@nxgt/material 3.12.1 → 3.13.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 +37 -0
- package/README.md +15 -13
- package/dist/{async-slice-4qbER86I.js → async-slice-ChtlTP8W.js} +2 -2
- package/dist/{background-cEqcZQ3v.js → background-Ce7M5V42.js} +2 -1
- package/dist/backgrounds/css-react/icons-quiet.css +43 -0
- package/dist/backgrounds/css-react/icons.css +2 -0
- package/dist/backgrounds.js +1 -1
- package/dist/{button-BNjw-pnE.js → button-BrgyWw7T.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-DLgQTJBZ.js → chip-BZu-bvAJ.js} +1 -1
- package/dist/{code-editor-BZbaYLvo.js → code-editor-DjY7_8TH.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-BT5BO5w6.js → code-language-items-D1lpNQ6J.js} +2 -2
- package/dist/components/components.css +2 -0
- package/dist/components/ui/display/avatar/avatar.css +17 -0
- package/dist/components/ui/feedback/alert/alert.css +16 -0
- package/dist/{components-yx1t_5_P.js → components-BQWoJgYR.js} +15131 -14980
- package/dist/components.js +26 -26
- package/dist/{dialog-BQp5IdFl.js → dialog-rOMjlKJ7.js} +1 -1
- package/dist/dnd.js +1 -1
- package/dist/draw-animate.js +1 -1
- package/dist/draw.js +1 -1
- package/dist/{drawing-B8VuG7nx.js → drawing-iP1SDjdL.js} +60 -54
- package/dist/{dropdown-menu-BsH9W_3C.js → dropdown-menu-BEyP-A0J.js} +1 -1
- package/dist/editor.js +527 -527
- package/dist/{empty-state-WaU4-T2c.js → empty-state-ZtqqpX0S.js} +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{i18n-provider-C6HhBw34.js → i18n-provider-GV4Ukoe2.js} +1 -1
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-DUAq9f7H.js → icon-badge-_tY1MwU9.js} +1 -1
- package/dist/lib/backgrounds/background/types.d.ts +2 -1
- package/dist/lib/backgrounds/index.d.ts +1 -1
- package/dist/lib/components/ui/collections/data-table/numeric-class.d.ts +2 -0
- package/dist/lib/components/ui/collections/data-table/table-meta.d.ts +8 -3
- package/dist/lib/components/ui/display/entity-header/entity-header.d.ts +8 -2
- package/dist/lib/components/ui/display/entity-header/entity-stats.d.ts +1 -1
- package/dist/lib/components/ui/display/entity-header/partials/entity-header-body.d.ts +2 -1
- package/dist/lib/components/ui/display/list-tile/list-tile.d.ts +43 -8
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-body.d.ts +4 -1
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-line.d.ts +3 -0
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-toggle.d.ts +20 -0
- package/dist/lib/components/ui/display/stat-card/index.d.ts +2 -0
- package/dist/lib/components/ui/display/stat-card/stat-card-group.d.ts +12 -0
- package/dist/lib/components/ui/feedback/alert/alert-tone-icon.d.ts +9 -0
- package/dist/lib/components/ui/feedback/alert/alert.d.ts +4 -0
- package/dist/lib/components/ui/fields/form-section/form-section-heading-classes.d.ts +4 -0
- package/dist/lib/components/ui/fields/form-section/form-section.d.ts +9 -1
- package/dist/lib/components/ui/layout/list-details-layout/list-details-layout.d.ts +12 -2
- package/dist/lib/components/ui/layout/list-details-layout/partials/list-details-back.d.ts +16 -0
- package/dist/lib/components/ui/layout/list-details-layout/partials/list-details-details.d.ts +11 -3
- package/dist/lib/components/ui/layout/list-details-layout/partials/pane-opener.d.ts +15 -0
- package/dist/lib/components/ui/layout/list-details-layout/partials/use-container-narrow.d.ts +7 -0
- package/dist/lib/components/ui/layout/list-details-layout/partials/use-pane-focus.d.ts +13 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-types.d.ts +6 -0
- package/dist/lib/components/ui/widgets/drawing/partials/drawing-root.d.ts +5 -1
- package/dist/lib/draw-animate/morph-drawing.d.ts +2 -8
- package/dist/lib/i18n/resources/en/en.d.ts +3 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +3 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +3 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +3 -0
- package/dist/lib/i18n/resources/resources.d.ts +6 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/print/components/print-document/print-document.d.ts +12 -2
- package/dist/lib/print/index.d.ts +2 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +43 -43
- package/dist/map.js +4 -4
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +101 -98
- package/dist/{public-B0Nq_yYV.js → public-D_Gz7wgr.js} +6 -6
- package/dist/{rich-code-block-v7WmeZp9.js → rich-code-block-RN-EpeTA.js} +4 -4
- package/dist/{sortable-provider-CgDTolQR.js → sortable-provider-Iej7IS4n.js} +1 -1
- package/dist/{spinner-BtSIYVrC.js → spinner-BwWDXIbg.js} +1 -1
- package/dist/{stored-language-BeIKw3-K.js → stored-language-BAAP7qS3.js} +4 -2
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-B2Pehdhn.js → theme-toggle-8zHeXSD1.js} +1 -1
- package/dist/{toolbar-items-rUHdVqAq.js → toolbar-items-CVQBYp4K.js} +2 -2
- package/dist/{translate-material-Bd_KgfB8.js → translate-material-C0aOnHpZ.js} +2 -2
- package/dist/{translator-Dje8HrNz.js → translator-BU07gNva.js} +1 -1
- package/dist/{use-chat-composer-B0_STpQN.js → use-chat-composer-P4GxmCHa.js} +14 -14
- package/dist/{use-heading-spy-DXo6IOX9.js → use-heading-spy-DETdqnB6.js} +1 -1
- package/dist/{use-material-translation-B3V_bz-5.js → use-material-translation-DGeVp-qP.js} +2 -2
- package/docs/components/data-display.md +60 -8
- package/docs/components/data-table-filter-and-lists.md +1 -1
- package/docs/components/feedback-and-status.md +22 -4
- package/docs/components/form-fields.md +14 -3
- package/docs/components/navigation-and-layout.md +8 -3
- package/docs/guides/backgrounds.md +35 -2
- package/docs/guides/drawing.md +15 -0
- package/docs/guides/printing.md +113 -2
- package/docs/previews/feedback-status-alert.webp +0 -0
- package/docs/roadmap.md +5 -3
- package/docs/troubleshooting.md +45 -0
- package/lib/backgrounds/css-react/icons-quiet.css +43 -0
- package/lib/backgrounds/css-react/icons.css +2 -0
- package/lib/components/components.css +2 -0
- package/lib/components/ui/display/avatar/avatar.css +17 -0
- package/lib/components/ui/feedback/alert/alert.css +16 -0
- package/package.json +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { t } from "./use-material-translation-
|
|
2
|
+
import { t } from "./use-material-translation-DGeVp-qP.js";
|
|
3
3
|
import { i as n } from "./escape-owner-C4W_sOAU.js";
|
|
4
4
|
import { a as r, c as i, i as a, n as o, o as s, r as c, t as l, u } from "./state-scenes-BX03WmSu.js";
|
|
5
5
|
import { AlertCircle as d, Construction as f, FileQuestion as p, PackageOpen as m, Search as h, ShieldAlert as g, WifiOff as _ } from "lucide-react";
|
package/dist/hooks.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as e } from "./i18n-provider-
|
|
1
|
+
import { r as e } from "./i18n-provider-GV4Ukoe2.js";
|
|
2
2
|
import { a as t, i as n, o as r, r as i, s as a } from "./theme-store-CSl51uNH.js";
|
|
3
3
|
import { n as o, t as s } from "./use-theme-DMcyJ52N.js";
|
|
4
4
|
import { t as c } from "./number.utils-BG_eEt5g.js";
|
|
5
|
-
import { n as l, r as u, t as d } from "./use-heading-spy-
|
|
5
|
+
import { n as l, r as u, t as d } from "./use-heading-spy-DETdqnB6.js";
|
|
6
6
|
import { r as f } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
7
7
|
import { t as p } from "./use-mobile-BDro060N.js";
|
|
8
8
|
import { t as m } from "./use-scroll-away-PQRFZkT2.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e, r as t, t as n } from "./stored-language-
|
|
1
|
+
import { i as e, r as t, t as n } from "./stored-language-BAAP7qS3.js";
|
|
2
2
|
import { createContext as r, useCallback as i, useContext as a, useMemo as o, useState as s } from "react";
|
|
3
3
|
import { jsx as c } from "react/jsx-runtime";
|
|
4
4
|
//#region lib/i18n/i18n-provider.tsx
|
package/dist/i18n.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "./is-production-GLw59WU8.js";
|
|
2
|
-
import { a as t, i as n, n as r, r as i } from "./stored-language-
|
|
3
|
-
import { n as a, r as o, t as s } from "./i18n-provider-
|
|
4
|
-
import { i as c, n as l, o as u, r as d, t as f } from "./translator-
|
|
2
|
+
import { a as t, i as n, n as r, r as i } from "./stored-language-BAAP7qS3.js";
|
|
3
|
+
import { n as a, r as o, t as s } from "./i18n-provider-GV4Ukoe2.js";
|
|
4
|
+
import { i as c, n as l, o as u, r as d, t as f } from "./translator-BU07gNva.js";
|
|
5
5
|
import { o as p, t as m } from "./merge-BCZE6HGq.js";
|
|
6
|
-
import { t as h } from "./translate-material-
|
|
7
|
-
import { t as g } from "./use-material-translation-
|
|
6
|
+
import { t as h } from "./translate-material-C0aOnHpZ.js";
|
|
7
|
+
import { t as g } from "./use-material-translation-DGeVp-qP.js";
|
|
8
8
|
import { useCallback as _ } from "react";
|
|
9
9
|
//#region lib/i18n/merge-resources.ts
|
|
10
10
|
function v(e, t, n = "") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { f as t } from "./dialog-
|
|
2
|
+
import { f as t } from "./dialog-rOMjlKJ7.js";
|
|
3
3
|
import { a as n, i as r, n as i } from "./field-blur-context-Cft9s7Hg.js";
|
|
4
4
|
import { t as a } from "./icon-button-ifTpXt0A.js";
|
|
5
5
|
import { isValidElement as o, useId as s } from "react";
|
|
@@ -54,7 +54,8 @@ export interface BackgroundProps extends ComponentProps<'div'> {
|
|
|
54
54
|
iconStyle?: IconStyleInput;
|
|
55
55
|
/** The `icons` preset: `layout` (`'scatter'`, `'grid'`, `'constellation'`,
|
|
56
56
|
* `'drift'`), `sizeRange`, `rotation`, `duotone` (`'opacity'` or `'tones'`),
|
|
57
|
-
* `secondaryOpacity` and `
|
|
57
|
+
* `secondaryOpacity`, `calm` and `quiet` (a band the icons fade out of, for
|
|
58
|
+
* text over the motif). A new object with the same values is the
|
|
58
59
|
* same scene. */
|
|
59
60
|
iconMotif?: IconMotifOptions;
|
|
60
61
|
/** `'viewport'` is the viewport's size (as in `/components`);
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
* name (same props, plus every preset's), with the types and the engine's
|
|
10
10
|
* tables re-exported from `@nxgt/material-core/backgrounds` by name.
|
|
11
11
|
*/
|
|
12
|
-
export { BACKGROUND_INTENSITIES, BACKGROUND_PRESETS, BACKGROUND_TONES, type BackgroundIntensity, type BackgroundPreset, type BackgroundTone, type CelestialPreset, type IconLayout, type IconMotifOptions, type IconStyleInput, type IconStyleRef, type IconsInput, MOTIF_SHAPES, MOTIF_SHAPES_ALL, type MoonOptions, type MotifDensity, type MotifOptions, type MotifShape, type MotifSize, type OpacitySpread, type PresetInfo, SHIPPED_BACKGROUND_PRESETS, type ShapeFill, type ShippedBackgroundPreset, type SkyPreset, } from '@nxgt/material-core/backgrounds';
|
|
12
|
+
export { BACKGROUND_INTENSITIES, BACKGROUND_PRESETS, BACKGROUND_TONES, type BackgroundIntensity, type BackgroundPreset, type BackgroundTone, type CelestialPreset, type IconLayout, type IconMotifOptions, type IconQuiet, type IconStyleInput, type IconStyleRef, type IconsInput, MOTIF_SHAPES, MOTIF_SHAPES_ALL, type MoonOptions, type MotifDensity, type MotifOptions, type MotifShape, type MotifSize, type OpacitySpread, type PresetInfo, SHIPPED_BACKGROUND_PRESETS, type ShapeFill, type ShippedBackgroundPreset, type SkyPreset, } from '@nxgt/material-core/backgrounds';
|
|
13
13
|
export { Background, type BackgroundProps } from './background/index.js';
|
|
14
14
|
export { AVAILABLE_BACKGROUND_PRESETS, type AvailableBackgroundPreset, } from './background/available.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CellData, RowData, TableFeatures } from '@tanstack/react-table';
|
|
2
2
|
/**
|
|
3
|
-
* `columnDef.meta.className`, read by `DataTable`
|
|
4
|
-
* the column, and `columnDef.meta.label`, the
|
|
5
|
-
* on TanStack's `ColumnMeta`, so it types a consumer's
|
|
3
|
+
* `columnDef.meta.className` and `columnDef.meta.numeric`, read by `DataTable`
|
|
4
|
+
* on each header and cell of the column, and `columnDef.meta.label`, the
|
|
5
|
+
* column's plain name. Declared on TanStack's `ColumnMeta`, so it types a consumer's
|
|
6
6
|
* column definitions too: `index.ts` re-exports this module so that the
|
|
7
7
|
* published declarations carry the augmentation wherever `DataTable` is
|
|
8
8
|
* imported from.
|
|
@@ -10,6 +10,11 @@ import { CellData, RowData, TableFeatures } from '@tanstack/react-table';
|
|
|
10
10
|
declare module '@tanstack/react-table' {
|
|
11
11
|
interface ColumnMeta<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
12
12
|
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* A column of figures: its header and cells are flush to the end and set
|
|
15
|
+
* in tabular digits (`tabular-nums`), so decimals line up down the column.
|
|
16
|
+
*/
|
|
17
|
+
numeric?: boolean;
|
|
13
18
|
/** The column's plain name, where a render function `header` has none to
|
|
14
19
|
* give: the sort control's option in the `cards` layout. Default: a
|
|
15
20
|
* string `header`, then the column's id. */
|
|
@@ -5,11 +5,17 @@ export type { EntityStat } from './entity-stats.js';
|
|
|
5
5
|
export type EntityHeaderProps = {
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
/**
|
|
8
|
-
* The heading (an `h1`). Leave it out when the page's `h1` is elsewhere, such
|
|
8
|
+
* The heading (an `h1`, or the `headingLevel` you choose). Leave it out when the page's `h1` is elsewhere, such
|
|
9
9
|
* as the app bar's `handle.title`: no heading is rendered, and the root stays
|
|
10
10
|
* a plain `div`, never a landmark, so nothing is left unnamed.
|
|
11
11
|
*/
|
|
12
12
|
title?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The title's heading level, `1` by default. Pass `2` or `3` when the page
|
|
15
|
+
* already has its `h1` (a list title beside a detail header), so the
|
|
16
|
+
* outline stays in order. The look does not change with the level.
|
|
17
|
+
*/
|
|
18
|
+
headingLevel?: 1 | 2 | 3;
|
|
13
19
|
status?: React.ReactNode;
|
|
14
20
|
metadata?: {
|
|
15
21
|
label: string;
|
|
@@ -23,4 +29,4 @@ export type EntityHeaderProps = {
|
|
|
23
29
|
stats?: EntityStat[];
|
|
24
30
|
actions?: ResponsiveButtonProps[] | React.ReactNode;
|
|
25
31
|
} & Pick<IconButtonProps, 'variant' | 'color'> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>;
|
|
26
|
-
export declare function EntityHeader({ color, variant, icon, title, status, metadata, stats, actions, className, children, ...props }: EntityHeaderProps): import("react").JSX.Element;
|
|
32
|
+
export declare function EntityHeader({ color, variant, icon, title, headingLevel, status, metadata, stats, actions, className, children, ...props }: EntityHeaderProps): import("react").JSX.Element;
|
|
@@ -9,7 +9,7 @@ export type EntityStat = {
|
|
|
9
9
|
export declare const hasStatValue: (stat: EntityStat) => boolean;
|
|
10
10
|
/**
|
|
11
11
|
* The figures of an EntityHeader (counts, a mean) as compact StatCard tiles in
|
|
12
|
-
* a row that wraps. A tile with a `tone` is tonal; without one it is outlined.
|
|
12
|
+
* a StatCardGroup: 2×2 on a phone, a row that wraps beside. A tile with a `tone` is tonal; without one it is outlined.
|
|
13
13
|
*/
|
|
14
14
|
export declare function EntityStats({ data }: {
|
|
15
15
|
data: EntityStat[];
|
|
@@ -3,8 +3,9 @@ import { EntityStat } from '../entity-stats.js';
|
|
|
3
3
|
* The column beside the icon: the heading and the status on one line, the
|
|
4
4
|
* metadata and the stats under it.
|
|
5
5
|
*/
|
|
6
|
-
export declare function EntityHeaderBody({ title, status, metadata, stats, }: {
|
|
6
|
+
export declare function EntityHeaderBody({ title, headingLevel, status, metadata, stats, }: {
|
|
7
7
|
title?: React.ReactNode;
|
|
8
|
+
headingLevel?: 1 | 2 | 3;
|
|
8
9
|
status?: React.ReactNode;
|
|
9
10
|
metadata: {
|
|
10
11
|
label: string;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { HTMLAttributes, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { LinkComponent } from '../../primitives/link/link-component.js';
|
|
3
|
-
|
|
3
|
+
import { ListTileToggle } from './partials/list-tile-toggle.js';
|
|
4
|
+
export type { ListTileToggle } from './partials/list-tile-toggle.js';
|
|
5
|
+
export type ListTileCommonProps = {
|
|
4
6
|
leading?: ReactNode;
|
|
5
7
|
/** Inside the row (and the link): decoration, never a button. */
|
|
6
8
|
trailing?: ReactNode;
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
subtitle?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The tile is the current one. A link tile (`href`) gets
|
|
13
|
+
* `aria-current="page"` (pass your own `aria-current`, such as `"true"`
|
|
14
|
+
* for a selection that is not a page, to replace it) and the selected look;
|
|
15
|
+
* a button tile (`onClick`) gets `aria-pressed`. For list-detail
|
|
16
|
+
* navigation, give `selected` from the router's location and the tile
|
|
17
|
+
* keeps a shareable URL.
|
|
18
|
+
*/
|
|
19
|
+
selected?: boolean;
|
|
20
|
+
size?: 'sm' | 'md';
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
} & Omit<HTMLAttributes<HTMLElement>, 'children' | 'title' | 'onClick'>;
|
|
23
|
+
export type ListTileLinkOrButtonProps = {
|
|
7
24
|
/**
|
|
8
25
|
* Buttons at the end of the tile, vertically centred, outside the link: a
|
|
9
26
|
* link tile's `trailing` sits inside its `<a>`, which cannot hold
|
|
@@ -11,10 +28,6 @@ export type ListTileProps = {
|
|
|
11
28
|
* sit above it; the tab order is the link, then the actions.
|
|
12
29
|
*/
|
|
13
30
|
actions?: ReactNode;
|
|
14
|
-
title: ReactNode;
|
|
15
|
-
subtitle?: ReactNode;
|
|
16
|
-
selected?: boolean;
|
|
17
|
-
size?: 'sm' | 'md';
|
|
18
31
|
href?: string;
|
|
19
32
|
/**
|
|
20
33
|
* A discreet chevron after `trailing`, flipped in right-to-left, decorative
|
|
@@ -30,7 +43,29 @@ export type ListTileProps = {
|
|
|
30
43
|
* router `Link` wrapper for client-side navigation.
|
|
31
44
|
*/
|
|
32
45
|
linkComponent?: LinkComponent;
|
|
33
|
-
disabled?: boolean;
|
|
34
46
|
onClick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
toggle?: undefined;
|
|
48
|
+
};
|
|
49
|
+
export type ListTileSwitchProps = {
|
|
50
|
+
/**
|
|
51
|
+
* Makes the tile a switch row: the tile is a `<label>` for a Switch at its
|
|
52
|
+
* end, so a press anywhere on the row toggles it. The switch is the one tab
|
|
53
|
+
* stop, named by `title` and described by `subtitle`. It takes the Switch's
|
|
54
|
+
* props (`checked`, `onCheckedChange`, `name`…); `disabled` on the tile
|
|
55
|
+
* disables it too. A switch row is neither a link nor a button: `href`,
|
|
56
|
+
* `onClick`, `actions` and `chevron` do not apply to it.
|
|
57
|
+
*/
|
|
58
|
+
toggle: ListTileToggle;
|
|
59
|
+
href?: never;
|
|
60
|
+
onClick?: never;
|
|
61
|
+
actions?: never;
|
|
62
|
+
chevron?: never;
|
|
63
|
+
linkComponent?: never;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A link or button tile, or a switch row (`toggle`): a switch row is neither
|
|
67
|
+
* a link nor a button, so `href`, `onClick`, `actions`, `chevron` and
|
|
68
|
+
* `linkComponent` do not type-check beside `toggle`.
|
|
69
|
+
*/
|
|
70
|
+
export type ListTileProps = ListTileCommonProps & (ListTileLinkOrButtonProps | ListTileSwitchProps);
|
|
71
|
+
export declare function ListTile({ toggle, ...props }: ListTileProps): import("react").JSX.Element;
|
|
@@ -7,6 +7,9 @@ type ListTileBodyProps = {
|
|
|
7
7
|
subtitle?: ReactNode;
|
|
8
8
|
compact: boolean;
|
|
9
9
|
selected?: boolean;
|
|
10
|
+
/** Ids of the title and the subtitle, for a control that is named by them. */
|
|
11
|
+
titleId?: string;
|
|
12
|
+
subtitleId?: string;
|
|
10
13
|
};
|
|
11
|
-
export declare function ListTileBody({ leading, trailing, chevron, title, subtitle, compact, selected, }: ListTileBodyProps): import("react").JSX.Element;
|
|
14
|
+
export declare function ListTileBody({ leading, trailing, chevron, title, subtitle, compact, selected, titleId, subtitleId, }: ListTileBodyProps): import("react").JSX.Element;
|
|
12
15
|
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ListTileCommonProps, ListTileLinkOrButtonProps } from '../list-tile.js';
|
|
2
|
+
/** A link, a button or a plain tile, with or without `actions` beside it. */
|
|
3
|
+
export declare function ListTileLine({ title, subtitle, leading, trailing, actions, className, selected, size, href, chevron, linkComponent, disabled, onClick, ...props }: ListTileCommonProps & Omit<ListTileLinkOrButtonProps, 'toggle'>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SwitchControlProps } from '../../../fields/switch/partials/switch-control.js';
|
|
2
|
+
import { ListTileCommonProps } from '../list-tile.js';
|
|
3
|
+
/**
|
|
4
|
+
* The switch of a switch row (`ListTile`'s `toggle`): a Switch's own props,
|
|
5
|
+
* `checked`, `defaultChecked`, `onCheckedChange`, `disabled`, `name`,
|
|
6
|
+
* `thumbIcons`… The row names it, so the naming props are left out.
|
|
7
|
+
*/
|
|
8
|
+
export type ListTileToggle = Omit<SwitchControlProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'children'>;
|
|
9
|
+
type ListTileToggleRowProps = ListTileCommonProps & {
|
|
10
|
+
toggle: ListTileToggle;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A switch row: the tile is a `<label>` for its switch, so a press anywhere
|
|
14
|
+
* on the row toggles it. The switch is the only tab stop (Space or Enter
|
|
15
|
+
* toggle it); it is named by the title and described by the subtitle, so a
|
|
16
|
+
* screen reader reads "Notifications, switch, on, Email and push" rather
|
|
17
|
+
* than the row's whole text as the name.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ListTileToggleRow({ toggle, title, subtitle, leading, trailing, selected, size, disabled, className, ...rootProps }: ListTileToggleRowProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -2,3 +2,5 @@ export type { StatDeltaTone } from './format-stat-delta.js';
|
|
|
2
2
|
export { formatStatDelta } from './format-stat-delta.js';
|
|
3
3
|
export type { StatCardProps, StatCardSize, StatCardValueSize, StatCardVariant, } from './stat-card.js';
|
|
4
4
|
export { StatCard } from './stat-card.js';
|
|
5
|
+
export type { StatCardGroupProps } from './stat-card-group.js';
|
|
6
|
+
export { StatCardGroup } from './stat-card-group.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export type StatCardGroupProps = ComponentProps<'div'>;
|
|
3
|
+
/**
|
|
4
|
+
* A band of `StatCard size="sm"` tiles with an even layout (#1493): two
|
|
5
|
+
* columns of equal tiles while the group is narrow (a phone: four tiles make
|
|
6
|
+
* a 2×2 grid, an odd last tile takes the whole row), and one row of tiles
|
|
7
|
+
* that hug their content, wrapping when it must, from `md` (28 rem) of the
|
|
8
|
+
* group's own width. It reads the group's width, not the viewport's, so it
|
|
9
|
+
* holds in a side panel or a header as well. Pass the tiles as children;
|
|
10
|
+
* `EntityHeader`'s `stats` use it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function StatCardGroup({ className, children, ...props }: StatCardGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AlertVariantProps } from './alert-variants.js';
|
|
3
|
+
export type AlertTone = NonNullable<AlertVariantProps['variant']>;
|
|
4
|
+
/**
|
|
5
|
+
* The icon each tone shows when none is passed, shared by Alert and Banner so
|
|
6
|
+
* the two cannot drift. The neutral tones (`primary`, `secondary`,
|
|
7
|
+
* `foreground`) read as information.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TONE_ICON: Record<AlertTone, ReactNode>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { AlertVariantProps } from './alert-variants.js';
|
|
3
3
|
export type AlertProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Unset: the tone's icon (the same as Banner's). `null` (or `false`)
|
|
6
|
+
* shows no icon; any node replaces the tone's icon.
|
|
7
|
+
*/
|
|
4
8
|
icon?: ReactNode;
|
|
5
9
|
title?: ReactNode;
|
|
6
10
|
description?: ReactNode;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The title: `title-md` emphasized, in the text colour. */
|
|
2
|
+
export declare const formSectionHeadingTitleClass = "min-w-0 break-words text-title-md-em";
|
|
3
|
+
/** The description: `body-md`, muted (4.5:1 on the form's background). */
|
|
4
|
+
export declare const formSectionHeadingDescriptionClass = "break-words text-body-md text-muted-foreground";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { FormSectionTitleElement } from './form-section-classes.js';
|
|
3
3
|
export type { FormSectionTitleElement } from './form-section-classes.js';
|
|
4
|
+
export type FormSectionVariant = 'label' | 'heading';
|
|
4
5
|
export type FormSectionProps = Omit<ComponentProps<'div'>, 'title'> & {
|
|
5
6
|
/** The section's heading. */
|
|
6
7
|
title: ReactNode;
|
|
@@ -13,6 +14,13 @@ export type FormSectionProps = Omit<ComponentProps<'div'>, 'title'> & {
|
|
|
13
14
|
description?: ReactNode;
|
|
14
15
|
/** Controls beside the title (e.g. "Add"), wrapping under it on a phone. */
|
|
15
16
|
actions?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* `label` (default) is the small uppercase muted title that sets the
|
|
19
|
+
* section apart from its fields' labels. `heading` puts the title on the
|
|
20
|
+
* type scale (`title-md` emphasized) and the description in `body-md`,
|
|
21
|
+
* muted: a section title like the design rules ask for.
|
|
22
|
+
*/
|
|
23
|
+
variant?: FormSectionVariant;
|
|
16
24
|
/** A rule above the section when it follows another FormSection. Default `true`. */
|
|
17
25
|
separated?: boolean;
|
|
18
26
|
};
|
|
@@ -22,4 +30,4 @@ export type FormSectionProps = Omit<ComponentProps<'div'>, 'title'> & {
|
|
|
22
30
|
* `[data-slot="form-fields"]` it takes a whole row and lays its fields out
|
|
23
31
|
* in the form's columns; one column on a phone.
|
|
24
32
|
*/
|
|
25
|
-
export declare function FormSection({ title, titleAs: Title, description, actions, separated, className, children, ...props }: FormSectionProps): import("react").JSX.Element;
|
|
33
|
+
export declare function FormSection({ title, titleAs: Title, description, actions, variant, separated, className, children, ...props }: FormSectionProps): import("react").JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
|
+
import { ListDetailsBack } from './partials/list-details-back.js';
|
|
2
3
|
import { ListPosition, ViewState } from './partials/list-details-context.js';
|
|
3
4
|
import { ListDetailsDetails } from './partials/list-details-details.js';
|
|
4
5
|
import { ListDetailsList } from './partials/list-details-list.js';
|
|
5
6
|
import { ListDetailsTrigger } from './partials/list-details-trigger.js';
|
|
7
|
+
export { ListDetailsBack, type ListDetailsBackProps, } from './partials/list-details-back.js';
|
|
6
8
|
export { useListDetails } from './partials/list-details-context.js';
|
|
7
|
-
export { ListDetailsDetails } from './partials/list-details-details.js';
|
|
9
|
+
export { ListDetailsDetails, type ListDetailsDetailsProps, } from './partials/list-details-details.js';
|
|
8
10
|
export { ListDetailsList, type ListDetailsListProps, } from './partials/list-details-list.js';
|
|
9
11
|
export { ListDetailsTrigger, type ListDetailsTriggerProps, } from './partials/list-details-trigger.js';
|
|
10
12
|
export interface ListDetailsLayoutProps extends ComponentProps<'div'> {
|
|
@@ -12,11 +14,19 @@ export interface ListDetailsLayoutProps extends ComponentProps<'div'> {
|
|
|
12
14
|
onActiveViewChange?: (view: ViewState) => void;
|
|
13
15
|
defaultActiveView?: ViewState;
|
|
14
16
|
listPosition?: ListPosition;
|
|
17
|
+
/**
|
|
18
|
+
* What the phone layout (one pane at a time) follows: `'viewport'`
|
|
19
|
+
* (default) the window, at 648px or less; `'container'` the layout's own
|
|
20
|
+
* width, at 648px or less, for a layout in a column, a dialog or a split
|
|
21
|
+
* pane of a wide window.
|
|
22
|
+
*/
|
|
23
|
+
breakpoint?: 'viewport' | 'container';
|
|
15
24
|
}
|
|
16
|
-
export declare function ListDetailsLayout({ children, className, activeView: controlledActiveView, onActiveViewChange, defaultActiveView, listPosition, ...props }: ListDetailsLayoutProps): import("react").JSX.Element;
|
|
25
|
+
export declare function ListDetailsLayout({ children, className, activeView: controlledActiveView, onActiveViewChange, defaultActiveView, listPosition, breakpoint, ...props }: ListDetailsLayoutProps): import("react").JSX.Element;
|
|
17
26
|
export declare namespace ListDetailsLayout {
|
|
18
27
|
var displayName: string;
|
|
19
28
|
var List: typeof ListDetailsList;
|
|
20
29
|
var Details: typeof ListDetailsDetails;
|
|
21
30
|
var Trigger: typeof ListDetailsTrigger;
|
|
31
|
+
var Back: typeof ListDetailsBack;
|
|
22
32
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '../../../actions/button/button.js';
|
|
3
|
+
export interface ListDetailsBackProps extends Omit<ButtonProps, 'children' | 'onClick'> {
|
|
4
|
+
/** The visible label; the default is the translated "Back to the list". */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
onClick?: ButtonProps['onClick'];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The way back from the details to the list on a phone, where one pane shows
|
|
10
|
+
* at a time. It renders nothing otherwise (a wide screen, or the list showing).
|
|
11
|
+
* The layout moves the focus back to the list item that opened the details.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ListDetailsBack({ children, onClick, ...props }: ListDetailsBackProps): import("react").JSX.Element | null;
|
|
14
|
+
export declare namespace ListDetailsBack {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
package/dist/lib/components/ui/layout/list-details-layout/partials/list-details-details.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { ListDetailsChildren } from './list-details-context.js';
|
|
3
|
-
export
|
|
3
|
+
export type ListDetailsDetailsProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
4
4
|
children: ListDetailsChildren;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A bar with the way back to the list, over the details, on a phone only
|
|
7
|
+
* (one pane shows at a time there). `true` shows the translated
|
|
8
|
+
* "Back to the list"; a node is its label. Leave it out to place a
|
|
9
|
+
* {@link ListDetailsBack} yourself, in your own header.
|
|
10
|
+
*/
|
|
11
|
+
back?: boolean | ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare function ListDetailsDetails({ children, className, back, ...props }: ListDetailsDetailsProps): import("react").JSX.Element;
|
|
6
14
|
export declare namespace ListDetailsDetails {
|
|
7
15
|
var displayName: string;
|
|
8
16
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** What the record logic needs of an element: no DOM global, so it tests without a browser. */
|
|
2
|
+
export type OpenerNode = {
|
|
3
|
+
closest(selector: string): OpenerNode | null;
|
|
4
|
+
isConnected: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The element of the list pane a focus or a pointer press landed on: for a
|
|
8
|
+
* press, the closest pressable (Safari and iOS do not focus a button or a link
|
|
9
|
+
* on a tap); for a focus, the element itself. `null` outside the list pane.
|
|
10
|
+
*/
|
|
11
|
+
export declare function openerOf<T extends OpenerNode = OpenerNode>(target: unknown, kind: 'focus' | 'pointer'): T | null;
|
|
12
|
+
/** The record is still worth focusing: attached and inside the list pane. */
|
|
13
|
+
export declare function usableOpener<T extends OpenerNode>(opener: T | null, list: {
|
|
14
|
+
contains(node: never): boolean;
|
|
15
|
+
} | null | undefined): opener is T;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the element is at most `width` px wide, watched with a
|
|
4
|
+
* ResizeObserver. `false` until measured (the server and the hydrating client
|
|
5
|
+
* both render the wide layout, as the viewport query does).
|
|
6
|
+
*/
|
|
7
|
+
export declare function useContainerNarrow(ref: RefObject<HTMLElement | null>, width: number, enabled: boolean): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { ViewState } from './list-details-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* On a phone one pane shows at a time, so the focus must follow the view:
|
|
5
|
+
* opening the details focuses the details pane; coming back focuses the list
|
|
6
|
+
* item that opened them (or the list pane when it is gone). Nothing moves on
|
|
7
|
+
* the first render, on a wide screen, or when the view did not change.
|
|
8
|
+
* The opener is the last element focused inside the list pane, tracked with
|
|
9
|
+
* `focusin` or, for a tap that focuses nothing (Safari, iOS), `pointerdown`;
|
|
10
|
+
* the last one wins, so it holds whatever changes the view: the context, a
|
|
11
|
+
* controlled `activeView` driven by a URL, or a link row.
|
|
12
|
+
*/
|
|
13
|
+
export declare function usePaneFocus(root: RefObject<HTMLElement | null>, activeView: ViewState, matches: boolean): void;
|
|
@@ -16,10 +16,16 @@ export type NodeClick = (id: string, event: MouseEvent<SVGGElement>) => void;
|
|
|
16
16
|
/** The root takes a name or is decorative, never neither: the type enforces it. */
|
|
17
17
|
export type DrawingName = {
|
|
18
18
|
title: string;
|
|
19
|
+
/**
|
|
20
|
+
* A long description for assistive technology, such as a chart's data:
|
|
21
|
+
* a `<desc>` the root names in `aria-describedby`.
|
|
22
|
+
*/
|
|
23
|
+
description?: string;
|
|
19
24
|
decorative?: never;
|
|
20
25
|
} | {
|
|
21
26
|
decorative: true;
|
|
22
27
|
title?: never;
|
|
28
|
+
description?: never;
|
|
23
29
|
};
|
|
24
30
|
type Root = Omit<ComponentProps<'svg'>, 'children' | 'style' | 'title' | 'role' | 'width' | 'height' | 'viewBox' | 'aria-label' | 'aria-labelledby' | 'aria-hidden'>;
|
|
25
31
|
type Shared = Root & {
|
|
@@ -3,6 +3,10 @@ import { RootRole } from '../drawing-a11y.js';
|
|
|
3
3
|
type Props = {
|
|
4
4
|
role: RootRole;
|
|
5
5
|
title?: string;
|
|
6
|
+
/** A `<desc>` named by `aria-describedby`; needs a title. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** The `<desc>`'s id. */
|
|
9
|
+
descriptionId?: string;
|
|
6
10
|
/** `width`, `height` and `viewBox`. */
|
|
7
11
|
attrs: Record<string, string | number>;
|
|
8
12
|
rest: Record<string, unknown>;
|
|
@@ -13,5 +17,5 @@ type Props = {
|
|
|
13
17
|
* `createElement`: the role is data (drawing-a11y.ts), and there is never a
|
|
14
18
|
* `<title>` (React 19 would hoist it into the document head).
|
|
15
19
|
*/
|
|
16
|
-
export declare function DrawingRoot({ role, title, attrs, rest, children }: Props): import('react').ReactSVGElement;
|
|
20
|
+
export declare function DrawingRoot({ role, title, description, descriptionId, attrs, rest, children, }: Props): import('react').ReactSVGElement;
|
|
17
21
|
export {};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { Scene } from '@nxgt/material-core/draw';
|
|
2
|
-
import { SceneDrawingProps } from '../components/ui/widgets/drawing/drawing-types.js';
|
|
2
|
+
import { DrawingName, SceneDrawingProps } from '../components/ui/widgets/drawing/drawing-types.js';
|
|
3
3
|
export type MorphDrawingProps = Omit<SceneDrawingProps, 'scene' | 'ref' | 'handlers' | 'from' | 'to'> & {
|
|
4
4
|
from: Scene;
|
|
5
5
|
to: Scene;
|
|
6
6
|
/** False draws `from`, true draws `to`; a change morphs between them. */
|
|
7
7
|
active: boolean;
|
|
8
|
-
} &
|
|
9
|
-
title: string;
|
|
10
|
-
decorative?: never;
|
|
11
|
-
} | {
|
|
12
|
-
decorative: true;
|
|
13
|
-
title?: never;
|
|
14
|
-
});
|
|
8
|
+
} & DrawingName;
|
|
15
9
|
/**
|
|
16
10
|
* A drawing that morphs from one scene to the other when `active` changes,
|
|
17
11
|
* writing each frame into the `d` of the paths the two scenes share by `id`
|
|
@@ -2660,6 +2660,9 @@ declare const _default: {
|
|
|
2660
2660
|
"scatter-range": "{axis} from {min} to {max}.",
|
|
2661
2661
|
"scatter-series": "{series}: {count, plural, one {# point} other {# points}}."
|
|
2662
2662
|
}
|
|
2663
|
+
},
|
|
2664
|
+
"list-details": {
|
|
2665
|
+
"back": "Back to the list"
|
|
2663
2666
|
}
|
|
2664
2667
|
}
|
|
2665
2668
|
;
|
|
@@ -2660,6 +2660,9 @@ declare const _default: {
|
|
|
2660
2660
|
"scatter-range": "{axis} de {min} à {max}.",
|
|
2661
2661
|
"scatter-series": "{series} : {count, plural, one {# point} other {# points}}."
|
|
2662
2662
|
}
|
|
2663
|
+
},
|
|
2664
|
+
"list-details": {
|
|
2665
|
+
"back": "Retour à la liste"
|
|
2663
2666
|
}
|
|
2664
2667
|
}
|
|
2665
2668
|
;
|
|
@@ -2669,6 +2669,9 @@ export declare const resources: {
|
|
|
2669
2669
|
"scatter-series": string;
|
|
2670
2670
|
};
|
|
2671
2671
|
};
|
|
2672
|
+
"list-details": {
|
|
2673
|
+
back: string;
|
|
2674
|
+
};
|
|
2672
2675
|
};
|
|
2673
2676
|
};
|
|
2674
2677
|
fr: {
|
|
@@ -5335,6 +5338,9 @@ export declare const resources: {
|
|
|
5335
5338
|
"scatter-series": string;
|
|
5336
5339
|
};
|
|
5337
5340
|
};
|
|
5341
|
+
"list-details": {
|
|
5342
|
+
back: string;
|
|
5343
|
+
};
|
|
5338
5344
|
};
|
|
5339
5345
|
};
|
|
5340
5346
|
};
|