Implemented button badges

pull/310/head
cagataycivici 2020-05-09 02:36:45 +03:00
parent 7f0d9d77e9
commit b936c9a135
27 changed files with 221 additions and 34 deletions

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3378,6 +3381,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #f4f4f4;
color: #333333;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #34A835; background-color: #34A835;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3378,6 +3381,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #f4f4f4;
color: #333333;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #34A835; background-color: #34A835;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3378,6 +3381,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #f4f4f4;
color: #333333;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #34A835; background-color: #34A835;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3378,6 +3381,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #f4f4f4;
color: #333333;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #34A835; background-color: #34A835;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3378,6 +3381,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #f4f4f4;
color: #333333;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #34A835; background-color: #34A835;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3378,6 +3381,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #f4f4f4;
color: #333333;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #34A835; background-color: #34A835;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3378,6 +3381,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #f4f4f4;
color: #333333;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #34A835; background-color: #34A835;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3378,6 +3381,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #f3f3f3;
color: #333333;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #A3E2C6; background-color: #A3E2C6;
color: #323E39; color: #323E39;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #ffffff;
color: #1976D2;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #689F38; background-color: #689F38;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #ffffff;
color: #00838F;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #689F38; background-color: #689F38;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #ffffff;
color: #512DA8;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #689F38; background-color: #689F38;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #ffffff;
color: #388E3C;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #689F38; background-color: #689F38;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #ffffff;
color: #303F9F;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #689F38; background-color: #689F38;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #ffffff;
color: #FFA000;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #689F38; background-color: #689F38;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #ffffff;
color: #7B1FA2;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #689F38; background-color: #689F38;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: #ffffff;
color: #00796B;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #689F38; background-color: #689F38;
color: #ffffff; color: #ffffff;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: transparent;
color: #64B5F6;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #AED581; background-color: #AED581;
color: #212529; color: #212529;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: transparent;
color: #4DD0E1;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #AED581; background-color: #AED581;
color: #212529; color: #212529;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: transparent;
color: #9575CD;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #AED581; background-color: #AED581;
color: #212529; color: #212529;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: transparent;
color: #81C784;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #AED581; background-color: #AED581;
color: #212529; color: #212529;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: transparent;
color: #7986CB;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #AED581; background-color: #AED581;
color: #212529; color: #212529;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: transparent;
color: #FFD54F;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #AED581; background-color: #AED581;
color: #212529; color: #212529;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: transparent;
color: #BA68C8;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #AED581; background-color: #AED581;
color: #212529; color: #212529;

View File

