@nysds/nys-radiobutton 1.18.1 → 1.19.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.
@@ -1,40 +1,109 @@
1
- import { LitElement as f, unsafeCSS as k, html as v } from "lit";
2
- import { property as r, state as m } from "lit/decorators.js";
3
- import { ifDefined as _ } from "lit/directives/if-defined.js";
1
+ import { LitElement as g, unsafeCSS as k, html as b } from "lit";
2
+ import { property as i, state as _ } from "lit/decorators.js";
3
+ import { ifDefined as v } from "lit/directives/if-defined.js";
4
4
  /*!
5
5
  * █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
6
6
  * █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
7
7
  * █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
8
8
  *
9
- * Radiobutton Component v1.18.1
9
+ * Radiobutton Component v1.19.0
10
10
  * Part of the New York State Design System
11
11
  * Repository: https://github.com/its-hcd/nysds
12
12
  * License: MIT
13
13
  */
14
- const w = `:host{--_nys-radiobutton-size: var(--nys-size-400, 32px);--_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);--_nys-radiobutton-border-width: var(--nys-border-width-md, 2px);--_nys-radiobutton-outline-color: var(--nys-color-focus, #004dd1);--_nys-radiobutton-outline-width: var(--nys-border-width-md, 2px);--_nys-radiobutton-outline-offset: var(--nys-space-2px, 2px);--_nys-radiobutton-gap: var(--nys-space-150, 12px);--_nys-radiogroup-gap: var(--nys-space-200, 16px);--_nys-radiobutton-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-radiobutton-font-size: var(--nys-font-size-ui-md, 16px);--_nys-radiobutton-font-weight--label: var(--nys-font-weight-regular, 400);--_nys-radiobutton-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-radiobutton-color: var( --nys-color-text, var(--nys-color-neutral-900, #1b1b1b) );--_nys-radiobutton-background-color: var(--nys-color-ink-reverse, #ffffff);--_nys-radiobutton-border-color: var(--nys-color-neutral-600, #62666a);--_nys-radiobutton-background-color--hover: var( --nys-color-neutral-50, #ededed );--_nys-radiobutton-border-color--hover: var(--nys-color-ink, #1b1b1b);--_nys-radiobutton-background-color--active: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-border-color--active: var(--nys-color-ink, #1b1b1b);--_nys-radiobutton-background-color--checked: var(--nys-color-theme, #154973);--_nys-radiobutton-background-color--disabled: var( --nys-color-ink-reverse, #f0f0f0 );--_nys-radiobutton-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-radiobutton-border-color--disabled: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-background-color--checked--disabled: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-border-color--checked--disabled: var( --nys-color-neutral-100, #d0d0ce )}:host([size=sm]){--_nys-radiobutton-size: var(--nys-size-300, 24px);--_nys-radiobutton-border-radius: var(--nys-radius-sm, 2px);--_nys-radiogroup-gap: var(--nys-space-100, 8px);--_nys-radiobutton-gap: var(--nys-space-100, 8px)}:host([size=md]){--_nys-radiobutton-size: var(--nys-size-400, 32px);--_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);--_nys-radiogroup-gap: var(--nys-space-200, 16px);--_nys-radiobutton-gap: var(--nys-space-150, 12px)}:host([tile]){--_nys-radiobutton-font-weight--label: var(--nys-font-weight-semibold, 600);--_nys-radiobutton-border-width--tile: var(--nys-border-width-sm, 1px);--_nys-radiobutton-border-radius--tile: var(--nys-radius-md, 4px);--_nys-radiobutton-border-color--tile: var(--nys-color-neutral-100, #d0d0ce);--_nys-radiobutton-background-color--tile: var(--nys-color-ink-reverse, #ffffff);--_nys-radiobutton-padding--x--tile: var(--nys-space-250, 20px);--_nys-radiobutton-padding--y--tile: var(--nys-space-200, 16px);--_nys-radiobutton-border-color--tile--hover: var( --nys-color-neutral-700, #4a4d4f );--_nys-radiobutton-background-color--tile--hover: var( --nys-color-ink-reverse, #ffffff );--_nys-radiobutton-border-color--tile--active: var( --nys-color-neutral-900, #1b1b1b );--_nys-radiobutton-background-color--tile--active: var( --nys-color-ink-reverse, #ffffff );--_nys-radiobutton-border-color--tile--checked: var( --nys-color-theme-mid, #457aa5 );--_nys-radiobutton-background-color--tile--checked: var( --nys-color-theme-faint, #f7fafd );--_nys-radiobutton-border-color--tile--disabled: var( --nys-color-ink-reverse, #f0f0f0 );--_nys-radiobutton-background-color--tile--disabled: var( --nys-color-neutral-100, #d0d0ce )}:host([tile][size=sm]){--_nys-radiobutton-padding--x--tile: var(--nys-space-200, 16px);--_nys-radiobutton-padding--y--tile: var(--nys-space-150, 12px)}:host([tile][showError]){--_nys-radiobutton-border-color--tile: var(--nys-color-danger, #b52c2c);--_nys-radiobutton-border-color--tile--hover: var( --nys-color-danger, #b52c2c );--_nys-radiobutton-border-color--tile--active: var( --nys-color-danger, #b52c2c );--_nys-radiobutton-border-color--tile--checked: var( --nys-color-danger, #b52c2c )}.nys-radiogroup{display:flex;flex-direction:column;gap:var(--nys-space-200, 16px);font-family:var(--_nys-radiobutton-font-family);font-size:var(--_nys-radiobutton-font-size);line-height:var(--_nys-radiobutton-line-height)}.nys-radiogroup__content{gap:var(--_nys-radiogroup-gap);display:flex;flex-direction:column}.nys-radiobutton{display:flex;flex-direction:column;font-family:var(--_nys-radiobutton-font-family);font-size:var(--_nys-radiobutton-font-size);line-height:var(--_nys-radiobutton-line-height);border-radius:var(--_nys-radiobutton-border-radius--tile);border:var(--_nys-radiobutton-border-width--tile) solid var(--_nys-radiobutton-border-color--tile);background-color:var(--_nys-radiobutton-background-color--tile);padding:var(--_nys-radiobutton-padding--y--tile) var(--_nys-radiobutton-padding--x--tile)}.nys-radiobutton__radio{appearance:none;width:var(--_nys-radiobutton-size);height:var(--_nys-radiobutton-size);min-width:var(--_nys-radiobutton-size);min-height:var(--_nys-radiobutton-size);max-width:var(--_nys-radiobutton-size);max-height:var(--_nys-radiobutton-size);border:solid var(--_nys-radiobutton-border-width) var(--_nys-radiobutton-border-color);background-color:var(--_nys-radiobutton-background-color);border-radius:100%;background-repeat:no-repeat;background-position:center;background-size:contain;outline-offset:var(--_nys-radiobutton-outline-offset);outline:none;margin:0 0 auto;box-sizing:border-box}.nys-radiobutton:hover,.nys-radiobutton:hover *{cursor:pointer}input:not(:disabled):checked+.nys-radiobutton .nys-radiobutton__radio{background-image:url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');background-color:var(--_nys-radiobutton-background-color--checked)}:host([tile]) .nys-radiobutton:has(input:not(:disabled):checked)+.nys-radiobutton .nys-radiobutton__radio{border-color:var(--_nys-radiobutton-border-color--tile--checked);background-color:var(--_nys-radiobutton-background-color--tile--checked)}:host([tile]) .nys-radiobutton:has(input:not(:disabled):checked:hover)+.nys-radiobutton .nys-radiobutton__radio{cursor:default}input:disabled:checked+.nys-radiobutton .nys-radiobutton__radio{background-image:url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');border-color:var(--_nys-radiobutton-border-color--checked--disabled);background-color:var(--_nys-radiobutton-background-color--checked--disabled)}:host([tile]) .nys-radiobutton:has(input:disabled:checked)+.nys-radiobutton .nys-radiobutton__radio{border-color:var(--_nys-radiobutton-background-color--tile--disabled);background-color:var(--_nys-radiobutton-border-color--tile--disabled)}input:disabled+.nys-radiobutton,input:disabled+.nys-radiobutton *{cursor:not-allowed}input:disabled+.nys-radiobutton .nys-radiobutton__radio{background-color:var(--_nys-radiobutton-background-color--disabled);border-color:var(--_nys-radiobutton-border-color--disabled);cursor:not-allowed}:host([tile]) .nys-radiobutton:has(input:disabled)+.nys-radiobutton .nys-radiobutton__radio{background-color:var(--_nys-radiobutton-background-color--disabled);border-color:var(--_nys-radiobutton-border-color--disabled);cursor:not-allowed}input:hover:not(:disabled):not(:checked)+.nys-radiobutton .nys-radiobutton__radio,input:not(:disabled):not(:checked)+.nys-radiobutton:hover .nys-radiobutton__radio{border-color:var(--_nys-radiobutton-border-color--hover);background-color:var(--_nys-radiobutton-background-color--hover)}:host([tile]) input:not(:disabled):not(:checked)+.nys-radiobutton:hover{border-color:var(--_nys-radiobutton-border-color--tile--hover);background-color:var(--_nys-radiobutton-background-color--tile--hover);outline:solid var(--_nys-radiobutton-border-width--tile) var(--_nys-radiobutton-border-color--tile--hover)}input:active:not(:disabled):not(:checked)+.nys-radiobutton .nys-radiobutton__radio,input:not(:disabled):not(:checked)+.nys-radiobutton:active .nys-radiobutton__radio{border-color:var(--_nys-radiobutton-border-color--active);background-color:var(--_nys-radiobutton-background-color--active)}:host([tile]) input:not(:disabled):not(:checked)+.nys-radiobutton:active{border-color:var(--_nys-radiobutton-border-color--tile--active);background-color:var(--_nys-radiobutton-background-color--tile--active);outline:solid var(--_nys-radiobutton-border-width--tile) var(--_nys-radiobutton-border-color--tile--active)}:host(:focus-visible){outline:none}:host(:focus-visible) .nys-radiobutton__radio{outline:solid var(--_nys-radiobutton-outline-width) var(--_nys-radiobutton-outline-color)}input:focus-visible+.nys-radiobutton .nys-radiobutton__radio,.nys-radiobutton:has(:focus-visible) .nys-radiobutton__radio{outline:solid var(--_nys-radiobutton-outline-width) var(--_nys-radiobutton-outline-color);outline-offset:var(--_nys-radiobutton-outline-offset)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.nys-radiobutton__main-container{display:flex;align-items:center}.nys-radiobutton__other-container{display:flex;padding-inline-start:calc(var(--_nys-radiobutton-size) + var(--_nys-radiobutton-gap))}.nys-radiobutton__main-container>nys-label{--_nys-label-font-weight: var(--_nys-radiobutton-font-weight--label);display:flex;padding-inline-start:var(--_nys-radiobutton-gap)}:host([tile]) .nys-radiobutton__main-container>nys-label{--_nys-description-font-style: normal}input:disabled+.nys-radiobutton .nys-radiobutton__main-container>nys-label,input:disabled+.nys-radiobutton .nys-radiobutton__main-container>nys-label *{cursor:not-allowed;--_nys-label-cursor: not-allowed;--_nys-label-color: var(--_nys-radiobutton-color--disabled);--_nys-description-color: var(--_nys-radiobutton-color--disabled);color:var(--_nys-radiobutton-color--disabled)}fieldset{all:unset;display:contents}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}`;
15
- var E = Object.defineProperty, l = (c, t, e, o) => {
16
- for (var s = void 0, n = c.length - 1, h; n >= 0; n--)
17
- (h = c[n]) && (s = h(t, e, s) || s);
18
- return s && E(t, e, s), s;
14
+ const w = `:host{--_nys-radiobutton-size: var(--nys-size-400, 32px);--_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);--_nys-radiobutton-border-width: var(--nys-border-width-md, 2px);--_nys-radiobutton-outline-color: var(--nys-color-focus, #004dd1);--_nys-radiobutton-outline-width: var(--nys-border-width-md, 2px);--_nys-radiobutton-outline-offset: var(--nys-space-2px, 2px);--_nys-radiobutton-gap: var(--nys-space-150, 12px);--_nys-radiogroup-gap: var(--nys-space-200, 16px);--_nys-radiobutton-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-radiobutton-font-size: var(--nys-font-size-ui-md, 16px);--_nys-radiobutton-font-weight--label: var(--nys-font-weight-regular, 400);--_nys-radiobutton-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-radiobutton-color: var( --nys-color-text, var(--nys-color-neutral-900, #1b1b1b) );--_nys-radiobutton-background-color: var(--nys-color-ink-reverse, #ffffff);--_nys-radiobutton-border-color: var(--nys-color-neutral-600, #62666a);--_nys-radiobutton-background-color--hover: var( --nys-color-neutral-50, #ededed );--_nys-radiobutton-border-color--hover: var(--nys-color-ink, #1b1b1b);--_nys-radiobutton-background-color--active: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-border-color--active: var(--nys-color-ink, #1b1b1b);--_nys-radiobutton-background-color--checked: var(--nys-color-theme, #154973);--_nys-radiobutton-background-color--disabled: var( --nys-color-ink-reverse, #f0f0f0 );--_nys-radiobutton-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-radiobutton-border-color--disabled: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-background-color--checked--disabled: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-border-color--checked--disabled: var( --nys-color-neutral-100, #d0d0ce )}:host([size=sm]){--_nys-radiobutton-size: var(--nys-size-300, 24px);--_nys-radiobutton-border-radius: var(--nys-radius-sm, 2px);--_nys-radiogroup-gap: var(--nys-space-100, 8px);--_nys-radiobutton-gap: var(--nys-space-100, 8px)}:host([size=md]){--_nys-radiobutton-size: var(--nys-size-400, 32px);--_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);--_nys-radiogroup-gap: var(--nys-space-200, 16px);--_nys-radiobutton-gap: var(--nys-space-150, 12px)}:host([tile]){--_nys-radiobutton-font-weight--label: var(--nys-font-weight-semibold, 600);--_nys-radiobutton-border-width--tile: var(--nys-border-width-sm, 1px);--_nys-radiobutton-border-radius--tile: var(--nys-radius-md, 4px);--_nys-radiobutton-border-color--tile: var(--nys-color-neutral-100, #d0d0ce);--_nys-radiobutton-background-color--tile: var( --nys-color-ink-reverse, #ffffff );--_nys-radiobutton-padding--x--tile: var(--nys-space-250, 20px);--_nys-radiobutton-padding--y--tile: var(--nys-space-200, 16px);--_nys-radiobutton-border-color--tile--hover: var( --nys-color-neutral-700, #4a4d4f );--_nys-radiobutton-background-color--tile--hover: var( --nys-color-ink-reverse, #ffffff );--_nys-radiobutton-border-color--tile--active: var( --nys-color-neutral-900, #1b1b1b );--_nys-radiobutton-background-color--tile--active: var( --nys-color-ink-reverse, #ffffff );--_nys-radiobutton-border-color--tile--checked: var( --nys-color-theme-mid, #457aa5 );--_nys-radiobutton-background-color--tile--checked: var( --nys-color-theme-faint, #f7fafd );--_nys-radiobutton-border-color--tile--disabled: var( --nys-color-neutral-100, #d0d0ce );--_nys-radiobutton-background-color--tile--disabled: var( --nys-color-ink-reverse, #ffffff )}:host([tile][size=sm]){--_nys-radiobutton-padding--x--tile: var(--nys-space-200, 16px);--_nys-radiobutton-padding--y--tile: var(--nys-space-150, 12px)}:host([tile][showError]){--_nys-radiobutton-border-color--tile: var(--nys-color-danger, #b52c2c);--_nys-radiobutton-border-color--tile--hover: var( --nys-color-danger, #b52c2c );--_nys-radiobutton-border-color--tile--active: var( --nys-color-danger, #b52c2c );--_nys-radiobutton-border-color--tile--checked: var( --nys-color-danger, #b52c2c )}.nys-radiogroup{display:flex;flex-direction:column;gap:var(--nys-space-200, 16px);font-family:var(--_nys-radiobutton-font-family);font-size:var(--_nys-radiobutton-font-size);line-height:var(--_nys-radiobutton-line-height)}.nys-radiogroup legend{margin-bottom:var(--nys-space-200, 16px)}.nys-radiogroup__content{gap:var(--_nys-radiogroup-gap);display:flex;flex-direction:column}.nys-radiobutton{display:flex;flex-direction:column;font-family:var(--_nys-radiobutton-font-family);font-size:var(--_nys-radiobutton-font-size);line-height:var(--_nys-radiobutton-line-height);border-radius:var(--_nys-radiobutton-border-radius--tile);border:var(--_nys-radiobutton-border-width--tile) solid var(--_nys-radiobutton-border-color--tile);background-color:var(--_nys-radiobutton-background-color--tile);padding:var(--_nys-radiobutton-padding--y--tile) var(--_nys-radiobutton-padding--x--tile)}.nys-radiobutton__radio{appearance:none;width:var(--_nys-radiobutton-size);height:var(--_nys-radiobutton-size);min-width:var(--_nys-radiobutton-size);min-height:var(--_nys-radiobutton-size);max-width:var(--_nys-radiobutton-size);max-height:var(--_nys-radiobutton-size);border:solid var(--_nys-radiobutton-border-width) var(--_nys-radiobutton-border-color);background-color:var(--_nys-radiobutton-background-color);border-radius:100%;background-repeat:no-repeat;background-position:center;background-size:contain;outline-offset:var(--_nys-radiobutton-outline-offset);outline:none;margin:0 0 auto;box-sizing:border-box}.nys-radiobutton:hover,.nys-radiobutton:hover *{cursor:pointer}.nys-radiobutton__radio:not(:disabled):checked{background-image:url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');background-color:var(--_nys-radiobutton-background-color--checked)}:host([tile]) .nys-radiobutton:has(.nys-radiobutton__radio:not(:disabled):checked){border-color:var(--_nys-radiobutton-border-color--tile--checked);background-color:var(--_nys-radiobutton-background-color--tile--checked)}:host([tile]) .nys-radiobutton:has(.nys-radiobutton__radio:not(:disabled):checked:hover){cursor:default}.nys-radiobutton__radio:disabled:checked{background-image:url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');border-color:var(--_nys-radiobutton-border-color--checked--disabled);background-color:var(--_nys-radiobutton-background-color--checked--disabled)}:host([tile]) .nys-radiobutton:has(.nys-radiobutton__radio:disabled){border-color:var(--_nys-radiobutton-border-color--tile--disabled);background-color:var(--_nys-radiobutton-background-color--tile--disabled)}.nys-radiobutton__radio:disabled{background-color:var(--_nys-radiobutton-background-color--disabled);border-color:var(--_nys-radiobutton-border-color--disabled);cursor:not-allowed}.nys-radiobutton__radio:hover:not(:disabled):not(:checked),.nys-radiobutton:hover .nys-radiobutton__radio:not(:disabled):not(:checked){border-color:var(--_nys-radiobutton-border-color--hover);background-color:var(--_nys-radiobutton-background-color--hover)}:host([tile]) .nys-radiobutton:hover:has(.nys-radiobutton__radio:not(:disabled):not(:checked)){border-color:var(--_nys-radiobutton-border-color--tile--hover);background-color:var(--_nys-radiobutton-background-color--tile--hover);outline:solid var(--_nys-radiobutton-border-width--tile) var(--_nys-radiobutton-border-color--tile--hover)}.nys-radiobutton__radio:active:not(:disabled):not(:checked),.nys-radiobutton:active .nys-radiobutton__radio:not(:disabled):not(:checked){border-color:var(--_nys-radiobutton-border-color--active);background-color:var(--_nys-radiobutton-background-color--active)}:host([tile]) .nys-radiobutton:active:has(.nys-radiobutton__radio:not(:disabled):not(:checked)){border-color:var(--_nys-radiobutton-border-color--tile--active);background-color:var(--_nys-radiobutton-background-color--tile--active);outline:solid var(--_nys-radiobutton-border-width--tile) var(--_nys-radiobutton-border-color--tile--active)}:host(:focus-visible){outline:none}:host(:focus-visible) .nys-radiobutton__radio{outline:solid var(--_nys-radiobutton-outline-width) var(--_nys-radiobutton-outline-color)}.nys-radiobutton__radio:focus-visible{outline:solid var(--_nys-radiobutton-outline-width) var(--_nys-radiobutton-outline-color);outline-offset:var(--_nys-radiobutton-outline-offset)}.nys-radiobutton__main-container{display:flex;align-items:center}.nys-radiobutton__other-container{display:flex;padding-inline-start:calc(var(--_nys-radiobutton-size) + var(--_nys-radiobutton-gap))}.nys-radiobutton__main-container>nys-label{--_nys-label-font-weight: var(--_nys-radiobutton-font-weight--label);display:flex;padding-inline-start:var(--_nys-radiobutton-gap)}:host([tile]) .nys-radiobutton__main-container>nys-label{--_nys-description-font-style: normal}.nys-radiobutton:has(.nys-radiobutton__radio:disabled) .nys-radiobutton__main-container>nys-label,.nys-radiobutton:has(.nys-radiobutton__radio:disabled) .nys-radiobutton__main-container>nys-label *{cursor:not-allowed;--_nys-label-cursor: not-allowed;--_nys-label-color: var(--_nys-radiobutton-color--disabled);--_nys-description-color: var(--_nys-radiobutton-color--disabled);color:var(--_nys-radiobutton-color--disabled)}fieldset{all:unset;display:contents}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}`;
15
+ var E = Object.defineProperty, l = (y, t, o, e) => {
16
+ for (var r = void 0, s = y.length - 1, u; s >= 0; s--)
17
+ (u = y[s]) && (r = u(t, o, r) || r);
18
+ return r && E(t, o, r), r;
19
19
  };
20
- let x = 0;
21
- const p = class p extends f {
20
+ let $ = 0;
21
+ const m = class m extends g {
22
+ constructor() {
23
+ super(...arguments), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this.form = null, this.size = "md", this.tile = !1, this.other = !1, this.showOtherError = !1;
24
+ }
25
+ /**
26
+ * Lifecycle methods
27
+ * --------------------------------------------------------------------------
28
+ */
29
+ connectedCallback() {
30
+ super.connectedCallback(), this.id || (this.id = `nys-radiobutton-${Date.now()}-${$++}`);
31
+ }
32
+ render() {
33
+ return b``;
34
+ }
35
+ };
36
+ m.styles = k(w);
37
+ let d = m;
38
+ l([
39
+ i({ type: Boolean, reflect: !0 })
40
+ ], d.prototype, "checked");
41
+ l([
42
+ i({ type: Boolean, reflect: !0 })
43
+ ], d.prototype, "disabled");
44
+ l([
45
+ i({ type: Boolean, reflect: !0 })
46
+ ], d.prototype, "required");
47
+ l([
48
+ i({ type: String })
49
+ ], d.prototype, "label");
50
+ l([
51
+ i({ type: String })
52
+ ], d.prototype, "description");
53
+ l([
54
+ i({ type: String, reflect: !0 })
55
+ ], d.prototype, "id");
56
+ l([
57
+ i({ type: String, reflect: !0 })
58
+ ], d.prototype, "name");
59
+ l([
60
+ i({ type: String })
61
+ ], d.prototype, "value");
62
+ l([
63
+ i({ type: String, reflect: !0 })
64
+ ], d.prototype, "form");
65
+ l([
66
+ i({ type: String, reflect: !0 })
67
+ ], d.prototype, "size");
68
+ l([
69
+ i({ type: Boolean, reflect: !0 })
70
+ ], d.prototype, "tile");
71
+ l([
72
+ i({ type: Boolean, reflect: !0 })
73
+ ], d.prototype, "other");
74
+ l([
75
+ i({ type: Boolean })
76
+ ], d.prototype, "showOtherError");
77
+ customElements.get("nys-radiobutton") || customElements.define("nys-radiobutton", d);
78
+ var A = Object.defineProperty, a = (y, t, o, e) => {
79
+ for (var r = void 0, s = y.length - 1, u; s >= 0; s--)
80
+ (u = y[s]) && (r = u(t, o, r) || r);
81
+ return r && A(t, o, r), r;
82
+ };
83
+ let R = 0;
84
+ const p = class p extends g {
22
85
  // allows use of elementInternals' API
23
86
  constructor() {
24
- super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.tile = !1, this.tooltip = "", this.form = null, this.size = "md", this.selectedValue = null, this._slottedDescriptionText = "", this._internals = this.attachInternals();
87
+ super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.tile = !1, this.tooltip = "", this.form = null, this.size = "md", this._showOtherError = !1, this.selectedValue = null, this._slottedDescriptionText = "", this._radios = [], this.isMobile = !1, this._hasUserInteracted = !1, this._handleMobileQuery = () => {
88
+ this.isMobile = this._mobileQuery.matches;
89
+ }, this._handleRadiobtnClick = (t) => {
90
+ t.disabled || this.shadowRoot?.querySelector(`#input-${t.id}`)?.click();
91
+ }, this._internals = this.attachInternals();
25
92
  }
26
93
  // Generate a unique ID if one is not provided
27
94
  connectedCallback() {
28
- super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${x++}`), this.addEventListener("nys-change", this._handleRadioButtonChange), this.addEventListener("invalid", this._handleInvalid), this.addEventListener("nys-error", this._handleChildError), this.addEventListener("nys-error-clear", this._handleChildErrorClear), this.addEventListener("nys-other-input", this._handleOtherInput);
95
+ super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${R++}`), this._mobileQuery = window.matchMedia("(max-width: 479px)"), this.isMobile = this._mobileQuery.matches, this._mobileQuery.addEventListener("change", this._handleMobileQuery), this.addEventListener("invalid", this._handleInvalid), this._childObserver = new MutationObserver(() => {
96
+ this._radios = this._getAllRadios(), this.requestUpdate();
97
+ }), this._childObserver.observe(this, { childList: !0 });
29
98
  }
30
99
  disconnectedCallback() {
31
- super.disconnectedCallback(), this.removeEventListener("nys-change", this._handleRadioButtonChange), this.removeEventListener("invalid", this._handleInvalid), this.removeEventListener("nys-error", this._handleChildError), this.removeEventListener("nys-error-clear", this._handleChildErrorClear), this.removeEventListener("nys-other-input", this._handleOtherInput);
100
+ super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid), this._mobileQuery.removeEventListener("change", this._handleMobileQuery), this._childObserver?.disconnect();
32
101
  }
33
102
  async firstUpdated() {
34
- await this.updateComplete, this._initializeCheckedRadioValue(), this._setValue(), this._setRadioButtonRequire(), this._updateRadioButtonsSize(), this._updateRadioButtonsTile(), this._updateRadioButtonsShowError(), this._getSlotDescriptionForAria(), this._initializeChildAttributes(), this._updateGroupTabIndex();
103
+ await this.updateComplete, this._radios = this._getAllRadios(), this._initializeCheckedRadioValue(), this._setValue(), this._setRadioButtonRequire(), this._updateRadioButtonsSize(), this._getSlotDescriptionForAria(), this._initializeChildAttributes(), this._updateGroupTabIndex();
35
104
  }
36
105
  updated(t) {
37
- (t.has("required") || t.has("selectedValue")) && (this.showError || this._manageRequire()), t.has("size") && this._updateRadioButtonsSize(), t.has("tile") && this._updateRadioButtonsTile(), t.has("showError") && this._updateRadioButtonsShowError(), t.has("form") && this._updateRadioButtonsForm();
106
+ (t.has("required") || t.has("selectedValue")) && (this.showError || this._manageRequire()), t.has("size") && this._updateRadioButtonsSize(), this._updateGroupTabIndex();
38
107
  }
39
108
  /**
40
109
  * Form Integration
@@ -43,25 +112,28 @@ const p = class p extends f {
43
112
  _setValue() {
44
113
  this._internals.setFormValue(this.selectedValue);
45
114
  }
46
- // Updates the "require" attribute of the first radiobutton underneath a radiogroup.
47
- // This will make sure there's a requirement for all radiobutton under the same name/group
48
115
  _setRadioButtonRequire() {
49
- this.querySelectorAll("nys-radiobutton").forEach((e, o) => {
50
- this.required && o === 0 && e.setAttribute("required", "required");
116
+ this.querySelectorAll("nys-radiobutton").forEach((o, e) => {
117
+ this.required && e === 0 && o.setAttribute("required", "required");
51
118
  });
52
119
  }
53
120
  async _manageRequire() {
54
- const t = this.errorMessage || "Please select an option.", o = Array.from(this.querySelectorAll("nys-radiobutton"))[0];
55
- o && (this.required && !this.selectedValue ? this._internals.setValidity(
56
- { valueMissing: !0 },
57
- t,
58
- o
59
- // pass the custom element, not shadow input
60
- ) : (this.showError = !1, this._internals.setValidity({}, "", o)));
121
+ const t = this.errorMessage || "Please select an option.", e = Array.from(this.querySelectorAll("nys-radiobutton"))[0];
122
+ if (e) {
123
+ const r = this.shadowRoot?.querySelector(
124
+ `#input-${e.id}`
125
+ );
126
+ this.required && !this.selectedValue ? this._internals.setValidity(
127
+ { valueMissing: !0 },
128
+ t,
129
+ r ?? e
130
+ // pass the custom element, not shadow input
131
+ ) : (this.showError = !1, this._internals.setValidity({}, "", e));
132
+ }
61
133
  }
62
134
  checkValidity() {
63
135
  const t = Array.from(this.querySelectorAll("nys-radiobutton"));
64
- return !this.required || t.some((o) => o.checked);
136
+ return !this.required || t.some((e) => e.checked);
65
137
  }
66
138
  // Need to account for if radiogroup already have a radiobutton checked at initialization
67
139
  _initializeCheckedRadioValue() {
@@ -76,423 +148,306 @@ const p = class p extends f {
76
148
  }
77
149
  // Arrow / Space / Enter navigation at group level
78
150
  async _handleKeyDown(t) {
79
- if (!["ArrowUp", "ArrowDown", " ", "Enter"].includes(t.key)) return;
151
+ if (![
152
+ "ArrowUp",
153
+ "ArrowDown",
154
+ "ArrowLeft",
155
+ "ArrowRight",
156
+ " ",
157
+ "Enter"
158
+ ].includes(t.key) || (t.key === "ArrowLeft" || t.key === "ArrowRight") && t.composedPath().some((x) => x.tagName === "NYS-TEXTINPUT"))
159
+ return;
80
160
  t.preventDefault();
81
- const o = this._getAllRadios().filter((y) => !y.disabled), n = o.find((y) => y.matches(":focus")) || o.find((y) => y.checked) || o[0];
82
- let h = 0;
83
- ["ArrowUp", "ArrowLeft"].includes(t.key) ? h = -1 : ["ArrowDown", "ArrowRight"].includes(t.key) && (h = 1);
84
- let b = o.indexOf(n) + h;
85
- b < 0 && (b = o.length - 1), b >= o.length && (b = 0);
86
- const g = o[b];
87
- (await g.getInputElement())?.click(), await this.updateComplete, this._updateGroupTabIndex(), g.focus();
161
+ const e = this._getAllRadios().filter((c) => !c.disabled), r = t.target, s = e.find(
162
+ (c) => this.shadowRoot?.querySelector(`#input-${c.id}`) === r
163
+ ) || e.find((c) => c.checked) || e[0];
164
+ let u = 0;
165
+ ["ArrowUp", "ArrowLeft"].includes(t.key) ? u = -1 : ["ArrowDown", "ArrowRight"].includes(t.key) && (u = 1);
166
+ let h = e.indexOf(s) + u;
167
+ h < 0 && (h = e.length - 1), h >= e.length && (h = 0);
168
+ const f = e[h];
169
+ this._selectRadio(f), await this.updateComplete, this._updateGroupTabIndex(), this.shadowRoot?.querySelector(`#input-${f.id}`)?.focus();
88
170
  }
89
171
  _updateGroupTabIndex() {
90
- const t = this._getAllRadios(), e = t.find((o) => o.checked && !o.disabled) || t.find((o) => !o.disabled);
91
- t.forEach((o) => {
92
- o.setAttribute("aria-checked", String(o.checked)), o.tabIndex = o === e && !o.disabled ? 0 : -1;
172
+ const t = this._getAllRadios(), o = t.find((e) => e.checked && !e.disabled) || t.find((e) => !e.disabled);
173
+ t.forEach((e) => {
174
+ const r = this.shadowRoot?.querySelector(
175
+ `#input-${e.id}`
176
+ );
177
+ r && (r.tabIndex = e === o ? 0 : -1);
93
178
  });
94
179
  }
95
180
  // This callback is automatically called when the parent form is reset.
96
181
  formResetCallback() {
97
- this.querySelectorAll("nys-radiobutton").forEach((e) => {
98
- e.formResetUpdate();
99
- }), this.selectedValue = null, this._internals.setFormValue(null), this.showError = !1, this.errorMessage = "", this._internals.setValidity({}), this.requestUpdate();
182
+ this.querySelectorAll("nys-radiobutton").forEach((o) => {
183
+ o.checked = !1;
184
+ }), this.selectedValue = null, this._internals.setFormValue(null), this.showError = !1, this.errorMessage = "", this._internals.setValidity({}), this._hasUserInteracted = !1, this.requestUpdate();
185
+ }
186
+ _handleSlotChange() {
187
+ this._radios = Array.from(this.querySelectorAll("nys-radiobutton")), this.requestUpdate();
100
188
  }
101
- /**
102
- * Functions
103
- * --------------------------------------------------------------------------
104
- */
105
189
  // Apply ARIA & initial tabindex to each child radio
106
190
  _initializeChildAttributes() {
107
- this._getAllRadios().forEach((e) => {
108
- e.setAttribute("role", "radio"), e.setAttribute("aria-checked", String(e.checked)), e.setAttribute("aria-required", String(e.required)), e.setAttribute("aria-disabled", String(e.disabled)), e.setAttribute("tabindex", "-1");
191
+ this._getAllRadios().forEach((o) => {
192
+ o.getAttribute("tabindex") !== "-1" && o.setAttribute("tabindex", "-1");
109
193
  });
110
194
  }
111
- // Updates the size of each radiobutton underneath a radiogroup to ensure size standardization
112
195
  _updateRadioButtonsSize() {
113
- this.querySelectorAll("nys-radiobutton").forEach((e) => {
114
- e.setAttribute("size", this.size);
196
+ this.querySelectorAll("nys-radiobutton").forEach((o) => {
197
+ o.getAttribute("size") !== this.size && o.setAttribute("size", this.size);
115
198
  });
116
199
  }
117
- _updateRadioButtonsTile() {
118
- this.querySelectorAll("nys-radiobutton").forEach((e) => {
119
- this.tile ? e.toggleAttribute("tile", !0) : e.removeAttribute("tile");
120
- });
121
- }
122
- _updateRadioButtonsShowError() {
123
- this.querySelectorAll("nys-radiobutton").forEach((e) => {
124
- this.showError ? e.setAttribute("showError", "") : e.removeAttribute("showError");
125
- });
126
- }
127
- _updateRadioButtonsForm() {
128
- this.querySelectorAll("nys-radiobutton").forEach((e) => {
129
- this.showError && this.form !== null ? e.setAttribute("form", this.form) : e.removeAttribute("form");
130
- });
200
+ _selectRadio(t) {
201
+ if (t.checked || t.disabled) return;
202
+ this._getAllRadios().forEach((e) => {
203
+ e.checked = !1;
204
+ }), t.checked = !0, this._showOtherError = !1, this._hasUserInteracted = !1, this.name = t.name, this.selectedValue = t.value, this._internals.setFormValue(this.selectedValue), this._internals.setValidity({}), this.showError = !1, this._updateGroupTabIndex(), this.requestUpdate(), this.dispatchEvent(
205
+ new CustomEvent("nys-change", {
206
+ detail: {
207
+ id: t.id,
208
+ checked: t.checked,
209
+ name: t.name,
210
+ value: t.value
211
+ },
212
+ bubbles: !0,
213
+ composed: !0
214
+ })
215
+ );
131
216
  }
132
217
  // Get the slotted text contents so native VO can attempt to announce it within the legend in the fieldset
133
218
  _getSlotDescriptionForAria() {
134
- const e = this.shadowRoot?.querySelector(
219
+ const o = this.shadowRoot?.querySelector(
135
220
  'slot[name="description"]'
136
221
  )?.assignedNodes({ flatten: !0 }) || [];
137
- this._slottedDescriptionText = e.map((o) => o.textContent?.trim()).filter(Boolean).join(", ");
222
+ this._slottedDescriptionText = o.map((e) => e.textContent?.trim()).filter(Boolean).join(", ");
138
223
  }
139
224
  /**
140
225
  * Event Handlers
141
226
  * --------------------------------------------------------------------------
142
227
  */
143
- // Keeps radiogroup informed of the name and value of its current selected radiobutton at each change
144
- _handleRadioButtonChange(t) {
145
- const { name: e, value: o } = t.detail;
146
- this.name = e, this.selectedValue = o, this._internals.setFormValue(this.selectedValue), this._internals.setValidity({}), this.showError = !1, this._updateGroupTabIndex();
147
- }
148
228
  async _handleInvalid(t) {
149
- if (t.preventDefault(), this._internals.validity.customError) {
150
- const s = this._getAllRadios().find((n) => n.other && n.checked);
229
+ t.preventDefault();
230
+ const e = this._getAllRadios().find((s) => s.other && s.checked);
231
+ if (e && e.value.trim() === "") {
232
+ this.showError = !0, this._hasUserInteracted = !0, this._validateOtherAndEmitError(e), await this.updateComplete;
233
+ const s = this.shadowRoot?.querySelector("nys-textinput");
151
234
  if (s) {
152
- const n = s.shadowRoot?.querySelector("nys-textinput");
153
- if (s.classList.remove("focused"), n) {
154
- await n.updateComplete, n.focus();
155
- return;
156
- }
235
+ await s.updateComplete, s.focus();
236
+ return;
157
237
  }
158
238
  }
159
239
  this.showError = !0, await this._manageRequire();
160
- const e = this.querySelector("nys-radiobutton");
161
- if (e) {
162
- const o = this._internals.form;
163
- o ? Array.from(o.elements).find(
164
- (h) => typeof h.checkValidity == "function" && !h.checkValidity()
165
- ) === this && e.focus() : e.focus();
166
- }
167
- }
168
- _handleChildError(t) {
169
- t.stopPropagation();
170
- const { message: e, sourceRadio: o } = t.detail;
171
- o && (this.showError = !0, this._internals.setValidity(
172
- { customError: !0 },
173
- e || "Please complete this field.",
174
- o
175
- ));
176
- }
177
- _handleChildErrorClear() {
178
- this._internals.setValidity({}), this.showError = !1;
179
- }
180
- _handleOtherInput(t) {
181
- const { value: e } = t.detail;
182
- this.selectedValue = e, this._internals.setFormValue(e);
183
- }
184
- render() {
185
- return v`<fieldset
186
- aria-label="${this.label}${this._slottedDescriptionText ? ` ${this._slottedDescriptionText}` : this.description ? ` ${this.description}` : ""}"
187
- role="radiogroup"
188
- class="nys-radiogroup"
189
- >
190
- <nys-label
191
- label=${this.label}
192
- description=${this.description}
193
- flag=${this.required ? "required" : this.optional ? "optional" : ""}
194
- tooltip=${this.tooltip}
195
- >
196
- <slot name="description" slot="description">${this.description}</slot>
197
- </nys-label>
198
- <div class="nys-radiogroup__content" @keydown=${this._handleKeyDown}>
199
- <slot></slot>
200
- </div>
201
- <nys-errormessage
202
- ?showError=${this.showError}
203
- errorMessage=${this._internals.validationMessage || this.errorMessage}
204
- .showDivider=${!this.tile}
205
- ></nys-errormessage>
206
- </fieldset>`;
207
- }
208
- };
209
- p.styles = k(w), p.shadowRootOptions = {
210
- ...f.shadowRootOptions,
211
- delegatesFocus: !0
212
- }, p.formAssociated = !0;
213
- let a = p;
214
- l([
215
- r({ type: String, reflect: !0 })
216
- ], a.prototype, "id");
217
- l([
218
- r({ type: String, reflect: !0 })
219
- ], a.prototype, "name");
220
- l([
221
- r({ type: Boolean, reflect: !0 })
222
- ], a.prototype, "required");
223
- l([
224
- r({ type: Boolean, reflect: !0 })
225
- ], a.prototype, "optional");
226
- l([
227
- r({ type: Boolean, reflect: !0 })
228
- ], a.prototype, "showError");
229
- l([
230
- r({ type: String })
231
- ], a.prototype, "errorMessage");
232
- l([
233
- r({ type: String })
234
- ], a.prototype, "label");
235
- l([
236
- r({ type: String })
237
- ], a.prototype, "description");
238
- l([
239
- r({ type: Boolean, reflect: !0 })
240
- ], a.prototype, "tile");
241
- l([
242
- r({ type: String })
243
- ], a.prototype, "tooltip");
244
- l([
245
- r({ type: String, reflect: !0 })
246
- ], a.prototype, "form");
247
- l([
248
- r({ type: String, reflect: !0 })
249
- ], a.prototype, "size");
250
- l([
251
- m()
252
- ], a.prototype, "selectedValue");
253
- l([
254
- m()
255
- ], a.prototype, "_slottedDescriptionText");
256
- customElements.get("nys-radiogroup") || customElements.define("nys-radiogroup", a);
257
- var A = Object.defineProperty, u = (c, t, e, o) => {
258
- for (var s = void 0, n = c.length - 1, h; n >= 0; n--)
259
- (h = c[n]) && (s = h(t, e, s) || s);
260
- return s && A(t, e, s), s;
261
- };
262
- let C = 0;
263
- var i;
264
- const d = (i = class extends f {
265
- constructor() {
266
- super(...arguments), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this.form = null, this.size = "md", this.tile = !1, this.other = !1, this.showOtherError = !1, this.isMobile = window.innerWidth < 480, this._hasUserInteracted = !1, this._handleResize = () => {
267
- this.isMobile = window.innerWidth < 480;
268
- };
269
- }
270
- /**
271
- * Lifecycle methods
272
- * --------------------------------------------------------------------------
273
- */
274
- connectedCallback() {
275
- super.connectedCallback(), this.id || (this.id = `nys-radiobutton-${Date.now()}-${C++}`), this.checked && (i.buttonGroup[this.name] && (i.buttonGroup[this.name].checked = !1, i.buttonGroup[this.name].requestUpdate()), i.buttonGroup[this.name] = this), this.addEventListener("focus", this._handleFocus), this.addEventListener("blur", this._handleBlur), this.addEventListener("click", this._handleChange), window.addEventListener("resize", this._handleResize);
276
- }
277
- disconnectedCallback() {
278
- super.disconnectedCallback(), this.removeEventListener("focus", this._handleFocus), this.removeEventListener("blur", this._handleBlur), window.removeEventListener("resize", this._handleResize);
279
- }
280
- updated(t) {
281
- t.has("checked") && (t.get("checked") && !this.checked && this._clearOtherState(), this.checked && i.buttonGroup[this.name] !== this && (i.buttonGroup[this.name] && (i.buttonGroup[this.name].checked = !1, i.buttonGroup[this.name].requestUpdate()), i.buttonGroup[this.name] = this));
282
- }
283
- /**
284
- * Functions
285
- * --------------------------------------------------------------------------
286
- */
287
- async getInputElement() {
288
- return await this.updateComplete, this.shadowRoot?.querySelector("input") || null;
289
- }
290
- // This callback is automatically called when the parent form is reset.
291
- formResetUpdate() {
292
- this.checked = !1, this._clearOtherState(), i.buttonGroup[this.name] === this && delete i.buttonGroup[this.name], this.requestUpdate();
293
- }
294
- _clearOtherState() {
295
- this.other && (this.showOtherError = !1, this._hasUserInteracted = !1, this._dispatchClearErrorEvent());
296
- }
297
- _dispatchClearErrorEvent() {
298
- this.dispatchEvent(
299
- new CustomEvent("nys-error-clear", {
300
- detail: {
301
- id: this.id,
302
- name: this.name,
303
- type: "other"
304
- },
305
- bubbles: !0,
306
- composed: !0
307
- })
308
- );
309
- }
310
- /**
311
- * Event Handlers
312
- * --------------------------------------------------------------------------
313
- */
314
- _emitChangeEvent() {
315
- this.dispatchEvent(
316
- new CustomEvent("nys-change", {
317
- detail: {
318
- id: this.id,
319
- checked: this.checked,
320
- name: this.name,
321
- value: this.value
322
- },
323
- bubbles: !0,
324
- composed: !0
325
- })
240
+ const r = this._getAllRadios().find(
241
+ (s) => !s.disabled
326
242
  );
243
+ if (r) {
244
+ const s = () => {
245
+ this.shadowRoot?.querySelector(`#input-${r.id}`)?.focus();
246
+ }, u = this._internals.form;
247
+ u ? Array.from(u.elements).find(
248
+ (c) => typeof c.checkValidity == "function" && !c.checkValidity()
249
+ ) === this && s() : s();
250
+ }
327
251
  }
328
- _emitOtherInputEvent() {
329
- this.dispatchEvent(
252
+ _handleTextInput(t, o) {
253
+ const e = o.target;
254
+ t.value = e.value, this.selectedValue = e.value, this._internals.setFormValue(e.value), this._hasUserInteracted && this._validateOtherAndEmitError(t), this.dispatchEvent(
330
255
  new CustomEvent("nys-other-input", {
331
- detail: {
332
- id: this.id,
333
- name: this.name,
334
- value: this.value
335
- },
256
+ detail: { id: t.id, name: t.name, value: t.value },
336
257
  bubbles: !0,
337
258
  composed: !0
338
259
  })
339
260
  );
340
261
  }
341
- // Handle radiobutton change event & un-selection of other radio options in group
342
- async _handleChange() {
343
- this.showOtherError = !1, !this.checked && !this.disabled && (i.buttonGroup[this.name] && (i.buttonGroup[this.name].checked = !1, i.buttonGroup[this.name].requestUpdate()), i.buttonGroup[this.name] = this, this.checked = !0, this._validateOtherAndEmitError(), this._emitChangeEvent());
262
+ _handleTextInputBlur(t) {
263
+ this._hasUserInteracted = !0, this._validateOtherAndEmitError(t);
344
264
  }
345
- // Handle focus event
346
- _handleFocus() {
347
- this.dispatchEvent(
348
- new Event("nys-focus", { bubbles: !0, composed: !0 })
265
+ _validateOtherAndEmitError(t) {
266
+ if (!t.other) return;
267
+ if (!t.checked || !this._hasUserInteracted) {
268
+ this._showOtherError = !1;
269
+ return;
270
+ }
271
+ const o = t.value.trim() === "";
272
+ this._showOtherError = o;
273
+ const e = this.shadowRoot?.querySelector(
274
+ `#input-${t.id}`
349
275
  );
276
+ o ? (this._internals.setValidity(
277
+ {
278
+ customError: !0
279
+ },
280
+ "Please enter a value for this option.",
281
+ e ?? t
282
+ ), this.showError = !0) : (this._internals.setValidity({}), this.showError = !1);
350
283
  }
351
- // Handle blur event
352
- _handleBlur() {
353
- this.dispatchEvent(
354
- new Event("nys-blur", { bubbles: !0, composed: !0 })
355
- ), setTimeout(() => {
356
- this.other && this.checked && (this._hasUserInteracted = !0, this._validateOtherAndEmitError());
357
- }, 50);
284
+ _handleOtherKeydown(t) {
285
+ (t.key == "Space" || t.key === " ") && t.stopPropagation();
358
286
  }
359
- _callInputHandling() {
360
- if (this.disabled) return;
361
- const t = this.shadowRoot?.querySelector(
362
- 'input[type="radio"]'
287
+ _handleGroupFocusout(t) {
288
+ const o = t.relatedTarget;
289
+ if (o && this.shadowRoot?.contains(o)) return;
290
+ const e = this._getAllRadios().find(
291
+ (r) => r.other && r.checked
363
292
  );
364
- t && (t.focus(), t.click());
293
+ e && e.value.trim() === "" && (this._hasUserInteracted = !0, this._validateOtherAndEmitError(e));
365
294
  }
366
- _handleTextInput(t) {
367
- let o = t.target.value;
368
- this.value = o, this._hasUserInteracted && this._validateOtherAndEmitError(), this._emitOtherInputEvent();
369
- }
370
- _handleTextInputBlur() {
371
- this._hasUserInteracted = !0, this._validateOtherAndEmitError();
372
- }
373
- _validateOtherAndEmitError() {
374
- if (!this.other) return;
375
- if (!this.checked || !this._hasUserInteracted) {
376
- this.showOtherError = !1;
377
- return;
378
- }
379
- const t = this.value.trim() === "";
380
- this.showOtherError = t, t ? this.dispatchEvent(
381
- new CustomEvent("nys-error", {
382
- detail: {
383
- id: this.id,
384
- name: this.name,
385
- type: "other",
386
- message: "Please enter a value for this option.",
387
- sourceRadio: this
388
- },
389
- bubbles: !0,
390
- composed: !0
391
- })
392
- ) : this._dispatchClearErrorEvent();
295
+ _handleRadiobtnFocus(t) {
296
+ t.dispatchEvent(
297
+ new CustomEvent("nys-focus", { bubbles: !0, composed: !0 })
298
+ );
393
299
  }
394
- _handleOtherKeydown(t) {
395
- (t.key == "Space" || t.key === " ") && t.stopPropagation();
300
+ _handleRadiobtnBlur(t) {
301
+ t.dispatchEvent(
302
+ new CustomEvent("nys-blur", { bubbles: !0, composed: !0 })
303
+ );
396
304
  }
397
305
  render() {
398
- return v`
399
- <input
400
- type="radio"
401
- name="${_(this.name ? this.name : void 0)}"
402
- .checked=${this.checked}
403
- ?disabled=${this.disabled}
404
- .value=${this.value}
405
- ?required="${this.required}"
406
- form=${_(this.form || void 0)}
407
- @change="${this._handleChange}"
408
- aria-hidden="true"
409
- hidden
410
- class="sr-only"
411
- />
412
- <div
413
- class="nys-radiobutton"
414
- @click="${this._callInputHandling}"
415
- aria-label=${this.label || (this.other ?? "Other")}
306
+ return b` <slot
307
+ style="display:none"
308
+ @slotchange=${this._handleSlotChange}
309
+ ></slot>
310
+ <fieldset
311
+ aria-label="${this.label}${this._slottedDescriptionText ? ` ${this._slottedDescriptionText}` : this.description ? ` ${this.description}` : ""}"
312
+ role="radiogroup"
313
+ aria-required=${this.required ? "true" : "false"}
314
+ class="nys-radiogroup"
315
+ @focusout=${this._handleGroupFocusout}
416
316
  >
417
- <div class="nys-radiobutton__main-container">
418
- <span class="nys-radiobutton__radio" tabindex="0"></span>
419
- ${(this.label || this.other) && v`<nys-label
420
- label="${this.label || (this.other ? "Other" : "")}"
421
- description=${_(this.description || void 0)}
317
+ <legend>
318
+ <nys-label
319
+ label=${this.label}
320
+ description=${this.description}
321
+ flag=${this.required ? "required" : this.optional ? "optional" : ""}
322
+ tooltip=${this.tooltip}
422
323
  >
423
324
  <slot name="description" slot="description"
424
325
  >${this.description}</slot
425
326
  >
426
- </nys-label> `}
327
+ </nys-label>
328
+ </legend>
329
+ <div class="nys-radiogroup__content" @keydown=${this._handleKeyDown}>
330
+ ${this._radios.map(
331
+ (t, o) => b`
332
+ <div
333
+ class="nys-radiobutton"
334
+ @click=${() => this._handleRadiobtnClick(t)}
335
+ >
336
+ <div class="nys-radiobutton__main-container">
337
+ <!-- <span class="nys-radiobutton__radio" tabindex="-1"></span> -->
338
+ <input
339
+ id="input-${t.id}"
340
+ type="radio"
341
+ class="nys-radiobutton__radio"
342
+ name="${v(t.name || void 0)}"
343
+ .checked=${t.checked}
344
+ ?disabled=${t.disabled}
345
+ .value=${t.value}
346
+ ?required=${this.required && o === 0}
347
+ form=${v(t.form || void 0)}
348
+ aria-label="${t.label || (t.other ? "Other" : "")}"
349
+ @change=${() => this._selectRadio(t)}
350
+ @focus=${() => this._handleRadiobtnFocus(t)}
351
+ @blur=${() => this._handleRadiobtnBlur(t)}
352
+ />
353
+ ${(t.label || t.other) && b`<nys-label
354
+ aria-hidden="true"
355
+ id="${t.id}-label"
356
+ label="${t.label || (t.other ? "Other" : "")}"
357
+ description=${v(t.description || void 0)}
358
+ >
359
+ <slot name="description" slot="description"
360
+ >${t.description}</slot
361
+ >
362
+ </nys-label> `}
363
+ </div>
364
+ <div class="nys-radiobutton__other-container">
365
+ ${t.other && t.checked ? b`
366
+ <nys-textinput
367
+ .value=${t.value}
368
+ id=${"radiobutton-other-" + t.id}
369
+ @nys-input=${(e) => this._handleTextInput(t, e)}
370
+ @nys-blur=${() => this._handleTextInputBlur(t)}
371
+ @keydown=${this._handleOtherKeydown}
372
+ @nys-focus=${() => t.classList.remove("focused")}
373
+ ariaLabel="Other"
374
+ aria-invalid=${t.showOtherError ? "true" : "false"}
375
+ width=${this.isMobile ? "full" : "md"}
376
+ ?disabled=${t.disabled}
377
+ ></nys-textinput>
378
+ ` : ""}
379
+ </div>
380
+ </div>
381
+ `
382
+ )}
427
383
  </div>
428
- <div class="nys-radiobutton__other-container">
429
- ${this.other && this.checked ? v`
430
- <nys-textinput
431
- .value=${this.value}
432
- id=${"radiobutton-other-" + this.id}
433
- @nys-input=${this._handleTextInput}
434
- @nys-blur=${this._handleTextInputBlur}
435
- @keydown=${this._handleOtherKeydown}
436
- @nys-focus=${() => this.classList.remove("focused")}
437
- ariaLabel="Other"
438
- aria-invalid=${this.showOtherError ? "true" : "false"}
439
- width=${this.isMobile ? "full" : "md"}
440
- ></nys-textinput>
441
- ` : ""}
442
- </div>
443
- </div>
444
- `;
384
+ <nys-errormessage
385
+ ?showError=${this.showError}
386
+ errorMessage=${this._internals.validationMessage || this.errorMessage}
387
+ .showDivider=${!this.tile}
388
+ ></nys-errormessage>
389
+ </fieldset>`;
445
390
  }
446
- }, i.styles = k(w), i.shadowRootOptions = {
447
- ...f.shadowRootOptions,
391
+ };
392
+ p.styles = k(w), p.shadowRootOptions = {
393
+ ...g.shadowRootOptions,
448
394
  delegatesFocus: !0
449
- }, i.buttonGroup = {}, i);
450
- u([
451
- r({ type: Boolean, reflect: !0 })
452
- ], d.prototype, "checked");
453
- u([
454
- r({ type: Boolean, reflect: !0 })
455
- ], d.prototype, "disabled");
456
- u([
457
- r({ type: Boolean, reflect: !0 })
458
- ], d.prototype, "required");
459
- u([
460
- r({ type: String })
461
- ], d.prototype, "label");
462
- u([
463
- r({ type: String })
464
- ], d.prototype, "description");
465
- u([
466
- r({ type: String, reflect: !0 })
467
- ], d.prototype, "id");
468
- u([
469
- r({ type: String, reflect: !0 })
470
- ], d.prototype, "name");
471
- u([
472
- r({ type: String })
473
- ], d.prototype, "value");
474
- u([
475
- r({ type: String, reflect: !0 })
476
- ], d.prototype, "form");
477
- u([
478
- r({ type: String, reflect: !0 })
479
- ], d.prototype, "size");
480
- u([
481
- r({ type: Boolean, reflect: !0 })
482
- ], d.prototype, "tile");
483
- u([
484
- r({ type: Boolean, reflect: !0 })
485
- ], d.prototype, "other");
486
- u([
487
- r({ type: Boolean })
488
- ], d.prototype, "showOtherError");
489
- u([
490
- m()
491
- ], d.prototype, "isMobile");
492
- let R = d;
493
- customElements.get("nys-radiobutton") || customElements.define("nys-radiobutton", R);
395
+ }, p.formAssociated = !0;
396
+ let n = p;
397
+ a([
398
+ i({ type: String, reflect: !0 })
399
+ ], n.prototype, "id");
400
+ a([
401
+ i({ type: String, reflect: !0 })
402
+ ], n.prototype, "name");
403
+ a([
404
+ i({ type: Boolean, reflect: !0 })
405
+ ], n.prototype, "required");
406
+ a([
407
+ i({ type: Boolean, reflect: !0 })
408
+ ], n.prototype, "optional");
409
+ a([
410
+ i({ type: Boolean, reflect: !0 })
411
+ ], n.prototype, "showError");
412
+ a([
413
+ i({ type: String })
414
+ ], n.prototype, "errorMessage");
415
+ a([
416
+ i({ type: String })
417
+ ], n.prototype, "label");
418
+ a([
419
+ i({ type: String })
420
+ ], n.prototype, "description");
421
+ a([
422
+ i({ type: Boolean, reflect: !0 })
423
+ ], n.prototype, "tile");
424
+ a([
425
+ i({ type: String })
426
+ ], n.prototype, "tooltip");
427
+ a([
428
+ i({ type: String, reflect: !0 })
429
+ ], n.prototype, "form");
430
+ a([
431
+ i({ type: String, reflect: !0 })
432
+ ], n.prototype, "size");
433
+ a([
434
+ i({ type: Boolean })
435
+ ], n.prototype, "_showOtherError");
436
+ a([
437
+ _()
438
+ ], n.prototype, "selectedValue");
439
+ a([
440
+ _()
441
+ ], n.prototype, "_slottedDescriptionText");
442
+ a([
443
+ _()
444
+ ], n.prototype, "_radios");
445
+ a([
446
+ _()
447
+ ], n.prototype, "isMobile");
448
+ customElements.get("nys-radiogroup") || customElements.define("nys-radiogroup", n);
494
449
  export {
495
- R as NysRadiobutton,
496
- a as NysRadiogroup
450
+ d as NysRadiobutton,
451
+ n as NysRadiogroup
497
452
  };
498
453
  //# sourceMappingURL=nys-radiobutton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nys-radiobutton.js","sources":["../src/nys-radiogroup.ts","../src/nys-radiobutton.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport type { NysRadiobutton } from \"./nys-radiobutton\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-radiobutton.scss?inline\";\n\nlet radiogroupIdCounter = 0;\n\n/**\n * A container for grouping `nys-radiobutton` elements as a single form control with enforced single selection.\n * Handles keyboard navigation (arrow keys), validation, required constraints, and form integration.\n *\n * Use to let users select exactly one option from 2-6 choices. Apply `tile` and `size` to the group\n * and all children inherit these styles automatically. For 7+ options, use `nys-select`.\n *\n * @summary Container for grouping radio buttons as a single form control.\n * @element nys-radiogroup\n *\n * @slot - Default slot for `nys-radiobutton` elements.\n * @slot description - Custom HTML description content.\n *\n * @example Basic radio group\n * ```html\n * <nys-radiogroup label=\"Select borough\" required>\n * <nys-radiobutton name=\"borough\" value=\"bronx\" label=\"The Bronx\"></nys-radiobutton>\n * <nys-radiobutton name=\"borough\" value=\"brooklyn\" label=\"Brooklyn\"></nys-radiobutton>\n * <nys-radiobutton name=\"borough\" value=\"manhattan\" label=\"Manhattan\"></nys-radiobutton>\n * </nys-radiogroup>\n * ```\n */\n\nexport class NysRadiogroup extends LitElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Unique identifier. Auto-generated if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name for form submission. Auto-populated from child radiobuttons. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Requires a selection before form submission. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Shows \"Optional\" flag. */\n @property({ type: Boolean, reflect: true }) optional = false;\n\n /** Shows error message when true. */\n @property({ type: Boolean, reflect: true }) showError = false;\n\n /** Error message text. Shown only when `showError` is true. */\n @property({ type: String }) errorMessage = \"\";\n\n /** Visible label text for the group. */\n @property({ type: String }) label = \"\";\n\n /** Helper text below label. Use slot for custom HTML. */\n @property({ type: String }) description = \"\";\n\n /** Renders all radiobuttons as tiles with larger clickable area. */\n @property({ type: Boolean, reflect: true }) tile = false;\n\n /** Tooltip text shown on hover/focus of info icon. */\n @property({ type: String }) tooltip = \"\";\n\n /** Form `id` to associate with. Applied to all children. */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /**\n * Radio size for all children: `sm` (24px) or `md` (32px, default).\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" = \"md\";\n\n @state() private selectedValue: string | null = null;\n @state() private _slottedDescriptionText = \"\";\n\n private _internals: ElementInternals;\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n */\n\n static formAssociated = true; // allows use of elementInternals' API\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n // Generate a unique ID if one is not provided\n connectedCallback() {\n super.connectedCallback();\n if (!this.id) {\n this.id = `nys-radiogroup-${Date.now()}-${radiogroupIdCounter++}`;\n }\n this.addEventListener(\"nys-change\", this._handleRadioButtonChange);\n this.addEventListener(\"invalid\", this._handleInvalid);\n this.addEventListener(\"nys-error\", this._handleChildError);\n this.addEventListener(\"nys-error-clear\", this._handleChildErrorClear);\n this.addEventListener(\"nys-other-input\", this._handleOtherInput);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"nys-change\", this._handleRadioButtonChange);\n this.removeEventListener(\"invalid\", this._handleInvalid);\n this.removeEventListener(\"nys-error\", this._handleChildError);\n this.removeEventListener(\"nys-error-clear\", this._handleChildErrorClear);\n this.removeEventListener(\"nys-other-input\", this._handleOtherInput);\n }\n\n async firstUpdated() {\n await this.updateComplete;\n this._initializeCheckedRadioValue();\n this._setValue(); // This ensures our element always participates in the form\n this._setRadioButtonRequire();\n this._updateRadioButtonsSize();\n this._updateRadioButtonsTile();\n this._updateRadioButtonsShowError();\n this._getSlotDescriptionForAria();\n\n this._initializeChildAttributes();\n this._updateGroupTabIndex();\n }\n\n updated(changedProperties: Map<string | symbol, unknown>) {\n if (\n changedProperties.has(\"required\") ||\n changedProperties.has(\"selectedValue\")\n ) {\n if (!this.showError) {\n this._manageRequire();\n }\n }\n if (changedProperties.has(\"size\")) {\n this._updateRadioButtonsSize();\n }\n if (changedProperties.has(\"tile\")) {\n this._updateRadioButtonsTile();\n }\n if (changedProperties.has(\"showError\")) {\n this._updateRadioButtonsShowError();\n }\n if (changedProperties.has(\"form\")) {\n this._updateRadioButtonsForm();\n }\n }\n\n /**\n * Form Integration\n * --------------------------------------------------------------------------\n */\n\n private _setValue() {\n this._internals.setFormValue(this.selectedValue);\n }\n\n // Updates the \"require\" attribute of the first radiobutton underneath a radiogroup.\n // This will make sure there's a requirement for all radiobutton under the same name/group\n private _setRadioButtonRequire() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radioButton, index) => {\n if (this.required && index === 0) {\n radioButton.setAttribute(\"required\", \"required\");\n }\n });\n }\n\n private async _manageRequire() {\n const message = this.errorMessage || \"Please select an option.\";\n\n const radioButtons = Array.from(this.querySelectorAll(\"nys-radiobutton\"));\n const firstRadio = radioButtons[0] as HTMLElement;\n\n if (firstRadio) {\n if (this.required && !this.selectedValue) {\n this._internals.setValidity(\n { valueMissing: true },\n message,\n firstRadio, // pass the custom element, not shadow input\n );\n } else {\n this.showError = false;\n this._internals.setValidity({}, \"\", firstRadio);\n }\n }\n }\n\n checkValidity() {\n const radioButtons = Array.from(this.querySelectorAll(\"nys-radiobutton\"));\n const valid =\n !this.required ||\n radioButtons.some((radio) => (radio as NysRadiobutton).checked);\n return valid;\n }\n\n // Need to account for if radiogroup already have a radiobutton checked at initialization\n private _initializeCheckedRadioValue() {\n const checkedRadio = this.querySelector(\"nys-radiobutton[checked]\");\n if (checkedRadio) {\n this.selectedValue = checkedRadio.getAttribute(\"value\");\n this._internals.setFormValue(this.selectedValue);\n }\n }\n\n // Core Keyboard & Click Logic\n private _getAllRadios() {\n return Array.from(\n this.querySelectorAll(\"nys-radiobutton\"),\n ) as NysRadiobutton[];\n }\n\n // Arrow / Space / Enter navigation at group level\n private async _handleKeyDown(event: KeyboardEvent) {\n const keys = [\"ArrowUp\", \"ArrowDown\", \" \", \"Enter\"];\n\n if (!keys.includes(event.key)) return;\n event.preventDefault();\n\n const radioBtns = this._getAllRadios().filter((radio) => !radio.disabled);\n\n const focusedRadio = radioBtns.find((radio) => radio.matches(\":focus\"));\n const currentRadio =\n focusedRadio || radioBtns.find((radio) => radio.checked) || radioBtns[0]; // fallback is checked radio or first radio\n\n let increment = 0;\n if ([\"ArrowUp\", \"ArrowLeft\"].includes(event.key)) {\n increment = -1;\n } else if ([\"ArrowDown\", \"ArrowRight\"].includes(event.key)) {\n increment = 1;\n }\n\n let index = radioBtns.indexOf(currentRadio) + increment;\n\n // Handles the wrap around ends if user is at first or last radiobutton\n if (index < 0) {\n index = radioBtns.length - 1;\n }\n if (index >= radioBtns.length) {\n index = 0;\n }\n\n const target = radioBtns[index];\n const input = await target.getInputElement();\n input?.click();\n\n await this.updateComplete;\n this._updateGroupTabIndex();\n target.focus();\n }\n\n private _updateGroupTabIndex() {\n const radios = this._getAllRadios();\n\n // Pick active: checked first, otherwise first enabled\n const active =\n radios.find((radio) => radio.checked && !radio.disabled) ||\n radios.find((radio) => !radio.disabled);\n\n radios.forEach((radio) => {\n radio.setAttribute(\"aria-checked\", String(radio.checked));\n // Only one radiobutton can be focusable at all times.\n // Due to this, we calculate logic to determine an active radiobutton and call all other as tabindex=\"-1\"\n radio.tabIndex = radio === active && !radio.disabled ? 0 : -1;\n });\n }\n\n // This callback is automatically called when the parent form is reset.\n public formResetCallback() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radioButton) => {\n (radioButton as NysRadiobutton).formResetUpdate();\n });\n\n this.selectedValue = null;\n\n this._internals.setFormValue(null);\n\n // Reset validation UI\n this.showError = false;\n this.errorMessage = \"\";\n this._internals.setValidity({});\n\n // Re-render UI\n this.requestUpdate();\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n // Apply ARIA & initial tabindex to each child radio\n private _initializeChildAttributes() {\n const radios = this._getAllRadios();\n radios.forEach((radio) => {\n radio.setAttribute(\"role\", \"radio\");\n radio.setAttribute(\"aria-checked\", String(radio.checked));\n radio.setAttribute(\"aria-required\", String(radio.required));\n radio.setAttribute(\"aria-disabled\", String(radio.disabled));\n radio.setAttribute(\"tabindex\", \"-1\");\n });\n }\n\n // Updates the size of each radiobutton underneath a radiogroup to ensure size standardization\n private _updateRadioButtonsSize() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radioButton) => {\n radioButton.setAttribute(\"size\", this.size);\n });\n }\n\n private _updateRadioButtonsTile() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radioButton) => {\n if (this.tile) {\n radioButton.toggleAttribute(\"tile\", true);\n } else {\n radioButton.removeAttribute(\"tile\");\n }\n });\n }\n\n private _updateRadioButtonsShowError() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radioButton) => {\n if (this.showError) {\n radioButton.setAttribute(\"showError\", \"\");\n } else {\n radioButton.removeAttribute(\"showError\");\n }\n });\n }\n\n private _updateRadioButtonsForm() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radioButton) => {\n if (this.showError) {\n if (this.form !== null) {\n radioButton.setAttribute(\"form\", this.form);\n } else {\n radioButton.removeAttribute(\"form\");\n }\n } else {\n radioButton.removeAttribute(\"form\");\n }\n });\n }\n\n // Get the slotted text contents so native VO can attempt to announce it within the legend in the fieldset\n private _getSlotDescriptionForAria() {\n const slot = this.shadowRoot?.querySelector(\n 'slot[name=\"description\"]',\n ) as HTMLSlotElement;\n const nodes = slot?.assignedNodes({ flatten: true }) || [];\n\n this._slottedDescriptionText = nodes\n .map((node) => node.textContent?.trim())\n .filter(Boolean)\n .join(\", \");\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n // Keeps radiogroup informed of the name and value of its current selected radiobutton at each change\n private _handleRadioButtonChange(event: Event) {\n const { name, value } = (event as CustomEvent).detail;\n\n this.name = name;\n this.selectedValue = value;\n this._internals.setFormValue(this.selectedValue);\n\n // selecting anything clears group required error\n this._internals.setValidity({});\n this.showError = false;\n\n // Accounts for tabindex & ARIA on every click/space select\n this._updateGroupTabIndex();\n }\n\n private async _handleInvalid(event: Event) {\n event.preventDefault();\n\n // Focus \"other\" text input when customError is set\n if (this._internals.validity.customError) {\n const radios = this._getAllRadios();\n const otherRadio = radios.find((radio) => radio.other && radio.checked);\n\n if (otherRadio) {\n const textInput = otherRadio.shadowRoot?.querySelector(\"nys-textinput\");\n otherRadio.classList.remove(\"focused\");\n\n if (textInput) {\n await (textInput as any).updateComplete;\n (textInput as HTMLElement).focus();\n return;\n }\n }\n }\n\n // Check if the radio group is invalid and set `showError` accordingly\n this.showError = true;\n await this._manageRequire(); // Refresh validation message\n\n const firstRadio = this.querySelector(\"nys-radiobutton\") as NysRadiobutton;\n if (firstRadio) {\n // Focus only if this is the first invalid element (top-down approach)\n const form = this._internals.form;\n if (form) {\n const elements = Array.from(form.elements) as Array<\n HTMLElement & { checkValidity?: () => boolean }\n >;\n\n // Find the first element in the form that is invalid\n const firstInvalidElement = elements.find(\n (element) =>\n typeof element.checkValidity === \"function\" &&\n !element.checkValidity(),\n );\n if (firstInvalidElement === this) {\n firstRadio.focus();\n }\n } else {\n // If not part of a form, simply focus.\n firstRadio.focus();\n }\n }\n }\n\n private _handleChildError(event: Event) {\n event.stopPropagation();\n\n const { message, sourceRadio } = (event as CustomEvent).detail;\n if (!sourceRadio) return;\n\n this.showError = true;\n\n this._internals.setValidity(\n { customError: true },\n message || \"Please complete this field.\",\n sourceRadio as HTMLElement,\n );\n }\n\n private _handleChildErrorClear() {\n this._internals.setValidity({});\n this.showError = false;\n }\n\n private _handleOtherInput(event: Event) {\n const { value } = (event as CustomEvent).detail;\n this.selectedValue = value;\n this._internals.setFormValue(value);\n }\n\n render() {\n return html`<fieldset\n aria-label=\"${this.label}${this._slottedDescriptionText\n ? ` ${this._slottedDescriptionText}`\n : this.description\n ? ` ${this.description}`\n : \"\"}\"\n role=\"radiogroup\"\n class=\"nys-radiogroup\"\n >\n <nys-label\n label=${this.label}\n description=${this.description}\n flag=${this.required ? \"required\" : this.optional ? \"optional\" : \"\"}\n tooltip=${this.tooltip}\n >\n <slot name=\"description\" slot=\"description\">${this.description}</slot>\n </nys-label>\n <div class=\"nys-radiogroup__content\" @keydown=${this._handleKeyDown}>\n <slot></slot>\n </div>\n <nys-errormessage\n ?showError=${this.showError}\n errorMessage=${this._internals.validationMessage || this.errorMessage}\n .showDivider=${!this.tile}\n ></nys-errormessage>\n </fieldset>`;\n }\n}\n\nif (!customElements.get(\"nys-radiogroup\")) {\n customElements.define(\"nys-radiogroup\", NysRadiogroup);\n}\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport \"./nys-radiogroup\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-radiobutton.scss?inline\";\n\nlet radiobuttonIdCounter = 0;\n\n/**\n * A radio button for single selection within a `nys-radiogroup`. Only one radio with the same `name` can be selected.\n *\n * Use within `nys-radiogroup` for 2-6 mutually exclusive options. For 7+ options, use `nys-select`.\n * For multiple selections, use `nys-checkbox`.\n *\n * @summary Radio button for single selection from mutually exclusive options.\n * @element nys-radiobutton\n *\n * @slot description - Custom HTML description content.\n *\n * @fires nys-change - Fired when selection changes. Detail: `{id, checked, name, value}`.\n * @fires nys-focus - Fired when radio gains focus.\n * @fires nys-blur - Fired when radio loses focus.\n * @fires nys-other-input - Fired when \"other\" text input value changes. Detail: `{id, name, value}`.\n *\n * @example Radio group\n * ```html\n * <nys-radiogroup label=\"Select borough\" required>\n * <nys-radiobutton name=\"borough\" value=\"bronx\" label=\"The Bronx\"></nys-radiobutton>\n * <nys-radiobutton name=\"borough\" value=\"brooklyn\" label=\"Brooklyn\"></nys-radiobutton>\n * </nys-radiogroup>\n * ```\n */\n\nexport class NysRadiobutton extends LitElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Whether this radio is selected. Only one per group can be checked. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** Prevents interaction. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Marks group as required. Set on radiogroup, not individual radios. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Visible label text. Required for accessibility. */\n @property({ type: String }) label = \"\";\n\n /** Helper text below label. Use slot for custom HTML. */\n @property({ type: String }) description = \"\";\n\n /** Unique identifier. Auto-generated if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Group name. Radios with same name are mutually exclusive. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Value submitted when this radio is selected. */\n @property({ type: String }) value = \"\";\n\n /** Form `id` to associate with. */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /**\n * Radio size: `sm` (24px) or `md` (32px, default).\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" = \"md\";\n\n /** Renders as tile with larger clickable area. */\n @property({ type: Boolean, reflect: true }) tile = false;\n @property({ type: Boolean, reflect: true }) other = false;\n @property({ type: Boolean }) showOtherError = false;\n\n @state() private isMobile = window.innerWidth < 480;\n\n private _hasUserInteracted = false; // need this flag for \"eager mode\"\n\n static buttonGroup: Record<string, NysRadiobutton> = {};\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n */\n connectedCallback() {\n super.connectedCallback();\n if (!this.id) {\n this.id = `nys-radiobutton-${Date.now()}-${radiobuttonIdCounter++}`;\n }\n\n // If this button is initially checked, set it as the current button in its group\n if (this.checked) {\n if (NysRadiobutton.buttonGroup[this.name]) {\n NysRadiobutton.buttonGroup[this.name].checked = false;\n NysRadiobutton.buttonGroup[this.name].requestUpdate();\n }\n NysRadiobutton.buttonGroup[this.name] = this;\n }\n\n this.addEventListener(\"focus\", this._handleFocus);\n this.addEventListener(\"blur\", this._handleBlur);\n this.addEventListener(\"click\", this._handleChange);\n window.addEventListener(\"resize\", this._handleResize);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"focus\", this._handleFocus);\n this.removeEventListener(\"blur\", this._handleBlur);\n window.removeEventListener(\"resize\", this._handleResize);\n }\n\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n // When \"checked\" changes, update the internals.\n if (changedProperties.has(\"checked\")) {\n const wasChecked = changedProperties.get(\"checked\") as\n | boolean\n | undefined;\n\n // If this radio was unchecked, clear \"other\" error state\n if (wasChecked && !this.checked) {\n this._clearOtherState();\n }\n\n // Ensure only one radiobutton per group is checked.\n if (this.checked && NysRadiobutton.buttonGroup[this.name] !== this) {\n if (NysRadiobutton.buttonGroup[this.name]) {\n NysRadiobutton.buttonGroup[this.name].checked = false;\n NysRadiobutton.buttonGroup[this.name].requestUpdate();\n }\n NysRadiobutton.buttonGroup[this.name] = this;\n }\n }\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n public async getInputElement(): Promise<HTMLInputElement | null> {\n await this.updateComplete; // Wait for the component to finish rendering\n return this.shadowRoot?.querySelector(\"input\") || null;\n }\n\n // This callback is automatically called when the parent form is reset.\n public formResetUpdate() {\n this.checked = false;\n this._clearOtherState();\n\n if (NysRadiobutton.buttonGroup[this.name] === this) {\n delete NysRadiobutton.buttonGroup[this.name];\n }\n\n // Re-render UI\n this.requestUpdate();\n }\n\n private _handleResize = () => {\n this.isMobile = window.innerWidth < 480;\n };\n\n private _clearOtherState() {\n if (!this.other) return;\n\n this.showOtherError = false;\n this._hasUserInteracted = false;\n\n // Optional: clear error at the group level\n this._dispatchClearErrorEvent();\n }\n\n private _dispatchClearErrorEvent() {\n this.dispatchEvent(\n new CustomEvent(\"nys-error-clear\", {\n detail: {\n id: this.id,\n name: this.name,\n type: \"other\",\n },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n private _emitChangeEvent() {\n this.dispatchEvent(\n new CustomEvent(\"nys-change\", {\n detail: {\n id: this.id,\n checked: this.checked,\n name: this.name,\n value: this.value,\n },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _emitOtherInputEvent() {\n this.dispatchEvent(\n new CustomEvent(\"nys-other-input\", {\n detail: {\n id: this.id,\n name: this.name,\n value: this.value,\n },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // Handle radiobutton change event & un-selection of other radio options in group\n private async _handleChange() {\n this.showOtherError = false;\n\n if (!this.checked && !this.disabled) {\n if (NysRadiobutton.buttonGroup[this.name]) {\n NysRadiobutton.buttonGroup[this.name].checked = false;\n NysRadiobutton.buttonGroup[this.name].requestUpdate();\n }\n NysRadiobutton.buttonGroup[this.name] = this;\n\n this.checked = true;\n this._validateOtherAndEmitError();\n this._emitChangeEvent();\n }\n }\n\n // Handle focus event\n private _handleFocus() {\n this.dispatchEvent(\n new Event(\"nys-focus\", { bubbles: true, composed: true }),\n );\n }\n\n // Handle blur event\n private _handleBlur() {\n this.dispatchEvent(\n new Event(\"nys-blur\", { bubbles: true, composed: true }),\n );\n\n setTimeout(() => {\n // Only validate if we're blurring away from the component entirely\n // and this is an \"other\" radio that's checked\n if (this.other && this.checked) {\n this._hasUserInteracted = true;\n this._validateOtherAndEmitError();\n }\n }, 50);\n }\n\n private _callInputHandling() {\n if (this.disabled) return;\n\n // Find the hidden input and trigger a click to toggle selection\n const input = this.shadowRoot?.querySelector(\n 'input[type=\"radio\"]',\n ) as HTMLInputElement;\n\n if (input) {\n input.focus();\n input.click();\n }\n }\n\n private _handleTextInput(event: Event) {\n const input = event.target as HTMLInputElement;\n let newValue = input.value;\n this.value = newValue;\n\n if (this._hasUserInteracted) {\n this._validateOtherAndEmitError();\n }\n\n this._emitOtherInputEvent();\n }\n\n private _handleTextInputBlur() {\n this._hasUserInteracted = true;\n this._validateOtherAndEmitError();\n }\n\n private _validateOtherAndEmitError() {\n if (!this.other) return;\n\n if (!this.checked || !this._hasUserInteracted) {\n this.showOtherError = false;\n return;\n }\n\n const isInvalid = this.value.trim() === \"\";\n this.showOtherError = isInvalid;\n\n if (isInvalid) {\n this.dispatchEvent(\n new CustomEvent(\"nys-error\", {\n detail: {\n id: this.id,\n name: this.name,\n type: \"other\",\n message: \"Please enter a value for this option.\",\n sourceRadio: this,\n },\n bubbles: true,\n composed: true,\n }),\n );\n } else {\n this._dispatchClearErrorEvent();\n }\n }\n\n private _handleOtherKeydown(e: KeyboardEvent) {\n if (e.key == \"Space\" || e.key === \" \") {\n e.stopPropagation();\n }\n }\n\n render() {\n return html`\n <input\n type=\"radio\"\n name=\"${ifDefined(this.name ? this.name : undefined)}\"\n .checked=${this.checked}\n ?disabled=${this.disabled}\n .value=${this.value}\n ?required=\"${this.required}\"\n form=${ifDefined(this.form || undefined)}\n @change=\"${this._handleChange}\"\n aria-hidden=\"true\"\n hidden\n class=\"sr-only\"\n />\n <div\n class=\"nys-radiobutton\"\n @click=\"${this._callInputHandling}\"\n aria-label=${this.label || (this.other ?? \"Other\")}\n >\n <div class=\"nys-radiobutton__main-container\">\n <span class=\"nys-radiobutton__radio\" tabindex=\"0\"></span>\n ${(this.label || this.other) &&\n html`<nys-label\n label=\"${this.label || (this.other ? \"Other\" : \"\")}\"\n description=${ifDefined(this.description || undefined)}\n >\n <slot name=\"description\" slot=\"description\"\n >${this.description}</slot\n >\n </nys-label> `}\n </div>\n <div class=\"nys-radiobutton__other-container\">\n ${this.other && this.checked\n ? html`\n <nys-textinput\n .value=${this.value}\n id=${\"radiobutton-other-\" + this.id}\n @nys-input=${this._handleTextInput}\n @nys-blur=${this._handleTextInputBlur}\n @keydown=${this._handleOtherKeydown}\n @nys-focus=${() => this.classList.remove(\"focused\")}\n ariaLabel=\"Other\"\n aria-invalid=${this.showOtherError ? \"true\" : \"false\"}\n width=${this.isMobile ? \"full\" : \"md\"}\n ></nys-textinput>\n `\n : \"\"}\n </div>\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-radiobutton\")) {\n customElements.define(\"nys-radiobutton\", NysRadiobutton);\n}\n"],"names":["radiogroupIdCounter","_NysRadiogroup","LitElement","changedProperties","radioButton","index","message","firstRadio","radioButtons","radio","checkedRadio","event","radioBtns","currentRadio","increment","target","radios","active","nodes","node","name","value","otherRadio","textInput","form","element","sourceRadio","html","unsafeCSS","styles","NysRadiogroup","__decorateClass","property","state","radiobuttonIdCounter","_NysRadiobutton","_a","input","newValue","isInvalid","e","ifDefined","NysRadiobutton"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,IAAIA,IAAsB;AAyBnB,MAAMC,IAAN,MAAMA,UAAsBC,EAAW;AAAA;AAAA,EA0D5C,cAAc;AACZ,UAAA,GAnDyC,KAAA,KAAK,IAGL,KAAA,OAAO,IAGN,KAAA,WAAW,IAGX,KAAA,WAAW,IAGX,KAAA,YAAY,IAG5B,KAAA,eAAe,IAGf,KAAA,QAAQ,IAGR,KAAA,cAAc,IAGE,KAAA,OAAO,IAGvB,KAAA,UAAU,IAGK,KAAA,OAAsB,MAMtB,KAAA,OAAoB,MAEtD,KAAQ,gBAA+B,MACvC,KAAQ,0BAA0B,IAazC,KAAK,aAAa,KAAK,gBAAA;AAAA,EACzB;AAAA;AAAA,EAGA,oBAAoB;AAClB,UAAM,kBAAA,GACD,KAAK,OACR,KAAK,KAAK,kBAAkB,KAAK,KAAK,IAAI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,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAzC/BG,EAyCiC,WAAA,MAAA;AACAJ,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GA1C/BG,EA0CiC,WAAA,OAAA;AACfJ,EAAA;AAAA,EAA5BC,EAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GA3ChBG,EA2CkB,WAAA,gBAAA;AAEZJ,EAAA;AAAA,EAAhBE,EAAA;AAAM,GA7CIE,EA6CM,WAAA,UAAA;AA7CZ,IAAMO,IAANP;AAiWF,eAAe,IAAI,iBAAiB,KACvC,eAAe,OAAO,mBAAmBO,CAAc;"}
1
+ {"version":3,"file":"nys-radiobutton.js","sources":["../src/nys-radiobutton.ts","../src/nys-radiogroup.ts"],"sourcesContent":["import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property } from \"lit/decorators.js\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-radiobutton.scss?inline\";\n\nlet radiobuttonIdCounter = 0;\n\n/**\n * A radio button for single selection within a `nys-radiogroup`. Only one radio with the same `name` can be selected.\n *\n * Use within `nys-radiogroup` for 2-6 mutually exclusive options. For 7+ options, use `nys-select`.\n * For multiple selections, use `nys-checkbox`.\n *\n * @summary Radio button for single selection from mutually exclusive options. This is a READONLY data component.\n * @element nys-radiobutton\n *\n * @slot description - Custom HTML description content.\n *\n * @fires nys-change - Fired when selection changes. Detail: `{id, checked, name, value}`.\n * @fires nys-focus - Fired when radio gains focus.\n * @fires nys-blur - Fired when radio loses focus.\n * @fires nys-other-input - Fired when \"other\" text input value changes. Detail: `{id, name, value}`.\n *\n * @example Radio group\n * ```html\n * <nys-radiogroup label=\"Select borough\" required>\n * <nys-radiobutton name=\"borough\" value=\"bronx\" label=\"The Bronx\"></nys-radiobutton>\n * <nys-radiobutton name=\"borough\" value=\"brooklyn\" label=\"Brooklyn\"></nys-radiobutton>\n * </nys-radiogroup>\n * ```\n */\n\nexport class NysRadiobutton extends LitElement {\n static styles = unsafeCSS(styles);\n\n /** Whether this radio is selected. Only one per group can be checked. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** Prevents interaction. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Marks group as required. Set on radiogroup, not individual radios. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Visible label text. Required for accessibility. */\n @property({ type: String }) label = \"\";\n\n /** Helper text below label. Use slot for custom HTML. */\n @property({ type: String }) description = \"\";\n\n /** Unique identifier. Auto-generated if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Group name. Radios with same name are mutually exclusive. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Value submitted when this radio is selected. */\n @property({ type: String }) value = \"\";\n\n /** Form `id` to associate with. */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /**\n * Radio size: `sm` (24px) or `md` (32px, default).\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" = \"md\";\n\n /** Renders as tile with larger clickable area. */\n @property({ type: Boolean, reflect: true }) tile = false;\n @property({ type: Boolean, reflect: true }) other = false;\n @property({ type: Boolean }) showOtherError = false;\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n */\n connectedCallback() {\n super.connectedCallback();\n if (!this.id) {\n this.id = `nys-radiobutton-${Date.now()}-${radiobuttonIdCounter++}`;\n }\n }\n\n render() {\n return html``;\n }\n}\n\nif (!customElements.get(\"nys-radiobutton\")) {\n customElements.define(\"nys-radiobutton\", NysRadiobutton);\n}\n","import { LitElement, html, unsafeCSS } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport type { NysRadiobutton } from \"./nys-radiobutton\";\n// @ts-ignore: SCSS module imported via bundler as inline\nimport styles from \"./nys-radiobutton.scss?inline\";\n\nlet radiogroupIdCounter = 0;\n\n/**\n * A container for grouping `nys-radiobutton` elements as a single form control with enforced single selection.\n * Handles keyboard navigation (arrow keys), validation, required constraints, and form integration.\n *\n * Use to let users select exactly one option from 2-6 choices. Apply `tile` and `size` to the group\n * and all children inherit these styles automatically. For 7+ options, use `nys-select`.\n *\n * @summary Container for grouping radio buttons as a single form control.\n * @element nys-radiogroup\n *\n * @slot - Default slot for `nys-radiobutton` elements.\n * @slot description - Custom HTML description content.\n *\n * @example Basic radio group\n * ```html\n * <nys-radiogroup label=\"Select borough\" required>\n * <nys-radiobutton name=\"borough\" value=\"bronx\" label=\"The Bronx\"></nys-radiobutton>\n * <nys-radiobutton name=\"borough\" value=\"brooklyn\" label=\"Brooklyn\"></nys-radiobutton>\n * <nys-radiobutton name=\"borough\" value=\"manhattan\" label=\"Manhattan\"></nys-radiobutton>\n * </nys-radiogroup>\n * ```\n */\n\nexport class NysRadiogroup extends LitElement {\n static styles = unsafeCSS(styles);\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Unique identifier. Auto-generated if not provided. */\n @property({ type: String, reflect: true }) id = \"\";\n\n /** Name for form submission. Auto-populated from child radiobuttons. */\n @property({ type: String, reflect: true }) name = \"\";\n\n /** Requires a selection before form submission. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Shows \"Optional\" flag. */\n @property({ type: Boolean, reflect: true }) optional = false;\n\n /** Shows error message when true. */\n @property({ type: Boolean, reflect: true }) showError = false;\n\n /** Error message text. Shown only when `showError` is true. */\n @property({ type: String }) errorMessage = \"\";\n\n /** Visible label text for the group. */\n @property({ type: String }) label = \"\";\n\n /** Helper text below label. Use slot for custom HTML. */\n @property({ type: String }) description = \"\";\n\n /** Renders all radiobuttons as tiles with larger clickable area. */\n @property({ type: Boolean, reflect: true }) tile = false;\n\n /** Tooltip text shown on hover/focus of info icon. */\n @property({ type: String }) tooltip = \"\";\n\n /** Form `id` to associate with. Applied to all children. */\n @property({ type: String, reflect: true }) form: string | null = null;\n\n /**\n * Radio size for all children: `sm` (24px) or `md` (32px, default).\n * @default \"md\"\n */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" = \"md\";\n @property({ type: Boolean }) _showOtherError = false;\n\n @state() private selectedValue: string | null = null;\n @state() private _slottedDescriptionText = \"\";\n @state() private _radios: NysRadiobutton[] = [];\n\n private _mobileQuery!: MediaQueryList;\n @state() private isMobile = false;\n\n private _hasUserInteracted = false; // need this flag for \"eager mode\"\n\n private _childObserver?: MutationObserver;\n\n private _internals: ElementInternals;\n\n /**\n * Lifecycle methods\n * --------------------------------------------------------------------------\n */\n\n static formAssociated = true; // allows use of elementInternals' API\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n // Generate a unique ID if one is not provided\n connectedCallback() {\n super.connectedCallback();\n if (!this.id) {\n this.id = `nys-radiogroup-${Date.now()}-${radiogroupIdCounter++}`;\n }\n\n this._mobileQuery = window.matchMedia(\"(max-width: 479px)\");\n this.isMobile = this._mobileQuery.matches;\n this._mobileQuery.addEventListener(\"change\", this._handleMobileQuery);\n\n this.addEventListener(\"invalid\", this._handleInvalid);\n\n this._childObserver = new MutationObserver(() => {\n this._radios = this._getAllRadios();\n this.requestUpdate();\n });\n this._childObserver.observe(this, { childList: true });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"invalid\", this._handleInvalid);\n this._mobileQuery.removeEventListener(\"change\", this._handleMobileQuery);\n\n this._childObserver?.disconnect();\n }\n\n async firstUpdated() {\n await this.updateComplete;\n\n this._radios = this._getAllRadios();\n\n this._initializeCheckedRadioValue();\n this._setValue(); // This ensures our element always participates in the form\n this._setRadioButtonRequire();\n this._updateRadioButtonsSize();\n this._getSlotDescriptionForAria();\n this._initializeChildAttributes();\n\n this._updateGroupTabIndex();\n }\n\n updated(changedProperties: Map<string | symbol, unknown>) {\n if (\n changedProperties.has(\"required\") ||\n changedProperties.has(\"selectedValue\")\n ) {\n if (!this.showError) {\n this._manageRequire();\n }\n }\n if (changedProperties.has(\"size\")) {\n this._updateRadioButtonsSize();\n }\n this._updateGroupTabIndex();\n }\n\n /**\n * Form Integration\n * --------------------------------------------------------------------------\n */\n\n private _setValue() {\n this._internals.setFormValue(this.selectedValue);\n }\n\n private _setRadioButtonRequire() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radioButton, index) => {\n if (this.required && index === 0) {\n radioButton.setAttribute(\"required\", \"required\");\n }\n });\n }\n\n private async _manageRequire() {\n const message = this.errorMessage || \"Please select an option.\";\n\n const radioButtons = Array.from(this.querySelectorAll(\"nys-radiobutton\"));\n const firstRadio = radioButtons[0] as HTMLElement;\n\n if (firstRadio) {\n const shadowInput = this.shadowRoot?.querySelector<HTMLElement>(\n `#input-${(firstRadio as NysRadiobutton).id}`,\n );\n if (this.required && !this.selectedValue) {\n this._internals.setValidity(\n { valueMissing: true },\n message,\n shadowInput ?? firstRadio, // pass the custom element, not shadow input\n );\n } else {\n this.showError = false;\n this._internals.setValidity({}, \"\", firstRadio);\n }\n }\n }\n\n checkValidity() {\n const radioButtons = Array.from(this.querySelectorAll(\"nys-radiobutton\"));\n const valid =\n !this.required ||\n radioButtons.some((radio) => (radio as NysRadiobutton).checked);\n return valid;\n }\n\n // Need to account for if radiogroup already have a radiobutton checked at initialization\n private _initializeCheckedRadioValue() {\n const checkedRadio = this.querySelector(\"nys-radiobutton[checked]\");\n if (checkedRadio) {\n this.selectedValue = checkedRadio.getAttribute(\"value\");\n this._internals.setFormValue(this.selectedValue);\n }\n }\n\n // Core Keyboard & Click Logic\n private _getAllRadios() {\n return Array.from(\n this.querySelectorAll(\"nys-radiobutton\"),\n ) as NysRadiobutton[];\n }\n\n // Arrow / Space / Enter navigation at group level\n private async _handleKeyDown(event: KeyboardEvent) {\n const keys = [\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \" \",\n \"Enter\",\n ];\n\n if (!keys.includes(event.key)) return;\n // Prevent arrow left/right from switching to next radiobutton when focus is within \"other\" textinput\n if (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\") {\n const inTextInput = event\n .composedPath()\n .some((el) => (el as HTMLElement).tagName === \"NYS-TEXTINPUT\");\n if (inTextInput) return;\n }\n\n event.preventDefault();\n\n const radioBtns = this._getAllRadios().filter((radio) => !radio.disabled);\n const focusedInput = event.target as HTMLElement;\n const currentRadio =\n radioBtns.find(\n (radio) =>\n this.shadowRoot?.querySelector(`#input-${radio.id}`) === focusedInput,\n ) ||\n radioBtns.find((radio) => radio.checked) ||\n radioBtns[0];\n\n let increment = 0;\n if ([\"ArrowUp\", \"ArrowLeft\"].includes(event.key)) {\n increment = -1;\n } else if ([\"ArrowDown\", \"ArrowRight\"].includes(event.key)) {\n increment = 1;\n }\n\n let index = radioBtns.indexOf(currentRadio) + increment;\n\n // Handles the wrap around ends if user is at first or last radiobutton\n if (index < 0) {\n index = radioBtns.length - 1;\n }\n if (index >= radioBtns.length) {\n index = 0;\n }\n\n const target = radioBtns[index];\n\n this._selectRadio(target);\n await this.updateComplete;\n this._updateGroupTabIndex();\n this.shadowRoot?.querySelector<HTMLElement>(`#input-${target.id}`)?.focus();\n }\n\n private _updateGroupTabIndex() {\n const radios = this._getAllRadios();\n\n // Pick active: look for what's selected first, otherwise choose the first enabled radiobutton\n const active =\n radios.find((radio) => radio.checked && !radio.disabled) ||\n radios.find((radio) => !radio.disabled);\n\n radios.forEach((radio) => {\n const input = this.shadowRoot?.querySelector(\n `#input-${radio.id}`,\n ) as HTMLInputElement;\n\n // Only one radiobutton can be focusable at all times.\n // Due to this, we calculate logic to determine an active radiobutton and call all other as tabindex=\"-1\"\n if (input) {\n input.tabIndex = radio === active ? 0 : -1;\n }\n });\n }\n\n // This callback is automatically called when the parent form is reset.\n public formResetCallback() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radio) => {\n (radio as NysRadiobutton).checked = false;\n });\n\n this.selectedValue = null;\n this._internals.setFormValue(null);\n this.showError = false;\n this.errorMessage = \"\";\n this._internals.setValidity({});\n this._hasUserInteracted = false;\n this.requestUpdate();\n }\n\n /**\n * Functions\n * --------------------------------------------------------------------------\n */\n\n private _handleMobileQuery = () => {\n this.isMobile = this._mobileQuery.matches;\n };\n\n private _handleSlotChange() {\n this._radios = Array.from(this.querySelectorAll(\"nys-radiobutton\"));\n this.requestUpdate();\n }\n\n // Apply ARIA & initial tabindex to each child radio\n private _initializeChildAttributes() {\n const radios = this._getAllRadios();\n radios.forEach((radio) => {\n if (radio.getAttribute(\"tabindex\") !== \"-1\") {\n radio.setAttribute(\"tabindex\", \"-1\");\n }\n });\n }\n\n private _updateRadioButtonsSize() {\n const radioButtons = this.querySelectorAll(\"nys-radiobutton\");\n radioButtons.forEach((radioButton) => {\n if (radioButton.getAttribute(\"size\") !== this.size) {\n radioButton.setAttribute(\"size\", this.size);\n }\n });\n }\n\n private _selectRadio(radiobtn: NysRadiobutton) {\n if (radiobtn.checked || radiobtn.disabled) return;\n\n const radios = this._getAllRadios();\n radios.forEach((radio) => {\n radio.checked = false;\n });\n\n radiobtn.checked = true;\n\n this._showOtherError = false;\n this._hasUserInteracted = false;\n\n this.name = radiobtn.name;\n this.selectedValue = radiobtn.value;\n this._internals.setFormValue(this.selectedValue);\n this._internals.setValidity({});\n this.showError = false;\n\n this._updateGroupTabIndex();\n this.requestUpdate();\n\n this.dispatchEvent(\n new CustomEvent(\"nys-change\", {\n detail: {\n id: radiobtn.id,\n checked: radiobtn.checked,\n name: radiobtn.name,\n value: radiobtn.value,\n },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n // Get the slotted text contents so native VO can attempt to announce it within the legend in the fieldset\n private _getSlotDescriptionForAria() {\n const slot = this.shadowRoot?.querySelector(\n 'slot[name=\"description\"]',\n ) as HTMLSlotElement;\n const nodes = slot?.assignedNodes({ flatten: true }) || [];\n\n this._slottedDescriptionText = nodes\n .map((node) => node.textContent?.trim())\n .filter(Boolean)\n .join(\", \");\n }\n\n /**\n * Event Handlers\n * --------------------------------------------------------------------------\n */\n\n private async _handleInvalid(event: Event) {\n event.preventDefault();\n\n const radios = this._getAllRadios();\n const otherRadio = radios.find((radio) => radio.other && radio.checked);\n\n if (otherRadio && otherRadio.value.trim() === \"\") {\n this.showError = true;\n this._hasUserInteracted = true;\n this._validateOtherAndEmitError(otherRadio);\n\n await this.updateComplete;\n const textInput = this.shadowRoot?.querySelector(\"nys-textinput\");\n\n if (textInput) {\n await (textInput as any).updateComplete;\n (textInput as HTMLElement).focus();\n return;\n }\n }\n\n // Check if the radio group is invalid and set `showError` accordingly\n this.showError = true;\n await this._manageRequire(); // Refresh validation message\n\n const firstEnabledRadio = this._getAllRadios().find(\n (radio) => !radio.disabled,\n );\n if (firstEnabledRadio) {\n const focusFirstInput = () => {\n this.shadowRoot\n ?.querySelector<HTMLElement>(`#input-${firstEnabledRadio.id}`)\n ?.focus();\n };\n\n // Focus only if this is the first invalid element (top-down approach)\n const form = this._internals.form;\n if (form) {\n const elements = Array.from(form.elements) as Array<\n HTMLElement & { checkValidity?: () => boolean }\n >;\n\n // Find the first element in the form that is invalid\n const firstInvalidElement = elements.find(\n (element) =>\n typeof element.checkValidity === \"function\" &&\n !element.checkValidity(),\n );\n if (firstInvalidElement === this) {\n focusFirstInput();\n }\n } else {\n // If not part of a form, simply focus.\n focusFirstInput();\n }\n }\n }\n\n private _handleTextInput(radiobtn: NysRadiobutton, event: Event) {\n const input = event.target as HTMLInputElement;\n radiobtn.value = input.value;\n this.selectedValue = input.value;\n this._internals.setFormValue(input.value);\n\n if (this._hasUserInteracted) {\n this._validateOtherAndEmitError(radiobtn);\n }\n\n this.dispatchEvent(\n new CustomEvent(\"nys-other-input\", {\n detail: { id: radiobtn.id, name: radiobtn.name, value: radiobtn.value },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _handleTextInputBlur(radiobtn: NysRadiobutton) {\n this._hasUserInteracted = true;\n this._validateOtherAndEmitError(radiobtn);\n }\n\n private _validateOtherAndEmitError(radiobtn: NysRadiobutton) {\n if (!radiobtn.other) return;\n\n if (!radiobtn.checked || !this._hasUserInteracted) {\n this._showOtherError = false;\n return;\n }\n\n const isInvalid = radiobtn.value.trim() === \"\";\n this._showOtherError = isInvalid;\n const shadowInput = this.shadowRoot?.querySelector<HTMLElement>(\n `#input-${radiobtn.id}`,\n );\n\n if (isInvalid) {\n this._internals.setValidity(\n {\n customError: true,\n },\n \"Please enter a value for this option.\",\n shadowInput ?? (radiobtn as HTMLElement),\n );\n this.showError = true;\n } else {\n this._internals.setValidity({});\n this.showError = false;\n }\n }\n\n private _handleOtherKeydown(e: KeyboardEvent) {\n if (e.key == \"Space\" || e.key === \" \") {\n e.stopPropagation();\n }\n }\n\n private _handleGroupFocusout(event: FocusEvent) {\n const relatedTarget = event.relatedTarget as Node | null;\n if (relatedTarget && this.shadowRoot?.contains(relatedTarget)) return;\n\n const otherRadio = this._getAllRadios().find(\n (radio) => radio.other && radio.checked,\n );\n if (otherRadio && otherRadio.value.trim() === \"\") {\n this._hasUserInteracted = true;\n this._validateOtherAndEmitError(otherRadio);\n }\n }\n\n private _handleRadiobtnClick = (radiobtn: NysRadiobutton) => {\n if (!radiobtn.disabled) {\n this.shadowRoot\n ?.querySelector<HTMLInputElement>(`#input-${radiobtn.id}`)\n ?.click();\n }\n };\n\n private _handleRadiobtnFocus(radiobtn: NysRadiobutton) {\n radiobtn.dispatchEvent(\n new CustomEvent(\"nys-focus\", { bubbles: true, composed: true }),\n );\n }\n\n private _handleRadiobtnBlur(radiobtn: NysRadiobutton) {\n radiobtn.dispatchEvent(\n new CustomEvent(\"nys-blur\", { bubbles: true, composed: true }),\n );\n }\n\n render() {\n return html` <slot\n style=\"display:none\"\n @slotchange=${this._handleSlotChange}\n ></slot>\n <fieldset\n aria-label=\"${this.label}${this._slottedDescriptionText\n ? ` ${this._slottedDescriptionText}`\n : this.description\n ? ` ${this.description}`\n : \"\"}\"\n role=\"radiogroup\"\n aria-required=${this.required ? \"true\" : \"false\"}\n class=\"nys-radiogroup\"\n @focusout=${this._handleGroupFocusout}\n >\n <legend>\n <nys-label\n label=${this.label}\n description=${this.description}\n flag=${this.required ? \"required\" : this.optional ? \"optional\" : \"\"}\n tooltip=${this.tooltip}\n >\n <slot name=\"description\" slot=\"description\"\n >${this.description}</slot\n >\n </nys-label>\n </legend>\n <div class=\"nys-radiogroup__content\" @keydown=${this._handleKeyDown}>\n ${this._radios.map(\n (radiobtn, index) => html`\n <div\n class=\"nys-radiobutton\"\n @click=${() => this._handleRadiobtnClick(radiobtn)}\n >\n <div class=\"nys-radiobutton__main-container\">\n <!-- <span class=\"nys-radiobutton__radio\" tabindex=\"-1\"></span> -->\n <input\n id=\"input-${radiobtn.id}\"\n type=\"radio\"\n class=\"nys-radiobutton__radio\"\n name=\"${ifDefined(radiobtn.name || undefined)}\"\n .checked=${radiobtn.checked}\n ?disabled=${radiobtn.disabled}\n .value=${radiobtn.value}\n ?required=${this.required && index === 0}\n form=${ifDefined(radiobtn.form || undefined)}\n aria-label=\"${radiobtn.label ||\n (radiobtn.other ? \"Other\" : \"\")}\"\n @change=${() => this._selectRadio(radiobtn)}\n @focus=${() => this._handleRadiobtnFocus(radiobtn)}\n @blur=${() => this._handleRadiobtnBlur(radiobtn)}\n />\n ${(radiobtn.label || radiobtn.other) &&\n html`<nys-label\n aria-hidden=\"true\"\n id=\"${radiobtn.id}-label\"\n label=\"${radiobtn.label || (radiobtn.other ? \"Other\" : \"\")}\"\n description=${ifDefined(radiobtn.description || undefined)}\n >\n <slot name=\"description\" slot=\"description\"\n >${radiobtn.description}</slot\n >\n </nys-label> `}\n </div>\n <div class=\"nys-radiobutton__other-container\">\n ${radiobtn.other && radiobtn.checked\n ? html`\n <nys-textinput\n .value=${radiobtn.value}\n id=${\"radiobutton-other-\" + radiobtn.id}\n @nys-input=${(e: Event) =>\n this._handleTextInput(radiobtn, e)}\n @nys-blur=${() => this._handleTextInputBlur(radiobtn)}\n @keydown=${this._handleOtherKeydown}\n @nys-focus=${() =>\n radiobtn.classList.remove(\"focused\")}\n ariaLabel=\"Other\"\n aria-invalid=${radiobtn.showOtherError\n ? \"true\"\n : \"false\"}\n width=${this.isMobile ? \"full\" : \"md\"}\n ?disabled=${radiobtn.disabled}\n ></nys-textinput>\n `\n : \"\"}\n </div>\n </div>\n `,\n )}\n </div>\n <nys-errormessage\n ?showError=${this.showError}\n errorMessage=${this._internals.validationMessage || this.errorMessage}\n .showDivider=${!this.tile}\n ></nys-errormessage>\n </fieldset>`;\n }\n}\n\nif (!customElements.get(\"nys-radiogroup\")) {\n customElements.define(\"nys-radiogroup\", NysRadiogroup);\n}\n"],"names":["radiobuttonIdCounter","_NysRadiobutton","LitElement","html","unsafeCSS","styles","NysRadiobutton","__decorateClass","property","radiogroupIdCounter","_NysRadiogroup","radiobtn","changedProperties","radioButton","index","message","firstRadio","shadowInput","radioButtons","radio","checkedRadio","event","el","radioBtns","focusedInput","currentRadio","increment","target","radios","active","input","nodes","node","otherRadio","textInput","firstEnabledRadio","focusFirstInput","form","element","isInvalid","e","relatedTarget","ifDefined","NysRadiogroup","state"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,IAAIA,IAAuB;AA2BpB,MAAMC,IAAN,MAAMA,UAAuBC,EAAW;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA,GAIuC,KAAA,UAAU,IAGV,KAAA,WAAW,IAGX,KAAA,WAAW,IAG3B,KAAA,QAAQ,IAGR,KAAA,cAAc,IAGC,KAAA,KAAK,IAGL,KAAA,OAAO,IAGtB,KAAA,QAAQ,IAGO,KAAA,OAAsB,MAMtB,KAAA,OAAoB,MAGnB,KAAA,OAAO,IACP,KAAA,QAAQ,IACvB,KAAA,iBAAiB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9C,oBAAoB;AAClB,UAAM,kBAAA,GACD,KAAK,OACR,KAAK,KAAK,mBAAmB,KAAK,KAAK,IAAIF,GAAsB;AAAA,EAErE;AAAA,EAEA,SAAS;AACP,WAAOG;AAAA,EACT;AACF;AA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AA;AAAA,EAAhBqC,EAAA;AAAM,GApDID,EAoDM,WAAA,UAAA;AA8jBd,eAAe,IAAI,gBAAgB,KACtC,eAAe,OAAO,kBAAkBA,CAAa;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/nys-radiobutton",
3
- "version": "1.18.1",
3
+ "version": "1.19.0",
4
4
  "description": "The Radiobutton component from the NYS Design System.",
5
5
  "module": "dist/nys-radiobutton.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "lit-analyze": "lit-analyzer '**/*.ts'"
24
24
  },
25
25
  "dependencies": {
26
- "@nysds/nys-label": "^1.18.1",
27
- "@nysds/nys-errormessage": "^1.18.1"
26
+ "@nysds/nys-label": "^1.19.0",
27
+ "@nysds/nys-errormessage": "^1.19.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "lit": "^3.3.1",