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,64 +1,141 @@
1
- import { css as u, LitElement as c, html as m } from "lit";
2
- import { property as n, customElement as h } from "lit/decorators.js";
1
+ import { css as p, LitElement as f, html as v } from "lit";
2
+ import { property as o, customElement as b } from "lit/decorators.js";
3
3
  import "./scb-segmented-item.js";
4
- var b = Object.defineProperty, f = Object.getOwnPropertyDescriptor, d = (r, i, e, t) => {
5
- for (var s = t > 1 ? void 0 : t ? f(i, e) : i, o = r.length - 1, a; o >= 0; o--)
6
- (a = r[o]) && (s = (t ? a(i, e, s) : a(s)) || s);
7
- return t && s && b(i, e, s), s;
8
- };
9
- let l = class extends c {
4
+ var g = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, m = (t) => {
5
+ throw TypeError(t);
6
+ }, l = (t, e, s, i) => {
7
+ for (var r = i > 1 ? void 0 : i ? _(e, s) : e, a = t.length - 1, d; a >= 0; a--)
8
+ (d = t[a]) && (r = (i ? d(e, s, r) : d(r)) || r);
9
+ return i && r && g(e, s, r), r;
10
+ }, y = (t, e, s) => e.has(t) || m("Cannot " + s), S = (t, e, s) => e.has(t) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s) => (y(t, e, "access private method"), s), u, h;
11
+ let n = class extends f {
10
12
  constructor() {
11
- super(...arguments), this.variant = "single-select", this.value = "", this.values = [], this.disabled = !1;
13
+ super(), S(this, u), this._internals = null, this.variant = "single-select", this.value = "", this.values = [], this.disabled = !1, this.name = "", this.spacing = "", this._form = null, this._formResetHandler = null, this._initialValue = "", this._initialValues = [], "attachInternals" in this && (this._internals = this.attachInternals());
12
14
  }
13
- onSlotClick(r) {
14
- let i = r.target;
15
- if (!i || !i.closest) return;
16
- const e = i.closest("scb-segmented-item");
17
- if (!e || this.disabled || e.hasAttribute("disabled")) return;
18
- const t = e.getAttribute("value") || "";
19
- t && (this.variant === "multi-select" ? (this.values.indexOf(t) === -1 ? this.values = [...this.values, t] : this.values = this.values.filter((o) => o !== t), this.dispatchEvent(new CustomEvent("change", { detail: { values: this.values }, bubbles: !0, composed: !0 })), this.updateSegments()) : t !== this.value && (this.value = t, this.dispatchEvent(new CustomEvent("change", { detail: { value: t }, bubbles: !0, composed: !0 })), this.updateSegments()));
15
+ connectedCallback() {
16
+ super.connectedCallback(), this._form = this.closest("form"), this._form && (this._formResetHandler = () => {
17
+ this.value = this._initialValue, this.values = Array.isArray(this._initialValues) ? [...this._initialValues] : [], this.updateSegments(), this._syncFormValue();
18
+ }, this._form.addEventListener("reset", this._formResetHandler, !0));
20
19
  }
21
- updateSegments() {
20
+ disconnectedCallback() {
21
+ this._form && this._formResetHandler && this._form.removeEventListener("reset", this._formResetHandler, !0), super.disconnectedCallback();
22
+ }
23
+ firstUpdated() {
22
24
  var e;
23
- const r = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot");
24
- if (!r) return;
25
- r.assignedElements().forEach((t) => {
26
- if (t.tagName === "SCB-SEGMENTED-ITEM") {
27
- const s = t.getAttribute("value") || "";
28
- if (s) {
29
- let o = !1;
30
- this.variant === "multi-select" ? o = !!this.values && this.values.includes(s) : o = s === this.value, t.setAttribute("aria-pressed", o ? "true" : "false"), o ? t.setAttribute("selected", "true") : t.removeAttribute("selected");
25
+ this._initialValue = this.value, this._initialValues = Array.isArray(this.values) ? [...this.values] : [], this.updateSegments();
26
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot");
27
+ t && (t.addEventListener("click", (s) => this.onSlotClick(s)), t.addEventListener(
28
+ "focus",
29
+ () => {
30
+ this.dispatchEvent(
31
+ new CustomEvent("focus", { detail: {}, bubbles: !0, composed: !0 })
32
+ );
33
+ },
34
+ !0
35
+ ), t.addEventListener(
36
+ "blur",
37
+ () => {
38
+ this.dispatchEvent(
39
+ new CustomEvent("blur", { detail: {}, bubbles: !0, composed: !0 })
40
+ );
41
+ },
42
+ !0
43
+ ), t.addEventListener("keydown", (s) => {
44
+ if (s.code === "Space" || s.code === "Enter" || s.code === "NumpadEnter") {
45
+ const i = s.target;
46
+ if (i && i.closest) {
47
+ const r = i.closest("scb-segmented-item");
48
+ r && !r.hasAttribute("disabled") && !this.disabled && (this.onSlotClick(s), s.preventDefault());
49
+ }
50
+ }
51
+ })), this._syncFormValue(), c(this, u, h).call(this);
52
+ }
53
+ updated(t) {
54
+ super.updated(t), this.updateSegments(), (t.has("value") || t.has("values") || t.has("disabled") || t.has("variant") || t.has("name")) && this._syncFormValue(), t.has("spacing") && c(this, u, h).call(this);
55
+ }
56
+ onSlotClick(t) {
57
+ let e = t.target;
58
+ if (!e || !e.closest) return;
59
+ const s = e.closest("scb-segmented-item");
60
+ if (!s || this.disabled || s.hasAttribute("disabled")) return;
61
+ const i = s.getAttribute("value") || "";
62
+ i && (this.variant === "multi-select" ? (this.values.indexOf(i) === -1 ? this.values = [...this.values, i] : this.values = this.values.filter((a) => a !== i), this.dispatchEvent(
63
+ new CustomEvent("change", {
64
+ detail: { values: this.values },
65
+ bubbles: !0,
66
+ composed: !0
67
+ })
68
+ ), this.updateSegments()) : i !== this.value && (this.value = i, this.dispatchEvent(
69
+ new CustomEvent("change", { detail: { value: i }, bubbles: !0, composed: !0 })
70
+ ), this.updateSegments()));
71
+ }
72
+ updateSegments() {
73
+ var s;
74
+ const t = (s = this.shadowRoot) == null ? void 0 : s.querySelector("slot");
75
+ if (!t) return;
76
+ t.assignedElements().forEach((i) => {
77
+ if (i.tagName === "SCB-SEGMENTED-ITEM") {
78
+ const r = i.getAttribute("value") || "";
79
+ if (r) {
80
+ let a = !1;
81
+ this.variant === "multi-select" ? a = !!this.values && this.values.includes(r) : a = r === this.value, i.setAttribute("aria-pressed", a ? "true" : "false"), a ? i.setAttribute("selected", "true") : i.removeAttribute("selected");
31
82
  }
32
- this.disabled && t.setAttribute("disabled", "true");
83
+ this.disabled && i.setAttribute("disabled", "true");
33
84
  }
34
85
  });
35
86
  }
36
- firstUpdated() {
37
- var i;
38
- this.updateSegments();
39
- const r = (i = this.shadowRoot) == null ? void 0 : i.querySelector("slot");
40
- r && (r.addEventListener("click", (e) => this.onSlotClick(e)), r.addEventListener("focus", () => {
41
- this.dispatchEvent(new CustomEvent("focus", { detail: {}, bubbles: !0, composed: !0 }));
42
- }, !0), r.addEventListener("blur", () => {
43
- this.dispatchEvent(new CustomEvent("blur", { detail: {}, bubbles: !0, composed: !0 }));
44
- }, !0), r.addEventListener("keydown", (e) => {
45
- if (e.code === "Space" || e.code === "Enter" || e.code === "NumpadEnter") {
46
- const t = e.target;
47
- if (t && t.closest) {
48
- const s = t.closest("scb-segmented-item");
49
- s && !s.hasAttribute("disabled") && !this.disabled && (this.onSlotClick(e), e.preventDefault());
87
+ /**
88
+ * Gör så att native formulär kan sätta disabled på kontrollen.
89
+ */
90
+ formDisabledCallback(t) {
91
+ this.disabled = t;
92
+ }
93
+ /**
94
+ * Synkar value/values FormData via ElementInternals.
95
+ * single-select: FormData.get(name) string
96
+ * multi-select: FormData.getAll(name) string[]
97
+ */
98
+ _syncFormValue() {
99
+ if (this._internals) {
100
+ if (this.disabled || !this.name) {
101
+ this._internals.setFormValue(null);
102
+ return;
103
+ }
104
+ if (this.variant === "multi-select") {
105
+ if (!this.values || this.values.length === 0) {
106
+ this._internals.setFormValue(null);
107
+ return;
108
+ }
109
+ const t = new FormData();
110
+ for (const e of this.values)
111
+ t.append(this.name, e);
112
+ this._internals.setFormValue(t);
113
+ } else {
114
+ if (!this.value) {
115
+ this._internals.setFormValue(null);
116
+ return;
50
117
  }
118
+ this._internals.setFormValue(this.value);
51
119
  }
52
- }));
120
+ }
53
121
  }
54
- updated() {
55
- this.updateSegments();
122
+ mapSpacingToken(t) {
123
+ if (!t) return;
124
+ const e = String(t).trim();
125
+ if (e)
126
+ return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
56
127
  }
57
128
  render() {
58
- return m`<slot></slot>`;
129
+ return v`<slot></slot>`;
59
130
  }
60
131
  };
61
- l.styles = u`
132
+ u = /* @__PURE__ */ new WeakSet();
133
+ h = function() {
134
+ const t = this.mapSpacingToken(this.spacing);
135
+ t ? this.style.setProperty("--scb-segmented-button-spacing-block", t) : this.style.removeProperty("--scb-segmented-button-spacing-block");
136
+ };
137
+ n.formAssociated = !0;
138
+ n.styles = p`
62
139
  :host {
63
140
  --scb-segmented-button-width: 100%;
64
141
  --scb-segmented-button-height: 48px;
@@ -68,6 +145,7 @@ l.styles = u`
68
145
  grid-auto-flow: column;
69
146
  grid-auto-columns: 1fr;
70
147
  font-family: var(--brand, Inter);
148
+ margin-block: var(--scb-segmented-button-spacing-block, 0);
71
149
  }
72
150
  /* Border radius only on first and last button */
73
151
  ::slotted(scb-segmented-item:first-child .segmented-item),
@@ -86,21 +164,27 @@ l.styles = u`
86
164
  border-left: 1px solid var(--md-sys-color-outline);
87
165
  }
88
166
  `;
89
- d([
90
- n({ type: String, reflect: !0 })
91
- ], l.prototype, "variant", 2);
92
- d([
93
- n({ type: String, reflect: !0 })
94
- ], l.prototype, "value", 2);
95
- d([
96
- n({ type: Array })
97
- ], l.prototype, "values", 2);
98
- d([
99
- n({ type: Boolean, reflect: !0 })
100
- ], l.prototype, "disabled", 2);
101
- l = d([
102
- h("scb-segmented-button")
103
- ], l);
167
+ l([
168
+ o({ type: String, reflect: !0 })
169
+ ], n.prototype, "variant", 2);
170
+ l([
171
+ o({ type: String, reflect: !0 })
172
+ ], n.prototype, "value", 2);
173
+ l([
174
+ o({ type: Array })
175
+ ], n.prototype, "values", 2);
176
+ l([
177
+ o({ type: Boolean, reflect: !0 })
178
+ ], n.prototype, "disabled", 2);
179
+ l([
180
+ o({ type: String, reflect: !0 })
181
+ ], n.prototype, "name", 2);
182
+ l([
183
+ o({ type: String, reflect: !0 })
184
+ ], n.prototype, "spacing", 2);
185
+ n = l([
186
+ b("scb-segmented-button")
187
+ ], n);
104
188
  export {
105
- l as ScbSegmentedButton
189
+ n as ScbSegmentedButton
106
190
  };
@@ -45,9 +45,9 @@ e.styles = h`
45
45
  .item.checked {
46
46
  background-color: var(--md-sys-color-secondary-container);
47
47
  }
48
- md-icon.radio-checked{
49
- color: var(--md-sys-color-primary);
50
- }
48
+ md-icon.radio-checked{
49
+ color: var(--md-sys-color-primary);
50
+ }
51
51
  `;
52
52
  o([
53
53
  s({ type: String })
@@ -1,8 +1,8 @@
1
1
  import { css as h, LitElement as p, html as d } from "lit";
2
- import { property as r, customElement as u } from "lit/decorators.js";
2
+ import { property as n, customElement as u } from "lit/decorators.js";
3
3
  import "./scb-select-option.js";
4
4
  import "@material/web/focus/md-focus-ring.js";
5
- var b = Object.defineProperty, v = Object.getOwnPropertyDescriptor, n = (e, i, o, t) => {
5
+ var b = Object.defineProperty, v = Object.getOwnPropertyDescriptor, r = (e, i, o, t) => {
6
6
  for (var s = t > 1 ? void 0 : t ? v(i, o) : i, c = e.length - 1, l; c >= 0; c--)
7
7
  (l = e[c]) && (s = (t ? l(i, o, s) : l(s)) || s);
8
8
  return t && s && b(i, o, s), s;
@@ -205,17 +205,17 @@ a.styles = h`
205
205
  .options::-webkit-scrollbar {
206
206
  width: 12px;
207
207
  background: var(--md-sys-color-surface);
208
- border-radius: 8px;
208
+ border-radius: var(--md-sys-shape-corner-small);
209
209
  }
210
210
  .options::-webkit-scrollbar-thumb {
211
211
  background: var(--md-sys-color-outline);
212
- border-radius: 8px;
212
+ border-radius: var(--md-sys-shape-corner-small);
213
213
  border: 4px solid var(--md-sys-color-surface);
214
214
 
215
215
  }
216
216
  .options::-webkit-scrollbar-track {
217
217
  background: var(--md-sys-color-surface);
218
- border-radius: 8px;
218
+ border-radius: var(--md-sys-shape-corner-small);
219
219
  }
220
220
  :host([open]) .options {
221
221
  max-height: 240px;
@@ -239,37 +239,37 @@ a.styles = h`
239
239
  }
240
240
 
241
241
  `;
242
- n([
243
- r({ type: String })
242
+ r([
243
+ n({ type: String })
244
244
  ], a.prototype, "variant", 2);
245
- n([
246
- r({ type: String })
245
+ r([
246
+ n({ type: String })
247
247
  ], a.prototype, "value", 2);
248
- n([
249
- r({ type: Array })
248
+ r([
249
+ n({ type: Array })
250
250
  ], a.prototype, "values", 2);
251
- n([
252
- r({ type: Boolean })
251
+ r([
252
+ n({ type: Boolean })
253
253
  ], a.prototype, "disabled", 2);
254
- n([
255
- r({ type: Boolean, reflect: !0 })
254
+ r([
255
+ n({ type: Boolean, reflect: !0 })
256
256
  ], a.prototype, "open", 2);
257
- n([
258
- r({ type: String })
257
+ r([
258
+ n({ type: String })
259
259
  ], a.prototype, "label", 2);
260
- n([
261
- r({ type: String })
260
+ r([
261
+ n({ type: String })
262
262
  ], a.prototype, "name", 2);
263
- n([
264
- r({ type: String })
263
+ r([
264
+ n({ type: String })
265
265
  ], a.prototype, "placeholder", 2);
266
- n([
267
- r({ type: String, attribute: "supporting-text" })
266
+ r([
267
+ n({ type: String, attribute: "supporting-text" })
268
268
  ], a.prototype, "supportingText", 2);
269
- n([
270
- r({ type: Boolean, attribute: "with-radiobuttons" })
269
+ r([
270
+ n({ type: Boolean, attribute: "with-radiobuttons" })
271
271
  ], a.prototype, "withRadiobuttons", 2);
272
- a = n([
272
+ a = r([
273
273
  u("scb-select")
274
274
  ], a);
275
275
  export {
@@ -1,8 +1,19 @@
1
- import { LitElement } from 'lit';
1
+ import { LitElement, PropertyValues } from 'lit';
2
2
  export declare class ScbStatusPill extends LitElement {
3
3
  status: string;
4
4
  label: string;
5
5
  showIcon: boolean;
6
+ spacing: string;
7
+ spacingTop: string;
8
+ spacingBottom: string;
6
9
  static styles: import('lit').CSSResult;
10
+ private __resolveSpacingToken;
11
+ private __applySpacing;
12
+ protected updated(changed: PropertyValues): void;
7
13
  render(): import('lit-html').TemplateResult<1>;
8
14
  }
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'scb-status-pill': ScbStatusPill;
18
+ }
19
+ }
@@ -1,19 +1,30 @@
1
- import { css as m, LitElement as d, html as o } from "lit";
2
- import { property as l, customElement as u } from "lit/decorators.js";
1
+ import { css as m, LitElement as g, html as a } from "lit";
2
+ import { property as i, customElement as h } from "lit/decorators.js";
3
3
  import "@material/web/icon/icon.js";
4
- var h = Object.defineProperty, y = Object.getOwnPropertyDescriptor, n = (p, r, a, t) => {
5
- for (var s = t > 1 ? void 0 : t ? y(r, a) : r, i = p.length - 1, c; i >= 0; i--)
6
- (c = p[i]) && (s = (t ? c(r, a, s) : c(s)) || s);
7
- return t && s && h(r, a, s), s;
4
+ var u = Object.defineProperty, y = Object.getOwnPropertyDescriptor, o = (t, s, c, n) => {
5
+ for (var r = n > 1 ? void 0 : n ? y(s, c) : s, p = t.length - 1, l; p >= 0; p--)
6
+ (l = t[p]) && (r = (n ? l(s, c, r) : l(r)) || r);
7
+ return n && r && u(s, c, r), r;
8
8
  };
9
- let e = class extends d {
9
+ let e = class extends g {
10
10
  constructor() {
11
- super(...arguments), this.status = "", this.label = "", this.showIcon = !1;
11
+ super(...arguments), this.status = "", this.label = "", this.showIcon = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
12
+ }
13
+ __resolveSpacingToken(t) {
14
+ const s = (t ?? "").trim();
15
+ return s ? /^(?:[0-9]|1[0-4])$/.test(s) ? `var(--spacing-${s})` : s : "";
16
+ }
17
+ __applySpacing() {
18
+ const t = this.__resolveSpacingToken(this.spacingTop || this.spacing), s = this.__resolveSpacingToken(this.spacingBottom || this.spacing);
19
+ t ? this.style.marginBlockStart = t : this.style.removeProperty("margin-block-start"), s ? this.style.marginBlockEnd = s : this.style.removeProperty("margin-block-end");
20
+ }
21
+ updated(t) {
22
+ super.updated(t), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && this.__applySpacing();
12
23
  }
13
24
  render() {
14
- return o`
15
- ${this.showIcon ? this.status === "success" ? o`<md-icon>check_circle</md-icon>` : this.status === "warning" ? o`<md-icon>warning</md-icon>` : this.status === "error" ? o`<md-icon>error</md-icon>` : "" : ""}
16
- <span class="label">${this.label}</span>
25
+ return a`
26
+ ${this.showIcon ? this.status === "success" ? a`<md-icon>check_circle</md-icon>` : this.status === "warning" ? a`<md-icon>warning</md-icon>` : this.status === "error" ? a`<md-icon>error</md-icon>` : "" : ""}
27
+ <span class="label">${this.label}</span>
17
28
  `;
18
29
  }
19
30
  };
@@ -30,36 +41,49 @@ e.styles = m`
30
41
  gap: var(--spacing-3);
31
42
  width: fit-content;
32
43
  }
33
- .label{
44
+
45
+ .label {
34
46
  font-size: var(--md-sys-typescale-label-medium-size);
35
47
  line-height: var(--md-sys-typescale-label-medium-line-height);
36
48
  font-weight: var(--md-sys-typescale-label-medium-weight);
37
49
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
38
50
  }
39
- :host([status="success"]) {
40
- background: var(--md-sys-color-success-container);
41
- color: var(--md-sys-color-on-success-container);
51
+
52
+ :host([status='success']) {
53
+ background: var(--md-sys-color-success-container);
54
+ color: var(--md-sys-color-on-success-container);
42
55
  }
43
- :host([status="warning"]) {
56
+
57
+ :host([status='warning']) {
44
58
  background: var(--md-sys-color-warning-container);
45
59
  color: var(--md-sys-color-on-warning-container);
46
60
  }
47
- :host([status="error"]) {
48
- background: var(--md-sys-color-error-container);
49
- color: var(--md-sys-color-on-error-container);
61
+
62
+ :host([status='error']) {
63
+ background: var(--md-sys-color-error-container);
64
+ color: var(--md-sys-color-on-error-container);
50
65
  }
51
66
  `;
52
- n([
53
- l({ type: String })
67
+ o([
68
+ i({ type: String })
54
69
  ], e.prototype, "status", 2);
55
- n([
56
- l({ type: String })
70
+ o([
71
+ i({ type: String })
57
72
  ], e.prototype, "label", 2);
58
- n([
59
- l({ type: Boolean, attribute: "show-icon" })
73
+ o([
74
+ i({ type: Boolean, attribute: "show-icon" })
60
75
  ], e.prototype, "showIcon", 2);
61
- e = n([
62
- u("scb-status-pill")
76
+ o([
77
+ i({ type: String })
78
+ ], e.prototype, "spacing", 2);
79
+ o([
80
+ i({ type: String, attribute: "spacing-top" })
81
+ ], e.prototype, "spacingTop", 2);
82
+ o([
83
+ i({ type: String, attribute: "spacing-bottom" })
84
+ ], e.prototype, "spacingBottom", 2);
85
+ e = o([
86
+ h("scb-status-pill")
63
87
  ], e);
64
88
  export {
65
89
  e as ScbStatusPill
@@ -1,14 +1,22 @@
1
- import { LitElement } from 'lit';
1
+ import { LitElement, PropertyValues } from 'lit';
2
2
  /**
3
3
  * En stepper-komponent enligt SCB-standard.
4
4
  * @slot - Innehåll för stegen
5
5
  */
6
6
  export declare class ScbStepper extends LitElement {
7
+ #private;
7
8
  type: string;
8
9
  label: string;
9
10
  changeOnCompleted: boolean;
10
11
  variant: 'horizontal' | 'vertical';
11
12
  symbolVariant: 'number' | 'icon' | 'marker';
13
+ /**
14
+ * Vertikalt avstånd mot omgivande innehåll.
15
+ * spacing sätter både top och bottom om spacing-top / spacing-bottom inte är satta.
16
+ */
17
+ spacing: string;
18
+ spacingTop: string;
19
+ spacingBottom: string;
12
20
  private activeIndex;
13
21
  static styles: import('lit').CSSResult;
14
22
  private _onStepClick;
@@ -26,8 +34,8 @@ export declare class ScbStepper extends LitElement {
26
34
  getActiveIndex(): number;
27
35
  private _updateSteps;
28
36
  private _getSteps;
29
- firstUpdated(): void;
30
- updated(): void;
37
+ protected firstUpdated(_changed: PropertyValues): void;
38
+ protected updated(changed: PropertyValues): void;
31
39
  render(): import('lit-html').TemplateResult<1>;
32
40
  private _onKeyNav;
33
41
  private _onStepContainerClick;