@nysds/components 1.23.0 → 1.23.2

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.
Files changed (31) hide show
  1. package/custom-elements.json +47 -107
  2. package/dist/.vscode/vscode.html-custom-data.json +5 -37
  3. package/dist/custom-elements.json +47 -107
  4. package/dist/{nys-icon.library-B1pGtdv1.js → nys-icon.library-BRplkAua.js} +2 -2
  5. package/dist/{nys-icon.library-B1pGtdv1.js.map → nys-icon.library-BRplkAua.js.map} +1 -1
  6. package/dist/{nys-icon.library-dR8B2cmh-D2cWTOx2.js → nys-icon.library-DPR9yd8U-CCjVAKg8.js} +3 -3
  7. package/dist/{nys-icon.library-dR8B2cmh-D2cWTOx2.js.map → nys-icon.library-DPR9yd8U-CCjVAKg8.js.map} +1 -1
  8. package/dist/nysds.es.js +1641 -1615
  9. package/dist/nysds.es.js.map +1 -1
  10. package/dist/nysds.js +265 -266
  11. package/dist/nysds.js.map +1 -1
  12. package/dist/packages/mcp-server/src/lib/framework-snippets.d.ts +1 -1
  13. package/dist/packages/mcp-server/src/lib/framework-usage.d.ts +2 -1
  14. package/dist/packages/mcp-server/src/lib/search.d.ts +1 -5
  15. package/dist/packages/mcp-server/src/lib/token-parser.d.ts +44 -1
  16. package/dist/packages/mcp-server/src/resources/components.d.ts +1 -1
  17. package/dist/packages/mcp-server/src/resources/guides.d.ts +1 -1
  18. package/dist/packages/mcp-server/src/tools/guide-tools.d.ts +10 -0
  19. package/dist/packages/mcp-server/src/tools/utility-tools.d.ts +36 -16
  20. package/dist/packages/nys-button/src/nys-button.d.ts +1 -1
  21. package/dist/packages/nys-card/src/nys-card.d.ts +1 -1
  22. package/dist/packages/nys-combobox/src/nys-combobox.d.ts +1 -0
  23. package/dist/packages/nys-datepicker/src/nys-datepicker.d.ts +1 -0
  24. package/dist/packages/nys-fileinput/src/nys-fileinput.d.ts +1 -0
  25. package/dist/packages/nys-modal/src/nys-modal.d.ts +1 -6
  26. package/dist/packages/nys-radiobutton/src/nys-radiogroup.d.ts +1 -0
  27. package/dist/packages/nys-select/src/nys-select.d.ts +1 -0
  28. package/dist/packages/nys-stepper/src/nys-stepper.d.ts +2 -2
  29. package/dist/packages/nys-unavheader/src/nys-unavheader.d.ts +8 -9
  30. package/dist/packages/nys-verticalnav/src/nys-verticalnav.d.ts +9 -0
  31. package/package.json +1 -1
@@ -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 `"angular"` — the import
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;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Search Utilities
3
3
  *
