scb-wc-test 0.1.114 → 0.1.115
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/mvc/components/scb-accordion/scb-accordion-item.js +43 -7
- package/mvc/components/scb-toc/scb-toc-item.js +163 -44
- package/mvc/components/scb-toc/scb-toc.js +1 -1
- package/mvc/scb-wc-test.css +1 -1
- package/package.json +2 -2
- package/scb-accordion/scb-accordion-item.js +70 -34
- package/scb-toc/scb-toc-item.d.ts +15 -5
- package/scb-toc/scb-toc-item.js +302 -134
- package/scb-wc-test.bundle.js +340 -185
- package/scb-wc-test.css +1 -1
package/scb-toc/scb-toc-item.js
CHANGED
|
@@ -1,142 +1,226 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as
|
|
3
|
-
import "../scb-icon-button/scb-icon-button.js";
|
|
1
|
+
import { css as m, LitElement as h, html as u } from "lit";
|
|
2
|
+
import { property as p, customElement as f } from "lit/decorators.js";
|
|
4
3
|
import "../scb-divider/scb-divider.js";
|
|
5
4
|
import "@material/web/focus/md-focus-ring.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import "@material/web/icon/icon.js";
|
|
6
|
+
import "@material/web/ripple/ripple.js";
|
|
7
|
+
var v = Object.defineProperty, g = Object.getOwnPropertyDescriptor, c = (t, e, i, s) => {
|
|
8
|
+
for (var o = s > 1 ? void 0 : s ? g(e, i) : e, d = t.length - 1, l; d >= 0; d--)
|
|
9
|
+
(l = t[d]) && (o = (s ? l(e, i, o) : l(o)) || o);
|
|
10
|
+
return s && o && v(e, i, o), o;
|
|
10
11
|
};
|
|
11
|
-
let
|
|
12
|
+
let a = class extends h {
|
|
12
13
|
constructor() {
|
|
13
|
-
super(...arguments), this.expanded = !1, this.label = "", this.supportingText = "", this.itemHref = "#", this.divider = !0, this._unique =
|
|
14
|
-
const
|
|
15
|
-
this._slotHasContent
|
|
16
|
-
}, this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
super(...arguments), this.expanded = !1, this.label = "", this.supportingText = "", this.itemHref = "#", this.divider = !0, this._unique = a._uid(), this._overflowVisibleTimer = null, this._slotHasContent = !1, this._onSlotChange = () => {
|
|
15
|
+
const t = this.renderRoot.querySelector("slot"), e = !!t && t.assignedElements({ flatten: !0 }).length > 0;
|
|
16
|
+
this._slotHasContent !== e && (this._slotHasContent = e, this.requestUpdate()), !this._slotHasContent && this.expanded && (this.expanded = !1), this._applyInertByExpanded();
|
|
17
|
+
}, this._toggleAccordion = () => {
|
|
18
|
+
if (!this._slotHasContent) return;
|
|
19
|
+
const t = !this.expanded;
|
|
20
|
+
t && this._collapseSiblingsIfNeeded(), this.expanded = t;
|
|
21
|
+
}, this._onKeyDown = (t) => {
|
|
22
|
+
var r;
|
|
23
|
+
const e = this.closest("scb-toc"), s = Array.from((e == null ? void 0 : e.querySelectorAll("scb-toc-item")) || []).map((n) => ({
|
|
24
|
+
host: n,
|
|
25
|
+
label: n.renderRoot.querySelector(".toc-item-label") || null
|
|
26
|
+
})).filter((n) => !!n.label), o = s.findIndex((n) => n.host === this);
|
|
27
|
+
if (o < 0) return;
|
|
28
|
+
const d = t.currentTarget, l = ((r = d == null ? void 0 : d.classList) == null ? void 0 : r.contains("toc-chevron-button")) ?? !1;
|
|
29
|
+
switch (t.key) {
|
|
30
|
+
case "Enter":
|
|
31
|
+
case " ":
|
|
32
|
+
if (!l) return;
|
|
33
|
+
t.preventDefault(), this._toggleAccordion();
|
|
34
|
+
break;
|
|
35
|
+
case "ArrowDown":
|
|
36
|
+
t.preventDefault(), o < s.length - 1 && s[o + 1].label.focus();
|
|
37
|
+
break;
|
|
38
|
+
case "ArrowUp":
|
|
39
|
+
t.preventDefault(), o > 0 && s[o - 1].label.focus();
|
|
40
|
+
break;
|
|
41
|
+
case "Home":
|
|
42
|
+
t.preventDefault(), s.length && s[0].label.focus();
|
|
43
|
+
break;
|
|
44
|
+
case "End":
|
|
45
|
+
t.preventDefault(), s.length && s[s.length - 1].label.focus();
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
35
48
|
};
|
|
36
49
|
}
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
// Privat hjälpfunktion för unik ID-generering till aria-controls
|
|
51
|
+
static _uid() {
|
|
52
|
+
var t, e;
|
|
53
|
+
return ((e = (t = globalThis.crypto) == null ? void 0 : t.randomUUID) == null ? void 0 : e.call(t)) ?? `${a._uidPrefix}-${++a._uidSeq}`;
|
|
54
|
+
}
|
|
55
|
+
firstUpdated() {
|
|
56
|
+
this._onSlotChange(), this._applyInertByExpanded(), this._syncOverflowVisibilityByExpanded();
|
|
57
|
+
}
|
|
58
|
+
updated(t) {
|
|
59
|
+
t.has("expanded") && (this._applyInertByExpanded(), this._syncOverflowVisibilityByExpanded(), this.dispatchEvent(
|
|
60
|
+
new CustomEvent("expanded-changed", {
|
|
61
|
+
detail: { expanded: this.expanded, label: this.label },
|
|
62
|
+
bubbles: !0,
|
|
63
|
+
composed: !0
|
|
64
|
+
})
|
|
65
|
+
));
|
|
39
66
|
}
|
|
40
67
|
disconnectedCallback() {
|
|
41
|
-
super.disconnectedCallback(), this.
|
|
68
|
+
super.disconnectedCallback(), this._overflowVisibleTimer !== null && (window.clearTimeout(this._overflowVisibleTimer), this._overflowVisibleTimer = null);
|
|
69
|
+
}
|
|
70
|
+
_applyInertByExpanded() {
|
|
71
|
+
const t = this.renderRoot.querySelector(".scb-toc-item-bottom");
|
|
72
|
+
t && (this.expanded ? (t.removeAttribute("inert"), t.setAttribute("aria-hidden", "false"), this._restoreTabIndexesIfNeeded()) : (t.setAttribute("inert", ""), t.setAttribute("aria-hidden", "true"), this._removeTabIndexesIfNeeded()));
|
|
73
|
+
}
|
|
74
|
+
_syncOverflowVisibilityByExpanded() {
|
|
75
|
+
if (this._overflowVisibleTimer !== null && (window.clearTimeout(this._overflowVisibleTimer), this._overflowVisibleTimer = null), this.removeAttribute("data-expanded-settled"), !this.expanded) return;
|
|
76
|
+
const t = this.renderRoot.querySelector(".scb-toc-item-bottom");
|
|
77
|
+
if (!t) {
|
|
78
|
+
this.setAttribute("data-expanded-settled", "");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const e = this._getTransitionMs(t);
|
|
82
|
+
if (e <= 0) {
|
|
83
|
+
this.setAttribute("data-expanded-settled", "");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this._overflowVisibleTimer = window.setTimeout(() => {
|
|
87
|
+
this._overflowVisibleTimer = null, this.expanded && this.setAttribute("data-expanded-settled", "");
|
|
88
|
+
}, e);
|
|
89
|
+
}
|
|
90
|
+
_getTransitionMs(t) {
|
|
91
|
+
const e = getComputedStyle(t), i = e.transitionDuration.split(",").map((r) => r.trim()), s = e.transitionDelay.split(",").map((r) => r.trim()), o = (r) => {
|
|
92
|
+
const n = parseFloat(r);
|
|
93
|
+
return Number.isFinite(n) ? r.endsWith("ms") ? n : r.endsWith("s") ? n * 1e3 : n : 0;
|
|
94
|
+
}, d = Math.max(i.length, s.length);
|
|
95
|
+
let l = 0;
|
|
96
|
+
for (let r = 0; r < d; r += 1) {
|
|
97
|
+
const n = o(i[r] ?? i[i.length - 1] ?? "0s"), b = o(s[r] ?? s[s.length - 1] ?? "0s");
|
|
98
|
+
l = Math.max(l, n + b);
|
|
99
|
+
}
|
|
100
|
+
return Math.ceil(l);
|
|
42
101
|
}
|
|
43
|
-
|
|
44
|
-
|
|
102
|
+
_supportsInert() {
|
|
103
|
+
return "inert" in HTMLElement.prototype;
|
|
45
104
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
105
|
+
_collectFocusableFromSlot() {
|
|
106
|
+
const t = this.renderRoot.querySelector("slot");
|
|
107
|
+
if (!t) return [];
|
|
108
|
+
const e = t.assignedElements({ flatten: !0 }), i = [], s = (o) => {
|
|
109
|
+
o instanceof HTMLElement && o.matches("a,button,input,select,textarea,[tabindex]") && i.push(o);
|
|
110
|
+
};
|
|
111
|
+
return e.forEach((o) => {
|
|
112
|
+
var d;
|
|
113
|
+
s(o), (d = o.querySelectorAll) == null || d.call(o, "a,button,input,select,textarea,[tabindex]").forEach((l) => s(l));
|
|
114
|
+
}), i;
|
|
115
|
+
}
|
|
116
|
+
_removeTabIndexesIfNeeded() {
|
|
117
|
+
if (this._supportsInert()) return;
|
|
118
|
+
this._collectFocusableFromSlot().forEach((e) => {
|
|
119
|
+
const i = e.getAttribute("tabindex");
|
|
120
|
+
i !== null && e.setAttribute("data-scb-prev-tabindex", i), e.setAttribute("tabindex", "-1");
|
|
56
121
|
});
|
|
57
122
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
123
|
+
_restoreTabIndexesIfNeeded() {
|
|
124
|
+
if (this._supportsInert()) return;
|
|
125
|
+
this._collectFocusableFromSlot().forEach((e) => {
|
|
126
|
+
const i = e.getAttribute("data-scb-prev-tabindex");
|
|
127
|
+
i !== null ? (e.setAttribute("tabindex", i), e.removeAttribute("data-scb-prev-tabindex")) : e.removeAttribute("tabindex");
|
|
128
|
+
});
|
|
62
129
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
_onKeyDown(e) {
|
|
70
|
-
const s = this.closest("scb-toc"), t = Array.from((s == null ? void 0 : s.querySelectorAll("scb-toc-item")) || []).map((n) => n.renderRoot.querySelector(".scb-toc-item")).filter((n) => !!n), i = e.currentTarget, a = t.indexOf(i);
|
|
71
|
-
switch (e.key) {
|
|
72
|
-
case "Enter":
|
|
73
|
-
case " ":
|
|
74
|
-
e.preventDefault(), this.toggleAccordion();
|
|
75
|
-
break;
|
|
76
|
-
case "ArrowDown":
|
|
77
|
-
e.preventDefault(), a < t.length - 1 && t[a + 1].focus();
|
|
78
|
-
break;
|
|
79
|
-
case "ArrowUp":
|
|
80
|
-
e.preventDefault(), a > 0 && t[a - 1].focus();
|
|
81
|
-
break;
|
|
82
|
-
case "Home":
|
|
83
|
-
e.preventDefault(), t.length && t[0].focus();
|
|
84
|
-
break;
|
|
85
|
-
case "End":
|
|
86
|
-
e.preventDefault(), t.length && t[t.length - 1].focus();
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
130
|
+
_collapseSiblingsIfNeeded() {
|
|
131
|
+
const t = this.closest("scb-toc");
|
|
132
|
+
if (!t || t.hasAttribute("detached")) return;
|
|
133
|
+
t.querySelectorAll("scb-toc-item").forEach((i) => {
|
|
134
|
+
i !== this && i.expanded && (i.expanded = !1);
|
|
135
|
+
});
|
|
89
136
|
}
|
|
90
137
|
render() {
|
|
91
|
-
const
|
|
92
|
-
return
|
|
93
|
-
<div
|
|
94
|
-
class="scb-toc-item"
|
|
95
|
-
role="listitem"
|
|
96
|
-
aria-expanded=${this.expanded}
|
|
97
|
-
aria-controls=${e}
|
|
98
|
-
>
|
|
138
|
+
const t = `bottom-${this._unique}`, e = `toc-label-${this._unique}`, i = `toc-chevron-${this._unique}`;
|
|
139
|
+
return u`
|
|
140
|
+
<div class="scb-toc-item" role="listitem">
|
|
99
141
|
<div class="scb-toc-item-top">
|
|
100
142
|
<div>
|
|
101
143
|
<div class="toc-item-label-wrapper">
|
|
102
|
-
<a
|
|
103
|
-
|
|
144
|
+
<a
|
|
145
|
+
id=${e}
|
|
146
|
+
class="toc-item-label"
|
|
147
|
+
href=${this.itemHref}
|
|
148
|
+
@keydown=${this._onKeyDown}
|
|
149
|
+
>
|
|
150
|
+
${this.label}
|
|
151
|
+
</a>
|
|
152
|
+
<md-focus-ring for=${e} inward></md-focus-ring>
|
|
104
153
|
</div>
|
|
105
154
|
<div class="supporting-text">${this.supportingText}</div>
|
|
106
155
|
</div>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
156
|
+
|
|
157
|
+
${this._slotHasContent ? u`
|
|
158
|
+
<div class="toc-chevron-button-wrapper">
|
|
159
|
+
<button
|
|
160
|
+
id=${i}
|
|
161
|
+
class="toc-chevron-button"
|
|
162
|
+
type="button"
|
|
163
|
+
aria-label=${this.expanded ? "Fäll ihop avsnitt" : "Fäll ut avsnitt"}
|
|
164
|
+
aria-expanded=${this.expanded ? "true" : "false"}
|
|
165
|
+
aria-controls=${t}
|
|
166
|
+
@click=${this._toggleAccordion}
|
|
167
|
+
@keydown=${this._onKeyDown}
|
|
168
|
+
>
|
|
169
|
+
<md-ripple></md-ripple>
|
|
170
|
+
<md-icon class="toc-chevron-icon" aria-hidden="true">expand_more</md-icon>
|
|
171
|
+
</button>
|
|
172
|
+
<md-focus-ring for=${i} inward></md-focus-ring>
|
|
173
|
+
</div>
|
|
114
174
|
` : ""}
|
|
115
175
|
</div>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class="
|
|
119
|
-
|
|
120
|
-
|
|
176
|
+
|
|
177
|
+
<div id=${t} class="scb-toc-item-bottom" role="region" aria-labelledby=${e}>
|
|
178
|
+
<div class="bottom-inner">
|
|
179
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
180
|
+
</div>
|
|
121
181
|
</div>
|
|
122
|
-
|
|
182
|
+
|
|
183
|
+
${this.divider ? u`<scb-divider></scb-divider>` : ""}
|
|
123
184
|
</div>
|
|
124
185
|
`;
|
|
125
186
|
}
|
|
126
187
|
};
|
|
127
|
-
|
|
128
|
-
|
|
188
|
+
a._uidPrefix = `uid-${Math.random().toString(36).slice(2)}`;
|
|
189
|
+
a._uidSeq = 0;
|
|
190
|
+
a.styles = [
|
|
191
|
+
m`
|
|
192
|
+
:host {
|
|
193
|
+
display: block;
|
|
194
|
+
--scb-toc-transition-duration: var(--motion-duration-medium, 150ms);
|
|
195
|
+
--scb-toc-transition-easing: var(
|
|
196
|
+
--motion-easing-emphasized-accelerate,
|
|
197
|
+
var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98))
|
|
198
|
+
);
|
|
199
|
+
--scb-toc-panel-padding-closed: var(--spacing-0, 0px);
|
|
200
|
+
color: var(--md-sys-color-on-surface);
|
|
201
|
+
font-family: var(--brand-font, 'Inter', sans-serif);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([expanded]) {
|
|
205
|
+
--scb-toc-transition-easing: var(
|
|
206
|
+
--motion-easing-emphasized-decelerate,
|
|
207
|
+
var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98))
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
129
211
|
.scb-toc-item-top {
|
|
130
|
-
padding: var(--spacing-5) var(--spacing-3);
|
|
212
|
+
padding: var(--spacing-5, 16px) var(--spacing-3, 8px);
|
|
131
213
|
display: flex;
|
|
132
|
-
gap: var(--spacing-5);
|
|
214
|
+
gap: var(--spacing-5, 16px);
|
|
133
215
|
flex-direction: row;
|
|
134
216
|
}
|
|
217
|
+
|
|
135
218
|
.toc-item-label-wrapper {
|
|
136
219
|
position: relative;
|
|
137
220
|
display: block;
|
|
138
221
|
width: fit-content;
|
|
139
222
|
}
|
|
223
|
+
|
|
140
224
|
.toc-item-label {
|
|
141
225
|
display: block;
|
|
142
226
|
width: fit-content;
|
|
@@ -147,71 +231,155 @@ r.styles = [
|
|
|
147
231
|
letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
148
232
|
text-decoration: underline;
|
|
149
233
|
text-decoration-thickness: 1px;
|
|
150
|
-
text-underline-offset: .1578em;
|
|
151
|
-
margin-bottom: var(--spacing-3);
|
|
234
|
+
text-underline-offset: 0.1578em;
|
|
235
|
+
margin-bottom: var(--spacing-3, 8px);
|
|
152
236
|
}
|
|
237
|
+
|
|
153
238
|
.toc-item-label:hover {
|
|
154
239
|
color: var(--md-sys-color-on-surface);
|
|
155
240
|
text-decoration-thickness: 2px;
|
|
156
241
|
}
|
|
242
|
+
|
|
157
243
|
.toc-item-label:focus {
|
|
158
244
|
color: var(--md-sys-color-on-surface);
|
|
159
245
|
outline: none;
|
|
160
|
-
|
|
161
246
|
}
|
|
247
|
+
|
|
162
248
|
.toc-item-label-wrapper md-focus-ring {
|
|
163
249
|
position: absolute;
|
|
164
250
|
pointer-events: none;
|
|
165
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
251
|
+
border-radius: var(--md-sys-shape-corner-small, 8px);
|
|
166
252
|
--md-focus-ring-inward-offset: -7px;
|
|
167
253
|
}
|
|
168
|
-
|
|
254
|
+
|
|
255
|
+
.supporting-text {
|
|
256
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
257
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
258
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
259
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.toc-chevron-button-wrapper {
|
|
263
|
+
position: relative;
|
|
169
264
|
margin-left: auto;
|
|
265
|
+
display: flex;
|
|
266
|
+
align-items: flex-start;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.toc-chevron-button {
|
|
270
|
+
position: relative;
|
|
271
|
+
display: inline-flex;
|
|
272
|
+
align-items: center;
|
|
273
|
+
justify-content: center;
|
|
274
|
+
inline-size: 40px;
|
|
275
|
+
block-size: 40px;
|
|
276
|
+
padding: 0;
|
|
277
|
+
border: 0;
|
|
278
|
+
background: transparent;
|
|
279
|
+
border-radius: 999px;
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
color: inherit;
|
|
282
|
+
-webkit-tap-highlight-color: transparent;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.toc-chevron-button:focus {
|
|
286
|
+
outline: none;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.toc-chevron-button md-ripple {
|
|
290
|
+
border-radius: inherit;
|
|
170
291
|
}
|
|
292
|
+
|
|
293
|
+
.toc-chevron-button-wrapper md-focus-ring {
|
|
294
|
+
position: absolute;
|
|
295
|
+
inset: 0;
|
|
296
|
+
pointer-events: none;
|
|
297
|
+
border-radius: 999px;
|
|
298
|
+
--md-focus-ring-inward-offset: -7px;
|
|
299
|
+
height: var(--icon-size-large, 40px);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.toc-chevron-icon {
|
|
303
|
+
transform: rotate(0deg);
|
|
304
|
+
transition: transform var(--motion-duration-medium, var(--scb-toc-transition-duration))
|
|
305
|
+
var(--motion-easing-standard, var(--scb-toc-transition-easing));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
:host([expanded]) .toc-chevron-icon {
|
|
309
|
+
transform: rotate(180deg);
|
|
310
|
+
}
|
|
311
|
+
|
|
171
312
|
scb-divider {
|
|
172
|
-
margin: var(--spacing-0) var(--spacing-3);
|
|
313
|
+
margin: var(--spacing-0, 0px) var(--spacing-3, 8px);
|
|
173
314
|
}
|
|
315
|
+
|
|
316
|
+
/* Animerar panelen utan JS genom grid-template-rows 0fr till 1fr */
|
|
174
317
|
.scb-toc-item-bottom {
|
|
318
|
+
display: grid;
|
|
319
|
+
grid-template-rows: 0fr;
|
|
320
|
+
transition:
|
|
321
|
+
grid-template-rows var(--scb-toc-transition-duration) var(--scb-toc-transition-easing),
|
|
322
|
+
opacity var(--scb-toc-transition-duration) var(--scb-toc-transition-easing),
|
|
323
|
+
padding var(--scb-toc-transition-duration) var(--scb-toc-transition-easing);
|
|
324
|
+
opacity: 0;
|
|
325
|
+
overflow: hidden;
|
|
326
|
+
padding-top: var(--spacing-0, 0px);
|
|
327
|
+
padding-right: var(--spacing-5, 16px);
|
|
328
|
+
padding-bottom: var(--scb-toc-panel-padding-closed);
|
|
329
|
+
padding-left: var(--spacing-9, 32px);
|
|
175
330
|
font-size: var(--md-sys-typescale-body-medium-size);
|
|
176
331
|
line-height: var(--md-sys-typescale-body-medium-line-height); /* 150% */
|
|
177
332
|
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
178
333
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
334
|
+
|
|
335
|
+
:host([expanded]) .scb-toc-item-bottom {
|
|
336
|
+
grid-template-rows: 1fr;
|
|
337
|
+
opacity: 1;
|
|
338
|
+
padding-bottom: var(--spacing-5, 16px);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.bottom-inner {
|
|
182
342
|
overflow: hidden;
|
|
183
|
-
transition: .15s cubic-bezier(.69,.16,.2,.98);
|
|
184
|
-
opacity: var(--spacing-0);
|
|
185
343
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
max-height: 100%;
|
|
344
|
+
|
|
345
|
+
:host([expanded][data-expanded-settled]) .scb-toc-item-bottom {
|
|
346
|
+
overflow: visible;
|
|
190
347
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
348
|
+
|
|
349
|
+
:host([expanded][data-expanded-settled]) .bottom-inner {
|
|
350
|
+
overflow: visible;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@media (prefers-reduced-motion: reduce) {
|
|
354
|
+
.scb-toc-item-bottom,
|
|
355
|
+
.toc-chevron-icon {
|
|
356
|
+
transition: none;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
md-ripple {
|
|
360
|
+
display: none;
|
|
361
|
+
}
|
|
194
362
|
}
|
|
195
363
|
`
|
|
196
364
|
];
|
|
197
365
|
c([
|
|
198
|
-
|
|
199
|
-
],
|
|
366
|
+
p({ type: Boolean, reflect: !0 })
|
|
367
|
+
], a.prototype, "expanded", 2);
|
|
200
368
|
c([
|
|
201
|
-
|
|
202
|
-
],
|
|
369
|
+
p({ type: String, reflect: !0 })
|
|
370
|
+
], a.prototype, "label", 2);
|
|
203
371
|
c([
|
|
204
|
-
|
|
205
|
-
],
|
|
372
|
+
p({ type: String, attribute: "supporting-text" })
|
|
373
|
+
], a.prototype, "supportingText", 2);
|
|
206
374
|
c([
|
|
207
|
-
|
|
208
|
-
],
|
|
375
|
+
p({ type: String, attribute: "item-href" })
|
|
376
|
+
], a.prototype, "itemHref", 2);
|
|
209
377
|
c([
|
|
210
|
-
|
|
211
|
-
],
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
],
|
|
378
|
+
p({ type: Boolean, attribute: "divider" })
|
|
379
|
+
], a.prototype, "divider", 2);
|
|
380
|
+
a = c([
|
|
381
|
+
f("scb-toc-item")
|
|
382
|
+
], a);
|
|
215
383
|
export {
|
|
216
|
-
|
|
384
|
+
a as ScbTocItem
|
|
217
385
|
};
|