{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAqCM,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE,SAAS,MACvC,KAAyB,EACzB,GAA2B;IAE3B,IAAI,YAAC,QAAQ,WAAE,OAAO,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,yCAAe,EAAE;IAC1D,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IACvB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,aAAa,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,KAAK,CAAC,CAAA,IAAK,eAAC,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC;IAEzF,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,MAAK;QACL,WAAW,CAAA,GAAA,yCAAS,EAClB,CAAA,GAAA,kDAAK,GACL,kBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,gCAAC,CAAA,GAAA,yCAAS,uBACR,gCAAC,CAAA,GAAA,yCAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,kDAAK,GAAG;YACvC;YACA,MAAM;gBACJ,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,kDAAK,GAAG;YACvC;QACF;OACC,OAAO,aAAa,YAAY,2BAAa,gCAAC,CAAA,GAAA,yCAAG,SAAG,YAAmB;AAKlF","sources":["packages/@adobe/react-spectrum/src/badge/Badge.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 {AriaLabelingProps, DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider} from '../utils/Slots';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport React, {forwardRef, ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/badge/vars.css';\nimport {Text} from '../text/Text';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumBadgeProps extends DOMProps, StyleProps, AriaLabelingProps {\n  /** The content to display in the badge. */\n  children: ReactNode;\n  /**\n   * The variant changes the background color of the badge.\n   * When badge has a semantic meaning, they should use the variant for semantic colors.\n   */\n  variant:\n    | 'neutral'\n    | 'info'\n    | 'positive'\n    | 'negative'\n    | 'indigo'\n    | 'yellow'\n    | 'magenta'\n    | 'fuchsia'\n    | 'purple'\n    | 'seafoam';\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a\n * user's attention.\n */\nexport const Badge = forwardRef(function Badge(\n  props: SpectrumBadgeProps,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let {children, variant, ...otherProps} = useProviderProps(props);\n  let domRef = useDOMRef(ref);\n  let {styleProps} = useStyleProps(otherProps);\n  let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n  return (\n    <span\n      {...filterDOMProps(otherProps)}\n      {...styleProps}\n      role=\"presentation\"\n      className={classNames(\n        styles,\n        'spectrum-Badge',\n        {\n          [`spectrum-Badge--${variant}`]: variant\n        },\n        styleProps.className\n      )}\n      ref={domRef}>\n      <ClearSlots>\n        <SlotProvider\n          slots={{\n            icon: {\n              size: 'S',\n              UNSAFE_className: classNames(styles, 'spectrum-Badge-icon')\n            },\n            text: {\n              UNSAFE_className: classNames(styles, 'spectrum-Badge-label')\n            }\n          }}>\n          {typeof children === 'string' || isTextOnly ? <Text>{children}</Text> : children}\n        </SlotProvider>\n      </ClearSlots>\n    </span>\n  );\n});\n"],"names":[],"version":3,"file":"Badge.mjs.map"}