@devalok/shilp-sutra 0.39.0 → 0.40.1

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 (220) hide show
  1. package/AGENTS.md +156 -0
  2. package/MIGRATION.md +149 -0
  3. package/README.md +4 -1
  4. package/dist/_chunks/badge-group.js +75 -74
  5. package/dist/_chunks/badge-group.js.map +1 -1
  6. package/dist/_chunks/chart-container.js +50 -0
  7. package/dist/_chunks/chart-container.js.map +1 -0
  8. package/dist/_chunks/chat.js +231 -223
  9. package/dist/_chunks/chat.js.map +1 -1
  10. package/dist/_chunks/colors.js +30 -0
  11. package/dist/_chunks/colors.js.map +1 -0
  12. package/dist/_chunks/emoji-data.js +45 -0
  13. package/dist/_chunks/emoji-data.js.map +1 -0
  14. package/dist/_chunks/grid-lines.js +72 -0
  15. package/dist/_chunks/grid-lines.js.map +1 -0
  16. package/dist/_chunks/mention-suggestion.js +31 -259
  17. package/dist/_chunks/mention-suggestion.js.map +1 -1
  18. package/dist/_chunks/normalize-icon.js +18 -0
  19. package/dist/_chunks/normalize-icon.js.map +1 -0
  20. package/dist/_chunks/oauth-button.js +227 -0
  21. package/dist/_chunks/oauth-button.js.map +1 -0
  22. package/dist/_chunks/primitives.js +107 -107
  23. package/dist/_chunks/primitives.js.map +1 -1
  24. package/dist/_chunks/{text.js → success.js} +24 -61
  25. package/dist/_chunks/success.js.map +1 -0
  26. package/dist/_chunks/tiptap.js +1952 -1949
  27. package/dist/_chunks/tiptap.js.map +1 -1
  28. package/dist/_chunks/tooltip.js +58 -0
  29. package/dist/_chunks/tooltip.js.map +1 -0
  30. package/dist/_chunks/tree-view.js +101 -96
  31. package/dist/_chunks/tree-view.js.map +1 -1
  32. package/dist/ai/ai-command-provider.d.ts +3 -2
  33. package/dist/ai/ai-command-provider.d.ts.map +1 -1
  34. package/dist/ai/ai-command-provider.js.map +1 -1
  35. package/dist/ai/block-renderer.js +11 -9
  36. package/dist/ai/block-renderer.js.map +1 -1
  37. package/dist/ai/blocks/error.js +31 -0
  38. package/dist/ai/blocks/error.js.map +1 -0
  39. package/dist/ai/blocks/index.d.ts +0 -2
  40. package/dist/ai/blocks/index.d.ts.map +1 -1
  41. package/dist/ai/blocks/index.js +2 -2
  42. package/dist/ai/blocks/text.js +19 -0
  43. package/dist/ai/blocks/text.js.map +1 -0
  44. package/dist/ai/command-bar.d.ts.map +1 -1
  45. package/dist/ai/command-bar.js +192 -187
  46. package/dist/ai/command-bar.js.map +1 -1
  47. package/dist/ai/conversation.d.ts +2 -1
  48. package/dist/ai/conversation.d.ts.map +1 -1
  49. package/dist/ai/conversation.js +88 -83
  50. package/dist/ai/conversation.js.map +1 -1
  51. package/dist/ai/index.d.ts +0 -4
  52. package/dist/ai/index.d.ts.map +1 -1
  53. package/dist/ai/index.js +45 -46
  54. package/dist/ai/index.js.map +1 -1
  55. package/dist/composed/activity-feed.d.ts +2 -1
  56. package/dist/composed/activity-feed.d.ts.map +1 -1
  57. package/dist/composed/activity-feed.js.map +1 -1
  58. package/dist/composed/bulk-action-bar.d.ts +2 -2
  59. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  60. package/dist/composed/bulk-action-bar.js +11 -11
  61. package/dist/composed/bulk-action-bar.js.map +1 -1
  62. package/dist/composed/command-palette.d.ts +2 -1
  63. package/dist/composed/command-palette.d.ts.map +1 -1
  64. package/dist/composed/command-palette.js +103 -98
  65. package/dist/composed/command-palette.js.map +1 -1
  66. package/dist/composed/date-picker/index.js +747 -3
  67. package/dist/composed/date-picker/index.js.map +1 -0
  68. package/dist/composed/empty-state.d.ts +3 -3
  69. package/dist/composed/empty-state.d.ts.map +1 -1
  70. package/dist/composed/empty-state.js +40 -31
  71. package/dist/composed/empty-state.js.map +1 -1
  72. package/dist/composed/extensions/emoji-node.js +81 -0
  73. package/dist/composed/extensions/emoji-node.js.map +1 -0
  74. package/dist/composed/extensions/emoji-suggestion.js +117 -0
  75. package/dist/composed/extensions/emoji-suggestion.js.map +1 -0
  76. package/dist/composed/file-preview.js +498 -2
  77. package/dist/{_chunks → composed}/file-preview.js.map +1 -1
  78. package/dist/composed/index.d.ts +0 -15
  79. package/dist/composed/index.d.ts.map +1 -1
  80. package/dist/composed/index.js +16 -24
  81. package/dist/composed/rich-chat-input.js +2073 -2
  82. package/dist/{_chunks → composed}/rich-chat-input.js.map +1 -1
  83. package/dist/composed/rich-text-editor.js +64 -61
  84. package/dist/composed/rich-text-editor.js.map +1 -1
  85. package/dist/composed/status-badge.d.ts +3 -2
  86. package/dist/composed/status-badge.d.ts.map +1 -1
  87. package/dist/composed/status-badge.js +58 -53
  88. package/dist/composed/status-badge.js.map +1 -1
  89. package/dist/shell/app-command-palette.d.ts +2 -1
  90. package/dist/shell/app-command-palette.d.ts.map +1 -1
  91. package/dist/shell/app-command-palette.js.map +1 -1
  92. package/dist/shell/bottom-navbar.d.ts +3 -1
  93. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  94. package/dist/shell/bottom-navbar.js +90 -82
  95. package/dist/shell/bottom-navbar.js.map +1 -1
  96. package/dist/shell/command-registry.d.ts +2 -1
  97. package/dist/shell/command-registry.d.ts.map +1 -1
  98. package/dist/shell/command-registry.js.map +1 -1
  99. package/dist/shell/sidebar.d.ts +7 -4
  100. package/dist/shell/sidebar.d.ts.map +1 -1
  101. package/dist/shell/sidebar.js +143 -129
  102. package/dist/shell/sidebar.js.map +1 -1
  103. package/dist/shell/top-bar.d.ts +4 -3
  104. package/dist/shell/top-bar.d.ts.map +1 -1
  105. package/dist/shell/top-bar.js +114 -106
  106. package/dist/shell/top-bar.js.map +1 -1
  107. package/dist/ui/badge.d.ts +3 -2
  108. package/dist/ui/badge.d.ts.map +1 -1
  109. package/dist/ui/button.d.ts +3 -2
  110. package/dist/ui/button.d.ts.map +1 -1
  111. package/dist/ui/button.js +54 -53
  112. package/dist/ui/button.js.map +1 -1
  113. package/dist/ui/charts/area-chart.js +177 -0
  114. package/dist/ui/charts/area-chart.js.map +1 -0
  115. package/dist/ui/charts/bar-chart.js +127 -0
  116. package/dist/ui/charts/bar-chart.js.map +1 -0
  117. package/dist/ui/charts/chart-container.js +3 -0
  118. package/dist/ui/charts/gauge-chart.js +72 -0
  119. package/dist/ui/charts/gauge-chart.js.map +1 -0
  120. package/dist/ui/charts/index.js +10 -1035
  121. package/dist/ui/charts/line-chart.js +135 -0
  122. package/dist/ui/charts/line-chart.js.map +1 -0
  123. package/dist/ui/charts/pie-chart.js +111 -0
  124. package/dist/ui/charts/pie-chart.js.map +1 -0
  125. package/dist/ui/charts/radar-chart.js +170 -0
  126. package/dist/ui/charts/radar-chart.js.map +1 -0
  127. package/dist/ui/charts/sparkline.js +119 -0
  128. package/dist/ui/charts/sparkline.js.map +1 -0
  129. package/dist/ui/chat/message.d.ts +3 -3
  130. package/dist/ui/chat/message.d.ts.map +1 -1
  131. package/dist/ui/chat/system-message.d.ts +2 -1
  132. package/dist/ui/chat/system-message.d.ts.map +1 -1
  133. package/dist/ui/combobox.d.ts +2 -1
  134. package/dist/ui/combobox.d.ts.map +1 -1
  135. package/dist/ui/combobox.js +97 -92
  136. package/dist/ui/combobox.js.map +1 -1
  137. package/dist/ui/container.d.ts +6 -1
  138. package/dist/ui/container.d.ts.map +1 -1
  139. package/dist/ui/container.js +2 -1
  140. package/dist/ui/container.js.map +1 -1
  141. package/dist/ui/icon-button.d.ts +9 -2
  142. package/dist/ui/icon-button.d.ts.map +1 -1
  143. package/dist/ui/icon-button.js +14 -13
  144. package/dist/ui/icon-button.js.map +1 -1
  145. package/dist/ui/index.d.ts +1 -3
  146. package/dist/ui/index.d.ts.map +1 -1
  147. package/dist/ui/index.js +31 -33
  148. package/dist/ui/index.js.map +1 -1
  149. package/dist/ui/lib/icon-input.d.ts +42 -0
  150. package/dist/ui/lib/icon-input.d.ts.map +1 -0
  151. package/dist/ui/lib/normalize-icon.d.ts +39 -0
  152. package/dist/ui/lib/normalize-icon.d.ts.map +1 -0
  153. package/dist/ui/oauth-button/index.d.ts +3 -0
  154. package/dist/ui/oauth-button/index.d.ts.map +1 -0
  155. package/dist/ui/oauth-button/index.js +3 -0
  156. package/dist/ui/oauth-button/oauth-button.d.ts +208 -0
  157. package/dist/ui/oauth-button/oauth-button.d.ts.map +1 -0
  158. package/dist/ui/progress.js +1 -1
  159. package/dist/ui/segmented-control.d.ts +3 -4
  160. package/dist/ui/segmented-control.d.ts.map +1 -1
  161. package/dist/ui/segmented-control.js +53 -45
  162. package/dist/ui/segmented-control.js.map +1 -1
  163. package/dist/ui/stack.d.ts +6 -1
  164. package/dist/ui/stack.d.ts.map +1 -1
  165. package/dist/ui/stack.js +2 -1
  166. package/dist/ui/stack.js.map +1 -1
  167. package/dist/ui/stat-card.d.ts +2 -3
  168. package/dist/ui/stat-card.d.ts.map +1 -1
  169. package/dist/ui/stat-card.js +117 -115
  170. package/dist/ui/stat-card.js.map +1 -1
  171. package/dist/ui/stepper.d.ts +2 -1
  172. package/dist/ui/stepper.d.ts.map +1 -1
  173. package/dist/ui/stepper.js +74 -69
  174. package/dist/ui/stepper.js.map +1 -1
  175. package/dist/ui/text.d.ts +7 -2
  176. package/dist/ui/text.d.ts.map +1 -1
  177. package/dist/ui/text.js +2 -1
  178. package/dist/ui/text.js.map +1 -1
  179. package/dist/ui/toaster.d.ts +11 -2
  180. package/dist/ui/toaster.d.ts.map +1 -1
  181. package/dist/ui/toaster.js.map +1 -1
  182. package/dist/ui/tooltip.js +12 -12
  183. package/dist/ui/tree-view/tree-item.d.ts +3 -2
  184. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  185. package/dist/ui/tree-view/use-tree.d.ts +2 -1
  186. package/dist/ui/tree-view/use-tree.d.ts.map +1 -1
  187. package/docs/components/ui/oauth-button.md +86 -0
  188. package/docs/recipes/customize-brand.md +15 -0
  189. package/docs/recipes/index.md +6 -1
  190. package/docs/recipes/install-astro.md +15 -0
  191. package/docs/recipes/install-next-app-router.md +20 -10
  192. package/docs/recipes/install-next-pages.md +2 -0
  193. package/docs/recipes/install-remix.md +15 -0
  194. package/docs/recipes/install-tanstack-start.md +15 -0
  195. package/docs/recipes/install-vite.md +15 -0
  196. package/docs/recipes/troubleshoot.md +24 -2
  197. package/docs/recipes/upgrading.md +52 -0
  198. package/llms-full.txt +87 -1
  199. package/llms-quick.txt +249 -0
  200. package/llms.txt +110 -3
  201. package/package.json +79 -2
  202. package/scripts/welcome.mjs +252 -0
  203. package/skill/SKILL.md +29 -7
  204. package/skill/references/components-full.md +87 -1
  205. package/skill/references/components.md +110 -3
  206. package/skill/references/customize-brand.md +15 -0
  207. package/skill/references/setup-astro.md +15 -0
  208. package/skill/references/setup-next-app-router.md +20 -10
  209. package/skill/references/setup-next-pages.md +2 -0
  210. package/skill/references/setup-remix.md +15 -0
  211. package/skill/references/setup-tanstack-start.md +15 -0
  212. package/skill/references/setup-vite.md +15 -0
  213. package/skill/references/troubleshoot.md +24 -2
  214. package/skill/references/upgrading.md +54 -0
  215. package/dist/_chunks/date-picker.js +0 -748
  216. package/dist/_chunks/date-picker.js.map +0 -1
  217. package/dist/_chunks/file-preview.js +0 -499
  218. package/dist/_chunks/rich-chat-input.js +0 -2071
  219. package/dist/_chunks/text.js.map +0 -1
  220. package/dist/ui/charts/index.js.map +0 -1
