Skip to content

Commit dcfd35a

Browse files
asyncLizcopybara-github
authored andcommitted
chore(card): add boilerplate files
PiperOrigin-RevId: 576646068
1 parent 2a06b29 commit dcfd35a

12 files changed

+186
-0
lines changed

labs/card/elevated-card.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @license
3+
* Copyright 2023 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import {customElement} from 'lit/decorators.js';
8+
9+
import {Card} from './internal/card.js';
10+
import {styles as elevatedStyles} from './internal/elevated-styles.css.js';
11+
import {styles as sharedStyles} from './internal/shared-styles.css.js';
12+
13+
declare global {
14+
interface HTMLElementTagNameMap {
15+
'md-elevated-card': MdElevatedCard;
16+
}
17+
}
18+
19+
/**
20+
* @final
21+
* @suppress {visibility}
22+
*/
23+
@customElement('md-elevated-card')
24+
export class MdElevatedCard extends Card {
25+
static override styles = [sharedStyles, elevatedStyles];
26+
}

labs/card/filled-card.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @license
3+
* Copyright 2023 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import {customElement} from 'lit/decorators.js';
8+
9+
import {Card} from './internal/card.js';
10+
import {styles as filledStyles} from './internal/filled-styles.css.js';
11+
import {styles as sharedStyles} from './internal/shared-styles.css.js';
12+
13+
declare global {
14+
interface HTMLElementTagNameMap {
15+
'md-filled-card': MdFilledCard;
16+
}
17+
}
18+
19+
/**
20+
* @final
21+
* @suppress {visibility}
22+
*/
23+
@customElement('md-filled-card')
24+
export class MdFilledCard extends Card {
25+
static override styles = [sharedStyles, filledStyles];
26+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// Copyright 2023 Google LLC
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
// go/keep-sorted start
7+
@use '../../../tokens';
8+
// go/keep-sorted end
9+
10+
@mixin styles() {
11+
$tokens: tokens.md-comp-elevated-card-values();
12+
13+
// TODO(b/261201808): add styles
14+
}

labs/card/internal/_filled-card.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// Copyright 2023 Google LLC
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
// go/keep-sorted start
7+
@use '../../../tokens';
8+
// go/keep-sorted end
9+
10+
@mixin styles() {
11+
$tokens: tokens.md-comp-filled-card-values();
12+
13+
// TODO(b/261201808): add styles
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//
2+
// Copyright 2023 Google LLC
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
// go/keep-sorted start
7+
@use '../../../tokens';
8+
// go/keep-sorted end
9+
10+
@mixin styles() {
11+
$tokens: tokens.md-comp-outlined-card-values();
12+
13+
// TODO(b/261201808): add styles
14+
}

labs/card/internal/_shared.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Copyright 2023 Google LLC
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
@mixin styles() {
7+
:host {
8+
display: flex;
9+
}
10+
}

labs/card/internal/card.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @license
3+
* Copyright 2023 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import {html, LitElement} from 'lit';
8+
9+
/**
10+
* A card component.
11+
*/
12+
export class Card extends LitElement {
13+
protected override render() {
14+
return html`<slot></slot>`;
15+
}
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Copyright 2023 Google LLC
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
// go/keep-sorted start
7+
@use './elevated-card';
8+
// go/keep-sorted end
9+
10+
@include elevated-card.styles;

labs/card/internal/filled-styles.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Copyright 2023 Google LLC
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
// go/keep-sorted start
7+
@use './filled-card';
8+
// go/keep-sorted end
9+
10+
@include filled-card.styles;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Copyright 2023 Google LLC
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
// go/keep-sorted start
7+
@use './outlined-card';
8+
// go/keep-sorted end
9+
10+
@include outlined-card.styles;

0 commit comments

Comments
 (0)