@nysds/components 1.19.2 → 1.19.3

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.
Files changed (65) hide show
  1. package/custom-elements.json +1184 -195
  2. package/dist/.vscode/vscode.html-custom-data.json +10 -10
  3. package/dist/custom-elements.json +1184 -195
  4. package/dist/nys-icon.library-ChLRj3i-.js +696 -0
  5. package/dist/nys-icon.library-ChLRj3i-.js.map +1 -0
  6. package/dist/nysds.es.js +1811 -1724
  7. package/dist/nysds.es.js.map +1 -1
  8. package/dist/nysds.js +750 -147
  9. package/dist/nysds.js.map +1 -1
  10. package/dist/packages/nys-accordion/src/nys-accordion.d.ts +35 -6
  11. package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +8 -3
  12. package/dist/packages/nys-alert/src/nys-alert.d.ts +81 -4
  13. package/dist/packages/nys-avatar/src/nys-avatar.d.ts +44 -4
  14. package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +70 -3
  15. package/dist/packages/nys-badge/src/nys-badge.d.ts +54 -4
  16. package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +75 -7
  17. package/dist/packages/nys-button/src/nys-button.d.ts +62 -7
  18. package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +5 -7
  19. package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +78 -1
  20. package/dist/packages/nys-combobox/src/nys-combobox.d.ts +164 -0
  21. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +64 -8
  22. package/dist/packages/nys-divider/src/nys-divider.d.ts +24 -1
  23. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +19 -12
  24. package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +0 -10
  25. package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +10 -0
  26. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +94 -4
  27. package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +50 -7
  28. package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +65 -4
  29. package/dist/packages/nys-icon/src/icon-cache.d.ts +11 -4
  30. package/dist/packages/nys-icon/src/icon-library-registry.d.ts +33 -16
  31. package/dist/packages/nys-icon/src/index.d.ts +2 -2
  32. package/dist/packages/nys-icon/src/nys-icon.d.ts +83 -6
  33. package/dist/packages/nys-label/src/nys-label.d.ts +32 -2
  34. package/dist/packages/nys-modal/src/nys-modal.d.ts +130 -5
  35. package/dist/packages/nys-pagination/src/nys-pagination.d.ts +11 -1
  36. package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +4 -3
  37. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +74 -1
  38. package/dist/packages/nys-select/src/nys-option.d.ts +0 -8
  39. package/dist/packages/nys-select/src/nys-select.d.ts +141 -10
  40. package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +2 -2
  41. package/dist/packages/nys-stepper/src/nys-step.d.ts +0 -13
  42. package/dist/packages/nys-stepper/src/nys-stepper.d.ts +119 -69
  43. package/dist/packages/nys-tab/src/nys-tab.d.ts +17 -8
  44. package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +77 -15
  45. package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +0 -17
  46. package/dist/packages/nys-table/src/nys-table.d.ts +71 -0
  47. package/dist/packages/nys-textarea/src/nys-textarea.d.ts +52 -5
  48. package/dist/packages/nys-textinput/src/nys-textinput.d.ts +63 -9
  49. package/dist/packages/nys-toggle/src/nys-toggle.d.ts +40 -4
  50. package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +38 -6
  51. package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +10 -2
  52. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +54 -8
  53. package/dist/packages/nys-video/src/nys-video.d.ts +65 -3
  54. package/package.json +11 -5
  55. package/packages/react/NysBreadcrumbs.d.ts +1 -1
  56. package/packages/react/NysButton.d.ts +2 -1
  57. package/packages/react/NysDropdownMenu.d.ts +1 -1
  58. package/packages/react/NysFileinput.d.ts +24 -2
  59. package/packages/react/NysFileinput.js +8 -1
  60. package/packages/react/NysGlobalHeader.d.ts +6 -1
  61. package/packages/react/NysLabel.d.ts +4 -1
  62. package/packages/react/NysTextarea.d.ts +1 -1
  63. package/packages/react/NysUnavHeader.d.ts +11 -1
  64. package/packages/react/NysUnavHeader.js +15 -1
  65. package/packages/react/nysds-jsx.d.ts +47 -10
