@reshape-biotech/design-system 1.2.5 → 1.2.7

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 (175) hide show
  1. package/README.md +3 -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/combobox/Combobox.stories.svelte +412 -412
  19. package/dist/components/combobox/components/combobox-add.svelte +8 -8
  20. package/dist/components/combobox/components/combobox-content.svelte +39 -39
  21. package/dist/components/combobox/components/combobox-indicator.svelte +1 -1
  22. package/dist/components/datepicker/DatePicker.stories.svelte +196 -196
  23. package/dist/components/datepicker/DatePicker.svelte +173 -173
  24. package/dist/components/divider/Divider.stories.svelte +7 -7
  25. package/dist/components/divider/Divider.svelte +9 -9
  26. package/dist/components/drawer/Drawer.stories.svelte +51 -51
  27. package/dist/components/drawer/Drawer.svelte +33 -33
  28. package/dist/components/drawer/DrawerLabel.svelte +10 -10
  29. package/dist/components/dropdown/Dropdown.stories.svelte +210 -210
  30. package/dist/components/dropdown/Dropdown.svelte +57 -57
  31. package/dist/components/dropdown/components/DropdownContent.svelte +16 -16
  32. package/dist/components/dropdown/components/DropdownMenu.svelte +10 -10
  33. package/dist/components/dropdown/components/DropdownTrigger.svelte +37 -37
  34. package/dist/components/dropdown/components/OutlinedButton.svelte +9 -9
  35. package/dist/components/empty-content/EmptyContent.stories.svelte +38 -38
  36. package/dist/components/empty-content/EmptyContent.svelte +12 -12
  37. package/dist/components/graphs/bar-chart/BarChart.stories.svelte +91 -91
  38. package/dist/components/graphs/bar-chart/BarChart.svelte +147 -147
  39. package/dist/components/graphs/bar-chart/StackedBarChart.stories.svelte +57 -57
  40. package/dist/components/graphs/bar-chart/StackedBarChart.svelte +198 -199
  41. package/dist/components/graphs/chart/Chart.stories.svelte +96 -96
  42. package/dist/components/graphs/chart/Chart.svelte +207 -207
  43. package/dist/components/graphs/line/LineChart.stories.svelte +138 -138
  44. package/dist/components/graphs/line/LineChart.svelte +140 -142
  45. package/dist/components/graphs/matrix/Matrix.stories.svelte +117 -117
  46. package/dist/components/graphs/matrix/Matrix.svelte +141 -141
  47. package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +168 -168
  48. package/dist/components/graphs/multiline/MultiLineChart.svelte +236 -236
  49. package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte +84 -84
  50. package/dist/components/graphs/scatterplot/Scatterplot.svelte +302 -302
  51. package/dist/components/graphs/utils/duration.d.ts +1 -0
  52. package/dist/components/graphs/utils/duration.js +33 -0
  53. package/dist/components/graphs/utils/tooltipFormatter.js +1 -1
  54. package/dist/components/icon-button/IconButton.stories.svelte +64 -64
  55. package/dist/components/icon-button/IconButton.svelte +88 -88
  56. package/dist/components/icons/AnalysisIcon.stories.svelte +18 -18
  57. package/dist/components/icons/AnalysisIcon.svelte +96 -96
  58. package/dist/components/icons/Icon.stories.svelte +111 -111
  59. package/dist/components/icons/Icon.svelte +17 -17
  60. package/dist/components/icons/PrincipalIcon.svelte +59 -59
  61. package/dist/components/icons/custom/Halo.svelte +31 -31
  62. package/dist/components/icons/custom/Well.svelte +27 -27
  63. package/dist/components/icons/index.d.ts +3 -2
  64. package/dist/components/icons/index.js +3 -1
  65. package/dist/components/image/Image.svelte +42 -42
  66. package/dist/components/input/Input.stories.svelte +55 -55
  67. package/dist/components/input/Input.svelte +121 -121
  68. package/dist/components/label/Label.stories.svelte +18 -18
  69. package/dist/components/label/Label.svelte +11 -11
  70. package/dist/components/list/List.stories.svelte +84 -84
  71. package/dist/components/list/List.svelte +20 -20
  72. package/dist/components/logo/Logo.stories.svelte +15 -15
  73. package/dist/components/logo/Logo.svelte +30 -30
  74. package/dist/components/manual-cfu-counter/ManualCFUCounter.stories.svelte +102 -102
  75. package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte +557 -565
  76. package/dist/components/manual-cfu-counter/test/ManualCFUCounterTestWrapper.svelte +11 -11
  77. package/dist/components/markdown/Markdown.stories.svelte +10 -10
  78. package/dist/components/markdown/Markdown.svelte +6 -6
  79. package/dist/components/modal/Modal.stories.svelte +29 -29
  80. package/dist/components/modal/Modal.svelte +71 -71
  81. package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte +215 -0
  82. package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte.d.ts +3 -0
  83. package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte +662 -0
  84. package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte.d.ts +32 -0
  85. package/dist/components/multi-cfu-counter/index.d.ts +1 -0
  86. package/dist/components/multi-cfu-counter/index.js +1 -0
  87. package/dist/components/multi-cfu-counter/test/MultiCFUCounterTestWrapper.svelte +28 -0
  88. package/dist/components/multi-cfu-counter/test/MultiCFUCounterTestWrapper.svelte.d.ts +20 -0
  89. package/dist/components/notification-popup/NotificationPopup.stories.svelte +18 -18
  90. package/dist/components/notification-popup/NotificationPopup.svelte +26 -26
  91. package/dist/components/notifications/Notifications.stories.svelte +101 -101
  92. package/dist/components/notifications/Notifications.svelte +9 -9
  93. package/dist/components/pill/Pill.stories.svelte +8 -8
  94. package/dist/components/pill/Pill.svelte +27 -27
  95. package/dist/components/progress-circle/ProgressCircle.stories.svelte +8 -8
  96. package/dist/components/progress-circle/ProgressCircle.svelte +54 -54
  97. package/dist/components/required-status-indicator/RequiredStatusIndicator.stories.svelte +18 -18
  98. package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte +14 -14
  99. package/dist/components/segmented-control-buttons/ControlButton.svelte +36 -36
  100. package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +35 -35
  101. package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +13 -13
  102. package/dist/components/select/Select.stories.svelte +77 -77
  103. package/dist/components/select/Select.svelte +114 -114
  104. package/dist/components/select-new/Select.stories.svelte +188 -188
  105. package/dist/components/select-new/components/Group.svelte +17 -17
  106. package/dist/components/select-new/components/MultiSelectTrigger.svelte +57 -57
  107. package/dist/components/select-new/components/SelectContent.svelte +22 -22
  108. package/dist/components/select-new/components/SelectGroupHeading.svelte +10 -10
  109. package/dist/components/select-new/components/SelectItem.svelte +25 -25
  110. package/dist/components/select-new/components/SelectTrigger.svelte +38 -38
  111. package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte +76 -76
  112. package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte.d.ts +1 -1
  113. package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte +53 -53
  114. package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte.d.ts +1 -1
  115. package/dist/components/sjsf-wrappers/sjsfCustomTheme.js +1 -1
  116. package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte +32 -32
  117. package/dist/components/skeleton-loader/SkeletonLoader.svelte +10 -10
  118. package/dist/components/skeleton-loader/StatcardSkeleton.svelte +9 -9
  119. package/dist/components/skeleton-loader/components/Skeleton.svelte +7 -7
  120. package/dist/components/skeleton-loader/components/SkeletonImage.svelte +12 -12
  121. package/dist/components/slider/Slider.stories.svelte +23 -23
  122. package/dist/components/slider/Slider.svelte +107 -107
  123. package/dist/components/spinner/Spinner.stories.svelte +8 -8
  124. package/dist/components/spinner/Spinner.svelte +18 -18
  125. package/dist/components/stat-card/StatCard.stories.svelte +26 -26
  126. package/dist/components/stat-card/StatCard.svelte +128 -128
  127. package/dist/components/status-badge/StatusBadge.stories.svelte +365 -365
  128. package/dist/components/status-badge/StatusBadge.svelte +54 -54
  129. package/dist/components/stepper/Stepper.stories.svelte +219 -219
  130. package/dist/components/stepper/components/stepper-root.svelte +12 -12
  131. package/dist/components/stepper/components/stepper-step.svelte +83 -83
  132. package/dist/components/table/Table.stories.svelte +87 -87
  133. package/dist/components/table/Table.svelte +32 -32
  134. package/dist/components/table/components/TBody.svelte +7 -7
  135. package/dist/components/table/components/THead.svelte +7 -7
  136. package/dist/components/table/components/Td.svelte +8 -8
  137. package/dist/components/table/components/Th.svelte +8 -8
  138. package/dist/components/table/components/Tr.svelte +11 -11
  139. package/dist/components/tabs/Tabs.stories.svelte +20 -20
  140. package/dist/components/tabs/Tabs.svelte +8 -8
  141. package/dist/components/tabs/components/Content.svelte +8 -8
  142. package/dist/components/tabs/components/Tab.svelte +14 -14
  143. package/dist/components/tabs/components/Tabs.svelte +7 -7
  144. package/dist/components/tag/Tag.stories.svelte +57 -57
  145. package/dist/components/tag/Tag.svelte +95 -95
  146. package/dist/components/textarea/Textarea.stories.svelte +70 -70
  147. package/dist/components/textarea/Textarea.svelte +76 -76
  148. package/dist/components/toast/Toast.stories.svelte +204 -204
  149. package/dist/components/toast/Toast.svelte +53 -53
  150. package/dist/components/toggle/Toggle.stories.svelte +9 -9
  151. package/dist/components/toggle/Toggle.svelte +53 -53
  152. package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte +152 -152
  153. package/dist/components/toggle-icon-button/ToggleIconButton.svelte +99 -99
  154. package/dist/components/tooltip/Tooltip.stories.svelte +105 -105
  155. package/dist/components/tooltip/Tooltip.svelte +26 -26
  156. package/dist/fonts/index.js +1 -1
  157. package/dist/index.d.ts +4 -1
  158. package/dist/index.js +5 -1
  159. package/dist/notifications.d.ts +1 -4
  160. package/dist/notifications.js +1 -1
  161. package/dist/styles.d.ts +1 -0
  162. package/dist/styles.js +4 -0
  163. package/dist/tailwind-safelist.js +406 -398
  164. package/dist/tailwind.preset.d.ts +4 -0
  165. package/dist/tailwind.preset.js +10 -10
  166. package/dist/tokens/colors.d.ts +246 -0
  167. package/dist/tokens/colors.js +139 -0
  168. package/dist/tokens/index.d.ts +3 -0
  169. package/dist/tokens/index.js +5 -0
  170. package/dist/tokens/typography.d.ts +48 -0
  171. package/dist/tokens/typography.js +48 -0
  172. package/dist/tokens.d.ts +16 -252
  173. package/dist/tokens.js +33 -164
  174. package/dist/types/fonts.d.ts +2 -2
  175. package/package.json +398 -78
