scb-wc-test 0.1.11 → 0.1.13

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 (95) hide show
  1. package/all.js +2 -0
  2. package/index.d.ts +1 -0
  3. package/index.js +34 -32
  4. package/mvc/components/all.js +1 -0
  5. package/mvc/components/scb-accordion/scb-accordion-item.js +21 -61
  6. package/mvc/components/scb-app-bar/scb-app-bar.js +1 -1
  7. package/mvc/components/scb-avatar/scb-avatar.js +1 -1
  8. package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +1 -1
  9. package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +1 -1
  10. package/mvc/components/scb-button/scb-button.js +1 -1
  11. package/mvc/components/scb-calendar-card/scb-calendar-card.js +165 -126
  12. package/mvc/components/scb-card/scb-card.js +223 -217
  13. package/mvc/components/scb-checkbox/scb-checkbox-group.js +1 -1
  14. package/mvc/components/scb-checkbox/scb-checkbox.js +9 -11
  15. package/mvc/components/scb-chips/scb-chip.js +1 -1
  16. package/mvc/components/scb-dialog/scb-dialog.js +2 -2
  17. package/mvc/components/scb-divider/scb-divider.js +43 -53
  18. package/mvc/components/scb-drawer/scb-drawer-item.js +2 -2
  19. package/mvc/components/scb-drawer/scb-drawer-section.js +4 -4
  20. package/mvc/components/scb-drawer/scb-drawer.js +1 -1
  21. package/mvc/components/scb-drawer/scb-sub-drawer.js +1 -1
  22. package/mvc/components/scb-fact-card/scb-fact-card-content.js +1 -1
  23. package/mvc/components/scb-fact-card/scb-fact-card.js +68 -55
  24. package/mvc/components/scb-footer/scb-footer-section.js +2 -2
  25. package/mvc/components/scb-footer/scb-footer.js +1 -1
  26. package/mvc/components/scb-grid/scb-grid-item.js +5 -3
  27. package/mvc/components/scb-grid/scb-grid.js +27 -10
  28. package/mvc/components/scb-grid/scb-stack.js +10 -6
  29. package/mvc/components/scb-header/scb-header-drawer-group.js +1 -1
  30. package/mvc/components/scb-header/scb-header-drawer-item.js +1 -1
  31. package/mvc/components/scb-header/scb-header-tab.js +1 -1
  32. package/mvc/components/scb-header/scb-header-utility.js +1 -1
  33. package/mvc/components/scb-header/scb-header.js +53 -49
  34. package/mvc/components/scb-icon-button/scb-icon-button.js +45 -80
  35. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +84 -58
  36. package/mvc/components/scb-link/scb-link.js +39 -16
  37. package/mvc/components/scb-list/scb-list-item.js +115 -37
  38. package/mvc/components/scb-list/scb-list.js +16 -7
  39. package/mvc/components/scb-menu/scb-menu-item.js +1 -1
  40. package/mvc/components/scb-menu/scb-menu.js +1 -1
  41. package/mvc/components/scb-menu/scb-sub-menu.js +1 -1
  42. package/mvc/components/scb-notification/scb-notification.js +1 -1
  43. package/mvc/components/scb-notification-card/scb-notification-card.js +187 -0
  44. package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +1 -1
  45. package/mvc/components/scb-radio-button/scb-radio-button.js +29 -36
  46. package/mvc/components/scb-radio-button/scb-radio-group.js +1 -1
  47. package/mvc/components/scb-search/scb-search.js +48 -37
  48. package/mvc/components/scb-snackbar/scb-snackbar.js +8 -8
  49. package/mvc/components/scb-status-pill/scb-status-pill.js +1 -1
  50. package/mvc/components/scb-switch/scb-switch.js +1 -1
  51. package/mvc/components/scb-tabs/scb-primary-tab.js +1 -1
  52. package/mvc/components/scb-tabs/scb-secondary-tab.js +1 -1
  53. package/mvc/components/scb-tabs/scb-tabs.js +1 -1
  54. package/mvc/components/scb-textfield/scb-textfield.js +1 -1
  55. package/mvc/components/scb-toc/scb-toc-item.js +1 -1
  56. package/mvc/components/scb-toc/scb-toc.js +2 -2
  57. package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
  58. package/mvc/vendor/vendor-material.js +232 -312
  59. package/mvc/vendor/vendor.js +19 -23
  60. package/package.json +6 -2
  61. package/scb-accordion/scb-accordion-item.js +47 -98
  62. package/scb-calendar-card/scb-calendar-card.d.ts +6 -4
  63. package/scb-calendar-card/scb-calendar-card.js +207 -154
  64. package/scb-card/scb-card.d.ts +8 -3
  65. package/scb-card/scb-card.js +265 -250
  66. package/scb-checkbox/scb-checkbox.d.ts +1 -0
  67. package/scb-checkbox/scb-checkbox.js +56 -49
  68. package/scb-divider/scb-divider.d.ts +16 -4
  69. package/scb-divider/scb-divider.js +63 -69
  70. package/scb-fact-card/scb-fact-card.d.ts +8 -7
  71. package/scb-fact-card/scb-fact-card.js +100 -78
  72. package/scb-grid/scb-grid-item.d.ts +7 -2
  73. package/scb-grid/scb-grid-item.js +47 -33
  74. package/scb-grid/scb-grid.d.ts +7 -3
  75. package/scb-grid/scb-grid.js +57 -21
  76. package/scb-grid/scb-stack.d.ts +5 -1
  77. package/scb-grid/scb-stack.js +57 -31
  78. package/scb-header/scb-header.d.ts +1 -2
  79. package/scb-header/scb-header.js +154 -162
  80. package/scb-icon-button/scb-icon-button.d.ts +15 -11
  81. package/scb-icon-button/scb-icon-button.js +149 -132
  82. package/scb-keyfigure-card/scb-keyfigure-card.d.ts +6 -1
  83. package/scb-keyfigure-card/scb-keyfigure-card.js +139 -93
  84. package/scb-link/scb-link.d.ts +1 -0
  85. package/scb-link/scb-link.js +65 -38
  86. package/scb-list/scb-list-item.d.ts +8 -5
  87. package/scb-list/scb-list-item.js +183 -73
  88. package/scb-list/scb-list.d.ts +5 -0
  89. package/scb-list/scb-list.js +71 -21
  90. package/scb-notification-card/scb-notification-card.d.ts +18 -0
  91. package/scb-notification-card/scb-notification-card.js +264 -0
  92. package/scb-radio-button/scb-radio-button.js +46 -53
  93. package/scb-search/scb-search.d.ts +8 -0
  94. package/scb-search/scb-search.js +176 -139
  95. package/scb-wc-test.bundle.js +1870 -1546
