{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAcM,SAAS,0CACd,KAAiC,EACjC,KAA6B,EAC7B,QAA4C;IAE5C,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,mCAAQ;IACvB,OAAO,CAAA,GAAA,wCAAa,EAClB;QACE,GAAG,KAAK;QACR,OAAO;QACP,cAAc;QACd,UAAU;QACV,UAAU;QACV,8DAA8D;QAC9D,cACE,KAAK,CAAC,aAAa,IAClB,CAAA,MAAM,KAAK,IAAI,KAAK,CAAC,kBAAkB,GACpC,YACA,MAAM,UAAU,CAAC,cAAc,CAAC,MAAM,OAAO,EAAE,OAAM;IAC7D,GACA,OACA;AAEJ","sources":["packages/react-aria/src/color/useColorChannelField.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaLabelingProps, RefObject} from '@react-types/shared';\nimport {ColorChannelFieldProps, ColorChannelFieldState} from 'react-stately/useColorFieldState';\nimport {NumberFieldAria, useNumberField} from '../numberfield/useNumberField';\nimport {useLocale} from '../i18n/I18nProvider';\n\nexport interface AriaColorChannelFieldProps extends ColorChannelFieldProps, AriaLabelingProps {}\nexport interface ColorChannelFieldAria extends NumberFieldAria {}\n\n/**\n * Provides the behavior and accessibility implementation for a color channel field, allowing users\n * to edit the value of an individual color channel.\n */\nexport function useColorChannelField(\n  props: AriaColorChannelFieldProps,\n  state: ColorChannelFieldState,\n  inputRef: RefObject<HTMLInputElement | null>\n): ColorChannelFieldAria {\n  let {locale} = useLocale();\n  return useNumberField(\n    {\n      ...props,\n      value: undefined,\n      defaultValue: undefined,\n      onChange: undefined,\n      validate: undefined,\n      // Provide a default aria-label if no other label is provided.\n      'aria-label':\n        props['aria-label'] ||\n        (props.label || props['aria-labelledby']\n          ? undefined\n          : state.colorValue.getChannelName(props.channel, locale))\n    },\n    state,\n    inputRef\n  );\n}\n"],"names":[],"version":3,"file":"useColorChannelField.cjs.map"}