@@ -0,0 +1,28 @@
1
+ <!-- src/lib/design-system/src/lib/components/manual-cfu-counter/ManualCFUCounterTestWrapper.svelte -->
2
+ <script lang="ts">
3
+ import MultiCFUCounter from '../MultiCFUCounter.svelte';
4
+
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
+
12
+ let {
13
+ initialTestMarks = [],
14
+ imageUrl = 'test-image.jpg',
15
+ onclick,
16
+ activeMarkerName = 'Test Marker',
17
+ }: Props = $props();
18
+
19
+ let marks = $state([...initialTestMarks]);
20
+
21
+ export function getCurrentMarks() {
22
+ return marks;
23
+ }
24
+ </script>
25
+
26
+ <MultiCFUCounter bind:marks {imageUrl} {onclick} {activeMarkerName} />
27
+
28
+ <span data-testid="wrapper-marks-count" class="sr-only">{marks.length}</span>
@@ -0,0 +1,20 @@
1
+ interface Props {
2
+ initialTestMarks?: Array<{
3
+ x: number;
4
+ y: number;
5
+ }>;
6
+ imageUrl?: string;
7
+ onclick?: (event: MouseEvent, marks: Array<{
8
+ x: number;
9
+ y: number;
10
+ }>) => void;
11
+ activeMarkerName?: string;
12
+ }
13
+ declare const MultiCfuCounterTestWrapper: import("svelte").Component<Props, {
14
+ getCurrentMarks: () => {
15
+ x: number;
16
+ y: number;
17
+ }[];
18
+ }, "">;
19
+ type MultiCfuCounterTestWrapper = ReturnType<typeof MultiCfuCounterTestWrapper>;
20
+ export default MultiCfuCounterTestWrapper;
@@ -1,26 +1,26 @@
1
1
  <script module>
