@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,66 +0,0 @@
1
- import React from "react";
2
- import { NysOption as NysOptionElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysOptionElement };
5
-
6
- export interface NysOptionProps 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
- /** Prevents selection of this option. */
22
- disabled?: boolean;
23
-
24
- /** Pre-selects this option. */
25
- selected?: boolean;
26
-
27
- /** Hides the option from the dropdown list. */
28
- hidden?: boolean;
29
-
30
- /** Value submitted when this option is selected. */
31
- value?: NysOptionElement["value"];
32
-
33
- /** Display text for the option. Auto-populated from slot content if not set. */
34
- label?: NysOptionElement["label"];
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
- * Option item for nys-select dropdown.
60
- * ---
61
- *
62
- *
63
- * ### **Slots:**
64
- * - _default_ - Option label text. Auto-populates the `label` prop if provided.
65
- */
66
- export const NysOption: React.ForwardRefExoticComponent<NysOptionProps>;
@@ -1,25 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysOption = forwardRef((props, forwardedRef) => {
5
- const { disabled, selected, hidden, value, label, ...filteredProps } = props;
6
-
7
- return React.createElement(
8
- "nys-option",
9
- {
10
- ...filteredProps,
11
- value: props.value,
12
- label: props.label,
13
- class: props.className,
14
- exportparts: props.exportparts,
15
- for: props.htmlFor,
16
- part: props.part,
17
- tabindex: props.tabIndex,
18
- disabled: props.disabled ? true : undefined,
19
- selected: props.selected ? true : undefined,
20
- hidden: props.hidden ? true : undefined,
21
- style: { ...props.style },
22
- },
23
- props.children,
24
- );
25
- });
@@ -1,72 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysPagination as NysPaginationElement,
4
- CustomEvent,
5
- } from "../../dist/nysds.es.js";
6
-
7
- export type { NysPaginationElement, CustomEvent };
8
-
9
- export interface NysPaginationProps 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
- /** Internal state for layout adjustments near the end. */
25
- _twoBeforeLast?: boolean;
26
-
27
- /** Unique identifier. Auto-generated if not provided. */
28
- id?: NysPaginationElement["id"];
29
-
30
- /** Name attribute for form association. */
31
- name?: NysPaginationElement["name"];
32
-
33
- /** Currently active page (1-indexed). Clamped to valid range. */
34
- currentPage?: NysPaginationElement["currentPage"];
35
-
36
- /** Total number of pages. Must be at least 1. */
37
- totalPages?: NysPaginationElement["totalPages"];
38
-
39
- /** 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()`. */
40
- className?: string;
41
-
42
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
43
- exportparts?: string;
44
-
45
- /** Used for labels to link them with their inputs (using input id). */
46
- htmlFor?: string;
47
-
48
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
49
- key?: number | string;
50
-
51
- /** 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. */
52
- part?: string;
53
-
54
- /** 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. */
55
- ref?: any;
56
-
57
- /** 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. */
58
- tabIndex?: number;
59
-
60
- /** Fired when page changes. Detail: `{page}`. */
61
- onNysChange?: (event: CustomEvent) => void;
62
- }
63
-
64
- /**
65
- * Page navigation with numbered links, prev/next buttons, and responsive layout.
66
- * ---
67
- *
68
- *
69
- * ### **Events:**
70
- * - **nys-change** - Fired when page changes. Detail: `{page}`.
71
- */
72
- export const NysPagination: React.ForwardRefExoticComponent<NysPaginationProps>;
@@ -1,45 +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 NysPagination = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- _twoBeforeLast,
9
- id,
10
- name,
11
- currentPage,
12
- totalPages,
13
- ...filteredProps
14
- } = props;
15
-
16
- /** Event listeners - run once */
17
- useEventListener(ref, "nys-change", props.onNysChange);
18
-
19
- return React.createElement(
20
- "nys-pagination",
21
- {
22
- ref: (node) => {
23
- ref.current = node;
24
- if (typeof forwardedRef === "function") {
25
- forwardedRef(node);
26
- } else if (forwardedRef) {
27
- forwardedRef.current = node;
28
- }
29
- },
30
- ...filteredProps,
31
- id: props.id,
32
- name: props.name,
33
- currentPage: props.currentPage,
34
- totalPages: props.totalPages,
35
- class: props.className,
36
- exportparts: props.exportparts,
37
- for: props.htmlFor,
38
- part: props.part,
39
- tabindex: props.tabIndex,
40
- _twoBeforeLast: props._twoBeforeLast ? true : undefined,
41
- style: { ...props.style },
42
- },
43
- props.children,
44
- );
45
- });
@@ -1,65 +0,0 @@
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>;
@@ -1,25 +0,0 @@
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
- });
@@ -1,61 +0,0 @@
1
- import React from "react";
2
- import { NysProcesslistitem as NysProcesslistitemElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysProcesslistitemElement };
5
-
6
- export interface NysProcesslistitemProps 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
- /** Step heading text. */
22
- label?: NysProcesslistitemElement["label"];
23
-
24
- /** Supporting information displayed below the label. Use the `description` slot for rich text. */
25
- description?: NysProcesslistitemElement["description"];
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
- /** A description is shown when either the property or the slot has content, so an item with
49
- neither renders no empty paragraph. */
50
- _hasDescription?: NysProcesslistitemElement["_hasDescription"];
51
- }
52
-
53
- /**
54
- * A numbered step for use inside `<nys-processlist>`.
55
- * ---
56
- *
57
- *
58
- * ### **Slots:**
59
- * - **description** - Custom HTML description content below the label. Overrides the `description` property.
60
- */
61
- export const NysProcesslistitem: React.ForwardRefExoticComponent<NysProcesslistitemProps>;
@@ -1,35 +0,0 @@
1
- import React, { forwardRef, useRef, useEffect } from "react";
2
- import "../../dist/nysds.es.js";
3
- import { useProperties } from "./react-utils.js";
4
-
5
- export const NysProcesslistitem = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const { label, description, _hasDescription, ...filteredProps } = props;
8
-
9
- /** Properties - run whenever a property has changed */
10
- useProperties(ref, "_hasDescription", props._hasDescription);
11
-
12
- return React.createElement(
13
- "nys-processlistitem",
14
- {
15
- ref: (node) => {
16
- ref.current = node;
17
- if (typeof forwardedRef === "function") {
18
- forwardedRef(node);
19
- } else if (forwardedRef) {
20
- forwardedRef.current = node;
21
- }
22
- },
23
- ...filteredProps,
24
- label: props.label,
25
- description: props.description,
26
- class: props.className,
27
- exportparts: props.exportparts,
28
- for: props.htmlFor,
29
- part: props.part,
30
- tabindex: props.tabIndex,
31
- style: { ...props.style },
32
- },
33
- props.children,
34
- );
35
- });
@@ -1,132 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysRadiobutton as NysRadiobuttonElement,
4
- CustomEvent,
5
- } from "../../dist/nysds.es.js";
6
-
7
- export type { NysRadiobuttonElement, CustomEvent };
8
-
9
- export interface NysRadiobuttonProps 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
- /** Whether this radio is selected. Only one per group can be checked. */
25
- checked?: boolean;
26
-
27
- /** Prevents interaction. */
28
- disabled?: boolean;
29
-
30
- /** Marks group as required. Set on radiogroup, not individual radios. */
31
- required?: boolean;
32
-
33
- /** Renders as tile with larger clickable area. */
34
- tile?: boolean;
35
-
36
- /** undefined */
37
- other?: boolean;
38
-
39
- /** undefined */
40
- showOtherError?: boolean;
41
-
42
- /** Suppress the internal visible `<nys-label>` (use with `labelledby` for
43
- table cells). Without `labelledby` there is no visible element left to name
44
- the radio from, so the accessible name falls back to the `label` string —
45
- pair `hideLabel` with `labelledby` wherever a visible element exists. */
46
- hideLabel?: boolean;
47
-
48
- /** Visible label text. Required for accessibility. */
49
- label?: NysRadiobuttonElement["label"];
50
-
51
- /** Helper text below label. Use slot for custom HTML. */
52
- description?: NysRadiobuttonElement["description"];
53
-
54
- /** Unique identifier. Auto-generated if not provided. */
55
- id?: NysRadiobuttonElement["id"];
56
-
57
- /** Group name. Radios with same name are mutually exclusive. */
58
- name?: NysRadiobuttonElement["name"];
59
-
60
- /** Value submitted when this radio is selected. */
61
- value?: NysRadiobuttonElement["value"];
62
-
63
- /** Form `id` to associate with. */
64
- form?: NysRadiobuttonElement["form"];
65
-
66
- /** Radio size: `sm` (24px) or `md` (32px, default). */
67
- size?: NysRadiobuttonElement["size"];
68
-
69
- /** Id of an element in the host's light-DOM tree to borrow the accessible name
70
- from (e.g. a table row `<th>`). Enables labelling a radio button that has no
71
- visible label of its own.
72
-
73
- Standalone radios only: inside a `nys-radiogroup` the group renders the
74
- native inputs and names them from the group's own labels. */
75
- labelledby?: NysRadiobuttonElement["labelledby"];
76
-
77
- /** 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()`. */
78
- className?: string;
79
-
80
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
81
- exportparts?: string;
82
-
83
- /** Used for labels to link them with their inputs (using input id). */
84
- htmlFor?: string;
85
-
86
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
87
- key?: number | string;
88
-
89
- /** 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. */
90
- part?: string;
91
-
92
- /** 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. */
93
- ref?: any;
94
-
95
- /** 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. */
96
- tabIndex?: number;
97
-
98
- /** Public validation API (Form Association)
99
- -------------------------------------------------------------------------- */
100
- validity?: NysRadiobuttonElement["validity"];
101
-
102
- /** Fired when selection changes. Detail: `{id, checked, name, value}`. */
103
- onNysChange?: (event: CustomEvent) => void;
104
-
105
- /** Fired when radio gains focus. */
106
- onNysFocus?: (event: CustomEvent) => void;
107
-
108
- /** Fired when radio loses focus. */
109
- onNysBlur?: (event: CustomEvent) => void;
110
-
111
- /** Fired when "other" text input value changes. Detail: `{id, name, value}`. */
112
- onNysOtherInput?: (event: CustomEvent) => void;
113
- }
114
-
115
- /**
116
- * Radio button for single selection from mutually exclusive options.
117
- * This is a READONLY data component when there is no `nys-radiogroup` wrapping the `nys-radiobutton`.
118
- * Otherwise this radiobutton mockup the native grouping of radio buttons via "name" attribute.
119
- * Since we can't do that naturally, we have supporting functions to keep track of keyboard navigation, a11y VO, and single radiobutton checked at all times.
120
- * ---
121
- *
122
- *
123
- * ### **Events:**
124
- * - **nys-change** - Fired when selection changes. Detail: `{id, checked, name, value}`.
125
- * - **nys-focus** - Fired when radio gains focus.
126
- * - **nys-blur** - Fired when radio loses focus.
127
- * - **nys-other-input** - Fired when "other" text input value changes. Detail: `{id, name, value}`.
128
- *
129
- * ### **Slots:**
130
- * - **description** - Custom HTML description content.
131
- */
132
- export const NysRadiobutton: React.ForwardRefExoticComponent<NysRadiobuttonProps>;
@@ -1,72 +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 NysRadiobutton = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- checked,
9
- disabled,
10
- required,
11
- tile,
12
- other,
13
- showOtherError,
14
- hideLabel,
15
- label,
16
- description,
17
- id,
18
- name,
19
- value,
20
- form,
21
- size,
22
- labelledby,
23
- validity,
24
- ...filteredProps
25
- } = props;
26
-
27
- /** Event listeners - run once */
28
- useEventListener(ref, "nys-change", props.onNysChange);
29
- useEventListener(ref, "nys-focus", props.onNysFocus);
30
- useEventListener(ref, "nys-blur", props.onNysBlur);
31
- useEventListener(ref, "nys-other-input", props.onNysOtherInput);
32
-
33
- /** Properties - run whenever a property has changed */
34
- useProperties(ref, "validity", props.validity);
35
-
36
- return React.createElement(
37
- "nys-radiobutton",
38
- {
39
- ref: (node) => {
40
- ref.current = node;
41
- if (typeof forwardedRef === "function") {
42
- forwardedRef(node);
43
- } else if (forwardedRef) {
44
- forwardedRef.current = node;
45
- }
46
- },
47
- ...filteredProps,
48
- label: props.label,
49
- description: props.description,
50
- id: props.id,
51
- name: props.name,
52
- value: props.value,
53
- form: props.form,
54
- size: props.size,
55
- labelledby: props.labelledby,
56
- class: props.className,
57
- exportparts: props.exportparts,
58
- for: props.htmlFor,
59
- part: props.part,
60
- tabindex: props.tabIndex,
61
- checked: props.checked ? true : undefined,
62
- disabled: props.disabled ? true : undefined,
63
- required: props.required ? true : undefined,
64
- tile: props.tile ? true : undefined,
65
- other: props.other ? true : undefined,
66
- showOtherError: props.showOtherError ? true : undefined,
67
- hideLabel: props.hideLabel ? true : undefined,
68
- style: { ...props.style },
69
- },
70
- props.children,
71
- );
72
- });