@nysds/components 1.21.1 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/custom-elements.json +1524 -1022
  2. package/dist/.vscode/vscode.css-custom-data.json +75 -0
  3. package/dist/.vscode/vscode.html-custom-data.json +99 -54
  4. package/dist/custom-elements.json +1524 -1022
  5. package/dist/{nys-icon.library-C02yNW9R.js → nys-icon.library-BZ3jVyhP.js} +2 -2
  6. package/dist/{nys-icon.library-C02yNW9R.js.map → nys-icon.library-BZ3jVyhP.js.map} +1 -1
  7. package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js → nys-icon.library-DYsQ8Tiv-DYS-TkV2.js} +3 -3
  8. package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js.map → nys-icon.library-DYsQ8Tiv-DYS-TkV2.js.map} +1 -1
  9. package/dist/nysds.es.js +5059 -3637
  10. package/dist/nysds.es.js.map +1 -1
  11. package/dist/nysds.js +248 -244
  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 +17 -0
  50. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +10 -0
  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 +30 -25
  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
@@ -28,9 +28,24 @@ import "@nysds/nys-icon";
28
28
  * @cssprop [--nys-button-border-color--hover] - Border color when hovered.
29
29
  * @cssprop [--nys-button-border-color--active] - Border color when active/pressed.
30
30
  *
31
- * @fires nys-click - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.
32
- * @fires nys-focus - Fired when the button receives focus.
33
- * @fires nys-blur - Fired when the button loses focus.
31
+ * @fires {Event} nys-click - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.
32
+ * @fires {Event} nys-focus - Fired when the button receives focus.
33
+ * @fires {Event} nys-blur - Fired when the button loses focus.
34
+ *
35
+ * @usagedos
36
+ * - Use for the most important actions you want users to take, such as "Download", "Sign up", or "Log out".
37
+ * - Use `variant="fill"` for the primary action on the page. There should be only one primary action per page.
38
+ * - Use `variant="outline"` for secondary actions, placed next to the primary Fill button.
39
+ * - Use `variant="ghost"` buttons for additional actions beyond primary and secondary.
40
+ * - Use `variant="text"` buttons when an action needs to appear within a text block. If clicking takes the user somewhere else, use a Link instead.
41
+ * - Always set the `type` attribute (`submit`, `button`, or `reset`). The default is `button`.
42
+ * - Use sentence case for button labels, only capitalizing the first word.
43
+ * - Place a `chevron_down icon` on the right for buttons that open a dropdown.
44
+ *
45
+ * @usagedonts
46
+ * - Use buttons for navigation. Use an `<a>` element or Text button for links that take users somewhere else.
47
+ * - Use icons in buttons without a text label. Very few icons are universally understood.
48
+ * - Create custom button styles (color, shape, size). Consistency helps users recognize buttons and predict behavior.
34
49
  *
35
50
  * @example Basic
