@nxgt/material 3.7.5 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +39 -6
  3. package/bin/nxgt-theme.js +6 -0
  4. package/dist/{async-slice-o_fpqeGX.js → async-slice-DDjaJY_F.js} +2 -2
  5. package/dist/background--Bf_EbFR.js +159 -0
  6. package/dist/backgrounds/backgrounds.css +2 -0
  7. package/dist/backgrounds/css-react/moon.css +97 -0
  8. package/dist/backgrounds.js +3 -139
  9. package/dist/browser-only-DQ94lWF8.js +18 -0
  10. package/dist/bubble-input-B7BVd9fX.js +237 -0
  11. package/dist/{button--cF4gY14.js → button-DbfdITBB.js} +51 -57
  12. package/dist/charts.js +3 -3
  13. package/dist/{chip-D1B1dL77.js → chip-DpySRqCy.js} +2 -2
  14. package/dist/{client-only.utils-lQ7GqP8w.js → client-only.utils-3nHNzCki.js} +1 -1
  15. package/dist/{code-editor-0CdGwKDg.js → code-editor-BiA14xua.js} +7 -7
  16. package/dist/code-editor.js +6 -6
  17. package/dist/{code-language-items-CGARRbVm.js → code-language-items-C_dJ6GVs.js} +2 -2
  18. package/dist/components/theme-tokens.css +34 -35
  19. package/dist/components/tones/app-tones.css +2 -1
  20. package/dist/components/tones/containers.css +4 -1
  21. package/dist/components/tones/index.css +2 -0
  22. package/dist/components/tones/surface.css +1 -0
  23. package/dist/components/tones/tokens.css +8 -3
  24. package/dist/components/tones/zone-paint.css +15 -0
  25. package/dist/components/ui/feedback/toast/toast-tokens.css +1 -0
  26. package/dist/components/ui/layout/app-shell/activity-backdrop.css +26 -0
  27. package/dist/components/ui/layout/sidebar/sidebar-tokens.css +5 -2
  28. package/dist/components/ui/media/media-player/nxgt-media-player.css +7 -32
  29. package/dist/components/ui/primitives/field-box/field-box-tokens.css +5 -2
  30. package/dist/{components-CDrQCOsU.js → components-B9EIfMdd.js} +18622 -18531
  31. package/dist/components.js +24 -22
  32. package/dist/{dialog-DdJ1C4BR.js → dialog-CkIYpJXk.js} +55 -53
  33. package/dist/dist-B7RjY7SL.js +158 -0
  34. package/dist/dist-C4wtXCjf.js +593 -0
  35. package/dist/dist-DVRQkaTK.js +111 -0
  36. package/dist/dist-lmHmz_bu.js +419 -0
  37. package/dist/dnd.js +1 -1
  38. package/dist/dropdown-menu-BC5Tbhb9.js +908 -0
  39. package/dist/editor.js +527 -527
  40. package/dist/empty-state-s2CSjKXJ.js +126 -0
  41. package/dist/{escape-owner-B8k7DvFa.js → escape-owner-CripBce_.js} +2 -1
  42. package/dist/{field-blur-DFUazxsL.js → field-blur-DPLsMufs.js} +1 -1
  43. package/dist/{field-blur-context-Dw9ZAgBr.js → field-blur-context-1ZwJgsHE.js} +2 -2
  44. package/dist/has-text-content-Ds2dkHX_.js +10 -0
  45. package/dist/hooks.js +35 -33
  46. package/dist/{hover-card-D5iHS9q1.js → hover-card-Cox-tPDz.js} +41 -39
  47. package/dist/{i18n-provider-C6SBK_nO.js → i18n-provider-C6HhBw34.js} +1 -1
  48. package/dist/i18n.js +6 -6
  49. package/dist/{icon-badge-Bb5-73XP.js → icon-badge-q3Ve8gra.js} +3 -3
  50. package/dist/{icon-button-5A6Mrj6w.js → icon-button-DJcWpIhu.js} +2 -1
  51. package/dist/{in-dialog-AiwTD3DK.js → in-dialog-Vwkyp-M5.js} +6 -5
  52. package/dist/lib/backgrounds/background/available.d.ts +3 -3
  53. package/dist/lib/backgrounds/background/background.d.ts +7 -3
  54. package/dist/lib/backgrounds/background/types.d.ts +7 -1
  55. package/dist/lib/backgrounds/index.d.ts +1 -1
  56. package/dist/lib/components/ui/layout/app-shell/activity-chrome.d.ts +17 -0
  57. package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +6 -4
  58. package/dist/lib/components/ui/layout/app-shell/backdrop-layer.d.ts +11 -0
  59. package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +17 -0
  60. package/dist/lib/components/ui/layout/app-shell/theme-backdrop.d.ts +6 -0
  61. package/dist/lib/components/ui/layout/app-shell/use-activity-backdrop.d.ts +18 -0
  62. package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +9 -0
  63. package/dist/lib/hooks/resolve-theme.d.ts +46 -1
  64. package/dist/lib/hooks/theme-store.d.ts +35 -4
  65. package/dist/lib/hooks/use-theme.d.ts +20 -4
  66. package/dist/lib/i18n/resources/en/en.d.ts +4 -0
  67. package/dist/lib/i18n/resources/en/material.json.d.ts +4 -0
  68. package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
  69. package/dist/lib/i18n/resources/fr/material.json.d.ts +4 -0
  70. package/dist/lib/i18n/resources/resources.d.ts +8 -0
  71. package/dist/lib/i18n/translator.d.ts +1 -1
  72. package/dist/lib/theme-picker/index.d.ts +7 -0
  73. package/dist/lib/theme-picker/partials/mini-background.d.ts +10 -0
  74. package/dist/lib/theme-picker/partials/mode-control.d.ts +5 -0
  75. package/dist/lib/theme-picker/partials/theme-tile.d.ts +12 -0
  76. package/dist/lib/theme-picker/theme-label.d.ts +7 -0
  77. package/dist/lib/theme-picker/theme-picker.d.ts +25 -0
  78. package/dist/lib/themes/index.d.ts +14 -0
  79. package/dist/lib/themes/nxgt-theme-provider.d.ts +29 -0
  80. package/dist/lib/themes/nxgt-theme.d.ts +22 -0
  81. package/dist/lib/themes/theme-context.d.ts +28 -0
  82. package/dist/lib/themes/theme-value.d.ts +5 -0
  83. package/dist/lib/vite/index.d.ts +1 -1
  84. package/dist/lib.js +3 -3
  85. package/dist/main.js +43 -39
  86. package/dist/map.js +8 -8
  87. package/dist/material.css +1 -1
  88. package/dist/nxgt-theme-CgSb9Obl.js +37 -0
  89. package/dist/pdf-reader.js +1 -1
  90. package/dist/print.js +2 -2
  91. package/dist/{public-SsiazLEv.js → public-Ce30uvp0.js} +591 -587
  92. package/dist/read-storage-C2J90bNm.js +10 -0
  93. package/dist/{rich-code-block-CwNwQs5z.js → rich-code-block-C2Fp_FDU.js} +5 -5
  94. package/dist/{sortable-provider-BvD98s8Y.js → sortable-provider-pVaEZzty.js} +3 -3
  95. package/dist/{spinner-CtGCPza-.js → spinner-CsHcmcpF.js} +2 -2
  96. package/dist/{stored-language-Bb7yX5uE.js → stored-language-BeIKw3-K.js} +15 -15
  97. package/dist/styles.css +8 -1
  98. package/dist/theme-context-BagPvRcz.js +16 -0
  99. package/dist/theme-picker.js +118 -0
  100. package/dist/theme-store-CSl51uNH.js +91 -0
  101. package/dist/theme-toggle-C8os82b4.js +48 -0
  102. package/dist/themes.js +42 -0
  103. package/dist/toggle-group-j8zaxEg1.js +69 -0
  104. package/dist/{toolbar-items-DsDDD5AY.js → toolbar-items-CqHvlTU8.js} +443 -589
  105. package/dist/tooltip-rhbqNmr3.js +1064 -0
  106. package/dist/{translate-material-Bsjc4Tow.js → translate-material-CGZljjp1.js} +2 -2
  107. package/dist/{translator-or2y0JJB.js → translator-DCYO4Ij3.js} +3 -3
  108. package/dist/{use-background-activity-B8jLHNop.js → use-background-activity-KxQgelFF.js} +1 -1
  109. package/dist/{use-chat-composer-DZ01a16D.js → use-chat-composer-CDrgWGMM.js} +4684 -4886
  110. package/dist/{use-heading-spy-ByOQNnFZ.js → use-heading-spy-DXo6IOX9.js} +52 -121
  111. package/dist/{use-material-translation-hLQzOjF0.js → use-material-translation-DkxcLbLM.js} +2 -2
  112. package/dist/use-slice-reducer-BGkeGtML.js +42 -0
  113. package/dist/use-theme-Cd-aiDJo.js +31 -0
  114. package/docs/README.md +2 -1
  115. package/docs/components/foundations.md +39 -0
  116. package/docs/components/navigation-and-layout.md +3 -3
  117. package/docs/getting-started.md +1 -1
  118. package/docs/guides/app-shell.md +41 -6
  119. package/docs/guides/backgrounds.md +43 -7
  120. package/docs/guides/i18n.md +1 -1
  121. package/docs/guides/themes.md +103 -0
  122. package/docs/guides/theming.md +288 -84
  123. package/docs/guides/vite-plugin.md +26 -0
  124. package/docs/previews/backgrounds-background-from-theme.webp +0 -0
  125. package/docs/previews/backgrounds-geometry-more.webp +0 -0
  126. package/docs/previews/backgrounds-geometry.webp +0 -0
  127. package/docs/previews/backgrounds-illustrated-scenes.webp +0 -0
  128. package/docs/previews/backgrounds-light-more.webp +0 -0
  129. package/docs/previews/backgrounds-light.webp +0 -0
  130. package/docs/previews/backgrounds-material-more.webp +0 -0
  131. package/docs/previews/backgrounds-matrix.webp +0 -0
  132. package/docs/previews/backgrounds-moon.webp +0 -0
  133. package/docs/previews/backgrounds-motif-shapes.webp +0 -0
  134. package/docs/previews/backgrounds-motifs.webp +0 -0
  135. package/docs/previews/foundations-themes-themepicker.webp +0 -0
  136. package/docs/roadmap.md +25 -0
  137. package/docs/troubleshooting.md +35 -7
  138. package/lib/backgrounds/backgrounds.css +2 -0
  139. package/lib/backgrounds/css-react/moon.css +97 -0
  140. package/lib/components/theme-tokens.css +34 -35
  141. package/lib/components/tones/app-tones.css +2 -1
  142. package/lib/components/tones/containers.css +4 -1
  143. package/lib/components/tones/index.css +2 -0
  144. package/lib/components/tones/surface.css +1 -0
  145. package/lib/components/tones/tokens.css +8 -3
  146. package/lib/components/tones/zone-paint.css +15 -0
  147. package/lib/components/ui/feedback/toast/toast-tokens.css +1 -0
  148. package/lib/components/ui/layout/app-shell/activity-backdrop.css +26 -0
  149. package/lib/components/ui/layout/sidebar/sidebar-tokens.css +5 -2
  150. package/lib/components/ui/media/media-player/nxgt-media-player.css +7 -32
  151. package/lib/components/ui/primitives/field-box/field-box-tokens.css +5 -2
  152. package/lib/styles.css +8 -1
  153. package/lib/theme-picker/theme-picker-list.css +29 -0
  154. package/lib/theme-picker/theme-picker.css +192 -0
  155. package/lib/theme-picker/theme-tile-background.css +77 -0
  156. package/lib/theme-picker/theme-tile-textures-night.css +63 -0
  157. package/lib/theme-picker/theme-tile-textures.css +153 -0
  158. package/lib/themes/ambre.css +134 -0
  159. package/lib/themes/ardoise.css +133 -0
  160. package/lib/themes/bleumono.css +136 -0
  161. package/lib/themes/bluemoon.css +136 -0
  162. package/lib/themes/corail.css +136 -0
  163. package/lib/themes/foret.css +133 -0
  164. package/lib/themes/lavande.css +133 -0
  165. package/lib/themes/menthe.css +136 -0
  166. package/lib/themes/ocean.css +136 -0
  167. package/lib/themes/pink.css +134 -0
  168. package/lib/themes/prune.css +133 -0
  169. package/lib/themes/sable.css +133 -0
  170. package/lib/themes/slate.css +133 -0
  171. package/lib/themes/teal.css +137 -0
  172. package/package.json +30 -2
  173. package/dist/dropdown-menu-DWtgUVW7.js +0 -1490
  174. package/dist/empty-state-CRWLQ1sM.js +0 -191
  175. package/dist/tooltip-tmFoTU_d.js +0 -1582
  176. package/dist/use-slice-reducer-0r5dXnJe.js +0 -58
