{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA0CD,SAAS,qCAAe,KAAqB;IAC3C,OAAO,CAAC,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACvD;AAEA,MAAM,uCAAgC;IACpC,GAAG,CAAA,GAAA,wCAAa,CAAC;IACjB,OAAO;QAAC;QAAS;KAAe;AAClC;AAKO,SAAS,0CAAK,KAAgB;IACnC,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,YACF,QAAQ,QACR,IAAI,EACJ,cAAc,SAAS,EACvB,eAAe,UAAU,EACzB,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE,YAAY;IAE7C,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;IAE7C,IAAI,CAAC,YACH,aAAa;IAGf,2EAA2E;IAC3E,IAAI,WAAW,OAAO,OAAO;IAE7B,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,6CAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACb,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,CAAC,mBAAmB,EAAE,UAAU,EAChC,WAAW,SAAS;IACxB;AACF","sources":["packages/@adobe/react-spectrum/src/icon/Icon.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, IconColorValue, StyleProps} from '@react-types/shared';\nimport {baseStyleProps, StyleHandlers, useStyleProps} from '../utils/styleProps';\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';\n\nexport interface IconProps extends DOMProps, AriaLabelingProps, StyleProps {\n  /**\n   * A screen reader only label for the Icon.\n   */\n  'aria-label'?: string,\n  /**\n   * The content to display. Should be an SVG.\n   */\n  children: ReactElement<any>,\n  /**\n   * Size of Icon (changes based on scale).\n   */\n  size?: 'XXS' | 'XS' | 'S' | 'M' | 'L' |'XL' | 'XXL',\n  /**\n   * A slot to place the icon in.\n   * @default 'icon'\n   */\n  slot?: string,\n  /**\n   * Indicates whether the element is exposed to an accessibility API.\n   */\n  'aria-hidden'?: boolean | 'false' | 'true',\n  /**\n   * Color of the Icon.\n   */\n  color?: IconColorValue\n}\n\nexport type IconPropsWithoutChildren = Omit<IconProps, 'children'>;\n\nfunction iconColorValue(value: IconColorValue) {\n  return `var(--spectrum-semantic-${value}-color-icon)`;\n}\n\nconst iconStyleProps: StyleHandlers = {\n  ...baseStyleProps,\n  color: ['color', iconColorValue]\n};\n\n/**\n * Spectrum icons are clear, minimal, and consistent across platforms. They follow the focused and rational principles of the design system in both metaphor and style.\n */\nexport function Icon(props: IconProps): JSX.Element {\n  props = useSlotProps(props, 'icon');\n  let {\n    children,\n    size,\n    'aria-label': ariaLabel,\n    'aria-hidden': ariaHidden,\n    ...otherProps\n  } = props;\n  let {styleProps} = useStyleProps(otherProps, iconStyleProps);\n\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  if (!ariaHidden) {\n    ariaHidden = undefined;\n  }\n\n  // Use user specified size, falling back to provider scale if size is undef\n  let iconSize = size ? size : scale;\n\n  return React.cloneElement(children, {\n    ...filterDOMProps(otherProps),\n    ...styleProps,\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      `spectrum-Icon--size${iconSize}`,\n      styleProps.className)\n  });\n}\n"],"names":[],"version":3,"file":"Icon.cjs.map"}