Skip to content

FE-647: Add button component#8687

Merged
alex-e-leon merged 33 commits into
mainfrom
FE-647-ds-button-component
May 11, 2026
Merged

FE-647: Add button component#8687
alex-e-leon merged 33 commits into
mainfrom
FE-647-ds-button-component

Conversation

@alex-e-leon
Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

  • Adds Button component to the DS.
  • Adds a new loading spinner variation to be used in Button.
  • Updates Button usage in petrinaut to match the new api.

There are more custom buttons in petrinaut that we can port over to this new Button - including all IconButtons, but I'll do that in a follow up PR to keep the PR size more manageable.

I'll also be looking to do a design review with CiaranH. Depending on the discussion there may be follow on updates.

🔗 Related links

Designs

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 11, 2026 2:53pm
hashdotdesign-tokens Ready Ready Preview, Comment May 11, 2026 2:53pm
petrinaut Ready Ready Preview, Comment May 11, 2026 2:53pm

@cursor
Copy link
Copy Markdown

cursor Bot commented May 1, 2026

PR Summary

Medium Risk
Introduces a brand-new Button implementation (new prop API, styling recipe, and anchor support) and propagates the API changes across Petrinaut UI, which could cause broad UI/interaction regressions if any edge-cases were missed.

Overview
Adds a new design-system Button component built on a slot recipe, supporting new variant/tone combinations, pressed/loading states, optional icon APIs (iconName or prefix/suffix), and rendering as either <button> or <a>.

Extends sizing across the DS with a new xxs size (tokens + formInputSizes), adds xxs support to Icon and LoadingSpinner, and introduces a new LoadingSpinner visual variant (bars) used by the Button loading state.

Updates Ladle stories (Button/Tooltip/LoadingSpinner) and migrates Petrinaut button usages from the legacy variant/colorScheme API to the new variant/tone + prefix/suffix props; also adjusts Turbo codegen outputs and exports LoadingSpinnerVariant from main.ts.

Reviewed by Cursor Bugbot for commit abc9787. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps > hash.design Affects the `hash.design` design site (app) area/infra Relates to version control, CI, CD or IaC (area) labels May 1, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 1, 2026

🤖 Augment PR Summary

Summary: This PR introduces a new Design System Button component with an updated API and styling system, and updates Petrinaut usage to match.

Changes:

  • Added a new Panda sva-based button recipe (button.recipe.ts) defining size/variant/tone/shape + state styling (loading/pressed/disabled, icon-only, etc.).
  • Replaced the legacy Button implementation with a new component supporting both <button> and <a> rendering, plus a new icon API (iconName / prefix/suffix).
  • Added a new LoadingSpinner visual variant (bars) and updated spinner recipe/stories to demo variants and dark backgrounds.
  • Updated Ladle stories for the Button to reflect the new variants/tones/sizes and demonstrate icons, shapes, loading, pressed, and disabled states.
  • Exported LoadingSpinnerVariant from the ds-components package entrypoint.
  • Adjusted multiple Petrinaut call sites to the new Button API (variant/tone + prefix/suffix icon props where applicable).
  • Updated turbo.json to ensure the fix task depends on codegen in ds-components.

Technical Notes: The new Button relies on recipe-driven slot classes and uses an overlay approach for loading state (spinner + hidden content) to preserve layout while busy.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread libs/@hashintel/ds-components/src/components/Button/button.tsx
Comment thread libs/@hashintel/ds-components/src/components/Button/button.tsx Outdated
Comment thread libs/@hashintel/ds-components/src/components/Button/button.tsx Outdated
Comment thread libs/@hashintel/ds-components/src/components/Button/button.tsx
Comment thread libs/@hashintel/petrinaut/src/views/Editor/panels/SimulateView/simulate-view.tsx Outdated
Comment thread libs/@hashintel/ds-components/src/components/Button/button.recipe.ts Outdated
Comment thread libs/@hashintel/ds-components/src/components/Button/button.tsx Outdated
Comment thread libs/@hashintel/ds-components/src/components/Button/button.recipe.ts Outdated
lunelson
lunelson previously approved these changes May 11, 2026
@alex-e-leon alex-e-leon added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
@alex-e-leon alex-e-leon added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
@alex-e-leon alex-e-leon added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
@alex-e-leon alex-e-leon added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
lunelson
lunelson previously approved these changes May 11, 2026
@alex-e-leon alex-e-leon added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
@alex-e-leon alex-e-leon added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
@alex-e-leon alex-e-leon added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit 926f9fa May 11, 2026
44 checks passed
@alex-e-leon alex-e-leon deleted the FE-647-ds-button-component branch May 11, 2026 15:25
@hashdotai hashdotai mentioned this pull request May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

3 participants