scb-wc-test 0.1.105 → 0.1.106

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.
Files changed (85) hide show
  1. package/mvc/components/scb-accordion/scb-accordion.js +8 -2
  2. package/mvc/components/scb-avatar/scb-avatar.js +19 -10
  3. package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -3
  4. package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +13 -7
  5. package/mvc/components/scb-button/scb-button.js +34 -32
  6. package/mvc/components/scb-calendar-card/scb-calendar-card.js +13 -11
  7. package/mvc/components/scb-card/scb-card.js +44 -41
  8. package/mvc/components/scb-checkbox/scb-checkbox-group.js +15 -13
  9. package/mvc/components/scb-checkbox/scb-checkbox.js +6 -6
  10. package/mvc/components/scb-chip/scb-chip.js +27 -7
  11. package/mvc/components/scb-divider/scb-divider.js +41 -15
  12. package/mvc/components/scb-fact-card/scb-fact-card.js +37 -18
  13. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +71 -43
  14. package/mvc/components/scb-icon-button/scb-icon-button.js +15 -10
  15. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -4
  16. package/mvc/components/scb-list/scb-list.js +3 -3
  17. package/mvc/components/scb-notification-card/scb-notification-card.js +5 -5
  18. package/mvc/components/scb-pagination/scb-pagination.js +165 -107
  19. package/mvc/components/scb-radio-button/scb-radio-group.js +22 -11
  20. package/mvc/components/scb-search/scb-search.js +84 -32
  21. package/mvc/components/scb-segmented-button/scb-segmented-button.js +3 -2
  22. package/mvc/components/scb-status-pill/scb-status-pill.js +17 -13
  23. package/mvc/components/scb-stepper/scb-stepper.js +32 -29
  24. package/mvc/components/scb-switch/scb-switch.js +11 -8
  25. package/mvc/components/scb-tabs/scb-tabs.js +22 -19
  26. package/mvc/components/scb-textfield/scb-textfield.js +14 -10
  27. package/mvc/components/scb-toc/scb-toc.js +6 -3
  28. package/mvc/components/scb-viz/scb-viz.js +188 -178
  29. package/package.json +2 -2
  30. package/scb-accordion/scb-accordion.d.ts +13 -0
  31. package/scb-accordion/scb-accordion.js +53 -21
  32. package/scb-avatar/scb-avatar.d.ts +6 -0
  33. package/scb-avatar/scb-avatar.js +96 -61
  34. package/scb-breadcrumb/scb-breadcrumb-item.js +8 -9
  35. package/scb-breadcrumb/scb-breadcrumb.d.ts +6 -0
  36. package/scb-breadcrumb/scb-breadcrumb.js +61 -30
  37. package/scb-button/scb-button.d.ts +10 -0
  38. package/scb-button/scb-button.js +89 -65
  39. package/scb-calendar-card/scb-calendar-card.d.ts +5 -0
  40. package/scb-calendar-card/scb-calendar-card.js +79 -55
  41. package/scb-card/scb-card.d.ts +5 -0
  42. package/scb-card/scb-card.js +165 -140
  43. package/scb-checkbox/scb-checkbox-group.d.ts +3 -1
  44. package/scb-checkbox/scb-checkbox-group.js +59 -40
  45. package/scb-checkbox/scb-checkbox.d.ts +11 -0
  46. package/scb-checkbox/scb-checkbox.js +78 -56
  47. package/scb-chip/scb-chip.d.ts +24 -0
  48. package/scb-chip/scb-chip.js +137 -65
  49. package/scb-divider/scb-divider.d.ts +14 -0
  50. package/scb-divider/scb-divider.js +91 -43
  51. package/scb-fact-card/scb-fact-card.d.ts +10 -0
  52. package/scb-fact-card/scb-fact-card.js +135 -94
  53. package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +10 -0
  54. package/scb-horizontal-scroller/scb-horizontal-scroller.js +179 -120
  55. package/scb-icon-button/scb-icon-button.d.ts +6 -1
  56. package/scb-icon-button/scb-icon-button.js +81 -59
  57. package/scb-keyfigure-card/scb-keyfigure-card.d.ts +10 -0
  58. package/scb-keyfigure-card/scb-keyfigure-card.js +76 -52
  59. package/scb-list/scb-list.d.ts +7 -1
  60. package/scb-list/scb-list.js +62 -40
  61. package/scb-notification-card/scb-notification-card.d.ts +5 -0
  62. package/scb-notification-card/scb-notification-card.js +56 -39
  63. package/scb-pagination/scb-pagination.d.ts +12 -1
  64. package/scb-pagination/scb-pagination.js +235 -147
  65. package/scb-radio-button/scb-radio-group.d.ts +14 -3
  66. package/scb-radio-button/scb-radio-group.js +120 -67
  67. package/scb-search/scb-search.d.ts +15 -2
  68. package/scb-search/scb-search.js +152 -69
  69. package/scb-segmented-button/scb-segmented-button.d.ts +41 -4
  70. package/scb-segmented-button/scb-segmented-button.js +145 -61
  71. package/scb-status-pill/scb-status-pill.d.ts +12 -1
  72. package/scb-status-pill/scb-status-pill.js +51 -27
  73. package/scb-stepper/scb-stepper.d.ts +11 -3
  74. package/scb-stepper/scb-stepper.js +134 -101
  75. package/scb-switch/scb-switch.d.ts +21 -2
  76. package/scb-switch/scb-switch.js +97 -45
  77. package/scb-tabs/scb-tabs.d.ts +8 -0
  78. package/scb-tabs/scb-tabs.js +74 -44
  79. package/scb-textfield/scb-textfield.d.ts +7 -0
  80. package/scb-textfield/scb-textfield.js +43 -16
  81. package/scb-toc/scb-toc.d.ts +10 -1
  82. package/scb-toc/scb-toc.js +49 -18
  83. package/scb-viz/scb-viz.d.ts +10 -3
  84. package/scb-viz/scb-viz.js +278 -236
  85. package/scb-wc-test.bundle.js +1171 -890
