File tree 7 files changed +33
-20
lines changed 7 files changed +33
-20
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { fade } from " svelte/ transition" ;
2
+ import { testSafeFade } from " $lib/directives/ transition.directives " ;
3
3
import { createEventDispatcher } from " svelte" ;
4
4
import { i18n } from " $lib/stores/i18n" ;
5
5
import { handleKeyPress } from " $lib/utils/keyboard.utils" ;
18
18
role =" button"
19
19
tabindex =" -1"
20
20
aria-label ={$i18n .core .close }
21
- in:fade |global ={{ duration : FADE_IN_DURATION }}
22
- out:fade |global ={{ duration : FADE_OUT_DURATION }}
21
+ in:testSafeFade |global ={{ duration : FADE_IN_DURATION }}
22
+ out:testSafeFade |global ={{ duration : FADE_OUT_DURATION }}
23
23
class =" backdrop"
24
24
class:visible ={! invisible }
25
25
on:click |stopPropagation ={close }
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { fade } from " svelte/ transition" ;
2
+ import { testSafeFade } from " $lib/directives/ transition.directives " ;
3
3
import { busy , busyMessage } from " $lib/stores/busy.store" ;
4
4
import Spinner from " $lib/components/Spinner.svelte" ;
5
5
import { nonNullish } from " @dfinity/utils" ;
6
6
</script >
7
7
8
8
<!-- Display spinner and lock UI if busyStore is not empty -->
9
9
{#if $busy }
10
- <div data-tid =" busy" transition:fade |global >
10
+ <div data-tid =" busy" transition:testSafeFade |global >
11
11
<div class =" content" >
12
12
{#if nonNullish ($busyMessage )}
13
13
<p >{$busyMessage }</p >
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { fade } from " svelte/ transition" ;
2
+ import { testSafeFade } from " $lib/directives/ transition.directives " ;
3
3
import { createEventDispatcher } from " svelte" ;
4
4
import { i18n } from " $lib/stores/i18n" ;
5
5
import IconClose from " $lib/icons/IconClose.svelte" ;
46
46
{#if visible }
47
47
<div
48
48
class =" modal"
49
- transition:fade |global ={{ duration : 25 }}
49
+ transition:testSafeFade |global ={{ duration : 25 }}
50
50
on:introend
51
51
{role }
52
52
data-tid ={testId }
56
56
>
57
57
<Backdrop {disablePointerEvents } on:nnsClose />
58
58
<div
59
- in:fade |global ={{ duration : FADE_IN_DURATION }}
60
- out:fade |global ={{ duration : FADE_OUT_DURATION }}
59
+ in:testSafeFade |global ={{ duration : FADE_IN_DURATION }}
60
+ out:testSafeFade |global ={{ duration : FADE_OUT_DURATION }}
61
61
class ={` wrapper ${role } ` }
62
62
>
63
63
{#if showHeader }
Original file line number Diff line number Diff line change 1
1
<!-- https://github.com/papyrs/papyrs/blob/main/src/lib/components/ui/Popover.svelte -->
2
2
<script lang =" ts" >
3
- import { fade , scale } from " svelte/transition" ;
3
+ import {
4
+ testSafeFade ,
5
+ testSafeScale ,
6
+ } from " $lib/directives/transition.directives" ;
4
7
import { quintOut } from " svelte/easing" ;
5
8
import { i18n } from " $lib/stores/i18n" ;
6
9
import Backdrop from " ./Backdrop.svelte" ;
30
33
<div
31
34
role =" menu"
32
35
aria-orientation =" vertical"
33
- transition:fade |global
36
+ transition:testSafeFade |global
34
37
class =" popover"
35
38
tabindex =" -1"
36
39
style ="--popover-top: {` ${bottom }px ` }; --popover-left: {` ${left }px ` }; --popover-right: {` ${
45
48
invisible ={invisibleBackdrop }
46
49
/>
47
50
<div
48
- transition:scale |global ={{ delay : 25 , duration : 150 , easing : quintOut }}
51
+ transition:testSafeScale |global ={{
52
+ delay : 25 ,
53
+ duration : 150 ,
54
+ easing : quintOut ,
55
+ }}
49
56
class =" wrapper"
50
57
class:with-border ={invisibleBackdrop }
51
58
class:rtl ={direction === " rtl" }
Original file line number Diff line number Diff line change 4
4
import { i18n } from " $lib/stores/i18n" ;
5
5
import IconLightMode from " $lib/icons/IconLightMode.svelte" ;
6
6
import IconDarkMode from " $lib/icons/IconDarkMode.svelte" ;
7
- import { fade } from " svelte/ transition" ;
7
+ import { testSafeFade } from " $lib/directives/ transition.directives " ;
8
8
9
9
const switchTheme = () => {
10
10
themeStore .select ($themeStore === Theme .LIGHT ? Theme .DARK : Theme .LIGHT );
21
21
aria-label ={$i18n .theme .switch_theme }
22
22
>
23
23
{#if isDarkMode }
24
- <span in:fade |global >
24
+ <span in:testSafeFade |global >
25
25
<IconLightMode />
26
26
</span >
27
27
{:else }
28
- <span in:fade |global >
28
+ <span in:testSafeFade |global >
29
29
<IconDarkMode />
30
30
</span >
31
31
{/if }
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import { toastsStore } from " $lib/stores/toasts.store" ;
3
- import { fade , fly } from " svelte/transition" ;
3
+ import {
4
+ testSafeFade ,
5
+ testSafeFly ,
6
+ } from " $lib/directives/transition.directives" ;
4
7
import { i18n } from " $lib/stores/i18n" ;
5
8
import type {
6
9
ToastLevel ,
92
95
data-tid =" toast-component"
93
96
role =" dialog"
94
97
class ={` toast ${theme ?? " themed" } ` }
95
- in:fly |global ={{ y : (position === " top" ? - 1 : 1 ) * 100 , duration : 200 }}
96
- out:fade |global ={{ delay : 100 }}
98
+ in:testSafeFly |global ={{
99
+ y : (position === " top" ? - 1 : 1 ) * 100 ,
100
+ duration : 200 ,
101
+ }}
102
+ out:testSafeFade |global ={{ delay : 100 }}
97
103
>
98
104
<div class ="icon {level }" aria-hidden =" true" >
99
105
{#if spinner }
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { fly } from " svelte/ transition" ;
2
+ import { testSafeFly } from " $lib/directives/ transition.directives " ;
3
3
4
4
// Instead of a number an object is used to make svelte notice any updates need rerender
5
5
export let transition: { diff: number } = { diff: 0 };
19
19
{#key transition }
20
20
<div
21
21
bind:clientWidth ={absolutOffset }
22
- in:fly |global ={{ x : slideOffset , duration : ANIMATION_DURATION }}
22
+ in:testSafeFly |global ={{ x : slideOffset , duration : ANIMATION_DURATION }}
23
23
class =" transition"
24
24
>
25
25
<slot />
You can’t perform that action at this time.
0 commit comments