@nysds/nys-button 1.21.0 → 1.22.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.
@@ -28,9 +28,24 @@ import "@nysds/nys-icon";
28
28
  * @cssprop [--nys-button-border-color--hover] - Border color when hovered.
29
29
  * @cssprop [--nys-button-border-color--active] - Border color when active/pressed.
30
30
  *
31
- * @fires nys-click - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.
32
- * @fires nys-focus - Fired when the button receives focus.
33
- * @fires nys-blur - Fired when the button loses focus.
31
+ * @fires {Event} nys-click - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.
32
+ * @fires {Event} nys-focus - Fired when the button receives focus.
33
+ * @fires {Event} nys-blur - Fired when the button loses focus.
34
+ *
35
+ * @usagedos
36
+ * - Use for the most important actions you want users to take, such as "Download", "Sign up", or "Log out".
37
+ * - Use `variant="fill"` for the primary action on the page. There should be only one primary action per page.
38
+ * - Use `variant="outline"` for secondary actions, placed next to the primary Fill button.
39
+ * - Use `variant="ghost"` buttons for additional actions beyond primary and secondary.
40
+ * - Use `variant="text"` buttons when an action needs to appear within a text block. If clicking takes the user somewhere else, use a Link instead.
41
+ * - Always set the `type` attribute (`submit`, `button`, or `reset`). The default is `button`.
42
+ * - Use sentence case for button labels, only capitalizing the first word.
43
+ * - Place a `chevron_down icon` on the right for buttons that open a dropdown.
44
+ *
45
+ * @usagedonts
46
+ * - Use buttons for navigation. Use an `<a>` element or Text button for links that take users somewhere else.
47
+ * - Use icons in buttons without a text label. Very few icons are universally understood.
48
+ * - Create custom button styles (color, shape, size). Consistency helps users recognize buttons and predict behavior.
34
49
  *
35
50
  * @example Basic