@@ -12,7 +12,7 @@ import { LitElement } from "lit";
12
12
  * @slot - Default slot for `nys-radiobutton` elements.
13
13
  * @slot description - Custom HTML description content.
14
14
  *
15
- * @example Basic radio group
15
+ * @example Basic
16
16
  * ```html
17
17
  * <nys-radiogroup label="Select borough" required>
18
18
  * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
@@ -20,6 +20,79 @@ import { LitElement } from "lit";
20
20
  * <nys-radiobutton name="borough" value="manhattan" label="Manhattan"></nys-radiobutton>
21
21
  * </nys-radiogroup>
22
22
  * ```
23
+ *
24
+ * @example Tile
25
+ * ```html
26
+ * <nys-radiogroup label="Select borough" tile>
27
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
28
+ * <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
29
+ * </nys-radiogroup>
30
+ * ```
31
+ *
32
+ * @example Required
33
+ * ```html
34
+ * <nys-radiogroup label="Select borough" required>
35
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
36
+ * <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
37
+ * </nys-radiogroup>
38
+ * ```
39
+ *
40
+ * @example Optional
41
+ * ```html
42
+ * <nys-radiogroup label="Select borough" optional>
43
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
44
+ * <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
45
+ * </nys-radiogroup>
46
+ * ```
47
+ *
48
+ * @example Disabled
49
+ * ```html
50
+ * <nys-radiogroup label="Select borough">
51
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx" disabled></nys-radiobutton>
52
+ * <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn" disabled></nys-radiobutton>
53
+ * </nys-radiogroup>
54
+ * ```
55
+ *
56
+ * @example Size Small
57
+ * ```html
58
+ * <nys-radiogroup label="Select borough" size="sm">
59
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
60
+ * <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
61
+ * </nys-radiogroup>
62
+ * ```
63
+ *
64
+ * @example Other Option
65
+ * ```html
66
+ * <nys-radiogroup label="Select borough">
67
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
68
+ * <nys-radiobutton name="borough" value="" label="Other" other></nys-radiobutton>
69
+ * </nys-radiogroup>
70
+ * ```
71
+ *
72
+ * @example Error Message
73
+ * ```html
74
+ * <nys-radiogroup label="Select borough" showError errorMessage="Please select a borough">
75
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
76
+ * <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
77
+ * </nys-radiogroup>
78
+ * ```
79
+ *
80
+ * @example Description
81
+ * ```html
82
+ * <nys-radiogroup label="Select borough" description="Your primary residence in NYC.">
83
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
84
+ * <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
85
+ * </nys-radiogroup>
86
+ * ```
87
+ *
88
+ * @example Description Slot
89
+ * ```html
90
+ * <nys-radiogroup label="Select borough">
91
+ * <div slot="description">Your primary <strong>residence</strong> in NYC.</div>
92
+ * <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
93
+ * <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
94
+ * </nys-radiogroup>
95
+ * ```
23
96
  */
