-
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.
Merge pull request #485 from Vonage/viv-200-badge-parity
feat(vwc-badge): viv-200 badge volta parity
- Loading branch information
Showing
12 changed files
with
285 additions
and
40 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 |
---|---|---|
|
@@ -24,5 +24,8 @@ | |
}, | ||
"dependencies": { | ||
"tslib": "^2.0.3" | ||
}, | ||
"devDependencies": { | ||
"@vonage/vvd-design-tokens": "^0.17.0" | ||
} | ||
} |
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,41 @@ | ||
@use '@vonage/vvd-design-tokens/build/scss/semantic-variables/scheme-variables'; | ||
@use '../variable-names/color-semantic-variable-names' as color-semantic; | ||
@use '../functions'; | ||
|
||
// override to apply relevance | ||
$layouts: filled outlined soft text !default; | ||
//////////////////////////////////////////////////////////////////////////// | ||
//////////////////////////////////////////////////////////////////////////// | ||
$allLayouts: ( | ||
filled: 'filled', | ||
outlined: 'outlined', | ||
soft: 'soft', | ||
text: 'text', | ||
); | ||
|
||
$bg: var(#{color-semantic.$vvd-color-connotation}); | ||
|
||
%filled { | ||
--background-color: #{$bg}; | ||
--color: var(#{color-semantic.$vvd-color-on-connotation}); | ||
} | ||
|
||
%outlined { | ||
--background-color: transparent; | ||
--border: 1px solid #{$bg}; | ||
--color: #{$bg}; | ||
} | ||
|
||
%soft { | ||
--background-color: #{$bg}; | ||
--color: var(#{scheme-variables.$vvd-color-on-base}); | ||
--opaque: 20; | ||
} | ||
|
||
@mixin layout() { | ||
@each $layout in functions.pick($layouts, $allLayouts) { | ||
#{':host([layout="#{$layout}"])'} { | ||
@extend %#{$layout}; | ||
} | ||
} | ||
} |
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
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,23 +1,40 @@ | ||
import { Connotation, Shape } from '@vonage/vvd-foundation/constants'; | ||
import { Connotation, Shape, Layout } from '@vonage/vvd-foundation/constants'; | ||
|
||
|
||
export const argTypes = { | ||
connotation: { | ||
control: { | ||
type: 'select', | ||
options: Object.values(Connotation), | ||
options: Object.values(Connotation).filter(c => [ | ||
Connotation.Primary, Connotation.CTA, Connotation.Success, Connotation.Alert, Connotation.Info, Connotation.Warning | ||
].includes(c)), | ||
} | ||
}, | ||
shape: { | ||
control: { | ||
type: 'select', | ||
options: Object.values(Shape), | ||
options: Object.values(Shape) | ||
} | ||
}, | ||
translucent: { | ||
layout: { | ||
control: { | ||
type: 'select', | ||
options: Object.values(Layout).filter(l => [ | ||
Layout.Filled, Layout.Outlined, Layout.Soft | ||
].includes(l)), | ||
} | ||
}, | ||
dense: { | ||
control: { | ||
type: 'inline-radio', | ||
options: { 'true': '', 'false': undefined } | ||
} | ||
}, | ||
enlarged: { | ||
control: { | ||
type: 'inline-radio', | ||
options: { 'true': '', 'false': undefined } | ||
} | ||
} | ||
}, | ||
styles: { table: { disable: true } }, | ||
} |
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
import '@vonage/vwc-badge/vwc-badge.js'; | ||
import { html } from 'lit-element'; | ||
import { spread } from '@open-wc/lit-helpers'; | ||
import { argTypes } from './arg-types.js'; | ||
|
||
export default { | ||
title: 'Atoms/Badge', | ||
component: 'vwc-badge', | ||
argTypes | ||
} | ||
|
||
const Template = args => html`<vwc-badge ...=${spread(args)}>I'm a badge</vwc-badge>`; | ||
|
||
export const Basic = Template.bind({}); | ||
Basic.args = { connotation: 'cta', layout: 'filled' }; | ||
|
||
export const Soft = Template.bind({}); | ||
Soft.args = { connotation: 'cta', layout: 'soft' }; | ||
|
||
export const Outlined = Template.bind({}); | ||
Outlined.args = { layout: 'outlined' }; | ||
|
||
export const PillShape = Template.bind({}); | ||
PillShape.args = { layout: 'filled', shape: 'pill' }; | ||
|
||
export const Dense = Template.bind({}); | ||
Dense.args = { layout: 'filled', dense: '' }; | ||
|
||
export const Enlarged = Template.bind({}); | ||
Enlarged.args = { layout: 'filled', enlarged: '' }; |
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
Oops, something went wrong.