@devalok/shilp-sutra 0.46.0 → 0.48.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.
Files changed (55) hide show
  1. package/AGENTS.md +37 -1
  2. package/BREAKING.json +46 -0
  3. package/MIGRATION.md +45 -0
  4. package/dist/_chunks/emoji-suggestion.js +124 -0
  5. package/dist/_chunks/emoji-suggestion.js.map +1 -0
  6. package/dist/_chunks/emoji.js +1115 -0
  7. package/dist/_chunks/emoji.js.map +1 -0
  8. package/dist/_chunks/tiptap.js.map +1 -1
  9. package/dist/composed/emoji-picker.d.ts +19 -9
  10. package/dist/composed/emoji-picker.d.ts.map +1 -1
  11. package/dist/composed/emoji-picker.js +87 -68
  12. package/dist/composed/emoji-picker.js.map +1 -1
  13. package/dist/composed/extensions/emoji-data.d.ts +1 -14
  14. package/dist/composed/extensions/emoji-data.d.ts.map +1 -1
  15. package/dist/composed/extensions/emoji-node.d.ts +0 -3
  16. package/dist/composed/extensions/emoji-node.d.ts.map +1 -1
  17. package/dist/composed/extensions/emoji-node.js +9 -34
  18. package/dist/composed/extensions/emoji-node.js.map +1 -1
  19. package/dist/composed/extensions/emoji-suggestion.d.ts +2 -2
  20. package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
  21. package/dist/composed/extensions/emoji-suggestion.js +2 -116
  22. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  23. package/dist/composed/rich-chat-input.js +554 -575
  24. package/dist/composed/rich-chat-input.js.map +1 -1
  25. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  26. package/dist/composed/rich-text-editor.js +167 -190
  27. package/dist/composed/rich-text-editor.js.map +1 -1
  28. package/docs/components/composed/emoji-picker.md +19 -17
  29. package/docs/components/composed/rich-text-editor.md +1 -1
  30. package/docs/components/ui/table-row-link.md +1 -1
  31. package/docs/recipes/index.md +1 -1
  32. package/docs/recipes/install-astro.md +15 -12
  33. package/docs/recipes/install-next-app-router.md +20 -12
  34. package/docs/recipes/install-next-pages.md +3 -1
  35. package/docs/recipes/install-remix.md +16 -13
  36. package/docs/recipes/install-tanstack-start.md +108 -54
  37. package/docs/recipes/install-vite.md +18 -15
  38. package/docs/recipes/troubleshoot.md +7 -8
  39. package/llms.txt +2 -2
  40. package/mcp-manifest.json +54 -48
  41. package/mcp-manifest.schema.json +6 -0
  42. package/package.json +7 -10
  43. package/scripts/welcome.mjs +4 -2
  44. package/skill/SKILL.md +1 -1
  45. package/skill/references/components.md +2 -2
  46. package/skill/references/setup-astro.md +15 -12
  47. package/skill/references/setup-next-app-router.md +20 -12
  48. package/skill/references/setup-next-pages.md +3 -1
  49. package/skill/references/setup-remix.md +16 -13
  50. package/skill/references/setup-tanstack-start.md +108 -54
  51. package/skill/references/setup-vite.md +18 -15
  52. package/skill/references/troubleshoot.md +7 -8
  53. package/dist/_chunks/emoji-data.js +0 -45
  54. package/dist/_chunks/emoji-data.js.map +0 -1
  55. package/dist/composed/extensions/emoji-suggestion.js.map +0 -1
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra",
3
- "version": "0.46.0",
3
+ "version": "0.48.0",
4
4
  "description": "Devalok Design System — accessible React components, OKLCH design tokens, and Tailwind 4 CSS-first setup. Ships with AI-agent setup recipes.",
5
5
  "license": "MIT",
6
6
  "author": "Devalok Design & Strategy Studios <shilp-sutra@devalok.in>",
7
- "homepage": "https://devalok-design.github.io/shilp-sutra/",
7
+ "homepage": "https://shilp-sutra.devalok.in",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/devalok-design/shilp-sutra",
@@ -52,8 +52,10 @@
52
52
  "provenance": true
53
53
  },
54
54
  "dependencies": {
55
+ "@emoji-mart/data": "^1.2.1",
55
56
  "class-variance-authority": "^0.7.1",
56
57
  "clsx": "^2.1.1",
58
+ "frimousse": "^0.3.0",
57
59
  "tw-animate-css": "^1.4.0",
58
60
  "use-sync-external-store": "^1.5.0"
59
61
  },
@@ -839,8 +841,6 @@
839
841
  ]
840
842
  },
