{"version":3,"sources":["../src/components/Link/useLink.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useLinkBase_unstable } from '@fluentui/react-link';\n\nimport type { LinkProps, LinkState } from './Link.types';\nimport { stringifyDataAttribute } from '../../utils';\n\n/**\n * Returns the state for a Link component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderLink`.\n */\nexport const useLink = (props: LinkProps, ref: React.Ref<HTMLElement>): LinkState => {\n  const state: LinkState = useLinkBase_unstable(props, ref);\n\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-disabled-focusable'] = stringifyDataAttribute(state.disabledFocusable);\n\n  return state;\n};\n"],"names":["useLink","props","ref","state","useLinkBase_unstable","root","stringifyDataAttribute","disabled","disabledFocusable"],"mappings":"AAAA;;;;;+BAYaA;;;eAAAA;;;2BATwB;uBAGE;AAMhC,MAAMA,UAAU,CAACC,OAAkBC;IACxC,MAAMC,QAAmBC,IAAAA,+BAAoB,EAACH,OAAOC;IAErD,oDAAoD;IACpDC,MAAME,IAAI,CAAC,gBAAgB,GAAGC,IAAAA,6BAAsB,EAACH,MAAMI,QAAQ;IACnE,oDAAoD;IACpDJ,MAAME,IAAI,CAAC,0BAA0B,GAAGC,IAAAA,6BAAsB,EAACH,MAAMK,iBAAiB;IAEtF,OAAOL;AACT"}