File tree 8 files changed +20
-33
lines changed
8 files changed +20
-33
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { testSafeFade } from " $lib/directives/ transition.directives " ;
2
+ import { fade } from " svelte/ transition" ;
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:testSafeFade |global ={{ duration : FADE_IN_DURATION }}
22
- out:testSafeFade |global ={{ duration : FADE_OUT_DURATION }}
21
+ in:fade |global ={{ duration : FADE_IN_DURATION }}
22
+ out:fade |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 { testSafeFade } from " $lib/directives/ transition.directives " ;
2
+ import { fade } from " svelte/ transition" ;
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:testSafeFade |global >
10
+ <div data-tid =" busy" transition:fade |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 { testSafeFade } from " $lib/directives/ transition.directives " ;
2
+ import { fade } from " svelte/ transition" ;
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:testSafeFade |global ={{ duration : 25 }}
49
+ transition:fade |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:testSafeFade |global ={{ duration : FADE_IN_DURATION }}
60
- out:testSafeFade |global ={{ duration : FADE_OUT_DURATION }}
59
+ in:fade |global ={{ duration : FADE_IN_DURATION }}
60
+ out:fade |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 {
4
- testSafeFade ,
5
- testSafeScale ,
6
- } from " $lib/directives/transition.directives" ;
3
+ import { fade , scale } from " svelte/transition" ;
7
4
import { quintOut } from " svelte/easing" ;
8
5
import { i18n } from " $lib/stores/i18n" ;
9
6
import Backdrop from " ./Backdrop.svelte" ;
33
30
<div
34
31
role =" menu"
35
32
aria-orientation =" vertical"
36
- transition:testSafeFade |global
33
+ transition:fade |global
37
34
class =" popover"
38
35
tabindex =" -1"
39
36
style ="--popover-top: {` ${bottom }px ` }; --popover-left: {` ${left }px ` }; --popover-right: {` ${
48
45
invisible ={invisibleBackdrop }
49
46
/>
50
47
<div
51
- transition:testSafeScale |global ={{
52
- delay : 25 ,
53
- duration : 150 ,
54
- easing : quintOut ,
55
- }}
48
+ transition:scale |global ={{ delay : 25 , duration : 150 , easing : quintOut }}
56
49
class =" wrapper"
57
50
class:with-border ={invisibleBackdrop }
58
51
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 { testSafeFade } from " $lib/directives/ transition.directives " ;
7
+ import { fade } from " svelte/ transition" ;
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:testSafeFade |global >
24
+ <span in:fade |global >
25
25
<IconLightMode />
26
26
</span >
27
27
{:else }
28
- <span in:testSafeFade |global >
28
+ <span in:fade |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 {
4
- testSafeFade ,
5
- testSafeFly ,
6
- } from " $lib/directives/transition.directives" ;
3
+ import { fade , fly } from " svelte/transition" ;
7
4
import { i18n } from " $lib/stores/i18n" ;
8
5
import type {
9
6
ToastLevel ,
95
92
data-tid =" toast-component"
96
93
role =" dialog"
97
94
class ={` toast ${theme ?? " themed" } ` }
98
- in:testSafeFly |global ={{
99
- y : (position === " top" ? - 1 : 1 ) * 100 ,
100
- duration : 200 ,
101
- }}
102
- out:testSafeFade |global ={{ delay : 100 }}
95
+ in:fly |global ={{ y : (position === " top" ? - 1 : 1 ) * 100 , duration : 200 }}
96
+ out:fade |global ={{ delay : 100 }}
103
97
>
104
98
<div class ="icon {level }" aria-hidden =" true" >
105
99
{#if spinner }
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { testSafeFly } from " $lib/directives/ transition.directives " ;
2
+ import { fly } from " svelte/ transition" ;
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:testSafeFly |global ={{ x : slideOffset , duration : ANIMATION_DURATION }}
22
+ in:fly |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