scb-wc-test 0.1.105 → 0.1.107

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 +16 -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 +15 -13
  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 +10 -1
  56. package/scb-icon-button/scb-icon-button.js +88 -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 +45 -4
  70. package/scb-segmented-button/scb-segmented-button.js +163 -72
  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 +1184 -901
@@ -1,19 +1,21 @@
1
- import { css as h, LitElement as v, html as t } from "lit";
2
- import { property as r, customElement as m } from "lit/decorators.js";
1
+ import { css as y, LitElement as u, html as i } from "lit";
2
+ import { property as l, customElement as f } from "lit/decorators.js";
3
3
  import "../scb-chip/scb-chip.js";
4
4
  import "../scb-segmented-button/scb-segmented-button.js";
5
5
  import "../scb-segmented-button/scb-segmented-item.js";
6
6
  import "../scb-accordion/scb-accordion.js";
7
7
  import "../scb-divider/scb-divider.js";
8
8
  import "../scb-horizontal-scroller/scb-horizontal-scroller.js";
9
- var b = Object.defineProperty, p = Object.getOwnPropertyDescriptor, o = (i, s, c, l) => {
10
- for (var e = l > 1 ? void 0 : l ? p(s, c) : s, n = i.length - 1, d; n >= 0; n--)
11
- (d = i[n]) && (e = (l ? d(s, c, e) : d(e)) || e);
12
- return l && e && b(s, c, e), e;
13
- };
14
- let a = class extends v {
9
+ var $ = Object.defineProperty, S = Object.getOwnPropertyDescriptor, g = (t) => {
10
+ throw TypeError(t);
11
+ }, r = (t, e, s, c) => {
12
+ for (var d = c > 1 ? void 0 : c ? S(e, s) : e, n = t.length - 1, o; n >= 0; n--)
13
+ (o = t[n]) && (d = (c ? o(e, s, d) : o(d)) || d);
14
+ return c && d && $(e, s, d), d;
15
+ }, x = (t, e, s) => e.has(t) || g("Cannot " + s), w = (t, e, s) => e.has(t) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), p = (t, e, s) => (x(t, e, "access private method"), s), h, b, v;
16
+ let a = class extends u {
15
17
  constructor() {
16
- super(...arguments), this.variant = "Standard", this.selectedChip = "Diagram", this.title = "", this.subtitle = "", this.description = "", this.comment = "", this.source = "", this.footnote = "", this.lang = "sv", this.imageHref = "";
18
+ super(...arguments), w(this, h), this.variant = "Standard", this.selectedChip = "Diagram", this.title = "", this.subtitle = "", this.description = "", this.comment = "", this.source = "", this.footnote = "", this.lang = "sv", this.imageHref = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
17
19
  }
18
20
  // Labels as getters so they react to lang changes
19
21
  get descriptionLabel() {
@@ -31,231 +33,251 @@ let a = class extends v {
31
33
  get footnoteLabel() {
32
34
  return this.lang === "en" ? "Footnotes" : "Fotnot";
33
35
  }
34
- firstUpdated() {
36
+ firstUpdated(t) {
35
37
  var s;
36
- const i = (s = this.shadowRoot) == null ? void 0 : s.querySelector('slot[name="table"]');
37
- i && (i.addEventListener("slotchange", () => this._styleSlottedTable()), this._styleSlottedTable());
38
+ const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector(
39
+ 'slot[name="table"]'
40
+ );
41
+ e && (e.addEventListener("slotchange", () => this._styleSlottedTable()), this._styleSlottedTable()), p(this, h, b).call(this);
38
42
  }
39
- updated() {
40
- this._styleSlottedTable();
43
+ updated(t) {
44
+ super.updated(t), this._styleSlottedTable(), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && p(this, h, b).call(this);
41
45
  }
42
46
  _styleSlottedTable() {
43
- var c;
44
- const i = (c = this.shadowRoot) == null ? void 0 : c.querySelector('slot[name="table"]');
45
- if (!i) return;
46
- i.assignedElements({ flatten: !0 }).forEach((l) => {
47
- l.tagName === "TABLE" && (l.style.borderCollapse = "collapse", l.style.width = "100%", l.querySelectorAll("tbody tr:nth-child(odd)").forEach((e) => {
48
- e.style.background = "var(--md-sys-color-surface-container)";
49
- }), l.querySelectorAll("th").forEach((e) => {
50
- e.style.border = "1px solid var(--md-sys-color-on-surface)", e.style.padding = "8px";
51
- }), l.querySelectorAll("td").forEach((e) => {
52
- e.style.border = "1px solid var(--md-sys-color-on-surface)", e.style.padding = "8px";
53
- }), l.querySelectorAll("tr").forEach((e) => {
54
- const n = Array.from(e.children).filter(
55
- (d) => d.tagName === "TD" || d.tagName === "TH"
56
- );
57
- n.length > 0 && (n[0].style.borderLeft = "none", n[n.length - 1].style.borderRight = "none");
58
- }));
47
+ var s;
48
+ const t = (s = this.shadowRoot) == null ? void 0 : s.querySelector(
49
+ 'slot[name="table"]'
50
+ );
51
+ if (!t) return;
52
+ t.assignedElements({ flatten: !0 }).forEach((c) => {
53
+ if (c.tagName === "TABLE") {
54
+ const d = c;
55
+ d.style.borderCollapse = "collapse", d.style.width = "100%", c.querySelectorAll("tbody tr:nth-child(odd)").forEach((n) => {
56
+ n.style.background = "var(--md-sys-color-surface-container)";
57
+ }), c.querySelectorAll("th").forEach((n) => {
58
+ const o = n;
59
+ o.style.border = "1px solid var(--md-sys-color-on-surface)", o.style.padding = "8px";
60
+ }), c.querySelectorAll("td").forEach((n) => {
61
+ const o = n;
62
+ o.style.border = "1px solid var(--md-sys-color-on-surface)", o.style.padding = "8px";
63
+ }), c.querySelectorAll("tr").forEach((n) => {
64
+ const o = Array.from(n.children).filter(
65
+ (m) => m.tagName === "TD" || m.tagName === "TH"
66
+ );
67
+ o.length > 0 && (o[0].style.borderLeft = "none", o[o.length - 1].style.borderRight = "none");
68
+ });
69
+ }
59
70
  });
60
71
  }
61
72
  render() {
62
73
  switch (this.variant) {
63
74
  case "Table":
64
- return t`
75
+ return i`
65
76
  <div part="container">
66
77
  <div class="header">
67
- ${this.title ? t`
68
- <div class="label">${this.title}</div>` : ""}
69
- ${this.subtitle ? t`
70
- <div class="subtitle">${this.subtitle}</div>` : ""}
78
+ ${this.title ? i` <div class="label">${this.title}</div> ` : ""}
79
+ ${this.subtitle ? i` <div class="subtitle">${this.subtitle}</div> ` : ""}
71
80
  </div>
72
81
  <div class="content">
73
- <scb-horizontal-scroller width="600px" class="table-scroller" variant="inline" show-scrollbar>
82
+ <scb-horizontal-scroller
83
+ width="600px"
84
+ class="table-scroller"
85
+ variant="inline"
86
+ show-scrollbar
87
+ >
74
88
  <slot name="table"></slot>
75
89
  </scb-horizontal-scroller>
76
90
  </div>
77
91
  <div class="footer">
78
- ${this.description ? t`
79
- <div class="description section">
80
- <div class="secondary-label">${this.descriptionLabel}</div>
81
- <div>${this.description}</div>
82
- </div>
83
- ` : ""}
84
- ${this.comment || this.source || this.footnote ? t`
85
- <scb-divider></scb-divider>
86
- <scb-accordion>
87
- <scb-accordion-item
88
- title="${this.moreAboutStatsLabel}"
89
- >
90
- <div class="more-about-stats-content">
91
- ${this.comment ? t`
92
- <div class="section">
93
- <div class="secondary-label">${this.commentLabel}</div>
94
- <div>${this.comment}</div>
95
- </div>
96
- ` : ""}
97
- ${this.source ? t`
98
- <div class="section">
99
-
100
- <div class="secondary-label">${this.sourceLabel}</div>
101
- <div>${this.source}</div>
102
- </div>` : ""}
103
- ${this.footnote ? t`
104
- <div class="section">
105
- <div class="secondary-label">${this.footnoteLabel}</div>
106
- <div>${this.footnote}</div>
92
+ ${this.description ? i`
93
+ <div class="description section">
94
+ <div class="secondary-label">${this.descriptionLabel}</div>
95
+ <div>${this.description}</div>
107
96
  </div>
108
- ` : ""}
109
- </div>
110
- </scb-accordion-item>
111
- </scb-accordion>
112
- ` : ""}
97
+ ` : ""}
98
+ ${this.comment || this.source || this.footnote ? i`
99
+ <scb-divider></scb-divider>
100
+ <scb-accordion>
101
+ <scb-accordion-item title="${this.moreAboutStatsLabel}">
102
+ <div class="more-about-stats-content">
103
+ ${this.comment ? i`
104
+ <div class="section">
105
+ <div class="secondary-label">${this.commentLabel}</div>
106
+ <div>${this.comment}</div>
107
+ </div>
108
+ ` : ""}
109
+ ${this.source ? i`
110
+ <div class="section">
111
+ <div class="secondary-label">${this.sourceLabel}</div>
112
+ <div>${this.source}</div>
113
+ </div>
114
+ ` : ""}
115
+ ${this.footnote ? i`
116
+ <div class="section">
117
+ <div class="secondary-label">${this.footnoteLabel}</div>
118
+ <div>${this.footnote}</div>
119
+ </div>
120
+ ` : ""}
121
+ </div>
122
+ </scb-accordion-item>
123
+ </scb-accordion>
124
+ ` : ""}
113
125
  </div>
114
126
  <slot></slot>
115
127
  </div>
116
128
  `;
117
129
  case "Image":
118
- return t`
130
+ return i`
119
131
  <div part="container">
120
132
  <div class="header">
121
- ${this.title ? t`
122
- <div class="label">${this.title}</div>
123
- ` : ""}
124
- ${this.subtitle ? t`
125
- <div class="subtitle">${this.subtitle}</div>
126
- ` : ""}
133
+ ${this.title ? i` <div class="label">${this.title}</div> ` : ""}
134
+ ${this.subtitle ? i` <div class="subtitle">${this.subtitle}</div> ` : ""}
127
135
  </div>
128
136
  <div class="content image-content">
129
- <img src="${this.imageHref}" alt="Image figure"/>
137
+ <img src="${this.imageHref}" alt="Image figure" />
130
138
  </div>
131
139
  <div class="footer">
132
- ${this.description ? t`
133
- <div class="description section">
134
- <div class="secondary-label">${this.descriptionLabel}</div>
135
- <div>${this.description}</div>
136
- </div>
137
- ` : ""}
138
- ${this.comment || this.source || this.footnote ? t`
139
- <scb-divider></scb-divider>
140
- <scb-accordion>
141
- <scb-accordion-item
142
- title="${this.moreAboutStatsLabel}"
143
- >
144
- <div class="more-about-stats-content">
145
- ${this.comment ? t`
146
- <div class="section">
147
- <div class="secondary-label">${this.commentLabel}</div>
148
- <div>${this.comment}</div>
149
- </div>
150
- ` : ""}
151
- ${this.source ? t`
152
- <div class="section">
153
- <div class="secondary-label">${this.sourceLabel}</div>
154
- <div>${this.source}</div>
155
- </div>
156
- ` : ""}
157
- ${this.footnote ? t`
158
- <div class="section">
159
- <div class="secondary-label">${this.footnoteLabel}</div>
160
- <div>${this.footnote}</div>
140
+ ${this.description ? i`
141
+ <div class="description section">
142
+ <div class="secondary-label">${this.descriptionLabel}</div>
143
+ <div>${this.description}</div>
161
144
  </div>
162
- ` : ""}
163
- </div>
164
- </scb-accordion-item>
165
- </scb-accordion>
166
- ` : ""}
145
+ ` : ""}
146
+ ${this.comment || this.source || this.footnote ? i`
147
+ <scb-divider></scb-divider>
148
+ <scb-accordion>
149
+ <scb-accordion-item title="${this.moreAboutStatsLabel}">
150
+ <div class="more-about-stats-content">
151
+ ${this.comment ? i`
152
+ <div class="section">
153
+ <div class="secondary-label">${this.commentLabel}</div>
154
+ <div>${this.comment}</div>
155
+ </div>
156
+ ` : ""}
157
+ ${this.source ? i`
158
+ <div class="section">
159
+ <div class="secondary-label">${this.sourceLabel}</div>
160
+ <div>${this.source}</div>
161
+ </div>
162
+ ` : ""}
163
+ ${this.footnote ? i`
164
+ <div class="section">
165
+ <div class="secondary-label">${this.footnoteLabel}</div>
166
+ <div>${this.footnote}</div>
167
+ </div>
168
+ ` : ""}
169
+ </div>
170
+ </scb-accordion-item>
171
+ </scb-accordion>
172
+ ` : ""}
167
173
  </div>
168
174
  <slot></slot>
169
175
  </div>
170
176
  `;
171
- default:
172
- const i = this.selectedChip === "Diagram" ? "chip-diagram" : this.selectedChip === "Table" ? "chip-table" : "";
173
- return this.className !== i && (this.className = i), t`
174
- <div part="container">
175
- <div class="header">
176
- ${this.title ? t`
177
- <div class="label">${this.title}</div>
178
- ` : ""}
179
- ${this.subtitle ? t`
180
- <div class="subtitle">${this.subtitle}</div>
181
- ` : ""}
182
- </div>
183
- ${this.variant === "Standard" ? t`
184
- <div class="flipp-wrapper">
185
- <scb-segmented-button
186
- .value=${this.selectedChip || ""}
187
- @change=${(s) => this._onSegmentedChange(s)}
188
- >
189
- <scb-segmented-item
190
- label=${this.lang === "en" ? "Figure" : "Diagram"}
191
- value="Diagram"
192
- icon="bar_chart"
193
- ></scb-segmented-item>
194
- <scb-segmented-item
195
- label="${this.lang === "en" ? "Table" : "Tabell"}"
196
- value="Table"
197
- icon="table"
198
- ></scb-segmented-item>
199
- </scb-segmented-button>
200
- </div>
201
- ` : ""}
202
- <div class="content">
203
- <scb-horizontal-scroller width="600px" class="diagram-scroller" variant="inline" show-scrollbar>
204
- <slot name="diagram"></slot>
205
- </scb-horizontal-scroller>
206
- <scb-horizontal-scroller width="600px" class="table-scroller" variant="inline" show-scrollbar>
207
- <slot name="table"></slot>
208
- </scb-horizontal-scroller>
209
- </div>
210
- <div class="footer">
211
- ${this.description ? t`
212
- <div class="description section">
213
- <div class="secondary-label">${this.descriptionLabel}</div>
214
- <div>${this.description}</div>
215
- </div>
216
- ` : ""}
217
- ${this.comment || this.source || this.footnote ? t`
218
- <scb-divider></scb-divider>
219
- <scb-accordion>
220
- <scb-accordion-item
221
- title="${this.moreAboutStatsLabel}"
177
+ default: {
178
+ const t = this.selectedChip === "Diagram" ? "chip-diagram" : this.selectedChip === "Table" ? "chip-table" : "";
179
+ return this.className !== t && (this.className = t), i`
180
+ <div part="container">
181
+ <div class="header">
182
+ ${this.title ? i` <div class="label">${this.title}</div> ` : ""}
183
+ ${this.subtitle ? i` <div class="subtitle">${this.subtitle}</div> ` : ""}
184
+ </div>
185
+ ${this.variant === "Standard" ? i`
186
+ <div class="flipp-wrapper">
187
+ <scb-segmented-button
188
+ .value=${this.selectedChip || ""}
189
+ @change=${(e) => this._onSegmentedChange(e)}
222
190
  >
223
- <div class="more-about-stats-content">
224
- ${this.comment ? t`
225
- <div class="section">
226
- <div class="secondary-label">${this.commentLabel}</div>
227
- <div>${this.comment}</div>
228
- </div>
229
- ` : ""}
230
- ${this.source ? t`
231
- <div class="section">
232
- <div class="secondary-label">${this.sourceLabel}</div>
233
- <div>${this.source}</div>
234
- </div>
235
- ` : ""}
236
- ${this.footnote ? t`
237
- <div class="section">
238
- <div class="secondary-label">${this.footnoteLabel}</div>
239
- <div>${this.footnote}</div>
240
- </div>
241
- ` : ""}
242
- </div>
243
- </scb-accordion-item>
244
- </scb-accordion>
191
+ <scb-segmented-item
192
+ label=${this.lang === "en" ? "Figure" : "Diagram"}
193
+ value="Diagram"
194
+ icon="bar_chart"
195
+ ></scb-segmented-item>
196
+ <scb-segmented-item
197
+ label="${this.lang === "en" ? "Table" : "Tabell"}"
198
+ value="Table"
199
+ icon="table"
200
+ ></scb-segmented-item>
201
+ </scb-segmented-button>
202
+ </div>
245
203
  ` : ""}
246
- </div>
247
- <slot></slot>
204
+ <div class="content">
205
+ <scb-horizontal-scroller
206
+ width="600px"
207
+ class="diagram-scroller"
208
+ variant="inline"
209
+ show-scrollbar
210
+ >
211
+ <slot name="diagram"></slot>
212
+ </scb-horizontal-scroller>
213
+ <scb-horizontal-scroller
214
+ width="600px"
215
+ class="table-scroller"
216
+ variant="inline"
217
+ show-scrollbar
218
+ >
219
+ <slot name="table"></slot>
220
+ </scb-horizontal-scroller>
248
221
  </div>
249
- `;
222
+ <div class="footer">
223
+ ${this.description ? i`
224
+ <div class="description section">
225
+ <div class="secondary-label">${this.descriptionLabel}</div>
226
+ <div>${this.description}</div>
227
+ </div>
228
+ ` : ""}
229
+ ${this.comment || this.source || this.footnote ? i`
230
+ <scb-divider></scb-divider>
231
+ <scb-accordion>
232
+ <scb-accordion-item title="${this.moreAboutStatsLabel}">
233
+ <div class="more-about-stats-content">
234
+ ${this.comment ? i`
235
+ <div class="section">
236
+ <div class="secondary-label">${this.commentLabel}</div>
237
+ <div>${this.comment}</div>
238
+ </div>
239
+ ` : ""}
240
+ ${this.source ? i`
241
+ <div class="section">
242
+ <div class="secondary-label">${this.sourceLabel}</div>
243
+ <div>${this.source}</div>
244
+ </div>
245
+ ` : ""}
246
+ ${this.footnote ? i`
247
+ <div class="section">
248
+ <div class="secondary-label">${this.footnoteLabel}</div>
249
+ <div>${this.footnote}</div>
250
+ </div>
251
+ ` : ""}
252
+ </div>
253
+ </scb-accordion-item>
254
+ </scb-accordion>
255
+ ` : ""}
256
+ </div>
257
+ <slot></slot>
258
+ </div>
259
+ `;
260
+ }
250
261
  }
251
262
  }
252
- _onSegmentedChange(i) {
253
- var c;
254
- const s = (c = i.detail) == null ? void 0 : c.value;
255
- this.selectedChip === s ? this.selectedChip = null : this.selectedChip = s;
263
+ _onSegmentedChange(t) {
264
+ var s;
265
+ const e = (s = t.detail) == null ? void 0 : s.value;
266
+ this.selectedChip === e ? this.selectedChip = null : this.selectedChip = e;
256
267
  }
257
268
  };
258
- a.styles = h`
269
+ h = /* @__PURE__ */ new WeakSet();
270
+ b = function() {
271
+ const t = p(this, h, v).call(this, this.spacing), e = p(this, h, v).call(this, this.spacingTop) ?? t, s = p(this, h, v).call(this, this.spacingBottom) ?? t;
272
+ e ? this.style.setProperty("--scb-viz-spacing-block-start", e) : this.style.removeProperty("--scb-viz-spacing-block-start"), s ? this.style.setProperty("--scb-viz-spacing-block-end", s) : this.style.removeProperty("--scb-viz-spacing-block-end");
273
+ };
274
+ v = function(t) {
275
+ if (!t) return;
276
+ const e = String(t).trim();
277
+ if (e)
278
+ return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
279
+ };
280
+ a.styles = y`
259
281
  :host {
260
282
  display: block;
261
283
  font-family: var(--brand-font);
@@ -265,8 +287,11 @@ a.styles = h`
265
287
  max-width: 100%;
266
288
  border-radius: var(--spacing-04, 16px);
267
289
  border: 1px solid var(--md-sys-color-outline-variant);
268
-
290
+ /* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
291
+ margin-block-start: var(--scb-viz-spacing-block-start, 0);
292
+ margin-block-end: var(--scb-viz-spacing-block-end, 0);
269
293
  }
294
+
270
295
  scb-segmented-button {
271
296
  --scb-segmented-button-height: var(--icon-size-small);
272
297
  }
@@ -277,65 +302,76 @@ a.styles = h`
277
302
  line-height: var(--md-sys-typescale-title-large-line-height);
278
303
  letter-spacing: var(--md-sys-typescale-title-large-tracking);
279
304
  }
280
- .sub-label{
305
+
306
+ .sub-label {
281
307
  font-size: var(--md-sys-typescale-body-large-size);
282
308
  line-height: var(--md-sys-typescale-body-large-line-height);
283
309
  letter-spacing: var(--md-sys-typescale-body-large-tracking);
284
310
  }
311
+
285
312
  .secondary-label {
286
313
  font-size: var(--md-sys-typescale-title-medium-size);
287
314
  font-weight: var(--weight-semibold);
288
315
  line-height: var(--md-sys-typescale-title-medium-line-height);
289
316
  letter-spacing: var(--md-sys-typescale-title-medium-tracking);
290
317
  }
318
+
291
319
  .section {
292
320
  display: flex;
293
321
  flex-direction: column;
294
- gap: var(--spacing-2);
322
+ gap: var(--spacing-2);
295
323
  }
324
+
296
325
  .more-about-stats-content {
297
326
  display: flex;
298
327
  flex-direction: column;
299
328
  gap: var(--spacing-7);
300
- max-width: 600px
329
+ max-width: 600px;
301
330
  }
331
+
302
332
  .header {
303
333
  margin-bottom: var(--spacing-7);
304
- max-width: 600px
334
+ max-width: 600px;
305
335
  }
336
+
306
337
  .flipp-wrapper {
307
338
  margin-bottom: var(--spacing-9);
308
- max-width: 234px
339
+ max-width: 234px;
309
340
  }
310
- .description{
341
+
342
+ .description {
311
343
  margin-bottom: var(--spacing-8);
312
344
  }
345
+
313
346
  .footer {
314
347
  margin-top: var(--spacing-7);
315
-
316
348
  }
317
- .description.section{
318
- max-width: 600px
349
+
350
+ .description.section {
351
+ max-width: 600px;
319
352
  }
353
+
320
354
  .table-scroller,
321
355
  .diagram-scroller {
322
356
  display: none;
323
357
  }
324
- :host([variant='Table']) slot[name="table"] {
358
+
359
+ :host([variant='Table']) slot[name='table'] {
325
360
  display: block;
326
361
  }
327
362
  :host([variant='Table']) .table-scroller {
328
363
  display: flex;
329
364
  }
365
+
330
366
  :host([variant='Image']) {
331
367
  img {
332
368
  height: auto;
333
369
  max-width: 100%;
334
370
  }
335
- slot[name="table"] {
371
+ slot[name='table'] {
336
372
  display: none;
337
373
  }
338
- slot[name="diagram"] {
374
+ slot[name='diagram'] {
339
375
  display: none;
340
376
  }
341
377
  .image-content {
@@ -352,57 +388,63 @@ a.styles = h`
352
388
  :host([variant='Standard'].chip-diagram) .diagram-scroller {
353
389
  display: flex;
354
390
  }
355
- :host([variant='Standard'].chip-table) .table-scroller {
391
+ :host([variant='Standard'].chip-table) .table-scroller {
356
392
  display: flex;
357
393
  }
358
- :host([variant='Standard'].chip-table) slot[name="table"] {
394
+ :host([variant='Standard'].chip-table) slot[name='table'] {
359
395
  display: block;
360
396
  }
361
- :host([variant='Standard'].chip-table) slot[name="diagram"] {
397
+ :host([variant='Standard'].chip-table) slot[name='diagram'] {
362
398
  display: none;
363
399
  }
364
- :host([variant='Standard'].chip-diagram) slot[name="table"] {
400
+ :host([variant='Standard'].chip-diagram) slot[name='table'] {
365
401
  display: none;
366
402
  }
367
- :host([variant='Standard'].chip-diagram) slot[name="diagram"] {
403
+ :host([variant='Standard'].chip-diagram) slot[name='diagram'] {
368
404
  display: block;
369
405
  }
370
-
371
-
372
-
373
406
  `;
374
- o([
375
- r({ type: String, reflect: !0 })
407
+ r([
408
+ l({ type: String, reflect: !0 })
376
409
  ], a.prototype, "variant", 2);
377
- o([
378
- r({ type: String })
410
+ r([
411
+ l({ type: String })
379
412
  ], a.prototype, "selectedChip", 2);
380
- o([
381
- r({ type: String, reflect: !0 })
413
+ r([
414
+ l({ type: String, reflect: !0 })
382
415
  ], a.prototype, "title", 2);
383
- o([
384
- r({ type: String, reflect: !0 })
416
+ r([
417
+ l({ type: String, reflect: !0 })
385
418
  ], a.prototype, "subtitle", 2);
386
- o([
387
- r({ type: String, reflect: !0 })
419
+ r([
420
+ l({ type: String, reflect: !0 })
388
421
  ], a.prototype, "description", 2);
389
- o([
390
- r({ type: String, reflect: !0 })
422
+ r([
423
+ l({ type: String, reflect: !0 })
391
424
  ], a.prototype, "comment", 2);
392
- o([
393
- r({ type: String, reflect: !0 })
425
+ r([
426
+ l({ type: String, reflect: !0 })
394
427
  ], a.prototype, "source", 2);
395
- o([
396
- r({ type: String, reflect: !0 })
428
+ r([
429
+ l({ type: String, reflect: !0 })
397
430
  ], a.prototype, "footnote", 2);
398
- o([
399
- r({ type: String, reflect: !0, attribute: "lang" })
431
+ r([
432
+ l({ type: String, reflect: !0, attribute: "lang" })
400
433
  ], a.prototype, "lang", 2);
401
- o([
402
- r({ type: String, reflect: !0, attribute: "image-href" })
434
+ r([
435
+ l({ type: String, reflect: !0, attribute: "image-href" })
403
436
  ], a.prototype, "imageHref", 2);
404
- a = o([
405
- m("scb-viz")
437
+ r([
438
+ l({ type: String, reflect: !0 })
439
+ ], a.prototype, "spacing", 2);
440
+ r([
441
+ l({ type: String, attribute: "spacing-top", reflect: !0 })
442
+ ], a.prototype, "spacingTop", 2);
443
+ r([
444
+ l({ type: String, attribute: "spacing-bottom", reflect: !0 })
445
+ ], a.prototype, "spacingBottom", 2);
446
+ a = r([
447
+ f("scb-viz")
406
448
  ], a);
407
449
  export {
408
450
  a as ScbViz