@francofantomius/material-components 0.1.0 → 1.0.1
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/CHANGELOG.md +80 -0
- package/README.md +550 -90
- package/custom-elements.json +21010 -2354
- package/dist/chunks/badge-G4EjcMoy.js +89 -0
- package/dist/chunks/badge-G4EjcMoy.js.map +1 -0
- package/dist/chunks/button-B4TSZ7Sl.js +250 -0
- package/dist/chunks/button-B4TSZ7Sl.js.map +1 -0
- package/dist/chunks/card-DVffdPpv.js +163 -0
- package/dist/chunks/card-DVffdPpv.js.map +1 -0
- package/dist/chunks/checkbox-BqlboAHd.js +194 -0
- package/dist/chunks/checkbox-BqlboAHd.js.map +1 -0
- package/dist/chunks/chip-CI1ZINnr.js +169 -0
- package/dist/chunks/chip-CI1ZINnr.js.map +1 -0
- package/dist/chunks/code-C5UFBkCh.js +1830 -0
- package/dist/chunks/code-C5UFBkCh.js.map +1 -0
- package/dist/chunks/decorate-DXuynaiA.js +39 -0
- package/dist/chunks/decorate-DXuynaiA.js.map +1 -0
- package/dist/chunks/dialog-DGVEE5m_.js +158 -0
- package/dist/chunks/dialog-DGVEE5m_.js.map +1 -0
- package/dist/chunks/divider-DNepwoZv.js +82 -0
- package/dist/chunks/divider-DNepwoZv.js.map +1 -0
- package/dist/chunks/fab-C9j3WBHE.js +150 -0
- package/dist/chunks/fab-C9j3WBHE.js.map +1 -0
- package/dist/chunks/focus-ring-CuiJuM-y.js +71 -0
- package/dist/chunks/focus-ring-CuiJuM-y.js.map +1 -0
- package/dist/chunks/{form-associated-fKbeX_2P.js → form-associated-Cty_ZaS9.js} +26 -27
- package/dist/chunks/form-associated-Cty_ZaS9.js.map +1 -0
- package/dist/chunks/icon-DrNqcNEL.js +62 -0
- package/dist/chunks/icon-DrNqcNEL.js.map +1 -0
- package/dist/chunks/icon-button-BdSc7eot.js +188 -0
- package/dist/chunks/icon-button-BdSc7eot.js.map +1 -0
- package/dist/chunks/list-D8olR7oZ.js +204 -0
- package/dist/chunks/list-D8olR7oZ.js.map +1 -0
- package/dist/chunks/navigation-drawer-CKl44Ef5.js +531 -0
- package/dist/chunks/navigation-drawer-CKl44Ef5.js.map +1 -0
- package/dist/chunks/player-C4ydiIpr.js +1582 -0
- package/dist/chunks/player-C4ydiIpr.js.map +1 -0
- package/dist/chunks/progress-LQmLMDjX.js +266 -0
- package/dist/chunks/progress-LQmLMDjX.js.map +1 -0
- package/dist/chunks/radio-Bily78NT.js +205 -0
- package/dist/chunks/radio-Bily78NT.js.map +1 -0
- package/dist/chunks/ripple-squbKHhj.js +135 -0
- package/dist/chunks/ripple-squbKHhj.js.map +1 -0
- package/dist/chunks/search-bar-TXnqJ-gd.js +698 -0
- package/dist/chunks/search-bar-TXnqJ-gd.js.map +1 -0
- package/dist/chunks/snackbar-Wsz3BzEY.js +161 -0
- package/dist/chunks/snackbar-Wsz3BzEY.js.map +1 -0
- package/dist/chunks/switch-DdukrvXb.js +190 -0
- package/dist/chunks/switch-DdukrvXb.js.map +1 -0
- package/dist/chunks/table-aRTYzDyE.js +773 -0
- package/dist/chunks/table-aRTYzDyE.js.map +1 -0
- package/dist/chunks/tabs-BfOtoeir.js +191 -0
- package/dist/chunks/tabs-BfOtoeir.js.map +1 -0
- package/dist/chunks/text-field-hN6-2HQy.js +338 -0
- package/dist/chunks/text-field-hN6-2HQy.js.map +1 -0
- package/dist/chunks/top-app-bar-Dgbp6CFv.js +228 -0
- package/dist/chunks/top-app-bar-Dgbp6CFv.js.map +1 -0
- package/dist/components/account-menu/account-menu.css.d.ts +3 -0
- package/dist/components/account-menu/account-menu.css.d.ts.map +1 -0
- package/dist/components/account-menu/account-menu.d.ts +111 -0
- package/dist/components/account-menu/account-menu.d.ts.map +1 -0
- package/dist/components/app-drawer/app-drawer.css.d.ts +3 -0
- package/dist/components/app-drawer/app-drawer.css.d.ts.map +1 -0
- package/dist/components/app-drawer/app-drawer.d.ts +173 -0
- package/dist/components/app-drawer/app-drawer.d.ts.map +1 -0
- package/dist/components/badge/badge.js +2 -91
- package/dist/components/button/button.js +2 -261
- package/dist/components/card/card.js +2 -167
- package/dist/components/checkbox/checkbox.css.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +2 -186
- package/dist/components/chip/chip.js +3 -172
- package/dist/components/code/code.css.d.ts +2 -0
- package/dist/components/code/code.css.d.ts.map +1 -0
- package/dist/components/code/code.d.ts +106 -0
- package/dist/components/code/code.d.ts.map +1 -0
- package/dist/components/code/code.js +5 -0
- package/dist/components/code/highlighter.d.ts +8 -0
- package/dist/components/code/highlighter.d.ts.map +1 -0
- package/dist/components/code/linter.d.ts +44 -0
- package/dist/components/code/linter.d.ts.map +1 -0
- package/dist/components/dialog/dialog.js +2 -165
- package/dist/components/divider/divider.js +2 -79
- package/dist/components/fab/fab.js +2 -153
- package/dist/components/icon/icon.js +2 -68
- package/dist/components/icon-button/icon-button.css.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js +1 -189
- package/dist/components/list/list.css.d.ts.map +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/list/list.js +3 -188
- package/dist/components/navigation-drawer/navigation-drawer.css.d.ts +3 -0
- package/dist/components/navigation-drawer/navigation-drawer.css.d.ts.map +1 -0
- package/dist/components/navigation-drawer/navigation-drawer.d.ts +76 -0
- package/dist/components/navigation-drawer/navigation-drawer.d.ts.map +1 -0
- package/dist/components/navigation-drawer/navigation-drawer.js +8 -0
- package/dist/components/player/player.css.d.ts +2 -0
- package/dist/components/player/player.css.d.ts.map +1 -0
- package/dist/components/player/player.d.ts +99 -0
- package/dist/components/player/player.d.ts.map +1 -0
- package/dist/components/player/player.js +7 -0
- package/dist/components/progress/progress.css.d.ts.map +1 -1
- package/dist/components/progress/progress.d.ts +2 -0
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/progress/progress.js +3 -181
- package/dist/components/radio/radio.css.d.ts.map +1 -1
- package/dist/components/radio/radio.js +3 -203
- package/dist/components/search-bar/search-bar.css.d.ts +2 -0
- package/dist/components/search-bar/search-bar.css.d.ts.map +1 -0
- package/dist/components/search-bar/search-bar.d.ts +81 -0
- package/dist/components/search-bar/search-bar.d.ts.map +1 -0
- package/dist/components/search-bar/search-bar.js +5 -0
- package/dist/components/snackbar/snackbar.js +2 -162
- package/dist/components/switch/switch.css.d.ts.map +1 -1
- package/dist/components/switch/switch.js +2 -169
- package/dist/components/table/table.css.d.ts +8 -0
- package/dist/components/table/table.css.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +158 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/table/table.js +13 -0
- package/dist/components/tabs/tabs.js +3 -198
- package/dist/components/text-field/text-field.css.d.ts.map +1 -1
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/text-field/text-field.d.ts.map +1 -1
- package/dist/components/text-field/text-field.js +2 -325
- package/dist/components/top-app-bar/top-app-bar.css.d.ts +2 -0
- package/dist/components/top-app-bar/top-app-bar.css.d.ts.map +1 -0
- package/dist/components/top-app-bar/top-app-bar.d.ts +29 -0
- package/dist/components/top-app-bar/top-app-bar.d.ts.map +1 -0
- package/dist/components/top-app-bar/top-app-bar.js +5 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2264 -58
- package/dist/index.js.map +1 -1
- package/dist/internal/focus-ring/focus-ring.d.ts.map +1 -1
- package/dist/internal/focus-ring/focus-ring.js +4 -0
- package/dist/internal/ripple/ripple.css.d.ts.map +1 -1
- package/dist/internal/ripple/ripple.d.ts +0 -3
- package/dist/internal/ripple/ripple.d.ts.map +1 -1
- package/dist/internal/ripple/ripple.js +2 -142
- package/dist/tokens/index.js +336 -11
- package/dist/tokens/index.js.map +1 -1
- package/package.json +118 -12
- package/dist/chunks/base-component-DQTjlEVL.js +0 -34
- package/dist/chunks/base-component-DQTjlEVL.js.map +0 -1
- package/dist/chunks/focus-ring-Dl-XoEKK.js +0 -71
- package/dist/chunks/focus-ring-Dl-XoEKK.js.map +0 -1
- package/dist/chunks/form-associated-fKbeX_2P.js.map +0 -1
- package/dist/chunks/theme.css-DV3DRha-.js +0 -263
- package/dist/chunks/theme.css-DV3DRha-.js.map +0 -1
- package/dist/components/badge/badge.js.map +0 -1
- package/dist/components/button/button.js.map +0 -1
- package/dist/components/card/card.js.map +0 -1
- package/dist/components/checkbox/checkbox.js.map +0 -1
- package/dist/components/chip/chip.js.map +0 -1
- package/dist/components/dialog/dialog.js.map +0 -1
- package/dist/components/divider/divider.js.map +0 -1
- package/dist/components/fab/fab.js.map +0 -1
- package/dist/components/icon/icon.js.map +0 -1
- package/dist/components/icon-button/icon-button.js.map +0 -1
- package/dist/components/list/list.js.map +0 -1
- package/dist/components/progress/progress.js.map +0 -1
- package/dist/components/radio/radio.js.map +0 -1
- package/dist/components/snackbar/snackbar.js.map +0 -1
- package/dist/components/switch/switch.js.map +0 -1
- package/dist/components/tabs/tabs.js.map +0 -1
- package/dist/components/text-field/text-field.js.map +0 -1
- package/dist/internal/ripple/ripple.js.map +0 -1
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
import { n as p, t as e } from "./decorate-DXuynaiA.js";
|
|
2
|
+
import "./ripple-squbKHhj.js";
|
|
3
|
+
import "./focus-ring-CuiJuM-y.js";
|
|
4
|
+
import "./icon-DrNqcNEL.js";
|
|
5
|
+
import { css as m, html as a, nothing as s } from "lit";
|
|
6
|
+
import { customElement as d, property as i } from "lit/decorators.js";
|
|
7
|
+
var y = m`
|
|
8
|
+
:host {
|
|
9
|
+
display: contents;
|
|
10
|
+
font-family: var(--md-sys-typescale-font-family, inherit);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.scrim {
|
|
14
|
+
position: fixed;
|
|
15
|
+
inset: 0;
|
|
16
|
+
background-color: var(--md-navigation-drawer-scrim-color, rgba(0, 0, 0, 0.32));
|
|
17
|
+
backdrop-filter: blur(1px);
|
|
18
|
+
opacity: 0;
|
|
19
|
+
visibility: hidden;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
transition: opacity 250ms cubic-bezier(0.2, 0, 0, 1),
|
|
22
|
+
visibility 250ms cubic-bezier(0.2, 0, 0, 1);
|
|
23
|
+
z-index: 999;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([open]) .scrim {
|
|
27
|
+
opacity: 1;
|
|
28
|
+
visibility: visible;
|
|
29
|
+
pointer-events: auto;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.drawer {
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
width: var(--md-navigation-drawer-width, 360px);
|
|
37
|
+
max-width: calc(100vw - 56px);
|
|
38
|
+
background-color: var(--md-navigation-drawer-container-color, var(--md-sys-color-surface-container-low, #F7F2FA));
|
|
39
|
+
color: var(--md-navigation-drawer-on-container-color, var(--md-sys-color-on-surface, #1D1B20));
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
z-index: 1000;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Modal Variant (Default) */
|
|
45
|
+
:host(:not([type="standard"])) .drawer,
|
|
46
|
+
:host([type="modal"]) .drawer {
|
|
47
|
+
position: fixed;
|
|
48
|
+
top: 0;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
height: 100dvh;
|
|
51
|
+
box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0, 0, 0, 0.15));
|
|
52
|
+
transition: transform 250ms cubic-bezier(0.2, 0, 0, 1),
|
|
53
|
+
visibility 250ms cubic-bezier(0.2, 0, 0, 1);
|
|
54
|
+
visibility: hidden;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Left Pivot (Default) */
|
|
58
|
+
:host(:not([pivot="right"])) .drawer {
|
|
59
|
+
left: 0;
|
|
60
|
+
border-radius: 0 16px 16px 0;
|
|
61
|
+
transform: translateX(-100%);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([open]:not([pivot="right"])) .drawer {
|
|
65
|
+
transform: translateX(0);
|
|
66
|
+
visibility: visible;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Right Pivot */
|
|
70
|
+
:host([pivot="right"]) .drawer {
|
|
71
|
+
right: 0;
|
|
72
|
+
border-radius: 16px 0 0 16px;
|
|
73
|
+
transform: translateX(100%);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([pivot="right"][open]) .drawer {
|
|
77
|
+
transform: translateX(0);
|
|
78
|
+
visibility: visible;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Standard Variant */
|
|
82
|
+
:host([type="standard"]) {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([type="standard"]) .scrim {
|
|
89
|
+
display: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([type="standard"]) .drawer {
|
|
93
|
+
position: relative;
|
|
94
|
+
height: 100%;
|
|
95
|
+
border-right: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);
|
|
96
|
+
border-radius: 0;
|
|
97
|
+
transform: none;
|
|
98
|
+
visibility: visible;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host([type="standard"][pivot="right"]) .drawer {
|
|
102
|
+
border-right: none;
|
|
103
|
+
border-left: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([type="standard"]:not([open])) {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Responsive Variant (Docked standard drawer on large screens, modal on mobile) */
|
|
111
|
+
@media (min-width: 961px) {
|
|
112
|
+
:host([responsive]),
|
|
113
|
+
:host([type="responsive"]) {
|
|
114
|
+
display: block;
|
|
115
|
+
width: var(--md-navigation-drawer-width, 280px);
|
|
116
|
+
flex-shrink: 0;
|
|
117
|
+
height: calc(100vh - var(--md-top-app-bar-height, 64px));
|
|
118
|
+
position: sticky;
|
|
119
|
+
top: var(--md-top-app-bar-height, 64px);
|
|
120
|
+
z-index: 10;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:host([responsive][closed]),
|
|
124
|
+
:host([type="responsive"][closed]) {
|
|
125
|
+
display: none !important;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([responsive]) .scrim,
|
|
129
|
+
:host([type="responsive"]) .scrim {
|
|
130
|
+
display: none !important;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([responsive]) .drawer,
|
|
134
|
+
:host([type="responsive"]) .drawer {
|
|
135
|
+
position: relative;
|
|
136
|
+
top: auto;
|
|
137
|
+
left: auto;
|
|
138
|
+
right: auto;
|
|
139
|
+
bottom: auto;
|
|
140
|
+
height: 100%;
|
|
141
|
+
width: 100%;
|
|
142
|
+
max-width: none;
|
|
143
|
+
border-right: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);
|
|
144
|
+
border-radius: 0;
|
|
145
|
+
transform: none !important;
|
|
146
|
+
visibility: visible !important;
|
|
147
|
+
box-shadow: none;
|
|
148
|
+
background-color: var(--md-navigation-drawer-container-color, var(--md-sys-color-surface, #FEF7FF));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host([responsive][pivot="right"]) .drawer,
|
|
152
|
+
:host([type="responsive"][pivot="right"]) .drawer {
|
|
153
|
+
border-right: none;
|
|
154
|
+
border-left: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@media (max-width: 960px) {
|
|
159
|
+
:host([responsive]),
|
|
160
|
+
:host([type="responsive"]) {
|
|
161
|
+
display: contents;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([responsive]) .drawer,
|
|
165
|
+
:host([type="responsive"]) .drawer {
|
|
166
|
+
position: fixed;
|
|
167
|
+
top: 0;
|
|
168
|
+
bottom: 0;
|
|
169
|
+
height: 100dvh;
|
|
170
|
+
box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0, 0, 0, 0.15));
|
|
171
|
+
transition: transform 250ms cubic-bezier(0.2, 0, 0, 1),
|
|
172
|
+
visibility 250ms cubic-bezier(0.2, 0, 0, 1);
|
|
173
|
+
visibility: hidden;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
:host([responsive]:not([pivot="right"])) .drawer,
|
|
177
|
+
:host([type="responsive"]:not([pivot="right"])) .drawer {
|
|
178
|
+
left: 0;
|
|
179
|
+
border-radius: 0 16px 16px 0;
|
|
180
|
+
transform: translateX(-100%);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:host([responsive][open]:not([pivot="right"])) .drawer,
|
|
184
|
+
:host([type="responsive"][open]:not([pivot="right"])) .drawer {
|
|
185
|
+
transform: translateX(0);
|
|
186
|
+
visibility: visible;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:host([responsive][pivot="right"]) .drawer,
|
|
190
|
+
:host([type="responsive"][pivot="right"]) .drawer {
|
|
191
|
+
right: 0;
|
|
192
|
+
border-radius: 16px 0 0 16px;
|
|
193
|
+
transform: translateX(100%);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:host([responsive][pivot="right"][open]) .drawer,
|
|
197
|
+
:host([type="responsive"][pivot="right"][open]) .drawer {
|
|
198
|
+
transform: translateX(0);
|
|
199
|
+
visibility: visible;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.header {
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
padding: 24px 28px 16px 28px;
|
|
207
|
+
box-sizing: border-box;
|
|
208
|
+
gap: 4px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.headline {
|
|
212
|
+
margin: 0;
|
|
213
|
+
font-size: var(--md-sys-typescale-title-small-size, 14px);
|
|
214
|
+
line-height: 20px;
|
|
215
|
+
font-weight: 500;
|
|
216
|
+
color: var(--md-navigation-drawer-headline-color, var(--md-sys-color-on-surface-variant, #49454F));
|
|
217
|
+
text-transform: uppercase;
|
|
218
|
+
letter-spacing: 0.1px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.content {
|
|
222
|
+
display: flex;
|
|
223
|
+
flex-direction: column;
|
|
224
|
+
flex: 1;
|
|
225
|
+
overflow-y: auto;
|
|
226
|
+
overflow-x: hidden;
|
|
227
|
+
padding: 0 12px;
|
|
228
|
+
box-sizing: border-box;
|
|
229
|
+
gap: 2px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.content::-webkit-scrollbar {
|
|
233
|
+
width: 6px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.content::-webkit-scrollbar-thumb {
|
|
237
|
+
background-color: var(--md-sys-color-outline-variant, #CAC4D0);
|
|
238
|
+
border-radius: 4px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.footer {
|
|
242
|
+
display: flex;
|
|
243
|
+
flex-direction: column;
|
|
244
|
+
padding: 12px 16px 16px 16px;
|
|
245
|
+
box-sizing: border-box;
|
|
246
|
+
gap: 8px;
|
|
247
|
+
}
|
|
248
|
+
`, b = m`
|
|
249
|
+
:host {
|
|
250
|
+
display: block;
|
|
251
|
+
outline: none;
|
|
252
|
+
box-sizing: border-box;
|
|
253
|
+
-webkit-tap-highlight-color: transparent;
|
|
254
|
+
margin-bottom: 4px;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
:host([disabled]) {
|
|
258
|
+
pointer-events: none;
|
|
259
|
+
opacity: 0.38;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.item {
|
|
263
|
+
position: relative;
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
width: 100%;
|
|
267
|
+
min-height: 56px;
|
|
268
|
+
padding: 0 24px 0 16px;
|
|
269
|
+
box-sizing: border-box;
|
|
270
|
+
border-radius: var(--md-navigation-drawer-item-shape, 28px);
|
|
271
|
+
font-family: var(--md-sys-typescale-font-family, inherit);
|
|
272
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
273
|
+
text-decoration: none;
|
|
274
|
+
gap: 12px;
|
|
275
|
+
user-select: none;
|
|
276
|
+
cursor: pointer;
|
|
277
|
+
overflow: hidden;
|
|
278
|
+
transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1),
|
|
279
|
+
color 150ms cubic-bezier(0.2, 0, 0, 1);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.item:hover {
|
|
283
|
+
background-color: var(--md-sys-color-surface-container-high, #ECE6F0);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/* Active / Selected State */
|
|
287
|
+
:host([active]) .item,
|
|
288
|
+
:host([selected]) .item {
|
|
289
|
+
background-color: var(--md-sys-color-secondary-container, #E8DEF8);
|
|
290
|
+
color: var(--md-sys-color-on-secondary-container, #1D192B);
|
|
291
|
+
font-weight: 500;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
:host([active]) .start,
|
|
295
|
+
:host([selected]) .start {
|
|
296
|
+
color: var(--md-sys-color-on-secondary-container, #1D192B);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.start {
|
|
300
|
+
display: inline-flex;
|
|
301
|
+
align-items: center;
|
|
302
|
+
justify-content: center;
|
|
303
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
304
|
+
flex-shrink: 0;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.label-container {
|
|
308
|
+
display: flex;
|
|
309
|
+
flex-direction: column;
|
|
310
|
+
flex: 1;
|
|
311
|
+
min-width: 0;
|
|
312
|
+
justify-content: center;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.label {
|
|
316
|
+
font-size: var(--md-sys-typescale-label-large-size, 14px);
|
|
317
|
+
line-height: 20px;
|
|
318
|
+
overflow: hidden;
|
|
319
|
+
text-overflow: ellipsis;
|
|
320
|
+
white-space: nowrap;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.end {
|
|
324
|
+
display: inline-flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
justify-content: center;
|
|
327
|
+
font-size: var(--md-sys-typescale-label-medium-size, 12px);
|
|
328
|
+
font-weight: 500;
|
|
329
|
+
color: inherit;
|
|
330
|
+
flex-shrink: 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.badge {
|
|
334
|
+
padding: 2px 8px;
|
|
335
|
+
font-size: 11px;
|
|
336
|
+
font-weight: 500;
|
|
337
|
+
line-height: 16px;
|
|
338
|
+
border-radius: 8px;
|
|
339
|
+
background-color: var(--md-sys-color-surface-container-highest, #E6E0E9);
|
|
340
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
341
|
+
letter-spacing: 0.2px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
:host([active]) .badge,
|
|
345
|
+
:host([selected]) .badge {
|
|
346
|
+
background-color: var(--md-sys-color-primary, #6750A4);
|
|
347
|
+
color: var(--md-sys-color-on-primary, #FFFFFF);
|
|
348
|
+
}
|
|
349
|
+
`, o = class extends p {
|
|
350
|
+
constructor(...t) {
|
|
351
|
+
super(...t), this.icon = "", this.label = "", this.headline = "", this.badge = "", this.active = !1, this.selected = !1, this.disabled = !1, this.href = "", this.target = "", this.handleClick = (n) => {
|
|
352
|
+
if (this.disabled) {
|
|
353
|
+
n.preventDefault(), n.stopImmediatePropagation();
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
this.emitEvent("item-click", {
|
|
357
|
+
label: this.label || this.headline,
|
|
358
|
+
icon: this.icon,
|
|
359
|
+
active: this.active
|
|
360
|
+
});
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
static {
|
|
364
|
+
this.styles = [p.styles, b];
|
|
365
|
+
}
|
|
366
|
+
willUpdate(t) {
|
|
367
|
+
super.willUpdate(t), t.has("selected") && !t.has("active") ? this.active = this.selected : t.has("active") && !t.has("selected") && (this.selected = this.active);
|
|
368
|
+
}
|
|
369
|
+
render() {
|
|
370
|
+
const t = this.label || this.headline, n = a`
|
|
371
|
+
<md-ripple ?disabled=${this.disabled}></md-ripple>
|
|
372
|
+
<md-focus-ring></md-focus-ring>
|
|
373
|
+
|
|
374
|
+
<div class="start">
|
|
375
|
+
${this.icon ? a`<md-icon name=${this.icon}></md-icon>` : s}
|
|
376
|
+
<slot name="icon"></slot>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<div class="label-container">
|
|
380
|
+
${t ? a`<span class="label">${t}</span>` : s}
|
|
381
|
+
<slot></slot>
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
<div class="end">
|
|
385
|
+
${this.badge ? a`<span class="badge">${this.badge}</span>` : s}
|
|
386
|
+
<slot name="badge"></slot>
|
|
387
|
+
</div>
|
|
388
|
+
`;
|
|
389
|
+
return this.href ? a`
|
|
390
|
+
<a
|
|
391
|
+
class="item"
|
|
392
|
+
href=${this.disabled ? s : this.href}
|
|
393
|
+
target=${this.target || s}
|
|
394
|
+
aria-disabled=${this.disabled ? "true" : s}
|
|
395
|
+
tabindex=${this.disabled ? "-1" : "0"}
|
|
396
|
+
@click=${this.handleClick}
|
|
397
|
+
>
|
|
398
|
+
${n}
|
|
399
|
+
</a>
|
|
400
|
+
` : a`
|
|
401
|
+
<div
|
|
402
|
+
class="item"
|
|
403
|
+
role="button"
|
|
404
|
+
tabindex=${this.disabled ? "-1" : "0"}
|
|
405
|
+
aria-disabled=${this.disabled ? "true" : s}
|
|
406
|
+
@click=${this.handleClick}
|
|
407
|
+
>
|
|
408
|
+
${n}
|
|
409
|
+
</div>
|
|
410
|
+
`;
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
e([i({ type: String })], o.prototype, "icon", void 0);
|
|
414
|
+
e([i({ type: String })], o.prototype, "label", void 0);
|
|
415
|
+
e([i({ type: String })], o.prototype, "headline", void 0);
|
|
416
|
+
e([i({ type: String })], o.prototype, "badge", void 0);
|
|
417
|
+
e([i({
|
|
418
|
+
type: Boolean,
|
|
419
|
+
reflect: !0
|
|
420
|
+
})], o.prototype, "active", void 0);
|
|
421
|
+
e([i({
|
|
422
|
+
type: Boolean,
|
|
423
|
+
reflect: !0
|
|
424
|
+
})], o.prototype, "selected", void 0);
|
|
425
|
+
e([i({
|
|
426
|
+
type: Boolean,
|
|
427
|
+
reflect: !0
|
|
428
|
+
})], o.prototype, "disabled", void 0);
|
|
429
|
+
e([i({ type: String })], o.prototype, "href", void 0);
|
|
430
|
+
e([i({ type: String })], o.prototype, "target", void 0);
|
|
431
|
+
o = e([d("md-navigation-drawer-item")], o);
|
|
432
|
+
var r = class extends p {
|
|
433
|
+
constructor(...t) {
|
|
434
|
+
super(...t), this.open = !1, this.type = "modal", this.responsive = !1, this.closed = !1, this.pivot = "left", this.headline = "", this.handleKeyDown = (n) => {
|
|
435
|
+
n.key === "Escape" && this.open && this.isModalMode() && this.close();
|
|
436
|
+
}, this.handleScrimClick = () => {
|
|
437
|
+
this.close(), this.emitEvent("scrim-click");
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
static {
|
|
441
|
+
this.styles = [p.styles, y];
|
|
442
|
+
}
|
|
443
|
+
connectedCallback() {
|
|
444
|
+
super.connectedCallback(), window.addEventListener("keydown", this.handleKeyDown);
|
|
445
|
+
}
|
|
446
|
+
disconnectedCallback() {
|
|
447
|
+
super.disconnectedCallback(), window.removeEventListener("keydown", this.handleKeyDown);
|
|
448
|
+
}
|
|
449
|
+
updated(t) {
|
|
450
|
+
super.updated(t), t.has("open") && (this.open ? this.emitEvent("open") : this.emitEvent("close")), t.has("closed") && !t.has("open") && (this.closed ? this.emitEvent("close") : this.emitEvent("open"));
|
|
451
|
+
}
|
|
452
|
+
isModalMode() {
|
|
453
|
+
return this.responsive || this.type === "responsive" ? typeof window < "u" && window.innerWidth <= 960 : this.type !== "standard";
|
|
454
|
+
}
|
|
455
|
+
show() {
|
|
456
|
+
this.isModalMode() ? this.open = !0 : (this.closed = !1, this.open = !0);
|
|
457
|
+
}
|
|
458
|
+
close() {
|
|
459
|
+
this.isModalMode() ? this.open = !1 : (this.closed = !0, this.open = !1);
|
|
460
|
+
}
|
|
461
|
+
toggle() {
|
|
462
|
+
this.isModalMode() ? this.open = !this.open : this.closed = !this.closed;
|
|
463
|
+
}
|
|
464
|
+
render() {
|
|
465
|
+
const t = this.headline ? a`<h2 class="headline">${this.headline}</h2>` : s;
|
|
466
|
+
return a`
|
|
467
|
+
<div class="scrim" @click=${this.handleScrimClick}></div>
|
|
468
|
+
|
|
469
|
+
<aside
|
|
470
|
+
class="drawer"
|
|
471
|
+
role="navigation"
|
|
472
|
+
aria-hidden=${this.open ? "false" : "true"}
|
|
473
|
+
aria-label=${this.headline || "Navigation menu"}
|
|
474
|
+
>
|
|
475
|
+
<div class="header">
|
|
476
|
+
<slot name="header">
|
|
477
|
+
${t}
|
|
478
|
+
</slot>
|
|
479
|
+
</div>
|
|
480
|
+
|
|
481
|
+
<div class="content">
|
|
482
|
+
<slot></slot>
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
<div class="footer">
|
|
486
|
+
<slot name="footer"></slot>
|
|
487
|
+
</div>
|
|
488
|
+
</aside>
|
|
489
|
+
`;
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
e([i({
|
|
493
|
+
type: Boolean,
|
|
494
|
+
reflect: !0
|
|
495
|
+
})], r.prototype, "open", void 0);
|
|
496
|
+
e([i({
|
|
497
|
+
type: String,
|
|
498
|
+
reflect: !0
|
|
499
|
+
})], r.prototype, "type", void 0);
|
|
500
|
+
e([i({
|
|
501
|
+
type: Boolean,
|
|
502
|
+
reflect: !0
|
|
503
|
+
})], r.prototype, "responsive", void 0);
|
|
504
|
+
e([i({
|
|
505
|
+
type: Boolean,
|
|
506
|
+
reflect: !0
|
|
507
|
+
})], r.prototype, "closed", void 0);
|
|
508
|
+
e([i({
|
|
509
|
+
type: String,
|
|
510
|
+
reflect: !0
|
|
511
|
+
})], r.prototype, "pivot", void 0);
|
|
512
|
+
e([i({ type: String })], r.prototype, "headline", void 0);
|
|
513
|
+
r = e([d("md-navigation-drawer")], r);
|
|
514
|
+
var c = class extends r {
|
|
515
|
+
};
|
|
516
|
+
c = e([d("md-drawer")], c);
|
|
517
|
+
var h = class extends r {
|
|
518
|
+
};
|
|
519
|
+
h = e([d("md-menu-bar")], h);
|
|
520
|
+
var v = class extends o {
|
|
521
|
+
};
|
|
522
|
+
v = e([d("md-drawer-item")], v);
|
|
523
|
+
export {
|
|
524
|
+
o as a,
|
|
525
|
+
r as i,
|
|
526
|
+
v as n,
|
|
527
|
+
h as r,
|
|
528
|
+
c as t
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
//# sourceMappingURL=navigation-drawer-CKl44Ef5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-drawer-CKl44Ef5.js","names":[],"sources":["../../src/components/navigation-drawer/navigation-drawer.css.ts","../../src/components/navigation-drawer/navigation-drawer.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const navigationDrawerStyles = css`\n :host {\n display: contents;\n font-family: var(--md-sys-typescale-font-family, inherit);\n }\n\n .scrim {\n position: fixed;\n inset: 0;\n background-color: var(--md-navigation-drawer-scrim-color, rgba(0, 0, 0, 0.32));\n backdrop-filter: blur(1px);\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n transition: opacity 250ms cubic-bezier(0.2, 0, 0, 1),\n visibility 250ms cubic-bezier(0.2, 0, 0, 1);\n z-index: 999;\n }\n\n :host([open]) .scrim {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n }\n\n .drawer {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: var(--md-navigation-drawer-width, 360px);\n max-width: calc(100vw - 56px);\n background-color: var(--md-navigation-drawer-container-color, var(--md-sys-color-surface-container-low, #F7F2FA));\n color: var(--md-navigation-drawer-on-container-color, var(--md-sys-color-on-surface, #1D1B20));\n overflow: hidden;\n z-index: 1000;\n }\n\n /* Modal Variant (Default) */\n :host(:not([type=\"standard\"])) .drawer,\n :host([type=\"modal\"]) .drawer {\n position: fixed;\n top: 0;\n bottom: 0;\n height: 100dvh;\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0, 0, 0, 0.15));\n transition: transform 250ms cubic-bezier(0.2, 0, 0, 1),\n visibility 250ms cubic-bezier(0.2, 0, 0, 1);\n visibility: hidden;\n }\n\n /* Left Pivot (Default) */\n :host(:not([pivot=\"right\"])) .drawer {\n left: 0;\n border-radius: 0 16px 16px 0;\n transform: translateX(-100%);\n }\n\n :host([open]:not([pivot=\"right\"])) .drawer {\n transform: translateX(0);\n visibility: visible;\n }\n\n /* Right Pivot */\n :host([pivot=\"right\"]) .drawer {\n right: 0;\n border-radius: 16px 0 0 16px;\n transform: translateX(100%);\n }\n\n :host([pivot=\"right\"][open]) .drawer {\n transform: translateX(0);\n visibility: visible;\n }\n\n /* Standard Variant */\n :host([type=\"standard\"]) {\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n :host([type=\"standard\"]) .scrim {\n display: none;\n }\n\n :host([type=\"standard\"]) .drawer {\n position: relative;\n height: 100%;\n border-right: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);\n border-radius: 0;\n transform: none;\n visibility: visible;\n }\n\n :host([type=\"standard\"][pivot=\"right\"]) .drawer {\n border-right: none;\n border-left: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);\n }\n\n :host([type=\"standard\"]:not([open])) {\n display: none;\n }\n\n /* Responsive Variant (Docked standard drawer on large screens, modal on mobile) */\n @media (min-width: 961px) {\n :host([responsive]),\n :host([type=\"responsive\"]) {\n display: block;\n width: var(--md-navigation-drawer-width, 280px);\n flex-shrink: 0;\n height: calc(100vh - var(--md-top-app-bar-height, 64px));\n position: sticky;\n top: var(--md-top-app-bar-height, 64px);\n z-index: 10;\n }\n\n :host([responsive][closed]),\n :host([type=\"responsive\"][closed]) {\n display: none !important;\n }\n\n :host([responsive]) .scrim,\n :host([type=\"responsive\"]) .scrim {\n display: none !important;\n }\n\n :host([responsive]) .drawer,\n :host([type=\"responsive\"]) .drawer {\n position: relative;\n top: auto;\n left: auto;\n right: auto;\n bottom: auto;\n height: 100%;\n width: 100%;\n max-width: none;\n border-right: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);\n border-radius: 0;\n transform: none !important;\n visibility: visible !important;\n box-shadow: none;\n background-color: var(--md-navigation-drawer-container-color, var(--md-sys-color-surface, #FEF7FF));\n }\n\n :host([responsive][pivot=\"right\"]) .drawer,\n :host([type=\"responsive\"][pivot=\"right\"]) .drawer {\n border-right: none;\n border-left: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);\n }\n }\n\n @media (max-width: 960px) {\n :host([responsive]),\n :host([type=\"responsive\"]) {\n display: contents;\n }\n\n :host([responsive]) .drawer,\n :host([type=\"responsive\"]) .drawer {\n position: fixed;\n top: 0;\n bottom: 0;\n height: 100dvh;\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0, 0, 0, 0.15));\n transition: transform 250ms cubic-bezier(0.2, 0, 0, 1),\n visibility 250ms cubic-bezier(0.2, 0, 0, 1);\n visibility: hidden;\n }\n\n :host([responsive]:not([pivot=\"right\"])) .drawer,\n :host([type=\"responsive\"]:not([pivot=\"right\"])) .drawer {\n left: 0;\n border-radius: 0 16px 16px 0;\n transform: translateX(-100%);\n }\n\n :host([responsive][open]:not([pivot=\"right\"])) .drawer,\n :host([type=\"responsive\"][open]:not([pivot=\"right\"])) .drawer {\n transform: translateX(0);\n visibility: visible;\n }\n\n :host([responsive][pivot=\"right\"]) .drawer,\n :host([type=\"responsive\"][pivot=\"right\"]) .drawer {\n right: 0;\n border-radius: 16px 0 0 16px;\n transform: translateX(100%);\n }\n\n :host([responsive][pivot=\"right\"][open]) .drawer,\n :host([type=\"responsive\"][pivot=\"right\"][open]) .drawer {\n transform: translateX(0);\n visibility: visible;\n }\n }\n\n .header {\n display: flex;\n flex-direction: column;\n padding: 24px 28px 16px 28px;\n box-sizing: border-box;\n gap: 4px;\n }\n\n .headline {\n margin: 0;\n font-size: var(--md-sys-typescale-title-small-size, 14px);\n line-height: 20px;\n font-weight: 500;\n color: var(--md-navigation-drawer-headline-color, var(--md-sys-color-on-surface-variant, #49454F));\n text-transform: uppercase;\n letter-spacing: 0.1px;\n }\n\n .content {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 0 12px;\n box-sizing: border-box;\n gap: 2px;\n }\n\n .content::-webkit-scrollbar {\n width: 6px;\n }\n\n .content::-webkit-scrollbar-thumb {\n background-color: var(--md-sys-color-outline-variant, #CAC4D0);\n border-radius: 4px;\n }\n\n .footer {\n display: flex;\n flex-direction: column;\n padding: 12px 16px 16px 16px;\n box-sizing: border-box;\n gap: 8px;\n }\n`;\n\nexport const navigationDrawerItemStyles = css`\n :host {\n display: block;\n outline: none;\n box-sizing: border-box;\n -webkit-tap-highlight-color: transparent;\n margin-bottom: 4px;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.38;\n }\n\n .item {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 56px;\n padding: 0 24px 0 16px;\n box-sizing: border-box;\n border-radius: var(--md-navigation-drawer-item-shape, 28px);\n font-family: var(--md-sys-typescale-font-family, inherit);\n color: var(--md-sys-color-on-surface-variant, #49454F);\n text-decoration: none;\n gap: 12px;\n user-select: none;\n cursor: pointer;\n overflow: hidden;\n transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1),\n color 150ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n .item:hover {\n background-color: var(--md-sys-color-surface-container-high, #ECE6F0);\n }\n\n /* Active / Selected State */\n :host([active]) .item,\n :host([selected]) .item {\n background-color: var(--md-sys-color-secondary-container, #E8DEF8);\n color: var(--md-sys-color-on-secondary-container, #1D192B);\n font-weight: 500;\n }\n\n :host([active]) .start,\n :host([selected]) .start {\n color: var(--md-sys-color-on-secondary-container, #1D192B);\n }\n\n .start {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n flex-shrink: 0;\n }\n\n .label-container {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n justify-content: center;\n }\n\n .label {\n font-size: var(--md-sys-typescale-label-large-size, 14px);\n line-height: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .end {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: var(--md-sys-typescale-label-medium-size, 12px);\n font-weight: 500;\n color: inherit;\n flex-shrink: 0;\n }\n\n .badge {\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 500;\n line-height: 16px;\n border-radius: 8px;\n background-color: var(--md-sys-color-surface-container-highest, #E6E0E9);\n color: var(--md-sys-color-on-surface-variant, #49454F);\n letter-spacing: 0.2px;\n }\n\n :host([active]) .badge,\n :host([selected]) .badge {\n background-color: var(--md-sys-color-primary, #6750A4);\n color: var(--md-sys-color-on-primary, #FFFFFF);\n }\n`;\n","import { html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { MdBaseElement } from '../../internal/base-component.js';\nimport '../../internal/ripple/ripple.js';\nimport '../../internal/focus-ring/focus-ring.js';\nimport '../icon/icon.js';\nimport { navigationDrawerStyles, navigationDrawerItemStyles } from './navigation-drawer.css.js';\n\nexport type NavigationDrawerType = 'modal' | 'standard' | 'responsive';\nexport type NavigationDrawerPivot = 'left' | 'right';\n\n/**\n * Material Design 3 Navigation Drawer Item component.\n *\n * @slot icon - Custom leading icon.\n * @slot - Default slot for item label / headline.\n * @slot badge - Custom trailing badge or indicator.\n */\n@customElement('md-navigation-drawer-item')\nexport class MdNavigationDrawerItem extends MdBaseElement {\n static override styles = [MdBaseElement.styles, navigationDrawerItemStyles];\n\n @property({ type: String })\n icon = '';\n\n @property({ type: String })\n label = '';\n\n @property({ type: String })\n headline = '';\n\n @property({ type: String })\n badge = '';\n\n @property({ type: Boolean, reflect: true })\n active = false;\n\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: String })\n href = '';\n\n @property({ type: String })\n target = '';\n\n override willUpdate(changedProperties: Map<string, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('selected') && !changedProperties.has('active')) {\n this.active = this.selected;\n } else if (changedProperties.has('active') && !changedProperties.has('selected')) {\n this.selected = this.active;\n }\n }\n\n private handleClick = (event: MouseEvent) => {\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n this.emitEvent('item-click', {\n label: this.label || this.headline,\n icon: this.icon,\n active: this.active,\n });\n };\n\n override render() {\n const text = this.label || this.headline;\n\n const inner = html`\n <md-ripple ?disabled=${this.disabled}></md-ripple>\n <md-focus-ring></md-focus-ring>\n\n <div class=\"start\">\n ${this.icon ? html`<md-icon name=${this.icon}></md-icon>` : nothing}\n <slot name=\"icon\"></slot>\n </div>\n\n <div class=\"label-container\">\n ${text ? html`<span class=\"label\">${text}</span>` : nothing}\n <slot></slot>\n </div>\n\n <div class=\"end\">\n ${this.badge ? html`<span class=\"badge\">${this.badge}</span>` : nothing}\n <slot name=\"badge\"></slot>\n </div>\n `;\n\n if (this.href) {\n return html`\n <a\n class=\"item\"\n href=${this.disabled ? nothing : this.href}\n target=${this.target || nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleClick}\n >\n ${inner}\n </a>\n `;\n }\n\n return html`\n <div\n class=\"item\"\n role=\"button\"\n tabindex=${this.disabled ? '-1' : '0'}\n aria-disabled=${this.disabled ? 'true' : nothing}\n @click=${this.handleClick}\n >\n ${inner}\n </div>\n `;\n }\n}\n\n/**\n * Material Design 3 Navigation Drawer (Side Menu / Menu Bar) component.\n *\n * @slot header - Top drawer header area (profile, app title, etc.).\n * @slot - Default slot for drawer navigation items.\n * @slot footer - Bottom drawer section.\n */\n@customElement('md-navigation-drawer')\nexport class MdNavigationDrawer extends MdBaseElement {\n static override styles = [MdBaseElement.styles, navigationDrawerStyles];\n\n @property({ type: Boolean, reflect: true })\n open = false;\n\n @property({ type: String, reflect: true })\n type: NavigationDrawerType = 'modal';\n\n @property({ type: Boolean, reflect: true })\n responsive = false;\n\n @property({ type: Boolean, reflect: true })\n closed = false;\n\n @property({ type: String, reflect: true })\n pivot: NavigationDrawerPivot = 'left';\n\n @property({ type: String })\n headline = '';\n\n override connectedCallback() {\n super.connectedCallback();\n window.addEventListener('keydown', this.handleKeyDown);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n\n override updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('open')) {\n if (this.open) {\n this.emitEvent('open');\n } else {\n this.emitEvent('close');\n }\n }\n if (changedProperties.has('closed') && !changedProperties.has('open')) {\n if (this.closed) {\n this.emitEvent('close');\n } else {\n this.emitEvent('open');\n }\n }\n }\n\n private isModalMode(): boolean {\n if (this.responsive || this.type === 'responsive') {\n return typeof window !== 'undefined' && window.innerWidth <= 960;\n }\n if (this.type === 'standard') return false;\n return true;\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && this.open && this.isModalMode()) {\n this.close();\n }\n };\n\n private handleScrimClick = () => {\n this.close();\n this.emitEvent('scrim-click');\n };\n\n /**\n * Opens the navigation drawer.\n */\n show() {\n if (this.isModalMode()) {\n this.open = true;\n } else {\n this.closed = false;\n this.open = true;\n }\n }\n\n /**\n * Closes the navigation drawer.\n */\n close() {\n if (this.isModalMode()) {\n this.open = false;\n } else {\n this.closed = true;\n this.open = false;\n }\n }\n\n /**\n * Toggles open / closed state of the navigation drawer.\n */\n toggle() {\n if (this.isModalMode()) {\n this.open = !this.open;\n } else {\n this.closed = !this.closed;\n }\n }\n\n override render() {\n const headlineContent = this.headline\n ? html`<h2 class=\"headline\">${this.headline}</h2>`\n : nothing;\n\n return html`\n <div class=\"scrim\" @click=${this.handleScrimClick}></div>\n\n <aside\n class=\"drawer\"\n role=\"navigation\"\n aria-hidden=${this.open ? 'false' : 'true'}\n aria-label=${this.headline || 'Navigation menu'}\n >\n <div class=\"header\">\n <slot name=\"header\">\n ${headlineContent}\n </slot>\n </div>\n\n <div class=\"content\">\n <slot></slot>\n </div>\n\n <div class=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n </aside>\n `;\n }\n}\n\n// Aliases\n@customElement('md-drawer')\nexport class MdDrawer extends MdNavigationDrawer {}\n\n@customElement('md-menu-bar')\nexport class MdMenuBar extends MdNavigationDrawer {}\n\n@customElement('md-drawer-item')\nexport class MdDrawerItem extends MdNavigationDrawerItem {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-navigation-drawer': MdNavigationDrawer;\n 'md-drawer': MdDrawer;\n 'md-menu-bar': MdMenuBar;\n 'md-navigation-drawer-item': MdNavigationDrawerItem;\n 'md-drawer-item': MdDrawerItem;\n }\n}\n"],"mappings":";;;;;;AAEA,IAAa,IAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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