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,18 +1,20 @@
1
- import { LitElement as _, css as x, html as m, nothing as r } from "lit";
2
- import { property as s, customElement as I } from "lit/decorators.js";
1
+ import { LitElement as k, css as T, html as p, nothing as r } from "lit";
2
+ import { property as s, customElement as B } from "lit/decorators.js";
3
3
  import "@material/web/button/filled-button.js";
4
4
  import "@material/web/button/outlined-button.js";
5
5
  import "@material/web/button/filled-tonal-button.js";
6
6
  import "@material/web/button/text-button.js";
7
7
  import "@material/web/icon/icon.js";
8
- var S = Object.defineProperty, O = Object.getOwnPropertyDescriptor, l = (t, e, n, o) => {
9
- for (var i = o > 1 ? void 0 : o ? O(e, n) : e, b = t.length - 1, u; b >= 0; b--)
10
- (u = t[b]) && (i = (o ? u(e, n, i) : u(i)) || i);
11
- return o && i && S(e, n, i), i;
12
- };
13
- let a = class extends _ {
8
+ var O = Object.defineProperty, w = Object.getOwnPropertyDescriptor, x = (t) => {
9
+ throw TypeError(t);
10
+ }, a = (t, e, i, l) => {
11
+ for (var n = l > 1 ? void 0 : l ? w(e, i) : e, b = t.length - 1, u; b >= 0; b--)
12
+ (u = t[b]) && (n = (l ? u(e, i, n) : u(n)) || n);
13
+ return l && n && O(e, i, n), n;
14
+ }, L = (t, e, i) => e.has(t) || x("Cannot " + i), P = (t, e, i) => e.has(t) ? x("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), A = (t, e, i) => (L(t, e, "access private method"), i), m, g;
15
+ let o = class extends k {
14
16
  constructor() {
15
- super(...arguments), this.variant = "filled", this.type = "button", this.label = "Button", this.trailingIcon = !1, this.icon = "", this.disabled = !1, this.href = "", this.target = "", this.rel = "";
17
+ super(...arguments), P(this, m), this.variant = "filled", this.type = "button", this.label = "Button", this.trailingIcon = !1, this.icon = "", this.disabled = !1, this.href = "", this.target = "", this.rel = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
16
18
  }
17
19
  // Hosta md-* elementet (värden flyttas därifrån in i dess shadow <button>)
18
20
  __getMdHost() {
@@ -27,26 +29,26 @@ let a = class extends _ {
27
29
  }
28
30
  // Spegla aria-attribut från host/md-host -> inre native <button>
29
31
  __syncAriaToInner() {
30
- var y;
32
+ var $;
31
33
  const t = this.__getMdHost(), e = this.__getInnerNativeButton(t);
32
34
  if (!t || !e) return;
33
- const n = (this.getAttribute("aria-label") || "").trim(), o = (t.getAttribute("aria-label") || "").trim(), i = this.label.trim() === "" ? (this.icon || "").trim() : "", b = n || o || i;
35
+ const i = (this.getAttribute("aria-label") || "").trim(), l = (t.getAttribute("aria-label") || "").trim(), n = this.label.trim() === "" ? (this.icon || "").trim() : "", b = i || l || n;
34
36
  b ? e.setAttribute("aria-label", b) : e.removeAttribute("aria-label");
35
37
  const u = this.getAttribute("aria-controls");
36
38
  u !== null ? e.setAttribute("aria-controls", u) : e.removeAttribute("aria-controls");
37
- const v = this.getAttribute("aria-expanded");
38
- v !== null ? e.setAttribute("aria-expanded", v) : e.removeAttribute("aria-expanded"), t.removeAttribute("aria-label"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-expanded"), this.removeAttribute("aria-expanded"), (y = this.__ariaObserver) == null || y.disconnect(), this.__ariaObserver = new MutationObserver(($) => {
39
- const d = this.__getMdHost(), h = this.__getInnerNativeButton(d);
40
- if (!(!d || !h)) {
41
- for (const p of $) {
42
- if (p.type !== "attributes" || !p.attributeName) continue;
43
- const c = p.attributeName, f = this.getAttribute(c);
44
- if (c === "aria-label") {
45
- const A = (d.getAttribute("aria-label") || "").trim(), g = (f || A || (this.label.trim() === "" ? (this.icon || "").trim() : "")).trim();
46
- g ? h.setAttribute("aria-label", g) : h.removeAttribute("aria-label"), d.removeAttribute("aria-label");
47
- } else (c === "aria-controls" || c === "aria-expanded") && (f === null ? h.removeAttribute(c) : h.setAttribute(c, f), c === "aria-expanded" && this.removeAttribute("aria-expanded"));
39
+ const y = this.getAttribute("aria-expanded");
40
+ y !== null ? e.setAttribute("aria-expanded", y) : e.removeAttribute("aria-expanded"), t.removeAttribute("aria-label"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-expanded"), this.removeAttribute("aria-expanded"), ($ = this.__ariaObserver) == null || $.disconnect(), this.__ariaObserver = new MutationObserver((S) => {
41
+ const c = this.__getMdHost(), h = this.__getInnerNativeButton(c);
42
+ if (!(!c || !h)) {
43
+ for (const f of S) {
44
+ if (f.type !== "attributes" || !f.attributeName) continue;
45
+ const d = f.attributeName, v = this.getAttribute(d);
46
+ if (d === "aria-label") {
47
+ const I = (c.getAttribute("aria-label") || "").trim(), _ = (v || I || (this.label.trim() === "" ? (this.icon || "").trim() : "")).trim();
48
+ _ ? h.setAttribute("aria-label", _) : h.removeAttribute("aria-label"), c.removeAttribute("aria-label");
49
+ } else (d === "aria-controls" || d === "aria-expanded") && (v === null ? h.removeAttribute(d) : h.setAttribute(d, v), d === "aria-expanded" && this.removeAttribute("aria-expanded"));
48
50
  }
49
- d.removeAttribute("aria-label"), d.removeAttribute("aria-controls"), d.removeAttribute("aria-expanded");
51
+ c.removeAttribute("aria-label"), c.removeAttribute("aria-controls"), c.removeAttribute("aria-expanded");
50
52
  }
51
53
  }), this.__ariaObserver.observe(this, {
52
54
  attributes: !0,
@@ -60,25 +62,33 @@ let a = class extends _ {
60
62
  const t = this.closest("form");
61
63
  t && (this.type === "submit" && t.requestSubmit(), this.type === "reset" && t.reset());
62
64
  }
63
- }), this.__syncAriaToInner();
65
+ }), this.__syncAriaToInner(), A(this, m, g).call(this);
64
66
  }
65
- // Kör även när variant/icon ändras
67
+ // Kör även när variant/icon/spacing ändras
66
68
  updated(t) {
67
- t.has("variant") && this.__syncAriaToInner();
69
+ t.has("variant") && this.__syncAriaToInner(), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && A(this, m, g).call(this);
68
70
  }
69
71
  disconnectedCallback() {
70
72
  var t;
71
73
  (t = this.__ariaObserver) == null || t.disconnect(), super.disconnectedCallback();
72
74
  }
75
+ mapSpacingToken(t) {
76
+ if (!t) return;
77
+ const e = String(t).trim();
78
+ if (e)
79
+ return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
80
+ }
73
81
  static get styles() {
74
- return x`
82
+ return T`
75
83
  /* Gör hosten stretchbar i t.ex. flex/grid */
76
84
  :host {
77
85
  display: inline-flex;
78
86
  block-size: var(--scb-button-block-size, auto);
87
+ margin-block-start: var(--scb-button-spacing-block-start, 0);
88
+ margin-block-end: var(--scb-button-spacing-block-end, 0);
79
89
  }
80
90
 
81
- /* Låt inre md-knappen fylla hostens höjd*/
91
+ /* Låt inre md-knappar fylla hostens höjd */
82
92
  md-filled-button,
83
93
  md-outlined-button,
84
94
  md-filled-tonal-button,
@@ -133,17 +143,17 @@ let a = class extends _ {
133
143
  `;
134
144
  }
135
145
  render() {
136
- var i;
137
- const t = !!((i = this.icon) != null && i.trim()), e = t ? m`<md-icon slot="icon">${this.icon}</md-icon>` : r, n = r, o = this.label.trim() === "" ? this.icon : void 0;
146
+ var n;
147
+ const t = !!((n = this.icon) != null && n.trim()), e = t ? p`<md-icon slot="icon">${this.icon}</md-icon>` : r, i = r, l = this.label.trim() === "" ? this.icon : void 0;
138
148
  switch (this.variant) {
139
149
  case "filled":
140
- return m`
150
+ return p`
141
151
  <md-filled-button
142
152
  type=${this.type}
143
- variant=${n}
153
+ variant=${i}
144
154
  ?trailing-icon=${this.trailingIcon}
145
155
  ?disabled=${this.disabled}
146
- aria-label=${o}
156
+ aria-label=${l}
147
157
  href=${this.href || r}
148
158
  target=${this.target || r}
149
159
  rel=${this.rel || r}
@@ -154,13 +164,13 @@ let a = class extends _ {
154
164
  </md-filled-button>
155
165
  `;
156
166
  case "outlined":
157
- return m`
167
+ return p`
158
168
  <md-outlined-button
159
169
  type=${this.type}
160
- variant=${n}
170
+ variant=${i}
161
171
  ?trailing-icon=${this.trailingIcon}
162
172
  ?disabled=${this.disabled}
163
- aria-label=${o}
173
+ aria-label=${l}
164
174
  href=${this.href || r}
165
175
  target=${this.target || r}
166
176
  rel=${this.rel || r}
@@ -171,13 +181,13 @@ let a = class extends _ {
171
181
  </md-outlined-button>
172
182
  `;
173
183
  case "filled-tonal":
174
- return m`
184
+ return p`
175
185
  <md-filled-tonal-button
176
186
  type=${this.type}
177
- variant=${n}
187
+ variant=${i}
178
188
  ?trailing-icon=${this.trailingIcon}
179
189
  ?disabled=${this.disabled}
180
- aria-label=${o}
190
+ aria-label=${l}
181
191
  href=${this.href || r}
182
192
  target=${this.target || r}
183
193
  rel=${this.rel || r}
@@ -188,13 +198,13 @@ let a = class extends _ {
188
198
  </md-filled-tonal-button>
189
199
  `;
190
200
  case "text":
191
- return m`
201
+ return p`
192
202
  <md-text-button
193
203
  type=${this.type}
194
- variant=${n}
204
+ variant=${i}
195
205
  ?trailing-icon=${this.trailingIcon}
196
206
  ?disabled=${this.disabled}
197
- aria-label=${o}
207
+ aria-label=${l}
198
208
  href=${this.href || r}
199
209
  target=${this.target || r}
200
210
  rel=${this.rel || r}
@@ -205,40 +215,54 @@ let a = class extends _ {
205
215
  </md-text-button>
206
216
  `;
207
217
  default:
208
- return m``;
218
+ return p``;
209
219
  }
210
220
  }
211
221
  };
212
- l([
222
+ m = /* @__PURE__ */ new WeakSet();
223
+ g = function() {
224
+ const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, i = this.mapSpacingToken(this.spacingBottom) ?? t;
225
+ e ? this.style.setProperty("--scb-button-spacing-block-start", e) : this.style.removeProperty("--scb-button-spacing-block-start"), i ? this.style.setProperty("--scb-button-spacing-block-end", i) : this.style.removeProperty("--scb-button-spacing-block-end");
226
+ };
227
+ a([
213
228
  s({ type: String, reflect: !0 })
214
- ], a.prototype, "variant", 2);
215
- l([
229
+ ], o.prototype, "variant", 2);
230
+ a([
216
231
  s({ type: String, reflect: !0 })
217
- ], a.prototype, "type", 2);
218
- l([
232
+ ], o.prototype, "type", 2);
233
+ a([
219
234
  s({ type: String })
220
- ], a.prototype, "label", 2);
221
- l([
235
+ ], o.prototype, "label", 2);
236
+ a([
222
237
  s({ type: Boolean, attribute: "trailing-icon" })
223
- ], a.prototype, "trailingIcon", 2);
224
- l([
238
+ ], o.prototype, "trailingIcon", 2);
239
+ a([
225
240
  s({ type: String })
226
- ], a.prototype, "icon", 2);
227
- l([
241
+ ], o.prototype, "icon", 2);
242
+ a([
228
243
  s({ type: Boolean, reflect: !0 })
229
- ], a.prototype, "disabled", 2);
230
- l([
244
+ ], o.prototype, "disabled", 2);
245
+ a([
231
246
  s({ type: String })
232
- ], a.prototype, "href", 2);
233
- l([
247
+ ], o.prototype, "href", 2);
248
+ a([
234
249
  s({ type: String })
235
- ], a.prototype, "target", 2);
236
- l([
250
+ ], o.prototype, "target", 2);
251
+ a([
237
252
  s({ type: String })
238
- ], a.prototype, "rel", 2);
239
- a = l([
240
- I("scb-button")
241
- ], a);
253
+ ], o.prototype, "rel", 2);
254
+ a([
255
+ s({ type: String, reflect: !0 })
256
+ ], o.prototype, "spacing", 2);
257
+ a([
258
+ s({ type: String, attribute: "spacing-top", reflect: !0 })
259
+ ], o.prototype, "spacingTop", 2);
260
+ a([
261
+ s({ type: String, attribute: "spacing-bottom", reflect: !0 })
262
+ ], o.prototype, "spacingBottom", 2);
263
+ o = a([
264
+ B("scb-button")
265
+ ], o);
242
266
  export {
243
- a as ScbButton
267
+ o as ScbButton
244
268
  };
@@ -1,5 +1,6 @@
1
1
  import { LitElement } from 'lit';
2
2
  export declare class ScbCalendarCard extends LitElement {
3
+ #private;
3
4
  variant: 'default' | 'outlined' | 'filled';
4
5
  direction: 'horizontal' | 'vertical';
5
6
  title: string;
@@ -18,6 +19,9 @@ export declare class ScbCalendarCard extends LitElement {
18
19
  maxHeight: string;
19
20
  minHeight: string;
20
21
  sizing: 'stretch' | 'content-width' | 'content-height';
22
+ spacing: string;
23
+ spacingTop: string;
24
+ spacingBottom: string;
21
25
  private static __iconLoaded;
22
26
  private static __rippleLoaded;
23
27
  protected firstUpdated(): Promise<void>;
@@ -26,6 +30,7 @@ export declare class ScbCalendarCard extends LitElement {
26
30
  private __applyInnerSizing;
27
31
  private _onKeyDown;
28
32
  private _handleHrefNavigation;
33
+ private mapSpacingToken;
29
34
  protected updated(changed: Map<string, unknown>): void;
30
35
  }
31
36
  declare global {
@@ -1,23 +1,25 @@
1
- import { css as m, LitElement as f, html as d } from "lit";
2
- import { property as r, customElement as g } from "lit/decorators.js";
1
+ import { css as u, LitElement as v, html as d } from "lit";
2
+ import { property as a, customElement as b } from "lit/decorators.js";
3
3
  import "@material/web/focus/md-focus-ring.js";
4
- var y = Object.defineProperty, u = Object.getOwnPropertyDescriptor, t = (e, s, c, n) => {
5
- for (var a = n > 1 ? void 0 : n ? u(s, c) : s, o = e.length - 1, l; o >= 0; o--)
6
- (l = e[o]) && (a = (n ? l(s, c, a) : l(a)) || a);
7
- return n && a && y(s, c, a), a;
8
- };
9
- let i = class extends f {
4
+ var x = Object.defineProperty, w = Object.getOwnPropertyDescriptor, f = (e) => {
5
+ throw TypeError(e);
6
+ }, r = (e, t, s, o) => {
7
+ for (var n = o > 1 ? void 0 : o ? w(t, s) : t, l = e.length - 1, c; l >= 0; l--)
8
+ (c = e[l]) && (n = (o ? c(t, s, n) : c(n)) || n);
9
+ return o && n && x(t, s, n), n;
10
+ }, z = (e, t, s) => t.has(e) || f("Cannot " + s), k = (e, t, s) => t.has(e) ? f("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), g = (e, t, s) => (z(e, t, "access private method"), s), p, h;
11
+ let i = class extends v {
10
12
  constructor() {
11
- super(...arguments), this.variant = "default", this.direction = "horizontal", this.title = "", this.subtitle = "", this.supportingText = "", this.cardHref = "", this.cardHrefNav = "", this.showMedia = null, this.mediaWidth = "", this.mediaHeight = "", this.mediaAspect = "", this.width = "", this.maxWidth = "", this.minWidth = "", this.height = "", this.maxHeight = "", this.minHeight = "", this.sizing = "stretch";
13
+ super(...arguments), k(this, p), this.variant = "default", this.direction = "horizontal", this.title = "", this.subtitle = "", this.supportingText = "", this.cardHref = "", this.cardHrefNav = "", this.showMedia = null, this.mediaWidth = "", this.mediaHeight = "", this.mediaAspect = "", this.width = "", this.maxWidth = "", this.minWidth = "", this.height = "", this.maxHeight = "", this.minHeight = "", this.sizing = "stretch", this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
12
14
  }
13
15
  async firstUpdated() {
14
- 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();
16
+ 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, p, h).call(this);
15
17
  }
16
18
  render() {
17
- const e = this.variant ? `${this.variant.toLowerCase()}` : "", s = this.direction ? `${this.direction.toLowerCase()}` : "", c = this.cardHref ? "clickable" : "", n = 1, a = "Jan", o = this.mediaWidth && this.mediaWidth.trim() !== "" ? this.mediaWidth : "", l = this.mediaHeight && this.mediaHeight.trim() !== "" ? this.mediaHeight : "", h = this.mediaAspect && this.mediaAspect.trim() !== "" ? this.mediaAspect : "", p = `${o ? `inline-size:${o};` : ""}${l ? `block-size:${l};` : ""}${h ? `aspect-ratio:${h};` : ""}`;
19
+ const e = this.variant ? `${this.variant.toLowerCase()}` : "", t = this.direction ? `${this.direction.toLowerCase()}` : "", s = this.cardHref ? "clickable" : "", o = 1, n = "Jan", l = this.mediaWidth && this.mediaWidth.trim() !== "" ? this.mediaWidth : "", c = this.mediaHeight && this.mediaHeight.trim() !== "" ? this.mediaHeight : "", m = this.mediaAspect && this.mediaAspect.trim() !== "" ? this.mediaAspect : "", y = `${l ? `inline-size:${l};` : ""}${c ? `block-size:${c};` : ""}${m ? `aspect-ratio:${m};` : ""}`;
18
20
  return d`
19
21
  <div
20
- class="calendar-card ${s} ${c} ${e}"
22
+ class="calendar-card ${t} ${s} ${e}"
21
23
  role="${this.cardHref ? "link" : "group"}"
22
24
  aria-label="${this.title || "Kalenderkort"}"
23
25
  tabindex="${this.cardHref ? "0" : "-1"}"
@@ -27,9 +29,9 @@ let i = class extends f {
27
29
  >
28
30
  ${this.cardHref ? d`<md-ripple></md-ripple>` : ""}
29
31
  ${this.showMedia ? d`
30
- <div class="media" style="${p}" aria-label="Datum: ${n} ${a}">
31
- <div class="day">${n}</div>
32
- <div class="month">${a}</div>
32
+ <div class="media" style="${y}" aria-label="Datum: ${o} ${n}">
33
+ <div class="day">${o}</div>
34
+ <div class="month">${n}</div>
33
35
  </div>
34
36
  ` : ""}
35
37
  <div class="container">
@@ -55,13 +57,24 @@ let i = class extends f {
55
57
  _handleHrefNavigation() {
56
58
  this.cardHref && (this.cardHrefNav === "tab" ? window.open(this.cardHref, "_blank") : this.cardHrefNav === "window" ? window.open(this.cardHref, "_blank", "noopener,noreferrer,width=800,height=600") : window.open(this.cardHref, "_self"));
57
59
  }
60
+ mapSpacingToken(e) {
61
+ if (!e) return;
62
+ const t = String(e).trim();
63
+ if (t)
64
+ return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
65
+ }
58
66
  updated(e) {
59
- 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("minWidth") && (this.minWidth ? this.style.minInlineSize = this.minWidth : this.style.removeProperty("min-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("minHeight") && (this.minHeight ? this.style.minBlockSize = this.minHeight : this.style.removeProperty("min-block-size")), (e.has("width") || e.has("height") || e.has("maxHeight") || e.has("sizing")) && this.__applyInnerSizing();
67
+ 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("minWidth") && (this.minWidth ? this.style.minInlineSize = this.minWidth : this.style.removeProperty("min-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("minHeight") && (this.minHeight ? this.style.minBlockSize = this.minHeight : this.style.removeProperty("min-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, p, h).call(this);
60
68
  }
61
69
  };
70
+ p = /* @__PURE__ */ new WeakSet();
71
+ h = function() {
72
+ const e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, s = this.mapSpacingToken(this.spacingBottom) ?? e;
73
+ t ? this.style.setProperty("--scb-calendar-card-spacing-block-start", t) : this.style.removeProperty("--scb-calendar-card-spacing-block-start"), s ? this.style.setProperty("--scb-calendar-card-spacing-block-end", s) : this.style.removeProperty("--scb-calendar-card-spacing-block-end");
74
+ };
62
75
  i.__iconLoaded = !1;
63
76
  i.__rippleLoaded = !1;
64
- i.styles = m`
77
+ i.styles = u`
65
78
  :host {
66
79
  display: block;
67
80
  position: relative;
@@ -69,6 +82,8 @@ i.styles = m`
69
82
  inline-size: 100%;
70
83
  min-inline-size: 0;
71
84
  padding: var(--scb-calendar-card-focus-ring-gap, 4px);
85
+ margin-block-start: var(--scb-calendar-card-spacing-block-start, 0);
86
+ margin-block-end: var(--scb-calendar-card-spacing-block-end, 0);
72
87
  }
73
88
 
74
89
  :host([sizing='stretch']) {
@@ -279,62 +294,71 @@ i.styles = m`
279
294
  text-overflow: clip;
280
295
  }
281
296
  `;
282
- t([
283
- r({ type: String, reflect: !0 })
297
+ r([
298
+ a({ type: String, reflect: !0 })
284
299
  ], i.prototype, "variant", 2);
285
- t([
286
- r({ type: String, reflect: !0 })
300
+ r([
301
+ a({ type: String, reflect: !0 })
287
302
  ], i.prototype, "direction", 2);
288
- t([
289
- r({ type: String, reflect: !0 })
303
+ r([
304
+ a({ type: String, reflect: !0 })
290
305
  ], i.prototype, "title", 2);
291
- t([
292
- r({ type: String, reflect: !0 })
306
+ r([
307
+ a({ type: String, reflect: !0 })
293
308
  ], i.prototype, "subtitle", 2);
294
- t([
295
- r({ type: String, attribute: "supporting-text", reflect: !0 })
309
+ r([
310
+ a({ type: String, attribute: "supporting-text", reflect: !0 })
296
311
  ], i.prototype, "supportingText", 2);
297
- t([
298
- r({ type: String, attribute: "card-href" })
312
+ r([
313
+ a({ type: String, attribute: "card-href" })
299
314
  ], i.prototype, "cardHref", 2);
300
- t([
301
- r({ type: String, attribute: "card-href-nav" })
315
+ r([
316
+ a({ type: String, attribute: "card-href-nav" })
302
317
  ], i.prototype, "cardHrefNav", 2);
303
- t([
304
- r({ type: Boolean, reflect: !0, attribute: "show-media" })
318
+ r([
319
+ a({ type: Boolean, reflect: !0, attribute: "show-media" })
305
320
  ], i.prototype, "showMedia", 2);
306
- t([
307
- r({ type: String, attribute: "media-width" })
321
+ r([
322
+ a({ type: String, attribute: "media-width" })
308
323
  ], i.prototype, "mediaWidth", 2);
309
- t([
310
- r({ type: String, attribute: "media-height" })
324
+ r([
325
+ a({ type: String, attribute: "media-height" })
311
326
  ], i.prototype, "mediaHeight", 2);
312
- t([
313
- r({ type: String, attribute: "media-aspect" })
327
+ r([
328
+ a({ type: String, attribute: "media-aspect" })
314
329
  ], i.prototype, "mediaAspect", 2);
315
- t([
316
- r({ type: String, reflect: !0 })
330
+ r([
331
+ a({ type: String, reflect: !0 })
317
332
  ], i.prototype, "width", 2);
318
- t([
319
- r({ type: String, reflect: !0, attribute: "max-width" })
333
+ r([
334
+ a({ type: String, reflect: !0, attribute: "max-width" })
320
335
  ], i.prototype, "maxWidth", 2);
321
- t([
322
- r({ type: String, attribute: "min-width" })
336
+ r([
337
+ a({ type: String, attribute: "min-width" })
323
338
  ], i.prototype, "minWidth", 2);
324
- t([
325
- r({ type: String, reflect: !0 })
339
+ r([
340
+ a({ type: String, reflect: !0 })
326
341
  ], i.prototype, "height", 2);
327
- t([
328
- r({ type: String, reflect: !0, attribute: "max-height" })
342
+ r([
343
+ a({ type: String, reflect: !0, attribute: "max-height" })
329
344
  ], i.prototype, "maxHeight", 2);
330
- t([
331
- r({ type: String, attribute: "min-height" })
345
+ r([
346
+ a({ type: String, attribute: "min-height" })
332
347
  ], i.prototype, "minHeight", 2);
333
- t([
334
- r({ type: String, reflect: !0 })
348
+ r([
349
+ a({ type: String, reflect: !0 })
335
350
  ], i.prototype, "sizing", 2);
336
- i = t([
337
- g("scb-calendar-card")
351
+ r([
352
+ a({ type: String, reflect: !0 })
353
+ ], i.prototype, "spacing", 2);
354
+ r([
355
+ a({ type: String, attribute: "spacing-top", reflect: !0 })
356
+ ], i.prototype, "spacingTop", 2);
357
+ r([
358
+ a({ type: String, attribute: "spacing-bottom", reflect: !0 })
359
+ ], i.prototype, "spacingBottom", 2);
360
+ i = r([
361
+ b("scb-calendar-card")
338
362
  ], i);
339
363
  export {
340
364
  i as ScbCalendarCard
@@ -1,5 +1,6 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  export declare class ScbCard extends LitElement {
3
+ #private;
3
4
  private static __iconLoaded;
4
5
  private static __rippleLoaded;
5
6
  type: string;
@@ -33,10 +34,14 @@ export declare class ScbCard extends LitElement {
33
34
  maxWidth: string;
34
35
  height: string;
35
36
  maxHeight: string;
37
+ spacing: string;
38
+ spacingTop: string;
39
+ spacingBottom: string;
36
40
  static styles: import('lit').CSSResult;
37
41
  private __calcAspectWH;
38
42
  private __onImgLoad;
39
43
  private __mediaTemplate;
44
+ private mapSpacingToken;
40
45
  render(): import('lit-html').TemplateResult<1>;
41
46
  protected updated(changed: PropertyValues): void;
42
47
  protected firstUpdated(_changed: PropertyValues): Promise<void>;