@nysds/components 1.20.0-alpha1 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +7119 -3701
- package/dist/.vscode/vscode.css-custom-data.json +5 -0
- package/dist/.vscode/vscode.html-custom-data.json +317 -38
- package/dist/custom-elements.json +7119 -3701
- package/dist/nys-icon.library-Bu3noJqZ-1mvg_e5Y.js +706 -0
- package/dist/nys-icon.library-Bu3noJqZ-1mvg_e5Y.js.map +1 -0
- package/dist/nys-icon.library-eNVZmfkf.js +696 -0
- package/dist/nys-icon.library-eNVZmfkf.js.map +1 -0
- package/dist/nysds.es.js +9119 -4161
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +2413 -492
- package/dist/nysds.js.map +1 -1
- package/dist/packages/internals/src/aria-associate.d.ts +41 -0
- package/dist/packages/internals/src/form-control-mixin.d.ts +34 -0
- package/dist/packages/internals/src/id.d.ts +8 -0
- package/dist/packages/internals/src/identified-mixin.d.ts +23 -0
- package/dist/packages/internals/src/index.d.ts +7 -0
- package/dist/packages/internals/src/reflects-aria-mixin.d.ts +33 -0
- package/dist/packages/internals/src/test-helpers.d.ts +29 -0
- package/dist/packages/internals/src/types.d.ts +9 -0
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +72 -10
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +63 -8
- package/dist/packages/nys-alert/src/nys-alert.d.ts +95 -20
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +100 -7
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +75 -5
- package/dist/packages/nys-badge/src/nys-badge.d.ts +63 -6
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +79 -10
- package/dist/packages/nys-button/src/nys-button.d.ts +132 -26
- package/dist/packages/nys-card/src/index.d.ts +1 -0
- package/dist/packages/nys-card/src/nys-card.d.ts +325 -0
- package/dist/packages/nys-card/src/nys-card.figma.d.ts +1 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +37 -12
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +84 -6
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +174 -5
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +83 -13
- package/dist/packages/nys-divider/src/nys-divider.d.ts +33 -9
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +24 -15
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +3 -12
- package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +22 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +129 -12
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +23 -2
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +99 -9
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +197 -7
- package/dist/packages/nys-icon/src/icon-cache.d.ts +11 -4
- package/dist/packages/nys-icon/src/icon-library-registry.d.ts +33 -16
- package/dist/packages/nys-icon/src/index.d.ts +2 -2
- package/dist/packages/nys-icon/src/nys-icon.d.ts +98 -8
- package/dist/packages/nys-iconlist/src/index.d.ts +2 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +92 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.figma.d.ts +1 -0
- package/dist/packages/nys-iconlist/src/nys-iconlistitem.d.ts +32 -0
- package/dist/packages/nys-label/src/nys-label.d.ts +37 -2
- package/dist/packages/nys-modal/src/nys-modal.d.ts +145 -13
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +67 -3
- package/dist/packages/nys-processlist/src/index.d.ts +2 -0
- package/dist/packages/nys-processlist/src/nys-processlist.d.ts +184 -0
- package/dist/packages/nys-processlist/src/nys-processlist.figma.d.ts +1 -0
- package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +41 -0
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +201 -7
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +88 -6
- package/dist/packages/nys-select/src/nys-option.d.ts +0 -8
- package/dist/packages/nys-select/src/nys-select.d.ts +150 -15
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +4 -4
- package/dist/packages/nys-stepper/src/nys-step.d.ts +26 -20
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +128 -75
- package/dist/packages/nys-tab/src/nys-tab.d.ts +19 -10
- package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +181 -39
- package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +15 -24
- package/dist/packages/nys-table/src/nys-table.d.ts +90 -3
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +60 -10
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +77 -14
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +47 -10
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +48 -8
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +45 -4
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +219 -10
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +421 -37
- package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +4 -54
- package/dist/packages/nys-video/src/nys-video.d.ts +67 -7
- package/dist/src/index.d.ts +5 -2
- package/package.json +15 -7
- package/packages/react/NysAccordion.d.ts +10 -0
- package/packages/react/NysAccordion.js +2 -1
- package/packages/react/NysAccordionItem.d.ts +10 -0
- package/packages/react/NysAccordionItem.js +3 -1
- package/packages/react/NysAlert.d.ts +8 -10
- package/packages/react/NysAlert.js +0 -2
- package/packages/react/NysAvatar.d.ts +11 -1
- package/packages/react/NysBacktotop.d.ts +3 -0
- package/packages/react/NysBacktotop.js +2 -1
- package/packages/react/NysBreadcrumbs.d.ts +2 -2
- package/packages/react/NysButton.d.ts +38 -8
- package/packages/react/NysButton.js +6 -4
- package/packages/react/NysCard.d.ts +110 -0
- package/packages/react/NysCard.js +61 -0
- package/packages/react/NysCheckbox.d.ts +9 -0
- package/packages/react/NysCheckbox.js +4 -0
- package/packages/react/NysDropdownMenu.d.ts +4 -2
- package/packages/react/NysFileinput.d.ts +25 -3
- package/packages/react/NysFileinput.js +8 -1
- package/packages/react/NysGlobalFooter.d.ts +17 -0
- package/packages/react/NysGlobalFooter.js +10 -2
- package/packages/react/NysGlobalHeader.d.ts +23 -1
- package/packages/react/NysGlobalHeader.js +11 -2
- package/packages/react/NysIconlist.d.ts +54 -0
- package/packages/react/NysIconlist.js +22 -0
- package/packages/react/NysIconlistitem.d.ts +59 -0
- package/packages/react/NysIconlistitem.js +22 -0
- package/packages/react/NysLabel.d.ts +4 -1
- package/packages/react/NysModal.d.ts +8 -1
- package/packages/react/NysModal.js +11 -2
- package/packages/react/NysProcesslist.d.ts +65 -0
- package/packages/react/NysProcesslist.js +25 -0
- package/packages/react/NysProcesslistitem.d.ts +61 -0
- package/packages/react/NysProcesslistitem.js +35 -0
- package/packages/react/NysRadiobutton.d.ts +27 -3
- package/packages/react/NysRadiobutton.js +9 -1
- package/packages/react/NysSelect.d.ts +3 -0
- package/packages/react/NysSelect.js +2 -0
- package/packages/react/NysStepper.d.ts +1 -1
- package/packages/react/NysTabgroup.d.ts +5 -4
- package/packages/react/NysTable.d.ts +1 -1
- package/packages/react/NysTabpanel.d.ts +11 -4
- package/packages/react/NysTextarea.d.ts +4 -1
- package/packages/react/NysTextarea.js +2 -0
- package/packages/react/NysUnavFooter.d.ts +13 -0
- package/packages/react/NysUnavFooter.js +4 -1
- package/packages/react/NysUnavHeader.d.ts +24 -1
- package/packages/react/NysUnavHeader.js +17 -1
- package/packages/react/NysVerticalnav.d.ts +15 -8
- package/packages/react/NysVerticalnav.js +6 -4
- package/packages/react/NysVerticalnavGroup.d.ts +4 -0
- package/packages/react/NysVerticalnavGroup.js +5 -0
- package/packages/react/index.d.ts +5 -0
- package/packages/react/index.js +5 -0
- package/packages/react/nysds-jsx.d.ts +394 -56
|
@@ -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 container for grouping multiple `nys-checkbox` components as a single form control.
|
|
4
6
|
* Handles validation, required constraints, and submits comma-separated values.
|
|
@@ -12,15 +14,89 @@ import { LitElement } from "lit";
|
|
|
12
14
|
* @slot - Default slot for `nys-checkbox` elements.
|
|
13
15
|
* @slot description - Custom HTML description content.
|
|
14
16
|
*
|
|
15
|
-
* @example Basic
|
|
17
|
+
* @example Basic
|
|
16
18
|
* ```html
|
|
17
19
|
* <nys-checkboxgroup label="Select landmarks" required>
|
|
18
20
|
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
19
21
|
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
20
22
|
* </nys-checkboxgroup>
|
|
21
23
|
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Tile
|
|
26
|
+
* ```html
|
|
27
|
+
* <nys-checkboxgroup label="Select landmarks" tile>
|
|
28
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
29
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
30
|
+
* </nys-checkboxgroup>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example Required
|
|
34
|
+
* ```html
|
|
35
|
+
* <nys-checkboxgroup label="Select landmarks" required>
|
|
36
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
37
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
38
|
+
* </nys-checkboxgroup>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Optional
|
|
42
|
+
* ```html
|
|
43
|
+
* <nys-checkboxgroup label="Select landmarks" optional>
|
|
44
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
45
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
46
|
+
* </nys-checkboxgroup>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Disabled
|
|
50
|
+
* ```html
|
|
51
|
+
* <nys-checkboxgroup label="Select landmarks">
|
|
52
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks" disabled></nys-checkbox>
|
|
53
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls" disabled></nys-checkbox>
|
|
54
|
+
* </nys-checkboxgroup>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example Size Small
|
|
58
|
+
* ```html
|
|
59
|
+
* <nys-checkboxgroup label="Select landmarks" size="sm">
|
|
60
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
61
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
62
|
+
* </nys-checkboxgroup>
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example Other Option
|
|
66
|
+
* ```html
|
|
67
|
+
* <nys-checkboxgroup label="Select landmarks">
|
|
68
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
69
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
70
|
+
* <nys-checkbox name="landmarks" value="" label="Other" other></nys-checkbox>
|
|
71
|
+
* </nys-checkboxgroup>
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @example Error Message
|
|
75
|
+
* ```html
|
|
76
|
+
* <nys-checkboxgroup label="Select landmarks" showError errorMessage="Please select at least one landmark">
|
|
77
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
78
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
79
|
+
* </nys-checkboxgroup>
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @example Description
|
|
83
|
+
* ```html
|
|
84
|
+
* <nys-checkboxgroup label="Select landmarks" description="Choose wisely, you can only pick one.">
|
|
85
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
86
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
87
|
+
* </nys-checkboxgroup>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @example Description Slot
|
|
91
|
+
* ```html
|
|
92
|
+
* <nys-checkboxgroup label="Select landmarks">
|
|
93
|
+
* <div slot="description">Your <strong>ABSOLUTE</strong> favorite one.</div>
|
|
94
|
+
* <nys-checkbox name="landmarks" value="adirondacks" label="Adirondacks"></nys-checkbox>
|
|
95
|
+
* <nys-checkbox name="landmarks" value="niagara" label="Niagara Falls"></nys-checkbox>
|
|
96
|
+
* </nys-checkboxgroup>
|
|
97
|
+
* ```
|
|
22
98
|
*/
|
|
23
|
-
export declare class NysCheckboxgroup extends
|
|
99
|
+
export declare class NysCheckboxgroup extends NysFormControlElement {
|
|
24
100
|
static styles: import("lit").CSSResult;
|
|
25
101
|
static shadowRootOptions: {
|
|
26
102
|
delegatesFocus: boolean;
|
|
@@ -60,13 +136,13 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
60
136
|
private _slottedDescriptionText;
|
|
61
137
|
private _hasOtherError;
|
|
62
138
|
private _otherErrorCheckbox;
|
|
63
|
-
private
|
|
139
|
+
private _hasSharedNames;
|
|
64
140
|
/**
|
|
65
141
|
* Lifecycle methods
|
|
66
142
|
* --------------------------------------------------------------------------
|
|
143
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
144
|
+
* NysFormControlElement (@nysds/internals).
|
|
67
145
|
*/
|
|
68
|
-
static formAssociated: boolean;
|
|
69
|
-
constructor();
|
|
70
146
|
connectedCallback(): void;
|
|
71
147
|
disconnectedCallback(): void;
|
|
72
148
|
firstUpdated(): void;
|
|
@@ -96,5 +172,7 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
96
172
|
private _handleChildErrorClear;
|
|
97
173
|
private _handleOtherInput;
|
|
98
174
|
private _checkOtherInputs;
|
|
175
|
+
/** Drupal-like naming support **/
|
|
176
|
+
private _checkSharedNames;
|
|
99
177
|
render(): import("lit-html").TemplateResult<1>;
|
|
100
178
|
}
|
|
@@ -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-icon";
|
|
5
|
+
import "@nysds/nys-button";
|
|
2
6
|
/**
|
|
3
7
|
* `<nys-combobox>` is a form-enabled combo box combining text input with a filterable dropdown.
|
|
4
8
|
*
|
|
@@ -19,8 +23,172 @@ import { LitElement } from "lit";
|
|
|
19
23
|
* @fires nys-input - Fired on input change. Detail: `{ id, value }`.
|
|
20
24
|
* @fires nys-focus - Fired when combobox receives focus.
|
|
21
25
|
* @fires nys-blur - Fired when combobox loses focus.
|
|
26
|
+
*
|
|
27
|
+
*
|
|
28
|
+
* @example Basic
|
|
29
|
+
* ```html
|
|
30
|
+
* <nys-combobox label="Select your favorite fruit">
|
|
31
|
+
* <option value="apple">Apple</option>
|
|
32
|
+
* <option value="banana">Banana</option>
|
|
33
|
+
* <option value="cherry">Cherry</option>
|
|
34
|
+
* <option value="date">Date</option>
|
|
35
|
+
* <option value="elderberry">Elderberry</option>
|
|
36
|
+
* <option value="fig">Fig</option>
|
|
37
|
+
* <option value="grape">Grape</option>
|
|
38
|
+
* <option value="honeydew">Honeydew</option>
|
|
39
|
+
* <option value="kiwi">Kiwi</option>
|
|
40
|
+
* <option value="lemon">Lemon</option>
|
|
41
|
+
* <option value="mango">Mango</option>
|
|
42
|
+
* <option value="nectarine">Nectarine</option>
|
|
43
|
+
* <option value="orange">Orange</option>
|
|
44
|
+
* <option value="papaya">Papaya</option>
|
|
45
|
+
* <option value="quince">Quince</option>
|
|
46
|
+
* <option value="raspberry">Raspberry</option>
|
|
47
|
+
* <option value="strawberry">Strawberry</option>
|
|
48
|
+
* <option value="tangerine">Tangerine</option>
|
|
49
|
+
* <option value="watermelon">Watermelon</option>
|
|
50
|
+
* </nys-combobox>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @example Default Value
|
|
54
|
+
* ```html
|
|
55
|
+
* <nys-combobox label="Select your favorite fruit" value="mango">
|
|
56
|
+
* <option value="apple">Apple</option>
|
|
57
|
+
* <option value="banana">Banana</option>
|
|
58
|
+
* <option value="mango" selected>Mango</option>
|
|
59
|
+
* <option value="orange">Orange</option>
|
|
60
|
+
* <option value="strawberry">Strawberry</option>
|
|
61
|
+
* </nys-combobox>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Option Group
|
|
65
|
+
* ```html
|
|
66
|
+
* <nys-combobox label="Select a fruit" description="Fruits organized by category">
|
|
67
|
+
* <optgroup label="Citrus">
|
|
68
|
+
* <option value="lemon">Lemon</option>
|
|
69
|
+
* <option value="lime">Lime</option>
|
|
70
|
+
* <option value="orange">Orange</option>
|
|
71
|
+
* <option value="grapefruit">Grapefruit</option>
|
|
72
|
+
* <option value="tangerine">Tangerine</option>
|
|
73
|
+
* </optgroup>
|
|
74
|
+
* <optgroup label="Berries">
|
|
75
|
+
* <option value="strawberry">Strawberry</option>
|
|
76
|
+
* <option value="blueberry">Blueberry</option>
|
|
77
|
+
* <option value="raspberry">Raspberry</option>
|
|
78
|
+
* <option value="blackberry">Blackberry</option>
|
|
79
|
+
* <option value="cranberry">Cranberry</option>
|
|
80
|
+
* </optgroup>
|
|
81
|
+
* <optgroup label="Tropical">
|
|
82
|
+
* <option value="mango">Mango</option>
|
|
83
|
+
* <option value="pineapple">Pineapple</option>
|
|
84
|
+
* <option value="papaya">Papaya</option>
|
|
85
|
+
* <option value="coconut">Coconut</option>
|
|
86
|
+
* <option value="passionfruit">Passionfruit</option>
|
|
87
|
+
* </optgroup>
|
|
88
|
+
* <optgroup label="Stone Fruits">
|
|
89
|
+
* <option value="peach">Peach</option>
|
|
90
|
+
* <option value="plum">Plum</option>
|
|
91
|
+
* <option value="cherry">Cherry</option>
|
|
92
|
+
* <option value="apricot">Apricot</option>
|
|
93
|
+
* <option value="nectarine">Nectarine</option>
|
|
94
|
+
* </optgroup>
|
|
95
|
+
* </nys-combobox>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example Disabled
|
|
99
|
+
* ```html
|
|
100
|
+
* <nys-combobox label="Select your favorite fruit" disabled>
|
|
101
|
+
* <option value="apple">Apple</option>
|
|
102
|
+
* <option value="banana">Banana</option>
|
|
103
|
+
* <option value="orange">Orange</option>
|
|
104
|
+
* <option value="strawberry">Strawberry</option>
|
|
105
|
+
* </nys-combobox>
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @example Required
|
|
109
|
+
* ```html
|
|
110
|
+
* <nys-combobox label="Select your favorite fruit" required>
|
|
111
|
+
* <option value="apple">Apple</option>
|
|
112
|
+
* <option value="banana">Banana</option>
|
|
113
|
+
* <option value="orange">Orange</option>
|
|
114
|
+
* <option value="strawberry">Strawberry</option>
|
|
115
|
+
* </nys-combobox>
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @example Optional
|
|
119
|
+
* ```html
|
|
120
|
+
* <nys-combobox label="Select your favorite fruit" optional>
|
|
121
|
+
* <option value="apple">Apple</option>
|
|
122
|
+
* <option value="banana">Banana</option>
|
|
123
|
+
* <option value="orange">Orange</option>
|
|
124
|
+
* <option value="strawberry">Strawberry</option>
|
|
125
|
+
* </nys-combobox>
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @example Width Medium
|
|
129
|
+
* ```html
|
|
130
|
+
* <nys-combobox label="Select your favorite fruit" width="md">
|
|
131
|
+
* <option value="apple">Apple</option>
|
|
132
|
+
* <option value="banana">Banana</option>
|
|
133
|
+
* <option value="orange">Orange</option>
|
|
134
|
+
* <option value="strawberry">Strawberry</option>
|
|
135
|
+
* </nys-combobox>
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* @example Width Large
|
|
139
|
+
* ```html
|
|
140
|
+
* <nys-combobox label="Select your favorite fruit" width="lg">
|
|
141
|
+
* <option value="apple">Apple</option>
|
|
142
|
+
* <option value="banana">Banana</option>
|
|
143
|
+
* <option value="orange">Orange</option>
|
|
144
|
+
* <option value="strawberry">Strawberry</option>
|
|
145
|
+
* </nys-combobox>
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* @example Description
|
|
149
|
+
* ```html
|
|
150
|
+
* <nys-combobox label="Select your favorite fruit" description="Choose from the list of available fruits.">
|
|
151
|
+
* <option value="apple">Apple</option>
|
|
152
|
+
* <option value="banana">Banana</option>
|
|
153
|
+
* <option value="orange">Orange</option>
|
|
154
|
+
* <option value="strawberry">Strawberry</option>
|
|
155
|
+
* </nys-combobox>
|
|
156
|
+
* ```d
|
|
157
|
+
*
|
|
158
|
+
* @example Description Slot
|
|
159
|
+
* ```html
|
|
160
|
+
* <nys-combobox label="Select your favorite fruit">
|
|
161
|
+
* <label slot="description">This is a description slot</label>
|
|
162
|
+
* <option value="apple">Apple</option>
|
|
163
|
+
* <option value="banana">Banana</option>
|
|
164
|
+
* <option value="orange">Orange</option>
|
|
165
|
+
* <option value="strawberry">Strawberry</option>
|
|
166
|
+
* </nys-combobox>
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @example Error Message
|
|
170
|
+
* ```html
|
|
171
|
+
* <nys-combobox label="Select your favorite fruit" showError errorMessage="Please select a fruit">
|
|
172
|
+
* <option value="apple">Apple</option>
|
|
173
|
+
* <option value="banana">Banana</option>
|
|
174
|
+
* <option value="orange">Orange</option>
|
|
175
|
+
* <option value="strawberry">Strawberry</option>
|
|
176
|
+
* </nys-combobox>
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @example Disabled Options
|
|
180
|
+
* ```html
|
|
181
|
+
* <nys-combobox label="Select your favorite fruit" description="Some fruits are out of season">
|
|
182
|
+
* <option value="apple">Apple</option>
|
|
183
|
+
* <option value="banana">Banana</option>
|
|
184
|
+
* <option value="cherry" disabled>Cherry (Out of season)</option>
|
|
185
|
+
* <option value="mango">Mango</option>
|
|
186
|
+
* <option value="strawberry" disabled>Strawberry (Out of season)</option>
|
|
187
|
+
* <option value="orange">Orange</option>
|
|
188
|
+
* </nys-combobox>
|
|
189
|
+
* ```
|
|
22
190
|
*/
|
|
23
|
-
export declare class NysCombobox extends
|
|
191
|
+
export declare class NysCombobox extends NysFormControlElement {
|
|
24
192
|
static styles: import("lit").CSSResult;
|
|
25
193
|
static shadowRootOptions: {
|
|
26
194
|
delegatesFocus: boolean;
|
|
@@ -55,18 +223,19 @@ export declare class NysCombobox extends LitElement {
|
|
|
55
223
|
private _listbox?;
|
|
56
224
|
private _originalErrorMessage;
|
|
57
225
|
private _hasUserInteracted;
|
|
58
|
-
private _internals;
|
|
59
226
|
private _selectedLabel;
|
|
60
227
|
private _defaultValue;
|
|
228
|
+
private _hasResolvedSlottedValue;
|
|
61
229
|
/**
|
|
62
230
|
* Lifecycle methods
|
|
63
231
|
* --------------------------------------------------------------------------
|
|
232
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
233
|
+
* NysFormControlElement (@nysds/internals).
|
|
64
234
|
*/
|
|
65
|
-
static formAssociated: boolean;
|
|
66
|
-
constructor();
|
|
67
235
|
connectedCallback(): void;
|
|
68
236
|
disconnectedCallback(): void;
|
|
69
237
|
firstUpdated(): void;
|
|
238
|
+
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
70
239
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
71
240
|
/**
|
|
72
241
|
* Slot handling
|
|
@@ -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-icon";
|
|
5
|
+
import "@nysds/nys-button";
|
|
2
6
|
/**
|
|
3
7
|
* Date picker with calendar popup and form validation. Falls back to native date input
|
|
4
8
|
* on Safari and mobile.
|
|
@@ -9,12 +13,17 @@ import { LitElement } from "lit";
|
|
|
9
13
|
* @fires nys-blur - Fired when input or calendar loses focus. Triggers validation.
|
|
10
14
|
* @fires nys-input - Fired on date selection. Detail: `{id, value}`.
|
|
11
15
|
*
|
|
12
|
-
* @example Basic
|
|
16
|
+
* @example Basic
|
|
13
17
|
* ```html
|
|
14
|
-
* <nys-datepicker
|
|
18
|
+
* <nys-datepicker
|
|
19
|
+
* id="my-datepicker"
|
|
20
|
+
* name="my-datepicker"
|
|
21
|
+
* label="Schedule an appointment"
|
|
22
|
+
* description="Enter in MM/DD/YYYY format"
|
|
23
|
+
* ></nys-datepicker>
|
|
15
24
|
* ```
|
|
16
25
|
*
|
|
17
|
-
* @example
|
|
26
|
+
* @example Width Large
|
|
18
27
|
* ```html
|
|
19
28
|
* <nys-datepicker
|
|
20
29
|
* label="Event Date"
|
|
@@ -23,26 +32,77 @@ import { LitElement } from "lit";
|
|
|
23
32
|
* </nys-datepicker>
|
|
24
33
|
* ```
|
|
25
34
|
*
|
|
26
|
-
* @example
|
|
35
|
+
* @example Width Full
|
|
36
|
+
* ```html
|
|
37
|
+
* <nys-datepicker
|
|
38
|
+
* label="Event Date"
|
|
39
|
+
* description="Select the date of your event"
|
|
40
|
+
* width="full">
|
|
41
|
+
* </nys-datepicker>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example Custom Start Date
|
|
27
45
|
* ```html
|
|
28
46
|
* <nys-datepicker
|
|
29
47
|
* label="Appointment"
|
|
30
|
-
* hideTodayButton
|
|
31
|
-
* hideClearButton
|
|
32
48
|
* startDate="2024-01-01">
|
|
33
49
|
* </nys-datepicker>
|
|
34
50
|
* ```
|
|
35
51
|
*
|
|
36
|
-
* @example
|
|
52
|
+
* @example Without Buttons
|
|
53
|
+
* ```html
|
|
54
|
+
* <nys-datepicker
|
|
55
|
+
* label="Appointment"
|
|
56
|
+
* hideTodayButton
|
|
57
|
+
* hideClearButton>
|
|
58
|
+
* </nys-datepicker>
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @example Error Message
|
|
37
62
|
* ```html
|
|
38
63
|
* <nys-datepicker
|
|
39
64
|
* label="Start Date"
|
|
40
|
-
*
|
|
65
|
+
* showError
|
|
41
66
|
* errorMessage="Please select a valid start date">
|
|
42
67
|
* </nys-datepicker>
|
|
43
68
|
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example Date Range
|
|
71
|
+
* ```html
|
|
72
|
+
* <nys-datepicker
|
|
73
|
+
* label="Select a date"
|
|
74
|
+
* description="Only dates within April 4/5/2026 - 7/15/2026 are selectable"
|
|
75
|
+
* minDate="2026-04-05"
|
|
76
|
+
* maxDate="2026-07-15">
|
|
77
|
+
* </nys-datepicker>
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @example Disabled
|
|
81
|
+
* ```html
|
|
82
|
+
* <nys-datepicker
|
|
83
|
+
* label="Disabled datepicker"
|
|
84
|
+
* disabled
|
|
85
|
+
* value="2025-01-15">
|
|
86
|
+
* </nys-datepicker>
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @example Required
|
|
90
|
+
* ```html
|
|
91
|
+
* <nys-datepicker
|
|
92
|
+
* label="Start Date"
|
|
93
|
+
* required>
|
|
94
|
+
* </nys-datepicker>
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @example Optional
|
|
98
|
+
* ```html
|
|
99
|
+
* <nys-datepicker
|
|
100
|
+
* label="Start Date"
|
|
101
|
+
* optional>
|
|
102
|
+
* </nys-datepicker>
|
|
103
|
+
* ```
|
|
44
104
|
*/
|
|
45
|
-
export declare class NysDatepicker extends
|
|
105
|
+
export declare class NysDatepicker extends NysFormControlElement {
|
|
46
106
|
static styles: import("lit").CSSResult;
|
|
47
107
|
static shadowRootOptions: {
|
|
48
108
|
delegatesFocus: boolean;
|
|
@@ -96,14 +156,14 @@ export declare class NysDatepicker extends LitElement {
|
|
|
96
156
|
/** Selected date. Accepts Date object or ISO string (YYYY-MM-DD). */
|
|
97
157
|
value: string | Date | undefined;
|
|
98
158
|
private datepickerIsOpen;
|
|
159
|
+
private readonly DATEPICKER_GAP;
|
|
99
160
|
private _hasUserInteracted;
|
|
100
|
-
private _internals;
|
|
101
161
|
/**
|
|
102
162
|
* Lifecycle methods
|
|
103
163
|
* --------------------------------------------------------------------------
|
|
164
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
165
|
+
* NysFormControlElement (@nysds/internals).
|
|
104
166
|
*/
|
|
105
|
-
static formAssociated: boolean;
|
|
106
|
-
constructor();
|
|
107
167
|
connectedCallback(): void;
|
|
108
168
|
disconnectedCallback(): void;
|
|
109
169
|
firstUpdated(): Promise<void>;
|
|
@@ -185,5 +245,15 @@ export declare class NysDatepicker extends LitElement {
|
|
|
185
245
|
*/
|
|
186
246
|
private _isMobile;
|
|
187
247
|
private _shouldUseNativeDatepicker;
|
|
248
|
+
/**
|
|
249
|
+
* Auto-Positioning
|
|
250
|
+
* --------------------------------------------------------------------------
|
|
251
|
+
* Opens the calendar below the input by default. If there isn't enough
|
|
252
|
+
* room below (and there's more room above), it opens above instead.
|
|
253
|
+
*/
|
|
254
|
+
private _positionDatepicker;
|
|
255
|
+
private _handleScrollReposition;
|
|
256
|
+
private _startDatepickerPositioning;
|
|
257
|
+
private _stopDatepickerPositioning;
|
|
188
258
|
render(): import("lit-html").TemplateResult<1>;
|
|
189
259
|
}
|
|
@@ -1,31 +1,55 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysReflectsAriaElement } from "@nysds/internals";
|
|
2
2
|
/**
|
|
3
|
-
* A horizontal rule for visual separation between content sections.
|
|
3
|
+
* A horizontal rule for visual separation between content sections. The host
|
|
4
|
+
* element carries `role="separator"` via ElementInternals.
|
|
4
5
|
*
|
|
5
6
|
* Use to separate distinct content areas within a page. Set `inverted` for use on dark backgrounds.
|
|
6
7
|
*
|
|
7
8
|
* @summary Horizontal divider for visual separation of content sections.
|
|
8
9
|
* @element nys-divider
|
|
9
10
|
*
|
|
10
|
-
* @example Basic
|
|
11
|
+
* @example Basic
|
|
11
12
|
* ```html
|
|
12
13
|
* <p>Section one content</p>
|
|
13
14
|
* <nys-divider></nys-divider>
|
|
14
15
|
* <p>Section two content</p>
|
|
15
16
|
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example Inverted
|
|
19
|
+
* ```html
|
|
20
|
+
* <p>Section one content</p>
|
|
21
|
+
* <nys-divider inverted></nys-divider>
|
|
22
|
+
* <p>Section two content</p>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @render Inverted
|
|
26
|
+
* ```html
|
|
27
|
+
* <div style="display: flex; flex-direction: column; background-color: var(--nys-color-ink, #1b1b1b); color: var(--nys-color-ink-reverse, #fff); padding: var(--nys-space-200, 16px);">
|
|
28
|
+
* <p>Section one content</p>
|
|
29
|
+
* <nys-divider inverted></nys-divider>
|
|
30
|
+
* <p>Section two content</p>
|
|
31
|
+
* </div>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example Subtle
|
|
35
|
+
* ```html
|
|
36
|
+
* <p>Section one content</p>
|
|
37
|
+
* <nys-divider subtle></nys-divider>
|
|
38
|
+
* <p>Section two content</p>
|
|
39
|
+
* ```
|
|
16
40
|
*/
|
|
17
|
-
export declare class NysDivider extends
|
|
41
|
+
export declare class NysDivider extends NysReflectsAriaElement {
|
|
18
42
|
static styles: import("lit").CSSResult;
|
|
19
43
|
/** Adjusts colors for dark backgrounds. */
|
|
20
44
|
inverted: boolean;
|
|
21
45
|
/** If true, the divider will use a lighter color. */
|
|
22
46
|
subtle: boolean;
|
|
23
|
-
constructor();
|
|
24
|
-
connectedCallback(): void;
|
|
25
47
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
48
|
+
* The host element IS the separator, so reflect role="separator" onto the host
|
|
49
|
+
* via internals. A horizontal separator's implicit aria-orientation is
|
|
50
|
+
* "horizontal", which matches this component, so no explicit orientation is set.
|
|
28
51
|
*/
|
|
29
|
-
|
|
52
|
+
protected get defaultRole(): string | null;
|
|
53
|
+
connectedCallback(): void;
|
|
30
54
|
render(): import("lit-html").TemplateResult<1>;
|
|
31
55
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
2
|
import "./nys-dropdownmenuitem";
|
|
3
|
+
type Position = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
3
4
|
/**
|
|
4
5
|
* Dropdown menus enable users to select an action from a list of options.
|
|
5
6
|
* They’re commonly used to save space by grouping related actions, or to provide actions in a confined space.
|
|
@@ -7,31 +8,39 @@ import "./nys-dropdownmenuitem";
|
|
|
7
8
|
* @summary Action menu with auto-positioning, keyboard support, and screen reader integration.
|
|
8
9
|
* @element nys-dropdownmenu
|
|
9
10
|
*
|
|
10
|
-
* @example Basic
|
|
11
|
+
* @example Basic
|
|
11
12
|
* ```html
|
|
12
|
-
* <button id="my-trigger"
|
|
13
|
-
* <nys-dropdownmenu for="my-trigger">
|
|
14
|
-
* <nys-dropdownmenuitem label="
|
|
15
|
-
* <nys-dropdownmenuitem label="
|
|
13
|
+
* <nys-button id="my-trigger-id" label="Open Menu"></nys-button>
|
|
14
|
+
* <nys-dropdownmenu id="my-dropdownmenu" for="my-trigger-id">
|
|
15
|
+
* <nys-dropdownmenuitem label="Profile" href="/profile"></nys-dropdownmenuitem>
|
|
16
|
+
* <nys-dropdownmenuitem label="Repositories & Github Pages" href="/repos"></nys-dropdownmenuitem>
|
|
17
|
+
* <nys-dropdownmenuitem label="Organizations" href="/organizations"></nys-dropdownmenuitem>
|
|
18
|
+
* <nys-dropdownmenuitem label="Sign out" href="/logout"></nys-dropdownmenuitem>
|
|
16
19
|
* </nys-dropdownmenu>
|
|
20
|
+
* </div>
|
|
17
21
|
* ```
|
|
18
22
|
*
|
|
19
|
-
* @
|
|
23
|
+
* @render Basic
|
|
20
24
|
* ```html
|
|
21
|
-
* <
|
|
22
|
-
*
|
|
23
|
-
* <nys-
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* <div style="margin: 200px; display: flex; justify-content: center; align-items: center;">
|
|
26
|
+
* <nys-button id="my-trigger-id" label="Open Menu"></nys-button>
|
|
27
|
+
* <nys-dropdownmenu id="my-dropdownmenu" for="my-trigger-id">
|
|
28
|
+
* <nys-dropdownmenuitem label="Profile" href="/profile"></nys-dropdownmenuitem>
|
|
29
|
+
* <nys-dropdownmenuitem label="Repositories & Github Pages" href="/repos"></nys-dropdownmenuitem>
|
|
30
|
+
* <nys-dropdownmenuitem label="Organizations" href="/organizations"></nys-dropdownmenuitem>
|
|
31
|
+
* <nys-dropdownmenuitem label="Sign out" href="/logout"></nys-dropdownmenuitem>
|
|
32
|
+
* </nys-dropdownmenu>
|
|
33
|
+
* </div>
|
|
26
34
|
* ```
|
|
27
35
|
*/
|
|
28
|
-
|
|
29
|
-
export declare class NysDropdownMenu extends LitElement {
|
|
36
|
+
export declare class NysDropdownMenu extends NysElement {
|
|
30
37
|
static styles: import("lit").CSSResult;
|
|
31
38
|
for: string;
|
|
32
39
|
showDropdown: boolean;
|
|
33
40
|
/**
|
|
34
|
-
* Accessible label for the menu. Used as `aria-label`
|
|
41
|
+
* Accessible label for the menu (`role="menu"`) container. Used as `aria-label`
|
|
42
|
+
* on the `<ul role="menu">` element. When empty, falls back to "Menu" so the
|
|
43
|
+
* menu always has an accessible name for screen readers.
|
|
35
44
|
* @default ""
|
|
36
45
|
*/
|
|
37
46
|
label: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-icon";
|
|
2
3
|
/**
|
|
3
4
|
* **Slotted component.** Displays an individual dropdown item within `nys-dropdown` with label.
|
|
4
5
|
*
|
|
@@ -7,18 +8,8 @@ import { LitElement } from "lit";
|
|
|
7
8
|
*
|
|
8
9
|
* @summary Dropdown item to display label and provide href link.
|
|
9
10
|
* @element nys-dropdownmenuitem
|
|
10
|
-
*
|
|
11
|
-
* @example Basic item
|
|
12
|
-
* ```html
|
|
13
|
-
* <nys-dropdownmenuitem label="Edit" link="/edit"></nys-dropdownmenuitem>
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @example Disabled item
|
|
17
|
-
* ```html
|
|
18
|
-
* <nys-dropdownmenuitem label="Delete" link="/delete" disabled></nys-dropdownmenuitem>
|
|
19
|
-
* ```
|
|
20
11
|
*/
|
|
21
|
-
export declare class NysDropdownMenuItem extends
|
|
12
|
+
export declare class NysDropdownMenuItem extends NysElement {
|
|
22
13
|
static styles: import("lit").CSSResult;
|
|
23
14
|
static shadowRootOptions: {
|
|
24
15
|
delegatesFocus: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
|
+
import "@nysds/nys-icon";
|
|
2
3
|
/**
|
|
3
4
|
* **Internal component.** Displays error messages for form validation with icon and ARIA alert role.
|
|
4
5
|
*
|
|
@@ -7,6 +8,25 @@ import { LitElement } from "lit";
|
|
|
7
8
|
*
|
|
8
9
|
* @summary Internal error message display with icon and ARIA alert support.
|
|
9
10
|
* @element nys-errormessage
|
|
11
|
+
*
|
|
12
|
+
* @example Basic
|
|
13
|
+
* ```html
|
|
14
|
+
* <nys-errormessage showError errorMessage="This is an error message"></nys-errormessage>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Divider
|
|
18
|
+
* ```html
|
|
19
|
+
* <nys-errormessage showError errorMessage="This is an error message" showDivider></nys-errormessage>
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Association contract for form controls:
|
|
23
|
+
* Chromium never surfaces `aria-errormessage` for a control inside a shadow root —
|
|
24
|
+
* verified against Blink's AX tree by `src/scripts/verify-a11y-names.mjs`, and true for
|
|
25
|
+
* the IDREF attribute and for `ariaErrorMessageElements` reflection alike.
|
|
26
|
+
* `aria-describedby` DOES resolve there. Form controls therefore reference this element
|
|
27
|
+
* with BOTH `aria-errormessage` (for engines that honor it) and `aria-describedby` (which
|
|
28
|
+
* is what actually reaches the AX tree today), alongside `aria-invalid` — which Blink
|
|
29
|
+
* requires before it will expose an error relation at all.
|
|
10
30
|
*/
|
|
11
31
|
export declare class NysErrorMessage extends LitElement {
|
|
12
32
|
static styles: import("lit").CSSResult;
|
|
@@ -18,10 +38,12 @@ export declare class NysErrorMessage extends LitElement {
|
|
|
18
38
|
errorMessage: string;
|
|
19
39
|
/** Shows a divider line above the error message. */
|
|
20
40
|
showDivider: boolean;
|
|
41
|
+
private _errInternals;
|
|
21
42
|
/**
|
|
22
43
|
* Lifecycle methods
|
|
23
44
|
* --------------------------------------------------------------------------
|
|
24
45
|
*/
|
|
25
46
|
constructor();
|
|
47
|
+
updated(): void;
|
|
26
48
|
render(): import("lit-html").TemplateResult<1>;
|
|
27
49
|
}
|