pebble-web 2.6.0 → 2.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pebble-web",
3
- "version": "2.6.0",
3
+ "version": "2.7.1",
4
4
  "author": "ritz078 <rkritesh078@gmail.com>",
5
5
  "license": "MIT",
6
6
  "main": "dist/pebble-web.js",
@@ -44,12 +44,12 @@
44
44
  "utility-types": "^3.10.0"
45
45
  },
46
46
  "devDependencies": {
47
- "pebble-shared": "^2.5.0"
47
+ "pebble-shared": "^2.7.0"
48
48
  },
49
49
  "greenkeeper": {
50
50
  "ignore": [
51
51
  "rheostat"
52
52
  ]
53
53
  },
54
- "gitHead": "10642c163578a97858d3df92ec9532d01c2cbc52"
54
+ "gitHead": "d569cdeb12f659905b61f0642b91a5b3c1371784"
55
55
  }
@@ -5,16 +5,16 @@ import {
5
5
  sidebarWrapperStyle
6
6
  } from "./styles/Sidebar.styles";
7
7
  import { SidebarProps } from "./typings/Sidebar";
8
- import { Transition, animated } from "react-spring/renderprops.cjs";
8
+ import { animated } from "react-spring/renderprops.cjs";
9
9
  import Ink from "react-ink";
10
10
  import { css, cx } from "emotion";
11
11
  import { disableScrollY } from "../theme/styles";
12
- import { animationConfig } from "../utils/animation";
12
+ import MountTransition from "./shared/MountTransition";
13
13
 
14
14
  const transitionProps = {
15
- from: { opacity: 0 },
16
- enter: { opacity: 1 },
17
- leave: { opacity: 0 }
15
+ from: { opacity: 0, transform: "translateX(100%)" },
16
+ enter: { opacity: 1, transform: "translateX(0)" },
17
+ leave: { opacity: 0, transform: "translateX(100%)", pointerEvents: "none" }
18
18
  };
19
19
 
20
20
  class SideBar extends React.PureComponent<SidebarProps> {
@@ -57,65 +57,36 @@ class SideBar extends React.PureComponent<SidebarProps> {
57
57
  onOutsideClick,
58
58
  closeOnOutsideClick
59
59
  } = this.props;
60
- const _sidebarOverride = css({
61
- width,
62
- transform: isOpen ? `translateX(0)` : `translateX(${width}px)`
63
- });
64
- const _sidebarStyle = cx(
65
- _sidebarOverride,
66
- sidebarStyle,
67
- css({
68
- transform: isOpen ? `translateX(0)` : `translateX(100%)`
69
- })
70
- );
60
+ const _sidebarStyle = cx(sidebarStyle, css({ width }));
71
61
 
72
62
  return (
73
- <React.Fragment>
74
- <Transition
75
- items={isOpen}
76
- {...transitionProps}
77
- config={animationConfig.config}
78
- >
79
- {show =>
80
- show &&
81
- (styles => (
82
- <animated.div
83
- style={styles}
84
- className={sidebarWrapperStyle}
85
- onClick={
86
- onOutsideClick || closeOnOutsideClick
87
- ? this.onOutsideClick
88
- : undefined
89
- }
90
- data-testid="shadowArea"
91
- />
92
- ))
93
- }
94
- </Transition>
63
+ <MountTransition visible={isOpen} {...transitionProps}>
64
+ {styles => (
65
+ <>
66
+ <animated.div
67
+ style={{ opacity: styles.opacity }}
68
+ className={sidebarWrapperStyle}
69
+ onClick={
70
+ onOutsideClick || closeOnOutsideClick
71
+ ? this.onOutsideClick
72
+ : undefined
73
+ }
74
+ data-testid="shadowArea"
75
+ />
76
+
77
+ <animated.div className={_sidebarStyle} style={styles}>
78
+ <div className={closeStyle} onClick={onClose}>
79
+ <i className="pi pi-close" />
80
+ <Ink />
81
+ </div>
95
82
 
96
- <div className={_sidebarStyle}>
97
- <Transition items={isOpen} {...transitionProps}>
98
- {show =>
99
- show &&
100
- (styles => (
101
- <animated.div
102
- style={styles}
103
- className={closeStyle}
104
- onClick={onClose}
105
- >
106
- <i className="pi pi-close" />
107
- <Ink />
108
- </animated.div>
109
- ))
110
- }
111
- </Transition>
112
- {isOpen && (
113
- <div style={{ overflowY: "scroll", height: "100vh" }}>
114
- {children}
115
- </div>
116
- )}
117
- </div>
118
- </React.Fragment>
83
+ <div style={{ overflowY: "scroll", height: "100vh" }}>
84
+ {children}
85
+ </div>
86
+ </animated.div>
87
+ </>
88
+ )}
89
+ </MountTransition>
119
90
  );
120
91
  }
121
92
  }
@@ -24,6 +24,7 @@ export const optionGroupCheckBoxWrap = css({
24
24
 
25
25
  export const optionGroupCheckBoxButtonWrap = css({
26
26
  ...mixins.flexSpaceBetween,
27
+ gap: 60,
27
28
  padding: optionGroupCheckBoxButtonWrapPadding,
28
29
  paddingTop: optionGroupCheckBoxButtonWrapPaddingTop,
29
30
  backgroundColor: colors.white.base
@@ -44,7 +44,6 @@ export const closeStyle = css({
44
44
  });
45
45
 
46
46
  export const sidebarStyle = css({
47
- transition: `transform 200ms ${constants.animationCurve}`,
48
47
  backgroundColor: colors.white.base,
49
48
  position: "fixed",
50
49
  top: 0,
@@ -5,5 +5,5 @@ export const animationConfig = {
5
5
  enter: { opacity: 1, transform: "scale(1)" },
6
6
  leave: { opacity: 0, transform: "scale(0.95)", pointerEvents: "none" },
7
7
  config: (_a: boolean, motion: State) =>
8
- motion === "leave" ? { duration: 0.1 } : { duration: 200 }
8
+ motion === "leave" ? { duration: 80 } : { duration: 200 }
9
9
  };