Skip to content

Commit

Permalink
fix: NavUl update
Browse files Browse the repository at this point in the history
  • Loading branch information
shinokada committed Jan 20, 2024
1 parent 4b50246 commit af6b733
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@
"svelte": "./dist/spinner/Spinner.svelte"
}
}
}
}
10 changes: 4 additions & 6 deletions src/lib/nav/NavUl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
divClass?: string | undefined;
}
import { getContext } from 'svelte';
import { quintOut } from 'svelte/easing';
// import { quintOut } from 'svelte/easing';
import { twMerge } from 'tailwind-merge';
import { slide, type SlideParams } from 'svelte/transition';
// import { slide, type SlideParams } from 'svelte/transition';
let { children, ulClass, divClass, ...attributes } = $props<Props>();
let breakPoint: 'md' | 'lg' | 'xl' | 'xxl';
// let _hidden: boolean;
Expand All @@ -23,10 +23,10 @@
xxl: '2xl:mt-0 2xl:flex-row 2xl:space-x-8 2xl:border-0 2xl:p-0 2xl:dark:bg-gray-900'
};
let slideParams: SlideParams = { delay: 250, duration: 500, easing: quintOut };
// let slideParams: SlideParams = { delay: 250, duration: 500, easing: quintOut };
// $inspect('break', ulBreak[breakPoint]);
let _divClass = twMerge('w-full md:block md:w-auto', divClass);
// let _divClass = twMerge('w-full md:block md:w-auto', divClass);
let ulCls = twMerge(
'mt-4 flex flex-col rounded-lg border border-gray-100 bg-gray-50 bg-transparent p-4 font-medium dark:border-gray-700 dark:bg-gray-800 rtl:space-x-reverse',
ulBreak[breakPoint],
Expand All @@ -36,10 +36,8 @@
// $inspect('NavUl', breakPoint);
</script>

<div {...attributes} class={_divClass} transition:slide={slideParams} on:click role="button" tabindex="0">
<ul class={ulCls} {...attributes}>
{@render children()}
</ul>
</div>


6 changes: 5 additions & 1 deletion src/lib/nav/Navbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import { setContext } from 'svelte';
import { twMerge } from 'tailwind-merge';
import { clickOutside } from '../uiHelpers.svelte';
import { slide, type SlideParams } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
let {
children,
Expand Down Expand Up @@ -61,6 +63,8 @@
};
let divChildrenCls = twMerge('w-full', blockBreak[breakPoint], divChildrenClass);
// $inspect('Navbar: ', breakPoint);
let slideParams: SlideParams = { delay: 250, duration: 500, easing: quintOut };
</script>

<nav class={navCls} use:clickOutside={closeNav} {...attributes}>
Expand All @@ -86,7 +90,7 @@
/>
</svg>
</button>
<div class="{navDisplay} {divChildrenCls}">
<div class="{navDisplay} {divChildrenCls}" transition:slide={slideParams} role="button" tabindex="0" >
{@render children()}
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/lib/sidebar/SidebarGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
);
// export let border: boolean = false;
if (border) {
ulCls += ' ' + borderCls;
}
// if (border) {
// ulCls += ' ' + borderCls;
// }
</script>

<ul {...attributes} class={ulCls}>
<ul {...attributes} class={border ? borderCls : ulCls}>
{@render children()}
</ul>

0 comments on commit af6b733

Please sign in to comment.