@reshape-biotech/design-system 0.0.52 → 1.1.1
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 +21 -8
- package/dist/components/activity/Activity.svelte +49 -9
- package/dist/components/activity/Activity.svelte.d.ts +1 -1
- package/dist/components/avatar/Avatar.stories.svelte +7 -17
- package/dist/components/avatar/Avatar.svelte +2 -2
- package/dist/components/avatar/Avatar.svelte.d.ts +2 -2
- package/dist/components/banner/Banner.stories.svelte +5 -5
- package/dist/components/button/Button.stories.svelte +54 -21
- package/dist/components/button/Button.svelte +58 -11
- package/dist/components/button/Button.svelte.d.ts +4 -3
- package/dist/components/card/Card.stories.svelte +130 -0
- package/dist/components/card/Card.stories.svelte.d.ts +19 -0
- package/dist/components/card/Card.svelte +25 -0
- package/dist/components/card/Card.svelte.d.ts +10 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/checkbox/Checkbox.stories.svelte +22 -0
- package/dist/components/checkbox/Checkbox.stories.svelte.d.ts +19 -0
- package/dist/components/checkbox/Checkbox.svelte +24 -0
- package/dist/components/checkbox/Checkbox.svelte.d.ts +5 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/collapsible/Collapsible.stories.svelte +5 -4
- package/dist/components/collapsible/components/collapsible-trigger.svelte +1 -1
- package/dist/components/combobox/Combobox.stories.svelte +7 -5
- package/dist/components/combobox/components/combobox-add.svelte +2 -1
- package/dist/components/combobox/components/combobox-content.svelte +4 -0
- package/dist/components/combobox/types.d.ts +2 -0
- package/dist/components/datepicker/DatePicker.stories.svelte +8 -14
- package/dist/components/divider/Divider.stories.svelte +1 -3
- package/dist/components/divider/Divider.svelte +8 -2
- package/dist/components/divider/Divider.svelte.d.ts +2 -0
- package/dist/components/drawer/Drawer.stories.svelte +3 -3
- package/dist/components/dropdown/Dropdown.stories.svelte +8 -8
- package/dist/components/empty-content/EmptyContent.stories.svelte +2 -2
- package/dist/components/graphs/bar-chart/BarChart.stories.svelte +81 -0
- package/dist/components/graphs/bar-chart/BarChart.stories.svelte.d.ts +19 -0
- package/dist/components/graphs/bar-chart/BarChart.svelte +136 -0
- package/dist/components/graphs/bar-chart/BarChart.svelte.d.ts +15 -0
- package/dist/components/graphs/bar-chart/StackedBarChart.stories.svelte +42 -0
- package/dist/components/graphs/bar-chart/StackedBarChart.stories.svelte.d.ts +19 -0
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte +177 -0
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte.d.ts +16 -0
- package/dist/components/graphs/chart/Chart.stories.svelte +31 -23
- package/dist/components/graphs/chart/Chart.svelte +104 -32
- package/dist/components/graphs/chart/Chart.svelte.d.ts +15 -5
- package/dist/components/graphs/index.d.ts +3 -0
- package/dist/components/graphs/index.js +3 -0
- package/dist/components/graphs/line/LineChart.stories.svelte +107 -15
- package/dist/components/graphs/line/LineChart.svelte +90 -51
- package/dist/components/graphs/line/LineChart.svelte.d.ts +6 -13
- package/dist/components/graphs/matrix/Matrix.stories.svelte +156 -0
- package/dist/components/graphs/matrix/Matrix.stories.svelte.d.ts +19 -0
- package/dist/components/graphs/matrix/Matrix.svelte +149 -0
- package/dist/components/graphs/matrix/Matrix.svelte.d.ts +24 -0
- package/dist/components/graphs/matrix/index.d.ts +3 -0
- package/dist/components/graphs/matrix/index.js +3 -0
- package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +130 -18
- package/dist/components/graphs/multiline/MultiLineChart.svelte +187 -50
- package/dist/components/graphs/multiline/MultiLineChart.svelte.d.ts +9 -12
- package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte +68 -41
- package/dist/components/graphs/scatterplot/Scatterplot.svelte +312 -45
- package/dist/components/graphs/scatterplot/Scatterplot.svelte.d.ts +23 -13
- package/dist/components/graphs/utils/tooltipFormatter.d.ts +10 -0
- package/dist/components/graphs/utils/tooltipFormatter.js +52 -0
- package/dist/components/icon-button/IconButton.stories.svelte +6 -6
- package/dist/components/icon-button/IconButton.svelte +50 -9
- package/dist/components/icon-button/IconButton.svelte.d.ts +3 -5
- package/dist/components/icons/AnalysisIcon.stories.svelte +15 -21
- package/dist/components/icons/AnalysisIcon.svelte +53 -43
- package/dist/components/icons/Icon.stories.svelte +4 -4
- package/dist/components/icons/Icon.svelte +1 -1
- package/dist/components/icons/PrincipalIcon.svelte +96 -0
- package/dist/components/icons/PrincipalIcon.svelte.d.ts +10 -0
- package/dist/components/icons/custom/Halo.svelte +14 -8
- package/dist/components/icons/custom/Halo.svelte.d.ts +7 -25
- package/dist/components/icons/custom/Well.svelte +14 -6
- package/dist/components/icons/custom/Well.svelte.d.ts +7 -25
- package/dist/components/icons/index.d.ts +3 -2
- package/dist/components/icons/index.js +26 -0
- package/dist/components/input/Input.stories.svelte +16 -22
- package/dist/components/input/Input.svelte +140 -134
- package/dist/components/input/Input.svelte.d.ts +12 -13
- package/dist/components/label/Label.stories.svelte +28 -0
- package/dist/components/label/Label.stories.svelte.d.ts +19 -0
- package/dist/components/label/Label.svelte +17 -0
- package/dist/components/label/Label.svelte.d.ts +9 -0
- package/dist/components/list/List.stories.svelte +3 -3
- package/dist/components/logo/Logo.stories.svelte +1 -1
- package/dist/components/manual-cfu-counter/ManualCFUCounter.stories.svelte +125 -0
- package/dist/components/manual-cfu-counter/ManualCFUCounter.stories.svelte.d.ts +3 -0
- package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte +577 -0
- package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte.d.ts +16 -0
- package/dist/components/manual-cfu-counter/index.d.ts +1 -0
- package/dist/components/manual-cfu-counter/index.js +1 -0
- package/dist/components/manual-cfu-counter/test/ManualCFUCounterTestWrapper.svelte +22 -0
- package/dist/components/manual-cfu-counter/test/ManualCFUCounterTestWrapper.svelte.d.ts +19 -0
- package/dist/components/markdown/Markdown.stories.svelte +1 -1
- package/dist/components/markdown/Markdown.svelte +1 -1
- package/dist/components/modal/Modal.stories.svelte +2 -2
- package/dist/components/modal/Modal.svelte +27 -22
- package/dist/components/modal/Modal.svelte.d.ts +4 -1
- package/dist/components/notification-popup/NotificationPopup.stories.svelte +1 -1
- package/dist/components/pill/Pill.stories.svelte +13 -0
- package/dist/components/pill/Pill.stories.svelte.d.ts +19 -0
- package/dist/components/progress-circle/ProgressCircle.stories.svelte +15 -0
- package/dist/components/progress-circle/ProgressCircle.stories.svelte.d.ts +19 -0
- package/dist/components/required-status-indicator/RequiredStatusIndicator.stories.svelte +28 -0
- package/dist/components/required-status-indicator/RequiredStatusIndicator.stories.svelte.d.ts +19 -0
- package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte +22 -0
- package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte.d.ts +8 -0
- package/dist/components/required-status-indicator/index.d.ts +1 -0
- package/dist/components/required-status-indicator/index.js +1 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +3 -3
- package/dist/components/select/Select.stories.svelte +12 -12
- package/dist/components/select/Select.svelte +0 -2
- package/dist/components/select-new/Select.stories.svelte +219 -0
- package/dist/components/select-new/Select.stories.svelte.d.ts +19 -0
- package/dist/components/select-new/components/Group.svelte +23 -0
- package/dist/components/select-new/components/Group.svelte.d.ts +10 -0
- package/dist/components/select-new/components/MultiSelectTrigger.svelte +66 -0
- package/dist/components/select-new/components/MultiSelectTrigger.svelte.d.ts +17 -0
- package/dist/components/select-new/components/SelectContent.svelte +33 -0
- package/dist/components/select-new/components/SelectContent.svelte.d.ts +10 -0
- package/dist/components/select-new/components/SelectGroupHeading.svelte +19 -0
- package/dist/components/select-new/components/SelectGroupHeading.svelte.d.ts +9 -0
- package/dist/components/select-new/components/SelectItem.svelte +41 -0
- package/dist/components/select-new/components/SelectItem.svelte.d.ts +9 -0
- package/dist/components/select-new/components/SelectTrigger.svelte +48 -0
- package/dist/components/select-new/components/SelectTrigger.svelte.d.ts +12 -0
- package/dist/components/select-new/index.d.ts +10 -0
- package/dist/components/select-new/index.js +12 -0
- package/dist/components/select-new/types.d.ts +25 -0
- package/dist/components/select-new/types.js +1 -0
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte +92 -0
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte.d.ts +3 -0
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte +65 -0
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte.d.ts +3 -0
- package/dist/components/sjsf-wrappers/index.d.ts +2 -0
- package/dist/components/sjsf-wrappers/index.js +2 -0
- package/dist/components/sjsf-wrappers/sjsfCustomTheme.d.ts +2 -0
- package/dist/components/sjsf-wrappers/sjsfCustomTheme.js +8 -0
- package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte +4 -4
- package/dist/components/slider/Slider.stories.svelte +4 -4
- package/dist/components/spinner/Spinner.stories.svelte +13 -0
- package/dist/components/spinner/Spinner.stories.svelte.d.ts +19 -0
- package/dist/components/stat-card/StatCard.stories.svelte +27 -19
- package/dist/components/stat-card/StatCard.svelte +100 -6
- package/dist/components/stat-card/StatCard.svelte.d.ts +3 -0
- package/dist/components/status-badge/StatusBadge.stories.svelte +6 -6
- package/dist/components/status-badge/StatusBadge.svelte +5 -3
- package/dist/components/table/Table.stories.svelte +1 -1
- package/dist/components/table/components/Td.svelte +3 -2
- package/dist/components/table/components/Td.svelte.d.ts +1 -0
- package/dist/components/table/components/Tr.svelte +3 -2
- package/dist/components/table/components/Tr.svelte.d.ts +1 -0
- package/dist/components/tabs/Tabs.stories.svelte +1 -1
- package/dist/components/tag/Tag.stories.svelte +38 -7
- package/dist/components/tag/Tag.svelte +34 -21
- package/dist/components/tag/Tag.svelte.d.ts +1 -1
- package/dist/components/textarea/Textarea.stories.svelte +97 -0
- package/dist/components/textarea/Textarea.stories.svelte.d.ts +19 -0
- package/dist/components/textarea/Textarea.svelte +94 -0
- package/dist/components/textarea/Textarea.svelte.d.ts +17 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/toggle/Toggle.stories.svelte +1 -1
- package/dist/components/toggle/Toggle.svelte +3 -2
- package/dist/components/toggle/Toggle.svelte.d.ts +1 -0
- package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte +173 -0
- package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte.d.ts +19 -0
- package/dist/components/toggle-icon-button/ToggleIconButton.svelte +117 -0
- package/dist/components/toggle-icon-button/ToggleIconButton.svelte.d.ts +15 -0
- package/dist/components/toggle-icon-button/index.d.ts +3 -0
- package/dist/components/toggle-icon-button/index.js +3 -0
- package/dist/components/tooltip/Tooltip.stories.svelte +6 -6
- package/dist/components/tooltip/Tooltip.svelte +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/tailwind-safelist.js +2 -0
- package/dist/tailwind.preset.d.ts +2 -0
- package/dist/tokens.d.ts +4 -0
- package/dist/tokens.js +3 -1
- package/package.json +1 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
imageUrl: string;
|
|
3
|
+
marks?: Array<{
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}>;
|
|
7
|
+
onclick?: (event: MouseEvent, marks: Array<{
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}>) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
hideMarkers?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const ManualCfuCounter: import("svelte").Component<Props, {}, "marks">;
|
|
15
|
+
type ManualCfuCounter = ReturnType<typeof ManualCfuCounter>;
|
|
16
|
+
export default ManualCfuCounter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ManualCFUCounter } from './ManualCFUCounter.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ManualCFUCounter } from './ManualCFUCounter.svelte';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- src/lib/design-system/src/lib/components/manual-cfu-counter/ManualCFUCounterTestWrapper.svelte -->
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import ManualCFUCounter from '../ManualCFUCounter.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
initialTestMarks?: Array<{ x: number; y: number }>;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
onclick?: (event: MouseEvent, marks: Array<{ x: number; y: number }>) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { initialTestMarks = [], imageUrl = 'test-image.jpg', onclick }: Props = $props();
|
|
12
|
+
|
|
13
|
+
let marks = $state([...initialTestMarks]);
|
|
14
|
+
|
|
15
|
+
export function getCurrentMarks() {
|
|
16
|
+
return marks;
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<ManualCFUCounter bind:marks {imageUrl} {onclick} />
|
|
21
|
+
|
|
22
|
+
<span data-testid="wrapper-marks-count" class="sr-only">{marks.length}</span>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
initialTestMarks?: Array<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
imageUrl?: string;
|
|
7
|
+
onclick?: (event: MouseEvent, marks: Array<{
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}>) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const ManualCfuCounterTestWrapper: import("svelte").Component<Props, {
|
|
13
|
+
getCurrentMarks: () => {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
}[];
|
|
17
|
+
}, "">;
|
|
18
|
+
type ManualCfuCounterTestWrapper = ReturnType<typeof ManualCfuCounterTestWrapper>;
|
|
19
|
+
export default ManualCfuCounterTestWrapper;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
let defaultOpen = $state(true);
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
|
-
<Story name="Default">
|
|
15
|
+
<Story name="Default" asChild>
|
|
16
16
|
<Modal>
|
|
17
17
|
{#snippet Trigger({ openModal })}
|
|
18
18
|
<Button onClick={openModal}>Open Modal</Button>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</Modal>
|
|
26
26
|
</Story>
|
|
27
27
|
|
|
28
|
-
<Story name="Default open">
|
|
28
|
+
<Story name="Default open" asChild>
|
|
29
29
|
<Modal {defaultOpen} onclose={() => (defaultOpen = false)}>
|
|
30
30
|
{#snippet Trigger({ openModal })}
|
|
31
31
|
<Button onClick={openModal}>Open Modal</Button>
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { type Snippet } from 'svelte';
|
|
3
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
4
4
|
import IconButton from '../icon-button/IconButton.svelte';
|
|
5
5
|
import { Icon } from '../icons';
|
|
6
|
+
import Divider from '../divider/Divider.svelte';
|
|
6
7
|
|
|
7
8
|
type ModalProps = {
|
|
8
9
|
Trigger?: Snippet<[{ openModal: () => void; closeModal: () => void }]>;
|
|
10
|
+
Header?: Snippet;
|
|
9
11
|
Content: Snippet;
|
|
12
|
+
Footer?: Snippet;
|
|
10
13
|
onclose?: () => void;
|
|
11
14
|
defaultOpen?: boolean;
|
|
12
15
|
id?: string;
|
|
13
16
|
withClose?: boolean;
|
|
14
17
|
closeOnClickOutside?: boolean;
|
|
15
18
|
class?: string;
|
|
19
|
+
contentClass?: string;
|
|
16
20
|
};
|
|
17
21
|
let {
|
|
18
22
|
Trigger,
|
|
23
|
+
Header,
|
|
19
24
|
Content,
|
|
25
|
+
Footer,
|
|
20
26
|
onclose,
|
|
21
27
|
defaultOpen = false,
|
|
22
28
|
id = 'modal-' + uuidv4(),
|
|
23
29
|
withClose = true,
|
|
24
30
|
closeOnClickOutside = true,
|
|
25
|
-
class: modalClass
|
|
31
|
+
class: modalClass,
|
|
32
|
+
contentClass = 'p-4'
|
|
26
33
|
}: ModalProps = $props();
|
|
27
34
|
|
|
28
35
|
const modalOpen = $state(defaultOpen);
|
|
@@ -42,15 +49,29 @@
|
|
|
42
49
|
{@render Trigger({ openModal, closeModal })}
|
|
43
50
|
{/if}
|
|
44
51
|
<dialog {id} class="modal w-full max-w-full" class:modal-open={modalOpen}>
|
|
45
|
-
<div class="modal-box {modalClass}">
|
|
52
|
+
<div class="modal-box relative flex max-w-full flex-col rounded-xl bg-surface p-0 {modalClass}">
|
|
53
|
+
{#if Header}
|
|
54
|
+
<div class="flex h-12 items-center px-4">
|
|
55
|
+
{@render Header()}
|
|
56
|
+
</div>
|
|
57
|
+
<Divider />
|
|
58
|
+
{/if}
|
|
46
59
|
{#if withClose}
|
|
47
|
-
<div class="
|
|
48
|
-
<IconButton onclick={closeModal} size="md" variant="
|
|
60
|
+
<div class="absolute right-0 top-0 z-10 p-2">
|
|
61
|
+
<IconButton onclick={closeModal} size="md" variant="transparent" rounded={false}>
|
|
49
62
|
<Icon iconName="X" />
|
|
50
63
|
</IconButton>
|
|
51
64
|
</div>
|
|
52
65
|
{/if}
|
|
53
|
-
{
|
|
66
|
+
<div class="flex-1 {contentClass}">
|
|
67
|
+
{@render Content()}
|
|
68
|
+
</div>
|
|
69
|
+
{#if Footer}
|
|
70
|
+
<Divider />
|
|
71
|
+
<div class="px-4 py-2">
|
|
72
|
+
{@render Footer()}
|
|
73
|
+
</div>
|
|
74
|
+
{/if}
|
|
54
75
|
</div>
|
|
55
76
|
{#if closeOnClickOutside}
|
|
56
77
|
<form method="dialog" class="modal-backdrop">
|
|
@@ -58,19 +79,3 @@
|
|
|
58
79
|
</form>
|
|
59
80
|
{/if}
|
|
60
81
|
</dialog>
|
|
61
|
-
|
|
62
|
-
<style>
|
|
63
|
-
.modal-box {
|
|
64
|
-
position: relative;
|
|
65
|
-
max-width: 100%;
|
|
66
|
-
border-radius: 0.75rem;
|
|
67
|
-
--tw-bg-opacity: 1;
|
|
68
|
-
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1))
|
|
69
|
-
}
|
|
70
|
-
.close-button {
|
|
71
|
-
position: absolute;
|
|
72
|
-
right: 0px;
|
|
73
|
-
top: 0px;
|
|
74
|
-
padding: 1.5rem
|
|
75
|
-
}
|
|
76
|
-
</style>
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
2
|
type ModalProps = {
|
|
3
3
|
Trigger?: Snippet<[{
|
|
4
4
|
openModal: () => void;
|
|
5
5
|
closeModal: () => void;
|
|
6
6
|
}]>;
|
|
7
|
+
Header?: Snippet;
|
|
7
8
|
Content: Snippet;
|
|
9
|
+
Footer?: Snippet;
|
|
8
10
|
onclose?: () => void;
|
|
9
11
|
defaultOpen?: boolean;
|
|
10
12
|
id?: string;
|
|
11
13
|
withClose?: boolean;
|
|
12
14
|
closeOnClickOutside?: boolean;
|
|
13
15
|
class?: string;
|
|
16
|
+
contentClass?: string;
|
|
14
17
|
};
|
|
15
18
|
declare const Modal: import("svelte").Component<ModalProps, {}, "">;
|
|
16
19
|
type Modal = ReturnType<typeof Modal>;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
|
-
<Story name="Primary">
|
|
19
|
+
<Story name="Primary" asChild>
|
|
20
20
|
<NotificationPopup onClose={handleClick} title="See what's new" {visible}>
|
|
21
21
|
<a href="_blank" color="transparent" class="flex items-center gap-2">
|
|
22
22
|
<Icon iconName="Sparkle" />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Pill from './Pill.svelte';
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Design System/Pill',
|
|
8
|
+
component: Pill,
|
|
9
|
+
tags: ['autodocs']
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Story name="Base" args={{ text: 'Example Pill' }} />
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Pill from './Pill.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 Pill: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Pill = InstanceType<typeof Pill>;
|
|
19
|
+
export default Pill;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import ProgressCircle from './ProgressCircle.svelte';
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Design System/ProgressCircle',
|
|
8
|
+
component: ProgressCircle,
|
|
9
|
+
tags: ['autodocs']
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<Story name="Base" args={{ progress: 20 }} />
|
|
14
|
+
|
|
15
|
+
<Story name="Small" args={{ progress: 20, size: 'sm' }} />
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ProgressCircle from './ProgressCircle.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 ProgressCircle: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type ProgressCircle = InstanceType<typeof ProgressCircle>;
|
|
19
|
+
export default ProgressCircle;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import RequiredStatusIndicator from './RequiredStatusIndicator.svelte';
|
|
4
|
+
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: 'Design System/RequiredStatusIndicator',
|
|
7
|
+
component: RequiredStatusIndicator,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
argTypes: {
|
|
10
|
+
currentCount: { control: 'number', description: 'Current number of completed items' },
|
|
11
|
+
requiredCount: { control: 'number', description: 'Total number of required items' },
|
|
12
|
+
class: { control: 'text', description: 'Optional additional CSS classes' }
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<Story name="Incomplete" args={{ currentCount: 1, requiredCount: 3 }} />
|
|
18
|
+
|
|
19
|
+
<Story name="Complete" args={{ currentCount: 3, requiredCount: 3 }} />
|
|
20
|
+
|
|
21
|
+
<Story
|
|
22
|
+
name="CustomClass"
|
|
23
|
+
args={{
|
|
24
|
+
currentCount: 2,
|
|
25
|
+
requiredCount: 4,
|
|
26
|
+
class: 'text-lg text-warning'
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import RequiredStatusIndicator from './RequiredStatusIndicator.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 RequiredStatusIndicator: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type RequiredStatusIndicator = InstanceType<typeof RequiredStatusIndicator>;
|
|
19
|
+
export default RequiredStatusIndicator;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Icon } from '../icons';
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
currentCount: number;
|
|
6
|
+
requiredCount: number;
|
|
7
|
+
class?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
let { currentCount, requiredCount, class: className = '' }: Props = $props();
|
|
11
|
+
|
|
12
|
+
const isComplete = $derived(currentCount >= requiredCount);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<span class={`flex items-center gap-1 text-sm text-tertiary ${className}`}>
|
|
16
|
+
{currentCount} of {requiredCount} required
|
|
17
|
+
{#if isComplete}
|
|
18
|
+
<Icon iconName="CheckCircle" weight="fill" color="accent" size={16} />
|
|
19
|
+
{:else}
|
|
20
|
+
<Icon iconName="CheckCircle" size={16} />
|
|
21
|
+
{/if}
|
|
22
|
+
</span>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
currentCount: number;
|
|
3
|
+
requiredCount: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const RequiredStatusIndicator: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type RequiredStatusIndicator = ReturnType<typeof RequiredStatusIndicator>;
|
|
8
|
+
export default RequiredStatusIndicator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RequiredStatusIndicator } from './RequiredStatusIndicator.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RequiredStatusIndicator } from './RequiredStatusIndicator.svelte';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
});
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<Story name="Primary">
|
|
13
|
+
<Story name="Primary" asChild>
|
|
14
14
|
<SegmentedControlButtons class="w-[350px]">
|
|
15
15
|
{#snippet children({ ControlButton })}
|
|
16
16
|
<ControlButton active><Icon iconName="Star" /> Low</ControlButton>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
{/snippet}
|
|
20
20
|
</SegmentedControlButtons>
|
|
21
21
|
</Story>
|
|
22
|
-
<Story name="Large">
|
|
22
|
+
<Story name="Large" asChild>
|
|
23
23
|
<SegmentedControlButtons size="lg" class="w-[350px]">
|
|
24
24
|
{#snippet children({ ControlButton })}
|
|
25
25
|
<ControlButton active><Icon iconName="Star" /> Low</ControlButton>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
{/snippet}
|
|
29
29
|
</SegmentedControlButtons>
|
|
30
30
|
</Story>
|
|
31
|
-
<Story name="Secondary">
|
|
31
|
+
<Story name="Secondary" asChild>
|
|
32
32
|
<SegmentedControlButtons class="w-[350px]">
|
|
33
33
|
{#snippet children({ ControlButton })}
|
|
34
34
|
<ControlButton active color="secondary">
|
|
@@ -23,55 +23,55 @@
|
|
|
23
23
|
}
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<Story name="Default">
|
|
26
|
+
<Story name="Default" asChild>
|
|
27
27
|
<div class="py-12">
|
|
28
28
|
<Select listOpen {items} />
|
|
29
29
|
</div>
|
|
30
30
|
</Story>
|
|
31
|
-
<Story name="Grouped">
|
|
31
|
+
<Story name="Grouped" asChild>
|
|
32
32
|
<div class="py-12">
|
|
33
33
|
<Select listOpen {items} withGroup />
|
|
34
34
|
</div>
|
|
35
35
|
</Story>
|
|
36
36
|
|
|
37
|
-
<Story name="DefaultValue">
|
|
37
|
+
<Story name="DefaultValue" asChild>
|
|
38
38
|
<div class="py-12">
|
|
39
39
|
<Select listOpen {items} withGroup value={{ value: '1', label: 'One', group: 'Group 1' }} />
|
|
40
40
|
</div>
|
|
41
41
|
</Story>
|
|
42
42
|
|
|
43
|
-
<Story name="Disabled">
|
|
43
|
+
<Story name="Disabled" asChild>
|
|
44
44
|
<div class="py-12">
|
|
45
45
|
<Select listOpen {items} disabled />
|
|
46
46
|
</div>
|
|
47
47
|
</Story>
|
|
48
|
-
<Story name="Searchable">
|
|
48
|
+
<Story name="Searchable" asChild>
|
|
49
49
|
<div class="py-12">
|
|
50
50
|
<Select listOpen {items} searchable />
|
|
51
51
|
</div>
|
|
52
52
|
</Story>
|
|
53
|
-
<Story name="Open">
|
|
53
|
+
<Story name="Open" asChild>
|
|
54
54
|
<div class="py-12">
|
|
55
55
|
<Select listOpen {items} />
|
|
56
56
|
</div>
|
|
57
57
|
</Story>
|
|
58
|
-
<Story name="Error">
|
|
58
|
+
<Story name="Error" asChild>
|
|
59
59
|
<div class="py-12">
|
|
60
60
|
<Select listOpen {items} hasError />
|
|
61
61
|
</div>
|
|
62
62
|
</Story>
|
|
63
|
-
<Story name="Placeholder">
|
|
63
|
+
<Story name="Placeholder" asChild>
|
|
64
64
|
<div class="py-12">
|
|
65
65
|
<Select listOpen {items} placeholder="Select a value" />
|
|
66
66
|
</div>
|
|
67
67
|
</Story>
|
|
68
|
-
<Story name="Multiple">
|
|
68
|
+
<Story name="Multiple" asChild>
|
|
69
69
|
<div class="py-12">
|
|
70
70
|
<Select listOpen {items} multiple bind:value />
|
|
71
71
|
</div>
|
|
72
72
|
</Story>
|
|
73
73
|
|
|
74
|
-
<Story name="Bind value input changed">
|
|
74
|
+
<Story name="Bind value input changed" asChild>
|
|
75
75
|
<div class="py-12">
|
|
76
76
|
<Select listOpen {items} bind:value on:input={handleInput} />
|
|
77
77
|
{#if thisChanged}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
</div>
|
|
80
80
|
</Story>
|
|
81
81
|
|
|
82
|
-
<Story name="Custom Item">
|
|
82
|
+
<Story name="Custom Item" asChild>
|
|
83
83
|
<div class="py-12">
|
|
84
84
|
<Select listOpen {items} value={{ value: '1', label: 'One', group: 'Group 1' }}>
|
|
85
85
|
<!-- @migration-task: migrate this slot by hand, `custom-item` is an invalid identifier -->
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
</div>
|
|
102
102
|
</Story>
|
|
103
103
|
|
|
104
|
-
<Story name="Custom selection label">
|
|
104
|
+
<Story name="Custom selection label" asChild>
|
|
105
105
|
<div class="py-12">
|
|
106
106
|
<Select {items} value={{ value: '1', label: 'One', group: 'Group 1' }}>
|
|
107
107
|
<!-- @migration-task: migrate this slot by hand, `custom-selection` is an invalid identifier -->
|