24
97
  export declare class NysRadiogroup extends LitElement {
25
98
  static styles: import("lit").CSSResult;
@@ -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. */
@@ -16,24 +16,155 @@ import { LitElement } from "lit";
16
16
  * @fires nys-focus - Fired when select gains focus.
17
17
  * @fires nys-blur - Fired when select loses focus. Triggers validation.
18
18
  *
19
- * @example Basic select
19
+ * @example Basic
20
20
  * ```html
21
- * <nys-select label="Select borough">
22
- * <option value="bronx">The Bronx</option>
23
- * <option value="brooklyn">Brooklyn</option>
24
- * <option value="manhattan">Manhattan</option>
21
+ * <nys-select label="Select your favorite borough" id="borough">
22
+ * <option value="bronx" label="The Bronx"></option>
23
+ * <option value="brooklyn" label="Brooklyn"></option>
24
+ * <option value="manhattan" label="Manhattan"></option>
25
+ * <option value="staten_island" label="Staten Island"></option>
26
+ * <option value="queens" label="Queens"></option>
25
27
  * </nys-select>
26
28
  * ```
27
29
  *
28
- * @example With option groups
30
+ * @example Default value
29
31
  * ```html
30
- * <nys-select label="Select service">
31
- * <optgroup label="Transportation">
32
- * <option value="mta">MTA</option>
33
- * <option value="dmv">DMV</option>
32
+ * <nys-select label="Select your favorite borough" id="borough">
33
+ * <option value="bronx" label="The Bronx"></option>
34
+ * <option value="brooklyn" label="Brooklyn" selected></option>
35
+ * <option value="manhattan" label="Manhattan"></option>
36
+ * <option value="staten_island" label="Staten Island"></option>
37
+ * <option value="queens" label="Queens"></option>
38
+ * </nys-select>
39
+ * ```
40
+ *
41
+ * @example Option Group
42
+ * ```html
43
+ * <nys-select
44
+ * label="Which New York State service are you contacting us about?"
45
+ * description="This is for demo purposes and the list might not be exhaustive."
46
+ * >
47
+ * <optgroup label="Transportation Services">
48
+ * <option value="mta">MTA / Public Transit</option>
49
+ * <option value="dmv">Department of Motor Vehicles (DMV)</option>
50
+ * <option value="highway">Highway Maintenance</option>
51
+ * </optgroup>
52
+ * <optgroup label="Health & Human Services">
53
+ * <option value="medicaid">Medicaid / Health Insurance</option>
54
+ * <option value="mental-health">Mental Health Support</option>
55
+ * <option value="child-family">Child and Family Services</option>
34
56
  * </optgroup>
57
+ * <optgroup label="Public Safety">
58
+ * <option value="state-police">State Police</option>
59
+ * <option value="emergency-management">Emergency Management</option>
60
+ * <option value="fire-safety">Fire Safety</option>
61
+ * </optgroup>
62
+ * <optgroup label="Environment & Energy">
63
+ * <option value="environmental-conservation">
64
+ * Environmental Conservation
65
+ * </option>
66
+ * <option value="clean-energy">Clean Energy Programs</option>
67
+ * <option value="waste-management">Waste Management</option>
68
+ * </optgroup>
69
+ * </nys-select>
70
+ * ```
71
+ * @example Disabled
72
+ * ```html
73
+ * <nys-select label="Select your favorite borough" id="borough" disabled>
74
+ * <option value="bronx" label="The Bronx"></option>
75
+ * <option value="brooklyn" label="Brooklyn"></option>
76
+ * <option value="manhattan" label="Manhattan"></option>
77
+ * <option value="staten_island" label="Staten Island"></option>
78
+ * <option value="queens" label="Queens"></option>
79
+ * </nys-select>
80
+ * ```
81
+ *
82
+ * @example Disabled Option
83
+ * ```html
84
+ * <nys-select label="Select your favorite borough" id="borough">
85
+ * <option value="bronx" label="The Bronx"></option>
86
+ * <option value="brooklyn" label="Brooklyn"></option>
87
+ * <option value="manhattan" label="Manhattan"></option>
88
+ * <option value="staten_island" label="Staten Island" disabled></option>
89
+ * <option value="queens" label="Queens" disabled></option>
90
+ * </nys-select>
91
+ * ```
92
+ *
93
+ * @example Required
94
+ * ```html
95
+ * <nys-select label="Select your favorite borough" id="borough" required>
96
+ * <option value="bronx" label="The Bronx"></option>
97
+ * <option value="brooklyn" label="Brooklyn"></option>
98
+ * <option value="manhattan" label="Manhattan"></option>
99
+ * <option value="staten_island" label="Staten Island"></option>
100
+ * <option value="queens" label="Queens"></option>
101
+ * </nys-select>
102
+ * ```
103
+ *
104
+ * @example Optional
105
+ * ```html
106
+ * <nys-select label="Select your favorite borough" id="borough" optional>
107
+ * <option value="bronx" label="The Bronx"></option>
108
+ * <option value="brooklyn" label="Brooklyn"></option>
109
+ * <option value="manhattan" label="Manhattan"></option>
110
+ * <option value="staten_island" label="Staten Island"></option>
111
+ * <option value="queens" label="Queens"></option>
112
+ * </nys-select>
113
+ * ```
114
+ *
115
+ * @example Width small
116
+ * ```html
117
+ * <nys-select label="Select your favorite borough" id="borough" width="sm">
118
+ * <option value="bronx" label="The Bronx"></option>
119
+ * <option value="brooklyn" label="Brooklyn"></option>
120
+ * <option value="manhattan" label="Manhattan"></option>
121
+ * <option value="staten_island" label="Staten Island"></option>
122
+ * <option value="queens" label="Queens"></option>
123
+ * </nys-select>
124
+ * ```
125
+ *
126
+ * @example Width medium
127
+ * ```html
128
+ * <nys-select label="Select your favorite borough" id="borough" width="md">
129
+ * <option value="bronx" label="The Bronx"></option>
130
+ * <option value="brooklyn" label="Brooklyn"></option>
131
+ * <option value="manhattan" label="Manhattan"></option>
132
+ * <option value="staten_island" label="Staten Island"></option>
133
+ * <option value="queens" label="Queens"></option>
35
134
  * </nys-select>
36
135
  * ```
136
+ *
137
+ * @example Width large
138
+ * ```html
139
+ * <nys-select label="Select your favorite borough" id="borough" width="lg">
140
+ * <option value="bronx" label="The Bronx"></option>
141
+ * <option value="brooklyn" label="Brooklyn"></option>
142
+ * <option value="manhattan" label="Manhattan"></option>
143
+ * <option value="staten_island" label="Staten Island"></option>
144
+ * <option value="queens" label="Queens"></option>
145
+ * </nys-select>
146
+ * ```
147
+ *
148
+ * @example Slotted Description
149
+ * ```html
150
+ * <nys-select label="Select your favorite borough" id="borough">
151
+ * <label slot="description">This is a slotted description</label>
152
+ * <option value="bronx" label="The Bronx"></option>
153
+ * <option value="brooklyn" label="Brooklyn"></option>
154
+ * <option value="manhattan" label="Manhattan"></option>
155
+ * <option value="staten_island" label="Staten Island"></option>
156
+ * <option value="queens" label="Queens"></option>
157
+ * </nys-select>
158
+ * ```
159
+ *
160
+ * @example Error Message
161
+ * <nys-select label="Select your favorite borough" id="borough" errorMessage="You did not select a borough" showError>
162
+ * <option value="bronx" label="The Bronx"></option>
163
+ * <option value="brooklyn" label="Brooklyn"></option>
164
+ * <option value="manhattan" label="Manhattan"></option>
165
+ * <option value="staten_island" label="Staten Island"></option>
166
+ * <option value="queens" label="Queens"></option>
167
+ * </nys-select>
37
168
  */
38
169
  export declare class NysSelect extends LitElement {
39
170
  static styles: import("lit").CSSResult;
@@ -8,15 +8,15 @@ 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 Default skip link
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
22
  export declare class NysSkipnav extends LitElement {
@@ -74,19 +74,6 @@ import { LitElement } from "lit";
74
74
  * @fires nys-step-click - Fired when a navigable (`previous` or `current`) non-selected step is clicked
75
75
  * or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call
76
76
  * `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
77
  */
91
78
  export declare class NysStep extends LitElement {
92
79
  static styles: import("lit").CSSResult;
@@ -48,87 +48,137 @@ import "./nys-step";
48
48
  * @slot - Default slot for `nys-step` elements. Only `nys-step` children are accepted; others are removed.
49
49
  * @slot actions - Persistent navigation buttons. Must contain exactly one `<div>` wrapping only `<nys-button>` elements.
50
50
  *
51
- * @example Basic stepper
51
+ * @example Basic
52
52
  * ```html
53
- * <nys-stepper label="Application Progress">
54
- * <nys-step label="Personal Info" current></nys-step>
55
- * <nys-step label="Contact Details"></nys-step>
56
- * <nys-step label="Review"></nys-step>
57
- * </nys-stepper>
53
+ * <div class="nys-grid-row">
54
+ * <nys-stepper
55
+ * id="stepper"
56
+ * name="stepper"
57
+ * label="Register for Design System Office Hours"
58
+ * class="nys-desktop:nys-grid-col-3"
59
+ * >
60
+ * <nys-step label="Personal Details" href="/nys-stepper/personal.html"></nys-step>
61
+ * <nys-step label="Team Info" selected href="/nys-stepper/team.html"></nys-step>
62
+ * <nys-step label="Usage Survey" current href="/nys-stepper/survey.html"></nys-step>
63
+ * <nys-step label="Newsletter Opt-In" href="/nys-stepper/newsletter.html"></nys-step>
64
+ * <div slot="actions">
65
+ * <nys-button variant="outline" label="Save & Exit" fullWidth></nys-button>
66
+ * </div>
67
+ * </nys-stepper>
68
+ * <div class="nys-desktop:nys-grid-col-9" id="nys-stepper-content">
69
+ * Loading...
70
+ * </div>
71
+ * </div>
58
72
  * ```
59
- *
60
- * @example Grid layout with sidebar placement
61
- * Use NYSDS grid utilities to position the stepper as a sidebar alongside form content.
62
- * **Layout requirements:**
63
- * - Wrap in `nys-grid-container` > `nys-grid-row`
64
- * - Use mobile-first classes: `nys-grid-col-12` (stacks on mobile) plus `nys-desktop:nys-grid-col-*`
65
- * - Columns must total 12 (e.g., 3+9 or 4+8)
66
- * - Recommended: stepper 3-4 cols, content 8-9 cols
73
+ * @render Basic
67
74
  * ```html
68
- * <div class="nys-grid-container">
69
- * <div class="nys-grid-row">
70
- * <nys-stepper label="Application" class="nys-grid-col-12 nys-desktop:nys-grid-col-3">
71
- * <nys-step label="Personal Info"></nys-step>
72
- * <nys-step label="Contact" current></nys-step>
73
- * <nys-step label="Review"></nys-step>
74
- * </nys-stepper>
75
- * <main class="nys-grid-col-12 nys-desktop:nys-grid-col-9" id="main-content">
76
- * <!-- Form content for current step -->
77
- * <nys-textinput label="Email" required></nys-textinput>
78
- * <nys-textinput label="Phone"></nys-textinput>
79
- * </main>
75
+ * <div class="nys-grid-row">
76
+ * <nys-stepper
77
+ * id="stepper"
78
+ * name="stepper"
79
+ * label="Register for Design System Office Hours"
80
+ * class="nys-desktop:nys-grid-col-3"
81
+ * >
82
+ * <nys-step label="Personal Details" href="/nys-stepper/personal.html"></nys-step>
83
+ * <nys-step label="Team Info" selected href="/nys-stepper/team.html"></nys-step>
84
+ * <nys-step label="Usage Survey" current href="/nys-stepper/survey.html"></nys-step>
85
+ * <nys-step label="Newsletter Opt-In" href="/nys-stepper/newsletter.html"></nys-step>
86
+ * </nys-stepper>
87
+ * <div class="nys-desktop:nys-grid-col-9" id="nys-stepper-content">
88
+ * Loading...
80
89
  * </div>
81
90
  * </div>
91
+ * <script>
92
+ * document.addEventListener("DOMContentLoaded", async () => {
93
+ * const stepper = document.querySelector("nys-stepper");
94
+ * if (stepper?.updateComplete) await stepper.updateComplete;
95
+ * const selectedStep = document.querySelector("nys-step[selected]");
96
+ * const href = selectedStep?.getAttribute("href");
97
+ * if (!href) return;
98
+ * const res = await fetch(href);
99
+ * if (!res.ok) return;
100
+ * const container = document.querySelector("#nys-stepper-content");
101
+ * if (container) container.innerHTML = await res.text();
102
+ * });
103
+ *
104
+ * document.addEventListener("nys-step-click", async (e) => {
105
+ * const href = e.detail?.href;
106
+ * if (!href) return;
107
+ * e.preventDefault();
108
+ * const res = await fetch(href);
109
+ * if (!res.ok) return;
110
+ * const container = document.querySelector("#nys-stepper-content");
111
+ * if (container) container.innerHTML = await res.text();
112
+ * });
113
+ * </script>
82
114
  * ```
83
115
  *
84
- * @example Navigation buttons in actions slot
85
- * Add Previous/Next buttons using the actions slot. Wrap buttons in a `<div>`.
116
+ * @example Actions slot
86
117
  * ```html
87
- * <nys-stepper label="Application">
88
- * <nys-step label="Step 1"></nys-step>
89
- * <nys-step label="Step 2" current></nys-step>
90
- * <nys-step label="Step 3"></nys-step>
91
- * <div slot="actions">
92
- * <nys-button label="Save and Exit" variant="outline" size="sm" fullWidth></nys-button>
118
+ * <div class="nys-grid-row">
119
+ * <nys-stepper
120
+ * id="stepper"
121
+ * name="stepper"
122
+ * label="Register for Design System Office Hours"
123
+ * class="nys-desktop:nys-grid-col-3"
124
+ * >
125
+ * <nys-step label="Personal Details" href="/nys-stepper/personal.html"></nys-step>
126
+ * <nys-step label="Team Info" selected href="/nys-stepper/team.html"></nys-step>
127
+ * <nys-step label="Usage Survey" current href="/nys-stepper/survey.html"></nys-step>
128
+ * <nys-step label="Newsletter Opt-In" href="/nys-stepper/newsletter.html"></nys-step>
129
+ * <div slot="actions">
130
+ * <nys-button variant="outline" label="Save & Exit" fullWidth></nys-button>
131
+ * </div>
132
+ * </nys-stepper>
133
+ * <div class="nys-desktop:nys-grid-col-9" id="nys-stepper-content">
134
+ * Loading...
93
135
  * </div>
94
- * </nys-stepper>
136
+ * </div>
95
137
  * ```
96
- *
97
- * @example SPA / programmatic navigation
98
- * Two state variables drive the stepper in any framework or vanilla JS:
99
- * - `currentStep` (progress boundary) → set `current` on the matching step
100
- * - `viewingStep` (displayed content) → set `selected` on the matching step
101
- *
102
- * Always set both explicitly. Always call `e.preventDefault()` in the
103
- * `nys-step-click` listener to suppress href navigation. Do NOT nest inside a
104
- * `<form>` element.
105
- * ```js
106
- * let currentStep = 0; // furthest reached
107
- * let viewingStep = 0; // currently displayed
108
- *
109
- * function updateStepper(steps) {
110
- * steps.forEach((step, i) => {
111
- * step.toggleAttribute('current', i === currentStep);
112
- * step.toggleAttribute('selected', i === viewingStep);
138
+ * @render Actions slot
139
+ * ```html
140
+ * <div class="nys-grid-row">
141
+ * <nys-stepper
142
+ * id="stepper"
143
+ * name="stepper"
144
+ * label="Register for Design System Office Hours"
145
+ * class="nys-desktop:nys-grid-col-3"
146
+ * >
147
+ * <nys-step label="Personal Details" href="/nys-stepper/personal.html"></nys-step>
148
+ * <nys-step label="Team Info" selected href="/nys-stepper/team.html"></nys-step>
149
+ * <nys-step label="Usage Survey" current href="/nys-stepper/survey.html"></nys-step>
150
+ * <nys-step label="Newsletter Opt-In" href="/nys-stepper/newsletter.html"></nys-step>
151
+ * <div slot="actions">
152
+ * <nys-button variant="outline" label="Save & Exit" fullWidth></nys-button>
153
+ * </div>
154
+ * </nys-stepper>
155
+ * <div class="nys-desktop:nys-grid-col-9" id="nys-stepper-content">
156
+ * Loading...
157
+ * </div>
158
+ * </div>
159
+ * <script>
160
+ * document.addEventListener("DOMContentLoaded", async () => {
161
+ * const stepper = document.querySelector("nys-stepper");
162
+ * if (stepper?.updateComplete) await stepper.updateComplete;
163
+ * const selectedStep = document.querySelector("nys-step[selected]");
164
+ * const href = selectedStep?.getAttribute("href");
165
+ * if (!href) return;
166
+ * const res = await fetch(href);
167
+ * if (!res.ok) return;
168
+ * const container = document.querySelector("#nys-stepper-content");
169
+ * if (container) container.innerHTML = await res.text();
113
170
  * });
114
- * }
115
- *
116
- * document.querySelector('nys-stepper').addEventListener('nys-step-click', (e) => {
117
- * e.preventDefault();
118
- * const steps = Array.from(document.querySelectorAll('nys-step'));
119
- * const clicked = e.composedPath().find(el => el.tagName?.toLowerCase() === 'nys-step');
120
- * const index = steps.indexOf(clicked);
121
- * if (index !== -1) { viewingStep = index; updateStepper(steps); }
122
- * });
123
171
  *
124
- * // Advance to next step (call on form submit / "Continue" click)
125
- * function advance(steps) {
126
- * if (currentStep < steps.length - 1) {
127
- * currentStep++;
128
- * viewingStep = currentStep;
129
- * updateStepper(steps);
130
- * }
131
- * }
172
+ * document.addEventListener("nys-step-click", async (e) => {
173
+ * const href = e.detail?.href;
174
+ * if (!href) return;
175
+ * e.preventDefault();
176
+ * const res = await fetch(href);
177
+ * if (!res.ok) return;
178
+ * const container = document.querySelector("#nys-stepper-content");
179
+ * if (container) container.innerHTML = await res.text();
180
+ * });
181
+ * </script>
132
182
  * ```
133
183
  */
134
184
  export declare class NysStepper extends LitElement {
@@ -20,16 +20,25 @@ import { LitElement } from "lit";
20
20
  *
21
21
  * @slot - No slots; content is derived from the `label` property.
22
22
  *
23
- * @example `<nys-tab>` and `<nys-tabpanel>` should always be wrapped by `<nys-tabgroup>`
23
+ * @example Disabled
24
24
  * ```html
25
- * <!-- Always place <nys-tab> elements inside a <nys-tabgroup>. -->
26
- * <nys-tabgroup name="My Tabs">
27
- * <nys-tab label="Overview"></nys-tab>
25
+ * <nys-tabgroup name="Account Settings">
26
+ * <nys-tab label="Profile"></nys-tab>
27
+ * <nys-tab label="Security"></nys-tab>
28
+ * <nys-tab label="Notifications" disabled></nys-tab>
29
+ * <nys-tabpanel><p>Manage your profile information.</p></nys-tabpanel>
30
+ * <nys-tabpanel><p>Update your password and 2FA settings.</p></nys-tabpanel>
31
+ * <nys-tabpanel><p>Notification preferences (coming soon).</p></nys-tabpanel>
32
+ * </nys-tabgroup>
33
+ * ```
34
+ *
35
+ * @example Preselected
36
+ * ```html
37
+ * <nys-tabgroup name="Reports">
38
+ * <nys-tab label="Summary"></nys-tab>
28
39
  * <nys-tab label="Details" selected></nys-tab>
29
- * <nys-tab label="Archived" disabled></nys-tab>
30
- * <nys-tabpanel><p>Overview content</p></nys-tabpanel>
31
- * <nys-tabpanel><p>Details content (shown by default)</p></nys-tabpanel>
32
- * <nys-tabpanel><p>Archived content</p></nys-tabpanel>
40
+ * <nys-tabpanel><p>Summary view</p></nys-tabpanel>
41
+ * <nys-tabpanel><p>Detailed view (shown by default)</p></nys-tabpanel>
33
42
  * </nys-tabgroup>
34
43
  * ```
35
44
  */