Skip to content

[WEB-4736] dev: propel button#7746

Merged
sriramveeraghanta merged 4 commits intopreviewfrom
dev-propel-button
Sep 9, 2025
Merged

[WEB-4736] dev: propel button#7746
sriramveeraghanta merged 4 commits intopreviewfrom
dev-propel-button

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Sep 9, 2025

Description

This PR introduces the button component in propel.

Media

Before
media

Summary by CodeRabbit

  • New Features

    • Added a reusable Button component with multiple variants (primary, secondary, outline, ghost, destructive), sizes (sm, md, lg), disabled state, native attribute forwarding, and custom class support.
  • Documentation

    • Added Storybook stories demonstrating default, variant, size, disabled, and composite views for easy preview and testing.
  • Chores

    • Exposed the Button in the package public exports and included it in the build for consumer imports.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a new Button component (with variants and sizes), Storybook stories, an index re-export, includes it in tsdown build entries, and exposes it via a new package export ("./button") in packages/propel/package.json.

Changes

Cohort / File(s) Summary
Button implementation & public API
packages/propel/src/button/button.tsx, packages/propel/src/button/index.ts
New Button component (forwardRef) with enums/types for variants/sizes, styling mappings, and exported Button and ButtonProps.
Storybook stories
packages/propel/src/button/button.stories.tsx
New Storybook stories for Default, variant variations, size variations, Disabled, AllVariants, and AllSizes.
Build & package exports
packages/propel/package.json, packages/propel/tsdown.config.ts
Added "./button": "./dist/button/index.js" to package exports and added src/button/index.ts to tsdown build entries.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App as Consumer
  participant Build as Bundler
  participant PropelPkg as @propel package
  participant Runtime as React

  App->>Build: import { Button } from "@propel/button"
  Build->>PropelPkg: resolve exports["./button"]
  PropelPkg-->>Build: ./dist/button/index.js
  Build->>App: bundle Button
  App->>Runtime: render <Button variant="PRIMARY" size="MD" />
  Runtime-->>App: mounted button element
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • prateekshourya29
  • vamsikrishnamathala

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description currently includes only a brief description and a media section but omits several required template sections such as “Type of Change” with checkboxes, “Test Scenarios,” and “References,” and it uses a “Media” heading rather than the template’s “Screenshots and Media” heading, so it does not fully conform to the repository’s description template. Update the PR description to match the repository template by adding a “Type of Change” checklist (marking “Feature”), renaming “Media” to “Screenshots and Media” (with both before and after images if applicable), including a “Test Scenarios” section detailing how the Button component was verified, and adding a “References” section linking any related issues or tickets.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The current title “[WEB-4736] dev: propel button” directly references adding a button to the Propel package, which is the primary change introduced by this PR, so it accurately captures the main focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I stitched a Button, neat and bright,
With tiny hops and variants light.
In stories told I take the stage,
From ghost to bold across the page.
Now exported wide — click, delight! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bbb5b17 and f888dba.

📒 Files selected for processing (2)
  • packages/propel/package.json (1 hunks)
  • packages/propel/tsdown.config.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/propel/package.json
  • packages/propel/tsdown.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Build and lint web apps
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev-propel-button

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@makeplane
Copy link

makeplane bot commented Sep 9, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new Button component to the propel design system package. The implementation includes a React component with multiple variants and sizes, proper TypeScript types, and comprehensive Storybook documentation.

  • Adds a new Button component with 5 variants (primary, secondary, outline, ghost, destructive) and 3 sizes (sm, md, lg)
  • Implements proper TypeScript interfaces and enum types for variant and size options
  • Includes comprehensive Storybook stories demonstrating all variants, sizes, and component states

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/propel/tsdown.config.ts Adds button entry point to build configuration
packages/propel/src/button/index.ts Exports Button component and types
packages/propel/src/button/button.tsx Main Button component implementation with variants and sizes
packages/propel/src/button/button.stories.tsx Storybook stories for all button variants and configurations
packages/propel/package.json Adds button export path to package exports

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
packages/propel/package.json (1)

21-21: Public subpath export added — LGTM.

