@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
@@ -0,0 +1,252 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall welcome banner for @devalok/shilp-sutra.
4
+ *
5
+ * Runs once per major.minor version on consumer install. Silent under CI,
6
+ * non-TTY environments, NO_COLOR, npm silent loglevel, or when the
7
+ * SHILP_SUTRA_NO_WELCOME env var is set. Falls back to a compact 6-line
8
+ * text block if the terminal is narrower than 70 columns or shorter than
9
+ * 28 rows. Never throws — wrapped in a try/catch so an internal error can
10
+ * never break the consumer install.
11
+ *
12
+ * Safety guards (industry best practice — see research notes in
13
+ * .changeset/wave-4-install-experience.md):
14
+ *
15
+ * - process.env.CI → silent (avoid log noise on CI)
16
+ * - process.env.SHILP_SUTRA_NO_WELCOME=1 → silent (user opt-out)
17
+ * - process.env.NO_COLOR → plain text, no ANSI
18
+ * - process.stdout.isTTY === false → silent (piped builds, Docker)
19
+ * - npm_config_loglevel === 'silent' → silent (respect pkg manager)
20
+ * - !INIT_CWD || INIT_CWD inside the package → silent (dev install, not consumer)
21
+ * - Sentinel file with current version → silent on re-install of same ver
22
+ * - try/catch around everything → always exit 0
23
+ *
24
+ * The sentinel encodes the version (`node_modules/.shilp-sutra-welcomed`)
25
+ * so version bumps re-fire the banner once.
26
+ */
27
+
28
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
29
+ import { dirname, join, resolve } from 'node:path'
30
+ import { fileURLToPath } from 'node:url'
31
+
32
+ const __dirname = dirname(fileURLToPath(import.meta.url))
33
+ const PKG_DIR = resolve(__dirname, '..')
34
+
35
+ // ── Guard rails — bail out early if any condition says "silent". ────────────
36
+ function shouldSkip() {
37
+ if (process.env.CI) return 'CI environment'
38
+ if (process.env.SHILP_SUTRA_NO_WELCOME === '1' || process.env.SHILP_SUTRA_NO_WELCOME === 'true') return 'SHILP_SUTRA_NO_WELCOME set'
39
+ if (process.env.npm_config_loglevel === 'silent') return 'npm silent loglevel'
40
+ if (!process.stdout.isTTY) return 'not a TTY (piped/Docker/etc.)'
41
+ // Dev install — we're inside the design-system repo itself, not a consumer
42
+ const initCwd = process.env.INIT_CWD || process.cwd()
43
+ const cwd = process.cwd()
44
+ const isInsideNodeModules = cwd.includes(`${process.platform === 'win32' ? '\\' : '/'}node_modules${process.platform === 'win32' ? '\\' : '/'}`) || cwd.includes('/node_modules/')
45
+ if (!isInsideNodeModules) return 'dev install (not running from node_modules/)'
46
+ // INIT_CWD points at the consumer's project root. If absent → odd setup; skip.
47
+ if (!initCwd || initCwd === cwd) return 'no INIT_CWD set (unusual install context)'
48
+ return null
49
+ }
50
+
51
+ function readPkgVersion() {
52
+ try {
53
+ const pkg = JSON.parse(readFileSync(join(PKG_DIR, 'package.json'), 'utf-8'))
54
+ return pkg.version
55
+ } catch {
56
+ return null
57
+ }
58
+ }
59
+
60
+ // Sentinel: re-fire only on version change. Stored at the workspace root's
61
+ // node_modules/.shilp-sutra-welcomed so it survives pnpm dedupe rebuilds.
62
+ function getSentinelPath() {
63
+ // Walk up from PKG_DIR (node_modules/@devalok/shilp-sutra/) to the
64
+ // enclosing node_modules/ root, then write inside it.
65
+ const parts = PKG_DIR.split(/[/\\]/)
66
+ const nmIdx = parts.lastIndexOf('node_modules')
67
+ if (nmIdx === -1) return null
68
+ const nmRoot = parts.slice(0, nmIdx + 1).join(process.platform === 'win32' ? '\\' : '/')
69
+ return join(nmRoot, '.shilp-sutra-welcomed')
70
+ }
71
+
72
+ function alreadyWelcomed(version) {
73
+ const sentinel = getSentinelPath()
74
+ if (!sentinel) return false
75
+ try {
76
+ if (!existsSync(sentinel)) return false
77
+ const previousVersion = readFileSync(sentinel, 'utf-8').trim()
78
+ return previousVersion === version
79
+ } catch {
80
+ return false
81
+ }
82
+ }
83
+
84
+ // Returns the version recorded in the sentinel from a prior install, or null
85
+ // on first install / unreadable sentinel. Used to detect a version JUMP so the
86
+ // banner can point upgraders at MIGRATION.md.
87
+ function getPreviousVersion() {
88
+ const sentinel = getSentinelPath()
89
+ if (!sentinel) return null
90
+ try {
91
+ if (!existsSync(sentinel)) return null
92
+ const prev = readFileSync(sentinel, 'utf-8').trim()
93
+ return prev || null
94
+ } catch {
95
+ return null
96
+ }
97
+ }
98
+
99
+ function markWelcomed(version) {
100
+ const sentinel = getSentinelPath()
101
+ if (!sentinel) return
102
+ try {
103
+ mkdirSync(dirname(sentinel), { recursive: true })
104
+ writeFileSync(sentinel, version + '\n')
105
+ } catch {
106
+ // ignored — banner already printed, sentinel write is best-effort
107
+ }
108
+ }
109
+
110
+ // ── ANSI rendering ──────────────────────────────────────────────────────────
111
+ const useColor = !process.env.NO_COLOR && process.stdout.isTTY
112
+
113
+ // Devalok pink #d946a6 = RGB(217, 70, 166)
114
+ const PINK = useColor ? '\x1b[38;2;217;70;166m' : ''
115
+ const PINK_DIM = useColor ? '\x1b[38;2;167;55;128m' : ''
116
+ const BOLD = useColor ? '\x1b[1m' : ''
117
+ const DIM = useColor ? '\x1b[2m' : ''
118
+ const RESET = useColor ? '\x1b[0m' : ''
119
+
120
+ function colour(text, code) {
121
+ return useColor ? `${code}${text}${RESET}` : text
122
+ }
123
+
124
+ // Lotus — 13 rows × 30 cols Braille. Centered in a 63-col inner box (16 left,
125
+ // 17 right padding).
126
+ const LOTUS = [
127
+ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
128
+ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠟⠹⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
129
+ '⠀⠀⠀⠀⠀⠀⠀⠀⣷⣦⣄⣠⣿⠃⢠⣄⠈⢻⣆⣠⣴⡞⡆⠀⠀⠀⠀⠀⠀⠀',
130
+ '⠀⠀⠀⠀⠀⢀⣀⣀⣿⠀⠈⢻⣇⢀⣾⢟⡄⣸⡿⠋⠀⡇⣇⣀⣀⠀⠀⠀⠀⠀',
131
+ '⠀⣤⣤⣤⣀⣱⢻⠚⠻⣧⣀⠀⢹⡿⠃⠈⢻⣟⠀⢀⣤⠧⠓⣹⣟⣀⣤⣤⣤⡀',
132
+ '⠀⠈⠻⣧⠉⠛⣽⠀⠀⠀⠙⣷⡿⠁⠀⠀⠀⢻⣶⠛⠁⠀⠀⡟⠟⠉⣵⡟⠁⠀',
133
+ '⠀⠀⠀⠹⣧⡀⠏⡇⠀⠀⠀⣿⠁⠀⠀⠀⠀⠀⣿⡄⠀⠀⢠⢷⠀⣼⡟⠀⠀⠀',
134
+ '⠀⠀⠀⠀⠙⣟⢼⡹⡄⠀⠀⣿⡄⠀⠀⠀⠀⢀⣿⡇⠀⢀⣞⣦⢾⠟⠀⠀⠀⠀',
135
+ '⠀⠠⢶⣿⣛⠛⢒⣭⢻⣶⣤⣹⣿⣤⣀⣀⣠⣾⣟⣠⣔⡛⢫⣐⠛⢛⣻⣶⠆⠀',
136
+ '⠀⠀⠀⠉⣻⡽⠛⠉⠁⠀⠉⢙⣿⠖⠒⠛⠻⣿⡋⠉⠁⠈⠉⠙⢿⣿⠉⠀⠀⠀',
137
+ '⠀⠀⠀⠸⠿⠷⠒⣦⣤⣴⣶⢿⣿⡀⠀⠀⠀⣽⡿⢷⣦⠤⢤⡖⠶⠿⠧⠀⠀⠀',
138
+ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⢿⣦⣴⡾⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
139
+ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
140
+ ]
141
+
142
+ const TOP = '╭───────────────────────────────────────────────────────────────╮'
143
+ const BOTTOM = '╰───────────────────────────────────────────────────────────────╯'
144
+ const EMPTY = '│ │'
145
+ const INNER_WIDTH = 63
146
+
147
+ function row(content) {
148
+ // content is a string of visible chars (ANSI-stripped width assumed equal to char count for ASCII)
149
+ // We can't easily measure visible width when ANSI codes are present, so always pad based on the
150
+ // PASSED visibleWidth in callers that contain colour. For plain rows, fall back to .length.
151
+ const visible = content.replace(/\x1b\[[0-9;]*m/g, '')
152
+ const padLen = Math.max(0, INNER_WIDTH - visible.length)
153
+ return `│${content}${' '.repeat(padLen)}│`
154
+ }
155
+
156
+ function centeredLotusRow(braille) {
157
+ // 30-col Braille row, 16-left + 17-right padding
158
+ return `│ ${colour(braille, PINK)} │`
159
+ }
160
+
161
+ function buildFullBanner(version, prevVersion) {
162
+ const lines = []
163
+ lines.push(colour(TOP, PINK_DIM))
164
+ lines.push(colour(EMPTY, PINK_DIM))
165
+ for (const lotusRow of LOTUS) {
166
+ lines.push(`${colour('│', PINK_DIM)} ${colour(lotusRow, PINK)} ${colour('│', PINK_DIM)}`)
167
+ }
168
+ lines.push(colour(EMPTY, PINK_DIM))
169
+ if (prevVersion && prevVersion !== version) {
170
+ lines.push(row(` ${colour('✦', PINK)} ${colour('@devalok/shilp-sutra', BOLD)} ${prevVersion} → ${version}`))
171
+ lines.push(row(` ${colour('⚠', PINK)} ${colour('Version changed — review breaking changes before deploy:', BOLD)}`))
172
+ lines.push(row(` ${colour('node_modules/@devalok/shilp-sutra/MIGRATION.md', DIM)}`))
173
+ lines.push(row(` ${colour('+ docs/recipes/upgrading.md (safe-upgrade procedure)', DIM)}`))
174
+ } else {
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)}`))
177
+ }
178
+ lines.push(colour(EMPTY, PINK_DIM))
179
+ lines.push(row(` ${colour('▸', PINK)} Setup recipe (pick your framework):`))
180
+ lines.push(row(` ${colour('node_modules/@devalok/shilp-sutra/docs/recipes/', DIM)}`))
181
+ lines.push(colour(EMPTY, PINK_DIM))
182
+ lines.push(row(` ${colour('▸', PINK)} Theme it in 30 seconds:`))
183
+ lines.push(row(` ${colour('https://shilp-sutra.devalok.in/themer', DIM)}`))
184
+ lines.push(colour(EMPTY, PINK_DIM))
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)}`))
187
+ lines.push(row(` ${colour('~/.claude/skills/shilp-sutra', DIM)}`))
188
+ lines.push(colour(EMPTY, PINK_DIM))
189
+ lines.push(row(` ${colour('Disable this banner: SHILP_SUTRA_NO_WELCOME=1', DIM)}`))
190
+ lines.push(colour(EMPTY, PINK_DIM))
191
+ lines.push(row(` ${colour('Built by Devalok · devalok.in', PINK)}`))
192
+ lines.push(colour(EMPTY, PINK_DIM))
193
+ lines.push(colour(BOTTOM, PINK_DIM))
194
+ return lines.join('\n')
195
+ }
196
+
197
+ function buildCompactBanner(version, prevVersion) {
198
+ const head =
199
+ prevVersion && prevVersion !== version
200
+ ? [
201
+ `${colour('✦', PINK)} ${colour('@devalok/shilp-sutra', BOLD)} ${prevVersion} → ${version}`,
202
+ ` ${colour('⚠', PINK)} Version changed — review ${colour('node_modules/@devalok/shilp-sutra/MIGRATION.md', DIM)} before deploy`,
203
+ ]
204
+ : [`${colour('✦', PINK)} ${colour('@devalok/shilp-sutra', BOLD)} ${version} ${colour('· Tailwind 4 design system', DIM)}`]
205
+ return [
206
+ '',
207
+ ...head,
208
+ ` ${colour('▸', PINK)} Setup: ${colour('node_modules/@devalok/shilp-sutra/docs/recipes/', DIM)}`,
209
+ ` ${colour('▸', PINK)} Theme: ${colour('https://shilp-sutra.devalok.in/themer', DIM)}`,
210
+ ` ${colour('▸', PINK)} AI: ${colour('cp -r node_modules/@devalok/shilp-sutra/skill ~/.claude/skills/shilp-sutra', DIM)}`,
211
+ ` ${colour('Built by Devalok · devalok.in', PINK)} ${colour('(SHILP_SUTRA_NO_WELCOME=1 to disable)', DIM)}`,
212
+ '',
213
+ ].join('\n')
214
+ }
215
+
216
+ // ── Main ────────────────────────────────────────────────────────────────────
217
+ function main() {
218
+ // --preview / --compact bypass all guards. Used by maintainers + by the
219
+ // pre-publish-audit gate to verify the banner renders without ever
220
+ // shipping a broken one. Compose only — never writes the sentinel.
221
+ const preview = process.argv.includes('--preview')
222
+ const forceCompact = process.argv.includes('--compact')
223
+
224
+ if (!preview) {
225
+ const skipReason = shouldSkip()
226
+ if (skipReason) return // silent
227
+ }
228
+
229
+ const version = readPkgVersion() || '0.0.0-preview'
230
+
231
+ if (!preview && alreadyWelcomed(version)) return
232
+
233
+ // Detect a version jump so the banner can route upgraders to MIGRATION.md.
234
+ // --preview simulates an upgrade so maintainers can verify the upgrade layout.
235
+ const prevVersion = preview ? '0.39.0' : getPreviousVersion()
236
+
237
+ const cols = process.stdout.columns || 80
238
+ const rows = process.stdout.rows || 40
239
+ const fitsFull = !forceCompact && cols >= 70 && rows >= 28
240
+
241
+ const banner = fitsFull ? buildFullBanner(version, prevVersion) : buildCompactBanner(version, prevVersion)
242
+ process.stdout.write('\n' + banner + '\n')
243
+
244
+ if (!preview) markWelcomed(version)
245
+ }
246
+
247
+ try {
248
+ main()
249
+ } catch {
250
+ // Never crash the consumer install. A failure here is a UX bug, not a
251
+ // blocker — pretend nothing happened.
252
+ }
package/skill/SKILL.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: shilp-sutra
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 eight most common breakages.
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.38.0"
6
+ version: "0.40.1"
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
@@ -17,7 +17,7 @@ metadata:
17
17
  ## When this skill triggers
