From da97f779108e94e49853ab0ee2e8ea4a24783fa7 Mon Sep 17 00:00:00 2001 From: Lukas Spirig Date: Wed, 27 Nov 2024 16:29:02 +0100 Subject: [PATCH 1/2] build: define scss api configuration (#3258) This should facilitate the Vite 6 upgrade. --- vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vite.config.ts b/vite.config.ts index c30f0df392..7ce13e4f86 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,6 +11,7 @@ export default defineConfig({ scss: { // https://vitejs.dev/config/shared-options#css-preprocessoroptions // TODO: api: 'modern', + api: 'legacy', silenceDeprecations: ['legacy-js-api'], }, }, From ce8c31817facb2dbbfcc0214d3e7553b3d8caf1c Mon Sep 17 00:00:00 2001 From: Davide Mininni <101575400+DavideMininni-Fincons@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:42:10 +0100 Subject: [PATCH 2/2] fix(sbb-mini-button): remove useless base class (#3257) BREAKING CHANGE: the `SbbMiniButtonBaseElement` is used only in the `sbb-mini-button-component`, so it can be safely removed to avoid redundant code. --- src/elements/button/mini-button.ts | 1 - .../mini-button/mini-button-base-element.ts | 16 ---------------- src/elements/button/mini-button/mini-button.ts | 17 +++++++++++++---- 3 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 src/elements/button/mini-button/mini-button-base-element.ts diff --git a/src/elements/button/mini-button.ts b/src/elements/button/mini-button.ts index 379817a955..65b7e88ef6 100644 --- a/src/elements/button/mini-button.ts +++ b/src/elements/button/mini-button.ts @@ -1,2 +1 @@ -export * from './mini-button/mini-button-base-element.js'; export * from './mini-button/mini-button.js'; diff --git a/src/elements/button/mini-button/mini-button-base-element.ts b/src/elements/button/mini-button/mini-button-base-element.ts deleted file mode 100644 index 31a57fda41..0000000000 --- a/src/elements/button/mini-button/mini-button-base-element.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { TemplateResult } from 'lit'; - -import { SbbButtonBaseElement } from '../../core/base-elements.js'; -import { slotState } from '../../core/decorators.js'; -import { SbbNegativeMixin } from '../../core/mixins.js'; -import { SbbIconNameMixin } from '../../icon.js'; - -export -@slotState() -abstract class SbbMiniButtonBaseElement extends SbbNegativeMixin( - SbbIconNameMixin(SbbButtonBaseElement), -) { - protected override renderTemplate(): TemplateResult { - return super.renderIconSlot(); - } -} diff --git a/src/elements/button/mini-button/mini-button.ts b/src/elements/button/mini-button/mini-button.ts index c4ce6c4f71..04c07518a3 100644 --- a/src/elements/button/mini-button/mini-button.ts +++ b/src/elements/button/mini-button/mini-button.ts @@ -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'; /** @@ -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 {