@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,144 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
NysTextinput as NysTextinputElement,
|
|
4
|
-
CustomEvent,
|
|
5
|
-
Event,
|
|
6
|
-
} from "../../dist/nysds.es.js";
|
|
7
|
-
|
|
8
|
-
export type { NysTextinputElement, CustomEvent, Event };
|
|
9
|
-
|
|
10
|
-
export interface NysTextinputProps 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
|
-
/** Prevents interaction. */
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
|
|
28
|
-
/** Makes input read-only but focusable. */
|
|
29
|
-
readonly?: boolean;
|
|
30
|
-
|
|
31
|
-
/** Marks as required. Shows "Required" flag and validates on blur. */
|
|
32
|
-
required?: boolean;
|
|
33
|
-
|
|
34
|
-
/** Shows "Optional" flag. Use when most fields are required. */
|
|
35
|
-
optional?: boolean;
|
|
36
|
-
|
|
37
|
-
/** Adjusts colors for dark backgrounds. */
|
|
38
|
-
inverted?: boolean;
|
|
39
|
-
|
|
40
|
-
/** Shows error message when true. Set by validation or manually. */
|
|
41
|
-
showError?: boolean;
|
|
42
|
-
|
|
43
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
44
|
-
id?: NysTextinputElement["id"];
|
|
45
|
-
|
|
46
|
-
/** Name for form submission. */
|
|
47
|
-
name?: NysTextinputElement["name"];
|
|
48
|
-
|
|
49
|
-
/** Input type: `text` (default), `email`, `number`, `password`, `search`, `tel` (auto-masked), `url`. */
|
|
50
|
-
type?: NysTextinputElement["type"];
|
|
51
|
-
|
|
52
|
-
/** Visible label text. Required for accessibility. */
|
|
53
|
-
label?: NysTextinputElement["label"];
|
|
54
|
-
|
|
55
|
-
/** Helper text below label. Use slot for custom HTML. */
|
|
56
|
-
description?: NysTextinputElement["description"];
|
|
57
|
-
|
|
58
|
-
/** Placeholder text. Don't use as label replacement. */
|
|
59
|
-
placeholder?: NysTextinputElement["placeholder"];
|
|
60
|
-
|
|
61
|
-
/** Current input value. */
|
|
62
|
-
value?: NysTextinputElement["value"];
|
|
63
|
-
|
|
64
|
-
/** Tooltip text shown on hover/focus of info icon. */
|
|
65
|
-
tooltip?: NysTextinputElement["tooltip"];
|
|
66
|
-
|
|
67
|
-
/** Form `id` to associate with when input is outside form element. */
|
|
68
|
-
form?: NysTextinputElement["form"];
|
|
69
|
-
|
|
70
|
-
/** Regex pattern for validation. Shows error on mismatch. */
|
|
71
|
-
pattern?: NysTextinputElement["pattern"];
|
|
72
|
-
|
|
73
|
-
/** Maximum character length. */
|
|
74
|
-
maxlength?: NysTextinputElement["maxlength"];
|
|
75
|
-
|
|
76
|
-
/** Accessible label. When set, assuming "label" isn't provided for private special cases (i.e., <checkbox other>). */
|
|
77
|
-
ariaLabel?: NysTextinputElement["ariaLabel"];
|
|
78
|
-
|
|
79
|
-
/** Input width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default). */
|
|
80
|
-
width?: NysTextinputElement["width"];
|
|
81
|
-
|
|
82
|
-
/** Step increment for `type="number"`. */
|
|
83
|
-
step?: NysTextinputElement["step"];
|
|
84
|
-
|
|
85
|
-
/** Minimum value for `type="number"`. */
|
|
86
|
-
min?: NysTextinputElement["min"];
|
|
87
|
-
|
|
88
|
-
/** Maximum value for `type="number"`. */
|
|
89
|
-
max?: NysTextinputElement["max"];
|
|
90
|
-
|
|
91
|
-
/** Error message text. Shown only when `showError` is true. */
|
|
92
|
-
errorMessage?: NysTextinputElement["errorMessage"];
|
|
93
|
-
|
|
94
|
-
/** 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()`. */
|
|
95
|
-
className?: string;
|
|
96
|
-
|
|
97
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
98
|
-
exportparts?: string;
|
|
99
|
-
|
|
100
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
101
|
-
htmlFor?: string;
|
|
102
|
-
|
|
103
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
104
|
-
key?: number | string;
|
|
105
|
-
|
|
106
|
-
/** 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. */
|
|
107
|
-
part?: string;
|
|
108
|
-
|
|
109
|
-
/** 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. */
|
|
110
|
-
ref?: any;
|
|
111
|
-
|
|
112
|
-
/** 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. */
|
|
113
|
-
tabIndex?: number;
|
|
114
|
-
|
|
115
|
-
/** Fired on input change. Detail: `{id, value}`. */
|
|
116
|
-
onNysInput?: (event: CustomEvent) => void;
|
|
117
|
-
|
|
118
|
-
/** Fired when input gains focus. */
|
|
119
|
-
onNysFocus?: (event: CustomEvent) => void;
|
|
120
|
-
|
|
121
|
-
/** Fired when input loses focus. Triggers validation. */
|
|
122
|
-
onNysBlur?: (event: CustomEvent) => void;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Text input for short single-line data with validation and masking support.
|
|
127
|
-
* ---
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* ### **Events:**
|
|
131
|
-
* - **nys-input** - Fired on input change. Detail: `{id, value}`.
|
|
132
|
-
* - **nys-focus** - Fired when input gains focus.
|
|
133
|
-
* - **nys-blur** - Fired when input loses focus. Triggers validation.
|
|
134
|
-
*
|
|
135
|
-
* ### **Methods:**
|
|
136
|
-
* - **checkValidity(): _boolean_** - Functions
|
|
137
|
-
* --------------------------------------------------------------------------
|
|
138
|
-
*
|
|
139
|
-
* ### **Slots:**
|
|
140
|
-
* - **description** - Custom HTML description content below the label.
|
|
141
|
-
* - **startButton** - Button at input start. Use single `nys-button` only.
|
|
142
|
-
* - **endButton** - Button at input end. Use single `nys-button` only.
|
|
143
|
-
*/
|
|
144
|
-
export const NysTextinput: React.ForwardRefExoticComponent<NysTextinputProps>;
|
|
@@ -1,83 +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 NysTextinput = forwardRef((props, forwardedRef) => {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const {
|
|
8
|
-
disabled,
|
|
9
|
-
readonly,
|
|
10
|
-
required,
|
|
11
|
-
optional,
|
|
12
|
-
inverted,
|
|
13
|
-
showError,
|
|
14
|
-
id,
|
|
15
|
-
name,
|
|
16
|
-
type,
|
|
17
|
-
label,
|
|
18
|
-
description,
|
|
19
|
-
placeholder,
|
|
20
|
-
value,
|
|
21
|
-
tooltip,
|
|
22
|
-
form,
|
|
23
|
-
pattern,
|
|
24
|
-
maxlength,
|
|
25
|
-
ariaLabel,
|
|
26
|
-
width,
|
|
27
|
-
step,
|
|
28
|
-
min,
|
|
29
|
-
max,
|
|
30
|
-
errorMessage,
|
|
31
|
-
...filteredProps
|
|
32
|
-
} = props;
|
|
33
|
-
|
|
34
|
-
/** Event listeners - run once */
|
|
35
|
-
useEventListener(ref, "nys-input", props.onNysInput);
|
|
36
|
-
useEventListener(ref, "nys-focus", props.onNysFocus);
|
|
37
|
-
useEventListener(ref, "nys-blur", props.onNysBlur);
|
|
38
|
-
|
|
39
|
-
return React.createElement(
|
|
40
|
-
"nys-textinput",
|
|
41
|
-
{
|
|
42
|
-
ref: (node) => {
|
|
43
|
-
ref.current = node;
|
|
44
|
-
if (typeof forwardedRef === "function") {
|
|
45
|
-
forwardedRef(node);
|
|
46
|
-
} else if (forwardedRef) {
|
|
47
|
-
forwardedRef.current = node;
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
...filteredProps,
|
|
51
|
-
id: props.id,
|
|
52
|
-
name: props.name,
|
|
53
|
-
type: props.type,
|
|
54
|
-
label: props.label,
|
|
55
|
-
description: props.description,
|
|
56
|
-
placeholder: props.placeholder,
|
|
57
|
-
value: props.value,
|
|
58
|
-
tooltip: props.tooltip,
|
|
59
|
-
form: props.form,
|
|
60
|
-
pattern: props.pattern,
|
|
61
|
-
maxlength: props.maxlength,
|
|
62
|
-
ariaLabel: props.ariaLabel,
|
|
63
|
-
width: props.width,
|
|
64
|
-
step: props.step,
|
|
65
|
-
min: props.min,
|
|
66
|
-
max: props.max,
|
|
67
|
-
errorMessage: props.errorMessage,
|
|
68
|
-
class: props.className,
|
|
69
|
-
exportparts: props.exportparts,
|
|
70
|
-
for: props.htmlFor,
|
|
71
|
-
part: props.part,
|
|
72
|
-
tabindex: props.tabIndex,
|
|
73
|
-
disabled: props.disabled ? true : undefined,
|
|
74
|
-
readonly: props.readonly ? true : undefined,
|
|
75
|
-
required: props.required ? true : undefined,
|
|
76
|
-
optional: props.optional ? true : undefined,
|
|
77
|
-
inverted: props.inverted ? true : undefined,
|
|
78
|
-
showError: props.showError ? true : undefined,
|
|
79
|
-
style: { ...props.style },
|
|
80
|
-
},
|
|
81
|
-
props.children,
|
|
82
|
-
);
|
|
83
|
-
});
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
NysToggle as NysToggleElement,
|
|
4
|
-
CustomEvent,
|
|
5
|
-
Event,
|
|
6
|
-
} from "../../dist/nysds.es.js";
|
|
7
|
-
|
|
8
|
-
export type { NysToggleElement, CustomEvent, Event };
|
|
9
|
-
|
|
10
|
-
export interface NysToggleProps 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
|
-
/** Whether toggle is on. */
|
|
26
|
-
checked?: boolean;
|
|
27
|
-
|
|
28
|
-
/** Prevents interaction. */
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
|
|
31
|
-
/** Hides check/close icon inside toggle knob. */
|
|
32
|
-
noIcon?: boolean;
|
|
33
|
-
|
|
34
|
-
/** Adjusts colors for dark backgrounds. */
|
|
35
|
-
inverted?: boolean;
|
|
36
|
-
|
|
37
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
38
|
-
id?: NysToggleElement["id"];
|
|
39
|
-
|
|
40
|
-
/** Name for form submission. */
|
|
41
|
-
name?: NysToggleElement["name"];
|
|
42
|
-
|
|
43
|
-
/** Value submitted when toggle is on. */
|
|
44
|
-
value?: NysToggleElement["value"];
|
|
45
|
-
|
|
46
|
-
/** Visible label text. */
|
|
47
|
-
label?: NysToggleElement["label"];
|
|
48
|
-
|
|
49
|
-
/** Helper text below label. Use slot for custom HTML. */
|
|
50
|
-
description?: NysToggleElement["description"];
|
|
51
|
-
|
|
52
|
-
/** Form `id` to associate with. */
|
|
53
|
-
form?: NysToggleElement["form"];
|
|
54
|
-
|
|
55
|
-
/** Toggle size: `sm` or `md` (default). */
|
|
56
|
-
size?: NysToggleElement["size"];
|
|
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
|
-
/** Fired when toggle state changes. Detail: `{id, checked}`. */
|
|
80
|
-
onNysChange?: (event: CustomEvent) => void;
|
|
81
|
-
|
|
82
|
-
/** Fired when toggle gains focus. */
|
|
83
|
-
onNysFocus?: (event: CustomEvent) => void;
|
|
84
|
-
|
|
85
|
-
/** Fired when toggle loses focus. */
|
|
86
|
-
onNysBlur?: (event: CustomEvent) => void;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Toggle switch for binary settings with immediate effect.
|
|
91
|
-
* ---
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* ### **Events:**
|
|
95
|
-
* - **nys-change** - Fired when toggle state changes. Detail: `{id, checked}`.
|
|
96
|
-
* - **nys-focus** - Fired when toggle gains focus.
|
|
97
|
-
* - **nys-blur** - Fired when toggle loses focus.
|
|
98
|
-
*
|
|
99
|
-
* ### **Slots:**
|
|
100
|
-
* - **description** - Custom HTML description content.
|
|
101
|
-
*/
|
|
102
|
-
export const NysToggle: React.ForwardRefExoticComponent<NysToggleProps>;
|
|
@@ -1,59 +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 NysToggle = forwardRef((props, forwardedRef) => {
|
|
6
|
-
const ref = useRef(null);
|
|
7
|
-
const {
|
|
8
|
-
checked,
|
|
9
|
-
disabled,
|
|
10
|
-
noIcon,
|
|
11
|
-
inverted,
|
|
12
|
-
id,
|
|
13
|
-
name,
|
|
14
|
-
value,
|
|
15
|
-
label,
|
|
16
|
-
description,
|
|
17
|
-
form,
|
|
18
|
-
size,
|
|
19
|
-
...filteredProps
|
|
20
|
-
} = props;
|
|
21
|
-
|
|
22
|
-
/** Event listeners - run once */
|
|
23
|
-
useEventListener(ref, "nys-change", props.onNysChange);
|
|
24
|
-
useEventListener(ref, "nys-focus", props.onNysFocus);
|
|
25
|
-
useEventListener(ref, "nys-blur", props.onNysBlur);
|
|
26
|
-
|
|
27
|
-
return React.createElement(
|
|
28
|
-
"nys-toggle",
|
|
29
|
-
{
|
|
30
|
-
ref: (node) => {
|
|
31
|
-
ref.current = node;
|
|
32
|
-
if (typeof forwardedRef === "function") {
|
|
33
|
-
forwardedRef(node);
|
|
34
|
-
} else if (forwardedRef) {
|
|
35
|
-
forwardedRef.current = node;
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
...filteredProps,
|
|
39
|
-
id: props.id,
|
|
40
|
-
name: props.name,
|
|
41
|
-
value: props.value,
|
|
42
|
-
label: props.label,
|
|
43
|
-
description: props.description,
|
|
44
|
-
form: props.form,
|
|
45
|
-
size: props.size,
|
|
46
|
-
class: props.className,
|
|
47
|
-
exportparts: props.exportparts,
|
|
48
|
-
for: props.htmlFor,
|
|
49
|
-
part: props.part,
|
|
50
|
-
tabindex: props.tabIndex,
|
|
51
|
-
checked: props.checked ? true : undefined,
|
|
52
|
-
disabled: props.disabled ? true : undefined,
|
|
53
|
-
noIcon: props.noIcon ? true : undefined,
|
|
54
|
-
inverted: props.inverted ? true : undefined,
|
|
55
|
-
style: { ...props.style },
|
|
56
|
-
},
|
|
57
|
-
props.children,
|
|
58
|
-
);
|
|
59
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysTooltip as NysTooltipElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysTooltipElement };
|
|
5
|
-
|
|
6
|
-
export interface NysTooltipProps extends Pick<
|
|
7
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
-
| "children"
|
|
9
|
-
| "dir"
|
|
10
|
-
| "hidden"
|
|
11
|
-
| "id"
|
|
12
|
-
| "lang"
|
|
13
|
-
| "slot"
|
|
14
|
-
| "style"
|
|
15
|
-
| "title"
|
|
16
|
-
| "translate"
|
|
17
|
-
| "onClick"
|
|
18
|
-
| "onFocus"
|
|
19
|
-
| "onBlur"
|
|
20
|
-
> {
|
|
21
|
-
/** Adjusts colors for dark backgrounds. */
|
|
22
|
-
inverted?: boolean;
|
|
23
|
-
|
|
24
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
25
|
-
id?: NysTooltipElement["id"];
|
|
26
|
-
|
|
27
|
-
/** Tooltip content text. Required. */
|
|
28
|
-
text?: NysTooltipElement["text"];
|
|
29
|
-
|
|
30
|
-
/** ID of the trigger element to attach this tooltip to. Required. */
|
|
31
|
-
for?: NysTooltipElement["for"];
|
|
32
|
-
|
|
33
|
-
/** Preferred position relative to trigger. Auto-adjusts if space is insufficient. */
|
|
34
|
-
position?: NysTooltipElement["position"];
|
|
35
|
-
|
|
36
|
-
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
37
|
-
className?: string;
|
|
38
|
-
|
|
39
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
40
|
-
exportparts?: string;
|
|
41
|
-
|
|
42
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
43
|
-
key?: number | string;
|
|
44
|
-
|
|
45
|
-
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
46
|
-
part?: string;
|
|
47
|
-
|
|
48
|
-
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
49
|
-
ref?: any;
|
|
50
|
-
|
|
51
|
-
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
52
|
-
tabIndex?: number;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Contextual tooltip with auto-positioning, keyboard support, and screen reader integration.
|
|
57
|
-
* ---
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
export const NysTooltip: React.ForwardRefExoticComponent<NysTooltipProps>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export const NysTooltip = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const { inverted, id, text, position, ...filteredProps } = props;
|
|
6
|
-
|
|
7
|
-
return React.createElement(
|
|
8
|
-
"nys-tooltip",
|
|
9
|
-
{
|
|
10
|
-
...filteredProps,
|
|
11
|
-
id: props.id,
|
|
12
|
-
text: props.text,
|
|
13
|
-
for: props.for,
|
|
14
|
-
position: props.position,
|
|
15
|
-
class: props.className,
|
|
16
|
-
exportparts: props.exportparts,
|
|
17
|
-
part: props.part,
|
|
18
|
-
tabindex: props.tabIndex,
|
|
19
|
-
inverted: props.inverted ? true : undefined,
|
|
20
|
-
style: { ...props.style },
|
|
21
|
-
},
|
|
22
|
-
props.children,
|
|
23
|
-
);
|
|
24
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysUnavFooter as NysUnavFooterElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysUnavFooterElement };
|
|
5
|
-
|
|
6
|
-
export interface NysUnavFooterProps extends Pick<
|
|
7
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
-
| "children"
|
|
9
|
-
| "dir"
|
|
10
|
-
| "hidden"
|
|
11
|
-
| "id"
|
|
12
|
-
| "lang"
|
|
13
|
-
| "slot"
|
|
14
|
-
| "style"
|
|
15
|
-
| "title"
|
|
16
|
-
| "translate"
|
|
17
|
-
| "onClick"
|
|
18
|
-
| "onFocus"
|
|
19
|
-
| "onBlur"
|
|
20
|
-
> {
|
|
21
|
-
/** Accessible name for the `contentinfo` landmark this footer renders.
|
|
22
|
-
Defaults to `"New York State"`.
|
|
23
|
-
|
|
24
|
-
A page pairing this footer with `nys-globalfooter` carries two `contentinfo`
|
|
25
|
-
landmarks; distinct names are what keep landmark navigation useful instead of
|
|
26
|
-
announcing "content information" twice. Override only when your wording is
|
|
27
|
-
clearer for your audience — and keep it distinct from the agency footer's
|
|
28
|
-
name, which comes from that footer's visible heading.
|
|
29
|
-
|
|
30
|
-
A blank value falls back to the default rather than leaving the landmark
|
|
31
|
-
unnamed. */
|
|
32
|
-
landmarkLabel?: NysUnavFooterElement["landmarkLabel"];
|
|
33
|
-
|
|
34
|
-
/** 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()`. */
|
|
35
|
-
className?: string;
|
|
36
|
-
|
|
37
|
-
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
38
|
-
exportparts?: string;
|
|
39
|
-
|
|
40
|
-
/** Used for labels to link them with their inputs (using input id). */
|
|
41
|
-
htmlFor?: string;
|
|
42
|
-
|
|
43
|
-
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
44
|
-
key?: number | string;
|
|
45
|
-
|
|
46
|
-
/** 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. */
|
|
47
|
-
part?: string;
|
|
48
|
-
|
|
49
|
-
/** 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. */
|
|
50
|
-
ref?: any;
|
|
51
|
-
|
|
52
|
-
/** 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. */
|
|
53
|
-
tabIndex?: number;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Universal NYS footer with logo and statewide links. Required site-wide.
|
|
58
|
-
* ---
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
export const NysUnavFooter: React.ForwardRefExoticComponent<NysUnavFooterProps>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
|
-
import "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export const NysUnavFooter = forwardRef((props, forwardedRef) => {
|
|
5
|
-
const { landmarkLabel, ...filteredProps } = props;
|
|
6
|
-
|
|
7
|
-
return React.createElement(
|
|
8
|
-
"nys-unavfooter",
|
|
9
|
-
{
|
|
10
|
-
...filteredProps,
|
|
11
|
-
landmarkLabel: props.landmarkLabel,
|
|
12
|
-
class: props.className,
|
|
13
|
-
exportparts: props.exportparts,
|
|
14
|
-
for: props.htmlFor,
|
|
15
|
-
part: props.part,
|
|
16
|
-
tabindex: props.tabIndex,
|
|
17
|
-
style: { ...props.style },
|
|
18
|
-
},
|
|
19
|
-
props.children,
|
|
20
|
-
);
|
|
21
|
-
});
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NysUnavHeader as NysUnavHeaderElement } from "../../dist/nysds.es.js";
|
|
3
|
-
|
|
4
|
-
export type { NysUnavHeaderElement };
|
|
5
|
-
|
|
6
|
-
export interface NysUnavHeaderProps extends Pick<
|
|
7
|
-
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
-
| "children"
|
|
9
|
-
| "dir"
|
|
10
|
-
| "hidden"
|
|
11
|
-
| "id"
|
|
12
|
-
| "lang"
|
|
13
|
-
| "slot"
|
|
14
|
-
| "style"
|
|
15
|
-
| "title"
|
|
16
|
-
| "translate"
|
|
17
|
-
| "onClick"
|
|
18
|
-
| "onFocus"
|
|
19
|
-
| "onBlur"
|
|
20
|
-
> {
|
|
21
|
-
/** Internal: Whether trust bar panel is expanded. */
|
|
22
|
-
trustbarVisible?: boolean;
|
|
23
|
-
|
|
24
|
-
/** Internal: Whether search dropdown is visible (mobile). */
|
|
25
|
-
searchDropdownVisible?: boolean;
|
|
26
|
-
|
|
27
|
-
/** Internal: Whether language dropdown is visible. */
|
|
28
|
-
languageVisible?: boolean;
|
|
29
|
-
|
|
30
|
-
/** Internal: Whether search input is focused. */
|
|
31
|
-
isSearchFocused?: boolean;
|
|
32
|
-
|
|
33
|
-
/** Hides the translation dropdown. */
|
|
34
|
-
hideTranslate?: boolean;
|
|
35
|
-
|
|
36
|
-
/** Hides the search functionality. */
|
|
37
|
-
hideSearch?: boolean;
|
|
38
|
-
|
|
39
|
-
/** The URL endpoint of the search, make sure to include the query param. */
|
|
40
|
-
searchUrl?: NysUnavHeaderElement["searchUrl"];
|
|
41
|
-
|
|
42
|
-
/** Accessible name for the `banner` landmark this header renders.
|
|
43
|
-
Defaults to `"New York State"`.
|
|
44
|
-
|
|
45
|
-
A page pairing this header with `nys-globalheader` carries two `banner`
|
|
46
|
-
landmarks; distinct names are what keep landmark navigation useful instead of
|
|
47
|
-
announcing "banner, banner". Override only when your wording is clearer for
|
|
48
|
-
your audience — and keep it distinct from the agency header's name, which
|
|
49
|
-
comes from that header's visible title.
|
|
50
|
-
|
|
51
|
-
A blank value falls back to the default rather than leaving the landmark
|
|
52
|
-
unnamed. */
|
|
53
|
-
landmarkLabel?: NysUnavHeaderElement["landmarkLabel"];
|
|
54
|
-
|
|
55
|
-
/** The list of languages this site can be translated to, default to use Smartling */
|
|
56
|
-
languages?: NysUnavHeaderElement["languages"];
|
|
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
|
-
/** Fired when a language is selected. Detail: `{language: {code, label, url?}}`. Cancelable; `preventDefault()` overrides the default Smartling redirect. */
|
|
80
|
-
onNysLanguageSelect?: (event: CustomEvent) => void;
|
|
81
|
-
|
|
82
|
-
/** Fired when a search is submitted. Detail: `{query}`. Cancelable; `preventDefault()` overrides the default search redirect. */
|
|
83
|
-
onNysSearchSubmit?: (event: CustomEvent) => void;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Universal NYS header with trust bar, search, and translation. Required site-wide.
|
|
88
|
-
* ---
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* ### **Events:**
|
|
92
|
-
* - **nys-language-select** - Fired when a language is selected. Detail: `{language: {code, label, url?}}`. Cancelable; `preventDefault()` overrides the default Smartling redirect.
|
|
93
|
-
* - **nys-search-submit** - Fired when a search is submitted. Detail: `{query}`. Cancelable; `preventDefault()` overrides the default search redirect.
|
|
94
|
-
*/
|
|
95
|
-
export const NysUnavHeader: React.ForwardRefExoticComponent<NysUnavHeaderProps>;
|