@nxgt/material 3.10.2 → 3.12.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.
Files changed (158) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +10 -11
  3. package/dist/{async-slice-DDjaJY_F.js → async-slice-4qbER86I.js} +1 -1
  4. package/dist/button-BNjw-pnE.js +327 -0
  5. package/dist/button-group-context-CaP0X5p_.js +5 -0
  6. package/dist/{button-tones-BgZJ1tkD.js → button-tones-BwuVvAmd.js} +9 -1
  7. package/dist/{callout-view-DdJPdFrP.js → callout-view-C6voDS00.js} +1 -1
  8. package/dist/charts.js +5 -5
  9. package/dist/{chip-DpySRqCy.js → chip-DLgQTJBZ.js} +4 -4
  10. package/dist/{code-editor-BiA14xua.js → code-editor-BZbaYLvo.js} +8 -8
  11. package/dist/code-editor.js +7 -7
  12. package/dist/{code-language-items-C_dJ6GVs.js → code-language-items-BT5BO5w6.js} +2 -2
  13. package/dist/components/base.css +21 -6
  14. package/dist/components/components.css +6 -2
  15. package/dist/components/type-scale.css +194 -0
  16. package/dist/components/ui/actions/button/button.css +156 -0
  17. package/dist/components/ui/actions/button-group/button-group-standard.css +131 -0
  18. package/dist/components/ui/actions/button-group/button-group.css +4 -1
  19. package/dist/components/ui/actions/icon-button/icon-button.css +115 -0
  20. package/dist/components/ui/actions/morph-fill.css +62 -0
  21. package/dist/components/ui/feedback/toast/toast-expressive.css +17 -0
  22. package/dist/components/ui/layout/app-shell/activity-backdrop-shapes.css +49 -0
  23. package/dist/components/ui/layout/app-shell/activity-backdrop.css +0 -17
  24. package/dist/components/ui/layout/sidebar/sidebar-tokens.css +7 -2
  25. package/dist/{components-BkF9N-Yx.js → components-yx1t_5_P.js} +13740 -13422
  26. package/dist/components.js +24 -24
  27. package/dist/{dialog-CkIYpJXk.js → dialog-BQp5IdFl.js} +147 -147
  28. package/dist/dnd.js +1 -1
  29. package/dist/{dropdown-menu-BC5Tbhb9.js → dropdown-menu-BsH9W_3C.js} +3 -3
  30. package/dist/editor-viewer.js +1 -1
  31. package/dist/editor.js +13 -13
  32. package/dist/{empty-state-SeAg2TOX.js → empty-state-WaU4-T2c.js} +5 -5
  33. package/dist/escape-owner-C4W_sOAU.js +116 -0
  34. package/dist/{field-blur-DPLsMufs.js → field-blur-CJHzVSh9.js} +1 -1
  35. package/dist/{field-blur-context-1ZwJgsHE.js → field-blur-context-Cft9s7Hg.js} +2 -2
  36. package/dist/{hover-card-Cox-tPDz.js → hover-card-C0fw2kLK.js} +72 -71
  37. package/dist/i18n.js +12 -12
  38. package/dist/{icon-badge-q3Ve8gra.js → icon-badge-DUAq9f7H.js} +4 -4
  39. package/dist/icon-button-ifTpXt0A.js +355 -0
  40. package/dist/{illustration-BfHRpVzM.js → illustration-BmQmvW_4.js} +1 -1
  41. package/dist/illustrations.js +2 -2
  42. package/dist/lib/components/ui/actions/button/button-tones.d.ts +16 -0
  43. package/dist/lib/components/ui/actions/button/button.d.ts +13 -0
  44. package/dist/lib/components/ui/actions/button/button.variants.d.ts +4 -3
  45. package/dist/lib/components/ui/actions/button-group/button-group-context.d.ts +16 -0
  46. package/dist/lib/components/ui/actions/button-group/button-group-reset.d.ts +13 -0
  47. package/dist/lib/components/ui/actions/button-group/button-group.d.ts +19 -2
  48. package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +3 -2
  49. package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +18 -4
  50. package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +34 -4
  51. package/dist/lib/components/ui/display/badge/badge.d.ts +7 -2
  52. package/dist/lib/components/ui/display/entity-header/entity-header.d.ts +9 -1
  53. package/dist/lib/components/ui/display/entity-header/entity-stats.d.ts +16 -0
  54. package/dist/lib/components/ui/display/entity-header/partials/entity-header-actions.d.ts +6 -0
  55. package/dist/lib/components/ui/display/entity-header/partials/entity-header-body.d.ts +14 -0
  56. package/dist/lib/components/ui/display/entity-header/partials/entity-header-icon.d.ts +6 -0
  57. package/dist/lib/components/ui/display/entity-header/partials/shown.d.ts +2 -0
  58. package/dist/lib/components/ui/display/list-tile/list-tile.d.ts +8 -1
  59. package/dist/lib/components/ui/display/list-tile/partials/list-tile-body.d.ts +2 -1
  60. package/dist/lib/components/ui/display/stat-card/index.d.ts +1 -1
  61. package/dist/lib/components/ui/display/stat-card/partials/stat-card-compact.d.ts +12 -0
  62. package/dist/lib/components/ui/display/stat-card/stat-card-classes.d.ts +3 -2
  63. package/dist/lib/components/ui/display/stat-card/stat-card.d.ts +2 -2
  64. package/dist/lib/components/ui/display/stat-card/types.d.ts +9 -0
  65. package/dist/lib/components/ui/feedback/alert/alert-variants.d.ts +18 -0
  66. package/dist/lib/components/ui/feedback/alert/alert.d.ts +2 -6
  67. package/dist/lib/components/ui/feedback/typing-indicator/typing-indicator.d.ts +1 -1
  68. package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +1 -1
  69. package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +1 -1
  70. package/dist/lib/components/ui/layout/app-shell/activity-column.d.ts +17 -0
  71. package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +3 -106
  72. package/dist/lib/components/ui/layout/app-shell/activity-layout.types.d.ts +113 -0
  73. package/dist/lib/components/ui/layout/app-shell/app-breadcrumb.d.ts +2 -1
  74. package/dist/lib/components/ui/layout/app-shell/app-sidebar-icon-item.d.ts +13 -0
  75. package/dist/lib/components/ui/layout/app-shell/app-sidebar-label-item.d.ts +11 -0
  76. package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +6 -0
  77. package/dist/lib/components/ui/layout/app-shell/observe-layout.d.ts +11 -0
  78. package/dist/lib/components/ui/layout/app-shell/shape-units.d.ts +16 -0
  79. package/dist/lib/components/ui/layout/app-shell/shapes-clear-content.d.ts +13 -0
  80. package/dist/lib/components/ui/layout/app-shell/types.d.ts +10 -0
  81. package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +14 -0
  82. package/dist/lib/components/ui/layout/app-shell/watch-content.d.ts +19 -0
  83. package/dist/lib/components/ui/overlays/dialog/dialog-variants.d.ts +1 -1
  84. package/dist/lib/components/ui/primitives/toggle/toggle.d.ts +1 -1
  85. package/dist/lib/components/ui/primitives/typography/typography.d.ts +17 -7
  86. package/dist/lib/components/ui/primitives/typography/typography.variants.d.ts +55 -0
  87. package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +2 -2
  88. package/dist/lib/components/ui/tones.d.ts +1 -1
  89. package/dist/lib/i18n/translator.d.ts +1 -1
  90. package/dist/lib.js +2 -2
  91. package/dist/{line-path-BQeLQZ-P.js → line-path-C5pZGC49.js} +1 -1
  92. package/dist/main.js +29 -29
  93. package/dist/map.js +9 -9
  94. package/dist/material.css +1 -1
  95. package/dist/pdf-reader.js +1 -1
  96. package/dist/print.js +1 -1
  97. package/dist/{public-CtpsxV4I.js → public-B0Nq_yYV.js} +524 -524
  98. package/dist/{render-json-DyFYFIkZ.js → render-json-BOhvPnSv.js} +1 -1
  99. package/dist/{rich-code-block-C2Fp_FDU.js → rich-code-block-v7WmeZp9.js} +5 -5
  100. package/dist/{rich-text-viewer-LO1IZCWs.js → rich-text-viewer-W15XIwah.js} +2 -2
  101. package/dist/{skeleton-Bmp4gWAH.js → skeleton-DSdtr2qc.js} +1 -1
  102. package/dist/{sortable-provider-pVaEZzty.js → sortable-provider-CgDTolQR.js} +3 -3
  103. package/dist/{spinner-CsHcmcpF.js → spinner-BtSIYVrC.js} +3 -3
  104. package/dist/{state-scenes-SGNyZjTz.js → state-scenes-BX03WmSu.js} +1 -1
  105. package/dist/styles.css +2 -0
  106. package/dist/theme-picker.js +3 -3
  107. package/dist/{theme-toggle-oU-fh6WE.js → theme-toggle-B2Pehdhn.js} +2 -2
  108. package/dist/{toggle-group-j8zaxEg1.js → toggle-group-BMJNcFAC.js} +1 -1
  109. package/dist/{toolbar-items-CqHvlTU8.js → toolbar-items-rUHdVqAq.js} +399 -398
  110. package/dist/{tooltip-rhbqNmr3.js → tooltip-CkttDIab.js} +1 -1
  111. package/dist/{translate-material-CGZljjp1.js → translate-material-Bd_KgfB8.js} +1 -1
  112. package/dist/{translator-DCYO4Ij3.js → translator-Dje8HrNz.js} +5 -5
  113. package/dist/{use-chat-composer-nWWfVyrK.js → use-chat-composer-B0_STpQN.js} +4173 -4173
  114. package/dist/{use-material-translation-DkxcLbLM.js → use-material-translation-B3V_bz-5.js} +1 -1
  115. package/dist/{utils-Bcd2Z3ea.js → utils-BLfntITJ.js} +14 -1
  116. package/docs/components/buttons-and-actions.md +64 -15
  117. package/docs/components/data-display.md +40 -9
  118. package/docs/components/feedback-and-status.md +12 -1
  119. package/docs/components/navigation-and-layout.md +4 -3
  120. package/docs/components/primitives.md +52 -10
  121. package/docs/guides/app-shell.md +52 -8
  122. package/docs/guides/backgrounds.md +2 -0
  123. package/docs/guides/theming.md +55 -3
  124. package/docs/previews/buttons-actions-button.webp +0 -0
  125. package/docs/previews/buttons-actions-iconbutton.webp +0 -0
  126. package/docs/previews/data-display-badge.webp +0 -0
  127. package/docs/previews/data-display-entityheader.webp +0 -0
  128. package/docs/previews/data-display-listtile.webp +0 -0
  129. package/docs/previews/data-display-statcard.webp +0 -0
  130. package/docs/previews/feedback-status-banner.webp +0 -0
  131. package/docs/previews/navigation-layout-appshell-footer-icon.webp +0 -0
  132. package/docs/previews/navigation-layout-appshell-menu-badge.webp +0 -0
  133. package/docs/previews/navigation-layout-appshell.webp +0 -0
  134. package/docs/previews/navigation-layout-sidebar.webp +0 -0
  135. package/docs/previews/primitives-typography.webp +0 -0
  136. package/docs/roadmap.md +53 -4
  137. package/docs/troubleshooting.md +75 -4
  138. package/lib/components/base.css +21 -6
  139. package/lib/components/components.css +6 -2
  140. package/lib/components/type-scale.css +194 -0
  141. package/lib/components/ui/actions/button/button.css +156 -0
  142. package/lib/components/ui/actions/button-group/button-group-standard.css +131 -0
  143. package/lib/components/ui/actions/button-group/button-group.css +4 -1
  144. package/lib/components/ui/actions/icon-button/icon-button.css +115 -0
  145. package/lib/components/ui/actions/morph-fill.css +62 -0
  146. package/lib/components/ui/feedback/toast/toast-expressive.css +17 -0
  147. package/lib/components/ui/layout/app-shell/activity-backdrop-shapes.css +49 -0
  148. package/lib/components/ui/layout/app-shell/activity-backdrop.css +0 -17
  149. package/lib/components/ui/layout/sidebar/sidebar-tokens.css +7 -2
  150. package/lib/styles.css +2 -0
  151. package/package.json +2 -1
  152. package/dist/button-DbfdITBB.js +0 -322
  153. package/dist/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
  154. package/dist/components/ui/actions/icon-button/icon-button-morph.css +0 -152
  155. package/dist/escape-owner-CripBce_.js +0 -57
  156. package/dist/icon-button-DJcWpIhu.js +0 -319
  157. package/lib/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
  158. package/lib/components/ui/actions/icon-button/icon-button-morph.css +0 -152
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ import { Tone } from '../../tones.js';
3
+ export type EntityStat = {
4
+ label: string;
5
+ value: ReactNode;
6
+ tone?: Tone;
7
+ };
8
+ /** A stat with no value (`null`, `undefined`, `false`, `''`) is dropped; `0` is a figure. */
9
+ export declare const hasStatValue: (stat: EntityStat) => boolean;
10
+ /**
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.
13
+ */
14
+ export declare function EntityStats({ data }: {
15
+ data: EntityStat[];
16
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { ResponsiveButtonProps } from '../../../actions/responsive-button/responsive-button.js';
2
+ /** The actions: buttons from props, or any node, at the end of the band; nothing when empty. */
3
+ export declare function EntityHeaderActions({ actions, row, }: {
4
+ actions: ResponsiveButtonProps[] | React.ReactNode;
5
+ row: boolean;
6
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ import { EntityStat } from '../entity-stats.js';
2
+ /**
3
+ * The column beside the icon: the heading and the status on one line, the
4
+ * metadata and the stats under it.
5
+ */
6
+ export declare function EntityHeaderBody({ title, status, metadata, stats, }: {
7
+ title?: React.ReactNode;
8
+ status?: React.ReactNode;
9
+ metadata: {
10
+ label: string;
11
+ value: React.ReactNode;
12
+ }[];
13
+ stats: EntityStat[];
14
+ }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { IconButtonProps } from '../../../actions/icon-button/icon-button.js';
2
+ /** The icon badge at the band's start; a round Avatar is its own badge. */
3
+ export declare function EntityHeaderIcon({ icon, row, variant, color, }: {
4
+ icon: React.ReactNode;
5
+ row: boolean;
6
+ } & Pick<IconButtonProps, 'variant' | 'color'>): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ /** Whether a node draws anything: not nil, `false` or an empty string. */
2
+ export declare const shown: (node: React.ReactNode) => boolean;
@@ -16,6 +16,13 @@ export type ListTileProps = {
16
16
  selected?: boolean;
17
17
  size?: 'sm' | 'md';
18
18
  href?: string;
19
+ /**
20
+ * A discreet chevron after `trailing`, flipped in right-to-left, decorative
21
+ * (`aria-hidden`). On by default for a tile with an `href`, off otherwise
22
+ * (an `onClick` tile may select or act rather than navigate: pass `true`
23
+ * when it navigates). `false` opts a link out.
24
+ */
25
+ chevron?: boolean;
19
26
  /**
20
27
  * The link element of a tile with an `href`, with the app shell's contract
21
28
  * ({@link LinkComponent}: it takes `href`, spreads every other prop and
@@ -26,4 +33,4 @@ export type ListTileProps = {
26
33
  disabled?: boolean;
27
34
  onClick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
28
35
  } & Omit<HTMLAttributes<HTMLElement>, 'children' | 'title' | 'onClick'>;
29
- export declare function ListTile({ title, subtitle, leading, trailing, actions, className, selected, size, href, linkComponent, disabled, onClick, ...props }: ListTileProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
36
+ export declare function ListTile({ title, subtitle, leading, trailing, actions, className, selected, size, href, chevron, linkComponent, disabled, onClick, ...props }: ListTileProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
@@ -2,10 +2,11 @@ import { ReactNode } from 'react';
2
2
  type ListTileBodyProps = {
3
3
  leading?: ReactNode;
4
4
  trailing?: ReactNode;
5
+ chevron?: boolean;
5
6
  title: ReactNode;
6
7
  subtitle?: ReactNode;
7
8
  compact: boolean;
8
9
  selected?: boolean;
9
10
  };
10
- export declare function ListTileBody({ leading, trailing, title, subtitle, compact, selected, }: ListTileBodyProps): import("react").JSX.Element;
11
+ export declare function ListTileBody({ leading, trailing, chevron, title, subtitle, compact, selected, }: ListTileBodyProps): import("react").JSX.Element;
11
12
  export {};
@@ -1,4 +1,4 @@
1
1
  export type { StatDeltaTone } from './format-stat-delta.js';
2
2
  export { formatStatDelta } from './format-stat-delta.js';
3
- export type { StatCardProps, StatCardValueSize, StatCardVariant, } from './stat-card.js';
3
+ export type { StatCardProps, StatCardSize, StatCardValueSize, StatCardVariant, } from './stat-card.js';
4
4
  export { StatCard } from './stat-card.js';
@@ -0,0 +1,12 @@
1
+ import { StatCardClasses } from '../stat-card-classes.js';
2
+ import { StatCardProps } from '../types.js';
3
+ type Props = Pick<StatCardProps, 'label' | 'value' | 'icon' | 'loading'> & {
4
+ classes: StatCardClasses;
5
+ };
6
+ /**
7
+ * The inside of `StatCard size="sm"`: the icon chip, then the value over its
8
+ * label. The value comes first in the document, so assistive tech reads
9
+ * "22 Students"; the figures are tabular so a row of tiles does not jitter.
10
+ */
11
+ export declare function StatCardCompact({ label, value, icon, loading, classes, }: Props): import("react").JSX.Element;
12
+ export {};
@@ -1,4 +1,4 @@
1
- import { StatCardProps, StatCardVariant } from './types.js';
1
+ import { StatCardProps, StatCardSize, StatCardVariant } from './types.js';
2
2
  export type StatCardClasses = {
3
3
  /** `data-tone` of the root: the tone, or `neutral` on a tonal or filled card with none. */
4
4
  dataTone: StatCardProps['tone'] | 'neutral' | undefined;
@@ -13,7 +13,8 @@ export type StatCardClasses = {
13
13
  skeleton: string;
14
14
  };
15
15
  /** Every class a StatCard picks from its variant and tone; `className` is merged by the caller. */
16
- export declare function statCardClasses({ variant, tone, }: {
16
+ export declare function statCardClasses({ variant, tone, size, }: {
17
17
  variant: StatCardVariant;
18
18
  tone: StatCardProps['tone'];
19
+ size?: StatCardSize;
19
20
  }): StatCardClasses;
@@ -1,3 +1,3 @@
1
1
  import { StatCardProps } from './types.js';
2
- export type { StatCardProps, StatCardValueSize, StatCardVariant, } from './types.js';
3
- export declare function StatCard({ label, value, hint, delta, deltaTone, icon, loading, tone, variant, valueSize, className, ...props }: StatCardProps): import("react").JSX.Element;
2
+ export type { StatCardProps, StatCardSize, StatCardValueSize, StatCardVariant, } from './types.js';
3
+ export declare function StatCard({ label, value, hint, delta, deltaTone, icon, loading, tone, variant, valueSize, size, className, ...props }: StatCardProps): import("react").JSX.Element;
@@ -4,6 +4,7 @@ import { Tone } from '../../tones.js';
4
4
  import { StatDeltaTone } from './format-stat-delta.js';
5
5
  export type StatCardVariant = 'outlined' | 'tonal' | 'filled';
6
6
  export type StatCardValueSize = 'default' | 'display';
7
+ export type StatCardSize = 'default' | 'sm';
7
8
  export type StatCardProps = Omit<ComponentProps<typeof Card>, 'children'> & {
8
9
  label: ReactNode;
9
10
  value?: ReactNode;
@@ -25,6 +26,14 @@ export type StatCardProps = Omit<ComponentProps<typeof Card>, 'children'> & {
25
26
  * `neutral` when there is no `tone`.
26
27
  */
27
28
  variant?: StatCardVariant;
29
+ /**
30
+ * `sm` is a compact tile for a band or a header, 40 to 56 px tall: the icon
31
+ * chip, then the value (tabular figures) over its label, in one row that
32
+ * hugs its content, so tiles sit side by side and wrap on a phone. It takes
33
+ * the same `tone` and `variant`; `hint`, `delta` and `valueSize` do not
34
+ * apply to it.
35
+ */
36
+ size?: StatCardSize;
28
37
  /** `display` draws the value larger (`headline-large`); `default` is `headline-small`. */
29
38
  valueSize?: StatCardValueSize;
30
39
  };
@@ -0,0 +1,18 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ /**
3
+ * Alert's look, in one place: Banner builds on the same variants, title and
4
+ * description classes, so the two cannot drift. The icon rules target the
5
+ * `alert-icon` slot only, so a Banner's dismiss button and action keep their
6
+ * own colours. Every class is written out in full: Tailwind cannot see one
7
+ * built from a template string.
8
+ */
9
+ export declare const alertVariants: (props?: ({
10
+ variant?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "foreground" | null | undefined;
11
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
12
+ export type AlertVariantProps = VariantProps<typeof alertVariants>;
13
+ /** The text column: it may shrink below its content, so a long URL wraps. */
14
+ export declare const ALERT_TEXT_CLASS = "flex min-w-0 flex-1 flex-col gap-1 break-words";
15
+ /** The title's Typography variant and class. */
16
+ export declare const ALERT_TITLE_VARIANT = "title-small";
17
+ export declare const ALERT_TITLE_CLASS = "font-bold";
18
+ export declare const ALERT_DESCRIPTION_CLASS = "text-muted-foreground";
@@ -1,12 +1,8 @@
1
- import { VariantProps } from 'class-variance-authority';
2
1
  import { ComponentProps, ReactNode } from 'react';
3
- declare const variants: (props?: ({
4
- variant?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "foreground" | null | undefined;
5
- } & import('class-variance-authority/types').ClassProp) | undefined) => string;
2
+ import { AlertVariantProps } from './alert-variants.js';
6
3
  export type AlertProps = {
7
4
  icon?: ReactNode;
8
5
  title?: ReactNode;
9
6
  description?: ReactNode;
10
- } & Omit<ComponentProps<'div'>, 'title' | 'description'> & VariantProps<typeof variants>;
7
+ } & Omit<ComponentProps<'div'>, 'title' | 'description'> & AlertVariantProps;
11
8
  export declare function Alert({ description, icon, title, className, variant, ...props }: AlertProps): import("react").JSX.Element;
12
- export {};
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import { ComponentProps } from 'react';
3
3
  declare const typingIndicatorVariants: (props?: ({
4
4
  variant?: "bubble" | "dots" | null | undefined;
5
- size?: "sm" | "md" | null | undefined;
5
+ size?: "md" | "sm" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export type TypingIndicatorProps = ComponentProps<'div'> & VariantProps<typeof typingIndicatorVariants> & {
8
8
  /** Its accessible name, announced politely (`role="status"`). Default: "Typing". */
@@ -45,13 +45,13 @@ export declare function splitSliderProps({ defaultValue, value, min, max, step,
45
45
  minStepsBetweenThumbs?: number;
46
46
  onValueCommit?(value: number[]): void;
47
47
  form?: string;
48
+ title?: string | undefined | undefined;
48
49
  content?: string | undefined | undefined;
49
50
  translate?: "yes" | "no" | undefined | undefined;
50
51
  color?: string | undefined | undefined;
51
52
  prefix?: string | undefined | undefined;
52
53
  slot?: string | undefined | undefined;
53
54
  style?: import('react').CSSProperties | undefined;
54
- title?: string | undefined | undefined;
55
55
  children?: import('react').ReactNode;
56
56
  key?: import('react').Key | null | undefined;
57
57
  defaultChecked?: boolean | undefined | undefined;
@@ -19,13 +19,13 @@ export declare function useSliderControl(props: SliderControlProps): {
19
19
  minStepsBetweenThumbs?: number;
20
20
  onValueCommit?(value: number[]): void;
21
21
  form?: string;
22
+ title?: string | undefined | undefined;
22
23
  content?: string | undefined | undefined;
23
24
  translate?: "yes" | "no" | undefined | undefined;
24
25
  color?: string | undefined | undefined;
25
26
  prefix?: string | undefined | undefined;
26
27
  slot?: string | undefined | undefined;
27
28
  style?: import('react').CSSProperties | undefined;
28
- title?: string | undefined | undefined;
29
29
  children?: import('react').ReactNode;
30
30
  key?: import('react').Key | null | undefined;
31
31
  defaultChecked?: boolean | undefined | undefined;
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { ActivityLayoutProps } from './activity-layout.types.js';
3
+ type ColumnProps = Pick<ActivityLayoutProps, 'items' | 'brand' | 'logo' | 'name' | 'context' | 'headerTitle' | 'breadcrumb' | 'breadcrumbRoot' | 'headerActions' | 'avatar' | 'linkComponent' | 'menuOpen' | 'onMenuOpenChange' | 'routeTransition' | 'backdrop'> & {
4
+ /** The element of the content region. */
5
+ as: 'main' | 'div';
6
+ contained: boolean;
7
+ /** Whether a backdrop is drawn, and whether it is the theme's. */
8
+ hasBackdrop: boolean;
9
+ themeBackdrop: boolean;
10
+ children?: ReactNode;
11
+ };
12
+ /**
13
+ * The content column of {@link ActivityLayout}: the backdrop layer behind, the
14
+ * app bar, the breadcrumb and the routed content region.
15
+ */
16
+ export declare function ActivityColumn({ as, contained, hasBackdrop, themeBackdrop, items, brand, logo, name, context, headerTitle, breadcrumb, breadcrumbRoot, headerActions, avatar, linkComponent, menuOpen, onMenuOpenChange, routeTransition, backdrop, children, }: ColumnProps): import("react").JSX.Element;
17
+ export {};
@@ -1,108 +1,5 @@
1
- import { ComponentProps, ReactNode } from 'react';
2
- import { AppBreadcrumbRoot } from './app-breadcrumb.js';
3
- import { RouteTransition } from './route-transition.js';
4
- import { AppLogo, AppShellLinkComponent, MenuItem } from './types.js';
5
- export type ActivityLayoutProps = {
6
- items: MenuItem[];
7
- /**
8
- * The sidebar header, in the rail and in the phone's menu sheet: replaces
9
- * `logo` and `name` entirely.
10
- */
11
- brand?: ReactNode;
12
- /**
13
- * The app's logo: an image URL, `{ src, alt }`, or a node. The collapsed
14
- * rail shows it alone, the phone's menu sheet beside `name`.
15
- */
16
- logo?: AppLogo;
17
- /**
18
- * The app's name, already translated: the logo's accessible name and
19
- * tooltip in the rail, shown beside it in the menu sheet.
20
- */
21
- name?: string;
22
- /**
23
- * A line at the top of the phone's menu sheet, above the brand: the
24
- * current tenant's name. `name` stays the app's brand.
25
- */
26
- context?: ReactNode;
27
- /**
28
- * The header's leading title, the context the app is in (the active
29
- * organisation's name): right after the phone's menu button, truncated
30
- * with an ellipsis when long. Not a heading: the screen's `h1` is
31
- * `ActivityContent`'s title, or the page's title in the bar (a route's
32
- * `handle.title`), which it then sits beside.
33
- */
34
- headerTitle?: ReactNode;
35
- /** The breadcrumb's first crumb, a text link in place of the home icon. */
36
- breadcrumbRoot?: AppBreadcrumbRoot;
37
- /** Passed to the header, before the avatar. */
38
- headerActions?: ReactNode;
39
- /** Passed to the header. An image URL, or a whole node. */
40
- avatar?: ReactNode;
41
- /**
42
- * The link each menu entry renders, given its `href`. Defaults to React
43
- * Router's `Link`; pass another for a different router.
44
- */
45
- linkComponent?: AppShellLinkComponent;
46
- /**
47
- * The element of the content region. `'main'` (the default) makes it the
48
- * page's `<main>` landmark; pass `'div'` when your app renders its own
49
- * `<main>` around or inside the shell — a page has only one.
50
- */
51
- contentAs?: 'main' | 'div';
52
- /**
53
- * Who scrolls. `'document'` (the default): the page grows with its content
54
- * and the browser scrolls it, the header and the sidebar staying in view.
55
- * `'container'`: the shell is exactly one screen high and the content
56
- * region scrolls inside it — for a screen that manages its own height
57
- * (a full-height map, a kanban board). The region then starts each new
58
- * location at the top, and Back returns to where that page was left.
59
- */
60
- scroll?: 'document' | 'container';
61
- /**
62
- * Where the rail's entries sit. `'start'` (the default): right under the
63
- * brand. `'center'`: vertically centred, as before.
64
- */
65
- align?: 'start' | 'center';
66
- /**
67
- * Controls the phone's menu sheet: open while true. It closes by itself
68
- * when a link in it is followed or the location changes (the
69
- * `onMenuOpenChange(false)` call tells you); leave it out to let the
70
- * layout manage the sheet. Only a phone shows the sheet.
71
- */
72
- menuOpen?: boolean;
73
- /** Asked for every change of the menu sheet: the button, Escape, a link, a new location. */
74
- onMenuOpenChange?: (open: boolean) => void;
75
- /**
76
- * React's `<ViewTransition>` around the content region: on by default,
77
- * `false` for none, or its props (default class `nxgt-route`). See the
78
- * app shell guide, "Route transitions".
79
- */
80
- routeTransition?: RouteTransition;
81
- /**
82
- * An exception to the theme's background, which the layout draws by
83
- * default: under Lavande, or under no theme, the built-in gradient and its
84
- * three blobs; under another theme, that theme's `background`. A node
85
- * replaces it for this screen: typically a `Background` preset from
86
- * `@nxgt/material/backgrounds`. It fills the whole layout, sits under the
87
- * sidebar, the header and the content, and is `inert`, `aria-hidden` and
88
- * never takes a pointer. `false` draws no background at all, a plain page.
89
- * The preset's stylesheet (`@nxgt/material/backgrounds.css`) is the app's to
90
- * import. See the app shell guide, "Use a background preset behind the shell".
91
- *
92
- * @example
93
- * ```tsx
94
- * import { Background, MOTIF_SHAPES_ALL } from '@nxgt/material/backgrounds';
95
- *
96
- * <ActivityLayout
97
- * items={items}
98
- * backdrop={<Background preset="shapes" motif={{ shapes: MOTIF_SHAPES_ALL }} />}
99
- * >
100
- * <Outlet />
101
- * </ActivityLayout>
102
- * ```
103
- */
104
- backdrop?: ReactNode | false;
105
- } & ComponentProps<'div'>;
1
+ import { ActivityLayoutProps } from './activity-layout.types.js';
2
+ export type { ActivityLayoutProps } from './activity-layout.types.js';
106
3
  /**
107
4
  * The application chrome: sidebar, header, breadcrumbs, and the routed content.
108
5
  *
@@ -118,4 +15,4 @@ export type ActivityLayoutProps = {
118
15
  * phone's toolbar (the bottom of the screen hidden). The bottom keeps clear
119
16
  * of a `MediaPlayerHost`'s docked bar (`--nxgt-media-dock`).
120
17
  */
121
- export declare function ActivityLayout({ items, brand, logo, name, context, headerTitle, breadcrumbRoot, headerActions, avatar, linkComponent, contentAs: Content, scroll, align, menuOpen, onMenuOpenChange, routeTransition, backdrop, children, className, ...props }: ActivityLayoutProps): import("react").JSX.Element;
18
+ export declare function ActivityLayout({ items, brand, logo, name, context, headerTitle, breadcrumb, breadcrumbRoot, headerActions, avatar, linkComponent, contentAs: Content, scroll, align, menuOpen, onMenuOpenChange, routeTransition, backdrop, children, className, ...props }: ActivityLayoutProps): import("react").JSX.Element;
@@ -0,0 +1,113 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { AppBreadcrumbRoot } from './app-breadcrumb.js';
3
+ import { RouteTransition } from './route-transition.js';
4
+ import { AppLogo, AppShellLinkComponent, MenuItem } from './types.js';
5
+ export type ActivityLayoutProps = {
6
+ items: MenuItem[];
7
+ /**
8
+ * The sidebar header, in the rail and in the phone's menu sheet: replaces
9
+ * `logo` and `name` entirely.
10
+ */
11
+ brand?: ReactNode;
12
+ /**
13
+ * The app's logo: an image URL, `{ src, alt }`, or a node. The collapsed
14
+ * rail shows it alone, the phone's menu sheet beside `name`.
15
+ */
16
+ logo?: AppLogo;
17
+ /**
18
+ * The app's name, already translated: the logo's accessible name and
19
+ * tooltip in the rail, shown beside it in the menu sheet.
20
+ */
21
+ name?: string;
22
+ /**
23
+ * A line at the top of the phone's menu sheet, above the brand: the
24
+ * current tenant's name. `name` stays the app's brand.
25
+ */
26
+ context?: ReactNode;
27
+ /**
28
+ * The header's leading title, the context the app is in (the active
29
+ * organisation's name): right after the phone's menu button, truncated
30
+ * with an ellipsis when long. Not a heading: the screen's `h1` is
31
+ * `ActivityContent`'s title, or the page's title in the bar (a route's
32
+ * `handle.title`), which it then sits beside.
33
+ */
34
+ headerTitle?: ReactNode;
35
+ /**
36
+ * Whether the breadcrumb trail shows. `false` hides it, for an error page
37
+ * whose matched routes would show a misleading trail. The trail is also
38
+ * hidden when every matched `handle.breadcrumb` renders `null`.
39
+ *
40
+ * @default true
41
+ */
42
+ breadcrumb?: boolean;
43
+ /** The breadcrumb's first crumb, a text link in place of the home icon. */
44
+ breadcrumbRoot?: AppBreadcrumbRoot;
45
+ /** Passed to the header, before the avatar. */
46
+ headerActions?: ReactNode;
47
+ /** Passed to the header. An image URL, or a whole node. */
48
+ avatar?: ReactNode;
49
+ /**
50
+ * The link each menu entry renders, given its `href`. Defaults to React
51
+ * Router's `Link`; pass another for a different router.
52
+ */
53
+ linkComponent?: AppShellLinkComponent;
54
+ /**
55
+ * The element of the content region. `'main'` (the default) makes it the
56
+ * page's `<main>` landmark; pass `'div'` when your app renders its own
57
+ * `<main>` around or inside the shell — a page has only one.
58
+ */
59
+ contentAs?: 'main' | 'div';
60
+ /**
61
+ * Who scrolls. `'document'` (the default): the page grows with its content
62
+ * and the browser scrolls it, the header and the sidebar staying in view.
63
+ * `'container'`: the shell is exactly one screen high and the content
64
+ * region scrolls inside it — for a screen that manages its own height
65
+ * (a full-height map, a kanban board). The region then starts each new
66
+ * location at the top, and Back returns to where that page was left.
67
+ */
68
+ scroll?: 'document' | 'container';
69
+ /**
70
+ * Where the rail's entries sit. `'start'` (the default): right under the
71
+ * brand. `'center'`: vertically centred, as before.
72
+ */
73
+ align?: 'start' | 'center';
74
+ /**
75
+ * Controls the phone's menu sheet: open while true. It closes by itself
76
+ * when a link in it is followed or the location changes (the
77
+ * `onMenuOpenChange(false)` call tells you); leave it out to let the
78
+ * layout manage the sheet. Only a phone shows the sheet.
79
+ */
80
+ menuOpen?: boolean;
81
+ /** Asked for every change of the menu sheet: the button, Escape, a link, a new location. */
82
+ onMenuOpenChange?: (open: boolean) => void;
83
+ /**
84
+ * React's `<ViewTransition>` around the content region: on by default,
85
+ * `false` for none, or its props (default class `nxgt-route`). See the
86
+ * app shell guide, "Route transitions".
87
+ */
88
+ routeTransition?: RouteTransition;
89
+ /**
90
+ * An exception to the theme's background, which the layout draws by
91
+ * default: under Lavande, or under no theme, the built-in gradient and its
92
+ * three blobs; under another theme, that theme's `background`. A node
93
+ * replaces it for this screen: typically a `Background` preset from
94
+ * `@nxgt/material/backgrounds`. It fills the whole layout, sits under the
95
+ * sidebar, the header and the content, and is `inert`, `aria-hidden` and
96
+ * never takes a pointer. `false` draws no background at all, a plain page.
97
+ * The preset's stylesheet (`@nxgt/material/backgrounds.css`) is the app's to
98
+ * import. See the app shell guide, "Use a background preset behind the shell".
99
+ *
100
+ * @example
101
+ * ```tsx
102
+ * import { Background, MOTIF_SHAPES_ALL } from '@nxgt/material/backgrounds';
103
+ *
104
+ * <ActivityLayout
105
+ * items={items}
106
+ * backdrop={<Background preset="shapes" motif={{ shapes: MOTIF_SHAPES_ALL }} />}
107
+ * >
108
+ * <Outlet />
109
+ * </ActivityLayout>
110
+ * ```
111
+ */
112
+ backdrop?: ReactNode | false;
113
+ } & ComponentProps<'div'>;
@@ -33,7 +33,8 @@ export type AppBreadcrumbProps = {
33
33
  *
34
34
  * A route opts in by exporting `handle = { breadcrumb: (match) => ... }`;
35
35
  * routes without one contribute nothing, so intermediate layouts stay out of
36
- * the trail. It starts with a home icon, or with `root`'s text link. Hidden on
36
+ * the trail, and so does a crumb that renders `null`; with none left the trail
37
+ * is hidden. It starts with a home icon, or with `root`'s text link. Hidden on
37
38
  * mobile, where there is no room for it.
38
39
  */
39
40
  export declare function AppBreadcrumb({ root, className, ...props }: AppBreadcrumbProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { AppShellLinkComponent, MenuItem } from './types.js';
2
+ /**
3
+ * An entry with `display: 'icon'`: a round, icon-only link, drawn with
4
+ * `IconButton` (the Button family's look) in the expanded sidebar and the
5
+ * collapsed rail alike. The label is its tooltip and, visually hidden, its
6
+ * accessible name; the active one is tinted in primary and `aria-current`.
7
+ * On a coarse pointer the button itself is 44px.
8
+ */
9
+ export declare function AppSidebarIconItem({ item, active, linkComponent: Link, }: {
10
+ item: MenuItem;
11
+ active: boolean;
12
+ linkComponent?: AppShellLinkComponent;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { AppShellLinkComponent, MenuItem } from './types.js';
2
+ /**
3
+ * The default entry: an icon and its label (any node, e.g. a `<Trans/>`),
4
+ * with its badge. The twin of {@link AppSidebarIconItem}, which draws an
5
+ * entry with `display: 'icon'`.
6
+ */
7
+ export declare function AppSidebarLabelItem({ item, active, linkComponent, }: {
8
+ item: MenuItem;
9
+ active: boolean;
10
+ linkComponent?: AppShellLinkComponent;
11
+ }): import("react").JSX.Element;
@@ -5,6 +5,12 @@ export interface Box {
5
5
  right: number;
6
6
  bottom: number;
7
7
  }
8
+ /** The chrome above the content that no shape may touch. */
9
+ export declare const BAND = "[data-slot=\"app-header\"], [data-slot=\"breadcrumb\"], [data-slot=\"activity-content-header\"], [data-slot=\"entity-header\"]";
10
+ /** The content region: a route swaps the page directly under it. */
11
+ export declare const REGION = "[data-slot=\"activity-content-region\"]";
12
+ /** An element's box as a plain object. */
13
+ export declare const box: (el: Element) => Box;
8
14
  /** The space a shape keeps from the layer's edges and from the header band, in pixels. */
9
15
  export declare const SHAPE_MARGIN = 8;
10
16
  /**
@@ -0,0 +1,11 @@
1
+ /**
2
+ * What can change where the shapes may be, and nothing more: the layer's
3
+ * size and scene (a new theme or seed adds or removes elements; our own
4
+ * attributes do not count), the column's size, and the band elements (their
5
+ * size, and their parents' children: a route swaps the page under the
6
+ * content region, a header card comes and goes). The page's whole subtree is
7
+ * not watched for structure; its text and controls are, debounced on their
8
+ * own timer, and its inner scrollers and late fonts and images count too.
9
+ * `later` is the caller's debounce to a frame. Returns the cleanup.
10
+ */
11
+ export declare function observeLayout(layer: Element, column: Element, later: () => void): () => void;
@@ -0,0 +1,16 @@
1
+ import { Box } from './keep-shapes-inside.js';
2
+ /**
3
+ * What the backdrop shows or hides as one: a lone shape (`.mo > *`), or a
4
+ * compound body (`.pt.mg > .mo`: the moon, the planet, the eclipse), which is
5
+ * one unit made of all its parts, drawn with its halo (`.pt.mh`).
6
+ */
7
+ export interface ShapeUnit {
8
+ /** The parts that carry `data-outside` (their `.mo > *` children). */
9
+ parts: Element[];
10
+ /** The elements that carry `data-hidden`: the shape itself, or the body group and its halo. */
11
+ hide: Element[];
12
+ /** The union box of the parts. */
13
+ box: Box;
14
+ }
15
+ /** The units of a scene, measured now. */
16
+ export declare function shapeUnits(scene: Element): ShapeUnit[];
@@ -0,0 +1,13 @@
1
+ import { Box } from './keep-shapes-inside.js';
2
+ /** The space a shape keeps from the text and controls of the page, in pixels. */
3
+ export declare const CONTENT_MARGIN = 8;
4
+ /** Most boxes kept from one page: past this the rest of a very long list is not collected, and a shape may be drawn over it. */
5
+ export declare const MAX_CONTENT_BOXES = 6000;
6
+ /** What a person reads or presses: a shape is never drawn over one of these. */
7
+ export declare const CONTROLS = "input, textarea, select, button, a[href], img, canvas, video, [role=\"button\"], [role=\"textbox\"], [role=\"combobox\"], [role=\"checkbox\"], [role=\"switch\"], [role=\"tab\"], [role=\"slider\"], [contenteditable=\"true\"]";
8
+ /**
9
+ * Whether a shape lies over (or within `margin` of) any occupied box of the
10
+ * content. The boxes are in the content's coordinates; `dx` and `dy` are the
11
+ * scroll offsets that bring them to the viewport.
12
+ */
13
+ export declare function hitsContent(shape: Box, occupied: readonly Box[], dx: number, dy: number, margin?: number): boolean;
@@ -22,6 +22,16 @@ export type MenuItem = {
22
22
  * one out of the footer.
23
23
  */
24
24
  footer?: boolean;
25
+ /**
26
+ * How the entry is drawn. Unset: the icon and the label (a tile under the
27
+ * icon on the collapsed rail). `'icon'`: a round, icon-only button (the
28
+ * Button family's `IconButton`) in the expanded sidebar, the collapsed rail
29
+ * and the phone's menu sheet, with the `label` as its tooltip and its
30
+ * accessible name, `aria-current` when active and a 44px target on a
31
+ * coarse pointer. Meant for a `footer` entry such as "Settings". It draws
32
+ * no `badge`: the option is ignored on an icon entry.
33
+ */
34
+ display?: 'icon';
25
35
  /**
26
36
  * A badge on the entry (Material 3 navigation badge). `true`: a small dot.
27
37
  * A number: a count, shown as "99+" past 99. `0`, `false` or nothing: no
@@ -1,6 +1,20 @@
1
1
  import { Box } from './keep-shapes-inside.js';
2
2
  /** The band's strips: a sticky one (the app bar) is measured where it rests, above the first strip that scrolls. */
3
3
  export declare function bandBoxes(column: Element, layer: Box): Box[];
4
+ /**
5
+ * Keeps the discrete shapes of a preset (`.mo > *`: the motif and illustrated
6
+ * families) whole and clear of the chrome: after layout, and whenever the
7
+ * layer or its column resizes or its content changes (a new scene, a new
8
+ * route), a shape that crosses the layer's edge or the header band gets
9
+ * `data-outside` (activity-backdrop-shapes.css hides it). A compound body (the
10
+ * moon, a planet, an eclipse) counts as one shape, by the union of its parts. A floating scene
11
+ * (`data-animated`) keeps an extra margin for its drift. `data-checked` on the
12
+ * root lets the CSS show the scene, which stays hidden until the first pass so
13
+ * no cut shape flashes; where `ResizeObserver` or `Range#getClientRects` is
14
+ * missing, the scene is only marked checked. Presets without discrete shapes (waves, gradient) are
15
+ * only marked checked.
16
+ */
17
+ export declare function keepInside(layer: HTMLElement, column: HTMLElement, scenes: () => Element[]): () => void;
4
18
  /** A callback ref for the theme's `Background`, a child of the backdrop layer (it is loaded lazily, so it mounts after this hook). */
5
19
  export declare function useKeepShapesInside(): (el: HTMLElement | null) => void;
6
20
  /**