@nysds/nys-button 1.20.1 → 1.21.1

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.
@@ -7,13 +7,13 @@ import "@nysds/nys-icon";
7
7
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
8
8
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
9
9
  *
10
- * Button Component v1.20.1
10
+ * Button Component v1.21.1
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.20.1
16
+ * New York State Design System v1.21.1
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
@@ -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.20.1\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}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, A = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction R(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction _(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction E(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction V(e, t, n) {\n const i = d(n), r = _(t);\n i.length ? e.setAttribute(r, E(i).join(\" \")) : e.removeAttribute(r);\n}\nfunction x(e, t, n, i, r) {\n const s = d(i), a = p[n], l = t;\n if (a && R(t)) {\n l[a] = s.length ? s : null;\n return;\n }\n const o = A[n];\n if (!o) return;\n const c = r ?? (s.length ? s.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst g = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, C = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, n) {\n const i = d(n), r = g[t], s = C[t], a = e;\n if (r && r in e && (a[r] = i.length ? i : null), !s) return;\n const l = i.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(s, l) : e.removeAttribute(s);\n}\nconst b = (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__ */ b(u), h = (e) => {\n class t extends b(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(i, r) {\n const s = this.internals;\n if (s && i in s) {\n s[i] = r;\n return;\n }\n const a = v(i);\n r === null ? this.removeAttribute(a) : this.setAttribute(a, r);\n }\n reflectDefaultSemantics() {\n const i = this.defaultRole;\n i && this.setHostAria(\"role\", i);\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__ */ h(u), I = (e) => {\n const n = class n extends h(e) {\n setFormValue(r) {\n this.internals?.setFormValue(r ?? null);\n }\n setValidityFromState(r, s, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(r).some(Boolean);\n o ? l.setValidity(r, s ?? \"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.clearValidity();\n }\n };\n n.formAssociated = !0;\n let t = n;\n return t;\n}, w = /* @__PURE__ */ I(u);\nfunction O(e) {\n const t = e.tagName.toLowerCase(), n = /* @__PURE__ */ new Set(), i = (r) => {\n r.querySelectorAll(\"*\").forEach((s) => {\n const a = s.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && n.add(a), s.shadowRoot && i(s.shadowRoot);\n });\n };\n return e.shadowRoot && i(e.shadowRoot), i(e), [...n].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 R 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 { 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","h","i","r","s","a","v","I","n","l","o","w","u","_NysButton","NysFormControlElement","slot","form","event","btn","linkEl","options","innerEl","styles","NysButton","__decorateClass"],"mappings":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C9B,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.21.1\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}\nconst p = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, A = {\n labelledby: \"ariaLabel\",\n describedby: \"ariaDescription\"\n};\nfunction R(e) {\n return \"ariaDescribedByElements\" in e;\n}\nfunction _(e) {\n return e === \"errormessage\" ? \"aria-errormessage\" : `aria-${e}`;\n}\nfunction d(e) {\n return e.filter((t) => !!t);\n}\nfunction E(e) {\n return e.map((t) => (t.id || (t.id = f(\"nys-ref\")), t.id));\n}\nfunction V(e, t, n) {\n const i = d(n), r = _(t);\n i.length ? e.setAttribute(r, E(i).join(\" \")) : e.removeAttribute(r);\n}\nfunction x(e, t, n, i, r) {\n const s = d(i), a = p[n], l = t;\n if (a && R(t)) {\n l[a] = s.length ? s : null;\n return;\n }\n const o = A[n];\n if (!o) return;\n const c = r ?? (s.length ? s.map((m) => m.textContent?.trim() ?? \"\").filter(Boolean).join(\" \") : \"\");\n o in l ? l[o] = c || null : c ? e.setAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\",\n c\n ) : e.removeAttribute(\n n === \"labelledby\" ? \"aria-label\" : \"aria-description\"\n );\n}\nconst g = {\n labelledby: \"ariaLabelledByElements\",\n describedby: \"ariaDescribedByElements\"\n}, C = {\n labelledby: \"aria-label\",\n describedby: \"aria-description\"\n};\nfunction L(e, t, n) {\n const i = d(n), r = g[t], s = C[t], a = e;\n if (r && r in e && (a[r] = i.length ? i : null), !s) return;\n const l = i.map((o) => o.textContent?.trim() ?? \"\").filter(Boolean).join(\" \");\n l ? e.setAttribute(s, l) : e.removeAttribute(s);\n}\nconst b = (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__ */ b(u), h = (e) => {\n class t extends b(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(i, r) {\n const s = this.internals;\n if (s && i in s) {\n s[i] = r;\n return;\n }\n const a = v(i);\n r === null ? this.removeAttribute(a) : this.setAttribute(a, r);\n }\n reflectDefaultSemantics() {\n const i = this.defaultRole;\n i && this.setHostAria(\"role\", i);\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__ */ h(u), I = (e) => {\n const n = class n extends h(e) {\n setFormValue(r) {\n this.internals?.setFormValue(r ?? null);\n }\n setValidityFromState(r, s, a) {\n const l = this.internals;\n if (!l) return;\n const o = Object.values(r).some(Boolean);\n o ? l.setValidity(r, s ?? \"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.clearValidity();\n }\n };\n n.formAssociated = !0;\n let t = n;\n return t;\n}, w = /* @__PURE__ */ I(u);\nfunction O(e) {\n const t = e.tagName.toLowerCase(), n = /* @__PURE__ */ new Set(), i = (r) => {\n r.querySelectorAll(\"*\").forEach((s) => {\n const a = s.tagName.toLowerCase();\n a.startsWith(\"nys-\") && a !== t && !customElements.get(a) && n.add(a), s.shadowRoot && i(s.shadowRoot);\n });\n };\n return e.shadowRoot && i(e.shadowRoot), i(e), [...n].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 R 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 { 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","h","i","r","s","a","v","I","n","l","o","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;AAqDK,MAACG,IAAI,CAACD,MAAM;AAAA,EACf,MAAM,UAAUA,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,SAAO;AACT,GAA6BG,IAAI,CAACF,MAAM;AAAA,EACtC,MAAM,UAAUC,EAAED,CAAC,EAAE;AAAA,IACnB,cAAc;AACZ,YAAM,GAAG,SAAS,GAAG,KAAK,cAAc;AAAA,IAC1C;AAAA,IACA,IAAI,YAAY;AACd,UAAI,KAAK,YAAa,QAAO,KAAK;AAClC,UAAI,OAAO,KAAK,mBAAmB;AACjC,YAAI;AACF,eAAK,cAAc,KAAK,gBAAe;AAAA,QACzC,QAAQ;AACN,eAAK,cAAc;AAAA,QACrB;AACF,aAAO,KAAK;AAAA,IACd;AAAA,IACA,IAAI,cAAc;AAChB,aAAO;AAAA,IACT;AAAA,IACA,YAAYG,GAAGC,GAAG;AAChB,YAAMC,IAAI,KAAK;AACf,UAAIA,KAAKF,KAAKE,GAAG;AACf,QAAAA,EAAEF,CAAC,IAAIC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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;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-button",
3
- "version": "1.20.1",
3
+ "version": "1.21.1",
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",
@@ -23,10 +23,10 @@
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-icon": "^1.20.1"
26
+ "@nysds/nys-icon": "^1.21.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@nysds/internals": "^1.20.1",
29
+ "@nysds/internals": "^1.21.1",
30
30
  "lit": "^3.3.1",
31
31
  "typescript": "^5.9.3",
32
32
  "vite": "^7.3.1"