@ttoss/fsl-theme 1.1.13 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/Types-BiBa17RL.d.cts +1427 -0
  2. package/dist/Types-BiBa17RL.d.mts +1427 -0
  3. package/dist/baseBundle-DxvXyhGa.mjs +17 -0
  4. package/dist/baseBundle-iEFf5nqT.cjs +22 -0
  5. package/dist/{esm/chunk-SE5Z52RE.js → createTheme-BLNYztZU.mjs} +76 -172
  6. package/dist/createTheme-Cv6RP9D6.cjs +1825 -0
  7. package/dist/css.cjs +48 -0
  8. package/dist/{css.d.ts → css.d.cts} +67 -63
  9. package/dist/css.d.mts +168 -0
  10. package/dist/css.mjs +42 -0
  11. package/dist/dataviz/index.cjs +45 -0
  12. package/dist/dataviz/{index.d.ts → index.d.cts} +9 -5
  13. package/dist/dataviz/index.d.mts +66 -0
  14. package/dist/dataviz/index.mjs +39 -0
  15. package/dist/dtcg.cjs +115 -0
  16. package/dist/{dtcg.d.ts → dtcg.d.cts} +9 -7
  17. package/dist/dtcg.d.mts +51 -0
  18. package/dist/dtcg.mjs +112 -0
  19. package/dist/helpers-4p4-QVt_.cjs +258 -0
  20. package/dist/helpers-CaswNJMy.mjs +211 -0
  21. package/dist/{index.d.ts → index-CsIjfw86.d.cts} +42 -34
  22. package/dist/index-nJrjI0BA.d.mts +94 -0
  23. package/dist/index.cjs +16 -0
  24. package/dist/index.d.cts +6 -0
  25. package/dist/index.d.mts +6 -0
  26. package/dist/index.mjs +7 -0
  27. package/dist/{react.d.ts → react-CGa6FlNL.d.cts} +130 -106
  28. package/dist/react-DnKxR2gK.d.mts +370 -0
  29. package/dist/react-EUwpdvY7.cjs +481 -0
  30. package/dist/react.cjs +12 -0
  31. package/dist/react.d.cts +4 -0
  32. package/dist/react.d.mts +4 -0
  33. package/dist/react.mjs +412 -0
  34. package/dist/runtime-entry.cjs +9 -0
  35. package/dist/runtime-entry.d.cts +3 -0
  36. package/dist/runtime-entry.d.mts +3 -0
  37. package/dist/runtime-entry.mjs +3 -0
  38. package/dist/{runtime-entry.d.ts → ssrScript-BVysxDws.d.cts} +26 -23
  39. package/dist/ssrScript-BVysxDws.d.mts +98 -0
  40. package/dist/ssrScript-CRfrN8Pm.cjs +202 -0
  41. package/dist/ssrScript-D3kGPQpi.mjs +179 -0
  42. package/dist/themes/bruttal.cjs +75 -0
  43. package/dist/themes/bruttal.d.cts +3 -0
  44. package/dist/themes/bruttal.d.mts +3 -0
  45. package/dist/themes/bruttal.mjs +72 -0
  46. package/dist/themes/corporate.cjs +34 -0
  47. package/dist/themes/corporate.d.cts +3 -0
  48. package/dist/themes/corporate.d.mts +3 -0
  49. package/dist/{esm/chunk-TPMN75JM.js → themes/corporate.mjs} +7 -5
  50. package/dist/themes/oca.cjs +34 -0
  51. package/dist/themes/oca.d.cts +3 -0
  52. package/dist/themes/oca.d.mts +3 -0
  53. package/dist/{esm/chunk-DU4QDQUC.js → themes/oca.mjs} +7 -5
  54. package/dist/themes/ventures.cjs +34 -0
  55. package/dist/themes/ventures.d.cts +3 -0
  56. package/dist/themes/ventures.d.mts +3 -0
  57. package/dist/{esm/chunk-BXKVVQEP.js → themes/ventures.mjs} +7 -5
  58. package/dist/toCssVars-CYZCe-on.mjs +286 -0
  59. package/dist/toCssVars-DudHKvt2.cjs +297 -0
  60. package/dist/{esm/chunk-4Q4P3JBB.js → tokenRegistry-DjgSN3oU.mjs} +23 -20
  61. package/dist/tokenRegistry-OhaJ9sPJ.cjs +199 -0
  62. package/dist/vars.cjs +127 -0
  63. package/dist/{vars.d.ts → vars.d.cts} +8 -7
  64. package/dist/vars.d.mts +128 -0
  65. package/dist/vars.mjs +123 -0
  66. package/dist/withDataviz-B4pVsOwV.cjs +192 -0
  67. package/dist/{esm/chunk-FBVUI2PK.js → withDataviz-DY5s7R51.mjs} +40 -12
  68. package/package.json +6 -6
  69. package/dist/Types-6tR0_2Ss.d.ts +0 -1452
  70. package/dist/esm/chunk-5PWPAQMC.js +0 -9
  71. package/dist/esm/chunk-HRNXVRS3.js +0 -54
  72. package/dist/esm/chunk-IJGA42O6.js +0 -141
  73. package/dist/esm/chunk-PQPQNZ73.js +0 -262
  74. package/dist/esm/chunk-UMRQ4OTX.js +0 -11
  75. package/dist/esm/chunk-VL6EGE6Z.js +0 -222
  76. package/dist/esm/chunk-WVQSTQD5.js +0 -192
  77. package/dist/esm/css.js +0 -6
  78. package/dist/esm/dataviz/index.js +0 -19
  79. package/dist/esm/dtcg.js +0 -65
  80. package/dist/esm/index.js +0 -10
  81. package/dist/esm/react.js +0 -8
  82. package/dist/esm/runtime-entry.js +0 -4
  83. package/dist/esm/themes/bruttal.js +0 -6
  84. package/dist/esm/themes/corporate.js +0 -6
  85. package/dist/esm/themes/oca.js +0 -6
  86. package/dist/esm/themes/ventures.js +0 -6
  87. package/dist/esm/vars.js +0 -28
  88. package/dist/themes/bruttal.d.ts +0 -5
  89. package/dist/themes/corporate.d.ts +0 -5
  90. package/dist/themes/oca.d.ts +0 -5
  91. package/dist/themes/ventures.d.ts +0 -5
