File tree Expand file tree Collapse file tree 4 files changed +109
-0
lines changed Expand file tree Collapse file tree 4 files changed +109
-0
lines changed Original file line number Diff line number Diff line change 3030 "@storybook/vue3-webpack5" : " ^7.4.5" ,
3131 "@vue/cli-plugin-babel" : " ^5.0.8" ,
3232 "@vue/vue3-jest" : " ^29.2.6" ,
33+ "ajv" : " ^8.12.0" ,
3334 "babel-core" : " ^7.0.0-bridge.0" ,
3435 "babel-jest" : " ^29.7.0" ,
3536 "babel-loader" : " ^9.1.3" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import tab from './widgets/tab/widget.vue';
66import pad from './widgets/pad/widget.vue' ;
77import card from './widgets/card/widget.vue' ;
88import icon from './widgets/icon/widget.vue' ;
9+ import status from './widgets/status/widget.vue' ;
910
1011import _store from './core/store' ;
1112import _bus from './core/eventBus' ;
@@ -15,6 +16,7 @@ export const Tab = tab;
1516export const Pad = pad ;
1617export const Card = card ;
1718export const Icon = icon ;
19+ export const Status = status ;
1820
1921export const bus = _bus ;
2022export 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+ statusText : '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+ > {{ statusText }}
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+ statusText: {
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