{"version":3,"sources":["../src/components/Button/CompoundButtonShim.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport type { IButtonProps } from '@fluentui/react';\n\nimport { CompoundButton } from '@fluentui/react-components';\nimport type { CompoundButtonProps } from '@fluentui/react-components';\nimport type { RefAttributes } from '@fluentui/react-utilities';\n\nimport { shimButtonProps } from './shimButtonProps';\n\n/**\n * Shims v8 CompoundButton to render a v9 CompoundButton\n */\nexport const CompoundButtonShim: React.ForwardRefExoticComponent<\n  IButtonProps &\n    // eslint-disable-next-line @typescript-eslint/no-restricted-types -- this is expected in order to be compatible with v8, as every v8 interface contains `React.RefAttributes` to accept ref as string\n    React.RefAttributes<HTMLButtonElement>\n> = React.forwardRef((props, _ref) => {\n  const variantProps = {\n    ...props,\n    variantClassName: props.primary ? 'ms-Button--compoundPrimary' : 'ms-Button--compound',\n  };\n\n  const shimProps: CompoundButtonProps = {\n    ...shimButtonProps(variantProps),\n    secondaryContent: props.secondaryText || props.onRenderDescription?.(props),\n  };\n\n  return <CompoundButton {...(props as RefAttributes<HTMLButtonElement>)} {...shimProps} />;\n});\n"],"names":["React","CompoundButton","shimButtonProps","CompoundButtonShim","forwardRef","props","_ref","variantProps","variantClassName","primary","shimProps","secondaryContent","secondaryText","onRenderDescription"],"mappings":"AAAA;;;;;+BAeaG;;;;;;;iEAbU,QAAQ;iCAIA,6BAA6B;iCAI5B,uBAAoB;AAK7C,2BAAMA,WAAAA,GAITH,OAAMI,UAAU,CAAC,CAACC,OAAOC;QAQgBD;IAP3C,MAAME,eAAe;QACnB,GAAGF,KAAK;QACRG,kBAAkBH,MAAMI,OAAO,GAAG,+BAA+B;IACnE;IAEA,MAAMC,YAAiC;QACrC,OAAGR,gCAAAA,EAAgBK,aAAa;QAChCI,kBAAkBN,MAAMO,aAAa,IAAA,CAAA,CAAIP,6BAAAA,MAAMQ,mBAAAA,AAAmB,MAAA,QAAzBR,+BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,2BAAAA,IAAAA,CAAAA,OAA4BA,MAAAA;IACvE;IAEA,OAAA,WAAA,GAAO,OAAA,aAAA,CAACJ,+BAAAA,EAAAA;QAAgB,GAAII,KAAK;QAAwC,GAAGK,SAAS;;AACvF,GAAG"}