Commit 156101b 1 parent bb20d57 commit 156101b Copy full SHA for 156101b
File tree 4 files changed +18
-4
lines changed
4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @dust-tt/sparkle" ,
3
- "version" : " 0.2.311 " ,
3
+ "version" : " 0.2.312 " ,
4
4
"scripts" : {
5
5
"build" : " rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs" ,
6
6
"tailwind" : " tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css" ,
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
3
+ import { Tooltip } from "@sparkle/components/Tooltip" ;
3
4
import {
4
5
ArrowUpOnSquareIcon ,
5
6
ChevronLeftIcon ,
@@ -12,13 +13,15 @@ import { Button } from "./Button";
12
13
13
14
interface BarHeaderProps {
14
15
title : string ;
16
+ tooltip ?: string ;
15
17
leftActions ?: React . ReactNode ;
16
18
rightActions ?: React . ReactNode ;
17
19
className ?: string ;
18
20
}
19
21
20
22
export function BarHeader ( {
21
23
title,
24
+ tooltip,
22
25
leftActions,
23
26
rightActions,
24
27
className = "" ,
@@ -39,7 +42,17 @@ export function BarHeader({
39
42
) }
40
43
>
41
44
{ leftActions && < div className = { buttonBarClasses } > { leftActions } </ div > }
42
- < div className = { titleClasses } > { title } </ div >
45
+ < div className = { titleClasses } >
46
+ { tooltip ? (
47
+ < Tooltip
48
+ tooltipTriggerAsChild
49
+ trigger = { < span > { title } </ span > }
50
+ label = { tooltip }
51
+ > </ Tooltip >
52
+ ) : (
53
+ title
54
+ ) }
55
+ </ div >
43
56
{ rightActions && < div className = { buttonBarClasses } > { rightActions } </ div > }
44
57
</ div >
45
58
) ;
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ export const BasicBarHeaderConversation = () => (
146
146
< div className = "s-mt-16 s-h-full s-w-full" >
147
147
< BarHeader
148
148
title = "Knowledge Base"
149
+ tooltip = "This is a tooltip"
149
150
rightActions = { < BarHeader . ButtonBar variant = "conversation" /> }
150
151
/>
151
152
< div className = "s-flex s-flex-col s-gap-16 s-overflow-auto" >
You can’t perform that action at this time.
0 commit comments