@devalok/shilp-sutra 0.37.0 → 0.37.1
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/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js +42 -40
- package/dist/composed/inline-edit.js.map +1 -1
- package/dist/test-utils/conformance.d.ts +37 -0
- package/dist/test-utils/conformance.d.ts.map +1 -0
- package/docs/components/composed/activity-feed.md +6 -0
- package/docs/components/composed/avatar-group.md +8 -0
- package/docs/components/composed/bulk-action-bar.md +6 -0
- package/docs/components/composed/command-palette.md +7 -0
- package/docs/components/composed/confirm-dialog.md +6 -0
- package/docs/components/composed/content-card.md +6 -0
- package/docs/components/composed/date-picker.md +10 -0
- package/docs/components/composed/deadline-indicator.md +7 -0
- package/docs/components/composed/emoji-picker.md +8 -0
- package/docs/components/composed/empty-state.md +8 -0
- package/docs/components/composed/error-boundary.md +7 -0
- package/docs/components/composed/file-preview.md +8 -0
- package/docs/components/composed/filter-bar.md +8 -0
- package/docs/components/composed/form-section.md +6 -0
- package/docs/components/composed/global-loading.md +6 -0
- package/docs/components/composed/inline-edit.md +8 -0
- package/docs/components/composed/loading-skeleton.md +7 -0
- package/docs/components/composed/markdown-viewer.md +9 -0
- package/docs/components/composed/master-detail.md +7 -0
- package/docs/components/composed/member-picker.md +7 -0
- package/docs/components/composed/multi-select-popover.md +11 -0
- package/docs/components/composed/page-header.md +7 -0
- package/docs/components/composed/page-skeletons.md +10 -0
- package/docs/components/composed/priority-indicator.md +7 -0
- package/docs/components/composed/responsive-overlay.md +7 -0
- package/docs/components/composed/rich-chat-input.md +12 -0
- package/docs/components/composed/rich-text-editor.md +9 -0
- package/docs/components/composed/schedule-view.md +8 -0
- package/docs/components/composed/simple-tooltip.md +7 -0
- package/docs/components/composed/status-badge.md +10 -0
- package/docs/components/shell/app-command-palette.md +8 -0
- package/docs/components/shell/bottom-navbar.md +12 -0
- package/docs/components/shell/command-registry.md +7 -0
- package/docs/components/shell/link-context.md +15 -0
- package/docs/components/shell/notification-center.md +10 -0
- package/docs/components/shell/notification-preferences.md +7 -0
- package/docs/components/shell/sidebar.md +11 -0
- package/docs/components/shell/top-bar.md +11 -0
- package/docs/components/ui/accordion.md +10 -0
- package/docs/components/ui/alert-dialog.md +10 -1
- package/docs/components/ui/alert.md +10 -2
- package/docs/components/ui/aspect-ratio.md +7 -0
- package/docs/components/ui/autocomplete.md +7 -0
- package/docs/components/ui/avatar.md +10 -0
- package/docs/components/ui/badge-group.md +7 -0
- package/docs/components/ui/badge-indicator.md +7 -0
- package/docs/components/ui/badge.md +12 -0
- package/docs/components/ui/banner.md +7 -0
- package/docs/components/ui/breadcrumb.md +8 -0
- package/docs/components/ui/button-group.md +24 -4
- package/docs/components/ui/button-processing.md +5 -0
- package/docs/components/ui/button.md +9 -0
- package/docs/components/ui/card.md +16 -4
- package/docs/components/ui/charts.md +9 -0
- package/docs/components/ui/chat.md +9 -0
- package/docs/components/ui/checkbox.md +15 -1
- package/docs/components/ui/chip.md +9 -0
- package/docs/components/ui/code.md +7 -0
- package/docs/components/ui/collapsible.md +9 -0
- package/docs/components/ui/color-input.md +8 -0
- package/docs/components/ui/color-swatch.md +7 -0
- package/docs/components/ui/combobox.md +16 -3
- package/docs/components/ui/container.md +11 -0
- package/docs/components/ui/context-menu.md +8 -0
- package/docs/components/ui/data-table-body.md +4 -0
- package/docs/components/ui/data-table-bulk-actions.md +4 -0
- package/docs/components/ui/data-table-card.md +4 -0
- package/docs/components/ui/data-table-context.md +4 -0
- package/docs/components/ui/data-table-header.md +4 -0
- package/docs/components/ui/data-table-pagination.md +4 -0
- package/docs/components/ui/data-table-toolbar.md +7 -0
- package/docs/components/ui/data-table.md +25 -0
- package/docs/components/ui/devalok-grain.md +8 -0
- package/docs/components/ui/dialog.md +10 -0
- package/docs/components/ui/dropdown-menu.md +10 -0
- package/docs/components/ui/file-upload.md +8 -0
- package/docs/components/ui/form.md +21 -0
- package/docs/components/ui/hover-card.md +9 -0
- package/docs/components/ui/icon-button.md +7 -0
- package/docs/components/ui/icon-context.md +7 -0
- package/docs/components/ui/icon-group.md +9 -0
- package/docs/components/ui/icon.md +7 -0
- package/docs/components/ui/input-otp.md +29 -7
- package/docs/components/ui/input.md +7 -0
- package/docs/components/ui/label.md +7 -1
- package/docs/components/ui/link.md +7 -0
- package/docs/components/ui/menubar.md +9 -0
- package/docs/components/ui/navigation-menu.md +9 -0
- package/docs/components/ui/number-input.md +10 -0
- package/docs/components/ui/pagination.md +10 -0
- package/docs/components/ui/popover.md +9 -0
- package/docs/components/ui/progress-ring.md +7 -0
- package/docs/components/ui/progress.md +7 -0
- package/docs/components/ui/radio.md +27 -2
- package/docs/components/ui/search-input.md +8 -0
- package/docs/components/ui/segmented-control.md +8 -0
- package/docs/components/ui/select.md +14 -3
- package/docs/components/ui/separator.md +7 -0
- package/docs/components/ui/sheet.md +10 -0
- package/docs/components/ui/sidebar.md +30 -0
- package/docs/components/ui/skeleton.md +7 -0
- package/docs/components/ui/slider.md +15 -1
- package/docs/components/ui/spinner.md +7 -0
- package/docs/components/ui/split-button.md +11 -0
- package/docs/components/ui/stack.md +8 -0
- package/docs/components/ui/stat-card.md +9 -0
- package/docs/components/ui/status-dot.md +9 -0
- package/docs/components/ui/stepper.md +8 -0
- package/docs/components/ui/switch.md +8 -0
- package/docs/components/ui/table.md +8 -0
- package/docs/components/ui/tabs.md +10 -2
- package/docs/components/ui/text.md +9 -4
- package/docs/components/ui/textarea.md +7 -1
- package/docs/components/ui/toast.md +9 -0
- package/docs/components/ui/toaster.md +8 -0
- package/docs/components/ui/toggle-group.md +13 -4
- package/docs/components/ui/toggle.md +10 -2
- package/docs/components/ui/tooltip.md +11 -1
- package/docs/components/ui/tree-view.md +12 -0
- package/docs/components/ui/visually-hidden.md +7 -0
- package/llms-full.txt +1116 -44
- package/package.json +1 -1
|
@@ -5,12 +5,9 @@
|
|
|
5
5
|
- Category: ui
|
|
6
6
|
|
|
7
7
|
## Props
|
|
8
|
-
variant:
|
|
8
|
+
variant: "heading-2xl" | "heading-xl" | "heading-lg" | "heading-md" | "heading-sm" | "heading-xs" | "body-lg" | "body-md" | "body-sm" | "body-xs" | "label-lg" | "label-md" | "label-sm" | "label-xs" | "label-plain-lg" | "label-plain-md" | "label-plain-sm" | "caption" | "overline" | "code"
|
|
9
9
|
as: ElementType (override the auto-selected HTML element)
|
|
10
10
|
|
|
11
|
-
## Types
|
|
12
|
-
TextVariant = 'heading-2xl' | 'heading-xl' | 'heading-lg' | 'heading-md' | 'heading-sm' | 'heading-xs' | 'body-lg' | 'body-md' | 'body-sm' | 'body-xs' | 'label-lg' | 'label-md' | 'label-sm' | 'label-xs' | 'caption' | 'overline'
|
|
13
|
-
|
|
14
11
|
## Defaults
|
|
15
12
|
variant: "body-md"
|
|
16
13
|
|
|
@@ -25,9 +22,17 @@
|
|
|
25
22
|
<Text variant="label-sm" className="text-text-secondary">SECTION LABEL</Text>
|
|
26
23
|
```
|
|
27
24
|
|
|
25
|
+
## Composability
|
|
26
|
+
- **Server-safe** (one of few components in the library that is). Can render in RSC trees without `"use client"`.
|
|
27
|
+
- No context consumption, no context cascade — pure typography primitive.
|
|
28
|
+
- **Semantic HTML by default:** Each variant maps to a meaningful HTML element (h1 through p, span, code). The `as` prop overrides for visual-only demotion: e.g. `<Text variant="heading-xl" as="div">` renders h2-sized text inside a div, useful when the element already has a heading ancestor but you want the visual weight.
|
|
29
|
+
- **Underpins many components:** Card's CardTitle, Alert's title, PageHeader, EmptyState, SectionHeader all render Text internally with specific variants. Don't wrap another Text inside them — variants cascade structurally, not via context.
|
|
30
|
+
- Pairs with Code for inline code spans inside body text: `<Text>Call <Code>onClick</Code> to...</Text>`.
|
|
31
|
+
|
|
28
32
|
## Gotchas
|
|
29
33
|
- label-* and overline variants are automatically uppercase
|
|
30
34
|
- Use "as" prop to override the HTML element when needed
|
|
35
|
+
- Don't use Text inside headings that already have semantic meaning (e.g. CardTitle) — the double-element wraps are redundant and break screen-reader heading navigation
|
|
31
36
|
|
|
32
37
|
## Changes
|
|
33
38
|
### v0.2.0
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- Category: ui
|
|
6
6
|
|
|
7
7
|
## Props
|
|
8
|
-
size: "sm" | "md" | "lg"
|
|
8
|
+
size: "xs" | "sm" | "md" | "lg"
|
|
9
9
|
state: "default" | "error" | "warning" | "success"
|
|
10
10
|
(plus standard textarea attributes except native "size")
|
|
11
11
|
|
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
<Textarea size="lg" state="error" placeholder="Describe the issue..." />
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
## Composability
|
|
21
|
+
- **FormField auto-consumption:** Same pattern as Input — inside `<FormField>`, Textarea inherits `state`, `aria-describedby`, `aria-invalid`, `aria-required`. Explicit props override.
|
|
22
|
+
- **Resize:** Vertically resizable by default (`resize-y`); override with `className="resize-none"` if needed.
|
|
23
|
+
- **Label pairing:** Manual — `<Label htmlFor="x" />` + `<Textarea id="x" />`. FormField doesn't auto-wire.
|
|
24
|
+
- No IconProvider cascade (no icon slots — different from Input).
|
|
25
|
+
|
|
20
26
|
## Gotchas
|
|
21
27
|
- state="error" sets aria-invalid automatically; all sizes are vertically resizable
|
|
22
28
|
- Inside FormField: auto-inherits state, aria-describedby, aria-required from context (explicit props override)
|
|
@@ -41,6 +41,15 @@ toast.error('Upload failed', { description: 'File too large' })
|
|
|
41
41
|
toast.undo('Task deleted', { onUndo: () => restoreTask(id) })
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
## Composability
|
|
45
|
+
- **Imperative API only** — `toast.success(...)`, `toast.error(...)`, etc. NO JSX invocation. This is by design (Sonner-based) — you call from event handlers, not render.
|
|
46
|
+
- **Requires Toaster mounted once** at app root. Without it, `toast.*` calls are no-ops. Render `<Toaster />` in the root layout, not inside route components.
|
|
47
|
+
- **toast.promise** orchestrates async flows: `toast.promise(fetch(...), { loading: 'Saving', success: 'Saved', error: 'Failed' })`. One toast, three states. Beats manually calling `.loading()` + `.success()`/`.error()`.
|
|
48
|
+
- **toast.undo** adds an inline Undo button with 8s default duration — pair with state management that supports reversal (soft-delete with restore, last-action redo).
|
|
49
|
+
- **toast.upload** is specifically for file-upload progress — per-file progress bars, retry on error, remove from list. Replaces the old `UploadProgress` composed component.
|
|
50
|
+
- **toast.custom** is the escape hatch — render arbitrary JSX. Use sparingly; prefer the typed methods for consistency.
|
|
51
|
+
- **Distinction from Alert/Banner:** Toast = transient, auto-dismissing, non-interactive-dismissible floating notification. Alert = inline in-flow announcement. Banner = page-level strip. Pick by persistence + position.
|
|
52
|
+
|
|
44
53
|
## Gotchas
|
|
45
54
|
- DO NOT use useToast() hook — it is deprecated, use imperative toast.* methods
|
|
46
55
|
- DO NOT use toast({ title, color }) object syntax — use toast.success('message') etc.
|
|
@@ -33,9 +33,17 @@ export default function RootLayout({ children }) {
|
|
|
33
33
|
}
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
## Composability
|
|
37
|
+
- **Mount once, use everywhere.** Render `<Toaster />` in the root layout file once. Every `toast.*` call anywhere in the tree routes to this single container.
|
|
38
|
+
- **Global config lives here.** Set `position`, `duration`, `visibleToasts` on Toaster to control default behavior for all toasts. Individual `toast.*` calls can override `duration` per toast.
|
|
39
|
+
- **Keyboard shortcut:** `hotkey` prop sets a global shortcut to focus the toast region (default: Alt+T). Useful for keyboard users to review recent notifications.
|
|
40
|
+
- **Next.js / App Router:** Mount inside your root `app/layout.tsx`'s `<body>`. It's marked `'use client'` so it doesn't render on the server (Toaster is client-only).
|
|
41
|
+
- **Portal rendering:** z-toast (highest layer) — Toaster content appears above Dialog, Popover, everything. Don't wrap it in a stacking context.
|
|
42
|
+
|
|
36
43
|
## Gotchas
|
|
37
44
|
- Must be mounted once at the layout root for toast notifications to work
|
|
38
45
|
- Use the `toast` import from `@devalok/shilp-sutra/ui/toast` to trigger toasts
|
|
46
|
+
- NOT server-safe — mounts with 'use client'; rendering during SSR has no visual effect
|
|
39
47
|
|
|
40
48
|
## Changes
|
|
41
49
|
### v0.18.0
|
|
@@ -16,8 +16,11 @@
|
|
|
16
16
|
value: string
|
|
17
17
|
|
|
18
18
|
## Compound Components
|
|
19
|
-
ToggleGroup (root)
|
|
20
|
-
ToggleGroupItem (value: string)
|
|
19
|
+
ToggleGroup (root — variant, size propagated to items via context)
|
|
20
|
+
ToggleGroupItem (value: string — reads variant/size from context)
|
|
21
|
+
|
|
22
|
+
## Defaults
|
|
23
|
+
variant="default", size="md"
|
|
21
24
|
|
|
22
25
|
## Example
|
|
23
26
|
```jsx
|
|
@@ -28,9 +31,15 @@
|
|
|
28
31
|
</ToggleGroup>
|
|
29
32
|
```
|
|
30
33
|
|
|
34
|
+
## Composability
|
|
35
|
+
- ToggleGroup passes `variant` and `size` to every ToggleGroupItem via `ToggleGroupContext`. Items read both from context; explicit props on a child override.
|
|
36
|
+
- `type="single"` enforces one-selected-at-a-time (value: string); `type="multiple"` allows many (value: string[]). Radix Toggle Group underpins this — it's the same role + keyboard model as Radix.
|
|
37
|
+
- Built on top of the plain `Toggle` component's CVA — the `variant` and `size` axes of ToggleGroupItem match Toggle exactly (`default | outline`, `sm | md | lg`).
|
|
38
|
+
|
|
31
39
|
## Gotchas
|
|
32
|
-
- type is required — "single" or "multiple"
|
|
33
|
-
- variant and size propagate from ToggleGroup to items
|
|
40
|
+
- `type` is required — "single" or "multiple" — and drives the value shape
|
|
41
|
+
- variant and size propagate from ToggleGroup to items; setting them on a ToggleGroupItem overrides that item only
|
|
42
|
+
- Unlike Tabs (where TabsList is the styling surface), ToggleGroup itself is the styling surface — there's no intermediate List component
|
|
34
43
|
|
|
35
44
|
## Changes
|
|
36
45
|
### v0.18.0
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
## Props
|
|
8
8
|
variant: "default" | "outline"
|
|
9
9
|
size: "sm" | "md" | "lg"
|
|
10
|
+
color: "accent" | "error" | "success" | "neutral" (pressed-state bg + text color)
|
|
10
11
|
pressed: boolean
|
|
11
12
|
onPressedChange: (pressed: boolean) => void
|
|
12
13
|
defaultPressed: boolean
|
|
13
14
|
|
|
14
15
|
## Defaults
|
|
15
|
-
variant
|
|
16
|
-
size: "md"
|
|
16
|
+
variant="default", size="md", color="accent"
|
|
17
17
|
|
|
18
18
|
## Example
|
|
19
19
|
```jsx
|
|
@@ -22,8 +22,16 @@
|
|
|
22
22
|
</Toggle>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## Composability
|
|
26
|
+
- Radix Toggle primitive — `pressed` / `onPressedChange` / `defaultPressed`. Not the same as Switch (boolean value doesn't map to on/off semantically — Toggle is "this action is currently active").
|
|
27
|
+
- **Pairs with ToggleGroup** for mutually-exclusive or multi-select toggle clusters — ToggleGroupItem inherits variant + size from ToggleGroup via context. Don't set variant on a ToggleGroupItem directly.
|
|
28
|
+
- **No context consumption as a standalone** — when rendered outside a ToggleGroup, Toggle is fully independent.
|
|
29
|
+
- **Icon content:** Commonly wraps a single `<Icon>` for formatting toolbar toggles (Bold, Italic, AlignLeft). Pair with IconGroup for a horizontal cluster of independent toggles (vs. ToggleGroup for related state).
|
|
30
|
+
- **aria-label is required** — icon-only toggles need an accessible name.
|
|
31
|
+
|
|
25
32
|
## Gotchas
|
|
26
33
|
- Always provide aria-label for accessibility
|
|
34
|
+
- Toggle is not Switch — Toggle means "this action is active right now"; Switch means "this setting is on"
|
|
27
35
|
|
|
28
36
|
## Changes
|
|
29
37
|
### v0.18.0
|
|
@@ -20,8 +20,18 @@
|
|
|
20
20
|
</TooltipProvider>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
## Composability
|
|
24
|
+
- Built on Radix Tooltip — accepts `delayDuration`, `skipDelayDuration` (on TooltipProvider), and `open`/`onOpenChange`/`defaultOpen` (on Tooltip root).
|
|
25
|
+
- **Auto-provider (v0.22.0+):** If no ancestor TooltipProvider exists, `<Tooltip>` auto-wraps itself with one. Explicit TooltipProvider is still recommended at layout root for shared `delayDuration` tuning.
|
|
26
|
+
- **Trigger:** `<TooltipTrigger asChild>` around the element that should show the tooltip on hover/focus. Icon-only buttons are the canonical use case.
|
|
27
|
+
- **Not interactive:** TooltipContent is for non-interactive text labels — don't put buttons/links inside. Use HoverCard or Popover when the popped content needs interaction.
|
|
28
|
+
- **Positioning:** TooltipContent accepts `side`, `align`, `sideOffset`, and arrow via `<TooltipArrow>` (optional).
|
|
29
|
+
- **Portal rendering:** z-index is `z-tooltip` (highest in the stack — above Popover and Dialog).
|
|
30
|
+
|
|
23
31
|
## Gotchas
|
|
24
|
-
- TooltipProvider is REQUIRED —
|
|
32
|
+
- TooltipProvider is REQUIRED at the layout level OR auto-created per-tooltip — but having a single root provider is better for consistent delays
|
|
33
|
+
- Don't use Tooltip for critical information — hover-triggered UI is invisible to touch users. Pair with a visible label or aria-description
|
|
34
|
+
- TooltipContent children must be inert — no buttons, no links, no focusable elements
|
|
25
35
|
|
|
26
36
|
## Changes
|
|
27
37
|
### v0.22.0
|
|
@@ -51,8 +51,20 @@
|
|
|
51
51
|
</TreeView>
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
## Composability
|
|
55
|
+
- **Two rendering modes:**
|
|
56
|
+
- **Data-driven:** Pass `items: TreeNode[]` with nested `children`. Good for server-fetched or programmatic trees.
|
|
57
|
+
- **Declarative:** Use `<TreeItem>` children directly. Good for hardcoded nav, readable JSX.
|
|
58
|
+
- Don't mix — pick one per TreeView instance.
|
|
59
|
+
- **useTree hook** lets you drive TreeView state externally (e.g. sync with URL, persist expanded state, drive from Redux). Pass `defaultExpanded`/`defaultSelected` initially OR manage state via the hook's return value.
|
|
60
|
+
- **TreeItem composability:** Each TreeItem has `icon`, `label`, `secondaryLabel`, and `actions` slots — rich rows without custom render props. `actions` reveals on row hover (same pattern as Message.Actions).
|
|
61
|
+
- **multiSelect + checkboxes:** Set both to turn TreeView into a file-picker style tree with checkboxes instead of single-select highlighting.
|
|
62
|
+
- **Keyboard navigation:** Full `role="tree"` spec — Arrow Up/Down to move, Right to expand/descend, Left to collapse/ascend, Enter to select. Pre-wired; no manual key handling needed.
|
|
63
|
+
|
|
54
64
|
## Gotchas
|
|
55
65
|
- Supports both data-driven (items prop) and declarative (children) modes
|
|
66
|
+
- Don't mix data-driven and declarative in the same TreeView — pick one
|
|
67
|
+
- For a simple flat checkbox list, use RadioGroup/Checkbox + Stack — TreeView is overkill for non-hierarchical data
|
|
56
68
|
|
|
57
69
|
## Changes
|
|
58
70
|
### v0.4.2
|
|
@@ -12,9 +12,16 @@
|
|
|
12
12
|
<VisuallyHidden>Screen reader only text</VisuallyHidden>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Composability
|
|
16
|
+
- Server-safe. Works anywhere — no context, no cascade.
|
|
17
|
+
- Canonical use: wrap a DialogTitle / SheetTitle that must exist for a11y but shouldn't show visually (`<DialogTitle asChild><VisuallyHidden>...</VisuallyHidden></DialogTitle>`).
|
|
18
|
+
- Also useful inside IconButton to provide a text alternative when the icon already has an aria-label (redundant label is harmless and helps some screen readers).
|
|
19
|
+
- Uses the `sr-only` CSS pattern under the hood — content is in the DOM, just positioned off-screen.
|
|
20
|
+
|
|
15
21
|
## Gotchas
|
|
16
22
|
- Content is visually hidden but accessible to screen readers
|
|
17
23
|
- Useful for providing accessible labels without visual UI
|
|
24
|
+
- Don't use for content you want hidden entirely — that's `hidden` or conditional rendering
|
|
18
25
|
|
|
19
26
|
## Changes
|
|
20
27
|
### v0.1.0
|