@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,88 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysAvatar as NysAvatarElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysAvatarElement };
|
|
5
|
-
|
|
6
|
-
export interface NysAvatarProps 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
|
-
/** Makes avatar clickable with button role and focus ring. */
|
|
22
|
-
interactive?: boolean;
|
|
23
|
-
|
|
24
|
-
/** Prevents interaction when `interactive` is true. */
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
|
|
27
|
-
/** Enables lazy loading for the image. */
|
|
28
|
-
lazy?: boolean;
|
|
29
|
-
|
|
30
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
31
|
-
id?: NysAvatarElement["id"];
|
|
32
|
-
|
|
33
|
-
/** Accessible name for the avatar — who or what it represents ("Jane Smith"),
|
|
34
|
-
not what it is ("avatar").
|
|
35
|
-
|
|
36
|
-
Leave it unset for a decorative avatar and the whole thing is hidden from
|
|
37
|
-
assistive tech, which is the right outcome next to a visible name. Set it
|
|
38
|
-
whenever the avatar is the only thing identifying the person, and always when
|
|
39
|
-
`interactive` is set: that renders a `<button>`, and a nameless button cannot
|
|
40
|
-
be operated by screen reader or voice-control users (WCAG 4.1.2). An
|
|
41
|
-
interactive avatar without a name logs a console warning.
|
|
42
|
-
|
|
43
|
-
Whitespace-only values — including a non-breaking space — count as no name. */
|
|
44
|
-
ariaLabel?: NysAvatarElement["ariaLabel"];
|
|
45
|
-
|
|
46
|
-
/** Image URL. Takes priority over initials and icon. */
|
|
47
|
-
image?: NysAvatarElement["image"];
|
|
48
|
-
|
|
49
|
-
/** 1-2 character initials. Used when no image is provided. */
|
|
50
|
-
initials?: NysAvatarElement["initials"];
|
|
51
|
-
|
|
52
|
-
/** Custom icon name. Falls back to `account_circle` if not set. */
|
|
53
|
-
icon?: NysAvatarElement["icon"];
|
|
54
|
-
|
|
55
|
-
/** Background color. Foreground auto-adjusts for contrast. Accepts CSS values or variables. */
|
|
56
|
-
color?: NysAvatarElement["color"];
|
|
57
|
-
|
|
58
|
-
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
59
|
-
className?: string;
|
|
60
|
-
|
|
61
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
62
|
-
exportparts?: string;
|
|
63
|
-
|
|
64
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
65
|
-
htmlFor?: string;
|
|
66
|
-
|
|
67
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
68
|
-
key?: number | string;
|
|
69
|
-
|
|
70
|
-
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
71
|
-
part?: string;
|
|
72
|
-
|
|
73
|
-
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
74
|
-
ref?: any;
|
|
75
|
-
|
|
76
|
-
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
77
|
-
tabIndex?: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* User avatar with image, initials, or icon fallback and contrast-aware colors.
|
|
82
|
-
* ---
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* ### **Slots:**
|
|
86
|
-
* - _default_ - Custom icon content. Overrides default icon when no image or initials.
|
|
87
|
-
*/
|
|
88
|
-
export const NysAvatar: React.ForwardRefExoticComponent<NysAvatarProps>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export const NysAvatar = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const {
|
|
6
|
-
interactive,
|
|
7
|
-
disabled,
|
|
8
|
-
lazy,
|
|
9
|
-
id,
|
|
10
|
-
ariaLabel,
|
|
11
|
-
image,
|
|
12
|
-
initials,
|
|
13
|
-
icon,
|
|
14
|
-
color,
|
|
15
|
-
...filteredProps
|
|
16
|
-
} = props;
|
|
17
|
-
|
|
18
|
-
return React.createElement(
|
|
19
|
-
"nys-avatar",
|
|
20
|
-
{
|
|
21
|
-
...filteredProps,
|
|
22
|
-
id: props.id,
|
|
23
|
-
ariaLabel: props.ariaLabel,
|
|
24
|
-
image: props.image,
|
|
25
|
-
initials: props.initials,
|
|
26
|
-
icon: props.icon,
|
|
27
|
-
color: props.color,
|
|
28
|
-
class: props.className,
|
|
29
|
-
exportparts: props.exportparts,
|
|
30
|
-
for: props.htmlFor,
|
|
31
|
-
part: props.part,
|
|
32
|
-
tabindex: props.tabIndex,
|
|
33
|
-
interactive: props.interactive ? true : undefined,
|
|
34
|
-
disabled: props.disabled ? true : undefined,
|
|
35
|
-
lazy: props.lazy ? true : undefined,
|
|
36
|
-
style: { ...props.style },
|
|
37
|
-
},
|
|
38
|
-
props.children,
|
|
39
|
-
);
|
|
40
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysBacktotop as NysBacktotopElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysBacktotopElement };
|
|
5
|
-
|
|
6
|
-
export interface NysBacktotopProps 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
|
-
/** Force button visibility. Overrides auto-show scroll behavior. */
|
|
22
|
-
visible?: boolean;
|
|
23
|
-
|
|
24
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
25
|
-
id?: NysBacktotopElement["id"];
|
|
26
|
-
|
|
27
|
-
/** Horizontal position: `left` or `right`. */
|
|
28
|
-
position?: NysBacktotopElement["position"];
|
|
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
|
-
* Floating back-to-top button with auto-show behavior, smooth scroll, and focus management.
|
|
54
|
-
* ---
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
export const NysBacktotop: React.ForwardRefExoticComponent<NysBacktotopProps>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export const NysBacktotop = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const { visible, id, position, ...filteredProps } = props;
|
|
6
|
-
|
|
7
|
-
return React.createElement(
|
|
8
|
-
"nys-backtotop",
|
|
9
|
-
{
|
|
10
|
-
...filteredProps,
|
|
11
|
-
id: props.id,
|
|
12
|
-
position: props.position,
|
|
13
|
-
class: props.className,
|
|
14
|
-
exportparts: props.exportparts,
|
|
15
|
-
for: props.htmlFor,
|
|
16
|
-
part: props.part,
|
|
17
|
-
tabindex: props.tabIndex,
|
|
18
|
-
visible: props.visible ? true : undefined,
|
|
19
|
-
style: { ...props.style },
|
|
20
|
-
},
|
|
21
|
-
props.children,
|
|
22
|
-
);
|
|
23
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysBadge as NysBadgeElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysBadgeElement };
|
|
5
|
-
|
|
6
|
-
export interface NysBadgeProps 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
|
-
/** Strong visual intent with bolder text and background. */
|
|
22
|
-
strong?: boolean;
|
|
23
|
-
|
|
24
|
-
/** undefined */
|
|
25
|
-
prefixIcon?: string | boolean;
|
|
26
|
-
|
|
27
|
-
/** undefined */
|
|
28
|
-
suffixIcon?: string | boolean;
|
|
29
|
-
|
|
30
|
-
/** Unique identifier. */
|
|
31
|
-
id?: NysBadgeElement["id"];
|
|
32
|
-
|
|
33
|
-
/** Name attribute for form association. */
|
|
34
|
-
name?: NysBadgeElement["name"];
|
|
35
|
-
|
|
36
|
-
/** Badge size: `sm` (smaller text) or `md` (default). */
|
|
37
|
-
size?: NysBadgeElement["size"];
|
|
38
|
-
|
|
39
|
-
/** Semantic intent affecting color: `base`, `info`, `success`, `warning` `danger`, `emergency`. `error` has been deprecated and support will be removed in a future release. Use `danger` instead */
|
|
40
|
-
intent?: NysBadgeElement["intent"];
|
|
41
|
-
|
|
42
|
-
/** Secondary label displayed before the main label. */
|
|
43
|
-
prefixLabel?: NysBadgeElement["prefixLabel"];
|
|
44
|
-
|
|
45
|
-
/** Primary label text displayed in the badge. */
|
|
46
|
-
label?: NysBadgeElement["label"];
|
|
47
|
-
|
|
48
|
-
/** Screen reader text appended after the label for additional context. */
|
|
49
|
-
srText?: NysBadgeElement["srText"];
|
|
50
|
-
|
|
51
|
-
/** 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()`. */
|
|
52
|
-
className?: string;
|
|
53
|
-
|
|
54
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
55
|
-
exportparts?: string;
|
|
56
|
-
|
|
57
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
58
|
-
htmlFor?: string;
|
|
59
|
-
|
|
60
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
61
|
-
key?: number | string;
|
|
62
|
-
|
|
63
|
-
/** 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. */
|
|
64
|
-
part?: string;
|
|
65
|
-
|
|
66
|
-
/** 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. */
|
|
67
|
-
ref?: any;
|
|
68
|
-
|
|
69
|
-
/** 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. */
|
|
70
|
-
tabIndex?: number;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Compact label for status, counts, or categorization with semantic styling.
|
|
75
|
-
* ---
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
|
-
export const NysBadge: React.ForwardRefExoticComponent<NysBadgeProps>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export const NysBadge = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const {
|
|
6
|
-
strong,
|
|
7
|
-
prefixIcon,
|
|
8
|
-
suffixIcon,
|
|
9
|
-
id,
|
|
10
|
-
name,
|
|
11
|
-
size,
|
|
12
|
-
intent,
|
|
13
|
-
prefixLabel,
|
|
14
|
-
label,
|
|
15
|
-
srText,
|
|
16
|
-
...filteredProps
|
|
17
|
-
} = props;
|
|
18
|
-
|
|
19
|
-
return React.createElement(
|
|
20
|
-
"nys-badge",
|
|
21
|
-
{
|
|
22
|
-
...filteredProps,
|
|
23
|
-
id: props.id,
|
|
24
|
-
name: props.name,
|
|
25
|
-
size: props.size,
|
|
26
|
-
intent: props.intent,
|
|
27
|
-
prefixLabel: props.prefixLabel,
|
|
28
|
-
label: props.label,
|
|
29
|
-
srText: props.srText,
|
|
30
|
-
class: props.className,
|
|
31
|
-
exportparts: props.exportparts,
|
|
32
|
-
for: props.htmlFor,
|
|
33
|
-
part: props.part,
|
|
34
|
-
tabindex: props.tabIndex,
|
|
35
|
-
strong: props.strong ? true : undefined,
|
|
36
|
-
prefixicon: props.prefixIcon ? true : undefined,
|
|
37
|
-
suffixicon: props.suffixIcon ? true : undefined,
|
|
38
|
-
style: { ...props.style },
|
|
39
|
-
},
|
|
40
|
-
props.children,
|
|
41
|
-
);
|
|
42
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
NysBreadcrumbItem as NysBreadcrumbItemElement,
|
|
4
|
-
CustomEvent,
|
|
5
|
-
} from "../../dist/nysds.es.js";
|
|
6
|
-
|
|
7
|
-
export type { NysBreadcrumbItemElement, CustomEvent };
|
|
8
|
-
|
|
9
|
-
export interface NysBreadcrumbItemProps 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
|
-
/** Private property used by nys-breadcrumbs to indicate this breadcrumb item is the last in the trail * */
|
|
25
|
-
isLast?: boolean;
|
|
26
|
-
|
|
27
|
-
/** undefined */
|
|
28
|
-
isBackToParent?: boolean;
|
|
29
|
-
|
|
30
|
-
/** undefined */
|
|
31
|
-
id?: NysBreadcrumbItemElement["id"];
|
|
32
|
-
|
|
33
|
-
/** undefined */
|
|
34
|
-
label?: NysBreadcrumbItemElement["label"];
|
|
35
|
-
|
|
36
|
-
/** undefined */
|
|
37
|
-
link?: NysBreadcrumbItemElement["link"];
|
|
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
|
-
/** Fired when the link is clicked. Detail: `{id, link}`. */
|
|
61
|
-
onNysBreadcrumbitemClick?: (event: CustomEvent) => void;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Single breadcrumb trail item with chevron separator and current page support.
|
|
66
|
-
* ---
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* ### **Events:**
|
|
70
|
-
* - **nys-breadcrumbitem-click** - Fired when the link is clicked. Detail: `{id, link}`.
|
|
71
|
-
*/
|
|
72
|
-
export const NysBreadcrumbItem: React.ForwardRefExoticComponent<NysBreadcrumbItemProps>;
|
|
@@ -1,42 +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 NysBreadcrumbItem = forwardRef((props, forwardedRef) => {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const { isLast, isBackToParent, id, label, link, ...filteredProps } = props;
|
|
8
|
-
|
|
9
|
-
/** Event listeners - run once */
|
|
10
|
-
useEventListener(
|
|
11
|
-
ref,
|
|
12
|
-
"nys-breadcrumbitem-click",
|
|
13
|
-
props.onNysBreadcrumbitemClick,
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
return React.createElement(
|
|
17
|
-
"nys-breadcrumbitem",
|
|
18
|
-
{
|
|
19
|
-
ref: (node) => {
|
|
20
|
-
ref.current = node;
|
|
21
|
-
if (typeof forwardedRef === "function") {
|
|
22
|
-
forwardedRef(node);
|
|
23
|
-
} else if (forwardedRef) {
|
|
24
|
-
forwardedRef.current = node;
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
...filteredProps,
|
|
28
|
-
id: props.id,
|
|
29
|
-
label: props.label,
|
|
30
|
-
link: props.link,
|
|
31
|
-
class: props.className,
|
|
32
|
-
exportparts: props.exportparts,
|
|
33
|
-
for: props.htmlFor,
|
|
34
|
-
part: props.part,
|
|
35
|
-
tabindex: props.tabIndex,
|
|
36
|
-
isLast: props.isLast ? true : undefined,
|
|
37
|
-
isBackToParent: props.isBackToParent ? true : undefined,
|
|
38
|
-
style: { ...props.style },
|
|
39
|
-
},
|
|
40
|
-
props.children,
|
|
41
|
-
);
|
|
42
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
NysBreadcrumbs as NysBreadcrumbsElement,
|
|
4
|
-
CustomEvent,
|
|
5
|
-
} from "../../dist/nysds.es.js";
|
|
6
|
-
|
|
7
|
-
export type { NysBreadcrumbsElement, CustomEvent };
|
|
8
|
-
|
|
9
|
-
export interface NysBreadcrumbsProps 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
|
-
/** On mobile, renders the trail as a single back-to-parent link pointing to the item before the current page.
|
|
25
|
-
Has no effect on desktop or when only one item is present (which always renders as a back link). */
|
|
26
|
-
backToParent?: boolean;
|
|
27
|
-
|
|
28
|
-
/** Forces the trail into its collapsed state.
|
|
29
|
-
It shows only the first item, an ellipsis, and the last two items.
|
|
30
|
-
The user can still expand the trail by clicking the ellipsis. */
|
|
31
|
-
collapsed?: boolean;
|
|
32
|
-
|
|
33
|
-
/** Renders a filled light theme background bar behind the breadcrumb trail. */
|
|
34
|
-
backgroundBar?: boolean;
|
|
35
|
-
|
|
36
|
-
/** Prevents interaction. */
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
|
|
39
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
40
|
-
id?: NysBreadcrumbsElement["id"];
|
|
41
|
-
|
|
42
|
-
/** Accessible label for the `<nav>` landmark. Defaults to "Breadcrumb" if not set.
|
|
43
|
-
Override when multiple crumbs exist on the same page. */
|
|
44
|
-
ariaLabel?: NysBreadcrumbsElement["ariaLabel"];
|
|
45
|
-
|
|
46
|
-
/** Controls the visual size of the breadcrumb text and spacing: `sm` for dense layouts, `md` (default) for standard use. */
|
|
47
|
-
size?: NysBreadcrumbsElement["size"];
|
|
48
|
-
|
|
49
|
-
/** 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()`. */
|
|
50
|
-
className?: string;
|
|
51
|
-
|
|
52
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
53
|
-
exportparts?: string;
|
|
54
|
-
|
|
55
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
56
|
-
htmlFor?: string;
|
|
57
|
-
|
|
58
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
59
|
-
key?: number | string;
|
|
60
|
-
|
|
61
|
-
/** 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. */
|
|
62
|
-
part?: string;
|
|
63
|
-
|
|
64
|
-
/** 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. */
|
|
65
|
-
ref?: any;
|
|
66
|
-
|
|
67
|
-
/** 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. */
|
|
68
|
-
tabIndex?: number;
|
|
69
|
-
|
|
70
|
-
/** undefined */
|
|
71
|
-
onNysExpand?: (event: CustomEvent) => void;
|
|
72
|
-
|
|
73
|
-
/** Fired when the user clicks the ellipsis to expand the trail. */
|
|
74
|
-
onNysBreadcrumbsExpand?: (event: CustomEvent) => void;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Breadcrumb navigation trail with responsive collapse support.
|
|
79
|
-
* ---
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* ### **Events:**
|
|
83
|
-
* - **nys-expand**
|
|
84
|
-
* - **nys-breadcrumbs-expand** - Fired when the user clicks the ellipsis to expand the trail.
|
|
85
|
-
*
|
|
86
|
-
* ### **Slots:**
|
|
87
|
-
* - _default_ - One or more `li` elements defining the trail.
|
|
88
|
-
*/
|
|
89
|
-
export const NysBreadcrumbs: React.ForwardRefExoticComponent<NysBreadcrumbsProps>;
|
|
@@ -1,50 +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 NysBreadcrumbs = forwardRef((props, forwardedRef) => {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const {
|
|
8
|
-
backToParent,
|
|
9
|
-
collapsed,
|
|
10
|
-
backgroundBar,
|
|
11
|
-
disabled,
|
|
12
|
-
id,
|
|
13
|
-
ariaLabel,
|
|
14
|
-
size,
|
|
15
|
-
...filteredProps
|
|
16
|
-
} = props;
|
|
17
|
-
|
|
18
|
-
/** Event listeners - run once */
|
|
19
|
-
useEventListener(ref, "nys-expand", props.onNysExpand);
|
|
20
|
-
useEventListener(ref, "nys-breadcrumbs-expand", props.onNysBreadcrumbsExpand);
|
|
21
|
-
|
|
22
|
-
return React.createElement(
|
|
23
|
-
"nys-breadcrumbs",
|
|
24
|
-
{
|
|
25
|
-
ref: (node) => {
|
|
26
|
-
ref.current = node;
|
|
27
|
-
if (typeof forwardedRef === "function") {
|
|
28
|
-
forwardedRef(node);
|
|
29
|
-
} else if (forwardedRef) {
|
|
30
|
-
forwardedRef.current = node;
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
...filteredProps,
|
|
34
|
-
id: props.id,
|
|
35
|
-
ariaLabel: props.ariaLabel,
|
|
36
|
-
size: props.size,
|
|
37
|
-
class: props.className,
|
|
38
|
-
exportparts: props.exportparts,
|
|
39
|
-
for: props.htmlFor,
|
|
40
|
-
part: props.part,
|
|
41
|
-
tabindex: props.tabIndex,
|
|
42
|
-
backToParent: props.backToParent ? true : undefined,
|
|
43
|
-
collapsed: props.collapsed ? true : undefined,
|
|
44
|
-
backgroundBar: props.backgroundBar ? true : undefined,
|
|
45
|
-
disabled: props.disabled ? true : undefined,
|
|
46
|
-
style: { ...props.style },
|
|
47
|
-
},
|
|
48
|
-
props.children,
|
|
49
|
-
);
|
|
50
|
-
});
|