# @kana-consultant/ui-kit — Full Reference A modern React UI kit for back-office apps and admin dashboards. - **npm**: `@kana-consultant/ui-kit` - **Version**: 0.1.0 - **License**: MIT - **Repo**: https://github.com/kana-consultant/kana-ui-kit - **Docs**: https://kana-ui-kit-docs.pages.dev - **Storybook**: https://kana-ui-kit-storybook.pages.dev --- ## Installation ```bash pnpm add @kana-consultant/ui-kit # or: npm install @kana-consultant/ui-kit # or: yarn add @kana-consultant/ui-kit ``` ### Peer dependencies ```bash pnpm add react react-dom ``` The kit expects React 18+ or 19+. Radix UI, TanStack Form / Store, `clsx`, `class-variance-authority`, `lucide-react`, `tailwind-merge`, and `zod` install automatically as transitive runtime dependencies. ### Tailwind CSS v4 setup The kit requires Tailwind v4. ```bash pnpm add -D tailwindcss @tailwindcss/vite ``` In `vite.config.ts`: ```ts import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import tailwindcss from '@tailwindcss/vite' export default defineConfig({ plugins: [react(), tailwindcss()], }) ``` In your app's entry CSS (e.g. `src/styles/app.css`): ```css @import 'tailwindcss'; @import '@kana-consultant/ui-kit/styles'; ``` **Critical for AI assistants generating projects**: Tailwind v4 scans the project source by default but NOT node_modules. If you use Dialog, DropdownMenu, Tooltip, or Select, add: ```css @source '../node_modules/@kana-consultant/ui-kit/dist/*.js'; ``` Without this, portal-based components (Dialog overlay, etc.) render with missing styles. --- ## Theming Dark mode is applied via a `.dark` class on ``. The kit ships a persistent theme store. ```tsx import { ThemeToggle, setThemeMode, toggleTheme, useTheme, useThemeMode, useResolvedTheme, } from '@kana-consultant/ui-kit' function Header() { const resolved = useResolvedTheme() return ( <> Current: {resolved} ) } setThemeMode('system') toggleTheme() ``` State is persisted in `localStorage` under key `kana-ui-theme` and reacts to `prefers-color-scheme` automatically. ### Color tokens All colors are OKLCH CSS variables. Override any in your own stylesheet to rebrand: ```css :root { --primary: oklch(62% 0.22 25); --primary-foreground: oklch(99% 0.005 25); --primary-soft: oklch(95% 0.06 25); } .dark { --primary: oklch(72% 0.2 25); } ``` Available tokens: `--background`, `--foreground`, `--surface`, `--surface-muted`, `--border`, `--border-strong`, `--input`, `--ring`, `--muted`, `--muted-foreground`, `--primary`, `--primary-foreground`, `--primary-soft`, `--accent`, `--accent-foreground`, `--success`, `--warning`, `--danger`, `--info` (each with a `-foreground` pair where applicable). --- ## Naming conventions - **Components**: PascalCase (`Button`, `DashboardShell`) - **Types**: `T` prefix (`TButtonProps`, `TTask`, `TProject`) - **Enum-like const objects**: `E` prefix (`EStatus`, `EPriority`) - **Filenames in the source**: kebab-case (`task-card.tsx`) --- ## Primitives ### Button ```tsx import { Button } from '@kana-consultant/ui-kit' import { Plus } from 'lucide-react' ``` Props: `variant`, `size`, `loading`, `leadingIcon`, `trailingIcon`, `asChild`, plus all native `