@nysds/components 1.20.0-alpha-3 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +9101 -5385
- package/dist/.vscode/vscode.css-custom-data.json +5 -0
- package/dist/.vscode/vscode.html-custom-data.json +332 -30
- package/dist/custom-elements.json +9101 -5385
- package/dist/nys-icon.library-Bu3noJqZ-1mvg_e5Y.js +706 -0
- package/dist/nys-icon.library-Bu3noJqZ-1mvg_e5Y.js.map +1 -0
- package/dist/nys-icon.library-eNVZmfkf.js +696 -0
- package/dist/nys-icon.library-eNVZmfkf.js.map +1 -0
- package/dist/nysds.es.js +10460 -5393
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +2436 -472
- package/dist/nysds.js.map +1 -1
- package/dist/packages/internals/src/aria-associate.d.ts +41 -0
- package/dist/packages/internals/src/form-control-mixin.d.ts +34 -0
- package/dist/packages/internals/src/id.d.ts +8 -0
- package/dist/packages/internals/src/identified-mixin.d.ts +23 -0
- package/dist/packages/internals/src/index.d.ts +7 -0
- package/dist/packages/internals/src/reflects-aria-mixin.d.ts +33 -0
- package/dist/packages/internals/src/test-helpers.d.ts +29 -0
- package/dist/packages/internals/src/types.d.ts +9 -0
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +72 -10
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +63 -8
- package/dist/packages/nys-alert/src/nys-alert.d.ts +95 -20
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +100 -7
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +75 -5
- package/dist/packages/nys-badge/src/nys-badge.d.ts +63 -6
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +79 -10
- package/dist/packages/nys-button/src/nys-button.d.ts +132 -26
- package/dist/packages/nys-card/src/index.d.ts +1 -0
- package/dist/packages/nys-card/src/nys-card.d.ts +325 -0
- package/dist/packages/nys-card/src/nys-card.figma.d.ts +1 -0
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +36 -12
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +81 -6
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +174 -5
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +83 -13
- package/dist/packages/nys-divider/src/nys-divider.d.ts +33 -9
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +24 -15
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +3 -12
- package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +22 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +101 -12
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +23 -2
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +99 -9
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +189 -6
- package/dist/packages/nys-icon/src/icon-cache.d.ts +11 -4
- package/dist/packages/nys-icon/src/icon-library-registry.d.ts +33 -16
- package/dist/packages/nys-icon/src/index.d.ts +2 -2
- package/dist/packages/nys-icon/src/nys-icon.d.ts +98 -8
- package/dist/packages/nys-iconlist/src/index.d.ts +2 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.d.ts +92 -0
- package/dist/packages/nys-iconlist/src/nys-iconlist.figma.d.ts +1 -0
- package/dist/packages/nys-iconlist/src/nys-iconlistitem.d.ts +32 -0
- package/dist/packages/nys-label/src/nys-label.d.ts +37 -2
- package/dist/packages/nys-modal/src/nys-modal.d.ts +145 -13
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +67 -3
- package/dist/packages/nys-processlist/src/index.d.ts +2 -0
- package/dist/packages/nys-processlist/src/nys-processlist.d.ts +184 -0
- package/dist/packages/nys-processlist/src/nys-processlist.figma.d.ts +1 -0
- package/dist/packages/nys-processlist/src/nys-processlistitem.d.ts +41 -0
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +201 -7
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +88 -6
- package/dist/packages/nys-select/src/nys-option.d.ts +0 -8
- package/dist/packages/nys-select/src/nys-select.d.ts +150 -15
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +4 -4
- package/dist/packages/nys-stepper/src/nys-step.d.ts +26 -20
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +128 -75
- package/dist/packages/nys-tab/src/nys-tab.d.ts +19 -10
- package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +181 -39
- package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +15 -24
- package/dist/packages/nys-table/src/nys-table.d.ts +90 -3
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +60 -10
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +77 -14
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +47 -10
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +48 -8
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +45 -4
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +216 -11
- package/dist/packages/nys-verticalnav/src/index.d.ts +2 -0
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +572 -0
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.figma.d.ts +1 -0
- package/dist/packages/nys-verticalnav/src/nys-verticalnavgroup.d.ts +24 -0
- package/dist/packages/nys-video/src/nys-video.d.ts +67 -7
- package/dist/src/index.d.ts +6 -2
- package/package.json +11 -6
- package/packages/react/NysAccordion.d.ts +10 -0
- package/packages/react/NysAccordion.js +2 -1
- package/packages/react/NysAccordionItem.d.ts +10 -0
- package/packages/react/NysAccordionItem.js +3 -1
- package/packages/react/NysAlert.d.ts +8 -10
- package/packages/react/NysAlert.js +0 -2
- package/packages/react/NysAvatar.d.ts +11 -1
- package/packages/react/NysBacktotop.d.ts +3 -0
- package/packages/react/NysBacktotop.js +2 -1
- package/packages/react/NysBreadcrumbs.d.ts +2 -2
- package/packages/react/NysButton.d.ts +38 -8
- package/packages/react/NysButton.js +6 -4
- package/packages/react/NysCard.d.ts +110 -0
- package/packages/react/NysCard.js +61 -0
- package/packages/react/NysCheckbox.d.ts +9 -0
- package/packages/react/NysCheckbox.js +4 -0
- package/packages/react/NysDropdownMenu.d.ts +4 -2
- package/packages/react/NysFileinput.d.ts +2 -2
- package/packages/react/NysGlobalFooter.d.ts +17 -0
- package/packages/react/NysGlobalFooter.js +10 -2
- package/packages/react/NysGlobalHeader.d.ts +17 -0
- package/packages/react/NysGlobalHeader.js +11 -2
- package/packages/react/NysIconlist.d.ts +54 -0
- package/packages/react/NysIconlist.js +22 -0
- package/packages/react/NysIconlistitem.d.ts +59 -0
- package/packages/react/NysIconlistitem.js +22 -0
- package/packages/react/NysLabel.d.ts +4 -1
- package/packages/react/NysModal.d.ts +8 -1
- package/packages/react/NysModal.js +11 -2
- package/packages/react/NysProcesslist.d.ts +65 -0
- package/packages/react/NysProcesslist.js +25 -0
- package/packages/react/NysProcesslistitem.d.ts +61 -0
- package/packages/react/NysProcesslistitem.js +35 -0
- package/packages/react/NysRadiobutton.d.ts +27 -3
- package/packages/react/NysRadiobutton.js +9 -1
- package/packages/react/NysSelect.d.ts +3 -0
- package/packages/react/NysSelect.js +2 -0
- package/packages/react/NysStepper.d.ts +1 -1
- package/packages/react/NysTabgroup.d.ts +5 -4
- package/packages/react/NysTable.d.ts +1 -1
- package/packages/react/NysTabpanel.d.ts +11 -4
- package/packages/react/NysTextarea.d.ts +4 -1
- package/packages/react/NysTextarea.js +2 -0
- package/packages/react/NysUnavFooter.d.ts +13 -0
- package/packages/react/NysUnavFooter.js +4 -1
- package/packages/react/NysUnavHeader.d.ts +24 -1
- package/packages/react/NysUnavHeader.js +17 -1
- package/packages/react/NysVerticalnav.d.ts +67 -0
- package/packages/react/NysVerticalnav.js +26 -0
- package/packages/react/NysVerticalnavGroup.d.ts +76 -0
- package/packages/react/NysVerticalnavGroup.js +43 -0
- package/packages/react/index.d.ts +7 -0
- package/packages/react/index.js +7 -0
- package/packages/react/nysds-jsx.d.ts +404 -46
|
@@ -1,30 +1,100 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type PropertyValues } from "lit";
|
|
2
|
+
import { NysElement } from "@nysds/internals";
|
|
3
|
+
import "@nysds/nys-icon";
|
|
2
4
|
/**
|
|
3
5
|
* Displays a user representation as image, initials, or icon with automatic fallback chain.
|
|
4
6
|
*
|
|
5
7
|
* Priority: `image` > `initials` > `icon` > default icon. Set `color` to customize background;
|
|
6
8
|
* foreground auto-adjusts for contrast. Use `interactive` for clickable avatars (e.g., profile menus).
|
|
7
9
|
*
|
|
10
|
+
* An avatar with no `ariaLabel` is treated as decorative and hidden from assistive
|
|
11
|
+
* tech — correct beside a visible name, wrong for an `interactive` avatar, which
|
|
12
|
+
* renders a `<button>` and warns in the console when left nameless.
|
|
13
|
+
*
|
|
8
14
|
* @summary User avatar with image, initials, or icon fallback and contrast-aware colors.
|
|
9
15
|
* @element nys-avatar
|
|
10
16
|
*
|
|
11
17
|
* @slot - Custom icon content. Overrides default icon when no image or initials.
|
|
12
18
|
*
|
|
13
|
-
* @example
|
|
19
|
+
* @example Basic
|
|
20
|
+
* ```html
|
|
21
|
+
* <nys-avatar ariaLabel="User avatar"></nys-avatar>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example Image
|
|
25
|
+
* ```html
|
|
26
|
+
* <nys-avatar
|
|
27
|
+
* image="path/to/img.png"
|
|
28
|
+
* ariaLabel="Jane Smith"
|
|
29
|
+
* ></nys-avatar>
|
|
30
|
+
* ```
|
|
31
|
+
* @render Image
|
|
32
|
+
* ```html
|
|
33
|
+
* <nys-avatar
|
|
34
|
+
* image="https://images.unsplash.com/photo-1523712999610-f77fbcfc3843?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
|
35
|
+
* ariaLabel="Jane Smith"
|
|
36
|
+
* ></nys-avatar>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example Initials
|
|
14
40
|
* ```html
|
|
15
|
-
* <nys-avatar
|
|
41
|
+
* <nys-avatar initials="JS" ariaLabel="Jane Smith"></nys-avatar>
|
|
16
42
|
* ```
|
|
17
43
|
*
|
|
18
|
-
* @example
|
|
44
|
+
* @example Icon
|
|
19
45
|
* ```html
|
|
20
|
-
* <nys-avatar
|
|
46
|
+
* <nys-avatar icon="account_circle"></nys-avatar>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Interactive
|
|
50
|
+
* ```html
|
|
51
|
+
* <!-- Interactive renders a <button>, so it always needs a name. -->
|
|
52
|
+
* <nys-avatar interactive ariaLabel="Open account menu"></nys-avatar>
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example Decorative
|
|
56
|
+
* ```html
|
|
57
|
+
* <!-- No ariaLabel: hidden from assistive tech, for use beside a visible name. -->
|
|
58
|
+
* <nys-avatar initials="JS"></nys-avatar>
|
|
59
|
+
* <span>Jane Smith</span>
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @example Disabled
|
|
63
|
+
* ```html
|
|
64
|
+
* <nys-avatar disabled></nys-avatar>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example Custom Background Color
|
|
68
|
+
* ```html
|
|
69
|
+
* <nys-avatar
|
|
70
|
+
* color="var(--nys-color-red-500)"
|
|
71
|
+
* interactive
|
|
72
|
+
* ariaLabel="Open account menu"
|
|
73
|
+
* ></nys-avatar>
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example Lazy Loading
|
|
77
|
+
* ```html
|
|
78
|
+
* <nys-avatar lazy></nys-avatar>
|
|
21
79
|
* ```
|
|
22
80
|
*/
|
|
23
|
-
export declare class NysAvatar extends
|
|
81
|
+
export declare class NysAvatar extends NysElement {
|
|
24
82
|
static styles: import("lit").CSSResult;
|
|
25
83
|
/** Unique identifier. Auto-generated if not provided. */
|
|
26
84
|
id: string;
|
|
27
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Accessible name for the avatar — who or what it represents ("Jane Smith"),
|
|
87
|
+
* not what it is ("avatar").
|
|
88
|
+
*
|
|
89
|
+
* Leave it unset for a decorative avatar and the whole thing is hidden from
|
|
90
|
+
* assistive tech, which is the right outcome next to a visible name. Set it
|
|
91
|
+
* whenever the avatar is the only thing identifying the person, and always when
|
|
92
|
+
* `interactive` is set: that renders a `<button>`, and a nameless button cannot
|
|
93
|
+
* be operated by screen reader or voice-control users (WCAG 4.1.2). An
|
|
94
|
+
* interactive avatar without a name logs a console warning.
|
|
95
|
+
*
|
|
96
|
+
* Whitespace-only values — including a non-breaking space — count as no name.
|
|
97
|
+
*/
|
|
28
98
|
ariaLabel: string;
|
|
29
99
|
/** Image URL. Takes priority over initials and icon. */
|
|
30
100
|
image: string;
|
|
@@ -46,12 +116,35 @@ export declare class NysAvatar extends LitElement {
|
|
|
46
116
|
* --------------------------------------------------------------------------
|
|
47
117
|
*/
|
|
48
118
|
connectedCallback(): void;
|
|
119
|
+
updated(changedProperties: PropertyValues): void;
|
|
49
120
|
private _handleSlotChange;
|
|
50
121
|
/**
|
|
51
122
|
* Functions
|
|
52
123
|
* --------------------------------------------------------------------------
|
|
53
124
|
*/
|
|
125
|
+
/**
|
|
126
|
+
* The label with all whitespace — including the non-breaking space consumers
|
|
127
|
+
* reach for when they want "no label but the prop is required" — collapsed and
|
|
128
|
+
* trimmed. A name made only of blank characters is announced as an empty name,
|
|
129
|
+
* so `" "` and `" "` must resolve to no label at all rather than to a
|
|
130
|
+
* label the user can neither hear nor act on.
|
|
131
|
+
*/
|
|
54
132
|
private get _cleanAriaLabel();
|
|
133
|
+
/** One warning per gap, so a re-rendering avatar cannot flood the console. */
|
|
134
|
+
private _warnedMissingName;
|
|
135
|
+
/**
|
|
136
|
+
* Warns when an interactive avatar has no accessible name.
|
|
137
|
+
*
|
|
138
|
+
* An interactive avatar renders a `<button>`, and a button with no name is
|
|
139
|
+
* unusable by screen reader and voice-control users (WCAG 4.1.2). The component
|
|
140
|
+
* used to paper over this with a captive default name of "Avatar", which told
|
|
141
|
+
* the user nothing ("button, avatar") and hid the mistake from audits (#1093).
|
|
142
|
+
* The name is the author's to supply, so the component surfaces the gap here
|
|
143
|
+
* instead of inventing one. `ariaLabel` deliberately stays optional —
|
|
144
|
+
* decorative avatars are legitimate, and making it required would break the
|
|
145
|
+
* consumers already shipping without it.
|
|
146
|
+
*/
|
|
147
|
+
private _warnMissingInteractiveName;
|
|
55
148
|
private _colorStyle;
|
|
56
149
|
/**
|
|
57
150
|
* Computes the appropriate foreground color (icon or initials)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-button";
|
|
2
3
|
/**
|
|
3
4
|
* A floating "Back to top" button that appears after scrolling. Smooth-scrolls to page top when clicked.
|
|
4
5
|
*
|
|
@@ -16,7 +17,7 @@ import { LitElement } from "lit";
|
|
|
16
17
|
* @summary Floating back-to-top button with auto-show behavior, smooth scroll, and focus management.
|
|
17
18
|
* @element nys-backtotop
|
|
18
19
|
*
|
|
19
|
-
* @example
|
|
20
|
+
* @example Basic
|
|
20
21
|
* ```html
|
|
21
22
|
* <footer>
|
|
22
23
|
* <nys-backtotop></nys-backtotop>
|
|
@@ -24,13 +25,82 @@ import { LitElement } from "lit";
|
|
|
24
25
|
* </footer>
|
|
25
26
|
* ```
|
|
26
27
|
*
|
|
27
|
-
* @
|
|
28
|
+
* @render Basic
|
|
28
29
|
* ```html
|
|
29
|
-
* <
|
|
30
|
+
* <style>
|
|
31
|
+
* code {
|
|
32
|
+
* white-space: nowrap;
|
|
33
|
+
* padding: var(--nys-space-1px) var(--nys-space-2px);
|
|
34
|
+
* border-radius: var(--nys-radius-md);
|
|
35
|
+
* color: var(--nys-color-red-600);
|
|
36
|
+
* background: var(--nys-color-neutral-10);
|
|
37
|
+
* font-size: var(--nys-font-size-sm);
|
|
38
|
+
* }
|
|
39
|
+
* </style>
|
|
40
|
+
* <nys-unavheader hideTranslate hideSearch></nys-unavheader>
|
|
41
|
+
* <nys-globalheader appName="Back to Top Example"></nys-globalheader>
|
|
42
|
+
* <main style="padding: 0 2rem">
|
|
43
|
+
* <h1>Sample Content on page</h1>
|
|
44
|
+
* <p>
|
|
45
|
+
* This is a sample content area used to demonstrate the functionality of
|
|
46
|
+
* the Back to Top button. In an actual application,
|
|
47
|
+
* <code>nys-backtotop</code> would not be visible until the user scrolls
|
|
48
|
+
* down the page.
|
|
49
|
+
* </p>
|
|
50
|
+
* </main>
|
|
51
|
+
* <footer>
|
|
52
|
+
* <nys-backtotop visible></nys-backtotop>
|
|
53
|
+
* <nys-unavfooter></nys-unavfooter>
|
|
54
|
+
* </footer>
|
|
55
|
+
* ```
|
|
56
|
+
* @example Left
|
|
57
|
+
* ```html
|
|
58
|
+
* <footer>
|
|
59
|
+
* <nys-backtotop position="left"></nys-backtotop>
|
|
60
|
+
* <!-- Other footer content -->
|
|
61
|
+
* </footer>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @render Left
|
|
65
|
+
* ```html
|
|
66
|
+
* <style>
|
|
67
|
+
* code {
|
|
68
|
+
* white-space: nowrap;
|
|
69
|
+
* padding: var(--nys-space-1px) var(--nys-space-2px);
|
|
70
|
+
* border-radius: var(--nys-radius-md);
|
|
71
|
+
* color: var(--nys-color-red-600);
|
|
72
|
+
* background: var(--nys-color-neutral-10);
|
|
73
|
+
* font-size: var(--nys-font-size-sm);
|
|
74
|
+
* }
|
|
75
|
+
* nys-button {
|
|
76
|
+
* position: fixed;
|
|
77
|
+
* bottom: 1rem;
|
|
78
|
+
* right: 1rem;
|
|
79
|
+
* --_nys-button-border-radius: var(--nys-radius-round);
|
|
80
|
+
* }
|
|
81
|
+
* </style>
|
|
82
|
+
* <nys-unavheader hideTranslate hideSearch></nys-unavheader>
|
|
83
|
+
* <nys-globalheader appName="Back to Top Example"></nys-globalheader>
|
|
84
|
+
* <main style="padding: 0 2rem">
|
|
85
|
+
* <h1>Sample Content on page</h1>
|
|
86
|
+
* <p>
|
|
87
|
+
* This is a sample content area used to demonstrate the functionality of
|
|
88
|
+
* the Back to Top button. In an actual application,
|
|
89
|
+
* <code>nys-backtotop</code> would not be visible until the user scrolls
|
|
90
|
+
* down the page.
|
|
91
|
+
* </p>
|
|
92
|
+
* </main>
|
|
93
|
+
* <footer>
|
|
94
|
+
* <nys-backtotop visible position="left"></nys-backtotop>
|
|
95
|
+
* <nys-button prefixIcon="sms" variant="outline" label="Chat with us" size="sm"></nys-button>
|
|
96
|
+
* <nys-unavfooter></nys-unavfooter>
|
|
97
|
+
* </footer>
|
|
30
98
|
* ```
|
|
31
99
|
*/
|
|
32
|
-
export declare class NysBacktotop extends
|
|
100
|
+
export declare class NysBacktotop extends NysElement {
|
|
33
101
|
static styles: import("lit").CSSResult;
|
|
102
|
+
/** Unique identifier. Auto-generated if not provided. */
|
|
103
|
+
id: string;
|
|
34
104
|
/** Horizontal position: `left` or `right`. */
|
|
35
105
|
position: string;
|
|
36
106
|
/** Force button visibility. Overrides auto-show scroll behavior. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-icon";
|
|
2
3
|
/**
|
|
3
4
|
* A compact label for status, counts, or categorization. Supports semantic intents with auto-selected icons.
|
|
4
5
|
*
|
|
@@ -9,17 +10,67 @@ import { LitElement } from "lit";
|
|
|
9
10
|
* @summary Compact label for status, counts, or categorization with semantic styling.
|
|
10
11
|
* @element nys-badge
|
|
11
12
|
*
|
|
12
|
-
* @example
|
|
13
|
+
* @example Basic
|
|
13
14
|
* ```html
|
|
14
|
-
* <nys-badge
|
|
15
|
+
* <nys-badge label="Basic badge"></nys-badge>
|
|
15
16
|
* ```
|
|
16
17
|
*
|
|
17
|
-
* @example
|
|
18
|
+
* @example Error Intent
|
|
18
19
|
* ```html
|
|
19
|
-
* <nys-badge
|
|
20
|
+
* <nys-badge label="Error" intent="error" prefixIcon></nys-badge>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example Warning Intent
|
|
24
|
+
* ```html
|
|
25
|
+
* <nys-badge label="Warning" intent="warning" prefixIcon></nys-badge>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Success Intent
|
|
29
|
+
* ```html
|
|
30
|
+
* <nys-badge label="Success" intent="success" prefixIcon></nys-badge>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example Strong Neutral
|
|
34
|
+
* ```html
|
|
35
|
+
* <nys-badge variant="strong" label="Neutral" prefixIcon></nys-badge>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example Strong Error
|
|
39
|
+
* ```html
|
|
40
|
+
* <nys-badge variant="strong" label="Error" intent="error" prefixIcon></nys-badge>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example Strong Warning
|
|
44
|
+
* ```html
|
|
45
|
+
* <nys-badge variant="strong" label="Warning" intent="warning" prefixIcon></nys-badge>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Strong Success
|
|
49
|
+
* ```html
|
|
50
|
+
* <nys-badge variant="strong" label="Success" intent="success" prefixIcon></nys-badge>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @example Custom Prefix Icon
|
|
54
|
+
* ```html
|
|
55
|
+
* <nys-badge label="Custom prefixIcon" prefixIcon="check"></nys-badge>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example Custom Suffix Icon
|
|
59
|
+
* ```html
|
|
60
|
+
* <nys-badge label="Custom suffixIcon" suffixIcon="check"></nys-badge>
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Size Small
|
|
64
|
+
* ```html
|
|
65
|
+
* <nys-badge label="Small" size="sm"></nys-badge>
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @example Screen reader text
|
|
69
|
+
* ```html
|
|
70
|
+
* <nys-badge intent="warning" label="Caution" prefixIcon srText="concern"></nys-badge>
|
|
20
71
|
* ```
|
|
21
72
|
*/
|
|
22
|
-
export declare class NysBadge extends
|
|
73
|
+
export declare class NysBadge extends NysElement {
|
|
23
74
|
static styles: import("lit").CSSResult;
|
|
24
75
|
/** Unique identifier. */
|
|
25
76
|
id: string;
|
|
@@ -58,6 +109,12 @@ export declare class NysBadge extends LitElement {
|
|
|
58
109
|
* --------------------------------------------------------------------------
|
|
59
110
|
*/
|
|
60
111
|
private static readonly DEFAULT_ICONS;
|
|
112
|
+
private static readonly INTENT_SR_TEXT;
|
|
113
|
+
/**
|
|
114
|
+
* Resolves the screen-reader-only text describing the badge's semantic intent.
|
|
115
|
+
* Returns null when no intent description should be announced.
|
|
116
|
+
*/
|
|
117
|
+
private resolveIntentSrText;
|
|
61
118
|
/**
|
|
62
119
|
* Resolves which icon should be rendered.
|
|
63
120
|
* @param icon The icon property value (string or boolean)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NysElement } from "@nysds/internals";
|
|
2
|
+
import "@nysds/nys-icon";
|
|
2
3
|
/**
|
|
3
|
-
* A breadcrumb navigation trail composed of `
|
|
4
|
+
* A breadcrumb navigation trail composed of `li` elements.
|
|
4
5
|
* Collapses when the trail exceeds 5 items on desktop or 3 items on mobile,
|
|
5
6
|
* showing the first, last, and item before the current page, with an ellipsis to expand.
|
|
6
7
|
* A single item renders as a back-to-parent link instead of a trail.
|
|
@@ -8,32 +9,32 @@ import { LitElement } from "lit";
|
|
|
8
9
|
* @summary Breadcrumb navigation trail with responsive collapse support.
|
|
9
10
|
* @element nys-breadcrumbs
|
|
10
11
|
*
|
|
11
|
-
* @slot - One or more `
|
|
12
|
+
* @slot - One or more `li` elements defining the trail.
|
|
12
13
|
*
|
|
13
14
|
* @fires nys-breadcrumbs-expand - Fired when the user clicks the ellipsis to expand the trail.
|
|
14
15
|
*
|
|
15
|
-
* @example
|
|
16
|
+
* @example Basic
|
|
16
17
|
* ```html
|
|
17
18
|
* <nys-breadcrumbs>
|
|
18
19
|
* <ol>
|
|
19
20
|
* <li><a href="/">Home</a></li>
|
|
20
21
|
* <li><a href="/services">Services</a></li>
|
|
21
|
-
* <li>Current Page</li>
|
|
22
22
|
* </ol>
|
|
23
23
|
* </nys-breadcrumbs>
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
26
|
-
* @example
|
|
26
|
+
* @example Current page
|
|
27
27
|
* ```html
|
|
28
28
|
* <nys-breadcrumbs>
|
|
29
29
|
* <ol>
|
|
30
30
|
* <li><a href="/">Home</a></li>
|
|
31
31
|
* <li><a href="/services">Services</a></li>
|
|
32
|
+
* <li>Current Page</li>
|
|
32
33
|
* </ol>
|
|
33
34
|
* </nys-breadcrumbs>
|
|
34
35
|
* ```
|
|
35
36
|
*
|
|
36
|
-
* @example Single item
|
|
37
|
+
* @example Single item list
|
|
37
38
|
* ```html
|
|
38
39
|
* <nys-breadcrumbs>
|
|
39
40
|
* <ol>
|
|
@@ -41,15 +42,83 @@ import { LitElement } from "lit";
|
|
|
41
42
|
* </ol>
|
|
42
43
|
* </nys-breadcrumbs>
|
|
43
44
|
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example Long list
|
|
47
|
+
* ```html
|
|
48
|
+
* <nys-breadcrumbs>
|
|
49
|
+
* <ol>
|
|
50
|
+
* <li><a href="/">Home</a></li>
|
|
51
|
+
* <li><a href="/government">Government</a></li>
|
|
52
|
+
* <li><a href="/government/agencies">Agencies</a></li>
|
|
53
|
+
* <li><a href="/government/agencies/parks">Parks & Recreation</a></li>
|
|
54
|
+
* <li><a href="/parks/state-parks">State Parks</a></li>
|
|
55
|
+
* <li><a href="/parks/state-parks/delaware">Delaware Region</a></li>
|
|
56
|
+
* <li><a href="/parks/state-parks/delaware/water-gap">Delaware Water Gap</a></li>
|
|
57
|
+
* <li>Trail Conditions</li>
|
|
58
|
+
* </ol>
|
|
59
|
+
* </nys-breadcrumbs>
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @example Size small
|
|
63
|
+
* ```html
|
|
64
|
+
* <nys-breadcrumbs size="sm">
|
|
65
|
+
* <ol>
|
|
66
|
+
* <li><a href="/">Home</a></li>
|
|
67
|
+
* <li><a href="/government">Government</a></li>
|
|
68
|
+
* <li><a href="/government/agencies">Agencies</a></li>
|
|
69
|
+
* <li>Parks & Recreation</li>
|
|
70
|
+
* </ol>
|
|
71
|
+
* </nys-breadcrumbs>
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @example Back to parent (mobile)
|
|
75
|
+
* ```html
|
|
76
|
+
* <nys-breadcrumbs backToParent>
|
|
77
|
+
* <ol>
|
|
78
|
+
* <li><a href="/">Home</a></li>
|
|
79
|
+
* <li><a href="/government">Government</a></li>
|
|
80
|
+
* <li><a href="/government/agencies">Agencies</a></li>
|
|
81
|
+
* <li><a href="/government/agencies/parks">Parks & Recreation</a></li>
|
|
82
|
+
* <li><a href="/parks/state-parks">State Parks</a></li>
|
|
83
|
+
* <li><a href="/parks/state-parks/delaware">Delaware Region</a></li>
|
|
84
|
+
* <li><a href="/parks/state-parks/delaware/water-gap">Delaware Water Gap</a></li>
|
|
85
|
+
* <li>Trail Conditions</li>
|
|
86
|
+
* </ol>
|
|
87
|
+
* </nys-breadcrumbs>
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @example Background bar
|
|
91
|
+
* ```html
|
|
92
|
+
* <nys-breadcrumbs backgroundBar>
|
|
93
|
+
* <ol>
|
|
94
|
+
* <li><a href="/">Home</a></li>
|
|
95
|
+
* <li><a href="/services">Services</a></li>
|
|
96
|
+
* <li><a href="/tickets">Ticket System</a></li>
|
|
97
|
+
* <li>Del Water Gap</li>
|
|
98
|
+
* </ol>
|
|
99
|
+
* </nys-breadcrumbs>
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @example Disabled
|
|
103
|
+
* ```html
|
|
104
|
+
* <nys-breadcrumbs disabled>
|
|
105
|
+
* <ol>
|
|
106
|
+
* <li><a href="/">Home</a></li>
|
|
107
|
+
* <li><a href="/services">Services</a></li>
|
|
108
|
+
* <li><a href="/tickets">Ticket System</a></li>
|
|
109
|
+
* <li>Del Water Gap</li>
|
|
110
|
+
* </ol>
|
|
111
|
+
* </nys-breadcrumbs>
|
|
112
|
+
* ```
|
|
44
113
|
*/
|
|
45
|
-
export declare class NysBreadcrumbs extends
|
|
114
|
+
export declare class NysBreadcrumbs extends NysElement {
|
|
46
115
|
static styles: import("lit").CSSResult;
|
|
47
116
|
/**
|
|
48
117
|
* Unique identifier. Auto-generated if not provided.
|
|
49
118
|
*/
|
|
50
119
|
id: string;
|
|
51
120
|
/**
|
|
52
|
-
* Accessible label for the `<nav>` landmark. Defaults to "
|
|
121
|
+
* Accessible label for the `<nav>` landmark. Defaults to "Breadcrumb" if not set.
|
|
53
122
|
* Override when multiple crumbs exist on the same page.
|
|
54
123
|
*/
|
|
55
124
|
ariaLabel: string;
|
|
@@ -57,7 +126,7 @@ export declare class NysBreadcrumbs extends LitElement {
|
|
|
57
126
|
* Controls the visual size of the breadcrumb text and spacing: `sm` for dense layouts, `md` (default) for standard use.
|
|
58
127
|
* @default "md"
|
|
59
128
|
*/
|
|
60
|
-
size: "sm" | "md"
|
|
129
|
+
size: "sm" | "md";
|
|
61
130
|
/**
|
|
62
131
|
* On mobile, renders the trail as a single back-to-parent link pointing to the item before the current page.
|
|
63
132
|
* Has no effect on desktop or when only one item is present (which always renders as a back link).
|