@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,54 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
import { useEventListener } from "./react-utils.js";
|
|
4
|
-
|
|
5
|
-
export const NysUnavHeader = forwardRef((props, forwardedRef) => {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const {
|
|
8
|
-
trustbarVisible,
|
|
9
|
-
searchDropdownVisible,
|
|
10
|
-
languageVisible,
|
|
11
|
-
isSearchFocused,
|
|
12
|
-
hideTranslate,
|
|
13
|
-
hideSearch,
|
|
14
|
-
searchUrl,
|
|
15
|
-
landmarkLabel,
|
|
16
|
-
languages,
|
|
17
|
-
...filteredProps
|
|
18
|
-
} = props;
|
|
19
|
-
|
|
20
|
-
/** Event listeners - run once */
|
|
21
|
-
useEventListener(ref, "nys-language-select", props.onNysLanguageSelect);
|
|
22
|
-
useEventListener(ref, "nys-search-submit", props.onNysSearchSubmit);
|
|
23
|
-
|
|
24
|
-
return React.createElement(
|
|
25
|
-
"nys-unavheader",
|
|
26
|
-
{
|
|
27
|
-
ref: (node) => {
|
|
28
|
-
ref.current = node;
|
|
29
|
-
if (typeof forwardedRef === "function") {
|
|
30
|
-
forwardedRef(node);
|
|
31
|
-
} else if (forwardedRef) {
|
|
32
|
-
forwardedRef.current = node;
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
...filteredProps,
|
|
36
|
-
searchUrl: props.searchUrl,
|
|
37
|
-
landmarkLabel: props.landmarkLabel,
|
|
38
|
-
languages: props.languages,
|
|
39
|
-
class: props.className,
|
|
40
|
-
exportparts: props.exportparts,
|
|
41
|
-
for: props.htmlFor,
|
|
42
|
-
part: props.part,
|
|
43
|
-
tabindex: props.tabIndex,
|
|
44
|
-
trustbarVisible: props.trustbarVisible ? true : undefined,
|
|
45
|
-
searchDropdownVisible: props.searchDropdownVisible ? true : undefined,
|
|
46
|
-
languageVisible: props.languageVisible ? true : undefined,
|
|
47
|
-
isSearchFocused: props.isSearchFocused ? true : undefined,
|
|
48
|
-
hideTranslate: props.hideTranslate ? true : undefined,
|
|
49
|
-
hideSearch: props.hideSearch ? true : undefined,
|
|
50
|
-
style: { ...props.style },
|
|
51
|
-
},
|
|
52
|
-
props.children,
|
|
53
|
-
);
|
|
54
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysVerticalnav as NysVerticalnavElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysVerticalnavElement };
|
|
5
|
-
|
|
6
|
-
export interface NysVerticalnavProps extends Pick<
|
|
7
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
-
| "children"
|
|
9
|
-
| "dir"
|
|
10
|
-
| "hidden"
|
|
11
|
-
| "id"
|
|
12
|
-
| "lang"
|
|
13
|
-
| "slot"
|
|
14
|
-
| "style"
|
|
15
|
-
| "title"
|
|
16
|
-
| "translate"
|
|
17
|
-
| "onClick"
|
|
18
|
-
| "onFocus"
|
|
19
|
-
| "onBlur"
|
|
20
|
-
> {
|
|
21
|
-
/** Hides the visible heading while keeping an accessible label for the navigation. */
|
|
22
|
-
hideHeading?: boolean;
|
|
23
|
-
|
|
24
|
-
/** Expands or collapses the navigation on mobile. */
|
|
25
|
-
expanded?: boolean;
|
|
26
|
-
|
|
27
|
-
/** ID for the navigation. Generated automatically if not provided. */
|
|
28
|
-
id?: NysVerticalnavElement["id"];
|
|
29
|
-
|
|
30
|
-
/** Heading text displayed at the top of the navigation. Defaults to "Page navigation". */
|
|
31
|
-
heading?: NysVerticalnavElement["heading"];
|
|
32
|
-
|
|
33
|
-
/** Heading level used for the navigation heading (`h1` through `h6`). */
|
|
34
|
-
headingLevel?: NysVerticalnavElement["headingLevel"];
|
|
35
|
-
|
|
36
|
-
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
37
|
-
className?: string;
|
|
38
|
-
|
|
39
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
40
|
-
exportparts?: string;
|
|
41
|
-
|
|
42
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
43
|
-
htmlFor?: string;
|
|
44
|
-
|
|
45
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
46
|
-
key?: number | string;
|
|
47
|
-
|
|
48
|
-
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
49
|
-
part?: string;
|
|
50
|
-
|
|
51
|
-
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
52
|
-
ref?: any;
|
|
53
|
-
|
|
54
|
-
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
55
|
-
tabIndex?: number;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Responsive navigation that becomes an accordion on smaller screens.
|
|
60
|
-
* ---
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* ### **Methods:**
|
|
64
|
-
* - **open()** - Public API for controlling the mobile accordion from outside the component
|
|
65
|
-
* --------------------------------------------------------------------------
|
|
66
|
-
*/
|
|
67
|
-
export const NysVerticalnav: React.ForwardRefExoticComponent<NysVerticalnavProps>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export const NysVerticalnav = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const { hideHeading, expanded, id, heading, headingLevel, ...filteredProps } =
|
|
6
|
-
props;
|
|
7
|
-
|
|
8
|
-
return React.createElement(
|
|
9
|
-
"nys-verticalnav",
|
|
10
|
-
{
|
|
11
|
-
...filteredProps,
|
|
12
|
-
id: props.id,
|
|
13
|
-
heading: props.heading,
|
|
14
|
-
headingLevel: props.headingLevel,
|
|
15
|
-
class: props.className,
|
|
16
|
-
exportparts: props.exportparts,
|
|
17
|
-
for: props.htmlFor,
|
|
18
|
-
part: props.part,
|
|
19
|
-
tabindex: props.tabIndex,
|
|
20
|
-
hideHeading: props.hideHeading ? true : undefined,
|
|
21
|
-
expanded: props.expanded ? true : undefined,
|
|
22
|
-
style: { ...props.style },
|
|
23
|
-
},
|
|
24
|
-
props.children,
|
|
25
|
-
);
|
|
26
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
NysVerticalnavGroup as NysVerticalnavGroupElement,
|
|
4
|
-
CustomEvent,
|
|
5
|
-
} from "../../dist/nysds.es.js";
|
|
6
|
-
|
|
7
|
-
export type { NysVerticalnavGroupElement, CustomEvent };
|
|
8
|
-
|
|
9
|
-
export interface NysVerticalnavGroupProps extends Pick<
|
|
10
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
11
|
-
| "children"
|
|
12
|
-
| "dir"
|
|
13
|
-
| "hidden"
|
|
14
|
-
| "id"
|
|
15
|
-
| "lang"
|
|
16
|
-
| "slot"
|
|
17
|
-
| "style"
|
|
18
|
-
| "title"
|
|
19
|
-
| "translate"
|
|
20
|
-
| "onClick"
|
|
21
|
-
| "onFocus"
|
|
22
|
-
| "onBlur"
|
|
23
|
-
> {
|
|
24
|
-
/** undefined */
|
|
25
|
-
expanded?: boolean;
|
|
26
|
-
|
|
27
|
-
/** undefined */
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
|
|
30
|
-
/** undefined */
|
|
31
|
-
active?: boolean;
|
|
32
|
-
|
|
33
|
-
/** undefined */
|
|
34
|
-
id?: NysVerticalnavGroupElement["id"];
|
|
35
|
-
|
|
36
|
-
/** undefined */
|
|
37
|
-
label?: NysVerticalnavGroupElement["label"];
|
|
38
|
-
|
|
39
|
-
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
40
|
-
className?: string;
|
|
41
|
-
|
|
42
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
43
|
-
exportparts?: string;
|
|
44
|
-
|
|
45
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
46
|
-
htmlFor?: string;
|
|
47
|
-
|
|
48
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
49
|
-
key?: number | string;
|
|
50
|
-
|
|
51
|
-
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
52
|
-
part?: string;
|
|
53
|
-
|
|
54
|
-
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
55
|
-
ref?: any;
|
|
56
|
-
|
|
57
|
-
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
58
|
-
tabIndex?: number;
|
|
59
|
-
|
|
60
|
-
/** undefined */
|
|
61
|
-
onNysChildResize?: (event: CustomEvent) => void;
|
|
62
|
-
|
|
63
|
-
/** undefined */
|
|
64
|
-
onNysVerticalnavgroupToggle?: (event: CustomEvent) => void;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Collapsible link group for use within `<nys-verticalnav>`.
|
|
69
|
-
* ---
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* ### **Events:**
|
|
73
|
-
* - **nys-child-resize**
|
|
74
|
-
* - **nys-verticalnavgroup-toggle**
|
|
75
|
-
*/
|
|
76
|
-
export const NysVerticalnavGroup: React.ForwardRefExoticComponent<NysVerticalnavGroupProps>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useRef, useEffect } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
import { useEventListener } from "./react-utils.js";
|
|
4
|
-
|
|
5
|
-
export const NysVerticalnavGroup = forwardRef((props, forwardedRef) => {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const { expanded, disabled, active, id, label, ...filteredProps } = props;
|
|
8
|
-
|
|
9
|
-
/** Event listeners - run once */
|
|
10
|
-
useEventListener(ref, "nys-child-resize", props.onNysChildResize);
|
|
11
|
-
useEventListener(
|
|
12
|
-
ref,
|
|
13
|
-
"nys-verticalnavgroup-toggle",
|
|
14
|
-
props.onNysVerticalnavgroupToggle,
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
return React.createElement(
|
|
18
|
-
"nys-verticalnavgroup",
|
|
19
|
-
{
|
|
20
|
-
ref: (node) => {
|
|
21
|
-
ref.current = node;
|
|
22
|
-
if (typeof forwardedRef === "function") {
|
|
23
|
-
forwardedRef(node);
|
|
24
|
-
} else if (forwardedRef) {
|
|
25
|
-
forwardedRef.current = node;
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
...filteredProps,
|
|
29
|
-
id: props.id,
|
|
30
|
-
label: props.label,
|
|
31
|
-
class: props.className,
|
|
32
|
-
exportparts: props.exportparts,
|
|
33
|
-
for: props.htmlFor,
|
|
34
|
-
part: props.part,
|
|
35
|
-
tabindex: props.tabIndex,
|
|
36
|
-
expanded: props.expanded ? true : undefined,
|
|
37
|
-
disabled: props.disabled ? true : undefined,
|
|
38
|
-
active: props.active ? true : undefined,
|
|
39
|
-
style: { ...props.style },
|
|
40
|
-
},
|
|
41
|
-
props.children,
|
|
42
|
-
);
|
|
43
|
-
});
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysVideo as NysVideoElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysVideoElement };
|
|
5
|
-
|
|
6
|
-
export interface NysVideoProps extends Pick<
|
|
7
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
-
| "children"
|
|
9
|
-
| "dir"
|
|
10
|
-
| "hidden"
|
|
11
|
-
| "id"
|
|
12
|
-
| "lang"
|
|
13
|
-
| "slot"
|
|
14
|
-
| "style"
|
|
15
|
-
| "title"
|
|
16
|
-
| "translate"
|
|
17
|
-
| "onClick"
|
|
18
|
-
| "onFocus"
|
|
19
|
-
| "onBlur"
|
|
20
|
-
> {
|
|
21
|
-
/** Triggers autoplay when the iframe loads */
|
|
22
|
-
autoplay?: boolean;
|
|
23
|
-
|
|
24
|
-
/** Prevents the video from being played */
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
|
|
27
|
-
/** Full YouTube URL — required. Component will not render if invalid. */
|
|
28
|
-
id?: NysVideoElement["id"];
|
|
29
|
-
|
|
30
|
-
/** Title text for the thumbnail of the video */
|
|
31
|
-
titleText?: NysVideoElement["titleText"];
|
|
32
|
-
|
|
33
|
-
/** Full YouTube URL — required. Component will not render if invalid. */
|
|
34
|
-
videourl?: NysVideoElement["videourl"];
|
|
35
|
-
|
|
36
|
-
/** Largest size for the video player.
|
|
37
|
-
If not set, size is determined automatically by viewport width. */
|
|
38
|
-
size?: NysVideoElement["size"];
|
|
39
|
-
|
|
40
|
-
/** undefined */
|
|
41
|
-
loading?: NysVideoElement["loading"];
|
|
42
|
-
|
|
43
|
-
/** Time in seconds where playback begins. * */
|
|
44
|
-
starttime?: NysVideoElement["starttime"];
|
|
45
|
-
|
|
46
|
-
/** Custom thumbnail image path.
|
|
47
|
-
Falls back to YouTube's auto-generated thumbnail if not provided. */
|
|
48
|
-
thumbnail?: NysVideoElement["thumbnail"];
|
|
49
|
-
|
|
50
|
-
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
51
|
-
className?: string;
|
|
52
|
-
|
|
53
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
54
|
-
exportparts?: string;
|
|
55
|
-
|
|
56
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
57
|
-
htmlFor?: string;
|
|
58
|
-
|
|
59
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
60
|
-
key?: number | string;
|
|
61
|
-
|
|
62
|
-
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
63
|
-
part?: string;
|
|
64
|
-
|
|
65
|
-
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
66
|
-
ref?: any;
|
|
67
|
-
|
|
68
|
-
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
69
|
-
tabIndex?: number;
|
|
70
|
-
|
|
71
|
-
/** Fired when the user clicks the thumbnail to load the player. */
|
|
72
|
-
onNysVideoPlay?: (event: CustomEvent) => void;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* YouTube video player with thumbnail preview and accessibility announcements.
|
|
77
|
-
* ---
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* ### **Events:**
|
|
81
|
-
* - **nys-video-play** - Fired when the user clicks the thumbnail to load the player.
|
|
82
|
-
*/
|
|
83
|
-
export const NysVideo: React.ForwardRefExoticComponent<NysVideoProps>;
|
|
@@ -1,53 +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 NysVideo = forwardRef((props, forwardedRef) => {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const {
|
|
8
|
-
autoplay,
|
|
9
|
-
disabled,
|
|
10
|
-
id,
|
|
11
|
-
titleText,
|
|
12
|
-
videourl,
|
|
13
|
-
size,
|
|
14
|
-
loading,
|
|
15
|
-
starttime,
|
|
16
|
-
thumbnail,
|
|
17
|
-
...filteredProps
|
|
18
|
-
} = props;
|
|
19
|
-
|
|
20
|
-
/** Event listeners - run once */
|
|
21
|
-
useEventListener(ref, "nys-video-play", props.onNysVideoPlay);
|
|
22
|
-
|
|
23
|
-
return React.createElement(
|
|
24
|
-
"nys-video",
|
|
25
|
-
{
|
|
26
|
-
ref: (node) => {
|
|
27
|
-
ref.current = node;
|
|
28
|
-
if (typeof forwardedRef === "function") {
|
|
29
|
-
forwardedRef(node);
|
|
30
|
-
} else if (forwardedRef) {
|
|
31
|
-
forwardedRef.current = node;
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
...filteredProps,
|
|
35
|
-
id: props.id,
|
|
36
|
-
titleText: props.titleText,
|
|
37
|
-
videourl: props.videourl,
|
|
38
|
-
size: props.size,
|
|
39
|
-
loading: props.loading,
|
|
40
|
-
starttime: props.starttime,
|
|
41
|
-
thumbnail: props.thumbnail,
|
|
42
|
-
class: props.className,
|
|
43
|
-
exportparts: props.exportparts,
|
|
44
|
-
for: props.htmlFor,
|
|
45
|
-
part: props.part,
|
|
46
|
-
tabindex: props.tabIndex,
|
|
47
|
-
autoplay: props.autoplay ? true : undefined,
|
|
48
|
-
disabled: props.disabled ? true : undefined,
|
|
49
|
-
style: { ...props.style },
|
|
50
|
-
},
|
|
51
|
-
props.children,
|
|
52
|
-
);
|
|
53
|
-
});
|
package/packages/react/README.md
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
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
|
-
```
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export * from "./NysAccordion.js";
|
|
2
|
-
export * from "./NysAccordionItem.js";
|
|
3
|
-
export * from "./NysAlert.js";
|
|
4
|
-
export * from "./NysAvatar.js";
|
|
5
|
-
export * from "./NysBacktotop.js";
|
|
6
|
-
export * from "./NysBadge.js";
|
|
7
|
-
export * from "./NysBreadcrumbs.js";
|
|
8
|
-
export * from "./NysButton.js";
|
|
9
|
-
export * from "./NysCard.js";
|
|
10
|
-
export * from "./NysCheckbox.js";
|
|
11
|
-
export * from "./NysCheckboxgroup.js";
|
|
12
|
-
export * from "./NysCombobox.js";
|
|
13
|
-
export * from "./NysDatepicker.js";
|
|
14
|
-
export * from "./NysDivider.js";
|
|
15
|
-
export * from "./NysDropdownMenu.js";
|
|
16
|
-
export * from "./NysDropdownMenuItem.js";
|
|
17
|
-
export * from "./NysErrorMessage.js";
|
|
18
|
-
export * from "./NysFileinput.js";
|
|
19
|
-
export * from "./NysFileItem.js";
|
|
20
|
-
export * from "./NysGlobalFooter.js";
|
|
21
|
-
export * from "./NysGlobalHeader.js";
|
|
22
|
-
export * from "./NysIcon.js";
|
|
23
|
-
export * from "./NysIconlist.js";
|
|
24
|
-
export * from "./NysIconlistitem.js";
|
|
25
|
-
export * from "./NysLabel.js";
|
|
26
|
-
export * from "./NysModal.js";
|
|
27
|
-
export * from "./NysPagination.js";
|
|
28
|
-
export * from "./NysProcesslist.js";
|
|
29
|
-
export * from "./NysProcesslistitem.js";
|
|
30
|
-
export * from "./NysRadiobutton.js";
|
|
31
|
-
export * from "./NysRadiogroup.js";
|
|
32
|
-
export * from "./NysOption.js";
|
|
33
|
-
export * from "./NysSelect.js";
|
|
34
|
-
export * from "./NysSkipnav.js";
|
|
35
|
-
export * from "./NysStep.js";
|
|
36
|
-
export * from "./NysStepper.js";
|
|
37
|
-
export * from "./NysTab.js";
|
|
38
|
-
export * from "./NysTabgroup.js";
|
|
39
|
-
export * from "./NysTabpanel.js";
|
|
40
|
-
export * from "./NysTable.js";
|
|
41
|
-
export * from "./NysTextarea.js";
|
|
42
|
-
export * from "./NysTextinput.js";
|
|
43
|
-
export * from "./NysToggle.js";
|
|
44
|
-
export * from "./NysTooltip.js";
|
|
45
|
-
export * from "./NysUnavFooter.js";
|
|
46
|
-
export * from "./NysUnavHeader.js";
|
|
47
|
-
export * from "./NysVerticalnav.js";
|
|
48
|
-
export * from "./NysVerticalnavGroup.js";
|
|
49
|
-
export * from "./NysVideo.js";
|
package/packages/react/index.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export * from "./NysAccordion.js";
|
|
2
|
-
export * from "./NysAccordionItem.js";
|
|
3
|
-
export * from "./NysAlert.js";
|
|
4
|
-
export * from "./NysAvatar.js";
|
|
5
|
-
export * from "./NysBacktotop.js";
|
|
6
|
-
export * from "./NysBadge.js";
|
|
7
|
-
export * from "./NysBreadcrumbs.js";
|
|
8
|
-
export * from "./NysButton.js";
|
|
9
|
-
export * from "./NysCard.js";
|
|
10
|
-
export * from "./NysCheckbox.js";
|
|
11
|
-
export * from "./NysCheckboxgroup.js";
|
|
12
|
-
export * from "./NysCombobox.js";
|
|
13
|
-
export * from "./NysDatepicker.js";
|
|
14
|
-
export * from "./NysDivider.js";
|
|
15
|
-
export * from "./NysDropdownMenu.js";
|
|
16
|
-
export * from "./NysDropdownMenuItem.js";
|
|
17
|
-
export * from "./NysErrorMessage.js";
|
|
18
|
-
export * from "./NysFileinput.js";
|
|
19
|
-
export * from "./NysFileItem.js";
|
|
20
|
-
export * from "./NysGlobalFooter.js";
|
|
21
|
-
export * from "./NysGlobalHeader.js";
|
|
22
|
-
export * from "./NysIcon.js";
|
|
23
|
-
export * from "./NysIconlist.js";
|
|
24
|
-
export * from "./NysIconlistitem.js";
|
|
25
|
-
export * from "./NysLabel.js";
|
|
26
|
-
export * from "./NysModal.js";
|
|
27
|
-
export * from "./NysPagination.js";
|
|
28
|
-
export * from "./NysProcesslist.js";
|
|
29
|
-
export * from "./NysProcesslistitem.js";
|
|
30
|
-
export * from "./NysRadiobutton.js";
|
|
31
|
-
export * from "./NysRadiogroup.js";
|
|
32
|
-
export * from "./NysOption.js";
|
|
33
|
-
export * from "./NysSelect.js";
|
|
34
|
-
export * from "./NysSkipnav.js";
|
|
35
|
-
export * from "./NysStep.js";
|
|
36
|
-
export * from "./NysStepper.js";
|
|
37
|
-
export * from "./NysTab.js";
|
|
38
|
-
export * from "./NysTabgroup.js";
|
|
39
|
-
export * from "./NysTabpanel.js";
|
|
40
|
-
export * from "./NysTable.js";
|
|
41
|
-
export * from "./NysTextarea.js";
|
|
42
|
-
export * from "./NysTextinput.js";
|
|
43
|
-
export * from "./NysToggle.js";
|
|
44
|
-
export * from "./NysTooltip.js";
|
|
45
|
-
export * from "./NysUnavFooter.js";
|
|
46
|
-
export * from "./NysUnavHeader.js";
|
|
47
|
-
export * from "./NysVerticalnav.js";
|
|
48
|
-
export * from "./NysVerticalnavGroup.js";
|
|
49
|
-
export * from "./NysVideo.js";
|