@nysds/components 1.16.0-alpha4 → 1.16.0-alpha5
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 +377 -32
- package/dist/custom-elements.json +377 -32
- package/dist/nysds.es.js +1 -1
- package/dist/nysds.es.js.map +1 -1
- package/dist/nysds.js +1 -1
- package/dist/nysds.js.map +1 -1
- package/dist/packages/mcp-server/src/lib/cem-parser.d.ts +6 -0
- package/dist/packages/mcp-server/src/lib/format.d.ts +21 -0
- package/dist/packages/mcp-server/src/tools/component-tools.d.ts +3 -5
- package/dist/packages/mcp-server/src/tools/guide-tools.d.ts +8 -0
- package/dist/packages/mcp-server/src/tools/token-tools.d.ts +2 -5
- package/dist/packages/mcp-server/src/tools/utility-tools.d.ts +7 -0
- package/dist/packages/mcp-server/src/tools/validation-tools.d.ts +1 -2
- package/dist/packages/nys-stepper/src/nys-step.d.ts +35 -0
- package/dist/packages/nys-stepper/src/nys-stepper.d.ts +38 -0
- package/package.json +5 -2
|
@@ -43,6 +43,11 @@ export interface CEMCssPart {
|
|
|
43
43
|
name: string;
|
|
44
44
|
description?: string;
|
|
45
45
|
}
|
|
46
|
+
export interface CEMExample {
|
|
47
|
+
title: string;
|
|
48
|
+
code: string;
|
|
49
|
+
lang?: string;
|
|
50
|
+
}
|
|
46
51
|
export interface CEMDeclaration {
|
|
47
52
|
kind: "class";
|
|
48
53
|
name: string;
|
|
@@ -59,6 +64,7 @@ export interface CEMDeclaration {
|
|
|
59
64
|
name: string;
|
|
60
65
|
package?: string;
|
|
61
66
|
};
|
|
67
|
+
examples?: CEMExample[];
|
|
62
68
|
}
|
|
63
69
|
export interface CEMModule {
|
|
64
70
|
kind: "javascript-module";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format Utilities
|
|
3
|
+
*
|
|
4
|
+
* Helpers for formatting MCP tool responses.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* JSON replacer that strips null and undefined values from objects.
|
|
8
|
+
* Use with JSON.stringify(obj, stripNulls, 2) for cleaner output.
|
|
9
|
+
*/
|
|
10
|
+
export declare function stripNulls(_key: string, value: unknown): unknown;
|
|
11
|
+
/**
|
|
12
|
+
* Format an object as JSON, stripping null/undefined values and empty arrays.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatResponse(data: unknown): string;
|
|
15
|
+
/**
|
|
16
|
+
* Create a text content response for MCP tools.
|
|
17
|
+
*/
|
|
18
|
+
export declare function textContent(data: unknown): {
|
|
19
|
+
type: "text";
|
|
20
|
+
text: string;
|
|
21
|
+
};
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* MCP tools for working with NYSDS components.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* - find_components: Search by name/description (fuzzy)
|
|
10
|
-
* - get_usage_guide: Installation and usage patterns
|
|
6
|
+
* Tools:
|
|
7
|
+
* - find_components: Search or list all components
|
|
8
|
+
* - get_component: Full documentation for a specific component
|
|
11
9
|
*/
|
|
12
10
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
13
11
|
export declare function registerComponentTools(server: McpServer): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guide Tools
|
|
3
|
+
*
|
|
4
|
+
* Consolidated MCP tool for NYSDS guides and documentation.
|
|
5
|
+
* Loads guide content from data/guides/ markdown files.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
export declare function registerGuideTools(server: McpServer): void;
|
|
@@ -4,12 +4,9 @@
|
|
|
4
4
|
* MCP tools for working with NYSDS design tokens.
|
|
5
5
|
*
|
|
6
6
|
* Tools:
|
|
7
|
-
* -
|
|
7
|
+
* - get_tokens: Get tokens, categories, or themes
|
|
8
8
|
* - find_tokens: Search tokens by CSS variable, value, or description
|
|
9
|
-
* -
|
|
10
|
-
* - get_token_value: Get detailed info for a specific token
|
|
11
|
-
* - validate_token_usage: Validate token usage in context
|
|
12
|
-
* - list_token_categories: List categories with token counts
|
|
9
|
+
* - get_token_info: Get detailed token info with optional context validation
|
|
13
10
|
* - get_token_graph: Get token dependency graph
|
|
14
11
|
*/
|
|
15
12
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* MCP tools for validating NYSDS component usage.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Tools:
|
|
7
7
|
* - validate_component_api: Validate prop/attribute usage
|
|
8
|
-
* - setup_framework: Framework-specific guides
|
|
9
8
|
*/
|
|
10
9
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
10
|
export declare function registerValidationTools(server: McpServer): void;
|
|
@@ -5,6 +5,41 @@ import { LitElement } from "lit";
|
|
|
5
5
|
* Mark as `current` to indicate active progress point. Previous steps become clickable for navigation.
|
|
6
6
|
* Set `href` for page-based navigation or listen to `nys-step-click` for SPA routing.
|
|
7
7
|
*
|
|
8
|
+
* ## Step States
|
|
9
|
+
*
|
|
10
|
+
* Understanding the three step states is critical for proper stepper usage:
|
|
11
|
+
*
|
|
12
|
+
* - **`selected`** - Which step is currently being displayed/viewed. This controls which step's
|
|
13
|
+
* content is shown. Defaults to `current` if not set. Cannot be set on a step after `current`.
|
|
14
|
+
* Users can click previous steps to change `selected` without changing `current`.
|
|
15
|
+
*
|
|
16
|
+
* - **`current`** - The furthest step the user has reached. This is the progress boundary.
|
|
17
|
+
* Update this as the user completes steps and advances. Steps after `current` are not navigable.
|
|
18
|
+
* Only one step should have `current` at a time.
|
|
19
|
+
*
|
|
20
|
+
* - **`previous`** - Auto-applied by the stepper to all steps before `current`. Do not set manually.
|
|
21
|
+
* Steps with `previous` are clickable and allow the user to navigate back.
|
|
22
|
+
*
|
|
23
|
+
* ## Common Patterns
|
|
24
|
+
*
|
|
25
|
+
* **Initial state:** Set `current` on the first step. `selected` will default to it.
|
|
26
|
+
* ```html
|
|
27
|
+
* <nys-step label="Step 1" current></nys-step>
|
|
28
|
+
* <nys-step label="Step 2"></nys-step>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* **User completed step 1, now on step 2:**
|
|
32
|
+
* ```html
|
|
33
|
+
* <nys-step label="Step 1"></nys-step>
|
|
34
|
+
* <nys-step label="Step 2" current></nys-step>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* **User went back to review step 1 (but progress is still at step 2):**
|
|
38
|
+
* ```html
|
|
39
|
+
* <nys-step label="Step 1" selected></nys-step>
|
|
40
|
+
* <nys-step label="Step 2" current></nys-step>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
8
43
|
* @summary Individual step for use within nys-stepper with navigation support.
|
|
9
44
|
* @element nys-step
|
|
10
45
|
*
|
|
@@ -5,6 +5,7 @@ import "./nys-step";
|
|
|
5
5
|
*
|
|
6
6
|
* Add `nys-step` elements as children. Mark one step as `current` to indicate progress; previous steps become
|
|
7
7
|
* navigable. Compact view on mobile expands to show all steps. Use `actions` slot for navigation buttons.
|
|
8
|
+
* Do not place the stepper inside a form element.
|
|
8
9
|
*
|
|
9
10
|
* @summary Multi-step progress indicator with navigation and mobile-friendly compact view.
|
|
10
11
|
* @element nys-stepper
|
|
@@ -20,6 +21,43 @@ import "./nys-step";
|
|
|
20
21
|
* <nys-step label="Review"></nys-step>
|
|
21
22
|
* </nys-stepper>
|
|
22
23
|
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Grid layout with sidebar placement
|
|
26
|
+
* Use NYSDS grid utilities to position the stepper as a sidebar alongside form content.
|
|
27
|
+
* **Layout requirements:**
|
|
28
|
+
* - Wrap in `nys-grid-container` > `nys-grid-row`
|
|
29
|
+
* - Use mobile-first classes: `nys-grid-col-12` (stacks on mobile) plus `nys-desktop:nys-grid-col-*`
|
|
30
|
+
* - Columns must total 12 (e.g., 3+9 or 4+8)
|
|
31
|
+
* - Recommended: stepper 3-4 cols, content 8-9 cols
|
|
32
|
+
* ```html
|
|
33
|
+
* <div class="nys-grid-container">
|
|
34
|
+
* <div class="nys-grid-row">
|
|
35
|
+
* <nys-stepper label="Application" class="nys-grid-col-12 nys-desktop:nys-grid-col-3">
|
|
36
|
+
* <nys-step label="Personal Info"></nys-step>
|
|
37
|
+
* <nys-step label="Contact" current></nys-step>
|
|
38
|
+
* <nys-step label="Review"></nys-step>
|
|
39
|
+
* </nys-stepper>
|
|
40
|
+
* <main class="nys-grid-col-12 nys-desktop:nys-grid-col-9" id="main-content">
|
|
41
|
+
* <!-- Form content for current step -->
|
|
42
|
+
* <nys-textinput label="Email" required></nys-textinput>
|
|
43
|
+
* <nys-textinput label="Phone"></nys-textinput>
|
|
44
|
+
* </main>
|
|
45
|
+
* </div>
|
|
46
|
+
* </div>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Navigation buttons in actions slot
|
|
50
|
+
* Add Previous/Next buttons using the actions slot. Wrap buttons in a `<div>`.
|
|
51
|
+
* ```html
|
|
52
|
+
* <nys-stepper label="Application">
|
|
53
|
+
* <nys-step label="Step 1"></nys-step>
|
|
54
|
+
* <nys-step label="Step 2" current></nys-step>
|
|
55
|
+
* <nys-step label="Step 3"></nys-step>
|
|
56
|
+
* <div slot="actions">
|
|
57
|
+
* <nys-button label="Save and Exit" variant="outline" size="sm" fullWidth></nys-button>
|
|
58
|
+
* </div>
|
|
59
|
+
* </nys-stepper>
|
|
60
|
+
* ```
|
|
23
61
|
*/
|
|
24
62
|
export declare class NysStepper extends LitElement {
|
|
25
63
|
static styles: import("lit").CSSResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nysds/components",
|
|
3
|
-
"version": "1.16.0-
|
|
3
|
+
"version": "1.16.0-alpha5",
|
|
4
4
|
"description": "New York State's design system and code component library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"workspaces": [
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"tsc:packages": "tsc -b tsconfig.build.json",
|
|
35
35
|
"build:packages": "npm run tsc:packages && turbo run build --filter='./packages/*' --log-order=grouped",
|
|
36
36
|
"build:root": "cross-env NODE_ENV=production npm run build && cross-env NODE_ENV=production npm run build:umd",
|
|
37
|
-
"build:all": "npm run clean:dist && npm run lint && npm run lit-analyze || true && cross-env NODE_ENV=production npm run build:packages && npm run build:root && npm run cem && npm run mcp
|
|
37
|
+
"build:all": "npm run clean:dist && npm run lint && npm run lit-analyze || true && cross-env NODE_ENV=production npm run build:packages && npm run build:root && npm run cem && npm run build:mcp",
|
|
38
|
+
"build:mcp": "npm run build -w @nysds/mcp-server",
|
|
38
39
|
"build:link": "npm run build:all && npm link && cd packages/styles && npm link",
|
|
39
40
|
"lint": "eslint --cache --cache-location node_modules/.cache/eslint && stylelint **/*.scss || true",
|
|
40
41
|
"lint:fix": "eslint --fix && stylelint **/*.scss --fix",
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
"@web/test-runner": "^0.20.2",
|
|
86
87
|
"@web/test-runner-commands": "^0.9.0",
|
|
87
88
|
"@web/test-runner-playwright": "^0.11.1",
|
|
89
|
+
"cem-plugin-examples": "github:its-hcd/cem-plugin-examples",
|
|
88
90
|
"cross-env": "^10.1.0",
|
|
89
91
|
"custom-element-react-wrappers": "^1.7.3",
|
|
90
92
|
"custom-element-vs-code-integration": "^1.5.0",
|
|
@@ -97,6 +99,7 @@
|
|
|
97
99
|
"lit": "^3.3.1",
|
|
98
100
|
"lit-analyzer": "^2.0.3",
|
|
99
101
|
"plop": "^4.0.4",
|
|
102
|
+
"prettier": "^3.8.1",
|
|
100
103
|
"rollup-plugin-esbuild-minify": "^1.3.0",
|
|
101
104
|
"rollup-plugin-minify-template-literals": "^1.1.7",
|
|
102
105
|
"rollup-plugin-visualizer": "^6.0.5",
|