Skip to content

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Sep 9, 2025

Description

This PR introduces the toolbar component in propel.

Media

Media
media

Summary by CodeRabbit

  • New Features
    • Added a Pill UI component for inline labels/badges with multiple variants (default, primary, success, warning, error, info) and sizes (small, medium, large). Supports numbers/symbols and forwards standard span attributes.
  • Documentation
    • Introduced Storybook stories showcasing default usage, all variants and sizes, composite demos (e.g., status groups), and numeric content.
  • Chores
    • Exposed the Pill component in the package entry points and build, enabling direct import from the library.

@makeplane
Copy link

makeplane bot commented Sep 9, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 2025

Walkthrough

Adds a new Pill UI component with variants and sizes, exposes it via a new ./pill export and barrel, includes Storybook stories, and updates the build config to bundle the new entry.

Changes

Cohort / File(s) Summary
Packaging & Exports
packages/propel/package.json, packages/propel/tsdown.config.ts
Added "./pill": "./dist/pill/index.js" to exports and included src/pill/index.ts in build entries.
Pill Component
packages/propel/src/pill/pill.tsx, packages/propel/src/pill/index.ts
Introduced Pill React component with EPillVariant, EPillSize, types, default props, and re-exports from barrel.
Storybook
packages/propel/src/pill/pill.stories.tsx
Added stories for variants, sizes, and composite examples; configured meta and controls.

Sequence Diagram(s)

sequenceDiagram
  actor Dev as Developer
  participant App as App Code
  participant Propel as @propel/pill
  participant Pill as Pill Component
  participant DOM as Browser DOM
  participant Util as cn()

  Dev->>App: import { Pill } from "@propel/pill"
  App->>Propel: Resolve export "./pill"
  Propel-->>App: dist/pill/index.js
  App->>Pill: <Pill variant size className>children</Pill>
  Pill->>Util: cn(base, variantClass, sizeClass, className)
  Util-->>Pill: merged class string
  Pill->>DOM: render <span> with classes and children
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

🌟enhancement

Suggested reviewers

  • vamsikrishnamathala

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The current description incorrectly refers to a “toolbar” component rather than the Pill component, and it omits required sections from the repository’s template, including Type of Change, Test Scenarios, and References. Revise the description to accurately describe the Pill component work, add the Type of Change section with the appropriate feature checkbox, include Test Scenarios detailing how the new Pill was verified, add a References section for related tickets, and use the “Screenshots and Media” heading to match the template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “[WEB-4737] dev: propel pill component” directly identifies the main change—adding the Pill component to Propel—and is concise and specific to the primary work in the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

A hop and a skip, I craft a Pill,
Variants lined, sizes fit the bill.
Stories sprout in a garden of UI,
Exports mapped—oh my, oh my!
Build burrows widened, neat and still—
Ship it, nibble, test at will. 🐇✨

✨ 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-pill-component

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.

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 Pill component to the propel design system. The component provides a flexible way to display small status indicators or labels with different visual variants and sizes.

  • Added a reusable Pill component with variant and size customization options
  • Included comprehensive Storybook stories demonstrating all variants and use cases
  • Updated build configuration and package exports to include the new component

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 Added pill component to build configuration
packages/propel/src/pill/pill.tsx Implemented main Pill component with variants and sizes
packages/propel/src/pill/pill.stories.tsx Created comprehensive Storybook stories for component documentation
packages/propel/src/pill/index.ts Added component exports
packages/propel/package.json Updated package exports to include pill component

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: 0

🧹 Nitpick comments (5)
packages/propel/src/pill/pill.tsx (2)

35-48: Type the lookup tables to catch missing keys at compile-time.

Add explicit Record typings for stronger safety.

