diff --git a/.github/ISSUE_TEMPLATE/contributing-request.yml b/.github/ISSUE_TEMPLATE/contributing-request.yml
index 91d66e3630..8f69342294 100644
--- a/.github/ISSUE_TEMPLATE/contributing-request.yml
+++ b/.github/ISSUE_TEMPLATE/contributing-request.yml
@@ -60,7 +60,7 @@ body:
label: Please describe the required properties (with type and value) for the component
value: |
Example:
- variant (string): "primary" | "secondary" | "tertiary" | "transparent"
+ variant (string): "primary" | "secondary" | "accent" | "transparent"
size (string): "s" | "m" | "l"
- type: textarea
id: markup-proposal
diff --git a/src/elements/button.ts b/src/elements/button.ts
index aca4df253d..e899e62b99 100644
--- a/src/elements/button.ts
+++ b/src/elements/button.ts
@@ -1,15 +1,15 @@
export * from './button/button.js';
export * from './button/secondary-button.js';
-export * from './button/tertiary-button.js';
+export * from './button/accent-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';
+export * from './button/accent-button-link.js';
export * from './button/transparent-button-link.js';
export * from './button/button-static.js';
export * from './button/secondary-button-static.js';
-export * from './button/tertiary-button-static.js';
+export * from './button/accent-button-static.js';
export * from './button/transparent-button-static.js';
export * from './button/common.js';
diff --git a/src/elements/button/accent-button-link.ts b/src/elements/button/accent-button-link.ts
new file mode 100644
index 0000000000..9be40bfac8
--- /dev/null
+++ b/src/elements/button/accent-button-link.ts
@@ -0,0 +1 @@
+export * from './accent-button-link/accent-button-link.js';
diff --git a/src/elements/button/accent-button-link/__snapshots__/accent-button-link.snapshot.spec.snap.js b/src/elements/button/accent-button-link/__snapshots__/accent-button-link.snapshot.spec.snap.js
new file mode 100644
index 0000000000..112ba3d906
--- /dev/null
+++ b/src/elements/button/accent-button-link/__snapshots__/accent-button-link.snapshot.spec.snap.js
@@ -0,0 +1,114 @@
+/* @web/test-runner snapshot v1 */
+export const snapshots = {};
+
+snapshots["sbb-accent-button-link renders a sbb-accent-button-link without icon DOM"] =
+`
+ { + "role": "WebArea", + "name": "", + "children": [ + { + "role": "link", + "name": "Label Text . Link target opens in a new window." + } + ] +} +
+`; +/* end snapshot sbb-accent-button-link renders a sbb-accent-button-link without icon A11y tree Chrome */ + +snapshots["sbb-accent-button-link renders a sbb-accent-button-link without icon A11y tree Firefox"] = +`+ { + "role": "document", + "name": "", + "children": [ + { + "role": "link", + "name": "Label Text . Link target opens in a new window.", + "value": "https://www.sbb.ch/" + } + ] +} +
+`; +/* end snapshot sbb-accent-button-link renders a sbb-accent-button-link without icon A11y tree Firefox */ + diff --git a/src/elements/button/tertiary-button-link/tertiary-button-link.snapshot.spec.ts b/src/elements/button/accent-button-link/accent-button-link.snapshot.spec.ts similarity index 57% rename from src/elements/button/tertiary-button-link/tertiary-button-link.snapshot.spec.ts rename to src/elements/button/accent-button-link/accent-button-link.snapshot.spec.ts index d828680071..8483cde953 100644 --- a/src/elements/button/tertiary-button-link/tertiary-button-link.snapshot.spec.ts +++ b/src/elements/button/accent-button-link/accent-button-link.snapshot.spec.ts @@ -3,15 +3,15 @@ import { expect } from '@open-wc/testing'; import { fixture, testA11yTreeSnapshot } from '../../core/testing/private.js'; import { buttonLinkIconTestTemplate, buttonLinkTestTemplate } from '../common/button-test-utils.js'; -import type { SbbTertiaryButtonLinkElement } from './tertiary-button-link.js'; -import './tertiary-button-link.js'; +import type { SbbAccentButtonLinkElement } from './accent-button-link.js'; +import './accent-button-link.js'; -describe(`sbb-tertiary-button-link`, () => { - let element: SbbTertiaryButtonLinkElement; +describe(`sbb-accent-button-link`, () => { + let element: SbbAccentButtonLinkElement; - describe('renders a sbb-tertiary-button-link without icon', async () => { + describe('renders a sbb-accent-button-link without icon', async () => { beforeEach(async () => { - element = await fixture(buttonLinkTestTemplate('sbb-tertiary-button-link')); + element = await fixture(buttonLinkTestTemplate('sbb-accent-button-link')); }); it('DOM', async () => { @@ -25,9 +25,9 @@ describe(`sbb-tertiary-button-link`, () => { testA11yTreeSnapshot(); }); - describe('renders a disabled sbb-tertiary-button-link with slotted icon', async () => { + describe('renders a disabled sbb-accent-button-link with slotted icon', async () => { beforeEach(async () => { - element = await fixture(buttonLinkIconTestTemplate('sbb-tertiary-button-link')); + element = await fixture(buttonLinkIconTestTemplate('sbb-accent-button-link')); }); it('DOM', async () => { diff --git a/src/elements/button/accent-button-link/accent-button-link.ssr.spec.ts b/src/elements/button/accent-button-link/accent-button-link.ssr.spec.ts new file mode 100644 index 0000000000..7cf1e9f6ed --- /dev/null +++ b/src/elements/button/accent-button-link/accent-button-link.ssr.spec.ts @@ -0,0 +1,20 @@ +import { assert } from '@open-wc/testing'; +import { html } from 'lit'; + +import { ssrHydratedFixture } from '../../core/testing/private.js'; + +import { SbbAccentButtonLinkElement } from './accent-button-link.js'; + +describe(`sbb-accent-button-link ssr`, () => { + let root: SbbAccentButtonLinkElement; + + beforeEach(async () => { + root = await ssrHydratedFixture(html`+ { + "role": "WebArea", + "name": "", + "children": [ + { + "role": "text", + "name": "Label Text" + } + ] +} +
+`; +/* end snapshot sbb-accent-button-static renders with slotted icon A11y tree Chrome */ + +snapshots["sbb-accent-button-static renders with slotted icon A11y tree Firefox"] = +`+ { + "role": "document", + "name": "", + "children": [ + { + "role": "text leaf", + "name": "Label Text " + } + ] +} +
+`; +/* end snapshot sbb-accent-button-static renders with slotted icon A11y tree Firefox */ + diff --git a/src/elements/button/tertiary-button-static/tertiary-button-static.snapshot.spec.ts b/src/elements/button/accent-button-static/accent-button-static.snapshot.spec.ts similarity index 73% rename from src/elements/button/tertiary-button-static/tertiary-button-static.snapshot.spec.ts rename to src/elements/button/accent-button-static/accent-button-static.snapshot.spec.ts index 07d6f2e682..d7ccadf0e4 100644 --- a/src/elements/button/tertiary-button-static/tertiary-button-static.snapshot.spec.ts +++ b/src/elements/button/accent-button-static/accent-button-static.snapshot.spec.ts @@ -3,16 +3,16 @@ import { expect } from '@open-wc/testing'; import { fixture, testA11yTreeSnapshot } from '../../core/testing/private.js'; import { buttonSlottedIconTestTemplate, buttonTestTemplate } from '../common/button-test-utils.js'; -import type { SbbTertiaryButtonStaticElement } from './tertiary-button-static.js'; +import type { SbbAccentButtonStaticElement } from './accent-button-static.js'; -import './tertiary-button-static.js'; +import './accent-button-static.js'; -describe(`sbb-tertiary-button-static`, () => { - let element: SbbTertiaryButtonStaticElement; +describe(`sbb-accent-button-static`, () => { + let element: SbbAccentButtonStaticElement; describe('renders without icon', async () => { beforeEach(async () => { - element = await fixture(buttonTestTemplate('sbb-tertiary-button-static', true)); + element = await fixture(buttonTestTemplate('sbb-accent-button-static', true)); }); it('DOM', async () => { @@ -26,7 +26,7 @@ describe(`sbb-tertiary-button-static`, () => { describe('renders with slotted icon', async () => { beforeEach(async () => { - element = await fixture(buttonSlottedIconTestTemplate('sbb-tertiary-button-static')); + element = await fixture(buttonSlottedIconTestTemplate('sbb-accent-button-static')); }); it('DOM', async () => { diff --git a/src/elements/button/tertiary-button-static/tertiary-button-static.spec.ts b/src/elements/button/accent-button-static/accent-button-static.spec.ts similarity index 61% rename from src/elements/button/tertiary-button-static/tertiary-button-static.spec.ts rename to src/elements/button/accent-button-static/accent-button-static.spec.ts index be675e0236..6a861e7802 100644 --- a/src/elements/button/tertiary-button-static/tertiary-button-static.spec.ts +++ b/src/elements/button/accent-button-static/accent-button-static.spec.ts @@ -5,18 +5,18 @@ import { buttonIconTestTemplate, buttonSpaceIconTestTemplate, } from '../common/button-test-utils.js'; -import './tertiary-button-static.js'; +import './accent-button-static.js'; -describe(`sbb-tertiary-button-static`, () => { - it('should detect icon in sbb-tertiary-button-static', async () => { - const root = await fixture(buttonIconTestTemplate('sbb-tertiary-button-static')); +describe(`sbb-accent-button-static`, () => { + it('should detect icon in sbb-accent-button-static', async () => { + const root = await fixture(buttonIconTestTemplate('sbb-accent-button-static')); const dataSlots = root.getAttribute('data-slot-names'); expect(dataSlots).to.contain('icon'); expect(dataSlots).not.to.contain('unnamed'); }); - it('should detect icon in sbb-tertiary-button-static when there is space around icon', async () => { - const root = await fixture(buttonSpaceIconTestTemplate('sbb-tertiary-button-static')); + it('should detect icon in sbb-accent-button-static when there is space around icon', async () => { + const root = await fixture(buttonSpaceIconTestTemplate('sbb-accent-button-static')); const dataSlots = root.getAttribute('data-slot-names'); expect(dataSlots).to.contain('icon'); expect(dataSlots).not.to.contain('unnamed'); diff --git a/src/elements/button/accent-button-static/accent-button-static.ssr.spec.ts b/src/elements/button/accent-button-static/accent-button-static.ssr.spec.ts new file mode 100644 index 0000000000..6ae0ea69a8 --- /dev/null +++ b/src/elements/button/accent-button-static/accent-button-static.ssr.spec.ts @@ -0,0 +1,23 @@ +import { assert } from '@open-wc/testing'; +import { html } from 'lit'; + +import { ssrHydratedFixture } from '../../core/testing/private.js'; + +import { SbbAccentButtonStaticElement } from './accent-button-static.js'; + +describe(`sbb-accent-button-static ssr`, () => { + let root: SbbAccentButtonStaticElement; + + beforeEach(async () => { + root = await ssrHydratedFixture( + html`+ { + "role": "WebArea", + "name": "", + "children": [ + { + "role": "button", + "name": "Label Text" + } + ] +} +
+`; +/* end snapshot sbb-accent-button renders a sbb-accent-button with slotted icon A11y tree Chrome */ + +snapshots["sbb-accent-button renders a sbb-accent-button with slotted icon A11y tree Firefox"] = +`+ { + "role": "document", + "name": "", + "children": [ + { + "role": "button", + "name": "Label Text" + } + ] +} +
+`; +/* end snapshot sbb-accent-button renders a sbb-accent-button with slotted icon A11y tree Firefox */ + diff --git a/src/elements/button/tertiary-button/tertiary-button.snapshot.spec.ts b/src/elements/button/accent-button/accent-button.snapshot.spec.ts similarity index 65% rename from src/elements/button/tertiary-button/tertiary-button.snapshot.spec.ts rename to src/elements/button/accent-button/accent-button.snapshot.spec.ts index 4c2d3b6d99..6041b44507 100644 --- a/src/elements/button/tertiary-button/tertiary-button.snapshot.spec.ts +++ b/src/elements/button/accent-button/accent-button.snapshot.spec.ts @@ -3,15 +3,15 @@ import { expect } from '@open-wc/testing'; import { fixture, testA11yTreeSnapshot } from '../../core/testing/private.js'; import { buttonSlottedIconTestTemplate, buttonTestTemplate } from '../common/button-test-utils.js'; -import type { SbbTertiaryButtonElement } from './tertiary-button.js'; -import './tertiary-button.js'; +import type { SbbAccentButtonElement } from './accent-button.js'; +import './accent-button.js'; -describe(`sbb-tertiary-button`, () => { - let element: SbbTertiaryButtonElement; +describe(`sbb-accent-button`, () => { + let element: SbbAccentButtonElement; - describe('renders a sbb-tertiary-button without icon', async () => { + describe('renders a sbb-accent-button without icon', async () => { beforeEach(async () => { - element = await fixture(buttonTestTemplate('sbb-tertiary-button')); + element = await fixture(buttonTestTemplate('sbb-accent-button')); }); it('DOM', async () => { @@ -23,9 +23,9 @@ describe(`sbb-tertiary-button`, () => { }); }); - describe('renders a sbb-tertiary-button with slotted icon', async () => { + describe('renders a sbb-accent-button with slotted icon', async () => { beforeEach(async () => { - element = await fixture(buttonSlottedIconTestTemplate('sbb-tertiary-button')); + element = await fixture(buttonSlottedIconTestTemplate('sbb-accent-button')); }); it('DOM', async () => { diff --git a/src/elements/button/tertiary-button/tertiary-button.spec.ts b/src/elements/button/accent-button/accent-button.spec.ts similarity index 64% rename from src/elements/button/tertiary-button/tertiary-button.spec.ts rename to src/elements/button/accent-button/accent-button.spec.ts index 8c3131bbe7..2d24fe8fa7 100644 --- a/src/elements/button/tertiary-button/tertiary-button.spec.ts +++ b/src/elements/button/accent-button/accent-button.spec.ts @@ -6,18 +6,18 @@ import { buttonSpaceIconTestTemplate, } from '../common/button-test-utils.js'; -import './tertiary-button.js'; +import './accent-button.js'; -describe(`sbb-tertiary-button`, () => { - it('should detect icon in sbb-tertiary-button', async () => { - const root = await fixture(buttonIconTestTemplate('sbb-tertiary-button')); +describe(`sbb-accent-button`, () => { + it('should detect icon in sbb-accent-button', async () => { + const root = await fixture(buttonIconTestTemplate('sbb-accent-button')); const dataSlots = root.getAttribute('data-slot-names'); expect(dataSlots).to.contain('icon'); expect(dataSlots).not.to.contain('unnamed'); }); - it('should detect icon in sbb-tertiary-button when there is space around icon', async () => { - const root = await fixture(buttonSpaceIconTestTemplate('sbb-tertiary-button')); + it('should detect icon in sbb-accent-button when there is space around icon', async () => { + const root = await fixture(buttonSpaceIconTestTemplate('sbb-accent-button')); const dataSlots = root.getAttribute('data-slot-names'); expect(dataSlots).to.contain('icon'); expect(dataSlots).not.to.contain('unnamed'); diff --git a/src/elements/button/accent-button/accent-button.ssr.spec.ts b/src/elements/button/accent-button/accent-button.ssr.spec.ts new file mode 100644 index 0000000000..cef6d6515f --- /dev/null +++ b/src/elements/button/accent-button/accent-button.ssr.spec.ts @@ -0,0 +1,20 @@ +import { assert } from '@open-wc/testing'; +import { html } from 'lit'; + +import { ssrHydratedFixture } from '../../core/testing/private.js'; + +import { SbbAccentButtonElement } from './accent-button.js'; + +describe(`sbb-accent-button ssr`, () => { + let root: SbbAccentButtonElement; + + beforeEach(async () => { + root = await ssrHydratedFixture(html`