scb-wc-test 0.1.113 → 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.
@@ -1,14 +1,14 @@
1
- import { css as v, LitElement as h, nothing as p, html as l } from "lit";
2
- import { property as o, customElement as m } from "lit/decorators.js";
1
+ import { css as v, LitElement as m, nothing as p, html as l } from "lit";
2
+ import { property as o, customElement as h } from "lit/decorators.js";
3
3
  import "@material/web/focus/md-focus-ring.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import "@material/web/ripple/ripple.js";
6
- var u = Object.defineProperty, b = Object.getOwnPropertyDescriptor, a = (t, e, s, r) => {
7
- for (var n = r > 1 ? void 0 : r ? b(e, s) : e, c = t.length - 1, d; c >= 0; c--)
8
- (d = t[c]) && (n = (r ? d(e, s, n) : d(n)) || n);
9
- return r && n && u(e, s, n), n;
6
+ var u = Object.defineProperty, b = Object.getOwnPropertyDescriptor, r = (t, e, s, a) => {
7
+ for (var n = a > 1 ? void 0 : a ? b(e, s) : e, c = t.length - 1, d; c >= 0; c--)
8
+ (d = t[c]) && (n = (a ? d(e, s, n) : d(n)) || n);
9
+ return a && n && u(e, s, n), n;
10
10
  };
11
- let i = class extends h {
11
+ let i = class extends m {
12
12
  constructor() {
13
13
  super(...arguments), this.open = !1, this.title = "", this.content = "", this.overline = "", this.supportingText = "", this.leading = !1, this.leadingVariant = "", this.leadingIcon = "", this.imgHrefImage = "", this.avatarLabel = "", this.avatarAlt = "", this.avatarVariant = "icon", this.avatarSrc = "", this.density = 0, this._unique = i._uid(), this._onToggle = (t) => {
14
14
  const e = t.currentTarget;
@@ -31,22 +31,22 @@ let i = class extends h {
31
31
  !t || !e || (e.open ? (t.removeAttribute("inert"), t.setAttribute("aria-hidden", "false")) : (t.setAttribute("inert", ""), t.setAttribute("aria-hidden", "true")));
32
32
  }
33
33
  _onKeyDown(t) {
34
- const e = this.closest("scb-accordion"), r = Array.from((e == null ? void 0 : e.querySelectorAll("scb-accordion-item")) || []).map((d) => {
34
+ const e = this.closest("scb-accordion"), a = Array.from((e == null ? void 0 : e.querySelectorAll("scb-accordion-item")) || []).map((d) => {
35
35
  var g;
36
36
  return ((g = d.renderRoot.querySelector("details")) == null ? void 0 : g.querySelector(".scb-accordion-top")) || null;
37
- }).filter((d) => !!d), n = t.currentTarget, c = r.indexOf(n);
37
+ }).filter((d) => !!d), n = t.currentTarget, c = a.indexOf(n);
38
38
  switch (t.key) {
39
39
  case "ArrowDown":
40
- t.preventDefault(), c < r.length - 1 && r[c + 1].focus();
40
+ t.preventDefault(), c < a.length - 1 && a[c + 1].focus();
41
41
  break;
42
42
  case "ArrowUp":
43
- t.preventDefault(), c > 0 && r[c - 1].focus();
43
+ t.preventDefault(), c > 0 && a[c - 1].focus();
44
44
  break;
45
45
  case "Home":
46
- t.preventDefault(), r.length && r[0].focus();
46
+ t.preventDefault(), a.length && a[0].focus();
47
47
  break;
48
48
  case "End":
49
- t.preventDefault(), r.length && r[r.length - 1].focus();
49
+ t.preventDefault(), a.length && a[a.length - 1].focus();
50
50
  break;
51
51
  }
52
52
  }
@@ -118,8 +118,8 @@ i.styles = [
118
118
  position: relative;
119
119
  --scb-accordion-hover-radius: var(--radius-none, 0px);
120
120
  --scb-accordion-chevron-nudge-y: 3px;
121
- --scb-accordion-transition-duration: 150ms;
122
- --scb-accordion-transition-easing: cubic-bezier(.69,.16,.2,.98);
121
+ --scb-accordion-transition-duration: var(--motion-duration-medium, 150ms);
122
+ --scb-accordion-transition-easing: var(--motion-easing-emphasized-accelerate, var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98)));
123
123
  --scb-accordion-panel-padding-closed: var(--spacing-0, 0px);
124
124
  }
125
125
 
@@ -166,7 +166,10 @@ i.styles = [
166
166
  padding-block: var(--spacing-4, 12px);
167
167
  }
168
168
 
169
- /* Panelinnehåll + animationer (grid 0fr -> 1fr) */
169
+ details[open] {
170
+ --scb-accordion-transition-easing: var(--motion-easing-emphasized-decelerate, var(--motion-easing-standard, cubic-bezier(.69,.16,.2,.98)));
171
+ }
172
+
170
173
  .scb-accordion-bottom {
171
174
  display: grid;
172
175
  grid-template-rows: 0fr;
@@ -189,6 +192,40 @@ i.styles = [
189
192
  }
190
193
  .bottom-inner { overflow: hidden; }
191
194
 
195
+ /* Browsers med stöd för ::details-content och interpolate-size kan animera höjd till auto. */
196
+ @supports selector(::details-content) and (interpolate-size: allow-keywords) {
197
+ :host {
198
+ interpolate-size: allow-keywords;
199
+ }
200
+
201
+ details {
202
+ interpolate-size: allow-keywords;
203
+ }
204
+
205
+ details::details-content {
206
+ height: 0;
207
+ overflow: clip;
208
+ content-visibility: hidden;
209
+ transition:
210
+ height var(--scb-accordion-transition-duration) var(--scb-accordion-transition-easing),
211
+ content-visibility var(--scb-accordion-transition-duration) var(--scb-accordion-transition-easing)
212
+ allow-discrete;
213
+ }
214
+
215
+ details[open]::details-content {
216
+ height: auto;
217
+ content-visibility: visible;
218
+ }
219
+
220
+ .scb-accordion-bottom {
221
+ display: block;
222
+ grid-template-rows: unset;
223
+ transition:
224
+ opacity var(--scb-accordion-transition-duration) var(--scb-accordion-transition-easing),
225
+ padding var(--scb-accordion-transition-duration) var(--scb-accordion-transition-easing);
226
+ }
227
+ }
228
+
192
229
  .title {
193
230
  font-family: var(--brand-font);
194
231
  font-size: var(--md-sys-typescale-title-large-size);
@@ -227,8 +264,7 @@ i.styles = [
227
264
  .chevron {
228
265
  margin-left: auto;
229
266
  padding-top: var(--scb-accordion-chevron-nudge-y, 3px);
230
- font-size: var(--icon-size-small, 24px);
231
- transition: transform var(--scb-accordion-transition-duration) var(--scb-accordion-transition-easing);
267
+ transition: transform var(--motion-duration-medium, var(--scb-accordion-transition-duration)) var(--motion-easing-standard, var(--scb-accordion-transition-easing));
232
268
  }
233
269
  details[open] .chevron { transform: rotate(180deg); }
234
270
 
@@ -244,50 +280,50 @@ i.styles = [
244
280
  }
245
281
  `
246
282
  ];
247
- a([
283
+ r([
248
284
  o({ type: Boolean, reflect: !0 })
249
285
  ], i.prototype, "open", 2);
250
- a([
286
+ r([
251
287
  o({ type: String, reflect: !0 })
252
288
  ], i.prototype, "title", 2);
253
- a([
289
+ r([
254
290
  o({ type: String })
255
291
  ], i.prototype, "content", 2);
256
- a([
292
+ r([
257
293
  o({ type: String, attribute: "overline" })
258
294
  ], i.prototype, "overline", 2);
259
- a([
295
+ r([
260
296
  o({ type: String, attribute: "supporting-text" })
261
297
  ], i.prototype, "supportingText", 2);
262
- a([
298
+ r([
263
299
  o({ type: Boolean })
264
300
  ], i.prototype, "leading", 2);
265
- a([
301
+ r([
266
302
  o({ type: String, attribute: "leading-variant", reflect: !0 })
267
303
  ], i.prototype, "leadingVariant", 2);
268
- a([
304
+ r([
269
305
  o({ type: String, attribute: "leading-icon" })
270
306
  ], i.prototype, "leadingIcon", 2);
271
- a([
307
+ r([
272
308
  o({ type: String, attribute: "img-href-image", reflect: !0 })
273
309
  ], i.prototype, "imgHrefImage", 2);
274
- a([
310
+ r([
275
311
  o({ type: String, attribute: "avatar-label" })
276
312
  ], i.prototype, "avatarLabel", 2);
277
- a([
313
+ r([
278
314
  o({ type: String, attribute: "avatar-alt" })
279
315
  ], i.prototype, "avatarAlt", 2);
280
- a([
316
+ r([
281
317
  o({ type: String, attribute: "avatar-variant" })
282
318
  ], i.prototype, "avatarVariant", 2);
283
- a([
319
+ r([
284
320
  o({ type: String, attribute: "avatar-src" })
285
321
  ], i.prototype, "avatarSrc", 2);
286
- a([
322
+ r([
287
323
  o({ type: Number, reflect: !0 })
288
324
  ], i.prototype, "density", 2);
289
- i = a([
290
- m("scb-accordion-item")
325
+ i = r([
326
+ h("scb-accordion-item")
291
327
  ], i);
292
328
  export {
293
329
  i as ScbAccordionItem
@@ -5,16 +5,26 @@ export declare class ScbTocItem extends LitElement {
5
5
  supportingText: string;
6
6
  itemHref: string;
7
7
  divider: boolean;
8
+ private static _uidPrefix;
9
+ private static _uidSeq;
10
+ private static _uid;
8
11
  private _unique;
12
+ private _overflowVisibleTimer;
9
13
  static styles: import('lit').CSSResult[];
10
14
  private _slotHasContent;
11
- connectedCallback(): void;
12
- disconnectedCallback(): void;
15
+ protected firstUpdated(): void;
13
16
  protected updated(changed: Map<string, unknown>): void;
17
+ disconnectedCallback(): void;
18
+ private _applyInertByExpanded;
19
+ private _syncOverflowVisibilityByExpanded;
20
+ private _getTransitionMs;
14
21
  private _onSlotChange;
15
- private _updateTabbable;
16
- private toggleAccordion;
17
- private toggleBottom;
22
+ private _supportsInert;
23
+ private _collectFocusableFromSlot;
24
+ private _removeTabIndexesIfNeeded;
25
+ private _restoreTabIndexesIfNeeded;
26
+ private _collapseSiblingsIfNeeded;
27
+ private _toggleAccordion;
18
28
  private _onKeyDown;
19
29
  render(): import('lit-html').TemplateResult<1>;
20
30
  }