luna-plus 0.0.58 → 0.0.59
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.
|
@@ -3,18 +3,38 @@
|
|
|
3
3
|
|
|
4
4
|
interface AsideProps {
|
|
5
5
|
width?: string
|
|
6
|
+
header?: Snippet
|
|
7
|
+
nav?: Snippet
|
|
8
|
+
footer?: Snippet
|
|
6
9
|
children?: Snippet
|
|
7
10
|
class?: string
|
|
8
11
|
}
|
|
9
12
|
|
|
10
|
-
let { width, children, class: cls = '', ...attrs }: AsideProps = $props()
|
|
13
|
+
let { width, header, nav, footer, children, class: cls = '', ...attrs }: AsideProps = $props()
|
|
11
14
|
|
|
15
|
+
const hasSlots = $derived(header || nav || footer)
|
|
12
16
|
const classes = $derived(cls ? `ln-aside ${cls}` : 'ln-aside')
|
|
13
17
|
const style = $derived(width ? `width: ${width}` : '')
|
|
14
18
|
</script>
|
|
15
19
|
|
|
16
20
|
<aside {...attrs} class={classes} {style}>
|
|
17
|
-
{#if
|
|
21
|
+
{#if hasSlots}
|
|
22
|
+
{#if header}
|
|
23
|
+
<div class="ln-aside__header">
|
|
24
|
+
{@render header()}
|
|
25
|
+
</div>
|
|
26
|
+
{/if}
|
|
27
|
+
{#if nav}
|
|
28
|
+
<nav class="ln-aside__nav">
|
|
29
|
+
{@render nav()}
|
|
30
|
+
</nav>
|
|
31
|
+
{/if}
|
|
32
|
+
{#if footer}
|
|
33
|
+
<div class="ln-aside__footer">
|
|
34
|
+
{@render footer()}
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
37
|
+
{:else if children}
|
|
18
38
|
{@render children()}
|
|
19
39
|
{/if}
|
|
20
40
|
</aside>
|