@reshape-biotech/design-system 2.7.1 → 2.7.3

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.
@@ -100,17 +100,27 @@
100
100
 
101
101
  border-radius: 0.5rem;
102
102
 
103
+ border-width: 1px;
104
+
105
+ border-color: transparent;
106
+
103
107
  font-size: 0.875rem;
104
108
 
109
+ line-height: 1.25rem;
110
+
105
111
  font-weight: 500;
106
112
 
107
- line-height: 1.5rem;
113
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
114
+
115
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
108
116
 
109
117
  transition-duration: 150ms
110
118
  }
111
119
 
112
120
  .button:disabled {
113
121
 
122
+ border-style: none;
123
+
114
124
  background-color: #12192a0A;
115
125
 
116
126
  --tw-text-opacity: 1;
@@ -145,7 +155,9 @@
145
155
 
146
156
  border-radius: 0.375rem;
147
157
 
148
- padding: 0.5rem
158
+ padding-left: 0.5rem;
159
+
160
+ padding-right: 0.5rem
149
161
  }
150
162
  .btn-size-sm {
151
163
 
@@ -153,11 +165,7 @@
153
165
 
154
166
  padding-left: 0.75rem;
155
167
 
156
- padding-right: 0.75rem;
157
-
158
- padding-top: 0.5rem;
159
-
160
- padding-bottom: 0.5rem
168
+ padding-right: 0.75rem
161
169
  }
162
170
  .btn-size-md {
163
171
 
@@ -165,11 +173,7 @@
165
173
 
166
174
  padding-left: 1rem;
167
175
 
168
- padding-right: 1rem;
169
-
170
- padding-top: 0.75rem;
171
-
172
- padding-bottom: 0.75rem
176
+ padding-right: 1rem
173
177
  }
174
178
  .btn-size-lg {
175
179
 
@@ -179,11 +183,7 @@
179
183
 
180
184
  padding-left: 1.25rem;
181
185
 
182
- padding-right: 1.25rem;
183
-
184
- padding-top: 1rem;
185
-
186
- padding-bottom: 1rem
186
+ padding-right: 1.25rem
187
187
  }
188
188
  @media (min-width: 1280px) {
189
189
 
@@ -198,13 +198,21 @@
198
198
  /* Button variants */
199
199
  .btn-primary {
200
200
 
201
+ border-color: #12192A1A;
202
+
201
203
  --tw-bg-opacity: 1;
202
204
 
203
205
  background-color: rgb(87 80 238 / var(--tw-bg-opacity, 1));
204
206
 
205
207
  --tw-text-opacity: 1;
206
208
 
207
- color: rgb(255 255 255 / var(--tw-text-opacity, 1))
209
+ color: rgb(255 255 255 / var(--tw-text-opacity, 1));
210
+
211
+ --tw-shadow: 0 1px 4px 0 rgba(18, 25, 42, 0.02);
212
+
213
+ --tw-shadow-colored: 0 1px 4px 0 var(--tw-shadow-color);
214
+
215
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
208
216
  }
209
217
  .btn-primary:hover {
210
218
 
@@ -243,13 +251,21 @@
243
251
  }
244
252
  .btn-danger {
245
253
 
254
+ border-color: #12192A1A;
255
+
246
256
  --tw-bg-opacity: 1;
247
257
 
248
258
  background-color: rgb(235 70 71 / var(--tw-bg-opacity, 1));
249
259
 
250
260
  --tw-text-opacity: 1;
251
261
 
252
- color: rgb(255 255 255 / var(--tw-text-opacity, 1))
262
+ color: rgb(255 255 255 / var(--tw-text-opacity, 1));
263
+
264
+ --tw-shadow: 0 1px 4px 0 rgba(18, 25, 42, 0.02);
265
+
266
+ --tw-shadow-colored: 0 1px 4px 0 var(--tw-shadow-color);
267
+
268
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
253
269
  }
254
270
  .btn-danger:hover {
255
271
 
@@ -259,8 +275,6 @@
259
275
  }
260
276
  .btn-outline {
261
277
 
262
- border-width: 1px;
263
-
264
278
  border-color: #12192A1A;
265
279
 
266
280
  --tw-bg-opacity: 1;
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
+ import type { ClassValue } from 'svelte/elements';
3
4
 
4
5
  type Props = {
5
6
  Header?: Snippet;
6
7
  children: Snippet;
7
8
  Footer?: Snippet;
8
- class?: string;
9
+ class?: ClassValue;
9
10
  variant?: 'default' | 'compact';
10
11
  };
11
12
 
@@ -13,30 +14,38 @@
13
14
  Header,
14
15
  children,
15
16
  Footer,
16
- class: additionalClasses = '',
17
+ class: additionalClasses,
17
18
  variant = 'default',
18
19
  }: Props = $props();
19
20
  </script>
20
21
 
21
- <div class="wrapper {variant} {additionalClasses}">
22
+ <div class={['wrapper', variant, additionalClasses]}>
22
23
  {#if Header}
23
24
  <header
24
- class="flex w-full items-center justify-between {variant === 'default'
25
- ? 'min-h-10 px-4'
26
- : 'min-h-8 px-3'}"
25
+ class={[
26
+ 'flex w-full items-center justify-between',
27
+ {
28
+ 'min-h-10 px-4': variant === 'default',
29
+ 'min-h-8 px-3': variant === 'compact',
30
+ },
31
+ ]}
27
32
  >
28
33
  {@render Header()}
29
34
  </header>
30
35
  {/if}
31
36
  <div
32
- class="flex w-full !overflow-hidden [&>*]:w-full {variant === 'default'
33
- ? '[&>*]:rounded-xl'
34
- : '[&>*]:rounded-[10px]'}"
37
+ class={[
38
+ 'flex w-full flex-col !overflow-hidden [&>*]:w-full',
39
+ {
40
+ 'gap-1 [&>*]:rounded-xl': variant === 'default',
41
+ 'gap-0.5 [&>*]:rounded-[10px]': variant === 'compact',
42
+ },
43
+ ]}
35
44
  >
