@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.
@@ -67,20 +67,24 @@
67
67
  <Story name="Base">
68
68
  <Table>
69
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>
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
- {/each}
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<[{ C: { Tr: typeof Tr; Th: typeof Th; Td: typeof Td } }]>;
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
- C: {
9
- Tr: typeof Tr;
10
- Th: typeof Th;
11
- Td: typeof Td;
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,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ class?: string;
4
+ children?: Snippet;
5
+ }
6
+ declare const TBody: import("svelte").Component<Props, {}, "">;
7
+ type TBody = ReturnType<typeof TBody>;
8
+ export default 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>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ class?: string;
4
+ children?: Snippet;
5
+ }
6
+ declare const THead: import("svelte").Component<Props, {}, "">;
7
+ type THead = ReturnType<typeof THead>;
8
+ export default 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.34",
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",