@canonical/react-ds-app 0.44.1 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/esm/lib/SideNavigation/SideNavigation.js +7 -22
  2. package/dist/esm/lib/SideNavigation/SideNavigation.js.map +1 -1
  3. package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js +15 -3
  4. package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js.map +1 -1
  5. package/dist/esm/lib/SideNavigation/common/CollapseToggle/constants.js +10 -0
  6. package/dist/esm/lib/SideNavigation/common/CollapseToggle/constants.js.map +1 -0
  7. package/dist/esm/lib/SideNavigation/common/CollapseToggle/styles.css +1 -2
  8. package/dist/esm/lib/SideNavigation/common/Content/Content.js +1 -1
  9. package/dist/esm/lib/SideNavigation/common/Content/Content.js.map +1 -1
  10. package/dist/esm/lib/SideNavigation/common/Content/styles.css +1 -1
  11. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.js +3 -3
  12. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/styles.css +1 -1
  13. package/dist/esm/lib/SideNavigation/common/Footer/Footer.js +26 -24
  14. package/dist/esm/lib/SideNavigation/common/Footer/Footer.js.map +1 -1
  15. package/dist/esm/lib/SideNavigation/common/Footer/styles.css +16 -4
  16. package/dist/esm/lib/SideNavigation/common/Header/Header.js +2 -2
  17. package/dist/esm/lib/SideNavigation/common/Header/Header.js.map +1 -1
  18. package/dist/esm/lib/SideNavigation/common/ItemExpandable/styles.css +70 -1
  19. package/dist/esm/lib/SideNavigation/constants.js +8 -0
  20. package/dist/esm/lib/SideNavigation/constants.js.map +1 -0
  21. package/dist/esm/lib/SideNavigation/helpItem.js +2 -1
  22. package/dist/esm/lib/SideNavigation/helpItem.js.map +1 -1
  23. package/dist/esm/lib/SideNavigation/styles.css +35 -143
  24. package/dist/types/lib/SideNavigation/SideNavigation.d.ts +4 -4
  25. package/dist/types/lib/SideNavigation/SideNavigation.d.ts.map +1 -1
  26. package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts +1 -1
  27. package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts.map +1 -1
  28. package/dist/types/lib/SideNavigation/common/CollapseToggle/constants.d.ts +4 -0
  29. package/dist/types/lib/SideNavigation/common/CollapseToggle/constants.d.ts.map +1 -0
  30. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts +20 -0
  31. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts.map +1 -1
  32. package/dist/types/lib/SideNavigation/common/Content/types.d.ts +1 -1
  33. package/dist/types/lib/SideNavigation/common/Content/types.d.ts.map +1 -1
  34. package/dist/types/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.d.ts +3 -3
  35. package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts.map +1 -1
  36. package/dist/types/lib/SideNavigation/common/Header/Header.d.ts +1 -1
  37. package/dist/types/lib/SideNavigation/common/Header/Header.d.ts.map +1 -1
  38. package/dist/types/lib/SideNavigation/common/Header/types.d.ts +3 -0
  39. package/dist/types/lib/SideNavigation/common/Header/types.d.ts.map +1 -1
  40. package/dist/types/lib/SideNavigation/constants.d.ts +4 -0
  41. package/dist/types/lib/SideNavigation/constants.d.ts.map +1 -0
  42. package/dist/types/lib/SideNavigation/helpItem.d.ts +2 -0
  43. package/dist/types/lib/SideNavigation/helpItem.d.ts.map +1 -1
  44. package/dist/types/lib/SideNavigation/types.d.ts +17 -0
  45. package/dist/types/lib/SideNavigation/types.d.ts.map +1 -1
  46. package/package.json +16 -16