@@ -1,84 +1,85 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import { ThemeMode, ResolvedMode, ThemeScriptConfig } from './runtime-entry.js';
4
- import { a as ThemeBundle, S as SemanticTokens } from './Types-6tR0_2Ss.js';
5
1
 
2
+ import { n as SemanticTokens, r as ThemeBundle } from "./Types-BiBa17RL.cjs";
3
+ import { a as ResolvedMode, o as ThemeMode, t as ThemeScriptConfig } from "./ssrScript-BVysxDws.cjs";
4
+ import * as React from "react";
5
+
6
+ //#region src/react.d.ts
6
7
  /**
7
8
  * Props for the `ThemeProvider` component.
8
9
  */
9
10
  interface ThemeProviderProps {
10
- /** Mode to use when no persisted value is found. Only read on initial mount. @default 'system' */
11
- defaultMode?: ThemeMode;
12
- /** localStorage key for persistence. Only read on initial mount. @default 'tt-theme' */
13
- storageKey?: string;
14
- /**
15
- * Theme identifier written to `data-tt-theme`. Reactive — changing this
16
- * prop recreates the runtime and rewrites the attribute so the browser
17
- * matches the scoped CSS (e.g. `[data-tt-theme="<id>"]`). Provide only
18
- * for MFE / multi-theme CSS scoping (Storybook toolbar, runtime theme swap).
19
- */
20
- themeId?: string;
21
- /**
22
- * The theme bundle for the app — the canonical 1-theme / 2-mode model.
23
- *
24
- * Passing `theme` enables `useTokens()` and `useResolvedTokens()` for all
25
- * descendants, and automatically injects the CSS Custom Properties `<style>`
26
- * tag into the document head (React 19 hoisting).
27
- *
28
- * @example
29
- * ```tsx
30
- * import { createTheme } from '@ttoss/fsl-theme';
31
- * import { ThemeProvider } from '@ttoss/fsl-theme/react';
32
- *
33
- * const myTheme = createTheme();
34
- *
35
- * <ThemeProvider theme={myTheme}>
36
- * <App />
37
- * </ThemeProvider>
38
- * ```
39
- */
40
- theme?: ThemeBundle;
41
- /**
42
- * Called after each mode transition. Does **not** fire on initial mount —
43
- * only on subsequent user-triggered or system-triggered mode changes.
44
- *
45
- * Receives both `mode` (user intent: `'light' | 'dark' | 'system'`) and
46
- * `resolvedMode` (actual: `'light' | 'dark'`), covering all integration
47
- * needs in one callback.
48
- *
49
- * @example
50
- * ```tsx
51
- * <ThemeProvider
52
- * theme={myTheme}
53
- * onModeChange={(mode, resolvedMode) => {
54
- * analytics.track('modeChanged', { mode, resolvedMode });
55
- * }}
56
- * >
57
- * ```
58
- */
59
- onModeChange?: (mode: ThemeMode, resolvedMode: ResolvedMode) => void;
60
- /**
61
- * Root element to anchor `data-tt-theme` / `data-tt-mode` attributes.
62
- * Defaults to `document.documentElement`. Pass a container element for
63
- * Storybook isolation or micro-frontend use cases.
64
- *
65
- * Because the element is often `null` on the first render when passed via
66
- * `ref.current`, `root` is reactive: the runtime is recreated once when
67
- * it transitions from `undefined` to the actual element.
68
- *
69
- * @example
70
- * ```tsx
71
- * // Storybook decorator — isolates each story from <html>
72
- * const rootRef = React.useRef<HTMLDivElement>(null);
73
- * <div ref={rootRef}>
74
- * <ThemeProvider theme={myTheme} root={rootRef.current ?? undefined}>
75
- * <Story />
76
- * </ThemeProvider>
77
- * </div>
78
- * ```
79
- */
80
- root?: HTMLElement;
81
- children: React.ReactNode;
11
+ /** Mode to use when no persisted value is found. Only read on initial mount. @default 'system' */
12
+ defaultMode?: ThemeMode;
13
+ /** localStorage key for persistence. Only read on initial mount. @default 'tt-theme' */
14
+ storageKey?: string;
15
+ /**
16
+ * Theme identifier written to `data-tt-theme`. Reactive — changing this
17
+ * prop recreates the runtime and rewrites the attribute so the browser
18
+ * matches the scoped CSS (e.g. `[data-tt-theme="<id>"]`). Provide only
19
+ * for MFE / multi-theme CSS scoping (Storybook toolbar, runtime theme swap).
20
+ */
21
+ themeId?: string;
22
+ /**
23
+ * The theme bundle for the app — the canonical 1-theme / 2-mode model.
24
+ *
25
+ * Passing `theme` enables `useTokens()` and `useResolvedTokens()` for all
26
+ * descendants, and automatically injects the CSS Custom Properties `<style>`
27
+ * tag into the document head (React 19 hoisting).
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * import { createTheme } from '@ttoss/fsl-theme';
32
+ * import { ThemeProvider } from '@ttoss/fsl-theme/react';
33
+ *
34
+ * const myTheme = createTheme();
35
+ *
36
+ * <ThemeProvider theme={myTheme}>
37
+ * <App />
38
+ * </ThemeProvider>
39
+ * ```
40
+ */
41
+ theme?: ThemeBundle;
42
+ /**
43
+ * Called after each mode transition. Does **not** fire on initial mount —
44
+ * only on subsequent user-triggered or system-triggered mode changes.
45
+ *
46
+ * Receives both `mode` (user intent: `'light' | 'dark' | 'system'`) and
47
+ * `resolvedMode` (actual: `'light' | 'dark'`), covering all integration
48
+ * needs in one callback.
49
+ *
50
+ * @example
51
+ * ```tsx
52
+ * <ThemeProvider
53
+ * theme={myTheme}
54
+ * onModeChange={(mode, resolvedMode) => {
55
+ * analytics.track('modeChanged', { mode, resolvedMode });
56
+ * }}
57
+ * >
58
+ * ```
59
+ */
60
+ onModeChange?: (mode: ThemeMode, resolvedMode: ResolvedMode) => void;
61
+ /**
62
+ * Root element to anchor `data-tt-theme` / `data-tt-mode` attributes.
63
+ * Defaults to `document.documentElement`. Pass a container element for
64
+ * Storybook isolation or micro-frontend use cases.
65
+ *
66
+ * Because the element is often `null` on the first render when passed via
67
+ * `ref.current`, `root` is reactive: the runtime is recreated once when
68
+ * it transitions from `undefined` to the actual element.
69
+ *
70
+ * @example
71
+ * ```tsx
72
+ * // Storybook decorator — isolates each story from <html>
73
+ * const rootRef = React.useRef<HTMLDivElement>(null);
74
+ * <div ref={rootRef}>
75
+ * <ThemeProvider theme={myTheme} root={rootRef.current ?? undefined}>
76
+ * <Story />
77
+ * </ThemeProvider>
78
+ * </div>
79
+ * ```
80
+ */
81
+ root?: HTMLElement;
82
+ children: React.ReactNode;
82
83
  }
