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,65 +1,79 @@
1
- import { css as m, LitElement as f, html as b } from "lit";
2
- import { property as l, customElement as g } from "lit/decorators.js";
3
- var v = Object.defineProperty, S = Object.getOwnPropertyDescriptor, y = (e) => {
1
+ import { css as d, LitElement as f, html as b } from "lit";
2
+ import { property as a, customElement as S } from "lit/decorators.js";
3
+ var g = Object.defineProperty, w = Object.getOwnPropertyDescriptor, m = (e) => {
4
4
  throw TypeError(e);
5
- }, a = (e, t, r, c) => {
6
- for (var o = c > 1 ? void 0 : c ? S(t, r) : t, h = e.length - 1, u; h >= 0; h--)
7
- (u = e[h]) && (o = (c ? u(t, r, o) : u(o)) || o);
8
- return c && o && v(t, r, o), o;
9
- }, _ = (e, t, r) => t.has(e) || y("Cannot " + r), x = (e, t, r) => t.has(e) ? y("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), p = (e, t, r) => (_(e, t, "access private method"), r), i, d, n;
5
+ }, i = (e, t, p, c) => {
6
+ for (var n = c > 1 ? void 0 : c ? w(t, p) : t, u = e.length - 1, h; u >= 0; u--)
7
+ (h = e[u]) && (n = (c ? h(t, p, n) : h(n)) || n);
8
+ return c && n && g(t, p, n), n;
9
+ }, v = (e, t, p) => t.has(e) || m("Cannot " + p), _ = (e, t, p) => t.has(e) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, p), o = (e, t, p) => (v(e, t, "access private method"), p), r, y, l;
10
10
  let s = class extends f {
11
11
  constructor() {
12
- super(...arguments), x(this, i), this.fit = !1;
12
+ super(...arguments), _(this, r), this.fit = !1;
13
13
  }
14
14
  firstUpdated() {
15
- p(this, i, d).call(this);
15
+ o(this, r, y).call(this);
16
16
  }
17
17
  updated() {
18
- p(this, i, d).call(this);
18
+ o(this, r, y).call(this);
19
19
  }
20
20
  render() {
21
21
  return b`<slot></slot>`;
22
22
  }
23
23
  };
