@nysds/components 1.19.3 → 1.20.0-alpha-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +180 -1055
- package/dist/.vscode/vscode.html-custom-data.json +7 -7
- package/dist/custom-elements.json +180 -1055
- package/dist/nysds.es.js +724 -731
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +136 -730
- package/dist/nysds.js.map +1 -1
- package/dist/packages/nys-accordion/src/nys-accordion.d.ts +6 -35
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +3 -8
- package/dist/packages/nys-alert/src/nys-alert.d.ts +4 -81
- package/dist/packages/nys-avatar/src/nys-avatar.d.ts +4 -44
- package/dist/packages/nys-backtotop/src/nys-backtotop.d.ts +3 -70
- package/dist/packages/nys-badge/src/nys-badge.d.ts +4 -54
- package/dist/packages/nys-breadcrumbs/src/nys-breadcrumbs.d.ts +7 -75
- package/dist/packages/nys-button/src/nys-button.d.ts +7 -60
- package/dist/packages/nys-checkbox/src/nys-checkbox.d.ts +7 -4
- package/dist/packages/nys-checkbox/src/nys-checkboxgroup.d.ts +1 -75
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +0 -164
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +8 -64
- package/dist/packages/nys-divider/src/nys-divider.d.ts +1 -24
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenu.d.ts +12 -19
- package/dist/packages/nys-dropdownmenu/src/nys-dropdownmenuitem.d.ts +10 -0
- package/dist/packages/nys-errormessage/src/nys-errormessage.d.ts +0 -10
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +4 -66
- package/dist/packages/nys-globalfooter/src/nys-globalfooter.d.ts +7 -50
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +3 -57
- package/dist/packages/nys-icon/src/icon-cache.d.ts +4 -11
- package/dist/packages/nys-icon/src/icon-library-registry.d.ts +16 -33
- package/dist/packages/nys-icon/src/index.d.ts +2 -2
- package/dist/packages/nys-icon/src/nys-icon.d.ts +6 -83
- package/dist/packages/nys-label/src/nys-label.d.ts +2 -32
- package/dist/packages/nys-modal/src/nys-modal.d.ts +5 -130
- package/dist/packages/nys-pagination/src/nys-pagination.d.ts +1 -11
- package/dist/packages/nys-radiobutton/src/nys-radiobutton.d.ts +3 -4
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +1 -74
- package/dist/packages/nys-select/src/nys-option.d.ts +8 -0
- package/dist/packages/nys-select/src/nys-select.d.ts +10 -141
- package/dist/packages/nys-skipnav/src/nys-skipnav.d.ts +2 -2
- package/dist/packages/nys-stepper/src/nys-step.d.ts +13 -0
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +69 -119
- package/dist/packages/nys-tab/src/nys-tab.d.ts +8 -17
- package/dist/packages/nys-tab/src/nys-tabgroup.d.ts +15 -77
- package/dist/packages/nys-tab/src/nys-tabpanel.d.ts +17 -0
- package/dist/packages/nys-table/src/nys-table.d.ts +0 -71
- package/dist/packages/nys-textarea/src/nys-textarea.d.ts +5 -52
- package/dist/packages/nys-textinput/src/nys-textinput.d.ts +9 -63
- package/dist/packages/nys-toggle/src/nys-toggle.d.ts +4 -40
- package/dist/packages/nys-tooltip/src/nys-tooltip.d.ts +6 -38
- package/dist/packages/nys-unavfooter/src/nys-unavfooter.d.ts +2 -10
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +9 -51
- package/dist/packages/nys-video/src/nys-video.d.ts +3 -65
- package/package.json +4 -7
- package/packages/react/NysBreadcrumbs.d.ts +1 -1
- package/packages/react/NysButton.d.ts +1 -2
- package/packages/react/NysDropdownMenu.d.ts +1 -1
- package/packages/react/NysLabel.d.ts +1 -4
- package/packages/react/NysTextarea.d.ts +1 -1
- package/packages/react/NysUnavHeader.d.ts +1 -11
- package/packages/react/NysUnavHeader.js +1 -15
- package/packages/react/nysds-jsx.d.ts +7 -20
- package/dist/nys-icon.library-ChLRj3i-.js +0 -696
- package/dist/nys-icon.library-ChLRj3i-.js.map +0 -1
|
@@ -11,66 +11,12 @@ import { LitElement } from "lit";
|
|
|
11
11
|
* @slot - Navigation content (typically `<ul>` with `<li><a>` links). Auto-sanitized.
|
|
12
12
|
* @slot user-actions - User-account controls (e.g. profile link, settings, log-out button) shown in the header.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* @example Basic
|
|
16
|
-
* ```html
|
|
17
|
-
* <nys-globalheader appName="User Registration Form" agencyName="Office of Information Technology Services"></nys-globalheader>
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @example Homepage Link
|
|
21
|
-
* ```html
|
|
22
|
-
* <nys-globalheader
|
|
23
|
-
* agencyName="Office of Information Technology Services"
|
|
24
|
-
* homepageLink="https://its.ny.gov"
|
|
25
|
-
* ></nys-globalheader>
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @example Only Agency Name
|
|
29
|
-
* ```html
|
|
30
|
-
* <nys-globalheader agencyName="Office of Information Technology Services"></nys-globalheader>
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @example Only App Name
|
|
14
|
+
* @example Basic header
|
|
34
15
|
* ```html
|
|
35
|
-
* <nys-globalheader appName="
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* @example With Links
|
|
39
|
-
* ```html
|
|
40
|
-
* <nys-globalheader agencyName="Office of Information Technology Services">
|
|
41
|
-
* <ul>
|
|
42
|
-
* <li><a href="https://its.ny.gov/services">Services</a></li>
|
|
43
|
-
* <li><a href="https://its.ny.gov/get-help">Help Center</a></li>
|
|
44
|
-
* <li><a href="https://its.ny.gov/cybersecurity">Cybersecurity</a></li>
|
|
45
|
-
* <li><a href="https://its.ny.gov/policies">Policies and Laws</a></li>
|
|
46
|
-
* <li><a href="https://its.ny.gov/procurement">Procurement</a></li>
|
|
47
|
-
* <li><a href="https://its.ny.gov/about-us">About Us</a></li>
|
|
48
|
-
* </ul>
|
|
16
|
+
* <nys-globalheader appName="My App" agencyName="Department of Health" homepageLink="/">
|
|
17
|
+
* <ul><li><a href="/about">About</a></li><li><a href="/contact">Contact</a></li></ul>
|
|
49
18
|
* </nys-globalheader>
|
|
50
19
|
* ```
|
|
51
|
-
* @example User Actions
|
|
52
|
-
* ```html
|
|
53
|
-
* <nys-globalheader agencyName="Office of Information Technology Services">
|
|
54
|
-
* <nys-button slot="user-actions" label="Log out">
|
|
55
|
-
* <nys-avatar
|
|
56
|
-
* slot="prefix-icon"
|
|
57
|
-
* ariaLabel="User avatar"
|
|
58
|
-
* initials="NY"
|
|
59
|
-
* ></nys-avatar>
|
|
60
|
-
* </nys-button>
|
|
61
|
-
* </nys-globalheader>
|
|
62
|
-
* <nys-dropdownmenu id="dropdownmenu" for="my-action-slot">
|
|
63
|
-
* <nys-dropdownmenuitem label="Profile" href="/profile"></nys-dropdownmenuitem>
|
|
64
|
-
* <nys-dropdownmenuitem label="Repositories & Github Pages" href="/repos"></nys-dropdownmenuitem>
|
|
65
|
-
* <nys-dropdownmenuitem label="Organizations" href="/organizations" disabled></nys-dropdownmenuitem>
|
|
66
|
-
* <nys-dropdownmenuitem label="Sign out" href="/logout"></nys-dropdownmenuitem>
|
|
67
|
-
* </nys-dropdownmenu>
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @example With NYS Logo
|
|
71
|
-
* ```html
|
|
72
|
-
* <nys-globalheader nysLogo appName="Admin Dashboard"></nys-globalheader>
|
|
73
|
-
* ```
|
|
74
20
|
*/
|
|
75
21
|
export declare class NysGlobalHeader extends LitElement {
|
|
76
22
|
static styles: import("lit").CSSResult;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Icon Cache
|
|
3
3
|
*
|
|
4
|
-
* Shared SVG
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* cloned SVGElement via `cloneNode(true)` so DOM nodes are never shared.
|
|
4
|
+
* Shared SVG fetch and parse cache. Deduplicates concurrent requests
|
|
5
|
+
* for the same icon URL. Each consumer gets a cloned SVGElement via
|
|
6
|
+
* `cloneNode(true)` so DOM nodes are never shared.
|
|
8
7
|
*/
|
|
9
8
|
/** Fetch and parse an SVG from a URL. Returns a cloned SVGElement (safe for multiple consumers). */
|
|
10
9
|
export declare function fetchIcon(url: string): Promise<SVGElement>;
|
|
11
|
-
/**
|
|
12
|
-
* Parse an inline SVG source string. Results are cached by source content,
|
|
13
|
-
* so repeated renders of the same icon sanitize/parse once. Returns a
|
|
14
|
-
* cloned SVGElement (safe for multiple consumers).
|
|
15
|
-
*/
|
|
16
|
-
export declare function parseIcon(source: string): SVGElement;
|
|
17
|
-
/** Clear one URL entry, or all cached icons (URL and inline) when no URL is given. */
|
|
10
|
+
/** Clear one or all entries from the cache. */
|
|
18
11
|
export declare function clearIconCache(url?: string): void;
|
|
@@ -1,51 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Icon Library Registry
|
|
3
3
|
*
|
|
4
|
-
* Global registry for icon libraries. The "default" library resolves
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* (Font Awesome, Material Icons, etc.) register at runtime via
|
|
9
|
-
* `registerIconLibrary()` and typically resolve to URLs.
|
|
4
|
+
* Global registry for icon libraries. The "default" library resolves
|
|
5
|
+
* NYSDS icons from colocated SVG files extracted at build time.
|
|
6
|
+
* Custom libraries (Font Awesome, Material Icons, etc.) can be
|
|
7
|
+
* registered at runtime via `registerIconLibrary()`.
|
|
10
8
|
*
|
|
11
|
-
* The registry and watcher maps are stored on `
|
|
9
|
+
* The registry and watcher maps are stored on `window` so that even
|
|
12
10
|
* when bundlers (Storybook Vite, etc.) create duplicate module
|
|
13
|
-
* instances, every copy shares a single source of truth.
|
|
14
|
-
* (rather than `window`) keeps module import side-effect-safe in
|
|
15
|
-
* Node/SSR environments, where `window` does not exist.
|
|
11
|
+
* instances, every copy shares a single source of truth.
|
|
16
12
|
*/
|
|
17
|
-
/**
|
|
18
|
-
* How a resolver locates an icon: a URL string (legacy shorthand for
|
|
19
|
-
* `{ type: "url" }`), an explicit URL, or inline SVG source. Resolvers may
|
|
20
|
-
* return synchronously or via a Promise.
|
|
21
|
-
*/
|
|
22
|
-
export type IconResolution = string | {
|
|
23
|
-
type: "url";
|
|
24
|
-
href: string;
|
|
25
|
-
} | {
|
|
26
|
-
type: "svg";
|
|
27
|
-
content: string;
|
|
28
|
-
};
|
|
29
13
|
export interface IconLibrary {
|
|
30
|
-
/** Given an icon name, return
|
|
31
|
-
resolver: (name: string) =>
|
|
32
|
-
/** Optional post-
|
|
14
|
+
/** Given an icon name, return the URL to its SVG file. Return undefined if not found. */
|
|
15
|
+
resolver: (name: string) => string | undefined;
|
|
16
|
+
/** Optional post-fetch transform applied to the parsed SVGElement. */
|
|
33
17
|
mutator?: (svg: SVGElement) => void;
|
|
34
18
|
}
|
|
35
19
|
export interface NysIconWatcher {
|
|
36
20
|
redraw(): void;
|
|
37
21
|
}
|
|
22
|
+
interface NysIconGlobals {
|
|
23
|
+
__nysIconRegistry: Map<string, IconLibrary>;
|
|
24
|
+
__nysIconWatchers: Map<string, Set<NysIconWatcher>>;
|
|
25
|
+
}
|
|
38
26
|
declare global {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var __nysIconDefaultRegistered: boolean | undefined;
|
|
27
|
+
interface Window extends NysIconGlobals {
|
|
28
|
+
}
|
|
42
29
|
}
|
|
43
30
|
/** Register or replace a named icon library. All watching icons using this library will redraw.
|
|
44
|
-
*
|
|
45
|
-
* Intended for custom/external libraries — the standard NYSDS set is
|
|
46
|
-
* built in and needs no registration. Registering under `"default"`
|
|
47
|
-
* replaces the built-in set (escape hatch).
|
|
48
|
-
*
|
|
49
31
|
* @example Register a Font Awesome library with a custom resolver:
|
|
50
32
|
* ```ts
|
|
51
33
|
* registerIconLibrary("fa", {
|
|
@@ -62,3 +44,4 @@ export declare function getIconLibrary(name: string): IconLibrary | undefined;
|
|
|
62
44
|
export declare function watchIconLibrary(name: string, watcher: NysIconWatcher): void;
|
|
63
45
|
/** Unsubscribe an icon instance from library change notifications. */
|
|
64
46
|
export declare function unwatchIconLibrary(name: string, watcher: NysIconWatcher): void;
|
|
47
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "./nys-icon";
|
|
2
|
-
export { registerIconLibrary, unregisterIconLibrary,
|
|
3
|
-
export type { IconLibrary
|
|
2
|
+
export { registerIconLibrary, unregisterIconLibrary, } from "./icon-library-registry";
|
|
3
|
+
export type { IconLibrary } from "./icon-library-registry";
|
|
4
4
|
export { clearIconCache } from "./icon-cache";
|
|
@@ -13,96 +13,19 @@ 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
|
-
* @example Basic
|
|
16
|
+
* @example Basic icon (default NYSDS library)
|
|
17
17
|
* ```html
|
|
18
|
-
* <nys-icon name="check_circle"></nys-icon>
|
|
18
|
+
* <nys-icon name="check_circle" size="lg"></nys-icon>
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
|
-
* @example
|
|
21
|
+
* @example Font Awesome icon
|
|
22
22
|
* ```html
|
|
23
|
-
* <nys-icon
|
|
24
|
-
* name="edit_square"
|
|
25
|
-
* ariaLabel="Edit content"
|
|
26
|
-
* ></nys-icon>
|
|
23
|
+
* <nys-icon name="house" library="fa" size="lg"></nys-icon>
|
|
27
24
|
* ```
|
|
28
25
|
*
|
|
29
|
-
* @example
|
|
26
|
+
* @example Accessible icon with label
|
|
30
27
|
* ```html
|
|
31
|
-
* <nys-icon
|
|
32
|
-
* name="edit_square"
|
|
33
|
-
* size="4xl"
|
|
34
|
-
* ></nys-icon>
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @example Size literal
|
|
38
|
-
* ```html
|
|
39
|
-
* <nys-icon
|
|
40
|
-
* name="edit_square"
|
|
41
|
-
* size="24"
|
|
42
|
-
* ></nys-icon>
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
* @example Color
|
|
46
|
-
* ```html
|
|
47
|
-
* <nys-icon
|
|
48
|
-
* name="edit_square"
|
|
49
|
-
* color="#db117d"
|
|
50
|
-
* ></nys-icon>
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @example Rotate
|
|
54
|
-
* ```html
|
|
55
|
-
* <nys-icon
|
|
56
|
-
* name="edit_square"
|
|
57
|
-
* rotate="20"
|
|
58
|
-
* ></nys-icon>
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* @example Flip
|
|
62
|
-
* ```html
|
|
63
|
-
* <nys-icon
|
|
64
|
-
* name="edit_square"
|
|
65
|
-
* flip="vertical"
|
|
66
|
-
* ></nys-icon>
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* @example External Library - Font Awesome
|
|
70
|
-
* ```html
|
|
71
|
-
* <nys-icon name="heart" library="fa"></nys-icon>
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* @render External Library - Font Awesome
|
|
75
|
-
* ```html
|
|
76
|
-
* <nys-icon name="heart" library="fa"></nys-icon>
|
|
77
|
-
* <script data-scope="module">
|
|
78
|
-
* registerIconLibrary("fa", {
|
|
79
|
-
* resolver: (name) =>
|
|
80
|
-
* `https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/svgs/solid/${name}.svg`,
|
|
81
|
-
* mutator: (svg) => {
|
|
82
|
-
* svg.setAttribute("fill", "currentColor");
|
|
83
|
-
* },
|
|
84
|
-
* });
|
|
85
|
-
* </script>
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* @example External Library - Material
|
|
89
|
-
* ```html
|
|
90
|
-
* <nys-icon name="favorite" library="material"></nys-icon>
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* @render External Library - Material
|
|
95
|
-
* ```html
|
|
96
|
-
* <nys-icon name="favorite" library="material"></nys-icon>
|
|
97
|
-
* <script data-scope="module">
|
|
98
|
-
* registerIconLibrary("material", {
|
|
99
|
-
* resolver: (name) =>
|
|
100
|
-
* `https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/${name}/default/24px.svg`,
|
|
101
|
-
* mutator: (svg) => {
|
|
102
|
-
* svg.setAttribute("fill", "currentColor");
|
|
103
|
-
* },
|
|
104
|
-
* });
|
|
105
|
-
* </script>
|
|
28
|
+
* <nys-icon name="warning" ariaLabel="Warning" color="var(--nys-color-warning)"></nys-icon>
|
|
106
29
|
* ```
|
|
107
30
|
*/
|
|
108
31
|
export declare class NysIcon extends LitElement implements NysIconWatcher {
|
|
@@ -5,38 +5,8 @@ import { LitElement } from "lit";
|
|
|
5
5
|
* Used internally by form components (textinput, select, checkbox, etc.). Not intended for direct use.
|
|
6
6
|
* Handles label association via `for`, displays asterisk for required fields, and integrates tooltips.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
*
|
|
10
|
-
* <nys-label label="This is a basic nys-label"></nys-label>
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @example Required
|
|
14
|
-
* ```html
|
|
15
|
-
* <nys-label label="This form is required" flag="required"></nys-label>
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @example Optional
|
|
19
|
-
* ```html
|
|
20
|
-
* <nys-label label="This form is required" flag="optional"></nys-label>
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @example Description
|
|
24
|
-
* ```html
|
|
25
|
-
* <nys-label label="Label Text" description="Description text"></nys-label>
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @example Description Slot
|
|
29
|
-
* ```html
|
|
30
|
-
* <nys-label label="Label Text">
|
|
31
|
-
* <p slot="description">Rich text description passed in <strong>HERE</strong></p>
|
|
32
|
-
* </nys-label>
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @example With Tooltip
|
|
36
|
-
* ```html
|
|
37
|
-
* <nys-label id="label-id" label="This label has a tooltip"></nys-label>
|
|
38
|
-
* <nys-tooltip for="label-id" text="Tooltip text in here"></nys-tooltip>
|
|
39
|
-
* ```
|
|
8
|
+
* @summary Internal label component for form fields with flag and tooltip support.
|
|
9
|
+
* @element nys-label
|
|
40
10
|
*
|
|
41
11
|
* @slot description - Custom HTML description content below the label.
|
|
42
12
|
*/
|
|
@@ -14,141 +14,16 @@ import { LitElement } from "lit";
|
|
|
14
14
|
* @fires nys-open - Fired when modal opens. Detail: `{id}`.
|
|
15
15
|
* @fires nys-close - Fired when modal closes. Detail: `{id}`.
|
|
16
16
|
*
|
|
17
|
-
* @example Basic
|
|
17
|
+
* @example Basic modal
|
|
18
18
|
* ```html
|
|
19
|
-
* <nys-modal
|
|
20
|
-
*
|
|
21
|
-
* heading="Update Available"
|
|
22
|
-
* >
|
|
23
|
-
* <p>
|
|
24
|
-
* Would you like to install the latest version? Albany ipsum dolor sit
|
|
25
|
-
* Empire, Hudson consectetur Adirondack elit, sed do MetroCard tempor
|
|
26
|
-
* incididunt ut Capitol et Broadway magna Niagara. Ut enim ad Erie
|
|
27
|
-
* veniam, quis nostrud Catskill ullamco Bronx nisi ut LongIsland ex ea
|
|
28
|
-
* Cuomo consequat.
|
|
29
|
-
* </p>
|
|
30
|
-
* </nys-modal>
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @render Basic
|
|
34
|
-
* ```html
|
|
35
|
-
* <div id="modal-wrapper1">
|
|
36
|
-
* <nys-button label="Open Modal" onclick="document.querySelector('.modal1').open = true; document.getElementById('modal-wrapper1').style.padding = '100px 0'"></nys-button>
|
|
37
|
-
* <nys-modal
|
|
38
|
-
* class="modal1"
|
|
39
|
-
* id="modal1"
|
|
40
|
-
* heading="Update Available"
|
|
41
|
-
* >
|
|
42
|
-
* <p>
|
|
43
|
-
* Would you like to install the latest version? Albany ipsum dolor sit
|
|
44
|
-
* Empire, Hudson consectetur Adirondack elit, sed do MetroCard tempor
|
|
45
|
-
* incididunt ut Capitol et Broadway magna Niagara. Ut enim ad Erie
|
|
46
|
-
* veniam, quis nostrud Catskill ullamco Bronx nisi ut LongIsland ex ea
|
|
47
|
-
* Cuomo consequat.
|
|
48
|
-
* </p>
|
|
49
|
-
* </nys-modal>
|
|
50
|
-
* </div>
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
|
|
54
|
-
* @example Subheading
|
|
55
|
-
* ```html
|
|
56
|
-
* <nys-modal
|
|
57
|
-
* id="modal-subheading"
|
|
58
|
-
* heading="Before you continue"
|
|
59
|
-
* subheading="Your progress has been saved automatically."
|
|
60
|
-
* >
|
|
61
|
-
* <p>You can safely leave this page and return later to pick up where you left off.</p>
|
|
62
|
-
* </nys-modal>
|
|
63
|
-
* ```
|
|
64
|
-
*
|
|
65
|
-
* @render Subheading
|
|
66
|
-
* ```html
|
|
67
|
-
* <div id="modal-wrapper-subheading">
|
|
68
|
-
* <nys-button label="Open Modal" onclick="document.querySelector('.modal-subheading').open = true; document.getElementById('modal-wrapper-subheading').style.padding = '100px 0'"></nys-button>
|
|
69
|
-
* <nys-modal
|
|
70
|
-
* class="modal-subheading"
|
|
71
|
-
* id="modal-subheading"
|
|
72
|
-
* heading="Before you continue"
|
|
73
|
-
* subheading="Your progress has been saved automatically."
|
|
74
|
-
* >
|
|
75
|
-
* <p>You can safely leave this page and return later to pick up where you left off.</p>
|
|
76
|
-
* </nys-modal>
|
|
77
|
-
* </div>
|
|
78
|
-
* ```
|
|
79
|
-
*
|
|
80
|
-
* @example Actions Slot
|
|
81
|
-
* ```html
|
|
82
|
-
* <nys-modal id="modal3" heading="Update password?">
|
|
83
|
-
* <p>
|
|
84
|
-
* Would you like to install the latest version? Albany ipsum dolor sit
|
|
85
|
-
* Empire, Hudson consectetur Adirondack elit, sed do MetroCard tempor
|
|
86
|
-
* incididunt ut Capitol et Broadway magna Niagara. Ut enim ad Erie
|
|
87
|
-
* veniam, quis nostrud Catskill ullamco Bronx nisi ut LongIsland ex ea
|
|
88
|
-
* Cuomo consequat.
|
|
89
|
-
* </p>
|
|
19
|
+
* <nys-modal id="confirm-modal" heading="Confirm action" open>
|
|
20
|
+
* <p>Are you sure you want to proceed?</p>
|
|
90
21
|
* <div slot="actions">
|
|
91
|
-
* <nys-button label="
|
|
92
|
-
* <nys-button label="
|
|
22
|
+
* <nys-button label="Cancel" variant="outline"></nys-button>
|
|
23
|
+
* <nys-button label="Confirm" variant="filled"></nys-button>
|
|
93
24
|
* </div>
|
|
94
25
|
* </nys-modal>
|
|
95
26
|
* ```
|
|
96
|
-
*
|
|
97
|
-
* @render Actions Slot
|
|
98
|
-
* ```html
|
|
99
|
-
* <div id="modal-wrapper3">
|
|
100
|
-
* <nys-button label="Open Modal" onclick="document.querySelector('.modal3').open = true; document.getElementById('modal-wrapper3').style.padding = '100px 0'"></nys-button>
|
|
101
|
-
* <nys-modal
|
|
102
|
-
* class="modal3"
|
|
103
|
-
* id="modal3"
|
|
104
|
-
* heading="Update password?"
|
|
105
|
-
* >
|
|
106
|
-
* <p>
|
|
107
|
-
* Would you like to install the latest version? Albany ipsum dolor sit
|
|
108
|
-
* Empire, Hudson consectetur Adirondack elit, sed do MetroCard tempor
|
|
109
|
-
* incididunt ut Capitol et Broadway magna Niagara. Ut enim ad Erie
|
|
110
|
-
* veniam, quis nostrud Catskill ullamco Bronx nisi ut LongIsland ex ea
|
|
111
|
-
* Cuomo consequat.
|
|
112
|
-
* </p>
|
|
113
|
-
* <div slot="actions">
|
|
114
|
-
* <nys-button label="Not now" variant="outline" onclick="document.querySelector('.modal3').open = false; document.getElementById('modal-wrapper3').style.padding = '0'"></nys-button>
|
|
115
|
-
* <nys-button label="Update" onclick="alert('Mock Alert: Changes saved!'); document.querySelector('.modal3').open = false; document.getElementById('modal-wrapper3').style.padding = '0'"></nys-button>
|
|
116
|
-
* </div>
|
|
117
|
-
* </nys-modal>
|
|
118
|
-
* </div>
|
|
119
|
-
* ```
|
|
120
|
-
*
|
|
121
|
-
* @example Mandatory Action
|
|
122
|
-
* ```html
|
|
123
|
-
* <nys-modal
|
|
124
|
-
* id="modal4"
|
|
125
|
-
* heading="There is no way to X out of here"
|
|
126
|
-
* subheading="Don't use this prop unless you add in the actions slot so the user does not get stuck in here."
|
|
127
|
-
* mandatory
|
|
128
|
-
* >
|
|
129
|
-
* <div slot="actions">
|
|
130
|
-
* <nys-button label="Get me out"></nys-button>
|
|
131
|
-
* </div>
|
|
132
|
-
* </nys-modal>
|
|
133
|
-
* ```
|
|
134
|
-
*
|
|
135
|
-
* @render Mandatory Action
|
|
136
|
-
* ```html
|
|
137
|
-
* <div id="modal-wrapper4">
|
|
138
|
-
* <nys-button label="Open Modal" onclick="document.querySelector('.modal4').open = true; document.getElementById('modal-wrapper4').style.padding = '100px 0'"></nys-button>
|
|
139
|
-
* <nys-modal
|
|
140
|
-
* class="modal4"
|
|
141
|
-
* id="modal4"
|
|
142
|
-
* heading="There is no way to X out of here"
|
|
143
|
-
* subheading="Don't use this prop unless you add in the actions slot so the user does not get stuck in here."
|
|
144
|
-
* mandatory
|
|
145
|
-
* >
|
|
146
|
-
* <div slot="actions">
|
|
147
|
-
* <nys-button label="Get me out" onclick="alert('Ok, ok. You can go now.'); document.querySelector('.modal4').open = false; document.getElementById('modal-wrapper4').style.padding = '0'"></nys-button>
|
|
148
|
-
* </div>
|
|
149
|
-
* </nys-modal>
|
|
150
|
-
* </div>
|
|
151
|
-
* ```
|
|
152
27
|
*/
|
|
153
28
|
export declare class NysModal extends LitElement {
|
|
154
29
|
static styles: import("lit").CSSResult;
|
|
@@ -10,20 +10,10 @@ import { LitElement, TemplateResult } from "lit";
|
|
|
10
10
|
*
|
|
11
11
|
* @fires nys-change - Fired when page changes. Detail: `{page}`.
|
|
12
12
|
*
|
|
13
|
-
* @example Basic
|
|
14
|
-
* ```html
|
|
15
|
-
* <nys-pagination currentPage="5" totalPages="10"></nys-pagination>
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @example First Page
|
|
13
|
+
* @example Basic pagination
|
|
19
14
|
* ```html
|
|
20
15
|
* <nys-pagination currentPage="1" totalPages="10"></nys-pagination>
|
|
21
16
|
* ```
|
|
22
|
-
*
|
|
23
|
-
* @example Last Page
|
|
24
|
-
* ```html
|
|
25
|
-
* <nys-pagination currentPage="10" totalPages="10"></nys-pagination>
|
|
26
|
-
* ```
|
|
27
17
|
*/
|
|
28
18
|
export declare class NysPagination extends LitElement {
|
|
29
19
|
static styles: import("lit").CSSResult;
|
|
@@ -15,11 +15,10 @@ import { LitElement } from "lit";
|
|
|
15
15
|
* @fires nys-blur - Fired when radio loses focus.
|
|
16
16
|
* @fires nys-other-input - Fired when "other" text input value changes. Detail: `{id, name, value}`.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
* @example Pre-selected
|
|
18
|
+
* @example Radio group
|
|
20
19
|
* ```html
|
|
21
|
-
* <nys-radiogroup label="Select borough">
|
|
22
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"
|
|
20
|
+
* <nys-radiogroup label="Select borough" required>
|
|
21
|
+
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
23
22
|
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
24
23
|
* </nys-radiogroup>
|
|
25
24
|
* ```
|
|
@@ -12,7 +12,7 @@ import { LitElement } from "lit";
|
|
|
12
12
|
* @slot - Default slot for `nys-radiobutton` elements.
|
|
13
13
|
* @slot description - Custom HTML description content.
|
|
14
14
|
*
|
|
15
|
-
* @example Basic
|
|
15
|
+
* @example Basic radio group
|
|
16
16
|
* ```html
|
|
17
17
|
* <nys-radiogroup label="Select borough" required>
|
|
18
18
|
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
@@ -20,79 +20,6 @@ import { LitElement } from "lit";
|
|
|
20
20
|
* <nys-radiobutton name="borough" value="manhattan" label="Manhattan"></nys-radiobutton>
|
|
21
21
|
* </nys-radiogroup>
|
|
22
22
|
* ```
|
|
23
|
-
*
|
|
24
|
-
* @example Tile
|
|
25
|
-
* ```html
|
|
26
|
-
* <nys-radiogroup label="Select borough" tile>
|
|
27
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
28
|
-
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
29
|
-
* </nys-radiogroup>
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @example Required
|
|
33
|
-
* ```html
|
|
34
|
-
* <nys-radiogroup label="Select borough" required>
|
|
35
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
36
|
-
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
37
|
-
* </nys-radiogroup>
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @example Optional
|
|
41
|
-
* ```html
|
|
42
|
-
* <nys-radiogroup label="Select borough" optional>
|
|
43
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
44
|
-
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
45
|
-
* </nys-radiogroup>
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @example Disabled
|
|
49
|
-
* ```html
|
|
50
|
-
* <nys-radiogroup label="Select borough">
|
|
51
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx" disabled></nys-radiobutton>
|
|
52
|
-
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn" disabled></nys-radiobutton>
|
|
53
|
-
* </nys-radiogroup>
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @example Size Small
|
|
57
|
-
* ```html
|
|
58
|
-
* <nys-radiogroup label="Select borough" size="sm">
|
|
59
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
60
|
-
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
61
|
-
* </nys-radiogroup>
|
|
62
|
-
* ```
|
|
63
|
-
*
|
|
64
|
-
* @example Other Option
|
|
65
|
-
* ```html
|
|
66
|
-
* <nys-radiogroup label="Select borough">
|
|
67
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
68
|
-
* <nys-radiobutton name="borough" value="" label="Other" other></nys-radiobutton>
|
|
69
|
-
* </nys-radiogroup>
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* @example Error Message
|
|
73
|
-
* ```html
|
|
74
|
-
* <nys-radiogroup label="Select borough" showError errorMessage="Please select a borough">
|
|
75
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
76
|
-
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
77
|
-
* </nys-radiogroup>
|
|
78
|
-
* ```
|
|
79
|
-
*
|
|
80
|
-
* @example Description
|
|
81
|
-
* ```html
|
|
82
|
-
* <nys-radiogroup label="Select borough" description="Your primary residence in NYC.">
|
|
83
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
84
|
-
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
85
|
-
* </nys-radiogroup>
|
|
86
|
-
* ```
|
|
87
|
-
*
|
|
88
|
-
* @example Description Slot
|
|
89
|
-
* ```html
|
|
90
|
-
* <nys-radiogroup label="Select borough">
|
|
91
|
-
* <div slot="description">Your primary <strong>residence</strong> in NYC.</div>
|
|
92
|
-
* <nys-radiobutton name="borough" value="bronx" label="The Bronx"></nys-radiobutton>
|
|
93
|
-
* <nys-radiobutton name="borough" value="brooklyn" label="Brooklyn"></nys-radiobutton>
|
|
94
|
-
* </nys-radiogroup>
|
|
95
|
-
* ```
|
|
96
23
|
*/
|
|
97
24
|
export declare class NysRadiogroup extends LitElement {
|
|
98
25
|
static styles: import("lit").CSSResult;
|
|
@@ -9,6 +9,14 @@ import { LitElement } from "lit";
|
|
|
9
9
|
* @element nys-option
|
|
10
10
|
*
|
|
11
11
|
* @slot - Option label text. Auto-populates the `label` prop if provided.
|
|
12
|
+
*
|
|
13
|
+
* @example Basic options
|
|
14
|
+
* ```html
|
|
15
|
+
* <nys-select>
|
|
16
|
+
* <nys-option value="ny">New York</nys-option>
|
|
17
|
+
* <nys-option value="ca" disabled>California</nys-option>
|
|
18
|
+
* </nys-select>
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
21
|
export declare class NysOption extends LitElement {
|
|
14
22
|
/** Prevents selection of this option. */
|