@nxgt/material 3.76.0 → 3.77.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 (53) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +2 -2
  3. package/dist/{calculator-BaSMe0SK.js → calculator-DSSaYRmM.js} +2 -2
  4. package/dist/calculator-field.js +2 -2
  5. package/dist/calculator.js +1 -1
  6. package/dist/components/ui/display/chip/chip-hairline.css +19 -0
  7. package/dist/components/ui/display/chip/chip-soft.css +18 -0
  8. package/dist/{components-Ci3Zo8kC.js → components-ZJx47chq.js} +11714 -11637
  9. package/dist/components.js +34 -34
  10. package/dist/{currency-field-BJ9rSrif.js → currency-field-DWHB5oms.js} +3 -2
  11. package/dist/editor.js +1 -1
  12. package/dist/{financial-variant-BsZEa5sF.js → financial-variant-vZdgyMeN.js} +3 -3
  13. package/dist/lib/components/ui/collections/row-menu/use-row-menu-focus.d.ts +11 -1
  14. package/dist/lib/components/ui/collections/server-table/partials/server-table-phone-row.d.ts +1 -1
  15. package/dist/lib/components/ui/display/entity-header/partials/entity-header-actions.d.ts +3 -1
  16. package/dist/lib/components/ui/display/entity-header/partials/entity-header-layout.d.ts +10 -0
  17. package/dist/lib/components/ui/fields/quantity-field/quantity-row.d.ts +4 -3
  18. package/dist/lib/components/ui/layout/app-shell/page-title.d.ts +4 -3
  19. package/dist/lib/components/ui/layout/hero/hero-backdrop.d.ts +7 -0
  20. package/dist/lib/components/ui/layout/hero/hero-parts.d.ts +27 -0
  21. package/dist/lib/components/ui/layout/hero/hero.d.ts +26 -1
  22. package/dist/lib/components/ui/primitives/tabs/tabs-manual-scroll.d.ts +16 -0
  23. package/dist/lib/components/ui/primitives/tabs/use-tabs-overflow.d.ts +1 -1
  24. package/dist/main.js +49 -49
  25. package/dist/material.css +1 -1
  26. package/dist/{percent-field-lahyDJDG.js → percent-field--WIXV5dX.js} +1 -1
  27. package/dist/{tabs-DzEqMb1W.js → tabs-BT9pSRwk.js} +128 -97
  28. package/dist/{use-chat-composer-DMXu9E1O.js → use-chat-composer-BOx4I6Ma.js} +1 -1
  29. package/docs/components/data-display.md +2 -1
  30. package/docs/components/data-table-filter-and-lists.md +13 -1
  31. package/docs/components/form-fields.md +6 -3
  32. package/docs/components/navigation-and-layout.md +29 -1
  33. package/docs/components/selection-and-choice.md +3 -1
  34. package/docs/guides/app-shell.md +6 -4
  35. package/docs/guides/theming.md +5 -5
  36. package/docs/troubleshooting.md +3 -2
  37. package/lib/components/ui/display/chip/chip-hairline.css +19 -0
  38. package/lib/components/ui/display/chip/chip-soft.css +18 -0
  39. package/lib/themes/ambre.css +1 -1
  40. package/lib/themes/ardoise.css +1 -1
  41. package/lib/themes/bleumono.css +1 -1
  42. package/lib/themes/bluemoon.css +1 -1
  43. package/lib/themes/corail.css +2 -2
  44. package/lib/themes/foret.css +1 -1
  45. package/lib/themes/lavande.css +1 -1
  46. package/lib/themes/menthe.css +1 -1
  47. package/lib/themes/ocean.css +1 -1
  48. package/lib/themes/pink.css +2 -2
  49. package/lib/themes/prune.css +1 -1
  50. package/lib/themes/sable.css +1 -1
  51. package/lib/themes/slate.css +1 -1
  52. package/lib/themes/teal.css +3 -3
  53. package/package.json +2 -2
