@reshape-biotech/design-system 2.6.5 → 2.7.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 (75) hide show
  1. package/dist/components/activity/Activity.stories.svelte +7 -2
  2. package/dist/components/activity/Activity.svelte +6 -48
  3. package/dist/components/activity/Activity.svelte.d.ts +2 -2
  4. package/dist/components/activity/ActivityIcon.svelte +75 -0
  5. package/dist/components/activity/ActivityIcon.svelte.d.ts +10 -0
  6. package/dist/components/banner/Banner.stories.svelte +46 -9
  7. package/dist/components/banner/Banner.svelte +3 -2
  8. package/dist/components/checkbox/Checkbox.svelte +5 -3
  9. package/dist/components/collapsible/components/collapsible-trigger.svelte +3 -2
  10. package/dist/components/combobox/Combobox.stories.svelte +18 -4
  11. package/dist/components/combobox/components/combobox-add.svelte +3 -2
  12. package/dist/components/combobox/components/combobox-content.svelte +5 -3
  13. package/dist/components/combobox/components/combobox-indicator.svelte +3 -2
  14. package/dist/components/datepicker/DatePicker.stories.svelte +12 -3
  15. package/dist/components/datepicker/DatePicker.svelte +5 -3
  16. package/dist/components/drawer/components/drawer-content.svelte +3 -2
  17. package/dist/components/empty-content/EmptyContent.stories.svelte +13 -15
  18. package/dist/components/graphs/bar-chart/BarChart.svelte +1 -1
  19. package/dist/components/graphs/bar-chart/BarChart.svelte.d.ts +1 -1
  20. package/dist/components/graphs/bar-chart/StackedBarChart.svelte +1 -2
  21. package/dist/components/graphs/bar-chart/StackedBarChart.svelte.d.ts +1 -1
  22. package/dist/components/graphs/chart/Chart.svelte +16 -7
  23. package/dist/components/graphs/chart/Chart.svelte.d.ts +1 -1
  24. package/dist/components/graphs/line/LineChart.stories.svelte +1 -1
  25. package/dist/components/graphs/line/LineChart.svelte +1 -2
  26. package/dist/components/graphs/line/types.d.ts +1 -1
  27. package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +1 -1
  28. package/dist/components/graphs/multiline/MultiLineChart.svelte +7 -4
  29. package/dist/components/graphs/multiline/MultiLineChart.svelte.d.ts +1 -1
  30. package/dist/components/graphs/multiline/types.d.ts +1 -1
  31. package/dist/components/graphs/scatterplot/Scatterplot.svelte +8 -4
  32. package/dist/components/graphs/scatterplot/Scatterplot.svelte.d.ts +5 -2
  33. package/dist/components/graphs/utils/tooltipFormatter.d.ts +1 -1
  34. package/dist/components/icon-button/IconButton.stories.svelte +17 -49
  35. package/dist/components/icons/AnalysisIcon.svelte +10 -6
  36. package/dist/components/icons/Icon.stories.svelte +19 -37
  37. package/dist/components/icons/Icon.svelte +46 -13
  38. package/dist/components/icons/Icon.svelte.d.ts +21 -2
  39. package/dist/components/icons/PrincipalIcon.svelte +25 -5
  40. package/dist/components/icons/PrincipalIcon.svelte.d.ts +2 -1
  41. package/dist/components/icons/index.d.ts +3 -10
  42. package/dist/components/icons/index.js +2 -253
  43. package/dist/components/input/Input.svelte +3 -2
  44. package/dist/components/legend/Legend.stories.svelte +13 -3
  45. package/dist/components/list/List.stories.svelte +12 -3
  46. package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte +6 -3
  47. package/dist/components/modal/Modal.stories.svelte +6 -1
  48. package/dist/components/modal/components/modal-content.svelte +3 -2
  49. package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte +8 -4
  50. package/dist/components/notification-popup/NotificationPopup.stories.svelte +7 -2
  51. package/dist/components/notification-popup/NotificationPopup.svelte +3 -2
  52. package/dist/components/notifications/Notifications.stories.svelte +11 -11
  53. package/dist/components/pill/Pill.svelte +3 -2
  54. package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte +4 -3
  55. package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +59 -10
  56. package/dist/components/select/components/MultiSelectTrigger.svelte +4 -6
  57. package/dist/components/select/components/MultiSelectTrigger.svelte.d.ts +0 -2
  58. package/dist/components/select/components/SelectContent.svelte +5 -3
  59. package/dist/components/select/components/SelectItem.svelte +3 -2
  60. package/dist/components/select/components/SelectTrigger.svelte +3 -2
  61. package/dist/components/slider/Slider.svelte +3 -2
  62. package/dist/components/stat-card/StatCard.svelte +5 -3
  63. package/dist/components/status-badge/StatusBadge.stories.svelte +132 -26
  64. package/dist/components/stepper/components/stepper-step.svelte +3 -2
  65. package/dist/components/table/Table.stories.svelte +7 -2
  66. package/dist/components/tag/Tag.stories.svelte +7 -2
  67. package/dist/components/toast/Toast.svelte +26 -6
  68. package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte +112 -23
  69. package/dist/echarts-config.d.ts +5 -0
  70. package/dist/echarts-config.js +33 -0
  71. package/dist/index.d.ts +3 -0
  72. package/dist/index.js +3 -0
  73. package/dist/notifications.d.ts +6 -7
  74. package/dist/notifications.js +2 -1
  75. package/package.json +1 -1
