@threelight/ui-react 0.1.0-alpha.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 +71 -0
- package/dist/index.d.ts +1191 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +98 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @threelight/ui-react
|
|
2
|
+
|
|
3
|
+
React adapters for the ThreeLight UI HTML/CSS contract.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pnpm add @threelight/ui@alpha @threelight/ui-react@alpha
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
`@threelight/ui` is a required peer dependency. It provides the CSS, tokens,
|
|
10
|
+
metadata, and public `tl-*` / `data-tl-*` contract that these React wrappers
|
|
11
|
+
render.
|
|
12
|
+
|
|
13
|
+
Import the core CSS once from your app entrypoint:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import '@threelight/ui/base.css'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Use React components as thin wrappers around the public contract:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { Body, Button, Display, PageHeader } from '@threelight/ui-react'
|
|
23
|
+
|
|
24
|
+
export function ReportsHeader() {
|
|
25
|
+
return (
|
|
26
|
+
<PageHeader>
|
|
27
|
+
<PageHeader.Content>
|
|
28
|
+
<Display>Reports</Display>
|
|
29
|
+
<Body>Readable governed UI foundations.</Body>
|
|
30
|
+
</PageHeader.Content>
|
|
31
|
+
<PageHeader.Actions>
|
|
32
|
+
<Button tone="primary">New report</Button>
|
|
33
|
+
</PageHeader.Actions>
|
|
34
|
+
</PageHeader>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`tone="neutral"` omits `data-tl-tone`; other tones render `data-tl-tone`.
|
|
40
|
+
`state` renders `data-tl-state`. The `as` prop is available on root components.
|
|
41
|
+
|
|
42
|
+
## Components
|
|
43
|
+
|
|
44
|
+
- Root: `Root`
|
|
45
|
+
- Layout: `Section`, `Stack`, `Cluster`, `Grid`
|
|
46
|
+
- Surfaces: `Card`, `Panel`, `Alert`
|
|
47
|
+
- Typography: `Display`, `Heading`, `Body`, `Caption`, `Meta`, `Label`,
|
|
48
|
+
`ActionText`, `Metric`, `Code`
|
|
49
|
+
- Actions and status: `Button`, `Badge`
|
|
50
|
+
- Forms: `Field`, `Input`, `Help`
|
|
51
|
+
- Patterns: `PageHeader`, `EmptyState`
|
|
52
|
+
|
|
53
|
+
## Release
|
|
54
|
+
|
|
55
|
+
Dry-run the package contents:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pnpm release:ui-react:pack
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Publish an alpha release:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pnpm release:ui-react:alpha
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Check published dist-tags:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pnpm release:ui-react:tags
|
|
71
|
+
```
|