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ACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,yBACA;YACE,wCAAwC;YACxC,gCAAgC,SAAS;YACzC,gCAAgC,SAAS;YACzC,yCAAyC,YAAY;YACrD,sCAAsC,gBAAgB;YACtD,sCAAsC,gBAAgB;QACxD,GACA,WAAW,SAAS;qBAGxB,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;sBACnC,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBACjC,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBACjC,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAY;QACZ,OAAO;qBACP,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;wBAGvC,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBACjC,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAY;QACZ,OAAO;qBACP,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAM/C","sources":["packages/@adobe/react-spectrum/src/progress/ProgressCircle.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 {clamp} from 'react-stately/private/utils/number';\nimport {classNames} from '../utils/classNames';\nimport React, {CSSProperties} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/circleloader/vars.css';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useProgressBar} from 'react-aria/useProgressBar';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface ProgressCircleProps {\n  /**\n   * The current value (controlled).\n   * @default 0\n   */\n  value?: number,\n  /**\n   * The smallest value allowed for the input.\n   * @default 0\n   */\n  minValue?: number,\n  /**\n   * The largest value allowed for the input.\n   * @default 100\n   */\n  maxValue?: number,\n  /**\n   * Whether presentation is indeterminate when progress isn't known.\n   */\n  isIndeterminate?: boolean\n}\n\nexport interface AriaProgressCircleProps extends ProgressCircleProps, DOMProps, AriaLabelingProps {}\nexport interface SpectrumProgressCircleProps extends AriaProgressCircleProps, StyleProps {\n  /**\n   * What the ProgressCircle's diameter should be.\n   * @default 'M'\n   */\n  size?: 'S' | 'M' | 'L',\n  /** The static color style to apply. Useful when the button appears over a color background. */\n  staticColor?: 'white' | 'black',\n  /**\n   * The [visual style](https://spectrum.adobe.com/page/progress-circle/#Over-background-variant) of the ProgressCircle.\n   *\n   * @deprecated - use staticColor instead.\n   */\n  variant?: 'overBackground'\n}\n\n/**\n * ProgressCircles show the progression of a system operation such as downloading, uploading, or processing, in a visual way.\n * They can represent determinate or indeterminate progress.\n */\nexport const ProgressCircle = React.forwardRef(function ProgressCircle(props: SpectrumProgressCircleProps, ref: DOMRef<HTMLDivElement>) {\n  let {\n    value = 0,\n    minValue = 0,\n    maxValue = 100,\n    size = 'M',\n    staticColor,\n    variant,\n    isIndeterminate = false,\n    'aria-label': ariaLabel,\n    'aria-labelledby': ariaLabelledby,\n    ...otherProps\n  } = props;\n  let domRef = useDOMRef(ref);\n  let {styleProps} = useStyleProps(otherProps);\n\n  value = clamp(value, minValue, maxValue);\n  let {progressBarProps} = useProgressBar({...props, value});\n\n  let subMask1Style: CSSProperties = {};\n  let subMask2Style: CSSProperties = {};\n  if (!isIndeterminate) {\n    let percentage = (value - minValue) / (maxValue - minValue) * 100;\n    let angle;\n    if (percentage > 0 && percentage <= 50) {\n      angle = -180 + (percentage / 50 * 180);\n      subMask1Style.transform = `rotate(${angle}deg)`;\n      subMask2Style.transform = 'rotate(-180deg)';\n    } else if (percentage > 50) {\n      angle = -180 + (percentage - 50) / 50 * 180;\n      subMask1Style.transform = 'rotate(0deg)';\n      subMask2Style.transform = `rotate(${angle}deg)`;\n    }\n  }\n\n  if (!ariaLabel && !ariaLabelledby && process.env.NODE_ENV !== 'production') {\n    console.warn('ProgressCircle requires an aria-label or aria-labelledby attribute for accessibility');\n  }\n\n  return (\n    <div\n      {...styleProps}\n      {...progressBarProps}\n      ref={domRef}\n      className={\n        classNames(\n          styles,\n          'spectrum-CircleLoader',\n          {\n            'spectrum-CircleLoader--indeterminate': isIndeterminate,\n            'spectrum-CircleLoader--small': size === 'S',\n            'spectrum-CircleLoader--large': size === 'L',\n            'spectrum-CircleLoader--overBackground': variant === 'overBackground',\n            'spectrum-CircleLoader--staticWhite': staticColor === 'white',\n            'spectrum-CircleLoader--staticBlack': staticColor === 'black'\n          },\n          styleProps.className\n        )\n      }>\n      <div className={classNames(styles, 'spectrum-CircleLoader-track')} />\n      <div className={classNames(styles, 'spectrum-CircleLoader-fills')} >\n        <div className={classNames(styles, 'spectrum-CircleLoader-fillMask1')} >\n          <div\n            className={classNames(styles, 'spectrum-CircleLoader-fillSubMask1')}\n            data-testid=\"fillSubMask1\"\n            style={subMask1Style}>\n            <div className={classNames(styles, 'spectrum-CircleLoader-fill')} />\n          </div>\n        </div>\n        <div className={classNames(styles, 'spectrum-CircleLoader-fillMask2')} >\n          <div\n            className={classNames(styles, 'spectrum-CircleLoader-fillSubMask2')}\n            data-testid=\"fillSubMask2\"\n            style={subMask2Style} >\n            <div className={classNames(styles, 'spectrum-CircleLoader-fill')} />\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n});\n"],"names":[],"version":3,"file":"ProgressCircle.cjs.map"}