@nysds/components 1.16.0-alpha-2 → 1.16.0-alpha3
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 +45 -4
- package/dist/.vscode/vscode.html-custom-data.json +1 -1
- package/dist/custom-elements.json +45 -4
- package/dist/nysds.es.js +772 -721
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +37 -37
- package/dist/nysds.js.map +1 -1
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +4 -2
- package/dist/packages/nys-table/src/nys-table.d.ts +12 -1
- package/dist/packages/react/nysds-jsx.d.ts +1411 -0
- package/package.json +19 -14
- package/packages/react/NysTable.d.ts +4 -0
- package/packages/react/NysTable.js +1 -0
- package/packages/react/README.md +10 -10
- package/packages/react/index.d.ts +9 -9
- package/packages/react/index.js +9 -9
- package/packages/react/nysds-jsx.d.ts +1428 -0
- package/packages/react/react-utils.js +19 -13
|
@@ -0,0 +1,1428 @@
|
|
|
1
|
+
import type { NysAccordion } from "NysAccordion";
|
|
2
|
+
import type { NysAccordionItem, CustomEvent } from "NysAccordionItem";
|
|
3
|
+
import type { NysAlert, CustomEvent } from "NysAlert";
|
|
4
|
+
import type { NysAvatar } from "NysAvatar";
|
|
5
|
+
import type { NysBacktotop } from "NysBacktotop";
|
|
6
|
+
import type { NysBadge } from "NysBadge";
|
|
7
|
+
import type { NysButton, Event } from "NysButton";
|
|
8
|
+
import type { NysCheckbox, CustomEvent, Event } from "NysCheckbox";
|
|
9
|
+
import type { NysCheckboxgroup } from "NysCheckboxgroup";
|
|
10
|
+
import type { NysCombobox, CustomEvent, Event } from "NysCombobox";
|
|
11
|
+
import type { NysDatepicker, CustomEvent, Event } from "NysDatepicker";
|
|
12
|
+
import type { NysDivider } from "NysDivider";
|
|
13
|
+
import type { NysDropdownMenu } from "NysDropdownMenu";
|
|
14
|
+
import type { NysDropdownMenuItem, CustomEvent } from "NysDropdownMenuItem";
|
|
15
|
+
import type { NysErrorMessage } from "NysErrorMessage";
|
|
16
|
+
import type { NysFileinput, CustomEvent } from "NysFileinput";
|
|
17
|
+
import type { NysFileItem, CustomEvent } from "NysFileItem";
|
|
18
|
+
import type { NysGlobalFooter } from "NysGlobalFooter";
|
|
19
|
+
import type { NysGlobalHeader } from "NysGlobalHeader";
|
|
20
|
+
import type { NysIcon } from "NysIcon";
|
|
21
|
+
import type { NysLabel } from "NysLabel";
|
|
22
|
+
import type { NysModal, CustomEvent } from "NysModal";
|
|
23
|
+
import type { NysPagination, CustomEvent } from "NysPagination";
|
|
24
|
+
import type { NysRadiobutton, CustomEvent, Event } from "NysRadiobutton";
|
|
25
|
+
import type { NysRadiogroup } from "NysRadiogroup";
|
|
26
|
+
import type { NysOption } from "NysOption";
|
|
27
|
+
import type { NysSelect, CustomEvent, Event } from "NysSelect";
|
|
28
|
+
import type { NysSkipnav } from "NysSkipnav";
|
|
29
|
+
import type { NysStep } from "NysStep";
|
|
30
|
+
import type { NysStepper } from "NysStepper";
|
|
31
|
+
import type { NysTable } from "NysTable";
|
|
32
|
+
import type { NysTextarea, CustomEvent, Event } from "NysTextarea";
|
|
33
|
+
import type { NysTextinput, CustomEvent, Event } from "NysTextinput";
|
|
34
|
+
import type { NysToggle, CustomEvent, Event } from "NysToggle";
|
|
35
|
+
import type { NysTooltip } from "NysTooltip";
|
|
36
|
+
import type { NysUnavFooter } from "NysUnavFooter";
|
|
37
|
+
import type { NysUnavHeader } from "NysUnavHeader";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* This type can be used to create scoped tags for your components.
|
|
41
|
+
*
|
|
42
|
+
* Usage:
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* import type { ScopedElements } from "path/to/library/jsx-integration";
|
|
46
|
+
*
|
|
47
|
+
* declare module "my-library" {
|
|
48
|
+
* namespace JSX {
|
|
49
|
+
* interface IntrinsicElements
|
|
50
|
+
* extends ScopedElements<'test-', ''> {}
|
|
51
|
+
* }
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export type ScopedElements<Prefix extends string = "", Suffix extends string = ""> = {
|
|
57
|
+
[Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type BaseProps = {
|
|
61
|
+
/** Content added between the opening and closing tags of the element */
|
|
62
|
+
children?: any;
|
|
63
|
+
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
64
|
+
class?: string;
|
|
65
|
+
/** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
|
|
66
|
+
className?: string;
|
|
67
|
+
/** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
|
|
68
|
+
classList?: Record<string, boolean | undefined>;
|
|
69
|
+
/** Specifies the text direction of the element. */
|
|
70
|
+
dir?: "ltr" | "rtl";
|
|
71
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
72
|
+
exportparts?: string;
|
|
73
|
+
/** For <label> and <output>, lets you associate the label with some control. */
|
|
74
|
+
htmlFor?: string;
|
|
75
|
+
/** Specifies whether the element should be hidden. */
|
|
76
|
+
hidden?: boolean | string;
|
|
77
|
+
/** A unique identifier for the element. */
|
|
78
|
+
id?: string;
|
|
79
|
+
/** Keys tell React which array item each component corresponds to */
|
|
80
|
+
key?: string | number;
|
|
81
|
+
/** Specifies the language of the element. */
|
|
82
|
+
lang?: string;
|
|
83
|
+
/** 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. */
|
|
84
|
+
part?: string;
|
|
85
|
+
/** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
|
|
86
|
+
ref?: unknown | ((e: unknown) => void);
|
|
87
|
+
/** Adds a reference for a custom element slot */
|
|
88
|
+
slot?: string;
|
|
89
|
+
/** Prop for setting inline styles */
|
|
90
|
+
style?: Record<string, string | number>;
|
|
91
|
+
/** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
|
|
92
|
+
tabIndex?: number;
|
|
93
|
+
/** Specifies the tooltip text for the element. */
|
|
94
|
+
title?: string;
|
|
95
|
+
/** Passing 'no' excludes the element content from being translated. */
|
|
96
|
+
translate?: "yes" | "no";
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
type BaseEvents = {};
|
|
100
|
+
|
|
101
|
+
export type NysAccordionProps = {
|
|
102
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
103
|
+
id?: NysAccordion["id"];
|
|
104
|
+
/** Only one item can be expanded at a time. Expanding one collapses others. */
|
|
105
|
+
singleSelect?: NysAccordion["singleSelect"];
|
|
106
|
+
/** Adds borders around each accordion item. Propagates to all children. */
|
|
107
|
+
bordered?: NysAccordion["bordered"];
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export type NysAccordionItemProps = {
|
|
111
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
112
|
+
id?: NysAccordionItem["id"];
|
|
113
|
+
/** Heading text displayed in the clickable toggle button. */
|
|
114
|
+
heading?: NysAccordionItem["heading"];
|
|
115
|
+
/** Whether the content panel is visible. Toggle via click or keyboard. */
|
|
116
|
+
expanded?: NysAccordionItem["expanded"];
|
|
117
|
+
/** Adds border styling. Set by parent `nys-accordion`, not directly. */
|
|
118
|
+
bordered?: NysAccordionItem["bordered"];
|
|
119
|
+
|
|
120
|
+
/** Fired when expanded state changes. Detail: `{id, heading, expanded}`. */
|
|
121
|
+
"onnys-accordionitem-toggle"?: (e: CustomEvent<CustomEvent>) => void;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export type NysAlertProps = {
|
|
125
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
126
|
+
id?: NysAlert["id"];
|
|
127
|
+
/** Bold heading text displayed at the top of the alert. */
|
|
128
|
+
heading?: NysAlert["heading"];
|
|
129
|
+
/** Custom icon name. Defaults to type-appropriate icon if not set. */
|
|
130
|
+
icon?: NysAlert["icon"];
|
|
131
|
+
/** Shows close button allowing users to dismiss the alert. */
|
|
132
|
+
dismissible?: NysAlert["dismissible"];
|
|
133
|
+
/** Auto-dismiss after specified milliseconds. Set to 0 to disable. */
|
|
134
|
+
duration?: NysAlert["duration"];
|
|
135
|
+
/** Body text content. Ignored if slot content is provided. */
|
|
136
|
+
text?: NysAlert["text"];
|
|
137
|
+
/** URL for the primary action link. */
|
|
138
|
+
primaryAction?: NysAlert["primaryAction"];
|
|
139
|
+
/** URL for the secondary action link. */
|
|
140
|
+
secondaryAction?: NysAlert["secondaryAction"];
|
|
141
|
+
/** Label text for primary action link. */
|
|
142
|
+
primaryLabel?: NysAlert["primaryLabel"];
|
|
143
|
+
/** Label text for secondary action link. */
|
|
144
|
+
secondaryLabel?: NysAlert["secondaryLabel"];
|
|
145
|
+
/** Semantic alert type affecting color and ARIA role. `danger`/`emergency` use assertive live region. */
|
|
146
|
+
type?: NysAlert["type"];
|
|
147
|
+
/** Returns ARIA role and label based on alert type.
|
|
148
|
+
- 'alert' => assertive live region (implied)
|
|
149
|
+
- 'status' => polite live region
|
|
150
|
+
- 'region' => generic, requires aria-label */
|
|
151
|
+
ariaAttributes?: NysAlert["ariaAttributes"];
|
|
152
|
+
/** Returns live-region type for screen readers if applicable.
|
|
153
|
+
- 'polite' for status role
|
|
154
|
+
- undefined for alert (since it's implicitly assertive) or region */
|
|
155
|
+
liveRegion?: NysAlert["liveRegion"];
|
|
156
|
+
/** Fired when alert is dismissed. Detail: `{id, type, label}`. */
|
|
157
|
+
"onnys-close"?: (e: CustomEvent<CustomEvent>) => void;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type NysAvatarProps = {
|
|
161
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
162
|
+
id?: NysAvatar["id"];
|
|
163
|
+
/** Accessible label for screen readers. Required when no image `alt` is available. */
|
|
164
|
+
ariaLabel?: NysAvatar["ariaLabel"];
|
|
165
|
+
/** Image URL. Takes priority over initials and icon. */
|
|
166
|
+
image?: NysAvatar["image"];
|
|
167
|
+
/** 1-2 character initials. Used when no image is provided. */
|
|
168
|
+
initials?: NysAvatar["initials"];
|
|
169
|
+
/** Custom icon name. Falls back to `account_circle` if not set. */
|
|
170
|
+
icon?: NysAvatar["icon"];
|
|
171
|
+
/** Background color. Foreground auto-adjusts for contrast. Accepts CSS values or variables. */
|
|
172
|
+
color?: NysAvatar["color"];
|
|
173
|
+
/** Makes avatar clickable with button role and focus ring. */
|
|
174
|
+
interactive?: NysAvatar["interactive"];
|
|
175
|
+
/** Prevents interaction when `interactive` is true. */
|
|
176
|
+
disabled?: NysAvatar["disabled"];
|
|
177
|
+
/** Enables lazy loading for the image. */
|
|
178
|
+
lazy?: NysAvatar["lazy"];
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export type NysBacktotopProps = {
|
|
182
|
+
/** Horizontal position: `left` or `right`. */
|
|
183
|
+
position?: NysBacktotop["position"];
|
|
184
|
+
/** Force button visibility. Overrides auto-show scroll behavior. */
|
|
185
|
+
visible?: NysBacktotop["visible"];
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export type NysBadgeProps = {
|
|
189
|
+
/** Unique identifier. */
|
|
190
|
+
id?: NysBadge["id"];
|
|
191
|
+
/** Name attribute for form association. */
|
|
192
|
+
name?: NysBadge["name"];
|
|
193
|
+
/** Badge size: `sm` (smaller text) or `md` (default). */
|
|
194
|
+
size?: NysBadge["size"];
|
|
195
|
+
/** Semantic intent affecting color: `neutral`, `error`, `success`, or `warning`. */
|
|
196
|
+
intent?: NysBadge["intent"];
|
|
197
|
+
/** Secondary label displayed before the main label. */
|
|
198
|
+
prefixLabel?: NysBadge["prefixLabel"];
|
|
199
|
+
/** Primary label text displayed in the badge. */
|
|
200
|
+
label?: NysBadge["label"];
|
|
201
|
+
/** */
|
|
202
|
+
variant?: NysBadge["variant"];
|
|
203
|
+
/** */
|
|
204
|
+
prefixicon?: NysBadge["prefixIcon"];
|
|
205
|
+
/** */
|
|
206
|
+
suffixicon?: NysBadge["suffixIcon"];
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export type NysButtonProps = {
|
|
210
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
211
|
+
id?: NysButton["id"];
|
|
212
|
+
/** Name for form submission. */
|
|
213
|
+
name?: NysButton["name"];
|
|
214
|
+
/** Button height: `sm` (40px) for dense UIs, `md` (48px, default) for standard use, `lg` (56px) for prominent CTAs. */
|
|
215
|
+
size?: NysButton["size"];
|
|
216
|
+
/** Expands button to fill container width. Use for mobile layouts or stacked button groups. */
|
|
217
|
+
fullWidth?: NysButton["fullWidth"];
|
|
218
|
+
/** Visual style: `filled` for primary (one per section), `outline` for secondary, `ghost` for tertiary, `text` for inline actions. Avoid `text` for navigation. */
|
|
219
|
+
variant?: NysButton["variant"];
|
|
220
|
+
/** Adjusts colors for dark backgrounds. */
|
|
221
|
+
inverted?: NysButton["inverted"];
|
|
222
|
+
/** Visible button text. Use sentence case, action-oriented text (e.g., "Save Draft"). Becomes aria-label in `circle` mode. */
|
|
223
|
+
label?: NysButton["label"];
|
|
224
|
+
/** Screen reader label. Required for icon-only buttons if `label` is not set. */
|
|
225
|
+
ariaLabel?: NysButton["ariaLabel"];
|
|
226
|
+
/** ID of controlled element (e.g., dropdown or modal). Sets `aria-controls`. */
|
|
227
|
+
ariaControls?: NysButton["ariaControls"];
|
|
228
|
+
/** Material Symbol icon before label. Not shown for `text` variant or `circle` mode. */
|
|
229
|
+
prefixIcon?: NysButton["prefixIcon"];
|
|
230
|
+
/** Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `text` variant or `circle` mode. */
|
|
231
|
+
suffixIcon?: NysButton["suffixIcon"];
|
|
232
|
+
/** Renders circular icon-only button. Requires `icon` prop. `label` becomes aria-label. */
|
|
233
|
+
circle?: NysButton["circle"];
|
|
234
|
+
/** Icon for circle mode. Required when `circle` is true. Scales with size (sm=24px, md=32px, lg=40px). */
|
|
235
|
+
icon?: NysButton["icon"];
|
|
236
|
+
/** Prevents interaction. Avoid disabling without explanation—show validation errors instead. */
|
|
237
|
+
disabled?: NysButton["disabled"];
|
|
238
|
+
/** Form `id` to associate with. Use when button is outside the form element. */
|
|
239
|
+
form?: NysButton["form"];
|
|
240
|
+
/** Value submitted with form data. Only used when `type="submit"`. */
|
|
241
|
+
value?: NysButton["value"];
|
|
242
|
+
/** Additional screen reader description. Sets `aria-description`. */
|
|
243
|
+
ariaDescription?: NysButton["ariaDescription"];
|
|
244
|
+
/** Form behavior: `button` (default, no form action), `submit` (submits form), `reset` (resets form). Always set explicitly to avoid unintended submissions. */
|
|
245
|
+
type?: NysButton["type"];
|
|
246
|
+
/** URL to navigate to. Renders as `<a>` tag. Omit for action buttons. */
|
|
247
|
+
href?: NysButton["href"];
|
|
248
|
+
/** Link target: `_self` (same tab), `_blank` (new tab—add `suffixIcon="open_in_new"`), `_parent`, `_top`, or frame name. */
|
|
249
|
+
target?: NysButton["target"];
|
|
250
|
+
/** Click handler. Use instead of `@click` to ensure keyboard accessibility. */
|
|
251
|
+
onClick?: NysButton["onClick"];
|
|
252
|
+
/** Fired when the button receives focus. */
|
|
253
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
254
|
+
/** Fired when the button loses focus. */
|
|
255
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
256
|
+
/** Fired when the button is clicked (mouse or keyboard). Not fired when disabled. */
|
|
257
|
+
"onnys-click"?: (e: CustomEvent<Event>) => void;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export type NysCheckboxProps = {
|
|
261
|
+
/** Whether checkbox is checked. */
|
|
262
|
+
checked?: NysCheckbox["checked"];
|
|
263
|
+
/** Prevents interaction. */
|
|
264
|
+
disabled?: NysCheckbox["disabled"];
|
|
265
|
+
/** Marks as required. Validates that checkbox is checked. */
|
|
266
|
+
required?: NysCheckbox["required"];
|
|
267
|
+
/** Visible label text. Required for accessibility. */
|
|
268
|
+
label?: NysCheckbox["label"];
|
|
269
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
270
|
+
description?: NysCheckbox["description"];
|
|
271
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
272
|
+
id?: NysCheckbox["id"];
|
|
273
|
+
/** Name for form submission. Use same name for grouped checkboxes. */
|
|
274
|
+
name?: NysCheckbox["name"];
|
|
275
|
+
/** Value submitted when checked. */
|
|
276
|
+
value?: NysCheckbox["value"];
|
|
277
|
+
/** Form `id` to associate with when checkbox is outside form element. */
|
|
278
|
+
form?: NysCheckbox["form"];
|
|
279
|
+
/** Shows error message when true. */
|
|
280
|
+
showError?: NysCheckbox["showError"];
|
|
281
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
282
|
+
errorMessage?: NysCheckbox["errorMessage"];
|
|
283
|
+
/** Internal: Set by parent checkboxgroup. Do not set manually. */
|
|
284
|
+
groupExist?: NysCheckbox["groupExist"];
|
|
285
|
+
/** Renders as tile with larger clickable area. Apply to group for consistency. */
|
|
286
|
+
tile?: NysCheckbox["tile"];
|
|
287
|
+
/** Adjusts colors for dark backgrounds. */
|
|
288
|
+
inverted?: NysCheckbox["inverted"];
|
|
289
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
290
|
+
tooltip?: NysCheckbox["tooltip"];
|
|
291
|
+
/** Checkbox size: `sm` (24px) or `md` (32px, default). */
|
|
292
|
+
size?: NysCheckbox["size"];
|
|
293
|
+
/** */
|
|
294
|
+
other?: NysCheckbox["other"];
|
|
295
|
+
/** */
|
|
296
|
+
showOtherError?: NysCheckbox["showOtherError"];
|
|
297
|
+
/** */
|
|
298
|
+
_hasDescription?: NysCheckbox["_hasDescription"];
|
|
299
|
+
/** Fired when checked state changes. Detail: `{id, checked, name, value}`. */
|
|
300
|
+
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
301
|
+
/** Fired when "other" text input value changes. Detail: `{id, name, value}`. */
|
|
302
|
+
"onnys-other-input"?: (e: CustomEvent<CustomEvent>) => void;
|
|
303
|
+
/** Fired when checkbox gains focus. */
|
|
304
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
305
|
+
/** Fired when checkbox loses focus. */
|
|
306
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
307
|
+
/** */
|
|
308
|
+
"onnys-error"?: (e: CustomEvent<CustomEvent>) => void;
|
|
309
|
+
/** */
|
|
310
|
+
"onnys-error-clear"?: (e: CustomEvent<CustomEvent>) => void;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
export type NysCheckboxgroupProps = {
|
|
314
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
315
|
+
id?: NysCheckboxgroup["id"];
|
|
316
|
+
/** Name for form submission. Set on group, not individual checkboxes. */
|
|
317
|
+
name?: NysCheckboxgroup["name"];
|
|
318
|
+
/** Requires at least one checkbox to be checked. */
|
|
319
|
+
required?: NysCheckboxgroup["required"];
|
|
320
|
+
/** Shows "Optional" flag. */
|
|
321
|
+
optional?: NysCheckboxgroup["optional"];
|
|
322
|
+
/** Shows error message when true. */
|
|
323
|
+
showError?: NysCheckboxgroup["showError"];
|
|
324
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
325
|
+
errorMessage?: NysCheckboxgroup["errorMessage"];
|
|
326
|
+
/** Visible label text for the group. */
|
|
327
|
+
label?: NysCheckboxgroup["label"];
|
|
328
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
329
|
+
description?: NysCheckboxgroup["description"];
|
|
330
|
+
/** Renders all checkboxes as tiles with larger clickable area. */
|
|
331
|
+
tile?: NysCheckboxgroup["tile"];
|
|
332
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
333
|
+
tooltip?: NysCheckboxgroup["tooltip"];
|
|
334
|
+
/** Adjusts colors for dark backgrounds. Applied to all children. */
|
|
335
|
+
inverted?: NysCheckboxgroup["inverted"];
|
|
336
|
+
/** Form `id` to associate with. Applied to all children. */
|
|
337
|
+
form?: NysCheckboxgroup["form"];
|
|
338
|
+
/** Checkbox size for all children: `sm` (24px) or `md` (32px, default). */
|
|
339
|
+
size?: NysCheckboxgroup["size"];
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
export type NysComboboxProps = {
|
|
343
|
+
/** */
|
|
344
|
+
id?: NysCombobox["id"];
|
|
345
|
+
/** */
|
|
346
|
+
name?: NysCombobox["name"];
|
|
347
|
+
/** */
|
|
348
|
+
label?: NysCombobox["label"];
|
|
349
|
+
/** */
|
|
350
|
+
description?: NysCombobox["description"];
|
|
351
|
+
/** */
|
|
352
|
+
value?: NysCombobox["value"];
|
|
353
|
+
/** */
|
|
354
|
+
disabled?: NysCombobox["disabled"];
|
|
355
|
+
/** */
|
|
356
|
+
required?: NysCombobox["required"];
|
|
357
|
+
/** */
|
|
358
|
+
optional?: NysCombobox["optional"];
|
|
359
|
+
/** */
|
|
360
|
+
tooltip?: NysCombobox["tooltip"];
|
|
361
|
+
/** */
|
|
362
|
+
form?: NysCombobox["form"];
|
|
363
|
+
/** */
|
|
364
|
+
width?: NysCombobox["width"];
|
|
365
|
+
/** */
|
|
366
|
+
inverted?: NysCombobox["inverted"];
|
|
367
|
+
/** */
|
|
368
|
+
showError?: NysCombobox["showError"];
|
|
369
|
+
/** */
|
|
370
|
+
errorMessage?: NysCombobox["errorMessage"];
|
|
371
|
+
|
|
372
|
+
/** Fired on input change. Detail: `{ id, value }`. */
|
|
373
|
+
"onnys-input"?: (e: CustomEvent<CustomEvent>) => void;
|
|
374
|
+
/** Fired when combobox receives focus. */
|
|
375
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
376
|
+
/** Fired when combobox loses focus. */
|
|
377
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
378
|
+
/** Fired when selection changes. Detail: `{ id, value }`. */
|
|
379
|
+
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
export type NysDatepickerProps = {
|
|
383
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
384
|
+
id?: NysDatepicker["id"];
|
|
385
|
+
/** Name for form submission. */
|
|
386
|
+
name?: NysDatepicker["name"];
|
|
387
|
+
/** Input width: `md` (200px), `lg` (384px), `full` (100%). */
|
|
388
|
+
width?: NysDatepicker["width"];
|
|
389
|
+
/** Hide the "Today" button in calendar popup. */
|
|
390
|
+
hideTodayButton?: NysDatepicker["hideTodayButton"];
|
|
391
|
+
/** Hide the "Clear" button in calendar popup. */
|
|
392
|
+
hideClearButton?: NysDatepicker["hideClearButton"];
|
|
393
|
+
/** Disable interaction. */
|
|
394
|
+
disabled?: NysDatepicker["disabled"];
|
|
395
|
+
/** Mark as required. Shows "Required" flag and validates on blur. */
|
|
396
|
+
required?: NysDatepicker["required"];
|
|
397
|
+
/** Show "Optional" flag. Use when most fields are required. */
|
|
398
|
+
optional?: NysDatepicker["optional"];
|
|
399
|
+
/** Show error state. */
|
|
400
|
+
showError?: NysDatepicker["showError"];
|
|
401
|
+
/** Error message text. */
|
|
402
|
+
errorMessage?: NysDatepicker["errorMessage"];
|
|
403
|
+
/** Form `id` to associate with when input is outside form. */
|
|
404
|
+
form?: NysDatepicker["form"];
|
|
405
|
+
/** Tooltip text on info icon hover. */
|
|
406
|
+
tooltip?: NysDatepicker["tooltip"];
|
|
407
|
+
/** Input type. Currently only supports `date`. */
|
|
408
|
+
type?: NysDatepicker["type"];
|
|
409
|
+
/** Label text. Required for accessibility. */
|
|
410
|
+
label?: NysDatepicker["label"];
|
|
411
|
+
/** Helper text below label. */
|
|
412
|
+
description?: NysDatepicker["description"];
|
|
413
|
+
/** Initial date when calendar opens (YYYY-MM-DD). */
|
|
414
|
+
startDate?: NysDatepicker["startDate"];
|
|
415
|
+
/** Dark background mode. */
|
|
416
|
+
inverted?: NysDatepicker["inverted"];
|
|
417
|
+
/** Selected date. Accepts Date object or ISO string (YYYY-MM-DD). */
|
|
418
|
+
value?: NysDatepicker["value"];
|
|
419
|
+
|
|
420
|
+
/** Fired on date selection. Detail: `{id, value}`. */
|
|
421
|
+
"onnys-input"?: (e: CustomEvent<CustomEvent>) => void;
|
|
422
|
+
/** Fired when input or calendar loses focus. Triggers validation. */
|
|
423
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export type NysDividerProps = {
|
|
427
|
+
/** Adjusts colors for dark backgrounds. */
|
|
428
|
+
inverted?: NysDivider["inverted"];
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
export type NysDropdownMenuProps = {
|
|
432
|
+
/** */
|
|
433
|
+
for?: NysDropdownMenu["for"];
|
|
434
|
+
/** */
|
|
435
|
+
showDropdown?: NysDropdownMenu["showDropdown"];
|
|
436
|
+
/** Preferred position relative to trigger. */
|
|
437
|
+
position?: NysDropdownMenu["position"];
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
export type NysDropdownMenuItemProps = {
|
|
441
|
+
/** */
|
|
442
|
+
label?: NysDropdownMenuItem["label"];
|
|
443
|
+
/** */
|
|
444
|
+
href?: NysDropdownMenuItem["href"];
|
|
445
|
+
/** */
|
|
446
|
+
disabled?: NysDropdownMenuItem["disabled"];
|
|
447
|
+
/** */
|
|
448
|
+
target?: NysDropdownMenuItem["target"];
|
|
449
|
+
/** */
|
|
450
|
+
prefixIcon?: NysDropdownMenuItem["prefixIcon"];
|
|
451
|
+
/** */
|
|
452
|
+
divider?: NysDropdownMenuItem["divider"];
|
|
453
|
+
|
|
454
|
+
/** */
|
|
455
|
+
"onnys-click"?: (e: CustomEvent<CustomEvent>) => void;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export type NysErrorMessageProps = {
|
|
459
|
+
/** Whether to display the error message. */
|
|
460
|
+
showError?: NysErrorMessage["showError"];
|
|
461
|
+
/** Error text to display. Falls back to native validation message if available. */
|
|
462
|
+
errorMessage?: NysErrorMessage["errorMessage"];
|
|
463
|
+
/** Shows a divider line above the error message. */
|
|
464
|
+
showDivider?: NysErrorMessage["showDivider"];
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
export type NysFileinputProps = {
|
|
468
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
469
|
+
id?: NysFileinput["id"];
|
|
470
|
+
/** Name for form submission. */
|
|
471
|
+
name?: NysFileinput["name"];
|
|
472
|
+
/** Visible label text. */
|
|
473
|
+
label?: NysFileinput["label"];
|
|
474
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
475
|
+
description?: NysFileinput["description"];
|
|
476
|
+
/** Allows selecting multiple files. */
|
|
477
|
+
multiple?: NysFileinput["multiple"];
|
|
478
|
+
/** Form `id` to associate with. */
|
|
479
|
+
form?: NysFileinput["form"];
|
|
480
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
481
|
+
tooltip?: NysFileinput["tooltip"];
|
|
482
|
+
/** Accepted file types. Use MIME types (`image/*`) or extensions (`.pdf`). Validated via magic bytes. */
|
|
483
|
+
accept?: NysFileinput["accept"];
|
|
484
|
+
/** Prevents interaction. */
|
|
485
|
+
disabled?: NysFileinput["disabled"];
|
|
486
|
+
/** Requires at least one file to be uploaded. */
|
|
487
|
+
required?: NysFileinput["required"];
|
|
488
|
+
/** Shows "Optional" flag. */
|
|
489
|
+
optional?: NysFileinput["optional"];
|
|
490
|
+
/** Shows error message when true. */
|
|
491
|
+
showError?: NysFileinput["showError"];
|
|
492
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
493
|
+
errorMessage?: NysFileinput["errorMessage"];
|
|
494
|
+
/** Enables drag-and-drop zone UI. */
|
|
495
|
+
dropzone?: NysFileinput["dropzone"];
|
|
496
|
+
/** Component width: `lg` (384px) or `full` (100%, default). */
|
|
497
|
+
width?: NysFileinput["width"];
|
|
498
|
+
/** Adjusts colors for dark backgrounds. */
|
|
499
|
+
inverted?: NysFileinput["inverted"];
|
|
500
|
+
|
|
501
|
+
/** Fired when files are added or removed. Detail: `{id, files}`. */
|
|
502
|
+
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
export type NysFileItemProps = {
|
|
506
|
+
/** Name of the file being displayed. */
|
|
507
|
+
filename?: NysFileItem["filename"];
|
|
508
|
+
/** Upload status: `pending` (queued), `processing` (uploading), `done` (complete), `error` (failed). */
|
|
509
|
+
status?: NysFileItem["status"];
|
|
510
|
+
/** Upload progress percentage (0-100). Only shown when status is `processing`. */
|
|
511
|
+
progress?: NysFileItem["progress"];
|
|
512
|
+
/** Error message displayed when status is `error`. */
|
|
513
|
+
errorMessage?: NysFileItem["errorMessage"];
|
|
514
|
+
|
|
515
|
+
/** Fired when remove button is clicked. Detail: `{filename}`. */
|
|
516
|
+
"onnys-fileRemove"?: (e: CustomEvent<CustomEvent>) => void;
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
export type NysGlobalFooterProps = {
|
|
520
|
+
/** Agency name displayed as the footer heading. */
|
|
521
|
+
agencyName?: NysGlobalFooter["agencyName"];
|
|
522
|
+
/** URL for the agency name link. If empty, name is not clickable. */
|
|
523
|
+
homepageLink?: NysGlobalFooter["homepageLink"];
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
export type NysGlobalHeaderProps = {
|
|
527
|
+
/** Application name displayed prominently. */
|
|
528
|
+
appName?: NysGlobalHeader["appName"];
|
|
529
|
+
/** Agency name displayed below app name (or as main title if no appName). */
|
|
530
|
+
agencyName?: NysGlobalHeader["agencyName"];
|
|
531
|
+
/** URL for the header title link. If empty, title is not clickable. */
|
|
532
|
+
homepageLink?: NysGlobalHeader["homepageLink"];
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
export type NysIconProps = {
|
|
536
|
+
/** Icon name from Material Symbols library. Required. */
|
|
537
|
+
name?: NysIcon["name"];
|
|
538
|
+
/** Accessible label. When set, removes `aria-hidden` and adds `aria-label` to the SVG. */
|
|
539
|
+
ariaLabel?: NysIcon["ariaLabel"];
|
|
540
|
+
/** Rotation in degrees. Applied via CSS `rotate`. */
|
|
541
|
+
rotate?: NysIcon["rotate"];
|
|
542
|
+
/** Flip direction: `horizontal`, `vertical`, or empty for none. */
|
|
543
|
+
flip?: NysIcon["flip"];
|
|
544
|
+
/** Icon color. Accepts any CSS color value. Defaults to `currentcolor`. */
|
|
545
|
+
color?: NysIcon["color"];
|
|
546
|
+
/** Icon size. Semantic sizes: `xs`-`5xl`. Pixel sizes: `12`-`50`. */
|
|
547
|
+
size?: NysIcon["size"];
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
export type NysLabelProps = {
|
|
551
|
+
/** ID of the form element this label is associated with. */
|
|
552
|
+
for?: NysLabel["for"];
|
|
553
|
+
/** Label text displayed above the form field. */
|
|
554
|
+
label?: NysLabel["label"];
|
|
555
|
+
/** Helper text displayed below the label. */
|
|
556
|
+
description?: NysLabel["description"];
|
|
557
|
+
/** Flag type: `required` shows asterisk, `optional` shows "(Optional)". */
|
|
558
|
+
flag?: NysLabel["flag"];
|
|
559
|
+
/** Adjusts colors for dark backgrounds. */
|
|
560
|
+
inverted?: NysLabel["inverted"];
|
|
561
|
+
/** Tooltip text shown on hover/focus of info icon next to label. */
|
|
562
|
+
tooltip?: NysLabel["tooltip"];
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
export type NysModalProps = {
|
|
566
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
567
|
+
id?: NysModal["id"];
|
|
568
|
+
/** Modal heading text. Required for accessibility. */
|
|
569
|
+
heading?: NysModal["heading"];
|
|
570
|
+
/** Secondary heading below the main heading. */
|
|
571
|
+
subheading?: NysModal["subheading"];
|
|
572
|
+
/** Controls modal visibility. Set to `true` to show. */
|
|
573
|
+
open?: NysModal["open"];
|
|
574
|
+
/** Prevents dismissal via close button or Escape key. User must take an action. */
|
|
575
|
+
mandatory?: NysModal["mandatory"];
|
|
576
|
+
/** Modal width: `sm` (400px), `md` (600px), or `lg` (800px). */
|
|
577
|
+
width?: NysModal["width"];
|
|
578
|
+
|
|
579
|
+
/** Fired when modal opens. Detail: `{id}`. */
|
|
580
|
+
"onnys-open"?: (e: CustomEvent<CustomEvent>) => void;
|
|
581
|
+
/** Fired when modal closes. Detail: `{id}`. */
|
|
582
|
+
"onnys-close"?: (e: CustomEvent<CustomEvent>) => void;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
export type NysPaginationProps = {
|
|
586
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
587
|
+
id?: NysPagination["id"];
|
|
588
|
+
/** Name attribute for form association. */
|
|
589
|
+
name?: NysPagination["name"];
|
|
590
|
+
/** Currently active page (1-indexed). Clamped to valid range. */
|
|
591
|
+
currentPage?: NysPagination["currentPage"];
|
|
592
|
+
/** Total number of pages. Must be at least 1. */
|
|
593
|
+
totalPages?: NysPagination["totalPages"];
|
|
594
|
+
/** Internal state for layout adjustments near the end. */
|
|
595
|
+
_twoBeforeLast?: NysPagination["_twoBeforeLast"];
|
|
596
|
+
|
|
597
|
+
/** Fired when page changes. Detail: `{page}`. */
|
|
598
|
+
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
export type NysRadiobuttonProps = {
|
|
602
|
+
/** Whether this radio is selected. Only one per group can be checked. */
|
|
603
|
+
checked?: NysRadiobutton["checked"];
|
|
604
|
+
/** Prevents interaction. */
|
|
605
|
+
disabled?: NysRadiobutton["disabled"];
|
|
606
|
+
/** Marks group as required. Set on radiogroup, not individual radios. */
|
|
607
|
+
required?: NysRadiobutton["required"];
|
|
608
|
+
/** Visible label text. Required for accessibility. */
|
|
609
|
+
label?: NysRadiobutton["label"];
|
|
610
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
611
|
+
description?: NysRadiobutton["description"];
|
|
612
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
613
|
+
id?: NysRadiobutton["id"];
|
|
614
|
+
/** Group name. Radios with same name are mutually exclusive. */
|
|
615
|
+
name?: NysRadiobutton["name"];
|
|
616
|
+
/** Value submitted when this radio is selected. */
|
|
617
|
+
value?: NysRadiobutton["value"];
|
|
618
|
+
/** Adjusts colors for dark backgrounds. */
|
|
619
|
+
inverted?: NysRadiobutton["inverted"];
|
|
620
|
+
/** Form `id` to associate with. */
|
|
621
|
+
form?: NysRadiobutton["form"];
|
|
622
|
+
/** Radio size: `sm` (24px) or `md` (32px, default). */
|
|
623
|
+
size?: NysRadiobutton["size"];
|
|
624
|
+
/** Renders as tile with larger clickable area. */
|
|
625
|
+
tile?: NysRadiobutton["tile"];
|
|
626
|
+
/** */
|
|
627
|
+
other?: NysRadiobutton["other"];
|
|
628
|
+
/** */
|
|
629
|
+
showOtherError?: NysRadiobutton["showOtherError"];
|
|
630
|
+
|
|
631
|
+
/** */
|
|
632
|
+
"onnys-error-clear"?: (e: CustomEvent<CustomEvent>) => void;
|
|
633
|
+
/** Fired when selection changes. Detail: `{id, checked, name, value}`. */
|
|
634
|
+
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
635
|
+
/** Fired when "other" text input value changes. Detail: `{id, name, value}`. */
|
|
636
|
+
"onnys-other-input"?: (e: CustomEvent<CustomEvent>) => void;
|
|
637
|
+
/** Fired when radio gains focus. */
|
|
638
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
639
|
+
/** Fired when radio loses focus. */
|
|
640
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
641
|
+
/** */
|
|
642
|
+
"onnys-error"?: (e: CustomEvent<CustomEvent>) => void;
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
export type NysRadiogroupProps = {
|
|
646
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
647
|
+
id?: NysRadiogroup["id"];
|
|
648
|
+
/** Name for form submission. Auto-populated from child radiobuttons. */
|
|
649
|
+
name?: NysRadiogroup["name"];
|
|
650
|
+
/** Requires a selection before form submission. */
|
|
651
|
+
required?: NysRadiogroup["required"];
|
|
652
|
+
/** Shows "Optional" flag. */
|
|
653
|
+
optional?: NysRadiogroup["optional"];
|
|
654
|
+
/** Shows error message when true. */
|
|
655
|
+
showError?: NysRadiogroup["showError"];
|
|
656
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
657
|
+
errorMessage?: NysRadiogroup["errorMessage"];
|
|
658
|
+
/** Visible label text for the group. */
|
|
659
|
+
label?: NysRadiogroup["label"];
|
|
660
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
661
|
+
description?: NysRadiogroup["description"];
|
|
662
|
+
/** Renders all radiobuttons as tiles with larger clickable area. */
|
|
663
|
+
tile?: NysRadiogroup["tile"];
|
|
664
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
665
|
+
tooltip?: NysRadiogroup["tooltip"];
|
|
666
|
+
/** Adjusts colors for dark backgrounds. Applied to all children. */
|
|
667
|
+
inverted?: NysRadiogroup["inverted"];
|
|
668
|
+
/** Form `id` to associate with. Applied to all children. */
|
|
669
|
+
form?: NysRadiogroup["form"];
|
|
670
|
+
/** Radio size for all children: `sm` (24px) or `md` (32px, default). */
|
|
671
|
+
size?: NysRadiogroup["size"];
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
export type NysOptionProps = {
|
|
675
|
+
/** Prevents selection of this option. */
|
|
676
|
+
disabled?: NysOption["disabled"];
|
|
677
|
+
/** Pre-selects this option. */
|
|
678
|
+
selected?: NysOption["selected"];
|
|
679
|
+
/** Value submitted when this option is selected. */
|
|
680
|
+
value?: NysOption["value"];
|
|
681
|
+
/** Display text for the option. Auto-populated from slot content if not set. */
|
|
682
|
+
label?: NysOption["label"];
|
|
683
|
+
/** Hides the option from the dropdown list. */
|
|
684
|
+
hidden?: NysOption["hidden"];
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
export type NysSelectProps = {
|
|
688
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
689
|
+
id?: NysSelect["id"];
|
|
690
|
+
/** Name for form submission. */
|
|
691
|
+
name?: NysSelect["name"];
|
|
692
|
+
/** Visible label text. Required for accessibility. */
|
|
693
|
+
label?: NysSelect["label"];
|
|
694
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
695
|
+
description?: NysSelect["description"];
|
|
696
|
+
/** Currently selected option value. */
|
|
697
|
+
value?: NysSelect["value"];
|
|
698
|
+
/** Prevents interaction. */
|
|
699
|
+
disabled?: NysSelect["disabled"];
|
|
700
|
+
/** Marks as required. Shows "Required" flag and validates on blur. */
|
|
701
|
+
required?: NysSelect["required"];
|
|
702
|
+
/** Shows "Optional" flag. Use when most fields are required. */
|
|
703
|
+
optional?: NysSelect["optional"];
|
|
704
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
705
|
+
tooltip?: NysSelect["tooltip"];
|
|
706
|
+
/** Form `id` to associate with when select is outside form element. */
|
|
707
|
+
form?: NysSelect["form"];
|
|
708
|
+
/** Adjusts colors for dark backgrounds. */
|
|
709
|
+
inverted?: NysSelect["inverted"];
|
|
710
|
+
/** Shows error message when true. Set by validation or manually. */
|
|
711
|
+
showError?: NysSelect["showError"];
|
|
712
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
713
|
+
errorMessage?: NysSelect["errorMessage"];
|
|
714
|
+
/** Select width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default). */
|
|
715
|
+
width?: NysSelect["width"];
|
|
716
|
+
|
|
717
|
+
/** Fired when selection changes. Detail: `{id, value}`. */
|
|
718
|
+
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
719
|
+
/** Fired when select gains focus. */
|
|
720
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
721
|
+
/** Fired when select loses focus. Triggers validation. */
|
|
722
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
export type NysSkipnavProps = {
|
|
726
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
727
|
+
id?: NysSkipnav["id"];
|
|
728
|
+
/** Target element ID (with `#`). Defaults to `#main-content`. */
|
|
729
|
+
href?: NysSkipnav["href"];
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
export type NysStepProps = {
|
|
733
|
+
/** Whether this step is currently being viewed. Set by parent stepper. */
|
|
734
|
+
selected?: NysStep["selected"];
|
|
735
|
+
/** Marks the furthest reached step. Steps before this are navigable. */
|
|
736
|
+
current?: NysStep["current"];
|
|
737
|
+
/** Step label text displayed alongside the step number. */
|
|
738
|
+
label?: NysStep["label"];
|
|
739
|
+
/** URL for page navigation when step is clicked. Optional for SPA routing. */
|
|
740
|
+
href?: NysStep["href"];
|
|
741
|
+
/** Internal: Whether parent stepper's compact view is expanded. */
|
|
742
|
+
isCompactExpanded?: NysStep["isCompactExpanded"];
|
|
743
|
+
/** Step number (1-indexed). Auto-assigned by parent stepper. */
|
|
744
|
+
stepNumber?: NysStep["stepNumber"];
|
|
745
|
+
/** Custom click handler. Called before `nys-step-click` event. */
|
|
746
|
+
onClick?: NysStep["onClick"];
|
|
747
|
+
/** Fired when a navigable step is clicked. Detail: `{href, label}`. Cancelable. */
|
|
748
|
+
"onnys-step-click"?: (e: CustomEvent<never>) => void;
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
export type NysStepperProps = {
|
|
752
|
+
/** Unique identifier. */
|
|
753
|
+
id?: NysStepper["id"];
|
|
754
|
+
/** Name attribute for form association. */
|
|
755
|
+
name?: NysStepper["name"];
|
|
756
|
+
/** Title displayed above the step counter. */
|
|
757
|
+
label?: NysStepper["label"];
|
|
758
|
+
/** Progress text (e.g., "Step 2 of 5"). Auto-updated based on selection. */
|
|
759
|
+
counterText?: NysStepper["counterText"];
|
|
760
|
+
/** Whether compact mobile view is expanded to show all steps. */
|
|
761
|
+
isCompactExpanded?: NysStepper["isCompactExpanded"];
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
export type NysTableProps = {
|
|
765
|
+
/** */
|
|
766
|
+
id?: NysTable["id"];
|
|
767
|
+
/** */
|
|
768
|
+
name?: NysTable["name"];
|
|
769
|
+
/** */
|
|
770
|
+
striped?: NysTable["striped"];
|
|
771
|
+
/** */
|
|
772
|
+
sortable?: NysTable["sortable"];
|
|
773
|
+
/** */
|
|
774
|
+
bordered?: NysTable["bordered"];
|
|
775
|
+
/** */
|
|
776
|
+
download?: NysTable["download"];
|
|
777
|
+
|
|
778
|
+
/** Fired when the download button or sortable headers are clicked. */
|
|
779
|
+
"onnys-click"?: (e: CustomEvent<never>) => void;
|
|
780
|
+
/** Fired when a sortable column header is clicked. Can be prevented by calling `event.preventDefault()` to override default sort behavior. Detail: { columnIndex: number, columnLabel: string, sortDirection: "asc" | "desc" | "none" } */
|
|
781
|
+
"onnys-column-sort"?: (e: CustomEvent<never>) => void;
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
export type NysTextareaProps = {
|
|
785
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
786
|
+
id?: NysTextarea["id"];
|
|
787
|
+
/** Name for form submission. */
|
|
788
|
+
name?: NysTextarea["name"];
|
|
789
|
+
/** Visible label text. Required for accessibility. */
|
|
790
|
+
label?: NysTextarea["label"];
|
|
791
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
792
|
+
description?: NysTextarea["description"];
|
|
793
|
+
/** Placeholder text. Don't use as label replacement. */
|
|
794
|
+
placeholder?: NysTextarea["placeholder"];
|
|
795
|
+
/** Current textarea value. */
|
|
796
|
+
value?: NysTextarea["value"];
|
|
797
|
+
/** Prevents interaction. */
|
|
798
|
+
disabled?: NysTextarea["disabled"];
|
|
799
|
+
/** Makes textarea read-only but focusable. */
|
|
800
|
+
readonly?: NysTextarea["readonly"];
|
|
801
|
+
/** Marks as required. Shows "Required" flag and validates on blur. */
|
|
802
|
+
required?: NysTextarea["required"];
|
|
803
|
+
/** Shows "Optional" flag. Use when most fields are required. */
|
|
804
|
+
optional?: NysTextarea["optional"];
|
|
805
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
806
|
+
tooltip?: NysTextarea["tooltip"];
|
|
807
|
+
/** Adjusts colors for dark backgrounds. */
|
|
808
|
+
inverted?: NysTextarea["inverted"];
|
|
809
|
+
/** Form `id` to associate with when textarea is outside form element. */
|
|
810
|
+
form?: NysTextarea["form"];
|
|
811
|
+
/** Maximum character length. */
|
|
812
|
+
maxlength?: NysTextarea["maxlength"];
|
|
813
|
+
/** Textarea width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default). */
|
|
814
|
+
width?: NysTextarea["width"];
|
|
815
|
+
/** Visible height in lines. */
|
|
816
|
+
rows?: NysTextarea["rows"];
|
|
817
|
+
/** Resize behavior: `vertical` (default, user can resize height), `none` (fixed size). */
|
|
818
|
+
resize?: NysTextarea["resize"];
|
|
819
|
+
/** Shows error message when true. Set by validation or manually. */
|
|
820
|
+
showError?: NysTextarea["showError"];
|
|
821
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
822
|
+
errorMessage?: NysTextarea["errorMessage"];
|
|
823
|
+
|
|
824
|
+
/** Fired on input change. Detail: `{id, value}`. */
|
|
825
|
+
"onnys-input"?: (e: CustomEvent<CustomEvent>) => void;
|
|
826
|
+
/** Fired when textarea gains focus. */
|
|
827
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
828
|
+
/** Fired when textarea loses focus. Triggers validation. */
|
|
829
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
830
|
+
/** Fired when user selects text. Detail: `{id, value}`. */
|
|
831
|
+
"onnys-select"?: (e: CustomEvent<CustomEvent>) => void;
|
|
832
|
+
/** */
|
|
833
|
+
"onnys-selectionchange"?: (e: CustomEvent<CustomEvent>) => void;
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
export type NysTextinputProps = {
|
|
837
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
838
|
+
id?: NysTextinput["id"];
|
|
839
|
+
/** Name for form submission. */
|
|
840
|
+
name?: NysTextinput["name"];
|
|
841
|
+
/** Input type: `text` (default), `email`, `number`, `password`, `search`, `tel` (auto-masked), `url`. */
|
|
842
|
+
type?: NysTextinput["type"];
|
|
843
|
+
/** Visible label text. Required for accessibility. */
|
|
844
|
+
label?: NysTextinput["label"];
|
|
845
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
846
|
+
description?: NysTextinput["description"];
|
|
847
|
+
/** Placeholder text. Don't use as label replacement. */
|
|
848
|
+
placeholder?: NysTextinput["placeholder"];
|
|
849
|
+
/** Current input value. */
|
|
850
|
+
value?: NysTextinput["value"];
|
|
851
|
+
/** Prevents interaction. */
|
|
852
|
+
disabled?: NysTextinput["disabled"];
|
|
853
|
+
/** Makes input read-only but focusable. */
|
|
854
|
+
readonly?: NysTextinput["readonly"];
|
|
855
|
+
/** Marks as required. Shows "Required" flag and validates on blur. */
|
|
856
|
+
required?: NysTextinput["required"];
|
|
857
|
+
/** Shows "Optional" flag. Use when most fields are required. */
|
|
858
|
+
optional?: NysTextinput["optional"];
|
|
859
|
+
/** Tooltip text shown on hover/focus of info icon. */
|
|
860
|
+
tooltip?: NysTextinput["tooltip"];
|
|
861
|
+
/** Form `id` to associate with when input is outside form element. */
|
|
862
|
+
form?: NysTextinput["form"];
|
|
863
|
+
/** Regex pattern for validation. Shows error on mismatch. */
|
|
864
|
+
pattern?: NysTextinput["pattern"];
|
|
865
|
+
/** Maximum character length. */
|
|
866
|
+
maxlength?: NysTextinput["maxlength"];
|
|
867
|
+
/** Accessible label. When set, assuming "label" isn't provided for private special cases (i.e., <checkbox other>). */
|
|
868
|
+
ariaLabel?: NysTextinput["ariaLabel"];
|
|
869
|
+
/** Input width: `sm` (88px), `md` (200px), `lg` (384px), `full` (100%, default). */
|
|
870
|
+
width?: NysTextinput["width"];
|
|
871
|
+
/** Step increment for `type="number"`. */
|
|
872
|
+
step?: NysTextinput["step"];
|
|
873
|
+
/** Minimum value for `type="number"`. */
|
|
874
|
+
min?: NysTextinput["min"];
|
|
875
|
+
/** Maximum value for `type="number"`. */
|
|
876
|
+
max?: NysTextinput["max"];
|
|
877
|
+
/** Adjusts colors for dark backgrounds. */
|
|
878
|
+
inverted?: NysTextinput["inverted"];
|
|
879
|
+
/** Shows error message when true. Set by validation or manually. */
|
|
880
|
+
showError?: NysTextinput["showError"];
|
|
881
|
+
/** Error message text. Shown only when `showError` is true. */
|
|
882
|
+
errorMessage?: NysTextinput["errorMessage"];
|
|
883
|
+
|
|
884
|
+
/** Fired on input change. Detail: `{id, value}`. */
|
|
885
|
+
"onnys-input"?: (e: CustomEvent<CustomEvent>) => void;
|
|
886
|
+
/** Fired when input gains focus. */
|
|
887
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
888
|
+
/** Fired when input loses focus. Triggers validation. */
|
|
889
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
export type NysToggleProps = {
|
|
893
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
894
|
+
id?: NysToggle["id"];
|
|
895
|
+
/** Name for form submission. */
|
|
896
|
+
name?: NysToggle["name"];
|
|
897
|
+
/** Value submitted when toggle is on. */
|
|
898
|
+
value?: NysToggle["value"];
|
|
899
|
+
/** Visible label text. */
|
|
900
|
+
label?: NysToggle["label"];
|
|
901
|
+
/** Helper text below label. Use slot for custom HTML. */
|
|
902
|
+
description?: NysToggle["description"];
|
|
903
|
+
/** Form `id` to associate with. */
|
|
904
|
+
form?: NysToggle["form"];
|
|
905
|
+
/** Whether toggle is on. */
|
|
906
|
+
checked?: NysToggle["checked"];
|
|
907
|
+
/** Prevents interaction. */
|
|
908
|
+
disabled?: NysToggle["disabled"];
|
|
909
|
+
/** Hides check/close icon inside toggle knob. */
|
|
910
|
+
noIcon?: NysToggle["noIcon"];
|
|
911
|
+
/** Adjusts colors for dark backgrounds. */
|
|
912
|
+
inverted?: NysToggle["inverted"];
|
|
913
|
+
/** Toggle size: `sm` or `md` (default). */
|
|
914
|
+
size?: NysToggle["size"];
|
|
915
|
+
|
|
916
|
+
/** Fired when toggle state changes. Detail: `{id, checked}`. */
|
|
917
|
+
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
918
|
+
/** Fired when toggle gains focus. */
|
|
919
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
920
|
+
/** Fired when toggle loses focus. */
|
|
921
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
export type NysTooltipProps = {
|
|
925
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
926
|
+
id?: NysTooltip["id"];
|
|
927
|
+
/** Tooltip content text. Required. */
|
|
928
|
+
text?: NysTooltip["text"];
|
|
929
|
+
/** Adjusts colors for dark backgrounds. */
|
|
930
|
+
inverted?: NysTooltip["inverted"];
|
|
931
|
+
/** ID of the trigger element to attach this tooltip to. Required. */
|
|
932
|
+
for?: NysTooltip["for"];
|
|
933
|
+
/** Preferred position relative to trigger. Auto-adjusts if space is insufficient. */
|
|
934
|
+
position?: NysTooltip["position"];
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
export type NysUnavFooterProps = {};
|
|
938
|
+
|
|
939
|
+
export type NysUnavHeaderProps = {
|
|
940
|
+
/** Internal: Whether trust bar panel is expanded. */
|
|
941
|
+
trustbarVisible?: NysUnavHeader["trustbarVisible"];
|
|
942
|
+
/** Internal: Whether search dropdown is visible (mobile). */
|
|
943
|
+
searchDropdownVisible?: NysUnavHeader["searchDropdownVisible"];
|
|
944
|
+
/** Internal: Whether language dropdown is visible. */
|
|
945
|
+
languageVisible?: NysUnavHeader["languageVisible"];
|
|
946
|
+
/** Internal: Whether search input is focused. */
|
|
947
|
+
isSearchFocused?: NysUnavHeader["isSearchFocused"];
|
|
948
|
+
/** Hides the translation dropdown. */
|
|
949
|
+
hideTranslate?: NysUnavHeader["hideTranslate"];
|
|
950
|
+
/** Hides the search functionality. */
|
|
951
|
+
hideSearch?: NysUnavHeader["hideSearch"];
|
|
952
|
+
/** The URL endpoint of the search, make sure to include the query param. */
|
|
953
|
+
searchUrl?: NysUnavHeader["searchUrl"];
|
|
954
|
+
/** The list of languages this site can be translated to, default to use Smartling */
|
|
955
|
+
languages?: NysUnavHeader["languages"];
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
export type CustomElements = {
|
|
959
|
+
/**
|
|
960
|
+
* Container for accordion items with optional single-select and bordered styling.
|
|
961
|
+
* ---
|
|
962
|
+
*
|
|
963
|
+
*
|
|
964
|
+
* ### **Slots:**
|
|
965
|
+
* - _default_ - Default slot for `nys-accordionitem` elements.
|
|
966
|
+
*
|
|
967
|
+
* ### **CSS Properties:**
|
|
968
|
+
* - **--nys-accordion-background-color--header** - Background color of the accordion header. _(default: undefined)_
|
|
969
|
+
* - **--nys-accordion-background-color--header--hover** - Background hover color of the accordion header. _(default: undefined)_
|
|
970
|
+
* - **--nys-accordion-content-max-width** - Maximum readable width of accordion content. Defaults to a character-based width (80ch) for readability. _(default: undefined)_
|
|
971
|
+
*/
|
|
972
|
+
"nys-accordion": Partial<NysAccordionProps & BaseProps & BaseEvents>;
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Collapsible panel for use within nys-accordion with keyboard support.
|
|
976
|
+
* ---
|
|
977
|
+
*
|
|
978
|
+
*
|
|
979
|
+
* ### **Events:**
|
|
980
|
+
* - **nys-accordionitem-toggle** - Fired when expanded state changes. Detail: `{id, heading, expanded}`.
|
|
981
|
+
*
|
|
982
|
+
* ### **Slots:**
|
|
983
|
+
* - _default_ - Default slot for panel content shown when expanded.
|
|
984
|
+
*/
|
|
985
|
+
"nys-accordionitem": Partial<NysAccordionItemProps & BaseProps & BaseEvents>;
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Alert for contextual feedback with semantic types and live region support.
|
|
989
|
+
* ---
|
|
990
|
+
*
|
|
991
|
+
*
|
|
992
|
+
* ### **Events:**
|
|
993
|
+
* - **nys-close** - Fired when alert is dismissed. Detail: `{id, type, label}`.
|
|
994
|
+
*
|
|
995
|
+
* ### **Slots:**
|
|
996
|
+
* - _default_ - Default slot for custom body content. Overrides `text` prop when provided.
|
|
997
|
+
*/
|
|
998
|
+
"nys-alert": Partial<NysAlertProps & BaseProps & BaseEvents>;
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* User avatar with image, initials, or icon fallback and contrast-aware colors.
|
|
1002
|
+
* ---
|
|
1003
|
+
*
|
|
1004
|
+
*
|
|
1005
|
+
* ### **Slots:**
|
|
1006
|
+
* - _default_ - Custom icon content. Overrides default icon when no image or initials.
|
|
1007
|
+
*/
|
|
1008
|
+
"nys-avatar": Partial<NysAvatarProps & BaseProps & BaseEvents>;
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Floating back-to-top button with auto-show behavior and smooth scroll.
|
|
1012
|
+
* ---
|
|
1013
|
+
*
|
|
1014
|
+
*/
|
|
1015
|
+
"nys-backtotop": Partial<NysBacktotopProps & BaseProps & BaseEvents>;
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* Compact label for status, counts, or categorization with semantic styling.
|
|
1019
|
+
* ---
|
|
1020
|
+
*
|
|
1021
|
+
*/
|
|
1022
|
+
"nys-badge": Partial<NysBadgeProps & BaseProps & BaseEvents>;
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* Button for actions and CTAs with variants, sizes, and icon support.
|
|
1026
|
+
* ---
|
|
1027
|
+
*
|
|
1028
|
+
*
|
|
1029
|
+
* ### **Events:**
|
|
1030
|
+
* - **nys-focus** - Fired when the button receives focus.
|
|
1031
|
+
* - **nys-blur** - Fired when the button loses focus.
|
|
1032
|
+
* - **nys-click** - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.
|
|
1033
|
+
*
|
|
1034
|
+
* ### **Slots:**
|
|
1035
|
+
* - **prefix-icon** - Icon before label. Not shown for `text` variant.
|
|
1036
|
+
* - **suffix-icon** - Icon after label. Not shown for `text` variant.
|
|
1037
|
+
* - **circle-icon** - Icon for circle mode. Overrides `icon` prop.
|
|
1038
|
+
*
|
|
1039
|
+
* ### **CSS Properties:**
|
|
1040
|
+
* - **--nys-button-color** - Text color of the button label. _(default: undefined)_
|
|
1041
|
+
* - **--nys-button-color--hover** - Text color when hovered. _(default: undefined)_
|
|
1042
|
+
* - **--nys-button-color--active** - Text color when active/pressed. _(default: undefined)_
|
|
1043
|
+
* - **--nys-button-background-color** - Background color of the button. _(default: undefined)_
|
|
1044
|
+
* - **--nys-button-background-color--hover** - Background color when hovered. _(default: undefined)_
|
|
1045
|
+
* - **--nys-button-background-color--active** - Background color when active/pressed. _(default: undefined)_
|
|
1046
|
+
* - **--nys-button-border-color** - Border color of the button. _(default: undefined)_
|
|
1047
|
+
* - **--nys-button-border-color--hover** - Border color when hovered. _(default: undefined)_
|
|
1048
|
+
* - **--nys-button-border-color--active** - Border color when active/pressed. _(default: undefined)_
|
|
1049
|
+
*/
|
|
1050
|
+
"nys-button": Partial<NysButtonProps & BaseProps & BaseEvents>;
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Checkbox for binary choices or multi-select options.
|
|
1054
|
+
* ---
|
|
1055
|
+
*
|
|
1056
|
+
*
|
|
1057
|
+
* ### **Events:**
|
|
1058
|
+
* - **nys-change** - Fired when checked state changes. Detail: `{id, checked, name, value}`.
|
|
1059
|
+
* - **nys-other-input** - Fired when "other" text input value changes. Detail: `{id, name, value}`.
|
|
1060
|
+
* - **nys-focus** - Fired when checkbox gains focus.
|
|
1061
|
+
* - **nys-blur** - Fired when checkbox loses focus.
|
|
1062
|
+
* - **nys-error**
|
|
1063
|
+
* - **nys-error-clear**
|
|
1064
|
+
*
|
|
1065
|
+
* ### **Methods:**
|
|
1066
|
+
* - **checkValidity(): _boolean_** - Functions
|
|
1067
|
+
* --------------------------------------------------------------------------
|
|
1068
|
+
*
|
|
1069
|
+
* ### **Slots:**
|
|
1070
|
+
* - **description** - Custom HTML description content.
|
|
1071
|
+
*/
|
|
1072
|
+
"nys-checkbox": Partial<NysCheckboxProps & BaseProps & BaseEvents>;
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Container for grouping checkboxes as a single form control.
|
|
1076
|
+
* ---
|
|
1077
|
+
*
|
|
1078
|
+
*
|
|
1079
|
+
* ### **Slots:**
|
|
1080
|
+
* - _default_ - Default slot for `nys-checkbox` elements.
|
|
1081
|
+
* - **description** - Custom HTML description content.
|
|
1082
|
+
*/
|
|
1083
|
+
"nys-checkboxgroup": Partial<NysCheckboxgroupProps & BaseProps & BaseEvents>;
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* `<nys-combobox>` is a form-enabled combo box combining text input with a filterable dropdown.
|
|
1087
|
+
*
|
|
1088
|
+
* Features:
|
|
1089
|
+
* - Type to filter options
|
|
1090
|
+
* - Keyboard navigation (Arrow keys, Enter, Escape)
|
|
1091
|
+
* - Mouse and keyboard interaction
|
|
1092
|
+
* - Clears non-selected text on blur
|
|
1093
|
+
* - Clear button when value is selected
|
|
1094
|
+
* - Integrates with forms via ElementInternals
|
|
1095
|
+
* - Supports native <option> and <optgroup> elements
|
|
1096
|
+
* - Accessible per W3C ARIA Authoring Practices
|
|
1097
|
+
* ---
|
|
1098
|
+
*
|
|
1099
|
+
*
|
|
1100
|
+
* ### **Events:**
|
|
1101
|
+
* - **nys-input** - Fired on input change. Detail: `{ id, value }`.
|
|
1102
|
+
* - **nys-focus** - Fired when combobox receives focus.
|
|
1103
|
+
* - **nys-blur** - Fired when combobox loses focus.
|
|
1104
|
+
* - **nys-change** - Fired when selection changes. Detail: `{ id, value }`.
|
|
1105
|
+
*
|
|
1106
|
+
* ### **Slots:**
|
|
1107
|
+
* - **description** - Optional custom description content below the label.
|
|
1108
|
+
* - **default** - Options (<option>, <optgroup>) to populate the dropdown
|
|
1109
|
+
*/
|
|
1110
|
+
"nys-combobox": Partial<NysComboboxProps & BaseProps & BaseEvents>;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Date picker with calendar popup and native fallback.
|
|
1114
|
+
* ---
|
|
1115
|
+
*
|
|
1116
|
+
*
|
|
1117
|
+
* ### **Events:**
|
|
1118
|
+
* - **nys-input** - Fired on date selection. Detail: `{id, value}`.
|
|
1119
|
+
* - **nys-blur** - Fired when input or calendar loses focus. Triggers validation.
|
|
1120
|
+
*
|
|
1121
|
+
* ### **Methods:**
|
|
1122
|
+
* - **checkValidity(): _boolean_** - Passive check of validity:
|
|
1123
|
+
* - Returns true/false
|
|
1124
|
+
* - Does NOT update UI or show errors
|
|
1125
|
+
* - Used in form submission checks
|
|
1126
|
+
*/
|
|
1127
|
+
"nys-datepicker": Partial<NysDatepickerProps & BaseProps & BaseEvents>;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Horizontal divider for visual separation of content sections.
|
|
1131
|
+
* ---
|
|
1132
|
+
*
|
|
1133
|
+
*/
|
|
1134
|
+
"nys-divider": Partial<NysDividerProps & BaseProps & BaseEvents>;
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
*
|
|
1138
|
+
* ---
|
|
1139
|
+
*
|
|
1140
|
+
*/
|
|
1141
|
+
"nys-dropdownmenu": Partial<NysDropdownMenuProps & BaseProps & BaseEvents>;
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Dropdown item to display label and provide href link.
|
|
1145
|
+
* ---
|
|
1146
|
+
*
|
|
1147
|
+
*
|
|
1148
|
+
* ### **Events:**
|
|
1149
|
+
* - **nys-click**
|
|
1150
|
+
*/
|
|
1151
|
+
"nys-dropdownmenuitem": Partial<NysDropdownMenuItemProps & BaseProps & BaseEvents>;
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Internal error message display with icon and ARIA alert support.
|
|
1155
|
+
* ---
|
|
1156
|
+
*
|
|
1157
|
+
*/
|
|
1158
|
+
"nys-errormessage": Partial<NysErrorMessageProps & BaseProps & BaseEvents>;
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* File input with drag-and-drop, validation, and progress tracking.
|
|
1162
|
+
* ---
|
|
1163
|
+
*
|
|
1164
|
+
*
|
|
1165
|
+
* ### **Events:**
|
|
1166
|
+
* - **nys-change** - Fired when files are added or removed. Detail: `{id, files}`.
|
|
1167
|
+
*
|
|
1168
|
+
* ### **Slots:**
|
|
1169
|
+
* - **description** - Custom HTML description content.
|
|
1170
|
+
*/
|
|
1171
|
+
"nys-fileinput": Partial<NysFileinputProps & BaseProps & BaseEvents>;
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Internal file item display with status, progress bar, and remove action.
|
|
1175
|
+
* ---
|
|
1176
|
+
*
|
|
1177
|
+
*
|
|
1178
|
+
* ### **Events:**
|
|
1179
|
+
* - **nys-fileRemove** - Fired when remove button is clicked. Detail: `{filename}`.
|
|
1180
|
+
*/
|
|
1181
|
+
"nys-fileitem": Partial<NysFileItemProps & BaseProps & BaseEvents>;
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* Agency footer with auto-layout for contact info and link sections.
|
|
1185
|
+
* ---
|
|
1186
|
+
*
|
|
1187
|
+
*
|
|
1188
|
+
* ### **Slots:**
|
|
1189
|
+
* - _default_ - Footer content (links, contact info). Use `<h4>` for column headings.
|
|
1190
|
+
*/
|
|
1191
|
+
"nys-globalfooter": Partial<NysGlobalFooterProps & BaseProps & BaseEvents>;
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Agency header with navigation, mobile menu, and active link highlighting.
|
|
1195
|
+
* ---
|
|
1196
|
+
*
|
|
1197
|
+
*
|
|
1198
|
+
* ### **Slots:**
|
|
1199
|
+
* - _default_ - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
|
|
1200
|
+
*/
|
|
1201
|
+
"nys-globalheader": Partial<NysGlobalHeaderProps & BaseProps & BaseEvents>;
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* SVG icon from Material Symbols library with size, rotation, and color options.
|
|
1205
|
+
* ---
|
|
1206
|
+
*
|
|
1207
|
+
*/
|
|
1208
|
+
"nys-icon": Partial<NysIconProps & BaseProps & BaseEvents>;
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* Internal label component for form fields with flag and tooltip support.
|
|
1212
|
+
* ---
|
|
1213
|
+
*
|
|
1214
|
+
*
|
|
1215
|
+
* ### **Slots:**
|
|
1216
|
+
* - **description** - Custom HTML description content below the label.
|
|
1217
|
+
*/
|
|
1218
|
+
"nys-label": Partial<NysLabelProps & BaseProps & BaseEvents>;
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Accessible modal dialog with focus trap, keyboard support, and action slots.
|
|
1222
|
+
* ---
|
|
1223
|
+
*
|
|
1224
|
+
*
|
|
1225
|
+
* ### **Events:**
|
|
1226
|
+
* - **nys-open** - Fired when modal opens. Detail: `{id}`.
|
|
1227
|
+
* - **nys-close** - Fired when modal closes. Detail: `{id}`.
|
|
1228
|
+
*
|
|
1229
|
+
* ### **Slots:**
|
|
1230
|
+
* - _default_ - Default slot for body content.
|
|
1231
|
+
* - **actions** - Action buttons displayed in footer. Buttons auto-resize on mobile.
|
|
1232
|
+
*/
|
|
1233
|
+
"nys-modal": Partial<NysModalProps & BaseProps & BaseEvents>;
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* Page navigation with numbered links, prev/next buttons, and responsive layout.
|
|
1237
|
+
* ---
|
|
1238
|
+
*
|
|
1239
|
+
*
|
|
1240
|
+
* ### **Events:**
|
|
1241
|
+
* - **nys-change** - Fired when page changes. Detail: `{page}`.
|
|
1242
|
+
*/
|
|
1243
|
+
"nys-pagination": Partial<NysPaginationProps & BaseProps & BaseEvents>;
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Radio button for single selection from mutually exclusive options.
|
|
1247
|
+
* ---
|
|
1248
|
+
*
|
|
1249
|
+
*
|
|
1250
|
+
* ### **Events:**
|
|
1251
|
+
* - **nys-error-clear**
|
|
1252
|
+
* - **nys-change** - Fired when selection changes. Detail: `{id, checked, name, value}`.
|
|
1253
|
+
* - **nys-other-input** - Fired when "other" text input value changes. Detail: `{id, name, value}`.
|
|
1254
|
+
* - **nys-focus** - Fired when radio gains focus.
|
|
1255
|
+
* - **nys-blur** - Fired when radio loses focus.
|
|
1256
|
+
* - **nys-error**
|
|
1257
|
+
*
|
|
1258
|
+
* ### **Methods:**
|
|
1259
|
+
* - **getInputElement(): _Promise<HTMLInputElement | null>_** - Functions
|
|
1260
|
+
* --------------------------------------------------------------------------
|
|
1261
|
+
*
|
|
1262
|
+
* ### **Slots:**
|
|
1263
|
+
* - **description** - Custom HTML description content.
|
|
1264
|
+
*/
|
|
1265
|
+
"nys-radiobutton": Partial<NysRadiobuttonProps & BaseProps & BaseEvents>;
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Container for grouping radio buttons as a single form control.
|
|
1269
|
+
* ---
|
|
1270
|
+
*
|
|
1271
|
+
*
|
|
1272
|
+
* ### **Slots:**
|
|
1273
|
+
* - _default_ - Default slot for `nys-radiobutton` elements.
|
|
1274
|
+
* - **description** - Custom HTML description content.
|
|
1275
|
+
*/
|
|
1276
|
+
"nys-radiogroup": Partial<NysRadiogroupProps & BaseProps & BaseEvents>;
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Option item for nys-select dropdown.
|
|
1280
|
+
* ---
|
|
1281
|
+
*
|
|
1282
|
+
*
|
|
1283
|
+
* ### **Slots:**
|
|
1284
|
+
* - _default_ - Option label text. Auto-populates the `label` prop if provided.
|
|
1285
|
+
*/
|
|
1286
|
+
"nys-option": Partial<NysOptionProps & BaseProps & BaseEvents>;
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Dropdown select for choosing one option from a list.
|
|
1290
|
+
* ---
|
|
1291
|
+
*
|
|
1292
|
+
*
|
|
1293
|
+
* ### **Events:**
|
|
1294
|
+
* - **nys-change** - Fired when selection changes. Detail: `{id, value}`.
|
|
1295
|
+
* - **nys-focus** - Fired when select gains focus.
|
|
1296
|
+
* - **nys-blur** - Fired when select loses focus. Triggers validation.
|
|
1297
|
+
*
|
|
1298
|
+
* ### **Methods:**
|
|
1299
|
+
* - **checkValidity(): _boolean_** - Functions
|
|
1300
|
+
* --------------------------------------------------------------------------
|
|
1301
|
+
*
|
|
1302
|
+
* ### **Slots:**
|
|
1303
|
+
* - _default_ - Default slot for `<option>` and `<optgroup>` elements.
|
|
1304
|
+
* - **description** - Custom HTML description content below the label.
|
|
1305
|
+
*/
|
|
1306
|
+
"nys-select": Partial<NysSelectProps & BaseProps & BaseEvents>;
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* Skip navigation link for keyboard accessibility. Hidden until focused.
|
|
1310
|
+
* ---
|
|
1311
|
+
*
|
|
1312
|
+
*/
|
|
1313
|
+
"nys-skipnav": Partial<NysSkipnavProps & BaseProps & BaseEvents>;
|
|
1314
|
+
|
|
1315
|
+
/**
|
|
1316
|
+
* Individual step for use within nys-stepper with navigation support.
|
|
1317
|
+
* ---
|
|
1318
|
+
*
|
|
1319
|
+
*
|
|
1320
|
+
* ### **Events:**
|
|
1321
|
+
* - **nys-step-click** - Fired when a navigable step is clicked. Detail: `{href, label}`. Cancelable.
|
|
1322
|
+
*/
|
|
1323
|
+
"nys-step": Partial<NysStepProps & BaseProps & BaseEvents>;
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* Multi-step progress indicator with navigation and mobile-friendly compact view.
|
|
1327
|
+
* ---
|
|
1328
|
+
*
|
|
1329
|
+
*
|
|
1330
|
+
* ### **Slots:**
|
|
1331
|
+
* - _default_ - Default slot for `nys-step` elements.
|
|
1332
|
+
* - **actions** - Navigation buttons (e.g., Back, Continue). Must be wrapped in a `<div>`.
|
|
1333
|
+
*/
|
|
1334
|
+
"nys-stepper": Partial<NysStepperProps & BaseProps & BaseEvents>;
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* `<nys-table>` is a responsive table component that can display native HTML tables,
|
|
1338
|
+
* supports striped and bordered styling, sortable columns, and CSV download.
|
|
1339
|
+
* ---
|
|
1340
|
+
*
|
|
1341
|
+
*
|
|
1342
|
+
* ### **Events:**
|
|
1343
|
+
* - **nys-click** - Fired when the download button or sortable headers are clicked.
|
|
1344
|
+
* - **nys-column-sort** - Fired when a sortable column header is clicked. Can be prevented by calling `event.preventDefault()` to override default sort behavior. Detail: { columnIndex: number, columnLabel: string, sortDirection: "asc" | "desc" | "none" }
|
|
1345
|
+
*
|
|
1346
|
+
* ### **Slots:**
|
|
1347
|
+
* - _default_ - Accepts a `<table>` element. Only the first table is rendered.
|
|
1348
|
+
*/
|
|
1349
|
+
"nys-table": Partial<NysTableProps & BaseProps & BaseEvents>;
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* Multi-line text input for comments, descriptions, and feedback.
|
|
1353
|
+
* ---
|
|
1354
|
+
*
|
|
1355
|
+
*
|
|
1356
|
+
* ### **Events:**
|
|
1357
|
+
* - **nys-input** - Fired on input change. Detail: `{id, value}`.
|
|
1358
|
+
* - **nys-focus** - Fired when textarea gains focus.
|
|
1359
|
+
* - **nys-blur** - Fired when textarea loses focus. Triggers validation.
|
|
1360
|
+
* - **nys-select** - Fired when user selects text. Detail: `{id, value}`.
|
|
1361
|
+
* - **nys-selectionchange**
|
|
1362
|
+
*
|
|
1363
|
+
* ### **Methods:**
|
|
1364
|
+
* - **checkValidity(): _boolean_** - Functions
|
|
1365
|
+
* --------------------------------------------------------------------------
|
|
1366
|
+
*
|
|
1367
|
+
* ### **Slots:**
|
|
1368
|
+
* - **description** - Custom HTML description content below the label.
|
|
1369
|
+
*/
|
|
1370
|
+
"nys-textarea": Partial<NysTextareaProps & BaseProps & BaseEvents>;
|
|
1371
|
+
|
|
1372
|
+
/**
|
|
1373
|
+
* Text input for short single-line data with validation and masking support.
|
|
1374
|
+
* ---
|
|
1375
|
+
*
|
|
1376
|
+
*
|
|
1377
|
+
* ### **Events:**
|
|
1378
|
+
* - **nys-input** - Fired on input change. Detail: `{id, value}`.
|
|
1379
|
+
* - **nys-focus** - Fired when input gains focus.
|
|
1380
|
+
* - **nys-blur** - Fired when input loses focus. Triggers validation.
|
|
1381
|
+
*
|
|
1382
|
+
* ### **Methods:**
|
|
1383
|
+
* - **checkValidity(): _boolean_** - Functions
|
|
1384
|
+
* --------------------------------------------------------------------------
|
|
1385
|
+
*
|
|
1386
|
+
* ### **Slots:**
|
|
1387
|
+
* - **description** - Custom HTML description content below the label.
|
|
1388
|
+
* - **startButton** - Button at input start. Use single `nys-button` only.
|
|
1389
|
+
* - **endButton** - Button at input end. Use single `nys-button` only.
|
|
1390
|
+
*/
|
|
1391
|
+
"nys-textinput": Partial<NysTextinputProps & BaseProps & BaseEvents>;
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* Toggle switch for binary settings with immediate effect.
|
|
1395
|
+
* ---
|
|
1396
|
+
*
|
|
1397
|
+
*
|
|
1398
|
+
* ### **Events:**
|
|
1399
|
+
* - **nys-change** - Fired when toggle state changes. Detail: `{id, checked}`.
|
|
1400
|
+
* - **nys-focus** - Fired when toggle gains focus.
|
|
1401
|
+
* - **nys-blur** - Fired when toggle loses focus.
|
|
1402
|
+
*
|
|
1403
|
+
* ### **Slots:**
|
|
1404
|
+
* - **description** - Custom HTML description content.
|
|
1405
|
+
*/
|
|
1406
|
+
"nys-toggle": Partial<NysToggleProps & BaseProps & BaseEvents>;
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Contextual tooltip with auto-positioning, keyboard support, and screen reader integration.
|
|
1410
|
+
* ---
|
|
1411
|
+
*
|
|
1412
|
+
*/
|
|
1413
|
+
"nys-tooltip": Partial<NysTooltipProps & BaseProps & BaseEvents>;
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* Universal NYS footer with logo and statewide links. Required site-wide.
|
|
1417
|
+
* ---
|
|
1418
|
+
*
|
|
1419
|
+
*/
|
|
1420
|
+
"nys-unavfooter": Partial<NysUnavFooterProps & BaseProps & BaseEvents>;
|
|
1421
|
+
|
|
1422
|
+
/**
|
|
1423
|
+
*
|
|
1424
|
+
* ---
|
|
1425
|
+
*
|
|
1426
|
+
*/
|
|
1427
|
+
"nys-unavheader": Partial<NysUnavHeaderProps & BaseProps & BaseEvents>;
|
|
1428
|
+
};
|