@canonical/react-ds-app 0.38.0 → 0.42.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 (142) hide show
  1. package/dist/esm/lib/ContentLayout/styles.css +1 -1
  2. package/dist/esm/lib/SideNavigation/SideNavigation.js +45 -9
  3. package/dist/esm/lib/SideNavigation/SideNavigation.js.map +1 -1
  4. package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js +14 -6
  5. package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js.map +1 -1
  6. package/dist/esm/lib/SideNavigation/common/CollapseToggle/styles.css +48 -2
  7. package/dist/esm/lib/SideNavigation/common/Content/Content.js +9 -5
  8. package/dist/esm/lib/SideNavigation/common/Content/Content.js.map +1 -1
  9. package/dist/esm/lib/SideNavigation/common/Content/styles.css +45 -21
  10. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.js +70 -0
  11. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.js.map +1 -0
  12. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/index.js +2 -0
  13. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/index.js.map +1 -0
  14. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/styles.css +94 -0
  15. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/types.js +2 -0
  16. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/types.js.map +1 -0
  17. package/dist/esm/lib/SideNavigation/common/Footer/Footer.js +46 -6
  18. package/dist/esm/lib/SideNavigation/common/Footer/Footer.js.map +1 -1
  19. package/dist/esm/lib/SideNavigation/common/Footer/styles.css +13 -3
  20. package/dist/esm/lib/SideNavigation/common/Group/Group.js +14 -0
  21. package/dist/esm/lib/SideNavigation/common/Group/Group.js.map +1 -0
  22. package/dist/esm/lib/SideNavigation/common/Group/index.js +2 -0
  23. package/dist/esm/lib/SideNavigation/common/Group/index.js.map +1 -0
  24. package/dist/esm/lib/SideNavigation/common/Group/styles.css +18 -0
  25. package/dist/esm/lib/SideNavigation/common/Group/types.js +2 -0
  26. package/dist/esm/lib/SideNavigation/common/Group/types.js.map +1 -0
  27. package/dist/esm/lib/SideNavigation/common/GroupHeader/GroupHeader.js +17 -0
  28. package/dist/esm/lib/SideNavigation/common/GroupHeader/GroupHeader.js.map +1 -0
  29. package/dist/esm/lib/SideNavigation/common/GroupHeader/index.js +2 -0
  30. package/dist/esm/lib/SideNavigation/common/GroupHeader/index.js.map +1 -0
  31. package/dist/esm/lib/SideNavigation/common/GroupHeader/styles.css +31 -0
  32. package/dist/esm/lib/SideNavigation/common/GroupHeader/types.js +2 -0
  33. package/dist/esm/lib/SideNavigation/common/GroupHeader/types.js.map +1 -0
  34. package/dist/esm/lib/SideNavigation/common/Header/Header.js +4 -2
  35. package/dist/esm/lib/SideNavigation/common/Header/Header.js.map +1 -1
  36. package/dist/esm/lib/SideNavigation/common/Header/styles.css +66 -28
  37. package/dist/esm/lib/SideNavigation/common/Item/Item.js +10 -14
  38. package/dist/esm/lib/SideNavigation/common/Item/Item.js.map +1 -1
  39. package/dist/esm/lib/SideNavigation/common/Item/styles.css +71 -36
  40. package/dist/esm/lib/SideNavigation/common/ItemButton/ItemButton.js +18 -0
  41. package/dist/esm/lib/SideNavigation/common/ItemButton/ItemButton.js.map +1 -0
  42. package/dist/esm/lib/SideNavigation/common/ItemButton/index.js +2 -0
  43. package/dist/esm/lib/SideNavigation/common/ItemButton/index.js.map +1 -0
  44. package/dist/esm/lib/SideNavigation/common/ItemButton/styles.css +79 -0
  45. package/dist/esm/lib/SideNavigation/common/ItemButton/types.js +2 -0
  46. package/dist/esm/lib/SideNavigation/common/ItemButton/types.js.map +1 -0
  47. package/dist/esm/lib/SideNavigation/common/ItemExpandable/ItemExpandable.js +71 -0
  48. package/dist/esm/lib/SideNavigation/common/ItemExpandable/ItemExpandable.js.map +1 -0
  49. package/dist/esm/lib/SideNavigation/common/ItemExpandable/index.js +2 -0
  50. package/dist/esm/lib/SideNavigation/common/ItemExpandable/index.js.map +1 -0
  51. package/dist/esm/lib/SideNavigation/common/ItemExpandable/styles.css +121 -0
  52. package/dist/esm/lib/SideNavigation/common/ItemExpandable/types.js +2 -0
  53. package/dist/esm/lib/SideNavigation/common/ItemExpandable/types.js.map +1 -0
  54. package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js +63 -21
  55. package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js.map +1 -1
  56. package/dist/esm/lib/SideNavigation/common/NavTree/styles.css +7 -30
  57. package/dist/esm/lib/SideNavigation/common/index.js +5 -0
  58. package/dist/esm/lib/SideNavigation/common/index.js.map +1 -1
  59. package/dist/esm/lib/SideNavigation/helpItem.js +29 -0
  60. package/dist/esm/lib/SideNavigation/helpItem.js.map +1 -0
  61. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/index.js +2 -0
  62. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/index.js.map +1 -0
  63. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/types.js +2 -0
  64. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/types.js.map +1 -0
  65. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.js +45 -0
  66. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.js.map +1 -0
  67. package/dist/esm/lib/SideNavigation/index.js +1 -0
  68. package/dist/esm/lib/SideNavigation/index.js.map +1 -1
  69. package/dist/esm/lib/SideNavigation/styles.css +272 -19
  70. package/dist/types/lib/ApplicationLayout/ApplicationLayout.d.ts.map +1 -1
  71. package/dist/types/lib/ContentLayout/ContentLayout.d.ts.map +1 -1
  72. package/dist/types/lib/ContentLayout/types.d.ts +1 -1
  73. package/dist/types/lib/SideNavigation/SideNavigation.d.ts +22 -1
  74. package/dist/types/lib/SideNavigation/SideNavigation.d.ts.map +1 -1
  75. package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts +9 -2
  76. package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts.map +1 -1
  77. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts +6 -1
  78. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts.map +1 -1
  79. package/dist/types/lib/SideNavigation/common/Content/Content.d.ts +8 -4
  80. package/dist/types/lib/SideNavigation/common/Content/Content.d.ts.map +1 -1
  81. package/dist/types/lib/SideNavigation/common/Content/types.d.ts +5 -8
  82. package/dist/types/lib/SideNavigation/common/Content/types.d.ts.map +1 -1
  83. package/dist/types/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.d.ts +20 -0
  84. package/dist/types/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.d.ts.map +1 -0
  85. package/dist/types/lib/SideNavigation/common/ContextSwitcher/index.d.ts +3 -0
  86. package/dist/types/lib/SideNavigation/common/ContextSwitcher/index.d.ts.map +1 -0
  87. package/dist/types/lib/SideNavigation/common/ContextSwitcher/types.d.ts +52 -0
  88. package/dist/types/lib/SideNavigation/common/ContextSwitcher/types.d.ts.map +1 -0
  89. package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts +8 -4
  90. package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts.map +1 -1
  91. package/dist/types/lib/SideNavigation/common/Footer/types.d.ts +5 -8
  92. package/dist/types/lib/SideNavigation/common/Footer/types.d.ts.map +1 -1
  93. package/dist/types/lib/SideNavigation/common/Group/Group.d.ts +13 -0
  94. package/dist/types/lib/SideNavigation/common/Group/Group.d.ts.map +1 -0
  95. package/dist/types/lib/SideNavigation/common/Group/index.d.ts +3 -0
  96. package/dist/types/lib/SideNavigation/common/Group/index.d.ts.map +1 -0
  97. package/dist/types/lib/SideNavigation/common/Group/types.d.ts +10 -0
  98. package/dist/types/lib/SideNavigation/common/Group/types.d.ts.map +1 -0
  99. package/dist/types/lib/SideNavigation/common/GroupHeader/GroupHeader.d.ts +13 -0
  100. package/dist/types/lib/SideNavigation/common/GroupHeader/GroupHeader.d.ts.map +1 -0
  101. package/dist/types/lib/SideNavigation/common/GroupHeader/index.d.ts +3 -0
  102. package/dist/types/lib/SideNavigation/common/GroupHeader/index.d.ts.map +1 -0
  103. package/dist/types/lib/SideNavigation/common/GroupHeader/types.d.ts +8 -0
  104. package/dist/types/lib/SideNavigation/common/GroupHeader/types.d.ts.map +1 -0
  105. package/dist/types/lib/SideNavigation/common/Header/Header.d.ts +3 -1
  106. package/dist/types/lib/SideNavigation/common/Header/Header.d.ts.map +1 -1
  107. package/dist/types/lib/SideNavigation/common/Item/Item.d.ts +8 -9
  108. package/dist/types/lib/SideNavigation/common/Item/Item.d.ts.map +1 -1
  109. package/dist/types/lib/SideNavigation/common/Item/types.d.ts +18 -7
  110. package/dist/types/lib/SideNavigation/common/Item/types.d.ts.map +1 -1
  111. package/dist/types/lib/SideNavigation/common/ItemButton/ItemButton.d.ts +17 -0
  112. package/dist/types/lib/SideNavigation/common/ItemButton/ItemButton.d.ts.map +1 -0
  113. package/dist/types/lib/SideNavigation/common/ItemButton/index.d.ts +3 -0
  114. package/dist/types/lib/SideNavigation/common/ItemButton/index.d.ts.map +1 -0
  115. package/dist/types/lib/SideNavigation/common/ItemButton/types.d.ts +17 -0
  116. package/dist/types/lib/SideNavigation/common/ItemButton/types.d.ts.map +1 -0
  117. package/dist/types/lib/SideNavigation/common/ItemExpandable/ItemExpandable.d.ts +26 -0
  118. package/dist/types/lib/SideNavigation/common/ItemExpandable/ItemExpandable.d.ts.map +1 -0
  119. package/dist/types/lib/SideNavigation/common/ItemExpandable/index.d.ts +3 -0
  120. package/dist/types/lib/SideNavigation/common/ItemExpandable/index.d.ts.map +1 -0
  121. package/dist/types/lib/SideNavigation/common/ItemExpandable/types.d.ts +32 -0
  122. package/dist/types/lib/SideNavigation/common/ItemExpandable/types.d.ts.map +1 -0
  123. package/dist/types/lib/SideNavigation/common/NavTree/NavTree.d.ts +12 -13
  124. package/dist/types/lib/SideNavigation/common/NavTree/NavTree.d.ts.map +1 -1
  125. package/dist/types/lib/SideNavigation/common/NavTree/types.d.ts +7 -5
  126. package/dist/types/lib/SideNavigation/common/NavTree/types.d.ts.map +1 -1
  127. package/dist/types/lib/SideNavigation/common/index.d.ts +5 -0
  128. package/dist/types/lib/SideNavigation/common/index.d.ts.map +1 -1
  129. package/dist/types/lib/SideNavigation/helpItem.d.ts +20 -0
  130. package/dist/types/lib/SideNavigation/helpItem.d.ts.map +1 -0
  131. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/index.d.ts +3 -0
  132. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/index.d.ts.map +1 -0
  133. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/types.d.ts +14 -0
  134. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/types.d.ts.map +1 -0
  135. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.d.ts +14 -0
  136. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.d.ts.map +1 -0
  137. package/dist/types/lib/SideNavigation/index.d.ts +1 -0
  138. package/dist/types/lib/SideNavigation/index.d.ts.map +1 -1
  139. package/dist/types/lib/SideNavigation/types.d.ts +168 -24
  140. package/dist/types/lib/SideNavigation/types.d.ts.map +1 -1
  141. package/dist/types/lib/ViewLayout/ViewLayout.d.ts.map +1 -1
  142. package/package.json +22 -22
