@nysds/nys-textinput 1.1.8 → 1.2.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.
- package/dist/nys-textinput.d.ts +2 -1
- package/dist/nys-textinput.js +1614 -377
- package/dist/nys-textinput.js.map +1 -1
- package/package.json +48 -46
package/dist/nys-textinput.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as qt, LitElement as jt, html as A } from "lit";
|
|
2
2
|
import "@nysds/nys-icon";
|
|
3
3
|
import "@nysds/nys-label";
|
|
4
4
|
import "@nysds/nys-errormessage";
|
|
@@ -17,18 +17,18 @@ import "@nysds/nys-errormessage";
|
|
|
17
17
|
* Copyright 2019 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
19
|
*/
|
|
20
|
-
const
|
|
21
|
-
let
|
|
20
|
+
const Q = globalThis, yt = Q.ShadowRoot && (Q.ShadyCSS === void 0 || Q.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ft = Symbol(), mt = /* @__PURE__ */ new WeakMap();
|
|
21
|
+
let oe = class {
|
|
22
22
|
constructor(t, e, s) {
|
|
23
|
-
if (this._$cssResult$ = !0, s !==
|
|
23
|
+
if (this._$cssResult$ = !0, s !== Ft) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
24
24
|
this.cssText = t, this.t = e;
|
|
25
25
|
}
|
|
26
26
|
get styleSheet() {
|
|
27
27
|
let t = this.o;
|
|
28
28
|
const e = this.t;
|
|
29
|
-
if (
|
|
29
|
+
if (yt && t === void 0) {
|
|
30
30
|
const s = e !== void 0 && e.length === 1;
|
|
31
|
-
s && (t =
|
|
31
|
+
s && (t = mt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && mt.set(e, t));
|
|
32
32
|
}
|
|
33
33
|
return t;
|
|
34
34
|
}
|
|
@@ -36,101 +36,101 @@ let dt = class {
|
|
|
36
36
|
return this.cssText;
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
39
|
+
const ne = (o) => new oe(typeof o == "string" ? o : o + "", void 0, Ft), ie = (o, t) => {
|
|
40
|
+
if (yt) o.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
41
41
|
else for (const e of t) {
|
|
42
|
-
const s = document.createElement("style"),
|
|
43
|
-
|
|
42
|
+
const s = document.createElement("style"), r = Q.litNonce;
|
|
43
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, o.appendChild(s);
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, xt = yt ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((t) => {
|
|
46
46
|
let e = "";
|
|
47
47
|
for (const s of t.cssRules) e += s.cssText;
|
|
48
|
-
return
|
|
49
|
-
})(
|
|
48
|
+
return ne(e);
|
|
49
|
+
})(o) : o;
|
|
50
50
|
/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2017 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
54
|
*/
|
|
55
|
-
const { is:
|
|
55
|
+
const { is: ae, defineProperty: le, getOwnPropertyDescriptor: he, getOwnPropertyNames: ce, getOwnPropertySymbols: de, getPrototypeOf: ue } = Object, I = globalThis, At = I.trustedTypes, pe = At ? At.emptyScript : "", ct = I.reactiveElementPolyfillSupport, j = (o, t) => o, tt = { toAttribute(o, t) {
|
|
56
56
|
switch (t) {
|
|
57
57
|
case Boolean:
|
|
58
|
-
|
|
58
|
+
o = o ? pe : null;
|
|
59
59
|
break;
|
|
60
60
|
case Object:
|
|
61
61
|
case Array:
|
|
62
|
-
|
|
62
|
+
o = o == null ? o : JSON.stringify(o);
|
|
63
63
|
}
|
|
64
|
-
return
|
|
65
|
-
}, fromAttribute(
|
|
66
|
-
let e =
|
|
64
|
+
return o;
|
|
65
|
+
}, fromAttribute(o, t) {
|
|
66
|
+
let e = o;
|
|
67
67
|
switch (t) {
|
|
68
68
|
case Boolean:
|
|
69
|
-
e =
|
|
69
|
+
e = o !== null;
|
|
70
70
|
break;
|
|
71
71
|
case Number:
|
|
72
|
-
e =
|
|
72
|
+
e = o === null ? null : Number(o);
|
|
73
73
|
break;
|
|
74
74
|
case Object:
|
|
75
75
|
case Array:
|
|
76
76
|
try {
|
|
77
|
-
e = JSON.parse(
|
|
77
|
+
e = JSON.parse(o);
|
|
78
78
|
} catch {
|
|
79
79
|
e = null;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
return e;
|
|
83
|
-
} },
|
|
84
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
85
|
-
class
|
|
83
|
+
} }, bt = (o, t) => !ae(o, t), wt = { attribute: !0, type: String, converter: tt, reflect: !1, hasChanged: bt };
|
|
84
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), I.litPropertyMetadata ?? (I.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
85
|
+
let L = class extends HTMLElement {
|
|
86
86
|
static addInitializer(t) {
|
|
87
87
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
88
88
|
}
|
|
89
89
|
static get observedAttributes() {
|
|
90
90
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
91
91
|
}
|
|
92
|
-
static createProperty(t, e =
|
|
92
|
+
static createProperty(t, e = wt) {
|
|
93
93
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
94
|
-
const s = Symbol(),
|
|
95
|
-
|
|
94
|
+
const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
95
|
+
r !== void 0 && le(this.prototype, t, r);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
static getPropertyDescriptor(t, e, s) {
|
|
99
|
-
const { get:
|
|
99
|
+
const { get: r, set: i } = he(this.prototype, t) ?? { get() {
|
|
100
100
|
return this[e];
|
|
101
101
|
}, set(n) {
|
|
102
102
|
this[e] = n;
|
|
103
103
|
} };
|
|
104
104
|
return { get() {
|
|
105
|
-
return
|
|
105
|
+
return r == null ? void 0 : r.call(this);
|
|
106
106
|
}, set(n) {
|
|
107
|
-
const l =
|
|
108
|
-
|
|
107
|
+
const l = r == null ? void 0 : r.call(this);
|
|
108
|
+
i.call(this, n), this.requestUpdate(t, l, s);
|
|
109
109
|
}, configurable: !0, enumerable: !0 };
|
|
110
110
|
}
|
|
111
111
|
static getPropertyOptions(t) {
|
|
112
|
-
return this.elementProperties.get(t) ??
|
|
112
|
+
return this.elementProperties.get(t) ?? wt;
|
|
113
113
|
}
|
|
114
114
|
static _$Ei() {
|
|
115
|
-
if (this.hasOwnProperty(
|
|
116
|
-
const t =
|
|
115
|
+
if (this.hasOwnProperty(j("elementProperties"))) return;
|
|
116
|
+
const t = ue(this);
|
|
117
117
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
118
118
|
}
|
|
119
119
|
static finalize() {
|
|
120
|
-
if (this.hasOwnProperty(
|
|
121
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
122
|
-
const e = this.properties, s = [...
|
|
123
|
-
for (const
|
|
120
|
+
if (this.hasOwnProperty(j("finalized"))) return;
|
|
121
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
|
|
122
|
+
const e = this.properties, s = [...ce(e), ...de(e)];
|
|
123
|
+
for (const r of s) this.createProperty(r, e[r]);
|
|
124
124
|
}
|
|
125
125
|
const t = this[Symbol.metadata];
|
|
126
126
|
if (t !== null) {
|
|
127
127
|
const e = litPropertyMetadata.get(t);
|
|
128
|
-
if (e !== void 0) for (const [s,
|
|
128
|
+
if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
|
|
129
129
|
}
|
|
130
130
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
131
131
|
for (const [e, s] of this.elementProperties) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const r = this._$Eu(e, s);
|
|
133
|
+
r !== void 0 && this._$Eh.set(r, e);
|
|
134
134
|
}
|
|
135
135
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
136
136
|
}
|
|
@@ -138,8 +138,8 @@ class S extends HTMLElement {
|
|
|
138
138
|
const e = [];
|
|
139
139
|
if (Array.isArray(t)) {
|
|
140
140
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
141
|
-
for (const
|
|
142
|
-
} else t !== void 0 && e.push(
|
|
141
|
+
for (const r of s) e.unshift(xt(r));
|
|
142
|
+
} else t !== void 0 && e.push(xt(t));
|
|
143
143
|
return e;
|
|
144
144
|
}
|
|
145
145
|
static _$Eu(t, e) {
|
|
@@ -168,7 +168,7 @@ class S extends HTMLElement {
|
|
|
168
168
|
}
|
|
169
169
|
createRenderRoot() {
|
|
170
170
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
171
|
-
return
|
|
171
|
+
return ie(t, this.constructor.elementStyles), t;
|
|
172
172
|
}
|
|
173
173
|
connectedCallback() {
|
|
174
174
|
var t;
|
|
@@ -190,24 +190,24 @@ class S extends HTMLElement {
|
|
|
190
190
|
this._$AK(t, s);
|
|
191
191
|
}
|
|
192
192
|
_$EC(t, e) {
|
|
193
|
-
var
|
|
194
|
-
const s = this.constructor.elementProperties.get(t),
|
|
195
|
-
if (
|
|
196
|
-
const n = (((
|
|
197
|
-
this._$Em = t, n == null ? this.removeAttribute(
|
|
193
|
+
var i;
|
|
194
|
+
const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
|
|
195
|
+
if (r !== void 0 && s.reflect === !0) {
|
|
196
|
+
const n = (((i = s.converter) == null ? void 0 : i.toAttribute) !== void 0 ? s.converter : tt).toAttribute(e, s.type);
|
|
197
|
+
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
_$AK(t, e) {
|
|
201
|
-
var
|
|
202
|
-
const s = this.constructor,
|
|
203
|
-
if (
|
|
204
|
-
const n = s.getPropertyOptions(
|
|
205
|
-
this._$Em =
|
|
201
|
+
var i;
|
|
202
|
+
const s = this.constructor, r = s._$Eh.get(t);
|
|
203
|
+
if (r !== void 0 && this._$Em !== r) {
|
|
204
|
+
const n = s.getPropertyOptions(r), l = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((i = n.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? n.converter : tt;
|
|
205
|
+
this._$Em = r, this[r] = l.fromAttribute(e, n.type), this._$Em = null;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
requestUpdate(t, e, s) {
|
|
209
209
|
if (t !== void 0) {
|
|
210
|
-
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ??
|
|
210
|
+
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? bt)(this[t], e)) return;
|
|
211
211
|
this.P(t, e, s);
|
|
212
212
|
}
|
|
213
213
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
@@ -233,21 +233,21 @@ class S extends HTMLElement {
|
|
|
233
233
|
if (!this.isUpdatePending) return;
|
|
234
234
|
if (!this.hasUpdated) {
|
|
235
235
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
236
|
-
for (const [
|
|
236
|
+
for (const [i, n] of this._$Ep) this[i] = n;
|
|
237
237
|
this._$Ep = void 0;
|
|
238
238
|
}
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
239
|
+
const r = this.constructor.elementProperties;
|
|
240
|
+
if (r.size > 0) for (const [i, n] of r) n.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], n);
|
|
241
241
|
}
|
|
242
242
|
let t = !1;
|
|
243
243
|
const e = this._$AL;
|
|
244
244
|
try {
|
|
245
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((
|
|
246
|
-
var
|
|
247
|
-
return (
|
|
245
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((r) => {
|
|
246
|
+
var i;
|
|
247
|
+
return (i = r.hostUpdate) == null ? void 0 : i.call(r);
|
|
248
248
|
}), this.update(e)) : this._$EU();
|
|
249
|
-
} catch (
|
|
250
|
-
throw t = !1, this._$EU(),
|
|
249
|
+
} catch (r) {
|
|
250
|
+
throw t = !1, this._$EU(), r;
|
|
251
251
|
}
|
|
252
252
|
t && this._$AE(e);
|
|
253
253
|
}
|
|
@@ -256,8 +256,8 @@ class S extends HTMLElement {
|
|
|
256
256
|
_$AE(t) {
|
|
257
257
|
var e;
|
|
258
258
|
(e = this._$EO) == null || e.forEach((s) => {
|
|
259
|
-
var
|
|
260
|
-
return (
|
|
259
|
+
var r;
|
|
260
|
+
return (r = s.hostUpdated) == null ? void 0 : r.call(s);
|
|
261
261
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
262
262
|
}
|
|
263
263
|
_$EU() {
|
|
@@ -279,54 +279,55 @@ class S extends HTMLElement {
|
|
|
279
279
|
}
|
|
280
280
|
firstUpdated(t) {
|
|
281
281
|
}
|
|
282
|
-
}
|
|
283
|
-
|
|
282
|
+
};
|
|
283
|
+
L.elementStyles = [], L.shadowRootOptions = { mode: "open" }, L[j("elementProperties")] = /* @__PURE__ */ new Map(), L[j("finalized")] = /* @__PURE__ */ new Map(), ct == null || ct({ ReactiveElement: L }), (I.reactiveElementVersions ?? (I.reactiveElementVersions = [])).push("2.0.4");
|
|
284
284
|
/**
|
|
285
285
|
* @license
|
|
286
286
|
* Copyright 2017 Google LLC
|
|
287
287
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
288
288
|
*/
|
|
289
|
-
const
|
|
290
|
-
const { kind: s, metadata:
|
|
291
|
-
let
|
|
292
|
-
if (
|
|
289
|
+
const fe = { attribute: !0, type: String, converter: tt, reflect: !1, hasChanged: bt }, ye = (o = fe, t, e) => {
|
|
290
|
+
const { kind: s, metadata: r } = e;
|
|
291
|
+
let i = globalThis.litPropertyMetadata.get(r);
|
|
292
|
+
if (i === void 0 && globalThis.litPropertyMetadata.set(r, i = /* @__PURE__ */ new Map()), i.set(e.name, o), s === "accessor") {
|
|
293
293
|
const { name: n } = e;
|
|
294
294
|
return { set(l) {
|
|
295
295
|
const a = t.get.call(this);
|
|
296
|
-
t.set.call(this, l), this.requestUpdate(n, a,
|
|
296
|
+
t.set.call(this, l), this.requestUpdate(n, a, o);
|
|
297
297
|
}, init(l) {
|
|
298
|
-
return l !== void 0 && this.P(n, void 0,
|
|
298
|
+
return l !== void 0 && this.P(n, void 0, o), l;
|
|
299
299
|
} };
|
|
300
300
|
}
|
|
301
301
|
if (s === "setter") {
|
|
302
302
|
const { name: n } = e;
|
|
303
303
|
return function(l) {
|
|
304
304
|
const a = this[n];
|
|
305
|
-
t.call(this, l), this.requestUpdate(n, a,
|
|
305
|
+
t.call(this, l), this.requestUpdate(n, a, o);
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
throw Error("Unsupported decorator location: " + s);
|
|
309
309
|
};
|
|
310
|
-
function
|
|
311
|
-
return (t, e) => typeof e == "object" ?
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
314
|
-
})(
|
|
310
|
+
function p(o) {
|
|
311
|
+
return (t, e) => typeof e == "object" ? ye(o, t, e) : ((s, r, i) => {
|
|
312
|
+
const n = r.hasOwnProperty(i);
|
|
313
|
+
return r.constructor.createProperty(i, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(r, i) : void 0;
|
|
314
|
+
})(o, t, e);
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
317
|
* @license
|
|
318
318
|
* Copyright 2017 Google LLC
|
|
319
319
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
320
320
|
*/
|
|
321
|
-
function
|
|
322
|
-
return
|
|
321
|
+
function be(o) {
|
|
322
|
+
return p({ ...o, state: !0, attribute: !1 });
|
|
323
323
|
}
|
|
324
|
-
const
|
|
324
|
+
const ve = qt`
|
|
325
325
|
:host {
|
|
326
326
|
/* Anything that can be overridden should be defined here */
|
|
327
327
|
|
|
328
328
|
/* Global Text Input Styles */
|
|
329
329
|
--_nys-textinput-width: 100%;
|
|
330
|
+
--_nys-textinput-height: var(--nys-size-500, 40px);
|
|
330
331
|
--_nys-textinput-radius: var(--nys-radius-md, 4px);
|
|
331
332
|
--_nys-textinput-width-border: var(--nys-border-width-sm, 1px);
|
|
332
333
|
--_nys-textinput-color-border: var(--nys-color-neutral-400, #909395);
|
|
@@ -429,9 +430,8 @@ const At = lt`
|
|
|
429
430
|
border: solid var(--_nys-textinput-color-border)
|
|
430
431
|
var(--_nys-textinput-width-border);
|
|
431
432
|
padding: var(--_nys-textinput-padding);
|
|
432
|
-
width:
|
|
433
|
-
|
|
434
|
-
max-width: var(--_nys-textinput-width);
|
|
433
|
+
width: 100%;
|
|
434
|
+
height: var(--_nys-textinput-height);
|
|
435
435
|
box-sizing: border-box;
|
|
436
436
|
-webkit-box-sizing: border-box;
|
|
437
437
|
-moz-box-sizing: border-box;
|
|
@@ -441,18 +441,74 @@ const At = lt`
|
|
|
441
441
|
color: var(--_nys-textinput-placeholder-color);
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
+
.nys-textinput__buttoncontainer {
|
|
445
|
+
width: var(--_nys-textinput-width);
|
|
446
|
+
min-width: var(--_nys-textinput-width);
|
|
447
|
+
max-width: var(--_nys-textinput-width);
|
|
448
|
+
display: flex;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.nys-textinput__buttoncontainer.has-end-button .nys-textinput__input {
|
|
452
|
+
border-top-right-radius: 0;
|
|
453
|
+
border-bottom-right-radius: 0;
|
|
454
|
+
border-right: none;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.nys-textinput__buttoncontainer.has-start-button .nys-textinput__input {
|
|
458
|
+
border-top-left-radius: 0;
|
|
459
|
+
border-bottom-left-radius: 0;
|
|
460
|
+
border-left: none;
|
|
461
|
+
}
|
|
462
|
+
|
|
444
463
|
/* This container exist to mainly style the type="password" eye icon */
|
|
445
|
-
.nys-
|
|
464
|
+
.nys-textinput__container {
|
|
446
465
|
position: relative;
|
|
466
|
+
display: flex;
|
|
467
|
+
align-items: center;
|
|
468
|
+
width: 100%;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
::slotted(nys-button) {
|
|
472
|
+
--_nys-button-height: var(--_nys-textinput-height);
|
|
473
|
+
--_nys-button-radius-left: var(--_nys-textinput-radius);
|
|
474
|
+
--_nys-button-radius-right: var(--_nys-textinput-radius);
|
|
475
|
+
--_nys-button-color-bg-disabled: var(--_nys-textinput-disabled-color);
|
|
476
|
+
--_nys-button-color-border-disabled: var(
|
|
477
|
+
--_nys-textinput-disabled-color-text
|
|
478
|
+
);
|
|
479
|
+
--_nys-button-color-text-disabled: var(
|
|
480
|
+
--_nys-textinput-disabled-color-text
|
|
481
|
+
);
|
|
482
|
+
--_nys-button-width-border: var(--_nys-textinput-width-border);
|
|
483
|
+
z-index: 1; /* to make sure the button outline renders on top of the input */
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.nys-textinput__buttoncontainer.has-start-button ::slotted(nys-button) {
|
|
487
|
+
--_nys-button-radius-right: 0;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.nys-textinput__buttoncontainer.has-end-button ::slotted(nys-button) {
|
|
491
|
+
--_nys-button-radius-left: 0;
|
|
447
492
|
}
|
|
493
|
+
|
|
448
494
|
.eye-icon {
|
|
449
495
|
position: absolute;
|
|
450
|
-
right:
|
|
496
|
+
right: var(--nys-space-50, 4px);
|
|
451
497
|
top: 50%;
|
|
452
498
|
transform: translateY(-50%);
|
|
453
499
|
cursor: pointer;
|
|
454
500
|
color: var(--_nys-textinput-icon-color);
|
|
455
|
-
|
|
501
|
+
--_nys-button-color-bg: transparent;
|
|
502
|
+
--_nys-button-color-bg-hover: transparent;
|
|
503
|
+
--_nys-button-color-bg-active: transparent;
|
|
504
|
+
--_nys-button-offset-focus: calc(
|
|
505
|
+
var(--_nys-button-width-focus) * -1
|
|
506
|
+
); /* Needs to be negative of the offset width */
|
|
507
|
+
--_nys-button-radius-left: var(--_nys-textinput-radius);
|
|
508
|
+
--_nys-button-radius-right: var(--_nys-textinput-radius);
|
|
509
|
+
--_nys-button-height: var(--nys-size-400, 32px);
|
|
510
|
+
--_nys-button-width: var(--nys-size-400, 32px);
|
|
511
|
+
--_nys-button-padding-x: 0;
|
|
456
512
|
}
|
|
457
513
|
|
|
458
514
|
/* Hovered */
|
|
@@ -472,9 +528,8 @@ const At = lt`
|
|
|
472
528
|
|
|
473
529
|
/* Disabled */
|
|
474
530
|
.nys-textinput__input:disabled,
|
|
475
|
-
.nys-
|
|
476
|
-
.nys-
|
|
477
|
-
.nys-textinput__input:disabled::placeholder {
|
|
531
|
+
.nys-textinput__input:disabled::placeholder,
|
|
532
|
+
.nys-textinput__input:disabled + .eye-icon {
|
|
478
533
|
background-color: var(--_nys-textinput-disabled-color);
|
|
479
534
|
border-color: var(--_nys-textinput-disabled-color-border);
|
|
480
535
|
color: var(--_nys-textinput-disabled-color-text);
|
|
@@ -486,70 +541,70 @@ const At = lt`
|
|
|
486
541
|
* Copyright 2017 Google LLC
|
|
487
542
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
488
543
|
*/
|
|
489
|
-
const
|
|
490
|
-
\f\r]`,
|
|
491
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
492
|
-
function
|
|
493
|
-
if (!
|
|
494
|
-
return
|
|
544
|
+
const F = globalThis, et = F.trustedTypes, St = et ? et.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, Wt = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, Gt = "?" + P, _e = `<${Gt}>`, k = document, st = () => k.createComment(""), G = (o) => o === null || typeof o != "object" && typeof o != "function", vt = Array.isArray, ge = (o) => vt(o) || typeof (o == null ? void 0 : o[Symbol.iterator]) == "function", dt = `[
|
|
545
|
+
\f\r]`, V = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Et = /-->/g, Pt = />/g, U = RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^
|
|
546
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ct = /'/g, It = /"/g, Kt = /^(?:script|style|textarea|title)$/i, K = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), Ut = /* @__PURE__ */ new WeakMap(), H = k.createTreeWalker(k, 129);
|
|
547
|
+
function Zt(o, t) {
|
|
548
|
+
if (!vt(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
549
|
+
return St !== void 0 ? St.createHTML(t) : t;
|
|
495
550
|
}
|
|
496
|
-
const
|
|
497
|
-
const e =
|
|
498
|
-
let
|
|
551
|
+
const $e = (o, t) => {
|
|
552
|
+
const e = o.length - 1, s = [];
|
|
553
|
+
let r, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = V;
|
|
499
554
|
for (let l = 0; l < e; l++) {
|
|
500
|
-
const a =
|
|
501
|
-
let
|
|
502
|
-
for (;
|
|
503
|
-
const
|
|
504
|
-
|
|
555
|
+
const a = o[l];
|
|
556
|
+
let c, d, h = -1, y = 0;
|
|
557
|
+
for (; y < a.length && (n.lastIndex = y, d = n.exec(a), d !== null); ) y = n.lastIndex, n === V ? d[1] === "!--" ? n = Et : d[1] !== void 0 ? n = Pt : d[2] !== void 0 ? (Kt.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = U) : d[3] !== void 0 && (n = U) : n === U ? d[0] === ">" ? (n = r ?? V, h = -1) : d[1] === void 0 ? h = -2 : (h = n.lastIndex - d[2].length, c = d[1], n = d[3] === void 0 ? U : d[3] === '"' ? It : Ct) : n === It || n === Ct ? n = U : n === Et || n === Pt ? n = V : (n = U, r = void 0);
|
|
558
|
+
const g = n === U && o[l + 1].startsWith("/>") ? " " : "";
|
|
559
|
+
i += n === V ? a + _e : h >= 0 ? (s.push(c), a.slice(0, h) + Wt + a.slice(h) + P + g) : a + P + (h === -2 ? l : g);
|
|
505
560
|
}
|
|
506
|
-
return [
|
|
561
|
+
return [Zt(o, i + (o[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
507
562
|
};
|
|
508
|
-
class
|
|
563
|
+
let ft = class Yt {
|
|
509
564
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
510
|
-
let
|
|
565
|
+
let r;
|
|
511
566
|
this.parts = [];
|
|
512
|
-
let
|
|
513
|
-
const l = t.length - 1, a = this.parts, [
|
|
514
|
-
if (this.el =
|
|
567
|
+
let i = 0, n = 0;
|
|
568
|
+
const l = t.length - 1, a = this.parts, [c, d] = $e(t, e);
|
|
569
|
+
if (this.el = Yt.createElement(c, s), H.currentNode = this.el.content, e === 2 || e === 3) {
|
|
515
570
|
const h = this.el.content.firstChild;
|
|
516
571
|
h.replaceWith(...h.childNodes);
|
|
517
572
|
}
|
|
518
|
-
for (; (
|
|
519
|
-
if (
|
|
520
|
-
if (
|
|
521
|
-
const
|
|
522
|
-
a.push({ type: 1, index:
|
|
523
|
-
} else h.startsWith(
|
|
524
|
-
if (
|
|
525
|
-
const h =
|
|
526
|
-
if (
|
|
527
|
-
|
|
528
|
-
for (let
|
|
529
|
-
|
|
573
|
+
for (; (r = H.nextNode()) !== null && a.length < l; ) {
|
|
574
|
+
if (r.nodeType === 1) {
|
|
575
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(Wt)) {
|
|
576
|
+
const y = d[n++], g = r.getAttribute(h).split(P), S = /([.?@])?(.*)/.exec(y);
|
|
577
|
+
a.push({ type: 1, index: i, name: S[2], strings: g, ctor: S[1] === "." ? xe : S[1] === "?" ? Ae : S[1] === "@" ? we : at }), r.removeAttribute(h);
|
|
578
|
+
} else h.startsWith(P) && (a.push({ type: 6, index: i }), r.removeAttribute(h));
|
|
579
|
+
if (Kt.test(r.tagName)) {
|
|
580
|
+
const h = r.textContent.split(P), y = h.length - 1;
|
|
581
|
+
if (y > 0) {
|
|
582
|
+
r.textContent = et ? et.emptyScript : "";
|
|
583
|
+
for (let g = 0; g < y; g++) r.append(h[g], st()), H.nextNode(), a.push({ type: 2, index: ++i });
|
|
584
|
+
r.append(h[y], st());
|
|
530
585
|
}
|
|
531
586
|
}
|
|
532
|
-
} else if (
|
|
587
|
+
} else if (r.nodeType === 8) if (r.data === Gt) a.push({ type: 2, index: i });
|
|
533
588
|
else {
|
|
534
589
|
let h = -1;
|
|
535
|
-
for (; (h =
|
|
590
|
+
for (; (h = r.data.indexOf(P, h + 1)) !== -1; ) a.push({ type: 7, index: i }), h += P.length - 1;
|
|
536
591
|
}
|
|
537
|
-
|
|
592
|
+
i++;
|
|
538
593
|
}
|
|
539
594
|
}
|
|
540
595
|
static createElement(t, e) {
|
|
541
|
-
const s =
|
|
596
|
+
const s = k.createElement("template");
|
|
542
597
|
return s.innerHTML = t, s;
|
|
543
598
|
}
|
|
544
|
-
}
|
|
545
|
-
function
|
|
599
|
+
};
|
|
600
|
+
function R(o, t, e = o, s) {
|
|
546
601
|
var n, l;
|
|
547
|
-
if (t ===
|
|
548
|
-
let
|
|
549
|
-
const
|
|
550
|
-
return (
|
|
602
|
+
if (t === K) return t;
|
|
603
|
+
let r = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
|
|
604
|
+
const i = G(t) ? void 0 : t._$litDirective$;
|
|
605
|
+
return (r == null ? void 0 : r.constructor) !== i && ((l = r == null ? void 0 : r._$AO) == null || l.call(r, !1), i === void 0 ? r = void 0 : (r = new i(o), r._$AT(o, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = R(o, r._$AS(o, t.values), r, s)), t;
|
|
551
606
|
}
|
|
552
|
-
class
|
|
607
|
+
let me = class {
|
|
553
608
|
constructor(t, e) {
|
|
554
609
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
555
610
|
}
|
|
@@ -560,30 +615,29 @@ class Pt {
|
|
|
560
615
|
return this._$AM._$AU;
|
|
561
616
|
}
|
|
562
617
|
u(t) {
|
|
563
|
-
const { el: { content: e }, parts: s } = this._$AD,
|
|
564
|
-
|
|
565
|
-
let
|
|
618
|
+
const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? k).importNode(e, !0);
|
|
619
|
+
H.currentNode = r;
|
|
620
|
+
let i = H.nextNode(), n = 0, l = 0, a = s[0];
|
|
566
621
|
for (; a !== void 0; ) {
|
|
567
622
|
if (n === a.index) {
|
|
568
|
-
let
|
|
569
|
-
a.type === 2 ?
|
|
623
|
+
let c;
|
|
624
|
+
a.type === 2 ? c = new Jt(i, i.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, t) : a.type === 6 && (c = new Se(i, this, t)), this._$AV.push(c), a = s[++l];
|
|
570
625
|
}
|
|
571
|
-
n !== (a == null ? void 0 : a.index) && (
|
|
626
|
+
n !== (a == null ? void 0 : a.index) && (i = H.nextNode(), n++);
|
|
572
627
|
}
|
|
573
|
-
return
|
|
628
|
+
return H.currentNode = k, r;
|
|
574
629
|
}
|
|
575
630
|
p(t) {
|
|
576
631
|
let e = 0;
|
|
577
632
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
578
633
|
}
|
|
579
|
-
}
|
|
580
|
-
class V {
|
|
634
|
+
}, Jt = class Qt {
|
|
581
635
|
get _$AU() {
|
|
582
636
|
var t;
|
|
583
637
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
584
638
|
}
|
|
585
|
-
constructor(t, e, s,
|
|
586
|
-
this.type = 2, this._$AH =
|
|
639
|
+
constructor(t, e, s, r) {
|
|
640
|
+
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
|
|
587
641
|
}
|
|
588
642
|
get parentNode() {
|
|
589
643
|
let t = this._$AA.parentNode;
|
|
@@ -597,7 +651,7 @@ class V {
|
|
|
597
651
|
return this._$AB;
|
|
598
652
|
}
|
|
599
653
|
_$AI(t, e = this) {
|
|
600
|
-
t =
|
|
654
|
+
t = R(this, t, e), G(t) ? t === b || t == null || t === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : t !== this._$AH && t !== K && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ge(t) ? this.k(t) : this._(t);
|
|
601
655
|
}
|
|
602
656
|
O(t) {
|
|
603
657
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -606,96 +660,93 @@ class V {
|
|
|
606
660
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
607
661
|
}
|
|
608
662
|
_(t) {
|
|
609
|
-
this._$AH !==
|
|
663
|
+
this._$AH !== b && G(this._$AH) ? this._$AA.nextSibling.data = t : this.T(k.createTextNode(t)), this._$AH = t;
|
|
610
664
|
}
|
|
611
665
|
$(t) {
|
|
612
|
-
var
|
|
613
|
-
const { values: e, _$litType$: s } = t,
|
|
614
|
-
if (((
|
|
666
|
+
var i;
|
|
667
|
+
const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = ft.createElement(Zt(s.h, s.h[0]), this.options)), s);
|
|
668
|
+
if (((i = this._$AH) == null ? void 0 : i._$AD) === r) this._$AH.p(e);
|
|
615
669
|
else {
|
|
616
|
-
const n = new
|
|
670
|
+
const n = new me(r, this), l = n.u(this.options);
|
|
617
671
|
n.p(e), this.T(l), this._$AH = n;
|
|
618
672
|
}
|
|
619
673
|
}
|
|
620
674
|
_$AC(t) {
|
|
621
|
-
let e =
|
|
622
|
-
return e === void 0 &&
|
|
675
|
+
let e = Ut.get(t.strings);
|
|
676
|
+
return e === void 0 && Ut.set(t.strings, e = new ft(t)), e;
|
|
623
677
|
}
|
|
624
678
|
k(t) {
|
|
625
|
-
|
|
679
|
+
vt(this._$AH) || (this._$AH = [], this._$AR());
|
|
626
680
|
const e = this._$AH;
|
|
627
|
-
let s,
|
|
628
|
-
for (const
|
|
629
|
-
|
|
681
|
+
let s, r = 0;
|
|
682
|
+
for (const i of t) r === e.length ? e.push(s = new Qt(this.O(st()), this.O(st()), this, this.options)) : s = e[r], s._$AI(i), r++;
|
|
683
|
+
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
630
684
|
}
|
|
631
685
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
632
686
|
var s;
|
|
633
687
|
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
634
|
-
const
|
|
635
|
-
t.remove(), t =
|
|
688
|
+
const r = t.nextSibling;
|
|
689
|
+
t.remove(), t = r;
|
|
636
690
|
}
|
|
637
691
|
}
|
|
638
692
|
setConnected(t) {
|
|
639
693
|
var e;
|
|
640
694
|
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
641
695
|
}
|
|
642
|
-
}
|
|
643
|
-
class q {
|
|
696
|
+
}, at = class {
|
|
644
697
|
get tagName() {
|
|
645
698
|
return this.element.tagName;
|
|
646
699
|
}
|
|
647
700
|
get _$AU() {
|
|
648
701
|
return this._$AM._$AU;
|
|
649
702
|
}
|
|
650
|
-
constructor(t, e, s,
|
|
651
|
-
this.type = 1, this._$AH =
|
|
703
|
+
constructor(t, e, s, r, i) {
|
|
704
|
+
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = b;
|
|
652
705
|
}
|
|
653
|
-
_$AI(t, e = this, s,
|
|
654
|
-
const
|
|
706
|
+
_$AI(t, e = this, s, r) {
|
|
707
|
+
const i = this.strings;
|
|
655
708
|
let n = !1;
|
|
656
|
-
if (
|
|
709
|
+
if (i === void 0) t = R(this, t, e, 0), n = !G(t) || t !== this._$AH && t !== K, n && (this._$AH = t);
|
|
657
710
|
else {
|
|
658
711
|
const l = t;
|
|
659
|
-
let a,
|
|
660
|
-
for (t =
|
|
712
|
+
let a, c;
|
|
713
|
+
for (t = i[0], a = 0; a < i.length - 1; a++) c = R(this, l[s + a], e, a), c === K && (c = this._$AH[a]), n || (n = !G(c) || c !== this._$AH[a]), c === b ? t = b : t !== b && (t += (c ?? "") + i[a + 1]), this._$AH[a] = c;
|
|
661
714
|
}
|
|
662
|
-
n && !
|
|
715
|
+
n && !r && this.j(t);
|
|
663
716
|
}
|
|
664
717
|
j(t) {
|
|
665
|
-
t ===
|
|
718
|
+
t === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
666
719
|
}
|
|
667
|
-
}
|
|
668
|
-
class
|
|
720
|
+
};
|
|
721
|
+
class xe extends at {
|
|
669
722
|
constructor() {
|
|
670
723
|
super(...arguments), this.type = 3;
|
|
671
724
|
}
|
|
672
725
|
j(t) {
|
|
673
|
-
this.element[this.name] = t ===
|
|
726
|
+
this.element[this.name] = t === b ? void 0 : t;
|
|
674
727
|
}
|
|
675
728
|
}
|
|
676
|
-
class
|
|
729
|
+
let Ae = class extends at {
|
|
677
730
|
constructor() {
|
|
678
731
|
super(...arguments), this.type = 4;
|
|
679
732
|
}
|
|
680
733
|
j(t) {
|
|
681
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
734
|
+
this.element.toggleAttribute(this.name, !!t && t !== b);
|
|
682
735
|
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
super(t, e, s, i, o), this.type = 5;
|
|
736
|
+
}, we = class extends at {
|
|
737
|
+
constructor(t, e, s, r, i) {
|
|
738
|
+
super(t, e, s, r, i), this.type = 5;
|
|
687
739
|
}
|
|
688
740
|
_$AI(t, e = this) {
|
|
689
|
-
if ((t =
|
|
690
|
-
const s = this._$AH,
|
|
691
|
-
|
|
741
|
+
if ((t = R(this, t, e, 0) ?? b) === K) return;
|
|
742
|
+
const s = this._$AH, r = t === b && s !== b || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, i = t !== b && (s === b || r);
|
|
743
|
+
r && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
692
744
|
}
|
|
693
745
|
handleEvent(t) {
|
|
694
746
|
var e;
|
|
695
747
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
696
748
|
}
|
|
697
|
-
}
|
|
698
|
-
class Ht {
|
|
749
|
+
}, Se = class {
|
|
699
750
|
constructor(t, e, s) {
|
|
700
751
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
701
752
|
}
|
|
@@ -703,129 +754,1298 @@ class Ht {
|
|
|
703
754
|
return this._$AM._$AU;
|
|
704
755
|
}
|
|
705
756
|
_$AI(t) {
|
|
706
|
-
|
|
757
|
+
R(this, t);
|
|
707
758
|
}
|
|
708
|
-
}
|
|
709
|
-
const
|
|
710
|
-
|
|
759
|
+
};
|
|
760
|
+
const ut = F.litHtmlPolyfillSupport;
|
|
761
|
+
ut == null || ut(ft, Jt), (F.litHtmlVersions ?? (F.litHtmlVersions = [])).push("3.2.1");
|
|
711
762
|
/**
|
|
712
763
|
* @license
|
|
713
764
|
* Copyright 2018 Google LLC
|
|
714
765
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
715
766
|
*/
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
767
|
+
const T = (o) => o ?? b;
|
|
768
|
+
/*!
|
|
769
|
+
*
|
|
770
|
+
* ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
|
|
771
|
+
* ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
|
|
772
|
+
* ▒█░░▀█ ░░▒█░░ ▒█▄▄▄█ ▒█▄▄▀ ▒█▄▄▄█
|
|
773
|
+
*
|
|
774
|
+
* Button Component
|
|
775
|
+
* Part of the New York State Design System
|
|
776
|
+
* Repository: https://github.com/its-hcd/nysds
|
|
777
|
+
* License: MIT
|
|
778
|
+
*/
|
|
779
|
+
/**
|
|
780
|
+
* @license
|
|
781
|
+
* Copyright 2019 Google LLC
|
|
782
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
783
|
+
*/
|
|
784
|
+
const X = globalThis, _t = X.ShadowRoot && (X.ShadyCSS === void 0 || X.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Xt = Symbol(), Tt = /* @__PURE__ */ new WeakMap();
|
|
785
|
+
let Ee = class {
|
|
786
|
+
constructor(o, t, e) {
|
|
787
|
+
if (this._$cssResult$ = !0, e !== Xt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
788
|
+
this.cssText = o, this.t = t;
|
|
789
|
+
}
|
|
790
|
+
get styleSheet() {
|
|
791
|
+
let o = this.o;
|
|
792
|
+
const t = this.t;
|
|
793
|
+
if (_t && o === void 0) {
|
|
794
|
+
const e = t !== void 0 && t.length === 1;
|
|
795
|
+
e && (o = Tt.get(t)), o === void 0 && ((this.o = o = new CSSStyleSheet()).replaceSync(this.cssText), e && Tt.set(t, o));
|
|
796
|
+
}
|
|
797
|
+
return o;
|
|
798
|
+
}
|
|
799
|
+
toString() {
|
|
800
|
+
return this.cssText;
|
|
801
|
+
}
|
|
721
802
|
};
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
super(), this.id = "", this.name = "", this._type = "text", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this.form = "", this.pattern = "", this.maxlength = null, this.width = "full", this.step = null, this.min = null, this.max = null, this.showError = !1, this.errorMessage = "", this.showPassword = !1, this._originalErrorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
|
|
803
|
+
const Pe = (o) => new Ee(typeof o == "string" ? o : o + "", void 0, Xt), Ce = (o, t) => {
|
|
804
|
+
if (_t) o.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
805
|
+
else for (const e of t) {
|
|
806
|
+
const s = document.createElement("style"), r = X.litNonce;
|
|
807
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, o.appendChild(s);
|
|
728
808
|
}
|
|
729
|
-
|
|
730
|
-
|
|
809
|
+
}, Mt = _t ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((t) => {
|
|
810
|
+
let e = "";
|
|
811
|
+
for (const s of t.cssRules) e += s.cssText;
|
|
812
|
+
return Pe(e);
|
|
813
|
+
})(o) : o;
|
|
814
|
+
/**
|
|
815
|
+
* @license
|
|
816
|
+
* Copyright 2017 Google LLC
|
|
817
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
818
|
+
*/
|
|
819
|
+
const { is: Ie, defineProperty: Ue, getOwnPropertyDescriptor: Te, getOwnPropertyNames: Me, getOwnPropertySymbols: He, getPrototypeOf: Oe } = Object, z = globalThis, Ht = z.trustedTypes, ke = Ht ? Ht.emptyScript : "", Ot = z.reactiveElementPolyfillSupport, W = (o, t) => o, rt = { toAttribute(o, t) {
|
|
820
|
+
switch (t) {
|
|
821
|
+
case Boolean:
|
|
822
|
+
o = o ? ke : null;
|
|
823
|
+
break;
|
|
824
|
+
case Object:
|
|
825
|
+
case Array:
|
|
826
|
+
o = o == null ? o : JSON.stringify(o);
|
|
731
827
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
828
|
+
return o;
|
|
829
|
+
}, fromAttribute(o, t) {
|
|
830
|
+
let e = o;
|
|
831
|
+
switch (t) {
|
|
832
|
+
case Boolean:
|
|
833
|
+
e = o !== null;
|
|
834
|
+
break;
|
|
835
|
+
case Number:
|
|
836
|
+
e = o === null ? null : Number(o);
|
|
837
|
+
break;
|
|
838
|
+
case Object:
|
|
839
|
+
case Array:
|
|
840
|
+
try {
|
|
841
|
+
e = JSON.parse(o);
|
|
842
|
+
} catch {
|
|
843
|
+
e = null;
|
|
844
|
+
}
|
|
736
845
|
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
846
|
+
return e;
|
|
847
|
+
} }, gt = (o, t) => !Ie(o, t), kt = { attribute: !0, type: String, converter: rt, reflect: !1, hasChanged: gt };
|
|
848
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), z.litPropertyMetadata ?? (z.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
849
|
+
class B extends HTMLElement {
|
|
850
|
+
static addInitializer(t) {
|
|
851
|
+
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
740
852
|
}
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
super.connectedCallback(), this.id || (this.id = `nys-textinput-${Date.now()}-${Ot++}`), this._originalErrorMessage = this.errorMessage, this.addEventListener("invalid", this._handleInvalid);
|
|
853
|
+
static get observedAttributes() {
|
|
854
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
744
855
|
}
|
|
745
|
-
|
|
746
|
-
|
|
856
|
+
static createProperty(t, e = kt) {
|
|
857
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
858
|
+
const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
859
|
+
r !== void 0 && Ue(this.prototype, t, r);
|
|
860
|
+
}
|
|
747
861
|
}
|
|
748
|
-
|
|
749
|
-
this.
|
|
862
|
+
static getPropertyDescriptor(t, e, s) {
|
|
863
|
+
const { get: r, set: i } = Te(this.prototype, t) ?? { get() {
|
|
864
|
+
return this[e];
|
|
865
|
+
}, set(n) {
|
|
866
|
+
this[e] = n;
|
|
867
|
+
} };
|
|
868
|
+
return { get() {
|
|
869
|
+
return r == null ? void 0 : r.call(this);
|
|
870
|
+
}, set(n) {
|
|
871
|
+
const l = r == null ? void 0 : r.call(this);
|
|
872
|
+
i.call(this, n), this.requestUpdate(t, l, s);
|
|
873
|
+
}, configurable: !0, enumerable: !0 };
|
|
750
874
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
this.value = "";
|
|
875
|
+
static getPropertyOptions(t) {
|
|
876
|
+
return this.elementProperties.get(t) ?? kt;
|
|
754
877
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
878
|
+
static _$Ei() {
|
|
879
|
+
if (this.hasOwnProperty(W("elementProperties"))) return;
|
|
880
|
+
const t = Oe(this);
|
|
881
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
758
882
|
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
883
|
+
static finalize() {
|
|
884
|
+
if (this.hasOwnProperty(W("finalized"))) return;
|
|
885
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(W("properties"))) {
|
|
886
|
+
const e = this.properties, s = [...Me(e), ...He(e)];
|
|
887
|
+
for (const r of s) this.createProperty(r, e[r]);
|
|
888
|
+
}
|
|
889
|
+
const t = this[Symbol.metadata];
|
|
890
|
+
if (t !== null) {
|
|
891
|
+
const e = litPropertyMetadata.get(t);
|
|
892
|
+
if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
|
|
893
|
+
}
|
|
894
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
895
|
+
for (const [e, s] of this.elementProperties) {
|
|
896
|
+
const r = this._$Eu(e, s);
|
|
897
|
+
r !== void 0 && this._$Eh.set(r, e);
|
|
898
|
+
}
|
|
899
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
765
900
|
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
901
|
+
static finalizeStyles(t) {
|
|
902
|
+
const e = [];
|
|
903
|
+
if (Array.isArray(t)) {
|
|
904
|
+
const s = new Set(t.flat(1 / 0).reverse());
|
|
905
|
+
for (const r of s) e.unshift(Mt(r));
|
|
906
|
+
} else t !== void 0 && e.push(Mt(t));
|
|
907
|
+
return e;
|
|
773
908
|
}
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
if (!t) return;
|
|
778
|
-
const e = t.validity;
|
|
779
|
-
let s = "";
|
|
780
|
-
e.valueMissing ? s = "This field is required" : e.typeMismatch ? s = "Invalid format for this type" : e.patternMismatch ? s = "Invalid format" : e.tooShort ? s = `Value is too short. Minimum length is ${t.minLength}` : e.tooLong ? s = `Value is too long. Maximum length is ${t.maxLength}` : e.rangeUnderflow ? s = `Value must be at least ${t.min}` : e.rangeOverflow ? s = `Value must be at most ${t.max}` : e.stepMismatch ? s = "Invalid step value" : s = t.validationMessage, this._setValidityMessage(s);
|
|
909
|
+
static _$Eu(t, e) {
|
|
910
|
+
const s = e.attribute;
|
|
911
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
781
912
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
913
|
+
constructor() {
|
|
914
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
915
|
+
}
|
|
916
|
+
_$Ev() {
|
|
917
|
+
var t;
|
|
918
|
+
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
|
|
919
|
+
}
|
|
920
|
+
addController(t) {
|
|
785
921
|
var e;
|
|
786
|
-
|
|
787
|
-
return t ? t.checkValidity() : !0;
|
|
922
|
+
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
|
788
923
|
}
|
|
789
|
-
|
|
924
|
+
removeController(t) {
|
|
925
|
+
var e;
|
|
926
|
+
(e = this._$EO) == null || e.delete(t);
|
|
927
|
+
}
|
|
928
|
+
_$E_() {
|
|
929
|
+
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
930
|
+
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
|
|
931
|
+
t.size > 0 && (this._$Ep = t);
|
|
932
|
+
}
|
|
933
|
+
createRenderRoot() {
|
|
934
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
935
|
+
return Ce(t, this.constructor.elementStyles), t;
|
|
936
|
+
}
|
|
937
|
+
connectedCallback() {
|
|
938
|
+
var t;
|
|
939
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
940
|
+
var s;
|
|
941
|
+
return (s = e.hostConnected) == null ? void 0 : s.call(e);
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
enableUpdating(t) {
|
|
945
|
+
}
|
|
946
|
+
disconnectedCallback() {
|
|
947
|
+
var t;
|
|
948
|
+
(t = this._$EO) == null || t.forEach((e) => {
|
|
949
|
+
var s;
|
|
950
|
+
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
attributeChangedCallback(t, e, s) {
|
|
954
|
+
this._$AK(t, s);
|
|
955
|
+
}
|
|
956
|
+
_$EC(t, e) {
|
|
790
957
|
var s;
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
i ? Array.from(i.elements).find(
|
|
796
|
-
(l) => typeof l.checkValidity == "function" && !l.checkValidity()
|
|
797
|
-
) === this && e.focus() : e.focus();
|
|
958
|
+
const r = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, r);
|
|
959
|
+
if (i !== void 0 && r.reflect === !0) {
|
|
960
|
+
const n = (((s = r.converter) == null ? void 0 : s.toAttribute) !== void 0 ? r.converter : rt).toAttribute(e, r.type);
|
|
961
|
+
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
798
962
|
}
|
|
799
963
|
}
|
|
800
|
-
|
|
801
|
-
|
|
964
|
+
_$AK(t, e) {
|
|
965
|
+
var s;
|
|
966
|
+
const r = this.constructor, i = r._$Eh.get(t);
|
|
967
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
968
|
+
const n = r.getPropertyOptions(i), l = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((s = n.converter) == null ? void 0 : s.fromAttribute) !== void 0 ? n.converter : rt;
|
|
969
|
+
this._$Em = i, this[i] = l.fromAttribute(e, n.type), this._$Em = null;
|
|
970
|
+
}
|
|
802
971
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
detail: { value: this.value },
|
|
810
|
-
bubbles: !0,
|
|
811
|
-
composed: !0
|
|
812
|
-
})
|
|
813
|
-
);
|
|
972
|
+
requestUpdate(t, e, s) {
|
|
973
|
+
if (t !== void 0) {
|
|
974
|
+
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? gt)(this[t], e)) return;
|
|
975
|
+
this.P(t, e, s);
|
|
976
|
+
}
|
|
977
|
+
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
814
978
|
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
this.dispatchEvent(new Event("focus"));
|
|
979
|
+
P(t, e, s) {
|
|
980
|
+
this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
|
818
981
|
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
982
|
+
async _$ET() {
|
|
983
|
+
this.isUpdatePending = !0;
|
|
984
|
+
try {
|
|
985
|
+
await this._$ES;
|
|
986
|
+
} catch (e) {
|
|
987
|
+
Promise.reject(e);
|
|
988
|
+
}
|
|
989
|
+
const t = this.scheduleUpdate();
|
|
990
|
+
return t != null && await t, !this.isUpdatePending;
|
|
991
|
+
}
|
|
992
|
+
scheduleUpdate() {
|
|
993
|
+
return this.performUpdate();
|
|
822
994
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
this.
|
|
995
|
+
performUpdate() {
|
|
996
|
+
var t;
|
|
997
|
+
if (!this.isUpdatePending) return;
|
|
998
|
+
if (!this.hasUpdated) {
|
|
999
|
+
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
1000
|
+
for (const [i, n] of this._$Ep) this[i] = n;
|
|
1001
|
+
this._$Ep = void 0;
|
|
1002
|
+
}
|
|
1003
|
+
const r = this.constructor.elementProperties;
|
|
1004
|
+
if (r.size > 0) for (const [i, n] of r) n.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], n);
|
|
1005
|
+
}
|
|
1006
|
+
let e = !1;
|
|
1007
|
+
const s = this._$AL;
|
|
1008
|
+
try {
|
|
1009
|
+
e = this.shouldUpdate(s), e ? (this.willUpdate(s), (t = this._$EO) == null || t.forEach((r) => {
|
|
1010
|
+
var i;
|
|
1011
|
+
return (i = r.hostUpdate) == null ? void 0 : i.call(r);
|
|
1012
|
+
}), this.update(s)) : this._$EU();
|
|
1013
|
+
} catch (r) {
|
|
1014
|
+
throw e = !1, this._$EU(), r;
|
|
1015
|
+
}
|
|
1016
|
+
e && this._$AE(s);
|
|
1017
|
+
}
|
|
1018
|
+
willUpdate(t) {
|
|
1019
|
+
}
|
|
1020
|
+
_$AE(t) {
|
|
1021
|
+
var e;
|
|
1022
|
+
(e = this._$EO) == null || e.forEach((s) => {
|
|
1023
|
+
var r;
|
|
1024
|
+
return (r = s.hostUpdated) == null ? void 0 : r.call(s);
|
|
1025
|
+
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
1026
|
+
}
|
|
1027
|
+
_$EU() {
|
|
1028
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
1029
|
+
}
|
|
1030
|
+
get updateComplete() {
|
|
1031
|
+
return this.getUpdateComplete();
|
|
1032
|
+
}
|
|
1033
|
+
getUpdateComplete() {
|
|
1034
|
+
return this._$ES;
|
|
1035
|
+
}
|
|
1036
|
+
shouldUpdate(t) {
|
|
1037
|
+
return !0;
|
|
1038
|
+
}
|
|
1039
|
+
update(t) {
|
|
1040
|
+
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
|
|
1041
|
+
}
|
|
1042
|
+
updated(t) {
|
|
1043
|
+
}
|
|
1044
|
+
firstUpdated(t) {
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
B.elementStyles = [], B.shadowRootOptions = { mode: "open" }, B[W("elementProperties")] = /* @__PURE__ */ new Map(), B[W("finalized")] = /* @__PURE__ */ new Map(), Ot == null || Ot({ ReactiveElement: B }), (z.reactiveElementVersions ?? (z.reactiveElementVersions = [])).push("2.0.4");
|
|
1048
|
+
/**
|
|
1049
|
+
* @license
|
|
1050
|
+
* Copyright 2017 Google LLC
|
|
1051
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1052
|
+
*/
|
|
1053
|
+
const Ne = { attribute: !0, type: String, converter: rt, reflect: !1, hasChanged: gt }, Re = (o = Ne, t, e) => {
|
|
1054
|
+
const { kind: s, metadata: r } = e;
|
|
1055
|
+
let i = globalThis.litPropertyMetadata.get(r);
|
|
1056
|
+
if (i === void 0 && globalThis.litPropertyMetadata.set(r, i = /* @__PURE__ */ new Map()), i.set(e.name, o), s === "accessor") {
|
|
1057
|
+
const { name: n } = e;
|
|
1058
|
+
return { set(l) {
|
|
1059
|
+
const a = t.get.call(this);
|
|
1060
|
+
t.set.call(this, l), this.requestUpdate(n, a, o);
|
|
1061
|
+
}, init(l) {
|
|
1062
|
+
return l !== void 0 && this.P(n, void 0, o), l;
|
|
1063
|
+
} };
|
|
1064
|
+
}
|
|
1065
|
+
if (s === "setter") {
|
|
1066
|
+
const { name: n } = e;
|
|
1067
|
+
return function(l) {
|
|
1068
|
+
const a = this[n];
|
|
1069
|
+
t.call(this, l), this.requestUpdate(n, a, o);
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
throw Error("Unsupported decorator location: " + s);
|
|
1073
|
+
};
|
|
1074
|
+
function $(o) {
|
|
1075
|
+
return (t, e) => typeof e == "object" ? Re(o, t, e) : ((s, r, i) => {
|
|
1076
|
+
const n = r.hasOwnProperty(i);
|
|
1077
|
+
return r.constructor.createProperty(i, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(r, i) : void 0;
|
|
1078
|
+
})(o, t, e);
|
|
1079
|
+
}
|
|
1080
|
+
const ze = qt`
|
|
1081
|
+
:host {
|
|
1082
|
+
/* Anything that can be overridden should be defined here */
|
|
1083
|
+
|
|
1084
|
+
/* Global Button Styles */
|
|
1085
|
+
--_nys-button-width: fit-content;
|
|
1086
|
+
--_nys-button-height: var(--nys-size-600, 48px);
|
|
1087
|
+
--_nys-button-radius-left: var(--nys-radius-xl, 12px);
|
|
1088
|
+
--_nys-button-radius-right: var(--nys-radius-xl, 12px);
|
|
1089
|
+
--_nys-button-padding-y: var(--nys-space-150, 12px);
|
|
1090
|
+
--_nys-button-padding-x: var(--nys-space-250, 20px);
|
|
1091
|
+
--_nys-button-gap: var(--nys-space-100, 8px);
|
|
1092
|
+
--_nys-button-width-border: var(--nys-border-width-md, 2px);
|
|
1093
|
+
--_nys-button-width-focus: var(--nys-border-width-md, 2px);
|
|
1094
|
+
--_nys-button-offset-focus: var(--nys-space-2px, 2px);
|
|
1095
|
+
--_nys-button-color-focus: var(--nys-color-focus, #004dd1);
|
|
1096
|
+
|
|
1097
|
+
/* Global Button Colors */
|
|
1098
|
+
--_nys-button-color-bg: var(--nys-color-theme, #154973);
|
|
1099
|
+
--_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
|
|
1100
|
+
--_nys-button-color-border: var(--nys-color-theme, #154973);
|
|
1101
|
+
|
|
1102
|
+
--_nys-button-color-bg-hover: var(--nys-color-theme-strong, #0e324f);
|
|
1103
|
+
--_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
|
|
1104
|
+
--_nys-button-color-border-hover: var(--nys-color-theme-strong, #0e324f);
|
|
1105
|
+
|
|
1106
|
+
--_nys-button-color-bg-active: var(--nys-color-theme-stronger, #081b2b);
|
|
1107
|
+
--_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
|
|
1108
|
+
--_nys-button-color-border-active: var(--nys-color-theme-stronger, #081b2b);
|
|
1109
|
+
|
|
1110
|
+
--_nys-button-color-bg-disabled: var(--nys-color-neutral-10, #f6f6f6);
|
|
1111
|
+
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1112
|
+
--_nys-button-color-border-disabled: var(--nys-color-neutral-10, #f6f6f6);
|
|
1113
|
+
|
|
1114
|
+
/* Typography */
|
|
1115
|
+
--_nys-button-font-size: var(--nys-font-size-ui-md, 16px);
|
|
1116
|
+
--_nys-button-font-weight: var(--nys-font-weight-semibold, 600);
|
|
1117
|
+
--_nys-button-line-height: var(--nys-font-lineheight-ui-md, 24px);
|
|
1118
|
+
--_nys-button-font-family: var(
|
|
1119
|
+
--nys-font-family-ui,
|
|
1120
|
+
var(
|
|
1121
|
+
--nys-font-family-sans,
|
|
1122
|
+
"Proxima Nova",
|
|
1123
|
+
"Helvetica Neue",
|
|
1124
|
+
"Helvetica",
|
|
1125
|
+
"Arial",
|
|
1126
|
+
sans-serif
|
|
1127
|
+
)
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/* Sizes */
|
|
1132
|
+
:host([size="sm"]) {
|
|
1133
|
+
--_nys-button-height: var(--nys-size-500, 40px);
|
|
1134
|
+
--_nys-button-padding-y: var(--nys-space-100, 8px);
|
|
1135
|
+
--_nys-button-padding-x: var(--nys-space-200, 16px);
|
|
1136
|
+
}
|
|
1137
|
+
:host([size="md"]) {
|
|
1138
|
+
--_nys-button-height: var(--nys-size-600, 48px);
|
|
1139
|
+
--_nys-button-padding-y: var(--nys-space-150, 12px);
|
|
1140
|
+
--_nys-button-padding-x: var(--nys-space-250, 20px);
|
|
1141
|
+
}
|
|
1142
|
+
:host([size="lg"]) {
|
|
1143
|
+
--_nys-button-height: var(--nys-size-700, 56px);
|
|
1144
|
+
--_nys-button-padding-y: var(--nys-space-200, 16px);
|
|
1145
|
+
--_nys-button-padding-x: var(--nys-space-300, 24px);
|
|
1146
|
+
}
|
|
1147
|
+
:host([fullWidth]) {
|
|
1148
|
+
--_nys-button-width: 100%;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/* VARIANTS */
|
|
1152
|
+
|
|
1153
|
+
/* Filled */
|
|
1154
|
+
:host([variant="filled"]) {
|
|
1155
|
+
/* Filled - Default */
|
|
1156
|
+
--_nys-button-color-bg: var(--nys-color-theme, #154973);
|
|
1157
|
+
--_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
|
|
1158
|
+
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1159
|
+
|
|
1160
|
+
/* Filled - Hover */
|
|
1161
|
+
--_nys-button-color-bg-hover: var(--nys-color-theme-strong, #0e324f);
|
|
1162
|
+
--_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
|
|
1163
|
+
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1164
|
+
|
|
1165
|
+
/* Filled - Pressed/Active */
|
|
1166
|
+
--_nys-button-color-bg-active: var(--nys-color-theme-stronger, #081b2b);
|
|
1167
|
+
--_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
|
|
1168
|
+
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1169
|
+
|
|
1170
|
+
/* Filled - Disabled */
|
|
1171
|
+
--_nys-button-color-bg-disabled: var(--nys-color-neutral-10, #f6f6f6);
|
|
1172
|
+
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1173
|
+
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/* Outline */
|
|
1177
|
+
:host([variant="outline"]) {
|
|
1178
|
+
/* Outline - Default */
|
|
1179
|
+
--_nys-button-color-bg: var(--nys-color-surface, #ffffff);
|
|
1180
|
+
--_nys-button-color-text: var(--nys-color-theme, #154973);
|
|
1181
|
+
--_nys-button-color-border: var(--nys-color-theme, #154973);
|
|
1182
|
+
|
|
1183
|
+
/* Outline - Hover */
|
|
1184
|
+
--_nys-button-color-bg-hover: var(--nys-color-theme-weaker, #eff6fb);
|
|
1185
|
+
--_nys-button-color-text-hover: var(--nys-color-theme, #154973);
|
|
1186
|
+
--_nys-button-color-border-hover: var(--nys-color-theme, #154973);
|
|
1187
|
+
|
|
1188
|
+
/* Outline - Pressed/Active */
|
|
1189
|
+
--_nys-button-color-bg-active: var(--nys-color-theme-weak, #cddde9);
|
|
1190
|
+
--_nys-button-color-text-active: var(--nys-color-theme, #154973);
|
|
1191
|
+
--_nys-button-color-border-active: var(--nys-color-theme, #154973);
|
|
1192
|
+
|
|
1193
|
+
/* Outline - Disabled */
|
|
1194
|
+
--_nys-button-color-bg-disabled: var(--nys-color-surface, #ffffff);
|
|
1195
|
+
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1196
|
+
--_nys-button-color-border-disabled: var(--nys-color-neutral-100, #d0d0ce);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/* Text */
|
|
1200
|
+
:host([variant="text"]) {
|
|
1201
|
+
--_nys-button-height: fit-content;
|
|
1202
|
+
--_nys-button-radius-left: var(--nys-radius-md, 4px);
|
|
1203
|
+
--_nys-button-radius-right: var(--nys-radius-md, 4px);
|
|
1204
|
+
--_nys-button-padding-y: var(--nys-space-2px, 2px);
|
|
1205
|
+
--_nys-button-padding-x: var(--nys-space-50, 4px);
|
|
1206
|
+
--_nys-button-width-border: 0px;
|
|
1207
|
+
--_nys-button-text-decoration: underline;
|
|
1208
|
+
|
|
1209
|
+
/* Text - Default */
|
|
1210
|
+
--_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
|
|
1211
|
+
--_nys-button-color-text: var(--nys-color-link, #004dd1);
|
|
1212
|
+
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1213
|
+
|
|
1214
|
+
/* Text - Hover */
|
|
1215
|
+
--_nys-button-color-bg-hover: var(--nys-color-transparent, #ffffff00);
|
|
1216
|
+
--_nys-button-color-text-hover: var(--nys-color-link-strong, #003ba1);
|
|
1217
|
+
--_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
|
|
1218
|
+
|
|
1219
|
+
/* Text - Pressed/Active */
|
|
1220
|
+
--_nys-button-color-bg-active: var(--nys-color-transparent, #ffffff00);
|
|
1221
|
+
--_nys-button-color-text-active: var(--nys-color-link-strongest, #002971);
|
|
1222
|
+
--_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
|
|
1223
|
+
|
|
1224
|
+
/* Text - Disabled */
|
|
1225
|
+
--_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
|
|
1226
|
+
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1227
|
+
--_nys-button-color-border-disabled: var(
|
|
1228
|
+
--nys-color-transparent,
|
|
1229
|
+
#ffffff00
|
|
1230
|
+
);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
/* Ghost */
|
|
1234
|
+
:host([variant="ghost"]) {
|
|
1235
|
+
/* Ghost - Default */
|
|
1236
|
+
--_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
|
|
1237
|
+
--_nys-button-color-text: var(--nys-color-text, #1b1b1b);
|
|
1238
|
+
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1239
|
+
|
|
1240
|
+
/* Ghost - Hover */
|
|
1241
|
+
--_nys-button-color-bg-hover: var(
|
|
1242
|
+
--nys-color-black-transparent-100,
|
|
1243
|
+
#0000001a
|
|
1244
|
+
);
|
|
1245
|
+
--_nys-button-color-text-hover: var(--nys-color-text, #1b1b1b);
|
|
1246
|
+
--_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
|
|
1247
|
+
|
|
1248
|
+
/* Ghost - Active */
|
|
1249
|
+
--_nys-button-color-bg-active: var(
|
|
1250
|
+
--nys-color-black-transparent-200,
|
|
1251
|
+
#00000033
|
|
1252
|
+
);
|
|
1253
|
+
--_nys-button-color-text-active: var(--nys-color-text, #1b1b1b);
|
|
1254
|
+
--_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
|
|
1255
|
+
|
|
1256
|
+
/* Ghost - Disabled */
|
|
1257
|
+
--_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
|
|
1258
|
+
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1259
|
+
--_nys-button-color-border-disabled: var(
|
|
1260
|
+
--nys-color-transparent,
|
|
1261
|
+
#ffffff00
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/* INVERTED VARIANTS */
|
|
1266
|
+
|
|
1267
|
+
/* Filled Inverted */
|
|
1268
|
+
:host([variant="filled"][inverted]) {
|
|
1269
|
+
/* Filled Inverted - Default */
|
|
1270
|
+
--_nys-button-color-bg: var(--nys-color-surface, #ffffff);
|
|
1271
|
+
--_nys-button-color-text: var(--nys-color-text, #1b1b1b);
|
|
1272
|
+
--_nys-button-color-border-disabled: var(
|
|
1273
|
+
--nys-color-transparent,
|
|
1274
|
+
#ffffff00
|
|
1275
|
+
);
|
|
1276
|
+
|
|
1277
|
+
/* Filled Inverted - Hover */
|
|
1278
|
+
--_nys-button-color-bg-hover: var(--nys-color-neutral-100, #d0d0ce);
|
|
1279
|
+
--_nys-button-color-text-hover: var(--nys-color-text, #1b1b1b);
|
|
1280
|
+
--_nys-button-color-border-disabled: var(
|
|
1281
|
+
--nys-color-transparent,
|
|
1282
|
+
#ffffff00
|
|
1283
|
+
);
|
|
1284
|
+
|
|
1285
|
+
/* Filled Inverted - Pressed/Active */
|
|
1286
|
+
--_nys-button-color-bg-active: var(--nys-color-neutral-300, #a7a9ab);
|
|
1287
|
+
--_nys-button-color-text-active: var(--nys-color-text, #1b1b1b);
|
|
1288
|
+
--_nys-button-color-border-disabled: var(
|
|
1289
|
+
--nys-color-transparent,
|
|
1290
|
+
#ffffff00
|
|
1291
|
+
);
|
|
1292
|
+
|
|
1293
|
+
/* Filled Inverted - Disabled */
|
|
1294
|
+
--_nys-button-color-bg-disabled: var(--nys-color-text, #1b1b1b);
|
|
1295
|
+
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #62666a);
|
|
1296
|
+
--_nys-button-color-border-disabled: var(
|
|
1297
|
+
--nys-color-transparent,
|
|
1298
|
+
#ffffff00
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
/* Outline Inverted */
|
|
1303
|
+
:host([variant="outline"][inverted]) {
|
|
1304
|
+
/* Outline Inverted - Default */
|
|
1305
|
+
--_nys-button-color-bg: var(--nys-color-surface-reverse, #1b1b1b);
|
|
1306
|
+
--_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
|
|
1307
|
+
--_nys-button-color-border: var(--nys-color-ink-reverse, #ffffff);
|
|
1308
|
+
|
|
1309
|
+
/* Outline Inverted - Hover */
|
|
1310
|
+
--_nys-button-color-bg-hover: var(--nys-color-surface-reverse, #1b1b1b);
|
|
1311
|
+
--_nys-button-color-text-hover: var(--nys-color-text-reverse-weak, #d0d0ce);
|
|
1312
|
+
--_nys-button-color-border-hover: var(--nys-color-neutral-100, #d0d0ce);
|
|
1313
|
+
|
|
1314
|
+
/* Outline Inverted - Pressed/Active */
|
|
1315
|
+
--_nys-button-color-bg-active: var(--nys-color-surface-reverse, #1b1b1b);
|
|
1316
|
+
--_nys-button-color-text-active: var(
|
|
1317
|
+
--nys-color-text-reverse-weaker,
|
|
1318
|
+
#bec0c1
|
|
1319
|
+
);
|
|
1320
|
+
--_nys-button-color-border-active: var(--nys-color-neutral-300, #a7a9ab);
|
|
1321
|
+
|
|
1322
|
+
/* Outline Inverted - Disabled */
|
|
1323
|
+
--_nys-button-color-bg-disabled: var(--nys-color-surface-reverse, #1b1b1b);
|
|
1324
|
+
--_nys-button-color-text-disabled: var(
|
|
1325
|
+
--nys-color-text-reverse-disabled,
|
|
1326
|
+
#62666a
|
|
1327
|
+
);
|
|
1328
|
+
--_nys-button-color-border-disabled: var(--nys-color-neutral-600, #62666a);
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
/* Text Inverted */
|
|
1332
|
+
:host([variant="text"][inverted]) {
|
|
1333
|
+
--_nys-button-height: fit-content;
|
|
1334
|
+
--_nys-button-radius-left: var(--nys-radius-md, 4px);
|
|
1335
|
+
--_nys-button-radius-right: var(--nys-radius-md, 4px);
|
|
1336
|
+
--_nys-button-padding-y: var(--nys-space-2px, 2px);
|
|
1337
|
+
--_nys-button-padding-x: var(--nys-space-50, 4px);
|
|
1338
|
+
--_nys-button-width-border: 0px;
|
|
1339
|
+
--_nys-button-text-decoration: underline;
|
|
1340
|
+
|
|
1341
|
+
/* Text Inverted - Default */
|
|
1342
|
+
--_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
|
|
1343
|
+
--_nys-button-color-text: var(--nys-color-link-reverse, #a7a9ab);
|
|
1344
|
+
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1345
|
+
|
|
1346
|
+
/* Text Inverted - Hover */
|
|
1347
|
+
--_nys-button-color-bg-hover: var(--nys-color-transparent, #ffffff00);
|
|
1348
|
+
--_nys-button-color-text-hover: var(
|
|
1349
|
+
--nys-color-link-reverse-strong,
|
|
1350
|
+
#ededed
|
|
1351
|
+
);
|
|
1352
|
+
--_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
|
|
1353
|
+
|
|
1354
|
+
/* Text Inverted - Pressed/Active */
|
|
1355
|
+
--_nys-button-color-bg-active: var(--nys-color-transparent, #ffffff00);
|
|
1356
|
+
--_nys-button-color-text-active: var(
|
|
1357
|
+
--nys-color-reverse-strongest,
|
|
1358
|
+
#ffffff
|
|
1359
|
+
);
|
|
1360
|
+
--_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
|
|
1361
|
+
|
|
1362
|
+
/* Text Inverted - Disabled */
|
|
1363
|
+
--_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
|
|
1364
|
+
--_nys-button-color-text-disabled: var(
|
|
1365
|
+
--nys-color-text-reverse-disabled,
|
|
1366
|
+
#62666a
|
|
1367
|
+
);
|
|
1368
|
+
--_nys-button-color-border-disabled: var(
|
|
1369
|
+
--nys-color-transparent,
|
|
1370
|
+
#ffffff00
|
|
1371
|
+
);
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/* Ghost Inverted */
|
|
1375
|
+
:host([variant="ghost"][inverted]) {
|
|
1376
|
+
/* Ghost Inverted - Default */
|
|
1377
|
+
--_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
|
|
1378
|
+
--_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
|
|
1379
|
+
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1380
|
+
|
|
1381
|
+
/* Ghost Inverted - Hover */
|
|
1382
|
+
--_nys-button-color-bg-hover: var(
|
|
1383
|
+
--nys-color-white-transparent-100,
|
|
1384
|
+
#ffffff1a
|
|
1385
|
+
);
|
|
1386
|
+
--_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
|
|
1387
|
+
--_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
|
|
1388
|
+
|
|
1389
|
+
/* Ghost Inverted - Pressed/Active */
|
|
1390
|
+
--_nys-button-color-bg-active: var(
|
|
1391
|
+
--nys-color-white-transparent-200,
|
|
1392
|
+
#ffffff33
|
|
1393
|
+
);
|
|
1394
|
+
--_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
|
|
1395
|
+
--_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
|
|
1396
|
+
|
|
1397
|
+
/* Ghost Inverted - Disabled */
|
|
1398
|
+
--_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
|
|
1399
|
+
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #62666a);
|
|
1400
|
+
--_nys-button-color-border-disabled: var(
|
|
1401
|
+
--nys-color-transparent,
|
|
1402
|
+
#ffffff00
|
|
1403
|
+
);
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
.nys-button {
|
|
1407
|
+
width: var(--_nys-button-width);
|
|
1408
|
+
height: var(--_nys-button-height);
|
|
1409
|
+
/* set every corner individually */
|
|
1410
|
+
border-top-left-radius: var(--_nys-button-radius-left);
|
|
1411
|
+
border-bottom-left-radius: var(--_nys-button-radius-left);
|
|
1412
|
+
border-top-right-radius: var(--_nys-button-radius-right);
|
|
1413
|
+
border-bottom-right-radius: var(--_nys-button-radius-right);
|
|
1414
|
+
padding: var(--_nys-button-padding-y) var(--_nys-button-padding-x);
|
|
1415
|
+
display: flex;
|
|
1416
|
+
align-items: center;
|
|
1417
|
+
justify-content: center;
|
|
1418
|
+
gap: var(--_nys-button-gap);
|
|
1419
|
+
font-family: var(--_nys-button-font-family);
|
|
1420
|
+
font-size: var(--_nys-button-font-size);
|
|
1421
|
+
font-weight: var(--_nys-button-font-weight);
|
|
1422
|
+
line-height: var(--_nys-button-line-height);
|
|
1423
|
+
text-decoration: var(--_nys-button-text-decoration);
|
|
1424
|
+
box-sizing: border-box;
|
|
1425
|
+
background-color: var(--_nys-button-color-bg);
|
|
1426
|
+
color: var(--_nys-button-color-text);
|
|
1427
|
+
border: solid var(--_nys-button-width-border)
|
|
1428
|
+
var(--_nys-button-color-border);
|
|
1429
|
+
cursor: pointer;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
.nys-button:hover {
|
|
1433
|
+
background-color: var(--_nys-button-color-bg-hover);
|
|
1434
|
+
color: var(--_nys-button-color-text-hover);
|
|
1435
|
+
border-color: var(--_nys-button-color-border-hover);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
.nys-button:active {
|
|
1439
|
+
background-color: var(--_nys-button-color-bg-active);
|
|
1440
|
+
color: var(--_nys-button-color-text-active);
|
|
1441
|
+
border-color: var(--_nys-button-color-border-active);
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
.nys-button:disabled,
|
|
1445
|
+
a[disabled] {
|
|
1446
|
+
background-color: var(--_nys-button-color-bg-disabled);
|
|
1447
|
+
color: var(--_nys-button-color-text-disabled);
|
|
1448
|
+
border-color: var(--_nys-button-color-border-disabled);
|
|
1449
|
+
cursor: not-allowed;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
.nys-button__linkwrapper:has([disabled]) {
|
|
1453
|
+
cursor: not-allowed;
|
|
1454
|
+
width: fit-content;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
/* Remove click functionality from disabled link button */
|
|
1458
|
+
a[disabled] {
|
|
1459
|
+
pointer-events: none;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
a[disabled]:hover {
|
|
1463
|
+
background-color: var(--_nys-button-color-bg-disabled);
|
|
1464
|
+
color: var(--_nys-button-color-text-disabled);
|
|
1465
|
+
border-color: var(--_nys-button-color-border-disabled);
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
.nys-button * {
|
|
1469
|
+
cursor: pointer;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.nys-button:disabled * {
|
|
1473
|
+
cursor: not-allowed;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
.nys-button:focus-visible {
|
|
1477
|
+
outline-offset: var(--_nys-button-offset-focus);
|
|
1478
|
+
outline: solid var(--_nys-button-width-focus) var(--_nys-button-color-focus);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
.nys-button__text {
|
|
1482
|
+
display: flex;
|
|
1483
|
+
align-items: center;
|
|
1484
|
+
user-select: none;
|
|
1485
|
+
}
|
|
1486
|
+
`;
|
|
1487
|
+
/**
|
|
1488
|
+
* @license
|
|
1489
|
+
* Copyright 2017 Google LLC
|
|
1490
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1491
|
+
*/
|
|
1492
|
+
const ot = globalThis, nt = ot.trustedTypes, Nt = nt ? nt.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, te = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, ee = "?" + C, De = `<${ee}>`, N = document, it = () => N.createComment(""), Z = (o) => o === null || typeof o != "object" && typeof o != "function", $t = Array.isArray, Le = (o) => $t(o) || typeof (o == null ? void 0 : o[Symbol.iterator]) == "function", pt = `[
|
|
1493
|
+
\f\r]`, q = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Rt = /-->/g, zt = />/g, M = RegExp(`>|${pt}(?:([^\\s"'>=/]+)(${pt}*=${pt}*(?:[^
|
|
1494
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Dt = /'/g, Lt = /"/g, se = /^(?:script|style|textarea|title)$/i, Y = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Vt = /* @__PURE__ */ new WeakMap(), O = N.createTreeWalker(N, 129);
|
|
1495
|
+
function re(o, t) {
|
|
1496
|
+
if (!$t(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
1497
|
+
return Nt !== void 0 ? Nt.createHTML(t) : t;
|
|
1498
|
+
}
|
|
1499
|
+
const Ve = (o, t) => {
|
|
1500
|
+
const e = o.length - 1, s = [];
|
|
1501
|
+
let r, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = q;
|
|
1502
|
+
for (let l = 0; l < e; l++) {
|
|
1503
|
+
const a = o[l];
|
|
1504
|
+
let c, d, h = -1, y = 0;
|
|
1505
|
+
for (; y < a.length && (n.lastIndex = y, d = n.exec(a), d !== null); ) y = n.lastIndex, n === q ? d[1] === "!--" ? n = Rt : d[1] !== void 0 ? n = zt : d[2] !== void 0 ? (se.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = M) : d[3] !== void 0 && (n = M) : n === M ? d[0] === ">" ? (n = r ?? q, h = -1) : d[1] === void 0 ? h = -2 : (h = n.lastIndex - d[2].length, c = d[1], n = d[3] === void 0 ? M : d[3] === '"' ? Lt : Dt) : n === Lt || n === Dt ? n = M : n === Rt || n === zt ? n = q : (n = M, r = void 0);
|
|
1506
|
+
const g = n === M && o[l + 1].startsWith("/>") ? " " : "";
|
|
1507
|
+
i += n === q ? a + De : h >= 0 ? (s.push(c), a.slice(0, h) + te + a.slice(h) + C + g) : a + C + (h === -2 ? l : g);
|
|
1508
|
+
}
|
|
1509
|
+
return [re(o, i + (o[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
1510
|
+
};
|
|
1511
|
+
class J {
|
|
1512
|
+
constructor({ strings: t, _$litType$: e }, s) {
|
|
1513
|
+
let r;
|
|
1514
|
+
this.parts = [];
|
|
1515
|
+
let i = 0, n = 0;
|
|
1516
|
+
const l = t.length - 1, a = this.parts, [c, d] = Ve(t, e);
|
|
1517
|
+
if (this.el = J.createElement(c, s), O.currentNode = this.el.content, e === 2 || e === 3) {
|
|
1518
|
+
const h = this.el.content.firstChild;
|
|
1519
|
+
h.replaceWith(...h.childNodes);
|
|
1520
|
+
}
|
|
1521
|
+
for (; (r = O.nextNode()) !== null && a.length < l; ) {
|
|
1522
|
+
if (r.nodeType === 1) {
|
|
1523
|
+
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(te)) {
|
|
1524
|
+
const y = d[n++], g = r.getAttribute(h).split(C), S = /([.?@])?(.*)/.exec(y);
|
|
1525
|
+
a.push({ type: 1, index: i, name: S[2], strings: g, ctor: S[1] === "." ? qe : S[1] === "?" ? je : S[1] === "@" ? Fe : ht }), r.removeAttribute(h);
|
|
1526
|
+
} else h.startsWith(C) && (a.push({ type: 6, index: i }), r.removeAttribute(h));
|
|
1527
|
+
if (se.test(r.tagName)) {
|
|
1528
|
+
const h = r.textContent.split(C), y = h.length - 1;
|
|
1529
|
+
if (y > 0) {
|
|
1530
|
+
r.textContent = nt ? nt.emptyScript : "";
|
|
1531
|
+
for (let g = 0; g < y; g++) r.append(h[g], it()), O.nextNode(), a.push({ type: 2, index: ++i });
|
|
1532
|
+
r.append(h[y], it());
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
} else if (r.nodeType === 8) if (r.data === ee) a.push({ type: 2, index: i });
|
|
1536
|
+
else {
|
|
1537
|
+
let h = -1;
|
|
1538
|
+
for (; (h = r.data.indexOf(C, h + 1)) !== -1; ) a.push({ type: 7, index: i }), h += C.length - 1;
|
|
1539
|
+
}
|
|
1540
|
+
i++;
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
static createElement(t, e) {
|
|
1544
|
+
const s = N.createElement("template");
|
|
1545
|
+
return s.innerHTML = t, s;
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
function D(o, t, e = o, s) {
|
|
1549
|
+
var r, i;
|
|
1550
|
+
if (t === Y) return t;
|
|
1551
|
+
let n = s !== void 0 ? (r = e._$Co) == null ? void 0 : r[s] : e._$Cl;
|
|
1552
|
+
const l = Z(t) ? void 0 : t._$litDirective$;
|
|
1553
|
+
return (n == null ? void 0 : n.constructor) !== l && ((i = n == null ? void 0 : n._$AO) == null || i.call(n, !1), l === void 0 ? n = void 0 : (n = new l(o), n._$AT(o, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = n : e._$Cl = n), n !== void 0 && (t = D(o, n._$AS(o, t.values), n, s)), t;
|
|
1554
|
+
}
|
|
1555
|
+
class Be {
|
|
1556
|
+
constructor(t, e) {
|
|
1557
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
1558
|
+
}
|
|
1559
|
+
get parentNode() {
|
|
1560
|
+
return this._$AM.parentNode;
|
|
1561
|
+
}
|
|
1562
|
+
get _$AU() {
|
|
1563
|
+
return this._$AM._$AU;
|
|
1564
|
+
}
|
|
1565
|
+
u(t) {
|
|
1566
|
+
const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? N).importNode(e, !0);
|
|
1567
|
+
O.currentNode = r;
|
|
1568
|
+
let i = O.nextNode(), n = 0, l = 0, a = s[0];
|
|
1569
|
+
for (; a !== void 0; ) {
|
|
1570
|
+
if (n === a.index) {
|
|
1571
|
+
let c;
|
|
1572
|
+
a.type === 2 ? c = new lt(i, i.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, t) : a.type === 6 && (c = new We(i, this, t)), this._$AV.push(c), a = s[++l];
|
|
1573
|
+
}
|
|
1574
|
+
n !== (a == null ? void 0 : a.index) && (i = O.nextNode(), n++);
|
|
1575
|
+
}
|
|
1576
|
+
return O.currentNode = N, r;
|
|
1577
|
+
}
|
|
1578
|
+
p(t) {
|
|
1579
|
+
let e = 0;
|
|
1580
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
class lt {
|
|
1584
|
+
get _$AU() {
|
|
1585
|
+
var t;
|
|
1586
|
+
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
1587
|
+
}
|
|
1588
|
+
constructor(t, e, s, r) {
|
|
1589
|
+
this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
|
|
1590
|
+
}
|
|
1591
|
+
get parentNode() {
|
|
1592
|
+
let t = this._$AA.parentNode;
|
|
1593
|
+
const e = this._$AM;
|
|
1594
|
+
return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
|
|
1595
|
+
}
|
|
1596
|
+
get startNode() {
|
|
1597
|
+
return this._$AA;
|
|
1598
|
+
}
|
|
1599
|
+
get endNode() {
|
|
1600
|
+
return this._$AB;
|
|
1601
|
+
}
|
|
1602
|
+
_$AI(t, e = this) {
|
|
1603
|
+
t = D(this, t, e), Z(t) ? t === v || t == null || t === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : t !== this._$AH && t !== Y && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Le(t) ? this.k(t) : this._(t);
|
|
1604
|
+
}
|
|
1605
|
+
O(t) {
|
|
1606
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
1607
|
+
}
|
|
1608
|
+
T(t) {
|
|
1609
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
1610
|
+
}
|
|
1611
|
+
_(t) {
|
|
1612
|
+
this._$AH !== v && Z(this._$AH) ? this._$AA.nextSibling.data = t : this.T(N.createTextNode(t)), this._$AH = t;
|
|
1613
|
+
}
|
|
1614
|
+
$(t) {
|
|
1615
|
+
var e;
|
|
1616
|
+
const { values: s, _$litType$: r } = t, i = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = J.createElement(re(r.h, r.h[0]), this.options)), r);
|
|
1617
|
+
if (((e = this._$AH) == null ? void 0 : e._$AD) === i) this._$AH.p(s);
|
|
1618
|
+
else {
|
|
1619
|
+
const n = new Be(i, this), l = n.u(this.options);
|
|
1620
|
+
n.p(s), this.T(l), this._$AH = n;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
_$AC(t) {
|
|
1624
|
+
let e = Vt.get(t.strings);
|
|
1625
|
+
return e === void 0 && Vt.set(t.strings, e = new J(t)), e;
|
|
1626
|
+
}
|
|
1627
|
+
k(t) {
|
|
1628
|
+
$t(this._$AH) || (this._$AH = [], this._$AR());
|
|
1629
|
+
const e = this._$AH;
|
|
1630
|
+
let s, r = 0;
|
|
1631
|
+
for (const i of t) r === e.length ? e.push(s = new lt(this.O(it()), this.O(it()), this, this.options)) : s = e[r], s._$AI(i), r++;
|
|
1632
|
+
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
1633
|
+
}
|
|
1634
|
+
_$AR(t = this._$AA.nextSibling, e) {
|
|
1635
|
+
var s;
|
|
1636
|
+
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
1637
|
+
const r = t.nextSibling;
|
|
1638
|
+
t.remove(), t = r;
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
setConnected(t) {
|
|
1642
|
+
var e;
|
|
1643
|
+
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
class ht {
|
|
1647
|
+
get tagName() {
|
|
1648
|
+
return this.element.tagName;
|
|
1649
|
+
}
|
|
1650
|
+
get _$AU() {
|
|
1651
|
+
return this._$AM._$AU;
|
|
1652
|
+
}
|
|
1653
|
+
constructor(t, e, s, r, i) {
|
|
1654
|
+
this.type = 1, this._$AH = v, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = v;
|
|
1655
|
+
}
|
|
1656
|
+
_$AI(t, e = this, s, r) {
|
|
1657
|
+
const i = this.strings;
|
|
1658
|
+
let n = !1;
|
|
1659
|
+
if (i === void 0) t = D(this, t, e, 0), n = !Z(t) || t !== this._$AH && t !== Y, n && (this._$AH = t);
|
|
1660
|
+
else {
|
|
1661
|
+
const l = t;
|
|
1662
|
+
let a, c;
|
|
1663
|
+
for (t = i[0], a = 0; a < i.length - 1; a++) c = D(this, l[s + a], e, a), c === Y && (c = this._$AH[a]), n || (n = !Z(c) || c !== this._$AH[a]), c === v ? t = v : t !== v && (t += (c ?? "") + i[a + 1]), this._$AH[a] = c;
|
|
1664
|
+
}
|
|
1665
|
+
n && !r && this.j(t);
|
|
1666
|
+
}
|
|
1667
|
+
j(t) {
|
|
1668
|
+
t === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
class qe extends ht {
|
|
1672
|
+
constructor() {
|
|
1673
|
+
super(...arguments), this.type = 3;
|
|
1674
|
+
}
|
|
1675
|
+
j(t) {
|
|
1676
|
+
this.element[this.name] = t === v ? void 0 : t;
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
class je extends ht {
|
|
1680
|
+
constructor() {
|
|
1681
|
+
super(...arguments), this.type = 4;
|
|
1682
|
+
}
|
|
1683
|
+
j(t) {
|
|
1684
|
+
this.element.toggleAttribute(this.name, !!t && t !== v);
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
class Fe extends ht {
|
|
1688
|
+
constructor(t, e, s, r, i) {
|
|
1689
|
+
super(t, e, s, r, i), this.type = 5;
|
|
1690
|
+
}
|
|
1691
|
+
_$AI(t, e = this) {
|
|
1692
|
+
if ((t = D(this, t, e, 0) ?? v) === Y) return;
|
|
1693
|
+
const s = this._$AH, r = t === v && s !== v || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, i = t !== v && (s === v || r);
|
|
1694
|
+
r && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
1695
|
+
}
|
|
1696
|
+
handleEvent(t) {
|
|
1697
|
+
var e;
|
|
1698
|
+
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
class We {
|
|
1702
|
+
constructor(t, e, s) {
|
|
1703
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
1704
|
+
}
|
|
1705
|
+
get _$AU() {
|
|
1706
|
+
return this._$AM._$AU;
|
|
1707
|
+
}
|
|
1708
|
+
_$AI(t) {
|
|
1709
|
+
D(this, t);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
const Bt = ot.litHtmlPolyfillSupport;
|
|
1713
|
+
Bt == null || Bt(J, lt), (ot.litHtmlVersions ?? (ot.litHtmlVersions = [])).push("3.2.1");
|
|
1714
|
+
/**
|
|
1715
|
+
* @license
|
|
1716
|
+
* Copyright 2018 Google LLC
|
|
1717
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1718
|
+
*/
|
|
1719
|
+
const E = (o) => o ?? v;
|
|
1720
|
+
var Ge = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, m = (o, t, e, s) => {
|
|
1721
|
+
for (var r = s > 1 ? void 0 : s ? Ke(t, e) : t, i = o.length - 1, n; i >= 0; i--)
|
|
1722
|
+
(n = o[i]) && (r = (s ? n(t, e, r) : n(r)) || r);
|
|
1723
|
+
return s && r && Ge(t, e, r), r;
|
|
1724
|
+
};
|
|
1725
|
+
let Ze = 0;
|
|
1726
|
+
var x;
|
|
1727
|
+
const _ = (x = class extends jt {
|
|
1728
|
+
// allows use of elementInternals' API
|
|
1729
|
+
constructor() {
|
|
1730
|
+
super(), this.id = "", this.name = "", this._size = "md", this.fullWidth = !1, this._variant = "filled", this.inverted = !1, this.label = "", this.ariaLabel = "", this.prefixIcon = "", this.suffixIcon = "", this.disabled = !1, this.form = "", this.value = "", this._type = "button", this.onClick = () => {
|
|
1731
|
+
}, this.href = "", this._target = "_self", this._internals = this.attachInternals();
|
|
1732
|
+
}
|
|
1733
|
+
get size() {
|
|
1734
|
+
return this._size;
|
|
1735
|
+
}
|
|
1736
|
+
set size(o) {
|
|
1737
|
+
this._size = x.VALID_SIZES.includes(
|
|
1738
|
+
o
|
|
1739
|
+
) ? o : "md";
|
|
1740
|
+
}
|
|
1741
|
+
get variant() {
|
|
1742
|
+
return this._variant;
|
|
1743
|
+
}
|
|
1744
|
+
set variant(o) {
|
|
1745
|
+
this._variant = x.VALID_VARIANTS.includes(
|
|
1746
|
+
o
|
|
1747
|
+
) ? o : "filled";
|
|
1748
|
+
}
|
|
1749
|
+
get type() {
|
|
1750
|
+
return this._type;
|
|
1751
|
+
}
|
|
1752
|
+
set type(o) {
|
|
1753
|
+
this._type = x.VALID_TYPES.includes(
|
|
1754
|
+
o
|
|
1755
|
+
) ? o : "button";
|
|
1756
|
+
}
|
|
1757
|
+
get target() {
|
|
1758
|
+
return this._target;
|
|
1759
|
+
}
|
|
1760
|
+
set target(o) {
|
|
1761
|
+
this._target = x.VALID_TARGETS.includes(
|
|
1762
|
+
o
|
|
1763
|
+
) ? o : "_self";
|
|
1764
|
+
}
|
|
1765
|
+
connectedCallback() {
|
|
1766
|
+
super.connectedCallback(), this.id || (this.id = this._generateUniqueId());
|
|
1767
|
+
}
|
|
1768
|
+
/******************** Functions ********************/
|
|
1769
|
+
_generateUniqueId() {
|
|
1770
|
+
return `nys-button-${Date.now()}-${Ze++}`;
|
|
1771
|
+
}
|
|
1772
|
+
_manageFormAction(o) {
|
|
1773
|
+
typeof this.onClick == "function" && this.onClick(o);
|
|
1774
|
+
const t = this._internals.form;
|
|
1775
|
+
if (t)
|
|
1776
|
+
switch (this.type) {
|
|
1777
|
+
case "submit":
|
|
1778
|
+
t.requestSubmit();
|
|
1779
|
+
break;
|
|
1780
|
+
case "reset":
|
|
1781
|
+
t.reset();
|
|
1782
|
+
break;
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
/******************** Event Handlers ********************/
|
|
1786
|
+
// Handle focus event
|
|
1787
|
+
_handleFocus() {
|
|
1788
|
+
this.dispatchEvent(new Event("nys-focus"));
|
|
1789
|
+
}
|
|
1790
|
+
// Handle blur event
|
|
1791
|
+
_handleBlur() {
|
|
1792
|
+
this.dispatchEvent(new Event("nys-blur"));
|
|
1793
|
+
}
|
|
1794
|
+
_handleClick(o) {
|
|
1795
|
+
if (this.disabled) {
|
|
1796
|
+
o.preventDefault();
|
|
1797
|
+
return;
|
|
1798
|
+
}
|
|
1799
|
+
this._manageFormAction(o), this.dispatchEvent(new Event("nys-click"));
|
|
1800
|
+
}
|
|
1801
|
+
// Handle keydown for keyboard accessibility
|
|
1802
|
+
_handleKeydown(o) {
|
|
1803
|
+
(o.code === "Space" || o.code === "Enter" || o.key === " " || o.key === "Enter") && (o.preventDefault(), this.disabled || this._manageFormAction(o));
|
|
1804
|
+
}
|
|
1805
|
+
render() {
|
|
1806
|
+
return A`
|
|
1807
|
+
${this.href ? A`
|
|
1808
|
+
<div class="nys-button__linkwrapper">
|
|
1809
|
+
<a
|
|
1810
|
+
class="nys-button"
|
|
1811
|
+
id=${E(this.id)}
|
|
1812
|
+
name=${E(this.name ? this.name : void 0)}
|
|
1813
|
+
?disabled=${this.disabled}
|
|
1814
|
+
aria-disabled="${this.disabled ? "true" : "false"}"
|
|
1815
|
+
form=${E(this.form ? this.form : void 0)}
|
|
1816
|
+
value=${E(this.value ? this.value : void 0)}
|
|
1817
|
+
href=${this.href}
|
|
1818
|
+
target=${this.target}
|
|
1819
|
+
aria-label=${this.ariaLabel || this.label || "button"}
|
|
1820
|
+
@click=${this._handleClick}
|
|
1821
|
+
@focus="${this._handleFocus}"
|
|
1822
|
+
@blur="${this._handleBlur}"
|
|
1823
|
+
>
|
|
1824
|
+
${this.prefixIcon && this.variant !== "text" ? A`<slot name="prefix-icon">
|
|
1825
|
+
<nys-icon size="16" name=${this.prefixIcon}></nys-icon>
|
|
1826
|
+
</slot>` : ""}
|
|
1827
|
+
${this.label ? A`<label class="nys-button__text">${this.label}</label>` : ""}
|
|
1828
|
+
${this.suffixIcon && this.variant !== "text" ? A`<slot name="suffix-icon">
|
|
1829
|
+
<nys-icon size="16" name=${this.suffixIcon}></nys-icon>
|
|
1830
|
+
</slot>` : ""}
|
|
1831
|
+
</a>
|
|
1832
|
+
</div>
|
|
1833
|
+
` : A`
|
|
1834
|
+
<button
|
|
1835
|
+
class="nys-button"
|
|
1836
|
+
id=${E(this.id)}
|
|
1837
|
+
name=${E(this.name ? this.name : void 0)}
|
|
1838
|
+
?disabled=${this.disabled}
|
|
1839
|
+
form=${E(this.form ? this.form : void 0)}
|
|
1840
|
+
value=${E(this.value ? this.value : void 0)}
|
|
1841
|
+
type=${this.type}
|
|
1842
|
+
aria-label=${this.ariaLabel || this.label || "button"}
|
|
1843
|
+
@click=${this._handleClick}
|
|
1844
|
+
@focus="${this._handleFocus}"
|
|
1845
|
+
@blur="${this._handleBlur}"
|
|
1846
|
+
@keydown="${this._handleKeydown}"
|
|
1847
|
+
>
|
|
1848
|
+
${this.prefixIcon && this.variant !== "text" ? A`<slot name="prefix-icon">
|
|
1849
|
+
<nys-icon size="16" name=${this.prefixIcon}></nys-icon>
|
|
1850
|
+
</slot>` : ""}
|
|
1851
|
+
${this.label ? A`<label class="nys-button__text">${this.label}</label>` : ""}
|
|
1852
|
+
${this.suffixIcon && this.variant !== "text" ? A`<slot name="suffix-icon">
|
|
1853
|
+
<nys-icon size="16" name=${this.suffixIcon}></nys-icon>
|
|
1854
|
+
</slot>` : ""}
|
|
1855
|
+
</button>
|
|
1856
|
+
`}
|
|
1857
|
+
`;
|
|
1858
|
+
}
|
|
1859
|
+
}, x.VALID_SIZES = ["sm", "md", "lg"], x.VALID_VARIANTS = [
|
|
1860
|
+
"filled",
|
|
1861
|
+
"outline",
|
|
1862
|
+
"ghost",
|
|
1863
|
+
"text"
|
|
1864
|
+
], x.VALID_TYPES = ["submit", "reset", "button"], x.VALID_TARGETS = [
|
|
1865
|
+
"_self",
|
|
1866
|
+
"_blank",
|
|
1867
|
+
"_parent",
|
|
1868
|
+
"_top",
|
|
1869
|
+
"framename"
|
|
1870
|
+
], x.styles = ze, x.formAssociated = !0, x);
|
|
1871
|
+
m([
|
|
1872
|
+
$({ type: String })
|
|
1873
|
+
], _.prototype, "id", 2);
|
|
1874
|
+
m([
|
|
1875
|
+
$({ type: String, reflect: !0 })
|
|
1876
|
+
], _.prototype, "name", 2);
|
|
1877
|
+
m([
|
|
1878
|
+
$({ reflect: !0 })
|
|
1879
|
+
], _.prototype, "size", 1);
|
|
1880
|
+
m([
|
|
1881
|
+
$({ type: Boolean, reflect: !0 })
|
|
1882
|
+
], _.prototype, "fullWidth", 2);
|
|
1883
|
+
m([
|
|
1884
|
+
$({ reflect: !0 })
|
|
1885
|
+
], _.prototype, "variant", 1);
|
|
1886
|
+
m([
|
|
1887
|
+
$({ type: Boolean, reflect: !0 })
|
|
1888
|
+
], _.prototype, "inverted", 2);
|
|
1889
|
+
m([
|
|
1890
|
+
$({ type: String })
|
|
1891
|
+
], _.prototype, "label", 2);
|
|
1892
|
+
m([
|
|
1893
|
+
$({ type: String })
|
|
1894
|
+
], _.prototype, "ariaLabel", 2);
|
|
1895
|
+
m([
|
|
1896
|
+
$({ type: String })
|
|
1897
|
+
], _.prototype, "prefixIcon", 2);
|
|
1898
|
+
m([
|
|
1899
|
+
$({ type: String })
|
|
1900
|
+
], _.prototype, "suffixIcon", 2);
|
|
1901
|
+
m([
|
|
1902
|
+
$({ type: Boolean, reflect: !0 })
|
|
1903
|
+
], _.prototype, "disabled", 2);
|
|
1904
|
+
m([
|
|
1905
|
+
$({ type: String })
|
|
1906
|
+
], _.prototype, "form", 2);
|
|
1907
|
+
m([
|
|
1908
|
+
$({ type: String })
|
|
1909
|
+
], _.prototype, "value", 2);
|
|
1910
|
+
m([
|
|
1911
|
+
$({ reflect: !0 })
|
|
1912
|
+
], _.prototype, "type", 1);
|
|
1913
|
+
m([
|
|
1914
|
+
$({ type: Function })
|
|
1915
|
+
], _.prototype, "onClick", 2);
|
|
1916
|
+
m([
|
|
1917
|
+
$({ type: String })
|
|
1918
|
+
], _.prototype, "href", 2);
|
|
1919
|
+
m([
|
|
1920
|
+
$({ reflect: !0 })
|
|
1921
|
+
], _.prototype, "target", 1);
|
|
1922
|
+
let Ye = _;
|
|
1923
|
+
customElements.get("nys-button") || customElements.define("nys-button", Ye);
|
|
1924
|
+
var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, f = (o, t, e, s) => {
|
|
1925
|
+
for (var r = s > 1 ? void 0 : s ? Qe(t, e) : t, i = o.length - 1, n; i >= 0; i--)
|
|
1926
|
+
(n = o[i]) && (r = (s ? n(t, e, r) : n(r)) || r);
|
|
1927
|
+
return s && r && Je(t, e, r), r;
|
|
1928
|
+
};
|
|
1929
|
+
let Xe = 0;
|
|
1930
|
+
var w;
|
|
1931
|
+
const u = (w = class extends jt {
|
|
1932
|
+
// allows use of elementInternals' API
|
|
1933
|
+
constructor() {
|
|
1934
|
+
super(), this.id = "", this.name = "", this._type = "text", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this.form = "", this.pattern = "", this.maxlength = null, this.width = "full", this.step = null, this.min = null, this.max = null, this.showError = !1, this.errorMessage = "", this.showPassword = !1, this._originalErrorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
|
|
1935
|
+
}
|
|
1936
|
+
get type() {
|
|
1937
|
+
return this._type;
|
|
1938
|
+
}
|
|
1939
|
+
set type(t) {
|
|
1940
|
+
this._type = w.VALID_TYPES.includes(
|
|
1941
|
+
t
|
|
1942
|
+
) ? t : "text";
|
|
1943
|
+
}
|
|
1944
|
+
// Ensure the "width" property is valid after updates
|
|
1945
|
+
async updated(t) {
|
|
1946
|
+
t.has("width") && (await Promise.resolve(), this.width = w.VALID_WIDTHS.includes(this.width) ? this.width : "full"), t.has("disabled") && (this._validateButtonSlot("startButton"), this._validateButtonSlot("endButton"));
|
|
1947
|
+
}
|
|
1948
|
+
// Generate a unique ID if one is not provided
|
|
1949
|
+
connectedCallback() {
|
|
1950
|
+
super.connectedCallback(), this.id || (this.id = `nys-textinput-${Date.now()}-${Xe++}`), this._originalErrorMessage = this.errorMessage ?? "", this.addEventListener("invalid", this._handleInvalid);
|
|
1951
|
+
}
|
|
1952
|
+
disconnectedCallback() {
|
|
1953
|
+
super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid);
|
|
1954
|
+
}
|
|
1955
|
+
firstUpdated() {
|
|
1956
|
+
this._setValue(), this._manageRequire();
|
|
1957
|
+
}
|
|
1958
|
+
// This callback is automatically called when the parent form is reset.
|
|
1959
|
+
formResetCallback() {
|
|
1960
|
+
this.value = "";
|
|
1961
|
+
}
|
|
1962
|
+
/********************** Form Integration **********************/
|
|
1963
|
+
_setValue() {
|
|
1964
|
+
this._internals.setFormValue(this.value), this._manageRequire();
|
|
1965
|
+
}
|
|
1966
|
+
_manageRequire() {
|
|
1967
|
+
var r, i;
|
|
1968
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector("input");
|
|
1969
|
+
if (!t) return;
|
|
1970
|
+
const e = this.errorMessage || "This field is required";
|
|
1971
|
+
this.required && (!this.value || ((i = this.value) == null ? void 0 : i.trim()) === "") ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, e, t)) : (this._internals.ariaRequired = "false", this._internals.setValidity({}), this._hasUserInteracted = !1);
|
|
1972
|
+
}
|
|
1973
|
+
_setValidityMessage(t = "") {
|
|
1974
|
+
var r, i;
|
|
1975
|
+
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector("input");
|
|
1976
|
+
if (!e) return;
|
|
1977
|
+
this.showError = !!t, (i = this._originalErrorMessage) != null && i.trim() && t !== "" ? this.errorMessage = this._originalErrorMessage : this.errorMessage = t;
|
|
1978
|
+
const s = t ? { customError: !0 } : {};
|
|
1979
|
+
this._internals.setValidity(s, this.errorMessage, e);
|
|
1980
|
+
}
|
|
1981
|
+
_validate() {
|
|
1982
|
+
var r;
|
|
1983
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector("input");
|
|
1984
|
+
if (!t) return;
|
|
1985
|
+
const e = t.validity;
|
|
1986
|
+
let s = "";
|
|
1987
|
+
e.valueMissing ? s = "This field is required" : e.typeMismatch ? s = "Invalid format for this type" : e.patternMismatch ? s = "Invalid format" : e.tooShort ? s = `Value is too short. Minimum length is ${t.minLength}` : e.tooLong ? s = `Value is too long. Maximum length is ${t.maxLength}` : e.rangeUnderflow ? s = `Value must be at least ${t.min}` : e.rangeOverflow ? s = `Value must be at most ${t.max}` : e.stepMismatch ? s = "Invalid step value" : s = t.validationMessage, this._setValidityMessage(s);
|
|
1988
|
+
}
|
|
1989
|
+
/********************** Functions **********************/
|
|
1990
|
+
// This helper function is called to perform the element's native validation.
|
|
1991
|
+
checkValidity() {
|
|
1992
|
+
var e;
|
|
1993
|
+
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("input");
|
|
1994
|
+
return t ? t.checkValidity() : !0;
|
|
1995
|
+
}
|
|
1996
|
+
_handleInvalid(t) {
|
|
1997
|
+
var s;
|
|
1998
|
+
t.preventDefault(), this._hasUserInteracted = !0, this._validate();
|
|
1999
|
+
const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("input");
|
|
2000
|
+
if (e) {
|
|
2001
|
+
const r = this._internals.form;
|
|
2002
|
+
r ? Array.from(r.elements).find(
|
|
2003
|
+
(l) => typeof l.checkValidity == "function" && !l.checkValidity()
|
|
2004
|
+
) === this && e.focus() : e.focus();
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
_togglePasswordVisibility() {
|
|
2008
|
+
this.showPassword = !this.showPassword;
|
|
2009
|
+
}
|
|
2010
|
+
/******************** Event Handlers ********************/
|
|
2011
|
+
// Handle input event to check pattern validity
|
|
2012
|
+
_handleInput(t) {
|
|
2013
|
+
const e = t.target;
|
|
2014
|
+
this.value = e.value, this._internals.setFormValue(this.value), this._hasUserInteracted && this._validate(), this.dispatchEvent(
|
|
2015
|
+
new CustomEvent("nys-input", {
|
|
2016
|
+
detail: { value: this.value },
|
|
2017
|
+
bubbles: !0,
|
|
2018
|
+
composed: !0
|
|
2019
|
+
})
|
|
2020
|
+
);
|
|
2021
|
+
}
|
|
2022
|
+
// Handle focus event
|
|
2023
|
+
_handleFocus() {
|
|
2024
|
+
this.dispatchEvent(new Event("nys-focus"));
|
|
2025
|
+
}
|
|
2026
|
+
// Handle blur event
|
|
2027
|
+
_handleBlur() {
|
|
2028
|
+
this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), this.dispatchEvent(new Event("nys-blur"));
|
|
2029
|
+
}
|
|
2030
|
+
_validateButtonSlot(t) {
|
|
2031
|
+
var n, l;
|
|
2032
|
+
const e = (n = this.shadowRoot) == null ? void 0 : n.querySelector(
|
|
2033
|
+
'slot[name="' + t + '"]'
|
|
2034
|
+
), s = (l = this.shadowRoot) == null ? void 0 : l.querySelector(
|
|
2035
|
+
".nys-textinput__buttoncontainer"
|
|
2036
|
+
);
|
|
2037
|
+
if (!e || !s) return;
|
|
2038
|
+
const r = e.assignedElements();
|
|
2039
|
+
let i = !1;
|
|
2040
|
+
r.forEach((a) => {
|
|
2041
|
+
a instanceof HTMLElement && a.tagName.toLowerCase() === "nys-button" && !i ? (i = !0, a.setAttribute("size", "sm"), a.setAttribute("variant", "primary"), this.disabled ? a.setAttribute("disabled", "true") : a.removeAttribute("disabled")) : (console.warn(
|
|
2042
|
+
"The '" + t + "' slot only accepts a single <nys-button> element. Removing invalid or extra node:",
|
|
2043
|
+
a
|
|
2044
|
+
), a.remove());
|
|
2045
|
+
}), t === "startButton" ? s.classList.toggle("has-start-button", i) : t === "endButton" && s.classList.toggle("has-end-button", i);
|
|
826
2046
|
}
|
|
827
2047
|
render() {
|
|
828
|
-
return
|
|
2048
|
+
return A`
|
|
829
2049
|
<div class="nys-textinput">
|
|
830
2050
|
<nys-label
|
|
831
2051
|
id=${this.id}
|
|
@@ -835,41 +2055,58 @@ const d = (f = class extends ht {
|
|
|
835
2055
|
>
|
|
836
2056
|
<slot name="description" slot="description">${this.description}</slot>
|
|
837
2057
|
</nys-label>
|
|
838
|
-
<div class="nys-
|
|
839
|
-
<
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
2058
|
+
<div class="nys-textinput__buttoncontainer">
|
|
2059
|
+
<slot
|
|
2060
|
+
name="startButton"
|
|
2061
|
+
@slotchange=${this._validateButtonSlot("startButton")}
|
|
2062
|
+
></slot>
|
|
2063
|
+
<div class="nys-textinput__container">
|
|
2064
|
+
<input
|
|
2065
|
+
class="nys-textinput__input"
|
|
2066
|
+
type=${this.type === "password" ? this.showPassword ? "text" : "password" : this.type}
|
|
2067
|
+
name=${this.name}
|
|
2068
|
+
id=${this.id}
|
|
2069
|
+
?disabled=${this.disabled}
|
|
2070
|
+
?required=${this.required}
|
|
2071
|
+
?readonly=${this.readonly}
|
|
2072
|
+
aria-required=${this.required}
|
|
2073
|
+
aria-disabled="${this.disabled}"
|
|
2074
|
+
aria-label="${[this.label, this.description].filter(Boolean).join(" ")}"
|
|
2075
|
+
.value=${this.value}
|
|
2076
|
+
placeholder=${T(
|
|
852
2077
|
this.placeholder ? this.placeholder : void 0
|
|
853
2078
|
)}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
2079
|
+
pattern=${T(this.pattern ? this.pattern : void 0)}
|
|
2080
|
+
min=${T(this.min !== "" ? this.min : void 0)}
|
|
2081
|
+
maxlength=${T(
|
|
857
2082
|
this.maxlength !== "" ? this.maxlength : void 0
|
|
858
2083
|
)}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
2084
|
+
step=${T(this.step !== "" ? this.step : void 0)}
|
|
2085
|
+
max=${T(this.max !== "" ? this.max : void 0)}
|
|
2086
|
+
form=${T(this.form ? this.form : void 0)}
|
|
2087
|
+
@input=${this._handleInput}
|
|
2088
|
+
@focus="${this._handleFocus}"
|
|
2089
|
+
@blur="${this._handleBlur}"
|
|
2090
|
+
/>
|
|
2091
|
+
${this.type === "password" ? A` <nys-button
|
|
2092
|
+
class="eye-icon"
|
|
2093
|
+
id="password-toggle"
|
|
2094
|
+
suffixIcon="slotted"
|
|
2095
|
+
.onClick=${() => !this.disabled && this._togglePasswordVisibility()}
|
|
2096
|
+
variant="ghost"
|
|
2097
|
+
size="sm"
|
|
2098
|
+
>
|
|
2099
|
+
<nys-icon
|
|
2100
|
+
slot="suffix-icon"
|
|
2101
|
+
size="2xl"
|
|
2102
|
+
name=${this.showPassword ? "visibility_off" : "visibility"}
|
|
2103
|
+
></nys-icon>
|
|
2104
|
+
</nys-button>` : ""}
|
|
2105
|
+
</div>
|
|
2106
|
+
<slot
|
|
2107
|
+
name="endButton"
|
|
2108
|
+
@slotchange=${this._validateButtonSlot("endButton")}
|
|
2109
|
+
></slot>
|
|
873
2110
|
</div>
|
|
874
2111
|
<nys-errormessage
|
|
875
2112
|
?showError=${this.showError}
|
|
@@ -878,7 +2115,7 @@ const d = (f = class extends ht {
|
|
|
878
2115
|
</div>
|
|
879
2116
|
`;
|
|
880
2117
|
}
|
|
881
|
-
},
|
|
2118
|
+
}, w.VALID_TYPES = [
|
|
882
2119
|
"email",
|
|
883
2120
|
"number",
|
|
884
2121
|
"password",
|
|
@@ -886,73 +2123,73 @@ const d = (f = class extends ht {
|
|
|
886
2123
|
"tel",
|
|
887
2124
|
"text",
|
|
888
2125
|
"url"
|
|
889
|
-
],
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
],
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
],
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
],
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
],
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
],
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
],
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
],
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
],
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
],
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
],
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
],
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
],
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
],
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
],
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
],
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
],
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
],
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
],
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
],
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
],
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
],
|
|
953
|
-
let
|
|
954
|
-
customElements.get("nys-textinput") || customElements.define("nys-textinput",
|
|
2126
|
+
], w.VALID_WIDTHS = ["sm", "md", "lg", "full"], w.styles = ve, w.formAssociated = !0, w);
|
|
2127
|
+
f([
|
|
2128
|
+
p({ type: String })
|
|
2129
|
+
], u.prototype, "id", 2);
|
|
2130
|
+
f([
|
|
2131
|
+
p({ type: String, reflect: !0 })
|
|
2132
|
+
], u.prototype, "name", 2);
|
|
2133
|
+
f([
|
|
2134
|
+
p({ reflect: !0 })
|
|
2135
|
+
], u.prototype, "type", 1);
|
|
2136
|
+
f([
|
|
2137
|
+
p({ type: String })
|
|
2138
|
+
], u.prototype, "label", 2);
|
|
2139
|
+
f([
|
|
2140
|
+
p({ type: String })
|
|
2141
|
+
], u.prototype, "description", 2);
|
|
2142
|
+
f([
|
|
2143
|
+
p({ type: String })
|
|
2144
|
+
], u.prototype, "placeholder", 2);
|
|
2145
|
+
f([
|
|
2146
|
+
p({ type: String })
|
|
2147
|
+
], u.prototype, "value", 2);
|
|
2148
|
+
f([
|
|
2149
|
+
p({ type: Boolean, reflect: !0 })
|
|
2150
|
+
], u.prototype, "disabled", 2);
|
|
2151
|
+
f([
|
|
2152
|
+
p({ type: Boolean, reflect: !0 })
|
|
2153
|
+
], u.prototype, "readonly", 2);
|
|
2154
|
+
f([
|
|
2155
|
+
p({ type: Boolean, reflect: !0 })
|
|
2156
|
+
], u.prototype, "required", 2);
|
|
2157
|
+
f([
|
|
2158
|
+
p({ type: Boolean, reflect: !0 })
|
|
2159
|
+
], u.prototype, "optional", 2);
|
|
2160
|
+
f([
|
|
2161
|
+
p({ type: String })
|
|
2162
|
+
], u.prototype, "form", 2);
|
|
2163
|
+
f([
|
|
2164
|
+
p({ type: String })
|
|
2165
|
+
], u.prototype, "pattern", 2);
|
|
2166
|
+
f([
|
|
2167
|
+
p({ type: Number })
|
|
2168
|
+
], u.prototype, "maxlength", 2);
|
|
2169
|
+
f([
|
|
2170
|
+
p({ reflect: !0 })
|
|
2171
|
+
], u.prototype, "width", 2);
|
|
2172
|
+
f([
|
|
2173
|
+
p({ type: Number })
|
|
2174
|
+
], u.prototype, "step", 2);
|
|
2175
|
+
f([
|
|
2176
|
+
p({ type: Number })
|
|
2177
|
+
], u.prototype, "min", 2);
|
|
2178
|
+
f([
|
|
2179
|
+
p({ type: Number })
|
|
2180
|
+
], u.prototype, "max", 2);
|
|
2181
|
+
f([
|
|
2182
|
+
p({ type: Boolean, reflect: !0 })
|
|
2183
|
+
], u.prototype, "showError", 2);
|
|
2184
|
+
f([
|
|
2185
|
+
p({ type: String })
|
|
2186
|
+
], u.prototype, "errorMessage", 2);
|
|
2187
|
+
f([
|
|
2188
|
+
be()
|
|
2189
|
+
], u.prototype, "showPassword", 2);
|
|
2190
|
+
let ts = u;
|
|
2191
|
+
customElements.get("nys-textinput") || customElements.define("nys-textinput", ts);
|
|
955
2192
|
export {
|
|
956
|
-
|
|
2193
|
+
ts as NysTextinput
|
|
957
2194
|
};
|
|
958
2195
|
//# sourceMappingURL=nys-textinput.js.map
|