@thecb/components 11.2.7-beta.1 → 11.2.8-beta.1

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.
@@ -1,20 +1,22 @@
1
1
  import React from "react";
2
2
  import styled from "styled-components";
3
- import { Box, Motion } from "../../atoms/layouts";
3
+ import posed from "react-pose";
4
+ import { easeIn, easeOut } from "@popmotion/easing";
5
+ import { Box } from "../../atoms/layouts";
4
6
  import { fallbackValues } from "./NavMenu.theme.js";
5
7
  import { themeComponent } from "../../../util/themeUtils";
6
8
 
7
- const menuVariants = {
9
+ const menu = posed.div({
8
10
  invisible: {
9
11
  left: "-100vw",
10
12
  right: "100vw",
11
13
  transition: {
12
14
  right: {
13
- ease: "easeOut",
15
+ ease: easeOut,
14
16
  duration: 500
15
17
  },
16
18
  left: {
17
- ease: "easeOut",
19
+ ease: easeOut,
18
20
  duration: 500
19
21
  }
20
22
  }
@@ -24,18 +26,18 @@ const menuVariants = {
24
26
  right: "0",
25
27
  transition: {
26
28
  left: {
27
- ease: "easeIn",
29
+ ease: easeIn,
28
30
  duration: 500
29
31
  },
30
32
  right: {
31
- ease: "easeIn",
33
+ ease: easeIn,
32
34
  duration: 500
33
35
  }
34
36
  }
35
37
  }
36
- };
38
+ });
37
39
 
38
- const ImposterMenu = styled(Motion)`
40
+ const ImposterMenu = styled(menu)`
39
41
  position: fixed;
40
42
  top: ${({ headerSize }) => headerSize};
41
43
  `;
@@ -50,9 +52,8 @@ const NavMenuMobile = ({
50
52
  return (
51
53
  <ImposterMenu
52
54
  id={id}
53
- variants={menuVariants}
54
- initial="invisible"
55
- animate={visible ? "visible" : "invisible"}
55
+ initialPose="invisible"
56
+ pose={visible ? "visible" : "invisible"}
56
57
  headerSize={headerSize}
57
58
  >
58
59
  <Box
@@ -1,6 +1,23 @@
1
1
  import React from "react";
2
2
  import styled from "styled-components";
3
- import { Motion } from "../../components/atoms/layouts";
3
+ import posed from "react-pose";
4
+ import { linear } from "@popmotion/easing";
5
+
6
+ const rotate = posed.div({
7
+ fixed: {
8
+ rotate: "0deg"
9
+ },
10
+ rotate: {
11
+ rotate: "360deg",
12
+ transition: {
13
+ rotate: {
14
+ ease: linear,
15
+ duration: 1000,
16
+ loop: Infinity
17
+ }
18
+ }
19
+ }
20
+ });
4
21
 
5
22
  export const SpinnerContainer = styled.div`
6
23
  width: 100%;
@@ -10,19 +27,14 @@ export const SpinnerContainer = styled.div`
10
27
  justify-content: center;
11
28
  `;
12
29
 
13
- export const SpinnerIconWrapper = styled(Motion)`
30
+ export const SpinnerIconWrapper = styled(rotate)`
14
31
  width: ${({ isMobile }) => (isMobile ? "18" : "21")}px;
15
32
  height: ${({ isMobile }) => (isMobile ? "18" : "21")}px;
16
33
  `;
17
34
 
18
35
  const SpinnerIcon = ({ color, isMobile }) => (
19
36
  <SpinnerContainer>
20
- <SpinnerIconWrapper
21
- initial={{ rotate: 0 }}
22
- animate={{ rotate: 360 }}
23
- transition={{ duration: 1, ease: "linear", repeat: Infinity }}
24
- isMobile={isMobile}
25
- >
37
+ <SpinnerIconWrapper initialPose="fixed" pose="rotate" isMobile={isMobile}>
26
38
  <svg
27
39
  viewBox={`0 0 24 24`}
28
40
  height="100%"
package/src/.DS_Store DELETED
Binary file
Binary file
Binary file
Binary file