@nysds/components 1.21.1 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/custom-elements.json +1524 -1022
  2. package/dist/.vscode/vscode.css-custom-data.json +75 -0
  3. package/dist/.vscode/vscode.html-custom-data.json +99 -54
  4. package/dist/custom-elements.json +1524 -1022
  5. package/dist/{nys-icon.library-C02yNW9R.js → nys-icon.library-BZ3jVyhP.js} +2 -2
  6. package/dist/{nys-icon.library-C02yNW9R.js.map → nys-icon.library-BZ3jVyhP.js.map} +1 -1
  7. package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js → nys-icon.library-DYsQ8Tiv-DYS-TkV2.js} +3 -3
  8. package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js.map → nys-icon.library-DYsQ8Tiv-DYS-TkV2.js.map} +1 -1
  9. package/dist/nysds.es.js +5059 -3637
  10. package/dist/nysds.es.js.map +1 -1
  11. package/dist/nysds.js +248 -244
  12. package/dist/nysds.js.map +1 -1
  13. package/dist/packages/codegen/src/index.d.ts +16 -0
  14. package/dist/packages/codegen/src/manifest/components.d.ts +5 -0
  15. package/dist/packages/codegen/src/manifest/filters.d.ts +5 -0
  16. package/dist/packages/codegen/src/manifest/form-control.d.ts +5 -0
  17. package/dist/packages/codegen/src/manifest/load.d.ts +10 -0
  18. package/dist/packages/codegen/src/manifest/naming.d.ts +6 -0
  19. package/dist/packages/codegen/src/manifest/packages.d.ts +5 -0
  20. package/dist/packages/codegen/src/manifest/types.d.ts +6 -0
  21. package/dist/packages/codegen/src/transform/index.d.ts +19 -0
  22. package/dist/packages/codegen/src/transform/parse.d.ts +18 -0
  23. package/dist/packages/codegen/src/transform/shared.d.ts +61 -0
  24. package/dist/packages/codegen/src/transform/to-angular.d.ts +6 -0
  25. package/dist/packages/codegen/src/transform/to-jsx.d.ts +6 -0
  26. package/dist/packages/internals/src/form-control-mixin.d.ts +16 -0
  27. package/dist/packages/internals/src/form-events.d.ts +22 -0
  28. package/dist/packages/internals/src/index.d.ts +2 -1
  29. package/dist/packages/internals/src/types.d.ts +6 -0
  30. package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +12 -0
  31. package/dist/packages/mcp-server/src/lib/framework-snippets.d.ts +35 -0
  32. package/dist/packages/mcp-server/src/lib/framework-usage.d.ts +19 -0
  33. package/dist/packages/mcp-server/src/lib/frameworks-data.d.ts +18 -0
  34. package/dist/packages/mcp-server/src/resources/frameworks.d.ts +14 -0
  35. package/dist/packages/nys-accordion/src/nys-accordion.d.ts +12 -0
  36. package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +9 -1
  37. package/dist/packages/nys-alert/src/nys-alert.d.ts +39 -1
  38. package/dist/packages/nys-avatar/src/nys-avatar.d.ts +16 -0
  39. package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +12 -0
  40. package/dist/packages/nys-badge/src/nys-badge.d.ts +18 -0
  41. package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +22 -1
  42. package/dist/packages/nys-button/src/nys-button.d.ts +35 -4
  43. package/dist/packages/nys-card/src/nys-card.d.ts +20 -0
  44. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +77 -7
  45. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +46 -0
  46. package/dist/packages/nys-combobox/src/nys-combobox.d.ts +51 -6
  47. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +44 -2
  48. package/dist/packages/nys-divider/src/nys-divider.d.ts +9 -0
  49. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +17 -0
  50. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +10 -0
  51. package/dist/packages/nys-fileinput/src/index.d.ts +1 -0
  52. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +42 -6
  53. package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +9 -1
  54. package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +17 -0
  55. package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +18 -0
  56. package/dist/packages/nys-icon/src/nys-icon.d.ts +18 -0
  57. package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +16 -0
  58. package/dist/packages/nys-label/src/nys-label.d.ts +3 -1
  59. package/dist/packages/nys-modal/src/nys-modal.d.ts +26 -2
  60. package/dist/packages/nys-pagination/src/nys-pagination.d.ts +21 -2
  61. package/dist/packages/nys-processlist/src/nys-processlist.d.ts +16 -0
  62. package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +1 -1
  63. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +29 -5
  64. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +66 -4
  65. package/dist/packages/nys-select/src/nys-select.d.ts +22 -4
  66. package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +8 -0
  67. package/dist/packages/nys-stepper/src/nys-step.d.ts +8 -1
  68. package/dist/packages/nys-stepper/src/nys-stepper.d.ts +8 -0
  69. package/dist/packages/nys-tab/src/nys-tab.d.ts +22 -3
  70. package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +12 -0
  71. package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +2 -0
  72. package/dist/packages/nys-table/src/nys-table.d.ts +39 -2
  73. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +47 -4
  74. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +42 -4
  75. package/dist/packages/nys-toggle/src/nys-toggle.d.ts +37 -3
  76. package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +13 -0
  77. package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +13 -0
  78. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +26 -4
  79. package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +14 -0
  80. package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +11 -0
  81. package/dist/packages/nys-video/src/nys-video.d.ts +14 -1
  82. package/package.json +30 -25
  83. package/packages/react/.turbo/turbo-build.log +0 -59
  84. package/packages/react/NysAccordion.d.ts +0 -75
  85. package/packages/react/NysAccordion.js +0 -24
  86. package/packages/react/NysAccordionItem.d.ts +0 -82
  87. package/packages/react/NysAccordionItem.js +0 -43
  88. package/packages/react/NysAlert.d.ts +0 -102
  89. package/packages/react/NysAlert.js +0 -61
  90. package/packages/react/NysAvatar.d.ts +0 -88
  91. package/packages/react/NysAvatar.js +0 -40
  92. package/packages/react/NysBacktotop.d.ts +0 -57
  93. package/packages/react/NysBacktotop.js +0 -23
  94. package/packages/react/NysBadge.d.ts +0 -78
  95. package/packages/react/NysBadge.js +0 -42
  96. package/packages/react/NysBreadcrumbItem.d.ts +0 -72
  97. package/packages/react/NysBreadcrumbItem.js +0 -42
  98. package/packages/react/NysBreadcrumbs.d.ts +0 -89
  99. package/packages/react/NysBreadcrumbs.js +0 -50
  100. package/packages/react/NysButton.d.ts +0 -171
  101. package/packages/react/NysButton.js +0 -83
  102. package/packages/react/NysCard.d.ts +0 -121
  103. package/packages/react/NysCard.js +0 -63
  104. package/packages/react/NysCheckbox.d.ts +0 -145
  105. package/packages/react/NysCheckbox.js +0 -78
  106. package/packages/react/NysCheckboxgroup.d.ts +0 -88
  107. package/packages/react/NysCheckboxgroup.js +0 -46
  108. package/packages/react/NysCombobox.d.ts +0 -126
  109. package/packages/react/NysCombobox.js +0 -66
  110. package/packages/react/NysDatepicker.d.ts +0 -128
  111. package/packages/react/NysDatepicker.js +0 -76
  112. package/packages/react/NysDivider.d.ts +0 -54
  113. package/packages/react/NysDivider.js +0 -22
  114. package/packages/react/NysDropdownMenu.d.ts +0 -59
  115. package/packages/react/NysDropdownMenu.js +0 -23
  116. package/packages/react/NysDropdownMenuItem.d.ts +0 -75
  117. package/packages/react/NysDropdownMenuItem.js +0 -47
  118. package/packages/react/NysErrorMessage.d.ts +0 -60
  119. package/packages/react/NysErrorMessage.js +0 -24
  120. package/packages/react/NysFileItem.d.ts +0 -69
  121. package/packages/react/NysFileItem.js +0 -37
  122. package/packages/react/NysFileinput.d.ts +0 -130
  123. package/packages/react/NysFileinput.js +0 -74
  124. package/packages/react/NysGlobalFooter.d.ts +0 -77
  125. package/packages/react/NysGlobalFooter.js +0 -32
  126. package/packages/react/NysGlobalHeader.d.ts +0 -82
  127. package/packages/react/NysGlobalHeader.js +0 -32
  128. package/packages/react/NysIcon.d.ts +0 -75
  129. package/packages/react/NysIcon.js +0 -50
  130. package/packages/react/NysIconlist.d.ts +0 -57
  131. package/packages/react/NysIconlist.js +0 -23
  132. package/packages/react/NysIconlistitem.d.ts +0 -63
  133. package/packages/react/NysIconlistitem.js +0 -23
  134. package/packages/react/NysLabel.d.ts +0 -81
  135. package/packages/react/NysLabel.js +0 -40
  136. package/packages/react/NysModal.d.ts +0 -90
  137. package/packages/react/NysModal.js +0 -50
  138. package/packages/react/NysOption.d.ts +0 -66
  139. package/packages/react/NysOption.js +0 -25
  140. package/packages/react/NysPagination.d.ts +0 -72
  141. package/packages/react/NysPagination.js +0 -45
  142. package/packages/react/NysProcesslist.d.ts +0 -65
  143. package/packages/react/NysProcesslist.js +0 -25
  144. package/packages/react/NysProcesslistitem.d.ts +0 -61
  145. package/packages/react/NysProcesslistitem.js +0 -35
  146. package/packages/react/NysRadiobutton.d.ts +0 -132
  147. package/packages/react/NysRadiobutton.js +0 -72
  148. package/packages/react/NysRadiogroup.d.ts +0 -104
  149. package/packages/react/NysRadiogroup.js +0 -62
  150. package/packages/react/NysSelect.d.ts +0 -119
  151. package/packages/react/NysSelect.js +0 -67
  152. package/packages/react/NysSkipnav.d.ts +0 -54
  153. package/packages/react/NysSkipnav.js +0 -22
  154. package/packages/react/NysStep.d.ts +0 -73
  155. package/packages/react/NysStep.js +0 -40
  156. package/packages/react/NysStepper.d.ts +0 -67
  157. package/packages/react/NysStepper.js +0 -26
  158. package/packages/react/NysTab.d.ts +0 -90
  159. package/packages/react/NysTab.js +0 -39
  160. package/packages/react/NysTabgroup.d.ts +0 -76
  161. package/packages/react/NysTabgroup.js +0 -22
  162. package/packages/react/NysTable.d.ts +0 -80
  163. package/packages/react/NysTable.js +0 -41
  164. package/packages/react/NysTabpanel.d.ts +0 -70
  165. package/packages/react/NysTabpanel.js +0 -21
  166. package/packages/react/NysTextarea.d.ts +0 -141
  167. package/packages/react/NysTextarea.js +0 -79
  168. package/packages/react/NysTextinput.d.ts +0 -144
  169. package/packages/react/NysTextinput.js +0 -83
  170. package/packages/react/NysToggle.d.ts +0 -102
  171. package/packages/react/NysToggle.js +0 -59
  172. package/packages/react/NysTooltip.d.ts +0 -60
  173. package/packages/react/NysTooltip.js +0 -24
  174. package/packages/react/NysUnavFooter.d.ts +0 -61
  175. package/packages/react/NysUnavFooter.js +0 -21
  176. package/packages/react/NysUnavHeader.d.ts +0 -95
  177. package/packages/react/NysUnavHeader.js +0 -54
  178. package/packages/react/NysVerticalnav.d.ts +0 -67
  179. package/packages/react/NysVerticalnav.js +0 -26
  180. package/packages/react/NysVerticalnavGroup.d.ts +0 -76
  181. package/packages/react/NysVerticalnavGroup.js +0 -43
  182. package/packages/react/NysVideo.d.ts +0 -83
  183. package/packages/react/NysVideo.js +0 -53
  184. package/packages/react/README.md +0 -92
  185. package/packages/react/index.d.ts +0 -49
  186. package/packages/react/index.js +0 -49
  187. package/packages/react/nysds-jsx.d.ts +0 -2009
  188. package/packages/react/react-utils.js +0 -40
