@devalok/shilp-sutra 0.18.0 → 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/dist/_chunks/motion-provider.js +24 -0
- package/dist/_chunks/primitives.js +101 -101
- package/dist/_chunks/tree-view.js +12 -12
- package/dist/_chunks/use-calendar.js +1 -1
- package/dist/_chunks/vendor-utils.js +2 -2
- package/dist/composed/activity-feed.js +21 -21
- package/dist/composed/avatar-group.js +25 -25
- package/dist/composed/command-palette.js +3 -3
- package/dist/composed/confirm-dialog.js +1 -1
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/empty-state.js +2 -2
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/global-loading.js +10 -10
- package/dist/composed/lib/string-utils.d.ts +0 -1
- package/dist/composed/lib/string-utils.js +0 -1
- package/dist/composed/loading-skeleton.js +1 -1
- package/dist/composed/member-picker.js +6 -6
- package/dist/composed/page-header.js +1 -1
- package/dist/composed/page-skeletons.js +1 -1
- package/dist/composed/priority-indicator.js +6 -6
- package/dist/composed/rich-text-editor.js +1 -1
- package/dist/composed/schedule-view.js +15 -15
- package/dist/composed/simple-tooltip.js +8 -8
- package/dist/composed/status-badge.js +12 -12
- package/dist/motion/index.d.ts +1 -1
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/index.js +8 -6
- package/dist/motion/primitives-index.js +184 -8
- package/dist/shell/app-command-palette.js +1 -1
- package/dist/shell/bottom-navbar.js +3 -3
- package/dist/shell/notification-center.js +35 -35
- package/dist/shell/notification-preferences.js +29 -28
- package/dist/shell/sidebar.js +56 -56
- package/dist/shell/top-bar.js +25 -25
- package/dist/ui/accordion.js +11 -11
- package/dist/ui/alert-dialog.js +41 -41
- package/dist/ui/alert.js +10 -10
- package/dist/ui/aspect-ratio.js +5 -5
- package/dist/ui/autocomplete.js +15 -15
- package/dist/ui/avatar.js +4 -4
- package/dist/ui/badge.js +11 -11
- package/dist/ui/banner.js +3 -3
- package/dist/ui/breadcrumb.js +8 -8
- package/dist/ui/button-group.js +4 -4
- package/dist/ui/button.js +25 -25
- package/dist/ui/card.js +5 -5
- package/dist/ui/charts/index.js +4 -4
- package/dist/ui/checkbox.js +4 -4
- package/dist/ui/chip.js +14 -14
- package/dist/ui/code.js +1 -1
- package/dist/ui/collapsible.js +7 -7
- package/dist/ui/color-input.js +1 -1
- package/dist/ui/combobox.js +5 -5
- package/dist/ui/container.js +4 -4
- package/dist/ui/context-menu.js +4 -4
- package/dist/ui/data-table-toolbar.js +18 -18
- package/dist/ui/data-table.js +55 -55
- package/dist/ui/dialog.js +3 -3
- package/dist/ui/dropdown-menu.js +3 -3
- package/dist/ui/file-upload.js +10 -10
- package/dist/ui/form.js +1 -1
- package/dist/ui/hover-card.js +12 -12
- package/dist/ui/icon-button.js +9 -9
- package/dist/ui/index.js +322 -516
- package/dist/ui/input-otp.js +4 -4
- package/dist/ui/input.js +9 -9
- package/dist/ui/label.js +9 -9
- package/dist/ui/lib/date-utils.d.ts +0 -1
- package/dist/{_chunks → ui/lib}/date-utils.js +1 -2
- package/dist/{_chunks/motion2.js → ui/lib/motion.js} +13 -14
- package/dist/ui/lib/use-ripple.d.ts.map +1 -1
- package/dist/ui/lib/utils.js +1 -1
- package/dist/ui/link.js +1 -1
- package/dist/ui/menubar.js +66 -66
- package/dist/ui/navigation-menu.js +4 -4
- package/dist/ui/number-input.js +9 -9
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/popover.js +18 -18
- package/dist/ui/progress.js +4 -4
- package/dist/ui/radio.js +11 -11
- package/dist/ui/search-input.js +2 -2
- package/dist/ui/segmented-control.d.ts +2 -0
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +59 -55
- package/dist/ui/select.js +19 -19
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.js +10 -10
- package/dist/ui/sidebar.js +574 -38
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.js +9 -9
- package/dist/ui/spinner.js +2 -2
- package/dist/ui/stack.js +1 -1
- package/dist/ui/stat-card.js +35 -35
- package/dist/ui/stepper.d.ts +1 -3
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +74 -74
- package/dist/ui/switch.js +7 -7
- package/dist/ui/table.js +28 -28
- package/dist/ui/tabs.js +10 -10
- package/dist/ui/text.js +1 -1
- package/dist/ui/textarea.js +10 -10
- package/dist/ui/toast.js +12 -12
- package/dist/ui/toaster.js +11 -11
- package/dist/ui/toggle-group.js +2 -2
- package/dist/ui/toggle.js +8 -8
- package/dist/ui/tooltip.js +21 -21
- package/dist/ui/visually-hidden.js +3 -3
- 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 +3384 -1591
- package/llms.txt +4 -4
- package/package.json +28 -3
- package/dist/_chunks/avatar.js +0 -52
- package/dist/_chunks/button-group.js +0 -27
- package/dist/_chunks/button.js +0 -113
- package/dist/_chunks/card.js +0 -50
- package/dist/_chunks/checkbox.js +0 -16
- package/dist/_chunks/form.js +0 -27
- package/dist/_chunks/sidebar.js +0 -606
- package/dist/_chunks/spinner.js +0 -64
- package/dist/_chunks/tooltip.js +0 -30
- package/dist/_chunks/utils.js +0 -17
- package/dist/motion/motion-provider.js +0 -24
- package/dist/motion/primitives.js +0 -187
- /package/dist/_chunks/{motion.js → framer.js} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Stepper / Step
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/stepper
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
### Stepper
|
|
9
|
+
activeStep: number (REQUIRED, 0-indexed)
|
|
10
|
+
orientation: "horizontal" | "vertical"
|
|
11
|
+
children: <Step> elements
|
|
12
|
+
|
|
13
|
+
### Step
|
|
14
|
+
label: string (REQUIRED)
|
|
15
|
+
description: string
|
|
16
|
+
icon: ReactNode (overrides default number/checkmark)
|
|
17
|
+
|
|
18
|
+
## Defaults
|
|
19
|
+
orientation: "horizontal"
|
|
20
|
+
|
|
21
|
+
### StepperContent
|
|
22
|
+
activeStep: number (REQUIRED, 0-indexed — matches Stepper's activeStep)
|
|
23
|
+
children: ReactNode (one child per step, only the active one is visible)
|
|
24
|
+
className: string
|
|
25
|
+
|
|
26
|
+
## Compound Components
|
|
27
|
+
Stepper (root)
|
|
28
|
+
Step (label, description, icon)
|
|
29
|
+
StepperContent (content panel, animates active step)
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
```jsx
|
|
33
|
+
<Stepper activeStep={1}>
|
|
34
|
+
<Step label="Account" description="Create credentials" />
|
|
35
|
+
<Step label="Profile" description="Add details" />
|
|
36
|
+
<Step label="Review" />
|
|
37
|
+
</Stepper>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Gotchas
|
|
41
|
+
- Steps before activeStep are "completed", at activeStep is "active", after is "pending"
|
|
42
|
+
|
|
43
|
+
## Changes
|
|
44
|
+
### v0.18.0
|
|
45
|
+
- **Fixed** `bg-interactive` changed to `bg-accent-9` (OKLCH migration)
|
|
46
|
+
- **Fixed** Wrapped Stepper context provider value in `useMemo` for performance
|
|
47
|
+
|
|
48
|
+
### v0.1.0
|
|
49
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/switch
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
checked: boolean
|
|
9
|
+
onCheckedChange: (checked: boolean) => void
|
|
10
|
+
error: boolean (shows red border/bg)
|
|
11
|
+
disabled: boolean
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
```jsx
|
|
15
|
+
<Switch checked={enabled} onCheckedChange={setEnabled} />
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Gotchas
|
|
19
|
+
- Use error prop for validation states (matches Checkbox API)
|
|
20
|
+
|
|
21
|
+
## Changes
|
|
22
|
+
### v0.18.0
|
|
23
|
+
- **Changed** Migrated to Framer Motion spring thumb animation
|
|
24
|
+
- **Fixed** Added visible border on unchecked state (`border-surface-border-strong`) — was borderless, making unchecked state hard to see
|
|
25
|
+
|
|
26
|
+
### v0.4.2
|
|
27
|
+
- **Fixed** `React.ComponentRef` changed to `React.ElementRef` for consistency
|
|
28
|
+
|
|
29
|
+
### v0.3.0
|
|
30
|
+
- **Added** `SwitchProps` type export
|
|
31
|
+
- **Added** `error` prop (matches Checkbox API)
|
|
32
|
+
|
|
33
|
+
### v0.1.0
|
|
34
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/table
|
|
4
|
+
- Server-safe: Yes
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
Table (root <table>)
|
|
9
|
+
TableHeader (<thead>)
|
|
10
|
+
TableRow (<tr>)
|
|
11
|
+
TableHead (<th>)
|
|
12
|
+
TableBody (<tbody>)
|
|
13
|
+
TableRow (<tr>)
|
|
14
|
+
TableCell (<td>)
|
|
15
|
+
TableFooter (<tfoot>)
|
|
16
|
+
TableCaption (<caption>)
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
```jsx
|
|
20
|
+
<Table>
|
|
21
|
+
<TableHeader>
|
|
22
|
+
<TableRow>
|
|
23
|
+
<TableHead>Name</TableHead>
|
|
24
|
+
<TableHead>Status</TableHead>
|
|
25
|
+
</TableRow>
|
|
26
|
+
</TableHeader>
|
|
27
|
+
<TableBody>
|
|
28
|
+
<TableRow>
|
|
29
|
+
<TableCell>Project Alpha</TableCell>
|
|
30
|
+
<TableCell><Badge color="success">Active</Badge></TableCell>
|
|
31
|
+
</TableRow>
|
|
32
|
+
</TableBody>
|
|
33
|
+
</Table>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Gotchas
|
|
37
|
+
- Table headers automatically have scope="col" for screen reader navigation
|
|
38
|
+
|
|
39
|
+
## Changes
|
|
40
|
+
### v0.18.0
|
|
41
|
+
- **Added** `TableProps`, `TableRowProps`, `TableCellProps` type exports
|
|
42
|
+
|
|
43
|
+
### v0.17.0
|
|
44
|
+
- **Fixed** TableCell: Added `px-ds-03` horizontal padding — was `px-0`, causing content to hug container edges
|
|
45
|
+
|
|
46
|
+
### v0.1.0
|
|
47
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/tabs
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
### Tabs (root)
|
|
9
|
+
defaultValue: string
|
|
10
|
+
value: string
|
|
11
|
+
onValueChange: (value: string) => void
|
|
12
|
+
|
|
13
|
+
### TabsList
|
|
14
|
+
variant: "line" | "contained"
|
|
15
|
+
|
|
16
|
+
### TabsTrigger
|
|
17
|
+
value: string (REQUIRED)
|
|
18
|
+
variant: (inherits from TabsList)
|
|
19
|
+
|
|
20
|
+
### TabsContent
|
|
21
|
+
value: string (REQUIRED)
|
|
22
|
+
|
|
23
|
+
## Compound Components
|
|
24
|
+
Tabs (root)
|
|
25
|
+
TabsList (variant)
|
|
26
|
+
TabsTrigger (value)
|
|
27
|
+
TabsContent (value)
|
|
28
|
+
|
|
29
|
+
## Defaults
|
|
30
|
+
TabsList variant: "line"
|
|
31
|
+
|
|
32
|
+
## Example
|
|
33
|
+
```jsx
|
|
34
|
+
<Tabs defaultValue="overview">
|
|
35
|
+
<TabsList variant="contained">
|
|
36
|
+
<TabsTrigger value="overview">Overview</TabsTrigger>
|
|
37
|
+
<TabsTrigger value="activity">Activity</TabsTrigger>
|
|
38
|
+
</TabsList>
|
|
39
|
+
<TabsContent value="overview">Overview content</TabsContent>
|
|
40
|
+
<TabsContent value="activity">Activity content</TabsContent>
|
|
41
|
+
</Tabs>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Gotchas
|
|
45
|
+
- variant goes on TabsList, NOT on individual TabsTrigger (propagates via context)
|
|
46
|
+
- DO NOT put variant on TabsTrigger — it inherits from TabsList
|
|
47
|
+
|
|
48
|
+
## Changes
|
|
49
|
+
### v0.18.0
|
|
50
|
+
- **Fixed** Wrapped TabsList context provider value in `useMemo` for performance
|
|
51
|
+
|
|
52
|
+
### v0.14.0
|
|
53
|
+
- **Changed** TabsTrigger: Added `gap-ds-02` (4px) between icon and label for better spacing
|
|
54
|
+
|
|
55
|
+
### v0.1.0
|
|
56
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Text
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/text
|
|
4
|
+
- Server-safe: Yes
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
variant: TextVariant
|
|
9
|
+
as: ElementType (override the auto-selected HTML element)
|
|
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
|
+
## Defaults
|
|
15
|
+
variant: "body-md"
|
|
16
|
+
|
|
17
|
+
## Default Element Mapping
|
|
18
|
+
heading-2xl -> h1, heading-xl -> h2, heading-lg -> h3, heading-md -> h4, heading-sm -> h5, heading-xs -> h6
|
|
19
|
+
body-* -> p, label-* -> span, caption -> span, overline -> span
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
```jsx
|
|
23
|
+
<Text variant="heading-2xl">Page Title</Text>
|
|
24
|
+
<Text variant="body-sm" as="span">Inline text</Text>
|
|
25
|
+
<Text variant="label-sm" className="text-text-secondary">SECTION LABEL</Text>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Gotchas
|
|
29
|
+
- label-* and overline variants are automatically uppercase
|
|
30
|
+
- Use "as" prop to override the HTML element when needed
|
|
31
|
+
|
|
32
|
+
## Changes
|
|
33
|
+
### v0.2.0
|
|
34
|
+
- **Fixed** `as` prop widened to accept any `React.ElementType` — `<Text as="h1">` no longer causes TypeScript errors
|
|
35
|
+
|
|
36
|
+
### v0.1.0
|
|
37
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Textarea
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/textarea
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
size: "sm" | "md" | "lg"
|
|
9
|
+
state: "default" | "error" | "warning" | "success"
|
|
10
|
+
(plus standard textarea attributes except native "size")
|
|
11
|
+
|
|
12
|
+
## Defaults
|
|
13
|
+
size: "md"
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
```jsx
|
|
17
|
+
<Textarea size="lg" state="error" placeholder="Describe the issue..." />
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Gotchas
|
|
21
|
+
- state="error" sets aria-invalid automatically; all sizes are vertically resizable
|
|
22
|
+
- Inside FormField: auto-inherits state, aria-describedby, aria-required from context (explicit props override)
|
|
23
|
+
|
|
24
|
+
## Changes
|
|
25
|
+
### v0.15.0
|
|
26
|
+
- **Changed** `lg` size font changed from `text-ds-lg` (18px) to `text-ds-md` (14px) — all input sizes now use 14px for consistency
|
|
27
|
+
- **Changed** `md` size font standardized to `text-ds-md` (14px)
|
|
28
|
+
|
|
29
|
+
### v0.8.0
|
|
30
|
+
- **Fixed** Now consumes FormField context automatically (`aria-describedby`, `aria-invalid`, `aria-required`)
|
|
31
|
+
|
|
32
|
+
### v0.4.2
|
|
33
|
+
- **Added** `textareaVariants` export
|
|
34
|
+
|
|
35
|
+
### v0.1.1
|
|
36
|
+
- **Fixed** Added `aria-invalid` for error state (matching Input pattern)
|
|
37
|
+
|
|
38
|
+
### v0.1.0
|
|
39
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Toast
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/toast
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## API
|
|
8
|
+
toast('Plain message') // no icon, no accent bar
|
|
9
|
+
toast.message('Same as plain') // alias for toast()
|
|
10
|
+
toast.success('Saved!') // green accent, check icon
|
|
11
|
+
toast.error('Failed', { description }) // red accent, X icon
|
|
12
|
+
toast.warning('Disk low') // yellow accent, triangle icon
|
|
13
|
+
toast.info('New version') // blue accent, info icon
|
|
14
|
+
toast.loading('Saving...') // interactive accent, spinner, no timer bar, duration: Infinity
|
|
15
|
+
toast.promise(asyncFn, { loading, success, error }) // dynamic messages
|
|
16
|
+
toast.undo('Item deleted', { onUndo, duration? }) // 8s default, Undo action button
|
|
17
|
+
toast.upload({ files, id?, onRetry?, onRemove? }) // upload toast with per-file progress
|
|
18
|
+
toast.custom((id) => <MyComponent />, options) // escape hatch
|
|
19
|
+
toast.dismiss(id?) // specific or all
|
|
20
|
+
|
|
21
|
+
## Options (all methods accept)
|
|
22
|
+
id?: string
|
|
23
|
+
description?: ReactNode
|
|
24
|
+
action?: { label: string, onClick: () => void }
|
|
25
|
+
cancel?: { label: string, onClick: () => void }
|
|
26
|
+
duration?: number (ms, default 5000)
|
|
27
|
+
|
|
28
|
+
## Types
|
|
29
|
+
UploadFile: { id, name, size (bytes), progress? (0-100), status: 'pending' | 'uploading' | 'processing' | 'complete' | 'error', error?, previewUrl? }
|
|
30
|
+
|
|
31
|
+
## Utility
|
|
32
|
+
formatFileSize(bytes) => string (B, KB, MB, GB)
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
```jsx
|
|
36
|
+
// Mount <Toaster /> once at root layout
|
|
37
|
+
import { toast } from '@devalok/shilp-sutra/ui/toast'
|
|
38
|
+
|
|
39
|
+
toast.success('Changes saved!')
|
|
40
|
+
toast.error('Upload failed', { description: 'File too large' })
|
|
41
|
+
toast.undo('Task deleted', { onUndo: () => restoreTask(id) })
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Gotchas
|
|
45
|
+
- DO NOT use useToast() hook — it is deprecated, use imperative toast.* methods
|
|
46
|
+
- DO NOT use toast({ title, color }) object syntax — use toast.success('message') etc.
|
|
47
|
+
- DO NOT call toast() without <Toaster /> mounted at layout root
|
|
48
|
+
- Timer bar animates auto-dismiss countdown (hidden on loading toasts)
|
|
49
|
+
- Upload toast replaces the old UploadProgress composed component
|
|
50
|
+
|
|
51
|
+
## Changes
|
|
52
|
+
### v0.18.0
|
|
53
|
+
- **Changed** (BREAKING) Complete rewrite to Sonner-based imperative API
|
|
54
|
+
- **Fixed** Accent bar colors from step 7 to step 9 (decorative fills use solid step)
|
|
55
|
+
|
|
56
|
+
### v0.4.2
|
|
57
|
+
- **Changed** (BREAKING) `color="default"` renamed to `color="neutral"`
|
|
58
|
+
|
|
59
|
+
### v0.3.0
|
|
60
|
+
- **Changed** (BREAKING) `variant` prop renamed to `color` for semantic intent
|
|
61
|
+
- **Fixed** Close button now always visible (was hidden until hover)
|
|
62
|
+
|
|
63
|
+
### v0.1.0
|
|
64
|
+
- **Added** Initial release
|
|
65
|
+
- **Fixed** Toast now announces to screen readers (`role="status"`, `aria-live`)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Toaster
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/toaster
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
position: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
|
|
9
|
+
closeButton: boolean
|
|
10
|
+
duration: number (ms)
|
|
11
|
+
hotkey: string[]
|
|
12
|
+
visibleToasts: number
|
|
13
|
+
|
|
14
|
+
## Defaults
|
|
15
|
+
position: "bottom-right"
|
|
16
|
+
closeButton: false
|
|
17
|
+
duration: 5000
|
|
18
|
+
hotkey: ['altKey', 'KeyT']
|
|
19
|
+
visibleToasts: 3
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
```jsx
|
|
23
|
+
// Mount once at root layout
|
|
24
|
+
import { Toaster } from '@devalok/shilp-sutra/ui/toaster'
|
|
25
|
+
|
|
26
|
+
export default function RootLayout({ children }) {
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
{children}
|
|
30
|
+
<Toaster />
|
|
31
|
+
</>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Gotchas
|
|
37
|
+
- Must be mounted once at the layout root for toast notifications to work
|
|
38
|
+
- Use the `toast` import from `@devalok/shilp-sutra/ui/toast` to trigger toasts
|
|
39
|
+
|
|
40
|
+
## Changes
|
|
41
|
+
### v0.18.0
|
|
42
|
+
- **Changed** (BREAKING) Rewritten to Sonner-based engine with custom ToastContent rendering
|
|
43
|
+
- **Added** `ToasterProps` type export
|
|
44
|
+
- **Added** Visual: neutral bg-layer-01 base, colored left accent bar per type, status icon, timer bar
|
|
45
|
+
|
|
46
|
+
### v0.1.0
|
|
47
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ToggleGroup
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/toggle-group
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
### ToggleGroup
|
|
9
|
+
type: "single" | "multiple"
|
|
10
|
+
variant: "default" | "outline" (propagated to items)
|
|
11
|
+
size: "sm" | "md" | "lg" (propagated to items)
|
|
12
|
+
value: string | string[]
|
|
13
|
+
onValueChange: (value) => void
|
|
14
|
+
|
|
15
|
+
### ToggleGroupItem
|
|
16
|
+
value: string
|
|
17
|
+
|
|
18
|
+
## Compound Components
|
|
19
|
+
ToggleGroup (root)
|
|
20
|
+
ToggleGroupItem (value: string)
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
```jsx
|
|
24
|
+
<ToggleGroup type="single" variant="outline" size="sm" value={alignment} onValueChange={setAlignment}>
|
|
25
|
+
<ToggleGroupItem value="left"><IconAlignLeft /></ToggleGroupItem>
|
|
26
|
+
<ToggleGroupItem value="center"><IconAlignCenter /></ToggleGroupItem>
|
|
27
|
+
<ToggleGroupItem value="right"><IconAlignRight /></ToggleGroupItem>
|
|
28
|
+
</ToggleGroup>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Gotchas
|
|
32
|
+
- type is required — "single" or "multiple"
|
|
33
|
+
- variant and size propagate from ToggleGroup to items
|
|
34
|
+
|
|
35
|
+
## Changes
|
|
36
|
+
### v0.18.0
|
|
37
|
+
- **Fixed** Wrapped ToggleGroup context provider value in `useMemo` for performance
|
|
38
|
+
|
|
39
|
+
### v0.4.2
|
|
40
|
+
- **Added** `ToggleGroupProps`, `ToggleGroupItemProps` type exports
|
|
41
|
+
|
|
42
|
+
### v0.1.0
|
|
43
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Toggle
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/toggle
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
variant: "default" | "outline"
|
|
9
|
+
size: "sm" | "md" | "lg"
|
|
10
|
+
pressed: boolean
|
|
11
|
+
onPressedChange: (pressed: boolean) => void
|
|
12
|
+
defaultPressed: boolean
|
|
13
|
+
|
|
14
|
+
## Defaults
|
|
15
|
+
variant: "default"
|
|
16
|
+
size: "md"
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
```jsx
|
|
20
|
+
<Toggle aria-label="Toggle bold" pressed={isBold} onPressedChange={setIsBold}>
|
|
21
|
+
<IconBold />
|
|
22
|
+
</Toggle>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Gotchas
|
|
26
|
+
- Always provide aria-label for accessibility
|
|
27
|
+
|
|
28
|
+
## Changes
|
|
29
|
+
### v0.18.0
|
|
30
|
+
- **Changed** Migrated to Framer Motion press spring animation
|
|
31
|
+
|
|
32
|
+
### v0.4.2
|
|
33
|
+
- **Fixed** `className` was passed inside CVA (silently dropped) — now separate `cn()` argument
|
|
34
|
+
- **Added** `ToggleProps` type export
|
|
35
|
+
|
|
36
|
+
### v0.1.0
|
|
37
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/tooltip
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Compound Components
|
|
8
|
+
TooltipProvider (REQUIRED at layout root or wrapping tooltip usage, controls delay)
|
|
9
|
+
Tooltip (root)
|
|
10
|
+
TooltipTrigger
|
|
11
|
+
TooltipContent
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
```jsx
|
|
15
|
+
<TooltipProvider>
|
|
16
|
+
<Tooltip>
|
|
17
|
+
<TooltipTrigger asChild><Button>Hover me</Button></TooltipTrigger>
|
|
18
|
+
<TooltipContent>Tooltip text</TooltipContent>
|
|
19
|
+
</Tooltip>
|
|
20
|
+
</TooltipProvider>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Gotchas
|
|
24
|
+
- TooltipProvider is REQUIRED — without it, tooltips won't show
|
|
25
|
+
|
|
26
|
+
## Changes
|
|
27
|
+
### v0.18.0
|
|
28
|
+
- **Changed** Migrated to Framer Motion for enter/exit animations
|
|
29
|
+
- **Added** `TooltipContentProps` type export
|
|
30
|
+
- **Fixed** Wrapped Tooltip context provider value in `useMemo` for performance
|
|
31
|
+
|
|
32
|
+
### v0.1.0
|
|
33
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# TreeView / TreeItem
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/tree-view
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
### TreeView
|
|
9
|
+
items: TreeNode[] (data-driven mode) — { id, label, icon?, disabled?, children? }
|
|
10
|
+
defaultExpanded: string[]
|
|
11
|
+
defaultSelected: string[]
|
|
12
|
+
multiSelect: boolean
|
|
13
|
+
checkboxes: boolean
|
|
14
|
+
onSelect: (ids: string[]) => void
|
|
15
|
+
onExpand: (ids: string[]) => void
|
|
16
|
+
children: ReactNode (declarative mode)
|
|
17
|
+
|
|
18
|
+
### TreeItem
|
|
19
|
+
itemId: string (REQUIRED)
|
|
20
|
+
label: ReactNode
|
|
21
|
+
secondaryLabel: ReactNode
|
|
22
|
+
icon: ReactNode
|
|
23
|
+
actions: ReactNode
|
|
24
|
+
disabled: boolean
|
|
25
|
+
depth: number
|
|
26
|
+
children: ReactNode (nested TreeItems)
|
|
27
|
+
|
|
28
|
+
## Hook
|
|
29
|
+
useTree({ defaultExpanded, defaultSelected, multiSelect, onSelect, onExpand })
|
|
30
|
+
|
|
31
|
+
## Example (data-driven)
|
|
32
|
+
```jsx
|
|
33
|
+
<TreeView
|
|
34
|
+
items={[
|
|
35
|
+
{ id: '1', label: 'Folder', children: [
|
|
36
|
+
{ id: '1.1', label: 'File A' },
|
|
37
|
+
{ id: '1.2', label: 'File B' },
|
|
38
|
+
]},
|
|
39
|
+
]}
|
|
40
|
+
defaultExpanded={['1']}
|
|
41
|
+
onSelect={(ids) => console.log(ids)}
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Example (declarative)
|
|
46
|
+
```jsx
|
|
47
|
+
<TreeView>
|
|
48
|
+
<TreeItem itemId="1" label="Folder">
|
|
49
|
+
<TreeItem itemId="1.1" label="File A" />
|
|
50
|
+
</TreeItem>
|
|
51
|
+
</TreeView>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Gotchas
|
|
55
|
+
- Supports both data-driven (items prop) and declarative (children) modes
|
|
56
|
+
|
|
57
|
+
## Changes
|
|
58
|
+
### v0.4.2
|
|
59
|
+
- **Added** TreeItem now accepts `className` prop
|
|
60
|
+
|
|
61
|
+
### v0.3.0
|
|
62
|
+
- **Added** Per-component export: `./ui/tree-view`
|
|
63
|
+
|
|
64
|
+
### v0.1.0
|
|
65
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# VisuallyHidden
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra/ui/visually-hidden
|
|
4
|
+
- Server-safe: Yes
|
|
5
|
+
- Category: ui
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
standard span attributes
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
```jsx
|
|
12
|
+
<VisuallyHidden>Screen reader only text</VisuallyHidden>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Gotchas
|
|
16
|
+
- Content is visually hidden but accessible to screen readers
|
|
17
|
+
- Useful for providing accessible labels without visual UI
|
|
18
|
+
|
|
19
|
+
## Changes
|
|
20
|
+
### v0.1.0
|
|
21
|
+
- **Added** Initial release
|