{"version":3,"sources":["../src/components/InteractionTag/useInteractionTag.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useInteractionTagBase_unstable } from '@fluentui/react-tags';\n\nimport type { InteractionTagProps, InteractionTagState } from './InteractionTag.types';\nimport { stringifyDataAttribute } from '../../utils';\n\n/**\n * Returns the state for an InteractionTag component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderInteractionTag`.\n */\nexport const useInteractionTag = (props: InteractionTagProps, ref: React.Ref<HTMLDivElement>): InteractionTagState => {\n  const state: InteractionTagState = useInteractionTagBase_unstable(props, ref);\n\n  /* eslint-disable react-hooks/immutability -- intentional: decorate base state with data-* attrs for styling */\n  state.root['data-disabled'] = stringifyDataAttribute(state.disabled);\n  state.root['data-selected'] = stringifyDataAttribute(state.selected);\n  /* eslint-enable react-hooks/immutability */\n\n  return state;\n};\n"],"names":["useInteractionTag","props","ref","state","useInteractionTagBase_unstable","root","stringifyDataAttribute","disabled","selected"],"mappings":"AAAA;;;;;+BAYaA;;;eAAAA;;;2BATkC;uBAGR;AAMhC,MAAMA,oBAAoB,CAACC,OAA4BC;IAC5D,MAAMC,QAA6BC,IAAAA,yCAA8B,EAACH,OAAOC;IAEzE,6GAA6G,GAC7GC,MAAME,IAAI,CAAC,gBAAgB,GAAGC,IAAAA,6BAAsB,EAACH,MAAMI,QAAQ;IACnEJ,MAAME,IAAI,CAAC,gBAAgB,GAAGC,IAAAA,6BAAsB,EAACH,MAAMK,QAAQ;IACnE,0CAA0C,GAE1C,OAAOL;AACT"}