@reshape-biotech/design-system 1.2.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +5 -1
  2. package/dist/app.css +97 -97
  3. package/dist/components/activity/Activity.stories.svelte +104 -104
  4. package/dist/components/activity/Activity.svelte +112 -112
  5. package/dist/components/avatar/Avatar.stories.svelte +23 -23
  6. package/dist/components/avatar/Avatar.svelte +54 -54
  7. package/dist/components/banner/Banner.stories.svelte +105 -105
  8. package/dist/components/banner/Banner.svelte +42 -42
  9. package/dist/components/button/Button.stories.svelte +61 -61
  10. package/dist/components/button/Button.svelte +95 -95
  11. package/dist/components/card/Card.stories.svelte +112 -112
  12. package/dist/components/card/Card.svelte +18 -18
  13. package/dist/components/checkbox/Checkbox.stories.svelte +8 -8
  14. package/dist/components/checkbox/Checkbox.svelte +17 -17
  15. package/dist/components/collapsible/Collapsible.stories.svelte +26 -26
  16. package/dist/components/collapsible/components/collapsible-content.svelte +20 -20
  17. package/dist/components/collapsible/components/collapsible-trigger.svelte +12 -12
  18. package/dist/components/collapsible/index.d.ts +1 -1
  19. package/dist/components/combobox/Combobox.stories.svelte +412 -412
  20. package/dist/components/combobox/components/combobox-add.svelte +8 -8
  21. package/dist/components/combobox/components/combobox-content.svelte +39 -39
  22. package/dist/components/combobox/components/combobox-indicator.svelte +1 -1
  23. package/dist/components/combobox/index.d.ts +1 -1
  24. package/dist/components/datepicker/DatePicker.stories.svelte +196 -196
  25. package/dist/components/datepicker/DatePicker.svelte +173 -173
  26. package/dist/components/divider/Divider.stories.svelte +7 -7
  27. package/dist/components/divider/Divider.svelte +9 -9
  28. package/dist/components/drawer/Drawer.stories.svelte +51 -51
  29. package/dist/components/drawer/Drawer.svelte +33 -33
  30. package/dist/components/drawer/DrawerLabel.svelte +10 -10
  31. package/dist/components/dropdown/Dropdown.stories.svelte +210 -210
  32. package/dist/components/dropdown/Dropdown.svelte +57 -57
  33. package/dist/components/dropdown/components/DropdownContent.svelte +16 -16
  34. package/dist/components/dropdown/components/DropdownMenu.svelte +10 -10
  35. package/dist/components/dropdown/components/DropdownTrigger.svelte +37 -37
  36. package/dist/components/dropdown/components/OutlinedButton.svelte +9 -9
  37. package/dist/components/empty-content/EmptyContent.stories.svelte +38 -38
  38. package/dist/components/empty-content/EmptyContent.svelte +12 -12
  39. package/dist/components/graphs/bar-chart/BarChart.stories.svelte +91 -91
  40. package/dist/components/graphs/bar-chart/BarChart.svelte +147 -147
  41. package/dist/components/graphs/bar-chart/StackedBarChart.stories.svelte +57 -57
  42. package/dist/components/graphs/bar-chart/StackedBarChart.svelte +198 -199
  43. package/dist/components/graphs/chart/Chart.stories.svelte +96 -96
  44. package/dist/components/graphs/chart/Chart.svelte +207 -207
  45. package/dist/components/graphs/line/LineChart.stories.svelte +138 -138
  46. package/dist/components/graphs/line/LineChart.svelte +140 -142
  47. package/dist/components/graphs/matrix/Matrix.stories.svelte +117 -117
  48. package/dist/components/graphs/matrix/Matrix.svelte +141 -141
  49. package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +168 -168
  50. package/dist/components/graphs/multiline/MultiLineChart.svelte +236 -236
  51. package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte +84 -84
  52. package/dist/components/graphs/scatterplot/Scatterplot.svelte +302 -302
  53. package/dist/components/graphs/utils/duration.d.ts +1 -0
  54. package/dist/components/graphs/utils/duration.js +33 -0
  55. package/dist/components/graphs/utils/tooltipFormatter.js +1 -1
  56. package/dist/components/icon-button/IconButton.stories.svelte +64 -64
  57. package/dist/components/icon-button/IconButton.svelte +88 -88
  58. package/dist/components/icons/AnalysisIcon.stories.svelte +18 -18
  59. package/dist/components/icons/AnalysisIcon.svelte +96 -96
  60. package/dist/components/icons/Icon.stories.svelte +111 -111
  61. package/dist/components/icons/Icon.svelte +17 -17
  62. package/dist/components/icons/PrincipalIcon.svelte +59 -59
  63. package/dist/components/icons/custom/Halo.svelte +31 -31
  64. package/dist/components/icons/custom/Well.svelte +27 -27
  65. package/dist/components/icons/index.js +1 -1
  66. package/dist/components/image/Image.svelte +42 -42
  67. package/dist/components/input/Input.stories.svelte +55 -55
  68. package/dist/components/input/Input.svelte +121 -121
  69. package/dist/components/label/Label.stories.svelte +18 -18
  70. package/dist/components/label/Label.svelte +11 -11
  71. package/dist/components/list/List.stories.svelte +84 -84
  72. package/dist/components/list/List.svelte +20 -20
  73. package/dist/components/logo/Logo.stories.svelte +15 -15
  74. package/dist/components/logo/Logo.svelte +30 -30
  75. package/dist/components/manual-cfu-counter/ManualCFUCounter.stories.svelte +102 -102
  76. package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte +557 -557
  77. package/dist/components/manual-cfu-counter/test/ManualCFUCounterTestWrapper.svelte +11 -11
  78. package/dist/components/markdown/Markdown.stories.svelte +10 -10
  79. package/dist/components/markdown/Markdown.svelte +6 -6
  80. package/dist/components/modal/Modal.stories.svelte +29 -29
  81. package/dist/components/modal/Modal.svelte +71 -71
  82. package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte +201 -201
  83. package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte +606 -606
  84. package/dist/components/multi-cfu-counter/test/MultiCFUCounterTestWrapper.svelte +17 -17
  85. package/dist/components/notification-popup/NotificationPopup.stories.svelte +18 -18
  86. package/dist/components/notification-popup/NotificationPopup.svelte +26 -26
  87. package/dist/components/notifications/Notifications.stories.svelte +101 -101
  88. package/dist/components/notifications/Notifications.svelte +9 -9
  89. package/dist/components/pill/Pill.stories.svelte +8 -8
  90. package/dist/components/pill/Pill.svelte +27 -27
  91. package/dist/components/progress-circle/ProgressCircle.stories.svelte +8 -8
  92. package/dist/components/progress-circle/ProgressCircle.svelte +54 -54
  93. package/dist/components/required-status-indicator/RequiredStatusIndicator.stories.svelte +18 -18
  94. package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte +14 -14
  95. package/dist/components/segmented-control-buttons/ControlButton.svelte +36 -36
  96. package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +35 -35
  97. package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +13 -13
  98. package/dist/components/select/Select.stories.svelte +200 -94
  99. package/dist/components/select/Select.stories.svelte.d.ts +1 -1
  100. package/dist/components/select/components/Group.svelte +24 -0
  101. package/dist/components/select/components/MultiSelectTrigger.svelte +66 -0
  102. package/dist/components/select/components/SelectContent.svelte +33 -0
  103. package/dist/components/select/components/SelectGroupHeading.svelte +19 -0
  104. package/dist/components/select/components/SelectItem.svelte +39 -0
  105. package/dist/components/select/components/SelectTrigger.svelte +48 -0
  106. package/dist/components/select/index.d.ts +10 -7
  107. package/dist/components/select/index.js +12 -1
  108. package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte +102 -87
  109. package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte.d.ts +1 -1
  110. package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte +53 -53
  111. package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte.d.ts +1 -1
  112. package/dist/components/sjsf-wrappers/sjsfCustomTheme.js +1 -1
  113. package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte +32 -32
  114. package/dist/components/skeleton-loader/SkeletonLoader.svelte +10 -10
  115. package/dist/components/skeleton-loader/StatcardSkeleton.svelte +9 -9
  116. package/dist/components/skeleton-loader/components/Skeleton.svelte +7 -7
  117. package/dist/components/skeleton-loader/components/SkeletonImage.svelte +12 -12
  118. package/dist/components/slider/Slider.stories.svelte +23 -23
  119. package/dist/components/slider/Slider.svelte +107 -107
  120. package/dist/components/spinner/Spinner.stories.svelte +8 -8
  121. package/dist/components/spinner/Spinner.svelte +18 -18
  122. package/dist/components/stat-card/StatCard.stories.svelte +26 -26
  123. package/dist/components/stat-card/StatCard.svelte +128 -128
  124. package/dist/components/status-badge/StatusBadge.stories.svelte +365 -365
  125. package/dist/components/status-badge/StatusBadge.svelte +54 -54
  126. package/dist/components/stepper/Stepper.stories.svelte +219 -219
  127. package/dist/components/stepper/components/stepper-root.svelte +12 -12
  128. package/dist/components/stepper/components/stepper-step.svelte +83 -83
  129. package/dist/components/table/Table.stories.svelte +87 -87
  130. package/dist/components/table/Table.svelte +32 -32
  131. package/dist/components/table/components/TBody.svelte +7 -7
  132. package/dist/components/table/components/THead.svelte +7 -7
  133. package/dist/components/table/components/Td.svelte +8 -8
  134. package/dist/components/table/components/Th.svelte +8 -8
  135. package/dist/components/table/components/Tr.svelte +11 -11
  136. package/dist/components/tabs/Tabs.stories.svelte +20 -20
  137. package/dist/components/tabs/Tabs.svelte +8 -8
  138. package/dist/components/tabs/components/Content.svelte +8 -8
  139. package/dist/components/tabs/components/Tab.svelte +14 -14
  140. package/dist/components/tabs/components/Tabs.svelte +7 -7
  141. package/dist/components/tag/Tag.stories.svelte +57 -57
  142. package/dist/components/tag/Tag.svelte +95 -95
  143. package/dist/components/textarea/Textarea.stories.svelte +70 -70
  144. package/dist/components/textarea/Textarea.svelte +76 -76
  145. package/dist/components/toast/Toast.stories.svelte +204 -204
  146. package/dist/components/toast/Toast.svelte +53 -53
  147. package/dist/components/toggle/Toggle.stories.svelte +9 -9
  148. package/dist/components/toggle/Toggle.svelte +53 -53
  149. package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte +152 -152
  150. package/dist/components/toggle-icon-button/ToggleIconButton.svelte +99 -99
  151. package/dist/components/tooltip/Tooltip.stories.svelte +85 -111
  152. package/dist/components/tooltip/Tooltip.svelte +57 -46
  153. package/dist/components/tooltip/Tooltip.svelte.d.ts +1 -1
  154. package/dist/components/tooltip/TooltipTest.svelte +31 -0
  155. package/dist/components/tooltip/TooltipTest.svelte.d.ts +11 -0
  156. package/dist/fonts/index.js +1 -1
  157. package/dist/index.d.ts +0 -1
  158. package/dist/index.js +0 -1
  159. package/dist/notifications.d.ts +1 -4
  160. package/dist/notifications.js +1 -1
  161. package/dist/tailwind-safelist.js +406 -406
  162. package/dist/tailwind.preset.js +10 -10
  163. package/dist/tokens/colors.js +18 -18
  164. package/dist/tokens/typography.js +6 -6
  165. package/dist/tokens.js +19 -19
  166. package/dist/types/fonts.d.ts +2 -2
  167. package/package.json +199 -204
  168. package/dist/components/select/Select.svelte +0 -139
  169. package/dist/components/select/Select.svelte.d.ts +0 -60
  170. package/dist/components/select-new/Select.stories.svelte +0 -219
  171. package/dist/components/select-new/Select.stories.svelte.d.ts +0 -19
  172. package/dist/components/select-new/components/Group.svelte +0 -24
  173. package/dist/components/select-new/components/MultiSelectTrigger.svelte +0 -66
  174. package/dist/components/select-new/components/SelectContent.svelte +0 -33
  175. package/dist/components/select-new/components/SelectGroupHeading.svelte +0 -19
  176. package/dist/components/select-new/components/SelectItem.svelte +0 -39
  177. package/dist/components/select-new/components/SelectTrigger.svelte +0 -48
  178. package/dist/components/select-new/index.d.ts +0 -10
  179. package/dist/components/select-new/index.js +0 -12
  180. /package/dist/components/{select-new → select}/components/Group.svelte.d.ts +0 -0
  181. /package/dist/components/{select-new → select}/components/MultiSelectTrigger.svelte.d.ts +0 -0
  182. /package/dist/components/{select-new → select}/components/SelectContent.svelte.d.ts +0 -0
  183. /package/dist/components/{select-new → select}/components/SelectGroupHeading.svelte.d.ts +0 -0
  184. /package/dist/components/{select-new → select}/components/SelectItem.svelte.d.ts +0 -0
  185. /package/dist/components/{select-new → select}/components/SelectTrigger.svelte.d.ts +0 -0
  186. /package/dist/components/{select-new → select}/types.d.ts +0 -0
  187. /package/dist/components/{select-new → select}/types.js +0 -0
