Skip to content

Commit

Permalink
feat: Added neutral badge option
Browse files Browse the repository at this point in the history
  • Loading branch information
Villalobos committed Jul 15, 2019
1 parent d8d9ef7 commit 6858383
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 10 deletions.
6 changes: 6 additions & 0 deletions dev/views/Badges.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
<td>
<badge text-shade="disabled" theme="disabled" :removable ="false">Text Badge</badge>
</td>
<td>
<badge text-shade="dark" theme="neutral" :removable ="false">Text Badge</badge>
</td>
</tr>
</table>

Expand Down Expand Up @@ -77,6 +80,9 @@
<td>
<badge text-shade="disabled" theme="disabled" :removable ="true">Text Badge</badge>
</td>
<td>
<badge text-shade="dark" theme="neutral" :removable ="true">Text Badge</badge>
</td>
</tr>
</table>
</card>
Expand Down
7 changes: 7 additions & 0 deletions dev/views/NumberBadges.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
</template>
</badge>
</td>
<td>
<badge theme ="neutral" text-shade="dark" :value="1" >
<template v-slot:content>
<inbox />
</template>
</badge>
</td>
<td>
<badge theme ="disabled" text-shade="disabled" :value="0" >
<template v-slot:content>
Expand Down
13 changes: 11 additions & 2 deletions src/components/FishTankBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export default class FishTankBadge extends Vue {
/**
* String representing the background color of the tag.
*
* Available themes `bgov, btax, notification-1, notification-2, notification-2, disabled`
* Available themes `bgov, btax, notification-1, notification-2, notification-2, disabled, neutral`
*/
@Prop({default:'notification-1'})
theme:String;
availableThemes:["theme","bgov", "btax", "notification-1", "notification-2", "notification-3","disabled"]
availableThemes:["theme","bgov", "btax", "notification-1", "notification-2", "notification-3","disabled","neutral"]
get themeClass() {
switch(this.theme) {
Expand All @@ -49,6 +49,8 @@ export default class FishTankBadge extends Vue {
return "badge-theme--color-notification-2"
case "notification-3":
return "badge-theme--color-notification-3"
case "neutral":
return "badge-theme--color-neutral"
default:
return "badge-theme--color-notification-1"
}
Expand Down Expand Up @@ -200,6 +202,13 @@ export default class FishTankBadge extends Vue {
}
}
.badge{
&.badge-theme--color-neutral {
background: var(--badge-background-color, $color-white);
border: 1px solid var(--badge-background-color, $color-disabled);
}
}
// remove icon (x) styles
.remove-light{
margin-left:5px;
Expand Down
42 changes: 34 additions & 8 deletions src/components/FishTankNumberBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,35 @@ import { Component, Prop, Vue } from 'vue-property-decorator'
export default class FishTankNumberBadge extends Vue {
//properties
@Prop({default:undefined, type:Number})
value:Number;
@Prop({default:'light'})
/**
* Value is the number displayed in the badge chip
*/
@Prop({
default:undefined,
type:Number
})
value:Number
/**
* Text shade is the color of the number in the badge chip
*/
@Prop({
default:'light'
})
textShade:String
availableShades:["light","dark","disabled"]
@Prop({default:'notification-1'})
/**
* Sets a theme to the badge
*/
@Prop({
default:'notification-1',
required:false
})
theme:String;
required:false;
description:"Sets a theme to the badge"
availableThemes:["theme","bgov", "btax", "notification-1", "notification-2", "notification-3","disabled"]
availableThemes:["theme","bgov", "btax", "notification-1", "notification-2", "notification-3","disabled","neutral"]
// need to properly format for vue property decorator
// Computed properties
get themeClass() {
switch(this.theme) {
case "bgov":
Expand All @@ -35,6 +52,8 @@ export default class FishTankNumberBadge extends Vue {
return "badge-chip--color-notification-2"
case "notification-3":
return "badge-chip--color-notification-3"
case "neutral":
return "badge-chip--color-neutral"
default:
return "badge-chip--color-notification-1"
}
Expand Down Expand Up @@ -172,6 +191,13 @@ export default class FishTankNumberBadge extends Vue {
}
}
.badge-chip{
&.badge-chip--color-neutral {
background: var(--badge-background-color, $color-white);
border: 1px solid $color-disabled;
}
}
//text colors
.badge-chip{
&.text--color-light {
Expand Down

0 comments on commit 6858383

Please sign in to comment.