{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAoBM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,+DAAa;;aAC9B,OAAO;;IAEvB,OAAO,UAA+B,EAAE,aAAkC,EAA8B;QACtG,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAKO,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,qDAAkB,EAAE,2CAAe,SAAS,UAAU,KAAqB,EAAE,GAA8B;IAChJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,eAAe;IAC7B,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,cAAc,CAAA,GAAA,6BAAE,CAAC,CAAC,QAAQ;IAE9B,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QACC,QAAQ,MAAM,MAAM;QACnB,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,aAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAEpB","sources":["packages/react-aria-components/src/Separator.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 */\n\nimport {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria/useSeparator';\n\nimport {BaseCollection, CollectionNode} from 'react-aria/private/collections/BaseCollection';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps, DOMRenderProps<'hr' | 'div', undefined>, GlobalDOMAttributes<HTMLElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n   * @default 'react-aria-Separator'\n   */\n  className?: string\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n  static readonly type = 'separator';\n\n  filter(collection: BaseCollection<any>, newCollection: BaseCollection<any>): CollectionNode<any> | null {\n    let prevItem = newCollection.getItem(this.prevKey!);\n    if (prevItem && prevItem.type !== 'separator') {\n      let clone = this.clone();\n      newCollection.addDescendants(clone, collection);\n      return clone;\n    }\n\n    return null;\n  }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(SeparatorNode, function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n  [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n  let {elementType, orientation, style, className, slot, ...otherProps} = props;\n  let Element = elementType || 'hr';\n  if (Element === 'hr' && orientation === 'vertical') {\n    Element = 'div';\n  }\n\n  let ElementType = dom[Element];\n\n  let {separatorProps} = useSeparator({\n    ...otherProps,\n    elementType,\n    orientation\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <ElementType\n      render={props.render}\n      {...mergeProps(DOMProps, separatorProps)}\n      style={style}\n      className={className ?? 'react-aria-Separator'}\n      ref={ref}\n      slot={slot || undefined} />\n  );\n});\n"],"names":[],"version":3,"file":"Separator.cjs.map"}