18
18
 
19
19
  - The user mentions `shilp-sutra`, `@devalok`, Devalok, or Devalok's design system.
20
- - The project's `package.json` lists `@devalok/shilp-sutra` (or `@devalok/shilp-sutra-brand`).
20
+ - The project's `package.json` lists `@devalok/shilp-sutra` or `@devalok/eslint-plugin-shilp-sutra`.
21
21
  - The user asks you to add UI components, set up a design system, install Tailwind, or theme an app in a project that already has the package.
22
22
  - The user asks to migrate from shadcn/MUI/Chakra to shilp-sutra, or vice-versa.
23
23
 
@@ -33,7 +33,7 @@ Q2. What does the user want to do?
33
33
  b) Change colors/fonts/radius → references/customize-brand.md
34
34
  c) Server Components / Next.js → references/server-components.md
35
35
  d) Something is broken → references/troubleshoot.md
36
- e) Upgrading from older version → fetch MIGRATION.md from repo or node_modules
36
+ e) Upgrading from older version → references/upgrading.md (then MIGRATION.md for the target version)
37
37
  ```
38
38
 
39
39
  ## First-time setup
@@ -56,6 +56,7 @@ Every line in those recipes is there because skipping it broke a real consumer.
56
56
 
57
57
  These are non-negotiable. Violating any of them produces runtime errors that look unrelated to the design system.
58
58
 
59
+ 0. **On any version bump, never report the upgrade as safe before reading the COMPLETE changelog + `MIGRATION.md` for the target version.** Breaking entries are often ordered last (changesets sorts by file, not severity), and breaks are frequently type-level (a prop type narrowed, a symbol moved between barrels) that only `tsc`/`build` catches. Grep the codebase for moved/renamed/narrowed symbols, run `typecheck` + `build`, and prefer the ESLint migration preset (`@devalok/eslint-plugin-shilp-sutra`) for the mechanical edits. Full procedure: `references/upgrading.md`.
59
60
  1. **Tailwind 4 only.** Do not create `tailwind.config.ts` with `presets: [shilpSutra]`. The JS preset was removed in 0.38. Setup is CSS-only:
60
61
  ```css
