scb-wc-test 0.1.340 → 0.1.342

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,5 +1,5 @@
1
- import { css as L, LitElement as C, html as r, nothing as m } from "lit";
2
- import { property as a, customElement as F } from "lit/decorators.js";
1
+ import { css as H, LitElement as E, html as r, nothing as g } from "lit";
2
+ import { property as a, customElement as D } from "lit/decorators.js";
3
3
  import "@material/web/focus/md-focus-ring.js";
4
4
  import "../scb-list/scb-list.js";
5
5
  import "../scb-button/scb-button.js";
@@ -7,20 +7,20 @@ import "../scb-icon-button/scb-icon-button.js";
7
7
  import "../scb-link/scb-link.js";
8
8
  import "../scb-avatar/scb-avatar.js";
9
9
  import "../scb-tooltip/scb-tooltip.js";
10
- var H = Object.defineProperty, E = Object.getOwnPropertyDescriptor, w = (t) => {
10
+ var B = Object.defineProperty, N = Object.getOwnPropertyDescriptor, P = (t) => {
11
11
  throw TypeError(t);
12
12
  }, s = (t, e, n, c) => {
13
- for (var o = c > 1 ? void 0 : c ? E(e, n) : e, d = t.length - 1, h; d >= 0; d--)
14
- (h = t[d]) && (o = (c ? h(e, n, o) : h(o)) || o);
15
- return c && o && H(e, n, o), o;
16
- }, B = (t, e, n) => e.has(t) || w("Cannot " + n), D = (t, e, n) => e.has(t) ? w("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), f = (t, e, n) => (B(t, e, "access private method"), n), y, z, k;
13
+ for (var o = c > 1 ? void 0 : c ? N(e, n) : e, p = t.length - 1, h; p >= 0; p--)
14
+ (h = t[p]) && (o = (c ? h(e, n, o) : h(o)) || o);
15
+ return c && o && B(e, n, o), o;
16
+ }, W = (t, e, n) => e.has(t) || P("Cannot " + n), M = (t, e, n) => e.has(t) ? P("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), x = (t, e, n) => (W(t, e, "access private method"), n), f, _, $;
17
17
  const l = {
18
18
  fromAttribute: (t) => t ?? "",
19
19
  toAttribute: (t) => typeof t != "string" || t.trim() === "" ? null : t
20
20
  };
21
- let i = class extends C {
21
+ let i = class extends E {
22
22
  constructor() {
23
- super(...arguments), D(this, y), this.__managedSocialAttributes = /* @__PURE__ */ new Set([
23
+ super(...arguments), M(this, f), this.__managedSocialAttributes = /* @__PURE__ */ new Set([
24
24
  "social-comments-text",
25
25
  "social-comments",
26
26
  "social-comments-href",
@@ -32,7 +32,7 @@ let i = class extends C {
32
32
  "social-author",
33
33
  "social-author-text",
34
34
  "social-author-href"
35
- ]), this.__isSyncingManagedSocialAttributes = !1, this.type = "standard", this.variant = "standard", this.direction = "vertical", this.size = "large", this.mediaType = "", this.mediaHref = "", this.mediaAlt = "", this.mediaSrcset = "", this.mediaSizes = "", this.mediaLoading = "auto", this.mediaDecoding = "async", this.mediaFetchPriority = "auto", this.mediaFit = "cover", this.mediaPosition = "center", this.mediaWidth = "", this.mediaHeight = "", this.mediaAspect = "", this.mediaPlaceholder = !1, this.cardHref = "", this.href = "", this.title = "", this.subtitle = "", this.supportingText = "", this.commentsText = "", this.commentsDisabled = !1, this.commentsHref = "", this.likesText = "", this.likesDisabled = !1, this.likesHoverContent = "", this.hasLiked = !1, this.likesInteractive = !0, this.author = !1, this.authorText = "", this.authorHref = "", this.replyEnabled = !1, this.editEnabled = !1, this.deleteEnabled = !1, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.innerPadding = void 0, this.paddingTop = void 0, this.paddingBottom = void 0, this.paddingLeft = void 0, this.paddingRight = void 0, this.__onImgLoad = (t) => {
35
+ ]), this.__isSyncingManagedSocialAttributes = !1, this.type = "standard", this.variant = "standard", this.direction = "dynamic", this.size = "large", this.mediaType = "", this.mediaHref = "", this.mediaAlt = "", this.mediaSrcset = "", this.mediaSizes = "", this.mediaLoading = "auto", this.mediaDecoding = "async", this.mediaFetchPriority = "auto", this.mediaFit = "cover", this.mediaPosition = "center", this.mediaWidth = "", this.mediaHeight = "", this.mediaAspect = "", this.mediaPlaceholder = !1, this.cardHref = "", this.href = "", this.title = "", this.subtitle = "", this.supportingText = "", this.commentsText = "", this.commentsDisabled = !1, this.commentsHref = "", this.likesText = "", this.likesDisabled = !1, this.likesHoverContent = "", this.hasLiked = !1, this.likesInteractive = !0, this.author = !1, this.authorText = "", this.authorHref = "", this.replyEnabled = !1, this.editEnabled = !1, this.deleteEnabled = !1, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.innerPadding = void 0, this.paddingTop = void 0, this.paddingBottom = void 0, this.paddingLeft = void 0, this.paddingRight = void 0, this.__onImgLoad = (t) => {
36
36
  const e = t.currentTarget.closest(".media");
37
37
  e && e.classList.add("is-loaded");
38
38
  }, this.__onKeyDown = (t) => {
@@ -58,8 +58,8 @@ let i = class extends C {
58
58
  if (!e) return { w: 640, h: 360 };
59
59
  const n = e.includes("/") ? e.split("/") : e.includes(":") ? e.split(":") : e.includes("x") ? e.split("x") : null;
60
60
  if (n && n.length === 2) {
61
- const o = Number(n[0]), d = Number(n[1]);
62
- if (o > 0 && d > 0) return { w: o, h: d };
61
+ const o = Number(n[0]), p = Number(n[1]);
62
+ if (o > 0 && p > 0) return { w: o, h: p };
63
63
  }
64
64
  const c = Number(e);
65
65
  return isFinite(c) && c > 0 ? { w: 1e3, h: Math.round(1e3 / c) } : { w: 640, h: 360 };
@@ -117,9 +117,9 @@ let i = class extends C {
117
117
  const h = this.__calcAspectWH(c || "16/9");
118
118
  e || (e = h.w), n || (n = h.h);
119
119
  }
120
- const o = `aspect-ratio:${c || `${e}/${n}`};`, d = this.mediaPlaceholder ? "has-ph" : "";
120
+ const o = `aspect-ratio:${c || `${e}/${n}`};`, p = this.mediaPlaceholder ? "has-ph" : "";
121
121
  return r`
122
- <div class="media ${d}" style="${o}">
122
+ <div class="media ${p}" style="${o}">
123
123
  <slot name="media-sources"></slot>
124
124
  <img
125
125
  src="${this.mediaHref || ""}"
@@ -172,44 +172,44 @@ let i = class extends C {
172
172
  this.type === "social" && (this.__syncStringAttribute("social-comments-text", this.commentsText), this.__syncNumberAttribute("social-comments", this.comments), this.__syncStringAttribute("social-comments-href", this.commentsHref), this.__syncStringAttribute("social-likes-text", this.likesText), this.__syncNumberAttribute("social-likes", this.likes), this.__syncStringAttribute("social-likes-hover-content", this.likesHoverContent), this.__syncBooleanAttribute("social-has-liked", this.hasLiked), this.__syncBooleanAttribute("social-likes-interactive", this.likesInteractive), this.__syncBooleanAttribute("social-author", this.author), this.__syncStringAttribute("social-author-text", this.authorText), this.__syncStringAttribute("social-author-href", this.authorHref));
173
173
  }
174
174
  render() {
175
- const t = this.variant ? `${this.variant.toLowerCase()}` : "", e = this.type === "list" || this.type === "container" ? "vertical" : this.direction ? this.direction.toLowerCase() : "vertical", n = this.__effectiveHref(), c = (this.type === "standard" || this.type === "social") && !!n, o = c ? "clickable" : "", d = this.date instanceof Date ? this.date.toISOString().slice(0, 10) : this.date || "", h = (g = !1) => g ? r`<a class="title" href="${n}" tabindex="-1"
175
+ const t = this.variant ? `${this.variant.toLowerCase()}` : "", e = (this.direction || "dynamic").toLowerCase(), c = this.type !== "list" && this.type !== "container" && e !== "vertical" && e !== "horizontal" ? "dynamic-direction" : "", o = this.type === "list" || this.type === "container" ? "vertical" : e === "horizontal" ? "horizontal" : "vertical", p = this.__effectiveHref(), h = (this.type === "standard" || this.type === "social") && !!p, A = h ? "clickable" : "", b = this.date instanceof Date ? this.date.toISOString().slice(0, 10) : this.date || "", z = (v = !1) => v ? r`<a class="title" href="${p}" tabindex="-1"
176
176
  >${this.title}</a
177
- ><md-icon>arrow_forward</md-icon>` : r`<span class="title">${this.title}</span>`, T = () => this.__mediaTemplate(), b = (g) => r`
177
+ ><md-icon>arrow_forward</md-icon>` : r`<span class="title">${this.title}</span>`, L = () => this.__mediaTemplate(), m = (v) => r`
178
178
  <div
179
- class="scb-card ${t} ${e} ${o}"
180
- @click=${c ? this.__handleHrefNavigation : null}
181
- @keydown=${c ? this.__onKeyDown : null}
182
- style="cursor:${c ? "pointer" : "default"};"
183
- role=${c ? "link" : m}
184
- tabindex=${c ? "0" : m}
179
+ class="scb-card ${t} ${o} ${c} ${A}"
180
+ @click=${h ? this.__handleHrefNavigation : null}
181
+ @keydown=${h ? this.__onKeyDown : null}
182
+ style="cursor:${h ? "pointer" : "default"};"
183
+ role=${h ? "link" : g}
184
+ tabindex=${h ? "0" : g}
185
185
  aria-label=${this.title || this.subtitle || "Kort"}
186
186
  >
187
- ${c ? r`<md-ripple></md-ripple>` : ""}
188
- ${T()}
189
- ${g}
187
+ ${h ? r`<md-ripple></md-ripple>` : ""}
188
+ ${L()}
189
+ ${v}
190
190
  </div>
191
191
  <md-focus-ring></md-focus-ring>
192
192
  `;
193
193
  switch (this.type) {
194
194
  case "standard":
195
- return b(r`
195
+ return m(r`
196
196
  <div class="full-content">
197
197
  <div class="top-content">
198
- ${this.title ? r`<div class="header">${h(!!n)}</div>` : ""}
198
+ ${this.title ? r`<div class="header">${z(!!p)}</div>` : ""}
199
199
  ${this.subtitle ? r`<div class="sub-label">${this.subtitle}</div>` : ""}
200
200
  ${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : ""}
201
- ${d ? r`<div class="date">${d}</div>` : ""}
201
+ ${b ? r`<div class="date">${b}</div>` : ""}
202
202
  </div>
203
203
  </div>
204
204
  `);
205
205
  case "list":
206
- return b(r`
206
+ return m(r`
207
207
  <div class="full-content">
208
208
  <div class="top-content">
209
209
  ${this.title ? r`<div class="header"><span class="title">${this.title}</span></div>` : ""}
210
210
  ${this.subtitle ? r`<div class="sub-label">${this.subtitle}</div>` : ""}
211
211
  ${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : ""}
212
- ${d ? r`<div class="date">${d}</div>` : ""}
212
+ ${b ? r`<div class="date">${b}</div>` : ""}
213
213
  </div>
214
214
  <div class="content list">
215
215
  <slot></slot>
@@ -217,19 +217,19 @@ let i = class extends C {
217
217
  </div>
218
218
  `);
219
219
  case "social":
220
- const g = this.commentsHref, _ = (p) => {
221
- p.stopPropagation();
222
- }, v = (p) => {
223
- var S;
224
- const u = (S = this.renderRoot) == null ? void 0 : S.querySelector(".scb-card");
225
- u && (p ? u.classList.add("no-hover") : u.classList.remove("no-hover"));
226
- }, P = this.commentsText ? `${this.commentsText}: ` : "", A = this.likesText ? `${this.likesText}: ` : "", x = (p) => (u) => {
227
- u.stopPropagation(), this.__dispatchSocialActionEvent(p, u);
228
- }, $ = this.likesDisabled ? m : r`
220
+ const v = this.commentsHref, S = (d) => {
221
+ d.stopPropagation();
222
+ }, u = (d) => {
223
+ var T;
224
+ const y = (T = this.renderRoot) == null ? void 0 : T.querySelector(".scb-card");
225
+ y && (d ? y.classList.add("no-hover") : y.classList.remove("no-hover"));
226
+ }, C = this.commentsText ? `${this.commentsText}: ` : "", F = this.likesText ? `${this.likesText}: ` : "", k = (d) => (y) => {
227
+ y.stopPropagation(), this.__dispatchSocialActionEvent(d, y);
228
+ }, w = this.likesDisabled ? g : r`
229
229
  <span
230
230
  class="likes"
231
- @mouseenter=${() => v(!0)}
232
- @mouseleave=${() => v(!1)}
231
+ @mouseenter=${() => u(!0)}
232
+ @mouseleave=${() => u(!1)}
233
233
  >
234
234
  ${this.likesInteractive ? r`
235
235
  <scb-icon-button
@@ -238,36 +238,36 @@ let i = class extends C {
238
238
  icon="thumb_up"
239
239
  ?icon-filled=${this.hasLiked}
240
240
  aria-label="${this.likesText || "Gilla"}"
241
- @click=${(p) => {
242
- p.stopPropagation(), this.hasLiked = !this.hasLiked, this.__dispatchLikeEvent("like-click", {
241
+ @click=${(d) => {
242
+ d.stopPropagation(), this.hasLiked = !this.hasLiked, this.__dispatchLikeEvent("like-click", {
243
243
  hasLiked: this.hasLiked,
244
244
  likes: this.likes ?? 0
245
245
  });
246
246
  }}
247
- @keydown=${(p) => {
248
- (p.key === "Enter" || p.key === " ") && (p.preventDefault(), p.stopPropagation(), this.hasLiked = !this.hasLiked, this.__dispatchLikeEvent("like-click", {
247
+ @keydown=${(d) => {
248
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), d.stopPropagation(), this.hasLiked = !this.hasLiked, this.__dispatchLikeEvent("like-click", {
249
249
  hasLiked: this.hasLiked,
250
250
  likes: this.likes ?? 0
251
251
  }));
252
252
  }}
253
- @hover=${(p) => {
254
- p.preventDefault(), p.stopPropagation(), this.__dispatchLikeEvent("like-hover", {
253
+ @hover=${(d) => {
254
+ d.preventDefault(), d.stopPropagation(), this.__dispatchLikeEvent("like-hover", {
255
255
  hasLiked: this.hasLiked,
256
256
  likes: this.likes ?? 0
257
257
  });
258
258
  }}
259
259
  ></scb-icon-button>
260
260
  ` : r`<md-icon>thumb_up</md-icon>`}
261
- <span class="social-text">${A}${this.likes ?? 0}</span>
261
+ <span class="social-text">${F}${this.likes ?? 0}</span>
262
262
  </span>
263
263
  `;
264
- return b(r`
264
+ return m(r`
265
265
  <div class="full-content">
266
266
  <div class="top-content">
267
- ${this.title ? r`<div class="header">${h(!!n)}</div>` : ""}
267
+ ${this.title ? r`<div class="header">${z(!!p)}</div>` : ""}
268
268
  ${this.subtitle ? r`<div class="sub-label">${this.subtitle}</div>` : ""}
269
269
  ${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : ""}
270
- ${d ? r`<div class="date">${d}</div>` : ""}
270
+ ${b ? r`<div class="date">${b}</div>` : ""}
271
271
  </div>
272
272
  <div class="content">
273
273
  <div class="social-metrics">
@@ -276,23 +276,23 @@ let i = class extends C {
276
276
  class="author social-text"
277
277
  href="${this.authorHref || "#"}"
278
278
  tabindex="0"
279
- @click=${_}
280
- @mouseenter=${() => v(!0)}
281
- @mouseleave=${() => v(!1)}
279
+ @click=${S}
280
+ @mouseenter=${() => u(!0)}
281
+ @mouseleave=${() => u(!1)}
282
282
  >${this.authorText}</a
283
283
  >
284
284
  ` : ""}
285
- ${this.commentsDisabled ? m : r`
285
+ ${this.commentsDisabled ? g : r`
286
286
  <span
287
287
  class="comments"
288
- @mouseenter=${() => v(!0)}
289
- @mouseleave=${() => v(!1)}
288
+ @mouseenter=${() => u(!0)}
289
+ @mouseleave=${() => u(!1)}
290
290
  >
291
- ${g !== "" ? r`
291
+ ${v !== "" ? r`
292
292
  <scb-icon-button
293
- href="${g}"
293
+ href="${v}"
294
294
  tabindex="0"
295
- @click=${_}
295
+ @click=${S}
296
296
  variant="standard"
297
297
  icon="comment"
298
298
  aria-label="Gå till kommentarer"
@@ -300,7 +300,7 @@ let i = class extends C {
300
300
  ` : r`
301
301
  <md-icon>comment</md-icon>
302
302
  `}
303
- <span class="social-text">${P}${this.comments ?? 0}</span>
303
+ <span class="social-text">${C}${this.comments ?? 0}</span>
304
304
  </span>
305
305
  `}
306
306
  ${this.likesHoverContent ? r`
@@ -311,54 +311,54 @@ let i = class extends C {
311
311
  trigger="hover"
312
312
  position="right"
313
313
  >
314
- ${$}
314
+ ${w}
315
315
  </scb-tooltip>
316
- ` : $}
316
+ ` : w}
317
317
  ${this.replyEnabled ? r`
318
318
  <span class="social-action">
319
319
  <scb-icon-button
320
320
  variant="standard"
321
321
  icon="reply"
322
322
  aria-label="Svara"
323
- @click=${x("reply")}
323
+ @click=${k("reply")}
324
324
  ></scb-icon-button>
325
325
  <span class="social-text">Svara</span>
326
326
  </span>
327
- ` : m}
327
+ ` : g}
328
328
  ${this.editEnabled ? r`
329
329
  <span class="social-action">
330
330
  <scb-icon-button
331
331
  variant="standard"
332
332
  icon="edit"
333
333
  aria-label="Redigera"
334
- @click=${x("edit")}
334
+ @click=${k("edit")}
335
335
  ></scb-icon-button>
336
336
  <span class="social-text">Redigera</span>
337
337
  </span>
338
- ` : m}
338
+ ` : g}
339
339
  ${this.deleteEnabled ? r`
340
340
  <span class="social-action">
341
341
  <scb-icon-button
342
342
  variant="standard"
343
343
  icon="delete"
344
344
  aria-label="Ta bort"
345
- @click=${x("delete")}
345
+ @click=${k("delete")}
346
346
  ></scb-icon-button>
347
347
  <span class="social-text">Ta bort</span>
348
348
  </span>
349
- ` : m}
349
+ ` : g}
350
350
  </div>
351
351
  </div>
352
352
  </div>
353
353
  `);
354
354
  case "link":
355
- return b(r`
355
+ return m(r`
356
356
  <div class="full-content">
357
357
  <div class="top-content">
358
358
  ${this.title ? r`<div class="header"><span class="title">${this.title}</span></div>` : ""}
359
359
  ${this.subtitle ? r`<div class="sub-label">${this.subtitle}</div>` : ""}
360
360
  ${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : ""}
361
- ${d ? r`<div class="date">${d}</div>` : ""}
361
+ ${b ? r`<div class="date">${b}</div>` : ""}
362
362
  </div>
363
363
  <div class="content links">
364
364
  <slot></slot>
@@ -366,13 +366,13 @@ let i = class extends C {
366
366
  </div>
367
367
  `);
368
368
  case "action":
369
- return b(r`
369
+ return m(r`
370
370
  <div class="full-content">
371
371
  <div class="top-content">
372
372
  ${this.title ? r`<div class="header"><span class="title">${this.title}</span></div>` : ""}
373
373
  ${this.subtitle ? r`<div class="sub-label">${this.subtitle}</div>` : ""}
374
374
  ${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : ""}
375
- ${d ? r`<div class="date">${d}</div>` : ""}
375
+ ${b ? r`<div class="date">${b}</div>` : ""}
376
376
  </div>
377
377
  <div class="content actions">
378
378
  <slot></slot>
@@ -380,7 +380,7 @@ let i = class extends C {
380
380
  </div>
381
381
  `);
382
382
  case "container":
383
- return b(r`
383
+ return m(r`
384
384
  <div class="container-content ${this.title || this.subtitle ? "has-header" : ""}">
385
385
  ${this.title || this.subtitle ? r`
386
386
  <div class="top-content">
@@ -392,39 +392,40 @@ let i = class extends C {
392
392
  </div>
393
393
  `);
394
394
  default:
395
- return b(r`
395
+ return m(r`
396
396
  <div class="full-content">
397
397
  <div class="top-content">
398
- ${this.title ? r`<div class="header">${h(!!n)}</div>` : ""}
398
+ ${this.title ? r`<div class="header">${z(!!p)}</div>` : ""}
399
399
  ${this.subtitle ? r`<div class="sub-label">${this.subtitle}</div>` : ""}
400
400
  ${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : ""}
401
- ${d ? r`<div class="date">${d}</div>` : ""}
401
+ ${b ? r`<div class="date">${b}</div>` : ""}
402
402
  </div>
403
403
  </div>
404
404
  `);
405
405
  }
406
406
  }
407
407
  updated(t) {
408
- super.updated(t), t.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), t.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), t.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), t.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), t.has("type") && (this.type === "list" ? this.setAttribute("data-density", "-2") : this.removeAttribute("data-density")), this.mediaFit && this.mediaFit !== "cover" ? this.style.setProperty("--scb-card-media-fit", this.mediaFit) : this.style.removeProperty("--scb-card-media-fit"), this.mediaPosition && this.mediaPosition !== "center" ? this.style.setProperty("--scb-card-media-position", this.mediaPosition) : this.style.removeProperty("--scb-card-media-position"), this.__syncSocialAttributes(), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom") || t.has("spacingLeft") || t.has("spacingRight")) && f(this, y, z).call(this), (t.has("innerPadding") || t.has("paddingTop") || t.has("paddingBottom") || t.has("paddingLeft") || t.has("paddingRight")) && f(this, y, k).call(this);
408
+ super.updated(t), t.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), t.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), t.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), t.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), t.has("type") && (this.type === "list" ? this.setAttribute("data-density", "-2") : this.removeAttribute("data-density")), this.mediaFit && this.mediaFit !== "cover" ? this.style.setProperty("--scb-card-media-fit", this.mediaFit) : this.style.removeProperty("--scb-card-media-fit"), this.mediaPosition && this.mediaPosition !== "center" ? this.style.setProperty("--scb-card-media-position", this.mediaPosition) : this.style.removeProperty("--scb-card-media-position"), this.__syncSocialAttributes(), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom") || t.has("spacingLeft") || t.has("spacingRight")) && x(this, f, _).call(this), (t.has("innerPadding") || t.has("paddingTop") || t.has("paddingBottom") || t.has("paddingLeft") || t.has("paddingRight")) && x(this, f, $).call(this);
409
409
  }
410
410
  async firstUpdated(t) {
411
- i.__iconLoaded || (await import("@material/web/icon/icon.js"), i.__iconLoaded = !0), i.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), i.__rippleLoaded = !0), f(this, y, z).call(this), f(this, y, k).call(this), this.__syncSocialAttributes();
411
+ i.__iconLoaded || (await import("@material/web/icon/icon.js"), i.__iconLoaded = !0), i.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), i.__rippleLoaded = !0), x(this, f, _).call(this), x(this, f, $).call(this), this.__syncSocialAttributes();
412
412
  }
413
413
  };
