@reshape-biotech/design-system 1.1.1 → 1.2.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/dist/components/activity/Activity.svelte +12 -4
- package/dist/components/activity/Activity.svelte.d.ts +1 -1
- package/dist/components/banner/Banner.svelte +1 -1
- package/dist/components/datepicker/DatePicker.stories.svelte +6 -5
- package/dist/components/datepicker/DatePicker.svelte +1 -0
- package/dist/components/graphs/bar-chart/BarChart.stories.svelte +38 -0
- package/dist/components/graphs/bar-chart/BarChart.svelte +14 -1
- package/dist/components/graphs/bar-chart/BarChart.svelte.d.ts +1 -0
- package/dist/components/graphs/bar-chart/StackedBarChart.stories.svelte +32 -0
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte +16 -3
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte.d.ts +3 -2
- package/dist/components/graphs/chart/Chart.stories.svelte +0 -3
- package/dist/components/graphs/line/LineChart.stories.svelte +21 -13
- package/dist/components/graphs/line/LineChart.svelte +14 -20
- package/dist/components/graphs/line/LineChart.svelte.d.ts +1 -0
- package/dist/components/graphs/matrix/Matrix.stories.svelte +0 -14
- package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +15 -40
- package/dist/components/graphs/multiline/MultiLineChart.svelte +0 -20
- package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte +1 -1
- package/dist/components/icons/AnalysisIcon.svelte +10 -1
- package/dist/components/icons/AnalysisIcon.svelte.d.ts +1 -0
- package/dist/components/icons/index.d.ts +1 -1
- package/dist/components/icons/index.js +12 -0
- package/dist/components/notifications/Notifications.stories.svelte +107 -0
- package/dist/components/notifications/Notifications.stories.svelte.d.ts +19 -0
- package/dist/components/notifications/Notifications.svelte +32 -0
- package/dist/components/notifications/Notifications.svelte.d.ts +18 -0
- package/dist/components/notifications/index.d.ts +1 -0
- package/dist/components/notifications/index.js +1 -0
- package/dist/components/select-new/components/Group.svelte +3 -2
- package/dist/components/select-new/components/Group.svelte.d.ts +1 -0
- package/dist/components/select-new/index.d.ts +1 -1
- package/dist/components/stepper/Stepper.stories.svelte +243 -0
- package/dist/components/stepper/Stepper.stories.svelte.d.ts +19 -0
- package/dist/components/stepper/components/stepper-root.svelte +20 -0
- package/dist/components/stepper/components/stepper-root.svelte.d.ts +9 -0
- package/dist/components/stepper/components/stepper-step.svelte +100 -0
- package/dist/components/stepper/components/stepper-step.svelte.d.ts +11 -0
- package/dist/components/stepper/index.d.ts +15 -0
- package/dist/components/stepper/index.js +2 -0
- package/dist/components/toast/Toast.stories.svelte +209 -0
- package/dist/components/toast/Toast.stories.svelte.d.ts +19 -0
- package/dist/components/toast/Toast.svelte +62 -0
- package/dist/components/toast/Toast.svelte.d.ts +7 -0
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/tailwind.preset.d.ts +3 -0
- package/dist/tokens.d.ts +6 -0
- package/dist/tokens.js +3 -3
- package/package.json +1 -1
|
@@ -35,6 +35,7 @@ import Copy from 'phosphor-svelte/lib/Copy';
|
|
|
35
35
|
import Crop from 'phosphor-svelte/lib/Crop';
|
|
36
36
|
import Cube from 'phosphor-svelte/lib/Cube';
|
|
37
37
|
import Database from 'phosphor-svelte/lib/Database';
|
|
38
|
+
import Dna from 'phosphor-svelte/lib/Dna';
|
|
38
39
|
import DotsThree from 'phosphor-svelte/lib/DotsThree';
|
|
39
40
|
import DotsThreeOutlineVertical from 'phosphor-svelte/lib/DotsThreeOutlineVertical';
|
|
40
41
|
import DownloadSimple from 'phosphor-svelte/lib/DownloadSimple';
|
|
@@ -58,11 +59,14 @@ import House from 'phosphor-svelte/lib/House';
|
|
|
58
59
|
import ImageSquare from 'phosphor-svelte/lib/ImageSquare';
|
|
59
60
|
import ImagesSquare from 'phosphor-svelte/lib/ImagesSquare';
|
|
60
61
|
import Info from 'phosphor-svelte/lib/Info';
|
|
62
|
+
import Link from 'phosphor-svelte/lib/Link';
|
|
61
63
|
import Lock from 'phosphor-svelte/lib/Lock';
|
|
62
64
|
import LineSegments from 'phosphor-svelte/lib/LineSegments';
|
|
63
65
|
import List from 'phosphor-svelte/lib/List';
|
|
66
|
+
import ListMagnifyingGlass from 'phosphor-svelte/lib/ListMagnifyingGlass';
|
|
64
67
|
import MagnifyingGlass from 'phosphor-svelte/lib/MagnifyingGlass';
|
|
65
68
|
import MegaphoneSimple from 'phosphor-svelte/lib/MegaphoneSimple';
|
|
69
|
+
import MicrosoftExcelLogo from 'phosphor-svelte/lib/MicrosoftExcelLogo';
|
|
66
70
|
import Moon from 'phosphor-svelte/lib/Moon';
|
|
67
71
|
import Minus from 'phosphor-svelte/lib/Minus';
|
|
68
72
|
import Pause from 'phosphor-svelte/lib/Pause';
|
|
@@ -75,6 +79,7 @@ import Plant from 'phosphor-svelte/lib/Plant';
|
|
|
75
79
|
import Play from 'phosphor-svelte/lib/Play';
|
|
76
80
|
import Plus from 'phosphor-svelte/lib/Plus';
|
|
77
81
|
import PlusMinus from 'phosphor-svelte/lib/PlusMinus';
|
|
82
|
+
import Ruler from 'phosphor-svelte/lib/Ruler';
|
|
78
83
|
import Question from 'phosphor-svelte/lib/Question';
|
|
79
84
|
import SealCheck from 'phosphor-svelte/lib/SealCheck';
|
|
80
85
|
import RadioButton from 'phosphor-svelte/lib/RadioButton';
|
|
@@ -101,6 +106,7 @@ import Target from 'phosphor-svelte/lib/Target';
|
|
|
101
106
|
import TestTube from 'phosphor-svelte/lib/TestTube';
|
|
102
107
|
import Trash from 'phosphor-svelte/lib/Trash';
|
|
103
108
|
import TrashSimple from 'phosphor-svelte/lib/TrashSimple';
|
|
109
|
+
import TreeStructure from 'phosphor-svelte/lib/TreeStructure';
|
|
104
110
|
import UserCircle from 'phosphor-svelte/lib/UserCircle';
|
|
105
111
|
import UserPlus from 'phosphor-svelte/lib/UserPlus';
|
|
106
112
|
import Video from 'phosphor-svelte/lib/Video';
|
|
@@ -146,6 +152,7 @@ export const iconMap = {
|
|
|
146
152
|
Crop,
|
|
147
153
|
Cube,
|
|
148
154
|
Database,
|
|
155
|
+
Dna,
|
|
149
156
|
DotsThree,
|
|
150
157
|
DotsThreeOutlineVertical,
|
|
151
158
|
DownloadSimple,
|
|
@@ -172,8 +179,11 @@ export const iconMap = {
|
|
|
172
179
|
Lock,
|
|
173
180
|
LineSegments,
|
|
174
181
|
List,
|
|
182
|
+
Link,
|
|
183
|
+
ListMagnifyingGlass,
|
|
175
184
|
MagnifyingGlass,
|
|
176
185
|
MegaphoneSimple,
|
|
186
|
+
MicrosoftExcelLogo,
|
|
177
187
|
Moon,
|
|
178
188
|
Minus,
|
|
179
189
|
Palette,
|
|
@@ -187,6 +197,7 @@ export const iconMap = {
|
|
|
187
197
|
Plus,
|
|
188
198
|
PlusMinus,
|
|
189
199
|
RadioButton,
|
|
200
|
+
Ruler,
|
|
190
201
|
Question,
|
|
191
202
|
SealCheck,
|
|
192
203
|
SealQuestion,
|
|
@@ -212,6 +223,7 @@ export const iconMap = {
|
|
|
212
223
|
TestTube,
|
|
213
224
|
Trash,
|
|
214
225
|
TrashSimple,
|
|
226
|
+
TreeStructure,
|
|
215
227
|
UserCircle,
|
|
216
228
|
UserPlus,
|
|
217
229
|
Video,
|
|
@@ -0,0 +1,107 @@
|
|
|
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';
|
|
6
|
+
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Notifications,
|
|
9
|
+
title: 'Design System/Notifications',
|
|
10
|
+
tags: ['autodocs']
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
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>
|
|
107
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Notifications from '../notifications/Notifications.svelte';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Notifications: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Notifications = InstanceType<typeof Notifications>;
|
|
19
|
+
export default Notifications;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { flip } from 'svelte/animate';
|
|
3
|
+
import { fly } from 'svelte/transition';
|
|
4
|
+
import { notifications } from '../../../notifications';
|
|
5
|
+
import { type IconColor } from '../icons';
|
|
6
|
+
import { tokens } from '../../tokens';
|
|
7
|
+
import Toast from '../toast/Toast.svelte';
|
|
8
|
+
|
|
9
|
+
const color = {
|
|
10
|
+
danger: tokens.backgroundColor['danger-inverse'],
|
|
11
|
+
success: tokens.backgroundColor['success-inverse-hover'],
|
|
12
|
+
warning: tokens.backgroundColor['warning-inverse-hover'],
|
|
13
|
+
info: tokens.backgroundColor['blue-inverse'],
|
|
14
|
+
default: tokens.backgroundColor.surface
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const textColor: Record<string, IconColor | 'inherit'> = {
|
|
18
|
+
danger: 'primary-inverse',
|
|
19
|
+
success: 'primary-inverse',
|
|
20
|
+
warning: 'primary-inverse',
|
|
21
|
+
info: 'primary-inverse',
|
|
22
|
+
default: 'inherit'
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<div class="fixed left-0 right-0 top-2 z-50 mx-auto flex w-fit flex-col items-center justify-start">
|
|
27
|
+
{#each $notifications as notification (notification.id)}
|
|
28
|
+
<div animate:flip transition:fly={{ y: -10 }}>
|
|
29
|
+
<Toast {notification} />
|
|
30
|
+
</div>
|
|
31
|
+
{/each}
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Notifications: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Notifications = InstanceType<typeof Notifications>;
|
|
18
|
+
export default Notifications;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Notifications } from './Notifications.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Notifications } from './Notifications.svelte';
|
|
@@ -8,16 +8,17 @@
|
|
|
8
8
|
label?: string;
|
|
9
9
|
children: Snippet;
|
|
10
10
|
class?: string;
|
|
11
|
+
contentClass?: string;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
let { label, children, class: className, ...restProps }: Props = $props();
|
|
14
|
+
let { label, children, class: className, contentClass, ...restProps }: Props = $props();
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
17
|
<SelectPrimitive.Group class={className} {...restProps}>
|
|
17
18
|
{#if label}
|
|
18
19
|
<GroupHeading>{label}</GroupHeading>
|
|
19
20
|
{/if}
|
|
20
|
-
<div class=
|
|
21
|
+
<div class={contentClass}>
|
|
21
22
|
{@render children()}
|
|
22
23
|
</div>
|
|
23
24
|
</SelectPrimitive.Group>
|
|
@@ -4,7 +4,7 @@ import GroupHeading from './components/SelectGroupHeading.svelte';
|
|
|
4
4
|
import Trigger from './components/SelectTrigger.svelte';
|
|
5
5
|
import MultiSelectTrigger from './components/MultiSelectTrigger.svelte';
|
|
6
6
|
import Group from './components/Group.svelte';
|
|
7
|
-
export declare const Root: import("svelte").Component<import("bits-ui").
|
|
7
|
+
export declare const Root: import("svelte").Component<import("bits-ui").SelectRootPropsWithoutHTML, {}, "open" | "value">;
|
|
8
8
|
export declare const Portal: import("svelte").Component<import("bits-ui").PortalProps, {}, "">;
|
|
9
9
|
export { Content, Item, Group, GroupHeading, Trigger, MultiSelectTrigger };
|
|
10
10
|
export * from './types';
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import * as Stepper from './index';
|
|
4
|
+
import StepperComponent from './components/stepper-root.svelte';
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Design System/Stepper',
|
|
8
|
+
component: StepperComponent,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
class: { control: 'text', description: 'Additional CSS classes' },
|
|
12
|
+
currentStep: { control: 'text', description: 'The currently active step identifier' }
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<Story name="Controlled by Root">
|
|
18
|
+
<div class="space-y-8 p-4">
|
|
19
|
+
<div>
|
|
20
|
+
<h3 class="mb-4 text-lg font-medium">Stepper controlled by currentStep prop</h3>
|
|
21
|
+
<div class="max-w-sm">
|
|
22
|
+
<Stepper.Root currentStep="2">
|
|
23
|
+
<Stepper.Step stepNumber="1">Configure experiment</Stepper.Step>
|
|
24
|
+
<Stepper.Step stepNumber="2">Set run conditions</Stepper.Step>
|
|
25
|
+
<Stepper.Step stepNumber="3">Approve plate maps</Stepper.Step>
|
|
26
|
+
<Stepper.Step stepNumber="4">Review</Stepper.Step>
|
|
27
|
+
</Stepper.Root>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</Story>
|
|
32
|
+
|
|
33
|
+
<Story name="Non-Numeric Steps">
|
|
34
|
+
<div class="space-y-8 p-4">
|
|
35
|
+
<div>
|
|
36
|
+
<h3 class="mb-4 text-lg font-medium">Stepper with Letter-based Steps</h3>
|
|
37
|
+
<div class="max-w-sm">
|
|
38
|
+
<Stepper.Root currentStep="B">
|
|
39
|
+
<Stepper.Step stepNumber="A">Configure</Stepper.Step>
|
|
40
|
+
<Stepper.Step stepNumber="B">Process</Stepper.Step>
|
|
41
|
+
<Stepper.Step stepNumber="C">Complete</Stepper.Step>
|
|
42
|
+
</Stepper.Root>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</Story>
|
|
47
|
+
|
|
48
|
+
<Story name="All States (Individually set)">
|
|
49
|
+
<div class="space-y-8 p-4">
|
|
50
|
+
<div>
|
|
51
|
+
<h3 class="mb-4 text-lg font-medium">Individual Step States</h3>
|
|
52
|
+
<div class="grid grid-cols-1 gap-6 md:grid-cols-3">
|
|
53
|
+
<div>
|
|
54
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Completed State</h4>
|
|
55
|
+
<div class="max-w-sm">
|
|
56
|
+
<Stepper.Root>
|
|
57
|
+
<Stepper.Step state="completed" stepNumber="1">Configure experiment</Stepper.Step>
|
|
58
|
+
</Stepper.Root>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
<div>
|
|
62
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Active State</h4>
|
|
63
|
+
<div class="max-w-sm">
|
|
64
|
+
<Stepper.Root>
|
|
65
|
+
<Stepper.Step state="active" stepNumber="2">Set run conditions</Stepper.Step>
|
|
66
|
+
</Stepper.Root>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div>
|
|
70
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Future State</h4>
|
|
71
|
+
<div class="max-w-sm">
|
|
72
|
+
<Stepper.Root>
|
|
73
|
+
<Stepper.Step state="future" stepNumber="3">Approve plate maps</Stepper.Step>
|
|
74
|
+
</Stepper.Root>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</Story>
|
|
81
|
+
|
|
82
|
+
<Story name="Progress Examples">
|
|
83
|
+
<div class="space-y-8 p-4">
|
|
84
|
+
<div>
|
|
85
|
+
<h3 class="mb-4 text-lg font-medium">Progress States</h3>
|
|
86
|
+
<div class="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
87
|
+
<div>
|
|
88
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Start State</h4>
|
|
89
|
+
<div class="max-w-sm">
|
|
90
|
+
<Stepper.Root currentStep="1">
|
|
91
|
+
<Stepper.Step stepNumber="1">Configure experiment</Stepper.Step>
|
|
92
|
+
<Stepper.Step stepNumber="2">Set run conditions</Stepper.Step>
|
|
93
|
+
<Stepper.Step stepNumber="3">Approve plate maps</Stepper.Step>
|
|
94
|
+
<Stepper.Step stepNumber="4">Review</Stepper.Step>
|
|
95
|
+
</Stepper.Root>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Mid Progress</h4>
|
|
100
|
+
<div class="max-w-sm">
|
|
101
|
+
<Stepper.Root currentStep="3">
|
|
102
|
+
<Stepper.Step stepNumber="1">Configure experiment</Stepper.Step>
|
|
103
|
+
<Stepper.Step stepNumber="2">Set run conditions</Stepper.Step>
|
|
104
|
+
<Stepper.Step stepNumber="3">Approve plate maps</Stepper.Step>
|
|
105
|
+
<Stepper.Step stepNumber="4">Review</Stepper.Step>
|
|
106
|
+
</Stepper.Root>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div>
|
|
110
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Almost Complete</h4>
|
|
111
|
+
<div class="max-w-sm">
|
|
112
|
+
<Stepper.Root currentStep="4">
|
|
113
|
+
<Stepper.Step stepNumber="1">Configure experiment</Stepper.Step>
|
|
114
|
+
<Stepper.Step stepNumber="2">Set run conditions</Stepper.Step>
|
|
115
|
+
<Stepper.Step stepNumber="3">Approve plate maps</Stepper.Step>
|
|
116
|
+
<Stepper.Step stepNumber="4">Review</Stepper.Step>
|
|
117
|
+
</Stepper.Root>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div>
|
|
121
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">All Complete</h4>
|
|
122
|
+
<div class="max-w-sm">
|
|
123
|
+
<!-- To show all as complete, set currentStep to a non-existent step after the last one -->
|
|
124
|
+
<Stepper.Root currentStep="5">
|
|
125
|
+
<Stepper.Step stepNumber="1">Configure experiment</Stepper.Step>
|
|
126
|
+
<Stepper.Step stepNumber="2">Set run conditions</Stepper.Step>
|
|
127
|
+
<Stepper.Step stepNumber="3">Approve plate maps</Stepper.Step>
|
|
128
|
+
<Stepper.Step stepNumber="4">Review</Stepper.Step>
|
|
129
|
+
</Stepper.Root>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</Story>
|
|
136
|
+
|
|
137
|
+
<Story name="Different Step Counts">
|
|
138
|
+
<div class="space-y-8 p-4">
|
|
139
|
+
<div>
|
|
140
|
+
<h3 class="mb-4 text-lg font-medium">Various Step Configurations</h3>
|
|
141
|
+
<div class="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
142
|
+
<div>
|
|
143
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Two Steps</h4>
|
|
144
|
+
<div class="max-w-sm">
|
|
145
|
+
<Stepper.Root currentStep="1">
|
|
146
|
+
<Stepper.Step stepNumber="1">Setup</Stepper.Step>
|
|
147
|
+
<Stepper.Step stepNumber="2">Review</Stepper.Step>
|
|
148
|
+
</Stepper.Root>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
<div>
|
|
152
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Three Steps</h4>
|
|
153
|
+
<div class="max-w-sm">
|
|
154
|
+
<Stepper.Root currentStep="2">
|
|
155
|
+
<Stepper.Step stepNumber="1">Configure</Stepper.Step>
|
|
156
|
+
<Stepper.Step stepNumber="2">Process</Stepper.Step>
|
|
157
|
+
<Stepper.Step stepNumber="3">Complete</Stepper.Step>
|
|
158
|
+
</Stepper.Root>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
<div>
|
|
162
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Five Steps</h4>
|
|
163
|
+
<div class="max-w-sm">
|
|
164
|
+
<Stepper.Root currentStep="3">
|
|
165
|
+
<Stepper.Step stepNumber="1">Initialize</Stepper.Step>
|
|
166
|
+
<Stepper.Step stepNumber="2">Configure</Stepper.Step>
|
|
167
|
+
<Stepper.Step stepNumber="3">Process</Stepper.Step>
|
|
168
|
+
<Stepper.Step stepNumber="4">Validate</Stepper.Step>
|
|
169
|
+
<Stepper.Step stepNumber="5">Complete</Stepper.Step>
|
|
170
|
+
</Stepper.Root>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
<div>
|
|
174
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Single Step</h4>
|
|
175
|
+
<div class="max-w-sm">
|
|
176
|
+
<Stepper.Root currentStep="1">
|
|
177
|
+
<Stepper.Step stepNumber="1">Single action step</Stepper.Step>
|
|
178
|
+
</Stepper.Root>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
</Story>
|
|
185
|
+
|
|
186
|
+
<Story name="Custom Styling">
|
|
187
|
+
<div class="space-y-8 p-4">
|
|
188
|
+
<div>
|
|
189
|
+
<h3 class="mb-4 text-lg font-medium">Custom Classes</h3>
|
|
190
|
+
<div class="max-w-sm">
|
|
191
|
+
<Stepper.Root currentStep="2" class="rounded-lg border bg-surface p-4">
|
|
192
|
+
<Stepper.Step stepNumber="1" class="font-bold">Configure experiment</Stepper.Step>
|
|
193
|
+
<Stepper.Step stepNumber="2" class="font-bold">Set run conditions</Stepper.Step>
|
|
194
|
+
<Stepper.Step stepNumber="3" class="font-bold">Approve plate maps</Stepper.Step>
|
|
195
|
+
</Stepper.Root>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
</Story>
|
|
200
|
+
|
|
201
|
+
<Story name="Responsive Behavior">
|
|
202
|
+
<div class="space-y-8 p-4">
|
|
203
|
+
<div>
|
|
204
|
+
<h3 class="mb-4 text-lg font-medium">Text Truncation</h3>
|
|
205
|
+
<div class="space-y-6">
|
|
206
|
+
<div>
|
|
207
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Normal Width (224px - Figma spec)</h4>
|
|
208
|
+
<div class="w-56">
|
|
209
|
+
<Stepper.Root currentStep="2">
|
|
210
|
+
<Stepper.Step stepNumber="1">Configure experiment</Stepper.Step>
|
|
211
|
+
<Stepper.Step stepNumber="2">Set run conditions</Stepper.Step>
|
|
212
|
+
<Stepper.Step stepNumber="3">Approve plate maps</Stepper.Step>
|
|
213
|
+
</Stepper.Root>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div>
|
|
217
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Narrow Width (160px)</h4>
|
|
218
|
+
<div class="w-40">
|
|
219
|
+
<Stepper.Root currentStep="2">
|
|
220
|
+
<Stepper.Step stepNumber="1">Configure experiment parameters</Stepper.Step>
|
|
221
|
+
<Stepper.Step stepNumber="2">Set run conditions and parameters</Stepper.Step>
|
|
222
|
+
<Stepper.Step stepNumber="3">Approve all plate maps and configurations</Stepper.Step>
|
|
223
|
+
</Stepper.Root>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
<div>
|
|
227
|
+
<h4 class="mb-2 text-sm font-medium text-secondary">Very Narrow Width (120px)</h4>
|
|
228
|
+
<div class="w-30">
|
|
229
|
+
<Stepper.Root currentStep="2">
|
|
230
|
+
<Stepper.Step stepNumber="1"
|
|
231
|
+
>Configure experiment parameters and settings</Stepper.Step
|
|
232
|
+
>
|
|
233
|
+
<Stepper.Step stepNumber="2">Set detailed run conditions and parameters</Stepper.Step>
|
|
234
|
+
<Stepper.Step stepNumber="3"
|
|
235
|
+
>Approve all plate maps and final configurations</Stepper.Step
|
|
236
|
+
>
|
|
237
|
+
</Stepper.Root>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as Stepper from './index';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Stepper: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Stepper = InstanceType<typeof Stepper>;
|
|
19
|
+
export default Stepper;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { setContext } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
children: Snippet;
|
|
7
|
+
class?: string;
|
|
8
|
+
currentStep?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { children, class: className = '', currentStep }: Props = $props();
|
|
12
|
+
|
|
13
|
+
setContext('STEPPER_CONTEXT', {
|
|
14
|
+
currentStep
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div class="flex w-full flex-col gap-3 {className}" role="progressbar">
|
|
19
|
+
{@render children()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: Snippet;
|
|
4
|
+
class?: string;
|
|
5
|
+
currentStep?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const StepperRoot: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type StepperRoot = ReturnType<typeof StepperRoot>;
|
|
9
|
+
export default StepperRoot;
|