From a0af8d37e1975013ccc5f9c084979734c48316e7 Mon Sep 17 00:00:00 2001 From: Tommmaso Menga Date: Wed, 24 Jul 2024 11:59:54 +0200 Subject: [PATCH] feat(sbb-mini-button-group): move to `sbb-button` module --- src/elements/button.ts | 1 + src/elements/{ => button}/mini-button-group.ts | 0 .../mini-button-group.snapshot.spec.snap.js | 0 src/elements/{ => button}/mini-button-group/index.ts | 0 .../mini-button-group/mini-button-group.scss | 2 +- .../mini-button-group.snapshot.spec.ts | 6 +++--- .../mini-button-group/mini-button-group.spec.ts | 8 ++++---- .../mini-button-group/mini-button-group.ssr.spec.ts | 6 +++--- .../mini-button-group/mini-button-group.stories.ts | 8 ++++---- .../mini-button-group/mini-button-group.ts | 6 +++--- .../mini-button-group/mini-button-group.visual.spec.ts | 10 +++++++--- src/elements/{ => button}/mini-button-group/readme.md | 0 12 files changed, 26 insertions(+), 21 deletions(-) rename src/elements/{ => button}/mini-button-group.ts (100%) rename src/elements/{ => button}/mini-button-group/__snapshots__/mini-button-group.snapshot.spec.snap.js (100%) rename src/elements/{ => button}/mini-button-group/index.ts (100%) rename src/elements/{ => button}/mini-button-group/mini-button-group.scss (97%) rename src/elements/{ => button}/mini-button-group/mini-button-group.snapshot.spec.ts (91%) rename src/elements/{ => button}/mini-button-group/mini-button-group.spec.ts (82%) rename src/elements/{ => button}/mini-button-group/mini-button-group.ssr.spec.ts (85%) rename src/elements/{ => button}/mini-button-group/mini-button-group.stories.ts (91%) rename src/elements/{ => button}/mini-button-group/mini-button-group.ts (89%) rename src/elements/{ => button}/mini-button-group/mini-button-group.visual.spec.ts (87%) rename src/elements/{ => button}/mini-button-group/readme.md (100%) diff --git a/src/elements/button.ts b/src/elements/button.ts index 0ee7b4877f..aca4df253d 100644 --- a/src/elements/button.ts +++ b/src/elements/button.ts @@ -3,6 +3,7 @@ export * from './button/secondary-button.js'; export * from './button/tertiary-button.js'; export * from './button/transparent-button.js'; export * from './button/mini-button.js'; +export * from './button/mini-button-group.js'; export * from './button/button-link.js'; export * from './button/secondary-button-link.js'; export * from './button/tertiary-button-link.js'; diff --git a/src/elements/mini-button-group.ts b/src/elements/button/mini-button-group.ts similarity index 100% rename from src/elements/mini-button-group.ts rename to src/elements/button/mini-button-group.ts diff --git a/src/elements/mini-button-group/__snapshots__/mini-button-group.snapshot.spec.snap.js b/src/elements/button/mini-button-group/__snapshots__/mini-button-group.snapshot.spec.snap.js similarity index 100% rename from src/elements/mini-button-group/__snapshots__/mini-button-group.snapshot.spec.snap.js rename to src/elements/button/mini-button-group/__snapshots__/mini-button-group.snapshot.spec.snap.js diff --git a/src/elements/mini-button-group/index.ts b/src/elements/button/mini-button-group/index.ts similarity index 100% rename from src/elements/mini-button-group/index.ts rename to src/elements/button/mini-button-group/index.ts diff --git a/src/elements/mini-button-group/mini-button-group.scss b/src/elements/button/mini-button-group/mini-button-group.scss similarity index 97% rename from src/elements/mini-button-group/mini-button-group.scss rename to src/elements/button/mini-button-group/mini-button-group.scss index 61fa222deb..4d31696572 100644 --- a/src/elements/mini-button-group/mini-button-group.scss +++ b/src/elements/button/mini-button-group/mini-button-group.scss @@ -1,4 +1,4 @@ -@use '../core/styles' as sbb; +@use '../../core/styles/index' as sbb; // Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component. @include sbb.box-sizing; diff --git a/src/elements/mini-button-group/mini-button-group.snapshot.spec.ts b/src/elements/button/mini-button-group/mini-button-group.snapshot.spec.ts similarity index 91% rename from src/elements/mini-button-group/mini-button-group.snapshot.spec.ts rename to src/elements/button/mini-button-group/mini-button-group.snapshot.spec.ts index 51c4a2c18b..520e4ef14c 100644 --- a/src/elements/mini-button-group/mini-button-group.snapshot.spec.ts +++ b/src/elements/button/mini-button-group/mini-button-group.snapshot.spec.ts @@ -1,12 +1,12 @@ import { expect } from '@open-wc/testing'; import { html } from 'lit/static-html.js'; -import { fixture, testA11yTreeSnapshot } from '../core/testing/private.js'; +import { fixture, testA11yTreeSnapshot } from '../../core/testing/private.js'; import type { SbbMiniButtonGroupElement } from './mini-button-group.js'; import './mini-button-group.js'; -import '../button/mini-button.js'; -import '../divider/divider.js'; +import '../mini-button.js'; +import '../../divider/divider.js'; describe(`sbb-mini-button-group`, () => { describe('renders', () => { diff --git a/src/elements/mini-button-group/mini-button-group.spec.ts b/src/elements/button/mini-button-group/mini-button-group.spec.ts similarity index 82% rename from src/elements/mini-button-group/mini-button-group.spec.ts rename to src/elements/button/mini-button-group/mini-button-group.spec.ts index d47ade61cb..fa78e7bdd1 100644 --- a/src/elements/mini-button-group/mini-button-group.spec.ts +++ b/src/elements/button/mini-button-group/mini-button-group.spec.ts @@ -1,12 +1,12 @@ import { assert, expect } from '@open-wc/testing'; import { html } from 'lit/static-html.js'; -import { fixture } from '../core/testing/private.js'; -import { waitForLitRender } from '../core/testing/wait-for-render.js'; +import { fixture } from '../../core/testing/private.js'; +import { waitForLitRender } from '../../core/testing/wait-for-render.js'; import { SbbMiniButtonGroupElement } from './mini-button-group.js'; -import '../button/mini-button.js'; -import '../divider/divider.js'; +import '../mini-button.js'; +import '../../divider/divider.js'; describe('sbb-mini-button-group', () => { let element: SbbMiniButtonGroupElement; diff --git a/src/elements/mini-button-group/mini-button-group.ssr.spec.ts b/src/elements/button/mini-button-group/mini-button-group.ssr.spec.ts similarity index 85% rename from src/elements/mini-button-group/mini-button-group.ssr.spec.ts rename to src/elements/button/mini-button-group/mini-button-group.ssr.spec.ts index 17bb770c3f..e93d930c8d 100644 --- a/src/elements/mini-button-group/mini-button-group.ssr.spec.ts +++ b/src/elements/button/mini-button-group/mini-button-group.ssr.spec.ts @@ -1,11 +1,11 @@ import { assert } from '@open-wc/testing'; import { html } from 'lit/static-html.js'; -import { ssrHydratedFixture } from '../core/testing/private.js'; +import { ssrHydratedFixture } from '../../core/testing/private.js'; import { SbbMiniButtonGroupElement } from './mini-button-group.js'; -import '../button/mini-button.js'; -import '../divider/divider.js'; +import '../mini-button.js'; +import '../../divider/divider.js'; describe(`sbb-mini-button-group ssr`, () => { let root: SbbMiniButtonGroupElement; diff --git a/src/elements/mini-button-group/mini-button-group.stories.ts b/src/elements/button/mini-button-group/mini-button-group.stories.ts similarity index 91% rename from src/elements/mini-button-group/mini-button-group.stories.ts rename to src/elements/button/mini-button-group/mini-button-group.stories.ts index ea5eeecdbe..25234983c6 100644 --- a/src/elements/mini-button-group/mini-button-group.stories.ts +++ b/src/elements/button/mini-button-group/mini-button-group.stories.ts @@ -11,12 +11,12 @@ import type { import type { TemplateResult } from 'lit'; import { html } from 'lit'; -import { sbbSpread } from '../../storybook/helpers/spread.js'; +import { sbbSpread } from '../../../storybook/helpers/spread.js'; import readme from './readme.md?raw'; import './mini-button-group.js'; -import '../button/mini-button.js'; -import '../divider/divider.js'; +import '../mini-button.js'; +import '../../divider/divider.js'; const size: InputType = { control: { @@ -84,7 +84,7 @@ const meta: Meta = { extractComponentDescription: () => readme, }, }, - title: 'elements/sbb-mini-button-group', + title: 'elements/sbb-button/sbb-mini-button-group', }; export default meta; diff --git a/src/elements/mini-button-group/mini-button-group.ts b/src/elements/button/mini-button-group/mini-button-group.ts similarity index 89% rename from src/elements/mini-button-group/mini-button-group.ts rename to src/elements/button/mini-button-group/mini-button-group.ts index a7dbc1a4fd..4ff5c4f76e 100644 --- a/src/elements/mini-button-group/mini-button-group.ts +++ b/src/elements/button/mini-button-group/mini-button-group.ts @@ -2,9 +2,9 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit'; import { html, LitElement } from 'lit'; import { customElement, property } from 'lit/decorators.js'; -import type { SbbMiniButtonElement } from '../button/mini-button/mini-button.js'; -import { SbbNamedSlotListMixin, SbbNegativeMixin } from '../core/mixins.js'; -import type { SbbDividerElement } from '../divider/divider.js'; +import { SbbNamedSlotListMixin, SbbNegativeMixin } from '../../core/mixins.js'; +import type { SbbDividerElement } from '../../divider/divider.js'; +import type { SbbMiniButtonElement } from '../mini-button/mini-button.js'; import style from './mini-button-group.scss?lit&inline'; diff --git a/src/elements/mini-button-group/mini-button-group.visual.spec.ts b/src/elements/button/mini-button-group/mini-button-group.visual.spec.ts similarity index 87% rename from src/elements/mini-button-group/mini-button-group.visual.spec.ts rename to src/elements/button/mini-button-group/mini-button-group.visual.spec.ts index 082ca44a79..6156d077a5 100644 --- a/src/elements/mini-button-group/mini-button-group.visual.spec.ts +++ b/src/elements/button/mini-button-group/mini-button-group.visual.spec.ts @@ -1,10 +1,14 @@ import { html, nothing, type TemplateResult } from 'lit'; -import { describeViewports, visualDiffDefault, visualDiffFocus } from '../core/testing/private.js'; +import { + describeViewports, + visualDiffDefault, + visualDiffFocus, +} from '../../core/testing/private.js'; import './mini-button-group.js'; -import '../button/mini-button.js'; -import '../divider/divider.js'; +import '../mini-button.js'; +import '../../divider/divider.js'; describe('sbb-mini-button-group', () => { const sizeCases = ['s', 'm', 'l', 'xl']; diff --git a/src/elements/mini-button-group/readme.md b/src/elements/button/mini-button-group/readme.md similarity index 100% rename from src/elements/mini-button-group/readme.md rename to src/elements/button/mini-button-group/readme.md