@handamade/psi-react 0.7.0 → 0.7.1

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/dist/Tag/Tag.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import type { HTMLAttributes, Ref } from "react";
2
2
  type Variant = "neutral" | "accent" | "success" | "warning" | "danger";
3
3
  export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
4
+ /** Label content. */
5
+ children?: React.ReactNode;
4
6
  /** Semantic color variant. @default "neutral" */
5
7
  variant?: Variant;
6
8
  /** Use tinted background with semantic foreground. @default false */
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,KAAK,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEvE,MAAM,WAAW,QAAS,SAAQ,cAAc,CAAC,eAAe,CAAC;IAC/D,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,wDAAwD;IACxD,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAkBD;8BAC8B;AAC9B,wBAAgB,GAAG,CAAC,EAClB,OAAmB,EACnB,MAAc,EACd,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACR,EAAE,QAAQ,+BAkCV"}
1
+ {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,KAAK,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEvE,MAAM,WAAW,QAAS,SAAQ,cAAc,CAAC,eAAe,CAAC;IAC/D,qBAAqB;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,wDAAwD;IACxD,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAkBD;8BAC8B;AAC9B,wBAAgB,GAAG,CAAC,EAClB,OAAmB,EACnB,MAAc,EACd,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACR,EAAE,QAAQ,+BAkCV"}
@@ -502,6 +502,13 @@
502
502
  "description": "Compact label for status or category; semantic variants, optional subtle tint and dismiss button.",
503
503
  "slots": [],
504
504
  "props": [
505
+ {
506
+ "name": "children",
507
+ "type": "ReactNode",
508
+ "required": false,
509
+ "default": null,
510
+ "description": "Label content."
511
+ },
505
512
  {
506
513
  "name": "variant",
507
514
  "type": "\"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\"",
@@ -13,7 +13,7 @@ Fixed-aspect-ratio box that sizes its child media.
13
13
 
14
14
  ## Theming
15
15
 
16
- Override `--psi-aspect-ratio-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
16
+ This component has no `--psi-aspect-ratio-*` 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.
17
17
 
18
18
 
19
19
 
package/docs/Card.md CHANGED
@@ -15,7 +15,7 @@ Content container with an optional edge-to-edge media slot; `stacked` (media abo
15
15
 
16
16
  ## Theming
17
17
 
18
- Override `--psi-card-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
18
+ Override `--psi-card-*` custom properties at any scope.
19
19
 
20
20
  ## Variant guidance
21
21
 
package/docs/Checkbox.md CHANGED
@@ -20,7 +20,7 @@ Native checkbox with a built-in label; for independent binary choices.
20
20
 
21
21
  ## Theming
22
22
 
23
- Override `--psi-checkbox-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
23
+ Override `--psi-checkbox-*` custom properties at any scope.
24
24
 
25
25
 
26
26
 
package/docs/Dialog.md CHANGED
@@ -27,7 +27,7 @@ Rendered with showModal(): aria-modal, inert background and focus restore come f
27
27
 
28
28
  ## Theming
29
29
 
30
- Override `--psi-dialog-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
30
+ Override `--psi-dialog-*` custom properties at any scope.
31
31
 
32
32
 
33
33
 
package/docs/Field.md CHANGED
@@ -26,7 +26,7 @@ Wires label association, aria-describedby and aria-invalid into a wrapped Input/
26
26
 
27
27
  ## Theming
28
28
 
29
- Override `--psi-field-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
29
+ Override `--psi-field-*` custom properties at any scope.
30
30
 
31
31
 
32
32
 
package/docs/Panel.md CHANGED
@@ -21,7 +21,7 @@ Plain <div> container with no implicit role. Pass aria-* host props if the panel
21
21
 
22
22
  ## Theming
23
23
 
24
- Override `--psi-panel-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
24
+ Override `--psi-panel-*` custom properties at any scope.
25
25
 
26
26
 
27
27
 
package/docs/Switch.md CHANGED
@@ -20,7 +20,7 @@ On/off toggle (`role="switch"`) with a built-in label; for settings that take ef
20
20
 
21
21
  ## Theming
22
22
 
23
- Override `--psi-switch-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
23
+ Override `--psi-switch-*` custom properties at any scope.
24
24
 
25
25
 
26
26
 
package/docs/Tag.md CHANGED
@@ -7,6 +7,7 @@ Compact label for status or category; semantic variants, optional subtle tint an
7
7
 
8
8
  | Prop | Type | Default | Required | Description |
9
9
  |---|---|---|---|---|
10
+ | `children` | `ReactNode` | — | no | Label content. |
10
11
  | `variant` | `"neutral" \| "accent" \| "success" \| "warning" \| "danger"` | neutral | no | Semantic color variant. |
11
12
  | `subtle` | `boolean` | false | no | Use tinted background with semantic foreground. |
12
13
  | `onDismiss` | `(() => void)` | — | no | When provided, renders a dismiss button that calls this handler. |
@@ -23,7 +24,7 @@ Passive label otherwise; not in the tab order without onDismiss.
23
24
 
24
25
  ## Theming
25
26
 
26
- Override `--psi-tag-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
27
+ Override `--psi-tag-*` custom properties at any scope.
27
28
 
28
29
  ## Variant guidance
29
30
 
package/docs/Toolbar.md CHANGED
@@ -21,7 +21,7 @@ With aria-label it renders role=group so the control cluster announces with a na
21
21
 
22
22
  ## Theming
23
23
 
24
- Override `--psi-toolbar-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
24
+ This component has no `--psi-toolbar-*` 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.
25
25
 
26
26
 
27
27
 
package/docs/Tooltip.md CHANGED
@@ -22,7 +22,7 @@ Hover opens after a short delay; content is linked via aria-describedby while vi
22
22
 
23
23
  ## Theming
24
24
 
25
- Override `--psi-tooltip-*` custom properties at any scope; interactive states derive automatically (L - 0.04 hover, L - 0.08 active).
25
+ Override `--psi-tooltip-*` custom properties at any scope.
26
26
 
27
27
 
28
28
 
package/llms.txt CHANGED
@@ -45,7 +45,7 @@
45
45
  - 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.
46
46
  - 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).
47
47
  - 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.
48
- - 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`.
48
+ - 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`. On Tag, `subtle` is a boolean prop — `accent-subtle` is spelled `variant="accent" subtle` (Tag's variant union has no `-subtle` entries).
49
49
  - 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.
50
50
  - 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).
51
51
  - Full semantic token roster: `@handamade/psi-tokens/resolved/<theme>.json` has every token with resolved values — this file lists only the patterns.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handamade/psi-react",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  "tsx": "^4.22.4",
40
40
  "vite": "^6.0.0",
41
41
  "vitest": "^3.2.6",
42
- "@handamade/psi-tokens": "0.7.0"
42
+ "@handamade/psi-tokens": "0.7.1"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "vite build && tsc -p tsconfig.build.json && tsx scripts/emit-manifest.ts && tsx scripts/emit-patterns.ts && tsx scripts/emit-docs.ts",