@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,48 @@
|
|
|
1
|
+
# Accordion
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/accordion
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
type: "single" | "multiple" (REQUIRED)
|
|
9
|
+
defaultValue: string (single) | string[] (multiple)
|
|
10
|
+
value: string | string[] (controlled)
|
|
11
|
+
onValueChange: (value) => void
|
|
12
|
+
collapsible: boolean (only valid when type="single")
|
|
13
|
+
|
|
14
|
+
## Compound Components
|
|
15
|
+
Accordion (root)
|
|
16
|
+
AccordionItem (value: string, REQUIRED)
|
|
17
|
+
AccordionTrigger (clickable header, chevron auto-renders)
|
|
18
|
+
AccordionContent (collapsible body)
|
|
19
|
+
|
|
20
|
+
## Defaults
|
|
21
|
+
none (type is required)
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
```jsx
|
|
25
|
+
<Accordion type="single" defaultValue="item-1" collapsible>
|
|
26
|
+
<AccordionItem value="item-1">
|
|
27
|
+
<AccordionTrigger>Question?</AccordionTrigger>
|
|
28
|
+
<AccordionContent>Answer.</AccordionContent>
|
|
29
|
+
</AccordionItem>
|
|
30
|
+
</Accordion>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Gotchas
|
|
34
|
+
- type is REQUIRED — omitting it causes runtime error
|
|
35
|
+
- collapsible only works with type="single"
|
|
36
|
+
|
|
37
|
+
## Changes
|
|
38
|
+
### v0.18.0
|
|
39
|
+
- **Changed** Accordion content fade animation migrated to Framer Motion (height animation still uses CSS keyframes)
|
|
40
|
+
|
|
41
|
+
### v0.13.0
|
|
42
|
+
- **Added** `accordion-down` and `accordion-up` keyframes added to Tailwind preset using Radix CSS custom properties
|
|
43
|
+
|
|
44
|
+
### v0.4.2
|
|
45
|
+
- **Added** `AccordionItemProps`, `AccordionTriggerProps`, `AccordionContentProps` type exports
|
|
46
|
+
|
|
47
|
+
### v0.1.0
|
|
48
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# AlertDialog
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/alert-dialog
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
open: boolean (controlled)
|
|
9
|
+
onOpenChange: (open: boolean) => void
|
|
10
|
+
defaultOpen: boolean
|
|
11
|
+
|
|
12
|
+
## Compound Components
|
|
13
|
+
AlertDialog (root)
|
|
14
|
+
AlertDialogTrigger
|
|
15
|
+
AlertDialogContent
|
|
16
|
+
AlertDialogHeader
|
|
17
|
+
AlertDialogTitle
|
|
18
|
+
AlertDialogDescription
|
|
19
|
+
AlertDialogFooter
|
|
20
|
+
AlertDialogCancel
|
|
21
|
+
AlertDialogAction
|
|
22
|
+
|
|
23
|
+
## Defaults
|
|
24
|
+
none
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
```jsx
|
|
28
|
+
<AlertDialog>
|
|
29
|
+
<AlertDialogTrigger asChild>
|
|
30
|
+
<Button color="error">Delete</Button>
|
|
31
|
+
</AlertDialogTrigger>
|
|
32
|
+
<AlertDialogContent>
|
|
33
|
+
<AlertDialogHeader>
|
|
34
|
+
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
35
|
+
<AlertDialogDescription>This cannot be undone.</AlertDialogDescription>
|
|
36
|
+
</AlertDialogHeader>
|
|
37
|
+
<AlertDialogFooter>
|
|
38
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
39
|
+
<AlertDialogAction>Delete</AlertDialogAction>
|
|
40
|
+
</AlertDialogFooter>
|
|
41
|
+
</AlertDialogContent>
|
|
42
|
+
</AlertDialog>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Gotchas
|
|
46
|
+
- AlertDialogAction does NOT have color="error" styling — add it yourself via className or wrap a Button
|
|
47
|
+
|
|
48
|
+
## Changes
|
|
49
|
+
### v0.18.0
|
|
50
|
+
- **Changed** Overlay animations migrated to Framer Motion (physics-based springs)
|
|
51
|
+
- **Added** `AlertDialogContentProps`, `AlertDialogActionProps`, `AlertDialogCancelProps` type exports
|
|
52
|
+
- **Fixed** Context provider value wrapped in `useMemo` for performance
|
|
53
|
+
|
|
54
|
+
### v0.4.2
|
|
55
|
+
- **Fixed** AlertDialogHeader/Footer now wrapped in `React.forwardRef` (matches Dialog/Sheet pattern)
|
|
56
|
+
|
|
57
|
+
### v0.1.0
|
|
58
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Alert
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/alert
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
variant: "subtle" | "filled" | "outline"
|
|
9
|
+
color: "info" | "success" | "warning" | "error" | "neutral"
|
|
10
|
+
title: string (optional)
|
|
11
|
+
onDismiss: () => void (optional, shows X button when provided)
|
|
12
|
+
children: ReactNode (body text)
|
|
13
|
+
|
|
14
|
+
## Defaults
|
|
15
|
+
variant="subtle", color="info"
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
```jsx
|
|
19
|
+
<Alert color="error" title="Save failed" onDismiss={() => setError(null)}>
|
|
20
|
+
Your changes could not be saved.
|
|
21
|
+
</Alert>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Gotchas
|
|
25
|
+
- NOT a compound component — use title prop, NOT <AlertTitle>
|
|
26
|
+
- DO NOT use variant="destructive" — use color="error"
|
|
27
|
+
- Renders role="alert" automatically
|
|
28
|
+
- Icon is auto-selected by color (info=circle, success=check, warning=triangle, error=alert)
|
|
29
|
+
|
|
30
|
+
## Changes
|
|
31
|
+
### v0.18.0
|
|
32
|
+
- **Changed** Exit animation migrated to Framer Motion
|
|
33
|
+
- **Fixed** `onDismiss` JSDoc documenting it fires after exit animation completes
|
|
34
|
+
- **Changed** OKLCH color token migration
|
|
35
|
+
|
|
36
|
+
### v0.3.1
|
|
37
|
+
- **Fixed** AlertProps uses `Omit<HTMLAttributes, 'color'>` to resolve TypeScript conflict with CVA `color` variant
|
|
38
|
+
|
|
39
|
+
### v0.3.0
|
|
40
|
+
- **Changed** (BREAKING) `variant` prop renamed to `color` for semantic intent
|
|
41
|
+
|
|
42
|
+
### v0.1.0
|
|
43
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# AspectRatio
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/aspect-ratio
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
ratio: number (e.g. 16/9, 4/3, 1)
|
|
9
|
+
|
|
10
|
+
## Defaults
|
|
11
|
+
none
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
```jsx
|
|
15
|
+
<AspectRatio ratio={16 / 9}>
|
|
16
|
+
<img src="/photo.jpg" alt="Photo" className="object-cover w-full h-full" />
|
|
17
|
+
</AspectRatio>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Gotchas
|
|
21
|
+
- ratio is a number, not a string — use `16/9` not `"16/9"`
|
|
22
|
+
|
|
23
|
+
## Changes
|
|
24
|
+
### v0.1.0
|
|
25
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Autocomplete
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/autocomplete
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
options: AutocompleteOption[] (REQUIRED) — { value: string, label: string }
|
|
9
|
+
value: AutocompleteOption | null
|
|
10
|
+
onValueChange: (option: AutocompleteOption) => void
|
|
11
|
+
placeholder: string
|
|
12
|
+
emptyText: string (default: "No options")
|
|
13
|
+
disabled: boolean
|
|
14
|
+
className: string
|
|
15
|
+
id: string
|
|
16
|
+
|
|
17
|
+
## Defaults
|
|
18
|
+
emptyText="No options"
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
<Autocomplete
|
|
23
|
+
options={[{ value: 'mumbai', label: 'Mumbai' }]}
|
|
24
|
+
value={selectedCity}
|
|
25
|
+
onValueChange={setSelectedCity}
|
|
26
|
+
placeholder="Search cities..."
|
|
27
|
+
/>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Gotchas
|
|
31
|
+
- Allows free-text input (no forced selection) — use Combobox for forced selection
|
|
32
|
+
- value is an object { value, label }, NOT just a string
|
|
33
|
+
|
|
34
|
+
## Changes
|
|
35
|
+
### v0.18.0
|
|
36
|
+
- **Fixed** Added `useEffect` to sync query when external value changes
|
|
37
|
+
|
|
38
|
+
### v0.14.0
|
|
39
|
+
- **Changed** z-index promoted from `z-dropdown` (1000) to `z-popover` (1400) — fixes dropdown rendering behind Sheet/Dialog overlays
|
|
40
|
+
|
|
41
|
+
### v0.3.0
|
|
42
|
+
- **Changed** (BREAKING) `onChange` renamed to `onValueChange`
|
|
43
|
+
|
|
44
|
+
### v0.1.1
|
|
45
|
+
- **Fixed** `focus:ring` changed to `focus-visible:ring` — focus ring no longer shows on mouse click
|
|
46
|
+
|
|
47
|
+
### v0.1.0
|
|
48
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/avatar
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
size: "xs" | "sm" | "md" | "lg" | "xl"
|
|
9
|
+
shape: "circle" | "square" | "rounded"
|
|
10
|
+
status: "online" | "offline" | "busy" | "away"
|
|
11
|
+
|
|
12
|
+
## Compound Components
|
|
13
|
+
Avatar (root with size/shape/status)
|
|
14
|
+
AvatarImage (src, alt)
|
|
15
|
+
AvatarFallback (children = initials text)
|
|
16
|
+
|
|
17
|
+
## Defaults
|
|
18
|
+
size="md", shape="circle"
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
<Avatar size="lg" status="online">
|
|
23
|
+
<AvatarImage src={user.photoUrl} alt={user.name} />
|
|
24
|
+
<AvatarFallback>JD</AvatarFallback>
|
|
25
|
+
</Avatar>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Gotchas
|
|
29
|
+
- Status dot renders with role="img" and aria-label (accessible, not decorative)
|
|
30
|
+
- Dot size scales automatically with avatar size
|
|
31
|
+
|
|
32
|
+
## Changes
|
|
33
|
+
### v0.1.0
|
|
34
|
+
- **Added** Initial release with CVA size variants (xs-xl) and status indicator badge
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/badge
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
variant: "subtle" | "solid" | "outline" | "secondary" (alias->subtle) | "destructive" (alias->solid+error)
|
|
9
|
+
color: "default" | "info" | "success" | "error" | "warning" | "brand" | "accent" | "teal" | "amber" | "slate" | "indigo" | "cyan" | "orange" | "emerald"
|
|
10
|
+
size: "xs" | "sm" | "md" | "lg"
|
|
11
|
+
dot: boolean (shows leading dot indicator)
|
|
12
|
+
onDismiss: () => void (shows X button when provided)
|
|
13
|
+
children: ReactNode
|
|
14
|
+
|
|
15
|
+
## Defaults
|
|
16
|
+
variant="subtle", color="default", size="md"
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
```jsx
|
|
20
|
+
<Badge variant="solid" color="success">Active</Badge>
|
|
21
|
+
<Badge color="teal" onDismiss={() => removeFilter('teal')}>Teal team</Badge>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Gotchas
|
|
25
|
+
- DO NOT use variant="destructive" — use variant="solid" color="error"
|
|
26
|
+
- Badge is display-only; for interactive tags use Chip
|
|
27
|
+
|
|
28
|
+
## Changes
|
|
29
|
+
### v0.18.0
|
|
30
|
+
- **Changed** Pulse-ring animation migrated to Framer Motion
|
|
31
|
+
- **Fixed** Accent color variants — `text-accent-9` changed to `text-accent-11`, `border-accent-9` changed to `border-accent-7`
|
|
32
|
+
- **Changed** OKLCH color token migration
|
|
33
|
+
|
|
34
|
+
### v0.8.0
|
|
35
|
+
- **Fixed** `text-[10px]` changed to `text-ds-xs` for token consistency
|
|
36
|
+
|
|
37
|
+
### v0.4.2
|
|
38
|
+
- **Fixed** `Omit<HTMLAttributes, 'color'>` resolves TS2320 conflict with CVA color prop
|
|
39
|
+
|
|
40
|
+
### v0.3.1
|
|
41
|
+
- **Fixed** Dismiss button added 24px touch target
|
|
42
|
+
|
|
43
|
+
### v0.3.0
|
|
44
|
+
- **Changed** (BREAKING) Single `variant` axis split into `variant` (subtle/solid/outline) + `color` (default/info/success/error/...)
|
|
45
|
+
- **Fixed** Solid variant phantom token `text-on-interactive` changed to `text-on-color`
|
|
46
|
+
|
|
47
|
+
### v0.1.0
|
|
48
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Banner
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/banner
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
color: "info" | "success" | "warning" | "error" | "neutral"
|
|
9
|
+
action: ReactNode (optional action slot, typically a ghost Button)
|
|
10
|
+
onDismiss: () => void (optional, shows X button)
|
|
11
|
+
children: ReactNode (message text)
|
|
12
|
+
|
|
13
|
+
## Defaults
|
|
14
|
+
color="info"
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
```jsx
|
|
18
|
+
<Banner color="warning" onDismiss={() => dismiss()}>
|
|
19
|
+
Scheduled maintenance on Sunday.
|
|
20
|
+
</Banner>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Gotchas
|
|
24
|
+
- Banner is full-width (spans container). Alert is inline.
|
|
25
|
+
- Renders role="alert" automatically
|
|
26
|
+
|
|
27
|
+
## Changes
|
|
28
|
+
### v0.3.1
|
|
29
|
+
- **Fixed** BannerProps uses `Omit<HTMLAttributes, 'color'>` to resolve TypeScript conflict with CVA `color` variant
|
|
30
|
+
|
|
31
|
+
### v0.3.0
|
|
32
|
+
- **Changed** (BREAKING) `variant` prop renamed to `color` for semantic intent
|
|
33
|
+
|
|
34
|
+
### v0.1.0
|
|
35
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Breadcrumb
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/breadcrumb
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
Breadcrumb (root nav)
|
|
9
|
+
BreadcrumbList (ol)
|
|
10
|
+
BreadcrumbItem (li)
|
|
11
|
+
BreadcrumbLink (for clickable items) | BreadcrumbPage (for current page)
|
|
12
|
+
BreadcrumbSeparator (auto-rendered or custom)
|
|
13
|
+
BreadcrumbEllipsis (for collapsed items)
|
|
14
|
+
|
|
15
|
+
## Defaults
|
|
16
|
+
none
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
```jsx
|
|
20
|
+
<Breadcrumb>
|
|
21
|
+
<BreadcrumbList>
|
|
22
|
+
<BreadcrumbItem><BreadcrumbLink href="/">Home</BreadcrumbLink></BreadcrumbItem>
|
|
23
|
+
<BreadcrumbSeparator />
|
|
24
|
+
<BreadcrumbItem><BreadcrumbPage>Settings</BreadcrumbPage></BreadcrumbItem>
|
|
25
|
+
</BreadcrumbList>
|
|
26
|
+
</Breadcrumb>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Gotchas
|
|
30
|
+
- Use BreadcrumbPage for the current (non-clickable) page, BreadcrumbLink for navigable items
|
|
31
|
+
|
|
32
|
+
## Changes
|
|
33
|
+
### v0.18.0
|
|
34
|
+
- **Added** `BreadcrumbProps`, `BreadcrumbLinkProps` type exports
|
|
35
|
+
|
|
36
|
+
### v0.1.0
|
|
37
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ButtonGroup
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/button-group
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
variant: ButtonProps['variant'] (propagated to children)
|
|
9
|
+
color: ButtonProps['color'] (propagated to children)
|
|
10
|
+
size: ButtonProps['size'] (propagated to children)
|
|
11
|
+
orientation: "horizontal" | "vertical" (default: "horizontal")
|
|
12
|
+
|
|
13
|
+
## Defaults
|
|
14
|
+
orientation="horizontal"
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
```jsx
|
|
18
|
+
<ButtonGroup variant="outline" size="sm">
|
|
19
|
+
<Button>Bold</Button>
|
|
20
|
+
<Button>Italic</Button>
|
|
21
|
+
</ButtonGroup>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Gotchas
|
|
25
|
+
- Children can override variant/size individually
|
|
26
|
+
|
|
27
|
+
## Changes
|
|
28
|
+
### v0.4.2
|
|
29
|
+
- **Fixed** `Omit<HTMLAttributes, 'color'>` resolves TS2320 conflict with CVA color prop
|
|
30
|
+
|
|
31
|
+
### v0.1.0
|
|
32
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/button
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
variant: "solid" | "default" (alias->solid) | "outline" | "ghost" | "link" | "destructive" (alias->solid+error)
|
|
9
|
+
color: "default" | "error"
|
|
10
|
+
size: "sm" | "md" | "lg" | "icon" | "icon-sm" | "icon-md" | "icon-lg"
|
|
11
|
+
startIcon: ReactNode
|
|
12
|
+
endIcon: ReactNode
|
|
13
|
+
loading: boolean (disables button, shows spinner)
|
|
14
|
+
loadingPosition: "start" | "end" | "center" (default: "start")
|
|
15
|
+
fullWidth: boolean
|
|
16
|
+
asChild: boolean
|
|
17
|
+
onClickAsync: (e: MouseEvent) => Promise<void> (auto loading->success/error->idle)
|
|
18
|
+
asyncFeedbackDuration: number (ms, default 1500)
|
|
19
|
+
|
|
20
|
+
## Defaults
|
|
21
|
+
variant="solid", color="default", size="md"
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
```jsx
|
|
25
|
+
<Button variant="solid" color="error" startIcon={<IconTrash />} loading={isDeleting}>
|
|
26
|
+
Delete project
|
|
27
|
+
</Button>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Gotchas
|
|
31
|
+
- DO NOT use variant="destructive" — use variant="solid" color="error"
|
|
32
|
+
- DO NOT use variant="secondary" — use variant="outline" or variant="ghost"
|
|
33
|
+
- DO NOT use size="default" — use size="md"
|
|
34
|
+
- DO NOT use color="danger" — use color="error"
|
|
35
|
+
- Inherits variant/color/size from ButtonGroup context if present
|
|
36
|
+
- onClickAsync overrides onClick and loading when active
|
|
37
|
+
|
|
38
|
+
## Changes
|
|
39
|
+
### v0.18.0
|
|
40
|
+
- **Added** `onClickAsync` prop — promise-driven loading -> success/error state machine
|
|
41
|
+
- **Added** `asyncFeedbackDuration` prop (default 1500ms)
|
|
42
|
+
- **Changed** whileTap scale animation added via Framer Motion
|
|
43
|
+
- **Fixed** Async feedback colors — `bg-success text-text-on-color` changed to `bg-success-9 text-accent-fg`
|
|
44
|
+
- **Fixed** `onClickAsync` added `isMountedRef` guard to prevent set-state-after-unmount
|
|
45
|
+
|
|
46
|
+
### v0.4.2
|
|
47
|
+
- **Fixed** `Omit<HTMLAttributes, 'color'>` resolves TS2320 conflict with CVA color prop
|
|
48
|
+
- **Fixed** `className` was passed inside `buttonVariants()` (silently dropped by CVA) — now separate `cn()` argument
|
|
49
|
+
|
|
50
|
+
### v0.3.0
|
|
51
|
+
- **Changed** (BREAKING) `variant="primary"` renamed to `variant="solid"`, `variant="secondary"` renamed to `variant="outline"`, `variant="error"` moved to `color="error"`
|
|
52
|
+
- **Fixed** All dismiss/close buttons now meet WCAG 2.5.8 minimum 24px touch target
|
|
53
|
+
|
|
54
|
+
### v0.1.0
|
|
55
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/card
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
variant: "default" | "elevated" | "outline" | "flat"
|
|
9
|
+
interactive: boolean (enables hover shadow lift + pointer cursor)
|
|
10
|
+
|
|
11
|
+
## Compound Components
|
|
12
|
+
Card (root)
|
|
13
|
+
CardHeader
|
|
14
|
+
CardTitle
|
|
15
|
+
CardDescription
|
|
16
|
+
CardContent
|
|
17
|
+
CardFooter
|
|
18
|
+
|
|
19
|
+
## Defaults
|
|
20
|
+
variant="default"
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
```jsx
|
|
24
|
+
<Card variant="elevated" interactive onClick={() => navigate(url)}>
|
|
25
|
+
<CardHeader>
|
|
26
|
+
<CardTitle>Project</CardTitle>
|
|
27
|
+
<CardDescription>Last updated 2h ago</CardDescription>
|
|
28
|
+
</CardHeader>
|
|
29
|
+
<CardContent><p>Content here</p></CardContent>
|
|
30
|
+
</Card>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Gotchas
|
|
34
|
+
- Use `interactive` prop for clickable cards — adds hover lift and pointer cursor
|
|
35
|
+
|
|
36
|
+
## Changes
|
|
37
|
+
### v0.18.0
|
|
38
|
+
- **Changed** Interactive card hover lift animation migrated to Framer Motion
|
|
39
|
+
|
|
40
|
+
### v0.4.2
|
|
41
|
+
- **Changed** (BREAKING) `variant="outlined"` renamed to `variant="outline"`
|
|
42
|
+
- **Added** `cardVariants` export
|
|
43
|
+
|
|
44
|
+
### v0.1.1
|
|
45
|
+
- **Fixed** `leading-none tracking-tight` changed to `leading-ds-none tracking-ds-tight` for token compliance
|
|
46
|
+
|
|
47
|
+
### v0.1.0
|
|
48
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Charts
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/charts
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
Charts is a collection of chart components. Each accepts data-specific props.
|
|
9
|
+
|
|
10
|
+
Exported components:
|
|
11
|
+
ChartContainer — wrapper with responsive sizing
|
|
12
|
+
BarChart
|
|
13
|
+
LineChart
|
|
14
|
+
AreaChart
|
|
15
|
+
PieChart
|
|
16
|
+
Sparkline
|
|
17
|
+
GaugeChart
|
|
18
|
+
RadarChart
|
|
19
|
+
Legend — chart legend with LegendItem[]
|
|
20
|
+
|
|
21
|
+
## Defaults
|
|
22
|
+
none
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
```jsx
|
|
26
|
+
import { BarChart } from '@devalok/shilp-sutra/ui/charts'
|
|
27
|
+
|
|
28
|
+
<BarChart data={salesData} />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Gotchas
|
|
32
|
+
- Barrel-isolated since v0.5.0 — must use `@devalok/shilp-sutra/ui/charts`, NOT the `ui` barrel
|
|
33
|
+
- Requires D3 as an optional peer dependency
|
|
34
|
+
|
|
35
|
+
## Changes
|
|
36
|
+
### v0.18.0
|
|
37
|
+
- **Changed** All 8 chart types migrated to Framer Motion entrance animations
|
|
38
|
+
|
|
39
|
+
### v0.5.0
|
|
40
|
+
- **Changed** (BREAKING) All chart components removed from `@devalok/shilp-sutra/ui` barrel export. Must use `@devalok/shilp-sutra/ui/charts` import path.
|
|
41
|
+
|
|
42
|
+
### v0.1.0
|
|
43
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/checkbox
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
checked: boolean | "indeterminate"
|
|
9
|
+
onCheckedChange: (checked: boolean | "indeterminate") => void
|
|
10
|
+
error: boolean (shows red border)
|
|
11
|
+
indeterminate: boolean (overrides checked, shows dash icon)
|
|
12
|
+
disabled: boolean
|
|
13
|
+
|
|
14
|
+
## Defaults
|
|
15
|
+
none
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
```jsx
|
|
19
|
+
<Checkbox checked={agreed} onCheckedChange={(v) => setAgreed(v === true)} />
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Gotchas
|
|
23
|
+
- indeterminate overrides checked visually
|
|
24
|
+
|
|
25
|
+
## Changes
|
|
26
|
+
### v0.18.0
|
|
27
|
+
- **Changed** Bouncy check indicator animation migrated to Framer Motion
|
|
28
|
+
- **Fixed** Icon sizing uses design tokens consistently
|
|
29
|
+
|
|
30
|
+
### v0.1.0
|
|
31
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Chip
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/chip
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
label: string (REQUIRED — use this, NOT children)
|
|
9
|
+
variant: "subtle" | "outline"
|
|
10
|
+
color: "default" | "primary" | "success" | "error" | "warning" | "info" | "teal" | "amber" | "slate" | "indigo" | "cyan" | "orange" | "emerald"
|
|
11
|
+
size: "sm" | "md" | "lg"
|
|
12
|
+
icon: ReactNode
|
|
13
|
+
onClick: MouseEventHandler (renders as <button> when provided)
|
|
14
|
+
onDismiss: () => void (shows X button)
|
|
15
|
+
disabled: boolean
|
|
16
|
+
|
|
17
|
+
## Defaults
|
|
18
|
+
variant="subtle", size="md", color="default"
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
<Chip label="In Progress" color="warning" />
|
|
23
|
+
<Chip label="React" color="info" onDismiss={() => removeFilter('react')} />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Additional Exports
|
|
27
|
+
ChipGroup — re-exported AnimatePresence from framer-motion; wrap a list of Chips for coordinated exit animations
|
|
28
|
+
|
|
29
|
+
## Gotchas
|
|
30
|
+
- MUST use label prop — children are NOT rendered
|
|
31
|
+
- `<Chip>text</Chip>` is WRONG — use `<Chip label="text" />`
|
|
32
|
+
- Wrap dynamic chip lists in `<ChipGroup>` for exit animations
|
|
33
|
+
|
|
34
|
+
## Changes
|
|
35
|
+
### v0.4.2
|
|
36
|
+
- **Changed** (BREAKING) `variant="filled"` renamed to `"subtle"`, `variant="outlined"` renamed to `"outline"`, `onDelete` renamed to `onDismiss`
|
|
37
|
+
|
|
38
|
+
### v0.1.1
|
|
39
|
+
- **Fixed** `opacity-[var(--action-disabled-opacity,0.38)]` replaced with `opacity-action-disabled`
|
|
40
|
+
- **Fixed** Converted from `React.createElement` to JSX syntax
|
|
41
|
+
|
|
42
|
+
### v0.1.0
|
|
43
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Code
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/code
|
|
4
|
+
- Server-safe: Yes
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
variant: "inline" | "block"
|
|
9
|
+
children: ReactNode
|
|
10
|
+
|
|
11
|
+
## Defaults
|
|
12
|
+
variant="inline"
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
```jsx
|
|
16
|
+
<Code>onClick</Code>
|
|
17
|
+
<Code variant="block">{`const x = 1;\nconsole.log(x);`}</Code>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Gotchas
|
|
21
|
+
- "block" renders as `<pre><code>`, "inline" renders as `<code>`
|
|
22
|
+
|
|
23
|
+
## Changes
|
|
24
|
+
### v0.1.1
|
|
25
|
+
- **Fixed** `leading-[150%]` replaced with `leading-ds-relaxed` for token compliance
|
|
26
|
+
|
|
27
|
+
### v0.1.0
|
|
28
|
+
- **Added** Initial release
|