@@ -0,0 +1,17 @@
1
+ /** Under a `backdrop`: the chrome's fill, from a token (activity-backdrop.css). */
2
+ export declare const CHROME_FILL = "bg-(--nxgt-backdrop-fill-chrome)";
3
+ /** The app bar: that fill, frosted (the blur is 0 when the user asks for less
4
+ * transparency). */
5
+ export declare const CHROME_FROSTED = "bg-(--nxgt-backdrop-fill-chrome) backdrop-blur-(--nxgt-backdrop-blur)";
6
+ /** The sidebar: a little more opaque than the app bar, for its text's contrast. */
7
+ export declare const NAV_FROSTED = "bg-(--nxgt-backdrop-fill-nav) backdrop-blur-(--nxgt-backdrop-blur)";
8
+ /**
9
+ * The top gutter, above the sticky app bar, stays in the viewport and hides
10
+ * what the page scrolls under it: the app bar's own fill, so nothing shows in
11
+ * the 8px strip. Not needed when the content region scrolls inside the frame.
12
+ * Without a `backdrop` it fades in over the first pixels of scroll
13
+ * (activity-backdrop.css), so the page at scroll top is as it always was.
14
+ */
15
+ export declare function ActivityGutterMask({ hasBackdrop }: {
16
+ hasBackdrop: boolean;
17
+ }): import("react").JSX.Element;
@@ -79,11 +79,13 @@ export type ActivityLayoutProps = {
79
79
  */
80
80
  routeTransition?: RouteTransition;
81
81
  /**
82
- * A decorative background drawn behind the frame, in place of the built-in
83
- * gradient and its three blobs: typically a `Background` preset from
82
+ * An exception to the theme's background, which the layout draws by
83
+ * default: under Lavande, or under no theme, the built-in gradient and its
84
+ * three blobs; under another theme, that theme's `background`. A node
85
+ * replaces it for this screen: typically a `Background` preset from
84
86
  * `@nxgt/material/backgrounds`. It fills the whole layout, sits under the
85
87
  * sidebar, the header and the content, and is `inert`, `aria-hidden` and
86
- * never takes a pointer. Leave it out and the gradient is drawn as before.
88
+ * never takes a pointer. `false` draws no background at all, a plain page.
87
89
  * The preset's stylesheet (`@nxgt/material/backgrounds.css`) is the app's to
88
90
  * import. See the app shell guide, "Use a background preset behind the shell".
89
91
  *
@@ -99,7 +101,7 @@ export type ActivityLayoutProps = {
99
101
  * </ActivityLayout>
100
102
  * ```
101
103
  */
102
- backdrop?: ReactNode;
104
+ backdrop?: ReactNode | false;
103
105
  } & ComponentProps<'div'>;
