{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA8CM,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAA+B,EAC/B,GAA2B;IAE3B,IAAI,WAAC,OAAO,YAAE,QAAQ,cAAE,UAAU,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,yCAAe,EAAE;IAC5E,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IACvB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IAEjC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAChE,QAAQ,IAAI,CAAC;IAGf,IACE,CAAC,QACA,CAAA,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,kBAAkB,AAAD,KAC/C,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAEzB,QAAQ,IAAI,CAAC;IAGf,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,YAAY;YAAC,WAAW,CAAC,CAAC;QAAI,EAAE;QAClD,GAAG,UAAU;QACd,MAAM;QACN,WAAW,CAAA,GAAA,yCAAS,EAClB,CAAA,GAAA,wDAAK,GACL,wBACA,CAAC,sBAAsB,EAAE,SAAS,EAClC;YACE,eAAe;QACjB,GACA,WAAW,SAAS;QAEtB,KAAK;OACJ;AAGP","sources":["packages/@adobe/react-spectrum/src/statuslight/StatusLight.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, DOMRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport React, {forwardRef, ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/statuslight/vars.css';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useProviderProps} from '../provider/Provider';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumStatusLightProps extends DOMProps, StyleProps, AriaLabelingProps {\n  /** The content to display as the label. */\n  children?: ReactNode;\n  /**\n   * The variant changes the color of the status light.\n   * When status lights have a semantic meaning, they should use the variant for semantic colors.\n   */\n  variant:\n    | 'positive'\n    | 'negative'\n    | 'notice'\n    | 'info'\n    | 'neutral'\n    | 'celery'\n    | 'chartreuse'\n    | 'yellow'\n    | 'magenta'\n    | 'fuchsia'\n    | 'purple'\n    | 'indigo'\n    | 'seafoam';\n  /** Whether the status light is disabled. */\n  isDisabled?: boolean;\n  /**\n   * An accessibility role for the status light. Should be set when the status\n   * can change at runtime, and no more than one status light will update simultaneously.\n   * For cases where multiple statuses can change at the same time, use a Toast instead.\n   */\n  role?: 'status';\n}\n\n/**\n * Status lights are used to color code categories and labels commonly found in data visualization.\n * When status lights have a semantic meaning, they should use semantic variant colors.\n */\nexport const StatusLight = forwardRef(function StatusLight(\n  props: SpectrumStatusLightProps,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let {variant, children, isDisabled, role, ...otherProps} = useProviderProps(props);\n  let domRef = useDOMRef(ref);\n  let {styleProps} = useStyleProps(otherProps);\n\n  if (!children && !props['aria-label'] && process.env.NODE_ENV !== 'production') {\n    console.warn('If no children are provided, an aria-label must be specified');\n  }\n\n  if (\n    !role &&\n    (props['aria-label'] || props['aria-labelledby']) &&\n    process.env.NODE_ENV !== 'production'\n  ) {\n    console.warn('A labelled StatusLight must have a role.');\n  }\n\n  return (\n    <div\n      {...filterDOMProps(otherProps, {labelable: !!role})}\n      {...styleProps}\n      role={role}\n      className={classNames(\n        styles,\n        'spectrum-StatusLight',\n        `spectrum-StatusLight--${variant}`,\n        {\n          'is-disabled': isDisabled\n        },\n        styleProps.className\n      )}\n      ref={domRef}>\n      {children}\n    </div>\n  );\n});\n"],"names":[],"version":3,"file":"StatusLight.mjs.map"}