{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAmBM,SAAS,wCAAqC,KAA8B;IACjF,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,kBACV,cAAc,EACf,GAAG;IACJ,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAyB;IACxC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,sCAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,sDAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;wBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE;QAAC,GAAG,KAAK;kBAAE;IAAQ,GAAG,OAAO;IAEzE,qBACE,0DAAC;QAAM,GAAG,UAAU;QAAE,eAAa,KAAK,CAAC,cAAc;QAAE,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,sCAAsC;QAAiB,KAAK;OAC1J,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,0DAAC,CAAA,GAAA,2CAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,0DAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAGlC","sources":["packages/@adobe/react-spectrum/src/datepicker/DatePickerField.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 {classNames} from '../utils/classNames';\n\nimport {createCalendar} from '@internationalized/date';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {DateValue, useDateField} from 'react-aria/useDateField';\nimport React, {JSX, useRef} from 'react';\nimport {SpectrumDatePickerProps} from './DatePicker';\nimport {useDateFieldState} from 'react-stately/useDateFieldState';\nimport {useLocale} from 'react-aria/I18nProvider';\n\ninterface DatePickerFieldProps<T extends DateValue> extends SpectrumDatePickerProps<T> {\n  inputClassName?: string,\n  hideValidationIcon?: boolean,\n  maxGranularity?: SpectrumDatePickerProps<T>['granularity']\n}\n\nexport function DatePickerField<T extends DateValue>(props: DatePickerFieldProps<T>): JSX.Element {\n  let {\n    isDisabled,\n    isReadOnly,\n    isRequired,\n    inputClassName\n  } = props;\n  let ref = useRef<HTMLDivElement | null>(null);\n  let {locale} = useLocale();\n  let state = useDateFieldState({\n    ...props,\n    locale,\n    createCalendar\n  });\n\n  let inputRef = useRef<HTMLInputElement | null>(null);\n  let {fieldProps, inputProps} = useDateField({...props, inputRef}, state, ref);\n\n  return (\n    <span {...fieldProps} data-testid={props['data-testid']} className={classNames(datepickerStyles, 'react-spectrum-Datepicker-segments', inputClassName)} ref={ref}>\n      {state.segments.map((segment, i) =>\n        (<DatePickerSegment\n          key={i}\n          segment={segment}\n          state={state}\n          isDisabled={isDisabled}\n          isReadOnly={isReadOnly}\n          isRequired={isRequired} />)\n      )}\n      <input {...inputProps} ref={inputRef} />\n    </span>\n  );\n}\n"],"names":[],"version":3,"file":"DatePickerField.cjs.map"}