36
51
  * ```html
@@ -245,7 +260,18 @@ export declare class NysButton extends NysFormControlElement {
245
260
  */
246
261
  form: string | null;
247
262
  /**
248
- * Value submitted with form data. Only used when `type="submit"`.
263
+ * Value submitted with the form data, mirroring a native submit button.
264
+ *
265
+ * When `type="submit"` and both `name` and `value` are set, the entry
266
+ * `name=value` is included in the form's data only for submissions this
267
+ * button triggers. It is not included when the form is submitted another
268
+ * way (Enter in a text field, another button, `form.requestSubmit()`),
269
+ * and it is not readable from `new FormData(form)` outside a submission,
270
+ * matching native submitter semantics.
271
+ *
272
+ * A form-associated custom element cannot act as a native submitter, so
273
+ * the value is staged through `ElementInternals.setFormValue()` for the
274
+ * duration of the submission and cleared afterward.
249
275
  */
250
276
  value: string;
251
277
  /**
@@ -259,6 +285,11 @@ export declare class NysButton extends NysFormControlElement {
259
285
  type: "submit" | "reset" | "button";
260
286
  /**
261
287
  * Click handler. Use instead of `@click` to ensure keyboard accessibility.
288
+ *
289
+ * @deprecated Listen for the `nys-click` event instead. `nys-click`
290
+ * bubbles, is composed, and fires for both mouse and keyboard activation
291
+ * but never while disabled. This property still works but is excluded
292
+ * from generated framework wrappers and goes away in 2.0.
262
293
  */
263
294
  onClick: ((event: Event) => void) | null;
264
295
  /**
@@ -35,6 +35,26 @@ type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
35
35
  * @fires nys-focus - Fired when an interactive card receives focus.
36
36
  * @fires nys-blur - Fired when an interactive card loses focus.
37
37
  *
38
+ * @usagedos
39
+ * - Use a card to group content and actions about a single subject, such as one program, event, or news item.
40
+ * - Set `headingLevel` so the card heading fits the surrounding page hierarchy.
41
+ * - Keep headings short and specific, so a card is understandable on its own.
42
+ * - Put actions in the `footer` slot as real buttons or links.
43
+ * - Use `href` or `onClick` when the whole card leads to one destination or performs one action, and add an icon to the footer slot so the interaction is visible.
44
+ * - Keep cards in the same group consistent in structure, so they are easy to scan and compare.
45
+ * - Repeat any information shown in the `media` or the `media-accent` slot in the card's text.
46
+ * - Place each card in a grid column to control its width, and set `--nys-card-height: 100%` when a row of cards should share one height.
47
+ *
48
+ * @usagedonts
49
+ * - Use a card as a substitute for a page section heading or for content that belongs in the page flow.
50
+ * - Put buttons, links, or other interactive elements in the slots of a card that has `href` or a click handler. That card is already a single control.
51
+ * - Set both `href` and a click handler on the same card.
52
+ * - Put more than one primary action in a card.
53
+ * - Rely on the `media` image or the `media-accent` slot to convey information that appears nowhere else.
54
+ * - Mix `elevated` and non-elevated cards within the same group.
55
+ * - Skip heading levels to get a particular text size. Use `headingLevel` for structure, not for styling.
56
+ * - Use cards for long-form content that a user needs to read in order.
57
+ *
38
58
  * @example Basic
39
59
  * ```html
40
60
  * <div class="nys-tablet:nys-grid-col-6 nys-desktop:nys-grid-col-3">
@@ -4,6 +4,51 @@ import "@nysds/nys-label";
4
4
  import "@nysds/nys-errormessage";
5
5
  import "@nysds/nys-icon";
6
6
  import "@nysds/nys-textinput";
