@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dilipod/ui",
3
- "version": "0.4.35",
3
+ "version": "0.4.36",
4
4
  "description": "Dilipod Design System - Shared UI components and styles",
5
5
  "author": "Dilipod <hello@dilipod.com>",
6
6
  "license": "MIT",
@@ -25,9 +25,10 @@ export interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
25
25
  }
26
26
  /** Optional help/support link */
27
27
  helpLink?: {
28
- href: string
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
- <a
200
- href={helpLink.href}
201
- 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"
202
- >
203
- {helpLink.icon && (
204
- <helpLink.icon className="h-4 w-4" />
205
- )}
206
- {helpLink.label}
207
- </a>
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
  )}