@canonical/react-ds-app 0.36.0 → 0.38.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 (32) 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/common/CollapseToggle/styles.css +6 -3
  5. package/dist/esm/lib/SideNavigation/common/Content/styles.css +31 -28
  6. package/dist/esm/lib/SideNavigation/common/Footer/styles.css +7 -4
  7. package/dist/esm/lib/SideNavigation/common/Header/styles.css +34 -31
  8. package/dist/esm/lib/SideNavigation/common/Item/styles.css +44 -39
  9. package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js +1 -1
  10. package/dist/esm/lib/SideNavigation/common/NavTree/NavTree.js.map +1 -1
  11. package/dist/esm/lib/SideNavigation/common/NavTree/styles.css +25 -20
  12. package/dist/esm/lib/SideNavigation/styles.css +25 -22
  13. package/dist/esm/lib/ViewLayout/styles.css +25 -22
  14. package/dist/types/lib/ApplicationLayout/types.d.ts +5 -3
  15. package/dist/types/lib/ApplicationLayout/types.d.ts.map +1 -1
  16. package/dist/types/lib/ContentLayout/types.d.ts +5 -3
  17. package/dist/types/lib/ContentLayout/types.d.ts.map +1 -1
  18. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts +5 -3
  19. package/dist/types/lib/SideNavigation/common/CollapseToggle/types.d.ts.map +1 -1
  20. package/dist/types/lib/SideNavigation/common/Content/types.d.ts +5 -3
  21. package/dist/types/lib/SideNavigation/common/Content/types.d.ts.map +1 -1
  22. package/dist/types/lib/SideNavigation/common/Footer/types.d.ts +5 -3
  23. package/dist/types/lib/SideNavigation/common/Footer/types.d.ts.map +1 -1
  24. package/dist/types/lib/SideNavigation/common/Header/types.d.ts +5 -3
  25. package/dist/types/lib/SideNavigation/common/Header/types.d.ts.map +1 -1
  26. package/dist/types/lib/SideNavigation/common/Item/types.d.ts +2 -2
  27. package/dist/types/lib/SideNavigation/common/Item/types.d.ts.map +1 -1
  28. package/dist/types/lib/SideNavigation/types.d.ts +7 -6
  29. package/dist/types/lib/SideNavigation/types.d.ts.map +1 -1
  30. package/dist/types/lib/ViewLayout/types.d.ts +5 -3
  31. package/dist/types/lib/ViewLayout/types.d.ts.map +1 -1
  32. package/package.json +20 -20
package/README.md CHANGED
@@ -28,6 +28,36 @@ function AppHeader() {
28
28
  }