841
843
  "peerDependencies": {
842
- "@emoji-mart/data": "^1.0.0",
843
- "@emoji-mart/react": "^1.0.0",
844
844
  "@tabler/icons-react": "^3.0.0",
845
845
  "@tanstack/react-table": "^8.0.0",
846
846
  "@tanstack/react-virtual": "^3.0.0",
@@ -873,12 +873,6 @@
873
873
  "@tanstack/react-virtual": {
874
874
  "optional": true
875
875
  },
876
- "@emoji-mart/data": {
877
- "optional": true
878
- },
879
- "@emoji-mart/react": {
880
- "optional": true
881
- },
882
876
  "d3-array": {
883
877
  "optional": true
884
878
  },
@@ -985,6 +979,9 @@
985
979
  "build:tokens": "node scripts/copy-tokens.mjs",
986
980
  "build:docs": "node scripts/build-component-docs.mjs",
987
981
  "build:docs:check": "node scripts/build-component-docs.mjs --check",
982
+ "peers:check": "node scripts/derive-peer-map.mjs --check",
983
+ "smoke:cold": "node scripts/cold-install-smoke.mjs",
984
+ "smoke:cold:next": "node scripts/cold-install-smoke.mjs --framework next-app-router",
988
985
  "typecheck": "tsc --noEmit",
989
986
  "lint": "eslint src/",
990
987
  "test": "vitest run",
@@ -173,7 +173,7 @@ function buildFullBanner(version, prevVersion) {
173
173
  lines.push(row(` ${colour('+ docs/recipes/upgrading.md (safe-upgrade procedure)', DIM)}`))
174
174
  } else {
175
175
  lines.push(row(` ${colour('✦', PINK)} ${colour('@devalok/shilp-sutra', BOLD)} ${version}`))
176
- lines.push(row(` ${colour('Tailwind 4 design system · 110+ components · RSC-safe', DIM)}`))
176
+ lines.push(row(` ${colour('Tailwind 4 design system · 120+ components · RSC-safe', DIM)}`))
177
177
  }
178
178
  lines.push(colour(EMPTY, PINK_DIM))
179
179
  lines.push(row(` ${colour('▸', PINK)} Setup recipe (pick your framework):`))
@@ -183,7 +183,9 @@ function buildFullBanner(version, prevVersion) {
183
183
  lines.push(row(` ${colour('https://shilp-sutra.devalok.in/themer', DIM)}`))
184
184
  lines.push(colour(EMPTY, PINK_DIM))
185
185
  lines.push(row(` ${colour('▸', PINK)} Wire your AI agent (Claude Code / Cursor / Codex):`))
186
- lines.push(row(` ${colour('cp -r node_modules/@devalok/shilp-sutra/skill \\', DIM)}`))
186
+ lines.push(row(` ${colour('connect the live docs MCP → https://shilp-sutra.devalok.in/mcp', DIM)}`))
187
+ lines.push(row(` ${colour('(version-exact setup + peer preflight; beats guessing)', DIM)}`))
188
+ lines.push(row(` ${colour('or copy the skill: cp -r node_modules/@devalok/shilp-sutra/skill \\', DIM)}`))
187
189
  lines.push(row(` ${colour('~/.claude/skills/shilp-sutra', DIM)}`))
188
190
  lines.push(colour(EMPTY, PINK_DIM))
189
191
  lines.push(row(` ${colour('Disable this banner: SHILP_SUTRA_NO_WELCOME=1', DIM)}`))
package/skill/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: shilp-sutra
3
3
  description: Add, configure, and use components from Devalok's shilp-sutra design system (@devalok/shilp-sutra) — a Tailwind 4 + React 19 + CVA library with 110+ accessible components, OKLCH design tokens, framer-motion animations, and per-component RSC-safe entry points. Use this skill whenever the user mentions shilp-sutra, Devalok, the @devalok npm scope, or asks to install/add/style/theme UI in any React project that already depends on the package — even if they don't name it explicitly. Use it instead of generic shadcn/ui, MUI, or Chakra knowledge when shilp-sutra is in the project. Covers Next.js (App + Pages), Vite, Astro, Remix, TanStack Start setup playbooks; component API and variant reference; brand token customization; Server Component import patterns; and a troubleshoot tree for the thirteen most common breakages.
4
4
  license: MIT
5
5
  metadata:
6
- version: "0.46.0"
6
+ version: "0.48.0"
7
7
  author: Devalok Design & Strategy Studios
8
8
  homepage: https://github.com/devalok-design/shilp-sutra
9
9
  npm: https://www.npmjs.com/package/@devalok/shilp-sutra
@@ -2,13 +2,13 @@
2
2
 
3
3
  # @devalok/shilp-sutra
4
4
 
5
- > Radix UI + Tailwind 4 (CSS-first) + CVA design system for Devalok apps, v0.46.0.
5
+ > Radix UI + Tailwind 4 (CSS-first) + CVA design system for Devalok apps, v0.48.0.
6
6
  > Built on the same primitives as shadcn/ui but with DIFFERENT prop APIs — never guess from shadcn knowledge; verify every prop.
7
7
  > This file is a ROUTER: it tells you what exists and where to get details. Do not look for prop tables here — fetch them per component (MCP tool or per-component doc file below).
8
8
 
9
9
  ## How to get component details (in priority order)
10
10
 
11
- 1. **shilp-sutra MCP** (if connected): `get_component(name)` — version-exact props/variants/examples/composition as JSON. Also: `find_component(query)`, `get_tokens(category)`, `get_setup(framework)`, `upgrade(from, to)`, `search_docs(query)`. Pass your installed version (`node_modules/@devalok/shilp-sutra/package.json`) as `version` on every call.
11
+ 1. **shilp-sutra MCP** (if connected): `get_component(name)` — version-exact props/variants/examples/composition as JSON. Also: `find_component(query)`, `get_tokens(category)`, `get_setup(framework)`, `upgrade(from, to)`, `search_docs(query)`. **Setting up in a project?** `detect_framework(packageJson)` → `get_setup(framework)` → `preflight(framework, imports)` (peer installs) → `validate_snippet(code)` before writing → `verify_setup(...)`. Pass your installed version (`node_modules/@devalok/shilp-sutra/package.json`) as `version` on every call.
12
12
  Connect: `claude mcp add --transport http shilp-sutra https://shilp-sutra.devalok.in/mcp`
13
13
  2. **No MCP?** Read the single per-component file linked in the index below (`node_modules/@devalok/shilp-sutra/docs/components/...`, ~3K tokens each). Read only the components you need — never bulk-read the directory.
14
14
  3. **Machine-readable everything**: `mcp-manifest.json` at the package root (all props/tokens/composition as JSON, react-docgen shape). Prefer targeted reads of it over any prose.
@@ -33,18 +33,21 @@ pnpm add sonner
33
33
 
34
34
  ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
35
35
 
36
- Some components ship hard peers as optional. **Install BEFORE first import** or Astro's Vite build will fail with `Failed to resolve import`. Skip if you only use core components.
37
-
38
- | When you import… | Install |
39
- |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
40
- | `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
41
- | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
42
- | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
43
- | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
44
- | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
45
- | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
46
- | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
47
- | Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
36
+ Some components ship hard peers as optional. **Install BEFORE first import.** On Vite / Rolldown a missing peer may **not** fail the build — the bundler can silently replace the import with a stub that throws `Could not resolve "…"` in the browser at runtime, while the build still exits 0. A green build is therefore **not** proof the app works. Confirm coverage with the MCP `verify_setup` / `preflight` tools or the table below. Skip only if you use core components.
37
+
38
+ | When you import… | Install |
39
+ |---|---|
40
+ | `@devalok/shilp-sutra/composed/date-picker` | `pnpm add date-fns` |
41
+ | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
42
+ | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter remark-gfm` |
43
+ | `@devalok/shilp-sutra/composed/schedule-view` | `pnpm add date-fns` |
44
+ | `@devalok/shilp-sutra/ui/charts` | `pnpm add d3-axis d3-scale d3-selection d3-shape` |
45
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
46
+ | `@devalok/shilp-sutra/ui/data-table-toolbar` | `pnpm add @tanstack/react-table` |
47
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
48
+ | `@devalok/shilp-sutra/ui/toast` | `pnpm add sonner` |
49
+ | `@devalok/shilp-sutra/ui/toaster` | `pnpm add sonner` |
50
+ | Any `Icon` / `IconButton` with Tabler icons (near-universal — most components use icons internally, so it is a base-install peer) | `pnpm add @tabler/icons-react` |
48
51
 
49
52
  ## 3. Wire Tailwind 4 in `astro.config`
50
53
 
@@ -48,16 +48,19 @@ pnpm add sonner
48
48
 
49
49
  Some components depend on third-party libraries that ship as optional peers. **Install BEFORE first import** of the matching component, or `next build` will exit with `Module not found`. Skip entirely if you only use core components (`Button`, `Text`, `Stack`, `Dialog`, `Toast`, `Form*`, `Input`, `Card`, etc.).
50
50
 
51
- | When you import… | Install |
52
- |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
53
- | `@devalok/shilp-sutra/ui/charts/*` (BarChart, LineChart, …)| `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
54
- | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
55
- | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
56
- | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
57
- | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
58
- | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
59
- | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
60
- | Any `Icon` / `IconButton` use with Tabler icons | `pnpm add @tabler/icons-react` |
51
+ | When you import… | Install |
52
+ |---|---|
53
+ | `@devalok/shilp-sutra/composed/date-picker` | `pnpm add date-fns` |
54
+ | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
55
+ | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter remark-gfm` |
56
+ | `@devalok/shilp-sutra/composed/schedule-view` | `pnpm add date-fns` |
57
+ | `@devalok/shilp-sutra/ui/charts` | `pnpm add d3-axis d3-scale d3-selection d3-shape` |
58
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
59
+ | `@devalok/shilp-sutra/ui/data-table-toolbar` | `pnpm add @tanstack/react-table` |
60
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
61
+ | `@devalok/shilp-sutra/ui/toast` | `pnpm add sonner` |
62
+ | `@devalok/shilp-sutra/ui/toaster` | `pnpm add sonner` |
63
+ | Any `Icon` / `IconButton` with Tabler icons (near-universal — most components use icons internally, so it is a base-install peer) | `pnpm add @tabler/icons-react` |
61
64
 
62
65
  > These aren't in core deps so consumers who never render a chart, OTP input, or rich-text editor don't pay the install / bundle cost. One-time decision at install.
63
66
 
@@ -166,9 +169,14 @@ export function Providers({ children }: { children: ReactNode }) {
166
169
  }
167
170
  ```
168
171
 
169
- `next-themes` is already in the install list from § 2 no extra install step needed here. If `<Toaster />` is not used:
172
+ > **This default `Providers` renders `<Toaster />`, which imports `sonner`.** Install it now or `next build` fails with `Module not found: Can't resolve 'sonner'`:
173
+ > ```bash
174
+ > pnpm add sonner
175
+ > ```
170
176
 
171
- - Drop the `Toaster` import and its JSX usage
177
+ `next-themes` is already in the install list from § 2 — no extra install step needed here. If you do **not** want toasts:
178
+
179
+ - Drop the `Toaster` import and its JSX usage from `Providers`
172
180
  - Skip installing `sonner`
173
181
 
174
182
  Mount `<Providers>` from `app/layout.tsx` (or `src/app/layout.tsx`). **Replace the scaffold's layout** with the version below — the scaffold imports `next/font/google` (Geist) and applies font-variable classes to `<html>`, which you don't need when shilp-sutra ships its own fonts:
@@ -18,7 +18,7 @@ If both `app/` and `pages/` exist, prefer [install-next-app-router.md](./install
18
18
 
19
19
  Same dependencies as the App Router recipe — see [install-next-app-router.md § 2](./install-next-app-router.md#2-install-dependencies). Replace `next-themes`'s `attribute="class"` setup with the same on Pages Router (it works identically).
20
20
 
21
- **Optional peer dependencies** — if you'll render `<DataTable>`, any chart, `<DatePicker>`, `<RichTextEditor>`, `<InputOTP>`, `<FilePreview>`, `<MarkdownViewer>`, or use Tabler icons, install the matching peers BEFORE first import. Full table at [install-next-app-router.md § 2a](./install-next-app-router.md#2a-optional-peer-dependencies-install-only-when-importing-the-matching-subpath) — identical for Pages Router.
21
+ **Optional peer dependencies** — if you'll render `<DataTable>`, any chart, `<DatePicker>`, `<ScheduleView>`, `<InputOTP>`, `<FilePreview>`, `<MarkdownViewer>`, or `<Toaster>`, install the matching peers BEFORE first import. (The emoji picker and rich-text editors bundle their deps — no install needed; `@tabler/icons-react` auto-installs as a required peer.) Full table at [install-next-app-router.md § 2a](./install-next-app-router.md#2a-optional-peer-dependencies-install-only-when-importing-the-matching-subpath) — identical for Pages Router.
22
22
 
23
23
  ## 3. PostCSS
24
24
 
@@ -69,6 +69,8 @@ export default function App({ Component, pageProps }: AppProps) {
69
69
  }
70
70
  ```
71
71
 
72
+ > ⚠ **This renders `<Toaster />`, which imports `sonner`.** Install it or `next build` fails with `Module not found: Can't resolve 'sonner'`: `pnpm add sonner`. If you don't want toasts, drop the `Toaster` import + usage and skip `sonner`.
73
+
72
74
  For `next-themes` to avoid hydration warnings, add a `_document.tsx` with `suppressHydrationWarning` on the `<html>`:
73
75
 
74
76
  ```tsx
@@ -12,7 +12,7 @@ You are in this recipe if:
12
12
  - `vite.config.{ts,js}` exists with the `vitePlugin` from `@remix-run/dev`
13
13
  - `app/root.tsx` exists with `<Outlet />` inside `<Document>` shell
14
14
 
15
- For React Router v7 (the spiritual successor to Remix), use the [install-vite.md](./install-vite.md) recipeit works the same way.
15
+ > **New projects scaffold as React Router v7, not Remix.** `create-remix` is deprecated and redirects to `create-react-router`; Remix v2 was upstreamed into React Router (maintenance mode). If you ran `create-react-router`, you have an RR7 **framework-mode** app (`@react-router/dev` + `react-router build` + `app/root.tsx` + `ssr: true`) — verified cold with shilp-sutra (SSR render, HTTP 200). Its wiring is the same shape as this recipe: `@tailwindcss/vite` plugin, `@import "@devalok/shilp-sutra/css"` in `app/app.css`, and **no `transpilePackages`** (Vite resolves our ESM). Ignore the SPA-only steps in [install-vite.md](./install-vite.md) (`index.html` bootstrap, `main.tsx` `createRoot`) RR7 framework mode has its own `root.tsx` shell, like this recipe.
16
16
 
17
17
  ## 2. Install
18
18
 
@@ -29,18 +29,21 @@ pnpm add sonner # only if rendering <Toaster />
29
29
 
30
30
  ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
31
31
 
32
- Some components ship hard peers as optional. **Install BEFORE first import** or Remix's Vite build will fail with `Failed to resolve import`. Skip if you only use core components.
33
-
34
- | When you import… | Install |
35
- |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
36
- | `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
37
- | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
38
- | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
39
- | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
40
- | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
41
- | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
42
- | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
43
- | Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
32
+ Some components ship hard peers as optional. **Install BEFORE first import.** On Vite 8 / Rolldown a missing peer does **not** fail the build — Rolldown silently replaces the import with a stub that throws `Could not resolve "…"` in the browser at runtime, while the build still exits 0. A green build is therefore **not** proof the app works. Confirm coverage with the MCP `verify_setup` / `preflight` tools or the table below. Skip only if you use core components.
33
+
34
+ | When you import… | Install |
35
+ |---|---|
36
+ | `@devalok/shilp-sutra/composed/date-picker` | `pnpm add date-fns` |
37
+ | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
38
+ | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter remark-gfm` |
39
+ | `@devalok/shilp-sutra/composed/schedule-view` | `pnpm add date-fns` |
40
+ | `@devalok/shilp-sutra/ui/charts` | `pnpm add d3-axis d3-scale d3-selection d3-shape` |
41
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
42
+ | `@devalok/shilp-sutra/ui/data-table-toolbar` | `pnpm add @tanstack/react-table` |
43
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
44
+ | `@devalok/shilp-sutra/ui/toast` | `pnpm add sonner` |
45
+ | `@devalok/shilp-sutra/ui/toaster` | `pnpm add sonner` |
46
+ | Any `Icon` / `IconButton` with Tabler icons (near-universal — most components use icons internally, so it is a base-install peer) | `pnpm add @tabler/icons-react` |
44
47
 
45
48
  ## 3. Wire Tailwind 4 in `vite.config.ts`
46
49
 
@@ -2,21 +2,32 @@
2
2
 
3
3
  # Install: TanStack Start
4
4
 
5
- > Setup recipe for adding `@devalok/shilp-sutra` to a TanStack Start project (the React full-stack framework built on Vinxi/Vite).
5
+ > Setup recipe for adding `@devalok/shilp-sutra` to a TanStack Start project (the React full-stack framework built on Vite).
6
+
7
+ > **Updated 2026-07-10 for the Vite-plugin era.** TanStack Start moved off Vinxi: the package is now `@tanstack/react-start` (not `@tanstack/start`), config lives in `vite.config.ts` (not `app.config.ts`), and the app root is `src/` (not `app/`). If you are on an old Vinxi-based project (`app.config.ts`, `@tanstack/start`), migrate to the Vite plugin first — see the TanStack Start docs.
6
8
 
7
9
  ## 1. Detect
8
10
 
9
11
  You are in this recipe if:
10
12
 
11
- - `package.json` lists `"@tanstack/start"` and `"@tanstack/react-router"`
12
- - `app.config.{ts,js}` (Vinxi) exists at the project root
13
- - `app/router.tsx` and `app/routes/__root.tsx` exist
13
+ - `package.json` lists `"@tanstack/react-start"` and `"@tanstack/react-router"`
14
+ - `vite.config.{ts,js}` exists and uses the `tanstackStart` plugin from `@tanstack/react-start/plugin/vite`
15
+ - `src/router.tsx` and `src/routes/__root.tsx` exist (a `src/routeTree.gen.ts` is generated on first run)
16
+
17
+ If instead you see `app.config.ts` + `@tanstack/start`, that is the legacy Vinxi setup — this recipe does not apply until you migrate.
18
+
19
+ > **Scaffolded with `create-start` and got a Router SPA?** As of `@tanstack/create-start` 0.59, the default template is a TanStack **Router** SPA — Vite + `@tanstack/react-router` + an `index.html` + `src/main.tsx` (client `createRoot`), with **no** `@tanstack/react-start` and no SSR server entry. That is NOT the Start SSR setup this recipe covers — use [install-vite.md](./install-vite.md) instead (it is router-agnostic and covers TanStack Router SPAs cleanly). This recipe applies only when `@tanstack/react-start` is a dependency.
14
20
 
15
21
  ## 2. Install
16
22
 
17
23
  ```bash
24
+ # pnpm
18
25
  pnpm add @devalok/shilp-sutra framer-motion
19
26
  pnpm add -D tailwindcss@^4 @tailwindcss/vite
27
+
28
+ # npm
29
+ npm install @devalok/shilp-sutra framer-motion
30
+ npm install -D tailwindcss@^4 @tailwindcss/vite
20
31
  ```
21
32
 
22
33
  Optional:
@@ -27,52 +38,97 @@ pnpm add sonner # only if rendering <Toaster />
27
38
 
28
39
  ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
29
40
 
30
- Some components ship hard peers as optional. **Install BEFORE first import** or the TanStack Start dev/build will fail with `Failed to resolve import`. Skip if you only use core components.
41
+ Some components ship hard peers as optional. **Install BEFORE first import.** On Vite 8 / Rolldown a missing peer does **not** fail the build — Rolldown silently replaces the import with a stub that throws `Could not resolve "…"` in the browser at runtime, while the build still exits 0. A green build is therefore **not** proof the app works. Confirm coverage with the MCP `verify_setup` / `preflight` tools or the table below. Skip only if you use core components.
31
42
 
32
- | When you import… | Install |
33
- |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
34
- | `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
35
- | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
36
- | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
37
- | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
38
- | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
39
- | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
40
- | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
41
- | Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
43
+ | When you import… | Install |
44
+ |---|---|
45
+ | `@devalok/shilp-sutra/composed/date-picker` | `pnpm add date-fns` |
46
+ | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
47
+ | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter remark-gfm` |
48
+ | `@devalok/shilp-sutra/composed/schedule-view` | `pnpm add date-fns` |
49
+ | `@devalok/shilp-sutra/ui/charts` | `pnpm add d3-axis d3-scale d3-selection d3-shape` |
50
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
51
+ | `@devalok/shilp-sutra/ui/data-table-toolbar` | `pnpm add @tanstack/react-table` |
52
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
53
+ | `@devalok/shilp-sutra/ui/toast` | `pnpm add sonner` |
54
+ | `@devalok/shilp-sutra/ui/toaster` | `pnpm add sonner` |
55
+ | Any `Icon` / `IconButton` with Tabler icons (near-universal — most components use icons internally, so it is a base-install peer) | `pnpm add @tabler/icons-react` |
42
56
 
43
- ## 3. Wire Tailwind 4 in `app.config.ts`
57
+ ## 3. Wire Tailwind 4 in `vite.config.ts`
58
+
59
+ Add `@tailwindcss/vite` to the existing plugins array. `tanstackStart()` must come before `viteReact()`; `tailwindcss()` can go first so tokens are processed early.
44
60
 
45
61
  ```ts
46
- import { defineConfig } from "@tanstack/start/config";
62
+ import { defineConfig } from "vite";
63
+ import { tanstackStart } from "@tanstack/react-start/plugin/vite";
64
+ import viteReact from "@vitejs/plugin-react";
47
65
  import tailwindcss from "@tailwindcss/vite";
48
66
 
49
67
  export default defineConfig({
50
- vite: {
51
- plugins: [tailwindcss()],
52
- },
68
+ plugins: [
69
+ tailwindcss(),
70
+ tanstackStart(),
71
+ viteReact(),
72
+ ],
53
73
  });
54
74
  ```
55
75
 
76
+ Do **not** add a `tailwind.config.{ts,js}` — Tailwind 4 is CSS-first.
77
+
56
78
  ## 4. Wire tokens
57
79
 
58
- Create `app/styles/globals.css`:
80
+ Create `src/styles/globals.css`:
59
81
 
60
82
  ```css
61
83
  @import "tailwindcss";
62
84
  @import "@devalok/shilp-sutra/css";
63
85
  ```
64
86
 
65
- Import it from `app/routes/__root.tsx`:
87
+ Wire it as an asset-URL stylesheet from the root route's `head` (the TanStack Start idiom — the `?url` suffix emits the file as an asset instead of inlining it):
66
88
 
67
89
  ```tsx
68
- import "../styles/globals.css";
90
+ // src/routes/__root.tsx
91
+ import {
92
+ createRootRoute,
93
+ HeadContent,
94
+ Outlet,
95
+ Scripts,
96
+ } from "@tanstack/react-router";
97
+ import globalsCss from "../styles/globals.css?url";
98
+
99
+ export const Route = createRootRoute({
100
+ head: () => ({
101
+ meta: [
102
+ { charSet: "utf-8" },
103
+ { name: "viewport", content: "width=device-width, initial-scale=1" },
104
+ ],
105
+ links: [{ rel: "stylesheet", href: globalsCss }],
106
+ }),
107
+ component: RootComponent,
108
+ });
109
+
110
+ function RootComponent() {
111
+ return (
112
+ <html lang="en" suppressHydrationWarning>
113
+ <head>
114
+ <HeadContent />
115
+ </head>
116
+ <body>
117
+ <Outlet />
118
+ <Scripts />
119
+ </body>
120
+ </html>
121
+ );
122
+ }
69
123
  ```
70
124
 
71
- If you prefer asset-URL imports the way Remix does it, use `import css from "../styles/globals.css?url"` and add `<link rel="stylesheet" href={css} />` to the `<head>` returned by `__root.tsx`.
125
+ > **Newer scaffolds use `shellComponent`.** As of `@tanstack/create-start` 0.59 the generated `__root.tsx` uses `shellComponent: RootDocument` (which receives `{ children }`) instead of `component: RootComponent` with `<Outlet />`. Both wire up the same way for shilp-sutra — put the `{ rel: "stylesheet", href: appCss }` link in `head()` and keep `<HeadContent />` + `<Scripts />`. If your `__root.tsx` already has a `shellComponent`, add the stylesheet link to its existing `head()` rather than replacing the component. (Verified cold: shilp-sutra components — Button, Text, MarkdownViewer, EmojiPickerPopover — SSR-render cleanly under TanStack Start, HTTP 200.)
72
126
 
73
127
  ## 5. Theme toggle
74
128
 
75
- Create `public/theme-bootstrap.js` (a static asset served verbatim):
129
+ Add a pre-hydration bootstrap so there is no flash of the wrong theme. The cleanest place is a `scripts` entry on the root route (runs before hydration); a static `public/theme-bootstrap.js` referenced from `<head>` also works and is CSP-friendly.
130
+
131
+ Static-asset approach — create `public/theme-bootstrap.js`:
76
132
 
77
133
  ```js
78
134
  (function () {
@@ -86,44 +142,36 @@ Create `public/theme-bootstrap.js` (a static asset served verbatim):
86
142
  })();
87
143
  ```
88
144
 
89
- Reference it from `app/routes/__root.tsx`:
145
+ Reference it from the root route's `head` scripts:
90
146
 
91
147
  ```tsx
92
- import { createRootRoute, Outlet } from "@tanstack/react-router";
93
-
94
148
  export const Route = createRootRoute({
95
- component: () => (
96
- <html lang="en" suppressHydrationWarning>
97
- <head>
98
- <script src="/theme-bootstrap.js" />
99
- </head>
100
- <body>
101
- <Outlet />
102
- </body>
103
- </html>
104
- ),
149
+ head: () => ({
150
+ // ...meta, links as above...
151
+ scripts: [{ src: "/theme-bootstrap.js" }],
152
+ }),
153
+ component: RootComponent,
105
154
  });
106
155
  ```
107
156
 
108
- For runtime toggling, use the `useColorMode` hook — see [install-vite.md § 5](./install-vite.md#5-theme-toggle-no-next-themes-here).
157
+ For runtime toggling inside components, use the `useColorMode` hook — see [install-vite.md § 5](./install-vite.md#5-theme-toggle-no-next-themes-here).
109
158
 
110
159
  ## 6. Toaster (optional)
111
160
 
112
- Mount in `__root.tsx` next to `<Outlet />`:
161
+ Mount once in `__root.tsx`'s `RootComponent`, next to `<Outlet />`:
113
162
 
114
163
  ```tsx
115
164
  import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
116
165
 
117
166
  // inside <body>
118
- <>
119
- <Outlet />
120
- <Toaster />
121
- </>
167
+ <Outlet />
168
+ <Toaster />
169
+ <Scripts />
122
170
  ```
123
171
 
124
172
  ## 7. Verify
125
173
 
126
- Create or replace `app/routes/index.tsx`:
174
+ Create or replace `src/routes/index.tsx`:
127
175
 
128
176
  ```tsx
129
177
  import { createFileRoute } from "@tanstack/react-router";
@@ -132,7 +180,11 @@ import { Stack } from "@devalok/shilp-sutra/ui/stack";
132
180
  import { Text } from "@devalok/shilp-sutra/ui/text";
133
181
 
134
182
  export const Route = createFileRoute("/")({
135
- component: () => (
183
+ component: Home,
184
+ });
185
+
186
+ function Home() {
187
+ return (
136
188
  <Stack className="p-ds-08" gap="ds-04">
137
189
  <Text variant="heading-2xl">Hello, Shilp Sutra</Text>
138
190
  <Stack direction="row" gap="ds-03">
@@ -140,21 +192,23 @@ export const Route = createFileRoute("/")({
140
192
  <Button variant="soft">Soft</Button>
141
193
  </Stack>
142
194
  </Stack>
143
- ),
144
- });
195
+ );
196
+ }
145
197
  ```
146
198
 
147
- Run `pnpm dev` and open the URL.
199
+ Run `pnpm dev` and open the printed URL. Expected output matches [Next App Router § 7](./install-next-app-router.md#7-verify-the-install).
148
200
 
149
201
  ## 8. TanStack Start specifics
150
202
 
203
+ - **No `transpilePackages` equivalent — and you do not need one.** TanStack Start's Vite resolves `@devalok/shilp-sutra` from `node_modules` as native ESM.
151
204
  - **Server functions** (`createServerFn`) — do not import shilp-sutra components inside server functions; they run server-only.
152
- - **Streaming SSR** is the default. All shilp-sutra components SSR cleanly because they have no client-only side effects at module top-level.
205
+ - **Streaming SSR** is the default. Shilp Sutra components SSR cleanly (no client-only side effects at module top-level).
153
206
  - **`framer-motion` SSR** — animations gracefully degrade on the initial render.
154
- - **CSP.** The static `theme-bootstrap.js` asset complies with strict CSP (no inline scripts required).
207
+ - **`routeTree.gen.ts` is generated** do not edit it by hand; it regenerates on dev/build.
155
208
 
156
209
  ## 9. What NOT to do
157
210
 
158
- - ❌ Add `tailwind.config.{ts,js}` — Tailwind 4 is CSS-first.
159
- - ❌ Mount `<Toaster />` inside route componentsit should live once at the `__root`.
160
- - ❌ Mix `@tailwindcss/postcss` and `@tailwindcss/vite` pick one (Vite plugin recommended for TanStack Start).
211
+ - ❌ Add a `tailwind.config.{ts,js}` — Tailwind 4 is CSS-first.
212
+ - ❌ Use `@tanstack/start` / `app.config.ts` / `@tanstack/start/config`that is the retired Vinxi setup. Current TanStack Start is `@tanstack/react-start` + `vite.config.ts`.
213
+ - ❌ Mount `<Toaster />` inside route components it lives once at the `__root`.
214
+ - ❌ Mix `@tailwindcss/postcss` and `@tailwindcss/vite` — pick the Vite plugin.
@@ -44,18 +44,21 @@ pnpm add sonner
44
44
 
45
45
  ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
46
46
 
47
- Some components ship hard peers as optional. **Install BEFORE first import** or `vite dev` / `vite build` will fail with `Failed to resolve import`. Skip if you only use core components.
48
-
49
- | When you import… | Install |
50
- |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
51
- | `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
52
- | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
53
- | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
54
- | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
55
- | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
56
- | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
57
- | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
58
- | Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
47
+ Some components ship hard peers as optional. **Install BEFORE first import.** ⚠ On Vite 8 / Rolldown a missing peer does **not** fail the build — Rolldown silently replaces the import with a stub that throws `Could not resolve "…"` in the browser at runtime, while `vite build` still exits 0. A green build is therefore **not** proof the app works. Confirm coverage with the MCP `verify_setup` / `preflight` tools or the table below. Skip only if you use core components.
48
+
49
+ | When you import… | Install |
50
+ |---|---|
51
+ | `@devalok/shilp-sutra/composed/date-picker` | `pnpm add date-fns` |
52
+ | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
53
+ | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter remark-gfm` |
54
+ | `@devalok/shilp-sutra/composed/schedule-view` | `pnpm add date-fns` |
55
+ | `@devalok/shilp-sutra/ui/charts` | `pnpm add d3-axis d3-scale d3-selection d3-shape` |
56
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
57
+ | `@devalok/shilp-sutra/ui/data-table-toolbar` | `pnpm add @tanstack/react-table` |
58
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
59
+ | `@devalok/shilp-sutra/ui/toast` | `pnpm add sonner` |
60
+ | `@devalok/shilp-sutra/ui/toaster` | `pnpm add sonner` |
61
+ | Any `Icon` / `IconButton` with Tabler icons (near-universal — most components use icons internally, so it is a base-install peer) | `pnpm add @tabler/icons-react` |
59
62
 
60
63
  ## 3. Wire Tailwind 4 in `vite.config.ts`
61
64
 
@@ -138,7 +141,7 @@ If you installed `sonner`, mount the Toaster once near the app root:
138
141
  import { StrictMode } from "react";
139
142
  import { createRoot } from "react-dom/client";
140
143
  import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
141
- import { App } from "./App";
144
+ import App from "./App";
142
145
  import "./index.css";
143
146
 
144
147
  createRoot(document.getElementById("root")!).render(
@@ -151,14 +154,14 @@ createRoot(document.getElementById("root")!).render(
151
154
 
152
155
  ## 7. Verify
153
156
 
154
- Replace `src/App.tsx`:
157
+ Replace `src/App.tsx` (keep the **default export** — the `create-vite` template's `main.tsx` imports it as `import App from "./App"`, so a named export would break the build with `TS2613: Module has no default export`):
155
158
 
156
159
  ```tsx
157
160
  import { Button } from "@devalok/shilp-sutra/ui/button";
158
161
  import { Stack } from "@devalok/shilp-sutra/ui/stack";
159
162
  import { Text } from "@devalok/shilp-sutra/ui/text";
160
163
 
161
- export function App() {
164
+ export default function App() {
162
165
  return (
163
166
  <Stack className="p-ds-08" gap="ds-04">
164
167
  <Text variant="heading-2xl">Hello, Shilp Sutra</Text>