@@ -1,9 +1,17 @@
1
1
  <script lang="ts">
2
2
  import { type Notification, notifications } from '../../notifications';
3
- import Icon from '../icons/Icon.svelte';
4
- import { type IconColor } from '../icons';
5
3
  import { tokens } from '../../tokens';
6
4
  import IconButton from '../icon-button/IconButton.svelte';
5
+ import Icon from '../icons/Icon.svelte';
6
+ import type { IconColor } from '../icons';
7
+ import X from 'phosphor-svelte/lib/X';
8
+
9
+ // Default notification icons for each type
10
+ import Info from 'phosphor-svelte/lib/Info';
11
+ import CheckCircle from 'phosphor-svelte/lib/CheckCircle';
12
+ import Warning from 'phosphor-svelte/lib/Warning';
13
+ import XCircle from 'phosphor-svelte/lib/XCircle';
14
+ import Bell from 'phosphor-svelte/lib/Bell';
7
15
 
8
16
  let { notification }: { notification: Notification } = $props();
9
17
 
@@ -22,6 +30,18 @@
22
30
  info: 'primary-inverse',
23
31
  default: 'inherit',
24
32
  };
33
+
34
+ // Default icons for each notification type
35
+ const typeIcons: Record<string, any> = {
36
+ info: Info,
37
+ success: CheckCircle,
38
+ warning: Warning,
39
+ danger: XCircle,
40
+ default: Bell,
41
+ };
42
+
43
+ // Get the icon component based on notification type
44
+ let iconComponent = $derived(typeIcons[notification.type] || Bell);
25
45
  </script>
26
46
 
27
47
  <div
@@ -30,11 +50,11 @@
30
50
  class:border={notification.type === 'default'}
31
51
  class:border-base-200={notification.type === 'default'}
32
52
  >
