Skip to content

Commit 50b0042

Browse files
authored
Merge pull request #88 from cloudblue/dialog
Add simple dialog
2 parents 8382b79 + 969bb5e commit 50b0042

File tree

6 files changed

+749
-0
lines changed

6 files changed

+749
-0
lines changed

components/src/constants/color.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const COLORS_DICT = {
2+
NICE_GREEN: '#0BB071',
3+
NICE_RED: '#FF6A6A',
4+
MIDDLE_GREY: '#BDBDBD',
5+
DARK_GREY: '#666666',
6+
NICE_BLUE: '#2C98F0',
7+
DARKER_BLUE: '#4797f2',
8+
TEXT: '#212121',
9+
WHITE: '#FFFFFF',
10+
TRANSPARENT: 'transparent',
11+
};

components/src/constants/dialogs.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const ACTIONS_DICT = {
2+
CANCEL: 'cancel',
3+
CLOSE: 'close',
4+
SAVE: 'save',
5+
SUBMIT: 'submit',
6+
DELETE: 'delete',
7+
SPACER: 'spacer',
8+
NEXT: 'next',
9+
BACK: 'back',
10+
};
11+
12+
export const ACTIONS_LABELS = {
13+
[ACTIONS_DICT.CANCEL]: 'Cancel',
14+
[ACTIONS_DICT.CLOSE]: 'Close',
15+
[ACTIONS_DICT.SAVE]: 'Save',
16+
[ACTIONS_DICT.SUBMIT]: 'Submit',
17+
[ACTIONS_DICT.DELETE]: 'Delete',
18+
[ACTIONS_DICT.NEXT]: 'Next',
19+
[ACTIONS_DICT.BACK]: 'Back',
20+
};

components/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export { default as Menu } from '~widgets/menu/widget.vue';
1818
export { default as Textarea } from '~widgets/textarea/widget.vue';
1919
export { default as Alert } from '~widgets/alert/widget.vue';
2020
export { default as Radio } from '~widgets/radio/widget.vue';
21+
export { default as Dialog } from '~widgets/dialog/widget.vue';
2122

2223
export { default as store } from '~core/store';
2324
export { default as bus } from '~core/eventBus';
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import Dialog from '~widgets/dialog/widget.vue';
2+
import registerWidget from '~core/registerWidget';
3+
4+
registerWidget('ui-dialog', Dialog);
5+
6+
export default {
7+
title: 'Components/Dialog',
8+
component: Dialog,
9+
parameters: {
10+
layout: 'centered',
11+
},
12+
};
13+
14+
export const Component = {
15+
render: (args) => ({
16+
setup() {
17+
return { args };
18+
},
19+
template: `
20+
<ui-dialog v-bind="args" style="position: relative;">
21+
<div slot>
22+
{{ args.content }}
23+
</div>
24+
</ui-dialog>`,
25+
}),
26+
27+
args: {
28+
value: true,
29+
title: 'Dialog Title',
30+
actions: ['cancel', 'submit'],
31+
height: '500px',
32+
width: '800px',
33+
isValid: true,
34+
submitLabel: 'Submit',
35+
content: 'This is the dialog content :-)',
36+
},
37+
decorators: [() => ({ template: '<div style="height: 600px;"><story/></div>' })],
38+
};

0 commit comments

Comments
 (0)