Skip to content
Draft
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
2 changes: 1 addition & 1 deletion button/_elevated-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/elevated-button' show theme;
@forward '../components/button/elevated-button';
2 changes: 1 addition & 1 deletion button/_filled-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/filled-button' show theme;
@forward '../components/button/filled-button';
2 changes: 1 addition & 1 deletion button/_filled-tonal-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/filled-tonal-button' show theme;
@forward '../components/button/filled-tonal-button';
2 changes: 1 addition & 1 deletion button/_outlined-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/outlined-button' show theme;
@forward '../components/button/outlined-button';
2 changes: 1 addition & 1 deletion button/_text-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/text-button' show theme;
@forward '../components/button/text-button';
45 changes: 1 addition & 44 deletions button/elevated-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,4 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResultOrNative} from 'lit';
import {customElement} from 'lit/decorators.js';

import {ElevatedButton} from './internal/elevated-button.js';
import {styles as elevatedStyles} from './internal/elevated-styles.js';
import {styles as sharedElevationStyles} from './internal/shared-elevation-styles.js';
import {styles as sharedStyles} from './internal/shared-styles.js';

declare global {
interface HTMLElementTagNameMap {
'md-elevated-button': MdElevatedButton;
}
}

/**
* @summary Buttons help people take action, such as sending an email, sharing a
* document, or liking a comment.
*
* @description
* __Emphasis:__ Medium emphasis – For important actions that don’t distract
* from other onscreen elements.
*
* __Rationale:__ Elevated buttons are essentially filled buttons with a lighter
* background color and a shadow. To prevent shadow creep, only use them when
* absolutely necessary, such as when the button requires visual separation from
* a patterned background.
*
* __Example usages:__
* - Reply
* - View all
* - Add to cart
* - Take out of trash
*
* @final
* @suppress {visibility}
*/
@customElement('md-elevated-button')
export class MdElevatedButton extends ElevatedButton {
static override styles: CSSResultOrNative[] = [
sharedStyles,
sharedElevationStyles,
elevatedStyles,
];
}
export * from '../components/button/elevated-button.js';
43 changes: 1 addition & 42 deletions button/filled-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,4 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResultOrNative} from 'lit';
import {customElement} from 'lit/decorators.js';

import {FilledButton} from './internal/filled-button.js';
import {styles as filledStyles} from './internal/filled-styles.js';
import {styles as sharedElevationStyles} from './internal/shared-elevation-styles.js';
import {styles as sharedStyles} from './internal/shared-styles.js';

declare global {
interface HTMLElementTagNameMap {
'md-filled-button': MdFilledButton;
}
}

/**
* @summary Buttons help people take action, such as sending an email, sharing a
* document, or liking a comment.
*
* @description
* __Emphasis:__ High emphasis – For the primary, most important, or most common
* action on a screen
*
* __Rationale:__ The filled button’s contrasting surface color makes it the
* most prominent button after the FAB. It’s used for final or unblocking
* actions in a flow.
*
* __Example usages:__
* - Save
* - Confirm
* - Done
*
* @final
* @suppress {visibility}
*/
@customElement('md-filled-button')
export class MdFilledButton extends FilledButton {
static override styles: CSSResultOrNative[] = [
sharedStyles,
sharedElevationStyles,
filledStyles,
];
}
export * from '../components/button/filled-button.js';
44 changes: 1 addition & 43 deletions button/filled-tonal-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,4 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResultOrNative} from 'lit';
import {customElement} from 'lit/decorators.js';

import {FilledTonalButton} from './internal/filled-tonal-button.js';
import {styles as tonalStyles} from './internal/filled-tonal-styles.js';
import {styles as sharedElevationStyles} from './internal/shared-elevation-styles.js';
import {styles as sharedStyles} from './internal/shared-styles.js';

declare global {
interface HTMLElementTagNameMap {
'md-filled-tonal-button': MdFilledTonalButton;
}
}

/**
* @summary Buttons help people take action, such as sending an email, sharing a
* document, or liking a comment.
*
* @description
* __Emphasis:__ Medium emphasis – For important actions that don’t distract
* from other onscreen elements.
*
* __Rationale:__ Filled tonal buttons have a lighter background color and
* darker label color, making them less visually prominent than a regular,
* filled button. They’re still used for final or unblocking actions in a flow,
* but do so with less emphasis.
*
* __Example usages:__
* - Save
* - Confirm
* - Done
*
* @final
* @suppress {visibility}
*/
@customElement('md-filled-tonal-button')
export class MdFilledTonalButton extends FilledTonalButton {
static override styles: CSSResultOrNative[] = [
sharedStyles,
sharedElevationStyles,
tonalStyles,
];
}
export * from '../components/button/filled-tonal-button.js';
14 changes: 1 addition & 13 deletions button/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,4 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {Harness} from '../testing/harness.js';

