@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.
- package/README.md +5 -1
- package/dist/app.css +97 -97
- package/dist/components/activity/Activity.stories.svelte +104 -104
- package/dist/components/activity/Activity.svelte +112 -112
- package/dist/components/avatar/Avatar.stories.svelte +23 -23
- package/dist/components/avatar/Avatar.svelte +54 -54
- package/dist/components/banner/Banner.stories.svelte +105 -105
- package/dist/components/banner/Banner.svelte +42 -42
- package/dist/components/button/Button.stories.svelte +61 -61
- package/dist/components/button/Button.svelte +95 -95
- package/dist/components/card/Card.stories.svelte +112 -112
- package/dist/components/card/Card.svelte +18 -18
- package/dist/components/checkbox/Checkbox.stories.svelte +8 -8
- package/dist/components/checkbox/Checkbox.svelte +17 -17
- package/dist/components/collapsible/Collapsible.stories.svelte +26 -26
- package/dist/components/collapsible/components/collapsible-content.svelte +20 -20
- package/dist/components/collapsible/components/collapsible-trigger.svelte +12 -12
- package/dist/components/collapsible/index.d.ts +1 -1
- package/dist/components/combobox/Combobox.stories.svelte +412 -412
- package/dist/components/combobox/components/combobox-add.svelte +8 -8
- package/dist/components/combobox/components/combobox-content.svelte +39 -39
- package/dist/components/combobox/components/combobox-indicator.svelte +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/datepicker/DatePicker.stories.svelte +196 -196
- package/dist/components/datepicker/DatePicker.svelte +173 -173
- package/dist/components/divider/Divider.stories.svelte +7 -7
- package/dist/components/divider/Divider.svelte +9 -9
- package/dist/components/drawer/Drawer.stories.svelte +51 -51
- package/dist/components/drawer/Drawer.svelte +33 -33
- package/dist/components/drawer/DrawerLabel.svelte +10 -10
- package/dist/components/dropdown/Dropdown.stories.svelte +210 -210
- package/dist/components/dropdown/Dropdown.svelte +57 -57
- package/dist/components/dropdown/components/DropdownContent.svelte +16 -16
- package/dist/components/dropdown/components/DropdownMenu.svelte +10 -10
- package/dist/components/dropdown/components/DropdownTrigger.svelte +37 -37
- package/dist/components/dropdown/components/OutlinedButton.svelte +9 -9
- package/dist/components/empty-content/EmptyContent.stories.svelte +38 -38
- package/dist/components/empty-content/EmptyContent.svelte +12 -12
- package/dist/components/graphs/bar-chart/BarChart.stories.svelte +91 -91
- package/dist/components/graphs/bar-chart/BarChart.svelte +147 -147
- package/dist/components/graphs/bar-chart/StackedBarChart.stories.svelte +57 -57
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte +198 -199
- package/dist/components/graphs/chart/Chart.stories.svelte +96 -96
- package/dist/components/graphs/chart/Chart.svelte +207 -207
- package/dist/components/graphs/line/LineChart.stories.svelte +138 -138
- package/dist/components/graphs/line/LineChart.svelte +140 -142
- package/dist/components/graphs/matrix/Matrix.stories.svelte +117 -117
- package/dist/components/graphs/matrix/Matrix.svelte +141 -141
- package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +168 -168
- package/dist/components/graphs/multiline/MultiLineChart.svelte +236 -236
- package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte +84 -84
- package/dist/components/graphs/scatterplot/Scatterplot.svelte +302 -302
- package/dist/components/graphs/utils/duration.d.ts +1 -0
- package/dist/components/graphs/utils/duration.js +33 -0
- package/dist/components/graphs/utils/tooltipFormatter.js +1 -1
- package/dist/components/icon-button/IconButton.stories.svelte +64 -64
- package/dist/components/icon-button/IconButton.svelte +88 -88
- package/dist/components/icons/AnalysisIcon.stories.svelte +18 -18
- package/dist/components/icons/AnalysisIcon.svelte +96 -96
- package/dist/components/icons/Icon.stories.svelte +111 -111
- package/dist/components/icons/Icon.svelte +17 -17
- package/dist/components/icons/PrincipalIcon.svelte +59 -59
- package/dist/components/icons/custom/Halo.svelte +31 -31
- package/dist/components/icons/custom/Well.svelte +27 -27
- package/dist/components/icons/index.js +1 -1
- package/dist/components/image/Image.svelte +42 -42
- package/dist/components/input/Input.stories.svelte +55 -55
- package/dist/components/input/Input.svelte +121 -121
- package/dist/components/label/Label.stories.svelte +18 -18
- package/dist/components/label/Label.svelte +11 -11
- package/dist/components/list/List.stories.svelte +84 -84
- package/dist/components/list/List.svelte +20 -20
- package/dist/components/logo/Logo.stories.svelte +15 -15
- package/dist/components/logo/Logo.svelte +30 -30
- package/dist/components/manual-cfu-counter/ManualCFUCounter.stories.svelte +102 -102
- package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte +557 -557
- package/dist/components/manual-cfu-counter/test/ManualCFUCounterTestWrapper.svelte +11 -11
- package/dist/components/markdown/Markdown.stories.svelte +10 -10
- package/dist/components/markdown/Markdown.svelte +6 -6
- package/dist/components/modal/Modal.stories.svelte +29 -29
- package/dist/components/modal/Modal.svelte +71 -71
- package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte +201 -201
- package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte +606 -606
- package/dist/components/multi-cfu-counter/test/MultiCFUCounterTestWrapper.svelte +17 -17
- package/dist/components/notification-popup/NotificationPopup.stories.svelte +18 -18
- package/dist/components/notification-popup/NotificationPopup.svelte +26 -26
- package/dist/components/notifications/Notifications.stories.svelte +101 -101
- package/dist/components/notifications/Notifications.svelte +9 -9
- package/dist/components/pill/Pill.stories.svelte +8 -8
- package/dist/components/pill/Pill.svelte +27 -27
- package/dist/components/progress-circle/ProgressCircle.stories.svelte +8 -8
- package/dist/components/progress-circle/ProgressCircle.svelte +54 -54
- package/dist/components/required-status-indicator/RequiredStatusIndicator.stories.svelte +18 -18
- package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte +14 -14
- package/dist/components/segmented-control-buttons/ControlButton.svelte +36 -36
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +35 -35
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +13 -13
- package/dist/components/select/Select.stories.svelte +200 -94
- package/dist/components/select/Select.stories.svelte.d.ts +1 -1
- package/dist/components/select/components/Group.svelte +24 -0
- package/dist/components/select/components/MultiSelectTrigger.svelte +66 -0
- package/dist/components/select/components/SelectContent.svelte +33 -0
- package/dist/components/select/components/SelectGroupHeading.svelte +19 -0
- package/dist/components/select/components/SelectItem.svelte +39 -0
- package/dist/components/select/components/SelectTrigger.svelte +48 -0
- package/dist/components/select/index.d.ts +10 -7
- package/dist/components/select/index.js +12 -1
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte +102 -87
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte.d.ts +1 -1
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte +53 -53
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte.d.ts +1 -1
- package/dist/components/sjsf-wrappers/sjsfCustomTheme.js +1 -1
- package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte +32 -32
- package/dist/components/skeleton-loader/SkeletonLoader.svelte +10 -10
- package/dist/components/skeleton-loader/StatcardSkeleton.svelte +9 -9
- package/dist/components/skeleton-loader/components/Skeleton.svelte +7 -7
- package/dist/components/skeleton-loader/components/SkeletonImage.svelte +12 -12
- package/dist/components/slider/Slider.stories.svelte +23 -23
- package/dist/components/slider/Slider.svelte +107 -107
- package/dist/components/spinner/Spinner.stories.svelte +8 -8
- package/dist/components/spinner/Spinner.svelte +18 -18
- package/dist/components/stat-card/StatCard.stories.svelte +26 -26
- package/dist/components/stat-card/StatCard.svelte +128 -128
- package/dist/components/status-badge/StatusBadge.stories.svelte +365 -365
- package/dist/components/status-badge/StatusBadge.svelte +54 -54
- package/dist/components/stepper/Stepper.stories.svelte +219 -219
- package/dist/components/stepper/components/stepper-root.svelte +12 -12
- package/dist/components/stepper/components/stepper-step.svelte +83 -83
- package/dist/components/table/Table.stories.svelte +87 -87
- package/dist/components/table/Table.svelte +32 -32
- package/dist/components/table/components/TBody.svelte +7 -7
- package/dist/components/table/components/THead.svelte +7 -7
- package/dist/components/table/components/Td.svelte +8 -8
- package/dist/components/table/components/Th.svelte +8 -8
- package/dist/components/table/components/Tr.svelte +11 -11
- package/dist/components/tabs/Tabs.stories.svelte +20 -20
- package/dist/components/tabs/Tabs.svelte +8 -8
- package/dist/components/tabs/components/Content.svelte +8 -8
- package/dist/components/tabs/components/Tab.svelte +14 -14
- package/dist/components/tabs/components/Tabs.svelte +7 -7
- package/dist/components/tag/Tag.stories.svelte +57 -57
- package/dist/components/tag/Tag.svelte +95 -95
- package/dist/components/textarea/Textarea.stories.svelte +70 -70
- package/dist/components/textarea/Textarea.svelte +76 -76
- package/dist/components/toast/Toast.stories.svelte +204 -204
- package/dist/components/toast/Toast.svelte +53 -53
- package/dist/components/toggle/Toggle.stories.svelte +9 -9
- package/dist/components/toggle/Toggle.svelte +53 -53
- package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte +152 -152
- package/dist/components/toggle-icon-button/ToggleIconButton.svelte +99 -99
- package/dist/components/tooltip/Tooltip.stories.svelte +85 -111
- package/dist/components/tooltip/Tooltip.svelte +57 -46
- package/dist/components/tooltip/Tooltip.svelte.d.ts +1 -1
- package/dist/components/tooltip/TooltipTest.svelte +31 -0
- package/dist/components/tooltip/TooltipTest.svelte.d.ts +11 -0
- package/dist/fonts/index.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/notifications.d.ts +1 -4
- package/dist/notifications.js +1 -1
- package/dist/tailwind-safelist.js +406 -406
- package/dist/tailwind.preset.js +10 -10
- package/dist/tokens/colors.js +18 -18
- package/dist/tokens/typography.js +6 -6
- package/dist/tokens.js +19 -19
- package/dist/types/fonts.d.ts +2 -2
- package/package.json +199 -204
- package/dist/components/select/Select.svelte +0 -139
- package/dist/components/select/Select.svelte.d.ts +0 -60
- package/dist/components/select-new/Select.stories.svelte +0 -219
- package/dist/components/select-new/Select.stories.svelte.d.ts +0 -19
- package/dist/components/select-new/components/Group.svelte +0 -24
- package/dist/components/select-new/components/MultiSelectTrigger.svelte +0 -66
- package/dist/components/select-new/components/SelectContent.svelte +0 -33
- package/dist/components/select-new/components/SelectGroupHeading.svelte +0 -19
- package/dist/components/select-new/components/SelectItem.svelte +0 -39
- package/dist/components/select-new/components/SelectTrigger.svelte +0 -48
- package/dist/components/select-new/index.d.ts +0 -10
- package/dist/components/select-new/index.js +0 -12
- /package/dist/components/{select-new → select}/components/Group.svelte.d.ts +0 -0
- /package/dist/components/{select-new → select}/components/MultiSelectTrigger.svelte.d.ts +0 -0
- /package/dist/components/{select-new → select}/components/SelectContent.svelte.d.ts +0 -0
- /package/dist/components/{select-new → select}/components/SelectGroupHeading.svelte.d.ts +0 -0
- /package/dist/components/{select-new → select}/components/SelectItem.svelte.d.ts +0 -0
- /package/dist/components/{select-new → select}/components/SelectTrigger.svelte.d.ts +0 -0
- /package/dist/components/{select-new → select}/types.d.ts +0 -0
- /package/dist/components/{select-new → select}/types.js +0 -0
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLTextareaAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
31
|
+
const textareaId = crypto.randomUUID();
|
|
32
|
+
const inputId = $derived(id ?? textareaId);
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
function handleBlurInternal(event: Event) {
|
|
55
|
+
onblur(event);
|
|
56
|
+
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
export function focus() {
|
|
59
|
+
input?.focus();
|
|
60
|
+
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
$effect(() => {
|
|
63
|
+
if (input && value) {
|
|
64
|
+
autoResizeTextarea(input);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
67
|
</script>
|
|
68
68
|
|
|
69
69
|
{#if label}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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>
|