pebble-web 2.18.0 → 3.0.0-alpha.0
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/dist/components/shared/MountTransition.d.ts +4 -4
- package/dist/pebble-web.dev.js +38 -35
- package/dist/pebble-web.dev.js.map +1 -1
- package/dist/pebble-web.es.dev.js +23 -17
- package/dist/pebble-web.es.dev.js.map +1 -1
- package/dist/pebble-web.es.js +22 -16
- package/dist/pebble-web.es.js.map +1 -1
- package/dist/pebble-web.js +37 -34
- package/dist/pebble-web.js.map +1 -1
- package/dist/pebble-web.module.dev.js +33 -30
- package/dist/pebble-web.module.dev.js.map +1 -1
- package/dist/pebble-web.module.js +32 -29
- package/dist/pebble-web.module.js.map +1 -1
- package/dist/pebble-web.umd.dev.js +3331 -1832
- package/dist/pebble-web.umd.dev.js.map +1 -1
- package/dist/pebble-web.umd.js +3342 -1843
- package/dist/pebble-web.umd.js.map +1 -1
- package/dist/utils/animation.d.ts +7 -2
- package/package.json +4 -4
- package/src/components/DropDown.tsx +6 -6
- package/src/components/Modal.tsx +10 -11
- package/src/components/Popper.tsx +6 -5
- package/src/components/Sidebar.tsx +1 -1
- package/src/components/Toast.tsx +4 -5
- package/src/components/TypeAhead.tsx +2 -2
- package/src/components/__tests__/__snapshots__/popper.test.tsx.snap +1 -1
- package/src/components/shared/MountTransition.tsx +22 -15
- package/src/utils/animation.ts +12 -3
|
@@ -17,7 +17,7 @@ import addDays from 'date-fns/addDays';
|
|
|
17
17
|
import startOfDay from 'date-fns/startOfDay';
|
|
18
18
|
import endOfDay from 'date-fns/endOfDay';
|
|
19
19
|
import isSameDay from 'date-fns/isSameDay';
|
|
20
|
-
import { Transition, animated } from 'react-spring
|
|
20
|
+
import { Transition, animated } from 'react-spring';
|
|
21
21
|
import { Manager, Reference, Popper } from 'react-popper';
|
|
22
22
|
import { Rifm } from 'rifm';
|
|
23
23
|
import format from 'date-fns/format';
|
|
@@ -1041,8 +1041,8 @@ var animationConfig = {
|
|
|
1041
1041
|
transform: "scale(0.95)",
|
|
1042
1042
|
pointerEvents: "none"
|
|
1043
1043
|
},
|
|
1044
|
-
config: function config(
|
|
1045
|
-
return
|
|
1044
|
+
config: function config(_show, _index, state) {
|
|
1045
|
+
return state === "leave" ? {
|
|
1046
1046
|
duration: 80
|
|
1047
1047
|
} : {
|
|
1048
1048
|
duration: 200
|
|
@@ -1051,12 +1051,13 @@ var animationConfig = {
|
|
|
1051
1051
|
};
|
|
1052
1052
|
|
|
1053
1053
|
var MountTransition = function MountTransition(props) {
|
|
1054
|
-
return /*#__PURE__*/createElement(Transition
|
|
1054
|
+
return /*#__PURE__*/createElement(Transition
|
|
1055
|
+
, Object.assign({
|
|
1055
1056
|
items: props.visible
|
|
1056
|
-
}, animationConfig, props), function (show,
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1057
|
+
}, animationConfig, props), function (styles, show, _ref, index) {
|
|
1058
|
+
var phase = _ref.phase;
|
|
1059
|
+
if (!show) return null;
|
|
1060
|
+
return props.children(styles, phase, index);
|
|
1060
1061
|
});
|
|
1061
1062
|
};
|
|
1062
1063
|
|
|
@@ -1142,11 +1143,13 @@ var DropDown = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1142
1143
|
arrowProps = _ref2.arrowProps;
|
|
1143
1144
|
var popperWrapperStyle = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, style), transitionStyles), {}, {
|
|
1144
1145
|
backgroundColor: colors.white.base,
|
|
1145
|
-
transform:
|
|
1146
|
+
transform: transitionStyles.transform.to(function (t) {
|
|
1147
|
+
return "".concat(style.transform || "", " ").concat(t || "");
|
|
1148
|
+
}),
|
|
1146
1149
|
transformOrigin: "".concat(arrowProps.style.left || 0, "px ").concat(arrowProps.style.top || 0, "px"),
|
|
1147
1150
|
padding: padding
|
|
1148
1151
|
});
|
|
1149
|
-
return /*#__PURE__*/createElement(
|
|
1152
|
+
return /*#__PURE__*/createElement(animated.div, {
|
|
1150
1153
|
className: cx(dropDownStyle, dropDownClassName),
|
|
1151
1154
|
ref: ref,
|
|
1152
1155
|
style: popperWrapperStyle,
|
|
@@ -1884,17 +1887,15 @@ var Toast = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1884
1887
|
pointerEvents: "none"
|
|
1885
1888
|
}, customStyles[position].transitions.leave),
|
|
1886
1889
|
config: animationConfig.config
|
|
1887
|
-
}, function (show) {
|
|
1888
|
-
return show &&
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
}), _this2.state.text);
|
|
1897
|
-
};
|
|
1890
|
+
}, function (styles, show) {
|
|
1891
|
+
return show && /*#__PURE__*/createElement(animated.div, {
|
|
1892
|
+
className: cx(toastWrapper, _this2.props.className),
|
|
1893
|
+
style: _objectSpread$b(_objectSpread$b({
|
|
1894
|
+
backgroundColor: bColor
|
|
1895
|
+
}, styles), customStyles[position].style)
|
|
1896
|
+
}, /*#__PURE__*/createElement("i", {
|
|
1897
|
+
className: iconClass
|
|
1898
|
+
}), _this2.state.text);
|
|
1898
1899
|
});
|
|
1899
1900
|
}
|
|
1900
1901
|
}], [{
|
|
@@ -2009,15 +2010,16 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
2009
2010
|
createElement(MountTransition, {
|
|
2010
2011
|
visible: visible
|
|
2011
2012
|
}, function (transitionStyles) {
|
|
2012
|
-
return /*#__PURE__*/createElement(
|
|
2013
|
+
return /*#__PURE__*/createElement(animated.div, {
|
|
2013
2014
|
style: {
|
|
2014
2015
|
opacity: transitionStyles.opacity
|
|
2015
2016
|
},
|
|
2016
2017
|
className: cx(modalContainer, backDropClassName)
|
|
2017
|
-
}, /*#__PURE__*/createElement(
|
|
2018
|
-
|
|
2018
|
+
}, /*#__PURE__*/createElement(animated.div, {
|
|
2019
|
+
style: {
|
|
2019
2020
|
transform: transitionStyles.transform
|
|
2020
|
-
},
|
|
2021
|
+
},
|
|
2022
|
+
className: modalClassName
|
|
2021
2023
|
}, children));
|
|
2022
2024
|
}), node);
|
|
2023
2025
|
}
|
|
@@ -2875,10 +2877,12 @@ var PebblePopper = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
2875
2877
|
arrowProps = _ref2.arrowProps;
|
|
2876
2878
|
var wrapperStyle = _objectSpread$i(_objectSpread$i(_objectSpread$i({}, style), transitionStyles), {}, {
|
|
2877
2879
|
backgroundColor: popperBackgroundColor,
|
|
2878
|
-
transform:
|
|
2880
|
+
transform: transitionStyles.transform.to(function (t) {
|
|
2881
|
+
return "".concat(style.transform || "", " ").concat(t || "");
|
|
2882
|
+
}),
|
|
2879
2883
|
transformOrigin: "".concat(arrowProps.style.left || 0, "px ").concat(arrowProps.style.top || 0, "px")
|
|
2880
2884
|
});
|
|
2881
|
-
return /*#__PURE__*/createElement(
|
|
2885
|
+
return /*#__PURE__*/createElement(animated.div, {
|
|
2882
2886
|
className: cx(popperStyle, popperClassName),
|
|
2883
2887
|
ref: ref,
|
|
2884
2888
|
style: wrapperStyle,
|
|
@@ -4470,8 +4474,7 @@ var TypeAhead = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
4470
4474
|
onFocus: this.onFocus,
|
|
4471
4475
|
value: value
|
|
4472
4476
|
}, this.props), /*#__PURE__*/createElement(MountTransition, {
|
|
4473
|
-
visible: showSuggestions
|
|
4474
|
-
native: true
|
|
4477
|
+
visible: showSuggestions
|
|
4475
4478
|
}, function (transitionStyles) {
|
|
4476
4479
|
return /*#__PURE__*/createElement(animated.div, {
|
|
4477
4480
|
style: transitionStyles,
|