Skip to content

Commit fd05524

Browse files
committed
Update all Svelte transitions with |local modifier for better SvelteKit compatibility
1 parent e16a530 commit fd05524

File tree

8 files changed

+20
-22
lines changed

8 files changed

+20
-22
lines changed

src/lib/components/Backdrop.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
on:click
1919
on:mousedown
2020
on:mouseup
21-
transition:fade={fadeParams}
21+
transition:fade|local={fadeParams}
2222
class:blur
2323
use:portalAction={{ enabled: portal }}
2424
>

src/lib/components/Dialog.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
$$props.class
9999
)}
100100
style={$$props.style}
101-
transition:scale={{ duration: 150, easing: quadIn }}
101+
transition:scale|local={{ duration: 150, easing: quadIn }}
102102
on:introstart
103103
on:outrostart
104104
on:introend

src/lib/components/Drawer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
$$props.class
5757
)}
5858
style={$$props.style}
59-
transition:fly={{
59+
transition:fly|local={{
6060
x: left ? '-100%' : right ? '100%' : 0,
6161
y: top ? '-100%' : bottom ? '100%' : 0,
6262
}}

src/lib/components/Menu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
// Do not allow event to reach Popover's on:mouseup (clickOutside)
6868
e.stopPropagation();
6969
}}
70-
transition:transition={transitionParams}
70+
transition:transition|local={transitionParams}
7171
use:focusMove={{ disabled: !moveFocus }}
7272
>
7373
<slot {close} />

src/lib/components/Month.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@
128128
{#key startOfMonth.valueOf()}
129129
<div
130130
class="col-span-full row-span-full grid grid-cols-7 grid-rows-6 gap-y-4"
131-
in:fly={{ x: '-100%' }}
132-
out:fly={{ x: '100%' }}
131+
in:fly|local={{ x: '-100%' }}
132+
out:fly|local={{ x: '100%' }}
133133
>
134134
{#each monthDaysByWeek ?? [] as week, weekIndex (weekIndex)}
135135
{#each week ?? [] as day (day.valueOf())}

src/lib/components/Notification.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
{#if open}
4444
<div
4545
class="notification rounded-lg border bg-white shadow-lg z-10"
46-
transition:fly={{ duration: 200, easing: quadIn, x: 100 }}
46+
transition:fly|local={{ duration: 200, easing: quadIn, x: 100 }}
4747
on:outroend={() => dispatch('close')}
4848
on:click={onClick}
4949
bind:this={notificationEl}

src/lib/components/RangeSlider.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
<output
305305
style="left: calc(var(--start) * 100%);"
306306
class="value absolute top-1/2 -translate-x-1/2 -translate-y-[180%] text-xs text-white bg-accent-500 rounded-full px-2 shadow"
307-
transition:fly={{ y: 4, duration: 300 }}
307+
transition:fly|local={{ y: 4, duration: 300 }}
308308
>
309309
{value[0]}
310310
</output>
@@ -314,7 +314,7 @@
314314
<output
315315
style="left: calc(var(--end) * 100%);"
316316
class="value absolute top-1/2 -translate-x-1/2 -translate-y-[180%] text-xs text-white bg-accent-500 rounded-full px-2 shadow"
317-
transition:fly={{ y: 4, duration: 300 }}
317+
transition:fly|local={{ y: 4, duration: 300 }}
318318
>
319319
{value[1]}
320320
</output>

src/lib/components/Tooltip.svelte

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
}
5454
</script>
5555

56-
{#if enabled}
56+
{#if enabled && (title || $$slots.title)}
5757
<Popover
5858
anchorEl={containerEl?.firstElementChild}
5959
{placement}
@@ -65,18 +65,16 @@
6565
{...$$restProps}
6666
>
6767
<slot name="title">
68-
{#if title}
69-
<div
70-
class="text-white text-xs bg-gray-900/90 px-2 py-1 rounded whitespace-nowrap"
71-
transition:fly={{
72-
x: placement === 'left' ? 6 : placement === 'right' ? -6 : 0,
73-
y: placement === 'top' ? 6 : placement === 'bottom' ? -6 : 0,
74-
duration: 300,
75-
}}
76-
>
77-
{title}
78-
</div>
79-
{/if}
68+
<div
69+
class="text-white text-xs bg-gray-900/90 px-2 py-1 rounded whitespace-nowrap"
70+
transition:fly|local={{
71+
x: placement === 'left' ? 6 : placement === 'right' ? -6 : 0,
72+
y: placement === 'top' ? 6 : placement === 'bottom' ? -6 : 0,
73+
duration: 300,
74+
}}
75+
>
76+
{title}
77+
</div>
8078
</slot>
8179
</Popover>
8280
{/if}

0 commit comments

Comments
 (0)