@reshape-biotech/design-system 0.0.44 → 0.0.47
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/index.css +1 -0
- package/dist/index.js +68464 -34
- package/dist/index.umd.cjs +148 -0
- package/package.json +17 -15
- package/dist/app.css +0 -103
- package/dist/components/avatar/Avatar.svelte +0 -63
- package/dist/components/avatar/Avatar.svelte.d.ts +0 -8
- package/dist/components/avatar/index.d.ts +0 -1
- package/dist/components/avatar/index.js +0 -1
- package/dist/components/banner/Banner.stories.svelte +0 -129
- package/dist/components/banner/Banner.stories.svelte.d.ts +0 -19
- package/dist/components/banner/Banner.svelte +0 -59
- package/dist/components/banner/Banner.svelte.d.ts +0 -11
- package/dist/components/banner/index.d.ts +0 -1
- package/dist/components/banner/index.js +0 -1
- package/dist/components/button/Button.stories.svelte +0 -37
- package/dist/components/button/Button.stories.svelte.d.ts +0 -19
- package/dist/components/button/Button.svelte +0 -176
- package/dist/components/button/Button.svelte.d.ts +0 -17
- package/dist/components/button/index.d.ts +0 -1
- package/dist/components/button/index.js +0 -1
- package/dist/components/datepicker/DatePicker.svelte +0 -283
- package/dist/components/datepicker/DatePicker.svelte.d.ts +0 -8
- package/dist/components/datepicker/index.d.ts +0 -1
- package/dist/components/datepicker/index.js +0 -1
- package/dist/components/divider/Divider.stories.svelte +0 -14
- package/dist/components/divider/Divider.stories.svelte.d.ts +0 -27
- package/dist/components/divider/Divider.svelte +0 -9
- package/dist/components/divider/Divider.svelte.d.ts +0 -6
- package/dist/components/divider/index.d.ts +0 -1
- package/dist/components/divider/index.js +0 -1
- package/dist/components/drawer/Drawer.stories.svelte +0 -64
- package/dist/components/drawer/Drawer.stories.svelte.d.ts +0 -27
- package/dist/components/drawer/Drawer.svelte +0 -41
- package/dist/components/drawer/Drawer.svelte.d.ts +0 -12
- package/dist/components/drawer/DrawerLabel.svelte +0 -62
- package/dist/components/drawer/DrawerLabel.svelte.d.ts +0 -9
- package/dist/components/drawer/index.d.ts +0 -1
- package/dist/components/drawer/index.js +0 -1
- package/dist/components/dropdown/Dropdown.stories.svelte +0 -236
- package/dist/components/dropdown/Dropdown.stories.svelte.d.ts +0 -27
- package/dist/components/dropdown/Dropdown.svelte +0 -69
- package/dist/components/dropdown/Dropdown.svelte.d.ts +0 -26
- package/dist/components/dropdown/components/DropdownContent.svelte +0 -29
- package/dist/components/dropdown/components/DropdownContent.svelte.d.ts +0 -10
- package/dist/components/dropdown/components/DropdownMenu.svelte +0 -23
- package/dist/components/dropdown/components/DropdownMenu.svelte.d.ts +0 -8
- package/dist/components/dropdown/components/DropdownTrigger.svelte +0 -44
- package/dist/components/dropdown/components/DropdownTrigger.svelte.d.ts +0 -12
- package/dist/components/dropdown/components/OutlinedButton.svelte +0 -61
- package/dist/components/dropdown/components/OutlinedButton.svelte.d.ts +0 -8
- package/dist/components/dropdown/index.d.ts +0 -1
- package/dist/components/dropdown/index.js +0 -1
- package/dist/components/icon-button/IconButton.stories.svelte +0 -52
- package/dist/components/icon-button/IconButton.stories.svelte.d.ts +0 -19
- package/dist/components/icon-button/IconButton.svelte +0 -72
- package/dist/components/icon-button/IconButton.svelte.d.ts +0 -14
- package/dist/components/icon-button/index.d.ts +0 -1
- package/dist/components/icon-button/index.js +0 -1
- package/dist/components/image/Image.svelte +0 -56
- package/dist/components/image/Image.svelte.d.ts +0 -7
- package/dist/components/image/index.d.ts +0 -1
- package/dist/components/image/index.js +0 -1
- package/dist/components/input/Input.stories.svelte +0 -87
- package/dist/components/input/Input.stories.svelte.d.ts +0 -27
- package/dist/components/input/Input.svelte +0 -182
- package/dist/components/input/Input.svelte.d.ts +0 -21
- package/dist/components/input/index.d.ts +0 -1
- package/dist/components/input/index.js +0 -1
- package/dist/components/list/List.stories.svelte +0 -97
- package/dist/components/list/List.stories.svelte.d.ts +0 -19
- package/dist/components/list/List.svelte +0 -75
- package/dist/components/list/List.svelte.d.ts +0 -24
- package/dist/components/list/index.d.ts +0 -1
- package/dist/components/list/index.js +0 -1
- package/dist/components/logo/Logo.stories.svelte +0 -21
- package/dist/components/logo/Logo.stories.svelte.d.ts +0 -27
- package/dist/components/logo/Logo.svelte +0 -36
- package/dist/components/logo/Logo.svelte.d.ts +0 -6
- package/dist/components/logo/index.d.ts +0 -1
- package/dist/components/logo/index.js +0 -1
- package/dist/components/markdown/Markdown.stories.svelte +0 -41
- package/dist/components/markdown/Markdown.stories.svelte.d.ts +0 -27
- package/dist/components/markdown/Markdown.svelte +0 -12
- package/dist/components/markdown/Markdown.svelte.d.ts +0 -6
- package/dist/components/markdown/index.d.ts +0 -1
- package/dist/components/markdown/index.js +0 -1
- package/dist/components/modal/Modal.stories.svelte +0 -39
- package/dist/components/modal/Modal.stories.svelte.d.ts +0 -19
- package/dist/components/modal/Modal.svelte +0 -76
- package/dist/components/modal/Modal.svelte.d.ts +0 -17
- package/dist/components/modal/index.d.ts +0 -1
- package/dist/components/modal/index.js +0 -1
- package/dist/components/notification-popup/NotificationPopup.stories.svelte +0 -27
- package/dist/components/notification-popup/NotificationPopup.stories.svelte.d.ts +0 -27
- package/dist/components/notification-popup/NotificationPopup.svelte +0 -31
- package/dist/components/notification-popup/NotificationPopup.svelte.d.ts +0 -11
- package/dist/components/notification-popup/index.d.ts +0 -1
- package/dist/components/notification-popup/index.js +0 -1
- package/dist/components/pill/Pill.svelte +0 -39
- package/dist/components/pill/Pill.svelte.d.ts +0 -10
- package/dist/components/pill/index.d.ts +0 -1
- package/dist/components/pill/index.js +0 -1
- package/dist/components/progress-circle/ProgressCircle.svelte +0 -79
- package/dist/components/progress-circle/ProgressCircle.svelte.d.ts +0 -7
- package/dist/components/progress-circle/index.d.ts +0 -1
- package/dist/components/progress-circle/index.js +0 -1
- package/dist/components/segmented-control-buttons/ControlButton.svelte +0 -59
- package/dist/components/segmented-control-buttons/ControlButton.svelte.d.ts +0 -14
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +0 -45
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte.d.ts +0 -19
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +0 -21
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte.d.ts +0 -12
- package/dist/components/segmented-control-buttons/index.d.ts +0 -1
- package/dist/components/segmented-control-buttons/index.js +0 -1
- package/dist/components/select/Select.stories.svelte +0 -113
- package/dist/components/select/Select.stories.svelte.d.ts +0 -19
- package/dist/components/select/Select.svelte +0 -138
- package/dist/components/select/Select.svelte.d.ts +0 -60
- package/dist/components/select/index.d.ts +0 -7
- package/dist/components/select/index.js +0 -1
- package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte +0 -45
- package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte.d.ts +0 -27
- package/dist/components/skeleton-loader/SkeletonLoader.svelte +0 -17
- package/dist/components/skeleton-loader/SkeletonLoader.svelte.d.ts +0 -14
- package/dist/components/skeleton-loader/StatcardSkeleton.svelte +0 -17
- package/dist/components/skeleton-loader/StatcardSkeleton.svelte.d.ts +0 -18
- package/dist/components/skeleton-loader/components/Skeleton.svelte +0 -14
- package/dist/components/skeleton-loader/components/Skeleton.svelte.d.ts +0 -8
- package/dist/components/skeleton-loader/components/SkeletonImage.svelte +0 -14
- package/dist/components/skeleton-loader/components/SkeletonImage.svelte.d.ts +0 -26
- package/dist/components/skeleton-loader/index.d.ts +0 -3
- package/dist/components/skeleton-loader/index.js +0 -3
- package/dist/components/slider/Slider.stories.svelte +0 -37
- package/dist/components/slider/Slider.stories.svelte.d.ts +0 -27
- package/dist/components/slider/Slider.svelte +0 -117
- package/dist/components/slider/Slider.svelte.d.ts +0 -29
- package/dist/components/slider/index.d.ts +0 -1
- package/dist/components/slider/index.js +0 -1
- package/dist/components/spinner/Spinner.svelte +0 -27
- package/dist/components/spinner/Spinner.svelte.d.ts +0 -6
- package/dist/components/spinner/index.d.ts +0 -1
- package/dist/components/spinner/index.js +0 -1
- package/dist/components/stat-card/StatCard.stories.svelte +0 -32
- package/dist/components/stat-card/StatCard.stories.svelte.d.ts +0 -27
- package/dist/components/stat-card/StatCard.svelte +0 -52
- package/dist/components/stat-card/StatCard.svelte.d.ts +0 -10
- package/dist/components/stat-card/index.d.ts +0 -1
- package/dist/components/stat-card/index.js +0 -1
- package/dist/components/status-badge/StatusBadge.stories.svelte +0 -401
- package/dist/components/status-badge/StatusBadge.stories.svelte.d.ts +0 -19
- package/dist/components/status-badge/StatusBadge.svelte +0 -147
- package/dist/components/status-badge/StatusBadge.svelte.d.ts +0 -12
- package/dist/components/status-badge/index.d.ts +0 -1
- package/dist/components/status-badge/index.js +0 -1
- package/dist/components/table/Table.stories.svelte +0 -90
- package/dist/components/table/Table.stories.svelte.d.ts +0 -24
- package/dist/components/table/Table.svelte +0 -47
- package/dist/components/table/Table.svelte.d.ts +0 -21
- package/dist/components/table/components/TBody.svelte +0 -14
- package/dist/components/table/components/TBody.svelte.d.ts +0 -8
- package/dist/components/table/components/THead.svelte +0 -14
- package/dist/components/table/components/THead.svelte.d.ts +0 -8
- package/dist/components/table/components/Td.svelte +0 -14
- package/dist/components/table/components/Td.svelte.d.ts +0 -8
- package/dist/components/table/components/Th.svelte +0 -15
- package/dist/components/table/components/Th.svelte.d.ts +0 -9
- package/dist/components/table/components/Tr.svelte +0 -31
- package/dist/components/table/components/Tr.svelte.d.ts +0 -8
- package/dist/components/table/index.d.ts +0 -1
- package/dist/components/table/index.js +0 -1
- package/dist/components/tabs/Tabs.stories.svelte +0 -28
- package/dist/components/tabs/Tabs.stories.svelte.d.ts +0 -27
- package/dist/components/tabs/Tabs.svelte +0 -13
- package/dist/components/tabs/Tabs.svelte.d.ts +0 -14
- package/dist/components/tabs/components/Content.svelte +0 -15
- package/dist/components/tabs/components/Content.svelte.d.ts +0 -9
- package/dist/components/tabs/components/Tab.svelte +0 -21
- package/dist/components/tabs/components/Tab.svelte.d.ts +0 -10
- package/dist/components/tabs/components/Tabs.svelte +0 -14
- package/dist/components/tabs/components/Tabs.svelte.d.ts +0 -8
- package/dist/components/tabs/index.d.ts +0 -1
- package/dist/components/tabs/index.js +0 -1
- package/dist/components/tag/Tag.stories.svelte +0 -51
- package/dist/components/tag/Tag.stories.svelte.d.ts +0 -19
- package/dist/components/tag/Tag.svelte +0 -104
- package/dist/components/tag/Tag.svelte.d.ts +0 -11
- package/dist/components/tag/index.d.ts +0 -1
- package/dist/components/tag/index.js +0 -1
- package/dist/components/toggle/Toggle.stories.svelte +0 -15
- package/dist/components/toggle/Toggle.stories.svelte.d.ts +0 -27
- package/dist/components/toggle/Toggle.svelte +0 -73
- package/dist/components/toggle/Toggle.svelte.d.ts +0 -7
- package/dist/components/toggle/index.d.ts +0 -1
- package/dist/components/toggle/index.js +0 -1
- package/dist/components/tooltip/Tooltip.stories.svelte +0 -126
- package/dist/components/tooltip/Tooltip.stories.svelte.d.ts +0 -27
- package/dist/components/tooltip/Tooltip.svelte +0 -49
- package/dist/components/tooltip/Tooltip.svelte.d.ts +0 -13
- package/dist/components/tooltip/index.d.ts +0 -1
- package/dist/components/tooltip/index.js +0 -1
- package/dist/fonts/MDSystem-Medium.woff +0 -0
- package/dist/fonts/MDSystem-Medium.woff2 +0 -0
- package/dist/fonts/MDSystem-Regular.woff +0 -0
- package/dist/fonts/MDSystem-Regular.woff2 +0 -0
- package/dist/fonts/MDSystem-Semibold.woff +0 -0
- package/dist/fonts/MDSystem-Semibold.woff2 +0 -0
- package/dist/fonts/MDSystemMono-Regular.woff +0 -0
- package/dist/fonts/MDSystemMono-Regular.woff2 +0 -0
- package/dist/fonts/index.d.ts +0 -6
- package/dist/fonts/index.js +0 -10
- package/dist/index.d.ts +0 -32
- package/dist/tailwind-safelist.d.ts +0 -27
- package/dist/tailwind-safelist.js +0 -475
- package/dist/tailwind.d.ts +0 -11
- package/dist/tailwind.js +0 -1
- package/dist/tailwind.preset.d.ts +0 -331
- package/dist/tailwind.preset.js +0 -54
- package/dist/tokens.d.ts +0 -570
- package/dist/tokens.js +0 -267
- package/dist/types/fonts.d.ts +0 -4
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import IconButton from '../icon-button/IconButton.svelte';
|
|
4
|
-
import { Plus } from 'phosphor-svelte';
|
|
5
|
-
|
|
6
|
-
const { Story } = defineMeta({
|
|
7
|
-
component: IconButton,
|
|
8
|
-
title: 'Design System/IconButton',
|
|
9
|
-
tags: ['autodocs']
|
|
10
|
-
});
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<Story name="Primary">
|
|
14
|
-
<IconButton color="primary">
|
|
15
|
-
<Plus />
|
|
16
|
-
</IconButton>
|
|
17
|
-
</Story>
|
|
18
|
-
<Story name="Danger">
|
|
19
|
-
<IconButton color="danger">
|
|
20
|
-
<Plus />
|
|
21
|
-
</IconButton>
|
|
22
|
-
</Story>
|
|
23
|
-
<Story name="Transparent">
|
|
24
|
-
<IconButton color="transparent">
|
|
25
|
-
<Plus />
|
|
26
|
-
</IconButton>
|
|
27
|
-
</Story>
|
|
28
|
-
<Story name="Secondary">
|
|
29
|
-
<IconButton color="secondary">
|
|
30
|
-
<Plus />
|
|
31
|
-
</IconButton>
|
|
32
|
-
</Story>
|
|
33
|
-
<Story name="Medium">
|
|
34
|
-
<IconButton color="secondary" size="md">
|
|
35
|
-
<Plus />
|
|
36
|
-
</IconButton>
|
|
37
|
-
</Story>
|
|
38
|
-
<Story name="Extra Small">
|
|
39
|
-
<IconButton color="secondary" size="xs">
|
|
40
|
-
<Plus />
|
|
41
|
-
</IconButton>
|
|
42
|
-
</Story>
|
|
43
|
-
<Story name="Disabled">
|
|
44
|
-
<IconButton disabled>
|
|
45
|
-
<Plus />
|
|
46
|
-
</IconButton>
|
|
47
|
-
</Story>
|
|
48
|
-
<Story name="Loading">
|
|
49
|
-
<IconButton loading>
|
|
50
|
-
<Plus />
|
|
51
|
-
</IconButton>
|
|
52
|
-
</Story>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import IconButton from '../icon-button/IconButton.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 IconButton: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
}, {}, {}, string>;
|
|
18
|
-
type IconButton = InstanceType<typeof IconButton>;
|
|
19
|
-
export default IconButton;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import { Spinner } from '../spinner/';
|
|
4
|
-
|
|
5
|
-
type Color = 'primary' | 'secondary' | 'transparent' | 'danger';
|
|
6
|
-
interface Props {
|
|
7
|
-
color?: 'primary' | 'transparent' | 'secondary' | 'danger';
|
|
8
|
-
type?: 'button' | 'submit' | 'reset' | null | undefined;
|
|
9
|
-
loading?: boolean;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
size?: 'xs' | 'sm' | 'md';
|
|
12
|
-
children?: Snippet;
|
|
13
|
-
onclick?: () => void;
|
|
14
|
-
tabindex?: number | undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let {
|
|
18
|
-
color = 'transparent',
|
|
19
|
-
type = 'button',
|
|
20
|
-
loading = false,
|
|
21
|
-
disabled = false,
|
|
22
|
-
size = 'sm',
|
|
23
|
-
children,
|
|
24
|
-
onclick,
|
|
25
|
-
tabindex
|
|
26
|
-
}: Props = $props();
|
|
27
|
-
|
|
28
|
-
const sizeClass = {
|
|
29
|
-
xs: 'h-6 w-6 [&>svg]:w-4 [&>svg]:h-4',
|
|
30
|
-
sm: 'h-8 w-8 [&>svg]:w-4 [&>svg]:h-4',
|
|
31
|
-
md: 'h-10 w-10 [&>svg]:w-5 [&>svg]:h-5',
|
|
32
|
-
lg: 'h-8 w-8 '
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const colors: Record<Color, string> = {
|
|
36
|
-
primary: 'bg-accent-inverse text-icon-primary-inverse hover:bg-accent-inverse-hover ',
|
|
37
|
-
secondary: 'bg-neutral text-icon-primary hover:bg-neutral-hover ',
|
|
38
|
-
transparent: 'bg-transparent text-icon-primary hover:bg-neutral-hover ',
|
|
39
|
-
danger: 'bg-danger-inverse text-icon-primary-inverse hover:bg-danger-inverse-hover '
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const baseStyle = 'flex justify-center items-center rounded-full';
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
{#if disabled || loading}
|
|
46
|
-
<button
|
|
47
|
-
onclick={(e) => {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
}}
|
|
50
|
-
{type}
|
|
51
|
-
{disabled}
|
|
52
|
-
class="disabled:bg-neutral disabled:text-tertiary {baseStyle} {sizeClass[
|
|
53
|
-
size
|
|
54
|
-
]} cursor-default {colors['secondary']}"
|
|
55
|
-
>
|
|
56
|
-
{#if loading}
|
|
57
|
-
<Spinner />
|
|
58
|
-
{:else}
|
|
59
|
-
{@render children?.()}
|
|
60
|
-
{/if}
|
|
61
|
-
</button>
|
|
62
|
-
{:else}
|
|
63
|
-
<button
|
|
64
|
-
{onclick}
|
|
65
|
-
{type}
|
|
66
|
-
{disabled}
|
|
67
|
-
{tabindex}
|
|
68
|
-
class="{colors[color]} {sizeClass[size]} {baseStyle} cursor-pointer"
|
|
69
|
-
>
|
|
70
|
-
{@render children?.()}
|
|
71
|
-
</button>
|
|
72
|
-
{/if}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
interface Props {
|
|
3
|
-
color?: 'primary' | 'transparent' | 'secondary' | 'danger';
|
|
4
|
-
type?: 'button' | 'submit' | 'reset' | null | undefined;
|
|
5
|
-
loading?: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
size?: 'xs' | 'sm' | 'md';
|
|
8
|
-
children?: Snippet;
|
|
9
|
-
onclick?: () => void;
|
|
10
|
-
tabindex?: number | undefined;
|
|
11
|
-
}
|
|
12
|
-
declare const IconButton: import("svelte").Component<Props, {}, "">;
|
|
13
|
-
type IconButton = ReturnType<typeof IconButton>;
|
|
14
|
-
export default IconButton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as IconButton } from './IconButton.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as IconButton } from './IconButton.svelte';
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount } from 'svelte';
|
|
3
|
-
import { SkeletonLoader } from '../skeleton-loader/';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
src: string;
|
|
7
|
-
alt: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
let { src, alt }: Props = $props();
|
|
11
|
-
|
|
12
|
-
let loaded = $state(false);
|
|
13
|
-
let failed = $state(false);
|
|
14
|
-
let loading = $state(false);
|
|
15
|
-
|
|
16
|
-
onMount(() => {
|
|
17
|
-
const img = new Image();
|
|
18
|
-
img.src = src;
|
|
19
|
-
loading = true;
|
|
20
|
-
|
|
21
|
-
img.onload = () => {
|
|
22
|
-
loading = false;
|
|
23
|
-
loaded = true;
|
|
24
|
-
};
|
|
25
|
-
img.onerror = () => {
|
|
26
|
-
loading = false;
|
|
27
|
-
failed = true;
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<div class="h-full w-full">
|
|
33
|
-
{#if loaded}
|
|
34
|
-
<img {src} {alt} class="image h-full w-full object-cover" />
|
|
35
|
-
{:else if failed}
|
|
36
|
-
<img src="/imgs/MissingImageListRectangle.png" {alt} class="image" />
|
|
37
|
-
{:else if loading}
|
|
38
|
-
<div class="flex h-full flex-grow flex-col content-center justify-center">
|
|
39
|
-
<SkeletonLoader>
|
|
40
|
-
{#snippet children({ Skeleton, SkeletonImage })}
|
|
41
|
-
<!-- TODO: BG color is to match design, but we want to change the color, therefore not a token -->
|
|
42
|
-
<Skeleton class=" h-full w-full rounded-s-lg bg-[#D9E6E9]">
|
|
43
|
-
<SkeletonImage />
|
|
44
|
-
</Skeleton>
|
|
45
|
-
{/snippet}
|
|
46
|
-
</SkeletonLoader>
|
|
47
|
-
</div>
|
|
48
|
-
{/if}
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<style>
|
|
52
|
-
.image {
|
|
53
|
-
border-start-start-radius: 0.5rem;
|
|
54
|
-
border-end-start-radius: 0.5rem
|
|
55
|
-
}
|
|
56
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Image } from './Image.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Image } from './Image.svelte';
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import Input from './Input.svelte';
|
|
3
|
-
|
|
4
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
5
|
-
|
|
6
|
-
const { Story } = defineMeta({
|
|
7
|
-
component: Input,
|
|
8
|
-
title: 'Design System/Input',
|
|
9
|
-
tags: ['autodocs']
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
let value = '';
|
|
13
|
-
let email = 'bob@foo.com';
|
|
14
|
-
let password = 'wordpass';
|
|
15
|
-
|
|
16
|
-
let textareaValue = '';
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<Story name="Base">
|
|
20
|
-
<Input bind:value autofocus />
|
|
21
|
-
</Story>
|
|
22
|
-
<Story name="XSmall">
|
|
23
|
-
<Input bind:value autofocus size="xs" />
|
|
24
|
-
</Story>
|
|
25
|
-
<Story name="Small">
|
|
26
|
-
<Input bind:value autofocus size="sm" />
|
|
27
|
-
</Story>
|
|
28
|
-
|
|
29
|
-
<Story name="Login">
|
|
30
|
-
<div class="flex flex-col gap-2">
|
|
31
|
-
<Input bind:value={email} label="Email" type="text" required id="email-select" autofocus />
|
|
32
|
-
<Input bind:value={password} label="Password" id="password-select" type="password" required />
|
|
33
|
-
</div>
|
|
34
|
-
</Story>
|
|
35
|
-
|
|
36
|
-
<Story name="Textarea">
|
|
37
|
-
<Input
|
|
38
|
-
bind:value={textareaValue}
|
|
39
|
-
label="Description"
|
|
40
|
-
type="textarea"
|
|
41
|
-
placeholder="Add a description..."
|
|
42
|
-
/>
|
|
43
|
-
</Story>
|
|
44
|
-
|
|
45
|
-
<Story name="Prefix">
|
|
46
|
-
<Input value="Bob">
|
|
47
|
-
{#snippet prefix()}
|
|
48
|
-
<div>Mr.</div>
|
|
49
|
-
{/snippet}
|
|
50
|
-
</Input>
|
|
51
|
-
</Story>
|
|
52
|
-
|
|
53
|
-
<Story name="Suffix">
|
|
54
|
-
<Input value="30">
|
|
55
|
-
{#snippet suffix()}
|
|
56
|
-
<div>± 1°C</div>
|
|
57
|
-
{/snippet}
|
|
58
|
-
</Input>
|
|
59
|
-
</Story>
|
|
60
|
-
|
|
61
|
-
<Story name="Prefix & Suffix">
|
|
62
|
-
<Input value="9001">
|
|
63
|
-
{#snippet prefix()}
|
|
64
|
-
<div>$</div>
|
|
65
|
-
{/snippet}
|
|
66
|
-
{#snippet suffix()}
|
|
67
|
-
<div>🔥</div>
|
|
68
|
-
{/snippet}
|
|
69
|
-
</Input>
|
|
70
|
-
</Story>
|
|
71
|
-
|
|
72
|
-
<Story name="Validation">
|
|
73
|
-
<Input value="Focus me, then click away" validator={(val) => val.toString().length < 10}>
|
|
74
|
-
{#snippet prefix({ valid })}
|
|
75
|
-
<div>
|
|
76
|
-
{#if valid}
|
|
77
|
-
😊
|
|
78
|
-
{:else}
|
|
79
|
-
😔
|
|
80
|
-
{/if}
|
|
81
|
-
</div>
|
|
82
|
-
{/snippet}
|
|
83
|
-
{#snippet error()}
|
|
84
|
-
<p class="pt-2 text-error">Oh no! Too many characters!</p>
|
|
85
|
-
{/snippet}
|
|
86
|
-
</Input>
|
|
87
|
-
</Story>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export default Input;
|
|
2
|
-
type Input = SvelteComponent<{
|
|
3
|
-
[x: string]: never;
|
|
4
|
-
}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {}> & {
|
|
7
|
-
$$bindings?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
declare const Input: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
import Input from './Input.svelte';
|
|
15
|
-
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> {
|
|
16
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
-
$$bindings?: Bindings;
|
|
18
|
-
} & Exports;
|
|
19
|
-
(internal: unknown, props: {
|
|
20
|
-
$$events?: Events;
|
|
21
|
-
$$slots?: Slots;
|
|
22
|
-
}): Exports & {
|
|
23
|
-
$set?: any;
|
|
24
|
-
$on?: any;
|
|
25
|
-
};
|
|
26
|
-
z_$$bindings?: Bindings;
|
|
27
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
label?: string | null;
|
|
6
|
-
value: string | number;
|
|
7
|
-
type?: 'text' | 'password' | 'textarea' | 'number';
|
|
8
|
-
required?: boolean;
|
|
9
|
-
autofocus?: boolean;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
id?: string | undefined;
|
|
12
|
-
validator?: (a: string | number) => boolean;
|
|
13
|
-
onBlur?: (e: Event) => void;
|
|
14
|
-
onkeydown?: (e: KeyboardEvent) => void;
|
|
15
|
-
prefix?: Snippet<[any]>;
|
|
16
|
-
suffix?: Snippet;
|
|
17
|
-
error?: Snippet;
|
|
18
|
-
input?: HTMLInputElement | HTMLTextAreaElement;
|
|
19
|
-
maxlength?: number | null;
|
|
20
|
-
size?: 'xs' | 'sm' | 'md';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
let {
|
|
24
|
-
label = null,
|
|
25
|
-
value = $bindable(),
|
|
26
|
-
type = 'text',
|
|
27
|
-
required = false,
|
|
28
|
-
autofocus = false,
|
|
29
|
-
placeholder = '',
|
|
30
|
-
id = undefined,
|
|
31
|
-
validator = (_) => {
|
|
32
|
-
return true;
|
|
33
|
-
},
|
|
34
|
-
onBlur = () => {},
|
|
35
|
-
onkeydown = () => {},
|
|
36
|
-
prefix,
|
|
37
|
-
suffix,
|
|
38
|
-
error,
|
|
39
|
-
input = $bindable(),
|
|
40
|
-
maxlength = null,
|
|
41
|
-
size = 'md'
|
|
42
|
-
}: Props = $props();
|
|
43
|
-
|
|
44
|
-
let valid = $state(true);
|
|
45
|
-
|
|
46
|
-
const inputId = Math.random().toString(36).substring(7); // used for A11y
|
|
47
|
-
|
|
48
|
-
function handleInput(event: Event) {
|
|
49
|
-
const target = event.target as HTMLTextAreaElement | HTMLInputElement;
|
|
50
|
-
value = target.value;
|
|
51
|
-
|
|
52
|
-
if (type === 'textarea') {
|
|
53
|
-
autoResizeTextarea(target as HTMLTextAreaElement);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function autoResizeTextarea(textarea: HTMLTextAreaElement) {
|
|
57
|
-
textarea.style.height = 'auto';
|
|
58
|
-
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function handleBlur(event: Event) {
|
|
62
|
-
valid = validator(value);
|
|
63
|
-
onBlur(event);
|
|
64
|
-
}
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<div class="w-full">
|
|
68
|
-
{#if label}
|
|
69
|
-
<label for={id ?? inputId} class="block px-1 py-2 text-sm text-secondary">{label}</label>
|
|
70
|
-
{/if}
|
|
71
|
-
<div
|
|
72
|
-
class="flex w-full items-center gap-1 rounded-lg border border-input bg-surface shadow-input size-{size}"
|
|
73
|
-
class:!border-error={!valid}
|
|
74
|
-
>
|
|
75
|
-
{#if type === 'textarea'}
|
|
76
|
-
<textarea
|
|
77
|
-
id={id ?? inputId}
|
|
78
|
-
rows="3"
|
|
79
|
-
class:has-text={value}
|
|
80
|
-
class:has-placeholder={placeholder}
|
|
81
|
-
aria-label={label}
|
|
82
|
-
oninput={handleInput}
|
|
83
|
-
onblur={handleBlur}
|
|
84
|
-
{onkeydown}
|
|
85
|
-
bind:this={input}
|
|
86
|
-
{value}
|
|
87
|
-
{required}
|
|
88
|
-
{autofocus}
|
|
89
|
-
{placeholder}
|
|
90
|
-
{maxlength}
|
|
91
|
-
></textarea>
|
|
92
|
-
{:else}
|
|
93
|
-
<div class="whitespace-nowrap text-secondary">
|
|
94
|
-
{@render prefix?.({ valid })}
|
|
95
|
-
</div>
|
|
96
|
-
<input
|
|
97
|
-
id={id ?? inputId}
|
|
98
|
-
class="inline leading-none"
|
|
99
|
-
class:has-text={value}
|
|
100
|
-
class:has-placeholder={placeholder}
|
|
101
|
-
aria-label={label}
|
|
102
|
-
{type}
|
|
103
|
-
{required}
|
|
104
|
-
oninput={handleInput}
|
|
105
|
-
onblur={handleBlur}
|
|
106
|
-
{onkeydown}
|
|
107
|
-
bind:this={input}
|
|
108
|
-
{value}
|
|
109
|
-
{autofocus}
|
|
110
|
-
{placeholder}
|
|
111
|
-
{maxlength}
|
|
112
|
-
/>
|
|
113
|
-
<div class="whitespace-nowrap text-secondary">
|
|
114
|
-
{@render suffix?.()}
|
|
115
|
-
</div>
|
|
116
|
-
{/if}
|
|
117
|
-
</div>
|
|
118
|
-
{#if !valid}
|
|
119
|
-
{@render error?.()}
|
|
120
|
-
{/if}
|
|
121
|
-
</div>
|
|
122
|
-
|
|
123
|
-
<style>
|
|
124
|
-
input,
|
|
125
|
-
textarea {
|
|
126
|
-
|
|
127
|
-
width: 100%;
|
|
128
|
-
|
|
129
|
-
resize: none;
|
|
130
|
-
|
|
131
|
-
overflow: hidden;
|
|
132
|
-
|
|
133
|
-
outline: 2px solid transparent;
|
|
134
|
-
|
|
135
|
-
outline-offset: 2px
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
div:not(:focus-within):hover {
|
|
139
|
-
|
|
140
|
-
border-color: #5750ee40
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
div:focus-within {
|
|
144
|
-
|
|
145
|
-
--tw-border-opacity: 1;
|
|
146
|
-
|
|
147
|
-
border-color: rgb(87 80 238 / var(--tw-border-opacity, 1))
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.size-xs {
|
|
151
|
-
|
|
152
|
-
padding: 0.5rem;
|
|
153
|
-
|
|
154
|
-
font-size: 0.75rem;
|
|
155
|
-
|
|
156
|
-
line-height: 1rem
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.size-sm {
|
|
160
|
-
|
|
161
|
-
padding-left: 0.75rem;
|
|
162
|
-
|
|
163
|
-
padding-right: 0.75rem;
|
|
164
|
-
|
|
165
|
-
padding-top: 0.5rem;
|
|
166
|
-
|
|
167
|
-
padding-bottom: 0.5rem;
|
|
168
|
-
|
|
169
|
-
font-size: 0.875rem;
|
|
170
|
-
|
|
171
|
-
line-height: 1.25rem
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.size-md {
|
|
175
|
-
|
|
176
|
-
padding: 0.75rem;
|
|
177
|
-
|
|
178
|
-
font-size: 1rem;
|
|
179
|
-
|
|
180
|
-
line-height: 1.5rem
|
|
181
|
-
}
|
|
182
|
-
</style>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
declare const Input: import("svelte").Component<{
|
|
3
|
-
label?: string | null;
|
|
4
|
-
value: string | number;
|
|
5
|
-
type?: "text" | "password" | "textarea" | "number";
|
|
6
|
-
required?: boolean;
|
|
7
|
-
autofocus?: boolean;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
id?: string | undefined;
|
|
10
|
-
validator?: (a: string | number) => boolean;
|
|
11
|
-
onBlur?: (e: Event) => void;
|
|
12
|
-
onkeydown?: (e: KeyboardEvent) => void;
|
|
13
|
-
prefix?: Snippet<[any]>;
|
|
14
|
-
suffix?: Snippet;
|
|
15
|
-
error?: Snippet;
|
|
16
|
-
input?: HTMLInputElement | HTMLTextAreaElement;
|
|
17
|
-
maxlength?: number | null;
|
|
18
|
-
size?: "xs" | "sm" | "md";
|
|
19
|
-
}, {}, "input" | "value">;
|
|
20
|
-
type Input = ReturnType<typeof Input>;
|
|
21
|
-
export default Input;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Input } from './Input.svelte';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Input } from './Input.svelte';
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import List from './List.svelte';
|
|
3
|
-
import Tag from '../tag/Tag.svelte';
|
|
4
|
-
import { ArrowUpRight } from 'phosphor-svelte';
|
|
5
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
6
|
-
|
|
7
|
-
const { Story } = defineMeta({
|
|
8
|
-
component: List,
|
|
9
|
-
title: 'Design System/List',
|
|
10
|
-
tags: ['autodocs']
|
|
11
|
-
});
|
|
12
|
-
|
|
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
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<Story name="Default" args={{}}>
|
|
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
|
-
<ArrowUpRight />
|
|
47
|
-
</div>
|
|
48
|
-
{/if}
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
{/snippet}
|
|
52
|
-
</List>
|
|
53
|
-
</Story>
|
|
54
|
-
|
|
55
|
-
<Story name="Compact" args={{ variant: 'compact' }}>
|
|
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
|
-
<ArrowUpRight />
|
|
81
|
-
</div>
|
|
82
|
-
{/if}
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
{/snippet}
|
|
86
|
-
</List>
|
|
87
|
-
</Story>
|
|
88
|
-
|
|
89
|
-
<Story name="Loading">
|
|
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
|
-
</Story>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import List from './List.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 List: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
}, {}, {}, string>;
|
|
18
|
-
type List = InstanceType<typeof List>;
|
|
19
|
-
export default List;
|