{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AA0BM,SAAS,0CACd,KAAyB;IAEzB,IAAI,EACF,OAAO,SAAS,EAChB,cAAc,mBAAmB,IAAI,CAAA,GAAA,yCAAc,EAAE,EAAE,CAAC,YACxD,QAAQ,EACT,GAAG;IAEJ,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,4CAAiB,EAAE,WAAkB,kBAAkB;IAC/E,IAAI,CAAC,aAAa,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAE;IAE3C,OAAO;eACL;kBACA;qBACA;sBACA;IACF;AACF","sources":["packages/react-stately/src/tokenfield/useTokenFieldState.ts"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {TokenFieldValue} from './TokenFieldValue';\nimport {useControlledState} from '../utils/useControlledState';\nimport {useState} from 'react';\nimport {ValueBase} from '@react-types/shared';\n\nexport interface TokenFieldProps<\n  T extends TokenFieldValue = TokenFieldValue\n> extends ValueBase<T> {}\n\nexport interface TokenFieldState<T extends TokenFieldValue = TokenFieldValue> {\n  /** The current value of the token field. */\n  value: T;\n  /** Sets the value of the token field. */\n  setValue: (fn: T | ((value: T) => T)) => void;\n  /** Whether the token field is composing. */\n  isComposing: boolean;\n  /** Sets the composing state of the token field. */\n  setComposing: (isComposing: boolean) => void;\n}\n\n/**\n * Provides state management for a token field. Tracks the field value and the\n * composition state.\n */\nexport function useTokenFieldState<T extends TokenFieldValue = TokenFieldValue>(\n  props: TokenFieldProps<T>\n): TokenFieldState<T> {\n  let {\n    value: valueProp,\n    defaultValue: defaultValueProp = new TokenFieldValue([]),\n    onChange\n  } = props;\n\n  let [value, setValue] = useControlledState(valueProp as any, defaultValueProp, onChange);\n  let [isComposing, setComposing] = useState(false);\n\n  return {\n    value,\n    setValue,\n    isComposing,\n    setComposing\n  };\n}\n"],"names":[],"version":3,"file":"useTokenFieldState.cjs.map"}