scb-wc-test 0.1.104 → 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 (89) 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-select/scb-select-option.js +3 -3
  23. package/mvc/components/scb-select/scb-select.js +3 -3
  24. package/mvc/components/scb-status-pill/scb-status-pill.js +17 -13
  25. package/mvc/components/scb-stepper/scb-stepper.js +32 -29
  26. package/mvc/components/scb-switch/scb-switch.js +11 -8
  27. package/mvc/components/scb-tabs/scb-tabs.js +22 -19
  28. package/mvc/components/scb-textfield/scb-textfield.js +14 -10
  29. package/mvc/components/scb-toc/scb-toc.js +6 -3
  30. package/mvc/components/scb-viz/scb-viz.js +188 -178
  31. package/package.json +2 -2
  32. package/scb-accordion/scb-accordion.d.ts +13 -0
  33. package/scb-accordion/scb-accordion.js +53 -21
  34. package/scb-avatar/scb-avatar.d.ts +6 -0
  35. package/scb-avatar/scb-avatar.js +96 -61
  36. package/scb-breadcrumb/scb-breadcrumb-item.js +8 -9
  37. package/scb-breadcrumb/scb-breadcrumb.d.ts +6 -0
  38. package/scb-breadcrumb/scb-breadcrumb.js +61 -30
  39. package/scb-button/scb-button.d.ts +10 -0
  40. package/scb-button/scb-button.js +89 -65
  41. package/scb-calendar-card/scb-calendar-card.d.ts +5 -0
  42. package/scb-calendar-card/scb-calendar-card.js +79 -55
  43. package/scb-card/scb-card.d.ts +5 -0
  44. package/scb-card/scb-card.js +165 -140
  45. package/scb-checkbox/scb-checkbox-group.d.ts +3 -1
  46. package/scb-checkbox/scb-checkbox-group.js +59 -40
  47. package/scb-checkbox/scb-checkbox.d.ts +11 -0
  48. package/scb-checkbox/scb-checkbox.js +78 -56
  49. package/scb-chip/scb-chip.d.ts +24 -0
  50. package/scb-chip/scb-chip.js +137 -65
  51. package/scb-divider/scb-divider.d.ts +14 -0
  52. package/scb-divider/scb-divider.js +91 -43
  53. package/scb-fact-card/scb-fact-card.d.ts +10 -0
  54. package/scb-fact-card/scb-fact-card.js +135 -94
  55. package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +10 -0
  56. package/scb-horizontal-scroller/scb-horizontal-scroller.js +179 -120
  57. package/scb-icon-button/scb-icon-button.d.ts +6 -1
  58. package/scb-icon-button/scb-icon-button.js +81 -59
  59. package/scb-keyfigure-card/scb-keyfigure-card.d.ts +10 -0
  60. package/scb-keyfigure-card/scb-keyfigure-card.js +76 -52
  61. package/scb-list/scb-list.d.ts +7 -1
  62. package/scb-list/scb-list.js +62 -40
  63. package/scb-notification-card/scb-notification-card.d.ts +5 -0
  64. package/scb-notification-card/scb-notification-card.js +56 -39
  65. package/scb-pagination/scb-pagination.d.ts +12 -1
  66. package/scb-pagination/scb-pagination.js +235 -147
  67. package/scb-radio-button/scb-radio-group.d.ts +14 -3
  68. package/scb-radio-button/scb-radio-group.js +120 -67
  69. package/scb-search/scb-search.d.ts +15 -2
  70. package/scb-search/scb-search.js +152 -69
  71. package/scb-segmented-button/scb-segmented-button.d.ts +41 -4
  72. package/scb-segmented-button/scb-segmented-button.js +145 -61
  73. package/scb-select/scb-select-option.js +3 -3
  74. package/scb-select/scb-select.js +26 -26
  75. package/scb-status-pill/scb-status-pill.d.ts +12 -1
  76. package/scb-status-pill/scb-status-pill.js +51 -27
  77. package/scb-stepper/scb-stepper.d.ts +11 -3
  78. package/scb-stepper/scb-stepper.js +134 -101
  79. package/scb-switch/scb-switch.d.ts +21 -2
  80. package/scb-switch/scb-switch.js +97 -45
  81. package/scb-tabs/scb-tabs.d.ts +8 -0
  82. package/scb-tabs/scb-tabs.js +74 -44
  83. package/scb-textfield/scb-textfield.d.ts +7 -0
  84. package/scb-textfield/scb-textfield.js +43 -16
  85. package/scb-toc/scb-toc.d.ts +10 -1
  86. package/scb-toc/scb-toc.js +49 -18
  87. package/scb-viz/scb-viz.d.ts +10 -3
  88. package/scb-viz/scb-viz.js +278 -236
  89. package/scb-wc-test.bundle.js +1177 -896
@@ -1,14 +1,16 @@
1
- import { css as h, LitElement as u, html as o } from "lit";
2
- import { property as a, customElement as _ } from "lit/decorators.js";
1
+ import { css as b, LitElement as g, html as a } from "lit";
2
+ import { property as r, customElement as f } from "lit/decorators.js";
3
3
  import "@material/web/icon/icon.js";