@@ -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 region (a `role="menu"` select-like widget — not
15
- * navigation, so it sits outside the landmark in a plain `<div>` between
16
- * Header and Content; hidden when collapsed, where labels are unviable),
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
- // --- Controlled circuit (not official yet) -------------------------------
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
@@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B,UAAU,EAAE,UAAU,GACtB,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;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
- const CollapseToggleButton = ({ className, expanded = true, "aria-label": ariaLabel, ...props }) => {
6
- return (_jsxs("button", { className: [componentCssClassName, className].filter(Boolean).join(" "), "aria-expanded": expanded, "aria-label": ariaLabel ?? (expanded ? "Collapse navigation" : "Expand navigation"), ...props, type: "button", children: [_jsx(Icon, { icon: expanded ? "collapse-side-nav" : "expand-side-nav" }), _jsx("span", { className: "p", children: expanded ? "Close menu" : "Menu" })] }));
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 }) => (_jsx(TooltipEngine, { Message: expanded ? "Collapse" : "Expand", activateDelay: 1000, children: _jsx(CollapseToggleButton, { expanded: expanded, ...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;AAGjE,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEnD,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,QAAQ,GAAG,IAAI,EACf,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACY,EAAsB,EAAE;IAC5C,OAAO,CACL,kBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,mBACxD,QAAQ,gBAErB,SAAS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,CAAC,KAEnE,KAAK,EACT,IAAI,EAAC,QAAQ,aAMb,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,GAAI,EAClE,eAAM,SAAS,EAAC,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D,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
- /* size matches collapse icons */
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,YAAY,CAAC;AAE3C;;;;;;;;;;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"}
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"}
@@ -1,7 +1,7 @@
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.content {
4
+ .ds.side-navigation-content {
5
5
  position: relative;
6
6
  flex: 1;
7
7
  display: flex;
@@ -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 — its
26
- * position is content-defined: compose this component directly where
27
- * the consumer wants it. See SPEC.md's known issues.
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
  */
@@ -75,7 +75,7 @@
75
75
  font-size: var(--typography-text-secondary-font-size);
76
76
  }
77
77
 
78
- & .badge {
78
+ & > .badge {
79
79
  position: absolute;
80
80
  align-self: flex-end;
81
81
  }
@@ -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
- * Renders one footer leaf row. The Footer is the one place a navigation row
9
- * may be a button. Three-way dispatch: a navigable item (`url` set,
10
- * `control` not `"button"`) renders as `Item` (a link via `LinkComponent`,
11
- * active when current); an action item (`control: "button"`, or `onClick`
12
- * with no `url`) renders as `ItemButton`; anything else — a label-only row
13
- * like a logged-in username — renders as `Item`'s plain label row, NOT an
14
- * inert `<button>` announced as an action that does nothing. Explicit
15
- * `control` always wins over the `url`-presence inference, so an action
16
- * item may carry a `url` yet render as a button. Toggle-style rows compose
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 renderFooterItem = (item, currentUrl, LinkComponent) => {
20
- // `label` is the row's identity (required on LeafFooterItem), so it is
21
- // the element key — reordering the authored list preserves each row's
22
- // state. Two same-labelled rows in one footer collide; that's ambiguous
23
- // UI, left to the consumer to avoid.
24
- if (item.control !== "button" && item.url) {
25
- const active = item.url === currentUrl;
26
- return (_jsx(Item, { url: item.url, icon: item.icon, slot: item.slot, LinkComponent: LinkComponent, active: active, children: item.label }, item.label));
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) => renderFooterItem(child, currentUrl, LinkComponent)) }, entry.label)) : (renderFooterItem(entry, currentUrl, LinkComponent))) })) : null }));
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;AAEtB,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,MAAM,gBAAgB,GAAG,CACvB,IAAoB,EACpB,UAA8B,EAC9B,aAA2C,EACvB,EAAE;IACtB,uEAAuE;IACvE,sEAAsE;IACtE,wEAAwE;IACxE,qCAAqC;IACrC,IAAI,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,KAAK,UAAU,CAAC;QACvC,OAAO,CACL,KAAC,IAAI,IAEH,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,YAEb,IAAI,CAAC,KAAK,IAPN,IAAI,CAAC,KAAK,CAQV,CACR,CAAC;IACJ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oB;gBACpB,yDAAyD;gBACzD,2DAA2D;gBAC3D,uDAAuD;gBACvD,4DAA4D;gBAC5D,4DAA4D;gBAC5D,qCAAqC;gBACrC,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAC/B,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,UAAU,CACtD,YAEA,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1B,KAAC,SAAS,IAER,IAAI,EAAE,KAAK,EACX,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,IAHvB,KAAK,CAAC,KAAK,CAIhB,CACH,CAAC,IAtBG,KAAK,CAAC,KAAK,CAuBD,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 — the footer's rows are always a flat list (leaves and
9
- depth-1 expandables; no groups), so this owns the structure reset
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
- they read as nested. */
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;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,OAAO,GAGH,EAAE,EACa,EAAE,CAAC,CAAC;IACvB,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,MAAM;IACb,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"}
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"}
@@ -1,5 +1,8 @@
1
1
  /* Generated by @canonical/summon-component:react v0.1.0
2
2
  * Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
3
+
4
+ /* Shell-only sheet: root box, region placement, shared tokens. Subcomponent
5
+ anatomy lives in each subcomponent's own styles.css. */
3
6
  @layer ds.components.apps {
4
7
  :root {
5
8
  /* ── Rail ───────────────────────────────────────────────────────── */
@@ -28,17 +31,13 @@
28
31
  --sidenav-inset-inline: var(--dimension-100);
29
32
  /* 0.5rem between a leading icon and its label. */
30
33
  --sidenav-icon-gap: var(--dimension-100);
31
- /* Fixed leading-icon column so labels align down the rail with or
32
- without an icon — matches the Icon component's default rendered size
33
- (1rem). No design token names it, so this stays a provisional value
34
- scoped here rather than reusing a spacing token for a sizing concern. */
34
+ /* Leading-icon column so labels align with or without an icon. No token
35
+ names it; provisional, scoped here. */
35
36
  --sidenav-icon-column-inline-size: 1.5rem;
36
37
 
37
38
  /* ── Row background channel ────────────────────────────────────────
38
- Item/ItemButton/ItemExpandable/CollapseToggle consume THIS, not the
39
- navigation-primary token directly, so every row retints from one
40
- place (an inherited custom-property override on any ancestor) instead
41
- of threading an "is this retinted?" flag through every row component. */
39
+ Rows consume this channel, not the navigation-primary token directly,
40
+ so an ancestor custom-property override retints every row at once. */
42
41
  --sidenav-row-background: var(--color-foreground-navigation-primary);
43
42
  --sidenav-row-background-hover: var(
44
43
  --color-foreground-navigation-primary-hover
@@ -51,10 +50,16 @@
51
50
  );
52
51
 
53
52
  /* ── Collapsed-rail popover ──────────────────────────────────────── */
54
- /* No design token names an elevated-popover shadow; component-scoped
55
- (overridable by any ancestor) rather than a phantom reference to a
56
- `--box-shadow-high` token that does not exist. */
53
+ /* No token names an elevated-popover shadow; scoped here so any
54
+ ancestor can override. */
57
55
  --sidenav-popover-shadow: 0 0.25rem 0.5rem rgb(0 0 0 / 20%);
56
+
57
+ /* ── CollapseToggle ─────────────────────────────────────────────── */
58
+ /* Hit target: icon square (2rem) plus 0.25rem breathing room. */
59
+ --sidenav-collapse-toggle-inline-size: calc(
60
+ var(--dimension-400) +
61
+ var(--dimension-050)
62
+ );
58
63
  }
59
64
 
60
65
  .ds.side-navigation {
@@ -64,11 +69,8 @@
64
69
  background: var(--color-foreground-navigation-primary);
65
70
  display: flex;
66
71
  flex-direction: column;
67
- /* Gap between Header / Content / Footer. Deliberate deviation from the
68
- upstream 24.04 design's per-seam 1rem (below the logo, above the
69
- first footer item): a single flex gap applies one value
70
- between every adjacent child, and this ships 0.5rem so the rail reads
71
- tight. */
72
+ /* Deliberate deviation from the upstream design's per-seam 1rem: one flex
73
+ gap, 0.5rem, so the rail reads tight. */
72
74
  gap: var(--dimension-100); /* 0.5rem */
73
75
 
74
76
  inline-size: var(--sidenav-rail-inline-size);
@@ -80,22 +82,14 @@
80
82
  to the bottom. */
81
83
  block-size: 100%;
82
84
 
83
- /* Per-component override of the shared overflow-fade token (default 2rem
84
- in @canonical/styles/overflow.css): the upstream 24.04 design calls
85
- for 1.75rem specifically at the Header/Content and Content/Footer
86
- seams. */
85
+ /* Override of the shared overflow-fade token (2rem default in
86
+ @canonical/styles/overflow.css): the design calls for 1.75rem. */
87
87
  --overflow-gradient-height: 1.75rem;
88
88
 
89
- /* Collapsed: the rail narrows to fit just
90
- the logo, and no navigation items show — a deliberate scope cut. The
91
- footer stays visible (icon-only); only Content is hidden. The width
92
- change animates over --motion-duration-medium — a deliberate
93
- deviation from the upstream 24.04 design's no-animation stance:
94
- the resize reads as motion, and it honours reduced motion (the
95
- motion tokens are zeroed under prefers-reduced-motion by
96
- @canonical/styles/motion.css). Both the physical and logical
97
- properties transition, for engines that implement only one of
98
- them. */
89
+ /* The width change animates — a deliberate deviation from the upstream
90
+ design's no-animation stance. Reduced motion is honoured via the
91
+ zeroed motion tokens. Both physical and logical properties
92
+ transition, for engines that implement only one. */
99
93
 
100
94
  transition:
101
95
  width var(--motion-duration-medium) ease-in-out,
@@ -136,129 +130,28 @@
136
130
  inline-size: var(--sidenav-rail-inline-size-collapsed);
137
131
  justify-content: space-between;
138
132
 
139
- & > .ds.content {
133
+ & > .ds.side-navigation-content {
140
134
  display: none;
141
135
  }
142
136
 
143
- /* The ContextSwitcher region hides with Content: its rows are
144
- label-driven (the switcher has no icon form), so nothing survives
145
- icon-only degradation. */
146
- & > .ds.side-navigation-context-switcher-region {
137
+ /* Label-driven rows — nothing survives icon-only degradation. */
138
+ & > .ds.side-navigation-context-switcher {
147
139
  display: none;
148
140
  }
149
141
 
150
- /* Footer stays visible, icon-only. The collapsed footer's labels
151
- show in tooltips on hover after 800ms — a documented follow-up;
152
- this is the icon-only layout half. */
153
- & > .ds.footer {
154
- .label,
155
- .end {
156
- display: none;
157
- }
158
-
159
- .row {
160
- grid-template-columns: var(--sidenav-icon-column-inline-size);
161
- }
162
- }
163
-
164
- /* Every ItemExpandable in the collapsed rail degrades its sub-items
165
- into a floating popover on the inline-end. Native <details>
166
- disclosure: the tree stays in the DOM and Tab reaches the panel's
167
- links from the summary; the expanded state keeps its inline
168
- disclosure (rules here are scoped to the collapsed state). */
169
- .ds.side-navigation-item-expandable {
170
- position: relative;
171
-
172
- .children {
173
- position: absolute;
174
- inset-block-start: 0;
175
- inset-inline-start: calc(100% + var(--dimension-100));
176
- z-index: var(--z-index-overlay, 100);
177
-
178
- display: none;
179
- inline-size: max-content;
180
- min-inline-size: calc(var(--sidenav-rail-inline-size) / 2);
181
- margin: 0;
182
-
183
- background: var(--color-background-default, #fff);
184
- border: var(--dimension-stroke-thickness-medium) solid
185
- var(--color-border-muted);
186
- border-radius: var(--dimension-radius-small);
187
- box-shadow: var(--sidenav-popover-shadow);
188
- }
189
-
190
- .details[open] .children {
191
- display: block;
192
-
193
- /* Undo the icon-only compression for popover rows: full grid and
194
- visible titles inside the panel. */
195
- .row {
196
- margin: 0;
197
- grid-template-columns:
198
- var(--sidenav-icon-column-inline-size) 1fr
199
- auto;
200
- padding-inline: var(--sidenav-inset-inline);
201
- }
202
-
203
- .label {
204
- display: inline-block;
205
- }
206
-
207
- .end {
208
- display: flex;
209
- }
210
- }
211
-
212
- /* Anchor-positioned popover (Baseline 2026; ~86% support): the
213
- children panel is fixed against its summary's anchor (inline
214
- styles from ItemExpandable) and position-try-fallbacks flips it
215
- above the trigger on viewport overflow — browser-measured, moving
216
- up exactly what it needs plus the mirrored 0.5rem gap. Browsers
217
- without the feature keep the absolute top-anchored popover above.
218
-
219
- NOTE: pinned to the summary's own edges via anchor(), not
220
- position-area — position-area regions are whole strips reaching
221
- the viewport edges, so a start-aligned panel would land pinned to
222
- the viewport's top-right corner, not beside the trigger. */
223
- @supports (anchor-name: --a) and (position-try-fallbacks: flip-block) {
224
- .children {
225
- position: fixed;
226
-
227
- /* Panel's top-left at the summary's top-right corner, growing
228
- down/right. Physical anchor() sides — the rail is
229
- horizontal-tb and they have the widest shipped support. */
230
- inset-block-start: anchor(top);
231
- inset-inline-start: anchor(right);
232
- inset-block-end: auto;
233
- inset-inline-end: auto;
234
-
235
- margin-inline-start: var(--dimension-100);
236
-
237
- position-try-fallbacks: flip-block;
238
-
239
- /* Both sides overflowing (taller than the viewport): flip-block
240
- reverts to the default position, so cap the panel and scroll
241
- internally rather than clip. */
242
- max-block-size: 100dvh;
243
- overflow-y: auto;
244
- }
245
- }
246
- }
142
+ /* Footer (icon-only) and ItemExpandable (popover) keep rendering —
143
+ their collapsed anatomy lives in their own stylesheets. */
247
144
  }
248
145
 
249
- /* Responsive: below Vanilla's "small" breakpoint
250
- ($breakpoint-small, 620px) the rail stops being a rail — the header is
251
- always shown; the body (Content AND Footer, unlike the desktop
252
- collapsed state which keeps the footer) is hidden until Menu is
253
- activated, then takes over the full screen. Same `data-expanded`
254
- attribute as desktop. Drill-down navigation is out of scope. */
146
+ /* Below the small breakpoint (620px) the rail stops being a rail: the
147
+ body (Content AND Footer) stays hidden until Menu activates it, then
148
+ takes over the full screen. Drill-down navigation is out of scope. */
255
149
  @media (width < 620px) {
256
150
  inline-size: 100%;
257
151
  flex-shrink: 1;
258
152
  block-size: auto;
259
153
 
260
- /* :not() form — a consumer shell that omits the attribute defaults
261
- open, matching the desktop rule's semantics. */
154
+ /* :not() form — a shell omitting the attribute defaults open. */
262
155
  &:not([data-expanded="false"]) {
263
156
  position: fixed;
264
157
  inset: 0;
@@ -270,9 +163,8 @@
270
163
  &[data-expanded="false"] {
271
164
  inline-size: 100%;
272
165
 
273
- /* Overrides the desktop collapsed rule above: the body is hidden
274
- entirely on mobile, not shown icon-only. */
275
- & > .ds.footer {
166
+ /* Overrides the desktop icon-only footer: hidden entirely on mobile. */
167
+ & > .ds.side-navigation-footer {
276
168
  display: none;
277
169
  }
278
170
  }
@@ -8,9 +8,9 @@ import "./styles.css";
8
8
  * region it controls.
9
9
  *
10
10
  * Four regions: Header (branding, collapse toggle), the optional
11
- * ContextSwitcher region (a `role="menu"` select-like widget — not
12
- * navigation, so it sits outside the landmark in a plain `<div>` between
13
- * Header and Content; hidden when collapsed, where labels are unviable),
11
+ * ContextSwitcher (a `role="menu"` select-like widget — not navigation,
12
+ * so it sits outside the landmark between Header and Content; hidden
13
+ * when collapsed, where labels are unviable),
14
14
  * Content (the main `<nav>` landmark) and Footer (user profile, settings
15
15
  * and non-navigational actions). The root element is a plain `<div>` and
16
16
  * the component's single *navigation* landmark is Content's `<nav>`, so
@@ -34,6 +34,6 @@ import "./styles.css";
34
34
  *
35
35
  * @implements ds:apps.pattern.side-navigation
36
36
  */
37
- declare const SideNavigation: ({ className, brand, applicationName, root, contextSwitcher, footerRoot, LinkComponent, currentUrl, skipTo, defaultExpanded: defaultExpandedProp, keyboardShortcut, "aria-label": ariaLabel, ...props }: SideNavigationProps) => React.ReactElement;
37
+ declare const SideNavigation: ({ className, brand, applicationName, root, contextSwitcher, footerRoot, LinkComponent, currentUrl, skipTo, defaultExpanded: defaultExpandedProp, keyboardShortcut, "aria-label": ariaLabel, messages: messagesProp, ...props }: SideNavigationProps) => React.ReactElement;
38
38
  export default SideNavigation;
39
39
  //# sourceMappingURL=SideNavigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideNavigation.d.ts","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/SideNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,QAAA,MAAM,cAAc,2MAiBjB,mBAAmB,KAAG,KAAK,CAAC,YAkF9B,CAAC;eAEa,cAAc"}
1
+ {"version":3,"file":"SideNavigation.d.ts","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/SideNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,QAAA,MAAM,cAAc,mOAejB,mBAAmB,KAAG,KAAK,CAAC,YAmE9B,CAAC;eAEa,cAAc"}
@@ -16,6 +16,6 @@ import "./styles.css";
16
16
  *
17
17
  * @implements ds:apps.subcomponent.side-navigation-collapse-toggle
18
18
  */
19
- declare const CollapseToggle: ({ expanded, ...props }: CollapseToggleProps) => React.ReactElement;
19
+ declare const CollapseToggle: ({ expanded, messages, ...props }: CollapseToggleProps) => React.ReactElement;
20
20
  export default CollapseToggle;
21
21
  //# sourceMappingURL=CollapseToggle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollapseToggle.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/CollapseToggle/CollapseToggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,cAAc,CAAC;AA8BtB;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,cAAc,2BAGjB,mBAAmB,KAAG,KAAK,CAAC,YAO9B,CAAC;eAEa,cAAc"}
1
+ {"version":3,"file":"CollapseToggle.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/CollapseToggle/CollapseToggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,cAAc,CAAC;AAyCtB;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,cAAc,qCAIjB,mBAAmB,KAAG,KAAK,CAAC,YAe9B,CAAC;eAEa,cAAc"}
@@ -0,0 +1,4 @@
1
+ import type { CollapseToggleMessages } from "./types.js";
2
+ /** The collapse toggle's English text, used for any message not supplied. */
3
+ export declare const DEFAULT_MESSAGES: CollapseToggleMessages;
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/CollapseToggle/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,EAAE,sBAO9B,CAAC"}
@@ -1,10 +1,30 @@
1
1
  import type { ComponentProps } from "react";
2
+ /**
3
+ * The collapse toggle's text, one function per string, so an application can
4
+ * supply translations. Each defaults to its English text.
5
+ */
6
+ export interface CollapseToggleMessages {
7
+ /** The button's accessible name while the rail is expanded. */
8
+ collapseNavigation: () => string;
9
+ /** The button's accessible name while the rail is collapsed. */
10
+ expandNavigation: () => string;
11
+ /** The tooltip naming the action while the rail is expanded. */
12
+ collapse: () => string;
13
+ /** The tooltip naming the action while the rail is collapsed. */
14
+ expand: () => string;
15
+ /** The button's visible text below the small breakpoint, menu closed. */
16
+ openMenu: () => string;
17
+ /** The button's visible text below the small breakpoint, menu open. */
18
+ closeMenu: () => string;
19
+ }
2
20
  type OwnProps = {
3
21
  /**
4
22
  * Whether the navigation is currently expanded. Drives `aria-expanded` and
5
23
  * the default `aria-label`. Controlled by the parent SideNavigation.
6
24
  */
7
25
  expanded?: boolean;
26
+ /** The toggle's text. Any message left out keeps its English default. */
27
+ messages?: Partial<CollapseToggleMessages>;
8
28
  };
9
29
  /**
10
30
  * `type` is excluded in addition to `OwnProps`: this is always a disclosure
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/CollapseToggle/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GACxC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/CollapseToggle/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,kBAAkB,EAAE,MAAM,MAAM,CAAC;IACjC,gEAAgE;IAChE,gBAAgB,EAAE,MAAM,MAAM,CAAC;IAC/B,gEAAgE;IAChE,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,iEAAiE;IACjE,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,uEAAuE;IACvE,SAAS,EAAE,MAAM,MAAM,CAAC;CACzB;AAED,KAAK,QAAQ,GAAG;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GACxC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { ComponentProps, ComponentType } from "react";
2
2
  import type { LinkComponentProps, NavRoot } from "../../types.js";
3
3
  type OwnProps = {
4
- /** Root whose direct children render as groups — see NavRoot. Data-only: rows render exclusively from this tree (there is no children escape hatch into the landmark). */
4
+ /** Root whose direct children render as groups — see NavRoot. */
5
5
  root?: NavRoot;
6
6
  /** Component used to render navigable items. Defaults to `"a"`. */
7
7
  LinkComponent?: ComponentType<LinkComponentProps> | "a";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Content/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,0KAA0K;IAC1K,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,QAAQ,GACjC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Content/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,iEAAiE;IACjE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,QAAQ,GACjC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
@@ -9,9 +9,9 @@ import "./styles.css";
9
9
  * full roving-focus keyboard navigation. `title`, when given, renders via
10
10
  * `SideNavigation.GroupHeader` as a sibling above the dropdown field.
11
11
  *
12
- * Not part of the `NavRoot`/`NavGroup` content-tree data model — its
13
- * position is content-defined: compose this component directly where
14
- * the consumer wants it. See SPEC.md's known issues.
12
+ * Not part of the `NavRoot`/`NavGroup` content-tree data model — it
13
+ * embeds via `SideNavigation`'s `contextSwitcher` prop slot, its region
14
+ * class owning the collapsed-rail hide.
15
15
  *
16
16
  * @implements ds:apps.subcomponent.side-navigation-context-switcher
17
17
  */
@@ -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;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,cAAc,CAAC;AA6DtB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,6DAMT,WAAW,KAAG,KAAK,CAAC,YAwCtB,CAAC;eAEa,MAAM"}
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;AA2DtB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,6DAMT,WAAW,KAAG,KAAK,CAAC,YAqDtB,CAAC;eAEa,MAAM"}
@@ -10,6 +10,6 @@ import "./styles.css";
10
10
  *
11
11
  * @implements ds:apps.subcomponent.side-navigation-header
12
12
  */
13
- declare const Header: ({ className, brand, applicationName, expanded, onToggle, collapseControls, ...props }: HeaderProps) => React.ReactElement;
13
+ declare const Header: ({ className, brand, applicationName, expanded, onToggle, collapseControls, collapseToggleMessages, ...props }: HeaderProps) => React.ReactElement;
14
14
  export default Header;
15
15
  //# sourceMappingURL=Header.d.ts.map
@@ -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;;;;;;;;GAQG;AACH,QAAA,MAAM,MAAM,0FAQT,WAAW,KAAG,KAAK,CAAC,YAyBtB,CAAC;eAEa,MAAM"}
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,kHAST,WAAW,KAAG,KAAK,CAAC,YA0BtB,CAAC;eAEa,MAAM"}
@@ -1,4 +1,5 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
+ import type { CollapseToggleMessages } from "../CollapseToggle/types.js";
2
3
  type OwnProps = {
3
4
  /** Brand content (logo mark) rendered at the start of the header. */
4
5
  brand?: ReactNode;
@@ -10,6 +11,8 @@ type OwnProps = {
10
11
  onToggle?: () => void;
11
12
  /** id of the navigation region the collapse toggle controls (`aria-controls`). */
12
13
  collapseControls?: string;
14
+ /** The collapse toggle's text. Any message left out keeps its default. */
15
+ collapseToggleMessages?: Partial<CollapseToggleMessages>;
13
16
  };
14
17
  export type HeaderProps = OwnProps & Omit<ComponentProps<"header">, keyof OwnProps>;
15
18
  export {};
@@ -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,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"}
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;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEzE,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;IAC1B,0EAA0E;IAC1E,sBAAsB,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;CAC1D,CAAC;AAKF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAChC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SideNavigationMessages } from "./types.js";
2
+ /** SideNavigation's English text, used for any message not supplied. */
3
+ export declare const DEFAULT_MESSAGES: SideNavigationMessages;
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/constants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,EAAE,sBAI9B,CAAC"}
@@ -9,11 +9,13 @@ import type { ExpandableNavItem } from "./types.js";
9
9
  * into their `root`.
10
10
  *
11
11
  * @param legalUrl The external URL to legal information.
12
+ * @param options.label Label for the Help item itself. Defaults to `"Help"`.
12
13
  * @param options.legalLabel Label for the legal link. Defaults to `"Legal information"`.
13
14
  * @param options.additionalItems Further leaf items under "Help", after the
14
15
  * legal link (e.g. a documentation or support link).
15
16
  */
16
17
  export declare const createHelpItem: (legalUrl: string, options?: {
18
+ label?: string;
17
19
  legalLabel?: string;
18
20
  additionalItems?: ExpandableNavItem["items"];
19
21
  }) => ExpandableNavItem;
@@ -1 +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,aACf,MAAM,YACP;IACP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CAC9C,KACA,iBAaD,CAAC"}
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;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,aACf,MAAM,YACP;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CAC9C,KACA,iBAaD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import type { IconName } from "@canonical/ds-assets";
2
2
  import type { LinkComponentProps } from "@canonical/react-ds-global";
3
3
  import type { ComponentProps, ComponentType, ReactNode } from "react";
4
+ import type { CollapseToggleMessages } from "./common/CollapseToggle/types.js";
4
5
  import type { ContextSwitcherProps } from "./common/ContextSwitcher/types.js";
5
6
  export type { LinkComponentProps };
6
7
  /**
@@ -132,6 +133,16 @@ export type _AnyNavNode = _AnyNavNodeFields & ({
132
133
  key?: string;
133
134
  url: string;
134
135
  });
136
+ /**
137
+ * SideNavigation's built-in text, one function per string, so an application
138
+ * can supply translations. Each defaults to its English text.
139
+ */
140
+ export interface SideNavigationMessages extends CollapseToggleMessages {
141
+ /** The visually hidden link that skips past the navigation. */
142
+ skipToContent: () => string;
143
+ /** The navigation landmark's name when no `aria-label` is given. */
144
+ navigation: () => string;
145
+ }
135
146
  type OwnProps = {
136
147
  /** Brand content (logo/wordmark) rendered in the header. */
137
148
  brand?: ReactNode;
@@ -179,6 +190,12 @@ type OwnProps = {
179
190
  * `ContextSwitcherProps`.
180
191
  */
181
192
  contextSwitcher?: ContextSwitcherProps;
193
+ /**
194
+ * The navigation's built-in text, for translation: the skip link, the
195
+ * landmark's default name and the collapse toggle's labels. Any message
196
+ * left out keeps its English default.
197
+ */
198
+ messages?: Partial<SideNavigationMessages>;
182
199
  };
183
200
  /**
184
201
  * SideNavigation's root is a plain `<div>` layout container — Header, the
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/SideNavigation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2GAA2G;IAC3G,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yDAAyD;IACzD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,wDAAwD;IACxD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC,GAAG;IAClE,+EA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,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,+DAA+D;IAC/D,aAAa,EAAE,MAAM,MAAM,CAAC;IAC5B,oEAAoE;IACpE,UAAU,EAAE,MAAM,MAAM,CAAC;CAC1B;AAED,KAAK,QAAQ,GAAG;IACd,4DAA4D;IAC5D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GACxC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-ds-app",
3
- "version": "0.44.1",
3
+ "version": "0.45.0",
4
4
  "type": "module",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -39,13 +39,13 @@
39
39
  "test:vitest:watch": "vitest"
40
40
  },
41
41
  "dependencies": {
42
- "@canonical/ds-assets": "^0.44.1",
43
- "@canonical/ds-types": "^0.44.1",
44
- "@canonical/ds-utils": "^0.44.1",
45
- "@canonical/react-ds-global": "^0.44.1",
46
- "@canonical/react-hooks": "^0.44.1",
47
- "@canonical/storybook-config": "^0.44.1",
48
- "@canonical/styles": "^0.44.1",
42
+ "@canonical/ds-assets": "^0.45.0",
43
+ "@canonical/ds-types": "^0.45.0",
44
+ "@canonical/ds-utils": "^0.45.0",
45
+ "@canonical/react-ds-global": "^0.45.0",
46
+ "@canonical/react-hooks": "^0.45.0",
47
+ "@canonical/storybook-config": "^0.45.0",
48
+ "@canonical/styles": "^0.45.0",
49
49
  "react": "^19.2.4",
50
50
  "react-dom": "^19.2.4"
51
51
  },
@@ -65,13 +65,13 @@
65
65
  "@biomejs/biome": "2.5.15",
66
66
  "@canonical/biome-config": "0.43.0",
67
67
  "@canonical/design-tokens": "0.43.0",
68
- "@canonical/react-ds-global-form": "^0.44.1",
69
- "@canonical/router-core": "^0.44.1",
70
- "@canonical/router-react": "^0.44.1",
71
- "@canonical/storybook-addon-utils": "^0.44.1",
72
- "@canonical/storybook-helpers": "^0.44.1",
73
- "@canonical/typescript-config-react": "^0.44.1",
74
- "@canonical/vitest-config-react": "^0.44.1",
68
+ "@canonical/react-ds-global-form": "^0.45.0",
69
+ "@canonical/router-core": "^0.45.0",
70
+ "@canonical/router-react": "^0.45.0",
71
+ "@canonical/storybook-addon-utils": "^0.45.0",
72
+ "@canonical/storybook-helpers": "^0.45.0",
73
+ "@canonical/typescript-config-react": "^0.45.0",
74
+ "@canonical/vitest-config-react": "^0.45.0",
75
75
  "@canonical/webarchitect": "0.43.0",
76
76
  "@chromatic-com/storybook": "^5.0.1",
77
77
  "@storybook/addon-docs": "^10.6.0",
@@ -90,5 +90,5 @@
90
90
  "vite": "^8.0.1",
91
91
  "vitest": "^5.0.0"
92
92
  },
93
- "gitHead": "81ed283dd7509fb5de86dfe39021c62de3e31b5e"
93
+ "gitHead": "f8c2473f9aa92d14c24f0976f2f02ebc4944f32f"
94
94
  }