@aquera/nile-elements 2.0.10 → 2.0.12

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 (104) hide show
  1. package/README.md +6 -0
  2. package/demo/app-shell.html +852 -0
  3. package/demo/nxtgen-classes.css +2 -2
  4. package/demo/nxtgen-properties.css +2 -2
  5. package/demo/nxtgen-utilities.css +2 -2
  6. package/demo/nxtgen.css +2 -2
  7. package/demo/utilities.css +2 -2
  8. package/demo/variables.css +2 -2
  9. package/dist/index.cjs.js +1 -1
  10. package/dist/index.esm.js +1 -1
  11. package/dist/index.js +595 -302
  12. package/dist/internal/app-shell-utility-control-styles.cjs.js +2 -0
  13. package/dist/internal/app-shell-utility-control-styles.cjs.js.map +1 -0
  14. package/dist/internal/app-shell-utility-control-styles.esm.js +16 -0
  15. package/dist/nile-app-shell/index.cjs.js +1 -1
  16. package/dist/nile-app-shell/index.esm.js +1 -1
  17. package/dist/nile-app-shell/nile-app-shell.cjs.js +1 -1
  18. package/dist/nile-app-shell/nile-app-shell.cjs.js.map +1 -1
  19. package/dist/nile-app-shell/nile-app-shell.css.cjs.js +1 -1
  20. package/dist/nile-app-shell/nile-app-shell.css.cjs.js.map +1 -1
  21. package/dist/nile-app-shell/nile-app-shell.css.esm.js +277 -96
  22. package/dist/nile-app-shell/nile-app-shell.esm.js +67 -11
  23. package/dist/nile-app-shell/shell-controller.cjs.js.map +1 -1
  24. package/dist/nile-app-shell-main/nile-app-shell-main.cjs.js.map +1 -1
  25. package/dist/nile-app-shell-nav-toggle/index.cjs.js +1 -1
  26. package/dist/nile-app-shell-nav-toggle/index.esm.js +1 -1
  27. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.cjs.js +1 -1
  28. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.cjs.js.map +1 -1
  29. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.cjs.js +1 -1
  30. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.cjs.js.map +1 -1
  31. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.esm.js +7 -3
  32. package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.esm.js +3 -3
  33. package/dist/nile-app-shell-panel/index.cjs.js +1 -1
  34. package/dist/nile-app-shell-panel/index.esm.js +1 -1
  35. package/dist/nile-app-shell-panel/nile-app-shell-panel.cjs.js +1 -1
  36. package/dist/nile-app-shell-panel/nile-app-shell-panel.cjs.js.map +1 -1
  37. package/dist/nile-app-shell-panel/nile-app-shell-panel.css.cjs.js +1 -1
  38. package/dist/nile-app-shell-panel/nile-app-shell-panel.css.cjs.js.map +1 -1
  39. package/dist/nile-app-shell-panel/nile-app-shell-panel.css.esm.js +32 -8
  40. package/dist/nile-app-shell-panel/nile-app-shell-panel.esm.js +18 -5
  41. package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.cjs.js.map +1 -1
  42. package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.css.cjs.js.map +1 -1
  43. package/dist/src/internal/app-shell-utility-control-styles.d.ts +12 -0
  44. package/dist/src/internal/app-shell-utility-control-styles.js +29 -0
  45. package/dist/src/internal/app-shell-utility-control-styles.js.map +1 -0
  46. package/dist/src/nile-app-shell/nile-app-shell-regions.test.d.ts +3 -0
  47. package/dist/src/nile-app-shell/nile-app-shell-regions.test.js +210 -0
  48. package/dist/src/nile-app-shell/nile-app-shell-regions.test.js.map +1 -1
  49. package/dist/src/nile-app-shell/nile-app-shell.css.d.ts +1 -9
  50. package/dist/src/nile-app-shell/nile-app-shell.css.js +277 -103
  51. package/dist/src/nile-app-shell/nile-app-shell.css.js.map +1 -1
  52. package/dist/src/nile-app-shell/nile-app-shell.d.ts +90 -122
  53. package/dist/src/nile-app-shell/nile-app-shell.js +235 -144
  54. package/dist/src/nile-app-shell/nile-app-shell.js.map +1 -1
  55. package/dist/src/nile-app-shell/nile-app-shell.test.d.ts +4 -0
  56. package/dist/src/nile-app-shell/nile-app-shell.test.js +1116 -29
  57. package/dist/src/nile-app-shell/nile-app-shell.test.js.map +1 -1
  58. package/dist/src/nile-app-shell/shell-controller.d.ts +1 -8
  59. package/dist/src/nile-app-shell/shell-controller.js +2 -14
  60. package/dist/src/nile-app-shell/shell-controller.js.map +1 -1
  61. package/dist/src/nile-app-shell-main/nile-app-shell-main.d.ts +2 -6
  62. package/dist/src/nile-app-shell-main/nile-app-shell-main.js +2 -6
  63. package/dist/src/nile-app-shell-main/nile-app-shell-main.js.map +1 -1
  64. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.d.ts +1 -4
  65. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.js +7 -5
  66. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.js.map +1 -1
  67. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.d.ts +4 -8
  68. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.js +5 -6
  69. package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.js.map +1 -1
  70. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.css.js +31 -6
  71. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.css.js.map +1 -1
  72. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.d.ts +18 -13
  73. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.js +45 -16
  74. package/dist/src/nile-app-shell-panel/nile-app-shell-panel.js.map +1 -1
  75. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.d.ts +1 -4
  76. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.js +1 -4
  77. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.js.map +1 -1
  78. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.d.ts +4 -12
  79. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.js +4 -12
  80. package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.js.map +1 -1
  81. package/dist/src/version.js +1 -1
  82. package/dist/src/version.js.map +1 -1
  83. package/dist/tsconfig.tsbuildinfo +1 -1
  84. package/dist/version.cjs.js +1 -1
  85. package/dist/version.cjs.js.map +1 -1
  86. package/dist/version.esm.js +1 -1
  87. package/package.json +1 -1
  88. package/plop-templates/lit/lit.test.ts.hbs +22 -0
  89. package/plop-templates/lit/lit.ts.hbs +10 -5
  90. package/plopfile.js +12 -0
  91. package/src/internal/app-shell-utility-control-styles.ts +30 -0
  92. package/src/nile-app-shell/nile-app-shell-regions.test.ts +252 -0
  93. package/src/nile-app-shell/nile-app-shell.css.ts +277 -103
  94. package/src/nile-app-shell/nile-app-shell.test.ts +1363 -29
  95. package/src/nile-app-shell/nile-app-shell.ts +249 -149
  96. package/src/nile-app-shell/shell-controller.ts +2 -14
  97. package/src/nile-app-shell-main/nile-app-shell-main.ts +2 -6
  98. package/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.ts +7 -5
  99. package/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.ts +7 -11
  100. package/src/nile-app-shell-panel/nile-app-shell-panel.css.ts +31 -6
  101. package/src/nile-app-shell-panel/nile-app-shell-panel.ts +44 -16
  102. package/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.ts +1 -4
  103. package/src/nile-app-shell-side-nav/nile-app-shell-side-nav.ts +4 -12
  104. package/vscode-html-custom-data.json +85 -18
