Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(checkbox): refactor checkbox component #409

Merged
merged 20 commits into from
Oct 31, 2023
Merged

Conversation

samrichardsontylertech
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added/updated: Y
  • Docs have been added/updated: Y
  • Does this PR introduce a breaking change? Y
  • I have linked any related GitHub issues to be closed when this PR is merged? Y

Describe the new behavior?

Removed Material dependencies from the checkbox component, added a toggle method, added tokens and new animations, set up element internals, refined the base form interface/class and forwarding/reflection utilities, and fixed related bugs around the state layer, focus indicator, and switch components.

Closes #370

@stackblitz
Copy link

stackblitz bot commented Oct 14, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions bot added the minor Increment the minor version when merged label Oct 14, 2023
src/dev/pages/switch/switch.ejs Outdated Show resolved Hide resolved
src/dev/pages/switch/switch.ejs Show resolved Hide resolved
src/dev/pages/switch/switch.ts Outdated Show resolved Hide resolved
src/lib/core/styles/tokens/checkbox/_tokens.scss Outdated Show resolved Hide resolved
src/lib/core/styles/tokens/checkbox/_tokens.scss Outdated Show resolved Hide resolved
src/lib/checkbox/checkbox-foundation.ts Show resolved Hide resolved
src/lib/checkbox/checkbox.test.ts Outdated Show resolved Hide resolved
src/lib/checkbox/checkbox.test.ts Outdated Show resolved Hide resolved
src/lib/checkbox/checkbox.scss Show resolved Hide resolved
src/lib/checkbox/checkbox-foundation.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@DRiFTy17 DRiFTy17 left a comment

Choose a reason for hiding this comment

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

Things are looking good, just a couple questions/comments:

When a slotted <input> is used, can we have it automatically add the slot="input" attribute when initializing the adapter if one doesn't exist? This makes it easier to use, but on top of that we can improve performance because it can immediately initialize against the slotted <input> instead as well regardless:

const slottedInput = this._component.querySelector('input[type=checkbox]:not([slot])') as HTMLInputElement;
 if (slottedInput) {
   slottedInput.slot = 'input';
 }

Additionally, I know you're probably waiting until the end, but we should update the delegate as well included tests for anything that is missing to improve coverage.

src/lib/core/styles/tokens/checkbox/_tokens.scss Outdated Show resolved Hide resolved
src/lib/checkbox/checkbox.scss Outdated Show resolved Hide resolved
src/lib/checkbox/checkbox.scss Show resolved Hide resolved
src/lib/checkbox/checkbox.html Outdated Show resolved Hide resolved
src/lib/checkbox/checkbox.html Outdated Show resolved Hide resolved
@samrichardsontylertech samrichardsontylertech merged commit 3ae5c0f into next Oct 31, 2023
6 checks passed
@samrichardsontylertech samrichardsontylertech deleted the checkbox-next branch October 31, 2023 19:51
Copy link
Contributor

🚀 PR was released in v3.0.0-next.13 🚀

@github-actions github-actions bot added the prerelease This change relates to a prerelease. label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged @next prerelease This change relates to a prerelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants