@nxgt/material 3.7.1 → 3.7.3

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 (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/ui/layout/app-shell/activity-backdrop.css +62 -2
  3. package/dist/{components-bYGPzyKd.js → components-DslV-TzK.js} +7449 -7447
  4. package/dist/components.js +1 -1
  5. package/dist/main.js +1 -1
  6. package/dist/material.css +1 -1
  7. package/docs/components/navigation-and-layout.md +1 -1
  8. package/docs/guides/app-shell.md +35 -10
  9. package/docs/previews/data-table-filter-lists-datatable.webp +0 -0
  10. package/docs/previews/data-table-filter-lists-servertable.webp +0 -0
  11. package/docs/previews/navigation-layout-accountmenu.webp +0 -0
  12. package/docs/previews/navigation-layout-appshell-menu-badge.webp +0 -0
  13. package/docs/previews/navigation-layout-appshell.webp +0 -0
  14. package/docs/previews/navigation-layout-authcard.webp +0 -0
  15. package/docs/previews/navigation-layout-background.webp +0 -0
  16. package/docs/previews/navigation-layout-bottomappbar.webp +0 -0
  17. package/docs/previews/navigation-layout-breadcrumb.webp +0 -0
  18. package/docs/previews/navigation-layout-doc-api.webp +0 -0
  19. package/docs/previews/navigation-layout-doc-blocks.webp +0 -0
  20. package/docs/previews/navigation-layout-doc.webp +0 -0
  21. package/docs/previews/navigation-layout-hero.webp +0 -0
  22. package/docs/previews/navigation-layout-listdetailslayout.webp +0 -0
  23. package/docs/previews/navigation-layout-pager.webp +0 -0
  24. package/docs/previews/navigation-layout-panelayout.webp +0 -0
  25. package/docs/previews/navigation-layout-resizable.webp +0 -0
  26. package/docs/previews/navigation-layout-responsivegrid.webp +0 -0
  27. package/docs/previews/navigation-layout-seealso.webp +0 -0
  28. package/docs/previews/navigation-layout-sidebar.webp +0 -0
  29. package/docs/previews/navigation-layout-skiplink.webp +0 -0
  30. package/docs/previews/navigation-layout-stepper.webp +0 -0
  31. package/docs/previews/navigation-layout-steps.webp +0 -0
  32. package/docs/previews/navigation-layout-threadlayout.webp +0 -0
  33. package/docs/previews/navigation-layout-toc.webp +0 -0
  34. package/docs/previews/navigation-layout-topappbar.webp +0 -0
  35. package/docs/troubleshooting.md +16 -0
  36. package/lib/components/ui/layout/app-shell/activity-backdrop.css +62 -2
  37. package/package.json +1 -1
@@ -81,7 +81,7 @@ phone's menu sheet pad clear of `env(safe-area-inset-*)`, as classes; see the
81
81
  | `titleAs` | `'h1'` … `'h6'` \| `'div'` | `'h1'` | `ActivityContent`: the title's heading level |
82
82
  | `inset` | `boolean` | `false` | `ActivityContent`: pads the content 1rem on each side. Off, it lines up with the app bar and the cards |
83
83
  | `align` | `'start' \| 'center'` | `'start'` | `ActivityLayout`, `AppSidebar`: the collapsed rail's entries sit right under the brand, or `'center'` for centred in the height below it |
84
- | `backdrop` | `ReactNode` | — | `ActivityLayout`: a decorative background behind the frame, in place of the gradient and its blobs: a `Background` preset from `@nxgt/material/backgrounds`. Rendered in an `inert`, `aria-hidden` layer that fills the layout. See [Use a background preset behind the shell](../guides/app-shell.md#use-a-background-preset-behind-the-shell) |
84
+ | `backdrop` | `ReactNode` | — | `ActivityLayout`: a decorative background behind the frame, in place of the gradient and its blobs: a `Background` preset from `@nxgt/material/backgrounds`. Rendered in an `inert`, `aria-hidden` layer as wide as the content column and one viewport high, fixed in the viewport while the content scrolls; the chrome and lists stay opaque over it, coloured by `--nxgt-backdrop-chrome` and `--nxgt-backdrop-surface`. See [Use a background preset behind the shell](../guides/app-shell.md#use-a-background-preset-behind-the-shell) |
85
85
  | `routeTransition` | `boolean \| Omit<ViewTransitionProps, 'children' \| 'ref'>` | `true` | `ActivityLayout`: React's `<ViewTransition>` around the content region, so a navigation cross-fades it. `false` renders none (your app has its own boundary); an object passes `default` / `update` classes, `name`, callbacks through. See [Route transitions](../guides/app-shell.md#route-transitions) |
86
86
 
87
87
  The active entry is the longest match across the whole menu, segment-aware.
@@ -512,18 +512,43 @@ export function Shell({ items }: { items: MenuItem[] }) {
512
512
  carries `data-backdrop`, and the built-in gradient (its tint and three blobs) is not drawn (plain
513
513
  CSS, no inline `style`). Without it the markup and the look are what they
514
514
  were; `null`, `undefined` and `false` count as none.
515
- - **It sits behind everything.** The node is wrapped in a layer
516
- (`[data-slot="activity-layout-backdrop"]`) that fills the layout, under the
517
- sidebar, the header and the content. The layer is `inert`, `aria-hidden="true"`
515
+ - **It sits behind the content column.** The node is wrapped in a layer
516
+ (`[data-slot="activity-layout-backdrop"]`) that spans the column's width beside the
517
+ sidebar, under the app bar, the breadcrumb and the content. The layer is `inert`, `aria-hidden="true"`
518
518
  and takes no pointer, so the preset is decoration only: put nothing
519
519
  interactive in it.
520
- - **It fills the layout.** A `Background` in the layer is sized to the layer,
521
- not to `100lvw × 100lvh`, so you need no `className` or `fill`. In
522
- `scroll="document"` the layout grows with the content, and so does the preset.
523
- - **Readable by design.** The frame keeps `bg-background-paper` and the sidebar
524
- and header their `bg-background/40`, so the content reads over a busy preset.
525
- Tone it down with the preset's `intensity` (`subtle`) rather than by
526
- restyling the frame.
520
+ - **It fills the column.** A `Background` in the layer is sized to the layer,
521
+ not to `100lvw × 100lvh`, so you need no `className` or `fill`. The layer is
522
+ as wide as the column and one viewport high, and stays in the viewport while
523
+ the content scrolls over it, in `scroll="document"` (the page scrolls) and in
524
+ `scroll="container"` alike.
525
+ - **The shapes stay in the free content area.** Under a `backdrop`, every
526
+ surface of the chrome is opaque, so no shape runs behind a text, an icon or a
527
+ control: the sidebar (over its full height), the app bar, the breadcrumb (a
528
+ pill as wide as its crumbs), the tabs strip, the lists and tables (band and
529
+ rows), the segmented `ToggleGroup`, the list bar and the phone tiles. Nothing
530
+ changes without a `backdrop`. Two tokens set the colours, on the layout (a
531
+ `className` such as `[--nxgt-backdrop-chrome:var(--muted)]`) or on any
532
+ ancestor:
533
+
534
+ | Token | Paints | Default |
535
+ | --- | --- | --- |
536
+ | `--nxgt-backdrop-chrome` | sidebar, app bar, breadcrumb, tabs strip | `var(--background)` |
537
+ | `--nxgt-backdrop-surface` | lists and tables (`DataTable`, `ServerTable`) | `var(--card)` |
538
+
539
+ ```tsx
540
+ <ActivityLayout
541
+ backdrop={<Background preset="shapes" />}
542
+ className="[--nxgt-backdrop-chrome:var(--card)] [--nxgt-backdrop-surface:var(--background)]"
543
+ >
544
+ ```
545
+
546
+ Give a colour, not a translucent one: a see-through surface lets the shapes
547
+ run behind the text again. Tone the preset down with its `intensity`
548
+ (`subtle`) rather than restyling the frame. The backdrop shows only inside
549
+ the content column (its layer is in the column, rounded like the frame): the
550
+ frame's padding, the gap beside the sidebar and the strip above the app bar
551
+ are the chrome colour, so no shape is cut at the edges.
527
552
  - **The stylesheet is yours to import.** `@nxgt/material/backgrounds` is a
528
553
  separate entry, so `ActivityLayout` never pulls it in: import it where you
529
554
  build the `backdrop`, and its `backgrounds.css` once.
@@ -60,6 +60,7 @@ words in your error.
60
60
  - [axe reports `target-size` on a control under a form's sticky actions](#axe-reports-target-size-on-a-control-under-a-forms-sticky-actions)
61
61
  - [`color-contrast` fails over the background blobs on phone](#color-contrast-fails-over-the-background-blobs-on-phone)
62
62
  - [`ActivityLayout`'s `backdrop` shows nothing, or the blobs are still there](#activitylayouts-backdrop-shows-nothing-or-the-blobs-are-still-there)
63
+ - [Shapes of an `ActivityLayout` `backdrop` run behind the text of the chrome or a list](#shapes-of-an-activitylayout-backdrop-run-behind-the-text-of-the-chrome-or-a-list)
63
64
  - [Shaped Gallery tiles are plain rounded squares](#shaped-gallery-tiles-are-plain-rounded-squares)
64
65
  - [A component with my own tone (Shape, Fab, Avatar, StatCard, a metric card) shows no colour, or `tone` is a type error](#a-component-with-my-own-tone-shape-fab-avatar-statcard-a-metric-card-shows-no-colour-or-tone-is-a-type-error)
65
66
  - [A test expects the old `bg-muted` Avatar fallback, or a filled fallback shows a grey ring](#a-test-expects-the-old-bg-muted-avatar-fallback-or-a-filled-fallback-shows-a-grey-ring)
@@ -1323,6 +1324,21 @@ import { Background } from '@nxgt/material/backgrounds';
1323
1324
  import '@nxgt/material/backgrounds.css';
1324
1325
  ```
1325
1326
 
1327
+ ### Shapes of an `ActivityLayout` `backdrop` run behind the text of the chrome or a list
1328
+
1329
+ **When:** with `backdrop`, a breadcrumb, a tabs strip, a table or the sidebar
1330
+ shows the shapes through it, or you set a translucent colour and they come back.
1331
+ **Why:** under `data-backdrop` those surfaces take `--nxgt-backdrop-chrome` (default
1332
+ `var(--background)`) and `--nxgt-backdrop-surface` (default `var(--card)`); before
1333
+ 3.7.2 they had no surface or a translucent one, and a custom `className` with its
1334
+ own `bg-*` on a list wins over the token.
1335
+ **Fix:** update `@nxgt/material`, and give the tokens opaque colours; drop a
1336
+ `bg-*/NN` class from the list's `className`.
1337
+
1338
+ ```tsx
1339
+ <ActivityLayout backdrop={<Background preset="shapes" />} className="[--nxgt-backdrop-surface:var(--background)]" />
1340
+ ```
1341
+
1326
1342
  ### A ResponsiveButton no longer shows its tooltip next to its visible label
1327
1343
 
1328
1344
  **When:** a `ResponsiveButton` with a `tooltip` on a desktop width (768 px and up, or `expanded`), where the tooltip used to appear beside the label.
@@ -1,11 +1,24 @@
1
1
  /* ActivityLayout's `backdrop` prop: a node (a `Background` preset from
2
- * `@nxgt/material/backgrounds`) drawn behind the frame instead of the built-in
2
+ * `@nxgt/material/backgrounds`) drawn behind the content column instead of the built-in
3
3
  * gradient. `data-backdrop` is on the layout's root only while one is given, so
4
4
  * without it nothing here matches and the gradient is unchanged.
5
5
  *
6
6
  * Plain CSS, no inline `style`, in `@layer components` like the rest: an app's
7
7
  * utilities still win. The layer itself (`data-slot="activity-layout-backdrop"`)
8
- * is positioned by classes in activity-layout.tsx. */
8
+ * is in the content column, positioned by classes in activity-layout.tsx: the
9
+ * frame's padding and gaps take the chrome fill, so the shapes show nowhere
10
+ * else.
11
+ *
12
+ * The shapes show in the free content area only: every surface of the chrome and
13
+ * of the lists is opaque, so none runs behind a text, an icon or a control. Two
14
+ * tokens, set on the layout (or any ancestor), tune them:
15
+ * --nxgt-backdrop-chrome the sidebar, the app bar, the breadcrumb, the tabs
16
+ * strip (default: var(--background))
17
+ * --nxgt-backdrop-surface the lists and tables, their band and rows
18
+ * (default: var(--card))
19
+ * The sidebar, the app bar and the tables take theirs from a class whose
20
+ * fallback is their usual surface, through `--nxgt-backdrop-fill-*`: a utility
21
+ * class outranks any rule in a layer, so a rule here could not set them. */
9
22
  @layer components {
10
23
  /* The gradient's own tint and blobs give way to the backdrop. */
11
24
  [data-slot="activity-layout"][data-backdrop] {
@@ -21,4 +34,51 @@
21
34
  width: 100%;
22
35
  height: 100%;
23
36
  }
37
+
38
+ /* The layer is sticky, not absolute: it keeps the column's left and right
39
+ * edges and stays in the viewport, from the app bar's top to the frame's
40
+ * bottom padding, while the page (scroll="document") or the content region
41
+ * (scroll="container") scrolls over it. It is the column's first child, so
42
+ * a negative bottom margin (its height, and the column's 0.5rem gap) takes
43
+ * it out of the flow: the app bar keeps its place. The offsets are the
44
+ * frame's own padding and the app bar's sticky top. */
45
+ [data-slot="activity-layout-backdrop"] {
46
+ --nxgt-backdrop-top: max(0.5rem, env(safe-area-inset-top));
47
+ --nxgt-backdrop-height: calc(
48
+ 100dvh -
49
+ var(--nxgt-backdrop-top) -
50
+ max(0.5rem, env(safe-area-inset-bottom)) -
51
+ var(--nxgt-media-dock, 0px)
52
+ );
53
+ position: sticky;
54
+ top: var(--nxgt-backdrop-top);
55
+ height: var(--nxgt-backdrop-height);
56
+ margin-bottom: calc(-1 * var(--nxgt-backdrop-height) - 0.5rem);
57
+ }
58
+
59
+ [data-slot="activity-layout"][data-backdrop] {
60
+ --nxgt-backdrop-fill-chrome: var(--nxgt-backdrop-chrome, var(--background));
61
+ --nxgt-backdrop-fill-surface: var(--nxgt-backdrop-surface, var(--card));
62
+ }
63
+
64
+ /* The breadcrumb trail: a pill under the app bar, as wide as its crumbs. */
65
+ [data-slot="activity-layout"][data-backdrop]
66
+ [data-slot="activity-layout-frame"]
67
+ > *
68
+ > [data-slot="breadcrumb"] {
69
+ width: fit-content;
70
+ max-width: 100%;
71
+ padding-block: 0.25rem;
72
+ padding-inline-end: 0.75rem;
73
+ border-radius: 999px;
74
+ background: var(--nxgt-backdrop-fill-chrome);
75
+ }
76
+
77
+ /* Tabs: the strip is a band, its top corners rounded. (The segmented look
78
+ * has its own track.) */
79
+ [data-slot="activity-layout"][data-backdrop] [data-slot="tabs-list"] {
80
+ border-start-start-radius: var(--radius);
81
+ border-start-end-radius: var(--radius);
82
+ background: var(--nxgt-backdrop-fill-chrome);
83
+ }
24
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "3.7.1",
3
+ "version": "3.7.3",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"