{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AA8BM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAA4C;AAM5E,MAAM,0DAAO,CAAA,GAAA,uBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAAkC;IAC/F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,oBAAC,gBAAgB,sBAAE,qBAAqB,oBAAU,QAAQ,aAAE,SAAS,EAAE,GAAG,UAAS,GAAG;IAC1F,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,IAAI;QACP,YAAY,uBAAuB;QAClC,GAAG,QAAQ;QACZ,KAAK;QACL,WAAW,aAAa;qBACxB,0DAAC,0CAAY,QAAQ;QAAC,OAAO;YAAC,GAAG,KAAK;gCAAE;QAAkB;qBACxD,0DAAC,CAAA,GAAA,0EAAoB,EAAE,QAAQ;QAAC,OAAO,oBAAoB,CAAC;OACzD;AAKX","sources":["packages/react-aria-components/src/Form.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {ContextValue, dom, DOMProps, DOMRenderProps, useContextProps} from './utils';\nimport {FormValidationContext} from 'react-stately/private/form/useFormValidationState';\nimport {GlobalDOMAttributes, FormProps as SharedFormProps} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface FormProps\n  extends\n    SharedFormProps,\n    DOMProps,\n    DOMRenderProps<'form', undefined>,\n    GlobalDOMAttributes<HTMLFormElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element.\n   *\n   * @default 'react-aria-Form'\n   */\n  className?: string;\n  /**\n   * Whether to use native HTML form validation to prevent form submission\n   * when a field value is missing or invalid, or mark fields as required\n   * or invalid via ARIA.\n   *\n   * @default 'native'\n   */\n  validationBehavior?: 'aria' | 'native';\n}\n\nexport const FormContext = createContext<ContextValue<FormProps, HTMLFormElement>>(null);\n\n/**\n * A form is a group of inputs that allows users to submit data to a server,\n * with support for providing field validation errors.\n */\nexport const Form = forwardRef(function Form(props: FormProps, ref: ForwardedRef<HTMLFormElement>) {\n  [props, ref] = useContextProps(props, ref, FormContext);\n  let {validationErrors, validationBehavior = 'native', children, className, ...domProps} = props;\n  return (\n    <dom.form\n      noValidate={validationBehavior !== 'native'}\n      {...domProps}\n      ref={ref}\n      className={className || 'react-aria-Form'}>\n      <FormContext.Provider value={{...props, validationBehavior}}>\n        <FormValidationContext.Provider value={validationErrors ?? {}}>\n          {children}\n        </FormValidationContext.Provider>\n      </FormContext.Provider>\n    </dom.form>\n  );\n});\n"],"names":[],"version":3,"file":"Form.cjs.map"}