29
29
  ```
30
30
 
31
+ ## Styling
32
+
33
+ ### Every component stylesheet is in `ds.components.apps`
34
+
35
+ Every component stylesheet under `src` is wrapped in one cascade layer:
36
+
37
+ ```css
38
+ @layer ds.components.apps {
39
+ .ds.side-navigation {
40
+ /* … */
41
+ }
42
+ }
43
+ ```
44
+
45
+ That includes the story-only components under `src/storybook`, which carry `.ds` rules of their own and render in the same page as the published ones. `.storybook/styles.css` is deliberately not wrapped: it is the Storybook harness rather than a component stylesheet, and it is not published.
46
+
47
+ One consequence is worth knowing before you read a story or a screenshot. The harness re-declares two SideNavigation row-grid custom properties, `--sidenav-start` and `--sidenav-row-columns`, because the subcomponent stories (Header, Item, NavTree, …) render inside a bare `.ds.side-navigation` shell without mounting the root, so the component's own sheet is not in those stories' chunk at all and the row grid would collapse without them — removing them moves 14 of the 26 stories. Where both are on the page, the harness copy is now the **authority** rather than merely the last one in: it is unlayered and the component's sheet is in `ds.components.apps`. The values are identical, so nothing computes differently, but the two must be kept in step until the story shell imports the component's sheet, after which the harness copy can go.
48
+
49
+ The component layers follow the design system's tier tree, flat, one name per tier: `ds.components.global` for the global packages, then the second level — `sites`, `documentation`, `stores` and `apps` — which `@canonical/styles` names in its order statement, and then a sub-tier, which names itself. This package is the **shared application tier**, so it is `ds.components.apps`. A product's own package (`@canonical/react-ds-app-lxd` and its siblings) is a sub-tier: it declares `@layer ds.components.apps-lxd;` as the first rule of its stylesheet entry and wraps its sheets in that, and because pragma's statement comes first, a name it does not contain is appended after the second level and sorts above it. Deeper wins, which is the tree's own rule — so a product tier overrides this package, this package overrides the global one, and none of it depends on the order a bundler emits them in. Three things follow.
50
+
51
+ **This release lands with, and after, the global tier's own wrap.** Taken alone it would invert the two packages: an unlayered author rule outranks every layered one, so wrapping this package while `@canonical/react-ds-global` is still unlayered hands the global tier every rule the two contend. Measured over this package's 26 Storybook stories, that is 80 of 810 elements — 74 icons in the side navigation lose `vertical-align: sub` to the global Icon's `middle`, and the application shell gains a third grid track from the global package's work-in-progress grid `ApplicationLayout`, which styles `.application-layout`, the same class this package's `ApplicationLayout` renders. With both packages layered, nothing moves at all: 0 of 810 elements, in every condition measured.
52
+
53
+ Once both are layered, no selector this package declares is also declared by `@canonical/react-ds-global`, so nothing changes hands. What the layer buys is the answer to the next collision, and that answer is fixed rather than emitted: today specificity settles the `.application-layout` near-miss, one seat apart; a global rule written at the same seat as this package's would have been settled by whichever bundle a loader emitted last, and is now settled by layer, in this package's favour, whatever the emit order and without a longer selector or an `!important`.
54
+
55
+ The guarantee needs `@canonical/styles` on the page, and needs its statement first. An order statement is what fixes the relative order of two sublayers; without it they fall back to the order they first appear in, and a bundle that emits this package before `@canonical/react-ds-global` hands the win back to the global tier. One nuance, measured: `ds.components.apps` is not a name the statement contains yet — it still names the retired `ds.components.app`, and gains the second level in full with the rework of the styles package — but a sublayer the statement does not name is appended after every name it fixed, so with the statement on the page this package already beats `@canonical/react-ds-global` in both emit orders. Nothing under `src/lib` imports `@canonical/styles` — an application imports it once, as the installation instructions above say.
56
+
57
+ An application's own **unlayered** CSS now beats every rule in this package, whatever the selectors on either side, because an unlayered author rule outranks every layered one. That is CSS working as designed, and it is the deliberate escape hatch: an application that needs to override a component writes a plain rule and it wins. An application that does *not* want to win by accident puts its CSS in `@layer app`.
58
+
59
+ **Rule for contributors:** every component stylesheet under `src` opens with that wrapper. `@keyframes` and a component's own `:root` token defaults go inside it; `@property` and `@font-face` registrations stay outside, above the block, because no layer sorts a registration. Never reach for `!important` to win a fight — an important declaration inverts the layer order, so it cannot be arbitrated by layers at all. The "Cascade Layers" section of the `@canonical/styles` README is the reference for the full order and for what is deliberately left unlayered.
60
+
31
61
  ## Storybook
32
62
 
33
63
  ```bash
