Skip to content

Commit

Permalink
fix(sbb-mini-button): remove useless base class (#3257)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the `SbbMiniButtonBaseElement` is used only in the `sbb-mini-button-component`, so it can be safely removed to avoid redundant code.
  • Loading branch information
DavideMininni-Fincons authored Nov 27, 2024
1 parent da97f77 commit ce8c318
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/elements/button/mini-button.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './mini-button/mini-button-base-element.js';
export * from './mini-button/mini-button.js';
16 changes: 0 additions & 16 deletions src/elements/button/mini-button/mini-button-base-element.ts

This file was deleted.

17 changes: 13 additions & 4 deletions src/elements/button/mini-button/mini-button.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { CSSResultGroup } from 'lit';
import type { CSSResultGroup, TemplateResult } from 'lit';
import { customElement } from 'lit/decorators.js';

import { SbbDisabledTabIndexActionMixin } from '../../core/mixins.js';
import { SbbButtonBaseElement } from '../../core/base-elements.js';
import { slotState } from '../../core/decorators.js';
import { SbbDisabledTabIndexActionMixin, SbbNegativeMixin } from '../../core/mixins.js';
import { SbbIconNameMixin } from '../../icon.js';

import { SbbMiniButtonBaseElement } from './mini-button-base-element.js';
import style from './mini-button.scss?lit&inline';

/**
Expand All @@ -14,8 +16,15 @@ import style from './mini-button.scss?lit&inline';
*/
export
@customElement('sbb-mini-button')
class SbbMiniButtonElement extends SbbDisabledTabIndexActionMixin(SbbMiniButtonBaseElement) {
@slotState()
class SbbMiniButtonElement extends SbbDisabledTabIndexActionMixin(
SbbNegativeMixin(SbbIconNameMixin(SbbButtonBaseElement)),
) {
public static override styles: CSSResultGroup = style;

protected override renderTemplate(): TemplateResult {
return super.renderIconSlot();
}
}

declare global {
Expand Down

0 comments on commit ce8c318

Please sign in to comment.