2
- import NotificationPopup from './NotificationPopup.svelte';
3
- import { Icon } from '../icons';
4
- import { defineMeta } from '@storybook/addon-svelte-csf';
2
+ import NotificationPopup from './NotificationPopup.svelte';
3
+ import { Icon } from '../icons';
4
+ import { defineMeta } from '@storybook/addon-svelte-csf';
5
5
 
6
- const { Story } = defineMeta({
7
- component: NotificationPopup,
8
- title: 'Design System/NotificationPopup',
9
- tags: ['autodocs']
10
- });
6
+ const { Story } = defineMeta({
7
+ component: NotificationPopup,
8
+ title: 'Design System/NotificationPopup',
9
+ tags: ['autodocs'],
10
+ });
11
11
 
12
- let visible = true;
12
+ let visible = true;
13
13
 
14
- function handleClick() {
15
- visible = !visible;
16
- }
14
+ function handleClick() {
15
+ visible = !visible;
16
+ }
17
17
  </script>
18
18
 
19
19
  <Story name="Primary" asChild>
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>
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
- import { IconButton } from '../icon-button/';
3
- import { fade, fly } from 'svelte/transition';
4
- import type { Snippet } from 'svelte';
5
- import { Icon } from '../icons';
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
- interface Props {
8
- onClose: () => void;
9
- title: string;
10
- visible: boolean;
11
- id?: string | undefined;
12
- children?: Snippet;
13
- }
7
+ interface Props {
8
+ onClose: () => void;
9
+ title: string;
10
+ visible: boolean;
11
+ id?: string | undefined;
12
+ children?: Snippet;
13
+ }
14
14
 
