@politiet/sheriff-web-components 0.6.4 → 1.0.0-beta.0

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 (65) hide show
  1. package/dist/sds-button/sds-button.d.ts +2 -7
  2. package/dist/sds-button/sds-button.d.ts.map +1 -1
  3. package/dist/sds-button/sds-button.js +8 -0
  4. package/dist/sds-button/sds-button.js.map +1 -1
  5. package/dist/sds-checkbox/sds-checkbox.d.ts +2 -8
  6. package/dist/sds-checkbox/sds-checkbox.d.ts.map +1 -1
  7. package/dist/sds-checkbox/sds-checkbox.js +8 -0
  8. package/dist/sds-checkbox/sds-checkbox.js.map +1 -1
  9. package/dist/sds-checkbox-group/sds-checkbox-group.d.ts +8 -1
  10. package/dist/sds-checkbox-group/sds-checkbox-group.d.ts.map +1 -1
  11. package/dist/sds-checkbox-group/sds-checkbox-group.js.map +1 -1
  12. package/dist/sds-chip/sds-chip.d.ts +8 -1
  13. package/dist/sds-chip/sds-chip.d.ts.map +1 -1
  14. package/dist/sds-chip/sds-chip.js.map +1 -1
  15. package/dist/sds-detail/sds-detail.d.ts +8 -1
  16. package/dist/sds-detail/sds-detail.d.ts.map +1 -1
  17. package/dist/sds-detail/sds-detail.js.map +1 -1
  18. package/dist/sds-heading/sds-heading.d.ts +8 -1
  19. package/dist/sds-heading/sds-heading.d.ts.map +1 -1
  20. package/dist/sds-heading/sds-heading.js.map +1 -1
  21. package/dist/sds-icon/sds-icon-loader.d.ts +7 -0
  22. package/dist/sds-icon/sds-icon-loader.d.ts.map +1 -1
  23. package/dist/sds-icon/sds-icon-loader.js +52 -6
  24. package/dist/sds-icon/sds-icon-loader.js.map +1 -1
  25. package/dist/sds-icon/sds-icon.d.ts +8 -1
  26. package/dist/sds-icon/sds-icon.d.ts.map +1 -1
  27. package/dist/sds-icon/sds-icon.js.map +1 -1
  28. package/dist/sds-label/sds-label.d.ts +8 -1
  29. package/dist/sds-label/sds-label.d.ts.map +1 -1
  30. package/dist/sds-label/sds-label.js.map +1 -1
  31. package/dist/sds-link/sds-link.d.ts +8 -1
  32. package/dist/sds-link/sds-link.d.ts.map +1 -1
  33. package/dist/sds-link/sds-link.js.map +1 -1
  34. package/dist/sds-loader/sds-loader.d.ts +8 -1
  35. package/dist/sds-loader/sds-loader.d.ts.map +1 -1
  36. package/dist/sds-loader/sds-loader.js.map +1 -1
  37. package/dist/sds-nav-card/sds-nav-card.d.ts +8 -1
  38. package/dist/sds-nav-card/sds-nav-card.d.ts.map +1 -1
  39. package/dist/sds-nav-card/sds-nav-card.js.map +1 -1
  40. package/dist/sds-nav-card/sds-nav-card.styles.d.ts.map +1 -1
  41. package/dist/sds-nav-card/sds-nav-card.styles.js +12 -19
  42. package/dist/sds-nav-card/sds-nav-card.styles.js.map +1 -1
  43. package/dist/sds-notification/sds-notification.d.ts +8 -1
  44. package/dist/sds-notification/sds-notification.d.ts.map +1 -1
  45. package/dist/sds-notification/sds-notification.js.map +1 -1
  46. package/dist/sds-paragraph/sds-paragraph.d.ts +8 -1
  47. package/dist/sds-paragraph/sds-paragraph.d.ts.map +1 -1
  48. package/dist/sds-paragraph/sds-paragraph.js.map +1 -1
  49. package/dist/sds-radio/sds-radio.d.ts +8 -1
  50. package/dist/sds-radio/sds-radio.d.ts.map +1 -1
  51. package/dist/sds-radio/sds-radio.js.map +1 -1
  52. package/dist/sds-radio-group/sds-radio-group.d.ts +8 -1
  53. package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
  54. package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
  55. package/dist/sds-switch/sds-switch.d.ts +8 -1
  56. package/dist/sds-switch/sds-switch.d.ts.map +1 -1
  57. package/dist/sds-switch/sds-switch.js.map +1 -1
  58. package/dist/sds-text/sds-text.d.ts +8 -1
  59. package/dist/sds-text/sds-text.d.ts.map +1 -1
  60. package/dist/sds-text/sds-text.js.map +1 -1
  61. package/dist/sds-textfield/sds-textfield.d.ts +8 -1
  62. package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
  63. package/dist/sds-textfield/sds-textfield.js.map +1 -1
  64. package/dist/sheriff-web-components.js +3649 -0
  65. package/package.json +130 -126
