blob: ef2afb72becd33d900b5fca3ea72f5fa0e6eceec [file] [log] [blame]
Derick Montaguecaaf7ba2020-10-09 11:17:48 -05001<template>
2 <span :class="['status-icon', status]">
3 <icon-info v-if="status === 'info'" />
4 <icon-success v-else-if="status === 'success'" />
5 <icon-warning v-else-if="status === 'warning'" />
6 <icon-danger v-else-if="status === 'danger'" />
7 <icon-secondary v-else />
8 </span>
9</template>
10
11<script>
12import IconInfo from '@carbon/icons-vue/es/information--filled/20';
13import IconCheckmark from '@carbon/icons-vue/es/checkmark--filled/20';
14import IconWarning from '@carbon/icons-vue/es/warning--filled/20';
15import IconError from '@carbon/icons-vue/es/error--filled/20';
16import IconMisuse from '@carbon/icons-vue/es/misuse/20';
17
18export default {
19 name: 'StatusIcon',
20 components: {
21 IconInfo: IconInfo,
22 iconSuccess: IconCheckmark,
23 iconDanger: IconMisuse,
24 iconSecondary: IconError,
25 iconWarning: IconWarning
26 },
27 props: {
28 status: {
29 type: String,
30 default: ''
31 }
32 }
33};
34</script>
35
Derick Montague2fabb1c2020-10-22 11:23:17 -050036<style lang="scss">
Derick Montaguecaaf7ba2020-10-09 11:17:48 -050037@import "src/assets/styles/bmc/helpers";
38@import "src/assets/styles/bootstrap/helpers";
39.status-icon {
40 vertical-align: text-bottom;
41 &.info {
Derick Montague2fabb1c2020-10-22 11:23:17 -050042 color: theme-color('info');
Derick Montaguecaaf7ba2020-10-09 11:17:48 -050043 }
44 &.success {
Derick Montague2fabb1c2020-10-22 11:23:17 -050045 color: theme-color('success');
Derick Montaguecaaf7ba2020-10-09 11:17:48 -050046 }
47 &.danger {
Derick Montague2fabb1c2020-10-22 11:23:17 -050048 color: theme-color('danger');
Derick Montaguecaaf7ba2020-10-09 11:17:48 -050049 }
50 &.secondary {
Derick Montague2fabb1c2020-10-22 11:23:17 -050051 color: gray('600');
Derick Montaguecaaf7ba2020-10-09 11:17:48 -050052
53 svg {
54 transform: rotate(-45deg);
55 }
56 }
57 &.warning {
Derick Montague2fabb1c2020-10-22 11:23:17 -050058 color: theme-color('warning');
59 }
60
61 svg {
62 fill: currentColor;
Derick Montaguecaaf7ba2020-10-09 11:17:48 -050063 }
64}
65</style>