@nysds/components 1.19.3-alpha-1 → 1.19.4

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 (68) hide show
  1. package/custom-elements.json +1243 -203
  2. package/dist/.vscode/vscode.html-custom-data.json +13 -13
  3. package/dist/custom-elements.json +1243 -203
  4. package/dist/nys-icon.library-r6nNUTzA.js +696 -0
  5. package/dist/nys-icon.library-r6nNUTzA.js.map +1 -0
  6. package/dist/nysds.es.js +2746 -2617
  7. package/dist/nysds.es.js.map +1 -1
  8. package/dist/nysds.js +757 -155
  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 +75 -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 +170 -35
  45. package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +13 -22
  46. package/dist/packages/nys-table/src/nys-table.d.ts +80 -1
  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/NysTabgroup.d.ts +5 -4
  63. package/packages/react/NysTable.d.ts +1 -1
  64. package/packages/react/NysTabpanel.d.ts +11 -4
  65. package/packages/react/NysTextarea.d.ts +1 -1
  66. package/packages/react/NysUnavHeader.d.ts +11 -1
  67. package/packages/react/NysUnavHeader.js +15 -1
  68. package/packages/react/nysds-jsx.d.ts +64 -19
@@ -4,9 +4,10 @@ import { LitElement } from "lit";
4
4
  * elements.
5
5
  *
6
6
  * Accepts tabs and panels as flat light-DOM children in any order (interleaved
7
- * or grouped). On slot change, children are sorted into dedicated shadow-DOM
8
- * containers, ARIA relationships are wired, and the first selected (or first)
9
- * tab is activated.
7
+ * or grouped). On slot change, each child is assigned `slot="tab"` or
8
+ * `slot="panel"` so it is projected into the correct shadow-DOM container
9
+ * while remaining in the light DOM, ARIA relationships are wired, and the
10
+ * first selected (or first) tab is activated.
10
11
  *
11
12
  * Scroll shadows are rendered on either side of the tab list and toggled via
12
13
  * `ResizeObserver` and a `scroll` listener so they accurately reflect whether
@@ -19,29 +20,133 @@ import { LitElement } from "lit";
19
20
  *
20
21
  * @element nys-tabgroup
21
22
  *
22
- * @slot - Accepts `<nys-tab>` and `<nys-tabpanel>` children. Elements are
23
- * moved into internal shadow-DOM containers on `slotchange`; the slot
24
- * itself is not rendered visibly.
23
+ * @slot - Accepts `<nys-tab>` and `<nys-tabpanel>` children. On `slotchange`
24
+ * they are assigned `slot="tab"` / `slot="panel"` and projected into the
25
+ * tablist and panel containers; they stay in the light DOM. Any other
26
+ * children remain in the default slot, rendered below the panels.
25
27
  *