@@ -68,7 +68,7 @@ at the top are needed is in [getting started](../getting-started.md#styles).
68
68
  | `--accent`, `--accent-foreground` | `bg-accent`, … | hover surfaces |
69
69
  | `--nxgt-accent` | `[--nxgt-accent:…]` | the mark colour of the selection controls: the fill, handle, state layer and stop dots of `Slider`, the on state of `Switch`, the box and dot of `Checkbox` and `Radio`. It defaults to `--primary` (`--primary-text` in dark) and is set per control, so override it on the control itself, not on `:root` |
70
70
  | `--error`, `--success`, `--info`, `--warning` (+ `-foreground`) | `bg-error`, `text-success`, … | the status colours of `Button`, `Alert`, `Badge`, toasts |
71
- | `--primary-text` | `text-primary-text` | primary drawn as text or an icon on a page, card or popover surface: `Typography tone="primary"`, links, the `Alert` primary icon, selected labels. Equal to `--primary` in light; in dark, `--primary` mixed 60 % with white (`color-mix(in oklab, var(--primary) 40%, white)`), well over 4.5:1 on `--background` and `--card` |
71
+ | `--primary-text` | `text-primary-text` | primary drawn as text or an icon on a page, card or popover surface: `Typography tone="primary"`, links, the `Alert` primary icon, selected labels. In light, `--primary` mixed toward black: 96 % at most, solved lower on a tinted page so a tonal Button label on a striped row reaches 4.6:1 (94 % on teal, 89 % on corail, 94 % on pink); in dark, `--primary` mixed 60 % with white (`color-mix(in oklab, var(--primary) 40%, white)`), well over 4.5:1 on `--background` and `--card` |
72
72
  | `--primary-indicator` | `bg-primary-indicator`, `border-primary-indicator`, `ring-primary-indicator`, `stroke-primary-indicator` | primary drawn as a non-text mark that carries a state (WCAG 1.4.11, 3:1): an active bar or dot, a selected or focused border, a ring, a spinner arc. Equal to `--primary` in light; in dark, `--primary` mixed 25 % with white (`color-mix(in oklab, var(--primary) 75%, white)`), 4.8:1 on `--background`, 4.5:1 on `--card`, 4.2:1 on `--muted` (`--primary` itself gives 2.7, 2.5 and 2.3:1) |
73
73
  | `--error-text` | `text-error-text` | error drawn as text: field messages, `HelperText` in its error state, form and dialog errors, `variant="error"` menu items |
74
74
  | `--destructive` | `bg-destructive`, `text-destructive` | deprecated alias of `--error`: the light theme sets it to `var(--error)`, the dark theme keeps its own value; use `--error` |
@@ -985,8 +985,8 @@ the fill can stay dark while the text is light enough to read. The light value
985
985
  is `color-mix(in oklab, var(--error) 92%, black)` (6.0:1 on `--background`,
986
986
  6.0:1 on `--card`, 5.0:1 on the `bg-error/10` tint of a focused menu item, where
987
987
  `--error` gives 5.0 and 4.2:1); the dark one is
988
- `color-mix(in oklab, var(--error) 76%, white)`, 6.25:1 on `--background` and
989
- 5.9:1 on `--card` (5.2:1 on a focused error menu item), where `--error` itself gives 4.0 and 3.8:1. Field messages,
988
+ `color-mix(in oklab, var(--error) 76%, white)` at most (6.25:1 on `--background` and
989
+ 5.9:1 on `--card` for the shared night, 5.2:1 on a focused error menu item, where `--error` itself gives 4.0 and 3.8:1). The share is solved per theme: it drops below 76 % (71 % on teal) when a lighter dark card would leave the text under 5.3:1, since a browser measures a hair under this module. Field messages,
990
990
  `HelperText` in its error state, form, dialog and upload errors, a textarea's
991
991
  counter over its limit, the error lines of `Terminal`, a
992
992
  `variant="error"` menu item and the falling values of the metric cards use it.
@@ -1011,8 +1011,8 @@ override on the root, or use a [theme zone](#themes), which re-declares them.
1011
1011
  **Primary text has a token of its own**, `--primary-text` (`text-primary-text`),
1012
1012
  for the same reason: the brand colour is a dark fill (it keeps near-white text
1013
1013
  readable on a button) and reads at only about 2:1 as text on the dark surfaces.
1014
- The light value is `color-mix(in oklab, var(--primary) 96%, black)` (primary
1015
- 4 % toward black, 7.9:1 on the white page); the dark one is
1014
+ The light value is `color-mix(in oklab, var(--primary) 96%, black)` at most (primary
1015
+ 4 % toward black, 7.9:1 on the white page; the share is solved per theme and drops when a tinted page would leave a tonal Button label under 4.6:1 on a striped row, to 94 % on teal); the dark one is
1016
1016
  `color-mix(in oklab, var(--primary) 40%, white)` (primary mixed 60 % with
1017
1017
  white, the recipe of the tonal `Button` labels). `Typography tone="primary"`,
1018
1018
  the `Alert` primary icon, links, selected labels and the other primary text of
@@ -1241,7 +1241,7 @@ on the page; the catalogue's own primary text passes.
1241
1241
  **Why:** it is drawn with `text-primary`, the fill colour. The brand colour is
1242
1242
  dark so that near-white text reads on it, which makes it too dark to read as
1243
1243
  text on the dark surfaces. Primary text has its own token, `--primary-text`:
1244
- the same colour in light, `--primary` mixed 60 % with white in dark.
1244
+ `--primary` mixed toward black in light (96 % at most, solved per theme), `--primary` mixed 60 % with white in dark.
1245
1245
  **Fix:** draw primary text with `text-primary-text`; keep `text-primary` for
1246
1246
  fills, borders and rings:
1247
1247
 
@@ -2219,7 +2219,8 @@ opens a dialog. When they close, `document.activeElement` is `document.body`.
2219
2219
  when a dialog opened from an item closes), but a toast, a later dialog or a
2220
2220
  remounted row takes it afterwards.
2221
2221
  **Fix:** call `focusRowMenu(row.id)` from `useRowMenuFocus()` once the action
2222
- settles, with `focusRef` on the table. It matches the row by id, not by label.
2222
+ settles, with `focusRef` on the table. It matches the row by id, not by label. A plain row button (not a `RowMenu`)
2223
+ needs `{...rowFocusProps(row.id)}` to be found.
2223
2224
  See "Handing the focus back to a row" in
2224
2225
  [RowMenu](components/data-table-filter-and-lists.md#handing-the-focus-back-to-a-row).
2225
2226
 
@@ -72,6 +72,25 @@
72
72
  }
73
73
  }