104
106
  /**
105
107
  * The application chrome: sidebar, header, breadcrumbs, and the routed content.
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * The layer behind the content column that holds the backdrop: the theme's
4
+ * background (`themed`) or the app's own node. It is `inert`, `aria-hidden`
5
+ * and takes no pointer, so what it draws is decoration only. A `Background`
6
+ * node keeps its shapes whole, as the theme's does (use-keep-shapes-inside.ts).
7
+ */
8
+ export declare function BackdropLayer({ backdrop, themed, }: {
9
+ backdrop: ReactNode;
10
+ themed: boolean;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ /** A box in the page's coordinates: what `getBoundingClientRect()` gives. */
2
+ export interface Box {
3
+ left: number;
4
+ top: number;
5
+ right: number;
6
+ bottom: number;
7
+ }
8
+ /** The space a shape keeps from the layer's edges and from the header band, in pixels. */
9
+ export declare const SHAPE_MARGIN = 8;
10
+ /**
11
+ * Whether a shape of the backdrop must not be drawn: it crosses an edge of the
12
+ * layer (or comes within `margin` of it), or it reaches the header band. The
13
+ * band is a list of horizontal strips (the app bar, the breadcrumb, the
14
+ * header card, an `EntityHeader`), full width: only their top and bottom count.
15
+ * A shape is kept or dropped whole, never cut.
16
+ */
17
+ export declare function shapeOutside(shape: Box, layer: Box, bands: readonly Box[], margin?: number): boolean;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The nearest theme's background, filling the backdrop layer (it reads the
3
+ * theme itself). Its shapes stay whole: none crosses the layer's edge or
4
+ * reaches the header band (use-keep-shapes-inside.ts).
5
+ */
6
+ export declare function ThemeBackdrop(): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * What ActivityLayout draws behind its frame. The theme's background is the
4
+ * default and `backdrop` the exception: `themeBackdrop` is a theme background
5
+ * other than Lavande's (which the built-in gradient is), `plain` is no
6
+ * background at all (`backdrop={false}`, or a theme without one), and
7
+ * `hasBackdrop` says the backdrop layer and the opaque chrome are in use.
8
+ * `attributes` are the root's `data-backdrop` / `data-plain`
9
+ * (activity-backdrop.css hides the built-in blobs and tint for either).
10
+ */
11
+ export declare function useActivityBackdrop(backdrop: ReactNode | false | undefined): {
12
+ themeBackdrop: boolean;
13
+ hasBackdrop: boolean;
14
+ attributes: {
15
+ 'data-backdrop': string | undefined;
16
+ 'data-plain': string | undefined;
17
+ };
18
+ };
@@ -0,0 +1,9 @@
1
+ /** A callback ref for the theme's `Background`, a child of the backdrop layer (it is loaded lazily, so it mounts after this hook). */
2
+ export declare function useKeepShapesInside(): (el: HTMLElement | null) => void;
3
+ /**
4
+ * The same for a `Background` the app passes as `backdrop`: a callback ref on
5
+ * the backdrop layer, which finds every preset (`[data-background]`) inside it
6
+ * whenever the layer's content changes, so a lazily loaded or swapped preset
7
+ * is kept whole too. Anything else in the layer (a custom node) is left alone.
8
+ */
9
+ export declare function useKeepNodeShapesInside(): (layer: HTMLElement | null) => void;
@@ -1,7 +1,52 @@
1
1
  export type ThemePreference = 'light' | 'dark' | 'system';
2
2
  export type ResolvedTheme = 'light' | 'dark';
3
- export declare function resolveTheme(stored: string | undefined | null, prefersDark: boolean): {
3
+ /**
4
+ * The mode shown: the stored preference, else `defaultMode` (what a first
5
+ * visit suggests: a theme's `colorScheme`, default `system`). `system`
6
+ * follows `prefers-color-scheme`.
7
+ */
8
+ export declare function resolveTheme(stored: string | undefined | null, prefersDark: boolean, defaultMode?: ThemePreference): {
4
9
  theme: ResolvedTheme;
5
10
  preference: ThemePreference;
6
11
  };
7
12
  export declare function applyResolvedTheme(theme: ResolvedTheme): void;
13
+ /**
14
+ * The theme names an app can use. Augment it, as `AppTones` is, with the
15
+ * app's own themes:
16
+ *
17
+ * ```ts
18
+ * declare module '@nxgt/material' {
19
+ * interface NxgtThemes { brand: true }
20
+ * }
21
+ * ```
22
+ */
23
+ export interface NxgtThemes {
24
+ lavande: true;
25
+ ocean: true;
26
+ foret: true;
27
+ ambre: true;
28
+ ardoise: true;
29
+ corail: true;
30
+ menthe: true;
31
+ prune: true;
32
+ sable: true;
33
+ slate: true;
34
+ pink: true;
35
+ bleumono: true;
36
+ bluemoon: true;
37
+ teal: true;
38
+ }
39
+ export type ThemeName = Extract<keyof NxgtThemes, string>;
40
+ /** The default theme: Lavande, which sets no `data-nxgt-theme`. */
41
+ export declare const DEFAULT_THEME: "lavande";
42
+ /**
43
+ * A stored name when it is a known theme (any well-formed name when `known` is
44
+ * left out), else `fallback`. A name that is no longer known resolves to the
45
+ * default.
46
+ */
47
+ export declare function resolveThemeName(stored: string | null | undefined, known: readonly string[] | undefined, fallback: string): string;
48
+ /**
49
+ * Puts the name on `<html data-nxgt-theme>`; the default, Lavande, takes the
50
+ * attribute off, as the boot script never sets it. No-op without `document`.
51
+ */
52
+ export declare function applyThemeName(name: string): void;
@@ -1,9 +1,40 @@
1
1
  import { ThemePreference } from './resolve-theme.js';
2
- declare function readStored(): string | undefined;
2
+ /** The theme name's key: the same as core's `THEME_STORAGE_KEY` (a spec holds them together). */
3
+ export declare const THEME_NAME_KEY = "nxgt-theme";
3
4
  export declare const themeStore: {
4
- subscribe(listener: () => void): () => void;
5
- getSnapshot: typeof readStored;
5
+ subscribe: (listener: () => void) => () => void;
6
+ getSnapshot: () => string | undefined;
6
7
  getServerSnapshot: () => string | undefined;
7
- set(next: ThemePreference): void;
8
+ /**
9
+ * `system` clears the key, unless a first visit would not be `system`
10
+ * (`defaultMode`: a theme's `colorScheme`): then it is stored, or clearing
11
+ * it would bring the suggestion back.
12
+ */
13
+ set(next: ThemePreference, defaultMode?: ThemePreference): void;
14
+ };
15
+ /**
16
+ * The mounted `NxgtThemeProvider`, when there is one: it owns
17
+ * `<html data-nxgt-theme>`, so the store only stores. Its themes say which
18
+ * names are acceptable, and its default is what a cleared key means.
19
+ */
20
+ interface Owner {
21
+ known: readonly string[];
22
+ fallback: string;
23
+ }
24
+ export declare const themeNameStore: {
25
+ subscribe: (listener: () => void) => () => void;
26
+ getSnapshot: () => string | undefined;
27
+ getServerSnapshot: () => string | undefined;
28
+ /**
29
+ * Called by the provider while it is mounted; the returned function gives
30
+ * the attribute back to the store.
31
+ */
32
+ claim(next: Owner): () => void;
33
+ /**
34
+ * Stores the name (JSON, like `theme`). Without a provider it also applies
35
+ * it to `<html>`; under one, a name the provider does not know is ignored
36
+ * (with a warning in development) and the provider writes the attribute.
37
+ */
38
+ set(next: string): void;
8
39
  };
9
40
  export {};
@@ -1,12 +1,28 @@
1
- import { ThemePreference } from './resolve-theme.js';
1
+ import { ThemeName, ThemePreference } from './resolve-theme.js';
2
+ export interface UseThemeOptions {
3
+ /**
4
+ * The mode when none is stored. Default: the one `NxgtThemeProvider`
5
+ * gives (its `defaultMode`, else the active theme's `colorScheme`), else
6
+ * `'system'`.
7
+ */
8
+ defaultMode?: ThemePreference;
9
+ }
2
10
  /**
3
11
  * The resolved theme and the stored preference. Every caller reads the same
4
12
  * store, so a toggle anywhere re-renders every reader (CodeBlock, CodeEditor…).
5
- * On the server, and while hydrating, the preference is `'system'`.
13
+ * On the server, and while hydrating, the preference is the first-visit one
14
+ * (`'system'` unless a provider or `defaultMode` says otherwise) and the theme
15
+ * name is the default (`'lavande'`, or the provider's). The name is stored
16
+ * apart from the mode, under `nxgt-theme`; under a `NxgtThemeProvider` or a
17
+ * `NxgtTheme` zone, `themeName` is the nearest one's. With no provider, the
18
+ * stored preset's `colorScheme` is still the first-visit mode (`bluemoon`:
19
+ * dark); an app's own theme needs the provider, or `defaultMode`.
6
20
  */
7
- export declare function useTheme(): {
21
+ export declare function useTheme(options?: UseThemeOptions): {
8
22
  theme: import('./resolve-theme.js').ResolvedTheme;
9
23
  preference: ThemePreference;
10
24
  updateTheme: (next: ThemePreference) => void;
25
+ themeName: ThemeName;
26
+ setThemeName: (next: ThemeName) => void;
11
27
  };
12
- export type { ResolvedTheme, ThemePreference } from './resolve-theme.js';
28
+ export type { ResolvedTheme, ThemeName, ThemePreference, } from './resolve-theme.js';
@@ -1178,6 +1178,10 @@ export declare const en: {
1178
1178
  "rating-field": {
1179
1179
  star: string;
1180
1180
  };
1181
+ "theme-picker": {
1182
+ label: string;
1183
+ mode: string;
1184
+ };
1181
1185
  "theme-toggle": {
1182
1186
  light: string;
1183
1187
  dark: string;
@@ -1168,6 +1168,10 @@ declare const _default: {
1168
1168
  "rating-field": {
1169
1169
  "star": "{value} of {max}"
1170
1170
  },
1171
+ "theme-picker": {
1172
+ "label": "Theme",
1173
+ "mode": "Mode"
1174
+ },
1171
1175
  "theme-toggle": {
1172
1176
  "light": "Light",
1173
1177
  "dark": "Dark",
@@ -1178,6 +1178,10 @@ export declare const fr: {
1178
1178
  "rating-field": {
1179
1179
  star: string;
1180
1180
  };
1181
+ "theme-picker": {
1182
+ label: string;
1183
+ mode: string;
1184
+ };
1181
1185
  "theme-toggle": {
1182
1186
  light: string;
1183
1187
  dark: string;
@@ -1168,6 +1168,10 @@ declare const _default: {
1168
1168
  "rating-field": {
1169
1169
  "star": "{value} sur {max}"
1170
1170
  },
1171
+ "theme-picker": {
1172
+ "label": "Thème",
1173
+ "mode": "Mode"
1174
+ },
1171
1175
  "theme-toggle": {
1172
1176
  "light": "Clair",
1173
1177
  "dark": "Sombre",
@@ -1176,6 +1176,10 @@ export declare const resources: {
1176
1176
  "rating-field": {
1177
1177
  star: string;
1178
1178
  };
1179
+ "theme-picker": {
1180
+ label: string;
1181
+ mode: string;
1182
+ };
1179
1183
  "theme-toggle": {
1180
1184
  light: string;
1181
1185
  dark: string;
@@ -3838,6 +3842,10 @@ export declare const resources: {
3838
3842
  "rating-field": {
3839
3843
  star: string;
3840
3844
  };
3845
+ "theme-picker": {
3846
+ label: string;
3847
+ mode: string;
3848
+ };
3841
3849
  "theme-toggle": {
3842
3850
  light: string;
3843
3851
  dark: string;