26
- * @example Disable a tab using the `disabled` attribute on `<nys-tab>`.
28
+ * @example Basic
27
29
  * ```html
28
- * <nys-tabgroup name="Account Settings">
29
- * <nys-tab label="Profile"></nys-tab>
30
- * <nys-tab label="Security"></nys-tab>
31
- * <nys-tab label="Notifications" disabled></nys-tab>
32
- * <nys-tabpanel><p>Manage your profile information.</p></nys-tabpanel>
33
- * <nys-tabpanel><p>Update your password and 2FA settings.</p></nys-tabpanel>
34
- * <nys-tabpanel><p>Notification preferences (coming soon).</p></nys-tabpanel>
30
+ * <nys-tabgroup>
31
+ * <nys-tab label="Marcy"></nys-tab>
32
+ * <nys-tab label="Algonquin"></nys-tab>
33
+ * <nys-tab label="Haystack"></nys-tab>
34
+ * // rest of tabs
35
+ * <nys-tabpanel
36
+ * >Mount Marcy is the tallest peak in the Adirondacks. It has an elevation
37
+ * of 5344 feet with 3166 feet of elevation gain. The roundtrip hike to the
38
+ * top is 14.8 miles and is an out-and-back route.
39
+ * </nys-tabpanel>
40
+ * <nys-tabpanel
41
+ * >Algonquin Peak is the 2nd tallest peak in the Adirondacks. It has an
42
+ * elevation of 5114 feet with 3050 feet of elevation gain. The roundtrip
43
+ * hike to the top is 7.8 miles and is an out-and-back route.</nys-tabpanel
44
+ * >
45
+ * <nys-tabpanel
46
+ * >Mount Haystack is the 3rd tallest peak in the Adirondacks. It has an
47
+ * elevation of 4960 feet with 4000 feet of elevation gain. The roundtrip
48
+ * hike to the top is 16.4 miles and is an out-and-back
49
+ * route.</nys-tabpanel
50
+ * >
51
+ * // rest of tab panel content
52
+ * </nys-tabgroup>
53
+ * ```
54
+ *
55
+ * @render Basic
56
+ * ```html
57
+ * <nys-tabgroup>
58
+ * <nys-tab label="Marcy"></nys-tab>
59
+ * <nys-tab label="Algonquin"></nys-tab>
60
+ * <nys-tab label="Haystack"></nys-tab>
61
+ * <nys-tab label="Skylight" id="tab4"></nys-tab>
62
+ * <nys-tab label="Whiteface" id="tab5"></nys-tab>
63
+ * <nys-tabpanel
64
+ * >Mount Marcy is the tallest peak in the Adirondacks. It has an elevation
65
+ * of 5344 feet with 3166 feet of elevation gain. The roundtrip hike to the
66
+ * top is 14.8 miles and is an out-and-back route.
67
+ * </nys-tabpanel>
68
+ * <nys-tabpanel
69
+ * >Algonquin Peak is the 2nd tallest peak in the Adirondacks. It has an
70
+ * elevation of 5114 feet with 3050 feet of elevation gain. The roundtrip
71
+ * hike to the top is 7.8 miles and is an out-and-back route.</nys-tabpanel
72
+ * >
73
+ * <nys-tabpanel
74
+ * >Mount Haystack is the 3rd tallest peak in the Adirondacks. It has an
75
+ * elevation of 4960 feet with 4000 feet of elevation gain. The roundtrip
76
+ * hike to the top is 16.4 miles and is an out-and-back
77
+ * route.</nys-tabpanel
78
+ * >
79
+ * <nys-tabpanel
80
+ * >Mount Skylight is the 4th tallest peak in the Adirondacks. It has an
81
+ * elevation of 4926 feet with 5100 feet of elevation gain. The roundtrip
82
+ * hike to the top is 16 miles and is an out-and-back route.</nys-tabpanel
83
+ * >
84
+ * <nys-tabpanel
85
+ * >Whiteface is the 5th tallest peak in the Adirondacks. It has an
86
+ * elevation of 4867 feet with 3050 feet of elevation gain. The roundtrip
87
+ * hike to the top is 7.2 miles and is an out-and-back route.</nys-tabpanel
88
+ * >
89
+ * <p style="padding: 1rem;">
90
+ * <strong>Note:</strong> The content in the tab panels was gathered from
91
+ * <a href="https://www.lakeplacid.com/do/outdoors/summerfall/hiking"
92
+ * >lakeplacid.com</a
93
+ * >
94
+ * and may not be completely accurate. This is meant to be a demo of how
95
+ * the component works, not a hiking guide.
96
+ * </p>
97
+ * </nys-tabgroup>
98
+ * ```
99
+ *
100
+ * @example Explicit Ordering
101
+ * ```html
102
+ * <nys-tabgroup id="explicit-ordering">
103
+ * <nys-tab label="1st Tab" id="tab1"></nys-tab>
104
+ * <nys-tab label="2nd Tab" id="tab2"></nys-tab>
105
+ * <nys-tab label="3rd Tab" id="tab3"></nys-tab>
106
+ * <nys-tabpanel aria-labelledby="tab2">Content for tab 2</nys-tabpanel>
107
+ * <nys-tabpanel aria-labelledby="tab3">Content for tab 3</nys-tabpanel>
108
+ * <nys-tabpanel aria-labelledby="tab1">Content for tab 1</nys-tabpanel>
109
+ * </nys-tabgroup>
110
+ * ```
111
+ *
112
+ * @example JS in tabpanel
113
+ * ```html
114
+ * <nys-tabgroup>
115
+ * <nys-tab label="Tab 1"></nys-tab>
116
+ * <nys-tab label="Tab 2"></nys-tab>
117
+ * <nys-tabpanel>
118
+ * <p>Content for tab 1</p>
119
+ * </nys-tabpanel>
120
+ * <nys-tabpanel>
121
+ * <p>Content for tab 2</p>
122
+ * </nys-tabpanel>
35
123
  * </nys-tabgroup>
124
+ * <script>
125
+ * const tabgroup = document.querySelector("nys-tabgroup");
126
+ * const panels = tabgroup.querySelectorAll("nys-tabpanel");
127
+ * panels[0].innerHTML += "<p>Added via JS</p>";
128
+ * </script>
36
129
  * ```
