@functionalcms/svelte-components 5.19.0 → 5.21.0

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.
@@ -56,7 +56,7 @@
56
56
  footer:
57
57
  'absolute start-0 bottom-0 z-20 w-full border-t border-gray-200 bg-white p-4 shadow-sm md:flex md:items-center md:justify-between md:p-6 dark:border-gray-600 dark:bg-gray-800',
58
58
  footerLinks: '',
59
- main: 'min-h-screen'
59
+ main: 'flex-1'
60
60
  };
61
61
  const mergedClasses = $derived(() => ({ ...defaultClasses, ...classes }));
62
62
 
@@ -75,7 +75,7 @@
75
75
  <link rel="canonical" href="{canonicalUrl}{page.url.pathname}" />
76
76
  </svelte:head>
77
77
 
78
- <div class="w-full relative" id="defaultLayout">
78
+ <div class="relative flex min-h-screen w-full flex-col" id="defaultLayout">
79
79
  <Navbar class={mergedClasses().navigation}>
80
80
  <NavBrand href="/" class="logo">
81
81
  <img src={logoUrl} class={mergedClasses().logo} alt={companyName} />
@@ -45,7 +45,7 @@
45
45
  });
46
46
  </script>
47
47
 
48
- <main class="" bind:this={container}>
48
+ <main class="menu-layout relative flex h-full" bind:this={container}>
49
49
  <SidebarButton onclick={helpers.toggle} class="mb-2" />
50
50
 
51
51
  <Sidebar
@@ -71,9 +71,13 @@
71
71
  {#each menuItems as item}
72
72
  {#if !isCollapsed}
73
73
  {#if 'items' in item}
74
- <SidebarDropdownWrapper label={item.label}>
74
+ <SidebarDropdownWrapper label={item.label} isOpen={item.isOpen}>
75
75
  {#each item.items as subItem}
76
- <SidebarDropdownItem label={subItem.label} href={subItem.href} />
76
+ <SidebarItem label={subItem.label} href={subItem.href}>
77
+ {#snippet icon()}
78
+ <Icon icon={subItem.icon} />
79
+ {/snippet}
80
+ </SidebarItem>
77
81
  {/each}
78
82
  </SidebarDropdownWrapper>
79
83
  {:else}
@@ -89,14 +93,26 @@
89
93
  <Icon icon={item.icon} />
90
94
  {/snippet}
91
95
  </SidebarItem>
96
+ {#if item.items && item.isOpen}
97
+ {#each item.items as subItem}
98
+ <SidebarItem label="" href={subItem.href}>
99
+ {#snippet icon()}
100
+ <Icon icon={subItem.icon} />
101
+ {/snippet}
102
+ </SidebarItem>
103
+ {/each}
104
+ {/if}
92
105
  {/if}
93
106
  {/each}
94
107
  </SidebarGroup>
95
108
  </Sidebar>
96
109
  <div
97
- class="content h-full overflow-auto px-4 transition-all duration-300 {isCollapsed
98
- ? 'md:ml-16'
99
- : 'md:ml-64'}"
110
+ class="content h-full overflow-auto px-4 transition-all duration-300 {sidebarPosition ===
111
+ 'static'
112
+ ? ''
113
+ : isCollapsed
114
+ ? 'md:ml-16'
115
+ : 'md:ml-64'}"
100
116
  style:flex="1"
101
117
  >
102
118
  {@render children?.()}
@@ -16,6 +16,7 @@ export type MenuSection = {
16
16
  href?: string;
17
17
  icon?: string;
18
18
  visibility?: Visibility;
19
+ isOpen?: boolean;
19
20
  };
20
21
  export type MenuDivider = {};
21
22
  export type MenuOption = MenuItem | MenuSection;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "5.19.0",
3
+ "version": "5.21.0",
4
4
  "license": "MIT",
5
5
  "watch": {
6
6
  "build": {