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,UAAU,IAAK;OACnC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Link.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 {AriaLinkOptions, useLink} from 'react-aria/useLink';\n\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  PossibleLinkDOMRenderProps,\n  RenderProps,\n  SlotProps,\n  useContextProps,\n  useRenderProps\n} from './utils';\nimport {DOMProps, forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {HoverEvents} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\n\nexport interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, Omit<RenderProps<LinkRenderProps>, 'render'>, PossibleLinkDOMRenderProps<'span', LinkRenderProps>, SlotProps, DOMProps, Omit<GlobalDOMAttributes<HTMLAnchorElement>, '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-Link'\n  */\n className?: ClassNameOrFunction<LinkRenderProps>\n}\n\nexport interface LinkRenderProps {\n  /**\n   * Whether the link is the current item within a list.\n   * @selector [data-current]\n   */\n  isCurrent: boolean,\n  /**\n   * Whether the link is currently hovered with a mouse.\n   * @selector [data-hovered]\n   */\n  isHovered: boolean,\n  /**\n   * Whether the link is currently in a pressed state.\n   * @selector [data-pressed]\n   */\n  isPressed: boolean,\n  /**\n   * Whether the link is focused, either via a mouse or keyboard.\n   * @selector [data-focused]\n   */\n  isFocused: boolean,\n  /**\n   * Whether the link is keyboard focused.\n   * @selector [data-focus-visible]\n   */\n  isFocusVisible: boolean,\n  /**\n   * Whether the link is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean\n}\n\nexport const LinkContext = createContext<ContextValue<LinkProps, HTMLAnchorElement>>(null);\n\n/**\n * A link allows a user to navigate to another page or resource within a web page\n * or application.\n */\nexport const Link = /*#__PURE__*/ (forwardRef as forwardRefType)(function Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {\n  [props, ref] = useContextProps(props, ref, LinkContext);\n\n  let elementType = props.href && !props.isDisabled ? 'a' : 'span';\n  let {linkProps, isPressed} = useLink({...props, elementType}, ref);\n  let ElementType = dom[elementType];\n\n  let {hoverProps, isHovered} = useHover(props);\n  let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n  let renderProps = useRenderProps<LinkRenderProps, 'span' | 'a'>({\n    ...props,\n    defaultClassName: 'react-aria-Link',\n    values: {\n      isCurrent: !!props['aria-current'],\n      isDisabled: props.isDisabled || false,\n      isPressed,\n      isHovered,\n      isFocused,\n      isFocusVisible\n    }\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n  delete DOMProps.onClick;\n\n  return (\n    <ElementType\n      ref={ref}\n      slot={props.slot || undefined}\n      {...mergeProps(DOMProps, renderProps, linkProps, hoverProps, focusProps)}\n      data-focused={isFocused || undefined}\n      data-hovered={isHovered || undefined}\n      data-pressed={isPressed || undefined}\n      data-focus-visible={isFocusVisible || undefined}\n      data-current={!!props['aria-current'] || undefined}\n      data-disabled={props.isDisabled  || undefined}>\n      {renderProps.children}\n    </ElementType>\n  );\n});\n"],"names":[],"version":3,"file":"Link.cjs.map"}