7
+ /** Detail payload for the `nys-change` event fired by `nys-checkbox`. */
8
+ export interface NysCheckboxChangeDetail {
9
+ id: string;
10
+ checked: boolean;
11
+ name: string;
12
+ value: string;
13
+ }
14
+ /** The `nys-change` event fired by `nys-checkbox`. */
15
+ export type NysCheckboxChangeEvent = CustomEvent<NysCheckboxChangeDetail>;
16
+ /** Detail payload for the `nys-other-input` event fired by `nys-checkbox`. */
17
+ export interface NysCheckboxOtherInputDetail {
18
+ id: string;
19
+ name: string;
20
+ value: string;
21
+ }
22
+ /** The `nys-other-input` event fired by `nys-checkbox`. */
23
+ export type NysCheckboxOtherInputEvent = CustomEvent<NysCheckboxOtherInputDetail>;
24
+ /**
25
+ * Detail payload for the `nys-error` group-coordination event.
26
+ * @internal
27
+ */
28
+ export interface NysCheckboxErrorDetail {
29
+ id: string;
30
+ name: string;
31
+ type: "other";
32
+ message: string;
33
+ sourceCheckbox: NysCheckbox;
34
+ }
35
+ /**
36
+ * The `nys-error` group-coordination event.
37
+ * @internal
38
+ */
39
+ export type NysCheckboxErrorEvent = CustomEvent<NysCheckboxErrorDetail>;
40
+ /**
41
+ * Detail payload for the `nys-error-clear` group-coordination event.
42
+ * @internal
43
+ */
44
+ export interface NysCheckboxErrorClearDetail {
45
+ sourceCheckbox: NysCheckbox;
46
+ }
47
+ /**
48
+ * The `nys-error-clear` group-coordination event.
49
+ * @internal
50
+ */
51
+ export type NysCheckboxErrorClearEvent = CustomEvent<NysCheckboxErrorClearDetail>;
7
52
  /**
8
53
  * A checkbox input for binary choices or multi-select lists. Can be used standalone or in a `nys-checkboxgroup`.
9
54
  * Form-associated with validation via ElementInternals.
@@ -13,13 +58,27 @@ import "@nysds/nys-textinput";
13
58
  *
14
59
  * @summary Checkbox for binary choices or multi-select options.
15
60
  * @element nys-checkbox
61
+ * @formControl checked nys-change
16
62
  *
17
63
  * @slot description - Custom HTML description content.
18
64
  *
19
- * @fires nys-change - Fired when checked state changes. Detail: `{id, checked, name, value}`.
20
- * @fires nys-focus - Fired when checkbox gains focus.
21
- * @fires nys-blur - Fired when checkbox loses focus.
22
- * @fires nys-other-input - Fired when "other" text input value changes. Detail: `{id, name, value}`.
65
+ * @fires {NysCheckboxChangeEvent} nys-change - Fired when checked state changes. Detail: `{id, checked, name, value}`. Bubbles and composed.
66
+ * @fires {Event} nys-focus - Fired when checkbox gains focus. Bubbles and composed.
67
+ * @fires {Event} nys-blur - Fired when checkbox loses focus. Bubbles and composed.
68
+ * @fires {NysCheckboxOtherInputEvent} nys-other-input - Fired when "other" text input value changes. Detail: `{id, name, value}`.
69
+ * @fires {NysCheckboxErrorEvent} nys-error - Internal group coordination: reports an empty "other" field to the parent `nys-checkboxgroup`. Not part of the public API.
70
+ * @fires {NysCheckboxErrorClearEvent} nys-error-clear - Internal group coordination: clears a previously reported "other" field error. Not part of the public API.
71
+ *
72
+ * @usagedos
73
+ * - Use for binary decisions (agree/disagree), confirmation, or multi-select lists.
74
+ * - Use for selecting multiple options from a list of up to 10 choices.
75
+ * - Use `nys-checkboxgroup` to group checkboxes with a shared label and description.
76
+ *
77
+ * @usagedonts
78
+ * - Use when users need to select only one option. Use a `<nys-radiobutton>` for 1–6 choices or a <nys-select> for 7 or more.
79
+ * - Use a checkbox when changing its state immediately affects the system. Use a `<nys-toggle>` instead (e.g., enabling Dark Mode).
80
+ * - Use when you have more than 10 options to choose from.
81
+ * - Change the state of one checkbox based on another being clicked.
23
82
  *
24
83
  * @example Single
25
84
  * ```html
@@ -63,7 +122,12 @@ export declare class NysCheckbox extends NysFormControlElement {
63
122
  showError: boolean;
64
123
  /** Error message text. Shown only when `showError` is true. */
65
124
  errorMessage: string;
66
- /** Internal: Set by parent checkboxgroup. Do not set manually. */
125
+ /**
126
+ * Set by the parent `nys-checkboxgroup` (via property) when all checkboxes
127
+ * in the group share a name, so the group owns the combined form value.
128
+ * Internal coordination state. Do not set manually.
129
+ * @internal
130
+ */
67
131
  groupExist: boolean;
68
132
  /** Renders as tile with larger clickable area. Apply to group for consistency. */