@@ -1,12 +1,12 @@
1
- import { css as x, LitElement as v, nothing as b, html as g } from "lit";
2
- import { property as n, customElement as f } from "lit/decorators.js";
1
+ import { css as x, LitElement as y, nothing as b, html as u } from "lit";
2
+ import { property as d, customElement as v } from "lit/decorators.js";
3
3
  import "@material/web/checkbox/checkbox.js";
4
- var y = Object.defineProperty, k = Object.getOwnPropertyDescriptor, l = (t, s, a, o) => {
5
- for (var e = o > 1 ? void 0 : o ? k(s, a) : s, d = t.length - 1, p; d >= 0; d--)
6
- (p = t[d]) && (e = (o ? p(s, a, e) : p(e)) || e);
7
- return o && e && y(s, a, e), e;
4
+ var f = Object.defineProperty, k = Object.getOwnPropertyDescriptor, l = (e, s, r, o) => {
5
+ for (var t = o > 1 ? void 0 : o ? k(s, r) : s, a = e.length - 1, p; a >= 0; a--)
6
+ (p = e[a]) && (t = (o ? p(s, r, t) : p(t)) || t);
7
+ return o && t && f(s, r, t), t;
8
8
  };
9
- let r = class extends v {
9
+ let i = class extends y {
10
10
  constructor() {
11
11
  super(...arguments), this.disabled = !1, this.indeterminate = !1, this.checked = !1, this.label = "", this.supportingText = "", this._checkboxId = "";
12
12
  }
@@ -14,61 +14,68 @@ let r = class extends v {
14
14
  super.connectedCallback(), this._checkboxId = this.id || `scb-checkbox-${Math.random().toString(36).slice(2, 11)}`;
15
15
  }
16
16
  firstUpdated() {
17
- var a, o;
18
- const t = (a = this.shadowRoot) == null ? void 0 : a.querySelector("md-checkbox");
19
- t && t.addEventListener("change", () => {
20
- const e = t.checked;
21
- this.checked = e, this.dispatchEvent(
17
+ var r, o;
18
+ const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector("md-checkbox");
19
+ e && e.addEventListener("change", () => {
20
+ const t = e.checked;
21
+ this.checked = t, this.dispatchEvent(
22
22
  new CustomEvent("change", {
23
- detail: { checked: e },
23
+ detail: { checked: t },
24
24
  bubbles: !0,
25
25
  composed: !0
26
26
  })
27
27
  );
28
28
  });
29
29
  const s = (o = this.shadowRoot) == null ? void 0 : o.querySelector("label.wrap");
30
- s == null || s.addEventListener("click", (e) => {
30
+ s == null || s.addEventListener("click", (t) => {
31
31
  if (this.disabled) return;
32
- if (!e.composedPath().some((i) => {
33
- var h, u, m;
34
- const c = i;
35
- return ((u = (h = c == null ? void 0 : c.tagName) == null ? void 0 : h.toLowerCase) == null ? void 0 : u.call(h)) === "md-checkbox" || ((m = c == null ? void 0 : c.classList) == null ? void 0 : m.contains("box-wrap"));
32
+ if (!t.composedPath().some((c) => {
33
+ var h, m, g;
34
+ const n = c;
35
+ return ((m = (h = n == null ? void 0 : n.tagName) == null ? void 0 : h.toLowerCase) == null ? void 0 : m.call(h)) === "md-checkbox" || ((g = n == null ? void 0 : n.classList) == null ? void 0 : g.contains("box-wrap"));
36
36
  })) {
37
- e.preventDefault();
38
- const i = this.shadowRoot.querySelector("md-checkbox");
39
- i && (i.checked = !i.checked, i.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })));
37
+ t.preventDefault();
38
+ const c = this.shadowRoot.querySelector("md-checkbox");
39
+ c && (c.checked = !c.checked, c.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })));
40
40
  }
41
- });
41
+ }), this.__syncInnerAria();
42
+ }
43
+ updated(e) {
44
+ super.updated(e), e.has("disabled") && this.toggleAttribute("aria-disabled", this.disabled), (e.has("label") || e.has("supportingText")) && this.__syncInnerAria();
42
45
  }
43
- updated(t) {
44
- super.updated(t), t.has("disabled") && this.toggleAttribute("aria-disabled", this.disabled);
46
+ __syncInnerAria() {
47
+ var a;
48
+ const e = (a = this.shadowRoot) == null ? void 0 : a.querySelector("md-checkbox"), s = e == null ? void 0 : e.shadowRoot;
49
+ if (!s) return;
50
+ const r = s.querySelector('[role="checkbox"]') || s.querySelector('input[type="checkbox"]');
51
+ if (!r) return;
52
+ const o = this.label ? `${this._checkboxId}-label` : "", t = this.supportingText ? `${this._checkboxId}-supporting-text` : "";
53
+ o ? r.setAttribute("aria-labelledby", o) : r.removeAttribute("aria-labelledby"), t ? r.setAttribute("aria-describedby", t) : r.removeAttribute("aria-describedby");
45
54
  }
46
55
  render() {
47
- const t = this.supportingText ? `${this._checkboxId}-supporting-text` : void 0;
48
- return g`
56
+ const e = this.supportingText ? `${this._checkboxId}-supporting-text` : void 0;
57
+ return u`
49
58
  <label class="wrap">
50
59
  <div class="box-wrap">
51
60
  <md-checkbox
52
61
  id="${this._checkboxId}"
53
- touch-target="wrapper"
54
62
  ?disabled=${this.disabled}
55
63
  ?indeterminate=${this.indeterminate}
56
64
  ?checked=${this.checked}
57
- aria-describedby=${t || b}
58
- aria-label=${this.label || b}
65
+ ${b}
59
66
  ></md-checkbox>
60
67
  </div>
61
- ${this.label ? g`<span class="lbl">${this.label}</span>` : b}
68
+ ${this.label ? u`<span class="lbl" id="${this._checkboxId}-label">${this.label}</span>` : b}
62
69
  </label>
63
70
 
64
- ${this.supportingText ? g`<div id="${this._checkboxId}-supporting-text" class="supporting-text">
71
+ ${this.supportingText ? u`<div id="${e}" class="supporting-text">
65
72
  ${this.supportingText}
66
73
  </div>` : b}
67
74
  <slot></slot>
68
75
  `;
69
76
  }
70
77
  };
71
- r.styles = x`
78
+ i.styles = x`
72
79
  :host {
73
80
  display: inline-grid;
74
81
  grid-template-columns: auto;
@@ -105,10 +112,10 @@ r.styles = x`
105
112
  .lbl {
106
113
  color: var(--md-sys-color-on-surface);
107
114
  font-family: var(--brand-font);
108
- font-size: var(--md-sys-typescale-body-large-size);
109
- line-height: var(--md-sys-typescale-body-large-line-height);
115
+ font-size: var(--md-sys-typescale-body-medium-size);
116
+ line-height: var(--md-sys-typescale-body-medium-line-height);
110
117
  font-weight: var(--weight-regular, 400);
111
- letter-spacing: var(--md-sys-typescale-body-large-tracking);
118
+ letter-spacing: var(--md-sys-typescale-body-medium-tracking);
112
119
  }
113
120
  :host([disabled]) .lbl { color: var(--n-60); }
114
121
 
@@ -125,23 +132,23 @@ r.styles = x`
125
132
  }
126
133
  `;
127
134
  l([
128
- n({ type: Boolean, reflect: !0 })
129
- ], r.prototype, "disabled", 2);
135
+ d({ type: Boolean, reflect: !0 })
136
+ ], i.prototype, "disabled", 2);
130
137
  l([
131
- n({ type: Boolean, reflect: !0 })
132
- ], r.prototype, "indeterminate", 2);
138
+ d({ type: Boolean, reflect: !0 })
139
+ ], i.prototype, "indeterminate", 2);
133
140
  l([
134
- n({ type: Boolean, reflect: !0 })
135
- ], r.prototype, "checked", 2);
141
+ d({ type: Boolean, reflect: !0 })
142
+ ], i.prototype, "checked", 2);
136
143
  l([
137
- n({ type: String })
138
- ], r.prototype, "label", 2);
144
+ d({ type: String })
145
+ ], i.prototype, "label", 2);
139
146
  l([
140
- n({ type: String, attribute: "supporting-text" })
141
- ], r.prototype, "supportingText", 2);
142
- r = l([
143
- f("scb-checkbox")
144
- ], r);
147
+ d({ type: String, attribute: "supporting-text" })
148
+ ], i.prototype, "supportingText", 2);
149
+ i = l([
150
+ v("scb-checkbox")
151
+ ], i);
145
152
  export {
146
- r as ScbCheckbox
153
+ i as ScbCheckbox
147
154
  };
@@ -1,8 +1,20 @@
1
1
  import { LitElement } from 'lit';
2
+ type Variant = 'thin' | 'bold';
3
+ type Direction = 'horizontal' | 'vertical';
4
+ type Inset = 'none' | 'both' | 'start' | 'end';
5
+ type Anchor = 'start' | 'end';
2
6
  export declare class ScbDivider extends LitElement {
3
- variant: 'thin' | 'bold';
4
- direction: 'horizontal' | 'vertical';
5
- inset: 'both' | 'start' | 'end';
6
- static styles: import('lit').CSSResult[];
7
+ variant: Variant;
8
+ direction: Direction;
9
+ inset: Inset;
10
+ overlay: boolean;
11
+ anchor: Anchor;
12
+ static styles: import('lit').CSSResult;
7
13
  render(): import('lit-html').TemplateResult<1>;
8
14
  }
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'scb-divider': ScbDivider;
18
+ }
19
+ }
20
+ export {};
@@ -1,84 +1,78 @@
1
- import { css as d, LitElement as p, html as v } from "lit";
2
- import { property as c, customElement as h } from "lit/decorators.js";
3
- var m = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (l, i, n, e) => {
4
- for (var t = e > 1 ? void 0 : e ? b(i, n) : i, s = l.length - 1, a; s >= 0; s--)
5
- (a = l[s]) && (t = (e ? a(i, n, t) : a(t)) || t);
6
- return e && t && m(i, n, t), t;
1
+ import { css as v, LitElement as d, html as p } from "lit";
2
+ import { property as i, customElement as b } from "lit/decorators.js";
3
+ var h = Object.defineProperty, g = Object.getOwnPropertyDescriptor, e = (l, o, s, n) => {
4
+ for (var t = n > 1 ? void 0 : n ? g(o, s) : o, c = l.length - 1, a; c >= 0; c--)
5
+ (a = l[c]) && (t = (n ? a(o, s, t) : a(t)) || t);
6
+ return n && t && h(o, s, t), t;
7
7
  };
8
- let r = class extends p {
8
+ let r = class extends d {
9
9
  constructor() {
10
- super(...arguments), this.variant = "thin", this.direction = "horizontal", this.inset = "both";
10
+ super(...arguments), this.variant = "thin", this.direction = "horizontal", this.inset = "none", this.overlay = !1, this.anchor = "end";
11
11
  }
12
12
  render() {
13
- return v`
14
- <div class="scb-divider"
15
- variant=${this.variant}
16
- direction=${this.direction}
17
- ></div>
18
- `;
13
+ return p``;
19
14
  }
20
15
  };
21
- r.styles = [
22
- d`
23
- :host {
24
- content: '';
25
- display: block;
26
- border-top: 1px solid var(--md-sys-color-outline-variant);
27
- width: 100%;
28
- }
16
+ r.styles = v`
17
+ :host {
18
+ --scb-divider-color: var(--md-sys-color-outline-variant);
19
+ --scb-divider-thickness: 1px;
20
+ --scb-divider-gap: var(--scb-grid-column-gap, var(--spacing-6, 24px));
21
+ display: block;
22
+ box-sizing: border-box;
23
+ pointer-events: none;
24
+ }
25
+ :host([variant="bold"]) {
26
+ --scb-divider-color: var(--md-sys-color-outline);
27
+ }
29
28
 
30
- :host([variant="bold"]) {
31
- border-top: 1px solid var(--md-sys-color-outline);
32
- }
33
- :host([direction="vertical"]) {
34
- border-top: none;
35
- border-left: 1px solid var(--md-sys-color-outline-variant);
36
- height: calc(100% - 20px);
37
- margin: 10px;
38
- width: 2px;
39
- }
29
+ :host(:not([direction="vertical"])) {
30
+ inline-size: 100%;
31
+ block-size: var(--scb-divider-thickness);
32
+ background: var(--scb-divider-color);
33
+ }
34
+ :host([inset="both"]:not([direction="vertical"])) { margin-inline: var(--spacing-8, 32px); }
35
+ :host([inset="start"]:not([direction="vertical"])) { margin-inline-start: var(--spacing-8, 32px); }
36
+ :host([inset="end"]:not([direction="vertical"])) { margin-inline-end: var(--spacing-8, 32px); }
40
37
 
41
- :host([variant="bold"][direction="vertical"]) {
42
- border-left: 1px solid var(--md-sys-color-outline);
43
- }
38
+ :host([direction="vertical"]) {
39
+ inline-size: var(--scb-divider-thickness);
40
+ block-size: 100%;
41
+ background: var(--scb-divider-color);
42
+ align-self: stretch;
43
+ justify-self: center;
44
+ }
45
+ :host([direction="vertical"][inset="both"]:not([overlay])) { margin-block: var(--spacing-8, 32px); }
46
+ :host([direction="vertical"][inset="start"]:not([overlay])) { margin-block-start: var(--spacing-8, 32px); }
47
+ :host([direction="vertical"][inset="end"]:not([overlay])) { margin-block-end: var(--spacing-8, 32px); }
44
48
 
45
-
46
- // // // :host([inset="both"]:not([direction="vertical"])) {
47
- // // // margin: 0 32px;
48
- // // // }
49
-
50
- // // // :host([inset="start"]:not([direction="vertical"])) {
51
- // // // margin-left: 32px;
52
- // // // }
53
-
54
- // // // :host([inset="end"]:not([direction="vertical"])) {
55
- // // // margin-right: 32px;
56
- // // // }
57
-
58
- // // // :host([inset="both"][direction="vertical"]) {
59
- // // // margin: 32px 0;
60
- // // // }
61
-
62
- // // // :host([inset="start"][direction="vertical"]) {
63
- // // // margin-top: 32px;
64
- // // // }
65
-
66
- // // // :host([inset="end"][direction="vertical"]) {
67
- // // // margin-bottom: 32px;
68
- // // // }
69
- `
70
- ];
71
- o([
72
- c({ type: String, reflect: !0 })
49
+ :host([overlay][direction="vertical"]) {
50
+ position: absolute;
51
+ top: 0;
52
+ bottom: 0;
53
+ inline-size: var(--scb-divider-thickness);
54
+ background: var(--scb-divider-color);
55
+ }
56
+ :host([overlay][direction="vertical"][anchor="end"]) { right: calc(var(--scb-divider-gap) / -2); }
57
+ :host([overlay][direction="vertical"][anchor="start"]){ left: calc(var(--scb-divider-gap) / -2); }
58
+ `;
59
+ e([
60
+ i({ type: String, reflect: !0 })
73
61
  ], r.prototype, "variant", 2);
74
- o([
75
- c({ type: String, reflect: !0 })
62
+ e([
63
+ i({ type: String, reflect: !0 })
76
64
  ], r.prototype, "direction", 2);
77
- o([
78
- c({ type: String, reflect: !0 })
65
+ e([
66
+ i({ type: String, reflect: !0 })
79
67
  ], r.prototype, "inset", 2);
80
- r = o([
81
- h("scb-divider")
68
+ e([
69
+ i({ type: Boolean, reflect: !0 })
70
+ ], r.prototype, "overlay", 2);
71
+ e([
72
+ i({ type: String, reflect: !0 })
73
+ ], r.prototype, "anchor", 2);
74
+ r = e([
75
+ b("scb-divider")
82
76
  ], r);
83
77
  export {
84
78
  r as ScbDivider
@@ -1,7 +1,4 @@
1
1
  import { LitElement } from 'lit';
2
- /**
3
- * Enkel faktakort-komponent för SCB-designsystemet
4
- */
5
2
  export declare class ScbFactCard extends LitElement {
6
3
  private __onCloseClick;
7
4
  variant: 'filled' | 'outlined';
@@ -10,12 +7,11 @@ export declare class ScbFactCard extends LitElement {
10
7
  supportingText: string;
11
8
  icon: string;
12
9
  showCloseButton: boolean;
13
- /**
14
- * Gör det möjligt att öppna/stänga kortet via aria-controls eller data-fact-card-toggle
15
- * (precis som scb-dialog). Hanterar även aria-expanded på triggern.
16
- */
17
10
  open: boolean;
18
11
  __lastTriggerEl: HTMLElement | null;
12
+ fullHeight: boolean;
13
+ fullWidth: boolean;
14
+ stretch: boolean;
19
15
  private __getActionFromEvent;
20
16
  private __onDocumentClick;
21
17
  connectedCallback(): void;
@@ -26,3 +22,8 @@ export declare class ScbFactCard extends LitElement {
26
22
  static styles: import('lit').CSSResult;
27
23
  render(): import('lit-html').TemplateResult<1>;
28
24
  }
25
+ declare global {
26
+ interface HTMLElementTagNameMap {
27
+ 'scb-fact-card': ScbFactCard;
28
+ }
29
+ }
@@ -1,19 +1,19 @@
1
- import { css as p, LitElement as u, html as n } from "lit";
2
- import { property as i, customElement as h } from "lit/decorators.js";
1
+ import { css as d, LitElement as u, html as a } from "lit";
2
+ import { property as s, customElement as h } from "lit/decorators.js";
3
3
  import "@material/web/icon/icon.js";
4
4
  import "@material/web/ripple/ripple.js";
5
5
  import "../scb-icon-button/scb-icon-button.js";
6
6
  import "./scb-fact-card-content.js";
7
- var b = Object.defineProperty, f = Object.getOwnPropertyDescriptor, r = (t, e, c, a) => {
8
- for (var s = a > 1 ? void 0 : a ? f(e, c) : e, l = t.length - 1, d; l >= 0; l--)
9
- (d = t[l]) && (s = (a ? d(e, c, s) : d(s)) || s);
10
- return a && s && b(e, c, s), s;
7
+ var f = Object.defineProperty, b = Object.getOwnPropertyDescriptor, i = (t, e, l, n) => {
8
+ for (var r = n > 1 ? void 0 : n ? b(e, l) : e, c = t.length - 1, p; c >= 0; c--)
9
+ (p = t[c]) && (r = (n ? p(e, l, r) : p(r)) || r);
10
+ return n && r && f(e, l, r), r;
11
11
  };
12
12
  let o = class extends u {
13
13
  constructor() {
14
14
  super(...arguments), this.__onCloseClick = (t) => {
15
15
  t.stopPropagation(), this.__setOpen(!1);
16
- }, this.variant = "filled", this.label = "", this.subLabel = "", this.supportingText = "", this.icon = "", this.showCloseButton = !1, this.open = !0, this.__lastTriggerEl = null, this.__onDocumentClick = (t) => {
16
+ }, this.variant = "filled", this.label = "", this.subLabel = "", this.supportingText = "", this.icon = "", this.showCloseButton = !1, this.open = !0, this.__lastTriggerEl = null, this.fullHeight = !1, this.fullWidth = !1, this.stretch = !1, this.__onDocumentClick = (t) => {
17
17
  this.__getActionFromEvent(t) === "toggle" && (this.__setOpen(!this.open), t.stopPropagation());
18
18
  };
19
19
  }
@@ -47,100 +47,122 @@ let o = class extends u {
47
47
  this.open = t, t && !e ? this.dispatchEvent(new CustomEvent("open", { bubbles: !0, composed: !0 })) : !t && e && this.dispatchEvent(new CustomEvent("close", { bubbles: !0, composed: !0 }));
48
48
  }
49
49
  render() {
50
- if (!this.open) return n``;
50
+ if (!this.open) return a``;
51
51
  const t = this.variant === "outlined" ? "outlined" : "filled";
52
- return n`
53
- ${this.icon ? n`<div class="icon-wrapper ${t}"><md-icon>${this.icon}</md-icon></div>` : ""}
54
- <div class="scb-fact-card ${t} ${this.icon ? "no-topleft-radius" : ""} ${this.showCloseButton ? "has-close" : ""}">
55
- ${this.showCloseButton ? n`<scb-icon-button variant="standard" icon="close" @click=${this.__onCloseClick}></scb-icon-button>` : ""}
56
- <div class="content">
57
- <slot></slot>
58
- </div>
59
- </div>
60
- `;
52
+ return a`
53
+ ${this.icon ? a`<div class="icon-wrapper ${t}"><md-icon>${this.icon}</md-icon></div>` : ""}
54
+ <div class="scb-fact-card ${t} ${this.icon ? "no-topleft-radius" : ""} ${this.showCloseButton ? "has-close" : ""}">
55
+ ${this.showCloseButton ? a`<scb-icon-button variant="standard" icon="close" @click=${this.__onCloseClick}></scb-icon-button>` : ""}
56
+ <div class="content">
57
+ <slot></slot>
58
+ </div>
59
+ </div>
60
+ `;
61
61
  }
62
62
  };
63
- o.styles = p`
64
- :host{ --scb-fact-card-max-w: 580px; }
63
+ o.styles = d`
65
64
  :host {
66
- max-width: var(--scb-fact-card-max-w);
67
- width: fit-content;
68
- display: block;
69
- position: relative;
65
+ --scb-fact-card-max-w: 580px;
66
+ display: block;
67
+ position: relative;
68
+ box-sizing: border-box;
69
+ inline-size: 100%;
70
+ min-inline-size: 0;
71
+ max-inline-size: var(--scb-fact-card-max-w);
72
+ height: auto;
70
73
  }
74
+
75
+ :host([full-width]) { max-inline-size: none; }
76
+
77
+ :host([stretch]),
78
+ :host([full-height]) { block-size: 100%; }
79
+
80
+ :host([stretch]) .scb-fact-card,
81
+ :host([full-height]) .scb-fact-card { block-size: 100%; }
82
+
71
83
  .scb-fact-card {
72
- color: var(--md-sys-color-on-surface);
73
- max-width: var(--scb-fact-card-max-w);
74
- width: fit-content;
75
- position: relative;
76
- border-radius: var(--md-sys-shape-corner-large);
77
- background: var(--md-sys-color-surface-dim);
78
- padding: var(--spacing-7);
79
- }
80
- .scb-fact-card.has-close {
81
- padding-right: var(--spacing-12);
82
- }
83
- .scb-fact-card.no-topleft-radius {
84
- border-top-left-radius: 0;
85
- margin-top: var(--spacing-9);
86
- }
87
- .scb-fact-card.outlined {
88
- border: 1px solid var(--md-sys-color-outline);
89
- background: var(--md-sys-color-surface);
84
+ color: var(--md-sys-color-on-surface);
85
+ position: relative;
86
+ border-radius: var(--md-sys-shape-corner-large);
87
+ background: var(--md-sys-color-surface-dim);
88
+ padding: var(--spacing-7);
89
+ box-sizing: border-box;
90
+ inline-size: 100%;
91
+ max-inline-size: 100%;
92
+ min-inline-size: 0;
93
+ overflow: hidden;
90
94
  }
95
+
96
+ .scb-fact-card.has-close { padding-right: var(--spacing-12); }
97
+ .scb-fact-card.no-topleft-radius { border-top-left-radius: 0; margin-top: var(--spacing-9); }
98
+ .scb-fact-card.outlined { border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); }
99
+
91
100
  .icon-wrapper {
92
- top: -40px;
93
- position: absolute;
94
- z-index: 1;
95
- padding: var(--spacing-5) var(--spacing-7);
96
- padding-bottom: 0;
97
- width: fit-content;
98
- border-radius: var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0 / var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0; /* halvmåne upptill */
99
- background: var(--md-sys-color-surface-dim);
100
- line-height: 0;
101
+ position: absolute;
102
+ z-index: 1;
103
+ top: -40px;
104
+ left: 0;
105
+ padding: var(--spacing-5) var(--spacing-7);
106
+ padding-bottom: 0;
107
+ width: fit-content;
108
+ border-radius: var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0 /
109
+ var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0 0;
110
+ background: var(--md-sys-color-surface-dim);
111
+ line-height: 0;
101
112
  }
102
113
  .icon-wrapper.outlined {
103
- border: var(--stroke-border) solid var(--md-sys-color-outline);
104
- border-bottom: none;
105
- background: var(--md-sys-color-surface);
114
+ border: var(--stroke-border) solid var(--md-sys-color-outline);
115
+ border-bottom: none;
116
+ background: var(--md-sys-color-surface);
106
117
  }
118
+
107
119
  scb-icon-button {
108
- position: absolute;
109
- right: var(--scale-01);
110
- top: var(--scale-01 );
111
- }
112
- .scb-fact-card.clickable {
113
- cursor: pointer;
120
+ position: absolute;
121
+ right: var(--scale-01);
122
+ top: var(--scale-01);
114
123
  }
124
+
125
+ .scb-fact-card.clickable { cursor: pointer; }
126
+
115
127
  .content {
116
- display: flex;
117
- flex-direction: column;
118
- gap: var(--spacing-8);
119
- width: 100%;
128
+ display: flex;
129
+ flex-direction: column;
130
+ gap: var(--spacing-8);
131
+ inline-size: 100%;
132
+ min-inline-size: 0;
120
133
  }
121
134
  `;
122
- r([
123
- i({ type: String })
135
+ i([
136
+ s({ type: String })
124
137
  ], o.prototype, "variant", 2);
125
- r([
126
- i({ type: String })
138
+ i([
139
+ s({ type: String })
127
140
  ], o.prototype, "label", 2);
128
- r([
129
- i({ type: String, attribute: "sub-label" })
141
+ i([
142
+ s({ type: String, attribute: "sub-label" })
130
143
  ], o.prototype, "subLabel", 2);
131
- r([
132
- i({ type: String, attribute: "supporting-text" })
144
+ i([
145
+ s({ type: String, attribute: "supporting-text" })
133
146
  ], o.prototype, "supportingText", 2);
134
- r([
135
- i({ type: String })
147
+ i([
148
+ s({ type: String })
136
149
  ], o.prototype, "icon", 2);
137
- r([
138
- i({ type: Boolean, attribute: "show-close-button" })
150
+ i([
151
+ s({ type: Boolean, attribute: "show-close-button" })
139
152
  ], o.prototype, "showCloseButton", 2);
140
- r([
141
- i({ type: Boolean, reflect: !0 })
153
+ i([
154
+ s({ type: Boolean, reflect: !0 })
142
155
  ], o.prototype, "open", 2);
143
- o = r([
156
+ i([
157
+ s({ type: Boolean, reflect: !0, attribute: "full-height" })
158
+ ], o.prototype, "fullHeight", 2);
159
+ i([
160
+ s({ type: Boolean, reflect: !0, attribute: "full-width" })
161
+ ], o.prototype, "fullWidth", 2);
162
+ i([
163
+ s({ type: Boolean, reflect: !0 })
164
+ ], o.prototype, "stretch", 2);
165
+ o = i([
144
166
  h("scb-fact-card")
145
167
  ], o);
146
168
  export {
@@ -2,9 +2,10 @@ import { LitElement } from 'lit';
2
2
  /**
3
3
  <scb-grid-item>
4
4
  Styr enskilda celler i <scb-grid>.
5
- - Span-attribut (reflectas som CSS-variabler) → läses av <scb-grid>
5
+ - Kolumn-span: col-span*, reflectas som CSS-variabler
6
+ - Rad-span: row-span*, omvandlas till "span N" och läses av <scb-grid>
6
7
  - Per-item justering: align/justify (align-self/justify-self)
7
- - fit (width: fit-content)
8
+ - fit: fyll radens höjd samt låt första slottade barnet sträcka sig
8
9
  */
9
10
  export declare class ScbGridItem extends LitElement {
10
11
  #private;
@@ -12,6 +13,10 @@ export declare class ScbGridItem extends LitElement {
12
13
  colSpanCompact?: number;
13
14
  colSpanMedium?: number;
14
15
  colSpanExpanded?: number;
16
+ rowSpan?: number;
17
+ rowSpanCompact?: number;
18
+ rowSpanMedium?: number;
19
+ rowSpanExpanded?: number;
15
20
  align?: 'start' | 'center' | 'end' | 'stretch';
16
21
  justify?: 'start' | 'center' | 'end' | 'stretch';
17
22
  fit: boolean;