74
74
 
75
+ /* A toggle chip (`aria-checked` or `aria-pressed`: a choice of a
76
+ * ChipGroupField, a filter) is a control, and its boundary is what shows
77
+ * where it is: 3:1 against the page and the card (WCAG 1.4.11), in light and
78
+ * dark, on every preset (#2357). The soft look draws it too (chip-soft.css
79
+ * reads --chip-line). The share is checked in chip-line-contrast.test.ts. A
80
+ * plain or a coloured chip keeps its quiet look. */
81
+ @layer components {
82
+ .nxgt-chip[data-tone="neutral"]:is([aria-checked], [aria-pressed]),
83
+ :is(.dark, [data-theme="dark"])
84
+ .nxgt-chip[data-tone="neutral"]:is([aria-checked], [aria-pressed]) {
85
+ --chip-line: color-mix(in oklab, var(--foreground) 50%, var(--background));
86
+ --chip-line-hover: color-mix(
87
+ in oklab,
88
+ var(--foreground) 64%,
89
+ var(--background)
90
+ );
91
+ }
92
+ }
93
+
75
94
  /* A coloured chip: the hairline takes the tone, the face a breath of it,
76
95
  * hover included (through the variables the hover rule reads). */
77
96
  @layer components {
@@ -65,6 +65,24 @@
65
65
  }
66
66
  }
67
67
 
68
+ /* A toggle chip left unselected keeps a boundary (--chip-line, set in
69
+ * chip-hairline.css): the fill alone is under 3:1 (#2357). Selected has its
70
+ * ring and its check. */
71
+ @layer components {
72
+ .nxgt-chip[data-look="soft"][data-tone="neutral"]:is(
73
+ [aria-checked="false"],
74
+ [aria-pressed="false"]
75
+ ) {
76
+ border-color: var(--chip-line);
77
+ }
78
+ .nxgt-chip[data-look="soft"][data-tone="neutral"]:is(
79
+ [aria-checked="false"],
80
+ [aria-pressed="false"]
81
+ ):is(button:hover):not(:disabled, [data-disabled]) {
82
+ border-color: var(--chip-line-hover);
83
+ }
84
+ }
85
+
68
86
  /* A coloured chip (`color` other than default) is a status: the tone
69
87
  * (in dark the base of the tone's container, --nxgt-tone-container-base: the
70
88
  * tone held at a container's lightness) at
@@ -1,6 +1,6 @@
1
1
  /* Theme "ambre", generated.
2
2
  * Seeds: primary oklch(0.52 0.13 48), secondary oklch(0.5 0.09 95), tertiary oklch(0.5 0.14 350), neutral hue 65, tint 0.85.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  * hue-near-status: The primary's hue 48 is 14° from warning (62): they may read alike. Keep an icon and a word with every status.
5
5
  */