@@ -1,29 +1,32 @@
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.application-layout {
4
- /* Application shell: navigation rail (min-content) + content (1fr), per
5
- the ontology instance apps.layout.application_layout. The rail/content
6
- gutter follows the design reference (#421: 1rem) via the container gap
7
- token; --application-layout-gap overrides (0 for a flush shell). */
8
- display: grid;
9
- grid-template-columns: min-content 1fr;
10
- gap: var(--application-layout-gap, var(--container-gap-default, 1rem));
11
- block-size: 100%;
12
- }
4
+ @layer ds.components.apps {
5
+ .ds.application-layout {
6
+ /* Application shell: navigation rail (min-content) + content (1fr), per
7
+ the ontology instance apps.layout.application_layout. The rail/content
8
+ gutter follows the design reference (#421: 1rem) via the container gap
9
+ token; --application-layout-gap overrides (0 for a flush shell). */
10
+ display: grid;
11
+ grid-template-columns: min-content 1fr;
12
+ gap: var(--application-layout-gap, var(--container-gap-default, 1rem));
13
+ block-size: 100%;
14
+ }
13
15
 
14
- /* Without a navigation slot, drop the rail column entirely so neither the
15
- empty track nor the gap offsets the content. */
16
- .ds.application-layout:not(:has(> .navigation)) {
17
- grid-template-columns: 1fr;
18
- }
16
+ /* Without a navigation slot, drop the rail column entirely so neither the
17
+ empty track nor the gap offsets the content. */
18
+ .ds.application-layout:not(:has(> .navigation)) {
19
+ grid-template-columns: 1fr;
20
+ }
19
21
 
20
- /* min-size 0 lets each region scroll internally instead of stretching the
21
- shell beyond the viewport. The navigation slot owns its inline size. */
22
- .ds.application-layout > .navigation {
23
- min-block-size: 0;
24
- }
22
+ /* min-size 0 lets each region scroll internally instead of stretching the
23
+ shell beyond the viewport. The navigation slot owns its inline size. */
24
+ .ds.application-layout > .navigation {
25
+ min-block-size: 0;
26
+ }
25
27
 
26
- .ds.application-layout > .content {
27
- min-block-size: 0;
28
- min-inline-size: 0;
28
+ .ds.application-layout > .content {
29
+ min-block-size: 0;
30
+ min-inline-size: 0;
31
+ }
29
32
  }
@@ -1,13 +1,16 @@
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.content-layout {
4
- /* Column templates and gaps come from the .grid presets in
5
- @canonical/styles (.responsive: breakpoint-driven 4/8/12 columns;
6
- .intrinsic: fluid auto-fill groups of four minmax(--grid-col-min, 1fr)
7
- columns). Knobs: --grid-gap (or per-axis --grid-row-gap /
8
- --grid-column-gap), --grid-col-min for the intrinsic mode. */
4
+ @layer ds.components.apps {
5
+ .ds.content-layout {
6
+ /* Column templates and gaps come from the .grid presets in
7
+ @canonical/styles (.responsive: breakpoint-driven 4/8/12 columns;
8
+ .intrinsic: fluid auto-fill groups of four minmax(--grid-col-min, 1fr)
9
+ columns). Knobs: --grid-gap (or per-axis --grid-row-gap /
10
+ --grid-column-gap), --grid-col-min for the intrinsic mode. */
9
11
 
10
- /* Rows size to content; the grid grows downwards and scrolls in whatever
11
- region contains it (e.g. ViewLayout's content slot). */
12
- align-content: start;
12
+ /* Rows size to content; the grid grows downwards and scrolls in whatever
13
+ region contains it (e.g. ViewLayout's content slot). */
14
+ align-content: start;
15
+ }
13
16
  }
@@ -1,5 +1,8 @@
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.collapse-toggle {
4
- /* Component styles */
4
+ @layer ds.components.apps {
5
+ .ds.collapse-toggle {
6
+ /* Component styles */
7
+ }
5
8
  }
@@ -1,33 +1,36 @@
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.content {
4
- position: relative;
5
- flex: 1;
6
- /* min-height:0 lets this flex item shrink below its content height so it can
7
- scroll internally (flex items default to min-height:auto, which refuses to
8
- shrink and would push the whole nav taller instead). Vertical scroll only;
9
- never horizontal (long labels must not cause sideways scroll). */
10
- min-height: 0;
11
- overflow: hidden auto;
4
+ @layer ds.components.apps {
5
+ .ds.content {
6
+ position: relative;
7
+ flex: 1;
8
+ /* min-height:0 lets this flex item shrink below its content height so it can
9
+ scroll internally (flex items default to min-height:auto, which refuses to
10
+ shrink and would push the whole nav taller instead). Vertical scroll only;
11
+ never horizontal (long labels must not cause sideways scroll). */
12
+ min-height: 0;
13
+ overflow: hidden auto;
12
14
 
13
- /* Tree structure (.group/.header/.list) is owned by NavTree's own styles.
14
- Content only reserves room for the overflow fade so the last item of the
15
- last group is never permanently hidden behind it. */
16
- & .nav-tree > .group:last-child > .list {
17
- padding-block-end: var(--overflow-gradient-height);
18
- }
15
+ /* Tree structure (.group/.header/.list) is owned by NavTree's own styles.
16
+ Content only reserves room for the overflow fade so the last item of the
17
+ last group is never permanently hidden behind it. */
18
+ & .nav-tree > .group:last-child > .list {
19
+ padding-block-end: var(--overflow-gradient-height);
20
+ }
19
21
 
20
- /* Overflow fade: a sticky bar pinned to the bottom of the scroll viewport,
21
- painting the surface-aware gradient over content scrolling underneath. */
22
- &::after {
23
- content: "";
24
- position: sticky;
25
- bottom: 0;
26
- display: block;
27
- block-size: var(--overflow-gradient-height);
28
- /* Pull the bar back over the reserved padding so it overlays content. */
29
- margin-block-start: calc(-1 * var(--overflow-gradient-height));
30
- background: var(--surface-overflow-gradient);
31
- pointer-events: none;
22
+ /* Overflow fade: a sticky bar pinned to the bottom of the scroll viewport,
23
+ painting the surface-aware gradient over content scrolling underneath. */
24
+ &::after {
25
+ content: "";
26
+ position: sticky;
27
+ bottom: 0;
28
+ display: block;
29
+ block-size: var(--overflow-gradient-height);
30
+ /* Pull the bar back over the reserved padding so it overlays content. */
31
+ margin-block-start: calc(-1 * var(--overflow-gradient-height));
32
+ background: var(--surface-overflow-gradient);
33
+ pointer-events: none;
34
+ }
32
35
  }
33
36
  }
@@ -1,6 +1,9 @@
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.footer {
4
- /* Tree structure (.group/.header/.list) is owned by NavTree's own styles;
5
- the footer renders a NavTree and adds no tree-specific layout of its own. */
4
+ @layer ds.components.apps {
5
+ .ds.footer {
6
+ /* Tree structure (.group/.header/.list) is owned by NavTree's own styles;
7
+ the footer renders a NavTree and adds no tree-specific layout of its own. */
8
+ }
6
9
  }
@@ -1,37 +1,40 @@
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.side-navigation-header {
4
- /* Shared row template with Item so the brand/logo aligns with item icons. */
5
- display: grid;
6
- grid-template-columns: var(--sidenav-row-columns);
7
- /* Baseline grid: a fixed box height of whole baseline units (5bU/40px, the
8
- same row height as the items below) keeps the header on the rail's rhythm.
9
- align-items: start tops every cell so the brand rectangle fills from the
10
- top and the title/toggle sit at the top of the row. */
11
- block-size: calc(var(--space-baseline) * 5); /* 40px — 5bU */
12
- box-sizing: border-box;
13
- align-items: start;
14
- gap: var(--dimension-100); /* 0.5rem */
4
+ @layer ds.components.apps {
5
+ .ds.side-navigation-header {
6
+ /* Shared row template with Item so the brand/logo aligns with item icons. */
7
+ display: grid;
8
+ grid-template-columns: var(--sidenav-row-columns);
9
+ /* Baseline grid: a fixed box height of whole baseline units (5bU/40px, the
10
+ same row height as the items below) keeps the header on the rail's rhythm.
11
+ align-items: start tops every cell so the brand rectangle fills from the
12
+ top and the title/toggle sit at the top of the row. */
13
+ block-size: calc(var(--space-baseline) * 5); /* 40px — 5bU */
14
+ box-sizing: border-box;
15
+ align-items: start;
16
+ gap: var(--dimension-100); /* 0.5rem */
15
17
 
16
- /* Pin each part to its column explicitly so the toggle stays in the end
17
- column even when the optional title is absent. */
18
- .brand {
19
- /* Start column, aligned with the item icons below. Tops-align with the rest
20
- of the row (align-items: start); the brand's own margin/padding handles
21
- its vertical placement, not a stretched cell. */
22
- grid-column: 1;
23
- display: flex;
24
- align-items: center;
25
- }
18
+ /* Pin each part to its column explicitly so the toggle stays in the end
19
+ column even when the optional title is absent. */
20
+ .brand {
21
+ /* Start column, aligned with the item icons below. Tops-align with the rest
22
+ of the row (align-items: start); the brand's own margin/padding handles
23
+ its vertical placement, not a stretched cell. */
24
+ grid-column: 1;
25
+ display: flex;
26
+ align-items: center;
27
+ }
26
28
 
27
- .title {
28
- /* Middle (1fr) column. Optional. */
29
- grid-column: 2;
30
- min-width: 0;
31
- }
29
+ .title {
30
+ /* Middle (1fr) column. Optional. */
31
+ grid-column: 2;
32
+ min-width: 0;
33
+ }
32
34
 
33
- & > .ds.collapse-toggle {
34
- /* End column. */
35
- grid-column: 3;
35
+ & > .ds.collapse-toggle {
36
+ /* End column. */
37
+ grid-column: 3;
38
+ }
36
39
  }
37
40
  }
@@ -4,51 +4,56 @@
4
4
  * PR1: structural layout only. Colour/visual state (hover/active fills,
5
5
  * text/icon colour) is deferred to PR2 (token pairings). A bare focus outline
6
6
  * is included for keyboard focus visibility.
7
+ *
8
+ * Layer: ds.components.apps (@canonical/styles README, "Cascade layers").
7
9
  */
8
- .ds.side-navigation-item {
9
- list-style: none;
10
-
11
- /* The row: link or label. Shares the SideNavigation row template so the
12
- leading icon aligns with the header logo. [icon] [label] [end].
13
- Baseline grid: a fixed 5bU/40px row height (matching the header) carries the
14
- vertical rhythm. Every cell top-anchors (align-items: start) so the .p line
15
- boxes (icon + label) start at the same row top with equal line-height — their
16
- baselines line up on the grid. No block padding — the fixed height owns it. */
17
- & > .row {
18
- display: grid;
19
- grid-template-columns: var(--sidenav-row-columns);
20
- align-items: start;
21
- gap: var(--dimension-100); /* 0.5rem */
22
- width: 100%;
23
- block-size: calc(var(--space-baseline) * 5); /* 40px — 5bU */
24
- box-sizing: border-box;
25
- padding-block: 0;
26
- text-decoration: none;
27
- }
28
10
 
29
- /* Leading icon → start column. A .p line box: the icon is inline and rides the
30
- baseline-snapped line like a text glyph, so it shares the label baseline. */
31
- & .start {
32
- text-align: center;
11
+ @layer ds.components.apps {
12
+ .ds.side-navigation-item {
13
+ list-style: none;
33
14
 
34
- & > .ds.icon {
35
- vertical-align: sub;
15
+ /* The row: link or label. Shares the SideNavigation row template so the
16
+ leading icon aligns with the header logo. [icon] [label] [end].
17
+ Baseline grid: a fixed 5bU/40px row height (matching the header) carries the
18
+ vertical rhythm. Every cell top-anchors (align-items: start) so the .p line
19
+ boxes (icon + label) start at the same row top with equal line-height — their
20
+ baselines line up on the grid. No block padding — the fixed height owns it. */
21
+ & > .row {
22
+ display: grid;
23
+ grid-template-columns: var(--sidenav-row-columns);
24
+ align-items: start;
25
+ gap: var(--dimension-100); /* 0.5rem */
26
+ width: 100%;
27
+ block-size: calc(var(--space-baseline) * 5); /* 40px — 5bU */
28
+ box-sizing: border-box;
29
+ padding-block: 0;
30
+ text-decoration: none;
36
31
  }
37
- }
38
32
 
39
- /* Label → middle (1fr) column. .p line box, top-anchored like .start. */
40
- & .label {
41
- min-width: 0;
42
- }
33
+ /* Leading icon → start column. A .p line box: the icon is inline and rides the
34
+ baseline-snapped line like a text glyph, so it shares the label baseline. */
35
+ & .start {
36
+ text-align: center;
43
37
 
44
- /* Trailing caret / slot → end (auto) column, top-anchored. */
45
- & .end {
46
- text-align: center;
47
- }
38
+ & > .ds.icon {
39
+ vertical-align: sub;
40
+ }
41
+ }
48
42
 
49
- /* Keyboard focus visibility (structural a11y; styling refined in PR2). */
50
- & > .row:focus-visible {
51
- outline: 2px solid currentColor;
52
- outline-offset: -2px;
43
+ /* Label → middle (1fr) column. .p line box, top-anchored like .start. */
44
+ & .label {
45
+ min-width: 0;
46
+ }
47
+
48
+ /* Trailing caret / slot → end (auto) column, top-anchored. */
49
+ & .end {
50
+ text-align: center;
51
+ }
52
+
53
+ /* Keyboard focus visibility (structural a11y; styling refined in PR2). */
54
+ & > .row:focus-visible {
55
+ outline: 2px solid currentColor;
56
+ outline-offset: -2px;
57
+ }
53
58
  }
54
59
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getItemId } from "@canonical/ds-utils";
2
3
  import { useNavigationTree } from "@canonical/react-hooks";
3
- import { getItemId } from "@canonical/utils";
4
4
  import { useEffect } from "react";
5
5
  import { Item } from "../Item/index.js";
6
6
  import "./styles.css";
@@ -1 +1 @@
1
- {"version":3,"file":"NavTree.js","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/NavTree/NavTree.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,cAAc,CAAC;AAEtB;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,GAAG,CAAC,EACf,IAAI,EACJ,UAAU,EACV,aAAa,GAAG,GAAG,GACN,EAAsB,EAAE;IACrC,MAAM,GAAG,GAAG,iBAAiB,CAAU,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;IACzE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;IAElC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,KAAK,SAAS;YAAE,OAAO;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;QACh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,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,QAAQ,EACxC,aAAa,EAAE,aAAa,IAHvB,SAAS,CAAC,IAAI,CAAC,CAIpB,CACH,CAAC,GACC,KAdyB,OAAO,CAe7B,CACX,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -3,29 +3,34 @@
3
3
  * (level-1 groups → header + level-2 item list). Owned here so Content and
4
4
  * Footer can compose NavTree without re-declaring its internals. Structural
5
5
  * only; colour/visual tokens are deferred to PR2.
6
+ *
7
+ * Layer: ds.components.apps (@canonical/styles README, "Cascade layers").
6
8
  */
7
- .ds.nav-tree {
8
- display: contents;
9
9
 
10
- & > .group {
11
- > .header {
12
- /* Group header sits on the baseline grid like a row: a fixed bU-multiple
13
- height (4bU) with the .p label baseline-snapped, and inline padding that
14
- aligns the header text with the item labels below (past the start column
15
- + its gap). */
16
- display: flex;
17
- align-items: baseline;
18
- block-size: calc(var(--space-baseline) * 4); /* 32px — 4bU */
19
- box-sizing: border-box;
20
- padding-inline-start: calc(var(--sidenav-start) + var(--dimension-100));
21
- }
10
+ @layer ds.components.apps {
11
+ .ds.nav-tree {
12
+ display: contents;
13
+
14
+ & > .group {
15
+ > .header {
16
+ /* Group header sits on the baseline grid like a row: a fixed bU-multiple
17
+ height (4bU) with the .p label baseline-snapped, and inline padding that
18
+ aligns the header text with the item labels below (past the start column
19
+ + its gap). */
20
+ display: flex;
21
+ align-items: baseline;
22
+ block-size: calc(var(--space-baseline) * 4); /* 32px — 4bU */
23
+ box-sizing: border-box;
24
+ padding-inline-start: calc(var(--sidenav-start) + var(--dimension-100));
25
+ }
22
26
 
23
- > .list {
24
- display: flex;
25
- flex-direction: column;
26
- list-style: none;
27
- margin: 0;
28
- padding: 0;
27
+ > .list {
28
+ display: flex;
29
+ flex-direction: column;
30
+ list-style: none;
31
+ margin: 0;
32
+ padding: 0;
33
+ }
29
34
  }
30
35
  }
31
36
  }
@@ -1,25 +1,28 @@
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.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%;
4
+ @layer ds.components.apps {
5
+ .ds.side-navigation {
6
+ /* Component styles */
7
+ background: var(--color-foreground-navigation-primary);
8
+ display: flex;
9
+ 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%;
18
20
 
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;
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;
27
+ }
25
28
  }
@@ -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"}
@@ -1,9 +1,11 @@
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
+ export type CollapseToggleProps = OwnProps & Omit<ComponentProps<"button">, keyof OwnProps>;
10
+ export {};
9
11
  //# 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,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GACxC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { Item as NavItem } from "@canonical/ds-types";
2
- import type { ComponentType, HTMLAttributes, ReactNode } from "react";
2
+ import type { ComponentProps, ComponentType, ReactNode } from "react";
3
3
  import type { LinkComponentProps } from "../../types.js";
4
- export interface ContentProps extends HTMLAttributes<HTMLDivElement> {
4
+ type OwnProps = {
5
5
  /** Root item whose direct children are rendered as the nav item list. */
6
6
  root?: NavItem;
7
7
  /** Component used to render navigable items. Defaults to `"a"`. */
@@ -10,5 +10,7 @@ export interface ContentProps extends HTMLAttributes<HTMLDivElement> {
10
10
  currentUrl?: string;
11
11
  /** Fallback content when no `root` is provided. */
12
12
  children?: ReactNode;
13
- }
13
+ };
14
+ export type ContentProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
15
+ export {};
14
16
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/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,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,7 +1,7 @@
1
1
  import type { Item as NavItem } from "@canonical/ds-types";
2
- import type { ComponentType, HTMLAttributes, ReactNode } from "react";
2
+ import type { ComponentProps, ComponentType, ReactNode } from "react";
3
3
  import type { LinkComponentProps } from "../../types.js";
4
- export interface FooterProps extends HTMLAttributes<HTMLDivElement> {
4
+ type OwnProps = {
5
5
  /** Root item whose direct children are rendered as the footer nav list. */
6
6
  root?: NavItem;
7
7
  /** Component used to render navigable items. Defaults to `"a"`. */
@@ -10,5 +10,7 @@ export interface FooterProps extends HTMLAttributes<HTMLDivElement> {
10
10
  currentUrl?: string;
11
11
  /** Fallback content when no `root` is provided. */
12
12
  children?: ReactNode;
13
- }
13
+ };
14
+ export type FooterProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
15
+ export {};
14
16
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Footer/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,WAAY,SAAQ,cAAc,CAAC,cAAc,CAAC;IACjE,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"}
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,5 +1,5 @@
1
- import type { HTMLAttributes, ReactNode } from "react";
2
- export interface HeaderProps extends HTMLAttributes<HTMLDivElement> {
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ type OwnProps = {
3
3
  /** Brand content (logo mark) rendered at the start of the header. */
4
4
  brand?: ReactNode;
5
5
  /** Optional application name/wordmark shown beside the brand. Omitted when absent. */
@@ -10,5 +10,7 @@ export interface HeaderProps extends HTMLAttributes<HTMLDivElement> {
10
10
  onToggle?: () => void;
11
11
  /** id of the navigation region the collapse toggle controls (`aria-controls`). */
12
12
  collapseControls?: string;
13
- }
13
+ };
14
+ export type HeaderProps = OwnProps & Omit<ComponentProps<"header">, keyof OwnProps>;
15
+ export {};
14
16
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Header/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,cAAc,CAAC;IACjE,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"}
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"}
@@ -8,10 +8,10 @@ import type { LinkComponentProps, NavItem } from "../../types.js";
8
8
  * lives in NavTree's two loops. The end slot is derived — an item with subitems
9
9
  * shows a disclosure caret; a leaf shows its optional `slot`.
10
10
  */
11
- export interface ItemProps extends NavItem {
11
+ export type ItemProps = NavItem & {
12
12
  /** Whether this item is the active (current) page. */
13
13
  active?: boolean;
14
14
  /** Component used to render navigable items. Defaults to `"a"`. */
15
15
  LinkComponent?: ComponentType<LinkComponentProps> | "a";
16
- }
16
+ };
17
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,WAAW,SAAU,SAAQ,OAAO;IACxC,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;CACzD"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/SideNavigation/common/Item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG;IAChC,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { IconName } from "@canonical/ds-assets";
2
- import type { Item } from "@canonical/ds-types";
2
+ import type { _DistributiveOmit, Item } from "@canonical/ds-types";
3
3
  import type { LinkComponentProps } from "@canonical/react-ds-global";
4
- import type { ComponentType, HTMLAttributes, ReactNode } from "react";
4
+ import type { ComponentProps, ComponentType, ReactNode } from "react";
5
5
  export type { LinkComponentProps };
6
6
  /**
7
7
  * The SideNavigation item — the WD405 `Item` enhanced with the presentational
@@ -15,7 +15,7 @@ export type { LinkComponentProps };
15
15
  * No discriminated union to author: the caret-vs-slot choice is structural,
16
16
  * derived from whether the item has `items`.
17
17
  */
18
- export interface NavItem extends Omit<Item, "items"> {
18
+ export type NavItem = _DistributiveOmit<Item, "items"> & {
19
19
  /** Leading icon (start slot), by ds-assets icon name. */
20
20
  icon?: IconName;
21
21
  /** Trailing content for leaf items (end slot). Ignored if the item has subitems. */
@@ -24,8 +24,8 @@ export interface NavItem extends Omit<Item, "items"> {
24
24
  items?: NavItem[];
25
25
  /** CSS class name applied to this item's row, in addition to the base classes. */
26
26
  className?: string;
27
- }
28
- export interface SideNavigationProps extends HTMLAttributes<HTMLDivElement> {
27
+ };
28
+ type OwnProps = {
29
29
  /** Brand content (logo/wordmark) rendered in the header. */
30
30
  brand?: ReactNode;
31
31
  /** Optional application name/wordmark shown beside the brand in the header. */
@@ -49,5 +49,6 @@ export interface SideNavigationProps extends HTMLAttributes<HTMLDivElement> {
49
49
  currentUrl?: string;
50
50
  /** Initial expanded (rail) state when uncontrolled. Defaults to `true`. */
51
51
  defaultExpanded?: boolean;
52
- }
52
+ };
53
+ export type SideNavigationProps = OwnProps & Omit<ComponentProps<"div">, keyof OwnProps>;
53
54
  //# sourceMappingURL=types.d.ts.map
@@ -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;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAKhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,OAAQ,SAAQ,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;IAClD,yDAAyD;IACzD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,oFAAoF;IACpF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACzE,4DAA4D;IAC5D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC;IACxD;;;;;OAKG;IACH,UAAU,CAA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MAAM,mBAAmB,GAAG,QAAQ,GACxC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
- import type { HTMLAttributes, ReactNode } from "react";
2
- export interface ViewLayoutProps extends HTMLAttributes<HTMLDivElement> {
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ type OwnProps = {
3
3
  /** View content (default slot). Typically a ContentLayout. */
4
4
  children?: ReactNode;
5
5
  /**
@@ -8,5 +8,7 @@ export interface ViewLayoutProps extends HTMLAttributes<HTMLDivElement> {
8
8
  * ReactNode; the slot owns its inline size.
9
9
  */
10
10
  aside?: ReactNode;
11
- }
11
+ };
12
+ export type ViewLayoutProps = 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/ViewLayout/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACrE,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/ViewLayout/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,KAAK,QAAQ,GAAG;IACd,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,QAAQ,GACpC,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.36.0",
3
+ "version": "0.38.0",
4
4
  "type": "module",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -33,19 +33,19 @@
33
33
  "check:biome": "biome check",
34
34
  "check:biome:fix": "biome check --write",
35
35
  "check:ts": "tsc --noEmit",
36
- "storybook": "storybook dev -p 6006 --no-open --host 0.0.0.0",
36
+ "storybook": "storybook dev -p 6008 --no-open --host 0.0.0.0",
37
37
  "test": "bun run test:vitest",
38
38
  "test:vitest": "vitest run",
39
39
  "test:vitest:watch": "vitest"
40
40
  },
41
41
  "dependencies": {
42
- "@canonical/ds-assets": "^0.36.0",
43
- "@canonical/ds-types": "^0.36.0",
44
- "@canonical/react-ds-global": "^0.36.0",
45
- "@canonical/react-hooks": "^0.36.0",
46
- "@canonical/storybook-config": "^0.36.0",
47
- "@canonical/styles": "^0.36.0",
48
- "@canonical/utils": "^0.36.0",
42
+ "@canonical/ds-assets": "^0.38.0",
43
+ "@canonical/ds-types": "^0.38.0",
44
+ "@canonical/ds-utils": "^0.38.0",
45
+ "@canonical/react-ds-global": "^0.38.0",
46
+ "@canonical/react-hooks": "^0.38.0",
47
+ "@canonical/storybook-config": "^0.38.0",
48
+ "@canonical/styles": "^0.38.0",
49
49
  "react": "^19.2.4",
50
50
  "react-dom": "^19.2.4"
51
51
  },
@@ -62,16 +62,16 @@
62
62
  }
63
63
  },
64
64
  "devDependencies": {
65
- "@biomejs/biome": "2.4.9",
66
- "@canonical/biome-config": "^0.36.0",
67
- "@canonical/design-tokens": "0.8.1",
68
- "@canonical/router-core": "^0.36.0",
69
- "@canonical/router-react": "^0.36.0",
70
- "@canonical/storybook-addon-utils": "^0.36.0",
71
- "@canonical/storybook-helpers": "^0.36.0",
72
- "@canonical/typescript-config-react": "^0.36.0",
73
- "@canonical/vitest-config-react": "^0.36.0",
74
- "@canonical/webarchitect": "^0.36.0",
65
+ "@biomejs/biome": "2.5.13",
66
+ "@canonical/biome-config": "^0.38.0",
67
+ "@canonical/design-tokens": "0.10.0",
68
+ "@canonical/router-core": "^0.38.0",
69
+ "@canonical/router-react": "^0.38.0",
70
+ "@canonical/storybook-addon-utils": "^0.38.0",
71
+ "@canonical/storybook-helpers": "^0.38.0",
72
+ "@canonical/typescript-config-react": "^0.38.0",
73
+ "@canonical/vitest-config-react": "^0.38.0",
74
+ "@canonical/webarchitect": "^0.38.0",
75
75
  "@chromatic-com/storybook": "^5.0.1",
76
76
  "@storybook/addon-docs": "^10.3.1",
77
77
  "@storybook/react-vite": "^10.3.1",
@@ -89,5 +89,5 @@
89
89
  "vite": "^8.0.1",
90
90
  "vitest": "^4.0.18"
91
91
  },
92
- "gitHead": "78eb47ac10104e914eeacd331795e14b832703d4"
92
+ "gitHead": "4d10a68a9b299af6fe3d1d7d053e54ca128944ad"
93
93
  }