4
- var b = Object.defineProperty, p = Object.getOwnPropertyDescriptor, n = (t, e, l, r) => {
5
- for (var s = r > 1 ? void 0 : r ? p(e, l) : e, d = t.length - 1, c; d >= 0; d--)
6
- (c = t[d]) && (s = (r ? c(e, l, s) : c(s)) || s);
7
- return r && s && b(e, l, s), s;
8
- };
9
- let i = class extends u {
4
+ var m = Object.defineProperty, v = Object.getOwnPropertyDescriptor, _ = (t) => {
5
+ throw TypeError(t);
6
+ }, o = (t, e, i, l) => {
7
+ for (var n = l > 1 ? void 0 : l ? v(e, i) : e, d = t.length - 1, h; d >= 0; d--)
8
+ (h = t[d]) && (n = (l ? h(e, i, n) : h(n)) || n);
9
+ return l && n && m(e, i, n), n;
10
+ }, y = (t, e, i) => e.has(t) || _("Cannot " + i), $ = (t, e, i) => e.has(t) ? _("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), p = (t, e, i) => (y(t, e, "access private method"), i), c, u;
11
+ let s = class extends g {
10
12
  constructor() {
11
- super(...arguments), this.icon = "home", this.tooltip = "", this.ariaLabel = "", this.variant = "standard", this.toggle = !1, this.selected = !1, this.toggleofficon = "add", this.toggleonicon = "remove", this.disabled = !1, this.__loadedVariants = /* @__PURE__ */ new Set(), this.__iconLoaded = !1, this.__lastMdHost = null, this.__onInnerChange = () => {
13
+ super(...arguments), $(this, c), this.icon = "home", this.tooltip = "", this.ariaLabel = "", this.variant = "standard", this.toggle = !1, this.selected = !1, this.toggleofficon = "add", this.toggleonicon = "remove", this.disabled = !1, this.spacing = "", this.__loadedVariants = /* @__PURE__ */ new Set(), this.__iconLoaded = !1, this.__lastMdHost = null, this.__onInnerChange = () => {
12
14
  const t = this.__getMdHost(), e = !!(t != null && t.selected);
13
15
  this.toggle && (this.selected = e), this.dispatchEvent(
14
16
  new CustomEvent("change", {
@@ -20,10 +22,10 @@ let i = class extends u {
20
22
  };
21
23
  }
22
24
  async firstUpdated() {
23
- await this.__ensureDepsLoaded(), await this.updateComplete, this.__attachChangeListener(), this.__syncTitleAndAria();
25
+ await this.__ensureDepsLoaded(), await this.updateComplete, this.__attachChangeListener(), this.__syncTitleAndAria(), p(this, c, u).call(this);
24
26
  }
25
27
  updated(t) {
26
- if (super.updated(t), t.has("variant")) {
28
+ if (super.updated(t), t.has("spacing") && p(this, c, u).call(this), t.has("variant")) {
27
29
  this.__ensureDepsLoaded().then(() => {
28
30
  queueMicrotask(() => {
29
31
  this.__attachChangeListener(), this.__syncTitleAndAria();
@@ -67,35 +69,42 @@ let i = class extends u {
67
69
  }
68
70
  /** Koppla change-event från md-* samt spegla selected. */
69
71
  __attachChangeListener() {
70
- var e, l;
72
+ var e, i;
71
73
  const t = this.__getMdHost();
72
- t && t !== this.__lastMdHost && ((l = (e = this.__lastMdHost) == null ? void 0 : e.removeEventListener) == null || l.call(e, "change", this.__onInnerChange), t.addEventListener("change", this.__onInnerChange), this.__lastMdHost = t), this.toggle && t && "selected" in t && (t.selected = this.selected);
74
+ t && t !== this.__lastMdHost && ((i = (e = this.__lastMdHost) == null ? void 0 : e.removeEventListener) == null || i.call(e, "change", this.__onInnerChange), t.addEventListener("change", this.__onInnerChange), this.__lastMdHost = t), this.toggle && t && "selected" in t && (t.selected = this.selected);
73
75
  }
74
76
  /**
75
- * Synkar native title och aria-* mellan host och md-*. */
77
+ * Synkar native title och aria-* mellan host och md-*.
78
+ */
76
79
  __syncTitleAndAria() {
77
80
  const t = this.__getMdHost();
78
81
  if (!t) return;
79
- const e = (this.tooltip || this.getAttribute("title") || "").trim(), l = (this.ariaLabel || this.getAttribute("aria-label") || "").trim(), r = this.getAttribute("aria-controls"), s = this.getAttribute("aria-expanded");
82
+ const e = (this.tooltip || this.getAttribute("title") || "").trim(), i = (this.ariaLabel || this.getAttribute("aria-label") || "").trim(), l = this.getAttribute("aria-controls"), n = this.getAttribute("aria-expanded");
80
83
  this.tooltip && this.setAttribute("title", e);
81
- const d = l || e || this.icon.trim() || void 0;
82
- d ? t.setAttribute("aria-label", d) : t.removeAttribute("aria-label"), e ? t.setAttribute("title", e) : t.removeAttribute("title"), r !== null ? t.setAttribute("aria-controls", r) : t.removeAttribute("aria-controls"), s !== null ? t.setAttribute("aria-expanded", s) : t.removeAttribute("aria-expanded");
84
+ const d = i || e || this.icon.trim() || void 0;
85
+ d ? t.setAttribute("aria-label", d) : t.removeAttribute("aria-label"), e ? t.setAttribute("title", e) : t.removeAttribute("title"), l !== null ? t.setAttribute("aria-controls", l) : t.removeAttribute("aria-controls"), n !== null ? t.setAttribute("aria-expanded", n) : t.removeAttribute("aria-expanded");
86
+ }
87
+ mapSpacingToken(t) {
88
+ if (!t) return;
89
+ const e = String(t).trim();
90
+ if (e)
91
+ return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
83
92
  }
84
93
  __renderToggleIcons() {
85
- return o`
94
+ return a`
86
95
  <md-icon aria-hidden="true">${this.toggleofficon}</md-icon>
87
96
  <md-icon slot="selected" aria-hidden="true">${this.toggleonicon}</md-icon>
88
97
  `;
89
98
  }
90
99
  __renderSingleIcon() {
91
- return o`<md-icon aria-hidden="true">${this.icon}</md-icon>`;
100
+ return a`<md-icon aria-hidden="true">${this.icon}</md-icon>`;
92
101
  }
93
102
  __renderMd() {
94
103
  const t = this.toggle ? this.__renderToggleIcons() : this.__renderSingleIcon();
95
104
  if (this.toggle)
96
105
  switch (this.variant) {
97
106
  case "filled":
98
- return o`
107
+ return a`
99
108
  <md-filled-icon-button
100
109
  toggle
101
110
  ?selected=${this.selected}
@@ -105,7 +114,7 @@ let i = class extends u {
105
114
  </md-filled-icon-button>
106
115
  `;
107
116
  case "outlined":
108
- return o`
117
+ return a`
109
118
  <md-outlined-icon-button
110
119
  toggle
111
120
  ?selected=${this.selected}
@@ -115,7 +124,7 @@ let i = class extends u {
115
124
  </md-outlined-icon-button>
116
125
  `;
117
126
  case "filled-tonal":
118
- return o`
127
+ return a`
119
128
  <md-filled-tonal-icon-button
120
129
  toggle
121
130
  ?selected=${this.selected}
@@ -125,7 +134,7 @@ let i = class extends u {
125
134
  </md-filled-tonal-icon-button>
126
135
  `;
127
136
  default:
128
- return o`
137
+ return a`
129
138
  <md-icon-button toggle ?selected=${this.selected} ?disabled=${this.disabled}>
130
139
  ${t}
131
140
  </md-icon-button>
@@ -133,25 +142,25 @@ let i = class extends u {
133
142
  }
134
143
  switch (this.variant) {
135
144
  case "filled":
136
- return o`
145
+ return a`
137
146
  <md-filled-icon-button ?disabled=${this.disabled}>
138
147
  ${t}
139
148
  </md-filled-icon-button>
140
149
  `;
141
150
  case "outlined":
142
- return o`
151
+ return a`
143
152
  <md-outlined-icon-button ?disabled=${this.disabled}>
144
153
  ${t}
145
154
  </md-outlined-icon-button>
146
155
  `;
147
156
  case "filled-tonal":
148
- return o`
157
+ return a`
149
158
  <md-filled-tonal-icon-button ?disabled=${this.disabled}>
150
159
  ${t}
151
160
  </md-filled-tonal-icon-button>
152
161
  `;
153
162
  default:
154
- return o`
163
+ return a`
155
164
  <md-icon-button ?disabled=${this.disabled}>
156
165
  ${t}
157
166
  </md-icon-button>
@@ -162,37 +171,50 @@ let i = class extends u {
162
171
  return this.__renderMd();
163
172
  }
164
173
  };
165
- i.styles = h``;
166
- n([
167
- a({ type: String })
168
- ], i.prototype, "icon", 2);
169
- n([
170
- a({ type: String })
171
- ], i.prototype, "tooltip", 2);
172
- n([
173
- a({ type: String, attribute: "aria-label" })
174
- ], i.prototype, "ariaLabel", 2);
175
- n([
176
- a({ type: String })
177
- ], i.prototype, "variant", 2);
178
- n([
179
- a({ type: Boolean, reflect: !0 })
180
- ], i.prototype, "toggle", 2);
181
- n([
182
- a({ type: Boolean, reflect: !0 })
183
- ], i.prototype, "selected", 2);
184
- n([
185
- a({ type: String })
186
- ], i.prototype, "toggleofficon", 2);
187
- n([
188
- a({ type: String })
189
- ], i.prototype, "toggleonicon", 2);
190
- n([
191
- a({ type: Boolean, reflect: !0 })
192
- ], i.prototype, "disabled", 2);
193
- i = n([
194
- _("scb-icon-button")
195
- ], i);
174
+ c = /* @__PURE__ */ new WeakSet();
175
+ u = function() {
176
+ const t = this.mapSpacingToken(this.spacing);
177
+ t ? this.style.setProperty("--scb-icon-button-spacing-block", t) : this.style.removeProperty("--scb-icon-button-spacing-block");
178
+ };
179
+ s.styles = b`
180
+ :host {
181
+ display: inline-flex;
182
+ margin-block: var(--scb-icon-button-spacing-block, 0);
183
+ }
184
+ `;
185
+ o([
186
+ r({ type: String })
187
+ ], s.prototype, "icon", 2);
188
+ o([
189
+ r({ type: String })
190
+ ], s.prototype, "tooltip", 2);
191
+ o([
192
+ r({ type: String, attribute: "aria-label" })
193
+ ], s.prototype, "ariaLabel", 2);
194
+ o([
195
+ r({ type: String })
196
+ ], s.prototype, "variant", 2);
197
+ o([
198
+ r({ type: Boolean, reflect: !0 })
199
+ ], s.prototype, "toggle", 2);
200
+ o([
201
+ r({ type: Boolean, reflect: !0 })
202
+ ], s.prototype, "selected", 2);
203
+ o([
204
+ r({ type: String })
205
+ ], s.prototype, "toggleofficon", 2);
206
+ o([
207
+ r({ type: String })
208
+ ], s.prototype, "toggleonicon", 2);
209
+ o([
210
+ r({ type: Boolean, reflect: !0 })
211
+ ], s.prototype, "disabled", 2);
212
+ o([
213
+ r({ type: String, reflect: !0 })
214
+ ], s.prototype, "spacing", 2);
215
+ s = o([
216
+ f("scb-icon-button")
217
+ ], s);
196
218
  export {
197
- i as ScbIconButton
219
+ s as ScbIconButton
198
220
  };
@@ -1,5 +1,6 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  export declare class ScbKeyFigureCard extends LitElement {
3
+ #private;
3
4
  private static __iconLoaded;
4
5
  private static __rippleLoaded;
5
6
  keyfigure: number | string;
@@ -14,12 +15,21 @@ export declare class ScbKeyFigureCard extends LitElement {
14
15
  height: string;
15
16
  maxHeight: string;
16
17
  sizing: 'stretch' | 'content-width' | 'content-height';
18
+ /**
19
+ * Vertikalt avstånd till omgivande innehåll.
20
+ * spacing sätter både top och bottom om spacing-top/spacing-bottom inte är satta.
21
+ * "N" (0–14) mappas till var(--spacing-N), annars valfritt CSS-värde (t.ex. "16px" eller "var(--spacing-6)").
22
+ */
23
+ spacing: string;
24
+ spacingTop: string;
25
+ spacingBottom: string;
17
26
  static styles: import('lit').CSSResult;
18
27
  private formatNumber;
19
28
  protected firstUpdated(): Promise<void>;
20
29
  render(): import('lit-html').TemplateResult<1>;
21
30
  private __applyInnerSizing;
22
31
  protected updated(changed: PropertyValues): void;
32
+ private mapSpacingToken;
23
33
  private __onKeyDown;
24
34
  private __handleHrefNavigation;
25
35
  }
@@ -1,14 +1,16 @@
1
- import { css as p, LitElement as d, html as a } from "lit";
2
- import { property as s, customElement as u } from "lit/decorators.js";
1
+ import { css as u, LitElement as f, html as l } from "lit";
2
+ import { property as a, customElement as m } from "lit/decorators.js";
3
3
  import "@material/web/focus/md-focus-ring.js";
4
- var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, t = (e, r, n, o) => {
5
- for (var l = o > 1 ? void 0 : o ? g(r, n) : r, h = e.length - 1, c; h >= 0; h--)
6
- (c = e[h]) && (l = (o ? c(r, n, l) : c(l)) || l);
7
- return o && l && y(r, n, l), l;
8
- };
9
- let i = class extends d {
4
+ var b = Object.defineProperty, v = Object.getOwnPropertyDescriptor, y = (e) => {
5
+ throw TypeError(e);
6
+ }, s = (e, t, r, n) => {
7
+ for (var o = n > 1 ? void 0 : n ? v(t, r) : t, p = e.length - 1, h; p >= 0; p--)
8
+ (h = e[p]) && (o = (n ? h(t, r, o) : h(o)) || o);
9
+ return n && o && b(t, r, o), o;
10
+ }, k = (e, t, r) => t.has(e) || y("Cannot " + r), z = (e, t, r) => t.has(e) ? y("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), g = (e, t, r) => (k(e, t, "access private method"), r), c, d;
11
+ let i = class extends f {
10
12
  constructor() {
11
- super(...arguments), this.keyfigure = 0, this.subtitle = "", this.supportingText = "", this.cardHref = "", this.icon = "", this.size = "standard", this.unit = "", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.sizing = "stretch", this.__onKeyDown = (e) => {
13
+ super(...arguments), z(this, c), this.keyfigure = 0, this.subtitle = "", this.supportingText = "", this.cardHref = "", this.icon = "", this.size = "standard", this.unit = "", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.sizing = "stretch", this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this.__onKeyDown = (e) => {
12
14
  (e.key === "Enter" || e.key === " ") && this.cardHref && (e.preventDefault(), window.location.href = this.cardHref);
13
15
  }, this.__handleHrefNavigation = (e) => {
14
16
  this.cardHref && (e.target.closest("a") || (window.location.href = this.cardHref));
@@ -17,43 +19,43 @@ let i = class extends d {
17
19
  formatNumber(e) {
18
20
  if (typeof e == "number")
19
21
  return e.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
20
- const r = Number(e);
21
- return Number.isNaN(r) ? String(e) : r.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
22
+ const t = Number(e);
23
+ return Number.isNaN(t) ? String(e) : t.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
22
24
  }
23
25
  async firstUpdated() {
24
- i.__iconLoaded || (await import("@material/web/icon/icon.js"), i.__iconLoaded = !0), i.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), i.__rippleLoaded = !0), this.__applyInnerSizing();
26
+ i.__iconLoaded || (await import("@material/web/icon/icon.js"), i.__iconLoaded = !0), i.__rippleLoaded || (await import("@material/web/ripple/ripple.js"), i.__rippleLoaded = !0), this.__applyInnerSizing(), g(this, c, d).call(this);
25
27
  }
26
28
  render() {
27
- const e = !!this.cardHref, r = this.formatNumber(this.keyfigure), n = (this.unit || "").trim(), o = n ? `${r} ${n}` : r;
28
- return a`
29
+ const e = !!this.cardHref, t = this.formatNumber(this.keyfigure), r = (this.unit || "").trim(), n = r ? `${t} ${r}` : t;
30
+ return l`
29
31
  <div
30
32
  class="scb-keyfigure-card ${e ? "clickable" : ""} ${this.size}"
31
33
  role=${e ? "link" : "group"}
32
34
  tabindex=${e ? "0" : "-1"}
33
- aria-label=${this.subtitle || o}
35
+ aria-label=${this.subtitle || n}
34
36
  @click=${e ? this.__handleHrefNavigation : null}
35
37
  @keydown=${e ? this.__onKeyDown : null}
36
38
  style="cursor:${e ? "pointer" : "default"};"
37
39
  >
38
- ${e ? a`<md-ripple></md-ripple>` : ""}
39
- ${this.icon ? a`<md-icon>${this.icon}</md-icon>` : ""}
40
+ ${e ? l`<md-ripple></md-ripple>` : ""}
41
+ ${this.icon ? l`<md-icon>${this.icon}</md-icon>` : ""}
40
42
 
41
- ${this.keyfigure !== void 0 && this.keyfigure !== null && this.keyfigure !== "" ? a`
43
+ ${this.keyfigure !== void 0 && this.keyfigure !== null && this.keyfigure !== "" ? l`
42
44
  <div class="keyfigure">
43
- <span class="value" aria-label="${o}">
44
- ${r}${n ? a`<span class="unit" aria-hidden="true">\u00A0${n}</span>` : ""}
45
+ <span class="value" aria-label="${n}">
46
+ ${t}${r ? l`<span class="unit" aria-hidden="true">\u00A0${r}</span>` : ""}
45
47
  </span>
46
- ${e ? a`<md-icon>arrow_forward</md-icon>` : ""}
48
+ ${e ? l`<md-icon>arrow_forward</md-icon>` : ""}
47
49
  </div>
48
50
  ` : ""}
49
51
 
50
- ${this.subtitle ? a`
52
+ ${this.subtitle ? l`
51
53
  <div class="sub-label">
52
- ${e ? a`<a href="${this.cardHref}" tabindex="-1">${this.subtitle}</a>` : this.subtitle}
54
+ ${e ? l`<a href="${this.cardHref}" tabindex="-1">${this.subtitle}</a>` : this.subtitle}
53
55
  </div>
54
56
  ` : ""}
55
57
 
56
- ${this.supportingText ? a`<div class="supporting-text">${this.supportingText}</div>` : ""}
58
+ ${this.supportingText ? l`<div class="supporting-text">${this.supportingText}</div>` : ""}
57
59
  </div>
58
60
 
59
61
  <md-focus-ring></md-focus-ring>
@@ -65,12 +67,23 @@ let i = class extends d {
65
67
  this.width && this.width.trim() !== "" ? (e.style.inlineSize = "100%", e.style.maxInlineSize = "100%") : (e.style.removeProperty("inline-size"), e.style.removeProperty("max-inline-size")), this.height && this.height.trim() !== "" || this.sizing === "stretch" ? e.style.blockSize = "100%" : e.style.removeProperty("block-size"), this.maxHeight && this.maxHeight.trim() !== "" ? e.style.maxBlockSize = "100%" : e.style.removeProperty("max-block-size");
66
68
  }
67
69
  updated(e) {
68
- super.updated(e), 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")), (e.has("width") || e.has("height") || e.has("maxHeight") || e.has("sizing")) && this.__applyInnerSizing();
70
+ super.updated(e), 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")), (e.has("width") || e.has("height") || e.has("maxHeight") || e.has("sizing")) && this.__applyInnerSizing(), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom")) && g(this, c, d).call(this);
71
+ }
72
+ mapSpacingToken(e) {
73
+ if (!e) return;
74
+ const t = String(e).trim();
75
+ if (t)
76
+ return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
69
77
  }
70
78
  };
79
+ c = /* @__PURE__ */ new WeakSet();
80
+ d = function() {
81
+ const e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop), r = this.mapSpacingToken(this.spacingBottom), n = t ?? e, o = r ?? e;
82
+ n ? this.style.setProperty("--scb-keyfigure-card-spacing-block-start", n) : this.style.removeProperty("--scb-keyfigure-card-spacing-block-start"), o ? this.style.setProperty("--scb-keyfigure-card-spacing-block-end", o) : this.style.removeProperty("--scb-keyfigure-card-spacing-block-end");
83
+ };
71
84
  i.__iconLoaded = !1;
72
85
  i.__rippleLoaded = !1;
73
- i.styles = p`
86
+ i.styles = u`
74
87
  :host {
75
88
  display: block;
76
89
  box-sizing: border-box;
@@ -78,6 +91,8 @@ i.styles = p`
78
91
  inline-size: 100%;
79
92
  min-inline-size: 0;
80
93
  padding: var(--scb-keyfigure-card-focus-ring-gap, 4px);
94
+ margin-block-start: var(--scb-keyfigure-card-spacing-block-start, 0);
95
+ margin-block-end: var(--scb-keyfigure-card-spacing-block-end, 0);
81
96
  }
82
97
 
83
98
  /* Ska vi ha tabulära eller inte? */
@@ -187,44 +202,53 @@ i.styles = p`
187
202
  letter-spacing: var(--md-sys-typescale-display-medium-tracking);
188
203
  }
189
204
  `;
190
- t([
191
- s({ attribute: "keyfigure" })
205
+ s([
206
+ a({ attribute: "keyfigure" })
192
207
  ], i.prototype, "keyfigure", 2);
193
- t([
194
- s({ type: String, attribute: "subtitle" })
208
+ s([
209
+ a({ type: String, attribute: "subtitle" })
195
210
  ], i.prototype, "subtitle", 2);
196
- t([
197
- s({ type: String, attribute: "supporting-text" })
211
+ s([
212
+ a({ type: String, attribute: "supporting-text" })
198
213
  ], i.prototype, "supportingText", 2);
199
- t([
200
- s({ type: String, attribute: "card-href" })
214
+ s([
215
+ a({ type: String, attribute: "card-href" })
201
216
  ], i.prototype, "cardHref", 2);
202
- t([
203
- s({ type: String })
217
+ s([
218
+ a({ type: String })
204
219
  ], i.prototype, "icon", 2);
205
- t([
206
- s({ type: String })
220
+ s([
221
+ a({ type: String })
207
222
  ], i.prototype, "size", 2);
208
- t([
209
- s({ type: String })
223
+ s([
224
+ a({ type: String })
210
225
  ], i.prototype, "unit", 2);
211
- t([
212
- s({ type: String, reflect: !0 })
226
+ s([
227
+ a({ type: String, reflect: !0 })
213
228
  ], i.prototype, "width", 2);
214
- t([
215
- s({ type: String, reflect: !0, attribute: "max-width" })
229
+ s([
230
+ a({ type: String, reflect: !0, attribute: "max-width" })
216
231
  ], i.prototype, "maxWidth", 2);
217
- t([
218
- s({ type: String, reflect: !0 })
232
+ s([
233
+ a({ type: String, reflect: !0 })
219
234
  ], i.prototype, "height", 2);
220
- t([
221
- s({ type: String, reflect: !0, attribute: "max-height" })
235
+ s([
236
+ a({ type: String, reflect: !0, attribute: "max-height" })
222
237
  ], i.prototype, "maxHeight", 2);
223
- t([
224
- s({ type: String, reflect: !0 })
238
+ s([
239
+ a({ type: String, reflect: !0 })
225
240
  ], i.prototype, "sizing", 2);
226
- i = t([
227
- u("scb-keyfigure-card")
241
+ s([
242
+ a({ type: String, reflect: !0 })
243
+ ], i.prototype, "spacing", 2);
244
+ s([
245
+ a({ type: String, reflect: !0, attribute: "spacing-top" })
246
+ ], i.prototype, "spacingTop", 2);
247
+ s([
248
+ a({ type: String, reflect: !0, attribute: "spacing-bottom" })
249
+ ], i.prototype, "spacingBottom", 2);
250
+ i = s([
251
+ m("scb-keyfigure-card")
228
252
  ], i);
229
253
  export {
230
254
  i as ScbKeyFigureCard
@@ -1,13 +1,19 @@
1
- import { LitElement, TemplateResult } from 'lit';
1
+ import { LitElement, TemplateResult, PropertyValues } from 'lit';
2
2
  export declare class ScbList extends LitElement {
3
3
  #private;
4
4
  noDivider: boolean;
5
+ spacing: string;
6
+ spacingTop: string;
7
+ spacingBottom: string;
5
8
  private _slotEl;
6
9
  protected firstUpdated(): Promise<void>;
10
+ protected updated(changed: PropertyValues): void;
7
11
  private _onSlotChange;
8
12
  private _getItems;
9
13
  private _setupItems;
10
14
  private _onKeyDown;
15
+ private _mapSpacingToken;
16
+ private _applySpacing;
11
17
  static styles: import('lit').CSSResult[];
12
18
  render(): TemplateResult;
13
19
  }
@@ -1,69 +1,82 @@
1
- import { css as v, LitElement as f, html as u } from "lit";
2
- import { property as m, query as _, customElement as b } from "lit/decorators.js";
1
+ import { css as g, LitElement as u, html as f } from "lit";
2
+ import { property as c, query as v, customElement as _ } from "lit/decorators.js";
3
3
  import "./scb-list-item.js";
4
- var g = Object.defineProperty, y = Object.getOwnPropertyDescriptor, c = (e) => {
4
+ var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, d = (e) => {
5
5
  throw TypeError(e);
6
- }, l = (e, t, r, s) => {
7
- for (var i = s > 1 ? void 0 : s ? y(t, r) : t, o = e.length - 1, a; o >= 0; o--)
8
- (a = e[o]) && (i = (s ? a(t, r, i) : a(i)) || i);
9
- return s && i && g(t, r, i), i;
10
- }, p = (e, t, r) => t.has(e) || c("Cannot " + r), w = (e, t, r) => (p(e, t, "read from private field"), t.get(e)), A = (e, t, r) => t.has(e) ? c("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), k = (e, t, r, s) => (p(e, t, "write to private field"), t.set(e, r), r), d;
11
- let n = class extends f {
6
+ }, o = (e, t, s, r) => {
7
+ for (var i = r > 1 ? void 0 : r ? y(t, s) : t, p = e.length - 1, n; p >= 0; p--)
8
+ (n = e[p]) && (i = (r ? n(t, s, i) : n(i)) || i);
9
+ return r && i && b(t, s, i), i;
10
+ }, h = (e, t, s) => t.has(e) || d("Cannot " + s), k = (e, t, s) => (h(e, t, "read from private field"), t.get(e)), S = (e, t, s) => t.has(e) ? d("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), w = (e, t, s, r) => (h(e, t, "write to private field"), t.set(e, s), s), l;
11
+ let a = class extends u {
12
12
  constructor() {
13
- super(...arguments), A(this, d, !1), this.noDivider = !1, this._onSlotChange = () => this._setupItems();
13
+ super(...arguments), S(this, l, !1), this.noDivider = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this._onSlotChange = () => this._setupItems();
14
14
  }
15
15
  async firstUpdated() {
16
- w(this, d) || (await import("@material/web/list/list.js"), k(this, d, !0)), this._setupItems();
16
+ k(this, l) || (await import("@material/web/list/list.js"), w(this, l, !0)), this._setupItems(), this._applySpacing();
17
+ }
18
+ updated(e) {
19
+ super.updated(e), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom")) && this._applySpacing();
17
20
  }
18
21
  _getItems() {
19
22
  var t;
20
- return (((t = this._slotEl) == null ? void 0 : t.assignedElements({ flatten: !0 })) ?? []).filter((r) => r instanceof HTMLElement);
23
+ return (((t = this._slotEl) == null ? void 0 : t.assignedElements({ flatten: !0 })) ?? []).filter((s) => s instanceof HTMLElement);
21
24
  }
22
25
  _setupItems() {
23
- var r;
24
- this._getItems().forEach((s, i) => {
25
- s.hasAttribute("role") || s.setAttribute("role", "listitem"), s.setAttribute("tabindex", i === 0 ? "0" : "-1");
26
+ var s;
27
+ this._getItems().forEach((r, i) => {
28
+ r.hasAttribute("role") || r.setAttribute("role", "listitem"), r.setAttribute("tabindex", i === 0 ? "0" : "-1");
26
29
  });
27
- const t = (r = this.renderRoot) == null ? void 0 : r.querySelector("md-list");
28
- t && !t.hasAttribute("data-kbd") && (t.setAttribute("data-kbd", "true"), t.addEventListener("keydown", (s) => this._onKeyDown(s)));
30
+ const t = (s = this.renderRoot) == null ? void 0 : s.querySelector("md-list");
31
+ t && !t.hasAttribute("data-kbd") && (t.setAttribute("data-kbd", "true"), t.addEventListener("keydown", (r) => this._onKeyDown(r)));
29
32
  }
30
33
  _onKeyDown(e) {
31
34
  const t = this._getItems();
32
35
  if (!t.length) return;
33
- const r = t.findIndex((i) => i.getAttribute("tabindex") === "0"), s = (i) => {
34
- const o = (i % t.length + t.length) % t.length;
35
- t.forEach((h) => h.setAttribute("tabindex", "-1"));
36
- const a = t[o];
37
- a.setAttribute("tabindex", "0"), a.focus();
36
+ const s = t.findIndex((i) => i.getAttribute("tabindex") === "0"), r = (i) => {
37
+ const p = (i % t.length + t.length) % t.length;
38
+ t.forEach((m) => m.setAttribute("tabindex", "-1"));
39
+ const n = t[p];
40
+ n.setAttribute("tabindex", "0"), n.focus();
38
41
  };
39
42
  switch (e.key) {
40
43
  case "ArrowDown":
41
44
  case "ArrowRight":
42
- e.preventDefault(), s(r < 0 ? 0 : r + 1);
45
+ e.preventDefault(), r(s < 0 ? 0 : s + 1);
43
46
  break;
44
47
  case "ArrowUp":
45
48
  case "ArrowLeft":
46
- e.preventDefault(), s(r < 0 ? 0 : r - 1);
49
+ e.preventDefault(), r(s < 0 ? 0 : s - 1);
47
50
  break;
48
51
  case "Home":
49
- e.preventDefault(), s(0);
52
+ e.preventDefault(), r(0);
50
53
  break;
51
54
  case "End":
52
- e.preventDefault(), s(t.length - 1);
55
+ e.preventDefault(), r(t.length - 1);
53
56
  break;
54
57
  }
55
58
  }
59
+ _mapSpacingToken(e) {
60
+ if (!e) return;
61
+ const t = String(e).trim();
62
+ if (t)
63
+ return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
64
+ }
65
+ _applySpacing() {
66
+ const e = this._mapSpacingToken(this.spacing), t = this._mapSpacingToken(this.spacingTop) ?? e, s = this._mapSpacingToken(this.spacingBottom) ?? e;
67
+ t ? this.style.marginBlockStart = t : this.style.removeProperty("margin-block-start"), s ? this.style.marginBlockEnd = s : this.style.removeProperty("margin-block-end");
68
+ }
56
69
  render() {
57
- return u`
70
+ return f`
58
71
  <md-list role="list" @slotchange=${this._onSlotChange}>
59
72
  <slot></slot>
60
73
  </md-list>
61
74
  `;
62
75
  }
63
76
  };
64
- d = /* @__PURE__ */ new WeakMap();
65
- n.styles = [
66
- v`
77
+ l = /* @__PURE__ */ new WeakMap();
78
+ a.styles = [
79
+ g`
67
80
  :host {
68
81
  display: block;
69
82
  --scb-list-bg: transparent;
@@ -85,15 +98,24 @@ n.styles = [
85
98
  }
86
99
  `
87
100
  ];
88
- l([
89
- m({ type: Boolean, attribute: "no-divider", reflect: !0 })
90
- ], n.prototype, "noDivider", 2);
91
- l([
92
- _("slot")
93
- ], n.prototype, "_slotEl", 2);
94
- n = l([
95
- b("scb-list")
96
- ], n);
101
+ o([
102
+ c({ type: Boolean, attribute: "no-divider", reflect: !0 })
103
+ ], a.prototype, "noDivider", 2);
104
+ o([
105
+ c({ type: String, reflect: !0 })
106
+ ], a.prototype, "spacing", 2);
107
+ o([
108
+ c({ type: String, reflect: !0, attribute: "spacing-top" })
109
+ ], a.prototype, "spacingTop", 2);
110
+ o([
111
+ c({ type: String, reflect: !0, attribute: "spacing-bottom" })
112
+ ], a.prototype, "spacingBottom", 2);
113
+ o([
114
+ v("slot")
115
+ ], a.prototype, "_slotEl", 2);
116
+ a = o([
117
+ _("scb-list")
118
+ ], a);
97
119
  export {
98
- n as ScbList
120
+ a as ScbList
99
121
  };
@@ -20,9 +20,14 @@ export declare class ScbNotificationCard extends LitElement {
20
20
  maxHeight: string;
21
21
  fullHeight: boolean;
22
22
  fullWidth: boolean;
23
+ spacing: string;
24
+ spacingTop: string;
25
+ spacingBottom: string;
23
26
  static styles: import('lit').CSSResult[];
24
27
  private _iconForVariant;
25
28
  private _closeNotification;
29
+ private __resolveSpacingToken;
30
+ private __applySpacing;
26
31
  protected updated(changed: PropertyValues): void;
27
32
  render(): import('lit-html').TemplateResult<1>;
28
33
  }