{"version":3,"sources":["../src/components/Toolbar/useToolbar.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useToolbarBase_unstable, useToolbarContextValues_unstable } from '@fluentui/react-toolbar';\n\nimport type { ToolbarProps, ToolbarState, ToolbarContextValues } from './Toolbar.types';\nimport { toDataAttributeValue } from '../../utils';\n\n/**\n * Returns the state for a Toolbar component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderToolbar`.\n */\nexport const useToolbar = (props: ToolbarProps, ref: React.Ref<HTMLElement>): ToolbarState => {\n  const state: ToolbarState = useToolbarBase_unstable(props, ref);\n\n  // eslint-disable-next-line react-hooks/immutability\n  state.root.focusgroup = `toolbar ${state.vertical ? 'block' : 'inline'} wrap`;\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-vertical'] = toDataAttributeValue(state.vertical);\n\n  return state;\n};\n\n/**\n * Returns the context of the toolbar, which is used to pass information about the toolbar to its children.\n */\nexport { useToolbarContext_unstable as useToolbarContext } from '@fluentui/react-toolbar';\n\n/**\n * Maps the state of the toolbar to the values that are passed through context to its children.\n */\nexport const useToolbarContextValues = useToolbarContextValues_unstable as (\n  state: ToolbarState,\n) => ToolbarContextValues;\n"],"names":["useToolbar","useToolbarContext","useToolbarContext_unstable","useToolbarContextValues","props","ref","state","useToolbarBase_unstable","root","focusgroup","vertical","toDataAttributeValue","useToolbarContextValues_unstable"],"mappings":"AAAA;;;;;;;;;;;;IAYaA,UAAU;eAAVA;;IAc0BC,iBAAiB;eAA/CC,wCAA0B;;IAKtBC,uBAAuB;eAAvBA;;;8BA5B6D;uBAGrC;AAM9B,MAAMH,aAAa,CAACI,OAAqBC;IAC9C,MAAMC,QAAsBC,IAAAA,qCAAuB,EAACH,OAAOC;IAE3D,oDAAoD;IACpDC,MAAME,IAAI,CAACC,UAAU,GAAG,CAAC,QAAQ,EAAEH,MAAMI,QAAQ,GAAG,UAAU,SAAS,KAAK,CAAC;IAC7E,oDAAoD;IACpDJ,MAAME,IAAI,CAAC,gBAAgB,GAAGG,IAAAA,2BAAoB,EAACL,MAAMI,QAAQ;IAEjE,OAAOJ;AACT;AAUO,MAAMH,0BAA0BS,8CAAgC"}