@nysds/components 1.21.1 → 1.22.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 +1524 -1022
- package/dist/.vscode/vscode.css-custom-data.json +75 -0
- package/dist/.vscode/vscode.html-custom-data.json +99 -54
- package/dist/custom-elements.json +1524 -1022
- package/dist/{nys-icon.library-C02yNW9R.js → nys-icon.library-BZ3jVyhP.js} +2 -2
- package/dist/{nys-icon.library-C02yNW9R.js.map → nys-icon.library-BZ3jVyhP.js.map} +1 -1
- package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js → nys-icon.library-DYsQ8Tiv-DYS-TkV2.js} +3 -3
- package/dist/{nys-icon.library-BxwfG3ym-D4Dl8jc_.js.map → nys-icon.library-DYsQ8Tiv-DYS-TkV2.js.map} +1 -1
- package/dist/nysds.es.js +5059 -3637
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +248 -244
- package/dist/nysds.js.map +1 -1
- package/dist/packages/codegen/src/index.d.ts +16 -0
- package/dist/packages/codegen/src/manifest/components.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/filters.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/form-control.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/load.d.ts +10 -0
- package/dist/packages/codegen/src/manifest/naming.d.ts +6 -0
- package/dist/packages/codegen/src/manifest/packages.d.ts +5 -0
- package/dist/packages/codegen/src/manifest/types.d.ts +6 -0
- package/dist/packages/codegen/src/transform/index.d.ts +19 -0
- package/dist/packages/codegen/src/transform/parse.d.ts +18 -0
- package/dist/packages/codegen/src/transform/shared.d.ts +61 -0
- package/dist/packages/codegen/src/transform/to-angular.d.ts +6 -0
- package/dist/packages/codegen/src/transform/to-jsx.d.ts +6 -0
- package/dist/packages/internals/src/form-control-mixin.d.ts +16 -0
- package/dist/packages/internals/src/form-events.d.ts +22 -0
- package/dist/packages/internals/src/index.d.ts +2 -1
- package/dist/packages/internals/src/types.d.ts +6 -0
- package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +12 -0
- package/dist/packages/mcp-server/src/lib/framework-snippets.d.ts +35 -0
- package/dist/packages/mcp-server/src/lib/framework-usage.d.ts +19 -0
- package/dist/packages/mcp-server/src/lib/frameworks-data.d.ts +18 -0
- package/dist/packages/mcp-server/src/resources/frameworks.d.ts +14 -0
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +12 -0
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +9 -1
- package/dist/packages/nys-alert/src/nys-alert.d.ts +39 -1
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +16 -0
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +12 -0
- package/dist/packages/nys-badge/src/nys-badge.d.ts +18 -0
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +22 -1
- package/dist/packages/nys-button/src/nys-button.d.ts +35 -4
- package/dist/packages/nys-card/src/nys-card.d.ts +20 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +77 -7
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +46 -0
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +51 -6
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +44 -2
- package/dist/packages/nys-divider/src/nys-divider.d.ts +9 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +17 -0
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +10 -0
- package/dist/packages/nys-fileinput/src/index.d.ts +1 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +42 -6
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +9 -1
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +17 -0
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +18 -0
- package/dist/packages/nys-icon/src/nys-icon.d.ts +18 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +16 -0
- package/dist/packages/nys-label/src/nys-label.d.ts +3 -1
- package/dist/packages/nys-modal/src/nys-modal.d.ts +26 -2
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +21 -2
- package/dist/packages/nys-processlist/src/nys-processlist.d.ts +16 -0
- package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +1 -1
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +29 -5
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +66 -4
- package/dist/packages/nys-select/src/nys-select.d.ts +22 -4
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +8 -0
- package/dist/packages/nys-stepper/src/nys-step.d.ts +8 -1
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +8 -0
- package/dist/packages/nys-tab/src/nys-tab.d.ts +22 -3
- package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +12 -0
- package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +2 -0
- package/dist/packages/nys-table/src/nys-table.d.ts +39 -2
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +47 -4
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +42 -4
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +37 -3
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +13 -0
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +13 -0
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +26 -4
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +14 -0
- package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +11 -0
- package/dist/packages/nys-video/src/nys-video.d.ts +14 -1
- package/package.json +30 -25
- package/packages/react/.turbo/turbo-build.log +0 -59
- package/packages/react/NysAccordion.d.ts +0 -75
- package/packages/react/NysAccordion.js +0 -24
- package/packages/react/NysAccordionItem.d.ts +0 -82
- package/packages/react/NysAccordionItem.js +0 -43
- package/packages/react/NysAlert.d.ts +0 -102
- package/packages/react/NysAlert.js +0 -61
- package/packages/react/NysAvatar.d.ts +0 -88
- package/packages/react/NysAvatar.js +0 -40
- package/packages/react/NysBacktotop.d.ts +0 -57
- package/packages/react/NysBacktotop.js +0 -23
- package/packages/react/NysBadge.d.ts +0 -78
- package/packages/react/NysBadge.js +0 -42
- package/packages/react/NysBreadcrumbItem.d.ts +0 -72
- package/packages/react/NysBreadcrumbItem.js +0 -42
- package/packages/react/NysBreadcrumbs.d.ts +0 -89
- package/packages/react/NysBreadcrumbs.js +0 -50
- package/packages/react/NysButton.d.ts +0 -171
- package/packages/react/NysButton.js +0 -83
- package/packages/react/NysCard.d.ts +0 -121
- package/packages/react/NysCard.js +0 -63
- package/packages/react/NysCheckbox.d.ts +0 -145
- package/packages/react/NysCheckbox.js +0 -78
- package/packages/react/NysCheckboxgroup.d.ts +0 -88
- package/packages/react/NysCheckboxgroup.js +0 -46
- package/packages/react/NysCombobox.d.ts +0 -126
- package/packages/react/NysCombobox.js +0 -66
- package/packages/react/NysDatepicker.d.ts +0 -128
- package/packages/react/NysDatepicker.js +0 -76
- package/packages/react/NysDivider.d.ts +0 -54
- package/packages/react/NysDivider.js +0 -22
- package/packages/react/NysDropdownMenu.d.ts +0 -59
- package/packages/react/NysDropdownMenu.js +0 -23
- package/packages/react/NysDropdownMenuItem.d.ts +0 -75
- package/packages/react/NysDropdownMenuItem.js +0 -47
- package/packages/react/NysErrorMessage.d.ts +0 -60
- package/packages/react/NysErrorMessage.js +0 -24
- package/packages/react/NysFileItem.d.ts +0 -69
- package/packages/react/NysFileItem.js +0 -37
- package/packages/react/NysFileinput.d.ts +0 -130
- package/packages/react/NysFileinput.js +0 -74
- package/packages/react/NysGlobalFooter.d.ts +0 -77
- package/packages/react/NysGlobalFooter.js +0 -32
- package/packages/react/NysGlobalHeader.d.ts +0 -82
- package/packages/react/NysGlobalHeader.js +0 -32
- package/packages/react/NysIcon.d.ts +0 -75
- package/packages/react/NysIcon.js +0 -50
- package/packages/react/NysIconlist.d.ts +0 -57
- package/packages/react/NysIconlist.js +0 -23
- package/packages/react/NysIconlistitem.d.ts +0 -63
- package/packages/react/NysIconlistitem.js +0 -23
- package/packages/react/NysLabel.d.ts +0 -81
- package/packages/react/NysLabel.js +0 -40
- package/packages/react/NysModal.d.ts +0 -90
- package/packages/react/NysModal.js +0 -50
- package/packages/react/NysOption.d.ts +0 -66
- package/packages/react/NysOption.js +0 -25
- package/packages/react/NysPagination.d.ts +0 -72
- package/packages/react/NysPagination.js +0 -45
- package/packages/react/NysProcesslist.d.ts +0 -65
- package/packages/react/NysProcesslist.js +0 -25
- package/packages/react/NysProcesslistitem.d.ts +0 -61
- package/packages/react/NysProcesslistitem.js +0 -35
- package/packages/react/NysRadiobutton.d.ts +0 -132
- package/packages/react/NysRadiobutton.js +0 -72
- package/packages/react/NysRadiogroup.d.ts +0 -104
- package/packages/react/NysRadiogroup.js +0 -62
- package/packages/react/NysSelect.d.ts +0 -119
- package/packages/react/NysSelect.js +0 -67
- package/packages/react/NysSkipnav.d.ts +0 -54
- package/packages/react/NysSkipnav.js +0 -22
- package/packages/react/NysStep.d.ts +0 -73
- package/packages/react/NysStep.js +0 -40
- package/packages/react/NysStepper.d.ts +0 -67
- package/packages/react/NysStepper.js +0 -26
- package/packages/react/NysTab.d.ts +0 -90
- package/packages/react/NysTab.js +0 -39
- package/packages/react/NysTabgroup.d.ts +0 -76
- package/packages/react/NysTabgroup.js +0 -22
- package/packages/react/NysTable.d.ts +0 -80
- package/packages/react/NysTable.js +0 -41
- package/packages/react/NysTabpanel.d.ts +0 -70
- package/packages/react/NysTabpanel.js +0 -21
- package/packages/react/NysTextarea.d.ts +0 -141
- package/packages/react/NysTextarea.js +0 -79
- package/packages/react/NysTextinput.d.ts +0 -144
- package/packages/react/NysTextinput.js +0 -83
- package/packages/react/NysToggle.d.ts +0 -102
- package/packages/react/NysToggle.js +0 -59
- package/packages/react/NysTooltip.d.ts +0 -60
- package/packages/react/NysTooltip.js +0 -24
- package/packages/react/NysUnavFooter.d.ts +0 -61
- package/packages/react/NysUnavFooter.js +0 -21
- package/packages/react/NysUnavHeader.d.ts +0 -95
- package/packages/react/NysUnavHeader.js +0 -54
- package/packages/react/NysVerticalnav.d.ts +0 -67
- package/packages/react/NysVerticalnav.js +0 -26
- package/packages/react/NysVerticalnavGroup.d.ts +0 -76
- package/packages/react/NysVerticalnavGroup.js +0 -43
- package/packages/react/NysVideo.d.ts +0 -83
- package/packages/react/NysVideo.js +0 -53
- package/packages/react/README.md +0 -92
- package/packages/react/index.d.ts +0 -49
- package/packages/react/index.js +0 -49
- package/packages/react/nysds-jsx.d.ts +0 -2009
- package/packages/react/react-utils.js +0 -40
|
@@ -11,6 +11,23 @@ import "@nysds/nys-divider";
|
|
|
11
11
|
*
|
|
12
12
|
* @slot - Footer content (links, contact info). Use `<h4>` for column headings.
|
|
13
13
|
*
|
|
14
|
+
* @cssprop [--nys-max-width--content] - Overrides the inner content max width across the grid, header, footer, and breadcrumb. Set at a higher level like `:root` to apply to all instances. Takes priority over the size-specific variable.
|
|
15
|
+
*
|
|
16
|
+
* @usagedos
|
|
17
|
+
* - Use on every agency site and application. The Global Footer is a required page element.
|
|
18
|
+
* - Use to surface essential site-wide links such as contact information, privacy policies, accessibility statements, and related program pages.
|
|
19
|
+
* - Set `agencyName` to your agency's full official name (e.g., "Office of Information Technology Services").
|
|
20
|
+
* - Set `homepageLink` to make the agency name a clickable link back to your site's homepage.
|
|
21
|
+
* - Keep footer link lists concise. Group related links under `<span>` headings when you have more than 5–6 links.
|
|
22
|
+
* - Use slotted `<ul>` content for single-list links, or nested `<ul>` with `<span>` headings for multi-column layouts.
|
|
23
|
+
* - Place `<nys-globalfooter>` above `<nys-unavfooter>` and below your page content and `<nys-backtotop>`.
|
|
24
|
+
*
|
|
25
|
+
* @usagedonts
|
|
26
|
+
* - Use for primary navigation. That belongs in `<nys-globalheader>`.
|
|
27
|
+
* - Include page-specific content or calls to action. Footer content should be relevant site-wide.
|
|
28
|
+
* - Use for statewide universal links (Agencies, Services, Counties). Those belong in `<nys-unavfooter>`, which renders below this component.
|
|
29
|
+
* - Embed `<script>`, `<iframe>`, `<object>`, or `<img>` elements in slotted content. These are sanitized and removed by the component for security.
|
|
30
|
+
*
|
|
14
31
|
* @example Basic
|
|
15
32
|
* ```html
|
|
16
33
|
* <nys-globalfooter agencyName="Office of Information Technology Services"></nys-globalfooter>
|
|
@@ -9,9 +9,27 @@ import { NysElement } from "@nysds/internals";
|
|
|
9
9
|
* @summary Agency header with navigation, mobile menu, and active link highlighting.
|
|
10
10
|
* @element nys-globalheader
|
|
11
11
|
*
|
|
12
|
+
* @cssprop [--nys-max-width--content] - Overrides the inner content max width across the grid, header, footer, and breadcrumb. Set at a higher level like `:root` to apply to all instances. Takes priority over the size-specific variable.
|
|
13
|
+
*
|
|
12
14
|
* @slot - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
|
|
13
15
|
* @slot user-actions - User-account controls (e.g. profile link, settings, log-out button) shown in the header.
|
|
14
16
|
*
|
|
17
|
+
* @usagedos
|
|
18
|
+
* - Use on every agency site and application. The Global Header is a required page element.
|
|
19
|
+
* - Place below `<nys-unavheader>` when using the Universal Navigation Header.
|
|
20
|
+
* - Use `agencyName` alone for public-facing agency websites not tied to a specific application; omit it for statewide portals that aren't agency-specific.
|
|
21
|
+
* - Use `appName` for named applications (e.g., "Employee Time Tracker" or "License Renewal Portal").
|
|
22
|
+
* - Combine `appName` and `agencyName` when an application belongs to a specific agency.
|
|
23
|
+
* - Set `homepageLink` to make the header title clickable. On public-facing sites, this is the primary path back to the homepage.
|
|
24
|
+
* - Use the `user-actions` slot for authenticated applications that need log-out buttons or user profile controls.
|
|
25
|
+
* - Keep navigation link lists to 6 items or fewer. On mobile, these collapse into a full-width menu.
|
|
26
|
+
* - Add the `nysLogo` property to display the NYS brand mark for internal applications that don't require public-facing agency branding.
|
|
27
|
+
*
|
|
28
|
+
* @usagedonts
|
|
29
|
+
* - Use `appName` for an agency name. Use the `agencyName` prop instead.
|
|
30
|
+
* - Add navigation links to application headers where users should remain focused on a task (e.g., a multi-step form).
|
|
31
|
+
* - Place secondary or utility navigation in the Global Header. Use `<nys-globalfooter>` for secondary links.
|
|
32
|
+
* - Use the `nysLogo` property on public-facing sites, instead use the `<nys-unavheader>` for statewide branding.
|
|
15
33
|
*
|
|
16
34
|
* @example Basic
|
|
17
35
|
* ```html
|
|
@@ -13,6 +13,24 @@ import { NysIconWatcher } from "./icon-library-registry";
|
|
|
13
13
|
* @summary SVG icon with swappable library support, size, rotation, and color options.
|
|
14
14
|
* @element nys-icon
|
|
15
15
|
*
|
|
16
|
+
* @cssprop [--nys-icon-size] - Width and height of the component
|
|
17
|
+
*
|
|
18
|
+
* @usagedos
|
|
19
|
+
* - Use icons to draw attention to actions, help users scan for key information, or enhance recognizable common actions (e.g., search, download, share).
|
|
20
|
+
* - Pair icons with a text label—few icons are universally understood alone.
|
|
21
|
+
* - Use icons consistently: same icon and label for the same meaning throughout your app.
|
|
22
|
+
* - Use `ariaLabel` when the icon conveys meaning, so screen readers can announce its purpose.
|
|
23
|
+
* - Use icons from the NYS Design System library; if unavailable, use Google Material Symbols (rounded, unfilled).
|
|
24
|
+
* - Match icon size and color to the design system.
|
|
25
|
+
*
|
|
26
|
+
* @usagedonts
|
|
27
|
+
* - Use an icon if its meaning isn't immediately clear—if you suspect users won't recognize it, remove it.
|
|
28
|
+
* - Use icons to compensate for unclear page hierarchy or confusing content organization.
|
|
29
|
+
* - Use standalone icons for actions—use `<nys-button>` with an icon inside instead.
|
|
30
|
+
* - Replace meaningful text with icons unless the icon is universally recognized or paired with a label.
|
|
31
|
+
* - Overuse icons—too many create visual noise and reduce focus.
|
|
32
|
+
* - Use excessive icon customization that breaks design consistency.
|
|
33
|
+
*
|
|
16
34
|
* @example Basic
|
|
17
35
|
* ```html
|
|
18
36
|
* <nys-icon name="check_circle"></nys-icon>
|
|
@@ -17,6 +17,19 @@ import "./nys-iconlistitem";
|
|
|
17
17
|
* its styling comes from `nys-iconlist.light.scss` adopted once onto
|
|
18
18
|
* `document.adoptedStyleSheets` rather than from a shadow-DOM stylesheet.
|
|
19
19
|
*
|
|
20
|
+
* @usagedos
|
|
21
|
+
* - Use an icon list to highlight key attributes, features, requirements, or metadata that help users quickly scan content.
|
|
22
|
+
* - Keep list items short and concise—ideally a single line of text or a brief phrase.
|
|
23
|
+
* - Limit the number of items shown (typically 3–5) to maintain scannability and keep the list from becoming overly dense.
|
|
24
|
+
* - Order items by importance, placing the most relevant information first.
|
|
25
|
+
* - Make sure icons add meaning and are not purely decorative. If all items use the same icon, consider whether a standard list would communicate the content just as effectively.
|
|
26
|
+
*
|
|
27
|
+
* @usagedonts
|
|
28
|
+
* - Use an icon list when the items represent steps in a process. Use the `<nys-stepper>` instead.
|
|
29
|
+
* - Use an icon list for long descriptions, complex instructions, or content that requires hierarchy. Use standard lists or body text instead.
|
|
30
|
+
* - Mix icon styles within a single list, which makes the list harder to scan.
|
|
31
|
+
* - Place interactive controls such as buttons inside list items.
|
|
32
|
+
*
|
|
20
33
|
* @example Basic
|
|
21
34
|
* ```html
|
|
22
35
|
* <nys-iconlist id="event-details">
|
|
@@ -105,8 +118,11 @@ export declare class NysIconlist extends NysElement {
|
|
|
105
118
|
private _childObserver;
|
|
106
119
|
private _warnedChildren;
|
|
107
120
|
createRenderRoot(): this;
|
|
121
|
+
private _firstUpdatePending;
|
|
122
|
+
protected scheduleUpdate(): Promise<void>;
|
|
108
123
|
connectedCallback(): void;
|
|
109
124
|
disconnectedCallback(): void;
|
|
125
|
+
firstUpdated(changedProperties: PropertyValues<this>): void;
|
|
110
126
|
updated(changedProperties: PropertyValues<this>): void;
|
|
111
127
|
private _syncInverted;
|
|
112
128
|
private _syncDividers;
|
|
@@ -41,6 +41,8 @@ import "@nysds/nys-icon";
|
|
|
41
41
|
* ```
|
|
42
42
|
*
|
|
43
43
|
* @slot description - Custom HTML description content below the label.
|
|
44
|
+
*
|
|
45
|
+
* @fires {Event} nys-label-click - Fired when the label is clicked. Bubbles and composed. Listened for by form components (for example nys-fileinput and nys-toggle) that need label-activation behavior.
|
|
44
46
|
*/
|
|
45
47
|
export declare class NysLabel extends LitElement {
|
|
46
48
|
static styles: import("lit").CSSResult;
|
|
@@ -57,7 +59,7 @@ export declare class NysLabel extends LitElement {
|
|
|
57
59
|
/** Tooltip text shown on hover/focus of info icon next to label. */
|
|
58
60
|
tooltip: string;
|
|
59
61
|
private _labelInternals;
|
|
60
|
-
get _hasDescription()
|
|
62
|
+
private get _hasDescription();
|
|
61
63
|
connectedCallback(): void;
|
|
62
64
|
updated(): void;
|
|
63
65
|
/**
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { NysElement } from "@nysds/internals";
|
|
2
2
|
import "@nysds/nys-button";
|
|
3
|
+
/** Detail payload for the `nys-open` event fired by `nys-modal`. */
|
|
4
|
+
export interface NysModalOpenDetail {
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
/** The `nys-open` event fired by `nys-modal`. */
|
|
8
|
+
export type NysModalOpenEvent = CustomEvent<NysModalOpenDetail>;
|
|
9
|
+
/** Detail payload for the `nys-close` event fired by `nys-modal`. */
|
|
10
|
+
export interface NysModalCloseDetail {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
/** The `nys-close` event fired by `nys-modal`. */
|
|
14
|
+
export type NysModalCloseEvent = CustomEvent<NysModalCloseDetail>;
|
|
3
15
|
/**
|
|
4
16
|
* An accessible modal dialog with focus trapping, keyboard navigation, and scroll management.
|
|
5
17
|
*
|
|
@@ -12,8 +24,20 @@ import "@nysds/nys-button";
|
|
|
12
24
|
* @slot - Default slot for body content.
|
|
13
25
|
* @slot actions - Action buttons displayed in footer. Buttons auto-resize on mobile.
|
|
14
26
|
*
|
|
15
|
-
* @fires nys-open - Fired when modal opens. Detail: `{id}`.
|
|
16
|
-
* @fires nys-close - Fired when modal closes. Detail: `{id}`.
|
|
27
|
+
* @fires {NysModalOpenEvent} nys-open - Fired when modal opens. Detail: `{id}`.
|
|
28
|
+
* @fires {NysModalCloseEvent} nys-close - Fired when modal closes. Detail: `{id}`.
|
|
29
|
+
*
|
|
30
|
+
* @usagedos
|
|
31
|
+
* - Use to confirm important actions, present focused forms (e.g., login, feedback), or require acknowledgment of alerts without navigating away from the page.
|
|
32
|
+
* - Keep content short and focused. Use a dedicated page for long or complex content.
|
|
33
|
+
* - Keep the `subheading` short and use `<p>` tags within the modal for longer information.
|
|
34
|
+
* - Use the `mandatory` prop to disable the dismiss button only when the user must make a critical decision or acknowledge essential information.
|
|
35
|
+
*
|
|
36
|
+
* @usagedonts
|
|
37
|
+
* - Stack multiple modals.
|
|
38
|
+
* - Use for trivial information or inline status messages. Use `<nys-alert>` instead.
|
|
39
|
+
* - Use for quick hints on form fields. Use `<nys-tooltip>` instead.
|
|
40
|
+
* - Force the `mandatory` prop unnecessarily.
|
|
17
41
|
*
|
|
18
42
|
* @example Basic
|
|
19
43
|
* ```html
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { TemplateResult } from "lit";
|
|
2
2
|
import { NysElement } from "@nysds/internals";
|
|
3
3
|
import "@nysds/nys-button";
|
|
4
|
+
/** Detail payload for the `nys-change` event fired by `nys-pagination`. */
|
|
5
|
+
export interface NysPaginationChangeDetail {
|
|
6
|
+
page: number;
|
|
7
|
+
}
|
|
8
|
+
/** The `nys-change` event fired by `nys-pagination`. */
|
|
9
|
+
export type NysPaginationChangeEvent = CustomEvent<NysPaginationChangeDetail>;
|
|
4
10
|
/**
|
|
5
11
|
* Page navigation with Previous/Next buttons and numbered page links. Auto-collapses with ellipses for many pages.
|
|
6
12
|
*
|
|
@@ -20,7 +26,20 @@ import "@nysds/nys-button";
|
|
|
20
26
|
* @summary Page navigation with numbered links, prev/next buttons, and responsive layout.
|
|
21
27
|
* @element nys-pagination
|
|
22
28
|
*
|
|
23
|
-
* @fires nys-change - Fired when page changes. Detail: `{page}`.
|
|
29
|
+
* @fires {NysPaginationChangeEvent} nys-change - Fired when page changes. Detail: `{page}`.
|
|
30
|
+
*
|
|
31
|
+
* @usagedos
|
|
32
|
+
* - Use for large result sets such as search results, data tables, or directory listings where loading everything at once would hurt performance or usability.
|
|
33
|
+
* - Use when users need to navigate to a specific part of a result set.
|
|
34
|
+
* - Set `totalPages` based on your data set and page size; update `currentPage` in response to `nys-change` events.
|
|
35
|
+
* - Don't set `currentPage` to a value greater than `totalPages`. The component clamps the value automatically, but your application logic should prevent this.
|
|
36
|
+
* - Position the pagination component below the content it controls.
|
|
37
|
+
* - Scroll users to the top of the results area when they change pages.
|
|
38
|
+
*
|
|
39
|
+
* @usagedonts
|
|
40
|
+
* - Use when content fits on a single page (fewer than 3–4 screen heights). Show all items instead.
|
|
41
|
+
* - Use for step-based workflows where users complete tasks in order. Use `<nys-stepper>` instead.
|
|
42
|
+
* - Use for infinite-scroll patterns such as a news feed.
|
|
24
43
|
*
|
|
25
44
|
* @example Basic
|
|
26
45
|
* ```html
|
|
@@ -47,7 +66,7 @@ export declare class NysPagination extends NysElement {
|
|
|
47
66
|
currentPage: number;
|
|
48
67
|
/** Total number of pages. Must be at least 1. */
|
|
49
68
|
totalPages: number;
|
|
50
|
-
/** Internal state for
|
|
69
|
+
/** Internal layout coordination state reflected for styling. Not public API. @internal */
|
|
51
70
|
_twoBeforeLast: boolean;
|
|
52
71
|
/**
|
|
53
72
|
* Logical identity of the control that held focus when this update was scheduled,
|
|
@@ -23,6 +23,19 @@ import "./nys-processlistitem";
|
|
|
23
23
|
* `aria-describedby` for supporting copy such as an intro paragraph. Because the host renders
|
|
24
24
|
* in the light DOM, these native attributes work with zero component code.
|
|
25
25
|
*
|
|
26
|
+
* @usagedos
|
|
27
|
+
* - Use a process list to explain a sequence of steps a user will take, such as how to apply for a benefit or renew a license.
|
|
28
|
+
* - Keep step labels short and action-oriented, and put supporting detail in the `description`.
|
|
29
|
+
* - Give the list an accessible name with `aria-labelledby` or `aria-label` so its purpose is clear.
|
|
30
|
+
* - Use `initialstep` to continue the numbering when one process is split across multiple lists.
|
|
31
|
+
* - Keep styling consistent across all process lists on the same page.
|
|
32
|
+
*
|
|
33
|
+
* @usagedonts
|
|
34
|
+
* - Use a process list to show a user's progress through a multi-step form. Use the [Stepper](/components/stepper/) instead.
|
|
35
|
+
* - Use a process list for items with no inherent order. Use the [Icon List](/components/iconlist/) or a standard list instead.
|
|
36
|
+
* - Number the steps yourself in the `label`. The list owns the numbering.
|
|
37
|
+
* - Place interactive controls such as buttons inside a step.
|
|
38
|
+
*
|
|
26
39
|
* @example Basic
|
|
27
40
|
* ```html
|
|
28
41
|
* <nys-processlist id="application-steps">
|
|
@@ -177,8 +190,11 @@ export declare class NysProcesslist extends NysElement {
|
|
|
177
190
|
private _childObserver;
|
|
178
191
|
private _warnedChildren;
|
|
179
192
|
createRenderRoot(): this;
|
|
193
|
+
private _firstUpdatePending;
|
|
194
|
+
protected scheduleUpdate(): Promise<void>;
|
|
180
195
|
connectedCallback(): void;
|
|
181
196
|
disconnectedCallback(): void;
|
|
197
|
+
firstUpdated(changedProperties: PropertyValues): void;
|
|
182
198
|
updated(changedProperties: PropertyValues): void;
|
|
183
199
|
private _syncSteps;
|
|
184
200
|
}
|
|
@@ -30,7 +30,7 @@ export declare class NysProcesslistitem extends NysElement {
|
|
|
30
30
|
* A description is shown when either the property or the slot has content, so an item with
|
|
31
31
|
* neither renders no empty paragraph.
|
|
32
32
|
*/
|
|
33
|
-
get _hasDescription()
|
|
33
|
+
private get _hasDescription();
|
|
34
34
|
/**
|
|
35
35
|
* Sets the rendered step number.
|
|
36
36
|
* @internal Called by `<nys-processlist>`; not intended for direct use.
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { NysFormControlElement } from "@nysds/internals";
|
|
2
2
|
import "@nysds/nys-label";
|
|
3
|
+
/** Detail payload for the `nys-change` event fired by `nys-radiobutton`. */
|
|
4
|
+
export interface NysRadiobuttonChangeDetail {
|
|
5
|
+
id: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
/** The `nys-change` event fired by `nys-radiobutton`. */
|
|
11
|
+
export type NysRadiobuttonChangeEvent = CustomEvent<NysRadiobuttonChangeDetail>;
|
|
3
12
|
/**
|
|
4
13
|
* A radio button for single selection within a `nys-radiogroup`. Only one radio with the same `name` can be selected.
|
|
5
14
|
*
|
|
@@ -12,14 +21,28 @@ import "@nysds/nys-label";
|
|
|
12
21
|
* Since we can't do that naturally, we have supporting functions to keep track of keyboard navigation, a11y VO, and single radiobutton checked at all times.
|
|
13
22
|
*
|
|
14
23
|
* @element nys-radiobutton
|
|
24
|
+
* @formControl checked nys-change
|
|
15
25
|
*
|
|
16
26
|
* @slot description - Custom HTML description content.
|
|
17
27
|
*
|
|
18
|
-
* @fires nys-change - Fired when selection changes. Detail: `{id, checked, name, value}`.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
28
|
+
* @fires {NysRadiobuttonChangeEvent} nys-change - Fired when the selection changes. Detail: `{id, checked, name, value}`. Bubbles and composed.
|
|
29
|
+
*
|
|
30
|
+
* Standalone radios (outside a `nys-radiogroup`) render their own native input
|
|
31
|
+
* and dispatch `nys-change` themselves. Inside a `nys-radiogroup` the group
|
|
32
|
+
* renders the inputs and owns the form contract: `nys-focus` and `nys-blur`
|
|
33
|
+
* arrive re-targeted from the group, and `nys-other-input` fires on the group.
|
|
34
|
+
*
|
|
35
|
+
* @usagedos
|
|
36
|
+
* - Use when a user needs to select only one option from a list of 7 or fewer choices.
|
|
37
|
+
* - Always wrap a group of `<nys-radiobutton>` with a `<nys-radiogroup>`.
|
|
38
|
+
* - Group radio buttons vertically for easier scanning, especially when labels are lengthy.
|
|
39
|
+
* - Set a clear default when one choice is recommended or most common. Don't leave all options unselected if a helpful default can guide users.
|
|
40
|
+
* - Use concise, descriptive labels for each option.
|
|
22
41
|
*
|
|
42
|
+
* @usagedonts
|
|
43
|
+
* - Use when users need to select multiple options. Use checkboxes instead.
|
|
44
|
+
* - Use when there are more than 7 options. Use a dropdown for better space utilization.
|
|
45
|
+
* - Use for yes/no questions. Consider `<nys-toggle>` or `<nys-checkbox>` instead.
|
|
23
46
|
*
|
|
24
47
|
* @example Pre-selected
|
|
25
48
|
* ```html
|
|
@@ -46,7 +69,6 @@ import "@nysds/nys-label";
|
|
|
46
69
|
* </nys-radiogroup>
|
|
47
70
|
* ```
|
|
48
71
|
*
|
|
49
|
-
* /**
|
|
50
72
|
* @example Standalone, one per table row
|
|
51
73
|
* ```html
|
|
52
74
|
* <nys-table striped bordered>
|
|
@@ -183,6 +205,8 @@ export declare class NysRadiobutton extends NysFormControlElement {
|
|
|
183
205
|
* --------------------------------------------------------------------------
|
|
184
206
|
*/
|
|
185
207
|
protected createRenderRoot(): this;
|
|
208
|
+
private _firstUpdatePending;
|
|
209
|
+
protected scheduleUpdate(): Promise<void>;
|
|
186
210
|
connectedCallback(): void;
|
|
187
211
|
disconnectedCallback(): void;
|
|
188
212
|
firstUpdated(): void;
|
|
@@ -2,6 +2,29 @@ import { NysFormControlElement } from "@nysds/internals";
|
|
|
2
2
|
import "@nysds/nys-label";
|
|
3
3
|
import "@nysds/nys-errormessage";
|
|
4
4
|
import "@nysds/nys-textinput";
|
|
5
|
+
/** Detail payload for the `nys-change` event fired by `nys-radiogroup`. */
|
|
6
|
+
export interface NysRadiogroupChangeDetail {
|
|
7
|
+
/** Id of the selected child radiobutton (kept for 1.x compatibility). */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Checked state of the selected child radiobutton (always `true`). */
|
|
10
|
+
checked: boolean;
|
|
11
|
+
/** Name of the selected child radiobutton, which the group adopts. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** The group's selected value. */
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
/** The `nys-change` event fired by `nys-radiogroup`. */
|
|
17
|
+
export type NysRadiogroupChangeEvent = CustomEvent<NysRadiogroupChangeDetail>;
|
|
18
|
+
/** Detail payload for the `nys-other-input` event fired by `nys-radiogroup`. */
|
|
19
|
+
export interface NysRadiogroupOtherInputDetail {
|
|
20
|
+
/** Id of the "other" child radiobutton. */
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
/** Current text of the "other" free-text field. */
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
26
|
+
/** The `nys-other-input` event fired by `nys-radiogroup`. */
|
|
27
|
+
export type NysRadiogroupOtherInputEvent = CustomEvent<NysRadiogroupOtherInputDetail>;
|
|
5
28
|
/**
|
|
6
29
|
* A container for grouping `nys-radiobutton` elements as a single form control with enforced single selection.
|
|
7
30
|
* Handles keyboard navigation (arrow keys), validation, required constraints, and form integration.
|
|
@@ -11,10 +34,16 @@ import "@nysds/nys-textinput";
|
|
|
11
34
|
*
|
|
12
35
|
* @summary Container for grouping radio buttons as a single form control.
|
|
13
36
|
* @element nys-radiogroup
|
|
37
|
+
* @formControl value nys-change
|
|
14
38
|
*
|
|
15
39
|
* @slot - Default slot for `nys-radiobutton` elements.
|
|
16
40
|
* @slot description - Custom HTML description content.
|
|
17
41
|
*
|
|
42
|
+
* @fires {NysRadiogroupChangeEvent} nys-change - Fired when the selection changes. Detail: `{id, checked, name, value}` — `value` is the selected value; `id`, `checked`, and `name` echo the selected child radio for compatibility. Bubbles and composed.
|
|
43
|
+
* @fires {NysRadiogroupOtherInputEvent} nys-other-input - Fired as the "other" free-text input changes. Detail: `{id, name, value}`. Bubbles and composed.
|
|
44
|
+
* @fires {Event} nys-focus - Fired on the group when focus enters it from outside; also re-dispatched targeted at the focused child radio for compatibility. Bubbles and composed.
|
|
45
|
+
* @fires {Event} nys-blur - Fired on the group when focus leaves it; also re-dispatched targeted at the blurred child radio for compatibility. Bubbles and composed.
|
|
46
|
+
*
|
|
18
47
|
* @example Basic
|
|
19
48
|
* ```html
|
|
20
49
|
* <nys-radiogroup label="Select borough" required>
|
|
@@ -138,8 +167,16 @@ export declare class NysRadiogroup extends NysFormControlElement {
|
|
|
138
167
|
* @default "md"
|
|
139
168
|
*/
|
|
140
169
|
size: "sm" | "md";
|
|
141
|
-
_showOtherError
|
|
142
|
-
private
|
|
170
|
+
private _showOtherError;
|
|
171
|
+
private _value;
|
|
172
|
+
private _syncingValueFromChildren;
|
|
173
|
+
/**
|
|
174
|
+
* Value of the selected child radiobutton, or `""` when none is selected.
|
|
175
|
+
* Setting it programmatically checks the matching child and updates the
|
|
176
|
+
* form value without firing `nys-change`. Setting `""` clears the selection.
|
|
177
|
+
*/
|
|
178
|
+
get value(): string;
|
|
179
|
+
set value(next: string);
|
|
143
180
|
private _slottedDescriptionText;
|
|
144
181
|
private _radios;
|
|
145
182
|
private _mobileQuery;
|
|
@@ -163,10 +200,25 @@ export declare class NysRadiogroup extends NysFormControlElement {
|
|
|
163
200
|
* --------------------------------------------------------------------------
|
|
164
201
|
*/
|
|
165
202
|
private _setValue;
|
|
203
|
+
/**
|
|
204
|
+
* Set `value` from a child selection without pushing the same state back
|
|
205
|
+
* down (and without firing `nys-change`).
|
|
206
|
+
*/
|
|
207
|
+
private _setValueFromChild;
|
|
208
|
+
/**
|
|
209
|
+
* Apply a programmatically set `value` to the child radiobuttons and the
|
|
210
|
+
* form value. Setting `checked` on a child never fires `nys-change` (only
|
|
211
|
+
* user interaction does), so no change events echo back.
|
|
212
|
+
*/
|
|
213
|
+
private _applyValueToChildren;
|
|
214
|
+
/**
|
|
215
|
+
* Derive `value` from the currently checked child. Runs off the default
|
|
216
|
+
* slot's `slotchange`, so it covers first render and dynamically added
|
|
217
|
+
* radios without scheduling work inside the update cycle.
|
|
218
|
+
*/
|
|
219
|
+
private _syncValueFromChildren;
|
|
166
220
|
private _setRadioButtonRequire;
|
|
167
221
|
private _manageRequire;
|
|
168
|
-
checkValidity(): boolean;
|
|
169
|
-
private _initializeCheckedRadioValue;
|
|
170
222
|
private _getAllRadios;
|
|
171
223
|
private _handleKeyDown;
|
|
172
224
|
private _updateGroupTabIndex;
|
|
@@ -193,6 +245,16 @@ export declare class NysRadiogroup extends NysFormControlElement {
|
|
|
193
245
|
private _handleOtherKeydown;
|
|
194
246
|
private _handleGroupFocusout;
|
|
195
247
|
private _handleRadiobtnClick;
|
|
248
|
+
/** True when `node` is inside this group, including its shadow DOM. */
|
|
249
|
+
private _containsFocus;
|
|
250
|
+
/**
|
|
251
|
+
* Group-level focus: fired only when focus enters from outside the group,
|
|
252
|
+
* so moving between the radios stays silent. The per-radio `nys-focus`
|
|
253
|
+
* re-dispatches (targeted at the child) are kept for compatibility.
|
|
254
|
+
*/
|
|
255
|
+
private _handleHostFocusIn;
|
|
256
|
+
/** Group-level blur: fired only when focus leaves the group entirely. */
|
|
257
|
+
private _handleHostFocusOut;
|
|
196
258
|
private _handleRadiobtnFocus;
|
|
197
259
|
private _handleRadiobtnBlur;
|
|
198
260
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -2,6 +2,14 @@ import { NysFormControlElement } from "@nysds/internals";
|
|
|
2
2
|
import "@nysds/nys-label";
|
|
3
3
|
import "@nysds/nys-errormessage";
|
|
4
4
|
import "@nysds/nys-icon";
|
|
5
|
+
/** Detail payload for the `nys-change` event. */
|
|
6
|
+
export interface NysSelectChangeDetail {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
/** The `nys-change` event, fired when the selection changes. */
|
|
12
|
+
export type NysSelectChangeEvent = CustomEvent<NysSelectChangeDetail>;
|
|
5
13
|
/**
|
|
6
14
|
* A dropdown for selecting a single option from a list. Supports native `<option>` and `<optgroup>` elements.
|
|
7
15
|
* Form-associated with validation via ElementInternals.
|
|
@@ -15,9 +23,20 @@ import "@nysds/nys-icon";
|
|
|
15
23
|
* @slot - Default slot for `<option>` and `<optgroup>` elements.
|
|
16
24
|
* @slot description - Custom HTML description content below the label.
|
|
17
25
|
*
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
* @fires nys-
|
|
26
|
+
* @formControl value nys-change
|
|
27
|
+
*
|
|
28
|
+
* @fires {NysSelectChangeEvent} nys-change - Fired when the selection changes. Detail: `{id, name, value}`.
|
|
29
|
+
* @fires {Event} nys-focus - Fired when the select gains focus.
|
|
30
|
+
* @fires {Event} nys-blur - Fired when the select loses focus. Triggers validation.
|
|
31
|
+
*
|
|
32
|
+
* @usagedos
|
|
33
|
+
* - Use when a user needs to select a single item from a dropdown list.
|
|
34
|
+
* - Use the `<option>` element to define options and the native `<optgroup>` to group them.
|
|
35
|
+
*
|
|
36
|
+
* @usagedonts
|
|
37
|
+
* - Use when users need to select multiple items. Use a checkbox group instead.
|
|
38
|
+
* - Use the custom `<nys-option>` element. It will be deprecated in the 2.0 release.
|
|
39
|
+
* - Use `<nys-select multiple>`. Use a checkbox group instead.
|
|
21
40
|
*
|
|
22
41
|
* @example Basic
|
|
23
42
|
* ```html
|
|
@@ -212,7 +231,6 @@ export declare class NysSelect extends NysFormControlElement {
|
|
|
212
231
|
* @default "full"
|
|
213
232
|
*/
|
|
214
233
|
width: "sm" | "md" | "lg" | "full";
|
|
215
|
-
private _originalErrorMessage;
|
|
216
234
|
private _hasUserInteracted;
|
|
217
235
|
/**
|
|
218
236
|
* Lifecycle methods
|
|
@@ -8,6 +8,14 @@ import { NysElement } from "@nysds/internals";
|
|
|
8
8
|
* @summary Skip navigation link for keyboard accessibility. Hidden until focused.
|
|
9
9
|
* @element nys-skipnav
|
|
10
10
|
*
|
|
11
|
+
* @usagedos
|
|
12
|
+
* - Use on pages with a large header, navigation, or other repeated content before the main section.
|
|
13
|
+
* - Ensure the `href` on `<nys-skipnav>` matches the `id` of the main content container.
|
|
14
|
+
*
|
|
15
|
+
* @usagedonts
|
|
16
|
+
* - Use if your layout already starts with the main content and there is nothing to skip over.
|
|
17
|
+
* - Mismatch the `href` and target `id`.
|
|
18
|
+
*
|
|
11
19
|
* @example Basic
|
|
12
20
|
* ```html
|
|
13
21
|
* <nys-skipnav></nys-skipnav>
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { NysElement } from "@nysds/internals";
|
|
2
|
+
/** Detail payload for the `nys-step-click` event fired by `nys-step`. */
|
|
3
|
+
export interface NysStepClickDetail {
|
|
4
|
+
href: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/** The `nys-step-click` event fired by `nys-step`. */
|
|
8
|
+
export type NysStepClickEvent = CustomEvent<NysStepClickDetail>;
|
|
2
9
|
/**
|
|
3
10
|
* A single step within `nys-stepper`. Represents one stage in a multi-step process.
|
|
4
11
|
*
|
|
@@ -79,7 +86,7 @@ import { NysElement } from "@nysds/internals";
|
|
|
79
86
|
* @summary Individual step for use within nys-stepper with navigation support.
|
|
80
87
|
* @element nys-step
|
|
81
88
|
*
|
|
82
|
-
* @fires nys-step-click - Fired when a navigable (`previous` or `current`) non-selected step is clicked
|
|
89
|
+
* @fires {NysStepClickEvent} nys-step-click - Fired when a navigable (`previous` or `current`) non-selected step is clicked
|
|
83
90
|
* or activated by keyboard. Detail: `{ href: string, label: string }`. Cancelable — call
|
|
84
91
|
* `e.preventDefault()` to suppress `window.location.href` navigation.
|
|
85
92
|
*/
|
|
@@ -52,6 +52,14 @@ import "./nys-step";
|
|
|
52
52
|
* @slot - Default slot for `nys-step` elements. Only `nys-step` children are accepted; others are removed.
|
|
53
53
|
* @slot actions - Persistent navigation buttons. Must contain exactly one `<div>` wrapping only `<nys-button>` elements.
|
|
54
54
|
*
|
|
55
|
+
* @usagedos
|
|
56
|
+
* - Use for linear, ordered forms with more than 2 sections to show progress through a multi-step process.
|
|
57
|
+
* - Ensure users can navigate back to previous steps to review or change information.
|
|
58
|
+
*
|
|
59
|
+
* @usagedonts
|
|
60
|
+
* - Use when a form has only 1 or 2 sections.
|
|
61
|
+
* - Use for forms that are nonlinear and can be completed in any order.
|
|
62
|
+
*
|
|
55
63
|
* @example Basic
|
|
56
64
|
* ```html
|
|
57
65
|
* <div class="nys-grid-row">
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { NysElement } from "@nysds/internals";
|
|
2
|
+
/** Detail payload for the `nys-tab-select` event fired by `nys-tab`. */
|
|
3
|
+
export interface NysTabSelectDetail {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/** The `nys-tab-select` event fired by `nys-tab`. */
|
|
8
|
+
export type NysTabSelectEvent = CustomEvent<NysTabSelectDetail>;
|
|
9
|
+
/** Detail payload for the `nys-tab-focus` event fired by `nys-tab`. */
|
|
10
|
+
export interface NysTabFocusDetail {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
/** The `nys-tab-focus` event fired by `nys-tab`. */
|
|
14
|
+
export type NysTabFocusEvent = CustomEvent<NysTabFocusDetail>;
|
|
15
|
+
/** Detail payload for the `nys-tab-blur` event fired by `nys-tab`. */
|
|
16
|
+
export interface NysTabBlurDetail {
|
|
17
|
+
id: string;
|
|
18
|
+
}
|
|
19
|
+
/** The `nys-tab-blur` event fired by `nys-tab`. */
|
|
20
|
+
export type NysTabBlurEvent = CustomEvent<NysTabBlurDetail>;
|
|
2
21
|
/**
|
|
3
22
|
* `<nys-tab>` is a single tab within a `<nys-tabgroup>`.
|
|
4
23
|
*
|
|
@@ -10,12 +29,12 @@ import { NysElement } from "@nysds/internals";
|
|
|
10
29
|
*
|
|
11
30
|
* @element nys-tab
|
|
12
31
|
*
|
|
13
|
-
* @fires nys-tab-select - Dispatched when the tab is activated via click or
|
|
32
|
+
* @fires {NysTabSelectEvent} nys-tab-select - Dispatched when the tab is activated via click or
|
|
14
33
|
* Enter / Space. Bubbles and crosses shadow DOM boundaries.
|
|
15
34
|
* `detail: { id: string, label: string }`
|
|
16
|
-
* @fires nys-tab-focus - Dispatched when the host receives focus. Bubbles and
|
|
35
|
+
* @fires {NysTabFocusEvent} nys-tab-focus - Dispatched when the host receives focus. Bubbles and
|
|
17
36
|
* crosses shadow DOM boundaries. `detail: { id: string }`
|
|
18
|
-
* @fires nys-tab-blur - Dispatched when the host loses focus. Bubbles and
|
|
37
|
+
* @fires {NysTabBlurEvent} nys-tab-blur - Dispatched when the host loses focus. Bubbles and
|
|
19
38
|
* crosses shadow DOM boundaries. `detail: { id: string }`
|
|
20
39
|
*
|
|
21
40
|
* @slot - No slots; content is derived from the `label` property.
|
|
@@ -25,6 +25,18 @@ import { NysElement } from "@nysds/internals";
|
|
|
25
25
|
* tablist and panel containers; they stay in the light DOM. Any other
|
|
26
26
|
* children remain in the default slot, rendered below the panels.
|
|
27
27
|
*
|
|
28
|
+
* @usagedos
|
|
29
|
+
* - Use to organize related content into distinct sections within the same context (e.g., Overview, Specs, Reviews), especially when a page would otherwise be overwhelmingly long.
|
|
30
|
+
* - Keep tab labels short and clear, limited to 2–9 tabs and one row. Avoid wrapping.
|
|
31
|
+
* - Only one tab should ever be in the active state.
|
|
32
|
+
*
|
|
33
|
+
* @usagedonts
|
|
34
|
+
* - Use when users need to compare information across sections simultaneously. Tabs require clicking back and forth.
|
|
35
|
+
* - Use for linear, step-by-step processes. Use a stepper instead.
|
|
36
|
+
* - Use when you only have two small pieces of content. Display them consecutively instead.
|
|
37
|
+
* - Nest tabs inside other tabs.
|
|
38
|
+
* - Use tabs for page navigation.
|
|
39
|
+
*
|
|
28
40
|
* @example Basic
|
|
29
41
|
* ```html
|
|
30
42
|
* <nys-tabgroup>
|
|
@@ -17,6 +17,8 @@ import { NysElement } from "@nysds/internals";
|
|
|
17
17
|
*
|
|
18
18
|
* @element nys-tabpanel
|
|
19
19
|
*
|
|
20
|
+
* @cssprop [--nys-tabpanel-max-height] - Maximum height of the tab panel content area.
|
|
21
|
+
*
|
|
20
22
|
* @slot - Default slot for panel content. Rendered directly under the host,
|
|
21
23
|
* which is the scrollable, focusable (`tabindex="0"`) `role="tabpanel"`
|
|
22
24
|
* region.
|