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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.105",
3
+ "version": "0.1.107",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -337,5 +337,5 @@
337
337
  },
338
338
  "./mvc/*": "./mvc/*"
339
339
  },
340
- "buildHash": "F471BF0297C09631C7B212F431BB78DE6E04C544E36E5B3038379A15174EE4B8"
340
+ "buildHash": "9C8FDE229A6A7627895483B4195C5836D7D6E708679AC92B7306C433AB2EB029"
341
341
  }
@@ -1,5 +1,18 @@
1
1
  import { LitElement, TemplateResult } from 'lit';
2
2
  export declare class ScbAccordion extends LitElement {
3
+ #private;
3
4
  detached: boolean;
5
+ spacing: string;
6
+ spacingTop: string;
7
+ spacingBottom: string;
8
+ static styles: import('lit').CSSResult;
4
9
  render(): TemplateResult;
10
+ protected firstUpdated(): void;
11
+ protected updated(changed: Map<string, unknown>): void;
12
+ private mapSpacingToken;
13
+ }
14
+ declare global {
15
+ interface HTMLElementTagNameMap {
16
+ 'scb-accordion': ScbAccordion;
17
+ }
5
18
  }
@@ -1,33 +1,65 @@
1
- import { LitElement as n, html as a } from "lit";
2
- import { property as i, customElement as m } from "lit/decorators.js";
1
+ import { css as m, LitElement as v, html as b } from "lit";
2
+ import { property as n, customElement as f } from "lit/decorators.js";
3
3
  import "./scb-accordion-item.js";
