-
Notifications
You must be signed in to change notification settings - Fork 907
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
255 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
@forward './internal/elevated-card' show 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,6 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
@forward './internal/filled-card' show 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,6 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
@forward './internal/outlined-card' show 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,26 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {customElement} from 'lit/decorators.js'; | ||
|
||
import {Card} from './internal/card.js'; | ||
import {styles as elevatedStyles} from './internal/elevated-styles.css.js'; | ||
import {styles as sharedStyles} from './internal/shared-styles.css.js'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'md-elevated-card': MdElevatedCard; | ||
} | ||
} | ||
|
||
/** | ||
* @final | ||
* @suppress {visibility} | ||
*/ | ||
@customElement('md-elevated-card') | ||
export class MdElevatedCard extends Card { | ||
static override styles = [sharedStyles, elevatedStyles]; | ||
} |
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,26 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {customElement} from 'lit/decorators.js'; | ||
|
||
import {Card} from './internal/card.js'; | ||
import {styles as filledStyles} from './internal/filled-styles.css.js'; | ||
import {styles as sharedStyles} from './internal/shared-styles.css.js'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'md-filled-card': MdFilledCard; | ||
} | ||
} | ||
|
||
/** | ||
* @final | ||
* @suppress {visibility} | ||
*/ | ||
@customElement('md-filled-card') | ||
export class MdFilledCard extends Card { | ||
static override styles = [sharedStyles, filledStyles]; | ||
} |
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,31 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// go/keep-sorted start | ||
@use 'sass:list'; | ||
// go/keep-sorted end | ||
// go/keep-sorted start | ||
@use '../../../tokens'; | ||
// go/keep-sorted end | ||
|
||
@mixin theme($tokens) { | ||
$supported-tokens: tokens.$md-comp-elevated-card-supported-tokens; | ||
|
||
@each $token, $value in $tokens { | ||
@if list.index($supported-tokens, $token) == null { | ||
@error 'Elevated card `#{$token}` is not a supported token.'; | ||
} | ||
|
||
@if $value { | ||
--md-elevated-card-#{$token}: #{$value}; | ||
} | ||
} | ||
} | ||
|
||
@mixin styles() { | ||
$tokens: tokens.md-comp-elevated-card-values(); | ||
|
||
// TODO(b/261201808): add styles | ||
} |
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,31 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// go/keep-sorted start | ||
@use 'sass:list'; | ||
// go/keep-sorted end | ||
// go/keep-sorted start | ||
@use '../../../tokens'; | ||
// go/keep-sorted end | ||
|
||
@mixin theme($tokens) { | ||
$supported-tokens: tokens.$md-comp-filled-card-supported-tokens; | ||
|
||
@each $token, $value in $tokens { | ||
@if list.index($supported-tokens, $token) == null { | ||
@error 'Filled card `#{$token}` is not a supported token.'; | ||
} | ||
|
||
@if $value { | ||
--md-filled-card-#{$token}: #{$value}; | ||
} | ||
} | ||
} | ||
|
||
@mixin styles() { | ||
$tokens: tokens.md-comp-filled-card-values(); | ||
|
||
// TODO(b/261201808): add styles | ||
} |
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,31 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// go/keep-sorted start | ||
@use 'sass:list'; | ||
// go/keep-sorted end | ||
// go/keep-sorted start | ||
@use '../../../tokens'; | ||
// go/keep-sorted end | ||
|
||
@mixin theme($tokens) { | ||
$supported-tokens: tokens.$md-comp-outlined-card-supported-tokens; | ||
|
||
@each $token, $value in $tokens { | ||
@if list.index($supported-tokens, $token) == null { | ||
@error 'Outlined card `#{$token}` is not a supported token.'; | ||
} | ||
|
||
@if $value { | ||
--md-outlined-card-#{$token}: #{$value}; | ||
} | ||
} | ||
} | ||
|
||
@mixin styles() { | ||
$tokens: tokens.md-comp-outlined-card-values(); | ||
|
||
// TODO(b/261201808): add styles | ||
} |
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,10 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
@mixin styles() { | ||
:host { | ||
display: flex; | ||
} | ||
} |
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,16 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {html, LitElement} from 'lit'; | ||
|
||
/** | ||
* A card component. | ||
*/ | ||
export class Card extends LitElement { | ||
protected override render() { | ||
return html`<slot></slot>`; | ||
} | ||
} |
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,10 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// go/keep-sorted start | ||
@use './elevated-card'; | ||
// go/keep-sorted end | ||
|
||
@include elevated-card.styles; |
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,10 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// go/keep-sorted start | ||
@use './filled-card'; | ||
// go/keep-sorted end | ||
|
||
@include filled-card.styles; |
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,10 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// go/keep-sorted start | ||
@use './outlined-card'; | ||
// go/keep-sorted end | ||
|
||
@include outlined-card.styles; |
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,10 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// go/keep-sorted start | ||
@use './shared'; | ||
// go/keep-sorted end | ||
|
||
@include shared.styles; |
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,26 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {customElement} from 'lit/decorators.js'; | ||
|
||
import {Card} from './internal/card.js'; | ||
import {styles as outlinedStyles} from './internal/outlined-styles.css.js'; | ||
import {styles as sharedStyles} from './internal/shared-styles.css.js'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'md-outlined-card': MdOutlinedCard; | ||
} | ||
} | ||
|
||
/** | ||
* @final | ||
* @suppress {visibility} | ||
*/ | ||
@customElement('md-outlined-card') | ||
export class MdOutlinedCard extends Card { | ||
static override styles = [sharedStyles, outlinedStyles]; | ||
} |