@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.
- package/README.md +6 -0
- package/demo/app-shell.html +852 -0
- package/demo/nxtgen-classes.css +2 -2
- package/demo/nxtgen-properties.css +2 -2
- package/demo/nxtgen-utilities.css +2 -2
- package/demo/nxtgen.css +2 -2
- package/demo/utilities.css +2 -2
- package/demo/variables.css +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +595 -302
- package/dist/internal/app-shell-utility-control-styles.cjs.js +2 -0
- package/dist/internal/app-shell-utility-control-styles.cjs.js.map +1 -0
- package/dist/internal/app-shell-utility-control-styles.esm.js +16 -0
- package/dist/nile-app-shell/index.cjs.js +1 -1
- package/dist/nile-app-shell/index.esm.js +1 -1
- package/dist/nile-app-shell/nile-app-shell.cjs.js +1 -1
- package/dist/nile-app-shell/nile-app-shell.cjs.js.map +1 -1
- package/dist/nile-app-shell/nile-app-shell.css.cjs.js +1 -1
- package/dist/nile-app-shell/nile-app-shell.css.cjs.js.map +1 -1
- package/dist/nile-app-shell/nile-app-shell.css.esm.js +277 -96
- package/dist/nile-app-shell/nile-app-shell.esm.js +67 -11
- package/dist/nile-app-shell/shell-controller.cjs.js.map +1 -1
- package/dist/nile-app-shell-main/nile-app-shell-main.cjs.js.map +1 -1
- package/dist/nile-app-shell-nav-toggle/index.cjs.js +1 -1
- package/dist/nile-app-shell-nav-toggle/index.esm.js +1 -1
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.cjs.js +1 -1
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.cjs.js.map +1 -1
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.cjs.js +1 -1
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.cjs.js.map +1 -1
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.esm.js +7 -3
- package/dist/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.esm.js +3 -3
- package/dist/nile-app-shell-panel/index.cjs.js +1 -1
- package/dist/nile-app-shell-panel/index.esm.js +1 -1
- package/dist/nile-app-shell-panel/nile-app-shell-panel.cjs.js +1 -1
- package/dist/nile-app-shell-panel/nile-app-shell-panel.cjs.js.map +1 -1
- package/dist/nile-app-shell-panel/nile-app-shell-panel.css.cjs.js +1 -1
- package/dist/nile-app-shell-panel/nile-app-shell-panel.css.cjs.js.map +1 -1
- package/dist/nile-app-shell-panel/nile-app-shell-panel.css.esm.js +32 -8
- package/dist/nile-app-shell-panel/nile-app-shell-panel.esm.js +18 -5
- package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.cjs.js.map +1 -1
- package/dist/nile-app-shell-side-nav/nile-app-shell-side-nav.css.cjs.js.map +1 -1
- package/dist/src/internal/app-shell-utility-control-styles.d.ts +12 -0
- package/dist/src/internal/app-shell-utility-control-styles.js +29 -0
- package/dist/src/internal/app-shell-utility-control-styles.js.map +1 -0
- package/dist/src/nile-app-shell/nile-app-shell-regions.test.d.ts +3 -0
- package/dist/src/nile-app-shell/nile-app-shell-regions.test.js +210 -0
- package/dist/src/nile-app-shell/nile-app-shell-regions.test.js.map +1 -1
- package/dist/src/nile-app-shell/nile-app-shell.css.d.ts +1 -9
- package/dist/src/nile-app-shell/nile-app-shell.css.js +277 -103
- package/dist/src/nile-app-shell/nile-app-shell.css.js.map +1 -1
- package/dist/src/nile-app-shell/nile-app-shell.d.ts +90 -122
- package/dist/src/nile-app-shell/nile-app-shell.js +235 -144
- package/dist/src/nile-app-shell/nile-app-shell.js.map +1 -1
- package/dist/src/nile-app-shell/nile-app-shell.test.d.ts +4 -0
- package/dist/src/nile-app-shell/nile-app-shell.test.js +1116 -29
- package/dist/src/nile-app-shell/nile-app-shell.test.js.map +1 -1
- package/dist/src/nile-app-shell/shell-controller.d.ts +1 -8
- package/dist/src/nile-app-shell/shell-controller.js +2 -14
- package/dist/src/nile-app-shell/shell-controller.js.map +1 -1
- package/dist/src/nile-app-shell-main/nile-app-shell-main.d.ts +2 -6
- package/dist/src/nile-app-shell-main/nile-app-shell-main.js +2 -6
- package/dist/src/nile-app-shell-main/nile-app-shell-main.js.map +1 -1
- package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.d.ts +1 -4
- package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.js +7 -5
- package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.js.map +1 -1
- package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.d.ts +4 -8
- package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.js +5 -6
- package/dist/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.js.map +1 -1
- package/dist/src/nile-app-shell-panel/nile-app-shell-panel.css.js +31 -6
- package/dist/src/nile-app-shell-panel/nile-app-shell-panel.css.js.map +1 -1
- package/dist/src/nile-app-shell-panel/nile-app-shell-panel.d.ts +18 -13
- package/dist/src/nile-app-shell-panel/nile-app-shell-panel.js +45 -16
- package/dist/src/nile-app-shell-panel/nile-app-shell-panel.js.map +1 -1
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.d.ts +1 -4
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.js +1 -4
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.js.map +1 -1
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.d.ts +4 -12
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.js +4 -12
- package/dist/src/nile-app-shell-side-nav/nile-app-shell-side-nav.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/version.cjs.js +1 -1
- package/dist/version.cjs.js.map +1 -1
- package/dist/version.esm.js +1 -1
- package/package.json +1 -1
- package/plop-templates/lit/lit.test.ts.hbs +22 -0
- package/plop-templates/lit/lit.ts.hbs +10 -5
- package/plopfile.js +12 -0
- package/src/internal/app-shell-utility-control-styles.ts +30 -0
- package/src/nile-app-shell/nile-app-shell-regions.test.ts +252 -0
- package/src/nile-app-shell/nile-app-shell.css.ts +277 -103
- package/src/nile-app-shell/nile-app-shell.test.ts +1363 -29
- package/src/nile-app-shell/nile-app-shell.ts +249 -149
- package/src/nile-app-shell/shell-controller.ts +2 -14
- package/src/nile-app-shell-main/nile-app-shell-main.ts +2 -6
- package/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.ts +7 -5
- package/src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.ts +7 -11
- package/src/nile-app-shell-panel/nile-app-shell-panel.css.ts +31 -6
- package/src/nile-app-shell-panel/nile-app-shell-panel.ts +44 -16
- package/src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.ts +1 -4
- package/src/nile-app-shell-side-nav/nile-app-shell-side-nav.ts +4 -12
- package/vscode-html-custom-data.json +85 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-app-shell-main.js","sourceRoot":"","sources":["../../../src/nile-app-shell-main/nile-app-shell-main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"nile-app-shell-main.js","sourceRoot":"","sources":["../../../src/nile-app-shell-main/nile-app-shell-main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,WAAW;IAA1C;;QAKL,sCAAsC;QAEtC,gBAAW,GAAY,KAAK,CAAC;IAK/B,CAAC;IAXQ,MAAM,KAAK,MAAM;QACtB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAMM,MAAM;QACX,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;CACF,CAAA;AALC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;qDACzC;AAPlB,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CAY5B;;AAED,eAAe,gBAAgB,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-app-shell-main.css';\nimport NileElement from '../internal/nile-element';\n\n/**\n * @summary The shell's centre region — the page body; declares the size query container that page CSS sizes against.\n *\n * @status stable\n * @since 2.0\n *\n * @tag nile-app-shell-main\n *\n * @dependency nile-app-shell\n *\n * @slot - The page body.\n *\n * @attr no-container - Drops the query container, so page content can escape to the viewport.\n */\n@customElement('nile-app-shell-main')\nexport class NileAppShellMain extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /** Drops the size query container. */\n @property({ type: Boolean, reflect: true, attribute: 'no-container' })\n noContainer: boolean = false;\n\n public render(): TemplateResult {\n return html`<slot></slot>`;\n }\n}\n\nexport default NileAppShellMain;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-app-shell-main': NileAppShellMain;\n }\n}\n"]}
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
* AppShellNavToggle CSS. The button itself is the shared utility recipe; this
|
|
9
|
-
* file only handles the host box and the rule.
|
|
10
|
-
*/
|
|
7
|
+
/** AppShellNavToggle CSS: the host box, the rule, and the utility-control recipe, since this element also mounts outside a shell. */
|
|
11
8
|
export declare const styles: import("lit").CSSResult;
|
|
12
9
|
declare const _default: import("lit").CSSResult[];
|
|
13
10
|
export default _default;
|
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { css } from 'lit';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* file only handles the host box and the rule.
|
|
11
|
-
*/
|
|
8
|
+
import { utilityControlStyles } from '../internal/app-shell-utility-control-styles';
|
|
9
|
+
/** AppShellNavToggle CSS: the host box, the rule, and the utility-control recipe, since this element also mounts outside a shell. */
|
|
12
10
|
export const styles = css `
|
|
13
11
|
:host {
|
|
14
12
|
display: inline-flex;
|
|
@@ -20,10 +18,14 @@ export const styles = css `
|
|
|
20
18
|
display: none;
|
|
21
19
|
}
|
|
22
20
|
|
|
21
|
+
/* Lands the 20px glyph box, not the 32px utility circle, on the 24px origin: (32 - 20) / 2 = 6. */
|
|
23
22
|
.toggle {
|
|
24
|
-
margin-inline-start: var(--nile-app-shell-nav-toggle-offset, -
|
|
23
|
+
margin-inline-start: var(--nile-app-shell-nav-toggle-offset, -6px);
|
|
25
24
|
}
|
|
26
25
|
|
|
26
|
+
/* The toggle itself: the shared utility-control recipe. */
|
|
27
|
+
${utilityControlStyles}
|
|
28
|
+
|
|
27
29
|
.rule {
|
|
28
30
|
flex: 0 0 auto;
|
|
29
31
|
width: var(--nile-border-width-1, var(--ng-border-width-1));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-app-shell-nav-toggle.css.js","sourceRoot":"","sources":["../../../src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"nile-app-shell-nav-toggle.css.js","sourceRoot":"","sources":["../../../src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAEpF,qIAAqI;AACrI,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;IAiBrB,oBAAoB;;;;;;;;;;;;;;;CAevB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\nimport { utilityControlStyles } from '../internal/app-shell-utility-control-styles';\n\n/** AppShellNavToggle CSS: the host box, the rule, and the utility-control recipe, since this element also mounts outside a shell. */\nexport const styles = css`\n :host {\n display: inline-flex;\n align-items: center;\n gap: var(--nile-spacing-lg, var(--ng-spacing-lg));\n }\n\n :host([hidden]) {\n display: none;\n }\n\n /* Lands the 20px glyph box, not the 32px utility circle, on the 24px origin: (32 - 20) / 2 = 6. */\n .toggle {\n margin-inline-start: var(--nile-app-shell-nav-toggle-offset, -6px);\n }\n\n /* The toggle itself: the shared utility-control recipe. */\n ${utilityControlStyles}\n\n .rule {\n flex: 0 0 auto;\n width: var(--nile-border-width-1, var(--ng-border-width-1));\n height: 24px;\n background: var(\n --nile-colors-neutral-400,\n var(--ng-colors-border-secondary)\n );\n }\n\n :host(:not([with-rule])) .rule {\n display: none;\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -9,9 +9,7 @@ import '../nile-button/nile-button';
|
|
|
9
9
|
import NileElement from '../internal/nile-element';
|
|
10
10
|
import type { NileAppShell } from '../nile-app-shell/nile-app-shell';
|
|
11
11
|
/**
|
|
12
|
-
* @summary The side-nav toggle
|
|
13
|
-
* renders one in its own top bar; mount this in a header you build yourself, or
|
|
14
|
-
* a route has no way to expand the rail.
|
|
12
|
+
* @summary The side-nav toggle as a standalone control, for a header you build yourself.
|
|
15
13
|
*
|
|
16
14
|
* @status stable
|
|
17
15
|
* @since 2.0
|
|
@@ -24,16 +22,14 @@ import type { NileAppShell } from '../nile-app-shell/nile-app-shell';
|
|
|
24
22
|
* @csspart button - The toggle button.
|
|
25
23
|
* @csspart rule - The trailing vertical rule.
|
|
26
24
|
*
|
|
27
|
-
* @cssproperty [--nile-app-shell-nav-toggle-offset=-
|
|
25
|
+
* @cssproperty [--nile-app-shell-nav-toggle-offset=-6px] - Optical start offset, so the glyph lands on the bar's text origin.
|
|
26
|
+
* @cssproperty [--nile-app-shell-utility-size=32px] - Box the toggle sits in; the hit area and hover surface, not a visible chip.
|
|
28
27
|
*/
|
|
29
28
|
export declare class NileAppShellNavToggle extends NileElement {
|
|
30
29
|
static get styles(): CSSResultArray;
|
|
31
30
|
/** Draws the vertical rule the shell's own bar puts after the toggle. */
|
|
32
31
|
withRule: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* The shell to drive. Defaults to the nearest `nile-app-shell` ancestor, or
|
|
35
|
-
* the element with this id.
|
|
36
|
-
*/
|
|
32
|
+
/** The shell to drive. Defaults to the nearest `nile-app-shell` ancestor, or the element with this id. */
|
|
37
33
|
shell?: string;
|
|
38
34
|
private _rail;
|
|
39
35
|
private _locked;
|
|
@@ -12,9 +12,7 @@ import { renderGlyph } from '../internal/glyph';
|
|
|
12
12
|
import '../nile-button/nile-button';
|
|
13
13
|
import NileElement from '../internal/nile-element';
|
|
14
14
|
/**
|
|
15
|
-
* @summary The side-nav toggle
|
|
16
|
-
* renders one in its own top bar; mount this in a header you build yourself, or
|
|
17
|
-
* a route has no way to expand the rail.
|
|
15
|
+
* @summary The side-nav toggle as a standalone control, for a header you build yourself.
|
|
18
16
|
*
|
|
19
17
|
* @status stable
|
|
20
18
|
* @since 2.0
|
|
@@ -27,7 +25,8 @@ import NileElement from '../internal/nile-element';
|
|
|
27
25
|
* @csspart button - The toggle button.
|
|
28
26
|
* @csspart rule - The trailing vertical rule.
|
|
29
27
|
*
|
|
30
|
-
* @cssproperty [--nile-app-shell-nav-toggle-offset=-
|
|
28
|
+
* @cssproperty [--nile-app-shell-nav-toggle-offset=-6px] - Optical start offset, so the glyph lands on the bar's text origin.
|
|
29
|
+
* @cssproperty [--nile-app-shell-utility-size=32px] - Box the toggle sits in; the hit area and hover surface, not a visible chip.
|
|
31
30
|
*/
|
|
32
31
|
let NileAppShellNavToggle = class NileAppShellNavToggle extends NileElement {
|
|
33
32
|
constructor() {
|
|
@@ -86,7 +85,7 @@ let NileAppShellNavToggle = class NileAppShellNavToggle extends NileElement {
|
|
|
86
85
|
const expanded = !this._rail;
|
|
87
86
|
return html `
|
|
88
87
|
<nile-button
|
|
89
|
-
class="toggle"
|
|
88
|
+
class="toggle utility-control"
|
|
90
89
|
part="button"
|
|
91
90
|
variant="ghost"
|
|
92
91
|
circle
|
|
@@ -100,7 +99,7 @@ let NileAppShellNavToggle = class NileAppShellNavToggle extends NileElement {
|
|
|
100
99
|
aria-label=${expanded ? 'Collapse navigation' : 'Expand navigation'}
|
|
101
100
|
@click=${this._onClick}
|
|
102
101
|
>
|
|
103
|
-
${renderGlyph(expanded ? 'ng-panel-left
|
|
102
|
+
${renderGlyph(expanded ? 'ng-panel-left' : 'ng-panel-right', 20, 'currentColor')}
|
|
104
103
|
</nile-button>
|
|
105
104
|
<span class="rule" part="rule"></span>
|
|
106
105
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-app-shell-nav-toggle.js","sourceRoot":"","sources":["../../../src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,4BAA4B,CAAC;AACpC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD
|
|
1
|
+
{"version":3,"file":"nile-app-shell-nav-toggle.js","sourceRoot":"","sources":["../../../src/nile-app-shell-nav-toggle/nile-app-shell-nav-toggle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,4BAA4B,CAAC;AACpC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,WAAW;IAA/C;;QAKL,yEAAyE;QAEzE,aAAQ,GAAY,KAAK,CAAC;QAMT,UAAK,GAAY,KAAK,CAAC;QACvB,YAAO,GAAY,KAAK,CAAC;QAkClC,mBAAc,GAAG,GAAS,EAAE;YAClC,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CAAC;QAqCM,aAAQ,GAAG,GAAS,EAAE;YAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC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the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { styles } from './nile-app-shell-nav-toggle.css';\nimport { renderGlyph } from '../internal/glyph';\nimport '../nile-button/nile-button';\nimport NileElement from '../internal/nile-element';\nimport type { NileAppShell } from '../nile-app-shell/nile-app-shell';\n\n/**\n * @summary The side-nav toggle as a standalone control, for a header you build yourself.\n *\n * @status stable\n * @since 2.0\n *\n * @tag nile-app-shell-nav-toggle\n *\n * @dependency nile-app-shell\n * @dependency nile-glyph\n *\n * @csspart button - The toggle button.\n * @csspart rule - The trailing vertical rule.\n *\n * @cssproperty [--nile-app-shell-nav-toggle-offset=-6px] - Optical start offset, so the glyph lands on the bar's text origin.\n * @cssproperty [--nile-app-shell-utility-size=32px] - Box the toggle sits in; the hit area and hover surface, not a visible chip.\n */\n@customElement('nile-app-shell-nav-toggle')\nexport class NileAppShellNavToggle extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /** Draws the vertical rule the shell's own bar puts after the toggle. */\n @property({ type: Boolean, reflect: true, attribute: 'with-rule' })\n withRule: boolean = false;\n\n /** The shell to drive. Defaults to the nearest `nile-app-shell` ancestor, or the element with this id. */\n @property({ type: String })\n shell?: string;\n\n @state() private _rail: boolean = false;\n @state() private _locked: boolean = false;\n\n private _observed?: NileAppShell;\n\n public connectedCallback(): void {\n super.connectedCallback();\n // The shell may upgrade after this element does, so read it on a microtask.\n Promise.resolve().then(() => this._attach());\n }\n\n public disconnectedCallback(): void {\n super.disconnectedCallback();\n this._observed?.removeEventListener('nile-nav-toggle', this._onShellToggle);\n this._observed = undefined;\n }\n\n /** The shell this toggle drives, if it found one. */\n public get appShell(): NileAppShell | null {\n if (this.shell) {\n const root = this.getRootNode() as Document | ShadowRoot;\n return (root.querySelector(`#${this.shell}`) as NileAppShell) ?? null;\n }\n return this.closest('nile-app-shell') ?? null;\n }\n\n private _attach(): void {\n const shell = this.appShell;\n if (!shell || shell === this._observed) return;\n this._observed?.removeEventListener('nile-nav-toggle', this._onShellToggle);\n this._observed = shell;\n shell.addEventListener('nile-nav-toggle', this._onShellToggle);\n this._sync();\n }\n\n private _onShellToggle = (): void => {\n this._sync();\n };\n\n private _sync(): void {\n const shell = this._observed;\n if (!shell) return;\n this._rail = shell.rail;\n this._locked = shell.navLocked;\n }\n\n public render(): TemplateResult {\n const expanded = !this._rail;\n return html`\n <nile-button\n class=\"toggle utility-control\"\n part=\"button\"\n variant=\"ghost\"\n circle\n aria-expanded=${expanded ? 'true' : 'false'}\n ?disabled=${this._locked}\n title=${this._locked\n ? 'The navigation stays collapsed at this window width'\n : expanded\n ? 'Collapse navigation'\n : 'Expand navigation'}\n aria-label=${expanded ? 'Collapse navigation' : 'Expand navigation'}\n @click=${this._onClick}\n >\n ${renderGlyph(\n expanded ? 'ng-panel-left' : 'ng-panel-right',\n 20,\n 'currentColor'\n )}\n </nile-button>\n <span class=\"rule\" part=\"rule\"></span>\n `;\n }\n\n private _onClick = (): void => {\n this._attach();\n this._observed?.toggleNav();\n this._sync();\n };\n}\n\nexport default NileAppShellNavToggle;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-app-shell-nav-toggle': NileAppShellNavToggle;\n }\n}\n"]}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { css } from 'lit';
|
|
8
|
+
import { utilityControlStyles } from '../internal/app-shell-utility-control-styles';
|
|
8
9
|
export const styles = css `
|
|
9
10
|
:host {
|
|
10
11
|
box-sizing: border-box;
|
|
@@ -21,14 +22,15 @@ export const styles = css `
|
|
|
21
22
|
display: none;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
/* The panel header keeps its own height, never the page header's; the literal is the floor for a panel mounted outside a shell. */
|
|
24
26
|
.header {
|
|
25
27
|
box-sizing: border-box;
|
|
26
28
|
flex: 0 0 auto;
|
|
27
29
|
display: flex;
|
|
28
30
|
align-items: center;
|
|
29
|
-
gap: var(--nile-spacing-
|
|
30
|
-
height: var(--nile-app-shell-
|
|
31
|
-
padding-inline: var(--nile-spacing-
|
|
31
|
+
gap: var(--nile-spacing-md, var(--ng-spacing-md));
|
|
32
|
+
height: var(--nile-app-shell-panel-header-height, 56px);
|
|
33
|
+
padding-inline: var(--nile-spacing-3xl, var(--ng-spacing-3xl));
|
|
32
34
|
border-bottom: var(--nile-border-width-1, var(--ng-border-width-1)) solid
|
|
33
35
|
var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
34
36
|
}
|
|
@@ -37,6 +39,21 @@ export const styles = css `
|
|
|
37
39
|
display: none;
|
|
38
40
|
}
|
|
39
41
|
|
|
42
|
+
/* The back control for a sub-view; stands where the brand mark does in the root view. */
|
|
43
|
+
.back {
|
|
44
|
+
flex: 0 0 auto;
|
|
45
|
+
margin-inline-start: -6px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Mirrors the back control's offset on the end edge: the 20px glyph, not the 32px circle, lands on the padding line. */
|
|
49
|
+
.close {
|
|
50
|
+
margin-inline-end: -6px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([back]) .mark {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
40
57
|
.heading {
|
|
41
58
|
display: flex;
|
|
42
59
|
align-items: center;
|
|
@@ -61,7 +78,9 @@ export const styles = css `
|
|
|
61
78
|
|
|
62
79
|
.title {
|
|
63
80
|
margin: 0;
|
|
64
|
-
|
|
81
|
+
/* 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. */
|
|
82
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-lg));
|
|
83
|
+
line-height: var(--ng-line-height-text-lg);
|
|
65
84
|
font-weight: var(
|
|
66
85
|
--nile-font-weight-semi-bold,
|
|
67
86
|
var(--ng-font-weight-semibold)
|
|
@@ -83,6 +102,11 @@ export const styles = css `
|
|
|
83
102
|
display: none;
|
|
84
103
|
}
|
|
85
104
|
|
|
105
|
+
/* ------------------------------------------------------- utility controls */
|
|
106
|
+
|
|
107
|
+
/* The header's own icon controls (back and close): the shared utility-control recipe. */
|
|
108
|
+
${utilityControlStyles}
|
|
109
|
+
|
|
86
110
|
.body {
|
|
87
111
|
flex: 1 1 auto;
|
|
88
112
|
min-height: 0;
|
|
@@ -90,7 +114,8 @@ export const styles = css `
|
|
|
90
114
|
display: flex;
|
|
91
115
|
flex-direction: column;
|
|
92
116
|
gap: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
93
|
-
|
|
117
|
+
/* 16 under the header, 24 on the sides and bottom. */
|
|
118
|
+
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));
|
|
94
119
|
}
|
|
95
120
|
|
|
96
121
|
:host([no-padding]) .body {
|
|
@@ -99,7 +124,7 @@ export const styles = css `
|
|
|
99
124
|
|
|
100
125
|
.footer {
|
|
101
126
|
flex: 0 0 auto;
|
|
102
|
-
padding: var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
127
|
+
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));
|
|
103
128
|
border-top: var(--nile-border-width-1, var(--ng-border-width-1)) solid
|
|
104
129
|
var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
105
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-app-shell-panel.css.js","sourceRoot":"","sources":["../../../src/nile-app-shell-panel/nile-app-shell-panel.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"nile-app-shell-panel.css.js","sourceRoot":"","sources":["../../../src/nile-app-shell-panel/nile-app-shell-panel.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAEpF,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmGrB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BvB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\nimport { utilityControlStyles } from '../internal/app-shell-utility-control-styles';\n\nexport const styles = css`\n :host {\n box-sizing: border-box;\n /* A flex item of the shell's panel region, filling it. */\n flex: 1 1 auto;\n display: flex;\n flex-direction: column;\n min-height: 0;\n height: 100%;\n overflow: hidden;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n /* The panel header keeps its own height, never the page header's; the literal is the floor for a panel mounted outside a shell. */\n .header {\n box-sizing: border-box;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-md));\n height: var(--nile-app-shell-panel-header-height, 56px);\n padding-inline: var(--nile-spacing-3xl, var(--ng-spacing-3xl));\n border-bottom: var(--nile-border-width-1, var(--ng-border-width-1)) solid\n var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n\n :host([no-header]) .header {\n display: none;\n }\n\n /* The back control for a sub-view; stands where the brand mark does in the root view. */\n .back {\n flex: 0 0 auto;\n margin-inline-start: -6px;\n }\n\n /* Mirrors the back control's offset on the end edge: the 20px glyph, not the 32px circle, lands on the padding line. */\n .close {\n margin-inline-end: -6px;\n }\n\n :host([back]) .mark {\n display: none;\n }\n\n .heading {\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-md));\n min-width: 0;\n }\n\n .mark {\n display: inline-flex;\n color: var(\n --nile-colors-primary-600,\n var(--ng-colors-fg-brand-primary-600)\n );\n }\n\n .mark nile-glyph {\n --nile-svg-fill: currentColor;\n --nile-svg-stroke-width: var(--ng-svg-stroke-width);\n width: 20px;\n height: 20px;\n }\n\n .title {\n margin: 0;\n /* 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. */\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-lg));\n line-height: var(--ng-line-height-text-lg);\n font-weight: var(\n --nile-font-weight-semi-bold,\n var(--ng-font-weight-semibold)\n );\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .actions {\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-xs, var(--ng-spacing-xs));\n margin-inline-start: auto;\n }\n\n :host([no-close]) .close {\n display: none;\n }\n\n /* ------------------------------------------------------- utility controls */\n\n /* The header's own icon controls (back and close): the shared utility-control recipe. */\n ${utilityControlStyles}\n\n .body {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-xl, var(--ng-spacing-xl));\n /* 16 under the header, 24 on the sides and bottom. */\n 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));\n }\n\n :host([no-padding]) .body {\n padding: 0;\n }\n\n .footer {\n flex: 0 0 auto;\n 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));\n border-top: var(--nile-border-width-1, var(--ng-border-width-1)) solid\n var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n\n :host(:not([has-footer])) .footer {\n display: none;\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -9,10 +9,7 @@ import '../nile-button/nile-button';
|
|
|
9
9
|
import NileElement from '../internal/nile-element';
|
|
10
10
|
import type { NileAppShellPanelMode } from '../nile-app-shell/nile-app-shell';
|
|
11
11
|
/**
|
|
12
|
-
* @summary The shell's right region — the AI assistant panel
|
|
13
|
-
* the shell's `panel` slot and takes over the panel chrome: heading, actions,
|
|
14
|
-
* close button, scroll region and composer footer. The shell keeps the geometry
|
|
15
|
-
* — 480px docked, an overlay drawer when narrow — and the open/closed state.
|
|
12
|
+
* @summary The shell's right region — the AI assistant panel; takes over the panel chrome while the shell keeps the geometry and open state.
|
|
16
13
|
*
|
|
17
14
|
* @status stable
|
|
18
15
|
* @since 2.0
|
|
@@ -23,20 +20,25 @@ import type { NileAppShellPanelMode } from '../nile-app-shell/nile-app-shell';
|
|
|
23
20
|
* @dependency nile-glyph
|
|
24
21
|
*
|
|
25
22
|
* @slot - The panel body. Scrolls.
|
|
26
|
-
* @slot header - Replaces the default heading (mark plus label).
|
|
27
|
-
* @slot actions - Controls added before the close button.
|
|
23
|
+
* @slot header - Replaces the default heading (mark plus label); the back control renders before it.
|
|
24
|
+
* @slot actions - Controls added before the close button; size and clear their `base` part from page CSS to match the header's bare glyphs.
|
|
28
25
|
* @slot footer - A composer, docked below the scroll region.
|
|
29
26
|
*
|
|
30
|
-
* @event nile-close - Emitted when the close button is pressed, after the shell
|
|
31
|
-
*
|
|
32
|
-
*
|
|
27
|
+
* @event nile-close - Emitted when the close button is pressed, after the shell has been told to close.
|
|
28
|
+
* @event nile-back - Emitted when the back control is pressed; the page swaps its own content back.
|
|
29
|
+
* @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.
|
|
33
30
|
*
|
|
34
31
|
* @csspart header - The header bar.
|
|
32
|
+
* @csspart back - The back control, shown by `back`.
|
|
35
33
|
* @csspart title - The default heading text.
|
|
36
34
|
* @csspart actions - The header action group.
|
|
37
35
|
* @csspart close - The close button.
|
|
38
36
|
* @csspart body - The scrolling body.
|
|
39
37
|
* @csspart footer - The footer.
|
|
38
|
+
*
|
|
39
|
+
* @cssproperty [--nile-app-shell-utility-size=32px] - Box the header's back and close controls sit in.
|
|
40
|
+
*
|
|
41
|
+
* @method goBack() - Emit `nile-back` then `nile-panel-back`, as the back control does.
|
|
40
42
|
*/
|
|
41
43
|
export declare class NileAppShellPanel extends NileElement {
|
|
42
44
|
static get styles(): CSSResultArray;
|
|
@@ -45,21 +47,24 @@ export declare class NileAppShellPanel extends NileElement {
|
|
|
45
47
|
label: string;
|
|
46
48
|
/** Drops the header bar entirely. */
|
|
47
49
|
noHeader: boolean;
|
|
50
|
+
/** 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`. */
|
|
51
|
+
back: boolean;
|
|
52
|
+
/** Accessible name of the back control. */
|
|
53
|
+
backLabel: string;
|
|
48
54
|
/** Drops the close button — for a panel the page closes its own way. */
|
|
49
55
|
noClose: boolean;
|
|
50
56
|
/** Removes the body's padding, for a full-bleed transcript. */
|
|
51
57
|
noPadding: boolean;
|
|
52
58
|
/** Id of the shell to follow. Defaults to the nearest ancestor. */
|
|
53
59
|
shell?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Mirrors the shell's panel mode. Set by the shell; treat it as read-only and
|
|
56
|
-
* style against it (`nile-app-shell-panel[mode='overlay']`).
|
|
57
|
-
*/
|
|
60
|
+
/** 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']`). */
|
|
58
61
|
mode: NileAppShellPanelMode;
|
|
59
62
|
private _hasFooter;
|
|
60
63
|
connectedCallback(): void;
|
|
61
64
|
protected willUpdate(): void;
|
|
62
65
|
protected updated(): void;
|
|
66
|
+
/** 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. */
|
|
67
|
+
goBack(): void;
|
|
63
68
|
/** Close the panel through the shell. */
|
|
64
69
|
close(): void;
|
|
65
70
|
private handleFooterSlotChange;
|
|
@@ -13,10 +13,7 @@ import { AppShellController } from '../nile-app-shell/shell-controller';
|
|
|
13
13
|
import '../nile-button/nile-button';
|
|
14
14
|
import NileElement from '../internal/nile-element';
|
|
15
15
|
/**
|
|
16
|
-
* @summary The shell's right region — the AI assistant panel
|
|
17
|
-
* the shell's `panel` slot and takes over the panel chrome: heading, actions,
|
|
18
|
-
* close button, scroll region and composer footer. The shell keeps the geometry
|
|
19
|
-
* — 480px docked, an overlay drawer when narrow — and the open/closed state.
|
|
16
|
+
* @summary The shell's right region — the AI assistant panel; takes over the panel chrome while the shell keeps the geometry and open state.
|
|
20
17
|
*
|
|
21
18
|
* @status stable
|
|
22
19
|
* @since 2.0
|
|
@@ -27,20 +24,25 @@ import NileElement from '../internal/nile-element';
|
|
|
27
24
|
* @dependency nile-glyph
|
|
28
25
|
*
|
|
29
26
|
* @slot - The panel body. Scrolls.
|
|
30
|
-
* @slot header - Replaces the default heading (mark plus label).
|
|
31
|
-
* @slot actions - Controls added before the close button.
|
|
27
|
+
* @slot header - Replaces the default heading (mark plus label); the back control renders before it.
|
|
28
|
+
* @slot actions - Controls added before the close button; size and clear their `base` part from page CSS to match the header's bare glyphs.
|
|
32
29
|
* @slot footer - A composer, docked below the scroll region.
|
|
33
30
|
*
|
|
34
|
-
* @event nile-close - Emitted when the close button is pressed, after the shell
|
|
35
|
-
*
|
|
36
|
-
*
|
|
31
|
+
* @event nile-close - Emitted when the close button is pressed, after the shell has been told to close.
|
|
32
|
+
* @event nile-back - Emitted when the back control is pressed; the page swaps its own content back.
|
|
33
|
+
* @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.
|
|
37
34
|
*
|
|
38
35
|
* @csspart header - The header bar.
|
|
36
|
+
* @csspart back - The back control, shown by `back`.
|
|
39
37
|
* @csspart title - The default heading text.
|
|
40
38
|
* @csspart actions - The header action group.
|
|
41
39
|
* @csspart close - The close button.
|
|
42
40
|
* @csspart body - The scrolling body.
|
|
43
41
|
* @csspart footer - The footer.
|
|
42
|
+
*
|
|
43
|
+
* @cssproperty [--nile-app-shell-utility-size=32px] - Box the header's back and close controls sit in.
|
|
44
|
+
*
|
|
45
|
+
* @method goBack() - Emit `nile-back` then `nile-panel-back`, as the back control does.
|
|
44
46
|
*/
|
|
45
47
|
let NileAppShellPanel = class NileAppShellPanel extends NileElement {
|
|
46
48
|
constructor() {
|
|
@@ -50,14 +52,15 @@ let NileAppShellPanel = class NileAppShellPanel extends NileElement {
|
|
|
50
52
|
this.label = 'Ask Aquera';
|
|
51
53
|
/** Drops the header bar entirely. */
|
|
52
54
|
this.noHeader = false;
|
|
55
|
+
/** 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`. */
|
|
56
|
+
this.back = false;
|
|
57
|
+
/** Accessible name of the back control. */
|
|
58
|
+
this.backLabel = 'Back';
|
|
53
59
|
/** Drops the close button — for a panel the page closes its own way. */
|
|
54
60
|
this.noClose = false;
|
|
55
61
|
/** Removes the body's padding, for a full-bleed transcript. */
|
|
56
62
|
this.noPadding = false;
|
|
57
|
-
/**
|
|
58
|
-
* Mirrors the shell's panel mode. Set by the shell; treat it as read-only and
|
|
59
|
-
* style against it (`nile-app-shell-panel[mode='overlay']`).
|
|
60
|
-
*/
|
|
63
|
+
/** 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']`). */
|
|
61
64
|
this.mode = 'docked';
|
|
62
65
|
this._hasFooter = false;
|
|
63
66
|
}
|
|
@@ -82,6 +85,11 @@ let NileAppShellPanel = class NileAppShellPanel extends NileElement {
|
|
|
82
85
|
this.toggleAttribute('has-footer', this._hasFooter);
|
|
83
86
|
this.setAttribute('aria-label', this.label);
|
|
84
87
|
}
|
|
88
|
+
/** 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. */
|
|
89
|
+
goBack() {
|
|
90
|
+
this.emit('nile-back');
|
|
91
|
+
this.emit('nile-panel-back');
|
|
92
|
+
}
|
|
85
93
|
/** Close the panel through the shell. */
|
|
86
94
|
close() {
|
|
87
95
|
this.shellLink.shell?.closePanel();
|
|
@@ -96,16 +104,31 @@ let NileAppShellPanel = class NileAppShellPanel extends NileElement {
|
|
|
96
104
|
render() {
|
|
97
105
|
return html `
|
|
98
106
|
<header class="header" part="header">
|
|
107
|
+
${this.back
|
|
108
|
+
? html `<nile-button
|
|
109
|
+
class="back utility-control"
|
|
110
|
+
part="back"
|
|
111
|
+
variant="ghost"
|
|
112
|
+
circle
|
|
113
|
+
title=${this.backLabel}
|
|
114
|
+
aria-label=${this.backLabel}
|
|
115
|
+
@click=${() => this.goBack()}
|
|
116
|
+
>
|
|
117
|
+
${renderGlyph('ng-arrow-left', 20, 'currentColor')}
|
|
118
|
+
</nile-button>`
|
|
119
|
+
: ''}
|
|
99
120
|
<slot name="header">
|
|
100
121
|
<span class="heading">
|
|
101
|
-
<span class="mark"
|
|
122
|
+
<span class="mark"
|
|
123
|
+
>${renderGlyph('ng-sparkles', 20, 'currentColor')}</span
|
|
124
|
+
>
|
|
102
125
|
<h2 class="title" part="title">${this.label}</h2>
|
|
103
126
|
</span>
|
|
104
127
|
</slot>
|
|
105
128
|
<div class="actions" part="actions">
|
|
106
129
|
<slot name="actions"></slot>
|
|
107
130
|
<nile-button
|
|
108
|
-
class="close"
|
|
131
|
+
class="close utility-control"
|
|
109
132
|
part="close"
|
|
110
133
|
variant="ghost"
|
|
111
134
|
circle
|
|
@@ -113,7 +136,7 @@ let NileAppShellPanel = class NileAppShellPanel extends NileElement {
|
|
|
113
136
|
aria-label="Close ${this.label}"
|
|
114
137
|
@click=${() => this.close()}
|
|
115
138
|
>
|
|
116
|
-
${renderGlyph('ng-x-close',
|
|
139
|
+
${renderGlyph('ng-x-close', 20, 'currentColor')}
|
|
117
140
|
</nile-button>
|
|
118
141
|
</div>
|
|
119
142
|
</header>
|
|
@@ -135,6 +158,12 @@ __decorate([
|
|
|
135
158
|
__decorate([
|
|
136
159
|
property({ type: Boolean, reflect: true, attribute: 'no-header' })
|
|
137
160
|
], NileAppShellPanel.prototype, "noHeader", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
property({ type: Boolean, reflect: true })
|
|
163
|
+
], NileAppShellPanel.prototype, "back", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
property({ type: String })
|
|
166
|
+
], NileAppShellPanel.prototype, "backLabel", void 0);
|
|
138
167
|
__decorate([
|
|
139
168
|
property({ type: Boolean, reflect: true, attribute: 'no-close' })
|
|
140
169
|
], NileAppShellPanel.prototype, "noClose", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-app-shell-panel.js","sourceRoot":"","sources":["../../../src/nile-app-shell-panel/nile-app-shell-panel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,4BAA4B,CAAC;AACpC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEI,IAAM,iBAAiB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Q,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACZ;AAOf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACH;AAEtB;IAAhB,KAAK,EAAE;qDAAqC;AAlClC,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAyG7B;;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { styles } from './nile-app-shell-panel.css';\nimport { renderGlyph } from '../internal/glyph';\nimport { AppShellController } from '../nile-app-shell/shell-controller';\nimport '../nile-button/nile-button';\nimport NileElement from '../internal/nile-element';\nimport type { NileAppShellPanelMode } from '../nile-app-shell/nile-app-shell';\n\n/**\n * @summary The shell's right region — the AI assistant panel. Assigns itself to\n * the shell's `panel` slot and takes over the panel chrome: heading, actions,\n * close button, scroll region and composer footer. The shell keeps the geometry\n * — 480px docked, an overlay drawer when narrow — and the open/closed state.\n *\n * @status stable\n * @since 2.0\n *\n * @tag nile-app-shell-panel\n *\n * @dependency nile-app-shell\n * @dependency nile-glyph\n *\n * @slot - The panel body. Scrolls.\n * @slot header - Replaces the default heading (mark plus label).\n * @slot actions - Controls added before the close button.\n * @slot footer - A composer, docked below the scroll region.\n *\n * @event nile-close - Emitted when the close button is pressed, after the shell\n * has been told to close. Cancelable is not honoured; listen to it to react,\n * and use `no-close` to own the control yourself.\n *\n * @csspart header - The header bar.\n * @csspart title - The default heading text.\n * @csspart actions - The header action group.\n * @csspart close - The close button.\n * @csspart body - The scrolling body.\n * @csspart footer - The footer.\n */\n@customElement('nile-app-shell-panel')\nexport class NileAppShellPanel extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private shellLink = new AppShellController(this);\n\n /** The heading, and the accessible name of the region. */\n @property({ type: String })\n label: string = 'Ask Aquera';\n\n /** Drops the header bar entirely. */\n @property({ type: Boolean, reflect: true, attribute: 'no-header' })\n noHeader: boolean = false;\n\n /** Drops the close button — for a panel the page closes its own way. */\n @property({ type: Boolean, reflect: true, attribute: 'no-close' })\n noClose: boolean = false;\n\n /** Removes the body's padding, for a full-bleed transcript. */\n @property({ type: Boolean, reflect: true, attribute: 'no-padding' })\n noPadding: boolean = false;\n\n /** Id of the shell to follow. Defaults to the nearest ancestor. */\n @property({ type: String })\n shell?: string;\n\n /**\n * Mirrors the shell's panel mode. Set by the shell; treat it as read-only and\n * style against it (`nile-app-shell-panel[mode='overlay']`).\n */\n @property({ type: String, reflect: true })\n mode: NileAppShellPanelMode = 'docked';\n\n @state() private _hasFooter: boolean = false;\n\n public connectedCallback(): void {\n super.connectedCallback();\n // Claim the shell's right region unless the author placed it elsewhere.\n if (!this.hasAttribute('slot')) this.setAttribute('slot', 'panel');\n if (!this.hasAttribute('role')) this.setAttribute('role', 'complementary');\n }\n\n protected willUpdate(): void {\n this.shellLink.shellId = this.shell;\n const shell = this.shellLink.shell;\n if (shell) this.mode = shell.panelMode;\n }\n\n protected updated(): void {\n this.toggleAttribute('has-footer', this._hasFooter);\n this.setAttribute('aria-label', this.label);\n }\n\n /** Close the panel through the shell. */\n public close(): void {\n this.shellLink.shell?.closePanel();\n this.emit('nile-close');\n }\n\n private handleFooterSlotChange(event: Event): void {\n this._hasFooter = (event.target as HTMLSlotElement)\n .assignedNodes({ flatten: true })\n .some(\n node =>\n node.nodeType === Node.ELEMENT_NODE ||\n (node.textContent ?? '').trim() !== ''\n );\n }\n\n public render(): TemplateResult {\n return html`\n <header class=\"header\" part=\"header\">\n <slot name=\"header\">\n <span class=\"heading\">\n <span class=\"mark\">${renderGlyph('ng-sparkles', 20, 'currentColor')}</span>\n <h2 class=\"title\" part=\"title\">${this.label}</h2>\n </span>\n </slot>\n <div class=\"actions\" part=\"actions\">\n <slot name=\"actions\"></slot>\n <nile-button\n class=\"close\"\n part=\"close\"\n variant=\"ghost\"\n circle\n title=\"Close ${this.label}\"\n aria-label=\"Close ${this.label}\"\n @click=${() => this.close()}\n >\n ${renderGlyph('ng-x-close', 24, 'currentColor')}\n </nile-button>\n </div>\n </header>\n\n <div class=\"body\" part=\"body\"><slot></slot></div>\n\n <div class=\"footer\" part=\"footer\">\n <slot\n name=\"footer\"\n @slotchange=${(e: Event) => this.handleFooterSlotChange(e)}\n ></slot>\n </div>\n `;\n }\n}\n\nexport default NileAppShellPanel;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-app-shell-panel': NileAppShellPanel;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nile-app-shell-panel.js","sourceRoot":"","sources":["../../../src/nile-app-shell-panel/nile-app-shell-panel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,4BAA4B,CAAC;AACpC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,WAAW;IAA3C;;QAKG,cAAS,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAEjD,0DAA0D;QAE1D,UAAK,GAAW,YAAY,CAAC;QAE7B,qCAAqC;QAErC,aAAQ,GAAY,KAAK,CAAC;QAE1B,gIAAgI;QAEhI,SAAI,GAAY,KAAK,CAAC;QAEtB,2CA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,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACrB;AAItB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACA;AAI3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;kDACzC;AAIzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDACzC;AAI3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDACZ;AAIf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACH;AAEtB;IAAhB,KAAK,EAAE;qDAAqC;AAvClC,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAmI7B;;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { styles } from './nile-app-shell-panel.css';\nimport { renderGlyph } from '../internal/glyph';\nimport { AppShellController } from '../nile-app-shell/shell-controller';\nimport '../nile-button/nile-button';\nimport NileElement from '../internal/nile-element';\nimport type { NileAppShellPanelMode } from '../nile-app-shell/nile-app-shell';\n\n/**\n * @summary The shell's right region — the AI assistant panel; takes over the panel chrome while the shell keeps the geometry and open state.\n *\n * @status stable\n * @since 2.0\n *\n * @tag nile-app-shell-panel\n *\n * @dependency nile-app-shell\n * @dependency nile-glyph\n *\n * @slot - The panel body. Scrolls.\n * @slot header - Replaces the default heading (mark plus label); the back control renders before it.\n * @slot actions - Controls added before the close button; size and clear their `base` part from page CSS to match the header's bare glyphs.\n * @slot footer - A composer, docked below the scroll region.\n *\n * @event nile-close - Emitted when the close button is pressed, after the shell has been told to close.\n * @event nile-back - Emitted when the back control is pressed; the page swaps its own content back.\n * @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.\n *\n * @csspart header - The header bar.\n * @csspart back - The back control, shown by `back`.\n * @csspart title - The default heading text.\n * @csspart actions - The header action group.\n * @csspart close - The close button.\n * @csspart body - The scrolling body.\n * @csspart footer - The footer.\n *\n * @cssproperty [--nile-app-shell-utility-size=32px] - Box the header's back and close controls sit in.\n *\n * @method goBack() - Emit `nile-back` then `nile-panel-back`, as the back control does.\n */\n@customElement('nile-app-shell-panel')\nexport class NileAppShellPanel extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private shellLink = new AppShellController(this);\n\n /** The heading, and the accessible name of the region. */\n @property({ type: String })\n label: string = 'Ask Aquera';\n\n /** Drops the header bar entirely. */\n @property({ type: Boolean, reflect: true, attribute: 'no-header' })\n noHeader: boolean = false;\n\n /** 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`. */\n @property({ type: Boolean, reflect: true })\n back: boolean = false;\n\n /** Accessible name of the back control. */\n @property({ type: String })\n backLabel: string = 'Back';\n\n /** Drops the close button — for a panel the page closes its own way. */\n @property({ type: Boolean, reflect: true, attribute: 'no-close' })\n noClose: boolean = false;\n\n /** Removes the body's padding, for a full-bleed transcript. */\n @property({ type: Boolean, reflect: true, attribute: 'no-padding' })\n noPadding: boolean = false;\n\n /** Id of the shell to follow. Defaults to the nearest ancestor. */\n @property({ type: String })\n shell?: string;\n\n /** 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']`). */\n @property({ type: String, reflect: true })\n mode: NileAppShellPanelMode = 'docked';\n\n @state() private _hasFooter: boolean = false;\n\n public connectedCallback(): void {\n super.connectedCallback();\n // Claim the shell's right region unless the author placed it elsewhere.\n if (!this.hasAttribute('slot')) this.setAttribute('slot', 'panel');\n if (!this.hasAttribute('role')) this.setAttribute('role', 'complementary');\n }\n\n protected willUpdate(): void {\n this.shellLink.shellId = this.shell;\n const shell = this.shellLink.shell;\n if (shell) this.mode = shell.panelMode;\n }\n\n protected updated(): void {\n this.toggleAttribute('has-footer', this._hasFooter);\n this.setAttribute('aria-label', this.label);\n }\n\n /** 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. */\n public goBack(): void {\n this.emit('nile-back');\n this.emit('nile-panel-back');\n }\n\n /** Close the panel through the shell. */\n public close(): void {\n this.shellLink.shell?.closePanel();\n this.emit('nile-close');\n }\n\n private handleFooterSlotChange(event: Event): void {\n this._hasFooter = (event.target as HTMLSlotElement)\n .assignedNodes({ flatten: true })\n .some(\n node =>\n node.nodeType === Node.ELEMENT_NODE ||\n (node.textContent ?? '').trim() !== ''\n );\n }\n\n public render(): TemplateResult {\n return html`\n <header class=\"header\" part=\"header\">\n ${this.back\n ? html`<nile-button\n class=\"back utility-control\"\n part=\"back\"\n variant=\"ghost\"\n circle\n title=${this.backLabel}\n aria-label=${this.backLabel}\n @click=${() => this.goBack()}\n >\n ${renderGlyph('ng-arrow-left', 20, 'currentColor')}\n </nile-button>`\n : ''}\n <slot name=\"header\">\n <span class=\"heading\">\n <span class=\"mark\"\n >${renderGlyph('ng-sparkles', 20, 'currentColor')}</span\n >\n <h2 class=\"title\" part=\"title\">${this.label}</h2>\n </span>\n </slot>\n <div class=\"actions\" part=\"actions\">\n <slot name=\"actions\"></slot>\n <nile-button\n class=\"close utility-control\"\n part=\"close\"\n variant=\"ghost\"\n circle\n title=\"Close ${this.label}\"\n aria-label=\"Close ${this.label}\"\n @click=${() => this.close()}\n >\n ${renderGlyph('ng-x-close', 20, 'currentColor')}\n </nile-button>\n </div>\n </header>\n\n <div class=\"body\" part=\"body\"><slot></slot></div>\n\n <div class=\"footer\" part=\"footer\">\n <slot\n name=\"footer\"\n @slotchange=${(e: Event) => this.handleFooterSlotChange(e)}\n ></slot>\n </div>\n `;\n }\n}\n\nexport default NileAppShellPanel;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-app-shell-panel': NileAppShellPanel;\n }\n}\n"]}
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
* AppShellSideNav CSS. The shell owns the track width; this owns what happens
|
|
9
|
-
* inside it — a pinned header, a scrolling body, a pinned footer.
|
|
10
|
-
*/
|
|
7
|
+
/** AppShellSideNav CSS: the shell owns the track width, this owns what happens inside it — a pinned header, a scrolling body, a pinned footer. */
|
|
11
8
|
export declare const styles: import("lit").CSSResult;
|
|
12
9
|
declare const _default: import("lit").CSSResult[];
|
|
13
10
|
export default _default;
|
|
@@ -5,10 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { css } from 'lit';
|
|
8
|
-
/**
|
|
9
|
-
* AppShellSideNav CSS. The shell owns the track width; this owns what happens
|
|
10
|
-
* inside it — a pinned header, a scrolling body, a pinned footer.
|
|
11
|
-
*/
|
|
8
|
+
/** AppShellSideNav CSS: the shell owns the track width, this owns what happens inside it — a pinned header, a scrolling body, a pinned footer. */
|
|
12
9
|
export const styles = css `
|
|
13
10
|
:host {
|
|
14
11
|
box-sizing: border-box;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-app-shell-side-nav.css.js","sourceRoot":"","sources":["../../../src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B
|
|
1
|
+
{"version":3,"file":"nile-app-shell-side-nav.css.js","sourceRoot":"","sources":["../../../src/nile-app-shell-side-nav/nile-app-shell-side-nav.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,kJAAkJ;AAClJ,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/** AppShellSideNav CSS: the shell owns the track width, this owns what happens inside it — a pinned header, a scrolling body, a pinned footer. */\nexport const styles = css`\n :host {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n overflow: hidden;\n /* The nav and the page share one surface. */\n background: var(--nile-app-shell-side-nav-bg, transparent);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .header,\n .footer {\n flex: 0 0 auto;\n display: block;\n }\n\n .body {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n padding: var(\n --nile-app-shell-side-nav-padding,\n var(--nile-spacing-lg, var(--ng-spacing-lg))\n );\n scrollbar-width: thin;\n }\n\n .body::-webkit-scrollbar {\n width: 6px;\n }\n\n .body::-webkit-scrollbar-track {\n background: transparent;\n }\n\n .body::-webkit-scrollbar-thumb {\n background-color: var(\n --nile-colors-neutral-500,\n var(--ng-colors-border-primary)\n );\n border-radius: 10px;\n }\n\n /* A rail has no room for a horizontal scrollbar or for wide children. */\n :host([collapsed]) .body {\n overflow-x: hidden;\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
import { CSSResultArray, TemplateResult } from 'lit';
|
|
8
8
|
import NileElement from '../internal/nile-element';
|
|
9
9
|
/**
|
|
10
|
-
* @summary The shell's left region — the navigation track
|
|
11
|
-
* shell's `side-nav` slot and mirrors the shell's rail state, so nav content can
|
|
12
|
-
* style against it.
|
|
10
|
+
* @summary The shell's left region — the navigation track; mirrors the shell's rail state so nav content can style against it.
|
|
13
11
|
*
|
|
14
12
|
* @status stable
|
|
15
13
|
* @since 2.0
|
|
@@ -26,19 +24,13 @@ import NileElement from '../internal/nile-element';
|
|
|
26
24
|
* @csspart body - The scrolling nav body.
|
|
27
25
|
* @csspart footer - The pinned footer.
|
|
28
26
|
*
|
|
29
|
-
* @cssproperty [--nile-app-shell-side-nav-padding=12px] - Body inset.
|
|
30
|
-
*
|
|
31
|
-
* @cssproperty [--nile-app-shell-side-nav-bg=transparent] - Surface behind the
|
|
32
|
-
* nav. Transparent by default: the nav and the page share one.
|
|
27
|
+
* @cssproperty [--nile-app-shell-side-nav-padding=12px] - Body inset.
|
|
28
|
+
* @cssproperty [--nile-app-shell-side-nav-bg=transparent] - Surface behind the nav; transparent so the nav and page share one.
|
|
33
29
|
*/
|
|
34
30
|
export declare class NileAppShellSideNav extends NileElement {
|
|
35
31
|
static get styles(): CSSResultArray;
|
|
36
32
|
private shellLink;
|
|
37
|
-
/**
|
|
38
|
-
* Mirrors the shell's effective rail state — the user's preference, or a rail
|
|
39
|
-
* forced by the shell's width. Set by the shell; treat it as read-only and
|
|
40
|
-
* style against it (`nile-app-shell-side-nav[collapsed] .label`).
|
|
41
|
-
*/
|
|
33
|
+
/** 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`). */
|
|
42
34
|
collapsed: boolean;
|
|
43
35
|
/** Id of the shell to follow. Defaults to the nearest ancestor. */
|
|
44
36
|
shell?: string;
|