@nysds/nys-radiobutton 1.11.1 → 1.11.3

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.
@@ -1,900 +1,15 @@
1
- import { css as ut, LitElement as st, html as L } from "lit";
2
- /*!
3
- * ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
4
- * ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
5
- * ▒█░░▀█ ░░▒█░░ ▒█▄▄▄█ ▒█▄▄▀ ▒█▄▄▄█
6
- *
7
- * Radiobutton Component
8
- * Part of the New York State Design System
9
- * Repository: https://github.com/its-hcd/nysds
10
- * License: MIT
11
- */
12
- /**
13
- * @license
14
- * Copyright 2019 Google LLC
15
- * SPDX-License-Identifier: BSD-3-Clause
16
- */
17
- const U = globalThis, j = U.ShadowRoot && (U.ShadyCSS === void 0 || U.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, rt = Symbol(), Z = /* @__PURE__ */ new WeakMap();
18
- let pt = class {
19
- constructor(t, e, o) {
20
- if (this._$cssResult$ = !0, o !== rt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
21
- this.cssText = t, this.t = e;
22
- }
23
- get styleSheet() {
24
- let t = this.o;
25
- const e = this.t;
26
- if (j && t === void 0) {
27
- const o = e !== void 0 && e.length === 1;
28
- o && (t = Z.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), o && Z.set(e, t));
29
- }
30
- return t;
31
- }
32
- toString() {
33
- return this.cssText;
34
- }
35
- };
36
- const bt = (s) => new pt(typeof s == "string" ? s : s + "", void 0, rt), yt = (s, t) => {
37
- if (j) s.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
38
- else for (const e of t) {
39
- const o = document.createElement("style"), i = U.litNonce;
40
- i !== void 0 && o.setAttribute("nonce", i), o.textContent = e.cssText, s.appendChild(o);
41
- }
42
- }, K = j ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
43
- let e = "";
44
- for (const o of t.cssRules) e += o.cssText;
45
- return bt(e);
46
- })(s) : s;
47
- /**
48
- * @license
49
- * Copyright 2017 Google LLC
50
- * SPDX-License-Identifier: BSD-3-Clause
51
- */
52
- const { is: ft, defineProperty: _t, getOwnPropertyDescriptor: vt, getOwnPropertyNames: gt, getOwnPropertySymbols: mt, getPrototypeOf: $t } = Object, D = globalThis, J = D.trustedTypes, At = J ? J.emptyScript : "", wt = D.reactiveElementPolyfillSupport, R = (s, t) => s, T = { toAttribute(s, t) {
53
- switch (t) {
54
- case Boolean:
55
- s = s ? At : null;
56
- break;
57
- case Object:
58
- case Array:
59
- s = s == null ? s : JSON.stringify(s);
60
- }
61
- return s;
62
- }, fromAttribute(s, t) {
63
- let e = s;
64
- switch (t) {
65
- case Boolean:
66
- e = s !== null;
67
- break;
68
- case Number:
69
- e = s === null ? null : Number(s);
70
- break;
71
- case Object:
72
- case Array:
73
- try {
74
- e = JSON.parse(s);
75
- } catch {
76
- e = null;
77
- }
78
- }
79
- return e;
80
- } }, G = (s, t) => !ft(s, t), Y = { attribute: !0, type: String, converter: T, reflect: !1, useDefault: !1, hasChanged: G };
81
- Symbol.metadata ??= Symbol("metadata"), D.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
82
- class x extends HTMLElement {
83
- static addInitializer(t) {
84
- this._$Ei(), (this.l ??= []).push(t);
85
- }
86
- static get observedAttributes() {
87
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
88
- }
89
- static createProperty(t, e = Y) {
90
- if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
91
- const o = Symbol(), i = this.getPropertyDescriptor(t, o, e);
92
- i !== void 0 && _t(this.prototype, t, i);
93
- }
94
- }
95
- static getPropertyDescriptor(t, e, o) {
96
- const { get: i, set: r } = vt(this.prototype, t) ?? { get() {
97
- return this[e];
98
- }, set(n) {
99
- this[e] = n;
100
- } };
101
- return { get: i, set(n) {
102
- const d = i?.call(this);
103
- r?.call(this, n), this.requestUpdate(t, d, o);
104
- }, configurable: !0, enumerable: !0 };
105
- }
106
- static getPropertyOptions(t) {
107
- return this.elementProperties.get(t) ?? Y;
108
- }
109
- static _$Ei() {
110
- if (this.hasOwnProperty(R("elementProperties"))) return;
111
- const t = $t(this);
112
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
113
- }
114
- static finalize() {
115
- if (this.hasOwnProperty(R("finalized"))) return;
116
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(R("properties"))) {
117
- const e = this.properties, o = [...gt(e), ...mt(e)];
118
- for (const i of o) this.createProperty(i, e[i]);
119
- }
120
- const t = this[Symbol.metadata];
121
- if (t !== null) {
122
- const e = litPropertyMetadata.get(t);
123
- if (e !== void 0) for (const [o, i] of e) this.elementProperties.set(o, i);
124
- }
125
- this._$Eh = /* @__PURE__ */ new Map();
126
- for (const [e, o] of this.elementProperties) {
127
- const i = this._$Eu(e, o);
128
- i !== void 0 && this._$Eh.set(i, e);
129
- }
130
- this.elementStyles = this.finalizeStyles(this.styles);
131
- }
132
- static finalizeStyles(t) {
133
- const e = [];
134
- if (Array.isArray(t)) {
135
- const o = new Set(t.flat(1 / 0).reverse());
136
- for (const i of o) e.unshift(K(i));
137
- } else t !== void 0 && e.push(K(t));
138
- return e;
139
- }
140
- static _$Eu(t, e) {
141
- const o = e.attribute;
142
- return o === !1 ? void 0 : typeof o == "string" ? o : typeof t == "string" ? t.toLowerCase() : void 0;
143
- }
144
- constructor() {
145
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
146
- }
147
- _$Ev() {
148
- this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
149
- }
150
- addController(t) {
151
- (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
152
- }
153
- removeController(t) {
154
- this._$EO?.delete(t);
155
- }
156
- _$E_() {
157
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
158
- for (const o of e.keys()) this.hasOwnProperty(o) && (t.set(o, this[o]), delete this[o]);
159
- t.size > 0 && (this._$Ep = t);
160
- }
161
- createRenderRoot() {
162
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
163
- return yt(t, this.constructor.elementStyles), t;
164
- }
165
- connectedCallback() {
166
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
167
- }
168
- enableUpdating(t) {
169
- }
170
- disconnectedCallback() {
171
- this._$EO?.forEach(((t) => t.hostDisconnected?.()));
172
- }
173
- attributeChangedCallback(t, e, o) {
174
- this._$AK(t, o);
175
- }
176
- _$ET(t, e) {
177
- const o = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, o);
178
- if (i !== void 0 && o.reflect === !0) {
179
- const r = (o.converter?.toAttribute !== void 0 ? o.converter : T).toAttribute(e, o.type);
180
- this._$Em = t, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null;
181
- }
182
- }
183
- _$AK(t, e) {
184
- const o = this.constructor, i = o._$Eh.get(t);
185
- if (i !== void 0 && this._$Em !== i) {
186
- const r = o.getPropertyOptions(i), n = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : T;
187
- this._$Em = i;
188
- const d = n.fromAttribute(e, r.type);
189
- this[i] = d ?? this._$Ej?.get(i) ?? d, this._$Em = null;
190
- }
191
- }
192
- requestUpdate(t, e, o) {
193
- if (t !== void 0) {
194
- const i = this.constructor, r = this[t];
195
- if (o ??= i.getPropertyOptions(t), !((o.hasChanged ?? G)(r, e) || o.useDefault && o.reflect && r === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, o)))) return;
196
- this.C(t, e, o);
197
- }
198
- this.isUpdatePending === !1 && (this._$ES = this._$EP());
199
- }
200
- C(t, e, { useDefault: o, reflect: i, wrapped: r }, n) {
201
- o && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), r !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || o || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
202
- }
203
- async _$EP() {
204
- this.isUpdatePending = !0;
205
- try {
206
- await this._$ES;
207
- } catch (e) {
208
- Promise.reject(e);
209
- }
210
- const t = this.scheduleUpdate();
211
- return t != null && await t, !this.isUpdatePending;
212
- }
213
- scheduleUpdate() {
214
- return this.performUpdate();
215
- }
216
- performUpdate() {
217
- if (!this.isUpdatePending) return;
218
- if (!this.hasUpdated) {
219
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
220
- for (const [i, r] of this._$Ep) this[i] = r;
221
- this._$Ep = void 0;
222
- }
223
- const o = this.constructor.elementProperties;
224
- if (o.size > 0) for (const [i, r] of o) {
225
- const { wrapped: n } = r, d = this[i];
226
- n !== !0 || this._$AL.has(i) || d === void 0 || this.C(i, void 0, r, d);
227
- }
228
- }
229
- let t = !1;
230
- const e = this._$AL;
231
- try {
232
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((o) => o.hostUpdate?.())), this.update(e)) : this._$EM();
233
- } catch (o) {
234
- throw t = !1, this._$EM(), o;
235
- }
236
- t && this._$AE(e);
237
- }
238
- willUpdate(t) {
239
- }
240
- _$AE(t) {
241
- this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
242
- }
243
- _$EM() {
244
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
245
- }
246
- get updateComplete() {
247
- return this.getUpdateComplete();
248
- }
249
- getUpdateComplete() {
250
- return this._$ES;
251
- }
252
- shouldUpdate(t) {
253
- return !0;
254
- }
255
- update(t) {
256
- this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
257
- }
258
- updated(t) {
259
- }
260
- firstUpdated(t) {
261
- }
262
- }
263
- x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[R("elementProperties")] = /* @__PURE__ */ new Map(), x[R("finalized")] = /* @__PURE__ */ new Map(), wt?.({ ReactiveElement: x }), (D.reactiveElementVersions ??= []).push("2.1.1");
264
- /**
265
- * @license
266
- * Copyright 2017 Google LLC
267
- * SPDX-License-Identifier: BSD-3-Clause
268
- */
269
- const Et = { attribute: !0, type: String, converter: T, reflect: !1, hasChanged: G }, kt = (s = Et, t, e) => {
270
- const { kind: o, metadata: i } = e;
271
- let r = globalThis.litPropertyMetadata.get(i);
272
- if (r === void 0 && globalThis.litPropertyMetadata.set(i, r = /* @__PURE__ */ new Map()), o === "setter" && ((s = Object.create(s)).wrapped = !0), r.set(e.name, s), o === "accessor") {
273
- const { name: n } = e;
274
- return { set(d) {
275
- const a = t.get.call(this);
276
- t.set.call(this, d), this.requestUpdate(n, a, s);
277
- }, init(d) {
278
- return d !== void 0 && this.C(n, void 0, s, d), d;
279
- } };
280
- }
281
- if (o === "setter") {
282
- const { name: n } = e;
283
- return function(d) {
284
- const a = this[n];
285
- t.call(this, d), this.requestUpdate(n, a, s);
286
- };
287
- }
288
- throw Error("Unsupported decorator location: " + o);
289
- };
290
- function l(s) {
291
- return (t, e) => typeof e == "object" ? kt(s, t, e) : ((o, i, r) => {
292
- const n = i.hasOwnProperty(r);
293
- return i.constructor.createProperty(r, o), n ? Object.getOwnPropertyDescriptor(i, r) : void 0;
294
- })(s, t, e);
295
- }
296
- /**
297
- * @license
298
- * Copyright 2017 Google LLC
299
- * SPDX-License-Identifier: BSD-3-Clause
300
- */
301
- function nt(s) {
302
- return l({ ...s, state: !0, attribute: !1 });
303
- }
304
- /**
305
- * @license
306
- * Copyright 2017 Google LLC
307
- * SPDX-License-Identifier: BSD-3-Clause
308
- */
309
- const F = globalThis, O = F.trustedTypes, Q = O ? O.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, at = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, dt = "?" + A, St = `<${dt}>`, k = document, M = () => k.createComment(""), P = (s) => s === null || typeof s != "object" && typeof s != "function", W = Array.isArray, xt = (s) => W(s) || typeof s?.[Symbol.iterator] == "function", N = `[
310
- \f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, tt = />/g, w = RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^
311
- \f\r"'\`<>=]|("|')|))|$)`, "g"), et = /'/g, ot = /"/g, lt = /^(?:script|style|textarea|title)$/i, z = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), it = /* @__PURE__ */ new WeakMap(), E = k.createTreeWalker(k, 129);
312
- function ct(s, t) {
313
- if (!W(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
314
- return Q !== void 0 ? Q.createHTML(t) : t;
315
- }
316
- const Ct = (s, t) => {
317
- const e = s.length - 1, o = [];
318
- let i, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = C;
319
- for (let d = 0; d < e; d++) {
320
- const a = s[d];
321
- let h, b, c = -1, g = 0;
322
- for (; g < a.length && (n.lastIndex = g, b = n.exec(a), b !== null); ) g = n.lastIndex, n === C ? b[1] === "!--" ? n = X : b[1] !== void 0 ? n = tt : b[2] !== void 0 ? (lt.test(b[2]) && (i = RegExp("</" + b[2], "g")), n = w) : b[3] !== void 0 && (n = w) : n === w ? b[0] === ">" ? (n = i ?? C, c = -1) : b[1] === void 0 ? c = -2 : (c = n.lastIndex - b[2].length, h = b[1], n = b[3] === void 0 ? w : b[3] === '"' ? ot : et) : n === ot || n === et ? n = w : n === X || n === tt ? n = C : (n = w, i = void 0);
323
- const $ = n === w && s[d + 1].startsWith("/>") ? " " : "";
324
- r += n === C ? a + St : c >= 0 ? (o.push(h), a.slice(0, c) + at + a.slice(c) + A + $) : a + A + (c === -2 ? d : $);
325
- }
326
- return [ct(s, r + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), o];
327
- };
328
- class B {
329
- constructor({ strings: t, _$litType$: e }, o) {
330
- let i;
331
- this.parts = [];
332
- let r = 0, n = 0;
333
- const d = t.length - 1, a = this.parts, [h, b] = Ct(t, e);
334
- if (this.el = B.createElement(h, o), E.currentNode = this.el.content, e === 2 || e === 3) {
335
- const c = this.el.content.firstChild;
336
- c.replaceWith(...c.childNodes);
337
- }
338
- for (; (i = E.nextNode()) !== null && a.length < d; ) {
339
- if (i.nodeType === 1) {
340
- if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(at)) {
341
- const g = b[n++], $ = i.getAttribute(c).split(A), q = /([.?@])?(.*)/.exec(g);
342
- a.push({ type: 1, index: r, name: q[2], strings: $, ctor: q[1] === "." ? Pt : q[1] === "?" ? zt : q[1] === "@" ? Bt : I }), i.removeAttribute(c);
343
- } else c.startsWith(A) && (a.push({ type: 6, index: r }), i.removeAttribute(c));
344
- if (lt.test(i.tagName)) {
345
- const c = i.textContent.split(A), g = c.length - 1;
346
- if (g > 0) {
347
- i.textContent = O ? O.emptyScript : "";
348
- for (let $ = 0; $ < g; $++) i.append(c[$], M()), E.nextNode(), a.push({ type: 2, index: ++r });
349
- i.append(c[g], M());
350
- }
351
- }
352
- } else if (i.nodeType === 8) if (i.data === dt) a.push({ type: 2, index: r });
353
- else {
354
- let c = -1;
355
- for (; (c = i.data.indexOf(A, c + 1)) !== -1; ) a.push({ type: 7, index: r }), c += A.length - 1;
356
- }
357
- r++;
358
- }
359
- }
360
- static createElement(t, e) {
361
- const o = k.createElement("template");
362
- return o.innerHTML = t, o;
363
- }
364
- }
365
- function S(s, t, e = s, o) {
366
- if (t === z) return t;
367
- let i = o !== void 0 ? e._$Co?.[o] : e._$Cl;
368
- const r = P(t) ? void 0 : t._$litDirective$;
369
- return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(s), i._$AT(s, e, o)), o !== void 0 ? (e._$Co ??= [])[o] = i : e._$Cl = i), i !== void 0 && (t = S(s, i._$AS(s, t.values), i, o)), t;
370
- }
371
- class Rt {
372
- constructor(t, e) {
373
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
374
- }
375
- get parentNode() {
376
- return this._$AM.parentNode;
377
- }
378
- get _$AU() {
379
- return this._$AM._$AU;
380
- }
381
- u(t) {
382
- const { el: { content: e }, parts: o } = this._$AD, i = (t?.creationScope ?? k).importNode(e, !0);
383
- E.currentNode = i;
384
- let r = E.nextNode(), n = 0, d = 0, a = o[0];
385
- for (; a !== void 0; ) {
386
- if (n === a.index) {
387
- let h;
388
- a.type === 2 ? h = new H(r, r.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (h = new qt(r, this, t)), this._$AV.push(h), a = o[++d];
389
- }
390
- n !== a?.index && (r = E.nextNode(), n++);
391
- }
392
- return E.currentNode = k, i;
393
- }
394
- p(t) {
395
- let e = 0;
396
- for (const o of this._$AV) o !== void 0 && (o.strings !== void 0 ? (o._$AI(t, o, e), e += o.strings.length - 2) : o._$AI(t[e])), e++;
397
- }
398
- }
399
- class H {
400
- get _$AU() {
401
- return this._$AM?._$AU ?? this._$Cv;
402
- }
403
- constructor(t, e, o, i) {
404
- this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = o, this.options = i, this._$Cv = i?.isConnected ?? !0;
405
- }
406
- get parentNode() {
407
- let t = this._$AA.parentNode;
408
- const e = this._$AM;
409
- return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
410
- }
411
- get startNode() {
412
- return this._$AA;
413
- }
414
- get endNode() {
415
- return this._$AB;
416
- }
417
- _$AI(t, e = this) {
418
- t = S(this, t, e), P(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== z && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : xt(t) ? this.k(t) : this._(t);
419
- }
420
- O(t) {
421
- return this._$AA.parentNode.insertBefore(t, this._$AB);
422
- }
423
- T(t) {
424
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
425
- }
426
- _(t) {
427
- this._$AH !== p && P(this._$AH) ? this._$AA.nextSibling.data = t : this.T(k.createTextNode(t)), this._$AH = t;
428
- }
429
- $(t) {
430
- const { values: e, _$litType$: o } = t, i = typeof o == "number" ? this._$AC(t) : (o.el === void 0 && (o.el = B.createElement(ct(o.h, o.h[0]), this.options)), o);
431
- if (this._$AH?._$AD === i) this._$AH.p(e);
432
- else {
433
- const r = new Rt(i, this), n = r.u(this.options);
434
- r.p(e), this.T(n), this._$AH = r;
435
- }
436
- }
437
- _$AC(t) {
438
- let e = it.get(t.strings);
439
- return e === void 0 && it.set(t.strings, e = new B(t)), e;
440
- }
441
- k(t) {
442
- W(this._$AH) || (this._$AH = [], this._$AR());
443
- const e = this._$AH;
444
- let o, i = 0;
445
- for (const r of t) i === e.length ? e.push(o = new H(this.O(M()), this.O(M()), this, this.options)) : o = e[i], o._$AI(r), i++;
446
- i < e.length && (this._$AR(o && o._$AB.nextSibling, i), e.length = i);
447
- }
448
- _$AR(t = this._$AA.nextSibling, e) {
449
- for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
450
- const o = t.nextSibling;
451
- t.remove(), t = o;
452
- }
453
- }
454
- setConnected(t) {
455
- this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
456
- }
457
- }
458
- class I {
459
- get tagName() {
460
- return this.element.tagName;
461
- }
462
- get _$AU() {
463
- return this._$AM._$AU;
464
- }
465
- constructor(t, e, o, i, r) {
466
- this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = r, o.length > 2 || o[0] !== "" || o[1] !== "" ? (this._$AH = Array(o.length - 1).fill(new String()), this.strings = o) : this._$AH = p;
467
- }
468
- _$AI(t, e = this, o, i) {
469
- const r = this.strings;
470
- let n = !1;
471
- if (r === void 0) t = S(this, t, e, 0), n = !P(t) || t !== this._$AH && t !== z, n && (this._$AH = t);
472
- else {
473
- const d = t;
474
- let a, h;
475
- for (t = r[0], a = 0; a < r.length - 1; a++) h = S(this, d[o + a], e, a), h === z && (h = this._$AH[a]), n ||= !P(h) || h !== this._$AH[a], h === p ? t = p : t !== p && (t += (h ?? "") + r[a + 1]), this._$AH[a] = h;
476
- }
477
- n && !i && this.j(t);
478
- }
479
- j(t) {
480
- t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
481
- }
482
- }
483
- class Pt extends I {
484
- constructor() {
485
- super(...arguments), this.type = 3;
486
- }
487
- j(t) {
488
- this.element[this.name] = t === p ? void 0 : t;
489
- }
490
- }
491
- class zt extends I {
492
- constructor() {
493
- super(...arguments), this.type = 4;
494
- }
495
- j(t) {
496
- this.element.toggleAttribute(this.name, !!t && t !== p);
497
- }
498
- }
499
- class Bt extends I {
500
- constructor(t, e, o, i, r) {
501
- super(t, e, o, i, r), this.type = 5;
502
- }
503
- _$AI(t, e = this) {
504
- if ((t = S(this, t, e, 0) ?? p) === z) return;
505
- const o = this._$AH, i = t === p && o !== p || t.capture !== o.capture || t.once !== o.once || t.passive !== o.passive, r = t !== p && (o === p || i);
506
- i && this.element.removeEventListener(this.name, this, o), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
507
- }
508
- handleEvent(t) {
509
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
510
- }
511
- }
512
- class qt {
513
- constructor(t, e, o) {
514
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = o;
515
- }
516
- get _$AU() {
517
- return this._$AM._$AU;
518
- }
519
- _$AI(t) {
520
- S(this, t);
521
- }
522
- }
523
- const Ut = F.litHtmlPolyfillSupport;
524
- Ut?.(B, H), (F.litHtmlVersions ??= []).push("3.3.1");
525
- /**
526
- * @license
527
- * Copyright 2018 Google LLC
528
- * SPDX-License-Identifier: BSD-3-Clause
529
- */
530
- const V = (s) => s ?? p, ht = ut`
531
- :host {
532
- /* Global Radiobutton Styles */
533
- --_nys-radiobutton-size: var(--nys-size-400, 32px);
534
- --_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);
535
- --_nys-radiobutton-border-width: var(--nys-border-width-md, 2px);
536
- --_nys-radiobutton-outline-color: var(--nys-color-focus, #004dd1);
537
- --_nys-radiobutton-outline-width: var(--nys-border-width-md, 2px);
538
- --_nys-radiobutton-outline-offset: var(--nys-space-2px, 2px);
539
- /* space between radio and it's label */
540
- --_nys-radiobutton-gap: var(--nys-space-150, 12px);
541
- /* space between radio buttons */
542
- --_nys-radiogroup-gap: var(--nys-space-200, 16px);
543
-
544
- /* Typography */
545
- --_nys-radiobutton-font-family: var(
546
- --nys-font-family-ui,
547
- var(
548
- --nys-font-family-sans,
549
- "Proxima Nova",
550
- "Helvetica Neue",
551
- "Helvetica",
552
- "Arial",
553
- sans-serif
554
- )
555
- );
556
- --_nys-radiobutton-font-size: var(--nys-font-size-ui-md, 16px);
557
- --_nys-radiobutton-font-weight--label: var(--nys-font-weight-regular, 400);
558
- --_nys-radiobutton-line-height: var(--nys-font-lineheight-ui-md, 24px);
559
-
560
- /* Global Radio Button Colors */
561
- --_nys-radiobutton-color: var(
562
- --nys-color-text,
563
- var(--nys-color-neutral-900, #1b1b1b)
564
- );
565
-
566
- /* Default (Empty) */
567
- --_nys-radiobutton-background-color: var(--nys-color-ink-reverse, #ffffff);
568
- --_nys-radiobutton-border-color: var(--nys-color-neutral-600, #62666a);
569
- /* Empty + Hovered */
570
- --_nys-radiobutton-background-color--hover: var(
571
- --nys-color-neutral-50,
572
- #ededed
573
- );
574
- --_nys-radiobutton-border-color--hover: var(--nys-color-ink, #1b1b1b);
575
- /* Empty + Pressed */
576
- --_nys-radiobutton-background-color--active: var(
577
- --nys-color-neutral-100,
578
- #d0d0ce
579
- );
580
- --_nys-radiobutton-border-color--active: var(--nys-color-ink, #1b1b1b);
581
- /* Checked */
582
- --_nys-radiobutton-background-color--checked: var(
583
- --nys-color-theme,
584
- #154973
585
- );
586
- /* Disabled */
587
- --_nys-radiobutton-background-color--disabled: var(
588
- --nys-color-ink-reverse,
589
- #f0f0f0
590
- );
591
- --_nys-radiobutton-color--disabled: var(--nys-color-text-disabled, #bec0c1);
592
- --_nys-radiobutton-border-color--disabled: var(
593
- --nys-color-neutral-100,
594
- #d0d0ce
595
- );
596
- /* Disabled Checked */
597
- --_nys-radiobutton-background-color--checked--disabled: var(
598
- --nys-color-neutral-100,
599
- #d0d0ce
600
- );
601
- --_nys-radiobutton-border-color--checked--disabled: var(
602
- --nys-color-neutral-100,
603
- #d0d0ce
604
- );
605
- }
606
-
607
- /* Small Variant */
608
- :host([size="sm"]) {
609
- --_nys-radiobutton-size: var(--nys-size-300, 24px);
610
- --_nys-radiobutton-border-radius: var(--nys-radius-sm, 2px);
611
- --_nys-radiogroup-gap: var(--nys-space-100, 8px);
612
- --_nys-radiobutton-gap: var(--nys-space-100, 8px);
613
- }
614
- /* Medium Variant */
615
- :host([size="md"]) {
616
- --_nys-radiobutton-size: var(--nys-size-400, 32px);
617
- --_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);
618
- --_nys-radiogroup-gap: var(--nys-space-200, 16px);
619
- --_nys-radiobutton-gap: var(--nys-space-150, 12px);
620
- }
621
-
622
- /* Tile Variant */
623
- :host([tile]) {
624
- --_nys-radiobutton-font-weight--label: var(--nys-font-weight-semibold, 600);
625
- --_nys-radiobutton-border-width--tile: var(--nys-border-width-sm, 1px);
626
- --_nys-radiobutton-border-radius--tile: var(--nys-radius-md, 4px);
627
- --_nys-radiobutton-border-color--tile: var(
628
- --nys-color-neutral-100,
629
- #d0d0ce
630
- );
631
- --_nys-radiobutton-background-color--tile: var(
632
- --nys-color-ink-reverse,
633
- #ffffff
634
- );
635
- --_nys-radiobutton-padding--x--tile: var(--nys-space-250, 20px);
636
- --_nys-radiobutton-padding--y--tile: var(--nys-space-200, 16px);
637
- /* Hover */
638
- --_nys-radiobutton-border-color--tile--hover: var(
639
- --nys-color-neutral-700,
640
- #4a4d4f
641
- );
642
- --_nys-radiobutton-background-color--tile--hover: var(
643
- --nys-color-ink-reverse,
644
- #ffffff
645
- );
646
- /* Pressed */
647
- --_nys-radiobutton-border-color--tile--active: var(
648
- --nys-color-neutral-900,
649
- #1b1b1b
650
- );
651
- --_nys-radiobutton-background-color--tile--active: var(
652
- --nys-color-ink-reverse,
653
- #ffffff
654
- );
655
- /* Checked */
656
- --_nys-radiobutton-border-color--tile--checked: var(
657
- --nys-color-theme-mid,
658
- #457aa5
659
- );
660
- --_nys-radiobutton-background-color--tile--checked: var(
661
- --nys-color-theme-faint,
662
- #f7fafd
663
- );
664
- /* Disabled */
665
- --_nys-radiobutton-border-color--tile--disabled: var(
666
- --nys-color-ink-reverse,
667
- #f0f0f0
668
- );
669
- --_nys-radiobutton-background-color--tile--disabled: var(
670
- --nys-color-neutral-100,
671
- #d0d0ce
672
- );
673
- }
674
-
675
- :host([tile][size="sm"]) {
676
- --_nys-radiobutton-padding--x--tile: var(--nys-space-200, 16px);
677
- --_nys-radiobutton-padding--y--tile: var(--nys-space-150, 12px);
678
- }
679
-
680
- :host([tile][showError]) {
681
- --_nys-radiobutton-border-color--tile: var(--nys-color-danger, #b52c2c);
682
- --_nys-radiobutton-border-color--tile--hover: var(
683
- --nys-color-danger,
684
- #b52c2c
685
- );
686
- --_nys-radiobutton-border-color--tile--active: var(
687
- --nys-color-danger,
688
- #b52c2c
689
- );
690
- --_nys-radiobutton-border-color--tile--checked: var(
691
- --nys-color-danger,
692
- #b52c2c
693
- );
694
- }
695
-
696
- .nys-radiogroup {
697
- display: flex;
698
- flex-direction: column;
699
- gap: var(--nys-space-200, 16px);
700
- font-family: var(--_nys-radiobutton-font-family);
701
- font-size: var(--_nys-radiobutton-font-size);
702
- line-height: var(--_nys-radiobutton-line-height);
703
- }
704
-
705
- .nys-radiogroup__content {
706
- gap: var(--_nys-radiogroup-gap);
707
- display: flex;
708
- flex-direction: column;
709
- }
710
-
711
- .nys-radiobutton {
712
- display: flex;
713
- align-items: center;
714
- font-family: var(--_nys-radiobutton-font-family);
715
- font-size: var(--_nys-radiobutton-font-size);
716
- line-height: var(--_nys-radiobutton-line-height);
717
-
718
- /* Tile */
719
- border-radius: var(--_nys-radiobutton-border-radius--tile);
720
- border: var(--_nys-radiobutton-border-width--tile) solid
721
- var(--_nys-radiobutton-border-color--tile);
722
- background-color: var(--_nys-radiobutton-background-color--tile);
723
- padding: var(--_nys-radiobutton-padding--y--tile)
724
- var(--_nys-radiobutton-padding--x--tile);
725
- }
726
-
727
- .nys-radiobutton__radio {
728
- appearance: none;
729
- width: var(--_nys-radiobutton-size);
730
- height: var(--_nys-radiobutton-size);
731
- min-width: var(--_nys-radiobutton-size);
732
- min-height: var(--_nys-radiobutton-size);
733
- max-width: var(--_nys-radiobutton-size);
734
- max-height: var(--_nys-radiobutton-size);
735
- border: solid var(--_nys-radiobutton-border-width)
736
- var(--_nys-radiobutton-border-color);
737
- background-color: var(--_nys-radiobutton-background-color);
738
- border-radius: 100%;
739
- background-repeat: no-repeat;
740
- background-position: center;
741
- background-size: contain;
742
- outline-offset: var(--_nys-radiobutton-outline-offset);
743
- outline: none;
744
- margin: 0 0 auto 0; /* Causes centered radio button if single line of label but top aligned if multiline */
745
- box-sizing: border-box;
746
- }
747
-
748
- /* Pointer cursor for unchecked radio button */
749
- .nys-radiobutton:hover,
750
- .nys-radiobutton:hover * {
751
- cursor: pointer;
752
- }
753
-
754
- /* Checked */
755
- input:not(:disabled):checked + .nys-radiobutton .nys-radiobutton__radio {
756
- background-image: url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');
757
- background-color: var(--_nys-radiobutton-background-color--checked);
758
- }
759
- :host([tile])
760
- .nys-radiobutton:has(input:not(:disabled):checked)
761
- + .nys-radiobutton
762
- .nys-radiobutton__radio {
763
- border-color: var(--_nys-radiobutton-border-color--tile--checked);
764
- background-color: var(--_nys-radiobutton-background-color--tile--checked);
765
- }
766
- :host([tile])
767
- .nys-radiobutton:has(input:not(:disabled):checked:hover)
768
- + .nys-radiobutton
769
- .nys-radiobutton__radio {
770
- cursor: default;
771
- }
772
-
773
- /* Checked + Disabled */
774
- input:disabled:checked + .nys-radiobutton .nys-radiobutton__radio {
775
- background-image: url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');
776
- border-color: var(--_nys-radiobutton-border-color--checked--disabled);
777
- background-color: var(
778
- --_nys-radiobutton-background-color--checked--disabled
779
- );
780
- }
781
-
782
- :host([tile])
783
- .nys-radiobutton:has(input:disabled:checked)
784
- + .nys-radiobutton
785
- .nys-radiobutton__radio {
786
- border-color: var(--_nys-radiobutton-background-color--tile--disabled);
787
- background-color: var(--_nys-radiobutton-border-color--tile--disabled);
788
- }
789
-
790
- /* Disabled */
791
- input:disabled + .nys-radiobutton,
792
- input:disabled + .nys-radiobutton * {
793
- cursor: not-allowed;
794
- }
795
-
796
- input:disabled + .nys-radiobutton .nys-radiobutton__radio {
797
- background-color: var(--_nys-radiobutton-background-color--disabled);
798
- border-color: var(--_nys-radiobutton-border-color--disabled);
799
- cursor: not-allowed;
800
- }
801
- :host([tile])
802
- .nys-radiobutton:has(input:disabled)
803
- + .nys-radiobutton
804
- .nys-radiobutton__radio {
805
- background-color: var(--_nys-radiobutton-background-color--disabled);
806
- border-color: var(--_nys-radiobutton-border-color--disabled);
807
- cursor: not-allowed;
808
- }
809
-
810
- /* Hover - only allow hover on unchecked */
811
- input:hover:not(:disabled):not(:checked)
812
- + .nys-radiobutton
813
- .nys-radiobutton__radio {
814
- border-color: var(--_nys-radiobutton-border-color--hover);
815
- background-color: var(--_nys-radiobutton-background-color--hover);
816
- }
817
- :host([tile])
818
- .nys-radiobutton:has(
819
- input:hover:not(:disabled):not(:checked)
820
- + .nys-radiobutton
821
- .nys-radiobutton__radio
822
- ) {
823
- border-color: var(--_nys-radiobutton-border-color--tile--hover);
824
- background-color: var(--_nys-radiobutton-background-color--tile--hover);
825
- outline: solid var(--_nys-radiobutton-border-width--tile)
826
- var(--_nys-radiobutton-border-color--tile--hover);
827
- }
828
-
829
- /* Pressed - only allow pressed on unchecked */
830
- input:active:not(:disabled):not(:checked)
831
- + .nys-radiobutton
832
- .nys-radiobutton__radio {
833
- border-color: var(--_nys-radiobutton-border-color--active);
834
- background-color: var(--_nys-radiobutton-background-color--active);
835
- }
836
- :host([tile])
837
- .nys-radiobutton:has(
838
- input:active:not(:disabled):not(:checked)
839
- + .nys-radiobutton
840
- .nys-radiobutton__radio
841
- ) {
842
- border-color: var(--_nys-radiobutton-border-color--tile--active);
843
- background-color: var(--_nys-radiobutton-background-color--tile--active);
844
- outline: solid var(--_nys-radiobutton-border-width--tile)
845
- var(--_nys-radiobutton-border-color--tile--active);
846
- }
847
-
848
- /* Focused */
849
- :host:focus-visible,
850
- :host(.active-focus) {
851
- outline: solid var(--_nys-radiobutton-outline-width)
852
- var(--_nys-radiobutton-outline-color);
853
- }
854
-
855
- .nys-radiobutton > nys-label {
856
- --_nys-label-font-weight: var(--_nys-radiobutton-font-weight--label);
857
- display: flex;
858
- padding-inline-start: var(--_nys-radiobutton-gap);
859
- }
860
-
861
- :host([tile]) .nys-radiobutton > nys-label {
862
- --_nys-description-font-style: normal;
863
- }
864
-
865
- input:disabled + .nys-radiobutton > nys-label,
866
- input:disabled + .nys-radiobutton > nys-label * {
867
- cursor: not-allowed;
868
- --_nys-label-cursor: not-allowed;
869
- --_nys-label-color: var(--_nys-radiobutton-color--disabled);
870
- --_nys-description-color: var(--_nys-radiobutton-color--disabled);
871
- color: var(--_nys-radiobutton-color--disabled);
872
- }
873
-
874
- /* Screen readers ONLY */
875
- fieldset {
876
- all: unset;
877
- display: contents;
878
- }
879
-
880
- .sr-only {
881
- position: absolute;
882
- width: 1px;
883
- height: 1px;
884
- padding: 0;
885
- margin: -1px;
886
- overflow: hidden;
887
- border: 0;
888
- }
889
- `;
890
- var Tt = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, f = (s, t, e, o) => {
891
- for (var i = o > 1 ? void 0 : o ? Ot(t, e) : t, r = s.length - 1, n; r >= 0; r--)
892
- (n = s[r]) && (i = (o ? n(t, e, i) : n(i)) || i);
893
- return o && i && Tt(t, e, i), i;
1
+ import { LitElement as _, unsafeCSS as g, html as v } from "lit";
2
+ import { property as r, state as m } from "lit/decorators.js";
3
+ import { ifDefined as p } from "lit/directives/if-defined.js";
4
+ const k = `:host{--_nys-radiobutton-size: var(--nys-size-400, 32px);--_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);--_nys-radiobutton-border-width: var(--nys-border-width-md, 2px);--_nys-radiobutton-outline-color: var(--nys-color-focus, #004dd1);--_nys-radiobutton-outline-width: var(--nys-border-width-md, 2px);--_nys-radiobutton-outline-offset: var(--nys-space-2px, 2px);--_nys-radiobutton-gap: var(--nys-space-150, 12px);--_nys-radiogroup-gap: var(--nys-space-200, 16px);--_nys-radiobutton-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-radiobutton-font-size: var(--nys-font-size-ui-md, 16px);--_nys-radiobutton-font-weight--label: var(--nys-font-weight-regular, 400);--_nys-radiobutton-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-radiobutton-color: var( --nys-color-text, var(--nys-color-neutral-900, #1b1b1b) );--_nys-radiobutton-background-color: var(--nys-color-ink-reverse, #ffffff);--_nys-radiobutton-border-color: var(--nys-color-neutral-600, #62666a);--_nys-radiobutton-background-color--hover: var( --nys-color-neutral-50, #ededed );--_nys-radiobutton-border-color--hover: var(--nys-color-ink, #1b1b1b);--_nys-radiobutton-background-color--active: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-border-color--active: var(--nys-color-ink, #1b1b1b);--_nys-radiobutton-background-color--checked: var( --nys-color-theme, #154973 );--_nys-radiobutton-background-color--disabled: var( --nys-color-ink-reverse, #f0f0f0 );--_nys-radiobutton-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-radiobutton-border-color--disabled: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-background-color--checked--disabled: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-border-color--checked--disabled: var( --nys-color-neutral-100, #d0d0ce )}:host([size=sm]){--_nys-radiobutton-size: var(--nys-size-300, 24px);--_nys-radiobutton-border-radius: var(--nys-radius-sm, 2px);--_nys-radiogroup-gap: var(--nys-space-100, 8px);--_nys-radiobutton-gap: var(--nys-space-100, 8px)}:host([size=md]){--_nys-radiobutton-size: var(--nys-size-400, 32px);--_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);--_nys-radiogroup-gap: var(--nys-space-200, 16px);--_nys-radiobutton-gap: var(--nys-space-150, 12px)}:host([tile]){--_nys-radiobutton-font-weight--label: var(--nys-font-weight-semibold, 600);--_nys-radiobutton-border-width--tile: var(--nys-border-width-sm, 1px);--_nys-radiobutton-border-radius--tile: var(--nys-radius-md, 4px);--_nys-radiobutton-border-color--tile: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-background-color--tile: var( --nys-color-ink-reverse, #ffffff );--_nys-radiobutton-padding--x--tile: var(--nys-space-250, 20px);--_nys-radiobutton-padding--y--tile: var(--nys-space-200, 16px);--_nys-radiobutton-border-color--tile--hover: var( --nys-color-neutral-700, #4a4d4f );--_nys-radiobutton-background-color--tile--hover: var( --nys-color-ink-reverse, #ffffff );--_nys-radiobutton-border-color--tile--active: var( --nys-color-neutral-900, #1b1b1b );--_nys-radiobutton-background-color--tile--active: var( --nys-color-ink-reverse, #ffffff );--_nys-radiobutton-border-color--tile--checked: var( --nys-color-theme-mid, #457aa5 );--_nys-radiobutton-background-color--tile--checked: var( --nys-color-theme-faint, #f7fafd );--_nys-radiobutton-border-color--tile--disabled: var( --nys-color-ink-reverse, #f0f0f0 );--_nys-radiobutton-background-color--tile--disabled: var( --nys-color-neutral-100, #d0d0ce )}:host([tile][size=sm]){--_nys-radiobutton-padding--x--tile: var(--nys-space-200, 16px);--_nys-radiobutton-padding--y--tile: var(--nys-space-150, 12px)}:host([tile][showError]){--_nys-radiobutton-border-color--tile: var(--nys-color-danger, #b52c2c);--_nys-radiobutton-border-color--tile--hover: var( --nys-color-danger, #b52c2c );--_nys-radiobutton-border-color--tile--active: var( --nys-color-danger, #b52c2c );--_nys-radiobutton-border-color--tile--checked: var( --nys-color-danger, #b52c2c )}.nys-radiogroup{display:flex;flex-direction:column;gap:var(--nys-space-200, 16px);font-family:var(--_nys-radiobutton-font-family);font-size:var(--_nys-radiobutton-font-size);line-height:var(--_nys-radiobutton-line-height)}.nys-radiogroup__content{gap:var(--_nys-radiogroup-gap);display:flex;flex-direction:column}.nys-radiobutton{display:flex;align-items:center;font-family:var(--_nys-radiobutton-font-family);font-size:var(--_nys-radiobutton-font-size);line-height:var(--_nys-radiobutton-line-height);border-radius:var(--_nys-radiobutton-border-radius--tile);border:var(--_nys-radiobutton-border-width--tile) solid var(--_nys-radiobutton-border-color--tile);background-color:var(--_nys-radiobutton-background-color--tile);padding:var(--_nys-radiobutton-padding--y--tile) var(--_nys-radiobutton-padding--x--tile)}.nys-radiobutton__radio{appearance:none;width:var(--_nys-radiobutton-size);height:var(--_nys-radiobutton-size);min-width:var(--_nys-radiobutton-size);min-height:var(--_nys-radiobutton-size);max-width:var(--_nys-radiobutton-size);max-height:var(--_nys-radiobutton-size);border:solid var(--_nys-radiobutton-border-width) var(--_nys-radiobutton-border-color);background-color:var(--_nys-radiobutton-background-color);border-radius:100%;background-repeat:no-repeat;background-position:center;background-size:contain;outline-offset:var(--_nys-radiobutton-outline-offset);outline:none;margin:0 0 auto;box-sizing:border-box}.nys-radiobutton:hover,.nys-radiobutton:hover *{cursor:pointer}input:not(:disabled):checked+.nys-radiobutton .nys-radiobutton__radio{background-image:url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');background-color:var(--_nys-radiobutton-background-color--checked)}:host([tile]) .nys-radiobutton:has(input:not(:disabled):checked)+.nys-radiobutton .nys-radiobutton__radio{border-color:var(--_nys-radiobutton-border-color--tile--checked);background-color:var(--_nys-radiobutton-background-color--tile--checked)}:host([tile]) .nys-radiobutton:has(input:not(:disabled):checked:hover)+.nys-radiobutton .nys-radiobutton__radio{cursor:default}input:disabled:checked+.nys-radiobutton .nys-radiobutton__radio{background-image:url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');border-color:var(--_nys-radiobutton-border-color--checked--disabled);background-color:var(--_nys-radiobutton-background-color--checked--disabled)}:host([tile]) .nys-radiobutton:has(input:disabled:checked)+.nys-radiobutton .nys-radiobutton__radio{border-color:var(--_nys-radiobutton-background-color--tile--disabled);background-color:var(--_nys-radiobutton-border-color--tile--disabled)}input:disabled+.nys-radiobutton,input:disabled+.nys-radiobutton *{cursor:not-allowed}input:disabled+.nys-radiobutton .nys-radiobutton__radio{background-color:var(--_nys-radiobutton-background-color--disabled);border-color:var(--_nys-radiobutton-border-color--disabled);cursor:not-allowed}:host([tile]) .nys-radiobutton:has(input:disabled)+.nys-radiobutton .nys-radiobutton__radio{background-color:var(--_nys-radiobutton-background-color--disabled);border-color:var(--_nys-radiobutton-border-color--disabled);cursor:not-allowed}input:hover:not(:disabled):not(:checked)+.nys-radiobutton .nys-radiobutton__radio{border-color:var(--_nys-radiobutton-border-color--hover);background-color:var(--_nys-radiobutton-background-color--hover)}:host([tile]) .nys-radiobutton:has(input:hover:not(:disabled):not(:checked)+.nys-radiobutton .nys-radiobutton__radio){border-color:var(--_nys-radiobutton-border-color--tile--hover);background-color:var(--_nys-radiobutton-background-color--tile--hover);outline:solid var(--_nys-radiobutton-border-width--tile) var(--_nys-radiobutton-border-color--tile--hover)}input:active:not(:disabled):not(:checked)+.nys-radiobutton .nys-radiobutton__radio{border-color:var(--_nys-radiobutton-border-color--active);background-color:var(--_nys-radiobutton-background-color--active)}:host([tile]) .nys-radiobutton:has(input:active:not(:disabled):not(:checked)+.nys-radiobutton .nys-radiobutton__radio){border-color:var(--_nys-radiobutton-border-color--tile--active);background-color:var(--_nys-radiobutton-background-color--tile--active);outline:solid var(--_nys-radiobutton-border-width--tile) var(--_nys-radiobutton-border-color--tile--active)}:host:focus-visible,:host(.active-focus){outline:solid var(--_nys-radiobutton-outline-width) var(--_nys-radiobutton-outline-color)}.nys-radiobutton>nys-label{--_nys-label-font-weight: var(--_nys-radiobutton-font-weight--label);display:flex;padding-inline-start:var(--_nys-radiobutton-gap)}:host([tile]) .nys-radiobutton>nys-label{--_nys-description-font-style: normal}input:disabled+.nys-radiobutton>nys-label,input:disabled+.nys-radiobutton>nys-label *{cursor:not-allowed;--_nys-label-cursor: not-allowed;--_nys-label-color: var(--_nys-radiobutton-color--disabled);--_nys-description-color: var(--_nys-radiobutton-color--disabled);color:var(--_nys-radiobutton-color--disabled)}fieldset{all:unset;display:contents}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}`;
5
+ var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, d = (b, t, e, o) => {
6
+ for (var s = o > 1 ? void 0 : o ? x(t, e) : t, c = b.length - 1, n; c >= 0; c--)
7
+ (n = b[c]) && (s = (o ? n(t, e, s) : n(s)) || s);
8
+ return o && s && w(t, e, s), s;
894
9
  };
895
- let Mt = 0;
896
- var m;
897
- const y = (m = class extends st {
10
+ let E = 0;
11
+ var h;
12
+ const a = (h = class extends _ {
898
13
  // allows use of elementInternals' API
899
14
  constructor() {
900
15
  super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.tile = !1, this._tooltip = "", this.inverted = !1, this.form = null, this.selectedValue = null, this._slottedDescriptionText = "", this._size = "md", this._internals = this.attachInternals();
@@ -903,19 +18,19 @@ const y = (m = class extends st {
903
18
  return this._size;
904
19
  }
905
20
  set size(t) {
906
- this._size = m.VALID_SIZES.includes(
21
+ this._size = h.VALID_SIZES.includes(
907
22
  t
908
23
  ) ? t : "md";
909
24
  }
910
25
  // Generate a unique ID if one is not provided
911
26
  connectedCallback() {
912
- super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${Mt++}`), this.addEventListener("nys-change", this._handleRadioButtonChange), this.addEventListener("invalid", this._handleInvalid);
27
+ super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${E++}`), this.addEventListener("nys-change", this._handleRadioButtonChange), this.addEventListener("invalid", this._handleInvalid);
913
28
  }
914
29
  disconnectedCallback() {
915
30
  super.disconnectedCallback(), this.removeEventListener("nys-change", this._handleRadioButtonChange), this.removeEventListener("invalid", this._handleInvalid);
916
31
  }
917
32
  async firstUpdated() {
918
- this._initializeCheckedRadioValue(), this._setValue(), this._setRadioButtonRequire(), this._updateRadioButtonsSize(), this._updateRadioButtonsTile(), this._updateRadioButtonsShowError(), this._getSlotDescriptionForAria(), await this.updateComplete, this._initializeChildAttributes(), this._updateGroupTabIndex();
33
+ await this.updateComplete, this._initializeCheckedRadioValue(), this._setValue(), this._setRadioButtonRequire(), this._updateRadioButtonsSize(), this._updateRadioButtonsTile(), this._updateRadioButtonsShowError(), this._getSlotDescriptionForAria(), this._initializeChildAttributes(), this._updateGroupTabIndex();
919
34
  }
920
35
  updated(t) {
921
36
  (t.has("required") || t.has("selectedValue")) && this._manageRequire(), t.has("size") && this._updateRadioButtonsSize(), t.has("tile") && this._updateRadioButtonsTile(), t.has("inverted") && this._updateRadioButtonsInvert(), t.has("showError") && this._updateRadioButtonsShowError(), t.has("form") && this._updateRadioButtonsForm();
@@ -972,11 +87,11 @@ const y = (m = class extends st {
972
87
  "Enter"
973
88
  ].includes(t.key)) return;
974
89
  t.preventDefault();
975
- const o = this._getAllRadios().filter((h) => !h.disabled), i = o.find((h) => h.checked) || o[0], r = t.key === " " || t.key === "Enter" ? 0 : ["ArrowUp", "ArrowLeft"].includes(t.key) ? -1 : 1;
976
- let n = o.indexOf(i) + r;
90
+ const o = this._getAllRadios().filter((y) => !y.disabled), s = o.find((y) => y.checked) || o[0], c = t.key === " " || t.key === "Enter" ? 0 : ["ArrowUp", "ArrowLeft"].includes(t.key) ? -1 : 1;
91
+ let n = o.indexOf(s) + c;
977
92
  n < 0 && (n = o.length - 1), n >= o.length && (n = 0);
978
- const d = o[n];
979
- (await d.getInputElement())?.click(), this._updateGroupTabIndex(), d.focus();
93
+ const f = o[n];
94
+ (await f.getInputElement())?.click(), this._updateGroupTabIndex(), f.focus();
980
95
  }
981
96
  _updateGroupTabIndex() {
982
97
  const t = this._getAllRadios(), e = t.find((o) => o.checked) || t[0];
@@ -1027,8 +142,8 @@ const y = (m = class extends st {
1027
142
  /******************** Event Handlers ********************/
1028
143
  // Keeps radiogroup informed of the name and value of its current selected radiobutton at each change
1029
144
  _handleRadioButtonChange(t) {
1030
- const e = t, { name: o, value: i } = e.detail;
1031
- this.name = o, this.selectedValue = i, this._internals.setFormValue(this.selectedValue), this._updateGroupTabIndex();
145
+ const e = t, { name: o, value: s } = e.detail;
146
+ this.name = o, this.selectedValue = s, this._internals.setFormValue(this.selectedValue), this._updateGroupTabIndex();
1032
147
  }
1033
148
  async _handleInvalid(t) {
1034
149
  if (t.preventDefault(), this._internals.validity.valueMissing) {
@@ -1045,9 +160,8 @@ const y = (m = class extends st {
1045
160
  }
1046
161
  }
1047
162
  render() {
1048
- return L`<div class="nys-radiogroup">
163
+ return v`<div class="nys-radiogroup">
1049
164
  <nys-label
1050
- for=${this.id}
1051
165
  label=${this.label}
1052
166
  description=${this.description}
1053
167
  flag=${this.required ? "required" : this.optional ? "optional" : ""}
@@ -1071,62 +185,62 @@ const y = (m = class extends st {
1071
185
  ></nys-errormessage>
1072
186
  </div>`;
1073
187
  }
1074
- }, m.VALID_SIZES = ["sm", "md"], m.styles = ht, m.formAssociated = !0, m);
1075
- f([
1076
- l({ type: String })
1077
- ], y.prototype, "id", 2);
1078
- f([
1079
- l({ type: String, reflect: !0 })
1080
- ], y.prototype, "name", 2);
1081
- f([
1082
- l({ type: Boolean, reflect: !0 })
1083
- ], y.prototype, "required", 2);
1084
- f([
1085
- l({ type: Boolean, reflect: !0 })
1086
- ], y.prototype, "optional", 2);
1087
- f([
1088
- l({ type: Boolean, reflect: !0 })
1089
- ], y.prototype, "showError", 2);
1090
- f([
1091
- l({ type: String })
1092
- ], y.prototype, "errorMessage", 2);
1093
- f([
1094
- l({ type: String })
1095
- ], y.prototype, "label", 2);
1096
- f([
1097
- l({ type: String })
1098
- ], y.prototype, "description", 2);
1099
- f([
1100
- l({ type: Boolean, reflect: !0 })
1101
- ], y.prototype, "tile", 2);
1102
- f([
1103
- l({ type: String })
1104
- ], y.prototype, "_tooltip", 2);
1105
- f([
1106
- l({ type: Boolean, reflect: !0 })
1107
- ], y.prototype, "inverted", 2);
1108
- f([
1109
- l({ type: String, reflect: !0 })
1110
- ], y.prototype, "form", 2);
1111
- f([
1112
- nt()
1113
- ], y.prototype, "selectedValue", 2);
1114
- f([
1115
- nt()
1116
- ], y.prototype, "_slottedDescriptionText", 2);
1117
- f([
1118
- l({ reflect: !0 })
1119
- ], y.prototype, "size", 1);
1120
- let Dt = y;
1121
- customElements.get("nys-radiogroup") || customElements.define("nys-radiogroup", Dt);
1122
- var Ht = Object.defineProperty, It = Object.getOwnPropertyDescriptor, v = (s, t, e, o) => {
1123
- for (var i = o > 1 ? void 0 : o ? It(t, e) : t, r = s.length - 1, n; r >= 0; r--)
1124
- (n = s[r]) && (i = (o ? n(t, e, i) : n(i)) || i);
1125
- return o && i && Ht(t, e, i), i;
188
+ }, h.styles = g(k), h.VALID_SIZES = ["sm", "md"], h.formAssociated = !0, h);
189
+ d([
190
+ r({ type: String, reflect: !0 })
191
+ ], a.prototype, "id", 2);
192
+ d([
193
+ r({ type: String, reflect: !0 })
194
+ ], a.prototype, "name", 2);
195
+ d([
196
+ r({ type: Boolean, reflect: !0 })
197
+ ], a.prototype, "required", 2);
198
+ d([
199
+ r({ type: Boolean, reflect: !0 })
200
+ ], a.prototype, "optional", 2);
201
+ d([
202
+ r({ type: Boolean, reflect: !0 })
203
+ ], a.prototype, "showError", 2);
204
+ d([
205
+ r({ type: String })
206
+ ], a.prototype, "errorMessage", 2);
207
+ d([
208
+ r({ type: String })
209
+ ], a.prototype, "label", 2);
210
+ d([
211
+ r({ type: String })
212
+ ], a.prototype, "description", 2);
213
+ d([
214
+ r({ type: Boolean, reflect: !0 })
215
+ ], a.prototype, "tile", 2);
216
+ d([
217
+ r({ type: String })
218
+ ], a.prototype, "_tooltip", 2);
219
+ d([
220
+ r({ type: Boolean, reflect: !0 })
221
+ ], a.prototype, "inverted", 2);
222
+ d([
223
+ r({ type: String, reflect: !0 })
224
+ ], a.prototype, "form", 2);
225
+ d([
226
+ m()
227
+ ], a.prototype, "selectedValue", 2);
228
+ d([
229
+ m()
230
+ ], a.prototype, "_slottedDescriptionText", 2);
231
+ d([
232
+ r({ reflect: !0 })
233
+ ], a.prototype, "size", 1);
234
+ let A = a;
235
+ customElements.get("nys-radiogroup") || customElements.define("nys-radiogroup", A);
236
+ var S = Object.defineProperty, B = Object.getOwnPropertyDescriptor, u = (b, t, e, o) => {
237
+ for (var s = o > 1 ? void 0 : o ? B(t, e) : t, c = b.length - 1, n; c >= 0; c--)
238
+ (n = b[c]) && (s = (o ? n(t, e, s) : n(s)) || s);
239
+ return o && s && S(t, e, s), s;
1126
240
  };
1127
- let Nt = 0;
1128
- var u;
1129
- const _ = (u = class extends st {
241
+ let z = 0;
242
+ var i;
243
+ const l = (i = class extends _ {
1130
244
  constructor() {
1131
245
  super(...arguments), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this.inverted = !1, this.form = null, this._size = "md", this.tile = !1;
1132
246
  }
@@ -1134,7 +248,7 @@ const _ = (u = class extends st {
1134
248
  return this._size;
1135
249
  }
1136
250
  set size(t) {
1137
- this._size = u.VALID_SIZES.includes(
251
+ this._size = i.VALID_SIZES.includes(
1138
252
  t
1139
253
  ) ? t : "md";
1140
254
  }
@@ -1148,13 +262,13 @@ const _ = (u = class extends st {
1148
262
  /********************** Lifecycle updates **********************/
1149
263
  // Generate a unique ID if one is not provided
1150
264
  connectedCallback() {
1151
- super.connectedCallback(), this.id || (this.id = `nys-radiobutton-${Date.now()}-${Nt++}`), this.checked && (u.buttonGroup[this.name] && (u.buttonGroup[this.name].checked = !1, u.buttonGroup[this.name].requestUpdate()), u.buttonGroup[this.name] = this), this.addEventListener("focus", this._handleFocus), this.addEventListener("blur", this._handleBlur), this.addEventListener("click", this._handleChange);
265
+ super.connectedCallback(), this.id || (this.id = `nys-radiobutton-${Date.now()}-${z++}`), this.checked && (i.buttonGroup[this.name] && (i.buttonGroup[this.name].checked = !1, i.buttonGroup[this.name].requestUpdate()), i.buttonGroup[this.name] = this), this.addEventListener("focus", this._handleFocus), this.addEventListener("blur", this._handleBlur), this.addEventListener("click", this._handleChange);
1152
266
  }
1153
267
  disconnectedCallback() {
1154
268
  super.disconnectedCallback(), this.removeEventListener("focus", this._handleFocus), this.removeEventListener("blur", this._handleBlur);
1155
269
  }
1156
270
  updated(t) {
1157
- t.has("checked") && this.checked && u.buttonGroup[this.name] !== this && (u.buttonGroup[this.name] && (u.buttonGroup[this.name].checked = !1, u.buttonGroup[this.name].requestUpdate()), u.buttonGroup[this.name] = this);
271
+ t.has("checked") && this.checked && i.buttonGroup[this.name] !== this && (i.buttonGroup[this.name] && (i.buttonGroup[this.name].checked = !1, i.buttonGroup[this.name].requestUpdate()), i.buttonGroup[this.name] = this);
1158
272
  }
1159
273
  /********************** Functions **********************/
1160
274
  // This helper function is called to perform the element's native validation.
@@ -1181,7 +295,7 @@ const _ = (u = class extends st {
1181
295
  }
1182
296
  // Handle radiobutton change event & unselection of other options in group
1183
297
  _handleChange() {
1184
- this.classList.remove("active-focus"), !this.checked && !this.disabled && (u.buttonGroup[this.name] && (u.buttonGroup[this.name].checked = !1, u.buttonGroup[this.name].requestUpdate()), u.buttonGroup[this.name] = this, this.checked = !0, this._emitChangeEvent());
298
+ this.classList.remove("active-focus"), !this.checked && !this.disabled && (i.buttonGroup[this.name] && (i.buttonGroup[this.name].checked = !1, i.buttonGroup[this.name].requestUpdate()), i.buttonGroup[this.name] = this, this.checked = !0, this._emitChangeEvent());
1185
299
  }
1186
300
  // Handle focus event
1187
301
  _handleFocus() {
@@ -1199,79 +313,76 @@ const _ = (u = class extends st {
1199
313
  t && (t.focus(), t.click());
1200
314
  }
1201
315
  render() {
1202
- return L`
316
+ return v`
1203
317
  <input
1204
- id="${this.id}"
1205
318
  type="radio"
1206
- name="${V(this.name ? this.name : void 0)}"
319
+ name="${p(this.name ? this.name : void 0)}"
1207
320
  .checked=${this.checked}
1208
321
  ?disabled=${this.disabled}
1209
322
  .value=${this.value}
1210
323
  ?required="${this.required}"
1211
- form=${V(this.form || void 0)}
324
+ form=${p(this.form || void 0)}
1212
325
  @change="${this._handleChange}"
1213
326
  hidden
1214
327
  aria-hidden="true"
1215
328
  />
1216
- <label
329
+ <div
1217
330
  class="nys-radiobutton"
1218
- for="${this.id}"
1219
331
  @click="${this._callInputHandling}"
1220
332
  aria-label=${this.label}
1221
333
  >
1222
334
  <span class="nys-radiobutton__radio"></span>
1223
- ${this.label && L`<nys-label
1224
- for=${this.id}
335
+ ${this.label && v`<nys-label
1225
336
  label=${this.label}
1226
- description=${V(this.description || void 0)}
337
+ description=${p(this.description || void 0)}
1227
338
  ?inverted=${this.inverted}
1228
339
  >
1229
340
  <slot name="description" slot="description">${this.description}</slot>
1230
341
  </nys-label> `}
1231
- </label>
342
+ </div>
1232
343
  `;
1233
344
  }
1234
- }, u.VALID_SIZES = ["sm", "md"], u.buttonGroup = {}, u.styles = ht, u);
1235
- v([
1236
- l({ type: Boolean, reflect: !0 })
1237
- ], _.prototype, "checked", 2);
1238
- v([
1239
- l({ type: Boolean, reflect: !0 })
1240
- ], _.prototype, "disabled", 2);
1241
- v([
1242
- l({ type: Boolean, reflect: !0 })
1243
- ], _.prototype, "required", 2);
1244
- v([
1245
- l({ type: String })
1246
- ], _.prototype, "label", 2);
1247
- v([
1248
- l({ type: String })
1249
- ], _.prototype, "description", 2);
1250
- v([
1251
- l({ type: String })
1252
- ], _.prototype, "id", 2);
1253
- v([
1254
- l({ type: String, reflect: !0 })
1255
- ], _.prototype, "name", 2);
1256
- v([
1257
- l({ type: String })
1258
- ], _.prototype, "value", 2);
1259
- v([
1260
- l({ type: Boolean, reflect: !0 })
1261
- ], _.prototype, "inverted", 2);
1262
- v([
1263
- l({ type: String, reflect: !0 })
1264
- ], _.prototype, "form", 2);
1265
- v([
1266
- l({ reflect: !0 })
1267
- ], _.prototype, "size", 1);
1268
- v([
1269
- l({ type: Boolean, reflect: !0 })
1270
- ], _.prototype, "tile", 2);
1271
- let Vt = _;
1272
- customElements.get("nys-radiobutton") || customElements.define("nys-radiobutton", Vt);
345
+ }, i.styles = g(k), i.VALID_SIZES = ["sm", "md"], i.buttonGroup = {}, i);
346
+ u([
347
+ r({ type: Boolean, reflect: !0 })
348
+ ], l.prototype, "checked", 2);
349
+ u([
350
+ r({ type: Boolean, reflect: !0 })
351
+ ], l.prototype, "disabled", 2);
352
+ u([
353
+ r({ type: Boolean, reflect: !0 })
354
+ ], l.prototype, "required", 2);
355
+ u([
356
+ r({ type: String })
357
+ ], l.prototype, "label", 2);
358
+ u([
359
+ r({ type: String })
360
+ ], l.prototype, "description", 2);
361
+ u([
362
+ r({ type: String, reflect: !0 })
363
+ ], l.prototype, "id", 2);
364
+ u([
365
+ r({ type: String, reflect: !0 })
366
+ ], l.prototype, "name", 2);
367
+ u([
368
+ r({ type: String })
369
+ ], l.prototype, "value", 2);
370
+ u([
371
+ r({ type: Boolean, reflect: !0 })
372
+ ], l.prototype, "inverted", 2);
373
+ u([
374
+ r({ type: String, reflect: !0 })
375
+ ], l.prototype, "form", 2);
376
+ u([
377
+ r({ reflect: !0 })
378
+ ], l.prototype, "size", 1);
379
+ u([
380
+ r({ type: Boolean, reflect: !0 })
381
+ ], l.prototype, "tile", 2);
382
+ let q = l;
383
+ customElements.get("nys-radiobutton") || customElements.define("nys-radiobutton", q);
1273
384
  export {
1274
- Vt as NysRadiobutton,
1275
- Dt as NysRadiogroup
385
+ q as NysRadiobutton,
386
+ A as NysRadiogroup
1276
387
  };
1277
388
  //# sourceMappingURL=nys-radiobutton.js.map