@@ -1,94 +1,94 @@
1
1
  <script lang="ts">
2
- import type { Snippet } from 'svelte';
3
- import type { HTMLTextareaAttributes } from 'svelte/elements';
2
+ import type { Snippet } from 'svelte';
3
+ import type { HTMLTextareaAttributes } from 'svelte/elements';
4
4
 
5
- interface TextareaProps extends HTMLTextareaAttributes {
6
- oninput?: (event: Event) => void;
7
- onblur?: (event: Event) => void;
8
- onkeydown?: (event: KeyboardEvent) => void;
9
- input?: HTMLTextAreaElement;
10
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'dynamic';
11
- label?: string;
12
- error?: Snippet;
13
- placeholder?: string;
14
- }
5
+ interface TextareaProps extends HTMLTextareaAttributes {
6
+ oninput?: (event: Event) => void;
7
+ onblur?: (event: Event) => void;
8
+ onkeydown?: (event: KeyboardEvent) => void;
9
+ input?: HTMLTextAreaElement;
10
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'dynamic';
11
+ label?: string;
12
+ error?: Snippet;
13
+ placeholder?: string;
14
+ }
15
15
 
16
- let {
17
- value = $bindable(),
18
- oninput = () => {},
19
- onblur = () => {},
20
- onkeydown = () => {},
21
- input = $bindable(),
22
- label,
23
- placeholder,
24
- error,
25
- id,
26
- size = 'md',
27
- class: className,
28
- ...rest
29
- }: TextareaProps = $props();
16
+ let {
17
+ value = $bindable(),
18
+ oninput = () => {},
19
+ onblur = () => {},
20
+ onkeydown = () => {},
21
+ input = $bindable(),
22
+ label,
23
+ placeholder,
24
+ error,
25
+ id,
26
+ size = 'md',
27
+ class: className,
28
+ ...rest
29
+ }: TextareaProps = $props();
30
30
 
