@reshape-biotech/design-system 1.2.6 → 1.2.7
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/README.md +3 -1
- package/dist/app.css +97 -97
- package/dist/components/activity/Activity.stories.svelte +104 -104
- package/dist/components/activity/Activity.svelte +112 -112
- package/dist/components/avatar/Avatar.stories.svelte +23 -23
- package/dist/components/avatar/Avatar.svelte +54 -54
- package/dist/components/banner/Banner.stories.svelte +105 -105
- package/dist/components/banner/Banner.svelte +42 -42
- package/dist/components/button/Button.stories.svelte +61 -61
- package/dist/components/button/Button.svelte +95 -95
- package/dist/components/card/Card.stories.svelte +112 -112
- package/dist/components/card/Card.svelte +18 -18
- package/dist/components/checkbox/Checkbox.stories.svelte +8 -8
- package/dist/components/checkbox/Checkbox.svelte +17 -17
- package/dist/components/collapsible/Collapsible.stories.svelte +26 -26
- package/dist/components/collapsible/components/collapsible-content.svelte +20 -20
- package/dist/components/collapsible/components/collapsible-trigger.svelte +12 -12
- package/dist/components/combobox/Combobox.stories.svelte +412 -412
- package/dist/components/combobox/components/combobox-add.svelte +8 -8
- package/dist/components/combobox/components/combobox-content.svelte +39 -39
- package/dist/components/combobox/components/combobox-indicator.svelte +1 -1
- package/dist/components/datepicker/DatePicker.stories.svelte +196 -196
- package/dist/components/datepicker/DatePicker.svelte +173 -173
- package/dist/components/divider/Divider.stories.svelte +7 -7
- package/dist/components/divider/Divider.svelte +9 -9
- package/dist/components/drawer/Drawer.stories.svelte +51 -51
- package/dist/components/drawer/Drawer.svelte +33 -33
- package/dist/components/drawer/DrawerLabel.svelte +10 -10
- package/dist/components/dropdown/Dropdown.stories.svelte +210 -210
- package/dist/components/dropdown/Dropdown.svelte +57 -57
- package/dist/components/dropdown/components/DropdownContent.svelte +16 -16
- package/dist/components/dropdown/components/DropdownMenu.svelte +10 -10
- package/dist/components/dropdown/components/DropdownTrigger.svelte +37 -37
- package/dist/components/dropdown/components/OutlinedButton.svelte +9 -9
- package/dist/components/empty-content/EmptyContent.stories.svelte +38 -38
- package/dist/components/empty-content/EmptyContent.svelte +12 -12
- package/dist/components/graphs/bar-chart/BarChart.stories.svelte +91 -91
- package/dist/components/graphs/bar-chart/BarChart.svelte +147 -147
- package/dist/components/graphs/bar-chart/StackedBarChart.stories.svelte +57 -57
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte +198 -199
- package/dist/components/graphs/chart/Chart.stories.svelte +96 -96
- package/dist/components/graphs/chart/Chart.svelte +207 -207
- package/dist/components/graphs/line/LineChart.stories.svelte +138 -138
- package/dist/components/graphs/line/LineChart.svelte +140 -142
- package/dist/components/graphs/matrix/Matrix.stories.svelte +117 -117
- package/dist/components/graphs/matrix/Matrix.svelte +141 -141
- package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +168 -168
- package/dist/components/graphs/multiline/MultiLineChart.svelte +236 -236
- package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte +84 -84
- package/dist/components/graphs/scatterplot/Scatterplot.svelte +302 -302
- package/dist/components/graphs/utils/duration.d.ts +1 -0
- package/dist/components/graphs/utils/duration.js +33 -0
- package/dist/components/graphs/utils/tooltipFormatter.js +1 -1
- package/dist/components/icon-button/IconButton.stories.svelte +64 -64
- package/dist/components/icon-button/IconButton.svelte +88 -88
- package/dist/components/icons/AnalysisIcon.stories.svelte +18 -18
- package/dist/components/icons/AnalysisIcon.svelte +96 -96
- package/dist/components/icons/Icon.stories.svelte +111 -111
- package/dist/components/icons/Icon.svelte +17 -17
- package/dist/components/icons/PrincipalIcon.svelte +59 -59
- package/dist/components/icons/custom/Halo.svelte +31 -31
- package/dist/components/icons/custom/Well.svelte +27 -27
- package/dist/components/icons/index.js +1 -1
- package/dist/components/image/Image.svelte +42 -42
- package/dist/components/input/Input.stories.svelte +55 -55
- package/dist/components/input/Input.svelte +121 -121
- package/dist/components/label/Label.stories.svelte +18 -18
- package/dist/components/label/Label.svelte +11 -11
- package/dist/components/list/List.stories.svelte +84 -84
- package/dist/components/list/List.svelte +20 -20
- package/dist/components/logo/Logo.stories.svelte +15 -15
- package/dist/components/logo/Logo.svelte +30 -30
- package/dist/components/manual-cfu-counter/ManualCFUCounter.stories.svelte +102 -102
- package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte +557 -557
- package/dist/components/manual-cfu-counter/test/ManualCFUCounterTestWrapper.svelte +11 -11
- package/dist/components/markdown/Markdown.stories.svelte +10 -10
- package/dist/components/markdown/Markdown.svelte +6 -6
- package/dist/components/modal/Modal.stories.svelte +29 -29
- package/dist/components/modal/Modal.svelte +71 -71
- package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte +201 -201
- package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte +606 -606
- package/dist/components/multi-cfu-counter/test/MultiCFUCounterTestWrapper.svelte +17 -17
- package/dist/components/notification-popup/NotificationPopup.stories.svelte +18 -18
- package/dist/components/notification-popup/NotificationPopup.svelte +26 -26
- package/dist/components/notifications/Notifications.stories.svelte +101 -101
- package/dist/components/notifications/Notifications.svelte +9 -9
- package/dist/components/pill/Pill.stories.svelte +8 -8
- package/dist/components/pill/Pill.svelte +27 -27
- package/dist/components/progress-circle/ProgressCircle.stories.svelte +8 -8
- package/dist/components/progress-circle/ProgressCircle.svelte +54 -54
- package/dist/components/required-status-indicator/RequiredStatusIndicator.stories.svelte +18 -18
- package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte +14 -14
- package/dist/components/segmented-control-buttons/ControlButton.svelte +36 -36
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +35 -35
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +13 -13
- package/dist/components/select/Select.stories.svelte +77 -77
- package/dist/components/select/Select.svelte +114 -114
- package/dist/components/select-new/Select.stories.svelte +188 -188
- package/dist/components/select-new/components/Group.svelte +17 -17
- package/dist/components/select-new/components/MultiSelectTrigger.svelte +57 -57
- package/dist/components/select-new/components/SelectContent.svelte +22 -22
- package/dist/components/select-new/components/SelectGroupHeading.svelte +10 -10
- package/dist/components/select-new/components/SelectItem.svelte +25 -25
- package/dist/components/select-new/components/SelectTrigger.svelte +38 -38
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte +76 -76
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte.d.ts +1 -1
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte +53 -53
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte.d.ts +1 -1
- package/dist/components/sjsf-wrappers/sjsfCustomTheme.js +1 -1
- package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte +32 -32
- package/dist/components/skeleton-loader/SkeletonLoader.svelte +10 -10
- package/dist/components/skeleton-loader/StatcardSkeleton.svelte +9 -9
- package/dist/components/skeleton-loader/components/Skeleton.svelte +7 -7
- package/dist/components/skeleton-loader/components/SkeletonImage.svelte +12 -12
- package/dist/components/slider/Slider.stories.svelte +23 -23
- package/dist/components/slider/Slider.svelte +107 -107
- package/dist/components/spinner/Spinner.stories.svelte +8 -8
- package/dist/components/spinner/Spinner.svelte +18 -18
- package/dist/components/stat-card/StatCard.stories.svelte +26 -26
- package/dist/components/stat-card/StatCard.svelte +128 -128
- package/dist/components/status-badge/StatusBadge.stories.svelte +365 -365
- package/dist/components/status-badge/StatusBadge.svelte +54 -54
- package/dist/components/stepper/Stepper.stories.svelte +219 -219
- package/dist/components/stepper/components/stepper-root.svelte +12 -12
- package/dist/components/stepper/components/stepper-step.svelte +83 -83
- package/dist/components/table/Table.stories.svelte +87 -87
- package/dist/components/table/Table.svelte +32 -32
- package/dist/components/table/components/TBody.svelte +7 -7
- package/dist/components/table/components/THead.svelte +7 -7
- package/dist/components/table/components/Td.svelte +8 -8
- package/dist/components/table/components/Th.svelte +8 -8
- package/dist/components/table/components/Tr.svelte +11 -11
- package/dist/components/tabs/Tabs.stories.svelte +20 -20
- package/dist/components/tabs/Tabs.svelte +8 -8
- package/dist/components/tabs/components/Content.svelte +8 -8
- package/dist/components/tabs/components/Tab.svelte +14 -14
- package/dist/components/tabs/components/Tabs.svelte +7 -7
- package/dist/components/tag/Tag.stories.svelte +57 -57
- package/dist/components/tag/Tag.svelte +95 -95
- package/dist/components/textarea/Textarea.stories.svelte +70 -70
- package/dist/components/textarea/Textarea.svelte +76 -76
- package/dist/components/toast/Toast.stories.svelte +204 -204
- package/dist/components/toast/Toast.svelte +53 -53
- package/dist/components/toggle/Toggle.stories.svelte +9 -9
- package/dist/components/toggle/Toggle.svelte +53 -53
- package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte +152 -152
- package/dist/components/toggle-icon-button/ToggleIconButton.svelte +99 -99
- package/dist/components/tooltip/Tooltip.stories.svelte +105 -105
- package/dist/components/tooltip/Tooltip.svelte +26 -26
- package/dist/fonts/index.js +1 -1
- package/dist/notifications.d.ts +1 -4
- package/dist/notifications.js +1 -1
- package/dist/tailwind-safelist.js +406 -406
- package/dist/tailwind.preset.js +10 -10
- package/dist/tokens/colors.js +18 -18
- package/dist/tokens/typography.js +6 -6
- package/dist/tokens.js +19 -19
- package/dist/types/fonts.d.ts +2 -2
- package/package.json +199 -198
|
@@ -1,124 +1,124 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { IconButton } from '../icon-button';
|
|
4
|
+
import { Icon } from '../icons';
|
|
5
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
6
|
+
|
|
7
|
+
interface InputProps extends Omit<HTMLInputAttributes, 'size' | 'prefix' | 'suffix'> {
|
|
8
|
+
label?: string | null;
|
|
9
|
+
id?: string | undefined;
|
|
10
|
+
validator?: (a: string | number) => boolean;
|
|
11
|
+
prefix?: Snippet<[any]>;
|
|
12
|
+
suffix?: Snippet;
|
|
13
|
+
error?: Snippet;
|
|
14
|
+
input?: HTMLInputElement;
|
|
15
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'dynamic';
|
|
16
|
+
transparent?: boolean;
|
|
17
|
+
clearable?: boolean;
|
|
18
|
+
onclear?: () => void;
|
|
19
|
+
class?: string;
|
|
20
|
+
oninput?: (event: Event) => void;
|
|
21
|
+
onblur?: (event: FocusEvent) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let {
|
|
25
|
+
label = null,
|
|
26
|
+
value = $bindable(),
|
|
27
|
+
type = 'text',
|
|
28
|
+
validator = (_) => {
|
|
29
|
+
return true;
|
|
30
|
+
},
|
|
31
|
+
prefix,
|
|
32
|
+
suffix,
|
|
33
|
+
error,
|
|
34
|
+
input = $bindable(),
|
|
35
|
+
size = 'md',
|
|
36
|
+
transparent = false,
|
|
37
|
+
clearable = false,
|
|
38
|
+
onclear = () => {},
|
|
39
|
+
class: className,
|
|
40
|
+
oninput,
|
|
41
|
+
onblur,
|
|
42
|
+
...rest
|
|
43
|
+
}: InputProps = $props();
|
|
44
|
+
|
|
45
|
+
export function focus() {
|
|
46
|
+
input?.focus();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let valid = $state(true);
|
|
50
|
+
|
|
51
|
+
const inputId = crypto.randomUUID();
|
|
52
|
+
const id = $derived(rest.id ?? inputId);
|
|
53
|
+
function handleInput(event: Event) {
|
|
54
|
+
if (rest.readonly) return;
|
|
55
|
+
const target = event.target as HTMLInputElement;
|
|
56
|
+
value = target.value;
|
|
57
|
+
oninput?.(event);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function handleBlur(event: FocusEvent & { currentTarget: EventTarget & HTMLInputElement }) {
|
|
61
|
+
valid = validator(value);
|
|
62
|
+
onblur?.(event);
|
|
63
|
+
}
|
|
64
64
|
</script>
|
|
65
65
|
|
|
66
66
|
<div class="w-full">
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
67
|
+
{#if label}
|
|
68
|
+
<label for={id ?? inputId} class="block px-1 py-2 text-sm text-secondary">
|
|
69
|
+
{label}
|
|
70
|
+
{#if rest.required}
|
|
71
|
+
<span class="ml-0.5 text-danger">*</span>
|
|
72
|
+
{/if}
|
|
73
|
+
</label>
|
|
74
|
+
{/if}
|
|
75
|
+
|
|
76
|
+
<div
|
|
77
|
+
class="flex w-full items-center gap-1 rounded-lg border border-input bg-surface shadow-input size-{size}"
|
|
78
|
+
class:border-transparent={transparent}
|
|
79
|
+
class:shadow-input={!transparent}
|
|
80
|
+
class:!border-error={!valid}
|
|
81
|
+
>
|
|
82
|
+
<div class="whitespace-nowrap text-secondary">
|
|
83
|
+
{@render prefix?.({ valid })}
|
|
84
|
+
</div>
|
|
85
|
+
<input
|
|
86
|
+
{id}
|
|
87
|
+
class="inline leading-none"
|
|
88
|
+
class:has-text={value}
|
|
89
|
+
class:has-placeholder={rest.placeholder}
|
|
90
|
+
aria-label={label}
|
|
91
|
+
{type}
|
|
92
|
+
oninput={handleInput}
|
|
93
|
+
onblur={handleBlur}
|
|
94
|
+
bind:this={input}
|
|
95
|
+
bind:value
|
|
96
|
+
{...rest}
|
|
97
|
+
/>
|
|
98
|
+
<div class="whitespace-nowrap text-secondary">
|
|
99
|
+
{@render suffix?.()}
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{#if clearable && value}
|
|
103
|
+
<IconButton
|
|
104
|
+
variant="transparent"
|
|
105
|
+
size="xs"
|
|
106
|
+
onclick={() => {
|
|
107
|
+
value = '';
|
|
108
|
+
input?.focus();
|
|
109
|
+
onclear();
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
<Icon iconName="X" />
|
|
113
|
+
</IconButton>
|
|
114
|
+
{/if}
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
{@render error?.()}
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
<style>
|
|
121
|
-
|
|
121
|
+
input {
|
|
122
122
|
|
|
123
123
|
width: 100%;
|
|
124
124
|
|
|
@@ -129,19 +129,19 @@
|
|
|
129
129
|
outline-offset: 2px
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
div:not(:focus-within):hover {
|
|
133
133
|
|
|
134
134
|
border-color: #5750ee40
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
div:focus-within {
|
|
138
138
|
|
|
139
139
|
--tw-border-opacity: 1;
|
|
140
140
|
|
|
141
141
|
border-color: rgb(87 80 238 / var(--tw-border-opacity, 1))
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
.size-xs {
|
|
145
145
|
|
|
146
146
|
height: 1.5rem;
|
|
147
147
|
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
line-height: 1rem
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
.size-sm {
|
|
156
156
|
|
|
157
157
|
height: 2rem;
|
|
158
158
|
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
padding-bottom: 0.5rem
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
.size-md {
|
|
169
169
|
|
|
170
170
|
height: 2.5rem;
|
|
171
171
|
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
padding-bottom: 0.5rem
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
.size-lg {
|
|
182
182
|
|
|
183
183
|
height: 3rem;
|
|
184
184
|
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
line-height: 1.5rem
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
.size-dynamic {
|
|
199
199
|
|
|
200
200
|
height: auto;
|
|
201
201
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Label from './Label.svelte';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: 'Design System/Label',
|
|
7
|
+
component: Label,
|
|
8
|
+
argTypes: {
|
|
9
|
+
text: { control: 'text' },
|
|
10
|
+
forId: { control: 'text' },
|
|
11
|
+
required: { control: 'boolean' },
|
|
12
|
+
class: { control: 'text' },
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<Story name="Default" args={{ text: 'Email Address', forId: 'email' }} />
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
<Story name="Required" args={{ text: 'Password', forId: 'password', required: true }} />
|
|
20
20
|
|
|
21
21
|
<Story
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
name="With Custom Class"
|
|
23
|
+
args={{
|
|
24
|
+
text: 'Custom Styled Label',
|
|
25
|
+
forId: 'custom',
|
|
26
|
+
class: 'text-lg text-primary font-bold',
|
|
27
|
+
}}
|
|
28
28
|
/>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
interface Props {
|
|
3
|
+
forId: string;
|
|
4
|
+
text: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const { forId, text, required = false, class: className }: Props = $props();
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<label for={forId} class="block text-sm text-secondary {className ?? ''}">
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
{text}
|
|
14
|
+
{#if required}
|
|
15
|
+
<span class="ml-0.5 text-danger">*</span>
|
|
16
|
+
{/if}
|
|
17
17
|
</label>
|
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import List from './List.svelte';
|
|
3
|
+
import Tag from '../tag/Tag.svelte';
|
|
4
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
5
|
+
import { Icon } from '../icons';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: List,
|
|
9
|
+
title: 'Design System/List',
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
});
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const items: { name: string; licenses: string; repository: string }[] = [
|
|
14
|
+
{ name: 'Formik', licenses: 'MIT', repository: 'somewhere' },
|
|
15
|
+
{ name: 'Formik', licenses: 'MIT', repository: 'somewhere' },
|
|
16
|
+
{ name: 'Formik', licenses: 'MIT', repository: 'somewhere' },
|
|
17
|
+
{ name: 'Formik', licenses: 'MIT', repository: 'somewhere' },
|
|
18
|
+
];
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<Story name="Default" args={{}} asChild>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
22
|
+
<List {items}>
|
|
23
|
+
{#snippet item(item)}
|
|
24
|
+
<div class="flex min-h-2 flex-row gap-2">
|
|
25
|
+
<div class="flex flex-row justify-start gap-2">
|
|
26
|
+
<div class="max-w-56 truncate font-bold">
|
|
27
|
+
{item.name}
|
|
28
|
+
</div>
|
|
29
|
+
{#if item.licenses}
|
|
30
|
+
<Tag>
|
|
31
|
+
{item.licenses}
|
|
32
|
+
</Tag>
|
|
33
|
+
{/if}
|
|
34
|
+
</div>
|
|
35
|
+
<div class="flex grow flex-row justify-end gap-3">
|
|
36
|
+
{#if item.repository}
|
|
37
|
+
<div class="flex flex-row items-center gap-1">
|
|
38
|
+
<a
|
|
39
|
+
href={item.repository}
|
|
40
|
+
class="text-secondary"
|
|
41
|
+
target="_blank"
|
|
42
|
+
rel="noopener noreferrer"
|
|
43
|
+
>
|
|
44
|
+
Repository
|
|
45
|
+
</a>
|
|
46
|
+
<Icon iconName="ArrowUpRight" />
|
|
47
|
+
</div>
|
|
48
|
+
{/if}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
{/snippet}
|
|
52
|
+
</List>
|
|
53
53
|
</Story>
|
|
54
54
|
|
|
55
55
|
<Story name="Compact" args={{ variant: 'compact' }} asChild>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
56
|
+
<List {items} variant="compact">
|
|
57
|
+
{#snippet item(item)}
|
|
58
|
+
<div class="flex min-h-2 flex-row gap-2">
|
|
59
|
+
<div class="flex flex-row justify-start gap-2">
|
|
60
|
+
<div class="max-w-56 truncate font-bold">
|
|
61
|
+
{item.name}
|
|
62
|
+
</div>
|
|
63
|
+
{#if item.licenses}
|
|
64
|
+
<Tag>
|
|
65
|
+
{item.licenses}
|
|
66
|
+
</Tag>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
<div class="flex grow flex-row justify-end gap-3">
|
|
70
|
+
{#if item.repository}
|
|
71
|
+
<div class="flex flex-row items-center gap-1">
|
|
72
|
+
<a
|
|
73
|
+
href={item.repository}
|
|
74
|
+
class="text-gray-700"
|
|
75
|
+
target="_blank"
|
|
76
|
+
rel="noopener noreferrer"
|
|
77
|
+
>
|
|
78
|
+
Repository
|
|
79
|
+
</a>
|
|
80
|
+
<Icon iconName="ArrowUpRight" />
|
|
81
|
+
</div>
|
|
82
|
+
{/if}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
{/snippet}
|
|
86
|
+
</List>
|
|
87
87
|
</Story>
|
|
88
88
|
|
|
89
89
|
<Story name="Loading" asChild>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
<List variant="compact" items={[{}, {}, {}]}>
|
|
91
|
+
{#snippet item({})}
|
|
92
|
+
<div class="flex h-8 w-full items-center">
|
|
93
|
+
<div class="skeleton h-6 w-full bg-neutral"></div>
|
|
94
|
+
</div>
|
|
95
|
+
{/snippet}
|
|
96
|
+
</List>
|
|
97
97
|
</Story>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<script lang="ts" generics="T">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import type { Overflow } from '../../tailwind';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
items: T[];
|
|
7
|
+
item: Snippet<[T]>;
|
|
8
|
+
overflow?: Overflow;
|
|
9
|
+
variant?: 'compact' | 'default';
|
|
10
|
+
};
|
|
11
|
+
let { items, item, overflow = 'overflow-y-auto', variant = 'default' }: Props = $props();
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<div class="{`listStyles ${variant === 'compact' ? 'compact' : 'default'} ${overflow} `}}">
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
{#each items as currentItem, i}
|
|
16
|
+
<div class="item">
|
|
17
|
+
{@render item(currentItem)}
|
|
18
|
+
</div>
|
|
19
|
+
{/each}
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
<style>
|
|
23
|
-
|
|
23
|
+
.listStyles {
|
|
24
24
|
|
|
25
25
|
display: flex;
|
|
26
26
|
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
border-radius: 0.25rem
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
.listStyles.default {
|
|
39
39
|
|
|
40
40
|
gap: 1rem
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
.listStyles.compact {
|
|
44
44
|
|
|
45
45
|
gap: 0px;
|
|
46
46
|
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
padding-right: 1rem
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
.listStyles.compact :global(> .item:not(:last-child)) {
|
|
57
57
|
|
|
58
58
|
border-bottom-width: 1px;
|
|
59
59
|
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
border-color: #12192a14
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
.listStyles :global(.item) {
|
|
66
66
|
|
|
67
67
|
align-self: stretch
|
|
68
68
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<script module>
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Logo from './Logo.svelte';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Design System/Logo',
|
|
8
|
+
component: Logo,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
});
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<Story name="Base" asChild>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
<div class="flex flex-col gap-4">
|
|
15
|
+
<Logo size="xs" />
|
|
16
|
+
<Logo size="sm" />
|
|
17
|
+
<Logo size="md" />
|
|
18
|
+
<Logo size="lg" />
|
|
19
|
+
<Logo size="xl" />
|
|
20
|
+
</div>
|
|
21
21
|
</Story>
|