@@ -1,28 +1,281 @@
1
1
  /* Generated by @canonical/summon-component:react v0.1.0
2
2
  * Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
3
-
4
3
  @layer ds.components.apps {
4
+ :root {
5
+ /* ── Rail ───────────────────────────────────────────────────────── */
6
+ /* 240px on all breakpoints ≥ small. */
7
+ --sidenav-rail-inline-size: 15rem;
8
+
9
+ /* Derived: logo width + one spacing unit
10
+ (--dimension-200, 1rem) on each side, with the logo horizontally
11
+ centred. */
12
+ --sidenav-rail-inline-size-collapsed: calc(
13
+ var(--sidenav-logo-inline-size) +
14
+ 2 *
15
+ var(--dimension-200)
16
+ );
17
+
18
+ /* ── Logo ───────────────────────────────────────────────────────── */
19
+ /* Deliberate deviation from the upstream 24.04 design's 2.25rem: this
20
+ ships 2.5rem (the design's own 1:2 aspect ratio kept, both sides
21
+ scaled). Width follows the same ratio: 1.25rem. */
22
+ --sidenav-logo-block-size: 2.5rem;
23
+ --sidenav-logo-inline-size: 1.25rem;
24
+
25
+ /* ── Row insets (Header + Item, shared so icons/logo/toggle line up) ─ */
26
+ /* 0.5rem from the left and the right (aligns with the collapse
27
+ toggle / context-switcher chevron beyond it). */
28
+ --sidenav-inset-inline: var(--dimension-100);
29
+ /* 0.5rem between a leading icon and its label. */
30
+ --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. */
35
+ --sidenav-icon-column-inline-size: 1.5rem;
36
+
37
+ /* ── 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. */
42
+ --sidenav-row-background: var(--color-foreground-navigation-primary);
43
+ --sidenav-row-background-hover: var(
44
+ --color-foreground-navigation-primary-hover
45
+ );
46
+ --sidenav-row-background-active: var(
47
+ --color-foreground-navigation-primary-active
48
+ );
49
+ --sidenav-row-background-disabled: var(
50
+ --color-foreground-navigation-primary-disabled
51
+ );
52
+
53
+ /* ── 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. */
57
+ --sidenav-popover-shadow: 0 0.25rem 0.5rem rgb(0 0 0 / 20%);
58
+ }
59
+
5
60
  .ds.side-navigation {
6
- /* Component styles */
61
+ box-sizing: border-box;
62
+ /* Skip-link's absolute overlay anchors to this box. */
63
+ position: relative;
7
64
  background: var(--color-foreground-navigation-primary);
8
65
  display: flex;
9
66
  flex-direction: column;
10
- /* Gap between Header / Content / Footer, in baseline units (2bU). */
11
- gap: calc(var(--space-baseline) * 2);
12
- /* Cap to the parent's height so the nav never overflows the screen; Header
13
- and Footer pin (flex auto) and Content (flex:1, min-height:0) takes the
14
- leftover space and scrolls internally.
15
- KNOWN (parked, see K.02): Content is flex:1, so it absorbs *leftover*
16
- height. If the nav's outer height isn't itself a whole baseline multiple,
17
- that leftover is fractional and the Footer can seat a sub-pixel off the
18
- grid. Not solved in this pass. */
19
- max-height: 100%;
20
-
21
- /* Shared row template: [start] [label/title] [end]. The Header and each Item
22
- row use this so the logo aligns with the item icons down the rail. The
23
- start column is a fixed width (3bU) matching the icon box; the logo sits in
24
- it. */
25
- --sidenav-start: calc(var(--space-baseline) * 3); /* 1.5rem — 3bU */
26
- --sidenav-row-columns: var(--sidenav-start) 1fr auto;
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
+ gap: var(--dimension-100); /* 0.5rem */
73
+
74
+ inline-size: var(--sidenav-rail-inline-size);
75
+ padding-inline: var(--sidenav-inset-inline); /* 0.5rem */
76
+ flex-shrink: 0;
77
+
78
+ /* The nav spans the full viewport height. Content (flex:1, min-height:0)
79
+ absorbs the remainder and scrolls internally so Footer stays pinned
80
+ to the bottom. */
81
+ block-size: 100%;
82
+
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. */
87
+ --overflow-gradient-height: 1.75rem;
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. */
99
+
100
+ transition:
101
+ width var(--motion-duration-medium) ease-in-out,
102
+ inline-size var(--motion-duration-medium) ease-in-out;
103
+
104
+ /* Skip navigation — visually hidden until keyboard focus, then it
105
+ overlays the rail so keyboard users can bypass the block. */
106
+
107
+ & .skip-link {
108
+ position: absolute;
109
+ inset-block-start: 0;
110
+ inset-inline-start: 0;
111
+ z-index: var(--z-index-overlay, 100);
112
+
113
+ width: 1px;
114
+ height: 1px;
115
+ margin: -1px;
116
+ padding: 0;
117
+ overflow: hidden;
118
+ clip-path: inset(50%);
119
+ white-space: nowrap;
120
+
121
+ &:focus {
122
+ width: auto;
123
+ height: auto;
124
+ margin: 0;
125
+ padding: var(--dimension-100) var(--dimension-200);
126
+ overflow: visible;
127
+ clip-path: none;
128
+ white-space: normal;
129
+
130
+ color: var(--color-text-default, #111);
131
+ background: var(--color-background-default, #fff);
132
+ }
133
+ }
134
+
135
+ &[data-expanded="false"] {
136
+ inline-size: var(--sidenav-rail-inline-size-collapsed);
137
+ justify-content: space-between;
138
+
139
+ & > .ds.content {
140
+ display: none;
141
+ }
142
+
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 {
147
+ display: none;
148
+ }
149
+
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
+ }
247
+ }
248
+
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. */
255
+ @media (width < 620px) {
256
+ inline-size: 100%;
257
+ flex-shrink: 1;
258
+ block-size: auto;
259
+
260
+ /* :not() form — a consumer shell that omits the attribute defaults
261
+ open, matching the desktop rule's semantics. */
262
+ &:not([data-expanded="false"]) {
263
+ position: fixed;
264
+ inset: 0;
265
+ z-index: var(--z-index-overlay, 100);
266
+ inline-size: 100%;
267
+ block-size: 100dvh;
268
+ }
269
+
270
+ &[data-expanded="false"] {
271
+ inline-size: 100%;
272
+
273
+ /* Overrides the desktop collapsed rule above: the body is hidden
274
+ entirely on mobile, not shown icon-only. */
275
+ & > .ds.footer {
276
+ display: none;
277
+ }
278
+ }
279
+ }
27
280
  }
28
281
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationLayout.d.ts","sourceRoot":"","sources":["../../../../src/lib/ApplicationLayout/ApplicationLayout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,cAAc,CAAC;AAItB;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,GAAI,+CAKxB,sBAAsB,KAAG,KAAK,CAAC,YAUjC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"ApplicationLayout.d.ts","sourceRoot":"","sources":["../../../../src/lib/ApplicationLayout/ApplicationLayout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,cAAc,CAAC;AAItB;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,kDAKpB,sBAAsB,KAAG,KAAK,CAAC,YAUjC,CAAC;eAEa,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContentLayout.d.ts","sourceRoot":"","sources":["../../../../src/lib/ContentLayout/ContentLayout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,cAAc,CAAC;AAItB;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,GAAI,yCAKpB,kBAAkB,KAAG,KAAK,CAAC,YAW7B,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ContentLayout.d.ts","sourceRoot":"","sources":["../../../../src/lib/ContentLayout/ContentLayout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,cAAc,CAAC;AAItB;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,4CAKhB,kBAAkB,KAAG,KAAK,CAAC,YAW7B,CAAC;eAEa,aAAa"}
@@ -4,7 +4,7 @@ import type { ComponentProps, ReactNode } from "react";
4
4
  * The grid preset laying out the content items — `GridPreset` from
5
5
  * \@canonical/ds-types, rendered by the `.grid` presets in
6
6
  * \@canonical/styles: `responsive` (fixed-responsive, breakpoint-driven
7
- * 4/8/12 columns) or `intrinsic` (fluid auto-fill groups of four
7
+ * 4/8/16 columns) or `intrinsic` (fluid auto-fill groups of four
8
8
  * `minmax(--grid-col-min, 1fr)` columns).
9
9
  */
10
10
  export type ContentLayoutGrid = GridPreset;
@@ -7,12 +7,33 @@ import "./styles.css";
7
7
  * `defaultExpanded` — and wires the header's collapse toggle to the content
8
8
  * region it controls.
9
9
  *
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),
14
+ * Content (the main `<nav>` landmark) and Footer (user profile, settings
15
+ * and non-navigational actions). The root element is a plain `<div>` and
16
+ * the component's single *navigation* landmark is Content's `<nav>`, so
17
+ * screen readers announce exactly one navigation region; the regions
18
+ * themselves are `<header>`/`<footer>` elements, which additionally
19
+ * expose banner/contentinfo landmarks. `aria-label` is forwarded to the
20
+ * `<nav>` and defaults to `"Main navigation"`.
21
+ *
22
+ * A visually hidden "Skip to main content" link is the first element in the
23
+ * component's DOM order, so keyboard users can bypass the navigation block;
24
+ * target it with `skipTo` (default `"#main-content"`).
25
+ *
10
26
  * Routing-agnostic: navigable items render via `LinkComponent` (default `"a"`);
11
27
  * pass a router `Link` to integrate client-side navigation. The active item is
12
28
  * resolved from `currentUrl`.
13
29
  *
30
+ * Consumption pattern: data-driven only. Pass props and all four regions
31
+ * build; row-level and region components are private
32
+ * (`cs:react.component.subcomponent_export_api` — no dot-static exports),
33
+ * and render exclusively from data.
34
+ *
14
35
  * @implements ds:apps.pattern.side-navigation
15
36
  */
16
- declare const SideNavigation: ({ className, brand, applicationName, root, footerRoot, LinkComponent, currentUrl, defaultExpanded, ...props }: SideNavigationProps) => React.ReactElement;
37
+ declare const SideNavigation: ({ className, brand, applicationName, root, contextSwitcher, footerRoot, LinkComponent, currentUrl, skipTo, defaultExpanded: defaultExpandedProp, keyboardShortcut, "aria-label": ariaLabel, ...props }: SideNavigationProps) => React.ReactElement;
17
38
  export default SideNavigation;
18
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;AAG/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,cAAc,GAAI,+GAarB,mBAAmB,KAAG,KAAK,CAAC,YAoD9B,CAAC;AAEF,eAAe,cAAc,CAAC"}
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"}
@@ -5,10 +5,17 @@ import "./styles.css";
5
5
  * SideNavigation.CollapseToggle — icon-only button that expands or collapses
6
6
  * the navigation rail. Carries the disclosure ARIA contract: `aria-expanded`
7
7
  * reflects the current state and `aria-controls` should point at the id of the
8
- * navigation region it toggles.
8
+ * navigation region it toggles. Hovering for 1s shows a tooltip naming the
9
+ * action ("Collapse"/"Expand"); the `<button>`'s own
10
+ * `aria-label` carries the fuller "Collapse/Expand navigation" text.
11
+ *
12
+ * Rendered through `TooltipEngine` (not `withTooltip`) so the tooltip's
13
+ * message follows the `expanded` prop as a live prop: one stable element
14
+ * type across state changes, so the button — and with it keyboard focus
15
+ * and hover state — survives every toggle instead of remounting.
9
16
  *
10
17
  * @implements ds:apps.subcomponent.side-navigation-collapse-toggle
11
18
  */
12
- declare const CollapseToggle: ({ className, expanded, "aria-label": ariaLabel, ...props }: CollapseToggleProps) => React.ReactElement;
19
+ declare const CollapseToggle: ({ expanded, ...props }: CollapseToggleProps) => React.ReactElement;
13
20
  export default CollapseToggle;
14
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;AAItB;;;;;;;GAOG;AACH,QAAA,MAAM,cAAc,GAAI,4DAKrB,mBAAmB,KAAG,KAAK,CAAC,YAc9B,CAAC;AAEF,eAAe,cAAc,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;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"}
@@ -6,6 +6,11 @@ type OwnProps = {
6
6
  */
7
7
  expanded?: boolean;
8
8
  };
9
- export type CollapseToggleProps = OwnProps & Omit<ComponentProps<"button">, keyof OwnProps>;
9
+ /**
10
+ * `type` is excluded in addition to `OwnProps`: this is always a disclosure
11
+ * trigger, never a form submit/reset control, so the DS fixes it to
12
+ * `"button"` rather than exposing it.
13
+ */
14
+ export type CollapseToggleProps = OwnProps & Omit<ComponentProps<"button">, keyof OwnProps | "type">;
10
15
  export {};
11
16
  //# sourceMappingURL=types.d.ts.map
@@ -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,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GACxC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,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,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"}
@@ -2,12 +2,16 @@ import type React from "react";
2
2
  import type { ContentProps } from "./types.js";
3
3
  import "./styles.css";
4
4
  /**
5
- * SideNavigation.Content — main navigation region. Renders the direct children
6
- * of its `root` Item via useNavigationTree (selection, active state, keyboard
7
- * traversal). Falls back to `children` when no `root` is given.
5
+ * SideNavigation.Content — the component's main `<nav>` landmark, and the
6
+ * only one: navigation rows are links and expandable items exclusively
7
+ * (actions are Footer's job). Data-only — rows render exclusively from the
8
+ * `root` tree (row components are private; there is no children escape
9
+ * hatch into the landmark). `aria-label` defaults to `"Main navigation"`
10
+ * and may be overridden by the consumer; with no `root`, the landmark
11
+ * renders empty (the landmark contract stays stable).
8
12
  *
9
13
  * @implements ds:apps.subcomponent.side-navigation-content
10
14
  */
11
- declare const Content: ({ className, root, LinkComponent, currentUrl, children, ...props }: ContentProps) => React.ReactElement;
15
+ declare const Content: ({ className, root, LinkComponent, currentUrl, ...props }: ContentProps) => React.ReactElement;
12
16
  export default Content;
13
17
  //# sourceMappingURL=Content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,cAAc,CAAC;AAItB;;;;;;GAMG;AACH,QAAA,MAAM,OAAO,GAAI,oEAOd,YAAY,KAAG,KAAK,CAAC,YAiBvB,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,cAAc,CAAC;AAItB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,OAAO,6DAMV,YAAY,KAAG,KAAK,CAAC,YAevB,CAAC;eAEa,OAAO"}
@@ -1,16 +1,13 @@
1
- import type { Item as NavItem } from "@canonical/ds-types";
2
- import type { ComponentProps, ComponentType, ReactNode } from "react";
3
- import type { LinkComponentProps } from "../../types.js";
1
+ import type { ComponentProps, ComponentType } from "react";
2
+ import type { LinkComponentProps, NavRoot } from "../../types.js";
4
3
  type OwnProps = {
5
- /** Root item whose direct children are rendered as the nav item list. */
6
- root?: NavItem;
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). */
5
+ root?: NavRoot;
7
6
  /** Component used to render navigable items. Defaults to `"a"`. */
8
7
  LinkComponent?: ComponentType<LinkComponentProps> | "a";
9
8
  /** Live current location; resolves and keeps the active item in sync. */
10
9
  currentUrl?: string;
11
- /** Fallback content when no `root` is provided. */
12
- children?: ReactNode;
13
10
  };
14
- export type ContentProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
11
+ export type ContentProps = OwnProps & Omit<ComponentProps<"nav">, keyof OwnProps>;
15
12
  export {};
16
13
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Content/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,KAAK,QAAQ,GAAG;IACd,yEAAyE;IACzE,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;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,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,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"}
@@ -0,0 +1,20 @@
1
+ import type React from "react";
2
+ import type { ContextSwitcherProps } from "./types.js";
3
+ import "./styles.css";
4
+ /**
5
+ * SideNavigation.ContextSwitcher — a dropdown for products that divide
6
+ * into contexts, projects, users, or similar. Renders via
7
+ * `ContextualMenu`: a real `<button>` trigger
8
+ * (`aria-haspopup="menu"`/`aria-expanded`) and a `role="menu"` popup with
9
+ * full roving-focus keyboard navigation. `title`, when given, renders via
10
+ * `SideNavigation.GroupHeader` as a sibling above the dropdown field.
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.
15
+ *
16
+ * @implements ds:apps.subcomponent.side-navigation-context-switcher
17
+ */
18
+ declare const ContextSwitcher: ({ title, currentContext, contexts, onContextChange, onCreateContext, createContextLabel, className, open, onOpenChange, preferredDirections, distance, gutter, maxWidth, autoFit, ...props }: ContextSwitcherProps) => React.ReactElement;
19
+ export default ContextSwitcher;
20
+ //# sourceMappingURL=ContextSwitcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextSwitcher.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAuB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,cAAc,CAAC;AAmDtB;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,eAAe,iMAgBlB,oBAAoB,KAAG,KAAK,CAAC,YAkE/B,CAAC;eAEa,eAAe"}
@@ -0,0 +1,3 @@
1
+ export { default as ContextSwitcher } from "./ContextSwitcher.js";
2
+ export type * from "./types.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ContextSwitcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,mBAAmB,YAAY,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type { ContextualMenuProps } from "@canonical/react-ds-global";
2
+ import type { ComponentProps, ReactNode } from "react";
3
+ /** A single entry in the context switcher's list — user-generated. */
4
+ export interface ContextSwitcherItem {
5
+ /** Stable identity for the context (list key and selection matching). */
6
+ key: string;
7
+ /** Display name — also shown in the dropdown field when current. */
8
+ name: string;
9
+ /**
10
+ * Optional route for the context. No render target for a
11
+ * `LinkComponent` exists inside a `role="menu"` (every row is a
12
+ * `<div role="menuitem">`), so when given the url rides through
13
+ * `onContextChange` and the consumer routes with their own router.
14
+ * Omitted, the context stays a pure action.
15
+ */
16
+ url?: string;
17
+ /** Optional supporting text shown under the name in the list. */
18
+ description?: string;
19
+ /** Optional badge for dynamic/actionable information. */
20
+ badge?: ReactNode;
21
+ }
22
+ type OwnProps = Pick<ContextualMenuProps, "open" | "onOpenChange" | "preferredDirections" | "distance" | "gutter" | "maxWidth" | "autoFit"> & {
23
+ /**
24
+ * A caption rendered above the dropdown field (e.g. "Context") via
25
+ * `SideNavigation.GroupHeader` — intrinsic to the component in the Figma
26
+ * source, not a consumer composition. Omitted renders no caption.
27
+ */
28
+ title?: ReactNode;
29
+ /** The currently selected context, shown in the dropdown field. */
30
+ currentContext: ContextSwitcherItem;
31
+ /** The user-generated list of available contexts. */
32
+ contexts: ContextSwitcherItem[];
33
+ /** Called when the user selects a different context from the list. */
34
+ onContextChange?: (context: ContextSwitcherItem) => void;
35
+ /** Called when the "create context" action is activated. Omit to hide it. */
36
+ onCreateContext?: () => void;
37
+ /** Label for the "create context" action. Defaults to `"Create context"`. */
38
+ createContextLabel?: ReactNode;
39
+ };
40
+ /**
41
+ * Renders via `ContextualMenu` — a real `<button>` trigger with
42
+ * `aria-haspopup="menu"`/`aria-expanded`, and a `role="menu"` popup with
43
+ * full roving-focus keyboard navigation — a "select"-like widget, not a
44
+ * bare disclosure. Extends `<div>` — the component's own wrapper, which
45
+ * carries the caption (`title`) and the dropdown field. `onSelect` — a
46
+ * native `<div>` text-selection event — is excluded: it would collide with
47
+ * this component's own item-selection callback (`onContextChange`) under
48
+ * one name with two incompatible signatures.
49
+ */
50
+ export type ContextSwitcherProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps | "onSelect">;
51
+ export {};
52
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/ContextSwitcher/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,sEAAsE;AACtE,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,KAAK,QAAQ,GAAG,IAAI,CAClB,mBAAmB,EACjB,MAAM,GACN,cAAc,GACd,qBAAqB,GACrB,UAAU,GACV,QAAQ,GACR,UAAU,GACV,SAAS,CACZ,GAAG;IACF;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mEAAmE;IACnE,cAAc,EAAE,mBAAmB,CAAC;IACpC,qDAAqD;IACrD,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,sEAAsE;IACtE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACzD,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,SAAS,CAAC;CAChC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GACzC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC"}
@@ -2,12 +2,16 @@ import type React from "react";
2
2
  import type { FooterProps } from "./types.js";
3
3
  import "./styles.css";
4
4
  /**
5
- * SideNavigation.Footer — optional region pinned to the bottom, holding
6
- * account-level or global actions. Drives its own useNavigationTree over its
7
- * `root` (independent of Content). Falls back to `children` when no `root`.
5
+ * SideNavigation.Footer — optional region pinned to the bottom, reserved
6
+ * for user-related content. Data-only: `root` is the footer's only data
7
+ * surface — free-form leaves (`LeafFooterItem`, buttons via
8
+ * `control`/`onClick`) and depth-1 expandables (`ExpandableFooterItem`,
9
+ * whose children disclose through the same native `<details>` disclosure
10
+ * the content tree uses). A certificate-user application, for instance,
11
+ * composes the `certificate` icon and omits the logout item itself.
8
12
  *
9
13
  * @implements ds:apps.subcomponent.side-navigation-footer
10
14
  */
11
- declare const Footer: ({ className, root, LinkComponent, currentUrl, children, ...props }: FooterProps) => React.ReactElement;
15
+ declare const Footer: ({ className, root, LinkComponent, currentUrl, ...props }: FooterProps) => React.ReactElement;
12
16
  export default Footer;
13
17
  //# sourceMappingURL=Footer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,cAAc,CAAC;AAItB;;;;;;GAMG;AACH,QAAA,MAAM,MAAM,GAAI,oEAOb,WAAW,KAAG,KAAK,CAAC,YAiBtB,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,cAAc,CAAC;AA6DtB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,6DAMT,WAAW,KAAG,KAAK,CAAC,YAwCtB,CAAC;eAEa,MAAM"}
@@ -1,15 +1,12 @@
1
- import type { Item as NavItem } from "@canonical/ds-types";
2
- import type { ComponentProps, ComponentType, ReactNode } from "react";
3
- import type { LinkComponentProps } from "../../types.js";
1
+ import type { ComponentProps, ComponentType } from "react";
2
+ import type { FooterRoot, LinkComponentProps } from "../../types.js";
4
3
  type OwnProps = {
5
- /** Root item whose direct children are rendered as the footer nav list. */
6
- root?: NavItem;
4
+ /** The footer's items — the footer's only data surface. See FooterRoot. */
5
+ root?: FooterRoot;
7
6
  /** Component used to render navigable items. Defaults to `"a"`. */
8
7
  LinkComponent?: ComponentType<LinkComponentProps> | "a";
9
- /** Live current location; resolves and keeps the active item in sync. */
8
+ /** Live current location; resolves the active row and seeds expandables. */
10
9
  currentUrl?: string;
11
- /** Fallback content when no `root` is provided. */
12
- children?: ReactNode;
13
10
  };
14
11
  export type FooterProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
15
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,KAAK,QAAQ,GAAG;IACd,2EAA2E;IAC3E,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;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAChC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAErE,KAAK,QAAQ,GAAG;IACd,2EAA2E;IAC3E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAChC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type React from "react";
2
+ import type { GroupProps } from "./types.js";
3
+ import "./styles.css";
4
+ /**
5
+ * SideNavigation.Group — a named collection of navigation entries, with an
6
+ * optional SideNavigation.GroupHeader. One of NavTree's direct content
7
+ * entries.
8
+ *
9
+ * @implements ds:apps.subcomponent.side-navigation-group
10
+ */
11
+ declare const Group: ({ label, children, className, ...props }: GroupProps) => React.ReactElement;
12
+ export default Group;
13
+ //# sourceMappingURL=Group.d.ts.map