@nysds/components 1.13.0 → 1.14.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.
Files changed (63) hide show
  1. package/custom-elements.json +10932 -0
  2. package/dist/.vscode/vscode.css-custom-data.json +62 -1
  3. package/dist/.vscode/vscode.html-custom-data.json +1346 -295
  4. package/dist/custom-elements.json +1251 -198
  5. package/dist/nys-stepper/newsletter.html +4 -0
  6. package/dist/nys-stepper/personal.html +6 -0
  7. package/dist/nys-stepper/survey.html +5 -0
  8. package/dist/nys-stepper/team.html +6 -0
  9. package/dist/nysds.es.js +2024 -1650
  10. package/dist/nysds.es.js.map +1 -1
  11. package/dist/nysds.js +189 -126
  12. package/dist/nysds.js.map +1 -1
  13. package/dist/packages/mcp-server/src/index.d.ts +8 -0
  14. package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +95 -0
  15. package/dist/packages/mcp-server/src/lib/search.d.ts +19 -0
  16. package/dist/packages/mcp-server/src/lib/token-parser.d.ts +139 -0
  17. package/dist/packages/mcp-server/src/prompts/nysds-mode.d.ts +7 -0
  18. package/dist/packages/mcp-server/src/resources/components.d.ts +11 -0
  19. package/dist/packages/mcp-server/src/resources/guides.d.ts +10 -0
  20. package/dist/packages/mcp-server/src/resources/index.d.ts +7 -0
  21. package/dist/packages/mcp-server/src/resources/tokens.d.ts +16 -0
  22. package/dist/packages/mcp-server/src/server.d.ts +10 -0
  23. package/dist/packages/mcp-server/src/tools/component-tools.d.ts +13 -0
  24. package/dist/packages/mcp-server/src/tools/index.d.ts +7 -0
  25. package/dist/packages/mcp-server/src/tools/token-tools.d.ts +16 -0
  26. package/dist/packages/mcp-server/src/tools/validation-tools.d.ts +11 -0
  27. package/dist/packages/nys-accordion/src/nys-accordion.d.ts +29 -8
  28. package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +19 -7
  29. package/dist/packages/nys-alert/src/nys-alert.d.ts +32 -9
  30. package/dist/packages/nys-avatar/src/nys-avatar.d.ts +26 -7
  31. package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +17 -7
  32. package/dist/packages/nys-badge/src/nys-badge.d.ts +30 -4
  33. package/dist/packages/nys-button/src/nys-button.d.ts +126 -9
  34. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +53 -11
  35. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +40 -12
  36. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +65 -7
  37. package/dist/packages/nys-divider/src/nys-divider.d.ts +20 -2
  38. package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +10 -3
  39. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +37 -11
  40. package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +16 -2
  41. package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +16 -7
  42. package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +16 -10
  43. package/dist/packages/nys-icon/src/nys-icon.d.ts +25 -3
  44. package/dist/packages/nys-label/src/nys-label.d.ts +20 -3
  45. package/dist/packages/nys-modal/src/nys-modal.d.ts +30 -7
  46. package/dist/packages/nys-pagination/src/nys-pagination.d.ts +17 -5
  47. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +45 -13
  48. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +34 -8
  49. package/dist/packages/nys-select/src/nys-option.d.ts +24 -0
  50. package/dist/packages/nys-select/src/nys-select.d.ts +48 -12
  51. package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +19 -6
  52. package/dist/packages/nys-stepper/src/index.d.ts +2 -0
  53. package/dist/packages/nys-stepper/src/nys-step.d.ts +37 -0
  54. package/dist/packages/nys-stepper/src/nys-stepper.d.ts +48 -0
  55. package/dist/packages/nys-stepper/src/nys-stepper.figma.d.ts +1 -0
  56. package/dist/packages/nys-table/src/nys-table.d.ts +2 -1
  57. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +51 -8
  58. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +67 -9
  59. package/dist/packages/nys-toggle/src/nys-toggle.d.ts +35 -6
  60. package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +24 -11
  61. package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +12 -5
  62. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +25 -7
  63. package/package.json +31 -25
