{"mappings":"ACqDgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAeF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAfE;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA","sources":["dcb557d93c6b9336","packages/@react-spectrum/s2/src/StatusLight.tsx"],"sourcesContent":["@import \"f9aed9e8e46292d1\";\n@import \"946093cc8d031f9b\";\n","/*\n * Copyright 2024 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, DOMRefValue} from '@react-types/shared';\nimport {CenterBaseline} from './CenterBaseline';\nimport {ContextValue, SlotProps} from 'react-aria-components';\nimport {controlFont, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode} from 'react';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {Text} from './Content';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useIsSkeleton} from './Skeleton';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\ninterface StatusLightStyleProps {\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: 'informative' | 'neutral' | 'positive' | 'notice' | 'negative' | 'celery' | 'chartreuse' | 'cyan' | 'fuchsia' | 'purple' | 'magenta' | 'indigo' | 'seafoam' | 'yellow' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n  /**\n   * The size of the StatusLight.\n   *\n   * @default 'M'\n   */\n  size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport interface StatusLightProps extends StatusLightStyleProps, DOMProps, AriaLabelingProps, StyleProps, SlotProps {\n  /**\n   * The content to display as the label.\n   */\n  children?: ReactNode,\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\nexport const StatusLightContext = createContext<ContextValue<Partial<StatusLightProps>, DOMRefValue<HTMLDivElement>>>(null);\n\nconst wrapper = style<StatusLightStyleProps>({\n  display: 'flex',\n  gap: 'text-to-visual',\n  alignItems: 'baseline',\n  width: 'fit',\n  font: controlFont(),\n  color: {\n    default: 'neutral',\n    variant: {\n      neutral: 'gray-600'\n    }\n  },\n  disableTapHighlight: true\n}, getAllowedOverrides());\n\nconst light = style<StatusLightStyleProps & {isSkeleton: boolean}>({\n  size: {\n    size: {\n      S: 8,\n      M: 10,\n      L: 12,\n      XL: 14\n    }\n  },\n  fill: {\n    variant: {\n      informative: 'informative',\n      neutral: 'neutral',\n      positive: 'positive',\n      notice: 'notice',\n      negative: 'negative',\n      celery: 'celery',\n      chartreuse: 'chartreuse',\n      cyan: 'cyan',\n      fuchsia: 'fuchsia',\n      purple: 'purple',\n      magenta: 'magenta',\n      indigo: 'indigo',\n      seafoam: 'seafoam',\n      yellow: 'yellow',\n      pink: 'pink',\n      turquoise: 'turquoise',\n      cinnamon: 'cinnamon',\n      brown: 'brown',\n      silver: 'silver'\n    },\n    isSkeleton: 'gray-200'\n  },\n  overflow: 'visible' // prevents the light from getting clipped on iOS\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 = /*#__PURE__*/ forwardRef(function StatusLight(props: StatusLightProps, ref: DOMRef<HTMLDivElement>) {\n  [props, ref] = useSpectrumContextProps(props, ref, StatusLightContext);\n  let {children, size = 'M', variant, role, UNSAFE_className = '', UNSAFE_style, styles} = props;\n  let domRef = useDOMRef(ref);\n  let isSkeleton = useIsSkeleton();\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 (!role && (props['aria-label'] || props['aria-labelledby']) && process.env.NODE_ENV !== 'production') {\n    console.warn('A labelled StatusLight must have a role.');\n  }\n\n  return (\n    <div\n      {...filterDOMProps(props, {labelable: !!role})}\n      ref={domRef}\n      role={role}\n      style={UNSAFE_style}\n      className={UNSAFE_className + wrapper({size, variant}, styles)}>\n      <CenterBaseline>\n        <svg className={light({size, variant, isSkeleton})} aria-hidden=\"true\">\n          <circle r=\"50%\" cx=\"50%\" cy=\"50%\" />\n        </svg>\n      </CenterBaseline>\n      <Text>{children}</Text>\n    </div>\n  );\n});\n"],"names":[],"version":3,"file":"StatusLight.css.map"}