{"version":3,"sources":["../src/components/MessageBar/MessageBarActions/useMessageBarActions.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useMessageBarActions_unstable, useMessageBarActionsContextValue_unstable } from '@fluentui/react-message-bar';\n\nimport type {\n  MessageBarActionsProps,\n  MessageBarActionsState,\n  MessageBarActionsContextValues,\n} from './MessageBarActions.types';\nimport { stringifyDataAttribute } from '../../../utils';\n\n/**\n * Returns the state for a MessageBarActions component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderMessageBarActions`.\n */\nexport const useMessageBarActions = (\n  props: MessageBarActionsProps,\n  ref: React.Ref<HTMLDivElement>,\n): MessageBarActionsState => {\n  const state: MessageBarActionsState = useMessageBarActions_unstable(props, ref);\n\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-layout'] = state.layout;\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-has-actions'] = stringifyDataAttribute(state.hasActions);\n\n  return state;\n};\n\n/**\n * Returns the context values provided by MessageBarActions to its child buttons.\n */\nexport const useMessageBarActionsContextValues =\n  useMessageBarActionsContextValue_unstable as () => MessageBarActionsContextValues;\n"],"names":["useMessageBarActions","useMessageBarActionsContextValues","props","ref","state","useMessageBarActions_unstable","root","layout","stringifyDataAttribute","hasActions","useMessageBarActionsContextValue_unstable"],"mappings":"AAAA;;;;;;;;;;;;IAgBaA,oBAAoB;eAApBA;;IAiBAC,iCAAiC;eAAjCA;;;iCA9B4E;uBAOlD;AAMhC,MAAMD,uBAAuB,CAClCE,OACAC;IAEA,MAAMC,QAAgCC,IAAAA,8CAA6B,EAACH,OAAOC;IAE3E,oDAAoD;IACpDC,MAAME,IAAI,CAAC,cAAc,GAAGF,MAAMG,MAAM;IACxC,oDAAoD;IACpDH,MAAME,IAAI,CAAC,mBAAmB,GAAGE,IAAAA,6BAAsB,EAACJ,MAAMK,UAAU;IAExE,OAAOL;AACT;AAKO,MAAMH,oCACXS,0DAAyC"}