@nxgt/material 3.26.0 → 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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/{async-slice-DmElEOGR.js → async-slice-gAbGnQT8.js} +2 -2
- package/dist/{button-e-N2SrR4.js → button-Cr9GIIj4.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-CaIK5m3c.js → chip-s11lOfxB.js} +1 -1
- package/dist/{code-editor-CTNdNmnn.js → code-editor-DGIjL8Hr.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-Cra1Wt0w.js → code-language-items-DCOQnaCo.js} +2 -2
- package/dist/{components-Co11dc5M.js → components-DgpD3FJo.js} +7809 -7770
- package/dist/components.js +15 -15
- package/dist/{dialog-CJUqXZ-U.js → dialog-Crvg-MN5.js} +1 -1
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-D5yDYO-N.js → dropdown-menu-B71aggp0.js} +1 -1
- package/dist/editor.js +7 -7
- package/dist/{empty-state-BHrddQlY.js → empty-state-8LddxMU4.js} +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{i18n-provider-W9rFBjXN.js → i18n-provider-BDi9-6DO.js} +1 -1
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-BnAUnMVr.js → icon-badge-DG7wLnHh.js} +1 -1
- package/dist/lib/components/ui/layout/app-shell/activity-column.d.ts +2 -2
- package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-shell/activity-layout.types.d.ts +11 -0
- package/dist/lib/components/ui/layout/app-shell/backdrop-layer.d.ts +3 -1
- package/dist/lib/components/ui/layout/app-shell/shapes-clear-content.d.ts +24 -0
- package/dist/lib/components/ui/layout/app-shell/theme-backdrop.d.ts +3 -1
- package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +4 -3
- package/dist/lib/components/ui/layout/app-shell/watch-content.d.ts +10 -1
- package/dist/lib/components/ui/layout/auth-card/auth-card-backdrop.d.ts +4 -2
- package/dist/lib/components/ui/layout/auth-card/auth-card.d.ts +4 -2
- package/dist/lib/components/ui/primitives/tabs/partials/tabs-list.d.ts +6 -1
- package/dist/lib/components/ui/primitives/tabs/partials/tabs-scroll-buttons.d.ts +12 -0
- package/dist/lib/components/ui/primitives/tabs/tabs-overflow-classes.d.ts +6 -0
- package/dist/lib/components/ui/primitives/tabs/use-tabs-overflow.d.ts +25 -0
- package/dist/lib/i18n/resources/en/en.d.ts +4 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +4 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +4 -0
- package/dist/lib/i18n/resources/resources.d.ts +8 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +21 -21
- package/dist/map.js +4 -4
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-Bi0CZNsk.js → public-QUiFLEoj.js} +6 -6
- package/dist/{rich-code-block-B81MCyAI.js → rich-code-block-CjD54THr.js} +4 -4
- package/dist/{sortable-provider-CJ5P_QhI.js → sortable-provider-DYnyzfgR.js} +1 -1
- package/dist/{spinner-BuMxoFCj.js → spinner-CJtTRNAX.js} +1 -1
- package/dist/{stored-language-pHK1kTl6.js → stored-language-ClkfkueV.js} +8 -0
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-BAGSB-HE.js → theme-toggle-ufQL3SO6.js} +1 -1
- package/dist/{toolbar-items-BgcE2dSq.js → toolbar-items-DlioFgpM.js} +2 -2
- package/dist/{translate-material-DeVLQZTk.js → translate-material-O-uasx3u.js} +2 -2
- package/dist/{translator-DEPJOWV-.js → translator-C0uxN1Nh.js} +1 -1
- package/dist/{use-chat-composer-Ded2gthF.js → use-chat-composer-DzVO5mwz.js} +1762 -1640
- package/dist/{use-heading-spy-swqwAMjR.js → use-heading-spy-BHCVdJfr.js} +1 -1
- package/dist/{use-material-translation-DgeOLK6g.js → use-material-translation-B4Frk3vC.js} +2 -2
- package/docs/components/navigation-and-layout.md +1 -1
- package/docs/components/primitives.md +6 -1
- package/docs/guides/app-shell.md +38 -0
- package/docs/guides/backgrounds.md +5 -0
- package/docs/guides/i18n.md +2 -1
- package/docs/troubleshooting.md +14 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "./i18n-provider-
|
|
1
|
+
import { r as e } from "./i18n-provider-BDi9-6DO.js";
|
|
2
2
|
import { _ as t, g as n, h as r, n as i, v as a, y as o } from "./number.utils-BG_eEt5g.js";
|
|
3
3
|
import { useCallback as s, useEffect as c, useMemo as l, useRef as u } from "react";
|
|
4
4
|
//#region ../../node_modules/date-fns/locale/fr/_lib/formatDistance.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as e } from "./i18n-provider-
|
|
2
|
-
import { t } from "./translate-material-
|
|
1
|
+
import { r as e } from "./i18n-provider-BDi9-6DO.js";
|
|
2
|
+
import { t } from "./translate-material-O-uasx3u.js";
|
|
3
3
|
import { useCallback as n } from "react";
|
|
4
4
|
//#region lib/i18n/use-material-translation.ts
|
|
5
5
|
function r() {
|
|
@@ -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';
|
|
@@ -732,7 +732,12 @@ Parts: `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent`. `TabsList` and
|
|
|
732
732
|
**`underline`** (the default) lays the tabs over a border; the active one
|
|
733
733
|
takes the primary colour, and a bar under it slides to the tab clicked or
|
|
734
734
|
reached with the arrow keys. The list scrolls sideways when the tabs do not
|
|
735
|
-
fit (its scrollbar hidden), which suits a phone or a narrow popover.
|
|
735
|
+
fit (its scrollbar hidden), which suits a phone or a narrow popover. While it
|
|
736
|
+
overflows, each side with hidden tabs fades and gets a small scroll button
|
|
737
|
+
("Scroll tabs left" / "Scroll tabs right", from `material.tabs.*`; out of the
|
|
738
|
+
tab order, 44px on a touch screen); the selected and the focused tab are
|
|
739
|
+
scrolled into view, instantly under reduced motion. A list that fits has
|
|
740
|
+
neither, and neither is in the server markup. `segmented` does the same.
|
|
736
741
|
|
|
737
742
|
**`segmented`** is a neutral pill track: the active tab sits on a raised
|
|
738
743
|
surface that slides between tabs, and its label turns to the foreground
|
package/docs/guides/app-shell.md
CHANGED
|
@@ -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
|
|
package/docs/guides/i18n.md
CHANGED
|
@@ -240,7 +240,8 @@ presets and `Min`/`Max` fields, the `variant="4"` spinner's label,
|
|
|
240
240
|
`material.slider.minimum` / `maximum` ("Minimum", "Maximum"), and a
|
|
241
241
|
single value's input, when nothing names the slider, `material.slider.value`
|
|
242
242
|
("Value", "Valeur"). `CopyButton` reads `material.copy.copy`, `copied` and `failed` ("Copy", "Copied",
|
|
243
|
-
"Copy failed").
|
|
243
|
+
"Copy failed"). An overflowing `TabsList`'s scroll buttons read
|
|
244
|
+
`material.tabs.scroll-left` / `scroll-right` ("Scroll tabs left" / "Scroll tabs right"). The other icon-only buttons are named from it too: the
|
|
244
245
|
`Sidebar` toggle (`material.sidebar.toggle`), the data table's row expander
|
|
245
246
|
(`material.table.labels.toggle-row`) and its header, a hidden "Expand" / "Déplier"
|
|
246
247
|
(`material.table.labels.expand`), its loading status, "Loading data…" /
|
package/docs/troubleshooting.md
CHANGED
|
@@ -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:**
|
|
726
|
-
the backgrounds guide).
|
|
727
|
-
|
|
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
|
|