69
133
  tile: boolean;
@@ -74,7 +138,13 @@ export declare class NysCheckbox extends NysFormControlElement {
74
138
  * @default "md"
75
139
  */
76
140
  size: "sm" | "md";
141
+ /** Renders an additional free-text input when checked ("Other" option). */
77
142
  other: boolean;
143
+ /**
144
+ * Whether the "other" free-text field is in an error state. Managed by the
145
+ * component during validation; treat as read-only.
146
+ * @internal
147
+ */
78
148
  showOtherError: boolean;
79
149
  /**
80
150
  * Id of an element in the host's light-DOM tree to borrow the accessible name
@@ -129,8 +199,8 @@ export declare class NysCheckbox extends NysFormControlElement {
129
199
  checkValidity(): boolean;
130
200
  private _handleInvalid;
131
201
  private _manageLabelClick;
132
- get _hasDescription(): boolean;
133
- get _isStandalone(): boolean;
202
+ private get _hasDescription();
203
+ private get _isStandalone();
134
204
  /**
135
205
  * Event Handlers
136
206
  * --------------------------------------------------------------------------
@@ -1,6 +1,14 @@
1
1
  import { NysFormControlElement } from "@nysds/internals";
2
2
  import "@nysds/nys-label";
3
3
  import "@nysds/nys-errormessage";
4
+ /** Detail payload for the `nys-change` event fired by `nys-checkboxgroup`. */
5
+ export interface NysCheckboxgroupChangeDetail {
6
+ id: string;
7
+ name: string;
8
+ value: string[];
9
+ }
10
+ /** The `nys-change` event fired by `nys-checkboxgroup`. */
11
+ export type NysCheckboxgroupChangeEvent = CustomEvent<NysCheckboxgroupChangeDetail>;
4
12
  /**
5
13
  * A container for grouping multiple `nys-checkbox` components as a single form control.
6
14
  * Handles validation, required constraints, and submits comma-separated values.
@@ -10,10 +18,15 @@ import "@nysds/nys-errormessage";
10
18
  *
11
19
  * @summary Container for grouping checkboxes as a single form control.
12
20
  * @element nys-checkboxgroup
21
+ * @formControl value nys-change
13
22
  *
14
23
  * @slot - Default slot for `nys-checkbox` elements.
15
24
  * @slot description - Custom HTML description content.
16
25
  *
26
+ * @fires {NysCheckboxgroupChangeEvent} nys-change - Fired when any child checkbox changes. Detail: `{id, name, value}` where `value` is the checked values as a string array. Bubbles and composed. The child's own `nys-change` keeps bubbling alongside it.
27
+ * @fires {Event} nys-focus - Fired when focus enters the group from outside. Bubbles and composed.
28
+ * @fires {Event} nys-blur - Fired when focus leaves the group. Bubbles and composed.
29
+ *
17
30
  * @example Basic
18
31
  * ```html
19
32
  * <nys-checkboxgroup label="Select landmarks" required>
@@ -133,6 +146,15 @@ export declare class NysCheckboxgroup extends NysFormControlElement {
133
146
  * @default "md"
134
147
  */
135
148
  size: "sm" | "md";
149
+ private _value;
150
+ private _syncingValueFromChildren;
151
+ /**
152
+ * Values of the checked child checkboxes, in DOM order. Setting it
153
+ * programmatically checks the matching children and updates the form value
154
+ * without firing `nys-change`.
155
+ */
156
+ get value(): string[];
157
+ set value(next: string[]);
136
158
  private _slottedDescriptionText;
137
159
  private _hasOtherError;
138
160
  private _otherErrorCheckbox;
@@ -171,6 +193,30 @@ export declare class NysCheckboxgroup extends NysFormControlElement {
171
193
  private _handleChildError;
172
194
  private _handleChildErrorClear;
173
195
  private _handleOtherInput;
196
+ /**
197
+ * Group-level focus: fired only when focus enters from outside the group,
198
+ * so moving between child checkboxes stays silent.
199
+ */
200
+ private _handleFocusIn;
201
+ /** Group-level blur: fired only when focus leaves the group entirely. */
202
+ private _handleFocusOut;
203
+ /**
204
+ * Set `value` from the children's checked state without pushing the same
205
+ * state back down (and without firing `nys-change`).
206
+ */
207
+ private _setValueFromChildren;
208
+ /**
209
+ * Apply a programmatically set `value` to the child checkboxes and the form
210
+ * value. Setting `checked` on a child never fires its `nys-change` (only
211
+ * user interaction does), so no change events echo back.
212
+ */
213
+ private _applyValueToChildren;
214
+ /**
215
+ * Derive `value` from the checked children. Runs off the default slot's
216
+ * `slotchange`, so it covers first render and dynamically added checkboxes
217
+ * without scheduling a second update cycle.
218
+ */
219
+ private _handleDefaultSlotChange;
174
220
  private _checkOtherInputs;
175
221
  /** Drupal-like naming support **/
176
222
  private _checkSharedNames;
@@ -3,6 +3,25 @@ import "@nysds/nys-label";
3
3
  import "@nysds/nys-errormessage";
4
4
  import "@nysds/nys-icon";
5
5
  import "@nysds/nys-button";
6
+ /** Detail payload for the `nys-input` event. */
7
+ export interface NysComboboxInputDetail {
8
+ id: string;
9
+ name: string;
10
+ /** The committed value (the selected option's value), not the filter text. */
11
+ value: string;
12
+ /** The raw filter text the user has typed. */
13
+ query: string;
14
+ }
15
+ /** The `nys-input` event, fired on each keystroke while filtering. */
16
+ export type NysComboboxInputEvent = CustomEvent<NysComboboxInputDetail>;
17
+ /** Detail payload for the `nys-change` event. */
18
+ export interface NysComboboxChangeDetail {
19
+ id: string;
20
+ name: string;
21
+ value: string;
22
+ }
23
+ /** The `nys-change` event, fired when a selection is committed. */
24
+ export type NysComboboxChangeEvent = CustomEvent<NysComboboxChangeDetail>;
6
25
  /**
7
26
  * `<nys-combobox>` is a form-enabled combo box combining text input with a filterable dropdown.
8
27
  *
@@ -19,11 +38,21 @@ import "@nysds/nys-button";
19
38
  * @slot description - Optional custom description content below the label.
20
39
  * @slot default - Options (<option>, <optgroup>) to populate the dropdown
21
40
  *
22
- * @fires nys-change - Fired when selection changes. Detail: `{ id, value }`.
23
- * @fires nys-input - Fired on input change. Detail: `{ id, value }`.
24
- * @fires nys-focus - Fired when combobox receives focus.
25
- * @fires nys-blur - Fired when combobox loses focus.
41
+ * @formControl value nys-change nys-input
42
+ *
43
+ * @fires {NysComboboxChangeEvent} nys-change - Fired when a selection is committed (option chosen or cleared). Detail: `{id, name, value}`.
44
+ * @fires {NysComboboxInputEvent} nys-input - Fired on each keystroke while filtering. Detail: `{id, name, value, query}`. `value` is the committed value; `query` is the current filter text.
45
+ * @fires {Event} nys-focus - Fired when the combobox gains focus.
46
+ * @fires {Event} nys-blur - Fired when the combobox loses focus. Triggers validation.
47
+ *
48
+ * @usagedos
49
+ * - Use when there are more than 15 options to choose from.
50
+ * - Use when screen real estate is limited.
51
+ * - Use when users can predict or recognize the value they're looking for.
26
52
  *
53
+ * @usagedonts
54
+ * - Use when the number of options is small. Use `<nys-select>` or `<nys-radiobutton>` instead.
55
+ * - Use when options are unfamiliar to users and browsing the full list is necessary.
27
56
  *
28
57
  * @example Basic
29
58
  * ```html
@@ -153,7 +182,7 @@ import "@nysds/nys-button";
153
182
  * <option value="orange">Orange</option>
154
183
  * <option value="strawberry">Strawberry</option>
155
184
  * </nys-combobox>
156
- * ```d
185
+ * ```
157
186
  *
158
187
  * @example Description Slot
159
188
  * ```html
@@ -198,19 +227,36 @@ export declare class NysCombobox extends NysFormControlElement {
198
227
  serializable?: boolean;
199
228
  slotAssignment?: SlotAssignmentMode;
200
229
  };
230
+ /** Unique identifier. Auto-generated if not provided. */
201
231
  id: string;
232
+ /** Name for form submission. */
202
233
  name: string;
234
+ /** Visible label text. Required for accessibility. */
203
235
  label: string;
236
+ /** Helper text below label. Use slot for custom HTML. */
204
237
  description: string;
238
+ /** Current committed value: the selected option's value, not the typed filter text. */
205
239
  value: string;
240
+ /** Prevents interaction. */
206
241
  disabled: boolean;
242
+ /** Marks as required. Shows "Required" flag and validates on blur. */
207
243
  required: boolean;
244
+ /** Shows "Optional" flag. Use when most fields are required. */
208
245
  optional: boolean;
246
+ /** Tooltip text shown on hover/focus of info icon. */
209
247
  tooltip: string;
248
+ /** Form `id` to associate with when the combobox is outside the form element. */
210
249
  form: string | null;
250
+ /**
251
+ * Input width: `md` (200px), `lg` (384px), `full` (100%, default).
252
+ * @default "full"
253
+ */
211
254
  width: "md" | "lg" | "full";
255
+ /** Adjusts colors for dark backgrounds. */
212
256
  inverted: boolean;
257
+ /** Shows error message when true. Set by validation or manually. */
213
258
  showError: boolean;
259
+ /** Error message text. Shown only when `showError` is true. Never overwritten by internal validation. */
214
260
  errorMessage: string;
215
261
  private _isOpen;
216
262
  private _filterText;
@@ -221,7 +267,6 @@ export declare class NysCombobox extends NysFormControlElement {
221
267
  private _announcement;
222
268
  private _input;
223
269
  private _listbox?;
224
- private _originalErrorMessage;
225
270
  private _hasUserInteracted;
226
271
  private _selectedLabel;
227
272
  private _defaultValue;
@@ -3,6 +3,24 @@ import "@nysds/nys-label";
3
3
  import "@nysds/nys-errormessage";
4
4
  import "@nysds/nys-icon";
5
5
  import "@nysds/nys-button";
6
+ /** Detail payload for the `nys-input` event. */
7
+ export interface NysDatepickerInputDetail {
8
+ id: string;
9
+ name: string;
10
+ /** The current `value` property: a `Date`, a `YYYY-MM-DD` string, or `undefined`. */
11
+ value: string | Date | undefined;
12
+ }
13
+ /** The `nys-input` event, fired as the date value updates. */
14
+ export type NysDatepickerInputEvent = CustomEvent<NysDatepickerInputDetail>;
15
+ /** Detail payload for the `nys-change` event. */
16
+ export interface NysDatepickerChangeDetail {
17
+ id: string;
18
+ name: string;
19
+ /** The committed date, always a `YYYY-MM-DD` string. Empty string when cleared. */
20
+ value: string;
21
+ }
22
+ /** The `nys-change` event, fired on a committed selection. */
23
+ export type NysDatepickerChangeEvent = CustomEvent<NysDatepickerChangeDetail>;
6
24
  /**
7
25
  * Date picker with calendar popup and form validation. Falls back to native date input
8
26
  * on Safari and mobile.
@@ -10,8 +28,26 @@ import "@nysds/nys-button";
10
28
  * @summary Date picker with calendar popup and native fallback.
11
29
  * @element nys-datepicker
12
30
  *
13
- * @fires nys-blur - Fired when input or calendar loses focus. Triggers validation.
14
- * @fires nys-input - Fired on date selection. Detail: `{id, value}`.
31
+ * @formControl value nys-change nys-input
32
+ *
33
+ * @fires {NysDatepickerInputEvent} nys-input - Fired as the date value updates (valid typed date, calendar pick, Today, Clear). Detail: `{id, name, value}` where `value` is the current `value` property.
34
+ * @fires {NysDatepickerChangeEvent} nys-change - Fired on committed selection: calendar pick, valid typed date on blur, Today, Clear. Detail: `{id, name, value}` where `value` is always the `YYYY-MM-DD` string, empty string when cleared.
35
+ * @fires {Event} nys-focus - Fired when focus enters the component from outside.
36
+ * @fires {Event} nys-blur - Fired when input or calendar loses focus. Triggers validation.
37
+ *
38
+ * @usagedos
39
+ * - Use when users need to select a single calendar date, such as scheduling an appointment or choosing a filing deadline, especially when the day of the week matters.
40
+ * - Set the `label` property to clearly describe what date is being collected. Every datepicker needs one for accessibility.
41
+ * - Add `description` text to specify the expected format or provide context.
42
+ * - Set `required` when the date is mandatory for form submission; don't set both `required` and `optional` on the same component.
43
+ * - Use `startDate` to open the calendar to a relevant month when the expected date is far from today.
44
+ * - Pass date values as ISO strings (`"YYYY-MM-DD"`) rather than `Date` objects to avoid timezone issues.
45
+ *
46
+ * @usagedonts
47
+ * - Use for dates users know from memory, such as date of birth or document issue dates. A text input with separate month/day/year fields is more efficient.
48
+ * - Use when users need to select multiple dates or a date range, or when time selection is required alongside the date.
49
+ * - Rely on the calendar popup alone. Safari and mobile browsers use the native date picker instead.
50
+ * - Use `hideTodayButton` and `hideClearButton` together unless users must select a specific date and cannot be allowed to clear it.
15
51
  *
16
52
  * @example Basic
17
53
  * ```html
@@ -158,6 +194,7 @@ export declare class NysDatepicker extends NysFormControlElement {
158
194
  private datepickerIsOpen;
159
195
  private readonly DATEPICKER_GAP;
160
196
  private _hasUserInteracted;
197
+ private _dirtySinceCommit;
161
198
  /**
162
199
  * Lifecycle methods
163
200
  * --------------------------------------------------------------------------
@@ -214,12 +251,17 @@ export declare class NysDatepicker extends NysFormControlElement {
214
251
  private _setTodayDate;
215
252
  private _setFocusOnTodayDate;
216
253
  private _isOutOfRange;
254
+ private _valueAsString;
217
255
  private _dispatchInputEvent;
256
+ private _dispatchChangeEvent;
257
+ private _closeCalendar;
258
+ private _focusInput;
218
259
  /**
219
260
  * Event Handlers
220
261
  * --------------------------------------------------------------------------
221
262
  */
222
263
  private _handleInputKeydown;
264
+ private _handleFocus;
223
265
  private _handleBlur;
224
266
  private _onDocumentClick;
225
267
  private _onKeydownEsc;
@@ -8,6 +8,15 @@ import { NysReflectsAriaElement } from "@nysds/internals";
8
8
  * @summary Horizontal divider for visual separation of content sections.
9
9
  * @element nys-divider
10
10
  *
11
+ * @usagedos
12
+ * - Ensure consistent padding/margin above and below dividers to avoid crowding.
13
+ * - Use the `inverted` option on dark backgrounds.
14
+ *
15
+ * @usagedonts
16
+ * - Overuse dividers and clutter the interface, reducing scannability.
17
+ * - Use the divider to separate content appearing side bys side.
18
+ * - Use the `inverted` option on light backgrounds.
19
+ *
11
20
  * @example Basic
12
21
  * ```html
13
22
  * <p>Section one content</p>
@@ -8,6 +8,20 @@ type Position = "bottom-start" | "bottom-end" | "top-start" | "top-end";
8
8
  * @summary Action menu with auto-positioning, keyboard support, and screen reader integration.
9
9
  * @element nys-dropdownmenu
10
10
  *
11
+ * @usagedos
12
+ * - Use to display a list of 5–15 actions or links under a single trigger, such as navigation, commands, or user profile access.
13
+ * - Keep to 3–7 actions when possible.
14
+ * - Order actions by frequency or importance.
15
+ * - Separate destructive actions with a divider.
16
+ * - Use clear, specific labels (e.g., "Profile", "Account Settings", "Sign out").
17
+ *
18
+ * @usagedonts
19
+ * - Use for form inputs or selectable values. Use `<nys-select>` for standard selection or `<nys-combobox>` when users need to filter or search through many options.
20
+ * - Use when the action is always visible and frequently used. Use `<nys-button>` instead.
21
+ * - Use without a label or accessible description on the trigger.
22
+ * - Nest dropdown menus inside other dropdown menus.
23
+ * - Use vague labels like "Manage" or "Options".
24
+ *
11
25
  * @example Basic
12
26
  * ```html
13
27
  * <nys-button id="my-trigger-id" label="Open Menu"></nys-button>
@@ -55,6 +69,7 @@ export declare class NysDropdownMenu extends NysElement {
55
69
  private _lastFocusedIndex;
56
70
  private readonly GAP;
57
71
  private _resizeObserver;
72
+ private _wiredFor;
58
73
  /**
59
74
  * Lifecycle Methods
60
75
  * --------------------------------------------------------------------------
@@ -63,12 +78,14 @@ export declare class NysDropdownMenu extends NysElement {
63
78
  connectedCallback(): void;
64
79
  disconnectedCallback(): void;
65
80
  firstUpdated(): Promise<void>;
81
+ updated(changedProperties: Map<string | number | symbol, unknown>): void;
66
82
  /**
67
83
  * Functions
68
84
  * --------------------------------------------------------------------------
69
85
  */
70
86
  private _findTrigger;
71
87
  private _connectTrigger;
88
+ private _disconnectTrigger;
72
89
  private _toggleDropdown;
73
90
  private _closeDropdown;
74
91
  private _getMenuItems;
@@ -1,5 +1,13 @@
1
1
  import { NysElement } from "@nysds/internals";
2
2
  import "@nysds/nys-icon";
3
+ /** Detail payload for the `nys-click` event fired by `nys-dropdownmenuitem`. */
4
+ export interface NysDropdownmenuitemClickDetail {
5
+ id: string;
6
+ label: string;
7
+ href?: string;
8
+ }
9
+ /** The `nys-click` event fired by `nys-dropdownmenuitem`. */
10
+ export type NysDropdownmenuitemClickEvent = CustomEvent<NysDropdownmenuitemClickDetail>;
3
11
  /**
4
12
  * **Slotted component.** Displays an individual dropdown item within `nys-dropdown` with label.
5
13
  *
@@ -8,6 +16,8 @@ import "@nysds/nys-icon";
8
16
  *
9
17
  * @summary Dropdown item to display label and provide href link.
10
18
  * @element nys-dropdownmenuitem
19
+ *
20
+ * @fires {NysDropdownmenuitemClickEvent} nys-click - Fired when the item is activated (unless disabled). Detail: `{id, label, href?}` — `href` is present only when set. Bubbles and composed.
11
21
  */
12
22
  export declare class NysDropdownMenuItem extends NysElement {
13
23
  static styles: import("lit").CSSResult;
@@ -1 +1,2 @@
1
1
  export * from "./nys-fileinput";
2
+ export * from "./nys-fileitem";
@@ -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;