@holaboss/ui 0.1.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 +116 -0
- package/dist/index.cjs +973 -0
- package/dist/index.d.cts +643 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +643 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +904 -0
- package/dist/index.js.map +1 -0
- package/dist/themes/holaos.css +121 -0
- package/dist/tokens.css +446 -0
- package/package.json +72 -0
- package/src/index.ts +108 -0
- package/src/layouts/dashboard-shell.tsx +43 -0
- package/src/layouts/data-table.tsx +110 -0
- package/src/layouts/error-state.tsx +52 -0
- package/src/layouts/filter-bar.tsx +58 -0
- package/src/layouts/loading-state.tsx +67 -0
- package/src/layouts/page-header.tsx +44 -0
- package/src/layouts/section.tsx +49 -0
- package/src/layouts/stat-pill.tsx +57 -0
- package/src/lib/utils.ts +6 -0
- package/src/primitives/alert.tsx +76 -0
- package/src/primitives/badge.tsx +52 -0
- package/src/primitives/button.tsx +61 -0
- package/src/primitives/card.tsx +107 -0
- package/src/primitives/dropdown-menu.tsx +270 -0
- package/src/primitives/empty-state.tsx +112 -0
- package/src/primitives/input.tsx +20 -0
- package/src/primitives/kbd.tsx +38 -0
- package/src/primitives/label.tsx +20 -0
- package/src/primitives/popover.tsx +87 -0
- package/src/primitives/select.tsx +202 -0
- package/src/primitives/status-dot.tsx +85 -0
- package/src/primitives/switch.tsx +19 -0
- package/src/primitives/tabs.tsx +80 -0
- package/src/primitives/tooltip.tsx +64 -0
- package/src/tokens/themes/holaos.css +121 -0
- package/src/tokens/tokens.css +446 -0
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# @holaboss/ui
|
|
2
|
+
|
|
3
|
+
Shared UI library for holaOS — primitives, layouts, and CSS tokens used by [app-builder-sdk](https://github.com/holaboss-ai/holaOS/tree/main/sdk/app-builder-sdk) dashboards.
|
|
4
|
+
|
|
5
|
+
The goal is **visual consistency across agent-built apps**. Tokens already keep colors and radii in sync; this library adds the composition layer — page chrome, empty states, loading skeletons, data-table density — so every dashboard built in a workspace looks like it belongs to the same product.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add @holaboss/ui
|
|
11
|
+
# or: npm install @holaboss/ui
|
|
12
|
+
# or: pnpm add @holaboss/ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Peer deps: `react ^19`, `react-dom ^19`.
|
|
16
|
+
|
|
17
|
+
## Mount the tokens
|
|
18
|
+
|
|
19
|
+
At the root of your app (e.g. `routes/__root.tsx`):
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import "@holaboss/ui/tokens.css";
|
|
23
|
+
import "@holaboss/ui/themes/holaos.css";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Both stylesheets ship inside the npm package and are required — without them the CSS variables (`--background`, `--primary`, `--border`, `--radius`, etc.) fall back to defaults and every primitive renders wrong.
|
|
27
|
+
|
|
28
|
+
## What ships
|
|
29
|
+
|
|
30
|
+
### Primitives
|
|
31
|
+
|
|
32
|
+
Drop-in shadcn-style components on top of `@base-ui/react`. They match the holaOS desktop's canonical style exactly.
|
|
33
|
+
|
|
34
|
+
`Alert` · `Badge` · `Button` · `Card` (+ `CardHeader/Title/Description/Content/Footer/Action`) · `DropdownMenu` family · `EmptyState` · `Input` · `Kbd` · `Label` · `Popover` family · `Select` family · `StatusDot` · `Switch` · `Tabs` family · `Tooltip` family
|
|
35
|
+
|
|
36
|
+
### Layouts
|
|
37
|
+
|
|
38
|
+
Composition primitives that solve the actual dashboard-drift problem. Reach for these instead of hand-rolling a similar shape.
|
|
39
|
+
|
|
40
|
+
- **`DashboardShell`** — sticky-header chrome + scrollable content
|
|
41
|
+
- **`PageHeader`** — title + description + action row
|
|
42
|
+
- **`Section`** — title + description over a content block
|
|
43
|
+
- **`FilterBar`** — search input + filter chip slot + actions
|
|
44
|
+
- **`DataTable`** — typed columns, optional row click, built-in loading + empty states
|
|
45
|
+
- **`StatPill`** — small metric (label + value + tone + optional trend / icon)
|
|
46
|
+
- **`LoadingState`** — skeleton variants: `rows` / `list` / `card`
|
|
47
|
+
- **`ErrorState`** — error display with optional retry button
|
|
48
|
+
|
|
49
|
+
### Utility
|
|
50
|
+
|
|
51
|
+
- **`cn(...inputs)`** — class merging via `clsx` + `tailwind-merge`
|
|
52
|
+
|
|
53
|
+
## Minimal example
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import {
|
|
57
|
+
Badge,
|
|
58
|
+
Button,
|
|
59
|
+
DashboardShell,
|
|
60
|
+
DataTable,
|
|
61
|
+
FilterBar,
|
|
62
|
+
PageHeader,
|
|
63
|
+
Section,
|
|
64
|
+
StatPill,
|
|
65
|
+
type DataTableColumn,
|
|
66
|
+
} from "@holaboss/ui";
|
|
67
|
+
|
|
68
|
+
const columns: DataTableColumn<Issue>[] = [
|
|
69
|
+
{ id: "title", header: "Title", cell: (row) => row.title },
|
|
70
|
+
{ id: "status", header: "Status", width: "120px", cell: (row) => <Badge>{row.status}</Badge> },
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
export default function Dashboard() {
|
|
74
|
+
return (
|
|
75
|
+
<DashboardShell
|
|
76
|
+
header={
|
|
77
|
+
<>
|
|
78
|
+
<PageHeader
|
|
79
|
+
title="Issues"
|
|
80
|
+
description="GitHub issues synced into the workspace"
|
|
81
|
+
actions={<Button size="sm">Refresh</Button>}
|
|
82
|
+
/>
|
|
83
|
+
<FilterBar search={search} onSearchChange={setSearch} />
|
|
84
|
+
</>
|
|
85
|
+
}
|
|
86
|
+
>
|
|
87
|
+
<Section title="Overview">
|
|
88
|
+
<div className="grid grid-cols-3 gap-3">
|
|
89
|
+
<StatPill label="Open" value={open} tone="positive" />
|
|
90
|
+
<StatPill label="In progress" value={inProgress} />
|
|
91
|
+
<StatPill label="Closed" value={closed} />
|
|
92
|
+
</div>
|
|
93
|
+
</Section>
|
|
94
|
+
<Section title="Issues">
|
|
95
|
+
<DataTable
|
|
96
|
+
columns={columns}
|
|
97
|
+
rows={rows}
|
|
98
|
+
rowKey={(r) => String(r.id)}
|
|
99
|
+
isLoading={isLoading}
|
|
100
|
+
emptyTitle="No issues yet"
|
|
101
|
+
/>
|
|
102
|
+
</Section>
|
|
103
|
+
</DashboardShell>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## What this is **not**
|
|
109
|
+
|
|
110
|
+
- A replacement for Tailwind. The library expects Tailwind in the consuming app (the tokens compile against Tailwind's CSS-variable layer).
|
|
111
|
+
- A theming system. Themes are workspace-level; a single app does not get a theme toggle.
|
|
112
|
+
- A "ship raw shadcn" library. The primitives are pinned to the holaOS-canonical version — if shadcn's upstream changes, this package updates first.
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
Apache-2.0. See [LICENSE](https://github.com/holaboss-ai/holaOS/blob/main/LICENSE).
|