@reshape-biotech/design-system 1.1.1 → 1.1.2
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/chart/Chart.stories.svelte +0 -3
- package/dist/components/graphs/line/LineChart.stories.svelte +1 -13
- package/dist/components/graphs/matrix/Matrix.stories.svelte +0 -14
- package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +15 -40
- 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 +10 -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/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/index.d.ts +2 -0
- package/dist/index.js +2 -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
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
| 'start'
|
|
13
13
|
| 'stop'
|
|
14
14
|
| 'warning'
|
|
15
|
-
| 'success'
|
|
15
|
+
| 'success'
|
|
16
|
+
| 'export-succeeded'
|
|
17
|
+
| 'export-failed';
|
|
16
18
|
|
|
17
19
|
type Activity = {
|
|
18
20
|
activity_type?: string;
|
|
@@ -40,7 +42,9 @@
|
|
|
40
42
|
start: 'Play',
|
|
41
43
|
stop: 'Stop',
|
|
42
44
|
warning: 'Warning',
|
|
43
|
-
success: 'Check'
|
|
45
|
+
success: 'Check',
|
|
46
|
+
'export-succeeded': 'DownloadSimple',
|
|
47
|
+
'export-failed': 'DownloadSimple'
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
const ACTIVITY_COLOR: Record<ActivityIcon, IconColor> = {
|
|
@@ -53,7 +57,9 @@
|
|
|
53
57
|
start: 'icon-secondary',
|
|
54
58
|
stop: 'icon-secondary',
|
|
55
59
|
warning: 'icon-warning',
|
|
56
|
-
success: 'icon-secondary'
|
|
60
|
+
success: 'icon-secondary',
|
|
61
|
+
'export-succeeded': 'icon-secondary',
|
|
62
|
+
'export-failed': 'icon-danger'
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
const ACTIVITY_BACKGROUND: Record<ActivityIcon, BackgroundClass> = {
|
|
@@ -66,7 +72,9 @@
|
|
|
66
72
|
start: 'bg-neutral',
|
|
67
73
|
stop: 'bg-neutral',
|
|
68
74
|
warning: 'bg-warning',
|
|
69
|
-
success: 'bg-neutral'
|
|
75
|
+
success: 'bg-neutral',
|
|
76
|
+
'export-succeeded': 'bg-neutral',
|
|
77
|
+
'export-failed': 'bg-danger'
|
|
70
78
|
};
|
|
71
79
|
|
|
72
80
|
function formatDateTime(timestamp: string): string {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type ActivityIcon = 'add' | 'capture' | 'delete' | 'edit' | 'failed' | 'pause' | 'start' | 'stop' | 'warning' | 'success';
|
|
1
|
+
type ActivityIcon = 'add' | 'capture' | 'delete' | 'edit' | 'failed' | 'pause' | 'start' | 'stop' | 'warning' | 'success' | 'export-succeeded' | 'export-failed';
|
|
2
2
|
type Activity = {
|
|
3
3
|
activity_type?: string;
|
|
4
4
|
icon: ActivityIcon;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
{#if show}
|
|
32
|
-
<div class="rounded-lg bg-{color} flex
|
|
32
|
+
<div class="rounded-lg bg-{color} flex w-full items-center justify-between p-3">
|
|
33
33
|
<div class="inline-flex w-full items-center justify-start gap-3">
|
|
34
34
|
{#if icon}
|
|
35
35
|
<div class="flex size-5 items-center justify-center text-icon-{color} ">
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { DateTime } from 'luxon';
|
|
5
5
|
import DatePicker from './DatePicker.svelte';
|
|
6
6
|
import Dropdown from '../dropdown/Dropdown.svelte';
|
|
7
|
-
import Button from '../button/Button.svelte';
|
|
8
7
|
import { Icon } from '../icons';
|
|
9
8
|
|
|
10
9
|
const { Story } = defineMeta({
|
|
@@ -19,6 +18,8 @@
|
|
|
19
18
|
}
|
|
20
19
|
});
|
|
21
20
|
|
|
21
|
+
const staticDate = DateTime.local(2023, 10, 15);
|
|
22
|
+
|
|
22
23
|
let selectedDate = $state<DateTime | undefined>(undefined);
|
|
23
24
|
let loggedDate = $state<string | undefined>(undefined);
|
|
24
25
|
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
|
|
52
53
|
<Story name="Default" args={{ selectedDate: undefined }} />
|
|
53
54
|
|
|
54
|
-
<Story name="With Selected Date" args={{ selectedDate:
|
|
55
|
+
<Story name="With Selected Date" args={{ selectedDate: staticDate }} />
|
|
55
56
|
|
|
56
57
|
<Story name="With Date Change Handler" asChild>
|
|
57
58
|
<div class="p-4">
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
|
|
69
70
|
<Story name="Month Navigation" asChild>
|
|
70
71
|
<div class="p-4">
|
|
71
|
-
<DatePicker selectedDate={
|
|
72
|
+
<DatePicker selectedDate={staticDate} />
|
|
72
73
|
<div class="mt-4 text-sm text-tertiary">
|
|
73
74
|
<p>Click the arrow buttons to navigate between months</p>
|
|
74
75
|
</div>
|
|
@@ -117,11 +118,11 @@
|
|
|
117
118
|
<div class="flex flex-col gap-4 p-4 md:flex-row">
|
|
118
119
|
<div>
|
|
119
120
|
<h3 class="mb-2 text-sm font-medium">Start Date</h3>
|
|
120
|
-
<DatePicker selectedDate={
|
|
121
|
+
<DatePicker selectedDate={staticDate.minus({ days: 7 })} />
|
|
121
122
|
</div>
|
|
122
123
|
<div>
|
|
123
124
|
<h3 class="mb-2 text-sm font-medium">End Date</h3>
|
|
124
|
-
<DatePicker selectedDate={
|
|
125
|
+
<DatePicker selectedDate={staticDate} />
|
|
125
126
|
</div>
|
|
126
127
|
</div>
|
|
127
128
|
</Story>
|
|
@@ -140,6 +140,7 @@
|
|
|
140
140
|
{#if dayOfMonth === currentDay && shownMonth === currentMonth && shownYear === currentYear && dayOfMonth != selectedDay}
|
|
141
141
|
<svg
|
|
142
142
|
class="current-date-indicator text-accent"
|
|
143
|
+
data-chromatic="ignore"
|
|
143
144
|
xmlns="http://www.w3.org/2000/svg"
|
|
144
145
|
width="4"
|
|
145
146
|
height="4"
|
|
@@ -54,9 +54,6 @@
|
|
|
54
54
|
<!-- Custom Size -->
|
|
55
55
|
<Story name="Custom Size" args={{ options: baseOptions, ...defaultProps }} />
|
|
56
56
|
|
|
57
|
-
<!-- Loading State -->
|
|
58
|
-
<Story name="Loading State" args={{ options: baseOptions, ...defaultProps, loading: true }} />
|
|
59
|
-
|
|
60
57
|
<!-- With Events -->
|
|
61
58
|
<Story
|
|
62
59
|
name="With Click Events"
|
|
@@ -51,19 +51,7 @@
|
|
|
51
51
|
/>
|
|
52
52
|
</div>
|
|
53
53
|
</Story>
|
|
54
|
-
|
|
55
|
-
<div class="h-[400px] w-full">
|
|
56
|
-
<LineChart
|
|
57
|
-
{xAxisName}
|
|
58
|
-
{yAxisName}
|
|
59
|
-
{data}
|
|
60
|
-
loading
|
|
61
|
-
onitemclick={handleItemClick}
|
|
62
|
-
onmouseover={handleMouseOver}
|
|
63
|
-
onmouseout={handleMouseOut}
|
|
64
|
-
/>
|
|
65
|
-
</div>
|
|
66
|
-
</Story>
|
|
54
|
+
|
|
67
55
|
<Story name="Large datasets with capture intervals" asChild>
|
|
68
56
|
<div class="h-[400px] w-full">
|
|
69
57
|
<LineChart
|
|
@@ -81,20 +81,6 @@
|
|
|
81
81
|
</div>
|
|
82
82
|
</Story>
|
|
83
83
|
|
|
84
|
-
<Story name="Loading" asChild>
|
|
85
|
-
<div class="h-[500px] w-full">
|
|
86
|
-
<Matrix
|
|
87
|
-
data={confusionMatrix}
|
|
88
|
-
{rowLabels}
|
|
89
|
-
{colLabels}
|
|
90
|
-
loading={true}
|
|
91
|
-
invertYAxis={true}
|
|
92
|
-
xAxisName="Model count"
|
|
93
|
-
yAxisName="Manual count"
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
</Story>
|
|
97
|
-
|
|
98
84
|
<Story name="Multiple Classes" asChild>
|
|
99
85
|
<div class="h-[500px] w-full">
|
|
100
86
|
<Matrix
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
// Import the specific type to resolve mismatch
|
|
4
3
|
import type { ECElementEvent } from 'echarts';
|
|
5
|
-
|
|
6
4
|
import MultiLineChart from './MultiLineChart.svelte';
|
|
7
5
|
|
|
8
6
|
const { Story } = defineMeta({
|
|
@@ -16,40 +14,31 @@
|
|
|
16
14
|
const xAxisName = 'Time';
|
|
17
15
|
const yAxisName = 'Value';
|
|
18
16
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
50
|
|
32
|
-
]; // length 25
|
|
33
|
-
const rawDataGroup2 = [
|
|
34
|
-
5, 7, 9, 8, 10, 12, 14, 13, 15, 17, 19, 18, 20, 22, 24, 23, 25, 27, 29, 28
|
|
35
|
-
]; // length 20
|
|
36
|
-
const rawDataGroup3 = [
|
|
37
|
-
20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66,
|
|
38
|
-
68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88
|
|
39
|
-
]; // length 35
|
|
17
|
+
const staticSmoothedData1 = [
|
|
18
|
+
12.333333333333334, 13.5, 14.8, 15.6, 17.4, 19.8, 22.2, 23.6, 25.2, 26.8, 29, 31.6, 33.8, 34.8,
|
|
19
|
+
36.4, 37.6, 40.2, 42.4, 44.4, 45.6, 46.4, 46.75, 48.25, 49, 49.333333333333336
|
|
20
|
+
];
|
|
21
|
+
const staticSmoothedData2 = [
|
|
22
|
+
7, 8, 8.8, 10.2, 11.8, 13.2, 14.8, 16.2, 17.6, 18.4, 19.2, 20.6, 22.4, 23.6, 24.8, 25.8, 27,
|
|
23
|
+
27.75, 28.5, 28.5
|
|
24
|
+
];
|
|
25
|
+
const staticSmoothedData3 = [
|
|
26
|
+
22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68,
|
|
27
|
+
70, 72, 74, 76, 78, 80, 82, 84, 86, 87, 88
|
|
28
|
+
];
|
|
40
29
|
|
|
41
30
|
const data = [
|
|
42
31
|
{
|
|
43
32
|
key: 'Group 1',
|
|
44
|
-
series:
|
|
33
|
+
series: staticSmoothedData1
|
|
45
34
|
},
|
|
46
35
|
{
|
|
47
36
|
key: 'Group 2',
|
|
48
|
-
series:
|
|
37
|
+
series: staticSmoothedData2
|
|
49
38
|
},
|
|
50
39
|
{
|
|
51
40
|
key: 'Group 3',
|
|
52
|
-
series:
|
|
41
|
+
series: staticSmoothedData3
|
|
53
42
|
}
|
|
54
43
|
];
|
|
55
44
|
|
|
@@ -77,20 +66,6 @@
|
|
|
77
66
|
</div>
|
|
78
67
|
</Story>
|
|
79
68
|
|
|
80
|
-
<Story name="Loading" asChild>
|
|
81
|
-
<div class="h-[400px] w-full">
|
|
82
|
-
<MultiLineChart
|
|
83
|
-
{xAxisName}
|
|
84
|
-
{yAxisName}
|
|
85
|
-
{data}
|
|
86
|
-
loading
|
|
87
|
-
onitemclick={handleItemClick}
|
|
88
|
-
onmouseover={handleMouseOver}
|
|
89
|
-
onmouseout={handleMouseOut}
|
|
90
|
-
/>
|
|
91
|
-
</div>
|
|
92
|
-
</Story>
|
|
93
|
-
|
|
94
69
|
<Story name="With Area Gradient" asChild>
|
|
95
70
|
<div class="h-[400px] w-full">
|
|
96
71
|
<MultiLineChart
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
withBackground?: boolean;
|
|
10
10
|
size?: 'sm' | 'md' | 'lg';
|
|
11
11
|
class?: string;
|
|
12
|
+
disabled?: boolean;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
let { model, withBackground, size = 'md', class: className }: Props = $props();
|
|
15
|
+
let { model, withBackground, size = 'md', class: className, disabled = false }: Props = $props();
|
|
15
16
|
|
|
16
17
|
const getIconSize = () => {
|
|
17
18
|
switch (size) {
|
|
@@ -25,6 +26,10 @@
|
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
const backgroundColor = (analysis: SupportedAnalysisModelIcons) => {
|
|
29
|
+
if (disabled) {
|
|
30
|
+
return 'bg-neutral';
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
switch (analysis) {
|
|
29
34
|
case 'pipeline_halos':
|
|
30
35
|
return 'bg-warning';
|
|
@@ -46,6 +51,10 @@
|
|
|
46
51
|
};
|
|
47
52
|
|
|
48
53
|
const mapAnalysisToColor = (analysis: SupportedAnalysisModelIcons): IconColor => {
|
|
54
|
+
if (disabled) {
|
|
55
|
+
return 'secondary';
|
|
56
|
+
}
|
|
57
|
+
|
|
49
58
|
switch (analysis) {
|
|
50
59
|
case 'pipeline_halos':
|
|
51
60
|
return 'warning';
|
|
@@ -2,7 +2,7 @@ import type { IconComponentProps } from 'phosphor-svelte';
|
|
|
2
2
|
import type { Component } from 'svelte';
|
|
3
3
|
import type { textColor } from './../../tokens';
|
|
4
4
|
export type PhosphorIconProps = Component<IconComponentProps, object, ''>;
|
|
5
|
-
export type IconName = 'Aperture' | 'ArrowFatLineRight' | 'ArrowCounterClockwise' | 'ArrowRight' | 'ArrowUpRight' | 'ArrowUpLeft' | 'ArrowUUpLeft' | 'Barcode' | 'Bell' | 'BookOpen' | 'BookOpenText' | 'BowlingBall' | 'BugBeetle' | 'Calendar' | 'CalendarBlank' | 'Camera' | 'CameraSlash' | 'CaretDown' | 'CaretLeft' | 'CaretRight' | 'CaretUp' | 'CaretUpDown' | 'ChatTeardropDots' | 'Check' | 'CheckCircle' | 'CheckFat' | 'Circle' | 'CircleDashed' | 'CircleHalf' | 'CirclesFour' | 'CirclesThreePlus' | 'Clock' | 'ClockCountdown' | 'Copy' | 'Crop' | 'Cube' | 'Database' | 'DotsThree' | 'DotsThreeOutlineVertical' | 'DownloadSimple' | 'Drop' | 'EnvelopeSimple' | 'Eye' | 'Eyedropper' | 'FileCsv' | 'Flag' | 'Flask' | 'Folder' | 'FolderDashed' | 'FolderSimplePlus' | 'FunnelSimple' | 'Gear' | 'GlobeSimple' | 'GlobeSimpleX' | 'GridFour' | 'Hash' | 'House' | 'ImageSquare' | 'ImagesSquare' | 'Info' | 'Lock' | 'LineSegments' | 'List' | 'MagnifyingGlass' | 'MegaphoneSimple' | 'Moon' | 'Minus' | 'Palette' | 'Pause' | 'Pencil' | 'PencilSimple' | 'Percent' | 'Phone' | 'Plant' | 'Play' | 'Plus' | 'PlusMinus' | 'Question' | 'SealCheck' | 'RadioButton' | 'SealQuestion' | 'SealWarning' | 'SelectionAll' | 'Share' | 'SidebarSimple' | 'SkipBack' | 'SkipForward' | 'SignIn' | 'SignOut' | 'SortAscending' | 'Sparkle' | 'SpinnerGap' | 'SquaresFour' | 'Star' | 'Stop' | 'StopCircle' | 'Sun' | 'Table' | 'Tag' | 'Target' | 'TestTube' | 'Trash' | 'TrashSimple' | 'UserCircle' | 'UserPlus' | 'Video' | 'Warning' | 'WarningCircle' | 'WifiSlash' | 'X';
|
|
5
|
+
export type IconName = 'Aperture' | 'ArrowFatLineRight' | 'ArrowCounterClockwise' | 'ArrowRight' | 'ArrowUpRight' | 'ArrowUpLeft' | 'ArrowUUpLeft' | 'Barcode' | 'Bell' | 'BookOpen' | 'BookOpenText' | 'BowlingBall' | 'BugBeetle' | 'Calendar' | 'CalendarBlank' | 'Camera' | 'CameraSlash' | 'CaretDown' | 'CaretLeft' | 'CaretRight' | 'CaretUp' | 'CaretUpDown' | 'ChatTeardropDots' | 'Check' | 'CheckCircle' | 'CheckFat' | 'Circle' | 'CircleDashed' | 'CircleHalf' | 'CirclesFour' | 'CirclesThreePlus' | 'Clock' | 'ClockCountdown' | 'Copy' | 'Crop' | 'Cube' | 'Database' | 'Dna' | 'DotsThree' | 'DotsThreeOutlineVertical' | 'DownloadSimple' | 'Drop' | 'EnvelopeSimple' | 'Eye' | 'Eyedropper' | 'FileCsv' | 'Flag' | 'Flask' | 'Folder' | 'FolderDashed' | 'FolderSimplePlus' | 'FunnelSimple' | 'Gear' | 'GlobeSimple' | 'GlobeSimpleX' | 'GridFour' | 'Hash' | 'House' | 'ImageSquare' | 'ImagesSquare' | 'Info' | 'Lock' | 'LineSegments' | 'List' | 'Link' | 'ListMagnifyingGlass' | 'MagnifyingGlass' | 'MegaphoneSimple' | 'MicrosoftExcelLogo' | 'Moon' | 'Minus' | 'Palette' | 'Pause' | 'Pencil' | 'PencilSimple' | 'Percent' | 'Phone' | 'Plant' | 'Play' | 'Plus' | 'PlusMinus' | 'Question' | 'SealCheck' | 'RadioButton' | 'SealQuestion' | 'SealWarning' | 'SelectionAll' | 'Share' | 'SidebarSimple' | 'SkipBack' | 'SkipForward' | 'SignIn' | 'SignOut' | 'SortAscending' | 'Sparkle' | 'SpinnerGap' | 'SquaresFour' | 'Star' | 'Stop' | 'StopCircle' | 'Sun' | 'Table' | 'Tag' | 'Target' | 'TestTube' | 'Trash' | 'TrashSimple' | 'TreeStructure' | 'UserCircle' | 'UserPlus' | 'Video' | 'Warning' | 'WarningCircle' | 'WifiSlash' | 'X';
|
|
6
6
|
export declare const iconMap: Record<IconName, PhosphorIconProps>;
|
|
7
7
|
export declare function renderIcon(iconName: keyof typeof iconMap): PhosphorIconProps;
|
|
8
8
|
export type IconColor = keyof typeof textColor;
|
|
@@ -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';
|
|
@@ -101,6 +105,7 @@ import Target from 'phosphor-svelte/lib/Target';
|
|
|
101
105
|
import TestTube from 'phosphor-svelte/lib/TestTube';
|
|
102
106
|
import Trash from 'phosphor-svelte/lib/Trash';
|
|
103
107
|
import TrashSimple from 'phosphor-svelte/lib/TrashSimple';
|
|
108
|
+
import TreeStructure from 'phosphor-svelte/lib/TreeStructure';
|
|
104
109
|
import UserCircle from 'phosphor-svelte/lib/UserCircle';
|
|
105
110
|
import UserPlus from 'phosphor-svelte/lib/UserPlus';
|
|
106
111
|
import Video from 'phosphor-svelte/lib/Video';
|
|
@@ -146,6 +151,7 @@ export const iconMap = {
|
|
|
146
151
|
Crop,
|
|
147
152
|
Cube,
|
|
148
153
|
Database,
|
|
154
|
+
Dna,
|
|
149
155
|
DotsThree,
|
|
150
156
|
DotsThreeOutlineVertical,
|
|
151
157
|
DownloadSimple,
|
|
@@ -172,8 +178,11 @@ export const iconMap = {
|
|
|
172
178
|
Lock,
|
|
173
179
|
LineSegments,
|
|
174
180
|
List,
|
|
181
|
+
Link,
|
|
182
|
+
ListMagnifyingGlass,
|
|
175
183
|
MagnifyingGlass,
|
|
176
184
|
MegaphoneSimple,
|
|
185
|
+
MicrosoftExcelLogo,
|
|
177
186
|
Moon,
|
|
178
187
|
Minus,
|
|
179
188
|
Palette,
|
|
@@ -212,6 +221,7 @@ export const iconMap = {
|
|
|
212
221
|
TestTube,
|
|
213
222
|
Trash,
|
|
214
223
|
TrashSimple,
|
|
224
|
+
TreeStructure,
|
|
215
225
|
UserCircle,
|
|
216
226
|
UserPlus,
|
|
217
227
|
Video,
|
|
@@ -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>
|
|
@@ -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;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { getContext } from 'svelte';
|
|
4
|
+
import { Icon } from '../../icons/';
|
|
5
|
+
import type { StepState } from '../';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
children: Snippet;
|
|
9
|
+
state?: StepState;
|
|
10
|
+
stepNumber: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let { children, state: stateProp, stepNumber, class: className = '' }: Props = $props();
|
|
15
|
+
const id = $props.id();
|
|
16
|
+
|
|
17
|
+
type StepperContext = {
|
|
18
|
+
currentStep: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const context = getContext<StepperContext | undefined>('STEPPER_CONTEXT');
|
|
22
|
+
|
|
23
|
+
const currentState = $derived.by(() => {
|
|
24
|
+
if (context && context.currentStep !== undefined) {
|
|
25
|
+
if (context.currentStep > stepNumber) {
|
|
26
|
+
return 'completed';
|
|
27
|
+
} else if (context.currentStep === stepNumber) {
|
|
28
|
+
return 'active';
|
|
29
|
+
} else {
|
|
30
|
+
return 'future';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return stateProp ?? 'future';
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const stateVariants = {
|
|
37
|
+
completed: {
|
|
38
|
+
container: 'bg-transparent text-primary-inverse',
|
|
39
|
+
iconContainer: 'bg-primary ',
|
|
40
|
+
iconColor: 'text-surface',
|
|
41
|
+
labelColor: 'text-primary',
|
|
42
|
+
showIcon: true
|
|
43
|
+
},
|
|
44
|
+
active: {
|
|
45
|
+
container: 'bg-accent text-primary-inverse',
|
|
46
|
+
iconContainer: 'bg-primary ',
|
|
47
|
+
iconColor: 'text-surface',
|
|
48
|
+
labelColor: 'text-primary',
|
|
49
|
+
showIcon: false
|
|
50
|
+
},
|
|
51
|
+
future: {
|
|
52
|
+
container: 'bg-transparent',
|
|
53
|
+
iconContainer: 'bg-transparent border border-interactive',
|
|
54
|
+
iconColor: 'text-secondary',
|
|
55
|
+
labelColor: 'text-secondary',
|
|
56
|
+
showIcon: false
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const variant = $derived(stateVariants[currentState]);
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<div
|
|
64
|
+
{id}
|
|
65
|
+
class="relative flex items-center gap-3 rounded-lg px-2 py-3 {variant.container} {className}"
|
|
66
|
+
role="progressbar"
|
|
67
|
+
aria-valuenow={currentState === 'completed' ? 100 : currentState === 'active' ? 50 : 0}
|
|
68
|
+
aria-valuemin="0"
|
|
69
|
+
aria-valuemax="100"
|
|
70
|
+
aria-label="Step {stepNumber}"
|
|
71
|
+
>
|
|
72
|
+
<div
|
|
73
|
+
class="flex h-6 w-6 items-center justify-center rounded-md {variant.iconContainer}"
|
|
74
|
+
aria-hidden="true"
|
|
75
|
+
>
|
|
76
|
+
{#if variant.showIcon}
|
|
77
|
+
<Icon iconName="Check" class="h-3 w-3 {variant.iconColor}" />
|
|
78
|
+
{:else}
|
|
79
|
+
<span class="text-xs font-medium leading-none {variant.iconColor}">
|
|
80
|
+
{stepNumber}
|
|
81
|
+
</span>
|
|
82
|
+
{/if}
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<span class="text-sm font-medium leading-tight {variant.labelColor} flex-1 truncate">
|
|
86
|
+
{@render children()}
|
|
87
|
+
</span>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<style>
|
|
91
|
+
div[role='progressbar']:not(:last-child)::after {
|
|
92
|
+
content: '';
|
|
93
|
+
position: absolute;
|
|
94
|
+
width: 1px;
|
|
95
|
+
background-color: #12192a0d;
|
|
96
|
+
left: calc(0.5rem + 1.5rem / 2 - 1px / 2);
|
|
97
|
+
top: 2.25rem;
|
|
98
|
+
height: 2.25rem;
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { StepState } from '../';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
state?: StepState;
|
|
6
|
+
stepNumber: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const StepperStep: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type StepperStep = ReturnType<typeof StepperStep>;
|
|
11
|
+
export default StepperStep;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export { default as Root } from './components/stepper-root.svelte';
|
|
3
|
+
export { default as Step } from './components/stepper-step.svelte';
|
|
4
|
+
export type StepState = 'completed' | 'active' | 'future';
|
|
5
|
+
export interface StepperRootProps {
|
|
6
|
+
children: Snippet;
|
|
7
|
+
class?: string;
|
|
8
|
+
currentStep?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface StepperStepProps {
|
|
11
|
+
children: Snippet;
|
|
12
|
+
state?: StepState;
|
|
13
|
+
stepNumber: string;
|
|
14
|
+
class?: string;
|
|
15
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -27,11 +27,13 @@ export * from './components/progress-circle/';
|
|
|
27
27
|
export * from './components/required-status-indicator/';
|
|
28
28
|
export * from './components/segmented-control-buttons/';
|
|
29
29
|
export * from './components/select/';
|
|
30
|
+
export * as SelectNew from './components/select-new/';
|
|
30
31
|
export * from './components/skeleton-loader/';
|
|
31
32
|
export * from './components/slider/';
|
|
32
33
|
export * from './components/spinner/';
|
|
33
34
|
export * from './components/stat-card/';
|
|
34
35
|
export * from './components/status-badge/';
|
|
36
|
+
export * from './components/stepper/';
|
|
35
37
|
export * from './components/table/';
|
|
36
38
|
export * from './components/tabs/';
|
|
37
39
|
export * from './components/tag/';
|
package/dist/index.js
CHANGED
|
@@ -28,11 +28,13 @@ export * from './components/progress-circle/';
|
|
|
28
28
|
export * from './components/required-status-indicator/';
|
|
29
29
|
export * from './components/segmented-control-buttons/';
|
|
30
30
|
export * from './components/select/';
|
|
31
|
+
export * as SelectNew from './components/select-new/';
|
|
31
32
|
export * from './components/skeleton-loader/';
|
|
32
33
|
export * from './components/slider/';
|
|
33
34
|
export * from './components/spinner/';
|
|
34
35
|
export * from './components/stat-card/';
|
|
35
36
|
export * from './components/status-badge/';
|
|
37
|
+
export * from './components/stepper/';
|
|
36
38
|
export * from './components/table/';
|
|
37
39
|
export * from './components/tabs/';
|
|
38
40
|
export * from './components/tag/';
|
|
@@ -45,18 +45,21 @@ declare const config: {
|
|
|
45
45
|
10: string;
|
|
46
46
|
25: string;
|
|
47
47
|
50: string;
|
|
48
|
+
75: string;
|
|
48
49
|
};
|
|
49
50
|
4: {
|
|
50
51
|
default: string;
|
|
51
52
|
10: string;
|
|
52
53
|
25: string;
|
|
53
54
|
50: string;
|
|
55
|
+
75: string;
|
|
54
56
|
};
|
|
55
57
|
5: {
|
|
56
58
|
default: string;
|
|
57
59
|
10: string;
|
|
58
60
|
25: string;
|
|
59
61
|
50: string;
|
|
62
|
+
75: string;
|
|
60
63
|
};
|
|
61
64
|
6: string;
|
|
62
65
|
};
|
package/dist/tokens.d.ts
CHANGED
|
@@ -40,18 +40,21 @@ export declare const colors: {
|
|
|
40
40
|
10: string;
|
|
41
41
|
25: string;
|
|
42
42
|
50: string;
|
|
43
|
+
75: string;
|
|
43
44
|
};
|
|
44
45
|
4: {
|
|
45
46
|
default: string;
|
|
46
47
|
10: string;
|
|
47
48
|
25: string;
|
|
48
49
|
50: string;
|
|
50
|
+
75: string;
|
|
49
51
|
};
|
|
50
52
|
5: {
|
|
51
53
|
default: string;
|
|
52
54
|
10: string;
|
|
53
55
|
25: string;
|
|
54
56
|
50: string;
|
|
57
|
+
75: string;
|
|
55
58
|
};
|
|
56
59
|
6: string;
|
|
57
60
|
};
|
|
@@ -475,18 +478,21 @@ export declare const tokens: {
|
|
|
475
478
|
10: string;
|
|
476
479
|
25: string;
|
|
477
480
|
50: string;
|
|
481
|
+
75: string;
|
|
478
482
|
};
|
|
479
483
|
4: {
|
|
480
484
|
default: string;
|
|
481
485
|
10: string;
|
|
482
486
|
25: string;
|
|
483
487
|
50: string;
|
|
488
|
+
75: string;
|
|
484
489
|
};
|
|
485
490
|
5: {
|
|
486
491
|
default: string;
|
|
487
492
|
10: string;
|
|
488
493
|
25: string;
|
|
489
494
|
50: string;
|
|
495
|
+
75: string;
|
|
490
496
|
};
|
|
491
497
|
6: string;
|
|
492
498
|
};
|
package/dist/tokens.js
CHANGED
|
@@ -35,9 +35,9 @@ export const colors = {
|
|
|
35
35
|
periwinkle: {
|
|
36
36
|
1: '#eeeefd',
|
|
37
37
|
2: '#cbc9fa',
|
|
38
|
-
3: { default: '#8e8af4', 10: '#8e8af41A', 25: '#8e8af440', 50: '#8e8af480' },
|
|
39
|
-
4: { default: '#7973f1', 10: '#7973f11A', 25: '#7973f140', 50: '#7973f180' },
|
|
40
|
-
5: { default: '#5750ee', 10: '#5750ee1A', 25: '#5750ee40', 50: '#5750ee80' },
|
|
38
|
+
3: { default: '#8e8af4', 10: '#8e8af41A', 25: '#8e8af440', 50: '#8e8af480', 75: '#8e8af4BF' },
|
|
39
|
+
4: { default: '#7973f1', 10: '#7973f11A', 25: '#7973f140', 50: '#7973f180', 75: '#7973f1BF' },
|
|
40
|
+
5: { default: '#5750ee', 10: '#5750ee1A', 25: '#5750ee40', 50: '#5750ee80', 75: '#5750eeBF' },
|
|
41
41
|
6: '#4741c1'
|
|
42
42
|
},
|
|
43
43
|
orange: {
|