@nysds/components 1.21.1 → 1.22.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 +1562 -1029
- package/dist/.vscode/vscode.css-custom-data.json +75 -0
- package/dist/.vscode/vscode.html-custom-data.json +129 -60
- package/dist/custom-elements.json +1562 -1029
- package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js → nys-icon.library-715cAMBp-BmiCym2_.js} +3 -3
- package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js.map → nys-icon.library-715cAMBp-BmiCym2_.js.map} +1 -1
- package/dist/{nys-icon.library-C02yNW9R.js → nys-icon.library-C0_LOBWi.js} +2 -2
- package/dist/{nys-icon.library-C02yNW9R.js.map → nys-icon.library-C0_LOBWi.js.map} +1 -1
- package/dist/nysds.es.js +5074 -3645
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +252 -248
- package/dist/nysds.js.map +1 -1
- package/dist/packages/codegen/src/index.d.ts +16 -0
- package/dist/packages/codegen/src/manifest/components.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/filters.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/form-control.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/load.d.ts +10 -0
- package/dist/packages/codegen/src/manifest/naming.d.ts +6 -0
- package/dist/packages/codegen/src/manifest/packages.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/types.d.ts +6 -0
- package/dist/packages/codegen/src/transform/index.d.ts +19 -0
- package/dist/packages/codegen/src/transform/parse.d.ts +18 -0
- package/dist/packages/codegen/src/transform/shared.d.ts +61 -0
- package/dist/packages/codegen/src/transform/to-angular.d.ts +6 -0
- package/dist/packages/codegen/src/transform/to-jsx.d.ts +6 -0
- package/dist/packages/internals/src/form-control-mixin.d.ts +16 -0
- package/dist/packages/internals/src/form-events.d.ts +22 -0
- package/dist/packages/internals/src/index.d.ts +2 -1
- package/dist/packages/internals/src/types.d.ts +6 -0
- package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +12 -0
- package/dist/packages/mcp-server/src/lib/framework-snippets.d.ts +35 -0
- package/dist/packages/mcp-server/src/lib/framework-usage.d.ts +19 -0
- package/dist/packages/mcp-server/src/lib/frameworks-data.d.ts +18 -0
- package/dist/packages/mcp-server/src/resources/frameworks.d.ts +14 -0
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +12 -0
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +9 -1
- package/dist/packages/nys-alert/src/nys-alert.d.ts +39 -1
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +16 -0
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +12 -0
- package/dist/packages/nys-badge/src/nys-badge.d.ts +18 -0
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +22 -1
- package/dist/packages/nys-button/src/nys-button.d.ts +35 -4
- package/dist/packages/nys-card/src/nys-card.d.ts +20 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +77 -7
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +46 -0
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +51 -6
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +44 -2
- package/dist/packages/nys-divider/src/nys-divider.d.ts +9 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +43 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +21 -1
- package/dist/packages/nys-fileinput/src/index.d.ts +1 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +42 -6
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +9 -1
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +17 -0
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +18 -0
- package/dist/packages/nys-icon/src/nys-icon.d.ts +18 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +16 -0
- package/dist/packages/nys-label/src/nys-label.d.ts +3 -1
- package/dist/packages/nys-modal/src/nys-modal.d.ts +26 -2
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +21 -2
- package/dist/packages/nys-processlist/src/nys-processlist.d.ts +16 -0
- package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +1 -1
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +29 -5
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +66 -4
- package/dist/packages/nys-select/src/nys-select.d.ts +22 -4
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +8 -0
- package/dist/packages/nys-stepper/src/nys-step.d.ts +8 -1
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +8 -0
- package/dist/packages/nys-tab/src/nys-tab.d.ts +22 -3
- package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +12 -0
- package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +2 -0
- package/dist/packages/nys-table/src/nys-table.d.ts +39 -2
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +47 -4
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +42 -4
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +37 -3
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +13 -0
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +13 -0
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +26 -4
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +14 -0
- package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +11 -0
- package/dist/packages/nys-video/src/nys-video.d.ts +14 -1
- package/package.json +31 -26
- package/packages/react/.turbo/turbo-build.log +0 -59
- package/packages/react/NysAccordion.d.ts +0 -75
- package/packages/react/NysAccordion.js +0 -24
- package/packages/react/NysAccordionItem.d.ts +0 -82
- package/packages/react/NysAccordionItem.js +0 -43
- package/packages/react/NysAlert.d.ts +0 -102
- package/packages/react/NysAlert.js +0 -61
- package/packages/react/NysAvatar.d.ts +0 -88
- package/packages/react/NysAvatar.js +0 -40
- package/packages/react/NysBacktotop.d.ts +0 -57
- package/packages/react/NysBacktotop.js +0 -23
- package/packages/react/NysBadge.d.ts +0 -78
- package/packages/react/NysBadge.js +0 -42
- package/packages/react/NysBreadcrumbItem.d.ts +0 -72
- package/packages/react/NysBreadcrumbItem.js +0 -42
- package/packages/react/NysBreadcrumbs.d.ts +0 -89
- package/packages/react/NysBreadcrumbs.js +0 -50
- package/packages/react/NysButton.d.ts +0 -171
- package/packages/react/NysButton.js +0 -83
- package/packages/react/NysCard.d.ts +0 -121
- package/packages/react/NysCard.js +0 -63
- package/packages/react/NysCheckbox.d.ts +0 -145
- package/packages/react/NysCheckbox.js +0 -78
- package/packages/react/NysCheckboxgroup.d.ts +0 -88
- package/packages/react/NysCheckboxgroup.js +0 -46
- package/packages/react/NysCombobox.d.ts +0 -126
- package/packages/react/NysCombobox.js +0 -66
- package/packages/react/NysDatepicker.d.ts +0 -128
- package/packages/react/NysDatepicker.js +0 -76
- package/packages/react/NysDivider.d.ts +0 -54
- package/packages/react/NysDivider.js +0 -22
- package/packages/react/NysDropdownMenu.d.ts +0 -59
- package/packages/react/NysDropdownMenu.js +0 -23
- package/packages/react/NysDropdownMenuItem.d.ts +0 -75
- package/packages/react/NysDropdownMenuItem.js +0 -47
- package/packages/react/NysErrorMessage.d.ts +0 -60
- package/packages/react/NysErrorMessage.js +0 -24
- package/packages/react/NysFileItem.d.ts +0 -69
- package/packages/react/NysFileItem.js +0 -37
- package/packages/react/NysFileinput.d.ts +0 -130
- package/packages/react/NysFileinput.js +0 -74
- package/packages/react/NysGlobalFooter.d.ts +0 -77
- package/packages/react/NysGlobalFooter.js +0 -32
- package/packages/react/NysGlobalHeader.d.ts +0 -82
- package/packages/react/NysGlobalHeader.js +0 -32
- package/packages/react/NysIcon.d.ts +0 -75
- package/packages/react/NysIcon.js +0 -50
- package/packages/react/NysIconlist.d.ts +0 -57
- package/packages/react/NysIconlist.js +0 -23
- package/packages/react/NysIconlistitem.d.ts +0 -63
- package/packages/react/NysIconlistitem.js +0 -23
- package/packages/react/NysLabel.d.ts +0 -81
- package/packages/react/NysLabel.js +0 -40
- package/packages/react/NysModal.d.ts +0 -90
- package/packages/react/NysModal.js +0 -50
- package/packages/react/NysOption.d.ts +0 -66
- package/packages/react/NysOption.js +0 -25
- package/packages/react/NysPagination.d.ts +0 -72
- package/packages/react/NysPagination.js +0 -45
- package/packages/react/NysProcesslist.d.ts +0 -65
- package/packages/react/NysProcesslist.js +0 -25
- package/packages/react/NysProcesslistitem.d.ts +0 -61
- package/packages/react/NysProcesslistitem.js +0 -35
- package/packages/react/NysRadiobutton.d.ts +0 -132
- package/packages/react/NysRadiobutton.js +0 -72
- package/packages/react/NysRadiogroup.d.ts +0 -104
- package/packages/react/NysRadiogroup.js +0 -62
- package/packages/react/NysSelect.d.ts +0 -119
- package/packages/react/NysSelect.js +0 -67
- package/packages/react/NysSkipnav.d.ts +0 -54
- package/packages/react/NysSkipnav.js +0 -22
- package/packages/react/NysStep.d.ts +0 -73
- package/packages/react/NysStep.js +0 -40
- package/packages/react/NysStepper.d.ts +0 -67
- package/packages/react/NysStepper.js +0 -26
- package/packages/react/NysTab.d.ts +0 -90
- package/packages/react/NysTab.js +0 -39
- package/packages/react/NysTabgroup.d.ts +0 -76
- package/packages/react/NysTabgroup.js +0 -22
- package/packages/react/NysTable.d.ts +0 -80
- package/packages/react/NysTable.js +0 -41
- package/packages/react/NysTabpanel.d.ts +0 -70
- package/packages/react/NysTabpanel.js +0 -21
- package/packages/react/NysTextarea.d.ts +0 -141
- package/packages/react/NysTextarea.js +0 -79
- package/packages/react/NysTextinput.d.ts +0 -144
- package/packages/react/NysTextinput.js +0 -83
- package/packages/react/NysToggle.d.ts +0 -102
- package/packages/react/NysToggle.js +0 -59
- package/packages/react/NysTooltip.d.ts +0 -60
- package/packages/react/NysTooltip.js +0 -24
- package/packages/react/NysUnavFooter.d.ts +0 -61
- package/packages/react/NysUnavFooter.js +0 -21
- package/packages/react/NysUnavHeader.d.ts +0 -95
- package/packages/react/NysUnavHeader.js +0 -54
- package/packages/react/NysVerticalnav.d.ts +0 -67
- package/packages/react/NysVerticalnav.js +0 -26
- package/packages/react/NysVerticalnavGroup.d.ts +0 -76
- package/packages/react/NysVerticalnavGroup.js +0 -43
- package/packages/react/NysVideo.d.ts +0 -83
- package/packages/react/NysVideo.js +0 -53
- package/packages/react/README.md +0 -92
- package/packages/react/index.d.ts +0 -49
- package/packages/react/index.js +0 -49
- package/packages/react/nysds-jsx.d.ts +0 -2009
- package/packages/react/react-utils.js +0 -40
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
NysDropdownMenuItem as NysDropdownMenuItemElement,
|
|
4
|
-
CustomEvent,
|
|
5
|
-
} from "../../dist/nysds.es.js";
|
|
6
|
-
|
|
7
|
-
export type { NysDropdownMenuItemElement, CustomEvent };
|
|
8
|
-
|
|
9
|
-
export interface NysDropdownMenuItemProps extends Pick<
|
|
10
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
11
|
-
| "children"
|
|
12
|
-
| "dir"
|
|
13
|
-
| "hidden"
|
|
14
|
-
| "id"
|
|
15
|
-
| "lang"
|
|
16
|
-
| "slot"
|
|
17
|
-
| "style"
|
|
18
|
-
| "title"
|
|
19
|
-
| "translate"
|
|
20
|
-
| "onClick"
|
|
21
|
-
| "onFocus"
|
|
22
|
-
| "onBlur"
|
|
23
|
-
> {
|
|
24
|
-
/** undefined */
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
|
|
27
|
-
/** undefined */
|
|
28
|
-
label?: NysDropdownMenuItemElement["label"];
|
|
29
|
-
|
|
30
|
-
/** undefined */
|
|
31
|
-
href?: NysDropdownMenuItemElement["href"];
|
|
32
|
-
|
|
33
|
-
/** undefined */
|
|
34
|
-
target?: NysDropdownMenuItemElement["target"];
|
|
35
|
-
|
|
36
|
-
/** undefined */
|
|
37
|
-
prefixIcon?: NysDropdownMenuItemElement["prefixIcon"];
|
|
38
|
-
|
|
39
|
-
/** undefined */
|
|
40
|
-
divider?: NysDropdownMenuItemElement["divider"];
|
|
41
|
-
|
|
42
|
-
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
43
|
-
className?: string;
|
|
44
|
-
|
|
45
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
46
|
-
exportparts?: string;
|
|
47
|
-
|
|
48
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
49
|
-
htmlFor?: string;
|
|
50
|
-
|
|
51
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
52
|
-
key?: number | string;
|
|
53
|
-
|
|
54
|
-
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
55
|
-
part?: string;
|
|
56
|
-
|
|
57
|
-
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
58
|
-
ref?: any;
|
|
59
|
-
|
|
60
|
-
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
61
|
-
tabIndex?: number;
|
|
62
|
-
|
|
63
|
-
/** undefined */
|
|
64
|
-
onNysClick?: (event: CustomEvent) => void;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Dropdown item to display label and provide href link.
|
|
69
|
-
* ---
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* ### **Events:**
|
|
73
|
-
* - **nys-click**
|
|
74
|
-
*/
|
|
75
|
-
export const NysDropdownMenuItem: React.ForwardRefExoticComponent<NysDropdownMenuItemProps>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
import { useEventListener } from "./react-utils.js";
|
|
4
|
-
|
|
5
|
-
export const NysDropdownMenuItem = forwardRef((props, forwardedRef) => {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const {
|
|
8
|
-
disabled,
|
|
9
|
-
label,
|
|
10
|
-
href,
|
|
11
|
-
target,
|
|
12
|
-
prefixIcon,
|
|
13
|
-
divider,
|
|
14
|
-
...filteredProps
|
|
15
|
-
} = props;
|
|
16
|
-
|
|
17
|
-
/** Event listeners - run once */
|
|
18
|
-
useEventListener(ref, "nys-click", props.onNysClick);
|
|
19
|
-
|
|
20
|
-
return React.createElement(
|
|
21
|
-
"nys-dropdownmenuitem",
|
|
22
|
-
{
|
|
23
|
-
ref: (node) => {
|
|
24
|
-
ref.current = node;
|
|
25
|
-
if (typeof forwardedRef === "function") {
|
|
26
|
-
forwardedRef(node);
|
|
27
|
-
} else if (forwardedRef) {
|
|
28
|
-
forwardedRef.current = node;
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
...filteredProps,
|
|
32
|
-
label: props.label,
|
|
33
|
-
href: props.href,
|
|
34
|
-
target: props.target,
|
|
35
|
-
prefixIcon: props.prefixIcon,
|
|
36
|
-
divider: props.divider,
|
|
37
|
-
class: props.className,
|
|
38
|
-
exportparts: props.exportparts,
|
|
39
|
-
for: props.htmlFor,
|
|
40
|
-
part: props.part,
|
|
41
|
-
tabindex: props.tabIndex,
|
|
42
|
-
disabled: props.disabled ? true : undefined,
|
|
43
|
-
style: { ...props.style },
|
|
44
|
-
},
|
|
45
|
-
props.children,
|
|
46
|
-
);
|
|
47
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysErrorMessage as NysErrorMessageElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysErrorMessageElement };
|
|
5
|
-
|
|
6
|
-
export interface NysErrorMessageProps extends Pick<
|
|
7
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
-
| "children"
|
|
9
|
-
| "dir"
|
|
10
|
-
| "hidden"
|
|
11
|
-
| "id"
|
|
12
|
-
| "lang"
|
|
13
|
-
| "slot"
|
|
14
|
-
| "style"
|
|
15
|
-
| "title"
|
|
16
|
-
| "translate"
|
|
17
|
-
| "onClick"
|
|
18
|
-
| "onFocus"
|
|
19
|
-
| "onBlur"
|
|
20
|
-
> {
|
|
21
|
-
/** Whether to display the error message. */
|
|
22
|
-
showError?: boolean;
|
|
23
|
-
|
|
24
|
-
/** Shows a divider line above the error message. */
|
|
25
|
-
showDivider?: boolean;
|
|
26
|
-
|
|
27
|
-
/** The "id" of the error message. */
|
|
28
|
-
id?: NysErrorMessageElement["id"];
|
|
29
|
-
|
|
30
|
-
/** Error text to display. Falls back to native validation message if available. */
|
|
31
|
-
errorMessage?: NysErrorMessageElement["errorMessage"];
|
|
32
|
-
|
|
33
|
-
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
34
|
-
className?: string;
|
|
35
|
-
|
|
36
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
37
|
-
exportparts?: string;
|
|
38
|
-
|
|
39
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
40
|
-
htmlFor?: string;
|
|
41
|
-
|
|
42
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
43
|
-
key?: number | string;
|
|
44
|
-
|
|
45
|
-
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
46
|
-
part?: string;
|
|
47
|
-
|
|
48
|
-
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
49
|
-
ref?: any;
|
|
50
|
-
|
|
51
|
-
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
52
|
-
tabIndex?: number;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Internal error message display with icon and ARIA alert support.
|
|
57
|
-
* ---
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
export const NysErrorMessage: React.ForwardRefExoticComponent<NysErrorMessageProps>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export const NysErrorMessage = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const { showError, showDivider, id, errorMessage, ...filteredProps } = props;
|
|
6
|
-
|
|
7
|
-
return React.createElement(
|
|
8
|
-
"nys-errormessage",
|
|
9
|
-
{
|
|
10
|
-
...filteredProps,
|
|
11
|
-
id: props.id,
|
|
12
|
-
errorMessage: props.errorMessage,
|
|
13
|
-
class: props.className,
|
|
14
|
-
exportparts: props.exportparts,
|
|
15
|
-
for: props.htmlFor,
|
|
16
|
-
part: props.part,
|
|
17
|
-
tabindex: props.tabIndex,
|
|
18
|
-
showError: props.showError ? true : undefined,
|
|
19
|
-
showDivider: props.showDivider ? true : undefined,
|
|
20
|
-
style: { ...props.style },
|
|
21
|
-
},
|
|
22
|
-
props.children,
|
|
23
|
-
);
|
|
24
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
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>;
|
|
@@ -1,37 +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 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
|
-
});
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
NysFileinput as NysFileinputElement,
|
|
4
|
-
Event,
|
|
5
|
-
CustomEvent,
|
|
6
|
-
} from "../../dist/nysds.es.js";
|
|
7
|
-
|
|
8
|
-
export type { NysFileinputElement, Event, CustomEvent };
|
|
9
|
-
|
|
10
|
-
export interface NysFileinputProps extends Pick<
|
|
11
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
12
|
-
| "children"
|
|
13
|
-
| "dir"
|
|
14
|
-
| "hidden"
|
|
15
|
-
| "id"
|
|
16
|
-
| "lang"
|
|
17
|
-
| "slot"
|
|
18
|
-
| "style"
|
|
19
|
-
| "title"
|
|
20
|
-
| "translate"
|
|
21
|
-
| "onClick"
|
|
22
|
-
| "onFocus"
|
|
23
|
-
| "onBlur"
|
|
24
|
-
> {
|
|
25
|
-
/** Allows selecting multiple files. */
|
|
26
|
-
multiple?: boolean;
|
|
27
|
-
|
|
28
|
-
/** Prevents interaction. */
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
|
|
31
|
-
/** Requires at least one file to be uploaded. */
|
|
32
|
-
required?: boolean;
|
|
33
|
-
|
|
34
|
-
/** Shows "Optional" flag. */
|
|
35
|
-
optional?: boolean;
|
|
36
|
-
|
|
37
|
-
/** Shows error message when true. */
|
|
38
|
-
showError?: boolean;
|
|
39
|
-
|
|
40
|
-
/** Enables drag-and-drop zone UI. */
|
|
41
|
-
dropzone?: boolean;
|
|
42
|
-
|
|
43
|
-
/** Adjusts colors for dark backgrounds. */
|
|
44
|
-
inverted?: boolean;
|
|
45
|
-
|
|
46
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
47
|
-
id?: NysFileinputElement["id"];
|
|
48
|
-
|
|
49
|
-
/** Name for form submission. */
|
|
50
|
-
name?: NysFileinputElement["name"];
|
|
51
|
-
|
|
52
|
-
/** Visible label text. */
|
|
53
|
-
label?: NysFileinputElement["label"];
|
|
54
|
-
|
|
55
|
-
/** Helper text below label. Use slot for custom HTML. */
|
|
56
|
-
description?: NysFileinputElement["description"];
|
|
57
|
-
|
|
58
|
-
/** Form `id` to associate with. */
|
|
59
|
-
form?: NysFileinputElement["form"];
|
|
60
|
-
|
|
61
|
-
/** Tooltip text shown on hover/focus of info icon. */
|
|
62
|
-
tooltip?: NysFileinputElement["tooltip"];
|
|
63
|
-
|
|
64
|
-
/** Accepted file types. Use MIME types (`image/*`) or extensions (`.pdf`). Validated via magic bytes. */
|
|
65
|
-
accept?: NysFileinputElement["accept"];
|
|
66
|
-
|
|
67
|
-
/** Error message text. Shown only when `showError` is true. */
|
|
68
|
-
errorMessage?: NysFileinputElement["errorMessage"];
|
|
69
|
-
|
|
70
|
-
/** Component width: `lg` (384px) or `full` (100%, default). */
|
|
71
|
-
width?: NysFileinputElement["width"];
|
|
72
|
-
|
|
73
|
-
/** 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()`. */
|
|
74
|
-
className?: string;
|
|
75
|
-
|
|
76
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
77
|
-
exportparts?: string;
|
|
78
|
-
|
|
79
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
80
|
-
htmlFor?: string;
|
|
81
|
-
|
|
82
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
83
|
-
key?: number | string;
|
|
84
|
-
|
|
85
|
-
/** 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. */
|
|
86
|
-
part?: string;
|
|
87
|
-
|
|
88
|
-
/** 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. */
|
|
89
|
-
ref?: any;
|
|
90
|
-
|
|
91
|
-
/** 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. */
|
|
92
|
-
tabIndex?: number;
|
|
93
|
-
|
|
94
|
-
/** The currently selected files. Read to get the current selection; set to
|
|
95
|
-
replace it (e.g. rehydrating state after navigation, or binding from a
|
|
96
|
-
framework form model). Property-only — a `File[]` cannot round-trip through
|
|
97
|
-
an HTML attribute. Setting this is silent (does not emit `nys-change`),
|
|
98
|
-
matching native input behavior and avoiding feedback loops in two-way bindings. */
|
|
99
|
-
files?: NysFileinputElement["files"];
|
|
100
|
-
|
|
101
|
-
/** Single-file convenience accessor (parity with `nys-textinput`'s `value`).
|
|
102
|
-
Reads the first selected file (or `null`); setting replaces the selection. */
|
|
103
|
-
value?: NysFileinputElement["value"];
|
|
104
|
-
|
|
105
|
-
/** Fired when focus leaves the component. Triggers validation. */
|
|
106
|
-
onNysBlur?: (event: CustomEvent) => void;
|
|
107
|
-
|
|
108
|
-
/** Fired once per user action (file selection, drop, or removal). Detail: `{id, files, changedFiles}`. The `files` is the full current selection Whereas `changedFiles` is the entries this action added or removed. Both `changedFiles` and each entry in `files` are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`. */
|
|
109
|
-
onNysChange?: (event: CustomEvent) => void;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* File input with drag-and-drop, validation, and progress tracking.
|
|
114
|
-
* ---
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* ### **Events:**
|
|
118
|
-
* - **nys-blur** - Fired when focus leaves the component. Triggers validation.
|
|
119
|
-
* - **nys-change** - Fired once per user action (file selection, drop, or removal). Detail: `{id, files, changedFiles}`. The `files` is the full current selection Whereas `changedFiles` is the entries this action added or removed. Both `changedFiles` and each entry in `files` are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`.
|
|
120
|
-
*
|
|
121
|
-
* ### **Methods:**
|
|
122
|
-
* - **setFiles(incoming: _File[]_): _Promise<void>_** - Programmatically set the selection and await async validation/processing.
|
|
123
|
-
* Same as assigning `files`, but resolves once every file has finished its
|
|
124
|
-
* magic-byte validation and read — use when you need to read `checkValidity()`
|
|
125
|
-
* or the settled selection immediately after.
|
|
126
|
-
*
|
|
127
|
-
* ### **Slots:**
|
|
128
|
-
* - **description** - Custom HTML description content.
|
|
129
|
-
*/
|
|
130
|
-
export const NysFileinput: React.ForwardRefExoticComponent<NysFileinputProps>;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
import { useEventListener, useProperties } from "./react-utils.js";
|
|
4
|
-
|
|
5
|
-
export const 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
|
-
files,
|
|
25
|
-
value,
|
|
26
|
-
...filteredProps
|
|
27
|
-
} = props;
|
|
28
|
-
|
|
29
|
-
/** Event listeners - run once */
|
|
30
|
-
useEventListener(ref, "nys-blur", props.onNysBlur);
|
|
31
|
-
useEventListener(ref, "nys-change", props.onNysChange);
|
|
32
|
-
|
|
33
|
-
/** Properties - run whenever a property has changed */
|
|
34
|
-
useProperties(ref, "files", props.files);
|
|
35
|
-
useProperties(ref, "value", props.value);
|
|
36
|
-
|
|
37
|
-
return React.createElement(
|
|
38
|
-
"nys-fileinput",
|
|
39
|
-
{
|
|
40
|
-
ref: (node) => {
|
|
41
|
-
ref.current = node;
|
|
42
|
-
if (typeof forwardedRef === "function") {
|
|
43
|
-
forwardedRef(node);
|
|
44
|
-
} else if (forwardedRef) {
|
|
45
|
-
forwardedRef.current = node;
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
...filteredProps,
|
|
49
|
-
id: props.id,
|
|
50
|
-
name: props.name,
|
|
51
|
-
label: props.label,
|
|
52
|
-
description: props.description,
|
|
53
|
-
form: props.form,
|
|
54
|
-
tooltip: props.tooltip,
|
|
55
|
-
accept: props.accept,
|
|
56
|
-
errorMessage: props.errorMessage,
|
|
57
|
-
width: props.width,
|
|
58
|
-
class: props.className,
|
|
59
|
-
exportparts: props.exportparts,
|
|
60
|
-
for: props.htmlFor,
|
|
61
|
-
part: props.part,
|
|
62
|
-
tabindex: props.tabIndex,
|
|
63
|
-
multiple: props.multiple ? true : undefined,
|
|
64
|
-
disabled: props.disabled ? true : undefined,
|
|
65
|
-
required: props.required ? true : undefined,
|
|
66
|
-
optional: props.optional ? true : undefined,
|
|
67
|
-
showError: props.showError ? true : undefined,
|
|
68
|
-
dropzone: props.dropzone ? true : undefined,
|
|
69
|
-
inverted: props.inverted ? true : undefined,
|
|
70
|
-
style: { ...props.style },
|
|
71
|
-
},
|
|
72
|
-
props.children,
|
|
73
|
-
);
|
|
74
|
-
});
|
|
@@ -1,77 +0,0 @@
|
|
|
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
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
22
|
-
id?: NysGlobalFooterElement["id"];
|
|
23
|
-
|
|
24
|
-
/** Agency name displayed as the footer heading. */
|
|
25
|
-
agencyName?: NysGlobalFooterElement["agencyName"];
|
|
26
|
-
|
|
27
|
-
/** Optional subheading displayed below the agency name. */
|
|
28
|
-
agencySubheading?: NysGlobalFooterElement["agencySubheading"];
|
|
29
|
-
|
|
30
|
-
/** URL for the agency name link. If empty, name is not clickable. */
|
|
31
|
-
homepageLink?: NysGlobalFooterElement["homepageLink"];
|
|
32
|
-
|
|
33
|
-
/** Accessible name for the `contentinfo` landmark this footer renders.
|
|
34
|
-
|
|
35
|
-
Leave it unset and the landmark is named after the visible `agencyName`
|
|
36
|
-
heading, which cannot drift out of sync and is translated with the rest of
|
|
37
|
-
the page. Falls back to `"Site"` when there is no agency name to reference.
|
|
38
|
-
|
|
39
|
-
Set this only when the agency name is not right for your audience. A page
|
|
40
|
-
pairing this with `nys-unavfooter` carries two `contentinfo` landmarks, so
|
|
41
|
-
the name must stay distinct from that footer's (`"New York State"` by
|
|
42
|
-
default) or landmark navigation stops distinguishing them.
|
|
43
|
-
|
|
44
|
-
An explicit name replaces the reference to the visible heading. */
|
|
45
|
-
landmarkLabel?: NysGlobalFooterElement["landmarkLabel"];
|
|
46
|
-
|
|
47
|
-
/** 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()`. */
|
|
48
|
-
className?: string;
|
|
49
|
-
|
|
50
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
51
|
-
exportparts?: string;
|
|
52
|
-
|
|
53
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
54
|
-
htmlFor?: string;
|
|
55
|
-
|
|
56
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
57
|
-
key?: number | string;
|
|
58
|
-
|
|
59
|
-
/** 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. */
|
|
60
|
-
part?: string;
|
|
61
|
-
|
|
62
|
-
/** 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. */
|
|
63
|
-
ref?: any;
|
|
64
|
-
|
|
65
|
-
/** 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. */
|
|
66
|
-
tabIndex?: number;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Agency footer with auto-layout for contact info and link sections.
|
|
71
|
-
* ---
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* ### **Slots:**
|
|
75
|
-
* - _default_ - Footer content (links, contact info). Use `<h4>` for column headings.
|
|
76
|
-
*/
|
|
77
|
-
export const NysGlobalFooter: React.ForwardRefExoticComponent<NysGlobalFooterProps>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export const NysGlobalFooter = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const {
|
|
6
|
-
id,
|
|
7
|
-
agencyName,
|
|
8
|
-
agencySubheading,
|
|
9
|
-
homepageLink,
|
|
10
|
-
landmarkLabel,
|
|
11
|
-
...filteredProps
|
|
12
|
-
} = props;
|
|
13
|
-
|
|
14
|
-
return React.createElement(
|
|
15
|
-
"nys-globalfooter",
|
|
16
|
-
{
|
|
17
|
-
...filteredProps,
|
|
18
|
-
id: props.id,
|
|
19
|
-
agencyName: props.agencyName,
|
|
20
|
-
agencySubheading: props.agencySubheading,
|
|
21
|
-
homepageLink: props.homepageLink,
|
|
22
|
-
landmarkLabel: props.landmarkLabel,
|
|
23
|
-
class: props.className,
|
|
24
|
-
exportparts: props.exportparts,
|
|
25
|
-
for: props.htmlFor,
|
|
26
|
-
part: props.part,
|
|
27
|
-
tabindex: props.tabIndex,
|
|
28
|
-
style: { ...props.style },
|
|
29
|
-
},
|
|
30
|
-
props.children,
|
|
31
|
-
);
|
|
32
|
-
});
|