@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,78 +0,0 @@
1
- import React from "react";
2
- import { NysBadge as NysBadgeElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysBadgeElement };
5
-
6
- export interface NysBadgeProps 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
- /** Strong visual intent with bolder text and background. */
22
- strong?: boolean;
23
-
24
- /** undefined */
25
- prefixIcon?: string | boolean;
26
-
27
- /** undefined */
28
- suffixIcon?: string | boolean;
29
-
30
- /** Unique identifier. */
31
- id?: NysBadgeElement["id"];
32
-
33
- /** Name attribute for form association. */
34
- name?: NysBadgeElement["name"];
35
-
36
- /** Badge size: `sm` (smaller text) or `md` (default). */
37
- size?: NysBadgeElement["size"];
38
-
39
- /** Semantic intent affecting color: `base`, `info`, `success`, `warning` `danger`, `emergency`. `error` has been deprecated and support will be removed in a future release. Use `danger` instead */
40
- intent?: NysBadgeElement["intent"];
41
-
42
- /** Secondary label displayed before the main label. */
43
- prefixLabel?: NysBadgeElement["prefixLabel"];
44
-
45
- /** Primary label text displayed in the badge. */
46
- label?: NysBadgeElement["label"];
47
-
48
- /** Screen reader text appended after the label for additional context. */
49
- srText?: NysBadgeElement["srText"];
50
-
51
- /** 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()`. */
52
- className?: string;
53
-
54
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
55
- exportparts?: string;
56
-
57
- /** Used for labels to link them with their inputs (using input id). */
58
- htmlFor?: string;
59
-
60
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
61
- key?: number | string;
62
-
63
- /** 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. */
64
- part?: string;
65
-
66
- /** 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. */
67
- ref?: any;
68
-
69
- /** 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. */
70
- tabIndex?: number;
71
- }
72
-
73
- /**
74
- * Compact label for status, counts, or categorization with semantic styling.
75
- * ---
76
- *
77
- */
78
- export const NysBadge: React.ForwardRefExoticComponent<NysBadgeProps>;
@@ -1,42 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysBadge = forwardRef((props, forwardedRef) => {
5
- const {
6
- strong,
7
- prefixIcon,
8
- suffixIcon,
9
- id,
10
- name,
11
- size,
12
- intent,
13
- prefixLabel,
14
- label,
15
- srText,
16
- ...filteredProps
17
- } = props;
18
-
19
- return React.createElement(
20
- "nys-badge",
21
- {
22
- ...filteredProps,
23
- id: props.id,
24
- name: props.name,
25
- size: props.size,
26
- intent: props.intent,
27
- prefixLabel: props.prefixLabel,
28
- label: props.label,
29
- srText: props.srText,
30
- class: props.className,
31
- exportparts: props.exportparts,
32
- for: props.htmlFor,
33
- part: props.part,
34
- tabindex: props.tabIndex,
35
- strong: props.strong ? true : undefined,
36
- prefixicon: props.prefixIcon ? true : undefined,
37
- suffixicon: props.suffixIcon ? true : undefined,
38
- style: { ...props.style },
39
- },
40
- props.children,
41
- );
42
- });
@@ -1,72 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysBreadcrumbItem as NysBreadcrumbItemElement,
4
- CustomEvent,
5
- } from "../../dist/nysds.es.js";
6
-
7
- export type { NysBreadcrumbItemElement, CustomEvent };
8
-
9
- export interface NysBreadcrumbItemProps 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
- /** Private property used by nys-breadcrumbs to indicate this breadcrumb item is the last in the trail * */
25
- isLast?: boolean;
26
-
27
- /** undefined */
28
- isBackToParent?: boolean;
29
-
30
- /** undefined */
31
- id?: NysBreadcrumbItemElement["id"];
32
-
33
- /** undefined */
34
- label?: NysBreadcrumbItemElement["label"];
35
-
36
- /** undefined */
37
- link?: NysBreadcrumbItemElement["link"];
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 the link is clicked. Detail: `{id, link}`. */
61
- onNysBreadcrumbitemClick?: (event: CustomEvent) => void;
62
- }
63
-
64
- /**
65
- * Single breadcrumb trail item with chevron separator and current page support.
66
- * ---
67
- *
68
- *
69
- * ### **Events:**
70
- * - **nys-breadcrumbitem-click** - Fired when the link is clicked. Detail: `{id, link}`.
71
- */
72
- export const NysBreadcrumbItem: React.ForwardRefExoticComponent<NysBreadcrumbItemProps>;
@@ -1,42 +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 NysBreadcrumbItem = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const { isLast, isBackToParent, id, label, link, ...filteredProps } = props;
8
-
9
- /** Event listeners - run once */
10
- useEventListener(
11
- ref,
12
- "nys-breadcrumbitem-click",
13
- props.onNysBreadcrumbitemClick,
14
- );
15
-
16
- return React.createElement(
17
- "nys-breadcrumbitem",
18
- {
19
- ref: (node) => {
20
- ref.current = node;
21
- if (typeof forwardedRef === "function") {
22
- forwardedRef(node);
23
- } else if (forwardedRef) {
24
- forwardedRef.current = node;
25
- }
26
- },
27
- ...filteredProps,
28
- id: props.id,
29
- label: props.label,
30
- link: props.link,
31
- class: props.className,
32
- exportparts: props.exportparts,
33
- for: props.htmlFor,
34
- part: props.part,
35
- tabindex: props.tabIndex,
36
- isLast: props.isLast ? true : undefined,
37
- isBackToParent: props.isBackToParent ? true : undefined,
38
- style: { ...props.style },
39
- },
40
- props.children,
41
- );
42
- });
@@ -1,89 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysBreadcrumbs as NysBreadcrumbsElement,
4
- CustomEvent,
5
- } from "../../dist/nysds.es.js";
6
-
7
- export type { NysBreadcrumbsElement, CustomEvent };
8
-
9
- export interface NysBreadcrumbsProps 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
- /** On mobile, renders the trail as a single back-to-parent link pointing to the item before the current page.
25
- Has no effect on desktop or when only one item is present (which always renders as a back link). */
26
- backToParent?: boolean;
27
-
28
- /** Forces the trail into its collapsed state.
29
- It shows only the first item, an ellipsis, and the last two items.
30
- The user can still expand the trail by clicking the ellipsis. */
31
- collapsed?: boolean;
32
-
33
- /** Renders a filled light theme background bar behind the breadcrumb trail. */
34
- backgroundBar?: boolean;
35
-
36
- /** Prevents interaction. */
37
- disabled?: boolean;
38
-
39
- /** Unique identifier. Auto-generated if not provided. */
40
- id?: NysBreadcrumbsElement["id"];
41
-
42
- /** Accessible label for the `<nav>` landmark. Defaults to "Breadcrumb" if not set.
43
- Override when multiple crumbs exist on the same page. */
44
- ariaLabel?: NysBreadcrumbsElement["ariaLabel"];
45
-
46
- /** Controls the visual size of the breadcrumb text and spacing: `sm` for dense layouts, `md` (default) for standard use. */
47
- size?: NysBreadcrumbsElement["size"];
48
-
49
- /** 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()`. */
50
- className?: string;
51
-
52
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
53
- exportparts?: string;
54
-
55
- /** Used for labels to link them with their inputs (using input id). */
56
- htmlFor?: string;
57
-
58
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
59
- key?: number | string;
60
-
61
- /** 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. */
62
- part?: string;
63
-
64
- /** 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. */
65
- ref?: any;
66
-
67
- /** 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. */
68
- tabIndex?: number;
69
-
70
- /** undefined */
71
- onNysExpand?: (event: CustomEvent) => void;
72
-
73
- /** Fired when the user clicks the ellipsis to expand the trail. */
74
- onNysBreadcrumbsExpand?: (event: CustomEvent) => void;
75
- }
76
-
77
- /**
78
- * Breadcrumb navigation trail with responsive collapse support.
79
- * ---
80
- *
81
- *
82
- * ### **Events:**
83
- * - **nys-expand**
84
- * - **nys-breadcrumbs-expand** - Fired when the user clicks the ellipsis to expand the trail.
85
- *
86
- * ### **Slots:**
87
- * - _default_ - One or more `li` elements defining the trail.
88
- */
89
- export const NysBreadcrumbs: React.ForwardRefExoticComponent<NysBreadcrumbsProps>;
@@ -1,50 +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 NysBreadcrumbs = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- backToParent,
9
- collapsed,
10
- backgroundBar,
11
- disabled,
12
- id,
13
- ariaLabel,
14
- size,
15
- ...filteredProps
16
- } = props;
17
-
18
- /** Event listeners - run once */
19
- useEventListener(ref, "nys-expand", props.onNysExpand);
20
- useEventListener(ref, "nys-breadcrumbs-expand", props.onNysBreadcrumbsExpand);
21
-
22
- return React.createElement(
23
- "nys-breadcrumbs",
24
- {
25
- ref: (node) => {
26
- ref.current = node;
27
- if (typeof forwardedRef === "function") {
28
- forwardedRef(node);
29
- } else if (forwardedRef) {
30
- forwardedRef.current = node;
31
- }
32
- },
33
- ...filteredProps,
34
- id: props.id,
35
- ariaLabel: props.ariaLabel,
36
- size: props.size,
37
- class: props.className,
38
- exportparts: props.exportparts,
39
- for: props.htmlFor,
40
- part: props.part,
41
- tabindex: props.tabIndex,
42
- backToParent: props.backToParent ? true : undefined,
43
- collapsed: props.collapsed ? true : undefined,
44
- backgroundBar: props.backgroundBar ? true : undefined,
45
- disabled: props.disabled ? true : undefined,
46
- style: { ...props.style },
47
- },
48
- props.children,
49
- );
50
- });
@@ -1,171 +0,0 @@
1
- import React from "react";
2
- import { NysButton as NysButtonElement, Event } from "../../dist/nysds.es.js";
3
-
4
- export type { NysButtonElement, Event };
5
-
6
- export interface NysButtonProps 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
- /** Expands button to fill container width. Use for mobile layouts or stacked button groups. */
22
- fullWidth?: boolean;
23
-
24
- /** Adjusts colors for dark backgrounds. */
25
- inverted?: boolean;
26
-
27
- /** Renders circular icon-only button. Requires `icon` prop. `label` is rendered as visually-hidden text for the accessible name. */
28
- circle?: boolean;
29
-
30
- /** Prevents interaction. Avoid disabling without explanation—show validation errors instead. */
31
- disabled?: boolean;
32
-
33
- /** Unique identifier. Auto-generated if not provided. */
34
- id?: NysButtonElement["id"];
35
-
36
- /** Name for form submission. */
37
- name?: NysButtonElement["name"];
38
-
39
- /** Button height: `sm` (40px) for dense UIs, `md` (48px, default) for standard use, `lg` (56px) for prominent CTAs. */
40
- size?: NysButtonElement["size"];
41
-
42
- /** Visual style: `filled` for primary (one per section), `outline` for secondary, `ghost` for tertiary, `text` for inline actions. Avoid `text` for navigation. */
43
- variant?: NysButtonElement["variant"];
44
-
45
- /** Visible button text. Use sentence case, action-oriented text (e.g., "Save Draft"). In `circle` mode it is visually hidden but still exposed to assistive tech as the accessible name. */
46
- label?: NysButtonElement["label"];
47
-
48
- /** ID of controlled element (e.g., dropdown or modal). Sets `aria-controls`.
49
-
50
- Set this on `<nys-button>` rather than putting `aria-controls` on the host:
51
- the host has no role, so ARIA placed there is not mapped into the
52
- accessibility tree and never reaches the internal `<button>`. */
53
- ariaControls?: NysButtonElement["ariaControls"];
54
-
55
- /** Disclosure state for buttons that show/hide content. Sets `aria-expanded`
56
- on the internal `<button>`/`<a>`.
57
-
58
- Use `"false"` when the controlled content is collapsed and `"true"` when it
59
- is expanded, updating it every time the content toggles. Leave unset for
60
- buttons that are not disclosure triggers — an `aria-expanded` that never
61
- changes is worse than none. Pair with `ariaControls` pointing at the
62
- element being shown or hidden.
63
-
64
- Setting `aria-expanded` directly on the `<nys-button>` host does nothing:
65
- a custom element with no role does not map its ARIA attributes into the
66
- accessibility tree, and host ARIA does not cross into the shadow root. */
67
- ariaExpanded?: NysButtonElement["ariaExpanded"];
68
-
69
- /** Marks this button as the current item within a set of related controls — the current
70
- page of a pagination control, the current step of a wizard. Sets `aria-current` on the
71
- internal `<button>`/`<a>`.
72
-
73
- Use `"page"` inside a pagination landmark, `"step"` inside a step indicator, and
74
- `"true"` when no more specific token fits. Only one control in a set is ever current:
75
- leave the property unset on all the others rather than setting `"false"`, which the
76
- spec reads as "explicitly not current" and adds nothing.
77
-
78
- Setting `aria-current` directly on the `<nys-button>` host does nothing: a custom
79
- element with no role does not map its ARIA attributes into the accessibility tree,
80
- and host ARIA does not cross into the shadow root. */
81
- ariaCurrent?: NysButtonElement["ariaCurrent"];
82
-
83
- /** Material Symbol icon before label. Not shown for `circle` mode. */
84
- prefixIcon?: NysButtonElement["prefixIcon"];
85
-
86
- /** Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode. */
87
- suffixIcon?: NysButtonElement["suffixIcon"];
88
-
89
- /** Icon for circle mode. Required when `circle` is true. Scales with size (sm=24px, md=32px, lg=40px). */
90
- icon?: NysButtonElement["icon"];
91
-
92
- /** Form `id` to associate with. Use when button is outside the form element. */
93
- form?: NysButtonElement["form"];
94
-
95
- /** Value submitted with form data. Only used when `type="submit"`. */
96
- value?: NysButtonElement["value"];
97
-
98
- /** ID(s) of element(s) describing this button. Sets `aria-describedby`. */
99
- ariaDescribedBy?: NysButtonElement["ariaDescribedBy"];
100
-
101
- /** Form behavior: `button` (default, no form action), `submit` (submits form), `reset` (resets form). Always set explicitly to avoid unintended submissions. */
102
- type?: NysButtonElement["type"];
103
-
104
- /** URL to navigate to. Renders as `<a>` tag. Omit for action buttons. */
105
- href?: NysButtonElement["href"];
106
-
107
- /** Link target: `_self` (same tab), `_blank` (new tab—add `suffixIcon="open_in_new"`), `_parent`, `_top`, or frame name. */
108
- target?: NysButtonElement["target"];
109
-
110
- /** 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()`. */
111
- className?: string;
112
-
113
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
114
- exportparts?: string;
115
-
116
- /** Used for labels to link them with their inputs (using input id). */
117
- htmlFor?: string;
118
-
119
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
120
- key?: number | string;
121
-
122
- /** 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. */
123
- part?: string;
124
-
125
- /** 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. */
126
- ref?: any;
127
-
128
- /** 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. */
129
- tabIndex?: number;
130
-
131
- /** Click handler. Use instead of `@click` to ensure keyboard accessibility. */
132
- onClick?: NysButtonElement["onClick"];
133
-
134
- /** Fired when the button receives focus. */
135
- onNysFocus?: (event: CustomEvent) => void;
136
-
137
- /** Fired when the button loses focus. */
138
- onNysBlur?: (event: CustomEvent) => void;
139
-
140
- /** Fired when the button is clicked (mouse or keyboard). Not fired when disabled. */
141
- onNysClick?: (event: CustomEvent) => void;
142
- }
143
-
144
- /**
145
- * Button for actions and CTAs with variants, sizes, and icon support.
146
- * ---
147
- *
148
- *
149
- * ### **Events:**
150
- * - **nys-focus** - Fired when the button receives focus.
151
- * - **nys-blur** - Fired when the button loses focus.
152
- * - **nys-click** - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.
153
- *
154
- * ### **Slots:**
155
- * - _default_ - Button label text. Use as fallback when `label` prop is not provided.
156
- * - **prefix-icon** - Icon before label. Not shown for `text` variant.
157
- * - **suffix-icon** - Icon after label. Not shown for `text` variant.
158
- * - **circle-icon** - Icon for circle mode. Overrides `icon` prop.
159
- *
160
- * ### **CSS Properties:**
161
- * - **--nys-button-color** - Text color of the button label. _(default: undefined)_
162
- * - **--nys-button-color--hover** - Text color when hovered. _(default: undefined)_
163
- * - **--nys-button-color--active** - Text color when active/pressed. _(default: undefined)_
164
- * - **--nys-button-background-color** - Background color of the button. _(default: undefined)_
165
- * - **--nys-button-background-color--hover** - Background color when hovered. _(default: undefined)_
166
- * - **--nys-button-background-color--active** - Background color when active/pressed. _(default: undefined)_
167
- * - **--nys-button-border-color** - Border color of the button. _(default: undefined)_
168
- * - **--nys-button-border-color--hover** - Border color when hovered. _(default: undefined)_
169
- * - **--nys-button-border-color--active** - Border color when active/pressed. _(default: undefined)_
170
- */
171
- export const NysButton: React.ForwardRefExoticComponent<NysButtonProps>;
@@ -1,83 +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 NysButton = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- fullWidth,
9
- inverted,
10
- circle,
11
- disabled,
12
- id,
13
- name,
14
- size,
15
- variant,
16
- label,
17
- ariaControls,
18
- ariaExpanded,
19
- ariaCurrent,
20
- prefixIcon,
21
- suffixIcon,
22
- icon,
23
- form,
24
- value,
25
- ariaDescribedBy,
26
- type,
27
- href,
28
- target,
29
- onClick,
30
- ...filteredProps
31
- } = props;
32
-
33
- /** Event listeners - run once */
34
- useEventListener(ref, "nys-focus", props.onNysFocus);
35
- useEventListener(ref, "nys-blur", props.onNysBlur);
36
- useEventListener(ref, "nys-click", props.onNysClick);
37
-
38
- /** Properties - run whenever a property has changed */
39
- useProperties(ref, "onClick", props.onClick);
40
-
41
- return React.createElement(
42
- "nys-button",
43
- {
44
- ref: (node) => {
45
- ref.current = node;
46
- if (typeof forwardedRef === "function") {
47
- forwardedRef(node);
48
- } else if (forwardedRef) {
49
- forwardedRef.current = node;
50
- }
51
- },
52
- ...filteredProps,
53
- id: props.id,
54
- name: props.name,
55
- size: props.size,
56
- variant: props.variant,
57
- label: props.label,
58
- ariaControls: props.ariaControls,
59
- ariaExpanded: props.ariaExpanded,
60
- ariaCurrent: props.ariaCurrent,
61
- prefixIcon: props.prefixIcon,
62
- suffixIcon: props.suffixIcon,
63
- icon: props.icon,
64
- form: props.form,
65
- value: props.value,
66
- ariaDescribedBy: props.ariaDescribedBy,
67
- type: props.type,
68
- href: props.href,
69
- target: props.target,
70
- class: props.className,
71
- exportparts: props.exportparts,
72
- for: props.htmlFor,
73
- part: props.part,
74
- tabindex: props.tabIndex,
75
- fullWidth: props.fullWidth ? true : undefined,
76
- inverted: props.inverted ? true : undefined,
77
- circle: props.circle ? true : undefined,
78
- disabled: props.disabled ? true : undefined,
79
- style: { ...props.style },
80
- },
81
- props.children,
82
- );
83
- });