@canonical/react-ds-app 0.37.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +30 -0
  2. package/dist/esm/lib/ApplicationLayout/styles.css +27 -24
  3. package/dist/esm/lib/ContentLayout/styles.css +13 -10
  4. package/dist/esm/lib/SideNavigation/SideNavigation.js +51 -9
  5. package/dist/esm/lib/SideNavigation/SideNavigation.js.map +1 -1
  6. package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js +14 -6
  7. package/dist/esm/lib/SideNavigation/common/CollapseToggle/CollapseToggle.js.map +1 -1
  8. package/dist/esm/lib/SideNavigation/common/CollapseToggle/styles.css +52 -3
  9. package/dist/esm/lib/SideNavigation/common/Content/Content.js +9 -5
  10. package/dist/esm/lib/SideNavigation/common/Content/Content.js.map +1 -1
  11. package/dist/esm/lib/SideNavigation/common/Content/styles.css +55 -28
  12. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.js +70 -0
  13. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.js.map +1 -0
  14. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/index.js +2 -0
  15. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/index.js.map +1 -0
  16. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/styles.css +94 -0
  17. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/types.js +2 -0
  18. package/dist/esm/lib/SideNavigation/common/ContextSwitcher/types.js.map +1 -0
  19. package/dist/esm/lib/SideNavigation/common/Footer/Footer.js +46 -6
  20. package/dist/esm/lib/SideNavigation/common/Footer/Footer.js.map +1 -1
  21. package/dist/esm/lib/SideNavigation/common/Footer/styles.css +17 -4
  22. package/dist/esm/lib/SideNavigation/common/Group/Group.js +14 -0
  23. package/dist/esm/lib/SideNavigation/common/Group/Group.js.map +1 -0
  24. package/dist/esm/lib/SideNavigation/common/Group/index.js +2 -0
  25. package/dist/esm/lib/SideNavigation/common/Group/index.js.map +1 -0
  26. package/dist/esm/lib/SideNavigation/common/Group/styles.css +18 -0
  27. package/dist/esm/lib/SideNavigation/common/Group/types.js +2 -0
  28. package/dist/esm/lib/SideNavigation/common/Group/types.js.map +1 -0
  29. package/dist/esm/lib/SideNavigation/common/GroupHeader/GroupHeader.js +17 -0
  30. package/dist/esm/lib/SideNavigation/common/GroupHeader/GroupHeader.js.map +1 -0
  31. package/dist/esm/lib/SideNavigation/common/GroupHeader/index.js +2 -0
  32. package/dist/esm/lib/SideNavigation/common/GroupHeader/index.js.map +1 -0
  33. package/dist/esm/lib/SideNavigation/common/GroupHeader/styles.css +31 -0
  34. package/dist/esm/lib/SideNavigation/common/GroupHeader/types.js +2 -0
  35. package/dist/esm/lib/SideNavigation/common/GroupHeader/types.js.map +1 -0
  36. package/dist/esm/lib/SideNavigation/common/Header/Header.js +4 -2
  37. package/dist/esm/lib/SideNavigation/common/Header/Header.js.map +1 -1
  38. package/dist/esm/lib/SideNavigation/common/Header/styles.css +73 -32
  39. package/dist/esm/lib/SideNavigation/common/Item/Item.js +9 -13
  40. package/dist/esm/lib/SideNavigation/common/Item/Item.js.map +1 -1
  41. package/dist/esm/lib/SideNavigation/common/Item/styles.css +86 -46
  42. package/dist/esm/lib/SideNavigation/common/ItemButton/ItemButton.js +18 -0
  43. package/dist/esm/lib/SideNavigation/common/ItemButton/ItemButton.js.map +1 -0
  44. package/dist/esm/lib/SideNavigation/common/ItemButton/index.js +2 -0
  45. package/dist/esm/lib/SideNavigation/common/ItemButton/index.js.map +1 -0
  46. package/dist/esm/lib/SideNavigation/common/ItemButton/styles.css +79 -0
  47. package/dist/esm/lib/SideNavigation/common/ItemButton/types.js +2 -0
  48. package/dist/esm/lib/SideNavigation/common/ItemButton/types.js.map +1 -0
  49. package/dist/esm/lib/SideNavigation/common/ItemExpandable/ItemExpandable.js +71 -0
  50. package/dist/esm/lib/SideNavigation/common/ItemExpandable/ItemExpandable.js.map +1 -0
  51. package/dist/esm/lib/SideNavigation/common/ItemExpandable/index.js +2 -0
  52. package/dist/esm/lib/SideNavigation/common/ItemExpandable/index.js.map +1 -0
  53. package/dist/esm/lib/SideNavigation/common/ItemExpandable/styles.css +121 -0
  54. package/dist/esm/lib/SideNavigation/common/ItemExpandable/types.js +2 -0
  55. package/dist/esm/lib/SideNavigation/common/ItemExpandable/types.js.map +1 -0
  56. package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js +64 -22
  57. package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js.map +1 -1
  58. package/dist/esm/lib/SideNavigation/common/NavTree/styles.css +10 -28
  59. package/dist/esm/lib/SideNavigation/common/index.js +5 -0
  60. package/dist/esm/lib/SideNavigation/common/index.js.map +1 -1
  61. package/dist/esm/lib/SideNavigation/helpItem.js +29 -0
  62. package/dist/esm/lib/SideNavigation/helpItem.js.map +1 -0
  63. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/index.js +2 -0
  64. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/index.js.map +1 -0
  65. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/types.js +2 -0
  66. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/types.js.map +1 -0
  67. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.js +45 -0
  68. package/dist/esm/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.js.map +1 -0
  69. package/dist/esm/lib/SideNavigation/index.js +1 -0
  70. package/dist/esm/lib/SideNavigation/index.js.map +1 -1
  71. package/dist/esm/lib/SideNavigation/styles.css +280 -24
  72. package/dist/esm/lib/ViewLayout/styles.css +25 -22
  73. package/dist/types/lib/ApplicationLayout/types.d.ts +5 -3
  74. package/dist/types/lib/ApplicationLayout/types.d.ts.map +1 -1
  75. package/dist/types/lib/ContentLayout/types.d.ts +5 -3
  76. package/dist/types/lib/ContentLayout/types.d.ts.map +1 -1
  77. package/dist/types/lib/SideNavigation/SideNavigation.d.ts +22 -1
  78. package/dist/types/lib/SideNavigation/SideNavigation.d.ts.map +1 -1
  79. package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts +9 -2
  80. package/dist/types/lib/SideNavigation/common/CollapseToggle/CollapseToggle.d.ts.map +1 -1
  81. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts +10 -3
  82. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts.map +1 -1
  83. package/dist/types/lib/SideNavigation/common/Content/Content.d.ts +8 -4
  84. package/dist/types/lib/SideNavigation/common/Content/Content.d.ts.map +1 -1
  85. package/dist/types/lib/SideNavigation/common/Content/types.d.ts +8 -9
  86. package/dist/types/lib/SideNavigation/common/Content/types.d.ts.map +1 -1
  87. package/dist/types/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.d.ts +20 -0
  88. package/dist/types/lib/SideNavigation/common/ContextSwitcher/ContextSwitcher.d.ts.map +1 -0
  89. package/dist/types/lib/SideNavigation/common/ContextSwitcher/index.d.ts +3 -0
  90. package/dist/types/lib/SideNavigation/common/ContextSwitcher/index.d.ts.map +1 -0
  91. package/dist/types/lib/SideNavigation/common/ContextSwitcher/types.d.ts +52 -0
  92. package/dist/types/lib/SideNavigation/common/ContextSwitcher/types.d.ts.map +1 -0
  93. package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts +8 -4
  94. package/dist/types/lib/SideNavigation/common/Footer/Footer.d.ts.map +1 -1
  95. package/dist/types/lib/SideNavigation/common/Footer/types.d.ts +9 -10
  96. package/dist/types/lib/SideNavigation/common/Footer/types.d.ts.map +1 -1
  97. package/dist/types/lib/SideNavigation/common/Group/Group.d.ts +13 -0
  98. package/dist/types/lib/SideNavigation/common/Group/Group.d.ts.map +1 -0
  99. package/dist/types/lib/SideNavigation/common/Group/index.d.ts +3 -0
  100. package/dist/types/lib/SideNavigation/common/Group/index.d.ts.map +1 -0
  101. package/dist/types/lib/SideNavigation/common/Group/types.d.ts +10 -0
  102. package/dist/types/lib/SideNavigation/common/Group/types.d.ts.map +1 -0
  103. package/dist/types/lib/SideNavigation/common/GroupHeader/GroupHeader.d.ts +13 -0
  104. package/dist/types/lib/SideNavigation/common/GroupHeader/GroupHeader.d.ts.map +1 -0
  105. package/dist/types/lib/SideNavigation/common/GroupHeader/index.d.ts +3 -0
  106. package/dist/types/lib/SideNavigation/common/GroupHeader/index.d.ts.map +1 -0
  107. package/dist/types/lib/SideNavigation/common/GroupHeader/types.d.ts +8 -0
  108. package/dist/types/lib/SideNavigation/common/GroupHeader/types.d.ts.map +1 -0
  109. package/dist/types/lib/SideNavigation/common/Header/Header.d.ts +3 -1
  110. package/dist/types/lib/SideNavigation/common/Header/Header.d.ts.map +1 -1
  111. package/dist/types/lib/SideNavigation/common/Header/types.d.ts +5 -3
  112. package/dist/types/lib/SideNavigation/common/Header/types.d.ts.map +1 -1
  113. package/dist/types/lib/SideNavigation/common/Item/Item.d.ts +8 -9
  114. package/dist/types/lib/SideNavigation/common/Item/Item.d.ts.map +1 -1
  115. package/dist/types/lib/SideNavigation/common/Item/types.d.ts +19 -8
  116. package/dist/types/lib/SideNavigation/common/Item/types.d.ts.map +1 -1
  117. package/dist/types/lib/SideNavigation/common/ItemButton/ItemButton.d.ts +17 -0
  118. package/dist/types/lib/SideNavigation/common/ItemButton/ItemButton.d.ts.map +1 -0
  119. package/dist/types/lib/SideNavigation/common/ItemButton/index.d.ts +3 -0
  120. package/dist/types/lib/SideNavigation/common/ItemButton/index.d.ts.map +1 -0
  121. package/dist/types/lib/SideNavigation/common/ItemButton/types.d.ts +17 -0
  122. package/dist/types/lib/SideNavigation/common/ItemButton/types.d.ts.map +1 -0
  123. package/dist/types/lib/SideNavigation/common/ItemExpandable/ItemExpandable.d.ts +26 -0
  124. package/dist/types/lib/SideNavigation/common/ItemExpandable/ItemExpandable.d.ts.map +1 -0
  125. package/dist/types/lib/SideNavigation/common/ItemExpandable/index.d.ts +3 -0
  126. package/dist/types/lib/SideNavigation/common/ItemExpandable/index.d.ts.map +1 -0
  127. package/dist/types/lib/SideNavigation/common/ItemExpandable/types.d.ts +32 -0
  128. package/dist/types/lib/SideNavigation/common/ItemExpandable/types.d.ts.map +1 -0
  129. package/dist/types/lib/SideNavigation/common/NavTree/NavTree.d.ts +12 -13
  130. package/dist/types/lib/SideNavigation/common/NavTree/NavTree.d.ts.map +1 -1
  131. package/dist/types/lib/SideNavigation/common/NavTree/types.d.ts +7 -5
  132. package/dist/types/lib/SideNavigation/common/NavTree/types.d.ts.map +1 -1
  133. package/dist/types/lib/SideNavigation/common/index.d.ts +5 -0
  134. package/dist/types/lib/SideNavigation/common/index.d.ts.map +1 -1
  135. package/dist/types/lib/SideNavigation/helpItem.d.ts +20 -0
  136. package/dist/types/lib/SideNavigation/helpItem.d.ts.map +1 -0
  137. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/index.d.ts +3 -0
  138. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/index.d.ts.map +1 -0
  139. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/types.d.ts +14 -0
  140. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/types.d.ts.map +1 -0
  141. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.d.ts +14 -0
  142. package/dist/types/lib/SideNavigation/hooks/useCollapseShortcut/useCollapseShortcut.d.ts.map +1 -0
  143. package/dist/types/lib/SideNavigation/index.d.ts +1 -0
  144. package/dist/types/lib/SideNavigation/index.d.ts.map +1 -1
  145. package/dist/types/lib/SideNavigation/types.d.ts +172 -27
  146. package/dist/types/lib/SideNavigation/types.d.ts.map +1 -1
  147. package/dist/types/lib/ViewLayout/types.d.ts +5 -3
  148. package/dist/types/lib/ViewLayout/types.d.ts.map +1 -1
  149. package/package.json +20 -20