24
- i = /* @__PURE__ */ new WeakSet();
25
- d = function() {
26
- p(this, i, n).call(this, "--col-span", this.hasAttribute("col-span") ? String(this.colSpan) : null), p(this, i, n).call(this, "--col-span-compact", this.hasAttribute("col-span-compact") ? String(this.colSpanCompact) : null), p(this, i, n).call(this, "--col-span-medium", this.hasAttribute("col-span-medium") ? String(this.colSpanMedium) : null), p(this, i, n).call(this, "--col-span-expanded", this.hasAttribute("col-span-expanded") ? String(this.colSpanExpanded) : null), this.align ? this.style.setProperty("--scb-grid-item-align", this.align) : this.style.removeProperty("--scb-grid-item-align"), this.justify ? this.style.setProperty("--scb-grid-item-justify", this.justify) : this.style.removeProperty("--scb-grid-item-justify");
24
+ r = /* @__PURE__ */ new WeakSet();
25
+ y = function() {
26
+ o(this, r, l).call(this, "--col-span", this.hasAttribute("col-span") ? String(this.colSpan) : null), o(this, r, l).call(this, "--col-span-compact", this.hasAttribute("col-span-compact") ? String(this.colSpanCompact) : null), o(this, r, l).call(this, "--col-span-medium", this.hasAttribute("col-span-medium") ? String(this.colSpanMedium) : null), o(this, r, l).call(this, "--col-span-expanded", this.hasAttribute("col-span-expanded") ? String(this.colSpanExpanded) : null), o(this, r, l).call(this, "--row-rule", this.hasAttribute("row-span") ? `span ${this.rowSpan}` : null), o(this, r, l).call(this, "--row-rule-compact", this.hasAttribute("row-span-compact") ? `span ${this.rowSpanCompact}` : null), o(this, r, l).call(this, "--row-rule-medium", this.hasAttribute("row-span-medium") ? `span ${this.rowSpanMedium}` : null), o(this, r, l).call(this, "--row-rule-expanded", this.hasAttribute("row-span-expanded") ? `span ${this.rowSpanExpanded}` : null), this.align ? (this.style.setProperty("--scb-grid-item-align", this.align), this.style.setProperty("align-self", this.align)) : (this.style.removeProperty("--scb-grid-item-align"), this.style.removeProperty("align-self")), this.justify ? (this.style.setProperty("--scb-grid-item-justify", this.justify), this.style.setProperty("justify-self", this.justify)) : (this.style.removeProperty("--scb-grid-item-justify"), this.style.removeProperty("justify-self"));
27
27
  };
28
- n = function(e, t) {
28
+ l = function(e, t) {
29
29
  t === null || t === "" ? this.style.removeProperty(e) : this.style.setProperty(e, t);
30
30
  };
31
- s.styles = m`
31
+ s.styles = d`
32
32
  :host {
33
33
  box-sizing: border-box;
34
34
  display: block;
35
35
  align-self: var(--scb-grid-item-align, auto);
36
36
  justify-self: var(--scb-grid-item-justify, auto);
37
+ block-size: auto;
37
38
  }
38
- :host([fit]) { width: fit-content; max-width: 100%; }
39
+ :host([fit]) { block-size: 100%; }
40
+ :host([fit]) ::slotted(*) { block-size: 100%; }
39
41
  `;
40
- a([
41
- l({ type: Number, attribute: "col-span", reflect: !0 })
42
+ i([
43
+ a({ type: Number, attribute: "col-span", reflect: !0 })
42
44
  ], s.prototype, "colSpan", 2);
43
- a([
44
- l({ type: Number, attribute: "col-span-compact", reflect: !0 })
45
+ i([
46
+ a({ type: Number, attribute: "col-span-compact", reflect: !0 })
45
47
  ], s.prototype, "colSpanCompact", 2);
46
- a([
47
- l({ type: Number, attribute: "col-span-medium", reflect: !0 })
48
+ i([
49
+ a({ type: Number, attribute: "col-span-medium", reflect: !0 })
48
50
  ], s.prototype, "colSpanMedium", 2);
49
- a([
50
- l({ type: Number, attribute: "col-span-expanded", reflect: !0 })
51
+ i([
52
+ a({ type: Number, attribute: "col-span-expanded", reflect: !0 })
51
53
  ], s.prototype, "colSpanExpanded", 2);
52
- a([
53
- l({ type: String, reflect: !0 })
54
+ i([
55
+ a({ type: Number, attribute: "row-span", reflect: !0 })
56
+ ], s.prototype, "rowSpan", 2);
57
+ i([
58
+ a({ type: Number, attribute: "row-span-compact", reflect: !0 })
59
+ ], s.prototype, "rowSpanCompact", 2);
60
+ i([
61
+ a({ type: Number, attribute: "row-span-medium", reflect: !0 })
62
+ ], s.prototype, "rowSpanMedium", 2);
63
+ i([
64
+ a({ type: Number, attribute: "row-span-expanded", reflect: !0 })
65
+ ], s.prototype, "rowSpanExpanded", 2);
66
+ i([
67
+ a({ type: String, reflect: !0 })
54
68
  ], s.prototype, "align", 2);
55
- a([
56
- l({ type: String, reflect: !0 })
69
+ i([
70
+ a({ type: String, reflect: !0 })
57
71
  ], s.prototype, "justify", 2);
58
- a([
59
- l({ type: Boolean, reflect: !0 })
72
+ i([
73
+ a({ type: Boolean, reflect: !0 })
60
74
  ], s.prototype, "fit", 2);
61
- s = a([
62
- g("scb-grid-item")
75
+ s = i([
76
+ S("scb-grid-item")
63
77
  ], s);
64
78
  export {
65
79
  s as ScbGridItem
@@ -3,9 +3,10 @@ import { LitElement } from 'lit';
3
3
  * <scb-grid>
4
4
  * Responsivt kolumn-grid enligt M3 window size classes.
5
5
  * Kolumner: 4 (compact) / 8 (medium) / 12 (expanded)
6
- * Gap: var(--spacing-7, 24px) om inget anges
7
- * Barnen (grid-items) styra span via CSS-var som sätts av <scb-grid-item>:
8
- * --col-span, --col-span-compact, --col-span-medium, --col-span-expanded
6
+ * Default-gap: var(--spacing-7, 24px)
7
+ * Styrning via CSS-variabler som sätts av <scb-grid-item>:
8
+ * Kolumner: --col-span, --col-span-compact, --col-span-medium, --col-span-expanded
9
+ * Rader: --row-rule, --row-rule-compact, --row-rule-medium, --row-rule-expanded (t.ex. "span 2")
9
10
  */
10
11
  export declare class ScbGrid extends LitElement {
11
12
  #private;
@@ -20,9 +21,12 @@ export declare class ScbGrid extends LitElement {
20
21
  paddingInline: string;
21
22
  paddingBlock: string;
22
23
  maxWidth: string;
24
+ autoRows: string;
23
25
  static styles: import('lit').CSSResult;
24
26
  protected firstUpdated(): void;
25
27
  protected updated(): void;
28
+ private mapSpacingToken;
29
+ private parseGapShorthand;
26
30
  render(): import('lit-html').TemplateResult<1>;
27
31
  }
28
32
  declare global {
@@ -1,33 +1,49 @@
1
1
  import { css as h, LitElement as v, html as b } from "lit";
2
2
  import { property as a, customElement as y } from "lit/decorators.js";
3
- var x = Object.defineProperty, f = Object.getOwnPropertyDescriptor, u = (r) => {
3
+ var w = Object.defineProperty, f = Object.getOwnPropertyDescriptor, u = (r) => {
4
4
  throw TypeError(r);
5
- }, s = (r, t, i, n) => {
6
- for (var c = n > 1 ? void 0 : n ? f(t, i) : t, l = r.length - 1, m; l >= 0; l--)
7
- (m = r[l]) && (c = (n ? m(t, i, c) : m(c)) || c);
8
- return n && c && x(t, i, c), c;
9
- }, w = (r, t, i) => t.has(r) || u("Cannot " + i), _ = (r, t, i) => t.has(r) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, i), d = (r, t, i) => (w(r, t, "access private method"), i), o, g, p;
5
+ }, s = (r, t, i, c) => {
6
+ for (var o = c > 1 ? void 0 : c ? f(t, i) : t, d = r.length - 1, m; d >= 0; d--)
7
+ (m = r[d]) && (o = (c ? m(t, i, o) : m(o)) || o);
8
+ return c && o && w(t, i, o), o;
9
+ }, x = (r, t, i) => t.has(r) || u("Cannot " + i), S = (r, t, i) => t.has(r) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, i), p = (r, t, i) => (x(r, t, "access private method"), i), n, g, l;
10
10
  let e = class extends v {
11
11
  constructor() {
12
- super(...arguments), _(this, o), this.colsCompact = 4, this.colsMedium = 8, this.colsExpanded = 12, this.gap = "", this.rowGap = "", this.columnGap = "", this.alignItems = "stretch", this.justifyItems = "stretch", this.paddingInline = "", this.paddingBlock = "", this.maxWidth = "";
12
+ super(...arguments), S(this, n), this.colsCompact = 4, this.colsMedium = 8, this.colsExpanded = 12, this.gap = "", this.rowGap = "", this.columnGap = "", this.alignItems = "stretch", this.justifyItems = "stretch", this.paddingInline = "", this.paddingBlock = "", this.maxWidth = "", this.autoRows = "";
13
13
  }
14
14
  firstUpdated() {
15
- d(this, o, g).call(this);
15
+ p(this, n, g).call(this);
16
16
  }
17
17
  updated() {
18
- d(this, o, g).call(this);
18
+ p(this, n, g).call(this);
19
+ }
20
+ mapSpacingToken(r) {
21
+ if (!r) return;
22
+ const t = String(r).trim();
23
+ return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
24
+ }
25
+ parseGapShorthand(r) {
26
+ if (!r) return {};
27
+ const t = r.trim().split(/\s+/);
28
+ if (t.length === 1) {
29
+ const i = this.mapSpacingToken(t[0]);
30
+ return { row: i, col: i };
31
+ }
32
+ return { row: this.mapSpacingToken(t[0]), col: this.mapSpacingToken(t[1]) };
19
33
  }
20
34
  render() {
21
35
  return b`<div class="grid"><slot></slot></div>`;
22
36
  }
23
37
  };
24
- o = /* @__PURE__ */ new WeakSet();
38
+ n = /* @__PURE__ */ new WeakSet();
25
39
  g = function() {
26
40
  this.style.setProperty("--scb-grid-cols-compact", String(this.colsCompact)), this.style.setProperty("--scb-grid-cols-medium", String(this.colsMedium)), this.style.setProperty("--scb-grid-cols-expanded", String(this.colsExpanded));
27
- const r = "var(--spacing-7, 24px)", t = this.rowGap || this.gap || r, i = this.columnGap || this.gap || r;
28
- this.style.setProperty("--scb-grid-row-gap", t), this.style.setProperty("--scb-grid-column-gap", i), this.style.setProperty("--scb-grid-gap", `${t} ${i}`), this.style.setProperty("--scb-grid-align-items", this.alignItems), this.style.setProperty("--scb-grid-justify-items", this.justifyItems), d(this, o, p).call(this, "--scb-grid-max-width", this.maxWidth), d(this, o, p).call(this, "--scb-grid-padding-inline", this.paddingInline), d(this, o, p).call(this, "--scb-grid-padding-block", this.paddingBlock);
41
+ const r = "var(--spacing-7, 24px)", t = this.parseGapShorthand(this.gap), i = this.mapSpacingToken(this.rowGap) ?? t.row ?? r, c = this.mapSpacingToken(this.columnGap) ?? t.col ?? r;
42
+ this.style.setProperty("--scb-grid-row-gap", i), this.style.setProperty("--scb-grid-column-gap", c), this.style.setProperty("--scb-grid-gap", `${i} ${c}`), this.style.setProperty("--scb-grid-align-items", this.alignItems), this.style.setProperty("--scb-grid-justify-items", this.justifyItems);
43
+ const o = this.mapSpacingToken(this.paddingInline), d = this.mapSpacingToken(this.paddingBlock);
44
+ p(this, n, l).call(this, "--scb-grid-max-width", this.maxWidth), p(this, n, l).call(this, "--scb-grid-padding-inline", o ?? ""), p(this, n, l).call(this, "--scb-grid-padding-block", d ?? ""), p(this, n, l).call(this, "--scb-grid-auto-rows", this.autoRows);
29
45
  };
30
- p = function(r, t) {
46
+ l = function(r, t) {
31
47
  t ? this.style.setProperty(r, t) : this.style.removeProperty(r);
32
48
  };
33
49
  e.styles = h`
@@ -38,14 +54,18 @@ e.styles = h`
38
54
  margin-inline: auto;
39
55
  padding-inline: var(--scb-grid-padding-inline, 0);
40
56
  padding-block: var(--scb-grid-padding-block, 0);
41
-
42
57
  container-type: inline-size;
43
58
  }
44
59
 
45
60
  .grid {
46
61
  display: grid;
47
62
  width: 100%;
48
- gap: var(--scb-grid-gap, var(--spacing-7, 24px));
63
+ grid-auto-rows: var(--scb-grid-auto-rows, auto);
64
+
65
+ /* Longhands med fallback till --scb-grid-gap och sedan token-default */
66
+ row-gap: var(--scb-grid-row-gap, var(--scb-grid-gap, var(--spacing-7, 24px)));
67
+ column-gap: var(--scb-grid-column-gap, var(--scb-grid-gap, var(--spacing-7, 24px)));
68
+
49
69
  grid-auto-flow: row dense;
50
70
  grid-auto-rows: var(--scb-grid-auto-rows, auto);
51
71
  align-items: var(--scb-grid-align-items, stretch);
@@ -57,56 +77,69 @@ e.styles = h`
57
77
 
58
78
  .grid > slot { display: contents; }
59
79
 
80
+ /* Kolumn-span + rad-span (compact) */
60
81
  .grid ::slotted(*) {
61
- grid-column: span var(--col-span-compact, var(--col-span, var(--scb-grid-cols-compact, 4)));
82
+ min-width: 0;
83
+ min-height: 0;
62
84
  grid-column: span min(
63
85
  max(1, var(--col-span-compact, var(--col-span, var(--scb-grid-cols-compact, 4)))) ,
64
86
  var(--scb-grid-cols-compact, 4)
65
87
  );
88
+ grid-row: var(--row-rule-compact, var(--row-rule, auto));
66
89
  }
67
90
 
68
- @supports not (container-type: inline-size) {
91
+ /* Utan container queries -> media queries */
92
+ @supports not (container-type: inline-size) {
69
93
  @media (min-width: 600px) {
70
94
  .grid { grid-template-columns: repeat(var(--scb-grid-cols-medium, 8), minmax(0, 1fr)); }
71
95
  .grid ::slotted(*) {
72
- grid-column: span var(--col-span-medium, var(--col-span, var(--scb-grid-cols-medium, 8)));
96
+ min-width: 0;
97
+ min-height: 0;
73
98
  grid-column: span min(
74
99
  max(1, var(--col-span-medium, var(--col-span, var(--scb-grid-cols-medium, 8)))) ,
75
100
  var(--scb-grid-cols-medium, 8)
76
101
  );
102
+ grid-row: var(--row-rule-medium, var(--row-rule, auto));
77
103
  }
78
104
  }
79
105
  @media (min-width: 840px) {
80
106
  .grid { grid-template-columns: repeat(var(--scb-grid-cols-expanded, 12), minmax(0, 1fr)); }
81
107
  .grid ::slotted(*) {
82
- grid-column: span var(--col-span-expanded, var(--col-span, var(--scb-grid-cols-expanded, 12)));
108
+ min-width: 0;
109
+ min-height: 0;
83
110
  grid-column: span min(
84
111
  max(1, var(--col-span-expanded, var(--col-span, var(--scb-grid-cols-expanded, 12)))) ,
85
112
  var(--scb-grid-cols-expanded, 12)
86
113
  );
114
+ grid-row: var(--row-rule-expanded, var(--row-rule, auto));
87
115
  }
88
116
  }
89
117
  }
90
118
 
119
+ /* Med container queries */
91
120
  @supports (container-type: inline-size) {
92
121
  @container (min-width: 600px) {
93
122
  .grid { grid-template-columns: repeat(var(--scb-grid-cols-medium, 8), minmax(0, 1fr)); }
94
123
  .grid ::slotted(*) {
95
- grid-column: span var(--col-span-medium, var(--col-span, var(--scb-grid-cols-medium, 8)));
124
+ min-width: 0;
125
+ min-height: 0;
96
126
  grid-column: span min(
97
127
  max(1, var(--col-span-medium, var(--col-span, var(--scb-grid-cols-medium, 8)))) ,
98
128
  var(--scb-grid-cols-medium, 8)
99
129
  );
130
+ grid-row: var(--row-rule-medium, var(--row-rule, auto));
100
131
  }
101
132
  }
102
133
  @container (min-width: 840px) {
103
134
  .grid { grid-template-columns: repeat(var(--scb-grid-cols-expanded, 12), minmax(0, 1fr)); }
104
135
  .grid ::slotted(*) {
105
- grid-column: span var(--col-span-expanded, var(--col-span, var(--scb-grid-cols-expanded, 12)));
136
+ min-width: 0;
137
+ min-height: 0;
106
138
  grid-column: span min(
107
139
  max(1, var(--col-span-expanded, var(--col-span, var(--scb-grid-cols-expanded, 12)))) ,
108
140
  var(--scb-grid-cols-expanded, 12)
109
141
  );
142
+ grid-row: var(--row-rule-expanded, var(--row-rule, auto));
110
143
  }
111
144
  }
112
145
  }
@@ -144,6 +177,9 @@ s([
144
177
  s([
145
178
  a({ type: String, attribute: "max-width", reflect: !0 })
146
179
  ], e.prototype, "maxWidth", 2);
180
+ s([
181
+ a({ type: String, attribute: "auto-rows", reflect: !0 })
182
+ ], e.prototype, "autoRows", 2);
147
183
  e = s([
148
184
  y("scb-grid")
149
185
  ], e);
@@ -3,7 +3,7 @@ import { LitElement } from 'lit';
3
3
  * <scb-stack>
4
4
  * Minimal 1D-layout (flex) för innehåll inuti t.ex. <scb-grid-item>.
5
5
  * - direction: row | column
6
- * - gap: token-fallback (var(--spacing-5, 16px))
6
+ * - gap / row-gap / column-gap: kan vara spacing-siffra 0–14 (var(--spacing-N)) eller valfritt CSS-värde
7
7
  * - align (align-items) / justify (justify-content)
8
8
  * - wrap: bryt rad i row-läge
9
9
  * - inline: inline-flex istället för block
@@ -12,6 +12,8 @@ export declare class ScbStack extends LitElement {
12
12
  #private;
13
13
  direction: 'row' | 'column';
14
14
  gap: string;
15
+ rowGap: string;
16
+ columnGap: string;
15
17
  align: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
16
18
  justify: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
17
19
  wrap: boolean;
@@ -19,6 +21,8 @@ export declare class ScbStack extends LitElement {
19
21
  static styles: import('lit').CSSResult;
20
22
  protected firstUpdated(): void;
21
23
  protected updated(): void;
24
+ private mapSpacingToken;
25
+ private parseGapShorthand;
22
26
  render(): import('lit-html').TemplateResult<1>;
23
27
  }
24
28
  declare global {
@@ -1,36 +1,52 @@
1
- import { css as d, LitElement as u, html as v } from "lit";
2
- import { property as c, customElement as g } from "lit/decorators.js";
3
- var b = Object.defineProperty, w = Object.getOwnPropertyDescriptor, f = (e) => {
1
+ import { css as f, LitElement as g, html as d } from "lit";
2
+ import { property as c, customElement as m } from "lit/decorators.js";
3
+ var b = Object.defineProperty, v = Object.getOwnPropertyDescriptor, u = (e) => {
4
4
  throw TypeError(e);
5
- }, i = (e, t, s, n) => {
6
- for (var a = n > 1 ? void 0 : n ? w(t, s) : t, o = e.length - 1, l; o >= 0; o--)
7
- (l = e[o]) && (a = (n ? l(t, s, a) : l(a)) || a);
8
- return n && a && b(t, s, a), a;
9
- }, x = (e, t, s) => t.has(e) || f("Cannot " + s), _ = (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), y = (e, t, s) => (x(e, t, "access private method"), s), p, h;
10
- let r = class extends u {
5
+ }, n = (e, t, s, i) => {
6
+ for (var a = i > 1 ? void 0 : i ? v(t, s) : t, p = e.length - 1, l; p >= 0; p--)
7
+ (l = e[p]) && (a = (i ? l(t, s, a) : l(a)) || a);
8
+ return i && a && b(t, s, a), a;
9
+ }, k = (e, t, s) => t.has(e) || u("Cannot " + s), w = (e, t, s) => t.has(e) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), y = (e, t, s) => (k(e, t, "access private method"), s), o, h;
10
+ let r = class extends g {
11
11
  constructor() {
12
- super(...arguments), _(this, p), this.direction = "column", this.gap = "", this.align = "stretch", this.justify = "start", this.wrap = !1, this.inline = !1;
12
+ super(...arguments), w(this, o), this.direction = "column", this.gap = "", this.rowGap = "", this.columnGap = "", this.align = "stretch", this.justify = "start", this.wrap = !1, this.inline = !1;
13
13
  }
14
14
  firstUpdated() {
15
- y(this, p, h).call(this);
15
+ y(this, o, h).call(this);
16
16
  }
17
17
  updated() {
18
- y(this, p, h).call(this);
18
+ y(this, o, h).call(this);
19
+ }
20
+ mapSpacingToken(e) {
21
+ if (!e) return;
22
+ const t = String(e).trim();
23
+ return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
24
+ }
25
+ parseGapShorthand(e) {
26
+ if (!e) return {};
27
+ const t = e.trim().split(/\s+/);
28
+ if (t.length === 1) {
29
+ const s = this.mapSpacingToken(t[0]);
30
+ return { row: s, col: s };
31
+ }
32
+ return { row: this.mapSpacingToken(t[0]), col: this.mapSpacingToken(t[1]) };
19
33
  }
20
34
  render() {
21
- return v`<slot></slot>`;
35
+ return d`<slot></slot>`;
22
36
  }
23
37
  };
24
- p = /* @__PURE__ */ new WeakSet();
38
+ o = /* @__PURE__ */ new WeakSet();
25
39
  h = function() {
26
- this.style.setProperty("--scb-stack-direction", this.direction), this.style.setProperty("--scb-stack-gap", this.gap || "var(--spacing-5, 16px)");
27
- const e = {
40
+ this.style.setProperty("--scb-stack-direction", this.direction);
41
+ const e = "var(--spacing-5, 16px)", t = this.parseGapShorthand(this.gap), s = this.mapSpacingToken(this.rowGap) ?? t.row ?? e, i = this.mapSpacingToken(this.columnGap) ?? t.col ?? e;
42
+ this.style.setProperty("--scb-stack-gap", `${s}`), this.style.setProperty("--scb-stack-row-gap", s), this.style.setProperty("--scb-stack-column-gap", i);
43
+ const a = {
28
44
  start: "flex-start",
29
45
  center: "center",
30
46
  end: "flex-end",
31
47
  stretch: "stretch",
32
48
  baseline: "baseline"
33
- }, t = {
49
+ }, p = {
34
50
  start: "flex-start",
35
51
  center: "center",
36
52
  end: "flex-end",
@@ -38,44 +54,54 @@ h = function() {
38
54
  around: "space-around",
39
55
  evenly: "space-evenly"
40
56
  };
41
- this.style.setProperty("--scb-stack-align", e[this.align] ?? "stretch"), this.style.setProperty("--scb-stack-justify", t[this.justify] ?? "flex-start"), this.style.setProperty("--scb-stack-wrap", this.wrap ? "wrap" : "nowrap");
57
+ this.style.setProperty("--scb-stack-align", a[this.align] ?? "stretch"), this.style.setProperty("--scb-stack-justify", p[this.justify] ?? "flex-start"), this.style.setProperty("--scb-stack-wrap", this.wrap ? "wrap" : "nowrap");
42
58
  };
43
- r.styles = d`
59
+ r.styles = f`
44
60
  :host {
45
61
  box-sizing: border-box;
46
62
  display: var(--scb-stack-display, flex);
47
63
  flex-direction: var(--scb-stack-direction, column);
48
- gap: var(--scb-stack-gap, var(--spacing-5, 16px));
64
+
65
+ /* Longhands med fallback till --scb-stack-gap och token-default */
66
+ row-gap: var(--scb-stack-row-gap, var(--scb-stack-gap, var(--spacing-5, 16px)));
67
+ column-gap: var(--scb-stack-column-gap, var(--scb-stack-gap, var(--spacing-5, 16px)));
68
+
49
69
  align-items: var(--scb-stack-align, stretch);
50
70
  justify-content: var(--scb-stack-justify, flex-start);
51
71
  flex-wrap: var(--scb-stack-wrap, nowrap);
72
+
52
73
  width: auto;
53
74
  max-width: 100%;
75
+ min-inline-size: 0;
54
76
  }
55
- :host([inline]) {
56
- --scb-stack-display: inline-flex;
57
- }
77
+ :host([inline]) { --scb-stack-display: inline-flex; }
58
78
  `;
59
- i([
79
+ n([
60
80
  c({ type: String, reflect: !0 })
61
81
  ], r.prototype, "direction", 2);
62
- i([
82
+ n([
63
83
  c({ type: String, reflect: !0 })
64
84
  ], r.prototype, "gap", 2);
65
- i([
85
+ n([
86
+ c({ type: String, attribute: "row-gap", reflect: !0 })
87
+ ], r.prototype, "rowGap", 2);
88
+ n([
89
+ c({ type: String, attribute: "column-gap", reflect: !0 })
90
+ ], r.prototype, "columnGap", 2);
91
+ n([
66
92
  c({ type: String, reflect: !0 })
67
93
  ], r.prototype, "align", 2);
68
- i([
94
+ n([
69
95
  c({ type: String, reflect: !0 })
70
96
  ], r.prototype, "justify", 2);
71
- i([
97
+ n([
72
98
  c({ type: Boolean, reflect: !0 })
73
99
  ], r.prototype, "wrap", 2);
74
- i([
100
+ n([
75
101
  c({ type: Boolean, reflect: !0 })
76
102
  ], r.prototype, "inline", 2);
77
- r = i([
78
- g("scb-stack")
103
+ r = n([
104
+ m("scb-stack")
79
105
  ], r);
80
106
  export {
81
107
  r as ScbStack
@@ -35,8 +35,8 @@ export declare class ScbHeader extends LitElement {
35
35
  includeUtilityInDrawer: boolean;
36
36
  searchMax?: string;
37
37
  searchMin?: string;
38
+ searchHeight?: string;
38
39
  private _drawerId;
39
- private _paddingInline;
40
40
  private _drawerMounted;
41
41
  private _drawerExpanded;
42
42
  private _searchId;
@@ -79,7 +79,6 @@ export declare class ScbHeader extends LitElement {
79
79
  private _visible;
80
80
  private _overflows;
81
81
  private _measure;
82
- private _updatePadding;
83
82
  firstUpdated(): void;
84
83
  protected updated(changed: Map<string, unknown>): void;
85
84
  disconnectedCallback(): void;