@reshape-biotech/design-system 2.6.4 → 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.
- package/dist/components/activity/Activity.stories.svelte +7 -2
- package/dist/components/activity/Activity.svelte +6 -48
- package/dist/components/activity/Activity.svelte.d.ts +2 -2
- package/dist/components/activity/ActivityIcon.svelte +75 -0
- package/dist/components/activity/ActivityIcon.svelte.d.ts +10 -0
- package/dist/components/banner/Banner.stories.svelte +46 -9
- package/dist/components/banner/Banner.svelte +3 -2
- package/dist/components/checkbox/Checkbox.svelte +5 -3
- package/dist/components/collapsible/components/collapsible-trigger.svelte +3 -2
- package/dist/components/combobox/Combobox.stories.svelte +18 -4
- package/dist/components/combobox/components/combobox-add.svelte +3 -2
- package/dist/components/combobox/components/combobox-content.svelte +5 -3
- package/dist/components/combobox/components/combobox-indicator.svelte +3 -2
- package/dist/components/datepicker/DatePicker.stories.svelte +12 -3
- package/dist/components/datepicker/DatePicker.svelte +5 -3
- package/dist/components/drawer/components/drawer-content.svelte +3 -2
- package/dist/components/empty-content/EmptyContent.stories.svelte +13 -15
- package/dist/components/graphs/bar-chart/BarChart.svelte +1 -1
- package/dist/components/graphs/bar-chart/BarChart.svelte.d.ts +1 -1
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte +1 -2
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte.d.ts +1 -1
- package/dist/components/graphs/chart/Chart.svelte +16 -7
- package/dist/components/graphs/chart/Chart.svelte.d.ts +1 -1
- package/dist/components/graphs/line/LineChart.stories.svelte +1 -1
- package/dist/components/graphs/line/LineChart.svelte +1 -2
- package/dist/components/graphs/line/types.d.ts +1 -1
- package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +1 -1
- package/dist/components/graphs/multiline/MultiLineChart.svelte +7 -4
- package/dist/components/graphs/multiline/MultiLineChart.svelte.d.ts +1 -1
- package/dist/components/graphs/multiline/types.d.ts +1 -1
- package/dist/components/graphs/scatterplot/Scatterplot.svelte +52 -21
- package/dist/components/graphs/scatterplot/Scatterplot.svelte.d.ts +8 -2
- package/dist/components/graphs/utils/tooltipFormatter.d.ts +1 -1
- package/dist/components/icon-button/IconButton.stories.svelte +17 -49
- package/dist/components/icon-button/IconButton.svelte +9 -0
- package/dist/components/icon-button/IconButton.svelte.d.ts +1 -1
- package/dist/components/icons/AnalysisIcon.svelte +10 -6
- package/dist/components/icons/Icon.stories.svelte +19 -37
- package/dist/components/icons/Icon.svelte +46 -13
- package/dist/components/icons/Icon.svelte.d.ts +21 -2
- package/dist/components/icons/PrincipalIcon.svelte +25 -5
- package/dist/components/icons/PrincipalIcon.svelte.d.ts +2 -1
- package/dist/components/icons/index.d.ts +3 -10
- package/dist/components/icons/index.js +2 -251
- package/dist/components/input/Input.svelte +3 -2
- package/dist/components/legend/Legend.stories.svelte +13 -3
- package/dist/components/list/List.stories.svelte +12 -3
- package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte +6 -3
- package/dist/components/modal/Modal.stories.svelte +6 -1
- package/dist/components/modal/components/modal-content.svelte +3 -2
- package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte +8 -4
- package/dist/components/notification-popup/NotificationPopup.stories.svelte +7 -2
- package/dist/components/notification-popup/NotificationPopup.svelte +3 -2
- package/dist/components/notifications/Notifications.stories.svelte +11 -11
- package/dist/components/pill/Pill.svelte +3 -2
- package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte +4 -3
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +59 -10
- package/dist/components/select/components/MultiSelectTrigger.svelte +4 -6
- package/dist/components/select/components/MultiSelectTrigger.svelte.d.ts +0 -2
- package/dist/components/select/components/SelectContent.svelte +5 -3
- package/dist/components/select/components/SelectItem.svelte +3 -2
- package/dist/components/select/components/SelectTrigger.svelte +3 -2
- package/dist/components/slider/Slider.svelte +3 -2
- package/dist/components/stat-card/StatCard.svelte +5 -3
- package/dist/components/status-badge/StatusBadge.stories.svelte +132 -26
- package/dist/components/stepper/components/stepper-step.svelte +3 -2
- package/dist/components/table/Table.stories.svelte +7 -2
- package/dist/components/tag/Tag.stories.svelte +7 -2
- package/dist/components/toast/Toast.svelte +26 -6
- package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte +112 -23
- package/dist/echarts-config.d.ts +5 -0
- package/dist/echarts-config.js +33 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/notifications.d.ts +6 -7
- package/dist/notifications.js +2 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
+
import Eye from 'phosphor-svelte/lib/Eye';
|
|
3
|
+
import { Icon } from 'design-system';
|
|
2
4
|
import Button from '../button/Button.svelte';
|
|
3
5
|
import Activity from './Activity.svelte';
|
|
4
6
|
import * as Collapsible from '../collapsible/index';
|
|
5
|
-
import { Icon } from '../icons';
|
|
6
7
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
7
8
|
|
|
8
9
|
const { Story } = defineMeta({
|
|
@@ -87,7 +88,11 @@
|
|
|
87
88
|
size="sm"
|
|
88
89
|
class="icon-secondary w-36 rounded-full"
|
|
89
90
|
>
|
|
90
|
-
<Icon
|
|
91
|
+
<Icon>
|
|
92
|
+
{#snippet children(props)}
|
|
93
|
+
<Eye {...props} />
|
|
94
|
+
{/snippet}
|
|
95
|
+
</Icon>
|
|
91
96
|
<p>Show more</p>
|
|
92
97
|
</Button>
|
|
93
98
|
</Collapsible.Content>
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { type BackgroundClass } from '../icons';
|
|
3
|
+
import ActivityIcon from './ActivityIcon.svelte';
|
|
4
|
+
import type { ActivityIconType } from './ActivityIcon.svelte';
|
|
3
5
|
import { DateTime } from 'luxon';
|
|
4
6
|
|
|
5
|
-
type ActivityIcon =
|
|
6
|
-
| 'add'
|
|
7
|
-
| 'capture'
|
|
8
|
-
| 'delete'
|
|
9
|
-
| 'edit'
|
|
10
|
-
| 'failed'
|
|
11
|
-
| 'pause'
|
|
12
|
-
| 'start'
|
|
13
|
-
| 'stop'
|
|
14
|
-
| 'warning'
|
|
15
|
-
| 'success'
|
|
16
|
-
| 'export-succeeded'
|
|
17
|
-
| 'export-failed';
|
|
18
|
-
|
|
19
7
|
type Activity = {
|
|
20
8
|
activity_type?: string;
|
|
21
|
-
icon:
|
|
9
|
+
icon: ActivityIconType;
|
|
22
10
|
label: string;
|
|
23
11
|
timestamp: string;
|
|
24
12
|
author?: string | null;
|
|
@@ -32,37 +20,7 @@
|
|
|
32
20
|
class?: string;
|
|
33
21
|
};
|
|
34
22
|
|
|
35
|
-
const
|
|
36
|
-
add: 'Plus',
|
|
37
|
-
capture: 'Aperture',
|
|
38
|
-
delete: 'Trash',
|
|
39
|
-
edit: 'PencilSimple',
|
|
40
|
-
failed: 'WarningCircle',
|
|
41
|
-
pause: 'Pause',
|
|
42
|
-
start: 'Play',
|
|
43
|
-
stop: 'Stop',
|
|
44
|
-
warning: 'Warning',
|
|
45
|
-
success: 'Check',
|
|
46
|
-
'export-succeeded': 'DownloadSimple',
|
|
47
|
-
'export-failed': 'DownloadSimple',
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const ACTIVITY_COLOR: Record<ActivityIcon, IconColor> = {
|
|
51
|
-
add: 'icon-secondary',
|
|
52
|
-
capture: 'icon-secondary',
|
|
53
|
-
delete: 'icon-danger',
|
|
54
|
-
edit: 'icon-secondary',
|
|
55
|
-
failed: 'icon-danger',
|
|
56
|
-
pause: 'icon-secondary',
|
|
57
|
-
start: 'icon-secondary',
|
|
58
|
-
stop: 'icon-secondary',
|
|
59
|
-
warning: 'icon-warning',
|
|
60
|
-
success: 'icon-secondary',
|
|
61
|
-
'export-succeeded': 'icon-secondary',
|
|
62
|
-
'export-failed': 'icon-danger',
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const ACTIVITY_BACKGROUND: Record<ActivityIcon, BackgroundClass> = {
|
|
23
|
+
const ACTIVITY_BACKGROUND: Record<ActivityIconType, BackgroundClass> = {
|
|
66
24
|
add: 'bg-neutral',
|
|
67
25
|
capture: 'bg-neutral',
|
|
68
26
|
delete: 'bg-neutral',
|
|
@@ -104,7 +62,7 @@
|
|
|
104
62
|
activity.icon
|
|
105
63
|
]}"
|
|
106
64
|
>
|
|
107
|
-
<
|
|
65
|
+
<ActivityIcon icon={activity.icon} />
|
|
108
66
|
</div>
|
|
109
67
|
<div class="w-0.5 grow bg-neutral group-last:invisible"></div>
|
|
110
68
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type
|
|
1
|
+
import type { ActivityIconType } from './ActivityIcon.svelte';
|
|
2
2
|
type Activity = {
|
|
3
3
|
activity_type?: string;
|
|
4
|
-
icon:
|
|
4
|
+
icon: ActivityIconType;
|
|
5
5
|
label: string;
|
|
6
6
|
timestamp: string;
|
|
7
7
|
author?: string | null;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon } from '../icons';
|
|
3
|
+
import type { Component } from 'svelte';
|
|
4
|
+
|
|
5
|
+
// Import all required Phosphor icons for activities
|
|
6
|
+
import Plus from 'phosphor-svelte/lib/Plus';
|
|
7
|
+
import Aperture from 'phosphor-svelte/lib/Aperture';
|
|
8
|
+
import Trash from 'phosphor-svelte/lib/Trash';
|
|
9
|
+
import PencilSimple from 'phosphor-svelte/lib/PencilSimple';
|
|
10
|
+
import WarningCircle from 'phosphor-svelte/lib/WarningCircle';
|
|
11
|
+
import Pause from 'phosphor-svelte/lib/Pause';
|
|
12
|
+
import Play from 'phosphor-svelte/lib/Play';
|
|
13
|
+
import Stop from 'phosphor-svelte/lib/Stop';
|
|
14
|
+
import Warning from 'phosphor-svelte/lib/Warning';
|
|
15
|
+
import Check from 'phosphor-svelte/lib/Check';
|
|
16
|
+
import DownloadSimple from 'phosphor-svelte/lib/DownloadSimple';
|
|
17
|
+
import type { IconColor } from '../icons';
|
|
18
|
+
|
|
19
|
+
export type ActivityIconType =
|
|
20
|
+
| 'add'
|
|
21
|
+
| 'capture'
|
|
22
|
+
| 'delete'
|
|
23
|
+
| 'edit'
|
|
24
|
+
| 'failed'
|
|
25
|
+
| 'pause'
|
|
26
|
+
| 'start'
|
|
27
|
+
| 'stop'
|
|
28
|
+
| 'warning'
|
|
29
|
+
| 'success'
|
|
30
|
+
| 'export-succeeded'
|
|
31
|
+
| 'export-failed';
|
|
32
|
+
|
|
33
|
+
interface Props {
|
|
34
|
+
icon: ActivityIconType;
|
|
35
|
+
size?: number | string;
|
|
36
|
+
class?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let { icon, size = 16, class: className = '' }: Props = $props();
|
|
40
|
+
|
|
41
|
+
const ACTIVITY_ICONS: Record<ActivityIconType, Component> = {
|
|
42
|
+
add: Plus,
|
|
43
|
+
capture: Aperture,
|
|
44
|
+
delete: Trash,
|
|
45
|
+
edit: PencilSimple,
|
|
46
|
+
failed: WarningCircle,
|
|
47
|
+
pause: Pause,
|
|
48
|
+
start: Play,
|
|
49
|
+
stop: Stop,
|
|
50
|
+
warning: Warning,
|
|
51
|
+
success: Check,
|
|
52
|
+
'export-succeeded': DownloadSimple,
|
|
53
|
+
'export-failed': DownloadSimple,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const ACTIVITY_COLOR: Record<ActivityIconType, IconColor> = {
|
|
57
|
+
add: 'icon-secondary',
|
|
58
|
+
capture: 'icon-secondary',
|
|
59
|
+
delete: 'icon-danger',
|
|
60
|
+
edit: 'icon-secondary',
|
|
61
|
+
failed: 'icon-danger',
|
|
62
|
+
pause: 'icon-secondary',
|
|
63
|
+
start: 'icon-secondary',
|
|
64
|
+
stop: 'icon-secondary',
|
|
65
|
+
warning: 'icon-warning',
|
|
66
|
+
success: 'icon-secondary',
|
|
67
|
+
'export-succeeded': 'icon-secondary',
|
|
68
|
+
'export-failed': 'icon-danger',
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const IconComponent = $derived(ACTIVITY_ICONS[icon]);
|
|
72
|
+
const color = $derived(ACTIVITY_COLOR[icon]);
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<Icon {color} {size} class={className} icon={IconComponent} />
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
export type ActivityIconType = 'add' | 'capture' | 'delete' | 'edit' | 'failed' | 'pause' | 'start' | 'stop' | 'warning' | 'success' | 'export-succeeded' | 'export-failed';
|
|
3
|
+
interface Props {
|
|
4
|
+
icon: ActivityIconType;
|
|
5
|
+
size?: number | string;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const ActivityIcon: Component<Props, {}, "">;
|
|
9
|
+
type ActivityIcon = ReturnType<typeof ActivityIcon>;
|
|
10
|
+
export default ActivityIcon;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Warning from 'phosphor-svelte/lib/Warning';
|
|
3
|
+
import Info from 'phosphor-svelte/lib/Info';
|
|
4
|
+
import CheckCircle from 'phosphor-svelte/lib/CheckCircle';
|
|
5
|
+
import Circle from 'phosphor-svelte/lib/Circle';
|
|
6
|
+
import WarningCircle from 'phosphor-svelte/lib/WarningCircle';
|
|
7
|
+
import { Icon } from 'design-system';
|
|
3
8
|
import Banner from './Banner.svelte';
|
|
4
9
|
import Button from '../button/Button.svelte';
|
|
5
10
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
@@ -16,7 +21,11 @@
|
|
|
16
21
|
<Story name="Well finding warning" asChild>
|
|
17
22
|
<Banner type="warning" closable={false}>
|
|
18
23
|
{#snippet icon()}
|
|
19
|
-
<Icon size={20}
|
|
24
|
+
<Icon size={20} color="warning" weight="bold">
|
|
25
|
+
{#snippet children(props)}
|
|
26
|
+
<Warning {...props} />
|
|
27
|
+
{/snippet}
|
|
28
|
+
</Icon>
|
|
20
29
|
{/snippet}
|
|
21
30
|
{#snippet content()}
|
|
22
31
|
Our system couldn't find the wells in some plates. Analysis can't be done. For more help, <a
|
|
@@ -39,7 +48,11 @@
|
|
|
39
48
|
<Story name="No toggle" asChild>
|
|
40
49
|
<Banner type="progress" closable={false}>
|
|
41
50
|
{#snippet icon()}
|
|
42
|
-
<Icon size={20}
|
|
51
|
+
<Icon size={20} color="icon-blue" weight="bold">
|
|
52
|
+
{#snippet children(props)}
|
|
53
|
+
<Info {...props} />
|
|
54
|
+
{/snippet}
|
|
55
|
+
</Icon>
|
|
43
56
|
{/snippet}
|
|
44
57
|
{#snippet content()}
|
|
45
58
|
This banner has no toggle.
|
|
@@ -55,7 +68,11 @@
|
|
|
55
68
|
|
|
56
69
|
<Banner type="error" bind:show={showBanner}>
|
|
57
70
|
{#snippet icon()}
|
|
58
|
-
<Icon size={20}
|
|
71
|
+
<Icon size={20} color="danger" weight="bold">
|
|
72
|
+
{#snippet children(props)}
|
|
73
|
+
<Info {...props} />
|
|
74
|
+
{/snippet}
|
|
75
|
+
</Icon>
|
|
59
76
|
{/snippet}
|
|
60
77
|
{#snippet content()}
|
|
61
78
|
This banner can be toggled off with the "x" to the right and back on with the button above.
|
|
@@ -70,7 +87,11 @@
|
|
|
70
87
|
<h4>Neutral</h4>
|
|
71
88
|
<Banner type="neutral">
|
|
72
89
|
{#snippet icon()}
|
|
73
|
-
<Icon size={20}
|
|
90
|
+
<Icon size={20} weight="bold">
|
|
91
|
+
{#snippet children(props)}
|
|
92
|
+
<Info {...props} />
|
|
93
|
+
{/snippet}
|
|
94
|
+
</Icon>
|
|
74
95
|
{/snippet}
|
|
75
96
|
{#snippet content()}
|
|
76
97
|
This is a "neutral" banner.
|
|
@@ -82,7 +103,11 @@
|
|
|
82
103
|
<h4>Success</h4>
|
|
83
104
|
<Banner type="success">
|
|
84
105
|
{#snippet icon()}
|
|
85
|
-
<Icon size={20}
|
|
106
|
+
<Icon size={20} color="icon-success" weight="bold">
|
|
107
|
+
{#snippet children(props)}
|
|
108
|
+
<CheckCircle {...props} />
|
|
109
|
+
{/snippet}
|
|
110
|
+
</Icon>
|
|
86
111
|
{/snippet}
|
|
87
112
|
{#snippet content()}
|
|
88
113
|
This is a "success" banner.
|
|
@@ -94,7 +119,11 @@
|
|
|
94
119
|
<h4>Progress</h4>
|
|
95
120
|
<Banner type="progress">
|
|
96
121
|
{#snippet icon()}
|
|
97
|
-
<Icon size={20}
|
|
122
|
+
<Icon size={20} color="icon-blue" weight="bold">
|
|
123
|
+
{#snippet children(props)}
|
|
124
|
+
<Circle {...props} />
|
|
125
|
+
{/snippet}
|
|
126
|
+
</Icon>
|
|
98
127
|
{/snippet}
|
|
99
128
|
{#snippet content()}
|
|
100
129
|
This is a "progress" banner.
|
|
@@ -106,7 +135,11 @@
|
|
|
106
135
|
<h4>Warning</h4>
|
|
107
136
|
<Banner type="warning">
|
|
108
137
|
{#snippet icon()}
|
|
109
|
-
<Icon size={20}
|
|
138
|
+
<Icon size={20} color="icon-warning" weight="bold">
|
|
139
|
+
{#snippet children(props)}
|
|
140
|
+
<Warning {...props} />
|
|
141
|
+
{/snippet}
|
|
142
|
+
</Icon>
|
|
110
143
|
{/snippet}
|
|
111
144
|
{#snippet content()}
|
|
112
145
|
This is a "warning" banner.
|
|
@@ -118,7 +151,11 @@
|
|
|
118
151
|
<h4>Error</h4>
|
|
119
152
|
<Banner type="error">
|
|
120
153
|
{#snippet icon()}
|
|
121
|
-
<Icon size={20}
|
|
154
|
+
<Icon size={20} color="icon-danger" weight="bold">
|
|
155
|
+
{#snippet children(props)}
|
|
156
|
+
<WarningCircle {...props} />
|
|
157
|
+
{/snippet}
|
|
158
|
+
</Icon>
|
|
122
159
|
{/snippet}
|
|
123
160
|
{#snippet content()}
|
|
124
161
|
This is an "error" banner.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import X from 'phosphor-svelte/lib/X';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
import { IconButton } from '../icon-button/';
|
|
4
|
-
import Icon from '../icons/
|
|
5
|
+
import { Icon } from '../icons/';
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
type?: 'neutral' | 'success' | 'progress' | 'warning' | 'error';
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
</div>
|
|
43
44
|
{#if closable}
|
|
44
45
|
<IconButton size="sm" onclick={() => (show = false)}>
|
|
45
|
-
<Icon
|
|
46
|
+
<Icon color="icon-secondary" weight="bold" icon={X} />
|
|
46
47
|
</IconButton>
|
|
47
48
|
{/if}
|
|
48
49
|
</div>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import Check from 'phosphor-svelte/lib/Check';
|
|
3
|
+
import Minus from 'phosphor-svelte/lib/Minus';
|
|
4
|
+
import { Icon } from 'design-system';
|
|
2
5
|
import { Checkbox, type CheckboxRootProps } from 'bits-ui';
|
|
3
|
-
import { Icon } from '../icons';
|
|
4
6
|
|
|
5
7
|
export type CheckboxProps = CheckboxRootProps;
|
|
6
8
|
|
|
@@ -13,9 +15,9 @@
|
|
|
13
15
|
class={`flex items-center justify-center rounded border border-static ${checked ? 'bg-dark-accent-inverse-hover' : ''}`}
|
|
14
16
|
>
|
|
15
17
|
{#if checked}
|
|
16
|
-
<Icon
|
|
18
|
+
<Icon class="text-primary-inverse" icon={Check} />
|
|
17
19
|
{:else if indeterminate}
|
|
18
|
-
<Icon
|
|
20
|
+
<Icon icon={Minus} />
|
|
19
21
|
{:else}
|
|
20
22
|
<div class="h-4 w-4"></div>
|
|
21
23
|
{/if}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import CaretDown from 'phosphor-svelte/lib/CaretDown';
|
|
3
|
+
import { Icon } from 'design-system';
|
|
2
4
|
import { Collapsible } from 'bits-ui';
|
|
3
|
-
import { Icon } from '../../icons';
|
|
4
5
|
import type { CollapsibleTriggerProps } from '../types';
|
|
5
6
|
|
|
6
7
|
let { children, withIcon = true, ...props }: CollapsibleTriggerProps = $props();
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
<div class="container h-6">
|
|
11
12
|
{@render children()}
|
|
12
13
|
{#if withIcon}
|
|
13
|
-
<Icon
|
|
14
|
+
<Icon color="secondary" class="icon m-1" icon={CaretDown} />
|
|
14
15
|
{/if}
|
|
15
16
|
</div>
|
|
16
17
|
</Collapsible.Trigger>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
+
import Plus from 'phosphor-svelte/lib/Plus';
|
|
3
|
+
import List from 'phosphor-svelte/lib/List';
|
|
4
|
+
import { Icon } from 'design-system';
|
|
2
5
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
6
|
import { userEvent, within } from '@storybook/test';
|
|
4
7
|
import { Root as ComboboxRootForMeta } from './index';
|
|
5
8
|
import * as Combobox from './index';
|
|
6
|
-
import { Icon } from '../icons';
|
|
7
9
|
import IconButton from '../icon-button/IconButton.svelte';
|
|
8
10
|
import Divider from '../divider/Divider.svelte';
|
|
9
11
|
import Tag from '../tag/Tag.svelte';
|
|
@@ -131,7 +133,11 @@
|
|
|
131
133
|
<Combobox.Trigger>
|
|
132
134
|
<div bind:this={customAnchor}>
|
|
133
135
|
<IconButton rounded={false}>
|
|
134
|
-
<Icon
|
|
136
|
+
<Icon>
|
|
137
|
+
{#snippet children(props)}
|
|
138
|
+
<Plus {...props} />
|
|
139
|
+
{/snippet}
|
|
140
|
+
</Icon>
|
|
135
141
|
</IconButton>
|
|
136
142
|
</div>
|
|
137
143
|
</Combobox.Trigger>
|
|
@@ -241,7 +247,11 @@
|
|
|
241
247
|
<Combobox.Trigger>
|
|
242
248
|
<div bind:this={customAnchorGrouped}>
|
|
243
249
|
<Button variant="primary" size="sm">
|
|
244
|
-
<Icon
|
|
250
|
+
<Icon>
|
|
251
|
+
{#snippet children(props)}
|
|
252
|
+
<List {...props} />
|
|
253
|
+
{/snippet}
|
|
254
|
+
</Icon>
|
|
245
255
|
Select fruits by category
|
|
246
256
|
</Button>
|
|
247
257
|
</div>
|
|
@@ -379,7 +389,11 @@
|
|
|
379
389
|
<Combobox.Trigger data-testid="combobox-trigger">
|
|
380
390
|
<div bind:this={customAnchor}>
|
|
381
391
|
<IconButton rounded={false}>
|
|
382
|
-
<Icon
|
|
392
|
+
<Icon>
|
|
393
|
+
{#snippet children(props)}
|
|
394
|
+
<Plus {...props} />
|
|
395
|
+
{/snippet}
|
|
396
|
+
</Icon>
|
|
383
397
|
</IconButton>
|
|
384
398
|
</div>
|
|
385
399
|
</Combobox.Trigger>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Plus from 'phosphor-svelte/lib/Plus';
|
|
3
|
+
import { Icon } from 'design-system';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
5
6
|
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<button {...props}>
|
|
12
|
-
<Icon
|
|
13
|
+
<Icon class="text-icon-secondary" icon={Plus} />
|
|
13
14
|
{@render children()}
|
|
14
15
|
</button>
|
|
15
16
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import CaretUp from 'phosphor-svelte/lib/CaretUp';
|
|
3
|
+
import CaretDown from 'phosphor-svelte/lib/CaretDown';
|
|
4
|
+
import { Icon } from 'design-system';
|
|
2
5
|
import { Combobox } from 'bits-ui';
|
|
3
6
|
import type { ComboboxContentProps } from '../types';
|
|
4
|
-
import { Icon } from '../../icons';
|
|
5
7
|
import { fade } from 'svelte/transition';
|
|
6
8
|
|
|
7
9
|
let {
|
|
@@ -24,13 +26,13 @@
|
|
|
24
26
|
{@render header?.()}
|
|
25
27
|
{#if showScroll}
|
|
26
28
|
<Combobox.ScrollUpButton class="flex justify-center">
|
|
27
|
-
<Icon
|
|
29
|
+
<Icon icon={CaretUp} />
|
|
28
30
|
</Combobox.ScrollUpButton>
|
|
29
31
|
<Combobox.Viewport class={paddedContent ? 'p-1' : ''}>
|
|
30
32
|
{@render children()}
|
|
31
33
|
</Combobox.Viewport>
|
|
32
34
|
<Combobox.ScrollDownButton class="flex justify-center">
|
|
33
|
-
<Icon
|
|
35
|
+
<Icon icon={CaretDown} />
|
|
34
36
|
</Combobox.ScrollDownButton>
|
|
35
37
|
{:else}
|
|
36
38
|
{@render children()}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
+
import CalendarBlank from 'phosphor-svelte/lib/CalendarBlank';
|
|
3
|
+
import { Icon } from 'design-system';
|
|
2
4
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
5
|
import { userEvent, within } from '@storybook/test';
|
|
4
6
|
import { DateTime } from 'luxon';
|
|
5
7
|
import DatePicker from './DatePicker.svelte';
|
|
6
8
|
import Dropdown from '../dropdown/Dropdown.svelte';
|
|
7
|
-
import { Icon } from '../icons';
|
|
8
9
|
|
|
9
10
|
const { Story } = defineMeta({
|
|
10
11
|
component: DatePicker,
|
|
@@ -132,7 +133,11 @@
|
|
|
132
133
|
<Dropdown bind:open={isOpen} side="dropdown-bottom" alignEnd={false}>
|
|
133
134
|
{#snippet trigger({ Trigger })}
|
|
134
135
|
<Trigger>
|
|
135
|
-
<Icon
|
|
136
|
+
<Icon class="mr-2" size={16}>
|
|
137
|
+
{#snippet children(props)}
|
|
138
|
+
<CalendarBlank {...props} />
|
|
139
|
+
{/snippet}
|
|
140
|
+
</Icon>
|
|
136
141
|
{displayText}
|
|
137
142
|
</Trigger>
|
|
138
143
|
{/snippet}
|
|
@@ -204,7 +209,11 @@
|
|
|
204
209
|
{#snippet trigger({ Trigger })}
|
|
205
210
|
<Trigger>
|
|
206
211
|
<div data-testid="form-date-trigger" class="flex items-center gap-2">
|
|
207
|
-
<Icon
|
|
212
|
+
<Icon class="mr-2" size={16}>
|
|
213
|
+
{#snippet children(props)}
|
|
214
|
+
<CalendarBlank {...props} />
|
|
215
|
+
{/snippet}
|
|
216
|
+
</Icon>
|
|
208
217
|
{formDisplayText}
|
|
209
218
|
</div>
|
|
210
219
|
</Trigger>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import CaretLeft from 'phosphor-svelte/lib/CaretLeft';
|
|
3
|
+
import CaretRight from 'phosphor-svelte/lib/CaretRight';
|
|
4
|
+
import { Icon } from 'design-system';
|
|
2
5
|
import { run } from 'svelte/legacy';
|
|
3
6
|
|
|
4
7
|
import { DateTime, type MonthNumbers } from 'luxon';
|
|
5
8
|
|
|
6
9
|
import IconButton from '../icon-button/IconButton.svelte';
|
|
7
|
-
import { Icon } from '../icons';
|
|
8
10
|
|
|
9
11
|
interface Props {
|
|
10
12
|
selectedDate: DateTime | undefined;
|
|
@@ -96,11 +98,11 @@
|
|
|
96
98
|
<div class="calendar-header">
|
|
97
99
|
<div class="month-year">
|
|
98
100
|
<IconButton onclick={previousMonth} type="button">
|
|
99
|
-
<Icon
|
|
101
|
+
<Icon color="secondary" size="0.75rem" icon={CaretLeft} />
|
|
100
102
|
</IconButton>
|
|
101
103
|
<h5>{DateTime.local(shownYear, shownMonth).toFormat('MMM yyyy')}</h5>
|
|
102
104
|
<IconButton onclick={nextMonth} type="button">
|
|
103
|
-
<Icon
|
|
105
|
+
<Icon color="secondary" size="0.75rem" icon={CaretRight} />
|
|
104
106
|
</IconButton>
|
|
105
107
|
</div>
|
|
106
108
|
</div>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import X from 'phosphor-svelte/lib/X';
|
|
3
|
+
import { Icon } from 'design-system';
|
|
2
4
|
import { Dialog } from 'bits-ui';
|
|
3
5
|
import { fly } from 'svelte/transition';
|
|
4
|
-
import { Icon } from '../../icons';
|
|
5
6
|
import type { DrawerContentProps } from '../types';
|
|
6
7
|
import Overlay from './drawer-overlay.svelte';
|
|
7
8
|
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
<Dialog.Close
|
|
33
34
|
class="ring-offset-background focus:ring-ring absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none"
|
|
34
35
|
>
|
|
35
|
-
<Icon
|
|
36
|
+
<Icon icon={X} />
|
|
36
37
|
</Dialog.Close>
|
|
37
38
|
{/if}
|
|
38
39
|
{/snippet}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script module>
|
|
2
|
+
import ClockCountdown from 'phosphor-svelte/lib/ClockCountdown';
|
|
3
|
+
import MagnifyingGlass from 'phosphor-svelte/lib/MagnifyingGlass';
|
|
4
|
+
import { Icon } from 'design-system';
|
|
2
5
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
6
|
import EmptyContent from './EmptyContent.svelte';
|
|
4
|
-
import { Icon } from '../../components/icons';
|
|
5
7
|
|
|
6
8
|
const { Story } = defineMeta({
|
|
7
9
|
component: EmptyContent,
|
|
@@ -14,13 +16,11 @@
|
|
|
14
16
|
<div class="w-full bg-surface p-12">
|
|
15
17
|
<EmptyContent>
|
|
16
18
|
{#snippet icon()}
|
|
17
|
-
<Icon
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
weight="light"
|
|
23
|
-
/>
|
|
19
|
+
<Icon color="icon-tertiary" width={48} height={48} weight="light">
|
|
20
|
+
{#snippet children(props)}
|
|
21
|
+
<ClockCountdown {...props} />
|
|
22
|
+
{/snippet}
|
|
23
|
+
</Icon>
|
|
24
24
|
{/snippet}
|
|
25
25
|
<h6>No activity</h6>
|
|
26
26
|
<p class="text-center text-sm">Nothing has been logged for this job.</p>
|
|
@@ -32,13 +32,11 @@
|
|
|
32
32
|
<div class="w-full bg-surface p-12">
|
|
33
33
|
<EmptyContent>
|
|
34
34
|
{#snippet icon()}
|
|
35
|
-
<Icon
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
weight="light"
|
|
41
|
-
/>
|
|
35
|
+
<Icon color="icon-tertiary" width={48} height={48} weight="light">
|
|
36
|
+
{#snippet children(props)}
|
|
37
|
+
<MagnifyingGlass {...props} />
|
|
38
|
+
{/snippet}
|
|
39
|
+
</Icon>
|
|
42
40
|
{/snippet}
|
|
43
41
|
<h6>No results found</h6>
|
|
44
42
|
<p class="text-center text-sm">Try adjusting your search or filters.</p>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { textColor, borderColor, backgroundColor, boxShadow, chartColor } from '../../../tokens';
|
|
3
3
|
import Chart, { type GenericChartProps } from '../chart/Chart.svelte';
|
|
4
|
-
import type { EChartsOption, BarSeriesOption } from 'echarts';
|
|
4
|
+
import type { EChartsOption, BarSeriesOption } from '../../../echarts-config';
|
|
5
5
|
import { createTooltipFormatter } from '../utils/tooltipFormatter';
|
|
6
6
|
import { formattedDurationCompact } from '../utils/duration';
|
|
7
7
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { textColor, borderColor, backgroundColor, chartColor, boxShadow } from '../../../tokens';
|
|
3
3
|
import Chart, { type GenericChartProps } from '../chart/Chart.svelte';
|
|
4
|
-
import type { EChartsOption, BarSeriesOption } from 'echarts';
|
|
5
|
-
import type { CallbackDataParams } from 'echarts/types/dist/shared';
|
|
4
|
+
import type { EChartsOption, BarSeriesOption, CallbackDataParams } from '../../../echarts-config';
|
|
6
5
|
import { formattedDurationCompact } from '../utils/duration';
|
|
7
6
|
|
|
8
7
|
type StackedSeriesItem = {
|