{"version":3,"sources":["../src/components/MessageBar/MessageBarActions/useMessageBarActions.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useMessageBarActions_unstable } from '@fluentui/react-message-bar';\n\nimport type { MessageBarActionsProps, MessageBarActionsState } from './MessageBarActions.types';\nimport { toDataAttributeValue } 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'] = toDataAttributeValue(state.hasActions);\n\n  return state;\n};\n\n/**\n * Returns the context values provided by MessageBarActions to its child buttons.\n */\nexport { useMessageBarActionsContextValue_unstable as useMessageBarActionsContextValues } from '@fluentui/react-message-bar';\n"],"names":["useMessageBarActions","useMessageBarActionsContextValues","useMessageBarActionsContextValue_unstable","props","ref","state","useMessageBarActions_unstable","root","layout","toDataAttributeValue","hasActions"],"mappings":"AAAA;;;;;;;;;;;;IAYaA,oBAAoB;eAApBA;;IAiByCC,iCAAiC;eAA9EC,0DAAyC;;;iCA1BJ;uBAGT;AAM9B,MAAMF,uBAAuB,CAClCG,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,2BAAoB,EAACJ,MAAMK,UAAU;IAEtE,OAAOL;AACT"}