Skip to content

Commit 13516f9

Browse files
committed
add: story for only title alert.
1 parent 8e02fcd commit 13516f9

1 file changed

Lines changed: 45 additions & 2 deletions

File tree

v2/pink-sb/src/stories/alert/Inline.stories.svelte

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,33 @@
1919
};
2020
</script>
2121

22-
<script>
22+
<script lang="ts">
23+
import { Layout, Typography } from '$lib/index.ts';
2324
import { Story, Template } from '@storybook/addon-svelte-csf';
25+
26+
const alerts = [
27+
{
28+
status: 'info',
29+
title: 'To complete, add this OAuth2 redirect URI to your Appwrite app config.',
30+
content: undefined
31+
},
32+
{
33+
status: 'success',
34+
title: 'OAuth2 redirect URI added successfully. Your Appwrite app is now ready!',
35+
content: 'You can now authenticate users via Appwrite without any additional setup.'
36+
},
37+
{
38+
status: 'warning',
39+
title: 'The OAuth2 redirect URI is missing. You may encounter login issues.',
40+
content:
41+
'To avoid authentication problems, ensure the URI is correctly added to your Appwrite app.'
42+
},
43+
{
44+
status: 'error',
45+
title: 'Failed to add OAuth2 redirect URI. Please try again or check your configuration.',
46+
content: undefined
47+
}
48+
] as const;
2449
</script>
2550

2651
<Template let:args>
@@ -37,5 +62,23 @@
3762
<Story name="Warning" args={{ status: 'warning' }} />
3863
<Story name="Error" args={{ status: 'error' }} />
3964
<Story name="Only title">
40-
<Alert.Inline title="This is a title" status="error" dismissible />
65+
<div style:max-width="600px" style:margin-inline="auto" style:padding-block-start="4rem">
66+
<Layout.Stack gap="l">
67+
{#each alerts as alert}
68+
<Layout.Stack gap="xxxs">
69+
<Typography.Text variant="m-500">{alert.status.toUpperCase()}</Typography.Text>
70+
71+
{#if alert.content}
72+
<!-- with slot content -->
73+
<Alert.Inline title={alert.title} status={alert.status} dismissible>
74+
{alert.content}
75+
</Alert.Inline>
76+
{:else}
77+
<!-- without slot content -->
78+
<Alert.Inline title={alert.title} status={alert.status} dismissible />
79+
{/if}
80+
</Layout.Stack>
81+
{/each}
82+
</Layout.Stack>
83+
</div>
4184
</Story>

0 commit comments

Comments
 (0)