15
- let { onClose, title, visible, id = undefined, children }: Props = $props();
15
+ let { onClose, title, visible, id = undefined, children }: Props = $props();
16
16
  </script>
17
17
 
18
18
  {#if visible}
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>
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
- 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';
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
- const { Story } = defineMeta({
8
- component: Notifications,
9
- title: 'Design System/Notifications',
10
- tags: ['autodocs']
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
- <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>
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
- import { flip } from 'svelte/animate';
3
- import { fly } from 'svelte/transition';
4
- import { notifications } from '../../notifications';
5
- import Toast from '../toast/Toast.svelte';
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
- {#each $notifications as notification (notification.id)}
10
- <div animate:flip transition:fly={{ y: -10 }}>
11
- <Toast {notification} />
12
- </div>
13
- {/each}
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
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import Pill from './Pill.svelte';
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import Pill from './Pill.svelte';
4
4
 
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
- });
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
- import { Icon } from '../icons';
2
+ import { Icon } from '../icons';
3
3
 
4
- interface Props {
5
- class?: string;
6
- text: string;
7
- type?: 'button' | 'submit';
8
- testID?: string;
9
- onclick?: () => void;
10
- }
4
+ interface Props {
5
+ class?: string;
6
+ text: string;
7
+ type?: 'button' | 'submit';
8
+ testID?: string;
9
+ onclick?: () => void;
10
+ }
11
11
 
12
- let { class: className = '', text, type = 'button', testID = '', onclick }: Props = $props();
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
- {text}
17
- <Icon iconName="X" class="opacity-50" />
16
+ {text}
17
+ <Icon iconName="X" class="opacity-50" />
18
18
  </button>
19
19
 
20
20
  <style>
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;
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
- align-items: center
37
+ align-items: center
38
38
  }
39
39
  </style>
@@ -1,13 +1,13 @@
1
1
  <script lang="ts" module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import ProgressCircle from './ProgressCircle.svelte';
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import ProgressCircle from './ProgressCircle.svelte';
4
4
 
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
- });
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
- // 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}
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
- <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);
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
- pathLength="1"
40
- />
41
- </svg>
39
+ pathLength="1"
40
+ />
41
+ </svg>
42
42
  </div>
43
43
 
44
44
  <style>
45
- .progress-wrapper {
45
+ .progress-wrapper {
46
46
 
47
- position: relative;
47
+ position: relative;
48
48
 
49
- display: inline-block;
49
+ display: inline-block;
50
50
 
51
- aspect-ratio: 1;
51
+ aspect-ratio: 1;
52
52
  }
53
- .progress-wrapper.md {
53
+ .progress-wrapper.md {
54
54
 
55
- width: 1.25rem;
55
+ width: 1.25rem;
56
56
 
57
- height: 1.25rem;
57
+ height: 1.25rem;
58
58
  }
59
- .progress-wrapper.sm {
59
+ .progress-wrapper.sm {
60
60
 
61
- width: 1rem;
61
+ width: 1rem;
62
62
 
63
- height: 1rem;
63
+ height: 1rem;
64
64
  }
65
65
 
66
- svg {
66
+ svg {
67
67
 
68
- position: absolute;
68
+ position: absolute;
69
69
 
70
- inset: 0px;
71
- width: 100%;
72
- height: 100%;
73
- display: block;
70
+ inset: 0px;
71
+ width: 100%;
72
+ height: 100%;
73
+ display: block;
74
74
  }
75
75
 
76
- path {
77
- --pathLength: 1;
78
- }
76
+ path {
77
+ --pathLength: 1;
78
+ }
79
79
  </style>