@nysds/nys-button 1.11.1 → 1.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1194 +1,15 @@
1
- import { css as it, LitElement as at, html as _ } from "lit";
2
- /*!
3
- *
4
- * ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
5
- * ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
6
- * ▒█░░▀█ ░░▒█░░ ▒█▄▄▄█ ▒█▄▄▀ ▒█▄▄▄█
7
- *
8
- * Button Component
9
- * Part of the New York State Design System
10
- * Repository: https://github.com/its-hcd/nysds
11
- * License: MIT
12
- */
13
- /**
14
- * @license
15
- * Copyright 2019 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- */
18
- const D = globalThis, j = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, et = Symbol(), B = /* @__PURE__ */ new WeakMap();
19
- let lt = class {
20
- constructor(t, e, o) {
21
- if (this._$cssResult$ = !0, o !== et) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
22
- this.cssText = t, this.t = e;
23
- }
24
- get styleSheet() {
25
- let t = this.o;
26
- const e = this.t;
27
- if (j && t === void 0) {
28
- const o = e !== void 0 && e.length === 1;
29
- o && (t = B.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), o && B.set(e, t));
30
- }
31
- return t;
32
- }
33
- toString() {
34
- return this.cssText;
35
- }
36
- };
37
- const ct = (n) => new lt(typeof n == "string" ? n : n + "", void 0, et), dt = (n, t) => {
38
- if (j) n.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
39
- else for (const e of t) {
40
- const o = document.createElement("style"), r = D.litNonce;
41
- r !== void 0 && o.setAttribute("nonce", r), o.textContent = e.cssText, n.appendChild(o);
42
- }
43
- }, G = j ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
44
- let e = "";
45
- for (const o of t.cssRules) e += o.cssText;
46
- return ct(e);
47
- })(n) : n;
48
- /**
49
- * @license
50
- * Copyright 2017 Google LLC
51
- * SPDX-License-Identifier: BSD-3-Clause
52
- */
53
- const { is: ut, defineProperty: ht, getOwnPropertyDescriptor: bt, getOwnPropertyNames: yt, getOwnPropertySymbols: ft, getPrototypeOf: vt } = Object, M = globalThis, W = M.trustedTypes, pt = W ? W.emptyScript : "", _t = M.reactiveElementPolyfillSupport, C = (n, t) => n, H = { toAttribute(n, t) {
54
- switch (t) {
55
- case Boolean:
56
- n = n ? pt : null;
57
- break;
58
- case Object:
59
- case Array:
60
- n = n == null ? n : JSON.stringify(n);
61
- }
62
- return n;
63
- }, fromAttribute(n, t) {
64
- let e = n;
65
- switch (t) {
66
- case Boolean:
67
- e = n !== null;
68
- break;
69
- case Number:
70
- e = n === null ? null : Number(n);
71
- break;
72
- case Object:
73
- case Array:
74
- try {
75
- e = JSON.parse(n);
76
- } catch {
77
- e = null;
78
- }
79
- }
80
- return e;
81
- } }, F = (n, t) => !ut(n, t), K = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: F };
82
- Symbol.metadata ??= Symbol("metadata"), M.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
83
- class w extends HTMLElement {
84
- static addInitializer(t) {
85
- this._$Ei(), (this.l ??= []).push(t);
86
- }
87
- static get observedAttributes() {
88
- return this.finalize(), this._$Eh && [...this._$Eh.keys()];
89
- }
90
- static createProperty(t, e = K) {
91
- if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
92
- const o = Symbol(), r = this.getPropertyDescriptor(t, o, e);
93
- r !== void 0 && ht(this.prototype, t, r);
94
- }
95
- }
96
- static getPropertyDescriptor(t, e, o) {
97
- const { get: r, set: s } = bt(this.prototype, t) ?? { get() {
98
- return this[e];
99
- }, set(i) {
100
- this[e] = i;
101
- } };
102
- return { get: r, set(i) {
103
- const l = r?.call(this);
104
- s?.call(this, i), this.requestUpdate(t, l, o);
105
- }, configurable: !0, enumerable: !0 };
106
- }
107
- static getPropertyOptions(t) {
108
- return this.elementProperties.get(t) ?? K;
109
- }
110
- static _$Ei() {
111
- if (this.hasOwnProperty(C("elementProperties"))) return;
112
- const t = vt(this);
113
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
114
- }
115
- static finalize() {
116
- if (this.hasOwnProperty(C("finalized"))) return;
117
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
118
- const e = this.properties, o = [...yt(e), ...ft(e)];
119
- for (const r of o) this.createProperty(r, e[r]);
120
- }
121
- const t = this[Symbol.metadata];
122
- if (t !== null) {
123
- const e = litPropertyMetadata.get(t);
124
- if (e !== void 0) for (const [o, r] of e) this.elementProperties.set(o, r);
125
- }
126
- this._$Eh = /* @__PURE__ */ new Map();
127
- for (const [e, o] of this.elementProperties) {
128
- const r = this._$Eu(e, o);
129
- r !== void 0 && this._$Eh.set(r, e);
130
- }
131
- this.elementStyles = this.finalizeStyles(this.styles);
132
- }
133
- static finalizeStyles(t) {
134
- const e = [];
135
- if (Array.isArray(t)) {
136
- const o = new Set(t.flat(1 / 0).reverse());
137
- for (const r of o) e.unshift(G(r));
138
- } else t !== void 0 && e.push(G(t));
139
- return e;
140
- }
141
- static _$Eu(t, e) {
142
- const o = e.attribute;
143
- return o === !1 ? void 0 : typeof o == "string" ? o : typeof t == "string" ? t.toLowerCase() : void 0;
144
- }
145
- constructor() {
146
- super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
147
- }
148
- _$Ev() {
149
- this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
150
- }
151
- addController(t) {
152
- (this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
153
- }
154
- removeController(t) {
155
- this._$EO?.delete(t);
156
- }
157
- _$E_() {
158
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
159
- for (const o of e.keys()) this.hasOwnProperty(o) && (t.set(o, this[o]), delete this[o]);
160
- t.size > 0 && (this._$Ep = t);
161
- }
162
- createRenderRoot() {
163
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
164
- return dt(t, this.constructor.elementStyles), t;
165
- }
166
- connectedCallback() {
167
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
168
- }
169
- enableUpdating(t) {
170
- }
171
- disconnectedCallback() {
172
- this._$EO?.forEach(((t) => t.hostDisconnected?.()));
173
- }
174
- attributeChangedCallback(t, e, o) {
175
- this._$AK(t, o);
176
- }
177
- _$ET(t, e) {
178
- const o = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, o);
179
- if (r !== void 0 && o.reflect === !0) {
180
- const s = (o.converter?.toAttribute !== void 0 ? o.converter : H).toAttribute(e, o.type);
181
- this._$Em = t, s == null ? this.removeAttribute(r) : this.setAttribute(r, s), this._$Em = null;
182
- }
183
- }
184
- _$AK(t, e) {
185
- const o = this.constructor, r = o._$Eh.get(t);
186
- if (r !== void 0 && this._$Em !== r) {
187
- const s = o.getPropertyOptions(r), i = typeof s.converter == "function" ? { fromAttribute: s.converter } : s.converter?.fromAttribute !== void 0 ? s.converter : H;
188
- this._$Em = r;
189
- const l = i.fromAttribute(e, s.type);
190
- this[r] = l ?? this._$Ej?.get(r) ?? l, this._$Em = null;
191
- }
192
- }
193
- requestUpdate(t, e, o) {
194
- if (t !== void 0) {
195
- const r = this.constructor, s = this[t];
196
- if (o ??= r.getPropertyOptions(t), !((o.hasChanged ?? F)(s, e) || o.useDefault && o.reflect && s === this._$Ej?.get(t) && !this.hasAttribute(r._$Eu(t, o)))) return;
197
- this.C(t, e, o);
198
- }
199
- this.isUpdatePending === !1 && (this._$ES = this._$EP());
200
- }
201
- C(t, e, { useDefault: o, reflect: r, wrapped: s }, i) {
202
- o && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, i ?? e ?? this[t]), s !== !0 || i !== void 0) || (this._$AL.has(t) || (this.hasUpdated || o || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
203
- }
204
- async _$EP() {
205
- this.isUpdatePending = !0;
206
- try {
207
- await this._$ES;
208
- } catch (e) {
209
- Promise.reject(e);
210
- }
211
- const t = this.scheduleUpdate();
212
- return t != null && await t, !this.isUpdatePending;
213
- }
214
- scheduleUpdate() {
215
- return this.performUpdate();
216
- }
217
- performUpdate() {
218
- if (!this.isUpdatePending) return;
219
- if (!this.hasUpdated) {
220
- if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
221
- for (const [r, s] of this._$Ep) this[r] = s;
222
- this._$Ep = void 0;
223
- }
224
- const o = this.constructor.elementProperties;
225
- if (o.size > 0) for (const [r, s] of o) {
226
- const { wrapped: i } = s, l = this[r];
227
- i !== !0 || this._$AL.has(r) || l === void 0 || this.C(r, void 0, s, l);
228
- }
229
- }
230
- let t = !1;
231
- const e = this._$AL;
232
- try {
233
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((o) => o.hostUpdate?.())), this.update(e)) : this._$EM();
234
- } catch (o) {
235
- throw t = !1, this._$EM(), o;
236
- }
237
- t && this._$AE(e);
238
- }
239
- willUpdate(t) {
240
- }
241
- _$AE(t) {
242
- this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
243
- }
244
- _$EM() {
245
- this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
246
- }
247
- get updateComplete() {
248
- return this.getUpdateComplete();
249
- }
250
- getUpdateComplete() {
251
- return this._$ES;
252
- }
253
- shouldUpdate(t) {
254
- return !0;
255
- }
256
- update(t) {
257
- this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
258
- }
259
- updated(t) {
260
- }
261
- firstUpdated(t) {
262
- }
263
- }
264
- w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[C("elementProperties")] = /* @__PURE__ */ new Map(), w[C("finalized")] = /* @__PURE__ */ new Map(), _t?.({ ReactiveElement: w }), (M.reactiveElementVersions ??= []).push("2.1.1");
265
- /**
266
- * @license
267
- * Copyright 2017 Google LLC
268
- * SPDX-License-Identifier: BSD-3-Clause
269
- */
270
- const gt = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: F }, $t = (n = gt, t, e) => {
271
- const { kind: o, metadata: r } = e;
272
- let s = globalThis.litPropertyMetadata.get(r);
273
- if (s === void 0 && globalThis.litPropertyMetadata.set(r, s = /* @__PURE__ */ new Map()), o === "setter" && ((n = Object.create(n)).wrapped = !0), s.set(e.name, n), o === "accessor") {
274
- const { name: i } = e;
275
- return { set(l) {
276
- const a = t.get.call(this);
277
- t.set.call(this, l), this.requestUpdate(i, a, n);
278
- }, init(l) {
279
- return l !== void 0 && this.C(i, void 0, n, l), l;
280
- } };
281
- }
282
- if (o === "setter") {
283
- const { name: i } = e;
284
- return function(l) {
285
- const a = this[i];
286
- t.call(this, l), this.requestUpdate(i, a, n);
287
- };
288
- }
289
- throw Error("Unsupported decorator location: " + o);
290
- };
291
- function u(n) {
292
- return (t, e) => typeof e == "object" ? $t(n, t, e) : ((o, r, s) => {
293
- const i = r.hasOwnProperty(s);
294
- return r.constructor.createProperty(s, o), i ? Object.getOwnPropertyDescriptor(r, s) : void 0;
295
- })(n, t, e);
296
- }
297
- const mt = it`
298
- :host {
299
- /* Anything that can be overridden should be defined here */
300
-
301
- /* Global Button Styles */
302
- --_nys-button-width: fit-content;
303
- --_nys-button-height: var(--nys-size-600, 48px);
304
- --_nys-button-border-radius--start: var(--nys-radius-xl, 12px);
305
- --_nys-button-border-radius--end: var(--nys-radius-xl, 12px);
306
- --_nys-button-padding--y: var(--nys-space-150, 12px);
307
- --_nys-button-padding--x: var(--nys-space-250, 20px);
308
- --_nys-button-gap: var(--nys-space-100, 8px);
309
- --_nys-button-border-width: var(--nys-border-width-md, 2px);
310
- --_nys-button-outline-width: var(--nys-border-width-md, 2px);
311
- --_nys-button-outline-offset: var(--nys-space-2px, 2px);
312
- --_nys-button-outline-color: var(--nys-color-focus, #004dd1);
313
-
314
- /* Global Button Colors */
315
- --_nys-button-background-color: var(
316
- --nys-button-background-color,
317
- var(--nys-color-theme, #154973)
318
- );
319
- --_nys-button-color: var(
320
- --nys-button-color,
321
- var(--nys-color-text-reverse, #ffffff)
322
- );
323
- --_nys-button-border-color: var(
324
- --nys-button-border-color,
325
- var(--nys-color-theme, #154973)
326
- );
327
-
328
- --_nys-button-background-color--hover: var(
329
- --nys-button-background-color--hover,
330
- var(--nys-color-theme-strong, #0e324f)
331
- );
332
- --_nys-button-color--hover: var(
333
- --nys-button-color--hover,
334
- var(--nys-color-text-reverse, #ffffff)
335
- );
336
- --_nys-button-border-color--hover: var(
337
- --nys-button-border-color--hover,
338
- var(--nys-color-theme-strong, #0e324f)
339
- );
340
-
341
- --_nys-button-background-color--active: var(
342
- --nys-button-background-color--active,
343
- var(--nys-color-theme-stronger, #081b2b)
344
- );
345
- --_nys-button-color--active: var(
346
- --nys-button-color--active,
347
- var(--nys-color-text-reverse, #ffffff)
348
- );
349
- --_nys-button-border-color--active: var(
350
- --nys-button-border-color--active,
351
- var(--nys-color-theme-stronger, #081b2b)
352
- );
353
-
354
- --_nys-button-background-color--disabled: var(
355
- --nys-color-neutral-10,
356
- #f6f6f6
357
- );
358
- --_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);
359
- --_nys-button-border-color--disabled: var(--nys-color-neutral-10, #f6f6f6);
360
-
361
- /* Typography */
362
- --_nys-button-font-size: var(--nys-font-size-ui-md, 16px);
363
- --_nys-button-font-weight: var(--nys-font-weight-semibold, 600);
364
- --_nys-button-line-height: var(--nys-font-lineheight-ui-md, 24px);
365
- --_nys-button-font-family: var(
366
- --nys-font-family-ui,
367
- var(
368
- --nys-font-family-sans,
369
- "Proxima Nova",
370
- "Helvetica Neue",
371
- "Helvetica",
372
- "Arial",
373
- sans-serif
374
- )
375
- );
376
- }
377
-
378
- /* Sizes */
379
- :host([size="sm"]) {
380
- --_nys-button-height: var(--nys-size-500, 40px);
381
- --_nys-button-padding--y: var(--nys-space-100, 8px);
382
- --_nys-button-padding--x: var(--nys-space-200, 16px);
383
- }
384
- :host([size="md"]) {
385
- --_nys-button-height: var(--nys-size-600, 48px);
386
- --_nys-button-padding--y: var(--nys-space-150, 12px);
387
- --_nys-button-padding--x: var(--nys-space-250, 20px);
388
- }
389
- :host([size="lg"]) {
390
- --_nys-button-height: var(--nys-size-700, 56px);
391
- --_nys-button-padding--y: var(--nys-space-200, 16px);
392
- --_nys-button-padding--x: var(--nys-space-300, 24px);
393
- }
394
- :host([fullWidth]) {
395
- --_nys-button-width: 100%;
396
- }
397
-
398
- /* VARIANTS */
399
-
400
- /* Filled */
401
- :host([variant="filled"]) {
402
- /* Filled - Default */
403
- --_nys-button-background-color: var(
404
- --nys-button-background-color,
405
- var(--nys-color-theme, #154973)
406
- );
407
- --_nys-button-color: var(
408
- --nys-button-color,
409
- var(--nys-color-text-reverse, #ffffff)
410
- );
411
- --_nys-button-border-color: var(
412
- --nys-button-border-color,
413
- var(--nys-color-transparent, #ffffff00)
414
- );
415
-
416
- /* Filled - Hover */
417
- --_nys-button-background-color--hover: var(
418
- --nys-button-background-color--hover,
419
- var(--nys-color-theme-strong, #0e324f)
420
- );
421
- --_nys-button-color--hover: var(
422
- --nys-button-color--hover,
423
- var(--nys-color-text-reverse, #ffffff)
424
- );
425
- --_nys-button-border-color: var(
426
- --nys-button-border-color,
427
- var(--nys-color-transparent, #ffffff00)
428
- );
429
-
430
- /* Filled - Pressed/Active */
431
- --_nys-button-background-color--active: var(
432
- --nys-button-background-color--active,
433
- var(--nys-color-theme-stronger, #081b2b)
434
- );
435
- --_nys-button-color--active: var(
436
- --nys-button-color--active,
437
- var(--nys-color-text-reverse, #ffffff)
438
- );
439
- --_nys-button-border-color: var(
440
- --nys-button-border-color,
441
- var(--nys-color-transparent, #ffffff00)
442
- );
443
-
444
- /* Filled - Disabled */
445
- --_nys-button-background-color--disabled: var(
446
- --nys-color-neutral-10,
447
- #f6f6f6
448
- );
449
- --_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);
450
- --_nys-button-border-color: var(
451
- --nys-button-border-color,
452
- var(--nys-color-transparent, #ffffff00)
453
- );
454
- }
455
-
456
- /* Outline */
457
- :host([variant="outline"]) {
458
- /* Outline - Default */
459
- --_nys-button-background-color: var(
460
- --nys-button-background-color,
461
- var(--nys-color-surface, #ffffff)
462
- );
463
- --_nys-button-color: var(
464
- --nys-button-color,
465
- var(--nys-color-theme, #154973)
466
- );
467
- --_nys-button-border-color: var(
468
- --nys-button-border-color,
469
- var(--nys-color-theme, #154973)
470
- );
471
-
472
- /* Outline - Hover */
473
- --_nys-button-background-color--hover: var(
474
- --nys-button-background-color--hover,
475
- var(--nys-color-theme-weaker, #eff6fb)
476
- );
477
- --_nys-button-color--hover: var(
478
- --nys-button-color--hover,
479
- var(--nys-color-theme, #154973)
480
- );
481
- --_nys-button-border-color--hover: var(
482
- --nys-button-border-color--hover,
483
- var(--nys-color-theme, #154973)
484
- );
485
-
486
- /* Outline - Pressed/Active */
487
- --_nys-button-background-color--active: var(
488
- --nys-button-background-color--active,
489
- var(--nys-color-theme-weak, #cddde9)
490
- );
491
- --_nys-button-color--active: var(
492
- --nys-button-color--active,
493
- var(--nys-color-theme, #154973)
494
- );
495
- --_nys-button-border-color--active: var(
496
- --nys-button-border-color--active,
497
- var(--nys-color-theme, #154973)
498
- );
499
-
500
- /* Outline - Disabled */
501
- --_nys-button-background-color--disabled: var(--nys-color-surface, #ffffff);
502
- --_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);
503
- --_nys-button-border-color--disabled: var(--nys-color-neutral-100, #d0d0ce);
504
- }
505
-
506
- /* Text */
507
- :host([variant="text"]) {
508
- --_nys-button-height: fit-content;
509
- --_nys-button-border-radius--start: var(--nys-radius-md, 4px);
510
- --_nys-button-border-radius--end: var(--nys-radius-md, 4px);
511
- --_nys-button-padding--y: var(--nys-space-2px, 2px);
512
- --_nys-button-padding--x: var(--nys-space-50, 4px);
513
- --_nys-button-border-width: 0px;
514
- --_nys-button-text-decoration: underline;
515
-
516
- /* Text - Default */
517
- --_nys-button-background-color: var(
518
- --nys-button-background-color,
519
- var(--nys-color-transparent, #ffffff00)
520
- );
521
- --_nys-button-color: var(
522
- --nys-button-color,
523
- var(--nys-color-link, #004dd1)
524
- );
525
- --_nys-button-border-color: var(
526
- --nys-button-border-color,
527
- var(--nys-color-transparent, #ffffff00)
528
- );
529
-
530
- /* Text - Hover */
531
- --_nys-button-background-color--hover: var(
532
- --nys-button-background-color--hover,
533
- var(--nys-color-transparent, #ffffff00)
534
- );
535
- --_nys-button-color--hover: var(
536
- --nys-button-color--hover,
537
- var(--nys-color-link-strong, #003ba1)
538
- );
539
- --_nys-button-border-color--hover: var(
540
- --nys-button-border-color--hover,
541
- var(--nys-color-transparent, #ffffff00)
542
- );
543
-
544
- /* Text - Pressed/Active */
545
- --_nys-button-background-color--active: var(
546
- --nys-button-background-color--active,
547
- var(--nys-color-transparent, #ffffff00)
548
- );
549
- --_nys-button-color--active: var(
550
- --nys-button-color--active,
551
- var(--nys-color-link-strongest, #002971)
552
- );
553
- --_nys-button-border-color--active: var(
554
- --nys-button-border-color--active,
555
- var(--nys-color-transparent, #ffffff00)
556
- );
557
-
558
- /* Text - Disabled */
559
- --_nys-button-background-color--disabled: var(
560
- --nys-color-transparent,
561
- #ffffff00
562
- );
563
- --_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);
564
- --_nys-button-border-color--disabled: var(
565
- --nys-color-transparent,
566
- #ffffff00
567
- );
568
- }
569
-
570
- /* Ghost */
571
- :host([variant="ghost"]) {
572
- /* Ghost - Default */
573
- --_nys-button-background-color: var(
574
- --nys-button-background-color,
575
- var(--nys-color-transparent, #ffffff00)
576
- );
577
- --_nys-button-color: var(
578
- --nys-button-color,
579
- var(--nys-color-text, #1b1b1b)
580
- );
581
- --_nys-button-border-color: var(
582
- --nys-button-border-color,
583
- var(--nys-color-transparent, #ffffff00)
584
- );
585
-
586
- /* Ghost - Hover */
587
- --_nys-button-background-color--hover: var(
588
- --nys-button-background-color--hover,
589
- var(--nys-color-black-transparent-100, #0000001a)
590
- );
591
- --_nys-button-color--hover: var(
592
- --nys-button-color--hover,
593
- var(--nys-color-text, #1b1b1b)
594
- );
595
- --_nys-button-border-color--hover: var(
596
- --nys-button-border-color--hover,
597
- var(--nys-color-transparent, #ffffff00)
598
- );
599
-
600
- /* Ghost - Active */
601
- --_nys-button-background-color--active: var(
602
- --nys-button-background-color--active,
603
- var(--nys-color-black-transparent-200, #00000033)
604
- );
605
- --_nys-button-color--active: var(
606
- --nys-button-color--active,
607
- var(--nys-color-text, #1b1b1b)
608
- );
609
- --_nys-button-border-color--active: var(
610
- --nys-button-border-color--active,
611
- var(--nys-color-transparent, #ffffff00)
612
- );
613
-
614
- /* Ghost - Disabled */
615
- --_nys-button-background-color--disabled: var(
616
- --nys-color-transparent,
617
- #ffffff00
618
- );
619
- --_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);
620
- --_nys-button-border-color--disabled: var(
621
- --nys-color-transparent,
622
- #ffffff00
623
- );
624
- }
625
-
626
- /* INVERTED VARIANTS */
627
-
628
- /* Filled Inverted */
629
- :host([variant="filled"][inverted]) {
630
- /* Filled Inverted - Default */
631
- --_nys-button-background-color: var(
632
- --nys-button-background-color,
633
- var(--nys-color-surface, #ffffff)
634
- );
635
- --_nys-button-color: var(
636
- --nys-button-color,
637
- var(--nys-color-text, #1b1b1b)
638
- );
639
- --_nys-button-border-color--disabled: var(
640
- --nys-color-transparent,
641
- #ffffff00
642
- );
643
-
644
- /* Filled Inverted - Hover */
645
- --_nys-button-background-color--hover: var(
646
- --nys-button-background-color--hover,
647
- var(--nys-color-neutral-100, #d0d0ce)
648
- );
649
- --_nys-button-color--hover: var(
650
- --nys-button-color--hover,
651
- var(--nys-color-text, #1b1b1b)
652
- );
653
- --_nys-button-border-color--disabled: var(
654
- --nys-color-transparent,
655
- #ffffff00
656
- );
657
-
658
- /* Filled Inverted - Pressed/Active */
659
- --_nys-button-background-color--active: var(
660
- --nys-button-background-color--active,
661
- var(--nys-color-neutral-300, #a7a9ab)
662
- );
663
- --_nys-button-color--active: var(
664
- --nys-button-color--active,
665
- var(--nys-color-text, #1b1b1b)
666
- );
667
- --_nys-button-border-color--disabled: var(
668
- --nys-color-transparent,
669
- #ffffff00
670
- );
671
-
672
- /* Filled Inverted - Disabled */
673
- --_nys-button-background-color--disabled: var(--nys-color-text, #1b1b1b);
674
- --_nys-button-color--disabled: var(--nys-color-text-disabled, #62666a);
675
- --_nys-button-border-color--disabled: var(
676
- --nys-color-transparent,
677
- #ffffff00
678
- );
679
- }
680
-
681
- /* Outline Inverted */
682
- :host([variant="outline"][inverted]) {
683
- /* Outline Inverted - Default */
684
- --_nys-button-background-color: var(
685
- --nys-button-background-color,
686
- var(--nys-color-surface-reverse, #1b1b1b)
687
- );
688
- --_nys-button-color: var(
689
- --nys-button-color,
690
- var(--nys-color-text-reverse, #ffffff)
691
- );
692
- --_nys-button-border-color: var(
693
- --nys-button-border-color,
694
- var(--nys-color-ink-reverse, #ffffff)
695
- );
696
-
697
- /* Outline Inverted - Hover */
698
- --_nys-button-background-color--hover: var(
699
- --nys-button-background-color--hover,
700
- var(--nys-color-surface-reverse, #1b1b1b)
701
- );
702
- --_nys-button-color--hover: var(
703
- --nys-button-color--hover,
704
- var(--nys-color-text-reverse-weak, #d0d0ce)
705
- );
706
- --_nys-button-border-color--hover: var(
707
- --nys-button-border-color--hover,
708
- var(--nys-color-neutral-100, #d0d0ce)
709
- );
710
-
711
- /* Outline Inverted - Pressed/Active */
712
- --_nys-button-background-color--active: var(
713
- --nys-button-background-color--active,
714
- var(--nys-color-surface-reverse, #1b1b1b)
715
- );
716
- --_nys-button-color--active: var(
717
- --nys-button-color--active,
718
- var(--nys-color-text-reverse-weaker, #bec0c1)
719
- );
720
- --_nys-button-border-color--active: var(
721
- --nys-button-border-color--active,
722
- var(--nys-color-neutral-300, #a7a9ab)
723
- );
724
-
725
- /* Outline Inverted - Disabled */
726
- --_nys-button-background-color--disabled: var(
727
- --nys-color-surface-reverse,
728
- #1b1b1b
729
- );
730
- --_nys-button-color--disabled: var(
731
- --nys-color-text-reverse-disabled,
732
- #62666a
733
- );
734
- --_nys-button-border-color--disabled: var(--nys-color-neutral-600, #62666a);
735
- }
736
-
737
- /* Text Inverted */
738
- :host([variant="text"][inverted]) {
739
- --_nys-button-height: fit-content;
740
- --_nys-button-border-radius--start: var(--nys-radius-md, 4px);
741
- --_nys-button-border-radius--end: var(--nys-radius-md, 4px);
742
- --_nys-button-padding--y: var(--nys-space-2px, 2px);
743
- --_nys-button-padding--x: var(--nys-space-50, 4px);
744
- --_nys-button-border-width: 0px;
745
- --_nys-button-text-decoration: underline;
746
-
747
- /* Text Inverted - Default */
748
- --_nys-button-background-color: var(
749
- --nys-button-background-color,
750
- var(--nys-color-transparent, #ffffff00)
751
- );
752
- --_nys-button-color: var(
753
- --nys-button-color,
754
- var(--nys-color-link-reverse, #a7a9ab)
755
- );
756
- --_nys-button-border-color: var(
757
- --nys-button-border-color,
758
- var(--nys-color-transparent, #ffffff00)
759
- );
760
-
761
- /* Text Inverted - Hover */
762
- --_nys-button-background-color--hover: var(
763
- --nys-button-background-color--hover,
764
- var(--nys-color-transparent, #ffffff00)
765
- );
766
- --_nys-button-color--hover: var(
767
- --nys-button-color--hover,
768
- var(--nys-color-link-reverse-strong, #ededed)
769
- );
770
- --_nys-button-border-color--hover: var(
771
- --nys-button-border-color--hover,
772
- var(--nys-color-transparent, #ffffff00)
773
- );
774
-
775
- /* Text Inverted - Pressed/Active */
776
- --_nys-button-background-color--active: var(
777
- --nys-button-background-color--active,
778
- var(--nys-color-transparent, #ffffff00)
779
- );
780
- --_nys-button-color--active: var(
781
- --nys-button-color--active,
782
- var(--nys-color-reverse-strongest, #ffffff)
783
- );
784
- --_nys-button-border-color--active: var(
785
- --nys-button-border-color--active,
786
- var(--nys-color-transparent, #ffffff00)
787
- );
788
-
789
- /* Text Inverted - Disabled */
790
- --_nys-button-background-color--disabled: var(
791
- --nys-color-transparent,
792
- #ffffff00
793
- );
794
- --_nys-button-color--disabled: var(
795
- --nys-color-text-reverse-disabled,
796
- #62666a
797
- );
798
- --_nys-button-border-color--disabled: var(
799
- --nys-color-transparent,
800
- #ffffff00
801
- );
802
- }
803
-
804
- /* Ghost Inverted */
805
- :host([variant="ghost"][inverted]) {
806
- /* Ghost Inverted - Default */
807
- --_nys-button-background-color: var(
808
- --nys-button-background-color,
809
- var(--nys-color-transparent, #ffffff00)
810
- );
811
- --_nys-button-color: var(
812
- --nys-button-color,
813
- var(--nys-color-text-reverse, #ffffff)
814
- );
815
- --_nys-button-border-color: var(
816
- --nys-button-border-color,
817
- var(--nys-color-transparent, #ffffff00)
818
- );
819
-
820
- /* Ghost Inverted - Hover */
821
- --_nys-button-background-color--hover: var(
822
- --nys-button-background-color--hover,
823
- var(--nys-color-white-transparent-100, #ffffff1a)
824
- );
825
- --_nys-button-color--hover: var(
826
- --nys-button-color--hover,
827
- var(--nys-color-text-reverse, #ffffff)
828
- );
829
- --_nys-button-border-color--hover: var(
830
- --nys-button-border-color--hover,
831
- var(--nys-color-transparent, #ffffff00)
832
- );
833
-
834
- /* Ghost Inverted - Pressed/Active */
835
- --_nys-button-background-color--active: var(
836
- --nys-button-background-color--active,
837
- var(--nys-color-white-transparent-200, #ffffff33)
838
- );
839
- --_nys-button-color--active: var(
840
- --nys-button-color--active,
841
- var(--nys-color-text-reverse, #ffffff)
842
- );
843
- --_nys-button-border-color--active: var(
844
- --nys-button-border-color--active,
845
- var(--nys-color-transparent, #ffffff00)
846
- );
847
-
848
- /* Ghost Inverted - Disabled */
849
- --_nys-button-background-color--disabled: var(
850
- --nys-color-transparent,
851
- #ffffff00
852
- );
853
- --_nys-button-color--disabled: var(--nys-color-text-disabled, #62666a);
854
- --_nys-button-border-color--disabled: var(
855
- --nys-color-transparent,
856
- #ffffff00
857
- );
858
- }
859
-
860
- /* Circle */
861
- :host([circle]) {
862
- --_nys-button-width: var(--_nys-button-height);
863
- --_nys-button-border-radius--start: var(--nys-radius-round, 1776px);
864
- --_nys-button-border-radius--end: var(--nys-radius-round, 1776px);
865
- --_nys-button-padding--y: 0;
866
- --_nys-button-padding--x: 0;
867
- }
868
-
869
- .nys-button {
870
- width: var(--_nys-button-width);
871
- min-height: var(--_nys-button-height);
872
- height: var(--_nys-button-height);
873
- /* set every corner individually */
874
- border-start-start-radius: var(--_nys-button-border-radius--start);
875
- border-end-start-radius: var(--_nys-button-border-radius--start);
876
- border-start-end-radius: var(--_nys-button-border-radius--end);
877
- border-end-end-radius: var(--_nys-button-border-radius--end);
878
- padding: var(--_nys-button-padding--y) var(--_nys-button-padding--x);
879
- display: flex;
880
- align-items: center;
881
- justify-content: center;
882
- gap: var(--_nys-button-gap);
883
- font-family: var(--_nys-button-font-family);
884
- font-size: var(--_nys-button-font-size);
885
- font-weight: var(--_nys-button-font-weight);
886
- line-height: var(--_nys-button-line-height);
887
- text-decoration: var(--_nys-button-text-decoration);
888
- box-sizing: border-box;
889
- background-color: var(--_nys-button-background-color);
890
- color: var(--_nys-button-color);
891
- border: solid var(--_nys-button-border-width)
892
- var(--_nys-button-border-color);
893
- cursor: var(--_nys-button-cursor, pointer);
894
- }
895
-
896
- :host([circle]) .nys-button {
897
- max-width: var(--_nys-button-height);
898
- max-height: var(--_nys-button-height);
899
- }
900
-
901
- .nys-button:hover {
902
- background-color: var(--_nys-button-background-color--hover);
903
- color: var(--_nys-button-color--hover);
904
- border-color: var(--_nys-button-border-color--hover);
905
- }
906
-
907
- .nys-button:active {
908
- background-color: var(--_nys-button-background-color--active);
909
- color: var(--_nys-button-color--active);
910
- border-color: var(--_nys-button-border-color--active);
911
- }
912
-
913
- .nys-button:disabled,
914
- a[disabled] {
915
- background-color: var(--_nys-button-background-color--disabled);
916
- color: var(--_nys-button-color--disabled);
917
- border-color: var(--_nys-button-border-color--disabled);
918
- cursor: not-allowed;
919
- }
920
-
921
- .nys-button__linkwrapper:has([disabled]) {
922
- cursor: not-allowed;
923
- width: fit-content;
924
- }
925
-
926
- /* Remove click functionality from disabled link button */
927
- a[disabled] {
928
- pointer-events: none;
929
- }
930
-
931
- a[disabled]:hover {
932
- background-color: var(--_nys-button-background-color--disabled);
933
- color: var(--_nys-button-color--disabled);
934
- border-color: var(--_nys-button-border-color--disabled);
935
- }
936
-
937
- .nys-button * {
938
- cursor: var(--_nys-button-cursor, pointer);
939
- }
940
-
941
- .nys-button:disabled * {
942
- cursor: not-allowed;
943
- }
944
-
945
- .nys-button:focus-visible {
946
- outline-offset: var(--_nys-button-outline-offset);
947
- outline: solid var(--_nys-button-outline-width)
948
- var(--_nys-button-outline-color);
949
- }
950
-
951
- .nys-button__text {
952
- display: flex;
953
- align-items: center;
954
- user-select: none;
955
- }
956
- `;
957
- /**
958
- * @license
959
- * Copyright 2017 Google LLC
960
- * SPDX-License-Identifier: BSD-3-Clause
961
- */
962
- const V = globalThis, U = V.trustedTypes, Z = U ? U.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ot = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, rt = "?" + m, At = `<${rt}>`, k = document, z = () => k.createComment(""), P = (n) => n === null || typeof n != "object" && typeof n != "function", q = Array.isArray, xt = (n) => q(n) || typeof n?.[Symbol.iterator] == "function", L = `[
963
- \f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, J = /-->/g, Y = />/g, A = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
964
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Q = /'/g, X = /"/g, nt = /^(?:script|style|textarea|title)$/i, I = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), tt = /* @__PURE__ */ new WeakMap(), x = k.createTreeWalker(k, 129);
965
- function st(n, t) {
966
- if (!q(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
967
- return Z !== void 0 ? Z.createHTML(t) : t;
968
- }
969
- const kt = (n, t) => {
970
- const e = n.length - 1, o = [];
971
- let r, s = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = E;
972
- for (let l = 0; l < e; l++) {
973
- const a = n[l];
974
- let y, f, c = -1, g = 0;
975
- for (; g < a.length && (i.lastIndex = g, f = i.exec(a), f !== null); ) g = i.lastIndex, i === E ? f[1] === "!--" ? i = J : f[1] !== void 0 ? i = Y : f[2] !== void 0 ? (nt.test(f[2]) && (r = RegExp("</" + f[2], "g")), i = A) : f[3] !== void 0 && (i = A) : i === A ? f[0] === ">" ? (i = r ?? E, c = -1) : f[1] === void 0 ? c = -2 : (c = i.lastIndex - f[2].length, y = f[1], i = f[3] === void 0 ? A : f[3] === '"' ? X : Q) : i === X || i === Q ? i = A : i === J || i === Y ? i = E : (i = A, r = void 0);
976
- const $ = i === A && n[l + 1].startsWith("/>") ? " " : "";
977
- s += i === E ? a + At : c >= 0 ? (o.push(y), a.slice(0, c) + ot + a.slice(c) + m + $) : a + m + (c === -2 ? l : $);
978
- }
979
- return [st(n, s + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), o];
980
- };
981
- class T {
982
- constructor({ strings: t, _$litType$: e }, o) {
983
- let r;
984
- this.parts = [];
985
- let s = 0, i = 0;
986
- const l = t.length - 1, a = this.parts, [y, f] = kt(t, e);
987
- if (this.el = T.createElement(y, o), x.currentNode = this.el.content, e === 2 || e === 3) {
988
- const c = this.el.content.firstChild;
989
- c.replaceWith(...c.childNodes);
990
- }
991
- for (; (r = x.nextNode()) !== null && a.length < l; ) {
992
- if (r.nodeType === 1) {
993
- if (r.hasAttributes()) for (const c of r.getAttributeNames()) if (c.endsWith(ot)) {
994
- const g = f[i++], $ = r.getAttribute(c).split(m), O = /([.?@])?(.*)/.exec(g);
995
- a.push({ type: 1, index: s, name: O[2], strings: $, ctor: O[1] === "." ? wt : O[1] === "?" ? Et : O[1] === "@" ? Ct : N }), r.removeAttribute(c);
996
- } else c.startsWith(m) && (a.push({ type: 6, index: s }), r.removeAttribute(c));
997
- if (nt.test(r.tagName)) {
998
- const c = r.textContent.split(m), g = c.length - 1;
999
- if (g > 0) {
1000
- r.textContent = U ? U.emptyScript : "";
1001
- for (let $ = 0; $ < g; $++) r.append(c[$], z()), x.nextNode(), a.push({ type: 2, index: ++s });
1002
- r.append(c[g], z());
1003
- }
1004
- }
1005
- } else if (r.nodeType === 8) if (r.data === rt) a.push({ type: 2, index: s });
1006
- else {
1007
- let c = -1;
1008
- for (; (c = r.data.indexOf(m, c + 1)) !== -1; ) a.push({ type: 7, index: s }), c += m.length - 1;
1009
- }
1010
- s++;
1011
- }
1012
- }
1013
- static createElement(t, e) {
1014
- const o = k.createElement("template");
1015
- return o.innerHTML = t, o;
1016
- }
1017
- }
1018
- function S(n, t, e = n, o) {
1019
- if (t === I) return t;
1020
- let r = o !== void 0 ? e._$Co?.[o] : e._$Cl;
1021
- const s = P(t) ? void 0 : t._$litDirective$;
1022
- return r?.constructor !== s && (r?._$AO?.(!1), s === void 0 ? r = void 0 : (r = new s(n), r._$AT(n, e, o)), o !== void 0 ? (e._$Co ??= [])[o] = r : e._$Cl = r), r !== void 0 && (t = S(n, r._$AS(n, t.values), r, o)), t;
1023
- }
1024
- class St {
1025
- constructor(t, e) {
1026
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
1027
- }
1028
- get parentNode() {
1029
- return this._$AM.parentNode;
1030
- }
1031
- get _$AU() {
1032
- return this._$AM._$AU;
1033
- }
1034
- u(t) {
1035
- const { el: { content: e }, parts: o } = this._$AD, r = (t?.creationScope ?? k).importNode(e, !0);
1036
- x.currentNode = r;
1037
- let s = x.nextNode(), i = 0, l = 0, a = o[0];
1038
- for (; a !== void 0; ) {
1039
- if (i === a.index) {
1040
- let y;
1041
- a.type === 2 ? y = new R(s, s.nextSibling, this, t) : a.type === 1 ? y = new a.ctor(s, a.name, a.strings, this, t) : a.type === 6 && (y = new Pt(s, this, t)), this._$AV.push(y), a = o[++l];
1042
- }
1043
- i !== a?.index && (s = x.nextNode(), i++);
1044
- }
1045
- return x.currentNode = k, r;
1046
- }
1047
- p(t) {
1048
- let e = 0;
1049
- for (const o of this._$AV) o !== void 0 && (o.strings !== void 0 ? (o._$AI(t, o, e), e += o.strings.length - 2) : o._$AI(t[e])), e++;
1050
- }
1051
- }
1052
- class R {
1053
- get _$AU() {
1054
- return this._$AM?._$AU ?? this._$Cv;
1055
- }
1056
- constructor(t, e, o, r) {
1057
- this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = o, this.options = r, this._$Cv = r?.isConnected ?? !0;
1058
- }
1059
- get parentNode() {
1060
- let t = this._$AA.parentNode;
1061
- const e = this._$AM;
1062
- return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
1063
- }
1064
- get startNode() {
1065
- return this._$AA;
1066
- }
1067
- get endNode() {
1068
- return this._$AB;
1069
- }
1070
- _$AI(t, e = this) {
1071
- t = S(this, t, e), P(t) ? t === b || t == null || t === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : t !== this._$AH && t !== I && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : xt(t) ? this.k(t) : this._(t);
1072
- }
1073
- O(t) {
1074
- return this._$AA.parentNode.insertBefore(t, this._$AB);
1075
- }
1076
- T(t) {
1077
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
1078
- }
1079
- _(t) {
1080
- this._$AH !== b && P(this._$AH) ? this._$AA.nextSibling.data = t : this.T(k.createTextNode(t)), this._$AH = t;
1081
- }
1082
- $(t) {
1083
- const { values: e, _$litType$: o } = t, r = typeof o == "number" ? this._$AC(t) : (o.el === void 0 && (o.el = T.createElement(st(o.h, o.h[0]), this.options)), o);
1084
- if (this._$AH?._$AD === r) this._$AH.p(e);
1085
- else {
1086
- const s = new St(r, this), i = s.u(this.options);
1087
- s.p(e), this.T(i), this._$AH = s;
1088
- }
1089
- }
1090
- _$AC(t) {
1091
- let e = tt.get(t.strings);
1092
- return e === void 0 && tt.set(t.strings, e = new T(t)), e;
1093
- }
1094
- k(t) {
1095
- q(this._$AH) || (this._$AH = [], this._$AR());
1096
- const e = this._$AH;
1097
- let o, r = 0;
1098
- for (const s of t) r === e.length ? e.push(o = new R(this.O(z()), this.O(z()), this, this.options)) : o = e[r], o._$AI(s), r++;
1099
- r < e.length && (this._$AR(o && o._$AB.nextSibling, r), e.length = r);
1100
- }
1101
- _$AR(t = this._$AA.nextSibling, e) {
1102
- for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
1103
- const o = t.nextSibling;
1104
- t.remove(), t = o;
1105
- }
1106
- }
1107
- setConnected(t) {
1108
- this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
1109
- }
1110
- }
1111
- class N {
1112
- get tagName() {
1113
- return this.element.tagName;
1114
- }
1115
- get _$AU() {
1116
- return this._$AM._$AU;
1117
- }
1118
- constructor(t, e, o, r, s) {
1119
- this.type = 1, this._$AH = b, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = s, o.length > 2 || o[0] !== "" || o[1] !== "" ? (this._$AH = Array(o.length - 1).fill(new String()), this.strings = o) : this._$AH = b;
1120
- }
1121
- _$AI(t, e = this, o, r) {
1122
- const s = this.strings;
1123
- let i = !1;
1124
- if (s === void 0) t = S(this, t, e, 0), i = !P(t) || t !== this._$AH && t !== I, i && (this._$AH = t);
1125
- else {
1126
- const l = t;
1127
- let a, y;
1128
- for (t = s[0], a = 0; a < s.length - 1; a++) y = S(this, l[o + a], e, a), y === I && (y = this._$AH[a]), i ||= !P(y) || y !== this._$AH[a], y === b ? t = b : t !== b && (t += (y ?? "") + s[a + 1]), this._$AH[a] = y;
1129
- }
1130
- i && !r && this.j(t);
1131
- }
1132
- j(t) {
1133
- t === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
1134
- }
1135
- }
1136
- class wt extends N {
1137
- constructor() {
1138
- super(...arguments), this.type = 3;
1139
- }
1140
- j(t) {
1141
- this.element[this.name] = t === b ? void 0 : t;
1142
- }
1143
- }
1144
- class Et extends N {
1145
- constructor() {
1146
- super(...arguments), this.type = 4;
1147
- }
1148
- j(t) {
1149
- this.element.toggleAttribute(this.name, !!t && t !== b);
1150
- }
1151
- }
1152
- class Ct extends N {
1153
- constructor(t, e, o, r, s) {
1154
- super(t, e, o, r, s), this.type = 5;
1155
- }
1156
- _$AI(t, e = this) {
1157
- if ((t = S(this, t, e, 0) ?? b) === I) return;
1158
- const o = this._$AH, r = t === b && o !== b || t.capture !== o.capture || t.once !== o.once || t.passive !== o.passive, s = t !== b && (o === b || r);
1159
- r && this.element.removeEventListener(this.name, this, o), s && this.element.addEventListener(this.name, this, t), this._$AH = t;
1160
- }
1161
- handleEvent(t) {
1162
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
1163
- }
1164
- }
1165
- class Pt {
1166
- constructor(t, e, o) {
1167
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = o;
1168
- }
1169
- get _$AU() {
1170
- return this._$AM._$AU;
1171
- }
1172
- _$AI(t) {
1173
- S(this, t);
1174
- }
1175
- }
1176
- const It = V.litHtmlPolyfillSupport;
1177
- It?.(T, R), (V.litHtmlVersions ??= []).push("3.3.1");
1178
- /**
1179
- * @license
1180
- * Copyright 2018 Google LLC
1181
- * SPDX-License-Identifier: BSD-3-Clause
1182
- */
1183
- const p = (n) => n ?? b;
1184
- var Tt = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, h = (n, t, e, o) => {
1185
- for (var r = o > 1 ? void 0 : o ? Ot(t, e) : t, s = n.length - 1, i; s >= 0; s--)
1186
- (i = n[s]) && (r = (o ? i(t, e, r) : i(r)) || r);
1187
- return o && r && Tt(t, e, r), r;
1
+ import { LitElement as d, unsafeCSS as v, html as a } from "lit";
2
+ import { property as r } from "lit/decorators.js";
3
+ import { ifDefined as c } from "lit/directives/if-defined.js";
4
+ const f = ':host{--_nys-button-width: fit-content;--_nys-button-height: var(--nys-size-600, 48px);--_nys-button-border-radius--start: var(--nys-radius-xl, 12px);--_nys-button-border-radius--end: var(--nys-radius-xl, 12px);--_nys-button-padding--y: calc( var(--nys-space-150, 12px) - var(--nys-border-width-md, 2px) );--_nys-button-padding--x: calc( var(--nys-space-250, 20px) - var(--nys-border-width-md, 2px) );--_nys-button-gap: var(--nys-space-100, 8px);--_nys-button-border-width: var(--nys-border-width-md, 2px);--_nys-button-outline-width: var(--nys-border-width-md, 2px);--_nys-button-outline-offset: var(--nys-space-2px, 2px);--_nys-button-outline-color: var(--nys-color-focus, #004dd1);--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-theme, #154973) );--_nys-button-color: var( --nys-button-color, var(--nys-color-text-reverse, #ffffff) );--_nys-button-border-color: var( --nys-button-border-color, var(--nys-color-theme, #154973) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-theme-strong, #0e324f) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-text-reverse, #ffffff) );--_nys-button-border-color--hover: var( --nys-button-border-color--hover, var(--nys-color-theme-strong, #0e324f) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-theme-stronger, #081b2b) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-text-reverse, #ffffff) );--_nys-button-border-color--active: var( --nys-button-border-color--active, var(--nys-color-theme-stronger, #081b2b) );--_nys-button-background-color--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-button-border-color--disabled: var(--nys-color-neutral-10, #f6f6f6);--_nys-button-font-size: var(--nys-font-size-ui-md, 16px);--_nys-button-font-weight: var(--nys-font-weight-semibold, 600);--_nys-button-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-button-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) )}:host([size=sm]){--_nys-button-height: var(--nys-size-500, 40px);--_nys-button-padding--y: calc( var(--nys-space-100, 8px) - var(--nys-border-width-md, 2px) );--_nys-button-padding--x: calc( var(--nys-space-200, 16px) - var(--nys-border-width-md, 2px) )}:host([size=md]){--_nys-button-height: var(--nys-size-600, 48px);--_nys-button-padding--y: calc( var(--nys-space-150, 12px) - var(--nys-border-width-md, 2px) );--_nys-button-padding--x: calc( var(--nys-space-250, 20px) - var(--nys-border-width-md, 2px) )}:host([size=lg]){--_nys-button-height: var(--nys-size-700, 56px);--_nys-button-padding--y: calc( var(--nys-space-200, 16px) - var(--nys-border-width-md, 2px) );--_nys-button-padding--x: calc( var(--nys-space-300, 24px) - var(--nys-border-width-md, 2px) )}:host([fullWidth]){--_nys-button-width: 100%}:host([variant=filled]){--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-theme, #154973) );--_nys-button-color: var( --nys-button-color, var(--nys-color-text-reverse, #ffffff) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-theme-strong, #0e324f) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-text-reverse, #ffffff) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-theme-stronger, #081b2b) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-text-reverse, #ffffff) );--_nys-button-background-color--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-button-border-color: var( --nys-button-border-color, var(--nys-color-transparent, #ffffff00) )}:host([variant=outline]){--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-surface, #ffffff) );--_nys-button-color: var( --nys-button-color, var(--nys-color-theme, #154973) );--_nys-button-border-color: var( --nys-button-border-color, var(--nys-color-theme, #154973) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-theme-weaker, #eff6fb) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-theme, #154973) );--_nys-button-border-color--hover: var( --nys-button-border-color--hover, var(--nys-color-theme, #154973) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-theme-weak, #cddde9) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-theme, #154973) );--_nys-button-border-color--active: var( --nys-button-border-color--active, var(--nys-color-theme, #154973) );--_nys-button-background-color--disabled: var(--nys-color-surface, #ffffff);--_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-button-border-color--disabled: var(--nys-color-neutral-100, #d0d0ce)}:host([variant=text]){--_nys-button-height: fit-content;--_nys-button-border-radius--start: var(--nys-radius-md, 4px);--_nys-button-border-radius--end: var(--nys-radius-md, 4px);--_nys-button-padding--y: var(--nys-space-2px, 2px);--_nys-button-padding--x: var(--nys-space-50, 4px);--_nys-button-border-width: 0px;--_nys-button-text-decoration: underline;--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-transparent, #ffffff00) );--_nys-button-color: var( --nys-button-color, var(--nys-color-link, #004dd1) );--_nys-button-border-color: var( --nys-button-border-color, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-transparent, #ffffff00) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-link-strong, #003ba1) );--_nys-button-border-color--hover: var( --nys-button-border-color--hover, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-transparent, #ffffff00) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-link-strongest, #002971) );--_nys-button-border-color--active: var( --nys-button-border-color--active, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--disabled: var( --nys-color-transparent, #ffffff00 );--_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-button-border-color--disabled: var( --nys-color-transparent, #ffffff00 )}:host([variant=ghost]){--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-transparent, #ffffff00) );--_nys-button-color: var( --nys-button-color, var(--nys-color-text, #1b1b1b) );--_nys-button-border-color: var( --nys-button-border-color, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-black-transparent-100, #0000001a) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-text, #1b1b1b) );--_nys-button-border-color--hover: var( --nys-button-border-color--hover, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-black-transparent-200, #00000033) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-text, #1b1b1b) );--_nys-button-border-color--active: var( --nys-button-border-color--active, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--disabled: var( --nys-color-transparent, #ffffff00 );--_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-button-border-color--disabled: var( --nys-color-transparent, #ffffff00 )}:host([variant=filled][inverted]){--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-surface, #ffffff) );--_nys-button-color: var( --nys-button-color, var(--nys-color-text, #1b1b1b) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-neutral-100, #d0d0ce) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-text, #1b1b1b) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-neutral-300, #a7a9ab) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-text, #1b1b1b) );--_nys-button-background-color--disabled: var(--nys-color-text, #1b1b1b);--_nys-button-color--disabled: var(--nys-color-text-disabled, #62666a);--_nys-button-border-color--disabled: var( --nys-color-transparent, #ffffff00 )}:host([variant=outline][inverted]){--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-surface-reverse, #1b1b1b) );--_nys-button-color: var( --nys-button-color, var(--nys-color-text-reverse, #ffffff) );--_nys-button-border-color: var( --nys-button-border-color, var(--nys-color-ink-reverse, #ffffff) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-surface-reverse, #1b1b1b) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-text-reverse-weak, #d0d0ce) );--_nys-button-border-color--hover: var( --nys-button-border-color--hover, var(--nys-color-neutral-100, #d0d0ce) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-surface-reverse, #1b1b1b) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-text-reverse-weaker, #bec0c1) );--_nys-button-border-color--active: var( --nys-button-border-color--active, var(--nys-color-neutral-300, #a7a9ab) );--_nys-button-background-color--disabled: var( --nys-color-surface-reverse, #1b1b1b );--_nys-button-color--disabled: var( --nys-color-text-reverse-disabled, #62666a );--_nys-button-border-color--disabled: var(--nys-color-neutral-600, #62666a)}:host([variant=text][inverted]){--_nys-button-height: fit-content;--_nys-button-border-radius--start: var(--nys-radius-md, 4px);--_nys-button-border-radius--end: var(--nys-radius-md, 4px);--_nys-button-padding--y: var(--nys-space-2px, 2px);--_nys-button-padding--x: var(--nys-space-50, 4px);--_nys-button-border-width: 0px;--_nys-button-text-decoration: underline;--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-transparent, #ffffff00) );--_nys-button-color: var( --nys-button-color, var(--nys-color-link-reverse, #a7a9ab) );--_nys-button-border-color: var( --nys-button-border-color, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-transparent, #ffffff00) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-link-reverse-strong, #ededed) );--_nys-button-border-color--hover: var( --nys-button-border-color--hover, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-transparent, #ffffff00) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-reverse-strongest, #ffffff) );--_nys-button-border-color--active: var( --nys-button-border-color--active, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--disabled: var( --nys-color-transparent, #ffffff00 );--_nys-button-color--disabled: var( --nys-color-text-reverse-disabled, #62666a );--_nys-button-border-color--disabled: var( --nys-color-transparent, #ffffff00 )}:host([variant=ghost][inverted]){--_nys-button-background-color: var( --nys-button-background-color, var(--nys-color-transparent, #ffffff00) );--_nys-button-color: var( --nys-button-color, var(--nys-color-text-reverse, #ffffff) );--_nys-button-border-color: var( --nys-button-border-color, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--hover: var( --nys-button-background-color--hover, var(--nys-color-white-transparent-100, #ffffff1a) );--_nys-button-color--hover: var( --nys-button-color--hover, var(--nys-color-text-reverse, #ffffff) );--_nys-button-border-color--hover: var( --nys-button-border-color--hover, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--active: var( --nys-button-background-color--active, var(--nys-color-white-transparent-200, #ffffff33) );--_nys-button-color--active: var( --nys-button-color--active, var(--nys-color-text-reverse, #ffffff) );--_nys-button-border-color--active: var( --nys-button-border-color--active, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--disabled: var( --nys-color-transparent, #ffffff00 );--_nys-button-color--disabled: var(--nys-color-text-disabled, #62666a);--_nys-button-border-color--disabled: var( --nys-color-transparent, #ffffff00 )}:host([circle]){--_nys-button-width: var(--_nys-button-height);--_nys-button-border-radius--start: var(--nys-radius-round, 1776px);--_nys-button-border-radius--end: var(--nys-radius-round, 1776px);--_nys-button-padding--y: 0;--_nys-button-padding--x: 0}.nys-button{width:var(--_nys-button-width);min-height:var(--_nys-button-height);border-start-start-radius:var(--_nys-button-border-radius--start);border-end-start-radius:var(--_nys-button-border-radius--start);border-start-end-radius:var(--_nys-button-border-radius--end);border-end-end-radius:var(--_nys-button-border-radius--end);padding:var(--_nys-button-padding--y) var(--_nys-button-padding--x);display:flex;align-items:center;justify-content:center;gap:var(--_nys-button-gap);font-family:var(--_nys-button-font-family);font-size:var(--_nys-button-font-size);font-weight:var(--_nys-button-font-weight);line-height:var(--_nys-button-line-height);text-decoration:var(--_nys-button-text-decoration);box-sizing:border-box;background-color:var(--_nys-button-background-color);color:var(--_nys-button-color);border:solid var(--_nys-button-border-width) var(--_nys-button-border-color);cursor:var(--_nys-button-cursor, pointer)}:host([circle]) .nys-button{max-width:var(--_nys-button-height);max-height:var(--_nys-button-height)}.nys-button:hover{background-color:var(--_nys-button-background-color--hover);color:var(--_nys-button-color--hover);border-color:var(--_nys-button-border-color--hover)}.nys-button:active{background-color:var(--_nys-button-background-color--active);color:var(--_nys-button-color--active);border-color:var(--_nys-button-border-color--active)}.nys-button:disabled,a[disabled]{background-color:var(--_nys-button-background-color--disabled);color:var(--_nys-button-color--disabled);border-color:var(--_nys-button-border-color--disabled);cursor:not-allowed}.nys-button__linkwrapper:has([disabled]){cursor:not-allowed;width:fit-content}a[disabled]{pointer-events:none}a[disabled]:hover{background-color:var(--_nys-button-background-color--disabled);color:var(--_nys-button-color--disabled);border-color:var(--_nys-button-border-color--disabled)}.nys-button *{cursor:var(--_nys-button-cursor, pointer)}.nys-button:disabled *{cursor:not-allowed}.nys-button:focus-visible{outline-offset:var(--_nys-button-outline-offset);outline:solid var(--_nys-button-outline-width) var(--_nys-button-outline-color)}.nys-button__text{display:flex;align-items:center;-webkit-user-select:none;user-select:none}';
5
+ var h = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, n = (y, o, s, i) => {
6
+ for (var l = i > 1 ? void 0 : i ? _(o, s) : o, b = y.length - 1, u; b >= 0; b--)
7
+ (u = y[b]) && (l = (i ? u(o, s, l) : u(l)) || l);
8
+ return i && l && h(o, s, l), l;
1188
9
  };
1189
- let Dt = 0;
1190
- var v;
1191
- const d = (v = class extends at {
10
+ let p = 0;
11
+ var e;
12
+ const t = (e = class extends d {
1192
13
  // allows use of elementInternals' API
1193
14
  constructor() {
1194
15
  super(), this.id = "", this.name = "", this._size = "md", this.fullWidth = !1, this._variant = "filled", this.inverted = !1, this.label = "", this.ariaLabel = "", this.ariaControls = "", this.prefixIcon = "", this.suffixIcon = "", this.circle = !1, this.icon = "", this.disabled = !1, this.form = null, this.value = "", this.ariaDescription = "", this._type = "button", this.onClick = null, this.href = "", this._target = "_self", this._internals = this.attachInternals();
@@ -1196,59 +17,59 @@ const d = (v = class extends at {
1196
17
  get size() {
1197
18
  return this._size;
1198
19
  }
1199
- set size(t) {
1200
- this._size = v.VALID_SIZES.includes(
1201
- t
1202
- ) ? t : "md";
20
+ set size(o) {
21
+ this._size = e.VALID_SIZES.includes(
22
+ o
23
+ ) ? o : "md";
1203
24
  }
1204
25
  get variant() {
1205
26
  return this._variant;
1206
27
  }
1207
- set variant(t) {
1208
- this._variant = v.VALID_VARIANTS.includes(
1209
- t
1210
- ) ? t : "filled";
28
+ set variant(o) {
29
+ this._variant = e.VALID_VARIANTS.includes(
30
+ o
31
+ ) ? o : "filled";
1211
32
  }
1212
33
  get type() {
1213
34
  return this._type;
1214
35
  }
1215
- set type(t) {
1216
- this._type = v.VALID_TYPES.includes(
1217
- t
1218
- ) ? t : "button";
36
+ set type(o) {
37
+ this._type = e.VALID_TYPES.includes(
38
+ o
39
+ ) ? o : "button";
1219
40
  }
1220
41
  get target() {
1221
42
  return this._target;
1222
43
  }
1223
- set target(t) {
1224
- this._target = v.VALID_TARGETS.includes(
1225
- t
1226
- ) ? t : "_self";
44
+ set target(o) {
45
+ this._target = e.VALID_TARGETS.includes(
46
+ o
47
+ ) ? o : "_self";
1227
48
  }
1228
49
  async getButtonElement() {
1229
50
  await this.updateComplete;
1230
- const t = this.shadowRoot?.querySelector("a.nys-button") || null;
1231
- if (t) return t;
1232
- const e = this.shadowRoot?.querySelector("button.nys-button") || null;
1233
- return e || null;
51
+ const o = this.shadowRoot?.querySelector("a.nys-button") || null;
52
+ if (o) return o;
53
+ const s = this.shadowRoot?.querySelector("button.nys-button") || null;
54
+ return s || null;
1234
55
  }
1235
56
  connectedCallback() {
1236
57
  super.connectedCallback(), this.id || (this.id = this._generateUniqueId());
1237
58
  }
1238
59
  /******************** Functions ********************/
1239
60
  _generateUniqueId() {
1240
- return `nys-button-${Date.now()}-${Dt++}`;
61
+ return `nys-button-${Date.now()}-${p++}`;
1241
62
  }
1242
63
  _manageFormAction() {
1243
64
  typeof this.onClick == "function" && this.onClick !== null && this.onClick(new Event("click"));
1244
- const t = this._internals.form;
1245
- if (t)
65
+ const o = this._internals.form;
66
+ if (o)
1246
67
  switch (this.type) {
1247
68
  case "submit":
1248
- t.requestSubmit();
69
+ o.requestSubmit();
1249
70
  break;
1250
71
  case "reset":
1251
- t.reset();
72
+ o.reset();
1252
73
  break;
1253
74
  }
1254
75
  }
@@ -1261,24 +82,24 @@ const d = (v = class extends at {
1261
82
  _handleBlur() {
1262
83
  this.shadowRoot?.querySelector(".nys-button")?.classList.remove("active-focus"), this.dispatchEvent(new Event("nys-blur"));
1263
84
  }
1264
- _handleClick(t) {
85
+ _handleClick(o) {
1265
86
  if (this.disabled) {
1266
- t.preventDefault();
87
+ o.preventDefault();
1267
88
  return;
1268
89
  }
1269
90
  this._manageFormAction(), this.dispatchEvent(new Event("nys-click"));
1270
91
  }
1271
92
  // Handle keydown for keyboard accessibility
1272
- _handleKeydown(t) {
1273
- if (t.code === "Space" || t.code === "Enter" || t.key === " " || t.key === "Enter") {
93
+ _handleKeydown(o) {
94
+ if (o.code === "Space" || o.code === "Enter" || o.key === " " || o.key === "Enter") {
1274
95
  if (this.disabled) return;
1275
- if (t.preventDefault(), this.href) {
1276
- const e = this.renderRoot.querySelector(
96
+ if (o.preventDefault(), this.href) {
97
+ const s = this.renderRoot.querySelector(
1277
98
  "a.nys-button"
1278
99
  );
1279
- e && e.click();
100
+ s && s.click();
1280
101
  } else
1281
- this._handleAnyAttributeFunction(), this._handleClick(t);
102
+ this._handleAnyAttributeFunction(), this._handleClick(o);
1282
103
  }
1283
104
  }
1284
105
  /**
@@ -1288,33 +109,32 @@ const d = (v = class extends at {
1288
109
  * In vanilla HTML/JS, clicking with execute the attribute function, BUT now with keydown, hence this solution.
1289
110
  */
1290
111
  _handleAnyAttributeFunction() {
1291
- const t = this.getAttribute("onClick");
1292
- t && new Function("return " + t)();
112
+ const o = this.getAttribute("onClick");
113
+ o && new Function("return " + o)();
1293
114
  }
1294
115
  /******************** Public Methods ********************/
1295
- focus(t) {
1296
- const e = this.renderRoot.querySelector(
116
+ focus(o) {
117
+ const s = this.renderRoot.querySelector(
1297
118
  this.href ? "a.nys-button" : "button.nys-button"
1298
119
  );
1299
- e ? e.focus(t) : super.focus(t);
120
+ s ? s.focus(o) : super.focus(o);
1300
121
  }
1301
122
  render() {
1302
- return _`
1303
- ${this.href ? _`
123
+ return a`
124
+ ${this.href ? a`
1304
125
  <div class="nys-button__linkwrapper">
1305
126
  <a
1306
127
  class="nys-button"
1307
- id=${p(this.id)}
1308
- name=${p(this.name ? this.name : void 0)}
128
+ name=${c(this.name ? this.name : void 0)}
1309
129
  ?disabled=${this.disabled}
1310
130
  aria-disabled="${this.disabled ? "true" : "false"}"
1311
- value=${p(this.value ? this.value : void 0)}
131
+ value=${c(this.value ? this.value : void 0)}
1312
132
  href=${this.href}
1313
133
  target=${this.target}
1314
- aria-label=${p(
134
+ aria-label=${c(
1315
135
  this.ariaLabel || this.label || (this.circle ? this.icon : null) || "button"
1316
136
  )}
1317
- aria-description=${p(this.ariaDescription || void 0)}
137
+ aria-description=${c(this.ariaDescription || void 0)}
1318
138
  @click=${this._handleClick}
1319
139
  @focus="${this._handleFocus}"
1320
140
  @blur="${this._handleBlur}"
@@ -1322,14 +142,14 @@ const d = (v = class extends at {
1322
142
  role="button"
1323
143
  tabindex="${this.disabled ? -1 : 0}"
1324
144
  >
1325
- ${this.prefixIcon && this.variant !== "text" ? _`<slot name="prefix-icon">
145
+ ${this.prefixIcon && this.variant !== "text" ? a`<slot name="prefix-icon">
1326
146
  <nys-icon size="16" name=${this.prefixIcon}></nys-icon>
1327
147
  </slot>` : ""}
1328
- ${this.label && !this.circle ? _`<div class="nys-button__text">${this.label}</div>` : ""}
1329
- ${this.suffixIcon && this.variant !== "text" ? _`<slot name="suffix-icon">
148
+ ${this.label && !this.circle ? a`<div class="nys-button__text">${this.label}</div>` : ""}
149
+ ${this.suffixIcon && this.variant !== "text" ? a`<slot name="suffix-icon">
1330
150
  <nys-icon size="16" name=${this.suffixIcon}></nys-icon>
1331
151
  </slot>` : ""}
1332
- ${this.circle && this.icon ? _`<slot name="circle-icon"
152
+ ${this.circle && this.icon ? a`<slot name="circle-icon"
1333
153
  ><nys-icon
1334
154
  size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
1335
155
  name=${this.icon}
@@ -1337,34 +157,33 @@ const d = (v = class extends at {
1337
157
  ></slot>` : ""}
1338
158
  </a>
1339
159
  </div>
1340
- ` : _`
160
+ ` : a`
1341
161
  <button
1342
162
  class="nys-button"
1343
- id=${p(this.id)}
1344
- name=${p(this.name ? this.name : void 0)}
163
+ name=${c(this.name ? this.name : void 0)}
1345
164
  ?disabled=${this.disabled}
1346
- form=${p(this.form || void 0)}
1347
- value=${p(this.value ? this.value : void 0)}
165
+ form=${c(this.form || void 0)}
166
+ value=${c(this.value ? this.value : void 0)}
1348
167
  type=${this.type}
1349
- aria-controls=${p(this.ariaControls || void 0)}
1350
- aria-label=${p(
168
+ aria-controls=${c(this.ariaControls || void 0)}
169
+ aria-label=${c(
1351
170
  this.ariaLabel || this.label || (this.circle ? this.icon : null) || this.prefixIcon || this.suffixIcon || "button"
1352
171
  )}
1353
- aria-description=${p(this.ariaDescription || void 0)}
172
+ aria-description=${c(this.ariaDescription || void 0)}
1354
173
  @click=${this._handleClick}
1355
174
  @focus="${this._handleFocus}"
1356
175
  @blur="${this._handleBlur}"
1357
176
  @keydown="${this._handleKeydown}"
1358
177
  role="button"
1359
178
  >
1360
- ${this.prefixIcon && this.variant !== "text" ? _`<slot name="prefix-icon">
179
+ ${this.prefixIcon && this.variant !== "text" ? a`<slot name="prefix-icon">
1361
180
  <nys-icon size="16" name=${this.prefixIcon}></nys-icon>
1362
181
  </slot>` : ""}
1363
- ${this.label && !this.circle ? _`<div class="nys-button__text">${this.label}</div>` : ""}
1364
- ${this.suffixIcon && this.variant !== "text" ? _`<slot name="suffix-icon">
182
+ ${this.label && !this.circle ? a`<div class="nys-button__text">${this.label}</div>` : ""}
183
+ ${this.suffixIcon && this.variant !== "text" ? a`<slot name="suffix-icon">
1365
184
  <nys-icon size="16" name=${this.suffixIcon}></nys-icon>
1366
185
  </slot>` : ""}
1367
- ${this.circle && this.icon ? _`<slot name="circle-icon">
186
+ ${this.circle && this.icon ? a`<slot name="circle-icon">
1368
187
  <nys-icon
1369
188
  size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
1370
189
  name=${this.icon}
@@ -1374,84 +193,84 @@ const d = (v = class extends at {
1374
193
  `}
1375
194
  `;
1376
195
  }
1377
- }, v.VALID_SIZES = ["sm", "md", "lg"], v.VALID_VARIANTS = [
196
+ }, e.styles = v(f), e.VALID_SIZES = ["sm", "md", "lg"], e.VALID_VARIANTS = [
1378
197
  "filled",
1379
198
  "outline",
1380
199
  "ghost",
1381
200
  "text"
1382
- ], v.VALID_TYPES = ["submit", "reset", "button"], v.VALID_TARGETS = [
201
+ ], e.VALID_TYPES = ["submit", "reset", "button"], e.VALID_TARGETS = [
1383
202
  "_self",
1384
203
  "_blank",
1385
204
  "_parent",
1386
205
  "_top",
1387
206
  "framename"
1388
- ], v.styles = mt, v.formAssociated = !0, v);
1389
- h([
1390
- u({ type: String })
1391
- ], d.prototype, "id", 2);
1392
- h([
1393
- u({ type: String, reflect: !0 })
1394
- ], d.prototype, "name", 2);
1395
- h([
1396
- u({ reflect: !0 })
1397
- ], d.prototype, "size", 1);
1398
- h([
1399
- u({ type: Boolean, reflect: !0 })
1400
- ], d.prototype, "fullWidth", 2);
1401
- h([
1402
- u({ reflect: !0 })
1403
- ], d.prototype, "variant", 1);
1404
- h([
1405
- u({ type: Boolean, reflect: !0 })
1406
- ], d.prototype, "inverted", 2);
1407
- h([
1408
- u({ type: String })
1409
- ], d.prototype, "label", 2);
1410
- h([
1411
- u({ type: String })
1412
- ], d.prototype, "ariaLabel", 2);
1413
- h([
1414
- u({ type: String })
1415
- ], d.prototype, "ariaControls", 2);
1416
- h([
1417
- u({ type: String })
1418
- ], d.prototype, "prefixIcon", 2);
1419
- h([
1420
- u({ type: String })
1421
- ], d.prototype, "suffixIcon", 2);
1422
- h([
1423
- u({ type: Boolean, reflect: !0 })
1424
- ], d.prototype, "circle", 2);
1425
- h([
1426
- u({ type: String })
1427
- ], d.prototype, "icon", 2);
1428
- h([
1429
- u({ type: Boolean, reflect: !0 })
1430
- ], d.prototype, "disabled", 2);
1431
- h([
1432
- u({ type: String, reflect: !0 })
1433
- ], d.prototype, "form", 2);
1434
- h([
1435
- u({ type: String })
1436
- ], d.prototype, "value", 2);
1437
- h([
1438
- u({ type: String })
1439
- ], d.prototype, "ariaDescription", 2);
1440
- h([
1441
- u({ reflect: !0 })
1442
- ], d.prototype, "type", 1);
1443
- h([
1444
- u({ attribute: !1 })
1445
- ], d.prototype, "onClick", 2);
1446
- h([
1447
- u({ type: String })
1448
- ], d.prototype, "href", 2);
1449
- h([
1450
- u({ reflect: !0 })
1451
- ], d.prototype, "target", 1);
1452
- let Ht = d;
1453
- customElements.get("nys-button") || customElements.define("nys-button", Ht);
207
+ ], e.formAssociated = !0, e);
208
+ n([
209
+ r({ type: String, reflect: !0 })
210
+ ], t.prototype, "id", 2);
211
+ n([
212
+ r({ type: String, reflect: !0 })
213
+ ], t.prototype, "name", 2);
214
+ n([
215
+ r({ reflect: !0 })
216
+ ], t.prototype, "size", 1);
217
+ n([
218
+ r({ type: Boolean, reflect: !0 })
219
+ ], t.prototype, "fullWidth", 2);
220
+ n([
221
+ r({ reflect: !0 })
222
+ ], t.prototype, "variant", 1);
223
+ n([
224
+ r({ type: Boolean, reflect: !0 })
225
+ ], t.prototype, "inverted", 2);
226
+ n([
227
+ r({ type: String })
228
+ ], t.prototype, "label", 2);
229
+ n([
230
+ r({ type: String })
231
+ ], t.prototype, "ariaLabel", 2);
232
+ n([
233
+ r({ type: String })
234
+ ], t.prototype, "ariaControls", 2);
235
+ n([
236
+ r({ type: String })
237
+ ], t.prototype, "prefixIcon", 2);
238
+ n([
239
+ r({ type: String })
240
+ ], t.prototype, "suffixIcon", 2);
241
+ n([
242
+ r({ type: Boolean, reflect: !0 })
243
+ ], t.prototype, "circle", 2);
244
+ n([
245
+ r({ type: String })
246
+ ], t.prototype, "icon", 2);
247
+ n([
248
+ r({ type: Boolean, reflect: !0 })
249
+ ], t.prototype, "disabled", 2);
250
+ n([
251
+ r({ type: String, reflect: !0 })
252
+ ], t.prototype, "form", 2);
253
+ n([
254
+ r({ type: String })
255
+ ], t.prototype, "value", 2);
256
+ n([
257
+ r({ type: String })
258
+ ], t.prototype, "ariaDescription", 2);
259
+ n([
260
+ r({ reflect: !0 })
261
+ ], t.prototype, "type", 1);
262
+ n([
263
+ r({ attribute: !1 })
264
+ ], t.prototype, "onClick", 2);
265
+ n([
266
+ r({ type: String })
267
+ ], t.prototype, "href", 2);
268
+ n([
269
+ r({ reflect: !0 })
270
+ ], t.prototype, "target", 1);
271
+ let g = t;
272
+ customElements.get("nys-button") || customElements.define("nys-button", g);
1454
273
  export {
1455
- Ht as NysButton
274
+ g as NysButton
1456
275
  };
1457
276
  //# sourceMappingURL=nys-button.js.map