@nysds/components 1.23.1 → 1.24.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 +547 -127
- package/dist/.vscode/vscode.html-custom-data.json +53 -43
- package/dist/custom-elements.json +547 -127
- package/dist/{nys-icon.library-BoTLZp1N.js → nys-icon.library-C3fdrsXK.js} +2 -2
- package/dist/{nys-icon.library-BoTLZp1N.js.map → nys-icon.library-C3fdrsXK.js.map} +1 -1
- package/dist/{nys-icon.library-CzPN4H8R-DCkPqUYP.js → nys-icon.library-CHrtmOCL-BdLMRCBm.js} +3 -3
- package/dist/{nys-icon.library-CzPN4H8R-DCkPqUYP.js.map → nys-icon.library-CHrtmOCL-BdLMRCBm.js.map} +1 -1
- package/dist/nysds.es.js +4090 -3834
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +329 -335
- package/dist/nysds.js.map +1 -1
- package/dist/packages/mcp-server/src/lib/framework-snippets.d.ts +1 -1
- package/dist/packages/mcp-server/src/lib/framework-usage.d.ts +2 -1
- package/dist/packages/mcp-server/src/lib/icons.d.ts +18 -0
- package/dist/packages/mcp-server/src/lib/search.d.ts +1 -5
- package/dist/packages/mcp-server/src/lib/token-parser.d.ts +44 -1
- package/dist/packages/mcp-server/src/resources/components.d.ts +1 -1
- package/dist/packages/mcp-server/src/resources/guides.d.ts +1 -1
- package/dist/packages/mcp-server/src/tools/guide-tools.d.ts +10 -0
- package/dist/packages/mcp-server/src/tools/utility-tools.d.ts +36 -16
- package/dist/packages/nys-accordion/src/nys-accordionitem.d.ts +7 -27
- package/dist/packages/nys-button/src/nys-button.d.ts +6 -5
- package/dist/packages/nys-card/src/nys-card.d.ts +1 -1
- package/dist/packages/nys-combobox/src/nys-combobox.d.ts +1 -0
- package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +1 -0
- package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +9 -18
- package/dist/packages/nys-fileinput/src/nys-fileitem.d.ts +8 -0
- package/dist/packages/nys-globalheader/src/nys-globalheader.d.ts +2 -1
- package/dist/packages/nys-icon/src/nys-icon.d.ts +6 -4
- package/dist/packages/nys-iconlist/src/nys-iconlistitem.d.ts +2 -2
- package/dist/packages/nys-modal/src/nys-modal.d.ts +1 -6
- package/dist/packages/nys-onthispage/src/index.d.ts +1 -0
- package/dist/packages/nys-onthispage/src/nys-onthispage.d.ts +418 -0
- package/dist/packages/nys-onthispage/src/nys-onthispage.figma.d.ts +1 -0
- package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +1 -0
- package/dist/packages/nys-select/src/nys-select.d.ts +1 -0
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +2 -2
- package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +8 -8
- package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +11 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* designsystem.ny.gov.
|
|
9
9
|
*/
|
|
10
10
|
import { type CEMExample, type CEMFormControl } from "./cem-parser.js";
|
|
11
|
-
export type FrameworkFilter = "html" | "react" | "angular";
|
|
11
|
+
export type FrameworkFilter = "html" | "react" | "angular" | "vue";
|
|
12
12
|
export interface FrameworkSnippet {
|
|
13
13
|
code: string;
|
|
14
14
|
imports: string[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Framework usage notes
|
|
3
3
|
*
|
|
4
4
|
* Short, framework-specific guidance attached to `get_component` responses
|
|
5
|
-
* when the caller asks for `framework: "react"` or `"
|
|
5
|
+
* when the caller asks for `framework: "react"`, `"angular"`, or `"vue"` — the import
|
|
6
6
|
* line, the event-prop naming rule, and (when the component is a form
|
|
7
7
|
* control) how it binds into that framework's forms. Naming follows the
|
|
8
8
|
* rules in `.claude/plans/framework-support/README.md` section 4.1, reused
|
|
@@ -17,3 +17,4 @@ export interface FrameworkUsageNotes {
|
|
|
17
17
|
}
|
|
18
18
|
export declare function buildReactUsageNotes(tagName: string, className: string, formControl: CEMFormControl | undefined): FrameworkUsageNotes;
|
|
19
19
|
export declare function buildAngularUsageNotes(tagName: string, className: string, formControl: CEMFormControl | undefined): FrameworkUsageNotes;
|
|
20
|
+
export declare function buildVueUsageNotes(className: string, formControl: CEMFormControl | undefined): FrameworkUsageNotes;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NYSDS Icon Set
|
|
3
|
+
*
|
|
4
|
+
* The names of the icons built into nys-icon's "default" library, read from
|
|
5
|
+
* the manifest @nysds/nys-icon generates from nys-icon.library.ts. Only these
|
|
6
|
+
* names render without registering another library, so the MCP server lists
|
|
7
|
+
* them instead of leaving agents to guess (and guess Material Symbols names).
|
|
8
|
+
*/
|
|
9
|
+
import type { CEMDeclaration } from "./cem-parser.js";
|
|
10
|
+
/** Built-in NYSDS icon names, sorted. Empty if the manifest can't be found. */
|
|
11
|
+
export declare function getIconNames(): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Attributes on a component whose value is an icon name from the NYSDS set:
|
|
14
|
+
* nys-icon's `name`, and other components' `icon`, `prefixIcon`,
|
|
15
|
+
* `suffixIcon`, etc. Boolean flags such as `noIcon` aren't names.
|
|
16
|
+
*/
|
|
17
|
+
export declare function iconAttributes(component: CEMDeclaration): string[];
|
|
18
|
+
export declare const ICON_GUIDE_POINTER = "Only these names render by default. For an icon the NYSDS set doesn't have, register another library; see get_guide({ topic: \"icons\" }).";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Search Utilities
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Search functionality for components.
|
|
5
5
|
*/
|
|
6
6
|
export interface SearchResult {
|
|
7
7
|
tagName: string;
|
|
@@ -13,7 +13,3 @@ export interface SearchResult {
|
|
|
13
13
|
* Search components by name or description
|
|
14
14
|
*/
|
|
15
15
|
export declare function searchComponents(query: string): SearchResult[];
|
|
16
|
-
/**
|
|
17
|
-
* Check if a string matches a search query
|
|
18
|
-
*/
|
|
19
|
-
export declare function matchesQuery(text: string, query: string): boolean;
|
|
@@ -25,10 +25,37 @@ export interface CSSTokenInfo {
|
|
|
25
25
|
description?: string;
|
|
26
26
|
/** Token category (color, font, space, etc.) */
|
|
27
27
|
category: string;
|
|
28
|
-
/** Token layer (primitive, applied,
|
|
28
|
+
/** Token layer (primitive, applied, theme, etc.) */
|
|
29
29
|
layer: string;
|
|
30
30
|
/** Original JSON path for debugging */
|
|
31
31
|
jsonPath: string;
|
|
32
|
+
/**
|
|
33
|
+
* Per-theme values, keyed by theme name ("default" first). Present only
|
|
34
|
+
* when the token's value changes by agency theme, directly or through an
|
|
35
|
+
* alias of a token that does.
|
|
36
|
+
*/
|
|
37
|
+
themes?: Record<string, ThemeValue>;
|
|
38
|
+
/** Raw `$extensions.mode` overrides from tokens.json, as CSS values */
|
|
39
|
+
modeOverrides?: Record<string, {
|
|
40
|
+
cssValue: string;
|
|
41
|
+
referencesVariable?: string;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A token's value under one agency theme
|
|
46
|
+
*/
|
|
47
|
+
export interface ThemeValue {
|
|
48
|
+
cssValue: string;
|
|
49
|
+
referencesVariable?: string;
|
|
50
|
+
resolvedValue?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* An agency theme and the selectors tokens.css applies it with
|
|
54
|
+
*/
|
|
55
|
+
export interface ThemeInfo {
|
|
56
|
+
name: string;
|
|
57
|
+
/** Selectors from tokens.css; empty for the default theme, which is :root */
|
|
58
|
+
selectors: string[];
|
|
32
59
|
}
|
|
33
60
|
/**
|
|
34
61
|
* Token dependency graph node
|
|
@@ -36,7 +63,12 @@ export interface CSSTokenInfo {
|
|
|
36
63
|
export interface TokenGraphNode {
|
|
37
64
|
cssVariable: string;
|
|
38
65
|
referencesVariable?: string;
|
|
66
|
+
/** Per-theme references for a themed token, keyed by theme name */
|
|
67
|
+
themeReferences?: Record<string, string>;
|
|
68
|
+
/** Every token that references this one, in any theme */
|
|
39
69
|
usedBy: string[];
|
|
70
|
+
/** For consumers that only reference this token in some themes: consumer -> themes */
|
|
71
|
+
usedByThemes?: Record<string, string[]>;
|
|
40
72
|
}
|
|
41
73
|
/**
|
|
42
74
|
* Get the path to tokens.json file
|
|
@@ -85,6 +117,17 @@ export declare function getCSSTokensByCategory(category: string): CSSTokenInfo[]
|
|
|
85
117
|
* Get a single token by CSS variable name
|
|
86
118
|
*/
|
|
87
119
|
export declare function getCSSTokenByVariable(variableName: string): CSSTokenInfo | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Agency themes in tokens.json order, "default" first. Selectors follow the
|
|
122
|
+
* pattern tokens.css is built with (see packages/tokens/terrazzo.config.js);
|
|
123
|
+
* the default theme is :root and has no selector of its own.
|
|
124
|
+
*/
|
|
125
|
+
export declare function getThemes(): ThemeInfo[];
|
|
126
|
+
/**
|
|
127
|
+
* A token's value in one theme: its themed value if it has one, else its
|
|
128
|
+
* base value (unthemed tokens are the same in every theme)
|
|
129
|
+
*/
|
|
130
|
+
export declare function getTokenValueInTheme(token: CSSTokenInfo, theme: string): ThemeValue;
|
|
88
131
|
/**
|
|
89
132
|
* Get all unique categories
|
|
90
133
|
*/
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* - nysds://components - Component overview list
|
|
8
8
|
* - nysds://component/{tag} - Individual component docs
|
|
9
9
|
*/
|
|
10
|
-
import type
|
|
10
|
+
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
11
|
export declare function registerComponentResources(server: McpServer): void;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* MCP resources for NYSDS installation and usage guides.
|
|
5
5
|
*
|
|
6
6
|
* P0 Resources:
|
|
7
|
-
* - nysds://installation - Installation guide
|
|
7
|
+
* - nysds://installation - Installation guide (same file get_guide serves)
|
|
8
8
|
*/
|
|
9
9
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
10
|
export declare function registerGuideResources(server: McpServer): void;
|
|
@@ -5,4 +5,14 @@
|
|
|
5
5
|
* Loads guide content from data/guides/ markdown files.
|
|
6
6
|
*/
|
|
7
7
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
/**
|
|
9
|
+
* Load a guide markdown file. Shared with the nysds://installation resource
|
|
10
|
+
* so the tool and the resource serve the same text.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadGuide(filename: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Theme value tables for the themes guide, built from tokens.json so they
|
|
15
|
+
* can't drift from tokens.css the way a hand-written table did.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderThemeValueTables(): string;
|
|
8
18
|
export declare function registerGuideTools(server: McpServer): void;
|
|
@@ -7,30 +7,38 @@
|
|
|
7
7
|
* below. Those constants mirror the Sass sources that actually generate the
|
|
8
8
|
* stylesheet:
|
|
9
9
|
*
|
|
10
|
-
* - packages/styles/src/utilities/_config.scss
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* - packages/styles/src/utilities/_config.scss ($spacing, $opacity-values,
|
|
11
|
+
* $zindex-values, $display-values,
|
|
12
|
+
* $breakpoints, $flex-columns,
|
|
13
|
+
* $order-values, $float-values,
|
|
14
|
+
* $overflow-values, $position-values,
|
|
15
|
+
* $grid-containers)
|
|
16
|
+
* - packages/styles/src/utilities/_layout-grid.scss ($responsive-gap-suffixes)
|
|
17
|
+
* - packages/styles/src/utilities/_flex.scss (align, justify, gap)
|
|
18
|
+
* - packages/styles/src/core/typography.scss ($body-sizes, $ui-sizes,
|
|
19
|
+
* $ui-underline-styles, $display-sizes)
|
|
16
20
|
*
|
|
17
21
|
* Do not hand-write a class name into the markdown. Add it to a scale and let
|
|
18
22
|
* the renderer emit it, so a name can never appear here without a scale entry
|
|
19
23
|
* behind it.
|
|
20
24
|
*
|
|
21
|
-
* `npm run verify:utility-docs` compiles the stylesheet and asserts
|
|
22
|
-
* class this tool names exists
|
|
25
|
+
* `npm run verify:utility-docs` compiles the stylesheet and asserts, in both
|
|
26
|
+
* directions, that every class this tool names exists and every class the
|
|
27
|
+
* stylesheet defines is documented here. Run it after touching any scale.
|
|
23
28
|
*/
|
|
24
29
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
25
30
|
declare const UTILITY_DOCS: {
|
|
26
|
-
|
|
31
|
+
display: string;
|
|
27
32
|
flex: string;
|
|
33
|
+
float: string;
|
|
34
|
+
grid: string;
|
|
28
35
|
spacing: string;
|
|
29
|
-
display: string;
|
|
30
36
|
opacity: string;
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
overflow: string;
|
|
38
|
+
position: string;
|
|
33
39
|
responsive: string;
|
|
40
|
+
typography: string;
|
|
41
|
+
zindex: string;
|
|
34
42
|
componentSpacing: string;
|
|
35
43
|
};
|
|
36
44
|
/**
|
|
@@ -47,9 +55,21 @@ declare const UTILITY_DOCS: {
|
|
|
47
55
|
*/
|
|
48
56
|
declare const KNOWN_ABSENT: readonly string[];
|
|
49
57
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
58
|
+
* Classes the reference says have no breakpoint-prefixed versions.
|
|
59
|
+
* `verify-utility-docs.mjs` asserts the stylesheet defines none of them with
|
|
60
|
+
* a `nys-{breakpoint}:` prefix, and that every other documented class has one.
|
|
61
|
+
*/
|
|
62
|
+
declare const NOT_RESPONSIVE: readonly RegExp[];
|
|
63
|
+
/**
|
|
64
|
+
* Class families the reference documents by pattern rather than by listing
|
|
65
|
+
* every name (e.g. `nys-margin-{direction}-{value}`). The verifier counts a
|
|
66
|
+
* stylesheet class as documented if it is named outright or matches one of
|
|
67
|
+
* these.
|
|
68
|
+
*/
|
|
69
|
+
declare const DOCUMENTED_PATTERNS: readonly RegExp[];
|
|
70
|
+
/**
|
|
71
|
+
* Exported so `src/scripts/verify-utility-docs.mjs` can check this reference
|
|
72
|
+
* against the compiled stylesheet in both directions.
|
|
53
73
|
*/
|
|
54
|
-
export { UTILITY_DOCS, KNOWN_ABSENT };
|
|
74
|
+
export { UTILITY_DOCS, KNOWN_ABSENT, NOT_RESPONSIVE, DOCUMENTED_PATTERNS };
|
|
55
75
|
export declare function registerUtilityTools(server: McpServer): void;
|
|
@@ -15,10 +15,8 @@ export type NysAccordionitemToggleEvent = CustomEvent<NysAccordionitemToggleDeta
|
|
|
15
15
|
* Place inside `nys-accordion`. Set `expanded` to open by default. The heading acts as a toggle button
|
|
16
16
|
* accessible via click, Enter, or Space. Parent accordion controls `bordered` and `singleSelect` behavior.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* reader users can jump between them by heading. Set `headingLevel` (here or on
|
|
21
|
-
* the parent `nys-accordion`) to the level that fits the surrounding page.
|
|
18
|
+
* The toggle button sits inside a real heading (`h2`-`h6`). Set `headingLevel`
|
|
19
|
+
* here or on the parent `nys-accordion` to match the surrounding page.
|
|
22
20
|
*
|
|
23
21
|
* @summary Collapsible panel for use within nys-accordion with keyboard support.
|
|
24
22
|
* @element nys-accordionitem
|
|
@@ -60,14 +58,10 @@ export declare class NysAccordionItem extends NysElement {
|
|
|
60
58
|
/**
|
|
61
59
|
* Heading element that wraps the toggle button (`h2` through `h6`).
|
|
62
60
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* it empty to follow the `headingLevel` of the enclosing `nys-accordion`,
|
|
66
|
-
* which is the usual way to set it for a whole group; `h3` applies when
|
|
67
|
-
* neither is specified. `h1` is not offered because an accordion trigger is
|
|
68
|
-
* never the page title.
|
|
61
|
+
* Use one level below the heading that introduces the accordion. If unset,
|
|
62
|
+
* the item follows the parent `nys-accordion`, then falls back to `h3`.
|
|
69
63
|
*/
|
|
70
|
-
headingLevel: "h2" | "h3" | "h4" | "h5" | "h6" |
|
|
64
|
+
headingLevel: "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
71
65
|
/** Whether the content panel is visible. Toggle via click or keyboard. */
|
|
72
66
|
expanded: boolean;
|
|
73
67
|
/** Adds border styling. Set by parent `nys-accordion`, not directly. */
|
|
@@ -83,15 +77,7 @@ export declare class NysAccordionItem extends NysElement {
|
|
|
83
77
|
* Functions
|
|
84
78
|
* --------------------------------------------------------------------------
|
|
85
79
|
*/
|
|
86
|
-
/**
|
|
87
|
-
* The level actually rendered: this item's own `headingLevel`, otherwise the
|
|
88
|
-
* one set on the enclosing `nys-accordion`, otherwise the `h3` default.
|
|
89
|
-
*
|
|
90
|
-
* The group's value is read here rather than pushed down from the container
|
|
91
|
-
* so there is a single source of truth per item and an item-level value
|
|
92
|
-
* always wins. `nys-accordion` re-renders its items when its own level
|
|
93
|
-
* changes (see `_notifyHeadingLevel` there).
|
|
94
|
-
*/
|
|
80
|
+
/** The item's own level, else the parent accordion's, else `h3`. */
|
|
95
81
|
private _resolveHeadingLevel;
|
|
96
82
|
private _dispatchEvent;
|
|
97
83
|
private _handleExpand;
|
|
@@ -102,13 +88,7 @@ export declare class NysAccordionItem extends NysElement {
|
|
|
102
88
|
* Helper Render Functions
|
|
103
89
|
* --------------------------------------------------------------------------
|
|
104
90
|
*/
|
|
105
|
-
/**
|
|
106
|
-
* WAI-ARIA Accordion pattern: the toggle button must be contained in a
|
|
107
|
-
* heading at the level appropriate for the surrounding page. A real `h2`-`h6`
|
|
108
|
-
* element is used rather than `role="heading"` + `aria-level` so the trigger
|
|
109
|
-
* carries native heading semantics everywhere — including the places that
|
|
110
|
-
* read the DOM instead of the accessibility tree.
|
|
111
|
-
*/
|
|
91
|
+
/** Wraps the toggle button in a real heading, per the WAI-ARIA accordion pattern. */
|
|
112
92
|
private _renderHeading;
|
|
113
93
|
render(): TemplateResult<1>;
|
|
114
94
|
}
|
|
@@ -232,11 +232,11 @@ export declare class NysButton extends NysFormControlElement {
|
|
|
232
232
|
*/
|
|
233
233
|
ariaCurrent: "page" | "step" | "location" | "date" | "time" | "true" | "false" | "";
|
|
234
234
|
/**
|
|
235
|
-
*
|
|
235
|
+
* NYSDS icon name (see `nys-icon`) shown before the label. Not shown for `circle` mode.
|
|
236
236
|
*/
|
|
237
237
|
prefixIcon: string;
|
|
238
238
|
/**
|
|
239
|
-
*
|
|
239
|
+
* NYSDS icon name (see `nys-icon`) shown after the label. Use `chevron_down` for dropdowns, `open_in_new` for external links. Not shown for `circle` mode.
|
|
240
240
|
*/
|
|
241
241
|
suffixIcon: string;
|
|
242
242
|
/**
|
|
@@ -273,9 +273,10 @@ export declare class NysButton extends NysFormControlElement {
|
|
|
273
273
|
*/
|
|
274
274
|
value: string;
|
|
275
275
|
/**
|
|
276
|
-
*
|
|
276
|
+
* Aria description for the button's name. Useful for adding additional SR context
|
|
277
|
+
* such as hint texts from the nys-tooltip (since that cannot be resolved by `ariaDescribedBy`).
|
|
277
278
|
*/
|
|
278
|
-
|
|
279
|
+
ariaDescription: string;
|
|
279
280
|
/**
|
|
280
281
|
* Form behavior: `button` (default, no form action), `submit` (submits form), `reset` (resets form). Always set explicitly to avoid unintended submissions.
|
|
281
282
|
* @default "button"
|
|
@@ -298,7 +299,7 @@ export declare class NysButton extends NysFormControlElement {
|
|
|
298
299
|
* Link target: `_self` (same tab), `_blank` (new tab—add `suffixIcon="open_in_new"`), `_parent`, `_top`, or frame name.
|
|
299
300
|
* @default "_self"
|
|
300
301
|
*/
|
|
301
|
-
target: "_self" | "_blank" | "_parent" | "_top" |
|
|
302
|
+
target: "_self" | "_blank" | "_parent" | "_top" | string;
|
|
302
303
|
private _hasPrefixSlot;
|
|
303
304
|
private _hasSuffixSlot;
|
|
304
305
|
private _hasCircleSlot;
|
|
@@ -355,7 +355,7 @@ export declare class NysCard extends NysElement {
|
|
|
355
355
|
/**
|
|
356
356
|
* Link target: `_self` (same tab), `_blank` (new tab), `_parent`, `_top`, or frame name. Only used with `href`.
|
|
357
357
|
*/
|
|
358
|
-
target: "_self" | "_blank" | "_parent" | "_top" |
|
|
358
|
+
target: "_self" | "_blank" | "_parent" | "_top" | string;
|
|
359
359
|
/**
|
|
360
360
|
* Click handler. Makes the whole card a single `<button>`. Use instead of
|
|
361
361
|
* `@click` to ensure keyboard accessibility. Keep the card's slots free of
|
|
@@ -290,6 +290,7 @@ export declare class NysCombobox extends NysFormControlElement {
|
|
|
290
290
|
* --------------------------------------------------------------------------
|
|
291
291
|
*/
|
|
292
292
|
private _setValue;
|
|
293
|
+
private _isRequiredMissing;
|
|
293
294
|
private _manageRequire;
|
|
294
295
|
private _setValidityMessage;
|
|
295
296
|
private _validate;
|
|
@@ -202,6 +202,7 @@ export declare class NysDatepicker extends NysFormControlElement {
|
|
|
202
202
|
connectedCallback(): void;
|
|
203
203
|
disconnectedCallback(): void;
|
|
204
204
|
firstUpdated(): Promise<void>;
|
|
205
|
+
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
205
206
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
206
207
|
private _whenWcDatepickerReady;
|
|
207
208
|
/**
|
|
@@ -199,6 +199,7 @@ export declare class NysFileinput extends NysFormControlElement {
|
|
|
199
199
|
private _dragActive;
|
|
200
200
|
private get _isDropDisabled();
|
|
201
201
|
private get _innerNysButton();
|
|
202
|
+
private get _selectionSummary();
|
|
202
203
|
/**
|
|
203
204
|
* Lifecycle methods
|
|
204
205
|
* --------------------------------------------------------------------------
|
|
@@ -208,27 +209,17 @@ export declare class NysFileinput extends NysFormControlElement {
|
|
|
208
209
|
connectedCallback(): void;
|
|
209
210
|
disconnectedCallback(): void;
|
|
210
211
|
firstUpdated(): void;
|
|
212
|
+
willUpdate(changedProperties: Map<string, unknown>): void;
|
|
211
213
|
updated(changedProperties: Map<string, unknown>): void;
|
|
212
214
|
/**
|
|
213
|
-
*
|
|
214
|
-
* dropzone mode, at the "or drag here" instructional text.
|
|
215
|
+
* Sets the accessible description of the "Choose file" button.
|
|
215
216
|
*
|
|
216
|
-
* The
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* drop target and never receives focus.
|
|
223
|
-
*
|
|
224
|
-
* The button and these targets sit in different shadow roots, so an IDREF
|
|
225
|
-
* written on the button would dangle. ARIA element reflection does cross into a
|
|
226
|
-
* shadow-including ancestor tree, so associateControlRefs sets the control's own
|
|
227
|
-
* ariaDescribedByElements (plus an aria-description string fallback for engines
|
|
228
|
-
* that expose the IDL but do not yet honor it). aria-describedby — not
|
|
229
|
-
* aria-errormessage — is what Blink actually surfaces for a control inside a
|
|
230
|
-
* shadow root; see src/scripts/verify-a11y-names.mjs. aria-errormessage is set
|
|
231
|
-
* through its element-reflection form where the engine supports it.
|
|
217
|
+
* The real button lives inside <nys-button>'s shadow root, so a normal
|
|
218
|
+
* aria-describedby id can't reach elements out here. Instead we link the
|
|
219
|
+
* elements directly with associateControlRefs. The description is built, in
|
|
220
|
+
* order, from: the dropzone hint, the selected-files summary, and the error
|
|
221
|
+
* message. An aria-description string is also set for browsers that ignore
|
|
222
|
+
* element references.
|
|
232
223
|
*/
|
|
233
224
|
private _syncControlErrorAssociation;
|
|
234
225
|
/**
|
|
@@ -45,6 +45,12 @@ export declare class NysFileItem extends NysElement {
|
|
|
45
45
|
progress: number;
|
|
46
46
|
/** Error message displayed when status is `error`. */
|
|
47
47
|
errorMessage: string;
|
|
48
|
+
/**
|
|
49
|
+
* Label of the field this file belongs to. Set by `nys-fileinput` so screen
|
|
50
|
+
* readers know which field a remove button or progress bar belongs to.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
fieldLabel: string;
|
|
48
54
|
/**
|
|
49
55
|
* True when this item is actually in an error state. `aria-invalid` reflects
|
|
50
56
|
* this rather than being hardcoded, so a healthy item is never announced as
|
|
@@ -60,6 +66,8 @@ export declare class NysFileItem extends NysElement {
|
|
|
60
66
|
* rather than the filename, which is not id-safe and not stable.
|
|
61
67
|
*/
|
|
62
68
|
private get _errorId();
|
|
69
|
+
/** Accessible name for the remove button. Includes the field label from `nys-fileinput` when set. */
|
|
70
|
+
private get _removeAriaLabel();
|
|
63
71
|
private _handleRemove;
|
|
64
72
|
private splitFilename;
|
|
65
73
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -89,7 +89,7 @@ import { NysElement } from "@nysds/internals";
|
|
|
89
89
|
* <nys-globalheader nysLogo appName="Admin Dashboard"></nys-globalheader>
|
|
90
90
|
* ```
|
|
91
91
|
*
|
|
92
|
-
*
|
|
92
|
+
* @example Custom landmark label
|
|
93
93
|
* ```html
|
|
94
94
|
* <!-- Names the banner landmark directly instead of from the visible title.
|
|
95
95
|
* Keep it distinct from nys-unavheader's ("New York State"). -->
|
|
@@ -219,5 +219,6 @@ export declare class NysGlobalHeader extends NysElement {
|
|
|
219
219
|
* has something to point at, so the landmark never carries both.
|
|
220
220
|
*/
|
|
221
221
|
private get _bannerLabel();
|
|
222
|
+
private _renderNames;
|
|
222
223
|
render(): import("lit-html").TemplateResult<1>;
|
|
223
224
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NysElement } from "@nysds/internals";
|
|
2
2
|
import { NysIconWatcher } from "./icon-library-registry";
|
|
3
3
|
/**
|
|
4
|
-
* Renders SVG icons from a registered icon library. The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Renders SVG icons from a registered icon library. The default library is
|
|
5
|
+
* the curated NYSDS icon set built into the package; only its names render
|
|
6
|
+
* without setup. Other libraries (Font Awesome, Material Icons, your own
|
|
7
|
+
* SVGs, etc.) can be registered via `registerIconLibrary()` and selected with
|
|
8
|
+
* `library`.
|
|
7
9
|
*
|
|
8
10
|
* Pass `name` to select an icon. Use `library` to choose a registered library
|
|
9
11
|
* (defaults to `"default"` for NYSDS icons). Use `ariaLabel` to make the icon
|
|
@@ -20,7 +22,7 @@ import { NysIconWatcher } from "./icon-library-registry";
|
|
|
20
22
|
* - Pair icons with a text label—few icons are universally understood alone.
|
|
21
23
|
* - Use icons consistently: same icon and label for the same meaning throughout your app.
|
|
22
24
|
* - Use `ariaLabel` when the icon conveys meaning, so screen readers can announce its purpose.
|
|
23
|
-
* - Use icons from the NYS Design System library
|
|
25
|
+
* - Use icons from the NYS Design System library. If it doesn't have the icon you need, register another library with `registerIconLibrary()` and set `library`.
|
|
24
26
|
* - Match icon size and color to the design system.
|
|
25
27
|
* - Don't use an icon if its meaning isn't immediately clear—if you suspect users won't recognize it, remove it.
|
|
26
28
|
* - Don't use icons to compensate for unclear page hierarchy or confusing content organization.
|
|
@@ -9,7 +9,7 @@ import "@nysds/nys-icon";
|
|
|
9
9
|
* @summary An icon-paired list item for use inside `<nys-iconlist>`.
|
|
10
10
|
* @element nys-iconlistitem
|
|
11
11
|
*
|
|
12
|
-
* @prop {string} icon -
|
|
12
|
+
* @prop {string} icon - NYSDS icon name passed to `<nys-icon>`.
|
|
13
13
|
*
|
|
14
14
|
* @slot - Primary label text.
|
|
15
15
|
* @slot secondary - Optional second line of text rendered below the primary label.
|
|
@@ -17,7 +17,7 @@ import "@nysds/nys-icon";
|
|
|
17
17
|
export declare class NysIconlistitem extends NysElement {
|
|
18
18
|
static styles: import("lit").CSSResult;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* NYSDS icon name (see `nys-icon`) displayed beside the label.
|
|
21
21
|
*/
|
|
22
22
|
icon: string;
|
|
23
23
|
/**
|
|
@@ -195,13 +195,9 @@ export declare class NysModal extends NysElement {
|
|
|
195
195
|
open: boolean;
|
|
196
196
|
/** Prevents dismissal via close button or Escape key. User must take an action. */
|
|
197
197
|
mandatory: boolean;
|
|
198
|
-
/**
|
|
199
|
-
* Modal width: `sm` (400px), `md` (600px), or `lg` (800px).
|
|
200
|
-
* @default "md"
|
|
201
|
-
*/
|
|
202
|
-
width: "sm" | "md" | "lg";
|
|
203
198
|
private _actionButtonSlot;
|
|
204
199
|
private _prevFocusedElement;
|
|
200
|
+
private _originalHtmlOverflow;
|
|
205
201
|
private _originalBodyOverflow;
|
|
206
202
|
private _mobileMedia;
|
|
207
203
|
private hasBodySlots;
|
|
@@ -211,7 +207,6 @@ export declare class NysModal extends NysElement {
|
|
|
211
207
|
* --------------------------------------------------------------------------
|
|
212
208
|
*/
|
|
213
209
|
constructor();
|
|
214
|
-
private _boundHandleKeydown;
|
|
215
210
|
connectedCallback(): void;
|
|
216
211
|
disconnectedCallback(): void;
|
|
217
212
|
updated(changeProps: Map<string, any>): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./nys-onthispage";
|