@aircall/blocks
Version:
Aircall Blocks — higher-level UI compositions built on @aircall/ds
64 lines (48 loc) • 2.59 kB
Markdown
# /blocks
Higher-level UI compositions built on **`/ds`** — page shells (`DashboardPage` /
`DashboardStandalonePage`), the form layer (`useForm` + the `Form*Field` TanStack Form
wrappers), empty states, and more.
```bash
pnpm add /blocks @aircall/ds
```
Import the precompiled CSS once from your entry. `/blocks/globals.css` already
bundles the entire `/ds/globals.css` — do **not** import both or you duplicate all
of DS's compiled output (Preflight, theme tokens, all DS utilities):
```tsx
// ✅ Correct — blocks already includes DS
import '@aircall/blocks/globals.css';
// ❌ Wrong — duplicates all of DS's compiled output
// import '@aircall/ds/globals.css';
// import '@aircall/blocks/globals.css';
```
If you author your own Tailwind utility classes, use a CSS entry instead of a JS import:
```css
/* style.css */
theme, base, components, utilities;
'tailwindcss/theme.css' layer(theme);
'tailwindcss/utilities.css' layer(utilities);
'/blocks/globals.css';
"./src/**/*.{ts,tsx}";
```
For module-federation consumers (your app runs as a remote inside a host that already loads
DS/blocks globals), omit both globals imports entirely.
> Importing `/blocks` registers a `blocks` i18n namespace on `@aircall/ds`'s shared
> i18next instance. To make block strings follow the user's language, mount `DsI18nProvider`
> (from `/ds`) **under** your react-i18next provider, fed the active language. See
> the `/ds` README and the `aircall-ds/setup` skill for the full provider tree.
## For AI agents — migrating off `/library`?
This package ships **[TanStack Intent](https://tanstack.com/intent) migration skills** in
its `skills/` directory (published in the npm tarball): `aircall-blocks/migrate-dashboard`
(+ per-area recipes) for moving `/library` screens to `@aircall/blocks` /
`/ds`, plus `aircall-blocks/setup`. Enable them (one-time, same as `/ds`):
```bash
pnpm add /blocks@latest @aircall/ds /react-icons # react-icons >= 0.4.0
npx /intent install # writes the discovery block into CLAUDE.md / AGENTS.md
# allowlist in package.json: { "intent": { "skills": ["@aircall/ds", "@aircall/blocks"] } }
```
Then the agent loads guidance on demand:
```bash
npx /intent load "@aircall/blocks#aircall-blocks/migrate-dashboard"
```
`aircall-blocks/setup` builds on `aircall-ds/setup`, so the DS providers, `globals.css`, and
jsdom test shims documented there apply here too.