@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,59 +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 NysToggle = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- checked,
9
- disabled,
10
- noIcon,
11
- inverted,
12
- id,
13
- name,
14
- value,
15
- label,
16
- description,
17
- form,
18
- size,
19
- ...filteredProps
20
- } = props;
21
-
22
- /** Event listeners - run once */
23
- useEventListener(ref, "nys-change", props.onNysChange);
24
- useEventListener(ref, "nys-focus", props.onNysFocus);
25
- useEventListener(ref, "nys-blur", props.onNysBlur);
26
-
27
- return React.createElement(
28
- "nys-toggle",
29
- {
30
- ref: (node) => {
31
- ref.current = node;
32
- if (typeof forwardedRef === "function") {
33
- forwardedRef(node);
34
- } else if (forwardedRef) {
35
- forwardedRef.current = node;
36
- }
37
- },
38
- ...filteredProps,
39
- id: props.id,
40
- name: props.name,
41
- value: props.value,
42
- label: props.label,
43
- description: props.description,
44
- form: props.form,
45
- size: props.size,
46
- class: props.className,
47
- exportparts: props.exportparts,
48
- for: props.htmlFor,
49
- part: props.part,
50
- tabindex: props.tabIndex,
51
- checked: props.checked ? true : undefined,
52
- disabled: props.disabled ? true : undefined,
53
- noIcon: props.noIcon ? true : undefined,
54
- inverted: props.inverted ? true : undefined,
55
- style: { ...props.style },
56
- },
57
- props.children,
58
- );
59
- });
@@ -1,60 +0,0 @@
1
- import React from "react";
2
- import { NysTooltip as NysTooltipElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysTooltipElement };
5
-
6
- export interface NysTooltipProps 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
- /** Unique identifier. Auto-generated if not provided. */
25
- id?: NysTooltipElement["id"];
26
-
27
- /** Tooltip content text. Required. */
28
- text?: NysTooltipElement["text"];
29
-
30
- /** ID of the trigger element to attach this tooltip to. Required. */
31
- for?: NysTooltipElement["for"];
32
-
33
- /** Preferred position relative to trigger. Auto-adjusts if space is insufficient. */
34
- position?: NysTooltipElement["position"];
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 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
- * Contextual tooltip with auto-positioning, keyboard support, and screen reader integration.
57
- * ---
58
- *
59
- */
60
- export const NysTooltip: React.ForwardRefExoticComponent<NysTooltipProps>;
@@ -1,24 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysTooltip = forwardRef((props, forwardedRef) => {
5
- const { inverted, id, text, position, ...filteredProps } = props;
6
-
7
- return React.createElement(
8
- "nys-tooltip",
9
- {
10
- ...filteredProps,
11
- id: props.id,
12
- text: props.text,
13
- for: props.for,
14
- position: props.position,
15
- class: props.className,
16
- exportparts: props.exportparts,
17
- part: props.part,
18
- tabindex: props.tabIndex,
19
- inverted: props.inverted ? true : undefined,
20
- style: { ...props.style },
21
- },
22
- props.children,
23
- );
24
- });
@@ -1,61 +0,0 @@
1
- import React from "react";
2
- import { NysUnavFooter as NysUnavFooterElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysUnavFooterElement };
5
-
6
- export interface NysUnavFooterProps 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
- /** Accessible name for the `contentinfo` landmark this footer renders.
22
- Defaults to `"New York State"`.
23
-
24
- A page pairing this footer with `nys-globalfooter` carries two `contentinfo`
25
- landmarks; distinct names are what keep landmark navigation useful instead of
26
- announcing "content information" twice. Override only when your wording is
27
- clearer for your audience — and keep it distinct from the agency footer's
28
- name, which comes from that footer's visible heading.
29
-
30
- A blank value falls back to the default rather than leaving the landmark
31
- unnamed. */
32
- landmarkLabel?: NysUnavFooterElement["landmarkLabel"];
33
-
34
- /** 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()`. */
35
- className?: string;
36
-
37
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
38
- exportparts?: string;
39
-
40
- /** Used for labels to link them with their inputs (using input id). */
41
- htmlFor?: string;
42
-
43
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
44
- key?: number | string;
45
-
46
- /** 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. */
47
- part?: string;
48
-
49
- /** 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. */
50
- ref?: any;
51
-
52
- /** 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. */
53
- tabIndex?: number;
54
- }
55
-
56
- /**
57
- * Universal NYS footer with logo and statewide links. Required site-wide.
58
- * ---
59
- *
60
- */
61
- export const NysUnavFooter: React.ForwardRefExoticComponent<NysUnavFooterProps>;
@@ -1,21 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysUnavFooter = forwardRef((props, forwardedRef) => {
5
- const { landmarkLabel, ...filteredProps } = props;
6
-
7
- return React.createElement(
8
- "nys-unavfooter",
9
- {
10
- ...filteredProps,
11
- landmarkLabel: props.landmarkLabel,
12
- class: props.className,
13
- exportparts: props.exportparts,
14
- for: props.htmlFor,
15
- part: props.part,
16
- tabindex: props.tabIndex,
17
- style: { ...props.style },
18
- },
19
- props.children,
20
- );
21
- });
@@ -1,95 +0,0 @@
1
- import React from "react";
2
- import { NysUnavHeader as NysUnavHeaderElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysUnavHeaderElement };
5
-
6
- export interface NysUnavHeaderProps 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
- /** Internal: Whether trust bar panel is expanded. */
22
- trustbarVisible?: boolean;
23
-
24
- /** Internal: Whether search dropdown is visible (mobile). */
25
- searchDropdownVisible?: boolean;
26
-
27
- /** Internal: Whether language dropdown is visible. */
28
- languageVisible?: boolean;
29
-
30
- /** Internal: Whether search input is focused. */
31
- isSearchFocused?: boolean;
32
-
33
- /** Hides the translation dropdown. */
34
- hideTranslate?: boolean;
35
-
36
- /** Hides the search functionality. */
37
- hideSearch?: boolean;
38
-
39
- /** The URL endpoint of the search, make sure to include the query param. */
40
- searchUrl?: NysUnavHeaderElement["searchUrl"];
41
-
42
- /** Accessible name for the `banner` landmark this header renders.
43
- Defaults to `"New York State"`.
44
-
45
- A page pairing this header with `nys-globalheader` carries two `banner`
46
- landmarks; distinct names are what keep landmark navigation useful instead of
47
- announcing "banner, banner". Override only when your wording is clearer for
48
- your audience — and keep it distinct from the agency header's name, which
49
- comes from that header's visible title.
50
-
51
- A blank value falls back to the default rather than leaving the landmark
52
- unnamed. */
53
- landmarkLabel?: NysUnavHeaderElement["landmarkLabel"];
54
-
55
- /** The list of languages this site can be translated to, default to use Smartling */
56
- languages?: NysUnavHeaderElement["languages"];
57
-
58
- /** 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()`. */
59
- className?: string;
60
-
61
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
62
- exportparts?: string;
63
-
64
- /** Used for labels to link them with their inputs (using input id). */
65
- htmlFor?: string;
66
-
67
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
68
- key?: number | string;
69
-
70
- /** 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. */
71
- part?: string;
72
-
73
- /** 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. */
74
- ref?: any;
75
-
76
- /** 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. */
77
- tabIndex?: number;
78
-
79
- /** Fired when a language is selected. Detail: `{language: {code, label, url?}}`. Cancelable; `preventDefault()` overrides the default Smartling redirect. */
80
- onNysLanguageSelect?: (event: CustomEvent) => void;
81
-
82
- /** Fired when a search is submitted. Detail: `{query}`. Cancelable; `preventDefault()` overrides the default search redirect. */
83
- onNysSearchSubmit?: (event: CustomEvent) => void;
84
- }
85
-
86
- /**
87
- * Universal NYS header with trust bar, search, and translation. Required site-wide.
88
- * ---
89
- *
90
- *
91
- * ### **Events:**
92
- * - **nys-language-select** - Fired when a language is selected. Detail: `{language: {code, label, url?}}`. Cancelable; `preventDefault()` overrides the default Smartling redirect.
93
- * - **nys-search-submit** - Fired when a search is submitted. Detail: `{query}`. Cancelable; `preventDefault()` overrides the default search redirect.
94
- */
95
- export const NysUnavHeader: React.ForwardRefExoticComponent<NysUnavHeaderProps>;
@@ -1,54 +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 NysUnavHeader = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const {
8
- trustbarVisible,
9
- searchDropdownVisible,
10
- languageVisible,
11
- isSearchFocused,
12
- hideTranslate,
13
- hideSearch,
14
- searchUrl,
15
- landmarkLabel,
16
- languages,
17
- ...filteredProps
18
- } = props;
19
-
20
- /** Event listeners - run once */
21
- useEventListener(ref, "nys-language-select", props.onNysLanguageSelect);
22
- useEventListener(ref, "nys-search-submit", props.onNysSearchSubmit);
23
-
24
- return React.createElement(
25
- "nys-unavheader",
26
- {
27
- ref: (node) => {
28
- ref.current = node;
29
- if (typeof forwardedRef === "function") {
30
- forwardedRef(node);
31
- } else if (forwardedRef) {
32
- forwardedRef.current = node;
33
- }
34
- },
35
- ...filteredProps,
36
- searchUrl: props.searchUrl,
37
- landmarkLabel: props.landmarkLabel,
38
- languages: props.languages,
39
- class: props.className,
40
- exportparts: props.exportparts,
41
- for: props.htmlFor,
42
- part: props.part,
43
- tabindex: props.tabIndex,
44
- trustbarVisible: props.trustbarVisible ? true : undefined,
45
- searchDropdownVisible: props.searchDropdownVisible ? true : undefined,
46
- languageVisible: props.languageVisible ? true : undefined,
47
- isSearchFocused: props.isSearchFocused ? true : undefined,
48
- hideTranslate: props.hideTranslate ? true : undefined,
49
- hideSearch: props.hideSearch ? true : undefined,
50
- style: { ...props.style },
51
- },
52
- props.children,
53
- );
54
- });
@@ -1,67 +0,0 @@
1
- import React from "react";
2
- import { NysVerticalnav as NysVerticalnavElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysVerticalnavElement };
5
-
6
- export interface NysVerticalnavProps 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
- /** Hides the visible heading while keeping an accessible label for the navigation. */
22
- hideHeading?: boolean;
23
-
24
- /** Expands or collapses the navigation on mobile. */
25
- expanded?: boolean;
26
-
27
- /** ID for the navigation. Generated automatically if not provided. */
28
- id?: NysVerticalnavElement["id"];
29
-
30
- /** Heading text displayed at the top of the navigation. Defaults to "Page navigation". */
31
- heading?: NysVerticalnavElement["heading"];
32
-
33
- /** Heading level used for the navigation heading (`h1` through `h6`). */
34
- headingLevel?: NysVerticalnavElement["headingLevel"];
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
- * Responsive navigation that becomes an accordion on smaller screens.
60
- * ---
61
- *
62
- *
63
- * ### **Methods:**
64
- * - **open()** - Public API for controlling the mobile accordion from outside the component
65
- * --------------------------------------------------------------------------
66
- */
67
- export const NysVerticalnav: React.ForwardRefExoticComponent<NysVerticalnavProps>;
@@ -1,26 +0,0 @@
1
- import React, { forwardRef } from "react";
2
- import "../../dist/nysds.es.js";
3
-
4
- export const NysVerticalnav = forwardRef((props, forwardedRef) => {
5
- const { hideHeading, expanded, id, heading, headingLevel, ...filteredProps } =
6
- props;
7
-
8
- return React.createElement(
9
- "nys-verticalnav",
10
- {
11
- ...filteredProps,
12
- id: props.id,
13
- heading: props.heading,
14
- headingLevel: props.headingLevel,
15
- class: props.className,
16
- exportparts: props.exportparts,
17
- for: props.htmlFor,
18
- part: props.part,
19
- tabindex: props.tabIndex,
20
- hideHeading: props.hideHeading ? true : undefined,
21
- expanded: props.expanded ? true : undefined,
22
- style: { ...props.style },
23
- },
24
- props.children,
25
- );
26
- });
@@ -1,76 +0,0 @@
1
- import React from "react";
2
- import {
3
- NysVerticalnavGroup as NysVerticalnavGroupElement,
4
- CustomEvent,
5
- } from "../../dist/nysds.es.js";
6
-
7
- export type { NysVerticalnavGroupElement, CustomEvent };
8
-
9
- export interface NysVerticalnavGroupProps 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
- expanded?: boolean;
26
-
27
- /** undefined */
28
- disabled?: boolean;
29
-
30
- /** undefined */
31
- active?: boolean;
32
-
33
- /** undefined */
34
- id?: NysVerticalnavGroupElement["id"];
35
-
36
- /** undefined */
37
- label?: NysVerticalnavGroupElement["label"];
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
- /** undefined */
61
- onNysChildResize?: (event: CustomEvent) => void;
62
-
63
- /** undefined */
64
- onNysVerticalnavgroupToggle?: (event: CustomEvent) => void;
65
- }
66
-
67
- /**
68
- * Collapsible link group for use within `<nys-verticalnav>`.
69
- * ---
70
- *
71
- *
72
- * ### **Events:**
73
- * - **nys-child-resize**
74
- * - **nys-verticalnavgroup-toggle**
75
- */
76
- export const NysVerticalnavGroup: React.ForwardRefExoticComponent<NysVerticalnavGroupProps>;
@@ -1,43 +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 NysVerticalnavGroup = forwardRef((props, forwardedRef) => {
6
- const ref = useRef(null);
7
- const { expanded, disabled, active, id, label, ...filteredProps } = props;
8
-
9
- /** Event listeners - run once */
10
- useEventListener(ref, "nys-child-resize", props.onNysChildResize);
11
- useEventListener(
12
- ref,
13
- "nys-verticalnavgroup-toggle",
14
- props.onNysVerticalnavgroupToggle,
15
- );
16
-
17
- return React.createElement(
18
- "nys-verticalnavgroup",
19
- {
20
- ref: (node) => {
21
- ref.current = node;
22
- if (typeof forwardedRef === "function") {
23
- forwardedRef(node);
24
- } else if (forwardedRef) {
25
- forwardedRef.current = node;
26
- }
27
- },
28
- ...filteredProps,
29
- id: props.id,
30
- label: props.label,
31
- class: props.className,
32
- exportparts: props.exportparts,
33
- for: props.htmlFor,
34
- part: props.part,
35
- tabindex: props.tabIndex,
36
- expanded: props.expanded ? true : undefined,
37
- disabled: props.disabled ? true : undefined,
38
- active: props.active ? true : undefined,
39
- style: { ...props.style },
40
- },
41
- props.children,
42
- );
43
- });
@@ -1,83 +0,0 @@
1
- import React from "react";
2
- import { NysVideo as NysVideoElement } from "../../dist/nysds.es.js";
3
-
4
- export type { NysVideoElement };
5
-
6
- export interface NysVideoProps 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
- /** Triggers autoplay when the iframe loads */
22
- autoplay?: boolean;
23
-
24
- /** Prevents the video from being played */
25
- disabled?: boolean;
26
-
27
- /** Full YouTube URL — required. Component will not render if invalid. */
28
- id?: NysVideoElement["id"];
29
-
30
- /** Title text for the thumbnail of the video */
31
- titleText?: NysVideoElement["titleText"];
32
-
33
- /** Full YouTube URL — required. Component will not render if invalid. */
34
- videourl?: NysVideoElement["videourl"];
35
-
36
- /** Largest size for the video player.
37
- If not set, size is determined automatically by viewport width. */
38
- size?: NysVideoElement["size"];
39
-
40
- /** undefined */
41
- loading?: NysVideoElement["loading"];
42
-
43
- /** Time in seconds where playback begins. * */
44
- starttime?: NysVideoElement["starttime"];
45
-
46
- /** Custom thumbnail image path.
47
- Falls back to YouTube's auto-generated thumbnail if not provided. */
48
- thumbnail?: NysVideoElement["thumbnail"];
49
-
50
- /** 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()`. */
51
- className?: string;
52
-
53
- /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
54
- exportparts?: string;
55
-
56
- /** Used for labels to link them with their inputs (using input id). */
57
- htmlFor?: string;
58
-
59
- /** Used to help React identify which items have changed, are added, or are removed within a list. */
60
- key?: number | string;
61
-
62
- /** 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. */
63
- part?: string;
64
-
65
- /** 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. */
66
- ref?: any;
67
-
68
- /** 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. */
69
- tabIndex?: number;
70
-
71
- /** Fired when the user clicks the thumbnail to load the player. */
72
- onNysVideoPlay?: (event: CustomEvent) => void;
73
- }
74
-
75
- /**
76
- * YouTube video player with thumbnail preview and accessibility announcements.
77
- * ---
78
- *
79
- *
80
- * ### **Events:**
81
- * - **nys-video-play** - Fired when the user clicks the thumbnail to load the player.
82
- */
83
- export const NysVideo: React.ForwardRefExoticComponent<NysVideoProps>;