scb-wc-test 0.1.1

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 (178) hide show
  1. package/README.md +130 -0
  2. package/all.js +54 -0
  3. package/dummy.png +0 -0
  4. package/index.d.ts +54 -0
  5. package/index.js +108 -0
  6. package/mvc/components/all.js +53 -0
  7. package/mvc/components/scb-accordion/scb-accordion-item.js +194 -0
  8. package/mvc/components/scb-accordion/scb-accordion.js +5 -0
  9. package/mvc/components/scb-app-bar/scb-app-bar.js +144 -0
  10. package/mvc/components/scb-avatar/scb-avatar.js +99 -0
  11. package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +17 -0
  12. package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +52 -0
  13. package/mvc/components/scb-button/scb-button.js +121 -0
  14. package/mvc/components/scb-calendar-card/scb-calendar-card.js +140 -0
  15. package/mvc/components/scb-card/scb-card.js +256 -0
  16. package/mvc/components/scb-checkbox/scb-checkbox-group.js +33 -0
  17. package/mvc/components/scb-checkbox/scb-checkbox.js +99 -0
  18. package/mvc/components/scb-chips/scb-chip.js +46 -0
  19. package/mvc/components/scb-dialog/scb-dialog.js +158 -0
  20. package/mvc/components/scb-divider/scb-divider.js +53 -0
  21. package/mvc/components/scb-drawer/scb-drawer-item.js +114 -0
  22. package/mvc/components/scb-drawer/scb-drawer-section.js +19 -0
  23. package/mvc/components/scb-drawer/scb-drawer.js +79 -0
  24. package/mvc/components/scb-drawer/scb-sub-drawer.js +10 -0
  25. package/mvc/components/scb-fact-card/scb-fact-card-content.js +44 -0
  26. package/mvc/components/scb-fact-card/scb-fact-card.js +66 -0
  27. package/mvc/components/scb-footer/scb-footer-section.js +3 -0
  28. package/mvc/components/scb-footer/scb-footer.js +205 -0
  29. package/mvc/components/scb-grid/scb-grid-item.js +9 -0
  30. package/mvc/components/scb-grid/scb-grid.js +81 -0
  31. package/mvc/components/scb-grid/scb-stack.js +16 -0
  32. package/mvc/components/scb-header/scb-header-drawer-group.js +1 -0
  33. package/mvc/components/scb-header/scb-header-drawer-item.js +1 -0
  34. package/mvc/components/scb-header/scb-header-tab.js +1 -0
  35. package/mvc/components/scb-header/scb-header-utility.js +1 -0
  36. package/mvc/components/scb-header/scb-header.js +240 -0
  37. package/mvc/components/scb-icon-button/scb-icon-button.js +95 -0
  38. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +69 -0
  39. package/mvc/components/scb-link/scb-link.js +31 -0
  40. package/mvc/components/scb-list/scb-list-item.js +38 -0
  41. package/mvc/components/scb-list/scb-list.js +10 -0
  42. package/mvc/components/scb-menu/scb-menu-item.js +44 -0
  43. package/mvc/components/scb-menu/scb-menu.js +17 -0
  44. package/mvc/components/scb-menu/scb-sub-menu.js +29 -0
  45. package/mvc/components/scb-notification/scb-notification.js +120 -0
  46. package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +84 -0
  47. package/mvc/components/scb-radio-button/scb-radio-button.js +95 -0
  48. package/mvc/components/scb-radio-button/scb-radio-group.js +28 -0
  49. package/mvc/components/scb-search/scb-search.js +211 -0
  50. package/mvc/components/scb-snackbar/scb-snackbar.js +83 -0
  51. package/mvc/components/scb-status-pill/scb-status-pill.js +31 -0
  52. package/mvc/components/scb-switch/scb-switch.js +54 -0
  53. package/mvc/components/scb-tabs/scb-primary-tab.js +7 -0
  54. package/mvc/components/scb-tabs/scb-secondary-tab.js +7 -0
  55. package/mvc/components/scb-tabs/scb-tabs.js +23 -0
  56. package/mvc/components/scb-textfield/scb-textfield.js +135 -0
  57. package/mvc/components/scb-toc/scb-toc-item.js +84 -0
  58. package/mvc/components/scb-toc/scb-toc.js +6 -0
  59. package/mvc/components/scb-tooltip/scb-tooltip.js +216 -0
  60. package/mvc/scb-logo.svg +21 -0
  61. package/mvc/scb-wc-test.css +1 -0
  62. package/mvc/scb.svg +14 -0
  63. package/mvc/vendor/preload-helper.js +1 -0
  64. package/mvc/vendor/vendor-lit.js +1 -0
  65. package/mvc/vendor/vendor-material.js +764 -0
  66. package/mvc/vendor/vendor.js +68 -0
  67. package/package.json +248 -0
  68. package/scb-accordion/scb-accordion-item.d.ts +37 -0
  69. package/scb-accordion/scb-accordion-item.js +343 -0
  70. package/scb-accordion/scb-accordion.d.ts +6 -0
  71. package/scb-accordion/scb-accordion.js +33 -0
  72. package/scb-app-bar/scb-app-bar.d.ts +10 -0
  73. package/scb-app-bar/scb-app-bar.js +192 -0
  74. package/scb-avatar/scb-avatar.d.ts +30 -0
  75. package/scb-avatar/scb-avatar.js +169 -0
  76. package/scb-breadcrumb/scb-breadcrumb-item.d.ts +9 -0
  77. package/scb-breadcrumb/scb-breadcrumb-item.js +54 -0
  78. package/scb-breadcrumb/scb-breadcrumb.d.ts +16 -0
  79. package/scb-breadcrumb/scb-breadcrumb.js +105 -0
  80. package/scb-button/scb-button.d.ts +26 -0
  81. package/scb-button/scb-button.js +247 -0
  82. package/scb-calendar-card/scb-calendar-card.d.ts +20 -0
  83. package/scb-calendar-card/scb-calendar-card.js +191 -0
  84. package/scb-card/scb-card.d.ts +24 -0
  85. package/scb-card/scb-card.js +345 -0
  86. package/scb-checkbox/scb-checkbox-group.d.ts +17 -0
  87. package/scb-checkbox/scb-checkbox-group.js +80 -0
  88. package/scb-checkbox/scb-checkbox.d.ts +20 -0
  89. package/scb-checkbox/scb-checkbox.js +157 -0
  90. package/scb-chips/scb-chip.d.ts +24 -0
  91. package/scb-chips/scb-chip.js +150 -0
  92. package/scb-dialog/scb-dialog.d.ts +58 -0
  93. package/scb-dialog/scb-dialog.js +390 -0
  94. package/scb-divider/scb-divider.d.ts +9 -0
  95. package/scb-divider/scb-divider.js +85 -0
  96. package/scb-drawer/scb-drawer-item.d.ts +61 -0
  97. package/scb-drawer/scb-drawer-item.js +220 -0
  98. package/scb-drawer/scb-drawer-section.d.ts +7 -0
  99. package/scb-drawer/scb-drawer-section.js +44 -0
  100. package/scb-drawer/scb-drawer.d.ts +97 -0
  101. package/scb-drawer/scb-drawer.js +258 -0
  102. package/scb-drawer/scb-sub-drawer.d.ts +10 -0
  103. package/scb-drawer/scb-sub-drawer.js +43 -0
  104. package/scb-fact-card/scb-fact-card-content.d.ts +10 -0
  105. package/scb-fact-card/scb-fact-card-content.js +83 -0
  106. package/scb-fact-card/scb-fact-card.d.ts +15 -0
  107. package/scb-fact-card/scb-fact-card.js +110 -0
  108. package/scb-footer/scb-footer-section.d.ts +21 -0
  109. package/scb-footer/scb-footer-section.js +28 -0
  110. package/scb-footer/scb-footer.d.ts +27 -0
  111. package/scb-footer/scb-footer.js +326 -0
  112. package/scb-grid/scb-grid-item.d.ts +28 -0
  113. package/scb-grid/scb-grid-item.js +66 -0
  114. package/scb-grid/scb-grid.d.ts +33 -0
  115. package/scb-grid/scb-grid.js +152 -0
  116. package/scb-grid/scb-stack.d.ts +29 -0
  117. package/scb-grid/scb-stack.js +82 -0
  118. package/scb-header/scb-header-drawer-group.d.ts +13 -0
  119. package/scb-header/scb-header-drawer-group.js +28 -0
  120. package/scb-header/scb-header-drawer-item.d.ts +14 -0
  121. package/scb-header/scb-header-drawer-item.js +31 -0
  122. package/scb-header/scb-header-tab.d.ts +13 -0
  123. package/scb-header/scb-header-tab.js +28 -0
  124. package/scb-header/scb-header-utility.d.ts +14 -0
  125. package/scb-header/scb-header-utility.js +31 -0
  126. package/scb-header/scb-header.d.ts +105 -0
  127. package/scb-header/scb-header.js +618 -0
  128. package/scb-icon-button/scb-icon-button.d.ts +31 -0
  129. package/scb-icon-button/scb-icon-button.js +208 -0
  130. package/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -0
  131. package/scb-keyfigure-card/scb-keyfigure-card.js +119 -0
  132. package/scb-link/scb-link.d.ts +17 -0
  133. package/scb-link/scb-link.js +74 -0
  134. package/scb-list/scb-list-item.d.ts +32 -0
  135. package/scb-list/scb-list-item.js +144 -0
  136. package/scb-list/scb-list.d.ts +8 -0
  137. package/scb-list/scb-list.js +39 -0
  138. package/scb-logo.svg +21 -0
  139. package/scb-menu/scb-menu-item.d.ts +22 -0
  140. package/scb-menu/scb-menu-item.js +107 -0
  141. package/scb-menu/scb-menu.d.ts +21 -0
  142. package/scb-menu/scb-menu.js +98 -0
  143. package/scb-menu/scb-sub-menu.d.ts +12 -0
  144. package/scb-menu/scb-sub-menu.js +69 -0
  145. package/scb-notification/scb-notification.d.ts +16 -0
  146. package/scb-notification/scb-notification.js +187 -0
  147. package/scb-progress-indicator/scb-progress-indicator.d.ts +11 -0
  148. package/scb-progress-indicator/scb-progress-indicator.js +122 -0
  149. package/scb-radio-button/scb-radio-button.d.ts +19 -0
  150. package/scb-radio-button/scb-radio-button.js +176 -0
  151. package/scb-radio-button/scb-radio-group.d.ts +20 -0
  152. package/scb-radio-button/scb-radio-group.js +81 -0
  153. package/scb-search/scb-search.d.ts +45 -0
  154. package/scb-search/scb-search.js +410 -0
  155. package/scb-snackbar/scb-snackbar.d.ts +17 -0
  156. package/scb-snackbar/scb-snackbar.js +140 -0
  157. package/scb-status-pill/scb-status-pill.d.ts +9 -0
  158. package/scb-status-pill/scb-status-pill.js +62 -0
  159. package/scb-switch/scb-switch.d.ts +21 -0
  160. package/scb-switch/scb-switch.js +111 -0
  161. package/scb-tabs/scb-primary-tab.d.ts +17 -0
  162. package/scb-tabs/scb-primary-tab.js +93 -0
  163. package/scb-tabs/scb-secondary-tab.d.ts +17 -0
  164. package/scb-tabs/scb-secondary-tab.js +97 -0
  165. package/scb-tabs/scb-tabs.d.ts +10 -0
  166. package/scb-tabs/scb-tabs.js +66 -0
  167. package/scb-textfield/scb-textfield.d.ts +41 -0
  168. package/scb-textfield/scb-textfield.js +258 -0
  169. package/scb-toc/scb-toc-item.d.ts +21 -0
  170. package/scb-toc/scb-toc-item.js +196 -0
  171. package/scb-toc/scb-toc.d.ts +6 -0
  172. package/scb-toc/scb-toc.js +27 -0
  173. package/scb-tooltip/scb-tooltip.d.ts +32 -0
  174. package/scb-tooltip/scb-tooltip.js +329 -0
  175. package/scb-wc-test.bundle.js +5429 -0
  176. package/scb-wc-test.css +1 -0
  177. package/scb-wc-test.d.ts +106 -0
  178. package/scb.svg +14 -0
