@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.
- package/README.md +82 -239
- package/dist/_chunks/badge-group.js +123 -171
- package/dist/_chunks/document-preview.js +92 -0
- package/dist/_chunks/file-preview.js +511 -0
- package/dist/_chunks/image-preview.js +90 -0
- package/dist/_chunks/primitives.js +109 -109
- package/dist/_chunks/stat-row.js +144 -124
- package/dist/_chunks/use-calendar.js +558 -490
- package/dist/ai/block-renderer.d.ts +2 -1
- package/dist/ai/block-renderer.d.ts.map +1 -1
- package/dist/ai/block-renderer.js +30 -29
- package/dist/ai/blocks/block-table.d.ts.map +1 -1
- package/dist/ai/blocks/confirm.d.ts.map +1 -1
- package/dist/ai/blocks/divider.d.ts.map +1 -1
- package/dist/ai/blocks/error.d.ts.map +1 -1
- package/dist/ai/blocks/info.d.ts.map +1 -1
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/blocks/stat-row.d.ts.map +1 -1
- package/dist/ai/blocks/success.d.ts.map +1 -1
- package/dist/ai/blocks/text.d.ts.map +1 -1
- package/dist/ai/command-bar.d.ts +18 -0
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +126 -125
- package/dist/ai/conversation.d.ts +13 -1
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +78 -78
- package/dist/ai/types.d.ts +0 -1
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/ai/types.js +1 -0
- package/dist/composed/bulk-action-bar.d.ts +6 -4
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +102 -58
- package/dist/composed/command-palette.d.ts +9 -0
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +68 -68
- package/dist/composed/confirm-dialog.d.ts +1 -1
- package/dist/composed/confirm-dialog.d.ts.map +1 -1
- package/dist/composed/confirm-dialog.js +10 -10
- package/dist/composed/content-card.d.ts.map +1 -1
- package/dist/composed/date-picker/date-picker.d.ts +11 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.d.ts +1 -1
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +39 -36
- package/dist/composed/emoji-picker.d.ts +6 -0
- package/dist/composed/emoji-picker.d.ts.map +1 -1
- package/dist/composed/emoji-picker.js +22 -20
- package/dist/composed/error-boundary.d.ts +21 -1
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +47 -32
- package/dist/composed/file-preview/audio-preview.d.ts +7 -0
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/document-preview.d.ts +7 -0
- package/dist/composed/file-preview/document-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/embed-preview.d.ts +7 -0
- package/dist/composed/file-preview/embed-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/image-preview.d.ts +7 -0
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -0
- package/dist/composed/file-preview/shared.d.ts +20 -0
- package/dist/composed/file-preview/shared.d.ts.map +1 -0
- package/dist/composed/file-preview/video-preview.d.ts +6 -0
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -0
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +10 -662
- package/dist/composed/filter-bar.d.ts +10 -2
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +42 -43
- package/dist/composed/form-section.d.ts +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +22 -21
- package/dist/composed/index.d.ts +2 -2
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +58 -57
- package/dist/composed/inline-edit.d.ts +1 -1
- package/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js +33 -32
- package/dist/composed/lib/string-utils.d.ts.map +1 -1
- package/dist/composed/loading-skeleton.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.d.ts +1 -1
- package/dist/composed/markdown-viewer.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.js +60 -59
- package/dist/composed/master-detail.d.ts +11 -7
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +123 -84
- package/dist/composed/page-header.d.ts.map +1 -1
- package/dist/composed/page-skeletons.d.ts.map +1 -1
- package/dist/composed/priority-indicator.d.ts +1 -0
- package/dist/composed/priority-indicator.js +1 -0
- package/dist/composed/responsive-overlay.d.ts +8 -0
- package/dist/composed/responsive-overlay.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.d.ts +11 -3
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +21 -20
- package/dist/composed/schedule-view.d.ts +9 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +8 -4
- package/dist/hooks/use-touch-device.d.ts +12 -0
- package/dist/hooks/use-touch-device.d.ts.map +1 -0
- package/dist/hooks/use-touch-device.js +13 -0
- package/dist/hooks/use-viewport-height.d.ts +11 -0
- package/dist/hooks/use-viewport-height.d.ts.map +1 -0
- package/dist/hooks/use-viewport-height.js +16 -0
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +72 -63
- package/dist/shell/command-registry.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +77 -77
- package/dist/shell/top-bar.d.ts +2 -2
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +61 -60
- package/dist/tailwind/index.cjs +51 -7
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +51 -7
- package/dist/tokens/primitives.css +3 -1
- package/dist/tokens/semantic.css +16 -13
- package/dist/tokens/typography.css +33 -4
- package/dist/ui/alert.d.ts +1 -0
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +42 -37
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +38 -39
- package/dist/ui/badge.d.ts +110 -2
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +8 -7
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +54 -74
- package/dist/ui/card.d.ts +5 -1
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +111 -79
- package/dist/ui/charts/area-chart.d.ts +2 -0
- package/dist/ui/charts/area-chart.d.ts.map +1 -1
- package/dist/ui/charts/bar-chart.d.ts +2 -0
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts +2 -0
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/index.js +583 -577
- package/dist/ui/charts/line-chart.d.ts +2 -0
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/charts/pie-chart.d.ts +2 -0
- package/dist/ui/charts/pie-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts +2 -0
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts +2 -0
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +36 -27
- package/dist/ui/code.d.ts.map +1 -1
- package/dist/ui/color-input.js +5 -5
- package/dist/ui/combobox.d.ts +6 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +1 -1
- package/dist/ui/container.d.ts.map +1 -1
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/data-table-body.d.ts +12 -0
- package/dist/ui/data-table-body.d.ts.map +1 -0
- package/dist/ui/data-table-body.js +219 -0
- package/dist/ui/data-table-bulk-actions.d.ts +19 -0
- package/dist/ui/data-table-bulk-actions.d.ts.map +1 -0
- package/dist/ui/data-table-bulk-actions.js +61 -0
- package/dist/ui/data-table-card.d.ts +9 -0
- package/dist/ui/data-table-card.d.ts.map +1 -0
- package/dist/ui/data-table-card.js +73 -0
- package/dist/ui/data-table-context.d.ts +62 -0
- package/dist/ui/data-table-context.d.ts.map +1 -0
- package/dist/ui/data-table-context.js +48 -0
- package/dist/ui/data-table-header.d.ts +10 -0
- package/dist/ui/data-table-header.d.ts.map +1 -0
- package/dist/ui/data-table-header.js +141 -0
- package/dist/ui/data-table-pagination.d.ts +13 -0
- package/dist/ui/data-table-pagination.d.ts.map +1 -0
- package/dist/ui/data-table-pagination.js +84 -0
- package/dist/ui/data-table.d.ts +11 -9
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +258 -573
- package/dist/ui/dialog.d.ts +6 -2
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +84 -82
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +3 -3
- package/dist/ui/icon-group.d.ts +2 -4
- package/dist/ui/icon-group.d.ts.map +1 -1
- package/dist/ui/icon-group.js +22 -23
- package/dist/ui/index.d.ts +1 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +94 -99
- package/dist/ui/label.js +1 -1
- package/dist/ui/lib/bottom-sheet.d.ts +16 -0
- package/dist/ui/lib/bottom-sheet.d.ts.map +1 -0
- package/dist/ui/lib/date-utils.d.ts.map +1 -1
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/utils.d.ts.map +1 -1
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +64 -73
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +40 -44
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +19 -17
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/popover.js +107 -32
- package/dist/ui/progress-ring.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +80 -80
- package/dist/ui/progress.js +4 -4
- package/dist/ui/radio.d.ts +5 -2
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +29 -20
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +13 -12
- package/dist/ui/segmented-control.d.ts +6 -108
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +86 -272
- package/dist/ui/select.d.ts +3 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +83 -71
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts +2 -0
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +102 -84
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +200 -175
- package/dist/ui/skeleton.d.ts.map +1 -1
- package/dist/ui/slider.js +14 -14
- package/dist/ui/stack.d.ts.map +1 -1
- package/dist/ui/status-dot.js +8 -8
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +33 -31
- package/dist/ui/switch.js +3 -3
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +102 -76
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/toast-types.d.ts +0 -1
- package/dist/ui/toast-types.d.ts.map +1 -1
- package/dist/ui/toast-types.js +0 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +156 -150
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tooltip.js +3 -3
- package/dist/ui/visually-hidden.d.ts.map +1 -1
- package/docs/components/ui/alert.md +3 -0
- package/docs/components/ui/badge.md +3 -0
- package/docs/components/ui/card.md +4 -0
- package/docs/components/ui/data-table-body.md +13 -0
- package/docs/components/ui/data-table-bulk-actions.md +13 -0
- package/docs/components/ui/data-table-card.md +13 -0
- package/docs/components/ui/data-table-context.md +13 -0
- package/docs/components/ui/data-table-header.md +13 -0
- package/docs/components/ui/data-table-pagination.md +13 -0
- package/docs/components/ui/select.md +4 -0
- package/docs/components/ui/tabs.md +4 -0
- package/llms-full.txt +97 -48
- package/llms.txt +46 -1
- package/package.json +37 -7
- package/dist/ui/chip.d.ts +0 -19
- package/dist/ui/chip.d.ts.map +0 -1
- package/dist/ui/chip.js +0 -14
- package/dist/ui/lib/use-ripple.d.ts +0 -14
- 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
|
-
[](https://www.npmjs.com/package/@devalok/shilp-sutra)
|
|
6
|
-
[](https://devalok-design.github.io/shilp-sutra/)
|
|
7
|
-
[](https://opensource.org/licenses/MIT)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
import '
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
+
[](https://www.npmjs.com/package/@devalok/shilp-sutra)
|
|
6
|
+
[](https://devalok-design.github.io/shilp-sutra/)
|
|
7
|
+
[](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
|