@devalok/shilp-sutra 0.37.1 → 0.39.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 (260) hide show
  1. package/MIGRATION.md +185 -0
  2. package/dist/_chunks/badge-group.js +4 -4
  3. package/dist/_chunks/badge-group.js.map +1 -1
  4. package/dist/_chunks/chat.js +14 -14
  5. package/dist/_chunks/chat.js.map +1 -1
  6. package/dist/_chunks/date-picker.js +9 -9
  7. package/dist/_chunks/date-picker.js.map +1 -1
  8. package/dist/_chunks/document-preview.js +2 -2
  9. package/dist/_chunks/document-preview.js.map +1 -1
  10. package/dist/_chunks/file-preview.js +11 -11
  11. package/dist/_chunks/file-preview.js.map +1 -1
  12. package/dist/_chunks/image-preview.js +2 -2
  13. package/dist/_chunks/image-preview.js.map +1 -1
  14. package/dist/_chunks/mention-suggestion.js +5 -5
  15. package/dist/_chunks/mention-suggestion.js.map +1 -1
  16. package/dist/_chunks/popover.js +3 -3
  17. package/dist/_chunks/popover.js.map +1 -1
  18. package/dist/_chunks/rich-chat-input.js +33 -33
  19. package/dist/_chunks/rich-chat-input.js.map +1 -1
  20. package/dist/_chunks/shared.js +5 -5
  21. package/dist/_chunks/shared.js.map +1 -1
  22. package/dist/_chunks/text.js +2 -2
  23. package/dist/_chunks/text.js.map +1 -1
  24. package/dist/_chunks/tiptap.js +977 -968
  25. package/dist/_chunks/tiptap.js.map +1 -1
  26. package/dist/_chunks/tree-view.js +1 -1
  27. package/dist/_chunks/tree-view.js.map +1 -1
  28. package/dist/_chunks/use-calendar.js +5 -5
  29. package/dist/_chunks/use-calendar.js.map +1 -1
  30. package/dist/ai/command-bar.js +10 -10
  31. package/dist/ai/command-bar.js.map +1 -1
  32. package/dist/ai/conversation.js +4 -4
  33. package/dist/ai/conversation.js.map +1 -1
  34. package/dist/composed/activity-feed.js +5 -5
  35. package/dist/composed/activity-feed.js.map +1 -1
  36. package/dist/composed/avatar-group.js +4 -4
  37. package/dist/composed/avatar-group.js.map +1 -1
  38. package/dist/composed/bulk-action-bar.js +1 -1
  39. package/dist/composed/bulk-action-bar.js.map +1 -1
  40. package/dist/composed/command-palette.js +5 -5
  41. package/dist/composed/command-palette.js.map +1 -1
  42. package/dist/composed/content-card.js +1 -1
  43. package/dist/composed/content-card.js.map +1 -1
  44. package/dist/composed/emoji-picker.js +4 -4
  45. package/dist/composed/emoji-picker.js.map +1 -1
  46. package/dist/composed/empty-state.js +1 -1
  47. package/dist/composed/empty-state.js.map +1 -1
  48. package/dist/composed/error-boundary.js +3 -3
  49. package/dist/composed/error-boundary.js.map +1 -1
  50. package/dist/composed/filter-bar.js +1 -1
  51. package/dist/composed/filter-bar.js.map +1 -1
  52. package/dist/composed/index.d.ts +0 -2
  53. package/dist/composed/index.d.ts.map +1 -1
  54. package/dist/composed/index.js +5 -6
  55. package/dist/composed/inline-edit.js +1 -1
  56. package/dist/composed/inline-edit.js.map +1 -1
  57. package/dist/composed/loading-skeleton.js +9 -9
  58. package/dist/composed/loading-skeleton.js.map +1 -1
  59. package/dist/composed/markdown-viewer.js +3 -3
  60. package/dist/composed/markdown-viewer.js.map +1 -1
  61. package/dist/composed/multi-select-popover.js +1 -1
  62. package/dist/composed/multi-select-popover.js.map +1 -1
  63. package/dist/composed/page-header.js +1 -1
  64. package/dist/composed/page-header.js.map +1 -1
  65. package/dist/composed/page-skeletons.js +15 -15
  66. package/dist/composed/page-skeletons.js.map +1 -1
  67. package/dist/composed/priority-indicator.js +3 -3
  68. package/dist/composed/priority-indicator.js.map +1 -1
  69. package/dist/composed/rich-text-editor.js +11 -11
  70. package/dist/composed/rich-text-editor.js.map +1 -1
  71. package/dist/composed/schedule-view.js +3 -3
  72. package/dist/composed/schedule-view.js.map +1 -1
  73. package/dist/composed/status-badge.js +3 -3
  74. package/dist/composed/status-badge.js.map +1 -1
  75. package/dist/hooks/index.d.ts +2 -2
  76. package/dist/hooks/index.d.ts.map +1 -1
  77. package/dist/hooks/index.js +0 -1
  78. package/dist/shell/bottom-navbar.js +6 -6
  79. package/dist/shell/bottom-navbar.js.map +1 -1
  80. package/dist/shell/notification-center.js +8 -8
  81. package/dist/shell/notification-center.js.map +1 -1
  82. package/dist/shell/notification-preferences.js +1 -1
  83. package/dist/shell/notification-preferences.js.map +1 -1
  84. package/dist/shell/sidebar.js +6 -6
  85. package/dist/shell/sidebar.js.map +1 -1
  86. package/dist/shell/top-bar.js +4 -4
  87. package/dist/shell/top-bar.js.map +1 -1
  88. package/dist/tokens/semantic.css +82 -9
  89. package/dist/ui/accordion.js +1 -1
  90. package/dist/ui/accordion.js.map +1 -1
  91. package/dist/ui/alert-dialog.js +3 -3
  92. package/dist/ui/alert-dialog.js.map +1 -1
  93. package/dist/ui/alert.d.ts +1 -2
  94. package/dist/ui/alert.d.ts.map +1 -1
  95. package/dist/ui/alert.js +3 -29
  96. package/dist/ui/alert.js.map +1 -1
  97. package/dist/ui/autocomplete.js +2 -2
  98. package/dist/ui/autocomplete.js.map +1 -1
  99. package/dist/ui/avatar.js +11 -11
  100. package/dist/ui/avatar.js.map +1 -1
  101. package/dist/ui/badge-indicator.js +1 -1
  102. package/dist/ui/badge-indicator.js.map +1 -1
  103. package/dist/ui/banner.d.ts +3 -5
  104. package/dist/ui/banner.d.ts.map +1 -1
  105. package/dist/ui/banner.js +14 -14
  106. package/dist/ui/banner.js.map +1 -1
  107. package/dist/ui/breadcrumb.js +1 -1
  108. package/dist/ui/breadcrumb.js.map +1 -1
  109. package/dist/ui/button.d.ts +2 -2
  110. package/dist/ui/button.js +14 -14
  111. package/dist/ui/button.js.map +1 -1
  112. package/dist/ui/card.js +5 -5
  113. package/dist/ui/card.js.map +1 -1
  114. package/dist/ui/charts/index.js +5 -5
  115. package/dist/ui/charts/index.js.map +1 -1
  116. package/dist/ui/checkbox.js +1 -1
  117. package/dist/ui/checkbox.js.map +1 -1
  118. package/dist/ui/code.js +2 -2
  119. package/dist/ui/code.js.map +1 -1
  120. package/dist/ui/color-input.js +10 -10
  121. package/dist/ui/color-input.js.map +1 -1
  122. package/dist/ui/color-swatch.js +3 -3
  123. package/dist/ui/color-swatch.js.map +1 -1
  124. package/dist/ui/combobox.js +5 -5
  125. package/dist/ui/combobox.js.map +1 -1
  126. package/dist/ui/context-menu.js +6 -6
  127. package/dist/ui/context-menu.js.map +1 -1
  128. package/dist/ui/data-table-body.js +1 -1
  129. package/dist/ui/data-table-body.js.map +1 -1
  130. package/dist/ui/data-table-bulk-actions.js +2 -2
  131. package/dist/ui/data-table-bulk-actions.js.map +1 -1
  132. package/dist/ui/data-table-card.js +2 -2
  133. package/dist/ui/data-table-card.js.map +1 -1
  134. package/dist/ui/data-table-header.js +2 -2
  135. package/dist/ui/data-table-header.js.map +1 -1
  136. package/dist/ui/data-table-pagination.js +3 -3
  137. package/dist/ui/data-table-pagination.js.map +1 -1
  138. package/dist/ui/data-table-toolbar.js +1 -1
  139. package/dist/ui/data-table-toolbar.js.map +1 -1
  140. package/dist/ui/data-table.js +1 -1
  141. package/dist/ui/data-table.js.map +1 -1
  142. package/dist/ui/devalok-grain.d.ts +1 -1
  143. package/dist/ui/devalok-grain.js.map +1 -1
  144. package/dist/ui/dialog.js +2 -2
  145. package/dist/ui/dialog.js.map +1 -1
  146. package/dist/ui/dropdown-menu.js +6 -6
  147. package/dist/ui/dropdown-menu.js.map +1 -1
  148. package/dist/ui/file-upload.js +4 -4
  149. package/dist/ui/file-upload.js.map +1 -1
  150. package/dist/ui/hover-card.js +1 -1
  151. package/dist/ui/hover-card.js.map +1 -1
  152. package/dist/ui/icon-button.js +1 -1
  153. package/dist/ui/icon-button.js.map +1 -1
  154. package/dist/ui/index.d.ts +1 -1
  155. package/dist/ui/index.d.ts.map +1 -1
  156. package/dist/ui/index.js +2 -2
  157. package/dist/ui/index.js.map +1 -1
  158. package/dist/ui/input-otp.js +1 -1
  159. package/dist/ui/input-otp.js.map +1 -1
  160. package/dist/ui/input.d.ts +1 -9
  161. package/dist/ui/input.d.ts.map +1 -1
  162. package/dist/ui/input.js +28 -29
  163. package/dist/ui/input.js.map +1 -1
  164. package/dist/ui/link.js +1 -1
  165. package/dist/ui/link.js.map +1 -1
  166. package/dist/ui/menubar.js +8 -8
  167. package/dist/ui/menubar.js.map +1 -1
  168. package/dist/ui/navigation-menu.js +3 -3
  169. package/dist/ui/navigation-menu.js.map +1 -1
  170. package/dist/ui/number-input.js +3 -3
  171. package/dist/ui/number-input.js.map +1 -1
  172. package/dist/ui/pagination.js +1 -1
  173. package/dist/ui/pagination.js.map +1 -1
  174. package/dist/ui/progress.js +1 -1
  175. package/dist/ui/progress.js.map +1 -1
  176. package/dist/ui/radio.js +1 -1
  177. package/dist/ui/radio.js.map +1 -1
  178. package/dist/ui/segmented-control.d.ts +1 -1
  179. package/dist/ui/segmented-control.d.ts.map +1 -1
  180. package/dist/ui/segmented-control.js +5 -7
  181. package/dist/ui/segmented-control.js.map +1 -1
  182. package/dist/ui/select.js +3 -3
  183. package/dist/ui/select.js.map +1 -1
  184. package/dist/ui/sheet.js +2 -2
  185. package/dist/ui/sheet.js.map +1 -1
  186. package/dist/ui/sidebar.js +11 -11
  187. package/dist/ui/sidebar.js.map +1 -1
  188. package/dist/ui/skeleton.js +9 -9
  189. package/dist/ui/skeleton.js.map +1 -1
  190. package/dist/ui/slider.js +2 -2
  191. package/dist/ui/slider.js.map +1 -1
  192. package/dist/ui/split-button.js +7 -7
  193. package/dist/ui/split-button.js.map +1 -1
  194. package/dist/ui/stat-card.js +7 -7
  195. package/dist/ui/stat-card.js.map +1 -1
  196. package/dist/ui/status-dot.js +2 -2
  197. package/dist/ui/status-dot.js.map +1 -1
  198. package/dist/ui/stepper.js +2 -2
  199. package/dist/ui/stepper.js.map +1 -1
  200. package/dist/ui/switch.js +2 -2
  201. package/dist/ui/switch.js.map +1 -1
  202. package/dist/ui/tabs.js +3 -3
  203. package/dist/ui/tabs.js.map +1 -1
  204. package/dist/ui/textarea.js +1 -1
  205. package/dist/ui/textarea.js.map +1 -1
  206. package/dist/ui/toast.js +8 -8
  207. package/dist/ui/toast.js.map +1 -1
  208. package/dist/ui/toggle.js +1 -1
  209. package/dist/ui/toggle.js.map +1 -1
  210. package/dist/ui/tooltip.js +1 -1
  211. package/dist/ui/tooltip.js.map +1 -1
  212. package/docs/components/_header.md +91 -2
  213. package/docs/components/ui/alert.md +4 -1
  214. package/docs/components/ui/banner.md +3 -1
  215. package/docs/components/ui/input.md +4 -2
  216. package/docs/components/ui/segmented-control.md +13 -6
  217. package/docs/recipes/customize-brand.md +297 -0
  218. package/docs/recipes/index.md +51 -0
  219. package/docs/recipes/install-astro.md +178 -0
  220. package/docs/recipes/install-next-app-router.md +230 -0
  221. package/docs/recipes/install-next-pages.md +123 -0
  222. package/docs/recipes/install-remix.md +171 -0
  223. package/docs/recipes/install-tanstack-start.md +143 -0
  224. package/docs/recipes/install-vite.md +170 -0
  225. package/docs/recipes/server-components.md +209 -0
  226. package/docs/recipes/troubleshoot.md +217 -0
  227. package/llms-full.txt +116 -54
  228. package/llms.txt +42 -17
  229. package/package.json +46 -35
  230. package/skill/README.md +99 -0
  231. package/skill/SKILL.md +144 -0
  232. package/skill/install.sh +59 -0
  233. package/skill/references/components-full.md +6997 -0
  234. package/skill/references/components.md +673 -0
  235. package/skill/references/customize-brand.md +299 -0
  236. package/skill/references/server-components.md +211 -0
  237. package/skill/references/setup-astro.md +180 -0
  238. package/skill/references/setup-next-app-router.md +232 -0
  239. package/skill/references/setup-next-pages.md +125 -0
  240. package/skill/references/setup-remix.md +173 -0
  241. package/skill/references/setup-tanstack-start.md +145 -0
  242. package/skill/references/setup-vite.md +172 -0
  243. package/skill/references/troubleshoot.md +219 -0
  244. package/dist/composed/responsive-overlay.d.ts +0 -23
  245. package/dist/composed/responsive-overlay.d.ts.map +0 -1
  246. package/dist/composed/responsive-overlay.js +0 -40
  247. package/dist/composed/responsive-overlay.js.map +0 -1
  248. package/dist/hooks/use-toast.d.ts +0 -17
  249. package/dist/hooks/use-toast.d.ts.map +0 -1
  250. package/dist/hooks/use-toast.js +0 -3
  251. package/dist/tailwind/index.cjs +0 -41
  252. package/dist/tailwind/index.d.ts +0 -2
  253. package/dist/tailwind/index.d.ts.map +0 -1
  254. package/dist/tailwind/index.js +0 -2
  255. package/dist/tailwind/preset.d.ts +0 -25
  256. package/dist/tailwind/preset.d.ts.map +0 -1
  257. package/dist/tailwind/preset.js +0 -17
  258. package/dist/tailwind/preset.js.map +0 -1
  259. package/docs/components/composed/responsive-overlay.md +0 -41
  260. /package/{LICENSE → skill/LICENSE} +0 -0
@@ -0,0 +1,232 @@
1
+ <!-- Source: packages/core/docs/recipes/install-next-app-router.md — do not edit directly. Regenerate with `node scripts/build-skill.mjs`. -->
2
+
3
+ # Install: Next.js (App Router)
4
+
5
+ > Setup recipe for adding `@devalok/shilp-sutra` to a Next.js 13+ App Router project.
6
+
7
+ ## 1. Detect the framework
8
+
9
+ You are in this recipe if **all** of these are true:
10
+
11
+ - `package.json` lists `"next"` at version `^13.0.0` or higher
12
+ - An `app/` directory exists at the project root or under `src/`
13
+ - An `app/layout.tsx` (or `.jsx`) file exists
14
+ - No `pages/` directory at the project root, OR `pages/` exists but only contains `_app.{js,tsx}` and `_document.{js,tsx}` (legacy artifacts)
15
+
16
+ If `pages/` is the primary router, use [install-next-pages.md](./install-next-pages.md).
17
+
18
+ ## 2. Install dependencies
19
+
20
+ Pick the package manager that matches the project's lockfile.
21
+
22
+ ```bash
23
+ # pnpm (lockfile: pnpm-lock.yaml)
24
+ pnpm add @devalok/shilp-sutra framer-motion next-themes
25
+ pnpm add -D tailwindcss@^4 @tailwindcss/postcss
26
+
27
+ # npm (lockfile: package-lock.json)
28
+ npm install @devalok/shilp-sutra framer-motion next-themes
29
+ npm install -D tailwindcss@^4 @tailwindcss/postcss
30
+
31
+ # yarn (lockfile: yarn.lock)
32
+ yarn add @devalok/shilp-sutra framer-motion next-themes
33
+ yarn add -D tailwindcss@^4 @tailwindcss/postcss
34
+
35
+ # bun (lockfile: bun.lockb)
36
+ bun add @devalok/shilp-sutra framer-motion next-themes
37
+ bun add -d tailwindcss@^4 @tailwindcss/postcss
38
+ ```
39
+
40
+ Add only if you will render `<Toaster />`:
41
+
42
+ ```bash
43
+ pnpm add sonner
44
+ ```
45
+
46
+ Add brand assets package if you need Devalok or Karm logos:
47
+
48
+ ```bash
49
+ pnpm add @devalok/shilp-sutra-brand
50
+ ```
51
+
52
+ ## 3. Configure PostCSS
53
+
54
+ Create or update `postcss.config.mjs` at the project root:
55
+
56
+ ```js
57
+ export default {
58
+ plugins: {
59
+ "@tailwindcss/postcss": {},
60
+ },
61
+ };
62
+ ```
63
+
64
+ If a `postcss.config.{js,cjs,json}` already exists, merge the plugin in. Do not delete the existing file.
65
+
66
+ ## 4. Wire Tailwind 4 + design tokens
67
+
68
+ Locate the global CSS file. Common paths in priority order:
69
+
70
+ - `app/globals.css`
71
+ - `src/app/globals.css`
72
+ - `app/global.css`
73
+
74
+ If none exists, create `app/globals.css`. Set the file contents to (or merge into):
75
+
76
+ ```css
77
+ @import "tailwindcss";
78
+ @import "@devalok/shilp-sutra/css";
79
+ ```
80
+
81
+ **Order matters.** `tailwindcss` MUST come first. The shilp-sutra `/css` entry registers `@theme` blocks that the Tailwind import must process.
82
+
83
+ If the project has its own theme overrides, place them AFTER both imports:
84
+
85
+ ```css
86
+ @import "tailwindcss";
87
+ @import "@devalok/shilp-sutra/css";
88
+
89
+ @theme {
90
+ --color-brand: oklch(0.65 0.2 280);
91
+ }
92
+ ```
93
+
94
+ Import the CSS file once from `app/layout.tsx` (it should already be imported in a fresh `create-next-app` project):
95
+
96
+ ```tsx
97
+ import "./globals.css";
98
+ ```
99
+
100
+ ## 5. Configure `transpilePackages`
101
+
102
+ Edit `next.config.{ts,js,mjs}`. Add the `transpilePackages` field:
103
+
104
+ ```ts
105
+ import type { NextConfig } from "next";
106
+
107
+ const nextConfig: NextConfig = {
108
+ transpilePackages: ["@devalok/shilp-sutra", "@devalok/shilp-sutra-brand"],
109
+ };
110
+
111
+ export default nextConfig;
112
+ ```
113
+
114
+ If a `transpilePackages` array already exists, append to it. Do not replace.
115
+
116
+ Without `transpilePackages`, Next will refuse to load our pre-built `dist/*.js` because it ships native ESM that does not match Next's CJS-leaning loader for `node_modules`.
117
+
118
+ ## 6. Scaffold the Providers wrapper
119
+
120
+ Create `app/providers.tsx`:
121
+
122
+ ```tsx
123
+ "use client";
124
+
125
+ import type { ReactNode } from "react";
126
+ import { ThemeProvider } from "next-themes";
127
+ import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
128
+
129
+ export function Providers({ children }: { children: ReactNode }) {
130
+ return (
131
+ <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
132
+ {children}
133
+ <Toaster />
134
+ </ThemeProvider>
135
+ );
136
+ }
137
+ ```
138
+
139
+ `next-themes` is already in the install list from § 2 — no extra install step needed here. If `<Toaster />` is not used:
140
+
141
+ - Drop the `Toaster` import and its JSX usage
142
+ - Skip installing `sonner`
143
+
144
+ Mount `<Providers>` from `app/layout.tsx`:
145
+
146
+ ```tsx
147
+ import "./globals.css";
148
+ import { Providers } from "./providers";
149
+
150
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
151
+ return (
152
+ <html lang="en" suppressHydrationWarning>
153
+ <body>
154
+ <Providers>{children}</Providers>
155
+ </body>
156
+ </html>
157
+ );
158
+ }
159
+ ```
160
+
161
+ `suppressHydrationWarning` on `<html>` is required because `next-themes` writes the `class` attribute before React hydrates. Without it, every page logs a hydration warning.
162
+
163
+ ## 7. Verify the install
164
+
165
+ Replace the contents of `app/page.tsx`:
166
+
167
+ ```tsx
168
+ import { Button } from "@devalok/shilp-sutra/ui/button";
169
+ import { Stack } from "@devalok/shilp-sutra/ui/stack";
170
+ import { Text } from "@devalok/shilp-sutra/ui/text";
171
+
172
+ export default function Home() {
173
+ return (
174
+ <Stack className="p-ds-08" gap="ds-04">
175
+ <Text variant="heading-2xl">Hello, Shilp Sutra</Text>
176
+ <Stack direction="row" gap="ds-03">
177
+ <Button>Primary</Button>
178
+ <Button variant="soft">Soft</Button>
179
+ <Button variant="outline">Outline</Button>
180
+ </Stack>
181
+ </Stack>
182
+ );
183
+ }
184
+ ```
185
+
186
+ Run the dev server:
187
+
188
+ ```bash
189
+ pnpm dev
190
+ ```
191
+
192
+ Open `http://localhost:3000`. You should see:
193
+
194
+ - The heading rendered in **Ranade** (display font), the buttons in **Inter** (body font)
195
+ - The primary button on a saturated accent background, the soft button with a tinted background and no border, the outline button with a border and transparent background
196
+ - No hydration warning in the browser console
197
+ - No 404 for fonts (fonts are bundled inside the package; `next/font` is not required)
198
+
199
+ If anything is off, see [troubleshoot.md](./troubleshoot.md).
200
+
201
+ ## 8. Common gotchas
202
+
203
+ - **CSS import order.** `tailwindcss` BEFORE `@devalok/shilp-sutra/css`. Reversing the order silently produces a build with no design-system utilities.
204
+ - **Multiple `framer-motion` copies.** Run `pnpm why framer-motion`. If it shows more than one resolved version, contexts (`MotionConfig`, `LayoutGroup`, `AnimatePresence`) silently break. Fix:
205
+ ```jsonc
206
+ // package.json
207
+ {
208
+ "pnpm": {
209
+ "overrides": {
210
+ "framer-motion": "^12"
211
+ }
212
+ }
213
+ }
214
+ ```
215
+ For npm/yarn/bun equivalents, see [troubleshoot.md](./troubleshoot.md).
216
+ - **Server Component imports.** Use per-component imports (`@devalok/shilp-sutra/ui/text`) inside Server Components. The barrel import `@devalok/shilp-sutra/ui` pulls client-only code and breaks RSC. See [server-components.md](./server-components.md).
217
+ - **`p-3` vs `p-ds-03`.** Our spacing namespace is `--spacing-ds-*` to avoid collision with consumer numeric spacing. Use `p-ds-04`, not `p-4`.
218
+ - **Bare `shadow` is dead.** Tailwind 4 has no `--shadow-DEFAULT`. Use `shadow-raised`, `shadow-overlay`, or `shadow-floating`.
219
+
220
+ ## 9. What you should NOT do
221
+
222
+ - ❌ Create `tailwind.config.ts` with `presets: [shilpSutra]` — the JS preset was removed in 0.38.
223
+ - ❌ Add `@plugin "@devalok/shilp-sutra/tailwind"` — also removed.
224
+ - ❌ Wrap the whole app in `<MotionConfig reducedMotion="...">` unless the user explicitly asks for a global motion override; Shilp Sutra components already respect `prefers-reduced-motion`.
225
+ - ❌ Import from `@devalok/shilp-sutra/tailwind` — the export was removed in 0.38.
226
+ - ❌ Run `pnpm add @radix-ui/react-*` — Radix is vendored; no @radix-ui runtime deps are required.
227
+
228
+ ## 10. Optional next steps
229
+
230
+ - **Brand customization** — swap accent color, radius scale, or fonts: see [customize-brand.md](./customize-brand.md).
231
+ - **App shell** — add a sidebar + topbar layout: read `llms-full.txt` sections for `AppSidebar` and `TopBar`.
232
+ - **Server-safe components** — push as much rendering as possible into Server Components: see [server-components.md](./server-components.md).
@@ -0,0 +1,125 @@
1
+ <!-- Source: packages/core/docs/recipes/install-next-pages.md — do not edit directly. Regenerate with `node scripts/build-skill.mjs`. -->
2
+
3
+ # Install: Next.js (Pages Router)
4
+
5
+ > Setup recipe for adding `@devalok/shilp-sutra` to a Next.js project that uses the Pages Router (`pages/_app.tsx` as the entry).
6
+
7
+ ## 1. Detect
8
+
9
+ You are in this recipe if:
10
+
11
+ - `package.json` lists `"next"` (any version `>= 12`)
12
+ - A `pages/` directory exists at the project root or under `src/` and contains `_app.{js,tsx}` (and optionally `_document.{js,tsx}`)
13
+ - `app/` directory does NOT exist, OR exists but is unused
14
+
15
+ If both `app/` and `pages/` exist, prefer [install-next-app-router.md](./install-next-app-router.md) and treat the Pages Router as legacy.
16
+
17
+ ## 2. Install
18
+
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
+
21
+ ## 3. PostCSS
22
+
23
+ Same as App Router — see [§ 3](./install-next-app-router.md#3-configure-postcss).
24
+
25
+ ## 4. Wire Tailwind 4 + tokens
26
+
27
+ Common CSS entry paths in priority order:
28
+
29
+ - `styles/globals.css`
30
+ - `src/styles/globals.css`
31
+ - `pages/_app.css` (rare)
32
+
33
+ If none exists, create `styles/globals.css` with:
34
+
35
+ ```css
36
+ @import "tailwindcss";
37
+ @import "@devalok/shilp-sutra/css";
38
+ ```
39
+
40
+ Import it from `pages/_app.tsx`:
41
+
42
+ ```tsx
43
+ import "../styles/globals.css";
44
+ ```
45
+
46
+ ## 5. `transpilePackages`
47
+
48
+ Identical to App Router — see [§ 5](./install-next-app-router.md#5-configure-transpilepackages).
49
+
50
+ ## 6. Providers in `_app.tsx`
51
+
52
+ Replace or merge into `pages/_app.tsx`:
53
+
54
+ ```tsx
55
+ import "../styles/globals.css";
56
+ import type { AppProps } from "next/app";
57
+ import { ThemeProvider } from "next-themes";
58
+ import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
59
+
60
+ export default function App({ Component, pageProps }: AppProps) {
61
+ return (
62
+ <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
63
+ <Component {...pageProps} />
64
+ <Toaster />
65
+ </ThemeProvider>
66
+ );
67
+ }
68
+ ```
69
+
70
+ For `next-themes` to avoid hydration warnings, add a `_document.tsx` with `suppressHydrationWarning` on the `<html>`:
71
+
72
+ ```tsx
73
+ // pages/_document.tsx
74
+ import { Html, Head, Main, NextScript } from "next/document";
75
+
76
+ export default function Document() {
77
+ return (
78
+ <Html lang="en" suppressHydrationWarning>
79
+ <Head />
80
+ <body>
81
+ <Main />
82
+ <NextScript />
83
+ </body>
84
+ </Html>
85
+ );
86
+ }
87
+ ```
88
+
89
+ ## 7. Verify
90
+
91
+ Replace `pages/index.tsx`:
92
+
93
+ ```tsx
94
+ import { Button } from "@devalok/shilp-sutra/ui/button";
95
+ import { Stack } from "@devalok/shilp-sutra/ui/stack";
96
+ import { Text } from "@devalok/shilp-sutra/ui/text";
97
+
98
+ export default function Home() {
99
+ return (
100
+ <Stack className="p-ds-08" gap="ds-04">
101
+ <Text variant="heading-2xl">Hello, Shilp Sutra</Text>
102
+ <Stack direction="row" gap="ds-03">
103
+ <Button>Primary</Button>
104
+ <Button variant="soft">Soft</Button>
105
+ </Stack>
106
+ </Stack>
107
+ );
108
+ }
109
+ ```
110
+
111
+ Run `pnpm dev` and open `http://localhost:3000`. Expected output is the same as the App Router recipe — see [§ 7](./install-next-app-router.md#7-verify-the-install).
112
+
113
+ ## 8. Pages Router specifics
114
+
115
+ - **No React Server Components.** Every component runs on the client. Per-component imports still help tree-shaking but are not required for RSC safety.
116
+ - **`getServerSideProps` / `getStaticProps`** — do not import shilp-sutra components inside these (they run server-side and won't render JSX). Components are imported and used in the page module's default export, as usual.
117
+ - **`pages/_document.tsx` runs server-only.** Do not import shilp-sutra components there.
118
+
119
+ ## 9. Gotchas
120
+
121
+ Same as App Router — see [§ 8](./install-next-app-router.md#8-common-gotchas).
122
+
123
+ ## 10. What NOT to do
124
+
125
+ Same as App Router — see [§ 9](./install-next-app-router.md#9-what-you-should-not-do).
@@ -0,0 +1,173 @@
1
+ <!-- Source: packages/core/docs/recipes/install-remix.md — do not edit directly. Regenerate with `node scripts/build-skill.mjs`. -->
2
+
3
+ # Install: Remix
4
+
5
+ > Setup recipe for adding `@devalok/shilp-sutra` to a Remix project (v2 with Vite).
6
+
7
+ ## 1. Detect
8
+
9
+ You are in this recipe if:
10
+
11
+ - `package.json` lists `"@remix-run/node"` and `"@remix-run/react"`
12
+ - `vite.config.{ts,js}` exists with the `vitePlugin` from `@remix-run/dev`
13
+ - `app/root.tsx` exists with `<Outlet />` inside `<Document>` shell
14
+
15
+ For React Router v7 (the spiritual successor to Remix), use the [install-vite.md](./install-vite.md) recipe — it works the same way.
16
+
17
+ ## 2. Install
18
+
19
+ ```bash
20
+ pnpm add @devalok/shilp-sutra framer-motion
21
+ pnpm add -D tailwindcss@^4 @tailwindcss/vite
22
+ ```
23
+
24
+ Optional:
25
+
26
+ ```bash
27
+ pnpm add sonner # only if rendering <Toaster />
28
+ ```
29
+
30
+ ## 3. Wire Tailwind 4 in `vite.config.ts`
31
+
32
+ ```ts
33
+ import { vitePlugin as remix } from "@remix-run/dev";
34
+ import tailwindcss from "@tailwindcss/vite";
35
+ import { defineConfig } from "vite";
36
+
37
+ export default defineConfig({
38
+ plugins: [
39
+ tailwindcss(),
40
+ remix(),
41
+ ],
42
+ });
43
+ ```
44
+
45
+ `tailwindcss()` should come before `remix()` so the design tokens are processed first.
46
+
47
+ ## 4. Wire tokens
48
+
49
+ Create `app/styles/globals.css`:
50
+
51
+ ```css
52
+ @import "tailwindcss";
53
+ @import "@devalok/shilp-sutra/css";
54
+ ```
55
+
56
+ Wire it as a Remix link export from `app/root.tsx`:
57
+
58
+ ```tsx
59
+ import type { LinksFunction } from "@remix-run/node";
60
+ import globalsCss from "./styles/globals.css?url";
61
+
62
+ export const links: LinksFunction = () => [
63
+ { rel: "stylesheet", href: globalsCss },
64
+ ];
65
+ ```
66
+
67
+ The `?url` suffix is critical — it tells Vite to emit the file as an asset URL instead of inlining the CSS contents.
68
+
69
+ ## 5. Theme toggle
70
+
71
+ Create `public/theme-bootstrap.js` (a static asset served verbatim):
72
+
73
+ ```js
74
+ (function () {
75
+ try {
76
+ var stored = localStorage.getItem("theme");
77
+ var prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
78
+ if (stored === "dark" || (!stored && prefersDark)) {
79
+ document.documentElement.classList.add("dark");
80
+ }
81
+ } catch (e) {}
82
+ })();
83
+ ```
84
+
85
+ Reference it from `app/root.tsx` so it loads before any React hydration:
86
+
87
+ ```tsx
88
+ import { Outlet, Meta, Links, Scripts, ScrollRestoration } from "@remix-run/react";
89
+
90
+ export default function App() {
91
+ return (
92
+ <html lang="en" suppressHydrationWarning>
93
+ <head>
94
+ <Meta />
95
+ <Links />
96
+ <script src="/theme-bootstrap.js" />
97
+ </head>
98
+ <body>
99
+ <Outlet />
100
+ <ScrollRestoration />
101
+ <Scripts />
102
+ </body>
103
+ </html>
104
+ );
105
+ }
106
+ ```
107
+
108
+ For runtime toggling inside React components, use `useColorMode`:
109
+
110
+ ```tsx
111
+ import { useColorMode } from "@devalok/shilp-sutra/hooks/use-color-mode";
112
+
113
+ export function ThemeToggle() {
114
+ const { mode, toggle } = useColorMode();
115
+ return (
116
+ <button onClick={toggle} aria-label="Toggle theme">
117
+ {mode === "dark" ? "☀" : "☾"}
118
+ </button>
119
+ );
120
+ }
121
+ ```
122
+
123
+ ## 6. Toaster (optional)
124
+
125
+ Mount once in `app/root.tsx` next to `<Outlet />`:
126
+
127
+ ```tsx
128
+ import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
129
+
130
+ // inside <body>
131
+ <>
132
+ <Outlet />
133
+ <Toaster />
134
+ </>
135
+ ```
136
+
137
+ ## 7. Verify
138
+
139
+ Create `app/routes/_index.tsx`:
140
+
141
+ ```tsx
142
+ import { Button } from "@devalok/shilp-sutra/ui/button";
143
+ import { Stack } from "@devalok/shilp-sutra/ui/stack";
144
+ import { Text } from "@devalok/shilp-sutra/ui/text";
145
+
146
+ export default function Index() {
147
+ return (
148
+ <Stack className="p-ds-08" gap="ds-04">
149
+ <Text variant="heading-2xl">Hello, Shilp Sutra</Text>
150
+ <Stack direction="row" gap="ds-03">
151
+ <Button>Primary</Button>
152
+ <Button variant="soft">Soft</Button>
153
+ </Stack>
154
+ </Stack>
155
+ );
156
+ }
157
+ ```
158
+
159
+ Run `pnpm dev` and open the URL.
160
+
161
+ ## 8. Remix-specific gotchas
162
+
163
+ - **`?url` suffix on CSS imports.** Without it, Vite tries to inline the CSS, which breaks Tailwind processing.
164
+ - **Loaders are server-only.** Do not import shilp-sutra components inside a `loader` function — they will not render.
165
+ - **Server-rendered output.** Remix SSRs every route. The CSS-in-JS-free approach of shilp-sutra works perfectly here; no extra config needed.
166
+ - **`framer-motion` and SSR.** All shilp-sutra animations gracefully degrade for the initial server render. No special handling required.
167
+ - **CSP.** If your CSP blocks inline scripts, the `theme-bootstrap.js` static asset above already complies (no `unsafe-inline` needed).
168
+
169
+ ## 9. What NOT to do
170
+
171
+ - ❌ Add `tailwind.config.{ts,js}` — Tailwind 4 is CSS-first.
172
+ - ❌ Skip the `?url` suffix on CSS imports.
173
+ - ❌ Mount `<Toaster />` inside route components — it should live once at the root.
@@ -0,0 +1,145 @@
1
+ <!-- Source: packages/core/docs/recipes/install-tanstack-start.md — do not edit directly. Regenerate with `node scripts/build-skill.mjs`. -->
2
+
3
+ # Install: TanStack Start
4
+
5
+ > Setup recipe for adding `@devalok/shilp-sutra` to a TanStack Start project (the React full-stack framework built on Vinxi/Vite).
6
+
7
+ ## 1. Detect
8
+
9
+ You are in this recipe if:
10
+
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
14
+
15
+ ## 2. Install
16
+
17
+ ```bash
18
+ pnpm add @devalok/shilp-sutra framer-motion
19
+ pnpm add -D tailwindcss@^4 @tailwindcss/vite
20
+ ```
21
+
22
+ Optional:
23
+
24
+ ```bash
25
+ pnpm add sonner # only if rendering <Toaster />
26
+ ```
27
+
28
+ ## 3. Wire Tailwind 4 in `app.config.ts`
29
+
30
+ ```ts
31
+ import { defineConfig } from "@tanstack/start/config";
32
+ import tailwindcss from "@tailwindcss/vite";
33
+
34
+ export default defineConfig({
35
+ vite: {
36
+ plugins: [tailwindcss()],
37
+ },
38
+ });
39
+ ```
40
+
41
+ ## 4. Wire tokens
42
+
43
+ Create `app/styles/globals.css`:
44
+
45
+ ```css
46
+ @import "tailwindcss";
47
+ @import "@devalok/shilp-sutra/css";
48
+ ```
49
+
50
+ Import it from `app/routes/__root.tsx`:
51
+
52
+ ```tsx
53
+ import "../styles/globals.css";
54
+ ```
55
+
56
+ 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`.
57
+
58
+ ## 5. Theme toggle
59
+
60
+ Create `public/theme-bootstrap.js` (a static asset served verbatim):
61
+
62
+ ```js
63
+ (function () {
64
+ try {
65
+ var stored = localStorage.getItem("theme");
66
+ var prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
67
+ if (stored === "dark" || (!stored && prefersDark)) {
68
+ document.documentElement.classList.add("dark");
69
+ }
70
+ } catch (e) {}
71
+ })();
72
+ ```
73
+
74
+ Reference it from `app/routes/__root.tsx`:
75
+
76
+ ```tsx
77
+ import { createRootRoute, Outlet } from "@tanstack/react-router";
78
+
79
+ export const Route = createRootRoute({
80
+ component: () => (
81
+ <html lang="en" suppressHydrationWarning>
82
+ <head>
83
+ <script src="/theme-bootstrap.js" />
84
+ </head>
85
+ <body>
86
+ <Outlet />
87
+ </body>
88
+ </html>
89
+ ),
90
+ });
91
+ ```
92
+
93
+ For runtime toggling, use the `useColorMode` hook — see [install-vite.md § 5](./install-vite.md#5-theme-toggle-no-next-themes-here).
94
+
95
+ ## 6. Toaster (optional)
96
+
97
+ Mount in `__root.tsx` next to `<Outlet />`:
98
+
99
+ ```tsx
100
+ import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
101
+
102
+ // inside <body>
103
+ <>
104
+ <Outlet />
105
+ <Toaster />
106
+ </>
107
+ ```
108
+
109
+ ## 7. Verify
110
+
111
+ Create or replace `app/routes/index.tsx`:
112
+
113
+ ```tsx
114
+ import { createFileRoute } from "@tanstack/react-router";
115
+ import { Button } from "@devalok/shilp-sutra/ui/button";
116
+ import { Stack } from "@devalok/shilp-sutra/ui/stack";
117
+ import { Text } from "@devalok/shilp-sutra/ui/text";
118
+
119
+ export const Route = createFileRoute("/")({
120
+ component: () => (
121
+ <Stack className="p-ds-08" gap="ds-04">
122
+ <Text variant="heading-2xl">Hello, Shilp Sutra</Text>
123
+ <Stack direction="row" gap="ds-03">
124
+ <Button>Primary</Button>
125
+ <Button variant="soft">Soft</Button>
126
+ </Stack>
127
+ </Stack>
128
+ ),
129
+ });
130
+ ```
131
+
132
+ Run `pnpm dev` and open the URL.
133
+
134
+ ## 8. TanStack Start specifics
135
+
136
+ - **Server functions** (`createServerFn`) — do not import shilp-sutra components inside server functions; they run server-only.
137
+ - **Streaming SSR** is the default. All shilp-sutra components SSR cleanly because they have no client-only side effects at module top-level.
138
+ - **`framer-motion` SSR** — animations gracefully degrade on the initial render.
139
+ - **CSP.** The static `theme-bootstrap.js` asset complies with strict CSP (no inline scripts required).
140
+
141
+ ## 9. What NOT to do
142
+
143
+ - ❌ Add `tailwind.config.{ts,js}` — Tailwind 4 is CSS-first.
144
+ - ❌ Mount `<Toaster />` inside route components — it should live once at the `__root`.
145
+ - ❌ Mix `@tailwindcss/postcss` and `@tailwindcss/vite` — pick one (Vite plugin recommended for TanStack Start).