31
- const textareaId = crypto.randomUUID();
32
- const inputId = $derived(id ?? textareaId);
31
+ const textareaId = crypto.randomUUID();
32
+ const inputId = $derived(id ?? textareaId);
33
33
 
34
- function handleInputInternal(event: Event) {
35
- if (rest.readonly) return;
36
- const target = event.target as HTMLTextAreaElement;
37
- value = target.value;
38
- autoResizeTextarea(target);
39
- oninput(event);
40
- }
34
+ function handleInputInternal(event: Event) {
35
+ if (rest.readonly) return;
36
+ const target = event.target as HTMLTextAreaElement;
37
+ value = target.value;
38
+ autoResizeTextarea(target);
39
+ oninput(event);
40
+ }
41
41
 
42
- function autoResizeTextarea(textarea: HTMLTextAreaElement) {
43
- const maxHeight = 200;
44
- textarea.style.height = 'auto';
45
- if (textarea.scrollHeight < maxHeight) {
46
- textarea.style.height = `${textarea.scrollHeight}px`;
47
- textarea.style.overflowY = 'hidden';
48
- } else {
49
- textarea.style.height = `${maxHeight}px`;
50
- textarea.style.overflowY = 'auto';
51
- }
52
- }
42
+ function autoResizeTextarea(textarea: HTMLTextAreaElement) {
43
+ const maxHeight = 200;
44
+ textarea.style.height = 'auto';
45
+ if (textarea.scrollHeight < maxHeight) {
46
+ textarea.style.height = `${textarea.scrollHeight}px`;
47
+ textarea.style.overflowY = 'hidden';
48
+ } else {
49
+ textarea.style.height = `${maxHeight}px`;
50
+ textarea.style.overflowY = 'auto';
51
+ }
52
+ }
53
53
 
