@devalok/shilp-sutra 0.38.0 → 0.40.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/AGENTS.md +151 -0
- package/MIGRATION.md +255 -0
- package/README.md +3 -0
- package/dist/_chunks/badge-group.js +76 -75
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/chart-container.js +50 -0
- package/dist/_chunks/chart-container.js.map +1 -0
- package/dist/_chunks/chat.js +236 -228
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/colors.js +30 -0
- package/dist/_chunks/colors.js.map +1 -0
- package/dist/_chunks/document-preview.js +2 -2
- package/dist/_chunks/document-preview.js.map +1 -1
- package/dist/_chunks/emoji-data.js +45 -0
- package/dist/_chunks/emoji-data.js.map +1 -0
- package/dist/_chunks/grid-lines.js +72 -0
- package/dist/_chunks/grid-lines.js.map +1 -0
- package/dist/_chunks/image-preview.js +2 -2
- package/dist/_chunks/image-preview.js.map +1 -1
- package/dist/_chunks/mention-suggestion.js +35 -263
- package/dist/_chunks/mention-suggestion.js.map +1 -1
- package/dist/_chunks/normalize-icon.js +18 -0
- package/dist/_chunks/normalize-icon.js.map +1 -0
- package/dist/_chunks/oauth-button.js +227 -0
- package/dist/_chunks/oauth-button.js.map +1 -0
- package/dist/_chunks/popover.js +3 -3
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives.js +107 -107
- package/dist/_chunks/primitives.js.map +1 -1
- package/dist/_chunks/shared.js +5 -5
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/{text.js → success.js} +26 -63
- package/dist/_chunks/success.js.map +1 -0
- package/dist/_chunks/tiptap.js +1952 -1949
- package/dist/_chunks/tiptap.js.map +1 -1
- package/dist/_chunks/tooltip.js +58 -0
- package/dist/_chunks/tooltip.js.map +1 -0
- package/dist/_chunks/tree-view.js +101 -96
- package/dist/_chunks/tree-view.js.map +1 -1
- package/dist/_chunks/use-calendar.js +5 -5
- package/dist/_chunks/use-calendar.js.map +1 -1
- package/dist/ai/ai-command-provider.d.ts +3 -2
- package/dist/ai/ai-command-provider.d.ts.map +1 -1
- package/dist/ai/ai-command-provider.js.map +1 -1
- package/dist/ai/block-renderer.js +11 -9
- package/dist/ai/block-renderer.js.map +1 -1
- package/dist/ai/blocks/error.js +31 -0
- package/dist/ai/blocks/error.js.map +1 -0
- package/dist/ai/blocks/index.d.ts +0 -2
- package/dist/ai/blocks/index.d.ts.map +1 -1
- package/dist/ai/blocks/index.js +2 -2
- package/dist/ai/blocks/text.js +19 -0
- package/dist/ai/blocks/text.js.map +1 -0
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +198 -193
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.d.ts +2 -1
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +92 -87
- package/dist/ai/conversation.js.map +1 -1
- package/dist/ai/index.d.ts +0 -4
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +45 -46
- package/dist/ai/index.js.map +1 -1
- package/dist/composed/activity-feed.d.ts +2 -1
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +5 -5
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/avatar-group.js +4 -4
- package/dist/composed/avatar-group.js.map +1 -1
- package/dist/composed/bulk-action-bar.d.ts +2 -2
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +12 -12
- package/dist/composed/bulk-action-bar.js.map +1 -1
- package/dist/composed/command-palette.d.ts +2 -1
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +106 -101
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/content-card.js.map +1 -1
- package/dist/composed/date-picker/index.js +747 -3
- package/dist/composed/date-picker/index.js.map +1 -0
- package/dist/composed/emoji-picker.js +4 -4
- package/dist/composed/emoji-picker.js.map +1 -1
- package/dist/composed/empty-state.d.ts +3 -3
- package/dist/composed/empty-state.d.ts.map +1 -1
- package/dist/composed/empty-state.js +40 -31
- package/dist/composed/empty-state.js.map +1 -1
- package/dist/composed/error-boundary.js +3 -3
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/extensions/emoji-node.js +81 -0
- package/dist/composed/extensions/emoji-node.js.map +1 -0
- package/dist/composed/extensions/emoji-suggestion.js +117 -0
- package/dist/composed/extensions/emoji-suggestion.js.map +1 -0
- package/dist/composed/file-preview.js +498 -2
- package/dist/composed/file-preview.js.map +1 -0
- package/dist/composed/filter-bar.js +1 -1
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/index.d.ts +0 -15
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +16 -24
- package/dist/composed/inline-edit.js +1 -1
- package/dist/composed/inline-edit.js.map +1 -1
- package/dist/composed/loading-skeleton.js +9 -9
- package/dist/composed/loading-skeleton.js.map +1 -1
- package/dist/composed/markdown-viewer.js +3 -3
- package/dist/composed/markdown-viewer.js.map +1 -1
- package/dist/composed/multi-select-popover.js +1 -1
- package/dist/composed/multi-select-popover.js.map +1 -1
- package/dist/composed/page-header.js +1 -1
- package/dist/composed/page-header.js.map +1 -1
- package/dist/composed/page-skeletons.js +15 -15
- package/dist/composed/page-skeletons.js.map +1 -1
- package/dist/composed/priority-indicator.js +3 -3
- package/dist/composed/priority-indicator.js.map +1 -1
- package/dist/composed/rich-chat-input.js +2073 -2
- package/dist/composed/rich-chat-input.js.map +1 -0
- package/dist/composed/rich-text-editor.js +75 -72
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/composed/schedule-view.js +3 -3
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/composed/status-badge.d.ts +3 -2
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +58 -53
- package/dist/composed/status-badge.js.map +1 -1
- package/dist/shell/app-command-palette.d.ts +2 -1
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js.map +1 -1
- package/dist/shell/bottom-navbar.d.ts +3 -1
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +94 -86
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/shell/command-registry.d.ts +2 -1
- package/dist/shell/command-registry.d.ts.map +1 -1
- package/dist/shell/command-registry.js.map +1 -1
- package/dist/shell/notification-center.js +8 -8
- package/dist/shell/notification-center.js.map +1 -1
- package/dist/shell/notification-preferences.js +1 -1
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/shell/sidebar.d.ts +7 -4
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js +148 -134
- package/dist/shell/sidebar.js.map +1 -1
- package/dist/shell/top-bar.d.ts +4 -3
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +116 -108
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/tokens/semantic.css +82 -9
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.js +3 -3
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.js +2 -2
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/autocomplete.js +2 -2
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/avatar.js +11 -11
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge-indicator.js +1 -1
- package/dist/ui/badge-indicator.js.map +1 -1
- package/dist/ui/badge.d.ts +3 -2
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.js +1 -1
- package/dist/ui/banner.js.map +1 -1
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button.d.ts +5 -4
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +66 -65
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.js +5 -5
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/charts/area-chart.js +177 -0
- package/dist/ui/charts/area-chart.js.map +1 -0
- package/dist/ui/charts/bar-chart.js +127 -0
- package/dist/ui/charts/bar-chart.js.map +1 -0
- package/dist/ui/charts/chart-container.js +3 -0
- package/dist/ui/charts/gauge-chart.js +72 -0
- package/dist/ui/charts/gauge-chart.js.map +1 -0
- package/dist/ui/charts/index.js +10 -1035
- package/dist/ui/charts/line-chart.js +135 -0
- package/dist/ui/charts/line-chart.js.map +1 -0
- package/dist/ui/charts/pie-chart.js +111 -0
- package/dist/ui/charts/pie-chart.js.map +1 -0
- package/dist/ui/charts/radar-chart.js +170 -0
- package/dist/ui/charts/radar-chart.js.map +1 -0
- package/dist/ui/charts/sparkline.js +119 -0
- package/dist/ui/charts/sparkline.js.map +1 -0
- package/dist/ui/chat/message.d.ts +3 -3
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/chat/system-message.d.ts +2 -1
- package/dist/ui/chat/system-message.d.ts.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/code.js +2 -2
- package/dist/ui/code.js.map +1 -1
- package/dist/ui/color-input.js +10 -10
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/color-swatch.js +3 -3
- package/dist/ui/color-swatch.js.map +1 -1
- package/dist/ui/combobox.d.ts +2 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +100 -95
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/container.d.ts +6 -1
- package/dist/ui/container.d.ts.map +1 -1
- package/dist/ui/container.js +2 -1
- package/dist/ui/container.js.map +1 -1
- package/dist/ui/context-menu.js +6 -6
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/data-table-body.js +1 -1
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-bulk-actions.js +2 -2
- package/dist/ui/data-table-bulk-actions.js.map +1 -1
- package/dist/ui/data-table-card.js +2 -2
- package/dist/ui/data-table-card.js.map +1 -1
- package/dist/ui/data-table-header.js +2 -2
- package/dist/ui/data-table-header.js.map +1 -1
- package/dist/ui/data-table-pagination.js +3 -3
- package/dist/ui/data-table-pagination.js.map +1 -1
- package/dist/ui/data-table-toolbar.js +1 -1
- package/dist/ui/data-table-toolbar.js.map +1 -1
- package/dist/ui/data-table.js +1 -1
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/devalok-grain.d.ts +1 -1
- package/dist/ui/devalok-grain.js.map +1 -1
- package/dist/ui/dialog.js +2 -2
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.js +6 -6
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/file-upload.js +4 -4
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/icon-button.d.ts +9 -2
- package/dist/ui/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-button.js +14 -13
- package/dist/ui/icon-button.js.map +1 -1
- package/dist/ui/index.d.ts +1 -3
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +31 -33
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.js +2 -2
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/lib/icon-input.d.ts +42 -0
- package/dist/ui/lib/icon-input.d.ts.map +1 -0
- package/dist/ui/lib/normalize-icon.d.ts +39 -0
- package/dist/ui/lib/normalize-icon.d.ts.map +1 -0
- package/dist/ui/link.js +1 -1
- package/dist/ui/link.js.map +1 -1
- package/dist/ui/menubar.js +8 -8
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.js +3 -3
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/number-input.js +3 -3
- package/dist/ui/number-input.js.map +1 -1
- package/dist/ui/oauth-button/index.d.ts +3 -0
- package/dist/ui/oauth-button/index.d.ts.map +1 -0
- package/dist/ui/oauth-button/index.js +3 -0
- package/dist/ui/oauth-button/oauth-button.d.ts +208 -0
- package/dist/ui/oauth-button/oauth-button.d.ts.map +1 -0
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/progress.js +2 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio.js +1 -1
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/segmented-control.d.ts +3 -4
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +53 -45
- package/dist/ui/segmented-control.js.map +1 -1
- package/dist/ui/select.js +3 -3
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sheet.js +2 -2
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/sidebar.js +11 -11
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/skeleton.js +9 -9
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/slider.js +2 -2
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/split-button.js +7 -7
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stack.d.ts +6 -1
- package/dist/ui/stack.d.ts.map +1 -1
- package/dist/ui/stack.js +2 -1
- package/dist/ui/stack.js.map +1 -1
- package/dist/ui/stat-card.d.ts +2 -3
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +118 -116
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/status-dot.js +2 -2
- package/dist/ui/status-dot.js.map +1 -1
- package/dist/ui/stepper.d.ts +2 -1
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +74 -69
- package/dist/ui/stepper.js.map +1 -1
- package/dist/ui/switch.js +2 -2
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/tabs.js +3 -3
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/text.d.ts +7 -2
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/text.js +2 -1
- package/dist/ui/text.js.map +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toast.js +8 -8
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toaster.d.ts +11 -2
- package/dist/ui/toaster.d.ts.map +1 -1
- package/dist/ui/toaster.js.map +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.js +12 -12
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/tree-view/tree-item.d.ts +3 -2
- package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
- package/dist/ui/tree-view/use-tree.d.ts +2 -1
- package/dist/ui/tree-view/use-tree.d.ts.map +1 -1
- package/docs/components/_header.md +90 -1
- package/docs/components/ui/oauth-button.md +86 -0
- package/docs/recipes/customize-brand.md +100 -4
- package/docs/recipes/index.md +5 -1
- package/docs/recipes/install-astro.md +15 -0
- package/docs/recipes/install-next-app-router.md +21 -5
- package/docs/recipes/install-next-pages.md +2 -0
- package/docs/recipes/install-remix.md +15 -0
- package/docs/recipes/install-tanstack-start.md +15 -0
- package/docs/recipes/install-vite.md +15 -0
- package/docs/recipes/troubleshoot.md +22 -0
- package/llms-full.txt +177 -2
- package/llms-quick.txt +247 -0
- package/llms.txt +116 -3
- package/package.json +80 -2
- package/scripts/welcome.mjs +219 -0
- package/skill/README.md +99 -0
- package/skill/SKILL.md +163 -0
- package/skill/install.sh +59 -0
- package/skill/references/components-full.md +7083 -0
- package/skill/references/components.md +778 -0
- package/skill/references/customize-brand.md +314 -0
- package/skill/references/server-components.md +211 -0
- package/skill/references/setup-astro.md +195 -0
- package/skill/references/setup-next-app-router.md +248 -0
- package/skill/references/setup-next-pages.md +127 -0
- package/skill/references/setup-remix.md +188 -0
- package/skill/references/setup-tanstack-start.md +160 -0
- package/skill/references/setup-vite.md +187 -0
- package/skill/references/troubleshoot.md +241 -0
- package/dist/_chunks/date-picker.js +0 -748
- package/dist/_chunks/date-picker.js.map +0 -1
- package/dist/_chunks/file-preview.js +0 -499
- package/dist/_chunks/file-preview.js.map +0 -1
- package/dist/_chunks/rich-chat-input.js +0 -2071
- package/dist/_chunks/rich-chat-input.js.map +0 -1
- package/dist/_chunks/text.js.map +0 -1
- package/dist/ui/charts/index.js.map +0 -1
- /package/{LICENSE → skill/LICENSE} +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<!-- Source: packages/core/docs/recipes/install-remix.md — do not edit directly. Regenerate with `node scripts/build-skill.mjs`. -->
|
|
2
|
+
|
|
3
|
+
# Install: Remix
|
|
4
|
+
|
|
5
|
+
> Setup recipe for adding `@devalok/shilp-sutra` to a Remix project (v2 with Vite).
|
|
6
|
+
|
|
7
|
+
## 1. Detect
|
|
8
|
+
|
|
9
|
+
You are in this recipe if:
|
|
10
|
+
|
|
11
|
+
- `package.json` lists `"@remix-run/node"` and `"@remix-run/react"`
|
|
12
|
+
- `vite.config.{ts,js}` exists with the `vitePlugin` from `@remix-run/dev`
|
|
13
|
+
- `app/root.tsx` exists with `<Outlet />` inside `<Document>` shell
|
|
14
|
+
|
|
15
|
+
For React Router v7 (the spiritual successor to Remix), use the [install-vite.md](./install-vite.md) recipe — it works the same way.
|
|
16
|
+
|
|
17
|
+
## 2. Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add @devalok/shilp-sutra framer-motion
|
|
21
|
+
pnpm add -D tailwindcss@^4 @tailwindcss/vite
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Optional:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm add sonner # only if rendering <Toaster />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
|
|
31
|
+
|
|
32
|
+
Some components ship hard peers as optional. **Install BEFORE first import** or Remix's Vite build will fail with `Failed to resolve import`. Skip if you only use core components.
|
|
33
|
+
|
|
34
|
+
| When you import… | Install |
|
|
35
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
36
|
+
| `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
37
|
+
| `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
|
|
38
|
+
| `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
|
|
39
|
+
| `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
40
|
+
| `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
|
|
41
|
+
| `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
42
|
+
| `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
|
|
43
|
+
| Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
|
|
44
|
+
|
|
45
|
+
## 3. Wire Tailwind 4 in `vite.config.ts`
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import { vitePlugin as remix } from "@remix-run/dev";
|
|
49
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
50
|
+
import { defineConfig } from "vite";
|
|
51
|
+
|
|
52
|
+
export default defineConfig({
|
|
53
|
+
plugins: [
|
|
54
|
+
tailwindcss(),
|
|
55
|
+
remix(),
|
|
56
|
+
],
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`tailwindcss()` should come before `remix()` so the design tokens are processed first.
|
|
61
|
+
|
|
62
|
+
## 4. Wire tokens
|
|
63
|
+
|
|
64
|
+
Create `app/styles/globals.css`:
|
|
65
|
+
|
|
66
|
+
```css
|
|
67
|
+
@import "tailwindcss";
|
|
68
|
+
@import "@devalok/shilp-sutra/css";
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Wire it as a Remix link export from `app/root.tsx`:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import type { LinksFunction } from "@remix-run/node";
|
|
75
|
+
import globalsCss from "./styles/globals.css?url";
|
|
76
|
+
|
|
77
|
+
export const links: LinksFunction = () => [
|
|
78
|
+
{ rel: "stylesheet", href: globalsCss },
|
|
79
|
+
];
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The `?url` suffix is critical — it tells Vite to emit the file as an asset URL instead of inlining the CSS contents.
|
|
83
|
+
|
|
84
|
+
## 5. Theme toggle
|
|
85
|
+
|
|
86
|
+
Create `public/theme-bootstrap.js` (a static asset served verbatim):
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
(function () {
|
|
90
|
+
try {
|
|
91
|
+
var stored = localStorage.getItem("theme");
|
|
92
|
+
var prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
93
|
+
if (stored === "dark" || (!stored && prefersDark)) {
|
|
94
|
+
document.documentElement.classList.add("dark");
|
|
95
|
+
}
|
|
96
|
+
} catch (e) {}
|
|
97
|
+
})();
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Reference it from `app/root.tsx` so it loads before any React hydration:
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { Outlet, Meta, Links, Scripts, ScrollRestoration } from "@remix-run/react";
|
|
104
|
+
|
|
105
|
+
export default function App() {
|
|
106
|
+
return (
|
|
107
|
+
<html lang="en" suppressHydrationWarning>
|
|
108
|
+
<head>
|
|
109
|
+
<Meta />
|
|
110
|
+
<Links />
|
|
111
|
+
<script src="/theme-bootstrap.js" />
|
|
112
|
+
</head>
|
|
113
|
+
<body>
|
|
114
|
+
<Outlet />
|
|
115
|
+
<ScrollRestoration />
|
|
116
|
+
<Scripts />
|
|
117
|
+
</body>
|
|
118
|
+
</html>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For runtime toggling inside React components, use `useColorMode`:
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
import { useColorMode } from "@devalok/shilp-sutra/hooks/use-color-mode";
|
|
127
|
+
|
|
128
|
+
export function ThemeToggle() {
|
|
129
|
+
const { mode, toggle } = useColorMode();
|
|
130
|
+
return (
|
|
131
|
+
<button onClick={toggle} aria-label="Toggle theme">
|
|
132
|
+
{mode === "dark" ? "☀" : "☾"}
|
|
133
|
+
</button>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## 6. Toaster (optional)
|
|
139
|
+
|
|
140
|
+
Mount once in `app/root.tsx` next to `<Outlet />`:
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
|
|
144
|
+
|
|
145
|
+
// inside <body>
|
|
146
|
+
<>
|
|
147
|
+
<Outlet />
|
|
148
|
+
<Toaster />
|
|
149
|
+
</>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 7. Verify
|
|
153
|
+
|
|
154
|
+
Create `app/routes/_index.tsx`:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
import { Button } from "@devalok/shilp-sutra/ui/button";
|
|
158
|
+
import { Stack } from "@devalok/shilp-sutra/ui/stack";
|
|
159
|
+
import { Text } from "@devalok/shilp-sutra/ui/text";
|
|
160
|
+
|
|
161
|
+
export default function Index() {
|
|
162
|
+
return (
|
|
163
|
+
<Stack className="p-ds-08" gap="ds-04">
|
|
164
|
+
<Text variant="heading-2xl">Hello, Shilp Sutra</Text>
|
|
165
|
+
<Stack direction="row" gap="ds-03">
|
|
166
|
+
<Button>Primary</Button>
|
|
167
|
+
<Button variant="soft">Soft</Button>
|
|
168
|
+
</Stack>
|
|
169
|
+
</Stack>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Run `pnpm dev` and open the URL.
|
|
175
|
+
|
|
176
|
+
## 8. Remix-specific gotchas
|
|
177
|
+
|
|
178
|
+
- **`?url` suffix on CSS imports.** Without it, Vite tries to inline the CSS, which breaks Tailwind processing.
|
|
179
|
+
- **Loaders are server-only.** Do not import shilp-sutra components inside a `loader` function — they will not render.
|
|
180
|
+
- **Server-rendered output.** Remix SSRs every route. The CSS-in-JS-free approach of shilp-sutra works perfectly here; no extra config needed.
|
|
181
|
+
- **`framer-motion` and SSR.** All shilp-sutra animations gracefully degrade for the initial server render. No special handling required.
|
|
182
|
+
- **CSP.** If your CSP blocks inline scripts, the `theme-bootstrap.js` static asset above already complies (no `unsafe-inline` needed).
|
|
183
|
+
|
|
184
|
+
## 9. What NOT to do
|
|
185
|
+
|
|
186
|
+
- ❌ Add `tailwind.config.{ts,js}` — Tailwind 4 is CSS-first.
|
|
187
|
+
- ❌ Skip the `?url` suffix on CSS imports.
|
|
188
|
+
- ❌ Mount `<Toaster />` inside route components — it should live once at the root.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<!-- Source: packages/core/docs/recipes/install-tanstack-start.md — do not edit directly. Regenerate with `node scripts/build-skill.mjs`. -->
|
|
2
|
+
|
|
3
|
+
# Install: TanStack Start
|
|
4
|
+
|
|
5
|
+
> Setup recipe for adding `@devalok/shilp-sutra` to a TanStack Start project (the React full-stack framework built on Vinxi/Vite).
|
|
6
|
+
|
|
7
|
+
## 1. Detect
|
|
8
|
+
|
|
9
|
+
You are in this recipe if:
|
|
10
|
+
|
|
11
|
+
- `package.json` lists `"@tanstack/start"` and `"@tanstack/react-router"`
|
|
12
|
+
- `app.config.{ts,js}` (Vinxi) exists at the project root
|
|
13
|
+
- `app/router.tsx` and `app/routes/__root.tsx` exist
|
|
14
|
+
|
|
15
|
+
## 2. Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @devalok/shilp-sutra framer-motion
|
|
19
|
+
pnpm add -D tailwindcss@^4 @tailwindcss/vite
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Optional:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm add sonner # only if rendering <Toaster />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
|
|
29
|
+
|
|
30
|
+
Some components ship hard peers as optional. **Install BEFORE first import** or the TanStack Start dev/build will fail with `Failed to resolve import`. Skip if you only use core components.
|
|
31
|
+
|
|
32
|
+
| When you import… | Install |
|
|
33
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
34
|
+
| `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
35
|
+
| `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
|
|
36
|
+
| `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
|
|
37
|
+
| `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
38
|
+
| `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
|
|
39
|
+
| `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
40
|
+
| `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
|
|
41
|
+
| Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
|
|
42
|
+
|
|
43
|
+
## 3. Wire Tailwind 4 in `app.config.ts`
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { defineConfig } from "@tanstack/start/config";
|
|
47
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
48
|
+
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
vite: {
|
|
51
|
+
plugins: [tailwindcss()],
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 4. Wire tokens
|
|
57
|
+
|
|
58
|
+
Create `app/styles/globals.css`:
|
|
59
|
+
|
|
60
|
+
```css
|
|
61
|
+
@import "tailwindcss";
|
|
62
|
+
@import "@devalok/shilp-sutra/css";
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Import it from `app/routes/__root.tsx`:
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import "../styles/globals.css";
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
If you prefer asset-URL imports the way Remix does it, use `import css from "../styles/globals.css?url"` and add `<link rel="stylesheet" href={css} />` to the `<head>` returned by `__root.tsx`.
|
|
72
|
+
|
|
73
|
+
## 5. Theme toggle
|
|
74
|
+
|
|
75
|
+
Create `public/theme-bootstrap.js` (a static asset served verbatim):
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
(function () {
|
|
79
|
+
try {
|
|
80
|
+
var stored = localStorage.getItem("theme");
|
|
81
|
+
var prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
82
|
+
if (stored === "dark" || (!stored && prefersDark)) {
|
|
83
|
+
document.documentElement.classList.add("dark");
|
|
84
|
+
}
|
|
85
|
+
} catch (e) {}
|
|
86
|
+
})();
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Reference it from `app/routes/__root.tsx`:
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import { createRootRoute, Outlet } from "@tanstack/react-router";
|
|
93
|
+
|
|
94
|
+
export const Route = createRootRoute({
|
|
95
|
+
component: () => (
|
|
96
|
+
<html lang="en" suppressHydrationWarning>
|
|
97
|
+
<head>
|
|
98
|
+
<script src="/theme-bootstrap.js" />
|
|
99
|
+
</head>
|
|
100
|
+
<body>
|
|
101
|
+
<Outlet />
|
|
102
|
+
</body>
|
|
103
|
+
</html>
|
|
104
|
+
),
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
For runtime toggling, use the `useColorMode` hook — see [install-vite.md § 5](./install-vite.md#5-theme-toggle-no-next-themes-here).
|
|
109
|
+
|
|
110
|
+
## 6. Toaster (optional)
|
|
111
|
+
|
|
112
|
+
Mount in `__root.tsx` next to `<Outlet />`:
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
|
|
116
|
+
|
|
117
|
+
// inside <body>
|
|
118
|
+
<>
|
|
119
|
+
<Outlet />
|
|
120
|
+
<Toaster />
|
|
121
|
+
</>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 7. Verify
|
|
125
|
+
|
|
126
|
+
Create or replace `app/routes/index.tsx`:
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
130
|
+
import { Button } from "@devalok/shilp-sutra/ui/button";
|
|
131
|
+
import { Stack } from "@devalok/shilp-sutra/ui/stack";
|
|
132
|
+
import { Text } from "@devalok/shilp-sutra/ui/text";
|
|
133
|
+
|
|
134
|
+
export const Route = createFileRoute("/")({
|
|
135
|
+
component: () => (
|
|
136
|
+
<Stack className="p-ds-08" gap="ds-04">
|
|
137
|
+
<Text variant="heading-2xl">Hello, Shilp Sutra</Text>
|
|
138
|
+
<Stack direction="row" gap="ds-03">
|
|
139
|
+
<Button>Primary</Button>
|
|
140
|
+
<Button variant="soft">Soft</Button>
|
|
141
|
+
</Stack>
|
|
142
|
+
</Stack>
|
|
143
|
+
),
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Run `pnpm dev` and open the URL.
|
|
148
|
+
|
|
149
|
+
## 8. TanStack Start specifics
|
|
150
|
+
|
|
151
|
+
- **Server functions** (`createServerFn`) — do not import shilp-sutra components inside server functions; they run server-only.
|
|
152
|
+
- **Streaming SSR** is the default. All shilp-sutra components SSR cleanly because they have no client-only side effects at module top-level.
|
|
153
|
+
- **`framer-motion` SSR** — animations gracefully degrade on the initial render.
|
|
154
|
+
- **CSP.** The static `theme-bootstrap.js` asset complies with strict CSP (no inline scripts required).
|
|
155
|
+
|
|
156
|
+
## 9. What NOT to do
|
|
157
|
+
|
|
158
|
+
- ❌ Add `tailwind.config.{ts,js}` — Tailwind 4 is CSS-first.
|
|
159
|
+
- ❌ Mount `<Toaster />` inside route components — it should live once at the `__root`.
|
|
160
|
+
- ❌ Mix `@tailwindcss/postcss` and `@tailwindcss/vite` — pick one (Vite plugin recommended for TanStack Start).
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<!-- Source: packages/core/docs/recipes/install-vite.md — do not edit directly. Regenerate with `node scripts/build-skill.mjs`. -->
|
|
2
|
+
|
|
3
|
+
# Install: Vite + React
|
|
4
|
+
|
|
5
|
+
> Setup recipe for adding `@devalok/shilp-sutra` to a Vite + React SPA.
|
|
6
|
+
|
|
7
|
+
## 1. Detect
|
|
8
|
+
|
|
9
|
+
You are in this recipe if:
|
|
10
|
+
|
|
11
|
+
- `vite.config.{ts,js,mjs}` exists at the project root
|
|
12
|
+
- `package.json` lists `"vite"` and `"react"`
|
|
13
|
+
- `src/main.{tsx,jsx}` is the entry that calls `createRoot(...).render(<App />)`
|
|
14
|
+
|
|
15
|
+
This recipe also covers Vite + React + React Router (any version) — the design system is router-agnostic.
|
|
16
|
+
|
|
17
|
+
If you are using Remix (which now runs on Vite), use [install-remix.md](./install-remix.md). If you are using TanStack Start, use [install-tanstack-start.md](./install-tanstack-start.md).
|
|
18
|
+
|
|
19
|
+
## 2. Install dependencies
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# pnpm
|
|
23
|
+
pnpm add @devalok/shilp-sutra framer-motion
|
|
24
|
+
pnpm add -D tailwindcss@^4 @tailwindcss/vite
|
|
25
|
+
|
|
26
|
+
# npm
|
|
27
|
+
npm install @devalok/shilp-sutra framer-motion
|
|
28
|
+
npm install -D tailwindcss@^4 @tailwindcss/vite
|
|
29
|
+
|
|
30
|
+
# yarn
|
|
31
|
+
yarn add @devalok/shilp-sutra framer-motion
|
|
32
|
+
yarn add -D tailwindcss@^4 @tailwindcss/vite
|
|
33
|
+
|
|
34
|
+
# bun
|
|
35
|
+
bun add @devalok/shilp-sutra framer-motion
|
|
36
|
+
bun add -d tailwindcss@^4 @tailwindcss/vite
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Add only if rendering `<Toaster />`:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pnpm add sonner
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2a. Optional peer dependencies (install ONLY when importing the matching subpath)
|
|
46
|
+
|
|
47
|
+
Some components ship hard peers as optional. **Install BEFORE first import** or `vite dev` / `vite build` will fail with `Failed to resolve import`. Skip if you only use core components.
|
|
48
|
+
|
|
49
|
+
| When you import… | Install |
|
|
50
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
51
|
+
| `@devalok/shilp-sutra/ui/charts/*` | `pnpm add d3-array d3-axis d3-format d3-interpolate d3-scale d3-selection d3-shape d3-time-format d3-transition` |
|
|
52
|
+
| `@devalok/shilp-sutra/ui/data-table` | `pnpm add @tanstack/react-table @tanstack/react-virtual` |
|
|
53
|
+
| `@devalok/shilp-sutra/composed/date-picker` (+ DateRange, DateTime, Calendar) | `pnpm add date-fns` |
|
|
54
|
+
| `@devalok/shilp-sutra/composed/rich-text-editor` (+ RichChatInput, RichTextViewer) | `pnpm add @tiptap/react @tiptap/starter-kit @tiptap/extension-placeholder` |
|
|
55
|
+
| `@devalok/shilp-sutra/ui/input-otp` | `pnpm add input-otp` |
|
|
56
|
+
| `@devalok/shilp-sutra/composed/file-preview` | `pnpm add react-pdf react-zoom-pan-pinch` |
|
|
57
|
+
| `@devalok/shilp-sutra/composed/markdown-viewer` | `pnpm add react-markdown react-syntax-highlighter` |
|
|
58
|
+
| Any `Icon` / `IconButton` with Tabler icons | `pnpm add @tabler/icons-react` |
|
|
59
|
+
|
|
60
|
+
## 3. Wire Tailwind 4 in `vite.config.ts`
|
|
61
|
+
|
|
62
|
+
Use the official Tailwind 4 Vite plugin (faster than PostCSS for Vite):
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { defineConfig } from "vite";
|
|
66
|
+
import react from "@vitejs/plugin-react";
|
|
67
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
68
|
+
|
|
69
|
+
export default defineConfig({
|
|
70
|
+
plugins: [react(), tailwindcss()],
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If the project already uses PostCSS for other reasons, you can use `@tailwindcss/postcss` instead — see [install-next-app-router.md § 3](./install-next-app-router.md#3-configure-postcss). Stick with one approach; do not load both.
|
|
75
|
+
|
|
76
|
+
## 4. Wire tokens in the global CSS
|
|
77
|
+
|
|
78
|
+
Common CSS entry paths in priority order:
|
|
79
|
+
|
|
80
|
+
- `src/index.css`
|
|
81
|
+
- `src/main.css`
|
|
82
|
+
- `src/styles/globals.css`
|
|
83
|
+
- `src/App.css`
|
|
84
|
+
|
|
85
|
+
If none exists, create `src/index.css`. Set or merge:
|
|
86
|
+
|
|
87
|
+
```css
|
|
88
|
+
@import "tailwindcss";
|
|
89
|
+
@import "@devalok/shilp-sutra/css";
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Import it once from the entry (`src/main.tsx`):
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import "./index.css";
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 5. Theme toggle (no `next-themes` here)
|
|
99
|
+
|
|
100
|
+
Vite has no built-in theme provider. Use the design system's `useColorMode` hook with a small bootstrap script to avoid a flash of wrong theme.
|
|
101
|
+
|
|
102
|
+
Add the bootstrap to `index.html` (in `<head>`, before any stylesheet):
|
|
103
|
+
|
|
104
|
+
```html
|
|
105
|
+
<script>
|
|
106
|
+
(function () {
|
|
107
|
+
try {
|
|
108
|
+
var stored = localStorage.getItem("theme");
|
|
109
|
+
var prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
110
|
+
var dark = stored === "dark" || (!stored && prefersDark);
|
|
111
|
+
if (dark) document.documentElement.classList.add("dark");
|
|
112
|
+
} catch (e) {}
|
|
113
|
+
})();
|
|
114
|
+
</script>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Wire the runtime hook from anywhere in the app (e.g., a header button):
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import { useColorMode } from "@devalok/shilp-sutra/hooks/use-color-mode";
|
|
121
|
+
|
|
122
|
+
export function ThemeToggle() {
|
|
123
|
+
const { mode, toggle } = useColorMode();
|
|
124
|
+
return (
|
|
125
|
+
<button onClick={toggle} aria-label="Toggle theme">
|
|
126
|
+
{mode === "dark" ? "☀" : "☾"}
|
|
127
|
+
</button>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## 6. Mount Toaster (optional)
|
|
133
|
+
|
|
134
|
+
If you installed `sonner`, mount the Toaster once near the app root:
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
// src/main.tsx
|
|
138
|
+
import { StrictMode } from "react";
|
|
139
|
+
import { createRoot } from "react-dom/client";
|
|
140
|
+
import { Toaster } from "@devalok/shilp-sutra/ui/toaster";
|
|
141
|
+
import { App } from "./App";
|
|
142
|
+
import "./index.css";
|
|
143
|
+
|
|
144
|
+
createRoot(document.getElementById("root")!).render(
|
|
145
|
+
<StrictMode>
|
|
146
|
+
<App />
|
|
147
|
+
<Toaster />
|
|
148
|
+
</StrictMode>,
|
|
149
|
+
);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 7. Verify
|
|
153
|
+
|
|
154
|
+
Replace `src/App.tsx`:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
import { Button } from "@devalok/shilp-sutra/ui/button";
|
|
158
|
+
import { Stack } from "@devalok/shilp-sutra/ui/stack";
|
|
159
|
+
import { Text } from "@devalok/shilp-sutra/ui/text";
|
|
160
|
+
|
|
161
|
+
export function App() {
|
|
162
|
+
return (
|
|
163
|
+
<Stack className="p-ds-08" gap="ds-04">
|
|
164
|
+
<Text variant="heading-2xl">Hello, Shilp Sutra</Text>
|
|
165
|
+
<Stack direction="row" gap="ds-03">
|
|
166
|
+
<Button>Primary</Button>
|
|
167
|
+
<Button variant="soft">Soft</Button>
|
|
168
|
+
</Stack>
|
|
169
|
+
</Stack>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Run `pnpm dev` and open the printed Vite URL. Expected output matches [Next App Router § 7](./install-next-app-router.md#7-verify-the-install).
|
|
175
|
+
|
|
176
|
+
## 8. Gotchas (Vite-specific)
|
|
177
|
+
|
|
178
|
+
- **`@tailwindcss/vite` and `@tailwindcss/postcss` together.** Pick one — running both causes utilities to be processed twice and CSS bloat.
|
|
179
|
+
- **CSS import paths in HMR.** Vite is strict about case-sensitivity even on macOS. `@devalok/shilp-sutra/CSS` will not resolve; use the lowercase `/css`.
|
|
180
|
+
- **Multiple framer-motion copies.** Same fix as Next — see [install-next-app-router.md § 8](./install-next-app-router.md#8-common-gotchas).
|
|
181
|
+
- **Spacing utilities.** Use `p-ds-04` (not `p-4`). Tailwind composite text utilities: `text-heading-xl`, `text-body-md`, `text-code`.
|
|
182
|
+
|
|
183
|
+
## 9. What NOT to do
|
|
184
|
+
|
|
185
|
+
- ❌ Add `@devalok/shilp-sutra/tailwind` — the export was removed in 0.38.
|
|
186
|
+
- ❌ Add a `tailwind.config.{ts,js}` with `presets: [shilpSutra]` — JS preset removed.
|
|
187
|
+
- ❌ Try to use `next-themes` here — it requires Next. Use the bootstrap script + `useColorMode` shown in § 5.
|