feat(component): add Progress component#54
Open
alirezanaseri548 wants to merge 1 commit into
Open
Conversation
Resolves tailwiinder#30 Add a horizontal Progress bar component following the project's light/dark theming and cn-based className convention. It mirrors the shadcn/ui Progress API (a 0-100 value prop) while rendering native Views, clamps out-of-range values, and exposes accessibility props. - packages/cli/templates/progress/index.tsx: Progress component - packages/cli/templates/progress/styles.ts: light/dark class names
|
@alirezanaseri548 is attempting to deploy a commit to the major tom's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Description
Adds a new
Progresscomponent to the template library, implementing the request in #30.It renders a horizontal progress bar that represents the completion percentage (0–100) of a task. The API mirrors shadcn/ui's
Progress(avalueprop from 0 to 100) so it feels familiar to web contributors, while rendering nativeViews.Closes #30
What's added
packages/cli/templates/progress/index.tsx— theProgresscomponentpackages/cli/templates/progress/styles.ts— light/dark class names following the project's theming conventionImplementation notes
index.tsx+styles.tsfolder layout and thecnutility as the other templates (e.g.badge,card,aspectratio).modeprop toggles betweenbg-primary/bg-secondary(light) andbg-dark-primary/bg-dark-secondary(dark).valueis clamped to[0, 100]so the indicator never overflows the track or collapses to a negative width.accessibilityRole="progressbar"withaccessibilityValue={{ min: 0, max: 100, now }}so screen readers announce progress correctly.className(track) andindicatorClassName(fill), and spreads the rest ofViewProps.Usage
How Has This Been Tested?
tsc --noEmitpasses with no errors.turbo run buildsucceeds.prettier --writeapplied; files match the repo's formatting.badge,card,aspectratio) for consistency.Screenshots / Recording
This PR only adds template files consumed by the CLI; visual verification can be done by adding the component to the
examplesapp on request.Checklist