@canonical/react-ds-app 0.44.1 → 0.47.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/dist/esm/lib/SideNavigation/SideNavigation.js +7 -22
- package/dist/esm/lib/SideNavigation/SideNavigation.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js +15 -3
- package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/CollapseToggle/constants.js +10 -0
- package/dist/esm/lib/SideNavigation/common/CollapseToggle/constants.js.map +1 -0
- package/dist/esm/lib/SideNavigation/common/CollapseToggle/styles.css +1 -2
- package/dist/esm/lib/SideNavigation/common/Content/Content.js +1 -1
- package/dist/esm/lib/SideNavigation/common/Content/Content.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/Content/styles.css +1 -1
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.js +3 -3
- package/dist/esm/lib/SideNavigation/common/ContextSwitcher/styles.css +1 -1
- package/dist/esm/lib/SideNavigation/common/Footer/Footer.js +26 -24
- package/dist/esm/lib/SideNavigation/common/Footer/Footer.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/Footer/styles.css +16 -4
- package/dist/esm/lib/SideNavigation/common/Header/Header.js +2 -2
- package/dist/esm/lib/SideNavigation/common/Header/Header.js.map +1 -1
- package/dist/esm/lib/SideNavigation/common/ItemExpandable/styles.css +70 -1
- package/dist/esm/lib/SideNavigation/constants.js +8 -0
- package/dist/esm/lib/SideNavigation/constants.js.map +1 -0
- package/dist/esm/lib/SideNavigation/helpItem.js +2 -1
- package/dist/esm/lib/SideNavigation/helpItem.js.map +1 -1
- package/dist/esm/lib/SideNavigation/styles.css +35 -143
- package/dist/esm/lib/SidePanel/Provider.js +9 -3
- package/dist/esm/lib/SidePanel/Provider.js.map +1 -1
- package/dist/esm/lib/SidePanel/common/Content/Content.js +41 -3
- package/dist/esm/lib/SidePanel/common/Content/Content.js.map +1 -1
- package/dist/esm/lib/SidePanel/common/Content/styles.css +85 -0
- package/dist/esm/lib/SidePanel/common/Footer/styles.css +2 -13
- package/dist/esm/lib/SidePanel/common/Header/styles.css +1 -3
- package/dist/esm/lib/SidePanel/styles.css +9 -3
- package/dist/types/lib/SideNavigation/SideNavigation.d.ts +4 -4
- package/dist/types/lib/SideNavigation/SideNavigation.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts +1 -1
- package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/CollapseToggle/constants.d.ts +4 -0
- package/dist/types/lib/SideNavigation/common/CollapseToggle/constants.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts +20 -0
- package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Content/types.d.ts +1 -1
- package/dist/types/lib/SideNavigation/common/Content/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.d.ts +3 -3
- package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Header/Header.d.ts +1 -1
- package/dist/types/lib/SideNavigation/common/Header/Header.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/common/Header/types.d.ts +3 -0
- package/dist/types/lib/SideNavigation/common/Header/types.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/constants.d.ts +4 -0
- package/dist/types/lib/SideNavigation/constants.d.ts.map +1 -0
- package/dist/types/lib/SideNavigation/helpItem.d.ts +2 -0
- package/dist/types/lib/SideNavigation/helpItem.d.ts.map +1 -1
- package/dist/types/lib/SideNavigation/types.d.ts +17 -0
- package/dist/types/lib/SideNavigation/types.d.ts.map +1 -1
- package/dist/types/lib/SidePanel/Provider.d.ts.map +1 -1
- package/dist/types/lib/SidePanel/common/Content/Content.d.ts +1 -1
- package/dist/types/lib/SidePanel/common/Content/Content.d.ts.map +1 -1
- package/package.json +18 -18
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useId, useState } from "react";
|
|
3
3
|
import { Content, ContextSwitcher, Footer, Header } from "./common/index.js";
|
|
4
|
+
import { DEFAULT_MESSAGES } from "./constants.js";
|
|
4
5
|
import { useCollapseShortcut } from "./hooks/useCollapseShortcut/index.js";
|
|
5
6
|
import "./styles.css";
|
|
6
7
|
const componentCssClassName = "ds side-navigation";
|
|
@@ -11,9 +12,9 @@ const componentCssClassName = "ds side-navigation";
|
|
|
11
12
|
* region it controls.
|
|
12
13
|
*
|
|
13
14
|
* Four regions: Header (branding, collapse toggle), the optional
|
|
14
|
-
* ContextSwitcher
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* ContextSwitcher (a `role="menu"` select-like widget — not navigation,
|
|
16
|
+
* so it sits outside the landmark between Header and Content; hidden
|
|
17
|
+
* when collapsed, where labels are unviable),
|
|
17
18
|
* Content (the main `<nav>` landmark) and Footer (user profile, settings
|
|
18
19
|
* and non-navigational actions). The root element is a plain `<div>` and
|
|
19
20
|
* the component's single *navigation* landmark is Content's `<nav>`, so
|
|
@@ -37,13 +38,9 @@ const componentCssClassName = "ds side-navigation";
|
|
|
37
38
|
*
|
|
38
39
|
* @implements ds:apps.pattern.side-navigation
|
|
39
40
|
*/
|
|
40
|
-
const SideNavigation = ({ className, brand, applicationName, root, contextSwitcher, footerRoot, LinkComponent = "a", currentUrl, skipTo = "#main-content",
|
|
41
|
-
// Controlled circuit — not official yet.
|
|
42
|
-
// expanded: expandedProp,
|
|
43
|
-
defaultExpanded: defaultExpandedProp,
|
|
44
|
-
// onExpandedChange,
|
|
45
|
-
keyboardShortcut = true, "aria-label": ariaLabel, ...props }) => {
|
|
41
|
+
const SideNavigation = ({ className, brand, applicationName, root, contextSwitcher, footerRoot, LinkComponent = "a", currentUrl, skipTo = "#main-content", defaultExpanded: defaultExpandedProp, keyboardShortcut = true, "aria-label": ariaLabel, messages: messagesProp, ...props }) => {
|
|
46
42
|
const contentId = useId();
|
|
43
|
+
const messages = { ...DEFAULT_MESSAGES, ...messagesProp };
|
|
47
44
|
const [expanded, setExpanded] = useState(defaultExpandedProp ?? true);
|
|
48
45
|
// Mobile seed: below the small breakpoint, the
|
|
49
46
|
// expanded state renders as a fullscreen fixed overlay — a takeover, not a
|
|
@@ -64,19 +61,7 @@ keyboardShortcut = true, "aria-label": ariaLabel, ...props }) => {
|
|
|
64
61
|
// Ctrl+B rail-collapse shortcut — on unless
|
|
65
62
|
// `keyboardShortcut` opts out. See hooks/useCollapseShortcut.
|
|
66
63
|
useCollapseShortcut({ condition: keyboardShortcut, onTrigger: handleToggle });
|
|
67
|
-
|
|
68
|
-
// const [uncontrolledExpanded, setUncontrolledExpanded] =
|
|
69
|
-
// useState(defaultExpanded);
|
|
70
|
-
// const isControlled = expandedProp !== undefined;
|
|
71
|
-
// const expanded = isControlled ? expandedProp : uncontrolledExpanded;
|
|
72
|
-
//
|
|
73
|
-
// const handleToggle = useCallback(() => {
|
|
74
|
-
// const next = !expanded;
|
|
75
|
-
// if (!isControlled) setUncontrolledExpanded(next);
|
|
76
|
-
// onExpandedChange?.(next);
|
|
77
|
-
// }, [expanded, isControlled, onExpandedChange]);
|
|
78
|
-
// -------------------------------------------------------------------------
|
|
79
|
-
return (_jsxs("div", { className: [componentCssClassName, className].filter(Boolean).join(" "), "data-expanded": expanded, ...props, children: [_jsx("a", { className: "skip-link", href: skipTo, children: "Skip to main content" }), _jsx(Header, { brand: brand, applicationName: applicationName, expanded: expanded, onToggle: handleToggle, collapseControls: contentId }), contextSwitcher ? (_jsx("div", { className: "ds side-navigation-context-switcher-region", children: _jsx(ContextSwitcher, { ...contextSwitcher }) })) : null, _jsx(Content, { id: contentId, root: root, LinkComponent: LinkComponent, currentUrl: currentUrl, "aria-label": ariaLabel ?? "Main navigation" }), footerRoot ? (_jsx(Footer, { root: footerRoot, LinkComponent: LinkComponent, currentUrl: currentUrl })) : null] }));
|
|
64
|
+
return (_jsxs("div", { className: [componentCssClassName, className].filter(Boolean).join(" "), "data-expanded": expanded, ...props, children: [_jsx("a", { className: "skip-link", href: skipTo, children: messages.skipToContent() }), _jsx(Header, { brand: brand, applicationName: applicationName, expanded: expanded, onToggle: handleToggle, collapseControls: contentId, collapseToggleMessages: messages }), contextSwitcher ? (_jsx(ContextSwitcher, { ...contextSwitcher })) : null, _jsx(Content, { id: contentId, root: root, LinkComponent: LinkComponent, currentUrl: currentUrl, "aria-label": ariaLabel ?? messages.navigation() }), footerRoot ? (_jsx(Footer, { root: footerRoot, LinkComponent: LinkComponent, currentUrl: currentUrl })) : null] }));
|
|
80
65
|
};
|
|
81
66
|
export default SideNavigation;
|
|
82
67
|
//# sourceMappingURL=SideNavigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNavigation.js","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/SideNavigation.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,cAAc,GAAG,CAAC,EACtB,SAAS,EACT,KAAK,EACL,eAAe,EACf,IAAI,EACJ,eAAe,EACf,UAAU,EACV,aAAa,GAAG,GAAG,EACnB,UAAU,EACV,MAAM,GAAG,eAA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C;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Icon, TooltipEngine } from "@canonical/react-ds-global";
|
|
3
|
+
import { DEFAULT_MESSAGES } from "./constants.js";
|
|
3
4
|
import "./styles.css";
|
|
4
5
|
const componentCssClassName = "ds collapse-toggle";
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
// 1s hover before the tooltip shows (design-ratified value pending final
|
|
7
|
+
// confirmation with design).
|
|
8
|
+
const TOOLTIP_ACTIVATE_DELAY_MS = 1000;
|
|
9
|
+
// The bare trigger render — the module-level constant TooltipEngine wraps,
|
|
10
|
+
// stable so the element type never changes across expanded state (remounts
|
|
11
|
+
// would lose focus/hover mid-toggle).
|
|
12
|
+
const CollapseToggleTrigger = ({ className, expanded = true, messages: messagesProp, "aria-label": ariaLabel, ...props }) => {
|
|
13
|
+
const messages = { ...DEFAULT_MESSAGES, ...messagesProp };
|
|
14
|
+
return (_jsxs("button", { className: [componentCssClassName, className].filter(Boolean).join(" "), "aria-expanded": expanded, "aria-label": ariaLabel ??
|
|
15
|
+
(expanded ? messages.collapseNavigation() : messages.expandNavigation()), ...props, type: "button", children: [_jsx(Icon, { icon: expanded ? "collapse-side-nav" : "expand-side-nav" }), _jsx("span", { children: expanded ? messages.closeMenu() : messages.openMenu() })] }));
|
|
7
16
|
};
|
|
8
17
|
/**
|
|
9
18
|
* SideNavigation.CollapseToggle — icon-only button that expands or collapses
|
|
@@ -20,6 +29,9 @@ const CollapseToggleButton = ({ className, expanded = true, "aria-label": ariaLa
|
|
|
20
29
|
*
|
|
21
30
|
* @implements ds:apps.subcomponent.side-navigation-collapse-toggle
|
|
22
31
|
*/
|
|
23
|
-
const CollapseToggle = ({ expanded = true, ...props }) =>
|
|
32
|
+
const CollapseToggle = ({ expanded = true, messages, ...props }) => {
|
|
33
|
+
const { collapse, expand } = { ...DEFAULT_MESSAGES, ...messages };
|
|
34
|
+
return (_jsx(TooltipEngine, { Message: expanded ? collapse() : expand(), activateDelay: TOOLTIP_ACTIVATE_DELAY_MS, children: _jsx(CollapseToggleTrigger, { expanded: expanded, messages: messages, ...props }) }));
|
|
35
|
+
};
|
|
24
36
|
export default CollapseToggle;
|
|
25
37
|
//# sourceMappingURL=CollapseToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapseToggle.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/CollapseToggle/CollapseToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"CollapseToggle.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/CollapseToggle/CollapseToggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEnD,yEAAyE;AACzE,6BAA6B;AAC7B,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAEvC,2EAA2E;AAC3E,2EAA2E;AAC3E,sCAAsC;AACtC,MAAM,qBAAqB,GAAG,CAAC,EAC7B,SAAS,EACT,QAAQ,GAAG,IAAI,EACf,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACY,EAAsB,EAAE;IAC5C,MAAM,QAAQ,GAAG,EAAE,GAAG,gBAAgB,EAAE,GAAG,YAAY,EAAE,CAAC;IAE1D,OAAO,CACL,kBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,mBACxD,QAAQ,gBAErB,SAAS;YACT,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAEtE,KAAK,EACT,IAAI,EAAC,QAAQ,aAMb,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,GAAI,EAClE,yBAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAQ,IAC7D,CACV,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,cAAc,GAAG,CAAC,EACtB,QAAQ,GAAG,IAAI,EACf,QAAQ,EACR,GAAG,KAAK,EACY,EAAsB,EAAE;IAC5C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,gBAAgB,EAAE,GAAG,QAAQ,EAAE,CAAC;IAElE,OAAO,CACL,KAAC,aAAa,IACZ,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,EACzC,aAAa,EAAE,yBAAyB,YAExC,KAAC,qBAAqB,IACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,KACd,KAAK,GACT,GACY,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The collapse toggle's English text, used for any message not supplied. */
|
|
2
|
+
export const DEFAULT_MESSAGES = {
|
|
3
|
+
collapseNavigation: () => "Collapse navigation",
|
|
4
|
+
expandNavigation: () => "Expand navigation",
|
|
5
|
+
collapse: () => "Collapse",
|
|
6
|
+
expand: () => "Expand",
|
|
7
|
+
openMenu: () => "Menu",
|
|
8
|
+
closeMenu: () => "Close menu",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/CollapseToggle/constants.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,kBAAkB,EAAE,GAAG,EAAE,CAAC,qBAAqB;IAC/C,gBAAgB,EAAE,GAAG,EAAE,CAAC,mBAAmB;IAC3C,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU;IAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ;IACtB,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM;IACtB,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY;CAC9B,CAAC"}
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: center;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
inline-size: calc(var(--dimension-400) + var(--dimension-050));
|
|
9
|
+
inline-size: var(--sidenav-collapse-toggle-inline-size);
|
|
11
10
|
block-size: var(--dimension-400);
|
|
12
11
|
|
|
13
12
|
border: none;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { NavTree } from "../NavTree/index.js";
|
|
3
3
|
import "./styles.css";
|
|
4
|
-
const componentCssClassName = "ds content";
|
|
4
|
+
const componentCssClassName = "ds side-navigation-content";
|
|
5
5
|
/**
|
|
6
6
|
* SideNavigation.Content — the component's main `<nav>` landmark, and the
|
|
7
7
|
* only one: navigation rows are links and expandable items exclusively
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Content/Content.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,
|
|
1
|
+
{"version":3,"file":"Content.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Content/Content.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,OAAO,GAAG,CAAC,EACf,SAAS,EACT,IAAI,EACJ,aAAa,GAAG,GAAG,EACnB,UAAU,EACV,GAAG,KAAK,EACK,EAAsB,EAAE;IACrC,OAAO,CACL,cACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACnE,KAAK,YAER,IAAI,CAAC,CAAC,CAAC,CACN,KAAC,OAAO,IACN,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC,CAAC,CAAC,IAAI,GACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -22,9 +22,9 @@ const ContextItemContent = ({ item, }) => {
|
|
|
22
22
|
* full roving-focus keyboard navigation. `title`, when given, renders via
|
|
23
23
|
* `SideNavigation.GroupHeader` as a sibling above the dropdown field.
|
|
24
24
|
*
|
|
25
|
-
* Not part of the `NavRoot`/`NavGroup` content-tree data model —
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* Not part of the `NavRoot`/`NavGroup` content-tree data model — it
|
|
26
|
+
* embeds via `SideNavigation`'s `contextSwitcher` prop slot, its region
|
|
27
|
+
* class owning the collapsed-rail hide.
|
|
28
28
|
*
|
|
29
29
|
* @implements ds:apps.subcomponent.side-navigation-context-switcher
|
|
30
30
|
*/
|
|
@@ -3,32 +3,34 @@ import { Item } from "../Item/index.js";
|
|
|
3
3
|
import { ItemButton } from "../ItemButton/index.js";
|
|
4
4
|
import { ItemExpandable } from "../ItemExpandable/index.js";
|
|
5
5
|
import "./styles.css";
|
|
6
|
-
const componentCssClassName = "ds footer";
|
|
6
|
+
const componentCssClassName = "ds side-navigation-footer";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* may be a button
|
|
10
|
-
* `
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
* `ItemButton` plus a `slot` — there is no dedicated switch.
|
|
8
|
+
* One footer leaf row, dispatched by kind. The Footer is the one place a
|
|
9
|
+
* navigation row may be a button: a link (`url` set, `control` not
|
|
10
|
+
* `"button"`) renders as `Item`; an action (`control: "button"`, or
|
|
11
|
+
* `onClick` with no `url`) as `ItemButton`; anything else — a label-only
|
|
12
|
+
* row like a logged-in username — as `Item`'s plain label, not an inert
|
|
13
|
+
* `<button>` announced as an action that does nothing. Explicit `control`
|
|
14
|
+
* always wins over the `url`-presence inference, so an action item may
|
|
15
|
+
* carry a `url` yet render as a button. Toggle-style rows compose
|
|
16
|
+
* `ItemButton` plus a `slot` — there is no dedicated toggle component.
|
|
18
17
|
*/
|
|
19
|
-
const
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const FooterRow = ({ item, currentUrl, LinkComponent, }) => {
|
|
19
|
+
// Shared row props — each switch case complements its kind-specific ones.
|
|
20
|
+
const shared = { icon: item.icon, slot: item.slot };
|
|
21
|
+
const kind = item.control === "button" || (!item.url && item.onClick)
|
|
22
|
+
? "action"
|
|
23
|
+
: item.url
|
|
24
|
+
? "link"
|
|
25
|
+
: "label";
|
|
26
|
+
switch (kind) {
|
|
27
|
+
case "link":
|
|
28
|
+
return (_jsx(Item, { ...shared, url: item.url, LinkComponent: LinkComponent, active: item.url === currentUrl, children: item.label }));
|
|
29
|
+
case "action":
|
|
30
|
+
return (_jsx(ItemButton, { ...shared, onClick: item.onClick, children: item.label }));
|
|
31
|
+
default:
|
|
32
|
+
return _jsx(Item, { ...shared, children: item.label });
|
|
27
33
|
}
|
|
28
|
-
if (item.control === "button" || item.onClick) {
|
|
29
|
-
return (_jsx(ItemButton, { icon: item.icon, slot: item.slot, onClick: item.onClick, children: item.label }, item.label));
|
|
30
|
-
}
|
|
31
|
-
return (_jsx(Item, { icon: item.icon, slot: item.slot, children: item.label }, item.label));
|
|
32
34
|
};
|
|
33
35
|
/**
|
|
34
36
|
* SideNavigation.Footer — optional region pinned to the bottom, reserved
|
|
@@ -50,7 +52,7 @@ const Footer = ({ className, root, LinkComponent = "a", currentUrl, ...props })
|
|
|
50
52
|
// label-only child (no `url`) matches an unset `currentUrl`
|
|
51
53
|
// (`undefined === undefined`) and the disclosure seeds open
|
|
52
54
|
// whenever `currentUrl` isn't wired.
|
|
53
|
-
defaultExpanded: entry.items.some((child) => child.url !== undefined && child.url === currentUrl), children: entry.items.map((child) =>
|
|
55
|
+
defaultExpanded: entry.items.some((child) => child.url !== undefined && child.url === currentUrl), children: entry.items.map((child) => (_jsx(FooterRow, { item: child, currentUrl: currentUrl, LinkComponent: LinkComponent }, child.label))) }, entry.label)) : (_jsx(FooterRow, { item: entry, currentUrl: currentUrl, LinkComponent: LinkComponent }, entry.label))) })) : null }));
|
|
54
56
|
};
|
|
55
57
|
export default Footer;
|
|
56
58
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/Footer.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,cAAc,CAAC;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,CAClB,CAAC,CAAC,CAAC,CACF,KAAC,SAAS,IAER,IAAI,EAAE,KAAK,EACX,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,IAHvB,KAAK,CAAC,KAAK,CAIhB,CACH,CACF,GACE,CACN,CAAC,CAAC,CAAC,IAAI,GACD,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/* Generated by @canonical/summon-component:react v0.1.0
|
|
2
2
|
* Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
|
|
3
3
|
@layer ds.components.apps {
|
|
4
|
-
.ds.footer {
|
|
4
|
+
.ds.side-navigation-footer {
|
|
5
5
|
/* 0.5rem of bottom spacing. */
|
|
6
6
|
padding-block-end: var(--dimension-100);
|
|
7
7
|
|
|
8
|
-
/* Flat list reset —
|
|
9
|
-
|
|
10
|
-
directly. */
|
|
8
|
+
/* Flat list reset — rows are always a flat list (leaves and depth-1
|
|
9
|
+
expandables; no groups). */
|
|
11
10
|
& > .list {
|
|
12
11
|
display: flex;
|
|
13
12
|
flex-direction: column;
|
|
@@ -16,4 +15,17 @@
|
|
|
16
15
|
padding: 0;
|
|
17
16
|
}
|
|
18
17
|
}
|
|
18
|
+
|
|
19
|
+
/* Collapsed rail: the Footer stays visible, degrading to icon-only rows.
|
|
20
|
+
Label hover tooltips are a documented follow-up. */
|
|
21
|
+
.ds.side-navigation[data-expanded="false"] > .ds.side-navigation-footer {
|
|
22
|
+
.label,
|
|
23
|
+
.end {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.row {
|
|
28
|
+
grid-template-columns: var(--sidenav-icon-column-inline-size);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
19
31
|
}
|
|
@@ -11,8 +11,8 @@ const componentCssClassName = "ds side-navigation-header";
|
|
|
11
11
|
*
|
|
12
12
|
* @implements ds:apps.subcomponent.side-navigation-header
|
|
13
13
|
*/
|
|
14
|
-
const Header = ({ className, brand, applicationName, expanded, onToggle, collapseControls, ...props }) => {
|
|
15
|
-
return (_jsxs("header", { className: [componentCssClassName, className].filter(Boolean).join(" "), "data-expanded": expanded, ...props, children: [_jsxs("div", { className: "brand-container", children: [_jsx("div", { className: "brand", children: brand }), applicationName != null && (_jsx("h1", { className: "title", children: applicationName }))] }), onToggle && (_jsx(CollapseToggle, { expanded: expanded, "aria-controls": collapseControls, onClick: onToggle }))] }));
|
|
14
|
+
const Header = ({ className, brand, applicationName, expanded, onToggle, collapseControls, collapseToggleMessages, ...props }) => {
|
|
15
|
+
return (_jsxs("header", { className: [componentCssClassName, className].filter(Boolean).join(" "), "data-expanded": expanded, ...props, children: [_jsxs("div", { className: "brand-container", children: [_jsx("div", { className: "brand", children: brand }), applicationName != null && (_jsx("h1", { className: "title", children: applicationName }))] }), onToggle && (_jsx(CollapseToggle, { expanded: expanded, "aria-controls": collapseControls, messages: collapseToggleMessages, onClick: onToggle }))] }));
|
|
16
16
|
};
|
|
17
17
|
export default Header;
|
|
18
18
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Header/Header.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,KAAK,EACL,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,GAAG,KAAK,EACI,EAAsB,EAAE;IACpC,OAAO,CACL,kBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,mBACxD,QAAQ,KACnB,KAAK,aAET,eAAK,SAAS,EAAC,iBAAiB,aAC9B,cAAK,SAAS,EAAC,OAAO,YAAE,KAAK,GAAO,EAInC,eAAe,IAAI,IAAI,IAAI,CAC1B,aAAI,SAAS,EAAC,OAAO,YAAE,eAAe,GAAM,CAC7C,IACG,EACL,QAAQ,IAAI,CACX,KAAC,cAAc,IACb,QAAQ,EAAE,QAAQ,mBACH,gBAAgB,EAC/B,OAAO,EAAE,QAAQ,GACjB,CACH,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Header/Header.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,KAAK,EACL,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,sBAAsB,EACtB,GAAG,KAAK,EACI,EAAsB,EAAE;IACpC,OAAO,CACL,kBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,mBACxD,QAAQ,KACnB,KAAK,aAET,eAAK,SAAS,EAAC,iBAAiB,aAC9B,cAAK,SAAS,EAAC,OAAO,YAAE,KAAK,GAAO,EAInC,eAAe,IAAI,IAAI,IAAI,CAC1B,aAAI,SAAS,EAAC,OAAO,YAAE,eAAe,GAAM,CAC7C,IACG,EACL,QAAQ,IAAI,CACX,KAAC,cAAc,IACb,QAAQ,EAAE,QAAQ,mBACH,gBAAgB,EAC/B,QAAQ,EAAE,sBAAsB,EAChC,OAAO,EAAE,QAAQ,GACjB,CACH,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/* Children — always leaves, indented past the parent's icon column so
|
|
108
|
-
|
|
108
|
+
they read as nested. */
|
|
109
109
|
& > .details > .children {
|
|
110
110
|
display: flex;
|
|
111
111
|
flex-direction: column;
|
|
@@ -118,4 +118,73 @@
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
+
|
|
122
|
+
/* Collapsed rail: sub-items degrade into a floating popover on the
|
|
123
|
+
inline-end; the expanded state keeps its inline disclosure. */
|
|
124
|
+
.ds.side-navigation[data-expanded="false"]
|
|
125
|
+
.ds.side-navigation-item-expandable {
|
|
126
|
+
position: relative;
|
|
127
|
+
|
|
128
|
+
.children {
|
|
129
|
+
position: absolute;
|
|
130
|
+
inset-block-start: 0;
|
|
131
|
+
inset-inline-start: calc(100% + var(--dimension-100));
|
|
132
|
+
z-index: var(--z-index-overlay, 100);
|
|
133
|
+
|
|
134
|
+
display: none;
|
|
135
|
+
inline-size: max-content;
|
|
136
|
+
min-inline-size: calc(var(--sidenav-rail-inline-size) / 2);
|
|
137
|
+
margin: 0;
|
|
138
|
+
|
|
139
|
+
background: var(--color-background-default, #fff);
|
|
140
|
+
border: var(--dimension-stroke-thickness-medium) solid
|
|
141
|
+
var(--color-border-muted);
|
|
142
|
+
border-radius: var(--dimension-radius-small);
|
|
143
|
+
box-shadow: var(--sidenav-popover-shadow);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.details[open] .children {
|
|
147
|
+
display: block;
|
|
148
|
+
|
|
149
|
+
/* Full grid and visible titles inside the panel. */
|
|
150
|
+
.row {
|
|
151
|
+
margin: 0;
|
|
152
|
+
grid-template-columns: var(--sidenav-icon-column-inline-size) 1fr auto;
|
|
153
|
+
padding-inline: var(--sidenav-inset-inline);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.label {
|
|
157
|
+
display: inline-block;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.end {
|
|
161
|
+
display: flex;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Anchor-positioned popover (Baseline 2026; ~86% support): fixed against
|
|
166
|
+
the summary's anchor, flipped above the trigger on viewport overflow.
|
|
167
|
+
anchor(), not position-area — position-area strips reach the viewport
|
|
168
|
+
edges, which would pin the panel to a corner. Browsers without the
|
|
169
|
+
feature keep the absolute popover above. */
|
|
170
|
+
@supports (anchor-name: --a) and (position-try-fallbacks: flip-block) {
|
|
171
|
+
.children {
|
|
172
|
+
position: fixed;
|
|
173
|
+
|
|
174
|
+
/* Top-left at the summary's top-right, growing down/right. */
|
|
175
|
+
inset-block-start: anchor(top);
|
|
176
|
+
inset-inline-start: anchor(right);
|
|
177
|
+
inset-block-end: auto;
|
|
178
|
+
inset-inline-end: auto;
|
|
179
|
+
|
|
180
|
+
margin-inline-start: var(--dimension-100);
|
|
181
|
+
|
|
182
|
+
position-try-fallbacks: flip-block;
|
|
183
|
+
|
|
184
|
+
/* Taller than the viewport: cap and scroll internally. */
|
|
185
|
+
max-block-size: 100dvh;
|
|
186
|
+
overflow-y: auto;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
121
190
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DEFAULT_MESSAGES as COLLAPSE_TOGGLE_MESSAGES } from "./common/CollapseToggle/constants.js";
|
|
2
|
+
/** SideNavigation's English text, used for any message not supplied. */
|
|
3
|
+
export const DEFAULT_MESSAGES = {
|
|
4
|
+
...COLLAPSE_TOGGLE_MESSAGES,
|
|
5
|
+
skipToContent: () => "Skip to main content",
|
|
6
|
+
navigation: () => "Main navigation",
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAGpG,wEAAwE;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,GAAG,wBAAwB;IAC3B,aAAa,EAAE,GAAG,EAAE,CAAC,sBAAsB;IAC3C,UAAU,EAAE,GAAG,EAAE,CAAC,iBAAiB;CACpC,CAAC"}
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
* into their `root`.
|
|
9
9
|
*
|
|
10
10
|
* @param legalUrl The external URL to legal information.
|
|
11
|
+
* @param options.label Label for the Help item itself. Defaults to `"Help"`.
|
|
11
12
|
* @param options.legalLabel Label for the legal link. Defaults to `"Legal information"`.
|
|
12
13
|
* @param options.additionalItems Further leaf items under "Help", after the
|
|
13
14
|
* legal link (e.g. a documentation or support link).
|
|
14
15
|
*/
|
|
15
16
|
export const createHelpItem = (legalUrl, options = {}) => ({
|
|
16
17
|
key: "help",
|
|
17
|
-
label: "Help",
|
|
18
|
+
label: options.label ?? "Help",
|
|
18
19
|
icon: "help",
|
|
19
20
|
items: [
|
|
20
21
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpItem.js","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/helpItem.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"helpItem.js","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/helpItem.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,OAAO,GAIH,EAAE,EACa,EAAE,CAAC,CAAC;IACvB,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,MAAM;IAC9B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACL;YACE,GAAG,EAAE,YAAY;YACjB,GAAG,EAAE,QAAQ;YACb,KAAK,EAAE,OAAO,CAAC,UAAU,IAAI,mBAAmB;YAChD,IAAI,EAAE,eAAe;SACtB;QACD,GAAG,CAAC,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC;KACnC;CACF,CAAC,CAAC"}
|