{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA0BM,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACnG,IAAI,YACF,QAAQ,WACR,OAAO,EACP,GAAG,YACJ,GAAG,CAAA,GAAA,0CAAe,EAAE;IACrB,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,aAAa,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,KAAK,CAAC,CAAA,IAAK,eAAC,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC;IAEzF,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,6CAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,kBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,0DAAC,CAAA,GAAA,oCAAS,uBACR,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;YACA,MAAM;gBACJ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;QACF;OAGE,OAAO,aAAa,YAAY,2BAC5B,0DAAC,CAAA,GAAA,8BAAG,SAAG,YACP;AAMhB","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: 'neutral' | 'info' | 'positive' | 'negative' | 'indigo' | 'yellow' | 'magenta' | 'fuchsia' | 'purple' | 'seafoam'\n}\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nexport const Badge = forwardRef(function Badge(props: SpectrumBadgeProps, ref: DOMRef<HTMLDivElement>) {\n  let {\n    children,\n    variant,\n    ...otherProps\n  } = 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\n          {\n            typeof children === 'string' || isTextOnly\n              ? <Text>{children}</Text>\n              : children\n          }\n        </SlotProvider>\n      </ClearSlots>\n    </span>\n  );\n});\n"],"names":[],"version":3,"file":"Badge.cjs.map"}