feat(Progress): add circular variant#6747
Draft
aovee wants to merge 4 commits into
Draft
Conversation
Also adds thickness prop to control circle stroke width
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Resolves #6151
Note
Opening as a draft: implementation is ready for review, documentation is still WIP.
❓ Type of change
📚 Description
Adds circular progress support to
UProgressas avariantrather than a separateUCircularProgresscomponent, as suggested in the issue. This keeps a single API surface and lets the existingcolor,size,animation,inverted,statusandorientationprops carry over.What's included
variantprop —linear(default) orcircular. Defaults preserve current behaviour, so this is non-breaking.<circle>track plus aProgressIndicatorcircle withpathLength="100", driven bystroke-dasharray. A newtrackslot is exposed for the background circle.thicknessprop —auto(default) derives the stroke width fromsize, or pass a number of pixels. Both go through the--ui-progress-thicknessCSS variable, which also drives the radius (r: calc(50px - thickness / 2)) so the stroke never overflows the viewBox.2xs→2xlmap to both a diameter and a default thickness.statusslot is rendered centered inside the circle instead of above/beside the bar.animationvalues (carousel,carousel-inverse,swing,elastic) have circular equivalents, added as new keyframes inkeyframes.css.inverted— flips the sweep direction of the circle.Theme refactor
The
progresstheme has been reorganised so most existingorientation/size/animationcompound variants are now scoped undervariant: 'linear', withvariant: 'circular'counterparts added. Some slot classes moved fromslotsinto thelinearvariant (e.g.overflow-hidden rounded-full bg-accentedonbase). Rendered output for the defaultlinearvariant is unchanged apart from class ordering — snapshots were updated accordingly (Progress, andToastwhich embeds a progress bar).Playground
playgrounds/nuxt/app/pages/components/progress.vuenow exercises the circular variant across sizes, colors, animations and a custom thickness.📝 Checklist