diff --git a/package-lock.json b/package-lock.json index 92fbbaf3..87cb608a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gisce/react-formiga-components", - "version": "1.20.0-alpha.5", + "version": "1.21.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gisce/react-formiga-components", - "version": "1.20.0-alpha.5", + "version": "1.21.0", "license": "MIT", "dependencies": { "@ant-design/icons": "^6.0.0", diff --git a/package.json b/package.json index 65e17800..3298bb93 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "storybook", "library" ], - "version": "1.20.0-alpha.5", + "version": "1.21.0", "module": "./dist/react-formiga-components.es.js", "types": "./dist/index.d.ts", "exports": { diff --git a/src/components/widgets/ProgressBar/ProgressBarValue/ProgressBarValue.styles.tsx b/src/components/widgets/ProgressBar/ProgressBarValue/ProgressBarValue.styles.tsx index 2a874df3..8d439639 100644 --- a/src/components/widgets/ProgressBar/ProgressBarValue/ProgressBarValue.styles.tsx +++ b/src/components/widgets/ProgressBar/ProgressBarValue/ProgressBarValue.styles.tsx @@ -1,12 +1,30 @@ import { Progress } from "antd"; -import styled from "styled-components"; +import styled, { keyframes, css } from "styled-components"; -export const StyledProgress = styled(Progress)` -.ant-progress-outer { - margin-right: 0px; - padding-right: 0px; -} -.ant-progress-text { - display: none; -} +const indeterminateAnimation = keyframes` + 0% { + transform: translateX(-100%); + } + 100% { + transform: translateX(500%); + } +`; + +export const StyledProgress = styled(Progress)<{ $isIndeterminate?: boolean }>` + .ant-progress-outer { + margin-right: 0px; + padding-right: 0px; + } + .ant-progress-text { + display: none; + } + + ${(props) => + props.$isIndeterminate && + css` + .ant-progress-bg { + width: 25% !important; + animation: ${indeterminateAnimation} 1.5s ease-in-out infinite; + } + `} `; diff --git a/src/components/widgets/ProgressBar/ProgressBarValue/ProgressBarValue.tsx b/src/components/widgets/ProgressBar/ProgressBarValue/ProgressBarValue.tsx index 528f73fd..f358220f 100644 --- a/src/components/widgets/ProgressBar/ProgressBarValue/ProgressBarValue.tsx +++ b/src/components/widgets/ProgressBar/ProgressBarValue/ProgressBarValue.tsx @@ -1,7 +1,8 @@ -import React from 'react'; -import { StyledProgress } from './ProgressBarValue.styles'; +import React from "react"; +import { StyledProgress } from "./ProgressBarValue.styles"; export const ProgressBarValue = ({ value }: { value?: number }) => { + const isIndeterminate = value === -1; const textValue = `${(value || 0).toLocaleString("en-US", { minimumIntegerDigits: 1, maximumFractionDigits: 4, @@ -10,8 +11,13 @@ export const ProgressBarValue = ({ value }: { value?: number }) => { return (
- -
{textValue}
+ + {!isIndeterminate && ( +
{textValue}
+ )}
); -}; \ No newline at end of file +};