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(design): move each button type to its own component #3328

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

xelaint
Copy link
Member

@xelaint xelaint commented Nov 1, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Fixes: #3196

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@xelaint xelaint added the package: design @daffodil/design label Nov 1, 2024
@xelaint xelaint requested a review from damienwebdev November 1, 2024 03:31
@xelaint xelaint requested review from a team as code owners November 1, 2024 03:31
@xelaint xelaint added the status: awaiting review This PR is awaiting review label Nov 2, 2024
@xelaint
Copy link
Member Author

xelaint commented Nov 7, 2024

@damienwebdev The @if for prefix and suffix works, but the issue with splitting the components up is that DAFF_BUTTON_COMPONENTS, handles exporting the DaffPrefixSuffixModule so that the usage component doesn't have to import it.

Since each component example is only importing the specific button type (i.e. DaffFlatButtonComponent), the DaffPrefixSuffixModule import here doesn't actually work.

@Component({
  // eslint-disable-next-line @angular-eslint/component-selector
  selector: '' +
    'button[daff-flat-button]' + ',' +
    'a[daff-flat-button]',
  templateUrl: '../button-base.component.html',
  styleUrl: './flat.component.scss',
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
  standalone: true,
  imports: [
    DaffPrefixSuffixModule,
    DAFF_LOADING_ICON_COMPONENTS,
  ],
})

@damienwebdev
Copy link
Member

@xelaint I think that's perfectly fine. While the prefix suffix code is tiny, we still don't want to encourage people to import code they don't use. If they want to use prefix and suffix, they can import it.

Copy link
Member

@damienwebdev damienwebdev left a comment

Choose a reason for hiding this comment

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

lgtm

@damienwebdev damienwebdev merged commit 0af779d into develop Nov 12, 2024
13 checks passed
@damienwebdev damienwebdev deleted the button-refactor branch November 12, 2024 17:05
@gray-bot gray-bot mentioned this pull request Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: design @daffodil/design status: awaiting review This PR is awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Refactor Button Component
2 participants