@nxgt/material 3.85.1 → 3.86.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 +30 -0
- package/README.md +39 -5
- package/dist/{alert-dialog-1t6ULy5i.js → alert-dialog-DZnt8PYE.js} +1 -1
- package/dist/{async-slice-xyA9Uzct.js → async-slice-D3OdV2BS.js} +1 -1
- package/dist/{button-DhiNGrdT.js → button-MAL5an7L.js} +1 -1
- package/dist/{calculator-BcgxxScL.js → calculator-CyBjPONf.js} +10 -10
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-segment-C4WQAHcN.js → calculator-segment-BigMpjhn.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-m0_usuzd.js → chip-DKAKoNxq.js} +2 -2
- package/dist/{code-editor-BgKFrcld.js → code-editor-B6dFQSUJ.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-BWw17W9s.js → code-language-items-CXEMiWoF.js} +2 -2
- package/dist/components/components.css +2 -0
- package/dist/components/theme-tokens.css +18 -0
- package/dist/components/ui/layout/app-bar/top-app-bar/top-app-bar-collapse.css +60 -0
- package/dist/components/ui/layout/app-bar/top-app-bar/top-app-bar.css +205 -0
- package/dist/components/ui/layout/app-shell/app-header.css +70 -63
- package/dist/{components-DfSE2F8d.js → components-BVHbzzju.js} +17327 -16929
- package/dist/components.js +24 -24
- package/dist/{conversion-variant-DultZZQm.js → conversion-variant-BT5n4-jm.js} +3 -3
- package/dist/{currency-field-CPbaM7ay.js → currency-field-t41sFYg_.js} +4 -4
- package/dist/{dialog-DmlG9opW.js → dialog-BjKiRXJg.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-CDKev8dk.js → dropdown-menu-IRFp4CH9.js} +1 -1
- package/dist/editor.js +7 -7
- package/dist/{empty-state-C56000TB.js → empty-state-C70prDDr.js} +1 -1
- package/dist/{financial-variant-BYjQ690K.js → financial-variant-DqW4HJ_v.js} +5 -5
- package/dist/{hooks-BTwLAy_A.js → hooks-CjO11MS7.js} +2 -2
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-CDtW6utN.js → hover-card-cU_aJa18.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-ec7MmUGA.js → icon-badge-D3KO6uEQ.js} +1 -1
- package/dist/{icon-button-CG4aO8Gh.js → icon-button-DrqNk1Ww.js} +1 -1
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-bar/index.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/index.d.ts +1 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-actions.d.ts +15 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-headline.d.ts +4 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-link.d.ts +9 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-menu-section.d.ts +14 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-primary-action.d.ts +12 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-row.d.ts +23 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-title-block.d.ts +18 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/top-app-bar.actions.d.ts +43 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/top-app-bar.d.ts +9 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/top-app-bar.types.d.ts +120 -0
- package/dist/lib/components/ui/layout/app-bar/top-app-bar/top-app-bar.utils.d.ts +43 -0
- package/dist/lib/components/ui/layout/app-shell/activity-app-bar.d.ts +6 -6
- package/dist/lib/components/ui/layout/app-shell/activity-chrome.d.ts +6 -3
- package/dist/lib/components/ui/layout/app-shell/activity-column-props.d.ts +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-navigation.types.d.ts +32 -4
- package/dist/lib/components/ui/layout/app-shell/activity-layout.types.d.ts +12 -2
- package/dist/lib/components/ui/layout/app-shell/app-header.d.ts +9 -3
- package/dist/lib/components/ui/layout/app-shell/header-look.d.ts +14 -0
- package/dist/lib/components/ui/layout/app-shell/header-title.d.ts +9 -36
- package/dist/lib/components/ui/layout/app-shell/header.utils.d.ts +13 -3
- package/dist/lib/components/ui/layout/app-shell/index.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-shell/navigation.utils.d.ts +7 -2
- package/dist/lib/components/ui/layout/app-shell/shell-scroll.d.ts +23 -1
- package/dist/lib/components/ui/layout/app-shell/shell-top-app-bar.d.ts +10 -0
- package/dist/lib/components/ui/layout/app-shell/shell-top-app-bar.parts.d.ts +58 -0
- package/dist/lib/components/ui/layout/app-shell/shell-top-app-bar.types.d.ts +26 -0
- package/dist/lib/components/ui/layout/app-shell/use-header-scroll.d.ts +16 -9
- package/dist/lib/components/ui/layout/app-shell/use-shell-header.d.ts +1 -1
- 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 +28 -28
- package/dist/map.js +7 -7
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{percent-field-8_pILs15.js → percent-field-D47IlaPF.js} +1 -1
- package/dist/{picker-surface-pyGv-Qh9.js → picker-surface-Cg4V4-E0.js} +4 -4
- package/dist/{popover-3EF4q2CT.js → popover-Dzk4-l9U.js} +1 -1
- package/dist/{pos-types-Dv2UxKSN.js → pos-types-JOXMY4Y2.js} +1 -1
- package/dist/{pos-variant-DJvtN9N8.js → pos-variant-B2mS8bMB.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-Bmcq2KzC.js → programmer-variant-C_Tl0P4_.js} +2 -2
- package/dist/{public-BNebh4z0.js → public-ByAsqBOf.js} +9 -9
- package/dist/{rich-code-block-DmX7d58S.js → rich-code-block-CJAfqk6b.js} +5 -5
- package/dist/{scientific-variant-DijUrpP8.js → scientific-variant-CskM4MLV.js} +2 -2
- package/dist/{sortable-provider-Cnmt_gWu.js → sortable-provider-ICS_vkLA.js} +2 -2
- package/dist/{spinner-C6LP2Rw8.js → spinner-CweqX5A9.js} +1 -1
- package/dist/styles.css +2 -0
- package/dist/{tabs-Bj1zOe7-.js → tabs-BOT9B4le.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-Cxku5iBP.js → theme-toggle-WAFkncYx.js} +1 -1
- package/dist/{toolbar-items-CEIuSxU_.js → toolbar-items-BsgzHSNf.js} +4 -4
- package/dist/{translate-material-DI3nmQ6I.js → translate-material-DTIAPmlU.js} +1 -1
- package/dist/{translator-BstxG_hN.js → translator-BRZNhsy5.js} +8 -0
- package/dist/{use-chat-composer-BqLkk_iH.js → use-chat-composer-67MgWAHz.js} +15 -15
- package/dist/{use-heading-spy-nFyb9_KE.js → use-heading-spy-D8WbHJuK.js} +4 -4
- package/dist/{use-material-translation-1kCHtB0p.js → use-material-translation-CCy1Me0h.js} +1 -1
- package/dist/{use-return-focus-Hv8rn55-.js → use-return-focus-BA8G1qVU.js} +1 -1
- package/docs/README.md +1 -0
- package/docs/components/navigation-and-layout.md +85 -32
- package/docs/guides/app-shell.md +158 -63
- package/docs/guides/drawing.md +2 -0
- package/docs/guides/layouts.md +3 -3
- package/docs/guides/migrating-to-top-app-bar.md +156 -0
- package/docs/guides/theming.md +5 -0
- package/docs/previews/navigation-layout-appshell-blue-moon.webp +0 -0
- package/docs/previews/navigation-layout-appshell-footer-icon.webp +0 -0
- package/docs/previews/navigation-layout-appshell-menu-badge.webp +0 -0
- package/docs/previews/navigation-layout-appshell-page-ground.webp +0 -0
- package/docs/previews/navigation-layout-appshell-themes.webp +0 -0
- package/docs/previews/navigation-layout-appshell.webp +0 -0
- package/docs/previews/navigation-layout-topappbar.webp +0 -0
- package/docs/roadmap.md +17 -6
- package/docs/troubleshooting.md +80 -0
- package/lib/components/components.css +2 -0
- package/lib/components/theme-tokens.css +18 -0
- package/lib/components/ui/layout/app-bar/top-app-bar/top-app-bar-collapse.css +60 -0
- package/lib/components/ui/layout/app-bar/top-app-bar/top-app-bar.css +205 -0
- package/lib/components/ui/layout/app-shell/app-header.css +70 -63
- package/lib/styles.css +2 -0
- package/lib/themes/ambre.css +5 -1
- package/lib/themes/ardoise.css +5 -1
- package/lib/themes/bleumono.css +5 -1
- package/lib/themes/bluemoon.css +5 -1
- package/lib/themes/corail.css +5 -1
- package/lib/themes/foret.css +5 -1
- package/lib/themes/lavande.css +5 -1
- package/lib/themes/menthe.css +5 -1
- package/lib/themes/ocean.css +5 -1
- package/lib/themes/pink.css +5 -1
- package/lib/themes/prune.css +5 -1
- package/lib/themes/sable.css +5 -1
- package/lib/themes/slate.css +5 -1
- package/lib/themes/teal.css +5 -1
- package/package.json +2 -2
- package/dist/lib/components/ui/layout/app-bar/top-app-bar.d.ts +0 -18
- package/dist/lib/components/ui/layout/app-shell/app-header-row.d.ts +0 -3
- package/dist/lib/components/ui/layout/app-shell/header-context.d.ts +0 -10
- package/dist/lib/components/ui/layout/app-shell/page-title.d.ts +0 -27
- /package/dist/lib/components/ui/layout/{app-shell → app-bar/top-app-bar}/use-truncated-title.d.ts +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './bottom-app-bar.js';
|
|
2
|
-
export * from './top-app-bar.js';
|
|
2
|
+
export * from './top-app-bar/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './top-app-bar.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LinkComponent } from '../../../../primitives/link/link-component.js';
|
|
3
|
+
import { TopAppBarAction } from '../top-app-bar.types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The bar's `actions` array: free ghost icon buttons, `between` (the primary
|
|
6
|
+
* action), then the account menu (on `trailing`, or a More button) with the
|
|
7
|
+
* rest. A phone and a desktop share one markup; classes hide what each does
|
|
8
|
+
* not show.
|
|
9
|
+
*/
|
|
10
|
+
export declare function TopAppBarActions({ actions, trailing, linkComponent, between, }: {
|
|
11
|
+
actions: readonly TopAppBarAction[];
|
|
12
|
+
trailing?: ReactNode;
|
|
13
|
+
linkComponent?: LinkComponent;
|
|
14
|
+
between?: ReactNode;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { TopAppBarTitleBlock } from './top-app-bar-title-block.js';
|
|
3
|
+
/** The second row of a medium or large bar: the title block, with room under it. */
|
|
4
|
+
export declare function TopAppBarHeadline(props: ComponentProps<typeof TopAppBarTitleBlock>): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { LinkComponent } from '../../../../primitives/link/link-component.js';
|
|
3
|
+
/** The classes that hide an entry on the screen that does not show it. */
|
|
4
|
+
export declare const ONLY: {
|
|
5
|
+
readonly phone: "md:hidden";
|
|
6
|
+
readonly desktop: "max-md:hidden";
|
|
7
|
+
};
|
|
8
|
+
/** The link an action with an `href` renders: the prop, the provider's, else `a`. */
|
|
9
|
+
export declare function useLink(own?: LinkComponent): ElementType;
|
package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-menu-section.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LinkComponent } from '../../../../primitives/link/link-component.js';
|
|
2
|
+
import { PlacedAction } from '../top-app-bar.actions.js';
|
|
3
|
+
/**
|
|
4
|
+
* The separator before section `i` belongs to it: hidden on a screen where
|
|
5
|
+
* that section is hidden, or where every section before it is.
|
|
6
|
+
*/
|
|
7
|
+
export declare function separatorClass(sections: {
|
|
8
|
+
items: PlacedAction[];
|
|
9
|
+
}[], i: number): string;
|
|
10
|
+
export declare function MenuSection({ group, items, linkComponent, }: {
|
|
11
|
+
group?: string;
|
|
12
|
+
items: PlacedAction[];
|
|
13
|
+
linkComponent?: LinkComponent;
|
|
14
|
+
}): import("react").JSX.Element;
|
package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-primary-action.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TopAppBarPrimaryAction } from '../top-app-bar.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The screen's main action. A `Button` in the row from 768 px and a `Fab` in
|
|
4
|
+
* the `FabDock` (above `--nxgt-bottom-chrome`) on a phone. Both are in the
|
|
5
|
+
* markup and only CSS hides one: the page renders the same on the server for
|
|
6
|
+
* every width, so a screen reader or a test sees the name twice in the DOM
|
|
7
|
+
* but one of the two is `display: none`. After mount the dock moves to
|
|
8
|
+
* `document.body`, out of any transformed ancestor.
|
|
9
|
+
*/
|
|
10
|
+
export declare function TopAppBarPrimary({ action, }: {
|
|
11
|
+
action: TopAppBarPrimaryAction;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LinkComponent } from '../../../../primitives/link/link-component.js';
|
|
3
|
+
import { TopAppBarAction, TopAppBarPrimaryAction } from '../top-app-bar.types.js';
|
|
4
|
+
type Props = {
|
|
5
|
+
leading?: ReactNode;
|
|
6
|
+
/** The shell's leading title, drawn in one box with the titles. */
|
|
7
|
+
titleLead?: ReactNode;
|
|
8
|
+
/** The title block, or nothing on a medium or large bar. */
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
/** A medium or large bar that collapses: the title's copy for the eye, shown in this row once the headline has folded away. */
|
|
11
|
+
collapsedTitle?: ReactNode;
|
|
12
|
+
titleAfter?: ReactNode;
|
|
13
|
+
search?: ReactNode;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
actions?: ReactNode | TopAppBarAction[];
|
|
16
|
+
primaryAction?: TopAppBarPrimaryAction;
|
|
17
|
+
linkComponent?: LinkComponent;
|
|
18
|
+
trailing?: ReactNode;
|
|
19
|
+
collapsedSlot?: string;
|
|
20
|
+
};
|
|
21
|
+
/** The bar's first row: leading, title, the app's own children, actions, trailing. */
|
|
22
|
+
export declare function TopAppBarRow({ leading, titleLead, title, collapsedTitle, titleAfter, search, children, actions, primaryAction, linkComponent, trailing, collapsedSlot, }: Props): import("react").JSX.Element;
|
|
23
|
+
export {};
|
package/dist/lib/components/ui/layout/app-bar/top-app-bar/partials/top-app-bar-title-block.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TopAppBarSlotNames } from '../top-app-bar.types.js';
|
|
3
|
+
type Props = {
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
titleId?: string;
|
|
6
|
+
subtitle?: ReactNode;
|
|
7
|
+
/** The old `headline`: the app's own element, so no second `<h1>`. */
|
|
8
|
+
legacy?: boolean;
|
|
9
|
+
slotNames?: TopAppBarSlotNames;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The one `<h1>` and, right after it (not inside), the subtitle `<p>`. Each
|
|
13
|
+
* carries a `title` with its full text only once it is cut off by an ellipsis
|
|
14
|
+
* (#629); the `<h1>` is focusable by script (never by Tab), so a shell can
|
|
15
|
+
* start a new page at its name.
|
|
16
|
+
*/
|
|
17
|
+
export declare function TopAppBarTitleBlock({ title, titleId, subtitle, legacy, slotNames, }: Props): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TopAppBarAction } from './top-app-bar.types.js';
|
|
2
|
+
/** The icons the bar keeps: one on a phone, two from 768 px. */
|
|
3
|
+
export declare const BAR_ICONS_PHONE = 1;
|
|
4
|
+
export declare const BAR_ICONS_DESKTOP = 2;
|
|
5
|
+
/** On which screens an entry shows, when it is not on both. */
|
|
6
|
+
export type ActionScreen = 'phone' | 'desktop';
|
|
7
|
+
export type PlacedAction = {
|
|
8
|
+
action: TopAppBarAction;
|
|
9
|
+
/** The key: the action's `id`, else its `label`. */
|
|
10
|
+
key: string;
|
|
11
|
+
/** Absent: both screens. */
|
|
12
|
+
only?: ActionScreen;
|
|
13
|
+
};
|
|
14
|
+
export type PartitionedActions = {
|
|
15
|
+
/** The bar's icons; a `only: 'desktop'` one is hidden on a phone. */
|
|
16
|
+
bar: PlacedAction[];
|
|
17
|
+
/** The menu's entries, in the given order; a `only: 'phone'` one is the bar icon a phone gave up. */
|
|
18
|
+
menu: PlacedAction[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Splits the actions between the bar's free icons and the account menu, for
|
|
22
|
+
* both screens at once (a phone and a desktop share one markup, so the page
|
|
23
|
+
* renders the same on the server). The first `'bar'` actions fill the
|
|
24
|
+
* icons (`phone` of them on a phone, `desktop` from 768 px); a `'bar'` action
|
|
25
|
+
* that does not fit goes to the menu; an `'account'` one is always in it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function partitionActions(actions: readonly TopAppBarAction[], limits?: {
|
|
28
|
+
phone?: number;
|
|
29
|
+
desktop?: number;
|
|
30
|
+
}): PartitionedActions;
|
|
31
|
+
/** The menu's entries cut into labelled sections: the ungrouped ones first, then each group in order of appearance. */
|
|
32
|
+
export declare function groupMenu(menu: readonly PlacedAction[]): {
|
|
33
|
+
group?: string;
|
|
34
|
+
items: PlacedAction[];
|
|
35
|
+
}[];
|
|
36
|
+
/** The one screen every entry of a section is limited to, else undefined (it shows on both). */
|
|
37
|
+
export declare function sectionScreen(items: readonly PlacedAction[]): ActionScreen | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Whether `actions` is data: a non-empty array whose every item is a plain
|
|
40
|
+
* object with a string `label`. An array of elements (keyed buttons) is a
|
|
41
|
+
* node and is drawn as given.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isActionData(actions: unknown): actions is TopAppBarAction[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TopAppBarProps } from './top-app-bar.types.js';
|
|
2
|
+
export type { TopAppBarAction, TopAppBarActionPlacement, TopAppBarAlign, TopAppBarPrimaryAction, TopAppBarProps, TopAppBarSize, } from './top-app-bar.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A top app bar: a row of actions and a title, in the Material 3 sizes. It
|
|
5
|
+
* is flat on the page ground; a `data-scrolled` attribute (set by the shell)
|
|
6
|
+
* tints it and draws a hairline. It does not scroll itself; `ActivityLayout`'s
|
|
7
|
+
* `header` collapses and hides the shell's own bar.
|
|
8
|
+
*/
|
|
9
|
+
export declare function TopAppBar({ size: sizeProp, align: alignProp, variant, title: titleProp, headline, titleId, subtitle, titleAfter, leading, actions, primaryAction, linkComponent, trailing, search, tabs, collapse, hideOnScroll, slotNames, titleLead, as: Tag, className, children, ...props }: TopAppBarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { LinkComponent } from '../../../primitives/link/link-component.js';
|
|
3
|
+
/** How tall the bar is: one row, a second row for the title, or a search field. */
|
|
4
|
+
export type TopAppBarSize = 'small' | 'medium-flexible' | 'large-flexible' | 'search';
|
|
5
|
+
/** Where a `small` bar puts its title. */
|
|
6
|
+
export type TopAppBarAlign = 'start' | 'center';
|
|
7
|
+
/** Where an action of a `TopAppBarAction[]` goes: a free icon in the bar, or the account menu. */
|
|
8
|
+
export type TopAppBarActionPlacement = 'bar' | 'account';
|
|
9
|
+
/**
|
|
10
|
+
* One action of the bar, as data: a free ghost icon button in the bar, or an
|
|
11
|
+
* entry of the account menu. The bar keeps one icon on a phone and two from
|
|
12
|
+
* 768 px; the rest goes to the menu.
|
|
13
|
+
*/
|
|
14
|
+
export type TopAppBarAction = {
|
|
15
|
+
/** The key; defaults to `label`. */
|
|
16
|
+
id?: string;
|
|
17
|
+
/** The action's name: the icon button's accessible name, the menu entry's text. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** The icon, decorative (the action is named by `label`). */
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
/** The action was chosen. */
|
|
22
|
+
onClick?: () => void;
|
|
23
|
+
/** Makes the action a link, drawn with `linkComponent` (default `<a>`). */
|
|
24
|
+
href?: string;
|
|
25
|
+
/** `'bar'` (default): a bar icon while there is room. `'account'`: always in the account menu. */
|
|
26
|
+
placement?: TopAppBarActionPlacement;
|
|
27
|
+
/**
|
|
28
|
+
* The menu section the entry belongs to ("Language", "Theme"): its entries
|
|
29
|
+
* sit under that label, inline (never in a submenu, which overflows at
|
|
30
|
+
* 360 px). Entries without one come first.
|
|
31
|
+
*/
|
|
32
|
+
group?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The current choice of its group: a group of non-link entries where one
|
|
35
|
+
* sets `selected` is a radio group (`menuitemradio`, `aria-checked`); a
|
|
36
|
+
* link entry with `selected` is the current page (`aria-current="page"`).
|
|
37
|
+
*/
|
|
38
|
+
selected?: boolean;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
};
|
|
41
|
+
/** The screen's main action: a `Button` from 768 px, a `Fab` above the bottom chrome on a phone. */
|
|
42
|
+
export type TopAppBarPrimaryAction = {
|
|
43
|
+
label: string;
|
|
44
|
+
/** Required: the phone's FAB is its icon. */
|
|
45
|
+
icon: ReactNode;
|
|
46
|
+
onClick?: () => void;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @internal kept so the shell keeps its app-header* slots; removed with the slot rename in the next major
|
|
51
|
+
*
|
|
52
|
+
* The `data-slot` of the bar's parts, for a bar that must keep other names
|
|
53
|
+
* (the shell's `app-header*`). The bar's own root `data-slot` is overridden
|
|
54
|
+
* the usual way, as a prop. top-app-bar.css styles both names.
|
|
55
|
+
*/
|
|
56
|
+
export type TopAppBarSlotNames = Partial<Record<'title' | 'titleBlock' | 'subtitle' | 'headline' | 'collapsedTitle' | 'tabs', string>>;
|
|
57
|
+
export type TopAppBarProps = {
|
|
58
|
+
/** @internal kept so the shell keeps its app-header* slots; removed with the slot rename in the next major */
|
|
59
|
+
slotNames?: TopAppBarSlotNames;
|
|
60
|
+
/** @internal the shell's leading title: drawn with the title in one box whose width does not come from its content (a size container), so the title can be hidden when squeezed. */
|
|
61
|
+
titleLead?: ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* The bar's height. `'small'` (the default): one row. `'medium-flexible'`
|
|
64
|
+
* and `'large-flexible'`: the `title` on a second row, 28 px and 40 px
|
|
65
|
+
* (36 px on a phone). `'search'`: the `search` field is the bar's centre.
|
|
66
|
+
* Without a `title`, a medium or large bar draws as `'small'`.
|
|
67
|
+
*/
|
|
68
|
+
size?: TopAppBarSize;
|
|
69
|
+
/** `'center'` centres a `small` bar's title. Default `'start'`. */
|
|
70
|
+
align?: TopAppBarAlign;
|
|
71
|
+
/** The page's heading: the bar renders it as the one `<h1>`. */
|
|
72
|
+
title?: ReactNode;
|
|
73
|
+
/** An `id` for the `<h1>`, to name a region with `aria-labelledby`. */
|
|
74
|
+
titleId?: string;
|
|
75
|
+
/** A line under the title, in muted text: a `<p>` right after the `<h1>`, one line, truncated. */
|
|
76
|
+
subtitle?: ReactNode;
|
|
77
|
+
/** Beside the title: a badge, a status. */
|
|
78
|
+
titleAfter?: ReactNode;
|
|
79
|
+
/** At the start of the row: a menu or back button. */
|
|
80
|
+
leading?: ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* The row's actions, at its end. A `ReactNode` is drawn as given. An array
|
|
83
|
+
* of `TopAppBarAction` draws free ghost icon buttons (one on a phone, two
|
|
84
|
+
* from 768 px) and gathers the others, and the actions placed in
|
|
85
|
+
* `'account'`, in a menu opened by `trailing` (the avatar), or by a More
|
|
86
|
+
* button when there is no `trailing`.
|
|
87
|
+
*/
|
|
88
|
+
actions?: ReactNode | TopAppBarAction[];
|
|
89
|
+
/**
|
|
90
|
+
* The very end of the row: an avatar. With an `actions` array of data it
|
|
91
|
+
* becomes the account menu's trigger (a `<button>`), so it must be
|
|
92
|
+
* non-interactive: no link, button or input inside (a warning in
|
|
93
|
+
* development).
|
|
94
|
+
*/
|
|
95
|
+
trailing?: ReactNode;
|
|
96
|
+
/**
|
|
97
|
+
* The screen's main action: a `Button` from 768 px, a `Fab` above the
|
|
98
|
+
* bottom chrome on a phone. Both are in the markup and CSS shows one. After
|
|
99
|
+
* mount the phone's Fab is portalled to `document.body`, so a transformed
|
|
100
|
+
* ancestor (a sliding header, a backdrop blur) cannot break its
|
|
101
|
+
* `position: fixed`.
|
|
102
|
+
*/
|
|
103
|
+
primaryAction?: TopAppBarPrimaryAction;
|
|
104
|
+
/** The field of a `'search'` bar. */
|
|
105
|
+
search?: ReactNode;
|
|
106
|
+
/** A row under the bar: a `Tabs` list. */
|
|
107
|
+
tabs?: ReactNode;
|
|
108
|
+
/** Marks the bar as one that collapses its second row on scroll (`data-collapse`). */
|
|
109
|
+
collapse?: boolean;
|
|
110
|
+
/** Marks the bar as one that hides on scroll down (`data-hide-on-scroll`). */
|
|
111
|
+
hideOnScroll?: boolean;
|
|
112
|
+
/** The link an action with an `href` renders: the nearest `LinkComponentProvider`'s, else `'a'`. */
|
|
113
|
+
linkComponent?: LinkComponent;
|
|
114
|
+
/** The element drawn: `'div'` (the default) or `'header'`. */
|
|
115
|
+
as?: 'div' | 'header';
|
|
116
|
+
/** @deprecated Use `size` and `align`: `'center'` is `small` + `align="center"`, `'medium'` is `'medium-flexible'`, `'large'` is `'large-flexible'`. */
|
|
117
|
+
variant?: 'small' | 'center' | 'medium' | 'large';
|
|
118
|
+
/** @deprecated Use `title`, which renders the bar's own `<h1>`. `headline` renders in a non-heading `<div>` (put your own heading element in it) with the bar's title styling. */
|
|
119
|
+
headline?: ReactNode;
|
|
120
|
+
} & Omit<ComponentProps<'div'>, 'title'>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TopAppBarAlign, TopAppBarProps, TopAppBarSize } from './top-app-bar.types.js';
|
|
3
|
+
export type TopAppBarVariant = NonNullable<TopAppBarProps['variant']>;
|
|
4
|
+
/** The size and align each deprecated `variant` stands for: the one table the bar and the shell read. */
|
|
5
|
+
export declare const VARIANT_ALIASES: Record<TopAppBarVariant, [
|
|
6
|
+
TopAppBarSize,
|
|
7
|
+
TopAppBarAlign
|
|
8
|
+
]>;
|
|
9
|
+
/**
|
|
10
|
+
* The size and align a bar draws: the deprecated `variant` wins over the
|
|
11
|
+
* defaults only when `size` and `align` are not given.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toSizeAlign(props: Pick<TopAppBarProps, 'size' | 'align' | 'variant'>): {
|
|
14
|
+
size: TopAppBarSize;
|
|
15
|
+
align: TopAppBarAlign;
|
|
16
|
+
};
|
|
17
|
+
/** The deprecated `variant` that draws a size and align (`'small'` for the sizes with none, a `search` bar included). */
|
|
18
|
+
export declare function variantOf(size: TopAppBarSize, align: TopAppBarAlign): TopAppBarVariant;
|
|
19
|
+
/** The old `data-variant` value of a bar, kept for styles written against it. */
|
|
20
|
+
export declare function legacyVariant(size: TopAppBarSize, align: TopAppBarAlign): string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The bar's title: `title`, else the deprecated `headline` (which warns once
|
|
23
|
+
* and renders in a non-heading element).
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveTitle(title: ReactNode, headline: ReactNode): {
|
|
26
|
+
title: ReactNode;
|
|
27
|
+
legacy: boolean;
|
|
28
|
+
};
|
|
29
|
+
/** Whether a bar has a headline row: a medium or large size with a title. */
|
|
30
|
+
export declare function hasHeadlineRow(size: TopAppBarSize | 'none', title: unknown): boolean;
|
|
31
|
+
/** The bar's data attributes: the look, and the scroll behaviours it opts into. */
|
|
32
|
+
export declare function barAttributes({ size, align, collapse, hideOnScroll, }: {
|
|
33
|
+
size: TopAppBarSize;
|
|
34
|
+
align: TopAppBarAlign;
|
|
35
|
+
collapse?: boolean;
|
|
36
|
+
hideOnScroll?: boolean;
|
|
37
|
+
}): {
|
|
38
|
+
'data-variant': string | undefined;
|
|
39
|
+
'data-size': TopAppBarSize;
|
|
40
|
+
'data-align': TopAppBarAlign;
|
|
41
|
+
'data-collapse': string | undefined;
|
|
42
|
+
'data-hide-on-scroll': string | undefined;
|
|
43
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode, RefObject } from 'react';
|
|
2
2
|
import { ShellBack } from './activity-layout-navigation.types.js';
|
|
3
|
-
import { AppHeader } from './app-header.js';
|
|
4
3
|
import { ResolvedHeader } from './navigation.utils.js';
|
|
5
4
|
import { usePageTitleScope } from './page-title-scope.js';
|
|
5
|
+
import { ShellTopAppBar } from './shell-top-app-bar.js';
|
|
6
6
|
type BarProps = ReturnType<typeof usePageTitleScope>;
|
|
7
7
|
/** Whether the header has a headline row: a medium or large one, with a page title to put in it. */
|
|
8
8
|
export declare const hasHeadline: (header: ResolvedHeader, pageTitle: ReactNode) => boolean;
|
|
@@ -20,10 +20,10 @@ export declare function ActivityScroll({ on, region, children, }: {
|
|
|
20
20
|
children: ReactNode;
|
|
21
21
|
}): import("react").JSX.Element;
|
|
22
22
|
/**
|
|
23
|
-
* The app bar of {@link ActivityLayout}
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* the
|
|
23
|
+
* The app bar of {@link ActivityLayout}: a {@link TopAppBar} drawn as the
|
|
24
|
+
* page's `<header>`, in the size the route resolved. The page's title is its
|
|
25
|
+
* one `h1`; a medium or large size puts it on a second row (the small row then
|
|
26
|
+
* holds a faded copy of it), the others keep it in the row.
|
|
27
27
|
*/
|
|
28
28
|
export declare function ActivityAppBar({ header, back, bar, headerTitle, hasBackdrop, ...props }: {
|
|
29
29
|
header: ResolvedHeader;
|
|
@@ -31,5 +31,5 @@ export declare function ActivityAppBar({ header, back, bar, headerTitle, hasBack
|
|
|
31
31
|
bar: BarProps;
|
|
32
32
|
headerTitle?: ReactNode;
|
|
33
33
|
hasBackdrop: boolean;
|
|
34
|
-
} & Omit<ComponentProps<typeof
|
|
34
|
+
} & Omit<ComponentProps<typeof ShellTopAppBar>, 'children' | 'size' | 'align' | 'headline' | 'title'>): import("react").JSX.Element | null;
|
|
35
35
|
export {};
|
|
@@ -7,9 +7,12 @@ export declare const CHROME_FILL = "bg-(--nxgt-backdrop-fill-chrome)";
|
|
|
7
7
|
* transparency). */
|
|
8
8
|
export declare const CHROME_FROSTED = "bg-(--nxgt-backdrop-fill-chrome) backdrop-blur-(--nxgt-backdrop-blur)";
|
|
9
9
|
/**
|
|
10
|
-
* The sticky app bar's classes
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* The sticky app bar's classes. At rest it keeps the shell's fill
|
|
11
|
+
* (app-header.css, the page colour at 90%), tinted by top-app-bar.css once the
|
|
12
|
+
* page scrolls. Under a `backdrop` its fill is the chrome's translucent token
|
|
13
|
+
* (activity-backdrop.css), frosted: a utility class, so it wins over the bar's
|
|
14
|
+
* at-rest ground (a lower layer); once scrolled, app-header.css gives the fill
|
|
15
|
+
* back over the tint.
|
|
13
16
|
*/
|
|
14
17
|
export declare const appBarClass: (hasBackdrop: boolean) => string;
|
|
15
18
|
/** The sidebar: a little more opaque than the app bar, for its text's contrast. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActivityLayoutProps } from './activity-layout.types.js';
|
|
2
|
-
declare const COLUMN_KEYS: readonly ["context", "headerTitle", "titleAfter", "headerContext", "breadcrumb", "breadcrumbRoot", "headerActions", "avatar", "menuOpen", "onMenuOpenChange", "keepClear"];
|
|
2
|
+
declare const COLUMN_KEYS: readonly ["context", "headerTitle", "titleAfter", "headerContext", "breadcrumb", "breadcrumbRoot", "headerActions", "headerPrimaryAction", "avatar", "menuOpen", "onMenuOpenChange", "keepClear"];
|
|
3
3
|
type ColumnKey = (typeof COLUMN_KEYS)[number];
|
|
4
4
|
export type ColumnOwnProps = Pick<ActivityLayoutProps, ColumnKey>;
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ActivityLayoutProps } from './activity-layout.types.js';
|
|
3
|
-
type ColumnProps = Pick<ActivityLayoutProps, 'items' | 'brand' | 'logo' | 'name' | 'context' | 'headerTitle' | 'titleAfter' | 'headerContext' | 'breadcrumb' | 'breadcrumbRoot' | 'headerActions' | 'avatar' | 'linkComponent' | 'menuOpen' | 'onMenuOpenChange' | 'routeTransition' | 'backdrop' | 'keepClear' | 'header'> & {
|
|
3
|
+
type ColumnProps = Pick<ActivityLayoutProps, 'items' | 'brand' | 'logo' | 'name' | 'context' | 'headerTitle' | 'titleAfter' | 'headerContext' | 'breadcrumb' | 'breadcrumbRoot' | 'headerActions' | 'headerPrimaryAction' | 'avatar' | 'linkComponent' | 'menuOpen' | 'onMenuOpenChange' | 'routeTransition' | 'backdrop' | 'keepClear' | 'header'> & {
|
|
4
4
|
/** The element of the content region. */
|
|
5
5
|
as: 'main' | 'div';
|
|
6
6
|
contained: boolean;
|
|
@@ -21,5 +21,5 @@ type ColumnProps = Pick<ActivityLayoutProps, 'items' | 'brand' | 'logo' | 'name'
|
|
|
21
21
|
* The content column of {@link ActivityLayout}: the backdrop layer behind, the
|
|
22
22
|
* app bar, the breadcrumb and the routed content region.
|
|
23
23
|
*/
|
|
24
|
-
export declare function ActivityColumn({ as, contained, hasBackdrop, themeBackdrop, headerTitle, titleAfter, headerContext, breadcrumb, breadcrumbRoot, headerActions, avatar, routeTransition, backdrop, keepClear, showMenu, topNav, floating, trackScroll, header, children, ...menu }: ColumnProps): import("react").JSX.Element;
|
|
24
|
+
export declare function ActivityColumn({ as, contained, hasBackdrop, themeBackdrop, headerTitle, titleAfter, headerContext, breadcrumb, breadcrumbRoot, headerActions, headerPrimaryAction, avatar, routeTransition, backdrop, keepClear, showMenu, topNav, floating, trackScroll, header, children, ...menu }: ColumnProps): import("react").JSX.Element;
|
|
25
25
|
export {};
|
|
@@ -31,8 +31,27 @@ export type ShellNavigationOptions = {
|
|
|
31
31
|
/** Keeps the `'rail-expanded'` rail's, the `'sidebar'`'s and the `'two-level'` panel's open or narrow state in the browser under this key (read after hydration). Unset: the rail starts expanded, the sidebar collapsed and the panel open every time. */
|
|
32
32
|
persistKey?: string;
|
|
33
33
|
};
|
|
34
|
-
/**
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The height and kind of the shell header's bar. `'search'` is the search app
|
|
36
|
+
* bar: the `search` field is the bar's centre, and the title stays for
|
|
37
|
+
* assistive technology.
|
|
38
|
+
*/
|
|
39
|
+
export type ShellHeaderSize = 'small' | 'medium-flexible' | 'large-flexible' | 'search';
|
|
40
|
+
/** Where the bar's title sits. */
|
|
41
|
+
export type ShellHeaderAlign = 'start' | 'center';
|
|
42
|
+
/**
|
|
43
|
+
* The shell header's look: a `ShellHeaderSize`, or `'none'` for no header.
|
|
44
|
+
* `'center'`, `'medium'` and `'large'` are deprecated aliases kept working:
|
|
45
|
+
* `'center'` is `'small'` with `align: 'center'`, `'medium'` is
|
|
46
|
+
* `'medium-flexible'` and `'large'` is `'large-flexible'`.
|
|
47
|
+
*/
|
|
48
|
+
export type ShellHeaderVariant = ShellHeaderSize | 'none'
|
|
49
|
+
/** @deprecated Use `{ size: 'small', align: 'center' }`. */
|
|
50
|
+
| 'center'
|
|
51
|
+
/** @deprecated Use `'medium-flexible'`. */
|
|
52
|
+
| 'medium'
|
|
53
|
+
/** @deprecated Use `'large-flexible'`. */
|
|
54
|
+
| 'large';
|
|
36
55
|
/**
|
|
37
56
|
* A route's back arrow (`handle.back`): `{ to, label }` links to `to` and is
|
|
38
57
|
* named "Back to <label>" ("Back" without one); `true` goes back in the
|
|
@@ -44,8 +63,17 @@ export type ShellBack = true | {
|
|
|
44
63
|
};
|
|
45
64
|
/** The header, with its options. */
|
|
46
65
|
export type ShellHeaderOptions = {
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
/** The bar's size. @default 'small' */
|
|
67
|
+
size?: ShellHeaderSize;
|
|
68
|
+
/** Where the title sits. @default 'start' */
|
|
69
|
+
align?: ShellHeaderAlign;
|
|
70
|
+
/**
|
|
71
|
+
* `'none'` draws no header; the other values are the old spelling of `size`
|
|
72
|
+
* and `align`, mapped to them.
|
|
73
|
+
* @deprecated Use `size` and `align` (`'none'` stays valid here).
|
|
74
|
+
*/
|
|
75
|
+
variant?: ShellHeaderVariant;
|
|
76
|
+
/** Whether a `medium-flexible` or `large-flexible` header collapses to the small one while scrolling. @default true for those two sizes */
|
|
49
77
|
collapse?: boolean;
|
|
50
78
|
/** Whether the header slides away while scrolling down. @default false */
|
|
51
79
|
hideOnScroll?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { TopAppBarAction, TopAppBarPrimaryAction } from '../app-bar/top-app-bar/top-app-bar.types.js';
|
|
2
3
|
import { ActivityLayoutNavigationProps } from './activity-layout-navigation.types.js';
|
|
3
4
|
import { AppBreadcrumbRoot } from './app-breadcrumb.js';
|
|
4
5
|
import { RouteTransition } from './route-transition.js';
|
|
@@ -60,8 +61,17 @@ export type ActivityLayoutProps = {
|
|
|
60
61
|
breadcrumb?: boolean;
|
|
61
62
|
/** The breadcrumb's first crumb: a text link, or (`icon: true`) the home icon alone with its own target and name. */
|
|
62
63
|
breadcrumbRoot?: AppBreadcrumbRoot;
|
|
63
|
-
/**
|
|
64
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Passed to the header, before the avatar. A node is drawn as given; an
|
|
66
|
+
* array of `TopAppBarAction` (data) draws free icon buttons, with the rest
|
|
67
|
+
* in the account menu opened by the `avatar`.
|
|
68
|
+
*/
|
|
69
|
+
headerActions?: ReactNode | TopAppBarAction[];
|
|
70
|
+
/**
|
|
71
|
+
* The screen's main action in the app bar: a `Button` from 768 px, a `Fab`
|
|
72
|
+
* above the bottom chrome on a phone (`TopAppBar`'s `primaryAction`).
|
|
73
|
+
*/
|
|
74
|
+
headerPrimaryAction?: TopAppBarPrimaryAction;
|
|
65
75
|
/** Passed to the header. An image URL, or a whole node. */
|
|
66
76
|
avatar?: ReactNode;
|
|
67
77
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { TopAppBarAction } from '../app-bar/top-app-bar/top-app-bar.types.js';
|
|
2
3
|
import { AppSearchBarProps } from '../app-search/app-search.types.js';
|
|
3
4
|
import { ShellBack } from './activity-layout-navigation.types.js';
|
|
4
5
|
import { AppLogo, AppShellLinkComponent, MenuItem } from './types.js';
|
|
@@ -11,7 +12,7 @@ export type AppHeaderProps = {
|
|
|
11
12
|
/** The classes hiding the top navigation (`navigation="top"`) where it does not show, drawn right after the menu button with the brand; undefined: none. */
|
|
12
13
|
topNav?: string;
|
|
13
14
|
/** Rendered before the avatar — notifications, help, a theme toggle. */
|
|
14
|
-
actions?: ReactNode;
|
|
15
|
+
actions?: ReactNode | TopAppBarAction[];
|
|
15
16
|
/** An image URL, or a whole node when the app renders its own. */
|
|
16
17
|
avatar?: ReactNode;
|
|
17
18
|
/** The menu sheet's sidebar header; see `AppSidebar`'s `brand`. */
|
|
@@ -63,7 +64,12 @@ export type AppHeaderProps = {
|
|
|
63
64
|
headline?: ReactNode;
|
|
64
65
|
} & PropsWithChildren;
|
|
65
66
|
/**
|
|
66
|
-
* The top bar.
|
|
67
|
+
* The top bar.
|
|
68
|
+
*
|
|
69
|
+
* @deprecated Use `TopAppBar`, which `ActivityLayout` draws its own bar with.
|
|
70
|
+
* `AppHeader` stays as a wrapper over it, with the props it always had.
|
|
71
|
+
*
|
|
72
|
+
* On mobile it also *is* the navigation: the sidebar is hidden by
|
|
67
73
|
* the layout and reappears here inside a `Sheet`, which is why this component
|
|
68
74
|
* takes `items` at all.
|
|
69
75
|
*
|
|
@@ -75,4 +81,4 @@ export type AppHeaderProps = {
|
|
|
75
81
|
* {@link ActivityLayout}: the menu sheet reads the location to close when it
|
|
76
82
|
* changes, and `useLocation` throws outside a router.
|
|
77
83
|
*/
|
|
78
|
-
export declare function AppHeader({
|
|
84
|
+
export declare function AppHeader({ variant, headline, children, ...props }: AppHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ShellHeaderAlign, ShellHeaderOptions, ShellHeaderSize, ShellHeaderVariant } from './activity-layout-navigation.types.js';
|
|
2
|
+
/** A header's size and alignment, new spelling only. */
|
|
3
|
+
export type HeaderLook = {
|
|
4
|
+
size?: ShellHeaderSize | 'none';
|
|
5
|
+
align?: ShellHeaderAlign;
|
|
6
|
+
};
|
|
7
|
+
/** The new spelling of each old variant. */
|
|
8
|
+
export declare function variantLook(variant: ShellHeaderVariant): HeaderLook;
|
|
9
|
+
/**
|
|
10
|
+
* The header an input spells, with the old `variant` values mapped to `size`
|
|
11
|
+
* and `align` (a dev-only warning names the new spelling). `size` and `align`
|
|
12
|
+
* win over `variant`. Only the options the input sets are returned.
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizeHeader(header?: ShellHeaderVariant | ShellHeaderOptions): Omit<ShellHeaderOptions, 'variant' | 'size' | 'align'> & HeaderLook;
|
|
@@ -1,43 +1,16 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* The header's leading title, truncated with an
|
|
4
|
-
* then does it carry a `title` with the full text
|
|
5
|
-
* name stays the content itself.
|
|
6
|
-
*
|
|
7
|
-
* (
|
|
8
|
-
*
|
|
3
|
+
* The header's leading title (the active organisation), truncated with an
|
|
4
|
+
* ellipsis when long. Only then does it carry a `title` with the full text
|
|
5
|
+
* (#629): the accessible name stays the content itself. It is as wide as its
|
|
6
|
+
* text, up to 35% of the titles' box (45% from `sm`) when the page's title
|
|
7
|
+
* shares it (alone, it keeps the whole box and goes under 4.5rem). When that box is under 8rem (the share would be an ellipsis and
|
|
8
|
+
* a sliver) it is visually hidden (`sr-only`) and stays in the accessibility
|
|
9
|
+
* tree (#1693): a container query on the box the bar draws around the titles
|
|
10
|
+
* (top-app-bar-row.tsx), whose width does not come from its content.
|
|
9
11
|
*/
|
|
10
|
-
export declare function HeaderTitle({ children, shrinks,
|
|
12
|
+
export declare function HeaderTitle({ children, shrinks, }: {
|
|
11
13
|
children?: ReactNode;
|
|
12
|
-
/** Centre it, for the `'center'` header. */
|
|
13
|
-
center?: boolean;
|
|
14
14
|
/** The page's title shares the bar: this one gives it room. */
|
|
15
15
|
shrinks?: boolean;
|
|
16
16
|
}): import("react").JSX.Element | null;
|
|
17
|
-
/**
|
|
18
|
-
* The page's title in the small bar of a medium or large header, a copy of the
|
|
19
|
-
* headline's text for the eye: hidden from the accessibility tree (the headline
|
|
20
|
-
* is the page's `h1`) and faded in by app-header.css as the headline collapses.
|
|
21
|
-
*/
|
|
22
|
-
export declare function CollapsedTitle({ children, separated, }: {
|
|
23
|
-
children: ReactNode;
|
|
24
|
-
/** A leading title precedes it: a thin rule between them. */
|
|
25
|
-
separated?: boolean;
|
|
26
|
-
}): import("react").JSX.Element;
|
|
27
|
-
/**
|
|
28
|
-
* The app bar's titles: the leading `headerTitle`, then the page's title (a
|
|
29
|
-
* route's `handle.title`, the page's `h1`) after a thin rule when both are set.
|
|
30
|
-
*/
|
|
31
|
-
export declare function AppBarTitles({ headerTitle, pageTitle, pageTitleAfter, headerContext, titleId, center, collapsedTitle, }: {
|
|
32
|
-
headerTitle?: ReactNode;
|
|
33
|
-
pageTitle?: ReactNode;
|
|
34
|
-
/** The slot right after the page's title, outside its `h1`. */
|
|
35
|
-
pageTitleAfter?: ReactNode;
|
|
36
|
-
/** The small muted context line after the title, from `md` up. */
|
|
37
|
-
headerContext?: ReactNode;
|
|
38
|
-
titleId?: string;
|
|
39
|
-
/** The `'center'` header: the titles are centred. */
|
|
40
|
-
center?: boolean;
|
|
41
|
-
/** The page's title for a medium or large header, whose headline row carries the `h1`: the bar shows this copy once collapsed. */
|
|
42
|
-
collapsedTitle?: ReactNode;
|
|
43
|
-
}): import("react").JSX.Element;
|
|
@@ -2,10 +2,12 @@ import { UIMatch } from 'react-router';
|
|
|
2
2
|
import { ShellBack, ShellHeaderOptions, ShellHeaderVariant } from './activity-layout-navigation.types.js';
|
|
3
3
|
/** What `header` and a route's `handle.header` take. */
|
|
4
4
|
export type ShellHeaderInput = ShellHeaderVariant | ShellHeaderOptions;
|
|
5
|
-
/** The
|
|
5
|
+
/** The headline row a header gives back while it collapses, by size, in rem (16px each): the height used before the real one is measured (the server, first paint). */
|
|
6
6
|
export declare const HEADLINE_REM: {
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
7
|
+
readonly small: 0;
|
|
8
|
+
readonly 'medium-flexible': 3;
|
|
9
|
+
readonly 'large-flexible': 6.5;
|
|
10
|
+
readonly search: 0;
|
|
9
11
|
};
|
|
10
12
|
/** Px of scroll past which a header that hides on scroll goes away. */
|
|
11
13
|
export declare const HIDE_AFTER = 64;
|
|
@@ -33,5 +35,13 @@ export declare function mergeHeader(layout?: ShellHeaderInput, route?: ShellHead
|
|
|
33
35
|
* middle instead of following the scroll.
|
|
34
36
|
*/
|
|
35
37
|
export declare function collapseProgress(offset: number, range: number, reducedMotion?: boolean): number;
|
|
38
|
+
/** Whether the page has scrolled at all: the bar leaves the ground for its tint and hairline. */
|
|
39
|
+
export declare function isHeaderScrolled(offset: number): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The px of scroll a collapse takes: the measured headline row when there is
|
|
42
|
+
* one, else `fallback` (the server, before mount, no `ResizeObserver`). 0
|
|
43
|
+
* (a bar that does not collapse) stays 0.
|
|
44
|
+
*/
|
|
45
|
+
export declare function collapseRange(fallback: number, measured?: number): number;
|
|
36
46
|
/** Whether a header that hides on scroll is away: scrolling down, past `after` px. */
|
|
37
47
|
export declare function isHeaderHidden(direction: 'up' | 'down' | 'none', offset: number, after?: number): boolean;
|
|
@@ -10,5 +10,5 @@ export { DEFAULT_NAVIGATION, navigationClasses, type ResolvedHeader, type Resolv
|
|
|
10
10
|
export { usePageTitleFocus } from './page-title-focus.js';
|
|
11
11
|
export type { AppShellHandle, PageTitle } from './page-title-scope.js';
|
|
12
12
|
export { ROUTE_TRANSITION_CLASS, type RouteTransition, } from './route-transition.js';
|
|
13
|
-
export { ShellScrollContext, type ShellScrollDirection, type ShellScrollOptions, ShellScrollProvider, type ShellScrollState, useScrollTracker, useShellScroll, } from './shell-scroll.js';
|
|
13
|
+
export { ShellScrollContext, type ShellScrollDirection, type ShellScrollOptions, ShellScrollProvider, type ShellScrollPublisher, type ShellScrollState, useScrollTracker, useShellScroll, } from './shell-scroll.js';
|
|
14
14
|
export * from './types.js';
|