@nysds/mcp-server 1.20.1 → 1.21.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.
|
@@ -1463,10 +1463,10 @@
|
|
|
1463
1463
|
"kind": "field",
|
|
1464
1464
|
"name": "intent",
|
|
1465
1465
|
"type": {
|
|
1466
|
-
"text": "| \"
|
|
1466
|
+
"text": "| \"base\"\n | \"info\"\n | \"success\"\n | \"warning\"\n | \"danger\"\n | \"error\"\n | \"emergency\""
|
|
1467
1467
|
},
|
|
1468
|
-
"default": "\"
|
|
1469
|
-
"description": "Semantic intent affecting color: `
|
|
1468
|
+
"default": "\"base\"",
|
|
1469
|
+
"description": "Semantic intent affecting color: `base`, `info`, `success`, `warning` `danger`, `emergency`. `error` has been deprecated and support will be removed in a future release. Use `danger` instead",
|
|
1470
1470
|
"attribute": "intent",
|
|
1471
1471
|
"reflects": true
|
|
1472
1472
|
},
|
|
@@ -1502,12 +1502,13 @@
|
|
|
1502
1502
|
},
|
|
1503
1503
|
{
|
|
1504
1504
|
"kind": "field",
|
|
1505
|
-
"name": "
|
|
1505
|
+
"name": "strong",
|
|
1506
1506
|
"type": {
|
|
1507
|
-
"text": "
|
|
1507
|
+
"text": "boolean"
|
|
1508
1508
|
},
|
|
1509
|
-
"default": "
|
|
1510
|
-
"
|
|
1509
|
+
"default": "false",
|
|
1510
|
+
"description": "Strong visual intent with bolder text and background.",
|
|
1511
|
+
"attribute": "strong",
|
|
1511
1512
|
"reflects": true
|
|
1512
1513
|
},
|
|
1513
1514
|
{
|
|
@@ -1553,7 +1554,7 @@
|
|
|
1553
1554
|
"privacy": "private",
|
|
1554
1555
|
"static": true,
|
|
1555
1556
|
"readonly": true,
|
|
1556
|
-
"default": "{
|
|
1557
|
+
"default": "{ base: \"info\", info: \"info\", success: \"check_circle\", warning: \"warning\", danger: \"error\", error: \"error\", emergency: \"emergency_home\", }",
|
|
1557
1558
|
"description": "Functions\n--------------------------------------------------------------------------"
|
|
1558
1559
|
},
|
|
1559
1560
|
{
|
|
@@ -1565,7 +1566,7 @@
|
|
|
1565
1566
|
"privacy": "private",
|
|
1566
1567
|
"static": true,
|
|
1567
1568
|
"readonly": true,
|
|
1568
|
-
"default": "{
|
|
1569
|
+
"default": "{ info: \"Info\", success: \"Success\", warning: \"Warning\", danger: \"Danger\", error: \"Danger\", emergency: \"Emergency\", }"
|
|
1569
1570
|
},
|
|
1570
1571
|
{
|
|
1571
1572
|
"kind": "method",
|
|
@@ -1633,10 +1634,10 @@
|
|
|
1633
1634
|
{
|
|
1634
1635
|
"name": "intent",
|
|
1635
1636
|
"type": {
|
|
1636
|
-
"text": "| \"
|
|
1637
|
+
"text": "| \"base\"\n | \"info\"\n | \"success\"\n | \"warning\"\n | \"danger\"\n | \"error\"\n | \"emergency\""
|
|
1637
1638
|
},
|
|
1638
|
-
"default": "\"
|
|
1639
|
-
"description": "Semantic intent affecting color: `
|
|
1639
|
+
"default": "\"base\"",
|
|
1640
|
+
"description": "Semantic intent affecting color: `base`, `info`, `success`, `warning` `danger`, `emergency`. `error` has been deprecated and support will be removed in a future release. Use `danger` instead",
|
|
1640
1641
|
"fieldName": "intent",
|
|
1641
1642
|
"propName": "intent"
|
|
1642
1643
|
},
|
|
@@ -1671,13 +1672,14 @@
|
|
|
1671
1672
|
"propName": "srtext"
|
|
1672
1673
|
},
|
|
1673
1674
|
{
|
|
1674
|
-
"name": "
|
|
1675
|
+
"name": "strong",
|
|
1675
1676
|
"type": {
|
|
1676
|
-
"text": "
|
|
1677
|
+
"text": "boolean"
|
|
1677
1678
|
},
|
|
1678
|
-
"default": "
|
|
1679
|
-
"
|
|
1680
|
-
"
|
|
1679
|
+
"default": "false",
|
|
1680
|
+
"description": "Strong visual intent with bolder text and background.",
|
|
1681
|
+
"fieldName": "strong",
|
|
1682
|
+
"propName": "strong"
|
|
1681
1683
|
},
|
|
1682
1684
|
{
|
|
1683
1685
|
"name": "prefixicon",
|
|
@@ -1710,8 +1712,13 @@
|
|
|
1710
1712
|
"lang": "html"
|
|
1711
1713
|
},
|
|
1712
1714
|
{
|
|
1713
|
-
"title": "
|
|
1714
|
-
"code": "<nys-badge label=\"
|
|
1715
|
+
"title": "Info Intent",
|
|
1716
|
+
"code": "<nys-badge label=\"Info\" intent=\"info\" prefixIcon></nys-badge>",
|
|
1717
|
+
"lang": "html"
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
"title": "Success Intent",
|
|
1721
|
+
"code": "<nys-badge label=\"Success\" intent=\"success\" prefixIcon></nys-badge>",
|
|
1715
1722
|
"lang": "html"
|
|
1716
1723
|
},
|
|
1717
1724
|
{
|
|
@@ -1720,28 +1727,38 @@
|
|
|
1720
1727
|
"lang": "html"
|
|
1721
1728
|
},
|
|
1722
1729
|
{
|
|
1723
|
-
"title": "
|
|
1724
|
-
"code": "<nys-badge label=\"
|
|
1730
|
+
"title": "Danger Intent",
|
|
1731
|
+
"code": "<nys-badge label=\"Danger\" intent=\"danger\" prefixIcon></nys-badge>",
|
|
1725
1732
|
"lang": "html"
|
|
1726
1733
|
},
|
|
1727
1734
|
{
|
|
1728
|
-
"title": "
|
|
1729
|
-
"code": "<nys-badge
|
|
1735
|
+
"title": "Emergency Intent",
|
|
1736
|
+
"code": "<nys-badge label=\"Emergency\" intent=\"emergency\" prefixIcon></nys-badge>",
|
|
1730
1737
|
"lang": "html"
|
|
1731
1738
|
},
|
|
1732
1739
|
{
|
|
1733
|
-
"title": "Strong
|
|
1734
|
-
"code": "<nys-badge
|
|
1740
|
+
"title": "Strong Base",
|
|
1741
|
+
"code": "<nys-badge strong label=\"Base\" prefixIcon></nys-badge>",
|
|
1735
1742
|
"lang": "html"
|
|
1736
1743
|
},
|
|
1737
1744
|
{
|
|
1738
|
-
"title": "Strong
|
|
1739
|
-
"code": "<nys-badge
|
|
1745
|
+
"title": "Strong Info",
|
|
1746
|
+
"code": "<nys-badge strong label=\"Info\" intent=\"info\" prefixIcon></nys-badge>",
|
|
1740
1747
|
"lang": "html"
|
|
1741
1748
|
},
|
|
1742
1749
|
{
|
|
1743
1750
|
"title": "Strong Success",
|
|
1744
|
-
"code": "<nys-badge
|
|
1751
|
+
"code": "<nys-badge strong label=\"Success\" intent=\"success\" prefixIcon></nys-badge>",
|
|
1752
|
+
"lang": "html"
|
|
1753
|
+
},
|
|
1754
|
+
{
|
|
1755
|
+
"title": "Strong Warning",
|
|
1756
|
+
"code": "<nys-badge strong label=\"Warning\" intent=\"warning\" prefixIcon></nys-badge>",
|
|
1757
|
+
"lang": "html"
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
"title": "Strong Danger",
|
|
1761
|
+
"code": "<nys-badge strong label=\"Danger\" intent=\"danger\" prefixIcon></nys-badge>",
|
|
1745
1762
|
"lang": "html"
|
|
1746
1763
|
},
|
|
1747
1764
|
{
|
package/data/tokens/tokens.css
CHANGED
|
@@ -2,7 +2,55 @@
|
|
|
2
2
|
* Utility Tools
|
|
3
3
|
*
|
|
4
4
|
* MCP tools for NYSDS utility classes.
|
|
5
|
+
*
|
|
6
|
+
* The class lists this tool returns are RENDERED from the scale constants
|
|
7
|
+
* below. Those constants mirror the Sass sources that actually generate the
|
|
8
|
+
* stylesheet:
|
|
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)
|
|
16
|
+
*
|
|
17
|
+
* Do not hand-write a class name into the markdown. Add it to a scale and let
|
|
18
|
+
* the renderer emit it, so a name can never appear here without a scale entry
|
|
19
|
+
* behind it.
|
|
20
|
+
*
|
|
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.
|
|
5
23
|
*/
|
|
6
24
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
25
|
+
declare const UTILITY_DOCS: {
|
|
26
|
+
grid: string;
|
|
27
|
+
flex: string;
|
|
28
|
+
spacing: string;
|
|
29
|
+
display: string;
|
|
30
|
+
opacity: string;
|
|
31
|
+
zindex: string;
|
|
32
|
+
typography: string;
|
|
33
|
+
responsive: string;
|
|
34
|
+
componentSpacing: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Classes the reference deliberately names in order to say they do NOT exist.
|
|
38
|
+
*
|
|
39
|
+
* These are the names people reach for out of habit from other frameworks.
|
|
40
|
+
* Saying so explicitly is more useful than silence, but it means the docs
|
|
41
|
+
* mention class names the stylesheet does not define, which would otherwise
|
|
42
|
+
* trip the verifier.
|
|
43
|
+
*
|
|
44
|
+
* `verify-utility-docs.mjs` asserts each of these is genuinely absent, so if
|
|
45
|
+
* NYSDS ever adds one, the stale warning fails the check instead of quietly
|
|
46
|
+
* misinforming people.
|
|
47
|
+
*/
|
|
48
|
+
declare const KNOWN_ABSENT: readonly string[];
|
|
49
|
+
/**
|
|
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.
|
|
53
|
+
*/
|
|
54
|
+
export { UTILITY_DOCS, KNOWN_ABSENT };
|
|
7
55
|
export declare function registerUtilityTools(server: McpServer): void;
|
|
8
56
|
//# sourceMappingURL=utility-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility-tools.d.ts","sourceRoot":"","sources":["../../src/tools/utility-tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utility-tools.d.ts","sourceRoot":"","sources":["../../src/tools/utility-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiLzE,QAAA,MAAM,YAAY;;;;;;;;;;CAyOjB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,YAAY,EAAE,SAAS,MAAM,EAUlC,CAAC;AAEF;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAEtC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8D5D"}
|
|
@@ -2,8 +2,150 @@
|
|
|
2
2
|
* Utility Tools
|
|
3
3
|
*
|
|
4
4
|
* MCP tools for NYSDS utility classes.
|
|
5
|
+
*
|
|
6
|
+
* The class lists this tool returns are RENDERED from the scale constants
|
|
7
|
+
* below. Those constants mirror the Sass sources that actually generate the
|
|
8
|
+
* stylesheet:
|
|
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)
|
|
16
|
+
*
|
|
17
|
+
* Do not hand-write a class name into the markdown. Add it to a scale and let
|
|
18
|
+
* the renderer emit it, so a name can never appear here without a scale entry
|
|
19
|
+
* behind it.
|
|
20
|
+
*
|
|
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.
|
|
5
23
|
*/
|
|
6
24
|
import { z } from "zod";
|
|
25
|
+
/**
|
|
26
|
+
* `$spacing` in _config.scss. The utilities emit literal pixel values, not
|
|
27
|
+
* `var(--nys-space-*)` references, so the rendered docs quote pixels.
|
|
28
|
+
*
|
|
29
|
+
* There is deliberately no `0` key: `nys-margin-0` and `nys-padding-0` are
|
|
30
|
+
* not generated.
|
|
31
|
+
*/
|
|
32
|
+
const SPACING = [
|
|
33
|
+
["1px", "1px"],
|
|
34
|
+
["2px", "2px"],
|
|
35
|
+
["50", "4px", "0.25rem"],
|
|
36
|
+
["100", "8px", "0.5rem"],
|
|
37
|
+
["150", "12px", "0.75rem"],
|
|
38
|
+
["200", "16px", "1rem"],
|
|
39
|
+
["250", "20px", "1.25rem"],
|
|
40
|
+
["300", "24px", "1.5rem"],
|
|
41
|
+
["400", "32px", "2rem"],
|
|
42
|
+
["500", "40px", "2.5rem"],
|
|
43
|
+
["600", "48px", "3rem"],
|
|
44
|
+
["700", "56px", "3.5rem"],
|
|
45
|
+
["800", "64px", "4rem"],
|
|
46
|
+
["1200", "96px", "6rem"],
|
|
47
|
+
];
|
|
48
|
+
/** `$responsive-gap-suffixes` in _layout-grid.scss. */
|
|
49
|
+
const RESPONSIVE_GAP_KEYS = [
|
|
50
|
+
"400",
|
|
51
|
+
"500",
|
|
52
|
+
"600",
|
|
53
|
+
"700",
|
|
54
|
+
"800",
|
|
55
|
+
"1200",
|
|
56
|
+
];
|
|
57
|
+
/** `$opacity-values` in _config.scss. */
|
|
58
|
+
const OPACITY = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
|
|
59
|
+
/** `$zindex-values` in _config.scss. */
|
|
60
|
+
const ZINDEX = [
|
|
61
|
+
["0", "0"],
|
|
62
|
+
["100", "100"],
|
|
63
|
+
["200", "200"],
|
|
64
|
+
["300", "300"],
|
|
65
|
+
["400", "400"],
|
|
66
|
+
["500", "500"],
|
|
67
|
+
["auto", "auto"],
|
|
68
|
+
["bottom", "-100"],
|
|
69
|
+
["top", "99999"],
|
|
70
|
+
];
|
|
71
|
+
/** `$display-values` in _config.scss. */
|
|
72
|
+
const DISPLAY = [
|
|
73
|
+
"none",
|
|
74
|
+
"block",
|
|
75
|
+
"inline",
|
|
76
|
+
"inline-block",
|
|
77
|
+
"flex",
|
|
78
|
+
"inline-flex",
|
|
79
|
+
"table",
|
|
80
|
+
"table-cell",
|
|
81
|
+
"table-row",
|
|
82
|
+
];
|
|
83
|
+
/** `$breakpoints` in _config.scss. */
|
|
84
|
+
const BREAKPOINTS = [
|
|
85
|
+
["mobile-lg", "30em", "480px"],
|
|
86
|
+
["tablet", "40em", "640px"],
|
|
87
|
+
["desktop", "64em", "1024px"],
|
|
88
|
+
["widescreen", "87.5em", "1400px"],
|
|
89
|
+
];
|
|
90
|
+
/** Typography scales in core/typography.scss. */
|
|
91
|
+
const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
|
|
92
|
+
const BODY_SIZES = ["xs", "sm", "md"];
|
|
93
|
+
const UI_SIZES = ["xs", "sm", "md", "lg", "xl"];
|
|
94
|
+
const DISPLAY_SIZES = ["sm", "md", "lg", "xl"];
|
|
95
|
+
/** `$ui-underline-styles` — only these size/weight pairs are generated. */
|
|
96
|
+
const UI_UNDERLINE = [
|
|
97
|
+
["sm", "semibold"],
|
|
98
|
+
["md", "semibold"],
|
|
99
|
+
["md", "regular"],
|
|
100
|
+
["lg", "semibold"],
|
|
101
|
+
];
|
|
102
|
+
const FLEX_ALIGN = [
|
|
103
|
+
"start",
|
|
104
|
+
"center",
|
|
105
|
+
"end",
|
|
106
|
+
"baseline",
|
|
107
|
+
"stretch",
|
|
108
|
+
];
|
|
109
|
+
const FLEX_JUSTIFY = [
|
|
110
|
+
"start",
|
|
111
|
+
"center",
|
|
112
|
+
"end",
|
|
113
|
+
"space-between",
|
|
114
|
+
"space-around",
|
|
115
|
+
"space-evenly",
|
|
116
|
+
];
|
|
117
|
+
/* ------------------------------------------------------------------ *
|
|
118
|
+
* Renderers
|
|
119
|
+
* ------------------------------------------------------------------ */
|
|
120
|
+
const spacingKeys = SPACING.map(([key]) => key);
|
|
121
|
+
const bullets = (lines) => lines.join("\n");
|
|
122
|
+
const inlineList = (items) => items.map((i) => `\`${i}\``).join(", ");
|
|
123
|
+
const spacingValueRows = bullets(SPACING.map(([key, px, rem]) => `- \`${key}\` - ${px}${rem ? ` (${rem})` : ""}`));
|
|
124
|
+
const gapValueRows = bullets(SPACING.map(([key, px, rem]) => {
|
|
125
|
+
const size = `${px}${rem ? ` (${rem})` : ""}`;
|
|
126
|
+
// Gaps in the responsive set are capped at 2rem below 64em. For 400 the
|
|
127
|
+
// cap equals the full value, so only note it where it actually differs.
|
|
128
|
+
const capped = RESPONSIVE_GAP_KEYS.includes(key) && Number.parseInt(px, 10) > 32;
|
|
129
|
+
return capped
|
|
130
|
+
? `- \`nys-grid-gap-${key}\` - ${size} at 64em and up, capped at 32px (2rem) below that`
|
|
131
|
+
: `- \`nys-grid-gap-${key}\` - ${size}`;
|
|
132
|
+
}));
|
|
133
|
+
const opacityRows = bullets(OPACITY.map((v) => {
|
|
134
|
+
const label = v === 0
|
|
135
|
+
? "Fully transparent"
|
|
136
|
+
: v === 100
|
|
137
|
+
? "Fully opaque"
|
|
138
|
+
: `${v}% opaque`;
|
|
139
|
+
return `- \`nys-opacity-${v}\` - opacity: ${v / 100} (${label})`;
|
|
140
|
+
}));
|
|
141
|
+
const zindexRows = bullets(ZINDEX.map(([name, value]) => `- \`nys-z-${name}\` - z-index: ${value}`));
|
|
142
|
+
const displayRows = bullets(DISPLAY.map((v) => `- \`nys-display-${v}\` - display: ${v}`));
|
|
143
|
+
const breakpointRows = bullets(BREAKPOINTS.map(([name, em, px]) => `- \`nys-${name}:\` - ${em} (${px}) and up`));
|
|
144
|
+
const headingRows = bullets(HEADING_LEVELS.map((n) => `- \`nys-font-h${n}\` - Heading level ${n} type style`));
|
|
145
|
+
const underlineRows = bullets(UI_UNDERLINE.flatMap(([size, weight]) => [
|
|
146
|
+
`- \`nys-font-ui-${size}-${weight}-underline\` - UI ${size} ${weight}, 7% underline`,
|
|
147
|
+
`- \`nys-font-ui-${size}-${weight}-underline-strong\` - UI ${size} ${weight}, 14% underline`,
|
|
148
|
+
]));
|
|
7
149
|
const UTILITY_DOCS = {
|
|
8
150
|
grid: `## Grid System
|
|
9
151
|
|
|
@@ -26,20 +168,11 @@ NYSDS provides a 12-column responsive grid system.
|
|
|
26
168
|
- \`nys-grid-col-fill\` - Column fills remaining space
|
|
27
169
|
|
|
28
170
|
### Gap Classes
|
|
29
|
-
- \`nys-grid-gap-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- \`nys-grid-gap-200\` - 16px gap (1rem)
|
|
35
|
-
- \`nys-grid-gap-250\` - 20px gap (1.25rem)
|
|
36
|
-
- \`nys-grid-gap-300\` - 24px gap (1.5rem)
|
|
37
|
-
- \`nys-grid-gap-400\` - 32px gap (2rem)
|
|
38
|
-
- \`nys-grid-gap-500\` - 40px gap (2.5rem)
|
|
39
|
-
- \`nys-grid-gap-600\` - 48px gap (3rem)
|
|
40
|
-
- \`nys-grid-gap-700\` - 56px gap (3.5rem)
|
|
41
|
-
- \`nys-grid-gap-800\` - 64px gap (4rem)
|
|
42
|
-
- \`nys-grid-gap-1200\` - 96px gap (6rem)
|
|
171
|
+
Gap classes apply to \`nys-grid-row\`. Use \`nys-grid-gap-x-*\` or
|
|
172
|
+
\`nys-grid-gap-y-*\` for a single axis. There is no \`nys-grid-gap-0\`; omit
|
|
173
|
+
the gap class instead.
|
|
174
|
+
|
|
175
|
+
${gapValueRows}
|
|
43
176
|
|
|
44
177
|
### Offset Classes
|
|
45
178
|
- \`nys-grid-offset-[1-12]\` - Offset column by 1-12 columns
|
|
@@ -61,6 +194,7 @@ NYSDS provides a 12-column responsive grid system.
|
|
|
61
194
|
|
|
62
195
|
### Display
|
|
63
196
|
- \`nys-display-flex\` - Sets display: flex
|
|
197
|
+
- \`nys-display-inline-flex\` - Sets display: inline-flex
|
|
64
198
|
|
|
65
199
|
### Direction
|
|
66
200
|
- \`nys-flex-row\` - Row direction (default)
|
|
@@ -71,21 +205,26 @@ NYSDS provides a 12-column responsive grid system.
|
|
|
71
205
|
- \`nys-flex-no-wrap\` - Prevent wrapping
|
|
72
206
|
|
|
73
207
|
### Alignment (Cross Axis)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
208
|
+
${bullets(FLEX_ALIGN.map((v) => `- \`nys-flex-align-${v}\` - align-items: ${v}`))}
|
|
209
|
+
|
|
210
|
+
### Self Alignment
|
|
211
|
+
${bullets(FLEX_ALIGN.map((v) => `- \`nys-flex-align-self-${v}\` - align-self: ${v}`))}
|
|
78
212
|
|
|
79
213
|
### Justification (Main Axis)
|
|
80
|
-
|
|
81
|
-
- \`nys-flex-justify-center\` - Justify to center
|
|
82
|
-
- \`nys-flex-justify-end\` - Justify to end
|
|
214
|
+
${bullets(FLEX_JUSTIFY.map((v) => `- \`nys-flex-justify-${v}\` - justify-content: ${v}`))}
|
|
83
215
|
|
|
84
216
|
### Flex Sizing
|
|
85
217
|
- \`nys-flex-[1-12]\` - Flex grow/shrink values
|
|
86
218
|
- \`nys-flex-auto\` - flex: auto (grow and shrink)
|
|
87
219
|
- \`nys-flex-fill\` - Fill available space
|
|
88
220
|
|
|
221
|
+
### Gaps
|
|
222
|
+
Available on the spacing scale: ${inlineList(spacingKeys)}
|
|
223
|
+
|
|
224
|
+
- \`nys-flex-gap-{value}\` - gap on both axes
|
|
225
|
+
- \`nys-flex-row-gap-{value}\` - row-gap only
|
|
226
|
+
- \`nys-flex-column-gap-{value}\` - column-gap only
|
|
227
|
+
|
|
89
228
|
### Example: Button Group
|
|
90
229
|
\`\`\`html
|
|
91
230
|
<div class="nys-display-flex nys-flex-justify-end nys-flex-gap-200">
|
|
@@ -111,21 +250,11 @@ Pattern: \`nys-{property}-{direction}-{value}\`
|
|
|
111
250
|
- (none) - All sides
|
|
112
251
|
|
|
113
252
|
### Values
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- \`150\` - var(--nys-space-150) = 0.375rem (6px)
|
|
120
|
-
- \`200\` - var(--nys-space-200) = 0.5rem (8px)
|
|
121
|
-
- \`250\` - var(--nys-space-250) = 0.625rem (10px)
|
|
122
|
-
- \`300\` - var(--nys-space-300) = 0.75rem (12px)
|
|
123
|
-
- \`400\` - var(--nys-space-400) = 1rem (16px)
|
|
124
|
-
- \`500\` - var(--nys-space-500) = 1.25rem (20px)
|
|
125
|
-
- \`600\` - var(--nys-space-600) = 1.5rem (24px)
|
|
126
|
-
- \`700\` - var(--nys-space-700) = 2rem (32px)
|
|
127
|
-
- \`800\` - var(--nys-space-800) = 2.5rem (40px)
|
|
128
|
-
- \`1200\` - var(--nys-space-1200) = 4rem (64px)
|
|
253
|
+
The utilities emit literal pixel values. There is no zero and no \`auto\`
|
|
254
|
+
value — \`nys-margin-0\` and \`nys-padding-0\` are not generated. Omit the
|
|
255
|
+
class instead.
|
|
256
|
+
|
|
257
|
+
${spacingValueRows}
|
|
129
258
|
|
|
130
259
|
### Examples
|
|
131
260
|
\`\`\`html
|
|
@@ -140,11 +269,7 @@ Pattern: \`nys-{property}-{direction}-{value}\`
|
|
|
140
269
|
\`\`\``,
|
|
141
270
|
display: `## Display Utilities
|
|
142
271
|
|
|
143
|
-
|
|
144
|
-
- \`nys-display-block\` - Block display
|
|
145
|
-
- \`nys-display-inline\` - Inline display
|
|
146
|
-
- \`nys-display-inline-block\` - Inline-block display
|
|
147
|
-
- \`nys-display-flex\` - Flex display
|
|
272
|
+
${displayRows}
|
|
148
273
|
|
|
149
274
|
### Example: Hide on Mobile
|
|
150
275
|
\`\`\`html
|
|
@@ -154,46 +279,57 @@ Pattern: \`nys-{property}-{direction}-{value}\`
|
|
|
154
279
|
\`\`\``,
|
|
155
280
|
opacity: `## Opacity Utilities
|
|
156
281
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- \`nys-opacity-75\` - 75% opacity
|
|
161
|
-
- \`nys-opacity-100\` - Fully opaque`,
|
|
282
|
+
The scale steps by 10 — there is no \`nys-opacity-25\` or \`nys-opacity-75\`.
|
|
283
|
+
|
|
284
|
+
${opacityRows}`,
|
|
162
285
|
zindex: `## Z-Index Utilities
|
|
163
286
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
- \`nys-z-40\` - z-index: 40
|
|
169
|
-
- \`nys-z-50\` - z-index: 50
|
|
170
|
-
- \`nys-z-auto\` - z-index: auto`,
|
|
287
|
+
The scale steps by 100, not by 10. \`nys-z-10\` through \`nys-z-50\` do not
|
|
288
|
+
exist — the comparable values are \`nys-z-100\` through \`nys-z-500\`.
|
|
289
|
+
|
|
290
|
+
${zindexRows}`,
|
|
171
291
|
typography: `## Typography Utilities
|
|
172
292
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
293
|
+
NYSDS ships a role-based type scale, not atomic text modifiers. Each class
|
|
294
|
+
sets font-family, size, and line-height together, matching the text styles in
|
|
295
|
+
the NYSDS Foundations Figma file.
|
|
296
|
+
|
|
297
|
+
There are NO text-alignment, text-transform, or font-weight utilities
|
|
298
|
+
(no \`nys-text-center\`, no \`nys-font-bold\`). Use CSS for those.
|
|
299
|
+
|
|
300
|
+
### Headings
|
|
301
|
+
${headingRows}
|
|
302
|
+
|
|
303
|
+
### Body
|
|
304
|
+
${bullets(BODY_SIZES.map((s) => `- \`nys-font-body-${s}\` - Body text, ${s}`))}
|
|
305
|
+
|
|
306
|
+
### UI
|
|
307
|
+
${bullets(UI_SIZES.map((s) => `- \`nys-font-ui-${s}\` - UI text, ${s}`))}
|
|
308
|
+
|
|
309
|
+
### UI Underline
|
|
310
|
+
${underlineRows}
|
|
311
|
+
|
|
312
|
+
### Display
|
|
313
|
+
${bullets(DISPLAY_SIZES.map((s) => `- \`nys-font-display-${s}\` - Display text, ${s}`))}
|
|
314
|
+
|
|
315
|
+
### Agency
|
|
316
|
+
- \`nys-font-agency\` - Agency / application title
|
|
317
|
+
|
|
318
|
+
### Font family hooks
|
|
319
|
+
These are attribute selectors, not standalone classes. They set only
|
|
320
|
+
font-family on any element whose class list contains the substring, so pair
|
|
321
|
+
them with a size class:
|
|
322
|
+
|
|
323
|
+
- \`[class*="nys-font-mono-"]\` - monospace family
|
|
324
|
+
- \`[class*="nys-font-sans-"]\` - sans-serif family
|
|
325
|
+
- \`[class*="nys-font-serif-"]\` - serif family`,
|
|
188
326
|
responsive: `## Responsive Breakpoints
|
|
189
327
|
|
|
190
328
|
NYSDS utility classes support responsive prefixes.
|
|
191
329
|
|
|
192
330
|
### Breakpoints
|
|
193
331
|
- (no prefix) - All screen sizes (mobile-first)
|
|
194
|
-
|
|
195
|
-
- \`nys-tablet:\` - 40em (640px) and up
|
|
196
|
-
- \`nys-desktop:\` - 64em (1024px) and up
|
|
332
|
+
${breakpointRows}
|
|
197
333
|
|
|
198
334
|
### Pattern
|
|
199
335
|
\`nys-{breakpoint}:nys-{class}\`
|
|
@@ -236,6 +372,35 @@ When adding spacing around NYSDS components, use utility classes rather than wra
|
|
|
236
372
|
<nys-button label="Submit"></nys-button>
|
|
237
373
|
\`\`\``,
|
|
238
374
|
};
|
|
375
|
+
/**
|
|
376
|
+
* Classes the reference deliberately names in order to say they do NOT exist.
|
|
377
|
+
*
|
|
378
|
+
* These are the names people reach for out of habit from other frameworks.
|
|
379
|
+
* Saying so explicitly is more useful than silence, but it means the docs
|
|
380
|
+
* mention class names the stylesheet does not define, which would otherwise
|
|
381
|
+
* trip the verifier.
|
|
382
|
+
*
|
|
383
|
+
* `verify-utility-docs.mjs` asserts each of these is genuinely absent, so if
|
|
384
|
+
* NYSDS ever adds one, the stale warning fails the check instead of quietly
|
|
385
|
+
* misinforming people.
|
|
386
|
+
*/
|
|
387
|
+
const KNOWN_ABSENT = [
|
|
388
|
+
"nys-text-center",
|
|
389
|
+
"nys-font-bold",
|
|
390
|
+
"nys-z-10",
|
|
391
|
+
"nys-z-50",
|
|
392
|
+
"nys-opacity-25",
|
|
393
|
+
"nys-opacity-75",
|
|
394
|
+
"nys-margin-0",
|
|
395
|
+
"nys-padding-0",
|
|
396
|
+
"nys-grid-gap-0",
|
|
397
|
+
];
|
|
398
|
+
/**
|
|
399
|
+
* Exported so `src/scripts/verify-utility-docs.mjs` can assert that every class
|
|
400
|
+
* named in this reference exists in the compiled stylesheet — and that every
|
|
401
|
+
* class named in KNOWN_ABSENT still does not.
|
|
402
|
+
*/
|
|
403
|
+
export { UTILITY_DOCS, KNOWN_ABSENT };
|
|
239
404
|
export function registerUtilityTools(server) {
|
|
240
405
|
// get_utility_classes - Comprehensive utility class reference
|
|
241
406
|
server.tool("get_utility_classes", "Get NYSDS utility class reference for layout, spacing, and styling", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nysds/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "MCP server for the New York State Design System. Exposes components, tokens, and documentation to AI assistants.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"zod": "^3.25"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@nysds/styles": "^1.
|
|
34
|
-
"@nysds/tokens": "^1.
|
|
33
|
+
"@nysds/styles": "^1.21.0",
|
|
34
|
+
"@nysds/tokens": "^1.21.0",
|
|
35
35
|
"@types/node": "^22.0.0",
|
|
36
36
|
"typescript": "^5.9.3"
|
|
37
37
|
},
|