36
51
  * ```html
@@ -245,7 +260,18 @@ export declare class NysButton extends NysFormControlElement {
245
260
  */
246
261
  form: string | null;
247
262
  /**
248
- * Value submitted with form data. Only used when `type="submit"`.
263
+ * Value submitted with the form data, mirroring a native submit button.
264
+ *
265
+ * When `type="submit"` and both `name` and `value` are set, the entry
266
+ * `name=value` is included in the form's data only for submissions this
267
+ * button triggers. It is not included when the form is submitted another
268
+ * way (Enter in a text field, another button, `form.requestSubmit()`),
269
+ * and it is not readable from `new FormData(form)` outside a submission,
270
+ * matching native submitter semantics.
271
+ *
272
+ * A form-associated custom element cannot act as a native submitter, so
273
+ * the value is staged through `ElementInternals.setFormValue()` for the
274
+ * duration of the submission and cleared afterward.
249
275
  */
250
276
  value: string;
251
277
  /**
@@ -259,6 +285,11 @@ export declare class NysButton extends NysFormControlElement {
259
285
  type: "submit" | "reset" | "button";
260
286
  /**
261
287
  * Click handler. Use instead of `@click` to ensure keyboard accessibility.
288
+ *
289
+ * @deprecated Listen for the `nys-click` event instead. `nys-click`
290
+ * bubbles, is composed, and fires for both mouse and keyboard activation
291
+ * but never while disabled. This property still works but is excluded
292
+ * from generated framework wrappers and goes away in 2.0.
262
293
  */
263
294
  onClick: ((event: Event) => void) | null;
264
295
  /**
@@ -1,5 +1,5 @@
1
- import { LitElement as h, unsafeCSS as _, html as a } from "lit";
2
- import { property as n, state as d } from "lit/decorators.js";
1
+ import { LitElement as _, unsafeCSS as p, html as i } from "lit";
2
+ import { property as e, state as f } from "lit/decorators.js";
3
3
  import { ifDefined as l } from "lit/directives/if-defined.js";
4
4
  import "@nysds/nys-icon";
5
5
  /*!
@@ -7,63 +7,74 @@ import "@nysds/nys-icon";
7
7
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
8
8
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
9
9
  *
10
- * Button Component v1.21.0
10
+ * Button Component v1.22.0
11
11
  * Part of the New York State Design System
12
12
  * Repository: https://github.com/its-hcd/nysds
13
13
  * License: MIT
14
14
  */
15
15
  /*!
16
- * New York State Design System v1.21.0
16
+ * New York State Design System v1.22.0
17
17
  * Description: A design system for New York State's digital products.
18
18
  * Repository: https://github.com/its-hcd/nysds
19
19
  * License: MIT
20
20
  */
21
- var p = 0;
22
- function g(c) {
23
- return `${c}-${Date.now()}-${p++}`;
21
+ let g = 0;
22
+ function x(a) {
23
+ return `${a}-${Date.now()}-${g++}`;
24
24
  }
25
- var x = (c) => {
26
- class t extends c {
25
+ function k(a, t, n) {
26
+ a.dispatchEvent(
27
+ new CustomEvent(t, { detail: n, bubbles: !0, composed: !0 })
28
+ );
29
+ }
30
+ function h(a, t) {
31
+ a.dispatchEvent(
32
+ new Event(`nys-${t}`, { bubbles: !0, composed: !0 })
33
+ );
34
+ }
35
+ const m = (a) => {
36
+ class t extends a {
27
37
  get idPrefix() {
28
38
  return this.localName || "nys-element";
29
39
  }
30
40
  ensureId() {
31
- this.id || (this.id = g(this.idPrefix));
41
+ this.id || (this.id = x(this.idPrefix));
32
42
  }
33
43
  connectedCallback() {
34
44
  super.connectedCallback(), this.ensureId();
35
45
  }
36
46
  }
37
47
  return t;
38
- }, k = (c) => {
39
- class t extends x(c) {
40
- constructor(...i) {
41
- super(...i), this.__internals = null;
48
+ }, $ = (a) => {
49
+ class t extends m(a) {
50
+ constructor() {
51
+ super(...arguments), this.__internals = null;
42
52
  }
43
53
  get internals() {
44
54
  if (this.__internals) return this.__internals;
45
- if (typeof this.attachInternals == "function") try {
46
- this.__internals = this.attachInternals();
47
- } catch {
48
- this.__internals = null;
49
- }
55
+ if (typeof this.attachInternals == "function")
56
+ try {
57
+ this.__internals = this.attachInternals();
58
+ } catch {
59
+ this.__internals = null;
60
+ }
50
61
  return this.__internals;
51
62
  }
52
63
  get defaultRole() {
53
64
  return null;
54
65
  }
55
- setHostAria(i, s) {
66
+ setHostAria(c, s) {
56
67
  const b = this.internals;
57
- if (b && i in b) {
58
- b[i] = s;
68
+ if (b && c in b) {
69
+ b[c] = s;
59
70
  return;
60
71
  }
61
- const u = m(i);
72
+ const u = S(c);
62
73
  s === null ? this.removeAttribute(u) : this.setAttribute(u, s);
63
74
  }
64
75
  reflectDefaultSemantics() {
65
- const i = this.defaultRole;
66
- i && this.setHostAria("role", i);
76
+ const c = this.defaultRole;
77
+ c && this.setHostAria("role", c);
67
78
  }
68
79
  connectedCallback() {
69
80
  super.connectedCallback(), this.reflectDefaultSemantics();
@@ -71,21 +82,33 @@ var x = (c) => {
71
82
  }
72
83
  return t;
73
84
  };
74
- function m(c) {
75
- if (c === "role") return "role";
76
- const t = c.replace(/^aria/, "");
85
+ function S(a) {
86
+ if (a === "role") return "role";
87
+ const t = a.replace(/^aria/, "");
77
88
  return "aria-" + t.charAt(0).toLowerCase() + t.slice(1);
78
89
  }
79
- var $ = (c) => {
80
- const e = class e extends k(c) {
90
+ const w = (a) => {
91
+ const t = class extends $(a) {
92
+ constructor() {
93
+ super(...arguments), this.__internalValidationMessage = "";
94
+ }
95
+ get internalValidationMessage() {
96
+ return this.__internalValidationMessage;
97
+ }
98
+ set internalValidationMessage(s) {
99
+ s !== this.__internalValidationMessage && (this.__internalValidationMessage = s, this.requestUpdate("internalValidationMessage"));
100
+ }
101
+ resolvedErrorMessage() {
102
+ return this.errorMessage || this.internalValidationMessage;
103
+ }
81
104
  setFormValue(s) {
82
105
  this.internals?.setFormValue(s ?? null);
83
106
  }
84
107
  setValidityFromState(s, b, u) {
85
- const f = this.internals;
86
- if (!f) return;
108
+ const d = this.internals;
109
+ if (!d) return;
87
110
  const v = Object.values(s).some(Boolean);
88
- v ? f.setValidity(s, b ?? "Invalid value", u) : f.setValidity({}), this.setHostAria("ariaInvalid", v ? "true" : "false");
111
+ v ? d.setValidity(s, b ?? "Invalid value", u) : d.setValidity({}), this.setHostAria("ariaInvalid", v ? "true" : "false");
89
112
  }
90
113
  clearValidity() {
91
114
  this.internals?.setValidity({}), this.setHostAria("ariaInvalid", "false");
@@ -97,20 +120,17 @@ var $ = (c) => {
97
120
  return this.internals?.reportValidity() ?? !0;
98
121
  }
99
122
  formResetCallback() {
100
- this.clearValidity();
123
+ this.internalValidationMessage = "", this.clearValidity();
101
124
  }
102
125
  };
103
- e.formAssociated = !0;
104
- let t = e;
105
- return t;
106
- }, S = /* @__PURE__ */ $(h);
107
- const w = ':host{--_nys-button-width: fit-content;--_nys-button-height: var(--nys-size-600, 48px);--_nys-button-border-radius: var(--nys-radius-xl, 12px);--_nys-button-padding--y: calc( var(--nys-space-150, 12px) - var(--nys-border-width-md, 2px) );--_nys-button-cursor: pointer;--_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-justify-content: center;--_nys-button-border-style: solid;--_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-transparent, #ffffff00) );--_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-transparent, #ffffff00) );--_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-transparent, #ffffff00) );--_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-transparent, #ffffff00);--_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 ) );--_nys-button-text-decoration: none;display:inline-flex;width:var(--_nys-button-width);vertical-align:middle}: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=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]){width:100%}:host([fullWidth]) .nys-button__linkwrapper{width:100%}: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-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-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, var(--nys-color-transparent, #ffffff00) );--_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, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1)}: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: var(--nys-radius-md, 4px);--_nys-button-padding--y: var(--nys-space-2px, 2px);--_nys-button-padding--x: 0;--_nys-button-border-width: 0px;--_nys-button-text-decoration: underline;--_nys-button-text-decoration-thickness: var( --nys-font-decoration-thickness-regular, 7% );--_nys-button-text-decoration-thickness--hover: var( --nys-font-decoration-thickness-strong, 14% );--_nys-button-text-decoration-thickness--active: var( --nys-font-decoration-thickness-strong, 14% );--_nys-button-gap: var(--nys-space-50, 4px);--_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-gap: var(--nys-space-50, 4px);--_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-border-color--disabled: var(--nys-color-transparent, #ffffff00);--_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)}: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-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-200, #ffffff33) );--_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-300, #ffffff4d) );--_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([inverted]){--_nys-button-outline-color: var(--nys-color-focus-reverse, #7aa5e7)}:host([circle]){--_nys-button-width: var(--_nys-button-height);--_nys-button-border-radius: var(--nys-radius-round, 1776px);--_nys-button-padding--y: 0;--_nys-button-padding--x: 0}:host([circle]) .nys-button{max-width:var(--_nys-button-height);max-height:var(--_nys-button-height)}.nys-button{width:var(--_nys-button-width);min-height:var(--_nys-button-height);border-radius:var(--_nys-button-border-radius);padding:var(--_nys-button-padding--y) var(--_nys-button-padding--x);display:flex;align-items:center;justify-content:var(--_nys-button-justify-content);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-color:var(--_nys-button-border-color);border-style:var(--_nys-button-border-style);border-width:var(--_nys-button-border-width);cursor:var(--_nys-button-cursor)}.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);text-decoration-thickness:var(--_nys-button-text-decoration-thickness--hover, auto)}.nys-button:active,.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);text-decoration-thickness:var(--_nys-button-text-decoration-thickness--active, auto)}.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);--_nys-button-cursor: not-allowed}a[disabled]{pointer-events:none}.nys-button:focus-visible,.active-focus{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}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}';
108
- var C = Object.defineProperty, r = (c, t, e, i) => {
109
- for (var s = void 0, b = c.length - 1, u; b >= 0; b--)
110
- (u = c[b]) && (s = u(t, e, s) || s);
111
- return s && C(t, e, s), s;
126
+ return t.formAssociated = !0, t;
127
+ }, C = /* @__PURE__ */ w(_), I = ':host{--_nys-button-width: fit-content;--_nys-button-height: var(--nys-size-600, 48px);--_nys-button-border-radius: var(--nys-radius-xl, 12px);--_nys-button-padding--y: calc( var(--nys-space-150, 12px) - var(--nys-border-width-md, 2px) );--_nys-button-cursor: pointer;--_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-justify-content: center;--_nys-button-border-style: solid;--_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-transparent, #ffffff00) );--_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-transparent, #ffffff00) );--_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-transparent, #ffffff00) );--_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-transparent, #ffffff00);--_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 ) );--_nys-button-text-decoration: none;display:inline-flex;width:var(--_nys-button-width);vertical-align:middle}: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=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]){width:100%}:host([fullWidth]) .nys-button__linkwrapper{width:100%}: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-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-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, var(--nys-color-transparent, #ffffff00) );--_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, var(--nys-color-transparent, #ffffff00) );--_nys-button-background-color--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-button-color--disabled: var(--nys-color-text-disabled, #bec0c1)}: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: var(--nys-radius-md, 4px);--_nys-button-padding--y: var(--nys-space-2px, 2px);--_nys-button-padding--x: 0;--_nys-button-border-width: 0px;--_nys-button-text-decoration: underline;--_nys-button-text-decoration-thickness: var( --nys-font-decoration-thickness-regular, 7% );--_nys-button-text-decoration-thickness--hover: var( --nys-font-decoration-thickness-strong, 14% );--_nys-button-text-decoration-thickness--active: var( --nys-font-decoration-thickness-strong, 14% );--_nys-button-gap: var(--nys-space-50, 4px);--_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-gap: var(--nys-space-50, 4px);--_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-border-color--disabled: var(--nys-color-transparent, #ffffff00);--_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)}: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-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-200, #ffffff33) );--_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-300, #ffffff4d) );--_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([inverted]){--_nys-button-outline-color: var(--nys-color-focus-reverse, #7aa5e7)}:host([circle]){--_nys-button-width: var(--_nys-button-height);--_nys-button-border-radius: var(--nys-radius-round, 1776px);--_nys-button-padding--y: 0;--_nys-button-padding--x: 0}:host([circle]) .nys-button{max-width:var(--_nys-button-height);max-height:var(--_nys-button-height)}.nys-button{width:var(--_nys-button-width);min-height:var(--_nys-button-height);border-radius:var(--_nys-button-border-radius);padding:var(--_nys-button-padding--y) var(--_nys-button-padding--x);display:flex;align-items:center;justify-content:var(--_nys-button-justify-content);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-color:var(--_nys-button-border-color);border-style:var(--_nys-button-border-style);border-width:var(--_nys-button-border-width);cursor:var(--_nys-button-cursor)}.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);text-decoration-thickness:var(--_nys-button-text-decoration-thickness--hover, auto)}.nys-button:active,.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);text-decoration-thickness:var(--_nys-button-text-decoration-thickness--active, auto)}.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);--_nys-button-cursor: not-allowed}a[disabled]{pointer-events:none}.nys-button:focus-visible,.active-focus{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}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}';
128
+ var V = Object.defineProperty, r = (a, t, n, c) => {
129
+ for (var s = void 0, b = a.length - 1, u; b >= 0; b--)
130
+ (u = a[b]) && (s = u(t, n, s) || s);
131
+ return s && V(t, n, s), s;
112
132
  };
113
- const y = class y extends S {
133
+ const y = class y extends C {
114
134
  constructor() {
115
135
  super(...arguments), this.id = "", this.name = "", this.size = "md", this.fullWidth = !1, this.variant = "filled", this.inverted = !1, this.label = "", this.ariaControls = "", this.ariaExpanded = "", this.ariaCurrent = "", this.prefixIcon = "", this.suffixIcon = "", this.circle = !1, this.icon = "", this.disabled = !1, this.form = null, this.value = "", this.ariaDescribedBy = "", this.type = "button", this.onClick = null, this.href = "", this.target = "_self", this._hasPrefixSlot = !1, this._hasSuffixSlot = !1, this._hasCircleSlot = !1;
116
136
  }
@@ -123,25 +143,32 @@ const y = class y extends S {
123
143
  * an id when one is not provided (prefix = the element's localName).
124
144
  */
125
145
  _onPrefixSlotChange(t) {
126
- const e = t.target;
127
- this._hasPrefixSlot = e.assignedElements({ flatten: !0 }).length > 0;
146
+ const n = t.target;
147
+ this._hasPrefixSlot = n.assignedElements({ flatten: !0 }).length > 0;
128
148
  }
129
149
  _onSuffixSlotChange(t) {
130
- const e = t.target;
131
- this._hasSuffixSlot = e.assignedElements({ flatten: !0 }).length > 0;
150
+ const n = t.target;
151
+ this._hasSuffixSlot = n.assignedElements({ flatten: !0 }).length > 0;
132
152
  }
133
153
  _onCircleSlotChange(t) {
134
- const e = t.target;
135
- this._hasCircleSlot = e.assignedElements({ flatten: !0 }).length > 0;
154
+ const n = t.target;
155
+ this._hasCircleSlot = n.assignedElements({ flatten: !0 }).length > 0;
136
156
  }
137
157
  _manageFormAction() {
138
158
  typeof this.onClick == "function" && this.onClick !== null && this.onClick(new Event("click"));
139
159
  const t = this.internals?.form;
140
160
  if (t)
141
161
  switch (this.type) {
142
- case "submit":
143
- t.requestSubmit();
162
+ case "submit": {
163
+ const n = this.name !== "" && this.value !== "";
164
+ n && this.setFormValue(this.value);
165
+ try {
166
+ t.requestSubmit();
167
+ } finally {
168
+ n && this.setFormValue(null);
169
+ }
144
170
  break;
171
+ }
145
172
  case "reset":
146
173
  t.reset();
147
174
  break;
@@ -152,34 +179,28 @@ const y = class y extends S {
152
179
  * --------------------------------------------------------------------------
153
180
  */
154
181
  _handleFocus() {
155
- this.dispatchEvent(
156
- new Event("nys-focus", { bubbles: !0, composed: !0 })
157
- );
182
+ h(this, "focus");
158
183
  }
159
184
  _handleBlur() {
160
- this.shadowRoot?.querySelector(".nys-button")?.classList.remove("active-focus"), this.dispatchEvent(
161
- new Event("nys-blur", { bubbles: !0, composed: !0 })
162
- );
185
+ this.shadowRoot?.querySelector(".nys-button")?.classList.remove("active-focus"), h(this, "blur");
163
186
  }
164
187
  _handleClick(t) {
165
188
  if (this.disabled) {
166
189
  t.preventDefault();
167
190
  return;
168
191
  }
169
- this._manageFormAction(), this.dispatchEvent(
170
- new Event("nys-click", { bubbles: !0, composed: !0 })
171
- );
192
+ this._manageFormAction(), k(this, "nys-click", void 0);
172
193
  }
173
194
  _handleKeydown(t) {
174
195
  if (t.code === "Space" || t.code === "Enter" || t.key === " " || t.key === "Enter") {
175
196
  if (this.disabled) return;
176
197
  t.preventDefault();
177
- const e = this.renderRoot.querySelector(".nys-button");
178
- if (e?.classList.add("active"), setTimeout(() => e?.classList.remove("active"), 150), this.href) {
179
- const i = this.renderRoot.querySelector(
198
+ const n = this.renderRoot.querySelector(".nys-button");
199
+ if (n?.classList.add("active"), setTimeout(() => n?.classList.remove("active"), 150), this.href) {
200
+ const c = this.renderRoot.querySelector(
180
201
  "a.nys-button"
181
202
  );
182
- i && i.click();
203
+ c && c.click();
183
204
  } else
184
205
  this._handleAnyAttributeFunction(), this._handleClick(t);
185
206
  }
@@ -200,14 +221,14 @@ const y = class y extends S {
200
221
  this.click();
201
222
  }
202
223
  focus(t) {
203
- const e = this.renderRoot.querySelector(
224
+ const n = this.renderRoot.querySelector(
204
225
  this.href ? "a.nys-button" : "button.nys-button"
205
226
  );
206
- e ? e.focus(t) : super.focus(t);
227
+ n ? n.focus(t) : super.focus(t);
207
228
  }
208
229
  render() {
209
- return a`
210
- ${this.href ? a`
230
+ return i`
231
+ ${this.href ? i`
211
232
  <div class="nys-button__linkwrapper">
212
233
  <a
213
234
  class="nys-button"
@@ -231,20 +252,20 @@ const y = class y extends S {
231
252
  @slotchange=${this._onPrefixSlotChange}
232
253
  ?hidden=${!this.prefixIcon && !this._hasPrefixSlot}
233
254
  >
234
- ${this.prefixIcon ? a`<nys-icon
255
+ ${this.prefixIcon ? i`<nys-icon
235
256
  size="16"
236
257
  name=${this.prefixIcon}
237
258
  ></nys-icon>` : ""}
238
259
  </slot>
239
- ${this.circle ? a`<div class="nys-button__text sr-only">
260
+ ${this.circle ? i`<div class="nys-button__text sr-only">
240
261
  ${this.label}
241
- </div>` : this.label ? a`<div class="nys-button__text">${this.label}</div>` : a` <slot class="nys-button__default-slot"></slot> `}
262
+ </div>` : this.label ? i`<div class="nys-button__text">${this.label}</div>` : i` <slot class="nys-button__default-slot"></slot> `}
242
263
  <slot
243
264
  name="suffix-icon"
244
265
  @slotchange=${this._onSuffixSlotChange}
245
266
  ?hidden=${!this.suffixIcon && !this._hasSuffixSlot}
246
267
  >
247
- ${this.suffixIcon ? a`<nys-icon
268
+ ${this.suffixIcon ? i`<nys-icon
248
269
  size="16"
249
270
  name=${this.suffixIcon}
250
271
  ></nys-icon>` : ""}
@@ -254,14 +275,14 @@ const y = class y extends S {
254
275
  @slotchange=${this._onCircleSlotChange}
255
276
  ?hidden=${!this.circle || !this.icon && !this._hasCircleSlot}
256
277
  >
257
- ${this.icon ? a`<nys-icon
278
+ ${this.icon ? i`<nys-icon
258
279
  size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
259
280
  name=${this.icon}
260
281
  ></nys-icon>` : ""}
261
282
  </slot>
262
283
  </a>
263
284
  </div>
264
- ` : a`
285
+ ` : i`
265
286
  <button
266
287
  class="nys-button"
267
288
  name=${l(this.name ? this.name : void 0)}
@@ -284,20 +305,20 @@ const y = class y extends S {
284
305
  @slotchange=${this._onPrefixSlotChange}
285
306
  ?hidden=${!this.prefixIcon && !this._hasPrefixSlot}
286
307
  >
287
- ${this.prefixIcon ? a`<nys-icon
308
+ ${this.prefixIcon ? i`<nys-icon
288
309
  size="16"
289
310
  name=${this.prefixIcon}
290
311
  ></nys-icon>` : ""}
291
312
  </slot>
292
- ${this.circle ? a`<div class="nys-button__text sr-only">
313
+ ${this.circle ? i`<div class="nys-button__text sr-only">
293
314
  ${this.label}
294
- </div>` : this.label ? a`<div class="nys-button__text">${this.label}</div>` : a` <slot class="nys-button__default-slot"></slot> `}
315
+ </div>` : this.label ? i`<div class="nys-button__text">${this.label}</div>` : i` <slot class="nys-button__default-slot"></slot> `}
295
316
  <slot
296
317
  name="suffix-icon"
297
318
  @slotchange=${this._onSuffixSlotChange}
298
319
  ?hidden=${!this.suffixIcon && !this._hasSuffixSlot}
299
320
  >
300
- ${this.suffixIcon ? a`<nys-icon
321
+ ${this.suffixIcon ? i`<nys-icon
301
322
  size="16"
302
323
  name=${this.suffixIcon}
303
324
  ></nys-icon>` : ""}
@@ -307,7 +328,7 @@ const y = class y extends S {
307
328
  @slotchange=${this._onCircleSlotChange}
308
329
  ?hidden=${!this.circle || !this.icon && !this._hasCircleSlot}
309
330
  >
310
- ${this.icon ? a`<nys-icon
331
+ ${this.icon ? i`<nys-icon
311
332
  size=${this.size === "sm" ? "24" : this.size === "lg" ? "40" : "32"}
312
333
  name=${this.icon}
313
334
  ></nys-icon>` : ""}
@@ -317,85 +338,85 @@ const y = class y extends S {
317
338
  `;
318
339
  }
319
340
  };
320
- y.styles = _(w), y.shadowRootOptions = {
321
- ...h.shadowRootOptions,
341
+ y.styles = p(I), y.shadowRootOptions = {
342
+ ..._.shadowRootOptions,
322
343
  delegatesFocus: !0
323
344
  };
324
345
  let o = y;
325
346
  r([
326
- n({ type: String, reflect: !0 })
347
+ e({ type: String, reflect: !0 })
327
348
  ], o.prototype, "id");
328
349
  r([
329
- n({ type: String, reflect: !0 })
350
+ e({ type: String, reflect: !0 })
330
351
  ], o.prototype, "name");
331
352
  r([
332
- n({ type: String, reflect: !0 })
353
+ e({ type: String, reflect: !0 })
333
354
  ], o.prototype, "size");
334
355
  r([
335
- n({ type: Boolean, reflect: !0 })
356
+ e({ type: Boolean, reflect: !0 })
336
357
  ], o.prototype, "fullWidth");
337
358
  r([
338
- n({ type: String, reflect: !0 })
359
+ e({ type: String, reflect: !0 })
339
360
  ], o.prototype, "variant");
340
361
  r([
341
- n({ type: Boolean, reflect: !0 })
362
+ e({ type: Boolean, reflect: !0 })
342
363
  ], o.prototype, "inverted");
343
364
  r([
344
- n({ type: String })
365
+ e({ type: String })
345
366
  ], o.prototype, "label");
346
367
  r([
347
- n({ type: String })
368
+ e({ type: String })
348
369
  ], o.prototype, "ariaControls");
349
370
  r([
350
- n({ type: String })
371
+ e({ type: String })
351
372
  ], o.prototype, "ariaExpanded");
352
373
  r([
353
- n({ type: String })
374
+ e({ type: String })
354
375
  ], o.prototype, "ariaCurrent");
355
376
  r([
356
- n({ type: String })
377
+ e({ type: String })
357
378
  ], o.prototype, "prefixIcon");
358
379
  r([
359
- n({ type: String })
380
+ e({ type: String })
360
381
  ], o.prototype, "suffixIcon");
361
382
  r([
362
- n({ type: Boolean, reflect: !0 })
383
+ e({ type: Boolean, reflect: !0 })
363
384
  ], o.prototype, "circle");
364
385
  r([
365
- n({ type: String })
386
+ e({ type: String })
366
387
  ], o.prototype, "icon");
367
388
  r([
368
- n({ type: Boolean, reflect: !0 })
389
+ e({ type: Boolean, reflect: !0 })
369
390
  ], o.prototype, "disabled");
370
391
  r([
371
- n({ type: String, reflect: !0 })
392
+ e({ type: String, reflect: !0 })
372
393
  ], o.prototype, "form");
373
394
  r([
374
- n({ type: String })
395
+ e({ type: String })
375
396
  ], o.prototype, "value");
376
397
  r([
377
- n({ type: String })
398
+ e({ type: String })
378
399
  ], o.prototype, "ariaDescribedBy");
379
400
  r([
380
- n({ type: String, reflect: !0 })
401
+ e({ type: String, reflect: !0 })
381
402
  ], o.prototype, "type");
382
403
  r([
383
- n({ attribute: !1 })
404
+ e({ attribute: !1 })
384
405
  ], o.prototype, "onClick");
385
406
  r([
386
- n({ type: String })
407
+ e({ type: String })
387
408
  ], o.prototype, "href");
388
409
  r([
389
- n({ type: String, reflect: !0 })
410
+ e({ type: String, reflect: !0 })
390
411
  ], o.prototype, "target");
391
412
  r([
392
- d()
413
+ f()
393
414
  ], o.prototype, "_hasPrefixSlot");
394
415
  r([
395
- d()
416
+ f()
396
417
  ], o.prototype, "_hasSuffixSlot");
397
418
  r([
398
- d()
419
+ f()
399
420
  ], o.prototype, "_hasCircleSlot");
400
421
  customElements.get("nys-button") || customElements.define("nys-button", o);
401
422
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"nys-button.js","sources":["../../internals/dist/index.js","../src/nys-button.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.21.0\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nvar y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nvar p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, v = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction A(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction R(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((r) => !!r);\n}\nfunction _(e) {\n return e.map((r) => (r.id || (r.id = f(\"nys-ref\")), r.id));\n}\nfunction V(e, r, a) {\n const t = d(a), n = R(r);\n t.length ? e.setAttribute(n, _(t).join(\" \")) : e.removeAttribute(n);\n}\nfunction x(e, r, a, t, n) {\n const i = d(t), s = p[a], l = r;\n if (s && A(r)) {\n l[s] = i.length ? i : null;\n return;\n }\n const o = v[a];\n if (!o) return;\n const c = n ?? (i.length ? i.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(a === \"labelledby\" ? \"aria-label\" : \"aria-description\", c) : e.removeAttribute(a === \"labelledby\" ? \"aria-label\" : \"aria-description\");\n}\nvar E = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, C = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, r, a) {\n const t = d(a), n = E[r], i = C[r], s = e;\n if (n && n in e && (s[n] = t.length ? t : null), !i) return;\n const l = t.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(i, l) : e.removeAttribute(i);\n}\nvar b = (e) => {\n class r extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return r;\n}, P = /* @__PURE__ */ b(u), h = (e) => {\n class r extends b(e) {\n constructor(...t) {\n super(...t), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\") try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(t, n) {\n const i = this.internals;\n if (i && t in i) {\n i[t] = n;\n return;\n }\n const s = g(t);\n n === null ? this.removeAttribute(s) : this.setAttribute(s, n);\n }\n reflectDefaultSemantics() {\n const t = this.defaultRole;\n t && this.setHostAria(\"role\", t);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return r;\n};\nfunction g(e) {\n if (e === \"role\") return \"role\";\n const r = e.replace(/^aria/, \"\");\n return \"aria-\" + r.charAt(0).toLowerCase() + r.slice(1);\n}\nvar T = /* @__PURE__ */ h(u), I = (e) => {\n class r extends h(e) {\n static {\n this.formAssociated = !0;\n }\n setFormValue(t) {\n this.internals?.setFormValue(t ?? null);\n }\n setValidityFromState(t, n, i) {\n const s = this.internals;\n if (!s) return;\n const l = Object.values(t).some(Boolean);\n l ? s.setValidity(t, n ?? \"Invalid value\", i) : s.setValidity({}), this.setHostAria(\"ariaInvalid\", l ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.clearValidity();\n }\n }\n return r;\n}, w = /* @__PURE__ */ I(u);\nfunction O(e) {\n const r = e.tagName.toLowerCase(), a = /* @__PURE__ */ new Set(), t = (n) => {\n n.querySelectorAll(\"*\").forEach((i) => {\n const s = i.tagName.toLowerCase();\n s.startsWith(\"nys-\") && s !== r && !customElements.get(s) && a.add(s), i.shadowRoot && t(i.shadowRoot);\n });\n };\n return e.shadowRoot && t(e.shadowRoot), t(e), [...a].sort();\n}\nexport {\n I as FormControlMixin,\n b as IdentifiedMixin,\n P as NysElement,\n w as NysFormControlElement,\n T as NysReflectsAriaElement,\n h as ReflectsAriaMixin,\n V as associateControl,\n L as associateControlRefs,\n x as associateHost,\n O as findUnregisteredChildren,\n f as generateId,\n A as supportsElementRefs\n};\n\n//# sourceMappingURL=index.js.map","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { NysFormControlElement } from \"@nysds/internals\";\n// This element is rendered inside this component's shadow DOM as the default\n// prefix/suffix/circle icon content, so it must be registered whenever\n// nys-button is used. Importing it here (intentional side effect) guarantees\n// it always renders.\nimport \"@nysds/nys-icon\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-button.scss?inline\";\n\n/**\n * A button for actions like saving, submitting, or navigating. Form-associated with full keyboard support.\n *\n * Use `filled` for primary actions (one per section), `outline` for secondary, `ghost` for tertiary,\n * `text` for inline. Set `href` to render as a navigation link.\n *\n * ARIA belongs on the component's props, not on the `<nys-button>` host. The host has no role,\n * so attributes placed there are not mapped into the accessibility tree and never reach the\n * internal `<button>`. For a disclosure trigger use `ariaExpanded` together with `ariaControls`.\n *\n * @summary Button for actions and CTAs with variants, sizes, and icon support.\n * @element nys-button\n *\n * @slot - Button label text. Use as fallback when `label` prop is not provided.\n * @slot prefix-icon - Icon before label. Not shown for `text` variant.\n * @slot suffix-icon - Icon after label. Not shown for `text` variant.\n * @slot circle-icon - Icon for circle mode. Overrides `icon` prop.\n *\n * @cssprop [--nys-button-color] - Text color of the button label.\n * @cssprop [--nys-button-color--hover] - Text color when hovered.\n * @cssprop [--nys-button-color--active] - Text color when active/pressed.\n * @cssprop [--nys-button-background-color] - Background color of the button.\n * @cssprop [--nys-button-background-color--hover] - Background color when hovered.\n * @cssprop [--nys-button-background-color--active] - Background color when active/pressed.\n * @cssprop [--nys-button-border-color] - Border color of the button.\n * @cssprop [--nys-button-border-color--hover] - Border color when hovered.\n * @cssprop [--nys-button-border-color--active] - Border color when active/pressed.\n *\n * @fires nys-click - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.\n * @fires nys-focus - Fired when the button receives focus.\n * @fires nys-blur - Fired when the button loses focus.\n *\n * @example Basic\n * ```html\n * <nys-button label=\"Button\" variant=\"filled\"></nys-button>\n * ```\n *\n * @example Variant Outline\n * ```html\n * <nys-button label=\"Button\" variant=\"outline\"></nys-button>\n * ```\n *\n * @example Variant Ghost\n * ```html\n * <nys-button label=\"Button\" variant=\"ghost\"></nys-button>\n * ```\n *\n * @example Variant Text\n * ```html\n * <nys-button label=\"Button\" variant=\"text\"></nys-button>\n * ```\n *\n * @example Prefix Icon\n * ```html\n * <nys-button label=\"Previous\" prefixIcon=\"chevron_left\"></nys-button>\n * ```\n *\n * @example Suffix Icon\n * ```html\n * <nys-button label=\"Next\" suffixIcon=\"chevron_right\"></nys-button>\n * ```\n *\n * @example Slotted Icons\n * ```html\n * <nys-button label=\"Slotted icons\">\n * <nys-icon color=\"#db117d\" slot=\"prefix-icon\" name=\"chevron_left\"></nys-icon>\n * <nys-icon color=\"#db117d\" slot=\"suffix-icon\" name=\"chevron_right\"></nys-icon>\n * </nys-button>\n * ```\n *\n * @example Circle icon button\n * ```html\n * <nys-button circle icon=\"close\" label=\"Close dialog\"></nys-button>\n * ```\n *\n * @example Size Small\n * ```html\n * <nys-button label=\"Small\" size=\"sm\"></nys-button>\n * ```\n * @example Size Large\n * ```html\n * <nys-button label=\"Large\" size=\"lg\"></nys-button>\n * ```\n *\n * @example Full width\n * ```html\n * <nys-button label=\"Full width\" fullWidth></nys-button>\n * ```\n *\n * @example Inverted\n * ```html\n * <nys-button label=\"Inverted\" inverted></nys-button>\n * ```\n * @render Inverted\n * ```html\n * <div style=\"background: #1b1b1b; padding: 1rem;\">\n * <nys-button label=\"Inverted\" inverted></nys-button>\n * </div>\n * ```\n *\n * @example Disabled\n * ```html\n * <nys-button label=\"Disabled\" disabled></nys-button>\n * ```\n *\n * @example Href\n * ```html\n * <nys-button label=\"Visit NY.gov\" href=\"https://www.ny.gov/\" target=\"_blank\" suffixIcon=\"open_in_new\"></nys-button>\n * ```\n *\n * @example Type\n * ```html\n * <nys-button type=\"submit\" label=\"Save Changes\" variant=\"filled\"></nys-button>\n * ```\n *\n * @example Disclosure trigger\n * ```html\n * <nys-button\n * label=\"Here's how you know\"\n * ariaExpanded=\"false\"\n * ariaControls=\"trust-bar\"\n * ></nys-button>\n * ```\n */\n\nexport class NysButton extends NysFormControlElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Unique identifier. Auto-generated if not provided.\n */\n @property({ type: String, reflect: true }) id = \"\";\n\n /**\n * Name for form submission.\n */\n @property({ type: String, reflect: true }) name = \"\";\n\n /**\n * Button height: `sm` (40px) for dense UIs, `md` (48px, default) for standard use, `lg` (56px) for prominent CTAs.\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\n /**\n * Expands button to fill container width. Use for mobile layouts or stacked button groups.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) fullWidth = false;\n\n /**\n * Visual style: `filled` for primary (one per section), `outline` for secondary, `ghost` for tertiary, `text` for inline actions. Avoid `text` for navigation.\n * @default \"filled\"\n */\n @property({ type: String, reflect: true }) variant:\n | \"filled\"\n | \"outline\"\n | \"ghost\"\n | \"text\" = \"filled\";\n\n /**\n * Adjusts colors for dark backgrounds.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) inverted = false;\n\n /**\n * Visible button text. Use sentence case, action-oriented text (e.g., \"Save Draft\"). In `circle` mode it is visually hidden but still exposed to assistive tech as the accessible name.\n */\n @property({ type: String }) label = \"\";\n\n /**\n * ID of controlled element (e.g., dropdown or modal). Sets `aria-controls`.\n *\n * Set this on `<nys-button>` rather than putting `aria-controls` on the host:\n * the host has no role, so ARIA placed there is not mapped into the\n * accessibility tree and never reaches the internal `<button>`.\n */\n @property({ type: String }) ariaControls = \"\";\n\n /**\n * Disclosure state for buttons that show/hide content. Sets `aria-expanded`\n * on the internal `<button>`/`<a>`.\n *\n * Use `\"false\"` when the controlled content is collapsed and `\"true\"` when it\n * is expanded, updating it every time the content toggles. Leave unset for\n * buttons that are not disclosure triggers — an `aria-expanded` that never\n * changes is worse than none. Pair with `ariaControls` pointing at the\n * element being shown or hidden.\n *\n * Setting `aria-expanded` directly on the `<nys-button>` host does nothing:\n * a custom element with no role does not map its ARIA attributes into the\n * accessibility tree, and host ARIA does not cross into the shadow root.\n *\n * @example\n * ```html\n * <nys-button\n * label=\"Here's how you know\"\n * ariaExpanded=\"false\"\n * ariaControls=\"trust-bar\"\n * ></nys-button>\n * ```\n */\n @property({ type: String }) ariaExpanded: \"true\" | \"false\" | \"\" = \"\";\n\n /**\n * Marks this button as the current item within a set of related controls — the current\n * page of a pagination control, the current step of a wizard. Sets `aria-current` on the\n * internal `<button>`/`<a>`.\n *\n * Use `\"page\"` inside a pagination landmark, `\"step\"` inside a step indicator, and\n * `\"true\"` when no more specific token fits. Only one control in a set is ever current:\n * leave the property unset on all the others rather than setting `\"false\"`, which the\n * spec reads as \"explicitly not current\" and adds nothing.\n *\n * Setting `aria-current` directly on the `<nys-button>` host does nothing: a custom\n * element with no role does not map its ARIA attributes into the accessibility tree,\n * and host ARIA does not cross into the shadow root.\n *\n * @example\n * ```html\n * <nys-button label=\"3\" ariaCurrent=\"page\"></nys-button>\n * ```\n */\n @property({ type: String }) ariaCurrent:\n | \"page\"\n | \"step\"\n | \"location\"\n | \"date\"\n | \"time\"\n | \"true\"\n | \"false\"\n | \"\" = \"\";\n\n /**\n * Material Symbol icon before label. Not shown for `circle` mode.\n */\n @property({ type: String }) prefixIcon = \"\";\n\n /**\n * Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode.\n */\n @property({ type: String }) suffixIcon = \"\";\n\n /**\n * Renders circular icon-only button. Requires `icon` prop. `label` is rendered as visually-hidden text for the accessible name.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) circle = false;\n\n /**\n * Icon for circle mode. Required when `circle` is true. Scales with size (sm=24px, md=32px, lg=40px).\n */\n @property({ type: String }) icon = \"\";\n\n /**\n * Prevents interaction. Avoid disabling without explanation—show validation errors instead.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Form `id` to associate with. Use when button is outside the form element.\n */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /**\n * Value submitted with form data. Only used when `type=\"submit\"`.\n */\n @property({ type: String }) value = \"\";\n\n /**\n * ID(s) of element(s) describing this button. Sets `aria-describedby`.\n */\n @property({ type: String }) ariaDescribedBy = \"\";\n\n /**\n * Form behavior: `button` (default, no form action), `submit` (submits form), `reset` (resets form). Always set explicitly to avoid unintended submissions.\n * @default \"button\"\n */\n @property({ type: String, reflect: true }) type:\n | \"submit\"\n | \"reset\"\n | \"button\" = \"button\";\n\n /**\n * Click handler. Use instead of `@click` to ensure keyboard accessibility.\n */\n @property({ attribute: false }) onClick: ((event: Event) => void) | null =\n null;\n\n /**\n * URL to navigate to. Renders as `<a>` tag. Omit for action buttons.\n */\n @property({ type: String }) href = \"\";\n\n /**\n * Link target: `_self` (same tab), `_blank` (new tab—add `suffixIcon=\"open_in_new\"`), `_parent`, `_top`, or frame name.\n * @default \"_self\"\n */\n @property({ type: String, reflect: true }) target:\n | \"_self\"\n | \"_blank\"\n | \"_parent\"\n | \"_top\"\n | \"framename\" = \"_self\";\n\n @state() private _hasPrefixSlot = false;\n @state() private _hasSuffixSlot = false;\n @state() private _hasCircleSlot = false;\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n *\n * Form association, ElementInternals, and id generation are provided by\n * NysFormControlElement (@nysds/internals). super.connectedCallback() assigns\n * an id when one is not provided (prefix = the element's localName).\n */\n\n private _onPrefixSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n this._hasPrefixSlot = slot.assignedElements({ flatten: true }).length > 0;\n }\n\n private _onSuffixSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n this._hasSuffixSlot = slot.assignedElements({ flatten: true }).length > 0;\n }\n\n private _onCircleSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n this._hasCircleSlot = slot.assignedElements({ flatten: true }).length > 0;\n }\n\n private _manageFormAction() {\n // If an onClick function is provided, call it\n if (typeof this.onClick === \"function\" && this.onClick !== null) {\n this.onClick(new Event(\"click\")); // Call user-provided onClick function with a fake click event\n }\n\n // If part of a form, perform the corresponding action based on button's \"type\"\n const form = this.internals?.form;\n\n if (form) {\n switch (this.type) {\n case \"submit\":\n form.requestSubmit();\n break;\n case \"reset\":\n form.reset();\n break;\n case \"button\":\n }\n }\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n private _handleFocus() {\n this.dispatchEvent(\n new Event(\"nys-focus\", { bubbles: true, composed: true }),\n );\n }\n\n private _handleBlur() {\n const button = this.shadowRoot?.querySelector(\".nys-button\");\n button?.classList.remove(\"active-focus\");\n this.dispatchEvent(\n new Event(\"nys-blur\", { bubbles: true, composed: true }),\n );\n }\n\n private _handleClick(event: Event) {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n this._manageFormAction();\n this.dispatchEvent(\n new Event(\"nys-click\", { bubbles: true, composed: true }),\n );\n }\n\n private _handleKeydown(e: KeyboardEvent) {\n if (\n e.code === \"Space\" ||\n e.code === \"Enter\" ||\n e.key === \" \" ||\n e.key === \"Enter\"\n ) {\n if (this.disabled) return;\n\n e.preventDefault();\n const btn = this.renderRoot.querySelector(\".nys-button\");\n btn?.classList.add(\"active\");\n setTimeout(() => btn?.classList.remove(\"active\"), 150);\n\n if (this.href) {\n // Click the internal <a> so native navigation happens\n const linkEl = this.renderRoot.querySelector(\n \"a.nys-button\",\n ) as HTMLAnchorElement;\n if (linkEl) {\n linkEl.click();\n }\n } else {\n this._handleAnyAttributeFunction();\n this._handleClick(e);\n }\n }\n }\n\n private _handleKeyup(e: KeyboardEvent) {\n if (\n e.code === \"Space\" ||\n e.code === \"Enter\" ||\n e.key === \" \" ||\n e.key === \"Enter\"\n ) {\n this.renderRoot.querySelector(\".nys-button\")?.classList.remove(\"active\");\n }\n }\n\n /**\n * Handles inline onclick attributes for keyboard activation.\n *\n * Native clicks execute inline onclick attributes automatically, but\n * keyboard activation of the custom element does not trigger that native\n * behavior. Dispatching a synthetic click lets the browser's own inline\n * event handler mechanism execute any onclick attribute safely without\n * eval() or new Function().\n */\n private _handleAnyAttributeFunction() {\n this.click();\n }\n\n public focus(options?: FocusOptions) {\n const innerEl = this.renderRoot.querySelector(\n this.href ? \"a.nys-button\" : \"button.nys-button\",\n ) as HTMLElement | null;\n\n if (innerEl) {\n innerEl.focus(options);\n } else {\n // fallback: focus host\n super.focus(options);\n }\n }\n\n render() {\n return html`\n ${this.href\n ? html`\n <div class=\"nys-button__linkwrapper\">\n <a\n class=\"nys-button\"\n name=${ifDefined(this.name ? this.name : undefined)}\n ?disabled=${this.disabled}\n aria-disabled=\"${this.disabled ? \"true\" : \"false\"}\"\n value=${ifDefined(this.value ? this.value : undefined)}\n href=${this.href}\n target=${this.target}\n @click=${this._handleClick}\n @focus=\"${this._handleFocus}\"\n @blur=\"${this._handleBlur}\"\n @keydown=\"${this._handleKeydown}\"\n @keyup=\"${this._handleKeyup}\"\n aria-describedby=${ifDefined(this.ariaDescribedBy || undefined)}\n aria-expanded=${ifDefined(this.ariaExpanded || undefined)}\n aria-current=${ifDefined(this.ariaCurrent || undefined)}\n >\n <slot\n name=\"prefix-icon\"\n @slotchange=${this._onPrefixSlotChange}\n ?hidden=${!this.prefixIcon && !this._hasPrefixSlot}\n >\n ${this.prefixIcon\n ? html`<nys-icon\n size=\"16\"\n name=${this.prefixIcon}\n ></nys-icon>`\n : \"\"}\n </slot>\n ${this.circle\n ? html`<div class=\"nys-button__text sr-only\">\n ${this.label}\n </div>`\n : this.label\n ? html`<div class=\"nys-button__text\">${this.label}</div>`\n : html` <slot class=\"nys-button__default-slot\"></slot> `}\n <slot\n name=\"suffix-icon\"\n @slotchange=${this._onSuffixSlotChange}\n ?hidden=${!this.suffixIcon && !this._hasSuffixSlot}\n >\n ${this.suffixIcon\n ? html`<nys-icon\n size=\"16\"\n name=${this.suffixIcon}\n ></nys-icon>`\n : \"\"}\n </slot>\n <slot\n name=\"circle-icon\"\n @slotchange=${this._onCircleSlotChange}\n ?hidden=${!this.circle ||\n (!this.icon && !this._hasCircleSlot)}\n >\n ${this.icon\n ? html`<nys-icon\n size=${this.size === \"sm\"\n ? \"24\"\n : this.size === \"lg\"\n ? \"40\"\n : \"32\"}\n name=${this.icon}\n ></nys-icon>`\n : \"\"}\n </slot>\n </a>\n </div>\n `\n : html`\n <button\n class=\"nys-button\"\n name=${ifDefined(this.name ? this.name : undefined)}\n ?disabled=${this.disabled}\n form=${ifDefined(this.form || undefined)}\n value=${ifDefined(this.value ? this.value : undefined)}\n type=${this.type}\n aria-controls=${ifDefined(this.ariaControls || undefined)}\n @click=${this._handleClick}\n @focus=${this._handleFocus}\n @blur=${this._handleBlur}\n @keydown=${this._handleKeydown}\n @keyup=${this._handleKeyup}\n aria-describedby=${ifDefined(this.ariaDescribedBy || undefined)}\n aria-expanded=${ifDefined(this.ariaExpanded || undefined)}\n aria-current=${ifDefined(this.ariaCurrent || undefined)}\n >\n <slot\n name=\"prefix-icon\"\n @slotchange=${this._onPrefixSlotChange}\n ?hidden=${!this.prefixIcon && !this._hasPrefixSlot}\n >\n ${this.prefixIcon\n ? html`<nys-icon\n size=\"16\"\n name=${this.prefixIcon}\n ></nys-icon>`\n : \"\"}\n </slot>\n ${this.circle\n ? html`<div class=\"nys-button__text sr-only\">\n ${this.label}\n </div>`\n : this.label\n ? html`<div class=\"nys-button__text\">${this.label}</div>`\n : html` <slot class=\"nys-button__default-slot\"></slot> `}\n <slot\n name=\"suffix-icon\"\n @slotchange=${this._onSuffixSlotChange}\n ?hidden=${!this.suffixIcon && !this._hasSuffixSlot}\n >\n ${this.suffixIcon\n ? html`<nys-icon\n size=\"16\"\n name=${this.suffixIcon}\n ></nys-icon>`\n : \"\"}\n </slot>\n <slot\n name=\"circle-icon\"\n @slotchange=${this._onCircleSlotChange}\n ?hidden=${!this.circle || (!this.icon && !this._hasCircleSlot)}\n >\n ${this.icon\n ? html`<nys-icon\n size=${this.size === \"sm\"\n ? \"24\"\n : this.size === \"lg\"\n ? \"40\"\n : \"32\"}\n name=${this.icon}\n ></nys-icon>`\n : \"\"}\n </slot>\n </button>\n `}\n `;\n }\n}\n\nif (!customElements.get(\"nys-button\")) {\n customElements.define(\"nys-button\", NysButton);\n}\n"],"names":["LitElement","unsafeCSS","html","property","state","ifDefined","y","f","e","b","r","h","t","n","i","s","g","I","_r","l","w","u","_NysButton","NysFormControlElement","slot","form","event","btn","linkEl","options","innerEl","styles","NysButton","__decorateClass"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,GAAA,SAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF,GAAG;AAClC;AAgDG,IAACG,IAAI,CAACD,MAAM;AAAA,EACb,MAAME,UAAUF,EAAE;AAAA,IAChB,IAAI,WAAW;AACb,aAAO,KAAK,aAAa;AAAA,IAC3B;AAAA,IACA,WAAW;AACT,WAAK,OAAO,KAAK,KAAKD,EAAE,KAAK,QAAQ;AAAA,IACvC;AAAA,IACA,oBAAoB;AAClB,YAAM,kBAAiB,GAAI,KAAK,SAAQ;AAAA,IAC1C;AAAA,EACJ;AACE,SAAOG;AACT,GAA6BC,IAAI,CAACH,MAAM;AAAA,EACtC,MAAME,UAAUD,EAAED,CAAC,EAAE;AAAA,IACnB,eAAeI,GAAG;AAChB,YAAM,GAAGA,CAAC,GAAG,KAAK,cAAc;AAAA,IAClC;AAAA,IACA,IAAI,YAAY;AACd,UAAI,KAAK,YAAa,QAAO,KAAK;AAClC,UAAI,OAAO,KAAK,mBAAmB,WAAY,KAAI;AACjD,aAAK,cAAc,KAAK,gBAAe;AAAA,MACzC,QAAQ;AACN,aAAK,cAAc;AAAA,MACrB;AACA,aAAO,KAAK;AAAA,IACd;AAAA,IACA,IAAI,cAAc;AAChB,aAAO;AAAA,IACT;AAAA,IACA,YAAYA,GAAGC,GA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,SAAS,IAAM;AAAA,GA/I9B6B,EA+IgC,WAAA,MAAA;AAKfC,EAAA;AAAA,EAA3B9B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GApJf6B,EAoJiB,WAAA,OAAA;AAKAC,EAAA;AAAA,EAA3B9B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAzJf6B,EAyJiB,WAAA,iBAAA;AAMeC,EAAA;AAAA,EAA1C9B,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA/J9B6B,EA+JgC,WAAA,MAAA;AAQXC,EAAA;AAAA,EAA/B9B,EAAS,EAAE,WAAW,GAAA,CAAO;AAAA,GAvKnB6B,EAuKqB,WAAA,SAAA;AAMJC,EAAA;AAAA,EAA3B9B,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA7Kf6B,EA6KiB,WAAA,MAAA;AAMeC,EAAA;AAAA,EAA1C9B,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAnL9B6B,EAmLgC,WAAA,QAAA;AAO1BC,EAAA;AAAA,EAAhB7B,EAAA;AAAM,GA1LI4B,EA0LM,WAAA,gBAAA;AACAC,EAAA;AAAA,EAAhB7B,EAAA;AAAM,GA3LI4B,EA2LM,WAAA,gBAAA;AACAC,EAAA;AAAA,EAAhB7B,EAAA;AAAM,GA5LI4B,EA4LM,WAAA,gBAAA;AAgSd,eAAe,IAAI,YAAY,KAClC,eAAe,OAAO,cAAcA,CAAS;"}
1
+ {"version":3,"file":"nys-button.js","sources":["../../internals/dist/index.js","../src/nys-button.ts"],"sourcesContent":["import { LitElement as u } from \"lit\";\n/*!\n * New York State Design System v1.22.0\n * Description: A design system for New York State's digital products.\n * Repository: https://github.com/its-hcd/nysds\n * License: MIT\n */\nlet y = 0;\nfunction f(e) {\n return `${e}-${Date.now()}-${y++}`;\n}\nfunction N(e, t, s) {\n e.dispatchEvent(\n new CustomEvent(t, { detail: s, bubbles: !0, composed: !0 })\n );\n}\nfunction I(e, t) {\n e.dispatchEvent(\n new Event(`nys-${t}`, { bubbles: !0, composed: !0 })\n );\n}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, g = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction _(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction E(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction A(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction w(e, t, s) {\n const n = d(s), i = E(t);\n n.length ? e.setAttribute(i, A(n).join(\" \")) : e.removeAttribute(i);\n}\nfunction x(e, t, s, n, i) {\n const r = d(n), a = p[s], l = t;\n if (a && _(t)) {\n l[a] = r.length ? r : null;\n return;\n }\n const o = g[s];\n if (!o) return;\n const c = i ?? (r.length ? r.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n s === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n s === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst R = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, V = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, s) {\n const n = d(s), i = R[t], r = V[t], a = e;\n if (i && i in e && (a[i] = n.length ? n : null), !r) return;\n const l = n.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(r, l) : e.removeAttribute(r);\n}\nconst h = (e) => {\n class t extends e {\n get idPrefix() {\n return this.localName || \"nys-element\";\n }\n ensureId() {\n this.id || (this.id = f(this.idPrefix));\n }\n connectedCallback() {\n super.connectedCallback(), this.ensureId();\n }\n }\n return t;\n}, P = /* @__PURE__ */ h(u), b = (e) => {\n class t extends h(e) {\n constructor() {\n super(...arguments), this.__internals = null;\n }\n get internals() {\n if (this.__internals) return this.__internals;\n if (typeof this.attachInternals == \"function\")\n try {\n this.__internals = this.attachInternals();\n } catch {\n this.__internals = null;\n }\n return this.__internals;\n }\n get defaultRole() {\n return null;\n }\n setHostAria(n, i) {\n const r = this.internals;\n if (r && n in r) {\n r[n] = i;\n return;\n }\n const a = v(n);\n i === null ? this.removeAttribute(a) : this.setAttribute(a, i);\n }\n reflectDefaultSemantics() {\n const n = this.defaultRole;\n n && this.setHostAria(\"role\", n);\n }\n connectedCallback() {\n super.connectedCallback(), this.reflectDefaultSemantics();\n }\n }\n return t;\n};\nfunction v(e) {\n if (e === \"role\") return \"role\";\n const t = e.replace(/^aria/, \"\");\n return \"aria-\" + t.charAt(0).toLowerCase() + t.slice(1);\n}\nconst T = /* @__PURE__ */ b(u), C = (e) => {\n const s = class s extends b(e) {\n constructor() {\n super(...arguments), this.__internalValidationMessage = \"\";\n }\n get internalValidationMessage() {\n return this.__internalValidationMessage;\n }\n set internalValidationMessage(i) {\n i !== this.__internalValidationMessage && (this.__internalValidationMessage = i, this.requestUpdate(\"internalValidationMessage\"));\n }\n resolvedErrorMessage() {\n return this.errorMessage || this.internalValidationMessage;\n }\n setFormValue(i) {\n this.internals?.setFormValue(i ?? null);\n }\n setValidityFromState(i, r, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(i).some(Boolean);\n o ? l.setValidity(i, r ?? \"Invalid value\", a) : l.setValidity({}), this.setHostAria(\"ariaInvalid\", o ? \"true\" : \"false\");\n }\n clearValidity() {\n this.internals?.setValidity({}), this.setHostAria(\"ariaInvalid\", \"false\");\n }\n checkValidity() {\n return this.internals?.checkValidity() ?? !0;\n }\n reportValidity() {\n return this.internals?.reportValidity() ?? !0;\n }\n formResetCallback() {\n this.internalValidationMessage = \"\", this.clearValidity();\n }\n };\n s.formAssociated = !0;\n let t = s;\n return t;\n}, O = /* @__PURE__ */ C(u);\nfunction B(e) {\n const t = e.tagName.toLowerCase(), s = /* @__PURE__ */ new Set(), n = (i) => {\n i.querySelectorAll(\"*\").forEach((r) => {\n const a = r.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && s.add(a), r.shadowRoot && n(r.shadowRoot);\n });\n };\n return e.shadowRoot && n(e.shadowRoot), n(e), [...s].sort();\n}\nexport {\n C as FormControlMixin,\n h as IdentifiedMixin,\n P as NysElement,\n O as NysFormControlElement,\n T as NysReflectsAriaElement,\n b as ReflectsAriaMixin,\n w as associateControl,\n L as associateControlRefs,\n x as associateHost,\n N as dispatchNysEvent,\n I as dispatchNysFocusBlur,\n B as findUnregisteredChildren,\n f as generateId,\n _ as supportsElementRefs\n};\n//# sourceMappingURL=index.js.map\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport {\n NysFormControlElement,\n dispatchNysEvent,\n dispatchNysFocusBlur,\n} from \"@nysds/internals\";\n// This element is rendered inside this component's shadow DOM as the default\n// prefix/suffix/circle icon content, so it must be registered whenever\n// nys-button is used. Importing it here (intentional side effect) guarantees\n// it always renders.\nimport \"@nysds/nys-icon\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-button.scss?inline\";\n\n/**\n * A button for actions like saving, submitting, or navigating. Form-associated with full keyboard support.\n *\n * Use `filled` for primary actions (one per section), `outline` for secondary, `ghost` for tertiary,\n * `text` for inline. Set `href` to render as a navigation link.\n *\n * ARIA belongs on the component's props, not on the `<nys-button>` host. The host has no role,\n * so attributes placed there are not mapped into the accessibility tree and never reach the\n * internal `<button>`. For a disclosure trigger use `ariaExpanded` together with `ariaControls`.\n *\n * @summary Button for actions and CTAs with variants, sizes, and icon support.\n * @element nys-button\n *\n * @slot - Button label text. Use as fallback when `label` prop is not provided.\n * @slot prefix-icon - Icon before label. Not shown for `text` variant.\n * @slot suffix-icon - Icon after label. Not shown for `text` variant.\n * @slot circle-icon - Icon for circle mode. Overrides `icon` prop.\n *\n * @cssprop [--nys-button-color] - Text color of the button label.\n * @cssprop [--nys-button-color--hover] - Text color when hovered.\n * @cssprop [--nys-button-color--active] - Text color when active/pressed.\n * @cssprop [--nys-button-background-color] - Background color of the button.\n * @cssprop [--nys-button-background-color--hover] - Background color when hovered.\n * @cssprop [--nys-button-background-color--active] - Background color when active/pressed.\n * @cssprop [--nys-button-border-color] - Border color of the button.\n * @cssprop [--nys-button-border-color--hover] - Border color when hovered.\n * @cssprop [--nys-button-border-color--active] - Border color when active/pressed.\n *\n * @fires {Event} nys-click - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.\n * @fires {Event} nys-focus - Fired when the button receives focus.\n * @fires {Event} nys-blur - Fired when the button loses focus.\n *\n * @usagedos\n * - Use for the most important actions you want users to take, such as \"Download\", \"Sign up\", or \"Log out\".\n * - Use `variant=\"fill\"` for the primary action on the page. There should be only one primary action per page.\n * - Use `variant=\"outline\"` for secondary actions, placed next to the primary Fill button.\n * - Use `variant=\"ghost\"` buttons for additional actions beyond primary and secondary.\n * - Use `variant=\"text\"` buttons when an action needs to appear within a text block. If clicking takes the user somewhere else, use a Link instead.\n * - Always set the `type` attribute (`submit`, `button`, or `reset`). The default is `button`.\n * - Use sentence case for button labels, only capitalizing the first word.\n * - Place a `chevron_down icon` on the right for buttons that open a dropdown.\n *\n * @usagedonts\n * - Use buttons for navigation. Use an `<a>` element or Text button for links that take users somewhere else.\n * - Use icons in buttons without a text label. Very few icons are universally understood.\n * - Create custom button styles (color, shape, size). Consistency helps users recognize buttons and predict behavior.\n *\n * @example Basic\n * ```html\n * <nys-button label=\"Button\" variant=\"filled\"></nys-button>\n * ```\n *\n * @example Variant Outline\n * ```html\n * <nys-button label=\"Button\" variant=\"outline\"></nys-button>\n * ```\n *\n * @example Variant Ghost\n * ```html\n * <nys-button label=\"Button\" variant=\"ghost\"></nys-button>\n * ```\n *\n * @example Variant Text\n * ```html\n * <nys-button label=\"Button\" variant=\"text\"></nys-button>\n * ```\n *\n * @example Prefix Icon\n * ```html\n * <nys-button label=\"Previous\" prefixIcon=\"chevron_left\"></nys-button>\n * ```\n *\n * @example Suffix Icon\n * ```html\n * <nys-button label=\"Next\" suffixIcon=\"chevron_right\"></nys-button>\n * ```\n *\n * @example Slotted Icons\n * ```html\n * <nys-button label=\"Slotted icons\">\n * <nys-icon color=\"#db117d\" slot=\"prefix-icon\" name=\"chevron_left\"></nys-icon>\n * <nys-icon color=\"#db117d\" slot=\"suffix-icon\" name=\"chevron_right\"></nys-icon>\n * </nys-button>\n * ```\n *\n * @example Circle icon button\n * ```html\n * <nys-button circle icon=\"close\" label=\"Close dialog\"></nys-button>\n * ```\n *\n * @example Size Small\n * ```html\n * <nys-button label=\"Small\" size=\"sm\"></nys-button>\n * ```\n * @example Size Large\n * ```html\n * <nys-button label=\"Large\" size=\"lg\"></nys-button>\n * ```\n *\n * @example Full width\n * ```html\n * <nys-button label=\"Full width\" fullWidth></nys-button>\n * ```\n *\n * @example Inverted\n * ```html\n * <nys-button label=\"Inverted\" inverted></nys-button>\n * ```\n * @render Inverted\n * ```html\n * <div style=\"background: #1b1b1b; padding: 1rem;\">\n * <nys-button label=\"Inverted\" inverted></nys-button>\n * </div>\n * ```\n *\n * @example Disabled\n * ```html\n * <nys-button label=\"Disabled\" disabled></nys-button>\n * ```\n *\n * @example Href\n * ```html\n * <nys-button label=\"Visit NY.gov\" href=\"https://www.ny.gov/\" target=\"_blank\" suffixIcon=\"open_in_new\"></nys-button>\n * ```\n *\n * @example Type\n * ```html\n * <nys-button type=\"submit\" label=\"Save Changes\" variant=\"filled\"></nys-button>\n * ```\n *\n * @example Disclosure trigger\n * ```html\n * <nys-button\n * label=\"Here's how you know\"\n * ariaExpanded=\"false\"\n * ariaControls=\"trust-bar\"\n * ></nys-button>\n * ```\n */\n\nexport class NysButton extends NysFormControlElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Unique identifier. Auto-generated if not provided.\n */\n @property({ type: String, reflect: true }) id = \"\";\n\n /**\n * Name for form submission.\n */\n @property({ type: String, reflect: true }) name = \"\";\n\n /**\n * Button height: `sm` (40px) for dense UIs, `md` (48px, default) for standard use, `lg` (56px) for prominent CTAs.\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\n /**\n * Expands button to fill container width. Use for mobile layouts or stacked button groups.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) fullWidth = false;\n\n /**\n * Visual style: `filled` for primary (one per section), `outline` for secondary, `ghost` for tertiary, `text` for inline actions. Avoid `text` for navigation.\n * @default \"filled\"\n */\n @property({ type: String, reflect: true }) variant:\n | \"filled\"\n | \"outline\"\n | \"ghost\"\n | \"text\" = \"filled\";\n\n /**\n * Adjusts colors for dark backgrounds.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) inverted = false;\n\n /**\n * Visible button text. Use sentence case, action-oriented text (e.g., \"Save Draft\"). In `circle` mode it is visually hidden but still exposed to assistive tech as the accessible name.\n */\n @property({ type: String }) label = \"\";\n\n /**\n * ID of controlled element (e.g., dropdown or modal). Sets `aria-controls`.\n *\n * Set this on `<nys-button>` rather than putting `aria-controls` on the host:\n * the host has no role, so ARIA placed there is not mapped into the\n * accessibility tree and never reaches the internal `<button>`.\n */\n @property({ type: String }) ariaControls = \"\";\n\n /**\n * Disclosure state for buttons that show/hide content. Sets `aria-expanded`\n * on the internal `<button>`/`<a>`.\n *\n * Use `\"false\"` when the controlled content is collapsed and `\"true\"` when it\n * is expanded, updating it every time the content toggles. Leave unset for\n * buttons that are not disclosure triggers — an `aria-expanded` that never\n * changes is worse than none. Pair with `ariaControls` pointing at the\n * element being shown or hidden.\n *\n * Setting `aria-expanded` directly on the `<nys-button>` host does nothing:\n * a custom element with no role does not map its ARIA attributes into the\n * accessibility tree, and host ARIA does not cross into the shadow root.\n *\n * @example\n * ```html\n * <nys-button\n * label=\"Here's how you know\"\n * ariaExpanded=\"false\"\n * ariaControls=\"trust-bar\"\n * ></nys-button>\n * ```\n */\n @property({ type: String }) ariaExpanded: \"true\" | \"false\" | \"\" = \"\";\n\n /**\n * Marks this button as the current item within a set of related controls — the current\n * page of a pagination control, the current step of a wizard. Sets `aria-current` on the\n * internal `<button>`/`<a>`.\n *\n * Use `\"page\"` inside a pagination landmark, `\"step\"` inside a step indicator, and\n * `\"true\"` when no more specific token fits. Only one control in a set is ever current:\n * leave the property unset on all the others rather than setting `\"false\"`, which the\n * spec reads as \"explicitly not current\" and adds nothing.\n *\n * Setting `aria-current` directly on the `<nys-button>` host does nothing: a custom\n * element with no role does not map its ARIA attributes into the accessibility tree,\n * and host ARIA does not cross into the shadow root.\n *\n * @example\n * ```html\n * <nys-button label=\"3\" ariaCurrent=\"page\"></nys-button>\n * ```\n */\n @property({ type: String }) ariaCurrent:\n | \"page\"\n | \"step\"\n | \"location\"\n | \"date\"\n | \"time\"\n | \"true\"\n | \"false\"\n | \"\" = \"\";\n\n /**\n * Material Symbol icon before label. Not shown for `circle` mode.\n */\n @property({ type: String }) prefixIcon = \"\";\n\n /**\n * Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode.\n */\n @property({ type: String }) suffixIcon = \"\";\n\n /**\n * Renders circular icon-only button. Requires `icon` prop. `label` is rendered as visually-hidden text for the accessible name.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) circle = false;\n\n /**\n * Icon for circle mode. Required when `circle` is true. Scales with size (sm=24px, md=32px, lg=40px).\n */\n @property({ type: String }) icon = \"\";\n\n /**\n * Prevents interaction. Avoid disabling without explanation—show validation errors instead.\n * @default false\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Form `id` to associate with. Use when button is outside the form element.\n */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /**\n * Value submitted with the form data, mirroring a native submit button.\n *\n * When `type=\"submit\"` and both `name` and `value` are set, the entry\n * `name=value` is included in the form's data only for submissions this\n * button triggers. It is not included when the form is submitted another\n * way (Enter in a text field, another button, `form.requestSubmit()`),\n * and it is not readable from `new FormData(form)` outside a submission,\n * matching native submitter semantics.\n *\n * A form-associated custom element cannot act as a native submitter, so\n * the value is staged through `ElementInternals.setFormValue()` for the\n * duration of the submission and cleared afterward.\n */\n @property({ type: String }) value = \"\";\n\n /**\n * ID(s) of element(s) describing this button. Sets `aria-describedby`.\n */\n @property({ type: String }) ariaDescribedBy = \"\";\n\n /**\n * Form behavior: `button` (default, no form action), `submit` (submits form), `reset` (resets form). Always set explicitly to avoid unintended submissions.\n * @default \"button\"\n */\n @property({ type: String, reflect: true }) type:\n | \"submit\"\n | \"reset\"\n | \"button\" = \"button\";\n\n /**\n * Click handler. Use instead of `@click` to ensure keyboard accessibility.\n *\n * @deprecated Listen for the `nys-click` event instead. `nys-click`\n * bubbles, is composed, and fires for both mouse and keyboard activation\n * but never while disabled. This property still works but is excluded\n * from generated framework wrappers and goes away in 2.0.\n */\n @property({ attribute: false }) onClick: ((event: Event) => void) | null =\n null;\n\n /**\n * URL to navigate to. Renders as `<a>` tag. Omit for action buttons.\n */\n @property({ type: String }) href = \"\";\n\n /**\n * Link target: `_self` (same tab), `_blank` (new tab—add `suffixIcon=\"open_in_new\"`), `_parent`, `_top`, or frame name.\n * @default \"_self\"\n */\n @property({ type: String, reflect: true }) target:\n | \"_self\"\n | \"_blank\"\n | \"_parent\"\n | \"_top\"\n | \"framename\" = \"_self\";\n\n @state() private _hasPrefixSlot = false;\n @state() private _hasSuffixSlot = false;\n @state() private _hasCircleSlot = false;\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n *\n * Form association, ElementInternals, and id generation are provided by\n * NysFormControlElement (@nysds/internals). super.connectedCallback() assigns\n * an id when one is not provided (prefix = the element's localName).\n */\n\n private _onPrefixSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n this._hasPrefixSlot = slot.assignedElements({ flatten: true }).length > 0;\n }\n\n private _onSuffixSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n this._hasSuffixSlot = slot.assignedElements({ flatten: true }).length > 0;\n }\n\n private _onCircleSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n this._hasCircleSlot = slot.assignedElements({ flatten: true }).length > 0;\n }\n\n private _manageFormAction() {\n // If an onClick function is provided, call it\n if (typeof this.onClick === \"function\" && this.onClick !== null) {\n this.onClick(new Event(\"click\")); // Call user-provided onClick function with a fake click event\n }\n\n // If part of a form, perform the corresponding action based on button's \"type\"\n const form = this.internals?.form;\n\n if (form) {\n switch (this.type) {\n case \"submit\": {\n // A form-associated custom element cannot act as a native\n // submitter (requestSubmit() rejects anything that is not a\n // native submit button), so requestSubmit() stays argument-less.\n // To still contribute name=value like a native submit button,\n // stage the value through ElementInternals only for the duration\n // of this submission: the entry list is constructed synchronously\n // inside requestSubmit(), and clearing afterward keeps the value\n // out of submissions this button did not trigger.\n const contributesValue = this.name !== \"\" && this.value !== \"\";\n if (contributesValue) {\n this.setFormValue(this.value);\n }\n try {\n form.requestSubmit();\n } finally {\n if (contributesValue) {\n this.setFormValue(null);\n }\n }\n break;\n }\n case \"reset\":\n form.reset();\n break;\n case \"button\":\n }\n }\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n private _handleFocus() {\n dispatchNysFocusBlur(this, \"focus\");\n }\n\n private _handleBlur() {\n const button = this.shadowRoot?.querySelector(\".nys-button\");\n button?.classList.remove(\"active-focus\");\n dispatchNysFocusBlur(this, \"blur\");\n }\n\n private _handleClick(event: Event) {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n this._manageFormAction();\n dispatchNysEvent(this, \"nys-click\", undefined);\n }\n\n private _handleKeydown(e: KeyboardEvent) {\n if (\n e.code === \"Space\" ||\n e.code === \"Enter\" ||\n e.key === \" \" ||\n e.key === \"Enter\"\n ) {\n if (this.disabled) return;\n\n e.preventDefault();\n const btn = this.renderRoot.querySelector(\".nys-button\");\n btn?.classList.add(\"active\");\n setTimeout(() => btn?.classList.remove(\"active\"), 150);\n\n if (this.href) {\n // Click the internal <a> so native navigation happens\n const linkEl = this.renderRoot.querySelector(\n \"a.nys-button\",\n ) as HTMLAnchorElement;\n if (linkEl) {\n linkEl.click();\n }\n } else {\n this._handleAnyAttributeFunction();\n this._handleClick(e);\n }\n }\n }\n\n private _handleKeyup(e: KeyboardEvent) {\n if (\n e.code === \"Space\" ||\n e.code === \"Enter\" ||\n e.key === \" \" ||\n e.key === \"Enter\"\n ) {\n this.renderRoot.querySelector(\".nys-button\")?.classList.remove(\"active\");\n }\n }\n\n /**\n * Handles inline onclick attributes for keyboard activation.\n *\n * Native clicks execute inline onclick attributes automatically, but\n * keyboard activation of the custom element does not trigger that native\n * behavior. Dispatching a synthetic click lets the browser's own inline\n * event handler mechanism execute any onclick attribute safely without\n * eval() or new Function().\n */\n private _handleAnyAttributeFunction() {\n this.click();\n }\n\n public focus(options?: FocusOptions) {\n const innerEl = this.renderRoot.querySelector(\n this.href ? \"a.nys-button\" : \"button.nys-button\",\n ) as HTMLElement | null;\n\n if (innerEl) {\n innerEl.focus(options);\n } else {\n // fallback: focus host\n super.focus(options);\n }\n }\n\n render() {\n return html`\n ${this.href\n ? html`\n <div class=\"nys-button__linkwrapper\">\n <a\n class=\"nys-button\"\n name=${ifDefined(this.name ? this.name : undefined)}\n ?disabled=${this.disabled}\n aria-disabled=\"${this.disabled ? \"true\" : \"false\"}\"\n value=${ifDefined(this.value ? this.value : undefined)}\n href=${this.href}\n target=${this.target}\n @click=${this._handleClick}\n @focus=\"${this._handleFocus}\"\n @blur=\"${this._handleBlur}\"\n @keydown=\"${this._handleKeydown}\"\n @keyup=\"${this._handleKeyup}\"\n aria-describedby=${ifDefined(this.ariaDescribedBy || undefined)}\n aria-expanded=${ifDefined(this.ariaExpanded || undefined)}\n aria-current=${ifDefined(this.ariaCurrent || undefined)}\n >\n <slot\n name=\"prefix-icon\"\n @slotchange=${this._onPrefixSlotChange}\n ?hidden=${!this.prefixIcon && !this._hasPrefixSlot}\n >\n ${this.prefixIcon\n ? html`<nys-icon\n size=\"16\"\n name=${this.prefixIcon}\n ></nys-icon>`\n : \"\"}\n </slot>\n ${this.circle\n ? html`<div class=\"nys-button__text sr-only\">\n ${this.label}\n </div>`\n : this.label\n ? html`<div class=\"nys-button__text\">${this.label}</div>`\n : html` <slot class=\"nys-button__default-slot\"></slot> `}\n <slot\n name=\"suffix-icon\"\n @slotchange=${this._onSuffixSlotChange}\n ?hidden=${!this.suffixIcon && !this._hasSuffixSlot}\n >\n ${this.suffixIcon\n ? html`<nys-icon\n size=\"16\"\n name=${this.suffixIcon}\n ></nys-icon>`\n : \"\"}\n </slot>\n <slot\n name=\"circle-icon\"\n @slotchange=${this._onCircleSlotChange}\n ?hidden=${!this.circle ||\n (!this.icon && !this._hasCircleSlot)}\n >\n ${this.icon\n ? html`<nys-icon\n size=${this.size === \"sm\"\n ? \"24\"\n : this.size === \"lg\"\n ? \"40\"\n : \"32\"}\n name=${this.icon}\n ></nys-icon>`\n : \"\"}\n </slot>\n </a>\n </div>\n `\n : html`\n <button\n class=\"nys-button\"\n name=${ifDefined(this.name ? this.name : undefined)}\n ?disabled=${this.disabled}\n form=${ifDefined(this.form || undefined)}\n value=${ifDefined(this.value ? this.value : undefined)}\n type=${this.type}\n aria-controls=${ifDefined(this.ariaControls || undefined)}\n @click=${this._handleClick}\n @focus=${this._handleFocus}\n @blur=${this._handleBlur}\n @keydown=${this._handleKeydown}\n @keyup=${this._handleKeyup}\n aria-describedby=${ifDefined(this.ariaDescribedBy || undefined)}\n aria-expanded=${ifDefined(this.ariaExpanded || undefined)}\n aria-current=${ifDefined(this.ariaCurrent || undefined)}\n >\n <slot\n name=\"prefix-icon\"\n @slotchange=${this._onPrefixSlotChange}\n ?hidden=${!this.prefixIcon && !this._hasPrefixSlot}\n >\n ${this.prefixIcon\n ? html`<nys-icon\n size=\"16\"\n name=${this.prefixIcon}\n ></nys-icon>`\n : \"\"}\n </slot>\n ${this.circle\n ? html`<div class=\"nys-button__text sr-only\">\n ${this.label}\n </div>`\n : this.label\n ? html`<div class=\"nys-button__text\">${this.label}</div>`\n : html` <slot class=\"nys-button__default-slot\"></slot> `}\n <slot\n name=\"suffix-icon\"\n @slotchange=${this._onSuffixSlotChange}\n ?hidden=${!this.suffixIcon && !this._hasSuffixSlot}\n >\n ${this.suffixIcon\n ? html`<nys-icon\n size=\"16\"\n name=${this.suffixIcon}\n ></nys-icon>`\n : \"\"}\n </slot>\n <slot\n name=\"circle-icon\"\n @slotchange=${this._onCircleSlotChange}\n ?hidden=${!this.circle || (!this.icon && !this._hasCircleSlot)}\n >\n ${this.icon\n ? html`<nys-icon\n size=${this.size === \"sm\"\n ? \"24\"\n : this.size === \"lg\"\n ? \"40\"\n : \"32\"}\n name=${this.icon}\n ></nys-icon>`\n : \"\"}\n </slot>\n </button>\n `}\n `;\n }\n}\n\nif (!customElements.get(\"nys-button\")) {\n customElements.define(\"nys-button\", NysButton);\n}\n"],"names":["LitElement","unsafeCSS","html","property","state","ifDefined","y","f","e","N","s","I","h","b","n","i","r","a","v","C","l","o","O","u","_NysButton","NysFormControlElement","slot","form","contributesValue","dispatchNysFocusBlur","event","dispatchNysEvent","btn","linkEl","options","innerEl","styles","NysButton","__decorateClass"],"mappings":"AACA,SAAA,cAAAA,GAAA,aAAAC,GAAA,QAAAC,SAAA;AAAA,SAAA,YAAAC,GAAA,SAAAC,SAAA;AAAA,SAAA,aAAAC,SAAA;AAAA,OAAA;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,IAAIC,IAAI;AACR,SAASC,EAAEC,GAAG;AACZ,SAAO,GAAGA,CAAC,IAAI,KAAK,KAAK,IAAIF,GAAG;AAClC;AACA,SAASG,EAAED,GAAG,GAAGE,GAAG;AAClB,EAAAF,EAAE;AAAA,IACA,IAAI,YAAY,GAAG,EAAE,QAAQE,GAAG,SAAS,IAAI,UAAU,GAAE,CAAE;AAAA,EAC/D;A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IgC,WAAA,MAAA;AAgBfC,EAAA;AAAA,EAA3BnC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA/JfkC,EA+JiB,WAAA,OAAA;AAKAC,EAAA;AAAA,EAA3BnC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GApKfkC,EAoKiB,WAAA,iBAAA;AAMeC,EAAA;AAAA,EAA1CnC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GA1K9BkC,EA0KgC,WAAA,MAAA;AAaXC,EAAA;AAAA,EAA/BnC,EAAS,EAAE,WAAW,GAAA,CAAO;AAAA,GAvLnBkC,EAuLqB,WAAA,SAAA;AAMJC,EAAA;AAAA,EAA3BnC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA7LfkC,EA6LiB,WAAA,MAAA;AAMeC,EAAA;AAAA,EAA1CnC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAnM9BkC,EAmMgC,WAAA,QAAA;AAO1BC,EAAA;AAAA,EAAhBlC,EAAA;AAAM,GA1MIiC,EA0MM,WAAA,gBAAA;AACAC,EAAA;AAAA,EAAhBlC,EAAA;AAAM,GA3MIiC,EA2MM,WAAA,gBAAA;AACAC,EAAA;AAAA,EAAhBlC,EAAA;AAAM,GA5MIiC,EA4MM,WAAA,gBAAA;AA6Sd,eAAe,IAAI,YAAY,KAClC,eAAe,OAAO,cAAcA,CAAS;"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nysds/nys-button",
3
- "version": "1.21.0",
3
+ "version": "1.22.0",
4
4
  "description": "The Button component from the NYS Design System.",
5
5
  "module": "dist/nys-button.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
- "import": "./dist/nys-button.js",
10
- "types": "./dist/index.d.ts"
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/nys-button.js"
11
11
  }
12
12
  },
13
13
  "type": "module",
@@ -23,10 +23,10 @@
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.21.0"
26
+ "@nysds/nys-icon": "^1.22.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@nysds/internals": "^1.21.0",
29
+ "@nysds/internals": "^1.22.0",
30
30
  "lit": "^3.3.1",
31
31
  "typescript": "^5.9.3",
32
32
  "vite": "^7.3.1"