@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
@@ -3,7 +3,7 @@
3
3
  * after importing the stylesheet, under the same selectors. */
4
4
  :root {
5
5
  --radius: 0.625rem;
6
- --background: oklch(0.973 0.008 293.9);
6
+ --background: oklch(1 0 0);
7
7
  --foreground: oklch(0.227 0.017 290);
8
8
  --card: oklch(1 0 0);
9
9
  --card-foreground: oklch(0.227 0.017 290);
@@ -13,9 +13,8 @@
13
13
  --primary: oklch(46% 0.1135 276.35);
14
14
  --primary-foreground: oklch(0.984 0.003 247.858);
15
15
  /* Primary drawn as text or an icon on a normal surface (`text-primary-text`):
16
- the colour mixed 4 % toward black in light, which keeps it 7.3:1 or more on
17
- the violet page (7.9:1 on a Card; the colour itself gives 6.8:1 on the
18
- page); the dark theme lifts it. */
16
+ the colour mixed 4 % toward black in light, which keeps it 7.9:1 on
17
+ the white page and on a Card (the colour itself gives 7.3:1); the dark theme lifts it. */
19
18
  --primary-text: color-mix(in oklab, var(--primary) 96%, black);
20
19
  /* Primary drawn as a non-text mark (WCAG 1.4.11, 3:1): an indicator bar or dot,
21
20
  a selected or focused border, a ring, a spinner arc, a progress fill
@@ -23,7 +22,7 @@
23
22
  the dark theme lifts it. */
24
23
  --primary-indicator: var(--primary);
25
24
  /* --secondary, --success and --info are 0.02 darker than before: on the
26
- violet page tint (--background, 97.3 %) their own 15 % tonal tint gave the
25
+ former violet page tint (--background, 97.3 %) their own 15 % tonal tint gave the
27
26
  text 4.3 to 4.5:1; now 4.7:1 or more on the page and on a Card. */
28
27
  --secondary: oklch(48% 0.1135 245.65);
29
28
  --secondary-foreground: oklch(0.984 0.003 247.858);
@@ -58,8 +57,8 @@
58
57
  --destructive: var(--error);
59
58
  --border: oklch(0.912 0.016 293.7);
60
59
  --input: oklch(0.912 0.016 293.7);
61
- /* The focus indicator (WCAG 1.4.11, 3:1): 3.40:1 on --background, 3.69:1 on
62
- --card, 3.23:1 on --muted. */
60
+ /* The focus indicator (WCAG 1.4.11, 3:1): 3.68:1 on --background, 3.68:1 on
61
+ --card, 3.22:1 on --muted. */
63
62
  --ring: oklch(0.62 0.04 291);
64
63
  --chart-1: oklch(0.646 0.222 41.116);
65
64
  --chart-2: oklch(0.6 0.118 184.704);
@@ -98,41 +97,41 @@
98
97
 
99
98
  .dark,
100
99
  [data-theme="dark"] {
101
- --background: oklch(0.192 0.016 290.5);
100
+ --background: oklch(0.15 0.026 273);
102
101
  --foreground: oklch(0.943 0.012 291.3);
103
- --card: oklch(0.232 0.019 289.4);
102
+ --card: oklch(0.19 0.019 289.4);
104
103
  --card-foreground: oklch(0.943 0.012 291.3);
105
- --popover: oklch(0.232 0.019 289.4);
104
+ --popover: oklch(0.19 0.019 289.4);
106
105
  --popover-foreground: oklch(0.943 0.012 291.3);
107
106
  --primary: oklch(46% 0.1135 276.35);
108
107
  --primary-foreground: oklch(0.995 0.002 291.3);
109
108
  /* Mixed 60 % toward white (the tonal Button labels' recipe): readable as text
110
109
  on --background and --card. */
111
110
  --primary-text: color-mix(in oklab, var(--primary) 40%, white);
112
- /* --primary itself is 2.5:1 on --background, 2.3:1 on --card and 2.1:1 on
113
- --muted. Mixed 25 % toward white: 4.5:1, 4.1:1 and 3.7:1. */
111
+ /* --primary itself is 2.7:1 on --background, 2.5:1 on --card and 2.3:1 on
112
+ --muted. Mixed 25 % toward white: 4.8:1, 4.5:1 and 4.2:1. */
114
113
  --primary-indicator: color-mix(in oklab, var(--primary) 75%, white);
115
- /* Brighter than the light one: it is read as text on the dark surfaces (6.3:1
116
- on --background, 5.8:1 on --card; 4.6:1 on its own 15 % tonal tint over a
114
+ /* Brighter than the light one: it is read as text on the dark surfaces (6.8:1
115
+ on --background, 6.4:1 on --card; 5.1:1 on its own 15 % tonal tint over a
117
116
  Card). A filled secondary surface mixes it toward --background (the opaque
118
- 70 % mix) to keep 5.2:1 under its near-white text (4.9:1 over a Card). */
117
+ 70 % mix) to keep 5.4:1 under its near-white text (4.9:1 over a Card). */
119
118
  --secondary: oklch(0.675 0.1135 245.65);
120
119
  --secondary-foreground: oklch(0.995 0.002 291.3);
121
- --muted: oklch(0.27 0.022 290);
120
+ --muted: oklch(0.228 0.022 290);
122
121
  --muted-foreground: oklch(0.725 0.03 292.2);
123
- /* 3.5:1 on --background, 3.2:1 on --card; the fill 3.3:1 on the track. */
122
+ /* 3.7:1 on --background, 3.5:1 on --card; the fill 3.3:1 on the track. */
124
123
  --track: oklch(0.53 0.03 290);
125
124
  --track-fill: oklch(0.85 0.09 276.35);
126
125
  --tooltip: oklch(0.925 0.012 291.3);
127
126
  --tooltip-foreground: oklch(0.446 0.043 291);
128
- --accent: oklch(0.27 0.022 290);
127
+ --accent: oklch(0.25 0.022 290);
129
128
  --accent-foreground: oklch(0.943 0.012 291.3);
130
129
  --error: oklch(0.577 0.245 27.325);
131
130
  --error-foreground: oklch(0.995 0.002 291.3);
132
131
  /* --error stays the fill under near-white text; as text it would give only
133
- 3.9:1 on --background and 3.5:1 on --card. Lightened (76 % --error), 5.85
134
- and 5.35:1, and 4.78:1 on a focused error menu item (bg-error/20 over the
135
- popover; 4.45:1 at the former 80 %, which missed 4.5:1 once rendered). */
132
+ 4.0:1 on --background and 3.8:1 on --card. Lightened (76 % --error), 6.25
133
+ and 5.9:1, and 5.2:1 on a focused error menu item (bg-error/20 over the
134
+ popover; the former 80 % missed 4.5:1 once rendered). */
136
135
  --error-text: color-mix(in oklab, var(--error) 76%, white);
137
136
  /* The light brights: on the dark surfaces they read as text and as the
138
137
  badge's 60% tint, which keeps its contrast under near-white text (success
@@ -141,15 +140,15 @@
141
140
  --success-foreground: oklch(0.995 0.002 291.3);
142
141
  --info: oklch(0.707 0.165 254.624);
143
142
  --info-foreground: oklch(0.995 0.002 291.3);
144
- /* Amber too, as text: 6.7:1 on --background and 6.1:1 on --card, 5.9:1 and
145
- 5.3:1 on its 10% tint; the badge's 60% fill under near-white text is
146
- 5.8:1 on a page and 5.5:1 on a Card. */
143
+ /* Amber too, as text: 7.2:1 on --background and 6.7:1 on --card, 6.4:1 and
144
+ 5.9:1 on its 10% tint; the badge's 60% fill under near-white text is
145
+ 6.1:1 on a page and 5.8:1 on a Card. */
147
146
  --warning: oklch(0.7 0.15 70);
148
147
  --warning-foreground: oklch(0.995 0.002 291.3);
149
148
  --destructive: oklch(0.704 0.191 22.216);
150
- --border: oklch(0.301 0.025 291.4);
151
- --input: oklch(0.34 0.027 291.4);
152
- /* 3.78:1 on --background, 3.45:1 on --card, 3.09:1 on --muted. */
149
+ --border: oklch(0.259 0.025 291.4);
150
+ --input: oklch(0.298 0.027 291.4);
151
+ /* 4.05:1 on --background, 3.80:1 on --card, 3.50:1 on --muted. */
153
152
  --ring: oklch(0.551 0.03 290);
154
153
  --chart-1: oklch(0.488 0.243 264.376);
155
154
  --chart-2: oklch(0.696 0.17 162.48);
@@ -158,8 +157,8 @@
158
157
  --chart-5: oklch(0.645 0.246 16.439);
159
158
  /* The soft palette on the dark card: mid-tone fills (L 0.49, the sand a
160
159
  warmer 0.5 0.1 75), light inks of the same hues. Ink on the card:
161
- 1 8.44:1, 2 9.46, 3 10.17, 4 8.03, 5 8.06; at the 0.85 dim 6.17:1 or
162
- more. Ink on its own fill (the outline): 1 3.13:1, 2 3.40, 3 3.69,
160
+ 1 9.27:1, 2 10.38, 3 11.20, 4 8.82, 5 8.85; at the 0.85 dim 6.66:1 or
161
+ more. Ink on its own fill (the outline): 1 3.13:1, 2 3.38, 3 3.69,
163
162
  4 3.11, 5 3.13. Every pair at least 54 degrees and ΔEOK 0.109 apart. */
164
163
  --chart-soft-1: oklch(0.49 0.08 255);
165
164
  --chart-soft-1-ink: oklch(0.78 0.1 255);
@@ -171,13 +170,13 @@
171
170
  --chart-soft-4-ink: oklch(0.78 0.13 310);
172
171
  --chart-soft-5: oklch(0.49 0.09 25);
173
172
  --chart-soft-5-ink: oklch(0.78 0.11 25);
174
- --sidebar: oklch(0.232 0.019 289.4);
173
+ --sidebar: oklch(0.19 0.019 289.4);
175
174
  --sidebar-foreground: oklch(0.943 0.012 291.3);
176
175
  --sidebar-primary: oklch(0.488 0.243 264.376);
177
176
  --sidebar-primary-foreground: oklch(0.995 0.002 291.3);
178
- --sidebar-accent: oklch(0.27 0.022 290);
177
+ --sidebar-accent: oklch(0.228 0.022 290);
179
178
  --sidebar-accent-foreground: oklch(0.943 0.012 291.3);
180
- --sidebar-border: oklch(0.301 0.025 291.4);
179
+ --sidebar-border: oklch(0.259 0.025 291.4);
181
180
  --sidebar-ring: oklch(0.551 0.03 290);
182
181
  }
