@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.
- package/custom-elements.json +2350 -598
- package/dist/.vscode/vscode.html-custom-data.json +63 -7
- package/dist/custom-elements.json +2350 -598
- package/dist/nysds.es.js +2754 -1819
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +340 -117
- package/dist/nysds.js.map +1 -1
- package/dist/packages/nys-button/src/nys-button.d.ts +8 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +10 -0
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +8 -0
- package/dist/packages/nys-combobox/src/index.d.ts +1 -0
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +118 -0
- package/dist/packages/nys-combobox/src/nys-combobox.figma.d.ts +1 -0
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +9 -0
- package/dist/packages/nys-dropdownmenu/src/index.d.ts +2 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +110 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.figma.d.ts +1 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +40 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +8 -0
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +8 -0
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +4 -2
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +10 -0
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +8 -0
- package/dist/packages/nys-select/src/nys-select.d.ts +8 -0
- package/dist/packages/nys-table/src/nys-table.d.ts +12 -1
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +8 -0
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +8 -1
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +10 -1
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +10 -1
- package/dist/src/index.d.ts +2 -0
- package/package.json +19 -10
- package/packages/react/NysAccordion.d.ts +65 -0
- package/packages/react/NysAccordion.js +23 -0
- package/packages/react/NysAccordionItem.d.ts +72 -0
- package/packages/react/NysAccordionItem.js +41 -0
- package/packages/react/NysAlert.d.ts +104 -0
- package/packages/react/NysAlert.js +63 -0
- package/packages/react/NysAvatar.d.ts +78 -0
- package/packages/react/NysAvatar.js +40 -0
- package/packages/react/NysBacktotop.d.ts +54 -0
- package/packages/react/NysBacktotop.js +22 -0
- package/packages/react/NysBadge.d.ts +75 -0
- package/packages/react/NysBadge.js +40 -0
- package/packages/react/NysButton.d.ts +141 -0
- package/packages/react/NysButton.js +81 -0
- package/packages/react/NysCheckbox.d.ts +139 -0
- package/packages/react/NysCheckbox.js +76 -0
- package/packages/react/NysCheckboxgroup.d.ts +91 -0
- package/packages/react/NysCheckboxgroup.js +48 -0
- package/packages/react/NysCombobox.d.ts +126 -0
- package/packages/react/NysCombobox.js +66 -0
- package/packages/react/NysDatepicker.d.ts +122 -0
- package/packages/react/NysDatepicker.js +72 -0
- package/packages/react/NysDivider.d.ts +51 -0
- package/packages/react/NysDivider.js +21 -0
- package/packages/react/NysDropdownMenu.d.ts +54 -0
- package/packages/react/NysDropdownMenu.js +22 -0
- package/packages/react/NysDropdownMenuItem.d.ts +75 -0
- package/packages/react/NysDropdownMenuItem.js +47 -0
- package/packages/react/NysErrorMessage.d.ts +57 -0
- package/packages/react/NysErrorMessage.js +23 -0
- package/packages/react/NysFileItem.d.ts +69 -0
- package/packages/react/NysFileItem.js +37 -0
- package/packages/react/NysFileinput.d.ts +108 -0
- package/packages/react/NysFileinput.js +67 -0
- package/packages/react/NysGlobalFooter.d.ts +57 -0
- package/packages/react/NysGlobalFooter.js +22 -0
- package/packages/react/NysGlobalHeader.d.ts +60 -0
- package/packages/react/NysGlobalHeader.js +23 -0
- package/packages/react/NysIcon.d.ts +66 -0
- package/packages/react/NysIcon.js +27 -0
- package/packages/react/NysLabel.d.ts +66 -0
- package/packages/react/NysLabel.js +26 -0
- package/packages/react/NysModal.d.ts +83 -0
- package/packages/react/NysModal.js +41 -0
- package/packages/react/NysOption.d.ts +66 -0
- package/packages/react/NysOption.js +25 -0
- package/packages/react/NysPagination.d.ts +72 -0
- package/packages/react/NysPagination.js +45 -0
- package/packages/react/NysRadiobutton.d.ts +127 -0
- package/packages/react/NysRadiobutton.js +68 -0
- package/packages/react/NysRadiogroup.d.ts +91 -0
- package/packages/react/NysRadiogroup.js +48 -0
- package/packages/react/NysSelect.d.ts +116 -0
- package/packages/react/NysSelect.js +65 -0
- package/packages/react/NysSkipnav.d.ts +54 -0
- package/packages/react/NysSkipnav.js +22 -0
- package/packages/react/NysStep.d.ts +75 -0
- package/packages/react/NysStep.js +51 -0
- package/packages/react/NysStepper.d.ts +67 -0
- package/packages/react/NysStepper.js +26 -0
- package/packages/react/NysTable.d.ts +80 -0
- package/packages/react/NysTable.js +41 -0
- package/packages/react/NysTextarea.d.ts +138 -0
- package/packages/react/NysTextarea.js +77 -0
- package/packages/react/NysTextinput.d.ts +144 -0
- package/packages/react/NysTextinput.js +83 -0
- package/packages/react/NysToggle.d.ts +102 -0
- package/packages/react/NysToggle.js +59 -0
- package/packages/react/NysTooltip.d.ts +60 -0
- package/packages/react/NysTooltip.js +24 -0
- package/packages/react/NysUnavFooter.d.ts +48 -0
- package/packages/react/NysUnavFooter.js +18 -0
- package/packages/react/NysUnavHeader.d.ts +72 -0
- package/packages/react/NysUnavHeader.js +38 -0
- package/packages/react/README.md +92 -0
- package/packages/react/index.d.ts +37 -0
- package/packages/react/index.js +37 -0
- package/packages/react/react-utils.js +40 -0
- package/dist/nys-stepper/newsletter.html +0 -4
- package/dist/nys-stepper/personal.html +0 -6
- package/dist/nys-stepper/survey.html +0 -5
- package/dist/nys-stepper/team.html +0 -6
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NysErrorMessage as NysErrorMessageElement } from "../../dist/nysds.es.js";
|
|
3
|
+
|
|
4
|
+
export type { NysErrorMessageElement };
|
|
5
|
+
|
|
6
|
+
export interface NysErrorMessageProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** Whether to display the error message. */
|
|
22
|
+
showError?: boolean;
|
|
23
|
+
|
|
24
|
+
/** Shows a divider line above the error message. */
|
|
25
|
+
showDivider?: boolean;
|
|
26
|
+
|
|
27
|
+
/** Error text to display. Falls back to native validation message if available. */
|
|
28
|
+
errorMessage?: NysErrorMessageElement["errorMessage"];
|
|
29
|
+
|
|
30
|
+
/** 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()`. */
|
|
31
|
+
className?: string;
|
|
32
|
+
|
|
33
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
34
|
+
exportparts?: string;
|
|
35
|
+
|
|
36
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
37
|
+
htmlFor?: string;
|
|
38
|
+
|
|
39
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
40
|
+
key?: number | string;
|
|
41
|
+
|
|
42
|
+
/** 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. */
|
|
43
|
+
part?: string;
|
|
44
|
+
|
|
45
|
+
/** 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. */
|
|
46
|
+
ref?: any;
|
|
47
|
+
|
|
48
|
+
/** 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. */
|
|
49
|
+
tabIndex?: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Internal error message display with icon and ARIA alert support.
|
|
54
|
+
* ---
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
export const NysErrorMessage: React.ForwardRefExoticComponent<NysErrorMessageProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "../../dist/nysds.es.js";
|
|
3
|
+
|
|
4
|
+
export const NysErrorMessage = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { showError, showDivider, errorMessage, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"nys-errormessage",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
errorMessage: props.errorMessage,
|
|
12
|
+
class: props.className,
|
|
13
|
+
exportparts: props.exportparts,
|
|
14
|
+
for: props.htmlFor,
|
|
15
|
+
part: props.part,
|
|
16
|
+
tabindex: props.tabIndex,
|
|
17
|
+
showError: props.showError ? true : undefined,
|
|
18
|
+
showDivider: props.showDivider ? true : undefined,
|
|
19
|
+
style: { ...props.style },
|
|
20
|
+
},
|
|
21
|
+
props.children,
|
|
22
|
+
);
|
|
23
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
NysFileItem as NysFileItemElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../../dist/nysds.es.js";
|
|
6
|
+
|
|
7
|
+
export type { NysFileItemElement, CustomEvent };
|
|
8
|
+
|
|
9
|
+
export interface NysFileItemProps 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
|
+
/** Name of the file being displayed. */
|
|
25
|
+
filename?: NysFileItemElement["filename"];
|
|
26
|
+
|
|
27
|
+
/** Upload status: `pending` (queued), `processing` (uploading), `done` (complete), `error` (failed). */
|
|
28
|
+
status?: NysFileItemElement["status"];
|
|
29
|
+
|
|
30
|
+
/** Upload progress percentage (0-100). Only shown when status is `processing`. */
|
|
31
|
+
progress?: NysFileItemElement["progress"];
|
|
32
|
+
|
|
33
|
+
/** Error message displayed when status is `error`. */
|
|
34
|
+
errorMessage?: NysFileItemElement["errorMessage"];
|
|
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
|
+
/** Fired when remove button is clicked. Detail: `{filename}`. */
|
|
58
|
+
onNysFileRemove?: (event: CustomEvent) => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Internal file item display with status, progress bar, and remove action.
|
|
63
|
+
* ---
|
|
64
|
+
*
|
|
65
|
+
*
|
|
66
|
+
* ### **Events:**
|
|
67
|
+
* - **nys-fileRemove** - Fired when remove button is clicked. Detail: `{filename}`.
|
|
68
|
+
*/
|
|
69
|
+
export const NysFileItem: React.ForwardRefExoticComponent<NysFileItemProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 NysFileItem = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const { filename, status, progress, errorMessage, ...filteredProps } = props;
|
|
8
|
+
|
|
9
|
+
/** Event listeners - run once */
|
|
10
|
+
useEventListener(ref, "nys-fileRemove", props.onNysFileRemove);
|
|
11
|
+
|
|
12
|
+
return React.createElement(
|
|
13
|
+
"nys-fileitem",
|
|
14
|
+
{
|
|
15
|
+
ref: (node) => {
|
|
16
|
+
ref.current = node;
|
|
17
|
+
if (typeof forwardedRef === "function") {
|
|
18
|
+
forwardedRef(node);
|
|
19
|
+
} else if (forwardedRef) {
|
|
20
|
+
forwardedRef.current = node;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
...filteredProps,
|
|
24
|
+
filename: props.filename,
|
|
25
|
+
status: props.status,
|
|
26
|
+
progress: props.progress,
|
|
27
|
+
errorMessage: props.errorMessage,
|
|
28
|
+
class: props.className,
|
|
29
|
+
exportparts: props.exportparts,
|
|
30
|
+
for: props.htmlFor,
|
|
31
|
+
part: props.part,
|
|
32
|
+
tabindex: props.tabIndex,
|
|
33
|
+
style: { ...props.style },
|
|
34
|
+
},
|
|
35
|
+
props.children,
|
|
36
|
+
);
|
|
37
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
NysFileinput as NysFileinputElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../../dist/nysds.es.js";
|
|
6
|
+
|
|
7
|
+
export type { NysFileinputElement, CustomEvent };
|
|
8
|
+
|
|
9
|
+
export interface NysFileinputProps 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
|
+
/** Allows selecting multiple files. */
|
|
25
|
+
multiple?: boolean;
|
|
26
|
+
|
|
27
|
+
/** Prevents interaction. */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
|
|
30
|
+
/** Requires at least one file to be uploaded. */
|
|
31
|
+
required?: boolean;
|
|
32
|
+
|
|
33
|
+
/** Shows "Optional" flag. */
|
|
34
|
+
optional?: boolean;
|
|
35
|
+
|
|
36
|
+
/** Shows error message when true. */
|
|
37
|
+
showError?: boolean;
|
|
38
|
+
|
|
39
|
+
/** Enables drag-and-drop zone UI. */
|
|
40
|
+
dropzone?: boolean;
|
|
41
|
+
|
|
42
|
+
/** Adjusts colors for dark backgrounds. */
|
|
43
|
+
inverted?: boolean;
|
|
44
|
+
|
|
45
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
46
|
+
id?: NysFileinputElement["id"];
|
|
47
|
+
|
|
48
|
+
/** Name for form submission. */
|
|
49
|
+
name?: NysFileinputElement["name"];
|
|
50
|
+
|
|
51
|
+
/** Visible label text. */
|
|
52
|
+
label?: NysFileinputElement["label"];
|
|
53
|
+
|
|
54
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
55
|
+
description?: NysFileinputElement["description"];
|
|
56
|
+
|
|
57
|
+
/** Form `id` to associate with. */
|
|
58
|
+
form?: NysFileinputElement["form"];
|
|
59
|
+
|
|
60
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
61
|
+
tooltip?: NysFileinputElement["tooltip"];
|
|
62
|
+
|
|
63
|
+
/** Accepted file types. Use MIME types (`image/*`) or extensions (`.pdf`). Validated via magic bytes. */
|
|
64
|
+
accept?: NysFileinputElement["accept"];
|
|
65
|
+
|
|
66
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
67
|
+
errorMessage?: NysFileinputElement["errorMessage"];
|
|
68
|
+
|
|
69
|
+
/** Component width: `lg` (384px) or `full` (100%, default). */
|
|
70
|
+
width?: NysFileinputElement["width"];
|
|
71
|
+
|
|
72
|
+
/** 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()`. */
|
|
73
|
+
className?: string;
|
|
74
|
+
|
|
75
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
76
|
+
exportparts?: string;
|
|
77
|
+
|
|
78
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
79
|
+
htmlFor?: string;
|
|
80
|
+
|
|
81
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
82
|
+
key?: number | string;
|
|
83
|
+
|
|
84
|
+
/** 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. */
|
|
85
|
+
part?: string;
|
|
86
|
+
|
|
87
|
+
/** 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. */
|
|
88
|
+
ref?: any;
|
|
89
|
+
|
|
90
|
+
/** 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. */
|
|
91
|
+
tabIndex?: number;
|
|
92
|
+
|
|
93
|
+
/** Fired when files are added or removed. Detail: `{id, files}`. */
|
|
94
|
+
onNysChange?: (event: CustomEvent) => void;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* File input with drag-and-drop, validation, and progress tracking.
|
|
99
|
+
* ---
|
|
100
|
+
*
|
|
101
|
+
*
|
|
102
|
+
* ### **Events:**
|
|
103
|
+
* - **nys-change** - Fired when files are added or removed. Detail: `{id, files}`.
|
|
104
|
+
*
|
|
105
|
+
* ### **Slots:**
|
|
106
|
+
* - **description** - Custom HTML description content.
|
|
107
|
+
*/
|
|
108
|
+
export const NysFileinput: React.ForwardRefExoticComponent<NysFileinputProps>;
|
|
@@ -0,0 +1,67 @@
|
|
|
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 NysFileinput = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
multiple,
|
|
9
|
+
disabled,
|
|
10
|
+
required,
|
|
11
|
+
optional,
|
|
12
|
+
showError,
|
|
13
|
+
dropzone,
|
|
14
|
+
inverted,
|
|
15
|
+
id,
|
|
16
|
+
name,
|
|
17
|
+
label,
|
|
18
|
+
description,
|
|
19
|
+
form,
|
|
20
|
+
tooltip,
|
|
21
|
+
accept,
|
|
22
|
+
errorMessage,
|
|
23
|
+
width,
|
|
24
|
+
...filteredProps
|
|
25
|
+
} = props;
|
|
26
|
+
|
|
27
|
+
/** Event listeners - run once */
|
|
28
|
+
useEventListener(ref, "nys-change", props.onNysChange);
|
|
29
|
+
|
|
30
|
+
return React.createElement(
|
|
31
|
+
"nys-fileinput",
|
|
32
|
+
{
|
|
33
|
+
ref: (node) => {
|
|
34
|
+
ref.current = node;
|
|
35
|
+
if (typeof forwardedRef === "function") {
|
|
36
|
+
forwardedRef(node);
|
|
37
|
+
} else if (forwardedRef) {
|
|
38
|
+
forwardedRef.current = node;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
...filteredProps,
|
|
42
|
+
id: props.id,
|
|
43
|
+
name: props.name,
|
|
44
|
+
label: props.label,
|
|
45
|
+
description: props.description,
|
|
46
|
+
form: props.form,
|
|
47
|
+
tooltip: props.tooltip,
|
|
48
|
+
accept: props.accept,
|
|
49
|
+
errorMessage: props.errorMessage,
|
|
50
|
+
width: props.width,
|
|
51
|
+
class: props.className,
|
|
52
|
+
exportparts: props.exportparts,
|
|
53
|
+
for: props.htmlFor,
|
|
54
|
+
part: props.part,
|
|
55
|
+
tabindex: props.tabIndex,
|
|
56
|
+
multiple: props.multiple ? true : undefined,
|
|
57
|
+
disabled: props.disabled ? true : undefined,
|
|
58
|
+
required: props.required ? true : undefined,
|
|
59
|
+
optional: props.optional ? true : undefined,
|
|
60
|
+
showError: props.showError ? true : undefined,
|
|
61
|
+
dropzone: props.dropzone ? true : undefined,
|
|
62
|
+
inverted: props.inverted ? true : undefined,
|
|
63
|
+
style: { ...props.style },
|
|
64
|
+
},
|
|
65
|
+
props.children,
|
|
66
|
+
);
|
|
67
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NysGlobalFooter as NysGlobalFooterElement } from "../../dist/nysds.es.js";
|
|
3
|
+
|
|
4
|
+
export type { NysGlobalFooterElement };
|
|
5
|
+
|
|
6
|
+
export interface NysGlobalFooterProps 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
|
+
/** Agency name displayed as the footer heading. */
|
|
22
|
+
agencyName?: NysGlobalFooterElement["agencyName"];
|
|
23
|
+
|
|
24
|
+
/** URL for the agency name link. If empty, name is not clickable. */
|
|
25
|
+
homepageLink?: NysGlobalFooterElement["homepageLink"];
|
|
26
|
+
|
|
27
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
28
|
+
className?: string;
|
|
29
|
+
|
|
30
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
31
|
+
exportparts?: string;
|
|
32
|
+
|
|
33
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
34
|
+
htmlFor?: string;
|
|
35
|
+
|
|
36
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
37
|
+
key?: number | string;
|
|
38
|
+
|
|
39
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
40
|
+
part?: string;
|
|
41
|
+
|
|
42
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
43
|
+
ref?: any;
|
|
44
|
+
|
|
45
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
46
|
+
tabIndex?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Agency footer with auto-layout for contact info and link sections.
|
|
51
|
+
* ---
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* ### **Slots:**
|
|
55
|
+
* - _default_ - Footer content (links, contact info). Use `<h4>` for column headings.
|
|
56
|
+
*/
|
|
57
|
+
export const NysGlobalFooter: React.ForwardRefExoticComponent<NysGlobalFooterProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "../../dist/nysds.es.js";
|
|
3
|
+
|
|
4
|
+
export const NysGlobalFooter = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { agencyName, homepageLink, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"nys-globalfooter",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
agencyName: props.agencyName,
|
|
12
|
+
homepageLink: props.homepageLink,
|
|
13
|
+
class: props.className,
|
|
14
|
+
exportparts: props.exportparts,
|
|
15
|
+
for: props.htmlFor,
|
|
16
|
+
part: props.part,
|
|
17
|
+
tabindex: props.tabIndex,
|
|
18
|
+
style: { ...props.style },
|
|
19
|
+
},
|
|
20
|
+
props.children,
|
|
21
|
+
);
|
|
22
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NysGlobalHeader as NysGlobalHeaderElement } from "../../dist/nysds.es.js";
|
|
3
|
+
|
|
4
|
+
export type { NysGlobalHeaderElement };
|
|
5
|
+
|
|
6
|
+
export interface NysGlobalHeaderProps 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
|
+
/** Application name displayed prominently. */
|
|
22
|
+
appName?: NysGlobalHeaderElement["appName"];
|
|
23
|
+
|
|
24
|
+
/** Agency name displayed below app name (or as main title if no appName). */
|
|
25
|
+
agencyName?: NysGlobalHeaderElement["agencyName"];
|
|
26
|
+
|
|
27
|
+
/** URL for the header title link. If empty, title is not clickable. */
|
|
28
|
+
homepageLink?: NysGlobalHeaderElement["homepageLink"];
|
|
29
|
+
|
|
30
|
+
/** 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()`. */
|
|
31
|
+
className?: string;
|
|
32
|
+
|
|
33
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
34
|
+
exportparts?: string;
|
|
35
|
+
|
|
36
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
37
|
+
htmlFor?: string;
|
|
38
|
+
|
|
39
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
40
|
+
key?: number | string;
|
|
41
|
+
|
|
42
|
+
/** 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. */
|
|
43
|
+
part?: string;
|
|
44
|
+
|
|
45
|
+
/** 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. */
|
|
46
|
+
ref?: any;
|
|
47
|
+
|
|
48
|
+
/** 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. */
|
|
49
|
+
tabIndex?: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Agency header with navigation, mobile menu, and active link highlighting.
|
|
54
|
+
* ---
|
|
55
|
+
*
|
|
56
|
+
*
|
|
57
|
+
* ### **Slots:**
|
|
58
|
+
* - _default_ - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
|
|
59
|
+
*/
|
|
60
|
+
export const NysGlobalHeader: React.ForwardRefExoticComponent<NysGlobalHeaderProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "../../dist/nysds.es.js";
|
|
3
|
+
|
|
4
|
+
export const NysGlobalHeader = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { appName, agencyName, homepageLink, ...filteredProps } = props;
|
|
6
|
+
|
|
7
|
+
return React.createElement(
|
|
8
|
+
"nys-globalheader",
|
|
9
|
+
{
|
|
10
|
+
...filteredProps,
|
|
11
|
+
appName: props.appName,
|
|
12
|
+
agencyName: props.agencyName,
|
|
13
|
+
homepageLink: props.homepageLink,
|
|
14
|
+
class: props.className,
|
|
15
|
+
exportparts: props.exportparts,
|
|
16
|
+
for: props.htmlFor,
|
|
17
|
+
part: props.part,
|
|
18
|
+
tabindex: props.tabIndex,
|
|
19
|
+
style: { ...props.style },
|
|
20
|
+
},
|
|
21
|
+
props.children,
|
|
22
|
+
);
|
|
23
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NysIcon as NysIconElement } from "../../dist/nysds.es.js";
|
|
3
|
+
|
|
4
|
+
export type { NysIconElement };
|
|
5
|
+
|
|
6
|
+
export interface NysIconProps 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
|
+
/** Icon name from Material Symbols library. Required. */
|
|
22
|
+
name?: NysIconElement["name"];
|
|
23
|
+
|
|
24
|
+
/** Accessible label. When set, removes `aria-hidden` and adds `aria-label` to the SVG. */
|
|
25
|
+
ariaLabel?: NysIconElement["ariaLabel"];
|
|
26
|
+
|
|
27
|
+
/** Rotation in degrees. Applied via CSS `rotate`. */
|
|
28
|
+
rotate?: NysIconElement["rotate"];
|
|
29
|
+
|
|
30
|
+
/** Flip direction: `horizontal`, `vertical`, or empty for none. */
|
|
31
|
+
flip?: NysIconElement["flip"];
|
|
32
|
+
|
|
33
|
+
/** Icon color. Accepts any CSS color value. Defaults to `currentcolor`. */
|
|
34
|
+
color?: NysIconElement["color"];
|
|
35
|
+
|
|
36
|
+
/** Icon size. Semantic sizes: `xs`-`5xl`. Pixel sizes: `12`-`50`. */
|
|
37
|
+
size?: NysIconElement["size"];
|
|
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
|
+
|
|
61
|
+
/**
|
|
62
|
+
* SVG icon from Material Symbols library with size, rotation, and color options.
|
|
63
|
+
* ---
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
export const NysIcon: React.ForwardRefExoticComponent<NysIconProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import "../../dist/nysds.es.js";
|
|
3
|
+
|
|
4
|
+
export const NysIcon = forwardRef((props, forwardedRef) => {
|
|
5
|
+
const { name, ariaLabel, rotate, flip, color, size, ...filteredProps } =
|
|
6
|
+
props;
|
|
7
|
+
|
|
8
|
+
return React.createElement(
|
|
9
|
+
"nys-icon",
|
|
10
|
+
{
|
|
11
|
+
...filteredProps,
|
|
12
|
+
name: props.name,
|
|
13
|
+
ariaLabel: props.ariaLabel,
|
|
14
|
+
rotate: props.rotate,
|
|
15
|
+
flip: props.flip,
|
|
16
|
+
color: props.color,
|
|
17
|
+
size: props.size,
|
|
18
|
+
class: props.className,
|
|
19
|
+
exportparts: props.exportparts,
|
|
20
|
+
for: props.htmlFor,
|
|
21
|
+
part: props.part,
|
|
22
|
+
tabindex: props.tabIndex,
|
|
23
|
+
style: { ...props.style },
|
|
24
|
+
},
|
|
25
|
+
props.children,
|
|
26
|
+
);
|
|
27
|
+
});
|