jsxRuntime jsx jsxFrag import * as React from "react" ; import * as p from "@plasmicapp/react-web" ; import { hasVariant , classNames , wrapWithClassName , createPlasmicElementProxy , makeFragment , MultiChoiceArg , SingleBooleanChoiceArg , SingleChoiceArg , pick , omit , useTrigger , StrictProps , deriveRenderOpts , ensureGlobalVariants , } from "@plasmicapp/react-web" ; import Menu from "../../menu/Menu" ; import Menu__Item from "../../menu/Menu__Item" ; import "@plasmicapp/react-web/lib/plasmic.css" ; import * as defaultcss from "../plasmic__default_style.module.css" ; import * as projectcss from "./plasmic_plume_main.module.css" ; import * as sty from "./PlasmicMenuButton.module.css" ; import ChevronDownIcon from "./icons/PlasmicIcon__ChevronDown" ; import ChevronUpIcon from "./icons/PlasmicIcon__ChevronUp" ; export type PlasmicMenuButton__VariantMembers = { isOpen : "isOpen" ; isDisabled : "isDisabled" ; } ; export type PlasmicMenuButton__VariantsArgs = { isOpen ? : SingleBooleanChoiceArg < "isOpen" > ; isDisabled ? : SingleBooleanChoiceArg < "isDisabled" > ; } ; type VariantPropType = keyof PlasmicMenuButton__VariantsArgs ; export const PlasmicMenuButton__VariantProps = new Array < VariantPropType > ( "isOpen" , "isDisabled" ) ; export type PlasmicMenuButton__ArgsType = { children ? : React . ReactNode ; menu ? : React . ReactNode ; } ; type ArgPropType = keyof PlasmicMenuButton__ArgsType ; export const PlasmicMenuButton__ArgProps = new Array < ArgPropType > ( "children" , "menu" ) ; export type PlasmicMenuButton__OverridesType = { root ? : p . Flex < "div" > ; trigger ? : p . Flex < "button" > ; contentContainer ? : p . Flex < "div" > ; svg ? : p . Flex < "svg" > ; } ; export interface DefaultMenuButtonProps extends p . BaseMenuButtonProps { children ? : React . ReactNode ; } function PlasmicMenuButton__RenderFunc ( props ) { const { variants , args , overrides , forNode } = props ; const [ isRootFocusVisibleWithin , triggerRootFocusVisibleWithinProps , ] = useTrigger ( "useFocusVisibleWithin" , { isTextInput : false , } ) ; const triggers = { focusVisibleWithin_root : isRootFocusVisibleWithin , } ; return ( < div data - plasmic - name = { "root" } data - plasmic - override = { overrides . root } data - plasmic - root = { true } data - plasmic - for - node = { forNode } className = { classNames ( defaultcss . all , projectcss . root_reset , sty . root ) } data - plasmic - trigger - props = { [ triggerRootFocusVisibleWithinProps ] } > < p . Stack as = { "button" } data - plasmic - name = { "trigger" } data - plasmic - override = { overrides . trigger } hasGap = { true } className = { classNames ( defaultcss . button , sty . trigger , { [ sty . trigger_____focusVisibleWithin ] : triggers . focusVisibleWithin_root , [ sty . trigger__isDisabled ] : hasVariant ( variants , "isDisabled" , "isDisabled" ) , [ sty . trigger__isOpen ] : hasVariant ( variants , "isOpen" , "isOpen" ) , } ) } disabled = { hasVariant ( variants , "isDisabled" , "isDisabled" ) ? true : undefined } > < div data - plasmic - name = { "contentContainer" } data - plasmic - override = { overrides . contentContainer } className = { classNames ( defaultcss . all , sty . contentContainer ) } > { p . renderPlasmicSlot ( { defaultContents : "Menu" , value : args . children , className : classNames ( sty . slotChildren ) , } ) } < /div> < p . PlasmicIcon data - plasmic - name = { "svg" } data - plasmic - override = { overrides . svg } PlasmicIconType = { hasVariant ( variants , "isOpen" , "isOpen" ) ? ChevronUpIcon : ChevronDownIcon } className = { classNames ( defaultcss . all , sty . svg , { [ sty . svg__isOpen ] : hasVariant ( variants , "isOpen" , "isOpen" ) , } ) } role = { "img" } / > < /p.Stack> { ( hasVariant ( variants , "isOpen" , "isOpen" ) ? true : false ) ? p . renderPlasmicSlot ( { defaultContents : ( < Menu className = { classNames ( "__wab_instance" , sty . menu___61ZXh ) } />), value : args . menu , } ) : null } < /div>) as React.ReactElement | null; } function useBehavior < P extends p . BaseMenuButtonProps > ( props , ref ) { return p . useMenuButton ( PlasmicMenuButton , props , { isOpenVariant : { group : "isOpen" , variant : "isOpen" } , isDisabledVariant : { group : "isDisabled" , variant : "isDisabled" } , menuSlot : "menu" , root : "root" , trigger : "trigger" , } , ref ) ; } const PlasmicDescendants = { root : [ "root" , "trigger" , "contentContainer" , "svg" ] , trigger : [ "trigger" , "contentContainer" , "svg" ] , contentContainer : [ "contentContainer" ] , svg : [ "svg" ] , } as const ; type NodeNameType = keyof typeof PlasmicDescendants ; type DescendantsType < T extends NodeNameType > = typeof PlasmicDescendants [ T ] [ number ] ; type NodeDefaultElementType = { root : "div" ; trigger : "button" ; contentContainer : "div" ; svg : "svg" ; } ; type ReservedPropsType = "variants" | "args" | "overrides" ; type NodeOverridesType < T extends NodeNameType > = Pick < PlasmicMenuButton__OverridesType , DescendantsType < T > > ; type NodeComponentProps < T extends NodeNameType > = { variants ? : PlasmicMenuButton__VariantsArgs ; args ? : PlasmicMenuButton__ArgsType ; overrides ? : NodeOverridesType < T > ; } & Omit < PlasmicMenuButton__VariantsArgs , ReservedPropsType > & Omit < PlasmicMenuButton__ArgsType , ReservedPropsType > & Omit < NodeOverridesType < T > , ReservedPropsType | VariantPropType | ArgPropType > & Omit < Partial < React . ComponentProps < NodeDefaultElementType [ T ] > > , ReservedPropsType | VariantPropType | ArgPropType | DescendantsType < T > > ; function makeNodeComponent < NodeName extends NodeNameType > ( nodeName ) { type PropsType = NodeComponentProps < NodeName > & { key ? : React . Key ; } ; const func = function < T extends PropsType > ( props ) { const { variants , args , overrides } = deriveRenderOpts ( props , { name : nodeName , descendantNames : [ ... PlasmicDescendants [ nodeName ] ] , internalArgPropNames : PlasmicMenuButton__ArgProps , internalVariantPropNames : PlasmicMenuButton__VariantProps , } ) ; return PlasmicMenuButton__RenderFunc ( { variants , args , overrides , forNode : nodeName , } ) ; } ; if ( nodeName === "root" ) { func . displayName = "PlasmicMenuButton" ; } else { func . displayName = `PlasmicMenuButton.${ nodeName }` ; } return func ; } export const PlasmicMenuButton = Object . assign ( makeNodeComponent ( "root" ) , { trigger : makeNodeComponent ( "trigger" ) , contentContainer : makeNodeComponent ( "contentContainer" ) , svg : makeNodeComponent ( "svg" ) , internalVariantProps : PlasmicMenuButton__VariantProps , internalArgProps : PlasmicMenuButton__ArgProps , useBehavior , } ) ; export default PlasmicMenuButton ;