@nysds/components 1.16.1 → 1.18.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 +4245 -3280
- package/dist/.vscode/vscode.html-custom-data.json +114 -30
- package/dist/custom-elements.json +4245 -3280
- package/dist/nysds.es.js +2550 -1977
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +186 -164
- package/dist/nysds.js.map +1 -1
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +15 -3
- package/dist/packages/nys-badge/src/nys-badge.d.ts +2 -0
- package/dist/packages/nys-breadcrumbs/src/index.d.ts +1 -0
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +119 -0
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.figma.d.ts +1 -0
- package/dist/packages/nys-button/src/nys-button.d.ts +2 -2
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +0 -2
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +1 -4
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +8 -0
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +1 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +3 -1
- package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +2 -2
- package/dist/packages/nys-label/src/nys-label.d.ts +9 -6
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +0 -2
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +1 -4
- package/dist/packages/nys-tab/src/index.d.ts +3 -0
- package/dist/packages/nys-tab/src/nys-tab.d.ts +116 -0
- package/dist/packages/nys-tab/src/nys-tab.figma.d.ts +1 -0
- package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +197 -0
- package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +46 -0
- package/dist/packages/nys-table/src/nys-table.d.ts +10 -7
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +1 -1
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +2 -1
- package/dist/packages/nys-video/src/nys-video.d.ts +25 -0
- package/dist/src/index.d.ts +2 -0
- package/package.json +3 -2
- package/packages/react/NysBacktotop.d.ts +1 -1
- package/packages/react/NysBadge.d.ts +3 -0
- package/packages/react/NysBadge.js +2 -0
- package/packages/react/NysBreadcrumbItem.d.ts +72 -0
- package/packages/react/NysBreadcrumbItem.js +42 -0
- package/packages/react/NysBreadcrumbs.d.ts +89 -0
- package/packages/react/NysBreadcrumbs.js +50 -0
- package/packages/react/NysButton.d.ts +2 -2
- package/packages/react/NysCheckbox.d.ts +0 -3
- package/packages/react/NysCheckbox.js +0 -2
- package/packages/react/NysCheckboxgroup.d.ts +0 -3
- package/packages/react/NysCheckboxgroup.js +0 -2
- package/packages/react/NysErrorMessage.d.ts +3 -0
- package/packages/react/NysErrorMessage.js +2 -1
- package/packages/react/NysLabel.d.ts +16 -4
- package/packages/react/NysLabel.js +17 -3
- package/packages/react/NysRadiobutton.d.ts +0 -3
- package/packages/react/NysRadiobutton.js +0 -2
- package/packages/react/NysRadiogroup.d.ts +0 -3
- package/packages/react/NysRadiogroup.js +0 -2
- package/packages/react/NysTab.d.ts +90 -0
- package/packages/react/NysTab.js +39 -0
- package/packages/react/NysTabgroup.d.ts +75 -0
- package/packages/react/NysTabgroup.js +22 -0
- package/packages/react/NysTabpanel.d.ts +63 -0
- package/packages/react/NysTabpanel.js +21 -0
- package/packages/react/NysVideo.d.ts +7 -1
- package/packages/react/NysVideo.js +14 -1
- package/packages/react/index.d.ts +4 -0
- package/packages/react/index.js +4 -0
- package/packages/react/nysds-jsx.d.ts +167 -14
|
@@ -5,12 +5,23 @@ import { LitElement } from "lit";
|
|
|
5
5
|
* Auto-shows after scrolling 1.5 viewports on pages 4+ screens tall. Set `visible` to force display.
|
|
6
6
|
* Renders as circle button on mobile. Position with `position` prop (`left` or `right`).
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* **Placement:** For best accessibility, place as the first focusable element in the page footer.
|
|
9
|
+
* If no footer exists, place at the bottom of the body tag (after main content). Floating
|
|
10
|
+
* positioning allows it to overlay content without taking up layout space.
|
|
11
|
+
*
|
|
12
|
+
* **Focus Management:** When clicked, after scrolling to the top, focus is automatically moved
|
|
13
|
+
* to the `<main>` element (if present), the first heading (`<h1>` or `<h2>`), or the document element.
|
|
14
|
+
* This ensures keyboard navigation continues naturally from the top of the page.
|
|
15
|
+
*
|
|
16
|
+
* @summary Floating back-to-top button with auto-show behavior, smooth scroll, and focus management.
|
|
9
17
|
* @element nys-backtotop
|
|
10
18
|
*
|
|
11
|
-
* @example Auto-appearing button
|
|
19
|
+
* @example Auto-appearing button in footer
|
|
12
20
|
* ```html
|
|
13
|
-
* <
|
|
21
|
+
* <footer>
|
|
22
|
+
* <nys-backtotop></nys-backtotop>
|
|
23
|
+
* <!-- Other footer content -->
|
|
24
|
+
* </footer>
|
|
14
25
|
* ```
|
|
15
26
|
*
|
|
16
27
|
* @example Always visible, left position
|
|
@@ -40,6 +51,7 @@ export declare class NysBacktotop extends LitElement {
|
|
|
40
51
|
*/
|
|
41
52
|
private _handleScroll;
|
|
42
53
|
private _scrollToTop;
|
|
54
|
+
private _moveFocusToTop;
|
|
43
55
|
private _handleResize;
|
|
44
56
|
render(): import("lit-html").TemplateResult<1>;
|
|
45
57
|
}
|
|
@@ -39,6 +39,8 @@ export declare class NysBadge extends LitElement {
|
|
|
39
39
|
prefixLabel: string;
|
|
40
40
|
/** Primary label text displayed in the badge. */
|
|
41
41
|
label: string;
|
|
42
|
+
/** Screen reader text appended after the label for additional context. */
|
|
43
|
+
srText: string;
|
|
42
44
|
variant: "strong" | "";
|
|
43
45
|
private _prefixIcon;
|
|
44
46
|
get prefixIcon(): string | boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./nys-breadcrumbs";
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* A breadcrumb navigation trail composed of `nys-breadcrumbitem` elements.
|
|
4
|
+
* Collapses when the trail exceeds 5 items on desktop or 3 items on mobile,
|
|
5
|
+
* showing the first, last, and item before the current page, with an ellipsis to expand.
|
|
6
|
+
* A single item renders as a back-to-parent link instead of a trail.
|
|
7
|
+
*
|
|
8
|
+
* @summary Breadcrumb navigation trail with responsive collapse support.
|
|
9
|
+
* @element nys-breadcrumbs
|
|
10
|
+
*
|
|
11
|
+
* @slot - One or more `nys-breadcrumbitem` elements defining the trail.
|
|
12
|
+
*
|
|
13
|
+
* @fires nys-breadcrumbs-expand - Fired when the user clicks the ellipsis to expand the trail.
|
|
14
|
+
*
|
|
15
|
+
* @example Full trail with current page
|
|
16
|
+
* ```html
|
|
17
|
+
* <nys-breadcrumbs>
|
|
18
|
+
* <ol>
|
|
19
|
+
* <li><a href="/">Home</a></li>
|
|
20
|
+
* <li><a href="/services">Services</a></li>
|
|
21
|
+
* <li>Current Page</li>
|
|
22
|
+
* </ol>
|
|
23
|
+
* </nys-breadcrumbs>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Trail without current page
|
|
27
|
+
* ```html
|
|
28
|
+
* <nys-breadcrumbs>
|
|
29
|
+
* <ol>
|
|
30
|
+
* <li><a href="/">Home</a></li>
|
|
31
|
+
* <li><a href="/services">Services</a></li>
|
|
32
|
+
* </ol>
|
|
33
|
+
* </nys-breadcrumbs>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example Single item renders as back-to-parent
|
|
37
|
+
* ```html
|
|
38
|
+
* <nys-breadcrumbs>
|
|
39
|
+
* <ol>
|
|
40
|
+
* <li><a href="/services">Services</a></li>
|
|
41
|
+
* </ol>
|
|
42
|
+
* </nys-breadcrumbs>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class NysBreadcrumbs extends LitElement {
|
|
46
|
+
static styles: import("lit").CSSResult;
|
|
47
|
+
/**
|
|
48
|
+
* Unique identifier. Auto-generated if not provided.
|
|
49
|
+
*/
|
|
50
|
+
id: string;
|
|
51
|
+
/**
|
|
52
|
+
* Accessible label for the `<nav>` landmark. Defaults to "path to this page" if not set.
|
|
53
|
+
* Override when multiple crumbs exist on the same page.
|
|
54
|
+
*/
|
|
55
|
+
ariaLabel: string;
|
|
56
|
+
/**
|
|
57
|
+
* Controls the visual size of the breadcrumb text and spacing: `sm` for dense layouts, `md` (default) for standard use.
|
|
58
|
+
* @default "md"
|
|
59
|
+
*/
|
|
60
|
+
size: "sm" | "md" | "";
|
|
61
|
+
/**
|
|
62
|
+
* On mobile, renders the trail as a single back-to-parent link pointing to the item before the current page.
|
|
63
|
+
* Has no effect on desktop or when only one item is present (which always renders as a back link).
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
backToParent: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Forces the trail into its collapsed state.
|
|
69
|
+
* It shows only the first item, an ellipsis, and the last two items.
|
|
70
|
+
* The user can still expand the trail by clicking the ellipsis.
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
collapsed: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Renders a filled light theme background bar behind the breadcrumb trail.
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
backgroundBar: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Prevents interaction.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
disabled: boolean;
|
|
84
|
+
private _collapseThreshold;
|
|
85
|
+
private _manuallyExpanded;
|
|
86
|
+
private _mediaQuery;
|
|
87
|
+
/**
|
|
88
|
+
* Lifecycle methods
|
|
89
|
+
* --------------------------------------------------------------------------
|
|
90
|
+
*/
|
|
91
|
+
constructor();
|
|
92
|
+
connectedCallback(): void;
|
|
93
|
+
disconnectedCallback(): void;
|
|
94
|
+
firstUpdated(): void;
|
|
95
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
96
|
+
/**
|
|
97
|
+
* Functions
|
|
98
|
+
* --------------------------------------------------------------------------
|
|
99
|
+
*/
|
|
100
|
+
private _updateCollapseThreshold;
|
|
101
|
+
private _getSlottedOl;
|
|
102
|
+
private _getSlottedItems;
|
|
103
|
+
private _getAnchor;
|
|
104
|
+
private _isCurrentPage;
|
|
105
|
+
private _createBackToParentElement;
|
|
106
|
+
private _createCrumbElement;
|
|
107
|
+
/**
|
|
108
|
+
* Main logic for cloning and handling user slots.
|
|
109
|
+
* New <ol>, <li>, and <a> tags are created and rendered out as crumbs for the breadcrumbs trail.
|
|
110
|
+
*/
|
|
111
|
+
private _handleSlotChange;
|
|
112
|
+
private _moveFocusToFirstExpandCrumb;
|
|
113
|
+
/**
|
|
114
|
+
* Event Handlers
|
|
115
|
+
* --------------------------------------------------------------------------
|
|
116
|
+
*/
|
|
117
|
+
private _dispatchExpandEvent;
|
|
118
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
119
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -108,11 +108,11 @@ export declare class NysButton extends LitElement {
|
|
|
108
108
|
*/
|
|
109
109
|
ariaControls: string;
|
|
110
110
|
/**
|
|
111
|
-
* Material Symbol icon before label. Not shown for `
|
|
111
|
+
* Material Symbol icon before label. Not shown for `circle` mode.
|
|
112
112
|
*/
|
|
113
113
|
prefixIcon: string;
|
|
114
114
|
/**
|
|
115
|
-
* Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `
|
|
115
|
+
* Material Symbol icon after label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode.
|
|
116
116
|
*/
|
|
117
117
|
suffixIcon: string;
|
|
118
118
|
/**
|
|
@@ -66,8 +66,6 @@ export declare class NysCheckbox extends LitElement {
|
|
|
66
66
|
groupExist: boolean;
|
|
67
67
|
/** Renders as tile with larger clickable area. Apply to group for consistency. */
|
|
68
68
|
tile: boolean;
|
|
69
|
-
/** Adjusts colors for dark backgrounds. */
|
|
70
|
-
inverted: boolean;
|
|
71
69
|
/** Tooltip text shown on hover/focus of info icon. */
|
|
72
70
|
tooltip: string;
|
|
73
71
|
/**
|
|
@@ -3,7 +3,7 @@ import { LitElement } from "lit";
|
|
|
3
3
|
* A container for grouping multiple `nys-checkbox` components as a single form control.
|
|
4
4
|
* Handles validation, required constraints, and submits comma-separated values.
|
|
5
5
|
*
|
|
6
|
-
* Use to allow users to select multiple options from a list. Apply `tile
|
|
6
|
+
* Use to allow users to select multiple options from a list. Apply `tile` and `size` to the group
|
|
7
7
|
* and all children inherit these styles automatically.
|
|
8
8
|
*
|
|
9
9
|
* @summary Container for grouping checkboxes as a single form control.
|
|
@@ -50,8 +50,6 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
50
50
|
tile: boolean;
|
|
51
51
|
/** Tooltip text shown on hover/focus of info icon. */
|
|
52
52
|
tooltip: string;
|
|
53
|
-
/** Adjusts colors for dark backgrounds. Applied to all children. */
|
|
54
|
-
inverted: boolean;
|
|
55
53
|
/** Form `id` to associate with. Applied to all children. */
|
|
56
54
|
form: string | null;
|
|
57
55
|
/**
|
|
@@ -84,7 +82,6 @@ export declare class NysCheckboxgroup extends LitElement {
|
|
|
84
82
|
private _setCustomOtherError;
|
|
85
83
|
private _updateCheckboxSize;
|
|
86
84
|
private _updateCheckboxTile;
|
|
87
|
-
private _updateCheckboxInvert;
|
|
88
85
|
private _updateCheckboxShowError;
|
|
89
86
|
private _updateCheckboxForm;
|
|
90
87
|
private _getSlotDescriptionForAria;
|
|
@@ -22,6 +22,14 @@ import { LitElement } from "lit";
|
|
|
22
22
|
*/
|
|
23
23
|
export declare class NysCombobox extends LitElement {
|
|
24
24
|
static styles: import("lit").CSSResult;
|
|
25
|
+
static shadowRootOptions: {
|
|
26
|
+
delegatesFocus: boolean;
|
|
27
|
+
clonable?: boolean;
|
|
28
|
+
customElementRegistry?: CustomElementRegistry;
|
|
29
|
+
mode: ShadowRootMode;
|
|
30
|
+
serializable?: boolean;
|
|
31
|
+
slotAssignment?: SlotAssignmentMode;
|
|
32
|
+
};
|
|
25
33
|
id: string;
|
|
26
34
|
name: string;
|
|
27
35
|
label: string;
|
|
@@ -107,6 +107,7 @@ export declare class NysDatepicker extends LitElement {
|
|
|
107
107
|
connectedCallback(): void;
|
|
108
108
|
disconnectedCallback(): void;
|
|
109
109
|
firstUpdated(): Promise<void>;
|
|
110
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
110
111
|
private _whenWcDatepickerReady;
|
|
111
112
|
/**
|
|
112
113
|
* Form Integration
|
|
@@ -38,6 +38,7 @@ export declare class NysDropdownMenu extends LitElement {
|
|
|
38
38
|
private _trigger;
|
|
39
39
|
private _menuElement;
|
|
40
40
|
private _ariaTarget;
|
|
41
|
+
private _lastFocusedIndex;
|
|
41
42
|
private readonly GAP;
|
|
42
43
|
/**
|
|
43
44
|
* Lifecycle Methods
|
|
@@ -57,7 +58,7 @@ export declare class NysDropdownMenu extends LitElement {
|
|
|
57
58
|
private _closeDropdown;
|
|
58
59
|
private _getMenuItems;
|
|
59
60
|
private _handleDocumentClick;
|
|
60
|
-
private
|
|
61
|
+
private _focusOnItem;
|
|
61
62
|
private applyInverseTransform;
|
|
62
63
|
/**
|
|
63
64
|
* Position Logic
|
|
@@ -101,6 +102,7 @@ export declare class NysDropdownMenu extends LitElement {
|
|
|
101
102
|
* Event Handlers
|
|
102
103
|
* --------------------------------------------------------------------------
|
|
103
104
|
*/
|
|
105
|
+
private _handleMenuClick;
|
|
104
106
|
private _handleTriggerKeydown;
|
|
105
107
|
private _handleMenuKeydown;
|
|
106
108
|
private _handleWindowResize;
|
|
@@ -10,18 +10,18 @@ import { LitElement } from "lit";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class NysErrorMessage extends LitElement {
|
|
12
12
|
static styles: import("lit").CSSResult;
|
|
13
|
+
/** The "id" of the error message. */
|
|
14
|
+
id: string;
|
|
13
15
|
/** Whether to display the error message. */
|
|
14
16
|
showError: boolean;
|
|
15
17
|
/** Error text to display. Falls back to native validation message if available. */
|
|
16
18
|
errorMessage: string;
|
|
17
19
|
/** Shows a divider line above the error message. */
|
|
18
20
|
showDivider: boolean;
|
|
19
|
-
private _internals;
|
|
20
21
|
/**
|
|
21
22
|
* Lifecycle methods
|
|
22
23
|
* --------------------------------------------------------------------------
|
|
23
24
|
*/
|
|
24
|
-
static formAssociated: boolean;
|
|
25
25
|
constructor();
|
|
26
26
|
render(): import("lit-html").TemplateResult<1>;
|
|
27
27
|
}
|
|
@@ -12,8 +12,8 @@ import { LitElement } from "lit";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class NysLabel extends LitElement {
|
|
14
14
|
static styles: import("lit").CSSResult;
|
|
15
|
-
/** ID of the
|
|
16
|
-
|
|
15
|
+
/** The ID of the label. */
|
|
16
|
+
id: string;
|
|
17
17
|
/** Label text displayed above the form field. */
|
|
18
18
|
label: string;
|
|
19
19
|
/** Helper text displayed below the label. */
|
|
@@ -23,13 +23,16 @@ export declare class NysLabel extends LitElement {
|
|
|
23
23
|
/** Adjusts colors for dark backgrounds. */
|
|
24
24
|
inverted: boolean;
|
|
25
25
|
/** Tooltip text shown on hover/focus of info icon next to label. */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
private _tooltip;
|
|
26
|
+
tooltip: string;
|
|
27
|
+
connectedCallback(): void;
|
|
29
28
|
/**
|
|
30
29
|
* Event Handlers
|
|
31
30
|
* --------------------------------------------------------------------------
|
|
32
31
|
*/
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* While most components don't need to listen for this event.
|
|
34
|
+
* Special components like "nys-fileinput" and "nys-toggle" need to listen for label to execute their specific functionalities.
|
|
35
|
+
*/
|
|
36
|
+
private _dispatchLabelClick;
|
|
34
37
|
render(): import("lit-html").TemplateResult<1>;
|
|
35
38
|
}
|
|
@@ -50,8 +50,6 @@ export declare class NysRadiobutton extends LitElement {
|
|
|
50
50
|
name: string;
|
|
51
51
|
/** Value submitted when this radio is selected. */
|
|
52
52
|
value: string;
|
|
53
|
-
/** Adjusts colors for dark backgrounds. */
|
|
54
|
-
inverted: boolean;
|
|
55
53
|
/** Form `id` to associate with. */
|
|
56
54
|
form: string | null;
|
|
57
55
|
/**
|
|
@@ -3,7 +3,7 @@ import { LitElement } from "lit";
|
|
|
3
3
|
* A container for grouping `nys-radiobutton` elements as a single form control with enforced single selection.
|
|
4
4
|
* Handles keyboard navigation (arrow keys), validation, required constraints, and form integration.
|
|
5
5
|
*
|
|
6
|
-
* Use to let users select exactly one option from 2-6 choices. Apply `tile
|
|
6
|
+
* Use to let users select exactly one option from 2-6 choices. Apply `tile` and `size` to the group
|
|
7
7
|
* and all children inherit these styles automatically. For 7+ options, use `nys-select`.
|
|
8
8
|
*
|
|
9
9
|
* @summary Container for grouping radio buttons as a single form control.
|
|
@@ -51,8 +51,6 @@ export declare class NysRadiogroup extends LitElement {
|
|
|
51
51
|
tile: boolean;
|
|
52
52
|
/** Tooltip text shown on hover/focus of info icon. */
|
|
53
53
|
tooltip: string;
|
|
54
|
-
/** Adjusts colors for dark backgrounds. Applied to all children. */
|
|
55
|
-
inverted: boolean;
|
|
56
54
|
/** Form `id` to associate with. Applied to all children. */
|
|
57
55
|
form: string | null;
|
|
58
56
|
/**
|
|
@@ -93,7 +91,6 @@ export declare class NysRadiogroup extends LitElement {
|
|
|
93
91
|
private _initializeChildAttributes;
|
|
94
92
|
private _updateRadioButtonsSize;
|
|
95
93
|
private _updateRadioButtonsTile;
|
|
96
|
-
private _updateRadioButtonsInvert;
|
|
97
94
|
private _updateRadioButtonsShowError;
|
|
98
95
|
private _updateRadioButtonsForm;
|
|
99
96
|
private _getSlotDescriptionForAria;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* `<nys-tab>` is a single tab within a `<nys-tabgroup>`.
|
|
4
|
+
*
|
|
5
|
+
* The host element carries `role="tab"`, `tabindex`, `aria-selected`,
|
|
6
|
+
* `aria-controls`, and `aria-disabled` so assistive technologies see the
|
|
7
|
+
* correct ARIA tab semantics on the element that is actually focused.
|
|
8
|
+
* `<nys-tabgroup>` manages `tabindex`, `aria-selected`, and `aria-controls`
|
|
9
|
+
* via `_applySelection`; do not set them directly on this element.
|
|
10
|
+
*
|
|
11
|
+
* @element nys-tab
|
|
12
|
+
*
|
|
13
|
+
* @fires nys-tab-select - Dispatched when the tab is activated via click or
|
|
14
|
+
* Enter / Space. Bubbles and crosses shadow DOM boundaries.
|
|
15
|
+
* `detail: { id: string, label: string }`
|
|
16
|
+
* @fires nys-tab-focus - Dispatched when the host receives focus. Bubbles and
|
|
17
|
+
* crosses shadow DOM boundaries. `detail: { id: string }`
|
|
18
|
+
* @fires nys-tab-blur - Dispatched when the host loses focus. Bubbles and
|
|
19
|
+
* crosses shadow DOM boundaries. `detail: { id: string }`
|
|
20
|
+
*
|
|
21
|
+
* @slot - No slots; content is derived from the `label` property.
|
|
22
|
+
*
|
|
23
|
+
* @example `<nys-tab>` and `<nys-tabpanel>` should always be wrapped by `<nys-tabgroup>`
|
|
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>
|
|
28
|
+
* <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>
|
|
33
|
+
* </nys-tabgroup>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare class NysTab extends LitElement {
|
|
37
|
+
static styles: import("lit").CSSResult;
|
|
38
|
+
/**
|
|
39
|
+
* Unique identifier for the tab element.
|
|
40
|
+
* Reflected to the DOM attribute so `aria-controls` references resolve.
|
|
41
|
+
*
|
|
42
|
+
* @attr id
|
|
43
|
+
*/
|
|
44
|
+
id: string;
|
|
45
|
+
/**
|
|
46
|
+
* Visible text label rendered inside the inner `<span>`.
|
|
47
|
+
*
|
|
48
|
+
* @attr label
|
|
49
|
+
*/
|
|
50
|
+
label: string;
|
|
51
|
+
/**
|
|
52
|
+
* Whether this tab is the currently active tab.
|
|
53
|
+
* Managed by `<nys-tabgroup>`; reflected for CSS attribute selectors.
|
|
54
|
+
*
|
|
55
|
+
* @attr selected
|
|
56
|
+
*/
|
|
57
|
+
selected: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether this tab is disabled.
|
|
60
|
+
* Reflected to the DOM attribute for CSS styling.
|
|
61
|
+
*
|
|
62
|
+
* @attr disabled
|
|
63
|
+
*/
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Sets `role="tab"` and `tabindex="-1"` on the host (the element that AT
|
|
67
|
+
* will read and that receives keyboard focus). Attaches host-level listeners
|
|
68
|
+
* for keydown, focus, blur, and click so that interaction events work
|
|
69
|
+
* correctly on the host element itself.
|
|
70
|
+
*
|
|
71
|
+
* Click is handled at the host level so iOS VoiceOver double-tap (which
|
|
72
|
+
* dispatches `click` directly on the host because of `role="tab"`, bypassing
|
|
73
|
+
* shadow-DOM children) activates the tab. Normal taps land on the inner
|
|
74
|
+
* `<span>` and bubble up to this listener.
|
|
75
|
+
*
|
|
76
|
+
* `<nys-tabgroup>` overrides `tabindex` to `"0"` on the selected tab.
|
|
77
|
+
*/
|
|
78
|
+
connectedCallback(): void;
|
|
79
|
+
disconnectedCallback(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Keeps `aria-disabled` on the host in sync with the `disabled` property so
|
|
82
|
+
* AT perceives the disabled state on the element it actually focuses.
|
|
83
|
+
*/
|
|
84
|
+
updated(changed: Map<string, unknown>): void;
|
|
85
|
+
/**
|
|
86
|
+
* Focuses the host element. The host carries `role="tab"` and `tabindex`,
|
|
87
|
+
* so it is the correct element for AT to land on.
|
|
88
|
+
*/
|
|
89
|
+
focus(options?: FocusOptions): void;
|
|
90
|
+
/**
|
|
91
|
+
* Enter / Space on the focused host activate the tab.
|
|
92
|
+
* Arrow-key navigation is handled one level up by `<nys-tabgroup>`.
|
|
93
|
+
*/
|
|
94
|
+
private _onKeydown;
|
|
95
|
+
/**
|
|
96
|
+
* Host focus → dispatch `nys-tab-focus` for external observers.
|
|
97
|
+
*/
|
|
98
|
+
private _onFocus;
|
|
99
|
+
/**
|
|
100
|
+
* Host blur → dispatch `nys-tab-blur` for external observers.
|
|
101
|
+
*/
|
|
102
|
+
private _onBlur;
|
|
103
|
+
/**
|
|
104
|
+
* Host-level click handler. Activates the tab regardless of whether the
|
|
105
|
+
* click landed on the inner element (normal pointer/keyboard tap, which
|
|
106
|
+
* bubbles up) or directly on the host (iOS VoiceOver double-tap dispatches
|
|
107
|
+
* `click` on the element with `role="tab"`, bypassing shadow-DOM children).
|
|
108
|
+
*/
|
|
109
|
+
private _onClick;
|
|
110
|
+
/**
|
|
111
|
+
* Focuses the host then dispatches `nys-tab-select`. Called from both the
|
|
112
|
+
* click handler and the keydown handler.
|
|
113
|
+
*/
|
|
114
|
+
private _handleClick;
|
|
115
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
116
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|