@punica/components-mcp 0.9.1 → 0.10.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/README.md CHANGED
@@ -15,7 +15,8 @@ looks them up and validates its answer.
15
15
  | `search_components` | Finds elements by what they are for: "date range", "side navigation", "confirm dialog" |
16
16
  | `get_component` | One or more elements' whole API: attributes and their values, properties, methods, events, slots, parts, CSS properties, states |
17
17
  | `get_examples` | An element's documentation page as Markdown, with working HTML examples (fetched from the docs site) |
18
- | `validate_markup` | Checks HTML, JSX, Vue or script: unknown tags and 1.x names, attributes, values, slots, events, icon names; each problem with a fix |
18
+ | `validate_markup` | Checks HTML, JSX, Vue, script or CSS: unknown tags and 1.x names, attributes, values, slots, events, icon names, `var(--punica-*)` names that are not tokens; each problem with a fix |
19
+ | `get_tokens` | The `--punica-*` design tokens with their light and dark values, by group; `query` narrows them (`space`, `color`, `radius`) |
19
20
  | `get_guide` | The rules every element follows, or a guide page (theme, forms, frameworks, migration, accessibility, …) |
20
21
 
21
22
  Resources: `punica://guide` and `punica://component/<tag>`.
package/dist/bundled.json CHANGED
@@ -1 +1 @@
1
- {"version":"2.6.2"}
1
+ {"version":"2.7.0"}
@@ -327,152 +327,6 @@
327
327
  }
328
328
  ]
329
329
  },
330
- {
331
- "kind": "javascript-module",
332
- "path": "src/components/alert/alert.js",
333
- "declarations": [
334
- {
335
- "kind": "class",
336
- "description": "A message about the content beside it: a result, a warning, a tip.\n\nAn error or a warning is `role=alert` and interrupts a screen reader; any\nother colour is `role=status` and waits its turn.",
337
- "name": "PunicaAlert",
338
- "cssProperties": [
339
- {
340
- "description": "Corner radius.",
341
- "name": "--punica-alert-radius"
342
- },
343
- {
344
- "description": "Padding.",
345
- "name": "--punica-alert-padding"
346
- },
347
- {
348
- "description": "Space between icon, message and actions.",
349
- "name": "--punica-alert-gap"
350
- }
351
- ],
352
- "cssParts": [
353
- {
354
- "description": "The default icon.",
355
- "name": "icon"
356
- },
357
- {
358
- "description": "The wrapper around the message.",
359
- "name": "content"
360
- },
361
- {
362
- "description": "The wrapper around the actions.",
363
- "name": "actions"
364
- },
365
- {
366
- "description": "The close button.",
367
- "name": "close"
368
- }
369
- ],
370
- "slots": [
371
- {
372
- "description": "The message.",
373
- "name": ""
374
- },
375
- {
376
- "description": "An icon in place of the one the colour gives.",
377
- "name": "icon"
378
- },
379
- {
380
- "description": "Buttons that answer the message.",
381
- "name": "actions"
382
- }
383
- ],
384
- "members": [
385
- {
386
- "kind": "field",
387
- "name": "properties",
388
- "type": {
389
- "text": "object"
390
- },
391
- "static": true,
392
- "default": "{ color: {}, variant: {}, dismissible: { type: Boolean }, labelClose: { default: 'Close' } }"
393
- },
394
- {
395
- "kind": "field",
396
- "name": "styles",
397
- "static": true,
398
- "default": "styles"
399
- },
400
- {
401
- "kind": "field",
402
- "name": "template",
403
- "static": true,
404
- "default": "` <span class=\"icon\"><slot name=\"icon\"><span class=\"default info\">${icons.info}</span><span class=\"default success\">${icons.success}</span><span class=\"default warning\">${icons.warning}</span><span class=\"default error\">${icons.error}</span></slot></span> <div part=\"content\" class=\"content\"><slot></slot></div> <div part=\"actions\" class=\"actions\"><slot name=\"actions\"></slot></div> <button part=\"close\" class=\"close\" type=\"button\" hidden>${icons.close}</button> `"
405
- },
406
- {
407
- "kind": "field",
408
- "name": "#close",
409
- "privacy": "private"
410
- },
411
- {
412
- "kind": "method",
413
- "name": "update"
414
- },
415
- {
416
- "kind": "method",
417
- "name": "dismiss",
418
- "description": "Does what the close button does: fires `punica-dismiss` and, unless a\nlistener prevents it, hides the alert."
419
- }
420
- ],
421
- "events": [
422
- {
423
- "description": "The user pressed the close button. Cancelable: unless prevented, the alert hides itself with `hidden`.",
424
- "name": "punica-dismiss"
425
- }
426
- ],
427
- "attributes": [
428
- {
429
- "type": {
430
- "text": "'info' | 'success' | 'warning' | 'error' | 'primary' | 'secondary' | 'neutral'"
431
- },
432
- "description": "What the message is, `info` by default.",
433
- "name": "color"
434
- },
435
- {
436
- "type": {
437
- "text": "'tinted' | 'outlined' | 'filled'"
438
- },
439
- "description": "Visual weight, `tinted` by default.",
440
- "name": "variant"
441
- },
442
- {
443
- "type": {
444
- "text": "boolean"
445
- },
446
- "description": "Shows a close button.",
447
- "name": "dismissible"
448
- },
449
- {
450
- "type": {
451
- "text": "string"
452
- },
453
- "description": "Accessible name of the close button, `Close` by default.",
454
- "name": "label-close"
455
- }
456
- ],
457
- "superclass": {
458
- "name": "PunicaElement",
459
- "module": "/src/core/element.js"
460
- },
461
- "tagName": "punica-alert",
462
- "customElement": true
463
- }
464
- ],
465
- "exports": [
466
- {
467
- "kind": "js",
468
- "name": "PunicaAlert",
469
- "declaration": {
470
- "name": "PunicaAlert",
471
- "module": "src/components/alert/alert.js"
472
- }
473
- }
474
- ]
475
- },
476
330
  {
477
331
  "kind": "javascript-module",
478
332
  "path": "src/components/agenda/agenda.js",
@@ -1326,6 +1180,152 @@
1326
1180
  }
