@hyvor/design 1.0.7 → 1.0.8

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.
@@ -10,12 +10,6 @@
10
10
  const hoverCss = hover ? '--local-hover-color: var(--hover);' : '';
11
11
  </script>
12
12
 
13
- <div
14
- class="table"
15
- style="
16
- --local-columns: {columns};
17
- {hoverCss}
18
- "
19
- >
13
+ <div class="table" style="--local-columns: {columns};{hoverCss}" role="table">
20
14
  {@render children?.()}
21
15
  </div>
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { getContext, type Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ children: Snippet;
6
+ [key: string]: any;
7
+ }
8
+
9
+ let { children, ...rest }: Props = $props();
10
+
11
+ const { head } = getContext<{ head: boolean }>('table-row');
12
+ </script>
13
+
14
+ <div role={head ? 'columnheader' : 'cell'} {...rest}>
15
+ {@render children()}
16
+ </div>
@@ -0,0 +1,8 @@
1
+ import { type Snippet } from 'svelte';
2
+ interface Props {
3
+ children: Snippet;
4
+ [key: string]: any;
5
+ }
6
+ declare const TableCell: import("svelte").Component<Props, {}, "">;
7
+ type TableCell = ReturnType<typeof TableCell>;
8
+ export default TableCell;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { Snippet } from 'svelte';
2
+ import { setContext, type Snippet } from 'svelte';
3
3
 
4
4
  interface Props {
5
5
  head?: boolean;
@@ -7,9 +7,11 @@
7
7
  }
8
8
 
9
9
  const { head = false, children, ...rest }: Props = $props();
10
+
11
+ setContext('table-row', { head });
10
12
  </script>
11
13
 
12
- <div class:head {...rest}>
14
+ <div class:head {...rest} role="row">
13
15
  {@render children()}
14
16
  </div>
15
17
 
@@ -1,4 +1,4 @@
1
- import type { Snippet } from 'svelte';
1
+ import { type Snippet } from 'svelte';
2
2
  interface Props {
3
3
  head?: boolean;
4
4
  children: Snippet;
package/package.json CHANGED
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "version": "1.0.7"
60
+ "version": "1.0.8"
61
61
  }