@nysds/components 1.20.0-alpha1 → 1.20.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 (135) hide show
  1. package/custom-elements.json +7119 -3701
  2. package/dist/.vscode/vscode.css-custom-data.json +5 -0
  3. package/dist/.vscode/vscode.html-custom-data.json +317 -38
  4. package/dist/custom-elements.json +7119 -3701
  5. package/dist/nys-icon.library-Bu3noJqZ-1mvg_e5Y.js +706 -0
  6. package/dist/nys-icon.library-Bu3noJqZ-1mvg_e5Y.js.map +1 -0
  7. package/dist/nys-icon.library-eNVZmfkf.js +696 -0
  8. package/dist/nys-icon.library-eNVZmfkf.js.map +1 -0
  9. package/dist/nysds.es.js +9119 -4161
  10. package/dist/nysds.es.js.map +1 -1
  11. package/dist/nysds.js +2413 -492
  12. package/dist/nysds.js.map +1 -1
  13. package/dist/packages/internals/src/aria-associate.d.ts +41 -0
  14. package/dist/packages/internals/src/form-control-mixin.d.ts +34 -0
  15. package/dist/packages/internals/src/id.d.ts +8 -0
  16. package/dist/packages/internals/src/identified-mixin.d.ts +23 -0
  17. package/dist/packages/internals/src/index.d.ts +7 -0
  18. package/dist/packages/internals/src/reflects-aria-mixin.d.ts +33 -0
  19. package/dist/packages/internals/src/test-helpers.d.ts +29 -0
  20. package/dist/packages/internals/src/types.d.ts +9 -0
  21. package/dist/packages/nys-accordion/src/nys-accordion.d.ts +72 -10
  22. package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +63 -8
  23. package/dist/packages/nys-alert/src/nys-alert.d.ts +95 -20
  24. package/dist/packages/nys-avatar/src/nys-avatar.d.ts +100 -7
  25. package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +75 -5
  26. package/dist/packages/nys-badge/src/nys-badge.d.ts +63 -6
  27. package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +79 -10
  28. package/dist/packages/nys-button/src/nys-button.d.ts +132 -26
  29. package/dist/packages/nys-card/src/index.d.ts +1 -0
  30. package/dist/packages/nys-card/src/nys-card.d.ts +325 -0
  31. package/dist/packages/nys-card/src/nys-card.figma.d.ts +1 -0
  32. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +37 -12
  33. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +84 -6
  34. package/dist/packages/nys-combobox/src/nys-combobox.d.ts +174 -5
  35. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +83 -13
  36. package/dist/packages/nys-divider/src/nys-divider.d.ts +33 -9
  37. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +24 -15
  38. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +3 -12
  39. package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +22 -0
  40. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +129 -12
  41. package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +23 -2
  42. package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +99 -9
  43. package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +197 -7
  44. package/dist/packages/nys-icon/src/icon-cache.d.ts +11 -4
  45. package/dist/packages/nys-icon/src/icon-library-registry.d.ts +33 -16
  46. package/dist/packages/nys-icon/src/index.d.ts +2 -2
  47. package/dist/packages/nys-icon/src/nys-icon.d.ts +98 -8
  48. package/dist/packages/nys-iconlist/src/index.d.ts +2 -0
  49. package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +92 -0
  50. package/dist/packages/nys-iconlist/src/nys-iconlist.figma.d.ts +1 -0
  51. package/dist/packages/nys-iconlist/src/nys-iconlistitem.d.ts +32 -0
  52. package/dist/packages/nys-label/src/nys-label.d.ts +37 -2
  53. package/dist/packages/nys-modal/src/nys-modal.d.ts +145 -13
  54. package/dist/packages/nys-pagination/src/nys-pagination.d.ts +67 -3
  55. package/dist/packages/nys-processlist/src/index.d.ts +2 -0
  56. package/dist/packages/nys-processlist/src/nys-processlist.d.ts +184 -0
  57. package/dist/packages/nys-processlist/src/nys-processlist.figma.d.ts +1 -0
  58. package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +41 -0
  59. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +201 -7
  60. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +88 -6
  61. package/dist/packages/nys-select/src/nys-option.d.ts +0 -8
  62. package/dist/packages/nys-select/src/nys-select.d.ts +150 -15
  63. package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +4 -4
  64. package/dist/packages/nys-stepper/src/nys-step.d.ts +26 -20
  65. package/dist/packages/nys-stepper/src/nys-stepper.d.ts +128 -75
  66. package/dist/packages/nys-tab/src/nys-tab.d.ts +19 -10
  67. package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +181 -39
  68. package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +15 -24
  69. package/dist/packages/nys-table/src/nys-table.d.ts +90 -3
  70. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +60 -10
  71. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +77 -14
  72. package/dist/packages/nys-toggle/src/nys-toggle.d.ts +47 -10
  73. package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +48 -8
  74. package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +45 -4
  75. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +219 -10
  76. package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +421 -37
  77. package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +4 -54
  78. package/dist/packages/nys-video/src/nys-video.d.ts +67 -7
  79. package/dist/src/index.d.ts +5 -2
  80. package/package.json +15 -7
  81. package/packages/react/NysAccordion.d.ts +10 -0
  82. package/packages/react/NysAccordion.js +2 -1
  83. package/packages/react/NysAccordionItem.d.ts +10 -0
  84. package/packages/react/NysAccordionItem.js +3 -1
  85. package/packages/react/NysAlert.d.ts +8 -10
  86. package/packages/react/NysAlert.js +0 -2
  87. package/packages/react/NysAvatar.d.ts +11 -1
  88. package/packages/react/NysBacktotop.d.ts +3 -0
  89. package/packages/react/NysBacktotop.js +2 -1
  90. package/packages/react/NysBreadcrumbs.d.ts +2 -2
  91. package/packages/react/NysButton.d.ts +38 -8
  92. package/packages/react/NysButton.js +6 -4
  93. package/packages/react/NysCard.d.ts +110 -0
  94. package/packages/react/NysCard.js +61 -0
  95. package/packages/react/NysCheckbox.d.ts +9 -0
  96. package/packages/react/NysCheckbox.js +4 -0
  97. package/packages/react/NysDropdownMenu.d.ts +4 -2
  98. package/packages/react/NysFileinput.d.ts +25 -3
  99. package/packages/react/NysFileinput.js +8 -1
  100. package/packages/react/NysGlobalFooter.d.ts +17 -0
  101. package/packages/react/NysGlobalFooter.js +10 -2
  102. package/packages/react/NysGlobalHeader.d.ts +23 -1
  103. package/packages/react/NysGlobalHeader.js +11 -2
  104. package/packages/react/NysIconlist.d.ts +54 -0
  105. package/packages/react/NysIconlist.js +22 -0
  106. package/packages/react/NysIconlistitem.d.ts +59 -0
  107. package/packages/react/NysIconlistitem.js +22 -0
  108. package/packages/react/NysLabel.d.ts +4 -1
  109. package/packages/react/NysModal.d.ts +8 -1
  110. package/packages/react/NysModal.js +11 -2
  111. package/packages/react/NysProcesslist.d.ts +65 -0
  112. package/packages/react/NysProcesslist.js +25 -0
  113. package/packages/react/NysProcesslistitem.d.ts +61 -0
  114. package/packages/react/NysProcesslistitem.js +35 -0
  115. package/packages/react/NysRadiobutton.d.ts +27 -3
  116. package/packages/react/NysRadiobutton.js +9 -1
  117. package/packages/react/NysSelect.d.ts +3 -0
  118. package/packages/react/NysSelect.js +2 -0
  119. package/packages/react/NysStepper.d.ts +1 -1
  120. package/packages/react/NysTabgroup.d.ts +5 -4
  121. package/packages/react/NysTable.d.ts +1 -1
  122. package/packages/react/NysTabpanel.d.ts +11 -4
  123. package/packages/react/NysTextarea.d.ts +4 -1
  124. package/packages/react/NysTextarea.js +2 -0
  125. package/packages/react/NysUnavFooter.d.ts +13 -0
  126. package/packages/react/NysUnavFooter.js +4 -1
  127. package/packages/react/NysUnavHeader.d.ts +24 -1
  128. package/packages/react/NysUnavHeader.js +17 -1
  129. package/packages/react/NysVerticalnav.d.ts +15 -8
  130. package/packages/react/NysVerticalnav.js +6 -4
  131. package/packages/react/NysVerticalnavGroup.d.ts +4 -0
  132. package/packages/react/NysVerticalnavGroup.js +5 -0
  133. package/packages/react/index.d.ts +5 -0
  134. package/packages/react/index.js +5 -0
  135. package/packages/react/nysds-jsx.d.ts +394 -56