1327
1181
  ]
1328
1182
  },
1183
+ {
1184
+ "kind": "javascript-module",
1185
+ "path": "src/components/alert/alert.js",
1186
+ "declarations": [
1187
+ {
1188
+ "kind": "class",
1189
+ "description": "A message about the content beside it: a result, a warning, a tip.\n\nAn error or a warning is `role=alert` and interrupts a screen reader; any\nother colour is `role=status` and waits its turn.",
1190
+ "name": "PunicaAlert",
1191
+ "cssProperties": [
1192
+ {
1193
+ "description": "Corner radius.",
1194
+ "name": "--punica-alert-radius"
1195
+ },
1196
+ {
1197
+ "description": "Padding.",
1198
+ "name": "--punica-alert-padding"
1199
+ },
1200
+ {
1201
+ "description": "Space between icon, message and actions.",
1202
+ "name": "--punica-alert-gap"
1203
+ }
1204
+ ],
1205
+ "cssParts": [
1206
+ {
1207
+ "description": "The default icon.",
1208
+ "name": "icon"
1209
+ },
1210
+ {
1211
+ "description": "The wrapper around the message.",
1212
+ "name": "content"
1213
+ },
1214
+ {
1215
+ "description": "The wrapper around the actions.",
1216
+ "name": "actions"
1217
+ },
1218
+ {
1219
+ "description": "The close button.",
1220
+ "name": "close"
1221
+ }
1222
+ ],
1223
+ "slots": [
1224
+ {
1225
+ "description": "The message.",
1226
+ "name": ""
1227
+ },
1228
+ {
1229
+ "description": "An icon in place of the one the colour gives.",
1230
+ "name": "icon"
1231
+ },
1232
+ {
1233
+ "description": "Buttons that answer the message.",
1234
+ "name": "actions"
1235
+ }
1236
+ ],
1237
+ "members": [
1238
+ {
1239
+ "kind": "field",
1240
+ "name": "properties",
1241
+ "type": {
1242
+ "text": "object"
1243
+ },
1244
+ "static": true,
1245
+ "default": "{ color: {}, variant: {}, dismissible: { type: Boolean }, labelClose: { default: 'Close' } }"
1246
+ },
1247
+ {
1248
+ "kind": "field",
1249
+ "name": "styles",
1250
+ "static": true,
1251
+ "default": "styles"
1252
+ },
1253
+ {
1254
+ "kind": "field",
1255
+ "name": "template",
1256
+ "static": true,
1257
+ "default": "` <span class=\"icon\"><slot name=\"icon\"><span class=\"default info\">${icons.info}</span><span class=\"default success\">${icons.success}</span><span class=\"default warning\">${icons.warning}</span><span class=\"default error\">${icons.error}</span></slot></span> <div part=\"content\" class=\"content\"><slot></slot></div> <div part=\"actions\" class=\"actions\"><slot name=\"actions\"></slot></div> <button part=\"close\" class=\"close\" type=\"button\" hidden>${icons.close}</button> `"
1258
+ },
1259
+ {
1260
+ "kind": "field",
1261
+ "name": "#close",
1262
+ "privacy": "private"
1263
+ },
1264
+ {
1265
+ "kind": "method",
1266
+ "name": "update"
1267
+ },
1268
+ {
1269
+ "kind": "method",
1270
+ "name": "dismiss",
1271
+ "description": "Does what the close button does: fires `punica-dismiss` and, unless a\nlistener prevents it, hides the alert."
1272
+ }
1273
+ ],
1274
+ "events": [
1275
+ {
1276
+ "description": "The user pressed the close button. Cancelable: unless prevented, the alert hides itself with `hidden`.",
1277
+ "name": "punica-dismiss"
1278
+ }
1279
+ ],
1280
+ "attributes": [
1281
+ {
1282
+ "type": {
1283
+ "text": "'info' | 'success' | 'warning' | 'error' | 'primary' | 'secondary' | 'neutral'"
1284
+ },
1285
+ "description": "What the message is, `info` by default.",
1286
+ "name": "color"
1287
+ },
1288
+ {
1289
+ "type": {
1290
+ "text": "'tinted' | 'outlined' | 'filled'"
1291
+ },
1292
+ "description": "Visual weight, `tinted` by default.",
1293
+ "name": "variant"
1294
+ },
1295
+ {
1296
+ "type": {
1297
+ "text": "boolean"
1298
+ },
1299
+ "description": "Shows a close button.",
1300
+ "name": "dismissible"
1301
+ },
1302
+ {
1303
+ "type": {
1304
+ "text": "string"
1305
+ },
1306
+ "description": "Accessible name of the close button, `Close` by default.",
1307
+ "name": "label-close"
1308
+ }
1309
+ ],
1310
+ "superclass": {
1311
+ "name": "PunicaElement",
1312
+ "module": "/src/core/element.js"
1313
+ },
1314
+ "tagName": "punica-alert",
1315
+ "customElement": true
1316
+ }
1317
+ ],
1318
+ "exports": [
1319
+ {
1320
+ "kind": "js",
1321
+ "name": "PunicaAlert",
1322
+ "declaration": {
1323
+ "name": "PunicaAlert",
1324
+ "module": "src/components/alert/alert.js"
1325
+ }
1326
+ }
1327
+ ]
1328
+ },
1329
1329
  {
1330
1330
  "kind": "javascript-module",
1331
1331
  "path": "src/components/alertDialog/alertDialog.js",
package/dist/guide.md CHANGED
@@ -88,8 +88,11 @@ sheets and menus also have `show()` and `hide()`); they fire `punica-open` and `
88
88
 
89
89
  ## Theming
90
90
 
91
- Design tokens are `--punica-*` custom properties, built in. Override any of
92
- them; set `color-scheme` for light and dark:
91
+ Design tokens are `--punica-*` custom properties, built in. Their names are
92
+ exact and not guessable (spacing is named by pixel value: `--punica-space-16`
93
+ is 16px); a `var()` with a name that does not exist falls back without an
94
+ error. The list is in `@punica/components/tokens.css` (the MCP server's
95
+ `get_tokens`). Override any of them; set `color-scheme` for light and dark:
93
96
 
94
97
  ```css
