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BAAmB;QACnB,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,0DAAC,CAAA,GAAA,+BAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,UAAU;QACV,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC5B,0DAAC,CAAA,GAAA,2CAAgB;YACf,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAGhB,0DAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC","sources":["packages/@adobe/react-spectrum/src/datepicker/DateField.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 {\n  AriaDateFieldProps,\n  DateValue,\n  MappedDateValue,\n  useDateField\n} from 'react-aria/useDateField';\n\nimport {classNames} from '../utils/classNames';\nimport {createCalendar} from '@internationalized/date';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '../label/Field';\nimport {\n  FocusableRef,\n  HelpTextProps,\n  SpectrumFieldValidation,\n  SpectrumLabelableProps,\n  StyleProps\n} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {useDateFieldState} from 'react-stately/useDateFieldState';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth} from './utils';\nimport {useFormProps} from '../form/Form';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDateFieldBase<T extends DateValue>\n  extends\n    SpectrumLabelableProps,\n    HelpTextProps,\n    SpectrumFieldValidation<MappedDateValue<T>>,\n    StyleProps {\n  /**\n   * Whether the date picker should be displayed with a quiet style.\n   *\n   * @default false\n   */\n  isQuiet?: boolean;\n  /**\n   * Whether to show the localized date format as help text below the field.\n   *\n   * @default false\n   */\n  showFormatHelpText?: boolean;\n}\n\nexport interface SpectrumDateFieldProps<T extends DateValue>\n  extends\n    Omit<AriaDateFieldProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n    SpectrumDateFieldBase<T> {}\n\n/**\n * DateFields allow users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport const DateField = React.forwardRef(function DateField<T extends DateValue>(\n  props: SpectrumDateFieldProps<T>,\n  ref: FocusableRef<HTMLElement>\n) {\n  props = useProviderProps(props);\n  props = useFormProps(props);\n  let {autoFocus, isDisabled, isReadOnly, isRequired, isQuiet} = props;\n\n  let domRef = useFocusManagerRef(ref);\n  let {locale} = useLocale();\n  let state = useDateFieldState({\n    ...props,\n    locale,\n    createCalendar\n  });\n\n  let fieldRef = useRef<HTMLElement | null>(null);\n  let inputRef = useRef<HTMLInputElement | null>(null);\n  let {\n    labelProps,\n    fieldProps,\n    inputProps,\n    descriptionProps,\n    errorMessageProps,\n    isInvalid,\n    validationErrors,\n    validationDetails\n  } = useDateField(\n    {\n      ...props,\n      inputRef\n    },\n    state,\n    fieldRef\n  );\n\n  // Note: this description is intentionally not passed to useDatePicker.\n  // The format help text is unnecessary for screen reader users because each segment already has a label.\n  let description = useFormatHelpText(props);\n  if (description && !props.description) {\n    descriptionProps.id = undefined;\n  }\n\n  let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n  let approximateWidth = useFormattedDateWidth(state) + 'ch';\n\n  return (\n    <Field\n      {...props}\n      ref={domRef}\n      elementType=\"span\"\n      description={description}\n      labelProps={labelProps}\n      descriptionProps={descriptionProps}\n      errorMessageProps={errorMessageProps}\n      validationState={validationState ?? undefined}\n      isInvalid={isInvalid}\n      validationErrors={validationErrors}\n      validationDetails={validationDetails}\n      wrapperClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-fieldWrapper')}>\n      <Input\n        ref={fieldRef}\n        fieldProps={fieldProps}\n        isDisabled={isDisabled}\n        isQuiet={isQuiet}\n        autoFocus={autoFocus}\n        validationState={validationState}\n        minWidth={approximateWidth}\n        className={classNames(datepickerStyles, 'react-spectrum-DateField')}>\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      </Input>\n    </Field>\n  );\n}) as <T extends DateValue>(\n  props: SpectrumDateFieldProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"DateField.cjs.map"}