83
84
  /**
84
85
  * React provider that manages theme switching via `createThemeRuntime`.
@@ -102,7 +103,15 @@ interface ThemeProviderProps {
102
103
  * );
103
104
  * ```
104
105
  */
105
- declare const ThemeProvider: ({ defaultMode, storageKey, theme, themeId, onModeChange, root, children, }: ThemeProviderProps) => react_jsx_runtime.JSX.Element;
106
+ declare const ThemeProvider: ({
107
+ defaultMode,
108
+ storageKey,
109
+ theme,
110
+ themeId,
111
+ onModeChange,
112
+ root,
113
+ children
114
+ }: ThemeProviderProps) => any;
106
115
  /**
107
116
  * Access mode state and the mode setter — without subscribing to theme changes.
108
117
  *
@@ -127,9 +136,9 @@ declare const ThemeProvider: ({ defaultMode, storageKey, theme, themeId, onModeC
127
136
  * ```
128
137
  */
129
138
  interface UseColorModeResult {
130
- mode: ThemeMode;
131
- resolvedMode: ResolvedMode;
132
- setMode: (mode: ThemeMode) => void;
139
+ mode: ThemeMode;
140
+ resolvedMode: ResolvedMode;
141
+ setMode: (mode: ThemeMode) => void;
133
142
  }
