{"version":3,"file":"ProgressBar.mjs","names":[],"sources":["../../src/DataBars/ProgressBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { Tooltip } from '@lobehub/ui/base-ui';\nimport { cssVar, cx } from 'antd-style';\nimport { ReactNode, forwardRef } from 'react';\n\nimport { styles } from './styles';\n\nexport interface ProgressBarProps extends FlexboxProps {\n  bgColors?: string;\n  color?: string;\n  showAnimation?: boolean;\n  size?: number;\n  tooltip?: ReactNode;\n  value: number;\n}\n\nconst ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>((props, ref) => {\n  const {\n    value,\n    color,\n    bgColors,\n    tooltip,\n    showAnimation = false,\n    className,\n    width = '100%',\n    size = 8,\n    style,\n    ...rest\n  } = props;\n\n  return (\n    <Tooltip title={tooltip}>\n      <Flexbox\n        align={'center'}\n        className={className}\n        height={size}\n        horizontal\n        ref={ref}\n        style={{\n          position: 'relative',\n          ...style,\n        }}\n        width={width}\n        {...rest}\n      >\n        <Flexbox\n          height={'100%'}\n          style={{\n            background: bgColors || cssVar.colorFillTertiary,\n            borderRadius: size / 2,\n            inset: 0,\n            opacity: bgColors ? 0.2 : 1,\n            position: 'absolute',\n            zIndex: 0,\n          }}\n          width={'100%'}\n        />\n        <Flexbox\n          className={cx(showAnimation && styles.showAnimation)}\n          height={'100%'}\n          style={{\n            background: color || cssVar.colorPrimary,\n            borderRadius: size / 2,\n            zIndex: 1,\n          }}\n          width={`${value}%`}\n        />\n      </Flexbox>\n    </Tooltip>\n  );\n});\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":";;;;;;;;AAkBA,MAAM,cAAc,YAA8C,OAAO,QAAQ;CAC/E,MAAM,EACJ,OACA,OACA,UACA,SACA,gBAAgB,OAChB,WACA,QAAQ,QACR,OAAO,GACP,OACA,GAAG,SACD;CAEJ,OACE,oBAAC,SAAD;EAAS,OAAO;EACd,UAAA,qBAAC,SAAD;GACE,OAAO;GACI;GACX,QAAQ;GACR,YAAA;GACK;GACL,OAAO;IACL,UAAU;IACV,GAAG;GACL;GACO;GACP,GAAI;GAXN,UAAA,CAaE,oBAAC,SAAD;IACE,QAAQ;IACR,OAAO;KACL,YAAY,YAAY,OAAO;KAC/B,cAAc,OAAO;KACrB,OAAO;KACP,SAAS,WAAW,KAAM;KAC1B,UAAU;KACV,QAAQ;IACV;IACA,OAAO;GACR,CAAA,GACD,oBAAC,SAAD;IACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;IACnD,QAAQ;IACR,OAAO;KACL,YAAY,SAAS,OAAO;KAC5B,cAAc,OAAO;KACrB,QAAQ;IACV;IACA,OAAO,GAAG,MAAM;GACjB,CAAA,CACM;;CACF,CAAA;AAEb,CAAC;AAED,YAAY,cAAc"}