@nysds/components 1.14.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/custom-elements.json +2350 -598
  2. package/dist/.vscode/vscode.html-custom-data.json +63 -7
  3. package/dist/custom-elements.json +2350 -598
  4. package/dist/nysds.es.js +2754 -1819
  5. package/dist/nysds.es.js.map +1 -1
  6. package/dist/nysds.js +340 -117
  7. package/dist/nysds.js.map +1 -1
  8. package/dist/packages/nys-button/src/nys-button.d.ts +8 -0
  9. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +10 -0
  10. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +8 -0
  11. package/dist/packages/nys-combobox/src/index.d.ts +1 -0
  12. package/dist/packages/nys-combobox/src/nys-combobox.d.ts +118 -0
  13. package/dist/packages/nys-combobox/src/nys-combobox.figma.d.ts +1 -0
  14. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +9 -0
  15. package/dist/packages/nys-dropdownmenu/src/index.d.ts +2 -0
  16. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +110 -0
  17. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.figma.d.ts +1 -0
  18. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +40 -0
  19. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +8 -0
  20. package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +8 -0
  21. package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +4 -2
  22. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +10 -0
  23. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +8 -0
  24. package/dist/packages/nys-select/src/nys-select.d.ts +8 -0
  25. package/dist/packages/nys-table/src/nys-table.d.ts +12 -1
  26. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +8 -0
  27. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +8 -1
  28. package/dist/packages/nys-toggle/src/nys-toggle.d.ts +10 -1
  29. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +10 -1
  30. package/dist/src/index.d.ts +2 -0
  31. package/package.json +19 -10
  32. package/packages/react/NysAccordion.d.ts +65 -0
  33. package/packages/react/NysAccordion.js +23 -0
  34. package/packages/react/NysAccordionItem.d.ts +72 -0
  35. package/packages/react/NysAccordionItem.js +41 -0
  36. package/packages/react/NysAlert.d.ts +104 -0
  37. package/packages/react/NysAlert.js +63 -0
  38. package/packages/react/NysAvatar.d.ts +78 -0
  39. package/packages/react/NysAvatar.js +40 -0
  40. package/packages/react/NysBacktotop.d.ts +54 -0
  41. package/packages/react/NysBacktotop.js +22 -0
  42. package/packages/react/NysBadge.d.ts +75 -0
  43. package/packages/react/NysBadge.js +40 -0
  44. package/packages/react/NysButton.d.ts +141 -0
  45. package/packages/react/NysButton.js +81 -0
  46. package/packages/react/NysCheckbox.d.ts +139 -0
  47. package/packages/react/NysCheckbox.js +76 -0
  48. package/packages/react/NysCheckboxgroup.d.ts +91 -0
  49. package/packages/react/NysCheckboxgroup.js +48 -0
  50. package/packages/react/NysCombobox.d.ts +126 -0
  51. package/packages/react/NysCombobox.js +66 -0
  52. package/packages/react/NysDatepicker.d.ts +122 -0
  53. package/packages/react/NysDatepicker.js +72 -0
  54. package/packages/react/NysDivider.d.ts +51 -0
  55. package/packages/react/NysDivider.js +21 -0
  56. package/packages/react/NysDropdownMenu.d.ts +54 -0
  57. package/packages/react/NysDropdownMenu.js +22 -0
  58. package/packages/react/NysDropdownMenuItem.d.ts +75 -0
  59. package/packages/react/NysDropdownMenuItem.js +47 -0
  60. package/packages/react/NysErrorMessage.d.ts +57 -0
  61. package/packages/react/NysErrorMessage.js +23 -0
  62. package/packages/react/NysFileItem.d.ts +69 -0
  63. package/packages/react/NysFileItem.js +37 -0
  64. package/packages/react/NysFileinput.d.ts +108 -0
  65. package/packages/react/NysFileinput.js +67 -0
  66. package/packages/react/NysGlobalFooter.d.ts +57 -0
  67. package/packages/react/NysGlobalFooter.js +22 -0
  68. package/packages/react/NysGlobalHeader.d.ts +60 -0
  69. package/packages/react/NysGlobalHeader.js +23 -0
  70. package/packages/react/NysIcon.d.ts +66 -0
  71. package/packages/react/NysIcon.js +27 -0
  72. package/packages/react/NysLabel.d.ts +66 -0
  73. package/packages/react/NysLabel.js +26 -0
  74. package/packages/react/NysModal.d.ts +83 -0
  75. package/packages/react/NysModal.js +41 -0
  76. package/packages/react/NysOption.d.ts +66 -0
  77. package/packages/react/NysOption.js +25 -0
  78. package/packages/react/NysPagination.d.ts +72 -0
  79. package/packages/react/NysPagination.js +45 -0
  80. package/packages/react/NysRadiobutton.d.ts +127 -0
  81. package/packages/react/NysRadiobutton.js +68 -0
  82. package/packages/react/NysRadiogroup.d.ts +91 -0
  83. package/packages/react/NysRadiogroup.js +48 -0
  84. package/packages/react/NysSelect.d.ts +116 -0
  85. package/packages/react/NysSelect.js +65 -0
  86. package/packages/react/NysSkipnav.d.ts +54 -0
  87. package/packages/react/NysSkipnav.js +22 -0
  88. package/packages/react/NysStep.d.ts +75 -0
  89. package/packages/react/NysStep.js +51 -0
  90. package/packages/react/NysStepper.d.ts +67 -0
  91. package/packages/react/NysStepper.js +26 -0
  92. package/packages/react/NysTable.d.ts +80 -0
  93. package/packages/react/NysTable.js +41 -0
  94. package/packages/react/NysTextarea.d.ts +138 -0
  95. package/packages/react/NysTextarea.js +77 -0
  96. package/packages/react/NysTextinput.d.ts +144 -0
  97. package/packages/react/NysTextinput.js +83 -0
  98. package/packages/react/NysToggle.d.ts +102 -0
  99. package/packages/react/NysToggle.js +59 -0
  100. package/packages/react/NysTooltip.d.ts +60 -0
  101. package/packages/react/NysTooltip.js +24 -0
  102. package/packages/react/NysUnavFooter.d.ts +48 -0
  103. package/packages/react/NysUnavFooter.js +18 -0
  104. package/packages/react/NysUnavHeader.d.ts +72 -0
  105. package/packages/react/NysUnavHeader.js +38 -0
  106. package/packages/react/README.md +92 -0
  107. package/packages/react/index.d.ts +37 -0
  108. package/packages/react/index.js +37 -0
  109. package/packages/react/react-utils.js +40 -0
  110. package/dist/nys-stepper/newsletter.html +0 -4
  111. package/dist/nys-stepper/personal.html +0 -6
  112. package/dist/nys-stepper/survey.html +0 -5
  113. package/dist/nys-stepper/team.html +0 -6