@@ -15,14 +15,7 @@ const SHELL_EVENTS = [
15
15
  'nile-panel-mode-change',
16
16
  ];
17
17
 
18
- /**
19
- * A reactive controller that links a region component to its shell.
20
- *
21
- * Region components sit in the shell's light DOM, so the shell is just an
22
- * ancestor — `closest()` finds it. The shell may upgrade after its children do,
23
- * so the lookup is deferred to a microtask and retried on demand. While linked,
24
- * the host re-renders whenever the shell's nav or panel state changes.
25
- */
18
+ /** A reactive controller that links a region component to its shell, re-rendering the host when the shell's nav or panel state changes. */
26
19
  export class AppShellController implements ReactiveController {
27
20
  host: ReactiveControllerHost & HTMLElement;
28
21
 
@@ -62,12 +55,7 @@ export class AppShellController implements ReactiveController {
62
55
  SHELL_EVENTS.forEach(name =>
63
56
  found.addEventListener(name, this.handleShellChange)
64
57
  );
65
- /*
66
- * Not every state a region renders from has an event. Panel availability
67
- * flips when the panel slot fills, which emits nothing — a header would
68
- * render its Ask button hidden and never re-render. The shell reflects that
69
- * state onto itself, so watching its attributes covers the whole surface.
70
- */
58
+ /* Not every state a region renders from has an event, so watch the shell's reflected attributes to cover the whole surface. */
71
59
  this.observer = new MutationObserver(this.handleShellChange);
72
60
  this.observer.observe(found, { attributes: true });
73
61
  return true;
@@ -11,9 +11,7 @@ import { styles } from './nile-app-shell-main.css';
11
11
  import NileElement from '../internal/nile-element';
12
12
 
13
13
  /**
14
- * @summary The shell's centre region — the page body. Goes in the shell's
15
- * default slot and declares the size query container that page CSS sizes
16
- * against, which the shell itself cannot do across its shadow boundary.
14
+ * @summary The shell's centre region — the page body; declares the size query container that page CSS sizes against.
17
15
  *
18
16
  * @status stable
19
17
  * @since 2.0
@@ -24,9 +22,7 @@ import NileElement from '../internal/nile-element';
24
22
  *
25
23
  * @slot - The page body.
26
24
  *
27
- * @attr no-container - Drops the query container. Size containment makes this a
28
- * containing block for absolutely and fixed-positioned descendants; set this
29
- * when page content needs to escape to the viewport instead.
25
+ * @attr no-container - Drops the query container, so page content can escape to the viewport.
30
26
  */
31
27
  @customElement('nile-app-shell-main')
32
28
  export class NileAppShellMain extends NileElement {
@@ -6,11 +6,9 @@
6
6
  */
7
7
 
8
8
  import { css } from 'lit';
9
+ import { utilityControlStyles } from '../internal/app-shell-utility-control-styles';
9
10
 
10
- /**
11
- * AppShellNavToggle CSS. The button itself is the shared utility recipe; this
12
- * file only handles the host box and the rule.
13
- */
11
+ /** AppShellNavToggle CSS: the host box, the rule, and the utility-control recipe, since this element also mounts outside a shell. */
14
12
  export const styles = css`
15
13
  :host {
16
14
  display: inline-flex;
@@ -22,10 +20,14 @@ export const styles = css`
22
20
  display: none;
23
21
  }
24
22
 
23
+ /* Lands the 20px glyph box, not the 32px utility circle, on the 24px origin: (32 - 20) / 2 = 6. */
25
24
  .toggle {
26
- margin-inline-start: var(--nile-app-shell-nav-toggle-offset, -7px);
25
+ margin-inline-start: var(--nile-app-shell-nav-toggle-offset, -6px);
27
26
  }
28
27
 
28
+ /* The toggle itself: the shared utility-control recipe. */
29
+ ${utilityControlStyles}
30
+
29
31
  .rule {
30
32
  flex: 0 0 auto;
31
33
  width: var(--nile-border-width-1, var(--ng-border-width-1));
@@ -14,9 +14,7 @@ import NileElement from '../internal/nile-element';
14
14
  import type { NileAppShell } from '../nile-app-shell/nile-app-shell';
15
15
 
16
16
  /**
17
- * @summary The side-nav toggle, as a standalone control. `nile-app-shell`
18
- * renders one in its own top bar; mount this in a header you build yourself, or
19
- * a route has no way to expand the rail.
17
+ * @summary The side-nav toggle as a standalone control, for a header you build yourself.
20
18
  *
21
19
  * @status stable
22
20
  * @since 2.0
@@ -29,7 +27,8 @@ import type { NileAppShell } from '../nile-app-shell/nile-app-shell';
29
27
  * @csspart button - The toggle button.
30
28
  * @csspart rule - The trailing vertical rule.
31
29
  *
32
- * @cssproperty [--nile-app-shell-nav-toggle-offset=-4px] - Optical start offset.
30
+ * @cssproperty [--nile-app-shell-nav-toggle-offset=-6px] - Optical start offset, so the glyph lands on the bar's text origin.
31
+ * @cssproperty [--nile-app-shell-utility-size=32px] - Box the toggle sits in; the hit area and hover surface, not a visible chip.
33
32
  */
34
33
  @customElement('nile-app-shell-nav-toggle')
35
34
  export class NileAppShellNavToggle extends NileElement {
@@ -41,10 +40,7 @@ export class NileAppShellNavToggle extends NileElement {
41
40
  @property({ type: Boolean, reflect: true, attribute: 'with-rule' })
42
41
  withRule: boolean = false;
43
42
 
44
- /**
45
- * The shell to drive. Defaults to the nearest `nile-app-shell` ancestor, or
46
- * the element with this id.
47
- */
43
+ /** The shell to drive. Defaults to the nearest `nile-app-shell` ancestor, or the element with this id. */
48
44
  @property({ type: String })
49
45
  shell?: string;
50
46
 
@@ -98,7 +94,7 @@ export class NileAppShellNavToggle extends NileElement {
98
94
  const expanded = !this._rail;
99
95
  return html`
100
96
  <nile-button
101
- class="toggle"
97
+ class="toggle utility-control"
102
98
  part="button"
103
99
  variant="ghost"
104
100
  circle
@@ -113,8 +109,8 @@ export class NileAppShellNavToggle extends NileElement {
113
109
  @click=${this._onClick}
114
110
  >
115
111
  ${renderGlyph(
116
- expanded ? 'ng-panel-left-close' : 'ng-panel-left-open',
117
- 24,
112
+ expanded ? 'ng-panel-left' : 'ng-panel-right',
113
+ 20,
118
114
  'currentColor'
119
115
  )}
120
116
  </nile-button>
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import { css } from 'lit';
9
+ import { utilityControlStyles } from '../internal/app-shell-utility-control-styles';
9
10
 
10
11
  export const styles = css`
11
12
  :host {
@@ -23,14 +24,15 @@ export const styles = css`
23
24
  display: none;
24
25
  }
25
26
 
27
+ /* The panel header keeps its own height, never the page header's; the literal is the floor for a panel mounted outside a shell. */
26
28
  .header {
27
29
  box-sizing: border-box;
28
30
  flex: 0 0 auto;
29
31
  display: flex;
30
32
  align-items: center;
31
- gap: var(--nile-spacing-lg, var(--ng-spacing-lg));
32
- height: var(--nile-app-shell-top-bar-height, 56px);
33
- padding-inline: var(--nile-spacing-xl, var(--ng-spacing-xl));
33
+ gap: var(--nile-spacing-md, var(--ng-spacing-md));
34
+ height: var(--nile-app-shell-panel-header-height, 56px);
35
+ padding-inline: var(--nile-spacing-3xl, var(--ng-spacing-3xl));
34
36
  border-bottom: var(--nile-border-width-1, var(--ng-border-width-1)) solid
35
37
  var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
36
38
  }
@@ -39,6 +41,21 @@ export const styles = css`
39
41
  display: none;
40
42
  }
41
43
 
44
+ /* The back control for a sub-view; stands where the brand mark does in the root view. */
45
+ .back {
46
+ flex: 0 0 auto;
47
+ margin-inline-start: -6px;
48
+ }
49
+
50
+ /* Mirrors the back control's offset on the end edge: the 20px glyph, not the 32px circle, lands on the padding line. */
51
+ .close {
52
+ margin-inline-end: -6px;
53
+ }
54
+
55
+ :host([back]) .mark {
56
+ display: none;
57
+ }
58
+
42
59
  .heading {
43
60
  display: flex;
44
61
  align-items: center;
@@ -63,7 +80,9 @@ export const styles = css`
63
80
 
64
81
  .title {
65
82
  margin: 0;
66
- font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
83
+ /* Figma's Assistant Title: Text lg/Semibold, 18/28 on NxtGen. Enterprise keeps --nile-type-scale-3, and it defines no --ng-* tokens, so the line-height declaration is invalid there and the title inherits its line height exactly as before. */
84
+ font-size: var(--nile-type-scale-3, var(--ng-font-size-text-lg));
85
+ line-height: var(--ng-line-height-text-lg);
67
86
  font-weight: var(
68
87
  --nile-font-weight-semi-bold,
69
88
  var(--ng-font-weight-semibold)
@@ -85,6 +104,11 @@ export const styles = css`
85
104
  display: none;
86
105
  }
87
106
 
107
+ /* ------------------------------------------------------- utility controls */
108
+
109
+ /* The header's own icon controls (back and close): the shared utility-control recipe. */
110
+ ${utilityControlStyles}
111
+
88
112
  .body {
89
113
  flex: 1 1 auto;
90
114
  min-height: 0;
@@ -92,7 +116,8 @@ export const styles = css`
92
116
  display: flex;
93
117
  flex-direction: column;
94
118
  gap: var(--nile-spacing-xl, var(--ng-spacing-xl));
95
- padding: var(--nile-spacing-xl, var(--ng-spacing-xl));
119
+ /* 16 under the header, 24 on the sides and bottom. */
120
+ padding: var(--nile-spacing-xl, var(--ng-spacing-xl)) var(--nile-spacing-3xl, var(--ng-spacing-3xl)) var(--nile-spacing-3xl, var(--ng-spacing-3xl));
96
121
  }
97
122
 
98
123
  :host([no-padding]) .body {
@@ -101,7 +126,7 @@ export const styles = css`
101
126
 
102
127
  .footer {
103
128
  flex: 0 0 auto;
104
- padding: var(--nile-spacing-xl, var(--ng-spacing-xl));
129
+ padding: var(--nile-spacing-xl, var(--ng-spacing-xl)) var(--nile-spacing-3xl, var(--ng-spacing-3xl)) var(--nile-spacing-3xl, var(--ng-spacing-3xl));
105
130
  border-top: var(--nile-border-width-1, var(--ng-border-width-1)) solid
106
131
  var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
107
132
  }
@@ -15,10 +15,7 @@ import NileElement from '../internal/nile-element';
15
15
  import type { NileAppShellPanelMode } from '../nile-app-shell/nile-app-shell';
16
16
 
17
17
  /**
18
- * @summary The shell's right region — the AI assistant panel. Assigns itself to
19
- * the shell's `panel` slot and takes over the panel chrome: heading, actions,
20
- * close button, scroll region and composer footer. The shell keeps the geometry
21
- * — 480px docked, an overlay drawer when narrow — and the open/closed state.
18
+ * @summary The shell's right region — the AI assistant panel; takes over the panel chrome while the shell keeps the geometry and open state.
22
19
  *
23
20
  * @status stable
24
21
  * @since 2.0
@@ -29,20 +26,25 @@ import type { NileAppShellPanelMode } from '../nile-app-shell/nile-app-shell';
29
26
  * @dependency nile-glyph
30
27
  *
31
28
  * @slot - The panel body. Scrolls.
32
- * @slot header - Replaces the default heading (mark plus label).
33
- * @slot actions - Controls added before the close button.
29
+ * @slot header - Replaces the default heading (mark plus label); the back control renders before it.
30
+ * @slot actions - Controls added before the close button; size and clear their `base` part from page CSS to match the header's bare glyphs.
34
31
  * @slot footer - A composer, docked below the scroll region.
35
32
  *
36
- * @event nile-close - Emitted when the close button is pressed, after the shell
37
- * has been told to close. Cancelable is not honoured; listen to it to react,
38
- * and use `no-close` to own the control yourself.
33
+ * @event nile-close - Emitted when the close button is pressed, after the shell has been told to close.
34
+ * @event nile-back - Emitted when the back control is pressed; the page swaps its own content back.
35
+ * @event nile-panel-back - Emitted right after `nile-back` for the same press, matching the shell's built-in panel chrome, so a page listening on the shell keeps working when it slots this component. Listen for one of the two, not both, or one press is handled twice.
39
36
  *
40
37
  * @csspart header - The header bar.
38
+ * @csspart back - The back control, shown by `back`.
41
39
  * @csspart title - The default heading text.
42
40
  * @csspart actions - The header action group.
43
41
  * @csspart close - The close button.
44
42
  * @csspart body - The scrolling body.
45
43
  * @csspart footer - The footer.
44
+ *
45
+ * @cssproperty [--nile-app-shell-utility-size=32px] - Box the header's back and close controls sit in.
46
+ *
47
+ * @method goBack() - Emit `nile-back` then `nile-panel-back`, as the back control does.
46
48
  */
47
49
  @customElement('nile-app-shell-panel')
48
50
  export class NileAppShellPanel extends NileElement {
@@ -60,6 +62,14 @@ export class NileAppShellPanel extends NileElement {
60
62
  @property({ type: Boolean, reflect: true, attribute: 'no-header' })
61
63
  noHeader: boolean = false;
62
64
 
65
+ /** Shows a back control at the start of the header for a sub-view; the panel keeps no view stack and only emits `nile-back`. */
66
+ @property({ type: Boolean, reflect: true })
67
+ back: boolean = false;
68
+
69
+ /** Accessible name of the back control. */
70
+ @property({ type: String })
71
+ backLabel: string = 'Back';
72
+
63
73
  /** Drops the close button — for a panel the page closes its own way. */
64
74
  @property({ type: Boolean, reflect: true, attribute: 'no-close' })
65
75
  noClose: boolean = false;
@@ -72,10 +82,7 @@ export class NileAppShellPanel extends NileElement {
72
82
  @property({ type: String })
73
83
  shell?: string;
74
84
 
75
- /**
76
- * Mirrors the shell's panel mode. Set by the shell; treat it as read-only and
77
- * style against it (`nile-app-shell-panel[mode='overlay']`).
78
- */
85
+ /** Mirrors the shell's panel mode. Set by the shell; treat it as read-only and style against it (`nile-app-shell-panel[mode='overlay']`). */
79
86
  @property({ type: String, reflect: true })
80
87
  mode: NileAppShellPanelMode = 'docked';
81
88
 
@@ -99,6 +106,12 @@ export class NileAppShellPanel extends NileElement {
99
106
  this.setAttribute('aria-label', this.label);
100
107
  }
101
108
 
109
+ /** Announce that the back control was pressed, as the page owns which view it goes back to: `nile-back`, then `nile-panel-back` for pages written against the shell's built-in panel chrome. */
110
+ public goBack(): void {
111
+ this.emit('nile-back');
112
+ this.emit('nile-panel-back');
113
+ }
114
+
102
115
  /** Close the panel through the shell. */
103
116
  public close(): void {
104
117
  this.shellLink.shell?.closePanel();
@@ -118,16 +131,31 @@ export class NileAppShellPanel extends NileElement {
118
131
  public render(): TemplateResult {
119
132
  return html`
120
133
  <header class="header" part="header">
134
+ ${this.back
135
+ ? html`<nile-button
136
+ class="back utility-control"
137
+ part="back"
138
+ variant="ghost"
139
+ circle
140
+ title=${this.backLabel}
141
+ aria-label=${this.backLabel}
142
+ @click=${() => this.goBack()}
143
+ >
144
+ ${renderGlyph('ng-arrow-left', 20, 'currentColor')}
145
+ </nile-button>`
146
+ : ''}
121
147
  <slot name="header">
122
148
  <span class="heading">
123
- <span class="mark">${renderGlyph('ng-sparkles', 20, 'currentColor')}</span>
149
+ <span class="mark"
150
+ >${renderGlyph('ng-sparkles', 20, 'currentColor')}</span
151
+ >
124
152
  <h2 class="title" part="title">${this.label}</h2>
125
153
  </span>
126
154
  </slot>
127
155
  <div class="actions" part="actions">
128
156
  <slot name="actions"></slot>
129
157
  <nile-button
130
- class="close"
158
+ class="close utility-control"
131
159
  part="close"
132
160
  variant="ghost"
133
161
  circle
@@ -135,7 +163,7 @@ export class NileAppShellPanel extends NileElement {
135
163
  aria-label="Close ${this.label}"
136
164
  @click=${() => this.close()}
137
165
  >
138
- ${renderGlyph('ng-x-close', 24, 'currentColor')}
166
+ ${renderGlyph('ng-x-close', 20, 'currentColor')}
139
167
  </nile-button>
140
168
  </div>
141
169
  </header>
@@ -7,10 +7,7 @@
7
7
 
8
8
  import { css } from 'lit';
9
9
 
10
- /**
11
- * AppShellSideNav CSS. The shell owns the track width; this owns what happens
12
- * inside it — a pinned header, a scrolling body, a pinned footer.
13
- */
10
+ /** AppShellSideNav CSS: the shell owns the track width, this owns what happens inside it — a pinned header, a scrolling body, a pinned footer. */
14
11
  export const styles = css`
15
12
  :host {
16
13
  box-sizing: border-box;
@@ -12,9 +12,7 @@ import { AppShellController } from '../nile-app-shell/shell-controller';
12
12
  import NileElement from '../internal/nile-element';
13
13
 
14
14
  /**
15
- * @summary The shell's left region — the navigation track. Assigns itself to the
16
- * shell's `side-nav` slot and mirrors the shell's rail state, so nav content can
17
- * style against it.
15
+ * @summary The shell's left region — the navigation track; mirrors the shell's rail state so nav content can style against it.
18
16
  *
19
17
  * @status stable
20
18
  * @since 2.0
@@ -31,10 +29,8 @@ import NileElement from '../internal/nile-element';
31
29
  * @csspart body - The scrolling nav body.
32
30
  * @csspart footer - The pinned footer.
33
31
  *
34
- * @cssproperty [--nile-app-shell-side-nav-padding=12px] - Body inset. 12 + 40 +
35
- * 12 is what makes a 64px rail.
36
- * @cssproperty [--nile-app-shell-side-nav-bg=transparent] - Surface behind the
37
- * nav. Transparent by default: the nav and the page share one.
32
+ * @cssproperty [--nile-app-shell-side-nav-padding=12px] - Body inset.
33
+ * @cssproperty [--nile-app-shell-side-nav-bg=transparent] - Surface behind the nav; transparent so the nav and page share one.
38
34
  */
39
35
  @customElement('nile-app-shell-side-nav')
40
36
  export class NileAppShellSideNav extends NileElement {
@@ -44,11 +40,7 @@ export class NileAppShellSideNav extends NileElement {
44
40
 
45
41
  private shellLink = new AppShellController(this);
46
42
 
47
- /**
48
- * Mirrors the shell's effective rail state — the user's preference, or a rail
49
- * forced by the shell's width. Set by the shell; treat it as read-only and
50
- * style against it (`nile-app-shell-side-nav[collapsed] .label`).
51
- */
43
+ /** Mirrors the shell's effective rail state. Set by the shell; treat it as read-only and style against it (`nile-app-shell-side-nav[collapsed] .label`). */
52
44
  @property({ type: Boolean, reflect: true })
53
45
  collapsed: boolean = false;
54
46