4
- * Fuzzy search functionality for components and tokens.
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, color, etc.) */
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 { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
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 ($spacing, $opacity-values,
11
- * $zindex-values, $display-values,
12
- * $breakpoints, $flex-columns)
13
- * - packages/styles/src/utilities/_layout-grid.scss ($responsive-gap-suffixes)
14
- * - packages/styles/src/core/typography.scss ($body-sizes, $ui-sizes,
15
- * $ui-underline-styles, $display-sizes)
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 that every
22
- * class this tool names exists in it. Run it after touching any scale.
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
- grid: string;
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
- zindex: string;
32
- typography: string;
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
- * Exported so `src/scripts/verify-utility-docs.mjs` can assert that every class
51
- * named in this reference exists in the compiled stylesheet — and that every
52
- * class named in KNOWN_ABSENT still does not.
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;
@@ -298,7 +298,7 @@ export declare class NysButton extends NysFormControlElement {
298
298
  * Link target: `_self` (same tab), `_blank` (new tab—add `suffixIcon="open_in_new"`), `_parent`, `_top`, or frame name.
299
299
  * @default "_self"
300
300
  */
301
- target: "_self" | "_blank" | "_parent" | "_top" | "framename";
301
+ target: "_self" | "_blank" | "_parent" | "_top" | string;
302
302
  private _hasPrefixSlot;
303
303
  private _hasSuffixSlot;
304
304
  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" | "framename";
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
  /**
@@ -208,6 +208,7 @@ export declare class NysFileinput extends NysFormControlElement {
208
208
  connectedCallback(): void;
209
209
  disconnectedCallback(): void;
210
210
  firstUpdated(): void;
211
+ willUpdate(changedProperties: Map<string, unknown>): void;
211
212
  updated(changedProperties: Map<string, unknown>): void;
212
213
  /**
213
214
  * Point the exposed control at the rendered <nys-errormessage> and, in
@@ -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>;
@@ -194,6 +194,7 @@ export declare class NysRadiogroup extends NysFormControlElement {
194
194
  connectedCallback(): void;
195
195
  disconnectedCallback(): void;
196
196
  firstUpdated(): Promise<void>;
197
+ willUpdate(changedProperties: Map<string | symbol, unknown>): void;
197
198
  updated(changedProperties: Map<string | symbol, unknown>): void;
198
199
  /**
199
200
  * Form Integration
@@ -262,6 +262,7 @@ export declare class NysSelect extends NysFormControlElement {
262
262
  private _handleChange;
263
263
  private _handleFocus;
264
264
  private _handleBlur;
265
+ willUpdate(changedProperties: Map<string, unknown>): void;
265
266
  updated(changedProperties: Map<string, unknown>): void;
266
267
  render(): import("lit-html").TemplateResult<1>;
267
268
  }
@@ -199,8 +199,8 @@ export declare class NysStepper extends NysElement {
199
199
  name: string;
200
200
  /** Title displayed above the step list and compact counter. */
201
201
  label: string;
202
- /** Progress text displayed in compact mode (e.g., "Step 2 of 5"). Auto-managed — do not set manually. */
203
- counterText: string;
202
+ /** Progress text displayed in compact mode (e.g., "Step 2 of 5"). Derived from the steps. */
203
+ private _counterText;
204
204
  /** Whether compact mobile view is expanded to show all steps. Toggled by clicking the counter. */
205
205
  isCompactExpanded: boolean;
206
206
  private _stepsNumbered;
@@ -144,14 +144,14 @@ export declare const NYS_ALERT_URL_STAGE = "https://alerts-cta-stage.static-asse
144
144
  */
145
145
  export declare class NysUnavHeader extends NysElement {
146
146
  static styles: import("lit").CSSResult;
147
- /** Internal: Whether trust bar panel is expanded. */
148
- trustbarVisible: boolean;
149
- /** Internal: Whether search dropdown is visible (mobile). */
150
- searchDropdownVisible: boolean;
151
- /** Internal: Whether language dropdown is visible. */
152
- languageVisible: boolean;
153
- /** Internal: Whether search input is focused. */
154
- isSearchFocused: boolean;
147
+ /** Whether trust bar panel is expanded. */
148
+ private _trustbarVisible;
149
+ /** Whether search dropdown is visible (mobile). */
150
+ private _searchDropdownVisible;
151
+ /** Whether language dropdown is visible. */
152
+ private _languageVisible;
153
+ /** Whether search input is focused. */
154
+ private _isSearchFocused;
155
155
  /** Hides the translation dropdown. */
156
156
  hideTranslate: boolean;
157
157
  /** Hides the search functionality. */
@@ -271,7 +271,6 @@ export declare class NysUnavHeader extends NysElement {
271
271
  * so every option is a Smartling subdomain link.
272
272
  */
273
273
  private _languageHref;
274
- private _initGoogletagmanager;
275
274
  private _initLocalize;
276
275
  private _toggleSearchDropdown;
277
276
  /**
@@ -2,6 +2,13 @@ import { NysElement } from "@nysds/internals";
2
2
  import "./nys-verticalnavgroup";
3
3
  import "@nysds/nys-accordion";
4
4
  type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
5
+ /** Detail payload for the `nys-verticalnav-toggle` event fired by `nys-verticalnav`. */
6
+ export interface NysVerticalnavToggleDetail {
7
+ id: string;
8
+ expanded: boolean;
9
+ }
10
+ /** The `nys-verticalnav-toggle` event fired by `nys-verticalnav`. */
11
+ export type NysVerticalnavToggleEvent = CustomEvent<NysVerticalnavToggleDetail>;
5
12
  /**
6
13
  * Vertical navigation component with responsive desktop/mobile behavior.
7
14
  *
@@ -15,6 +22,8 @@ type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
15
22
  * @summary Responsive navigation that becomes an accordion on smaller screens.
16
23
  * @element nys-verticalnav
17
24
  *
25
+ * @fires {NysVerticalnavToggleEvent} nys-verticalnav-toggle - Fired when the mobile accordion opens or closes. Detail: `{id, expanded}`. Bubbles and composed.
26
+ *
18
27
  * @usage
19
28
  * - Use for navigation where every item links to a different page.
20
29
  * - Use for section-level navigation within a site.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nysds/components",
3
- "version": "1.23.0",
3
+ "version": "1.23.2",
4
4
  "description": "New York State's design system and code component library.",
5
5
  "type": "module",
6
6
  "workspaces": [