@devalok/shilp-sutra 0.38.0 → 0.39.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/MIGRATION.md +118 -0
- package/dist/_chunks/badge-group.js +4 -4
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/chat.js +14 -14
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/date-picker.js +9 -9
- package/dist/_chunks/date-picker.js.map +1 -1
- package/dist/_chunks/document-preview.js +2 -2
- package/dist/_chunks/document-preview.js.map +1 -1
- package/dist/_chunks/file-preview.js +11 -11
- package/dist/_chunks/file-preview.js.map +1 -1
- package/dist/_chunks/image-preview.js +2 -2
- package/dist/_chunks/image-preview.js.map +1 -1
- package/dist/_chunks/mention-suggestion.js +5 -5
- package/dist/_chunks/mention-suggestion.js.map +1 -1
- package/dist/_chunks/popover.js +3 -3
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/rich-chat-input.js +33 -33
- package/dist/_chunks/rich-chat-input.js.map +1 -1
- package/dist/_chunks/shared.js +5 -5
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/text.js +2 -2
- package/dist/_chunks/text.js.map +1 -1
- package/dist/_chunks/tree-view.js +1 -1
- 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/command-bar.js +10 -10
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.js +4 -4
- package/dist/ai/conversation.js.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.js +1 -1
- package/dist/composed/bulk-action-bar.js.map +1 -1
- package/dist/composed/command-palette.js +5 -5
- 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/emoji-picker.js +4 -4
- package/dist/composed/emoji-picker.js.map +1 -1
- package/dist/composed/empty-state.js +1 -1
- 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/filter-bar.js +1 -1
- package/dist/composed/filter-bar.js.map +1 -1
- 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-text-editor.js +11 -11
- 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.js +3 -3
- package/dist/composed/status-badge.js.map +1 -1
- package/dist/shell/bottom-navbar.js +6 -6
- package/dist/shell/bottom-navbar.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.js +6 -6
- package/dist/shell/sidebar.js.map +1 -1
- package/dist/shell/top-bar.js +4 -4
- 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/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 +2 -2
- package/dist/ui/button.js +14 -14
- 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/index.js +5 -5
- package/dist/ui/charts/index.js.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.js +5 -5
- package/dist/ui/combobox.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.js +1 -1
- package/dist/ui/icon-button.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/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/pagination.js +1 -1
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/progress.js +1 -1
- 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.js +3 -3
- 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/stat-card.js +7 -7
- 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.js +2 -2
- 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/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/toggle.js +1 -1
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/dist/ui/tooltip.js.map +1 -1
- package/docs/components/_header.md +90 -1
- package/docs/recipes/customize-brand.md +85 -4
- package/docs/recipes/index.md +1 -1
- package/llms-full.txt +91 -2
- package/llms.txt +9 -1
- package/package.json +2 -1
- package/skill/README.md +99 -0
- package/skill/SKILL.md +144 -0
- package/skill/install.sh +59 -0
- package/skill/references/components-full.md +6997 -0
- package/skill/references/components.md +673 -0
- package/skill/references/customize-brand.md +299 -0
- package/skill/references/server-components.md +211 -0
- package/skill/references/setup-astro.md +180 -0
- package/skill/references/setup-next-app-router.md +232 -0
- package/skill/references/setup-next-pages.md +125 -0
- package/skill/references/setup-remix.md +173 -0
- package/skill/references/setup-tanstack-start.md +145 -0
- package/skill/references/setup-vite.md +172 -0
- package/skill/references/troubleshoot.md +219 -0
- /package/{LICENSE → skill/LICENSE} +0 -0
|
@@ -56,19 +56,100 @@ To swap to teal:
|
|
|
56
56
|
|
|
57
57
|
For a quick swap without redoing the full scale, only override step 9 (background) and step 11 (foreground). Other steps will still reference the original chroma — visually mismatched but functional.
|
|
58
58
|
|
|
59
|
-
###
|
|
59
|
+
### Shape presets (`[data-shape]`)
|
|
60
|
+
|
|
61
|
+
The simplest way to change roundness for the whole UI is to set a `data-shape` attribute on the document (or any subtree). Three presets ship by default — `sharp`, `slightly-rounded` (the default if no attribute), and `rounded`. Pill shapes (Badge, Switch, Slider, Avatar circle) stay pill in every preset.
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<!-- Whole-app, sharp/technical feel -->
|
|
65
|
+
<html data-shape="sharp">
|
|
66
|
+
|
|
67
|
+
<!-- Whole-app, soft/consumer feel -->
|
|
68
|
+
<html data-shape="rounded">
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
You can scope it to a subtree if a particular section wants different shape language than the rest:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
<div data-shape="sharp">
|
|
75
|
+
<DeveloperConsole />
|
|
76
|
+
</div>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Visual feel:
|
|
80
|
+
|
|
81
|
+
| Preset | Identity | Comparable to |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| `sharp` | Technical, precise, "serious software" | Vercel, Linear, terminal UIs |
|
|
84
|
+
| `slightly-rounded` (default) | Modern SaaS neutral | shadcn default, Stripe, Notion sidebar |
|
|
85
|
+
| `rounded` | Friendly, soft, consumer | iOS, Notion content, modern startup landings |
|
|
86
|
+
|
|
87
|
+
### Custom radius — override a role token
|
|
88
|
+
|
|
89
|
+
If a preset doesn't fit, you can override any semantic radius role token directly. Components reference these role tokens (not the primitive scale), so a single override propagates everywhere.
|
|
90
|
+
|
|
91
|
+
```css
|
|
92
|
+
/* Tighten controls only; leave overlays / surfaces alone */
|
|
93
|
+
:root {
|
|
94
|
+
--radius-control: 4px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Or scoped to a subtree */
|
|
98
|
+
.checkout {
|
|
99
|
+
--radius-control: 8px;
|
|
100
|
+
--radius-surface: 20px;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The role tokens (defaults shown — the "slightly-rounded" preset):
|
|
105
|
+
|
|
106
|
+
| Token | Default | Used by |
|
|
107
|
+
|--------------------------|---------|---------|
|
|
108
|
+
| `--radius-control` | 6px | Button, Input, Select, Tabs trigger, Toggle, Code block |
|
|
109
|
+
| `--radius-control-inner` | 2px | Checkbox box, ±/close buttons, inline Code |
|
|
110
|
+
| `--radius-surface` | 10px | Card, Alert, Accordion |
|
|
111
|
+
| `--radius-overlay-sm` | 6px | Tooltip, Toast |
|
|
112
|
+
| `--radius-overlay` | 10px | Popover, HoverCard, DropdownMenu / ContextMenu / Menubar content, listboxes |
|
|
113
|
+
| `--radius-overlay-lg` | 16px | Dialog, AlertDialog, Sheet, BottomSheet, ColorInput picker |
|
|
114
|
+
| `--radius-pill` | 9999px | Badge, StatusDot, Radio, Switch, Slider, Progress, Avatar circle |
|
|
115
|
+
| `--radius-bubble` | 24px | ChatMessage bubble |
|
|
116
|
+
|
|
117
|
+
### Build your own preset
|
|
118
|
+
|
|
119
|
+
Define your own `[data-shape="…"]` block and swap to it whenever you want:
|
|
120
|
+
|
|
121
|
+
```css
|
|
122
|
+
[data-shape="brand-soft"] {
|
|
123
|
+
--radius-control: 8px;
|
|
124
|
+
--radius-control-inner: 3px;
|
|
125
|
+
--radius-surface: 14px;
|
|
126
|
+
--radius-overlay-sm: 8px;
|
|
127
|
+
--radius-overlay: 14px;
|
|
128
|
+
--radius-overlay-lg: 20px;
|
|
129
|
+
--radius-pill: 9999px;
|
|
130
|
+
--radius-bubble: 28px;
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<html data-shape="brand-soft">
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Change the primitive radius scale (advanced)
|
|
139
|
+
|
|
140
|
+
If you're rebuilding the entire system rather than just rebranding, you can also override the primitive scale that the role tokens reference:
|
|
60
141
|
|
|
61
142
|
```css
|
|
62
143
|
@theme {
|
|
63
|
-
--radius-ds-sm: 0.25rem;
|
|
64
|
-
--radius-ds-md: 0.5rem;
|
|
144
|
+
--radius-ds-sm: 0.25rem;
|
|
145
|
+
--radius-ds-md: 0.5rem;
|
|
65
146
|
--radius-ds-lg: 0.75rem;
|
|
66
147
|
--radius-ds-xl: 1rem;
|
|
67
148
|
--radius: 0.5rem; /* unsuffixed — generates bare `rounded` */
|
|
68
149
|
}
|
|
69
150
|
```
|
|
70
151
|
|
|
71
|
-
|
|
152
|
+
Most consumers should NOT touch this — overriding the role tokens above is the cleaner path.
|
|
72
153
|
|
|
73
154
|
### Change fonts
|
|
74
155
|
|
package/docs/recipes/index.md
CHANGED
|
@@ -29,7 +29,7 @@ If the framework is not listed, start with [install-vite.md](./install-vite.md)
|
|
|
29
29
|
|
|
30
30
|
| Recipe | What it covers |
|
|
31
31
|
|---|---|
|
|
32
|
-
| [customize-brand.md](./customize-brand.md) | Token override cookbook —
|
|
32
|
+
| [customize-brand.md](./customize-brand.md) | Token override cookbook — colors, radius role tokens, `[data-shape]` presets, fonts, spacing scale, dark-mode mapping |
|
|
33
33
|
| [server-components.md](./server-components.md) | Per-component RSC-safety matrix; correct import patterns for Server Components |
|
|
34
34
|
|
|
35
35
|
## Diagnostics
|
package/llms-full.txt
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> All variant values and props verified from source CVA definitions.
|
|
6
6
|
>
|
|
7
7
|
> Package: @devalok/shilp-sutra
|
|
8
|
-
> Version: 0.
|
|
8
|
+
> Version: 0.39.0
|
|
9
9
|
>
|
|
10
10
|
> **If you are an AI agent reading this file top-to-bottom:** the Setup
|
|
11
11
|
> section below is authoritative. If any later per-component doc or a
|
|
@@ -67,7 +67,8 @@ transpilePackages: ['@devalok/shilp-sutra', '@devalok/shilp-sutra-brand'],
|
|
|
67
67
|
| `--leading-ds-*` | `leading-ds-tight`, `leading-ds-normal` | ds-namespaced |
|
|
68
68
|
| `--tracking-*` | `tracking-tight`, `tracking-normal` | standard TW namespace |
|
|
69
69
|
| `--font-*`, `--font-weight-*` | `font-sans`, `font-semibold` | standard TW namespace |
|
|
70
|
-
| `--radius`, `--radius-ds-*` | `rounded` (bare), `rounded-ds-lg` | unprefixed + ds-namespaced |
|
|
70
|
+
| `--radius`, `--radius-ds-*` | `rounded` (bare), `rounded-ds-lg` | unprefixed + ds-namespaced primitive scale |
|
|
71
|
+
| `--radius-control`, `--radius-surface`, `--radius-overlay-*`, `--radius-pill`, `--radius-bubble` | `rounded-control`, `rounded-surface`, `rounded-overlay`, `rounded-pill`, `rounded-bubble` | semantic roles (PUBLIC) — components reference these, `[data-shape]` presets remap them |
|
|
71
72
|
| `--shadow-*` | `shadow-raised`, `shadow-overlay` | semantic names only; bare `shadow` is NOT generated (TW4 has no default scale and we don't define `--shadow`) |
|
|
72
73
|
| `--ease-*` | `ease-productive-standard` | semantic names |
|
|
73
74
|
| `--breakpoint-*` | `md:`, `lg:` | standard TW namespace |
|
|
@@ -105,6 +106,94 @@ See `MIGRATION.md#v0370--tailwind-4-css-first-migration` (root of this package).
|
|
|
105
106
|
|
|
106
107
|
---
|
|
107
108
|
|
|
109
|
+
## Shape Presets & Radius Roles (v0.39+)
|
|
110
|
+
|
|
111
|
+
Radius has TWO layers:
|
|
112
|
+
|
|
113
|
+
1. **Primitive scale** — `--radius-ds-sm/md/lg/xl/2xl/full` (private; internal building blocks).
|
|
114
|
+
2. **Semantic roles** — `--radius-control`, `--radius-control-inner`, `--radius-surface`, `--radius-overlay-sm/md/lg`, `--radius-pill`, `--radius-bubble`. Components reference roles. Consumers customize these.
|
|
115
|
+
|
|
116
|
+
### Role token reference
|
|
117
|
+
|
|
118
|
+
| Token | Default (px) | Utility class | Used by |
|
|
119
|
+
|--------------------------|--------------|--------------------------|---------|
|
|
120
|
+
| `--radius-control` | 6 | `rounded-control` | Button, Input, Select, Combobox, Autocomplete, NumberInput, Toggle, ToggleGroup, Tabs trigger (contained), menu items, sidebar menu button, stepper, pagination, code block, InputOTP slot |
|
|
121
|
+
| `--radius-control-inner` | 2 | `rounded-control-inner` | Checkbox box, +/− buttons, close X buttons, focus rings on text links, small badges, color preset swatches, skeleton text bars, inline Code |
|
|
122
|
+
| `--radius-surface` | 10 | `rounded-surface` | Card, StatCard, DataTableCard, Alert, Accordion trigger, FileUpload dropzone, Tabs list (contained) |
|
|
123
|
+
| `--radius-overlay-sm` | 6 | `rounded-overlay-sm` | Tooltip, Toast, charts internal tooltip |
|
|
124
|
+
| `--radius-overlay` | 10 | `rounded-overlay` | Popover, HoverCard, DropdownMenu / ContextMenu / Menubar content, Select / Combobox / Autocomplete listbox, NavigationMenu viewport, DataTable bulk-actions toolbar, SplitButton dropdown |
|
|
125
|
+
| `--radius-overlay-lg` | 16 | `rounded-overlay-lg` | Dialog, AlertDialog, Sheet (top corners), BottomSheet, ColorInput picker panel, ChatMessageInput wrapper, Sidebar inset variant |
|
|
126
|
+
| `--radius-pill` | 9999 | `rounded-pill` | Badge, BadgeIndicator, StatusDot, Radio, Switch, Slider, Progress, Avatar circle, SegmentedControl item, ChatMessage reaction button, drag handles |
|
|
127
|
+
| `--radius-bubble` | 24 | `rounded-bubble` | ChatMessage bubble |
|
|
128
|
+
|
|
129
|
+
Bare `rounded-ds-*` and `rounded-full` are BANNED in components (enforced by pre-publish audit gate). Token-showcase stories (`forced-colors.stories.tsx`, `FoundationsShowcase.tsx`) are explicitly allowlisted.
|
|
130
|
+
|
|
131
|
+
### Shape presets — `[data-shape]`
|
|
132
|
+
|
|
133
|
+
Apply to `<html>`, app root, or any subtree. Three presets ship by default:
|
|
134
|
+
|
|
135
|
+
| Preset | control / control-inner | surface | overlay-sm / overlay / overlay-lg | bubble | Feel |
|
|
136
|
+
|---|---|---|---|---|---|
|
|
137
|
+
| `sharp` | 2 / 0 | 4 | 2 / 4 / 6 | 8 | Vercel / Linear / dev-tool |
|
|
138
|
+
| `slightly-rounded` (default) | 6 / 2 | 10 | 6 / 10 / 16 | 24 | shadcn / Stripe / Notion sidebar |
|
|
139
|
+
| `rounded` | 10 / 4 | 16 | 10 / 16 / 24 | 32 | iOS / Notion content / consumer |
|
|
140
|
+
|
|
141
|
+
```html
|
|
142
|
+
<!-- Whole-app preset -->
|
|
143
|
+
<html data-shape="sharp">
|
|
144
|
+
|
|
145
|
+
<!-- Or scoped per subtree -->
|
|
146
|
+
<div data-shape="rounded">...</div>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`--radius-pill` stays `9999px` in every preset by design — pill shapes are shape-by-meaning, not shape-by-style.
|
|
150
|
+
|
|
151
|
+
### Per-token consumer overrides
|
|
152
|
+
|
|
153
|
+
Override any role globally or scoped:
|
|
154
|
+
|
|
155
|
+
```css
|
|
156
|
+
:root { --radius-control: 4px; } /* tighten controls only */
|
|
157
|
+
.checkout { --radius-control: 8px; --radius-surface: 20px; } /* per-subtree */
|
|
158
|
+
[data-shape="rounded"] .admin { --radius-control: 6px; } /* extend a preset */
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Custom preset
|
|
162
|
+
|
|
163
|
+
```css
|
|
164
|
+
[data-shape="brand-soft"] {
|
|
165
|
+
--radius-control: 8px;
|
|
166
|
+
--radius-control-inner: 3px;
|
|
167
|
+
--radius-surface: 14px;
|
|
168
|
+
--radius-overlay-sm: 8px;
|
|
169
|
+
--radius-overlay: 14px;
|
|
170
|
+
--radius-overlay-lg: 20px;
|
|
171
|
+
--radius-pill: 9999px;
|
|
172
|
+
--radius-bubble: 28px;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
```html
|
|
177
|
+
<html data-shape="brand-soft">
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Migration from `rounded-ds-*` / `rounded-full`
|
|
181
|
+
|
|
182
|
+
```diff
|
|
183
|
+
- className="rounded-ds-md ..." → + className="rounded-control ..."
|
|
184
|
+
- className="rounded-ds-lg ..." → + className="rounded-surface ..." /* card/panel context */
|
|
185
|
+
- className="rounded-ds-lg ..." → + className="rounded-overlay ..." /* popover/dropdown context */
|
|
186
|
+
- className="rounded-ds-xl ..." → + className="rounded-overlay-lg ..." /* dialog/sheet */
|
|
187
|
+
- className="rounded-ds-2xl ..." → + className="rounded-bubble ..."
|
|
188
|
+
- className="rounded-ds-sm ..." → + className="rounded-control-inner ..."
|
|
189
|
+
- className="rounded-ds-full ..." → + className="rounded-pill ..."
|
|
190
|
+
- className="rounded-full ..." → + className="rounded-pill ..."
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Re-runnable codemod: `scripts/migrate-radius-roles.mjs` (dry-run by default, `--write` to apply).
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
108
197
|
## Architecture Notes
|
|
109
198
|
|
|
110
199
|
### The Two-Axis Variant System
|
package/llms.txt
CHANGED
|
@@ -28,6 +28,14 @@ Other recipes:
|
|
|
28
28
|
|
|
29
29
|
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.
|
|
30
30
|
|
|
31
|
+
## NEW (v0.39.0)
|
|
32
|
+
|
|
33
|
+
- **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.
|
|
34
|
+
- **Semantic radius role tokens.** New: `--radius-control`, `--radius-control-inner`, `--radius-surface`, `--radius-overlay-sm`, `--radius-overlay`, `--radius-overlay-lg`, `--radius-pill`, `--radius-bubble`. Consumers override any role globally or scoped — e.g. `:root { --radius-control: 4px; }`.
|
|
35
|
+
- **Visual changes (no API breaks).** Button no longer scales radius with size (md/lg/xl/lg → all 6px); Input lg matches Button at same height; SegmentedControl items now actually pill; Tabs trigger (contained) matches Button; Tooltip belongs to its own `overlay-sm` tier with Toast; Menubar trigger matches DropdownMenu item; Autocomplete listbox matches Popover. If you preferred old chunky big controls, set `data-shape="rounded"` for v0.38-era feel.
|
|
36
|
+
- **Pre-publish audit gate.** Components in `src/ui/` can no longer use `rounded-ds-*` or bare `rounded-full` — must use semantic roles. Composed/shell migration is v0.40.0 (gate scoped accordingly).
|
|
37
|
+
- See `customize-brand.md` recipe for the full role token list and how to define your own preset.
|
|
38
|
+
|
|
31
39
|
## BREAKING CHANGES (v0.37.0 — Tailwind 4 CSS-first)
|
|
32
40
|
|
|
33
41
|
**Setup migration only — component APIs unchanged.** See `MIGRATION.md` at the root of this package (or https://github.com/devalok-design/shilp-sutra/blob/main/MIGRATION.md#v0370--tailwind-4-css-first-migration) for the full guide.
|
|
@@ -45,7 +53,7 @@ The repo URL for these files is `https://github.com/devalok-design/shilp-sutra/t
|
|
|
45
53
|
- **Node engines floor dropped.** No `engines.node` declared — use any Node 18+.
|
|
46
54
|
- **New export `@devalok/shilp-sutra/css`** — primary consumer entry for TW4 setup.
|
|
47
55
|
- **Source class hygiene:** `w-[--var]` → `w-(--var)`, `theme(spacing.N)` → literal, `bg-gradient-to-*` → `bg-linear-to-*`, bare `shadow` → explicit like `shadow-raised`. Codemod your own code; grep: `grep -rn 'w-\[--\|bg-gradient-to-\|theme(spacing' src/`.
|
|
48
|
-
- **Tokens now expose TW4 namespaces.** Spacing is `--spacing-ds-*` (so `p-ds-03`, not `p-3`). Typography uses `--text-ds-*`, `--leading-ds-*`. Radius
|
|
56
|
+
- **Tokens now expose TW4 namespaces.** Spacing is `--spacing-ds-*` (so `p-ds-03`, not `p-3`). Typography uses `--text-ds-*`, `--leading-ds-*`. Radius has TWO layers: primitive scale (`--radius-ds-sm/md/lg/xl/2xl/full`) AND semantic roles (`--radius-control`, `--radius-surface`, `--radius-overlay-sm/md/lg`, `--radius-pill`, `--radius-bubble`). Components reference roles — consumers swap roles via `[data-shape]` presets or override individual tokens. Z-layer utilities are custom-generated (`z-popover`, `z-dropdown`, etc.).
|
|
49
57
|
- **Dark mode variant:** `@custom-variant dark (&:where(.dark *))` — identical semantics to old `darkMode: 'class'`. `.dark` on `<html>` or `<body>` activates everything below.
|
|
50
58
|
|
|
51
59
|
## NEW (v0.36.0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devalok/shilp-sutra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "Devalok Design System — accessible React components, OKLCH design tokens, and Tailwind 4 CSS-first setup. Ships with AI-agent setup recipes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Devalok Design & Strategy Studios <shilp-sutra@devalok.in>",
|
|
@@ -734,6 +734,7 @@
|
|
|
734
734
|
"docs/recipes",
|
|
735
735
|
"docs/rollback.md",
|
|
736
736
|
"fonts",
|
|
737
|
+
"skill",
|
|
737
738
|
"MIGRATION.md",
|
|
738
739
|
"README.md",
|
|
739
740
|
"llms.txt",
|
package/skill/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# shilp-sutra — Devalok Design System
|
|
2
|
+
|
|
3
|
+
> Agent Skill for `@devalok/shilp-sutra` — Devalok Design & Strategy Studios' React design system. Tailwind 4, React 19, CVA, OKLCH tokens, framer-motion, 110+ accessible components.
|
|
4
|
+
|
|
5
|
+
Use this skill when working in a React project that depends on `@devalok/shilp-sutra` (or when adding the package to one). It teaches the agent the correct setup, the per-framework playbook, the component API, the brand-token override pattern, and the Server Component import rules — all from the same files the design system ships in its npm tarball, so the skill never drifts from the live package.
|
|
6
|
+
|
|
7
|
+
## When the agent should activate this skill
|
|
8
|
+
|
|
9
|
+
- The user mentions `shilp-sutra`, `@devalok`, or Devalok's design system.
|
|
10
|
+
- The project's `package.json` lists `@devalok/shilp-sutra` or `@devalok/shilp-sutra-brand`.
|
|
11
|
+
- The user asks to install Tailwind, add UI components, theme an app, or migrate from shadcn/MUI/Chakra in a project that already has the package.
|
|
12
|
+
|
|
13
|
+
## What's inside
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
shilp-sutra/
|
|
17
|
+
├── SKILL.md # Entry — load this first
|
|
18
|
+
├── README.md # This file (marketplace listing)
|
|
19
|
+
├── LICENSE # MIT
|
|
20
|
+
└── references/
|
|
21
|
+
├── components.md # Concise component cheatsheet (~660 lines)
|
|
22
|
+
├── components-full.md # Exhaustive per-component reference (~6900 lines)
|
|
23
|
+
├── setup-next-app-router.md # Next.js (App Router) install playbook
|
|
24
|
+
├── setup-next-pages.md # Next.js (Pages Router) install playbook
|
|
25
|
+
├── setup-vite.md # Vite + React install playbook
|
|
26
|
+
├── setup-astro.md # Astro install playbook
|
|
27
|
+
├── setup-remix.md # Remix install playbook
|
|
28
|
+
├── setup-tanstack-start.md # TanStack Start install playbook
|
|
29
|
+
├── customize-brand.md # Token override cookbook
|
|
30
|
+
├── server-components.md # RSC-safety matrix and import patterns
|
|
31
|
+
└── troubleshoot.md # Decision tree for the 8 most common breakages
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
### Claude Code (personal)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Option A — clone the repo (sparse) and copy the skill
|
|
40
|
+
git clone --depth=1 --filter=blob:none --sparse https://github.com/devalok-design/shilp-sutra
|
|
41
|
+
cd shilp-sutra
|
|
42
|
+
git sparse-checkout set skills/shilp-sutra
|
|
43
|
+
cp -r skills/shilp-sutra ~/.claude/skills/shilp-sutra
|
|
44
|
+
|
|
45
|
+
# Option B — if @devalok/shilp-sutra is already a dependency in your project
|
|
46
|
+
cp -r node_modules/@devalok/shilp-sutra/skill ~/.claude/skills/shilp-sutra
|
|
47
|
+
|
|
48
|
+
# Option C — direct curl (latest from main)
|
|
49
|
+
curl -fsSL https://raw.githubusercontent.com/devalok-design/shilp-sutra/main/skills/shilp-sutra/install.sh | bash
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Restart Claude Code or open a new session. Verify with `What skills are available?` — `shilp-sutra` should appear.
|
|
53
|
+
|
|
54
|
+
### Project-scoped (commit to repo)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mkdir -p .claude/skills
|
|
58
|
+
curl -fsSL https://raw.githubusercontent.com/devalok-design/shilp-sutra/main/skills/shilp-sutra/install.sh | INSTALL_DIR=.claude/skills bash
|
|
59
|
+
git add .claude/skills/shilp-sutra
|
|
60
|
+
git commit -m "chore: add shilp-sutra agent skill"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Every contributor (and their agent) on the project gets the skill automatically.
|
|
64
|
+
|
|
65
|
+
### Cursor, Codex, Aider, and other tools
|
|
66
|
+
|
|
67
|
+
The skill follows the [Agent Skills open standard](https://agentskills.io/specification) — any compatible agent loads it from the same directory. See your tool's docs for the install path.
|
|
68
|
+
|
|
69
|
+
## What it teaches the agent
|
|
70
|
+
|
|
71
|
+
- **Setup playbook** for Next.js (App + Pages), Vite, Astro, Remix, TanStack Start. Each recipe is concrete, copy-pasteable, and has been validated against real consumer projects.
|
|
72
|
+
- **Hard constraints** — the eight ways to break Tailwind 4 + framer-motion setup that look unrelated to the design system but aren't.
|
|
73
|
+
- **Component API** — every component, every variant, every example. Two layers: a cheatsheet for fast scans and a full reference for prop tables.
|
|
74
|
+
- **RSC import patterns** — which components are server-safe, which need `"use client"`, and why per-component imports matter for Next.js.
|
|
75
|
+
- **Theming** — how to override OKLCH ramps, radius, fonts, and the spacing scale without forking the package.
|
|
76
|
+
- **Troubleshoot tree** — the eight most common breakages with the symptom, root cause, and exact fix for each.
|
|
77
|
+
|
|
78
|
+
## Source of truth
|
|
79
|
+
|
|
80
|
+
This skill is **built from** the package's own documentation (`packages/core/llms.txt`, `packages/core/llms-full.txt`, `packages/core/docs/recipes/`) by `scripts/build-skill.mjs`. The pre-publish audit fails if the bundled references drift from source, so the skill stays in sync with every release.
|
|
81
|
+
|
|
82
|
+
## Versioning
|
|
83
|
+
|
|
84
|
+
The skill version tracks the package version. Both are at the top of `SKILL.md` (frontmatter `metadata.version`) and in `package.json`. If you've installed the skill but upgraded the package, regenerate the skill or pull the latest from the repo.
|
|
85
|
+
|
|
86
|
+
## Feedback
|
|
87
|
+
|
|
88
|
+
If a recipe is wrong, a constraint is outdated, or a component behavior contradicts the docs, file an issue at <https://github.com/devalok-design/shilp-sutra/issues> with the label `ai-agent-feedback`. Include the package version, the file/recipe path, the command or error, and what you expected.
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
MIT © Devalok Design & Strategy Studios. See `LICENSE`.
|
|
93
|
+
|
|
94
|
+
## Links
|
|
95
|
+
|
|
96
|
+
- npm: <https://www.npmjs.com/package/@devalok/shilp-sutra>
|
|
97
|
+
- Storybook: <https://devalok-design.github.io/shilp-sutra/>
|
|
98
|
+
- Repo: <https://github.com/devalok-design/shilp-sutra>
|
|
99
|
+
- Agent Skills spec: <https://agentskills.io/specification>
|
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
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.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: "0.38.0"
|
|
7
|
+
author: Devalok Design & Strategy Studios
|
|
8
|
+
homepage: https://github.com/devalok-design/shilp-sutra
|
|
9
|
+
npm: https://www.npmjs.com/package/@devalok/shilp-sutra
|
|
10
|
+
source: https://github.com/devalok-design/shilp-sutra/tree/main/skills/shilp-sutra
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# shilp-sutra — Devalok Design System
|
|
14
|
+
|
|
15
|
+
`@devalok/shilp-sutra` is a React design system. It is **not** shadcn/ui. It uses similar primitives (Radix, CVA, Tailwind) but the consumer setup, token namespace, and component APIs are different. Your training data is older than the current package — read the bundled references before writing code, do not improvise from memory.
|
|
16
|
+
|
|
17
|
+
## When this skill triggers
|
|
18
|
+
|
|
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`).
|
|
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
|
+
- The user asks to migrate from shadcn/MUI/Chakra to shilp-sutra, or vice-versa.
|
|
23
|
+
|
|
24
|
+
## Decision tree (read this first, then jump)
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Q1. Is @devalok/shilp-sutra already installed?
|
|
28
|
+
NO → go to "First-time setup" below
|
|
29
|
+
YES → continue
|
|
30
|
+
|
|
31
|
+
Q2. What does the user want to do?
|
|
32
|
+
a) Add or use a component → references/components.md (skim), then components-full.md (deep)
|
|
33
|
+
b) Change colors/fonts/radius → references/customize-brand.md
|
|
34
|
+
c) Server Components / Next.js → references/server-components.md
|
|
35
|
+
d) Something is broken → references/troubleshoot.md
|
|
36
|
+
e) Upgrading from older version → fetch MIGRATION.md from repo or node_modules
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## First-time setup
|
|
40
|
+
|
|
41
|
+
Detect the framework from the consumer's lockfile and config files, then open the matching reference:
|
|
42
|
+
|
|
43
|
+
| Detection | Reference |
|
|
44
|
+
| ------------------------------------------------------------------ | ---------------------------------------- |
|
|
45
|
+
| `app/` directory + `next.config.*` | `references/setup-next-app-router.md` |
|
|
46
|
+
| `pages/` directory (no `app/`) + `next.config.*` | `references/setup-next-pages.md` |
|
|
47
|
+
| `vite.config.*` + `react` in deps (no Remix/TanStack) | `references/setup-vite.md` |
|
|
48
|
+
| `astro.config.*` | `references/setup-astro.md` |
|
|
49
|
+
| `remix.config.*` or Remix v2 with Vite | `references/setup-remix.md` |
|
|
50
|
+
| `app.config.*` with `@tanstack/start` | `references/setup-tanstack-start.md` |
|
|
51
|
+
| Anything else (React + Tailwind) | Fall back to `setup-vite.md` and adapt |
|
|
52
|
+
|
|
53
|
+
Every line in those recipes is there because skipping it broke a real consumer. Do not paraphrase steps — execute them.
|
|
54
|
+
|
|
55
|
+
## Hard constraints (these silently break things if violated)
|
|
56
|
+
|
|
57
|
+
These are non-negotiable. Violating any of them produces runtime errors that look unrelated to the design system.
|
|
58
|
+
|
|
59
|
+
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
|
+
```css
|
|
61
|
+
@import "tailwindcss";
|
|
62
|
+
@import "@devalok/shilp-sutra/css";
|
|
63
|
+
```
|
|
64
|
+
2. **`framer-motion@^12` is a required peer dep.** The consumer must install it. Module-scoped contexts (`MotionConfig`, `LayoutGroup`, `AnimatePresence`) silently break if two copies of framer-motion resolve. Configure pnpm/yarn to dedupe.
|
|
65
|
+
3. **`sonner@^2` is an optional peer dep.** Install only when rendering `<Toaster />`.
|
|
66
|
+
4. **Per-component imports are mandatory for React Server Components.** `@devalok/shilp-sutra/ui/text` is server-safe; the barrel `@devalok/shilp-sutra/ui` pulls client code and crashes RSC. See `references/server-components.md` for the per-component matrix.
|
|
67
|
+
5. **Spacing namespace is `--spacing-ds-*`.** Write `p-ds-04`, not `p-4`. Same for typography: `text-ds-body-md`, not `text-base`.
|
|
68
|
+
6. **Bare `shadow` does not exist in Tailwind 4.** Use `shadow-raised`, `shadow-overlay`, `shadow-floating`. Bare `rounded` is fine (maps to `--radius`); `rounded-ds-lg` etc. for sized variants.
|
|
69
|
+
7. **Do not invent variant names.** CVA source files at `node_modules/@devalok/shilp-sutra/dist/ui/*.d.ts` (or `packages/core/src/ui/*.tsx` in the DS repo) are authoritative. When in doubt, check `references/components-full.md` for the enumerated list. If you guess a variant that doesn't exist, the prop is silently dropped and the default applies.
|
|
70
|
+
8. **Default `variant="soft"` over `variant="outline"` for non-primary Button actions.** Soft (tinted bg + tinted text, no border) reads warmer in data-dense UIs. Use outline only when soft would disappear on a colored background or when a primary/secondary hierarchy needs a visible border.
|
|
71
|
+
|
|
72
|
+
## Surface layering (when building cards, panels, dialogs)
|
|
73
|
+
|
|
74
|
+
The semantic surface names are the public API. The old numeric names (`surface-1` … `surface-4`) are deprecated aliases — do not use them.
|
|
75
|
+
|
|
76
|
+
| Token | Use for |
|
|
77
|
+
| ------------------------------ | ---------------------------------------------------------------------------------- |
|
|
78
|
+
| `bg-surface-base` | Page background |
|
|
79
|
+
| `bg-surface-raised` | Cards, widgets, panels — anything that sits **on** the page |
|
|
80
|
+
| `bg-surface-sunken` | Shell chrome (Sidebar, TopBar), recessed regions |
|
|
81
|
+
| `bg-surface-overlay` | Dialog, Sheet, Popover, Toast, Combobox menus, any floating overlay |
|
|
82
|
+
| `bg-surface-raised-hover` | Hover state on raised surfaces |
|
|
83
|
+
| `bg-surface-raised-active` | Active/pressed state on raised surfaces |
|
|
84
|
+
| `bg-surface-disabled` | Disabled surfaces (paired with `text-surface-fg-disabled`) |
|
|
85
|
+
| `bg-surface-inverted` | Inverted surfaces (dark on light themes, light on dark themes) |
|
|
86
|
+
|
|
87
|
+
Putting `bg-surface-base` on a card is a bug — cards belong on `surface-raised`. The pre-publish audit in the DS repo enforces this and blocks the old numeric aliases in component source files.
|
|
88
|
+
|
|
89
|
+
## Adding a component
|
|
90
|
+
|
|
91
|
+
1. Skim `references/components.md` — the concise cheatsheet, ~660 lines. Tells you what exists, what variants ship, what the common gotchas are.
|
|
92
|
+
2. If `components.md` does not have enough detail (you need full prop tables, every variant, every example), open `references/components-full.md`.
|
|
93
|
+
3. Import from the per-component entry: `import { Button } from "@devalok/shilp-sutra/ui/button"`. The barrel `@devalok/shilp-sutra/ui` works in client-only contexts but is heavier — prefer per-component.
|
|
94
|
+
4. Use **semantic tokens** for color (`text-foreground`, `bg-surface-2`, `border-border-default`). Never raw OKLCH values, never `text-white`.
|
|
95
|
+
5. Compose with primitives the package already ships. Do not rebuild Dialog/Popover/Combobox from scratch.
|
|
96
|
+
|
|
97
|
+
## Theming and brand customization
|
|
98
|
+
|
|
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
|
+
|
|
101
|
+
For the Devalok logo and other brand assets, the sibling package `@devalok/shilp-sutra-brand` ships SVG + PNG. Install it separately.
|
|
102
|
+
|
|
103
|
+
## Server Components and import patterns
|
|
104
|
+
|
|
105
|
+
`references/server-components.md` has the per-component RSC-safety matrix. The short version:
|
|
106
|
+
|
|
107
|
+
- Layout, typography, and presentational components (`Text`, `Heading`, `Card`, `Container`, `Stack`) → server-safe.
|
|
108
|
+
- Interactive components (`Button`, `Dialog`, `Combobox`, `DataTable`, anything with hooks or `framer-motion`) → must be inside a `"use client"` boundary.
|
|
109
|
+
- 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.*`.
|
|
111
|
+
|
|
112
|
+
## When something breaks
|
|
113
|
+
|
|
114
|
+
Go straight to `references/troubleshoot.md`. It is a decision tree for the 8 most common breakages: Tailwind not detecting tokens, framer-motion duplicates, missing `transpilePackages`, wrong CSS import order, dark mode not toggling, RSC import errors, font 404s, hydration mismatches.
|
|
115
|
+
|
|
116
|
+
Do not guess — most of these failures look identical from the outside but have different root causes. The tree disambiguates.
|
|
117
|
+
|
|
118
|
+
## Browsing the system
|
|
119
|
+
|
|
120
|
+
- **Storybook** (live previews, every story, MCP server available when running locally): https://devalok-design.github.io/shilp-sutra/
|
|
121
|
+
- **Component reference (this skill)**: `references/components.md` (cheatsheet) and `references/components-full.md` (full API).
|
|
122
|
+
- **Source**: https://github.com/devalok-design/shilp-sutra — `packages/core/src/ui/*.tsx` are the CVA sources of truth.
|
|
123
|
+
|
|
124
|
+
When the package is installed locally, the same content also ships in the npm tarball:
|
|
125
|
+
|
|
126
|
+
- `node_modules/@devalok/shilp-sutra/llms.txt` — cheatsheet
|
|
127
|
+
- `node_modules/@devalok/shilp-sutra/llms-full.txt` — full reference
|
|
128
|
+
- `node_modules/@devalok/shilp-sutra/docs/recipes/` — setup recipes
|
|
129
|
+
- `node_modules/@devalok/shilp-sutra/skill/` — this skill (offline-installable)
|
|
130
|
+
|
|
131
|
+
## Reporting feedback
|
|
132
|
+
|
|
133
|
+
If a recipe is wrong, a constraint above is no longer accurate, or a component behavior contradicts the docs:
|
|
134
|
+
|
|
135
|
+
1. File a GitHub issue at https://github.com/devalok-design/shilp-sutra/issues with the label `ai-agent-feedback`.
|
|
136
|
+
2. Include the package version (`pnpm view @devalok/shilp-sutra version` or read from the consumer's lockfile), the file/recipe path, the exact command or error, and what you expected.
|
|
137
|
+
|
|
138
|
+
## Stay current
|
|
139
|
+
|
|
140
|
+
`@devalok/shilp-sutra` ships breaking changes during `0.x`. Before writing code:
|
|
141
|
+
|
|
142
|
+
1. Check the installed version: `cat node_modules/@devalok/shilp-sutra/package.json | grep version` (or read from the consumer's lockfile).
|
|
143
|
+
2. If the version is older than the metadata `version` field at the top of this SKILL.md, suggest the user upgrade and consult `MIGRATION.md` from the package root.
|
|
144
|
+
3. Never trust APIs you remember from earlier versions — re-check `components.md` against the installed version.
|
package/skill/install.sh
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Install the shilp-sutra Agent Skill into ~/.claude/skills (or $INSTALL_DIR).
|
|
3
|
+
#
|
|
4
|
+
# Usage:
|
|
5
|
+
# curl -fsSL https://raw.githubusercontent.com/devalok-design/shilp-sutra/main/skills/shilp-sutra/install.sh | bash
|
|
6
|
+
#
|
|
7
|
+
# Custom install dir (e.g. project-scoped):
|
|
8
|
+
# curl -fsSL ... | INSTALL_DIR=.claude/skills bash
|
|
9
|
+
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
REPO="devalok-design/shilp-sutra"
|
|
13
|
+
BRANCH="${BRANCH:-main}"
|
|
14
|
+
INSTALL_DIR="${INSTALL_DIR:-$HOME/.claude/skills}"
|
|
15
|
+
SKILL_NAME="shilp-sutra"
|
|
16
|
+
DEST="$INSTALL_DIR/$SKILL_NAME"
|
|
17
|
+
|
|
18
|
+
if [[ -d "$DEST" ]]; then
|
|
19
|
+
echo "warning: $DEST already exists. Overwriting."
|
|
20
|
+
rm -rf "$DEST"
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
mkdir -p "$DEST/references"
|
|
24
|
+
|
|
25
|
+
# Fetch the skill tree via the GitHub trees API and download each file.
|
|
26
|
+
echo "Fetching skill manifest from github.com/$REPO@$BRANCH ..."
|
|
27
|
+
tree_json="$(curl -fsSL "https://api.github.com/repos/$REPO/git/trees/$BRANCH?recursive=1")"
|
|
28
|
+
|
|
29
|
+
# Extract every path under skills/shilp-sutra/ that is a blob.
|
|
30
|
+
paths="$(printf '%s\n' "$tree_json" \
|
|
31
|
+
| python3 -c '
|
|
32
|
+
import json, sys
|
|
33
|
+
tree = json.load(sys.stdin).get("tree", [])
|
|
34
|
+
for item in tree:
|
|
35
|
+
if item.get("type") == "blob" and item.get("path", "").startswith("skills/shilp-sutra/"):
|
|
36
|
+
# Skip the install.sh itself when bootstrapping; user already has it via curl.
|
|
37
|
+
if item["path"].endswith("/install.sh"):
|
|
38
|
+
continue
|
|
39
|
+
print(item["path"])
|
|
40
|
+
')"
|
|
41
|
+
|
|
42
|
+
if [[ -z "$paths" ]]; then
|
|
43
|
+
echo "error: no files found under skills/shilp-sutra/ on $REPO@$BRANCH" >&2
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
count=0
|
|
48
|
+
while IFS= read -r path; do
|
|
49
|
+
rel="${path#skills/shilp-sutra/}"
|
|
50
|
+
target="$DEST/$rel"
|
|
51
|
+
mkdir -p "$(dirname "$target")"
|
|
52
|
+
curl -fsSL "https://raw.githubusercontent.com/$REPO/$BRANCH/$path" -o "$target"
|
|
53
|
+
count=$((count + 1))
|
|
54
|
+
done <<< "$paths"
|
|
55
|
+
|
|
56
|
+
echo
|
|
57
|
+
echo "installed $count files to $DEST"
|
|
58
|
+
echo "restart Claude Code (or open a new session) to pick up the skill."
|
|
59
|
+
echo "verify with: ask Claude 'what skills are available?'"
|