{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuBM,SAAS,0CAAO,KAAkB;IACvC,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,YACF,QAAQ,EACR,cAAc,SAAS,EACvB,eAAe,UAAU,EACzB,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI;IACJ,IAAI;QACF,sDAAsD;QACtD,WAAW,CAAA,GAAA,qCAAU;IACvB,EAAE,OAAM;IACN,SAAS;IACX;IACA,IAAI,QAAQ;IACZ,IAAI,YAAY,MACd,QAAQ,SAAS,KAAK,KAAK,UAAU,MAAM;IAG7C,IAAI,CAAC,YACH,aAAa;IAGf,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,6CAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;eACb;QACA,WAAW;QACX,cAAc;QACd,eAAgB,YAAa,cAAc,YAAa;QACxD,MAAM;QACN,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,SAAS,KAAK,CAAC,SAAS,EACxB,iBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC,EAAE,SAAS,IAAI,CAAC,cAAc;QACnF,GACA,WAAW,SAAS;IACxB;AACF","sources":["packages/@adobe/react-spectrum/src/icon/UIIcon.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, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {ProviderContext} from '../provider/types';\nimport React, {JSX, ReactElement} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/icon/vars.css';\nimport {useProvider} from '../provider/Provider';\nimport {useSlotProps} from '../utils/Slots';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface UIIconProps extends DOMProps, AriaLabelingProps, StyleProps {\n  children: ReactElement<any>,\n  slot?: string,\n  /**\n   * Indicates whether the element is exposed to an accessibility API.\n   */\n  'aria-hidden'?: boolean | 'false' | 'true'\n}\n\nexport type UIIconPropsWithoutChildren = Omit<UIIconProps, 'children'>;\n\nexport function UIIcon(props: UIIconProps): JSX.Element {\n  props = useSlotProps(props, 'icon');\n  let {\n    children,\n    'aria-label': ariaLabel,\n    'aria-hidden': ariaHidden,\n    ...otherProps\n  } = props;\n\n  let {styleProps} = useStyleProps(otherProps);\n  let provider: undefined | ProviderContext;\n  try {\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    provider = useProvider();\n  } catch {\n    // ignore\n  }\n  let scale = 'M';\n  if (provider != null) {\n    scale = provider.scale === 'large' ? 'L' : 'M';\n  }\n\n  if (!ariaHidden) {\n    ariaHidden = undefined;\n  }\n\n  return React.cloneElement(children, {\n    ...filterDOMProps(otherProps),\n    ...styleProps,\n    scale,\n    focusable: 'false',\n    'aria-label': ariaLabel,\n    'aria-hidden': (ariaLabel ? (ariaHidden || undefined) : true),\n    role: 'img',\n    className: classNames(\n      styles,\n      children.props.className,\n      'spectrum-Icon',\n      {\n        [`spectrum-UIIcon-${children.type['displayName']}`]: children.type['displayName']\n      },\n      styleProps.className)\n  });\n}\n"],"names":[],"version":3,"file":"UIIcon.cjs.map"}