@csszyx/mcp-server 0.10.10 → 0.10.11

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 (2) hide show
  1. package/llms-full.txt +20 -3
  2. package/package.json +4 -4
package/llms-full.txt CHANGED
@@ -670,6 +670,13 @@ type Props = { title: string } & Pick<ComponentProps<'div'>, 'sz'>;
670
670
  // equivalent: import type { SzPropValue } from '@csszyx/types'; then `sz?: SzPropValue`
671
671
  ```
672
672
 
673
+ Pick is for CONCRETE tags only. On a generic component (`E extends ElementType`),
674
+ `Pick<ComponentProps<E>, 'sz'>` distributes over union members without the
675
+ augmentation and resolves order-dependently (sz can flip optional→required when an
676
+ unrelated file changes). Generic wrappers declare the prop directly — `sz?: SzInput`
677
+ (from `csszyx`) — which is stable and also accepts szv factory output
678
+ (`sz={someSzv({ v })}`; `SzPropValue` rejects it, `SzInput` is the forwarding type).
679
+
673
680
  The augmentation must be in scope (a `/// <reference types="@csszyx/types/jsx" />`
674
681
  or the project's `csszyx-env.d.ts`), otherwise `sz` is not a key of
675
682
  `ComponentProps<'div'>` and `Pick` fails.
@@ -682,7 +689,7 @@ a normal `sz`. So style a compound component's parts by giving each part its own
682
689
 
683
690
  ```tsx
684
691
  <Card sz={{ p: 4 }}>
685
- <Card.Header sz={{ bg: 'gray-100', fontWeight: 'bold' }}>Title</Card.Header>
692
+ <Card.Header sz={{ bg: 'gray-100', font: 'bold' }}>Title</Card.Header>
686
693
  <Card.Body sz={{ text: 'sm' }}>Body</Card.Body>
687
694
  </Card>
688
695
  // → each part compiled to className at build time; all classes safelisted.
@@ -692,7 +699,14 @@ Build it as a plain React compound component; each part forwards `sz` (already
692
699
  rewritten to `className` by the transform) onto a host element. Type each part with
693
700
  `ComponentProps<'div'>` (or the relevant tag) to get `sz` + `className` for free.
694
701
  Merge a part's own defaults with the consumer's override via `szcn` (mangle-aware,
695
- last-wins) or `clsx`.
702
+ last-wins) the RECOMMENDED pattern for slot defaults. Multi-property prefixes
703
+ (`text`, `bg`, `border`, `font`, `flex`, `divide`, `ring`, `outline`) are
704
+ value-classified into property groups: same property → later wins
705
+ (`szcn('text-base','text-sm')` → `text-sm`); different properties co-exist
706
+ (`text-red-500` never removes `text-sm`); unclassifiable values are always kept
707
+ (fail-safe). Custom `@theme` tokens join their groups automatically when the CSS
708
+ is scanned (`build.scanCss`); classes written in plain CSS register via
709
+ `registerSzcnGroups({ colors: [...], textSizes: [...] })` from `@csszyx/runtime`.
696
710
 
697
711
  ## `szs` — slot map for a component's internal parts
698
712
 
@@ -705,7 +719,10 @@ the matching child's `className`.
705
719
  type CardProps = { szs?: Szs<'header' | 'icon'> }; // Szs from @csszyx/types
706
720
  <Card szs={{ header: { bg: 'gray-100' }, icon: { color: 'red-500' } }} />
707
721
  // → <Card szs={{ header: "bg-gray-100", icon: "text-red-500" }} />
708
- // component: <header className={props.szs?.header} />
722
+ // component: <header className={szsClass(props.szs?.header)} />
723
+ // szsClass (from @csszyx/runtime) narrows the compiled slot to string | undefined —
724
+ // slots TYPE as sz values but ARE class strings after the transform; the helper
725
+ // is also fail-safe (uncompiled slot -> undefined, never "[object Object]").
709
726
  ```
710
727
 
711
728
  Rules: custom components only (host element → dev warn, unchanged). Slot values
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/mcp-server",
3
- "version": "0.10.10",
3
+ "version": "0.10.11",
4
4
  "description": "Model Context Protocol (MCP) server for csszyx — enables AI agents to understand and generate sz props",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,9 +30,9 @@
30
30
  "dependencies": {
31
31
  "@modelcontextprotocol/sdk": "^1.29.0",
32
32
  "zod": "^3.23.8",
33
- "@csszyx/compiler": "0.10.10",
34
- "@csszyx/cli": "0.10.10",
35
- "@csszyx/unplugin": "0.10.10"
33
+ "@csszyx/cli": "0.10.11",
34
+ "@csszyx/compiler": "0.10.11",
35
+ "@csszyx/unplugin": "0.10.11"
36
36
  },
37
37
  "devDependencies": {
38
38
  "typescript": "^6.0.3",