-const pillVariants = {
+const pillVariants: Record<TPillVariant, string> = {
   [EPillVariant.DEFAULT]: "bg-custom-background-90 text-custom-text-200 border border-custom-border-200",
   [EPillVariant.PRIMARY]: "bg-custom-primary-100/10 text-custom-primary-100 border border-custom-primary-100/20",
   [EPillVariant.SUCCESS]: "bg-green-50 text-green-700 border border-green-200",
   [EPillVariant.WARNING]: "bg-amber-50 text-amber-700 border border-amber-200",
   [EPillVariant.ERROR]: "bg-red-50 text-red-700 border border-red-200",
   [EPillVariant.INFO]: "bg-blue-50 text-blue-700 border border-blue-200",
 };
 
-const pillSizes = {
+const pillSizes: Record<TPillSize, string> = {
   [EPillSize.SM]: "px-2 py-0.5 text-xs",
   [EPillSize.MD]: "px-2.5 py-1 text-sm",
   [EPillSize.LG]: "px-3 py-1.5 text-base",
 };

55-61: Consider using class-variance-authority for variants/sizes.

You already depend on cva; adopting it here would align with other components and centralize defaults.

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

53-58: Rename the Error story to avoid shadowing the global Error.

Prevents linter complaints and accidental confusion.

-export const Error: Story = {
+export const ErrorVariant: Story = {
   args: {
     variant: EPillVariant.ERROR,
     children: "Error",
   },
 };

4-21: Stronger typing with satisfies Meta<typeof Pill>.

This narrows meta without over-constraining.

-const meta: Meta<typeof Pill> = {
+const meta = {
   title: "Components/Pill",
   component: Pill,
   parameters: {
     layout: "centered",
   },
   tags: ["autodocs"],
   argTypes: {
     variant: {
       control: "select",
       options: Object.values(EPillVariant),
     },
     size: {
       control: "select",
       options: Object.values(EPillSize),
     },
   },
-};
+} satisfies Meta<typeof Pill>;
packages/propel/src/pill/index.ts (1)

1-2: Export enums and helper types from the barrel for a complete public API.

Consumers will likely import variants/sizes; re-export them here.

-export { Pill } from "./pill";
-export type { PillProps } from "./pill";
+export { Pill, EPillVariant, EPillSize } from "./pill";
+export type { PillProps, TPillVariant, TPillSize } from "./pill";
📜 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 5215f82.

📒 Files selected for processing (5)
  • packages/propel/package.json (1 hunks)
  • packages/propel/src/pill/index.ts (1 hunks)
  • packages/propel/src/pill/pill.stories.tsx (1 hunks)
  • packages/propel/src/pill/pill.tsx (1 hunks)
  • packages/propel/tsdown.config.ts (1 hunks)
🧰 Additional context used
🪛 Biome (2.1.2)
packages/propel/src/pill/pill.stories.tsx

[error] 53-53: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

⏰ 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: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
packages/propel/package.json (2)

29-29: Export wired correctly for the new entry.

The subpath export "./pill" points to the built entry and matches tsdown’s new entry. LGTM.


29-29: Confirm TS type resolution for subpath.

If your TS version is <5.3, consider adding types mapping (typesVersions or per-export "types") so @plane/propel/pill resolves dist/pill/index.d.ts. Otherwise, no action.

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

50-68: Solid, idiomatic forwardRef implementation.

Defaults, class merging, and prop passthrough look good.

packages/propel/src/pill/pill.stories.tsx (1)

1-1: Verify Storybook types import path.

Most setups import types from @storybook/react even with the Vite builder; if this repo standardizes on @storybook/react-vite for types, keep it. Otherwise consider switching for consistency.

packages/propel/tsdown.config.ts (1)

15-15: Build entry added — good.

Including src/pill/index.ts ensures JS and DTS emission for the new subpath.

@sriramveeraghanta sriramveeraghanta merged commit 1c8ac3d into preview Sep 9, 2025
7 of 8 checks passed
@sriramveeraghanta sriramveeraghanta deleted the dev-propel-pill-component branch September 9, 2025 18:45
yarikoptic pushed a commit to yarikoptic/plane that referenced this pull request Oct 1, 2025
* dev: pill component added to propel

* dev: pill story added

* chore: propel config updated

* chore: code refactor
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