@nysds/components 1.21.1 → 1.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/custom-elements.json +1562 -1029
  2. package/dist/.vscode/vscode.css-custom-data.json +75 -0
  3. package/dist/.vscode/vscode.html-custom-data.json +129 -60
  4. package/dist/custom-elements.json +1562 -1029
  5. package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js → nys-icon.library-715cAMBp-BmiCym2_.js} +3 -3
  6. package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js.map → nys-icon.library-715cAMBp-BmiCym2_.js.map} +1 -1
  7. package/dist/{nys-icon.library-C02yNW9R.js → nys-icon.library-C0_LOBWi.js} +2 -2
  8. package/dist/{nys-icon.library-C02yNW9R.js.map → nys-icon.library-C0_LOBWi.js.map} +1 -1
  9. package/dist/nysds.es.js +5074 -3645
  10. package/dist/nysds.es.js.map +1 -1
  11. package/dist/nysds.js +252 -248
  12. package/dist/nysds.js.map +1 -1
  13. package/dist/packages/codegen/src/index.d.ts +16 -0
  14. package/dist/packages/codegen/src/manifest/components.d.ts +5 -0
  15. package/dist/packages/codegen/src/manifest/filters.d.ts +5 -0
  16. package/dist/packages/codegen/src/manifest/form-control.d.ts +5 -0
  17. package/dist/packages/codegen/src/manifest/load.d.ts +10 -0
  18. package/dist/packages/codegen/src/manifest/naming.d.ts +6 -0
  19. package/dist/packages/codegen/src/manifest/packages.d.ts +5 -0
  20. package/dist/packages/codegen/src/manifest/types.d.ts +6 -0
  21. package/dist/packages/codegen/src/transform/index.d.ts +19 -0
  22. package/dist/packages/codegen/src/transform/parse.d.ts +18 -0
  23. package/dist/packages/codegen/src/transform/shared.d.ts +61 -0
  24. package/dist/packages/codegen/src/transform/to-angular.d.ts +6 -0
  25. package/dist/packages/codegen/src/transform/to-jsx.d.ts +6 -0
  26. package/dist/packages/internals/src/form-control-mixin.d.ts +16 -0
  27. package/dist/packages/internals/src/form-events.d.ts +22 -0
  28. package/dist/packages/internals/src/index.d.ts +2 -1
  29. package/dist/packages/internals/src/types.d.ts +6 -0
  30. package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +12 -0
  31. package/dist/packages/mcp-server/src/lib/framework-snippets.d.ts +35 -0
  32. package/dist/packages/mcp-server/src/lib/framework-usage.d.ts +19 -0
  33. package/dist/packages/mcp-server/src/lib/frameworks-data.d.ts +18 -0
  34. package/dist/packages/mcp-server/src/resources/frameworks.d.ts +14 -0
  35. package/dist/packages/nys-accordion/src/nys-accordion.d.ts +12 -0
  36. package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +9 -1
  37. package/dist/packages/nys-alert/src/nys-alert.d.ts +39 -1
  38. package/dist/packages/nys-avatar/src/nys-avatar.d.ts +16 -0
  39. package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +12 -0
  40. package/dist/packages/nys-badge/src/nys-badge.d.ts +18 -0
  41. package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +22 -1
  42. package/dist/packages/nys-button/src/nys-button.d.ts +35 -4
  43. package/dist/packages/nys-card/src/nys-card.d.ts +20 -0
  44. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +77 -7
  45. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +46 -0
  46. package/dist/packages/nys-combobox/src/nys-combobox.d.ts +51 -6
  47. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +44 -2
  48. package/dist/packages/nys-divider/src/nys-divider.d.ts +9 -0
  49. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +43 -0
  50. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +21 -1
  51. package/dist/packages/nys-fileinput/src/index.d.ts +1 -0
  52. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +42 -6
  53. package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +9 -1
  54. package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +17 -0
  55. package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +18 -0
  56. package/dist/packages/nys-icon/src/nys-icon.d.ts +18 -0
  57. package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +16 -0
  58. package/dist/packages/nys-label/src/nys-label.d.ts +3 -1
  59. package/dist/packages/nys-modal/src/nys-modal.d.ts +26 -2
  60. package/dist/packages/nys-pagination/src/nys-pagination.d.ts +21 -2
  61. package/dist/packages/nys-processlist/src/nys-processlist.d.ts +16 -0
  62. package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +1 -1
  63. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +29 -5
  64. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +66 -4
  65. package/dist/packages/nys-select/src/nys-select.d.ts +22 -4
  66. package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +8 -0
  67. package/dist/packages/nys-stepper/src/nys-step.d.ts +8 -1
  68. package/dist/packages/nys-stepper/src/nys-stepper.d.ts +8 -0
  69. package/dist/packages/nys-tab/src/nys-tab.d.ts +22 -3
  70. package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +12 -0
  71. package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +2 -0
  72. package/dist/packages/nys-table/src/nys-table.d.ts +39 -2
  73. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +47 -4
  74. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +42 -4
  75. package/dist/packages/nys-toggle/src/nys-toggle.d.ts +37 -3
  76. package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +13 -0
  77. package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +13 -0
  78. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +26 -4
  79. package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +14 -0
  80. package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +11 -0
  81. package/dist/packages/nys-video/src/nys-video.d.ts +14 -1
  82. package/package.json +31 -26
  83. package/packages/react/.turbo/turbo-build.log +0 -59
  84. package/packages/react/NysAccordion.d.ts +0 -75
  85. package/packages/react/NysAccordion.js +0 -24
  86. package/packages/react/NysAccordionItem.d.ts +0 -82
  87. package/packages/react/NysAccordionItem.js +0 -43
  88. package/packages/react/NysAlert.d.ts +0 -102
  89. package/packages/react/NysAlert.js +0 -61
  90. package/packages/react/NysAvatar.d.ts +0 -88
  91. package/packages/react/NysAvatar.js +0 -40
  92. package/packages/react/NysBacktotop.d.ts +0 -57
  93. package/packages/react/NysBacktotop.js +0 -23
  94. package/packages/react/NysBadge.d.ts +0 -78
  95. package/packages/react/NysBadge.js +0 -42
  96. package/packages/react/NysBreadcrumbItem.d.ts +0 -72
  97. package/packages/react/NysBreadcrumbItem.js +0 -42
  98. package/packages/react/NysBreadcrumbs.d.ts +0 -89
  99. package/packages/react/NysBreadcrumbs.js +0 -50
  100. package/packages/react/NysButton.d.ts +0 -171
  101. package/packages/react/NysButton.js +0 -83
  102. package/packages/react/NysCard.d.ts +0 -121
  103. package/packages/react/NysCard.js +0 -63
  104. package/packages/react/NysCheckbox.d.ts +0 -145
  105. package/packages/react/NysCheckbox.js +0 -78
  106. package/packages/react/NysCheckboxgroup.d.ts +0 -88
  107. package/packages/react/NysCheckboxgroup.js +0 -46
  108. package/packages/react/NysCombobox.d.ts +0 -126
  109. package/packages/react/NysCombobox.js +0 -66
  110. package/packages/react/NysDatepicker.d.ts +0 -128
  111. package/packages/react/NysDatepicker.js +0 -76
  112. package/packages/react/NysDivider.d.ts +0 -54
  113. package/packages/react/NysDivider.js +0 -22
  114. package/packages/react/NysDropdownMenu.d.ts +0 -59
  115. package/packages/react/NysDropdownMenu.js +0 -23
  116. package/packages/react/NysDropdownMenuItem.d.ts +0 -75
  117. package/packages/react/NysDropdownMenuItem.js +0 -47
  118. package/packages/react/NysErrorMessage.d.ts +0 -60
  119. package/packages/react/NysErrorMessage.js +0 -24
  120. package/packages/react/NysFileItem.d.ts +0 -69
  121. package/packages/react/NysFileItem.js +0 -37
  122. package/packages/react/NysFileinput.d.ts +0 -130
  123. package/packages/react/NysFileinput.js +0 -74
  124. package/packages/react/NysGlobalFooter.d.ts +0 -77
  125. package/packages/react/NysGlobalFooter.js +0 -32
  126. package/packages/react/NysGlobalHeader.d.ts +0 -82
  127. package/packages/react/NysGlobalHeader.js +0 -32
  128. package/packages/react/NysIcon.d.ts +0 -75
  129. package/packages/react/NysIcon.js +0 -50
  130. package/packages/react/NysIconlist.d.ts +0 -57
  131. package/packages/react/NysIconlist.js +0 -23
  132. package/packages/react/NysIconlistitem.d.ts +0 -63
  133. package/packages/react/NysIconlistitem.js +0 -23
  134. package/packages/react/NysLabel.d.ts +0 -81
  135. package/packages/react/NysLabel.js +0 -40
  136. package/packages/react/NysModal.d.ts +0 -90
  137. package/packages/react/NysModal.js +0 -50
  138. package/packages/react/NysOption.d.ts +0 -66
  139. package/packages/react/NysOption.js +0 -25
  140. package/packages/react/NysPagination.d.ts +0 -72
  141. package/packages/react/NysPagination.js +0 -45
  142. package/packages/react/NysProcesslist.d.ts +0 -65
  143. package/packages/react/NysProcesslist.js +0 -25
  144. package/packages/react/NysProcesslistitem.d.ts +0 -61
  145. package/packages/react/NysProcesslistitem.js +0 -35
  146. package/packages/react/NysRadiobutton.d.ts +0 -132
  147. package/packages/react/NysRadiobutton.js +0 -72
  148. package/packages/react/NysRadiogroup.d.ts +0 -104
  149. package/packages/react/NysRadiogroup.js +0 -62
  150. package/packages/react/NysSelect.d.ts +0 -119
  151. package/packages/react/NysSelect.js +0 -67
  152. package/packages/react/NysSkipnav.d.ts +0 -54
  153. package/packages/react/NysSkipnav.js +0 -22
  154. package/packages/react/NysStep.d.ts +0 -73
  155. package/packages/react/NysStep.js +0 -40
  156. package/packages/react/NysStepper.d.ts +0 -67
  157. package/packages/react/NysStepper.js +0 -26
  158. package/packages/react/NysTab.d.ts +0 -90
  159. package/packages/react/NysTab.js +0 -39
  160. package/packages/react/NysTabgroup.d.ts +0 -76
  161. package/packages/react/NysTabgroup.js +0 -22
  162. package/packages/react/NysTable.d.ts +0 -80
  163. package/packages/react/NysTable.js +0 -41
  164. package/packages/react/NysTabpanel.d.ts +0 -70
  165. package/packages/react/NysTabpanel.js +0 -21
  166. package/packages/react/NysTextarea.d.ts +0 -141
  167. package/packages/react/NysTextarea.js +0 -79
  168. package/packages/react/NysTextinput.d.ts +0 -144
  169. package/packages/react/NysTextinput.js +0 -83
  170. package/packages/react/NysToggle.d.ts +0 -102
  171. package/packages/react/NysToggle.js +0 -59
  172. package/packages/react/NysTooltip.d.ts +0 -60
  173. package/packages/react/NysTooltip.js +0 -24
  174. package/packages/react/NysUnavFooter.d.ts +0 -61
  175. package/packages/react/NysUnavFooter.js +0 -21
  176. package/packages/react/NysUnavHeader.d.ts +0 -95
  177. package/packages/react/NysUnavHeader.js +0 -54
  178. package/packages/react/NysVerticalnav.d.ts +0 -67
  179. package/packages/react/NysVerticalnav.js +0 -26
  180. package/packages/react/NysVerticalnavGroup.d.ts +0 -76
  181. package/packages/react/NysVerticalnavGroup.js +0 -43
  182. package/packages/react/NysVideo.d.ts +0 -83
  183. package/packages/react/NysVideo.js +0 -53
  184. package/packages/react/README.md +0 -92
  185. package/packages/react/index.d.ts +0 -49
  186. package/packages/react/index.js +0 -49
  187. package/packages/react/nysds-jsx.d.ts +0 -2009
  188. package/packages/react/react-utils.js +0 -40
@@ -2,6 +2,26 @@ import { NysFormControlElement } from "@nysds/internals";
2
2
  import "./nys-fileitem";
3
3
  import "@nysds/nys-label";
4
4
  import "@nysds/nys-errormessage";
5
+ /** A selected file plus the component's processing metadata for it. */
6
+ export interface FileWithProgress {
7
+ file: File;
8
+ progress: number;
9
+ status: "pending" | "processing" | "done" | "error";
10
+ errorMsg?: string;
11
+ }
12
+ /** Detail payload for the `nys-change` event. */
13
+ export interface NysFileinputChangeDetail {
14
+ id: string;
15
+ name: string;
16
+ /** The full current selection as raw `File` objects (matches the `files` property). */
17
+ files: File[];
18
+ /** The full current selection with progress and status metadata. */
19
+ items: FileWithProgress[];
20
+ /** The entries this action added or removed, with progress and status metadata. */
21
+ changedFiles: FileWithProgress[];
22
+ }
23
+ /** The `nys-change` event dispatched by `nys-fileinput`. */
24
+ export type NysFileinputChangeEvent = CustomEvent<NysFileinputChangeDetail>;
5
25
  /**
6
26
  * A file input for uploading files with support for multiple files, drag-and-drop, and progress tracking.
7
27
  * Validates file types via magic bytes (not just extension). Form-associated via ElementInternals.
@@ -17,12 +37,26 @@ import "@nysds/nys-errormessage";
17
37
  *
18
38
  * @slot description - Custom HTML description content.
19
39
  *
20
- * @fires nys-change - Fired once per user action (file selection, drop, or removal).
21
- * Detail: `{id, files, changedFiles}`. The `files` is the full current selection
22
- * Whereas `changedFiles` is the entries this action added or removed.
23
- * Both `changedFiles` and each entry in `files` are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`.
40
+ * @formControl files nys-change
41
+ *
42
+ * @fires {NysFileinputChangeEvent} nys-change Fired once per user action (file selection, drop, or removal).
43
+ * Detail: `{ id, name, files, items, changedFiles }`. `files` is the full current selection as raw
44
+ * `File` objects (matches the `files` property). `items` is the same selection with progress metadata,
45
+ * and `changedFiles` is the entries this action added or removed. Entries in `items` and `changedFiles`
46
+ * are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`.
47
+ *
48
+ * @fires {Event} nys-focus Fired when focus enters the component from outside.
49
+ * @fires {Event} nys-blur Fired when focus leaves the component. Triggers validation.
50
+ *
51
+ * @usagedos
52
+ * - Use when a form requires file upload, including when multiple file selection or drag-and-drop is needed.
24
53
  *
25
- * @fires nys-blur - Fired when focus leaves the component. Triggers validation.
54
+ * @usagedonts
55
+ * - Use when uploading large files that require resumable upload logic.
56
+ * - Use when selecting only from camera input or other device-native features.
57
+ * - Use when uploading sensitive data without encryption.
58
+ * - Use when file preview of uploaded content is needed.
59
+ * - Use when file upload is not necessary for the task.
26
60
  *
27
61
  * @example Basic
28
62
  * ```html
@@ -176,7 +210,7 @@ export declare class NysFileinput extends NysFormControlElement {
176
210
  connectedCallback(): void;
177
211
  disconnectedCallback(): void;
178
212
  firstUpdated(): void;
179
- updated(): void;
213
+ updated(changedProperties: Map<string, unknown>): void;
180
214
  /**
181
215
  * Point the exposed control at the rendered <nys-errormessage> and, in
182
216
  * dropzone mode, at the "or drag here" instructional text.
@@ -216,6 +250,8 @@ export declare class NysFileinput extends NysFormControlElement {
216
250
  */
