@functionalcms/svelte-components 5.12.2 → 5.12.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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { MenuItem, MenuSection } from './menuItems.js';
|
|
4
4
|
import Icon from '../Icon.svelte';
|
|
5
|
+
import { OutlinedIcons } from '../icons.js';
|
|
5
6
|
import { afterNavigate } from '$app/navigation';
|
|
6
7
|
import {
|
|
7
8
|
Sidebar,
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
let container: HTMLElement | undefined = undefined;
|
|
36
37
|
const helpers = uiHelpers();
|
|
37
38
|
let isCollapsed = $state(false);
|
|
39
|
+
let icon = $derived(isCollapsed ? OutlinedIcons.ChevronDoubleRight : OutlinedIcons.ChevronDoubleLeft);
|
|
38
40
|
|
|
39
41
|
afterNavigate(() => {
|
|
40
42
|
window.scrollTo({ top: 0, behavior: 'instant' });
|
|
@@ -61,7 +63,7 @@
|
|
|
61
63
|
class="rounded-lg p-2 hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
62
64
|
title={isCollapsed ? 'Expand menu' : 'Collapse menu'}
|
|
63
65
|
>
|
|
64
|
-
<Icon icon={
|
|
66
|
+
<Icon icon={icon} />
|
|
65
67
|
</button>
|
|
66
68
|
</div>
|
|
67
69
|
{#if !isCollapsed}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import Icon from '../Icon.svelte';
|
|
3
|
+
import { OutlinedIcons } from '../icons.js';
|
|
2
4
|
import type { Snippet } from "svelte";
|
|
3
5
|
|
|
4
6
|
interface Props {
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
|
|
16
18
|
let asideWidth = $state(initialWidth);
|
|
17
19
|
let isCollapsed = $state(false);
|
|
20
|
+
let icon = $derived(isCollapsed ? OutlinedIcons.ChevronDoubleRight : OutlinedIcons.ChevronDoubleLeft);
|
|
18
21
|
|
|
19
22
|
const toggleCollapse = () => {
|
|
20
23
|
isCollapsed = !isCollapsed;
|
|
@@ -38,7 +41,7 @@
|
|
|
38
41
|
onclick={toggleCollapse}
|
|
39
42
|
aria-label={isCollapsed ? "Expand sidebar" : "Collapse sidebar"}
|
|
40
43
|
>
|
|
41
|
-
{
|
|
44
|
+
<Icon icon={icon} />
|
|
42
45
|
</button>
|
|
43
46
|
|
|
44
47
|
<main class="resizable-main">
|