import {Button} from './internal/button.js';

/**
* Test harness for buttons.
*/
export class ButtonHarness extends Harness<Button> {
protected override async getInteractiveElement() {
await this.element.updateComplete;
return this.element.renderRoot.querySelector('.button') as HTMLElement;
}
}
export * from '../components/button/harness.js';
40 changes: 1 addition & 39 deletions button/outlined-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,4 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResultOrNative} from 'lit';
import {customElement} from 'lit/decorators.js';

import {OutlinedButton} from './internal/outlined-button.js';
import {styles as outlinedStyles} from './internal/outlined-styles.js';
import {styles as sharedStyles} from './internal/shared-styles.js';

declare global {
interface HTMLElementTagNameMap {
'md-outlined-button': MdOutlinedButton;
}
}

/**
* @summary Buttons help people take action, such as sending an email, sharing a
* document, or liking a comment.
*
* @description
* __Emphasis:__ Medium emphasis – For important actions that don’t distract
* from other onscreen elements.
*
* __Rationale:__ Use an outlined button for actions that need attention but
* aren’t the primary action, such as “See all” or “Add to cart.” This is also
* the button to use for giving someone the opportunity to change their mind or
* escape a flow.
*
* __Example usages:__
* - Reply
* - View all
* - Add to cart
* - Take out of trash
*
* @final
* @suppress {visibility}
*/
@customElement('md-outlined-button')
export class MdOutlinedButton extends OutlinedButton {
static override styles: CSSResultOrNative[] = [sharedStyles, outlinedStyles];
}
export * from '../components/button/outlined-button.js';
38 changes: 1 addition & 37 deletions button/text-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,4 @@
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResultOrNative} from 'lit';
import {customElement} from 'lit/decorators.js';

import {styles as sharedStyles} from './internal/shared-styles.js';
import {TextButton} from './internal/text-button.js';
import {styles as textStyles} from './internal/text-styles.js';

declare global {
interface HTMLElementTagNameMap {
'md-text-button': MdTextButton;
}
}

/**
* @summary Buttons help people take action, such as sending an email, sharing a
* document, or liking a comment.
*
* @description
* __Emphasis:__ Low emphasis – For optional or supplementary actions with the
* least amount of prominence
*
* __Rationale:__ Text buttons have less visual prominence, so should be used
* for low emphasis actions, such as an alternative option.
*
* __Example usages:__
* - Learn more
* - View all
* - Change account
* - Turn on
*
* @final
* @suppress {visibility}
*/
@customElement('md-text-button')
export class MdTextButton extends TextButton {
static override styles: CSSResultOrNative[] = [sharedStyles, textStyles];
}
export * from '../components/button/text-button.js';
6 changes: 6 additions & 0 deletions components/button/_elevated-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/elevated-button' show theme;
6 changes: 6 additions & 0 deletions components/button/_filled-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/filled-button' show theme;
6 changes: 6 additions & 0 deletions components/button/_filled-tonal-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/filled-tonal-button' show theme;
6 changes: 6 additions & 0 deletions components/button/_outlined-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/outlined-button' show theme;
6 changes: 6 additions & 0 deletions components/button/_text-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//

@forward './internal/text-button' show theme;
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions components/button/elevated-button.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import {CSSResultOrNative} from 'lit';
import {customElement} from 'lit/decorators.js';

import {ElevatedButton} from './internal/elevated-button.js';
import {styles as elevatedStyles} from './internal/elevated-styles.js';
import {styles as sharedElevationStyles} from './internal/shared-elevation-styles.js';
import {styles as sharedStyles} from './internal/shared-styles.js';

declare global {
interface HTMLElementTagNameMap {
'md-elevated-button': MdElevatedButton;
}
}

/**
* @summary Buttons help people take action, such as sending an email, sharing a
* document, or liking a comment.
*
* @description
* __Emphasis:__ Medium emphasis – For important actions that don’t distract
* from other onscreen elements.
*
* __Rationale:__ Elevated buttons are essentially filled buttons with a lighter
* background color and a shadow. To prevent shadow creep, only use them when
* absolutely necessary, such as when the button requires visual separation from
* a patterned background.
*
* __Example usages:__
* - Reply
* - View all
* - Add to cart
* - Take out of trash
*
* @final
* @suppress {visibility}
*/
@customElement('md-elevated-button')
export class MdElevatedButton extends ElevatedButton {
static override styles: CSSResultOrNative[] = [
sharedStyles,
sharedElevationStyles,
elevatedStyles,
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// import 'jasmine'; (google3-only)

import {createTokenTests} from '../testing/tokens.js';
import {createTokenTests} from '../../testing/tokens.js';

import {MdElevatedButton} from './elevated-button.js';

Expand Down
Loading
Loading