diff --git a/src/components/progress-bar/ProgressBar.css.ts b/src/components/progress-bar/ProgressBar.css.ts index 5fd5f1c..f2dade9 100644 --- a/src/components/progress-bar/ProgressBar.css.ts +++ b/src/components/progress-bar/ProgressBar.css.ts @@ -1,4 +1,4 @@ -import { ComplexStyleRule, createVar, style } from "@vanilla-extract/css"; +import { ComplexStyleRule, createVar, keyframes, style } from "@vanilla-extract/css"; import { recipe, RecipeVariants } from "@vanilla-extract/recipes"; import { color, config, toRem } from "../../theme"; import { DefaultReset } from "../reset.css"; @@ -90,3 +90,27 @@ export const ProgressBarFill = style([ height: "100%", }, ]); + +const slidePacket = keyframes({ + "0%": { + transform: "translateX(0%)", + width: "0%", + }, + "50%": { + transform: "translateX(100%)", + width: "50%", + }, + "100%": { + transform: "translateX(200%)", + width: "50%", + }, +}); +export const ProgressBarPacket = style([ + DefaultReset, + { + display: "inline-block", + backgroundColor: "currentcolor", + height: "100%", + animation: `${slidePacket} 2s linear infinite`, + }, +]); diff --git a/src/components/progress-bar/ProgressBar.stories.tsx b/src/components/progress-bar/ProgressBar.stories.tsx index 5d69704..5820555 100644 --- a/src/components/progress-bar/ProgressBar.stories.tsx +++ b/src/components/progress-bar/ProgressBar.stories.tsx @@ -33,8 +33,6 @@ const Template: ComponentStory = (args) => ( @@ -37,7 +37,11 @@ export const ProgressBar = as<"span", ProgressBarProps & css.ProgressBarVariant> {...props} ref={ref} > - + {typeof max === "number" ? ( + + ) : ( + + )} ) );