@@ -1,79 +1,127 @@
1
- import { css as v, LitElement as d, html as p } from "lit";
2
- import { property as i, customElement as b } from "lit/decorators.js";
3
- var h = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (l, o, s, n) => {
4
- for (var t = n > 1 ? void 0 : n ? g(o, s) : o, c = l.length - 1, a; c >= 0; c--)
5
- (a = l[c]) && (t = (n ? a(o, s, t) : a(t)) || t);
6
- return n && t && h(o, s, t), t;
7
- };
8
- let r = class extends d {
1
+ import { css as g, LitElement as b, html as y } from "lit";
2
+ import { property as s, customElement as u } from "lit/decorators.js";
3
+ var f = Object.defineProperty, m = Object.getOwnPropertyDescriptor, h = (r) => {
4
+ throw TypeError(r);
5
+ }, a = (r, e, t, o) => {
6
+ for (var n = o > 1 ? void 0 : o ? m(e, t) : e, l = r.length - 1, d; l >= 0; l--)
7
+ (d = r[l]) && (n = (o ? d(e, t, n) : d(n)) || n);
8
+ return o && n && f(e, t, n), n;
9
+ }, k = (r, e, t) => e.has(r) || h("Cannot " + t), _ = (r, e, t) => e.has(r) ? h("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), p = (r, e, t) => (k(r, e, "access private method"), t), c, v;
10
+ let i = class extends b {
9
11
  constructor() {
10
- super(...arguments), this.variant = "thin", this.direction = "horizontal", this.inset = "none", this.overlay = !1, this.anchor = "end";
12
+ super(...arguments), _(this, c), this.variant = "thin", this.direction = "horizontal", this.inset = "none", this.overlay = !1, this.anchor = "end", this.spacing = "";
13
+ }
14
+ firstUpdated() {
15
+ p(this, c, v).call(this);
16
+ }
17
+ updated(r) {
18
+ r.has("spacing") && p(this, c, v).call(this);
19
+ }
20
+ mapSpacingToken(r) {
21
+ if (!r) return;
22
+ const e = String(r).trim();
23
+ if (e)
24
+ return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
11
25
  }
12
26
  render() {
13
- return p``;
27
+ return y``;
14
28
  }
15
29
  };
16
- r.styles = v`
30
+ c = /* @__PURE__ */ new WeakSet();
31
+ v = function() {
32
+ const r = this.mapSpacingToken(this.spacing);
33
+ r ? this.style.setProperty("--scb-divider-spacing-orth", r) : this.style.removeProperty("--scb-divider-spacing-orth");
34
+ };
35
+ i.styles = g`
17
36
  :host {
18
37
  --scb-divider-color: var(--md-sys-color-outline-variant);
19
38
  --scb-divider-thickness: 1px;
20
39
  --scb-divider-gap: var(--scb-grid-column-gap, var(--spacing-6, 24px));
40
+ --scb-divider-spacing-orth: 0;
41
+
21
42
  display: block;
22
43
  box-sizing: border-box;
23
- pointer-events: none;
44
+ pointer-events: none;
24
45
  }
25
- :host([variant="bold"]) {
46
+
47
+ :host([variant='bold']) {
26
48
  --scb-divider-color: var(--md-sys-color-outline);
27
49
  }
28
50
 
29
- :host(:not([direction="vertical"])) {
51
+ /* Horisontell avdelare: drar ut sig på inline-led, spacing på block-led (ovan/under). */
52
+ :host(:not([direction='vertical'])) {
30
53
  inline-size: 100%;
31
54
  block-size: var(--scb-divider-thickness);
32
55
  background: var(--scb-divider-color);
56
+ margin-block: var(--scb-divider-spacing-orth, 0);
33
57
  }
34
- :host([inset="both"]:not([direction="vertical"])) { margin-inline: var(--spacing-8, 32px); }
35
- :host([inset="start"]:not([direction="vertical"])) { margin-inline-start: var(--spacing-8, 32px); }
36
- :host([inset="end"]:not([direction="vertical"])) { margin-inline-end: var(--spacing-8, 32px); }
37
58
 
38
- :host([direction="vertical"]) {
59
+ :host([inset='both']:not([direction='vertical'])) {
60
+ margin-inline: var(--spacing-8, 32px);
61
+ }
62
+ :host([inset='start']:not([direction='vertical'])) {
63
+ margin-inline-start: var(--spacing-8, 32px);
64
+ }
65
+ :host([inset='end']:not([direction='vertical'])) {
66
+ margin-inline-end: var(--spacing-8, 32px);
67
+ }
68
+
69
+ /* Vertikal avdelare: drar ut sig på block-led, spacing på inline-led (vänster/höger). */
70
+ :host([direction='vertical']:not([overlay])) {
39
71
  inline-size: var(--scb-divider-thickness);
40
72
  block-size: 100%;
41
73
  background: var(--scb-divider-color);
42
74
  align-self: stretch;
43
75
  justify-self: center;
76
+ margin-inline: var(--scb-divider-spacing-orth, 0);
77
+ }
78
+
79
+ :host([direction='vertical'][inset='both']:not([overlay])) {
80
+ margin-block: var(--spacing-8, 32px);
81
+ }
82
+ :host([direction='vertical'][inset='start']:not([overlay])) {
83
+ margin-block-start: var(--spacing-8, 32px);
84
+ }
85
+ :host([direction='vertical'][inset='end']:not([overlay])) {
86
+ margin-block-end: var(--spacing-8, 32px);
44
87
  }
45
- :host([direction="vertical"][inset="both"]:not([overlay])) { margin-block: var(--spacing-8, 32px); }
46
- :host([direction="vertical"][inset="start"]:not([overlay])) { margin-block-start: var(--spacing-8, 32px); }
47
- :host([direction="vertical"][inset="end"]:not([overlay])) { margin-block-end: var(--spacing-8, 32px); }
48
88
 
49
- :host([overlay][direction="vertical"]) {
89
+ /* Overlay-variant för vertikal avdelare, spacing ignoreras (absolut positionerad). */
90
+ :host([overlay][direction='vertical']) {
50
91
  position: absolute;
51
92
  top: 0;
52
93
  bottom: 0;
53
94
  inline-size: var(--scb-divider-thickness);
54
95
  background: var(--scb-divider-color);
55
96
  }
56
- :host([overlay][direction="vertical"][anchor="end"]) { right: calc(var(--scb-divider-gap) / -2); }
57
- :host([overlay][direction="vertical"][anchor="start"]){ left: calc(var(--scb-divider-gap) / -2); }
97
+ :host([overlay][direction='vertical'][anchor='end']) {
98
+ right: calc(var(--scb-divider-gap) / -2);
99
+ }
100
+ :host([overlay][direction='vertical'][anchor='start']) {
101
+ left: calc(var(--scb-divider-gap) / -2);
102
+ }
58
103
  `;
59
- e([
60
- i({ type: String, reflect: !0 })
61
- ], r.prototype, "variant", 2);
62
- e([
63
- i({ type: String, reflect: !0 })
64
- ], r.prototype, "direction", 2);
65
- e([
66
- i({ type: String, reflect: !0 })
67
- ], r.prototype, "inset", 2);
68
- e([
69
- i({ type: Boolean, reflect: !0 })
70
- ], r.prototype, "overlay", 2);
71
- e([
72
- i({ type: String, reflect: !0 })
73
- ], r.prototype, "anchor", 2);
74
- r = e([
75
- b("scb-divider")
76
- ], r);
104
+ a([
105
+ s({ type: String, reflect: !0 })
106
+ ], i.prototype, "variant", 2);
107
+ a([
108
+ s({ type: String, reflect: !0 })
109
+ ], i.prototype, "direction", 2);
110
+ a([
111
+ s({ type: String, reflect: !0 })
112
+ ], i.prototype, "inset", 2);
113
+ a([
114
+ s({ type: Boolean, reflect: !0 })
115
+ ], i.prototype, "overlay", 2);
116
+ a([
117
+ s({ type: String, reflect: !0 })
118
+ ], i.prototype, "anchor", 2);
119
+ a([
120
+ s({ type: String, reflect: !0 })
121
+ ], i.prototype, "spacing", 2);
122
+ i = a([
123
+ u("scb-divider")
124
+ ], i);
77
125
  export {
78
- r as ScbDivider
126
+ i as ScbDivider
79
127
  };
@@ -1,5 +1,6 @@
1
1
  import { LitElement } from 'lit';
2
2
  export declare class ScbFactCard extends LitElement {
3
+ #private;
3
4
  private static __iconLoaded;
4
5
  private static __instances;
5
6
  private static __docListenerAttached;
@@ -20,6 +21,14 @@ export declare class ScbFactCard extends LitElement {
20
21
  maxWidth: string;
21
22
  height: string;
22
23
  maxHeight: string;
24
+ /**
25
+ * Vertikalt avstånd till omgivande innehåll.
26
+ * spacing sätter både top och bottom om spacing-top/spacing-bottom inte är satta.
27
+ * "N" (0–14) mappar till var(--spacing-N), annars valfritt CSS-värde (till exempel "16px" eller "var(--spacing-6)").
28
+ */
29
+ spacing: string;
30
+ spacingTop: string;
31
+ spacingBottom: string;
23
32
  connectedCallback(): void;
24
33
  disconnectedCallback(): void;
25
34
  protected updated(ch: Map<string, unknown>): void;
@@ -28,6 +37,7 @@ export declare class ScbFactCard extends LitElement {
28
37
  static styles: import('lit').CSSResult;
29
38
  render(): import('lit-html').TemplateResult<1>;
30
39
  firstUpdated(): Promise<void>;
40
+ private mapSpacingToken;
31
41
  }
32
42
  declare global {
33
43
  interface HTMLElementTagNameMap {
@@ -1,66 +1,74 @@
1
- import { css as h, LitElement as p, html as c } from "lit";
2
- import { property as n, customElement as u } from "lit/decorators.js";
1
+ import { css as b, LitElement as f, html as c } from "lit";
2
+ import { property as a, customElement as m } from "lit/decorators.js";
3
3
  import "../scb-icon-button/scb-icon-button.js";
4
4
  import "./scb-fact-card-content.js";
5
5
  import "../scb-link/scb-link.js";
6
- var b = Object.defineProperty, f = Object.getOwnPropertyDescriptor, i = (e, s, r, a) => {
7
- for (var o = a > 1 ? void 0 : a ? f(s, r) : s, l = e.length - 1, d; l >= 0; l--)
8
- (d = e[l]) && (o = (a ? d(s, r, o) : d(o)) || o);
9
- return a && o && b(s, r, o), o;
10
- };
11
- let t = class extends p {
6
+ var v = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, g = (t) => {
7
+ throw TypeError(t);
8
+ }, o = (t, i, s, r) => {
9
+ for (var n = r > 1 ? void 0 : r ? _(i, s) : i, p = t.length - 1, d; p >= 0; p--)
10
+ (d = t[p]) && (n = (r ? d(i, s, n) : d(n)) || n);
11
+ return r && n && v(i, s, n), n;
12
+ }, y = (t, i, s) => i.has(t) || g("Cannot " + s), x = (t, i, s) => i.has(t) ? g("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, s), u = (t, i, s) => (y(t, i, "access private method"), s), l, h;
13
+ let e = class extends f {
12
14
  constructor() {
13
- super(...arguments), this.__onCloseClick = (e) => {
14
- e.stopPropagation(), this.__setOpen(!1);
15
- }, this.variant = "filled", this.title = "", this.subtitle = "", this.supportingText = "", this.icon = "", this.showCloseButton = !1, this.open = !0, this.__lastTriggerEl = null, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "";
15
+ super(...arguments), x(this, l), this.__onCloseClick = (t) => {
16
+ t.stopPropagation(), this.__setOpen(!1);
17
+ }, this.variant = "filled", this.title = "", this.subtitle = "", this.supportingText = "", this.icon = "", this.showCloseButton = !1, this.open = !0, this.__lastTriggerEl = null, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
16
18
  }
17
- static __handleDocClick(e) {
18
- const s = e.composedPath();
19
- for (const r of s) {
20
- if (!(r instanceof Element)) continue;
21
- const a = r.getAttribute("data-fact-card-toggle") || r.getAttribute("aria-controls");
22
- if (!a) continue;
23
- const o = t.__instances.get(a);
24
- if (!o) {
25
- t.__instances.delete(a);
19
+ static __handleDocClick(t) {
20
+ const i = t.composedPath();
21
+ for (const s of i) {
22
+ if (!(s instanceof Element)) continue;
23
+ const r = s.getAttribute("data-fact-card-toggle") || s.getAttribute("aria-controls");
24
+ if (!r) continue;
25
+ const n = e.__instances.get(r);
26
+ if (!n) {
27
+ e.__instances.delete(r);
26
28
  continue;
27
29
  }
28
- o.__lastTriggerEl = r, o.__setOpen(!o.open), e.stopPropagation();
30
+ n.__lastTriggerEl = s, n.__setOpen(!n.open), t.stopPropagation();
29
31
  break;
30
32
  }
31
33
  }
32
34
  static __ensureDocListener() {
33
- t.__docListenerAttached || (document.addEventListener("click", t.__handleDocClick, !0), t.__docListenerAttached = !0);
35
+ e.__docListenerAttached || (document.addEventListener("click", e.__handleDocClick, !0), e.__docListenerAttached = !0);
34
36
  }
35
37
  static __maybeRemoveDocListener() {
36
- t.__docListenerAttached && t.__instances.size === 0 && (document.removeEventListener("click", t.__handleDocClick, !0), t.__docListenerAttached = !1);
38
+ e.__docListenerAttached && e.__instances.size === 0 && (document.removeEventListener("click", e.__handleDocClick, !0), e.__docListenerAttached = !1);
37
39
  }
38
40
  connectedCallback() {
39
- super.connectedCallback(), this.id && t.__instances.set(this.id, this), t.__ensureDocListener();
41
+ super.connectedCallback(), this.id && e.__instances.set(this.id, this), e.__ensureDocListener();
40
42
  }
41
43
  disconnectedCallback() {
42
- this.id && t.__instances.delete(this.id), t.__maybeRemoveDocListener(), super.disconnectedCallback();
44
+ this.id && e.__instances.delete(this.id), e.__maybeRemoveDocListener(), super.disconnectedCallback();
43
45
  }
44
- updated(e) {
45
- e.has("open") && this.__updateTriggersExpanded(), e.has("width") && (this.width ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), e.has("maxWidth") && (this.maxWidth ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), e.has("height") && (this.height ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), e.has("maxHeight") && (this.maxHeight ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size"));
46
+ updated(t) {
47
+ t.has("open") && this.__updateTriggersExpanded(), 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("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && u(this, l, h).call(this);
46
48
  }
47
49
  __updateTriggersExpanded() {
48
- this.id && document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach((e) => {
49
- e.hasAttribute("aria-controls") && e.setAttribute("aria-expanded", String(this.open));
50
+ this.id && document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach((t) => {
51
+ t.hasAttribute("aria-controls") && t.setAttribute("aria-expanded", String(this.open));
50
52
  });
51
53
  }
52
- __setOpen(e) {
53
- const s = this.open;
54
- this.open = e, e && !s ? this.dispatchEvent(new CustomEvent("open", { bubbles: !0, composed: !0 })) : !e && s && this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 }));
54
+ __setOpen(t) {
55
+ const i = this.open;
56
+ this.open = t, t && !i ? this.dispatchEvent(new CustomEvent("open", { bubbles: !0, composed: !0 })) : !t && i && this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 }));
55
57
  }
56
58
  render() {
57
59
  if (!this.open) return c``;
58
- const e = this.variant === "outlined" ? "outlined" : "filled", s = !!this.icon;
60
+ const t = this.variant === "outlined" ? "outlined" : "filled", i = !!this.icon;
59
61
  return c`
60
- <div class="outer ${s ? "has-icon" : ""}">
61
- ${s ? c`<div class="icon-wrapper ${e}"><md-icon>${this.icon}</md-icon></div>` : ""}
62
- <div class="scb-fact-card ${e} ${this.showCloseButton ? "has-close" : ""}">
63
- ${this.showCloseButton ? c`<scb-icon-button variant="standard" icon="close" @click=${this.__onCloseClick}></scb-icon-button>` : ""}
62
+ <div class="outer ${i ? "has-icon" : ""}">
63
+ ${i ? c`<div class="icon-wrapper ${t}"><md-icon>${this.icon}</md-icon></div>` : ""}
64
+ <div class="scb-fact-card ${t} ${this.showCloseButton ? "has-close" : ""}">
65
+ ${this.showCloseButton ? c`
66
+ <scb-icon-button
67
+ variant="standard"
68
+ icon="close"
69
+ @click=${this.__onCloseClick}
70
+ ></scb-icon-button>
71
+ ` : ""}
64
72
  <div class="content">
65
73
  <slot></slot>
66
74
  </div>
@@ -69,13 +77,24 @@ let t = class extends p {
69
77
  `;
70
78
  }
71
79
  async firstUpdated() {
72
- t.__iconLoaded || (await import("@material/web/icon/icon.js"), t.__iconLoaded = !0);
80
+ u(this, l, h).call(this), e.__iconLoaded || (await import("@material/web/icon/icon.js"), e.__iconLoaded = !0);
81
+ }
82
+ mapSpacingToken(t) {
83
+ if (!t) return;
84
+ const i = String(t).trim();
85
+ if (i)
86
+ return /^\d+$/.test(i) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(i, 10)))})` : i;
73
87
  }
74
88
  };
75
- t.__iconLoaded = !1;
76
- t.__instances = /* @__PURE__ */ new Map();
77
- t.__docListenerAttached = !1;
78
- t.styles = h`
89
+ l = /* @__PURE__ */ new WeakSet();
90
+ h = function() {
91
+ const t = this.mapSpacingToken(this.spacing), i = this.mapSpacingToken(this.spacingTop), s = this.mapSpacingToken(this.spacingBottom), r = i ?? t, n = s ?? t;
92
+ r ? this.style.setProperty("--scb-fact-card-spacing-block-start", r) : this.style.removeProperty("--scb-fact-card-spacing-block-start"), n ? this.style.setProperty("--scb-fact-card-spacing-block-end", n) : this.style.removeProperty("--scb-fact-card-spacing-block-end");
93
+ };
94
+ e.__iconLoaded = !1;
95
+ e.__instances = /* @__PURE__ */ new Map();
96
+ e.__docListenerAttached = !1;
97
+ e.styles = b`
79
98
  :host {
80
99
  --scb-fact-card-icon-overhang: 40px;
81
100
  display: block;
@@ -86,20 +105,22 @@ t.styles = h`
86
105
  max-inline-size: var(--scb-fact-card-max-w);
87
106
  height: auto;
88
107
  padding: 0;
108
+ margin-block-start: var(--scb-fact-card-spacing-block-start, 0);
109
+ margin-block-end: var(--scb-fact-card-spacing-block-end, 0);
89
110
  }
90
111
 
91
- :host([sizing="stretch"]) {
112
+ :host([sizing='stretch']) {
92
113
  inline-size: 100%;
93
114
  block-size: 100%;
94
115
  max-inline-size: none;
95
116
  }
96
- :host([sizing="content-width"]) {
117
+ :host([sizing='content-width']) {
97
118
  display: inline-block;
98
119
  inline-size: auto;
99
120
  block-size: auto;
100
121
  max-inline-size: var(--scb-fact-card-max-w);
101
122
  }
102
- :host([sizing="content-height"]) {
123
+ :host([sizing='content-height']) {
103
124
  inline-size: 100%;
104
125
  block-size: auto;
105
126
  max-inline-size: none;
@@ -113,13 +134,13 @@ t.styles = h`
113
134
  padding-top: var(--_icon-pad);
114
135
  box-sizing: border-box;
115
136
  }
116
- :host([sizing="content-width"]) .outer {
137
+ :host([sizing='content-width']) .outer {
117
138
  inline-size: max-content;
118
139
  }
119
140
 
120
141
  :host([height]) .outer,
121
142
  :host([max-height]) .outer,
122
- :host([sizing="stretch"]) .outer {
143
+ :host([sizing='stretch']) .outer {
123
144
  block-size: 100%;
124
145
  }
125
146
 
@@ -140,16 +161,25 @@ t.styles = h`
140
161
 
141
162
  :host([height]) .scb-fact-card,
142
163
  :host([max-height]) .scb-fact-card,
143
- :host([sizing="stretch"]) .scb-fact-card {
164
+ :host([sizing='stretch']) .scb-fact-card {
144
165
  block-size: calc(100% - var(--_icon-pad));
145
166
  }
146
167
 
147
- .scb-fact-card.has-close { padding-right: var(--spacing-12); }
168
+ .scb-fact-card.has-close {
169
+ padding-right: var(--spacing-12);
170
+ }
148
171
 
149
- .scb-fact-card.outlined { border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); }
172
+ .scb-fact-card.outlined {
173
+ border: 1px solid var(--md-sys-color-outline);
174
+ background: var(--md-sys-color-surface);
175
+ }
150
176
 
151
- .outer.has-icon { --_icon-pad: var(--scb-fact-card-icon-overhang); }
152
- .outer.has-icon .scb-fact-card { border-top-left-radius: 0; }
177
+ .outer.has-icon {
178
+ --_icon-pad: var(--scb-fact-card-icon-overhang);
179
+ }
180
+ .outer.has-icon .scb-fact-card {
181
+ border-top-left-radius: 0;
182
+ }
153
183
 
154
184
  .icon-wrapper {
155
185
  position: absolute;
@@ -160,7 +190,7 @@ t.styles = h`
160
190
  padding-bottom: 0;
161
191
  width: fit-content;
162
192
  border-radius: var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0 /
163
- var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0;
193
+ var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0;
164
194
  background: var(--md-sys-color-surface-dim);
165
195
  line-height: 0;
166
196
  }
@@ -176,7 +206,9 @@ t.styles = h`
176
206
  top: var(--scale-01);
177
207
  }
178
208
 
179
- .scb-fact-card.clickable { cursor: pointer; }
209
+ .scb-fact-card.clickable {
210
+ cursor: pointer;
211
+ }
180
212
 
181
213
  .content {
182
214
  display: flex;
@@ -197,45 +229,54 @@ t.styles = h`
197
229
  hyphens: auto;
198
230
  }
199
231
  `;
200
- i([
201
- n({ type: String })
202
- ], t.prototype, "variant", 2);
203
- i([
204
- n({ type: String, attribute: "title" })
205
- ], t.prototype, "title", 2);
206
- i([
207
- n({ type: String, attribute: "subtitle" })
208
- ], t.prototype, "subtitle", 2);
209
- i([
210
- n({ type: String, attribute: "supporting-text" })
211
- ], t.prototype, "supportingText", 2);
212
- i([
213
- n({ type: String })
214
- ], t.prototype, "icon", 2);
215
- i([
216
- n({ type: Boolean, attribute: "show-close-button" })
217
- ], t.prototype, "showCloseButton", 2);
218
- i([
219
- n({ type: Boolean, reflect: !0 })
220
- ], t.prototype, "open", 2);
221
- i([
222
- n({ type: String, reflect: !0 })
223
- ], t.prototype, "sizing", 2);
224
- i([
225
- n({ type: String, reflect: !0 })
226
- ], t.prototype, "width", 2);
227
- i([
228
- n({ type: String, reflect: !0, attribute: "max-width" })
229
- ], t.prototype, "maxWidth", 2);
230
- i([
231
- n({ type: String, reflect: !0 })
232
- ], t.prototype, "height", 2);
233
- i([
234
- n({ type: String, reflect: !0, attribute: "max-height" })
235
- ], t.prototype, "maxHeight", 2);
236
- t = i([
237
- u("scb-fact-card")
238
- ], t);
232
+ o([
233
+ a({ type: String })
234
+ ], e.prototype, "variant", 2);
235
+ o([
236
+ a({ type: String, attribute: "title" })
237
+ ], e.prototype, "title", 2);
238
+ o([
239
+ a({ type: String, attribute: "subtitle" })
240
+ ], e.prototype, "subtitle", 2);
241
+ o([
242
+ a({ type: String, attribute: "supporting-text" })
243
+ ], e.prototype, "supportingText", 2);
244
+ o([
245
+ a({ type: String })
246
+ ], e.prototype, "icon", 2);
247
+ o([
248
+ a({ type: Boolean, attribute: "show-close-button" })
249
+ ], e.prototype, "showCloseButton", 2);
250
+ o([
251
+ a({ type: Boolean, reflect: !0 })
252
+ ], e.prototype, "open", 2);
253
+ o([
254
+ a({ type: String, reflect: !0 })
255
+ ], e.prototype, "sizing", 2);
256
+ o([
257
+ a({ type: String, reflect: !0 })
258
+ ], e.prototype, "width", 2);
259
+ o([
260
+ a({ type: String, reflect: !0, attribute: "max-width" })
261
+ ], e.prototype, "maxWidth", 2);
262
+ o([
263
+ a({ type: String, reflect: !0 })
264
+ ], e.prototype, "height", 2);
265
+ o([
266
+ a({ type: String, reflect: !0, attribute: "max-height" })
267
+ ], e.prototype, "maxHeight", 2);
268
+ o([
269
+ a({ type: String, reflect: !0 })
270
+ ], e.prototype, "spacing", 2);
271
+ o([
272
+ a({ type: String, reflect: !0, attribute: "spacing-top" })
273
+ ], e.prototype, "spacingTop", 2);
274
+ o([
275
+ a({ type: String, reflect: !0, attribute: "spacing-bottom" })
276
+ ], e.prototype, "spacingBottom", 2);
277
+ e = o([
278
+ m("scb-fact-card")
279
+ ], e);
239
280
  export {
240
- t as ScbFactCard
281
+ e as ScbFactCard
241
282
  };
@@ -1,5 +1,6 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  export declare class ScbHorizontalScroller extends LitElement {
3
+ #private;
3
4
  /** Variant för scroll-layout. */
4
5
  variant: 'standard' | 'inline';
5
6
  /** Fast bredd på scroller, t.ex. '400px' eller '100%'. */
@@ -7,6 +8,14 @@ export declare class ScbHorizontalScroller extends LitElement {
7
8
  showScrollbar: boolean;
8
9
  rightScrollButtonLabel: string;
9
10
  leftScrollButtonLabel: string;
11
+ /**
12
+ * Vertikalt avstånd till omgivande innehåll.
13
+ * spacing sätter både top och bottom om spacing-top/spacing-bottom inte är satta.
14
+ * "N" (0–14) mappar till var(--spacing-N), annars valfritt CSS-värde (till exempel "16px" eller "var(--spacing-6)").
15
+ */
16
+ spacing: string;
17
+ spacingTop: string;
18
+ spacingBottom: string;
10
19
  contentFlex: boolean;
11
20
  static styles: import('lit').CSSResult;
12
21
  private doScrollBy;
@@ -22,5 +31,6 @@ export declare class ScbHorizontalScroller extends LitElement {
22
31
  private handleScroll;
23
32
  firstUpdated(): void;
24
33
  updated(changed: PropertyValues): void;
34
+ private mapSpacingToken;
25
35
  render(): import('lit-html').TemplateResult<1>;
26
36
  }