@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,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysFormControlElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-label";
|
|
3
|
+
import "@nysds/nys-errormessage";
|
|
4
|
+
import "@nysds/nys-textinput";
|
|
2
5
|
/**
|
|
3
6
|
* A container for grouping `nys-radiobutton` elements as a single form control with enforced single selection.
|
|
4
7
|
* Handles keyboard navigation (arrow keys), validation, required constraints, and form integration.
|
|
@@ -12,7 +15,7 @@ import { LitElement } from "lit";
|
|
|
12
15
|
* @slot - Default slot for `nys-radiobutton` elements.
|
|
13
16
|
* @slot description - Custom HTML description content.
|
|
14
17
|
*
|
|
15
|
-
* @example Basic
|
|
18
|
+
* @example Basic
|
|
16
19
|
* ```html
|
|
17
20
|
* <nys-radiogroup label="Select borough" required>
|
|
18
21
|
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
@@ -20,8 +23,85 @@ import { LitElement } from "lit";
|
|
|
20
23
|
* <nys-radiobutton name="borough" value="manhattan" label="Manhattan"></nys-radiobutton>
|
|
21
24
|
* </nys-radiogroup>
|
|
22
25
|
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example Tile
|
|
28
|
+
* ```html
|
|
29
|
+
* <nys-radiogroup label="Select borough" tile>
|
|
30
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
31
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
32
|
+
* </nys-radiogroup>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example Required
|
|
36
|
+
* ```html
|
|
37
|
+
* <nys-radiogroup label="Select borough" required>
|
|
38
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
39
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
40
|
+
* </nys-radiogroup>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example Optional
|
|
44
|
+
* ```html
|
|
45
|
+
* <nys-radiogroup label="Select borough" optional>
|
|
46
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
47
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
48
|
+
* </nys-radiogroup>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @example Disabled
|
|
52
|
+
* ```html
|
|
53
|
+
* <nys-radiogroup label="Select borough">
|
|
54
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx" disabled></nys-radiobutton>
|
|
55
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn" disabled></nys-radiobutton>
|
|
56
|
+
* </nys-radiogroup>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example Size Small
|
|
60
|
+
* ```html
|
|
61
|
+
* <nys-radiogroup label="Select borough" size="sm">
|
|
62
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
63
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
64
|
+
* </nys-radiogroup>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example Other Option
|
|
68
|
+
* ```html
|
|
69
|
+
* <nys-radiogroup label="Select borough">
|
|
70
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
71
|
+
* <nys-radiobutton name="borough" value="" label="Other" other></nys-radiobutton>
|
|
72
|
+
* </nys-radiogroup>
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @example Error Message
|
|
76
|
+
* ```html
|
|
77
|
+
* <nys-radiogroup label="Select borough" showError errorMessage="Please select a borough">
|
|
78
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
79
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
80
|
+
* </nys-radiogroup>
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @example Description
|
|
84
|
+
* ```html
|
|
85
|
+
* <nys-radiogroup label="Select borough" description="Your primary residence in NYC.">
|
|
86
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
87
|
+
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
88
|
+
* </nys-radiogroup>
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @example Description Slot
|
|
92
|
+
* ```html
|
|
93
|
+
* <nys-radiogroup label="What is your primary work location?">
|
|
94
|
+
* <label slot="description">This is the location you use for your <a href="https://www.ny.gov/" target="__blank">in office days.</a></label>
|
|
95
|
+
* <nys-radiobutton name="office" label="Albany" value="albany">
|
|
96
|
+
* <label slot="description">A part of <a href="https://www.ny.gov/" target="__blank">Upstate New York</a></label>
|
|
97
|
+
* </nys-radiobutton>
|
|
98
|
+
* <nys-radiobutton name="office" label="Manhattan" value="manhattan">
|
|
99
|
+
* <label slot="description">A part of <a href="https://www.ny.gov/" target="__blank">New York City</a></label>
|
|
100
|
+
* </nys-radiobutton>
|
|
101
|
+
* </nys-radiogroup>
|
|
102
|
+
* ```
|
|
23
103
|
*/
|
|
24
|
-
export declare class NysRadiogroup extends
|
|
104
|
+
export declare class NysRadiogroup extends NysFormControlElement {
|
|
25
105
|
static styles: import("lit").CSSResult;
|
|
26
106
|
static shadowRootOptions: {
|
|
27
107
|
delegatesFocus: boolean;
|
|
@@ -66,13 +146,14 @@ export declare class NysRadiogroup extends LitElement {
|
|
|
66
146
|
private isMobile;
|
|
67
147
|
private _hasUserInteracted;
|
|
68
148
|
private _childObserver?;
|
|
69
|
-
private _internals;
|
|
70
149
|
/**
|
|
71
150
|
* Lifecycle methods
|
|
72
151
|
* --------------------------------------------------------------------------
|
|
152
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
153
|
+
* NysFormControlElement (@nysds/internals). super.connectedCallback()
|
|
154
|
+
* assigns an id (prefix = localName) when one is not provided.
|
|
73
155
|
*/
|
|
74
|
-
|
|
75
|
-
constructor();
|
|
156
|
+
protected get defaultRole(): string | null;
|
|
76
157
|
connectedCallback(): void;
|
|
77
158
|
disconnectedCallback(): void;
|
|
78
159
|
firstUpdated(): Promise<void>;
|
|
@@ -100,6 +181,7 @@ export declare class NysRadiogroup extends LitElement {
|
|
|
100
181
|
private _updateRadioButtonsSize;
|
|
101
182
|
private _selectRadio;
|
|
102
183
|
private _getSlotDescriptionForAria;
|
|
184
|
+
private _forwardRadioDescriptions;
|
|
103
185
|
/**
|
|
104
186
|
* Event Handlers
|
|
105
187
|
* --------------------------------------------------------------------------
|
|
@@ -9,14 +9,6 @@ import { LitElement } from "lit";
|
|
|
9
9
|
* @element nys-option
|
|
10
10
|
*
|
|
11
11
|
* @slot - Option label text. Auto-populates the `label` prop if provided.
|
|
12
|
-
*
|
|
13
|
-
* @example Basic options
|
|
14
|
-
* ```html
|
|
15
|
-
* <nys-select>
|
|
16
|
-
* <nys-option value="ny">New York</nys-option>
|
|
17
|
-
* <nys-option value="ca" disabled>California</nys-option>
|
|
18
|
-
* </nys-select>
|
|
19
|
-
* ```
|
|
20
12
|
*/
|
|
21
13
|
export declare class NysOption extends LitElement {
|
|
22
14
|
/** Prevents selection of this option. */
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysFormControlElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-label";
|
|
3
|
+
import "@nysds/nys-errormessage";
|
|
4
|
+
import "@nysds/nys-icon";
|
|
2
5
|
/**
|
|
3
6
|
* A dropdown for selecting a single option from a list. Supports native `<option>` and `<optgroup>` elements.
|
|
4
7
|
* Form-associated with validation via ElementInternals.
|
|
@@ -16,26 +19,157 @@ import { LitElement } from "lit";
|
|
|
16
19
|
* @fires nys-focus - Fired when select gains focus.
|
|
17
20
|
* @fires nys-blur - Fired when select loses focus. Triggers validation.
|
|
18
21
|
*
|
|
19
|
-
* @example Basic
|
|
22
|
+
* @example Basic
|
|
20
23
|
* ```html
|
|
21
|
-
*
|
|
22
|
-
* <option value="bronx"
|
|
23
|
-
* <option value="brooklyn"
|
|
24
|
-
* <option value="manhattan"
|
|
24
|
+
* <nys-select label="Select your favorite borough" id="borough">
|
|
25
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
26
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
27
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
28
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
29
|
+
* <option value="queens" label="Queens"></option>
|
|
25
30
|
* </nys-select>
|
|
26
31
|
* ```
|
|
27
32
|
*
|
|
28
|
-
* @example
|
|
33
|
+
* @example Default value
|
|
29
34
|
* ```html
|
|
30
|
-
* <nys-select label="Select
|
|
31
|
-
* <
|
|
32
|
-
*
|
|
33
|
-
*
|
|
35
|
+
* <nys-select label="Select your favorite borough" id="borough">
|
|
36
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
37
|
+
* <option value="brooklyn" label="Brooklyn" selected></option>
|
|
38
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
39
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
40
|
+
* <option value="queens" label="Queens"></option>
|
|
41
|
+
* </nys-select>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example Option Group
|
|
45
|
+
* ```html
|
|
46
|
+
* <nys-select
|
|
47
|
+
* label="Which New York State service are you contacting us about?"
|
|
48
|
+
* description="This is for demo purposes and the list might not be exhaustive."
|
|
49
|
+
* >
|
|
50
|
+
* <optgroup label="Transportation Services">
|
|
51
|
+
* <option value="mta">MTA / Public Transit</option>
|
|
52
|
+
* <option value="dmv">Department of Motor Vehicles (DMV)</option>
|
|
53
|
+
* <option value="highway">Highway Maintenance</option>
|
|
54
|
+
* </optgroup>
|
|
55
|
+
* <optgroup label="Health & Human Services">
|
|
56
|
+
* <option value="medicaid">Medicaid / Health Insurance</option>
|
|
57
|
+
* <option value="mental-health">Mental Health Support</option>
|
|
58
|
+
* <option value="child-family">Child and Family Services</option>
|
|
34
59
|
* </optgroup>
|
|
60
|
+
* <optgroup label="Public Safety">
|
|
61
|
+
* <option value="state-police">State Police</option>
|
|
62
|
+
* <option value="emergency-management">Emergency Management</option>
|
|
63
|
+
* <option value="fire-safety">Fire Safety</option>
|
|
64
|
+
* </optgroup>
|
|
65
|
+
* <optgroup label="Environment & Energy">
|
|
66
|
+
* <option value="environmental-conservation">
|
|
67
|
+
* Environmental Conservation
|
|
68
|
+
* </option>
|
|
69
|
+
* <option value="clean-energy">Clean Energy Programs</option>
|
|
70
|
+
* <option value="waste-management">Waste Management</option>
|
|
71
|
+
* </optgroup>
|
|
72
|
+
* </nys-select>
|
|
73
|
+
* ```
|
|
74
|
+
* @example Disabled
|
|
75
|
+
* ```html
|
|
76
|
+
* <nys-select label="Select your favorite borough" id="borough" disabled>
|
|
77
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
78
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
79
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
80
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
81
|
+
* <option value="queens" label="Queens"></option>
|
|
82
|
+
* </nys-select>
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @example Disabled Option
|
|
86
|
+
* ```html
|
|
87
|
+
* <nys-select label="Select your favorite borough" id="borough">
|
|
88
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
89
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
90
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
91
|
+
* <option value="staten_island" label="Staten Island" disabled></option>
|
|
92
|
+
* <option value="queens" label="Queens" disabled></option>
|
|
93
|
+
* </nys-select>
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @example Required
|
|
97
|
+
* ```html
|
|
98
|
+
* <nys-select label="Select your favorite borough" id="borough" required>
|
|
99
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
100
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
101
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
102
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
103
|
+
* <option value="queens" label="Queens"></option>
|
|
104
|
+
* </nys-select>
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @example Optional
|
|
108
|
+
* ```html
|
|
109
|
+
* <nys-select label="Select your favorite borough" id="borough" optional>
|
|
110
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
111
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
112
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
113
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
114
|
+
* <option value="queens" label="Queens"></option>
|
|
115
|
+
* </nys-select>
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @example Width small
|
|
119
|
+
* ```html
|
|
120
|
+
* <nys-select label="Select your favorite borough" id="borough" width="sm">
|
|
121
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
122
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
123
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
124
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
125
|
+
* <option value="queens" label="Queens"></option>
|
|
126
|
+
* </nys-select>
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* @example Width medium
|
|
130
|
+
* ```html
|
|
131
|
+
* <nys-select label="Select your favorite borough" id="borough" width="md">
|
|
132
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
133
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
134
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
135
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
136
|
+
* <option value="queens" label="Queens"></option>
|
|
35
137
|
* </nys-select>
|
|
36
138
|
* ```
|
|
139
|
+
*
|
|
140
|
+
* @example Width large
|
|
141
|
+
* ```html
|
|
142
|
+
* <nys-select label="Select your favorite borough" id="borough" width="lg">
|
|
143
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
144
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
145
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
146
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
147
|
+
* <option value="queens" label="Queens"></option>
|
|
148
|
+
* </nys-select>
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* @example Slotted Description
|
|
152
|
+
* ```html
|
|
153
|
+
* <nys-select label="Select your favorite borough" id="borough">
|
|
154
|
+
* <label slot="description">This is a slotted description</label>
|
|
155
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
156
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
157
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
158
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
159
|
+
* <option value="queens" label="Queens"></option>
|
|
160
|
+
* </nys-select>
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @example Error Message
|
|
164
|
+
* <nys-select label="Select your favorite borough" id="borough" errorMessage="You did not select a borough" showError>
|
|
165
|
+
* <option value="bronx" label="The Bronx"></option>
|
|
166
|
+
* <option value="brooklyn" label="Brooklyn"></option>
|
|
167
|
+
* <option value="manhattan" label="Manhattan"></option>
|
|
168
|
+
* <option value="staten_island" label="Staten Island"></option>
|
|
169
|
+
* <option value="queens" label="Queens"></option>
|
|
170
|
+
* </nys-select>
|
|
37
171
|
*/
|
|
38
|
-
export declare class NysSelect extends
|
|
172
|
+
export declare class NysSelect extends NysFormControlElement {
|
|
39
173
|
static styles: import("lit").CSSResult;
|
|
40
174
|
static shadowRootOptions: {
|
|
41
175
|
delegatesFocus: boolean;
|
|
@@ -53,6 +187,8 @@ export declare class NysSelect extends LitElement {
|
|
|
53
187
|
label: string;
|
|
54
188
|
/** Helper text below label. Use slot for custom HTML. */
|
|
55
189
|
description: string;
|
|
190
|
+
/** Accessible label. Used as a fallback when `label` is not provided. */
|
|
191
|
+
ariaLabel: string;
|
|
56
192
|
/** Currently selected option value. */
|
|
57
193
|
value: string;
|
|
58
194
|
/** Prevents interaction. */
|
|
@@ -78,13 +214,12 @@ export declare class NysSelect extends LitElement {
|
|
|
78
214
|
width: "sm" | "md" | "lg" | "full";
|
|
79
215
|
private _originalErrorMessage;
|
|
80
216
|
private _hasUserInteracted;
|
|
81
|
-
private _internals;
|
|
82
217
|
/**
|
|
83
218
|
* Lifecycle methods
|
|
84
219
|
* --------------------------------------------------------------------------
|
|
220
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
221
|
+
* NysFormControlElement (@nysds/internals).
|
|
85
222
|
*/
|
|
86
|
-
static formAssociated: boolean;
|
|
87
|
-
constructor();
|
|
88
223
|
connectedCallback(): void;
|
|
89
224
|
disconnectedCallback(): void;
|
|
90
225
|
firstUpdated(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
2
|
/**
|
|
3
3
|
* An accessible "Skip to main content" link for keyboard and screen reader users. Visually hidden until focused.
|
|
4
4
|
*
|
|
@@ -8,18 +8,18 @@ import { LitElement } from "lit";
|
|
|
8
8
|
* @summary Skip navigation link for keyboard accessibility. Hidden until focused.
|
|
9
9
|
* @element nys-skipnav
|
|
10
10
|
*
|
|
11
|
-
* @example
|
|
11
|
+
* @example Basic
|
|
12
12
|
* ```html
|
|
13
13
|
* <nys-skipnav></nys-skipnav>
|
|
14
|
-
* <main id="main-content">...</main>
|
|
15
14
|
* ```
|
|
16
15
|
*
|
|
17
16
|
* @example Custom target
|
|
18
17
|
* ```html
|
|
19
18
|
* <nys-skipnav href="#content-area"></nys-skipnav>
|
|
19
|
+
* <p id="content-area">...</p>
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
export declare class NysSkipnav extends
|
|
22
|
+
export declare class NysSkipnav extends NysElement {
|
|
23
23
|
static styles: import("lit").CSSResult;
|
|
24
24
|
/** Unique identifier. Auto-generated if not provided. */
|
|
25
25
|
id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
2
|
/**
|
|
3
3
|
* A single step within `nys-stepper`. Represents one stage in a multi-step process.
|
|
4
4
|
*
|
|
@@ -43,10 +43,18 @@ import { LitElement } from "lit";
|
|
|
43
43
|
* as the `onClick` prop on `NysStep`.
|
|
44
44
|
*
|
|
45
45
|
* ## Accessibility
|
|
46
|
-
* - The
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* - `
|
|
46
|
+
* - The host carries `role="listitem"` so the parent stepper's `<ol>` and its slotted
|
|
47
|
+
* `<nys-step>` children form a real list — assistive technology announces each step's
|
|
48
|
+
* position and count (e.g. "2 of 4") automatically.
|
|
49
|
+
* - Navigable steps (`current`, `previous`, `selected`) render a real `<button>` for their
|
|
50
|
+
* row, giving native keyboard activation (Enter/Space), focus handling, and semantics for
|
|
51
|
+
* free — no manual `tabindex`/`keydown` scaffolding required.
|
|
52
|
+
* - Future (non-navigable) steps render the row as a plain, non-interactive `<div>` — not a
|
|
53
|
+
* disabled button. They are not focusable and carry no `role`, `tabindex`, or `aria-disabled`.
|
|
54
|
+
* - `aria-label` announces the step name and 1-indexed position, e.g. `"Personal Info, step 1"`.
|
|
55
|
+
* - The `current` step (progress boundary) is marked with `aria-current="step"` on the
|
|
56
|
+
* `<button>` itself so assistive technology announces the user's current position.
|
|
57
|
+
* - The visual step number is `aria-hidden` (its meaning is folded into the row's accessible name).
|
|
50
58
|
*
|
|
51
59
|
* ## Common patterns
|
|
52
60
|
*
|
|
@@ -74,21 +82,8 @@ import { LitElement } from "lit";
|
|
|
74
82
|
* @fires nys-step-click - Fired when a navigable (`previous` or `current`) non-selected step is clicked
|
|
75
83
|
* or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call
|
|
76
84
|
* `e.preventDefault()` to suppress `window.location.href` navigation.
|
|
77
|
-
*
|
|
78
|
-
* @example Step with page navigation
|
|
79
|
-
* ```html
|
|
80
|
-
* <nys-step label="Personal Info" href="/step-1"></nys-step>
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @example Step with SPA navigation (no href)
|
|
84
|
-
* ```js
|
|
85
|
-
* step.addEventListener('nys-step-click', (e) => {
|
|
86
|
-
* e.preventDefault(); // no href set, but good practice
|
|
87
|
-
* showStepContent(e.detail.label);
|
|
88
|
-
* });
|
|
89
|
-
* ```
|
|
90
85
|
*/
|
|
91
|
-
export declare class NysStep extends
|
|
86
|
+
export declare class NysStep extends NysElement {
|
|
92
87
|
static styles: import("lit").CSSResult;
|
|
93
88
|
/**
|
|
94
89
|
* Which step is currently being displayed. If not set, defaults to the `current` step.
|
|
@@ -118,7 +113,18 @@ export declare class NysStep extends LitElement {
|
|
|
118
113
|
onClick?: (e: Event) => void;
|
|
119
114
|
/** @internal 1-indexed position. Auto-assigned by the parent stepper on first render. Do not set manually. */
|
|
120
115
|
stepNumber: number;
|
|
116
|
+
/** A step is navigable (focusable + activatable) when it is the displayed,
|
|
117
|
+
* current, or a previously-reached step. Future steps are inert. */
|
|
118
|
+
private get _navigable();
|
|
119
|
+
/**
|
|
120
|
+
* Sets `role="listitem"` on the host so the parent stepper's `<ol>` (which
|
|
121
|
+
* only ever slots `<nys-step>` elements, never real `<li>`s) still forms a
|
|
122
|
+
* valid ARIA list. This is what lets assistive technology announce each
|
|
123
|
+
* step's position and count. Uses a plain attribute (not ElementInternals)
|
|
124
|
+
* so `getAttribute("role")` keeps working for existing consumers/tests,
|
|
125
|
+
* matching the convention used by `<nys-tab>`.
|
|
126
|
+
*/
|
|
127
|
+
connectedCallback(): void;
|
|
121
128
|
private _handleActivate;
|
|
122
|
-
private _handleKeydown;
|
|
123
129
|
render(): import("lit-html").TemplateResult<1>;
|
|
124
130
|
}
|