33
- {#if notification.icon}
53
+ {#if iconComponent}
34
54
  <Icon
35
55
  color={textColor[notification.type]}
36
- size={'14'}
37
- iconName={notification.icon}
56
+ size={14}
57
+ icon={iconComponent}
38
58
  class="flex h-6 w-6 items-center justify-center rounded-md {notification.type !== 'default'
39
59
  ? 'bg-neutral-inverse-hover'
40
60
  : 'bg-neutral'} p-1 {textColor[notification.type]}"
@@ -53,7 +73,7 @@
53
73
  <IconButton rounded={false} size="xs" onclick={() => notifications.dismiss(notification.id)}>
54
74
  <Icon
55
75
  color={textColor[notification.type]}
56
- iconName={'X'}
76
+ icon={X}
57
77
  class="rounded-md {textColor[notification.type]}"
58
78
  />
59
79
  </IconButton>
@@ -1,7 +1,8 @@
1
1
  <script module lang="ts">
2
+ import DownloadSimple from 'phosphor-svelte/lib/DownloadSimple';
3
+ import { Icon } from 'design-system';
2
4
  import { defineMeta } from '@storybook/addon-svelte-csf';
3
5
  import ToggleIconButton from './ToggleIconButton.svelte';
4
- import { Icon } from '../icons';
5
6
 
6
7
  const { Story } = defineMeta({
7
8
  component: ToggleIconButton,
@@ -16,13 +17,21 @@
16
17
  <div class="flex flex-col items-center gap-2">
17
18
  <p class="text-sm">Normal</p>
18
19
  <ToggleIconButton variant="primary-inverse">
19
- <Icon iconName="DownloadSimple" />
20
+ <Icon>
21
+ {#snippet children(props)}
22
+ <DownloadSimple {...props} />
23
+ {/snippet}
24
+ </Icon>
20
25
  </ToggleIconButton>
21
26
  </div>
22
27
  <div class="flex flex-col items-center gap-2">
23
28
  <p class="text-sm">Active</p>
24
29
  <ToggleIconButton variant="primary-inverse" isActive={true}>
25
- <Icon iconName="DownloadSimple" />
30
+ <Icon>
31
+ {#snippet children(props)}
32
+ <DownloadSimple {...props} />
33
+ {/snippet}
34
+ </Icon>
26
35
  </ToggleIconButton>
27
36
  </div>
28
37
  </div>
@@ -36,10 +45,18 @@
36
45
  <p class="text-sm">Primary Inverse</p>
37
46
  <div class="flex gap-4">
38
47
  <ToggleIconButton variant="primary-inverse">
39
- <Icon iconName="DownloadSimple" />
48
+ <Icon>
49
+ {#snippet children(props)}
50
+ <DownloadSimple {...props} />
51
+ {/snippet}
52
+ </Icon>
40
53
  </ToggleIconButton>
41
54
  <ToggleIconButton variant="primary-inverse" isActive={true}>
42
- <Icon iconName="DownloadSimple" />
55
+ <Icon>
56
+ {#snippet children(props)}
57
+ <DownloadSimple {...props} />
58
+ {/snippet}
59
+ </Icon>
43
60
  </ToggleIconButton>
44
61
  </div>
45
62
  </div>
@@ -49,10 +66,18 @@
49
66
  <p class="text-sm">Secondary</p>
50
67
  <div class="flex gap-4">
51
68
  <ToggleIconButton variant="secondary">
52
- <Icon iconName="DownloadSimple" />
69
+ <Icon>
70
+ {#snippet children(props)}
71
+ <DownloadSimple {...props} />
72
+ {/snippet}
73
+ </Icon>
53
74
  </ToggleIconButton>
54
75
  <ToggleIconButton variant="secondary" isActive={true}>
55
- <Icon iconName="DownloadSimple" />
76
+ <Icon>
77
+ {#snippet children(props)}
78
+ <DownloadSimple {...props} />
79
+ {/snippet}
80
+ </Icon>
56
81
  </ToggleIconButton>
57
82
  </div>
58
83
  </div>
@@ -66,10 +91,18 @@
66
91
  <p class="text-sm">XS</p>
67
92
  <div class="flex gap-4">
68
93
  <ToggleIconButton variant="primary-inverse" size="xs">
69
- <Icon iconName="DownloadSimple" />
94
+ <Icon>
95
+ {#snippet children(props)}
96
+ <DownloadSimple {...props} />
97
+ {/snippet}
98
+ </Icon>
70
99
  </ToggleIconButton>
71
100
  <ToggleIconButton variant="primary-inverse" size="xs" isActive={true}>
72
- <Icon iconName="DownloadSimple" />
101
+ <Icon>
102
+ {#snippet children(props)}
103
+ <DownloadSimple {...props} />
104
+ {/snippet}
105
+ </Icon>
73
106
  </ToggleIconButton>
74
107
  </div>
75
108
  </div>
@@ -77,10 +110,18 @@
77
110
  <p class="text-sm">SM</p>
78
111
  <div class="flex gap-4">
79
112
  <ToggleIconButton variant="primary-inverse" size="sm">
80
- <Icon iconName="DownloadSimple" />
113
+ <Icon>
114
+ {#snippet children(props)}
115
+ <DownloadSimple {...props} />
116
+ {/snippet}
117
+ </Icon>
81
118
  </ToggleIconButton>
82
119
  <ToggleIconButton variant="primary-inverse" size="sm" isActive={true}>
83
- <Icon iconName="DownloadSimple" />
120
+ <Icon>
121
+ {#snippet children(props)}
122
+ <DownloadSimple {...props} />
123
+ {/snippet}
124
+ </Icon>
84
125
  </ToggleIconButton>
85
126
  </div>
86
127
  </div>
@@ -88,10 +129,18 @@
88
129
  <p class="text-sm">MD</p>
89
130
  <div class="flex gap-4">
90
131
  <ToggleIconButton variant="primary-inverse" size="md">
91
- <Icon iconName="DownloadSimple" />
132
+ <Icon>
133
+ {#snippet children(props)}
134
+ <DownloadSimple {...props} />
135
+ {/snippet}
136
+ </Icon>
92
137
  </ToggleIconButton>
93
138
  <ToggleIconButton variant="primary-inverse" size="md" isActive={true}>
94
- <Icon iconName="DownloadSimple" />
139
+ <Icon>
140
+ {#snippet children(props)}
141
+ <DownloadSimple {...props} />
142
+ {/snippet}
143
+ </Icon>
95
144
  </ToggleIconButton>
96
145
  </div>
97
146
  </div>
@@ -99,10 +148,18 @@
99
148
  <p class="text-sm">LG</p>
100
149
  <div class="flex gap-4">
101
150
  <ToggleIconButton variant="primary-inverse" size="lg">
102
- <Icon iconName="DownloadSimple" />
151
+ <Icon>
152
+ {#snippet children(props)}
153
+ <DownloadSimple {...props} />
154
+ {/snippet}
155
+ </Icon>
103
156
  </ToggleIconButton>
104
157
  <ToggleIconButton variant="primary-inverse" size="lg" isActive={true}>
105
- <Icon iconName="DownloadSimple" />
158
+ <Icon>
159
+ {#snippet children(props)}
160
+ <DownloadSimple {...props} />
161
+ {/snippet}
162
+ </Icon>
106
163
  </ToggleIconButton>
107
164
  </div>
108
165
  </div>
@@ -115,10 +172,18 @@
115
172
  <p class="text-sm">Rounded</p>
116
173
  <div class="flex gap-4">
117
174
  <ToggleIconButton variant="primary-inverse" rounded>
118
- <Icon iconName="DownloadSimple" />
175
+ <Icon>
176
+ {#snippet children(props)}
177
+ <DownloadSimple {...props} />
178
+ {/snippet}
179
+ </Icon>
119
180
  </ToggleIconButton>
120
181
  <ToggleIconButton variant="primary-inverse" rounded isActive={true}>
121
- <Icon iconName="DownloadSimple" />
182
+ <Icon>
183
+ {#snippet children(props)}
184
+ <DownloadSimple {...props} />
185
+ {/snippet}
186
+ </Icon>
122
187
  </ToggleIconButton>
123
188
  </div>
124
189
  </div>
@@ -126,10 +191,18 @@
126
191
  <p class="text-sm">Square</p>
127
192
  <div class="flex gap-4">
128
193
  <ToggleIconButton variant="primary-inverse" rounded={false}>
129
- <Icon iconName="DownloadSimple" />
194
+ <Icon>
195
+ {#snippet children(props)}
196
+ <DownloadSimple {...props} />
197
+ {/snippet}
198
+ </Icon>
130
199
  </ToggleIconButton>
131
200
  <ToggleIconButton variant="primary-inverse" rounded={false} isActive={true}>
132
- <Icon iconName="DownloadSimple" />
201
+ <Icon>
202
+ {#snippet children(props)}
203
+ <DownloadSimple {...props} />
204
+ {/snippet}
205
+ </Icon>
133
206
  </ToggleIconButton>
134
207
  </div>
135
208
  </div>
@@ -142,13 +215,21 @@
142
215
  <div class="flex flex-col items-center gap-2">
143
216
  <p class="text-neutral-light text-sm">Normal</p>
144
217
  <ToggleIconButton variant="primary-inverse">
145
- <Icon iconName="DownloadSimple" />
218
+ <Icon>
219
+ {#snippet children(props)}
220
+ <DownloadSimple {...props} />
221
+ {/snippet}
222
+ </Icon>
146
223
  </ToggleIconButton>
147
224
  </div>
148
225
  <div class="flex flex-col items-center gap-2">
149
226
  <p class="text-neutral-light text-sm">Active</p>
150
227
  <ToggleIconButton variant="primary-inverse" isActive={true}>
151
- <Icon iconName="DownloadSimple" />
228
+ <Icon>
229
+ {#snippet children(props)}
230
+ <DownloadSimple {...props} />
231
+ {/snippet}
232
+ </Icon>
152
233
  </ToggleIconButton>
153
234
  </div>
154
235
  </div>
@@ -160,13 +241,21 @@
160
241
  <div class="flex flex-col items-center gap-2">
161
242
  <p class="text-sm">Disabled</p>
162
243
  <ToggleIconButton disabled>
163
- <Icon iconName="DownloadSimple" />
244
+ <Icon>
245
+ {#snippet children(props)}
246
+ <DownloadSimple {...props} />
247
+ {/snippet}
248
+ </Icon>
164
249
  </ToggleIconButton>
165
250
  </div>
166
251
  <div class="flex flex-col items-center gap-2">
167
252
  <p class="text-sm">Loading</p>
168
253
  <ToggleIconButton loading>
169
- <Icon iconName="DownloadSimple" />
254
+ <Icon>
255
+ {#snippet children(props)}
256
+ <DownloadSimple {...props} />
257
+ {/snippet}
258
+ </Icon>
170
259
  </ToggleIconButton>
171
260
  </div>
172
261
  </div>
@@ -0,0 +1,5 @@
1
+ import * as echarts from 'echarts/core';
2
+ export default echarts;
3
+ export type { ECharts, EChartsOption, SeriesOption, LineSeriesOption, BarSeriesOption, ECElementEvent, } from 'echarts';
4
+ export type { CallbackDataParams, YAXisOption } from 'echarts/types/dist/shared';
5
+ export declare const init: typeof echarts.init;
@@ -0,0 +1,33 @@
1
+ // Centralized ECharts modular import configuration
2
+ // This file imports only the ECharts components we actually use to reduce bundle size
3
+ // Core components (required)
4
+ import * as echarts from 'echarts/core';
5
+ // Charts we use
6
+ import { LineChart } from 'echarts/charts';
7
+ import { BarChart } from 'echarts/charts';
8
+ import { ScatterChart } from 'echarts/charts';
9
+ import { CustomChart } from 'echarts/charts';
10
+ // Components we use
11
+ import { TooltipComponent, GridComponent, LegendComponent, MarkLineComponent, } from 'echarts/components';
12
+ // Renderers (we primarily use SVG)
13
+ import { SVGRenderer, CanvasRenderer } from 'echarts/renderers';
14
+ // Register only the components we actually use
15
+ echarts.use([
16
+ // Charts
17
+ LineChart,
18
+ BarChart,
19
+ ScatterChart,
20
+ CustomChart,
21
+ // Components
22
+ TooltipComponent,
23
+ GridComponent,
24
+ LegendComponent,
25
+ MarkLineComponent,
26
+ // Renderers (both needed - SVG is default, Canvas for large datasets)
27
+ SVGRenderer,
28
+ CanvasRenderer,
29
+ ]);
30
+ // Export the configured echarts
31
+ export default echarts;
32
+ // Export the init function for convenience
33
+ export const init = echarts.init;
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export * as Drawer from './components/drawer/';
12
12
  export * from './components/dropdown/';
13
13
  export * from './components/empty-content/';
14
14
  export * from './components/icons/';
15
+ export * from './components/icons/custom/';
15
16
  export * from './components/icon-button/';
16
17
  export * from './components/image';
17
18
  export * from './components/input/';
@@ -49,3 +50,5 @@ export { notifications } from './notifications';
49
50
  export { colors, borderColor, textColor, backgroundColor, boxShadow, outlineColor } from './tokens';
50
51
  export * as TokensColors from './tokens/colors';
51
52
  export * as TokensTypography from './tokens/typography';
53
+ export { default as echarts, init } from './echarts-config';
54
+ export type { ECharts, EChartsOption, SeriesOption, LineSeriesOption, BarSeriesOption, ECElementEvent, CallbackDataParams, YAXisOption, } from './echarts-config';
package/dist/index.js CHANGED
@@ -13,6 +13,7 @@ export * as Drawer from './components/drawer/';
13
13
  export * from './components/dropdown/';
14
14
  export * from './components/empty-content/';
15
15
  export * from './components/icons/';
16
+ export * from './components/icons/custom/';
16
17
  export * from './components/icon-button/';
17
18
  export * from './components/image';
18
19
  export * from './components/input/';
@@ -52,3 +53,5 @@ export { colors, borderColor, textColor, backgroundColor, boxShadow, outlineColo
52
53
  // Export tokens modules for granular imports
53
54
  export * as TokensColors from './tokens/colors';
54
55
  export * as TokensTypography from './tokens/typography';
56
+ // Export echarts configuration
57
+ export { default as echarts, init } from './echarts-config';
@@ -1,19 +1,18 @@
1
- import type { IconName } from './../lib/components/icons/index.ts';
2
1
  export type NotificationType = 'info' | 'success' | 'warning' | 'danger' | 'default';
3
2
  export interface Notification {
4
3
  id: string;
5
4
  type: NotificationType;
6
5
  message: string;
7
6
  timeout?: number;
8
- icon?: IconName;
7
+ icon?: string;
9
8
  dismissable: boolean;
10
9
  }
11
10
  export declare const notifications: {
12
11
  subscribe: (this: void, run: import("svelte/store").Subscriber<Notification[]>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
13
12
  dismiss: (id: string) => void;
14
- default: (message: string, icon?: IconName, dismissable?: boolean, timeout?: number) => void;
15
- danger: (message: string, icon?: IconName, dismissable?: boolean, timeout?: number) => void;
16
- warning: (message: string, icon?: IconName, dismissable?: boolean, timeout?: number) => void;
17
- info: (message: string, icon?: IconName, dismissable?: boolean, timeout?: number) => void;
18
- success: (message: string, icon?: IconName, dismissable?: boolean, timeout?: number) => void;
13
+ default: (message: string, icon?: string, dismissable?: boolean, timeout?: number) => void;
14
+ danger: (message: string, icon?: string, dismissable?: boolean, timeout?: number) => void;
15
+ warning: (message: string, icon?: string, dismissable?: boolean, timeout?: number) => void;
16
+ info: (message: string, icon?: string, dismissable?: boolean, timeout?: number) => void;
17
+ success: (message: string, icon?: string, dismissable?: boolean, timeout?: number) => void;
19
18
  };
@@ -2,7 +2,8 @@ import { writable } from 'svelte/store';
2
2
  const TIMEOUT = 3000;
3
3
  const createNotificationStore = () => {
4
4
  const { subscribe, update } = writable([]);
5
- const send = (message, type = 'default', iconName, dismissable = false, timeout = 3000) => {
5
+ const send = (message, type = 'default', iconName, // @deprecated - parameter kept for backward compatibility
6
+ dismissable = false, timeout = 3000) => {
6
7
  const notification = { id: id(), type, message, timeout, icon: iconName, dismissable };
7
8
  update((state) => [...state, notification]);
8
9
  setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reshape-biotech/design-system",
3
- "version": "2.6.5",
3
+ "version": "2.7.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",