95
98
  :root {
package/dist/server.mjs CHANGED
@@ -6,6 +6,62 @@ import { createRequire } from "node:module";
6
6
  import { dirname, join } from "node:path";
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
8
8
 
9
+ // ../../src/ai/tokens.mjs
10
+ function splitTop(text2) {
11
+ const parts = [];
12
+ let depth = 0;
13
+ let start = 0;
14
+ for (let i = 0; i < text2.length; i++) {
15
+ if (text2[i] === "(") depth++;
16
+ else if (text2[i] === ")") depth--;
17
+ else if (text2[i] === "," && depth === 0) {
18
+ parts.push(text2.slice(start, i));
19
+ start = i + 1;
20
+ }
21
+ }
22
+ parts.push(text2.slice(start));
23
+ return parts.map((p) => p.trim());
24
+ }
25
+ function parseTokens(css) {
26
+ const tokens = [];
27
+ const seen = /* @__PURE__ */ new Set();
28
+ let group = "";
29
+ const re = /\/\*\s*([\s\S]*?)\s*\*\/|(--punica-[\w-]+)\s*:\s*([^;]+);/g;
30
+ let match;
31
+ while (match = re.exec(css)) {
32
+ if (match[1] !== void 0) {
33
+ if (!match[1].includes("\n")) group = match[1].split(/[:(]/)[0].trim();
34
+ continue;
35
+ }
36
+ const [, , name, raw] = match;
37
+ if (seen.has(name)) continue;
38
+ seen.add(name);
39
+ const value = raw.replace(/\s+/g, " ").trim();
40
+ const pair = /^light-dark\((.+)\)$/.exec(value);
41
+ const [light, dark] = pair ? splitTop(pair[1]) : [];
42
+ tokens.push({ name, group, value, ...pair ? { light, dark } : {} });
43
+ }
44
+ return tokens;
45
+ }
46
+ function formatTokens(tokens, query) {
47
+ const q = (query || "").trim().toLowerCase();
48
+ const kept = q ? tokens.filter((t) => t.name.includes(q) || t.group.toLowerCase().includes(q)) : tokens;
49
+ if (!kept.length) return `No token matches "${query}". Groups: ${[...new Set(tokens.map((t) => t.group))].join(", ")}.`;
50
+ const lines = [];
51
+ let group = null;
52
+ for (const t of kept) {
53
+ if (t.group !== group) {
54
+ group = t.group;
55
+ lines.push("", `### ${group || "other"}`, "", "| Token | Value |", "|---|---|");
56
+ }
57
+ lines.push(`| \`${t.name}\` | ${t.light !== void 0 ? `light \`${t.light}\`, dark \`${t.dark}\`` : `\`${t.value}\``} |`);
58
+ }
59
+ return [
60
+ `${kept.length} of ${tokens.length} \`--punica-*\` design tokens. Use them as \`var(--punica-\u2026)\` with the exact name: a name that does not exist gives no error, only the fallback. Override one on \`:root\` or any element. Each element's own \`--punica-<element>-*\` properties are listed by get_component.`,
61
+ ...lines
62
+ ].join("\n");
63
+ }
64
+
9
65
  // src/create.mjs
10
66
  import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
11
67
  import { z } from "zod";
@@ -362,10 +418,13 @@ var SYNTHETIC = /* @__PURE__ */ new Set(["change", "input", "select", "open", "c
362
418
  var VOID = new Set("area base br col embed hr img input link meta param source track wbr".split(" "));
363
419
  var RAW_TEXT = /* @__PURE__ */ new Set(["script", "style", "textarea", "title"]);
364
420
  var camelToKebab = (name) => name.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
365
- function createValidator(knowledge) {
366
- function validate(source2, options = {}) {
421
+ function createValidator(knowledge, options = {}) {
422
+ const tokenNames = new Set((options.tokens || []).map((t) => t.name));
423
+ const knownProperties = new Set(tokenNames);
424
+ if (tokenNames.size) for (const element of knowledge.elements.values()) for (const p of element.cssProperties) knownProperties.add(p.name);
425
+ function validate(source2, options2 = {}) {
367
426
  const text2 = String(source2);
368
- const kind = options.kind || guessKind(text2);
427
+ const kind = options2.kind || guessKind(text2);
369
428
  const findings = [];
370
429
  const lineStarts = [0];
371
430
  for (let i = 0; i < text2.length; i++) if (text2[i] === "\n") lineStarts.push(i + 1);
@@ -386,6 +445,7 @@ function createValidator(knowledge) {
386
445
  scanScript(text2, usesPunica, report);
387
446
  }
388
447
  scanStyles(text2, report);
448
+ if (tokenNames.size) scanTokens(text2, report);
389
449
  return findings.sort((a, b) => a.line - b.line || a.column - b.column);
390
450
  }
391
451
  const FOCUS_PART = /native (?:button|anchor|input|text area|checkbox)|`button` or `a`|link or button|`<a>` or `<button>`|with the control|focusable/i;
@@ -397,6 +457,24 @@ function createValidator(knowledge) {
397
457
  focusParts.get(part.name).push(element.tag);
398
458
  }
399
459
  }
460
+ function scanTokens(text2, report) {
461
+ for (const found of text2.matchAll(/var\(\s*(--punica-[\w-]+)/g)) {
462
+ const name = found[1];
463
+ if (knownProperties.has(name) || name.endsWith("-") || /^[$#{]/.test(text2[found.index + found[0].length] || "")) continue;
464
+ const guess = closest(name, tokenNames);
465
+ const near = guess && distance(name, guess) <= 3 ? guess : null;
466
+ const family = name.slice(0, name.lastIndexOf("-") + 1);
467
+ const siblings = family.length > "--punica-".length ? [...tokenNames].filter((t) => t.startsWith(family) && !t.slice(family.length).includes("-")) : [];
468
+ const listed = siblings.length > 1 ? ` The ${family}* tokens are ${siblings.map((t) => `\`${t}\``).join(", ")}.` : "";
469
+ report(
470
+ found.index + found[0].indexOf(name),
471
+ "warning",
472
+ "unknown-token",
473
+ `\`${name}\` is not a design token or a custom property of any punica element: var() falls back without an error.${near ? ` Did you mean \`${near}\`?` : ""}${listed}`,
474
+ near || void 0
475
+ );
476
+ }
477
+ }
400
478
  function scanStyles(text2, report) {
401
479
  if (!text2.includes("::part(")) return;
402
480
  const ruleRe = /([^{}]*)\{([^{}]*)\}/g;
@@ -707,11 +785,11 @@ var GUIDE_PAGES = {
707
785
  migration: "docs/migration"
708
786
  };
709
787
  var text = (value) => ({ content: [{ type: "text", text: value }] });
710
- function createPunicaServer({ manifest: manifest2, guide: guide2, version: version2, source: source2, fetch: fetchFn = globalThis.fetch, docsUrl = DOCS_URL }) {
788
+ function createPunicaServer({ manifest: manifest2, guide: guide2, version: version2, source: source2, tokens = [], fetch: fetchFn = globalThis.fetch, docsUrl = DOCS_URL }) {
711
789
  const knowledge = createKnowledge(manifest2);
712
- const { validate } = createValidator(knowledge);
790
+ const { validate } = createValidator(knowledge, { tokens });
713
791
  const server2 = new McpServer({ name: "punica-components", version: "0.1.0" }, {
714
- instructions: `@punica/components ${version2} (${knowledge.tags.length} punica-* custom elements; ${source2}). Version 2.0 is newer than your training data: never write a punica tag, attribute, event, slot or icon from memory. Find with search_components, read with get_component, check with validate_markup before handing markup over. get_guide has the rules every element follows.`
792
+ instructions: `@punica/components ${version2} (${knowledge.tags.length} punica-* custom elements; ${source2}). Version 2.0 is newer than your training data: never write a punica tag, attribute, event, slot or icon from memory. Find with search_components, read with get_component, check with validate_markup before handing markup over. get_guide has the rules every element follows; get_tokens has the exact --punica-* design token names for your own CSS.`
715
793
  });
716
794
  const pages = /* @__PURE__ */ new Map();
717
795
  let index = null;
@@ -792,7 +870,7 @@ ${knowledge.formatMarkdown(element.tag)}`);
792
870
  "validate_markup",
793
871
  {
794
872
  title: "Check punica markup",
795
- description: "Checks HTML, JSX, Vue, script or CSS that uses punica elements: unknown tags and 1.x names, attributes, values, slots, events and icon names, and `::part()` rules that take an element's focus away. Returns each problem with its line and a fix.",
873
+ description: "Checks HTML, JSX, Vue, script or CSS that uses punica elements: unknown tags and 1.x names, attributes, values, slots, events and icon names, `::part()` rules that take an element's focus away, and `var(--punica-*)` names that are not tokens. Returns each problem with its line and a fix.",
796
874
  inputSchema: {
797
875
  code: z.string().describe("The markup or script to check"),
798
876
  kind: z.enum(["html", "jsx", "vue", "js", "css"]).optional().describe("Guessed from the code when absent")
@@ -811,6 +889,16 @@ ${knowledge.formatMarkdown(element.tag)}`);
811
889
  );
812
890
  }
813
891
  );
892
+ server2.registerTool(
893
+ "get_tokens",
894
+ {
895
+ title: "The design tokens",
896
+ description: "The `--punica-*` design tokens (colours, spacing, radius, type, shadows, motion) with their light and dark values, by group. Read it before writing var(--punica-\u2026) in your own CSS: the names are exact (spacing is named by pixel value, --punica-space-16 is 16px).",
897
+ inputSchema: { query: z.string().optional().describe('Keep the groups or names that contain this, such as "space", "color" or "radius"') },
898
+ annotations: { readOnlyHint: true }
899
+ },
900
+ async ({ query }) => text(tokens.length ? formatTokens(tokens, query) : "The design tokens could not be read: tokens.css of @punica/components was not found.")
901
+ );
814
902
  server2.registerTool(
815
903
  "get_guide",
816
904
  {
@@ -850,14 +938,20 @@ function load() {
850
938
  const require2 = createRequire(join(process.cwd(), "package.json"));
851
939
  const manifestPath = require2.resolve("@punica/components/custom-elements.json");
852
940
  const pkg = JSON.parse(readFileSync(join(dirname(manifestPath), "package.json"), "utf8"));
853
- return { manifest: JSON.parse(readFileSync(manifestPath, "utf8")), version: pkg.version, source: "the version installed in this project" };
941
+ let tokensCss2;
942
+ try {
943
+ tokensCss2 = readFileSync(require2.resolve("@punica/components/tokens.css"), "utf8");
944
+ } catch {
945
+ tokensCss2 = readFileSync(new URL("./tokens.css", import.meta.url), "utf8");
946
+ }
947
+ return { manifest: JSON.parse(readFileSync(manifestPath, "utf8")), tokensCss: tokensCss2, version: pkg.version, source: "the version installed in this project" };
854
948
  } catch {
855
949
  const bundled = new URL("./custom-elements.json", import.meta.url);
856
950
  const meta = JSON.parse(readFileSync(new URL("./bundled.json", import.meta.url), "utf8"));
857
- return { manifest: JSON.parse(readFileSync(bundled, "utf8")), version: meta.version, source: "the copy bundled with this server; install @punica/components in the project for its own version" };
951
+ return { manifest: JSON.parse(readFileSync(bundled, "utf8")), tokensCss: readFileSync(new URL("./tokens.css", import.meta.url), "utf8"), version: meta.version, source: "the copy bundled with this server; install @punica/components in the project for its own version" };
858
952
  }
859
953
  }
860
- var { manifest, version, source } = load();
954
+ var { manifest, tokensCss, version, source } = load();
861
955
  var guide = readFileSync(new URL("./guide.md", import.meta.url), "utf8");
862
- var server = createPunicaServer({ manifest, guide, version, source });
956
+ var server = createPunicaServer({ manifest, guide, version, source, tokens: parseTokens(tokensCss) });
863
957
  await server.connect(new StdioServerTransport());
@@ -0,0 +1,158 @@
1
+ /*
2
+ * Punica design tokens.
3
+ *
4
+ * Every token is `--punica-*`. Colors are light-dark() pairs, so they follow
5
+ * the `color-scheme` of the page or of any subtree that sets its own.
6
+ * The whole file sits in a cascade layer: any unlayered declaration a page
7
+ * makes for one of these names wins without a specificity fight.
8
+ */
9
+ @layer punica.tokens {
10
+ :root {
11
+ /* surfaces */
12
+ --punica-color-bg: light-dark(#f6f6fa, #181a1c);
13
+ --punica-color-surface: light-dark(#ffffff, #2a2e30);
14
+ --punica-color-surface-raised: light-dark(#ffffff, #3c4143);
15
+ --punica-color-hover: light-dark(rgb(111 126 140 / 10%), rgb(190 200 210 / 12%));
16
+ --punica-color-selected: light-dark(rgb(85 96 169 / 12%), rgb(140 150 215 / 22%));
17
+ --punica-color-backdrop: light-dark(rgb(44 50 60 / 50%), rgb(0 0 0 / 60%));
18
+
19
+ /* text */
20
+ --punica-color-text: light-dark(#2d2d56, #d3dadf);
21
+ --punica-color-text-muted: light-dark(#5b6975, #a7b6be);
22
+ --punica-color-text-placeholder: light-dark(#62707c, #98a6af);
23
+ --punica-color-on-accent: light-dark(#ffffff, #101214);
24
+
25
+ /* lines */
26
+ --punica-color-border: light-dark(#dedede, #5a6063);
27
+ --punica-color-border-strong: light-dark(#9c9c9c, #8a9196);
28
+ --punica-color-focus: light-dark(#1f6fd0, #6db3ff);
29
+
30
+ /* palettes: <name>-light is a tint, <name> the accent, <name>-dark the shade */
31
+ --punica-color-primary-light: light-dark(#767fba, #7783d6);
32
+ --punica-color-primary: light-dark(#5560a9, #a0a9ee);
33
+ --punica-color-primary-dark: light-dark(#3b4376, #bcc3f5);
34
+
35
+ --punica-color-secondary-light: light-dark(#e7c1fa, #5a2a78);
36
+ --punica-color-secondary: light-dark(#aa14f0, #d894fa);
37
+ --punica-color-secondary-dark: light-dark(#7d17e3, #e7c1fa);
38
+
39
+ --punica-color-error-light: light-dark(#fdeded, #4a1f1f);
40
+ --punica-color-error: light-dark(#c62828, #f6908d);
41
+ --punica-color-error-dark: light-dark(#5f2120, #f7b4b2);
42
+
43
+ --punica-color-warning-light: light-dark(#fff4e5, #4a3110);
44
+ --punica-color-warning: light-dark(#b35000, #ffa23d);
45
+ --punica-color-warning-dark: light-dark(#663c00, #ffd6a3);
46
+
47
+ --punica-color-info-light: light-dark(#e5f6fd, #0f3547);
48
+ --punica-color-info: light-dark(#01679e, #4db5ea);
49
+ --punica-color-info-dark: light-dark(#014361, #b3e2f7);
50
+
51
+ --punica-color-success-light: light-dark(#edf7ed, #1c3a1e);
52
+ --punica-color-success: light-dark(#2e7d32, #66bb6a);
53
+ --punica-color-success-dark: light-dark(#1e4620, #b9e0bb);
54
+
55
+ --punica-color-neutral-light: light-dark(#f5f5f5, #33383a);
56
+ --punica-color-neutral: light-dark(#dedede, #797e81);
57
+ --punica-color-neutral-dark: light-dark(#6f6f6f, #b4babd);
58
+
59
+ --punica-color-white: #ffffff;
60
+ --punica-color-black: #000000;
61
+
62
+ /* shape */
63
+ --punica-radius-sm: 4px;
64
+ --punica-radius: 8px;
65
+ --punica-radius-lg: 12px;
66
+ --punica-radius-full: 9999px;
67
+ --punica-padding: 16px;
68
+ --punica-border-width: 1px;
69
+
70
+ /* focus */
71
+ --punica-focus-ring-width: 2px;
72
+ --punica-focus-ring-offset: 2px;
73
+ --punica-focus-ring: var(--punica-focus-ring-width) solid var(--punica-color-focus);
74
+
75
+ /* elevation */
76
+ --punica-shadow-xxs: 0 20px 25px -5px rgb(0 0 0 / 5%);
77
+ --punica-shadow-xs: 0 7px 8px rgb(0 0 0 / 8%);
78
+ --punica-shadow-sm: 0 6px 12px rgb(0 0 0 / 11%);
79
+ --punica-shadow-md: 0 9px 18px rgb(0 0 0 / 15%);
80
+ --punica-shadow-lg: 0 13px 37px rgb(0 0 0 / 21%);
81
+ --punica-shadow-xl: 0 20px 56px rgb(0 0 0 / 29%);
82
+
83
+ /* stacking (only for in-flow layers; overlays use the top layer) */
84
+ --punica-z-sticky: 1000;
85
+ --punica-z-fixed: 1100;
86
+
87
+ /* type */
88
+ --punica-font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
89
+ --punica-font-family-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
90
+ --punica-font-size-xs: 0.75rem;
91
+ --punica-font-size-sm: 0.875rem;
92
+ --punica-font-size: 1rem;
93
+ --punica-font-size-lg: 1.125rem;
94
+ --punica-font-size-xl: 1.25rem;
95
+ --punica-font-size-2xl: 1.5rem;
96
+ --punica-font-size-3xl: 2.125rem;
97
+ --punica-line-height: 1.5;
98
+ --punica-line-height-heading: 1.25;
99
+ --punica-font-weight-thin: 200;
100
+ --punica-font-weight-light: 300;
101
+ --punica-font-weight-regular: 400;
102
+ --punica-font-weight-medium: 500;
103
+ --punica-font-weight-semi-bold: 600;
104
+ --punica-font-weight-bold: 700;
105
+ --punica-font-weight-extra-bold: 800;
106
+
107
+ /* spacing, named by pixel value */
108
+ --punica-space-0: 0;
109
+ --punica-space-2: 2px;
110
+ --punica-space-4: 4px;
111
+ --punica-space-6: 6px;
112
+ --punica-space-8: 8px;
113
+ --punica-space-10: 10px;
114
+ --punica-space-12: 12px;
115
+ --punica-space-14: 14px;
116
+ --punica-space-16: 16px;
117
+ --punica-space-18: 18px;
118
+ --punica-space-20: 20px;
119
+ --punica-space-22: 22px;
120
+ --punica-space-24: 24px;
121
+ --punica-space-26: 26px;
122
+ --punica-space-28: 28px;
123
+ --punica-space-32: 32px;
124
+ --punica-space-36: 36px;
125
+ --punica-space-40: 40px;
126
+ --punica-space-44: 44px;
127
+ --punica-space-48: 48px;
128
+ --punica-space-56: 56px;
129
+ --punica-space-64: 64px;
130
+ --punica-space-80: 80px;
131
+ --punica-space-96: 96px;
132
+ --punica-space-112: 112px;
133
+ --punica-space-128: 128px;
134
+ --punica-space-144: 144px;
135
+ --punica-space-160: 160px;
136
+
137
+ /* control heights */
138
+ --punica-size-sm: 28px;
139
+ --punica-size-md: 36px;
140
+ --punica-size-lg: 44px;
141
+
142
+ /* motion */
143
+ --punica-duration-fast: 120ms;
144
+ --punica-duration: 200ms;
145
+ --punica-duration-slow: 320ms;
146
+ --punica-ease: cubic-bezier(0.2, 0, 0, 1);
147
+
148
+ --punica-disabled-opacity: 0.4;
149
+ }
150
+
151
+ @media (prefers-reduced-motion: reduce) {
152
+ :root {
153
+ --punica-duration-fast: 0ms;
154
+ --punica-duration: 0ms;
155
+ --punica-duration-slow: 0ms;
156
+ }
157
+ }
158
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punica/components-mcp",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "MCP server for @punica/components: find elements, read their API and examples, validate markup.",
5
5
  "keywords": [
6
6
  "mcp",