@@ -1,25 +1,281 @@
1
- /* Generated by @canonical/summon-component:react v0.1.0 */
2
-
3
- .ds.side-navigation {
4
- /* Component styles */
5
- background: var(--color-foreground-navigation-primary);
6
- display: flex;
7
- flex-direction: column;
8
- /* Gap between Header / Content / Footer, in baseline units (2bU). */
9
- gap: calc(var(--space-baseline) * 2);
10
- /* Cap to the parent's height so the nav never overflows the screen; Header
11
- and Footer pin (flex auto) and Content (flex:1, min-height:0) takes the
12
- leftover space and scrolls internally.
13
- KNOWN (parked, see K.02): Content is flex:1, so it absorbs *leftover*
14
- height. If the nav's outer height isn't itself a whole baseline multiple,
15
- that leftover is fractional and the Footer can seat a sub-pixel off the
16
- grid. Not solved in this pass. */
17
- max-height: 100%;
18
-
19
- /* Shared row template: [start] [label/title] [end]. The Header and each Item
20
- row use this so the logo aligns with the item icons down the rail. The
21
- start column is a fixed width (3bU) matching the icon box; the logo sits in
22
- it. */
23
- --sidenav-start: calc(var(--space-baseline) * 3); /* 1.5rem — 3bU */
24
- --sidenav-row-columns: var(--sidenav-start) 1fr auto;
1
+ /* Generated by @canonical/summon-component:react v0.1.0
2
+ * Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
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
+
60
+ .ds.side-navigation {
61
+ box-sizing: border-box;
62
+ /* Skip-link's absolute overlay anchors to this box. */
63
+ position: relative;
64
+ background: var(--color-foreground-navigation-primary);
65
+ display: flex;
66
+ 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
+ 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
+ }
280
+ }
25
281
  }