@@ -1,66 +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 NysCombobox = 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
- value,
18
- tooltip,
19
- form,
20
- width,
21
- errorMessage,
22
- ...filteredProps
23
- } = props;
24
-
25
- /** Event listeners - run once */
26
- useEventListener(ref, "nys-input", props.onNysInput);
27
- useEventListener(ref, "nys-focus", props.onNysFocus);
28
- useEventListener(ref, "nys-blur", props.onNysBlur);
29
- useEventListener(ref, "nys-change", props.onNysChange);
30
-
31
- return React.createElement(
32
- "nys-combobox",
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
- value: props.value,
48
- tooltip: props.tooltip,
49
- form: props.form,
50
- width: props.width,
51
- errorMessage: props.errorMessage,
52
- class: props.className,
53
- exportparts: props.exportparts,
54
- for: props.htmlFor,
55
- part: props.part,
56
- tabindex: props.tabIndex,
57
- disabled: props.disabled ? true : undefined,
58
- required: props.required ? true : undefined,
59
- optional: props.optional ? true : undefined,
60
- inverted: props.inverted ? true : undefined,
61
- showError: props.showError ? true : undefined,
62
- style: { ...props.style },
63
- },
64
- props.children,
65
- );
66
- });
@@ -1,128 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysDatepicker as NysDatepickerElement,
4
- CustomEvent,
5
- Event,
6
- } from "../../dist/nysds.es.js";
7
-
8
- export type { NysDatepickerElement, CustomEvent, Event };
9
-
10
- export interface NysDatepickerProps 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
- /** Hide the "Today" button in calendar popup. */
26
- hideTodayButton?: boolean;
27
-
28
- /** Hide the "Clear" button in calendar popup. */
29
- hideClearButton?: boolean;
30
-
31
- /** Disable interaction. */
32
- disabled?: boolean;
33
-
34
- /** Mark as required. Shows "Required" flag and validates on blur. */
35
- required?: boolean;
36
-
37
- /** Show "Optional" flag. Use when most fields are required. */
38
- optional?: boolean;
39
-
40
- /** Show error state. */
41
- showError?: boolean;
42
-
43
- /** Dark background mode. */
44
- inverted?: boolean;
45
-
46
- /** Unique identifier. Auto-generated if not provided. */
47
- id?: NysDatepickerElement["id"];
48
-
49
- /** Name for form submission. */
50
- name?: NysDatepickerElement["name"];
51
-
52
- /** Input width: `md` (200px), `lg` (384px), `full` (100%). */
53
- width?: NysDatepickerElement["width"];
54
-
55
- /** Error message text. */
56
- errorMessage?: NysDatepickerElement["errorMessage"];
57
-
58
- /** Form `id` to associate with when input is outside form. */
59
- form?: NysDatepickerElement["form"];
60
-
61
- /** Tooltip text on info icon hover. */
62
- tooltip?: NysDatepickerElement["tooltip"];
63
-
64
- /** Input type. Currently only supports `date`. */
65
- type?: NysDatepickerElement["type"];
66
-
67
- /** Label text. Required for accessibility. */
68
- label?: NysDatepickerElement["label"];
69
-
70
- /** Helper text below label. */
71
- description?: NysDatepickerElement["description"];
72
-
73
- /** Initial date when calendar opens (YYYY-MM-DD). */
74
- startDate?: NysDatepickerElement["startDate"];
75
-
76
- /** The earliest selectable date (YYYY-MM-DD). */
77
- minDate?: NysDatepickerElement["minDate"];
78
-
79
- /** The latest selectable date (YYYY-MM-DD). */
80
- maxDate?: NysDatepickerElement["maxDate"];
81
-
82
- /** Selected date. Accepts Date object or ISO string (YYYY-MM-DD). */
83
- value?: NysDatepickerElement["value"];
84
-
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()`. */
86
- className?: string;
87
-
88
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
89
- exportparts?: string;
90
-
91
- /** Used for labels to link them with their inputs (using input id). */
92
- htmlFor?: string;
93
-
94
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
95
- key?: number | string;
96
-
97
- /** 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. */
98
- part?: string;
99
-
100
- /** 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. */
101
- ref?: any;
102
-
103
- /** 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. */
104
- tabIndex?: number;
105
-
106
- /** Fired on date selection. Detail: `{id, value}`. */
107
- onNysInput?: (event: CustomEvent) => void;
108
-
109
- /** Fired when input or calendar loses focus. Triggers validation. */
110
- onNysBlur?: (event: CustomEvent) => void;
111
- }
112
-
113
- /**
114
- * Date picker with calendar popup and native fallback.
115
- * ---
116
- *
117
- *
118
- * ### **Events:**
119
- * - **nys-input** - Fired on date selection. Detail: `{id, value}`.
120
- * - **nys-blur** - Fired when input or calendar loses focus. Triggers validation.
121
- *
122
- * ### **Methods:**
123
- * - **checkValidity(): _boolean_** - Passive check of validity:
124
- * - Returns true/false
125
- * - Does NOT update UI or show errors
126
- * - Used in form submission checks
127
- */
128
- export const NysDatepicker: React.ForwardRefExoticComponent<NysDatepickerProps>;
@@ -1,76 +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 NysDatepicker = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- hideTodayButton,
9
- hideClearButton,
10
- disabled,
11
- required,
12
- optional,
13
- showError,
14
- inverted,
15
- id,
16
- name,
17
- width,
18
- errorMessage,
19
- form,
20
- tooltip,
21
- type,
22
- label,
23
- description,
24
- startDate,
25
- minDate,
26
- maxDate,
27
- value,
28
- ...filteredProps
29
- } = props;
30
-
31
- /** Event listeners - run once */
32
- useEventListener(ref, "nys-input", props.onNysInput);
33
- useEventListener(ref, "nys-blur", props.onNysBlur);
34
-
35
- return React.createElement(
36
- "nys-datepicker",
37
- {
38
- ref: (node) => {
39
- ref.current = node;
40
- if (typeof forwardedRef === "function") {
41
- forwardedRef(node);
42
- } else if (forwardedRef) {
43
- forwardedRef.current = node;
44
- }
45
- },
46
- ...filteredProps,
47
- id: props.id,
48
- name: props.name,
49
- width: props.width,
50
- errorMessage: props.errorMessage,
51
- form: props.form,
52
- tooltip: props.tooltip,
53
- type: props.type,
54
- label: props.label,
55
- description: props.description,
56
- startDate: props.startDate,
57
- minDate: props.minDate,
58
- maxDate: props.maxDate,
59
- value: props.value,
60
- class: props.className,
61
- exportparts: props.exportparts,
62
- for: props.htmlFor,
63
- part: props.part,
64
- tabindex: props.tabIndex,
65
- hideTodayButton: props.hideTodayButton ? true : undefined,
66
- hideClearButton: props.hideClearButton ? true : undefined,
67
- disabled: props.disabled ? true : undefined,
68
- required: props.required ? true : undefined,
69
- optional: props.optional ? true : undefined,
70
- showError: props.showError ? true : undefined,
71
- inverted: props.inverted ? true : undefined,
72
- style: { ...props.style },
73
- },
74
- props.children,
75
- );
76
- });
@@ -1,54 +0,0 @@
1
- import React from "react";
2
- import { NysDivider as NysDividerElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysDividerElement };
5
-
6
- export interface NysDividerProps 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
- /** Adjusts colors for dark backgrounds. */
22
- inverted?: boolean;
23
-
24
- /** If true, the divider will use a lighter color. */
25
- subtle?: boolean;
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
- * Horizontal divider for visual separation of content sections.
51
- * ---
52
- *
53
- */
54
- export const NysDivider: React.ForwardRefExoticComponent<NysDividerProps>;
@@ -1,22 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysDivider = forwardRef((props, forwardedRef) => {
5
- const { inverted, subtle, ...filteredProps } = props;
6
-
7
- return React.createElement(
8
- "nys-divider",
9
- {
10
- ...filteredProps,
11
- class: props.className,
12
- exportparts: props.exportparts,
13
- for: props.htmlFor,
14
- part: props.part,
15
- tabindex: props.tabIndex,
16
- inverted: props.inverted ? true : undefined,
17
- subtle: props.subtle ? true : undefined,
18
- style: { ...props.style },
19
- },
20
- props.children,
21
- );
22
- });
@@ -1,59 +0,0 @@
1
- import React from "react";
2
- import { NysDropdownMenu as NysDropdownMenuElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysDropdownMenuElement };
5
-
6
- export interface NysDropdownMenuProps 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
- /** undefined */
22
- showDropdown?: boolean;
23
-
24
- /** undefined */
25
- for?: NysDropdownMenuElement["for"];
26
-
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. */
30
- label?: NysDropdownMenuElement["label"];
31
-
32
- /** Preferred position relative to trigger. */
33
- position?: NysDropdownMenuElement["position"];
34
-
35
- /** 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()`. */
36
- className?: string;
37
-
38
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
39
- exportparts?: string;
40
-
41
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
42
- key?: number | string;
43
-
44
- /** 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. */
45
- part?: string;
46
-
47
- /** 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. */
48
- ref?: any;
49
-
50
- /** 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. */
51
- tabIndex?: number;
52
- }
53
-
54
- /**
55
- * Action menu with auto-positioning, keyboard support, and screen reader integration.
56
- * ---
57
- *
58
- */
59
- export const NysDropdownMenu: React.ForwardRefExoticComponent<NysDropdownMenuProps>;
@@ -1,23 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysDropdownMenu = forwardRef((props, forwardedRef) => {
5
- const { showDropdown, label, position, ...filteredProps } = props;
6
-
7
- return React.createElement(
8
- "nys-dropdownmenu",
9
- {
10
- ...filteredProps,
11
- for: props.for,
12
- label: props.label,
13
- position: props.position,
14
- class: props.className,
15
- exportparts: props.exportparts,
16
- part: props.part,
17
- tabindex: props.tabIndex,
18
- showDropdown: props.showDropdown ? true : undefined,
19
- style: { ...props.style },
20
- },
21
- props.children,
22
- );
23
- });
@@ -1,75 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysDropdownMenuItem as NysDropdownMenuItemElement,
4
- CustomEvent,
5
- } from "../../dist/nysds.es.js";
6
-
7
- export type { NysDropdownMenuItemElement, CustomEvent };
8
-
9
- export interface NysDropdownMenuItemProps 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
- /** undefined */
25
- disabled?: boolean;
26
-
27
- /** undefined */
28
- label?: NysDropdownMenuItemElement["label"];
29
-
30
- /** undefined */
31
- href?: NysDropdownMenuItemElement["href"];
32
-
33
- /** undefined */
34
- target?: NysDropdownMenuItemElement["target"];
35
-
36
- /** undefined */
37
- prefixIcon?: NysDropdownMenuItemElement["prefixIcon"];
38
-
39
- /** undefined */
40
- divider?: NysDropdownMenuItemElement["divider"];
41
-
42
- /** 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()`. */
43
- className?: string;
44
-
45
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
46
- exportparts?: string;
47
-
48
- /** Used for labels to link them with their inputs (using input id). */
49
- htmlFor?: string;
50
-
51
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
52
- key?: number | string;
53
-
54
- /** 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. */
55
- part?: string;
56
-
57
- /** 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. */
58
- ref?: any;
59
-
60
- /** 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. */
61
- tabIndex?: number;
62
-
63
- /** undefined */
64
- onNysClick?: (event: CustomEvent) => void;
65
- }
66
-
67
- /**
68
- * Dropdown item to display label and provide href link.
69
- * ---
70
- *
71
- *
72
- * ### **Events:**
73
- * - **nys-click**
74
- */
75
- export const NysDropdownMenuItem: React.ForwardRefExoticComponent<NysDropdownMenuItemProps>;
@@ -1,47 +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 NysDropdownMenuItem = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- disabled,
9
- label,
10
- href,
11
- target,
12
- prefixIcon,
13
- divider,
14
- ...filteredProps
15
- } = props;
16
-
17
- /** Event listeners - run once */
18
- useEventListener(ref, "nys-click", props.onNysClick);
19
-
20
- return React.createElement(
21
- "nys-dropdownmenuitem",
22
- {
23
- ref: (node) => {
24
- ref.current = node;
25
- if (typeof forwardedRef === "function") {
26
- forwardedRef(node);
27
- } else if (forwardedRef) {
28
- forwardedRef.current = node;
29
- }
30
- },
31
- ...filteredProps,
32
- label: props.label,
33
- href: props.href,
34
- target: props.target,
35
- prefixIcon: props.prefixIcon,
36
- divider: props.divider,
37
- class: props.className,
38
- exportparts: props.exportparts,
39
- for: props.htmlFor,
40
- part: props.part,
41
- tabindex: props.tabIndex,
42
- disabled: props.disabled ? true : undefined,
43
- style: { ...props.style },
44
- },
45
- props.children,
46
- );
47
- });
@@ -1,60 +0,0 @@
1
- import React from "react";
2
- import { NysErrorMessage as NysErrorMessageElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysErrorMessageElement };
5
-
6
- export interface NysErrorMessageProps 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 to display the error message. */
22
- showError?: boolean;
23
-
24
- /** Shows a divider line above the error message. */
25
- showDivider?: boolean;
26
-
27
- /** The "id" of the error message. */
28
- id?: NysErrorMessageElement["id"];
29
-
30
- /** Error text to display. Falls back to native validation message if available. */
31
- errorMessage?: NysErrorMessageElement["errorMessage"];
32
-
33
- /** 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
- className?: string;
35
-
36
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
37
- exportparts?: string;
38
-
39
- /** Used for labels to link them with their inputs (using input id). */
40
- htmlFor?: string;
41
-
42
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
43
- key?: number | string;
44
-
45
- /** 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. */
46
- part?: string;
47
-
48
- /** 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. */
49
- ref?: any;
50
-
51
- /** 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. */
52
- tabIndex?: number;
53
- }
54
-
55
- /**
56
- * Internal error message display with icon and ARIA alert support.
57
- * ---
58
- *
59
- */
60
- export const NysErrorMessage: React.ForwardRefExoticComponent<NysErrorMessageProps>;
@@ -1,24 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysErrorMessage = forwardRef((props, forwardedRef) => {
5
- const { showError, showDivider, id, errorMessage, ...filteredProps } = props;
6
-
7
- return React.createElement(
8
- "nys-errormessage",
9
- {
10
- ...filteredProps,
11
- id: props.id,
12
- errorMessage: props.errorMessage,
13
- class: props.className,
14
- exportparts: props.exportparts,
15
- for: props.htmlFor,
16
- part: props.part,
17
- tabindex: props.tabIndex,
18
- showError: props.showError ? true : undefined,
19
- showDivider: props.showDivider ? true : undefined,
20
- style: { ...props.style },
21
- },
22
- props.children,
23
- );
24
- });