From 0ad575ea1506dea5ad898e22c4efca4067dc2be6 Mon Sep 17 00:00:00 2001 From: Marco D'Auria Date: Mon, 18 Dec 2023 11:51:49 +0100 Subject: [PATCH] docs: add new story --- .../notification/notification.stories.ts | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/components/notification/notification.stories.ts b/src/components/notification/notification.stories.ts index b84a28d27a2..cf83b92b46a 100644 --- a/src/components/notification/notification.stories.ts +++ b/src/components/notification/notification.stories.ts @@ -81,6 +81,29 @@ const trigger = (args: Args): TemplateResult => html` `; +const simpleNotification = ( + disabelAnimation: boolean, + type: string, + title: string, +): TemplateResult => html` + + (notification as SbbNotificationElement)?.addEventListener( + SbbNotificationElement.events.didOpen, + () => ((notification as SbbNotificationElement).disableAnimation = disabelAnimation), + { once: true }, + ), + )} + > + This is a ${type} notification. + +`; + const pageContent = (): TemplateResult => html`

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut @@ -111,6 +134,31 @@ const DefaultTemplate = (args: Args): TemplateResult => html` `; +const MultipleNotificationsTemplate = (args: Args): TemplateResult => html` + + (notification as SbbNotificationElement)?.addEventListener( + SbbNotificationElement.events.didOpen, + () => + ((notification as SbbNotificationElement).disableAnimation = args['disable-animation']), + { once: true }, + ), + )} + > + The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy + dog.  Link one + Link two + Link three + + + ${simpleNotification(args['disable-animation'], 'success', 'Success')} + ${simpleNotification(args['disable-animation'], 'warn', 'Warn')} + ${simpleNotification(args['disable-animation'], 'error', 'Error')} +`; + const SlottedTitleTemplate = (args: Args): TemplateResult => html`