Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ Expected domain errors are returned as `Result<T, E>` via [`better-result`](http

### Prerequisites

You need [pnpm](https://pnpm.io/) installed. If you plan to regenerate
protobufs, also install the [Buf CLI](https://buf.build/docs/cli/installation/).
You need [pnpm](https://pnpm.io/) installed. The [Buf CLI](https://buf.build/docs/cli/installation/) is only required if you plan to regenerate protobuf stubs — the generated TypeScript is committed to the repo, so a fresh clone builds without it.

### Setup

Expand All @@ -102,8 +101,18 @@ pnpm --filter @meshtastic/web dev

### Build everything

`@meshtastic/protobufs` has a `build` script that regenerates its stubs with `buf`, so skip it when building the rest of the workspace:

```bash
pnpm --filter '!@meshtastic/protobufs' -r build
```

### Regenerate protobuf stubs

Only needed after bumping the `meshtastic/protobufs` submodule or editing the generator config. Requires the Buf CLI:

```bash
pnpm -r build
pnpm --filter @meshtastic/protobufs build
```

### Run tests
Expand Down
54 changes: 54 additions & 0 deletions packages/ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# @meshtastic/ui

Shared React component library used by [`@meshtastic/web`](../../apps/web). Radix Primitives + Tailwind CSS v4 with a shadcn-flavoured design system.

## What's inside

- **`AppSidebar`** — top-level layout sidebar used by the web client shell.
- **`ThemeProvider` + `useTheme` + `ThemeToggle`** — light/dark/system theme, persisted to `localStorage`.
- **`Badge`** — primitive re-exported at the package root.
- **`theme/default.css`** — Tailwind design tokens (colors, radii, typography) shipped as a standalone stylesheet.
- **shadcn primitives** under `src/components/ui/` (`Button`, `Input`, `Collapsible`, `DropdownMenu`, `Separator`, `Sheet`, `Skeleton`, `Tooltip`) — bundled but only re-exported through the sidebar surface today. Deep-imports work against the built `dist/`.

The package is framework-agnostic within React 19: no device, transport, or SDK dependencies. It only owns look-and-feel.

## Install

```sh
pnpm add @meshtastic/ui
```

Peer dependencies: `react` >=19, `react-dom` >=19, `tailwindcss` ^4.1, `@radix-ui/react-slot`, `class-variance-authority`, `tailwind-merge`.

## Usage

Import the theme stylesheet once at your app entry, then consume components:

```tsx
import "@meshtastic/ui/theme/default.css";
import { AppSidebar, Badge, ThemeProvider, ThemeToggle } from "@meshtastic/ui";

export function App() {
return (
<ThemeProvider defaultTheme="system">
<AppSidebar sections={[]} />
<Badge>online</Badge>
<ThemeToggle />
</ThemeProvider>
);
}
```

## Development

From the repo root:

```sh
pnpm --filter @meshtastic/ui dev # vite dev server
pnpm --filter @meshtastic/ui build # vite build + publint
pnpm --filter @meshtastic/ui test # vitest
```

## License

GPL-3.0-only.
1 change: 1 addition & 0 deletions packages/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default defineConfig({
{
src: "src/lib/theme/default.css",
dest: "theme",
rename: { stripBase: true },
},
],
}),
Expand Down
Loading