@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.
@@ -40,9 +40,6 @@
40
40
  }
41
41
  }
42
42
 
43
- html, body {
44
- height: 100%;
45
- width: 100%;
46
- margin: 0;
47
- padding: 0;
43
+ body, html, body > div, body > div > main{
44
+ @apply h-full w-full m-0 p-0;
48
45
  }
@@ -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 { children, menuItems = [] }: Partial<TwoColumnLayoutProps> = $props();
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
- <section class="flex flex-column md:flex-row" bind:this={container}>
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="fixed"
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
- </section>
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "5.1.0",
3
+ "version": "5.1.4",
4
4
  "license": "MIT",
5
5
  "watch": {
6
6
  "build": {