54
- function handleBlurInternal(event: Event) {
55
- onblur(event);
56
- }
54
+ function handleBlurInternal(event: Event) {
55
+ onblur(event);
56
+ }
57
57
 
58
- export function focus() {
59
- input?.focus();
60
- }
58
+ export function focus() {
59
+ input?.focus();
60
+ }
61
61
 
62
- $effect(() => {
63
- if (input && value) {
64
- autoResizeTextarea(input);
65
- }
66
- });
62
+ $effect(() => {
63
+ if (input && value) {
64
+ autoResizeTextarea(input);
65
+ }
66
+ });
67
67
  </script>
68
68
 
69
69
  {#if label}
70
- <label for={inputId} class="block px-1 py-2 text-sm text-secondary">
71
- {label}
72
- {#if rest.required}
73
- <span class="ml-0.5 text-danger">*</span>
74
- {/if}
75
- </label>
70
+ <label for={inputId} class="block px-1 py-2 text-sm text-secondary">
71
+ {label}
72
+ {#if rest.required}
73
+ <span class="ml-0.5 text-danger">*</span>
74
+ {/if}
75
+ </label>
76
76
  {/if}
77
77
 
78
78
  <textarea
79
- id={inputId}
80
- class="flex w-full items-center gap-1 rounded-lg border border-input bg-surface px-3 py-2 shadow-input focus-within:border-focus hover:border-hover {className ??
81
- ''}"
82
- class:!border-error={error}
83
- class:has-text={value}
84
- class:has-placeholder={placeholder}
85
- {placeholder}
86
- oninput={handleInputInternal}
87
- onblur={handleBlurInternal}
88
- bind:this={input}
89
- {value}
90
- {...rest}
91
- {onkeydown}
79
+ id={inputId}
80
+ class="flex w-full items-center gap-1 rounded-lg border border-input bg-surface px-3 py-2 shadow-input focus-within:border-focus hover:border-hover {className ??
81
+ ''}"
82
+ class:!border-error={error}
83
+ class:has-text={value}
84
+ class:has-placeholder={placeholder}
85
+ {placeholder}
86
+ oninput={handleInputInternal}
87
+ onblur={handleBlurInternal}
88
+ bind:this={input}
89
+ {value}
90
+ {...rest}
91
+ {onkeydown}
92
92
  ></textarea>
93
93
 
94
94
  {@render error?.()}
@@ -1,209 +1,209 @@
1
1
  <script module lang="ts">
2
- import type { Notification } from '../../../notifications';
3
- import Toast from './Toast.svelte';
4
- import { defineMeta } from '@storybook/addon-svelte-csf';
5
-
6
- const { Story } = defineMeta({
7
- component: Toast,
8
- title: 'Design System/Toast',
9
- tags: ['autodocs']
10
- });
11
-
12
- const defaultNotification: Notification = {
13
- id: '1',
14
- type: 'default',
15
- message: 'This is a default notification',
16
- dismissable: false
17
- };
18
-
19
- const dangerNotification: Notification = {
20
- id: '2',
21
- type: 'danger',
22
- message: 'This is a danger notification',
23
- dismissable: false
24
- };
25
-
26
- const warningNotification: Notification = {
27
- id: '3',
28
- type: 'warning',
29
- message: 'This is a warning notification',
30
- dismissable: false
31
- };
32
-
33
- const infoNotification: Notification = {
34
- id: '4',
35
- type: 'info',
36
- message: 'This is an info notification',
37
- dismissable: false
38
- };
39
-
40
- const successNotification: Notification = {
41
- id: '5',
42
- type: 'success',
43
- message: 'This is a success notification',
44
- dismissable: false
45
- };
46
-
47
- const defaultIconNotification: Notification = {
48
- id: '6',
49
- type: 'default',
50
- message: 'This is a default notification with icon',
51
- icon: 'Bell',
52
- dismissable: false
53
- };
54
-
55
- const dangerIconNotification: Notification = {
56
- id: '7',
57
- type: 'danger',
58
- message: 'This is a danger notification with icon',
59
- icon: 'SealWarning',
60
- dismissable: false
61
- };
62
-
63
- const warningIconNotification: Notification = {
64
- id: '8',
65
- type: 'warning',
66
- message: 'This is a warning notification with icon',
67
- icon: 'Warning',
68
- dismissable: false
69
- };
70
-
71
- const infoIconNotification: Notification = {
72
- id: '9',
73
- type: 'info',
74
- message: 'This is an info notification with icon',
75
- icon: 'Info',
76
- dismissable: false
77
- };
78
-
79
- const successIconNotification: Notification = {
80
- id: '10',
81
- type: 'success',
82
- message: 'This is a success notification with icon',
83
- icon: 'Check',
84
- dismissable: false
85
- };
86
-
87
- const defaultDismissableNotificationWithIcon: Notification = {
88
- id: '11',
89
- type: 'default',
90
- message: 'This is a dismissable default notification with icon',
91
- icon: 'Bell',
92
- dismissable: true
93
- };
94
-
95
- const dangerDismissableNotificationWithIcon: Notification = {
96
- id: '12',
97
- type: 'danger',
98
- message: 'This is a dismissable danger notification with icon',
99
- icon: 'SealWarning',
100
- dismissable: true
101
- };
102
-
103
- const warningDismissableNotificationWithIcon: Notification = {
104
- id: '13',
105
- type: 'warning',
106
- message: 'This is a dismissable warning notification with icon',
107
- icon: 'Warning',
108
- dismissable: true
109
- };
110
-
111
- const infoDismissableNotificationWithIcon: Notification = {
112
- id: '14',
113
- type: 'info',
114
- message: 'This is a dismissable info notification with icon',
115
- icon: 'Info',
116
- dismissable: true
117
- };
118
-
119
- const successDismissableNotificationWithIcon: Notification = {
120
- id: '15',
121
- type: 'success',
122
- message: 'This is a dismissable success notification with icon',
123
- icon: 'Check',
124
- dismissable: true
125
- };
126
-
127
- const defaultDismissableNoIconNotification: Notification = {
128
- id: '16',
129
- type: 'default',
130
- message: 'This is a dismissable default notification without icon',
131
- dismissable: true
132
- };
133
-
134
- const dangerDismissableNoIconNotification: Notification = {
135
- id: '17',
136
- type: 'danger',
137
- message: 'This is a dismissable danger notification without icon',
138
- dismissable: true
139
- };
140
-
141
- const warningDismissableNoIconNotification: Notification = {
142
- id: '18',
143
- type: 'warning',
144
- message: 'This is a dismissable warning notification without icon',
145
- dismissable: true
146
- };
147
-
148
- const infoDismissableNoIconNotification: Notification = {
149
- id: '19',
150
- type: 'info',
151
- message: 'This is a dismissable info notification without icon',
152
- dismissable: true
153
- };
154
-
155
- const successDismissableNoIconNotification: Notification = {
156
- id: '20',
157
- type: 'success',
158
- message: 'This is a dismissable success notification without icon',
159
- dismissable: true
160
- };
2
+ import type { Notification } from '../../../notifications';
3
+ import Toast from './Toast.svelte';
4
+ import { defineMeta } from '@storybook/addon-svelte-csf';
5
+
6
+ const { Story } = defineMeta({
7
+ component: Toast,
8
+ title: 'Design System/Toast',
9
+ tags: ['autodocs'],
10
+ });
11
+
12
+ const defaultNotification: Notification = {
13
+ id: '1',
14
+ type: 'default',
15
+ message: 'This is a default notification',
16
+ dismissable: false,
17
+ };
18
+
19
+ const dangerNotification: Notification = {
20
+ id: '2',
21
+ type: 'danger',
22
+ message: 'This is a danger notification',
23
+ dismissable: false,
24
+ };
25
+
26
+ const warningNotification: Notification = {
27
+ id: '3',
28
+ type: 'warning',
29
+ message: 'This is a warning notification',
30
+ dismissable: false,
31
+ };
32
+
33
+ const infoNotification: Notification = {
34
+ id: '4',
35
+ type: 'info',
36
+ message: 'This is an info notification',
37
+ dismissable: false,
38
+ };
39
+
40
+ const successNotification: Notification = {
41
+ id: '5',
42
+ type: 'success',
43
+ message: 'This is a success notification',
44
+ dismissable: false,
45
+ };
46
+
47
+ const defaultIconNotification: Notification = {
48
+ id: '6',
49
+ type: 'default',
50
+ message: 'This is a default notification with icon',
51
+ icon: 'Bell',
52
+ dismissable: false,
53
+ };
54
+
55
+ const dangerIconNotification: Notification = {
56
+ id: '7',
57
+ type: 'danger',
58
+ message: 'This is a danger notification with icon',
59
+ icon: 'SealWarning',
60
+ dismissable: false,
61
+ };
62
+
63
+ const warningIconNotification: Notification = {
64
+ id: '8',
65
+ type: 'warning',
66
+ message: 'This is a warning notification with icon',
67
+ icon: 'Warning',
68
+ dismissable: false,
69
+ };
70
+
71
+ const infoIconNotification: Notification = {
72
+ id: '9',
73
+ type: 'info',
74
+ message: 'This is an info notification with icon',
75
+ icon: 'Info',
76
+ dismissable: false,
77
+ };
78
+
79
+ const successIconNotification: Notification = {
80
+ id: '10',
81
+ type: 'success',
82
+ message: 'This is a success notification with icon',
83
+ icon: 'Check',
84
+ dismissable: false,
85
+ };
86
+
87
+ const defaultDismissableNotificationWithIcon: Notification = {
88
+ id: '11',
89
+ type: 'default',
90
+ message: 'This is a dismissable default notification with icon',
91
+ icon: 'Bell',
92
+ dismissable: true,
93
+ };
94
+
95
+ const dangerDismissableNotificationWithIcon: Notification = {
96
+ id: '12',
97
+ type: 'danger',
98
+ message: 'This is a dismissable danger notification with icon',
99
+ icon: 'SealWarning',
100
+ dismissable: true,
101
+ };
102
+
103
+ const warningDismissableNotificationWithIcon: Notification = {
104
+ id: '13',
105
+ type: 'warning',
106
+ message: 'This is a dismissable warning notification with icon',
107
+ icon: 'Warning',
108
+ dismissable: true,
109
+ };
110
+
111
+ const infoDismissableNotificationWithIcon: Notification = {
112
+ id: '14',
113
+ type: 'info',
114
+ message: 'This is a dismissable info notification with icon',
115
+ icon: 'Info',
116
+ dismissable: true,
117
+ };
118
+
119
+ const successDismissableNotificationWithIcon: Notification = {
120
+ id: '15',
121
+ type: 'success',
122
+ message: 'This is a dismissable success notification with icon',
123
+ icon: 'Check',
124
+ dismissable: true,
125
+ };
126
+
127
+ const defaultDismissableNoIconNotification: Notification = {
128
+ id: '16',
129
+ type: 'default',
130
+ message: 'This is a dismissable default notification without icon',
131
+ dismissable: true,
132
+ };
133
+
134
+ const dangerDismissableNoIconNotification: Notification = {
135
+ id: '17',
136
+ type: 'danger',
137
+ message: 'This is a dismissable danger notification without icon',
138
+ dismissable: true,
139
+ };
140
+
141
+ const warningDismissableNoIconNotification: Notification = {
142
+ id: '18',
143
+ type: 'warning',
144
+ message: 'This is a dismissable warning notification without icon',
145
+ dismissable: true,
146
+ };
147
+
148
+ const infoDismissableNoIconNotification: Notification = {
149
+ id: '19',
150
+ type: 'info',
151
+ message: 'This is a dismissable info notification without icon',
152
+ dismissable: true,
153
+ };
154
+
155
+ const successDismissableNoIconNotification: Notification = {
156
+ id: '20',
157
+ type: 'success',
158
+ message: 'This is a dismissable success notification without icon',
159
+ dismissable: true,
160
+ };
161
161
  </script>
162
162
 
163
163
  <Story name="Notifications" asChild>
164
- <div class="space-y-8">
165
- <div class="space-y-4">
166
- <h5 class="text-lg font-semibold">Basic Notifications</h5>
167
- <div class="space-y-2">
168
- <Toast notification={defaultNotification} />
169
- <Toast notification={dangerNotification} />
170
- <Toast notification={warningNotification} />
171
- <Toast notification={infoNotification} />
172
- <Toast notification={successNotification} />
173
- </div>
174
- </div>
175
-
176
- <div class="space-y-4">
177
- <h5 class="text-lg font-semibold">Notifications with Icons</h5>
178
- <div class="space-y-2">
179
- <Toast notification={defaultIconNotification} />
180
- <Toast notification={dangerIconNotification} />
181
- <Toast notification={warningIconNotification} />
182
- <Toast notification={infoIconNotification} />
183
- <Toast notification={successIconNotification} />
184
- </div>
185
- </div>
186
-
187
- <div class="space-y-4">
188
- <h5 class="text-lg font-semibold">Dismissable Notifications</h5>
189
- <div class="space-y-2">
190
- <Toast notification={defaultDismissableNoIconNotification} />
191
- <Toast notification={dangerDismissableNoIconNotification} />
192
- <Toast notification={warningDismissableNoIconNotification} />
193
- <Toast notification={infoDismissableNoIconNotification} />
194
- <Toast notification={successDismissableNoIconNotification} />
195
- </div>
196
- </div>
197
-
198
- <div class="space-y-4">
199
- <h5 class="text-lg font-semibold">Dismissable Notifications with Icons</h5>
200
- <div class="space-y-2">
201
- <Toast notification={defaultDismissableNotificationWithIcon} />
202
- <Toast notification={dangerDismissableNotificationWithIcon} />
203
- <Toast notification={warningDismissableNotificationWithIcon} />
204
- <Toast notification={infoDismissableNotificationWithIcon} />
205
- <Toast notification={successDismissableNotificationWithIcon} />
206
- </div>
207
- </div>
208
- </div>
164
+ <div class="space-y-8">
165
+ <div class="space-y-4">
166
+ <h5 class="text-lg font-semibold">Basic Notifications</h5>
167
+ <div class="space-y-2">
168
+ <Toast notification={defaultNotification} />
169
+ <Toast notification={dangerNotification} />
170
+ <Toast notification={warningNotification} />
171
+ <Toast notification={infoNotification} />
172
+ <Toast notification={successNotification} />
173
+ </div>
174
+ </div>
175
+
176
+ <div class="space-y-4">
177
+ <h5 class="text-lg font-semibold">Notifications with Icons</h5>
178
+ <div class="space-y-2">
179
+ <Toast notification={defaultIconNotification} />
180
+ <Toast notification={dangerIconNotification} />
181
+ <Toast notification={warningIconNotification} />
182
+ <Toast notification={infoIconNotification} />
183
+ <Toast notification={successIconNotification} />
184
+ </div>
185
+ </div>
186
+
187
+ <div class="space-y-4">
188
+ <h5 class="text-lg font-semibold">Dismissable Notifications</h5>
189
+ <div class="space-y-2">
190
+ <Toast notification={defaultDismissableNoIconNotification} />
191
+ <Toast notification={dangerDismissableNoIconNotification} />
192
+ <Toast notification={warningDismissableNoIconNotification} />
193
+ <Toast notification={infoDismissableNoIconNotification} />
194
+ <Toast notification={successDismissableNoIconNotification} />
195
+ </div>
196
+ </div>
197
+
198
+ <div class="space-y-4">
199
+ <h5 class="text-lg font-semibold">Dismissable Notifications with Icons</h5>
200
+ <div class="space-y-2">
201
+ <Toast notification={defaultDismissableNotificationWithIcon} />
202
+ <Toast notification={dangerDismissableNotificationWithIcon} />
203
+ <Toast notification={warningDismissableNotificationWithIcon} />
204
+ <Toast notification={infoDismissableNotificationWithIcon} />
205
+ <Toast notification={successDismissableNotificationWithIcon} />
206
+ </div>
207
+ </div>
208
+ </div>
209
209
  </Story>