Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vwc-top-app-bar): alternate #1087

Merged
merged 20 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion components/top-app-bar-fixed/src/vwc-top-app-bar-fixed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import '@vonage/vvd-core';
import { customElement } from 'lit-element';
import { customElement, property } from 'lit-element';
import { observer } from '@material/mwc-base/observer';
import { TopAppBarFixedBase as MWCTopAppBarFixedBase } from '@material/mwc-top-app-bar-fixed/mwc-top-app-bar-fixed-base.js';
import { styles as MWCTopAppBarStyles } from '@material/mwc-top-app-bar/mwc-top-app-bar.css.js';
import { style as VWCTopAppBarStyle } from '@vonage/vwc-top-app-bar/vwc-top-app-bar.css.js';
Expand All @@ -15,5 +16,15 @@ declare global {
*/
@customElement('vwc-top-app-bar-fixed')
export class VWCTopAppBarFixed extends MWCTopAppBarFixedBase {
@property({ type: Boolean })
@observer(function (this: VWCTopAppBarFixed, newVal: boolean) {
if (newVal) {
this.mdcRoot.setAttribute('part', 'vvd-scheme-alternate');
} else {
this.mdcRoot.removeAttribute('part');
}
})
alternate = false;

static override styles = [MWCTopAppBarStyles, VWCTopAppBarStyle];
}
37 changes: 18 additions & 19 deletions components/top-app-bar-fixed/stories/arg-types.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
const control = {
type: 'inline-radio',
options: { true: '', false: undefined },
};

export const argTypes = {
centerTitle: {
control: {
type: 'inline-radio',
options: { true: '', false: undefined },
},
},
dense: {
control: {
type: 'inline-radio',
options: { true: '', false: undefined },
},
},
prominent: {
control: {
type: 'inline-radio',
options: { true: '', false: undefined },
},
},
styles: { table: { disable: true } },
centerTitle: {
control
},
dense: {
control
},
alternate: {
control
},
prominent: {
control
},
styles: { table: { disable: true } },
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export default {

const Template = (args) => html`
<vwc-top-app-bar-fixed ...=${spread(args)}>
<vwc-icon-button slot="navigationIcon" icon="menu-line" layout="filled"></vwc-icon-button>
<vwc-icon-button slot="navigationIcon" icon="menu-line"></vwc-icon-button>
<span slot="title">Top App Bar</span>

<vwc-icon-button slot="actionItems" icon="twitter-mono" layout="filled"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="facebook-mono" layout="filled"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="heart-solid" layout="filled"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="twitter-mono"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="facebook-mono"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="heart-solid"></vwc-icon-button>
<span slot="actionItems">Toggle theme:</span>
<vwc-theme-switch slot="actionItems"></vwc-theme-switch>

Expand All @@ -37,3 +37,6 @@ export const Default = Template.bind({});

export const Dense = Template.bind({});
Dense.args = { dense: '' };

export const Alternate = Template.bind({});
Alternate.args = { alternate: true };
37 changes: 18 additions & 19 deletions components/top-app-bar/stories/arg-types.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
const control = {
type: 'inline-radio',
options: { true: '', false: undefined },
};

export const argTypes = {
centerTitle: {
control: {
type: 'inline-radio',
options: { true: '', false: undefined },
},
},
dense: {
control: {
type: 'inline-radio',
options: { true: '', false: undefined },
},
},
prominent: {
control: {
type: 'inline-radio',
options: { true: '', false: undefined },
},
},
styles: { table: { disable: true } },
centerTitle: {
control
},
dense: {
control
},
alternate: {
control
},
prominent: {
control
},
styles: { table: { disable: true } },
};
11 changes: 7 additions & 4 deletions components/top-app-bar/stories/top-app-bar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export default {

const Template = (args) => html`
<vwc-top-app-bar ...=${spread(args)}>
<vwc-icon-button slot="navigationIcon" icon="menu-line" layout="filled"></vwc-icon-button>
<vwc-icon-button slot="navigationIcon" icon="menu-line"></vwc-icon-button>
<span slot="title">Top App Bar</span>

<vwc-icon-button slot="actionItems" icon="twitter-mono" layout="filled"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="facebook-mono" layout="filled"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="heart-solid" layout="filled"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="twitter-mono"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="facebook-mono"></vwc-icon-button>
<vwc-icon-button slot="actionItems" icon="heart-solid"></vwc-icon-button>
<span slot="actionItems">Toggle theme:</span>
<vwc-theme-switch slot="actionItems"></vwc-theme-switch>

Expand All @@ -37,3 +37,6 @@ export const Default = Template.bind({});

export const Dense = Template.bind({});
Dense.args = { dense: '' };

export const Alternate = Template.bind({});
Alternate.args = { alternate: true };
Binary file modified ui-tests/snapshots/vwc-elevation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.