@functionalcms/svelte-components 5.1.0 → 5.1.3

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,16 +10,23 @@
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();
22
-
28
+ let { children, menuItems = [], logo = undefined, sidebarPosition = 'fixed' }: Partial<TwoColumnLayoutProps> = $props();
29
+
23
30
  let container: HTMLElement | undefined = undefined;
24
31
  const helpers = uiHelpers();
25
32
  afterNavigate(() => {
@@ -27,13 +34,16 @@
27
34
  });
28
35
  </script>
29
36
 
30
- <section class="flex flex-column md:flex-row" bind:this={container}>
37
+ <main class="" bind:this={container}>
31
38
  <SidebarButton onclick={helpers.toggle} class="mb-2" />
39
+ {#if logo}
40
+ <SidebarBrand site={logo} classes={{ img: 'h-6 w-6' }} />
41
+ {/if}
32
42
  <Sidebar
33
43
  backdrop={false}
34
44
  isOpen={helpers.isOpen}
35
45
  closeSidebar={helpers.close}
36
- position="fixed"
46
+ position={sidebarPosition}
37
47
  class="z-50 h-full"
38
48
  >
39
49
  <SidebarGroup>
@@ -57,7 +67,7 @@
57
67
  <div class="content" style:flex="1">
58
68
  {@render children?.()}
59
69
  </div>
60
- </section>
70
+ </main>
61
71
 
62
72
  <style>
63
73
  </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.3",
4
4
  "license": "MIT",
5
5
  "watch": {
6
6
  "build": {