@functionalcms/svelte-components 5.1.0 → 5.1.4
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.
package/css/functional.css
CHANGED
|
@@ -10,15 +10,27 @@
|
|
|
10
10
|
SidebarGroup,
|
|
11
11
|
SidebarItem,
|
|
12
12
|
SidebarButton,
|
|
13
|
-
uiHelpers
|
|
13
|
+
uiHelpers,
|
|
14
|
+
SidebarBrand
|
|
14
15
|
} from 'flowbite-svelte';
|
|
15
16
|
|
|
16
17
|
interface TwoColumnLayoutProps {
|
|
17
18
|
children: Snippet;
|
|
18
19
|
menuItems: Array<MenuSection | MenuItem>;
|
|
20
|
+
logo: {
|
|
21
|
+
name: string;
|
|
22
|
+
href: string;
|
|
23
|
+
img: string;
|
|
24
|
+
};
|
|
25
|
+
sidebarPosition?: 'fixed' | 'absolute' | 'static';
|
|
19
26
|
}
|
|
20
27
|
|
|
21
|
-
let {
|
|
28
|
+
let {
|
|
29
|
+
children,
|
|
30
|
+
menuItems = [],
|
|
31
|
+
logo = undefined,
|
|
32
|
+
sidebarPosition = 'fixed'
|
|
33
|
+
}: Partial<TwoColumnLayoutProps> = $props();
|
|
22
34
|
|
|
23
35
|
let container: HTMLElement | undefined = undefined;
|
|
24
36
|
const helpers = uiHelpers();
|
|
@@ -27,16 +39,20 @@
|
|
|
27
39
|
});
|
|
28
40
|
</script>
|
|
29
41
|
|
|
30
|
-
<
|
|
42
|
+
<main class="" bind:this={container}>
|
|
31
43
|
<SidebarButton onclick={helpers.toggle} class="mb-2" />
|
|
44
|
+
|
|
32
45
|
<Sidebar
|
|
33
46
|
backdrop={false}
|
|
34
47
|
isOpen={helpers.isOpen}
|
|
35
48
|
closeSidebar={helpers.close}
|
|
36
|
-
position=
|
|
49
|
+
position={sidebarPosition}
|
|
37
50
|
class="z-50 h-full"
|
|
38
51
|
>
|
|
39
52
|
<SidebarGroup>
|
|
53
|
+
{#if logo}
|
|
54
|
+
<SidebarBrand site={logo} classes={{ img: 'h-6 w-6' }} />
|
|
55
|
+
{/if}
|
|
40
56
|
{#each menuItems as item}
|
|
41
57
|
{#if 'items' in item}
|
|
42
58
|
<SidebarDropdownWrapper label={item.label}>
|
|
@@ -54,10 +70,10 @@
|
|
|
54
70
|
{/each}
|
|
55
71
|
</SidebarGroup>
|
|
56
72
|
</Sidebar>
|
|
57
|
-
<div class="content" style:flex="1">
|
|
73
|
+
<div class="content h-full overflow-auto px-4 md:ml-64" style:flex="1">
|
|
58
74
|
{@render children?.()}
|
|
59
75
|
</div>
|
|
60
|
-
</
|
|
76
|
+
</main>
|
|
61
77
|
|
|
62
78
|
<style>
|
|
63
79
|
</style>
|
|
@@ -3,6 +3,12 @@ import type { MenuItem, MenuSection } from './menuItems.js';
|
|
|
3
3
|
declare const MenuLayout: import("svelte").Component<Partial<{
|
|
4
4
|
children: Snippet;
|
|
5
5
|
menuItems: Array<MenuSection | MenuItem>;
|
|
6
|
+
logo: {
|
|
7
|
+
name: string;
|
|
8
|
+
href: string;
|
|
9
|
+
img: string;
|
|
10
|
+
};
|
|
11
|
+
sidebarPosition?: "fixed" | "absolute" | "static";
|
|
6
12
|
}>, {}, "">;
|
|
7
13
|
type MenuLayout = ReturnType<typeof MenuLayout>;
|
|
8
14
|
export default MenuLayout;
|