@@ -2,6 +2,21 @@
2
2
 
3
3
  Override colors, radius, fonts, and spacing without forking the package. All customization happens through CSS custom properties — no JS configuration.
4
4
 
5
+ ## The fast path: use the Themer
6
+
7
+ Before hand-writing variables, try **[shilp-sutra.devalok.in/themer](https://shilp-sutra.devalok.in/themer)**. It is one funnel with four entry doors:
8
+
9
+ - **Pick an archetype** — Linear, Stripe, Apple, Material, Notion, Vercel, or Devalok. Click → result page.
10
+ - **Use my brand color** — paste a hex or dial OKLCH. Auto-generates the 12-step ramp and suggests an archetype.
11
+ - **Walk me through it** — five-question wizard composes the answers into a theme.
12
+ - **Just exploring** — land on a sample result page to see what you ship away with.
13
+
14
+ Every door drops you at the same result screen: a copy-pasteable CSS block (role tokens + 12-step OKLCH accent ramp), install commands for your package manager, and a share URL that encodes the theme.
15
+
16
+ Paste the snippet into your global stylesheet *after* the `@import "@devalok/shilp-sutra/css";` line. That's the whole flow — no `tailwind.config.ts`, no theme provider, no JS bundle.
17
+
18
+ The rest of this doc covers what to do if the Themer doesn't expose a token you need to override (font stack, spacing scale, focus ring) — fall through to the hand-written cases below.
19
+
5
20
  ## How tokens layer
6
21
 
7
22
  Shilp Sutra's tokens are organized in three tiers:
@@ -29,8 +29,13 @@ If the framework is not listed, start with [install-vite.md](./install-vite.md)
29
29
 
30
30
  | Recipe | What it covers |
31
31
  |---|---|
32
- | [customize-brand.md](./customize-brand.md) | Token override cookbook — colors, radius role tokens, `[data-shape]` presets, fonts, spacing scale, dark-mode mapping |
32
+ | [customize-brand.md](./customize-brand.md) | Token override cookbook — colors, radius role tokens, `[data-shape]` presets, fonts, spacing scale, dark-mode mapping. **Start here**, or skip ahead to the Themer ↓ |
33
33
  | [server-components.md](./server-components.md) | Per-component RSC-safety matrix; correct import patterns for Server Components |
34
+ | [upgrading.md](./upgrading.md) | How to bump versions safely — read the full breaking surface, find affected call sites, autofix with the ESLint plugin, typecheck before deploy |
35
+
36
+ ### The fast path: Themer
37
+
38
+ Don't want to write CSS variables by hand? Use **[shilp-sutra.devalok.in/themer](https://shilp-sutra.devalok.in/themer)** — one funnel, four doors (pick an archetype, paste your brand color, take a wizard, or just explore). Every door drops you at a result page with a CSS snippet to paste, install commands, and a share URL.
34
39
 
35
40
  ## Diagnostics
36
41
 
@@ -29,6 +29,21 @@ Add only if rendering `<Toaster />`:
29
29
  pnpm add sonner
30
30
  ```
31
31
 
32
+ ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
33
+
34
+ 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.
35
+
36
+ | When you import… | Install |
37
+ |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
38
+ | `@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` |
39
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
40
+ | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
41
+ | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
42
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
43
+ | `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
44
+ | `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
45
+ | Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
46
+
32
47
  ## 3. Wire Tailwind 4 in `astro.config`
33
48
 
34
49
  Astro has its own `@astrojs/tailwind` integration, but for Tailwind 4 use the Vite plugin directly (Astro 4.5+ supports this):
@@ -8,10 +8,9 @@ You are in this recipe if **all** of these are true:
8
8
 
9
9
  - `package.json` lists `"next"` at version `^13.0.0` or higher
10
10
  - An `app/` directory exists at the project root or under `src/`
11
- - An `app/layout.tsx` (or `.jsx`) file exists
12
- - No `pages/` directory at the project root, OR `pages/` exists but only contains `_app.{js,tsx}` and `_document.{js,tsx}` (legacy artifacts)
11
+ - An `app/layout.{tsx,jsx}` file exists
13
12
 
14
- If `pages/` is the primary router, use [install-next-pages.md](./install-next-pages.md).
13
+ If a `pages/` directory exists at the project root AND contains route files (not just `_app`/`_document` legacy artifacts from older `create-next-app` versions), use [install-next-pages.md](./install-next-pages.md). `create-next-app@16+` no longer scaffolds `pages/` for App Router projects.
15
14
 
16
15
  ## 2. Install dependencies
17
16
 
@@ -41,11 +40,22 @@ Add only if you will render `<Toaster />`:
41
40
  pnpm add sonner
42
41
  ```
43
42
 
44
- Add brand assets package if you need Devalok or Karm logos:
43
+ ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
45
44
 
46
- ```bash
47
- pnpm add @devalok/shilp-sutra-brand
48
- ```
45
+ 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.).
46
+
47
+ | When you import… | Install |
48
+ |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
49
+ | `@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` |
50
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
51
+ | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
52
+ | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
53
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
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` |
56
+ | Any `Icon` / `IconButton` use with Tabler icons | `pnpm add @tabler/icons-react` |
57
+
58
+ > 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.
49
59
 
50
60
  ## 3. Configure PostCSS
51
61
 
@@ -103,7 +113,7 @@ Edit `next.config.{ts,js,mjs}`. Add the `transpilePackages` field:
103
113
  import type { NextConfig } from "next";
104
114
 
105
115
  const nextConfig: NextConfig = {
106
- transpilePackages: ["@devalok/shilp-sutra", "@devalok/shilp-sutra-brand"],
116
+ transpilePackages: ["@devalok/shilp-sutra"],
107
117
  };
108
118
 
109
119
  export default nextConfig;
@@ -211,8 +221,8 @@ If anything is off, see [troubleshoot.md](./troubleshoot.md).
211
221
  }
212
222
  ```