@@ -0,0 +1,61 @@
1
+ import React, { forwardRef, useRef, useEffect } from "react";
2
+ import "../../dist/nysds.es.js";
3
+ import { useEventListener, useProperties } from "./react-utils.js";
4
+
5
+ export const NysCard = forwardRef((props, forwardedRef) => {
6
+ const ref = useRef(null);
7
+ const {
8
+ inset,
9
+ elevated,
10
+ id,
11
+ preheading,
12
+ heading,
13
+ headingLevel,
14
+ subheading,
15
+ description,
16
+ href,
17
+ target,
18
+ onClick,
19
+ ...filteredProps
20
+ } = props;
21
+
22
+ /** Event listeners - run once */
23
+ useEventListener(ref, "nys-click", props.onNysClick);
24
+ useEventListener(ref, "nys-focus", props.onNysFocus);
25
+ useEventListener(ref, "nys-blur", props.onNysBlur);
26
+
27
+ /** Properties - run whenever a property has changed */
28
+ useProperties(ref, "onClick", props.onClick);
29
+
30
+ return React.createElement(
31
+ "nys-card",
32
+ {
33
+ ref: (node) => {
34
+ ref.current = node;
35
+ if (typeof forwardedRef === "function") {
36
+ forwardedRef(node);
37
+ } else if (forwardedRef) {
38
+ forwardedRef.current = node;
39
+ }
40
+ },
41
+ ...filteredProps,
42
+ id: props.id,
43
+ preheading: props.preheading,
44
+ heading: props.heading,
45
+ headingLevel: props.headingLevel,
46
+ subheading: props.subheading,
47
+ description: props.description,
48
+ href: props.href,
49
+ target: props.target,
50
+ class: props.className,
51
+ exportparts: props.exportparts,
52
+ for: props.htmlFor,
53
+ part: props.part,
54
+ tabindex: props.tabIndex,
55
+ inset: props.inset ? true : undefined,
56
+ elevated: props.elevated ? true : undefined,
57
+ style: { ...props.style },
58
+ },
59
+ props.children,
60
+ );
61
+ });
@@ -46,6 +46,10 @@ export interface NysCheckboxProps extends Pick<
46
46
  /** undefined */
47
47
  showOtherError?: boolean;
48
48
 
49
+ /** Suppress the internal visible `<nys-label>` (use with `labelledby` for
50
+ table cells). */
51
+ hideLabel?: boolean;
52
+
49
53
  /** Visible label text. Required for accessibility. */
50
54
  label?: NysCheckboxElement["label"];
51
55
 
@@ -73,6 +77,11 @@ export interface NysCheckboxProps extends Pick<
73
77
  /** Checkbox size: `sm` (24px) or `md` (32px, default). */
74
78
  size?: NysCheckboxElement["size"];
75
79
 
80
+ /** Id of an element in the host's light-DOM tree to borrow the accessible name
81
+ from (e.g. a table column `<th>`). Enables labelling a checkbox that has no
82
+ visible label of its own. */
83
+ labelledby?: NysCheckboxElement["labelledby"];
84
+
76
85
  /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
77
86
  className?: string;
78
87
 
@@ -13,6 +13,7 @@ export const NysCheckbox = forwardRef((props, forwardedRef) => {
13
13
  tile,
14
14
  other,
15
15
  showOtherError,
16
+ hideLabel,
16
17
  label,
17
18
  description,
18
19
  id,
@@ -22,6 +23,7 @@ export const NysCheckbox = forwardRef((props, forwardedRef) => {
22
23
  errorMessage,
23
24
  tooltip,
24
25
  size,
26
+ labelledby,
25
27
  ...filteredProps
26
28
  } = props;
27
29
 
@@ -54,6 +56,7 @@ export const NysCheckbox = forwardRef((props, forwardedRef) => {
54
56
  errorMessage: props.errorMessage,
55
57
  tooltip: props.tooltip,
56
58
  size: props.size,
59
+ labelledby: props.labelledby,
57
60
  class: props.className,
58
61
  exportparts: props.exportparts,
59
62
  for: props.htmlFor,
@@ -67,6 +70,7 @@ export const NysCheckbox = forwardRef((props, forwardedRef) => {
67
70
  tile: props.tile ? true : undefined,
68
71
  other: props.other ? true : undefined,
69
72
  showOtherError: props.showOtherError ? true : undefined,
73
+ hideLabel: props.hideLabel ? true : undefined,
70
74
  style: { ...props.style },
71
75
  },
72
76
  props.children,
@@ -24,7 +24,9 @@ export interface NysDropdownMenuProps extends Pick<
24
24
  /** undefined */
25
25
  for?: NysDropdownMenuElement["for"];
26
26
 
27
- /** Accessible label for the menu. Used as `aria-label` on the `<ul role="menu">` element. */
27
+ /** Accessible label for the menu (`role="menu"`) container. Used as `aria-label`
28
+ on the `<ul role="menu">` element. When empty, falls back to "Menu" so the
29
+ menu always has an accessible name for screen readers. */
28
30
  label?: NysDropdownMenuElement["label"];
29
31
 
30
32
  /** Preferred position relative to trigger. */
@@ -50,7 +52,7 @@ export interface NysDropdownMenuProps extends Pick<
50
52
  }
51
53
 
52
54
  /**
53
- *
55
+ * Action menu with auto-positioning, keyboard support, and screen reader integration.
54
56
  * ---
55
57
  *
56
58
  */
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
2
  import {
3
3
  NysFileinput as NysFileinputElement,
4
+ Event,
4
5
  CustomEvent,
5
6
  } from "../../dist/nysds.es.js";
6
7
 
7
- export type { NysFileinputElement, CustomEvent };
8
+ export type { NysFileinputElement, Event, CustomEvent };
8
9
 
9
10
  export interface NysFileinputProps extends Pick<
10
11
  React.AllHTMLAttributes<HTMLElement>,
@@ -90,7 +91,21 @@ export interface NysFileinputProps extends Pick<
90
91
  /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
91
92
  tabIndex?: number;
92
93
 
93
- /** Fired when files are added or removed. Detail: `{id, files}`. */
94
+ /** The currently selected files. Read to get the current selection; set to
95
+ replace it (e.g. rehydrating state after navigation, or binding from a
96
+ framework form model). Property-only — a `File[]` cannot round-trip through
97
+ an HTML attribute. Setting this is silent (does not emit `nys-change`),
98
+ matching native input behavior and avoiding feedback loops in two-way bindings. */
99
+ files?: NysFileinputElement["files"];
100
+
101
+ /** Single-file convenience accessor (parity with `nys-textinput`'s `value`).
102
+ Reads the first selected file (or `null`); setting replaces the selection. */
103
+ value?: NysFileinputElement["value"];
104
+
105
+ /** Fired when focus leaves the component. Triggers validation. */
106
+ onNysBlur?: (event: CustomEvent) => void;
107
+
108
+ /** Fired once per user action (file selection, drop, or removal). Detail: `{id, files, changedFiles}`. The `files` is the full current selection Whereas `changedFiles` is the entries this action added or removed. Both `changedFiles` and each entry in `files` are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`. */
94
109
  onNysChange?: (event: CustomEvent) => void;
95
110
  }
96
111
 
@@ -100,7 +115,14 @@ export interface NysFileinputProps extends Pick<
100
115
  *
101
116
  *
102
117
  * ### **Events:**
103
- * - **nys-change** - Fired when files are added or removed. Detail: `{id, files}`.
118
+ * - **nys-blur** - Fired when focus leaves the component. Triggers validation.
119
+ * - **nys-change** - Fired once per user action (file selection, drop, or removal). Detail: `{id, files, changedFiles}`. The `files` is the full current selection Whereas `changedFiles` is the entries this action added or removed. Both `changedFiles` and each entry in `files` are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`.
120
+ *
121
+ * ### **Methods:**
122
+ * - **setFiles(incoming: _File[]_): _Promise<void>_** - Programmatically set the selection and await async validation/processing.
123
+ * Same as assigning `files`, but resolves once every file has finished its
124
+ * magic-byte validation and read — use when you need to read `checkValidity()`
125
+ * or the settled selection immediately after.
104
126
  *
105
127
  * ### **Slots:**
106
128
  * - **description** - Custom HTML description content.
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef, useRef, useEffect } from "react";
2
2
  import "../../dist/nysds.es.js";
3
- import { useEventListener } from "./react-utils.js";
3
+ import { useEventListener, useProperties } from "./react-utils.js";
4
4
 
5
5
  export const NysFileinput = forwardRef((props, forwardedRef) => {
6
6
  const ref = useRef(null);
@@ -21,12 +21,19 @@ export const NysFileinput = forwardRef((props, forwardedRef) => {
21
21
  accept,
22
22
  errorMessage,
23
23
  width,
24
+ files,
25
+ value,
24
26
  ...filteredProps
25
27
  } = props;
26
28
 
27
29
  /** Event listeners - run once */
30
+ useEventListener(ref, "nys-blur", props.onNysBlur);
28
31
  useEventListener(ref, "nys-change", props.onNysChange);
29
32
 
33
+ /** Properties - run whenever a property has changed */
34
+ useProperties(ref, "files", props.files);
35
+ useProperties(ref, "value", props.value);
36
+
30
37
  return React.createElement(
31
38
  "nys-fileinput",
32
39
  {
@@ -18,6 +18,9 @@ export interface NysGlobalFooterProps extends Pick<
18
18
  | "onFocus"
19
19
  | "onBlur"
20
20
  > {
21
+ /** Unique identifier. Auto-generated if not provided. */
22
+ id?: NysGlobalFooterElement["id"];
23
+
21
24
  /** Agency name displayed as the footer heading. */
22
25
  agencyName?: NysGlobalFooterElement["agencyName"];
23
26
 
@@ -27,6 +30,20 @@ export interface NysGlobalFooterProps extends Pick<
27
30
  /** URL for the agency name link. If empty, name is not clickable. */
28
31
  homepageLink?: NysGlobalFooterElement["homepageLink"];
29
32
 
33
+ /** Accessible name for the `contentinfo` landmark this footer renders.
34
+
35
+ Leave it unset and the landmark is named after the visible `agencyName`
36
+ heading, which cannot drift out of sync and is translated with the rest of
37
+ the page. Falls back to `"Site"` when there is no agency name to reference.
38
+
39
+ Set this only when the agency name is not right for your audience. A page
40
+ pairing this with `nys-unavfooter` carries two `contentinfo` landmarks, so
41
+ the name must stay distinct from that footer's (`"New York State"` by
42
+ default) or landmark navigation stops distinguishing them.
43
+
44
+ An explicit name replaces the reference to the visible heading. */
45
+ landmarkLabel?: NysGlobalFooterElement["landmarkLabel"];
46
+
30
47
  /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
31
48
  className?: string;
32
49
 
@@ -2,16 +2,24 @@ import React, { forwardRef } from "react";
2
2
  import "../../dist/nysds.es.js";
3
3
 
4
4
  export const NysGlobalFooter = forwardRef((props, forwardedRef) => {
5
- const { agencyName, agencySubheading, homepageLink, ...filteredProps } =
6
- props;
5
+ const {
6
+ id,
7
+ agencyName,
8
+ agencySubheading,
9
+ homepageLink,
10
+ landmarkLabel,
11
+ ...filteredProps
12
+ } = props;
7
13
 
8
14
  return React.createElement(
9
15
  "nys-globalfooter",
10
16
  {
11
17
  ...filteredProps,
18
+ id: props.id,
12
19
  agencyName: props.agencyName,
13
20
  agencySubheading: props.agencySubheading,
14
21
  homepageLink: props.homepageLink,
22
+ landmarkLabel: props.landmarkLabel,
15
23
  class: props.className,
16
24
  exportparts: props.exportparts,
17
25
  for: props.htmlFor,
@@ -18,9 +18,16 @@ export interface NysGlobalHeaderProps extends Pick<
18
18
  | "onFocus"
19
19
  | "onBlur"
20
20
  > {
21
- /** Toggles the NYS brand mark */
21
+ /** Displays the NYS brand mark in the header. Off by default.
22
+
23
+ Enable only for internal, state-employee (back-office) applications that omit
24
+ `nys-unavheader`. Any resident-facing app — even one requiring login — should
25
+ keep `nys-unavheader` for trust and leave this off. */
22
26
  nysLogo?: boolean;
23
27
 
28
+ /** Unique identifier. Auto-generated if not provided. */
29
+ id?: NysGlobalHeaderElement["id"];
30
+
24
31
  /** Application name displayed prominently. */
25
32
  appName?: NysGlobalHeaderElement["appName"];
26
33
 
@@ -30,6 +37,20 @@ export interface NysGlobalHeaderProps extends Pick<
30
37
  /** URL for the header title link. If empty, title is not clickable. */
31
38
  homepageLink?: NysGlobalHeaderElement["homepageLink"];
32
39
 
40
+ /** Accessible name for the `banner` landmark this header renders.
41
+
42
+ Leave it unset and the banner is named after the visible `appName` or
43
+ `agencyName`, which cannot drift out of sync and is translated with the rest
44
+ of the page. Falls back to `"Site"` when there is no title to reference.
45
+
46
+ Set this only when neither is right for your audience. A page pairing this
47
+ with `nys-unavheader` carries two `banner` landmarks, so the name must stay
48
+ distinct from that header's (`"New York State"` by default) or landmark
49
+ navigation stops distinguishing them.
50
+
51
+ An explicit name replaces the reference to the visible title. */
52
+ landmarkLabel?: NysGlobalHeaderElement["landmarkLabel"];
53
+
33
54
  /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
34
55
  className?: string;
35
56
 
@@ -59,5 +80,6 @@ export interface NysGlobalHeaderProps extends Pick<
59
80
  *
60
81
  * ### **Slots:**
61
82
  * - _default_ - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
83
+ * - **user-actions** - User-account controls (e.g. profile link, settings, log-out button) shown in the header.
62
84
  */
63
85
  export const NysGlobalHeader: React.ForwardRefExoticComponent<NysGlobalHeaderProps>;
@@ -2,16 +2,25 @@ import React, { forwardRef } from "react";
2
2
  import "../../dist/nysds.es.js";
3
3
 
4
4
  export const NysGlobalHeader = forwardRef((props, forwardedRef) => {
5
- const { nysLogo, appName, agencyName, homepageLink, ...filteredProps } =
6
- props;
5
+ const {
6
+ nysLogo,
7
+ id,
8
+ appName,
9
+ agencyName,
10
+ homepageLink,
11
+ landmarkLabel,
12
+ ...filteredProps
13
+ } = props;
7
14
 
8
15
  return React.createElement(
9
16
  "nys-globalheader",
10
17
  {
11
18
  ...filteredProps,
19
+ id: props.id,
12
20
  appName: props.appName,
13
21
  agencyName: props.agencyName,
14
22
  homepageLink: props.homepageLink,
23
+ landmarkLabel: props.landmarkLabel,
15
24
  class: props.className,
16
25
  exportparts: props.exportparts,
17
26
  for: props.htmlFor,
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+ import { NysIconlist as NysIconlistElement } from "../../dist/nysds.es.js";
3
+
4
+ export type { NysIconlistElement };
5
+
6
+ export interface NysIconlistProps extends Pick<
7
+ React.AllHTMLAttributes<HTMLElement>,
8
+ | "children"
9
+ | "dir"
10
+ | "hidden"
11
+ | "id"
12
+ | "lang"
13
+ | "slot"
14
+ | "style"
15
+ | "title"
16
+ | "translate"
17
+ | "onClick"
18
+ | "onFocus"
19
+ | "onBlur"
20
+ > {
21
+ /** Draws a divider between items. No divider is drawn after the last item. */
22
+ divider?: boolean;
23
+
24
+ /** Unique identifier. Auto-generated if not provided. */
25
+ id?: NysIconlistElement["id"];
26
+
27
+ /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
28
+ className?: string;
29
+
30
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
31
+ exportparts?: string;
32
+
33
+ /** Used for labels to link them with their inputs (using input id). */
34
+ htmlFor?: string;
35
+
36
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
37
+ key?: number | string;
38
+
39
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
40
+ part?: string;
41
+
42
+ /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
43
+ ref?: any;
44
+
45
+ /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
46
+ tabIndex?: number;
47
+ }
48
+
49
+ /**
50
+ * A scannable list of icon + text items, with an optional divider between rows.
51
+ * ---
52
+ *
53
+ */
54
+ export const NysIconlist: React.ForwardRefExoticComponent<NysIconlistProps>;
@@ -0,0 +1,22 @@
1
+ import React, { forwardRef } from "react";
2
+ import "../../dist/nysds.es.js";
3
+
4
+ export const NysIconlist = forwardRef((props, forwardedRef) => {
5
+ const { divider, id, ...filteredProps } = props;
6
+
7
+ return React.createElement(
8
+ "nys-iconlist",
9
+ {
10
+ ...filteredProps,
11
+ id: props.id,
12
+ class: props.className,
13
+ exportparts: props.exportparts,
14
+ for: props.htmlFor,
15
+ part: props.part,
16
+ tabindex: props.tabIndex,
17
+ divider: props.divider ? true : undefined,
18
+ style: { ...props.style },
19
+ },
20
+ props.children,
21
+ );
22
+ });
@@ -0,0 +1,59 @@
1
+ import React from "react";
2
+ import { NysIconlistitem as NysIconlistitemElement } from "../../dist/nysds.es.js";
3
+
4
+ export type { NysIconlistitemElement };
5
+
6
+ export interface NysIconlistitemProps extends Pick<
7
+ React.AllHTMLAttributes<HTMLElement>,
8
+ | "children"
9
+ | "dir"
10
+ | "hidden"
11
+ | "id"
12
+ | "lang"
13
+ | "slot"
14
+ | "style"
15
+ | "title"
16
+ | "translate"
17
+ | "onClick"
18
+ | "onFocus"
19
+ | "onBlur"
20
+ > {
21
+ /** Draws a rule below the item. Set by the parent `<nys-iconlist divider>`; not intended to be
22
+ set directly. */
23
+ divider?: boolean;
24
+
25
+ /** Material Symbols icon name passed to `<nys-icon>`. */
26
+ icon?: NysIconlistitemElement["icon"];
27
+
28
+ /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
29
+ className?: string;
30
+
31
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
32
+ exportparts?: string;
33
+
34
+ /** Used for labels to link them with their inputs (using input id). */
35
+ htmlFor?: string;
36
+
37
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
38
+ key?: number | string;
39
+
40
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
41
+ part?: string;
42
+
43
+ /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
44
+ ref?: any;
45
+
46
+ /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
47
+ tabIndex?: number;
48
+ }
49
+
50
+ /**
51
+ * An icon-paired list item for use inside `<nys-iconlist>`.
52
+ * ---
53
+ *
54
+ *
55
+ * ### **Slots:**
56
+ * - _default_ - Primary label text.
57
+ * - **secondary** - Optional second line of text rendered below the primary label.
58
+ */
59
+ export const NysIconlistitem: React.ForwardRefExoticComponent<NysIconlistitemProps>;
@@ -0,0 +1,22 @@
1
+ import React, { forwardRef } from "react";
2
+ import "../../dist/nysds.es.js";
3
+
4
+ export const NysIconlistitem = forwardRef((props, forwardedRef) => {
5
+ const { divider, icon, ...filteredProps } = props;
6
+
7
+ return React.createElement(
8
+ "nys-iconlistitem",
9
+ {
10
+ ...filteredProps,
11
+ icon: props.icon,
12
+ class: props.className,
13
+ exportparts: props.exportparts,
14
+ for: props.htmlFor,
15
+ part: props.part,
16
+ tabindex: props.tabIndex,
17
+ divider: props.divider ? true : undefined,
18
+ style: { ...props.style },
19
+ },
20
+ props.children,
21
+ );
22
+ });
@@ -65,7 +65,10 @@ export interface NysLabelProps extends Pick<
65
65
  }
66
66
 
67
67
  /**
68
- * Internal label component for form fields with flag and tooltip support.
68
+ * **Internal component.** Renders form labels with description, required/optional flag, and tooltip.
69
+ *
70
+ * Used internally by form components (textinput, select, checkbox, etc.). Not intended for direct use.
71
+ * Handles label association via `for`, displays asterisk for required fields, and integrates tooltips.
69
72
  * ---
70
73
  *
71
74
  *
@@ -30,9 +30,16 @@ export interface NysModalProps extends Pick<
30
30
  /** Unique identifier. Auto-generated if not provided. */
31
31
  id?: NysModalElement["id"];
32
32
 
33
- /** Modal heading text. Required for accessibility. */
33
+ /** Modal heading text. Required for accessibility — it becomes the dialog's
34
+ accessible name via `aria-labelledby`. */
34
35
  heading?: NysModalElement["heading"];
35
36
 
37
+ /** Accessible name for the dialog, used only when no `heading` is set.
38
+ Prefer a visible `heading`: a visible label satisfies WCAG 2.5.3 (Label in
39
+ Name) and gives sighted users the same information. Use `ariaLabel` for the
40
+ rare headless dialog so it still exposes a name (WCAG 4.1.2). */
41
+ ariaLabel?: NysModalElement["ariaLabel"];
42
+
36
43
  /** Secondary heading below the main heading. */
37
44
  subheading?: NysModalElement["subheading"];
38
45
 
@@ -4,8 +4,16 @@ import { useEventListener } from "./react-utils.js";
4
4
 
5
5
  export const NysModal = forwardRef((props, forwardedRef) => {
6
6
  const ref = useRef(null);
7
- const { open, mandatory, id, heading, subheading, width, ...filteredProps } =
8
- props;
7
+ const {
8
+ open,
9
+ mandatory,
10
+ id,
11
+ heading,
12
+ ariaLabel,
13
+ subheading,
14
+ width,
15
+ ...filteredProps
16
+ } = props;
9
17
 
10
18
  /** Event listeners - run once */
11
19
  useEventListener(ref, "nys-open", props.onNysOpen);
@@ -25,6 +33,7 @@ export const NysModal = forwardRef((props, forwardedRef) => {
25
33
  ...filteredProps,
26
34
  id: props.id,
27
35
  heading: props.heading,
36
+ ariaLabel: props.ariaLabel,
28
37
  subheading: props.subheading,
29
38
  width: props.width,
30
39
  class: props.className,
@@ -0,0 +1,65 @@
1
+ import React from "react";
2
+ import { NysProcesslist as NysProcesslistElement } from "../../dist/nysds.es.js";
3
+
4
+ export type { NysProcesslistElement };
5
+
6
+ export interface NysProcesslistProps extends Pick<
7
+ React.AllHTMLAttributes<HTMLElement>,
8
+ | "children"
9
+ | "dir"
10
+ | "hidden"
11
+ | "id"
12
+ | "lang"
13
+ | "slot"
14
+ | "style"
15
+ | "title"
16
+ | "translate"
17
+ | "onClick"
18
+ | "onFocus"
19
+ | "onBlur"
20
+ > {
21
+ /** Renders each step number in a bolder, higher-emphasis color. */
22
+ strong?: boolean;
23
+
24
+ /** Renders each step number using neutral (grayscale) coloring instead of the theme color. */
25
+ neutral?: boolean;
26
+
27
+ /** Unique identifier. Auto-generated if not provided. */
28
+ id?: NysProcesslistElement["id"];
29
+
30
+ /** Step marker size: `sm` (smaller) or `md` (default). */
31
+ size?: NysProcesslistElement["size"];
32
+
33
+ /** Number given to the first step. Subsequent steps count up from it. Use this when one
34
+ process is split across several lists so the later lists continue the count instead of
35
+ restarting at 1. */
36
+ initialStep?: NysProcesslistElement["initialStep"];
37
+
38
+ /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
39
+ className?: string;
40
+
41
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
42
+ exportparts?: string;
43
+
44
+ /** Used for labels to link them with their inputs (using input id). */
45
+ htmlFor?: string;
46
+
47
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
48
+ key?: number | string;
49
+
50
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
51
+ part?: string;
52
+
53
+ /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
54
+ ref?: any;
55
+
56
+ /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
57
+ tabIndex?: number;
58
+ }
59
+
60
+ /**
61
+ * An ordered list of numbered process steps.
62
+ * ---
63
+ *
64
+ */
65
+ export const NysProcesslist: React.ForwardRefExoticComponent<NysProcesslistProps>;
@@ -0,0 +1,25 @@
1
+ import React, { forwardRef } from "react";
2
+ import "../../dist/nysds.es.js";
3
+
4
+ export const NysProcesslist = forwardRef((props, forwardedRef) => {
5
+ const { strong, neutral, id, size, initialStep, ...filteredProps } = props;
6
+
7
+ return React.createElement(
8
+ "nys-processlist",
9
+ {
10
+ ...filteredProps,
11
+ id: props.id,
12
+ size: props.size,
13
+ initialStep: props.initialStep,
14
+ class: props.className,
15
+ exportparts: props.exportparts,
16
+ for: props.htmlFor,
17
+ part: props.part,
18
+ tabindex: props.tabIndex,
19
+ strong: props.strong ? true : undefined,
20
+ neutral: props.neutral ? true : undefined,
21
+ style: { ...props.style },
22
+ },
23
+ props.children,
24
+ );
25
+ });