@@ -1,36 +1,72 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-select>` is a custom select/dropdown component.
3
+ * A dropdown for selecting a single option from a list. Supports native `<option>` and `<optgroup>` elements.
4
+ * Form-associated with validation via ElementInternals.
4
5
  *
5
- * Features:
6
- * - Supports slotted `<nys-option>` elements, native `<option>` and `<optgroup>`
7
- * - Integrates with forms via ElementInternals
8
- * - Handles validation, error messages, and required/optional states
9
- * - Inverted style and width variants supported
6
+ * Use when users must choose one option from 7+ items. For fewer options, consider `nys-radiobutton`.
7
+ * For multiple selections, use `nys-checkbox` group instead.
10
8
  *
11
- * @slot description - Optional description text announced to screen readers
12
- * @slot default - Options (<nys-option>, <option>, <optgroup>) to populate the dropdown
9
+ * @summary Dropdown select for choosing one option from a list.
10
+ * @element nys-select
13
11
  *
14
- * @fires nys-change - Fired when the selected value changes
15
- * detail: { id: string, value: string }
16
- * @fires nys-focus - Fired when the select gains focus
17
- * @fires nys-blur - Fired when the select loses focus
12
+ * @slot - Default slot for `<option>` and `<optgroup>` elements.
13
+ * @slot description - Custom HTML description content below the label.
14
+ *
15
+ * @fires nys-change - Fired when selection changes. Detail: `{id, value}`.
16
+ * @fires nys-focus - Fired when select gains focus.
17
+ * @fires nys-blur - Fired when select loses focus. Triggers validation.
18
+ *
19
+ * @example Basic select
20
+ * ```html
21
+ * <nys-select label="Select borough">
22
+ * <option value="bronx">The Bronx</option>
23
+ * <option value="brooklyn">Brooklyn</option>
24
+ * <option value="manhattan">Manhattan</option>
25
+ * </nys-select>
26
+ * ```
27
+ *
28
+ * @example With option groups
29
+ * ```html
30
+ * <nys-select label="Select service">
31
+ * <optgroup label="Transportation">
32
+ * <option value="mta">MTA</option>
33
+ * <option value="dmv">DMV</option>
34
+ * </optgroup>
35
+ * </nys-select>
36
+ * ```
18
37
  */
19
38
  export declare class NysSelect extends LitElement {
20
39
  static styles: import("lit").CSSResult;
40
+ /** Unique identifier. Auto-generated if not provided. */
21
41
  id: string;
42
+ /** Name for form submission. */
22
43
  name: string;
44
+ /** Visible label text. Required for accessibility. */
23
45
  label: string;
46
+ /** Helper text below label. Use slot for custom HTML. */
24
47
  description: string;
48
+ /** Currently selected option value. */
25
49
  value: string;
50
+ /** Prevents interaction. */
26
51
  disabled: boolean;
52
+ /** Marks as required. Shows "Required" flag and validates on blur. */
27
53
  required: boolean;
54
+ /** Shows "Optional" flag. Use when most fields are required. */
28
55
  optional: boolean;
56
+ /** Tooltip text shown on hover/focus of info icon. */
29
57
  tooltip: string;
58
+ /** Form `id` to associate with when select is outside form element. */
30
59
  form: string | null;
60
+ /** Adjusts colors for dark backgrounds. */
31
61
  inverted: boolean;
62
+ /** Shows error message when true. Set by validation or manually. */
32
63
  showError: boolean;
64
+ /** Error message text. Shown only when `showError` is true. */
33
65
  errorMessage: string;
66
+ /**
67
+ * Select width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).
68
+ * @default "full"
69
+ */
34
70
  width: "sm" | "md" | "lg" | "full";
35
71
  private _originalErrorMessage;
36
72
  private _hasUserInteracted;
@@ -1,16 +1,29 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-skipnav>` provides an accessible skip navigation link for keyboard
4
- * and screen reader users to jump directly to the main content of a page.
3
+ * An accessible "Skip to main content" link for keyboard and screen reader users. Visually hidden until focused.
5
4
  *
