@nysds/components 1.20.0-alpha1 → 1.20.0
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 +7119 -3701
- package/dist/.vscode/vscode.css-custom-data.json +5 -0
- package/dist/.vscode/vscode.html-custom-data.json +317 -38
- package/dist/custom-elements.json +7119 -3701
- package/dist/nys-icon.library-Bu3noJqZ-1mvg_e5Y.js +706 -0
- package/dist/nys-icon.library-Bu3noJqZ-1mvg_e5Y.js.map +1 -0
- package/dist/nys-icon.library-eNVZmfkf.js +696 -0
- package/dist/nys-icon.library-eNVZmfkf.js.map +1 -0
- package/dist/nysds.es.js +9119 -4161
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +2413 -492
- package/dist/nysds.js.map +1 -1
- package/dist/packages/internals/src/aria-associate.d.ts +41 -0
- package/dist/packages/internals/src/form-control-mixin.d.ts +34 -0
- package/dist/packages/internals/src/id.d.ts +8 -0
- package/dist/packages/internals/src/identified-mixin.d.ts +23 -0
- package/dist/packages/internals/src/index.d.ts +7 -0
- package/dist/packages/internals/src/reflects-aria-mixin.d.ts +33 -0
- package/dist/packages/internals/src/test-helpers.d.ts +29 -0
- package/dist/packages/internals/src/types.d.ts +9 -0
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +72 -10
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +63 -8
- package/dist/packages/nys-alert/src/nys-alert.d.ts +95 -20
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +100 -7
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +75 -5
- package/dist/packages/nys-badge/src/nys-badge.d.ts +63 -6
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +79 -10
- package/dist/packages/nys-button/src/nys-button.d.ts +132 -26
- package/dist/packages/nys-card/src/index.d.ts +1 -0
- package/dist/packages/nys-card/src/nys-card.d.ts +325 -0
- package/dist/packages/nys-card/src/nys-card.figma.d.ts +1 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +37 -12
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +84 -6
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +174 -5
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +83 -13
- package/dist/packages/nys-divider/src/nys-divider.d.ts +33 -9
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +24 -15
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +3 -12
- package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +22 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +129 -12
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +23 -2
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +99 -9
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +197 -7
- package/dist/packages/nys-icon/src/icon-cache.d.ts +11 -4
- package/dist/packages/nys-icon/src/icon-library-registry.d.ts +33 -16
- package/dist/packages/nys-icon/src/index.d.ts +2 -2
- package/dist/packages/nys-icon/src/nys-icon.d.ts +98 -8
- package/dist/packages/nys-iconlist/src/index.d.ts +2 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +92 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.figma.d.ts +1 -0
- package/dist/packages/nys-iconlist/src/nys-iconlistitem.d.ts +32 -0
- package/dist/packages/nys-label/src/nys-label.d.ts +37 -2
- package/dist/packages/nys-modal/src/nys-modal.d.ts +145 -13
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +67 -3
- package/dist/packages/nys-processlist/src/index.d.ts +2 -0
- package/dist/packages/nys-processlist/src/nys-processlist.d.ts +184 -0
- package/dist/packages/nys-processlist/src/nys-processlist.figma.d.ts +1 -0
- package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +41 -0
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +201 -7
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +88 -6
- package/dist/packages/nys-select/src/nys-option.d.ts +0 -8
- package/dist/packages/nys-select/src/nys-select.d.ts +150 -15
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +4 -4
- package/dist/packages/nys-stepper/src/nys-step.d.ts +26 -20
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +128 -75
- package/dist/packages/nys-tab/src/nys-tab.d.ts +19 -10
- package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +181 -39
- package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +15 -24
- package/dist/packages/nys-table/src/nys-table.d.ts +90 -3
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +60 -10
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +77 -14
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +47 -10
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +48 -8
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +45 -4
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +219 -10
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +421 -37
- package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +4 -54
- package/dist/packages/nys-video/src/nys-video.d.ts +67 -7
- package/dist/src/index.d.ts +5 -2
- package/package.json +15 -7
- package/packages/react/NysAccordion.d.ts +10 -0
- package/packages/react/NysAccordion.js +2 -1
- package/packages/react/NysAccordionItem.d.ts +10 -0
- package/packages/react/NysAccordionItem.js +3 -1
- package/packages/react/NysAlert.d.ts +8 -10
- package/packages/react/NysAlert.js +0 -2
- package/packages/react/NysAvatar.d.ts +11 -1
- package/packages/react/NysBacktotop.d.ts +3 -0
- package/packages/react/NysBacktotop.js +2 -1
- package/packages/react/NysBreadcrumbs.d.ts +2 -2
- package/packages/react/NysButton.d.ts +38 -8
- package/packages/react/NysButton.js +6 -4
- package/packages/react/NysCard.d.ts +110 -0
- package/packages/react/NysCard.js +61 -0
- package/packages/react/NysCheckbox.d.ts +9 -0
- package/packages/react/NysCheckbox.js +4 -0
- package/packages/react/NysDropdownMenu.d.ts +4 -2
- package/packages/react/NysFileinput.d.ts +25 -3
- package/packages/react/NysFileinput.js +8 -1
- package/packages/react/NysGlobalFooter.d.ts +17 -0
- package/packages/react/NysGlobalFooter.js +10 -2
- package/packages/react/NysGlobalHeader.d.ts +23 -1
- package/packages/react/NysGlobalHeader.js +11 -2
- package/packages/react/NysIconlist.d.ts +54 -0
- package/packages/react/NysIconlist.js +22 -0
- package/packages/react/NysIconlistitem.d.ts +59 -0
- package/packages/react/NysIconlistitem.js +22 -0
- package/packages/react/NysLabel.d.ts +4 -1
- package/packages/react/NysModal.d.ts +8 -1
- package/packages/react/NysModal.js +11 -2
- package/packages/react/NysProcesslist.d.ts +65 -0
- package/packages/react/NysProcesslist.js +25 -0
- package/packages/react/NysProcesslistitem.d.ts +61 -0
- package/packages/react/NysProcesslistitem.js +35 -0
- package/packages/react/NysRadiobutton.d.ts +27 -3
- package/packages/react/NysRadiobutton.js +9 -1
- package/packages/react/NysSelect.d.ts +3 -0
- package/packages/react/NysSelect.js +2 -0
- package/packages/react/NysStepper.d.ts +1 -1
- package/packages/react/NysTabgroup.d.ts +5 -4
- package/packages/react/NysTable.d.ts +1 -1
- package/packages/react/NysTabpanel.d.ts +11 -4
- package/packages/react/NysTextarea.d.ts +4 -1
- package/packages/react/NysTextarea.js +2 -0
- package/packages/react/NysUnavFooter.d.ts +13 -0
- package/packages/react/NysUnavFooter.js +4 -1
- package/packages/react/NysUnavHeader.d.ts +24 -1
- package/packages/react/NysUnavHeader.js +17 -1
- package/packages/react/NysVerticalnav.d.ts +15 -8
- package/packages/react/NysVerticalnav.js +6 -4
- package/packages/react/NysVerticalnavGroup.d.ts +4 -0
- package/packages/react/NysVerticalnavGroup.js +5 -0
- package/packages/react/index.d.ts +5 -0
- package/packages/react/index.js +5 -0
- package/packages/react/nysds-jsx.d.ts +394 -56
|
@@ -67,6 +67,15 @@ export type NysAccordionProps = {
|
|
|
67
67
|
singleSelect?: boolean;
|
|
68
68
|
/** Adds borders around each accordion item. Propagates to all children. */
|
|
69
69
|
bordered?: boolean;
|
|
70
|
+
/** Heading element wrapping every item's toggle button (`h2` through `h6`).
|
|
71
|
+
|
|
72
|
+
Each item's trigger is a real heading, so this is what places the accordion
|
|
73
|
+
in the page outline: choose one level below the heading that introduces the
|
|
74
|
+
accordion (an accordion under an `h2` section heading uses the `h3`
|
|
75
|
+
default). An individual `nys-accordionitem` can override it with its own
|
|
76
|
+
`headingLevel`. `h1` is not offered because an accordion trigger is never
|
|
77
|
+
the page title. */
|
|
78
|
+
headingLevel?: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
70
79
|
};
|
|
71
80
|
|
|
72
81
|
export type NysAccordionItemProps = {
|
|
@@ -74,6 +83,15 @@ export type NysAccordionItemProps = {
|
|
|
74
83
|
id?: string;
|
|
75
84
|
/** Heading text displayed in the clickable toggle button. */
|
|
76
85
|
heading?: string;
|
|
86
|
+
/** Heading element that wraps the toggle button (`h2` through `h6`).
|
|
87
|
+
|
|
88
|
+
Pick the level that puts the trigger in the right place in the page
|
|
89
|
+
outline — one level below the heading that introduces the accordion. Leave
|
|
90
|
+
it empty to follow the `headingLevel` of the enclosing `nys-accordion`,
|
|
91
|
+
which is the usual way to set it for a whole group; `h3` applies when
|
|
92
|
+
neither is specified. `h1` is not offered because an accordion trigger is
|
|
93
|
+
never the page title. */
|
|
94
|
+
headingLevel?: "h2" | "h3" | "h4" | "h5" | "h6" | "";
|
|
77
95
|
/** Whether the content panel is visible. Toggle via click or keyboard. */
|
|
78
96
|
expanded?: boolean;
|
|
79
97
|
/** Adds border styling. Set by parent `nys-accordion`, not directly. */
|
|
@@ -104,20 +122,19 @@ export type NysAlertProps = {
|
|
|
104
122
|
primaryLabel?: string;
|
|
105
123
|
/** Label text for secondary action link. */
|
|
106
124
|
secondaryLabel?: string;
|
|
107
|
-
/** Semantic alert type affecting color and ARIA role. `danger`/`emergency` use
|
|
125
|
+
/** Semantic alert type affecting color and ARIA role. `warning`/`danger`/`emergency` use
|
|
126
|
+
`role="alert"` (assertive live region); `base`/`info`/`success` use `role="status"` (polite). */
|
|
108
127
|
type?: "base" | "info" | "success" | "warning" | "danger" | "emergency";
|
|
109
|
-
/** Returns ARIA role and
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
|
|
128
|
+
/** Returns the ARIA role and aria-live setting for the alert's live region based on type.
|
|
129
|
+
- `warning`/`danger`/`emergency` => role="alert", aria-live="assertive" (urgent, interrupts)
|
|
130
|
+
- `base`/`info`/`success` => role="status", aria-live="polite" (waits its turn)
|
|
131
|
+
|
|
132
|
+
`aria-live` is set explicitly alongside `role` (rather than relying on the role's implicit
|
|
133
|
+
live-region semantics) for more consistent behavior across browser/AT combinations. */
|
|
113
134
|
ariaAttributes?: {
|
|
114
|
-
role: "alert" | "status"
|
|
115
|
-
|
|
135
|
+
role: "alert" | "status";
|
|
136
|
+
ariaLive: "polite" | "assertive";
|
|
116
137
|
};
|
|
117
|
-
/** Returns live-region type for screen readers if applicable.
|
|
118
|
-
- 'polite' for status role
|
|
119
|
-
- undefined for alert (since it's implicitly assertive) or region */
|
|
120
|
-
liveRegion?: "polite" | undefined;
|
|
121
138
|
/** Fired when alert is dismissed. Detail: `{id, type, label}`. */
|
|
122
139
|
"onnys-close"?: (e: CustomEvent<CustomEvent>) => void;
|
|
123
140
|
};
|
|
@@ -125,7 +142,17 @@ export type NysAlertProps = {
|
|
|
125
142
|
export type NysAvatarProps = {
|
|
126
143
|
/** Unique identifier. Auto-generated if not provided. */
|
|
127
144
|
id?: string;
|
|
128
|
-
/** Accessible
|
|
145
|
+
/** Accessible name for the avatar — who or what it represents ("Jane Smith"),
|
|
146
|
+
not what it is ("avatar").
|
|
147
|
+
|
|
148
|
+
Leave it unset for a decorative avatar and the whole thing is hidden from
|
|
149
|
+
assistive tech, which is the right outcome next to a visible name. Set it
|
|
150
|
+
whenever the avatar is the only thing identifying the person, and always when
|
|
151
|
+
`interactive` is set: that renders a `<button>`, and a nameless button cannot
|
|
152
|
+
be operated by screen reader or voice-control users (WCAG 4.1.2). An
|
|
153
|
+
interactive avatar without a name logs a console warning.
|
|
154
|
+
|
|
155
|
+
Whitespace-only values — including a non-breaking space — count as no name. */
|
|
129
156
|
ariaLabel?: string;
|
|
130
157
|
/** Image URL. Takes priority over initials and icon. */
|
|
131
158
|
image?: string;
|
|
@@ -144,6 +171,8 @@ export type NysAvatarProps = {
|
|
|
144
171
|
};
|
|
145
172
|
|
|
146
173
|
export type NysBacktotopProps = {
|
|
174
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
175
|
+
id?: string;
|
|
147
176
|
/** Horizontal position: `left` or `right`. */
|
|
148
177
|
position?: string;
|
|
149
178
|
/** Force button visibility. Overrides auto-show scroll behavior. */
|
|
@@ -176,11 +205,11 @@ export type NysBadgeProps = {
|
|
|
176
205
|
export type NysBreadcrumbsProps = {
|
|
177
206
|
/** Unique identifier. Auto-generated if not provided. */
|
|
178
207
|
id?: string;
|
|
179
|
-
/** Accessible label for the `<nav>` landmark. Defaults to "
|
|
208
|
+
/** Accessible label for the `<nav>` landmark. Defaults to "Breadcrumb" if not set.
|
|
180
209
|
Override when multiple crumbs exist on the same page. */
|
|
181
210
|
ariaLabel?: string;
|
|
182
211
|
/** Controls the visual size of the breadcrumb text and spacing: `sm` for dense layouts, `md` (default) for standard use. */
|
|
183
|
-
size?: "sm" | "md"
|
|
212
|
+
size?: "sm" | "md";
|
|
184
213
|
/** On mobile, renders the trail as a single back-to-parent link pointing to the item before the current page.
|
|
185
214
|
Has no effect on desktop or when only one item is present (which always renders as a back link). */
|
|
186
215
|
backToParent?: boolean;
|
|
@@ -212,17 +241,45 @@ export type NysButtonProps = {
|
|
|
212
241
|
variant?: "filled" | "outline" | "ghost" | "text";
|
|
213
242
|
/** Adjusts colors for dark backgrounds. */
|
|
214
243
|
inverted?: boolean;
|
|
215
|
-
/** Visible button text. Use sentence case, action-oriented text (e.g., "Save Draft").
|
|
244
|
+
/** Visible button text. Use sentence case, action-oriented text (e.g., "Save Draft"). In `circle` mode it is visually hidden but still exposed to assistive tech as the accessible name. */
|
|
216
245
|
label?: string;
|
|
217
|
-
/**
|
|
218
|
-
|
|
219
|
-
|
|
246
|
+
/** ID of controlled element (e.g., dropdown or modal). Sets `aria-controls`.
|
|
247
|
+
|
|
248
|
+
Set this on `<nys-button>` rather than putting `aria-controls` on the host:
|
|
249
|
+
the host has no role, so ARIA placed there is not mapped into the
|
|
250
|
+
accessibility tree and never reaches the internal `<button>`. */
|
|
220
251
|
ariaControls?: string;
|
|
252
|
+
/** Disclosure state for buttons that show/hide content. Sets `aria-expanded`
|
|
253
|
+
on the internal `<button>`/`<a>`.
|
|
254
|
+
|
|
255
|
+
Use `"false"` when the controlled content is collapsed and `"true"` when it
|
|
256
|
+
is expanded, updating it every time the content toggles. Leave unset for
|
|
257
|
+
buttons that are not disclosure triggers — an `aria-expanded` that never
|
|
258
|
+
changes is worse than none. Pair with `ariaControls` pointing at the
|
|
259
|
+
element being shown or hidden.
|
|
260
|
+
|
|
261
|
+
Setting `aria-expanded` directly on the `<nys-button>` host does nothing:
|
|
262
|
+
a custom element with no role does not map its ARIA attributes into the
|
|
263
|
+
accessibility tree, and host ARIA does not cross into the shadow root. */
|
|
264
|
+
ariaExpanded?: "true" | "false" | "";
|
|
265
|
+
/** Marks this button as the current item within a set of related controls — the current
|
|
266
|
+
page of a pagination control, the current step of a wizard. Sets `aria-current` on the
|
|
267
|
+
internal `<button>`/`<a>`.
|
|
268
|
+
|
|
269
|
+
Use `"page"` inside a pagination landmark, `"step"` inside a step indicator, and
|
|
270
|
+
`"true"` when no more specific token fits. Only one control in a set is ever current:
|
|
271
|
+
leave the property unset on all the others rather than setting `"false"`, which the
|
|
272
|
+
spec reads as "explicitly not current" and adds nothing.
|
|
273
|
+
|
|
274
|
+
Setting `aria-current` directly on the `<nys-button>` host does nothing: a custom
|
|
275
|
+
element with no role does not map its ARIA attributes into the accessibility tree,
|
|
276
|
+
and host ARIA does not cross into the shadow root. */
|
|
277
|
+
ariaCurrent?: "page" | "step" | "location" | "date" | "time" | "true" | "false" | "";
|
|
221
278
|
/** Material Symbol icon before label. Not shown for `circle` mode. */
|
|
222
279
|
prefixIcon?: string;
|
|
223
280
|
/** Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode. */
|
|
224
281
|
suffixIcon?: string;
|
|
225
|
-
/** Renders circular icon-only button. Requires `icon` prop. `label`
|
|
282
|
+
/** Renders circular icon-only button. Requires `icon` prop. `label` is rendered as visually-hidden text for the accessible name. */
|
|
226
283
|
circle?: boolean;
|
|
227
284
|
/** Icon for circle mode. Required when `circle` is true. Scales with size (sm=24px, md=32px, lg=40px). */
|
|
228
285
|
icon?: string;
|
|
@@ -232,8 +289,8 @@ export type NysButtonProps = {
|
|
|
232
289
|
form?: string | null;
|
|
233
290
|
/** Value submitted with form data. Only used when `type="submit"`. */
|
|
234
291
|
value?: string;
|
|
235
|
-
/**
|
|
236
|
-
|
|
292
|
+
/** ID(s) of element(s) describing this button. Sets `aria-describedby`. */
|
|
293
|
+
ariaDescribedBy?: string;
|
|
237
294
|
/** Form behavior: `button` (default, no form action), `submit` (submits form), `reset` (resets form). Always set explicitly to avoid unintended submissions. */
|
|
238
295
|
type?: "submit" | "reset" | "button";
|
|
239
296
|
/** URL to navigate to. Renders as `<a>` tag. Omit for action buttons. */
|
|
@@ -250,6 +307,42 @@ export type NysButtonProps = {
|
|
|
250
307
|
"onnys-click"?: (e: CustomEvent<Event>) => void;
|
|
251
308
|
};
|
|
252
309
|
|
|
310
|
+
export type NysCardProps = {
|
|
311
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
312
|
+
id?: string;
|
|
313
|
+
/** Appears above the heading text. */
|
|
314
|
+
preheading?: string;
|
|
315
|
+
/** Heading text in the card. */
|
|
316
|
+
heading?: string;
|
|
317
|
+
/** Heading level used for the card heading (`h1` through `h6`). */
|
|
318
|
+
headingLevel?: HeadingLevel;
|
|
319
|
+
/** Appears below the heading text. */
|
|
320
|
+
subheading?: string;
|
|
321
|
+
/** Appears below the subheading text. Takes in plain text. Use the main slot if the description requires rich text or more content. */
|
|
322
|
+
description?: string;
|
|
323
|
+
/** When true, adds padding around the media to visually contain it. */
|
|
324
|
+
inset?: boolean;
|
|
325
|
+
/** When true, adds a drop shadow to the card, giving it a raised appearance. */
|
|
326
|
+
elevated?: boolean;
|
|
327
|
+
/** URL to navigate to. Makes the whole card a single `<a>`. Keep the card's slots
|
|
328
|
+
free of other interactive elements when using this — nesting them inside the
|
|
329
|
+
card control is invalid HTML and unreachable for keyboard and screen reader users. */
|
|
330
|
+
href?: string;
|
|
331
|
+
/** Link target: `_self` (same tab), `_blank` (new tab), `_parent`, `_top`, or frame name. Only used with `href`. */
|
|
332
|
+
target?: "_self" | "_blank" | "_parent" | "_top" | "framename";
|
|
333
|
+
/** Click handler. Makes the whole card a single `<button>`. Use instead of
|
|
334
|
+
`@click` to ensure keyboard accessibility. Keep the card's slots free of
|
|
335
|
+
other interactive elements when using this — nesting them inside the card
|
|
336
|
+
control is invalid HTML and unreachable for keyboard and screen reader users. */
|
|
337
|
+
onClick?: ((event: Event) => void) | null;
|
|
338
|
+
/** Fired when an interactive card is activated (mouse or keyboard). */
|
|
339
|
+
"onnys-click"?: (e: CustomEvent<Event>) => void;
|
|
340
|
+
/** Fired when an interactive card receives focus. */
|
|
341
|
+
"onnys-focus"?: (e: CustomEvent<Event>) => void;
|
|
342
|
+
/** Fired when an interactive card loses focus. */
|
|
343
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
344
|
+
};
|
|
345
|
+
|
|
253
346
|
export type NysCheckboxProps = {
|
|
254
347
|
/** Whether checkbox is checked. */
|
|
255
348
|
checked?: boolean;
|
|
@@ -285,8 +378,17 @@ export type NysCheckboxProps = {
|
|
|
285
378
|
other?: boolean;
|
|
286
379
|
/** */
|
|
287
380
|
showOtherError?: boolean;
|
|
381
|
+
/** Id of an element in the host's light-DOM tree to borrow the accessible name
|
|
382
|
+
from (e.g. a table column `<th>`). Enables labelling a checkbox that has no
|
|
383
|
+
visible label of its own. */
|
|
384
|
+
labelledby?: string;
|
|
385
|
+
/** Suppress the internal visible `<nys-label>` (use with `labelledby` for
|
|
386
|
+
table cells). */
|
|
387
|
+
hideLabel?: boolean;
|
|
288
388
|
/** */
|
|
289
389
|
_hasDescription?: string;
|
|
390
|
+
/** */
|
|
391
|
+
_isStandalone?: string;
|
|
290
392
|
/** Fired when checked state changes. Detail: `{id, checked, name, value}`. */
|
|
291
393
|
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
292
394
|
/** Fired when "other" text input value changes. Detail: `{id, name, value}`. */
|
|
@@ -428,7 +530,9 @@ export type NysDropdownMenuProps = {
|
|
|
428
530
|
for?: string;
|
|
429
531
|
/** */
|
|
430
532
|
showDropdown?: boolean;
|
|
431
|
-
/** Accessible label for the menu. Used as `aria-label`
|
|
533
|
+
/** Accessible label for the menu (`role="menu"`) container. Used as `aria-label`
|
|
534
|
+
on the `<ul role="menu">` element. When empty, falls back to "Menu" so the
|
|
535
|
+
menu always has an accessible name for screen readers. */
|
|
432
536
|
label?: string;
|
|
433
537
|
/** Preferred position relative to trigger. */
|
|
434
538
|
position?: Position | null;
|
|
@@ -496,8 +600,18 @@ export type NysFileinputProps = {
|
|
|
496
600
|
width?: "lg" | "full";
|
|
497
601
|
/** Adjusts colors for dark backgrounds. */
|
|
498
602
|
inverted?: boolean;
|
|
499
|
-
|
|
500
|
-
|
|
603
|
+
/** The currently selected files. Read to get the current selection; set to
|
|
604
|
+
replace it (e.g. rehydrating state after navigation, or binding from a
|
|
605
|
+
framework form model). Property-only — a `File[]` cannot round-trip through
|
|
606
|
+
an HTML attribute. Setting this is silent (does not emit `nys-change`),
|
|
607
|
+
matching native input behavior and avoiding feedback loops in two-way bindings. */
|
|
608
|
+
files?: File[];
|
|
609
|
+
/** Single-file convenience accessor (parity with `nys-textinput`'s `value`).
|
|
610
|
+
Reads the first selected file (or `null`); setting replaces the selection. */
|
|
611
|
+
value?: File | null;
|
|
612
|
+
/** Fired when focus leaves the component. Triggers validation. */
|
|
613
|
+
"onnys-blur"?: (e: CustomEvent<Event>) => void;
|
|
614
|
+
/** Fired once per user action (file selection, drop, or removal). Detail: `{id, files, changedFiles}`. The `files` is the full current selection Whereas `changedFiles` is the entries this action added or removed. Both `changedFiles` and each entry in `files` are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`. */
|
|
501
615
|
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
502
616
|
};
|
|
503
617
|
|
|
@@ -516,23 +630,57 @@ export type NysFileItemProps = {
|
|
|
516
630
|
};
|
|
517
631
|
|
|
518
632
|
export type NysGlobalFooterProps = {
|
|
633
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
634
|
+
id?: string;
|
|
519
635
|
/** Agency name displayed as the footer heading. */
|
|
520
636
|
agencyName?: string;
|
|
521
637
|
/** Optional subheading displayed below the agency name. */
|
|
522
638
|
agencySubheading?: string;
|
|
523
639
|
/** URL for the agency name link. If empty, name is not clickable. */
|
|
524
640
|
homepageLink?: string;
|
|
641
|
+
/** Accessible name for the `contentinfo` landmark this footer renders.
|
|
642
|
+
|
|
643
|
+
Leave it unset and the landmark is named after the visible `agencyName`
|
|
644
|
+
heading, which cannot drift out of sync and is translated with the rest of
|
|
645
|
+
the page. Falls back to `"Site"` when there is no agency name to reference.
|
|
646
|
+
|
|
647
|
+
Set this only when the agency name is not right for your audience. A page
|
|
648
|
+
pairing this with `nys-unavfooter` carries two `contentinfo` landmarks, so
|
|
649
|
+
the name must stay distinct from that footer's (`"New York State"` by
|
|
650
|
+
default) or landmark navigation stops distinguishing them.
|
|
651
|
+
|
|
652
|
+
An explicit name replaces the reference to the visible heading. */
|
|
653
|
+
landmarkLabel?: string;
|
|
525
654
|
};
|
|
526
655
|
|
|
527
656
|
export type NysGlobalHeaderProps = {
|
|
657
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
658
|
+
id?: string;
|
|
528
659
|
/** Application name displayed prominently. */
|
|
529
660
|
appName?: string;
|
|
530
661
|
/** Agency name displayed below app name (or as main title if no appName). */
|
|
531
662
|
agencyName?: string;
|
|
532
663
|
/** URL for the header title link. If empty, title is not clickable. */
|
|
533
664
|
homepageLink?: string;
|
|
534
|
-
/**
|
|
665
|
+
/** Displays the NYS brand mark in the header. Off by default.
|
|
666
|
+
|
|
667
|
+
Enable only for internal, state-employee (back-office) applications that omit
|
|
668
|
+
`nys-unavheader`. Any resident-facing app — even one requiring login — should
|
|
669
|
+
keep `nys-unavheader` for trust and leave this off. */
|
|
535
670
|
nysLogo?: boolean;
|
|
671
|
+
/** Accessible name for the `banner` landmark this header renders.
|
|
672
|
+
|
|
673
|
+
Leave it unset and the banner is named after the visible `appName` or
|
|
674
|
+
`agencyName`, which cannot drift out of sync and is translated with the rest
|
|
675
|
+
of the page. Falls back to `"Site"` when there is no title to reference.
|
|
676
|
+
|
|
677
|
+
Set this only when neither is right for your audience. A page pairing this
|
|
678
|
+
with `nys-unavheader` carries two `banner` landmarks, so the name must stay
|
|
679
|
+
distinct from that header's (`"New York State"` by default) or landmark
|
|
680
|
+
navigation stops distinguishing them.
|
|
681
|
+
|
|
682
|
+
An explicit name replaces the reference to the visible title. */
|
|
683
|
+
landmarkLabel?: string;
|
|
536
684
|
};
|
|
537
685
|
|
|
538
686
|
export type NysIconProps = {
|
|
@@ -572,6 +720,21 @@ export type NysIconProps = {
|
|
|
572
720
|
updateComplete?: Promise<boolean>;
|
|
573
721
|
};
|
|
574
722
|
|
|
723
|
+
export type NysIconlistProps = {
|
|
724
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
725
|
+
id?: string;
|
|
726
|
+
/** Draws a divider between items. No divider is drawn after the last item. */
|
|
727
|
+
divider?: boolean;
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
export type NysIconlistitemProps = {
|
|
731
|
+
/** Material Symbols icon name passed to `<nys-icon>`. */
|
|
732
|
+
icon?: string;
|
|
733
|
+
/** Draws a rule below the item. Set by the parent `<nys-iconlist divider>`; not intended to be
|
|
734
|
+
set directly. */
|
|
735
|
+
divider?: boolean;
|
|
736
|
+
};
|
|
737
|
+
|
|
575
738
|
export type NysLabelProps = {
|
|
576
739
|
/** The ID of the label. */
|
|
577
740
|
id?: string;
|
|
@@ -585,7 +748,8 @@ export type NysLabelProps = {
|
|
|
585
748
|
inverted?: boolean;
|
|
586
749
|
/** Tooltip text shown on hover/focus of info icon next to label. */
|
|
587
750
|
tooltip?: string;
|
|
588
|
-
|
|
751
|
+
/** */
|
|
752
|
+
_hasDescription?: string;
|
|
589
753
|
/** */
|
|
590
754
|
"onnys-label-click"?: (e: CustomEvent<CustomEvent>) => void;
|
|
591
755
|
};
|
|
@@ -593,8 +757,14 @@ export type NysLabelProps = {
|
|
|
593
757
|
export type NysModalProps = {
|
|
594
758
|
/** Unique identifier. Auto-generated if not provided. */
|
|
595
759
|
id?: string;
|
|
596
|
-
/** Modal heading text. Required for accessibility
|
|
760
|
+
/** Modal heading text. Required for accessibility — it becomes the dialog's
|
|
761
|
+
accessible name via `aria-labelledby`. */
|
|
597
762
|
heading?: string;
|
|
763
|
+
/** Accessible name for the dialog, used only when no `heading` is set.
|
|
764
|
+
Prefer a visible `heading`: a visible label satisfies WCAG 2.5.3 (Label in
|
|
765
|
+
Name) and gives sighted users the same information. Use `ariaLabel` for the
|
|
766
|
+
rare headless dialog so it still exposes a name (WCAG 4.1.2). */
|
|
767
|
+
ariaLabel?: string;
|
|
598
768
|
/** Secondary heading below the main heading. */
|
|
599
769
|
subheading?: string;
|
|
600
770
|
/** Controls modal visibility. Set to `true` to show. */
|
|
@@ -626,6 +796,31 @@ export type NysPaginationProps = {
|
|
|
626
796
|
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
627
797
|
};
|
|
628
798
|
|
|
799
|
+
export type NysProcesslistProps = {
|
|
800
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
801
|
+
id?: string;
|
|
802
|
+
/** Renders each step number in a bolder, higher-emphasis color. */
|
|
803
|
+
strong?: boolean;
|
|
804
|
+
/** Renders each step number using neutral (grayscale) coloring instead of the theme color. */
|
|
805
|
+
neutral?: boolean;
|
|
806
|
+
/** Step marker size: `sm` (smaller) or `md` (default). */
|
|
807
|
+
size?: "md" | "sm";
|
|
808
|
+
/** Number given to the first step. Subsequent steps count up from it. Use this when one
|
|
809
|
+
process is split across several lists so the later lists continue the count instead of
|
|
810
|
+
restarting at 1. */
|
|
811
|
+
initialStep?: number;
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
export type NysProcesslistitemProps = {
|
|
815
|
+
/** Step heading text. */
|
|
816
|
+
label?: string;
|
|
817
|
+
/** Supporting information displayed below the label. Use the `description` slot for rich text. */
|
|
818
|
+
description?: string;
|
|
819
|
+
/** A description is shown when either the property or the slot has content, so an item with
|
|
820
|
+
neither renders no empty paragraph. */
|
|
821
|
+
_hasDescription?: string;
|
|
822
|
+
};
|
|
823
|
+
|
|
629
824
|
export type NysRadiobuttonProps = {
|
|
630
825
|
/** Whether this radio is selected. Only one per group can be checked. */
|
|
631
826
|
checked?: boolean;
|
|
@@ -653,9 +848,25 @@ export type NysRadiobuttonProps = {
|
|
|
653
848
|
other?: boolean;
|
|
654
849
|
/** */
|
|
655
850
|
showOtherError?: boolean;
|
|
656
|
-
|
|
851
|
+
/** Id of an element in the host's light-DOM tree to borrow the accessible name
|
|
852
|
+
from (e.g. a table row `<th>`). Enables labelling a radio button that has no
|
|
853
|
+
visible label of its own.
|
|
854
|
+
|
|
855
|
+
Standalone radios only: inside a `nys-radiogroup` the group renders the
|
|
856
|
+
native inputs and names them from the group's own labels. */
|
|
857
|
+
labelledby?: string;
|
|
858
|
+
/** Suppress the internal visible `<nys-label>` (use with `labelledby` for
|
|
859
|
+
table cells). Without `labelledby` there is no visible element left to name
|
|
860
|
+
the radio from, so the accessible name falls back to the `label` string —
|
|
861
|
+
pair `hideLabel` with `labelledby` wherever a visible element exists. */
|
|
862
|
+
hideLabel?: boolean;
|
|
863
|
+
/** Public validation API (Form Association)
|
|
864
|
+
-------------------------------------------------------------------------- */
|
|
865
|
+
validity?: ValidityState | undefined;
|
|
866
|
+
/** */
|
|
867
|
+
validationMessage?: string;
|
|
657
868
|
/** Fired when selection changes. Detail: `{id, checked, name, value}`. */
|
|
658
|
-
"onnys-change"?: (e: CustomEvent<
|
|
869
|
+
"onnys-change"?: (e: CustomEvent<CustomEvent>) => void;
|
|
659
870
|
/** Fired when radio gains focus. */
|
|
660
871
|
"onnys-focus"?: (e: CustomEvent<never>) => void;
|
|
661
872
|
/** Fired when radio loses focus. */
|
|
@@ -720,6 +931,8 @@ export type NysSelectProps = {
|
|
|
720
931
|
label?: string;
|
|
721
932
|
/** Helper text below label. Use slot for custom HTML. */
|
|
722
933
|
description?: string;
|
|
934
|
+
/** Accessible label. Used as a fallback when `label` is not provided. */
|
|
935
|
+
ariaLabel?: string;
|
|
723
936
|
/** Currently selected option value. */
|
|
724
937
|
value?: string;
|
|
725
938
|
/** Prevents interaction. */
|
|
@@ -776,7 +989,7 @@ Omit for SPA/framework routing and handle navigation in the event listener inste
|
|
|
776
989
|
};
|
|
777
990
|
|
|
778
991
|
export type NysStepperProps = {
|
|
779
|
-
/** Unique identifier. Auto-generated as `nys-stepper-{
|
|
992
|
+
/** Unique identifier. Auto-generated as `nys-stepper-{timestamp}-{n}` if not provided. */
|
|
780
993
|
id?: string;
|
|
781
994
|
/** Name attribute for form association. */
|
|
782
995
|
name?: string;
|
|
@@ -862,7 +1075,7 @@ export type NysTextareaProps = {
|
|
|
862
1075
|
value?: string;
|
|
863
1076
|
/** Prevents interaction. */
|
|
864
1077
|
disabled?: boolean;
|
|
865
|
-
/** Makes textarea
|
|
1078
|
+
/** Makes textarea readonly but focusable. */
|
|
866
1079
|
readonly?: boolean;
|
|
867
1080
|
/** Marks as required. Shows "Required" flag and validates on blur. */
|
|
868
1081
|
required?: boolean;
|
|
@@ -886,6 +1099,8 @@ export type NysTextareaProps = {
|
|
|
886
1099
|
showError?: boolean;
|
|
887
1100
|
/** Error message text. Shown only when `showError` is true. */
|
|
888
1101
|
errorMessage?: string;
|
|
1102
|
+
/** Accessible label used only when no visible `label` is provided. */
|
|
1103
|
+
ariaLabel?: string;
|
|
889
1104
|
|
|
890
1105
|
/** Fired on input change. Detail: `{id, value}`. */
|
|
891
1106
|
"onnys-input"?: (e: CustomEvent<CustomEvent>) => void;
|
|
@@ -1000,7 +1215,20 @@ export type NysTooltipProps = {
|
|
|
1000
1215
|
position?: string;
|
|
1001
1216
|
};
|
|
1002
1217
|
|
|
1003
|
-
export type NysUnavFooterProps = {
|
|
1218
|
+
export type NysUnavFooterProps = {
|
|
1219
|
+
/** Accessible name for the `contentinfo` landmark this footer renders.
|
|
1220
|
+
Defaults to `"New York State"`.
|
|
1221
|
+
|
|
1222
|
+
A page pairing this footer with `nys-globalfooter` carries two `contentinfo`
|
|
1223
|
+
landmarks; distinct names are what keep landmark navigation useful instead of
|
|
1224
|
+
announcing "content information" twice. Override only when your wording is
|
|
1225
|
+
clearer for your audience — and keep it distinct from the agency footer's
|
|
1226
|
+
name, which comes from that footer's visible heading.
|
|
1227
|
+
|
|
1228
|
+
A blank value falls back to the default rather than leaving the landmark
|
|
1229
|
+
unnamed. */
|
|
1230
|
+
landmarkLabel?: string;
|
|
1231
|
+
};
|
|
1004
1232
|
|
|
1005
1233
|
export type NysUnavHeaderProps = {
|
|
1006
1234
|
/** Internal: Whether trust bar panel is expanded. */
|
|
@@ -1017,19 +1245,38 @@ export type NysUnavHeaderProps = {
|
|
|
1017
1245
|
hideSearch?: boolean;
|
|
1018
1246
|
/** The URL endpoint of the search, make sure to include the query param. */
|
|
1019
1247
|
searchUrl?: string;
|
|
1248
|
+
/** Accessible name for the `banner` landmark this header renders.
|
|
1249
|
+
Defaults to `"New York State"`.
|
|
1250
|
+
|
|
1251
|
+
A page pairing this header with `nys-globalheader` carries two `banner`
|
|
1252
|
+
landmarks; distinct names are what keep landmark navigation useful instead of
|
|
1253
|
+
announcing "banner, banner". Override only when your wording is clearer for
|
|
1254
|
+
your audience — and keep it distinct from the agency header's name, which
|
|
1255
|
+
comes from that header's visible title.
|
|
1256
|
+
|
|
1257
|
+
A blank value falls back to the default rather than leaving the landmark
|
|
1258
|
+
unnamed. */
|
|
1259
|
+
landmarkLabel?: string;
|
|
1020
1260
|
/** The list of languages this site can be translated to, default to use Smartling */
|
|
1021
1261
|
languages?: Language[];
|
|
1262
|
+
|
|
1263
|
+
/** Fired when a language is selected. Detail: `{language: {code, label, url?}}`. Cancelable; `preventDefault()` overrides the default Smartling redirect. */
|
|
1264
|
+
"onnys-language-select"?: (e: CustomEvent<never>) => void;
|
|
1265
|
+
/** Fired when a search is submitted. Detail: `{query}`. Cancelable; `preventDefault()` overrides the default search redirect. */
|
|
1266
|
+
"onnys-search-submit"?: (e: CustomEvent<never>) => void;
|
|
1022
1267
|
};
|
|
1023
1268
|
|
|
1024
1269
|
export type NysVerticalnavProps = {
|
|
1025
|
-
/**
|
|
1270
|
+
/** ID for the navigation. Generated automatically if not provided. */
|
|
1026
1271
|
id?: string;
|
|
1027
|
-
/**
|
|
1028
|
-
|
|
1029
|
-
/**
|
|
1030
|
-
|
|
1031
|
-
/**
|
|
1032
|
-
|
|
1272
|
+
/** Heading text displayed at the top of the navigation. Defaults to "Page navigation". */
|
|
1273
|
+
heading?: string;
|
|
1274
|
+
/** Hides the visible heading while keeping an accessible label for the navigation. */
|
|
1275
|
+
hideHeading?: boolean;
|
|
1276
|
+
/** Heading level used for the navigation heading (`h1` through `h6`). */
|
|
1277
|
+
headingLevel?: HeadingLevel;
|
|
1278
|
+
/** Expands or collapses the navigation on mobile. */
|
|
1279
|
+
expanded?: boolean;
|
|
1033
1280
|
};
|
|
1034
1281
|
|
|
1035
1282
|
export type NysVerticalnavGroupProps = {
|
|
@@ -1046,6 +1293,8 @@ export type NysVerticalnavGroupProps = {
|
|
|
1046
1293
|
|
|
1047
1294
|
/** */
|
|
1048
1295
|
"onnys-child-resize"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1296
|
+
/** */
|
|
1297
|
+
"onnys-verticalnavgroup-toggle"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1049
1298
|
};
|
|
1050
1299
|
|
|
1051
1300
|
export type NysVideoProps = {
|
|
@@ -1150,7 +1399,7 @@ export type CustomElements = {
|
|
|
1150
1399
|
* - **nys-breadcrumbs-expand** - Fired when the user clicks the ellipsis to expand the trail.
|
|
1151
1400
|
*
|
|
1152
1401
|
* ### **Slots:**
|
|
1153
|
-
* - _default_ - One or more `
|
|
1402
|
+
* - _default_ - One or more `li` elements defining the trail.
|
|
1154
1403
|
*/
|
|
1155
1404
|
"nys-breadcrumbs": Partial<NysBreadcrumbsProps & BaseProps & BaseEvents>;
|
|
1156
1405
|
|
|
@@ -1165,7 +1414,8 @@ export type CustomElements = {
|
|
|
1165
1414
|
* - **nys-click** - Fired when the button is clicked (mouse or keyboard). Not fired when disabled.
|
|
1166
1415
|
*
|
|
1167
1416
|
* ### **Slots:**
|
|
1168
|
-
* -
|
|
1417
|
+
* - _default_ - Button label text. Use as fallback when `label` prop is not provided.
|
|
1418
|
+
* - **prefix-icon** - Icon before label. Not shown for `text` variant.
|
|
1169
1419
|
* - **suffix-icon** - Icon after label. Not shown for `text` variant.
|
|
1170
1420
|
* - **circle-icon** - Icon for circle mode. Overrides `icon` prop.
|
|
1171
1421
|
*
|
|
@@ -1182,6 +1432,28 @@ export type CustomElements = {
|
|
|
1182
1432
|
*/
|
|
1183
1433
|
"nys-button": Partial<NysButtonProps & BaseProps & BaseEvents>;
|
|
1184
1434
|
|
|
1435
|
+
/**
|
|
1436
|
+
* Flexible container that groups related content and actions about a single subject.
|
|
1437
|
+
* ---
|
|
1438
|
+
*
|
|
1439
|
+
*
|
|
1440
|
+
* ### **Events:**
|
|
1441
|
+
* - **nys-click** - Fired when an interactive card is activated (mouse or keyboard).
|
|
1442
|
+
* - **nys-focus** - Fired when an interactive card receives focus.
|
|
1443
|
+
* - **nys-blur** - Fired when an interactive card loses focus.
|
|
1444
|
+
*
|
|
1445
|
+
* ### **Slots:**
|
|
1446
|
+
* - **preheading** - Content rendered above the heading block (e.g. a badge or label).
|
|
1447
|
+
* - _default_ - Default slot for the card's main body. Use for rich content when the `description` property is not enough.
|
|
1448
|
+
* - **footer** - Content rendered at the footer of the card, typically actions like buttons or links.
|
|
1449
|
+
* - **media** - Visual content displayed at the top of the card, typically an `<img>`.
|
|
1450
|
+
* - **media-accent** - Text for the accent badge displayed over the media, typically a date. Pass a wrapper holding two elements: the first is rendered as the month line, the second as the day line. Only renders when the `media` slot has content. The card becomes a single interactive control when it is given something to do: an `href` renders it as an `<a>`, a click handler (`onClick` or an inline `onclick`) renders it as a `<button>`.
|
|
1451
|
+
*
|
|
1452
|
+
* ### **CSS Properties:**
|
|
1453
|
+
* - **--nys-card-height** - Height of the card. Set to `100%` to stretch the card to its container's height, so a row of cards renders at an equal height. The extra height is absorbed by the main content area, keeping the `footer` slot pinned to the bottom of the card. Requires the container to give the card a height to fill (e.g. a grid column with `nys-display-flex`). _(default: fit-content)_
|
|
1454
|
+
*/
|
|
1455
|
+
"nys-card": Partial<NysCardProps & BaseProps & BaseEvents>;
|
|
1456
|
+
|
|
1185
1457
|
/**
|
|
1186
1458
|
* Checkbox for binary choices or multi-select options.
|
|
1187
1459
|
* ---
|
|
@@ -1267,7 +1539,7 @@ export type CustomElements = {
|
|
|
1267
1539
|
"nys-divider": Partial<NysDividerProps & BaseProps & BaseEvents>;
|
|
1268
1540
|
|
|
1269
1541
|
/**
|
|
1270
|
-
*
|
|
1542
|
+
* Action menu with auto-positioning, keyboard support, and screen reader integration.
|
|
1271
1543
|
* ---
|
|
1272
1544
|
*
|
|
1273
1545
|
*/
|
|
@@ -1296,7 +1568,14 @@ export type CustomElements = {
|
|
|
1296
1568
|
*
|
|
1297
1569
|
*
|
|
1298
1570
|
* ### **Events:**
|
|
1299
|
-
* - **nys-
|
|
1571
|
+
* - **nys-blur** - Fired when focus leaves the component. Triggers validation.
|
|
1572
|
+
* - **nys-change** - Fired once per user action (file selection, drop, or removal). Detail: `{id, files, changedFiles}`. The `files` is the full current selection Whereas `changedFiles` is the entries this action added or removed. Both `changedFiles` and each entry in `files` are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`.
|
|
1573
|
+
*
|
|
1574
|
+
* ### **Methods:**
|
|
1575
|
+
* - **setFiles(incoming: _File[]_): _Promise<void>_** - Programmatically set the selection and await async validation/processing.
|
|
1576
|
+
* Same as assigning `files`, but resolves once every file has finished its
|
|
1577
|
+
* magic-byte validation and read — use when you need to read `checkValidity()`
|
|
1578
|
+
* or the settled selection immediately after.
|
|
1300
1579
|
*
|
|
1301
1580
|
* ### **Slots:**
|
|
1302
1581
|
* - **description** - Custom HTML description content.
|
|
@@ -1330,6 +1609,7 @@ export type CustomElements = {
|
|
|
1330
1609
|
*
|
|
1331
1610
|
* ### **Slots:**
|
|
1332
1611
|
* - _default_ - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
|
|
1612
|
+
* - **user-actions** - User-account controls (e.g. profile link, settings, log-out button) shown in the header.
|
|
1333
1613
|
*/
|
|
1334
1614
|
"nys-globalheader": Partial<NysGlobalHeaderProps & BaseProps & BaseEvents>;
|
|
1335
1615
|
|
|
@@ -1344,7 +1624,28 @@ export type CustomElements = {
|
|
|
1344
1624
|
"nys-icon": Partial<NysIconProps & BaseProps & BaseEvents>;
|
|
1345
1625
|
|
|
1346
1626
|
/**
|
|
1347
|
-
*
|
|
1627
|
+
* A scannable list of icon + text items, with an optional divider between rows.
|
|
1628
|
+
* ---
|
|
1629
|
+
*
|
|
1630
|
+
*/
|
|
1631
|
+
"nys-iconlist": Partial<NysIconlistProps & BaseProps & BaseEvents>;
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* An icon-paired list item for use inside `<nys-iconlist>`.
|
|
1635
|
+
* ---
|
|
1636
|
+
*
|
|
1637
|
+
*
|
|
1638
|
+
* ### **Slots:**
|
|
1639
|
+
* - _default_ - Primary label text.
|
|
1640
|
+
* - **secondary** - Optional second line of text rendered below the primary label.
|
|
1641
|
+
*/
|
|
1642
|
+
"nys-iconlistitem": Partial<NysIconlistitemProps & BaseProps & BaseEvents>;
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* **Internal component.** Renders form labels with description, required/optional flag, and tooltip.
|
|
1646
|
+
*
|
|
1647
|
+
* Used internally by form components (textinput, select, checkbox, etc.). Not intended for direct use.
|
|
1648
|
+
* Handles label association via `for`, displays asterisk for required fields, and integrates tooltips.
|
|
1348
1649
|
* ---
|
|
1349
1650
|
*
|
|
1350
1651
|
*
|
|
@@ -1382,7 +1683,27 @@ export type CustomElements = {
|
|
|
1382
1683
|
"nys-pagination": Partial<NysPaginationProps & BaseProps & BaseEvents>;
|
|
1383
1684
|
|
|
1384
1685
|
/**
|
|
1385
|
-
*
|
|
1686
|
+
* An ordered list of numbered process steps.
|
|
1687
|
+
* ---
|
|
1688
|
+
*
|
|
1689
|
+
*/
|
|
1690
|
+
"nys-processlist": Partial<NysProcesslistProps & BaseProps & BaseEvents>;
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* A numbered step for use inside `<nys-processlist>`.
|
|
1694
|
+
* ---
|
|
1695
|
+
*
|
|
1696
|
+
*
|
|
1697
|
+
* ### **Slots:**
|
|
1698
|
+
* - **description** - Custom HTML description content below the label. Overrides the `description` property.
|
|
1699
|
+
*/
|
|
1700
|
+
"nys-processlistitem": Partial<NysProcesslistitemProps & BaseProps & BaseEvents>;
|
|
1701
|
+
|
|
1702
|
+
/**
|
|
1703
|
+
* Radio button for single selection from mutually exclusive options.
|
|
1704
|
+
* This is a READONLY data component when there is no `nys-radiogroup` wrapping the `nys-radiobutton`.
|
|
1705
|
+
* Otherwise this radiobutton mockup the native grouping of radio buttons via "name" attribute.
|
|
1706
|
+
* Since we can't do that naturally, we have supporting functions to keep track of keyboard navigation, a11y VO, and single radiobutton checked at all times.
|
|
1386
1707
|
* ---
|
|
1387
1708
|
*
|
|
1388
1709
|
*
|
|
@@ -1500,9 +1821,10 @@ export type CustomElements = {
|
|
|
1500
1821
|
* elements.
|
|
1501
1822
|
*
|
|
1502
1823
|
* Accepts tabs and panels as flat light-DOM children in any order (interleaved
|
|
1503
|
-
* or grouped). On slot change,
|
|
1504
|
-
*
|
|
1505
|
-
*
|
|
1824
|
+
* or grouped). On slot change, each child is assigned `slot="tab"` or
|
|
1825
|
+
* `slot="panel"` so it is projected into the correct shadow-DOM container
|
|
1826
|
+
* while remaining in the light DOM, ARIA relationships are wired, and the
|
|
1827
|
+
* first selected (or first) tab is activated.
|
|
1506
1828
|
*
|
|
1507
1829
|
* Scroll shadows are rendered on either side of the tab list and toggled via
|
|
1508
1830
|
* `ResizeObserver` and a `scroll` listener so they accurately reflect whether
|
|
@@ -1516,7 +1838,7 @@ export type CustomElements = {
|
|
|
1516
1838
|
*
|
|
1517
1839
|
*
|
|
1518
1840
|
* ### **Slots:**
|
|
1519
|
-
* - _default_ - Accepts `<nys-tab>` and `<nys-tabpanel>` children.
|
|
1841
|
+
* - _default_ - Accepts `<nys-tab>` and `<nys-tabpanel>` children. On `slotchange` they are assigned `slot="tab"` / `slot="panel"` and projected into the tablist and panel containers; they stay in the light DOM. Any other children remain in the default slot, rendered below the panels.
|
|
1520
1842
|
*/
|
|
1521
1843
|
"nys-tabgroup": Partial<NysTabgroupProps & BaseProps & BaseEvents>;
|
|
1522
1844
|
|
|
@@ -1525,14 +1847,21 @@ export type CustomElements = {
|
|
|
1525
1847
|
* `<nys-tabgroup>`.
|
|
1526
1848
|
*
|
|
1527
1849
|
* Pairing is determined by render order: the Nth `<nys-tabpanel>` child of a
|
|
1528
|
-
* `<nys-tabgroup>` corresponds to the Nth `<nys-tab>` child
|
|
1529
|
-
* `aria-labelledby` and the `hidden` attribute are managed
|
|
1530
|
-
* `<nys-tabgroup>` via `_applySelection`; do not set them
|
|
1850
|
+
* `<nys-tabgroup>` corresponds to the Nth `<nys-tab>` child (or by explicit
|
|
1851
|
+
* `aria-labelledby`). `aria-labelledby` and the `hidden` attribute are managed
|
|
1852
|
+
* externally by `<nys-tabgroup>` via `_applySelection`; do not set them
|
|
1853
|
+
* directly.
|
|
1854
|
+
*
|
|
1855
|
+
* The panel container is styled from the light DOM (`nys-tabpanel.light.scss`,
|
|
1856
|
+
* adopted on the document) rather than a shadow-DOM wrapper. This keeps the
|
|
1857
|
+
* slotted panel content in the light DOM — reachable by consumer CSS and
|
|
1858
|
+
* JavaScript — and lets consumers override the panel's own styling (e.g.
|
|
1859
|
+
* `nys-tabpanel { padding: 0 }`), which a shadow wrapper would prevent.
|
|
1531
1860
|
* ---
|
|
1532
1861
|
*
|
|
1533
1862
|
*
|
|
1534
1863
|
* ### **Slots:**
|
|
1535
|
-
* - _default_ - Default slot for panel content. Rendered
|
|
1864
|
+
* - _default_ - Default slot for panel content. Rendered directly under the host, which is the scrollable, focusable (`tabindex="0"`) `role="tabpanel"` region.
|
|
1536
1865
|
*/
|
|
1537
1866
|
"nys-tabpanel": Partial<NysTabpanelProps & BaseProps & BaseEvents>;
|
|
1538
1867
|
|
|
@@ -1547,7 +1876,7 @@ export type CustomElements = {
|
|
|
1547
1876
|
* - **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" }
|
|
1548
1877
|
*
|
|
1549
1878
|
* ### **Slots:**
|
|
1550
|
-
* - _default_ - Accepts a `<table>` element. Only the first table is
|
|
1879
|
+
* - _default_ - Accepts a `<table>` element. Only the first table is used. The table is enhanced in place and stays in the light DOM (projected through a slot, never cloned), so embedded components remain interactive and reachable by consumer CSS/JS. Its cell styling is applied from `nys-table.light.scss`, adopted once onto `document.adoptedStyleSheets`.
|
|
1551
1880
|
*/
|
|
1552
1881
|
"nys-table": Partial<NysTableProps & BaseProps & BaseEvents>;
|
|
1553
1882
|
|
|
@@ -1623,16 +1952,24 @@ export type CustomElements = {
|
|
|
1623
1952
|
"nys-unavfooter": Partial<NysUnavFooterProps & BaseProps & BaseEvents>;
|
|
1624
1953
|
|
|
1625
1954
|
/**
|
|
1626
|
-
*
|
|
1955
|
+
* Universal NYS header with trust bar, search, and translation. Required site-wide.
|
|
1627
1956
|
* ---
|
|
1628
1957
|
*
|
|
1958
|
+
*
|
|
1959
|
+
* ### **Events:**
|
|
1960
|
+
* - **nys-language-select** - Fired when a language is selected. Detail: `{language: {code, label, url?}}`. Cancelable; `preventDefault()` overrides the default Smartling redirect.
|
|
1961
|
+
* - **nys-search-submit** - Fired when a search is submitted. Detail: `{query}`. Cancelable; `preventDefault()` overrides the default search redirect.
|
|
1629
1962
|
*/
|
|
1630
1963
|
"nys-unavheader": Partial<NysUnavHeaderProps & BaseProps & BaseEvents>;
|
|
1631
1964
|
|
|
1632
1965
|
/**
|
|
1633
|
-
* Responsive
|
|
1966
|
+
* Responsive navigation that becomes an accordion on smaller screens.
|
|
1634
1967
|
* ---
|
|
1635
1968
|
*
|
|
1969
|
+
*
|
|
1970
|
+
* ### **Methods:**
|
|
1971
|
+
* - **open()** - Public API for controlling the mobile accordion from outside the component
|
|
1972
|
+
* --------------------------------------------------------------------------
|
|
1636
1973
|
*/
|
|
1637
1974
|
"nys-verticalnav": Partial<NysVerticalnavProps & BaseProps & BaseEvents>;
|
|
1638
1975
|
|
|
@@ -1643,6 +1980,7 @@ export type CustomElements = {
|
|
|
1643
1980
|
*
|
|
1644
1981
|
* ### **Events:**
|
|
1645
1982
|
* - **nys-child-resize**
|
|
1983
|
+
* - **nys-verticalnavgroup-toggle**
|
|
1646
1984
|
*/
|
|
1647
1985
|
"nys-verticalnavgroup": Partial<NysVerticalnavGroupProps & BaseProps & BaseEvents>;
|
|
1648
1986
|
|