@devalok/shilp-sutra 0.44.0 → 0.45.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 +13 -11
- package/BREAKING.json +209 -27
- package/MIGRATION.md +34 -0
- package/README.md +12 -0
- package/dist/_chunks/badge-group.js +1 -0
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/block-shell.js +25 -0
- package/dist/_chunks/block-shell.js.map +1 -0
- package/dist/_chunks/chat.js +4 -2
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/document-preview.js +1 -1
- package/dist/_chunks/image-preview.js +4 -4
- package/dist/_chunks/shared.js +65 -78
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/success.js +108 -106
- package/dist/_chunks/success.js.map +1 -1
- package/dist/ai/blocks/block-shell.d.ts +19 -0
- package/dist/ai/blocks/block-shell.d.ts.map +1 -0
- 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/error.d.ts.map +1 -1
- package/dist/ai/blocks/error.js +5 -5
- package/dist/ai/blocks/error.js.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/blocks/text.js +4 -3
- package/dist/ai/blocks/text.js.map +1 -1
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +14 -12
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/shared.d.ts +10 -0
- package/dist/composed/file-preview/shared.d.ts.map +1 -1
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +149 -188
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +13 -4
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/composed/schedule-view.js +52 -39
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +115 -114
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/ui/badge-group.d.ts.map +1 -1
- package/dist/ui/card.d.ts +66 -16
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +85 -60
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +18 -18
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/data-table-body.d.ts.map +1 -1
- package/dist/ui/data-table-body.js +94 -64
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-card.d.ts.map +1 -1
- package/dist/ui/data-table-card.js +50 -43
- package/dist/ui/data-table-card.js.map +1 -1
- package/dist/ui/data-table-context.d.ts +0 -4
- package/dist/ui/data-table-context.d.ts.map +1 -1
- package/dist/ui/data-table-context.js +8 -12
- package/dist/ui/data-table-context.js.map +1 -1
- package/dist/ui/data-table-header.d.ts.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.d.ts.map +1 -1
- package/dist/ui/data-table.js +185 -182
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/index.d.ts +3 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +59 -58
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/segmented-control.js +4 -4
- package/dist/ui/segmented-control.js.map +1 -1
- package/dist/ui/separator.d.ts +6 -5
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js +7 -10
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +62 -129
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts +7 -0
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +144 -126
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/table-row-link.d.ts +45 -0
- package/dist/ui/table-row-link.d.ts.map +1 -0
- package/dist/ui/table-row-link.js +16 -0
- package/dist/ui/table-row-link.js.map +1 -0
- package/dist/ui/table.d.ts +49 -5
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +39 -29
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/toast-types.d.ts +10 -0
- package/dist/ui/toast-types.d.ts.map +1 -1
- package/dist/ui/toast.d.ts +6 -2
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +56 -54
- package/dist/ui/toast.js.map +1 -1
- package/docs/components/composed/content-card.md +2 -0
- package/docs/components/ui/button.md +3 -3
- package/docs/components/ui/card.md +27 -10
- package/docs/components/ui/color-input.md +2 -2
- package/docs/components/ui/data-table.md +8 -1
- package/docs/components/ui/segmented-control.md +2 -2
- package/docs/components/ui/separator.md +3 -1
- package/docs/components/ui/split-button.md +3 -0
- package/docs/components/ui/stat-card.md +10 -2
- package/docs/components/ui/table-row-link.md +41 -0
- package/docs/components/ui/table.md +69 -0
- package/docs/components/ui/toast.md +10 -6
- package/docs/recipes/install-next-app-router.md +1 -1
- package/docs/recipes/troubleshoot.md +1 -1
- package/llms.txt +159 -781
- package/make-kit/components/card.md +54 -16
- package/make-kit/components/table.md +45 -7
- package/make-kit/foundations/spacing.md +3 -1
- package/make-kit/foundations/surfaces.md +1 -1
- package/mcp-manifest.json +12349 -0
- package/mcp-manifest.schema.json +232 -0
- package/package.json +8 -3
- package/skill/README.md +0 -1
- package/skill/SKILL.md +9 -8
- package/skill/references/components.md +159 -781
- package/skill/references/setup-next-app-router.md +1 -1
- package/skill/references/troubleshoot.md +1 -1
- package/llms-full.txt +0 -7198
- package/llms-quick.txt +0 -251
- package/skill/references/components-full.md +0 -7200
|
@@ -6,18 +6,20 @@ The default container for any panel-style content that sits **on** the page.
|
|
|
6
6
|
import {
|
|
7
7
|
Card,
|
|
8
8
|
CardAction,
|
|
9
|
+
CardBleed,
|
|
9
10
|
CardHeader,
|
|
10
11
|
CardTitle,
|
|
11
12
|
CardDescription,
|
|
12
13
|
CardContent,
|
|
13
14
|
CardFooter,
|
|
15
|
+
CardSection,
|
|
14
16
|
} from '@devalok/shilp-sutra/ui/card'
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
## When to use
|
|
18
20
|
|
|
19
21
|
- Any rectangular region that reads as a discrete unit on the page: dashboards widgets, list items, marketing feature blocks.
|
|
20
|
-
-
|
|
22
|
+
- Header / actions / footer are built in as slots (`CardHeader`, `CardAction`, `CardFooter`) — don't reach for a wrapper. (`<ContentCard>` is deprecated; use Card slots.)
|
|
21
23
|
- Need just a tinted region with no card affordance? Use a `<div className="bg-surface-raised">` (rare; usually Card is right).
|
|
22
24
|
|
|
23
25
|
Card renders on `surface-raised` with `shadow-raised`. **Never** override its background or border.
|
|
@@ -38,27 +40,62 @@ Card renders on `surface-raised` with `shadow-raised`. **Never** override its ba
|
|
|
38
40
|
| `default` (default) | Standard border. |
|
|
39
41
|
| `accent`, `error`, `success`, `warning`, `info`, `neutral` | Border picks up the semantic color at step-7. Use to signal status without filling the whole card. |
|
|
40
42
|
|
|
41
|
-
## Sizes (
|
|
43
|
+
## Sizes (one CSS variable)
|
|
42
44
|
|
|
43
|
-
`size` on
|
|
45
|
+
`size` sets `--card-spacing` / `--card-gap` once on the root. The container reads them for its
|
|
46
|
+
vertical padding + inter-slot gap; every slot reads `--card-spacing` for its horizontal inset;
|
|
47
|
+
`CardAction` corners and `CardBleed` negations read the same variable.
|
|
44
48
|
|
|
45
|
-
| Size |
|
|
46
|
-
|
|
47
|
-
| `sm` | `ds-
|
|
48
|
-
| `md` (default) | `ds-
|
|
49
|
-
| `lg` | `ds-
|
|
49
|
+
| Size | `--card-spacing` | `--card-gap` |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| `sm` | `ds-05` (16 px) | `ds-03` (8 px) |
|
|
52
|
+
| `md` (default) | `ds-05b` (20 px) | `ds-04` (12 px) |
|
|
53
|
+
| `lg` | `ds-06` (24 px) | `ds-05` (16 px) |
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
To retune a single card, override the variable — never add `p-*`/`pt-*` classes:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<Card className="[--card-spacing:var(--spacing-ds-07)]">…</Card>
|
|
59
|
+
```
|
|
52
60
|
|
|
53
61
|
## Compound shape
|
|
54
62
|
|
|
55
63
|
```
|
|
56
|
-
Card (root)
|
|
57
|
-
|
|
64
|
+
Card (root) ← owns py + gap (vertical rhythm)
|
|
65
|
+
CardBleed side="top" ← optional full-bleed media (negates the card padding)
|
|
66
|
+
CardHeader ← owns px only
|
|
58
67
|
CardTitle
|
|
59
68
|
CardDescription
|
|
60
|
-
CardContent
|
|
61
|
-
CardFooter
|
|
69
|
+
CardContent ← owns px only
|
|
70
|
+
CardFooter ← owns px only
|
|
71
|
+
CardAction ← absolute corner overlay
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Direct children of Card span its **full width** (only slots are inset). A `<Separator />` or a
|
|
75
|
+
tinted band placed between slots is edge-to-edge for free. The flip side: **text must live inside
|
|
76
|
+
a slot** — a bare `<p>` as a direct child gets no horizontal inset (dev builds warn).
|
|
77
|
+
|
|
78
|
+
### CardBleed (escape the padding)
|
|
79
|
+
|
|
80
|
+
| Prop | Type | Notes |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| `side` | `'x'` (default) `\| 'top' \| 'bottom' \| 'y' \| 'all'` | Which card padding to negate. `top`/`bottom`/`y` are for **direct children** (cover images, edge bands) and inherit the card radius. `x`/`all` are for content **inside a slot**. Never use `x`/`all` on a direct child — it will overflow. |
|
|
83
|
+
|
|
84
|
+
### Horizontal cards
|
|
85
|
+
|
|
86
|
+
`orientation="horizontal"` turns the root into a padding-less row; put the media pane first and
|
|
87
|
+
wrap the text column in `<CardSection>`, which re-establishes py + gap from the same variables:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<Card orientation="horizontal">
|
|
91
|
+
<div className="w-28 shrink-0 overflow-hidden rounded-l-surface">
|
|
92
|
+
<img className="h-full w-full object-cover" src={thumb} alt="" />
|
|
93
|
+
</div>
|
|
94
|
+
<CardSection>
|
|
95
|
+
<CardHeader><CardTitle>Title</CardTitle></CardHeader>
|
|
96
|
+
<CardFooter>meta</CardFooter>
|
|
97
|
+
</CardSection>
|
|
98
|
+
</Card>
|
|
62
99
|
```
|
|
63
100
|
|
|
64
101
|
## Other props
|
|
@@ -152,6 +189,7 @@ Card (root)
|
|
|
152
189
|
- **Never** `bg-surface-base` on a Card — cards sit on `surface-raised`. The pre-publish audit rejects this.
|
|
153
190
|
- **Never** combine `border-*` + `shadow-*` on a Card. Pick one (Card already does — don't override).
|
|
154
191
|
- **Use `interactive` + `onClick` + `aria-label`** for clickable cards. Don't wrap a Card in a `<button>` — broken nesting.
|
|
155
|
-
- **`size` on Card** drives
|
|
156
|
-
- **
|
|
157
|
-
-
|
|
192
|
+
- **`size` on Card** drives all spacing via `--card-spacing`. Never set `p-*` on Card or a slot — override the variable if a one-off is truly needed.
|
|
193
|
+
- **Full-bleed** media/dividers use `<CardBleed>` (or plain direct children for full-width strips) — never negative-margin hacks.
|
|
194
|
+
- **Don't stack `default` cards inside another `default` card.** The nested one should be `flat` or `outline`, or better, a `bg-surface-base` recess.
|
|
195
|
+
- For row-style content (avatar + title + meta + actions), compose Card slots — `<ContentCard>` is deprecated and will be removed next major.
|
|
@@ -12,7 +12,9 @@ import {
|
|
|
12
12
|
TableHead,
|
|
13
13
|
TableCell,
|
|
14
14
|
TableCaption,
|
|
15
|
+
TableRowActions,
|
|
15
16
|
} from '@devalok/shilp-sutra/ui/table'
|
|
17
|
+
import { TableRowLink } from '@devalok/shilp-sutra/ui/table-row-link' // client-only
|
|
16
18
|
```
|
|
17
19
|
|
|
18
20
|
## When to use
|
|
@@ -39,7 +41,19 @@ Table (<table>)
|
|
|
39
41
|
TableCell
|
|
40
42
|
```
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
## Props
|
|
45
|
+
|
|
46
|
+
| Component | Prop | Values | Notes |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| `Table` | `density` | `compact` \| `standard` (default) \| `comfortable` | Rows ≈ 29 / 37 / 45 px via `--table-py`; header height tracks it |
|
|
49
|
+
| `Table` | `striped` | boolean | Opt-in zebra. Hairline separators are the default row cue — stripe only very wide/dense tables |
|
|
50
|
+
| `TableCell` / `TableHead` | `numeric` | boolean | Right-align + tabular figures. Quantities only — dates/phones/IDs stay left |
|
|
51
|
+
| `TableRowActions` | `persist` | boolean | Actions always visible instead of hover/focus reveal |
|
|
52
|
+
| `TableRowLink` | `href`, `stretch` | string, boolean (default true) | Real-anchor whole-row navigation; `stretch={false}` = title-only link |
|
|
53
|
+
|
|
54
|
+
Everything else is a thin semantic wrapper over standard HTML attributes plus `className`.
|
|
55
|
+
|
|
56
|
+
**Density → cell content.** Rows grow silently when content is taller than the text line: `compact` = text only, `standard` = `Avatar size="xs"` max + single-line identity, `comfortable` = the only density for two-line identity (name + email).
|
|
43
57
|
|
|
44
58
|
## Examples
|
|
45
59
|
|
|
@@ -104,22 +118,23 @@ Each component is a thin semantic wrapper — no props beyond standard HTML attr
|
|
|
104
118
|
</Table>
|
|
105
119
|
```
|
|
106
120
|
|
|
107
|
-
**Row actions (
|
|
121
|
+
**Row actions (hover/focus-revealed via TableRowActions):**
|
|
108
122
|
```tsx
|
|
109
123
|
<Table>
|
|
110
124
|
<TableHeader>
|
|
111
125
|
<TableRow>
|
|
112
126
|
<TableHead>File</TableHead>
|
|
113
|
-
<TableHead>Size</TableHead>
|
|
114
|
-
<TableHead className="w-12"
|
|
127
|
+
<TableHead numeric>Size</TableHead>
|
|
128
|
+
<TableHead className="w-12"><span className="sr-only">Actions</span></TableHead>
|
|
115
129
|
</TableRow>
|
|
116
130
|
</TableHeader>
|
|
117
131
|
<TableBody>
|
|
118
132
|
{files.map((f) => (
|
|
119
133
|
<TableRow key={f.id}>
|
|
120
134
|
<TableCell>{f.name}</TableCell>
|
|
121
|
-
<TableCell>{formatFileSize(f.size)}</TableCell>
|
|
135
|
+
<TableCell numeric>{formatFileSize(f.size)}</TableCell>
|
|
122
136
|
<TableCell>
|
|
137
|
+
<TableRowActions>
|
|
123
138
|
<DropdownMenu>
|
|
124
139
|
<DropdownMenuTrigger asChild>
|
|
125
140
|
<IconButton icon={<Icon icon={IconDots} />} variant="ghost" size="sm" aria-label="Actions" />
|
|
@@ -130,6 +145,7 @@ Each component is a thin semantic wrapper — no props beyond standard HTML attr
|
|
|
130
145
|
<DropdownMenuItem onSelect={() => remove(f)}>Delete</DropdownMenuItem>
|
|
131
146
|
</DropdownMenuContent>
|
|
132
147
|
</DropdownMenu>
|
|
148
|
+
</TableRowActions>
|
|
133
149
|
</TableCell>
|
|
134
150
|
</TableRow>
|
|
135
151
|
))}
|
|
@@ -137,6 +153,25 @@ Each component is a thin semantic wrapper — no props beyond standard HTML attr
|
|
|
137
153
|
</Table>
|
|
138
154
|
```
|
|
139
155
|
|
|
156
|
+
`TableRowActions` reveals on row hover AND keyboard focus (buttons stay permanently tabbable — opacity reveal, never `display:none`); always visible on touch. Pass `persist` to keep actions always visible. Give the column a visually-hidden header.
|
|
157
|
+
|
|
158
|
+
**Whole-row navigation (TableRowLink — client component):**
|
|
159
|
+
```tsx
|
|
160
|
+
<TableRow>
|
|
161
|
+
<TableCell className="relative">
|
|
162
|
+
<TableRowLink href={`/projects/${p.id}`}>{p.name}</TableRowLink>
|
|
163
|
+
</TableCell>
|
|
164
|
+
<TableCell><Badge color="success">Active</Badge></TableCell>
|
|
165
|
+
<TableCell>
|
|
166
|
+
<TableRowActions>
|
|
167
|
+
<IconButton className="relative z-[1]" size="xs" variant="ghost" aria-label={`Actions for ${p.name}`} icon={<Icon icon={IconDots} />} />
|
|
168
|
+
</TableRowActions>
|
|
169
|
+
</TableCell>
|
|
170
|
+
</TableRow>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
A real anchor stretched across the row — cmd/ctrl+click, middle-click, and "open in new tab" work. The primary cell must be `className="relative"`; other interactive elements in the row need `className="relative z-[1]"`. **Never** put `onClick` on a `<TableRow>` for navigation. Trade-off: the stretch blocks text selection — `stretch={false}` gives a title-only link.
|
|
174
|
+
|
|
140
175
|
**Inside a Card:**
|
|
141
176
|
```tsx
|
|
142
177
|
<Card>
|
|
@@ -164,7 +199,7 @@ Each component is a thin semantic wrapper — no props beyond standard HTML attr
|
|
|
164
199
|
</Card>
|
|
165
200
|
```
|
|
166
201
|
|
|
167
|
-
|
|
202
|
+
Better: for edge-to-edge rows (borders and hover running the full card width), place the Table as a **direct child of Card** instead of inside `CardContent` — first/last cells automatically pad with `var(--card-spacing)` so columns align with the card's header/footer slots. Use `CardContent` wrapping only when the table should stay inset.
|
|
168
203
|
|
|
169
204
|
**Server-rendered table (RSC):**
|
|
170
205
|
```tsx
|
|
@@ -212,4 +247,7 @@ See `foundations/typography.md` for the body / label variants inside cells, `fou
|
|
|
212
247
|
- For wide tables on mobile, wrap in an `overflow-x-auto` container. Don't try to make a Table responsive via column stacking — switch to a card list on small viewports.
|
|
213
248
|
- Don't style cell text with raw Tailwind palette utilities. Use `text-fg-muted` from `foundations/color.md`.
|
|
214
249
|
- Compose with Badge for status, Avatar for users, IconButton for row actions. Don't invent new primitives per table.
|
|
215
|
-
- Keep TableCell content single-line where possible — multi-line cells make scanning hard.
|
|
250
|
+
- Keep TableCell content single-line where possible — multi-line cells make scanning hard. Two-line identity cells (name + email) require `density="comfortable"`.
|
|
251
|
+
- Quantitative columns get `numeric` (right + tabular figures). Identifier-numbers (dates, phones, IDs) stay left. Negatives: never color alone — pair with a minus sign or parentheses.
|
|
252
|
+
- Row navigation = `<TableRowLink>` (real anchor), never `onClick` on the row. Row actions = `<TableRowActions>` with a visually-hidden column header.
|
|
253
|
+
- Empty cells get a muted em-dash with `aria-label`, never blank: `<span className="text-fg-muted" aria-label="No value">—</span>`.
|
|
@@ -37,7 +37,9 @@ If you need a *fourth* tier (e.g. between heading and body inside one group), us
|
|
|
37
37
|
|
|
38
38
|
```tsx
|
|
39
39
|
// Padding
|
|
40
|
-
|
|
40
|
+
// Card manages its own padding via the size prop — NEVER add p-* to a Card
|
|
41
|
+
// (it fights the gap model). Use size="sm" | "md" | "lg" instead.
|
|
42
|
+
<Card size="sm">…</Card> // tighter card
|
|
41
43
|
<div className="px-ds-07 py-ds-09">…</div> // page region
|
|
42
44
|
|
|
43
45
|
// Gaps
|
|
@@ -97,7 +97,7 @@ In dark mode the kit lightens surfaces with elevation (so `surface-overlay` is *
|
|
|
97
97
|
…
|
|
98
98
|
</aside>
|
|
99
99
|
<main className="bg-surface-base p-ds-07">
|
|
100
|
-
<Card
|
|
100
|
+
<Card> {/* Card — brings its own surface, shadow, and padding (never add p-*) */}
|
|
101
101
|
…
|
|
102
102
|
<Dialog>
|
|
103
103
|
<DialogContent className="bg-surface-overlay shadow-overlay">
|