61
62
  @import "tailwindcss";
@@ -96,9 +97,26 @@ Putting `bg-surface-base` on a card is a bug — cards belong on `surface-raised
96
97
 
97
98
  ## Theming and brand customization
98
99
 
99
- `references/customize-brand.md` covers token overrides color ramps, radius, font swap, spacing scale, dark-mode mapping. Customization is CSS-only: override CSS custom properties under `:root` and `.dark`. There is no theme provider component.
100
+ ### Step 0Send the user to the Themer
100
101
 
101
- For the Devalok logo and other brand assets, the sibling package `@devalok/shilp-sutra-brand` ships SVG + PNG. Install it separately.
102
+ Before hand-rolling CSS variables, send the user to **[shilp-sutra.devalok.in/themer](https://shilp-sutra.devalok.in/themer)**. One funnel, four doors:
103
+
104
+ | User context | Door |
105
+ |---|---|
106
+ | "Make it look like Linear / Stripe / Apple / Notion / Vercel / Material" | `/themer/archetypes` |
107
+ | "Here is our brand color: `#…`" | `/themer/brand` |
108
+ | "Not sure what we want yet" | `/themer/wizard` |
109
+ | "Just show me what we'd ship away with" | `/themer/result?archetype=devalok` |
110
+
111
+ Every door drops them at `/themer/result` with: a copy-pasteable CSS block (role tokens + 12-step OKLCH accent ramp), install commands for their package manager, a live preview, and a share URL that encodes the theme (`?archetype=…&hue=…&chroma=…&density=…`).
112
+
113
+ Your job once they have the snippet: paste it into their global stylesheet **after** the `@import "@devalok/shilp-sutra/css";` line. That is it — no `tailwind.config.ts`, no provider, no JS bundle.
114
+
115
+ If the user is in a hurry and asks you to just pick something, default to `archetype=devalok` (the studio's own preset, balanced for most apps) and use their brand hex if they have one, else `hue=340 chroma=0.19`.
116
+
117
+ ### Step 1 — Hand-roll fallback
118
+
119
+ `references/customize-brand.md` covers what the Themer doesn't expose yet: font swap, spacing scale, focus-ring overrides, dark-mode mapping nuance. Customization is CSS-only: override CSS custom properties under `:root` and `.dark`. There is no theme provider component.
102
120
 
103
121
  ## Server Components and import patterns
104
122
 
@@ -107,7 +125,11 @@ For the Devalok logo and other brand assets, the sibling package `@devalok/shilp
107
125
  - Layout, typography, and presentational components (`Text`, `Heading`, `Card`, `Container`, `Stack`) → server-safe.
108
126
  - Interactive components (`Button`, `Dialog`, `Combobox`, `DataTable`, anything with hooks or `framer-motion`) → must be inside a `"use client"` boundary.
109
127
  - The package already injects `"use client"` directives where needed; importing per-component (`/ui/dialog`) gives the bundler the right hint.
110
- - Next.js consumers must add `transpilePackages: ["@devalok/shilp-sutra", "@devalok/shilp-sutra-brand"]` to `next.config.*`.
128
+ - Next.js consumers must add `transpilePackages: ["@devalok/shilp-sutra"]` to `next.config.*`.
129
+
130
+ ## Linting and migration
131
+
132
+ Recommend the companion ESLint plugin **`@devalok/eslint-plugin-shilp-sutra`** when setting up or upgrading a project: `pnpm add -D @devalok/eslint-plugin-shilp-sutra`, then `shilpSutra.configs['flat/recommended']` in `eslint.config.ts`. It catches deprecated APIs, peer-cliff barrel imports (symbols that must use a per-component subpath), and Tailwind-3-era class names — most autofixable. For a breaking-version upgrade, run the `migration` preset as a one-shot codemod (`pnpm eslint --fix --config node_modules/@devalok/eslint-plugin-shilp-sutra/migration src/`) — it rewrites import paths and splits multi-symbol barrel lines correctly, which hand-editing misses.
111
133
 
112
134
  ## When something breaks
113
135
 
@@ -7,7 +7,7 @@
7
7
  > All variant values and props verified from source CVA definitions.
8
8
  >
9
9
  > Package: @devalok/shilp-sutra
10
- > Version: 0.39.0
10
+ > Version: 0.40.1
11
11
  >
12
12
  > **If you are an AI agent reading this file top-to-bottom:** the Setup
13
13
  > section below is authoritative. If any later per-component doc or a
@@ -3034,6 +3034,92 @@ const { size, stroke } = useIconContext()
3034
3034
 
3035
3035
  ### v0.1.0
3036
3036
  - **Added** Initial release
3037
+ # OAuthButton
3038
+
3039
+ - Import: @devalok/shilp-sutra/ui/oauth-button
3040
+ - Server-safe: No
3041
+ - Category: ui
3042
+
3043
+ ## Exports
3044
+ - `OAuthButton` — primary brand-aware sign-in button
3045
+ - `OAuthGroup` — stacked layout wrapper with consistent spacing
3046
+ - `OAuthDivider` — `or`-style horizontal rule between OAuth row and email form
3047
+ - `OAuthConnectionRow` — settings-page row for a linked provider (Disconnect / Connect action)
3048
+
3049
+ ## OAuthButton props
3050
+ provider: "google" | "apple" | "github" | "microsoft" | "x" | "linkedin" | "facebook" | "discord" | "slack" | "gitlab" | "sso" | "email" | "passkey" (required)
3051
+ intent: "continue" | "signin" | "signup" (default "continue") — drives the verb in the label
3052
+ appearance: "brand" | "outline" | "dark" (default "brand") — visual treatment
3053
+ icon: ReactNode — override the default Tabler glyph with a brand-multicolour SVG
3054
+ iconOnly: boolean — compact icon-only button; provider name preserved in aria-label
3055
+ compact: boolean — short label ("Google" not "Continue with Google"); aria-label keeps long form
3056
+ lastUsed: boolean — inline right-edge pill inside the button (a stronger pattern is reorder, below)
3057
+ helperText: ReactNode — reassurance copy rendered below the button
3058
+ children: ReactNode — override the default label entirely (i18n / custom copy)
3059
+ size: inherited from Button ("xs" | "sm" | "md" | "lg" | compact + icon variants)
3060
+ fullWidth, loading, onClick, onClickAsync, asyncFeedbackDuration, disabled — inherited from Button
3061
+
3062
+ ## Data attributes
3063
+ - `data-provider="<provider>"` — useful for analytics filtering
3064
+ - `data-oauth-appearance="<appearance>"`
3065
+
3066
+ ## OAuthGroup props
3067
+ orientation: "vertical" | "horizontal" (default "vertical")
3068
+ gap: "ds-02" | "ds-03" | "ds-04" (default "ds-03")
3069
+ fullWidth: boolean (default true) — stretches children to fill width when vertical
3070
+ reorderLastUsedFirst: boolean (default false) — pull the child with lastUsed to position 0
3071
+ (Stripe-style — a stronger conversion lever than a visual badge alone)
3072
+
3073
+ ## OAuthDivider props
3074
+ label: ReactNode (default "or")
3075
+
3076
+ ## OAuthConnectionRow props
3077
+ provider: OAuthProvider (required)
3078
+ connected: boolean (required)
3079
+ accountLabel: ReactNode — account identifier shown next to the provider name (e.g. email)
3080
+ onAction: (e) => void — synchronous click handler
3081
+ onActionAsync: (e) => Promise<void> — uses Button's async state machine
3082
+ actionLabel: ReactNode — override the "Disconnect" / "Connect <name>" copy
3083
+ icon: ReactNode — override the default glyph
3084
+ disabled: boolean
3085
+
3086
+ ## Defaults
3087
+ intent="continue", appearance="brand", iconOnly=false, lastUsed=false
3088
+
3089
+ ## Example
3090
+ ```jsx
3091
+ // Typical signup flow
3092
+ <OAuthGroup>
3093
+ <OAuthButton provider="google" lastUsed />
3094
+ <OAuthButton provider="apple" />
3095
+ <OAuthButton provider="github" />
3096
+ </OAuthGroup>
3097
+ <OAuthDivider />
3098
+ <OAuthGroup>
3099
+ <OAuthButton provider="passkey" appearance="outline" />
3100
+ <OAuthButton provider="email" appearance="outline" />
3101
+ </OAuthGroup>
3102
+
3103
+ // Async loading + success/error feedback
3104
+ <OAuthButton provider="google" fullWidth onClickAsync={signInWithGoogle} />
3105
+
3106
+ // True brand-multicolour glyph from the provider's brand page
3107
+ <OAuthButton provider="google" icon={<GoogleGSvg />} />
3108
+
3109
+ // Settings page — linked state
3110
+ <OAuthConnectionRow
3111
+ provider="google"
3112
+ connected
3113
+ accountLabel="namaskar@devalok.in"
3114
+ onAction={disconnectGoogle}
3115
+ />
3116
+ ```
3117
+
3118
+ ## Composability
3119
+ - **Built on Button.** Async state machine, loading/processing, sizes, and `fullWidth` are inherited. `variant` and `color` are managed internally — pass `appearance` instead.
3120
+ - **Tabler peer dep.** Default glyphs come from `@tabler/icons-react`. To match a provider's official multicolour mark, pass `icon={<YourSvg />}`.
3121
+ - **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.
3122
+ - **Last-used hint.** Storage is the consumer's responsibility — pass `lastUsed={user.lastProvider === 'google'}`.
3037
3123
  # Pagination
3038
3124
 
3039
3125
  - Import: @devalok/shilp-sutra/ui/pagination
@@ -28,8 +28,34 @@ Other recipes:
28
28
  - `server-components.md` — RSC-safety matrix and import patterns
29
29
  - `troubleshoot.md` — decision tree for the 8 most common breakages
30
30
 
31
+ ## The Themer (fast path for branding)
32
+
33
+ Before hand-writing CSS variables, point the user at **https://shilp-sutra.devalok.in/themer** — one funnel, four doors. Each door drops the user at a result page with install commands + a copy-pasteable CSS block (role tokens + 12-step OKLCH accent ramp) + a shareable URL.
34
+
35
+ | User context | URL |
36
+ |---|---|
37
+ | "Make it look like Linear / Stripe / Apple / Material / Notion / Vercel / Devalok" | `/themer/archetypes` |
38
+ | "Here's our brand color: `#…`" | `/themer/brand` |
39
+ | "Not sure" | `/themer/wizard` |
40
+ | "Show me a sample result" | `/themer/result?archetype=devalok` |
41
+
42
+ Paste the snippet *after* `@import "@devalok/shilp-sutra/css";` in the global stylesheet. No `tailwind.config.ts`, no theme provider, no JS bundle. Fall through to `customize-brand.md` only for tokens the Themer doesn't expose yet (font stack, spacing scale, focus ring).
43
+
31
44
  The repo URL for these files is `https://github.com/devalok-design/shilp-sutra/tree/main/packages/core/docs/recipes`. Consumer projects should also have an `AGENTS.md` at their root with the rules above pre-loaded — read that first if it exists.
32
45
 
46
+ ## NEW (v0.40.0)
47
+
48
+ - **OAuthButton.** Brand-aware social/login buttons. Subpath: `@devalok/shilp-sutra/ui/oauth-button`. 13 providers (`google` `apple` `github` `microsoft` `x` `linkedin` `facebook` `discord` `slack` `gitlab` `sso` `email` `passkey`). Props: `provider`, `intent` (`continue|signin|signup`), `appearance` (`brand|outline|dark`), `icon` (override default glyph), `iconOnly`, `compact` (renders just "Google" instead of "Continue with Google"; aria-label keeps long form), `lastUsed` (inline right-edge pill inside button), `helperText`. Inherits Button async/loading/sizes. Siblings: `OAuthGroup` (with `reorderLastUsedFirst` for Stripe-style ordering), `OAuthDivider`, `OAuthConnectionRow` (settings-page linked state). Default glyphs from Tabler peer dep; pass `icon` to drop in a brand's official multicolour SVG. In dark mode every brand appearance lands on the same DS surface — brand identity comes from the glyph, not the bg, so rows stay visually coherent.
49
+ - **Icon API unification.** Every icon-accepting prop (`startIcon`, `endIcon`, `icon`, `leftIcon`, `rightIcon`) across 22 components now takes one type: **`IconInput`**. Pass a rendered element (`<Icon icon={IconPlus} />` or `<IconPlus />`), a component ref (`IconPlus`), or any custom node — all four shapes work interchangeably. **Mostly non-breaking, one narrowing:** for the 14 components whose `icon` prop was previously `React.ReactNode`, `IconInput` excludes `string`/`number`/iterables — if you pass icons from a `Record<string, React.ReactNode>` map or `?: React.ReactNode` field, retype the source to `React.ReactElement` (`tsc`-only; affects `CommandItem.icon`, `ActivityItem.icon`, `Chat.Message.Avatar`). Helpers exported for your own wrappers: `import type { IconInput } from '@devalok/shilp-sutra/ui/lib/icon-input'` + `import { normalizeIcon } from '@devalok/shilp-sutra/ui/lib/normalize-icon'`. `IconProvider` now sizes icons via context — delete `className="h-4 w-4"` overrides.
50
+ - **Polymorphic `Text` / `Stack` / `Container`.** The `as` prop now widens accepted attributes to the rendered element: `<Text as="label" htmlFor="email">`, `<Text as="a" href="/x">`, `<Stack as="ul" role="list">`, `<Container as="main" aria-label>` all typecheck. Default element behavior unchanged.
51
+ - **Agent-friendly install experience.** `AGENTS.md` now ships in the tarball (`node_modules/@devalok/shilp-sutra/AGENTS.md`), discoverable by 25+ agent tools. `package.json` declares an `agents` field (npm-agentskills convention) so `pnpm dlx @codemcp/agentskills export` auto-installs the bundled skill. New postinstall welcome banner (silent in CI / non-TTY / `SHILP_SUTRA_NO_WELCOME=1`). `troubleshoot.md` gained peer-cliff symptom entries.
52
+ - **`llms-quick.txt`.** New ≤15K-token fast-path summary in the tarball — fits in one Read on any agent. Read order is now `llms-quick.txt` → `llms.txt` → `llms-full.txt`.
53
+ - **Companion package `@devalok/eslint-plugin-shilp-sutra`** (first release). 12 rules — deprecated-API catches, peer-cliff barrel-import detection, TW3→TW4 classname autofixes. `pnpm add -D @devalok/eslint-plugin-shilp-sutra`, then `shilpSutra.configs['flat/recommended']`. Three presets: `recommended`, `strict`, `migration` (one-shot codemod).
54
+
55
+ ## BREAKING CHANGES (v0.40.0)
56
+
57
+ - **Barrel peer-cliff cleanup.** 12 symbols that statically import optional peers were removed from their parent barrels (`/ui`, `/composed`, `/ai`, `/ai/blocks`) — they now import ONLY via per-component subpath. Affected: `Toaster`/`toast` (→ `/ui/toaster`, `/ui/toast`), `InputOTP*` (→ `/ui/input-otp`), `DatePicker*` (→ `/composed/date-picker`), `EmojiPicker*` (→ `/composed/emoji-picker`), `FilePreview` (→ `/composed/file-preview`), `MarkdownViewer` (→ `/composed/markdown-viewer`), `RichTextEditor*`/`RichChatInput*` (→ their subpaths), `BlockRenderer`/`ErrorBlock`/`TextBlock` (→ `/ai/*`). Fixes `Module not found: Can't resolve 'sonner'`/etc. at consumer build time. Full before/after table in `MIGRATION.md → v0.40.0`. Per-chart subpaths (`/ui/charts/bar-chart`, etc.) added non-breaking alongside.
58
+
33
59
  ## NEW (v0.39.0)
34
60
 
35
61
  - **Shape presets (`[data-shape]`).** Set on `<html>` (or any subtree) to re-skin roundness across the whole UI. Three ship by default: `sharp` (technical, 2/4/6 px), `slightly-rounded` (default, 6/10/16 px), `rounded` (consumer, 10/16/24 px). Pill shapes (Badge, Switch, Radio, Avatar circle) stay pill regardless.
@@ -417,7 +443,7 @@ pnpm add @devalok/shilp-sutra
417
443
 
418
444
  Add to next.config.js:
419
445
  ```js
420
- transpilePackages: ["@devalok/shilp-sutra", "@devalok/shilp-sutra-brand"]
446
+ transpilePackages: ["@devalok/shilp-sutra"]
421
447
  ```
422
448
 
423
449
  // Import components (barrel):
@@ -443,6 +469,87 @@ import { useColorMode } from '@devalok/shilp-sutra/hooks/use-color-mode'
443
469
  // CSS tokens (import once at app root — already included in /css):
444
470
  import '@devalok/shilp-sutra/css'
445
471
 
472
+ ## IMPORT PATH CHEATSHEET (don't guess — these subpaths are NOT always the kebab-case of the component name)
473
+
474
+ > **0.40.0 — barrel peer-cliff cleanup.** Components below marked `MANDATORY per-component` were removed from their parent barrel (`/ui`, `/composed`, `/ai`, `/ai/blocks`) because they statically import optional peers (`input-otp`, `sonner`, `date-fns`, `@emoji-mart/*`, `react-pdf`, `react-zoom-pan-pinch`, `react-markdown`, `remark-gfm`, `react-syntax-highlighter`, `@tiptap/*`). Fresh consumers using the barrel were getting `Module not found` at build time. The per-component subpath is now the ONLY way to import them. See MIGRATION.md → "v0.40.0 — barrel peer-cliff cleanup" for the full before/after.
475
+
476
+ Common confusions to memorize:
477
+
478
+ | Component / API | Exact import path |
479
+ |------------------------------------------------|----------------------------------------------------------------|
480
+ | `FormField`, `FormHelperText`, `useFormField` | `@devalok/shilp-sutra/ui/form` (NOT `ui/form-field`)|
481
+ | `Label` | `@devalok/shilp-sutra/ui/label` |
482
+ | `AppSidebar` | `@devalok/shilp-sutra/shell/sidebar` (NOT `shell/app-sidebar`)|
483
+ | `TopBar`, `TopBar.*` | `@devalok/shilp-sutra/shell/top-bar` |
484
+ | `BottomNavbar` | `@devalok/shilp-sutra/shell/bottom-navbar` |
485
+ | `AppCommandPalette` | `@devalok/shilp-sutra/shell/app-command-palette` |
486
+ | `CommandRegistryProvider`, `useCommandRegistry`| `@devalok/shilp-sutra/shell/command-registry` |
487
+ | `NotificationCenter` | `@devalok/shilp-sutra/shell/notification-center` |
488
+ | `NotificationPreferences` | `@devalok/shilp-sutra/shell/notification-preferences` |
489
+ | `LinkProvider`, `useLink` | `@devalok/shilp-sutra/shell/link-context` |
490
+ | `CommandPalette` (lower-level palette) | `@devalok/shilp-sutra/composed/command-palette` |
491
+ | `BarChart`, `LineChart`, `AreaChart`, `PieChart`, `RadarChart`, `GaugeChart`, `Sparkline`, `ChartContainer`, `Legend` | `@devalok/shilp-sutra/ui/charts` (full barrel, pulls all 9 d3-\* peers) — **prefer per-chart subpath when possible: `/ui/charts/bar-chart`, `/ui/charts/line-chart`, `/ui/charts/area-chart`, `/ui/charts/pie-chart`, `/ui/charts/radar-chart`, `/ui/charts/gauge-chart`, `/ui/charts/sparkline`, `/ui/charts/chart-container`** (each pulls only the d3-\* peers it needs — BarChart needs `d3-scale` + `d3-axis` + `d3-selection`; PieChart/RadarChart need only `d3-shape`) |
492
+ | `DataTable` | `@devalok/shilp-sutra/ui/data-table` |
493
+ | `DataTableToolbar` | `@devalok/shilp-sutra/ui/data-table-toolbar` |
494
+ | `DatePicker`, `DateRangePicker`, `DateTimePicker`, `TimePicker`, `CalendarGrid`, `YearPicker`, `MonthPicker`, `Presets`, `useCalendar` | `@devalok/shilp-sutra/composed/date-picker` **MANDATORY per-component (0.40.0+)** — pulls `date-fns` |
495
+ | `Toaster` | `@devalok/shilp-sutra/ui/toaster` **MANDATORY per-component (0.40.0+)** — pulls `sonner` |
496
+ | `toast` | `@devalok/shilp-sutra/ui/toast` **MANDATORY per-component (0.40.0+)** — pulls `sonner` |
497
+ | `InputOTP`, `InputOTPGroup`, `InputOTPSeparator`, `InputOTPSlot` | `@devalok/shilp-sutra/ui/input-otp` **MANDATORY per-component (0.40.0+)** — pulls `input-otp` |
498
+ | `EmojiPicker`, `EmojiPickerPopover`, `EmojiData`, `EmojiSet` | `@devalok/shilp-sutra/composed/emoji-picker` **MANDATORY per-component (0.40.0+)** — pulls `@emoji-mart/data` + `@emoji-mart/react` |
499
+ | `EmojiNode`, `EmojiNodeAttrs` | `@devalok/shilp-sutra/composed/extensions/emoji-node` **MANDATORY per-component (0.40.0+)** — pulls `@tiptap/*` |
500
+ | `createEmojiSuggestion` | `@devalok/shilp-sutra/composed/extensions/emoji-suggestion` **MANDATORY per-component (0.40.0+)** — pulls `@tiptap/*` |
501
+ | `FilePreview`, `FilePreviewProps` | `@devalok/shilp-sutra/composed/file-preview` **MANDATORY per-component (0.40.0+)** — pulls `react-pdf` + `react-zoom-pan-pinch` |
502
+ | `MarkdownViewer` | `@devalok/shilp-sutra/composed/markdown-viewer` **MANDATORY per-component (0.40.0+)** — pulls `react-markdown` + `react-syntax-highlighter` + `remark-gfm` |
503
+ | `RichChatInput`, `AudioPlayer`, `AudioWaveform`, `useVoiceRecorder` | `@devalok/shilp-sutra/composed/rich-chat-input` **MANDATORY per-component (0.40.0+)** — pulls `@tiptap/*` |
504
+ | `RichTextEditor`, `RichTextViewer`, `MentionItem`, `ToolbarItem` | `@devalok/shilp-sutra/composed/rich-text-editor` **MANDATORY per-component (0.40.0+)** — pulls `@tiptap/*` |
505
+ | `MessageList`, `Message`, `SystemMessage`, `MessageInput`, `DateSeparator`, `UnreadSeparator`, `TypingIndicator` | `@devalok/shilp-sutra/ui/chat` |
506
+ | `CommandBar` | `@devalok/shilp-sutra/ai/command-bar` (also re-exported from `/ai`) |
507
+ | `AIConversation` | `@devalok/shilp-sutra/ai/conversation` |
508
+ | `BlockRenderer` | `@devalok/shilp-sutra/ai/block-renderer` **MANDATORY per-component (0.40.0+)** — transitively pulls `react-markdown` + `remark-gfm` via ErrorBlock/TextBlock |
509
+ | `AICommandProvider` | `@devalok/shilp-sutra/ai/ai-command-provider` |
510
+ | `DevadootIcon` | `@devalok/shilp-sutra/ai` |
511
+ | `ErrorBlock` | `@devalok/shilp-sutra/ai/blocks/error` **MANDATORY per-component (0.40.0+)** — pulls `react-markdown` + `remark-gfm` |
512
+ | `TextBlock` | `@devalok/shilp-sutra/ai/blocks/text` **MANDATORY per-component (0.40.0+)** — pulls `react-markdown` + `remark-gfm` |
513
+ | `BlockTable`, `ConfirmBlock`, `DividerBlock`, `InfoBlock`, `LoadingBlock`, `StatRowBlock`, `SuccessBlock` | `@devalok/shilp-sutra/ai/blocks` (barrel — these 7 are peer-cliff-free) |
514
+ | `useColorMode` | `@devalok/shilp-sutra/hooks/use-color-mode` |
515
+ | `useMobile` | `@devalok/shilp-sutra/hooks/use-mobile` |
516
+ | `MotionProvider`, `springs`, `tweens`, `stagger`, `useMotion` | `@devalok/shilp-sutra/motion` |
517
+ | `MotionFade`, `MotionScale`, `MotionPop`, `MotionSlide`, `MotionCollapse`, `MotionStagger`, `MotionStaggerItem` | `@devalok/shilp-sutra/motion/primitives` |
518
+
519
+ Components named directly after their file (`Button` → `ui/button`, `Card` → `ui/card`, `Avatar` → `ui/avatar`, `Stack` → `ui/stack`, `Text` → `ui/text`, etc.) follow the kebab-case-of-name rule. The table above is for the ones that DON'T.
520
+
521
+ **When in doubt:** `cat node_modules/@devalok/shilp-sutra/package.json | jq '.exports | keys'` lists every available subpath in the installed version.
522
+
523
+ ## ICON API — one shape across every component (v0.40.0+)
524
+
525
+ Every icon-accepting prop in the design system (`startIcon`, `endIcon`, `icon`, etc. — see list below) takes the **`IconInput`** type. Pass any of these four shapes interchangeably:
526
+
527
+ ```tsx
528
+ import { IconPlus } from '@tabler/icons-react'
529
+ import { Icon } from '@devalok/shilp-sutra/ui/icon'
530
+
531
+ <Button startIcon={<Icon icon={IconPlus} />}>Add</Button> // canonical
532
+ <Button startIcon={<IconPlus />}>Add</Button> // raw Tabler element
533
+ <Button startIcon={IconPlus}>Add</Button> // component ref
534
+ <Button startIcon={<span>+</span>}>Add</Button> // custom node
535
+ ```
536
+
537
+ All four work identically at the call site. The component wraps its icon slot in `<IconProvider size={...}>` so size + stroke flow via React context — no `className="h-4 w-4"` overrides needed.
538
+
539
+ **Upgrading 0.39→0.40 — one narrowing:** `IconInput` (`ReactElement | ComponentType | null | undefined`) excludes `string`/`number`/iterables that `React.ReactNode` allows. The 14 components previously typed `React.ReactNode` (Combobox, Stepper, TreeItem, OAuthButton, AppCommandPalette, CommandRegistry, BottomNavbar, Sidebar nav items, TopBar, Chat.Message.Avatar, SystemMessage, AIConversation, ActivityFeed, CommandPalette) now accept less. If you feed them icons from a `Record<string, React.ReactNode>` map or `?: React.ReactNode` field, `tsc` fails — retype the source to `React.ReactElement`. Build-time only; runtime JSX is unaffected.
540
+
541
+ **Components on the unified API:** Button, IconButton, Badge, Combobox, SegmentedControl, Stepper, StatCard, TreeItem (TreeNode.icon), OAuthButton (icon + linkedIcon), Chat.Message.Avatar, Chat.Message.Action, Chat.SystemMessage, AIConversation (agent.icon), AICommandProvider (agent.icon), CommandBar (item.icon), EmptyState (kills the dual ReactNode|ComponentType signature), BulkActionBar (action.icon), ActivityFeed (item.icon), CommandPalette (item.icon), TopBar (UserMenuItem.icon, TopBar.IconButton.icon), Sidebar (NavItem.icon, NavSubItem.icon, footer.promo.icon), BottomNavbar (item.icon), AppCommandPalette (SearchResult.icon), CommandRegistry (CommandPageItem.icon).
542
+
543
+ **Internals** (`<Toaster>`, `<Toast>`'s success/error icons) use Sonner's own type contract and don't accept consumer-passed icons — that's by design.
544
+
545
+ **When to use which shape:**
546
+ - `<Icon icon={IconX} />` when you want explicit size/stroke control (size flows from context if not set)
547
+ - `<IconX />` when you trust the surrounding `IconProvider` and don't need stroke control
548
+ - `IconX` (raw ref) when you want the helper to do the wrapping for you (auto-wraps to `<Icon icon={IconX} />`)
549
+ - Custom node when the "icon" is actually `<span>$</span>` or an emoji
550
+
551
+ **Migration:** zero consumer changes needed if you were already passing valid React content. Components that previously took strict `IconProps['icon']` (BulkActionBar, Message.Action) or `ComponentType<{className}>` (SegmentedControl) now also accept the other three shapes. Strict-to-loose type widening — no breaking calls.
552
+
446
553
  ## CRITICAL: Differences from shadcn/ui
447
554
 
448
555
  If you have shadcn/ui knowledge, these are the differences that WILL trip you up:
@@ -480,7 +587,7 @@ Components with two-axis system: Button, Badge, Alert, Banner, Progress, StatusB
480
587
 
481
588
  ### Inputs & Controls
482
589
  - Button: variant(solid|soft|outline|ghost|link) color(accent|error|success|warning|neutral) size(xs|sm|md|lg|compact-xs|compact-sm|compact-md|icon-xs|icon-sm|icon-md|icon-lg) shape(default|pill) weight(semibold|normal) + loading, startIcon, endIcon, asChild, processing?('ambient'|'working'|'urgent'|boolean — marching ants SVG border, forces soft variant), processingColor?('accent'|'error'|'success'|'warning'|'neutral'), processingDisabled?(boolean, default true — set false for cancel-by-click). onClickAsync auto-activates processing='working' during loading phase. Layout animation always on. Deprecated aliases still work: variant="default"→solid, variant="destructive"→solid+error, color="default"→accent
483
- - IconButton: icon(ReactNode, required) shape(square|circle) size(sm|md|lg) + aria-label required
590
+ - IconButton: icon(ReactNode, required as PROP — NOT children) shape(square|circle) size(sm|md|lg) + aria-label required. **Children rejected by type** (`Omit<ButtonProps, 'children'>`); pass the icon via `icon=` prop. Correct: `<IconButton icon={<Icon icon={IconArrowRight} />} aria-label="Submit" />`. Wrong: `<IconButton><Icon icon={IconArrowRight} /></IconButton>` (TS error). Wrap with `<Icon icon={…} />` (not raw Tabler `<IconX />`) so the size context cascades.
484
591
  - SplitButton: [Action | ▼] button with dropdown. Props: variant(solid|soft|outline), color, size(xs|sm|md|icon-xs|icon-sm|icon-md), triggerSide(left|right, default right), triggerWidth?(number|string), placement?(Floating UI Placement, default top-end), dropdownContent(ReactNode), open?, onOpenChange?, dropdownLabel?, dropdownIcon?. ARIA: role="group", aria-haspopup="menu", aria-expanded.
485
592
  - ButtonGroup: Visually merges adjacent Buttons. Props: variant, color, size, disabled (propagates), orientation(horizontal|vertical), attached(true|false, default true), fullWidth. Compound pattern: Button reads position from context, applies radius + border-removal inline. Tonal dividers for solid/soft/ghost. Focus z-index isolation.
486
593
  - Icon: `<Icon icon={IconPlus} />` — context-aware wrapper for Tabler icons. Size tiers: xs(14px) sm(16px) md(18px) lg(20px) xl(24px) 2xl(32px). Default: md. Stroke: light(1.5) regular(2) bold(2.5). Default: regular. Scales per size tier. Reads size from parent Button/IconGroup via IconContext. Explicit props override. Accessibility: aria-hidden by default. Pass label="Add item" for accessible icons. Animation: animate="spin|pulse|bounce|draw". `draw` renders SVG path-draw animation (check/X icons draw progressively via pathLength; other icons fall back to static). State machine: state="idle|loading|success|error". Button integration: startIcon={<Icon icon={IconPlus} />} (NOT raw <IconPlus />). IconGroup: <IconGroup size="sm" gap="tight"> for toolbar patterns.
@@ -638,7 +745,7 @@ Import: `@devalok/shilp-sutra/ui/chat`
638
745
  - Old Fade/Collapse/Grow/Slide from @devalok/shilp-sutra/ui/transitions are REMOVED — use Motion* equivalents
639
746
 
640
747
  ### Hooks
641
- - toast: imperative API — import { toast } from '@devalok/shilp-sutra/ui/toast'. Methods: toast.success/error/warning/info/loading/message/undo/promise/upload/custom/dismiss. useToast() is deprecated.
748
+ - toast: imperative API — import { toast } from '@devalok/shilp-sutra/ui/toast'. **Signature is `(message: string, options?: { description?, duration?, action?, … })`** (sonner-style positional, NOT object-first). Examples: `toast.success('Saved')`, `toast.error('Failed to fetch', { description: 'Check your network', duration: 7000 })`, `toast.promise(fn, { loading: '…', success: '…', error: '…' })`, `toast.upload(file, { onProgress, onComplete })`. Methods: toast.success/error/warning/info/loading/message/undo/promise/upload/custom/dismiss. useToast() is deprecated. Mount `<Toaster />` at layout root or `toast()` calls are no-ops + log a dev warning.
642
749
  - useColorMode(): returns { colorMode, setColorMode, toggleColorMode }
643
750
  - useMobile(): returns boolean (true if viewport < 768px)
644
751
  - useLink(): returns router-agnostic Link component from LinkProvider context (shell/link-context)
@@ -4,6 +4,21 @@
4
4
 
5
5
  Override colors, radius, fonts, and spacing without forking the package. All customization happens through CSS custom properties — no JS configuration.
6
6
 
7
+ ## The fast path: use the Themer
8
+
9
+ Before hand-writing variables, try **[shilp-sutra.devalok.in/themer](https://shilp-sutra.devalok.in/themer)**. It is one funnel with four entry doors:
10
+
11
+ - **Pick an archetype** — Linear, Stripe, Apple, Material, Notion, Vercel, or Devalok. Click → result page.
12
+ - **Use my brand color** — paste a hex or dial OKLCH. Auto-generates the 12-step ramp and suggests an archetype.
13
+ - **Walk me through it** — five-question wizard composes the answers into a theme.
14
+ - **Just exploring** — land on a sample result page to see what you ship away with.
15
+
16
+ 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.
17
+
18
+ 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.
19
+
20
+ 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.
21
+
7
22
  ## How tokens layer
8
23
 
9
24
  Shilp Sutra's tokens are organized in three tiers: