Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 192b66a

Browse files
authored
Hotfix 0.1.6 (#78)
* Add popup animation * 0.1.6
1 parent baa9566 commit 192b66a

File tree

5 files changed

+83
-7
lines changed

5 files changed

+83
-7
lines changed

cypress/integration/highlight--popup.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ describe('highlight - Popup', () => {
1616
if (!elements.popup) return;
1717

1818
elements.popup.innerHTML = `
19-
<span x-arrow></span>
20-
<div uig-popup-card>Click Me!</div>
21-
`;
19+
<div uig-popup-wrapper>
20+
<span x-arrow></span>
21+
<div uig-popup-card>Click Me!</div>
22+
</div>`;
2223
},
2324
},
2425
popper: { placement: 'right' },

cypress/templates/index.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ body {
1919
border: 1px solid darken(aliceblue, 10%);
2020
}
2121

22-
[uig-highlight-box][uig-show] {
22+
// Disabled highlight & popup animation for tests.
23+
24+
[uig-highlight-box][uig-show],
25+
[uig-popup-wrapper] {
2326
animation-delay: 0s !important;
2427
animation-duration: 0s !important;
2528
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ranndev/ui-guide",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "Your UI guide helper for your application",
55
"main": "./dist/js/cjs/index.js",
66
"module": "./dist/js/esm/ui-guide.js",

themes/default.scss

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $box-border-size: 3px !default;
99
box-sizing: content-box !important;
1010
border: $box-border-size solid darken($theme-color, 5%);
1111
border-radius: 0.25rem;
12-
box-shadow: 0 0 0 999rem rgba($theme-color, 0.1),
12+
box-shadow: 0 0 0 999rem darken(rgba($theme-color, 0.15), 10%),
1313
0 0 0.25rem rgba($theme-color, 0.3);
1414
opacity: 0;
1515
will-change: padding, margin, opacity;
@@ -33,6 +33,78 @@ $box-border-size: 3px !default;
3333
}
3434
}
3535

36+
[uig-popup-wrapper] {
37+
position: relative;
38+
display: flex;
39+
max-width: 450px;
40+
opacity: 0;
41+
will-change: opacity, transform;
42+
43+
[uig-popup][uig-show][x-placement='top'] & {
44+
animation: slide-top 0.2s 0.3s ease-out forwards;
45+
46+
@keyframes slide-top {
47+
from {
48+
transform: translateY(30px);
49+
opacity: 0;
50+
}
51+
52+
to {
53+
transform: translateY(0);
54+
opacity: 1;
55+
}
56+
}
57+
}
58+
59+
[uig-popup][uig-show][x-placement='right'] & {
60+
animation: slide-right 0.2s 0.3s ease-out forwards;
61+
62+
@keyframes slide-right {
63+
from {
64+
transform: translateX(-30px);
65+
opacity: 0;
66+
}
67+
68+
to {
69+
transform: translateX(0);
70+
opacity: 1;
71+
}
72+
}
73+
}
74+
75+
[uig-popup][uig-show][x-placement='bottom'] & {
76+
animation: slide-bottom 0.2s 0.3s ease-out forwards;
77+
78+
@keyframes slide-bottom {
79+
from {
80+
transform: translateY(-30px);
81+
opacity: 0;
82+
}
83+
84+
to {
85+
transform: translateY(0);
86+
opacity: 1;
87+
}
88+
}
89+
}
90+
91+
[uig-popup][uig-show][x-placement='left'] & {
92+
animation: slide-left 0.2s 0.3s ease-out forwards;
93+
94+
@keyframes slide-left {
95+
from {
96+
transform: translateX(30px);
97+
opacity: 0;
98+
}
99+
100+
to {
101+
transform: translateX(0);
102+
opacity: 1;
103+
}
104+
}
105+
}
106+
}
107+
36108
span[x-arrow] {
37109
position: absolute;
38110
z-index: 2;

0 commit comments

Comments
 (0)