183
182
 
@@ -188,10 +187,10 @@
188
187
  --tertiary-foreground: oklch(0.984 0.003 247.858);
189
188
  }
190
189
 
191
- /* Dark: lifted like --secondary, as it is read as text (6.5:1 on --background,
192
- 5.9:1 on --card); its foreground is the dark surface, 6.5:1 on the fill. */
190
+ /* Dark: lifted like --secondary, as it is read as text (6.9:1 on --background,
191
+ 6.5:1 on --card); its foreground is the dark surface, 6.9:1 on the fill. */
193
192
  .dark,
194
193
  [data-theme="dark"] {
195
194
  --tertiary: oklch(0.7 0.15 310.75);
196
- --tertiary-foreground: oklch(0.192 0.016 290.5);
195
+ --tertiary-foreground: oklch(0.15 0.026 273);
197
196
  }
@@ -58,7 +58,8 @@
58
58
  /* White on a tone of relative luminance up to 0.179, black above: from
59
59
  * there each is 4.5:1 or more (white needs 0.183 or less, black 0.175 or
60
60
  * more). r, g and b are the tone's linear sRGB channels. */
61
- :root {
61
+ :root,
62
+ [data-nxgt-theme] {
62
63
  --nxgt-tone-on-channel: clamp(
63
64
  0,
64
65
  (0.179 - (0.2126 * r + 0.7152 * g + 0.0722 * b)) *
@@ -15,6 +15,7 @@
15
15
  * (the tone held at a container's lightness, set below where relative colour
16
16
  * syntax works, the tone's text colour where it does not). */
17
17
  :root,
18
+ [data-nxgt-theme],
18
19
  .dark,
19
20
  [data-theme="dark"] {
20
21
  --primary-container: var(
@@ -131,7 +132,9 @@
131
132
  * text colour above. */
132
133
  @supports (color: oklch(from red clamp(0, l, 0.5) c h)) {
133
134
  .dark,
134
- [data-theme="dark"] {
135
+ [data-theme="dark"],
136
+ :is(.dark, [data-theme="dark"]) [data-nxgt-theme],
137
+ [data-nxgt-theme]:is(.dark, [data-theme="dark"]) {
135
138
  --nxgt-primary-container-base: oklch(
136
139
  from var(--primary)
137
140
  clamp(var(--nxgt-tone-container-min), l, var(--nxgt-tone-container-max))
@@ -8,6 +8,7 @@
8
8
  * surface.css the surface a channel container is mixed over
9
9
  * channel.css --nxgt-tone* of a named tone, and its container and ring
10
10
  * app-tones.css the derivation for an app's own tone
11
+ * zone-paint.css a theme zone paints its own text (and a forced mode its background)
11
12
  *
12
13
  * The sidebar's active tokens are in ui/layout/sidebar/sidebar-tokens.css.
13
14
  *
@@ -34,3 +35,4 @@
34
35
  @import "./surface.css";
35
36
  @import "./channel.css";
36
37
  @import "./app-tones.css";
38
+ @import "./zone-paint.css";
@@ -5,6 +5,7 @@
5
5
  * unlayered, like theme-tokens.css. */
6
6
  @layer base {
7
7
  :root,
8
+ [data-nxgt-theme],
8
9
  .dark,
9
10
  [data-theme="dark"] {
10
11
  --nxgt-tone-surface: var(--background);
@@ -1,4 +1,5 @@
1
- :root {
1
+ :root,
2
+ [data-nxgt-theme] {
2
3
  /* Tints over the page. Hover, selected and strong are the alpha of the
3
4
  * selection and hover surfaces; the container tint is the share of the tone
4
5
  * in `--<tone>-container`. For apps: no rule of the library reads hover,
@@ -64,7 +65,9 @@
64
65
  }
65
66
 
66
67
  .dark,
67
- [data-theme="dark"] {
68
+ [data-theme="dark"],
69
+ :is(.dark, [data-theme="dark"]) [data-nxgt-theme],
70
+ [data-nxgt-theme]:is(.dark, [data-theme="dark"]) {
68
71
  /* 24 % of the tone's text colour where the browser cannot derive the
69
72
  * container's base (no relative colour syntax): the shares below hold its
70
73
  * text at 4.5:1. */
@@ -111,7 +114,9 @@
111
114
  * or more (the named tones' and an app tone's, on the page and on a card). */
112
115
  @supports (color: oklch(from red clamp(0, l, 0.5) c h)) {
113
116
  .dark,
114
- [data-theme="dark"] {
117
+ [data-theme="dark"],
118
+ :is(.dark, [data-theme="dark"]) [data-nxgt-theme],
119
+ [data-nxgt-theme]:is(.dark, [data-theme="dark"]) {
115
120
  --nxgt-tint-container: 45%;
116
121
  --nxgt-tint-status: 45%;
117
122
  }
@@ -0,0 +1,15 @@
1
+ /* A theme zone paints its own text: it sets the colour tokens below :root, so
2
+ * the colour it inherits would be the page's. A zone with a forced mode
3
+ * (`NxgtTheme mode`, `data-theme`) also paints its own background, since the
4
+ * page's would be the other mode's. `@layer base`, so a utility on the zone
5
+ * still wins. Lavande on <html> with no zone is untouched. React only (the
6
+ * zones are, until the Vue port). */
7
+ @layer base {
8
+ [data-nxgt-theme] {
9
+ color: var(--foreground);
10
+ }
11
+ [data-nxgt-theme][data-theme="dark"],
12
+ [data-nxgt-theme][data-theme="light"] {
13
+ background: var(--background);
14
+ }
15
+ }
@@ -8,6 +8,7 @@
8
8
  * outside a Toaster it changes nothing. */
9
9
  @layer components {
10
10
  :root,
11
+ [data-nxgt-theme],
11
12
  .dark,
12
13
  [data-theme="dark"] {
13
14
  --nxgt-toast-success-text: var(--success-text);
@@ -25,6 +25,15 @@
25
25
  * fallback is their usual surface, through `--nxgt-backdrop-fill-*`: a utility
26
26
  * class outranks any rule in a layer, so a rule here could not set them. */
27
27
  @layer components {
28
+ /* `backdrop={false}`, or a theme with no background: a plain page, no
29
+ * gradient and no blobs. The chrome keeps its usual fills. */
30
+ [data-slot="activity-layout"][data-plain] {
31
+ background-image: none;
32
+ }
33
+ [data-slot="activity-layout"][data-plain] > [data-layer] {
34
+ display: none;
35
+ }
36
+
28
37
  /* The gutter mask without a backdrop (activity-layout.tsx) has the app bar's
29
38
  * translucent fill, which the page's top gutter never had: it fades in over
30
39
  * the first 8px of scroll, so at scroll top nothing changed. A browser
@@ -68,6 +77,23 @@
68
77
  display: none;
69
78
  }
70
79
 
80
+ /* The theme's backdrop keeps its shapes whole (use-keep-shapes-inside.ts):
81
+ * the scene waits for the first pass, then a shape that would cross the
82
+ * layer's edge or reach the header band is hidden, never cut. */
83
+ [data-keep-inside]:not([data-checked]) .mo,
84
+ [data-slot="activity-layout-backdrop"]
85
+ [data-background]:not([data-checked])
86
+ .mo {
87
+ visibility: hidden;
88
+ }
89
+ [data-keep-inside] .mo > [data-outside],
90
+ [data-slot="activity-layout-backdrop"]
91
+ [data-background]
92
+ .mo
93
+ > [data-outside] {
94
+ visibility: hidden;
95
+ }
96
+
71
97
  /* A preset fills the layer: the layer's size, not `100lvw x 100lvh`, which
72
98
  * counts the scrollbar and a phone's toolbar. */
73
99
  [data-slot="activity-layout-backdrop"] > [data-background] {
@@ -18,7 +18,9 @@
18
18
  }
19
19
 
20
20
  .dark,
21
- [data-theme="dark"] {
21
+ [data-theme="dark"],
22
+ :is(.dark, [data-theme="dark"]) [data-nxgt-theme],
23
+ [data-nxgt-theme]:is(.dark, [data-theme="dark"]) {
22
24
  /* The dark theme's primary is too dark to read on its surfaces (2.5:1), so
23
25
  * the rail's label is a saturated lavender of its hue (5.3:1: lightness
24
26
  * 0.72, chroma 0.15) on a denser pill (30 %, 35 % hovered). Light keeps the
@@ -32,7 +34,8 @@
32
34
  * it is primary, as set on :root (2.5:1 in dark rather than the inherited
33
35
  * muted text). */
34
36
  @supports not (color: oklch(from red l c h)) {
35
- :root {
37
+ :root,
38
+ [data-nxgt-theme] {
36
39
  --sidebar-active-foreground: var(--primary);
37
40
  }
38
41
  }
@@ -69,42 +69,17 @@
69
69
  }
70
70
 
71
71
  /* The glass drawer reads the dark theme whatever the page's. `.dark` on it
72
- * redefines `--background` and friends, but Tailwind's `--color-*` were
73
- * resolved at the root, so they are pointed at the local values again. */
74
- [data-slot="media-panel-drawer"],
75
- [data-slot="media-lightbox"] {
76
- --color-background: var(--background);
77
- --color-foreground: var(--foreground);
78
- --color-card: var(--card);
79
- --color-card-foreground: var(--card-foreground);
80
- --color-popover: var(--popover);
81
- --color-popover-foreground: var(--popover-foreground);
82
- --color-secondary: var(--secondary);
83
- --color-secondary-foreground: var(--secondary-foreground);
84
- --color-destructive: var(--destructive);
85
- --color-error: var(--error);
86
- --color-error-foreground: var(--error-foreground);
87
- --color-error-text: var(--error-text);
88
- --color-success: var(--success);
89
- --color-success-foreground: var(--success-foreground);
90
- --color-primary: var(--primary);
91
- --color-primary-foreground: var(--primary-foreground);
92
- --color-primary-text: var(--primary-text);
93
- --color-muted: var(--muted);
94
- --color-muted-foreground: color-mix(
72
+ * redefines `--background` and friends; the utilities read `var(--token)`
73
+ * where they sit (`@theme inline`), so only the one token the dark theme does
74
+ * not give the glass, the muted text, is derived here. `.dark` in the selector
75
+ * outranks the dark tokens' own `.dark` rule, which sets `--muted-foreground`. */
76
+ .dark[data-slot="media-panel-drawer"],
77
+ .dark[data-slot="media-lightbox"] {
78
+ --muted-foreground: color-mix(
95
79
  in oklab,
96
80
  var(--foreground) 82%,
97
81
  var(--background)
98
82
  );
99
- --color-accent: var(--accent);
100
- --color-accent-foreground: var(--accent-foreground);
101
- --color-border: var(--border);
102
- --color-input: var(--input);
103
- --color-ring: var(--ring);
104
- --color-track: var(--track);
105
- --color-track-fill: var(--track-fill);
106
- --color-tooltip: var(--tooltip);
107
- --color-tooltip-foreground: var(--tooltip-foreground);
108
83
  }
109
84
 
110
85
  /* The fullscreen drawer takes the end 24rem of a wide player (a bottom sheet
@@ -8,7 +8,8 @@
8
8
  * so a filled field still reads apart from an empty one on the near-black
9
9
  * page (≥ 1.10:1 between the two, ≥ 1.15:1 against the page;
10
10
  * Guides/Accessibility/Field contrast measures both). */
11
- :root {
11
+ :root,
12
+ [data-nxgt-theme] {
12
13
  --nxgt-field-bg: color-mix(in oklab, var(--foreground) 2%, var(--background));
13
14
  --nxgt-field-bg-hover: color-mix(
14
15
  in oklab,
@@ -60,7 +61,9 @@
60
61
  }
61
62
 
62
63
  .dark,
63
- [data-theme="dark"] {
64
+ [data-theme="dark"],
65
+ :is(.dark, [data-theme="dark"]) [data-nxgt-theme],
66
+ [data-nxgt-theme]:is(.dark, [data-theme="dark"]) {
64
67
  --nxgt-option-ring: color-mix(in oklab, var(--primary-text) 50%, transparent);
65
68
  --nxgt-option-muted: color-mix(
66
69
  in oklab,