{"version":3,"sources":["../src/components/RadioGroup/Radio/useRadio.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useRadioBase_unstable } from '@fluentui/react-radio';\n\nimport type { RadioProps, RadioState } from './Radio.types';\nimport { stringifyDataAttribute } from '../../../utils';\n\n/**\n * Returns the state for a Radio component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderRadio`.\n */\nexport const useRadio = (props: RadioProps, ref: React.Ref<HTMLInputElement>): RadioState => {\n  const state: RadioState = useRadioBase_unstable(props, ref);\n\n  // Set data attribute for disabled state to simplify styling.\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-disabled'] = stringifyDataAttribute(state.input.disabled);\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-label-position'] = state.labelPosition;\n\n  return state;\n};\n"],"names":["useRadio","props","ref","state","useRadioBase_unstable","root","stringifyDataAttribute","input","disabled","labelPosition"],"mappings":"AAAA;;;;;+BAYaA;;;eAAAA;;;4BATyB;uBAGC;AAMhC,MAAMA,WAAW,CAACC,OAAmBC;IAC1C,MAAMC,QAAoBC,IAAAA,iCAAqB,EAACH,OAAOC;IAEvD,6DAA6D;IAC7D,oDAAoD;IACpDC,MAAME,IAAI,CAAC,gBAAgB,GAAGC,IAAAA,6BAAsB,EAACH,MAAMI,KAAK,CAACC,QAAQ;IACzE,oDAAoD;IACpDL,MAAME,IAAI,CAAC,sBAAsB,GAAGF,MAAMM,aAAa;IAEvD,OAAON;AACT"}