@reshape-biotech/design-system 0.0.34 → 0.0.36
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/table/Table.stories.svelte +17 -13
- package/dist/components/table/Table.svelte +17 -1
- package/dist/components/table/Table.svelte.d.ts +13 -7
- package/dist/components/table/components/TBody.svelte +14 -0
- package/dist/components/table/components/TBody.svelte.d.ts +8 -0
- package/dist/components/table/components/THead.svelte +14 -0
- package/dist/components/table/components/THead.svelte.d.ts +8 -0
- package/dist/tailwind-safelist.js +4 -1
- package/package.json +2 -1
|
@@ -67,20 +67,24 @@
|
|
|
67
67
|
<Story name="Base">
|
|
68
68
|
<Table>
|
|
69
69
|
{#snippet children({ C })}
|
|
70
|
-
<C.
|
|
71
|
-
<C.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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>
|
|
70
|
+
<C.THead>
|
|
71
|
+
<C.Tr>
|
|
72
|
+
<C.Th>Name</C.Th>
|
|
73
|
+
<C.Th>Age</C.Th>
|
|
74
|
+
<C.Th class="w-[100px]">Role</C.Th>
|
|
75
|
+
<C.Th class="w-6"></C.Th>
|
|
82
76
|
</C.Tr>
|
|
83
|
-
|
|
77
|
+
</C.THead>
|
|
78
|
+
<C.TBody>
|
|
79
|
+
{#each users as user}
|
|
80
|
+
<C.Tr disabled={user.role === 'deactivated'}>
|
|
81
|
+
<C.Td>{user.name}</C.Td>
|
|
82
|
+
<C.Td>{user.age}</C.Td>
|
|
83
|
+
<C.Td>{user.role}</C.Td>
|
|
84
|
+
<C.Td><IconButton disabled={user.role === 'deactivated'}><Phone /></IconButton></C.Td>
|
|
85
|
+
</C.Tr>
|
|
86
|
+
{/each}
|
|
87
|
+
</C.TBody>
|
|
84
88
|
{/snippet}
|
|
85
89
|
</Table>
|
|
86
90
|
</Story>
|
|
@@ -3,14 +3,30 @@
|
|
|
3
3
|
import Td from './components/Td.svelte';
|
|
4
4
|
import Th from './components/Th.svelte';
|
|
5
5
|
import Tr from './components/Tr.svelte';
|
|
6
|
+
import THead from './components/THead.svelte';
|
|
7
|
+
import TBody from './components/TBody.svelte';
|
|
6
8
|
|
|
7
9
|
interface Props {
|
|
8
10
|
tableLayout?: 'fixed' | 'auto';
|
|
9
|
-
children?: Snippet<
|
|
11
|
+
children?: Snippet<
|
|
12
|
+
[
|
|
13
|
+
{
|
|
14
|
+
C: {
|
|
15
|
+
THead: typeof THead;
|
|
16
|
+
TBody: typeof TBody;
|
|
17
|
+
Tr: typeof Tr;
|
|
18
|
+
Th: typeof Th;
|
|
19
|
+
Td: typeof Td;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
>;
|
|
10
24
|
}
|
|
11
25
|
|
|
12
26
|
let { tableLayout = 'fixed', children }: Props = $props();
|
|
13
27
|
const C = {
|
|
28
|
+
THead: THead,
|
|
29
|
+
TBody: TBody,
|
|
14
30
|
Tr: Tr,
|
|
15
31
|
Th: Th,
|
|
16
32
|
Td: Td
|
|
@@ -2,15 +2,21 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import Td from './components/Td.svelte';
|
|
3
3
|
import Th from './components/Th.svelte';
|
|
4
4
|
import Tr from './components/Tr.svelte';
|
|
5
|
+
import THead from './components/THead.svelte';
|
|
6
|
+
import TBody from './components/TBody.svelte';
|
|
5
7
|
interface Props {
|
|
6
8
|
tableLayout?: 'fixed' | 'auto';
|
|
7
|
-
children?: Snippet<[
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
children?: Snippet<[
|
|
10
|
+
{
|
|
11
|
+
C: {
|
|
12
|
+
THead: typeof THead;
|
|
13
|
+
TBody: typeof TBody;
|
|
14
|
+
Tr: typeof Tr;
|
|
15
|
+
Th: typeof Th;
|
|
16
|
+
Td: typeof Td;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
]>;
|
|
14
20
|
}
|
|
15
21
|
declare const Table: import("svelte").Component<Props, {}, "">;
|
|
16
22
|
type Table = ReturnType<typeof Table>;
|
|
@@ -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
|
+
<tbody class={`${className}`}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</tbody>
|
|
@@ -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
|
+
<thead class={`${className}`}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</thead>
|
|
@@ -100,7 +100,7 @@ export const textSizes = [
|
|
|
100
100
|
'text-4xl'
|
|
101
101
|
];
|
|
102
102
|
|
|
103
|
-
export const fonts = ['font-medium', 'font-semibold', 'font-bold'];
|
|
103
|
+
export const fonts = ['font-medium', 'font-semibold', 'font-bold', 'font-normal'];
|
|
104
104
|
|
|
105
105
|
export const badges = [
|
|
106
106
|
'badge-neutral',
|
|
@@ -152,6 +152,9 @@ export const flexLayout = [
|
|
|
152
152
|
'flex-1',
|
|
153
153
|
'flex-row',
|
|
154
154
|
'flex-col',
|
|
155
|
+
'text-left',
|
|
156
|
+
'text-right',
|
|
157
|
+
'text-center',
|
|
155
158
|
'gap-1',
|
|
156
159
|
'gap-2',
|
|
157
160
|
'gap-3',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reshape-biotech/design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"svelte-check": "^4.0.0",
|
|
66
66
|
"svelte-select": "^5.8.1",
|
|
67
67
|
"tailwindcss": "^3.4.9",
|
|
68
|
+
"tailwindest": "^2.3.0",
|
|
68
69
|
"typescript": "^5.0.0",
|
|
69
70
|
"typescript-eslint": "^8.0.0",
|
|
70
71
|
"vite": "^5.4.4",
|