134
143
  declare const useColorMode: () => UseColorModeResult;
135
144
  /**
@@ -214,8 +223,8 @@ declare const useResolvedTokens: () => Record<string, string | number>;
214
223
  * Props for the `ThemeScript` component.
215
224
  */
216
225
  interface ThemeScriptProps extends ThemeScriptConfig {
217
- /** CSP nonce for the inline script. */
218
- nonce?: string;
226
+ /** CSP nonce for the inline script. */
227
+ nonce?: string;
219
228
  }
220
229
  /**
221
230
  * Renders an inline `<script>` that prevents theme flash on SSR/SSG.
@@ -239,26 +248,31 @@ interface ThemeScriptProps extends ThemeScriptConfig {
239
248
  * }
240
249
  * ```
241
250
  */
242
- declare const ThemeScript: ({ defaultTheme, defaultMode, storageKey, nonce, }?: ThemeScriptProps) => react_jsx_runtime.JSX.Element;
251
+ declare const ThemeScript: ({
252
+ defaultTheme,
253
+ defaultMode,
254
+ storageKey,
255
+ nonce
256
+ }?: ThemeScriptProps) => any;
243
257
  /**
244
258
  * Props for the `ThemeStyles` component.
245
259
  */
246
260
  interface ThemeStylesProps {
247
- /** The theme bundle to generate CSS for. */
248
- theme: ThemeBundle;
249
- /**
250
- * Theme identifier for CSS scoping (`[data-tt-theme="<themeId>"]`).
251
- *
252
- * **Omit in the canonical 1-theme model** — CSS targets `:root` and the
253
- * alternate mode selector becomes `:root[data-tt-mode="dark"]`. No theme
254
- * name repetition required.
255
- *
256
- * Pass `themeId` only for multi-theme scenarios (Storybook, micro-frontends,
257
- * apps with visual theme switching).
258
- */
259
- themeId?: string;
260
- /** CSP nonce for the inline style tag. */
261
- nonce?: string;
261
+ /** The theme bundle to generate CSS for. */
262
+ theme: ThemeBundle;
263
+ /**
264
+ * Theme identifier for CSS scoping (`[data-tt-theme="<themeId>"]`).
265
+ *
266
+ * **Omit in the canonical 1-theme model** — CSS targets `:root` and the
267
+ * alternate mode selector becomes `:root[data-tt-mode="dark"]`. No theme
268
+ * name repetition required.
269
+ *
270
+ * Pass `themeId` only for multi-theme scenarios (Storybook, micro-frontends,
271
+ * apps with visual theme switching).
272
+ */
273
+ themeId?: string;
274
+ /** CSP nonce for the inline style tag. */
275
+ nonce?: string;
262
276
  }
263
277
  /**
264
278
  * Renders an inline `<style>` tag with all CSS Custom Properties for a theme
@@ -302,15 +316,19 @@ interface ThemeStylesProps {
302
316
  * <ThemeStyles theme={brandB} themeId="brand-b" />
303
317
  * ```
304
318
  */
305
- declare const ThemeStyles: ({ theme, themeId, nonce }: ThemeStylesProps) => react_jsx_runtime.JSX.Element;
319
+ declare const ThemeStyles: ({
320
+ theme,
321
+ themeId,
322
+ nonce
323
+ }: ThemeStylesProps) => any;
306
324
  /**
307
325
  * Props for the `ThemeHead` component.
308
326
  */
