@nysds/components 1.20.0-alpha1 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +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-Cfdq5Zdc.js +696 -0
- package/dist/nys-icon.library-Cfdq5Zdc.js.map +1 -0
- package/dist/nys-icon.library-DHBltclg-BYYeCcpo.js +706 -0
- package/dist/nys-icon.library-DHBltclg-BYYeCcpo.js.map +1 -0
- package/dist/nysds.es.js +9113 -4162
- 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 +14 -6
- 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
|
@@ -1,17 +1,94 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-icon";
|
|
3
|
+
import "@nysds/nys-button";
|
|
2
4
|
/**
|
|
3
5
|
* `<nys-table>` is a responsive table component that can display native HTML tables,
|
|
4
6
|
* supports striped and bordered styling, sortable columns, and CSV download.
|
|
5
7
|
*
|
|
6
|
-
* @slot - Accepts a `<table>` element. Only the first table is
|
|
8
|
+
* @slot - Accepts a `<table>` element. Only the first table is used. The table
|
|
9
|
+
* is enhanced in place and stays in the light DOM (projected through a slot,
|
|
10
|
+
* never cloned), so embedded components remain interactive and reachable by
|
|
11
|
+
* consumer CSS/JS. Its cell styling is applied from `nys-table.light.scss`,
|
|
12
|
+
* adopted once onto `document.adoptedStyleSheets`.
|
|
7
13
|
*
|
|
8
14
|
* @fires nys-click - Fired when the download button or sortable headers are clicked.
|
|
9
15
|
* @fires nys-column-sort - Fired when a sortable column header is clicked. Can be prevented by calling `event.preventDefault()` to override default sort behavior.
|
|
10
16
|
* Detail: { columnIndex: number, columnLabel: string, sortDirection: "asc" | "desc" | "none" }
|
|
11
17
|
*
|
|
12
18
|
* @method downloadFile - Triggers download of the CSV file if `download` is set.
|
|
19
|
+
*
|
|
20
|
+
* @example Basic
|
|
21
|
+
* ```html
|
|
22
|
+
* <nys-table id="table1" name="table1">
|
|
23
|
+
* <table>
|
|
24
|
+
* <caption>New York State High Peaks and Popular Hikes</caption>
|
|
25
|
+
* <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
|
|
26
|
+
* <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
|
|
27
|
+
* <tr><td>Algonquin</td><td>5,114</td><td>Northeast Trail</td></tr>
|
|
28
|
+
* <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
|
|
29
|
+
* <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
|
|
30
|
+
* <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
|
|
31
|
+
* </table>
|
|
32
|
+
* </nys-table>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example Striped
|
|
36
|
+
* ```html
|
|
37
|
+
* <nys-table id="table2" name="table2" striped>
|
|
38
|
+
* <table>
|
|
39
|
+
* <caption>New York State High Peaks and Popular Hikes</caption>
|
|
40
|
+
* <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
|
|
41
|
+
* <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
|
|
42
|
+
* <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
|
|
43
|
+
* <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
|
|
44
|
+
* <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
|
|
45
|
+
* </table>
|
|
46
|
+
* </nys-table>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Bordered
|
|
50
|
+
* ```html
|
|
51
|
+
* <nys-table id="table3" name="table3" bordered>
|
|
52
|
+
* <table>
|
|
53
|
+
* <caption>New York State High Peaks and Popular Hikes</caption>
|
|
54
|
+
* <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
|
|
55
|
+
* <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
|
|
56
|
+
* <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
|
|
57
|
+
* <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
|
|
58
|
+
* <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
|
|
59
|
+
* </table>
|
|
60
|
+
* </nys-table>
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Sortable
|
|
64
|
+
* ```html
|
|
65
|
+
* <nys-table id="table4" name="table4" sortable>
|
|
66
|
+
* <table>
|
|
67
|
+
* <caption>New York State High Peaks and Popular Hikes</caption>
|
|
68
|
+
* <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
|
|
69
|
+
* <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
|
|
70
|
+
* <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
|
|
71
|
+
* <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
|
|
72
|
+
* <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
|
|
73
|
+
* </table>
|
|
74
|
+
* </nys-table>
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @example Downloadable
|
|
78
|
+
* ```html
|
|
79
|
+
* <nys-table id="table5" name="table5" download="path/to/downloadable/version/of/table.filetype">
|
|
80
|
+
* <table>
|
|
81
|
+
* <caption>New York State High Peaks and Popular Hikes</caption>
|
|
82
|
+
* <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
|
|
83
|
+
* <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
|
|
84
|
+
* <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
|
|
85
|
+
* <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
|
|
86
|
+
* <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
|
|
87
|
+
* </table>
|
|
88
|
+
* </nys-table>
|
|
89
|
+
* ```
|
|
13
90
|
*/
|
|
14
|
-
export declare class NysTable extends
|
|
91
|
+
export declare class NysTable extends NysElement {
|
|
15
92
|
static styles: import("lit").CSSResult;
|
|
16
93
|
id: string;
|
|
17
94
|
name: string;
|
|
@@ -23,6 +100,7 @@ export declare class NysTable extends LitElement {
|
|
|
23
100
|
private _sortDirection;
|
|
24
101
|
private _captionText;
|
|
25
102
|
private _observer;
|
|
103
|
+
private _enhancing;
|
|
26
104
|
/**************** Lifecycle Methods ****************/
|
|
27
105
|
constructor();
|
|
28
106
|
connectedCallback(): void;
|
|
@@ -30,9 +108,18 @@ export declare class NysTable extends LitElement {
|
|
|
30
108
|
disconnectedCallback(): void;
|
|
31
109
|
willUpdate(): void;
|
|
32
110
|
/******************** Functions ********************/
|
|
111
|
+
private _getSlottedTable;
|
|
112
|
+
private _observeTable;
|
|
113
|
+
private _withObserverPaused;
|
|
33
114
|
private _handleSlotChange;
|
|
34
115
|
private _setupMutationObserver;
|
|
35
116
|
private _normalizeTableDOM;
|
|
117
|
+
/**
|
|
118
|
+
* Adds scope="col" to every column-header cell in the table head. Header cells
|
|
119
|
+
* inside the body (row headers) are left untouched so authors can still mark
|
|
120
|
+
* them scope="row" themselves; we only set a scope where one is missing.
|
|
121
|
+
*/
|
|
122
|
+
private _applyHeaderScopes;
|
|
36
123
|
private _addSortIcons;
|
|
37
124
|
private _updateSortIcons;
|
|
38
125
|
private _onSortClick;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysFormControlElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-label";
|
|
3
|
+
import "@nysds/nys-errormessage";
|
|
2
4
|
/**
|
|
3
5
|
* A multi-line text input for collecting longer responses like comments, descriptions, or feedback.
|
|
4
6
|
* Form-associated with validation support via ElementInternals.
|
|
@@ -16,17 +18,64 @@ import { LitElement } from "lit";
|
|
|
16
18
|
* @fires nys-blur - Fired when textarea loses focus. Triggers validation.
|
|
17
19
|
* @fires nys-select - Fired when user selects text. Detail: `{id, value}`.
|
|
18
20
|
*
|
|
19
|
-
* @example Basic
|
|
21
|
+
* @example Basic
|
|
20
22
|
* ```html
|
|
21
|
-
* <nys-textarea label="Comments"
|
|
23
|
+
* <nys-textarea label="Comments"></nys-textarea>
|
|
22
24
|
* ```
|
|
23
25
|
*
|
|
24
|
-
* @example
|
|
26
|
+
* @example Disabled
|
|
25
27
|
* ```html
|
|
26
|
-
* <nys-textarea label="
|
|
28
|
+
* <nys-textarea label="Comments" disabled></nys-textarea>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example Readonly
|
|
32
|
+
* ```html
|
|
33
|
+
* <nys-textarea label="Comments" readonly value="You can see me but not edit me"></nys-textarea>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example Required
|
|
37
|
+
* ```html
|
|
38
|
+
* <nys-textarea label="Describe the incident" required></nys-textarea>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Optional
|
|
42
|
+
* ```html
|
|
43
|
+
* <nys-textarea label="Comments" optional></nys-textarea>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example Max length
|
|
47
|
+
* ```html
|
|
48
|
+
* <nys-textarea label="Comments" maxlength="100"></nys-textarea>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @example Width Small
|
|
52
|
+
* ```html
|
|
53
|
+
* <nys-textarea label="Comments" width="sm"></nys-textarea>
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @example Width Medium
|
|
57
|
+
* ```html
|
|
58
|
+
* <nys-textarea label="Comments" width="md"></nys-textarea>
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @example Width Large
|
|
62
|
+
* ```html
|
|
63
|
+
* <nys-textarea label="Comments" width="lg"></nys-textarea>
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @example Description
|
|
67
|
+
* ```html
|
|
68
|
+
* <nys-textarea label="Describe the incident" description="Please provide details"></nys-textarea>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example Description Slot
|
|
72
|
+
* ```html
|
|
73
|
+
* <nys-textarea label="Describe the incident">
|
|
74
|
+
* <div slot="description">Please provide details</div>
|
|
75
|
+
* </nys-textarea>
|
|
27
76
|
* ```
|
|
28
77
|
*/
|
|
29
|
-
export declare class NysTextarea extends
|
|
78
|
+
export declare class NysTextarea extends NysFormControlElement {
|
|
30
79
|
static styles: import("lit").CSSResult;
|
|
31
80
|
static shadowRootOptions: {
|
|
32
81
|
delegatesFocus: boolean;
|
|
@@ -50,7 +99,7 @@ export declare class NysTextarea extends LitElement {
|
|
|
50
99
|
value: string;
|
|
51
100
|
/** Prevents interaction. */
|
|
52
101
|
disabled: boolean;
|
|
53
|
-
/** Makes textarea
|
|
102
|
+
/** Makes textarea readonly but focusable. */
|
|
54
103
|
readonly: boolean;
|
|
55
104
|
/** Marks as required. Shows "Required" flag and validates on blur. */
|
|
56
105
|
required: boolean;
|
|
@@ -83,14 +132,15 @@ export declare class NysTextarea extends LitElement {
|
|
|
83
132
|
showError: boolean;
|
|
84
133
|
/** Error message text. Shown only when `showError` is true. */
|
|
85
134
|
errorMessage: string;
|
|
135
|
+
/** Accessible label used only when no visible `label` is provided. */
|
|
136
|
+
ariaLabel: string;
|
|
86
137
|
private _hasUserInteracted;
|
|
87
|
-
private _internals;
|
|
88
138
|
/**
|
|
89
139
|
* Lifecycle methods
|
|
90
140
|
* --------------------------------------------------------------------------
|
|
141
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
142
|
+
* NysFormControlElement (@nysds/internals).
|
|
91
143
|
*/
|
|
92
|
-
static formAssociated: boolean;
|
|
93
|
-
constructor();
|
|
94
144
|
connectedCallback(): void;
|
|
95
145
|
disconnectedCallback(): void;
|
|
96
146
|
firstUpdated(): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysFormControlElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-label";
|
|
3
|
+
import "@nysds/nys-errormessage";
|
|
4
|
+
import "@nysds/nys-button";
|
|
5
|
+
import "@nysds/nys-icon";
|
|
2
6
|
/**
|
|
3
7
|
* A text input for collecting short, single-line data. Supports validation, input masking (tel),
|
|
4
8
|
* password visibility toggle, and live error messaging. Form-associated via ElementInternals.
|
|
@@ -17,29 +21,88 @@ import { LitElement } from "lit";
|
|
|
17
21
|
* @fires nys-focus - Fired when input gains focus.
|
|
18
22
|
* @fires nys-blur - Fired when input loses focus. Triggers validation.
|
|
19
23
|
*
|
|
20
|
-
* @example Basic
|
|
24
|
+
* @example Basic
|
|
21
25
|
* ```html
|
|
22
|
-
* <nys-textinput label="Full Name"
|
|
26
|
+
* <nys-textinput label="Full Name"></nys-textinput>
|
|
23
27
|
* ```
|
|
24
28
|
*
|
|
25
|
-
* @example
|
|
29
|
+
* @example Disabled
|
|
26
30
|
* ```html
|
|
27
|
-
* <nys-textinput
|
|
31
|
+
* <nys-textinput label="Email Address" disabled></nys-textinput>
|
|
28
32
|
* ```
|
|
29
33
|
*
|
|
30
|
-
* @example
|
|
34
|
+
* @example Readonly
|
|
31
35
|
* ```html
|
|
32
|
-
* <nys-textinput
|
|
36
|
+
* <nys-textinput label="Email Address" readonly value="You can see me but not edit me"></nys-textinput>
|
|
33
37
|
* ```
|
|
34
38
|
*
|
|
35
|
-
* @example
|
|
39
|
+
* @example Required
|
|
36
40
|
* ```html
|
|
37
|
-
* <nys-textinput
|
|
38
|
-
*
|
|
41
|
+
* <nys-textinput label="Email Address" required></nys-textinput>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example Optional
|
|
45
|
+
* ```html
|
|
46
|
+
* <nys-textinput label="Email Address" optional></nys-textinput>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Width Small
|
|
50
|
+
* ```html
|
|
51
|
+
* <nys-textinput label="Zip Code" width="sm"></nys-textinput>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example Width Medium
|
|
55
|
+
* ```html
|
|
56
|
+
* <nys-textinput label="City" width="md"></nys-textinput>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example Width Large
|
|
60
|
+
* ```html
|
|
61
|
+
* <nys-textinput label="Email Address" width="lg"></nys-textinput>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Description
|
|
65
|
+
* ```html
|
|
66
|
+
* <nys-textinput label="Email Address" description="Only valid ny.gov emails are accepted."></nys-textinput>
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example Description Slot
|
|
70
|
+
* ```html
|
|
71
|
+
* <nys-textinput label="Email Address">
|
|
72
|
+
* <div slot="description">Only valid <strong>ny.gov</strong> emails are accepted.</div>
|
|
73
|
+
* </nys-textinput>
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example Masking
|
|
77
|
+
* ```html
|
|
78
|
+
* <nys-textinput type="tel" label="Phone Number">
|
|
79
|
+
* <div slot="description">Some types, such as <code>tel</code> have automatic masking available.</div>
|
|
80
|
+
* </nys-textinput>
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @example Password
|
|
84
|
+
* ```html
|
|
85
|
+
* <nys-textinput type="password"></nys-textinput>
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @example Max Min Values
|
|
89
|
+
* ```html
|
|
90
|
+
* <nys-textinput type="number" label="Age" min="18" max="99" width="sm"></nys-textinput>
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @example Suffix Button
|
|
94
|
+
* ```html
|
|
95
|
+
* <nys-textinput id="search-demo" type="search" placeholder="Search">
|
|
96
|
+
* <nys-button
|
|
97
|
+
* slot="endButton"
|
|
98
|
+
* ariaLabel="Search"
|
|
99
|
+
* prefixIcon="search"
|
|
100
|
+
* onclick="alert('searching for: ' + document.getElementById('search-demo').value)"
|
|
101
|
+
* ></nys-button>
|
|
39
102
|
* </nys-textinput>
|
|
40
103
|
* ```
|
|
41
104
|
*/
|
|
42
|
-
export declare class NysTextinput extends
|
|
105
|
+
export declare class NysTextinput extends NysFormControlElement {
|
|
43
106
|
static styles: import("lit").CSSResult;
|
|
44
107
|
static shadowRootOptions: {
|
|
45
108
|
delegatesFocus: boolean;
|
|
@@ -105,14 +168,13 @@ export declare class NysTextinput extends LitElement {
|
|
|
105
168
|
private showPassword;
|
|
106
169
|
private _originalErrorMessage;
|
|
107
170
|
private _hasUserInteracted;
|
|
108
|
-
private _internals;
|
|
109
171
|
private _maskPatterns;
|
|
110
172
|
/**
|
|
111
173
|
* Lifecycle methods
|
|
112
174
|
* --------------------------------------------------------------------------
|
|
175
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
176
|
+
* NysFormControlElement (@nysds/internals).
|
|
113
177
|
*/
|
|
114
|
-
static formAssociated: boolean;
|
|
115
|
-
constructor();
|
|
116
178
|
connectedCallback(): void;
|
|
117
179
|
disconnectedCallback(): void;
|
|
118
180
|
firstUpdated(): Promise<void>;
|
|
@@ -133,6 +195,7 @@ export declare class NysTextinput extends LitElement {
|
|
|
133
195
|
checkValidity(): boolean;
|
|
134
196
|
private _handleInvalid;
|
|
135
197
|
private _togglePasswordVisibility;
|
|
198
|
+
private _clearSearch;
|
|
136
199
|
private _updateOverlay;
|
|
137
200
|
private _applyMask;
|
|
138
201
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysFormControlElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-label";
|
|
3
|
+
import "@nysds/nys-icon";
|
|
2
4
|
/**
|
|
3
5
|
* A toggle switch for binary settings with immediate effect. Form-associated via ElementInternals.
|
|
4
6
|
*
|
|
@@ -14,17 +16,53 @@ import { LitElement } from "lit";
|
|
|
14
16
|
* @fires nys-focus - Fired when toggle gains focus.
|
|
15
17
|
* @fires nys-blur - Fired when toggle loses focus.
|
|
16
18
|
*
|
|
17
|
-
* @example Basic
|
|
19
|
+
* @example Basic
|
|
18
20
|
* ```html
|
|
19
|
-
* <nys-toggle label="Enable notifications" name="notifications"></nys-toggle>
|
|
21
|
+
* <nys-toggle label="Enable notifications" name="notifications" value="enabled-notifications"></nys-toggle>
|
|
20
22
|
* ```
|
|
21
23
|
*
|
|
22
|
-
* @example
|
|
24
|
+
* @example Checked
|
|
23
25
|
* ```html
|
|
24
|
-
* <nys-toggle label="Dark
|
|
26
|
+
* <nys-toggle label="Dark Mode" name="theme" value="dark" checked></nys-toggle>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example Disabled
|
|
30
|
+
* ```html
|
|
31
|
+
* <nys-toggle label="Opt Out of emails" name="toggle-switch" value="emails" disabled></nys-toggle>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example Hide Icon
|
|
35
|
+
* ```html
|
|
36
|
+
* <nys-toggle label="No icon on the toggle knob" name="icon" value="no-icon" noIcon></nys-toggle>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example Size small
|
|
40
|
+
* ```html
|
|
41
|
+
* <nys-toggle label="Tiny but mighty" name="sm-size" value="sm-size" size="sm"></nys-toggle>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example Description
|
|
45
|
+
* ```html
|
|
46
|
+
* <nys-toggle
|
|
47
|
+
* label="Opt Out of emails"
|
|
48
|
+
* description="An email address is recommended to be on file for contact information."
|
|
49
|
+
* name="toggle-switch"
|
|
50
|
+
* value="emails"
|
|
51
|
+
* ></nys-toggle>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example Description Slot
|
|
55
|
+
* ```html
|
|
56
|
+
* <nys-toggle
|
|
57
|
+
* label="Opt Out of emails"
|
|
58
|
+
* name="toggle-switch"
|
|
59
|
+
* value="emails"
|
|
60
|
+
* >
|
|
61
|
+
* <p slot="description">We <strong>REALLY</strong> encourage you to keep emails enabled for contact purposes.</p>
|
|
62
|
+
* </nys-toggle>
|
|
25
63
|
* ```
|
|
26
64
|
*/
|
|
27
|
-
export declare class NysToggle extends
|
|
65
|
+
export declare class NysToggle extends NysFormControlElement {
|
|
28
66
|
static styles: import("lit").CSSResult;
|
|
29
67
|
static shadowRootOptions: {
|
|
30
68
|
delegatesFocus: boolean;
|
|
@@ -59,14 +97,13 @@ export declare class NysToggle extends LitElement {
|
|
|
59
97
|
* @default "md"
|
|
60
98
|
*/
|
|
61
99
|
size: "sm" | "md";
|
|
62
|
-
private _internals;
|
|
63
100
|
/**
|
|
64
101
|
* Lifecycle methods
|
|
65
102
|
* --------------------------------------------------------------------------
|
|
103
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
104
|
+
* NysFormControlElement (@nysds/internals). super.connectedCallback() assigns
|
|
105
|
+
* an id (prefix = localName) when one is not provided.
|
|
66
106
|
*/
|
|
67
|
-
static formAssociated: boolean;
|
|
68
|
-
constructor();
|
|
69
|
-
connectedCallback(): void;
|
|
70
107
|
/**
|
|
71
108
|
* Form Integration
|
|
72
109
|
* --------------------------------------------------------------------------
|
|
@@ -1,26 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
2
|
/**
|
|
3
3
|
* Shows contextual help text on hover/focus. Auto-positions to stay within viewport and supports keyboard dismiss.
|
|
4
4
|
*
|
|
5
5
|
* Link to a trigger element via `for` attribute matching the trigger's `id`. Tooltip appears on hover or focus
|
|
6
6
|
* and dismisses on blur, mouse leave, or Escape key. Use for supplementary info only—not critical content.
|
|
7
7
|
*
|
|
8
|
+
* @accessibility
|
|
9
|
+
* - Linked to trigger element via `for` attribute (must match trigger's `id`).
|
|
10
|
+
* - `role="tooltip"` with dynamic `aria-hidden` based on visibility.
|
|
11
|
+
* - Keyboard accessible: Tab to trigger, Enter/Space shows tooltip, Escape dismisses.
|
|
12
|
+
* - Screen readers announce tooltip text when visible.
|
|
13
|
+
* - Visual focus indicators on trigger elements meet WCAG 2.2 AA standards.
|
|
14
|
+
* - Auto-positioning respects viewport bounds to prevent content loss.
|
|
15
|
+
*
|
|
8
16
|
* @summary Contextual tooltip with auto-positioning, keyboard support, and screen reader integration.
|
|
9
17
|
* @element nys-tooltip
|
|
10
18
|
*
|
|
11
|
-
* @example
|
|
19
|
+
* @example Basic
|
|
20
|
+
* ```html
|
|
21
|
+
* <div style="display: flex; justify-content: center; gap: 5px; padding: 40px;">
|
|
22
|
+
* <nys-tooltip for="my-button" text="I am a tooltip."></nys-tooltip>
|
|
23
|
+
* <nys-button id="my-button" label="Hover Me"></nys-button>
|
|
24
|
+
* </div>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example Position
|
|
12
28
|
* ```html
|
|
13
|
-
* <
|
|
14
|
-
*
|
|
29
|
+
* <div style="display: flex; justify-content: center; gap: 5px; padding: 40px;">
|
|
30
|
+
* <p>Hover over the icon</p>
|
|
31
|
+
* <nys-tooltip
|
|
32
|
+
* for="my-icon2"
|
|
33
|
+
* text="I am a tooltip."
|
|
34
|
+
* position="right"
|
|
35
|
+
* >
|
|
36
|
+
* </nys-tooltip>
|
|
37
|
+
* <nys-icon id="my-icon2" name="info" size="3xl"></nys-icon>
|
|
38
|
+
* </div>
|
|
15
39
|
* ```
|
|
16
40
|
*
|
|
17
|
-
* @example
|
|
41
|
+
* @example Inverted
|
|
18
42
|
* ```html
|
|
19
|
-
* <
|
|
20
|
-
*
|
|
43
|
+
* <div style="background-color: #1b1b1b; color: #ffffff; padding: 40px; display: flex; gap: 5px">
|
|
44
|
+
* <p>Hover over the icon</p>
|
|
45
|
+
* <nys-tooltip
|
|
46
|
+
* for="my-tooltip3"
|
|
47
|
+
* text="I am a tooltip."
|
|
48
|
+
* inverted
|
|
49
|
+
* >
|
|
50
|
+
* </nys-tooltip>
|
|
51
|
+
* <nys-icon id="my-tooltip3" name="info" size="3xl"></nys-icon>
|
|
52
|
+
* </div>
|
|
21
53
|
* ```
|
|
22
54
|
*/
|
|
23
|
-
export declare class NysTooltip extends
|
|
55
|
+
export declare class NysTooltip extends NysElement {
|
|
24
56
|
static styles: import("lit").CSSResult;
|
|
25
57
|
/** Unique identifier. Auto-generated if not provided. */
|
|
26
58
|
id: string;
|
|
@@ -69,6 +101,14 @@ export declare class NysTooltip extends LitElement {
|
|
|
69
101
|
* --------------------------------------------------------------------------
|
|
70
102
|
*/
|
|
71
103
|
private _getReferenceElement;
|
|
104
|
+
/**
|
|
105
|
+
* Programmatically associates the trigger with the tooltip via
|
|
106
|
+
* `aria-describedby`, per the WAI-ARIA Tooltip pattern. The tooltip bubble
|
|
107
|
+
* (`.nys-tooltip__content`) carries `role="tooltip"` and `id={this.id}`, so we
|
|
108
|
+
* point the trigger's `aria-describedby` at that id. Preserves any existing
|
|
109
|
+
* `aria-describedby` tokens the consumer already set, and avoids duplicates.
|
|
110
|
+
*/
|
|
111
|
+
private _associateTrigger;
|
|
72
112
|
private _passAria;
|
|
73
113
|
/**
|
|
74
114
|
* In React, the reference element found is often the native HTML element within the nys-component.
|
|
@@ -1,25 +1,66 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
2
|
/**
|
|
3
3
|
* Universal NYS footer with logo and statewide navigation links. Required on all NYS sites.
|
|
4
4
|
*
|
|
5
5
|
* Place as the last element before `</body>`. Displays NY.gov logo and links to Agencies,
|
|
6
6
|
* App Directory, Counties, Events, Programs, and Services. No configuration needed.
|
|
7
7
|
*
|
|
8
|
+
* @accessibility
|
|
9
|
+
* - Uses semantic `<footer>` element for assistive technology recognition.
|
|
10
|
+
* - All links are keyboard-navigable via Tab.
|
|
11
|
+
* - Proper link text for screen reader users.
|
|
12
|
+
* - Links open in same window (no target="_blank") unless external policy requires otherwise.
|
|
13
|
+
* - Visual design meets WCAG 2.2 AA contrast and focus indicator standards.
|
|
14
|
+
* - Footer is not hidden from screen readers and is announced as navigation.
|
|
15
|
+
*
|
|
16
|
+
*
|
|
8
17
|
* @summary Universal NYS footer with logo and statewide links. Required site-wide.
|
|
9
18
|
* @element nys-unavfooter
|
|
10
19
|
*
|
|
11
|
-
* @example
|
|
20
|
+
* @example Basic
|
|
12
21
|
* ```html
|
|
13
|
-
* <nys-globalfooter>...</nys-globalfooter>
|
|
14
22
|
* <nys-unavfooter></nys-unavfooter>
|
|
15
23
|
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Custom landmark label
|
|
26
|
+
* ```html
|
|
27
|
+
* <!-- Renames the contentinfo landmark. Keep it distinct from the agency footer's. -->
|
|
28
|
+
* <nys-unavfooter landmarkLabel="Statewide"></nys-unavfooter>
|
|
29
|
+
* ```
|
|
16
30
|
*/
|
|
17
|
-
export declare class NysUnavFooter extends
|
|
31
|
+
export declare class NysUnavFooter extends NysElement {
|
|
18
32
|
static styles: import("lit").CSSResult;
|
|
33
|
+
/**
|
|
34
|
+
* Accessible name for the `contentinfo` landmark this footer renders.
|
|
35
|
+
* Defaults to `"New York State"`.
|
|
36
|
+
*
|
|
37
|
+
* A page pairing this footer with `nys-globalfooter` carries two `contentinfo`
|
|
38
|
+
* landmarks; distinct names are what keep landmark navigation useful instead of
|
|
39
|
+
* announcing "content information" twice. Override only when your wording is
|
|
40
|
+
* clearer for your audience — and keep it distinct from the agency footer's
|
|
41
|
+
* name, which comes from that footer's visible heading.
|
|
42
|
+
*
|
|
43
|
+
* A blank value falls back to the default rather than leaving the landmark
|
|
44
|
+
* unnamed.
|
|
45
|
+
*
|
|
46
|
+
* @default "New York State"
|
|
47
|
+
*/
|
|
48
|
+
landmarkLabel: string;
|
|
49
|
+
/**
|
|
50
|
+
* Lifecycle methods
|
|
51
|
+
* --------------------------------------------------------------------------
|
|
52
|
+
*/
|
|
53
|
+
connectedCallback(): void;
|
|
19
54
|
/**
|
|
20
55
|
* Functions
|
|
21
56
|
* --------------------------------------------------------------------------
|
|
22
57
|
*/
|
|
23
58
|
private _getNysLogo;
|
|
59
|
+
/**
|
|
60
|
+
* The contentinfo's accessible name. A blank override would put the page back
|
|
61
|
+
* where #1795 found it — two unnamed contentinfo landmarks — so it falls back
|
|
62
|
+
* to the default.
|
|
63
|
+
*/
|
|
64
|
+
private get _landmarkLabel();
|
|
24
65
|
render(): import("lit-html").TemplateResult<1>;
|
|
25
66
|
}
|