414
- y = /* @__PURE__ */ new WeakSet();
415
- z = function() {
414
+ f = /* @__PURE__ */ new WeakSet();
415
+ _ = function() {
416
416
  const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, n = this.mapSpacingToken(this.spacingBottom) ?? t, c = this.mapSpacingToken(this.spacingLeft), o = this.mapSpacingToken(this.spacingRight);
417
417
  e ? this.style.setProperty("--scb-card-spacing-block-start", e) : this.style.removeProperty("--scb-card-spacing-block-start"), n ? this.style.setProperty("--scb-card-spacing-block-end", n) : this.style.removeProperty("--scb-card-spacing-block-end"), c ? this.style.setProperty("--scb-card-spacing-inline-start", c) : this.style.removeProperty("--scb-card-spacing-inline-start"), o ? this.style.setProperty("--scb-card-spacing-inline-end", o) : this.style.removeProperty("--scb-card-spacing-inline-end");
418
418
  };
419
- k = function() {
419
+ $ = function() {
420
420
  const t = this.mapSpacingToken(this.innerPadding), e = this.mapSpacingToken(this.paddingTop) ?? t, n = this.mapSpacingToken(this.paddingBottom) ?? t, c = this.mapSpacingToken(this.paddingLeft) ?? t, o = this.mapSpacingToken(this.paddingRight) ?? t;
421
421
  e ? this.style.setProperty("--scb-card-content-padding-block-start", e) : this.style.removeProperty("--scb-card-content-padding-block-start"), n ? this.style.setProperty("--scb-card-content-padding-block-end", n) : this.style.removeProperty("--scb-card-content-padding-block-end"), c ? this.style.setProperty("--scb-card-content-padding-inline-start", c) : this.style.removeProperty("--scb-card-content-padding-inline-start"), o ? this.style.setProperty("--scb-card-content-padding-inline-end", o) : this.style.removeProperty("--scb-card-content-padding-inline-end");
422
422
  };
423
423
  i.__iconLoaded = !1;
424
424
  i.__rippleLoaded = !1;
425
- i.styles = L`
425
+ i.styles = H`
426
426
  :host {
427
427
  display: block;
428
+ container-type: inline-size;
428
429
  box-sizing: border-box;
429
430
  position: relative;
430
431
  inline-size: 100%;
@@ -654,6 +655,9 @@ i.styles = L`
654
655
  .scb-card.vertical {
655
656
  flex-direction: column;
656
657
  }
658
+ .scb-card.dynamic-direction {
659
+ flex-direction: column;
660
+ }
657
661
  .scb-card.clickable {
658
662
  cursor: pointer;
659
663
  }
@@ -810,6 +814,10 @@ i.styles = L`
810
814
  }
811
815
  .scb-card.horizontal .media {
812
816
  align-self: flex-start;
817
+ flex: 0 1 min(100%, var(--scb-card-size-horizontal-media-max, var(--scb-card-horizontal-media-max, 176px)));
818
+ min-inline-size: min(var(--scb-card-size-horizontal-media-min, var(--scb-card-horizontal-media-min, 96px)), 100%);
819
+ max-inline-size: min(100%, var(--scb-card-size-horizontal-media-max, var(--scb-card-horizontal-media-max, 176px)));
820
+ inline-size: min(100%, var(--scb-card-size-horizontal-media-max, var(--scb-card-horizontal-media-max, 176px)));
813
821
  }
814
822
  .scb-card.horizontal .media ::slotted(scb-avatar) {
815
823
  margin: 0;
@@ -832,13 +840,55 @@ i.styles = L`
832
840
  margin: 0;
833
841
  object-fit: var(--scb-card-media-fit, cover);
834
842
  aspect-ratio: var(--scb-card-horizontal-media-aspect, 16 / 9);
835
- flex: 0 1 var(--scb-card-size-horizontal-media-max, var(--scb-card-horizontal-media-max, 176px));
836
- min-inline-size: var(--scb-card-size-horizontal-media-min, var(--scb-card-horizontal-media-min, 96px));
837
- max-inline-size: var(--scb-card-size-horizontal-media-max, var(--scb-card-horizontal-media-max, 176px));
838
- inline-size: auto;
843
+ inline-size: 100%;
839
844
  block-size: auto;
840
845
  }
841
846
 
847
+ @container (min-width: 500px) {
848
+ .scb-card.dynamic-direction {
849
+ flex-direction: row;
850
+ align-items: flex-start;
851
+ column-gap: var(--scb-card-size-horizontal-gap);
852
+ padding: var(--scb-card-size-horizontal-padding);
853
+ }
854
+ .scb-card.dynamic-direction .media {
855
+ align-self: flex-start;
856
+ flex: 0 1 min(100%, var(--scb-card-size-horizontal-media-max, var(--scb-card-horizontal-media-max, 176px)));
857
+ min-inline-size: min(var(--scb-card-size-horizontal-media-min, var(--scb-card-horizontal-media-min, 96px)), 100%);
858
+ max-inline-size: min(100%, var(--scb-card-size-horizontal-media-max, var(--scb-card-horizontal-media-max, 176px)));
859
+ inline-size: min(100%, var(--scb-card-size-horizontal-media-max, var(--scb-card-horizontal-media-max, 176px)));
860
+ }
861
+ .scb-card.dynamic-direction .media ::slotted(scb-avatar) {
862
+ margin: 0;
863
+ }
864
+ .scb-card.dynamic-direction .full-content {
865
+ align-self: flex-start;
866
+ padding: 0;
867
+ inline-size: auto;
868
+ min-inline-size: 0;
869
+ flex: 1 1 auto;
870
+ }
871
+ .scb-card.dynamic-direction .header {
872
+ align-items: flex-start;
873
+ }
874
+ .scb-card.dynamic-direction .header md-icon {
875
+ align-self: flex-start;
876
+ }
877
+
878
+ .scb-card.dynamic-direction .media img {
879
+ margin: 0;
880
+ object-fit: var(--scb-card-media-fit, cover);
881
+ aspect-ratio: var(--scb-card-horizontal-media-aspect, 16 / 9);
882
+ inline-size: 100%;
883
+ block-size: auto;
884
+ }
885
+
886
+ :host([sizing='content-width']) .scb-card.dynamic-direction:has(.media img) .full-content {
887
+ inline-size: max-content;
888
+ flex: 0 1 auto;
889
+ }
890
+ }
891
+
842
892
  :host([sizing='content-width']) .scb-card.horizontal:has(.media img) .full-content {
843
893
  inline-size: max-content;
844
894
  flex: 0 1 auto;
@@ -867,13 +917,6 @@ i.styles = L`
867
917
  gap: var(--spacing-2, 4px);
868
918
  }
869
919
 
870
- /* .social-actions {
871
- display: flex;
872
- align-items: center;
873
- gap: var(--spacing-3, 8px);
874
- flex-wrap: wrap;
875
- } */
876
-
877
920
  .social-action {
878
921
  display: inline-flex;
879
922
  align-items: center;
@@ -1096,7 +1139,7 @@ s([
1096
1139
  a({ type: String, attribute: "padding-right", reflect: !0, converter: l })
1097
1140
  ], i.prototype, "paddingRight", 2);
1098
1141
  i = s([
1099
- F("scb-card")
1142
+ D("scb-card")
1100
1143
  ], i);
1101
1144
  export {
1102
1145
  i as ScbCard