@@ -0,0 +1,208 @@
1
+ import { css as u, LitElement as h, html as a } from "lit";
2
+ import { property as s, customElement as b } from "lit/decorators.js";
3
+ var m = Object.defineProperty, p = Object.getOwnPropertyDescriptor, l = (t, o, e, r) => {
4
+ for (var i = r > 1 ? void 0 : r ? p(o, e) : o, d = t.length - 1, c; d >= 0; d--)
5
+ (c = t[d]) && (i = (r ? c(o, e, i) : c(i)) || i);
6
+ return r && i && m(o, e, i), i;
7
+ };
8
+ let n = class extends h {
9
+ constructor() {
10
+ super(...arguments), this.ariaLabel = "", this.variant = "standard", this.icon = "home", this.toggle = !1, this.toggleofficon = "add", this.toggleonicon = "remove", this.disabled = !1, this.error = !1, this.__loadedVariants = /* @__PURE__ */ new Set(), this.__iconLoaded = !1, this.__onChange = () => {
11
+ const t = this.__lastBtn;
12
+ this.dispatchEvent(new CustomEvent("change", {
13
+ detail: { selected: !!(t != null && t.selected) },
14
+ bubbles: !0,
15
+ composed: !0
16
+ }));
17
+ };
18
+ }
19
+ __attachChangeListener() {
20
+ var o, e, r;
21
+ const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector(
22
+ "md-filled-icon-button, md-outlined-icon-button, md-filled-tonal-icon-button, md-icon-button"
23
+ );
24
+ t && t !== this.__lastBtn && ((r = (e = this.__lastBtn) == null ? void 0 : e.removeEventListener) == null || r.call(e, "change", this.__onChange), t.addEventListener("change", this.__onChange), this.__lastBtn = t);
25
+ }
26
+ async firstUpdated() {
27
+ await this.__ensureDepsLoaded(), await this.updateComplete, this.__attachChangeListener();
28
+ }
29
+ updated(t) {
30
+ super.updated(t), t.has("disabled") && this.toggleAttribute("aria-disabled", this.disabled), t.has("variant") || t.has("icon") || t.has("toggle") ? this.__ensureDepsLoaded().then(() => queueMicrotask(() => this.__attachChangeListener())) : queueMicrotask(() => this.__attachChangeListener());
31
+ }
32
+ // koppla loss lyssnare om host tas bort
33
+ disconnectedCallback() {
34
+ var t, o;
35
+ super.disconnectedCallback(), (o = (t = this.__lastBtn) == null ? void 0 : t.removeEventListener) == null || o.call(t, "change", this.__onChange), this.__lastBtn = null;
36
+ }
37
+ // Ladda in rätt Material-komponenter vid behov (variant + ikon)
38
+ async __ensureDepsLoaded() {
39
+ if (!this.__loadedVariants.has(this.variant)) {
40
+ switch (this.variant) {
41
+ case "filled":
42
+ await import("@material/web/iconbutton/filled-icon-button.js");
43
+ break;
44
+ case "outlined":
45
+ await import("@material/web/iconbutton/outlined-icon-button.js");
46
+ break;
47
+ case "filled-tonal":
48
+ await import("@material/web/iconbutton/filled-tonal-icon-button.js");
49
+ break;
50
+ default:
51
+ await import("@material/web/iconbutton/icon-button.js");
52
+ break;
53
+ }
54
+ this.__loadedVariants.add(this.variant);
55
+ }
56
+ this.__iconLoaded || (await import("@material/web/icon/icon.js"), this.__iconLoaded = !0);
57
+ }
58
+ render() {
59
+ const t = this.ariaLabel.trim() || this.icon, o = this.error ? "error" : void 0, e = a`
60
+ <md-icon aria-hidden="true">${this.toggleofficon}</md-icon>
61
+ <md-icon slot="selected" aria-hidden="true">${this.toggleonicon}</md-icon>
62
+ `, r = a`<md-icon aria-hidden="true">${this.icon}</md-icon>`;
63
+ if (this.toggle) {
64
+ const i = this.selected || !1;
65
+ switch (this.variant) {
66
+ case "filled":
67
+ return a`
68
+ <md-filled-icon-button
69
+ toggle
70
+ variant=${o}
71
+ ?disabled=${this.disabled}
72
+ aria-label=${t}
73
+ aria-pressed="${i}"
74
+ >${e}</md-filled-icon-button>
75
+ `;
76
+ case "outlined":
77
+ return a`
78
+ <md-outlined-icon-button
79
+ toggle
80
+ variant=${o}
81
+ ?disabled=${this.disabled}
82
+ aria-label=${t}
83
+ aria-pressed="${i}"
84
+ >${e}</md-outlined-icon-button>
85
+ `;
86
+ case "filled-tonal":
87
+ return a`
88
+ <md-filled-tonal-icon-button
89
+ toggle
90
+ variant=${o}
91
+ ?disabled=${this.disabled}
92
+ aria-label=${t}
93
+ aria-pressed="${i}"
94
+ >${e}</md-filled-tonal-icon-button>
95
+ `;
96
+ default:
97
+ return a`
98
+ <md-icon-button
99
+ role="button"
100
+ toggle
101
+ variant=${o}
102
+ ?disabled=${this.disabled}
103
+ aria-label=${t}
104
+ aria-pressed="${i}"
105
+ >${e}</md-icon-button>
106
+ `;
107
+ }
108
+ }
109
+ switch (this.variant) {
110
+ case "filled":
111
+ return a`
112
+ <md-filled-icon-button
113
+ variant=${o}
114
+ ?disabled=${this.disabled}
115
+ aria-label=${t}
116
+ >${r}</md-filled-icon-button>
117
+ `;
118
+ case "outlined":
119
+ return a`
120
+ <md-outlined-icon-button
121
+ variant=${o}
122
+ ?disabled=${this.disabled}
123
+ aria-label=${t}
124
+ >${r}</md-outlined-icon-button>
125
+ `;
126
+ case "filled-tonal":
127
+ return a`
128
+ <md-filled-tonal-icon-button
129
+ variant=${o}
130
+ ?disabled=${this.disabled}
131
+ aria-label=${t}
132
+ >${r}</md-filled-tonal-icon-button>
133
+ `;
134
+ default:
135
+ return a`
136
+ <md-icon-button
137
+ variant=${o}
138
+ ?disabled=${this.disabled}
139
+ aria-label=${t}
140
+ >${r}</md-icon-button>
141
+ `;
142
+ }
143
+ }
144
+ };
145
+ n.styles = u`
146
+ /*Error-styling på alla underliggande knappar*/
147
+ :host([error]) md-filled-icon-button[variant='error'],
148
+ :host([error]) md-outlined-icon-button[variant='error'],
149
+ :host([error]) md-filled-tonal-icon-button[variant='error'],
150
+ :host([error]) md-icon-button[variant='error'] {
151
+ --md-sys-color-primary: var(--md-sys-color-error);
152
+ --md-sys-color-on-primary: var(--md-sys-color-on-error);
153
+ }
154
+ :host([error]) md-outlined-icon-button[variant='error'] md-icon,
155
+ :host([error]) md-icon-button[variant='error'] md-icon {
156
+ color: var(--md-sys-color-error) !important;
157
+ }
158
+ :host([error]) md-outlined-icon-button[variant='error'] {
159
+ --_outline-color: var(--md-sys-color-error);
160
+ --md-outlined-icon-button-pressed-outline-color: var(--md-sys-color-error);
161
+ }
162
+ :host([error]) md-outlined-icon-button[variant='error']:hover {
163
+ --md-outlined-icon-button-outline-width: 2px;
164
+ }
165
+ :host([error]) md-filled-tonal-icon-button[variant='error'] {
166
+ --md-filled-tonal-icon-button-container-color: var(--md-sys-color-error-container);
167
+ --md-filled-tonal-icon-button-label-text-color: var(--md-sys-color-on-error-container);
168
+ --md-filled-tonal-icon-button-hover-label-text-color: var(--md-sys-color-on-error-container);
169
+ --md-filled-tonal-icon-button-pressed-label-text-color: var(--md-sys-color-on-error-container);
170
+ --md-filled-tonal-icon-button-focus-label-text-color: var(--md-sys-color-on-error-container);
171
+ --md-filled-tonal-icon-button-icon-color: var(--md-sys-color-on-error-container);
172
+ --md-filled-tonal-icon-button-hover-icon-color: var(--md-sys-color-on-error-container);
173
+ --md-filled-tonal-icon-button-pressed-icon-color: var(--md-sys-color-on-error-container);
174
+ --md-filled-tonal-icon-button-focus-icon-color: var(--md-sys-color-on-error-container);
175
+ --md-filled-tonal-icon-button-hover-state-layer-color: var(--md-sys-color-on-error-container);
176
+ --md-filled-tonal-icon-button-pressed-state-layer-color: var(--md-sys-color-on-error-container);
177
+ }
178
+ `;
179
+ l([
180
+ s({ type: String, reflect: !0, attribute: "aria-label" })
181
+ ], n.prototype, "ariaLabel", 2);
182
+ l([
183
+ s({ type: String })
184
+ ], n.prototype, "variant", 2);
185
+ l([
186
+ s({ type: String })
187
+ ], n.prototype, "icon", 2);
188
+ l([
189
+ s({ type: Boolean, reflect: !0 })
190
+ ], n.prototype, "toggle", 2);
191
+ l([
192
+ s({ type: String })
193
+ ], n.prototype, "toggleofficon", 2);
194
+ l([
195
+ s({ type: String })
196
+ ], n.prototype, "toggleonicon", 2);
197
+ l([
198
+ s({ type: Boolean, reflect: !0 })
199
+ ], n.prototype, "disabled", 2);
200
+ l([
201
+ s({ type: Boolean, reflect: !0 })
202
+ ], n.prototype, "error", 2);
203
+ n = l([
204
+ b("scb-icon-button")
205
+ ], n);
206
+ export {
207
+ n as ScbIconButton
208
+ };
@@ -0,0 +1,13 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ export declare class ScbKeyFigureCard extends LitElement {
4
+ keyfigure: number;
5
+ subLabel: string;
6
+ supportingText: string;
7
+ cardHref: string;
8
+ icon: string;
9
+ size: 'standard' | 'large';
10
+ static styles: import('lit').CSSResult;
11
+ render(): import('lit-html').TemplateResult<1>;
12
+ firstUpdated(): void;
13
+ }
@@ -0,0 +1,119 @@
1
+ import { css as p, LitElement as g, html as r } from "lit";
2
+ import { property as n, customElement as y } from "lit/decorators.js";
3
+ import "@material/web/icon/icon.js";
4
+ import "@material/web/ripple/ripple.js";
5
+ var h = Object.defineProperty, m = Object.getOwnPropertyDescriptor, c = (i, s, l, t) => {
6
+ for (var a = t > 1 ? void 0 : t ? m(s, l) : s, o = i.length - 1, d; o >= 0; o--)
7
+ (d = i[o]) && (a = (t ? d(s, l, a) : d(a)) || a);
8
+ return t && a && h(s, l, a), a;
9
+ };
10
+ let e = class extends g {
11
+ constructor() {
12
+ super(...arguments), this.keyfigure = 0, this.subLabel = "", this.supportingText = "", this.cardHref = "", this.icon = "", this.size = "standard";
13
+ }
14
+ render() {
15
+ const i = this.cardHref ? "clickable" : "", l = ((t) => typeof t == "number" ? t.toLocaleString("sv-SE").replace(/\u00A0/g, " ") : t)(this.keyfigure);
16
+ return r`
17
+ <div class="scb-keyfigure-card ${i} ${this.size}">
18
+ ${this.cardHref ? r`<md-ripple></md-ripple>` : ""}
19
+ ${this.icon ? r`<md-icon>${this.icon}</md-icon>` : ""}
20
+ ${this.keyfigure ? r`
21
+ <div class="keyfigure">
22
+ ${l}
23
+ ${this.cardHref ? r`<md-icon>arrow_forward</md-icon>` : l}
24
+ </div>` : ""}
25
+ ${this.subLabel ? r`
26
+ <div class="sub-label">
27
+ ${this.cardHref ? r`<a href="${this.subLabel}" tabindex="0">${this.subLabel}</a>` : this.subLabel}
28
+ </div>` : ""}
29
+ ${this.supportingText ? r`<div class="supporting-text">${this.supportingText}</div>` : ""}
30
+ </div>
31
+ `;
32
+ }
33
+ firstUpdated() {
34
+ if (this.cardHref) {
35
+ const i = this.renderRoot.querySelector(".scb-keyfigure-card");
36
+ i && i.addEventListener("click", (s) => {
37
+ s.target.closest("a") || (window.location.href = this.cardHref);
38
+ });
39
+ }
40
+ }
41
+ };
42
+ e.styles = p`
43
+ :host{ --scb-card-min-w: 360px; }
44
+ :host {
45
+ max-width: var(--scb-card-min-w);
46
+ width: fit-content;;
47
+ display: block;
48
+ }
49
+ .scb-keyfigure-card {
50
+ color: var(--md-sys-color-on-surface);
51
+ display: flex;
52
+ flex-direction: column;
53
+ gap: var(--spacing-3);
54
+ width: fit-content;
55
+ max-width: var(--scb-card-min-w);
56
+ position: relative;
57
+ border-radius: var(--md-sys-shape-corner-large);
58
+ background: var(--md-sys-color-surface-dim);
59
+ padding: var(--spacing-7) var(--spacing-6);
60
+ }
61
+ .keyfigure{
62
+ letter-spacing: var(--md-sys-typescale-headline-small-Tracking);
63
+ gap: var(--spacing-3);
64
+ display: flex;
65
+ justify-content: space-between;
66
+ align-items: center;
67
+ font-size: var(--md-sys-typescale-headline-large-size);
68
+ font-weight: var(--weight-bold);
69
+ line-height: var(--md-sys-typescale-headline-large-line-height);
70
+ letter-spacing: var(--md-sys-typescale-headline-large-tracking);
71
+ }
72
+ .sub-label a {
73
+ color: inherit;
74
+ text-decoration: none;
75
+ }
76
+ .sub-label {
77
+ font-size: var(--md-sys-typescale-title-medium-size);
78
+ font-weight: var(--weight-semibold);
79
+ line-height: var(--md-sys-typescale-title-medium-line-height);
80
+ letter-spacing: var(--md-sys-typescale-title-medium-tracking);
81
+ }
82
+ .supporting-text {
83
+ font-size: var(--md-sys-typescale-body-large-size);
84
+ line-height: var(--md-sys-typescale-body-large-line-height);
85
+ letter-spacing: var(--md-sys-typescale-body-large-tracking);
86
+ }
87
+ .scb-keyfigure-card.clickable {
88
+ cursor: pointer;
89
+ }
90
+ .scb-keyfigure-card.large .keyfigure {
91
+ font-size: var(--md-sys-typescale-display-medium-size);
92
+ line-height: var(--md-sys-typescale-display-medium-line-height);
93
+ letter-spacing: var(--md-sys-typescale-display-medium-tracking);
94
+ }
95
+ `;
96
+ c([
97
+ n({ type: Number })
98
+ ], e.prototype, "keyfigure", 2);
99
+ c([
100
+ n({ type: String, attribute: "sub-label" })
101
+ ], e.prototype, "subLabel", 2);
102
+ c([
103
+ n({ type: String, attribute: "supporting-text" })
104
+ ], e.prototype, "supportingText", 2);
105
+ c([
106
+ n({ type: String, attribute: "card-href" })
107
+ ], e.prototype, "cardHref", 2);
108
+ c([
109
+ n({ type: String })
110
+ ], e.prototype, "icon", 2);
111
+ c([
112
+ n({ type: String })
113
+ ], e.prototype, "size", 2);
114
+ e = c([
115
+ y("scb-keyfigure-card")
116
+ ], e);
117
+ export {
118
+ e as ScbKeyFigureCard
119
+ };
@@ -0,0 +1,17 @@
1
+ import { LitElement, TemplateResult } from 'lit';
2
+
3
+ export declare class ScbLink extends LitElement {
4
+ #private;
5
+ href: string;
6
+ target?: '_self' | '_blank' | '_parent' | '_top';
7
+ rel?: string;
8
+ download?: string;
9
+ disabled: boolean;
10
+ static styles: import('lit').CSSResult;
11
+ render(): TemplateResult;
12
+ }
13
+ declare global {
14
+ interface HTMLElementTagNameMap {
15
+ 'scb-link': ScbLink;
16
+ }
17
+ }
@@ -0,0 +1,74 @@
1
+ import { css as h, LitElement as v, html as u } from "lit";
2
+ import { property as n, customElement as y } from "lit/decorators.js";
3
+ import { ifDefined as i } from "lit/directives/if-defined.js";
4
+ var _ = Object.defineProperty, m = Object.getOwnPropertyDescriptor, f = (e) => {
5
+ throw TypeError(e);
6
+ }, s = (e, t, r, l) => {
7
+ for (var a = l > 1 ? void 0 : l ? m(t, r) : t, p = e.length - 1, c; p >= 0; p--)
8
+ (c = e[p]) && (a = (l ? c(t, r, a) : c(a)) || a);
9
+ return l && a && _(t, r, a), a;
10
+ }, x = (e, t, r) => t.has(e) || f("Cannot " + r), b = (e, t, r) => (x(e, t, "read from private field"), r ? r.call(e) : t.get(e)), g = (e, t, r) => t.has(e) ? f("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), d;
11
+ let o = class extends v {
12
+ constructor() {
13
+ super(...arguments), this.href = "", this.disabled = !1, g(this, d, (e) => {
14
+ this.disabled && (e.preventDefault(), e.stopPropagation());
15
+ });
16
+ }
17
+ render() {
18
+ const e = this.target === "_blank" && !this.rel ? "noopener noreferrer" : this.rel;
19
+ return u`
20
+ <a
21
+ part="anchor"
22
+ href=${i(this.disabled ? void 0 : this.href || void 0)}
23
+ target=${i(this.target)}
24
+ rel=${i(e)}
25
+ download=${i(this.download)}
26
+ aria-disabled=${this.disabled ? "true" : "false"}
27
+ aria-label=${i(this.ariaLabel ?? void 0)}
28
+ @click=${b(this, d)}
29
+ ><slot></slot></a>
30
+ `;
31
+ }
32
+ };
33
+ d = /* @__PURE__ */ new WeakMap();
34
+ o.styles = h`
35
+ :host { display:inline }
36
+ a {
37
+ text-decoration: underline;
38
+ text-underline-offset: .22em;
39
+ text-decoration-thickness: 1px;
40
+ color: var(--scb-link-color, var(--md-sys-color-primary));
41
+ border-radius: 2px;
42
+ outline: none;
43
+ cursor: pointer;
44
+ transition: text-decoration-thickness .12s ease;
45
+ }
46
+ a:hover { text-decoration-thickness: 2px; }
47
+ a:focus-visible {
48
+ outline: 2px solid var(--scb-link-focus, var(--md-sys-color-primary));
49
+ outline-offset: 3px;
50
+ }
51
+ a:visited { color: var(--scb-link-visited-color, var(--md-sys-color-on-surface)); }
52
+ :host([disabled]) a { pointer-events: none; opacity:.64; text-decoration:none; cursor: default; }
53
+ `;
54
+ s([
55
+ n({ type: String, reflect: !0 })
56
+ ], o.prototype, "href", 2);
57
+ s([
58
+ n({ type: String, reflect: !0 })
59
+ ], o.prototype, "target", 2);
60
+ s([
61
+ n({ type: String, reflect: !0 })
62
+ ], o.prototype, "rel", 2);
63
+ s([
64
+ n({ type: String, reflect: !0 })
65
+ ], o.prototype, "download", 2);
66
+ s([
67
+ n({ type: Boolean, reflect: !0 })
68
+ ], o.prototype, "disabled", 2);
69
+ o = s([
70
+ y("scb-link")
71
+ ], o);
72
+ export {
73
+ o as ScbLink
74
+ };
@@ -0,0 +1,32 @@
1
+ import { LitElement, TemplateResult, PropertyValues } from 'lit';
2
+
3
+ export declare class ScbListItem extends LitElement {
4
+ #private;
5
+ type: 'text' | 'link';
6
+ /** Alias till item-href (href får företräde om båda sätts) */
7
+ href: string;
8
+ itemHref: string;
9
+ target: string;
10
+ disabled: boolean;
11
+ label: string;
12
+ supportingText: string;
13
+ overline: string;
14
+ leading: boolean;
15
+ leadingIcon: string;
16
+ imgHrefAvatar: string;
17
+ imgHrefImage: string;
18
+ leadingVariant: 'icon' | 'avatar' | 'image';
19
+ trailing: boolean;
20
+ trailingIcon: string;
21
+ trailingVariant: 'icon' | 'checkbox' | 'switch';
22
+ static get styles(): import('lit').CSSResult;
23
+ protected firstUpdated(): Promise<void>;
24
+ protected updated(changed: PropertyValues): void;
25
+ private onListClick;
26
+ render(): TemplateResult;
27
+ }
28
+ declare global {
29
+ interface HTMLElementTagNameMap {
30
+ 'scb-list-item': ScbListItem;
31
+ }
32
+ }
@@ -0,0 +1,144 @@
1
+ import { LitElement as S, css as $, html as c, nothing as h } from "lit";
2
+ import { property as s, customElement as I } from "lit/decorators.js";
3
+ var V = Object.defineProperty, L = Object.getOwnPropertyDescriptor, k = (t) => {
4
+ throw TypeError(t);
5
+ }, r = (t, i, e, n) => {
6
+ for (var l = n > 1 ? void 0 : n ? L(i, e) : i, o = t.length - 1, b; o >= 0; o--)
7
+ (b = t[o]) && (l = (n ? b(i, e, l) : b(l)) || l);
8
+ return n && l && V(i, e, l), l;
9
+ }, x = (t, i, e) => i.has(t) || k("Cannot " + e), g = (t, i, e) => (x(t, i, "read from private field"), i.get(t)), p = (t, i, e) => i.has(t) ? k("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), d = (t, i, e, n) => (x(t, i, "write to private field"), i.set(t, e), e), _ = (t, i, e) => (x(t, i, "access private method"), e), f, m, y, u, v, w;
10
+ let a = class extends S {
11
+ constructor() {
12
+ super(...arguments), p(this, v), this.type = "text", this.href = "", this.itemHref = "", this.target = "", this.disabled = !1, this.label = "", this.supportingText = "", this.overline = "", this.leading = !1, this.leadingIcon = "", this.imgHrefAvatar = "https://www.scb.se/img/scb-logo.svg", this.imgHrefImage = "https://www.scb.se/img/scb-logo.svg", this.leadingVariant = "image", this.trailing = !1, this.trailingIcon = "", this.trailingVariant = "icon", p(this, f, !1), p(this, m, !1), p(this, y, !1), p(this, u, !1);
13
+ }
14
+ static get styles() {
15
+ return $`
16
+ :host { border-bottom: 1px solid var(--md-sys-color-outline-variant); }
17
+ .scb-list-item { display: flex; }
18
+ .leading-content { margin-right: 16px; align-self: center; }
19
+ .trailing-content { margin-left: auto; align-self: center; }
20
+ .trailing-content scb-checkbox { margin-right: 11px; }
21
+ .label { line-height: 27px; }
22
+ .overline { font-size: 14px; color: var(--md-sys-color-on-surface-variant); line-height: 21px; }
23
+ .supporting-text { font-size: 16px; color: var(--md-sys-color-on-surface-variant); line-height: 24px; }
24
+
25
+ .leading-content:has(.avatar) {
26
+ width: 40px; height: 40px;
27
+ background: var(--md-sys-color-primary-container);
28
+ border-radius: 50%;
29
+ align-content: center; justify-items: center;
30
+ }
31
+ .avatar { width: 24px; height: 24px; position: relative; display: flex; }
32
+ .img { width: 56px; height: 56px; }
33
+ `;
34
+ }
35
+ // Ladda in rätt beroenden första gången
36
+ async firstUpdated() {
37
+ await _(this, v, w).call(this);
38
+ }
39
+ // Ladda om/utöka beroenden om varianter ändras
40
+ updated(t) {
41
+ super.updated(t), (t.has("leading") || t.has("leadingVariant") || t.has("trailing") || t.has("trailingVariant") || t.has("type") || t.has("target")) && _(this, v, w).call(this);
42
+ }
43
+ onListClick() {
44
+ var e, n;
45
+ if (this.type === "link" && (this.href || this.itemHref)) return;
46
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("scb-checkbox"), i = (n = this.shadowRoot) == null ? void 0 : n.querySelector("scb-switch");
47
+ t && (t.checked = !t.checked), i && (i.selected = !i.selected);
48
+ }
49
+ render() {
50
+ const t = this.leadingVariant === "icon" ? c`<div class="leading-content"><md-icon>${this.leadingIcon}</md-icon></div>` : this.leadingVariant === "avatar" ? c`<div class="leading-content"><img class="avatar" src="${this.imgHrefAvatar}" /></div>` : this.leadingVariant === "image" ? c`<div class="leading-content"><img class="img" src="${this.imgHrefImage}" /></div>` : h, i = this.href || this.itemHref || "", e = this.target === "_blank" ? "open_in_new" : "chevron_right";
51
+ let n = h;
52
+ if (this.trailing)
53
+ if (this.trailingVariant === "icon") {
54
+ const o = this.trailingIcon || (this.type === "link" ? e : "");
55
+ n = o ? c`<div class="trailing-content"><md-icon>${o}</md-icon></div>` : h;
56
+ } else this.trailingVariant === "checkbox" ? n = c`<div class="trailing-content"><scb-checkbox @click=${(o) => o.stopPropagation()}></scb-checkbox></div>` : this.trailingVariant === "switch" && (n = c`<div class="trailing-content"><scb-switch @click=${(o) => o.stopPropagation()}></scb-switch></div>`);
57
+ else this.type === "link" && (n = c`<div class="trailing-content"><md-icon>${e}</md-icon></div>`);
58
+ const l = this.type === "link" && this.target === "_blank" ? "noopener noreferrer" : h;
59
+ return c`
60
+ <md-list-item
61
+ type=${this.type}
62
+ href=${this.type === "link" && i ? i : h}
63
+ target=${this.type === "link" && this.target ? this.target : h}
64
+ rel=${l}
65
+ ?disabled=${this.disabled}
66
+ >
67
+ <div class="scb-list-item" @click=${this.onListClick}>
68
+ ${this.leading ? t : h}
69
+ <div>
70
+ <div class="overline">${this.overline}</div>
71
+ <div class="label">${this.label}</div>
72
+ <div class="supporting-text">${this.supportingText}</div>
73
+ </div>
74
+ ${n}
75
+ </div>
76
+ </md-list-item>
77
+ `;
78
+ }
79
+ };
80
+ f = /* @__PURE__ */ new WeakMap();
81
+ m = /* @__PURE__ */ new WeakMap();
82
+ y = /* @__PURE__ */ new WeakMap();
83
+ u = /* @__PURE__ */ new WeakMap();
84
+ v = /* @__PURE__ */ new WeakSet();
85
+ w = async function() {
86
+ g(this, f) || (await import("@material/web/list/list-item.js"), d(this, f, !0));
87
+ const t = this.type === "link" && (!this.trailing || // Visa standardikon för länkar om trailing inte används
88
+ this.trailingVariant === "icon");
89
+ (this.leading && this.leadingVariant === "icon" || this.trailing && this.trailingVariant === "icon" || t) && !g(this, m) && (await import("@material/web/icon/icon.js"), d(this, m, !0)), this.trailing && this.trailingVariant === "checkbox" && !g(this, y) && (await import("../scb-checkbox/scb-checkbox.js"), d(this, y, !0)), this.trailing && this.trailingVariant === "switch" && !g(this, u) && (await import("../scb-switch/scb-switch.js"), d(this, u, !0));
90
+ };
91
+ r([
92
+ s({ type: String, reflect: !0, attribute: "type" })
93
+ ], a.prototype, "type", 2);
94
+ r([
95
+ s({ type: String })
96
+ ], a.prototype, "href", 2);
97
+ r([
98
+ s({ type: String, attribute: "item-href" })
99
+ ], a.prototype, "itemHref", 2);
100
+ r([
101
+ s({ type: String, attribute: "target" })
102
+ ], a.prototype, "target", 2);
103
+ r([
104
+ s({ type: Boolean, attribute: "disabled" })
105
+ ], a.prototype, "disabled", 2);
106
+ r([
107
+ s({ type: String, reflect: !0 })
108
+ ], a.prototype, "label", 2);
109
+ r([
110
+ s({ type: String, attribute: "supporting-text" })
111
+ ], a.prototype, "supportingText", 2);
112
+ r([
113
+ s({ type: String, attribute: "overline" })
114
+ ], a.prototype, "overline", 2);
115
+ r([
116
+ s({ type: Boolean })
117
+ ], a.prototype, "leading", 2);
118
+ r([
119
+ s({ type: String, attribute: "leading-icon" })
120
+ ], a.prototype, "leadingIcon", 2);
121
+ r([
122
+ s({ type: String, reflect: !0, attribute: "img-href-avatar" })
123
+ ], a.prototype, "imgHrefAvatar", 2);
124
+ r([
125
+ s({ type: String, reflect: !0, attribute: "img-href-image" })
126
+ ], a.prototype, "imgHrefImage", 2);
127
+ r([
128
+ s({ type: String, reflect: !0, attribute: "leading-variant" })
129
+ ], a.prototype, "leadingVariant", 2);
130
+ r([
131
+ s({ type: Boolean })
132
+ ], a.prototype, "trailing", 2);
133
+ r([
134
+ s({ type: String, attribute: "trailing-icon" })
135
+ ], a.prototype, "trailingIcon", 2);
136
+ r([
137
+ s({ type: String, reflect: !0, attribute: "trailing-variant" })
138
+ ], a.prototype, "trailingVariant", 2);
139
+ a = r([
140
+ I("scb-list-item")
141
+ ], a);
142
+ export {
143
+ a as ScbListItem
144
+ };
@@ -0,0 +1,8 @@
1
+ import { LitElement, TemplateResult } from 'lit';
2
+
3
+ export declare class ScbList extends LitElement {
4
+ #private;
5
+ protected firstUpdated(): Promise<void>;
6
+ static styles: import('lit').CSSResult[];
7
+ render(): TemplateResult;
8
+ }
@@ -0,0 +1,39 @@
1
+ import { css as v, LitElement as c, html as _ } from "lit";
2
+ import { customElement as f } from "lit/decorators.js";
3
+ import "./scb-list-item.js";
4
+ var h = Object.getOwnPropertyDescriptor, p = (t) => {
5
+ throw TypeError(t);
6
+ }, m = (t, e, r, i) => {
7
+ for (var s = i > 1 ? void 0 : i ? h(e, r) : e, o = t.length - 1, n; o >= 0; o--)
8
+ (n = t[o]) && (s = n(s) || s);
9
+ return s;
10
+ }, d = (t, e, r) => e.has(t) || p("Cannot " + r), u = (t, e, r) => (d(t, e, "read from private field"), e.get(t)), y = (t, e, r) => e.has(t) ? p("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), w = (t, e, r, i) => (d(t, e, "write to private field"), e.set(t, r), r), a;
11
+ let l = class extends c {
12
+ constructor() {
13
+ super(...arguments), y(this, a, !1);
14
+ }
15
+ async firstUpdated() {
16
+ u(this, a) || (await import("@material/web/list/list.js"), w(this, a, !0));
17
+ }
18
+ render() {
19
+ return _`
20
+ <md-list role="list">
21
+ <slot></slot>
22
+ </md-list>
23
+ `;
24
+ }
25
+ };
26
+ a = /* @__PURE__ */ new WeakMap();
27
+ l.styles = [
28
+ v`
29
+ ::slotted(scb-list-item:first-of-type) {
30
+ border-top: 1px solid var(--md-sys-color-outline-variant);
31
+ }
32
+ `
33
+ ];
34
+ l = m([
35
+ f("scb-list")
36
+ ], l);
37
+ export {
38
+ l as ScbList
39
+ };