@lit-material/navigation 0.0.1 → 0.1.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.
- package/README.md +72 -8
- package/custom-elements.json +1568 -0
- package/dist/adaptive-navigation.d.ts +52 -0
- package/dist/adaptive-navigation.d.ts.map +1 -0
- package/dist/adaptive-navigation.js +129 -0
- package/dist/adaptive-navigation.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/navigation-bar-item-styles.d.ts +2 -0
- package/dist/navigation-bar-item-styles.d.ts.map +1 -0
- package/dist/navigation-bar-item-styles.js +125 -0
- package/dist/navigation-bar-item-styles.js.map +1 -0
- package/dist/navigation-bar-item.d.ts +50 -0
- package/dist/navigation-bar-item.d.ts.map +1 -0
- package/dist/navigation-bar-item.js +132 -0
- package/dist/navigation-bar-item.js.map +1 -0
- package/dist/navigation-bar-styles.d.ts +2 -0
- package/dist/navigation-bar-styles.d.ts.map +1 -0
- package/dist/navigation-bar-styles.js +23 -0
- package/dist/navigation-bar-styles.js.map +1 -0
- package/dist/navigation-bar.d.ts +44 -0
- package/dist/navigation-bar.d.ts.map +1 -0
- package/dist/navigation-bar.js +88 -0
- package/dist/navigation-bar.js.map +1 -0
- package/dist/navigation-drawer-item-styles.js +2 -2
- package/dist/navigation-rail-item-styles.js +3 -3
- package/dist/navigation-rail-item.d.ts +2 -1
- package/dist/navigation-rail-item.d.ts.map +1 -1
- package/dist/navigation-rail-item.js +2 -1
- package/dist/navigation-rail-item.js.map +1 -1
- package/package.json +10 -6
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from "lit";
|
|
2
|
+
import "./navigation-drawer.js";
|
|
3
|
+
import "./navigation-drawer-item.js";
|
|
4
|
+
import "./navigation-rail.js";
|
|
5
|
+
import "./navigation-rail-item.js";
|
|
6
|
+
import "./navigation-bar.js";
|
|
7
|
+
import "./navigation-bar-item.js";
|
|
8
|
+
export interface NavigationDestination {
|
|
9
|
+
label: string;
|
|
10
|
+
/** An icon: an `svg`/`html` template, or text such as an emoji. */
|
|
11
|
+
icon?: TemplateResult | string;
|
|
12
|
+
href?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One set of destinations shown as M3 prescribes for the window's width: a
|
|
17
|
+
* navigation bar on compact windows (under 600px), a rail on medium ones
|
|
18
|
+
* (600–839px), and a drawer — or a rail, with `expanded="rail"` — on
|
|
19
|
+
* expanded ones (840px and up).
|
|
20
|
+
*
|
|
21
|
+
* All three are rendered and CSS shows one, so it needs no script to pick
|
|
22
|
+
* and server-rendered markup is already right; the hidden ones are out of
|
|
23
|
+
* the accessibility tree. `selected` is shared, and `change` fires (with the
|
|
24
|
+
* new index in `selected`) whichever one was used.
|
|
25
|
+
*
|
|
26
|
+
* Place the bar yourself — e.g. the host fixed or sticky at the bottom on
|
|
27
|
+
* compact windows: it sits where the element is.
|
|
28
|
+
*
|
|
29
|
+
* @element lit-material-adaptive-navigation
|
|
30
|
+
*
|
|
31
|
+
* @fires change - The selection changed; read `selected`.
|
|
32
|
+
*
|
|
33
|
+
* @cssprop --lit-material-adaptive-navigation-medium - Not a variable: breakpoints are fixed at 600px and 840px (M3 window size classes).
|
|
34
|
+
*/
|
|
35
|
+
export declare class LitMaterialAdaptiveNavigation extends LitElement {
|
|
36
|
+
static styles: import("lit").CSSResult;
|
|
37
|
+
destinations: NavigationDestination[];
|
|
38
|
+
selected: number;
|
|
39
|
+
/** What expanded windows show: `drawer` (default) or `rail`. */
|
|
40
|
+
expanded: "drawer" | "rail";
|
|
41
|
+
/** The accessible name of the navigation landmark. */
|
|
42
|
+
label: string;
|
|
43
|
+
private onChange;
|
|
44
|
+
private icon;
|
|
45
|
+
render(): TemplateResult<1>;
|
|
46
|
+
}
|
|
47
|
+
declare global {
|
|
48
|
+
interface HTMLElementTagNameMap {
|
|
49
|
+
"lit-material-adaptive-navigation": LitMaterialAdaptiveNavigation;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=adaptive-navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptive-navigation.d.ts","sourceRoot":"","sources":["../src/adaptive-navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAE1E,OAAO,wBAAwB,CAAC;AAChC,OAAO,6BAA6B,CAAC;AACrC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,2BAA2B,CAAC;AACnC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,0BAA0B,CAAC;AAElC,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,6BAA8B,SAAQ,UAAU;IAC3D,OAAgB,MAAM,0BA8BpB;IAE8B,YAAY,EAAE,qBAAqB,EAAE,CAAM;IAE/C,QAAQ,SAAM;IAE1C,gEAAgE;IACnC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAY;IAEpE,sDAAsD;IAC1C,KAAK,SAAU;IAE3B,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,IAAI;IAIH,MAAM;CAyBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kCAAkC,EAAE,6BAA6B,CAAC;KACnE;CACF"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html, LitElement, nothing } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import "./navigation-drawer.js";
|
|
10
|
+
import "./navigation-drawer-item.js";
|
|
11
|
+
import "./navigation-rail.js";
|
|
12
|
+
import "./navigation-rail-item.js";
|
|
13
|
+
import "./navigation-bar.js";
|
|
14
|
+
import "./navigation-bar-item.js";
|
|
15
|
+
/**
|
|
16
|
+
* One set of destinations shown as M3 prescribes for the window's width: a
|
|
17
|
+
* navigation bar on compact windows (under 600px), a rail on medium ones
|
|
18
|
+
* (600–839px), and a drawer — or a rail, with `expanded="rail"` — on
|
|
19
|
+
* expanded ones (840px and up).
|
|
20
|
+
*
|
|
21
|
+
* All three are rendered and CSS shows one, so it needs no script to pick
|
|
22
|
+
* and server-rendered markup is already right; the hidden ones are out of
|
|
23
|
+
* the accessibility tree. `selected` is shared, and `change` fires (with the
|
|
24
|
+
* new index in `selected`) whichever one was used.
|
|
25
|
+
*
|
|
26
|
+
* Place the bar yourself — e.g. the host fixed or sticky at the bottom on
|
|
27
|
+
* compact windows: it sits where the element is.
|
|
28
|
+
*
|
|
29
|
+
* @element lit-material-adaptive-navigation
|
|
30
|
+
*
|
|
31
|
+
* @fires change - The selection changed; read `selected`.
|
|
32
|
+
*
|
|
33
|
+
* @cssprop --lit-material-adaptive-navigation-medium - Not a variable: breakpoints are fixed at 600px and 840px (M3 window size classes).
|
|
34
|
+
*/
|
|
35
|
+
let LitMaterialAdaptiveNavigation = class LitMaterialAdaptiveNavigation extends LitElement {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.destinations = [];
|
|
39
|
+
this.selected = -1;
|
|
40
|
+
/** What expanded windows show: `drawer` (default) or `rail`. */
|
|
41
|
+
this.expanded = "drawer";
|
|
42
|
+
/** The accessible name of the navigation landmark. */
|
|
43
|
+
this.label = "Main";
|
|
44
|
+
}
|
|
45
|
+
static { this.styles = css `
|
|
46
|
+
:host {
|
|
47
|
+
display: block;
|
|
48
|
+
}
|
|
49
|
+
.bar,
|
|
50
|
+
.rail,
|
|
51
|
+
.drawer {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
@media (max-width: 599.98px) {
|
|
55
|
+
.bar { display: block; }
|
|
56
|
+
}
|
|
57
|
+
@media (min-width: 600px) and (max-width: 839.98px) {
|
|
58
|
+
.rail { display: block; height: 100%; }
|
|
59
|
+
}
|
|
60
|
+
@media (min-width: 840px) {
|
|
61
|
+
:host(:not([expanded="rail"])) .drawer { display: block; height: 100%; }
|
|
62
|
+
:host([expanded="rail"]) .rail { display: block; height: 100%; }
|
|
63
|
+
}
|
|
64
|
+
[slot="icon"] {
|
|
65
|
+
display: inline-flex;
|
|
66
|
+
width: 24px;
|
|
67
|
+
height: 24px;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
}
|
|
71
|
+
[slot="icon"] svg {
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
}
|
|
75
|
+
`; }
|
|
76
|
+
onChange(event) {
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
const selected = event.target.selected;
|
|
79
|
+
if (selected === this.selected)
|
|
80
|
+
return;
|
|
81
|
+
this.selected = selected;
|
|
82
|
+
this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
|
|
83
|
+
}
|
|
84
|
+
icon(d) {
|
|
85
|
+
return d.icon === undefined ? nothing : html `<span slot="icon" aria-hidden="true">${d.icon}</span>`;
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
const ds = this.destinations;
|
|
89
|
+
return html `
|
|
90
|
+
<nav aria-label=${this.label}>
|
|
91
|
+
<div class="drawer">
|
|
92
|
+
<lit-material-navigation-drawer .selected=${this.selected} @change=${this.onChange}>
|
|
93
|
+
${ds.map((d, i) => html `<lit-material-navigation-drawer-item ?selected=${i === this.selected} ?disabled=${!!d.disabled} href=${d.href ?? nothing}
|
|
94
|
+
>${this.icon(d)}${d.label}</lit-material-navigation-drawer-item>`)}
|
|
95
|
+
</lit-material-navigation-drawer>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="rail">
|
|
98
|
+
<lit-material-navigation-rail .selected=${this.selected} @change=${this.onChange}>
|
|
99
|
+
${ds.map((d, i) => html `<lit-material-navigation-rail-item ?selected=${i === this.selected} ?disabled=${!!d.disabled} href=${d.href ?? nothing}
|
|
100
|
+
>${this.icon(d)}${d.label}</lit-material-navigation-rail-item>`)}
|
|
101
|
+
</lit-material-navigation-rail>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="bar">
|
|
104
|
+
<lit-material-navigation-bar .selected=${this.selected} @change=${this.onChange}>
|
|
105
|
+
${ds.map((d, i) => html `<lit-material-navigation-bar-item ?selected=${i === this.selected} ?disabled=${!!d.disabled} href=${d.href ?? nothing}
|
|
106
|
+
>${this.icon(d)}${d.label}</lit-material-navigation-bar-item>`)}
|
|
107
|
+
</lit-material-navigation-bar>
|
|
108
|
+
</div>
|
|
109
|
+
</nav>
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ attribute: false })
|
|
115
|
+
], LitMaterialAdaptiveNavigation.prototype, "destinations", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: Number })
|
|
118
|
+
], LitMaterialAdaptiveNavigation.prototype, "selected", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
property({ reflect: true })
|
|
121
|
+
], LitMaterialAdaptiveNavigation.prototype, "expanded", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
property()
|
|
124
|
+
], LitMaterialAdaptiveNavigation.prototype, "label", void 0);
|
|
125
|
+
LitMaterialAdaptiveNavigation = __decorate([
|
|
126
|
+
customElement("lit-material-adaptive-navigation")
|
|
127
|
+
], LitMaterialAdaptiveNavigation);
|
|
128
|
+
export { LitMaterialAdaptiveNavigation };
|
|
129
|
+
//# sourceMappingURL=adaptive-navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptive-navigation.js","sourceRoot":"","sources":["../src/adaptive-navigation.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,8 @@ export { LitMaterialNavigationDrawerItem } from "./navigation-drawer-item.js";
|
|
|
4
4
|
export { LitMaterialNavigationRail } from "./navigation-rail.js";
|
|
5
5
|
export type { NavigationRailAlignment } from "./navigation-rail.js";
|
|
6
6
|
export { LitMaterialNavigationRailItem } from "./navigation-rail-item.js";
|
|
7
|
+
export { LitMaterialNavigationBar } from "./navigation-bar.js";
|
|
8
|
+
export { LitMaterialNavigationBarItem } from "./navigation-bar-item.js";
|
|
9
|
+
export { LitMaterialAdaptiveNavigation } from "./adaptive-navigation.js";
|
|
10
|
+
export type { NavigationDestination } from "./adaptive-navigation.js";
|
|
7
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,7 @@ export { LitMaterialNavigationDrawer } from "./navigation-drawer.js";
|
|
|
2
2
|
export { LitMaterialNavigationDrawerItem } from "./navigation-drawer-item.js";
|
|
3
3
|
export { LitMaterialNavigationRail } from "./navigation-rail.js";
|
|
4
4
|
export { LitMaterialNavigationRailItem } from "./navigation-rail-item.js";
|
|
5
|
+
export { LitMaterialNavigationBar } from "./navigation-bar.js";
|
|
6
|
+
export { LitMaterialNavigationBarItem } from "./navigation-bar-item.js";
|
|
7
|
+
export { LitMaterialAdaptiveNavigation } from "./adaptive-navigation.js";
|
|
5
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar-item-styles.d.ts","sourceRoot":"","sources":["../src/navigation-bar-item-styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA0HlB,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
flex: 1;
|
|
6
|
+
height: 100%;
|
|
7
|
+
outline: none;
|
|
8
|
+
-webkit-tap-highlight-color: transparent;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([disabled]) {
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.item {
|
|
16
|
+
position: relative;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
gap: 4px;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
padding-block: 12px 16px;
|
|
26
|
+
border: none;
|
|
27
|
+
margin: 0;
|
|
28
|
+
background-color: transparent;
|
|
29
|
+
color: var(--md-sys-color-on-surface-variant, #49454f);
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
font-family: var(--md-sys-typescale-label-medium-font, Roboto, system-ui, sans-serif);
|
|
33
|
+
font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);
|
|
34
|
+
font-weight: var(--md-sys-typescale-label-medium-weight, 500);
|
|
35
|
+
-webkit-appearance: none;
|
|
36
|
+
appearance: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.item:disabled,
|
|
40
|
+
.item[aria-disabled="true"] {
|
|
41
|
+
cursor: default;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host([selected]) .item {
|
|
45
|
+
color: var(--md-sys-color-on-surface, #1c1b1f);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon-container {
|
|
49
|
+
position: relative;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
width: 64px;
|
|
54
|
+
height: 32px;
|
|
55
|
+
border-radius: var(--md-sys-shape-corner-full, 16px);
|
|
56
|
+
transition: background-color 150ms var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([selected]) .icon-container {
|
|
60
|
+
background-color: var(--md-sys-color-secondary-container, #e8def8);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
slot.icon::slotted(*) {
|
|
64
|
+
display: block;
|
|
65
|
+
width: 24px;
|
|
66
|
+
height: 24px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
slot.badge::slotted(*) {
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: -4px;
|
|
72
|
+
inset-inline-end: 8px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.label {
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
text-align: center;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.state-layer {
|
|
84
|
+
position: absolute;
|
|
85
|
+
inset: 0;
|
|
86
|
+
border-radius: inherit;
|
|
87
|
+
background-color: currentColor;
|
|
88
|
+
opacity: 0;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
transition: opacity 100ms linear;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.item:hover .state-layer {
|
|
94
|
+
opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.state-layer[data-pressed] {
|
|
98
|
+
opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.1);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.focus-ring {
|
|
102
|
+
position: absolute;
|
|
103
|
+
inset: -2px;
|
|
104
|
+
border-radius: inherit;
|
|
105
|
+
outline: 3px solid var(--md-sys-color-secondary, #625b71);
|
|
106
|
+
outline-offset: 2px;
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.focus-ring[hidden] {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host([disabled]) .item {
|
|
115
|
+
color: color-mix(in srgb, var(--md-sys-color-on-surface, #1c1b1f) 38%, transparent);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media (prefers-reduced-motion: reduce) {
|
|
119
|
+
.icon-container,
|
|
120
|
+
.state-layer {
|
|
121
|
+
transition: none;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
//# sourceMappingURL=navigation-bar-item-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar-item-styles.js","sourceRoot":"","sources":["../src/navigation-bar-item-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0HxB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* A single destination inside a `lit-material-navigation-bar` — an icon in a
|
|
4
|
+
* pill-shaped active indicator, with a small label below it, following the
|
|
5
|
+
* MD3 navigation bar item spec. Visually and structurally almost identical
|
|
6
|
+
* to `lit-material-navigation-rail-item` (same icon-pill + label-below
|
|
7
|
+
* layout, badge slot, ripple/focus-ring scoped to the indicator) — the
|
|
8
|
+
* difference is this item shares the bar's width equally with its siblings
|
|
9
|
+
* (`flex: 1`) instead of filling a narrow vertical rail's width, and its
|
|
10
|
+
* indicator is 64px wide (the MD3 bar spec) rather than the rail's 56px.
|
|
11
|
+
*
|
|
12
|
+
* Renders as a real `<button>` by default, or an `<a>` when `href` is set.
|
|
13
|
+
* `selected` is normally managed by the parent bar (see its docs), not set
|
|
14
|
+
* directly.
|
|
15
|
+
*
|
|
16
|
+
* @element lit-material-navigation-bar-item
|
|
17
|
+
*
|
|
18
|
+
* @slot - The label text.
|
|
19
|
+
* @slot icon - The icon.
|
|
20
|
+
* @slot badge - Optional badge content (a count or dot), positioned over the icon's top-end corner
|
|
21
|
+
* (top-right in LTR, top-left in RTL).
|
|
22
|
+
*
|
|
23
|
+
* @csspart item - The `<button>` or `<a>` (layout only, no background of its own).
|
|
24
|
+
* @csspart icon-container - The pill-shaped active indicator behind the icon.
|
|
25
|
+
* @csspart ripple - The state-layer element the hover/press feedback is drawn on.
|
|
26
|
+
* @csspart focus-ring - The focus indicator element.
|
|
27
|
+
*/
|
|
28
|
+
export declare class LitMaterialNavigationBarItem extends LitElement {
|
|
29
|
+
static styles: import("lit").CSSResult;
|
|
30
|
+
static shadowRootOptions: ShadowRootInit;
|
|
31
|
+
selected: boolean;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
/** If set, renders the item as a link (`<a>`) instead of a `<button>`. */
|
|
34
|
+
href: string;
|
|
35
|
+
target: string;
|
|
36
|
+
private readonly stateLayerElement?;
|
|
37
|
+
private readonly ripple;
|
|
38
|
+
private readonly focusRing;
|
|
39
|
+
protected updated(): void;
|
|
40
|
+
private get content();
|
|
41
|
+
render(): import("lit").TemplateResult<1>;
|
|
42
|
+
private handleClick;
|
|
43
|
+
private handleLinkClick;
|
|
44
|
+
}
|
|
45
|
+
declare global {
|
|
46
|
+
interface HTMLElementTagNameMap {
|
|
47
|
+
"lit-material-navigation-bar-item": LitMaterialNavigationBarItem;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=navigation-bar-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar-item.d.ts","sourceRoot":"","sources":["../src/navigation-bar-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAKhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,4BAA6B,SAAQ,UAAU;IAC1D,OAAgB,MAAM,0BAAU;IAEhC,OAAgB,iBAAiB,EAAE,cAAc,CAG/C;IAE0C,QAAQ,UAAS;IACjB,QAAQ,UAAS;IAE7D,0EAA0E;IAC9D,IAAI,SAAM;IACV,MAAM,SAAM;IAED,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAc;IAExE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiC;cAExC,OAAO,IAAI,IAAI;IAIlC,OAAO,KAAK,OAAO,GAUlB;IAEQ,MAAM;IAmCf,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,eAAe;CAMxB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kCAAkC,EAAE,4BAA4B,CAAC;KAClE;CACF"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement, nothing } from "lit";
|
|
8
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
9
|
+
import { FocusRingController, RippleController } from "@lit-material/core";
|
|
10
|
+
import { styles } from "./navigation-bar-item-styles.js";
|
|
11
|
+
/**
|
|
12
|
+
* A single destination inside a `lit-material-navigation-bar` — an icon in a
|
|
13
|
+
* pill-shaped active indicator, with a small label below it, following the
|
|
14
|
+
* MD3 navigation bar item spec. Visually and structurally almost identical
|
|
15
|
+
* to `lit-material-navigation-rail-item` (same icon-pill + label-below
|
|
16
|
+
* layout, badge slot, ripple/focus-ring scoped to the indicator) — the
|
|
17
|
+
* difference is this item shares the bar's width equally with its siblings
|
|
18
|
+
* (`flex: 1`) instead of filling a narrow vertical rail's width, and its
|
|
19
|
+
* indicator is 64px wide (the MD3 bar spec) rather than the rail's 56px.
|
|
20
|
+
*
|
|
21
|
+
* Renders as a real `<button>` by default, or an `<a>` when `href` is set.
|
|
22
|
+
* `selected` is normally managed by the parent bar (see its docs), not set
|
|
23
|
+
* directly.
|
|
24
|
+
*
|
|
25
|
+
* @element lit-material-navigation-bar-item
|
|
26
|
+
*
|
|
27
|
+
* @slot - The label text.
|
|
28
|
+
* @slot icon - The icon.
|
|
29
|
+
* @slot badge - Optional badge content (a count or dot), positioned over the icon's top-end corner
|
|
30
|
+
* (top-right in LTR, top-left in RTL).
|
|
31
|
+
*
|
|
32
|
+
* @csspart item - The `<button>` or `<a>` (layout only, no background of its own).
|
|
33
|
+
* @csspart icon-container - The pill-shaped active indicator behind the icon.
|
|
34
|
+
* @csspart ripple - The state-layer element the hover/press feedback is drawn on.
|
|
35
|
+
* @csspart focus-ring - The focus indicator element.
|
|
36
|
+
*/
|
|
37
|
+
let LitMaterialNavigationBarItem = class LitMaterialNavigationBarItem extends LitElement {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.selected = false;
|
|
41
|
+
this.disabled = false;
|
|
42
|
+
/** If set, renders the item as a link (`<a>`) instead of a `<button>`. */
|
|
43
|
+
this.href = "";
|
|
44
|
+
this.target = "";
|
|
45
|
+
this.ripple = new RippleController(this);
|
|
46
|
+
this.focusRing = new FocusRingController(this);
|
|
47
|
+
}
|
|
48
|
+
static { this.styles = styles; }
|
|
49
|
+
static { this.shadowRootOptions = {
|
|
50
|
+
...LitElement.shadowRootOptions,
|
|
51
|
+
delegatesFocus: true,
|
|
52
|
+
}; }
|
|
53
|
+
updated() {
|
|
54
|
+
if (this.stateLayerElement)
|
|
55
|
+
this.ripple.attach(this.stateLayerElement);
|
|
56
|
+
}
|
|
57
|
+
get content() {
|
|
58
|
+
return html `
|
|
59
|
+
<span class="icon-container" part="icon-container">
|
|
60
|
+
<div class="focus-ring" part="focus-ring" ?hidden=${!this.focusRing.visible}></div>
|
|
61
|
+
<div class="state-layer" part="ripple"></div>
|
|
62
|
+
<slot name="icon" class="icon"></slot>
|
|
63
|
+
<slot name="badge" class="badge"></slot>
|
|
64
|
+
</span>
|
|
65
|
+
<span class="label"><slot></slot></span>
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
const ariaCurrent = this.selected ? "page" : nothing;
|
|
70
|
+
if (this.href) {
|
|
71
|
+
return html `
|
|
72
|
+
<a
|
|
73
|
+
class="item"
|
|
74
|
+
part="item"
|
|
75
|
+
href=${this.disabled ? nothing : this.href}
|
|
76
|
+
target=${this.target || nothing}
|
|
77
|
+
rel=${this.target === "_blank" ? "noopener noreferrer" : nothing}
|
|
78
|
+
aria-current=${ariaCurrent}
|
|
79
|
+
aria-disabled=${this.disabled ? "true" : nothing}
|
|
80
|
+
tabindex=${this.disabled ? "-1" : "0"}
|
|
81
|
+
@click=${this.handleLinkClick}
|
|
82
|
+
>
|
|
83
|
+
${this.content}
|
|
84
|
+
</a>
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
return html `
|
|
88
|
+
<button
|
|
89
|
+
class="item"
|
|
90
|
+
part="item"
|
|
91
|
+
type="button"
|
|
92
|
+
?disabled=${this.disabled}
|
|
93
|
+
aria-current=${ariaCurrent}
|
|
94
|
+
@click=${this.handleClick}
|
|
95
|
+
>
|
|
96
|
+
${this.content}
|
|
97
|
+
</button>
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
handleClick(event) {
|
|
101
|
+
if (this.disabled) {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
event.stopImmediatePropagation();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
handleLinkClick(event) {
|
|
107
|
+
if (this.disabled) {
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
event.stopImmediatePropagation();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: Boolean, reflect: true })
|
|
115
|
+
], LitMaterialNavigationBarItem.prototype, "selected", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: Boolean, reflect: true })
|
|
118
|
+
], LitMaterialNavigationBarItem.prototype, "disabled", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
property()
|
|
121
|
+
], LitMaterialNavigationBarItem.prototype, "href", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
property()
|
|
124
|
+
], LitMaterialNavigationBarItem.prototype, "target", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
query(".state-layer")
|
|
127
|
+
], LitMaterialNavigationBarItem.prototype, "stateLayerElement", void 0);
|
|
128
|
+
LitMaterialNavigationBarItem = __decorate([
|
|
129
|
+
customElement("lit-material-navigation-bar-item")
|
|
130
|
+
], LitMaterialNavigationBarItem);
|
|
131
|
+
export { LitMaterialNavigationBarItem };
|
|
132
|
+
//# sourceMappingURL=navigation-bar-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar-item.js","sourceRoot":"","sources":["../src/navigation-bar-item.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar-styles.d.ts","sourceRoot":"","sources":["../src/navigation-bar-styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAoBlB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.bar {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 80px;
|
|
15
|
+
background-color: var(--md-sys-color-surface-container, #f3edf7);
|
|
16
|
+
color: var(--md-sys-color-on-surface, #1c1b1f);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
::slotted(lit-material-navigation-bar-item) {
|
|
20
|
+
flex: 1;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
//# sourceMappingURL=navigation-bar-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar-styles.js","sourceRoot":"","sources":["../src/navigation-bar-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Material Design 3 navigation bar — a row of primary destinations
|
|
4
|
+
* (`lit-material-navigation-bar-item` elements) sharing a bar's width
|
|
5
|
+
* equally, typically docked to the bottom of the screen for compact window
|
|
6
|
+
* sizes.
|
|
7
|
+
*
|
|
8
|
+
* Selection is index-based and managed here (like `lit-material-tabs` and
|
|
9
|
+
* `lit-material-navigation-rail`): set `selected` to reflect your current
|
|
10
|
+
* route/section, and each item's own `selected` is kept in sync
|
|
11
|
+
* automatically. Clicking an item updates `selected` and fires `change` —
|
|
12
|
+
* items themselves don't manage selection.
|
|
13
|
+
*
|
|
14
|
+
* Unlike `lit-material-navigation-rail`, there's no `alignment` property or
|
|
15
|
+
* `fab` slot — a bottom bar is a single row of equally-shared destinations,
|
|
16
|
+
* not a strip with room to position things along its length.
|
|
17
|
+
*
|
|
18
|
+
* @element lit-material-navigation-bar
|
|
19
|
+
*
|
|
20
|
+
* @slot - `lit-material-navigation-bar-item` elements.
|
|
21
|
+
*
|
|
22
|
+
* @csspart bar - The bar (background, height, padding).
|
|
23
|
+
*
|
|
24
|
+
* @fires change - Fires when `selected` changes via an item click.
|
|
25
|
+
*/
|
|
26
|
+
export declare class LitMaterialNavigationBar extends LitElement {
|
|
27
|
+
static styles: import("lit").CSSResult;
|
|
28
|
+
/** Index of the selected item. `-1` means no selection. */
|
|
29
|
+
selected: number;
|
|
30
|
+
constructor();
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
33
|
+
private get items();
|
|
34
|
+
private syncSelected;
|
|
35
|
+
private readonly handleSlotChange;
|
|
36
|
+
private readonly handleClick;
|
|
37
|
+
render(): import("lit").TemplateResult<1>;
|
|
38
|
+
}
|
|
39
|
+
declare global {
|
|
40
|
+
interface HTMLElementTagNameMap {
|
|
41
|
+
"lit-material-navigation-bar": LitMaterialNavigationBar;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=navigation-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-bar.d.ts","sourceRoot":"","sources":["../src/navigation-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,wBAAyB,SAAQ,UAAU;IACtD,OAAgB,MAAM,0BAAU;IAEhC,2DAA2D;IAC/B,QAAQ,SAAM;;IAOjC,iBAAiB,IAAI,IAAI;cAKf,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI/D,OAAO,KAAK,KAAK,GAGhB;IAED,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmC;IAEpE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAS1B;IAEO,MAAM;CAOhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,6BAA6B,EAAE,wBAAwB,CAAC;KACzD;CACF"}
|