@canonical/react-ds-app 0.37.0 → 0.40.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/README.md +30 -0
- package/dist/esm/lib/ApplicationLayout/styles.css +27 -24
- package/dist/esm/lib/ContentLayout/styles.css +13 -10
- package/dist/esm/lib/SideNavigation/SideNavigation.js +51 -9
- package/dist/esm/lib/SideNavigation/SideNavigation.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js +14 -6
- package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/CollapseToggle/styles.css +52 -3
- package/dist/esm/lib/SideNavigation/common/Content/Content.js +9 -5
- package/dist/esm/lib/SideNavigation/common/Content/Content.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/Content/styles.css +55 -28
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.js +70 -0
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/index.js +2 -0
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/index.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/styles.css +94 -0
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/types.js +2 -0
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/types.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/Footer/Footer.js +46 -6
- package/dist/esm/lib/SideNavigation/common/Footer/Footer.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/Footer/styles.css +17 -4
- package/dist/esm/lib/SideNavigation/common/Group/Group.js +14 -0
- package/dist/esm/lib/SideNavigation/common/Group/Group.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/Group/index.js +2 -0
- package/dist/esm/lib/SideNavigation/common/Group/index.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/Group/styles.css +18 -0
- package/dist/esm/lib/SideNavigation/common/Group/types.js +2 -0
- package/dist/esm/lib/SideNavigation/common/Group/types.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/GroupHeader/GroupHeader.js +17 -0
- package/dist/esm/lib/SideNavigation/common/GroupHeader/GroupHeader.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/GroupHeader/index.js +2 -0
- package/dist/esm/lib/SideNavigation/common/GroupHeader/index.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/GroupHeader/styles.css +31 -0
- package/dist/esm/lib/SideNavigation/common/GroupHeader/types.js +2 -0
- package/dist/esm/lib/SideNavigation/common/GroupHeader/types.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/Header/Header.js +4 -2
- package/dist/esm/lib/SideNavigation/common/Header/Header.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/Header/styles.css +73 -32
- package/dist/esm/lib/SideNavigation/common/Item/Item.js +9 -13
- package/dist/esm/lib/SideNavigation/common/Item/Item.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/Item/styles.css +86 -46
- package/dist/esm/lib/SideNavigation/common/ItemButton/ItemButton.js +18 -0
- package/dist/esm/lib/SideNavigation/common/ItemButton/ItemButton.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/ItemButton/index.js +2 -0
- package/dist/esm/lib/SideNavigation/common/ItemButton/index.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/ItemButton/styles.css +79 -0
- package/dist/esm/lib/SideNavigation/common/ItemButton/types.js +2 -0
- package/dist/esm/lib/SideNavigation/common/ItemButton/types.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/ItemExpandable/ItemExpandable.js +71 -0
- package/dist/esm/lib/SideNavigation/common/ItemExpandable/ItemExpandable.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/ItemExpandable/index.js +2 -0
- package/dist/esm/lib/SideNavigation/common/ItemExpandable/index.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/ItemExpandable/styles.css +121 -0
- package/dist/esm/lib/SideNavigation/common/ItemExpandable/types.js +2 -0
- package/dist/esm/lib/SideNavigation/common/ItemExpandable/types.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js +64 -22
- package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/NavTree/styles.css +10 -28
- package/dist/esm/lib/SideNavigation/common/index.js +5 -0
- package/dist/esm/lib/SideNavigation/common/index.js.map +1 -1
- package/dist/esm/lib/SideNavigation/helpItem.js +29 -0
- package/dist/esm/lib/SideNavigation/helpItem.js.map +1 -0
- package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/index.js +2 -0
- package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/index.js.map +1 -0
- package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/types.js +2 -0
- package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/types.js.map +1 -0
- package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.js +45 -0
- package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.js.map +1 -0
- package/dist/esm/lib/SideNavigation/index.js +1 -0
- package/dist/esm/lib/SideNavigation/index.js.map +1 -1
- package/dist/esm/lib/SideNavigation/styles.css +280 -24
- package/dist/esm/lib/ViewLayout/styles.css +25 -22
- package/dist/types/lib/ApplicationLayout/types.d.ts +5 -3
- package/dist/types/lib/ApplicationLayout/types.d.ts.map +1 -1
- package/dist/types/lib/ContentLayout/types.d.ts +5 -3
- package/dist/types/lib/ContentLayout/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/SideNavigation.d.ts +22 -1
- package/dist/types/lib/SideNavigation/SideNavigation.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts +9 -2
- package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts +10 -3
- package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Content/Content.d.ts +8 -4
- package/dist/types/lib/SideNavigation/common/Content/Content.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Content/types.d.ts +8 -9
- package/dist/types/lib/SideNavigation/common/Content/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.d.ts +20 -0
- package/dist/types/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/ContextSwitcher/index.d.ts +3 -0
- package/dist/types/lib/SideNavigation/common/ContextSwitcher/index.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/ContextSwitcher/types.d.ts +52 -0
- package/dist/types/lib/SideNavigation/common/ContextSwitcher/types.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts +8 -4
- package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Footer/types.d.ts +9 -10
- package/dist/types/lib/SideNavigation/common/Footer/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Group/Group.d.ts +13 -0
- package/dist/types/lib/SideNavigation/common/Group/Group.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/Group/index.d.ts +3 -0
- package/dist/types/lib/SideNavigation/common/Group/index.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/Group/types.d.ts +10 -0
- package/dist/types/lib/SideNavigation/common/Group/types.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/GroupHeader/GroupHeader.d.ts +13 -0
- package/dist/types/lib/SideNavigation/common/GroupHeader/GroupHeader.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/GroupHeader/index.d.ts +3 -0
- package/dist/types/lib/SideNavigation/common/GroupHeader/index.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/GroupHeader/types.d.ts +8 -0
- package/dist/types/lib/SideNavigation/common/GroupHeader/types.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/Header/Header.d.ts +3 -1
- package/dist/types/lib/SideNavigation/common/Header/Header.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Header/types.d.ts +5 -3
- package/dist/types/lib/SideNavigation/common/Header/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Item/Item.d.ts +8 -9
- package/dist/types/lib/SideNavigation/common/Item/Item.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Item/types.d.ts +19 -8
- package/dist/types/lib/SideNavigation/common/Item/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/ItemButton/ItemButton.d.ts +17 -0
- package/dist/types/lib/SideNavigation/common/ItemButton/ItemButton.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/ItemButton/index.d.ts +3 -0
- package/dist/types/lib/SideNavigation/common/ItemButton/index.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/ItemButton/types.d.ts +17 -0
- package/dist/types/lib/SideNavigation/common/ItemButton/types.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/ItemExpandable/ItemExpandable.d.ts +26 -0
- package/dist/types/lib/SideNavigation/common/ItemExpandable/ItemExpandable.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/ItemExpandable/index.d.ts +3 -0
- package/dist/types/lib/SideNavigation/common/ItemExpandable/index.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/ItemExpandable/types.d.ts +32 -0
- package/dist/types/lib/SideNavigation/common/ItemExpandable/types.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/NavTree/NavTree.d.ts +12 -13
- package/dist/types/lib/SideNavigation/common/NavTree/NavTree.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/NavTree/types.d.ts +7 -5
- package/dist/types/lib/SideNavigation/common/NavTree/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/index.d.ts +5 -0
- package/dist/types/lib/SideNavigation/common/index.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/helpItem.d.ts +20 -0
- package/dist/types/lib/SideNavigation/helpItem.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/index.d.ts +3 -0
- package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/index.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/types.d.ts +14 -0
- package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/types.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.d.ts +14 -0
- package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/index.d.ts +1 -0
- package/dist/types/lib/SideNavigation/index.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/types.d.ts +172 -27
- package/dist/types/lib/SideNavigation/types.d.ts.map +1 -1
- package/dist/types/lib/ViewLayout/types.d.ts +5 -3
- package/dist/types/lib/ViewLayout/types.d.ts.map +1 -1
- package/package.json +20 -20
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ContextualMenuProps } from "@canonical/react-ds-global";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
/** A single entry in the context switcher's list — user-generated. */
|
|
4
|
+
export interface ContextSwitcherItem {
|
|
5
|
+
/** Stable identity for the context (list key and selection matching). */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Display name — also shown in the dropdown field when current. */
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional route for the context. No render target for a
|
|
11
|
+
* `LinkComponent` exists inside a `role="menu"` (every row is a
|
|
12
|
+
* `<div role="menuitem">`), so when given the url rides through
|
|
13
|
+
* `onContextChange` and the consumer routes with their own router.
|
|
14
|
+
* Omitted, the context stays a pure action.
|
|
15
|
+
*/
|
|
16
|
+
url?: string;
|
|
17
|
+
/** Optional supporting text shown under the name in the list. */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Optional badge for dynamic/actionable information. */
|
|
20
|
+
badge?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
type OwnProps = Pick<ContextualMenuProps, "open" | "onOpenChange" | "preferredDirections" | "distance" | "gutter" | "maxWidth" | "autoFit"> & {
|
|
23
|
+
/**
|
|
24
|
+
* A caption rendered above the dropdown field (e.g. "Context") via
|
|
25
|
+
* `SideNavigation.GroupHeader` — intrinsic to the component in the Figma
|
|
26
|
+
* source, not a consumer composition. Omitted renders no caption.
|
|
27
|
+
*/
|
|
28
|
+
title?: ReactNode;
|
|
29
|
+
/** The currently selected context, shown in the dropdown field. */
|
|
30
|
+
currentContext: ContextSwitcherItem;
|
|
31
|
+
/** The user-generated list of available contexts. */
|
|
32
|
+
contexts: ContextSwitcherItem[];
|
|
33
|
+
/** Called when the user selects a different context from the list. */
|
|
34
|
+
onContextChange?: (context: ContextSwitcherItem) => void;
|
|
35
|
+
/** Called when the "create context" action is activated. Omit to hide it. */
|
|
36
|
+
onCreateContext?: () => void;
|
|
37
|
+
/** Label for the "create context" action. Defaults to `"Create context"`. */
|
|
38
|
+
createContextLabel?: ReactNode;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Renders via `ContextualMenu` — a real `<button>` trigger with
|
|
42
|
+
* `aria-haspopup="menu"`/`aria-expanded`, and a `role="menu"` popup with
|
|
43
|
+
* full roving-focus keyboard navigation — a "select"-like widget, not a
|
|
44
|
+
* bare disclosure. Extends `<div>` — the component's own wrapper, which
|
|
45
|
+
* carries the caption (`title`) and the dropdown field. `onSelect` — a
|
|
46
|
+
* native `<div>` text-selection event — is excluded: it would collide with
|
|
47
|
+
* this component's own item-selection callback (`onContextChange`) under
|
|
48
|
+
* one name with two incompatible signatures.
|
|
49
|
+
*/
|
|
50
|
+
export type ContextSwitcherProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps | "onSelect">;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ContextSwitcher/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,sEAAsE;AACtE,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,KAAK,QAAQ,GAAG,IAAI,CAClB,mBAAmB,EACjB,MAAM,GACN,cAAc,GACd,qBAAqB,GACrB,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,CACZ,GAAG;IACF;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mEAAmE;IACnE,cAAc,EAAE,mBAAmB,CAAC;IACpC,qDAAqD;IACrD,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,sEAAsE;IACtE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACzD,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,SAAS,CAAC;CAChC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GACzC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC"}
|
|
@@ -2,12 +2,16 @@ import type React from "react";
|
|
|
2
2
|
import type { FooterProps } from "./types.js";
|
|
3
3
|
import "./styles.css";
|
|
4
4
|
/**
|
|
5
|
-
* SideNavigation.Footer — optional region pinned to the bottom,
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* SideNavigation.Footer — optional region pinned to the bottom, reserved
|
|
6
|
+
* for user-related content. Data-only: `root` is the footer's only data
|
|
7
|
+
* surface — free-form leaves (`LeafFooterItem`, buttons via
|
|
8
|
+
* `control`/`onClick`) and depth-1 expandables (`ExpandableFooterItem`,
|
|
9
|
+
* whose children disclose through the same native `<details>` disclosure
|
|
10
|
+
* the content tree uses). A certificate-user application, for instance,
|
|
11
|
+
* composes the `certificate` icon and omits the logout item itself.
|
|
8
12
|
*
|
|
9
13
|
* @implements ds:apps.subcomponent.side-navigation-footer
|
|
10
14
|
*/
|
|
11
|
-
declare const Footer: ({ className, root, LinkComponent, currentUrl,
|
|
15
|
+
declare const Footer: ({ className, root, LinkComponent, currentUrl, ...props }: FooterProps) => React.ReactElement;
|
|
12
16
|
export default Footer;
|
|
13
17
|
//# sourceMappingURL=Footer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,cAAc,CAAC;AA6DtB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,GAAI,0DAMb,WAAW,KAAG,KAAK,CAAC,YAwCtB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
root?: NavItem;
|
|
1
|
+
import type { ComponentProps, ComponentType } from "react";
|
|
2
|
+
import type { FooterRoot, LinkComponentProps } from "../../types.js";
|
|
3
|
+
type OwnProps = {
|
|
4
|
+
/** The footer's items — the footer's only data surface. See FooterRoot. */
|
|
5
|
+
root?: FooterRoot;
|
|
7
6
|
/** Component used to render navigable items. Defaults to `"a"`. */
|
|
8
7
|
LinkComponent?: ComponentType<LinkComponentProps> | "a";
|
|
9
|
-
/** Live current location; resolves
|
|
8
|
+
/** Live current location; resolves the active row and seeds expandables. */
|
|
10
9
|
currentUrl?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
10
|
+
};
|
|
11
|
+
export type FooterProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
|
|
12
|
+
export {};
|
|
14
13
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAErE,KAAK,QAAQ,GAAG;IACd,2EAA2E;IAC3E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAChC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { GroupProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* SideNavigation.Group — a named collection of navigation entries, with an
|
|
6
|
+
* optional SideNavigation.GroupHeader. One of NavTree's direct content
|
|
7
|
+
* entries.
|
|
8
|
+
*
|
|
9
|
+
* @implements ds:apps.subcomponent.side-navigation-group
|
|
10
|
+
*/
|
|
11
|
+
declare const Group: ({ label, children, className, ...props }: GroupProps) => React.ReactElement;
|
|
12
|
+
export default Group;
|
|
13
|
+
//# sourceMappingURL=Group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Group/Group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,cAAc,CAAC;AAItB;;;;;;GAMG;AACH,QAAA,MAAM,KAAK,GAAI,0CAKZ,UAAU,KAAG,KAAK,CAAC,YAQrB,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
type OwnProps = {
|
|
3
|
+
/** Group header text, rendered via GroupHeader. Omitted when absent. */
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
/** The group's navigation entries (Item / ItemExpandable / consumer-supplied). */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type GroupProps = OwnProps & Omit<ComponentProps<"section">, keyof OwnProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Group/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,QAAQ,GAAG;IACd,wEAAwE;IACxE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,QAAQ,GAC/B,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { GroupHeaderProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* SideNavigation.GroupHeader — the optional label above a
|
|
6
|
+
* SideNavigation.Group's entries. Purely presentational; rendered by Group
|
|
7
|
+
* when its `label` is set.
|
|
8
|
+
*
|
|
9
|
+
* @implements ds:apps.subcomponent.side-navigation-group-header
|
|
10
|
+
*/
|
|
11
|
+
declare const GroupHeader: ({ children, className, ...props }: GroupHeaderProps) => React.ReactElement;
|
|
12
|
+
export default GroupHeader;
|
|
13
|
+
//# sourceMappingURL=GroupHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupHeader.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/GroupHeader/GroupHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,cAAc,CAAC;AAItB;;;;;;GAMG;AACH,QAAA,MAAM,WAAW,GAAI,mCAIlB,gBAAgB,KAAG,KAAK,CAAC,YAW3B,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/GroupHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
type OwnProps = {
|
|
3
|
+
/** Header text. */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export type GroupHeaderProps = OwnProps & Omit<ComponentProps<"span">, keyof OwnProps>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/GroupHeader/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,QAAQ,GAAG;IACd,mBAAmB;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GACrC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
|
|
@@ -4,7 +4,9 @@ import "./styles.css";
|
|
|
4
4
|
/**
|
|
5
5
|
* SideNavigation.Header — top region holding the brand (the `brand` node, at the
|
|
6
6
|
* start) and the collapse toggle (at the end). The toggle is omitted when no
|
|
7
|
-
* `onToggle` handler is provided.
|
|
7
|
+
* `onToggle` handler is provided. Collapsed: the layout
|
|
8
|
+
* switches to a centred column — the toggle relocates below the logo rather
|
|
9
|
+
* than beside it — driven by `data-expanded` on the root.
|
|
8
10
|
*
|
|
9
11
|
* @implements ds:apps.subcomponent.side-navigation-header
|
|
10
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Header/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,cAAc,CAAC;AAItB
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Header/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,cAAc,CAAC;AAItB;;;;;;;;GAQG;AACH,QAAA,MAAM,MAAM,GAAI,uFAQb,WAAW,KAAG,KAAK,CAAC,YAyBtB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
type OwnProps = {
|
|
3
3
|
/** Brand content (logo mark) rendered at the start of the header. */
|
|
4
4
|
brand?: ReactNode;
|
|
5
5
|
/** Optional application name/wordmark shown beside the brand. Omitted when absent. */
|
|
@@ -10,5 +10,7 @@ export interface HeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
onToggle?: () => void;
|
|
11
11
|
/** id of the navigation region the collapse toggle controls (`aria-controls`). */
|
|
12
12
|
collapseControls?: string;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
export type HeaderProps = OwnProps & Omit<ComponentProps<"header">, keyof OwnProps>;
|
|
15
|
+
export {};
|
|
14
16
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Header/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Header/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,QAAQ,GAAG;IACd,qEAAqE;IACrE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sFAAsF;IACtF,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAKF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAChC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
|
|
@@ -4,18 +4,17 @@ import "./styles.css";
|
|
|
4
4
|
/**
|
|
5
5
|
* SideNavigation.Item — the default renderer for a single navigation item.
|
|
6
6
|
*
|
|
7
|
-
* A flat leaf row, NOT recursive
|
|
8
|
-
*
|
|
7
|
+
* A flat leaf row, NOT recursive — an entry with children is a
|
|
8
|
+
* SideNavigation.ItemExpandable instead. The row is
|
|
9
|
+
* `[icon] [content] [end]` over a shared grid template (so the icon aligns
|
|
9
10
|
* with the header logo). An item with a `url` renders as a link via
|
|
10
|
-
* `LinkComponent` (default `"a"`); otherwise a non-navigable label.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* behaviour is deferred);
|
|
15
|
-
* - leaf → the optional `slot` (a badge, count, …), or nothing.
|
|
11
|
+
* `LinkComponent` (default `"a"`); otherwise a non-navigable label. The end
|
|
12
|
+
* slot is the optional `slot` (a badge, count, …), or nothing. Content is
|
|
13
|
+
* composed via `children`, matching `Button`'s own convention — pass
|
|
14
|
+
* anything, not only text.
|
|
16
15
|
*
|
|
17
16
|
* @implements ds:apps.subcomponent.side-navigation-item
|
|
18
17
|
*/
|
|
19
|
-
declare const Item: ({ url,
|
|
18
|
+
declare const Item: ({ url, children, icon, slot, disabled, active, LinkComponent, className, ...props }: ItemProps) => React.ReactElement;
|
|
20
19
|
export default Item;
|
|
21
20
|
//# sourceMappingURL=Item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Item/Item.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAItB
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Item/Item.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,IAAI,GAAI,qFAUX,SAAS,KAAG,KAAK,CAAC,YA6CpB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
import type { ComponentType } from "react";
|
|
2
|
-
import type {
|
|
1
|
+
import type { ComponentProps, ComponentType, ReactNode } from "react";
|
|
2
|
+
import type { LeafNavItem, LinkComponentProps } from "../../types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Props for the default SideNavigation item renderer — a flat leaf row.
|
|
5
5
|
*
|
|
6
|
-
* Spreads the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Spreads the LeafNavItem fields directly (url, disabled, icon, slot, …)
|
|
7
|
+
* plus presentational extras. `key` is omitted with `label`: the authored
|
|
8
|
+
* identity is consumed by the data-driven path (`NavTree` — `getItemId`)
|
|
9
|
+
* and applied as the element key; it never reaches `Item`'s props. Content
|
|
10
|
+
* is composed via `children`
|
|
11
|
+
* (matching every other DS control, e.g. `Button`) rather than a `label`
|
|
12
|
+
* string prop — the data-driven path (`NavTree`, from a `root` tree, whose
|
|
13
|
+
* authored `LeafNavItem.label` stays a plain string) passes its `label` in
|
|
14
|
+
* as `children` rather than as a same-named prop. Always a leaf: an entry
|
|
15
|
+
* with children is a SideNavigation.ItemExpandable instead —
|
|
16
|
+
* Item never shows a disclosure caret.
|
|
10
17
|
*/
|
|
11
|
-
|
|
18
|
+
type OwnProps = Omit<LeafNavItem, "label" | "key"> & {
|
|
19
|
+
/** Item content — composed, not a string prop (matches `Button`'s own `children`-as-label convention). */
|
|
20
|
+
children?: ReactNode;
|
|
12
21
|
/** Whether this item is the active (current) page. */
|
|
13
22
|
active?: boolean;
|
|
14
23
|
/** Component used to render navigable items. Defaults to `"a"`. */
|
|
15
24
|
LinkComponent?: ComponentType<LinkComponentProps> | "a";
|
|
16
|
-
}
|
|
25
|
+
};
|
|
26
|
+
export type ItemProps = OwnProps & Omit<ComponentProps<"li">, keyof OwnProps>;
|
|
27
|
+
export {};
|
|
17
28
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,KAAK,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,KAAK,CAAC,GAAG;IACnD,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { ItemButtonProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* SideNavigation.ItemButton — a navigation row that performs an action
|
|
6
|
+
* instead of navigating (e.g. "Log out", "Create context"). Buttons are a
|
|
7
|
+
* Footer-only row kind: the content tree accepts links and plain labels,
|
|
8
|
+
* so an `ItemButton` belongs in a `SideNavigation.Footer` — rendered from
|
|
9
|
+
* a `control: "button"` footer item or composed via the Footer's
|
|
10
|
+
* `children`. Content is composed via `children`,
|
|
11
|
+
* matching `Button`'s own convention.
|
|
12
|
+
*
|
|
13
|
+
* @implements ds:apps.subcomponent.side-navigation-item-button
|
|
14
|
+
*/
|
|
15
|
+
declare const ItemButton: ({ children, icon, slot, className, ...props }: ItemButtonProps) => React.ReactElement;
|
|
16
|
+
export default ItemButton;
|
|
17
|
+
//# sourceMappingURL=ItemButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemButton.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ItemButton/ItemButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,UAAU,GAAI,+CAMjB,eAAe,KAAG,KAAK,CAAC,YAkB1B,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ItemButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxD,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IconName } from "@canonical/ds-assets";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
type OwnProps = {
|
|
4
|
+
/** Content, composed via children (matches `Button`'s own convention). */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** Leading icon (start slot), by ds-assets icon name. */
|
|
7
|
+
icon?: IconName;
|
|
8
|
+
/** Trailing content (end slot): a badge, count, etc. */
|
|
9
|
+
slot?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* `type` is excluded in addition to `OwnProps`: this is always a plain
|
|
13
|
+
* action trigger, never a form submit/reset control.
|
|
14
|
+
*/
|
|
15
|
+
export type ItemButtonProps = OwnProps & Omit<ComponentProps<"button">, keyof OwnProps | "type">;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ItemButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,QAAQ,GAAG;IACd,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,yDAAyD;IACzD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,wDAAwD;IACxD,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GACpC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { ItemExpandableProps } from "./types.js";
|
|
3
|
+
import "./styles.css";
|
|
4
|
+
/**
|
|
5
|
+
* SideNavigation.ItemExpandable — a collapsible row that discloses its own
|
|
6
|
+
* (always-leaf) children instead of navigating. Native
|
|
7
|
+
* `<details>`/`<summary>` — no `role`/`aria-expanded` authored, per
|
|
8
|
+
* `cs:ui_blocks.nojs.disclosure`; the element owns its own open state.
|
|
9
|
+
* `heading` and `children` are composed, not string props — matching
|
|
10
|
+
* `Accordion.Item`'s own split.
|
|
11
|
+
*
|
|
12
|
+
* `defaultExpanded` seeds the initial state (NavTree supplies it from the
|
|
13
|
+
* tree's own state: whether this node's branch is the selected one) and is
|
|
14
|
+
* live in one direction only: when it turns `true` on navigation the
|
|
15
|
+
* disclosure re-opens — a manual collapse stays collapsed and the
|
|
16
|
+
* disclosure never auto-closes.
|
|
17
|
+
*
|
|
18
|
+
* `collapseOnChildClick` is the Footer's opt-in: activating a leaf row
|
|
19
|
+
* among the `children` collapses the disclosure. The content tree does not
|
|
20
|
+
* opt in: its branch stays open so the active row remains visible.
|
|
21
|
+
*
|
|
22
|
+
* @implements ds:apps.subcomponent.side-navigation-item-expandable
|
|
23
|
+
*/
|
|
24
|
+
declare const ItemExpandable: ({ heading, icon, disabled, defaultExpanded, collapseOnChildClick, children, className, ...props }: ItemExpandableProps) => React.ReactElement;
|
|
25
|
+
export default ItemExpandable;
|
|
26
|
+
//# sourceMappingURL=ItemExpandable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemExpandable.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ItemExpandable/ItemExpandable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,cAAc,GAAI,mGASrB,mBAAmB,KAAG,KAAK,CAAC,YAqG9B,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ItemExpandable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IconName } from "@canonical/ds-assets";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
type OwnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The row's label in the `<summary>` — composed, not a string prop,
|
|
6
|
+
* matching `Accordion.Item`'s `heading`/`children` split.
|
|
7
|
+
*/
|
|
8
|
+
heading?: ReactNode;
|
|
9
|
+
/** Leading icon (start slot), by ds-assets icon name. */
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
/** Whether the item (and its disclosure) is interactive. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Initial open state when uncontrolled. Defaults to `false`. Seed from
|
|
15
|
+
* whether the active item is among this item's children so the
|
|
16
|
+
* current page's ancestor chain starts expanded.
|
|
17
|
+
*/
|
|
18
|
+
defaultExpanded?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether activating a child link or button collapses the disclosure —
|
|
21
|
+
* Footer behaviour (a footer row is chosen with it, like a menu choice
|
|
22
|
+
* dismissing its menu). The content tree does not opt in; its branch
|
|
23
|
+
* stays open so the active row remains visible.
|
|
24
|
+
* Defaults to `false`.
|
|
25
|
+
*/
|
|
26
|
+
collapseOnChildClick?: boolean;
|
|
27
|
+
/** The disclosed children — typically a list of SideNavigation.Item. */
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
};
|
|
30
|
+
export type ItemExpandableProps = OwnProps & Omit<ComponentProps<"li">, keyof OwnProps>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ItemExpandable/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,QAAQ,GAAG;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,yDAAyD;IACzD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GACxC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
|
|
@@ -2,19 +2,18 @@ import type React from "react";
|
|
|
2
2
|
import type { NavTreeProps } from "./types.js";
|
|
3
3
|
import "./styles.css";
|
|
4
4
|
/**
|
|
5
|
-
* Internal: renders
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* in sync with the consumer's router.
|
|
5
|
+
* Internal: renders the content tree with two explicit loops (no recursion)
|
|
6
|
+
* — loop 1 over root's `Group` children, loop 2 over a group's entries
|
|
7
|
+
* (leaf rows via `renderEntry`, or `ItemExpandable` for entries with
|
|
8
|
+
* `items`, whose always-leaf children render through the same
|
|
9
|
+
* `renderEntry`). Active/expanded state derives from `useNavigationTree`,
|
|
10
|
+
* generic over `_AnyNavNode` so every field stays typed on annotated nodes
|
|
11
|
+
* regardless of tier. `currentUrl` seeds initial
|
|
12
|
+
* selection and re-syncs it on navigation (the hook's `initialUrl` is
|
|
13
|
+
* mount-only), keeping the active item — and its `ItemExpandable`
|
|
14
|
+
* ancestors' open state (`inSelectedBranch`) — in sync with the consumer's
|
|
15
|
+
* router.
|
|
17
16
|
*/
|
|
18
|
-
declare const NavTree: ({ root, currentUrl, LinkComponent, }: NavTreeProps) => React.ReactElement;
|
|
17
|
+
declare const NavTree: ({ root, currentUrl, LinkComponent, className, ...props }: NavTreeProps) => React.ReactElement;
|
|
19
18
|
export default NavTree;
|
|
20
19
|
//# sourceMappingURL=NavTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavTree.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/NavTree/NavTree.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavTree.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/NavTree/NavTree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,cAAc,CAAC;AAoDtB;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,OAAO,GAAI,0DAMd,YAAY,KAAG,KAAK,CAAC,YAuFvB,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type { ComponentType } from "react";
|
|
2
|
-
import type { LinkComponentProps,
|
|
3
|
-
|
|
1
|
+
import type { ComponentProps, ComponentType } from "react";
|
|
2
|
+
import type { LinkComponentProps, NavRoot } from "../../types.js";
|
|
3
|
+
type OwnProps = {
|
|
4
4
|
/** Root NavItem whose direct children (level-1 groups) are rendered. */
|
|
5
|
-
root:
|
|
5
|
+
root: NavRoot;
|
|
6
6
|
/** Live current location; resolves and keeps the active item in sync. */
|
|
7
7
|
currentUrl?: string;
|
|
8
8
|
/** Component used to render navigable items. Defaults to `"a"`. */
|
|
9
9
|
LinkComponent?: ComponentType<LinkComponentProps> | "a";
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
export type NavTreeProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
|
|
12
|
+
export {};
|
|
11
13
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/NavTree/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/NavTree/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAElE,KAAK,QAAQ,GAAG;IACd,wEAAwE;IACxE,IAAI,EAAE,OAAO,CAAC;IACd,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,QAAQ,GACjC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export * from "./CollapseToggle/index.js";
|
|
2
2
|
export * from "./Content/index.js";
|
|
3
|
+
export * from "./ContextSwitcher/index.js";
|
|
3
4
|
export * from "./Footer/index.js";
|
|
5
|
+
export * from "./Group/index.js";
|
|
6
|
+
export * from "./GroupHeader/index.js";
|
|
4
7
|
export * from "./Header/index.js";
|
|
5
8
|
export * from "./Item/index.js";
|
|
9
|
+
export * from "./ItemButton/index.js";
|
|
10
|
+
export * from "./ItemExpandable/index.js";
|
|
6
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/SideNavigation/common/index.ts"],"names":[],"mappings":"AAEA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/SideNavigation/common/index.ts"],"names":[],"mappings":"AAEA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExpandableNavItem } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the content's one mandatory item: a collapsible "Help" item
|
|
4
|
+
* containing at least one external link to legal information.
|
|
5
|
+
*
|
|
6
|
+
* A thin data-construction helper, not a component — the mandatory item is
|
|
7
|
+
* an ordinary `ExpandableNavItem`; this removes the
|
|
8
|
+
* chance of authoring it slightly wrong every time a consumer wires it
|
|
9
|
+
* into their `root`.
|
|
10
|
+
*
|
|
11
|
+
* @param legalUrl The external URL to legal information.
|
|
12
|
+
* @param options.legalLabel Label for the legal link. Defaults to `"Legal information"`.
|
|
13
|
+
* @param options.additionalItems Further leaf items under "Help", after the
|
|
14
|
+
* legal link (e.g. a documentation or support link).
|
|
15
|
+
*/
|
|
16
|
+
export declare const createHelpItem: (legalUrl: string, options?: {
|
|
17
|
+
legalLabel?: string;
|
|
18
|
+
additionalItems?: ExpandableNavItem["items"];
|
|
19
|
+
}) => ExpandableNavItem;
|
|
20
|
+
//# sourceMappingURL=helpItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpItem.d.ts","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/helpItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,EAChB,UAAS;IACP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACzC,KACL,iBAaD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/hooks/useCollapseShortcut/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface UseCollapseShortcutProps {
|
|
2
|
+
/**
|
|
3
|
+
* The condition that activates the shortcut's listener — named for the
|
|
4
|
+
* state it represents, not a bare on/off switch. Defaults to `false`;
|
|
5
|
+
* `SideNavigation` passes its own `keyboardShortcut` prop (default
|
|
6
|
+
* `true`).
|
|
7
|
+
*/
|
|
8
|
+
condition?: boolean;
|
|
9
|
+
/** Called when the shortcut is triggered. */
|
|
10
|
+
onTrigger: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** The hook attaches a window listener as a side effect; it returns nothing. */
|
|
13
|
+
export type UseCollapseShortcutResult = undefined;
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/hooks/useCollapseShortcut/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,gFAAgF;AAChF,MAAM,MAAM,yBAAyB,GAAG,SAAS,CAAC"}
|