@dilipod/ui 0.4.35 → 0.4.36
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/components/sidebar.d.ts +2 -1
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/sidebar.tsx +24 -10
package/package.json
CHANGED
|
@@ -25,9 +25,10 @@ export interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
25
25
|
}
|
|
26
26
|
/** Optional help/support link */
|
|
27
27
|
helpLink?: {
|
|
28
|
-
href
|
|
28
|
+
href?: string
|
|
29
29
|
label?: string
|
|
30
30
|
icon?: React.ComponentType<React.SVGProps<SVGSVGElement> & { weight?: 'fill' | 'regular' }>
|
|
31
|
+
onClick?: () => void
|
|
31
32
|
}
|
|
32
33
|
/** Optional assistant button configuration */
|
|
33
34
|
assistantButton?: {
|
|
@@ -196,15 +197,28 @@ const Sidebar = React.forwardRef<HTMLElement, SidebarProps>(
|
|
|
196
197
|
</button>
|
|
197
198
|
)}
|
|
198
199
|
{helpLink && (
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
200
|
+
helpLink.onClick ? (
|
|
201
|
+
<button
|
|
202
|
+
type="button"
|
|
203
|
+
onClick={helpLink.onClick}
|
|
204
|
+
className="flex w-full items-center gap-3 rounded-sm px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors"
|
|
205
|
+
>
|
|
206
|
+
{helpLink.icon && (
|
|
207
|
+
<helpLink.icon className="h-4 w-4" />
|
|
208
|
+
)}
|
|
209
|
+
{helpLink.label}
|
|
210
|
+
</button>
|
|
211
|
+
) : (
|
|
212
|
+
<a
|
|
213
|
+
href={helpLink.href}
|
|
214
|
+
className="flex items-center gap-3 rounded-sm px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors"
|
|
215
|
+
>
|
|
216
|
+
{helpLink.icon && (
|
|
217
|
+
<helpLink.icon className="h-4 w-4" />
|
|
218
|
+
)}
|
|
219
|
+
{helpLink.label}
|
|
220
|
+
</a>
|
|
221
|
+
)
|
|
208
222
|
)}
|
|
209
223
|
</div>
|
|
210
224
|
)}
|