@@ -1,27 +1,30 @@
1
- /* Generated by @canonical/summon-component:react v0.1.0 */
1
+ /* Generated by @canonical/summon-component:react v0.1.0
2
+ * Layer: ds.components.apps (@canonical/styles README, "Cascade layers"). */
2
3
 
3
- .ds.view-layout {
4
- /* View: content (1fr) + contextual aside (min-content), per the ontology
5
- instance apps.layout.view_layout. */
6
- display: grid;
7
- grid-template-columns: 1fr min-content;
8
- gap: var(--view-layout-gap, var(--container-gap-default, 1rem));
9
- block-size: 100%;
10
- }
4
+ @layer ds.components.apps {
5
+ .ds.view-layout {
6
+ /* View: content (1fr) + contextual aside (min-content), per the ontology
7
+ instance apps.layout.view_layout. */
8
+ display: grid;
9
+ grid-template-columns: 1fr min-content;
10
+ gap: var(--view-layout-gap, var(--container-gap-default, 1rem));
11
+ block-size: 100%;
12
+ }
11
13
 
12
- /* Without an aside slot, drop the trailing column entirely so neither the
13
- empty track nor the gap offsets the content. */
14
- .ds.view-layout:not(:has(> .aside)) {
15
- grid-template-columns: 1fr;
16
- }
14
+ /* Without an aside slot, drop the trailing column entirely so neither the
15
+ empty track nor the gap offsets the content. */
16
+ .ds.view-layout:not(:has(> .aside)) {
17
+ grid-template-columns: 1fr;
18
+ }
17
19
 
18
- /* min-size 0 lets each region scroll internally instead of stretching the
19
- view. The aside slot owns its inline size. */
20
- .ds.view-layout > .content {
21
- min-block-size: 0;
22
- min-inline-size: 0;
23
- }
20
+ /* min-size 0 lets each region scroll internally instead of stretching the
21
+ view. The aside slot owns its inline size. */
22
+ .ds.view-layout > .content {
23
+ min-block-size: 0;
24
+ min-inline-size: 0;
25
+ }
24
26
 
25
- .ds.view-layout > .aside {
26
- min-block-size: 0;
27
+ .ds.view-layout > .aside {
28
+ min-block-size: 0;
29
+ }
27
30
  }
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes, ReactNode } from "react";
2
- export interface ApplicationLayoutProps extends HTMLAttributes<HTMLDivElement> {
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ type OwnProps = {
3
3
  /** Main content (default slot). Typically a ViewLayout. */
4
4
  children?: ReactNode;
5
5
  /**
@@ -8,5 +8,7 @@ export interface ApplicationLayoutProps extends HTMLAttributes<HTMLDivElement> {
8
8
  * (e.g. a SideNavigation) — the layout does not import or assume one.
9
9
  */
10
10
  navigation?: ReactNode;
11
- }
11
+ };
12
+ export type ApplicationLayoutProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
13
+ export {};
12
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/ApplicationLayout/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,sBAAuB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC5E,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/ApplicationLayout/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,QAAQ,GAAG;IACd,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAC3C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { GridPreset } from "@canonical/ds-types";
2
- import type { HTMLAttributes, ReactNode } from "react";
2
+ import type { ComponentProps, ReactNode } from "react";
3
3
  /**
4
4
  * The grid preset laying out the content items — `GridPreset` from
5
5
  * \@canonical/ds-types, rendered by the `.grid` presets in
@@ -8,10 +8,12 @@ import type { HTMLAttributes, ReactNode } from "react";
8
8
  * `minmax(--grid-col-min, 1fr)` columns).
9
9
  */
