diff options
Diffstat (limited to 'stories/angular/notifications.stories.ts')
-rw-r--r-- | stories/angular/notifications.stories.ts | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/stories/angular/notifications.stories.ts b/stories/angular/notifications.stories.ts new file mode 100644 index 0000000..4e87517 --- /dev/null +++ b/stories/angular/notifications.stories.ts @@ -0,0 +1,55 @@ +import { storiesOf } from '@storybook/angular'; +import { withKnobs, text, number, boolean, array, select, color, date, button } from '@storybook/addon-knobs'; +import { withNotes } from '@storybook/addon-notes'; +import { action, configureActions } from '@storybook/addon-actions'; +import { moduleMetadata } from '@storybook/angular'; +import { NotificationModule } from '../../src/angular/notifications/notification.module'; +import { NotificationSettings } from '../../src/angular/notifications/utilities/notification.config'; + +let stories = storiesOf('Notification', module) + .addDecorator(withKnobs) + .addDecorator(withNotes) + .addDecorator( + moduleMetadata({ + declarations: [ + ], + imports: [ + NotificationModule + + ] + }) + ) + createStory(stories, "All options", true, true, "Notification", "Full example of simple tabs."); + // createStory(stories, "Tabs with text", true, false, "Tabs with titles", "Simple tabs with text title."); + // createStory(stories, "Tabs with icons", false, true, "Tabs with icons", "Simple tabs with icon title."); + + function createStory(stories, title, containsTitle, containsTitleIcon, notesTitle, notesText){ + stories.add(title, () => { + const _type = select('Type', ["info", "warning", "error", "success"], 'left', ''); + const _notifyText = text('Text','notif info message test'); + const _notifyTitle = text('Title', 'Notif Titile Info'); + const _sticky = boolean('Sticky', false); + const _hasCustomContent = boolean('Has customer content', false); + const _duration = number('Duration', 2000); + let _notificationSetting = new NotificationSettings(_type, _notifyText, _notifyTitle, _duration, _sticky, _hasCustomContent) + // const innerComponentType: Type<any>; + // const innerComponentOptions: any; + + + return { + props: { + selectTab: action('select tab changed'), + _type, _notifyText, _notifyTitle, _sticky, _hasCustomContent, _duration + }, + template: ` + <sdc-notification + [notificationSetting] = "_notificationSetting" + > + </sdc-notification> + ` + } + }, + { notes: `<h2>` + notesTitle + `</h2>` + notesText + `<br>Use the KNOBS tab to change values.` + } + ) + } |