@@ -0,0 +1,59 @@
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
+ });
@@ -0,0 +1,60 @@
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>;
@@ -0,0 +1,24 @@
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
+ });
@@ -0,0 +1,48 @@
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
+ /** 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()`. */
22
+ className?: string;
23
+
24
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
25
+ exportparts?: string;
26
+
27
+ /** Used for labels to link them with their inputs (using input id). */
28
+ htmlFor?: string;
29
+
30
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
31
+ key?: number | string;
32
+
33
+ /** 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. */
34
+ part?: string;
35
+
36
+ /** 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. */
37
+ ref?: any;
38
+
39
+ /** 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. */
40
+ tabIndex?: number;
41
+ }
42
+
43
+ /**
44
+ * Universal NYS footer with logo and statewide links. Required site-wide.
45
+ * ---
46
+ *
47
+ */
48
+ export const NysUnavFooter: React.ForwardRefExoticComponent<NysUnavFooterProps>;
@@ -0,0 +1,18 @@
1
+ import React, { forwardRef } from "react";
2
+ import "../../dist/nysds.es.js";
3
+
4
+ export const NysUnavFooter = forwardRef((props, forwardedRef) => {
5
+ return React.createElement(
6
+ "nys-unavfooter",
7
+ {
8
+ ...props,
9
+ class: props.className,
10
+ exportparts: props.exportparts,
11
+ for: props.htmlFor,
12
+ part: props.part,
13
+ tabindex: props.tabIndex,
14
+ style: { ...props.style },
15
+ },
16
+ props.children,
17
+ );
18
+ });
@@ -0,0 +1,72 @@
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
+ /** The list of languages this site can be translated to, default to use Smartling */
43
+ languages?: NysUnavHeaderElement["languages"];
44
+
45
+ /** 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()`. */
46
+ className?: string;
47
+
48
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
49
+ exportparts?: string;
50
+
51
+ /** Used for labels to link them with their inputs (using input id). */
52
+ htmlFor?: string;
53
+
54
+ /** Used to help React identify which items have changed, are added, or are removed within a list. */
55
+ key?: number | string;
56
+
57
+ /** 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. */
58
+ part?: string;
59
+
60
+ /** 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. */
61
+ ref?: any;
62
+
63
+ /** 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. */
64
+ tabIndex?: number;
65
+ }
66
+
67
+ /**
68
+ *
69
+ * ---
70
+ *
71
+ */
72
+ export const NysUnavHeader: React.ForwardRefExoticComponent<NysUnavHeaderProps>;
@@ -0,0 +1,38 @@
1
+ import React, { forwardRef } from "react";
2
+ import "../../dist/nysds.es.js";
3
+
4
+ export const NysUnavHeader = forwardRef((props, forwardedRef) => {
5
+ const {
6
+ trustbarVisible,
7
+ searchDropdownVisible,
8
+ languageVisible,
9
+ isSearchFocused,
10
+ hideTranslate,
11
+ hideSearch,
12
+ searchUrl,
13
+ languages,
14
+ ...filteredProps
15
+ } = props;
16
+
17
+ return React.createElement(
18
+ "nys-unavheader",
19
+ {
20
+ ...filteredProps,
21
+ searchUrl: props.searchUrl,
22
+ languages: props.languages,
23
+ class: props.className,
24
+ exportparts: props.exportparts,
25
+ for: props.htmlFor,
26
+ part: props.part,
27
+ tabindex: props.tabIndex,
28
+ trustbarVisible: props.trustbarVisible ? true : undefined,
29
+ searchDropdownVisible: props.searchDropdownVisible ? true : undefined,
30
+ languageVisible: props.languageVisible ? true : undefined,
31
+ isSearchFocused: props.isSearchFocused ? true : undefined,
32
+ hideTranslate: props.hideTranslate ? true : undefined,
33
+ hideSearch: props.hideSearch ? true : undefined,
34
+ style: { ...props.style },
35
+ },
36
+ props.children,
37
+ );
38
+ });
@@ -0,0 +1,92 @@
1
+ # `@nysds/components/react` — Auto-generated React Wrappers
2
+
3
+ ⚠️ This folder is **fully auto-generated** — do not edit files inside it directly!
4
+ Files are regenerated every time `npm run cem` runs, which is called automatically by `npm run build:all`.
5
+
6
+ ---
7
+
8
+ ## How it works
9
+
10
+ ```
11
+ npm run cem
12
+ └─► cem analyze --config custom-elements-manifest.config.mjs
13
+ └─► customElementReactWrapperPlugin (custom-element-react-wrappers)
14
+ └─► packages/react/
15
+ ├── index.js <= barrel, one export per component
16
+ ├── index.d.ts <= TypeScript types
17
+ ├── react-utils.js <= auto generated internal hooks used by wrappers, do not use directly
18
+ ├── NysButton.js <= one file per component
19
+ └── ...etc.
20
+ ```
21
+
22
+ The plugin is configured in `custom-elements-manifest.config.mjs` at the repo root.
23
+ The `./react` subpath export is declared in the root `package.json`, pointing at this folder.
24
+
25
+ ---
26
+
27
+ ## Usage
28
+
29
+ ```tsx
30
+ import { NysButton, NysTextinput } from "@nysds/components/react";
31
+
32
+ function MyForm() {
33
+ return (
34
+ <>
35
+ <NysTextinput
36
+ label="First name"
37
+ onNysInput={(e) => console.log(e.detail)}
38
+ />
39
+ <NysButton
40
+ label="Submit"
41
+ variant="filled"
42
+ onNysClick={() => console.log("clicked!")}
43
+ />
44
+ </>
45
+ );
46
+ }
47
+ ```
48
+
49
+ All props are typed. Custom events map to `on<EventName>` React callbacks.
50
+
51
+ ---
52
+
53
+ ## Event name convention
54
+
55
+ | DOM event | React prop |
56
+ |------------------|------------------|
57
+ | `nys-click` | `onNysClick` |
58
+ | `nys-change` | `onNysChange` |
59
+ | `nys-input` | `onNysInput` |
60
+ | `nys-focus` | `onNysFocus` |
61
+ | `nys-blur` | `onNysBlur` |
62
+ | `nys-open` | `onNysOpen` |
63
+ | `nys-close` | `onNysClose` |
64
+ | `nys-step-click` | `onNysStepClick` |
65
+ | *(any new event)*| *(auto-added)* |
66
+
67
+ ---
68
+
69
+ ## Adding a new component
70
+
71
+ Nothing to do. Once a new Lit component is picked up by `cem analyze`, its wrapper is generated on the next `npm run cem` / `npm run build:all`.
72
+
73
+ ---
74
+
75
+ ## Why not React 19 native web component support?
76
+
77
+ React 19 improves web component interop but doesn't bridge custom events to `on*` callbacks, and provides no TypeScript prop types from the element class. These wrappers handle both and keep the same developer experience as any standard React component library.
78
+
79
+ ---
80
+
81
+ ## Repo layout
82
+
83
+ ```
84
+ custom-elements-manifest.config.mjs <= plugin configured here
85
+ package.json <= "./react" subpath export declared here
86
+ packages/
87
+ react/ <= auto-generated, do not edit
88
+ index.js
89
+ index.d.ts
90
+ react-utils.js
91
+ NysButton.js ...etc.
92
+ ```
@@ -0,0 +1,37 @@
1
+ export * from "./NysAccordion.js";
2
+ export * from "./NysAccordionItem.js";
3
+ export * from "./NysAvatar.js";
4
+ export * from "./NysAlert.js";
5
+ export * from "./NysBacktotop.js";
6
+ export * from "./NysBadge.js";
7
+ export * from "./NysButton.js";
8
+ export * from "./NysCombobox.js";
9
+ export * from "./NysCheckbox.js";
10
+ export * from "./NysCheckboxgroup.js";
11
+ export * from "./NysDatepicker.js";
12
+ export * from "./NysDivider.js";
13
+ export * from "./NysDropdownMenu.js";
14
+ export * from "./NysDropdownMenuItem.js";
15
+ export * from "./NysErrorMessage.js";
16
+ export * from "./NysFileinput.js";
17
+ export * from "./NysFileItem.js";
18
+ export * from "./NysGlobalHeader.js";
19
+ export * from "./NysIcon.js";
20
+ export * from "./NysGlobalFooter.js";
21
+ export * from "./NysModal.js";
22
+ export * from "./NysLabel.js";
23
+ export * from "./NysRadiobutton.js";
24
+ export * from "./NysRadiogroup.js";
25
+ export * from "./NysOption.js";
26
+ export * from "./NysSelect.js";
27
+ export * from "./NysPagination.js";
28
+ export * from "./NysTable.js";
29
+ export * from "./NysTextarea.js";
30
+ export * from "./NysStep.js";
31
+ export * from "./NysStepper.js";
32
+ export * from "./NysSkipnav.js";
33
+ export * from "./NysTextinput.js";
34
+ export * from "./NysTooltip.js";
35
+ export * from "./NysToggle.js";
36
+ export * from "./NysUnavFooter.js";
37
+ export * from "./NysUnavHeader.js";
@@ -0,0 +1,37 @@
1
+ export * from "./NysAccordion.js";
2
+ export * from "./NysAccordionItem.js";
3
+ export * from "./NysAvatar.js";
4
+ export * from "./NysAlert.js";
5
+ export * from "./NysBacktotop.js";
6
+ export * from "./NysBadge.js";
7
+ export * from "./NysButton.js";
8
+ export * from "./NysCombobox.js";
9
+ export * from "./NysCheckbox.js";
10
+ export * from "./NysCheckboxgroup.js";
11
+ export * from "./NysDatepicker.js";
12
+ export * from "./NysDivider.js";
13
+ export * from "./NysDropdownMenu.js";
14
+ export * from "./NysDropdownMenuItem.js";
15
+ export * from "./NysErrorMessage.js";
16
+ export * from "./NysFileinput.js";
17
+ export * from "./NysFileItem.js";
18
+ export * from "./NysGlobalHeader.js";
19
+ export * from "./NysIcon.js";
20
+ export * from "./NysGlobalFooter.js";
21
+ export * from "./NysModal.js";
22
+ export * from "./NysLabel.js";
23
+ export * from "./NysRadiobutton.js";
24
+ export * from "./NysRadiogroup.js";
25
+ export * from "./NysOption.js";
26
+ export * from "./NysSelect.js";
27
+ export * from "./NysPagination.js";
28
+ export * from "./NysTable.js";
29
+ export * from "./NysTextarea.js";
30
+ export * from "./NysStep.js";
31
+ export * from "./NysStepper.js";
32
+ export * from "./NysSkipnav.js";
33
+ export * from "./NysTextinput.js";
34
+ export * from "./NysTooltip.js";
35
+ export * from "./NysToggle.js";
36
+ export * from "./NysUnavFooter.js";
37
+ export * from "./NysUnavHeader.js";
@@ -0,0 +1,40 @@
1
+ import { useEffect, useRef } from "react";
2
+
3
+ export function useProperties(targetElement, propName, value) {
4
+ useEffect(() => {
5
+ if (
6
+ value !== undefined &&
7
+ targetElement.current &&
8
+ targetElement.current[propName] !== value
9
+ ) {
10
+ try {
11
+ targetElement.current[propName] = value;
12
+ } catch (e) {
13
+ console.warn(e);
14
+ }
15
+ }
16
+ }, [value, targetElement]);
17
+ }
18
+
19
+ export function useEventListener(targetElement, eventName, eventHandler) {
20
+ // Store the latest handler in a ref so we never need to re-subscribe
21
+ // just because the consumer passed a new function reference.
22
+ const savedHandler = useRef(eventHandler);
23
+ useEffect(() => {
24
+ savedHandler.current = eventHandler;
25
+ }, [eventHandler]);
26
+
27
+ useEffect(() => {
28
+ const element = targetElement.current;
29
+ if (!element || eventHandler === undefined) return;
30
+
31
+ // Stable wrapper — identity never changes, so add/remove are always paired.
32
+ const listener = (event) => savedHandler.current(event);
33
+
34
+ element.addEventListener(eventName, listener);
35
+
36
+ return () => {
37
+ element.removeEventListener(eventName, listener);
38
+ };
39
+ }, [eventName, targetElement]);
40
+ }
@@ -1,4 +0,0 @@
1
- <div style="padding: 2rem;">
2
- <h2>Newsletter Opt-In</h2>
3
- <p>Subscribe to our newsletter to stay updated on the latest features and offers.</p>
4
- </div>
@@ -1,6 +0,0 @@
1
- <div style="padding: 2rem;">
2
- <h2>Personal Details</h2>
3
- <p>This is the form to enter your personal information. Fill in your name, address, and contact details here.</p>
4
- <nys-textinput label="Name" required width="md"></nys-textinput>
5
- <nys-textinput label="Agency Email" required width="md"></nys-textinput>
6
- </div>
@@ -1,5 +0,0 @@
1
- <div style="padding: 2rem;">
2
- <h2>Usage Survey</h2>
3
- <p>Tell us how you plan to use this application. Your feedback helps us improve.</p>
4
- <nys-textarea label="Project Details" resize="none"></nys-textarea>
5
- </div>
@@ -1,6 +0,0 @@
1
- <div style="padding: 2rem;">
2
- <h2>Team Information</h2>
3
- <p>Provide details about your team. Who are you working with? What is your role?</p>
4
- <nys-textinput label="Agency Name" required width="md"></nys-textinput>
5
- <nys-textinput label="Team Name" required width="md"></nys-textinput>
6
- </div>