@handamade/psi-mcp 0.10.0 → 0.12.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 +1 -1
- package/dist/psi-index.json +180 -20
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @handamade/psi-mcp
|
|
2
2
|
|
|
3
|
-
MCP server and agent-context generator for the Psi (Ψ) design system. Documents the system — the
|
|
3
|
+
MCP server and agent-context generator for the Psi (Ψ) design system. Documents the system — the 28 React 19 components, 13 composition patterns (D47) that recipe them together with gap-annotated compose trees, every semantic token with its OKLCH derivation formula resolved across all four themes, and the usage guidance — through two read-only tools. It does not write code.
|
|
4
4
|
|
|
5
5
|
## Connect
|
|
6
6
|
|
package/dist/psi-index.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.12.0",
|
|
3
3
|
"themes": [
|
|
4
4
|
"light",
|
|
5
5
|
"dark",
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
},
|
|
379
379
|
{
|
|
380
380
|
"name": "Dialog",
|
|
381
|
-
"description": "Modal dialog on the native <dialog> top layer: focus trap, aria-modal and focus restore come from the platform; title/footer slots, Esc/backdrop/ close-button dismissal via onClose(reason) (D50).",
|
|
381
|
+
"description": "Modal dialog on the native <dialog> top layer: focus trap, aria-modal and focus restore come from the platform; title/footer slots, Esc/backdrop/ close-button dismissal via onClose(reason) (D50). `placement` moves the panel and nothing else (D66): an `inline-start` / `inline-end` Dialog is a drawer, pinned full-height to that edge, with the same modality, focus trap, focus restore and dismissal reasons as a centered one. There is deliberately no separate Drawer component — a sibling would have to duplicate or wrap all of that.",
|
|
382
382
|
"props": [
|
|
383
383
|
{
|
|
384
384
|
"name": "open",
|
|
@@ -413,7 +413,14 @@
|
|
|
413
413
|
"type": "400 | 560 | 720",
|
|
414
414
|
"required": false,
|
|
415
415
|
"default": 560,
|
|
416
|
-
"description": "Panel width in px (400 | 560 | 720)."
|
|
416
|
+
"description": "Panel width in px (400 | 560 | 720). For an `inline-*` placement this is\nthe drawer's width; the height is always the full viewport."
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"name": "placement",
|
|
420
|
+
"type": "\"center\" | \"inline-start\" | \"inline-end\"",
|
|
421
|
+
"required": false,
|
|
422
|
+
"default": "center",
|
|
423
|
+
"description": "Where the panel sits. `inline-start` / `inline-end` pin it full-height to\nthat edge, making it a drawer (D66)."
|
|
417
424
|
},
|
|
418
425
|
{
|
|
419
426
|
"name": "dismissible",
|
|
@@ -468,7 +475,7 @@
|
|
|
468
475
|
"order": 3
|
|
469
476
|
}
|
|
470
477
|
],
|
|
471
|
-
"doc": "<!-- Generated by emit-docs.ts — do not edit. -->\n# Dialog\n\nModal dialog on the native <dialog> top layer: focus trap, aria-modal and focus restore come from the platform; title/footer slots, Esc/backdrop/ close-button dismissal via onClose(reason) (D50).\n\n## Props\n\n| Prop | Type | Default | Required | Description |\n|---|---|---|---|---|\n| `open` | `boolean` | — | yes | Controlled open state; syncs to showModal()/close(). |\n| `onClose` | `(reason: \"esc\" \\| \"backdrop\" \\| \"close-button\") => void` | — | yes | Called on every dismissal attempt with its source; the consumer flips `open`. |\n| `title` | `ReactNode` | — | no | Heading; renders an <h2> wired to aria-labelledby. Without it, pass aria-label. |\n| `footer` | `ReactNode` | — | no | Action row (Buttons — one accent per group, danger for destructive). |\n| `width` | `400 \\| 560 \\| 720` | 560 | no | Panel width in px (400 \\| 560 \\| 720). |\n| `dismissible` | `boolean` | true | no | false = no close button, Esc and backdrop swallowed — footer is the only exit. |\n| `ref` | `Ref<HTMLDialogElement>` | — | no | Forwarded ref to the underlying <dialog> element. |\n| `className` | `string` | — | no | Additional CSS class name(s) merged onto the component's root element. |\n\n## Keyboard & assistive tech\n\n| Keys | Behavior |\n|---|---|\n| Esc | Dismisses via onClose('esc') when dismissible; swallowed otherwise. |\n| Tab | Focus is trapped inside by the native <dialog> top layer; restored on close. |\n\nRendered with showModal(): aria-modal, inert background and focus restore come from the platform. title wires aria-labelledby; without title, pass aria-label. Backdrop click dismisses only when dismissible.\n\n## Theming\n\nOverride `--psi-dialog-*` custom properties at any scope.\n\n\n\n## Rules\n\n- One accent per visual group; everything else neutral or ghost.\n- danger only for actions with real consequences.\n- Sizes are px numbers (24|32|40|48), never S/M/L.\n- Typography tokens are --psi-text-{size}-{lineHeight}-{weight}.\n- Override component tokens (--psi-{component}-*), not semantic tokens, for one-off theming.\n- --psi-button-font overrides button typography across all sizes (documented D34 override; ember → mono).\n- Wrap labeled form controls in Field — label association, description/error line, aria-describedby and aria-invalid come wired; don't hand-roll label+message rows.\n- Use Dialog for blocking modal flows — title/footer slots, dismissible gate; danger stays on the footer Buttons, one accent per group.\n"
|
|
478
|
+
"doc": "<!-- Generated by emit-docs.ts — do not edit. -->\n# Dialog\n\nModal dialog on the native <dialog> top layer: focus trap, aria-modal and focus restore come from the platform; title/footer slots, Esc/backdrop/ close-button dismissal via onClose(reason) (D50). `placement` moves the panel and nothing else (D66): an `inline-start` / `inline-end` Dialog is a drawer, pinned full-height to that edge, with the same modality, focus trap, focus restore and dismissal reasons as a centered one. There is deliberately no separate Drawer component — a sibling would have to duplicate or wrap all of that.\n\n## Props\n\n| Prop | Type | Default | Required | Description |\n|---|---|---|---|---|\n| `open` | `boolean` | — | yes | Controlled open state; syncs to showModal()/close(). |\n| `onClose` | `(reason: \"esc\" \\| \"backdrop\" \\| \"close-button\") => void` | — | yes | Called on every dismissal attempt with its source; the consumer flips `open`. |\n| `title` | `ReactNode` | — | no | Heading; renders an <h2> wired to aria-labelledby. Without it, pass aria-label. |\n| `footer` | `ReactNode` | — | no | Action row (Buttons — one accent per group, danger for destructive). |\n| `width` | `400 \\| 560 \\| 720` | 560 | no | Panel width in px (400 \\| 560 \\| 720). For an `inline-*` placement this is the drawer's width; the height is always the full viewport. |\n| `placement` | `\"center\" \\| \"inline-start\" \\| \"inline-end\"` | center | no | Where the panel sits. `inline-start` / `inline-end` pin it full-height to that edge, making it a drawer (D66). |\n| `dismissible` | `boolean` | true | no | false = no close button, Esc and backdrop swallowed — footer is the only exit. |\n| `ref` | `Ref<HTMLDialogElement>` | — | no | Forwarded ref to the underlying <dialog> element. |\n| `className` | `string` | — | no | Additional CSS class name(s) merged onto the component's root element. |\n\n## Keyboard & assistive tech\n\n| Keys | Behavior |\n|---|---|\n| Esc | Dismisses via onClose('esc') when dismissible; swallowed otherwise. |\n| Tab | Focus is trapped inside by the native <dialog> top layer; restored on close. |\n\nRendered with showModal(): aria-modal, inert background and focus restore come from the platform. title wires aria-labelledby; without title, pass aria-label. Backdrop click dismisses only when dismissible. placement=\"inline-start\"/\"inline-end\" pins the panel full-height to that edge — that is Psi's drawer, and it changes nothing about modality, the focus trap, focus restore or the dismissal reasons (D66). A drawer's panel scrolls internally so a dismissible={false} footer stays reachable.\n\n## Theming\n\nOverride `--psi-dialog-*` custom properties at any scope.\n\n\n\n## Rules\n\n- One accent per visual group; everything else neutral or ghost.\n- danger only for actions with real consequences.\n- Sizes are px numbers (24|32|40|48), never S/M/L.\n- Typography tokens are --psi-text-{size}-{lineHeight}-{weight}.\n- Override component tokens (--psi-{component}-*), not semantic tokens, for one-off theming.\n- --psi-button-font overrides button typography across all sizes (documented D34 override; ember → mono).\n- Wrap labeled form controls in Field — label association, description/error line, aria-describedby and aria-invalid come wired; don't hand-roll label+message rows.\n- Use Dialog for blocking modal flows — title/footer slots, dismissible gate; danger stays on the footer Buttons, one accent per group.\n"
|
|
472
479
|
},
|
|
473
480
|
{
|
|
474
481
|
"name": "Checkbox",
|
|
@@ -1086,6 +1093,162 @@
|
|
|
1086
1093
|
],
|
|
1087
1094
|
"slots": [],
|
|
1088
1095
|
"doc": "<!-- Generated by emit-docs.ts — do not edit. -->\n# Pagination\n\nNumbered pager with ellipsis truncation (D63). Standalone rather than a Table family member: `table-pagination` composes it as a Toolbar sibling of the page-size Select.\n\n## Props\n\n| Prop | Type | Default | Required | Description |\n|---|---|---|---|---|\n| `page` | `number` | — | yes | Current page, 1-based. |\n| `pageCount` | `number` | — | yes | Total number of pages. |\n| `onPageChange` | `(page: number) => void` | — | yes | Called with the requested page. Required — unlike Table's `onSortChange`/ `onSelectionChange`, which are optional because `sortable`/`selectable` gate whether they're meaningful, `Pagination` has no such gating boolean: the prop is unconditionally meaningful, so a `Pagination` without it is a dead control (final review finding, D62). |\n| `siblingCount` | `number` | 1 | no | Pages shown either side of the current one before truncating. |\n| `aria-label` | `string` | Pagination | no | Accessible name for the nav landmark. |\n| `className` | `string` | — | no | Additional CSS class name(s) merged onto the component's root element. |\n\n## Theming\n\nThis component has no `--psi-pagination-*` tokens — its styling binds scale tokens only, so there is nothing component-scoped to override. Theme changes reach it through the semantic tokens of its children and surroundings.\n\n\n\n## Rules\n\n- One accent per visual group; everything else neutral or ghost.\n- danger only for actions with real consequences.\n- Sizes are px numbers (24|32|40|48), never S/M/L.\n- Typography tokens are --psi-text-{size}-{lineHeight}-{weight}.\n- Override component tokens (--psi-{component}-*), not semantic tokens, for one-off theming.\n- --psi-button-font overrides button typography across all sizes (documented D34 override; ember → mono).\n- Wrap labeled form controls in Field — label association, description/error line, aria-describedby and aria-invalid come wired; don't hand-roll label+message rows.\n- Use Dialog for blocking modal flows — title/footer slots, dismissible gate; danger stays on the footer Buttons, one accent per group.\n"
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"name": "Toast",
|
|
1099
|
+
"description": "A single transient notification card (D64). Controlled and presentational: it holds no state, runs no timer, and never removes itself — `onDismiss` reports and the owner disposes, exactly as Dialog (D50) and Menu (D53) do. Toast does not carry its own `role`/`aria-live`. Politeness belongs to the two persistent wrappers inside ToastRegion, because a live region must pre-exist the content it announces; a role on the toast itself would reintroduce the mount-with-content problem one level down. Composed by hand with ToastRegion for full control, or driven by ToastProvider's queue.",
|
|
1100
|
+
"props": [
|
|
1101
|
+
{
|
|
1102
|
+
"name": "variant",
|
|
1103
|
+
"type": "\"neutral\" | \"success\" | \"warning\" | \"danger\"",
|
|
1104
|
+
"required": false,
|
|
1105
|
+
"default": "neutral",
|
|
1106
|
+
"description": "Status variant."
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
"name": "children",
|
|
1110
|
+
"type": "ReactNode",
|
|
1111
|
+
"required": true,
|
|
1112
|
+
"default": null,
|
|
1113
|
+
"description": "The message."
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
"name": "action",
|
|
1117
|
+
"type": "ReactNode",
|
|
1118
|
+
"required": false,
|
|
1119
|
+
"default": null,
|
|
1120
|
+
"description": "Trailing affordance — a ghost Button (Undo, Retry, View)."
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
"name": "onDismiss",
|
|
1124
|
+
"type": "(() => void)",
|
|
1125
|
+
"required": false,
|
|
1126
|
+
"default": null,
|
|
1127
|
+
"description": "When provided, renders the dismiss button and calls this. Toast does not\nremove itself; the owner disposes."
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
"name": "className",
|
|
1131
|
+
"type": "string",
|
|
1132
|
+
"required": false,
|
|
1133
|
+
"default": null,
|
|
1134
|
+
"description": "Additional CSS class name(s) merged onto the component's root element."
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
"name": "ref",
|
|
1138
|
+
"type": "Ref<HTMLDivElement>",
|
|
1139
|
+
"required": false,
|
|
1140
|
+
"default": null,
|
|
1141
|
+
"description": "Forwarded ref to the underlying `<div>`."
|
|
1142
|
+
}
|
|
1143
|
+
],
|
|
1144
|
+
"slots": [
|
|
1145
|
+
{
|
|
1146
|
+
"name": "body",
|
|
1147
|
+
"accepts": {},
|
|
1148
|
+
"cardinality": "1..*",
|
|
1149
|
+
"order": 1
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
"name": "action",
|
|
1153
|
+
"accepts": {
|
|
1154
|
+
"components": [
|
|
1155
|
+
"Button"
|
|
1156
|
+
],
|
|
1157
|
+
"contracts": [
|
|
1158
|
+
"inline-content"
|
|
1159
|
+
]
|
|
1160
|
+
},
|
|
1161
|
+
"cardinality": "0..1",
|
|
1162
|
+
"order": 2
|
|
1163
|
+
}
|
|
1164
|
+
],
|
|
1165
|
+
"doc": "<!-- Generated by emit-docs.ts — do not edit. -->\n# Toast\n\nA single transient notification card (D64). Controlled and presentational: it holds no state, runs no timer, and never removes itself — `onDismiss` reports and the owner disposes, exactly as Dialog (D50) and Menu (D53) do. Toast does not carry its own `role`/`aria-live`. Politeness belongs to the two persistent wrappers inside ToastRegion, because a live region must pre-exist the content it announces; a role on the toast itself would reintroduce the mount-with-content problem one level down. Composed by hand with ToastRegion for full control, or driven by ToastProvider's queue.\n\n## Props\n\n| Prop | Type | Default | Required | Description |\n|---|---|---|---|---|\n| `variant` | `\"neutral\" \\| \"success\" \\| \"warning\" \\| \"danger\"` | neutral | no | Status variant. |\n| `children` | `ReactNode` | — | yes | The message. |\n| `action` | `ReactNode` | — | no | Trailing affordance — a ghost Button (Undo, Retry, View). |\n| `onDismiss` | `(() => void)` | — | no | When provided, renders the dismiss button and calls this. Toast does not remove itself; the owner disposes. |\n| `className` | `string` | — | no | Additional CSS class name(s) merged onto the component's root element. |\n| `ref` | `Ref<HTMLDivElement>` | — | no | Forwarded ref to the underlying `<div>`. |\n\n## Keyboard & assistive tech\n\n| Keys | Behavior |\n|---|---|\n| Tab | Reaches the action and the dismiss button in DOM order. Esc is not a dismissal — a toast is not modal and traps nothing. |\n| Enter / Space | Activates the focused action or dismiss button. |\n\nPresentational and controlled (D64): onDismiss reports and the owner disposes; Toast never removes itself. It carries no role/aria-live of its own — politeness belongs to ToastRegion's two persistent wrappers. The variant's meaning is announced by a visually hidden status word (\"Success:\", \"Warning:\", \"Error:\"), never by colour and icon shape alone; the icon is aria-hidden. neutral has no status and gets no prefix. The dismiss button requires no props — it is labelled \"Dismiss notification\".\n\n## Theming\n\nOverride `--psi-toast-*` custom properties at any scope.\n\n## Variant guidance\n\n- **accent** — Primary action, draws attention. Submit, CTA, main action in a group.\n- **accent-subtle** — Accent tone, lower visual weight. Selected state, active filter, soft CTA.\n- **neutral** — Default, structurally present. Secondary actions, toolbar buttons.\n- **neutral-subtle** — Minimal chrome. Inline actions, table row actions.\n- **ghost** — No visible container until hover. Icon-only triggers, compact toolbars.\n- **outline** — Bordered ghost — visible structure, no fill until hover. Marketing CTA, download button; hover fills accent.\n- **danger** — Destructive action. Delete, remove, disconnect.\n- **danger-subtle** — Destructive context, low urgency. Warning badges, soft destructive hints.\n- **success | warning** — Status communication (Tag only). Status badges, labels.\n\n## Rules\n\n- One accent per visual group; everything else neutral or ghost.\n- danger only for actions with real consequences.\n- Sizes are px numbers (24|32|40|48), never S/M/L.\n- Typography tokens are --psi-text-{size}-{lineHeight}-{weight}.\n- Override component tokens (--psi-{component}-*), not semantic tokens, for one-off theming.\n- --psi-button-font overrides button typography across all sizes (documented D34 override; ember → mono).\n- Wrap labeled form controls in Field — label association, description/error line, aria-describedby and aria-invalid come wired; don't hand-roll label+message rows.\n- Use Dialog for blocking modal flows — title/footer slots, dismissible gate; danger stays on the footer Buttons, one accent per group.\n"
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
"name": "ToastRegion",
|
|
1169
|
+
"description": "The positioned live region that holds the toast stack (D64). Two things here are load-bearing and both look like details: 1. **The two live wrappers are always rendered**, empty queue included. A live region announces mutations to a subtree that already existed; a wrapper that mounts together with its first toast reads as a new subtree, and that first toast is never announced. 2. **`popover=\"manual\"`, not `\"auto\"`.** Manual puts the region in the native top layer without light dismiss. The top layer is required because Dialog uses showModal() — also top layer — so a fixed region at --psi-z-overlay would paint *under* the modal backdrop, hiding the confirmation for the action a user just took inside a dialog. And `auto` would be dismissed by the very click that raised the toast. Routing reads `variant` off each child, the same Children.map technique Table uses for select-all injection. Consequence of the split, visible in the `InRegion` VR baseline: the stack is grouped by politeness, not strictly chronological — every assertive toast sorts below every polite one regardless of arrival order. Chronological order is preserved *within* each group. Keeping it exact across both would mean one live region with a politeness that changes per message, which is the thing the two wrappers exist to avoid. Accepted: at `limit` 3 the grouping reads as severity ordering, and the newest toast still lands nearest the screen edge within its group.",
|
|
1170
|
+
"props": [
|
|
1171
|
+
{
|
|
1172
|
+
"name": "placement",
|
|
1173
|
+
"type": "\"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\"",
|
|
1174
|
+
"required": false,
|
|
1175
|
+
"default": "bottom-end",
|
|
1176
|
+
"description": "Corner the stack occupies."
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
"name": "aria-label",
|
|
1180
|
+
"type": "string",
|
|
1181
|
+
"required": false,
|
|
1182
|
+
"default": "Notifications",
|
|
1183
|
+
"description": "Accessible name for the region."
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
"name": "children",
|
|
1187
|
+
"type": "ReactNode",
|
|
1188
|
+
"required": true,
|
|
1189
|
+
"default": null,
|
|
1190
|
+
"description": "The toast stack — `Toast` elements, routed to a live wrapper by variant."
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
"name": "className",
|
|
1194
|
+
"type": "string",
|
|
1195
|
+
"required": false,
|
|
1196
|
+
"default": null,
|
|
1197
|
+
"description": "Additional CSS class name(s) merged onto the component's root element."
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
"name": "ref",
|
|
1201
|
+
"type": "Ref<HTMLDivElement>",
|
|
1202
|
+
"required": false,
|
|
1203
|
+
"default": null,
|
|
1204
|
+
"description": "Forwarded ref to the region element."
|
|
1205
|
+
}
|
|
1206
|
+
],
|
|
1207
|
+
"slots": [],
|
|
1208
|
+
"doc": "<!-- Generated by emit-docs.ts — do not edit. -->\n# ToastRegion\n\nThe positioned live region that holds the toast stack (D64). Two things here are load-bearing and both look like details: 1. **The two live wrappers are always rendered**, empty queue included. A live region announces mutations to a subtree that already existed; a wrapper that mounts together with its first toast reads as a new subtree, and that first toast is never announced. 2. **`popover=\"manual\"`, not `\"auto\"`.** Manual puts the region in the native top layer without light dismiss. The top layer is required because Dialog uses showModal() — also top layer — so a fixed region at --psi-z-overlay would paint *under* the modal backdrop, hiding the confirmation for the action a user just took inside a dialog. And `auto` would be dismissed by the very click that raised the toast. Routing reads `variant` off each child, the same Children.map technique Table uses for select-all injection. Consequence of the split, visible in the `InRegion` VR baseline: the stack is grouped by politeness, not strictly chronological — every assertive toast sorts below every polite one regardless of arrival order. Chronological order is preserved *within* each group. Keeping it exact across both would mean one live region with a politeness that changes per message, which is the thing the two wrappers exist to avoid. Accepted: at `limit` 3 the grouping reads as severity ordering, and the newest toast still lands nearest the screen edge within its group.\n\n## Props\n\n| Prop | Type | Default | Required | Description |\n|---|---|---|---|---|\n| `placement` | `\"top-start\" \\| \"top-end\" \\| \"bottom-start\" \\| \"bottom-end\"` | bottom-end | no | Corner the stack occupies. |\n| `aria-label` | `string` | Notifications | no | Accessible name for the region. |\n| `children` | `ReactNode` | — | yes | The toast stack — `Toast` elements, routed to a live wrapper by variant. |\n| `className` | `string` | — | no | Additional CSS class name(s) merged onto the component's root element. |\n| `ref` | `Ref<HTMLDivElement>` | — | no | Forwarded ref to the region element. |\n\n## Keyboard & assistive tech\n\n| Keys | Behavior |\n|---|---|\n| Tab | Moves into the stacked toasts' controls in DOM order; the region itself is not focusable. |\n\nRenders two always-present live wrappers — role=\"status\"/aria-live=\"polite\" and role=\"alert\"/aria-live=\"assertive\" — and routes each toast into one by variant (neutral/success polite, warning/danger assertive). Both stay in the DOM when the queue is empty: a live region announces mutations to a subtree that already existed, so a wrapper mounting with its first toast would leave that toast unannounced. Sits on the native top layer via popover=\"manual\", so a toast raised from inside a modal Dialog is still painted above the backdrop and still announced — though showModal() makes everything outside the dialog inert, so it cannot be clicked until the dialog closes; manual (not auto) means no light dismiss, so the click that raised the toast cannot close it. The region is click-through (pointer-events: none) and each toast takes its own clicks back.\n\n## Theming\n\nThis component has no `--psi-toast-region-*` tokens — its styling binds scale tokens only, so there is nothing component-scoped to override. Theme changes reach it through the semantic tokens of its children and surroundings.\n\n\n\n## Rules\n\n- One accent per visual group; everything else neutral or ghost.\n- danger only for actions with real consequences.\n- Sizes are px numbers (24|32|40|48), never S/M/L.\n- Typography tokens are --psi-text-{size}-{lineHeight}-{weight}.\n- Override component tokens (--psi-{component}-*), not semantic tokens, for one-off theming.\n- --psi-button-font overrides button typography across all sizes (documented D34 override; ember → mono).\n- Wrap labeled form controls in Field — label association, description/error line, aria-describedby and aria-invalid come wired; don't hand-roll label+message rows.\n- Use Dialog for blocking modal flows — title/footer slots, dismissible gate; danger stays on the footer Buttons, one accent per group.\n"
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
"name": "ToastProvider",
|
|
1212
|
+
"description": "Owns the toast queue, its auto-dismiss timers, and the single ToastRegion (D65). This is the library's one stateful container, and the exception is deliberately narrow. D50 and D53 rejected internal state for Dialog and Menu because the consumer already owned the state that decided visibility — a menu is open because a user clicked a trigger the consumer rendered. A toast has no such owner: it is created by an outcome, not by a UI state, and it disappears on a timer nobody is watching. The rule that survives is the useful half — presentational components stay controlled (`Toast` still holds nothing), a stateful container may exist when the state has no natural owner, and it must be opt-in. Timers pause while the pointer or focus is inside the region (WCAG 2.2.1), and resume with the time *remaining* rather than a fresh full duration — restarting would let a user hold a toast open indefinitely by jiggling the mouse.",
|
|
1213
|
+
"props": [
|
|
1214
|
+
{
|
|
1215
|
+
"name": "limit",
|
|
1216
|
+
"type": "number",
|
|
1217
|
+
"required": false,
|
|
1218
|
+
"default": 3,
|
|
1219
|
+
"description": "Max simultaneous toasts; the oldest is evicted first."
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
"name": "duration",
|
|
1223
|
+
"type": "number",
|
|
1224
|
+
"required": false,
|
|
1225
|
+
"default": 5000,
|
|
1226
|
+
"description": "Auto-dismiss for toasts with no action, in ms."
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
"name": "actionDuration",
|
|
1230
|
+
"type": "number",
|
|
1231
|
+
"required": false,
|
|
1232
|
+
"default": 10000,
|
|
1233
|
+
"description": "Auto-dismiss for toasts carrying an action, in ms. An affordance that\nvanishes before it can be reached is not an affordance."
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"name": "placement",
|
|
1237
|
+
"type": "\"top-start\" | \"top-end\" | \"bottom-start\" | \"bottom-end\"",
|
|
1238
|
+
"required": false,
|
|
1239
|
+
"default": "bottom-end",
|
|
1240
|
+
"description": "Corner the stack occupies."
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
"name": "children",
|
|
1244
|
+
"type": "ReactNode",
|
|
1245
|
+
"required": true,
|
|
1246
|
+
"default": null,
|
|
1247
|
+
"description": "The subtree that may call `useToast()`. The region is rendered alongside it."
|
|
1248
|
+
}
|
|
1249
|
+
],
|
|
1250
|
+
"slots": [],
|
|
1251
|
+
"doc": "<!-- Generated by emit-docs.ts — do not edit. -->\n# ToastProvider\n\nOwns the toast queue, its auto-dismiss timers, and the single ToastRegion (D65). This is the library's one stateful container, and the exception is deliberately narrow. D50 and D53 rejected internal state for Dialog and Menu because the consumer already owned the state that decided visibility — a menu is open because a user clicked a trigger the consumer rendered. A toast has no such owner: it is created by an outcome, not by a UI state, and it disappears on a timer nobody is watching. The rule that survives is the useful half — presentational components stay controlled (`Toast` still holds nothing), a stateful container may exist when the state has no natural owner, and it must be opt-in. Timers pause while the pointer or focus is inside the region (WCAG 2.2.1), and resume with the time *remaining* rather than a fresh full duration — restarting would let a user hold a toast open indefinitely by jiggling the mouse.\n\n## Props\n\n| Prop | Type | Default | Required | Description |\n|---|---|---|---|---|\n| `limit` | `number` | 3 | no | Max simultaneous toasts; the oldest is evicted first. |\n| `duration` | `number` | 5000 | no | Auto-dismiss for toasts with no action, in ms. |\n| `actionDuration` | `number` | 10000 | no | Auto-dismiss for toasts carrying an action, in ms. An affordance that vanishes before it can be reached is not an affordance. |\n| `placement` | `\"top-start\" \\| \"top-end\" \\| \"bottom-start\" \\| \"bottom-end\"` | bottom-end | no | Corner the stack occupies. |\n| `children` | `ReactNode` | — | yes | The subtree that may call `useToast()`. The region is rendered alongside it. |\n\n## Keyboard & assistive tech\n\n| Keys | Behavior |\n|---|---|\n| Tab | Focus entering the region pauses every auto-dismiss timer; leaving resumes them. |\n\nOwns the queue, the auto-dismiss timers and the single ToastRegion (D65). Timers pause while the pointer or focus is inside the region and resume with the time remaining, satisfying WCAG 2.2.1 for content that disappears on a timer. Toasts carrying an action get a longer default lifetime, so the affordance cannot vanish before it is reached. useToast() throws outside a provider rather than silently no-opping.\n\n## Theming\n\nThis component has no `--psi-toast-provider-*` tokens — its styling binds scale tokens only, so there is nothing component-scoped to override. Theme changes reach it through the semantic tokens of its children and surroundings.\n\n\n\n## Rules\n\n- One accent per visual group; everything else neutral or ghost.\n- danger only for actions with real consequences.\n- Sizes are px numbers (24|32|40|48), never S/M/L.\n- Typography tokens are --psi-text-{size}-{lineHeight}-{weight}.\n- Override component tokens (--psi-{component}-*), not semantic tokens, for one-off theming.\n- --psi-button-font overrides button typography across all sizes (documented D34 override; ember → mono).\n- Wrap labeled form controls in Field — label association, description/error line, aria-describedby and aria-invalid come wired; don't hand-roll label+message rows.\n- Use Dialog for blocking modal flows — title/footer slots, dismissible gate; danger stays on the footer Buttons, one accent per group.\n"
|
|
1089
1252
|
}
|
|
1090
1253
|
],
|
|
1091
1254
|
"tokens": [
|
|
@@ -2623,6 +2786,7 @@
|
|
|
2623
2786
|
"ask": "What kind of outcome is being confirmed?",
|
|
2624
2787
|
"options": [
|
|
2625
2788
|
"success",
|
|
2789
|
+
"warning",
|
|
2626
2790
|
"danger",
|
|
2627
2791
|
"neutral"
|
|
2628
2792
|
],
|
|
@@ -2633,11 +2797,9 @@
|
|
|
2633
2797
|
"message": "[what just happened]",
|
|
2634
2798
|
"undo-label": "Undo"
|
|
2635
2799
|
},
|
|
2636
|
-
"gaps": [
|
|
2637
|
-
|
|
2638
|
-
]
|
|
2639
|
-
"blocked": true,
|
|
2640
|
-
"preset": null
|
|
2800
|
+
"gaps": [],
|
|
2801
|
+
"blocked": false,
|
|
2802
|
+
"preset": "<Toast action={<Button variant=\"ghost\">Undo</Button>} variant=\"success\">[what just happened]</Toast>\n"
|
|
2641
2803
|
},
|
|
2642
2804
|
{
|
|
2643
2805
|
"id": "bulk-action-bar",
|
|
@@ -2933,9 +3095,9 @@
|
|
|
2933
3095
|
"record detail panel"
|
|
2934
3096
|
],
|
|
2935
3097
|
"compose": {
|
|
2936
|
-
"component": "
|
|
3098
|
+
"component": "Dialog",
|
|
2937
3099
|
"props": {
|
|
2938
|
-
"
|
|
3100
|
+
"placement": "{param:placement}"
|
|
2939
3101
|
},
|
|
2940
3102
|
"slots": {
|
|
2941
3103
|
"title": [
|
|
@@ -2964,13 +3126,13 @@
|
|
|
2964
3126
|
},
|
|
2965
3127
|
"parameters": [
|
|
2966
3128
|
{
|
|
2967
|
-
"key": "
|
|
3129
|
+
"key": "placement",
|
|
2968
3130
|
"ask": "Which edge should the drawer open from?",
|
|
2969
3131
|
"options": [
|
|
2970
|
-
"end",
|
|
2971
|
-
"start"
|
|
3132
|
+
"inline-end",
|
|
3133
|
+
"inline-start"
|
|
2972
3134
|
],
|
|
2973
|
-
"default": "end"
|
|
3135
|
+
"default": "inline-end"
|
|
2974
3136
|
}
|
|
2975
3137
|
],
|
|
2976
3138
|
"content": {
|
|
@@ -2979,11 +3141,9 @@
|
|
|
2979
3141
|
"primary-label": "Save",
|
|
2980
3142
|
"dismiss-label": "Close"
|
|
2981
3143
|
},
|
|
2982
|
-
"gaps": [
|
|
2983
|
-
|
|
2984
|
-
]
|
|
2985
|
-
"blocked": true,
|
|
2986
|
-
"preset": null
|
|
3144
|
+
"gaps": [],
|
|
3145
|
+
"blocked": false,
|
|
3146
|
+
"preset": "<Dialog\n footer={<>\n <Button variant=\"accent\">Save</Button>\n <Button variant=\"neutral\">Close</Button>\n </>}\n placement=\"inline-end\"\n title=\"[record title]\"\n>\n [key-value summary of the selected record]\n</Dialog>\n"
|
|
2987
3147
|
},
|
|
2988
3148
|
{
|
|
2989
3149
|
"id": "empty-state",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@handamade/psi-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "MCP server and agent-context generator for the Psi (Ψ) design system",
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"tsx": "^4.22.4",
|
|
34
34
|
"typescript": "^5.7.0",
|
|
35
35
|
"vitest": "^3.2.6",
|
|
36
|
-
"@handamade/psi-tokens": "0.
|
|
37
|
-
"@handamade/psi-react": "0.
|
|
36
|
+
"@handamade/psi-tokens": "0.12.0",
|
|
37
|
+
"@handamade/psi-react": "0.12.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsx scripts/build-index.ts && tsc -p tsconfig.build.json"
|