37
130
  *
38
- * @example Pre-select a tab using the `selected` attribute on `<nys-tab>`.
131
+ * @example Custom Styling
39
132
  * ```html
40
- * <nys-tabgroup name="Reports">
41
- * <nys-tab label="Summary"></nys-tab>
42
- * <nys-tab label="Details" selected></nys-tab>
43
- * <nys-tabpanel><p>Summary view</p></nys-tabpanel>
44
- * <nys-tabpanel><p>Detailed view (shown by default)</p></nys-tabpanel>
133
+ * <style>
134
+ * nys-tabpanel {
135
+ * --_nys-tabpanel-background-color: var(--nys-color-theme-faint);
136
+ * border: solid 2px var(--nys-color-theme-strong);
137
+ * --nys-button-background-color: var(--nys-color-success);
138
+ * }
139
+ * </style>
140
+ * <nys-tabgroup>
141
+ * <nys-tab label="Tab 1"></nys-tab>
142
+ * <nys-tab label="Tab 2"></nys-tab>
143
+ * <nys-tabpanel>
144
+ * <p>Content for tab 1</p>
145
+ * <nys-button>Click me</nys-button>
146
+ * </nys-tabpanel>
147
+ * <nys-tabpanel>
148
+ * <p>Content for tab 2</p>
149
+ * </nys-tabpanel>
45
150
  * </nys-tabgroup>
46
151
  * ```
47
152
  */
