@hyvor/design 2.0.8 → 2.0.9
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.
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
interface Props {
|
|
3
3
|
columns: string;
|
|
4
4
|
hover?: boolean;
|
|
5
|
+
style?: 'default' | 'bordered';
|
|
5
6
|
children?: import('svelte').Snippet;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
let { columns, hover = false, children }: Props = $props();
|
|
9
|
+
let { columns, hover = false, style = 'default', children }: Props = $props();
|
|
9
10
|
|
|
10
11
|
const hoverCss = hover ? '--local-hover-color: var(--hover);' : '';
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<div class="table" style="--local-columns: {columns};{hoverCss}" role="table">
|
|
14
|
+
<div class="table {style}" style="--local-columns: {columns};{hoverCss}" role="table">
|
|
14
15
|
{@render children?.()}
|
|
15
16
|
</div>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
.table.bordered {
|
|
20
|
+
border-radius: 20px;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
border: 1px solid var(--border);
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
head?: boolean;
|
|
6
|
+
section?: boolean;
|
|
6
7
|
children: Snippet;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
const { head = false, children, ...rest }: Props = $props();
|
|
10
|
+
const { head = false, section = false, children, ...rest }: Props = $props();
|
|
10
11
|
|
|
11
|
-
setContext('table-row', { head });
|
|
12
|
+
setContext('table-row', { head, section });
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
|
-
<div class:head {...rest} role="row">
|
|
15
|
+
<div class:head class:section {...rest} role="row">
|
|
15
16
|
{@render children()}
|
|
16
17
|
</div>
|
|
17
18
|
|
|
@@ -28,11 +29,37 @@
|
|
|
28
29
|
background: var(--accent-lightest);
|
|
29
30
|
margin-bottom: 5px;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
|
|
33
|
+
:global(.table.bordered) div {
|
|
34
|
+
border-radius: 0;
|
|
35
|
+
padding: 13px 20px;
|
|
36
|
+
border-top: 1px solid var(--border);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:global(.table.bordered) div.head {
|
|
40
|
+
background: var(--box-background);
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
font-size: 13px;
|
|
43
|
+
padding: 12px 20px;
|
|
44
|
+
margin-bottom: 0;
|
|
45
|
+
border-top: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
div:hover:not(.head, .section) {
|
|
32
49
|
background-color: var(--local-hover-color);
|
|
33
50
|
}
|
|
34
51
|
div > :global(*) {
|
|
35
52
|
padding-right: 5px;
|
|
36
53
|
word-wrap: break-word;
|
|
37
54
|
}
|
|
55
|
+
|
|
56
|
+
div.section {
|
|
57
|
+
background: var(--box-background);
|
|
58
|
+
font-size: 11px;
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
letter-spacing: 0.06em;
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
color: var(--text-light);
|
|
63
|
+
padding: 8px 20px;
|
|
64
|
+
}
|
|
38
65
|
</style>
|