@hyvor/design 1.0.6 → 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.
@@ -102,7 +102,7 @@
102
102
  </div>
103
103
 
104
104
  <div class="close-wrap">
105
- <IconButton variant="invisible" on:click={handleCancel}>
105
+ <IconButton variant="invisible" on:click={handleCancel} aria-label="Close modal">
106
106
  <IconX size={25} />
107
107
  </IconButton>
108
108
  </div>
@@ -10,12 +10,27 @@
10
10
  flex?: number[];
11
11
  children?: Snippet;
12
12
  nested?: Snippet;
13
+ [key: string]: any;
13
14
  }
14
15
 
15
- const { label, caption, column = false, flex = [1, 2], children, nested }: Props = $props();
16
+ const {
17
+ label,
18
+ caption,
19
+ column = false,
20
+ flex = [1, 2],
21
+ children,
22
+ nested,
23
+ ...rest
24
+ }: Props = $props();
16
25
  </script>
17
26
 
18
- <div class="split-control" class:has-nested={!!nested} class:column>
27
+ <div
28
+ class="split-control"
29
+ class:has-nested={!!nested}
30
+ class:column
31
+ aria-label={typeof label === 'string' ? label : undefined}
32
+ {...rest}
33
+ >
19
34
  <div class="left" style:flex={flex[0]}>
20
35
  <div class="label-wrap">
21
36
  {#if typeof label === 'string'}
@@ -6,6 +6,7 @@ interface Props {
6
6
  flex?: number[];
7
7
  children?: Snippet;
8
8
  nested?: Snippet;
9
+ [key: string]: any;
9
10
  }
10
11
  declare const SplitControl: import("svelte").Component<Props, {}, "">;
11
12
  type SplitControl = ReturnType<typeof SplitControl>;
@@ -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.6"
60
+ "version": "1.0.8"
61
61
  }