Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Progress] Assume indeterminate value #2947

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .yarn/versions/c9fc51b8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
releases:
"@radix-ui/react-progress": minor

declined:
- primitives
4 changes: 2 additions & 2 deletions packages/react/progress/src/Progress.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Chromatic = () => (
</Progress.Root>

<h1>Indeterminate</h1>
<Progress.Root className={rootClass()} value={null}>
<Progress.Root className={rootClass()}>
<Progress.Indicator className={chromaticIndicatorClass()}>/</Progress.Indicator>
</Progress.Root>

Expand All @@ -54,7 +54,7 @@ export const Chromatic = () => (
</Progress.Root>

<h2>Indeterminate</h2>
<Progress.Root className={rootAttrClass()} value={null}>
<Progress.Root className={rootAttrClass()}>
<Progress.Indicator className={indicatorAttrClass()}>/</Progress.Indicator>
</Progress.Root>

Expand Down
4 changes: 2 additions & 2 deletions packages/react/progress/src/Progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Progress = React.forwardRef<ProgressElement, ProgressProps>(
(props: ScopedProps<ProgressProps>, forwardedRef) => {
const {
__scopeProgress,
value: valueProp,
value: valueProp = null,
max: maxProp,
getValueLabel = defaultGetValueLabel,
...progressProps
Expand Down Expand Up @@ -140,7 +140,7 @@ function getInvalidValueError(propValue: string, componentName: string) {
return `Invalid prop \`value\` of value \`${propValue}\` supplied to \`${componentName}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${DEFAULT_MAX} if no \`max\` prop is set)
- \`null\` if the progress is indeterminate.
- \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`;
}
Expand Down
Loading