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,GAAG;uBAGvC,0DAAC,CAAA,GAAA,iEAAgB;QACf,eAAY;QACZ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAGxC,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\n  extends\n    Omit<DisclosureGroupProps, 'className' | 'style' | 'render' | 'children'>,\n    StyleProps,\n    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(\n  props: SpectrumAccordionProps,\n  ref: DOMRef<HTMLDivElement>\n) {\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\n  extends\n    Omit<DisclosureProps, 'className' | 'style' | 'render' | 'children'>,\n    AriaLabelingProps,\n    StyleProps {\n  /** Whether the Disclosure should be displayed with a quiet style. */\n  isQuiet?: boolean;\n  /**\n   * The contents of the disclosure. The first child should be the header, and the second child\n   * should be the panel.\n   */\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(\n  props: SpectrumDisclosureProps,\n  ref: DOMRef<HTMLDivElement>\n) {\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}) =>\n        classNames(\n          styles,\n          'spectrum-Accordion-item',\n          {\n            'spectrum-Accordion-item--quiet': accordionContext?.isQuiet ?? props.isQuiet,\n            'is-expanded': isExpanded,\n            'is-disabled': isDisabled,\n            'in-accordion': accordionContext != null\n          },\n          styleProps.className\n        )\n      }>\n      {props.children}\n    </RACDisclosure>\n  );\n});\n\nexport interface SpectrumDisclosurePanelProps\n  extends\n    Omit<DisclosurePanelProps, 'className' | 'style' | 'render' | 'children'>,\n    DOMProps,\n    AriaLabelingProps,\n    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)(\n  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);\n\nexport interface SpectrumDisclosureTitleProps extends DOMProps, AriaLabelingProps, StyleProps {\n  /**\n   * The heading level of the disclosure header.\n   *\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)(\n  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\n        ref={domRef}\n        level={level}\n        {...styleProps}\n        className={classNames(styles, 'spectrum-Accordion-itemHeading', styleProps.className)}>\n        <Button\n          slot=\"trigger\"\n          className={({isHovered, isFocusVisible, isPressed}) =>\n            classNames(styles, 'spectrum-Accordion-itemHeader', {\n              'is-hovered': isHovered,\n              'is-pressed': isPressed,\n              'focus-ring': isFocusVisible\n            })\n          }>\n          {direction === 'ltr' ? (\n            <ChevronRightMedium\n              aria-hidden=\"true\"\n              UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')}\n            />\n          ) : (\n            <ChevronLeftMedium\n              aria-hidden=\"true\"\n              UNSAFE_className={classNames(styles, 'spectrum-Accordion-itemIndicator')}\n            />\n          )}\n          {props.children}\n        </Button>\n      </Heading>\n    );\n  }\n);\n"],"names":[],"version":3,"file":"Accordion.cjs.map"}