scb-wc-test 0.1.1

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 (178) hide show
  1. package/README.md +130 -0
  2. package/all.js +54 -0
  3. package/dummy.png +0 -0
  4. package/index.d.ts +54 -0
  5. package/index.js +108 -0
  6. package/mvc/components/all.js +53 -0
  7. package/mvc/components/scb-accordion/scb-accordion-item.js +194 -0
  8. package/mvc/components/scb-accordion/scb-accordion.js +5 -0
  9. package/mvc/components/scb-app-bar/scb-app-bar.js +144 -0
  10. package/mvc/components/scb-avatar/scb-avatar.js +99 -0
  11. package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +17 -0
  12. package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +52 -0
  13. package/mvc/components/scb-button/scb-button.js +121 -0
  14. package/mvc/components/scb-calendar-card/scb-calendar-card.js +140 -0
  15. package/mvc/components/scb-card/scb-card.js +256 -0
  16. package/mvc/components/scb-checkbox/scb-checkbox-group.js +33 -0
  17. package/mvc/components/scb-checkbox/scb-checkbox.js +99 -0
  18. package/mvc/components/scb-chips/scb-chip.js +46 -0
  19. package/mvc/components/scb-dialog/scb-dialog.js +158 -0
  20. package/mvc/components/scb-divider/scb-divider.js +53 -0
  21. package/mvc/components/scb-drawer/scb-drawer-item.js +114 -0
  22. package/mvc/components/scb-drawer/scb-drawer-section.js +19 -0
  23. package/mvc/components/scb-drawer/scb-drawer.js +79 -0
  24. package/mvc/components/scb-drawer/scb-sub-drawer.js +10 -0
  25. package/mvc/components/scb-fact-card/scb-fact-card-content.js +44 -0
  26. package/mvc/components/scb-fact-card/scb-fact-card.js +66 -0
  27. package/mvc/components/scb-footer/scb-footer-section.js +3 -0
  28. package/mvc/components/scb-footer/scb-footer.js +205 -0
  29. package/mvc/components/scb-grid/scb-grid-item.js +9 -0
  30. package/mvc/components/scb-grid/scb-grid.js +81 -0
  31. package/mvc/components/scb-grid/scb-stack.js +16 -0
  32. package/mvc/components/scb-header/scb-header-drawer-group.js +1 -0
  33. package/mvc/components/scb-header/scb-header-drawer-item.js +1 -0
  34. package/mvc/components/scb-header/scb-header-tab.js +1 -0
  35. package/mvc/components/scb-header/scb-header-utility.js +1 -0
  36. package/mvc/components/scb-header/scb-header.js +240 -0
  37. package/mvc/components/scb-icon-button/scb-icon-button.js +95 -0
  38. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +69 -0
  39. package/mvc/components/scb-link/scb-link.js +31 -0
  40. package/mvc/components/scb-list/scb-list-item.js +38 -0
  41. package/mvc/components/scb-list/scb-list.js +10 -0
  42. package/mvc/components/scb-menu/scb-menu-item.js +44 -0
  43. package/mvc/components/scb-menu/scb-menu.js +17 -0
  44. package/mvc/components/scb-menu/scb-sub-menu.js +29 -0
  45. package/mvc/components/scb-notification/scb-notification.js +120 -0
  46. package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +84 -0
  47. package/mvc/components/scb-radio-button/scb-radio-button.js +95 -0
  48. package/mvc/components/scb-radio-button/scb-radio-group.js +28 -0
  49. package/mvc/components/scb-search/scb-search.js +211 -0
  50. package/mvc/components/scb-snackbar/scb-snackbar.js +83 -0
  51. package/mvc/components/scb-status-pill/scb-status-pill.js +31 -0
  52. package/mvc/components/scb-switch/scb-switch.js +54 -0
  53. package/mvc/components/scb-tabs/scb-primary-tab.js +7 -0
  54. package/mvc/components/scb-tabs/scb-secondary-tab.js +7 -0
  55. package/mvc/components/scb-tabs/scb-tabs.js +23 -0
  56. package/mvc/components/scb-textfield/scb-textfield.js +135 -0
  57. package/mvc/components/scb-toc/scb-toc-item.js +84 -0
  58. package/mvc/components/scb-toc/scb-toc.js +6 -0
  59. package/mvc/components/scb-tooltip/scb-tooltip.js +216 -0
  60. package/mvc/scb-logo.svg +21 -0
  61. package/mvc/scb-wc-test.css +1 -0
  62. package/mvc/scb.svg +14 -0
  63. package/mvc/vendor/preload-helper.js +1 -0
  64. package/mvc/vendor/vendor-lit.js +1 -0
  65. package/mvc/vendor/vendor-material.js +764 -0
  66. package/mvc/vendor/vendor.js +68 -0
  67. package/package.json +248 -0
  68. package/scb-accordion/scb-accordion-item.d.ts +37 -0
  69. package/scb-accordion/scb-accordion-item.js +343 -0
  70. package/scb-accordion/scb-accordion.d.ts +6 -0
  71. package/scb-accordion/scb-accordion.js +33 -0
  72. package/scb-app-bar/scb-app-bar.d.ts +10 -0
  73. package/scb-app-bar/scb-app-bar.js +192 -0
  74. package/scb-avatar/scb-avatar.d.ts +30 -0
  75. package/scb-avatar/scb-avatar.js +169 -0
  76. package/scb-breadcrumb/scb-breadcrumb-item.d.ts +9 -0
  77. package/scb-breadcrumb/scb-breadcrumb-item.js +54 -0
  78. package/scb-breadcrumb/scb-breadcrumb.d.ts +16 -0
  79. package/scb-breadcrumb/scb-breadcrumb.js +105 -0
  80. package/scb-button/scb-button.d.ts +26 -0
  81. package/scb-button/scb-button.js +247 -0
  82. package/scb-calendar-card/scb-calendar-card.d.ts +20 -0
  83. package/scb-calendar-card/scb-calendar-card.js +191 -0
  84. package/scb-card/scb-card.d.ts +24 -0
  85. package/scb-card/scb-card.js +345 -0
  86. package/scb-checkbox/scb-checkbox-group.d.ts +17 -0
  87. package/scb-checkbox/scb-checkbox-group.js +80 -0
  88. package/scb-checkbox/scb-checkbox.d.ts +20 -0
  89. package/scb-checkbox/scb-checkbox.js +157 -0
  90. package/scb-chips/scb-chip.d.ts +24 -0
  91. package/scb-chips/scb-chip.js +150 -0
  92. package/scb-dialog/scb-dialog.d.ts +58 -0
  93. package/scb-dialog/scb-dialog.js +390 -0
  94. package/scb-divider/scb-divider.d.ts +9 -0
  95. package/scb-divider/scb-divider.js +85 -0
  96. package/scb-drawer/scb-drawer-item.d.ts +61 -0
  97. package/scb-drawer/scb-drawer-item.js +220 -0
  98. package/scb-drawer/scb-drawer-section.d.ts +7 -0
  99. package/scb-drawer/scb-drawer-section.js +44 -0
  100. package/scb-drawer/scb-drawer.d.ts +97 -0
  101. package/scb-drawer/scb-drawer.js +258 -0
  102. package/scb-drawer/scb-sub-drawer.d.ts +10 -0
  103. package/scb-drawer/scb-sub-drawer.js +43 -0
  104. package/scb-fact-card/scb-fact-card-content.d.ts +10 -0
  105. package/scb-fact-card/scb-fact-card-content.js +83 -0
  106. package/scb-fact-card/scb-fact-card.d.ts +15 -0
  107. package/scb-fact-card/scb-fact-card.js +110 -0
  108. package/scb-footer/scb-footer-section.d.ts +21 -0
  109. package/scb-footer/scb-footer-section.js +28 -0
  110. package/scb-footer/scb-footer.d.ts +27 -0
  111. package/scb-footer/scb-footer.js +326 -0
  112. package/scb-grid/scb-grid-item.d.ts +28 -0
  113. package/scb-grid/scb-grid-item.js +66 -0
  114. package/scb-grid/scb-grid.d.ts +33 -0
  115. package/scb-grid/scb-grid.js +152 -0
  116. package/scb-grid/scb-stack.d.ts +29 -0
  117. package/scb-grid/scb-stack.js +82 -0
  118. package/scb-header/scb-header-drawer-group.d.ts +13 -0
  119. package/scb-header/scb-header-drawer-group.js +28 -0
  120. package/scb-header/scb-header-drawer-item.d.ts +14 -0
  121. package/scb-header/scb-header-drawer-item.js +31 -0
  122. package/scb-header/scb-header-tab.d.ts +13 -0
  123. package/scb-header/scb-header-tab.js +28 -0
  124. package/scb-header/scb-header-utility.d.ts +14 -0
  125. package/scb-header/scb-header-utility.js +31 -0
  126. package/scb-header/scb-header.d.ts +105 -0
  127. package/scb-header/scb-header.js +618 -0
  128. package/scb-icon-button/scb-icon-button.d.ts +31 -0
  129. package/scb-icon-button/scb-icon-button.js +208 -0
  130. package/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -0
  131. package/scb-keyfigure-card/scb-keyfigure-card.js +119 -0
  132. package/scb-link/scb-link.d.ts +17 -0
  133. package/scb-link/scb-link.js +74 -0
  134. package/scb-list/scb-list-item.d.ts +32 -0
  135. package/scb-list/scb-list-item.js +144 -0
  136. package/scb-list/scb-list.d.ts +8 -0
  137. package/scb-list/scb-list.js +39 -0
  138. package/scb-logo.svg +21 -0
  139. package/scb-menu/scb-menu-item.d.ts +22 -0
  140. package/scb-menu/scb-menu-item.js +107 -0
  141. package/scb-menu/scb-menu.d.ts +21 -0
  142. package/scb-menu/scb-menu.js +98 -0
  143. package/scb-menu/scb-sub-menu.d.ts +12 -0
  144. package/scb-menu/scb-sub-menu.js +69 -0
  145. package/scb-notification/scb-notification.d.ts +16 -0
  146. package/scb-notification/scb-notification.js +187 -0
  147. package/scb-progress-indicator/scb-progress-indicator.d.ts +11 -0
  148. package/scb-progress-indicator/scb-progress-indicator.js +122 -0
  149. package/scb-radio-button/scb-radio-button.d.ts +19 -0
  150. package/scb-radio-button/scb-radio-button.js +176 -0
  151. package/scb-radio-button/scb-radio-group.d.ts +20 -0
  152. package/scb-radio-button/scb-radio-group.js +81 -0
  153. package/scb-search/scb-search.d.ts +45 -0
  154. package/scb-search/scb-search.js +410 -0
  155. package/scb-snackbar/scb-snackbar.d.ts +17 -0
  156. package/scb-snackbar/scb-snackbar.js +140 -0
  157. package/scb-status-pill/scb-status-pill.d.ts +9 -0
  158. package/scb-status-pill/scb-status-pill.js +62 -0
  159. package/scb-switch/scb-switch.d.ts +21 -0
  160. package/scb-switch/scb-switch.js +111 -0
  161. package/scb-tabs/scb-primary-tab.d.ts +17 -0
  162. package/scb-tabs/scb-primary-tab.js +93 -0
  163. package/scb-tabs/scb-secondary-tab.d.ts +17 -0
  164. package/scb-tabs/scb-secondary-tab.js +97 -0
  165. package/scb-tabs/scb-tabs.d.ts +10 -0
  166. package/scb-tabs/scb-tabs.js +66 -0
  167. package/scb-textfield/scb-textfield.d.ts +41 -0
  168. package/scb-textfield/scb-textfield.js +258 -0
  169. package/scb-toc/scb-toc-item.d.ts +21 -0
  170. package/scb-toc/scb-toc-item.js +196 -0
  171. package/scb-toc/scb-toc.d.ts +6 -0
  172. package/scb-toc/scb-toc.js +27 -0
  173. package/scb-tooltip/scb-tooltip.d.ts +32 -0
  174. package/scb-tooltip/scb-tooltip.js +329 -0
  175. package/scb-wc-test.bundle.js +5429 -0
  176. package/scb-wc-test.css +1 -0
  177. package/scb-wc-test.d.ts +106 -0
  178. package/scb.svg +14 -0
