1- import { Card } from "~/components/primitives/charts/Card" ;
2- import { useState , type ReactNode } from "react" ;
3- import { type OutputColumnMetadata } from "@internal/tsql" ;
4- import { z } from "zod" ;
5- import { assertNever } from "assert-never" ;
6- import { TSQLResultsTable } from "../code/TSQLResultsTable" ;
7- import { QueryResultsChart } from "../code/QueryResultsChart" ;
8- import { BigNumberCard } from "../primitives/charts/BigNumberCard" ;
9- import { Dialog , DialogContent , DialogFooter , DialogHeader } from "../primitives/Dialog" ;
10- import { Button } from "../primitives/Buttons" ;
111import {
12- ArrowsPointingOutIcon ,
132 DocumentDuplicateIcon ,
143 PencilIcon ,
154 PencilSquareIcon ,
165 TrashIcon ,
176} from "@heroicons/react/20/solid" ;
18- import { LoadingBarDivider } from "../primitives/LoadingBarDivider" ;
19- import { Callout } from "../primitives/Callout" ;
207import { ChartBarIcon } from "@heroicons/react/24/solid" ;
8+ import { type OutputColumnMetadata } from "@internal/tsql" ;
9+ import { DialogClose } from "@radix-ui/react-dialog" ;
10+ import { assertNever } from "assert-never" ;
11+ import { SimpleTooltip } from "~/components/primitives/Tooltip" ;
12+ import { cn } from "~/utils/cn" ;
13+ import { Maximize2 } from "lucide-react" ;
14+ import { useState , type ReactNode } from "react" ;
15+ import { z } from "zod" ;
16+ import { Card } from "~/components/primitives/charts/Card" ;
17+ import { QueryResultsChart } from "../code/QueryResultsChart" ;
18+ import { TSQLResultsTable } from "../code/TSQLResultsTable" ;
19+ import { Button } from "../primitives/Buttons" ;
20+ import { Callout } from "../primitives/Callout" ;
21+ import { BigNumberCard } from "../primitives/charts/BigNumberCard" ;
22+ import { Dialog , DialogContent , DialogFooter , DialogHeader } from "../primitives/Dialog" ;
23+ import { Input } from "../primitives/Input" ;
24+ import { InputGroup } from "../primitives/InputGroup" ;
25+ import { Label } from "../primitives/Label" ;
26+ import { LoadingBarDivider } from "../primitives/LoadingBarDivider" ;
2127import {
2228 Popover ,
2329 PopoverContent ,
2430 PopoverMenuItem ,
2531 PopoverVerticalEllipseTrigger ,
2632} from "../primitives/Popover" ;
27- import { Input } from "../primitives/Input" ;
28- import { InputGroup } from "../primitives/InputGroup" ;
29- import { Label } from "../primitives/Label" ;
30- import { DialogClose } from "@radix-ui/react-dialog" ;
33+ import { IconChartHistogram } from "@tabler/icons-react" ;
3134
3235const ChartType = z . union ( [ z . literal ( "bar" ) , z . literal ( "line" ) ] ) ;
3336export type ChartType = z . infer < typeof ChartType > ;
@@ -169,25 +172,38 @@ export function QueryWidget({
169172 const hasMenu = onEdit || onRename || onDelete || onDuplicate ;
170173
171174 return (
172- < div className = "h-full" >
175+ < div className = "group h-full" >
173176 < Card className = "h-full overflow-hidden px-0 pb-0" >
174177 < Card . Header draggable = { isDraggable } >
175178 < div className = "flex items-center gap-1.5" > { title } </ div >
176179 < Card . Accessory >
177- { accessory }
178- < Button
179- variant = "tertiary/small"
180- LeadingIcon = { ArrowsPointingOutIcon }
181- onClick = { ( ) => setIsFullscreen ( true ) }
180+ < SimpleTooltip
181+ button = {
182+ < Button
183+ variant = "minimal/small"
184+ LeadingIcon = { Maximize2 }
185+ leadingIconClassName = "text-text-bright"
186+ onClick = { ( ) => setIsFullscreen ( true ) }
187+ className = "!px-1 opacity-0 transition-opacity group-hover:opacity-100"
188+ />
189+ }
190+ content = "Maximize"
182191 />
192+ { accessory }
183193 { hasMenu && (
184194 < Popover open = { isMenuOpen } onOpenChange = { setIsMenuOpen } >
185- < PopoverVerticalEllipseTrigger isOpen = { isMenuOpen } />
195+ < PopoverVerticalEllipseTrigger
196+ isOpen = { isMenuOpen }
197+ className = { cn (
198+ "transition-opacity" ,
199+ isMenuOpen ? "opacity-100" : "opacity-0 group-hover:opacity-100"
200+ ) }
201+ />
186202 < PopoverContent align = "end" className = "p-0" >
187203 < div className = "flex flex-col gap-1 p-1" >
188204 { onEdit && (
189205 < PopoverMenuItem
190- icon = { PencilSquareIcon }
206+ icon = { IconChartHistogram }
191207 title = "Edit chart"
192208 onClick = { ( ) => {
193209 onEdit ( props . data ) ;
@@ -197,7 +213,7 @@ export function QueryWidget({
197213 ) }
198214 { onRename && (
199215 < PopoverMenuItem
200- icon = { PencilIcon }
216+ icon = { PencilSquareIcon }
201217 title = "Rename"
202218 onClick = { ( ) => {
203219 setRenameValue ( titleString ?? "" ) ;
0 commit comments