36
45
  {@render children()}
37
46
  </div>
38
47
  {#if Footer}
39
- <footer class="flex min-h-8 w-full items-center {variant === 'default' ? 'px-4' : 'px-3'}">
48
+ <footer class="flex min-h-8 w-full items-center px-3">
40
49
  {@render Footer()}
41
50
  </footer>
42
51
  {/if}
@@ -1,9 +1,10 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { ClassValue } from 'svelte/elements';
2
3
  type Props = {
3
4
  Header?: Snippet;
4
5
  children: Snippet;
5
6
  Footer?: Snippet;
6
- class?: string;
7
+ class?: ClassValue;
7
8
  variant?: 'default' | 'compact';
8
9
  };
9
10
  declare const CardWrapper: import("svelte").Component<Props, {}, "">;
@@ -6,23 +6,155 @@
6
6
  component: Tabs,
7
7
  title: 'Design System/Tabs',
8
8
  tags: ['autodocs'],
9
+ argTypes: {
10
+ size: {
11
+ control: 'select',
12
+ options: ['sm', 'md', 'lg'],
13
+ description: 'Size of the tabs container',
14
+ },
15
+ },
9
16
  });
10
17
 
11
18
  let activeTab = 'tab-1';
19
+ let activeTabPrimary = 'tab-1';
20
+ let activeTabSecondary = 'tab-1';
21
+ let activeTabTransparent = 'tab-1';
22
+ let activeTabSizes = 'tab-1';
12
23
  </script>
13
24
 
14
- <Story name="Primary" asChild>
25
+ <Story name="Primary Variant" asChild>
15
26
  <Tabs>
