Skip to content

Commit

Permalink
🏷️ Fjernet referanse til duration i Progressbar for pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh committed May 2, 2024
1 parent db9c858 commit 7b25f30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions @navikt/core/react/src/progress-bar/ProgressBar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const Default: StoryFn = (args) => {
size={args.size}
value={value}
aria-labelledby="progress-bar-label"
duration={args.indeterminate ? 0 : undefined}
/* duration={args.indeterminate ? 0 : undefined} */
/>
</>
) : (
Expand Down Expand Up @@ -103,6 +103,9 @@ Sizes.args = {
valueMax: 12,
};

/**
* Duration is temp disabled due to potential API-updates
*/
export const IndeterminateState: Story = {
render: () => {
const values = [2, 5, 10, 20];
Expand All @@ -113,7 +116,7 @@ export const IndeterminateState: Story = {
</p>
<ProgressBar
valueMax={100}
duration={0}
/* duration={0} */
size="medium"
value={50}
aria-labelledby="progress-bar-label-immediate-indeterminate"
Expand All @@ -125,7 +128,7 @@ export const IndeterminateState: Story = {
</p>
<ProgressBar
valueMax={100}
duration={value}
/* duration={value} */
size="medium"
value={value}
aria-labelledby={`progress-bar-label-${value}`}
Expand Down
5 changes: 3 additions & 2 deletions @navikt/core/react/src/progress-bar/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ interface ProgressBarPropsBase
* ProgressBar grows with a preset animation for {duration} seconds.
* After a 4 sec delay, it then shows an indeterminate animation.
* A duration of 0 will show an indeterminate animation immediately.
* Temporary removed to avoid conflicts when updating API
*/
duration?: number;
//duration?: number;
/**
* String ID of the element that labels the progress bar.
* Not needed if `aria-label` is used.
Expand Down Expand Up @@ -72,7 +73,6 @@ export const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
size = "medium",
value = 0,
valueMax = 100,
duration,
"aria-labelledby": ariaLabelledBy,
"aria-label": ariaLabel,
className,
Expand All @@ -81,6 +81,7 @@ export const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
ref,
) => {
const translate = 100 - (Math.round(value) / valueMax) * 100;
const duration = undefined;

return (
<div
Expand Down

0 comments on commit 7b25f30

Please sign in to comment.