File tree Expand file tree Collapse file tree 3 files changed +108
-0
lines changed Expand file tree Collapse file tree 3 files changed +108
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import card from './widgets/card/widget.vue';
88import icon from './widgets/icon/widget.vue' ;
99import view from './widgets/view/widget.vue' ;
1010import navigation from './widgets/navigation/widget.vue' ;
11+ import status from './widgets/status/widget.vue' ;
1112
1213import _store from './core/store' ;
1314import _bus from './core/eventBus' ;
@@ -19,6 +20,7 @@ export const Card = card;
1920export const Icon = icon ;
2021export const View = view ;
2122export const Navigation = navigation ;
23+ export const Status = status ;
2224
2325export const bus = _bus ;
2426export const store = _store ;
Original file line number Diff line number Diff line change 1+ import Status from '~widgets/status/widget.vue' ;
2+ import registerWidget from '~core/registerWidget' ;
3+
4+ import * as icons from '@cloudblueconnect/material-svg' ;
5+
6+ registerWidget ( 'ui-status' , Status ) ;
7+
8+ export default {
9+ title : 'Components/Status' ,
10+ component : Status ,
11+ parameters : {
12+ layout : 'centered' ,
13+ } ,
14+ argTypes : {
15+ iconName : {
16+ options : Object . keys ( icons ) ,
17+ control : {
18+ type : 'select' ,
19+ } ,
20+ }
21+ }
22+ } ;
23+
24+ export const Component = {
25+ render : ( args ) => ( {
26+ components : { Status } ,
27+ setup ( ) {
28+ return { args } ;
29+ } ,
30+ template : '<ui-status style="font-size: 20px" v-bind="args"></ui-status>' ,
31+ } ) ,
32+
33+ args : {
34+ text : 'Status text' ,
35+ iconName : 'googleUpdateBaseline' ,
36+ iconColor : 'green' ,
37+ iconSize : '20' ,
38+ }
39+ } ;
Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" status-mark" >
3+ <ui-icon
4+ class =" status-mark__icon"
5+ :icon-name =" iconName"
6+ :color =" iconColor"
7+ :size =" iconSize"
8+ />
9+ <span
10+ class =" status-mark__text"
11+ > {{ text }}
12+ </span >
13+ </div >
14+ </template >
15+
16+
17+ <script >
18+ import icon from ' ~widgets/icon/widget.vue' ;
19+ import registerWidget from ' ~core/registerWidget' ;
20+ registerWidget (' ui-icon' , icon);
21+
22+ export default {
23+ props: {
24+ text: {
25+ type: String ,
26+ default: ' ' ,
27+ },
28+
29+ iconName: {
30+ type: String ,
31+ default: ' ' ,
32+ },
33+
34+ iconColor: {
35+ type: String ,
36+ default: ' #212121' ,
37+ },
38+
39+ iconSize: {
40+ type: [Number , String ],
41+ default: ' 16' ,
42+ }
43+ },
44+ };
45+ </script >
46+
47+
48+ <style lang="stylus">
49+ .status-mark {
50+ display : inline - flex ;
51+ align-items : center ;
52+ vertical-align : middle ;
53+ font-size : 14px ;
54+ line-height : 20px ;
55+
56+ & __icon {
57+ margin-right : 4px ;
58+ flex : 0 0 auto ;
59+ }
60+
61+ & __text {
62+ font-size : inherit ;
63+ line-height : inherit ;
64+ white-space : nowrap ;
65+ }
66+ }
67+ </style >
You can’t perform that action at this time.
0 commit comments