@profidev/pleiades 1.8.1 → 1.8.2
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/dist/components/nav/sidebar/sidebar-content.svelte +5 -5
- package/dist/components/nav/sidebar/sidebar-header.svelte +4 -2
- package/dist/components/nav/sidebar/sidebar-header.svelte.d.ts +1 -0
- package/dist/components/nav/sidebar/sidebar.svelte +12 -3
- package/dist/components/nav/sidebar/sidebar.svelte.d.ts +1 -0
- package/package.json +1 -1
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
|
|
17
17
|
let filteredItems = $derived(
|
|
18
18
|
items
|
|
19
|
-
.map((group) => {
|
|
20
|
-
group
|
|
19
|
+
.map((group) => ({
|
|
20
|
+
...group,
|
|
21
|
+
items: group.items.filter((item) => {
|
|
21
22
|
if (item.requiredPermission) {
|
|
22
23
|
return user.permissions.includes(item.requiredPermission);
|
|
23
24
|
}
|
|
24
25
|
return true;
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
})
|
|
26
|
+
})
|
|
27
|
+
}))
|
|
28
28
|
.filter((item) => item.items.length > 0)
|
|
29
29
|
);
|
|
30
30
|
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
import PanelLeftOpen from '@lucide/svelte/icons/panel-left-open';
|
|
5
5
|
import PanelLeftClose from '@lucide/svelte/icons/panel-left-close';
|
|
6
6
|
import type { Component } from 'svelte';
|
|
7
|
+
import { cn } from '../../../utils';
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
10
|
version: string;
|
|
10
11
|
app_name: string;
|
|
12
|
+
iconClass?: string;
|
|
11
13
|
app_icon?: Component;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
let { version, app_name, app_icon }: Props = $props();
|
|
16
|
+
let { version, app_name, app_icon, iconClass }: Props = $props();
|
|
15
17
|
|
|
16
18
|
let sidebar = Sidebar.useSidebar();
|
|
17
19
|
let isOpen = $derived(sidebar.props.open());
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
<div
|
|
31
33
|
class="bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg"
|
|
32
34
|
>
|
|
33
|
-
<AppIcon class=
|
|
35
|
+
<AppIcon class={cn('size-4 text-[#9db6ed]', iconClass)} />
|
|
34
36
|
</div>
|
|
35
37
|
<div class="flex flex-col gap-0.5 leading-none">
|
|
36
38
|
<span class="font-medium text-nowrap">{app_name}</span>
|
|
@@ -12,18 +12,27 @@
|
|
|
12
12
|
version: string;
|
|
13
13
|
app_name: string;
|
|
14
14
|
app_icon?: Component;
|
|
15
|
+
iconClass?: string;
|
|
15
16
|
items: NavGroup[];
|
|
16
17
|
logout: () => Promise<{ error?: any }>;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
const {
|
|
20
|
-
|
|
20
|
+
const {
|
|
21
|
+
children,
|
|
22
|
+
user,
|
|
23
|
+
version,
|
|
24
|
+
app_name,
|
|
25
|
+
app_icon,
|
|
26
|
+
items,
|
|
27
|
+
logout,
|
|
28
|
+
iconClass
|
|
29
|
+
}: Props = $props();
|
|
21
30
|
</script>
|
|
22
31
|
|
|
23
32
|
<Sidebar.Provider>
|
|
24
33
|
<Sidebar.Root collapsible="icon" variant="floating">
|
|
25
34
|
<Sidebar.Header>
|
|
26
|
-
<SidebarHeader {app_name} {app_icon} {version} />
|
|
35
|
+
<SidebarHeader {app_name} {app_icon} {version} {iconClass} />
|
|
27
36
|
</Sidebar.Header>
|
|
28
37
|
<Sidebar.Content>
|
|
29
38
|
<SidebarContent {items} {user} />
|