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BAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,CAAA,GAAA,qBAAa;QAAE,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Checkbox.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 */\nimport {AriaCheckboxGroupProps, useCheckboxGroup, useCheckboxGroupItem} from 'react-aria/useCheckboxGroup';\n\nimport {AriaCheckboxProps, useCheckbox} from 'react-aria/useCheckbox';\nimport {CheckboxGroupState, useCheckboxGroupState} from 'react-stately/useCheckboxGroupState';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  Provider,\n  RACValidation,\n  removeDataAttributes,\n  RenderProps,\n  SlotProps,\n  useContextProps,\n  useRenderProps,\n  useSlot,\n  useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {HoverEvents} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useToggleState} from 'react-stately/useToggleState';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<CheckboxGroupRenderProps, 'div'>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-CheckboxGroup'\n   */\n  className?: ClassNameOrFunction<CheckboxGroupRenderProps>\n}\nexport interface CheckboxProps extends Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>, HoverEvents, RACValidation, RenderProps<CheckboxRenderProps, 'label'>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-Checkbox'\n   */\n  className?: ClassNameOrFunction<CheckboxRenderProps>,\n  /**\n   * A ref for the HTML input element.\n   */\n  inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface CheckboxGroupRenderProps {\n  /**\n   * Whether the checkbox group is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * Whether the checkbox group is read only.\n   * @selector [data-readonly]\n   */\n  isReadOnly: boolean,\n  /**\n   * Whether the checkbox group is required.\n   * @selector [data-required]\n   */\n  isRequired: boolean,\n  /**\n   * Whether the checkbox group is invalid.\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean,\n  /**\n   * State of the checkbox group.\n   */\n  state: CheckboxGroupState\n}\n\nexport interface CheckboxRenderProps {\n  /**\n   * Whether the checkbox is selected.\n   * @selector [data-selected]\n   */\n  isSelected: boolean,\n  /**\n   * Whether the checkbox is indeterminate.\n   * @selector [data-indeterminate]\n   */\n  isIndeterminate: boolean,\n  /**\n   * Whether the checkbox is currently hovered with a mouse.\n   * @selector [data-hovered]\n   */\n  isHovered: boolean,\n  /**\n   * Whether the checkbox is currently in a pressed state.\n   * @selector [data-pressed]\n   */\n  isPressed: boolean,\n  /**\n   * Whether the checkbox is focused, either via a mouse or keyboard.\n   * @selector [data-focused]\n   */\n  isFocused: boolean,\n  /**\n   * Whether the checkbox is keyboard focused.\n   * @selector [data-focus-visible]\n   */\n  isFocusVisible: boolean,\n  /**\n   * Whether the checkbox is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * Whether the checkbox is read only.\n   * @selector [data-readonly]\n   */\n  isReadOnly: boolean,\n  /**\n   * Whether the checkbox invalid.\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean,\n  /**\n   * Whether the checkbox is required.\n   * @selector [data-required]\n   */\n  isRequired: boolean\n}\n\nexport const CheckboxContext = createContext<ContextValue<CheckboxProps, HTMLLabelElement>>(null);\nexport const CheckboxGroupContext = createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\n\n/**\n * A checkbox group allows a user to select multiple items from a list of options.\n */\nexport const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, CheckboxGroupContext);\n  let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n  let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n  let state = useCheckboxGroupState({\n    ...props,\n    validationBehavior\n  });\n  let [labelRef, label] = useSlot(\n    !props['aria-label'] && !props['aria-labelledby']\n  );\n  let {groupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useCheckboxGroup({\n    ...props,\n    label,\n    validationBehavior\n  }, state);\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      isDisabled: state.isDisabled,\n      isReadOnly: state.isReadOnly,\n      isRequired: props.isRequired || false,\n      isInvalid: state.isInvalid,\n      state\n    },\n    defaultClassName: 'react-aria-CheckboxGroup'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      {...mergeProps(DOMProps, renderProps, groupProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-readonly={state.isReadOnly || undefined}\n      data-required={props.isRequired || undefined}\n      data-invalid={state.isInvalid || undefined}\n      data-disabled={props.isDisabled || undefined}>\n      <Provider\n        values={[\n          [CheckboxGroupStateContext, state],\n          [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n          [TextContext, {\n            slots: {\n              description: descriptionProps,\n              errorMessage: errorMessageProps\n            }\n          }],\n          [FieldErrorContext, validation]\n        ]}>\n        {renderProps.children}\n      </Provider>\n    </dom.div>\n  );\n});\n\n/**\n * A checkbox allows a user to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n */\nexport const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Checkbox(props: CheckboxProps, ref: ForwardedRef<HTMLLabelElement>) {\n  let {\n    inputRef: userProvidedInputRef = null,\n    ...otherProps\n  } = props;\n  [props, ref] = useContextProps(otherProps, ref, CheckboxContext);\n  let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n  let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n  let groupState = useContext(CheckboxGroupStateContext);\n  let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n  let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid} = groupState\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    ? useCheckboxGroupItem({\n      ...removeDataAttributes(props),\n      // Value is optional for standalone checkboxes, but required for CheckboxGroup items;\n      // it's passed explicitly here to avoid typescript error (requires ignore).\n      // @ts-ignore\n      value: props.value,\n      // ReactNode type doesn't allow function children.\n      children: typeof props.children === 'function' ? true : props.children\n    }, groupState, inputRef)\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    : useCheckbox({\n      ...removeDataAttributes(props),\n      children: typeof props.children === 'function' ? true : props.children,\n      validationBehavior\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    }, useToggleState(props), inputRef);\n  let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n  let isInteractionDisabled = isDisabled || isReadOnly;\n\n  let {hoverProps, isHovered} = useHover({\n    ...props,\n    isDisabled: isInteractionDisabled\n  });\n\n  let renderProps = useRenderProps({\n    ...props,\n    defaultClassName: 'react-aria-Checkbox',\n    values: {\n      isSelected,\n      isIndeterminate: props.isIndeterminate || false,\n      isPressed,\n      isHovered,\n      isFocused,\n      isFocusVisible,\n      isDisabled,\n      isReadOnly,\n      isInvalid,\n      isRequired: props.isRequired || false\n    }\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n  delete DOMProps.id;\n  delete DOMProps.onClick;\n\n  return (\n    <dom.label\n      {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-selected={isSelected || undefined}\n      data-indeterminate={props.isIndeterminate || undefined}\n      data-pressed={isPressed || undefined}\n      data-hovered={isHovered || undefined}\n      data-focused={isFocused || undefined}\n      data-focus-visible={isFocusVisible || undefined}\n      data-disabled={isDisabled || undefined}\n      data-readonly={isReadOnly || undefined}\n      data-invalid={isInvalid || undefined}\n      data-required={props.isRequired || undefined}>\n      <VisuallyHidden elementType=\"span\">\n        <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n      </VisuallyHidden>\n      {renderProps.children}\n    </dom.label>\n  );\n});\n"],"names":[],"version":3,"file":"Checkbox.mjs.map"}