skyloom-ui 0.1.0 → 0.1.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/README.md +63 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
# skyloom-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Theme-token-based React components, layouts, data tables, and charts for React 19 and Tailwind CSS v4. Interactive components use Radix primitives for accessible behavior.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install skyloom-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
React and React DOM are peer dependencies and must be available in your application.
|
|
12
|
+
|
|
13
|
+
Import the package stylesheet after Tailwind in your global CSS:
|
|
14
|
+
|
|
15
|
+
```css
|
|
16
|
+
@import "tailwindcss";
|
|
17
|
+
@import "skyloom-ui/styles.css";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
For Next.js, add the package to `transpilePackages` in `next.config.ts`:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import type { NextConfig } from "next";
|
|
24
|
+
|
|
25
|
+
const nextConfig: NextConfig = {
|
|
26
|
+
transpilePackages: ["skyloom-ui"],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default nextConfig;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Button, Card, CardContent, CardHeader, CardTitle } from "skyloom-ui";
|
|
36
|
+
|
|
37
|
+
export function WelcomeCard() {
|
|
38
|
+
return (
|
|
39
|
+
<Card>
|
|
40
|
+
<CardHeader>
|
|
41
|
+
<CardTitle>Welcome</CardTitle>
|
|
42
|
+
</CardHeader>
|
|
43
|
+
<CardContent>
|
|
44
|
+
<Button>Get started</Button>
|
|
45
|
+
</CardContent>
|
|
46
|
+
</Card>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Set the theme and density on the document root:
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<html lang="en" data-theme="light" data-density="comfortable">
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Available themes are `light` and `dark`; densities are `comfortable` (default) and `compact`.
|
|
4
58
|
|
|
5
59
|
```tsx
|
|
6
60
|
import { Button, SelectField, MultiSelect, Card, Dialog, Sheet, ResponsiveGrid } from "skyloom-ui";
|
|
@@ -87,15 +141,15 @@ MultiSelect supports Select all, mixed state, disabled options, and empty option
|
|
|
87
141
|
|
|
88
142
|
Supply DialogTitle/SheetTitle and descriptions in overlays. Label switches and icon-only buttons. Tooltips require TooltipProvider and must not hold essential information available only on hover. Button defaults to type="button"; pass type="submit" explicitly. Button asChild expects one appropriate interactive child, such as a link; native button disabled semantics do not automatically apply to links. Accordion accepts Radix single/multiple modes. Keep business logic out of these wrappers.
|
|
89
143
|
|
|
90
|
-
##
|
|
144
|
+
## Styles and exports
|
|
91
145
|
|
|
92
|
-
|
|
146
|
+
The package exports its components from `skyloom-ui` and provides two stylesheet entry points:
|
|
93
147
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
148
|
+
- `skyloom-ui/styles.css` includes the theme, Tailwind utility mappings, responsive tokens, and shared state styles. Import this stylesheet for normal use.
|
|
149
|
+
- `skyloom-ui/tokens.css` contains the design-token CSS variables when you need tokens without the full stylesheet.
|
|
150
|
+
|
|
151
|
+
The stylesheet registers package component sources for Tailwind CSS v4 class scanning. Load it in your app's global stylesheet so the component styles and utilities are included.
|
|
98
152
|
|
|
99
|
-
|
|
153
|
+
## Development
|
|
100
154
|
|
|
101
|
-
|
|
155
|
+
From the repository's `frontend` directory, install dependencies with `npm install`. Run `npm run check` to type-check the frontend, verify compiled token and responsive styles, and run component interaction tests.
|