10
10
  export type ContentLayoutGrid = GridPreset;
11
- export interface ContentLayoutProps extends HTMLAttributes<HTMLDivElement> {
11
+ type OwnProps = {
12
12
  /** Content items (default slot) — direct grid items. */
13
13
  children?: ReactNode;
14
14
  /** Grid preset. Defaults to `responsive` (fixed-responsive). */
15
15
  grid?: ContentLayoutGrid;
16
- }
16
+ };
17
+ export type ContentLayoutProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
18
+ export {};
17
19
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/ContentLayout/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxE,wDAAwD;IACxD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gEAAgE;IAChE,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/ContentLayout/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C,KAAK,QAAQ,GAAG;IACd,wDAAwD;IACxD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gEAAgE;IAChE,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GACvC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
@@ -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,GAAI,wMAiBrB,mBAAmB,KAAG,KAAK,CAAC,YAkF9B,CAAC;AAEF,eAAe,cAAc,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,GAAI,wBAGrB,mBAAmB,KAAG,KAAK,CAAC,YAO9B,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,9 +1,16 @@
1
- import type { ButtonHTMLAttributes } from "react";
2
- export interface CollapseToggleProps extends ButtonHTMLAttributes<HTMLButtonElement> {
1
+ import type { ComponentProps } from "react";
2
+ type OwnProps = {
3
3
  /**
4
4
  * Whether the navigation is currently expanded. Drives `aria-expanded` and
5
5
  * the default `aria-label`. Controlled by the parent SideNavigation.
6
6
  */
7
7
  expanded?: boolean;
8
- }
8
+ };
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">;
15
+ export {};
9
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,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,mBACf,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
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,GAAI,0DAMd,YAAY,KAAG,KAAK,CAAC,YAevB,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,14 +1,13 @@
1
- import type { Item as NavItem } from "@canonical/ds-types";
2
- import type { ComponentType, HTMLAttributes, ReactNode } from "react";
3
- import type { LinkComponentProps } from "../../types.js";
4
- export interface ContentProps extends HTMLAttributes<HTMLDivElement> {
5
- /** Root item whose direct children are rendered as the nav item list. */
6
- root?: NavItem;
1
+ import type { ComponentProps, ComponentType } from "react";
2
+ import type { LinkComponentProps, NavRoot } from "../../types.js";
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). */
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
+ };
11
+ export type ContentProps = OwnProps & Omit<ComponentProps<"nav">, keyof OwnProps>;
12
+ export {};
14
13
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Content/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAClE,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"}
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,GAAI,8LAgBtB,oBAAoB,KAAG,KAAK,CAAC,YAkE/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -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"}