@refineui/react 0.0.1 → 0.0.3
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 +103 -0
- package/dist/index.cjs +17 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -20
- package/dist/index.d.ts +20 -20
- package/dist/index.js +17 -17
- package/dist/index.js.map +1 -1
- package/dist/spec/contract-index.json +1 -1
- package/dist/spec/token-graph.json +234 -38
- package/dist/spec/token-trace-v2.json +156 -6
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# @refineui/react
|
|
2
|
+
|
|
3
|
+
Accessible React components for [RefineUI](https://ui.pelagornis.com) — composed from `@refineui/tokens`, shipped with a machine-readable component contract.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @refineui/react @refineui/tokens
|
|
9
|
+
yarn add @refineui/react @refineui/tokens
|
|
10
|
+
pnpm add @refineui/react @refineui/tokens
|
|
11
|
+
bun add @refineui/react @refineui/tokens
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
React 18+ and `react-dom` 18+ are required as peers.
|
|
15
|
+
|
|
16
|
+
## Stylesheet
|
|
17
|
+
|
|
18
|
+
Load token CSS, system icons, and component interaction styles once at the app root:
|
|
19
|
+
|
|
20
|
+
```css
|
|
21
|
+
@import "@refineui/tokens/tailwind.css";
|
|
22
|
+
@import "@refineui/web-icons/dist/fonts/refineui-system-icons.css";
|
|
23
|
+
@import "@refineui/react/refineui.css";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or in JS:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import "@refineui/react/refineui.css";
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`refineui.css` carries the pseudo-state layer (`:hover`, `:focus-visible`, `data-state`), so components render unstyled interactions without it.
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Button, Card, Input } from "@refineui/react";
|
|
38
|
+
|
|
39
|
+
export function Example() {
|
|
40
|
+
return (
|
|
41
|
+
<Card>
|
|
42
|
+
<Input placeholder="Email" type="email" />
|
|
43
|
+
<Button variant="primary" type="button">
|
|
44
|
+
Continue
|
|
45
|
+
</Button>
|
|
46
|
+
</Card>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Subcomponents compose explicitly — there are no convenience props such as `title`, `items`, or `actions`:
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import {
|
|
55
|
+
Alert,
|
|
56
|
+
AlertBody,
|
|
57
|
+
AlertDescription,
|
|
58
|
+
AlertIcon,
|
|
59
|
+
AlertRow,
|
|
60
|
+
AlertTitle,
|
|
61
|
+
} from "@refineui/react";
|
|
62
|
+
|
|
63
|
+
<Alert variant="warning">
|
|
64
|
+
<AlertRow>
|
|
65
|
+
<AlertIcon />
|
|
66
|
+
<AlertBody>
|
|
67
|
+
<AlertTitle>Storage almost full</AlertTitle>
|
|
68
|
+
<AlertDescription>Free up space to keep syncing.</AlertDescription>
|
|
69
|
+
</AlertBody>
|
|
70
|
+
</AlertRow>
|
|
71
|
+
</Alert>;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Component Spec
|
|
75
|
+
|
|
76
|
+
Every component ships a behavior contract — anatomy, variants, states, DOM attributes, accessibility, keyboard, focus, and layout direction:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
spec/manifest.json # catalog of all component specs
|
|
80
|
+
spec/components/*.json # one contract per component
|
|
81
|
+
spec/schema/*.json # JSON Schema for the contract shape
|
|
82
|
+
dist/spec/contract-index.json
|
|
83
|
+
dist/spec/token-trace-v2.json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
These files are what [`@refineui/doctor`](https://www.npmjs.com/package/@refineui/doctor) validates against and what [`@refineui/mcp`](https://www.npmjs.com/package/@refineui/mcp) serves to agents. See `spec/README.md` for the contract layer status.
|
|
87
|
+
|
|
88
|
+
## Conventions
|
|
89
|
+
|
|
90
|
+
- Root elements carry `data-refineui`; component states carry `data-state`.
|
|
91
|
+
- Color, spacing, radius, stroke, typography, shadow, z-index, and motion come from tokens only.
|
|
92
|
+
- Focus rings use `:focus-visible` with `--refineui-focus-ring-*`.
|
|
93
|
+
- Motion collapses under `prefers-reduced-motion`; forced-colors mode maps to system colors.
|
|
94
|
+
- Layout uses logical properties (`ps`/`pe`/`ms`/`me`) so RTL works without overrides.
|
|
95
|
+
|
|
96
|
+
## Development
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bun run build # utilities → tokens → tsup → refineui.css → component spec
|
|
100
|
+
bun run dev # tsup --watch
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Docs: [ui.pelagornis.com/components](https://ui.pelagornis.com/components/) · AI context: [`llm.txt`](https://ui.pelagornis.com/llm.txt)
|
package/dist/index.cjs
CHANGED
|
@@ -587,20 +587,20 @@ var componentColorTokens = {
|
|
|
587
587
|
border: semanticToken("borderDefault"),
|
|
588
588
|
title: semanticToken("foregroundPrimary"),
|
|
589
589
|
description: {
|
|
590
|
-
default: semanticToken("
|
|
591
|
-
info:
|
|
592
|
-
success:
|
|
593
|
-
warning:
|
|
594
|
-
danger:
|
|
595
|
-
custom:
|
|
590
|
+
default: semanticToken("foregroundSecondary"),
|
|
591
|
+
info: semanticToken("foregroundInfo"),
|
|
592
|
+
success: semanticToken("foregroundSuccess"),
|
|
593
|
+
warning: semanticToken("foregroundWarning"),
|
|
594
|
+
danger: semanticToken("foregroundError"),
|
|
595
|
+
custom: semanticToken("foregroundDiscovery")
|
|
596
596
|
},
|
|
597
597
|
accent: {
|
|
598
598
|
default: semanticToken("foregroundPrimary"),
|
|
599
|
-
info:
|
|
600
|
-
success:
|
|
601
|
-
warning:
|
|
602
|
-
danger:
|
|
603
|
-
custom:
|
|
599
|
+
info: semanticToken("foregroundInfo"),
|
|
600
|
+
success: semanticToken("foregroundSuccess"),
|
|
601
|
+
warning: semanticToken("foregroundWarning"),
|
|
602
|
+
danger: semanticToken("foregroundError"),
|
|
603
|
+
custom: semanticToken("foregroundDiscovery")
|
|
604
604
|
}
|
|
605
605
|
},
|
|
606
606
|
badge: {
|
|
@@ -5512,31 +5512,31 @@ var variantSlotClasses = {
|
|
|
5512
5512
|
root: "bg-refineui-alias-background-primary",
|
|
5513
5513
|
icon: "text-refineui-alias-foreground-info",
|
|
5514
5514
|
title: "text-refineui-alias-foreground-info",
|
|
5515
|
-
description: "text-refineui-alias-
|
|
5515
|
+
description: "text-refineui-alias-foreground-info"
|
|
5516
5516
|
},
|
|
5517
5517
|
success: {
|
|
5518
5518
|
root: "bg-refineui-alias-background-primary",
|
|
5519
5519
|
icon: "text-refineui-alias-foreground-success",
|
|
5520
5520
|
title: "text-refineui-alias-foreground-success",
|
|
5521
|
-
description: "text-refineui-alias-
|
|
5521
|
+
description: "text-refineui-alias-foreground-success"
|
|
5522
5522
|
},
|
|
5523
5523
|
warning: {
|
|
5524
5524
|
root: "bg-refineui-alias-background-primary",
|
|
5525
5525
|
icon: "text-refineui-alias-foreground-warning",
|
|
5526
5526
|
title: "text-refineui-alias-foreground-warning",
|
|
5527
|
-
description: "text-refineui-alias-
|
|
5527
|
+
description: "text-refineui-alias-foreground-warning"
|
|
5528
5528
|
},
|
|
5529
5529
|
danger: {
|
|
5530
|
-
root: "bg-refineui-alias-background-
|
|
5530
|
+
root: "bg-refineui-alias-background-primary",
|
|
5531
5531
|
icon: "text-refineui-alias-foreground-error",
|
|
5532
5532
|
title: "text-refineui-alias-foreground-error",
|
|
5533
|
-
description: "text-refineui-alias-
|
|
5533
|
+
description: "text-refineui-alias-foreground-error"
|
|
5534
5534
|
},
|
|
5535
5535
|
custom: {
|
|
5536
5536
|
root: "bg-refineui-alias-background-primary",
|
|
5537
5537
|
icon: "text-refineui-alias-foreground-discovery",
|
|
5538
5538
|
title: "text-refineui-alias-foreground-discovery",
|
|
5539
|
-
description: "text-refineui-alias-
|
|
5539
|
+
description: "text-refineui-alias-foreground-discovery"
|
|
5540
5540
|
}
|
|
5541
5541
|
};
|
|
5542
5542
|
var alertRecipe = defineSlotRecipe({
|