@@ -0,0 +1,3649 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const t$3 = globalThis, e$7 = t$3.ShadowRoot && (void 0 === t$3.ShadyCSS || t$3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$1 = Symbol(), o$5 = /* @__PURE__ */ new WeakMap();
7
+ let n$3 = class n {
8
+ constructor(t2, e2, o2) {
9
+ if (this._$cssResult$ = true, o2 !== s$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
10
+ this.cssText = t2, this.t = e2;
11
+ }
12
+ get styleSheet() {
13
+ let t2 = this.o;
14
+ const s2 = this.t;
15
+ if (e$7 && void 0 === t2) {
16
+ const e2 = void 0 !== s2 && 1 === s2.length;
17
+ e2 && (t2 = o$5.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && o$5.set(s2, t2));
18
+ }
19
+ return t2;
20
+ }
21
+ toString() {
22
+ return this.cssText;
23
+ }
24
+ };
25
+ const r$5 = (t2) => new n$3("string" == typeof t2 ? t2 : t2 + "", void 0, s$1), i$4 = (t2, ...e2) => {
26
+ const o2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, o3) => e3 + ((t3) => {
27
+ if (true === t3._$cssResult$) return t3.cssText;
28
+ if ("number" == typeof t3) return t3;
29
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
30
+ })(s2) + t2[o3 + 1], t2[0]);
31
+ return new n$3(o2, t2, s$1);
32
+ }, S$1 = (s2, o2) => {
33
+ if (e$7) s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet);
34
+ else for (const e2 of o2) {
35
+ const o3 = document.createElement("style"), n3 = t$3.litNonce;
36
+ void 0 !== n3 && o3.setAttribute("nonce", n3), o3.textContent = e2.cssText, s2.appendChild(o3);
37
+ }
38
+ }, c$2 = e$7 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
39
+ let e2 = "";
40
+ for (const s2 of t3.cssRules) e2 += s2.cssText;
41
+ return r$5(e2);
42
+ })(t2) : t2;
43
+ /**
44
+ * @license
45
+ * Copyright 2017 Google LLC
46
+ * SPDX-License-Identifier: BSD-3-Clause
47
+ */
48
+ const { is: i$3, defineProperty: e$6, getOwnPropertyDescriptor: r$4, getOwnPropertyNames: h$1, getOwnPropertySymbols: o$4, getPrototypeOf: n$2 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (t2, s2) => t2, u$1 = { toAttribute(t2, s2) {
49
+ switch (s2) {
50
+ case Boolean:
51
+ t2 = t2 ? l$1 : null;
52
+ break;
53
+ case Object:
54
+ case Array:
55
+ t2 = null == t2 ? t2 : JSON.stringify(t2);
56
+ }
57
+ return t2;
58
+ }, fromAttribute(t2, s2) {
59
+ let i2 = t2;
60
+ switch (s2) {
61
+ case Boolean:
62
+ i2 = null !== t2;
63
+ break;
64
+ case Number:
65
+ i2 = null === t2 ? null : Number(t2);
66
+ break;
67
+ case Object:
68
+ case Array:
69
+ try {
70
+ i2 = JSON.parse(t2);
71
+ } catch (t3) {
72
+ i2 = null;
73
+ }
74
+ }
75
+ return i2;
76
+ } }, f$1 = (t2, s2) => !i$3(t2, s2), y$1 = { attribute: true, type: String, converter: u$1, reflect: false, hasChanged: f$1 };
77
+ Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
78
+ class b extends HTMLElement {
79
+ static addInitializer(t2) {
80
+ this._$Ei(), (this.l ??= []).push(t2);
81
+ }
82
+ static get observedAttributes() {
83
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
84
+ }
85
+ static createProperty(t2, s2 = y$1) {
86
+ if (s2.state && (s2.attribute = false), this._$Ei(), this.elementProperties.set(t2, s2), !s2.noAccessor) {
87
+ const i2 = Symbol(), r3 = this.getPropertyDescriptor(t2, i2, s2);
88
+ void 0 !== r3 && e$6(this.prototype, t2, r3);
89
+ }
90
+ }
91
+ static getPropertyDescriptor(t2, s2, i2) {
92
+ const { get: e2, set: h2 } = r$4(this.prototype, t2) ?? { get() {
93
+ return this[s2];
94
+ }, set(t3) {
95
+ this[s2] = t3;
96
+ } };
97
+ return { get() {
98
+ return e2?.call(this);
99
+ }, set(s3) {
100
+ const r3 = e2?.call(this);
101
+ h2.call(this, s3), this.requestUpdate(t2, r3, i2);
102
+ }, configurable: true, enumerable: true };
103
+ }
104
+ static getPropertyOptions(t2) {
105
+ return this.elementProperties.get(t2) ?? y$1;
106
+ }
107
+ static _$Ei() {
108
+ if (this.hasOwnProperty(d$1("elementProperties"))) return;
109
+ const t2 = n$2(this);
110
+ t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties);
111
+ }
112
+ static finalize() {
113
+ if (this.hasOwnProperty(d$1("finalized"))) return;
114
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
115
+ const t3 = this.properties, s2 = [...h$1(t3), ...o$4(t3)];
116
+ for (const i2 of s2) this.createProperty(i2, t3[i2]);
117
+ }
118
+ const t2 = this[Symbol.metadata];
119
+ if (null !== t2) {
120
+ const s2 = litPropertyMetadata.get(t2);
121
+ if (void 0 !== s2) for (const [t3, i2] of s2) this.elementProperties.set(t3, i2);
122
+ }
123
+ this._$Eh = /* @__PURE__ */ new Map();
124
+ for (const [t3, s2] of this.elementProperties) {
125
+ const i2 = this._$Eu(t3, s2);
126
+ void 0 !== i2 && this._$Eh.set(i2, t3);
127
+ }
128
+ this.elementStyles = this.finalizeStyles(this.styles);
129
+ }
130
+ static finalizeStyles(s2) {
131
+ const i2 = [];
132
+ if (Array.isArray(s2)) {
133
+ const e2 = new Set(s2.flat(1 / 0).reverse());
134
+ for (const s3 of e2) i2.unshift(c$2(s3));
135
+ } else void 0 !== s2 && i2.push(c$2(s2));
136
+ return i2;
137
+ }
138
+ static _$Eu(t2, s2) {
139
+ const i2 = s2.attribute;
140
+ return false === i2 ? void 0 : "string" == typeof i2 ? i2 : "string" == typeof t2 ? t2.toLowerCase() : void 0;
141
+ }
142
+ constructor() {
143
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
144
+ }
145
+ _$Ev() {
146
+ this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this));
147
+ }
148
+ addController(t2) {
149
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.();
150
+ }
151
+ removeController(t2) {
152
+ this._$EO?.delete(t2);
153
+ }
154
+ _$E_() {
155
+ const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties;
156
+ for (const i2 of s2.keys()) this.hasOwnProperty(i2) && (t2.set(i2, this[i2]), delete this[i2]);
157
+ t2.size > 0 && (this._$Ep = t2);
158
+ }
159
+ createRenderRoot() {
160
+ const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
161
+ return S$1(t2, this.constructor.elementStyles), t2;
162
+ }
163
+ connectedCallback() {
164
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.());
165
+ }
166
+ enableUpdating(t2) {
167
+ }
168
+ disconnectedCallback() {
169
+ this._$EO?.forEach((t2) => t2.hostDisconnected?.());
170
+ }
171
+ attributeChangedCallback(t2, s2, i2) {
172
+ this._$AK(t2, i2);
173
+ }
174
+ _$EC(t2, s2) {
175
+ const i2 = this.constructor.elementProperties.get(t2), e2 = this.constructor._$Eu(t2, i2);
176
+ if (void 0 !== e2 && true === i2.reflect) {
177
+ const r3 = (void 0 !== i2.converter?.toAttribute ? i2.converter : u$1).toAttribute(s2, i2.type);
178
+ this._$Em = t2, null == r3 ? this.removeAttribute(e2) : this.setAttribute(e2, r3), this._$Em = null;
179
+ }
180
+ }
181
+ _$AK(t2, s2) {
182
+ const i2 = this.constructor, e2 = i2._$Eh.get(t2);
183
+ if (void 0 !== e2 && this._$Em !== e2) {
184
+ const t3 = i2.getPropertyOptions(e2), r3 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u$1;
185
+ this._$Em = e2, this[e2] = r3.fromAttribute(s2, t3.type), this._$Em = null;
186
+ }
187
+ }
188
+ requestUpdate(t2, s2, i2) {
189
+ if (void 0 !== t2) {
190
+ if (i2 ??= this.constructor.getPropertyOptions(t2), !(i2.hasChanged ?? f$1)(this[t2], s2)) return;
191
+ this.P(t2, s2, i2);
192
+ }
193
+ false === this.isUpdatePending && (this._$ES = this._$ET());
194
+ }
195
+ P(t2, s2, i2) {
196
+ this._$AL.has(t2) || this._$AL.set(t2, s2), true === i2.reflect && this._$Em !== t2 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t2);
197
+ }
198
+ async _$ET() {
199
+ this.isUpdatePending = true;
200
+ try {
201
+ await this._$ES;
202
+ } catch (t3) {
203
+ Promise.reject(t3);
204
+ }
205
+ const t2 = this.scheduleUpdate();
206
+ return null != t2 && await t2, !this.isUpdatePending;
207
+ }
208
+ scheduleUpdate() {
209
+ return this.performUpdate();
210
+ }
211
+ performUpdate() {
212
+ if (!this.isUpdatePending) return;
213
+ if (!this.hasUpdated) {
214
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
215
+ for (const [t4, s3] of this._$Ep) this[t4] = s3;
216
+ this._$Ep = void 0;
217
+ }
218
+ const t3 = this.constructor.elementProperties;
219
+ if (t3.size > 0) for (const [s3, i2] of t3) true !== i2.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i2);
220
+ }
221
+ let t2 = false;
222
+ const s2 = this._$AL;
223
+ try {
224
+ t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EU();
225
+ } catch (s3) {
226
+ throw t2 = false, this._$EU(), s3;
227
+ }
228
+ t2 && this._$AE(s2);
229
+ }
230
+ willUpdate(t2) {
231
+ }
232
+ _$AE(t2) {
233
+ this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
234
+ }
235
+ _$EU() {
236
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
237
+ }
238
+ get updateComplete() {
239
+ return this.getUpdateComplete();
240
+ }
241
+ getUpdateComplete() {
242
+ return this._$ES;
243
+ }
244
+ shouldUpdate(t2) {
245
+ return true;
246
+ }
247
+ update(t2) {
248
+ this._$Ej &&= this._$Ej.forEach((t3) => this._$EC(t3, this[t3])), this._$EU();
249
+ }
250
+ updated(t2) {
251
+ }
252
+ firstUpdated(t2) {
253
+ }
254
+ }
255
+ b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d$1("elementProperties")] = /* @__PURE__ */ new Map(), b[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1?.({ ReactiveElement: b }), (a$1.reactiveElementVersions ??= []).push("2.0.4");
256
+ /**
257
+ * @license
258
+ * Copyright 2017 Google LLC
259
+ * SPDX-License-Identifier: BSD-3-Clause
260
+ */
261
+ const t$2 = globalThis, i$2 = t$2.trustedTypes, s = i$2 ? i$2.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$5 = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o$3 = "?" + h, n$1 = `<${o$3}>`, r$3 = document, l = () => r$3.createComment(""), c = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a = Array.isArray, u = (t2) => a(t2) || "function" == typeof t2?.[Symbol.iterator], d = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
262
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x = y(1), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r$3.createTreeWalker(r$3, 129);
263
+ function P(t2, i2) {
264
+ if (!a(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array");
265
+ return void 0 !== s ? s.createHTML(i2) : i2;
266
+ }
267
+ const V = (t2, i2) => {
268
+ const s2 = t2.length - 1, o2 = [];
269
+ let r3, l2 = 2 === i2 ? "<svg>" : 3 === i2 ? "<math>" : "", c2 = f;
270
+ for (let i3 = 0; i3 < s2; i3++) {
271
+ const s3 = t2[i3];
272
+ let a2, u2, d2 = -1, y2 = 0;
273
+ for (; y2 < s3.length && (c2.lastIndex = y2, u2 = c2.exec(s3), null !== u2); ) y2 = c2.lastIndex, c2 === f ? "!--" === u2[1] ? c2 = v : void 0 !== u2[1] ? c2 = _ : void 0 !== u2[2] ? ($.test(u2[2]) && (r3 = RegExp("</" + u2[2], "g")), c2 = m) : void 0 !== u2[3] && (c2 = m) : c2 === m ? ">" === u2[0] ? (c2 = r3 ?? f, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m : '"' === u2[3] ? g : p) : c2 === g || c2 === p ? c2 = m : c2 === v || c2 === _ ? c2 = f : (c2 = m, r3 = void 0);
274
+ const x2 = c2 === m && t2[i3 + 1].startsWith("/>") ? " " : "";
275
+ l2 += c2 === f ? s3 + n$1 : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$5 + s3.slice(d2) + h + x2) : s3 + h + (-2 === d2 ? i3 : x2);
276
+ }
277
+ return [P(t2, l2 + (t2[s2] || "<?>") + (2 === i2 ? "</svg>" : 3 === i2 ? "</math>" : "")), o2];
278
+ };
279
+ class N {
280
+ constructor({ strings: t2, _$litType$: s2 }, n3) {
281
+ let r3;
282
+ this.parts = [];
283
+ let c2 = 0, a2 = 0;
284
+ const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = V(t2, s2);
285
+ if (this.el = N.createElement(f2, n3), C.currentNode = this.el.content, 2 === s2 || 3 === s2) {
286
+ const t3 = this.el.content.firstChild;
287
+ t3.replaceWith(...t3.childNodes);
288
+ }
289
+ for (; null !== (r3 = C.nextNode()) && d2.length < u2; ) {
290
+ if (1 === r3.nodeType) {
291
+ if (r3.hasAttributes()) for (const t3 of r3.getAttributeNames()) if (t3.endsWith(e$5)) {
292
+ const i2 = v2[a2++], s3 = r3.getAttribute(t3).split(h), e2 = /([.?@])?(.*)/.exec(i2);
293
+ d2.push({ type: 1, index: c2, name: e2[2], strings: s3, ctor: "." === e2[1] ? H : "?" === e2[1] ? I : "@" === e2[1] ? L : k }), r3.removeAttribute(t3);
294
+ } else t3.startsWith(h) && (d2.push({ type: 6, index: c2 }), r3.removeAttribute(t3));
295
+ if ($.test(r3.tagName)) {
296
+ const t3 = r3.textContent.split(h), s3 = t3.length - 1;
297
+ if (s3 > 0) {
298
+ r3.textContent = i$2 ? i$2.emptyScript : "";
299
+ for (let i2 = 0; i2 < s3; i2++) r3.append(t3[i2], l()), C.nextNode(), d2.push({ type: 2, index: ++c2 });
300
+ r3.append(t3[s3], l());
301
+ }
302
+ }
303
+ } else if (8 === r3.nodeType) if (r3.data === o$3) d2.push({ type: 2, index: c2 });
304
+ else {
305
+ let t3 = -1;
306
+ for (; -1 !== (t3 = r3.data.indexOf(h, t3 + 1)); ) d2.push({ type: 7, index: c2 }), t3 += h.length - 1;
307
+ }
308
+ c2++;
309
+ }
310
+ }
311
+ static createElement(t2, i2) {
312
+ const s2 = r$3.createElement("template");
313
+ return s2.innerHTML = t2, s2;
314
+ }
315
+ }
316
+ function S(t2, i2, s2 = t2, e2) {
317
+ if (i2 === T) return i2;
318
+ let h2 = void 0 !== e2 ? s2._$Co?.[e2] : s2._$Cl;
319
+ const o2 = c(i2) ? void 0 : i2._$litDirective$;
320
+ return h2?.constructor !== o2 && (h2?._$AO?.(false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ??= [])[e2] = h2 : s2._$Cl = h2), void 0 !== h2 && (i2 = S(t2, h2._$AS(t2, i2.values), h2, e2)), i2;
321
+ }
322
+ class M {
323
+ constructor(t2, i2) {
324
+ this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2;
325
+ }
326
+ get parentNode() {
327
+ return this._$AM.parentNode;
328
+ }
329
+ get _$AU() {
330
+ return this._$AM._$AU;
331
+ }
332
+ u(t2) {
333
+ const { el: { content: i2 }, parts: s2 } = this._$AD, e2 = (t2?.creationScope ?? r$3).importNode(i2, true);
334
+ C.currentNode = e2;
335
+ let h2 = C.nextNode(), o2 = 0, n3 = 0, l2 = s2[0];
336
+ for (; void 0 !== l2; ) {
337
+ if (o2 === l2.index) {
338
+ let i3;
339
+ 2 === l2.type ? i3 = new R(h2, h2.nextSibling, this, t2) : 1 === l2.type ? i3 = new l2.ctor(h2, l2.name, l2.strings, this, t2) : 6 === l2.type && (i3 = new z(h2, this, t2)), this._$AV.push(i3), l2 = s2[++n3];
340
+ }
341
+ o2 !== l2?.index && (h2 = C.nextNode(), o2++);
342
+ }
343
+ return C.currentNode = r$3, e2;
344
+ }
345
+ p(t2) {
346
+ let i2 = 0;
347
+ for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++;
348
+ }
349
+ }
350
+ class R {
351
+ get _$AU() {
352
+ return this._$AM?._$AU ?? this._$Cv;
353
+ }
354
+ constructor(t2, i2, s2, e2) {
355
+ this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cv = e2?.isConnected ?? true;
356
+ }
357
+ get parentNode() {
358
+ let t2 = this._$AA.parentNode;
359
+ const i2 = this._$AM;
360
+ return void 0 !== i2 && 11 === t2?.nodeType && (t2 = i2.parentNode), t2;
361
+ }
362
+ get startNode() {
363
+ return this._$AA;
364
+ }
365
+ get endNode() {
366
+ return this._$AB;
367
+ }
368
+ _$AI(t2, i2 = this) {
369
+ t2 = S(this, t2, i2), c(t2) ? t2 === E || null == t2 || "" === t2 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t2 !== this._$AH && t2 !== T && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u(t2) ? this.k(t2) : this._(t2);
370
+ }
371
+ O(t2) {
372
+ return this._$AA.parentNode.insertBefore(t2, this._$AB);
373
+ }
374
+ T(t2) {
375
+ this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2));
376
+ }
377
+ _(t2) {
378
+ this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$3.createTextNode(t2)), this._$AH = t2;
379
+ }
380
+ $(t2) {
381
+ const { values: i2, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = N.createElement(P(s2.h, s2.h[0]), this.options)), s2);
382
+ if (this._$AH?._$AD === e2) this._$AH.p(i2);
383
+ else {
384
+ const t3 = new M(e2, this), s3 = t3.u(this.options);
385
+ t3.p(i2), this.T(s3), this._$AH = t3;
386
+ }
387
+ }
388
+ _$AC(t2) {
389
+ let i2 = A.get(t2.strings);
390
+ return void 0 === i2 && A.set(t2.strings, i2 = new N(t2)), i2;
391
+ }
392
+ k(t2) {
393
+ a(this._$AH) || (this._$AH = [], this._$AR());
394
+ const i2 = this._$AH;
395
+ let s2, e2 = 0;
396
+ for (const h2 of t2) e2 === i2.length ? i2.push(s2 = new R(this.O(l()), this.O(l()), this, this.options)) : s2 = i2[e2], s2._$AI(h2), e2++;
397
+ e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2);
398
+ }
399
+ _$AR(t2 = this._$AA.nextSibling, i2) {
400
+ for (this._$AP?.(false, true, i2); t2 && t2 !== this._$AB; ) {
401
+ const i3 = t2.nextSibling;
402
+ t2.remove(), t2 = i3;
403
+ }
404
+ }
405
+ setConnected(t2) {
406
+ void 0 === this._$AM && (this._$Cv = t2, this._$AP?.(t2));
407
+ }
408
+ }
409
+ class k {
410
+ get tagName() {
411
+ return this.element.tagName;
412
+ }
413
+ get _$AU() {
414
+ return this._$AM._$AU;
415
+ }
416
+ constructor(t2, i2, s2, e2, h2) {
417
+ this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = E;
418
+ }
419
+ _$AI(t2, i2 = this, s2, e2) {
420
+ const h2 = this.strings;
421
+ let o2 = false;
422
+ if (void 0 === h2) t2 = S(this, t2, i2, 0), o2 = !c(t2) || t2 !== this._$AH && t2 !== T, o2 && (this._$AH = t2);
423
+ else {
424
+ const e3 = t2;
425
+ let n3, r3;
426
+ for (t2 = h2[0], n3 = 0; n3 < h2.length - 1; n3++) r3 = S(this, e3[s2 + n3], i2, n3), r3 === T && (r3 = this._$AH[n3]), o2 ||= !c(r3) || r3 !== this._$AH[n3], r3 === E ? t2 = E : t2 !== E && (t2 += (r3 ?? "") + h2[n3 + 1]), this._$AH[n3] = r3;
427
+ }
428
+ o2 && !e2 && this.j(t2);
429
+ }
430
+ j(t2) {
431
+ t2 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? "");
432
+ }
433
+ }
434
+ class H extends k {
435
+ constructor() {
436
+ super(...arguments), this.type = 3;
437
+ }
438
+ j(t2) {
439
+ this.element[this.name] = t2 === E ? void 0 : t2;
440
+ }
441
+ }
442
+ class I extends k {
443
+ constructor() {
444
+ super(...arguments), this.type = 4;
445
+ }
446
+ j(t2) {
447
+ this.element.toggleAttribute(this.name, !!t2 && t2 !== E);
448
+ }
449
+ }
450
+ class L extends k {
451
+ constructor(t2, i2, s2, e2, h2) {
452
+ super(t2, i2, s2, e2, h2), this.type = 5;
453
+ }
454
+ _$AI(t2, i2 = this) {
455
+ if ((t2 = S(this, t2, i2, 0) ?? E) === T) return;
456
+ const s2 = this._$AH, e2 = t2 === E && s2 !== E || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== E && (s2 === E || e2);
457
+ e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2;
458
+ }
459
+ handleEvent(t2) {
460
+ "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2);
461
+ }
462
+ }
463
+ class z {
464
+ constructor(t2, i2, s2) {
465
+ this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2;
466
+ }
467
+ get _$AU() {
468
+ return this._$AM._$AU;
469
+ }
470
+ _$AI(t2) {
471
+ S(this, t2);
472
+ }
473
+ }
474
+ const j = t$2.litHtmlPolyfillSupport;
475
+ j?.(N, R), (t$2.litHtmlVersions ??= []).push("3.2.1");
476
+ const B = (t2, i2, s2) => {
477
+ const e2 = s2?.renderBefore ?? i2;
478
+ let h2 = e2._$litPart$;
479
+ if (void 0 === h2) {
480
+ const t3 = s2?.renderBefore ?? null;
481
+ e2._$litPart$ = h2 = new R(i2.insertBefore(l(), t3), t3, void 0, s2 ?? {});
482
+ }
483
+ return h2._$AI(t2), h2;
484
+ };
485
+ /**
486
+ * @license
487
+ * Copyright 2017 Google LLC
488
+ * SPDX-License-Identifier: BSD-3-Clause
489
+ */
490
+ let r$2 = class r extends b {
491
+ constructor() {
492
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
493
+ }
494
+ createRenderRoot() {
495
+ const t2 = super.createRenderRoot();
496
+ return this.renderOptions.renderBefore ??= t2.firstChild, t2;
497
+ }
498
+ update(t2) {
499
+ const s2 = this.render();
500
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = B(s2, this.renderRoot, this.renderOptions);
501
+ }
502
+ connectedCallback() {
503
+ super.connectedCallback(), this._$Do?.setConnected(true);
504
+ }
505
+ disconnectedCallback() {
506
+ super.disconnectedCallback(), this._$Do?.setConnected(false);
507
+ }
508
+ render() {
509
+ return T;
510
+ }
511
+ };
512
+ r$2._$litElement$ = true, r$2["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: r$2 });
513
+ const i$1 = globalThis.litElementPolyfillSupport;
514
+ i$1?.({ LitElement: r$2 });
515
+ (globalThis.litElementVersions ??= []).push("4.1.1");
516
+ /**
517
+ * @license
518
+ * Copyright 2017 Google LLC
519
+ * SPDX-License-Identifier: BSD-3-Clause
520
+ */
521
+ const t$1 = (t2) => (e2, o2) => {
522
+ void 0 !== o2 ? o2.addInitializer(() => {
523
+ customElements.define(t2, e2);
524
+ }) : customElements.define(t2, e2);
525
+ };
526
+ /**
527
+ * @license
528
+ * Copyright 2017 Google LLC
529
+ * SPDX-License-Identifier: BSD-3-Clause
530
+ */
531
+ const o$2 = { attribute: true, type: String, converter: u$1, reflect: false, hasChanged: f$1 }, r$1 = (t2 = o$2, e2, r3) => {
532
+ const { kind: n3, metadata: i2 } = r3;
533
+ let s2 = globalThis.litPropertyMetadata.get(i2);
534
+ if (void 0 === s2 && globalThis.litPropertyMetadata.set(i2, s2 = /* @__PURE__ */ new Map()), s2.set(r3.name, t2), "accessor" === n3) {
535
+ const { name: o2 } = r3;
536
+ return { set(r4) {
537
+ const n4 = e2.get.call(this);
538
+ e2.set.call(this, r4), this.requestUpdate(o2, n4, t2);
539
+ }, init(e3) {
540
+ return void 0 !== e3 && this.P(o2, void 0, t2), e3;
541
+ } };
542
+ }
543
+ if ("setter" === n3) {
544
+ const { name: o2 } = r3;
545
+ return function(r4) {
546
+ const n4 = this[o2];
547
+ e2.call(this, r4), this.requestUpdate(o2, n4, t2);
548
+ };
549
+ }
550
+ throw Error("Unsupported decorator location: " + n3);
551
+ };
552
+ function n2(t2) {
553
+ return (e2, o2) => "object" == typeof o2 ? r$1(t2, e2, o2) : ((t3, e3, o3) => {
554
+ const r3 = e3.hasOwnProperty(o3);
555
+ return e3.constructor.createProperty(o3, r3 ? { ...t3, wrapped: true } : t3), r3 ? Object.getOwnPropertyDescriptor(e3, o3) : void 0;
556
+ })(t2, e2, o2);
557
+ }
558
+ /**
559
+ * @license
560
+ * Copyright 2017 Google LLC
561
+ * SPDX-License-Identifier: BSD-3-Clause
562
+ */
563
+ function r2(r3) {
564
+ return n2({ ...r3, state: true, attribute: false });
565
+ }
566
+ /**
567
+ * @license
568
+ * Copyright 2017 Google LLC
569
+ * SPDX-License-Identifier: BSD-3-Clause
570
+ */
571
+ const e$4 = (e2, t2, c2) => (c2.configurable = true, c2.enumerable = true, Reflect.decorate && "object" != typeof t2 && Object.defineProperty(e2, t2, c2), c2);
572
+ /**
573
+ * @license
574
+ * Copyright 2017 Google LLC
575
+ * SPDX-License-Identifier: BSD-3-Clause
576
+ */
577
+ function e$3(e2, r3) {
578
+ return (n3, s2, i2) => {
579
+ const o2 = (t2) => t2.renderRoot?.querySelector(e2) ?? null;
580
+ return e$4(n3, s2, { get() {
581
+ return o2(this);
582
+ } });
583
+ };
584
+ }
585
+ /**
586
+ * @license
587
+ * Copyright 2017 Google LLC
588
+ * SPDX-License-Identifier: BSD-3-Clause
589
+ */
590
+ const t = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e$2 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 });
591
+ class i {
592
+ constructor(t2) {
593
+ }
594
+ get _$AU() {
595
+ return this._$AM._$AU;
596
+ }
597
+ _$AT(t2, e2, i2) {
598
+ this._$Ct = t2, this._$AM = e2, this._$Ci = i2;
599
+ }
600
+ _$AS(t2, e2) {
601
+ return this.update(t2, e2);
602
+ }
603
+ update(t2, e2) {
604
+ return this.render(...e2);
605
+ }
606
+ }
607
+ /**
608
+ * @license
609
+ * Copyright 2018 Google LLC
610
+ * SPDX-License-Identifier: BSD-3-Clause
611
+ */
612
+ const e$1 = e$2(class extends i {
613
+ constructor(t$12) {
614
+ if (super(t$12), t$12.type !== t.ATTRIBUTE || "class" !== t$12.name || t$12.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
615
+ }
616
+ render(t2) {
617
+ return " " + Object.keys(t2).filter((s2) => t2[s2]).join(" ") + " ";
618
+ }
619
+ update(s2, [i2]) {
620
+ if (void 0 === this.st) {
621
+ this.st = /* @__PURE__ */ new Set(), void 0 !== s2.strings && (this.nt = new Set(s2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2)));
622
+ for (const t2 in i2) i2[t2] && !this.nt?.has(t2) && this.st.add(t2);
623
+ return this.render(i2);
624
+ }
625
+ const r3 = s2.element.classList;
626
+ for (const t2 of this.st) t2 in i2 || (r3.remove(t2), this.st.delete(t2));
627
+ for (const t2 in i2) {
628
+ const s3 = !!i2[t2];
629
+ s3 === this.st.has(t2) || this.nt?.has(t2) || (s3 ? (r3.add(t2), this.st.add(t2)) : (r3.remove(t2), this.st.delete(t2)));
630
+ }
631
+ return T;
632
+ }
633
+ });
634
+ /**
635
+ * @license
636
+ * Copyright 2018 Google LLC
637
+ * SPDX-License-Identifier: BSD-3-Clause
638
+ */
639
+ const o$1 = (o2) => o2 ?? E;
640
+ const styles$h = i$4`
641
+ :host {
642
+ --_color-semantic-surface-critical-hover: #b32a23;
643
+ display: inline-block;
644
+ box-sizing: border-box;
645
+ }
646
+
647
+ .sds-button {
648
+ align-items: center;
649
+ display: inline-flex;
650
+ gap: var(--sds-spacing-3, 8px);
651
+ justify-content: center;
652
+ padding: var(--sds-spacing-3) var(--sds-spacing-4);
653
+
654
+ background-color: var(--sds-color-semantic-surface-action-default);
655
+ border: 2px solid var(--sds-color-semantic-border-action);
656
+ border-radius: var(--sds-radius-4);
657
+ cursor: pointer;
658
+
659
+ color: var(--sds-color-semantic-text-on-action);
660
+ font-family: var(--sds-typography-font-family);
661
+ font-size: 1rem;
662
+ font-weight: 500;
663
+ line-height: 1.5;
664
+ text-align: center;
665
+
666
+ &:hover {
667
+ background-color: var(--sds-color-semantic-surface-action-hover);
668
+ border: 2px solid var(--sds-color-semantic-surface-action-hover);
669
+ }
670
+
671
+ &:active {
672
+ background-color: var(--sds-color-semantic-surface-action-active);
673
+ border: 2px solid var(--sds-color-semantic-surface-action-active);
674
+ outline: 0;
675
+ }
676
+
677
+ &:disabled {
678
+ background-color: var(--sds-color-semantic-surface-disabled);
679
+ border: 2px solid var(--sds-color-semantic-surface-disabled);
680
+ color: var(--sds-color-semantic-text-subtle);
681
+ cursor: not-allowed;
682
+ }
683
+ }
684
+
685
+ .sds-button:focus,
686
+ :host(:focus) .give-focus {
687
+ background-color: var(--sds-color-semantic-surface-action-default);
688
+ outline: 2px solid var(--sds-color-semantic-surface-action-default);
689
+ outline-offset: 1px;
690
+ }
691
+
692
+ .sds-button--secondary {
693
+ background-color: var(--sds-color-semantic-surface-action-inverted);
694
+ border: 2px solid var(--sds-color-semantic-border-action);
695
+ color: var(--sds-color-semantic-text-default);
696
+
697
+ &:focus {
698
+ background-color: var(--sds-color-semantic-surface-action-inverted);
699
+ border: 2px solid var(--sds-color-semantic-border-action);
700
+ }
701
+
702
+ &:hover {
703
+ background-color: var(--sds-color-semantic-surface-action-subtle);
704
+ }
705
+
706
+ &:active {
707
+ background-color: var(--sds-color-semantic-surface-action-active);
708
+ border: 2px solid var(--sds-color-semantic-surface-action-active);
709
+ color: var(--sds-color-semantic-text-on-action);
710
+ outline: 0;
711
+ }
712
+
713
+ &:disabled {
714
+ border: 2px solid var(--sds-color-semantic-border-disabled);
715
+ background: var(--sds-color-semantic-surface-action-inverted);
716
+ color: var(--sds-color-semantic-text-disabled);
717
+ }
718
+ }
719
+
720
+ .sds-button--tertiary {
721
+ background-color: transparent;
722
+ border: 2px solid transparent;
723
+ color: var(--sds-color-semantic-text-action-default);
724
+
725
+ &:focus {
726
+ background-color: transparent;
727
+ border: 2px solid transparent;
728
+ }
729
+
730
+ &:hover {
731
+ background-color: var(--sds-color-semantic-surface-action-subtle);
732
+ }
733
+
734
+ &:active {
735
+ background-color: var(--sds-color-semantic-surface-action-active);
736
+ border: 2px solid var(--sds-color-semantic-surface-action-active);
737
+ color: var(--sds-color-semantic-text-on-action);
738
+ outline: 0;
739
+ position: relative;
740
+ }
741
+
742
+ &:disabled {
743
+ border: 2px solid transparent;
744
+ background: transparent;
745
+ color: var(--sds-color-semantic-text-disabled);
746
+ }
747
+ }
748
+
749
+ .sds-button--critical {
750
+ background-color: var(--sds-color-semantic-surface-critical-xtreme);
751
+ border: 2px solid var(--sds-color-semantic-border-critical);
752
+ color: var(--sds-color-semantic-text-on-critical);
753
+
754
+ &:focus {
755
+ background-color: var(--sds-color-semantic-surface-critical-xtreme);
756
+ border: 2px solid var(--sds-color-semantic-border-critical);
757
+ }
758
+
759
+ &:hover {
760
+ background-color: var(--_color-semantic-surface-critical-hover);
761
+ border: 2px solid var(--_color-semantic-surface-critical-hover);
762
+ }
763
+
764
+ &:active {
765
+ background-color: var(--sds-color-semantic-surface-action-active);
766
+ border: 2px solid var(--sds-color-semantic-surface-action-active);
767
+ }
768
+
769
+ &:disabled {
770
+ background-color: var(--sds-color-semantic-surface-disabled);
771
+ border: 2px solid var(--sds-color-semantic-surface-disabled);
772
+ color: var(--sds-color-semantic-text-subtle);
773
+ }
774
+ }
775
+
776
+ .sds-button--medium {
777
+ padding: var(--sds-spacing-1) var(--sds-spacing-3);
778
+ }
779
+
780
+ .sds-button--small {
781
+ font-size: 0.875rem;
782
+ padding: 0 var(--sds-spacing-3);
783
+ }
784
+ `;
785
+ var __defProp$h = Object.defineProperty;
786
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
787
+ var __decorateClass$h = (decorators, target, key, kind) => {
788
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
789
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
790
+ if (decorator = decorators[i2])
791
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
792
+ if (kind && result) __defProp$h(target, key, result);
793
+ return result;
794
+ };
795
+ let SDSButton = class extends r$2 {
796
+ constructor() {
797
+ super();
798
+ this.type = "button";
799
+ this.variant = "primary";
800
+ this.size = "large";
801
+ this.disabled = false;
802
+ this.value = "";
803
+ this._handleClick = (event) => {
804
+ event.preventDefault();
805
+ event.stopImmediatePropagation();
806
+ if (!this.disabled) {
807
+ switch (this.type) {
808
+ case "submit": {
809
+ const submitEvent = new CustomEvent("submit", {
810
+ bubbles: true,
811
+ composed: true,
812
+ cancelable: true
813
+ });
814
+ const shouldSubmit = this.dispatchEvent(submitEvent);
815
+ if (shouldSubmit) {
816
+ if (this.form) {
817
+ const root = this.getRootNode();
818
+ const formElement = root.querySelector(`form#${this.form}`);
819
+ formElement?.submit();
820
+ } else if (this.internals.form) {
821
+ this.internals.form.submit();
822
+ }
823
+ }
824
+ break;
825
+ }
826
+ case "reset": {
827
+ const resetEvent = new CustomEvent("reset", {
828
+ bubbles: true,
829
+ composed: true,
830
+ cancelable: true
831
+ });
832
+ const shouldReset = this.dispatchEvent(resetEvent);
833
+ if (shouldReset) {
834
+ if (this.form) {
835
+ const root = this.getRootNode();
836
+ const formElement = root.querySelector(`form#${this.form}`);
837
+ formElement?.reset();
838
+ } else if (this.internals.form) {
839
+ this.internals.form.reset();
840
+ }
841
+ }
842
+ break;
843
+ }
844
+ default:
845
+ this.dispatchEvent(
846
+ new CustomEvent("click", {
847
+ bubbles: true,
848
+ composed: true
849
+ })
850
+ );
851
+ }
852
+ }
853
+ };
854
+ this.internals = this.attachInternals();
855
+ this.attachShadow({ mode: "open", delegatesFocus: true });
856
+ }
857
+ focus() {
858
+ if (!this.disabled) this.shadowRoot?.querySelector("button")?.focus();
859
+ }
860
+ blur() {
861
+ if (!this.disabled) this.shadowRoot?.querySelector("button")?.blur();
862
+ }
863
+ click() {
864
+ if (!this.disabled) this.shadowRoot?.querySelector("button")?.click();
865
+ }
866
+ render() {
867
+ const buttonClasses = {
868
+ "sds-button": true,
869
+ "sds-button--secondary": this.variant === "secondary",
870
+ "sds-button--tertiary": this.variant === "tertiary",
871
+ "sds-button--critical": this.variant === "critical",
872
+ "sds-button--medium": this.size === "medium",
873
+ "sds-button--small": this.size === "small"
874
+ };
875
+ return x`
876
+ <button
877
+ id="control"
878
+ form="${o$1(this.form)}"
879
+ class="${e$1(buttonClasses)}"
880
+ type="${this.type}"
881
+ name="${o$1(this.name)}"
882
+ value="${o$1(this.value)}"
883
+ ?disabled="${this.disabled}"
884
+ @click="${this._handleClick}"
885
+ >
886
+ <slot name="before"></slot>
887
+ <slot></slot>
888
+ <slot name="after"></slot>
889
+ </button>
890
+ `;
891
+ }
892
+ };
893
+ SDSButton.styles = [styles$h];
894
+ SDSButton.formAssociated = true;
895
+ __decorateClass$h([
896
+ n2({ type: String, reflect: true })
897
+ ], SDSButton.prototype, "type", 2);
898
+ __decorateClass$h([
899
+ n2({ type: String, reflect: true })
900
+ ], SDSButton.prototype, "variant", 2);
901
+ __decorateClass$h([
902
+ n2({ type: String, reflect: true })
903
+ ], SDSButton.prototype, "size", 2);
904
+ __decorateClass$h([
905
+ n2({ type: Boolean, reflect: true })
906
+ ], SDSButton.prototype, "disabled", 2);
907
+ __decorateClass$h([
908
+ n2({ type: String, reflect: true })
909
+ ], SDSButton.prototype, "name", 2);
910
+ __decorateClass$h([
911
+ n2({ type: String, reflect: true })
912
+ ], SDSButton.prototype, "value", 2);
913
+ __decorateClass$h([
914
+ n2({ type: String, reflect: true })
915
+ ], SDSButton.prototype, "form", 2);
916
+ SDSButton = __decorateClass$h([
917
+ t$1("sds-button")
918
+ ], SDSButton);
919
+ const styles$g = i$4`
920
+ :host {
921
+ flex: 0 0 auto;
922
+ }
923
+
924
+ .sds-checkbox__label {
925
+ align-items: flex-start;
926
+ cursor: pointer;
927
+ color: var(--sds-color-semantic-text-default);
928
+ display: inline-flex;
929
+ font-family: var(--sds-typography-font-family);
930
+ font-size: 1rem;
931
+ font-weight: 400;
932
+ gap: var(--sds-spacing-3);
933
+ line-height: 1.25;
934
+
935
+ &:has(:disabled) {
936
+ cursor: default;
937
+ pointer-events: none;
938
+ }
939
+ }
940
+
941
+ .sds-checkbox__input {
942
+ appearance: none;
943
+ background-color: transparent;
944
+ color: currentColor;
945
+ cursor: pointer;
946
+ width: 24px;
947
+ height: 24px;
948
+ border: 1px solid var(--sds-color-semantic-border-default);
949
+ border-radius: var(--sds-radius-2);
950
+ margin: 0;
951
+ /*transition:
952
+ background-color 0.3s ease,
953
+ box-shadow 0.3s ease;*/
954
+
955
+ &:checked {
956
+ background-color: var(--sds-color-semantic-surface-action-selected);
957
+ border-color: var(--sds-color-semantic-surface-action-selected);
958
+
959
+ &::after {
960
+ content: '';
961
+ position: absolute;
962
+ width: 24px;
963
+ height: 24px;
964
+ background-color: white;
965
+ transform-origin: bottom left;
966
+ clip-path: path(
967
+ 'M9.54998 18L3.84998 12.3L5.27498 10.875L9.54998 15.15L18.725 5.97501L20.15 7.40001L9.54998 18Z'
968
+ );
969
+ transform: translate(-1px, -1px);
970
+ /*transition:
971
+ background-color 0.3s ease,
972
+ box-shadow 0.3s ease;*/
973
+ }
974
+ }
975
+
976
+ &:hover {
977
+ border-width: 2px;
978
+
979
+ &:checked {
980
+ &::after {
981
+ transform: translate(-2px, -2px);
982
+ }
983
+ }
984
+ }
985
+
986
+ &:focus {
987
+ outline: 2px solid var(--sds-color-semantic-border-focus);
988
+ outline-offset: 2px;
989
+ }
990
+
991
+ &.sds-checkbox__input--error {
992
+ border: 2px solid var(--sds-color-semantic-surface-critical-xtreme);
993
+
994
+ &:checked {
995
+ // TODO: Decide if checked checkbox with error should be fully red
996
+ //background-color: var(--sds-color-semantic-border-critical);
997
+
998
+ &::after {
999
+ transform: translate(-2px, -2px);
1000
+ }
1001
+ }
1002
+ }
1003
+
1004
+ &:disabled {
1005
+ border: 2px solid var(--sds-color-semantic-border-disabled);
1006
+
1007
+ &:checked {
1008
+ background-color: var(--sds-color-semantic-border-disabled);
1009
+
1010
+ &::after {
1011
+ transform: translate(-2px, -2px);
1012
+ }
1013
+ }
1014
+
1015
+ & + .sds-checkbox__text {
1016
+ color: var(--sds-color-semantic-border-disabled);
1017
+ }
1018
+ }
1019
+ }
1020
+
1021
+ .sds-checkbox__text {
1022
+ display: inline-block;
1023
+ max-width: var(--sds-typography-max-line-width);
1024
+ padding-top: 2px;
1025
+ }
1026
+ `;
1027
+ var __defProp$g = Object.defineProperty;
1028
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
1029
+ var __decorateClass$g = (decorators, target, key, kind) => {
1030
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
1031
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1032
+ if (decorator = decorators[i2])
1033
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1034
+ if (kind && result) __defProp$g(target, key, result);
1035
+ return result;
1036
+ };
1037
+ let SDSCheckbox = class extends r$2 {
1038
+ constructor() {
1039
+ super();
1040
+ this.checked = false;
1041
+ this.disabled = false;
1042
+ this.error = false;
1043
+ this._handleChange = (event) => {
1044
+ event.stopImmediatePropagation();
1045
+ if (!this.disabled) {
1046
+ const elem = event.target;
1047
+ this.checked = elem.checked;
1048
+ this.dispatchEvent(
1049
+ new CustomEvent("change", {
1050
+ detail: { checked: this.checked, value: elem.value },
1051
+ bubbles: true,
1052
+ composed: true
1053
+ })
1054
+ );
1055
+ }
1056
+ };
1057
+ this._handleFocus = (event) => {
1058
+ event.stopImmediatePropagation();
1059
+ this.dispatchEvent(
1060
+ new CustomEvent("focus", {
1061
+ detail: { checked: this.checked },
1062
+ bubbles: true,
1063
+ composed: true
1064
+ })
1065
+ );
1066
+ };
1067
+ this._handleBlur = (event) => {
1068
+ event.stopImmediatePropagation();
1069
+ this.dispatchEvent(
1070
+ new CustomEvent("blur", {
1071
+ detail: { checked: this.checked },
1072
+ bubbles: true,
1073
+ composed: true
1074
+ })
1075
+ );
1076
+ };
1077
+ this.internals = this.attachInternals();
1078
+ this.attachShadow({ mode: "open", delegatesFocus: true });
1079
+ }
1080
+ focus() {
1081
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.focus();
1082
+ }
1083
+ blur() {
1084
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.blur();
1085
+ }
1086
+ click() {
1087
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.click();
1088
+ }
1089
+ render() {
1090
+ const checkboxClasses = {
1091
+ "sds-checkbox": true,
1092
+ "sds-checkbox--error": Boolean(this.error)
1093
+ };
1094
+ const inputClasses = {
1095
+ "sds-checkbox__input": true,
1096
+ "sds-checkbox__input--error": Boolean(this.error)
1097
+ };
1098
+ return x`
1099
+ <div class="${e$1(checkboxClasses)}">
1100
+ <label class="sds-checkbox__label">
1101
+ <input
1102
+ type="checkbox"
1103
+ name="${o$1(this.name)}"
1104
+ value="${o$1(this.value)}"
1105
+ ?checked="${this.checked}"
1106
+ ?disabled="${this.disabled}"
1107
+ @change="${this._handleChange}"
1108
+ @focus="${this._handleFocus}"
1109
+ @blur="${this._handleBlur}"
1110
+ class="${e$1(inputClasses)}"
1111
+ />
1112
+ ${this.label ? x`<span class="sds-checkbox__text">${this.label}</span>` : E}
1113
+ </label>
1114
+ </div>
1115
+ `;
1116
+ }
1117
+ };
1118
+ SDSCheckbox.styles = [styles$g];
1119
+ SDSCheckbox.formAssociated = true;
1120
+ __decorateClass$g([
1121
+ n2({ type: String, reflect: true })
1122
+ ], SDSCheckbox.prototype, "name", 2);
1123
+ __decorateClass$g([
1124
+ n2({ type: String, reflect: true })
1125
+ ], SDSCheckbox.prototype, "label", 2);
1126
+ __decorateClass$g([
1127
+ n2({ type: String })
1128
+ ], SDSCheckbox.prototype, "value", 2);
1129
+ __decorateClass$g([
1130
+ n2({ type: Boolean, reflect: true })
1131
+ ], SDSCheckbox.prototype, "checked", 2);
1132
+ __decorateClass$g([
1133
+ n2({ type: Boolean, reflect: true })
1134
+ ], SDSCheckbox.prototype, "disabled", 2);
1135
+ __decorateClass$g([
1136
+ n2({ type: Boolean, reflect: true })
1137
+ ], SDSCheckbox.prototype, "error", 2);
1138
+ SDSCheckbox = __decorateClass$g([
1139
+ t$1("sds-checkbox")
1140
+ ], SDSCheckbox);
1141
+ const styles$f = i$4`
1142
+ :host {
1143
+ display: block;
1144
+ contain: layout style;
1145
+ box-sizing: border-box;
1146
+ }
1147
+
1148
+ .sds-checkbox-group {
1149
+ border: 0;
1150
+ font-family: var(--sds-typography-font-family);
1151
+ margin: 0;
1152
+ padding: 0;
1153
+ }
1154
+
1155
+ .sds-checkbox-group__legend {
1156
+ color: var(--sds-color-semantic-text-default);
1157
+ font-size: 1rem;
1158
+ font-weight: 700;
1159
+ line-height: 1.5;
1160
+ margin: 0 0 var(--sds-spacing-2) 0;
1161
+ max-width: var(--sds-typography-max-line-width);
1162
+ padding: 0;
1163
+ }
1164
+
1165
+ .sds-checkbox-group__help-text {
1166
+ color: var(--sds-color-semantic-text-subtle);
1167
+ font-size: 1rem;
1168
+ font-weight: 400;
1169
+ line-height: 1.25rem;
1170
+ margin: 0;
1171
+ max-width: var(--sds-typography-max-line-width);
1172
+ }
1173
+
1174
+ .sds-checkbox-group__checkboxes {
1175
+ display: flex;
1176
+ flex-direction: column;
1177
+ gap: var(--sds-spacing-5);
1178
+ margin-top: var(--sds-spacing-3);
1179
+ }
1180
+
1181
+ .sds-checkbox-group__error-message {
1182
+ margin: var(--sds-spacing-5) 0 0;
1183
+ max-width: var(--sds-typography-max-line-width);
1184
+ align-items: flex-start;
1185
+ color: var(--sds-color-semantic-text-default);
1186
+ display: flex;
1187
+ line-height: 1.5rem;
1188
+ gap: var(--sds-spacing-2);
1189
+ }
1190
+ `;
1191
+ /**
1192
+ * @license
1193
+ * Copyright 2017 Google LLC
1194
+ * SPDX-License-Identifier: BSD-3-Clause
1195
+ */
1196
+ class e extends i {
1197
+ constructor(i2) {
1198
+ if (super(i2), this.it = E, i2.type !== t.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
1199
+ }
1200
+ render(r3) {
1201
+ if (r3 === E || null == r3) return this._t = void 0, this.it = r3;
1202
+ if (r3 === T) return r3;
1203
+ if ("string" != typeof r3) throw Error(this.constructor.directiveName + "() called with a non-string value");
1204
+ if (r3 === this.it) return this._t;
1205
+ this.it = r3;
1206
+ const s2 = [r3];
1207
+ return s2.raw = s2, this._t = { _$litType$: this.constructor.resultType, strings: s2, values: [] };
1208
+ }
1209
+ }
1210
+ e.directiveName = "unsafeHTML", e.resultType = 1;
1211
+ const o = e$2(e);
1212
+ const _SDSIconLoader = class _SDSIconLoader {
1213
+ constructor() {
1214
+ this.cache = /* @__PURE__ */ new Map();
1215
+ this.resolver = _SDSIconLoader.defaultResolver;
1216
+ }
1217
+ resolve(name, onResolved) {
1218
+ const cached = this.cache.get(name);
1219
+ if (cached != null) {
1220
+ onResolved(cached);
1221
+ return;
1222
+ }
1223
+ this.resolver(name).catch((error) => {
1224
+ console.error(`Failed to fetch icon '${name}':`, error);
1225
+ return "";
1226
+ }).then((svg) => {
1227
+ this.cache.set(name, svg);
1228
+ onResolved(svg);
1229
+ });
1230
+ }
1231
+ // Allow consumers to override the resolver
1232
+ static setCustomResolver(resolver) {
1233
+ _SDSIconLoader.defaultResolver = resolver;
1234
+ }
1235
+ };
1236
+ _SDSIconLoader.defaultResolver = async (name) => {
1237
+ try {
1238
+ return await _SDSIconLoader.loadCdnIcons(name);
1239
+ } catch (error) {
1240
+ console.warn(`CDN icon '${name}' not found, falling back to local.`);
1241
+ return _SDSIconLoader.loadLocalIcons(name);
1242
+ }
1243
+ };
1244
+ _SDSIconLoader.loadCdnIcons = async (name) => fetch(`https://unpkg.com/@politiet/sheriff-icons/dist/${name}.svg`).then((response) => {
1245
+ if (!response.ok) throw new Error(`Sheriff: unknown icon '${name}'`);
1246
+ return response.text();
1247
+ });
1248
+ _SDSIconLoader.loadLocalIcons = async (name) => {
1249
+ try {
1250
+ const { default: svg } = await import(`@politiet/sheriff-icons/dist/${name}.js`);
1251
+ return svg;
1252
+ } catch (error) {
1253
+ throw new Error(`Local icon '${name}' could not be loaded.`);
1254
+ }
1255
+ };
1256
+ let SDSIconLoader = _SDSIconLoader;
1257
+ const styles$e = i$4`
1258
+ :host {
1259
+ --icon-size: var(--sds-icon-size-m);
1260
+ display: inline-block;
1261
+ block-size: var(--icon-size);
1262
+ inline-size: var(--icon-size);
1263
+ min-inline-size: var(--icon-size);
1264
+ }
1265
+
1266
+ :host([size='s']) {
1267
+ --icon-size: var(--sds-icon-size-s);
1268
+ }
1269
+ `;
1270
+ var __defProp$f = Object.defineProperty;
1271
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
1272
+ var __decorateClass$f = (decorators, target, key, kind) => {
1273
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
1274
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1275
+ if (decorator = decorators[i2])
1276
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1277
+ if (kind && result) __defProp$f(target, key, result);
1278
+ return result;
1279
+ };
1280
+ let SDSIcon = class extends r$2 {
1281
+ constructor() {
1282
+ super(...arguments);
1283
+ this.name = "";
1284
+ this.size = "m";
1285
+ this.color = "";
1286
+ this.label = "";
1287
+ this.svg = "";
1288
+ }
1289
+ static registerResolver(resolver) {
1290
+ this.iconLoader.resolver = resolver;
1291
+ }
1292
+ async fetchIcon() {
1293
+ if (!this.name) {
1294
+ this.svg = "";
1295
+ return;
1296
+ }
1297
+ try {
1298
+ const svg = await new Promise((resolve) => {
1299
+ SDSIcon.iconLoader.resolve(this.name, resolve);
1300
+ });
1301
+ this.svg = svg;
1302
+ } catch (error) {
1303
+ console.error(`Failed to fetch SVG for icon '${this.name}':`, error);
1304
+ this.svg = "";
1305
+ }
1306
+ }
1307
+ updated(changedProperties) {
1308
+ super.updated(changedProperties);
1309
+ if (changedProperties.has("name") && this.name) {
1310
+ void this.fetchIcon();
1311
+ }
1312
+ }
1313
+ render() {
1314
+ return x`<div
1315
+ class="sds-icon"
1316
+ role="${o$1(this.label ? "img" : void 0)}"
1317
+ style="${o$1(this.color ? `color:${this.color}` : void 0)}"
1318
+ aria-label="${o$1(this.label)}"
1319
+ >
1320
+ ${this.name ? x`<slot aria-hidden="true">${o(this.svg)}</slot>` : x`<slot aria-hidden="true"></slot>`}
1321
+ </div>`;
1322
+ }
1323
+ };
1324
+ SDSIcon.styles = [styles$e];
1325
+ SDSIcon.iconLoader = new SDSIconLoader();
1326
+ __decorateClass$f([
1327
+ n2({ type: String, reflect: true })
1328
+ ], SDSIcon.prototype, "name", 2);
1329
+ __decorateClass$f([
1330
+ n2({ type: String, reflect: true })
1331
+ ], SDSIcon.prototype, "size", 2);
1332
+ __decorateClass$f([
1333
+ n2({ type: String, reflect: true })
1334
+ ], SDSIcon.prototype, "color", 2);
1335
+ __decorateClass$f([
1336
+ n2({ type: String, reflect: true })
1337
+ ], SDSIcon.prototype, "label", 2);
1338
+ __decorateClass$f([
1339
+ r2()
1340
+ ], SDSIcon.prototype, "svg", 2);
1341
+ SDSIcon = __decorateClass$f([
1342
+ t$1("sds-icon")
1343
+ ], SDSIcon);
1344
+ var __defProp$e = Object.defineProperty;
1345
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
1346
+ var __decorateClass$e = (decorators, target, key, kind) => {
1347
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
1348
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1349
+ if (decorator = decorators[i2])
1350
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1351
+ if (kind && result) __defProp$e(target, key, result);
1352
+ return result;
1353
+ };
1354
+ let SDSCheckboxGroup = class extends r$2 {
1355
+ constructor() {
1356
+ super(...arguments);
1357
+ this.selectedValues = [];
1358
+ this._handleCheckboxChange = (event) => {
1359
+ const checkbox = event.target;
1360
+ const value = checkbox.value;
1361
+ const isChecked = checkbox.checked;
1362
+ this.selectedValues = isChecked ? [...this.selectedValues, value] : this.selectedValues.filter((v2) => v2 !== value);
1363
+ this.dispatchEvent(
1364
+ new CustomEvent("change", {
1365
+ detail: { selectedValues: this.selectedValues },
1366
+ bubbles: true,
1367
+ composed: true
1368
+ })
1369
+ );
1370
+ };
1371
+ }
1372
+ render() {
1373
+ const groupClasses = {
1374
+ "sds-checkbox-group": true,
1375
+ "sds-checkbox-group--error": Boolean(this.errorMessage)
1376
+ };
1377
+ return x`
1378
+ <fieldset class="${e$1(groupClasses)}">
1379
+ ${this.legend ? x`<legend class="sds-checkbox-group__legend">${this.legend}</legend>` : E}
1380
+ ${this.helpText ? x`<p class="sds-checkbox-group__help-text">${this.helpText}</p>` : E}
1381
+ <div class="sds-checkbox-group__checkboxes">
1382
+ <slot @change=${this._handleCheckboxChange}></slot>
1383
+ </div>
1384
+ ${this.errorMessage ? x`<p class="sds-checkbox-group__error-message">
1385
+ <sds-icon
1386
+ name="warning-material-filled"
1387
+ size="m"
1388
+ color="var(--sds-color-semantic-icon-critical)"
1389
+ ></sds-icon>
1390
+ ${this.errorMessage}
1391
+ </p>` : E}
1392
+ </fieldset>
1393
+ `;
1394
+ }
1395
+ };
1396
+ SDSCheckboxGroup.styles = [styles$f];
1397
+ __decorateClass$e([
1398
+ n2({ type: String, reflect: true })
1399
+ ], SDSCheckboxGroup.prototype, "legend", 2);
1400
+ __decorateClass$e([
1401
+ n2({ type: String, attribute: "help-text", reflect: true })
1402
+ ], SDSCheckboxGroup.prototype, "helpText", 2);
1403
+ __decorateClass$e([
1404
+ n2({ type: String, attribute: "error-message", reflect: true })
1405
+ ], SDSCheckboxGroup.prototype, "errorMessage", 2);
1406
+ __decorateClass$e([
1407
+ r2()
1408
+ ], SDSCheckboxGroup.prototype, "selectedValues", 2);
1409
+ SDSCheckboxGroup = __decorateClass$e([
1410
+ t$1("sds-checkbox-group")
1411
+ ], SDSCheckboxGroup);
1412
+ const styles$d = i$4`
1413
+ .sds-chip {
1414
+ align-items: center;
1415
+ display: inline-flex;
1416
+ gap: var(--sds-spacing-3);
1417
+ justify-content: center;
1418
+ padding: 6px var(--sds-spacing-4);
1419
+
1420
+ background-color: var(--sds-color-semantic-surface-action-inverted);
1421
+ border: 2px solid var(--sds-color-semantic-border-action);
1422
+ border-radius: 2rem;
1423
+
1424
+ font-family: var(--sds-typography-font-family);
1425
+ font-size: 1rem;
1426
+ font-weight: 400;
1427
+ line-height: 1.25;
1428
+ text-align: center;
1429
+
1430
+ user-select: none;
1431
+ cursor: pointer;
1432
+
1433
+ &:has(input[type='checkbox']:checked) {
1434
+ background-color: var(--sds-color-semantic-surface-action-default);
1435
+ border-color: var(--sds-color-semantic-surface-action-default);
1436
+ color: var(--sds-color-semantic-text-on-action);
1437
+ }
1438
+
1439
+ &:has(
1440
+ input[type='checkbox'][disabled],
1441
+ input[type='checkbox']:checked[disabled]
1442
+ ) {
1443
+ background-color: var(--sds-color-semantic-surface-disabled);
1444
+ border: 2px solid var(--sds-color-semantic-surface-disabled);
1445
+ color: var(--sds-color-semantic-text-disabled);
1446
+ cursor: not-allowed;
1447
+ }
1448
+
1449
+ &:hover {
1450
+ background-color: var(--sds-color-semantic-surface-action-hover);
1451
+ border-color: var(--sds-color-semantic-surface-action-hover);
1452
+ color: var(--sds-color-semantic-text-on-action);
1453
+ }
1454
+
1455
+ &:active {
1456
+ background-color: var(--sds-color-semantic-surface-action-active);
1457
+ border: 2px solid var(--sds-color-semantic-surface-action-active);
1458
+ }
1459
+
1460
+ &:focus-within,
1461
+ &:focus {
1462
+ outline: 2px solid var(--sds-color-semantic-border-focus);
1463
+ outline-offset: 2px;
1464
+ }
1465
+
1466
+ &.sds-chip--small {
1467
+ font-size: 0.875rem;
1468
+ line-height: 1.125rem;
1469
+ padding: var(--sds-spacing-1) var(--sds-spacing-3);
1470
+ gap: var(--sds-spacing-2);
1471
+ }
1472
+
1473
+ & input[type='checkbox'] {
1474
+ position: absolute;
1475
+ width: 1px;
1476
+ height: 1px;
1477
+ padding: 0;
1478
+ margin: -1px;
1479
+ overflow: hidden;
1480
+ clip-path: inset(50%);
1481
+ border: 0;
1482
+ white-space: nowrap;
1483
+ }
1484
+ }
1485
+ `;
1486
+ var __defProp$d = Object.defineProperty;
1487
+ var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
1488
+ var __decorateClass$d = (decorators, target, key, kind) => {
1489
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
1490
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1491
+ if (decorator = decorators[i2])
1492
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1493
+ if (kind && result) __defProp$d(target, key, result);
1494
+ return result;
1495
+ };
1496
+ let SDSChip = class extends r$2 {
1497
+ constructor() {
1498
+ super(...arguments);
1499
+ this.variant = "selectable";
1500
+ this.size = "large";
1501
+ this.checked = false;
1502
+ this.disabled = false;
1503
+ this._toggle = (event) => {
1504
+ event.preventDefault();
1505
+ event.stopImmediatePropagation();
1506
+ this.checked = !this.checked;
1507
+ this.dispatchEvent(
1508
+ new CustomEvent("change", {
1509
+ detail: { value: this.value, isChecked: this.checked },
1510
+ bubbles: true,
1511
+ composed: true
1512
+ })
1513
+ );
1514
+ };
1515
+ this._remove = () => {
1516
+ this.dispatchEvent(
1517
+ new CustomEvent("sds-remove", {
1518
+ bubbles: true,
1519
+ composed: true
1520
+ })
1521
+ );
1522
+ };
1523
+ }
1524
+ focus() {
1525
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.focus();
1526
+ }
1527
+ blur() {
1528
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.blur();
1529
+ }
1530
+ click() {
1531
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.click();
1532
+ }
1533
+ render() {
1534
+ const chipClasses = {
1535
+ "sds-chip": true,
1536
+ "sds-chip--small": this.size === "small"
1537
+ };
1538
+ if (this.variant === "removable") {
1539
+ return x`<button class="${e$1(chipClasses)}" @click=${this._remove}>
1540
+ <slot></slot>
1541
+ <sds-icon name="close-material-outlined" size="s"></sds-icon>
1542
+ </button>`;
1543
+ }
1544
+ return x`<label class="${e$1(chipClasses)}" @click="${this._toggle}">
1545
+ <input
1546
+ type="checkbox"
1547
+ name="${o$1(this.name)}"
1548
+ value="${o$1(this.value)}"
1549
+ ?checked="${this.checked}"
1550
+ ?disabled="${this.disabled}"
1551
+ />
1552
+ <slot></slot>
1553
+ </label>`;
1554
+ }
1555
+ };
1556
+ SDSChip.styles = [styles$d];
1557
+ __decorateClass$d([
1558
+ n2({ type: String, reflect: true })
1559
+ ], SDSChip.prototype, "variant", 2);
1560
+ __decorateClass$d([
1561
+ n2({ type: String, reflect: true })
1562
+ ], SDSChip.prototype, "size", 2);
1563
+ __decorateClass$d([
1564
+ n2({ type: Boolean, reflect: true })
1565
+ ], SDSChip.prototype, "checked", 2);
1566
+ __decorateClass$d([
1567
+ n2({ type: String, reflect: true })
1568
+ ], SDSChip.prototype, "name", 2);
1569
+ __decorateClass$d([
1570
+ n2({ type: String })
1571
+ ], SDSChip.prototype, "value", 2);
1572
+ __decorateClass$d([
1573
+ n2({ type: Boolean, reflect: true })
1574
+ ], SDSChip.prototype, "disabled", 2);
1575
+ SDSChip = __decorateClass$d([
1576
+ t$1("sds-chip")
1577
+ ], SDSChip);
1578
+ const styles$c = i$4`
1579
+ :host {
1580
+ display: block;
1581
+ }
1582
+
1583
+ .sds-detail {
1584
+ font-family: var(--sds-typography-font-family);
1585
+ font-size: 0.75rem;
1586
+ line-height: 1.333;
1587
+ color: var(--sds-color-semantic-text-default);
1588
+ margin: 0;
1589
+ max-width: var(--sds-typography-max-line-width);
1590
+ padding: 0;
1591
+ }
1592
+
1593
+ .sds-detail--text {
1594
+ font-weight: 400;
1595
+ }
1596
+
1597
+ .sds-detail--label {
1598
+ font-weight: 500;
1599
+ }
1600
+ `;
1601
+ var __defProp$c = Object.defineProperty;
1602
+ var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
1603
+ var __decorateClass$c = (decorators, target, key, kind) => {
1604
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
1605
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1606
+ if (decorator = decorators[i2])
1607
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1608
+ if (kind && result) __defProp$c(target, key, result);
1609
+ return result;
1610
+ };
1611
+ let SDSDetail = class extends r$2 {
1612
+ constructor() {
1613
+ super(...arguments);
1614
+ this.variation = "text";
1615
+ }
1616
+ render() {
1617
+ const styleClasses = {
1618
+ "sds-detail": true,
1619
+ "sds-detail--text": this.variation === "text",
1620
+ "sds-detail--label": this.variation === "label"
1621
+ };
1622
+ const classes = e$1(styleClasses);
1623
+ return x`<p class=${classes}><slot></slot></p>`;
1624
+ }
1625
+ };
1626
+ SDSDetail.styles = [styles$c];
1627
+ __decorateClass$c([
1628
+ n2({ type: String })
1629
+ ], SDSDetail.prototype, "variation", 2);
1630
+ SDSDetail = __decorateClass$c([
1631
+ t$1("sds-detail")
1632
+ ], SDSDetail);
1633
+ const styles$b = i$4`
1634
+ :host {
1635
+ --_heading-text-align: left;
1636
+ display: inline-block;
1637
+ }
1638
+
1639
+ h1,
1640
+ h2,
1641
+ h3,
1642
+ h4,
1643
+ h5,
1644
+ h6,
1645
+ .sds-heading {
1646
+ font-family: var(--sds-typography-font-family);
1647
+ color: var(--sds-color-semantic-text-default);
1648
+ display: inline-block;
1649
+ margin: 0;
1650
+ max-width: var(--sds-typography-max-line-width);
1651
+ padding: 0;
1652
+ text-align: var(--_heading-text-align);
1653
+ }
1654
+
1655
+ h1,
1656
+ .sds-heading--xl {
1657
+ font-size: 2rem;
1658
+ font-weight: 700;
1659
+ line-height: 1.24;
1660
+ }
1661
+
1662
+ @media (min-width: 640px) {
1663
+ h1,
1664
+ .sds-heading--xl {
1665
+ font-size: 2.5rem;
1666
+ font-weight: 700;
1667
+ line-height: 1.4;
1668
+ }
1669
+ }
1670
+
1671
+ h2,
1672
+ .sds-heading--l {
1673
+ font-size: 1.5rem;
1674
+ font-weight: 500;
1675
+ line-height: 1.333;
1676
+ }
1677
+
1678
+ @media (min-width: 640px) {
1679
+ h2,
1680
+ .sds-heading--l {
1681
+ font-size: 2rem;
1682
+ font-weight: 700;
1683
+ line-height: 1.24;
1684
+ }
1685
+ }
1686
+
1687
+ h3,
1688
+ .sds-heading--m {
1689
+ font-size: 1.25rem;
1690
+ font-weight: 500;
1691
+ line-height: 1.4;
1692
+ }
1693
+
1694
+ @media (min-width: 640px) {
1695
+ h3,
1696
+ .sds-heading--m {
1697
+ font-size: 1.5rem;
1698
+ font-weight: 500;
1699
+ line-height: 1.333;
1700
+ }
1701
+ }
1702
+
1703
+ h4,
1704
+ .sds-heading--s {
1705
+ font-size: 1.125rem;
1706
+ font-weight: 500;
1707
+ line-height: 1.333;
1708
+ }
1709
+
1710
+ @media (min-width: 640px) {
1711
+ h4,
1712
+ .sds-heading--s {
1713
+ font-size: 1.25rem;
1714
+ font-weight: 500;
1715
+ line-height: 1.4;
1716
+ }
1717
+ }
1718
+
1719
+ h5,
1720
+ h6,
1721
+ .sds-heading--xs {
1722
+ font-size: 1.063rem;
1723
+ line-height: 1.3529;
1724
+ }
1725
+
1726
+ @media (min-width: 640px) {
1727
+ h5,
1728
+ h6,
1729
+ .sds-heading--xs {
1730
+ font-size: 1.125rem;
1731
+ font-weight: 500;
1732
+ line-height: 1.333;
1733
+ }
1734
+ }
1735
+ `;
1736
+ var __defProp$b = Object.defineProperty;
1737
+ var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
1738
+ var __decorateClass$b = (decorators, target, key, kind) => {
1739
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
1740
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1741
+ if (decorator = decorators[i2])
1742
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1743
+ if (kind && result) __defProp$b(target, key, result);
1744
+ return result;
1745
+ };
1746
+ let SDSHeading = class extends r$2 {
1747
+ constructor() {
1748
+ super(...arguments);
1749
+ this.level = "h1";
1750
+ }
1751
+ render() {
1752
+ const headingClasses = {
1753
+ "sds-heading": true,
1754
+ "sds-heading--xl": this.as === "xl",
1755
+ "sds-heading--l": this.as === "l",
1756
+ "sds-heading--m": this.as === "m",
1757
+ "sds-heading--s": this.as === "s",
1758
+ "sds-heading--xs": this.as === "xs"
1759
+ };
1760
+ const classes = e$1(headingClasses);
1761
+ switch (this.level.toLowerCase()) {
1762
+ case "h1":
1763
+ return x`<h1 class=${classes}><slot></slot></h1>`;
1764
+ case "h2":
1765
+ return x`<h2 class=${classes}><slot></slot></h2>`;
1766
+ case "h3":
1767
+ return x`<h3 class=${classes}><slot></slot></h3>`;
1768
+ case "h4":
1769
+ return x`<h4 class=${classes}><slot></slot></h4>`;
1770
+ case "h5":
1771
+ return x`<h5 class=${classes}><slot></slot></h5>`;
1772
+ case "h6":
1773
+ return x`<h6 class=${classes}><slot></slot></h6>`;
1774
+ default:
1775
+ return x`<h1 class=${classes}><slot></slot></h1>`;
1776
+ }
1777
+ }
1778
+ };
1779
+ SDSHeading.styles = [styles$b];
1780
+ __decorateClass$b([
1781
+ n2({ type: String })
1782
+ ], SDSHeading.prototype, "level", 2);
1783
+ __decorateClass$b([
1784
+ n2({ type: String })
1785
+ ], SDSHeading.prototype, "as", 2);
1786
+ SDSHeading = __decorateClass$b([
1787
+ t$1("sds-heading")
1788
+ ], SDSHeading);
1789
+ const styles$a = i$4`
1790
+ :host {
1791
+ display: block;
1792
+ }
1793
+
1794
+ .sds-label {
1795
+ font-family: var(--sds-typography-font-family);
1796
+ font-weight: 500;
1797
+ color: var(--sds-color-semantic-text-default);
1798
+ margin: 0;
1799
+ max-width: var(--sds-typography-max-line-width);
1800
+ padding: 0;
1801
+ }
1802
+
1803
+ .sds-label--l {
1804
+ font-size: 1.125rem;
1805
+ line-height: 1.333;
1806
+ }
1807
+
1808
+ .sds-label--m {
1809
+ font-size: 1rem;
1810
+ line-height: 1.5;
1811
+ }
1812
+
1813
+ .sds-label--s {
1814
+ font-size: 0.875rem;
1815
+ line-height: 1.428;
1816
+ }
1817
+ `;
1818
+ var __defProp$a = Object.defineProperty;
1819
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
1820
+ var __decorateClass$a = (decorators, target, key, kind) => {
1821
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
1822
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1823
+ if (decorator = decorators[i2])
1824
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1825
+ if (kind && result) __defProp$a(target, key, result);
1826
+ return result;
1827
+ };
1828
+ let SDSLabel = class extends r$2 {
1829
+ constructor() {
1830
+ super(...arguments);
1831
+ this.size = "l";
1832
+ }
1833
+ render() {
1834
+ const styleClasses = {
1835
+ "sds-label": true,
1836
+ "sds-label--l": this.size === "l",
1837
+ "sds-label--m": this.size === "m",
1838
+ "sds-label--s": this.size === "s"
1839
+ };
1840
+ const classes = e$1(styleClasses);
1841
+ return x`<label for="${o$1(this.for)}" class=${classes}><slot></slot></label>`;
1842
+ }
1843
+ };
1844
+ SDSLabel.styles = [styles$a];
1845
+ __decorateClass$a([
1846
+ n2({ type: String })
1847
+ ], SDSLabel.prototype, "size", 2);
1848
+ __decorateClass$a([
1849
+ n2({ type: String })
1850
+ ], SDSLabel.prototype, "for", 2);
1851
+ SDSLabel = __decorateClass$a([
1852
+ t$1("sds-label")
1853
+ ], SDSLabel);
1854
+ const styles$9 = i$4`
1855
+ :host {
1856
+ display: inline;
1857
+ }
1858
+
1859
+ :host([display-type='block']) {
1860
+ display: block;
1861
+ max-width: var(--sds-typography-max-line-width);
1862
+
1863
+ .sds-link {
1864
+ display: block;
1865
+ max-width: var(--sds-typography-max-line-width);
1866
+ }
1867
+ }
1868
+
1869
+ :host([display-type='inline-block']) {
1870
+ display: inline-block;
1871
+
1872
+ .sds-link {
1873
+ display: inline-block;
1874
+ max-width: var(--sds-typography-max-line-width);
1875
+ }
1876
+ }
1877
+
1878
+ :host([display-type='inline']) {
1879
+ display: inline;
1880
+ }
1881
+
1882
+ .sds-link {
1883
+ color: var(--sds-color-semantic-text-default);
1884
+ display: inline;
1885
+ font-family: var(--sds-typography-font-family);
1886
+ font-weight: 400;
1887
+ line-height: 1.333;
1888
+ margin: 0;
1889
+ padding: 0;
1890
+
1891
+ &:link,
1892
+ &:visited {
1893
+ color: var(--sds-color-semantic-text-action-default);
1894
+ text-decoration: underline;
1895
+ text-decoration-thickness: 1px;
1896
+ text-underline-offset: 2px;
1897
+ }
1898
+
1899
+ &:active {
1900
+ color: var(--sds-color-semantic-text-action-active);
1901
+ }
1902
+
1903
+ &:hover {
1904
+ color: var(--sds-color-semantic-text-action-hover);
1905
+ }
1906
+
1907
+ &:focus {
1908
+ border-radius: 4px;
1909
+ outline: 2px solid var(--sds-color-semantic-border-focus);
1910
+ outline-offset: 2px;
1911
+ }
1912
+ }
1913
+
1914
+ .sds-link--l {
1915
+ font-size: 1.125rem;
1916
+ }
1917
+
1918
+ .sds-link--m {
1919
+ font-size: 1rem;
1920
+ }
1921
+
1922
+ .sds-link--s {
1923
+ font-size: 0.875rem;
1924
+ }
1925
+ `;
1926
+ var __defProp$9 = Object.defineProperty;
1927
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
1928
+ var __decorateClass$9 = (decorators, target, key, kind) => {
1929
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
1930
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1931
+ if (decorator = decorators[i2])
1932
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1933
+ if (kind && result) __defProp$9(target, key, result);
1934
+ return result;
1935
+ };
1936
+ let SDSLink = class extends r$2 {
1937
+ constructor() {
1938
+ super(...arguments);
1939
+ this.size = "m";
1940
+ }
1941
+ render() {
1942
+ const styleClasses = {
1943
+ "sds-link": true,
1944
+ "sds-link--l": this.size === "l",
1945
+ "sds-link--m": this.size === "m",
1946
+ "sds-link--s": this.size === "s"
1947
+ };
1948
+ const classes = e$1(styleClasses);
1949
+ return x`<a href="${o$1(this.href)}" target="${o$1(this.target)}" class=${classes}
1950
+ ><slot></slot
1951
+ ></a>`;
1952
+ }
1953
+ };
1954
+ SDSLink.styles = [styles$9];
1955
+ __decorateClass$9([
1956
+ n2({ type: String })
1957
+ ], SDSLink.prototype, "href", 2);
1958
+ __decorateClass$9([
1959
+ n2({ type: String })
1960
+ ], SDSLink.prototype, "size", 2);
1961
+ __decorateClass$9([
1962
+ n2({ type: String })
1963
+ ], SDSLink.prototype, "target", 2);
1964
+ SDSLink = __decorateClass$9([
1965
+ t$1("sds-link")
1966
+ ], SDSLink);
1967
+ const styles$8 = i$4`
1968
+ :host {
1969
+ line-height: 0;
1970
+ }
1971
+
1972
+ .sds-loader {
1973
+ width: 24px;
1974
+ height: 24px;
1975
+ border: 3px solid currentColor;
1976
+ border-bottom-color: transparent;
1977
+ border-radius: 50%;
1978
+ display: inline-block;
1979
+ box-sizing: border-box;
1980
+ animation: rotation 1s linear infinite;
1981
+
1982
+ &.sds-loader--medium {
1983
+ width: 18px;
1984
+ height: 18px;
1985
+ border-width: 2px;
1986
+ }
1987
+
1988
+ &.sds-loader--small {
1989
+ width: 14px;
1990
+ height: 14px;
1991
+ border-width: 2px;
1992
+ }
1993
+ }
1994
+
1995
+ @keyframes rotation {
1996
+ 0% {
1997
+ transform: rotate(0deg);
1998
+ }
1999
+ 100% {
2000
+ transform: rotate(360deg);
2001
+ }
2002
+ }
2003
+ `;
2004
+ var __defProp$8 = Object.defineProperty;
2005
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
2006
+ var __decorateClass$8 = (decorators, target, key, kind) => {
2007
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
2008
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
2009
+ if (decorator = decorators[i2])
2010
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2011
+ if (kind && result) __defProp$8(target, key, result);
2012
+ return result;
2013
+ };
2014
+ let SDSLoader = class extends r$2 {
2015
+ constructor() {
2016
+ super(...arguments);
2017
+ this.size = "large";
2018
+ this.color = "currentColor";
2019
+ }
2020
+ render() {
2021
+ const loaderClasses = {
2022
+ "sds-loader": true,
2023
+ "sds-loader--medium": this.size === "medium",
2024
+ "sds-loader--small": this.size === "small"
2025
+ };
2026
+ return x`<span class="${e$1(loaderClasses)}" style="${`color:${this.color}`}"></span>`;
2027
+ }
2028
+ };
2029
+ SDSLoader.styles = [styles$8];
2030
+ __decorateClass$8([
2031
+ n2({ type: String, reflect: true })
2032
+ ], SDSLoader.prototype, "size", 2);
2033
+ __decorateClass$8([
2034
+ n2({ type: String, reflect: true })
2035
+ ], SDSLoader.prototype, "color", 2);
2036
+ SDSLoader = __decorateClass$8([
2037
+ t$1("sds-loader")
2038
+ ], SDSLoader);
2039
+ const styles$7 = i$4`
2040
+ .sds-nav-card {
2041
+ color: var(--sds-color-semantic-text-default);
2042
+ background-color: var(
2043
+ --sds-color-global-lightblue-100
2044
+ ); // TODO: Global variable used, should be replaced by a more spesific one
2045
+
2046
+ font-size: var(--sds-typography-base-font-size);
2047
+ line-height: var(--sds-typography-base-line-height);
2048
+ font-weight: var(--sds-typography-base-font-weight);
2049
+ font-family: var(--sds-typography-font-family);
2050
+
2051
+ display: flex;
2052
+ min-height: 10.25rem;
2053
+ height: 100%;
2054
+ width: 100%;
2055
+ max-width: 50rem;
2056
+
2057
+ box-sizing: border-box;
2058
+ padding: var(--sds-spacing-7) var(--sds-spacing-9) var(--sds-spacing-8);
2059
+ gap: var(--sds-spacing-5);
2060
+ text-align: left;
2061
+
2062
+ border-radius: var(--sds-radius-card);
2063
+ border: 1px solid transparent;
2064
+
2065
+ cursor: pointer;
2066
+
2067
+ & p {
2068
+ padding: 0;
2069
+ margin: 0;
2070
+ hyphens: auto;
2071
+ }
2072
+
2073
+ &:link {
2074
+ text-decoration: none;
2075
+ }
2076
+
2077
+ &:hover {
2078
+ background-color: var(
2079
+ --sds-color-global-lightblue-300
2080
+ ); // TODO: Global variable used, should be replaced by a more spesific one
2081
+
2082
+ .sds-nav-card__heading {
2083
+ text-decoration: none;
2084
+ }
2085
+ }
2086
+
2087
+ &:active,
2088
+ &:focus:active {
2089
+ background-color: var(--sds-color-semantic-surface-action-selected);
2090
+ color: var(--sds-color-semantic-text-on-action);
2091
+
2092
+ .sds-nav-card__heading {
2093
+ text-decoration: underline;
2094
+ text-decoration-thickness: 0.075rem;
2095
+ }
2096
+
2097
+ ::slotted(*) {
2098
+ stroke: var(--sds-color-semantic-icon-on-action);
2099
+ }
2100
+ }
2101
+
2102
+ &:focus {
2103
+ border: 1px solid var(--sds-color-semantic-border-focus);
2104
+ background: var(
2105
+ --sds-color-global-lightblue-100
2106
+ ); // TODO: Global variable used, should be replaced by a more spesific one
2107
+ }
2108
+
2109
+ &:disabled {
2110
+ background-color: var(--sds-color-semantic-surface-disabled);
2111
+ pointer-events: none;
2112
+ }
2113
+ }
2114
+
2115
+ .sds-nav-card--hasIcon {
2116
+ padding: var(--sds-spacing-7) var(--sds-spacing-7) var(--sds-spacing-8);
2117
+ }
2118
+
2119
+ .sds-nav-card__content {
2120
+ display: flex;
2121
+ flex-direction: column;
2122
+ width: 100%;
2123
+ gap: var(--sds-spacing-3);
2124
+ }
2125
+
2126
+ .sds-nav-card__text {
2127
+ display: -webkit-box;
2128
+ -webkit-line-clamp: 3;
2129
+ -webkit-box-orient: vertical;
2130
+ overflow: hidden;
2131
+ }
2132
+
2133
+ ::slotted(*) {
2134
+ height: 4.5rem;
2135
+ min-width: 4.5rem;
2136
+ width: 4.5rem;
2137
+ align-self: center;
2138
+ stroke: var(
2139
+ --sds-color-global-black
2140
+ ); // TODO: Global variable used, should be replaced by a more spesific one
2141
+ }
2142
+
2143
+ .sds-nav-card__heading {
2144
+ font-weight: 700;
2145
+ font-size: 1.5rem;
2146
+ margin: 0;
2147
+ text-decoration: underline;
2148
+ text-decoration-thickness: 0.075rem;
2149
+ text-underline-offset: 0.146rem;
2150
+ }
2151
+
2152
+ .sds-nav-card--medium {
2153
+ min-height: 7rem;
2154
+
2155
+ .sds-nav-card__text {
2156
+ display: -webkit-box;
2157
+ display: flex;
2158
+
2159
+ -webkit-line-clamp: 1;
2160
+ -webkit-box-orient: vertical;
2161
+
2162
+ overflow: hidden;
2163
+ text-overflow: ellipsis;
2164
+ }
2165
+
2166
+ ::slotted(*) {
2167
+ height: 3rem;
2168
+ min-width: 3rem;
2169
+ width: 3rem;
2170
+ }
2171
+ }
2172
+
2173
+ .sds-nav-card--small {
2174
+ min-height: 4.5rem;
2175
+ padding: var(--sds-spacing-5) var(--sds-spacing-8) var(--sds-spacing-6);
2176
+
2177
+ .sds-nav-card--hasIcon {
2178
+ padding: var(--sds-spacing-5) var(--sds-spacing-7)
2179
+ var(--sds-spacing-6);
2180
+ }
2181
+
2182
+ .sds-nav-card__content {
2183
+ gap: 0;
2184
+ align-self: center;
2185
+ }
2186
+
2187
+ ::slotted(*) {
2188
+ height: 2.5rem;
2189
+ min-width: 2.5rem;
2190
+ width: 2.5rem;
2191
+ }
2192
+ }
2193
+ `;
2194
+ var __defProp$7 = Object.defineProperty;
2195
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
2196
+ var __decorateClass$7 = (decorators, target, key, kind) => {
2197
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
2198
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
2199
+ if (decorator = decorators[i2])
2200
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2201
+ if (kind && result) __defProp$7(target, key, result);
2202
+ return result;
2203
+ };
2204
+ let SDSNavCard = class extends r$2 {
2205
+ constructor() {
2206
+ super(...arguments);
2207
+ this.size = "large";
2208
+ this.level = "h2";
2209
+ this.hasIcon = false;
2210
+ }
2211
+ firstUpdated() {
2212
+ this._checkSlotContent();
2213
+ }
2214
+ _handleSlotChange() {
2215
+ this._checkSlotContent();
2216
+ }
2217
+ _filterToMeaningfulNodes(nodes) {
2218
+ return nodes.filter((node) => {
2219
+ if (node.nodeType === Node.TEXT_NODE) {
2220
+ const textContent = node.textContent;
2221
+ return textContent !== null && textContent.trim().length > 0;
2222
+ }
2223
+ return true;
2224
+ });
2225
+ }
2226
+ _checkSlotContent() {
2227
+ const assignedNodes = this.iconSlot.assignedNodes({ flatten: true });
2228
+ const meaningfulNodes = this._filterToMeaningfulNodes(assignedNodes);
2229
+ this.hasIcon = meaningfulNodes.length !== 0;
2230
+ }
2231
+ _renderHeading() {
2232
+ const headingClass = "sds-nav-card__heading";
2233
+ switch (this.level) {
2234
+ case "h2":
2235
+ return x`<h2 class="${headingClass}">${this.heading}</h2>`;
2236
+ case "h3":
2237
+ return x`<h3 class="${headingClass}">${this.heading}</h3>`;
2238
+ case "h4":
2239
+ return x`<h4 class="${headingClass}">${this.heading}</h4>`;
2240
+ case "h5":
2241
+ return x`<h5 class="${headingClass}">${this.heading}</h5>`;
2242
+ case "h6":
2243
+ return x`<h6 class="${headingClass}">${this.heading}</h6>`;
2244
+ default:
2245
+ return x`<h2 class="${headingClass}">${this.heading}</h2>`;
2246
+ }
2247
+ }
2248
+ render() {
2249
+ const navCardClasses = {
2250
+ "sds-nav-card": true,
2251
+ "sds-nav-card--hasIcon": this.hasIcon,
2252
+ "sds-nav-card--small": this.size === "small",
2253
+ "sds-nav-card--medium": this.size === "medium",
2254
+ "sds-nav-card--large": this.size === "large"
2255
+ };
2256
+ return x`
2257
+ <a class="${e$1(navCardClasses)}" href="${this.link}">
2258
+ <slot name="before" @slotchange=${this._handleSlotChange}></slot>
2259
+ <div class="sds-nav-card__content">
2260
+ ${this._renderHeading()}
2261
+ <slot></slot>
2262
+ </div>
2263
+ </a>
2264
+ `;
2265
+ }
2266
+ };
2267
+ SDSNavCard.styles = [styles$7];
2268
+ __decorateClass$7([
2269
+ n2({ type: String, reflect: true })
2270
+ ], SDSNavCard.prototype, "size", 2);
2271
+ __decorateClass$7([
2272
+ n2({ type: String, reflect: true })
2273
+ ], SDSNavCard.prototype, "heading", 2);
2274
+ __decorateClass$7([
2275
+ n2({ type: String, reflect: true })
2276
+ ], SDSNavCard.prototype, "level", 2);
2277
+ __decorateClass$7([
2278
+ n2({ type: String, reflect: true })
2279
+ ], SDSNavCard.prototype, "link", 2);
2280
+ __decorateClass$7([
2281
+ r2()
2282
+ ], SDSNavCard.prototype, "hasIcon", 2);
2283
+ __decorateClass$7([
2284
+ e$3("slot")
2285
+ ], SDSNavCard.prototype, "iconSlot", 2);
2286
+ SDSNavCard = __decorateClass$7([
2287
+ t$1("sds-nav-card")
2288
+ ], SDSNavCard);
2289
+ const styles$6 = i$4`
2290
+ :host {
2291
+ display: block;
2292
+ box-sizing: border-box;
2293
+ }
2294
+
2295
+ .sds-notification {
2296
+ font-family: var(--sds-typography-font-family);
2297
+ font-size: 1rem;
2298
+ font-weight: 400;
2299
+ line-height: 1.25;
2300
+
2301
+ display: flex;
2302
+ gap: 0.5rem;
2303
+
2304
+ background-color: var(--sds-color-semantic-surface-info-subtle);
2305
+ border: 1px solid var(--sds-color-semantic-surface-info-xtreme);
2306
+ color: var(--sds-color-semantic-text-default);
2307
+
2308
+ text-align: left;
2309
+ }
2310
+
2311
+ .sds-notification--success {
2312
+ background-color: var(--sds-color-semantic-surface-ok-subtle);
2313
+ border-color: var(--sds-color-semantic-surface-ok-xtreme);
2314
+
2315
+ .sds-notification__type {
2316
+ background-color: var(--sds-color-semantic-surface-ok-xtreme);
2317
+ }
2318
+ }
2319
+
2320
+ .sds-notification--attention {
2321
+ background-color: var(--sds-color-semantic-surface-attention-subtle);
2322
+ border-color: var(--sds-color-semantic-surface-attention-xtreme);
2323
+
2324
+ .sds-notification__type {
2325
+ background-color: var(--sds-color-semantic-surface-attention-xtreme);
2326
+ }
2327
+ }
2328
+
2329
+ .sds-notification--warning {
2330
+ background-color: var(--sds-color-semantic-surface-warning-subtle);
2331
+ border-color: var(--sds-color-semantic-surface-warning-xtreme);
2332
+
2333
+ .sds-notification__type {
2334
+ background-color: var(--sds-color-semantic-surface-warning-xtreme);
2335
+ }
2336
+
2337
+ .sds-notification__icon::before {
2338
+ width: 4px;
2339
+ height: 14px;
2340
+ }
2341
+ }
2342
+
2343
+ .sds-notification--critical {
2344
+ background-color: var(--sds-color-semantic-surface-critical-subtle);
2345
+ border-color: var(--sds-color-semantic-surface-critical-xtreme);
2346
+
2347
+ .sds-notification__type {
2348
+ background-color: var(--sds-color-semantic-surface-critical-xtreme);
2349
+ }
2350
+
2351
+ .sds-notification__icon::before {
2352
+ width: 10px;
2353
+ height: 10px;
2354
+ }
2355
+ }
2356
+
2357
+ .sds-notification__type {
2358
+ background-color: var(--sds-color-semantic-surface-info-xtreme);
2359
+ color: white;
2360
+ padding: 1rem 0.5rem;
2361
+ }
2362
+
2363
+ .sds-notification__content {
2364
+ display: flex;
2365
+ flex: 1;
2366
+ gap: 1rem;
2367
+ padding: 1rem 0.5rem;
2368
+ }
2369
+
2370
+ .sds-notification__content-text {
2371
+ flex: 1;
2372
+ }
2373
+
2374
+ ::slotted([slot='title']),
2375
+ ::slotted(:is(h1, h2, h3, h4, h5, h6)) {
2376
+ color: var(--sds-color-semantic-text-default) !important;
2377
+ font-size: 1rem !important;
2378
+ font-style: normal !important;
2379
+ font-weight: 700 !important;
2380
+ line-height: 1.5 !important;
2381
+ margin: 0 !important;
2382
+ max-width: var(--sds-typography-max-line-width) !important;
2383
+ }
2384
+
2385
+ ::slotted([slot='message']),
2386
+ ::slotted(:is(p)) {
2387
+ color: var(--sds-color-semantic-text-default) !important;
2388
+ font-size: 1rem !important;
2389
+ font-style: normal !important;
2390
+ font-weight: 400 !important;
2391
+ line-height: 1.5 !important;
2392
+ margin: 0 !important;
2393
+ max-width: var(--sds-typography-max-line-width) !important;
2394
+ }
2395
+
2396
+ .sds-notification__icon {
2397
+ display: block;
2398
+ position: relative;
2399
+ z-index: 1;
2400
+
2401
+ &::before {
2402
+ content: '';
2403
+ display: block;
2404
+ width: 14px;
2405
+ height: 14px;
2406
+ background-color: black;
2407
+ position: absolute;
2408
+ top: 50%;
2409
+ left: 50%;
2410
+ transform: translate(-50%, -50%);
2411
+ z-index: -1;
2412
+ }
2413
+ }
2414
+
2415
+ .sds-notification__remove-btn {
2416
+ border: 0;
2417
+ border-radius: var(--sds-radius-4);
2418
+ background: transparent;
2419
+ cursor: pointer;
2420
+ flex: 0 1 auto;
2421
+ padding: 0;
2422
+ width: 24px;
2423
+ height: 24px;
2424
+
2425
+ display: flex;
2426
+ align-items: center;
2427
+ justify-content: center;
2428
+
2429
+ &:focus {
2430
+ outline: 2px solid var(--sds-color-semantic-surface-action-default);
2431
+ outline-offset: 1px;
2432
+ }
2433
+
2434
+ &:hover {
2435
+ background-color: var(--sds-color-semantic-surface-action-subtle);
2436
+ border: 2px solid var(--sds-color-semantic-surface-action-hover);
2437
+ }
2438
+
2439
+ &:active {
2440
+ background-color: var(--sds-color-semantic-surface-action-active);
2441
+ border: 2px solid var(--sds-color-semantic-surface-action-active);
2442
+ color: var(--sds-color-semantic-text-on-action);
2443
+ outline: 0;
2444
+ }
2445
+ }
2446
+ `;
2447
+ var __defProp$6 = Object.defineProperty;
2448
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
2449
+ var __decorateClass$6 = (decorators, target, key, kind) => {
2450
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
2451
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
2452
+ if (decorator = decorators[i2])
2453
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2454
+ if (kind && result) __defProp$6(target, key, result);
2455
+ return result;
2456
+ };
2457
+ const notificationIcons = {
2458
+ info: "info-material-filled",
2459
+ success: "check_circle-material-filled",
2460
+ attention: "error-material-filled",
2461
+ warning: "warning-material-filled",
2462
+ critical: "dangerous-material-filled"
2463
+ };
2464
+ let SDSNotification = class extends r$2 {
2465
+ constructor() {
2466
+ super(...arguments);
2467
+ this.variant = "info";
2468
+ this._remove = () => {
2469
+ this.dispatchEvent(
2470
+ new CustomEvent("sds-remove", {
2471
+ bubbles: true,
2472
+ composed: true
2473
+ })
2474
+ );
2475
+ };
2476
+ }
2477
+ render() {
2478
+ const notificationClasses = {
2479
+ "sds-notification": true,
2480
+ [`sds-notification--${this.variant}`]: true
2481
+ };
2482
+ return x`<div class="${e$1(notificationClasses)}">
2483
+ <div class="sds-notification__type">
2484
+ <sds-icon class="sds-notification__icon" name="${notificationIcons[this.variant]}" size="m"></sds-icon>
2485
+ </div>
2486
+ <div class="sds-notification__content">
2487
+ <div class="sds-notification__content-text">
2488
+ <slot name="title"></slot>
2489
+ <slot name="message"></slot>
2490
+ </div>
2491
+ ${this.removableLabel ? x`<button
2492
+ class="sds-notification__remove-btn"
2493
+ @click=${this._remove}
2494
+ aria-label="${this.removableLabel}"
2495
+ >
2496
+ <sds-icon name="close-material-outlined" size="s"></sds-icon>
2497
+ </button>` : E}
2498
+ </div>
2499
+ </div>`;
2500
+ }
2501
+ };
2502
+ SDSNotification.styles = [styles$6];
2503
+ __decorateClass$6([
2504
+ n2({ type: String, reflect: true })
2505
+ ], SDSNotification.prototype, "variant", 2);
2506
+ __decorateClass$6([
2507
+ n2({ type: String, attribute: "removable-label", reflect: true })
2508
+ ], SDSNotification.prototype, "removableLabel", 2);
2509
+ SDSNotification = __decorateClass$6([
2510
+ t$1("sds-notification")
2511
+ ], SDSNotification);
2512
+ const styles$5 = i$4`
2513
+ :host {
2514
+ display: block;
2515
+ }
2516
+
2517
+ .sds-paragraph {
2518
+ font-family: var(--sds-typography-font-family);
2519
+ font-weight: 400;
2520
+ color: var(--sds-color-semantic-text-default);
2521
+ margin: 0;
2522
+ max-width: var(--sds-typography-max-line-width);
2523
+ padding: 0;
2524
+ }
2525
+
2526
+ .sds-paragraph--xl {
2527
+ font-size: 1.25rem;
2528
+ line-height: 1.4;
2529
+ }
2530
+
2531
+ .sds-paragraph--l {
2532
+ font-size: 1.125rem;
2533
+ line-height: 1.333;
2534
+ }
2535
+
2536
+ .sds-paragraph--m {
2537
+ font-size: 1rem;
2538
+ line-height: 1.5;
2539
+ }
2540
+
2541
+ @media (max-width: 640px) {
2542
+ .sds-paragraph--m {
2543
+ line-height: 1.375;
2544
+ }
2545
+ }
2546
+ `;
2547
+ var __defProp$5 = Object.defineProperty;
2548
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
2549
+ var __decorateClass$5 = (decorators, target, key, kind) => {
2550
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
2551
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
2552
+ if (decorator = decorators[i2])
2553
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2554
+ if (kind && result) __defProp$5(target, key, result);
2555
+ return result;
2556
+ };
2557
+ let SDSParagraph = class extends r$2 {
2558
+ constructor() {
2559
+ super(...arguments);
2560
+ this.size = "xl";
2561
+ }
2562
+ render() {
2563
+ const styleClasses = {
2564
+ "sds-paragraph": true,
2565
+ "sds-paragraph--xl": this.size === "xl",
2566
+ "sds-paragraph--l": this.size === "l",
2567
+ "sds-paragraph--m": this.size === "m"
2568
+ };
2569
+ const classes = e$1(styleClasses);
2570
+ return x`<p class=${classes}><slot></slot></p>`;
2571
+ }
2572
+ };
2573
+ SDSParagraph.styles = [styles$5];
2574
+ __decorateClass$5([
2575
+ n2({ type: String })
2576
+ ], SDSParagraph.prototype, "size", 2);
2577
+ SDSParagraph = __decorateClass$5([
2578
+ t$1("sds-paragraph")
2579
+ ], SDSParagraph);
2580
+ const styles$4 = i$4`
2581
+ :host {
2582
+ flex: 0 0 auto;
2583
+ }
2584
+
2585
+ .sds-radio__label {
2586
+ align-items: flex-start;
2587
+ cursor: pointer;
2588
+ color: var(--sds-color-semantic-text-default);
2589
+ display: inline-flex;
2590
+ font-family: var(--sds-typography-font-family);
2591
+ font-size: 1rem;
2592
+ font-weight: 400;
2593
+ gap: var(--sds-spacing-3);
2594
+ line-height: 1.25;
2595
+
2596
+ &:has(:disabled) {
2597
+ cursor: default;
2598
+ pointer-events: none;
2599
+ }
2600
+ }
2601
+
2602
+ .sds-radio__input {
2603
+ appearance: none;
2604
+ background-color: transparent;
2605
+ color: currentColor;
2606
+ cursor: pointer;
2607
+ width: 24px;
2608
+ height: 24px;
2609
+ border: 2px solid var(--sds-color-semantic-border-default);
2610
+ border-radius: 50%;
2611
+ margin: 0;
2612
+ position: relative;
2613
+
2614
+ &:checked {
2615
+ background-color: white;
2616
+ border-color: var(--sds-color-semantic-surface-action-selected);
2617
+ border-width: 3px;
2618
+
2619
+ &::after {
2620
+ content: '';
2621
+ position: absolute;
2622
+ top: 50%;
2623
+ left: 50%;
2624
+ width: 12px;
2625
+ height: 12px;
2626
+ background-color: var(--sds-color-semantic-icon-action-default);
2627
+ border-radius: 50%;
2628
+ transform: translate(-50%, -50%);
2629
+ }
2630
+ }
2631
+
2632
+ &:hover {
2633
+ border-width: 3px;
2634
+
2635
+ &:checked {
2636
+ &::after {
2637
+ width: 12px;
2638
+ height: 12px;
2639
+ transform: translate(-50%, -50%);
2640
+ }
2641
+ }
2642
+ }
2643
+
2644
+ &:focus {
2645
+ outline: 2px solid var(--sds-color-semantic-border-focus);
2646
+ outline-offset: 1px;
2647
+ }
2648
+
2649
+ &.sds-radio__input--error {
2650
+ border: 2px solid var(--sds-color-semantic-surface-critical-xtreme);
2651
+
2652
+ &:checked {
2653
+ &::after {
2654
+ width: 12px;
2655
+ height: 12px;
2656
+ transform: translate(-50%, -50%);
2657
+ }
2658
+ }
2659
+ }
2660
+
2661
+ &:disabled {
2662
+ border: 2px solid var(--sds-color-semantic-border-disabled);
2663
+
2664
+ &:checked {
2665
+ border-width: 3px;
2666
+ background-color: white;
2667
+
2668
+ &::after {
2669
+ background-color: var(--sds-color-semantic-border-disabled);
2670
+ width: 12px;
2671
+ height: 12px;
2672
+ }
2673
+ }
2674
+
2675
+ & + .sds-radio__text {
2676
+ color: var(--sds-color-semantic-border-disabled);
2677
+ }
2678
+ }
2679
+ }
2680
+
2681
+ .sds-radio__text {
2682
+ display: inline-block;
2683
+ max-width: var(--sds-typography-max-line-width);
2684
+ padding-top: 2px;
2685
+ }
2686
+ `;
2687
+ var __defProp$4 = Object.defineProperty;
2688
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
2689
+ var __decorateClass$4 = (decorators, target, key, kind) => {
2690
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
2691
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
2692
+ if (decorator = decorators[i2])
2693
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2694
+ if (kind && result) __defProp$4(target, key, result);
2695
+ return result;
2696
+ };
2697
+ let SDSRadio = class extends r$2 {
2698
+ constructor() {
2699
+ super();
2700
+ this.disabled = false;
2701
+ this.required = false;
2702
+ this.label = "";
2703
+ this.hideLabel = false;
2704
+ this.checked = false;
2705
+ this.error = false;
2706
+ this._initialChecked = false;
2707
+ this._handleKeydown = (event) => {
2708
+ if (!this.name || this.disabled) return;
2709
+ const root = this.getRootNode();
2710
+ const radios = Array.from(root.querySelectorAll(`sds-radio[name="${this.name}"]`));
2711
+ const currentIndex = radios.indexOf(this);
2712
+ if (currentIndex === -1) return;
2713
+ let targetIndex = null;
2714
+ switch (event.key) {
2715
+ case "ArrowUp":
2716
+ case "ArrowLeft":
2717
+ targetIndex = currentIndex > 0 ? currentIndex - 1 : radios.length - 1;
2718
+ break;
2719
+ case "ArrowDown":
2720
+ case "ArrowRight":
2721
+ targetIndex = currentIndex < radios.length - 1 ? currentIndex + 1 : 0;
2722
+ break;
2723
+ default:
2724
+ return;
2725
+ }
2726
+ const targetRadio = radios[targetIndex];
2727
+ targetRadio?.focus();
2728
+ event.preventDefault();
2729
+ };
2730
+ this._handleChange = (event) => {
2731
+ if (!this.disabled) {
2732
+ const elem = event.target;
2733
+ this.checked = elem.checked;
2734
+ this._validate();
2735
+ this.dispatchEvent(
2736
+ new CustomEvent("change", {
2737
+ detail: { checked: this.checked, value: this.value },
2738
+ bubbles: true,
2739
+ composed: true
2740
+ })
2741
+ );
2742
+ }
2743
+ };
2744
+ this._handleFocus = (event) => {
2745
+ event.stopImmediatePropagation();
2746
+ this.dispatchEvent(new CustomEvent("focus", { bubbles: true, composed: true }));
2747
+ };
2748
+ this._handleBlur = (event) => {
2749
+ event.stopImmediatePropagation();
2750
+ this.dispatchEvent(new CustomEvent("blur", { bubbles: true, composed: true }));
2751
+ };
2752
+ this.internals = this.attachInternals();
2753
+ this.attachShadow({ mode: "open", delegatesFocus: true });
2754
+ }
2755
+ connectedCallback() {
2756
+ super.connectedCallback();
2757
+ this.internals.role = "radio";
2758
+ if (!this._initialChecked) {
2759
+ this._initialChecked = this.checked;
2760
+ }
2761
+ this._validate();
2762
+ this.addEventListener("keydown", this._handleKeydown);
2763
+ }
2764
+ disconnectedCallback() {
2765
+ super.disconnectedCallback();
2766
+ this.removeEventListener("keydown", this._handleKeydown);
2767
+ }
2768
+ formResetCallback() {
2769
+ this.checked = this._initialChecked;
2770
+ this.control.checked = this._initialChecked;
2771
+ this.internals.setFormValue(this.checked ? this.value ?? null : null);
2772
+ this._validate();
2773
+ }
2774
+ _validate() {
2775
+ if (this.required && !this.checked) {
2776
+ this.setCustomValidity("This field is required.");
2777
+ } else {
2778
+ this.setCustomValidity("");
2779
+ }
2780
+ }
2781
+ updated(changedProperties) {
2782
+ super.updated?.(changedProperties);
2783
+ if (changedProperties.has("checked")) {
2784
+ this._validate();
2785
+ if (this.checked) {
2786
+ this._uncheckSiblings();
2787
+ this.internals.setFormValue(this.value ?? null);
2788
+ } else {
2789
+ this.internals.setFormValue(null);
2790
+ }
2791
+ }
2792
+ if (changedProperties.has("required") && this.control) {
2793
+ this.control.required = this.required;
2794
+ }
2795
+ }
2796
+ _uncheckSiblings() {
2797
+ if (!this.name) return;
2798
+ const root = this.getRootNode();
2799
+ const radios = root.querySelectorAll(`sds-radio[name="${this.name}"]`);
2800
+ radios.forEach((radio) => {
2801
+ if (radio !== this) {
2802
+ radio.checked = false;
2803
+ radio.internals.setFormValue(null);
2804
+ const input = radio.shadowRoot?.querySelector("#control");
2805
+ if (input) {
2806
+ input.checked = false;
2807
+ }
2808
+ }
2809
+ });
2810
+ }
2811
+ get form() {
2812
+ return this.internals.form;
2813
+ }
2814
+ get type() {
2815
+ return this.localName;
2816
+ }
2817
+ get validity() {
2818
+ return this.internals.validity;
2819
+ }
2820
+ get validationMessage() {
2821
+ return this.internals.validationMessage;
2822
+ }
2823
+ get willValidate() {
2824
+ return this.internals.willValidate;
2825
+ }
2826
+ checkValidity() {
2827
+ return this.internals.checkValidity();
2828
+ }
2829
+ reportValidity() {
2830
+ return this.internals.reportValidity();
2831
+ }
2832
+ setCustomValidity(message) {
2833
+ this.internals.setValidity({ customError: !!message }, message);
2834
+ }
2835
+ formDisabledCallback(disabled) {
2836
+ this.disabled = disabled;
2837
+ if (this.control) this.control.disabled = disabled;
2838
+ }
2839
+ focus() {
2840
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.focus();
2841
+ }
2842
+ blur() {
2843
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.blur();
2844
+ }
2845
+ click() {
2846
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.click();
2847
+ }
2848
+ render() {
2849
+ const radioClasses = {
2850
+ "sds-radio": true,
2851
+ "sds-radio--error": Boolean(this.error)
2852
+ };
2853
+ const inputClasses = {
2854
+ "sds-radio__input": true,
2855
+ "sds-radio__input--error": Boolean(this.error)
2856
+ };
2857
+ return x`
2858
+ <div class="${e$1(radioClasses)}">
2859
+ <label class="sds-radio__label">
2860
+ <input
2861
+ id="control"
2862
+ type="radio"
2863
+ name="${o$1(this.name)}"
2864
+ value="${o$1(this.value)}"
2865
+ ?checked="${this.checked}"
2866
+ ?disabled="${this.disabled}"
2867
+ @change="${this._handleChange}"
2868
+ @focus="${this._handleFocus}"
2869
+ @blur="${this._handleBlur}"
2870
+ class="${e$1(inputClasses)}"
2871
+ />
2872
+ ${this.label ? x`<span class="sds-radio__text">${this.label}</span>` : E}
2873
+ </label>
2874
+ </div>
2875
+ `;
2876
+ }
2877
+ };
2878
+ SDSRadio.styles = [styles$4];
2879
+ SDSRadio.formAssociated = true;
2880
+ __decorateClass$4([
2881
+ n2({ type: Boolean, reflect: true })
2882
+ ], SDSRadio.prototype, "disabled", 2);
2883
+ __decorateClass$4([
2884
+ n2({ type: Boolean, reflect: true })
2885
+ ], SDSRadio.prototype, "required", 2);
2886
+ __decorateClass$4([
2887
+ n2({ type: String, reflect: true })
2888
+ ], SDSRadio.prototype, "label", 2);
2889
+ __decorateClass$4([
2890
+ n2({ type: Boolean, reflect: true, attribute: "hide-label" })
2891
+ ], SDSRadio.prototype, "hideLabel", 2);
2892
+ __decorateClass$4([
2893
+ n2({ type: String, reflect: true })
2894
+ ], SDSRadio.prototype, "name", 2);
2895
+ __decorateClass$4([
2896
+ n2({ type: String })
2897
+ ], SDSRadio.prototype, "value", 2);
2898
+ __decorateClass$4([
2899
+ n2({ type: Boolean, reflect: true })
2900
+ ], SDSRadio.prototype, "checked", 2);
2901
+ __decorateClass$4([
2902
+ n2({ type: Boolean, reflect: true })
2903
+ ], SDSRadio.prototype, "error", 2);
2904
+ __decorateClass$4([
2905
+ e$3("#control")
2906
+ ], SDSRadio.prototype, "control", 2);
2907
+ SDSRadio = __decorateClass$4([
2908
+ t$1("sds-radio")
2909
+ ], SDSRadio);
2910
+ const styles$3 = i$4`
2911
+ .sds-radio-group {
2912
+ border: 0;
2913
+ margin: 0;
2914
+ padding: 0;
2915
+ }
2916
+
2917
+ .sds-radio-group__legend {
2918
+ color: var(--sds-color-semantic-text-default);
2919
+ font-family: var(--sds-typography-font-family);
2920
+ font-size: 1rem;
2921
+ font-weight: 600;
2922
+ line-height: 1.5;
2923
+ margin: 0 0 var(--sds-spacing-2) 0;
2924
+ max-width: var(--sds-typography-max-line-width);
2925
+ padding: 0;
2926
+ }
2927
+
2928
+ .sds-radio-group__help-text {
2929
+ color: var(--sds-color-semantic-text-subtle);
2930
+ font-family: var(--sds-typography-font-family);
2931
+ font-size: 1rem;
2932
+ font-weight: 400;
2933
+ line-height: 1.25rem;
2934
+ margin: 0;
2935
+ max-width: var(--sds-typography-max-line-width);
2936
+ }
2937
+
2938
+ .sds-radio-group__radios {
2939
+ display: flex;
2940
+ flex-direction: column;
2941
+ gap: var(--sds-spacing-5);
2942
+ margin-top: var(--sds-spacing-3);
2943
+ }
2944
+
2945
+ .sds-radio-group__error-message {
2946
+ margin: var(--sds-spacing-5) 0 0;
2947
+ max-width: var(--sds-typography-max-line-width);
2948
+ align-items: flex-start;
2949
+ color: var(--sds-color-semantic-text-default);
2950
+ display: flex;
2951
+ line-height: 1.5rem;
2952
+ gap: var(--sds-spacing-2);
2953
+ }
2954
+ `;
2955
+ var __defProp$3 = Object.defineProperty;
2956
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
2957
+ var __decorateClass$3 = (decorators, target, key, kind) => {
2958
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
2959
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
2960
+ if (decorator = decorators[i2])
2961
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2962
+ if (kind && result) __defProp$3(target, key, result);
2963
+ return result;
2964
+ };
2965
+ let SDSRadioGroup = class extends r$2 {
2966
+ constructor() {
2967
+ super(...arguments);
2968
+ this.selectedValue = null;
2969
+ this._handleRadioChange = (event) => {
2970
+ const target = event.composedPath().find((el) => el instanceof HTMLElement && el.tagName === "SDS-RADIO");
2971
+ if (target) {
2972
+ this.selectedValue = target.getAttribute("value") || null;
2973
+ this.dispatchEvent(
2974
+ new CustomEvent("change", {
2975
+ detail: { selectedValue: this.selectedValue },
2976
+ bubbles: true,
2977
+ composed: true
2978
+ })
2979
+ );
2980
+ }
2981
+ };
2982
+ }
2983
+ render() {
2984
+ return x`
2985
+ <fieldset class="sds-radio-group">
2986
+ ${this.legend ? x`<legend class="sds-radio-group__legend">${this.legend}</legend>` : E}
2987
+ ${this.helpText ? x`<p class="sds-radio-group__help-text">${this.helpText}</p>` : E}
2988
+ <div class="sds-radio-group__radios" @change=${this._handleRadioChange}>
2989
+ <slot></slot>
2990
+ </div>
2991
+ ${this.errorMessage ? x`<p class="sds-radio-group__error-message">
2992
+ <sds-icon
2993
+ name="warning-material-filled"
2994
+ size="m"
2995
+ color="var(--sds-color-semantic-icon-critical)"
2996
+ ></sds-icon>
2997
+ ${this.errorMessage}
2998
+ </p>` : E}
2999
+ </fieldset>
3000
+ `;
3001
+ }
3002
+ };
3003
+ SDSRadioGroup.styles = [styles$3];
3004
+ __decorateClass$3([
3005
+ n2({ type: String })
3006
+ ], SDSRadioGroup.prototype, "legend", 2);
3007
+ __decorateClass$3([
3008
+ n2({ type: String, attribute: "help-text" })
3009
+ ], SDSRadioGroup.prototype, "helpText", 2);
3010
+ __decorateClass$3([
3011
+ n2({ type: String, attribute: "error-message" })
3012
+ ], SDSRadioGroup.prototype, "errorMessage", 2);
3013
+ __decorateClass$3([
3014
+ r2()
3015
+ ], SDSRadioGroup.prototype, "selectedValue", 2);
3016
+ SDSRadioGroup = __decorateClass$3([
3017
+ t$1("sds-radio-group")
3018
+ ], SDSRadioGroup);
3019
+ const styles$2 = i$4`
3020
+ :host {
3021
+ display: inline-flex;
3022
+ contain: layout style;
3023
+ box-sizing: border-box;
3024
+ align-items: center;
3025
+ justify-content: space-between;
3026
+ }
3027
+
3028
+ :host([hidden]) {
3029
+ display: none;
3030
+ }
3031
+
3032
+ :host(:disabled),
3033
+ :host(:disabled) * {
3034
+ pointer-events: none;
3035
+ }
3036
+
3037
+ :host(:disabled) .sds-switch__input:checked::before {
3038
+ content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' fill='%23C4C6C7' viewBox='0 0 24 24'><path d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'></path></svg>");
3039
+ }
3040
+
3041
+ :host(:disabled) .sds-switch__input:not(:checked)::before {
3042
+ display: none;
3043
+ }
3044
+
3045
+ :host(:disabled) .sds-switch__label {
3046
+ color: var(--sds-color-semantic-text-disabled);
3047
+ }
3048
+
3049
+ .sds-switch {
3050
+ --_switch-motion-duration: 200ms;
3051
+ --_switch-height: 32px;
3052
+ --_switch-width: 60px;
3053
+ --_switch-padding: 8px;
3054
+ --_switch-icon-size: calc(var(--_switch-height) - (2 * var(--_switch-padding)));
3055
+
3056
+ display: flex;
3057
+ gap: 0.5rem;
3058
+ }
3059
+
3060
+ .sds-switch--small {
3061
+ --_switch-height: 24px;
3062
+ --_switch-width: 48px;
3063
+ --_switch-padding: 6px;
3064
+ }
3065
+
3066
+ .sds-switch:has(.sds-switch__input:checked) {
3067
+ --_switch-padding: 6px;
3068
+ }
3069
+
3070
+ .sds-switch--small:has(.sds-switch__input:checked) {
3071
+ --_switch-padding: 4px;
3072
+ }
3073
+
3074
+ .sds-switch__label {
3075
+ display: flex;
3076
+ align-items: center;
3077
+ cursor: pointer;
3078
+ user-select: none;
3079
+ color: var(--sds-color-semantic-text-default);
3080
+ font-family: var(--sds-typography-font-family);
3081
+ font-size: 1rem;
3082
+ font-weight: 400;
3083
+ line-height: 1.25;
3084
+ }
3085
+
3086
+ .sds-switch__label--hidden:not(:focus):not(:active):not(:focus-within) {
3087
+ clip-path: inset(50%);
3088
+ height: 1px;
3089
+ overflow: hidden;
3090
+ position: absolute;
3091
+ white-space: nowrap;
3092
+ width: 1px;
3093
+ }
3094
+
3095
+ .sds-switch__input {
3096
+ --_switch-icon-position: var(--_switch-padding);
3097
+
3098
+ appearance: none;
3099
+ cursor: pointer;
3100
+ user-select: none;
3101
+
3102
+ inline-size: var(--_switch-width);
3103
+ block-size: var(--_switch-height);
3104
+ margin: 0;
3105
+
3106
+ flex-shrink: 0;
3107
+ display: grid;
3108
+ align-items: center;
3109
+ grid: [track] 1fr / [track] 1fr;
3110
+
3111
+ transition: background-color var(--_switch-motion-duration);
3112
+ border-radius: 1rem;
3113
+ background-color: var(--sds-color-global-gray-300);
3114
+ }
3115
+
3116
+ .sds-switch__input::before {
3117
+ content: '';
3118
+ grid-area: track;
3119
+ inline-size: var(--_switch-icon-size);
3120
+ block-size: var(--_switch-icon-size);
3121
+
3122
+ background-color: var(--sds-color-semantic-border-default);
3123
+ transition: transform var(--_switch-motion-duration);
3124
+ border-radius: 50%;
3125
+ transform: translateX(var(--_switch-icon-position));
3126
+ }
3127
+
3128
+ .sds-switch__input:focus-visible {
3129
+ outline: 2px solid var(--sds-color-semantic-border-focus);
3130
+ outline-offset: 2px;
3131
+ }
3132
+
3133
+ .sds-switch__input:checked {
3134
+ --_switch-icon-position: calc(var(--_switch-width) - var(--_switch-icon-size) - var(--_switch-padding));
3135
+ }
3136
+
3137
+ .sds-switch__input:checked::before {
3138
+ content: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' fill='%230072ce' viewBox='0 0 24 24'><path d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'></path></svg>");
3139
+ background-color: var(--sds-color-semantic-surface-default);
3140
+ }
3141
+ `;
3142
+ var __defProp$2 = Object.defineProperty;
3143
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
3144
+ var __decorateClass$2 = (decorators, target, key, kind) => {
3145
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
3146
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
3147
+ if (decorator = decorators[i2])
3148
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3149
+ if (kind && result) __defProp$2(target, key, result);
3150
+ return result;
3151
+ };
3152
+ let SDSSwitch = class extends r$2 {
3153
+ constructor() {
3154
+ super();
3155
+ this.disabled = false;
3156
+ this.label = "";
3157
+ this.hideLabel = false;
3158
+ this.value = "";
3159
+ this.reverse = false;
3160
+ this.checked = false;
3161
+ this.size = "l";
3162
+ this._initialChecked = false;
3163
+ this._handleChange = (event) => {
3164
+ event.stopImmediatePropagation();
3165
+ if (!this.disabled) {
3166
+ const elem = event.target;
3167
+ this.checked = elem.checked;
3168
+ this.dispatchEvent(
3169
+ new CustomEvent("change", {
3170
+ detail: { checked: this.checked, value: this.value },
3171
+ bubbles: true,
3172
+ composed: true
3173
+ })
3174
+ );
3175
+ }
3176
+ };
3177
+ this._handleFocus = (event) => {
3178
+ event.stopImmediatePropagation();
3179
+ if (!this.disabled) {
3180
+ this.dispatchEvent(
3181
+ new CustomEvent("focus", {
3182
+ detail: { checked: this.checked, value: this.value },
3183
+ bubbles: true,
3184
+ composed: true
3185
+ })
3186
+ );
3187
+ }
3188
+ };
3189
+ this._handleBlur = (event) => {
3190
+ event.stopImmediatePropagation();
3191
+ if (!this.disabled) {
3192
+ this.dispatchEvent(
3193
+ new CustomEvent("blur", {
3194
+ detail: { checked: this.checked, value: this.value },
3195
+ bubbles: true,
3196
+ composed: true
3197
+ })
3198
+ );
3199
+ }
3200
+ };
3201
+ this.internals = this.attachInternals();
3202
+ this.attachShadow({ mode: "open", delegatesFocus: true });
3203
+ }
3204
+ connectedCallback() {
3205
+ super.connectedCallback();
3206
+ if (!this._initialChecked) {
3207
+ this._initialChecked = this.checked;
3208
+ }
3209
+ }
3210
+ updated(changedProperties) {
3211
+ if (changedProperties.has("checked")) {
3212
+ this.control.checked = this.checked;
3213
+ this.internals.setFormValue(this.checked ? this.value : null);
3214
+ }
3215
+ }
3216
+ formResetCallback() {
3217
+ this.checked = this._initialChecked;
3218
+ this.control.checked = this._initialChecked;
3219
+ this.internals.setFormValue(this._initialChecked ? this.value : null);
3220
+ }
3221
+ formStateRestoreCallback(state) {
3222
+ this.checked = state;
3223
+ }
3224
+ render() {
3225
+ const switchClasses = {
3226
+ "sds-switch": true,
3227
+ "sds-switch--small": this.size === "s"
3228
+ };
3229
+ const labelClasses = {
3230
+ "sds-switch__label": true,
3231
+ "sds-switch__label--hidden": this.hideLabel
3232
+ };
3233
+ const inputTemplate = x`<input
3234
+ class="sds-switch__input"
3235
+ id="control"
3236
+ type="checkbox"
3237
+ role="switch"
3238
+ ?checked="${this.checked}"
3239
+ value="${o$1(this.value)}"
3240
+ name="${o$1(this.name)}"
3241
+ @change="${this._handleChange}"
3242
+ @focus="${this._handleFocus}"
3243
+ @blur="${this._handleBlur}"
3244
+ />`;
3245
+ const labelTemplate = x`<label class="${e$1(labelClasses)}" for="control">${this.label}</label>`;
3246
+ return x`<div class="${e$1(switchClasses)}">
3247
+ ${this.reverse ? [labelTemplate, inputTemplate] : [inputTemplate, labelTemplate]}
3248
+ </div>`;
3249
+ }
3250
+ };
3251
+ SDSSwitch.styles = [styles$2];
3252
+ SDSSwitch.formAssociated = true;
3253
+ __decorateClass$2([
3254
+ n2({ type: Boolean, reflect: true })
3255
+ ], SDSSwitch.prototype, "disabled", 2);
3256
+ __decorateClass$2([
3257
+ n2({ type: String, reflect: true })
3258
+ ], SDSSwitch.prototype, "label", 2);
3259
+ __decorateClass$2([
3260
+ n2({ type: Boolean, reflect: true, attribute: "hide-label" })
3261
+ ], SDSSwitch.prototype, "hideLabel", 2);
3262
+ __decorateClass$2([
3263
+ n2({ type: String, reflect: false })
3264
+ ], SDSSwitch.prototype, "name", 2);
3265
+ __decorateClass$2([
3266
+ n2({ type: String, reflect: false })
3267
+ ], SDSSwitch.prototype, "value", 2);
3268
+ __decorateClass$2([
3269
+ n2({ type: Boolean, reflect: true })
3270
+ ], SDSSwitch.prototype, "reverse", 2);
3271
+ __decorateClass$2([
3272
+ n2({ type: Boolean, reflect: true })
3273
+ ], SDSSwitch.prototype, "checked", 2);
3274
+ __decorateClass$2([
3275
+ n2({ type: String, reflect: true })
3276
+ ], SDSSwitch.prototype, "size", 2);
3277
+ __decorateClass$2([
3278
+ e$3("#control")
3279
+ ], SDSSwitch.prototype, "control", 2);
3280
+ SDSSwitch = __decorateClass$2([
3281
+ t$1("sds-switch")
3282
+ ], SDSSwitch);
3283
+ const styles$1 = i$4`
3284
+ :host {
3285
+ display: block;
3286
+ }
3287
+
3288
+ .sds-text {
3289
+ font-family: var(--sds-typography-font-family);
3290
+ font-weight: 400;
3291
+ color: var(--sds-color-semantic-text-default);
3292
+ margin: 0;
3293
+ max-width: var(--sds-typography-max-line-width);
3294
+ padding: 0;
3295
+ }
3296
+
3297
+ .sds-text--l {
3298
+ font-size: 1.125rem;
3299
+ line-height: 1.222;
3300
+ }
3301
+
3302
+ .sds-text--m {
3303
+ font-size: 1rem;
3304
+ line-height: 1.25;
3305
+ }
3306
+
3307
+ .sds-text--s {
3308
+ font-size: 0.875rem;
3309
+ line-height: 1.285;
3310
+ }
3311
+ `;
3312
+ var __defProp$1 = Object.defineProperty;
3313
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
3314
+ var __decorateClass$1 = (decorators, target, key, kind) => {
3315
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
3316
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
3317
+ if (decorator = decorators[i2])
3318
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3319
+ if (kind && result) __defProp$1(target, key, result);
3320
+ return result;
3321
+ };
3322
+ let SDSText = class extends r$2 {
3323
+ constructor() {
3324
+ super(...arguments);
3325
+ this.size = "l";
3326
+ }
3327
+ render() {
3328
+ const styleClasses = {
3329
+ "sds-text": true,
3330
+ "sds-text--l": this.size === "l",
3331
+ "sds-text--m": this.size === "m",
3332
+ "sds-text--s": this.size === "s"
3333
+ };
3334
+ const classes = e$1(styleClasses);
3335
+ return x`<p class=${classes}><slot></slot></p>`;
3336
+ }
3337
+ };
3338
+ SDSText.styles = [styles$1];
3339
+ __decorateClass$1([
3340
+ n2({ type: String })
3341
+ ], SDSText.prototype, "size", 2);
3342
+ SDSText = __decorateClass$1([
3343
+ t$1("sds-text")
3344
+ ], SDSText);
3345
+ const styles = i$4`
3346
+ :host {
3347
+ all: unset;
3348
+ display: block;
3349
+ text-align: start;
3350
+ }
3351
+
3352
+ .sds-textfield {
3353
+ display: flex;
3354
+ flex-direction: column;
3355
+ gap: 0.25rem;
3356
+ font-family: var(--sds-typography-font-family);
3357
+
3358
+ .sds-textfield__input-container {
3359
+ max-width: var(--sds-typography-max-line-width);
3360
+ position: relative;
3361
+ }
3362
+
3363
+ .sds-textfield__input {
3364
+ box-sizing: border-box;
3365
+ color: var(--sds-color-semantic-text-default);
3366
+ padding: 0.75rem 1rem;
3367
+ line-height: 1.25rem;
3368
+ font-size: 1rem;
3369
+ justify-content: flex-end;
3370
+ border-radius: var(--sds-radius-4);
3371
+ border: 1px solid var(--sds-color-semantic-border-default);
3372
+ background: var(--sds-color-semantic-surface-default);
3373
+ max-width: var(--sds-typography-max-line-width);
3374
+ width: 100%;
3375
+
3376
+ &:hover {
3377
+ border-color: var(--sds-color-semantic-border-strong);
3378
+ }
3379
+
3380
+ &:focus {
3381
+ outline: 2px solid var(--sds-color-semantic-border-focus);
3382
+ outline-offset: 1px;
3383
+ }
3384
+
3385
+ &:active {
3386
+ border-color: var(--sds-color-semantic-border-action);
3387
+ outline: none;
3388
+ }
3389
+ }
3390
+
3391
+ .sds-textfield__label {
3392
+ color: var(--sds-color-semantic-text-default);
3393
+ display: block;
3394
+ font-size: 1rem;
3395
+ font-weight: 500;
3396
+ line-height: 1.5rem;
3397
+ max-width: var(--sds-typography-max-line-width);
3398
+ }
3399
+
3400
+ .sds-textfield__help-text {
3401
+ color: var(--sds-color-semantic-text-subtle);
3402
+ font-size: 1rem;
3403
+ font-weight: 400;
3404
+ line-height: 1.25rem;
3405
+ margin: 0;
3406
+ max-width: var(--sds-typography-max-line-width);
3407
+ }
3408
+
3409
+ .sds-textfield__error-message {
3410
+ margin: 0;
3411
+ max-width: var(--sds-typography-max-line-width);
3412
+ align-items: flex-start;
3413
+ color: var(--sds-color-semantic-text-default);
3414
+ display: flex;
3415
+ line-height: 1.5rem;
3416
+ gap: 0.25rem;
3417
+ }
3418
+ }
3419
+
3420
+ .sds-textfield--error {
3421
+ color: var(--sds-color-semantic-text-default);
3422
+ line-height: 1.5rem;
3423
+
3424
+ .sds-textfield__input,
3425
+ .sds-textfield__input:hover {
3426
+ border-color: var(--sds-color-semantic-border-critical);
3427
+ }
3428
+ }
3429
+
3430
+ .sds-textfield--disabled {
3431
+ pointer-events: none;
3432
+
3433
+ .sds-textfield__label,
3434
+ .sds-textfield__help-text,
3435
+ .sds-textfield__error-message,
3436
+ .sds-textfield__input {
3437
+ color: var(--sds-color-semantic-text-disabled);
3438
+ }
3439
+
3440
+ .sds-textfield__input {
3441
+ border: 1px solid var(--sds-color-semantic-border-disabled);
3442
+ }
3443
+ }
3444
+
3445
+ .sds-textfield--has-icon {
3446
+ .sds-textfield__input {
3447
+ padding-right: 3.5rem;
3448
+ }
3449
+ }
3450
+
3451
+ ::slotted([slot='after']) {
3452
+ position: absolute;
3453
+ top: 50%;
3454
+ right: 1rem;
3455
+ transform: translateY(-50%);
3456
+ pointer-events: none;
3457
+ }
3458
+ `;
3459
+ var __defProp = Object.defineProperty;
3460
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3461
+ var __decorateClass = (decorators, target, key, kind) => {
3462
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
3463
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
3464
+ if (decorator = decorators[i2])
3465
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3466
+ if (kind && result) __defProp(target, key, result);
3467
+ return result;
3468
+ };
3469
+ let SDSTextField = class extends r$2 {
3470
+ constructor() {
3471
+ super(...arguments);
3472
+ this.type = "text";
3473
+ this.disabled = false;
3474
+ this.readOnly = false;
3475
+ this.autocomplete = false;
3476
+ this.hasIcon = false;
3477
+ this.handleSlotChange = (e2) => {
3478
+ const slot = e2.target;
3479
+ this.hasIcon = slot.assignedNodes({ flatten: true }).length > 0;
3480
+ };
3481
+ this._handleInput = (event) => {
3482
+ event.stopImmediatePropagation();
3483
+ if (!this.disabled) {
3484
+ this.dispatchEvent(
3485
+ new CustomEvent("input", {
3486
+ detail: { value: event.target.value },
3487
+ bubbles: true,
3488
+ composed: true
3489
+ })
3490
+ );
3491
+ }
3492
+ };
3493
+ this._handleChange = (event) => {
3494
+ event.stopImmediatePropagation();
3495
+ if (!this.disabled) {
3496
+ this.dispatchEvent(
3497
+ new CustomEvent("change", {
3498
+ detail: { value: event.target.value },
3499
+ bubbles: true,
3500
+ composed: true
3501
+ })
3502
+ );
3503
+ }
3504
+ };
3505
+ this._handleSelect = (event) => {
3506
+ event.stopImmediatePropagation();
3507
+ if (!this.disabled) {
3508
+ const target = event.target;
3509
+ const selectedText = target.value.substring(target.selectionStart ?? 0, target.selectionEnd ?? 0);
3510
+ this.dispatchEvent(
3511
+ new CustomEvent("select", {
3512
+ detail: { selectedText },
3513
+ bubbles: true,
3514
+ composed: true
3515
+ })
3516
+ );
3517
+ }
3518
+ };
3519
+ this._handleFocus = (event) => {
3520
+ event.stopImmediatePropagation();
3521
+ this.dispatchEvent(
3522
+ new CustomEvent("focus", {
3523
+ detail: { value: event.target.value },
3524
+ bubbles: true,
3525
+ composed: true
3526
+ })
3527
+ );
3528
+ };
3529
+ this._handleBlur = (event) => {
3530
+ event.stopImmediatePropagation();
3531
+ this.dispatchEvent(
3532
+ new CustomEvent("blur", {
3533
+ detail: { value: event.target.value },
3534
+ bubbles: true,
3535
+ composed: true
3536
+ })
3537
+ );
3538
+ };
3539
+ }
3540
+ select() {
3541
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.select();
3542
+ }
3543
+ focus() {
3544
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.focus();
3545
+ }
3546
+ blur() {
3547
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.blur();
3548
+ }
3549
+ click() {
3550
+ if (!this.disabled) this.shadowRoot?.querySelector("input")?.click();
3551
+ }
3552
+ render() {
3553
+ const textfieldClasses = {
3554
+ "sds-textfield": true,
3555
+ "sds-textfield--error": Boolean(this.errorMessage),
3556
+ "sds-textfield--disabled": Boolean(this.disabled),
3557
+ "sds-textfield--readonly": Boolean(this.readOnly),
3558
+ "sds-textfield--has-icon": this.hasIcon
3559
+ };
3560
+ return x` <div class="${e$1(textfieldClasses)}">
3561
+ ${this.label ? x`<label for="sds-textfield" class="sds-textfield__label">${this.label}</label>` : E}
3562
+ ${this.helpText ? x`<p class="sds-textfield__help-text">${this.helpText}</p>` : E}
3563
+ <div class="sds-textfield__input-container">
3564
+ <input
3565
+ class="sds-textfield__input"
3566
+ type="${this.type}"
3567
+ id="sds-textfield"
3568
+ ?disabled="${this.disabled}"
3569
+ ?readonly="${this.readOnly}"
3570
+ placeholder="${o$1(this.placeholder)}"
3571
+ value="${o$1(this.value)}"
3572
+ name="${o$1(this.name)}"
3573
+ autocomplete="${this.autocomplete ? "on" : "off"}"
3574
+ @input="${this._handleInput}"
3575
+ @change="${this._handleChange}"
3576
+ @select="${this._handleSelect}"
3577
+ @focus="${this._handleFocus}"
3578
+ @blur="${this._handleBlur}"
3579
+ />
3580
+ <slot name="after" @slotchange="${this.handleSlotChange}" aria-hidden="true"></slot>
3581
+ </div>
3582
+ ${this.errorMessage ? x`<p class="sds-textfield__error-message">
3583
+ <sds-icon
3584
+ name="warning-material-filled"
3585
+ size="m"
3586
+ color="${!this.disabled ? `var(--sds-color-semantic-icon-critical)` : `var(--sds-color-semantic-icon-disabled)`}"
3587
+ ></sds-icon
3588
+ >${this.errorMessage}
3589
+ </p>` : E}
3590
+ </div>`;
3591
+ }
3592
+ };
3593
+ SDSTextField.styles = [styles];
3594
+ __decorateClass([
3595
+ n2({ type: String })
3596
+ ], SDSTextField.prototype, "type", 2);
3597
+ __decorateClass([
3598
+ n2({ type: String })
3599
+ ], SDSTextField.prototype, "value", 2);
3600
+ __decorateClass([
3601
+ n2({ type: String })
3602
+ ], SDSTextField.prototype, "name", 2);
3603
+ __decorateClass([
3604
+ n2({ type: String })
3605
+ ], SDSTextField.prototype, "label", 2);
3606
+ __decorateClass([
3607
+ n2({ type: String })
3608
+ ], SDSTextField.prototype, "placeholder", 2);
3609
+ __decorateClass([
3610
+ n2({ type: String, attribute: "help-text" })
3611
+ ], SDSTextField.prototype, "helpText", 2);
3612
+ __decorateClass([
3613
+ n2({ type: String, attribute: "error-message" })
3614
+ ], SDSTextField.prototype, "errorMessage", 2);
3615
+ __decorateClass([
3616
+ n2({ type: Boolean })
3617
+ ], SDSTextField.prototype, "disabled", 2);
3618
+ __decorateClass([
3619
+ n2({ type: Boolean, attribute: "readonly" })
3620
+ ], SDSTextField.prototype, "readOnly", 2);
3621
+ __decorateClass([
3622
+ n2({ type: Boolean })
3623
+ ], SDSTextField.prototype, "autocomplete", 2);
3624
+ __decorateClass([
3625
+ r2()
3626
+ ], SDSTextField.prototype, "hasIcon", 2);
3627
+ SDSTextField = __decorateClass([
3628
+ t$1("sds-textfield")
3629
+ ], SDSTextField);
3630
+ export {
3631
+ SDSButton,
3632
+ SDSCheckbox,
3633
+ SDSCheckboxGroup,
3634
+ SDSChip,
3635
+ SDSDetail,
3636
+ SDSHeading,
3637
+ SDSIcon,
3638
+ SDSLabel,
3639
+ SDSLink,
3640
+ SDSLoader,
3641
+ SDSNavCard,
3642
+ SDSNotification,
3643
+ SDSParagraph,
3644
+ SDSRadio,
3645
+ SDSRadioGroup,
3646
+ SDSSwitch,
3647
+ SDSText,
3648
+ SDSTextField
3649
+ };