@handamade/psi-react 0.4.0 → 0.5.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/AspectRatio/AspectRatio.d.ts +1 -0
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/Button/Button.d.ts +2 -0
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Card/Card.d.ts +2 -0
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Dialog/Dialog.d.ts +24 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -0
- package/dist/Field/Field.d.ts +36 -0
- package/dist/Field/Field.d.ts.map +1 -0
- package/dist/IconButton/IconButton.d.ts +2 -0
- package/dist/IconButton/IconButton.d.ts.map +1 -1
- package/dist/Input/Input.d.ts +4 -1
- package/dist/Input/Input.d.ts.map +1 -1
- package/dist/NavBar/NavBar.d.ts +1 -0
- package/dist/NavBar/NavBar.d.ts.map +1 -1
- package/dist/Select/Select.d.ts +4 -1
- package/dist/Select/Select.d.ts.map +1 -1
- package/dist/Switch/Switch.d.ts +2 -0
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Tag/Tag.d.ts +2 -0
- package/dist/Tag/Tag.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.d.ts +1 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/a11y-meta.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +567 -442
- package/dist/manifest.json +180 -13
- package/dist/styles.css +1 -1
- package/docs/AspectRatio.md +3 -1
- package/docs/Button.md +3 -1
- package/docs/Card.md +3 -1
- package/docs/Checkbox.md +3 -1
- package/docs/Dialog.md +43 -0
- package/docs/Field.md +42 -0
- package/docs/IconButton.md +3 -1
- package/docs/Input.md +5 -3
- package/docs/NavBar.md +3 -1
- package/docs/Select.md +5 -3
- package/docs/Switch.md +3 -1
- package/docs/Tag.md +3 -1
- package/docs/Tooltip.md +3 -1
- package/llms.txt +3 -3
- package/package.json +3 -2
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @handamade/psi-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
13 React 19 components consuming @handamade/psi-tokens. Zero runtime deps, CSS Modules, ref-as-prop.
|
|
4
4
|
|
|
5
5
|
## Machine-readable artifacts
|
|
6
6
|
- dist/manifest.json: full component/prop inventory with types and defaults
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
|
|
33
33
|
## Compositions (recipes for what has no component yet)
|
|
34
34
|
|
|
35
|
-
- Form field:
|
|
35
|
+
- Form field: wrap the label, control, and message with `<Field label description error required>{control}</Field>` — label association (htmlFor/id), the description/error message line (swaps to error, aria-live="polite"), and aria-describedby/aria-invalid wiring onto a nested Input/Select are automatic (D49). `group` mode renders fieldset/legend for self-labeled controls (Checkbox/Switch). Standalone Input/Select used outside Field still need `aria-invalid` and `aria-describedby` paired manually. Spacing: `psi-gap-24` between fields, `psi-gap-12` for toggle groups, `psi-gap-8` for button rows and label+Tag rows.
|
|
36
36
|
- Stacks/rows: `.psi-gap-*` utilities set only the gap — they do not create a flex/grid container. Pair them with `display: flex` (column for stacks, row for button groups).
|
|
37
37
|
- Native pass-through: components spread unlisted props onto their underlying element (Input → `<input>`, Select → `<select>`, Button → `<button>`/`<a>`), so `value`, `onChange`, `type`, `id`, `autoComplete`, `checked` etc. all work even though manifest.json lists only the component-specific props. Exception: Tooltip takes no host props — put handlers/attributes on its trigger child.
|
|
38
38
|
- Theming, programmatic: the standard setup is `data-psi-theme` on `<html>`. From JS, set it once at app init: `document.documentElement.dataset.psiTheme = "dark"` (React: in a root-level effect). Theme CSS does NOT paint the page background — paint `background: var(--psi-bg-primary)` at your app root yourself. For a themed subtree, set `data-psi-theme` on a wrapper and paint its background the same way; brand font combos do not reach nested subtrees (see guidance.fonts.scope).
|
|
39
39
|
- Size selection: 32 is the default (compact UI); 40 for comfortable forms and marketing pages; 24 for inline/table-row actions; 48 for hero CTAs.
|
|
40
40
|
- Tags & the accent rule (D40): Tags are passive labels — they do NOT count against "one accent per visual group" (that rule governs buttons/CTAs). Badge mapping: highlight (e.g. a plan badge) → `accent-subtle`; meta → `neutral-subtle`; status → `success`/`warning`/`danger`.
|
|
41
41
|
- CSS import order: all DS stylesheets are order-independent — base.css opens with an explicit `@layer psi.base, psi.theme, psi.components, psi.utilities;` statement. Recommended listing for readability: base → theme → components → utilities → @handamade/psi-react/styles.
|
|
42
|
-
- Widths: content widths are app-level; the system tokenizes the page container only (`--psi-container-max`).
|
|
42
|
+
- Widths: content widths are app-level; the system tokenizes the page container only (`--psi-container-max`). Dialog is the first component with its own width union — `width` is `400 | 560 | 720` (default 560).
|
|
43
43
|
- Full semantic token roster: `@handamade/psi-tokens/resolved/<theme>.json` has every token with resolved values — this file lists only the patterns.
|
|
44
44
|
|
|
45
45
|
Live MCP access to this data: see packages/mcp/llms.txt (hosted: https://psi.kurkin.de/mcp).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@handamade/psi-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts"
|
|
11
11
|
},
|
|
12
12
|
"./styles": "./dist/styles.css",
|
|
13
|
+
"./styles.css": "./dist/styles.css",
|
|
13
14
|
"./manifest.json": "./dist/manifest.json"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
"tsx": "^4.22.4",
|
|
38
39
|
"vite": "^6.0.0",
|
|
39
40
|
"vitest": "^3.2.6",
|
|
40
|
-
"@handamade/psi-tokens": "0.
|
|
41
|
+
"@handamade/psi-tokens": "0.5.0"
|
|
41
42
|
},
|
|
42
43
|
"scripts": {
|
|
43
44
|
"build": "vite build && tsc -p tsconfig.build.json && tsx scripts/emit-manifest.ts && tsx scripts/emit-docs.ts",
|