@@ -0,0 +1,169 @@
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 {
9
+ 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 = () => {
11
+ this._imgError = !1, this.dispatchEvent(new CustomEvent("image-load", { bubbles: !0, composed: !0 }));
12
+ }, this._onImgError = () => {
13
+ 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;
17
+ };
18
+ }
19
+ async firstUpdated() {
20
+ this.variant === "icon" && await import("@material/web/icon/icon.js");
21
+ }
22
+ _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();
29
+ }
30
+ _ariaLabel() {
31
+ const i = (this.label || this.alt || "").trim();
32
+ return i || null;
33
+ }
34
+ render() {
35
+ const i = this._ariaLabel(), t = this.variant === "image" && !!this.src && !this._imgError, o = a`${c}
36
+ <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`
40
+ <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>`}
42
+ `;
43
+ return a`
44
+ <div class="container" part="container" role="img" aria-label=${i ?? c}>
45
+ ${this.variant === "icon" ? o : s}
46
+ </div>
47
+ `;
48
+ }
49
+ };
50
+ e.styles = d`
51
+ :host {
52
+ display: inline-block;
53
+ vertical-align: middle;
54
+ --_size: 40px;
55
+ --_font-size: 16px;
56
+ --_bg: var(--md-sys-color-primary-fixed-dim, var(--md-sys-color-primary-container));
57
+ --_fg: var(--md-sys-color-on-primary-fixed, var(--md-sys-color-on-primary-container));
58
+ --_radius: var(--radius-full, 1000px);
59
+ --_border: 0 solid transparent;
60
+
61
+ font-family: var(--brand-font, Inter, system-ui, sans-serif);
62
+ color-scheme: light dark;
63
+ }
64
+
65
+ :host([size="small"]) { --_size: 32px; --_font-size: var(--md-sys-typescale-label-medium-size, 14px); }
66
+ :host([size="medium"]) { --_size: 40px; --_font-size: var(--md-sys-typescale-label-large-size, 16px); }
67
+ :host([size="large"]) { --_size: 56px; --_font-size: var(--md-sys-typescale-title-large-size, 20px); }
68
+
69
+ :host([shape="circular"]) { --_radius: var(--radius-full, 1000px); }
70
+ :host([shape="rounded"]) { --_radius: var(--radius-s, 8px); }
71
+ :host([shape="square"]) { --_radius: 0; }
72
+
73
+ .container {
74
+ inline-size: var(--_size);
75
+ block-size: var(--_size);
76
+ border-radius: var(--_radius);
77
+ position: relative;
78
+ overflow: hidden;
79
+ user-select: none;
80
+ line-height: 1;
81
+ border: var(--_border);
82
+ display: grid;
83
+ place-items: center;
84
+ }
85
+
86
+ :host([variant="image"]) .container { background: none; }
87
+ :host([variant="image"]) img.photo {
88
+ width: 100%;
89
+ height: 100%;
90
+ object-fit: cover;
91
+ display: block;
92
+ }
93
+
94
+ :host([size="small"]) { --_icon-size: var(--icon-size-small, 24px); }
95
+ :host([size="medium"]) { --_icon-size: var(--icon-size-medium, 32px); }
96
+ :host([size="large"]) { --_icon-size: var(--icon-size-large, 40px); }
97
+
98
+ :host([variant="icon"]) .container { background: var(--_bg); color: var(--_fg); }
99
+
100
+ img.icon {
101
+ width: var(--_icon-size);
102
+ height: var(--_icon-size);
103
+ object-fit: contain;
104
+ display: block;
105
+ }
106
+
107
+ .fallback {
108
+ display: grid;
109
+ place-items: center;
110
+ width: 100%;
111
+ height: 100%;
112
+ font-size: var(--_font-size);
113
+ font-weight: var(--weight-semibold, 600);
114
+ letter-spacing: .01em;
115
+ text-transform: uppercase;
116
+ color: var(--_fg);
117
+ background: var(--_bg);
118
+ }
119
+
120
+ :host([variant="image"]) .fallback {
121
+ color: var(--md-sys-color-on-primary-container);
122
+ background: var(--md-sys-color-primary-container);
123
+ }
124
+
125
+ ::slotted([slot="icon"]) {
126
+ width: var(--_icon-size);
127
+ height: var(--_icon-size);
128
+ line-height: 1;
129
+ }
130
+
131
+ :host(:focus-visible) .container {
132
+ outline: var(--md-focus-ring-width, 2px) solid var(--md-focus-ring-color, var(--p-40));
133
+ outline-offset: 2px;
134
+ border-radius: var(--_radius);
135
+ }
136
+ `;
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);
167
+ export {
168
+ e as ScbAvatar
169
+ };
@@ -0,0 +1,9 @@
1
+ import { LitElement, TemplateResult } from 'lit';
2
+
3
+ export declare class SCBBreadcrumbItem extends LitElement {
4
+ label: string;
5
+ isCurrent: boolean;
6
+ href: string;
7
+ static get styles(): import('lit').CSSResult;
8
+ protected render(): TemplateResult;
9
+ }
@@ -0,0 +1,54 @@
1
+ import { LitElement as u, css as b, html as p } from "lit";
2
+ import { property as i, customElement as m } from "lit/decorators.js";
3
+ var h = Object.defineProperty, f = Object.getOwnPropertyDescriptor, a = (l, t, o, s) => {
4
+ for (var r = s > 1 ? void 0 : s ? f(t, o) : t, c = l.length - 1, n; c >= 0; c--)
5
+ (n = l[c]) && (r = (s ? n(t, o, r) : n(r)) || r);
6
+ return s && r && h(t, o, r), r;
7
+ };
8
+ let e = class extends u {
9
+ constructor() {
10
+ super(...arguments), this.label = "", this.isCurrent = !1, this.href = "";
11
+ }
12
+ static get styles() {
13
+ return b`
14
+ .breadcrumb-separator {
15
+ margin: 0 8px;
16
+ color: var(--md-sys-color-on-surface);
17
+ }
18
+ .breadcrumb-link {
19
+ color: var(--md-sys-color-primary);
20
+ text-decoration-thickness: 1px;
21
+
22
+ }
23
+ .breadcrumb-link:hover {
24
+ text-decoration-thickness: 2px;
25
+ }
26
+ `;
27
+ }
28
+ render() {
29
+ switch (!0) {
30
+ case this.isCurrent:
31
+ return p`<span class="breadcrumb-current">${this.label}</span>`;
32
+ default:
33
+ return p`
34
+ <a href="${this.href}" class="breadcrumb-link">${this.label}</a>
35
+ <span class="breadcrumb-separator">/</span>
36
+ `;
37
+ }
38
+ }
39
+ };
40
+ a([
41
+ i({ type: String })
42
+ ], e.prototype, "label", 2);
43
+ a([
44
+ i({ type: Boolean, attribute: "is-current" })
45
+ ], e.prototype, "isCurrent", 2);
46
+ a([
47
+ i({ type: String, attribute: "item-href" })
48
+ ], e.prototype, "href", 2);
49
+ e = a([
50
+ m("scb-breadcrumb-item")
51
+ ], e);
52
+ export {
53
+ e as SCBBreadcrumbItem
54
+ };
@@ -0,0 +1,16 @@
1
+ import { LitElement, TemplateResult } from 'lit';
2
+
3
+ export declare class SCBBreadcrumb extends LitElement {
4
+ showAll: boolean;
5
+ private static __iconLoaded;
6
+ private __ensureIconLoaded;
7
+ static get styles(): import('lit').CSSResult;
8
+ protected firstUpdated(): void;
9
+ private _onEllipsisClick;
10
+ render(): TemplateResult;
11
+ }
12
+ declare global {
13
+ interface HTMLElementTagNameMap {
14
+ 'scb-breadcrumb': SCBBreadcrumb;
15
+ }
16
+ }
@@ -0,0 +1,105 @@
1
+ import { LitElement as d, css as m, html as n } from "lit";
2
+ import { property as p, customElement as b } from "lit/decorators.js";
3
+ import "./scb-breadcrumb-item.js";
4
+ var h = Object.defineProperty, u = Object.getOwnPropertyDescriptor, c = (e, r, s, t) => {
5
+ for (var a = t > 1 ? void 0 : t ? u(r, s) : r, i = e.length - 1, o; i >= 0; i--)
6
+ (o = e[i]) && (a = (t ? o(r, s, a) : o(a)) || a);
7
+ return t && a && h(r, s, a), a;
8
+ };
9
+ let l = class extends d {
10
+ constructor() {
11
+ super(...arguments), this.showAll = !1;
12
+ }
13
+ async __ensureIconLoaded() {
14
+ l.__iconLoaded || (await import("@material/web/icon/icon.js"), l.__iconLoaded = !0);
15
+ }
16
+ static get styles() {
17
+ return m`
18
+ .scb-breadcrumb {
19
+ display: flex;
20
+ align-items: center;
21
+ flex-wrap: wrap;
22
+ }
23
+ .breadcrumb-separator {
24
+ margin: 0 8px;
25
+ color: var(--md-sys-color-on-surface);
26
+ }
27
+ .collapsed > scb-breadcrumb-item {
28
+ display: none;
29
+ }
30
+ .collapsed > scb-breadcrumb-item:nth-child(-n+3),
31
+ .collapsed > scb-breadcrumb-item:nth-last-child(-n+3) {
32
+ display: inline-flex;
33
+ }
34
+ .ellipsis {
35
+ cursor: pointer;
36
+ display: inline-flex;
37
+ color: var(--md-sys-color-primary);
38
+ }
39
+ .collapsed .ellipsis {
40
+ display: inline-flex;
41
+ }
42
+ .expanded .ellipsis {
43
+ display: none;
44
+ }
45
+ .breadcrumb-animate {
46
+ opacity: 0;
47
+ transform: translateY(10px);
48
+ animation: fadeInBreadcrumb 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
49
+ }
50
+ @keyframes fadeInBreadcrumb {
51
+ to {
52
+ opacity: 1;
53
+ transform: translateY(0);
54
+ }
55
+ }
56
+ `;
57
+ }
58
+ firstUpdated() {
59
+ this.children.length > 6 && !this.showAll && this.__ensureIconLoaded();
60
+ }
61
+ _onEllipsisClick() {
62
+ this.showAll ? (this.showAll = !1, l.__iconLoaded || this.__ensureIconLoaded()) : (this.showAll = !0, this.updateComplete.then(() => {
63
+ var r;
64
+ const e = (r = this.shadowRoot) == null ? void 0 : r.querySelectorAll(".scb-breadcrumb.expanded > scb-breadcrumb-item");
65
+ e && (e.forEach((s, t) => {
66
+ s.classList.add("breadcrumb-animate"), s.style.animationDelay = `${t * 60}ms`;
67
+ }), setTimeout(() => {
68
+ e.forEach((s) => {
69
+ s.classList.remove("breadcrumb-animate"), s.style.animationDelay = "";
70
+ });
71
+ }, 600));
72
+ }));
73
+ }
74
+ render() {
75
+ let e = [];
76
+ this.children.length || (e = Array.from(this.shadowRoot ? this.shadowRoot.querySelectorAll("scb-breadcrumb-item") : [])), e.length || (e = Array.from(this.children).filter((s) => s.tagName.toLowerCase() === "scb-breadcrumb-item")), e.length > 0 && e[e.length - 1].setAttribute("is-current", "true");
77
+ const r = e.length > 6 && !this.showAll;
78
+ return n`
79
+ <div class="scb-breadcrumb ${r ? "collapsed" : "expanded"}">
80
+ ${r ? e.map(
81
+ (s, t) => t === 3 ? n`<span
82
+ class="ellipsis"
83
+ aria-label="Visa alla"
84
+ role="button"
85
+ tabindex="0"
86
+ @click=${this._onEllipsisClick}
87
+ @keydown=${(a) => {
88
+ (a.key === "Enter" || a.key === " ") && this._onEllipsisClick();
89
+ }}
90
+ ><md-icon>more_horiz</md-icon></span><span class="breadcrumb-separator">/</span>${s}` : n`${s}`
91
+ ) : e.map((s) => s)}
92
+ </div>
93
+ `;
94
+ }
95
+ };
96
+ l.__iconLoaded = !1;
97
+ c([
98
+ p({ type: Boolean })
99
+ ], l.prototype, "showAll", 2);
100
+ l = c([
101
+ b("scb-breadcrumb")
102
+ ], l);
103
+ export {
104
+ l as SCBBreadcrumb
105
+ };
@@ -0,0 +1,26 @@
1
+ import { LitElement, TemplateResult } from 'lit';
2
+
3
+ /** "filled", "outlined", "filled-tonal" eller "text" */
4
+ export type ScbButtonVariant = 'filled' | 'outlined' | 'filled-tonal' | 'text';
5
+ export declare class ScbButton extends LitElement {
6
+ variant: ScbButtonVariant;
7
+ type: string;
8
+ label: string;
9
+ trailingIcon: boolean;
10
+ icon: string;
11
+ disabled: boolean;
12
+ href: string;
13
+ target: string;
14
+ rel: string;
15
+ private __loadedButtons;
16
+ private __iconLoaded;
17
+ private __ariaObserver?;
18
+ private __ensureDepsLoaded;
19
+ private __getInnerButton;
20
+ private __syncAriaToInner;
21
+ protected firstUpdated(): void;
22
+ protected updated(changed: Map<string, unknown>): void;
23
+ disconnectedCallback(): void;
24
+ static get styles(): import('lit').CSSResult;
25
+ render(): TemplateResult;
26
+ }
@@ -0,0 +1,247 @@
1
+ import { LitElement as b, css as m, html as u, nothing as e } from "lit";
2
+ import { property as d, customElement as p } from "lit/decorators.js";
3
+ var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (t, r, a, i) => {
4
+ for (var o = i > 1 ? void 0 : i ? v(r, a) : r, c = t.length - 1, n; c >= 0; c--)
5
+ (n = t[c]) && (o = (i ? n(r, a, o) : n(o)) || o);
6
+ return i && o && f(r, a, o), o;
7
+ };
8
+ let l = class extends b {
9
+ constructor() {
10
+ super(...arguments), this.variant = "filled", this.type = "button", this.label = "Button", this.trailingIcon = !1, this.icon = "", this.disabled = !1, this.href = "", this.target = "", this.rel = "", this.__loadedButtons = /* @__PURE__ */ new Set(), this.__iconLoaded = !1;
11
+ }
12
+ // Ladda in nödvändiga Material-web-komponenter vid behov (variant + ev. ikon)
13
+ async __ensureDepsLoaded() {
14
+ if (!this.__loadedButtons.has(this.variant)) {
15
+ switch (this.variant) {
16
+ case "filled":
17
+ await import("@material/web/button/filled-button.js");
18
+ break;
19
+ case "outlined":
20
+ await import("@material/web/button/outlined-button.js");
21
+ break;
22
+ case "filled-tonal":
23
+ await import("@material/web/button/filled-tonal-button.js");
24
+ break;
25
+ case "text":
26
+ await import("@material/web/button/text-button.js");
27
+ break;
28
+ }
29
+ this.__loadedButtons.add(this.variant);
30
+ }
31
+ this.icon && !this.__iconLoaded && (await import("@material/web/icon/icon.js"), this.__iconLoaded = !0);
32
+ }
33
+ // Hämta inre md-knapp (oavsett variant)
34
+ __getInnerButton() {
35
+ return this.renderRoot.querySelector(
36
+ "md-filled-button, md-outlined-button, md-filled-tonal-button, md-text-button"
37
+ );
38
+ }
39
+ // Spegla aria-attribut från host -> inre md-knapp
40
+ // (behåll aria-controls på host; ta bort aria-expanded från host
41
+ __syncAriaToInner() {
42
+ var i;
43
+ const t = this.__getInnerButton();
44
+ if (!t) return;
45
+ const r = this.getAttribute("aria-controls");
46
+ r && t.setAttribute("aria-controls", r);
47
+ const a = this.getAttribute("aria-expanded");
48
+ a !== null && (t.setAttribute("aria-expanded", a), this.removeAttribute("aria-expanded")), (i = this.__ariaObserver) == null || i.disconnect(), this.__ariaObserver = new MutationObserver((o) => {
49
+ const c = this.__getInnerButton();
50
+ if (c) {
51
+ for (const n of o)
52
+ if (!(n.type !== "attributes" || !n.attributeName) && (n.attributeName === "aria-controls" || n.attributeName === "aria-expanded")) {
53
+ const h = this.getAttribute(n.attributeName);
54
+ h === null ? c.removeAttribute(n.attributeName) : c.setAttribute(n.attributeName, h), n.attributeName === "aria-expanded" && this.removeAttribute("aria-expanded");
55
+ }
56
+ }
57
+ }), this.__ariaObserver.observe(this, { attributes: !0, attributeFilter: ["aria-controls", "aria-expanded"] });
58
+ }
59
+ // Kör dynamisk import första gången komponenten renderats
60
+ firstUpdated() {
61
+ (this.type === "submit" || this.type === "reset") && this.addEventListener("click", () => {
62
+ if (!this.disabled) {
63
+ const t = this.closest("form");
64
+ t && (this.type === "submit" && t.requestSubmit(), this.type === "reset" && t.reset());
65
+ }
66
+ }), this.__ensureDepsLoaded(), this.__syncAriaToInner();
67
+ }
68
+ // Kör även när variant/icon ändras
69
+ updated(t) {
70
+ (t.has("variant") || t.has("icon") && this.icon) && this.__ensureDepsLoaded(), t.has("variant") && this.__syncAriaToInner();
71
+ }
72
+ disconnectedCallback() {
73
+ var t;
74
+ (t = this.__ariaObserver) == null || t.disconnect(), super.disconnectedCallback();
75
+ }
76
+ static get styles() {
77
+ return m`
78
+ /* Gör hosten stretchbar i t.ex. flex/grid */
79
+ :host {
80
+ display: inline-flex;
81
+ block-size: var(--scb-button-block-size, auto);
82
+ }
83
+
84
+ /* Låt inre md-knappen fylla hostens höjd*/
85
+ md-filled-button,
86
+ md-outlined-button,
87
+ md-filled-tonal-button,
88
+ md-text-button {
89
+ block-size: 100%;
90
+ }
91
+
92
+ /* Errorvarianter */
93
+ /*
94
+ md-filled-button[variant='error'],
95
+ md-outlined-button[variant='error'],
96
+ md-filled-tonal-button[variant='error'],
97
+ md-text-button[variant='error'] {
98
+ --md-sys-color-primary: var(--md-sys-color-error);
99
+ --md-sys-color-on-primary: var(--md-sys-color-on-error);
100
+ }
101
+ */
102
+
103
+ /* Outlined – röd outline vid error + tjockare vid hover */
104
+ /*
105
+ md-outlined-button[variant='error'] {
106
+ --_outline-color: var(--md-sys-color-error);
107
+ --md-outlined-button-pressed-outline-color: var(--md-sys-color-error);
108
+ }
109
+ */
110
+ /* md-outlined-button[variant='error']:hover, */
111
+ md-outlined-button:hover {
112
+ --md-outlined-button-outline-width: var(--spacing-1, 1px);
113
+ }
114
+
115
+ /* Filled-tonal – error-färger */
116
+ /*
117
+ md-filled-tonal-button[variant='error'] {
118
+ --md-filled-tonal-button-container-color: var(--md-sys-color-error-container);
119
+ --md-filled-tonal-button-label-text-color: var(--md-sys-color-on-error-container);
120
+ --md-filled-tonal-button-hover-label-text-color: var(--md-sys-color-on-error-container);
121
+ --md-filled-tonal-button-pressed-label-text-color: var(--md-sys-color-on-error-container);
122
+ --md-filled-tonal-button-focus-label-text-color: var(--md-sys-color-on-error-container);
123
+ --md-filled-tonal-button-icon-color: var(--md-sys-color-on-error-container);
124
+ --md-filled-tonal-button-hover-icon-color: var(--md-sys-color-on-error-container);
125
+ --md-filled-tonal-button-pressed-icon-color: var(--md-sys-color-on-error-container);
126
+ --md-filled-tonal-button-focus-icon-color: var(--md-sys-color-on-error-container);
127
+ --md-filled-tonal-button-hover-state-layer-color: var(--md-sys-color-on-error-container);
128
+ --md-filled-tonal-button-pressed-state-layer-color: var(--md-sys-color-on-error-container);
129
+ }
130
+ @media (prefers-color-scheme: dark) {
131
+ md-filled-tonal-button[variant='error'] {
132
+ --md-filled-tonal-button-container-color: var(--md-sys-color-on-error);
133
+ }
134
+ }
135
+ */
136
+ `;
137
+ }
138
+ render() {
139
+ var o;
140
+ const t = !!((o = this.icon) != null && o.trim()), r = t ? u`<md-icon slot="icon">${this.icon}</md-icon>` : e, a = e, i = this.label.trim() === "" ? this.icon : void 0;
141
+ switch (this.variant) {
142
+ case "filled":
143
+ return u`
144
+ <md-filled-button
145
+ type=${this.type}
146
+ variant=${a}
147
+ ?trailing-icon=${this.trailingIcon}
148
+ ?disabled=${this.disabled}
149
+ aria-label=${i}
150
+ href=${this.href || e}
151
+ target=${this.target || e}
152
+ rel=${this.rel || e}
153
+ >
154
+ ${t && !this.trailingIcon ? r : e}
155
+ ${this.label}
156
+ ${t && this.trailingIcon ? r : e}
157
+ </md-filled-button>
158
+ `;
159
+ case "outlined":
160
+ return u`
161
+ <md-outlined-button
162
+ type=${this.type}
163
+ variant=${a}
164
+ ?trailing-icon=${this.trailingIcon}
165
+ ?disabled=${this.disabled}
166
+ aria-label=${i}
167
+ href=${this.href || e}
168
+ target=${this.target || e}
169
+ rel=${this.rel || e}
170
+ >
171
+ ${t && !this.trailingIcon ? r : e}
172
+ ${this.label}
173
+ ${t && this.trailingIcon ? r : e}
174
+ </md-outlined-button>
175
+ `;
176
+ case "filled-tonal":
177
+ return u`
178
+ <md-filled-tonal-button
179
+ type=${this.type}
180
+ variant=${a}
181
+ ?trailing-icon=${this.trailingIcon}
182
+ ?disabled=${this.disabled}
183
+ aria-label=${i}
184
+ href=${this.href || e}
185
+ target=${this.target || e}
186
+ rel=${this.rel || e}
187
+ >
188
+ ${t && !this.trailingIcon ? r : e}
189
+ ${this.label}
190
+ ${t && this.trailingIcon ? r : e}
191
+ </md-filled-tonal-button>
192
+ `;
193
+ case "text":
194
+ return u`
195
+ <md-text-button
196
+ type=${this.type}
197
+ variant=${a}
198
+ ?trailing-icon=${this.trailingIcon}
199
+ ?disabled=${this.disabled}
200
+ aria-label=${i}
201
+ href=${this.href || e}
202
+ target=${this.target || e}
203
+ rel=${this.rel || e}
204
+ >
205
+ ${t && !this.trailingIcon ? r : e}
206
+ ${this.label}
207
+ ${t && this.trailingIcon ? r : e}
208
+ </md-text-button>
209
+ `;
210
+ default:
211
+ return u``;
212
+ }
213
+ }
214
+ };
215
+ s([
216
+ d({ type: String, reflect: !0 })
217
+ ], l.prototype, "variant", 2);
218
+ s([
219
+ d({ type: String, reflect: !0 })
220
+ ], l.prototype, "type", 2);
221
+ s([
222
+ d({ type: String })
223
+ ], l.prototype, "label", 2);
224
+ s([
225
+ d({ type: Boolean, attribute: "trailing-icon" })
226
+ ], l.prototype, "trailingIcon", 2);
227
+ s([
228
+ d({ type: String })
229
+ ], l.prototype, "icon", 2);
230
+ s([
231
+ d({ type: Boolean, reflect: !0 })
232
+ ], l.prototype, "disabled", 2);
233
+ s([
234
+ d({ type: String })
235
+ ], l.prototype, "href", 2);
236
+ s([
237
+ d({ type: String })
238
+ ], l.prototype, "target", 2);
239
+ s([
240
+ d({ type: String })
241
+ ], l.prototype, "rel", 2);
242
+ l = s([
243
+ p("scb-button")
244
+ ], l);
245
+ export {
246
+ l as ScbButton
247
+ };
@@ -0,0 +1,20 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ /**
4
+ * Enkel kort-komponent för SCB-designsystemet
5
+ */
6
+ export declare class ScbCalendarCard extends LitElement {
7
+ variant: 'default' | 'outlined' | 'filled';
8
+ direction: 'horizontal' | 'vertical';
9
+ header: string;
10
+ subtitle: string;
11
+ supportingText: string;
12
+ cardHref: string;
13
+ showMedia: boolean | null;
14
+ private static __iconLoaded;
15
+ private static __rippleLoaded;
16
+ protected firstUpdated(): Promise<void>;
17
+ static styles: import('lit').CSSResult;
18
+ render(): import('lit-html').TemplateResult<1>;
19
+ private _onKeyDown;
20
+ }