-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
91 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 './lib/suggestion-chip' 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,35 @@ | ||
// | ||
// Copyright 2023 Google LLC | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
// go/keep-sorted start | ||
@use '../../sass/shape'; | ||
@use '../../sass/theme'; | ||
@use '../../tokens'; | ||
@use './shared'; | ||
// go/keep-sorted end | ||
|
||
@mixin theme($tokens) { | ||
$tokens: theme.validate-theme( | ||
shared.resolve-tokens(tokens.md-comp-suggestion-chip-values()), | ||
shared.resolve-tokens($tokens) | ||
); | ||
$tokens: theme.create-theme-vars($tokens, 'suggestion-chip'); | ||
$tokens: shape.resolve-tokens($tokens, 'container-shape'); | ||
|
||
@include theme.emit-theme-vars($tokens); | ||
} | ||
|
||
@mixin styles() { | ||
$tokens: tokens.md-comp-suggestion-chip-values(); | ||
$tokens: shared.resolve-tokens($tokens); | ||
$tokens: theme.create-theme-vars($tokens, 'suggestion-chip'); | ||
$tokens: shape.resolve-tokens($tokens, 'container-shape'); | ||
|
||
:host { | ||
@each $token, $value in $tokens { | ||
--_#{$token}: #{$value}; | ||
} | ||
} | ||
} |
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,12 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {Chip} from './chip.js'; | ||
|
||
/** | ||
* A suggestion chip component. | ||
*/ | ||
export class SuggestionChip extends Chip {} |
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 './suggestion-chip'; | ||
// go/keep-sorted end | ||
|
||
@include suggestion-chip.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,28 @@ | ||
/** | ||
* @license | ||
* Copyright 2023 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {customElement} from 'lit/decorators.js'; | ||
|
||
import {styles as sharedStyles} from './lib/shared-styles.css.js'; | ||
import {SuggestionChip} from './lib/suggestion-chip.js'; | ||
import {styles} from './lib/suggestion-styles.css.js'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'md-suggestion-chip': MdSuggestionChip; | ||
} | ||
} | ||
|
||
/** | ||
* TODO(b/243982145): add docs | ||
* | ||
* @final | ||
* @suppress {visibility} | ||
*/ | ||
@customElement('md-suggestion-chip') | ||
export class MdSuggestionChip extends SuggestionChip { | ||
static override styles = [sharedStyles, styles]; | ||
} |