hamzus-ui 0.0.123 → 0.0.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
import Portal from '../Portal/Portal.svelte';
|
|
4
4
|
|
|
5
5
|
export let isOpen = true;
|
|
6
|
+
export let direction = "center";
|
|
7
|
+
export let width = "min(100%, 350px)";
|
|
8
|
+
export let height = "auto";
|
|
9
|
+
|
|
10
|
+
const positionBeforeAnimation = {
|
|
11
|
+
"left-top":[-10,0],
|
|
12
|
+
"left":[-10,0],
|
|
13
|
+
"left-bottom":[-10,0],
|
|
14
|
+
|
|
15
|
+
"center-top":[0,-10],
|
|
16
|
+
"center":[0,10],
|
|
17
|
+
"center-bottom":[0,10],
|
|
18
|
+
|
|
19
|
+
"right-top":[10,0],
|
|
20
|
+
"right":[10,0],
|
|
21
|
+
"right-bottom":[10,0],
|
|
22
|
+
}
|
|
23
|
+
|
|
6
24
|
|
|
7
25
|
function handleClose() {
|
|
8
26
|
isOpen = false;
|
|
@@ -11,8 +29,8 @@
|
|
|
11
29
|
|
|
12
30
|
{#if isOpen}
|
|
13
31
|
<Portal target="body">
|
|
14
|
-
<div class="dialog">
|
|
15
|
-
<div class="dialog-container">
|
|
32
|
+
<div class="dialog {direction}" style="--left:{positionBeforeAnimation[direction][0]}px;--top:{positionBeforeAnimation[direction][1]}px;">
|
|
33
|
+
<div class="dialog-container" style="width: {width};height:{height};">
|
|
16
34
|
<IconButton style="position:absolute;top:var(--pad-m);right:var(--pad-m);" label="ghost" variant="ghost" onClick={handleClose}>
|
|
17
35
|
<svg
|
|
18
36
|
width="25"
|
|
@@ -46,16 +64,78 @@
|
|
|
46
64
|
display: flex;
|
|
47
65
|
align-items: center;
|
|
48
66
|
justify-content: center;
|
|
67
|
+
padding: var(--pad-m);
|
|
49
68
|
background-color: var(--bg-blur);
|
|
50
69
|
backdrop-filter: blur(20px);
|
|
51
70
|
-webkit-backdrop-filter: blur(20px);
|
|
71
|
+
animation: entry .2s ease-out;
|
|
52
72
|
}
|
|
73
|
+
.dialog.left-top {
|
|
74
|
+
align-items: start;
|
|
75
|
+
justify-content: start;
|
|
76
|
+
}
|
|
77
|
+
.dialog.left {
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: start;
|
|
80
|
+
}
|
|
81
|
+
.dialog.left-bottom {
|
|
82
|
+
align-items: end;
|
|
83
|
+
justify-content: start;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.dialog.center-top {
|
|
87
|
+
align-items: start;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
}
|
|
90
|
+
.dialog.center {
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
}
|
|
94
|
+
.dialog.center-bottom {
|
|
95
|
+
align-items: end;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
}
|
|
98
|
+
.dialog.right-top {
|
|
99
|
+
align-items: start;
|
|
100
|
+
justify-content: end;
|
|
101
|
+
}
|
|
102
|
+
.dialog.right {
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: end;
|
|
105
|
+
}
|
|
106
|
+
.dialog.right-bottom {
|
|
107
|
+
align-items: end;
|
|
108
|
+
justify-content: end;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@keyframes entry {
|
|
112
|
+
from {
|
|
113
|
+
opacity: 0;
|
|
114
|
+
}
|
|
115
|
+
to {
|
|
116
|
+
opacity: 1;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
53
121
|
.dialog-container {
|
|
54
|
-
width: min(100%, 350px);
|
|
55
122
|
min-height: 45px;
|
|
123
|
+
max-height: 100%;
|
|
56
124
|
padding: var(--pad-xxl);
|
|
57
125
|
border-radius: var(--radius-m);
|
|
58
126
|
background-color: var(--bg-1);
|
|
59
127
|
position: relative;
|
|
128
|
+
animation: entry-container .2s ease-out;
|
|
129
|
+
overflow: auto;
|
|
60
130
|
}
|
|
131
|
+
|
|
132
|
+
@keyframes entry-container {
|
|
133
|
+
from {
|
|
134
|
+
transform: translate(var(--left), var(--top));
|
|
135
|
+
}
|
|
136
|
+
to {
|
|
137
|
+
transform: translate(0, 0);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
61
141
|
</style>
|