4
- var f = Object.defineProperty, h = Object.getOwnPropertyDescriptor, d = (l, r, o, t) => {
5
- for (var e = t > 1 ? void 0 : t ? h(r, o) : r, c = l.length - 1, s; c >= 0; c--)
6
- (s = l[c]) && (e = (t ? s(r, o, e) : s(e)) || e);
7
- return t && e && f(r, o, e), e;
8
- };
9
- let p = class extends n {
4
+ var y = Object.defineProperty, u = Object.getOwnPropertyDescriptor, g = (t) => {
5
+ throw TypeError(t);
6
+ }, c = (t, e, s, a) => {
7
+ for (var o = a > 1 ? void 0 : a ? u(e, s) : e, p = t.length - 1, l; p >= 0; p--)
8
+ (l = t[p]) && (o = (a ? l(e, s, o) : l(o)) || o);
9
+ return a && o && y(e, s, o), o;
10
+ }, _ = (t, e, s) => e.has(t) || g("Cannot " + s), S = (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), h = (t, e, s) => (_(t, e, "access private method"), s), i, d;
11
+ let r = class extends v {
10
12
  constructor() {
11
- super(...arguments), this.detached = !1;
13
+ super(...arguments), S(this, i), this.detached = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
12
14
  }
13
- /*
14
- Renderar containern och slottar in alla scb-accordion-item.
15
- Sätter attributet `detached` på wrappern om relevant.
16
- */
17
15
  render() {
18
- return a`
16
+ return b`
19
17
  <div class="scb-accordion" ?detached=${this.detached}>
20
18
  <slot></slot>
21
19
  </div>
22
20
  `;
23
21
  }
22
+ firstUpdated() {
23
+ h(this, i, d).call(this);
24
+ }
25
+ updated(t) {
26
+ (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && h(this, i, d).call(this);
27
+ }
28
+ // Mappar spacing-värden till tokens eller fria CSS-värden.
29
+ mapSpacingToken(t) {
30
+ if (!t) return;
31
+ const e = String(t).trim();
32
+ if (e)
33
+ return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
34
+ }
35
+ };
36
+ i = /* @__PURE__ */ new WeakSet();
37
+ d = function() {
38
+ const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, s = this.mapSpacingToken(this.spacingBottom) ?? t;
39
+ e ? this.style.setProperty("--scb-accordion-spacing-block-start", e) : this.style.removeProperty("--scb-accordion-spacing-block-start"), s ? this.style.setProperty("--scb-accordion-spacing-block-end", s) : this.style.removeProperty("--scb-accordion-spacing-block-end");
24
40
  };
25
- d([
26
- i({ type: Boolean, reflect: !0 })
27
- ], p.prototype, "detached", 2);
28
- p = d([
29
- m("scb-accordion")
30
- ], p);
41
+ r.styles = m`
42
+ :host {
43
+ display: block;
44
+ margin-block-start: var(--scb-accordion-spacing-block-start, 0);
45
+ margin-block-end: var(--scb-accordion-spacing-block-end, 0);
46
+ }
47
+ `;
48
+ c([
49
+ n({ type: Boolean, reflect: !0 })
50
+ ], r.prototype, "detached", 2);
51
+ c([
52
+ n({ type: String, reflect: !0 })
53
+ ], r.prototype, "spacing", 2);
54
+ c([
55
+ n({ type: String, attribute: "spacing-top", reflect: !0 })
56
+ ], r.prototype, "spacingTop", 2);
57
+ c([
58
+ n({ type: String, attribute: "spacing-bottom", reflect: !0 })
59
+ ], r.prototype, "spacingBottom", 2);
60
+ r = c([
61
+ f("scb-accordion")
62
+ ], r);
31
63
  export {
32
- p as ScbAccordion
64
+ r as ScbAccordion
33
65
  };
@@ -3,6 +3,7 @@ type AvatarSize = 'small' | 'medium' | 'large';
3
3
  type AvatarShape = 'circular' | 'rounded' | 'square';
4
4
  type AvatarVariant = 'image' | 'icon';
5
5
  export declare class ScbAvatar extends LitElement {
6
+ #private;
6
7
  src: string;
7
8
  alt: string;
8
9
  label: string;
@@ -10,6 +11,9 @@ export declare class ScbAvatar extends LitElement {
10
11
  shape: AvatarShape;
11
12
  iconName: string;
12
13
  variant: AvatarVariant;
14
+ spacing: string;
15
+ spacingTop: string;
16
+ spacingBottom: string;
13
17
  private _imgError;
14
18
  private _hasIconSlot;
15
19
  static styles: import('lit').CSSResult;
@@ -17,8 +21,10 @@ export declare class ScbAvatar extends LitElement {
17
21
  private _onImgError;
18
22
  private _onIconSlotChange;
19
23
  protected firstUpdated(): Promise<void>;
24
+ protected updated(changed: Map<string, unknown>): void;
20
25
  private _initials;
21
26
  private _ariaLabel;
27
+ private mapSpacingToken;
22
28
  render(): TemplateResult;
23
29
  }
24
30
  declare global {
@@ -1,56 +1,82 @@
1
- import { css as d, LitElement as g, nothing as c, html as a } from "lit";
2
- import { property as l, state as m, customElement as v } from "lit/decorators.js";
3
- var u = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, r = (i, t, o, s) => {
4
- for (var n = s > 1 ? void 0 : s ? _(t, o) : t, h = i.length - 1, p; h >= 0; h--)
5
- (p = i[h]) && (n = (s ? p(t, o, n) : p(n)) || n);
6
- return s && n && u(t, o, n), n;
7
- };
8
- let e = class extends g {
1
+ import { css as _, LitElement as f, nothing as l, html as n } from "lit";
2
+ import { property as r, state as v, customElement as b } from "lit/decorators.js";
3
+ var y = Object.defineProperty, z = Object.getOwnPropertyDescriptor, u = (t) => {
4
+ throw TypeError(t);
5
+ }, s = (t, i, e, o) => {
6
+ for (var c = o > 1 ? void 0 : o ? z(i, e) : i, h = t.length - 1, m; h >= 0; h--)
7
+ (m = t[h]) && (c = (o ? m(i, e, c) : m(c)) || c);
8
+ return o && c && y(i, e, c), c;
9
+ }, S = (t, i, e) => i.has(t) || u("Cannot " + e), k = (t, i, e) => i.has(t) ? u("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), g = (t, i, e) => (S(t, i, "access private method"), e), p, d;
10
+ let a = class extends f {
9
11
  constructor() {
10
- super(...arguments), this.src = "", this.alt = "", this.label = "", this.size = "medium", this.shape = "circular", this.iconName = "", this.variant = "image", this._imgError = !1, this._hasIconSlot = !1, this._onImgLoad = () => {
12
+ super(...arguments), k(this, p), this.src = "", this.alt = "", this.label = "", this.size = "medium", this.shape = "circular", this.iconName = "", this.variant = "image", this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this._imgError = !1, this._hasIconSlot = !1, this._onImgLoad = () => {
11
13
  this._imgError = !1, this.dispatchEvent(new CustomEvent("image-load", { bubbles: !0, composed: !0 }));
12
14
  }, this._onImgError = () => {
13
15
  this._imgError = !0, this.dispatchEvent(new CustomEvent("image-error", { bubbles: !0, composed: !0 }));
14
- }, this._onIconSlotChange = (i) => {
15
- const t = i.currentTarget;
16
- this._hasIconSlot = (t.assignedNodes({ flatten: !0 }) || []).length > 0;
16
+ }, this._onIconSlotChange = (t) => {
17
+ const i = t.currentTarget;
18
+ this._hasIconSlot = (i.assignedNodes({ flatten: !0 }) || []).length > 0;
17
19
  };
18
20
  }
19
21
  async firstUpdated() {
20
- this.variant === "icon" && await import("@material/web/icon/icon.js");
22
+ this.variant === "icon" && await import("@material/web/icon/icon.js"), g(this, p, d).call(this);
23
+ }
24
+ updated(t) {
25
+ super.updated(t), t.has("variant") && this.variant === "icon" && import("@material/web/icon/icon.js"), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && g(this, p, d).call(this);
21
26
  }
22
27
  _initials() {
23
- const i = (this.label || this.alt || "").trim();
24
- if (!i) return "?";
25
- const t = i.split(/\s+/).filter(Boolean);
26
- if (t.length === 1) return t[0].slice(0, 1).toUpperCase();
27
- const o = t[0].slice(0, 1), s = t[t.length - 1].slice(0, 1);
28
- return (o + s).toUpperCase();
28
+ const t = (this.label || this.alt || "").trim();
29
+ if (!t) return "?";
30
+ const i = t.split(/\s+/).filter(Boolean);
31
+ if (i.length === 1) return i[0].slice(0, 1).toUpperCase();
32
+ const e = i[0].slice(0, 1), o = i[i.length - 1].slice(0, 1);
33
+ return (e + o).toUpperCase();
29
34
  }
30
35
  _ariaLabel() {
31
- const i = (this.label || this.alt || "").trim();
32
- return i || null;
36
+ const t = (this.label || this.alt || "").trim();
37
+ return t || null;
38
+ }
39
+ // Mappar spacing-värden till spacing-token eller fritt css-värde.
40
+ mapSpacingToken(t) {
41
+ if (!t) return;
42
+ const i = String(t).trim();
43
+ if (i)
44
+ return /^\d+$/.test(i) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(i, 10)))})` : i;
33
45
  }
34
46
  render() {
35
- const i = this._ariaLabel(), t = this.variant === "image" && !!this.src && !this._imgError, o = a`${c}
47
+ const t = this._ariaLabel(), i = this.variant === "image" && !!this.src && !this._imgError, e = n`${l}
36
48
  <slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
37
- ${this._hasIconSlot ? c : this.iconName ? a`<md-icon aria-hidden="true">${this.iconName}</md-icon>` : a`<div class="fallback" part="fallback">${this._initials()}</div>`}
38
- `, s = t ? a`<img class="photo" part="image" src=${this.src} alt=${this.alt}
39
- @load=${this._onImgLoad} @error=${this._onImgError} />` : a`
49
+ ${this._hasIconSlot ? l : this.iconName ? n`<md-icon aria-hidden="true">${this.iconName}</md-icon>` : n`<div class="fallback" part="fallback">${this._initials()}</div>`}
50
+ `, o = i ? n`<img
51
+ class="photo"
52
+ part="image"
53
+ src=${this.src}
54
+ alt=${this.alt}
55
+ @load=${this._onImgLoad}
56
+ @error=${this._onImgError}
57
+ />` : n`
40
58
  <slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
41
- ${this._hasIconSlot ? c : this.iconName ? a`<md-icon aria-hidden="true">${this.iconName}</md-icon>` : a`<div class="fallback" part="fallback">${this._initials()}</div>`}
59
+ ${this._hasIconSlot ? l : this.iconName ? n`<md-icon aria-hidden="true">${this.iconName}</md-icon>` : n`<div class="fallback" part="fallback">${this._initials()}</div>`}
42
60
  `;
43
- return a`
44
- <div class="container" part="container" role="img" aria-label=${i ?? c}>
45
- ${this.variant === "icon" ? o : s}
61
+ return n`
62
+ <div class="container" part="container" role="img" aria-label=${t ?? l}>
63
+ ${this.variant === "icon" ? e : o}
46
64
  </div>
47
65
  `;
48
66
  }
49
67
  };
50
- e.styles = d`
68
+ p = /* @__PURE__ */ new WeakSet();
69
+ d = function() {
70
+ const t = this.mapSpacingToken(this.spacing), i = this.mapSpacingToken(this.spacingTop) ?? t, e = this.mapSpacingToken(this.spacingBottom) ?? t;
71
+ i ? this.style.setProperty("--scb-avatar-spacing-block-start", i) : this.style.removeProperty("--scb-avatar-spacing-block-start"), e ? this.style.setProperty("--scb-avatar-spacing-block-end", e) : this.style.removeProperty("--scb-avatar-spacing-block-end");
72
+ };
73
+ a.styles = _`
51
74
  :host {
52
75
  display: inline-block;
53
76
  vertical-align: middle;
77
+ margin-block-start: var(--scb-avatar-spacing-block-start, 0);
78
+ margin-block-end: var(--scb-avatar-spacing-block-end, 0);
79
+
54
80
  --_size: 40px;
55
81
  --_font-size: 16px;
56
82
  --_bg: var(--md-sys-color-primary-fixed-dim, var(--md-sys-color-primary-container));
@@ -134,36 +160,45 @@ e.styles = d`
134
160
  border-radius: var(--_radius);
135
161
  }
136
162
  `;
137
- r([
138
- l({ type: String })
139
- ], e.prototype, "src", 2);
140
- r([
141
- l({ type: String })
142
- ], e.prototype, "alt", 2);
143
- r([
144
- l({ type: String })
145
- ], e.prototype, "label", 2);
146
- r([
147
- l({ type: String, reflect: !0 })
148
- ], e.prototype, "size", 2);
149
- r([
150
- l({ type: String, reflect: !0 })
151
- ], e.prototype, "shape", 2);
152
- r([
153
- l({ type: String, attribute: "icon-name", reflect: !0 })
154
- ], e.prototype, "iconName", 2);
155
- r([
156
- l({ type: String, reflect: !0 })
157
- ], e.prototype, "variant", 2);
158
- r([
159
- m()
160
- ], e.prototype, "_imgError", 2);
161
- r([
162
- m()
163
- ], e.prototype, "_hasIconSlot", 2);
164
- e = r([
165
- v("scb-avatar")
166
- ], e);
163
+ s([
164
+ r({ type: String })
165
+ ], a.prototype, "src", 2);
166
+ s([
167
+ r({ type: String })
168
+ ], a.prototype, "alt", 2);
169
+ s([
170
+ r({ type: String })
171
+ ], a.prototype, "label", 2);
172
+ s([
173
+ r({ type: String, reflect: !0 })
174
+ ], a.prototype, "size", 2);
175
+ s([
176
+ r({ type: String, reflect: !0 })
177
+ ], a.prototype, "shape", 2);
178
+ s([
179
+ r({ type: String, attribute: "icon-name", reflect: !0 })
180
+ ], a.prototype, "iconName", 2);
181
+ s([
182
+ r({ type: String, reflect: !0 })
183
+ ], a.prototype, "variant", 2);
184
+ s([
185
+ r({ type: String, reflect: !0 })
186
+ ], a.prototype, "spacing", 2);
187
+ s([
188
+ r({ type: String, attribute: "spacing-top", reflect: !0 })
189
+ ], a.prototype, "spacingTop", 2);
190
+ s([
191
+ r({ type: String, attribute: "spacing-bottom", reflect: !0 })
192
+ ], a.prototype, "spacingBottom", 2);
193
+ s([
194
+ v()
195
+ ], a.prototype, "_imgError", 2);
196
+ s([
197
+ v()
198
+ ], a.prototype, "_hasIconSlot", 2);
199
+ a = s([
200
+ b("scb-avatar")
201
+ ], a);
167
202
  export {
168
- e as ScbAvatar
203
+ a as ScbAvatar
169
204
  };
@@ -1,10 +1,10 @@
1
1
  import { LitElement as p, css as b, html as l } from "lit";
2
- import { property as u, customElement as m } from "lit/decorators.js";
2
+ import { property as o, customElement as m } from "lit/decorators.js";
3
3
  import "../scb-link/scb-link.js";
4
- var h = Object.defineProperty, f = Object.getOwnPropertyDescriptor, n = (t, s, i, a) => {
5
- for (var r = a > 1 ? void 0 : a ? f(s, i) : s, o = t.length - 1, c; o >= 0; o--)
6
- (c = t[o]) && (r = (a ? c(s, i, r) : c(r)) || r);
7
- return a && r && h(s, i, r), r;
4
+ var f = Object.defineProperty, h = Object.getOwnPropertyDescriptor, n = (t, s, c, a) => {
5
+ for (var r = a > 1 ? void 0 : a ? h(s, c) : s, i = t.length - 1, u; i >= 0; i--)
6
+ (u = t[i]) && (r = (a ? u(s, c, r) : u(r)) || r);
7
+ return a && r && f(s, c, r), r;
8
8
  };
9
9
  let e = class extends p {
10
10
  constructor() {
@@ -19,7 +19,6 @@ let e = class extends p {
19
19
 
20
20
  .breadcrumb-current {
21
21
  color: var(--md-sys-color-on-surface);
22
- font-weight: var(--weight-semibold);
23
22
  font-family: var(--brand, Inter);
24
23
  }
25
24
  `;
@@ -47,13 +46,13 @@ let e = class extends p {
47
46
  }
48
47
  };
49
48
  n([
50
- u({ type: String })
49
+ o({ type: String })
51
50
  ], e.prototype, "label", 2);
52
51
  n([
53
- u({ type: Boolean, attribute: "is-current", reflect: !0 })
52
+ o({ type: Boolean, attribute: "is-current", reflect: !0 })
54
53
  ], e.prototype, "isCurrent", 2);
55
54
  n([
56
- u({ type: String, attribute: "item-href" })
55
+ o({ type: String, attribute: "item-href" })
57
56
  ], e.prototype, "href", 2);
58
57
  e = n([
59
58
  m("scb-breadcrumb-item")
@@ -1,11 +1,17 @@
1
1
  import { LitElement, TemplateResult } from 'lit';
2
2
  export declare class SCBBreadcrumb extends LitElement {
3
+ #private;
3
4
  showAll: boolean;
5
+ spacing: string;
6
+ spacingTop: string;
7
+ spacingBottom: string;
4
8
  private _observer?;
5
9
  static get styles(): import('lit').CSSResult;
6
10
  connectedCallback(): void;
7
11
  disconnectedCallback(): void;
12
+ protected firstUpdated(): void;
8
13
  protected updated(changed: Map<string, unknown>): void;
14
+ private mapSpacingToken;
9
15
  private _onEllipsisClick;
10
16
  render(): TemplateResult;
11
17
  }
@@ -1,19 +1,27 @@
1
- import { LitElement as d, css as p, html as o } from "lit";
2
- import { property as m, customElement as b } from "lit/decorators.js";
1
+ import { LitElement as u, css as f, html as d } from "lit";
2
+ import { property as n, customElement as g } from "lit/decorators.js";
3
3
  import "./scb-breadcrumb-item.js";
4
4
  import "@material/web/icon/icon.js";
5
5
  import "@material/web/focus/md-focus-ring.js";
6
- var u = Object.defineProperty, h = Object.getOwnPropertyDescriptor, n = (e, a, s, t) => {
7
- for (var r = t > 1 ? void 0 : t ? h(a, s) : a, l = e.length - 1, i; l >= 0; l--)
8
- (i = e[l]) && (r = (t ? i(a, s, r) : i(r)) || r);
9
- return t && r && u(a, s, r), r;
10
- };
11
- let c = class extends d {
6
+ var y = Object.defineProperty, v = Object.getOwnPropertyDescriptor, h = (e) => {
7
+ throw TypeError(e);
8
+ }, o = (e, t, s, a) => {
9
+ for (var r = a > 1 ? void 0 : a ? v(t, s) : t, l = e.length - 1, p; l >= 0; l--)
10
+ (p = e[l]) && (r = (a ? p(t, s, r) : p(r)) || r);
11
+ return a && r && y(t, s, r), r;
12
+ }, w = (e, t, s) => t.has(e) || h("Cannot " + s), k = (e, t, s) => t.has(e) ? h("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), m = (e, t, s) => (w(e, t, "access private method"), s), c, b;
13
+ let i = class extends u {
12
14
  constructor() {
13
- super(...arguments), this.showAll = !1;
15
+ super(...arguments), k(this, c), this.showAll = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
14
16
  }
15
17
  static get styles() {
16
- return p`
18
+ return f`
19
+ :host {
20
+ display: block;
21
+ margin-block-start: var(--scb-breadcrumb-spacing-block-start, 0);
22
+ margin-block-end: var(--scb-breadcrumb-spacing-block-end, 0);
23
+ }
24
+
17
25
  .scb-breadcrumb {
18
26
  display: flex;
19
27
  align-items: center;
@@ -92,6 +100,9 @@ let c = class extends d {
92
100
  var e;
93
101
  super.disconnectedCallback(), (e = this._observer) == null || e.disconnect();
94
102
  }
103
+ firstUpdated() {
104
+ m(this, c, b).call(this);
105
+ }
95
106
  // Sänd event när showAll förändras (för Blazor-bryggan: show-all-changed)
96
107
  updated(e) {
97
108
  e.has("showAll") && this.dispatchEvent(
@@ -100,16 +111,22 @@ let c = class extends d {
100
111
  bubbles: !0,
101
112
  composed: !0
102
113
  })
103
- );
114
+ ), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom")) && m(this, c, b).call(this);
115
+ }
116
+ mapSpacingToken(e) {
117
+ if (!e) return;
118
+ const t = String(e).trim();
119
+ if (t)
120
+ return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
104
121
  }
105
122
  _onEllipsisClick() {
106
123
  this.showAll ? this.showAll = !1 : (this.showAll = !0, this.updateComplete.then(() => {
107
- var a;
108
- const e = (a = this.shadowRoot) == null ? void 0 : a.querySelectorAll(
124
+ var t;
125
+ const e = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll(
109
126
  ".scb-breadcrumb.expanded > scb-breadcrumb-item"
110
127
  );
111
- e && (e.forEach((s, t) => {
112
- s.classList.add("breadcrumb-animate"), s.style.animationDelay = `${t * 60}ms`;
128
+ e && (e.forEach((s, a) => {
129
+ s.classList.add("breadcrumb-animate"), s.style.animationDelay = `${a * 60}ms`;
113
130
  }), setTimeout(() => {
114
131
  e.forEach((s) => {
115
132
  s.classList.remove("breadcrumb-animate"), s.style.animationDelay = "";
@@ -125,15 +142,15 @@ let c = class extends d {
125
142
  (s) => s.tagName.toLowerCase() === "scb-breadcrumb-item"
126
143
  )), e.length > 0) {
127
144
  const s = e.length - 1;
128
- e.forEach((t, r) => {
129
- t.toggleAttribute("is-current", r === s);
145
+ e.forEach((a, r) => {
146
+ a.toggleAttribute("is-current", r === s);
130
147
  });
131
148
  }
132
- const a = e.length > 6 && !this.showAll;
133
- return o`
134
- <div class="scb-breadcrumb ${a ? "collapsed" : "expanded"}">
135
- ${a ? e.map(
136
- (s, t) => t === 3 ? o`<span
149
+ const t = e.length > 6 && !this.showAll;
150
+ return d`
151
+ <div class="scb-breadcrumb ${t ? "collapsed" : "expanded"}">
152
+ ${t ? e.map(
153
+ (s, a) => a === 3 ? d`<span
137
154
  class="ellipsis"
138
155
  aria-label="Visa alla"
139
156
  role="button"
@@ -149,18 +166,32 @@ let c = class extends d {
149
166
  </md-icon>
150
167
  </span>
151
168
  <span class="breadcrumb-separator">/</span>
152
- ${s}` : o`${s}`
169
+ ${s}` : d`${s}`
153
170
  ) : e.map((s) => s)}
154
171
  </div>
155
172
  `;
156
173
  }
157
174
  };
158
- n([
159
- m({ type: Boolean, attribute: "show-all", reflect: !0 })
160
- ], c.prototype, "showAll", 2);
161
- c = n([
162
- b("scb-breadcrumb")
163
- ], c);
175
+ c = /* @__PURE__ */ new WeakSet();
176
+ b = function() {
177
+ const e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, s = this.mapSpacingToken(this.spacingBottom) ?? e;
178
+ t ? this.style.setProperty("--scb-breadcrumb-spacing-block-start", t) : this.style.removeProperty("--scb-breadcrumb-spacing-block-start"), s ? this.style.setProperty("--scb-breadcrumb-spacing-block-end", s) : this.style.removeProperty("--scb-breadcrumb-spacing-block-end");
179
+ };
180
+ o([
181
+ n({ type: Boolean, attribute: "show-all", reflect: !0 })
182
+ ], i.prototype, "showAll", 2);
183
+ o([
184
+ n({ type: String, reflect: !0 })
185
+ ], i.prototype, "spacing", 2);
186
+ o([
187
+ n({ type: String, attribute: "spacing-top", reflect: !0 })
188
+ ], i.prototype, "spacingTop", 2);
189
+ o([
190
+ n({ type: String, attribute: "spacing-bottom", reflect: !0 })
191
+ ], i.prototype, "spacingBottom", 2);
192
+ i = o([
193
+ g("scb-breadcrumb")
194
+ ], i);
164
195
  export {
165
- c as SCBBreadcrumb
196
+ i as SCBBreadcrumb
166
197
  };
@@ -2,6 +2,7 @@ import { LitElement, TemplateResult } from 'lit';
2
2
  /** "filled", "outlined", "filled-tonal" eller "text" */
3
3
  export type ScbButtonVariant = 'filled' | 'outlined' | 'filled-tonal' | 'text';
4
4
  export declare class ScbButton extends LitElement {
5
+ #private;
5
6
  variant: ScbButtonVariant;
6
7
  type: string;
7
8
  label: string;
@@ -11,6 +12,9 @@ export declare class ScbButton extends LitElement {
11
12
  href: string;
12
13
  target: string;
13
14
  rel: string;
15
+ spacing: string;
16
+ spacingTop: string;
17
+ spacingBottom: string;
14
18
  private __ariaObserver?;
15
19
  private __getMdHost;
16
20
  private __getInnerNativeButton;
@@ -18,6 +22,12 @@ export declare class ScbButton extends LitElement {
18
22
  protected firstUpdated(): void;
19
23
  protected updated(changed: Map<string, unknown>): void;
20
24
  disconnectedCallback(): void;
25
+ private mapSpacingToken;
21
26
  static get styles(): import('lit').CSSResult;
22
27
  render(): TemplateResult;
23
28
  }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'scb-button': ScbButton;
32
+ }
33
+ }