@nxgt/material 3.26.1 → 3.27.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.
@@ -207,7 +207,7 @@ import { AuthCard, Button, EmailField, LanguageSwitcher, PasswordField } from '@
207
207
  | `banner` | `ReactNode` | — | above that row (an update notice) |
208
208
  | `footer` | `ReactNode` | — | under the card |
209
209
  | `backdrop` | `ReactNode \| false` | the theme's background | what is drawn behind the page: a `Background` preset or any node; `false` for none. Without a theme provider nothing is drawn |
210
- | `keepClear` | `boolean` | `true` | glyphs (shapes or icons) of the backdrop that would meet the brand row, the card or the page's surfaces, text or controls are dropped (never moved); `false` lets them run under the card |
210
+ | `keepClear` | `boolean \| 'gaps'` | `true` | glyphs (shapes or icons) of the backdrop that would meet the brand row, the card or the page's surfaces, text or controls are dropped (never moved); `false` lets them run under the card; `'gaps'` also keeps a glyph that fits in a gap of 24px or more between two surfaces |
211
211
 
212
212
  ```tsx
213
213
  import { Background } from '@nxgt/material/backgrounds';
@@ -210,6 +210,7 @@ partitionMenu(items); // { content, footer }
210
210
  | `menuOpen` | `boolean` | — | Controls the phone's menu sheet: open while `true`. Leave it out and the layout manages the sheet. Only a phone shows the sheet |
211
211
  | `onMenuOpenChange` | `(open: boolean) => void` | — | Called for every change of the sheet: the menu button, Escape, the close button, a followed link, a new location |
212
212
  | `backdrop` | `ReactNode \| false` | — | An exception to the theme's background (the page ground, [`--ground`](#the-page-ground), is painted either way), which the layout draws by default (Lavande's: the built-in gradient and blobs). A node replaces it for this screen: usually a `Background` preset from `@nxgt/material/backgrounds` (see [Use a background preset behind the shell](#use-a-background-preset-behind-the-shell)); `false` draws no background, a plain page |
213
+ | `keepClear` | `boolean \| 'gaps'` | `true` | how the backdrop's glyphs keep clear of the page: `true` drops every glyph within 8px of a surface, a text or a control; `'gaps'` also keeps a glyph that fits in a gap of 24px or more between two surfaces; `false` keeps nothing clear (the edge and the header band still are). See [Keep the backdrop clear of the content](#keep-the-backdrop-clear-of-the-content) |
213
214
 
214
215
  On a page with `viewport-fit=cover` (an installed PWA drawing under a
215
216
  notch and the home indicator), the shell pads clear of
@@ -646,6 +647,43 @@ export function Shell({ items }: { items: MenuItem[] }) {
646
647
  - The `--nxgt-bg-blob-1..3` variables recolour the built-in blobs only; the
647
648
  `blobs` preset reads them too.
648
649
 
650
+ ## Keep the backdrop clear of the content
651
+
652
+ Behind the shell a glyph of the backdrop (a shape or an icon) is dropped, never
653
+ moved, when its box meets the page's content. `keepClear` sets how strict that
654
+ is:
655
+
656
+ | `keepClear` | Result |
657
+ | --- | --- |
658
+ | `true` (default) | a glyph within 8px of a surface (a card, a stat card, a list, a table), a text or a control is dropped |
659
+ | `'gaps'` | the same for text, controls and the inside of a surface, but a glyph may stay between two surfaces when its whole box fits in a gap of 24px or more (4px to spare from each card) |
660
+ | `false` | the content is not measured; only the layer's edge and the header band drop a glyph |
661
+
662
+ On a dense page (stat cards, a list, a grid of cards 24 to 32px apart) `true`
663
+ leaves almost no glyph. `'gaps'` is opt-in and keeps the glyphs small enough
664
+ for the gutters, so use it on such a page. It adds little on a page with wide
665
+ open areas, where `true` already draws them. It never keeps a glyph that sits
666
+ on a card, on text or on a control, and it measures the same way as `true`:
667
+ boxes are read first, then written in one frame, with the 150 ms fade. A
668
+ floating (`animated`) scene keeps its drift margin, so it rarely fits a gutter.
669
+
670
+ ```tsx
671
+ import { ActivityLayout } from '@nxgt/material/components';
672
+ import { Background, MOTIF_SHAPES_ALL } from '@nxgt/material/backgrounds';
673
+
674
+ <ActivityLayout
675
+ items={items}
676
+ backdrop={<Background preset="shapes" motif={{ shapes: MOTIF_SHAPES_ALL }} />}
677
+ keepClear="gaps"
678
+ >
679
+ <Outlet />
680
+ </ActivityLayout>
681
+ ```
682
+
683
+ `AuthCard` takes the same prop (`keepClear="gaps"`). Its card and brand row
684
+ are kept whole, so there it only adds glyphs between the page's other
685
+ surfaces, such as a banner.
686
+
649
687
  ## Route transitions
650
688
 
651
689
  `ActivityLayout` wraps its content region (`data-slot="activity-content-region"`)
@@ -548,6 +548,11 @@ good.
548
548
  away. It runs again on resize and when the content changes.
549
549
  - The open areas keep their glyphs; the space behind and between cards is empty. `keepClear={false}` on an `AuthCard`
550
550
  lets the glyphs run under the card.
551
+ - **`keepClear="gaps"`** (on `ActivityLayout` and `AuthCard`, opt-in; `true` stays the default) lets a glyph stay between
552
+ two surfaces when its whole box fits in a gap of 24 px or more, with 4 px to spare from each. It is still dropped when
553
+ it meets a text, a control or the inside of a surface. Use it on a dense page (stat cards, a list and a grid of cards
554
+ 24 to 32 px apart), where `true` leaves almost nothing. A glyph wider than the gap is dropped as before. See
555
+ [Keep the backdrop clear of the content](./app-shell.md#keep-the-backdrop-clear-of-the-content).
551
556
  - See [The theme's background](./app-shell.md#the-themes-background) for the shell and `AuthCard` in
552
557
  [navigation and layout](../components/navigation-and-layout.md#authcard) for the sign-in page.
553
558
 
@@ -722,9 +722,20 @@ list) hold shapes.
722
722
  backdrop layer). Since 3.22 a glyph whose box meets a surface, a text or a
723
723
  control, within 8px, is dropped whole (the keep-clear pass), so a gap narrower
724
724
  than a glyph shows none.
725
- **Fix:** none needed, it is the documented behaviour (see [the drop rule](./guides/backgrounds.md) in
726
- the backgrounds guide). To see more shapes, leave open space in the page, or draw
727
- the backdrop in a layout that has no content over it.
725
+ **Fix:** it is the documented behaviour (see [the drop rule](./guides/backgrounds.md) in
726
+ the backgrounds guide). On a dense page, opt in to `keepClear="gaps"` on the
727
+ `ActivityLayout` (or `AuthCard`): a glyph then stays when its box fits in a gap of
728
+ 24px or more between two surfaces, and is still dropped over text, a control or a
729
+ card. A glyph wider than the gap is dropped as before. Or leave open space in the page.
730
+
731
+ ```tsx
732
+ import { ActivityLayout } from '@nxgt/material/components';
733
+ import { Background } from '@nxgt/material/backgrounds';
734
+
735
+ <ActivityLayout items={items} backdrop={<Background preset="shapes" />} keepClear="gaps">
736
+ <Outlet />
737
+ </ActivityLayout>
738
+ ```
728
739
 
729
740
  ### The page and the cards look the same
730
741
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "3.26.1",
3
+ "version": "3.27.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"