217
251
  private _saveSelectedFiles;
218
252
  private _processFile;
253
+ private _containsFocus;
254
+ private _handleFocusIn;
219
255
  private _handleBlur;
220
256
  private _dispatchChangeEvent;
221
257
  private _openFileDialog;
@@ -1,6 +1,12 @@
1
1
  import { NysElement } from "@nysds/internals";
2
2
  import "@nysds/nys-icon";
3
3
  import "@nysds/nys-button";
4
+ /** Detail payload for the `nys-file-remove` event (and its deprecated `nys-fileRemove` alias). */
5
+ export interface NysFileitemFileRemoveDetail {
6
+ filename: string;
7
+ }
8
+ /** The `nys-file-remove` event dispatched by `nys-fileitem`. */
9
+ export type NysFileitemFileRemoveEvent = CustomEvent<NysFileitemFileRemoveDetail>;
4
10
  /**
5
11
  * **Internal component.** Displays an individual file within `nys-fileinput` with status and progress.
6
12
  *
@@ -14,7 +20,9 @@ import "@nysds/nys-button";
14
20
  * @summary Internal file item display with status, progress bar, and remove action.
15
21
  * @element nys-fileitem
16
22
  *
17
- * @fires nys-fileRemove - Fired when remove button is clicked. Detail: `{filename}`.
23
+ * @fires {NysFileitemFileRemoveEvent} nys-file-remove Fired when the remove button is clicked. Detail: `{ filename }`.
24
+ * @fires {NysFileitemFileRemoveEvent} nys-fileRemove deprecated 1.x alias of `nys-file-remove`, fired
25
+ * alongside it. Listen for `nys-file-remove` instead; this name goes away in 2.0.
18
26
  */