309
327
  interface ThemeHeadProps extends ThemeStylesProps {
310
- /** Mode to use when no persisted value is found. @default 'system' */
311
- defaultMode?: ThemeMode;
312
- /** localStorage key for persistence. Must match `ThemeProvider`'s `storageKey`. @default 'tt-theme' */
313
- storageKey?: string;
328
+ /** Mode to use when no persisted value is found. @default 'system' */
329
+ defaultMode?: ThemeMode;
330
+ /** localStorage key for persistence. Must match `ThemeProvider`'s `storageKey`. @default 'tt-theme' */
331
+ storageKey?: string;
314
332
  }
315
333
  /**
316
334
  * Convenience component that renders both `<ThemeScript>` and `<ThemeStyles>`
@@ -341,6 +359,12 @@ interface ThemeHeadProps extends ThemeStylesProps {
341
359
  * }
342
360
  * ```
343
361
  */
344
- declare const ThemeHead: ({ theme, themeId, nonce, defaultMode, storageKey, }: ThemeHeadProps) => react_jsx_runtime.JSX.Element;
345
-
346
- export { ResolvedMode, ThemeHead, type ThemeHeadProps, ThemeMode, ThemeProvider, type ThemeProviderProps, ThemeScript, type ThemeScriptProps, ThemeStyles, type ThemeStylesProps, type UseColorModeResult, useColorMode, useResolvedTokens, useTokens };
362
+ declare const ThemeHead: ({
363
+ theme,
364
+ themeId,
365
+ nonce,
366
+ defaultMode,
367
+ storageKey
368
+ }: ThemeHeadProps) => any;
369
+ //#endregion
370
+ export { ThemeScript as a, ThemeStylesProps as c, useResolvedTokens as d, useTokens as f, ThemeProviderProps as i, UseColorModeResult as l, ThemeHeadProps as n, ThemeScriptProps as o, ThemeProvider as r, ThemeStyles as s, ThemeHead as t, useColorMode as u };
@@ -0,0 +1,370 @@
1
+
2
+ import { n as SemanticTokens, r as ThemeBundle } from "./Types-BiBa17RL.mjs";
3
+ import { a as ResolvedMode, o as ThemeMode, t as ThemeScriptConfig } from "./ssrScript-BVysxDws.mjs";
4
+ import * as React from "react";
5
+
6
+ //#region src/react.d.ts
7
+ /**
8
+ * Props for the `ThemeProvider` component.
9
+ */
10
+ interface ThemeProviderProps {
11
+ /** Mode to use when no persisted value is found. Only read on initial mount. @default 'system' */
12
+ defaultMode?: ThemeMode;
13
+ /** localStorage key for persistence. Only read on initial mount. @default 'tt-theme' */
14
+ storageKey?: string;
15
+ /**
16
+ * Theme identifier written to `data-tt-theme`. Reactive — changing this
17
+ * prop recreates the runtime and rewrites the attribute so the browser
18
+ * matches the scoped CSS (e.g. `[data-tt-theme="<id>"]`). Provide only
19
+ * for MFE / multi-theme CSS scoping (Storybook toolbar, runtime theme swap).
20
+ */
21
+ themeId?: string;
22
+ /**
23
+ * The theme bundle for the app — the canonical 1-theme / 2-mode model.
24
+ *
25
+ * Passing `theme` enables `useTokens()` and `useResolvedTokens()` for all
26
+ * descendants, and automatically injects the CSS Custom Properties `<style>`
27
+ * tag into the document head (React 19 hoisting).
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * import { createTheme } from '@ttoss/fsl-theme';
32
+ * import { ThemeProvider } from '@ttoss/fsl-theme/react';
33
+ *
34
+ * const myTheme = createTheme();
35
+ *
36
+ * <ThemeProvider theme={myTheme}>
37
+ * <App />
38
+ * </ThemeProvider>
39
+ * ```
40
+ */
41
+ theme?: ThemeBundle;
42
+ /**
43
+ * Called after each mode transition. Does **not** fire on initial mount —
44
+ * only on subsequent user-triggered or system-triggered mode changes.
45
+ *
46
+ * Receives both `mode` (user intent: `'light' | 'dark' | 'system'`) and
47
+ * `resolvedMode` (actual: `'light' | 'dark'`), covering all integration
48
+ * needs in one callback.
49
+ *
50
+ * @example
51
+ * ```tsx
52
+ * <ThemeProvider
53
+ * theme={myTheme}
54
+ * onModeChange={(mode, resolvedMode) => {
55
+ * analytics.track('modeChanged', { mode, resolvedMode });
56
+ * }}
57
+ * >
58
+ * ```
59
+ */
60
+ onModeChange?: (mode: ThemeMode, resolvedMode: ResolvedMode) => void;
61
+ /**
62
+ * Root element to anchor `data-tt-theme` / `data-tt-mode` attributes.
63
+ * Defaults to `document.documentElement`. Pass a container element for
64
+ * Storybook isolation or micro-frontend use cases.
65
+ *
66
+ * Because the element is often `null` on the first render when passed via
67
+ * `ref.current`, `root` is reactive: the runtime is recreated once when
68
+ * it transitions from `undefined` to the actual element.
69
+ *
70
+ * @example
71
+ * ```tsx
72
+ * // Storybook decorator — isolates each story from <html>
73
+ * const rootRef = React.useRef<HTMLDivElement>(null);
74
+ * <div ref={rootRef}>
75
+ * <ThemeProvider theme={myTheme} root={rootRef.current ?? undefined}>
76
+ * <Story />
77
+ * </ThemeProvider>
78
+ * </div>
79
+ * ```
80
+ */
81
+ root?: HTMLElement;
82
+ children: React.ReactNode;
83
+ }
84
+ /**
85
+ * React provider that manages theme switching via `createThemeRuntime`.
86
+ *
87
+ * Applies `data-tt-theme` and `data-tt-mode` on `<html>` (or `root`),
88
+ * persists to localStorage, and listens to system color scheme changes.
89
+ * When `theme` is provided, automatically injects CSS Custom Properties into
90
+ * the document `<head>` via React 19 style hoisting.
91
+ *
92
+ * @example
93
+ * ```tsx
94
+ * import { ThemeProvider } from '@ttoss/fsl-theme/react';
95
+ * import { createTheme } from '@ttoss/fsl-theme';
96
+ *
97
+ * const myTheme = createTheme();
98
+ *
99
+ * export const App = () => (
100
+ * <ThemeProvider theme={myTheme}>
101
+ * <YourApp />
102
+ * </ThemeProvider>
103
+ * );
104
+ * ```
105
+ */
106
+ declare const ThemeProvider: ({
107
+ defaultMode,
108
+ storageKey,
109
+ theme,
110
+ themeId,
111
+ onModeChange,
112
+ root,
113
+ children
114
+ }: ThemeProviderProps) => any;
115
+ /**
116
+ * Access mode state and the mode setter — without subscribing to theme changes.
117
+ *
118
+ * Consumers of `useColorMode()` only re-render on mode transitions, never on
119
+ * `themeId` changes. Use this for components that only need dark/light toggling
120
+ * (e.g. a sun/moon icon button) to avoid unnecessary re-renders.
121
+ *
122
+ * Must be used within a `<ThemeProvider>`.
123
+ *
124
+ * @example
125
+ * ```tsx
126
+ * import { useColorMode } from '@ttoss/fsl-theme/react';
127
+ *
128
+ * const DarkModeToggle = () => {
129
+ * const { resolvedMode, setMode } = useColorMode();
130
+ * return (
131
+ * <button onClick={() => setMode(resolvedMode === 'dark' ? 'light' : 'dark')}>
132
+ * {resolvedMode === 'dark' ? '☀️' : '🌙'}
133
+ * </button>
134
+ * );
135
+ * };
136
+ * ```
137
+ */
138
+ interface UseColorModeResult {
139
+ mode: ThemeMode;
140
+ resolvedMode: ResolvedMode;
141
+ setMode: (mode: ThemeMode) => void;
142
+ }
143
+ declare const useColorMode: () => UseColorModeResult;
144
+ /**
145
+ * Access the current theme's **semantic tokens only** — the structural tree
146
+ * with **unresolved** `TokenRef` values (e.g. `'{core.colors.brand.500}'`).
147
+ *
148
+ * ### Primary use cases
149
+ * - Introspection and devtools
150
+ * - Token path comparison (e.g. checking which tokens differ between themes)
151
+ * - Passing to `createTheme` calls
152
+ *
153
+ * ### ✗ Do not use for styling
154
+ * `TokenRef` values are reference strings, not CSS values. Using them in
155
+ * inline styles produces silently broken rendering:
156
+ *
157
+ * ```tsx
158
+ * // ✗ WRONG — tokens.colors.brand.main is '{core.colors.brand.main}', not '#FF0000'
159
+ * <div style={{ color: tokens.colors.brand.main }} />
160
+ *
161
+ * // ✓ CSS consumers — use vars:
162
+ * <div style={{ color: 'var(--tt-color-brand-main)' }} />
163
+ *
164
+ * // ✓ Non-CSS consumers (React Native, canvas) — use useResolvedTokens():
165
+ * const resolved = useResolvedTokens();
166
+ * <View style={{ backgroundColor: resolved['semantic.colors.action.primary.background.default'] }} />
167
+ * ```
168
+ *
169
+ * Requires `<ThemeProvider theme={...}>`.
170
+ *
171
+ * @example
172
+ * ```tsx
173
+ * import { useTokens } from '@ttoss/fsl-theme/react';
174
+ *
175
+ * const Button = () => {
176
+ * const tokens = useTokens(); // introspection only
177
+ * // tokens.colors.action.primary.background.default → '{core.colors.brand.500}'
178
+ * return <button style={{ background: 'var(--tt-action-primary-background-default)' }} />;
179
+ * };
180
+ * ```
181
+ */
182
+ declare const useTokens: () => SemanticTokens;
183
+ /**
184
+ * Access fully resolved token values as a flat `Record<string, string | number>`.
185
+ *
186
+ * All `{ref}` indirections are resolved to their final raw values — hex colors,
187
+ * px sizes, unitless numbers, etc. Keys use `semantic.*` dot-path notation.
188
+ *
189
+ * ### When to use
190
+ * Use in non-CSS environments where CSS custom properties (`var()`) are not
191
+ * available: React Native, canvas renderers, PDF generation, test assertions.
192
+ *
193
+ * ### ✗ Do not use for CSS rendering
194
+ * CSS consumers should use `vars.*` instead for zero-JS rendering:
195
+ *
196
+ * ```tsx
197
+ * // ✓ CSS (browser)
198
+ * <div style={{ color: 'var(--tt-color-informational-primary-default)' }} />
199
+ *
200
+ * // ✓ Non-CSS (React Native, canvas)
201
+ * const resolved = useResolvedTokens();
202
+ * <View style={{ backgroundColor: resolved['semantic.colors.action.primary.background.default'] }} />
203
+ * ```
204
+ *
205
+ * Requires `<ThemeProvider theme={...}>`.
206
+ *
207
+ * @example
208
+ * ```tsx
209
+ * import { useResolvedTokens } from '@ttoss/fsl-theme/react';
210
+ *
211
+ * const ReactNativeButton = () => {
212
+ * const resolved = useResolvedTokens();
213
+ * return (
214
+ * <View style={{ backgroundColor: resolved['semantic.colors.action.primary.background.default'] }}>
215
+ * <Text>Click</Text>
216
+ * </View>
217
+ * );
218
+ * };
219
+ * ```
220
+ */
221
+ declare const useResolvedTokens: () => Record<string, string | number>;
222
+ /**
223
+ * Props for the `ThemeScript` component.
224
+ */
225
+ interface ThemeScriptProps extends ThemeScriptConfig {
226
+ /** CSP nonce for the inline script. */
227
+ nonce?: string;
228
+ }
229
+ /**
230
+ * Renders an inline `<script>` that prevents theme flash on SSR/SSG.
231
+ *
232
+ * Place in the `<head>` before stylesheets.
233
+ *
234
+ * @example
235
+ * ```tsx
236
+ * // Next.js app/layout.tsx
237
+ * import { ThemeScript } from '@ttoss/fsl-theme/react';
238
+ *
239
+ * export default function RootLayout({ children }) {
240
+ * return (
241
+ * <html lang="en">
242
+ * <head>
243
+ * <ThemeScript defaultTheme="bruttal" />
244
+ * </head>
245
+ * <body>{children}</body>
246
+ * </html>
247
+ * );
248
+ * }
249
+ * ```
250
+ */
251
+ declare const ThemeScript: ({
252
+ defaultTheme,
253
+ defaultMode,
254
+ storageKey,
255
+ nonce
256
+ }?: ThemeScriptProps) => any;
257
+ /**
258
+ * Props for the `ThemeStyles` component.
259
+ */
260
+ interface ThemeStylesProps {
261
+ /** The theme bundle to generate CSS for. */
262
+ theme: ThemeBundle;
263
+ /**
264
+ * Theme identifier for CSS scoping (`[data-tt-theme="<themeId>"]`).
265
+ *
266
+ * **Omit in the canonical 1-theme model** — CSS targets `:root` and the
267
+ * alternate mode selector becomes `:root[data-tt-mode="dark"]`. No theme
268
+ * name repetition required.
269
+ *
270
+ * Pass `themeId` only for multi-theme scenarios (Storybook, micro-frontends,
271
+ * apps with visual theme switching).
272
+ */
273
+ themeId?: string;
274
+ /** CSP nonce for the inline style tag. */
275
+ nonce?: string;
276
+ }
277
+ /**
278
+ * Renders an inline `<style>` tag with all CSS Custom Properties for a theme
279
+ * bundle — including coarse-pointer, reduced-motion, and container query
280
+ * progressive enhancement blocks.
281
+ *
282
+ * Use as an escape hatch for SSR frameworks that need explicit `<head>` style
283
+ * injection. In most React apps, `<ThemeProvider theme={...}>` already injects
284
+ * styles automatically via React 19 style hoisting — no `<ThemeStyles>` needed.
285
+ *
286
+ * `dangerouslySetInnerHTML` is safe: content comes exclusively from
287
+ * `toCssVars()` (a pure internal function) — no user input is interpolated.
288
+ *
289
+ * @example
290
+ * ```tsx
291
+ * // SSR escape hatch — no themeId needed for canonical 1-theme model
292
+ * import { ThemeScript, ThemeStyles } from '@ttoss/fsl-theme/react';
293
+ * import { createTheme } from '@ttoss/fsl-theme';
294
+ *
295
+ * const myTheme = createTheme();
296
+ *
297
+ * export default function RootLayout({ children }) {
298
+ * return (
299
+ * <html lang="en">
300
+ * <head>
301
+ * <ThemeScript />
302
+ * <ThemeStyles theme={myTheme} />
303
+ * </head>
304
+ * <body>
305
+ * <ThemeProvider theme={myTheme}>{children}</ThemeProvider>
306
+ * </body>
307
+ * </html>
308
+ * );
309
+ * }
310
+ * ```
311
+ *
312
+ * @example
313
+ * ```tsx
314
+ * // Multi-theme: explicit themeId for CSS scoping
315
+ * <ThemeStyles theme={brandA} themeId="brand-a" />
316
+ * <ThemeStyles theme={brandB} themeId="brand-b" />
317
+ * ```
318
+ */
319
+ declare const ThemeStyles: ({
320
+ theme,
321
+ themeId,
322
+ nonce
323
+ }: ThemeStylesProps) => any;
324
+ /**
325
+ * Props for the `ThemeHead` component.
326
+ */
327
+ interface ThemeHeadProps extends ThemeStylesProps {
328
+ /** Mode to use when no persisted value is found. @default 'system' */
329
+ defaultMode?: ThemeMode;
330
+ /** localStorage key for persistence. Must match `ThemeProvider`'s `storageKey`. @default 'tt-theme' */
331
+ storageKey?: string;
332
+ }
333
+ /**
334
+ * Convenience component that renders both `<ThemeScript>` and `<ThemeStyles>`
335
+ * in a single line — the complete SSR `<head>` setup for flash-free theming.
336
+ *
337
+ * Use in SSR frameworks (Next.js, Remix) where you need explicit `<head>`
338
+ * injection. In CSR apps, `<ThemeProvider theme={...}>` handles everything.
339
+ *
340
+ * @example
341
+ * ```tsx
342
+ * // Next.js app/layout.tsx
343
+ * import { ThemeHead, ThemeProvider } from '@ttoss/fsl-theme/react';
344
+ * import { createTheme } from '@ttoss/fsl-theme';
345
+ *
346
+ * const myTheme = createTheme();
347
+ *
348
+ * export default function RootLayout({ children }) {
349
+ * return (
350
+ * <html lang="en">
351
+ * <head>
352
+ * <ThemeHead theme={myTheme} />
353
+ * </head>
354
+ * <body>
355
+ * <ThemeProvider theme={myTheme}>{children}</ThemeProvider>
356
+ * </body>
357
+ * </html>
358
+ * );
359
+ * }
360
+ * ```
361
+ */
362
+ declare const ThemeHead: ({
363
+ theme,
364
+ themeId,
365
+ nonce,
366
+ defaultMode,
367
+ storageKey
368
+ }: ThemeHeadProps) => any;
369
+ //#endregion
370
+ export { ThemeScript as a, ThemeStylesProps as c, useResolvedTokens as d, useTokens as f, ThemeProviderProps as i, UseColorModeResult as l, ThemeHeadProps as n, ThemeScriptProps as o, ThemeProvider as r, ThemeStyles as s, ThemeHead as t, useColorMode as u };