@reshape-biotech/design-system 0.0.22 → 0.0.24
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 +30 -38
- package/dist/components/banner/Banner.stories.svelte +129 -0
- package/dist/components/banner/Banner.stories.svelte.d.ts +19 -0
- package/dist/components/banner/Banner.svelte +59 -0
- package/dist/components/banner/Banner.svelte.d.ts +11 -0
- package/dist/components/button/Button.stories.svelte +37 -0
- package/dist/components/button/Button.stories.svelte.d.ts +19 -0
- package/dist/components/button/Button.svelte +85 -0
- package/dist/components/button/Button.svelte.d.ts +17 -0
- package/dist/components/datepicker/DatePicker.svelte +283 -0
- package/dist/components/datepicker/DatePicker.svelte.d.ts +8 -0
- package/dist/components/divider/Divider.stories.svelte +14 -0
- package/dist/components/divider/Divider.stories.svelte.d.ts +27 -0
- package/dist/components/divider/Divider.svelte +9 -0
- package/dist/components/divider/Divider.svelte.d.ts +6 -0
- package/dist/components/drawer/Drawer.stories.svelte +99 -0
- package/dist/components/drawer/Drawer.stories.svelte.d.ts +27 -0
- package/dist/components/drawer/Drawer.svelte +45 -0
- package/dist/components/drawer/Drawer.svelte.d.ts +12 -0
- package/dist/components/drawer/DrawerLabel.svelte +13 -0
- package/dist/components/drawer/DrawerLabel.svelte.d.ts +9 -0
- package/dist/components/dropdown/Dropdown.stories.svelte +214 -0
- package/dist/components/dropdown/Dropdown.stories.svelte.d.ts +27 -0
- package/dist/components/dropdown/Dropdown.svelte +69 -0
- package/dist/components/dropdown/Dropdown.svelte.d.ts +14 -0
- package/dist/components/dropdown/components/DropdownContent.svelte +29 -0
- package/dist/components/dropdown/components/DropdownContent.svelte.d.ts +10 -0
- package/dist/components/dropdown/components/DropdownMenu.svelte +23 -0
- package/dist/components/dropdown/components/DropdownMenu.svelte.d.ts +8 -0
- package/dist/components/dropdown/components/DropdownTrigger.svelte +44 -0
- package/dist/components/dropdown/components/DropdownTrigger.svelte.d.ts +12 -0
- package/dist/components/icon-button/IconButton.stories.svelte +52 -0
- package/dist/components/icon-button/IconButton.stories.svelte.d.ts +19 -0
- package/dist/components/icon-button/IconButton.svelte +71 -0
- package/dist/components/icon-button/IconButton.svelte.d.ts +14 -0
- package/dist/components/image/Image.svelte +56 -0
- package/dist/components/image/Image.svelte.d.ts +7 -0
- package/dist/components/input/Input.stories.svelte +81 -0
- package/dist/components/input/Input.stories.svelte.d.ts +27 -0
- package/dist/components/input/Input.svelte +131 -0
- package/dist/components/input/Input.svelte.d.ts +20 -0
- package/dist/components/list/List.stories.svelte +97 -0
- package/dist/components/list/List.stories.svelte.d.ts +19 -0
- package/dist/components/list/List.svelte +75 -0
- package/dist/components/list/List.svelte.d.ts +24 -0
- package/dist/components/markdown/Markdown.stories.svelte +41 -0
- package/dist/components/markdown/Markdown.stories.svelte.d.ts +27 -0
- package/dist/components/markdown/Markdown.svelte +12 -0
- package/dist/components/markdown/Markdown.svelte.d.ts +6 -0
- package/dist/components/modal/Modal.stories.svelte +41 -0
- package/dist/components/modal/Modal.stories.svelte.d.ts +19 -0
- package/dist/components/modal/Modal.svelte +56 -0
- package/dist/components/modal/Modal.svelte.d.ts +16 -0
- package/dist/components/notification-popup/NotificationPopup.stories.svelte +27 -0
- package/dist/components/notification-popup/NotificationPopup.stories.svelte.d.ts +27 -0
- package/dist/components/notification-popup/NotificationPopup.svelte +31 -0
- package/dist/components/notification-popup/NotificationPopup.svelte.d.ts +11 -0
- package/dist/components/pill/Pill.svelte +39 -0
- package/dist/components/pill/Pill.svelte.d.ts +10 -0
- package/dist/components/progress-circle/ProgressCircle.svelte +79 -0
- package/dist/components/progress-circle/ProgressCircle.svelte.d.ts +7 -0
- package/dist/components/segmented-control-buttons/ControlButton.svelte +59 -0
- package/dist/components/segmented-control-buttons/ControlButton.svelte.d.ts +14 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +45 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte.d.ts +19 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +21 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte.d.ts +10 -0
- package/dist/components/select/Select.stories.svelte +113 -0
- package/dist/components/select/Select.stories.svelte.d.ts +19 -0
- package/dist/components/select/Select.svelte +137 -0
- package/dist/components/select/Select.svelte.d.ts +60 -0
- package/dist/components/select/index.d.ts +6 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/skeleton-loader/HorizontalCardSkeleton.svelte +31 -0
- package/dist/components/skeleton-loader/HorizontalCardSkeleton.svelte.d.ts +5 -0
- package/dist/components/skeleton-loader/ProjectCardSkeleton.svelte +12 -0
- package/dist/components/skeleton-loader/ProjectCardSkeleton.svelte.d.ts +18 -0
- package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte +71 -0
- package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte.d.ts +27 -0
- package/dist/components/skeleton-loader/SkeletonLoader.svelte +17 -0
- package/dist/components/skeleton-loader/SkeletonLoader.svelte.d.ts +9 -0
- package/dist/components/skeleton-loader/StatcardSkeleton.svelte +17 -0
- package/dist/components/skeleton-loader/StatcardSkeleton.svelte.d.ts +18 -0
- package/dist/components/skeleton-loader/components/Skeleton.svelte +14 -0
- package/dist/components/skeleton-loader/components/Skeleton.svelte.d.ts +8 -0
- package/dist/components/skeleton-loader/components/SkeletonImage.svelte +14 -0
- package/dist/components/skeleton-loader/components/SkeletonImage.svelte.d.ts +26 -0
- package/dist/components/skeleton-loader/index.d.ts +5 -0
- package/dist/components/skeleton-loader/index.js +5 -0
- package/dist/components/slider/Slider.stories.svelte +37 -0
- package/dist/components/slider/Slider.stories.svelte.d.ts +27 -0
- package/dist/components/slider/Slider.svelte +117 -0
- package/dist/components/slider/Slider.svelte.d.ts +29 -0
- package/dist/components/spinner/Spinner.svelte +27 -0
- package/dist/components/spinner/Spinner.svelte.d.ts +6 -0
- package/dist/components/stat-card/StatCard.stories.svelte +31 -0
- package/dist/components/stat-card/StatCard.stories.svelte.d.ts +27 -0
- package/dist/components/stat-card/StatCard.svelte +46 -0
- package/dist/components/stat-card/StatCard.svelte.d.ts +9 -0
- package/dist/components/status-badge/StatusBadge.stories.svelte +401 -0
- package/dist/components/status-badge/StatusBadge.stories.svelte.d.ts +19 -0
- package/dist/components/status-badge/StatusBadge.svelte +147 -0
- package/dist/components/status-badge/StatusBadge.svelte.d.ts +12 -0
- package/dist/components/table/Table.stories.svelte +86 -0
- package/dist/components/table/Table.stories.svelte.d.ts +24 -0
- package/dist/components/table/Table.svelte +33 -0
- package/dist/components/table/Table.svelte.d.ts +8 -0
- package/dist/components/table/components/Td.svelte +14 -0
- package/dist/components/table/components/Td.svelte.d.ts +8 -0
- package/dist/components/table/components/Th.svelte +15 -0
- package/dist/components/table/components/Th.svelte.d.ts +9 -0
- package/dist/components/table/components/Tr.svelte +31 -0
- package/dist/components/table/components/Tr.svelte.d.ts +8 -0
- package/dist/components/tabs/Tabs.stories.svelte +30 -0
- package/dist/components/tabs/Tabs.stories.svelte.d.ts +27 -0
- package/dist/components/tabs/Tabs.svelte +15 -0
- package/dist/components/tabs/Tabs.svelte.d.ts +8 -0
- package/dist/components/tabs/components/Content.svelte +15 -0
- package/dist/components/tabs/components/Content.svelte.d.ts +9 -0
- package/dist/components/tabs/components/Tab.svelte +21 -0
- package/dist/components/tabs/components/Tab.svelte.d.ts +10 -0
- package/dist/components/tabs/components/Tabs.svelte +14 -0
- package/dist/components/tabs/components/Tabs.svelte.d.ts +8 -0
- package/dist/components/tag/Tag.stories.svelte +50 -0
- package/dist/components/tag/Tag.stories.svelte.d.ts +19 -0
- package/dist/components/tag/Tag.svelte +104 -0
- package/dist/components/tag/Tag.svelte.d.ts +11 -0
- package/dist/components/toast/Toast.svelte +66 -0
- package/dist/components/toast/Toast.svelte.d.ts +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tailwind-safelist.d.ts +14 -0
- package/dist/tailwind-safelist.js +148 -0
- package/dist/tailwind.preset.d.ts +1 -0
- package/dist/tokens.d.ts +314 -36
- package/dist/tokens.js +235 -248
- package/package.json +5 -6
- package/dist/tailwind-safelist.txt +0 -142
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import StatusBadge from 'design-system/components/status-badge/StatusBadge.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 StatusBadge: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type StatusBadge = InstanceType<typeof StatusBadge>;
|
|
19
|
+
export default StatusBadge;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
// we can add dynamic classes because they are safelisted in tailwind-safelist.txt
|
|
6
|
+
type?: 'neutral' | 'success' | 'progress' | 'warning' | 'error';
|
|
7
|
+
size?: 'md' | 'sm';
|
|
8
|
+
content?: Snippet;
|
|
9
|
+
progress?: Snippet;
|
|
10
|
+
icon?: Snippet;
|
|
11
|
+
iconOnly?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
type = 'neutral',
|
|
16
|
+
size = 'md',
|
|
17
|
+
content,
|
|
18
|
+
progress,
|
|
19
|
+
icon,
|
|
20
|
+
iconOnly: propIconOnly = false
|
|
21
|
+
}: Props = $props();
|
|
22
|
+
|
|
23
|
+
let iconOnly = $derived((content === undefined && progress === undefined) || propIconOnly);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
class={`badge badge-${type} badge-${size}`}
|
|
28
|
+
class:badge-icon-only={iconOnly}
|
|
29
|
+
data-testid="status-badge"
|
|
30
|
+
>
|
|
31
|
+
<div class={`icon`}>
|
|
32
|
+
{@render icon?.()}
|
|
33
|
+
</div>
|
|
34
|
+
<div class="gap-2">
|
|
35
|
+
{@render content?.()}
|
|
36
|
+
{@render progress?.()}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<style>
|
|
41
|
+
.badge {
|
|
42
|
+
gap: 0.5rem;
|
|
43
|
+
border-style: none;
|
|
44
|
+
--tw-text-opacity: 1;
|
|
45
|
+
color: rgb(18 25 42 / var(--tw-text-opacity, 1))
|
|
46
|
+
}
|
|
47
|
+
.badge-md {
|
|
48
|
+
height: 2rem;
|
|
49
|
+
padding-top: 0.5rem;
|
|
50
|
+
padding-bottom: 0.5rem;
|
|
51
|
+
padding-left: 0.5rem;
|
|
52
|
+
padding-right: 0.75rem
|
|
53
|
+
}
|
|
54
|
+
.badge-md .icon {
|
|
55
|
+
width: 1.25rem;
|
|
56
|
+
height: 1.25rem
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.badge-sm {
|
|
60
|
+
height: 1.5rem;
|
|
61
|
+
gap: 0.25rem;
|
|
62
|
+
padding-left: 0.25rem;
|
|
63
|
+
padding-right: 0.5rem
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.badge-sm .icon {
|
|
67
|
+
width: 1rem;
|
|
68
|
+
height: 1rem
|
|
69
|
+
}
|
|
70
|
+
.badge-icon-only {
|
|
71
|
+
width: 2rem;
|
|
72
|
+
height: 2rem;
|
|
73
|
+
gap: 0px;
|
|
74
|
+
padding: 0px
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.badge-sm.badge-icon-only {
|
|
78
|
+
width: 1.5rem;
|
|
79
|
+
height: 1.5rem;
|
|
80
|
+
padding: 0px
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.badge-neutral {
|
|
84
|
+
background-color: #12192a0d
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.badge-neutral:hover {
|
|
88
|
+
background-color: #12192A1A
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.badge-neutral .icon {
|
|
92
|
+
--tw-text-opacity: 1;
|
|
93
|
+
color: rgb(136 140 148 / var(--tw-text-opacity, 1))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.badge-success {
|
|
97
|
+
background-color: #0aad6e1A
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.badge-success:hover {
|
|
101
|
+
background-color: #0aad6e40
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.badge-success .icon {
|
|
105
|
+
--tw-text-opacity: 1;
|
|
106
|
+
color: rgb(10 173 110 / var(--tw-text-opacity, 1))
|
|
107
|
+
}
|
|
108
|
+
.badge-progress {
|
|
109
|
+
background-color: #5750ee1A
|
|
110
|
+
}
|
|
111
|
+
.badge-progress:hover {
|
|
112
|
+
background-color: #5750ee40
|
|
113
|
+
}
|
|
114
|
+
.badge-progress .icon {
|
|
115
|
+
--tw-text-opacity: 1;
|
|
116
|
+
color: rgb(71 65 193 / var(--tw-text-opacity, 1))
|
|
117
|
+
}
|
|
118
|
+
.badge-warning {
|
|
119
|
+
background-color: #f1b1231A
|
|
120
|
+
}
|
|
121
|
+
.badge-warning:hover {
|
|
122
|
+
background-color: #f1b12340
|
|
123
|
+
}
|
|
124
|
+
.badge-warning .icon {
|
|
125
|
+
--tw-text-opacity: 1;
|
|
126
|
+
color: rgb(241 177 35 / var(--tw-text-opacity, 1))
|
|
127
|
+
}
|
|
128
|
+
.badge-error {
|
|
129
|
+
background-color: #eb46471A
|
|
130
|
+
}
|
|
131
|
+
.badge-error:hover {
|
|
132
|
+
background-color: #eb464740
|
|
133
|
+
}
|
|
134
|
+
.badge-error .icon {
|
|
135
|
+
--tw-text-opacity: 1;
|
|
136
|
+
color: rgb(235 70 71 / var(--tw-text-opacity, 1))
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:global(.badge > div) {
|
|
140
|
+
display: flex;
|
|
141
|
+
height: 100%;
|
|
142
|
+
flex-direction: row;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
white-space: nowrap
|
|
146
|
+
}
|
|
147
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
type?: 'neutral' | 'success' | 'progress' | 'warning' | 'error';
|
|
4
|
+
size?: 'md' | 'sm';
|
|
5
|
+
content?: Snippet;
|
|
6
|
+
progress?: Snippet;
|
|
7
|
+
icon?: Snippet;
|
|
8
|
+
iconOnly?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const StatusBadge: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type StatusBadge = ReturnType<typeof StatusBadge>;
|
|
12
|
+
export default StatusBadge;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import Table from './Table.svelte';
|
|
3
|
+
|
|
4
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
component: Table,
|
|
7
|
+
title: 'Design System/Table',
|
|
8
|
+
tags: ['autodocs']
|
|
9
|
+
});
|
|
10
|
+
import IconButton from 'design-system/components/icon-button/IconButton.svelte';
|
|
11
|
+
import { Phone } from 'phosphor-svelte';
|
|
12
|
+
|
|
13
|
+
export const users = [
|
|
14
|
+
{
|
|
15
|
+
name: 'John Doe',
|
|
16
|
+
age: 25,
|
|
17
|
+
role: 'admin'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Jane Smith',
|
|
21
|
+
age: 32,
|
|
22
|
+
role: 'member'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Michael Johnson',
|
|
26
|
+
age: 41,
|
|
27
|
+
role: 'deactivated'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Emily Brown',
|
|
31
|
+
age: 28,
|
|
32
|
+
role: 'member'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'David Lee',
|
|
36
|
+
age: 37,
|
|
37
|
+
role: 'admin'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Sarah Wilson',
|
|
41
|
+
age: 29,
|
|
42
|
+
role: 'member'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Robert Taylor',
|
|
46
|
+
age: 45,
|
|
47
|
+
role: 'deactivated'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Lisa Anderson',
|
|
51
|
+
age: 33,
|
|
52
|
+
role: 'member'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'James Martinez',
|
|
56
|
+
age: 39,
|
|
57
|
+
role: 'admin'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Jennifer Garcia',
|
|
61
|
+
age: 31,
|
|
62
|
+
role: 'deactivated'
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<Story name="Base">
|
|
68
|
+
<Table>
|
|
69
|
+
{#snippet children({ C })}
|
|
70
|
+
<C.Tr>
|
|
71
|
+
<C.Th>Name</C.Th>
|
|
72
|
+
<C.Th>Age</C.Th>
|
|
73
|
+
<C.Th class="w-[100px]">Role</C.Th>
|
|
74
|
+
<C.Th class="w-6"></C.Th>
|
|
75
|
+
</C.Tr>
|
|
76
|
+
{#each users as user}
|
|
77
|
+
<C.Tr disabled={user.role === 'deactivated'}>
|
|
78
|
+
<C.Td>{user.name}</C.Td>
|
|
79
|
+
<C.Td>{user.age}</C.Td>
|
|
80
|
+
<C.Td>{user.role}</C.Td>
|
|
81
|
+
<C.Td><IconButton disabled={user.role === 'deactivated'}><Phone /></IconButton></C.Td>
|
|
82
|
+
</C.Tr>
|
|
83
|
+
{/each}
|
|
84
|
+
{/snippet}
|
|
85
|
+
</Table>
|
|
86
|
+
</Story>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Table from './Table.svelte';
|
|
2
|
+
export declare const users: {
|
|
3
|
+
name: string;
|
|
4
|
+
age: number;
|
|
5
|
+
role: string;
|
|
6
|
+
}[];
|
|
7
|
+
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> {
|
|
8
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
9
|
+
$$bindings?: Bindings;
|
|
10
|
+
} & Exports;
|
|
11
|
+
(internal: unknown, props: {
|
|
12
|
+
$$events?: Events;
|
|
13
|
+
$$slots?: Slots;
|
|
14
|
+
}): Exports & {
|
|
15
|
+
$set?: any;
|
|
16
|
+
$on?: any;
|
|
17
|
+
};
|
|
18
|
+
z_$$bindings?: Bindings;
|
|
19
|
+
}
|
|
20
|
+
declare const Table: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type Table = InstanceType<typeof Table>;
|
|
24
|
+
export default Table;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import Td from './components/Td.svelte';
|
|
4
|
+
import Th from './components/Th.svelte';
|
|
5
|
+
import Tr from './components/Tr.svelte';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
tableLayout?: 'fixed' | 'auto';
|
|
9
|
+
children?: Snippet<[any]>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { tableLayout = 'fixed', children }: Props = $props();
|
|
13
|
+
const C = {
|
|
14
|
+
Tr: Tr,
|
|
15
|
+
Th: Th,
|
|
16
|
+
Td: Td
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div class="w-full rounded-lg bg-surface px-6 pb-1 pt-3">
|
|
21
|
+
<table class={`w-full table-fixed sm:table-auto xl:table-${tableLayout}`}>
|
|
22
|
+
{@render children?.({ C })}
|
|
23
|
+
</table>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
:global(tr) {
|
|
28
|
+
border-bottom-width: 1px
|
|
29
|
+
}
|
|
30
|
+
:global(tr):last-child {
|
|
31
|
+
border-bottom-width: 0px
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
dataTestId?: string;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { dataTestId = '', children }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<td data-testid={dataTestId} class={`text-left text-sm font-normal`}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</td>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Width } from '../../../tailwind';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
class?: Width | '';
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { class: className = '', children }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<th class={`text-left text-xs font-normal text-secondary ${className}`}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</th>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Width } from '../../../tailwind';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
interface Props {
|
|
4
|
+
class?: Width | '';
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
}
|
|
7
|
+
declare const Th: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type Th = ReturnType<typeof Th>;
|
|
9
|
+
export default Th;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { disabled = false, children }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<tr class="my-2 border-static [&.disabled]:text-tertiary" class:disabled>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</tr>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
:global(td) {
|
|
18
|
+
padding-top: 1rem;
|
|
19
|
+
padding-bottom: 1rem
|
|
20
|
+
}
|
|
21
|
+
:global(td):first-child {
|
|
22
|
+
padding-left: 0.5rem
|
|
23
|
+
}
|
|
24
|
+
:global(th) {
|
|
25
|
+
padding-top: 1rem;
|
|
26
|
+
padding-bottom: 1rem
|
|
27
|
+
}
|
|
28
|
+
:global(th):first-child {
|
|
29
|
+
padding-left: 0.5rem
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import Tabs from './Tabs.svelte';
|
|
3
|
+
|
|
4
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
component: Tabs,
|
|
7
|
+
title: 'Design System/Tabs',
|
|
8
|
+
tags: ['autodocs']
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
let activeTab = 'tab-1';
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Primary">
|
|
15
|
+
<Tabs>
|
|
16
|
+
{#snippet children({ C })}
|
|
17
|
+
<C.Tabs>
|
|
18
|
+
<C.Tab active={activeTab === 'tab-1'} onClick={() => (activeTab = 'tab-1')}>Tab 1</C.Tab>
|
|
19
|
+
<C.Tab active={activeTab === 'tab-2'} onClick={() => (activeTab = 'tab-2')}>Tab 2</C.Tab>
|
|
20
|
+
<C.Tab active={activeTab === 'tab-3'} onClick={() => (activeTab = 'tab-3')}>Tab 3</C.Tab>
|
|
21
|
+
</C.Tabs>
|
|
22
|
+
|
|
23
|
+
<C.Content show={activeTab === 'tab-1'}>Showing tab 1 content</C.Content>
|
|
24
|
+
|
|
25
|
+
<C.Content show={activeTab === 'tab-2'}>Showing tab 2 content</C.Content>
|
|
26
|
+
|
|
27
|
+
<C.Content show={activeTab === 'tab-3'}>Showing tab 3 content</C.Content>
|
|
28
|
+
{/snippet}
|
|
29
|
+
</Tabs>
|
|
30
|
+
</Story>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default Tabs;
|
|
2
|
+
type Tabs = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Tabs: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
import Tabs from './Tabs.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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import Content from './components/Content.svelte';
|
|
4
|
+
import Tab from './components/Tab.svelte';
|
|
5
|
+
import Tabs from './components/Tabs.svelte';
|
|
6
|
+
interface Props {
|
|
7
|
+
children?: Snippet<[any]>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { children }: Props = $props();
|
|
11
|
+
|
|
12
|
+
const C = { Tabs, Tab, Content };
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{@render children?.({ C })}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string;
|
|
6
|
+
show?: boolean;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { class: className = '', show = false, children }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div class:hidden={!show} class={className}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from 'design-system/components/button/Button.svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
interface Props {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
class?: string;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { active = false, onClick, class: className = '', children }: Props = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Button
|
|
15
|
+
{onClick}
|
|
16
|
+
variant="transparent"
|
|
17
|
+
size="md"
|
|
18
|
+
class={`tab flex !h-10 gap-2 !rounded-md !px-0 !py-0 ${active ? 'tab-active' : ''} ${className}`}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</Button>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
class?: string;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
declare const Tab: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type Tab = ReturnType<typeof Tab>;
|
|
10
|
+
export default Tab;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className = '', children }: Props = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div role="tablist" class={`tabs-boxed tabs h-[48px] gap-1 rounded-lg ${className}`}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { Folder } from 'phosphor-svelte';
|
|
3
|
+
import Tag from './Tag.svelte';
|
|
4
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
component: Tag,
|
|
7
|
+
title: 'Design System/Tag',
|
|
8
|
+
tags: ['autodocs']
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Story name="Default">
|
|
13
|
+
<div class="w-fit">
|
|
14
|
+
<Tag>Default</Tag>
|
|
15
|
+
</div>
|
|
16
|
+
</Story>
|
|
17
|
+
<Story name="Default small">
|
|
18
|
+
<div class="w-fit">
|
|
19
|
+
<Tag variant="default" size="sm">Default</Tag>
|
|
20
|
+
</div>
|
|
21
|
+
</Story>
|
|
22
|
+
<Story name="Default onclick">
|
|
23
|
+
<div class="w-fit">
|
|
24
|
+
<Tag onclick={() => {}}>Default</Tag>
|
|
25
|
+
</div>
|
|
26
|
+
</Story>
|
|
27
|
+
<Story name="Default icon onclick">
|
|
28
|
+
<div class="w-fit">
|
|
29
|
+
<Tag onclick={() => {}}>
|
|
30
|
+
<Folder />
|
|
31
|
+
Default
|
|
32
|
+
</Tag>
|
|
33
|
+
</div>
|
|
34
|
+
</Story>
|
|
35
|
+
|
|
36
|
+
<Story name="Transparent">
|
|
37
|
+
<div class="w-fit">
|
|
38
|
+
<Tag variant="transparent">Transparent</Tag>
|
|
39
|
+
</div>
|
|
40
|
+
</Story>
|
|
41
|
+
<Story name="Transparent small">
|
|
42
|
+
<div class="w-fit">
|
|
43
|
+
<Tag variant="transparent" size="sm">Transparent</Tag>
|
|
44
|
+
</div>
|
|
45
|
+
</Story>
|
|
46
|
+
<Story name="Transparent onclick">
|
|
47
|
+
<div class="w-fit">
|
|
48
|
+
<Tag variant="transparent" onclick={() => {}}>Transparent</Tag>
|
|
49
|
+
</div>
|
|
50
|
+
</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Tag from './Tag.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 Tag: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Tag = InstanceType<typeof Tag>;
|
|
19
|
+
export default Tag;
|