{"version":3,"sources":["../src/components/TagPicker/TagPickerControl/useTagPickerControl.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useTagPickerControlBase_unstable } from '@fluentui/react-tag-picker';\n\nimport type { TagPickerControlProps, TagPickerControlState } from './TagPickerControl.types';\nimport { toDataAttributeValue } from '../../../utils/toDataAttributeValue';\n\n/**\n * Returns the state for a headless TagPickerControl.\n *\n * Wraps {@link useTagPickerControlBase_unstable} (which omits `size`/`appearance`) and\n * exposes the disabled/invalid state as `data-*` attributes for styling hooks.\n */\nexport const useTagPickerControl = (\n  props: TagPickerControlProps,\n  ref: React.Ref<HTMLDivElement>,\n): TagPickerControlState => {\n  const state: TagPickerControlState = useTagPickerControlBase_unstable(props, ref);\n\n  /* eslint-disable react-hooks/immutability -- decorate base state with data-* attributes */\n  state.root['data-disabled'] = toDataAttributeValue(state.disabled);\n  state.root['data-invalid'] = toDataAttributeValue(state.invalid);\n  /* eslint-enable react-hooks/immutability */\n\n  return state;\n};\n"],"names":["useTagPickerControl","props","ref","state","useTagPickerControlBase_unstable","root","toDataAttributeValue","disabled","invalid"],"mappings":"AAAA;;;;;+BAcaA;;;eAAAA;;;gCAXoC;sCAGZ;AAQ9B,MAAMA,sBAAsB,CACjCC,OACAC;IAEA,MAAMC,QAA+BC,IAAAA,gDAAgC,EAACH,OAAOC;IAE7E,yFAAyF,GACzFC,MAAME,IAAI,CAAC,gBAAgB,GAAGC,IAAAA,0CAAoB,EAACH,MAAMI,QAAQ;IACjEJ,MAAME,IAAI,CAAC,eAAe,GAAGC,IAAAA,0CAAoB,EAACH,MAAMK,OAAO;IAC/D,0CAA0C,GAE1C,OAAOL;AACT"}