{"version":3,"sources":["../src/components/Badge/useBadge.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useBadgeBase_unstable } from '@fluentui/react-badge';\n\nimport type { BadgeProps, BadgeState } from './Badge.types';\n\n/**\n * Returns the state for a Badge component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderBadge`.\n */\nexport const useBadge = (props: BadgeProps, ref: React.Ref<HTMLDivElement>): BadgeState => {\n  const state: BadgeState = useBadgeBase_unstable(props, ref);\n\n  // Set data-icon-position only when an icon slot is present.\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-icon-position'] = state.icon ? state.iconPosition : undefined;\n\n  return state;\n};\n"],"names":["useBadge","props","ref","state","useBadgeBase_unstable","root","icon","iconPosition","undefined"],"mappings":"AAAA;;;;;+BAWaA;;;eAAAA;;;4BARyB;AAQ/B,MAAMA,WAAW,CAACC,OAAmBC;IAC1C,MAAMC,QAAoBC,IAAAA,iCAAqB,EAACH,OAAOC;IAEvD,4DAA4D;IAC5D,oDAAoD;IACpDC,MAAME,IAAI,CAAC,qBAAqB,GAAGF,MAAMG,IAAI,GAAGH,MAAMI,YAAY,GAAGC;IAErE,OAAOL;AACT"}