Skip to content

Commit

Permalink
fix animations
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt committed Jun 21, 2024
1 parent d07a319 commit 5b69166
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/vis-elements/DeltaBar/DeltaBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const DeltaBar = React.forwardRef<HTMLDivElement, DeltaBarProps>((props, ref) =>
)}
style={{
width: `${Math.abs(value)}%`,
transition: showAnimation ? "all 1s" : "",
transition: showAnimation ? "all duration-300" : "",
}}
{...getReferenceProps}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/vis-elements/MarkerBar/MarkerBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const MarkerBar = React.forwardRef<HTMLDivElement, MarkerBarProps>((props, ref)
style={{
left: `${minValue}%`,
width: `${maxValue - minValue}%`,
transition: showAnimation ? "all 1s" : "",
transition: showAnimation ? "all duration-300" : "",
}}
{...getRangeReferenceProps}
/>
Expand Down
9 changes: 1 addition & 8 deletions src/components/vis-elements/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"use client";
import React from "react";

import Tooltip, { useTooltip } from "components/util-elements/Tooltip/Tooltip";
import { getColorClassNames, makeClassName, tremorTwMerge } from "lib";
import { colorPalette } from "lib/theme";
Expand Down Expand Up @@ -46,34 +44,29 @@ const ProgressBar = React.forwardRef<HTMLDivElement, ProgressBarProps>((props, r
<div
className={tremorTwMerge(
makeProgressBarClassName("progressBar"),
// common
"flex-col h-full rounded-tremor-full",
color
? getColorClassNames(color, colorPalette.background).bgColor
: "bg-tremor-brand dark:bg-dark-tremor-brand",
showAnimation ? "transition-all duration-300 ease-in-out" : "",
)}
style={{
width: `${value}%`,
transition: showAnimation ? "all 1s" : "",
}}
/>
</div>
{label ? (
<div
className={tremorTwMerge(
makeProgressBarClassName("labelWrapper"),
// common
"w-16 truncate text-right ml-2",
// light
"text-tremor-content-emphasis",
// dark
"dark:text-dark-tremor-content-emphasis",
)}
>
<p
className={tremorTwMerge(
makeProgressBarClassName("label"),
// common
"shrink-0 whitespace-nowrap truncate text-tremor-default",
)}
>
Expand Down
1 change: 1 addition & 0 deletions src/stories/vis-elements/ProgressBar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Story = StoryObj<typeof ProgressBar>;

export const Default: Story = {
args: {
showAnimation: true,
value: 50,
tooltip: "50%",
label: "90%",
Expand Down

0 comments on commit 5b69166

Please sign in to comment.