-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vwc-circular-progress): added connotation support (#694)
* feat(vwc-circular-progress): added connotation support * fixing the color comparator - adding stroke property for the cured ones * fixing the color comparator - adding stroke property for the cured ones * dep-check @vonage/vvd-design-tokens Co-authored-by: Yuri Guller <[email protected]>
- Loading branch information
Showing
7 changed files
with
109 additions
and
3 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
14 changes: 14 additions & 0 deletions
14
components/circular-progress/src/vwc-circular-progress.scss
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,14 @@ | ||
@use '@vonage/vvd-design-tokens/build/scss/semantic-variables/scheme-variables'; | ||
@use '@vonage/vvd-foundation/scss/variable-names/color-semantic-variable-names' as color-semantic; | ||
@use '@vonage/vvd-foundation/scss/mixins/color-connotation-mixins' with ( | ||
$connotations: primary cta success alert | ||
); | ||
|
||
@include color-connotation-mixins.connotations-context( | ||
':host(#{color-connotation-mixins.$connotation-placeholder})' | ||
); | ||
|
||
:host { | ||
--mdc-theme-primary: var(#{color-semantic.$vvd-color-connotation}, | ||
var(#{scheme-variables.$vvd-color-primary})); | ||
} |
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 |
---|---|---|
@@ -1,18 +1,31 @@ | ||
import '@vonage/vvd-core'; | ||
import { customElement } from 'lit-element'; | ||
import { customElement, property } from 'lit-element'; | ||
import { CircularProgress as MWCCircularProgress } from '@material/mwc-circular-progress'; | ||
import { style as mwcCircularProgressStyle } from '@material/mwc-circular-progress/mwc-circular-progress-css.js'; | ||
import { style as vwcCircularProgressStyle } from './vwc-circular-progress.css'; | ||
import { style as styleCoupling } from '@vonage/vvd-style-coupling/vvd-style-coupling.css.js'; | ||
import { Connotation } from '@vonage/vvd-foundation/constants'; | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'vwc-circular-progress': VWCCircularProgress; | ||
} | ||
} | ||
|
||
type CircularProgressConnotation = Extract< | ||
Connotation, | ||
| Connotation.Primary | ||
| Connotation.CTA | ||
| Connotation.Success | ||
| Connotation.Alert | ||
>; | ||
|
||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
// @ts-ignore | ||
MWCCircularProgress.styles = [styleCoupling, mwcCircularProgressStyle]; | ||
MWCCircularProgress.styles = [styleCoupling, mwcCircularProgressStyle, vwcCircularProgressStyle]; | ||
|
||
@customElement('vwc-circular-progress') | ||
export class VWCCircularProgress extends MWCCircularProgress {} | ||
export class VWCCircularProgress extends MWCCircularProgress { | ||
@property({ type: String, reflect: true }) | ||
connotation?: CircularProgressConnotation | null; | ||
} |
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
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
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
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