6
6
  [data-nxgt-theme="ambre"] {
@@ -1,6 +1,6 @@
1
1
  /* Theme "ardoise", generated.
2
2
  * Seeds: primary oklch(0.45 0.065 252), secondary oklch(0.48 0.05 215), tertiary oklch(0.48 0.1 290), neutral hue 250, tint 0.7.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  */
5
5
  [data-nxgt-theme="ardoise"] {
6
6
  --radius: 0.375rem;
@@ -1,6 +1,6 @@
1
1
  /* Theme "bleumono", generated.
2
2
  * Seeds: primary oklch(0.46 0.13 255), secondary oklch(0.55 0.06 255), tertiary oklch(0.38 0.17 255), neutral hue 255, tint 1.1.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  * lightness-moved: secondary: lightness 0.550 to 0.520 for AA.
5
5
  * chroma-lowered: tertiary: chroma 0.170 to 0.125 (lowered to fit sRGB or AA).
6
6
  * hue-near-status: The primary's hue 255 is 0° from info (254.624): they may read alike. Keep an icon and a word with every status.
@@ -1,6 +1,6 @@
1
1
  /* Theme "bluemoon", generated.
2
2
  * Seeds: primary oklch(0.45 0.12 265), secondary oklch(0.55 0.02 250), tertiary oklch(0.62 0.08 290), neutral hue 265, tint 1.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  * lightness-moved: secondary: lightness 0.550 to 0.520 for AA.
5
5
  * lightness-moved: tertiary: lightness 0.620 to 0.563 for AA.
6
6
  * hue-near-status: The primary's hue 265 is 10° from info (254.624): they may read alike. Keep an icon and a word with every status.
@@ -1,6 +1,6 @@
1
1
  /* Theme "corail", generated.
2
2
  * Seeds: primary oklch(0.58 0.17 35), secondary oklch(0.52 0.1 70), tertiary oklch(0.5 0.1 200), neutral hue 30, tint 0.8.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  * lightness-moved: primary: lightness 0.580 to 0.575 for AA.
5
5
  * chroma-lowered: tertiary: chroma 0.100 to 0.085 (lowered to fit sRGB or AA).
6
6
  * hue-near-status: The primary's hue 35 is 8° from error (27.325): they may read alike. Keep an icon and a word with every status.
@@ -17,7 +17,7 @@
17
17
  --popover-foreground: oklch(0.227 0.0136 30);
18
18
  --primary: oklch(0.575 0.17 35);
19
19
  --primary-foreground: oklch(0.984 0.003 30);
20
- --primary-text: color-mix(in oklab, var(--primary) 96%, black);
20
+ --primary-text: color-mix(in oklab, var(--primary) 89%, black);
21
21
  --primary-indicator: var(--primary);
22
22
  --secondary: oklch(0.52 0.1 70);
23
23
  --secondary-foreground: oklch(0.984 0.003 30);
@@ -1,6 +1,6 @@
1
1
  /* Theme "foret", generated.
2
2
  * Seeds: primary oklch(0.48 0.1 152), secondary oklch(0.5 0.08 118), tertiary oklch(0.5 0.1 55), neutral hue 140, tint 0.8.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  */
5
5
  [data-nxgt-theme="foret"] {
6
6
  --radius: 0.5rem;
@@ -1,6 +1,6 @@
1
1
  /* Theme "lavande", generated.
2
2
  * Seeds: primary oklch(46% 0.1135 276.35), secondary oklch(48% 0.1135 245.65), tertiary oklch(45.91% 0.1864 310.75), neutral hue 292, tint 1.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  */
5
5
  [data-nxgt-theme="lavande"] {
6
6
  --radius: 0.625rem;
@@ -1,6 +1,6 @@
1
1
  /* Theme "menthe", generated.
2
2
  * Seeds: primary oklch(0.5 0.105 168), secondary oklch(0.5 0.09 205), tertiary oklch(0.52 0.11 120), neutral hue 170, tint 0.8.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  * chroma-lowered: primary: chroma 0.105 to 0.101 (lowered to fit sRGB or AA).
5
5
  * chroma-lowered: secondary: chroma 0.090 to 0.085 (lowered to fit sRGB or AA).
6
6
  * hue-near-status: The primary's hue 168 is 17° from success (184.704): they may read alike. Keep an icon and a word with every status.
@@ -1,6 +1,6 @@
1
1
  /* Theme "ocean", generated.
2
2
  * Seeds: primary oklch(0.5 0.12 228), secondary oklch(0.52 0.09 192), tertiary oklch(0.5 0.13 268), neutral hue 230, tint 0.9.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  * chroma-lowered: primary: chroma 0.120 to 0.098 (lowered to fit sRGB or AA).
5
5
  * lightness-moved: secondary: lightness 0.520 to 0.505 for AA.
6
6
  * chroma-lowered: secondary: chroma 0.090 to 0.087 (lowered to fit sRGB or AA).
@@ -1,6 +1,6 @@
1
1
  /* Theme "pink", generated.
2
2
  * Seeds: primary oklch(0.55 0.2 345), secondary oklch(0.5 0.14 320), tertiary oklch(0.5 0.1 200), neutral hue 345, tint 0.7.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  * chroma-lowered: tertiary: chroma 0.100 to 0.085 (lowered to fit sRGB or AA).
5
5
  */
6
6
  [data-nxgt-theme="pink"] {
@@ -15,7 +15,7 @@
15
15
  --popover-foreground: oklch(0.227 0.0119 345);
16
16
  --primary: oklch(0.55 0.2 345);
17
17
  --primary-foreground: oklch(0.984 0.003 345);
18
- --primary-text: color-mix(in oklab, var(--primary) 96%, black);
18
+ --primary-text: color-mix(in oklab, var(--primary) 94%, black);
19
19
  --primary-indicator: var(--primary);
20
20
  --secondary: oklch(0.5 0.14 320);
21
21
  --secondary-foreground: oklch(0.984 0.003 345);
@@ -1,6 +1,6 @@
1
1
  /* Theme "prune", generated.
2
2
  * Seeds: primary oklch(0.42 0.15 330), secondary oklch(0.5 0.1 355), tertiary oklch(0.55 0.1 85), neutral hue 330, tint 1.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  */
5
5
  [data-nxgt-theme="prune"] {
6
6
  --radius: 0.5rem;
@@ -1,6 +1,6 @@
1
1
  /* Theme "sable", generated.
2
2
  * Seeds: primary oklch(0.5 0.06 70), secondary oklch(0.5 0.05 45), tertiary oklch(0.5 0.07 150), neutral hue 75, tint 0.5.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  */
5
5
  [data-nxgt-theme="sable"] {
6
6
  --radius: 0.5rem;
@@ -1,6 +1,6 @@
1
1
  /* Theme "slate", generated.
2
2
  * Seeds: primary oklch(0.4 0.025 258), secondary oklch(0.48 0.02 230), tertiary oklch(0.46 0.045 275), neutral hue 258, tint 0.35.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  */
5
5
  [data-nxgt-theme="slate"] {
6
6
  --radius: 0.25rem;
@@ -1,6 +1,6 @@
1
1
  /* Theme "teal", generated.
2
2
  * Seeds: primary oklch(0.5 0.105 185), secondary oklch(0.52 0.09 215), tertiary oklch(0.52 0.12 60), neutral hue 190, tint 0.8.
3
- * Contrast: 65 pairs, 0 failing.
3
+ * Contrast: 66 pairs, 0 failing.
4
4
  * chroma-lowered: primary: chroma 0.105 to 0.088 (lowered to fit sRGB or AA).
5
5
  * lightness-moved: secondary: lightness 0.520 to 0.490 for AA.
6
6
  * chroma-lowered: secondary: chroma 0.090 to 0.087 (lowered to fit sRGB or AA).
@@ -19,7 +19,7 @@
19
19
  --popover-foreground: oklch(0.227 0.0136 190);
20
20
  --primary: oklch(0.5 0.0881 185);
21
21
  --primary-foreground: oklch(0.984 0.003 190);
22
- --primary-text: color-mix(in oklab, var(--primary) 96%, black);
22
+ --primary-text: color-mix(in oklab, var(--primary) 94%, black);
23
23
  --primary-indicator: var(--primary);
24
24
  --secondary: oklch(0.49 0.0866 215);
25
25
  --secondary-foreground: oklch(0.984 0.003 190);
@@ -105,7 +105,7 @@
105
105
  --accent-foreground: oklch(0.943 0.0096 190);
106
106
  --error: oklch(0.577 0.245 27.33);
107
107
  --error-foreground: oklch(0.995 0.002 190);
108
- --error-text: color-mix(in oklab, var(--error) 76%, white);
108
+ --error-text: color-mix(in oklab, var(--error) 71%, white);
109
109
  --success: oklch(0.6 0.118 145);
110
110
  --success-foreground: oklch(0.995 0.002 190);
111
111
  --info: oklch(0.707 0.165 254.62);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "3.76.0",
3
+ "version": "3.77.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -390,7 +390,7 @@
390
390
  "docs:previews": "rm -rf node_modules/.cache/nxgt-preview-free/missing && NXGT_PREVIEW_FREE=1 vitest run --project previews && bun .storybook/preview-free-report.ts"
391
391
  },
392
392
  "dependencies": {
393
- "@nxgt/material-core": "^0.49.0",
393
+ "@nxgt/material-core": "^0.49.1",
394
394
  "@base-ui/react": "^1.6.0",
395
395
  "@dnd-kit/core": "^6.3.1",
396
396
  "@dnd-kit/sortable": "^10.0.0",