Skip to content

WEBDEV-8503 Migrate ia-button to elements#56

Open
rebecca-shoptaw wants to merge 9 commits into
mainfrom
webdev-8503-migrate-ia-button-to-elements
Open

WEBDEV-8503 Migrate ia-button to elements#56
rebecca-shoptaw wants to merge 9 commits into
mainfrom
webdev-8503-migrate-ia-button-to-elements

Conversation

@rebecca-shoptaw
Copy link
Copy Markdown
Collaborator

Moves the ia-button component from Offshoot into Elements. It's mostly a simple copy-paste, with the only big difference being switching from using parent-applied classes for styling, to using a property called mode, i.e. <ia-button class="primary"> -> <ia-button mode="primary">

Also renames the CSS variables to match our new conventions and creates a set of theme variables where needed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

PR Preview Action v1.8.1

🚀 View preview at
https://internetarchive.github.io/elements/pr/pr-56/

Built to branch ghpages at 2026-05-29 17:17 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

describe('IA button', () => {
test('renders a basic button', async () => {
const el = await fixture<IAButton>(html`<ia-button>Click me</ia-button>`);
const el = await fixture<IAButton>(html`<ia-button>Submit</ia-button>`);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This test file copied verbatim from Offshoot

`;
}

/** Sets up or removes button type emulation as needed */
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This entire block of additions (form emulation) also copied verbatim from Offshoot and doesn't need a re-review

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2026

Codecov Report

❌ Patch coverage is 58.62069% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.77%. Comparing base (bb9c6de) to head (5d5b562).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/elements/ia-button/ia-button.ts 58.62% 10 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #56      +/-   ##
==========================================
+ Coverage   78.75%   78.77%   +0.01%     
==========================================
  Files          16       16              
  Lines         645      688      +43     
  Branches      168      186      +18     
==========================================
+ Hits          508      542      +34     
- Misses         95      100       +5     
- Partials       42       46       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@latonv latonv left a comment

Choose a reason for hiding this comment

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

LGTM, nice migration! Spotted one possible typo.

Comment on lines +17 to +27
radioOptions: [
'primary',
'secondary',
'danger',
'warning',
'disabled',
'transparent',
'custom',
'link',
'danger-link',
],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we could use a "dropdown menu" input type at some point :)

},
{
label: 'Background color (custom)',
cssVariable: '--ia-button-custom-text-color',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be --ia-button-custom-fill?

>
${this.loading ? this.loadingStateTemplate : html`<slot></slot>`}
</button>
<slot name="hidden-btn"></slot>
Copy link
Copy Markdown
Member

@latonv latonv May 30, 2026

Choose a reason for hiding this comment

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

Ah, one other typo I just spotted -- slot is named hidden-btn here but the input has slot="hidden-button" below.

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.

3 participants