{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAmBM,SAAS,wCAAqC,KAA8B;IACjF,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,kBAAE,cAAc,EAAC,GAAG;IAC3D,IAAI,MAAM,CAAA,GAAA,aAAK,EAAyB;IACxC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;wBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,cAAC,UAAU,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAAC,GAAG,KAAK;kBAAE;IAAQ,GAAG,OAAO;IAEzE,qBACE,gCAAC;QACE,GAAG,UAAU;QACd,eAAa,KAAK,CAAC,cAAc;QACjC,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,8CAAe,GAAG,sCAAsC;QAC9E,KAAK;OACJ,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC5B,gCAAC,CAAA,GAAA,yCAAgB;YACf,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAGhB,gCAAC;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 {isDisabled, isReadOnly, isRequired, inputClassName} = 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\n      {...fieldProps}\n      data-testid={props['data-testid']}\n      className={classNames(datepickerStyles, 'react-spectrum-Datepicker-segments', inputClassName)}\n      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      ))}\n      <input {...inputProps} ref={inputRef} />\n    </span>\n  );\n}\n"],"names":[],"version":3,"file":"DatePickerField.mjs.map"}