@nysds/components 1.21.1-alpha-1 → 1.22.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 +1794 -1170
- package/dist/.vscode/vscode.css-custom-data.json +115 -0
- package/dist/.vscode/vscode.html-custom-data.json +116 -61
- package/dist/custom-elements.json +1791 -1119
- package/dist/{nys-icon.library-CwuPZJAc.js → nys-icon.library-BZ3jVyhP.js} +2 -2
- package/dist/{nys-icon.library-D_YvOGLH.js.map → nys-icon.library-BZ3jVyhP.js.map} +1 -1
- package/dist/{nys-icon.library-Bi_7DKlD-BEL9M8Q4.js → nys-icon.library-DYsQ8Tiv-DYS-TkV2.js} +12 -4
- package/dist/nys-icon.library-DYsQ8Tiv-DYS-TkV2.js.map +1 -0
- package/dist/nysds.es.js +5422 -4579
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +479 -457
- package/dist/nysds.js.map +1 -1
- package/dist/packages/codegen/src/index.d.ts +16 -0
- package/dist/packages/codegen/src/manifest/components.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/filters.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/form-control.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/load.d.ts +10 -0
- package/dist/packages/codegen/src/manifest/naming.d.ts +6 -0
- package/dist/packages/codegen/src/manifest/packages.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/types.d.ts +6 -0
- package/dist/packages/codegen/src/transform/index.d.ts +19 -0
- package/dist/packages/codegen/src/transform/parse.d.ts +18 -0
- package/dist/packages/codegen/src/transform/shared.d.ts +61 -0
- package/dist/packages/codegen/src/transform/to-angular.d.ts +6 -0
- package/dist/packages/codegen/src/transform/to-jsx.d.ts +6 -0
- package/dist/packages/internals/src/form-control-mixin.d.ts +16 -0
- package/dist/packages/internals/src/form-events.d.ts +22 -0
- package/dist/packages/internals/src/index.d.ts +2 -1
- package/dist/packages/internals/src/types.d.ts +6 -0
- package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +12 -0
- package/dist/packages/mcp-server/src/lib/framework-snippets.d.ts +35 -0
- package/dist/packages/mcp-server/src/lib/framework-usage.d.ts +19 -0
- package/dist/packages/mcp-server/src/lib/frameworks-data.d.ts +18 -0
- package/dist/packages/mcp-server/src/resources/frameworks.d.ts +14 -0
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +12 -0
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +9 -1
- package/dist/packages/nys-alert/src/nys-alert.d.ts +39 -1
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +16 -0
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +14 -2
- package/dist/packages/nys-badge/src/nys-badge.d.ts +18 -0
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +29 -3
- package/dist/packages/nys-button/src/nys-button.d.ts +35 -4
- package/dist/packages/nys-card/src/nys-card.d.ts +72 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +77 -7
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +46 -0
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +51 -6
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +44 -2
- package/dist/packages/nys-divider/src/nys-divider.d.ts +9 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +17 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +10 -0
- package/dist/packages/nys-fileinput/src/index.d.ts +1 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +42 -6
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +9 -1
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +18 -0
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +36 -55
- package/dist/packages/nys-icon/src/nys-icon.d.ts +18 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +38 -1
- package/dist/packages/nys-iconlist/src/nys-iconlistitem.d.ts +6 -0
- package/dist/packages/nys-label/src/nys-label.d.ts +3 -1
- package/dist/packages/nys-modal/src/nys-modal.d.ts +26 -2
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +21 -2
- package/dist/packages/nys-processlist/src/nys-processlist.d.ts +16 -0
- package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +1 -1
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +29 -5
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +66 -4
- package/dist/packages/nys-select/src/nys-select.d.ts +22 -4
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +8 -0
- package/dist/packages/nys-stepper/src/nys-step.d.ts +8 -1
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +8 -0
- package/dist/packages/nys-tab/src/nys-tab.d.ts +22 -3
- package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +12 -0
- package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +2 -0
- package/dist/packages/nys-table/src/nys-table.d.ts +39 -2
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +47 -4
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +42 -4
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +37 -3
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +13 -0
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +13 -0
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +28 -19
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +14 -0
- package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +11 -0
- package/dist/packages/nys-video/src/nys-video.d.ts +14 -1
- package/package.json +32 -27
- package/dist/nys-icon.library-Bi_7DKlD-BEL9M8Q4.js.map +0 -1
- package/dist/nys-icon.library-Bi_7DKlD-YSs5zqZy.js +0 -698
- package/dist/nys-icon.library-Bi_7DKlD-YSs5zqZy.js.map +0 -1
- package/dist/nys-icon.library-CwuPZJAc.js.map +0 -1
- package/dist/nys-icon.library-D_YvOGLH.js +0 -696
- package/packages/react/NysAccordion.d.ts +0 -75
- package/packages/react/NysAccordion.js +0 -24
- package/packages/react/NysAccordionItem.d.ts +0 -82
- package/packages/react/NysAccordionItem.js +0 -43
- package/packages/react/NysAlert.d.ts +0 -102
- package/packages/react/NysAlert.js +0 -61
- package/packages/react/NysAvatar.d.ts +0 -88
- package/packages/react/NysAvatar.js +0 -40
- package/packages/react/NysBacktotop.d.ts +0 -57
- package/packages/react/NysBacktotop.js +0 -23
- package/packages/react/NysBadge.d.ts +0 -78
- package/packages/react/NysBadge.js +0 -42
- package/packages/react/NysBreadcrumbItem.d.ts +0 -72
- package/packages/react/NysBreadcrumbItem.js +0 -42
- package/packages/react/NysBreadcrumbs.d.ts +0 -89
- package/packages/react/NysBreadcrumbs.js +0 -50
- package/packages/react/NysButton.d.ts +0 -171
- package/packages/react/NysButton.js +0 -83
- package/packages/react/NysCard.d.ts +0 -110
- package/packages/react/NysCard.js +0 -61
- package/packages/react/NysCheckbox.d.ts +0 -145
- package/packages/react/NysCheckbox.js +0 -78
- package/packages/react/NysCheckboxgroup.d.ts +0 -88
- package/packages/react/NysCheckboxgroup.js +0 -46
- package/packages/react/NysCombobox.d.ts +0 -126
- package/packages/react/NysCombobox.js +0 -66
- package/packages/react/NysDatepicker.d.ts +0 -128
- package/packages/react/NysDatepicker.js +0 -76
- package/packages/react/NysDivider.d.ts +0 -54
- package/packages/react/NysDivider.js +0 -22
- package/packages/react/NysDropdownMenu.d.ts +0 -59
- package/packages/react/NysDropdownMenu.js +0 -23
- package/packages/react/NysDropdownMenuItem.d.ts +0 -75
- package/packages/react/NysDropdownMenuItem.js +0 -47
- package/packages/react/NysErrorMessage.d.ts +0 -60
- package/packages/react/NysErrorMessage.js +0 -24
- package/packages/react/NysFileItem.d.ts +0 -69
- package/packages/react/NysFileItem.js +0 -37
- package/packages/react/NysFileinput.d.ts +0 -130
- package/packages/react/NysFileinput.js +0 -74
- package/packages/react/NysGlobalFooter.d.ts +0 -77
- package/packages/react/NysGlobalFooter.js +0 -32
- package/packages/react/NysGlobalHeader.d.ts +0 -85
- package/packages/react/NysGlobalHeader.js +0 -34
- package/packages/react/NysIcon.d.ts +0 -75
- package/packages/react/NysIcon.js +0 -50
- package/packages/react/NysIconlist.d.ts +0 -54
- package/packages/react/NysIconlist.js +0 -22
- package/packages/react/NysIconlistitem.d.ts +0 -59
- package/packages/react/NysIconlistitem.js +0 -22
- package/packages/react/NysLabel.d.ts +0 -81
- package/packages/react/NysLabel.js +0 -40
- package/packages/react/NysModal.d.ts +0 -90
- package/packages/react/NysModal.js +0 -50
- package/packages/react/NysOption.d.ts +0 -66
- package/packages/react/NysOption.js +0 -25
- package/packages/react/NysPagination.d.ts +0 -72
- package/packages/react/NysPagination.js +0 -45
- package/packages/react/NysProcesslist.d.ts +0 -65
- package/packages/react/NysProcesslist.js +0 -25
- package/packages/react/NysProcesslistitem.d.ts +0 -61
- package/packages/react/NysProcesslistitem.js +0 -35
- package/packages/react/NysRadiobutton.d.ts +0 -132
- package/packages/react/NysRadiobutton.js +0 -72
- package/packages/react/NysRadiogroup.d.ts +0 -104
- package/packages/react/NysRadiogroup.js +0 -62
- package/packages/react/NysSelect.d.ts +0 -119
- package/packages/react/NysSelect.js +0 -67
- package/packages/react/NysSkipnav.d.ts +0 -54
- package/packages/react/NysSkipnav.js +0 -22
- package/packages/react/NysStep.d.ts +0 -73
- package/packages/react/NysStep.js +0 -40
- package/packages/react/NysStepper.d.ts +0 -67
- package/packages/react/NysStepper.js +0 -26
- package/packages/react/NysTab.d.ts +0 -90
- package/packages/react/NysTab.js +0 -39
- package/packages/react/NysTabgroup.d.ts +0 -76
- package/packages/react/NysTabgroup.js +0 -22
- package/packages/react/NysTable.d.ts +0 -80
- package/packages/react/NysTable.js +0 -41
- package/packages/react/NysTabpanel.d.ts +0 -70
- package/packages/react/NysTabpanel.js +0 -21
- package/packages/react/NysTextarea.d.ts +0 -141
- package/packages/react/NysTextarea.js +0 -79
- package/packages/react/NysTextinput.d.ts +0 -144
- package/packages/react/NysTextinput.js +0 -83
- package/packages/react/NysToggle.d.ts +0 -102
- package/packages/react/NysToggle.js +0 -59
- package/packages/react/NysTooltip.d.ts +0 -60
- package/packages/react/NysTooltip.js +0 -24
- package/packages/react/NysUnavFooter.d.ts +0 -61
- package/packages/react/NysUnavFooter.js +0 -21
- package/packages/react/NysUnavHeader.d.ts +0 -98
- package/packages/react/NysUnavHeader.js +0 -56
- package/packages/react/NysVerticalnav.d.ts +0 -67
- package/packages/react/NysVerticalnav.js +0 -26
- package/packages/react/NysVerticalnavGroup.d.ts +0 -76
- package/packages/react/NysVerticalnavGroup.js +0 -43
- package/packages/react/NysVideo.d.ts +0 -83
- package/packages/react/NysVideo.js +0 -53
- package/packages/react/README.md +0 -92
- package/packages/react/index.d.ts +0 -49
- package/packages/react/index.js +0 -49
- package/packages/react/nysds-jsx.d.ts +0 -1998
- package/packages/react/react-utils.js +0 -40
|
@@ -2,6 +2,26 @@ import { NysFormControlElement } from "@nysds/internals";
|
|
|
2
2
|
import "./nys-fileitem";
|
|
3
3
|
import "@nysds/nys-label";
|
|
4
4
|
import "@nysds/nys-errormessage";
|
|
5
|
+
/** A selected file plus the component's processing metadata for it. */
|
|
6
|
+
export interface FileWithProgress {
|
|
7
|
+
file: File;
|
|
8
|
+
progress: number;
|
|
9
|
+
status: "pending" | "processing" | "done" | "error";
|
|
10
|
+
errorMsg?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Detail payload for the `nys-change` event. */
|
|
13
|
+
export interface NysFileinputChangeDetail {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
/** The full current selection as raw `File` objects (matches the `files` property). */
|
|
17
|
+
files: File[];
|
|
18
|
+
/** The full current selection with progress and status metadata. */
|
|
19
|
+
items: FileWithProgress[];
|
|
20
|
+
/** The entries this action added or removed, with progress and status metadata. */
|
|
21
|
+
changedFiles: FileWithProgress[];
|
|
22
|
+
}
|
|
23
|
+
/** The `nys-change` event dispatched by `nys-fileinput`. */
|
|
24
|
+
export type NysFileinputChangeEvent = CustomEvent<NysFileinputChangeDetail>;
|
|
5
25
|
/**
|
|
6
26
|
* A file input for uploading files with support for multiple files, drag-and-drop, and progress tracking.
|
|
7
27
|
* Validates file types via magic bytes (not just extension). Form-associated via ElementInternals.
|
|
@@ -17,12 +37,26 @@ import "@nysds/nys-errormessage";
|
|
|
17
37
|
*
|
|
18
38
|
* @slot description - Custom HTML description content.
|
|
19
39
|
*
|
|
20
|
-
* @
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
40
|
+
* @formControl files nys-change
|
|
41
|
+
*
|
|
42
|
+
* @fires {NysFileinputChangeEvent} nys-change Fired once per user action (file selection, drop, or removal).
|
|
43
|
+
* Detail: `{ id, name, files, items, changedFiles }`. `files` is the full current selection as raw
|
|
44
|
+
* `File` objects (matches the `files` property). `items` is the same selection with progress metadata,
|
|
45
|
+
* and `changedFiles` is the entries this action added or removed. Entries in `items` and `changedFiles`
|
|
46
|
+
* are `{ file: File, progress: number, status: "pending" | "processing" | "done" | "error", errorMsg?: string }`.
|
|
47
|
+
*
|
|
48
|
+
* @fires {Event} nys-focus Fired when focus enters the component from outside.
|
|
49
|
+
* @fires {Event} nys-blur Fired when focus leaves the component. Triggers validation.
|
|
50
|
+
*
|
|
51
|
+
* @usagedos
|
|
52
|
+
* - Use when a form requires file upload, including when multiple file selection or drag-and-drop is needed.
|
|
24
53
|
*
|
|
25
|
-
* @
|
|
54
|
+
* @usagedonts
|
|
55
|
+
* - Use when uploading large files that require resumable upload logic.
|
|
56
|
+
* - Use when selecting only from camera input or other device-native features.
|
|
57
|
+
* - Use when uploading sensitive data without encryption.
|
|
58
|
+
* - Use when file preview of uploaded content is needed.
|
|
59
|
+
* - Use when file upload is not necessary for the task.
|
|
26
60
|
*
|
|
27
61
|
* @example Basic
|
|
28
62
|
* ```html
|
|
@@ -176,7 +210,7 @@ export declare class NysFileinput extends NysFormControlElement {
|
|
|
176
210
|
connectedCallback(): void;
|
|
177
211
|
disconnectedCallback(): void;
|
|
178
212
|
firstUpdated(): void;
|
|
179
|
-
updated(): void;
|
|
213
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
180
214
|
/**
|
|
181
215
|
* Point the exposed control at the rendered <nys-errormessage> and, in
|
|
182
216
|
* dropzone mode, at the "or drag here" instructional text.
|
|
@@ -216,6 +250,8 @@ export declare class NysFileinput extends NysFormControlElement {
|
|
|
216
250
|
*/
|
|
217
251
|
private _saveSelectedFiles;
|
|
218
252
|
private _processFile;
|
|
253
|
+
private _containsFocus;
|
|
254
|
+
private _handleFocusIn;
|
|
219
255
|
private _handleBlur;
|
|
220
256
|
private _dispatchChangeEvent;
|
|
221
257
|
private _openFileDialog;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { NysElement } from "@nysds/internals";
|
|
2
2
|
import "@nysds/nys-icon";
|
|
3
3
|
import "@nysds/nys-button";
|
|
4
|
+
/** Detail payload for the `nys-file-remove` event (and its deprecated `nys-fileRemove` alias). */
|
|
5
|
+
export interface NysFileitemFileRemoveDetail {
|
|
6
|
+
filename: string;
|
|
7
|
+
}
|
|
8
|
+
/** The `nys-file-remove` event dispatched by `nys-fileitem`. */
|
|
9
|
+
export type NysFileitemFileRemoveEvent = CustomEvent<NysFileitemFileRemoveDetail>;
|
|
4
10
|
/**
|
|
5
11
|
* **Internal component.** Displays an individual file within `nys-fileinput` with status and progress.
|
|
6
12
|
*
|
|
@@ -14,7 +20,9 @@ import "@nysds/nys-button";
|
|
|
14
20
|
* @summary Internal file item display with status, progress bar, and remove action.
|
|
15
21
|
* @element nys-fileitem
|
|
16
22
|
*
|
|
17
|
-
* @fires nys-
|
|
23
|
+
* @fires {NysFileitemFileRemoveEvent} nys-file-remove Fired when the remove button is clicked. Detail: `{ filename }`.
|
|
24
|
+
* @fires {NysFileitemFileRemoveEvent} nys-fileRemove deprecated 1.x alias of `nys-file-remove`, fired
|
|
25
|
+
* alongside it. Listen for `nys-file-remove` instead; this name goes away in 2.0.
|
|
18
26
|
*/
|
|
19
27
|
export declare class NysFileItem extends NysElement {
|
|
20
28
|
static styles: import("lit").CSSResult;
|
|
@@ -11,6 +11,23 @@ import "@nysds/nys-divider";
|
|
|
11
11
|
*
|
|
12
12
|
* @slot - Footer content (links, contact info). Use `<h4>` for column headings.
|
|
13
13
|
*
|
|
14
|
+
* @cssprop [--nys-max-width--content] - Overrides the inner content max width across the grid, header, footer, and breadcrumb. Set at a higher level like `:root` to apply to all instances. Takes priority over the size-specific variable.
|
|
15
|
+
*
|
|
16
|
+
* @usagedos
|
|
17
|
+
* - Use on every agency site and application. The Global Footer is a required page element.
|
|
18
|
+
* - Use to surface essential site-wide links such as contact information, privacy policies, accessibility statements, and related program pages.
|
|
19
|
+
* - Set `agencyName` to your agency's full official name (e.g., "Office of Information Technology Services").
|
|
20
|
+
* - Set `homepageLink` to make the agency name a clickable link back to your site's homepage.
|
|
21
|
+
* - Keep footer link lists concise. Group related links under `<span>` headings when you have more than 5–6 links.
|
|
22
|
+
* - Use slotted `<ul>` content for single-list links, or nested `<ul>` with `<span>` headings for multi-column layouts.
|
|
23
|
+
* - Place `<nys-globalfooter>` above `<nys-unavfooter>` and below your page content and `<nys-backtotop>`.
|
|
24
|
+
*
|
|
25
|
+
* @usagedonts
|
|
26
|
+
* - Use for primary navigation. That belongs in `<nys-globalheader>`.
|
|
27
|
+
* - Include page-specific content or calls to action. Footer content should be relevant site-wide.
|
|
28
|
+
* - Use for statewide universal links (Agencies, Services, Counties). Those belong in `<nys-unavfooter>`, which renders below this component.
|
|
29
|
+
* - Embed `<script>`, `<iframe>`, `<object>`, or `<img>` elements in slotted content. These are sanitized and removed by the component for security.
|
|
30
|
+
*
|
|
14
31
|
* @example Basic
|
|
15
32
|
* ```html
|
|
16
33
|
* <nys-globalfooter agencyName="Office of Information Technology Services"></nys-globalfooter>
|
|
@@ -106,6 +123,7 @@ export declare class NysGlobalFooter extends NysElement {
|
|
|
106
123
|
* Lifecycle Methods
|
|
107
124
|
* --------------------------------------------------------------------------
|
|
108
125
|
*/
|
|
126
|
+
connectedCallback(): void;
|
|
109
127
|
firstUpdated(): void;
|
|
110
128
|
/**
|
|
111
129
|
* Functions
|
|
@@ -1,26 +1,35 @@
|
|
|
1
|
-
import { NysElement } from "@nysds/internals";
|
|
2
1
|
import "@nysds/nys-icon";
|
|
2
|
+
import { NysElement } from "@nysds/internals";
|
|
3
3
|
/**
|
|
4
4
|
* Agency-branded header with app/agency name, navigation, and responsive mobile menu.
|
|
5
5
|
*
|
|
6
6
|
* Place below `nys-unavheader`. Slot navigation links as `<ul><li><a>` elements; active links
|
|
7
|
-
* are auto-highlighted based on current URL
|
|
8
|
-
* yourself — then the header leaves the current-page state entirely to you, which is
|
|
9
|
-
* what apps that don't route on the pathname (hash-routed SPAs, for example) need.
|
|
10
|
-
* Mobile menu toggles automatically on narrow screens.
|
|
7
|
+
* are auto-highlighted based on current URL. Mobile menu toggles automatically on narrow screens.
|
|
11
8
|
*
|
|
12
9
|
* @summary Agency header with navigation, mobile menu, and active link highlighting.
|
|
13
10
|
* @element nys-globalheader
|
|
14
11
|
*
|
|
15
|
-
* @
|
|
16
|
-
* - The mobile menu toggle is a real `<button>` carrying `aria-expanded` and
|
|
17
|
-
* `aria-controls` pointing at the mobile navigation.
|
|
18
|
-
* - While the mobile menu is open, Tab and Shift+Tab cycle within the toggle and
|
|
19
|
-
* the menu's links; Escape closes the menu and returns focus to the toggle.
|
|
12
|
+
* @cssprop [--nys-max-width--content] - Overrides the inner content max width across the grid, header, footer, and breadcrumb. Set at a higher level like `:root` to apply to all instances. Takes priority over the size-specific variable.
|
|
20
13
|
*
|
|
21
14
|
* @slot - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
|
|
22
15
|
* @slot user-actions - User-account controls (e.g. profile link, settings, log-out button) shown in the header.
|
|
23
16
|
*
|
|
17
|
+
* @usagedos
|
|
18
|
+
* - Use on every agency site and application. The Global Header is a required page element.
|
|
19
|
+
* - Place below `<nys-unavheader>` when using the Universal Navigation Header.
|
|
20
|
+
* - Use `agencyName` alone for public-facing agency websites not tied to a specific application; omit it for statewide portals that aren't agency-specific.
|
|
21
|
+
* - Use `appName` for named applications (e.g., "Employee Time Tracker" or "License Renewal Portal").
|
|
22
|
+
* - Combine `appName` and `agencyName` when an application belongs to a specific agency.
|
|
23
|
+
* - Set `homepageLink` to make the header title clickable. On public-facing sites, this is the primary path back to the homepage.
|
|
24
|
+
* - Use the `user-actions` slot for authenticated applications that need log-out buttons or user profile controls.
|
|
25
|
+
* - Keep navigation link lists to 6 items or fewer. On mobile, these collapse into a full-width menu.
|
|
26
|
+
* - Add the `nysLogo` property to display the NYS brand mark for internal applications that don't require public-facing agency branding.
|
|
27
|
+
*
|
|
28
|
+
* @usagedonts
|
|
29
|
+
* - Use `appName` for an agency name. Use the `agencyName` prop instead.
|
|
30
|
+
* - Add navigation links to application headers where users should remain focused on a task (e.g., a multi-step form).
|
|
31
|
+
* - Place secondary or utility navigation in the Global Header. Use `<nys-globalfooter>` for secondary links.
|
|
32
|
+
* - Use the `nysLogo` property on public-facing sites, instead use the `<nys-unavheader>` for statewide branding.
|
|
24
33
|
*
|
|
25
34
|
* @example Basic
|
|
26
35
|
* ```html
|
|
@@ -58,21 +67,10 @@ import "@nysds/nys-icon";
|
|
|
58
67
|
* </ul>
|
|
59
68
|
* </nys-globalheader>
|
|
60
69
|
* ```
|
|
61
|
-
* @example Author-controlled active link
|
|
62
|
-
* ```html
|
|
63
|
-
* <!-- Set aria-current yourself and the header stops guessing from the URL. -->
|
|
64
|
-
* <nys-globalheader agencyName="Office of Information Technology Services">
|
|
65
|
-
* <ul>
|
|
66
|
-
* <li><a href="#/services">Services</a></li>
|
|
67
|
-
* <li><a href="#/help" aria-current="page">Help Center</a></li>
|
|
68
|
-
* </ul>
|
|
69
|
-
* </nys-globalheader>
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
70
|
* @example User Actions
|
|
73
71
|
* ```html
|
|
74
72
|
* <nys-globalheader agencyName="Office of Information Technology Services">
|
|
75
|
-
* <nys-button slot="user-actions" label="Log out">
|
|
73
|
+
* <nys-button id="my-action-slot" slot="user-actions" label="Log out">
|
|
76
74
|
* <nys-avatar
|
|
77
75
|
* slot="prefix-icon"
|
|
78
76
|
* ariaLabel="User avatar"
|
|
@@ -93,7 +91,7 @@ import "@nysds/nys-icon";
|
|
|
93
91
|
* <nys-globalheader nysLogo appName="Admin Dashboard"></nys-globalheader>
|
|
94
92
|
* ```
|
|
95
93
|
*
|
|
96
|
-
* @example Custom landmark label
|
|
94
|
+
* * @example Custom landmark label
|
|
97
95
|
* ```html
|
|
98
96
|
* <!-- Names the banner landmark directly instead of from the visible title.
|
|
99
97
|
* Keep it distinct from nys-unavheader's ("New York State"). -->
|
|
@@ -105,8 +103,6 @@ import "@nysds/nys-icon";
|
|
|
105
103
|
*/
|
|
106
104
|
export declare class NysGlobalHeader extends NysElement {
|
|
107
105
|
static styles: import("lit").CSSResult;
|
|
108
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
109
|
-
id: string;
|
|
110
106
|
/** Application name displayed prominently. */
|
|
111
107
|
appName: string;
|
|
112
108
|
/** Agency name displayed below app name (or as main title if no appName). */
|
|
@@ -166,23 +162,14 @@ export declare class NysGlobalHeader extends NysElement {
|
|
|
166
162
|
* Functions
|
|
167
163
|
* --------------------------------------------------------------------------
|
|
168
164
|
*/
|
|
165
|
+
private get _navSlot();
|
|
166
|
+
private _getAssignedLinks;
|
|
169
167
|
private _highlightActiveLink;
|
|
170
168
|
private _handleListSlotChange;
|
|
171
169
|
private _normalizePath;
|
|
170
|
+
private _setMobileMenuOpen;
|
|
172
171
|
private _toggleMobileMenu;
|
|
173
|
-
/** The toggle, which is both the trap's first stop and where focus returns. */
|
|
174
172
|
private get _menuButton();
|
|
175
|
-
private get _mobileNav();
|
|
176
|
-
/**
|
|
177
|
-
* Closes the mobile menu.
|
|
178
|
-
*
|
|
179
|
-
* `restoreFocus` moves focus back to the toggle, which is required whenever the
|
|
180
|
-
* menu is dismissed by keyboard: the closed menu is `display: none`, so focus
|
|
181
|
-
* sitting on one of its links would otherwise be dropped to the top of the
|
|
182
|
-
* document (WCAG 2.4.3 Focus Order). A click outside is a pointer gesture that
|
|
183
|
-
* lands somewhere the user chose, so that path leaves focus alone.
|
|
184
|
-
*/
|
|
185
|
-
private _closeMobileMenu;
|
|
186
173
|
/**
|
|
187
174
|
* Toggle first, then the menu's own links — the tab order a sighted keyboard
|
|
188
175
|
* user sees, so the trap cycles in the order the menu reads.
|
|
@@ -192,8 +179,7 @@ export declare class NysGlobalHeader extends NysElement {
|
|
|
192
179
|
* The focused element, but only when it is one of the menu's own stops.
|
|
193
180
|
*
|
|
194
181
|
* `document.activeElement` reports the host for anything focused inside this
|
|
195
|
-
* shadow root
|
|
196
|
-
* real stop.
|
|
182
|
+
* shadow root (the toggle button) or the links in the lightDOM.
|
|
197
183
|
*/
|
|
198
184
|
private _activeMenuElement;
|
|
199
185
|
/**
|
|
@@ -205,7 +191,17 @@ export declare class NysGlobalHeader extends NysElement {
|
|
|
205
191
|
* way out.
|
|
206
192
|
*/
|
|
207
193
|
private _trapMobileMenuFocus;
|
|
208
|
-
private
|
|
194
|
+
private _renderBrandMark;
|
|
195
|
+
private _getNysLogo;
|
|
196
|
+
private _boundClickOutside;
|
|
197
|
+
private _boundLinkClick;
|
|
198
|
+
/**
|
|
199
|
+
* Growing past the mobile breakpoint takes the menu off the page, so drop the
|
|
200
|
+
* open state with it. No focus restore: the toggle is gone too, and the resize
|
|
201
|
+
* was not a dismissal the user aimed at anything.
|
|
202
|
+
*/
|
|
203
|
+
private _boundBreakpointChange;
|
|
204
|
+
private _boundKeyDown;
|
|
209
205
|
/**
|
|
210
206
|
* Id of the element that names the banner landmark, or undefined when this
|
|
211
207
|
* header carries no title to point at.
|
|
@@ -225,20 +221,5 @@ export declare class NysGlobalHeader extends NysElement {
|
|
|
225
221
|
* has something to point at, so the landmark never carries both.
|
|
226
222
|
*/
|
|
227
223
|
private get _bannerLabel();
|
|
228
|
-
/**
|
|
229
|
-
* App/agency title block. Rendered on its own so the linked and unlinked
|
|
230
|
-
* variants cannot drift apart — the ids here are what names the banner.
|
|
231
|
-
*/
|
|
232
|
-
private _renderNameContainer;
|
|
233
|
-
private _renderBrandMark;
|
|
234
|
-
private _getNysLogo;
|
|
235
|
-
private _boundClickOutside;
|
|
236
|
-
/**
|
|
237
|
-
* Growing past the mobile breakpoint takes the menu off the page, so drop the
|
|
238
|
-
* open state with it. No focus restore: the toggle is gone too, and the resize
|
|
239
|
-
* was not a dismissal the user aimed at anything.
|
|
240
|
-
*/
|
|
241
|
-
private _boundBreakpointChange;
|
|
242
|
-
private _boundKeyDown;
|
|
243
224
|
render(): import("lit-html").TemplateResult<1>;
|
|
244
225
|
}
|
|
@@ -13,6 +13,24 @@ import { NysIconWatcher } from "./icon-library-registry";
|
|
|
13
13
|
* @summary SVG icon with swappable library support, size, rotation, and color options.
|
|
14
14
|
* @element nys-icon
|
|
15
15
|
*
|
|
16
|
+
* @cssprop [--nys-icon-size] - Width and height of the component
|
|
17
|
+
*
|
|
18
|
+
* @usagedos
|
|
19
|
+
* - Use icons to draw attention to actions, help users scan for key information, or enhance recognizable common actions (e.g., search, download, share).
|
|
20
|
+
* - Pair icons with a text label—few icons are universally understood alone.
|
|
21
|
+
* - Use icons consistently: same icon and label for the same meaning throughout your app.
|
|
22
|
+
* - Use `ariaLabel` when the icon conveys meaning, so screen readers can announce its purpose.
|
|
23
|
+
* - Use icons from the NYS Design System library; if unavailable, use Google Material Symbols (rounded, unfilled).
|
|
24
|
+
* - Match icon size and color to the design system.
|
|
25
|
+
*
|
|
26
|
+
* @usagedonts
|
|
27
|
+
* - Use an icon if its meaning isn't immediately clear—if you suspect users won't recognize it, remove it.
|
|
28
|
+
* - Use icons to compensate for unclear page hierarchy or confusing content organization.
|
|
29
|
+
* - Use standalone icons for actions—use `<nys-button>` with an icon inside instead.
|
|
30
|
+
* - Replace meaningful text with icons unless the icon is universally recognized or paired with a label.
|
|
31
|
+
* - Overuse icons—too many create visual noise and reduce focus.
|
|
32
|
+
* - Use excessive icon customization that breaks design consistency.
|
|
33
|
+
*
|
|
16
34
|
* @example Basic
|
|
17
35
|
* ```html
|
|
18
36
|
* <nys-icon name="check_circle"></nys-icon>
|
|
@@ -8,7 +8,7 @@ import "./nys-iconlistitem";
|
|
|
8
8
|
* default slot for the primary label. A second line can be added with `<span slot="secondary">`.
|
|
9
9
|
* Set `divider` to draw a rule between items; no divider is drawn after the last item.
|
|
10
10
|
*
|
|
11
|
-
* @summary A scannable list of icon + text items
|
|
11
|
+
* @summary A scannable list of icon + text items.
|
|
12
12
|
* @element nys-iconlist
|
|
13
13
|
*
|
|
14
14
|
* Children: one or more `<nys-iconlistitem>` elements, kept in light DOM so the
|
|
@@ -17,6 +17,19 @@ import "./nys-iconlistitem";
|
|
|
17
17
|
* its styling comes from `nys-iconlist.light.scss` adopted once onto
|
|
18
18
|
* `document.adoptedStyleSheets` rather than from a shadow-DOM stylesheet.
|
|
19
19
|
*
|
|
20
|
+
* @usagedos
|
|
21
|
+
* - Use an icon list to highlight key attributes, features, requirements, or metadata that help users quickly scan content.
|
|
22
|
+
* - Keep list items short and concise—ideally a single line of text or a brief phrase.
|
|
23
|
+
* - Limit the number of items shown (typically 3–5) to maintain scannability and keep the list from becoming overly dense.
|
|
24
|
+
* - Order items by importance, placing the most relevant information first.
|
|
25
|
+
* - Make sure icons add meaning and are not purely decorative. If all items use the same icon, consider whether a standard list would communicate the content just as effectively.
|
|
26
|
+
*
|
|
27
|
+
* @usagedonts
|
|
28
|
+
* - Use an icon list when the items represent steps in a process. Use the `<nys-stepper>` instead.
|
|
29
|
+
* - Use an icon list for long descriptions, complex instructions, or content that requires hierarchy. Use standard lists or body text instead.
|
|
30
|
+
* - Mix icon styles within a single list, which makes the list harder to scan.
|
|
31
|
+
* - Place interactive controls such as buttons inside list items.
|
|
32
|
+
*
|
|
20
33
|
* @example Basic
|
|
21
34
|
* ```html
|
|
22
35
|
* <nys-iconlist id="event-details">
|
|
@@ -61,6 +74,21 @@ import "./nys-iconlistitem";
|
|
|
61
74
|
* </nys-iconlist>
|
|
62
75
|
* ```
|
|
63
76
|
*
|
|
77
|
+
* @example Inverted
|
|
78
|
+
* ```html
|
|
79
|
+
* <nys-iconlist id="demo-inverted" divider inverted>
|
|
80
|
+
* <nys-iconlistitem icon="calendar_month">July 4, 2026</nys-iconlistitem>
|
|
81
|
+
* <nys-iconlistitem icon="schedule">
|
|
82
|
+
* 5:00 PM
|
|
83
|
+
* <span slot="secondary">Eastern Standard Time</span>
|
|
84
|
+
* </nys-iconlistitem>
|
|
85
|
+
* <nys-iconlistitem icon="location_on">
|
|
86
|
+
* Central Park West
|
|
87
|
+
* <span slot="secondary">New York, NY</span>
|
|
88
|
+
* </nys-iconlistitem>
|
|
89
|
+
* </nys-iconlist>
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
64
92
|
* @example Checklist
|
|
65
93
|
* ```html
|
|
66
94
|
* <nys-iconlist id="requirements">
|
|
@@ -82,11 +110,20 @@ export declare class NysIconlist extends NysElement {
|
|
|
82
110
|
* @default false
|
|
83
111
|
*/
|
|
84
112
|
divider: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Adjusts colors for dark backgrounds.
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
inverted: boolean;
|
|
85
118
|
private _childObserver;
|
|
86
119
|
private _warnedChildren;
|
|
87
120
|
createRenderRoot(): this;
|
|
121
|
+
private _firstUpdatePending;
|
|
122
|
+
protected scheduleUpdate(): Promise<void>;
|
|
88
123
|
connectedCallback(): void;
|
|
89
124
|
disconnectedCallback(): void;
|
|
125
|
+
firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
90
126
|
updated(changedProperties: PropertyValues<this>): void;
|
|
127
|
+
private _syncInverted;
|
|
91
128
|
private _syncDividers;
|
|
92
129
|
}
|
|
@@ -26,6 +26,12 @@ export declare class NysIconlistitem extends NysElement {
|
|
|
26
26
|
* @default false
|
|
27
27
|
*/
|
|
28
28
|
divider: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Adjusts colors for dark backgrounds. Set by the parent `<nys-iconlist inverted>`; not intended to be
|
|
31
|
+
* set directly.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
inverted: boolean;
|
|
29
35
|
connectedCallback(): void;
|
|
30
36
|
private _handleSecondarySlotChange;
|
|
31
37
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -41,6 +41,8 @@ import "@nysds/nys-icon";
|
|
|
41
41
|
* ```
|
|
42
42
|
*
|
|
43
43
|
* @slot description - Custom HTML description content below the label.
|
|
44
|
+
*
|
|
45
|
+
* @fires {Event} nys-label-click - Fired when the label is clicked. Bubbles and composed. Listened for by form components (for example nys-fileinput and nys-toggle) that need label-activation behavior.
|
|
44
46
|
*/
|
|
45
47
|
export declare class NysLabel extends LitElement {
|
|
46
48
|
static styles: import("lit").CSSResult;
|
|
@@ -57,7 +59,7 @@ export declare class NysLabel extends LitElement {
|
|
|
57
59
|
/** Tooltip text shown on hover/focus of info icon next to label. */
|
|
58
60
|
tooltip: string;
|
|
59
61
|
private _labelInternals;
|
|
60
|
-
get _hasDescription()
|
|
62
|
+
private get _hasDescription();
|
|
61
63
|
connectedCallback(): void;
|
|
62
64
|
updated(): void;
|
|
63
65
|
/**
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { NysElement } from "@nysds/internals";
|
|
2
2
|
import "@nysds/nys-button";
|
|
3
|
+
/** Detail payload for the `nys-open` event fired by `nys-modal`. */
|
|
4
|
+
export interface NysModalOpenDetail {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
/** The `nys-open` event fired by `nys-modal`. */
|
|
8
|
+
export type NysModalOpenEvent = CustomEvent<NysModalOpenDetail>;
|
|
9
|
+
/** Detail payload for the `nys-close` event fired by `nys-modal`. */
|
|
10
|
+
export interface NysModalCloseDetail {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
/** The `nys-close` event fired by `nys-modal`. */
|
|
14
|
+
export type NysModalCloseEvent = CustomEvent<NysModalCloseDetail>;
|
|
3
15
|
/**
|
|
4
16
|
* An accessible modal dialog with focus trapping, keyboard navigation, and scroll management.
|
|
5
17
|
*
|
|
@@ -12,8 +24,20 @@ import "@nysds/nys-button";
|
|
|
12
24
|
* @slot - Default slot for body content.
|
|
13
25
|
* @slot actions - Action buttons displayed in footer. Buttons auto-resize on mobile.
|
|
14
26
|
*
|
|
15
|
-
* @fires nys-open - Fired when modal opens. Detail: `{id}`.
|
|
16
|
-
* @fires nys-close - Fired when modal closes. Detail: `{id}`.
|
|
27
|
+
* @fires {NysModalOpenEvent} nys-open - Fired when modal opens. Detail: `{id}`.
|
|
28
|
+
* @fires {NysModalCloseEvent} nys-close - Fired when modal closes. Detail: `{id}`.
|
|
29
|
+
*
|
|
30
|
+
* @usagedos
|
|
31
|
+
* - Use to confirm important actions, present focused forms (e.g., login, feedback), or require acknowledgment of alerts without navigating away from the page.
|
|
32
|
+
* - Keep content short and focused. Use a dedicated page for long or complex content.
|
|
33
|
+
* - Keep the `subheading` short and use `<p>` tags within the modal for longer information.
|
|
34
|
+
* - Use the `mandatory` prop to disable the dismiss button only when the user must make a critical decision or acknowledge essential information.
|
|
35
|
+
*
|
|
36
|
+
* @usagedonts
|
|
37
|
+
* - Stack multiple modals.
|
|
38
|
+
* - Use for trivial information or inline status messages. Use `<nys-alert>` instead.
|
|
39
|
+
* - Use for quick hints on form fields. Use `<nys-tooltip>` instead.
|
|
40
|
+
* - Force the `mandatory` prop unnecessarily.
|
|
17
41
|
*
|
|
18
42
|
* @example Basic
|
|
19
43
|
* ```html
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { TemplateResult } from "lit";
|
|
2
2
|
import { NysElement } from "@nysds/internals";
|
|
3
3
|
import "@nysds/nys-button";
|
|
4
|
+
/** Detail payload for the `nys-change` event fired by `nys-pagination`. */
|
|
5
|
+
export interface NysPaginationChangeDetail {
|
|
6
|
+
page: number;
|
|
7
|
+
}
|
|
8
|
+
/** The `nys-change` event fired by `nys-pagination`. */
|
|
9
|
+
export type NysPaginationChangeEvent = CustomEvent<NysPaginationChangeDetail>;
|
|
4
10
|
/**
|
|
5
11
|
* Page navigation with Previous/Next buttons and numbered page links. Auto-collapses with ellipses for many pages.
|
|
6
12
|
*
|
|
@@ -20,7 +26,20 @@ import "@nysds/nys-button";
|
|
|
20
26
|
* @summary Page navigation with numbered links, prev/next buttons, and responsive layout.
|
|
21
27
|
* @element nys-pagination
|
|
22
28
|
*
|
|
23
|
-
* @fires nys-change - Fired when page changes. Detail: `{page}`.
|
|
29
|
+
* @fires {NysPaginationChangeEvent} nys-change - Fired when page changes. Detail: `{page}`.
|
|
30
|
+
*
|
|
31
|
+
* @usagedos
|
|
32
|
+
* - Use for large result sets such as search results, data tables, or directory listings where loading everything at once would hurt performance or usability.
|
|
33
|
+
* - Use when users need to navigate to a specific part of a result set.
|
|
34
|
+
* - Set `totalPages` based on your data set and page size; update `currentPage` in response to `nys-change` events.
|
|
35
|
+
* - Don't set `currentPage` to a value greater than `totalPages`. The component clamps the value automatically, but your application logic should prevent this.
|
|
36
|
+
* - Position the pagination component below the content it controls.
|
|
37
|
+
* - Scroll users to the top of the results area when they change pages.
|
|
38
|
+
*
|
|
39
|
+
* @usagedonts
|
|
40
|
+
* - Use when content fits on a single page (fewer than 3–4 screen heights). Show all items instead.
|
|
41
|
+
* - Use for step-based workflows where users complete tasks in order. Use `<nys-stepper>` instead.
|
|
42
|
+
* - Use for infinite-scroll patterns such as a news feed.
|
|
24
43
|
*
|
|
25
44
|
* @example Basic
|
|
26
45
|
* ```html
|
|
@@ -47,7 +66,7 @@ export declare class NysPagination extends NysElement {
|
|
|
47
66
|
currentPage: number;
|
|
48
67
|
/** Total number of pages. Must be at least 1. */
|
|
49
68
|
totalPages: number;
|
|
50
|
-
/** Internal state for
|
|
69
|
+
/** Internal layout coordination state reflected for styling. Not public API. @internal */
|
|
51
70
|
_twoBeforeLast: boolean;
|
|
52
71
|
/**
|
|
53
72
|
* Logical identity of the control that held focus when this update was scheduled,
|
|
@@ -23,6 +23,19 @@ import "./nys-processlistitem";
|
|
|
23
23
|
* `aria-describedby` for supporting copy such as an intro paragraph. Because the host renders
|
|
24
24
|
* in the light DOM, these native attributes work with zero component code.
|
|
25
25
|
*
|
|
26
|
+
* @usagedos
|
|
27
|
+
* - Use a process list to explain a sequence of steps a user will take, such as how to apply for a benefit or renew a license.
|
|
28
|
+
* - Keep step labels short and action-oriented, and put supporting detail in the `description`.
|
|
29
|
+
* - Give the list an accessible name with `aria-labelledby` or `aria-label` so its purpose is clear.
|
|
30
|
+
* - Use `initialstep` to continue the numbering when one process is split across multiple lists.
|
|
31
|
+
* - Keep styling consistent across all process lists on the same page.
|
|
32
|
+
*
|
|
33
|
+
* @usagedonts
|
|
34
|
+
* - Use a process list to show a user's progress through a multi-step form. Use the [Stepper](/components/stepper/) instead.
|
|
35
|
+
* - Use a process list for items with no inherent order. Use the [Icon List](/components/iconlist/) or a standard list instead.
|
|
36
|
+
* - Number the steps yourself in the `label`. The list owns the numbering.
|
|
37
|
+
* - Place interactive controls such as buttons inside a step.
|
|
38
|
+
*
|
|
26
39
|
* @example Basic
|
|
27
40
|
* ```html
|
|
28
41
|
* <nys-processlist id="application-steps">
|
|
@@ -177,8 +190,11 @@ export declare class NysProcesslist extends NysElement {
|
|
|
177
190
|
private _childObserver;
|
|
178
191
|
private _warnedChildren;
|
|
179
192
|
createRenderRoot(): this;
|
|
193
|
+
private _firstUpdatePending;
|
|
194
|
+
protected scheduleUpdate(): Promise<void>;
|
|
180
195
|
connectedCallback(): void;
|
|
181
196
|
disconnectedCallback(): void;
|
|
197
|
+
firstUpdated(changedProperties: PropertyValues): void;
|
|
182
198
|
updated(changedProperties: PropertyValues): void;
|
|
183
199
|
private _syncSteps;
|
|
184
200
|
}
|
|
@@ -30,7 +30,7 @@ export declare class NysProcesslistitem extends NysElement {
|
|
|
30
30
|
* A description is shown when either the property or the slot has content, so an item with
|
|
31
31
|
* neither renders no empty paragraph.
|
|
32
32
|
*/
|
|
33
|
-
get _hasDescription()
|
|
33
|
+
private get _hasDescription();
|
|
34
34
|
/**
|
|
35
35
|
* Sets the rendered step number.
|
|
36
36
|
* @internal Called by `<nys-processlist>`; not intended for direct use.
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { NysFormControlElement } from "@nysds/internals";
|
|
2
2
|
import "@nysds/nys-label";
|
|
3
|
+
/** Detail payload for the `nys-change` event fired by `nys-radiobutton`. */
|
|
4
|
+
export interface NysRadiobuttonChangeDetail {
|
|
5
|
+
id: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
/** The `nys-change` event fired by `nys-radiobutton`. */
|
|
11
|
+
export type NysRadiobuttonChangeEvent = CustomEvent<NysRadiobuttonChangeDetail>;
|
|
3
12
|
/**
|
|
4
13
|
* A radio button for single selection within a `nys-radiogroup`. Only one radio with the same `name` can be selected.
|
|
5
14
|
*
|
|
@@ -12,14 +21,28 @@ import "@nysds/nys-label";
|
|
|
12
21
|
* 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.
|
|
13
22
|
*
|
|
14
23
|
* @element nys-radiobutton
|
|
24
|
+
* @formControl checked nys-change
|
|
15
25
|
*
|
|
16
26
|
* @slot description - Custom HTML description content.
|
|
17
27
|
*
|
|
18
|
-
* @fires nys-change - Fired when selection changes. Detail: `{id, checked, name, value}`.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
28
|
+
* @fires {NysRadiobuttonChangeEvent} nys-change - Fired when the selection changes. Detail: `{id, checked, name, value}`. Bubbles and composed.
|
|
29
|
+
*
|
|
30
|
+
* Standalone radios (outside a `nys-radiogroup`) render their own native input
|
|
31
|
+
* and dispatch `nys-change` themselves. Inside a `nys-radiogroup` the group
|
|
32
|
+
* renders the inputs and owns the form contract: `nys-focus` and `nys-blur`
|
|
33
|
+
* arrive re-targeted from the group, and `nys-other-input` fires on the group.
|
|
34
|
+
*
|
|
35
|
+
* @usagedos
|
|
36
|
+
* - Use when a user needs to select only one option from a list of 7 or fewer choices.
|
|
37
|
+
* - Always wrap a group of `<nys-radiobutton>` with a `<nys-radiogroup>`.
|
|
38
|
+
* - Group radio buttons vertically for easier scanning, especially when labels are lengthy.
|
|
39
|
+
* - Set a clear default when one choice is recommended or most common. Don't leave all options unselected if a helpful default can guide users.
|
|
40
|
+
* - Use concise, descriptive labels for each option.
|
|
22
41
|
*
|
|
42
|
+
* @usagedonts
|
|
43
|
+
* - Use when users need to select multiple options. Use checkboxes instead.
|
|
44
|
+
* - Use when there are more than 7 options. Use a dropdown for better space utilization.
|
|
45
|
+
* - Use for yes/no questions. Consider `<nys-toggle>` or `<nys-checkbox>` instead.
|
|
23
46
|
*
|
|
24
47
|
* @example Pre-selected
|
|
25
48
|
* ```html
|
|
@@ -46,7 +69,6 @@ import "@nysds/nys-label";
|
|
|
46
69
|
* </nys-radiogroup>
|
|
47
70
|
* ```
|
|
48
71
|
*
|
|
49
|
-
* /**
|
|
50
72
|
* @example Standalone, one per table row
|
|
51
73
|
* ```html
|
|
52
74
|
* <nys-table striped bordered>
|
|
@@ -183,6 +205,8 @@ export declare class NysRadiobutton extends NysFormControlElement {
|
|
|
183
205
|
* --------------------------------------------------------------------------
|
|
184
206
|
*/
|
|
185
207
|
protected createRenderRoot(): this;
|
|
208
|
+
private _firstUpdatePending;
|
|
209
|
+
protected scheduleUpdate(): Promise<void>;
|
|
186
210
|
connectedCallback(): void;
|
|
187
211
|
disconnectedCallback(): void;
|
|
188
212
|
firstUpdated(): void;
|