@ -1108,6 +1108,9 @@
.p-button .p-button-icon-right { .p-button .p-button-icon-right {
margin-left: 0.5em; margin-left: 0.5em;
} }
.p-button .p-badge {
margin-left: 0.5em;
}
.p-button.p-button-icon-only { .p-button.p-button-icon-only {
width: 2.357em; width: 2.357em;
} }
@ -3412,6 +3415,10 @@
height: 2em; height: 2em;
line-height: 2em; line-height: 2em;
} }
.p-badge.p-badge-secondary {
background-color: transparent;
color: #4DB6AC;
}
.p-badge.p-badge-success { .p-badge.p-badge-success {
background-color: #AED581; background-color: #AED581;
color: #212529; color: #212529;

View File

@ -454,11 +454,6 @@ a {
.content-section { .content-section {
display: block; display: block;
padding: 30px; padding: 30px;
background-color: #f5f7f8;
&:first-of-type > div > span {
line-height: 1.5em;
}
h2 { h2 {
margin-top: 0; margin-top: 0;
@ -588,6 +583,7 @@ a {
&.documentation { &.documentation {
border-top: 1px solid #dadada; border-top: 1px solid #dadada;
background-color: #f5f7f8;
h3 { h3 {
color: #495057; color: #495057;

View File

@ -2,6 +2,7 @@
<button :class="buttonClass" v-on="$listeners"> <button :class="buttonClass" v-on="$listeners">
<span v-if="icon" :class="iconClass"></span> <span v-if="icon" :class="iconClass"></span>
<span class="p-button-text">{{label||'&nbsp;'}}</span> <span class="p-button-text">{{label||'&nbsp;'}}</span>
<span class="p-badge" v-if="badge" :class="badgeClass">{{badge}}</span>
</button> </button>
</template> </template>
@ -17,6 +18,13 @@ export default {
iconPos: { iconPos: {
type: String, type: String,
default: 'left' default: 'left'
},
badge: {
type: String
},
badgeClass: {
type: String,
default: 'p-badge-secondary'
} }
}, },
computed: { computed: {

View File

@ -9,25 +9,31 @@
<div class="content-section implementation"> <div class="content-section implementation">
<h3>Numbers</h3> <h3>Numbers</h3>
<div class="badges">
<span class="p-badge">2</span> <span class="p-badge">2</span>
<span class="p-badge p-badge-success">8</span> <span class="p-badge p-badge-success">8</span>
<span class="p-badge p-badge-info">4</span> <span class="p-badge p-badge-info">4</span>
<span class="p-badge p-badge-warning">12</span> <span class="p-badge p-badge-warning">12</span>
<span class="p-badge p-badge-danger">3</span> <span class="p-badge p-badge-danger">3</span>
</div>
<h3>Tags</h3> <h3>Tags</h3>
<div class="badges">
<span class="p-tag">Primary</span> <span class="p-tag">Primary</span>
<span class="p-tag p-tag-success">Success</span> <span class="p-tag p-tag-success">Success</span>
<span class="p-tag p-tag-info">Info</span> <span class="p-tag p-tag-info">Info</span>
<span class="p-tag p-tag-warning">Warning</span> <span class="p-tag p-tag-warning">Warning</span>
<span class="p-tag p-tag-danger">Danger</span> <span class="p-tag p-tag-danger">Danger</span>
</div>
<h3>Pills</h3> <h3>Pills</h3>
<div class="badges">
<span class="p-tag p-tag-rounded">Primary</span> <span class="p-tag p-tag-rounded">Primary</span>
<span class="p-tag p-tag-rounded p-tag-success">Success</span> <span class="p-tag p-tag-rounded p-tag-success">Success</span>
<span class="p-tag p-tag-rounded p-tag-info">Info</span> <span class="p-tag p-tag-rounded p-tag-info">Info</span>
<span class="p-tag p-tag-rounded p-tag-warning">Warning</span> <span class="p-tag p-tag-rounded p-tag-warning">Warning</span>
<span class="p-tag p-tag-rounded p-tag-danger">Danger</span> <span class="p-tag p-tag-rounded p-tag-danger">Danger</span>
</div>
<h3>Positioned Badge</h3> <h3>Positioned Badge</h3>
<span class="p-overlay-badge"> <span class="p-overlay-badge">
@ -40,7 +46,12 @@
<Button type="button" label="New" /> <Button type="button" label="New" />
</span> </span>
<h3>Inline Button Badge</h3>
<Button type="button" label="Emails" badge="8" />
<Button type="button" label="Messages" icon="pi pi-users" class="p-button-warning" badge="8" badgeClass="p-" />
<h3>Sizes</h3> <h3>Sizes</h3>
<div class="badges">
<span class="p-badge" style="font-size: 1em">2</span> <span class="p-badge" style="font-size: 1em">2</span>
<span class="p-badge p-badge-success" style="font-size: 1.25em">8</span> <span class="p-badge p-badge-success" style="font-size: 1.25em">8</span>
<span class="p-badge p-badge-info" style="font-size: 1.5em">4</span> <span class="p-badge p-badge-info" style="font-size: 1.5em">4</span>
@ -51,6 +62,8 @@
<h2>Heading 2 <span class="p-tag p-tag-success">New</span></h2> <h2>Heading 2 <span class="p-tag p-tag-success">New</span></h2>
</div> </div>
</div>
<BadgeDoc /> <BadgeDoc />
</div> </div>
</template> </template>
@ -71,16 +84,18 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.p-badge, .p-tag { .badges {
.p-badge, .p-tag {
margin-right: .5em;
}
}
.p-button {
margin-right: .5em; margin-right: .5em;
} }
.p-overlay-badge { .p-overlay-badge {
margin-right: 2em; margin-right: 2em;
.p-badge {
margin-right: 0;
}
} }
/deep/ h1, h2 { /deep/ h1, h2 {