@@ -29,7 +29,7 @@ import { createPortal } from "react-dom";
2929
3030import { Button } from "../../button" ;
3131import { Dropdown , DropdownMenuContent , DropdownMenuItem , DropdownMenuTrigger } from "../../dropdown" ;
32- import { ChevronDownIcon } from "@coss/ui/icons" ;
32+ import { ChevronDownIcon , ChevronUpIcon } from "@coss/ui/icons" ;
3333import type { TextEditorProps } from "../types" ;
3434import { AddVariablesDropdown } from "./AddVariablesDropdown" ;
3535
@@ -247,7 +247,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
247247 const [ isLink , setIsLink ] = useState ( false ) ;
248248 const [ isBold , setIsBold ] = useState ( false ) ;
249249 const [ isItalic , setIsItalic ] = useState ( false ) ;
250-
250+ const [ isOpen , setIsOpen ] = useState ( false ) ;
251251 const formatParagraph = ( ) => {
252252 if ( blockType !== "paragraph" ) {
253253 editor . update ( ( ) => {
@@ -459,14 +459,16 @@ export default function ToolbarPlugin(props: TextEditorProps) {
459459 < >
460460 { ! props . excludedToolbarItems ?. includes ( "blockType" ) && (
461461 < >
462- < Dropdown >
462+ < Dropdown onOpenChange = { setIsOpen } open = { isOpen } >
463463 < DropdownMenuTrigger className = "text-subtle" >
464464 < >
465465 < span className = { `icon${ blockType } ` } />
466466 < span className = "text text-default hidden sm:flex" >
467467 { blockTypeToBlockName [ blockType as keyof BlockType ] }
468468 </ span >
469- < ChevronDownIcon className = "text-default ml-2 h-4 w-4" />
469+ {
470+ isOpen ? ( < ChevronUpIcon className = "text-default ml-2 h-4 w-4" /> ) : ( < ChevronDownIcon className = "text-default ml-2 h-4 w-4" /> )
471+ }
470472 </ >
471473 </ DropdownMenuTrigger >
472474 < DropdownMenuContent align = "start" className = "flex flex-col gap-1" >
0 commit comments