Skip to content

feat: add swc-ai-button to the AI toolkit (WIP demo) - #6731

Draft
rubencarvalho wants to merge 2 commits into
mainfrom
rcarvalho/feat-ai-button-ai-toolkit
Draft

rubencarvalho wants to merge 2 commits into
mainfrom
rcarvalho/feat-ai-button-ai-toolkit

Conversation

@rubencarvalho

Copy link
Copy Markdown
Contributor

WIP / demonstration only — opened for review of the approach, not ready to merge.

Adds a branded AI action button pattern under patterns/ai-toolkit/ai-button, extending the core ButtonBase.

What's here

  • swc-ai-button element: sizes s/m/l/xl, optional slotted label, always-on sparkle icon (icon-only renders a circle and requires accessible-label).
  • Branded treatment built the same way as swc-prompt-field: a brand-relative OKLCH gradient wash + inset gloss dome, driven by the --swc-ai-button-brand-color custom property (override it to retint — no attribute).
  • Ambient glow with eased hover and pressed states; disabled has no glow/press.
  • Storybook stories + per-unit MDX docs page.
  • Shared SparkleIcon added to the toolkit icon utils.

Notes / open questions

  • The design-token gradient stops it references don't exist in this repo, so the resolved stop colors are inlined as brand-relative OKLCH (marked with a ponytail: comment). Worth deciding whether these should become real tokens.
  • Light/dark are unified into one structure via light-dark() rather than separate blend-mode layers.
  • Next: make the button react to mouse proximity/angle (glass/glow/reflection border).

🤖 Generated with Claude Code

WIP demonstration. Adds a branded AI action button pattern under
patterns/ai-toolkit/ai-button, extending the core ButtonBase:

- sizes s/m/l/xl, optional slotted label, always-on sparkle icon
- brand-relative OKLCH gradient wash + inset gloss; retint via the
  --swc-ai-button-brand-color custom property
- ambient glow with hover/press states
- stories + docs page

Adds a shared SparkleIcon to the toolkit icon utils.
@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 373f4cb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Track the pointer on the window (rAF-throttled) and write proximity +
position custom properties. A masked border-ring reflection lights the
edge nearest the cursor, and the ambient glow and wash scale with
proximity; hovering is just proximity = 1. Disabled suppresses it.
@github-actions

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6731

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant