@devalok/shilp-sutra 0.17.0 → 0.17.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/llms-full.txt +40 -13
- package/llms.txt +16 -11
- package/package.json +1 -1
package/llms-full.txt
CHANGED
|
@@ -187,6 +187,7 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
187
187
|
<AvatarImage src={user.photoUrl} alt={user.name} />
|
|
188
188
|
<AvatarFallback>JD</AvatarFallback>
|
|
189
189
|
</Avatar>
|
|
190
|
+
- Type: AvatarStatus = 'online' | 'offline' | 'busy' | 'away'
|
|
190
191
|
- Gotchas:
|
|
191
192
|
- Status dot renders with role="img" and aria-label (accessible, not decorative)
|
|
192
193
|
- Dot size scales automatically with avatar size
|
|
@@ -534,6 +535,7 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
534
535
|
required: boolean
|
|
535
536
|
- Props (FormHelperText):
|
|
536
537
|
state: "helper" | "error" | "warning" | "success" (inherits from FormField context)
|
|
538
|
+
- Type: FormHelperState = 'helper' | 'error' | 'warning' | 'success'
|
|
537
539
|
- Hook: useFormField() => { state, helperTextId, required }
|
|
538
540
|
- Example:
|
|
539
541
|
<FormField state="error">
|
|
@@ -581,9 +583,10 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
581
583
|
## Input
|
|
582
584
|
- Import: @devalok/shilp-sutra/ui/input
|
|
583
585
|
- Server-safe: No
|
|
586
|
+
- Type: InputState = 'default' | 'error' | 'warning' | 'success'
|
|
584
587
|
- Props:
|
|
585
588
|
size: "sm" | "md" | "lg"
|
|
586
|
-
state:
|
|
589
|
+
state: InputState
|
|
587
590
|
startIcon: ReactNode
|
|
588
591
|
endIcon: ReactNode
|
|
589
592
|
(plus all standard HTML input attributes except native "size")
|
|
@@ -814,10 +817,13 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
814
817
|
- Props (SegmentedControl root):
|
|
815
818
|
size: "sm" | "md" | "lg" (REQUIRED) — also accepts legacy "small" | "medium" | "big"
|
|
816
819
|
variant: "filled" | "tonal" (REQUIRED)
|
|
817
|
-
options: SegmentedControlOption[] (REQUIRED)
|
|
820
|
+
options: SegmentedControlOption[] (REQUIRED)
|
|
818
821
|
selectedId: string (REQUIRED)
|
|
819
822
|
onSelect: (id: string) => void (REQUIRED)
|
|
820
823
|
disabled: boolean
|
|
824
|
+
- Type: SegmentedControlOption = { id: string, text: string, icon?: ComponentType<{ className?: string }> }
|
|
825
|
+
- Type: SegmentedControlSize = 'sm' | 'md' | 'lg' | 'small' | 'medium' | 'big' (legacy aliases)
|
|
826
|
+
- Type: SegmentedControlVariant = 'filled' | 'tonal'
|
|
821
827
|
- Defaults: None — size and variant are required
|
|
822
828
|
- Example:
|
|
823
829
|
<SegmentedControl
|
|
@@ -1111,8 +1117,9 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
1111
1117
|
## Text
|
|
1112
1118
|
- Import: @devalok/shilp-sutra/ui/text
|
|
1113
1119
|
- Server-safe: Yes
|
|
1120
|
+
- Type: 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'
|
|
1114
1121
|
- Props:
|
|
1115
|
-
variant:
|
|
1122
|
+
variant: TextVariant
|
|
1116
1123
|
as: ElementType (override the auto-selected HTML element)
|
|
1117
1124
|
- Defaults: variant="body-md"
|
|
1118
1125
|
- Default element mapping:
|
|
@@ -1631,6 +1638,7 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
1631
1638
|
emptyState: ReactNode — empty state content
|
|
1632
1639
|
compact: boolean — tighter spacing, no avatars, smaller text
|
|
1633
1640
|
maxInitialItems: number — truncate with "Show all (N)" toggle
|
|
1641
|
+
- Type: ActivityItem = { id: string, actor?: { name: string, image?: string }, action: string | ReactNode, timestamp: Date | string, icon?: ReactNode, color?: 'default' | 'success' | 'warning' | 'error' | 'info', detail?: ReactNode }
|
|
1634
1642
|
- Example:
|
|
1635
1643
|
<ActivityFeed
|
|
1636
1644
|
items={[
|
|
@@ -1724,8 +1732,9 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
1724
1732
|
## PriorityIndicator
|
|
1725
1733
|
- Import: @devalok/shilp-sutra/composed/priority-indicator
|
|
1726
1734
|
- Server-safe: Yes
|
|
1735
|
+
- Type: Priority = 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT' | 'low' | 'medium' | 'high' | 'urgent'
|
|
1727
1736
|
- Props:
|
|
1728
|
-
priority:
|
|
1737
|
+
priority: Priority
|
|
1729
1738
|
display: "compact" | "full" (default: "full")
|
|
1730
1739
|
- Example:
|
|
1731
1740
|
<PriorityIndicator priority="HIGH" />
|
|
@@ -1881,9 +1890,11 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
1881
1890
|
extraGroups: CommandGroup[]
|
|
1882
1891
|
onNavigate: (path: string) => void
|
|
1883
1892
|
onSearch: (query: string) => void
|
|
1884
|
-
searchResults: SearchResult[]
|
|
1893
|
+
searchResults: SearchResult[]
|
|
1885
1894
|
isSearching: boolean (shows loading state while search is in progress)
|
|
1886
1895
|
onSearchResultSelect: (result: SearchResult) => void
|
|
1896
|
+
- Type: SearchResult = { id: string, title: string, snippet?: string, entityType: string, projectId?: string | null, metadata?: Record<string, unknown> }
|
|
1897
|
+
- Type: AppCommandPaletteUser = { name: string, role?: string }
|
|
1887
1898
|
- Example:
|
|
1888
1899
|
<AppCommandPalette
|
|
1889
1900
|
user={{ name: 'John', role: 'admin' }}
|
|
@@ -1903,7 +1914,10 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
|
|
|
1903
1914
|
logo: ReactNode
|
|
1904
1915
|
footerLinks: Array<{ label: string, href: string }>
|
|
1905
1916
|
className: string
|
|
1906
|
-
- NavItem
|
|
1917
|
+
- Type: NavItem = { title: string, href: string, icon: ReactNode, exact?: boolean, badge?: string | number, children?: NavSubItem[], defaultOpen?: boolean }
|
|
1918
|
+
- Type: NavSubItem = { title: string, href: string, icon?: ReactNode, exact?: boolean }
|
|
1919
|
+
- Type: NavGroup = { label: string, items: NavItem[], action?: ReactNode }
|
|
1920
|
+
- Type: SidebarUser = { name: string, email?: string, image?: string | null, designation?: string, role?: string }
|
|
1907
1921
|
- Example:
|
|
1908
1922
|
<AppSidebar
|
|
1909
1923
|
currentPath="/dashboard"
|
|
@@ -2021,10 +2035,12 @@ Deprecated props:
|
|
|
2021
2035
|
- Server-safe: No
|
|
2022
2036
|
- Props:
|
|
2023
2037
|
currentPath: string
|
|
2024
|
-
user: BottomNavbarUser | null (optional)
|
|
2025
|
-
primaryItems: BottomNavItem[] (max 4 recommended)
|
|
2038
|
+
user: BottomNavbarUser | null (optional). Not required to render.
|
|
2039
|
+
primaryItems: BottomNavItem[] (max 4 recommended)
|
|
2026
2040
|
moreItems: BottomNavItem[] (overflow items in "More" menu)
|
|
2027
2041
|
className: string
|
|
2042
|
+
- Type: BottomNavItem = { title: string, href: string, icon: ReactNode, exact?: boolean, badge?: number }
|
|
2043
|
+
- Type: BottomNavbarUser = { name: string, role?: string }
|
|
2028
2044
|
- Example:
|
|
2029
2045
|
<BottomNavbar
|
|
2030
2046
|
currentPath="/dashboard"
|
|
@@ -2053,8 +2069,9 @@ Deprecated props:
|
|
|
2053
2069
|
- Import: @devalok/shilp-sutra/shell/notification-center
|
|
2054
2070
|
- Server-safe: No
|
|
2055
2071
|
- Props:
|
|
2056
|
-
notifications: Notification[]
|
|
2057
|
-
|
|
2072
|
+
notifications: Notification[]
|
|
2073
|
+
- Type: Notification = { id: string, title: string, body?: string | null, tier: 'INFO' | 'IMPORTANT' | 'CRITICAL', isRead: boolean, createdAt: string, entityType?: string | null, entityId?: string | null, projectId?: string | null, project?: { title: string } | null, actions?: NotificationAction[] }
|
|
2074
|
+
- Type: NotificationAction = { label: string, variant?: 'primary' | 'default' | 'danger', onClick: (id: string) => void }
|
|
2058
2075
|
unreadCount: number (derived from notifications if not provided)
|
|
2059
2076
|
open: boolean (controlled mode)
|
|
2060
2077
|
onOpenChange: (open: boolean) => void
|
|
@@ -2088,8 +2105,10 @@ Deprecated props:
|
|
|
2088
2105
|
- Import: @devalok/shilp-sutra/shell/notification-preferences
|
|
2089
2106
|
- Server-safe: No
|
|
2090
2107
|
- Props:
|
|
2091
|
-
preferences: NotificationPreference[]
|
|
2092
|
-
projects: NotificationProject[]
|
|
2108
|
+
preferences: NotificationPreference[]
|
|
2109
|
+
projects: NotificationProject[]
|
|
2110
|
+
- Type: NotificationPreference = { id: string, userId?: string, projectId: string | null, channel: string, minTier: string, muted: boolean }
|
|
2111
|
+
- Type: NotificationProject = { id: string, title: string }
|
|
2093
2112
|
isLoading: boolean
|
|
2094
2113
|
onSave: (preference: { projectId, channel, minTier, muted }) => void | Promise<void>
|
|
2095
2114
|
onToggleMute: (preference: NotificationPreference) => void | Promise<void>
|
|
@@ -2120,7 +2139,8 @@ Deprecated props:
|
|
|
2120
2139
|
notificationSlot: ReactNode (render NotificationCenter here)
|
|
2121
2140
|
userMenuItems?: UserMenuItem[] — custom items between Profile and Dark/Light Mode toggle
|
|
2122
2141
|
className: string
|
|
2123
|
-
-
|
|
2142
|
+
- Type: TopBarUser = { name: string, email?: string, image?: string | null }
|
|
2143
|
+
- Type: UserMenuItem = { label: string, icon?: ReactNode, href?: string, onClick?: () => void, separator?: boolean, color?: string, badge?: string | boolean, disabled?: boolean }
|
|
2124
2144
|
href — navigates via onNavigate callback
|
|
2125
2145
|
onClick — custom action (takes precedence over href)
|
|
2126
2146
|
separator — renders a DropdownMenuSeparator before this item
|
|
@@ -2201,3 +2221,10 @@ Deprecated props:
|
|
|
2201
2221
|
## motion / duration / easings / durations
|
|
2202
2222
|
- Import: @devalok/shilp-sutra (barrel export)
|
|
2203
2223
|
- Design system motion tokens for custom animations
|
|
2224
|
+
- Type: MotionMode = 'productive' | 'expressive'
|
|
2225
|
+
- Type: MotionCategory = 'standard' | 'entrance' | 'exit'
|
|
2226
|
+
- Type: DurationToken = 'instant' | 'fast-01' | 'fast-02' | 'moderate-01' | 'moderate-02' | 'slow-01' | 'slow-02'
|
|
2227
|
+
- Function: motion(category: MotionCategory, mode: MotionMode) => string — returns CSS cubic-bezier string
|
|
2228
|
+
- Function: duration(token: DurationToken) => string — returns CSS duration string (e.g. '150ms')
|
|
2229
|
+
- Object: easings — Record<MotionMode, Record<MotionCategory, string>> — all cubic-bezier values
|
|
2230
|
+
- Object: durations — Record<DurationToken, string> — { instant: '0ms', fast-01: '70ms', fast-02: '110ms', moderate-01: '150ms', moderate-02: '240ms', slow-01: '400ms', slow-02: '700ms' }
|
package/llms.txt
CHANGED
|
@@ -108,7 +108,7 @@ Components with two-axis system: Button, Badge, Alert, Chip, Toast, Banner, Prog
|
|
|
108
108
|
### Inputs & Controls
|
|
109
109
|
- Button: variant(solid|default|outline|ghost|link) color(default|error) size(sm|md|lg|icon) + loading, startIcon, endIcon, asChild
|
|
110
110
|
- IconButton: icon(ReactNode, required) shape(square|circle) size(sm|md|lg) + aria-label required
|
|
111
|
-
- Input: size(sm|md|lg) state(
|
|
111
|
+
- Input: size(sm|md|lg) state(InputState) + startIcon, endIcon. Type: InputState = 'default' | 'error' | 'warning' | 'success'
|
|
112
112
|
- SearchInput: size(sm|md|lg) + loading, onClear
|
|
113
113
|
- NumberInput: value + onValueChange, min, max, step (controlled only)
|
|
114
114
|
- Textarea: size(sm|md|lg) state(default|error|warning|success)
|
|
@@ -119,7 +119,7 @@ Components with two-axis system: Button, Badge, Alert, Chip, Toast, Banner, Prog
|
|
|
119
119
|
- Select > SelectTrigger(size) > SelectValue; SelectContent > SelectItem(value)
|
|
120
120
|
- Toggle: variant(default|outline) size(sm|md|lg)
|
|
121
121
|
- ToggleGroup > ToggleGroupItem (variant/size propagate from root)
|
|
122
|
-
- SegmentedControl > SegmentedControlItem: variant(filled|tonal) size(sm|md|lg)
|
|
122
|
+
- SegmentedControl > SegmentedControlItem: variant(filled|tonal) size(sm|md|lg). Types: SegmentedControlOption = { id, text, icon? }, SegmentedControlSize = 'sm' | 'md' | 'lg', SegmentedControlVariant = 'filled' | 'tonal'
|
|
123
123
|
- Slider: standard Radix slider
|
|
124
124
|
|
|
125
125
|
### Feedback & Notifications
|
|
@@ -137,10 +137,10 @@ NOTIFICATION SELECTION GUIDE:
|
|
|
137
137
|
### Data Display
|
|
138
138
|
- Badge: variant(subtle|solid|outline) color(default|info|success|error|warning|brand|accent + 7 category colors) size(xs|sm|md|lg) + onDismiss
|
|
139
139
|
- Chip: variant(subtle|outline) color(default|primary|success|error|warning|info + 7 category) size(sm|md|lg) label(string, REQUIRED) + onDismiss, onClick
|
|
140
|
-
- Avatar: size(xs|sm|md|lg|xl) shape(circle|square|rounded) status(
|
|
140
|
+
- Avatar: size(xs|sm|md|lg|xl) shape(circle|square|rounded) status(AvatarStatus) > AvatarImage + AvatarFallback. Type: AvatarStatus = 'online' | 'offline' | 'busy' | 'away'
|
|
141
141
|
- Card: variant(default|elevated|outline|flat) interactive(boolean) > CardHeader > CardTitle, CardDescription; CardContent; CardFooter
|
|
142
142
|
- Table > TableHeader > TableRow > TableHead; TableBody > TableRow > TableCell; TableFooter; TableCaption
|
|
143
|
-
- Text: 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|caption|overline
|
|
143
|
+
- Text: variant(TextVariant) as(element). Type: 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'
|
|
144
144
|
- Code: variant(inline|block)
|
|
145
145
|
- Skeleton: variant(rectangle|circle|text) animation(pulse|shimmer|none)
|
|
146
146
|
- StatCard: title, value, description, trend, icon
|
|
@@ -171,7 +171,7 @@ NOTIFICATION SELECTION GUIDE:
|
|
|
171
171
|
- Sidebar: complex — see llms-full.txt for complete tree
|
|
172
172
|
|
|
173
173
|
### Form Pattern
|
|
174
|
-
- FormField: state(
|
|
174
|
+
- FormField: state(FormHelperState) > Label + Input + FormHelperText. Type: FormHelperState = 'helper' | 'error' | 'warning' | 'success'
|
|
175
175
|
- useFormField() hook returns { state, helperTextId, required } from FormField context
|
|
176
176
|
- Wire accessibility: const { state, helperTextId } = useFormField(); then aria-describedby={helperTextId}, aria-invalid={state === 'error'}
|
|
177
177
|
- Input/Textarea auto-wire from FormField context (no manual hookup needed). Explicit props override.
|
|
@@ -183,7 +183,7 @@ NOTIFICATION SELECTION GUIDE:
|
|
|
183
183
|
- StatusBadge: DISCRIMINATED UNION — pass status OR color, not both. status(active|pending|approved|rejected|completed|blocked|cancelled|draft) color(success|warning|error|info|neutral) size(sm|md)
|
|
184
184
|
- ContentCard: variant(default|outline|ghost) padding(default|compact|spacious|none)
|
|
185
185
|
- EmptyState: icon(ReactNode or ComponentType), title(required), description, action(ReactNode), compact
|
|
186
|
-
- PriorityIndicator: priority(LOW|MEDIUM|HIGH|URGENT
|
|
186
|
+
- PriorityIndicator: priority(Priority) display(compact|full). Type: Priority = 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT' | 'low' | 'medium' | 'high' | 'urgent'
|
|
187
187
|
- SimpleTooltip: wraps Tooltip compound into single component
|
|
188
188
|
- DatePicker, DateRangePicker, DateTimePicker
|
|
189
189
|
- TimePicker: standalone time selector — value(Date|null), onChange, format('12h'|'24h'), minuteStep, showSeconds, disabled
|
|
@@ -195,14 +195,15 @@ NOTIFICATION SELECTION GUIDE:
|
|
|
195
195
|
- UploadProgress: file upload tracker — files(UploadFile[]), onRemove, onRetry, onDismissAll, variant(default|compact), showSize. Status: pending|uploading|processing|complete|error. Also exports formatFileSize()
|
|
196
196
|
- RichTextEditor: Tiptap editor — bold/italic/underline/strike/highlight, headings, blockquote, lists (bullet/ordered/task), code, links, images (paste/drop/upload), file attachments, @mentions, emoji picker + :shortcode:, text alignment, HR. Props: onImageUpload?, onFileUpload?, mentions?, onMentionSearch?, onMentionSelect?
|
|
197
197
|
- RichTextViewer: read-only renderer for RichTextEditor HTML content (renders all above content types)
|
|
198
|
+
- ActivityFeed: items(ActivityItem[]), onLoadMore, loading, hasMore, emptyState, compact, maxInitialItems. Type: ActivityItem = { id, actor?, action, timestamp, icon?, color?, detail? }
|
|
198
199
|
- CommandPalette, MemberPicker
|
|
199
200
|
- ErrorDisplay, GlobalLoading
|
|
200
201
|
- Loading skeletons: CardSkeleton, TableSkeleton, BoardSkeleton, ListSkeleton
|
|
201
202
|
- Page skeletons: DashboardSkeleton, ProjectListSkeleton, TaskDetailSkeleton (no props, server-safe)
|
|
202
203
|
|
|
203
204
|
### Shell Components (app-level layout)
|
|
204
|
-
- TopBar: pageTitle, user, onNavigate, onLogout, notificationSlot, mobileLogo, userMenuItems?(UserMenuItem[]
|
|
205
|
-
- AppSidebar: navigation tree with NavItem[], NavGroup[]
|
|
205
|
+
- TopBar: pageTitle, user, onNavigate, onLogout, notificationSlot, mobileLogo, userMenuItems?(UserMenuItem[]). Types: TopBarUser = { name, email?, image? }, UserMenuItem = { label, icon?, href?, onClick?, separator?, color?, badge?, disabled? }
|
|
206
|
+
- AppSidebar: navigation tree with NavItem[], NavGroup[]. Types: NavItem = { title, href, icon, exact?, badge?, children?, defaultOpen? }, NavSubItem = { title, href, icon?, exact? }, NavGroup = { label, items, action? }, SidebarUser = { name, email?, image?, designation?, role? }
|
|
206
207
|
|
|
207
208
|
### AppSidebar (v0.10.0 additions)
|
|
208
209
|
- NavItem.children?: NavSubItem[] — collapsible sub-list with chevron toggle
|
|
@@ -214,11 +215,15 @@ NOTIFICATION SELECTION GUIDE:
|
|
|
214
215
|
- preFooterSlot?: ReactNode — content between navigation and footer
|
|
215
216
|
- renderItem?: (item, defaultRender) => ReactNode | null — custom item rendering
|
|
216
217
|
|
|
217
|
-
- BottomNavbar: mobile navigation, user is optional
|
|
218
|
-
- NotificationCenter: notifications[], onMarkRead, onMarkAllRead, onNavigate, getNotificationRoute
|
|
219
|
-
-
|
|
218
|
+
- BottomNavbar: mobile navigation, user is optional. Types: BottomNavItem = { title, href, icon, exact?, badge? }, BottomNavbarUser = { name, role? }
|
|
219
|
+
- NotificationCenter: notifications[], onMarkRead, onMarkAllRead, onNavigate, getNotificationRoute?, footerSlot?, emptyState?, headerActions?, popoverClassName?, onDismiss?(id). Types: Notification = { id, title, body?, tier, isRead, createdAt, entityType?, entityId?, projectId?, project?, actions? }, NotificationAction = { label, variant?, onClick }
|
|
220
|
+
- NotificationPreferences: preferences[], projects[], onSave, onToggleMute, onUpdateTier, onDelete. Types: NotificationPreference = { id, userId?, projectId, channel, minTier, muted }, NotificationProject = { id, title }
|
|
221
|
+
- AppCommandPalette: user, isAdmin, onNavigate, onSearch, searchResults, isSearching, onSearchResultSelect. Types: SearchResult = { id, title, snippet?, entityType, projectId?, metadata? }, AppCommandPaletteUser = { name, role? }
|
|
220
222
|
- LinkProvider: wraps app with router-agnostic Link component — component(ForwardRefComponent), children. useLink() hook returns the Link component.
|
|
221
223
|
|
|
224
|
+
### Motion Tokens
|
|
225
|
+
- motion(category, mode) => CSS cubic-bezier string. duration(token) => CSS duration string. easings: Record<MotionMode, Record<MotionCategory, string>>. durations: Record<DurationToken, string> = { instant: '0ms', fast-01: '70ms', fast-02: '110ms', moderate-01: '150ms', moderate-02: '240ms', slow-01: '400ms', slow-02: '700ms' }
|
|
226
|
+
|
|
222
227
|
### Hooks
|
|
223
228
|
- useToast(): returns { toast, toasts, dismiss } — toast({ title, description, color }). Also: import { toast } from '@devalok/shilp-sutra/hooks/use-toast' for imperative usage without hook
|
|
224
229
|
- useColorMode(): returns { colorMode, setColorMode, toggleColorMode }
|