Skip to content

Commit

Permalink
Set unconstrainedWidth prop to false by default to better align w…
Browse files Browse the repository at this point in the history
…ith its type
  • Loading branch information
fullofcaffeine committed May 24, 2024
1 parent 310a7c0 commit 6a2626d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 6 additions & 1 deletion packages/components/src/progress-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ function UnforwardedProgressBar(
props: WordPressComponentProps< ProgressBarProps, 'progress', false >,
ref: ForwardedRef< HTMLProgressElement >
) {
const { className, value, hasUnconstrainedWidth, ...progressProps } = props;
const {
className,
value,
hasUnconstrainedWidth = false,
...progressProps
} = props;
const isIndeterminate = ! Number.isFinite( value );

return (
Expand Down
4 changes: 1 addition & 3 deletions packages/components/src/progress-bar/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const Template: StoryFn< typeof ProgressBar > = ( { ...args } ) => {
};

export const Default: StoryFn< typeof ProgressBar > = Template.bind( {} );
Default.args = {
value: 50,
};
Default.args = {};

/**
* A progress bar that expands to fill its container, ignoring the default `max-width`.
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/progress-bar/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type ProgressBarProps = {
/**
* If `true`, the progress bar will expand to fill its container, ignoring the default `max-width` of 160px.
* This allows the progress bar to adapt to different container sizes.
* @default undefined
* @default false
*/
hasUnconstrainedWidth?: boolean;
};

0 comments on commit 6a2626d

Please sign in to comment.