@@ -117,19 +222,42 @@ export declare class NysTabgroup extends LitElement {
117
222
  */
118
223
  private _updateScrollShadows;
119
224
  /**
120
- * Returns all `<nys-tab>` elements currently residing in the shadow-DOM
121
- * tabs container, in DOM order.
225
+ * Returns all `<nys-tab>` light-DOM children in DOM order.
226
+ *
227
+ * Tabs are projected into the shadow-DOM tablist via the `tab` slot but
228
+ * remain light-DOM children of the group, so they stay reachable by consumer
229
+ * CSS and JavaScript.
122
230
  *
123
231
  * @returns An array of `HTMLElement` references to every `<nys-tab>` child.
124
232
  */
125
233
  private _getTabs;
126
234
  /**
127
- * Returns all `<nys-tabpanel>` elements currently residing in the
128
- * shadow-DOM panels container, in DOM order.
235
+ * Returns the `<nys-tabpanel>` light-DOM children ordered to align with
236
+ * `_getTabs()` — i.e. `panels[i]` is the panel paired with `tabs[i]`.
237
+ *
238
+ * Pairing honors explicit `aria-labelledby` references first, then falls
239
+ * back to source order for the remaining panels. See {@link _pairPanels}.
129
240
  *
130
- * @returns An array of `HTMLElement` references to every `<nys-tabpanel>` child.
241
+ * @returns An array of `HTMLElement` references to every `<nys-tabpanel>`,
242
+ * in tab-paired order.
131
243
  */
132
244
  private _getPanels;
245
+ /**
246
+ * Orders `panels` to align 1:1 with `tabs`.
247
+ *
248
+ * A panel is paired with a tab when its `aria-labelledby` matches that tab's
249
+ * `id`; explicit references win over position. Panels without a reference
250
+ * fill the remaining tab slots in source order. Any panels whose reference
251
+ * does not resolve to a tab are appended at the end.
252
+ *
253
+ * Idempotent: after `_applySelection` writes `aria-labelledby` onto every
254
+ * panel, re-running this yields the same order.
255
+ *
256
+ * @param tabs - Ordered `<nys-tab>` elements.
257
+ * @param panels - `<nys-tabpanel>` elements in source order.
258
+ * @returns The panels reordered to tab-paired order.
259
+ */
260
+ private _pairPanels;
133
261
  /**
134
262
  * Single source of truth for ARIA wiring, `tabindex`, and panel visibility.
135
263
  *
@@ -150,20 +278,27 @@ export declare class NysTabgroup extends LitElement {
150
278
  */
151
279
  private _applySelection;
152
280
  /**
153
- * Handles `slotchange` on the default slot.
281
+ * Handles `slotchange` and keeps the tabs/panels wired without ever removing
282
+ * them from the light DOM.
283
+ *
284
+ * Consumers author `<nys-tab>` / `<nys-tabpanel>` as flat children with no
285
+ * `slot` attribute. This assigns `slot="tab"` / `slot="panel"` so each is
286
+ * projected into the correct shadow-DOM container while remaining a
287
+ * light-DOM child of the group (reachable by consumer CSS/JS). Any other
288
+ * children (e.g. a footnote `<p>`) are left untouched in the default slot.
289
+ *
290
+ * Reads all current light-DOM children on every call (rather than a single
291
+ * slot's assigned nodes), so it is robust to dynamic additions/removals and
292
+ * idempotent: setting the `slot` attributes triggers further `slotchange`
293
+ * events, but once the attributes are stable no more mutations occur and the
294
+ * cascade settles.
154
295
  *
155
- * Iterates over all assigned elements and moves each `<nys-tab>` into
156
- * `.nys-tabgroup__tabs` and each `<nys-tabpanel>` into
157
- * `.nys-tabgroup__panels`. If a panel has an `aria-labelledby` attribute,
158
- * it is explicitly paired with the tab it references; otherwise panels are
159
- * paired with tabs by index order. After sorting, calls `_applySelection`
160
- * using the first element that already has a `selected` attribute, or
161
- * index `0` if none is found.
296
+ * After (re)assignment, `_applySelection` is called honoring the first tab
297
+ * that already has a `selected` attribute, or index `0` if none is found.
162
298
  *
163
- * @param e - The `Event` fired by the `<slot>` element on slot change.
164
299
  * @returns void
165
300
  */
166
- private _sortChildren;
301
+ private _syncChildren;
167
302
  /**
168
303
  * Handles the `nys-tab-select` custom event bubbled up from a child
169
304
  * `<nys-tab>`.
@@ -4,31 +4,22 @@ import { LitElement } from "lit";
4
4
  * `<nys-tabgroup>`.
5
5
  *
6
6
  * Pairing is determined by render order: the Nth `<nys-tabpanel>` child of a
7
- * `<nys-tabgroup>` corresponds to the Nth `<nys-tab>` child.
8
- * `aria-labelledby` and the `hidden` attribute are managed externally by
9
- * `<nys-tabgroup>` via `_applySelection`; do not set them directly.
7
+ * `<nys-tabgroup>` corresponds to the Nth `<nys-tab>` child (or by explicit
8
+ * `aria-labelledby`). `aria-labelledby` and the `hidden` attribute are managed
9
+ * externally by `<nys-tabgroup>` via `_applySelection`; do not set them
10
+ * directly.
10
11
  *
11
- * @element nys-tabpanel
12
+ * The panel container is styled from the light DOM (`nys-tabpanel.light.scss`,
13
+ * adopted on the document) rather than a shadow-DOM wrapper. This keeps the
14
+ * slotted panel content in the light DOM — reachable by consumer CSS and
15
+ * JavaScript — and lets consumers override the panel's own styling (e.g.
16
+ * `nys-tabpanel { padding: 0 }`), which a shadow wrapper would prevent.
12
17
  *
13
- * @slot - Default slot for panel content. Rendered inside a wrapper `<div>`
14
- * with the `.nys-tabpanel` class for styling.
18
+ * @element nys-tabpanel
15
19
  *
16
- * @example Panel content is wrapped by `<nys-tabpanel>`.
17
- * ```html
18
- * <!-- Panels are paired by position with <nys-tab> elements in the same <nys-tabgroup>. -->
19
- * <nys-tabgroup name="Steps">
20
- * <nys-tab label="Step 1"></nys-tab>
21
- * <nys-tab label="Step 2"></nys-tab>
22
- * <nys-tabpanel>
23
- * <h2>Step 1: Enter your information</h2>
24
- * <p>Fill out the form below.</p>
25
- * </nys-tabpanel>
26
- * <nys-tabpanel>
27
- * <h2>Step 2: Review and submit</h2>
28
- * <p>Confirm your details before submitting.</p>
29
- * </nys-tabpanel>
30
- * </nys-tabgroup>
31
- * ```
20
+ * @slot - Default slot for panel content. Rendered directly under the host,
21
+ * which is the scrollable, focusable (`tabindex="0"`) `role="tabpanel"`
22
+ * region.
32
23
  */
33
24
  export declare class NysTabpanel extends LitElement {
34
25
  static styles: import("lit").CSSResult;
@@ -3,13 +3,88 @@ import { LitElement } from "lit";
3
3
  * `<nys-table>` is a responsive table component that can display native HTML tables,
4
4
  * supports striped and bordered styling, sortable columns, and CSV download.
5
5
  *
6
- * @slot - Accepts a `<table>` element. Only the first table is rendered.
6
+ * @slot - Accepts a `<table>` element. Only the first table is used. The table
7
+ * is enhanced in place and stays in the light DOM (projected through a slot,
8
+ * never cloned), so embedded components remain interactive and reachable by
9
+ * consumer CSS/JS. Its cell styling is applied from `nys-table.light.scss`,
10
+ * adopted once onto `document.adoptedStyleSheets`.
7
11
  *
8
12
  * @fires nys-click - Fired when the download button or sortable headers are clicked.
9
13
  * @fires nys-column-sort - Fired when a sortable column header is clicked. Can be prevented by calling `event.preventDefault()` to override default sort behavior.
10
14
  * Detail: { columnIndex: number, columnLabel: string, sortDirection: "asc" | "desc" | "none" }
11
15
  *
12
16
  * @method downloadFile - Triggers download of the CSV file if `download` is set.
17
+ *
18
+ * @example Basic
19
+ * ```html
20
+ * <nys-table id="table1" name="table1">
21
+ * <table>
22
+ * <caption>New York State High Peaks and Popular Hikes</caption>
23
+ * <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
24
+ * <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
25
+ * <tr><td>Algonquin</td><td>5,114</td><td>Northeast Trail</td></tr>
26
+ * <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
27
+ * <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
28
+ * <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
29
+ * </table>
30
+ * </nys-table>
31
+ * ```
32
+ *
33
+ * @example Striped
34
+ * ```html
35
+ * <nys-table id="table2" name="table2" striped>
36
+ * <table>
37
+ * <caption>New York State High Peaks and Popular Hikes</caption>
38
+ * <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
39
+ * <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
40
+ * <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
41
+ * <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
42
+ * <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
43
+ * </table>
44
+ * </nys-table>
45
+ * ```
46
+ *
47
+ * @example Bordered
48
+ * ```html
49
+ * <nys-table id="table3" name="table3" bordered>
50
+ * <table>
51
+ * <caption>New York State High Peaks and Popular Hikes</caption>
52
+ * <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
53
+ * <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
54
+ * <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
55
+ * <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
56
+ * <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
57
+ * </table>
58
+ * </nys-table>
59
+ * ```
60
+ *
61
+ * @example Sortable
62
+ * ```html
63
+ * <nys-table id="table4" name="table4" sortable>
64
+ * <table>
65
+ * <caption>New York State High Peaks and Popular Hikes</caption>
66
+ * <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
67
+ * <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
68
+ * <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
69
+ * <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
70
+ * <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
71
+ * </table>
72
+ * </nys-table>
73
+ * ```
74
+ *
75
+ * @example Downloadable
76
+ * ```html
77
+ * <nys-table id="table5" name="table5" download="path/to/downloadable/version/of/table.filetype">
78
+ * <table>
79
+ * <caption>New York State High Peaks and Popular Hikes</caption>
80
+ * <tr><th>Mountain</th><th>Peak Height (ft)</th><th>Hike Name</th></tr>
81
+ * <tr><td>Marcy</td><td>5,344</td><td>Van Hoevenberg Trail</td></tr>
82
+ * <tr><td>Haystack</td><td>4,960</td><td>Johns Brook Trail</td></tr>
83
+ * <tr><td>Skylight</td><td>4,926</td><td>Lake Tear Trail</td></tr>
84
+ * <tr><td>Whiteface</td><td>4,867</td><td>Whiteface Mountain Trail</td></tr>
85
+ * </table>
86
+ * </nys-table>
87
+ * ```
13
88
  */
14
89
  export declare class NysTable extends LitElement {
15
90
  static styles: import("lit").CSSResult;
@@ -23,6 +98,7 @@ export declare class NysTable extends LitElement {
23
98
  private _sortDirection;
24
99
  private _captionText;
25
100
  private _observer;
101
+ private _enhancing;
26
102
  /**************** Lifecycle Methods ****************/
27
103
  constructor();
28
104
  connectedCallback(): void;
@@ -30,6 +106,9 @@ export declare class NysTable extends LitElement {
30
106
  disconnectedCallback(): void;
31
107
  willUpdate(): void;
32
108
  /******************** Functions ********************/
109
+ private _getSlottedTable;
110
+ private _observeTable;
111
+ private _withObserverPaused;
33
112
  private _handleSlotChange;
34
113
  private _setupMutationObserver;
35
114
  private _normalizeTableDOM;
@@ -16,14 +16,61 @@ import { LitElement } from "lit";
16
16
  * @fires nys-blur - Fired when textarea loses focus. Triggers validation.
17
17
  * @fires nys-select - Fired when user selects text. Detail: `{id, value}`.
18
18
  *
19
- * @example Basic textarea
19
+ * @example Basic
20
20
  * ```html
21
- * <nys-textarea label="Comments" rows="4"></nys-textarea>
21
+ * <nys-textarea label="Comments"></nys-textarea>
22
22
  * ```
23
23
  *
24
- * @example Required with description
24
+ * @example Disabled
25
25
  * ```html
26
- * <nys-textarea label="Describe the incident" description="Please provide details" required></nys-textarea>
26
+ * <nys-textarea label="Comments" disabled></nys-textarea>
27
+ * ```
28
+ *
29
+ * @example Readonly
30
+ * ```html
31
+ * <nys-textarea label="Comments" readonly value="You can see me but not edit me"></nys-textarea>
32
+ * ```
33
+ *
34
+ * @example Required
35
+ * ```html
36
+ * <nys-textarea label="Describe the incident" required></nys-textarea>
37
+ * ```
38
+ *
39
+ * @example Optional
40
+ * ```html
41
+ * <nys-textarea label="Comments" optional></nys-textarea>
42
+ * ```
43
+ *
44
+ * @example Max length
45
+ * ```html
46
+ * <nys-textarea label="Comments" maxlength="100"></nys-textarea>
47
+ * ```
48
+ *
49
+ * @example Width Small
50
+ * ```html
51
+ * <nys-textarea label="Comments" width="sm"></nys-textarea>
52
+ * ```
53
+ *
54
+ * @example Width Medium
55
+ * ```html
56
+ * <nys-textarea label="Comments" width="md"></nys-textarea>
57
+ * ```
58
+ *
59
+ * @example Width Large
60
+ * ```html
61
+ * <nys-textarea label="Comments" width="lg"></nys-textarea>
62
+ * ```
63
+ *
64
+ * @example Description
65
+ * ```html
66
+ * <nys-textarea label="Describe the incident" description="Please provide details"></nys-textarea>
67
+ * ```
68
+ *
69
+ * @example Description Slot
70
+ * ```html
71
+ * <nys-textarea label="Describe the incident">
72
+ * <div slot="description">Please provide details</div>
73
+ * </nys-textarea>
27
74
  * ```
28
75
  */
29
76
  export declare class NysTextarea extends LitElement {
@@ -50,7 +97,7 @@ export declare class NysTextarea extends LitElement {
50
97
  value: string;
51
98
  /** Prevents interaction. */
52
99
  disabled: boolean;
53
- /** Makes textarea read-only but focusable. */
100
+ /** Makes textarea readonly but focusable. */
54
101
  readonly: boolean;
55
102
  /** Marks as required. Shows "Required" flag and validates on blur. */
56
103
  required: boolean;
@@ -17,25 +17,79 @@ import { LitElement } from "lit";
17
17
  * @fires nys-focus - Fired when input gains focus.
18
18
  * @fires nys-blur - Fired when input loses focus. Triggers validation.
19
19
  *
20
- * @example Basic text input
20
+ * @example Basic
21
21
  * ```html
22
- * <nys-textinput label="Full Name" required></nys-textinput>
22
+ * <nys-textinput label="Full Name"></nys-textinput>
23
23
  * ```
24
24
  *
25
- * @example Required Email
25
+ * @example Disabled
26
26
  * ```html
27
- * <nys-textinput type="email" label="Email Address" required></nys-textinput>
27
+ * <nys-textinput label="Email Address" disabled></nys-textinput>
28
28
  * ```
29
29
  *
30
- * @example Phone with masking
30
+ * @example Readonly
31
31
  * ```html
32
- * <nys-textinput type="tel" label="Phone Number"></nys-textinput>
32
+ * <nys-textinput label="Email Address" readonly value="You can see me but not edit me"></nys-textinput>
33
33
  * ```
34
34
  *
35
- * @example Search with button
35
+ * @example Required
36
36
  * ```html
37
- * <nys-textinput type="search" placeholder="Search">
38
- * <nys-button slot="endButton" label="Search" prefixIcon="search"></nys-button>
37
+ * <nys-textinput label="Email Address" required></nys-textinput>
38
+ * ```
39
+ *
40
+ * @example Optional
41
+ * ```html
42
+ * <nys-textinput label="Email Address" optional></nys-textinput>
43
+ * ```
44
+ *
45
+ * @example Width Small
46
+ * ```html
47
+ * <nys-textinput label="Zip Code" width="sm"></nys-textinput>
48
+ * ```
49
+ *
50
+ * @example Width Medium
51
+ * ```html
52
+ * <nys-textinput label="City" width="md"></nys-textinput>
53
+ * ```
54
+ *
55
+ * @example Width Large
56
+ * ```html
57
+ * <nys-textinput label="Email Address" width="lg"></nys-textinput>
58
+ * ```
59
+ *
60
+ * @example Description
61
+ * ```html
62
+ * <nys-textinput label="Email Address" description="Only valid ny.gov emails are accepted."></nys-textinput>
63
+ * ```
64
+ *
65
+ * @example Description Slot
66
+ * ```html
67
+ * <nys-textinput label="Email Address">
68
+ * <div slot="description">Only valid <strong>ny.gov</strong> emails are accepted.</div>
69
+ * </nys-textinput>
70
+ * ```
71
+ *
72
+ * @example Masking
73
+ * ```html
74
+ * <nys-textinput type="tel" label="Phone Number">
75
+ * <div slot="description">Some types, such as <code>tel</code> have automatic masking available.</div>
76
+ * </nys-textinput>
77
+ * ```
78
+ *
79
+ * @example Max Min Values
80
+ * ```html
81
+ * <nys-textinput type="number" label="Age" min="18" max="99" width="sm"></nys-textinput>
82
+ * ```
83
+ *
84
+ * @example Suffix Button
85
+ * ```html
86
+ * <nys-textinput id="search-demo" type="search" placeholder="Search">
87
+ * <nys-button
88
+ * slot="endButton"
89
+ * ariaLabel="Search"
90
+ * prefixIcon="search"
91
+ * onclick="alert('searching for: ' + document.getElementById('search-demo').value)"
92
+ * ></nys-button>
39
93
  * </nys-textinput>
40
94
  * ```
41
95
  */
@@ -14,14 +14,50 @@ import { LitElement } from "lit";
14
14
  * @fires nys-focus - Fired when toggle gains focus.
15
15
  * @fires nys-blur - Fired when toggle loses focus.
16
16
  *
17
- * @example Basic toggle
17
+ * @example Basic
18
18
  * ```html
19
- * <nys-toggle label="Enable notifications" name="notifications"></nys-toggle>
19
+ * <nys-toggle label="Enable notifications" name="notifications" value="enabled-notifications"></nys-toggle>
20
20
  * ```
21
21
  *
22
- * @example Dark mode toggle
22
+ * @example Checked
23
23
  * ```html
24
- * <nys-toggle label="Dark mode" description="Adjust display for low light" checked></nys-toggle>
24
+ * <nys-toggle label="Dark Mode" name="theme" value="dark" checked></nys-toggle>
25
+ * ```
26
+ *
27
+ * @example Disabled
28
+ * ```html
29
+ * <nys-toggle label="Opt Out of emails" name="toggle-switch" value="emails" disabled></nys-toggle>
30
+ * ```
31
+ *
32
+ * @example Hide Icon
33
+ * ```html
34
+ * <nys-toggle label="No icon on the toggle knob" name="icon" value="no-icon" noIcon></nys-toggle>
35
+ * ```
36
+ *
37
+ * @example Size small
38
+ * ```html
39
+ * <nys-toggle label="Tiny but mighty" name="sm-size" value="sm-size" size="sm"></nys-toggle>
40
+ * ```
41
+ *
42
+ * @example Description
43
+ * ```html
44
+ * <nys-toggle
45
+ * label="Opt Out of emails"
46
+ * description="An email address is recommended to be on file for contact information."
47
+ * name="toggle-switch"
48
+ * value="emails"
49
+ * ></nys-toggle>
50
+ * ```
51
+ *
52
+ * @example Description Slot
53
+ * ```html
54
+ * <nys-toggle
55
+ * label="Opt Out of emails"
56
+ * name="toggle-switch"
57
+ * value="emails"
58
+ * >
59
+ * <p slot="description">We <strong>REALLY</strong> encourage you to keep emails enabled for contact purposes.</p>
60
+ * </nys-toggle>
25
61
  * ```
26
62
  */
27
63
  export declare class NysToggle extends LitElement {