Optional: consider adding "types" conditions to subpath exports in a follow-up (applied consistently across all entries) for crisper TS resolution.

I can draft a repo-wide export map with { types, import, require } conditions if you want.

packages/propel/src/button/button.tsx (3)

33-47: Type the style maps for exhaustiveness and safer indexing.

Apply this diff:

-const buttonVariants = {
+const buttonVariants: Record<TButtonVariant, string> = {
   [EButtonVariant.PRIMARY]: "bg-custom-primary-100 text-white hover:bg-custom-primary-200 focus:bg-custom-primary-200",
   [EButtonVariant.SECONDARY]:
     "bg-custom-background-100 text-custom-text-200 border border-custom-border-200 hover:bg-custom-background-90 focus:bg-custom-background-90",
   [EButtonVariant.OUTLINE]:
     "border border-custom-primary-100 text-custom-primary-100 bg-transparent hover:bg-custom-primary-100/10 focus:bg-custom-primary-100/20",
   [EButtonVariant.GHOST]: "text-custom-text-200 hover:bg-custom-background-90 focus:bg-custom-background-90",
   [EButtonVariant.DESTRUCTIVE]: "bg-red-500 text-white hover:bg-red-600 focus:bg-red-600",
 };
 
-const buttonSizes = {
+const buttonSizes: Record<TButtonSize, string> = {
   [EButtonSize.SM]: "px-3 py-1.5 text-xs font-medium",
   [EButtonSize.MD]: "px-4 py-2 text-sm font-medium",
   [EButtonSize.LG]: "px-6 py-2.5 text-base font-medium",
 };

26-31: Children can be optional; className is already in ButtonHTMLAttributes.

Apply this diff:

 export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
   variant?: TButtonVariant;
   size?: TButtonSize;
-  className?: string;
-  children: React.ReactNode;
+  // className is already included in the base interface
+  children?: React.ReactNode;
 }

18-25: Reduce duplication in type aliases.

Using the enum type directly simplifies maintenance.

Apply this diff:

-export type TButtonVariant =
-  | EButtonVariant.PRIMARY
-  | EButtonVariant.SECONDARY
-  | EButtonVariant.OUTLINE
-  | EButtonVariant.GHOST
-  | EButtonVariant.DESTRUCTIVE;
-export type TButtonSize = EButtonSize.SM | EButtonSize.MD | EButtonSize.LG;
+export type TButtonVariant = EButtonVariant;
+export type TButtonSize = EButtonSize;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 291101a and bbb5b17.

📒 Files selected for processing (5)
  • packages/propel/package.json (1 hunks)
  • packages/propel/src/button/button.stories.tsx (1 hunks)
  • packages/propel/src/button/button.tsx (1 hunks)
  • packages/propel/src/button/index.ts (1 hunks)
  • packages/propel/tsdown.config.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/propel/src/button/button.tsx (1)
packages/propel/src/button/index.ts (2)
  • ButtonProps (2-2)
  • Button (1-1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Build and lint web apps
🔇 Additional comments (4)
packages/propel/tsdown.config.ts (1)

7-7: Button entry wired into build — LGTM.

Including "src/button/index.ts" ensures the module is bundled and d.ts emitted with the rest.

packages/propel/src/button/button.tsx (1)

33-41: Verify or define destructive design tokens. No custom-danger-* tokens were found—check your Tailwind or design-token config for existing “danger/destructive” colors; if they’re missing, add them and then update the [EButtonVariant.DESTRUCTIVE] entry to use those tokens instead of hardcoded red values.

packages/propel/src/button/button.stories.tsx (2)

26-119: Stories cover variants, sizes, disabled — LGTM.

Good breadth for visual regressions and docs.


1-1: Import path is correct and consistent in packages/propel; no changes needed.

@sriramveeraghanta sriramveeraghanta merged commit b0db4fc into preview Sep 9, 2025
6 of 7 checks passed
@sriramveeraghanta sriramveeraghanta deleted the dev-propel-button branch September 9, 2025 19:04
yarikoptic pushed a commit to yarikoptic/plane that referenced this pull request Oct 1, 2025
* dev: button added to propel

* dev: button story added

* chore: propel config updated

---------

Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants