File tree 4 files changed +17
-17
lines changed 4 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 2
2
import { fade , FadeParams } from ' svelte/transition' ;
3
3
4
4
import portalAction from ' ../actions/portal' ;
5
+ import { cls } from ' ../utils/styles' ;
5
6
6
7
export let blur: boolean = false ;
7
8
export let portal = false ;
8
9
9
10
export let fadeParams: FadeParams = { duration: 300 };
10
11
</script >
11
12
12
- <!-- TODO: Add `|local` to transition without breaking `ToggleButton` usage: https://github.com/techniq/svelte-ux/issues/51 -->
13
13
<div
14
- class =" backdrop fixed top-0 bottom-0 left-0 right-0 flex items-center
15
- justify-center bg-black/50 {$$restProps.class || ''}"
14
+ class ={cls (
15
+ ' backdrop fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-black/50' ,
16
+ blur && ' backdrop-blur-sm' ,
17
+ $$restProps .class
18
+ )}
16
19
on:keydown
17
20
on:keyup
18
21
on:keypress
19
22
on:click
20
23
on:mousedown
21
24
on:mouseup
22
- transition :fade ={fadeParams }
23
- class:blur
25
+ in :fade ={fadeParams }
26
+ out:fade | local ={ fadeParams }
24
27
use:portalAction ={{ enabled : portal }}
25
28
>
26
29
<slot />
27
30
</div >
28
-
29
- <style lang =" postcss" >
30
- .blur {
31
- backdrop-filter : blur (2 px );
32
- }
33
- </style >
Original file line number Diff line number Diff line change 91
91
}}
92
92
use:portalAction ={{ enabled : portal }}
93
93
>
94
- <!-- TODO: Add `|local` to transition without breaking `ToggleButton` usage: https://github.com/techniq/svelte-ux/issues/51 -->
95
94
<div
96
95
class ={cls (
97
96
' dialog rounded bg-white elevation-4 overflow-y-auto pointer-events-auto relative outline-none' ,
98
97
classes .dialog ,
99
98
$$props .class
100
99
)}
101
100
style ={$$props .style }
102
- transition:scale ={{ duration : 150 , easing : quadIn }}
101
+ in:scale ={{ duration : 150 , easing : quadIn }}
102
+ out:scale |local ={{ duration : 150 , easing : quadIn }}
103
103
on:introstart
104
104
on:outrostart
105
105
on:introend
Original file line number Diff line number Diff line change 42
42
{portal }
43
43
/>
44
44
45
- <!-- TODO: Add `|local` to transition without breaking `ToggleButton` usage: https://github.com/techniq/svelte-ux/issues/51 -->
46
45
<div
47
46
class ={cls (
48
47
' bg-white fixed overflow-auto transform z-50 outline-none' ,
57
56
$$props .class
58
57
)}
59
58
style ={$$props .style }
60
- transition:fly ={{
59
+ in:fly ={{
60
+ x : left ? ' -100%' : right ? ' 100%' : 0 ,
61
+ y : top ? ' -100%' : bottom ? ' 100%' : 0 ,
62
+ }}
63
+ out:fly |local ={{
61
64
x : left ? ' -100%' : right ? ' 100%' : 0 ,
62
65
y : top ? ' -100%' : bottom ? ' 100%' : 0 ,
63
66
}}
Original file line number Diff line number Diff line change 58
58
on:close
59
59
let:close
60
60
>
61
- <!-- TODO: Add `|local` to transition without breaking `ToggleButton` usage: https://github.com/techniq/svelte-ux/issues/51 -->
62
61
<!-- svelte-ignore a11y-click-events-have-key-events -->
63
62
<menu
64
63
class =" menu-items outline-none max-h-screen"
68
67
// Do not allow event to reach Popover's on:mouseup (clickOutside)
69
68
e .stopPropagation ();
70
69
}}
71
- transition:transition ={transitionParams }
70
+ in:transition ={transitionParams }
71
+ out:transition |local ={transitionParams }
72
72
use:focusMove ={{ disabled : ! moveFocus }}
73
73
>
74
74
<slot {close } />
You can’t perform that action at this time.
0 commit comments