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A,mDAAK,GAAG;uBAEjC,0DAAC,CAAA,GAAA,iEAAgB;QACf,eAAY;QACZ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAE9C,MAAM,QAAQ;AAIvB","sources":["packages/@adobe/react-spectrum/src/accordion/Accordion.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 {AriaLabelingProps, DOMProps, DOMRef, forwardRefType, StyleProps} from '@react-types/shared';\nimport {Button} from 'react-aria-components/Button';\n\nimport ChevronLeftMedium from '@spectrum-icons/ui/ChevronLeftMedium';\n\nimport ChevronRightMedium from '@spectrum-icons/ui/ChevronRightMedium';\nimport {classNames} from '../utils/classNames';\nimport {\n  DisclosureGroup,\n  DisclosureGroupProps,\n  DisclosurePanelProps,\n  DisclosureProps,\n  Disclosure as RACDisclosure,\n  DisclosurePanel as RACDisclosurePanel\n} from 'react-aria-components/DisclosureGroup';\nimport {Heading} from 'react-aria-components/Heading';\nimport React, {createContext, forwardRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/accordion/vars.css';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumAccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style' | 'render' | 'children'>, StyleProps, DOMProps {\n  /** Whether the Accordion should be displayed with a quiet style. */\n  isQuiet?: boolean,\n  /** The disclosures within the accordion group. */\n  children: React.ReactNode\n}\n\nconst InternalAccordionContext = createContext<{isQuiet: boolean} | null>(null);\n\n/** A group of disclosures that can be expanded and collapsed. */\nexport const Accordion = /*#__PURE__*/(forwardRef as forwardRefType)(function Accordion(props: SpectrumAccordionProps, ref: DOMRef<HTMLDivElement>) {\n  props = useProviderProps(props);\n  let {styleProps} = useStyleProps(props);\n  let domRef = useDOMRef(ref);\n  return (\n    <InternalAccordionContext.Provider value={{isQuiet: props.isQuiet || false}}>\n      <DisclosureGroup\n        {...props}\n        {...styleProps}\n        ref={domRef}\n        className={classNames(styles, 'spectrum-Accordion', styleProps.className)}>\n        {props.children}\n      </DisclosureGroup>\n    </InternalAccordionContext.Provider>\n  );\n});\n\nexport interface SpectrumDisclosureProps extends Omit<DisclosureProps, 'className' | 'style' | 'render' | 'children'>, AriaLabelingProps, StyleProps {\n  /** Whether the Disclosure should be displayed with a quiet style. */\n  isQuiet?: boolean,\n  /** The contents of the disclosure. The first child should be the header, and the second child should be the panel. */\n  children: React.ReactNode\n}\n\n/** A collapsible section of content composed of a heading that expands and collapses a panel. */\nexport const Disclosure = /*#__PURE__*/(forwardRef as forwardRefType)(function Disclosure(props: SpectrumDisclosureProps, ref: DOMRef<HTMLDivElement>) {\n  props = useProviderProps(props);\n  let {styleProps} = useStyleProps(props);\n  let domRef = useDOMRef(ref);\n  let accordionContext = React.useContext(InternalAccordionContext)!;\n  return (\n    <RACDisclosure\n      {...props}\n      {...styleProps}\n      ref={domRef}\n      className={({isExpanded, isDisabled}) => classNames(styles, 'spectrum-Accordion-item', {\n        'spectrum-Accordion-item--quiet': accordionContext?.isQuiet ?? props.isQuiet,\n        'is-expanded': isExpanded,\n        'is-disabled': isDisabled,\n        'in-accordion': accordionContext != null\n      }, styleProps.className)}>\n      {props.children}\n    </RACDisclosure>\n  );\n});\n\nexport interface SpectrumDisclosurePanelProps extends Omit<DisclosurePanelProps, 'className' | 'style' | 'render' | 'children'>, DOMProps, AriaLabelingProps, StyleProps {\n  /** The contents of the accordion panel. */\n  children: React.ReactNode\n}\n\n/** The panel that contains the content of the disclosure. */\nexport const DisclosurePanel = /*#__PURE__*/(forwardRef as forwardRefType)(function DisclosurePanel(props: SpectrumDisclosurePanelProps, ref: DOMRef<HTMLDivElement>) {\n  let {styleProps} = useStyleProps(props);\n  let domRef = useDOMRef(ref);\n  return (\n    <RACDisclosurePanel\n      ref={domRef}\n      {...styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'role'>}\n      className={classNames(styles, 'spectrum-Accordion-itemContent', styleProps.className)} \n      {...props}>\n      {props.children}\n    </RACDisclosurePanel>\n  );\n});\n\nexport interface SpectrumDisclosureTitleProps extends DOMProps, AriaLabelingProps, StyleProps {\n  /**\n   * The heading level of the disclosure header.\n   * @default 3\n   */\n  level?: number,\n  /** The contents of the disclosure header. */\n  children: React.ReactNode\n}\n\n/** The heading of the disclosure. */\nexport const DisclosureTitle = /*#__PURE__*/(forwardRef as forwardRefType)(function DisclosureTitle(props: SpectrumDisclosureTitleProps, ref: DOMRef<HTMLHeadingElement>) {\n  let {styleProps} = useStyleProps(props);\n  let {level = 3} = props;\n  let {direction} = useLocale();\n  let domRef = useDOMRef(ref);\n  return (\n    <Heading ref={domRef} level={level} {...styleProps} className={classNames(styles, 'spectrum-Accordion-itemHeading', styleProps.className)}>\n      <Button\n        slot=\"trigger\"\n        className={({isHovered, isFocusVisible, isPressed}) => classNames(styles, 'spectrum-Accordion-itemHeader', {\n          'is-hovered': isHovered,\n          'is-pressed': isPressed,\n          'focus-ring': isFocusVisible\n        })}>\n        {direction === 'ltr' ? (\n          <ChevronRightMedium\n            aria-hidden=\"true\"\n            UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n              ) : (\n                <ChevronLeftMedium\n                  aria-hidden=\"true\"\n                  UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')} />\n              )}\n        {props.children}\n      </Button>\n    </Heading>\n  );\n});\n"],"names":[],"version":3,"file":"Accordion.cjs.map"}