16
27
  {#snippet children({ Tabs, Tab, Content })}
17
- <Tabs>
18
- <Tab active={activeTab === 'tab-1'} onClick={() => (activeTab = 'tab-1')}>Tab 1</Tab>
19
- <Tab active={activeTab === 'tab-2'} onClick={() => (activeTab = 'tab-2')}>Tab 2</Tab>
20
- <Tab active={activeTab === 'tab-3'} onClick={() => (activeTab = 'tab-3')}>Tab 3</Tab>
28
+ <Tabs variant="primary">
29
+ <Tab active={activeTabPrimary === 'tab-1'} onclick={() => (activeTabPrimary = 'tab-1')}
30
+ >Tab 1</Tab
31
+ >
32
+ <Tab active={activeTabPrimary === 'tab-2'} onclick={() => (activeTabPrimary = 'tab-2')}
33
+ >Tab 2</Tab
34
+ >
35
+ <Tab active={activeTabPrimary === 'tab-3'} onclick={() => (activeTabPrimary = 'tab-3')}
36
+ >Tab 3</Tab
37
+ >
38
+ </Tabs>
39
+
40
+ <Content show={activeTabPrimary === 'tab-1'}>Showing primary tab 1 content</Content>
41
+ <Content show={activeTabPrimary === 'tab-2'}>Showing primary tab 2 content</Content>
42
+ <Content show={activeTabPrimary === 'tab-3'}>Showing primary tab 3 content</Content>
43
+ {/snippet}
44
+ </Tabs>
45
+ </Story>
46
+
47
+ <Story name="Secondary Variant" asChild>
48
+ <Tabs>
49
+ {#snippet children({ Tabs, Tab, Content })}
50
+ <Tabs variant="secondary">
51
+ <Tab active={activeTabSecondary === 'tab-1'} onclick={() => (activeTabSecondary = 'tab-1')}
52
+ >Tab 1</Tab
53
+ >
54
+ <Tab active={activeTabSecondary === 'tab-2'} onclick={() => (activeTabSecondary = 'tab-2')}
55
+ >Tab 2</Tab
56
+ >
57
+ <Tab active={activeTabSecondary === 'tab-3'} onclick={() => (activeTabSecondary = 'tab-3')}
58
+ >Tab 3</Tab
59
+ >
60
+ </Tabs>
61
+
62
+ <Content show={activeTabSecondary === 'tab-1'}>Showing secondary tab 1 content</Content>
63
+ <Content show={activeTabSecondary === 'tab-2'}>Showing secondary tab 2 content</Content>
64
+ <Content show={activeTabSecondary === 'tab-3'}>Showing secondary tab 3 content</Content>
65
+ {/snippet}
66
+ </Tabs>
67
+ </Story>
68
+
69
+ <Story name="Transparent Variant" asChild>
70
+ <Tabs>
71
+ {#snippet children({ Tabs, Tab, Content })}
72
+ <Tabs variant="transparent">
73
+ <Tab
74
+ active={activeTabTransparent === 'tab-1'}
75
+ onclick={() => (activeTabTransparent = 'tab-1')}>Tab 1</Tab
76
+ >
77
+ <Tab
78
+ active={activeTabTransparent === 'tab-2'}
79
+ onclick={() => (activeTabTransparent = 'tab-2')}>Tab 2</Tab
80
+ >
81
+ <Tab
82
+ active={activeTabTransparent === 'tab-3'}
83
+ onclick={() => (activeTabTransparent = 'tab-3')}>Tab 3</Tab
84
+ >
21
85
  </Tabs>
22
86
 
23
- <Content show={activeTab === 'tab-1'}>Showing tab 1 content</Content>
24
- <Content show={activeTab === 'tab-2'}>Showing tab 2 content</Content>
25
- <Content show={activeTab === 'tab-3'}>Showing tab 3 content</Content>
87
+ <Content show={activeTabTransparent === 'tab-1'}>Showing transparent tab 1 content</Content>
88
+ <Content show={activeTabTransparent === 'tab-2'}>Showing transparent tab 2 content</Content>
89
+ <Content show={activeTabTransparent === 'tab-3'}>Showing transparent tab 3 content</Content>
26
90
  {/snippet}
27
91
  </Tabs>
28
92
  </Story>
93
+
94
+ <Story name="Different Sizes" asChild>
95
+ <div class="flex flex-col gap-6">
96
+ <div>
97
+ <h4 class="mb-2 text-sm font-medium">Small (sm), full width</h4>
98
+ <Tabs>
99
+ {#snippet children({ Tabs, Tab, Content })}
100
+ <Tabs variant="primary" size="sm">
101
+ <Tab active={activeTabSizes === 'tab-1'} onclick={() => (activeTabSizes = 'tab-1')}
102
+ >Small Tab 1</Tab
103
+ >
104
+ <Tab active={activeTabSizes === 'tab-2'} onclick={() => (activeTabSizes = 'tab-2')}
105
+ >Small Tab 2</Tab
106
+ >
107
+ </Tabs>
108
+ {/snippet}
109
+ </Tabs>
110
+ </div>
111
+
112
+ <div>
113
+ <h4 class="mb-2 text-sm font-medium">Medium (md), full width</h4>
114
+ <Tabs>
115
+ {#snippet children({ Tabs, Tab, Content })}
116
+ <Tabs variant="primary" size="md">
117
+ <Tab active={activeTabSizes === 'tab-1'} onclick={() => (activeTabSizes = 'tab-1')}
118
+ >Medium Tab 1</Tab
119
+ >
120
+ <Tab active={activeTabSizes === 'tab-2'} onclick={() => (activeTabSizes = 'tab-2')}
121
+ >Medium Tab 2</Tab
122
+ >
123
+ </Tabs>
124
+ {/snippet}
125
+ </Tabs>
126
+ </div>
127
+
128
+ <div>
129
+ <h4 class="mb-2 text-sm font-medium">Large (lg), full width</h4>
130
+ <Tabs>
131
+ {#snippet children({ Tabs, Tab, Content })}
132
+ <Tabs variant="primary" size="lg">
133
+ <Tab active={activeTabSizes === 'tab-1'} onclick={() => (activeTabSizes = 'tab-1')}
134
+ >Large Tab 1</Tab
135
+ >
136
+ <Tab active={activeTabSizes === 'tab-2'} onclick={() => (activeTabSizes = 'tab-2')}
137
+ >Large Tab 2</Tab
138
+ >
139
+ </Tabs>
140
+ {/snippet}
141
+ </Tabs>
142
+ </div>
143
+
144
+ <div>
145
+ <h4 class="mb-2 text-sm font-medium">Large (lg), fit content</h4>
146
+ <Tabs>
147
+ {#snippet children({ Tabs, Tab, Content })}
148
+ <Tabs variant="primary" size="lg" fullWidth={false}>
149
+ <Tab active={activeTabSizes === 'tab-1'} onclick={() => (activeTabSizes = 'tab-1')}
150
+ >Included in score</Tab
151
+ >
152
+ <Tab active={activeTabSizes === 'tab-2'} onclick={() => (activeTabSizes = 'tab-2')}
153
+ >Excluded from score</Tab
154
+ >
155
+ </Tabs>
156
+ {/snippet}
157
+ </Tabs>
158
+ </div>
159
+ </div>
160
+ </Story>
@@ -1,21 +1,22 @@
1
1
  <script lang="ts">
2
- import { Button } from '../../button/';
3
2
  import type { Snippet } from 'svelte';
3
+ import Button from '../../button/Button.svelte';
4
+
4
5
  interface Props {
5
- active?: boolean;
6
- onClick: () => void;
7
6
  class?: string;
7
+ active?: boolean;
8
+ onclick?: () => void;
8
9
  children?: Snippet;
9
10
  }
10
11
 
11
- let { active = false, onClick, class: className = '', children }: Props = $props();
12
+ let { class: className = '', active = false, onclick, children }: Props = $props();
12
13
  </script>
13
14
 
14
15
  <Button
15
- {onClick}
16
+ {onclick}
16
17
  variant="transparent"
17
- size="md"
18
- class={`tab flex !h-10 gap-2 !rounded-md !px-0 !py-0 ${active ? 'tab-active' : ''} ${className}`}
18
+ size="sm"
19
+ class={`tab !h-full ${className} ${active ? 'active' : ''}`}
19
20
  >
20
21
  {@render children?.()}
21
22
  </Button>
@@ -1,8 +1,8 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  interface Props {
3
- active?: boolean;
4
- onClick: () => void;
5
3
  class?: string;
4
+ active?: boolean;
5
+ onclick?: () => void;
6
6
  children?: Snippet;
7
7
  }
8
8
  declare const Tab: import("svelte").Component<Props, {}, "">;
@@ -1,14 +1,82 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
 
4
+ type Size = 'sm' | 'md' | 'lg';
5
+ type Variant = 'primary' | 'secondary' | 'transparent';
6
+
4
7
  interface Props {
5
8
  class?: string;
6
- children?: Snippet;
9
+ size?: Size;
10
+ variant?: Variant;
11
+ fullWidth?: boolean;
12
+ children?: Snippet<[{ variant: Variant }]>;
7
13
  }
8
14
 
9
- let { class: className = '', children }: Props = $props();
15
+ let {
16
+ class: className = '',
17
+ size = 'lg',
18
+ variant = 'primary',
19
+ fullWidth = true,
20
+ children,
21
+ }: Props = $props();
22
+
23
+ const sizes = {
24
+ sm: 'h-8 p-0.5 gap-0.5 rounded-lg [&>*]:!rounded-md',
25
+ md: 'h-10 p-1 gap-1 rounded-[10px] [&>*]:!rounded-md',
26
+ lg: 'h-12 p-1 gap-1 rounded-xl',
27
+ };
10
28
  </script>
11
29
 
12
- <div role="tablist" class={`tabs-boxed tabs h-[48px] gap-1 rounded-lg ${className}`}>
13
- {@render children?.()}
30
+ <div
31
+ role="tablist"
32
+ class={`flex ${sizes[size]} ${variant} ${className} ${fullWidth ? 'w-full [&>*]:flex-1' : 'w-fit [&>*]:flex-none'}`}
33
+ >
34
+ {@render children?.({ variant })}
14
35
  </div>
36
+
37
+ <style>
38
+ .primary {
39
+
40
+ background-color: #12192a0A
41
+ }
42
+
43
+ .primary :global(.tab.active) {
44
+
45
+ border-color: #12192A1A;
46
+
47
+ --tw-bg-opacity: 1;
48
+
49
+ background-color: rgb(87 80 238 / var(--tw-bg-opacity, 1));
50
+
51
+ --tw-text-opacity: 1;
52
+
53
+ color: rgb(255 255 255 / var(--tw-text-opacity, 1))
54
+ }
55
+
56
+ .secondary {
57
+
58
+ background-color: #12192a0A
59
+ }
60
+
61
+ .secondary :global(.tab.active) {
62
+
63
+ border-color: #12192A1A;
64
+
65
+ --tw-bg-opacity: 1;
66
+
67
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
68
+
69
+ --tw-text-opacity: 1;
70
+
71
+ color: rgb(18 25 42 / var(--tw-text-opacity, 1))
72
+ }
73
+
74
+ .transparent :global(.tab.active) {
75
+
76
+ background-color: #12192a0A;
77
+
78
+ --tw-text-opacity: 1;
79
+
80
+ color: rgb(18 25 42 / var(--tw-text-opacity, 1))
81
+ }
82
+ </style>
@@ -1,7 +1,14 @@
1
1
  import type { Snippet } from 'svelte';
2
+ type Size = 'sm' | 'md' | 'lg';
3
+ type Variant = 'primary' | 'secondary' | 'transparent';
2
4
  interface Props {
3
5
  class?: string;
4
- children?: Snippet;
6
+ size?: Size;
7
+ variant?: Variant;
8
+ fullWidth?: boolean;
9
+ children?: Snippet<[{
10
+ variant: Variant;
11
+ }]>;
5
12
  }
6
13
  declare const Tabs: import("svelte").Component<Props, {}, "">;
7
14
  type Tabs = ReturnType<typeof Tabs>;
@@ -8,7 +8,7 @@ import { BarChart } from 'echarts/charts';
8
8
  import { ScatterChart } from 'echarts/charts';
9
9
  import { CustomChart } from 'echarts/charts';
10
10
  // Components we use
11
- import { TooltipComponent, GridComponent, LegendComponent, MarkLineComponent, MarkAreaComponent, AxisPointerComponent, TitleComponent, } from 'echarts/components';
11
+ import { TooltipComponent, GridComponent, LegendComponent, MarkLineComponent, MarkAreaComponent, AxisPointerComponent, TitleComponent, DatasetComponent, } from 'echarts/components';
12
12
  // Renderers (we primarily use SVG)
13
13
  import { SVGRenderer, CanvasRenderer } from 'echarts/renderers';
14
14
  // Register only the components we actually use
@@ -26,6 +26,7 @@ echarts.use([
26
26
  MarkAreaComponent,
27
27
  AxisPointerComponent,
28
28
  TitleComponent,
29
+ DatasetComponent,
29
30
  // Renderers (both needed - SVG is default, Canvas for large datasets)
30
31
  SVGRenderer,
31
32
  CanvasRenderer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reshape-biotech/design-system",
3
- "version": "2.7.1",
3
+ "version": "2.7.3",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",