kira-kit 0.3.0 → 0.5.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 +273 -176
- package/dist/index.mjs +4755 -1204
- package/package.json +71 -64
- package/templates/monorepo/components.json +23 -23
- package/templates/monorepo/packages/ui/package.json +37 -32
- package/templates/monorepo/packages/ui/src/components/ui/welcome.tsx +52 -52
- package/templates/monorepo/packages/ui/src/index.css +738 -89
- package/templates/monorepo/packages/ui/src/styles/kira-utilities.css +649 -0
- package/templates/monorepo/packages/ui/tsconfig.json +8 -7
- package/templates/next/app/globals.css +731 -83
- package/templates/next/app/kira-utilities.css +649 -0
- package/templates/next/components/ui/welcome.tsx +62 -62
- package/templates/next/components.json +23 -23
- package/templates/next/package.json +31 -28
- package/templates/next/types/import-meta.d.ts +11 -0
- package/templates/tanstack-start/README.md +16 -16
- package/templates/tanstack-start/components.json +23 -23
- package/templates/tanstack-start/package.json +33 -30
- package/templates/tanstack-start/src/components/ui/route-transition.tsx +116 -0
- package/templates/tanstack-start/src/components/ui/welcome.tsx +52 -52
- package/templates/tanstack-start/src/index.css +738 -89
- package/templates/tanstack-start/src/lib/view-transition.ts +35 -0
- package/templates/tanstack-start/src/router.tsx +23 -15
- package/templates/tanstack-start/src/routes/__root.tsx +70 -41
- package/templates/tanstack-start/src/styles/kira-utilities.css +649 -0
- package/templates/tanstack-start/tsconfig.json +22 -21
- package/templates/vite/components.json +23 -23
- package/templates/vite/package.json +31 -28
- package/templates/vite/src/components/ui/welcome.tsx +60 -60
- package/templates/vite/src/index.css +731 -83
- package/templates/vite/src/styles/kira-utilities.css +649 -0
- package/templates/vite/tsconfig.node.json +25 -22
package/README.md
CHANGED
|
@@ -1,176 +1,273 @@
|
|
|
1
|
-
# kira-kit
|
|
2
|
-
|
|
3
|
-
The CLI for [Kira Kit](../../#readme) — a
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- **
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
kira-kit
|
|
32
|
-
|
|
33
|
-
kira-kit init
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
kira-kit
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
`
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
kira-kit
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
1
|
+
# kira-kit
|
|
2
|
+
|
|
3
|
+
The CLI for [Kira Kit](../../#readme) — a source registry of Base UI components.
|
|
4
|
+
`kira-kit` is a self-contained registry client: it resolves items and their
|
|
5
|
+
transitive dependencies, rewrites import aliases to your project layout,
|
|
6
|
+
installs missing npm packages with your detected package manager, and merges
|
|
7
|
+
theme tokens into your global CSS. No other CLI is involved.
|
|
8
|
+
|
|
9
|
+
- **Native install engine** — `init` and `add` work offline against the embedded
|
|
10
|
+
kit assets and any registry reachable by URL or local path
|
|
11
|
+
- **OKLCH theme generation** from any primary color, with WCAG 2.2 AA verified
|
|
12
|
+
contrast
|
|
13
|
+
- **Font & icon options** — six sans and three mono variable fonts, Tabler or
|
|
14
|
+
Lucide icons (install-time import rewrite)
|
|
15
|
+
- **Quality checks** over component sources (13 parser-based checks)
|
|
16
|
+
- **Project scaffolding** with four embedded templates
|
|
17
|
+
- **`migrate`** from legacy `registryUrl` / `clsx` / `tailwind-merge` setups
|
|
18
|
+
- **`build`** for maintainers: the full registry → validate → JSON → docs
|
|
19
|
+
pipeline
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
- Node.js 22.12.0 or later (or Bun 1.x)
|
|
24
|
+
- Consumer projects: React 19.2+ (components use `useEffectEvent`), Tailwind
|
|
25
|
+
CSS v4, TypeScript path aliases (`@/*`)
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
The notes below cover common commands. Run `kira-kit <command> --help` for
|
|
30
|
+
the flags supported by the installed CLI. See the
|
|
31
|
+
[CLI documentation](https://kira-kit.vercel.app/docs/cli) for more examples.
|
|
32
|
+
|
|
33
|
+
### `kira-kit init`
|
|
34
|
+
|
|
35
|
+
Set up a project for Kira Kit:
|
|
36
|
+
|
|
37
|
+
1. Writes or repairs `components.json` (`style: "kira"`, standard aliases, the
|
|
38
|
+
`@kira-kit` registry — existing entries are never overwritten)
|
|
39
|
+
2. Enforces the React 19.2+ floor
|
|
40
|
+
3. Installs the kit's base CSS (tokens, safelists, keyframes, `@theme inline`)
|
|
41
|
+
and the vendored `kira-utilities.css` — unless a theme already exists
|
|
42
|
+
4. Installs the base dependencies (`@base-ui/react`, `cn`,
|
|
43
|
+
`class-variance-authority`, the chosen icon library, `tailwindcss`,
|
|
44
|
+
`tw-animate-css`, and the chosen `@fontsource-variable` fonts)
|
|
45
|
+
5. Applies the kit's default theme — no prompt, no network. `--preset` and
|
|
46
|
+
`--primary` override it.
|
|
47
|
+
6. With `--icon lucide`, rewrites Tabler icon imports across project sources
|
|
48
|
+
to aliased `lucide-react` imports (local names never change).
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
kira-kit init
|
|
52
|
+
kira-kit init --preset ember-press # one of the 9 curated presets
|
|
53
|
+
kira-kit init --primary "#0B7F79" # generate a custom theme
|
|
54
|
+
kira-kit init --font inter --font-mono jetbrains-mono --icon lucide
|
|
55
|
+
kira-kit init --primary "#0B7F79" --base-color stone --yes
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
In an interactive terminal (no `--yes`), `init` also prompts for the sans
|
|
59
|
+
font, mono font, and icon library before the theme choice.
|
|
60
|
+
|
|
61
|
+
Options: `--preset`, `--primary`, `--base-color`, `--font` (geist, inter,
|
|
62
|
+
manrope, plus-jakarta-sans, space-grotesk, dm-sans), `--font-mono`
|
|
63
|
+
(geist-mono, jetbrains-mono, fira-code), `--icon` (tabler, lucide), `--force`,
|
|
64
|
+
`-y/--yes`, `-c/--cwd`.
|
|
65
|
+
|
|
66
|
+
### `kira-kit add [items...]`
|
|
67
|
+
|
|
68
|
+
Add components, hooks, and lib modules. Transitive `registryDependencies` are
|
|
69
|
+
resolved automatically (cycles included), imports are rewritten to your
|
|
70
|
+
aliases, and missing npm deps are installed with pinned ranges where majors
|
|
71
|
+
matter.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
kira-kit add button
|
|
75
|
+
kira-kit add button card dialog --overwrite
|
|
76
|
+
kira-kit add --all # every ui/hook/lib item
|
|
77
|
+
kira-kit add color-picker --dry-run --diff
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`--all` installs components, hooks, and lib modules only — themes and styles
|
|
81
|
+
are excluded (install those explicitly, e.g. `kira-kit add theme-ember-press`).
|
|
82
|
+
|
|
83
|
+
Options: `-o/--overwrite`, `-y/--yes`, `-a/--all`, `-p/--path`, `--dry-run`,
|
|
84
|
+
`--diff`, `--view`, `-c/--cwd`.
|
|
85
|
+
|
|
86
|
+
### `kira-kit list` / `view` / `search`
|
|
87
|
+
|
|
88
|
+
Registry inspection:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
kira-kit list # every available item
|
|
92
|
+
kira-kit list --json
|
|
93
|
+
kira-kit view button # show item contents
|
|
94
|
+
kira-kit search table --json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Options: `--json` (list/search), `-c/--cwd`.
|
|
98
|
+
|
|
99
|
+
### `kira-kit theme`
|
|
100
|
+
|
|
101
|
+
Generate an OKLCH theme palette from a primary color. Produces a
|
|
102
|
+
`registry:theme` item with light/dark schemes, chart hues, and APCA-verified
|
|
103
|
+
contrast; every token lands in the 4.5:1 (text) / 3:1 (UI) range. Font and
|
|
104
|
+
icon options apply on their own too — at least one of `--primary`, `--font`,
|
|
105
|
+
`--font-mono`, or `--icon` is required.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
kira-kit theme --primary "#0B7F79" # print the palette
|
|
109
|
+
kira-kit theme --primary "#0B7F79" --apply # install into the project
|
|
110
|
+
kira-kit theme --primary "#0B7F79" --out my-theme.json
|
|
111
|
+
kira-kit theme --font manrope --font-mono fira-code --apply
|
|
112
|
+
kira-kit theme --icon lucide --apply
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Font application rewrites the `@fontsource-variable` imports and the
|
|
116
|
+
`--font-sans` / `--font-mono` tokens in your global CSS — color tokens are
|
|
117
|
+
never touched and `--force` is not required. `--icon lucide` installs
|
|
118
|
+
`lucide-react` and rewrites every Tabler import in your project sources,
|
|
119
|
+
keeping local names aliased (`import { Check as IconCheck } from
|
|
120
|
+
"lucide-react"`). Filled Tabler icons get `fill="currentColor"` injected and
|
|
121
|
+
Tabler `stroke` width props become `strokeWidth`; a few names map to
|
|
122
|
+
approximate Lucide equivalents. The CLI never removes
|
|
123
|
+
`@tabler/icons-react` from package.json — it prints a hint instead. To
|
|
124
|
+
convert already-installed registry components after switching, run
|
|
125
|
+
`kira-kit add --all --overwrite`.
|
|
126
|
+
|
|
127
|
+
Options: `--primary`, `--base-color` (neutral, stone, zinc, slate, gray, plus
|
|
128
|
+
mauve, olive, mist, taupe), `--font`, `--font-mono`, `--icon`, `--out`,
|
|
129
|
+
`--apply`, `-c/--cwd`.
|
|
130
|
+
|
|
131
|
+
### `kira-kit check [paths...]`
|
|
132
|
+
|
|
133
|
+
Run the quality checks over component sources (defaults to
|
|
134
|
+
`src/components/ui` + `src/hooks` + `src/lib`). Errors fail the run; warnings
|
|
135
|
+
are advisory unless `--ci` is passed.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
kira-kit check
|
|
139
|
+
kira-kit check --format github # GitHub Actions annotations
|
|
140
|
+
kira-kit check --ci # strict: every finding fails
|
|
141
|
+
kira-kit check src/components/ui # directories only, not file paths
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Checks include: imports-vs-declared-deps, lib resolution, dead animation
|
|
145
|
+
utilities, `data-slot`/cva exports, reduced-motion gating, 24×24 target sizes,
|
|
146
|
+
raw colors, layout-property transitions, arbitrary Tailwind values, spacing
|
|
147
|
+
scale, registry metadata, Base-UI-only primitives, `cn` import source, and
|
|
148
|
+
suppression hygiene.
|
|
149
|
+
|
|
150
|
+
Suppress a false positive with a reason (unused suppressions are themselves
|
|
151
|
+
flagged):
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
// kira-kit-ignore target-size: decorative icon, no pointer target needed
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Or for a whole file — the reason is mandatory in both forms:
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
/* kira-kit-ignore-file raw-colors: this file defines the raw palette itself */
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### `kira-kit create [dir]`
|
|
164
|
+
|
|
165
|
+
Scaffold a new project pre-wired for Kira Kit — `components.json` with the
|
|
166
|
+
`@kira-kit` registry, the kit's base CSS and theme tokens, the `cn` package,
|
|
167
|
+
and a welcome component.
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
kira-kit create my-app
|
|
171
|
+
kira-kit create my-app --template next --install --git
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Templates: `vite`, `next`, `tanstack-start`, `monorepo` (app + ui packages).
|
|
175
|
+
|
|
176
|
+
Options: `-t/--template`, `--install` / `--no-install`, `--git` / `--no-git`,
|
|
177
|
+
`-y/--yes`.
|
|
178
|
+
|
|
179
|
+
### `kira-kit migrate`
|
|
180
|
+
|
|
181
|
+
Migrate a legacy project: converts the legacy `registryUrl` field to the
|
|
182
|
+
`registries` map, normalizes legacy `$schema`/`style` values, rewrites
|
|
183
|
+
`clsx`/`tailwind-merge`/`@/lib/cn` imports to the `cn` package (including
|
|
184
|
+
`twMerge(clsx(…))` → `cn(…)`), and reports components that have diverged from
|
|
185
|
+
the published registry. Your component files are never overwritten.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
kira-kit migrate
|
|
189
|
+
kira-kit migrate --dry-run
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Options: `--dry-run`, `-y/--yes`, `-c/--cwd`.
|
|
193
|
+
|
|
194
|
+
### `kira-kit build` (maintainers)
|
|
195
|
+
|
|
196
|
+
The full registry pipeline, run from the repository root:
|
|
197
|
+
|
|
198
|
+
1. Quality checks (errors block, warnings advise)
|
|
199
|
+
2. Regenerate the theme presets + `theme-default` into `src/themes/registry.json`
|
|
200
|
+
3. Validate every source registry, including full import-graph resolution
|
|
201
|
+
4. Build `public/r/*.json` (file contents inlined) + `public/schema/*.json`
|
|
202
|
+
5. Prune stale `public/r` outputs
|
|
203
|
+
6. Generate `public/llms.txt` + per-item markdown docs
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
kira-kit build
|
|
207
|
+
kira-kit build --skip-checks
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Registry configuration
|
|
211
|
+
|
|
212
|
+
Items resolve through the `registries` map in `components.json`. The `{name}`
|
|
213
|
+
placeholder is literal; URLs, `file://` paths, and local paths all work:
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"registries": {
|
|
218
|
+
"@kira-kit": "https://kira-kit.vercel.app/r/{name}.json"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
The index lives at `/r/registry.json`; JSON schemas are published at
|
|
224
|
+
`/schema/registry.json`, `/schema/registry-item.json`, and
|
|
225
|
+
`/schema/components.json`.
|
|
226
|
+
|
|
227
|
+
## Deliberately not supported
|
|
228
|
+
|
|
229
|
+
Features the old shadcn-delegating CLI exposed that the native engine does
|
|
230
|
+
not implement:
|
|
231
|
+
|
|
232
|
+
- Tailwind prefix support and Tailwind v3 / JavaScript output
|
|
233
|
+
- Base-library pickers (Radix / React Aria) and base-color theme pickers —
|
|
234
|
+
the kit is Base UI-only and ships one default theme plus curated presets
|
|
235
|
+
- Registry authentication and env-var interpolation beyond `{name}`
|
|
236
|
+
- Per-file AST `"use client"` detection (the `rsc` config flag drives it)
|
|
237
|
+
- Framework scaffolding inside `init` — use `kira-kit create`
|
|
238
|
+
|
|
239
|
+
## Exit codes
|
|
240
|
+
|
|
241
|
+
| Code | Meaning |
|
|
242
|
+
| ---- | -------------------------------------------------- |
|
|
243
|
+
| 0 | Success |
|
|
244
|
+
| 1 | User error (bad input, validation failure) |
|
|
245
|
+
| 2 | Registry problem (invalid/malformed registry data) |
|
|
246
|
+
| 3 | Quality checks failed |
|
|
247
|
+
|
|
248
|
+
## Development
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
bun install
|
|
252
|
+
bun run test # vitest
|
|
253
|
+
bun run typecheck
|
|
254
|
+
bun run build # embed-assets + tsdown → dist/index.mjs
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
`bun run build` first runs `scripts/embed-assets.ts`, which embeds the kit's
|
|
258
|
+
base CSS, vendored utilities, and default theme tokens into
|
|
259
|
+
`src/generated/assets.ts` and syncs the same CSS into the bundled templates.
|
|
260
|
+
A drift-guard test fails if the embedded assets fall out of sync with
|
|
261
|
+
`src/index.css`.
|
|
262
|
+
|
|
263
|
+
When source registries change, refresh dependency/file facts with
|
|
264
|
+
`bun run scripts/scaffold-sources.ts` (curated titles/descriptions/categories
|
|
265
|
+
in `scripts/registry-metadata.json` are preserved).
|
|
266
|
+
|
|
267
|
+
Releases use [Changesets](https://changesets.js.org) scoped to this package.
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
MIT. The vendored utilities CSS (`src/styles/kira-utilities.css` in the kit,
|
|
272
|
+
embedded as `UTILITIES_CSS`) is derived from shadcn's MIT-licensed Tailwind
|
|
273
|
+
CSS — Copyright (c) 2023 shadcn.
|