@devalok/shilp-sutra 0.30.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +82 -239
  2. package/dist/_chunks/badge-group.js +123 -171
  3. package/dist/_chunks/document-preview.js +92 -0
  4. package/dist/_chunks/file-preview.js +511 -0
  5. package/dist/_chunks/image-preview.js +90 -0
  6. package/dist/_chunks/primitives.js +109 -109
  7. package/dist/_chunks/stat-row.js +144 -124
  8. package/dist/_chunks/use-calendar.js +558 -490
  9. package/dist/ai/block-renderer.d.ts +2 -1
  10. package/dist/ai/block-renderer.d.ts.map +1 -1
  11. package/dist/ai/block-renderer.js +30 -29
  12. package/dist/ai/blocks/block-table.d.ts.map +1 -1
  13. package/dist/ai/blocks/confirm.d.ts.map +1 -1
  14. package/dist/ai/blocks/divider.d.ts.map +1 -1
  15. package/dist/ai/blocks/error.d.ts.map +1 -1
  16. package/dist/ai/blocks/info.d.ts.map +1 -1
  17. package/dist/ai/blocks/loading.d.ts.map +1 -1
  18. package/dist/ai/blocks/stat-row.d.ts.map +1 -1
  19. package/dist/ai/blocks/success.d.ts.map +1 -1
  20. package/dist/ai/blocks/text.d.ts.map +1 -1
  21. package/dist/ai/command-bar.d.ts +18 -0
  22. package/dist/ai/command-bar.d.ts.map +1 -1
  23. package/dist/ai/command-bar.js +126 -125
  24. package/dist/ai/conversation.d.ts +13 -1
  25. package/dist/ai/conversation.d.ts.map +1 -1
  26. package/dist/ai/conversation.js +78 -78
  27. package/dist/ai/types.d.ts +0 -1
  28. package/dist/ai/types.d.ts.map +1 -1
  29. package/dist/ai/types.js +1 -0
  30. package/dist/composed/bulk-action-bar.d.ts +6 -4
  31. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  32. package/dist/composed/bulk-action-bar.js +102 -58
  33. package/dist/composed/command-palette.d.ts +9 -0
  34. package/dist/composed/command-palette.d.ts.map +1 -1
  35. package/dist/composed/command-palette.js +68 -68
  36. package/dist/composed/confirm-dialog.d.ts +1 -1
  37. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  38. package/dist/composed/confirm-dialog.js +10 -10
  39. package/dist/composed/content-card.d.ts.map +1 -1
  40. package/dist/composed/date-picker/date-picker.d.ts +11 -1
  41. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  42. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  43. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  44. package/dist/composed/deadline-indicator.d.ts +1 -1
  45. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  46. package/dist/composed/deadline-indicator.js +39 -36
  47. package/dist/composed/emoji-picker.d.ts +6 -0
  48. package/dist/composed/emoji-picker.d.ts.map +1 -1
  49. package/dist/composed/emoji-picker.js +22 -20
  50. package/dist/composed/error-boundary.d.ts +21 -1
  51. package/dist/composed/error-boundary.d.ts.map +1 -1
  52. package/dist/composed/error-boundary.js +47 -32
  53. package/dist/composed/file-preview/audio-preview.d.ts +7 -0
  54. package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
  55. package/dist/composed/file-preview/document-preview.d.ts +7 -0
  56. package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
  57. package/dist/composed/file-preview/embed-preview.d.ts +7 -0
  58. package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
  59. package/dist/composed/file-preview/image-preview.d.ts +7 -0
  60. package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
  61. package/dist/composed/file-preview/shared.d.ts +20 -0
  62. package/dist/composed/file-preview/shared.d.ts.map +1 -0
  63. package/dist/composed/file-preview/video-preview.d.ts +6 -0
  64. package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
  65. package/dist/composed/file-preview.d.ts.map +1 -1
  66. package/dist/composed/file-preview.js +10 -662
  67. package/dist/composed/filter-bar.d.ts +10 -2
  68. package/dist/composed/filter-bar.d.ts.map +1 -1
  69. package/dist/composed/filter-bar.js +42 -43
  70. package/dist/composed/form-section.d.ts +1 -1
  71. package/dist/composed/form-section.d.ts.map +1 -1
  72. package/dist/composed/form-section.js +22 -21
  73. package/dist/composed/index.d.ts +2 -2
  74. package/dist/composed/index.d.ts.map +1 -1
  75. package/dist/composed/index.js +58 -57
  76. package/dist/composed/inline-edit.d.ts +1 -1
  77. package/dist/composed/inline-edit.d.ts.map +1 -1
  78. package/dist/composed/inline-edit.js +33 -32
  79. package/dist/composed/lib/string-utils.d.ts.map +1 -1
  80. package/dist/composed/loading-skeleton.d.ts.map +1 -1
  81. package/dist/composed/markdown-viewer.d.ts +1 -1
  82. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  83. package/dist/composed/markdown-viewer.js +60 -59
  84. package/dist/composed/master-detail.d.ts +11 -7
  85. package/dist/composed/master-detail.d.ts.map +1 -1
  86. package/dist/composed/master-detail.js +123 -84
  87. package/dist/composed/page-header.d.ts.map +1 -1
  88. package/dist/composed/page-skeletons.d.ts.map +1 -1
  89. package/dist/composed/priority-indicator.d.ts +1 -0
  90. package/dist/composed/priority-indicator.js +1 -0
  91. package/dist/composed/responsive-overlay.d.ts +8 -0
  92. package/dist/composed/responsive-overlay.d.ts.map +1 -1
  93. package/dist/composed/rich-text-editor.d.ts +11 -3
  94. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  95. package/dist/composed/rich-text-editor.js +21 -20
  96. package/dist/composed/schedule-view.d.ts +9 -1
  97. package/dist/composed/schedule-view.d.ts.map +1 -1
  98. package/dist/hooks/index.d.ts +2 -0
  99. package/dist/hooks/index.d.ts.map +1 -1
  100. package/dist/hooks/index.js +8 -4
  101. package/dist/hooks/use-touch-device.d.ts +12 -0
  102. package/dist/hooks/use-touch-device.d.ts.map +1 -0
  103. package/dist/hooks/use-touch-device.js +13 -0
  104. package/dist/hooks/use-viewport-height.d.ts +11 -0
  105. package/dist/hooks/use-viewport-height.d.ts.map +1 -0
  106. package/dist/hooks/use-viewport-height.js +16 -0
  107. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  108. package/dist/shell/bottom-navbar.js +72 -63
  109. package/dist/shell/command-registry.d.ts.map +1 -1
  110. package/dist/shell/notification-center.d.ts.map +1 -1
  111. package/dist/shell/notification-center.js +77 -77
  112. package/dist/shell/top-bar.d.ts +2 -2
  113. package/dist/shell/top-bar.d.ts.map +1 -1
  114. package/dist/shell/top-bar.js +61 -60
  115. package/dist/tailwind/index.cjs +51 -7
  116. package/dist/tailwind/preset.d.ts.map +1 -1
  117. package/dist/tailwind/preset.js +51 -7
  118. package/dist/tokens/primitives.css +3 -1
  119. package/dist/tokens/semantic.css +16 -13
  120. package/dist/tokens/typography.css +33 -4
  121. package/dist/ui/alert.d.ts +1 -0
  122. package/dist/ui/alert.d.ts.map +1 -1
  123. package/dist/ui/alert.js +42 -37
  124. package/dist/ui/autocomplete.d.ts.map +1 -1
  125. package/dist/ui/autocomplete.js +38 -39
  126. package/dist/ui/badge.d.ts +110 -2
  127. package/dist/ui/badge.d.ts.map +1 -1
  128. package/dist/ui/banner.d.ts.map +1 -1
  129. package/dist/ui/banner.js +8 -7
  130. package/dist/ui/button.d.ts +2 -2
  131. package/dist/ui/button.d.ts.map +1 -1
  132. package/dist/ui/button.js +54 -74
  133. package/dist/ui/card.d.ts +5 -1
  134. package/dist/ui/card.d.ts.map +1 -1
  135. package/dist/ui/card.js +111 -79
  136. package/dist/ui/charts/area-chart.d.ts +2 -0
  137. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  138. package/dist/ui/charts/bar-chart.d.ts +2 -0
  139. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  140. package/dist/ui/charts/chart-container.d.ts +2 -0
  141. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  142. package/dist/ui/charts/index.js +583 -577
  143. package/dist/ui/charts/line-chart.d.ts +2 -0
  144. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  145. package/dist/ui/charts/pie-chart.d.ts +2 -0
  146. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  147. package/dist/ui/charts/radar-chart.d.ts +2 -0
  148. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  149. package/dist/ui/checkbox.d.ts +2 -0
  150. package/dist/ui/checkbox.d.ts.map +1 -1
  151. package/dist/ui/checkbox.js +36 -27
  152. package/dist/ui/code.d.ts.map +1 -1
  153. package/dist/ui/color-input.js +5 -5
  154. package/dist/ui/combobox.d.ts +6 -1
  155. package/dist/ui/combobox.d.ts.map +1 -1
  156. package/dist/ui/combobox.js +1 -1
  157. package/dist/ui/container.d.ts.map +1 -1
  158. package/dist/ui/context-menu.js +1 -1
  159. package/dist/ui/data-table-body.d.ts +12 -0
  160. package/dist/ui/data-table-body.d.ts.map +1 -0
  161. package/dist/ui/data-table-body.js +219 -0
  162. package/dist/ui/data-table-bulk-actions.d.ts +19 -0
  163. package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
  164. package/dist/ui/data-table-bulk-actions.js +61 -0
  165. package/dist/ui/data-table-card.d.ts +9 -0
  166. package/dist/ui/data-table-card.d.ts.map +1 -0
  167. package/dist/ui/data-table-card.js +73 -0
  168. package/dist/ui/data-table-context.d.ts +62 -0
  169. package/dist/ui/data-table-context.d.ts.map +1 -0
  170. package/dist/ui/data-table-context.js +48 -0
  171. package/dist/ui/data-table-header.d.ts +10 -0
  172. package/dist/ui/data-table-header.d.ts.map +1 -0
  173. package/dist/ui/data-table-header.js +141 -0
  174. package/dist/ui/data-table-pagination.d.ts +13 -0
  175. package/dist/ui/data-table-pagination.d.ts.map +1 -0
  176. package/dist/ui/data-table-pagination.js +84 -0
  177. package/dist/ui/data-table.d.ts +11 -9
  178. package/dist/ui/data-table.d.ts.map +1 -1
  179. package/dist/ui/data-table.js +258 -573
  180. package/dist/ui/dialog.d.ts +6 -2
  181. package/dist/ui/dialog.d.ts.map +1 -1
  182. package/dist/ui/dialog.js +84 -82
  183. package/dist/ui/dropdown-menu.js +1 -1
  184. package/dist/ui/hover-card.d.ts +7 -0
  185. package/dist/ui/hover-card.d.ts.map +1 -1
  186. package/dist/ui/hover-card.js +3 -3
  187. package/dist/ui/icon-group.d.ts +2 -4
  188. package/dist/ui/icon-group.d.ts.map +1 -1
  189. package/dist/ui/icon-group.js +22 -23
  190. package/dist/ui/index.d.ts +1 -2
  191. package/dist/ui/index.d.ts.map +1 -1
  192. package/dist/ui/index.js +94 -99
  193. package/dist/ui/label.js +1 -1
  194. package/dist/ui/lib/bottom-sheet.d.ts +16 -0
  195. package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
  196. package/dist/ui/lib/date-utils.d.ts.map +1 -1
  197. package/dist/ui/lib/motion.d.ts.map +1 -1
  198. package/dist/ui/lib/utils.d.ts.map +1 -1
  199. package/dist/ui/menubar.d.ts.map +1 -1
  200. package/dist/ui/menubar.js +64 -73
  201. package/dist/ui/navigation-menu.d.ts.map +1 -1
  202. package/dist/ui/navigation-menu.js +40 -44
  203. package/dist/ui/number-input.d.ts.map +1 -1
  204. package/dist/ui/number-input.js +19 -17
  205. package/dist/ui/popover.d.ts.map +1 -1
  206. package/dist/ui/popover.js +107 -32
  207. package/dist/ui/progress-ring.d.ts.map +1 -1
  208. package/dist/ui/progress-ring.js +80 -80
  209. package/dist/ui/progress.js +4 -4
  210. package/dist/ui/radio.d.ts +5 -2
  211. package/dist/ui/radio.d.ts.map +1 -1
  212. package/dist/ui/radio.js +29 -20
  213. package/dist/ui/search-input.d.ts.map +1 -1
  214. package/dist/ui/search-input.js +13 -12
  215. package/dist/ui/segmented-control.d.ts +6 -108
  216. package/dist/ui/segmented-control.d.ts.map +1 -1
  217. package/dist/ui/segmented-control.js +86 -272
  218. package/dist/ui/select.d.ts +3 -1
  219. package/dist/ui/select.d.ts.map +1 -1
  220. package/dist/ui/select.js +83 -71
  221. package/dist/ui/separator.js +5 -5
  222. package/dist/ui/sheet.d.ts +2 -0
  223. package/dist/ui/sheet.d.ts.map +1 -1
  224. package/dist/ui/sheet.js +102 -84
  225. package/dist/ui/sidebar.d.ts.map +1 -1
  226. package/dist/ui/sidebar.js +200 -175
  227. package/dist/ui/skeleton.d.ts.map +1 -1
  228. package/dist/ui/slider.js +14 -14
  229. package/dist/ui/stack.d.ts.map +1 -1
  230. package/dist/ui/status-dot.js +8 -8
  231. package/dist/ui/stepper.d.ts.map +1 -1
  232. package/dist/ui/stepper.js +33 -31
  233. package/dist/ui/switch.js +3 -3
  234. package/dist/ui/table.d.ts.map +1 -1
  235. package/dist/ui/tabs.d.ts +7 -0
  236. package/dist/ui/tabs.d.ts.map +1 -1
  237. package/dist/ui/tabs.js +102 -76
  238. package/dist/ui/text.d.ts.map +1 -1
  239. package/dist/ui/toast-types.d.ts +0 -1
  240. package/dist/ui/toast-types.d.ts.map +1 -1
  241. package/dist/ui/toast-types.js +0 -1
  242. package/dist/ui/toast.d.ts.map +1 -1
  243. package/dist/ui/toast.js +156 -150
  244. package/dist/ui/toggle-group.js +1 -1
  245. package/dist/ui/toggle.js +1 -1
  246. package/dist/ui/tooltip.js +3 -3
  247. package/dist/ui/visually-hidden.d.ts.map +1 -1
  248. package/docs/components/ui/alert.md +3 -0
  249. package/docs/components/ui/badge.md +3 -0
  250. package/docs/components/ui/card.md +4 -0
  251. package/docs/components/ui/data-table-body.md +13 -0
  252. package/docs/components/ui/data-table-bulk-actions.md +13 -0
  253. package/docs/components/ui/data-table-card.md +13 -0
  254. package/docs/components/ui/data-table-context.md +13 -0
  255. package/docs/components/ui/data-table-header.md +13 -0
  256. package/docs/components/ui/data-table-pagination.md +13 -0
  257. package/docs/components/ui/select.md +4 -0
  258. package/docs/components/ui/tabs.md +4 -0
  259. package/llms-full.txt +97 -48
  260. package/llms.txt +46 -1
  261. package/package.json +37 -7
  262. package/dist/ui/chip.d.ts +0 -19
  263. package/dist/ui/chip.d.ts.map +0 -1
  264. package/dist/ui/chip.js +0 -14
  265. package/dist/ui/lib/use-ripple.d.ts +0 -14
  266. package/dist/ui/lib/use-ripple.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,239 +1,82 @@
