@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
@@ -1,104 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysRadiogroup as NysRadiogroupElement,
4
- CustomEvent,
5
- } from "../../dist/nysds.es.js";
6
-
7
- export type { NysRadiogroupElement, CustomEvent };
8
-
9
- export interface NysRadiogroupProps extends Pick<
10
- React.AllHTMLAttributes<HTMLElement>,
11
- | "children"
12
- | "dir"
13
- | "hidden"
14
- | "id"
15
- | "lang"
16
- | "slot"
17
- | "style"
18
- | "title"
19
- | "translate"
20
- | "onClick"
21
- | "onFocus"
22
- | "onBlur"
23
- > {
24
- /** Requires a selection before form submission. */
25
- required?: boolean;
26
-
27
- /** Shows "Optional" flag. */
28
- optional?: boolean;
29
-
30
- /** Shows error message when true. */
31
- showError?: boolean;
32
-
33
- /** Renders all radiobuttons as tiles with larger clickable area. */
34
- tile?: boolean;
35
-
36
- /** undefined */
37
- _showOtherError?: boolean;
38
-
39
- /** Unique identifier. Auto-generated if not provided. */
40
- id?: NysRadiogroupElement["id"];
41
-
42
- /** Name for form submission. Auto-populated from child radiobuttons. */
43
- name?: NysRadiogroupElement["name"];
44
-
45
- /** Error message text. Shown only when `showError` is true. */
46
- errorMessage?: NysRadiogroupElement["errorMessage"];
47
-
48
- /** Visible label text for the group. */
49
- label?: NysRadiogroupElement["label"];
50
-
51
- /** Helper text below label. Use slot for custom HTML. */
52
- description?: NysRadiogroupElement["description"];
53
-
54
- /** Tooltip text shown on hover/focus of info icon. */
55
- tooltip?: NysRadiogroupElement["tooltip"];
56
-
57
- /** Form `id` to associate with. Applied to all children. */
58
- form?: NysRadiogroupElement["form"];
59
-
60
- /** Radio size for all children: `sm` (24px) or `md` (32px, default). */
61
- size?: NysRadiogroupElement["size"];
62
-
63
- /** 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()`. */
64
- className?: string;
65
-
66
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
67
- exportparts?: string;
68
-
69
- /** Used for labels to link them with their inputs (using input id). */
70
- htmlFor?: string;
71
-
72
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
73
- key?: number | string;
74
-
75
- /** 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. */
76
- part?: string;
77
-
78
- /** 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. */
79
- ref?: any;
80
-
81
- /** 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. */
82
- tabIndex?: number;
83
-
84
- /** undefined */
85
- onNysChange?: (event: CustomEvent) => void;
86
-
87
- /** undefined */
88
- onNysOtherInput?: (event: CustomEvent) => void;
89
- }
90
-
91
- /**
92
- * Container for grouping radio buttons as a single form control.
93
- * ---
94
- *
95
- *
96
- * ### **Events:**
97
- * - **nys-change**
98
- * - **nys-other-input**
99
- *
100
- * ### **Slots:**
101
- * - _default_ - Default slot for `nys-radiobutton` elements.
102
- * - **description** - Custom HTML description content.
103
- */
104
- export const NysRadiogroup: React.ForwardRefExoticComponent<NysRadiogroupProps>;
@@ -1,62 +0,0 @@
1
- import React, { forwardRef, useRef, useEffect } from "react";
2
- import "../../dist/nysds.es.js";
3
- import { useEventListener } from "./react-utils.js";
4
-
5
- export const NysRadiogroup = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- required,
9
- optional,
10
- showError,
11
- tile,
12
- _showOtherError,
13
- id,
14
- name,
15
- errorMessage,
16
- label,
17
- description,
18
- tooltip,
19
- form,
20
- size,
21
- ...filteredProps
22
- } = props;
23
-
24
- /** Event listeners - run once */
25
- useEventListener(ref, "nys-change", props.onNysChange);
26
- useEventListener(ref, "nys-other-input", props.onNysOtherInput);
27
-
28
- return React.createElement(
29
- "nys-radiogroup",
30
- {
31
- ref: (node) => {
32
- ref.current = node;
33
- if (typeof forwardedRef === "function") {
34
- forwardedRef(node);
35
- } else if (forwardedRef) {
36
- forwardedRef.current = node;
37
- }
38
- },
39
- ...filteredProps,
40
- id: props.id,
41
- name: props.name,
42
- errorMessage: props.errorMessage,
43
- label: props.label,
44
- description: props.description,
45
- tooltip: props.tooltip,
46
- form: props.form,
47
- size: props.size,
48
- class: props.className,
49
- exportparts: props.exportparts,
50
- for: props.htmlFor,
51
- part: props.part,
52
- tabindex: props.tabIndex,
53
- required: props.required ? true : undefined,
54
- optional: props.optional ? true : undefined,
55
- showError: props.showError ? true : undefined,
56
- tile: props.tile ? true : undefined,
57
- _showOtherError: props._showOtherError ? true : undefined,
58
- style: { ...props.style },
59
- },
60
- props.children,
61
- );
62
- });
@@ -1,119 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysSelect as NysSelectElement,
4
- CustomEvent,
5
- Event,
6
- } from "../../dist/nysds.es.js";
7
-
8
- export type { NysSelectElement, CustomEvent, Event };
9
-
10
- export interface NysSelectProps extends Pick<
11
- React.AllHTMLAttributes<HTMLElement>,
12
- | "children"
13
- | "dir"
14
- | "hidden"
15
- | "id"
16
- | "lang"
17
- | "slot"
18
- | "style"
19
- | "title"
20
- | "translate"
21
- | "onClick"
22
- | "onFocus"
23
- | "onBlur"
24
- > {
25
- /** Prevents interaction. */
26
- disabled?: boolean;
27
-
28
- /** Marks as required. Shows "Required" flag and validates on blur. */
29
- required?: boolean;
30
-
31
- /** Shows "Optional" flag. Use when most fields are required. */
32
- optional?: boolean;
33
-
34
- /** Adjusts colors for dark backgrounds. */
35
- inverted?: boolean;
36
-
37
- /** Shows error message when true. Set by validation or manually. */
38
- showError?: boolean;
39
-
40
- /** Unique identifier. Auto-generated if not provided. */
41
- id?: NysSelectElement["id"];
42
-
43
- /** Name for form submission. */
44
- name?: NysSelectElement["name"];
45
-
46
- /** Visible label text. Required for accessibility. */
47
- label?: NysSelectElement["label"];
48
-
49
- /** Helper text below label. Use slot for custom HTML. */
50
- description?: NysSelectElement["description"];
51
-
52
- /** Accessible label. Used as a fallback when `label` is not provided. */
53
- ariaLabel?: NysSelectElement["ariaLabel"];
54
-
55
- /** Currently selected option value. */
56
- value?: NysSelectElement["value"];
57
-
58
- /** Tooltip text shown on hover/focus of info icon. */
59
- tooltip?: NysSelectElement["tooltip"];
60
-
61
- /** Form `id` to associate with when select is outside form element. */
62
- form?: NysSelectElement["form"];
63
-
64
- /** Error message text. Shown only when `showError` is true. */
65
- errorMessage?: NysSelectElement["errorMessage"];
66
-
67
- /** Select width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default). */
68
- width?: NysSelectElement["width"];
69
-
70
- /** 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()`. */
71
- className?: string;
72
-
73
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
74
- exportparts?: string;
75
-
76
- /** Used for labels to link them with their inputs (using input id). */
77
- htmlFor?: string;
78
-
79
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
80
- key?: number | string;
81
-
82
- /** 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. */
83
- part?: string;
84
-
85
- /** 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. */
86
- ref?: any;
87
-
88
- /** 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. */
89
- tabIndex?: number;
90
-
91
- /** Fired when selection changes. Detail: `{id, value}`. */
92
- onNysChange?: (event: CustomEvent) => void;
93
-
94
- /** Fired when select gains focus. */
95
- onNysFocus?: (event: CustomEvent) => void;
96
-
97
- /** Fired when select loses focus. Triggers validation. */
98
- onNysBlur?: (event: CustomEvent) => void;
99
- }
100
-
101
- /**
102
- * Dropdown select for choosing one option from a list.
103
- * ---
104
- *
105
- *
106
- * ### **Events:**
107
- * - **nys-change** - Fired when selection changes. Detail: `{id, value}`.
108
- * - **nys-focus** - Fired when select gains focus.
109
- * - **nys-blur** - Fired when select loses focus. Triggers validation.
110
- *
111
- * ### **Methods:**
112
- * - **checkValidity(): _boolean_** - Functions
113
- * --------------------------------------------------------------------------
114
- *
115
- * ### **Slots:**
116
- * - _default_ - Default slot for `<option>` and `<optgroup>` elements.
117
- * - **description** - Custom HTML description content below the label.
118
- */
119
- export const NysSelect: React.ForwardRefExoticComponent<NysSelectProps>;
@@ -1,67 +0,0 @@
1
- import React, { forwardRef, useRef, useEffect } from "react";
2
- import "../../dist/nysds.es.js";
3
- import { useEventListener } from "./react-utils.js";
4
-
5
- export const NysSelect = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- disabled,
9
- required,
10
- optional,
11
- inverted,
12
- showError,
13
- id,
14
- name,
15
- label,
16
- description,
17
- ariaLabel,
18
- value,
19
- tooltip,
20
- form,
21
- errorMessage,
22
- width,
23
- ...filteredProps
24
- } = props;
25
-
26
- /** Event listeners - run once */
27
- useEventListener(ref, "nys-change", props.onNysChange);
28
- useEventListener(ref, "nys-focus", props.onNysFocus);
29
- useEventListener(ref, "nys-blur", props.onNysBlur);
30
-
31
- return React.createElement(
32
- "nys-select",
33
- {
34
- ref: (node) => {
35
- ref.current = node;
36
- if (typeof forwardedRef === "function") {
37
- forwardedRef(node);
38
- } else if (forwardedRef) {
39
- forwardedRef.current = node;
40
- }
41
- },
42
- ...filteredProps,
43
- id: props.id,
44
- name: props.name,
45
- label: props.label,
46
- description: props.description,
47
- ariaLabel: props.ariaLabel,
48
- value: props.value,
49
- tooltip: props.tooltip,
50
- form: props.form,
51
- errorMessage: props.errorMessage,
52
- width: props.width,
53
- class: props.className,
54
- exportparts: props.exportparts,
55
- for: props.htmlFor,
56
- part: props.part,
57
- tabindex: props.tabIndex,
58
- disabled: props.disabled ? true : undefined,
59
- required: props.required ? true : undefined,
60
- optional: props.optional ? true : undefined,
61
- inverted: props.inverted ? true : undefined,
62
- showError: props.showError ? true : undefined,
63
- style: { ...props.style },
64
- },
65
- props.children,
66
- );
67
- });
@@ -1,54 +0,0 @@
1
- import React from "react";
2
- import { NysSkipnav as NysSkipnavElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysSkipnavElement };
5
-
6
- export interface NysSkipnavProps 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
- /** Unique identifier. Auto-generated if not provided. */
22
- id?: NysSkipnavElement["id"];
23
-
24
- /** Target element ID (with `#`). Defaults to `#main-content`. */
25
- href?: NysSkipnavElement["href"];
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
- * Skip navigation link for keyboard accessibility. Hidden until focused.
51
- * ---
52
- *
53
- */
54
- export const NysSkipnav: React.ForwardRefExoticComponent<NysSkipnavProps>;
@@ -1,22 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysSkipnav = forwardRef((props, forwardedRef) => {
5
- const { id, href, ...filteredProps } = props;
6
-
7
- return React.createElement(
8
- "nys-skipnav",
9
- {
10
- ...filteredProps,
11
- id: props.id,
12
- href: props.href,
13
- class: props.className,
14
- exportparts: props.exportparts,
15
- for: props.htmlFor,
16
- part: props.part,
17
- tabindex: props.tabIndex,
18
- style: { ...props.style },
19
- },
20
- props.children,
21
- );
22
- });
@@ -1,73 +0,0 @@
1
- import React from "react";
2
- import { NysStep as NysStepElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysStepElement };
5
-
6
- export interface NysStepProps 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
- /** Which step is currently being displayed. If not set, defaults to the `current` step.
22
- Setting this on a step after `current` is silently corrected to match `current`.
23
- When controlling state from a framework, always set this explicitly. */
24
- selected?: boolean;
25
-
26
- /** The furthest step the user has reached (progress boundary). Steps before this are navigable. */
27
- current?: boolean;
28
-
29
- /** Step label text displayed alongside the step number. */
30
- label?: NysStepElement["label"];
31
-
32
- /** URL navigated to when the step is activated, via `window.location.href`.
33
- Navigation is suppressed if the `nys-step-click` listener calls `e.preventDefault()`.
34
- Omit for SPA/framework routing and handle navigation in the event listener instead. */
35
- href?: NysStepElement["href"];
36
-
37
- /** 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()`. */
38
- className?: string;
39
-
40
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
41
- exportparts?: string;
42
-
43
- /** Used for labels to link them with their inputs (using input id). */
44
- htmlFor?: string;
45
-
46
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
47
- key?: number | string;
48
-
49
- /** 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. */
50
- part?: string;
51
-
52
- /** 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. */
53
- ref?: any;
54
-
55
- /** 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. */
56
- tabIndex?: number;
57
-
58
- /** Optional function called before `nys-step-click` is dispatched. Use for pre-navigation logic. */
59
- onClick?: NysStepElement["onClick"];
60
-
61
- /** Fired when a navigable (`previous` or `current`) non-selected step is clicked or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call `e.preventDefault()` to suppress `window.location.href` navigation. */
62
- onNysStepClick?: (event: CustomEvent) => void;
63
- }
64
-
65
- /**
66
- * Individual step for use within nys-stepper with navigation support.
67
- * ---
68
- *
69
- *
70
- * ### **Events:**
71
- * - **nys-step-click** - Fired when a navigable (`previous` or `current`) non-selected step is clicked or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call `e.preventDefault()` to suppress `window.location.href` navigation.
72
- */
73
- export const NysStep: React.ForwardRefExoticComponent<NysStepProps>;
@@ -1,40 +0,0 @@
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 NysStep = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const { selected, current, label, href, onClick, ...filteredProps } = props;
8
-
9
- /** Event listeners - run once */
10
- useEventListener(ref, "nys-step-click", props.onNysStepClick);
11
-
12
- /** Properties - run whenever a property has changed */
13
- useProperties(ref, "onClick", props.onClick);
14
-
15
- return React.createElement(
16
- "nys-step",
17
- {
18
- ref: (node) => {
19
- ref.current = node;
20
- if (typeof forwardedRef === "function") {
21
- forwardedRef(node);
22
- } else if (forwardedRef) {
23
- forwardedRef.current = node;
24
- }
25
- },
26
- ...filteredProps,
27
- label: props.label,
28
- href: props.href,
29
- class: props.className,
30
- exportparts: props.exportparts,
31
- for: props.htmlFor,
32
- part: props.part,
33
- tabindex: props.tabIndex,
34
- selected: props.selected ? true : undefined,
35
- current: props.current ? true : undefined,
36
- style: { ...props.style },
37
- },
38
- props.children,
39
- );
40
- });
@@ -1,67 +0,0 @@
1
- import React from "react";
2
- import { NysStepper as NysStepperElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysStepperElement };
5
-
6
- export interface NysStepperProps 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
- /** Whether compact mobile view is expanded to show all steps. Toggled by clicking the counter. */
22
- isCompactExpanded?: boolean;
23
-
24
- /** Unique identifier. Auto-generated as `nys-stepper-{timestamp}-{n}` if not provided. */
25
- id?: NysStepperElement["id"];
26
-
27
- /** Name attribute for form association. */
28
- name?: NysStepperElement["name"];
29
-
30
- /** Title displayed above the step list and compact counter. */
31
- label?: NysStepperElement["label"];
32
-
33
- /** Progress text displayed in compact mode (e.g., "Step 2 of 5"). Auto-managed — do not set manually. */
34
- counterText?: NysStepperElement["counterText"];
35
-
36
- /** 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()`. */
37
- className?: string;
38
-
39
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
40
- exportparts?: string;
41
-
42
- /** Used for labels to link them with their inputs (using input id). */
43
- htmlFor?: string;
44
-
45
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
46
- key?: number | string;
47
-
48
- /** 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. */
49
- part?: string;
50
-
51
- /** 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. */
52
- ref?: any;
53
-
54
- /** 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. */
55
- tabIndex?: number;
56
- }
57
-
58
- /**
59
- * Multi-step progress indicator with navigation and mobile-friendly compact view.
60
- * ---
61
- *
62
- *
63
- * ### **Slots:**
64
- * - _default_ - Default slot for `nys-step` elements. Only `nys-step` children are accepted; others are removed.
65
- * - **actions** - Persistent navigation buttons. Must contain exactly one `<div>` wrapping only `<nys-button>` elements.
66
- */
67
- export const NysStepper: React.ForwardRefExoticComponent<NysStepperProps>;
@@ -1,26 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysStepper = forwardRef((props, forwardedRef) => {
5
- const { isCompactExpanded, id, name, label, counterText, ...filteredProps } =
6
- props;
7
-
8
- return React.createElement(
9
- "nys-stepper",
10
- {
11
- ...filteredProps,
12
- id: props.id,
13
- name: props.name,
14
- label: props.label,
15
- counterText: props.counterText,
16
- class: props.className,
17
- exportparts: props.exportparts,
18
- for: props.htmlFor,
19
- part: props.part,
20
- tabindex: props.tabIndex,
21
- isCompactExpanded: props.isCompactExpanded ? true : undefined,
22
- style: { ...props.style },
23
- },
24
- props.children,
25
- );
26
- });