@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,26 +1,26 @@
|
|
|
1
1
|
<!-- src/lib/design-system/src/lib/components/manual-cfu-counter/ManualCFUCounterTestWrapper.svelte -->
|
|
2
2
|
<script lang="ts">
|
|
3
|
-
|
|
3
|
+
import MultiCFUCounter from '../MultiCFUCounter.svelte';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
interface Props {
|
|
6
|
+
initialTestMarks?: Array<{ x: number; y: number }>;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
onclick?: (event: MouseEvent, marks: Array<{ x: number; y: number }>) => void;
|
|
9
|
+
activeMarkerName?: string;
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
let {
|
|
13
|
+
initialTestMarks = [],
|
|
14
|
+
imageUrl = 'test-image.jpg',
|
|
15
|
+
onclick,
|
|
16
|
+
activeMarkerName = 'Test Marker',
|
|
17
|
+
}: Props = $props();
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
let marks = $state([...initialTestMarks]);
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
export function getCurrentMarks() {
|
|
22
|
+
return marks;
|
|
23
|
+
}
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<MultiCFUCounter bind:marks {imageUrl} {onclick} {activeMarkerName} />
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import NotificationPopup from './NotificationPopup.svelte';
|
|
3
|
+
import { Icon } from '../icons';
|
|
4
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
component: NotificationPopup,
|
|
8
|
+
title: 'Design System/NotificationPopup',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
let visible = true;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function handleClick() {
|
|
15
|
+
visible = !visible;
|
|
16
|
+
}
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<Story name="Primary" asChild>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
<NotificationPopup onClose={handleClick} title="See what's new" {visible}>
|
|
21
|
+
<a href="_blank" color="transparent" class="flex items-center gap-2">
|
|
22
|
+
<Icon iconName="Sparkle" />
|
|
23
|
+
<p>Product updates</p>
|
|
24
|
+
</a>
|
|
25
|
+
</NotificationPopup>
|
|
26
26
|
</Story>
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { IconButton } from '../icon-button/';
|
|
3
|
+
import { fade, fly } from 'svelte/transition';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
import { Icon } from '../icons';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
interface Props {
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
title: string;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
id?: string | undefined;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
let { onClose, title, visible, id = undefined, children }: Props = $props();
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
{#if visible}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
<div
|
|
20
|
+
{id}
|
|
21
|
+
class="flex w-[200px] justify-between rounded-lg bg-surface p-3 shadow-menu"
|
|
22
|
+
in:fly={{ y: 100, duration: 1000 }}
|
|
23
|
+
out:fade
|
|
24
|
+
>
|
|
25
|
+
<div class="flex flex-col gap-2">
|
|
26
|
+
<h6 class="flex h-6 items-center">{title}</h6>
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
</div>
|
|
29
|
+
<IconButton size="xs" variant="transparent" rounded={false} onclick={onClose}>
|
|
30
|
+
<Icon iconName="X" />
|
|
31
|
+
</IconButton>
|
|
32
|
+
</div>
|
|
33
33
|
{/if}
|
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { notifications } from '../../notifications';
|
|
3
|
+
import Button from '../button/Button.svelte';
|
|
4
|
+
import Notifications from '../notifications/Notifications.svelte';
|
|
5
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Notifications,
|
|
9
|
+
title: 'Design System/Notifications',
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
});
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<Story name="Notifications" asChild>
|
|
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
|
-
|
|
15
|
+
<Notifications></Notifications>
|
|
16
|
+
<div class="h-24 rounded-md border"></div>
|
|
17
|
+
<div class="pt-4">
|
|
18
|
+
<div class="flex flex-row justify-between gap-2">
|
|
19
|
+
<div class="flex flex-col gap-2">
|
|
20
|
+
<h5>Default</h5>
|
|
21
|
+
<Button
|
|
22
|
+
onClick={() => {
|
|
23
|
+
notifications.default('This is a default notification');
|
|
24
|
+
}}>Show default</Button
|
|
25
|
+
>
|
|
26
|
+
<Button
|
|
27
|
+
onClick={() => {
|
|
28
|
+
notifications.danger('This is a danger notification');
|
|
29
|
+
}}>Show danger</Button
|
|
30
|
+
>
|
|
31
|
+
<Button
|
|
32
|
+
onClick={() => {
|
|
33
|
+
notifications.warning('This is a warning notification');
|
|
34
|
+
}}>Show warning</Button
|
|
35
|
+
>
|
|
36
|
+
<Button
|
|
37
|
+
onClick={() => {
|
|
38
|
+
notifications.info('This is an info notification');
|
|
39
|
+
}}>Show info</Button
|
|
40
|
+
>
|
|
41
|
+
<Button
|
|
42
|
+
onClick={() => {
|
|
43
|
+
notifications.success('This is a success notification');
|
|
44
|
+
}}>Show success</Button
|
|
45
|
+
>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="grow"></div>
|
|
48
|
+
<div class="flex flex-col gap-2">
|
|
49
|
+
<h5>Icons</h5>
|
|
50
|
+
<Button
|
|
51
|
+
onClick={() => {
|
|
52
|
+
notifications.default('This is a default icon notification', 'Bell');
|
|
53
|
+
}}>Show default</Button
|
|
54
|
+
>
|
|
55
|
+
<Button
|
|
56
|
+
onClick={() => {
|
|
57
|
+
notifications.danger('This is a danger icon notification', 'SealWarning');
|
|
58
|
+
}}>Show danger</Button
|
|
59
|
+
>
|
|
60
|
+
<Button
|
|
61
|
+
onClick={() => {
|
|
62
|
+
notifications.warning('This is a warning icon notification', 'Warning');
|
|
63
|
+
}}>Show warning</Button
|
|
64
|
+
>
|
|
65
|
+
<Button
|
|
66
|
+
onClick={() => {
|
|
67
|
+
notifications.info('This is an info icon notification', 'Info');
|
|
68
|
+
}}>Show info</Button
|
|
69
|
+
>
|
|
70
|
+
<Button
|
|
71
|
+
onClick={() => {
|
|
72
|
+
notifications.success('This is a success icon notification', 'Check');
|
|
73
|
+
}}>Show success</Button
|
|
74
|
+
>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="grow"></div>
|
|
77
|
+
<div class="flex flex-col gap-2">
|
|
78
|
+
<h5>Dismissable</h5>
|
|
79
|
+
<Button
|
|
80
|
+
onClick={() => {
|
|
81
|
+
notifications.default('This is a default icon notification', 'Bell', true);
|
|
82
|
+
}}>Show default</Button
|
|
83
|
+
>
|
|
84
|
+
<Button
|
|
85
|
+
onClick={() => {
|
|
86
|
+
notifications.danger('This is a danger icon notification', 'SealWarning', true);
|
|
87
|
+
}}>Show danger</Button
|
|
88
|
+
>
|
|
89
|
+
<Button
|
|
90
|
+
onClick={() => {
|
|
91
|
+
notifications.warning('This is a warning icon notification', 'Warning', true);
|
|
92
|
+
}}>Show warning</Button
|
|
93
|
+
>
|
|
94
|
+
<Button
|
|
95
|
+
onClick={() => {
|
|
96
|
+
notifications.info('This is an info icon notification', 'Info', true);
|
|
97
|
+
}}>Show info</Button
|
|
98
|
+
>
|
|
99
|
+
<Button
|
|
100
|
+
onClick={() => {
|
|
101
|
+
notifications.success('This is a success icon notification', 'Check', true);
|
|
102
|
+
}}>Show success</Button
|
|
103
|
+
>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
107
|
</Story>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { flip } from 'svelte/animate';
|
|
3
|
+
import { fly } from 'svelte/transition';
|
|
4
|
+
import { notifications } from '../../notifications';
|
|
5
|
+
import Toast from '../toast/Toast.svelte';
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<div class="fixed left-0 right-0 top-2 z-50 mx-auto flex w-fit flex-col items-center justify-start">
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
{#each $notifications as notification (notification.id)}
|
|
10
|
+
<div animate:flip transition:fly={{ y: -10 }}>
|
|
11
|
+
<Toast {notification} />
|
|
12
|
+
</div>
|
|
13
|
+
{/each}
|
|
14
14
|
</div>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Pill from './Pill.svelte';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Design System/Pill',
|
|
8
|
+
component: Pill,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
});
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<Story name="Base" args={{ text: 'Example Pill' }} />
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
2
|
+
import { Icon } from '../icons';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string;
|
|
6
|
+
text: string;
|
|
7
|
+
type?: 'button' | 'submit';
|
|
8
|
+
testID?: string;
|
|
9
|
+
onclick?: () => void;
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
let { class: className = '', text, type = 'button', testID = '', onclick }: Props = $props();
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<button class="{className} " {onclick} {type} data-testid={testID}>
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
{text}
|
|
17
|
+
<Icon iconName="X" class="opacity-50" />
|
|
18
18
|
</button>
|
|
19
19
|
|
|
20
20
|
<style>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
button {
|
|
22
|
+
gap: 0.5rem;
|
|
23
|
+
border-radius: 9999px;
|
|
24
|
+
background-color: #5750ee1A;
|
|
25
|
+
padding-left: 1rem;
|
|
26
|
+
padding-right: 1rem;
|
|
27
|
+
padding-top: 0px;
|
|
28
|
+
padding-bottom: 0px;
|
|
29
|
+
font-size: 0.875rem;
|
|
30
|
+
line-height: 1.25rem;
|
|
31
|
+
--tw-text-opacity: 1;
|
|
32
|
+
color: rgb(71 65 193 / var(--tw-text-opacity, 1));
|
|
33
|
+
display: flex;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
height: 32px;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
align-items: center
|
|
38
38
|
}
|
|
39
39
|
</style>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import ProgressCircle from './ProgressCircle.svelte';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Design System/ProgressCircle',
|
|
8
|
+
component: ProgressCircle,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
});
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<Story name="Base" args={{ progress: 20 }} />
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
// Make sure progress is between 0 and 100 and round down to the nearest 10 if over 90
|
|
3
|
+
$effect(() => {
|
|
4
|
+
progress =
|
|
5
|
+
progress > 90
|
|
6
|
+
? Math.floor(Math.min(100, progress) / 10) * 10
|
|
7
|
+
: Math.min(100, Math.max(0, progress));
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
progress: number;
|
|
12
|
+
size?: 'md' | 'sm';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
let { progress = $bindable(), size = 'md' }: Props = $props();
|
|
16
|
+
|
|
17
|
+
const viewBox = size === 'md' ? '0 0 20 20' : '0 0 16 16';
|
|
18
|
+
const center = size === 'md' ? 10 : 8;
|
|
19
|
+
const radius = size === 'md' ? 7 : 6;
|
|
20
|
+
|
|
21
|
+
// Create the circle path
|
|
22
|
+
const path = `M ${center} ${center - radius}
|
|
23
23
|
A ${radius} ${radius} 0 1 1 ${center - 0.01} ${center - radius}`;
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<div class="progress-wrapper" class:sm={size === 'sm'} class:md={size === 'md'}>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
<svg xmlns="http://www.w3.org/2000/svg" {viewBox} fill="none">
|
|
28
|
+
<!-- Background track -->
|
|
29
|
+
<path d={path} stroke="currentColor" stroke-opacity="0.25" stroke-width="2" fill="none" />
|
|
30
|
+
<!-- Progress indicator -->
|
|
31
|
+
<path
|
|
32
|
+
d={path}
|
|
33
|
+
stroke="currentColor"
|
|
34
|
+
stroke-width="2"
|
|
35
|
+
stroke-linecap="round"
|
|
36
|
+
fill="none"
|
|
37
|
+
style="stroke-dasharray: var(--pathLength);
|
|
38
38
|
stroke-dashoffset: calc(var(--pathLength) * (1 - {progress / 100}));"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
pathLength="1"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<style>
|
|
45
|
-
|
|
45
|
+
.progress-wrapper {
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
position: relative;
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
display: inline-block;
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
aspect-ratio: 1;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
.progress-wrapper.md {
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
width: 1.25rem;
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
height: 1.25rem;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
.progress-wrapper.sm {
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
width: 1rem;
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
height: 1rem;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
svg {
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
position: absolute;
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
inset: 0px;
|
|
71
|
+
width: 100%;
|
|
72
|
+
height: 100%;
|
|
73
|
+
display: block;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
path {
|
|
77
|
+
--pathLength: 1;
|
|
78
|
+
}
|
|
79
79
|
</style>
|