1
- # @devalok/shilp-sutra
2
-
3
- Devalok Design System -- tokens, components, and patterns for React & Next.js.
4
-
5
- [![npm](https://img.shields.io/npm/v/@devalok/shilp-sutra)](https://www.npmjs.com/package/@devalok/shilp-sutra)
6
- [![Storybook](https://img.shields.io/badge/Storybook-ff4785?logo=storybook&logoColor=white)](https://devalok-design.github.io/shilp-sutra/)
7
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8
-
9
- ---
10
-
11
- ## Quick Setup
12
-
13
- ### 1. Install
14
-
15
- ```bash
16
- pnpm add @devalok/shilp-sutra
17
- ```
18
-
19
- ### 2. Add Tailwind Preset
20
-
21
- ```ts
22
- // tailwind.config.ts
23
- import shilpSutra from '@devalok/shilp-sutra/tailwind'
24
-
25
- export default {
26
- presets: [shilpSutra],
27
- content: [
28
- './app/**/*.{ts,tsx}',
29
- './node_modules/@devalok/shilp-sutra/dist/**/*.js',
30
- ],
31
- }
32
- ```
33
-
34
- ### 3. Import Tokens
35
-
36
- ```tsx
37
- // app/layout.tsx (Next.js) or main entry point
38
- import '@devalok/shilp-sutra/tokens'
39
- import './globals.css'
40
- ```
41
-
42
- Done. Start using components.
43
-
44
- ---
45
-
46
- ## Import Patterns
47
-
48
- ### Per-component import (recommended)
49
-
50
- Best for tree-shaking, Server Components, and fast builds:
51
-
52
- ```tsx
53
- import { Button } from '@devalok/shilp-sutra/ui/button'
54
- import { Dialog } from '@devalok/shilp-sutra/ui/dialog'
55
- import { DatePicker } from '@devalok/shilp-sutra/composed/date-picker'
56
- import { TopBar } from '@devalok/shilp-sutra/shell/top-bar'
57
- ```
58
-
59
- ### Barrel import
60
-
61
- Convenient for client components that use many primitives:
62
-
63
- ```tsx
64
- import { Button, Dialog, Input, Badge } from '@devalok/shilp-sutra/ui'
65
- import { PageHeader, DatePicker } from '@devalok/shilp-sutra/composed'
66
- import { AppSidebar, TopBar } from '@devalok/shilp-sutra/shell'
67
- ```
68
-
69
- ### Root import
70
-
71
- Shorthand for UI components only:
72
-
73
- ```tsx
74
- import { Button, Input } from '@devalok/shilp-sutra'
75
- ```
76
-
77
- ---
78
-
79
- ## Mental Model
80
-
81
- The design system is organized into three tiers:
82
-
83
- | Layer | Import | What it contains |
84
- |-------|--------|------------------|
85
- | **ui** | `@devalok/shilp-sutra/ui` | 60+ atomic primitives -- buttons, inputs, dialogs, cards, tables, badges, charts, navigation menus |
86
- | **composed** | `@devalok/shilp-sutra/composed` | 14 multi-component patterns -- date picker, rich text editor, command palette, page header, skeletons |
87
- | **shell** | `@devalok/shilp-sutra/shell` | 7 app-level layout components -- sidebar, top bar, bottom navbar, notification center, command palette |
88
-
89
- Additional exports:
90
-
91
- | Import | Contents |
92
- |--------|----------|
93
- | `@devalok/shilp-sutra/tokens` | CSS custom properties (primitives, semantic, typography) |
94
- | `@devalok/shilp-sutra/tailwind` | Tailwind CSS preset with all design tokens |
95
- | `@devalok/shilp-sutra/hooks` | `useToast`, `useColorMode`, `useIsMobile` |
96
- | `@devalok/shilp-sutra/fonts/*` | Inter and Ranade variable fonts (WOFF2) |
97
-
98
- ---
99
-
100
- ## Peer Dependencies
101
-
102
- ### Required
103
-
104
- | Package | Version |
105
- |---------|---------|
106
- | `react` | `^18 \|\| ^19` |
107
- | `react-dom` | `^18 \|\| ^19` |
108
-
109
- ### Optional
110
-
111
- Install only what you use:
112
-
113
- | Feature | Packages |
114
- |---------|----------|
115
- | Charts (`./ui/charts`) | `d3-array`, `d3-axis`, `d3-format`, `d3-interpolate`, `d3-scale`, `d3-selection`, `d3-shape`, `d3-time-format`, `d3-transition` |
116
- | Rich Text Editor (`./composed/rich-text-editor`) | `@tiptap/react`, `@tiptap/starter-kit`, `@tiptap/extension-placeholder` |
117
- | DataTable (`./ui/data-table`) | `@tanstack/react-table`, `@tanstack/react-virtual` |
118
- | Icons (various components) | `@tabler/icons-react` |
119
- | Date components (`./composed/date-picker`) | `date-fns` |
120
- | OTP Input (`./ui/input-otp`) | `input-otp` |
121
- | Markdown rendering | `react-markdown` |
122
-
123
- Example -- install only charts deps:
124
-
125
- ```bash
126
- pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition
127
- ```
128
-
129
- ---
130
-
131
- ## Server-Safe Components
132
-
133
- These components work in React Server Components when imported via their per-component path. They do **not** include `"use client"` directives:
134
-
135
- ### ui
136
-
137
- | Component | Import |
138
- |-----------|--------|
139
- | Text | `@devalok/shilp-sutra/ui/text` |
140
- | Skeleton | `@devalok/shilp-sutra/ui/skeleton` |
141
- | Spinner | `@devalok/shilp-sutra/ui/spinner` |
142
- | Stack | `@devalok/shilp-sutra/ui/stack` |
143
- | Container | `@devalok/shilp-sutra/ui/container` |
144
- | Table | `@devalok/shilp-sutra/ui/table` |
145
- | Code | `@devalok/shilp-sutra/ui/code` |
146
- | VisuallyHidden | `@devalok/shilp-sutra/ui/visually-hidden` |
147
-
148
- ### composed
149
-
150
- | Component | Import |
151
- |-----------|--------|
152
- | ContentCard | `@devalok/shilp-sutra/composed/content-card` |
153
- | EmptyState | `@devalok/shilp-sutra/composed/empty-state` |
154
- | PageHeader | `@devalok/shilp-sutra/composed/page-header` |
155
- | LoadingSkeleton | `@devalok/shilp-sutra/composed/loading-skeleton` |
156
- | PageSkeletons | `@devalok/shilp-sutra/composed/page-skeletons` |
157
- | PriorityIndicator | `@devalok/shilp-sutra/composed/priority-indicator` |
158
- | StatusBadge | `@devalok/shilp-sutra/composed/status-badge` |
159
-
160
- All other components require client-side React and include `"use client"`.
161
-
162
- ---
163
-
164
- ## Dark Mode
165
-
166
- The design system uses CSS custom properties with a `.dark` class toggle. All semantic tokens have dark mode overrides built in.
167
-
168
- ### Setup
169
-
170
- Add the `.dark` class to your `<html>` or a parent element:
171
-
172
- ```html
173
- <html class="dark">
174
- ```
175
-
176
- ### Next.js with next-themes
177
-
178
- ```tsx
179
- // app/layout.tsx
180
- import { ThemeProvider } from 'next-themes'
181
-
182
- export default function RootLayout({ children }) {
183
- return (
184
- <html suppressHydrationWarning>
185
- <body>
186
- <ThemeProvider attribute="class" defaultTheme="system">
187
- {children}
188
- </ThemeProvider>
189
- </body>
190
- </html>
191
- )
192
- }
193
- ```
194
-
195
- ### Programmatic toggle
196
-
197
- ```tsx
198
- import { useColorMode } from '@devalok/shilp-sutra/hooks'
199
-
200
- function ThemeToggle() {
201
- const { mode, toggle } = useColorMode()
202
- return <button onClick={toggle}>{mode === 'dark' ? 'Light' : 'Dark'}</button>
203
- }
204
- ```
205
-
206
- ---
207
-
208
- ## TypeScript
209
-
210
- Full TypeScript support works out of the box. No special `tsconfig.json` settings required.
211
-
212
- All component props are exported as named types:
213
-
214
- ```tsx
215
- import { type ButtonProps } from '@devalok/shilp-sutra/ui/button'
216
- import { type DatePickerProps } from '@devalok/shilp-sutra/composed/date-picker'
217
- ```
218
-
219
- ---
220
-
221
- ## Token Architecture
222
-
223
- Three-tier CSS custom property system:
224
-
225
- 1. **Primitives** (`primitives.css`) -- Raw palette values (50-950 scales). Never used directly in components.
226
- 2. **Semantic** (`semantic.css`) -- Intent-based tokens (`--color-interactive`, `--color-text-primary`). Includes dark mode via `.dark` class.
227
- 3. **Typography** (`typography.css`) -- Font-face declarations, type scale (T1-T7, B1-B8, L1-L6, P1-P7).
228
-
229
- ---
230
-
231
- ## Links
232
-
233
- - [Storybook](https://devalok-design.github.io/shilp-sutra/) -- interactive component docs
234
- - [GitHub](https://github.com/devalok-design/shilp-sutra)
235
- - [Changelog](https://github.com/devalok-design/shilp-sutra/blob/main/CHANGELOG.md)
236
-
237
- ## License
238
-
239
- MIT -- Copyright 2026 Devalok Design & Strategy Studios
1
+ # @devalok/shilp-sutra
2
+
3
+ Devalok Design System -- tokens, components, and patterns for React & Next.js.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@devalok/shilp-sutra)](https://www.npmjs.com/package/@devalok/shilp-sutra)
6
+ [![Storybook](https://img.shields.io/badge/Storybook-ff4785?logo=storybook&logoColor=white)](https://devalok-design.github.io/shilp-sutra/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ For full documentation, setup guides, and architecture details, see the [monorepo README](https://github.com/devalok-design/shilp-sutra#readme).
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pnpm add @devalok/shilp-sutra
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```ts
20
+ // tailwind.config.ts
21
+ import shilpSutra from '@devalok/shilp-sutra/tailwind'
22
+
23
+ export default {
24
+ presets: [shilpSutra],
25
+ content: [
26
+ './app/**/*.{ts,tsx}',
27
+ './node_modules/@devalok/shilp-sutra/dist/**/*.js',
28
+ ],
29
+ }
30
+ ```
31
+
32
+ ```tsx
33
+ // app/layout.tsx
34
+ import '@devalok/shilp-sutra/tokens'
35
+ ```
36
+
37
+ ```tsx
38
+ // Any component
39
+ import { Button } from '@devalok/shilp-sutra/ui/button'
40
+ ```
41
+
42
+ ## Peer Dependencies
43
+
44
+ ### Required
45
+
46
+ | Package | Version |
47
+ |---------|---------|
48
+ | `react` | `^18 \|\| ^19` |
49
+ | `react-dom` | `^18 \|\| ^19` |
50
+
51
+ ### Optional
52
+
53
+ Install only what you use:
54
+
55
+ | Feature | Packages |
56
+ |---------|----------|
57
+ | Charts (`./ui/charts`) | `d3-array`, `d3-axis`, `d3-format`, `d3-interpolate`, `d3-scale`, `d3-selection`, `d3-shape`, `d3-time-format`, `d3-transition` |
58
+ | Rich Text Editor (`./composed/rich-text-editor`) | `@tiptap/react`, `@tiptap/starter-kit`, `@tiptap/extension-placeholder` |
59
+ | DataTable (`./ui/data-table`) | `@tanstack/react-table`, `@tanstack/react-virtual` |
60
+ | Icons | `@tabler/icons-react` |
61
+ | Date components (`./composed/date-picker`) | `date-fns` |
62
+ | OTP Input (`./ui/input-otp`) | `input-otp` |
63
+ | Markdown rendering | `react-markdown` |
64
+
65
+ ## Next.js
66
+
67
+ Add to `next.config.js`:
68
+
69
+ ```js
70
+ transpilePackages: ["@devalok/shilp-sutra", "@devalok/shilp-sutra-brand"]
71
+ ```
72
+
73
+ ## Links
74
+
75
+ - [Storybook](https://devalok-design.github.io/shilp-sutra/) -- interactive component docs
76
+ - [Monorepo README](https://github.com/devalok-design/shilp-sutra#readme) -- full docs, architecture, component list
77
+ - [Changelog](https://github.com/devalok-design/shilp-sutra/blob/main/CHANGELOG.md)
78
+ - [Migration Guide](https://github.com/devalok-design/shilp-sutra/blob/main/docs/MIGRATION.md)
79
+
80
+ ## License
81
+
82
+ MIT -- Copyright 2026 Devalok Design & Strategy Studios