213
223
  For npm/yarn/bun equivalents, see [troubleshoot.md](./troubleshoot.md).
214
- - **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).
215
- - **`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`.
224
+ - **Per-component imports keep RSC fast AND avoid peer-dep cliffs.** Inside Server Components, prefer `@devalok/shilp-sutra/ui/text`, `…/composed/page-header`, etc. The barrel `@devalok/shilp-sutra/ui` re-exports many client components — including some with hard peer-dep imports (e.g. `input-otp`) — so it both inflates the client bundle and forces those peers to be installed even when you never render those components. See [server-components.md](./server-components.md) for the full RSC-safety matrix.
225
+ - **`p-3` vs `p-ds-03` both are valid.** DS spacing uses the `--spacing-ds-*` namespace (`p-ds-04`, `gap-ds-03`); Tailwind 4's default numeric scale (`p-4`, `gap-2`) coexists by design. Pick `p-ds-*` for values that should track DS theme changes (card padding, form gaps); pick `p-N` for one-off layout values (section breathing room). Do NOT mass-codemod `p-4` → `p-ds-04` — that is not what the package intends.
216
226
  - **Bare `shadow` is dead.** Tailwind 4 has no `--shadow-DEFAULT`. Use `shadow-raised`, `shadow-overlay`, or `shadow-floating`.
217
227
 
218
228
  ## 9. What you should NOT do
@@ -16,6 +16,8 @@ If both `app/` and `pages/` exist, prefer [install-next-app-router.md](./install
16
16
 
17
17
  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).
18
18
 
19
+ **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.
20
+
19
21
  ## 3. PostCSS
20
22
 
21
23
  Same as App Router — see [§ 3](./install-next-app-router.md#3-configure-postcss).
@@ -25,6 +25,21 @@ Optional:
25
25
  pnpm add sonner # only if rendering <Toaster />
26
26
  ```
27
27
 
28
+ ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
29
+
30
+ 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.
31
+
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` |
42
+
28
43
  ## 3. Wire Tailwind 4 in `vite.config.ts`
29
44
 
30
45
  ```ts
@@ -23,6 +23,21 @@ Optional:
23
23
  pnpm add sonner # only if rendering <Toaster />
24
24
  ```
25
25
 
26
+ ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
27
+
28
+ 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.
29
+
30
+ | When you import… | Install |
31
+ |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
32
+ | `@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` |
33
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
34
+ | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
35
+ | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
36
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
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` |
39
+ | Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
40
+
26
41
  ## 3. Wire Tailwind 4 in `app.config.ts`
27
42
 
28
43
  ```ts
@@ -40,6 +40,21 @@ Add only if rendering `<Toaster />`:
40
40
  pnpm add sonner
41
41
  ```
42
42
 
43
+ ### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
44
+
45
+ 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.
46
+
47
+ | When you import… | Install |
48
+ |-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
49
+ | `@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` |
50
+ | `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
51
+ | `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
52
+ | `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
53
+ | `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
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` |
56
+ | Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
57
+
43
58
  ## 3. Wire Tailwind 4 in `vite.config.ts`
44
59
 
45
60
  Use the official Tailwind 4 Vite plugin (faster than PostCSS for Vite):
@@ -92,10 +92,32 @@ After editing, delete the lockfile + `node_modules` and reinstall.
92
92
  Add:
93
93
 
94
94
  ```ts
95
- transpilePackages: ["@devalok/shilp-sutra", "@devalok/shilp-sutra-brand"],
95
+ transpilePackages: ["@devalok/shilp-sutra"],
96
96
  ```
97
97
 
98
- If `@devalok/shilp-sutra-brand` is not installed, list only `@devalok/shilp-sutra`.
98
+ ## Symptom: Build error `Cannot find module 'sonner' / 'input-otp' / 'date-fns' / '@tiptap/react' / 'react-pdf' / 'react-markdown' / '@emoji-mart/react'`
99
+
100
+ **Diagnosis:** an optional peer dependency is missing. Each component below has a peer it pulls only when imported. Install the matching peer (always BEFORE the first import):
101
+
102
+ | You imported (per-component subpath) | Install |
103
+ |--------------------------------------|-----------------------------------------------------------------------------------------------|
104
+ | `…/ui/toaster` or `…/ui/toast` | `pnpm add sonner` |
105
+ | `…/ui/input-otp` | `pnpm add input-otp` |
106
+ | `…/composed/date-picker` | `pnpm add date-fns` |
107
+ | `…/composed/emoji-picker` | `pnpm add @emoji-mart/data @emoji-mart/react` |
108
+ | `…/composed/extensions/emoji-node` or `…/extensions/emoji-suggestion` | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
109
+ | `…/composed/rich-text-editor` | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
110
+ | `…/composed/rich-chat-input` | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
111
+ | `…/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
112
+ | `…/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter remark-gfm` |
113
+ | `…/ai/block-renderer`, `…/ai/blocks/text`, `…/ai/blocks/error` | `pnpm add react-markdown remark-gfm` |
114
+ | Any `…/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
115
+
116
+ These ship as **optional** peers so consumers who never render the matching component don't pay the install cost. Once you import the component, the peer becomes required. Each affected component's JSDoc carries the same install hint — hover the import in your editor to see it inline.
117
+
118
+ **Catch this at edit time, not build time:** install `@devalok/eslint-plugin-shilp-sutra` (`pnpm add -D @devalok/eslint-plugin-shilp-sutra`, then `shilpSutra.configs['flat/recommended']`). Its `prefer-per-component-import` rule flags peer-cliff symbols imported from a barrel and autofixes the path — surfacing the cliff in your editor before the bundler ever fails.
119
+
120
+ For the full table in your framework's install recipe, see `install-<framework>.md → §2a. Optional peer dependencies`.
99
121
 
100
122
  ## Symptom: Hydration warning on every page load (Next.js)
101
123
 
@@ -0,0 +1,52 @@
1
+ # Upgrading shilp-sutra safely
2
+
3
+ A version bump is **not** safe-by-default. Breaking changes in this design system are often type-level (prop types narrowed, symbols moved between barrels) and only surface at `tsc`/build time — never assume a bump is low-risk before doing the checks below.
4
+
5
+ > **Hard rule for AI agents:** On ANY version bump, do not report the upgrade as safe before you have read the COMPLETE changelog **and** `MIGRATION.md` for the target version, grepped the consumer codebase for moved/renamed/narrowed symbols, and run `typecheck` + `build`. Breaking entries are frequently ordered LAST in the changelog (changesets orders by file, not severity) — skimming the top and relaxing is the #1 failure mode.
6
+
7
+ ## Step 1 — read the full breaking surface
8
+
9
+ 1. Open the target version's section in `node_modules/@devalok/shilp-sutra/CHANGELOG.md` (or the GitHub release). **Read all of it**, not just the top.
10
+ 2. Open `node_modules/@devalok/shilp-sutra/MIGRATION.md` and read every section from your current version up to the target.
11
+ 3. Scan for these signals — each is a potential break:
12
+ - `feat!` / `BREAKING` headers
13
+ - "removed", "moved", "renamed", "narrowed", "no longer exported"
14
+ - any prop **type** change (a narrowing — new type accepts less than the old — fails `tsc` for values that compiled before)
15
+ - peer-dependency changes (a symbol now imported from a per-component subpath instead of the barrel)
16
+
17
+ ## Step 2 — find affected call sites in your code
18
+
19
+ ```bash
20
+ # Symbols moved out of barrels (0.40.0 peer-cliff cleanup example):
21
+ grep -rn "from '@devalok/shilp-sutra/ui'" src/ | grep -E "Toaster|toast|InputOTP"
22
+ grep -rn "from '@devalok/shilp-sutra/composed'" src/ | grep -E "DatePicker|EmojiPicker|FilePreview|MarkdownViewer|RichTextEditor|RichChatInput"
23
+ grep -rn "from '@devalok/shilp-sutra/ai'" src/ | grep -E "BlockRenderer|ErrorBlock|TextBlock"
24
+
25
+ # Type narrowings — find icon sources annotated as the wide React.ReactNode:
26
+ grep -rn "React.ReactNode" src/ | grep -i "icon"
27
+ ```
28
+
29
+ ## Step 3 — let the ESLint plugin do the mechanical work
30
+
31
+ ```bash
32
+ pnpm add -D @devalok/eslint-plugin-shilp-sutra
33
+ # one-shot codemod: repoints moved barrel imports + flags deprecated APIs
34
+ pnpm eslint --fix --config node_modules/@devalok/eslint-plugin-shilp-sutra/migration src/
35
+ ```
36
+
37
+ The `prefer-per-component-import` rule autofixes barrel→subpath moves and splits multi-symbol lines correctly. It cannot retype your own annotations — narrowings (Step 4) are still manual.
38
+
39
+ ## Step 4 — typecheck + build BEFORE deploy
40
+
41
+ ```bash
42
+ pnpm typecheck && pnpm build
43
+ ```
44
+
45
+ This is the gate that catches type narrowings the changelog may have under-described. Two real examples from 0.40.0:
46
+
47
+ - **Barrel peer-cliff cleanup (breaking):** `import { Toaster } from '@devalok/shilp-sutra/ui'` → `import { Toaster } from '@devalok/shilp-sutra/ui/toaster'`. 12 symbol families. Full table in `MIGRATION.md → v0.40.0`.
48
+ - **Icon API narrowing:** the unified `IconInput` type excludes `string`/`number`/iterables that `React.ReactNode` allowed. If you stored icons in a `Record<string, React.ReactNode>` map or `icon?: React.ReactNode` field and passed them to a migrated component (`CommandItem.icon`, `ActivityItem.icon`, `Chat.Message.Avatar`), retype the source to `React.ReactElement`.
49
+
50
+ ## Step 5 — only now is the bump "safe"
51
+
52
+ Report the upgrade as complete only after Steps 1-4 pass. If anything in the changelog was ambiguous, prefer a per-prop `expectTypeOf` probe over assuming "non-breaking".
package/llms-full.txt CHANGED
@@ -5,7 +5,7 @@
5
5
  > All variant values and props verified from source CVA definitions.
6
6
  >
7
7
  > Package: @devalok/shilp-sutra
8
- > Version: 0.39.0
8
+ > Version: 0.40.1
9
9
  >
10
10
  > **If you are an AI agent reading this file top-to-bottom:** the Setup
11
11
  > section below is authoritative. If any later per-component doc or a
@@ -3032,6 +3032,92 @@ const { size, stroke } = useIconContext()
3032
3032
 
3033
3033
  ### v0.1.0
3034
3034
  - **Added** Initial release
3035
+ # OAuthButton
3036
+
3037
+ - Import: @devalok/shilp-sutra/ui/oauth-button
3038
+ - Server-safe: No
3039
+ - Category: ui
3040
+
3041
+ ## Exports
3042
+ - `OAuthButton` — primary brand-aware sign-in button
3043
+ - `OAuthGroup` — stacked layout wrapper with consistent spacing
3044
+ - `OAuthDivider` — `or`-style horizontal rule between OAuth row and email form
3045
+ - `OAuthConnectionRow` — settings-page row for a linked provider (Disconnect / Connect action)
3046
+
3047
+ ## OAuthButton props
3048
+ provider: "google" | "apple" | "github" | "microsoft" | "x" | "linkedin" | "facebook" | "discord" | "slack" | "gitlab" | "sso" | "email" | "passkey" (required)
3049
+ intent: "continue" | "signin" | "signup" (default "continue") — drives the verb in the label
3050
+ appearance: "brand" | "outline" | "dark" (default "brand") — visual treatment
3051
+ icon: ReactNode — override the default Tabler glyph with a brand-multicolour SVG
3052
+ iconOnly: boolean — compact icon-only button; provider name preserved in aria-label
3053
+ compact: boolean — short label ("Google" not "Continue with Google"); aria-label keeps long form
3054
+ lastUsed: boolean — inline right-edge pill inside the button (a stronger pattern is reorder, below)
3055
+ helperText: ReactNode — reassurance copy rendered below the button
3056
+ children: ReactNode — override the default label entirely (i18n / custom copy)
3057
+ size: inherited from Button ("xs" | "sm" | "md" | "lg" | compact + icon variants)
3058
+ fullWidth, loading, onClick, onClickAsync, asyncFeedbackDuration, disabled — inherited from Button
3059
+
3060
+ ## Data attributes
3061
+ - `data-provider="<provider>"` — useful for analytics filtering
3062
+ - `data-oauth-appearance="<appearance>"`
3063
+
3064
+ ## OAuthGroup props
3065
+ orientation: "vertical" | "horizontal" (default "vertical")
3066
+ gap: "ds-02" | "ds-03" | "ds-04" (default "ds-03")
3067
+ fullWidth: boolean (default true) — stretches children to fill width when vertical
3068
+ reorderLastUsedFirst: boolean (default false) — pull the child with lastUsed to position 0
3069
+ (Stripe-style — a stronger conversion lever than a visual badge alone)
3070
+
3071
+ ## OAuthDivider props
3072
+ label: ReactNode (default "or")
3073
+
3074
+ ## OAuthConnectionRow props
3075
+ provider: OAuthProvider (required)
3076
+ connected: boolean (required)
3077
+ accountLabel: ReactNode — account identifier shown next to the provider name (e.g. email)
3078
+ onAction: (e) => void — synchronous click handler
3079
+ onActionAsync: (e) => Promise<void> — uses Button's async state machine
3080
+ actionLabel: ReactNode — override the "Disconnect" / "Connect <name>" copy
3081
+ icon: ReactNode — override the default glyph
3082
+ disabled: boolean
3083
+
3084
+ ## Defaults
3085
+ intent="continue", appearance="brand", iconOnly=false, lastUsed=false
3086
+
3087
+ ## Example
3088
+ ```jsx
3089
+ // Typical signup flow
3090
+ <OAuthGroup>
3091
+ <OAuthButton provider="google" lastUsed />
3092
+ <OAuthButton provider="apple" />
3093
+ <OAuthButton provider="github" />
3094
+ </OAuthGroup>
3095
+ <OAuthDivider />
3096
+ <OAuthGroup>
3097
+ <OAuthButton provider="passkey" appearance="outline" />
3098
+ <OAuthButton provider="email" appearance="outline" />
3099
+ </OAuthGroup>
3100
+
3101
+ // Async loading + success/error feedback
3102
+ <OAuthButton provider="google" fullWidth onClickAsync={signInWithGoogle} />
3103
+
3104
+ // True brand-multicolour glyph from the provider's brand page
3105
+ <OAuthButton provider="google" icon={<GoogleGSvg />} />
3106
+
3107
+ // Settings page — linked state
3108
+ <OAuthConnectionRow
3109
+ provider="google"
3110
+ connected
3111
+ accountLabel="namaskar@devalok.in"
3112
+ onAction={disconnectGoogle}
3113
+ />
3114
+ ```
3115
+
3116
+ ## Composability
3117
+ - **Built on Button.** Async state machine, loading/processing, sizes, and `fullWidth` are inherited. `variant` and `color` are managed internally — pass `appearance` instead.
3118
+ - **Tabler peer dep.** Default glyphs come from `@tabler/icons-react`. To match a provider's official multicolour mark, pass `icon={<YourSvg />}`.
3119
+ - **Brand-colour backgrounds.** `appearance="brand"` uses each provider's published button colour. `appearance="outline"` falls back to DS-neutral. `appearance="dark"` unifies every provider into an Apple-style black-on-white (light) / white-on-black (dark) treatment — useful when you want a row to feel visually consistent across providers.
3120
+ - **Last-used hint.** Storage is the consumer's responsibility — pass `lastUsed={user.lastProvider === 'google'}`.
3035
3121
  # Pagination
3036
3122
 
3037
3123
  - Import: @devalok/shilp-sutra/ui/pagination