{"version":3,"sources":["../src/components/SearchBox/useSearchBox.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useSearchBoxBase_unstable } from '@fluentui/react-search';\n\nimport type { SearchBoxProps, SearchBoxState } from './Search.types';\nimport { stringifyDataAttribute } from '../../utils';\n\n/**\n * Returns the state for a SearchBox component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderSearchBox`.\n */\nexport const useSearchBox = (props: SearchBoxProps, ref: React.Ref<HTMLInputElement>): SearchBoxState => {\n  const state: SearchBoxState = useSearchBoxBase_unstable(props, ref);\n\n  // Set data attributes for disabled and focused states to simplify styling of these states.\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-disabled'] = stringifyDataAttribute(state.disabled);\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-focused'] = stringifyDataAttribute(state.focused);\n\n  return state;\n};\n"],"names":["useSearchBox","props","ref","state","useSearchBoxBase_unstable","root","stringifyDataAttribute","disabled","focused"],"mappings":"AAAA;;;;;+BAYaA;;;eAAAA;;;6BAT6B;uBAGH;AAMhC,MAAMA,eAAe,CAACC,OAAuBC;IAClD,MAAMC,QAAwBC,IAAAA,sCAAyB,EAACH,OAAOC;IAE/D,2FAA2F;IAC3F,oDAAoD;IACpDC,MAAME,IAAI,CAAC,gBAAgB,GAAGC,IAAAA,6BAAsB,EAACH,MAAMI,QAAQ;IACnE,oDAAoD;IACpDJ,MAAME,IAAI,CAAC,eAAe,GAAGC,IAAAA,6BAAsB,EAACH,MAAMK,OAAO;IAEjE,OAAOL;AACT"}