19
27
  export declare class NysFileItem extends NysElement {
20
28
  static styles: import("lit").CSSResult;
@@ -11,6 +11,23 @@ import "@nysds/nys-divider";
11
11
  *
12
12
  * @slot - Footer content (links, contact info). Use `<h4>` for column headings.
13
13
  *
14
+ * @cssprop [--nys-max-width--content] - Overrides the inner content max width across the grid, header, footer, and breadcrumb. Set at a higher level like `:root` to apply to all instances. Takes priority over the size-specific variable.
15
+ *
16
+ * @usagedos
17
+ * - Use on every agency site and application. The Global Footer is a required page element.
18
+ * - Use to surface essential site-wide links such as contact information, privacy policies, accessibility statements, and related program pages.
19
+ * - Set `agencyName` to your agency's full official name (e.g., "Office of Information Technology Services").
20
+ * - Set `homepageLink` to make the agency name a clickable link back to your site's homepage.
21
+ * - Keep footer link lists concise. Group related links under `<span>` headings when you have more than 5–6 links.
22
+ * - Use slotted `<ul>` content for single-list links, or nested `<ul>` with `<span>` headings for multi-column layouts.
23
+ * - Place `<nys-globalfooter>` above `<nys-unavfooter>` and below your page content and `<nys-backtotop>`.
24
+ *
25
+ * @usagedonts
26
+ * - Use for primary navigation. That belongs in `<nys-globalheader>`.
27
+ * - Include page-specific content or calls to action. Footer content should be relevant site-wide.
28
+ * - Use for statewide universal links (Agencies, Services, Counties). Those belong in `<nys-unavfooter>`, which renders below this component.
29
+ * - Embed `<script>`, `<iframe>`, `<object>`, or `<img>` elements in slotted content. These are sanitized and removed by the component for security.
30
+ *
14
31
  * @example Basic
15
32
  * ```html
16
33
  * <nys-globalfooter agencyName="Office of Information Technology Services"></nys-globalfooter>
@@ -9,9 +9,27 @@ import { NysElement } from "@nysds/internals";
9
9
  * @summary Agency header with navigation, mobile menu, and active link highlighting.
10
10
  * @element nys-globalheader
11
11
  *
12
+ * @cssprop [--nys-max-width--content] - Overrides the inner content max width across the grid, header, footer, and breadcrumb. Set at a higher level like `:root` to apply to all instances. Takes priority over the size-specific variable.
13
+ *
12
14
  * @slot - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
13
15
  * @slot user-actions - User-account controls (e.g. profile link, settings, log-out button) shown in the header.
14
16
  *
17
+ * @usagedos
18
+ * - Use on every agency site and application. The Global Header is a required page element.
19
+ * - Place below `<nys-unavheader>` when using the Universal Navigation Header.
20
+ * - Use `agencyName` alone for public-facing agency websites not tied to a specific application; omit it for statewide portals that aren't agency-specific.
21
+ * - Use `appName` for named applications (e.g., "Employee Time Tracker" or "License Renewal Portal").
22
+ * - Combine `appName` and `agencyName` when an application belongs to a specific agency.
23
+ * - Set `homepageLink` to make the header title clickable. On public-facing sites, this is the primary path back to the homepage.
24
+ * - Use the `user-actions` slot for authenticated applications that need log-out buttons or user profile controls.
25
+ * - Keep navigation link lists to 6 items or fewer. On mobile, these collapse into a full-width menu.
26
+ * - Add the `nysLogo` property to display the NYS brand mark for internal applications that don't require public-facing agency branding.
27
+ *
28
+ * @usagedonts
29
+ * - Use `appName` for an agency name. Use the `agencyName` prop instead.
30
+ * - Add navigation links to application headers where users should remain focused on a task (e.g., a multi-step form).
31
+ * - Place secondary or utility navigation in the Global Header. Use `<nys-globalfooter>` for secondary links.
32
+ * - Use the `nysLogo` property on public-facing sites, instead use the `<nys-unavheader>` for statewide branding.
15
33
  *
16
34
  * @example Basic
17
35
  * ```html
@@ -13,6 +13,24 @@ import { NysIconWatcher } from "./icon-library-registry";
13
13
  * @summary SVG icon with swappable library support, size, rotation, and color options.
14
14
  * @element nys-icon
15
15
  *
16
+ * @cssprop [--nys-icon-size] - Width and height of the component
17
+ *
18
+ * @usagedos
19
+ * - Use icons to draw attention to actions, help users scan for key information, or enhance recognizable common actions (e.g., search, download, share).
20
+ * - Pair icons with a text label—few icons are universally understood alone.
21
+ * - Use icons consistently: same icon and label for the same meaning throughout your app.
22
+ * - Use `ariaLabel` when the icon conveys meaning, so screen readers can announce its purpose.
23
+ * - Use icons from the NYS Design System library; if unavailable, use Google Material Symbols (rounded, unfilled).
24
+ * - Match icon size and color to the design system.
25
+ *
26
+ * @usagedonts
27
+ * - Use an icon if its meaning isn't immediately clear—if you suspect users won't recognize it, remove it.
28
+ * - Use icons to compensate for unclear page hierarchy or confusing content organization.
29
+ * - Use standalone icons for actions—use `<nys-button>` with an icon inside instead.
30
+ * - Replace meaningful text with icons unless the icon is universally recognized or paired with a label.
31
+ * - Overuse icons—too many create visual noise and reduce focus.
32
+ * - Use excessive icon customization that breaks design consistency.
33
+ *
16
34
  * @example Basic
17
35
  * ```html
18
36
  * <nys-icon name="check_circle"></nys-icon>
@@ -17,6 +17,19 @@ import "./nys-iconlistitem";
17
17
  * its styling comes from `nys-iconlist.light.scss` adopted once onto
18
18
  * `document.adoptedStyleSheets` rather than from a shadow-DOM stylesheet.
19
19
  *
20
+ * @usagedos
21
+ * - Use an icon list to highlight key attributes, features, requirements, or metadata that help users quickly scan content.
22
+ * - Keep list items short and concise—ideally a single line of text or a brief phrase.
23
+ * - Limit the number of items shown (typically 3–5) to maintain scannability and keep the list from becoming overly dense.
24
+ * - Order items by importance, placing the most relevant information first.
25
+ * - Make sure icons add meaning and are not purely decorative. If all items use the same icon, consider whether a standard list would communicate the content just as effectively.
26
+ *
27
+ * @usagedonts
28
+ * - Use an icon list when the items represent steps in a process. Use the `<nys-stepper>` instead.
29
+ * - Use an icon list for long descriptions, complex instructions, or content that requires hierarchy. Use standard lists or body text instead.
30
+ * - Mix icon styles within a single list, which makes the list harder to scan.
31
+ * - Place interactive controls such as buttons inside list items.
32
+ *
20
33
  * @example Basic
21
34
  * ```html
22
35
  * <nys-iconlist id="event-details">
@@ -105,8 +118,11 @@ export declare class NysIconlist extends NysElement {
105
118
  private _childObserver;
106
119
  private _warnedChildren;
107
120
  createRenderRoot(): this;
121
+ private _firstUpdatePending;
122
+ protected scheduleUpdate(): Promise<void>;
108
123
  connectedCallback(): void;
109
124
  disconnectedCallback(): void;
125
+ firstUpdated(changedProperties: PropertyValues<this>): void;
110
126
  updated(changedProperties: PropertyValues<this>): void;
111
127
  private _syncInverted;
112
128
  private _syncDividers;
@@ -41,6 +41,8 @@ import "@nysds/nys-icon";
41
41
  * ```
42
42
  *
43
43
  * @slot description - Custom HTML description content below the label.
44
+ *
45
+ * @fires {Event} nys-label-click - Fired when the label is clicked. Bubbles and composed. Listened for by form components (for example nys-fileinput and nys-toggle) that need label-activation behavior.
44
46
  */
45
47
  export declare class NysLabel extends LitElement {
46
48
  static styles: import("lit").CSSResult;
@@ -57,7 +59,7 @@ export declare class NysLabel extends LitElement {
57
59
  /** Tooltip text shown on hover/focus of info icon next to label. */
58
60
  tooltip: string;
59
61
  private _labelInternals;
60
- get _hasDescription(): boolean;
62
+ private get _hasDescription();
61
63
  connectedCallback(): void;
62
64
  updated(): void;
63
65
  /**
@@ -1,5 +1,17 @@
1
1
  import { NysElement } from "@nysds/internals";
2
2
  import "@nysds/nys-button";
3
+ /** Detail payload for the `nys-open` event fired by `nys-modal`. */
4
+ export interface NysModalOpenDetail {
5
+ id: string;
6
+ }
7
+ /** The `nys-open` event fired by `nys-modal`. */
8
+ export type NysModalOpenEvent = CustomEvent<NysModalOpenDetail>;
9
+ /** Detail payload for the `nys-close` event fired by `nys-modal`. */
10
+ export interface NysModalCloseDetail {
11
+ id: string;
12
+ }
13
+ /** The `nys-close` event fired by `nys-modal`. */
14
+ export type NysModalCloseEvent = CustomEvent<NysModalCloseDetail>;
3
15
  /**
4
16
  * An accessible modal dialog with focus trapping, keyboard navigation, and scroll management.
5
17
  *
@@ -12,8 +24,20 @@ import "@nysds/nys-button";
12
24
  * @slot - Default slot for body content.
13
25
  * @slot actions - Action buttons displayed in footer. Buttons auto-resize on mobile.
14
26
  *
15
- * @fires nys-open - Fired when modal opens. Detail: `{id}`.
16
- * @fires nys-close - Fired when modal closes. Detail: `{id}`.
27
+ * @fires {NysModalOpenEvent} nys-open - Fired when modal opens. Detail: `{id}`.
28
+ * @fires {NysModalCloseEvent} nys-close - Fired when modal closes. Detail: `{id}`.
29
+ *
30
+ * @usagedos
31
+ * - Use to confirm important actions, present focused forms (e.g., login, feedback), or require acknowledgment of alerts without navigating away from the page.
32
+ * - Keep content short and focused. Use a dedicated page for long or complex content.
33
+ * - Keep the `subheading` short and use `<p>` tags within the modal for longer information.
34
+ * - Use the `mandatory` prop to disable the dismiss button only when the user must make a critical decision or acknowledge essential information.
35
+ *
36
+ * @usagedonts
37
+ * - Stack multiple modals.
38
+ * - Use for trivial information or inline status messages. Use `<nys-alert>` instead.
39
+ * - Use for quick hints on form fields. Use `<nys-tooltip>` instead.
40
+ * - Force the `mandatory` prop unnecessarily.
17
41
  *
18
42
  * @example Basic
19
43
  * ```html
@@ -1,6 +1,12 @@
1
1
  import { TemplateResult } from "lit";
2
2
  import { NysElement } from "@nysds/internals";
3
3
  import "@nysds/nys-button";
4
+ /** Detail payload for the `nys-change` event fired by `nys-pagination`. */
5
+ export interface NysPaginationChangeDetail {
6
+ page: number;
7
+ }
8
+ /** The `nys-change` event fired by `nys-pagination`. */
9
+ export type NysPaginationChangeEvent = CustomEvent<NysPaginationChangeDetail>;
4
10
  /**
5
11
  * Page navigation with Previous/Next buttons and numbered page links. Auto-collapses with ellipses for many pages.
6
12
  *
@@ -20,7 +26,20 @@ import "@nysds/nys-button";
20
26
  * @summary Page navigation with numbered links, prev/next buttons, and responsive layout.
21
27
  * @element nys-pagination
22
28
  *
23
- * @fires nys-change - Fired when page changes. Detail: `{page}`.
29
+ * @fires {NysPaginationChangeEvent} nys-change - Fired when page changes. Detail: `{page}`.
30
+ *
31
+ * @usagedos
32
+ * - Use for large result sets such as search results, data tables, or directory listings where loading everything at once would hurt performance or usability.
33
+ * - Use when users need to navigate to a specific part of a result set.
34
+ * - Set `totalPages` based on your data set and page size; update `currentPage` in response to `nys-change` events.
35
+ * - Don't set `currentPage` to a value greater than `totalPages`. The component clamps the value automatically, but your application logic should prevent this.
36
+ * - Position the pagination component below the content it controls.
37
+ * - Scroll users to the top of the results area when they change pages.
38
+ *
39
+ * @usagedonts
40
+ * - Use when content fits on a single page (fewer than 3–4 screen heights). Show all items instead.
41
+ * - Use for step-based workflows where users complete tasks in order. Use `<nys-stepper>` instead.
42
+ * - Use for infinite-scroll patterns such as a news feed.
24
43
  *
25
44
  * @example Basic
26
45
  * ```html
@@ -47,7 +66,7 @@ export declare class NysPagination extends NysElement {
47
66
  currentPage: number;
48
67
  /** Total number of pages. Must be at least 1. */
49
68
  totalPages: number;
50
- /** Internal state for layout adjustments near the end. */
69
+ /** Internal layout coordination state reflected for styling. Not public API. @internal */
51
70
  _twoBeforeLast: boolean;
52
71
  /**
53
72
  * Logical identity of the control that held focus when this update was scheduled,
@@ -23,6 +23,19 @@ import "./nys-processlistitem";
23
23
  * `aria-describedby` for supporting copy such as an intro paragraph. Because the host renders
24
24
  * in the light DOM, these native attributes work with zero component code.
25
25
  *
26
+ * @usagedos
27
+ * - Use a process list to explain a sequence of steps a user will take, such as how to apply for a benefit or renew a license.
28
+ * - Keep step labels short and action-oriented, and put supporting detail in the `description`.
29
+ * - Give the list an accessible name with `aria-labelledby` or `aria-label` so its purpose is clear.
30
+ * - Use `initialstep` to continue the numbering when one process is split across multiple lists.
31
+ * - Keep styling consistent across all process lists on the same page.
32
+ *
33
+ * @usagedonts
34
+ * - Use a process list to show a user's progress through a multi-step form. Use the [Stepper](/components/stepper/) instead.
35
+ * - Use a process list for items with no inherent order. Use the [Icon List](/components/iconlist/) or a standard list instead.
36
+ * - Number the steps yourself in the `label`. The list owns the numbering.
37
+ * - Place interactive controls such as buttons inside a step.
38
+ *
26
39
  * @example Basic
27
40
  * ```html
28
41
  * <nys-processlist id="application-steps">
@@ -177,8 +190,11 @@ export declare class NysProcesslist extends NysElement {
177
190
  private _childObserver;
178
191
  private _warnedChildren;
179
192
  createRenderRoot(): this;
193
+ private _firstUpdatePending;
194
+ protected scheduleUpdate(): Promise<void>;
180
195
  connectedCallback(): void;
181
196
  disconnectedCallback(): void;
197
+ firstUpdated(changedProperties: PropertyValues): void;
182
198
  updated(changedProperties: PropertyValues): void;
183
199
  private _syncSteps;
184
200
  }
@@ -30,7 +30,7 @@ export declare class NysProcesslistitem extends NysElement {
30
30
  * A description is shown when either the property or the slot has content, so an item with
31
31
  * neither renders no empty paragraph.
32
32
  */
33
- get _hasDescription(): boolean;
33
+ private get _hasDescription();
34
34
  /**
35
35
  * Sets the rendered step number.
36
36
  * @internal Called by `<nys-processlist>`; not intended for direct use.
@@ -1,5 +1,14 @@
1
1
  import { NysFormControlElement } from "@nysds/internals";
2
2
  import "@nysds/nys-label";
3
+ /** Detail payload for the `nys-change` event fired by `nys-radiobutton`. */
4
+ export interface NysRadiobuttonChangeDetail {
5
+ id: string;
6
+ checked: boolean;
7
+ name: string;
8
+ value: string;
9
+ }
10
+ /** The `nys-change` event fired by `nys-radiobutton`. */
11
+ export type NysRadiobuttonChangeEvent = CustomEvent<NysRadiobuttonChangeDetail>;
3
12
  /**
4
13
  * A radio button for single selection within a `nys-radiogroup`. Only one radio with the same `name` can be selected.
5
14
  *
@@ -12,14 +21,28 @@ import "@nysds/nys-label";
12
21
  * Since we can't do that naturally, we have supporting functions to keep track of keyboard navigation, a11y VO, and single radiobutton checked at all times.
13
22
  *
14
23
  * @element nys-radiobutton
24
+ * @formControl checked nys-change
15
25
  *
16
26
  * @slot description - Custom HTML description content.
17
27
  *
18
- * @fires nys-change - Fired when selection changes. Detail: `{id, checked, name, value}`.
19
- * @fires nys-focus - Fired when radio gains focus.
20
- * @fires nys-blur - Fired when radio loses focus.
21
- * @fires nys-other-input - Fired when "other" text input value changes. Detail: `{id, name, value}`.
28
+ * @fires {NysRadiobuttonChangeEvent} nys-change - Fired when the selection changes. Detail: `{id, checked, name, value}`. Bubbles and composed.
29
+ *
30
+ * Standalone radios (outside a `nys-radiogroup`) render their own native input
31
+ * and dispatch `nys-change` themselves. Inside a `nys-radiogroup` the group
32
+ * renders the inputs and owns the form contract: `nys-focus` and `nys-blur`
33
+ * arrive re-targeted from the group, and `nys-other-input` fires on the group.
34
+ *
35
+ * @usagedos
36
+ * - Use when a user needs to select only one option from a list of 7 or fewer choices.
37
+ * - Always wrap a group of `<nys-radiobutton>` with a `<nys-radiogroup>`.
38
+ * - Group radio buttons vertically for easier scanning, especially when labels are lengthy.
39
+ * - Set a clear default when one choice is recommended or most common. Don't leave all options unselected if a helpful default can guide users.
40
+ * - Use concise, descriptive labels for each option.
22
41
  *
42
+ * @usagedonts
43
+ * - Use when users need to select multiple options. Use checkboxes instead.
44
+ * - Use when there are more than 7 options. Use a dropdown for better space utilization.
45
+ * - Use for yes/no questions. Consider `<nys-toggle>` or `<nys-checkbox>` instead.
23
46
  *
24
47
  * @example Pre-selected
25
48
  * ```html
@@ -46,7 +69,6 @@ import "@nysds/nys-label";
46
69
  * </nys-radiogroup>
47
70
  * ```
48
71
  *
49
- * /**
50
72
  * @example Standalone, one per table row
51
73
  * ```html
52
74
  * <nys-table striped bordered>
@@ -183,6 +205,8 @@ export declare class NysRadiobutton extends NysFormControlElement {
183
205
  * --------------------------------------------------------------------------
184
206
  */
185
207
  protected createRenderRoot(): this;
208
+ private _firstUpdatePending;
209
+ protected scheduleUpdate(): Promise<void>;
186
210
  connectedCallback(): void;
187
211
  disconnectedCallback(): void;
188
212
  firstUpdated(): void;
@@ -2,6 +2,29 @@ import { NysFormControlElement } from "@nysds/internals";
2
2
  import "@nysds/nys-label";
3
3
  import "@nysds/nys-errormessage";
4
4
  import "@nysds/nys-textinput";
5
+ /** Detail payload for the `nys-change` event fired by `nys-radiogroup`. */
6
+ export interface NysRadiogroupChangeDetail {
7
+ /** Id of the selected child radiobutton (kept for 1.x compatibility). */
8
+ id: string;
9
+ /** Checked state of the selected child radiobutton (always `true`). */
10
+ checked: boolean;
11
+ /** Name of the selected child radiobutton, which the group adopts. */
12
+ name: string;
13
+ /** The group's selected value. */
14
+ value: string;
15
+ }
16
+ /** The `nys-change` event fired by `nys-radiogroup`. */
17
+ export type NysRadiogroupChangeEvent = CustomEvent<NysRadiogroupChangeDetail>;
18
+ /** Detail payload for the `nys-other-input` event fired by `nys-radiogroup`. */
19
+ export interface NysRadiogroupOtherInputDetail {
20
+ /** Id of the "other" child radiobutton. */
21
+ id: string;
22
+ name: string;
23
+ /** Current text of the "other" free-text field. */
24
+ value: string;
25
+ }
26
+ /** The `nys-other-input` event fired by `nys-radiogroup`. */
27
+ export type NysRadiogroupOtherInputEvent = CustomEvent<NysRadiogroupOtherInputDetail>;
5
28
  /**
6
29
  * A container for grouping `nys-radiobutton` elements as a single form control with enforced single selection.
7
30
  * Handles keyboard navigation (arrow keys), validation, required constraints, and form integration.
@@ -11,10 +34,16 @@ import "@nysds/nys-textinput";
11
34
  *
12
35
  * @summary Container for grouping radio buttons as a single form control.
13
36
  * @element nys-radiogroup
37
+ * @formControl value nys-change
14
38
  *
15
39
  * @slot - Default slot for `nys-radiobutton` elements.
16
40
  * @slot description - Custom HTML description content.
17
41
  *
42
+ * @fires {NysRadiogroupChangeEvent} nys-change - Fired when the selection changes. Detail: `{id, checked, name, value}` — `value` is the selected value; `id`, `checked`, and `name` echo the selected child radio for compatibility. Bubbles and composed.
43
+ * @fires {NysRadiogroupOtherInputEvent} nys-other-input - Fired as the "other" free-text input changes. Detail: `{id, name, value}`. Bubbles and composed.
44
+ * @fires {Event} nys-focus - Fired on the group when focus enters it from outside; also re-dispatched targeted at the focused child radio for compatibility. Bubbles and composed.
45
+ * @fires {Event} nys-blur - Fired on the group when focus leaves it; also re-dispatched targeted at the blurred child radio for compatibility. Bubbles and composed.
46
+ *
18
47
  * @example Basic
19
48
  * ```html
20
49
  * <nys-radiogroup label="Select borough" required>
@@ -138,8 +167,16 @@ export declare class NysRadiogroup extends NysFormControlElement {
138
167
  * @default "md"
139
168
  */
140
169
  size: "sm" | "md";
141
- _showOtherError: boolean;
142
- private selectedValue;
170
+ private _showOtherError;
171
+ private _value;
172
+ private _syncingValueFromChildren;
173
+ /**
174
+ * Value of the selected child radiobutton, or `""` when none is selected.
175
+ * Setting it programmatically checks the matching child and updates the
176
+ * form value without firing `nys-change`. Setting `""` clears the selection.
177
+ */
178
+ get value(): string;
179
+ set value(next: string);
143
180
  private _slottedDescriptionText;
144
181
  private _radios;
145
182
  private _mobileQuery;
@@ -163,10 +200,25 @@ export declare class NysRadiogroup extends NysFormControlElement {
163
200
  * --------------------------------------------------------------------------
164
201
  */
165
202
  private _setValue;
203
+ /**
204
+ * Set `value` from a child selection without pushing the same state back
205
+ * down (and without firing `nys-change`).
206
+ */
207
+ private _setValueFromChild;
208
+ /**
209
+ * Apply a programmatically set `value` to the child radiobuttons and the
210
+ * form value. Setting `checked` on a child never fires `nys-change` (only
211
+ * user interaction does), so no change events echo back.
212
+ */
213
+ private _applyValueToChildren;
214
+ /**
215
+ * Derive `value` from the currently checked child. Runs off the default
216
+ * slot's `slotchange`, so it covers first render and dynamically added
217
+ * radios without scheduling work inside the update cycle.
218
+ */
219
+ private _syncValueFromChildren;
166
220
  private _setRadioButtonRequire;
167
221
  private _manageRequire;
168
- checkValidity(): boolean;
169
- private _initializeCheckedRadioValue;
170
222
  private _getAllRadios;
171
223
  private _handleKeyDown;
172
224
  private _updateGroupTabIndex;
@@ -193,6 +245,16 @@ export declare class NysRadiogroup extends NysFormControlElement {
193
245
  private _handleOtherKeydown;
194
246
  private _handleGroupFocusout;
195
247
  private _handleRadiobtnClick;
248
+ /** True when `node` is inside this group, including its shadow DOM. */
249
+ private _containsFocus;
250
+ /**
251
+ * Group-level focus: fired only when focus enters from outside the group,
252
+ * so moving between the radios stays silent. The per-radio `nys-focus`
253
+ * re-dispatches (targeted at the child) are kept for compatibility.
254
+ */
255
+ private _handleHostFocusIn;
256
+ /** Group-level blur: fired only when focus leaves the group entirely. */
257
+ private _handleHostFocusOut;
196
258
  private _handleRadiobtnFocus;
197
259
  private _handleRadiobtnBlur;
198
260
  render(): import("lit-html").TemplateResult<1>;
@@ -2,6 +2,14 @@ import { NysFormControlElement } from "@nysds/internals";
2
2
  import "@nysds/nys-label";
3
3
  import "@nysds/nys-errormessage";
4
4
  import "@nysds/nys-icon";
5
+ /** Detail payload for the `nys-change` event. */
6
+ export interface NysSelectChangeDetail {
7
+ id: string;
8
+ name: string;
9
+ value: string;
10
+ }
11
+ /** The `nys-change` event, fired when the selection changes. */
12
+ export type NysSelectChangeEvent = CustomEvent<NysSelectChangeDetail>;
5
13
  /**
6
14
  * A dropdown for selecting a single option from a list. Supports native `<option>` and `<optgroup>` elements.
7
15
  * Form-associated with validation via ElementInternals.
@@ -15,9 +23,20 @@ import "@nysds/nys-icon";
15
23
  * @slot - Default slot for `<option>` and `<optgroup>` elements.
16
24
  * @slot description - Custom HTML description content below the label.
17
25
  *
18
- * @fires nys-change - Fired when selection changes. Detail: `{id, value}`.
19
- * @fires nys-focus - Fired when select gains focus.
20
- * @fires nys-blur - Fired when select loses focus. Triggers validation.
26
+ * @formControl value nys-change
27
+ *
28
+ * @fires {NysSelectChangeEvent} nys-change - Fired when the selection changes. Detail: `{id, name, value}`.
29
+ * @fires {Event} nys-focus - Fired when the select gains focus.
30
+ * @fires {Event} nys-blur - Fired when the select loses focus. Triggers validation.
31
+ *
32
+ * @usagedos
33
+ * - Use when a user needs to select a single item from a dropdown list.
34
+ * - Use the `<option>` element to define options and the native `<optgroup>` to group them.
35
+ *
36
+ * @usagedonts
37
+ * - Use when users need to select multiple items. Use a checkbox group instead.
38
+ * - Use the custom `<nys-option>` element. It will be deprecated in the 2.0 release.
39
+ * - Use `<nys-select multiple>`. Use a checkbox group instead.
21
40
  *
22
41
  * @example Basic
23
42
  * ```html
@@ -212,7 +231,6 @@ export declare class NysSelect extends NysFormControlElement {
212
231
  * @default "full"
213
232
  */
214
233
  width: "sm" | "md" | "lg" | "full";
215
- private _originalErrorMessage;
216
234
  private _hasUserInteracted;
217
235
  /**
218
236
  * Lifecycle methods
@@ -8,6 +8,14 @@ import { NysElement } from "@nysds/internals";
8
8
  * @summary Skip navigation link for keyboard accessibility. Hidden until focused.
9
9
  * @element nys-skipnav
10
10
  *
11
+ * @usagedos
12
+ * - Use on pages with a large header, navigation, or other repeated content before the main section.
13
+ * - Ensure the `href` on `<nys-skipnav>` matches the `id` of the main content container.
14
+ *
15
+ * @usagedonts
16
+ * - Use if your layout already starts with the main content and there is nothing to skip over.
17
+ * - Mismatch the `href` and target `id`.
18
+ *
11
19
  * @example Basic
12
20
  * ```html
13
21
  * <nys-skipnav></nys-skipnav>
@@ -1,4 +1,11 @@
1
1
  import { NysElement } from "@nysds/internals";
2
+ /** Detail payload for the `nys-step-click` event fired by `nys-step`. */
3
+ export interface NysStepClickDetail {
4
+ href: string;
5
+ label: string;
6
+ }
7
+ /** The `nys-step-click` event fired by `nys-step`. */
8
+ export type NysStepClickEvent = CustomEvent<NysStepClickDetail>;
2
9
  /**
3
10
  * A single step within `nys-stepper`. Represents one stage in a multi-step process.
4
11
  *
@@ -79,7 +86,7 @@ import { NysElement } from "@nysds/internals";
79
86
  * @summary Individual step for use within nys-stepper with navigation support.
80
87
  * @element nys-step
81
88
  *
82
- * @fires nys-step-click - Fired when a navigable (`previous` or `current`) non-selected step is clicked
89
+ * @fires {NysStepClickEvent} nys-step-click - Fired when a navigable (`previous` or `current`) non-selected step is clicked
83
90
  * or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call
84
91
  * `e.preventDefault()` to suppress `window.location.href` navigation.
85
92
  */
@@ -52,6 +52,14 @@ import "./nys-step";
52
52
  * @slot - Default slot for `nys-step` elements. Only `nys-step` children are accepted; others are removed.
53
53
  * @slot actions - Persistent navigation buttons. Must contain exactly one `<div>` wrapping only `<nys-button>` elements.
54
54
  *
55
+ * @usagedos
56
+ * - Use for linear, ordered forms with more than 2 sections to show progress through a multi-step process.
57
+ * - Ensure users can navigate back to previous steps to review or change information.
58
+ *
59
+ * @usagedonts
60
+ * - Use when a form has only 1 or 2 sections.
61
+ * - Use for forms that are nonlinear and can be completed in any order.
62
+ *
55
63
  * @example Basic
56
64
  * ```html
57
65
  * <div class="nys-grid-row">