Skip to content

Commit

Permalink
Merge pull request #88 from cloudblue/dialog
Browse files Browse the repository at this point in the history
Add simple dialog
  • Loading branch information
arnaugiralt committed May 8, 2024
2 parents 8382b79 + 969bb5e commit 50b0042
Show file tree
Hide file tree
Showing 6 changed files with 749 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/src/constants/color.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const COLORS_DICT = {
NICE_GREEN: '#0BB071',
NICE_RED: '#FF6A6A',
MIDDLE_GREY: '#BDBDBD',
DARK_GREY: '#666666',
NICE_BLUE: '#2C98F0',
DARKER_BLUE: '#4797f2',
TEXT: '#212121',
WHITE: '#FFFFFF',
TRANSPARENT: 'transparent',
};
20 changes: 20 additions & 0 deletions components/src/constants/dialogs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const ACTIONS_DICT = {
CANCEL: 'cancel',
CLOSE: 'close',
SAVE: 'save',
SUBMIT: 'submit',
DELETE: 'delete',
SPACER: 'spacer',
NEXT: 'next',
BACK: 'back',
};

export const ACTIONS_LABELS = {
[ACTIONS_DICT.CANCEL]: 'Cancel',
[ACTIONS_DICT.CLOSE]: 'Close',
[ACTIONS_DICT.SAVE]: 'Save',
[ACTIONS_DICT.SUBMIT]: 'Submit',
[ACTIONS_DICT.DELETE]: 'Delete',
[ACTIONS_DICT.NEXT]: 'Next',
[ACTIONS_DICT.BACK]: 'Back',
};
1 change: 1 addition & 0 deletions components/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export { default as Menu } from '~widgets/menu/widget.vue';
export { default as Textarea } from '~widgets/textarea/widget.vue';
export { default as Alert } from '~widgets/alert/widget.vue';
export { default as Radio } from '~widgets/radio/widget.vue';
export { default as Dialog } from '~widgets/dialog/widget.vue';

export { default as store } from '~core/store';
export { default as bus } from '~core/eventBus';
Expand Down
38 changes: 38 additions & 0 deletions components/src/stories/Dialog.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import Dialog from '~widgets/dialog/widget.vue';
import registerWidget from '~core/registerWidget';

registerWidget('ui-dialog', Dialog);

export default {
title: 'Components/Dialog',
component: Dialog,
parameters: {
layout: 'centered',
},
};

export const Component = {
render: (args) => ({
setup() {
return { args };
},
template: `
<ui-dialog v-bind="args" style="position: relative;">
<div slot>
{{ args.content }}
</div>
</ui-dialog>`,
}),

args: {
value: true,
title: 'Dialog Title',
actions: ['cancel', 'submit'],
height: '500px',
width: '800px',
isValid: true,
submitLabel: 'Submit',
content: 'This is the dialog content :-)',
},
decorators: [() => ({ template: '<div style="height: 600px;"><story/></div>' })],
};

0 comments on commit 50b0042

Please sign in to comment.