6
- * Features:
7
- * - Default target is `#main-content` if `href` is not provided
8
- * - Link becomes visible on focus and hides on blur
9
- * - Ensures the target element is focusable for accessibility
5
+ * Place as the first focusable element in the document. Links to `#main-content` by default, or specify `href`
6
+ * for a custom target. The target element receives focus when activated for proper screen reader announcement.
7
+ *
8
+ * @summary Skip navigation link for keyboard accessibility. Hidden until focused.
9
+ * @element nys-skipnav
10
+ *
11
+ * @example Default skip link
12
+ * ```html
13
+ * <nys-skipnav></nys-skipnav>
14
+ * <main id="main-content">...</main>
15
+ * ```
16
+ *
17
+ * @example Custom target
18
+ * ```html
19
+ * <nys-skipnav href="#content-area"></nys-skipnav>
20
+ * ```
10
21
  */
11
22
  export declare class NysSkipnav extends LitElement {
12
23
  static styles: import("lit").CSSResult;
24
+ /** Unique identifier. Auto-generated if not provided. */
13
25
  id: string;
26
+ /** Target element ID (with `#`). Defaults to `#main-content`. */
14
27
  href: string;
15
28
  constructor();
16
29
  connectedCallback(): void;
@@ -0,0 +1,2 @@
1
+ export * from "./nys-stepper";
2
+ export * from "./nys-step";
@@ -0,0 +1,37 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * A single step within `nys-stepper`. Represents one stage in a multi-step process.
4
+ *
5
+ * Mark as `current` to indicate active progress point. Previous steps become clickable for navigation.
6
+ * Set `href` for page-based navigation or listen to `nys-step-click` for SPA routing.
7
+ *
8
+ * @summary Individual step for use within nys-stepper with navigation support.
9
+ * @element nys-step
10
+ *
11
+ * @fires nys-step-click - Fired when a navigable step is clicked. Detail: `{href, label}`. Cancelable.
12
+ *
13
+ * @example Step with navigation
14
+ * ```html
15
+ * <nys-step label="Personal Info" href="/step-1"></nys-step>
16
+ * ```
17
+ */
18
+ export declare class NysStep extends LitElement {
19
+ static styles: import("lit").CSSResult;
20
+ /** Whether this step is currently being viewed. Set by parent stepper. */
21
+ selected: boolean;
22
+ /** Marks the furthest reached step. Steps before this are navigable. */
23
+ current: boolean;
24
+ /** Step label text displayed alongside the step number. */
25
+ label: string;
26
+ /** URL for page navigation when step is clicked. Optional for SPA routing. */
27
+ href: string;
28
+ /** Internal: Whether parent stepper's compact view is expanded. */
29
+ isCompactExpanded: boolean;
30
+ /** Custom click handler. Called before `nys-step-click` event. */
31
+ onClick?: (e: Event) => void;
32
+ /** Step number (1-indexed). Auto-assigned by parent stepper. */
33
+ stepNumber: number;
34
+ private _handleActivate;
35
+ private _handleKeydown;
36
+ render(): import("lit-html").TemplateResult<1>;
37
+ }
@@ -0,0 +1,48 @@
1
+ import { LitElement } from "lit";
2
+ import "./nys-step";
3
+ /**
4
+ * A multi-step progress indicator for forms or wizards. Manages `nys-step` children with selection and navigation.
5
+ *
6
+ * Add `nys-step` elements as children. Mark one step as `current` to indicate progress; previous steps become
7
+ * navigable. Compact view on mobile expands to show all steps. Use `actions` slot for navigation buttons.
8
+ *
9
+ * @summary Multi-step progress indicator with navigation and mobile-friendly compact view.
10
+ * @element nys-stepper
11
+ *
12
+ * @slot - Default slot for `nys-step` elements.
13
+ * @slot actions - Navigation buttons (e.g., Back, Continue). Must be wrapped in a `<div>`.
14
+ *
15
+ * @example Basic stepper
16
+ * ```html
17
+ * <nys-stepper label="Application Progress">
18
+ * <nys-step label="Personal Info" current></nys-step>
19
+ * <nys-step label="Contact Details"></nys-step>
20
+ * <nys-step label="Review"></nys-step>
21
+ * </nys-stepper>
22
+ * ```
23
+ */
24
+ export declare class NysStepper extends LitElement {
25
+ static styles: import("lit").CSSResult;
26
+ /** Unique identifier. */
27
+ id: string;
28
+ /** Name attribute for form association. */
29
+ name: string;
30
+ /** Title displayed above the step counter. */
31
+ label: string;
32
+ /** Progress text (e.g., "Step 2 of 5"). Auto-updated based on selection. */
33
+ counterText: string;
34
+ /** Whether compact mobile view is expanded to show all steps. */
35
+ isCompactExpanded: boolean;
36
+ private _stepsNumbered;
37
+ constructor();
38
+ connectedCallback(): void;
39
+ disconnectedCallback(): void;
40
+ private _validateSteps;
41
+ private _validateButtonSlot;
42
+ private _onStepClick;
43
+ private _updateCounter;
44
+ willUpdate(): void;
45
+ private _toggleCompact;
46
+ private _handleCounterKeydown;
47
+ render(): import("lit-html").TemplateResult<1>;
48
+ }
@@ -26,7 +26,8 @@ export declare class NysTable extends LitElement {
26
26
  /******************** Functions ********************/
27
27
  firstUpdated(): void;
28
28
  _handleSlotChange(): void;
29
- _normalizeTable(table: HTMLTableElement): void;
29
+ _normalizeTableDOM(table: HTMLTableElement): void;
30
+ willUpdate(): void;
30
31
  _addSortIcons(table: HTMLTableElement): void;
31
32
  _updateSortIcons(table: HTMLTableElement): void;
32
33
  _onSortClick(columnIndex: number, table: HTMLTableElement): void;
@@ -1,36 +1,79 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-textarea>` is a form-enabled textarea with validation, accessibility support,
4
- * and live error messages. Integrates with forms via ElementInternals.
3
+ * A multi-line text input for collecting longer responses like comments, descriptions, or feedback.
4
+ * Form-associated with validation support via ElementInternals.
5
5
  *
6
- * @slot description - Optional slot for custom description content below the label.
6
+ * Use for detailed responses needing multiple lines. For single-line input, use `nys-textinput`.
7
+ * For predefined options, use `nys-select`, `nys-radiobutton`, or `nys-checkbox`.
7
8
  *
8
- * @fires nys-input - Fired on input, detail: `{ id, value }`
9
- * @fires nys-focus - Fired on focus.
10
- * @fires nys-blur - Fired on blur.
11
- * @fires nys-select - Fired on text selection, detail: `{ id, value }`
12
- * @fires nys-selectionchange - Fired on selection change, detail: `{ id, value }`
9
+ * @summary Multi-line text input for comments, descriptions, and feedback.
10
+ * @element nys-textarea
11
+ *
12
+ * @slot description - Custom HTML description content below the label.
13
+ *
14
+ * @fires nys-input - Fired on input change. Detail: `{id, value}`.
15
+ * @fires nys-focus - Fired when textarea gains focus.
16
+ * @fires nys-blur - Fired when textarea loses focus. Triggers validation.
17
+ * @fires nys-select - Fired when user selects text. Detail: `{id, value}`.
18
+ *
19
+ * @example Basic textarea
20
+ * ```html
21
+ * <nys-textarea label="Comments" rows="4"></nys-textarea>
22
+ * ```
23
+ *
24
+ * @example Required with description
25
+ * ```html
26
+ * <nys-textarea label="Describe the incident" description="Please provide details" required></nys-textarea>
27
+ * ```
13
28
  */
14
29
  export declare class NysTextarea extends LitElement {
15
30
  static styles: import("lit").CSSResult;
31
+ /** Unique identifier. Auto-generated if not provided. */
16
32
  id: string;
33
+ /** Name for form submission. */
17
34
  name: string;
35
+ /** Visible label text. Required for accessibility. */
18
36
  label: string;
37
+ /** Helper text below label. Use slot for custom HTML. */
19
38
  description: string;
39
+ /** Placeholder text. Don't use as label replacement. */
20
40
  placeholder: string;
41
+ /** Current textarea value. */
21
42
  value: string;
43
+ /** Prevents interaction. */
22
44
  disabled: boolean;
45
+ /** Makes textarea read-only but focusable. */
23
46
  readonly: boolean;
47
+ /** Marks as required. Shows "Required" flag and validates on blur. */
24
48
  required: boolean;
49
+ /** Shows "Optional" flag. Use when most fields are required. */
25
50
  optional: boolean;
51
+ /** Tooltip text shown on hover/focus of info icon. */
26
52
  tooltip: string;
53
+ /** Adjusts colors for dark backgrounds. */
27
54
  inverted: boolean;
55
+ /** Form `id` to associate with when textarea is outside form element. */
28
56
  form: string | null;
57
+ /** Maximum character length. */
29
58
  maxlength: number | null;
59
+ /**
60
+ * Textarea width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).
61
+ * @default "full"
62
+ */
30
63
  width: "sm" | "md" | "lg" | "full";
64
+ /**
65
+ * Visible height in lines.
66
+ * @default 4
67
+ */
31
68
  rows: number;
69
+ /**
70
+ * Resize behavior: `vertical` (default, user can resize height), `none` (fixed size).
71
+ * @default "vertical"
72
+ */
32
73
  resize: "vertical" | "none";
74
+ /** Shows error message when true. Set by validation or manually. */
33
75
  showError: boolean;
76
+ /** Error message text. Shown only when `showError` is true. */
34
77
  errorMessage: string;
35
78
  updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
36
79
  private _hasUserInteracted;
@@ -1,40 +1,97 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-textinput>` is a form-enabled text input with validation, optional
4
- * masking, password toggle, accessibility support, and live error messages.
5
- * Works with forms via ElementInternals.
3
+ * A text input for collecting short, single-line data. Supports validation, input masking (tel),
4
+ * password visibility toggle, and live error messaging. Form-associated via ElementInternals.
6
5
  *
7
- * @slot description - Optional custom description content below the label.
8
- * @slot startButton - Slot for a single <nys-button> at the start of the input.
9
- * @slot endButton - Slot for a single <nys-button> at the end of the input.
6
+ * Use for names, emails, passwords, phone numbers. For multi-line input, use `nys-textarea` instead.
7
+ * For predefined options, use `nys-select`, `nys-radiobutton`, or `nys-checkbox`.
10
8
  *
11
- * @fires nys-input - Fired on input change. Detail: `{ id, value }`.
12
- * @fires nys-focus - Fired when input receives focus.
13
- * @fires nys-blur - Fired when input loses focus.
9
+ * @summary Text input for short single-line data with validation and masking support.
10
+ * @element nys-textinput
11
+ *
12
+ * @slot description - Custom HTML description content below the label.
13
+ * @slot startButton - Button at input start. Use single `nys-button` only.
14
+ * @slot endButton - Button at input end. Use single `nys-button` only.
15
+ *
16
+ * @fires nys-input - Fired on input change. Detail: `{id, value}`.
17
+ * @fires nys-focus - Fired when input gains focus.
18
+ * @fires nys-blur - Fired when input loses focus. Triggers validation.
19
+ *
20
+ * @example Basic text input
21
+ * ```html
22
+ * <nys-textinput label="Full Name" required></nys-textinput>
23
+ * ```
24
+ *
25
+ * @example Required Email
26
+ * ```html
27
+ * <nys-textinput type="email" label="Email Address" required></nys-textinput>
28
+ * ```
29
+ *
30
+ * @example Phone with masking
31
+ * ```html
32
+ * <nys-textinput type="tel" label="Phone Number"></nys-textinput>
33
+ * ```
34
+ *
35
+ * @example Search with button
36
+ * ```html
37
+ * <nys-textinput type="search" placeholder="Search">
38
+ * <nys-button slot="endButton" label="Search" prefixIcon="search"></nys-button>
39
+ * </nys-textinput>
40
+ * ```
14
41
  */
15
42
  export declare class NysTextinput extends LitElement {
16
43
  static styles: import("lit").CSSResult;
44
+ /** Unique identifier. Auto-generated if not provided. */
17
45
  id: string;
46
+ /** Name for form submission. */
18
47
  name: string;
48
+ /**
49
+ * Input type: `text` (default), `email`, `number`, `password`, `search`, `tel` (auto-masked), `url`.
50
+ * @default "text"
51
+ */
19
52
  type: "email" | "number" | "password" | "search" | "tel" | "text" | "url";
53
+ /** Visible label text. Required for accessibility. */
20
54
  label: string;
55
+ /** Helper text below label. Use slot for custom HTML. */
21
56
  description: string;
57
+ /** Placeholder text. Don't use as label replacement. */
22
58
  placeholder: string;
59
+ /** Current input value. */
23
60
  value: string;
61
+ /** Prevents interaction. */
24
62
  disabled: boolean;
63
+ /** Makes input read-only but focusable. */
25
64
  readonly: boolean;
65
+ /** Marks as required. Shows "Required" flag and validates on blur. */
26
66
  required: boolean;
67
+ /** Shows "Optional" flag. Use when most fields are required. */
27
68
  optional: boolean;
69
+ /** Tooltip text shown on hover/focus of info icon. */
28
70
  tooltip: string;
71
+ /** Form `id` to associate with when input is outside form element. */
29
72
  form: string | null;
73
+ /** Regex pattern for validation. Shows error on mismatch. */
30
74
  pattern: string;
75
+ /** Maximum character length. */
31
76
  maxlength: number | null;
77
+ /** Accessible label. When set, assuming "label" isn't provided for private special cases (i.e., <checkbox other>). */
78
+ ariaLabel: string;
79
+ /**
80
+ * Input width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default).
81
+ * @default "full"
82
+ */
32
83
  width: "sm" | "md" | "lg" | "full";
84
+ /** Step increment for `type="number"`. */
33
85
  step: number | null;
86
+ /** Minimum value for `type="number"`. */
34
87
  min: number | null;
88
+ /** Maximum value for `type="number"`. */
35
89
  max: number | null;
90
+ /** Adjusts colors for dark backgrounds. */
36
91
  inverted: boolean;
92
+ /** Shows error message when true. Set by validation or manually. */
37
93
  showError: boolean;
94
+ /** Error message text. Shown only when `showError` is true. */
38
95
  errorMessage: string;
39
96
  private showPassword;
40
97
  private _originalErrorMessage;
@@ -51,6 +108,7 @@ export declare class NysTextinput extends LitElement {
51
108
  disconnectedCallback(): void;
52
109
  firstUpdated(): void;
53
110
  updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
111
+ focus(): void;
54
112
  /**
55
113
  * Form Integration
56
114
  * --------------------------------------------------------------------------
@@ -1,27 +1,55 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-toggle>` is a form-associated toggle switch with label, description,
4
- * size variants, inverted styles, and optional icons. Supports keyboard
5
- * interaction and integrates with forms via ElementInternals.
3
+ * A toggle switch for binary settings with immediate effect. Form-associated via ElementInternals.
6
4
  *
7
- * @slot description - Optional slot to provide additional description below the label.
5
+ * Use when changing a setting takes effect immediately (e.g., dark mode, notifications).
6
+ * For binary choices in forms that submit later, use `nys-checkbox` instead.
8
7
  *
9
- * @fires nys-change - Fired when toggle changes state. Detail: `{ id, checked }`.
10
- * @fires nys-focus - Fired when toggle receives focus.
8
+ * @summary Toggle switch for binary settings with immediate effect.
9
+ * @element nys-toggle
10
+ *
11
+ * @slot description - Custom HTML description content.
12
+ *
13
+ * @fires nys-change - Fired when toggle state changes. Detail: `{id, checked}`.
14
+ * @fires nys-focus - Fired when toggle gains focus.
11
15
  * @fires nys-blur - Fired when toggle loses focus.
16
+ *
17
+ * @example Basic toggle
18
+ * ```html
19
+ * <nys-toggle label="Enable notifications" name="notifications"></nys-toggle>
20
+ * ```
21
+ *
22
+ * @example Dark mode toggle
23
+ * ```html
24
+ * <nys-toggle label="Dark mode" description="Adjust display for low light" checked></nys-toggle>
25
+ * ```
12
26
  */
13
27
  export declare class NysToggle extends LitElement {
14
28
  static styles: import("lit").CSSResult;
29
+ /** Unique identifier. Auto-generated if not provided. */
15
30
  id: string;
31
+ /** Name for form submission. */
16
32
  name: string;
33
+ /** Value submitted when toggle is on. */
17
34
  value: string;
35
+ /** Visible label text. */
18
36
  label: string;
37
+ /** Helper text below label. Use slot for custom HTML. */
19
38
  description: string;
39
+ /** Form `id` to associate with. */
20
40
  form: string | null;
41
+ /** Whether toggle is on. */
21
42
  checked: boolean;
43
+ /** Prevents interaction. */
22
44
  disabled: boolean;
45
+ /** Hides check/close icon inside toggle knob. */
23
46
  noIcon: boolean;
47
+ /** Adjusts colors for dark backgrounds. */
24
48
  inverted: boolean;
49
+ /**
50
+ * Toggle size: `sm` or `md` (default).
51
+ * @default "md"
52
+ */
25
53
  size: "sm" | "md";
26
54
  private _internals;
27
55
  /**
@@ -36,6 +64,7 @@ export declare class NysToggle extends LitElement {
36
64
  * --------------------------------------------------------------------------
37
65
  */
38
66
  updated(changedProperties: Map<string, any>): void;
67
+ formResetCallback(): void;
39
68
  /**
40
69
  * Event Handlers
41
70
  * --------------------------------------------------------------------------
@@ -1,25 +1,34 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-tooltip>` is a custom tooltip component for NYS design system elements.
4
- * It supports dynamic positioning, screen-reader accessibility, keyboard interaction,
5
- * and viewport overflow handling.
3
+ * Shows contextual help text on hover/focus. Auto-positions to stay within viewport and supports keyboard dismiss.
6
4
  *
7
- * The tooltip automatically positions itself relative to a target element specified
8
- * via the `for` attribute, but can also respect a user-defined position.
5
+ * Link to a trigger element via `for` attribute matching the trigger's `id`. Tooltip appears on hover or focus
6
+ * and dismisses on blur, mouse leave, or Escape key. Use for supplementary info only—not critical content.
9
7
  *
10
- * @fires nys-focus - Dispatched when the reference element receives focus (via keyboard or programmatically).
11
- * @fires nys-blur - Dispatched when the reference element loses focus or mouse leaves the tooltip.
8
+ * @summary Contextual tooltip with auto-positioning, keyboard support, and screen reader integration.
9
+ * @element nys-tooltip
12
10
  *
13
- * Notes:
14
- * - Tooltip visibility is automatically managed on hover/focus of the reference element.
15
- * - The component adjusts position dynamically to prevent overflow off-screen.
16
- * - Supports keyboard dismissal with the Escape key.
11
+ * @example Tooltip for button
12
+ * ```html
13
+ * <nys-button id="help-btn" label="Help" circle icon="help"></nys-button>
14
+ * <nys-tooltip for="help-btn" text="Click for assistance"></nys-tooltip>
15
+ * ```
16
+ *
17
+ * @example Positioned tooltip
18
+ * ```html
19
+ * <nys-icon id="info-icon" name="info"></nys-icon>
20
+ * <nys-tooltip for="info-icon" text="Additional details" position="right"></nys-tooltip>
21
+ * ```
17
22
  */
18
23
  export declare class NysTooltip extends LitElement {
19
24
  static styles: import("lit").CSSResult;
25
+ /** Unique identifier. Auto-generated if not provided. */
20
26
  id: string;
27
+ /** Tooltip content text. Required. */
21
28
  text: string;
29
+ /** Adjusts colors for dark backgrounds. */
22
30
  inverted: boolean;
31
+ /** ID of the trigger element to attach this tooltip to. Required. */
23
32
  for: string;
24
33
  private _active;
25
34
  private _userHasSetPosition;
@@ -27,6 +36,10 @@ export declare class NysTooltip extends LitElement {
27
36
  private _internallyUpdatingPosition;
28
37
  private _hideTimeout;
29
38
  private _position;
39
+ /**
40
+ * Preferred position relative to trigger. Auto-adjusts if space is insufficient.
41
+ * @default null (auto-positioned based on available space)
42
+ */
30
43
  get position(): "right" | "top" | "bottom" | "left" | null;
31
44
  set position(value: "right" | "top" | "bottom" | "left" | null);
32
45
  /**
@@ -1,11 +1,18 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-unavfooter>` is a footer component for New York State websites.
4
- * It displays the official NYS logo linking to ny.gov and a set of primary navigation links.
3
+ * Universal NYS footer with logo and statewide navigation links. Required on all NYS sites.
5
4
  *
6
- * Features:
7
- * - Renders the NYS logo as an inline SVG linking to https://www.ny.gov
8
- * - Provides key navigation links
5
+ * Place as the last element before `</body>`. Displays NY.gov logo and links to Agencies,
6
+ * App Directory, Counties, Events, Programs, and Services. No configuration needed.
7
+ *
8
+ * @summary Universal NYS footer with logo and statewide links. Required site-wide.
9
+ * @element nys-unavfooter
10
+ *
11
+ * @example Standard usage
12
+ * ```html
13
+ * <nys-globalfooter>...</nys-globalfooter>
14
+ * <nys-unavfooter></nys-unavfooter>
15
+ * ```
9
16
  */
10
17
  export declare class NysUnavFooter extends LitElement {
11
18
  static styles: import("lit").CSSResult;
@@ -1,22 +1,40 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * `<nys-unavheader>` is a universal header for New York State websites.
3
+ * Universal NYS header with trust bar, logo, search, and language translation. Required on all NYS sites.
4
4
  *
5
- * Features:
6
- * - Trust bar indicating official NYS site status, with expandable details
7
- * - NYS logo linking to the homepage
8
- * - Search bar with dropdown behavior for mobile and desktop
9
- * - Language translation dropdown supporting multiple languages
10
- * - Accessible interactions with ARIA attributes and keyboard handling
5
+ * Place as the first element in `<body>`. Includes "official site" trust indicator, NY.gov logo,
6
+ * site search (searches ny.gov), and 14-language translation dropdown. Use `hideSearch` or `hideTranslate`
7
+ * to remove features if not applicable.
8
+ *
9
+ * @summary Universal NYS header with trust bar, search, and translation. Required site-wide.
10
+ * @element nys-unavheader
11
+ *
12
+ * @example Standard usage
13
+ * ```html
14
+ * <nys-unavheader></nys-unavheader>
15
+ * <nys-globalheader>...</nys-globalheader>
16
+ * ```
17
+ *
18
+ * @example Without search
19
+ * ```html
20
+ * <nys-unavheader hideSearch></nys-unavheader>
21
+ * ```
11
22
  */
12
23
  export declare class NysUnavHeader extends LitElement {
13
24
  static styles: import("lit").CSSResult;
25
+ /** Internal: Whether trust bar panel is expanded. */
14
26
  trustbarVisible: boolean;
27
+ /** Internal: Whether search dropdown is visible (mobile). */
15
28
  searchDropdownVisible: boolean;
29
+ /** Internal: Whether language dropdown is visible. */
16
30
  languageVisible: boolean;
31
+ /** Internal: Whether search input is focused. */
17
32
  isSearchFocused: boolean;
33
+ /** Hides the translation dropdown. */
18
34
  hideTranslate: boolean;
35
+ /** Hides the search functionality. */
19
36
  hideSearch: boolean;
37
+ searchUrl: string;
20
38
  private languages;
21
39
  /**
22
40
  * Lifecycle Methods