diff --git a/web-components/package.json b/web-components/package.json index 38ef6c8c4..fb78bc11b 100644 --- a/web-components/package.json +++ b/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@momentum-ui/web-components", - "version": "2.16.10", + "version": "2.16.11", "author": "Yana Harris", "license": "MIT", "repository": "https://github.com/momentum-design/momentum-ui.git", diff --git a/web-components/src/[sandbox]/examples/tabs.ts b/web-components/src/[sandbox]/examples/tabs.ts index 1df8cb35a..6c6a78cae 100644 --- a/web-components/src/[sandbox]/examples/tabs.ts +++ b/web-components/src/[sandbox]/examples/tabs.ts @@ -514,69 +514,72 @@ export class TabsTemplateSandbox extends LitElement { `} -

Allows the tab index to be changed programmatically without requiring a mouse click event on the tab item

- this.handleTabIndexChange()}> - Programmatically change tab index - -
- - - Consult - - - - -
-
-

Alan Johnson

-

1234434

+

+ Allows the tab index to be changed programmatically without requiring a mouse click event on the tab item +

+ this.handleTabIndexChange()}> + Programmatically change tab index + +
+ + + Consult + + + + +
+
+

Alan Johnson

+

1234434

+
-
- - -
-
-

Mark Corrigan

-

43454334

+ + +
+
+

Mark Corrigan

+

43454334

+
-
- - - - - Transfer - - - - -
-
-

Jermey Usborne

-

83498347

+ + + + + Transfer + + + + +
+
+

Jermey Usborne

+

83498347

+
-
- - -
-
-

Sophie Chapman

-

22384758

+ + +
+
+

Sophie Chapman

+

22384758

+
-
- - - - -
-
- -
- Close Tab Confirmation + + + +
-

Are you sure you want to close the Tab?

- Cancel - Confirm -
+
+ +
+ Close Tab Confirmation +
+

Are you sure you want to close the Tab?

+ Cancel + Confirm +
+
`; } diff --git a/web-components/src/[sandbox]/sandbox.scss b/web-components/src/[sandbox]/sandbox.scss index b042dd53f..874d1b4b0 100644 --- a/web-components/src/[sandbox]/sandbox.scss +++ b/web-components/src/[sandbox]/sandbox.scss @@ -1,3 +1,28 @@ +md-theme { + background-color: white; + color: var(--md-primary-text-color); + + &.is-visual-rebrand { + background: url("/images/brand-visuals/backgrounds/operation-pop-background-light.png"); + background-repeat: no-repeat; + background-position: center; + background-size: cover; + } +} + + +md-theme[darkTheme] { + background-color: black; + color: var(--md-primary-text-color); + + &.is-visual-rebrand { + background: url("/images/brand-visuals/backgrounds/operation-pop-background-light.png"); + background-repeat: no-repeat; + background-position: center; + background-size: cover; + } +} + .container { box-sizing: border-box; height: calc(100vh - 1.75rem); @@ -5,7 +30,7 @@ overflow-y: auto; padding: 1rem; width: 100%; - background: var(--md-primary-bg-color); + background: var(--md-glass-bg-color); } .container-color-bg-color-options { diff --git a/web-components/src/[sandbox]/sandbox.ts b/web-components/src/[sandbox]/sandbox.ts index a18b00be3..5a777c911 100644 --- a/web-components/src/[sandbox]/sandbox.ts +++ b/web-components/src/[sandbox]/sandbox.ts @@ -5,6 +5,7 @@ import { themeManager } from "@/managers/ThemeManager"; import reset from "@/wc_scss/reset.scss"; import { MobxLitElement } from "@adobe/lit-mobx"; import { customElement, html, internalProperty, PropertyValues, TemplateResult } from "lit-element"; +import { classMap } from "lit-html/directives/class-map"; import { accordionTemplate, advanceListTemplate, @@ -86,17 +87,6 @@ export class Sandbox extends MobxLitElement { this.selectedTab = tab; } - protected updated(changedProperties: PropertyValues) { - super.updated(changedProperties); - if (themeManager.isDarkMode) { - document.body.style.backgroundColor = "#000"; - document.body.style.color = "#fff"; - } else { - document.body.style.backgroundColor = "#fff"; - document.body.style.color = "#000"; - } - } - protected firstUpdated(_changedProperties: PropertyValues): void { super.firstUpdated(_changedProperties); } @@ -111,6 +101,11 @@ export class Sandbox extends MobxLitElement { if (storedDarkTheme) { themeManager.setDarkMode(JSON.parse(storedDarkTheme)); } + + const storedVisualRebrand = localStorage.getItem("is-visual-rebrand-enabled"); + if (storedVisualRebrand) { + themeManager.setVisualRebrandEnabled(JSON.parse(storedVisualRebrand)); + } } toggleSetting(event: MouseEvent) { @@ -129,6 +124,11 @@ export class Sandbox extends MobxLitElement { } } + toggleVisualRebrandEnabled() { + themeManager.setVisualRebrandEnabled(!themeManager.isVisualRebrandEnabled); + localStorage.setItem("is-visual-rebrand-enabled", JSON.stringify(themeManager.isVisualRebrandEnabled)); + } + themeToggle() { return html`
@@ -176,6 +176,17 @@ export class Sandbox extends MobxLitElement { /> MomentumV2 +
`; } @@ -185,10 +196,10 @@ export class Sandbox extends MobxLitElement {