{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA2CD,SAAS,qCAAe,KAAqB;IAC3C,OAAO,CAAC,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACvD;AAEA,MAAM,uCAAgC;IACpC,GAAG,CAAA,GAAA,yCAAa,CAAC;IACjB,OAAO;QAAC;QAAS;KAAe;AAClC;AAMO,SAAS,0CAAK,KAAgB;IACnC,QAAQ,CAAA,GAAA,yCAAW,EAAE,OAAO;IAC5B,IAAI,YAAC,QAAQ,QAAE,IAAI,EAAE,cAAc,SAAS,EAAE,eAAe,UAAU,EAAE,GAAG,YAAW,GAAG;IAC1F,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE,YAAY;IAE7C,IAAI;IACJ,IAAI;QACF,sDAAsD;QACtD,WAAW,CAAA,GAAA,yCAAU;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,YAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACb,WAAW;QACX,cAAc;QACd,eAAe,YAAY,cAAc,YAAY;QACrD,MAAM;QACN,WAAW,CAAA,GAAA,yCAAS,EAClB,CAAA,GAAA,iDAAK,GACL,SAAS,KAAK,CAAC,SAAS,EACxB,iBACA,CAAC,mBAAmB,EAAE,UAAU,EAChC,WAAW,SAAS;IAExB;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   *\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\n * 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 {children, size, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, ...otherProps} = 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}\n"],"names":[],"version":3,"file":"Icon.mjs.map"}