@devalok/shilp-sutra 0.18.1 → 0.18.2
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/docs/components/_header.md +83 -0
- package/docs/components/composed/activity-feed.md +43 -0
- package/docs/components/composed/avatar-group.md +32 -0
- package/docs/components/composed/command-palette.md +40 -0
- package/docs/components/composed/confirm-dialog.md +46 -0
- package/docs/components/composed/content-card.md +36 -0
- package/docs/components/composed/date-picker.md +130 -0
- package/docs/components/composed/empty-state.md +53 -0
- package/docs/components/composed/error-boundary.md +29 -0
- package/docs/components/composed/global-loading.md +27 -0
- package/docs/components/composed/loading-skeleton.md +51 -0
- package/docs/components/composed/member-picker.md +35 -0
- package/docs/components/composed/page-header.md +41 -0
- package/docs/components/composed/page-skeletons.md +32 -0
- package/docs/components/composed/priority-indicator.md +32 -0
- package/docs/components/composed/rich-text-editor.md +71 -0
- package/docs/components/composed/schedule-view.md +39 -0
- package/docs/components/composed/simple-tooltip.md +33 -0
- package/docs/components/composed/status-badge.md +41 -0
- package/docs/components/shell/app-command-palette.md +44 -0
- package/docs/components/shell/bottom-navbar.md +48 -0
- package/docs/components/shell/command-registry.md +48 -0
- package/docs/components/shell/link-context.md +41 -0
- package/docs/components/shell/notification-center.md +63 -0
- package/docs/components/shell/notification-preferences.md +42 -0
- package/docs/components/shell/sidebar.md +88 -0
- package/docs/components/shell/top-bar.md +63 -0
- package/docs/components/ui/accordion.md +48 -0
- package/docs/components/ui/alert-dialog.md +58 -0
- package/docs/components/ui/alert.md +43 -0
- package/docs/components/ui/aspect-ratio.md +25 -0
- package/docs/components/ui/autocomplete.md +48 -0
- package/docs/components/ui/avatar.md +34 -0
- package/docs/components/ui/badge.md +48 -0
- package/docs/components/ui/banner.md +35 -0
- package/docs/components/ui/breadcrumb.md +37 -0
- package/docs/components/ui/button-group.md +32 -0
- package/docs/components/ui/button.md +55 -0
- package/docs/components/ui/card.md +48 -0
- package/docs/components/ui/charts.md +43 -0
- package/docs/components/ui/checkbox.md +31 -0
- package/docs/components/ui/chip.md +43 -0
- package/docs/components/ui/code.md +28 -0
- package/docs/components/ui/collapsible.md +40 -0
- package/docs/components/ui/color-input.md +37 -0
- package/docs/components/ui/combobox.md +54 -0
- package/docs/components/ui/container.md +26 -0
- package/docs/components/ui/context-menu.md +43 -0
- package/docs/components/ui/data-table-toolbar.md +44 -0
- package/docs/components/ui/data-table.md +91 -0
- package/docs/components/ui/dialog.md +51 -0
- package/docs/components/ui/dropdown-menu.md +45 -0
- package/docs/components/ui/file-upload.md +41 -0
- package/docs/components/ui/form.md +51 -0
- package/docs/components/ui/hover-card.md +32 -0
- package/docs/components/ui/icon-button.md +33 -0
- package/docs/components/ui/input-otp.md +44 -0
- package/docs/components/ui/input.md +48 -0
- package/docs/components/ui/label.md +25 -0
- package/docs/components/ui/link.md +29 -0
- package/docs/components/ui/menubar.md +44 -0
- package/docs/components/ui/navigation-menu.md +46 -0
- package/docs/components/ui/number-input.md +44 -0
- package/docs/components/ui/pagination.md +48 -0
- package/docs/components/ui/popover.md +30 -0
- package/docs/components/ui/progress.md +29 -0
- package/docs/components/ui/radio.md +34 -0
- package/docs/components/ui/search-input.md +43 -0
- package/docs/components/ui/segmented-control.md +50 -0
- package/docs/components/ui/select.md +49 -0
- package/docs/components/ui/separator.md +29 -0
- package/docs/components/ui/sheet.md +47 -0
- package/docs/components/ui/sidebar.md +72 -0
- package/docs/components/ui/skeleton.md +77 -0
- package/docs/components/ui/slider.md +29 -0
- package/docs/components/ui/spinner.md +50 -0
- package/docs/components/ui/stack.md +39 -0
- package/docs/components/ui/stat-card.md +61 -0
- package/docs/components/ui/stepper.md +49 -0
- package/docs/components/ui/switch.md +34 -0
- package/docs/components/ui/table.md +47 -0
- package/docs/components/ui/tabs.md +56 -0
- package/docs/components/ui/text.md +37 -0
- package/docs/components/ui/textarea.md +39 -0
- package/docs/components/ui/toast.md +65 -0
- package/docs/components/ui/toaster.md +47 -0
- package/docs/components/ui/toggle-group.md +43 -0
- package/docs/components/ui/toggle.md +37 -0
- package/docs/components/ui/tooltip.md +33 -0
- package/docs/components/ui/tree-view.md +65 -0
- package/docs/components/ui/visually-hidden.md +21 -0
- package/llms-full.txt +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Label
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/label
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
required: boolean (shows red asterisk)
|
|
9
|
+
htmlFor: string
|
|
10
|
+
(plus standard Radix Label props)
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
```jsx
|
|
14
|
+
<Label htmlFor="email" required>Email Address</Label>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Gotchas
|
|
18
|
+
- Use with FormField for automatic aria wiring
|
|
19
|
+
|
|
20
|
+
## Changes
|
|
21
|
+
### v0.2.0
|
|
22
|
+
- **Fixed** Children rendering verified and covered by tests — issue was caused by `@primitives` type leak, not a runtime bug
|
|
23
|
+
|
|
24
|
+
### v0.1.0
|
|
25
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Link
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/link
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
inline: boolean (default: true — "inline" or "block" display)
|
|
9
|
+
asChild: boolean (merge with child element, e.g. Next.js Link)
|
|
10
|
+
(plus standard anchor attributes)
|
|
11
|
+
|
|
12
|
+
## Defaults
|
|
13
|
+
inline: true
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
```jsx
|
|
17
|
+
<Link href="/docs">Documentation</Link>
|
|
18
|
+
<Link asChild><NextLink href="/about">About</NextLink></Link>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Gotchas
|
|
22
|
+
- Use asChild with framework-specific Link components (e.g. Next.js Link)
|
|
23
|
+
|
|
24
|
+
## Changes
|
|
25
|
+
### v0.18.0
|
|
26
|
+
- **Fixed** Color tokens — `text-info-9` changed to `text-accent-11` (links are interactive = accent scale)
|
|
27
|
+
|
|
28
|
+
### v0.1.0
|
|
29
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Menubar
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/menubar
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
Menubar (root)
|
|
9
|
+
MenubarMenu
|
|
10
|
+
MenubarTrigger
|
|
11
|
+
MenubarContent
|
|
12
|
+
MenubarItem (+ MenubarShortcut)
|
|
13
|
+
MenubarCheckboxItem
|
|
14
|
+
MenubarRadioGroup > MenubarRadioItem
|
|
15
|
+
MenubarLabel
|
|
16
|
+
MenubarSeparator
|
|
17
|
+
MenubarSub > MenubarSubTrigger, MenubarSubContent
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
```jsx
|
|
21
|
+
<Menubar>
|
|
22
|
+
<MenubarMenu>
|
|
23
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
24
|
+
<MenubarContent>
|
|
25
|
+
<MenubarItem>New<MenubarShortcut>Ctrl+N</MenubarShortcut></MenubarItem>
|
|
26
|
+
<MenubarSeparator />
|
|
27
|
+
<MenubarItem>Exit</MenubarItem>
|
|
28
|
+
</MenubarContent>
|
|
29
|
+
</MenubarMenu>
|
|
30
|
+
</Menubar>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Gotchas
|
|
34
|
+
- Follows the standard Radix Menubar compound pattern
|
|
35
|
+
|
|
36
|
+
## Changes
|
|
37
|
+
### v0.18.0
|
|
38
|
+
- **Added** `MenubarContentProps`, `MenubarItemProps` type exports
|
|
39
|
+
|
|
40
|
+
### v0.14.0
|
|
41
|
+
- **Changed** z-index promoted from `z-dropdown` (1000) to `z-popover` (1400) — fixes content rendering behind Sheet/Dialog overlays
|
|
42
|
+
|
|
43
|
+
### v0.1.0
|
|
44
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# NavigationMenu
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/navigation-menu
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
NavigationMenu (root)
|
|
9
|
+
NavigationMenuList
|
|
10
|
+
NavigationMenuItem
|
|
11
|
+
NavigationMenuTrigger (for items with content panels)
|
|
12
|
+
NavigationMenuContent (dropdown panel)
|
|
13
|
+
NavigationMenuLink (for direct links)
|
|
14
|
+
NavigationMenuIndicator
|
|
15
|
+
NavigationMenuViewport
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
```jsx
|
|
19
|
+
<NavigationMenu>
|
|
20
|
+
<NavigationMenuList>
|
|
21
|
+
<NavigationMenuItem>
|
|
22
|
+
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
|
|
23
|
+
<NavigationMenuContent>
|
|
24
|
+
<ul>...</ul>
|
|
25
|
+
</NavigationMenuContent>
|
|
26
|
+
</NavigationMenuItem>
|
|
27
|
+
<NavigationMenuItem>
|
|
28
|
+
<NavigationMenuLink href="/about">About</NavigationMenuLink>
|
|
29
|
+
</NavigationMenuItem>
|
|
30
|
+
</NavigationMenuList>
|
|
31
|
+
</NavigationMenu>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Gotchas
|
|
35
|
+
- Uses Framer Motion for enter/exit animations (v0.18.0)
|
|
36
|
+
|
|
37
|
+
## Changes
|
|
38
|
+
### v0.18.0
|
|
39
|
+
- **Changed** Migrated to Framer Motion for enter/exit animations
|
|
40
|
+
- **Added** `NavigationMenuProps`, `NavigationMenuContentProps` type exports
|
|
41
|
+
|
|
42
|
+
### v0.1.1
|
|
43
|
+
- **Fixed** Token compliance — icon sizes replaced with `h-ico-sm w-ico-sm`
|
|
44
|
+
|
|
45
|
+
### v0.1.0
|
|
46
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# NumberInput
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/number-input
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
value: number (default: 0)
|
|
9
|
+
onValueChange: (value: number) => void
|
|
10
|
+
min: number
|
|
11
|
+
max: number
|
|
12
|
+
step: number (default: 1)
|
|
13
|
+
disabled: boolean
|
|
14
|
+
|
|
15
|
+
## Defaults
|
|
16
|
+
value: 0
|
|
17
|
+
step: 1
|
|
18
|
+
min: Number.MIN_SAFE_INTEGER
|
|
19
|
+
max: Number.MAX_SAFE_INTEGER
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
```jsx
|
|
23
|
+
<NumberInput value={qty} onValueChange={setQty} min={1} max={99} />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Gotchas
|
|
27
|
+
- Controlled only — buttons won't work without onValueChange
|
|
28
|
+
|
|
29
|
+
## Changes
|
|
30
|
+
### v0.18.0
|
|
31
|
+
- **Fixed** Replaced `parseInt` with `Number()`, handle empty input
|
|
32
|
+
|
|
33
|
+
### v0.15.0
|
|
34
|
+
- **Changed** `md` size font standardized to `text-ds-md` (14px)
|
|
35
|
+
|
|
36
|
+
### v0.8.0
|
|
37
|
+
- **Fixed** FormField context consumption, `aria-label` fallback, `parseInt` radix parameter
|
|
38
|
+
|
|
39
|
+
### v0.3.0
|
|
40
|
+
- **Changed** (BREAKING) `onChange` renamed to `onValueChange`
|
|
41
|
+
- **Changed** Now extends HTMLAttributes — accepts all standard HTML props
|
|
42
|
+
|
|
43
|
+
### v0.1.0
|
|
44
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/pagination
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
PaginationRoot (nav)
|
|
9
|
+
PaginationContent (ul)
|
|
10
|
+
PaginationItem (li)
|
|
11
|
+
PaginationLink (isActive: boolean, asChild: boolean)
|
|
12
|
+
PaginationPrevious
|
|
13
|
+
PaginationNext
|
|
14
|
+
PaginationEllipsis
|
|
15
|
+
PaginationNav (convenience wrapper)
|
|
16
|
+
|
|
17
|
+
## Utility
|
|
18
|
+
generatePagination(current: number, total: number, siblingCount: number) => (number | 'ellipsis')[]
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
<PaginationRoot>
|
|
23
|
+
<PaginationContent>
|
|
24
|
+
<PaginationItem><PaginationPrevious onClick={() => setPage(p - 1)} /></PaginationItem>
|
|
25
|
+
{generatePagination(page, totalPages, 1).map((item, i) =>
|
|
26
|
+
item === 'ellipsis'
|
|
27
|
+
? <PaginationItem key={i}><PaginationEllipsis /></PaginationItem>
|
|
28
|
+
: <PaginationItem key={i}>
|
|
29
|
+
<PaginationLink isActive={item === page} onClick={() => setPage(item)}>
|
|
30
|
+
{item}
|
|
31
|
+
</PaginationLink>
|
|
32
|
+
</PaginationItem>
|
|
33
|
+
)}
|
|
34
|
+
<PaginationItem><PaginationNext onClick={() => setPage(p + 1)} /></PaginationItem>
|
|
35
|
+
</PaginationContent>
|
|
36
|
+
</PaginationRoot>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Gotchas
|
|
40
|
+
- Root component is PaginationRoot (NOT Pagination)
|
|
41
|
+
|
|
42
|
+
## Changes
|
|
43
|
+
### v0.1.1
|
|
44
|
+
- **Fixed** Pagination link padding uses `ds-*` tokens instead of Tailwind arbitrary values
|
|
45
|
+
|
|
46
|
+
### v0.1.0
|
|
47
|
+
- **Added** Initial release
|
|
48
|
+
- **Added** PaginationNav compound wrapper with `generatePagination` helper
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Popover
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/popover
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
Popover (root)
|
|
9
|
+
PopoverTrigger
|
|
10
|
+
PopoverContent
|
|
11
|
+
PopoverAnchor (optional anchor point)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
```jsx
|
|
15
|
+
<Popover>
|
|
16
|
+
<PopoverTrigger asChild><Button>Open</Button></PopoverTrigger>
|
|
17
|
+
<PopoverContent>Content here</PopoverContent>
|
|
18
|
+
</Popover>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Gotchas
|
|
22
|
+
- Uses Framer Motion for enter/exit animations (v0.18.0)
|
|
23
|
+
|
|
24
|
+
## Changes
|
|
25
|
+
### v0.18.0
|
|
26
|
+
- **Changed** Migrated to Framer Motion for enter/exit animations
|
|
27
|
+
- **Added** `PopoverContentProps` type export
|
|
28
|
+
|
|
29
|
+
### v0.1.0
|
|
30
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/progress
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
value: number (0-100) — omit for indeterminate
|
|
9
|
+
size: "sm" | "md" | "lg" (track height)
|
|
10
|
+
color: "default" | "success" | "warning" | "error" (indicator color)
|
|
11
|
+
showLabel: boolean (shows percentage text)
|
|
12
|
+
indicatorClassName: string
|
|
13
|
+
|
|
14
|
+
## Defaults
|
|
15
|
+
size: "md"
|
|
16
|
+
color: "default"
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
```jsx
|
|
20
|
+
<Progress value={75} color="success" showLabel />
|
|
21
|
+
<Progress size="sm" /> {/* indeterminate */}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Gotchas
|
|
25
|
+
- Omit value (or pass undefined) for indeterminate animation
|
|
26
|
+
|
|
27
|
+
## Changes
|
|
28
|
+
### v0.1.0
|
|
29
|
+
- **Added** Initial release with `size`, `color`, `indeterminate` variants and optional label slot
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# RadioGroup
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/radio
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
RadioGroup (root, value, onValueChange, defaultValue)
|
|
9
|
+
RadioGroupItem (value: string, REQUIRED)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
```jsx
|
|
13
|
+
<RadioGroup defaultValue="option-1" onValueChange={setValue}>
|
|
14
|
+
<div className="flex items-center gap-2">
|
|
15
|
+
<RadioGroupItem value="option-1" id="r1" />
|
|
16
|
+
<Label htmlFor="r1">Option 1</Label>
|
|
17
|
+
</div>
|
|
18
|
+
<div className="flex items-center gap-2">
|
|
19
|
+
<RadioGroupItem value="option-2" id="r2" />
|
|
20
|
+
<Label htmlFor="r2">Option 2</Label>
|
|
21
|
+
</div>
|
|
22
|
+
</RadioGroup>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Gotchas
|
|
26
|
+
- Each RadioGroupItem needs a unique `value` prop
|
|
27
|
+
- Pair each item with a Label for accessibility
|
|
28
|
+
|
|
29
|
+
## Changes
|
|
30
|
+
### v0.4.2
|
|
31
|
+
- **Added** `RadioGroupProps`, `RadioGroupItemProps` type exports
|
|
32
|
+
|
|
33
|
+
### v0.1.0
|
|
34
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# SearchInput
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/search-input
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
size: "sm" | "md" | "lg"
|
|
9
|
+
loading: boolean (shows spinner instead of clear button)
|
|
10
|
+
onClear: () => void (shows X button when value is non-empty)
|
|
11
|
+
value: string
|
|
12
|
+
onChange: ChangeEventHandler
|
|
13
|
+
(plus standard input attributes except native "size")
|
|
14
|
+
|
|
15
|
+
## Defaults
|
|
16
|
+
size: "md"
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
```jsx
|
|
20
|
+
<SearchInput
|
|
21
|
+
value={query}
|
|
22
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
23
|
+
onClear={() => setQuery('')}
|
|
24
|
+
placeholder="Search tasks..."
|
|
25
|
+
loading={isSearching}
|
|
26
|
+
/>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Gotchas
|
|
30
|
+
- HTML native "size" attribute is excluded — use CSS width instead
|
|
31
|
+
|
|
32
|
+
## Changes
|
|
33
|
+
### v0.15.0
|
|
34
|
+
- **Changed** `lg` size font changed from `text-ds-lg` (18px) to `text-ds-md` (14px) — all input sizes now use 14px for consistency
|
|
35
|
+
|
|
36
|
+
### v0.2.0
|
|
37
|
+
- **Changed** `inputSize` prop renamed to `size` to match Input API
|
|
38
|
+
|
|
39
|
+
### v0.1.1
|
|
40
|
+
- **Fixed** Token compliance — replaced `pl-10 pr-9` and icon offsets with explicit arbitrary values
|
|
41
|
+
|
|
42
|
+
### v0.1.0
|
|
43
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# SegmentedControl
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/segmented-control
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
size: "sm" | "md" | "lg" (REQUIRED) — also accepts legacy "small" | "medium" | "big"
|
|
9
|
+
variant: "filled" | "tonal" (REQUIRED)
|
|
10
|
+
options: SegmentedControlOption[] (REQUIRED)
|
|
11
|
+
selectedId: string (REQUIRED)
|
|
12
|
+
onSelect: (id: string) => void (REQUIRED)
|
|
13
|
+
disabled: boolean
|
|
14
|
+
|
|
15
|
+
## Types
|
|
16
|
+
SegmentedControlOption = { id: string, text: string, icon?: ComponentType<{ className?: string }> }
|
|
17
|
+
SegmentedControlSize = 'sm' | 'md' | 'lg' | 'small' | 'medium' | 'big' (legacy aliases)
|
|
18
|
+
SegmentedControlVariant = 'filled' | 'tonal'
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
<SegmentedControl
|
|
23
|
+
size="md"
|
|
24
|
+
variant="tonal"
|
|
25
|
+
options={[
|
|
26
|
+
{ id: 'list', text: 'List' },
|
|
27
|
+
{ id: 'grid', text: 'Grid' },
|
|
28
|
+
]}
|
|
29
|
+
selectedId={viewMode}
|
|
30
|
+
onSelect={setViewMode}
|
|
31
|
+
/>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Gotchas
|
|
35
|
+
- Controlled only — selectedId + onSelect are required
|
|
36
|
+
- Uses data-driven API (options prop), not compound children
|
|
37
|
+
|
|
38
|
+
## Changes
|
|
39
|
+
### v0.18.0
|
|
40
|
+
- **Fixed** `bg-interactive` changed to `bg-accent-9`, `bg-field` changed to `bg-surface-3` (OKLCH migration)
|
|
41
|
+
|
|
42
|
+
### v0.4.2
|
|
43
|
+
- **Changed** (BREAKING) `color` prop renamed to `variant` (values `filled`/`tonal` unchanged)
|
|
44
|
+
|
|
45
|
+
### v0.1.1
|
|
46
|
+
- **Fixed** `tabIndex={0}` changed to `tabIndex={-1}` on tablist wrapper — fixes double-focus keyboard navigation bug
|
|
47
|
+
- **Fixed** Removed `!important` override — resolved specificity by restructuring base CVA classes
|
|
48
|
+
|
|
49
|
+
### v0.1.0
|
|
50
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/select
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
### SelectTrigger
|
|
9
|
+
size: "sm" | "md" | "lg"
|
|
10
|
+
|
|
11
|
+
## Compound Components
|
|
12
|
+
Select (root — value, onValueChange, defaultValue)
|
|
13
|
+
SelectTrigger (size goes HERE, not on Select root)
|
|
14
|
+
SelectValue (placeholder)
|
|
15
|
+
SelectContent
|
|
16
|
+
SelectGroup (optional grouping)
|
|
17
|
+
SelectLabel (group header)
|
|
18
|
+
SelectItem (value: string, REQUIRED)
|
|
19
|
+
SelectSeparator
|
|
20
|
+
|
|
21
|
+
## Defaults
|
|
22
|
+
SelectTrigger size: "md"
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
```jsx
|
|
26
|
+
<Select onValueChange={setValue}>
|
|
27
|
+
<SelectTrigger size="lg">
|
|
28
|
+
<SelectValue placeholder="Choose..." />
|
|
29
|
+
</SelectTrigger>
|
|
30
|
+
<SelectContent>
|
|
31
|
+
<SelectItem value="a">Option A</SelectItem>
|
|
32
|
+
<SelectItem value="b">Option B</SelectItem>
|
|
33
|
+
</SelectContent>
|
|
34
|
+
</Select>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Gotchas
|
|
38
|
+
- Size goes on SelectTrigger, NOT on Select root
|
|
39
|
+
- `<Select size="lg">` is silently ignored (no TypeScript error)
|
|
40
|
+
|
|
41
|
+
## Changes
|
|
42
|
+
### v0.15.0
|
|
43
|
+
- **Changed** `lg` size font changed from `text-ds-lg` (18px) to `text-ds-md` (14px) — all input sizes now use 14px for consistency
|
|
44
|
+
|
|
45
|
+
### v0.14.0
|
|
46
|
+
- **Changed** z-index promoted from `z-dropdown` (1000) to `z-popover` (1400) — fixes content rendering behind Sheet/Dialog overlays
|
|
47
|
+
|
|
48
|
+
### v0.1.0
|
|
49
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Separator
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/separator
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
orientation: "horizontal" | "vertical"
|
|
9
|
+
decorative: boolean
|
|
10
|
+
|
|
11
|
+
## Defaults
|
|
12
|
+
orientation: "horizontal"
|
|
13
|
+
decorative: true
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
```jsx
|
|
17
|
+
<Separator />
|
|
18
|
+
<Separator orientation="vertical" className="h-6" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Gotchas
|
|
22
|
+
- When decorative is true, the separator is hidden from screen readers
|
|
23
|
+
|
|
24
|
+
## Changes
|
|
25
|
+
### v0.4.2
|
|
26
|
+
- **Added** `SeparatorProps` type export
|
|
27
|
+
|
|
28
|
+
### v0.1.0
|
|
29
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Sheet
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/sheet
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
### SheetContent
|
|
9
|
+
side: "top" | "bottom" | "left" | "right"
|
|
10
|
+
|
|
11
|
+
## Compound Components
|
|
12
|
+
Sheet (root)
|
|
13
|
+
SheetTrigger
|
|
14
|
+
SheetContent (side prop)
|
|
15
|
+
SheetHeader
|
|
16
|
+
SheetTitle
|
|
17
|
+
SheetDescription
|
|
18
|
+
[body content]
|
|
19
|
+
SheetFooter
|
|
20
|
+
SheetClose
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
```jsx
|
|
24
|
+
<Sheet>
|
|
25
|
+
<SheetTrigger asChild><Button>Open</Button></SheetTrigger>
|
|
26
|
+
<SheetContent side="right">
|
|
27
|
+
<SheetHeader>
|
|
28
|
+
<SheetTitle>Settings</SheetTitle>
|
|
29
|
+
</SheetHeader>
|
|
30
|
+
<div>Content</div>
|
|
31
|
+
</SheetContent>
|
|
32
|
+
</Sheet>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Gotchas
|
|
36
|
+
- Uses Framer Motion for slide enter/exit animations (v0.18.0)
|
|
37
|
+
|
|
38
|
+
## Changes
|
|
39
|
+
### v0.18.0
|
|
40
|
+
- **Changed** Migrated to Framer Motion for enter/exit animations
|
|
41
|
+
- **Added** `SheetContentProps` type export
|
|
42
|
+
|
|
43
|
+
### v0.3.0
|
|
44
|
+
- **Fixed** SheetHeader/Footer now support ref forwarding
|
|
45
|
+
|
|
46
|
+
### v0.1.0
|
|
47
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Sidebar
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/sidebar
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
SidebarProvider (context provider — must wrap everything)
|
|
9
|
+
Sidebar (root panel)
|
|
10
|
+
SidebarHeader
|
|
11
|
+
SidebarContent
|
|
12
|
+
SidebarGroup
|
|
13
|
+
SidebarGroupLabel
|
|
14
|
+
SidebarGroupAction
|
|
15
|
+
SidebarGroupContent
|
|
16
|
+
SidebarMenu
|
|
17
|
+
SidebarMenuItem
|
|
18
|
+
SidebarMenuButton (tooltip, isActive)
|
|
19
|
+
SidebarMenuAction
|
|
20
|
+
SidebarMenuBadge
|
|
21
|
+
SidebarMenuSub
|
|
22
|
+
SidebarMenuSubItem
|
|
23
|
+
SidebarMenuSubButton (isActive)
|
|
24
|
+
SidebarFooter
|
|
25
|
+
SidebarSeparator
|
|
26
|
+
SidebarRail
|
|
27
|
+
SidebarInset (main content area)
|
|
28
|
+
SidebarTrigger (hamburger button)
|
|
29
|
+
SidebarInput (search input in sidebar)
|
|
30
|
+
SidebarMenuSkeleton (loading placeholder)
|
|
31
|
+
|
|
32
|
+
## Hook
|
|
33
|
+
useSidebar() => { state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
```jsx
|
|
37
|
+
<SidebarProvider>
|
|
38
|
+
<Sidebar>
|
|
39
|
+
<SidebarHeader>Logo</SidebarHeader>
|
|
40
|
+
<SidebarContent>
|
|
41
|
+
<SidebarGroup>
|
|
42
|
+
<SidebarGroupLabel>Navigation</SidebarGroupLabel>
|
|
43
|
+
<SidebarGroupContent>
|
|
44
|
+
<SidebarMenu>
|
|
45
|
+
<SidebarMenuItem>
|
|
46
|
+
<SidebarMenuButton isActive>
|
|
47
|
+
<IconHome /> Dashboard
|
|
48
|
+
</SidebarMenuButton>
|
|
49
|
+
</SidebarMenuItem>
|
|
50
|
+
</SidebarMenu>
|
|
51
|
+
</SidebarGroupContent>
|
|
52
|
+
</SidebarGroup>
|
|
53
|
+
</SidebarContent>
|
|
54
|
+
</Sidebar>
|
|
55
|
+
<SidebarInset>
|
|
56
|
+
<SidebarTrigger />
|
|
57
|
+
<main>Page content</main>
|
|
58
|
+
</SidebarInset>
|
|
59
|
+
</SidebarProvider>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Gotchas
|
|
63
|
+
- SidebarProvider MUST wrap both Sidebar and SidebarInset
|
|
64
|
+
- Use SidebarMenuButton for nav items (supports tooltip in collapsed state)
|
|
65
|
+
|
|
66
|
+
## Changes
|
|
67
|
+
### v0.18.0
|
|
68
|
+
- **Fixed** `bg-interactive-subtle` changed to `bg-accent-2` (OKLCH migration)
|
|
69
|
+
- **Added** `SidebarProps` type export
|
|
70
|
+
|
|
71
|
+
### v0.1.0
|
|
72
|
+
- **Added** Initial release
|