@devalok/shilp-sutra 0.18.2 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shell/bottom-navbar.js +4 -4
- package/dist/shell/sidebar.js +2 -2
- package/dist/shell/top-bar.d.ts +45 -20
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +222 -159
- package/dist/tokens/semantic.css +5 -5
- package/dist/ui/alert-dialog.js +28 -28
- package/dist/ui/chip.d.ts.map +1 -1
- package/dist/ui/chip.js +13 -12
- package/dist/ui/dialog.js +4 -4
- package/dist/ui/sidebar.js +11 -11
- package/docs/components/_header.md +7 -5
- package/docs/components/composed/activity-feed.md +4 -4
- package/docs/components/composed/command-palette.md +2 -2
- package/docs/components/composed/confirm-dialog.md +1 -1
- package/docs/components/composed/date-picker.md +13 -13
- package/docs/components/composed/schedule-view.md +2 -2
- package/docs/components/composed/status-badge.md +1 -0
- package/docs/components/shell/bottom-navbar.md +4 -0
- package/docs/components/shell/notification-center.md +15 -15
- package/docs/components/shell/sidebar.md +5 -1
- package/docs/components/shell/top-bar.md +101 -24
- package/docs/components/ui/alert-dialog.md +3 -0
- package/docs/components/ui/autocomplete.md +1 -1
- package/docs/components/ui/banner.md +1 -0
- package/docs/components/ui/chip.md +4 -0
- package/docs/components/ui/combobox.md +2 -2
- package/docs/components/ui/dialog.md +3 -0
- package/docs/components/ui/input.md +1 -1
- package/docs/components/ui/spinner.md +1 -0
- package/docs/components/ui/tabs.md +1 -1
- package/llms-full.txt +173 -73
- package/llms.txt +1 -1
- package/package.json +699 -699
|
@@ -4,16 +4,54 @@
|
|
|
4
4
|
- Server-safe: No
|
|
5
5
|
- Category: shell
|
|
6
6
|
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Composition-based application top bar. Uses dot-notation subcomponents for flexible layout.
|
|
10
|
+
|
|
11
|
+
## Subcomponents
|
|
12
|
+
|
|
13
|
+
| Component | Purpose |
|
|
14
|
+
|-----------|---------|
|
|
15
|
+
| `TopBar` | Root — bg-surface-2, border-b, sticky. Auto-switches to grid when Center is present. |
|
|
16
|
+
| `TopBar.Left` | Left zone — sidebar trigger, title, breadcrumbs |
|
|
17
|
+
| `TopBar.Center` | Optional center zone — search bar, tabs. Triggers 3-column grid layout. |
|
|
18
|
+
| `TopBar.Right` | Right zone — action buttons, user menu. Gets ml-auto in flex mode. |
|
|
19
|
+
| `TopBar.Section` | Groups items with configurable gap |
|
|
20
|
+
| `TopBar.IconButton` | Circular icon button with tooltip (bg-surface-3, hover:bg-surface-4) |
|
|
21
|
+
| `TopBar.Title` | Page title heading, hidden on mobile |
|
|
22
|
+
| `TopBar.UserMenu` | Avatar dropdown with color mode toggle, profile, logout |
|
|
23
|
+
|
|
7
24
|
## Props
|
|
8
|
-
|
|
9
|
-
|
|
25
|
+
|
|
26
|
+
### TopBar (root)
|
|
27
|
+
children: ReactNode
|
|
28
|
+
className?: string
|
|
29
|
+
|
|
30
|
+
### TopBar.Left / TopBar.Center / TopBar.Right
|
|
31
|
+
children: ReactNode
|
|
32
|
+
className?: string
|
|
33
|
+
|
|
34
|
+
### TopBar.Section
|
|
35
|
+
gap?: "tight" | "default" | "loose" (default: "default")
|
|
36
|
+
children: ReactNode
|
|
37
|
+
className?: string
|
|
38
|
+
|
|
39
|
+
Gap values: tight = gap-ds-02, default = gap-ds-04, loose = gap-ds-06
|
|
40
|
+
|
|
41
|
+
### TopBar.IconButton
|
|
42
|
+
icon: ReactNode
|
|
43
|
+
tooltip: string
|
|
44
|
+
...ButtonHTMLAttributes
|
|
45
|
+
|
|
46
|
+
### TopBar.Title
|
|
47
|
+
children: ReactNode
|
|
48
|
+
className?: string
|
|
49
|
+
|
|
50
|
+
### TopBar.UserMenu
|
|
51
|
+
user: TopBarUser — { name, email?, image? }
|
|
10
52
|
onNavigate?: (path: string) => void
|
|
11
53
|
onLogout?: () => void
|
|
12
|
-
|
|
13
|
-
onAiChatClick?: () => void
|
|
14
|
-
mobileLogo?: ReactNode
|
|
15
|
-
notificationSlot?: ReactNode (render NotificationCenter here)
|
|
16
|
-
userMenuItems?: UserMenuItem[] — custom items between Profile and Dark/Light Mode toggle
|
|
54
|
+
userMenuItems?: UserMenuItem[]
|
|
17
55
|
className?: string
|
|
18
56
|
|
|
19
57
|
TopBarUser: { name: string, email?: string, image?: string | null }
|
|
@@ -27,30 +65,69 @@ UserMenuItem fields:
|
|
|
27
65
|
- badge — string for count badge, true for dot indicator
|
|
28
66
|
- disabled — greys out the item
|
|
29
67
|
|
|
30
|
-
## Defaults
|
|
31
|
-
None
|
|
32
|
-
|
|
33
68
|
## Example
|
|
69
|
+
|
|
70
|
+
### Two-zone (standard)
|
|
34
71
|
```jsx
|
|
35
|
-
<TopBar
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
72
|
+
<TopBar>
|
|
73
|
+
<TopBar.Left>
|
|
74
|
+
<SidebarTrigger />
|
|
75
|
+
<TopBar.Title>Dashboard</TopBar.Title>
|
|
76
|
+
</TopBar.Left>
|
|
77
|
+
<TopBar.Right>
|
|
78
|
+
<TopBar.Section gap="tight">
|
|
79
|
+
<TopBar.IconButton icon={<IconSearch />} tooltip="Search (Ctrl+K)" onClick={openSearch} />
|
|
80
|
+
<NotificationCenter notifications={notifications} />
|
|
81
|
+
<TopBar.IconButton icon={<IconSparkles />} tooltip="AI Chat" onClick={openAI} />
|
|
82
|
+
</TopBar.Section>
|
|
83
|
+
<TopBar.UserMenu
|
|
84
|
+
user={{ name: 'John', email: 'john@example.com' }}
|
|
85
|
+
onNavigate={(p) => router.push(p)}
|
|
86
|
+
onLogout={handleLogout}
|
|
87
|
+
userMenuItems={[
|
|
88
|
+
{ label: 'Changelog', icon: <IconNews />, href: '/changelog', badge: '3' },
|
|
89
|
+
]}
|
|
90
|
+
/>
|
|
91
|
+
</TopBar.Right>
|
|
92
|
+
</TopBar>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Three-zone (centered search bar)
|
|
96
|
+
```jsx
|
|
97
|
+
<TopBar>
|
|
98
|
+
<TopBar.Left>
|
|
99
|
+
<SidebarTrigger />
|
|
100
|
+
<TopBar.Title>Dashboard</TopBar.Title>
|
|
101
|
+
</TopBar.Left>
|
|
102
|
+
<TopBar.Center>
|
|
103
|
+
<SearchBarTrigger />
|
|
104
|
+
</TopBar.Center>
|
|
105
|
+
<TopBar.Right>
|
|
106
|
+
<TopBar.Section gap="tight">
|
|
107
|
+
<TopBar.IconButton icon={<IconBell />} tooltip="Notifications" onClick={fn} />
|
|
108
|
+
</TopBar.Section>
|
|
109
|
+
<TopBar.UserMenu user={user} onLogout={logout} />
|
|
110
|
+
</TopBar.Right>
|
|
111
|
+
</TopBar>
|
|
46
112
|
```
|
|
47
113
|
|
|
48
114
|
## Gotchas
|
|
49
|
-
- `
|
|
50
|
-
- `
|
|
51
|
-
-
|
|
115
|
+
- Without `TopBar.Center`, layout is flex (two-zone). With it, layout switches to CSS grid `1fr auto 1fr` for true centering.
|
|
116
|
+
- `TopBar.IconButton` renders any number of action buttons — no artificial limit. Use responsive hiding (`className="hidden md:flex"`) for mobile.
|
|
117
|
+
- `TopBar.UserMenu` includes Profile link, color mode toggle, and logout automatically. `userMenuItems` are inserted between Profile and the toggle.
|
|
118
|
+
- Requires SidebarProvider wrapper for SidebarTrigger to work.
|
|
52
119
|
|
|
53
120
|
## Changes
|
|
121
|
+
### v0.19.0
|
|
122
|
+
- **BREAKING** Rewritten as composition API. Old props-based API removed (`pageTitle`, `onSearchClick`, `onAiChatClick`, `notificationSlot`, `mobileLogo` props).
|
|
123
|
+
- **Added** `TopBar.Left`, `TopBar.Center`, `TopBar.Right` zone components
|
|
124
|
+
- **Added** `TopBar.Section` with `gap` prop (`tight` | `default` | `loose`)
|
|
125
|
+
- **Added** `TopBar.IconButton` — reusable circular icon button with tooltip
|
|
126
|
+
- **Added** `TopBar.Title` — responsive page title (hidden on mobile)
|
|
127
|
+
- **Added** `TopBar.UserMenu` — extracted user dropdown as standalone subcomponent
|
|
128
|
+
- **Added** Auto grid/flex layout detection based on Center zone presence
|
|
129
|
+
- **Changed** Background elevated from `bg-surface-1` to `bg-surface-2`
|
|
130
|
+
|
|
54
131
|
### v0.7.0
|
|
55
132
|
- **Added** `userMenuItems` prop for custom dropdown items
|
|
56
133
|
|
|
@@ -46,6 +46,9 @@
|
|
|
46
46
|
- AlertDialogAction does NOT have color="error" styling — add it yourself via className or wrap a Button
|
|
47
47
|
|
|
48
48
|
## Changes
|
|
49
|
+
### v0.19.1
|
|
50
|
+
- **Fixed** AlertDialog not centered after Framer Motion animation completes — same `transform: none` fix as Dialog.
|
|
51
|
+
|
|
49
52
|
### v0.18.0
|
|
50
53
|
- **Changed** Overlay animations migrated to Framer Motion (physics-based springs)
|
|
51
54
|
- **Added** `AlertDialogContentProps`, `AlertDialogActionProps`, `AlertDialogCancelProps` type exports
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
## Props
|
|
8
8
|
options: AutocompleteOption[] (REQUIRED) — { value: string, label: string }
|
|
9
9
|
value: AutocompleteOption | null
|
|
10
|
-
onValueChange
|
|
10
|
+
onValueChange?: (option: AutocompleteOption) => void
|
|
11
11
|
placeholder: string
|
|
12
12
|
emptyText: string (default: "No options")
|
|
13
13
|
disabled: boolean
|
|
@@ -30,8 +30,12 @@
|
|
|
30
30
|
- MUST use label prop — children are NOT rendered
|
|
31
31
|
- `<Chip>text</Chip>` is WRONG — use `<Chip label="text" />`
|
|
32
32
|
- Wrap dynamic chip lists in `<ChipGroup>` for exit animations
|
|
33
|
+
- `color="primary"` will be renamed to `color="brand"` in v1.0 — use `color="primary"` for now
|
|
33
34
|
|
|
34
35
|
## Changes
|
|
36
|
+
### v0.19.1
|
|
37
|
+
- **Fixed** `active:scale-95` tap feedback broken by Framer Motion transform override — replaced with `whileTap={{ scale: 0.95 }}`
|
|
38
|
+
|
|
35
39
|
### v0.4.2
|
|
36
40
|
- **Changed** (BREAKING) `variant="filled"` renamed to `"subtle"`, `variant="outlined"` renamed to `"outline"`, `onDelete` renamed to `onDismiss`
|
|
37
41
|
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
## Props
|
|
8
8
|
options: ComboboxOption[] (REQUIRED) — { value: string, label: string, description?: string, icon?: ReactNode, disabled?: boolean }
|
|
9
9
|
DISCRIMINATED UNION — type depends on `multiple` flag:
|
|
10
|
-
Single (default): multiple?: false, value
|
|
11
|
-
Multiple: multiple: true, value
|
|
10
|
+
Single (default): multiple?: false, value?: string, onValueChange: (value: string) => void
|
|
11
|
+
Multiple: multiple: true, value?: string[], onValueChange: (value: string[]) => void
|
|
12
12
|
placeholder: string (default: "Select...")
|
|
13
13
|
searchPlaceholder: string (default: "Search...")
|
|
14
14
|
emptyMessage: string (default: "No results found")
|
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
- DialogTitle is required for accessibility — screen readers announce it when the dialog opens
|
|
40
40
|
|
|
41
41
|
## Changes
|
|
42
|
+
### v0.19.1
|
|
43
|
+
- **Fixed** Dialog not centered after Framer Motion animation completes — `transform: none` inline style overrode Tailwind `translate-x/y` classes. Centering now handled via Framer Motion `x`/`y` properties.
|
|
44
|
+
|
|
42
45
|
### v0.18.0
|
|
43
46
|
- **Changed** Overlay animations migrated to Framer Motion (physics-based springs)
|
|
44
47
|
- **Added** `DialogContentProps`, `DialogTitleProps` type exports
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
- HTML native "size" attribute is excluded — use CSS width instead
|
|
27
27
|
- state="error" sets aria-invalid automatically
|
|
28
28
|
- Inside FormField: auto-inherits state, aria-describedby, aria-required from context (explicit props override)
|
|
29
|
-
- Resting border is border-subtle (soft); focus ring is ring-1
|
|
29
|
+
- Resting border is border-subtle (soft); focus ring is `ring-1 ring-accent-7` (v0.12.0)
|
|
30
30
|
- All sizes (sm, md, lg) use text-ds-md (14px) font — size only affects height and padding (v0.15.0)
|
|
31
31
|
|
|
32
32
|
## Changes
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
## Gotchas
|
|
45
45
|
- variant goes on TabsList, NOT on individual TabsTrigger (propagates via context)
|
|
46
|
-
-
|
|
46
|
+
- Normally omit `variant` on TabsTrigger — it inherits from TabsList via context. You CAN set it per-trigger to override.
|
|
47
47
|
|
|
48
48
|
## Changes
|
|
49
49
|
### v0.18.0
|