{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAoCM,MAAM,0DAAgB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,cAAc,KAAiC,EAAE,GAA2B;IACjI,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,gBACF,YAAY,YACZ,QAAQ,eACR,cAAc,YACf,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,QAAQ,CAAA,GAAA,8DAAoB,EAAE;IAClC,IAAI,cAAC,UAAU,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,iDAAe,EAAE,OAAO;IAE1D,qBACE,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,KAAK;QACR,GAAG,UAAU;QACd,KAAK;QACL,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACrC,aAAY;QACZ,8CAAA;qBACA,0DAAC;QACE,GAAG,UAAU;QACd,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,6BACA;YACE,yCAAyC,gBAAgB;QAC3D;qBAGJ,0DAAC,CAAA,GAAA,kCAAO;QAAE,cAAc;qBACtB,0DAAC,CAAA,GAAA,8CAAmB,EAAE,QAAQ;QAAC,OAAO;OACnC;AAMb","sources":["packages/@adobe/react-spectrum/src/checkbox/CheckboxGroup.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 {AriaCheckboxGroupProps, useCheckboxGroup} from 'react-aria/useCheckboxGroup';\n\nimport {CheckboxGroupContext} from './context';\nimport {classNames} from '../utils/classNames';\nimport {DOMRef, Orientation, SpectrumHelpTextProps, SpectrumLabelableProps, StyleProps, Validation} from '@react-types/shared';\nimport {Field} from '../label/Field';\nimport {Provider, useProviderProps} from '../provider/Provider';\nimport React, {ReactElement} from 'react';\nimport {SpectrumCheckboxProps} from './Checkbox';\nimport styles from '@adobe/spectrum-css-temp/components/fieldgroup/vars.css';\nimport {useCheckboxGroupState} from 'react-stately/useCheckboxGroupState';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useFormProps} from '../form/Form';\n\nexport interface SpectrumCheckboxGroupProps extends AriaCheckboxGroupProps, SpectrumLabelableProps, Validation<string[]>, StyleProps, SpectrumHelpTextProps {\n  /**\n   * The Checkboxes contained within the CheckboxGroup.\n   */\n  children: ReactElement<SpectrumCheckboxProps> | ReactElement<SpectrumCheckboxProps>[],\n  /**\n   * The axis the checkboxes should align with.\n   * @default 'vertical'\n   */\n  orientation?: Orientation,\n  /**\n   * By default, checkboxes are not emphasized (gray).\n   * The emphasized (blue) version provides visual prominence.\n   */\n  isEmphasized?: boolean\n}\n\n/**\n * A CheckboxGroup allows users to select one or more items from a list of choices.\n */\nexport const CheckboxGroup = React.forwardRef(function CheckboxGroup(props: SpectrumCheckboxGroupProps, ref: DOMRef<HTMLDivElement>) {\n  props = useProviderProps(props);\n  props = useFormProps(props);\n  let {\n    isEmphasized,\n    children,\n    orientation = 'vertical'\n  } = props;\n  let domRef = useDOMRef(ref);\n  let state = useCheckboxGroupState(props);\n  let {groupProps, ...otherProps} = useCheckboxGroup(props, state);\n\n  return (\n    <Field\n      {...props}\n      {...otherProps}\n      ref={domRef}\n      wrapperClassName={classNames(styles, 'spectrum-FieldGroup')}\n      elementType=\"span\"\n      includeNecessityIndicatorInAccessibilityName>\n      <div\n        {...groupProps}\n        className={\n          classNames(\n            styles,\n            'spectrum-FieldGroup-group',\n            {\n              'spectrum-FieldGroup-group--horizontal': orientation === 'horizontal'\n            }\n          )\n        }>\n        <Provider isEmphasized={isEmphasized}>\n          <CheckboxGroupContext.Provider value={state}>\n            {children}\n          </CheckboxGroupContext.Provider>\n        </Provider>\n      </div>\n    </Field>\n  );\n});\n"],"names":[],"version":3,"file":"CheckboxGroup.cjs.map"}