-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f4a842
commit 37b53a1
Showing
11 changed files
with
354 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2023 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
|
||
import { LitElement, html, css } from 'lit'; | ||
import { customElement } from 'lit/decorators.js'; | ||
|
||
@customElement('plugin-action-bar') | ||
export class PluginActionBar extends LitElement { | ||
static styles = css` | ||
sp-action-group { | ||
padding: 8px; | ||
} | ||
`; | ||
|
||
render() { | ||
return html` | ||
<action-bar> | ||
<sp-action-group> | ||
<sp-action-button quiet> | ||
<sp-icon-play slot="icon"></sp-icon-play> | ||
</sp-action-button> | ||
<sp-action-button quiet> | ||
<sp-icon-edit slot="icon"></sp-icon-edit> | ||
</sp-action-button> | ||
<sp-action-button quiet> | ||
<sp-icon-refresh slot="icon"></sp-icon-refresh> | ||
</sp-action-button> | ||
</sp-action-group> | ||
<sp-divider size="s" vertical></sp-divider> | ||
<sp-action-group> | ||
<sp-action-button quiet> | ||
<sp-icon-share slot="icon"></sp-icon-share> | ||
</sp-action-button> | ||
</sp-action-group> | ||
<sp-divider size="s" vertical></sp-divider> | ||
<sp-action-group> | ||
<sp-action-button quiet> | ||
<sp-icon-real-time-customer-profile slot="icon"></sp-icon-real-time-customer-profile> | ||
</sp-action-button> | ||
</sp-action-group> | ||
</action-bar> | ||
`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright 2023 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
|
||
/* eslint-disable wc/no-constructor-params, wc/guard-super-call */ | ||
|
||
import { html, LitElement } from 'lit'; | ||
import { customElement } from 'lit/decorators.js'; | ||
|
||
@customElement('theme-wrapper') | ||
export class ThemeWrapper extends LitElement { | ||
static properties = { | ||
theme: { type: String }, | ||
}; | ||
|
||
constructor() { | ||
super(); | ||
this.theme = 'light'; | ||
} | ||
|
||
async connectedCallback() { | ||
super.connectedCallback(); | ||
|
||
this.getTheme(); | ||
|
||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', this.onChange); | ||
} | ||
|
||
onChange = () => { | ||
this.getTheme(); | ||
}; | ||
|
||
disconnectedCallback() { | ||
super.disconnectedCallback(); | ||
|
||
window.matchMedia('(prefers-color-scheme: dark)').removeEventListener('change', this.onChange); | ||
} | ||
|
||
getTheme() { | ||
this.theme = window.matchMedia('(prefers-color-scheme: dark)').matches | ||
? 'dark' | ||
: 'light'; | ||
} | ||
|
||
render() { | ||
return html` | ||
<sp-theme | ||
theme="express" | ||
color=${this.theme === 'dark' ? 'dark' : 'light'} | ||
scale="medium" | ||
> | ||
<slot></slot> | ||
</sp-theme> | ||
`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2023 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
|
||
import { css } from 'lit'; | ||
|
||
export const style = css` | ||
:host { | ||
position: fixed; | ||
height: 100%; | ||
width: 100%; | ||
pointer-events: none; | ||
z-index: 9999; | ||
} | ||
:host([open='true']) { | ||
display: block; | ||
} | ||
:host([open='false']) { | ||
display: none; | ||
} | ||
action-bar { | ||
position: absolute; | ||
left: 50%; | ||
transform: translate(-50%, 0px); | ||
bottom: 150px; | ||
pointer-events: auto; | ||
} | ||
action-bar sp-action-group { | ||
padding: 8px; | ||
} | ||
action-bar sp-action-group span { | ||
padding-bottom: 3px; | ||
padding-left: 8px; | ||
margin: 0; | ||
display: flex; | ||
align-items: center; | ||
} | ||
`; |
Oops, something went wrong.