@nxgt/material 3.7.2 → 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.
- package/CHANGELOG.md +6 -0
- package/dist/components/ui/layout/app-shell/activity-backdrop.css +21 -0
- package/dist/{components-bsrzppcD.js → components-DslV-TzK.js} +1 -1
- package/dist/components.js +1 -1
- package/dist/main.js +1 -1
- package/dist/material.css +1 -1
- package/docs/components/navigation-and-layout.md +1 -1
- package/docs/guides/app-shell.md +5 -3
- package/lib/components/ui/layout/app-shell/activity-backdrop.css +21 -0
- 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
|
|
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.
|
package/docs/guides/app-shell.md
CHANGED
|
@@ -513,13 +513,15 @@ export function Shell({ items }: { items: MenuItem[] }) {
|
|
|
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
515
|
- **It sits behind the content column.** The node is wrapped in a layer
|
|
516
|
-
(`[data-slot="activity-layout-backdrop"]`) that
|
|
516
|
+
(`[data-slot="activity-layout-backdrop"]`) that spans the column's width beside the
|
|
517
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
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`.
|
|
522
|
-
|
|
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.
|
|
523
525
|
- **The shapes stay in the free content area.** Under a `backdrop`, every
|
|
524
526
|
surface of the chrome is opaque, so no shape runs behind a text, an icon or a
|
|
525
527
|
control: the sidebar (over its full height), the app bar, the breadcrumb (a
|
|
@@ -35,6 +35,27 @@
|
|
|
35
35
|
height: 100%;
|
|
36
36
|
}
|
|
37
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
|
+
|
|
38
59
|
[data-slot="activity-layout"][data-backdrop] {
|
|
39
60
|
--nxgt-backdrop-fill-chrome: var(--nxgt-backdrop-chrome, var(--background));
|
|
40
61
|
--nxgt-backdrop-fill-surface: var(--nxgt-backdrop-surface, var(--card));
|