@tomny-dev/uzi 0.1.7 → 0.1.9
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 -103
- package/dist/index.cjs +81 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +89 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
# @tomny-dev/uzi
|
|
2
|
-
|
|
3
|
-
Rapid-fire React UI components. Ship faster, build more.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm add @tomny-dev/uzi
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```tsx
|
|
14
|
-
import { Button, Card, Modal, ThemeProvider, useToast } from "@tomny-dev/uzi";
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
If you want the packaged component styles, import the exported stylesheet once in your app:
|
|
18
|
-
|
|
19
|
-
```css
|
|
20
|
-
@import "@tomny-dev/uzi/styles.css";
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Themes
|
|
24
|
-
|
|
25
|
-
`uzi` ships with built-in light/dark tokens and a small accent palette layer.
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
"use client";
|
|
29
|
-
|
|
30
|
-
import { Button, ThemeProvider, useTheme } from "@tomny-dev/uzi";
|
|
31
|
-
|
|
32
|
-
function ThemeToggle() {
|
|
33
|
-
const { resolvedTheme, toggleTheme, accent, setAccent } = useTheme();
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<div>
|
|
37
|
-
<Button onClick={toggleTheme}>
|
|
38
|
-
{resolvedTheme === "dark" ? "Switch to light" : "Switch to dark"}
|
|
39
|
-
</Button>
|
|
40
|
-
<Button variant="outline" onClick={() => setAccent(accent === "violet" ? "blue" : "violet")}>
|
|
41
|
-
Toggle accent
|
|
42
|
-
</Button>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function App() {
|
|
48
|
-
return (
|
|
49
|
-
<ThemeProvider defaultTheme="system" defaultAccent="blue">
|
|
50
|
-
<ThemeToggle />
|
|
51
|
-
</ThemeProvider>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Supported themes:
|
|
57
|
-
|
|
58
|
-
- `light`
|
|
59
|
-
- `dark`
|
|
60
|
-
- `system`
|
|
61
|
-
|
|
62
|
-
Supported accent palettes:
|
|
63
|
-
|
|
64
|
-
- `blue`
|
|
65
|
-
- `cyan`
|
|
66
|
-
- `violet`
|
|
67
|
-
- `emerald`
|
|
68
|
-
- `amber`
|
|
69
|
-
- `rose`
|
|
70
|
-
|
|
71
|
-
## Components
|
|
72
|
-
|
|
73
|
-
| Component | Description |
|
|
74
|
-
|---|---|
|
|
75
|
-
| `Avatar` | Profile image with fallback states |
|
|
76
|
-
| `Button` | Primary, secondary, outline, ghost variants |
|
|
77
|
-
| `Card` | Surface container with tone/padding control |
|
|
78
|
-
| `Checkbox` | Checkbox form primitive |
|
|
79
|
-
| `Input` | Text input primitive |
|
|
80
|
-
| `Label` | Form label primitive |
|
|
81
|
-
| `Pill` | Inline badge/tag |
|
|
82
|
-
| `Modal` | Accessible overlay dialog |
|
|
83
|
-
| `Dropdown` | Select-style dropdown |
|
|
84
|
-
| `DropdownMenu` | Radix-based action menu primitives |
|
|
85
|
-
| `AppShell` | Responsive layout with collapsible sidebar |
|
|
86
|
-
| `SidebarNav` | Sidebar navigation list |
|
|
87
|
-
| `TopBar` | Composable header shell for brand, nav triggers, and actions |
|
|
88
|
-
| `ThemeToggleButton` | Reusable light/dark toggle wired to `ThemeProvider` |
|
|
89
|
-
| `ThemeProvider` / `useTheme` | Light/dark + accent palette theming |
|
|
90
|
-
| `ToastProvider` / `useToast` | Toast notification system |
|
|
91
|
-
|
|
92
|
-
`TopBar` supports:
|
|
93
|
-
|
|
94
|
-
- `brandingLocation="left" | "center"`
|
|
95
|
-
- `isSticky={true | false}`
|
|
96
|
-
- `showThemeToggle`
|
|
97
|
-
- `themeToggleProps`
|
|
98
|
-
|
|
99
|
-
## Notes
|
|
100
|
-
|
|
101
|
-
- No Tailwind — components use CSS modules internally
|
|
102
|
-
- `"use client"` is handled by the bundle — no need to wrap imports
|
|
103
|
-
- `react` and `react-dom` are peer dependencies, provided by your app
|
|
1
|
+
# @tomny-dev/uzi
|
|
2
|
+
|
|
3
|
+
Rapid-fire React UI components. Ship faster, build more.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @tomny-dev/uzi
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Button, Card, Modal, ThemeProvider, useToast } from "@tomny-dev/uzi";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
If you want the packaged component styles, import the exported stylesheet once in your app:
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@import "@tomny-dev/uzi/styles.css";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Themes
|
|
24
|
+
|
|
25
|
+
`uzi` ships with built-in light/dark tokens and a small accent palette layer.
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
"use client";
|
|
29
|
+
|
|
30
|
+
import { Button, ThemeProvider, useTheme } from "@tomny-dev/uzi";
|
|
31
|
+
|
|
32
|
+
function ThemeToggle() {
|
|
33
|
+
const { resolvedTheme, toggleTheme, accent, setAccent } = useTheme();
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div>
|
|
37
|
+
<Button onClick={toggleTheme}>
|
|
38
|
+
{resolvedTheme === "dark" ? "Switch to light" : "Switch to dark"}
|
|
39
|
+
</Button>
|
|
40
|
+
<Button variant="outline" onClick={() => setAccent(accent === "violet" ? "blue" : "violet")}>
|
|
41
|
+
Toggle accent
|
|
42
|
+
</Button>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function App() {
|
|
48
|
+
return (
|
|
49
|
+
<ThemeProvider defaultTheme="system" defaultAccent="blue">
|
|
50
|
+
<ThemeToggle />
|
|
51
|
+
</ThemeProvider>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Supported themes:
|
|
57
|
+
|
|
58
|
+
- `light`
|
|
59
|
+
- `dark`
|
|
60
|
+
- `system`
|
|
61
|
+
|
|
62
|
+
Supported accent palettes:
|
|
63
|
+
|
|
64
|
+
- `blue`
|
|
65
|
+
- `cyan`
|
|
66
|
+
- `violet`
|
|
67
|
+
- `emerald`
|
|
68
|
+
- `amber`
|
|
69
|
+
- `rose`
|
|
70
|
+
|
|
71
|
+
## Components
|
|
72
|
+
|
|
73
|
+
| Component | Description |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `Avatar` | Profile image with fallback states |
|
|
76
|
+
| `Button` | Primary, secondary, outline, ghost variants |
|
|
77
|
+
| `Card` | Surface container with tone/padding control |
|
|
78
|
+
| `Checkbox` | Checkbox form primitive |
|
|
79
|
+
| `Input` | Text input primitive |
|
|
80
|
+
| `Label` | Form label primitive |
|
|
81
|
+
| `Pill` | Inline badge/tag |
|
|
82
|
+
| `Modal` | Accessible overlay dialog |
|
|
83
|
+
| `Dropdown` | Select-style dropdown |
|
|
84
|
+
| `DropdownMenu` | Radix-based action menu primitives |
|
|
85
|
+
| `AppShell` | Responsive layout with collapsible sidebar |
|
|
86
|
+
| `SidebarNav` | Sidebar navigation list |
|
|
87
|
+
| `TopBar` | Composable header shell for brand, nav triggers, and actions |
|
|
88
|
+
| `ThemeToggleButton` | Reusable light/dark toggle wired to `ThemeProvider` |
|
|
89
|
+
| `ThemeProvider` / `useTheme` | Light/dark + accent palette theming |
|
|
90
|
+
| `ToastProvider` / `useToast` | Toast notification system |
|
|
91
|
+
|
|
92
|
+
`TopBar` supports:
|
|
93
|
+
|
|
94
|
+
- `brandingLocation="left" | "center"`
|
|
95
|
+
- `isSticky={true | false}`
|
|
96
|
+
- `showThemeToggle`
|
|
97
|
+
- `themeToggleProps`
|
|
98
|
+
|
|
99
|
+
## Notes
|
|
100
|
+
|
|
101
|
+
- No Tailwind — components use CSS modules internally
|
|
102
|
+
- `"use client"` is handled by the bundle — no need to wrap imports
|
|
103
|
+
- `react` and `react-dom` are peer dependencies, provided by your app
|
package/dist/index.cjs
CHANGED
|
@@ -59,7 +59,10 @@ __export(index_exports, {
|
|
|
59
59
|
Modal: () => Modal,
|
|
60
60
|
ModalOverlay: () => ModalOverlay,
|
|
61
61
|
Pill: () => Pill,
|
|
62
|
+
Progress: () => Progress,
|
|
63
|
+
Select: () => Select,
|
|
62
64
|
SidebarNav: () => SidebarNav,
|
|
65
|
+
Skeleton: () => Skeleton,
|
|
63
66
|
ThemeProvider: () => ThemeProvider,
|
|
64
67
|
ThemeToggleButton: () => ThemeToggleButton,
|
|
65
68
|
ToastProvider: () => ToastProvider,
|
|
@@ -1364,6 +1367,81 @@ function SidebarNavEntry({
|
|
|
1364
1367
|
}
|
|
1365
1368
|
);
|
|
1366
1369
|
}
|
|
1370
|
+
|
|
1371
|
+
// src/components/skeleton/Skeleton.tsx
|
|
1372
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1373
|
+
function Skeleton({
|
|
1374
|
+
width,
|
|
1375
|
+
height,
|
|
1376
|
+
radius = "md",
|
|
1377
|
+
className,
|
|
1378
|
+
style,
|
|
1379
|
+
...rest
|
|
1380
|
+
}) {
|
|
1381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1382
|
+
"div",
|
|
1383
|
+
{
|
|
1384
|
+
className: cx("skeleton", `radius-${radius}`, className),
|
|
1385
|
+
style: { width, height, ...style },
|
|
1386
|
+
"aria-hidden": "true",
|
|
1387
|
+
...rest
|
|
1388
|
+
}
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
// src/components/progress/Progress.tsx
|
|
1393
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1394
|
+
function Progress({
|
|
1395
|
+
value,
|
|
1396
|
+
tone = "default",
|
|
1397
|
+
className,
|
|
1398
|
+
"aria-label": ariaLabel,
|
|
1399
|
+
...rest
|
|
1400
|
+
}) {
|
|
1401
|
+
const clamped = Math.max(0, Math.min(100, value));
|
|
1402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1403
|
+
"div",
|
|
1404
|
+
{
|
|
1405
|
+
className: cx("track", className),
|
|
1406
|
+
role: "progressbar",
|
|
1407
|
+
"aria-valuenow": clamped,
|
|
1408
|
+
"aria-valuemin": 0,
|
|
1409
|
+
"aria-valuemax": 100,
|
|
1410
|
+
"aria-label": ariaLabel,
|
|
1411
|
+
...rest,
|
|
1412
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1413
|
+
"div",
|
|
1414
|
+
{
|
|
1415
|
+
className: cx("fill", `tone-${tone}`),
|
|
1416
|
+
style: { width: `${clamped}%` }
|
|
1417
|
+
}
|
|
1418
|
+
)
|
|
1419
|
+
}
|
|
1420
|
+
);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
// src/components/select/Select.tsx
|
|
1424
|
+
var React4 = __toESM(require("react"), 1);
|
|
1425
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1426
|
+
var Select = React4.forwardRef(
|
|
1427
|
+
({ options, value, onChange, placeholder, className, ...rest }, ref) => {
|
|
1428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1429
|
+
"select",
|
|
1430
|
+
{
|
|
1431
|
+
ref,
|
|
1432
|
+
value,
|
|
1433
|
+
onChange: (e) => onChange(e.target.value),
|
|
1434
|
+
className: cx("select", className),
|
|
1435
|
+
...rest,
|
|
1436
|
+
children: [
|
|
1437
|
+
placeholder ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: "", disabled: true, children: placeholder }) : null,
|
|
1438
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1439
|
+
]
|
|
1440
|
+
}
|
|
1441
|
+
);
|
|
1442
|
+
}
|
|
1443
|
+
);
|
|
1444
|
+
Select.displayName = "Select";
|
|
1367
1445
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1368
1446
|
0 && (module.exports = {
|
|
1369
1447
|
Alert,
|
|
@@ -1394,7 +1472,10 @@ function SidebarNavEntry({
|
|
|
1394
1472
|
Modal,
|
|
1395
1473
|
ModalOverlay,
|
|
1396
1474
|
Pill,
|
|
1475
|
+
Progress,
|
|
1476
|
+
Select,
|
|
1397
1477
|
SidebarNav,
|
|
1478
|
+
Skeleton,
|
|
1398
1479
|
ThemeProvider,
|
|
1399
1480
|
ThemeToggleButton,
|
|
1400
1481
|
ToastProvider,
|