scb-wc-test 0.1.105 → 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 (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 +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-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 +6 -1
  56. package/scb-icon-button/scb-icon-button.js +81 -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 +41 -4
  70. package/scb-segmented-button/scb-segmented-button.js +145 -61
  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 +1171 -890
@@ -1,23 +1,23 @@
1
- import { css as p, LitElement as d, html as s } from "lit";
2
- import { property as e, customElement as f } from "lit/decorators.js";
1
+ import { css as h, LitElement as d, html as r } from "lit";
2
+ import { property as o, customElement as f } from "lit/decorators.js";
3
3
  import "@material/web/icon/icon.js";
4
4
  import "@material/web/focus/md-focus-ring.js";
5
5
  import "../scb-icon-button/scb-icon-button.js";
6
- var m = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (o, r, l, a) => {
7
- for (var n = a > 1 ? void 0 : a ? g(r, l) : r, c = o.length - 1, h; c >= 0; c--)
8
- (h = o[c]) && (n = (a ? h(r, l, n) : h(n)) || n);
9
- return a && n && m(r, l, n), n;
6
+ var m = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (e, n, l, a) => {
7
+ for (var s = a > 1 ? void 0 : a ? g(n, l) : n, c = e.length - 1, p; c >= 0; c--)
8
+ (p = e[c]) && (s = (a ? p(n, l, s) : p(s)) || s);
9
+ return a && s && m(n, l, s), s;
10
10
  };
11
11
  let t = class extends d {
12
12
  constructor() {
13
- super(...arguments), this.variant = "success", this.direction = "horizontal", this.title = "", this.subtitle = "", this.supportingText = "", this.open = !1, this.linkText = "", this.linkHref = "#", this.showIcon = !1, this.showCloseButton = !1, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.fullHeight = !1, this.fullWidth = !1, this._closeNotification = () => {
13
+ super(...arguments), this.variant = "success", this.direction = "horizontal", this.title = "", this.subtitle = "", this.supportingText = "", this.open = !1, this.linkText = "", this.linkHref = "#", this.showIcon = !1, this.showCloseButton = !1, this.sizing = "stretch", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.fullHeight = !1, this.fullWidth = !1, this.spacing = "", this.spacingTop = "", this.spacingBottom = "", this._closeNotification = () => {
14
14
  this.open = !1;
15
- const o = new CustomEvent("close", {
15
+ const e = new CustomEvent("close", {
16
16
  detail: { open: this.open },
17
17
  bubbles: !0,
18
18
  composed: !0
19
19
  });
20
- this.dispatchEvent(o);
20
+ this.dispatchEvent(e);
21
21
  };
22
22
  }
23
23
  _iconForVariant() {
@@ -33,12 +33,20 @@ let t = class extends d {
33
33
  return "info";
34
34
  }
35
35
  }
36
- updated(o) {
37
- super.updated(o), o.has("width") && (this.width && this.width.trim() !== "" ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), o.has("maxWidth") && (this.maxWidth && this.maxWidth.trim() !== "" ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), o.has("height") && (this.height && this.height.trim() !== "" ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), o.has("maxHeight") && (this.maxHeight && this.maxHeight.trim() !== "" ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size"));
36
+ __resolveSpacingToken(e) {
37
+ const n = (e ?? "").trim();
38
+ return n ? /^(?:[0-9]|1[0-4])$/.test(n) ? `var(--spacing-${n})` : n : "";
39
+ }
40
+ __applySpacing() {
41
+ const e = this.__resolveSpacingToken(this.spacingTop || this.spacing), n = this.__resolveSpacingToken(this.spacingBottom || this.spacing);
42
+ e ? this.style.marginBlockStart = e : this.style.removeProperty("margin-block-start"), n ? this.style.marginBlockEnd = n : this.style.removeProperty("margin-block-end");
43
+ }
44
+ updated(e) {
45
+ super.updated(e), e.has("width") && (this.width && this.width.trim() !== "" ? this.style.inlineSize = this.width : this.style.removeProperty("inline-size")), e.has("maxWidth") && (this.maxWidth && this.maxWidth.trim() !== "" ? this.style.maxInlineSize = this.maxWidth : this.style.removeProperty("max-inline-size")), e.has("height") && (this.height && this.height.trim() !== "" ? this.style.blockSize = this.height : this.style.removeProperty("block-size")), e.has("maxHeight") && (this.maxHeight && this.maxHeight.trim() !== "" ? this.style.maxBlockSize = this.maxHeight : this.style.removeProperty("max-block-size")), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom")) && this.__applySpacing();
38
46
  }
39
47
  render() {
40
- const o = this.direction === "vertical" ? "vertical" : "horizontal", r = this.variant === "success" ? "--_icon-color: var(--md-sys-color-on-success-container);" : this.variant === "error" ? "--_icon-color: var(--md-sys-color-on-error-container);" : this.variant === "warning" ? "--_icon-color: var(--md-sys-color-on-warning-container);" : "--_icon-color: var(--md-sys-color-on-info-container);";
41
- return s`
48
+ const e = this.direction === "vertical" ? "vertical" : "horizontal", n = this.variant === "success" ? "--_icon-color: var(--md-sys-color-on-success-container);" : this.variant === "error" ? "--_icon-color: var(--md-sys-color-on-error-container);" : this.variant === "warning" ? "--_icon-color: var(--md-sys-color-on-warning-container);" : "--_icon-color: var(--md-sys-color-on-info-container);";
49
+ return r`
42
50
  <div
43
51
  class="notification"
44
52
  type=${this.variant}
@@ -46,8 +54,8 @@ let t = class extends d {
46
54
  aria-live="assertive"
47
55
  aria-atomic="true"
48
56
  >
49
- <div class="notification-main ${o}">
50
- ${this.showIcon ? s`
57
+ <div class="notification-main ${e}">
58
+ ${this.showIcon ? r`
51
59
  <div class="notification-leading-icon">
52
60
  <md-icon aria-hidden="true">
53
61
  ${this._iconForVariant()}
@@ -55,14 +63,14 @@ let t = class extends d {
55
63
  </div>
56
64
  ` : null}
57
65
  <div class="notification-text-container">
58
- ${this.title ? s`<div class="notification-title">${this.title}</div>` : null}
59
- ${this.subtitle ? s`<div class="notification-subtitle">
66
+ ${this.title ? r`<div class="notification-title">${this.title}</div>` : null}
67
+ ${this.subtitle ? r`<div class="notification-subtitle">
60
68
  ${this.subtitle}
61
69
  </div>` : null}
62
- ${this.supportingText ? s`<div class="notification-text">
70
+ ${this.supportingText ? r`<div class="notification-text">
63
71
  ${this.supportingText}
64
72
  </div>` : null}
65
- ${this.linkText ? s`
73
+ ${this.linkText ? r`
66
74
  <div class="notification-footer">
67
75
  <a class="footer-link" href="${this.linkHref}">
68
76
  ${this.linkText}
@@ -71,12 +79,12 @@ let t = class extends d {
71
79
  ` : null}
72
80
  </div>
73
81
  </div>
74
- ${this.showCloseButton ? s`
82
+ ${this.showCloseButton ? r`
75
83
  <div class="notification-close-button">
76
84
  <scb-icon-button
77
85
  aria-label="Stäng meddelande"
78
86
  icon="close"
79
- style=${r}
87
+ style=${n}
80
88
  @click=${this._closeNotification}
81
89
  >
82
90
  </scb-icon-button>
@@ -88,7 +96,7 @@ let t = class extends d {
88
96
  }
89
97
  };
90
98
  t.styles = [
91
- p`
99
+ h`
92
100
  :host {
93
101
  display: block;
94
102
  position: relative;
@@ -341,56 +349,65 @@ t.styles = [
341
349
  `
342
350
  ];
343
351
  i([
344
- e({ type: String })
352
+ o({ type: String })
345
353
  ], t.prototype, "variant", 2);
346
354
  i([
347
- e({ type: String, reflect: !0 })
355
+ o({ type: String, reflect: !0 })
348
356
  ], t.prototype, "direction", 2);
349
357
  i([
350
- e({ type: String })
358
+ o({ type: String })
351
359
  ], t.prototype, "title", 2);
352
360
  i([
353
- e({ type: String })
361
+ o({ type: String })
354
362
  ], t.prototype, "subtitle", 2);
355
363
  i([
356
- e({ type: String, attribute: "supporting-text" })
364
+ o({ type: String, attribute: "supporting-text" })
357
365
  ], t.prototype, "supportingText", 2);
358
366
  i([
359
- e({ type: Boolean, reflect: !0 })
367
+ o({ type: Boolean, reflect: !0 })
360
368
  ], t.prototype, "open", 2);
361
369
  i([
362
- e({ type: String, attribute: "link-text" })
370
+ o({ type: String, attribute: "link-text" })
363
371
  ], t.prototype, "linkText", 2);
364
372
  i([
365
- e({ type: String, attribute: "link-href" })
373
+ o({ type: String, attribute: "link-href" })
366
374
  ], t.prototype, "linkHref", 2);
367
375
  i([
368
- e({ type: Boolean, attribute: "show-icon" })
376
+ o({ type: Boolean, attribute: "show-icon" })
369
377
  ], t.prototype, "showIcon", 2);
370
378
  i([
371
- e({ type: Boolean, attribute: "show-close-button" })
379
+ o({ type: Boolean, attribute: "show-close-button" })
372
380
  ], t.prototype, "showCloseButton", 2);
373
381
  i([
374
- e({ type: String, reflect: !0 })
382
+ o({ type: String, reflect: !0 })
375
383
  ], t.prototype, "sizing", 2);
376
384
  i([
377
- e({ type: String, reflect: !0 })
385
+ o({ type: String, reflect: !0 })
378
386
  ], t.prototype, "width", 2);
379
387
  i([
380
- e({ type: String, reflect: !0, attribute: "max-width" })
388
+ o({ type: String, reflect: !0, attribute: "max-width" })
381
389
  ], t.prototype, "maxWidth", 2);
382
390
  i([
383
- e({ type: String, reflect: !0 })
391
+ o({ type: String, reflect: !0 })
384
392
  ], t.prototype, "height", 2);
385
393
  i([
386
- e({ type: String, reflect: !0, attribute: "max-height" })
394
+ o({ type: String, reflect: !0, attribute: "max-height" })
387
395
  ], t.prototype, "maxHeight", 2);
388
396
  i([
389
- e({ type: Boolean, reflect: !0, attribute: "full-height" })
397
+ o({ type: Boolean, reflect: !0, attribute: "full-height" })
390
398
  ], t.prototype, "fullHeight", 2);
391
399
  i([
392
- e({ type: Boolean, reflect: !0, attribute: "full-width" })
400
+ o({ type: Boolean, reflect: !0, attribute: "full-width" })
393
401
  ], t.prototype, "fullWidth", 2);
402
+ i([
403
+ o({ type: String })
404
+ ], t.prototype, "spacing", 2);
405
+ i([
406
+ o({ type: String, attribute: "spacing-top" })
407
+ ], t.prototype, "spacingTop", 2);
408
+ i([
409
+ o({ type: String, attribute: "spacing-bottom" })
410
+ ], t.prototype, "spacingBottom", 2);
394
411
  t = i([
395
412
  f("scb-notification-card")
396
413
  ], t);
@@ -1,4 +1,4 @@
1
- import { LitElement } from 'lit';
1
+ import { LitElement, PropertyValues } from 'lit';
2
2
  export declare class ScbPagination extends LitElement {
3
3
  variant: 'icon-text' | 'icon';
4
4
  page: number;
@@ -8,11 +8,22 @@ export declare class ScbPagination extends LitElement {
8
8
  currentAriaLabel: string;
9
9
  pagingNumberAriaLabel: string;
10
10
  isNarrow: boolean;
11
+ spacing: string;
12
+ spacingTop: string;
13
+ spacingBottom: string;
11
14
  static styles: import('lit').CSSResult[];
12
15
  private _prevPage;
13
16
  private _nextPage;
14
17
  connectedCallback(): void;
15
18
  disconnectedCallback(): void;
16
19
  private _onResize;
20
+ private __resolveSpacingToken;
21
+ private __applySpacing;
22
+ protected updated(changed: PropertyValues): void;
17
23
  render(): import('lit-html').TemplateResult<1> | null;
18
24
  }
25
+ declare global {
26
+ interface HTMLElementTagNameMap {
27
+ 'scb-pagination': ScbPagination;
28
+ }
29
+ }