pebble-web 2.23.0 → 2.24.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 +37 -35
- package/dist/pebble-web.dev.js.map +1 -1
- package/dist/pebble-web.es.dev.js +21 -16
- package/dist/pebble-web.es.dev.js.map +1 -1
- package/dist/pebble-web.es.js +20 -15
- package/dist/pebble-web.es.js.map +1 -1
- package/dist/pebble-web.js +36 -34
- package/dist/pebble-web.js.map +1 -1
- package/dist/pebble-web.module.dev.js +31 -29
- package/dist/pebble-web.module.dev.js.map +1 -1
- package/dist/pebble-web.module.js +30 -28
- package/dist/pebble-web.module.js.map +1 -1
- package/dist/pebble-web.umd.dev.js +3329 -1832
- package/dist/pebble-web.umd.dev.js.map +1 -1
- package/dist/pebble-web.umd.js +3340 -1843
- package/dist/pebble-web.umd.js.map +1 -1
- package/dist/utils/animation.d.ts +6 -18
- 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 +25 -14
- package/src/utils/animation.ts +13 -4
|
@@ -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
|
|
@@ -1053,10 +1053,10 @@ var animationConfig = {
|
|
|
1053
1053
|
var MountTransition = function MountTransition(props) {
|
|
1054
1054
|
return /*#__PURE__*/createElement(Transition, Object.assign({
|
|
1055
1055
|
items: props.visible
|
|
1056
|
-
}, animationConfig, props), function (show,
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1056
|
+
}, animationConfig, props), function (styles, show, _ref, index) {
|
|
1057
|
+
var phase = _ref.phase;
|
|
1058
|
+
if (!show) return null;
|
|
1059
|
+
return props.children(styles, phase, index);
|
|
1060
1060
|
});
|
|
1061
1061
|
};
|
|
1062
1062
|
|
|
@@ -1142,11 +1142,13 @@ var DropDown = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1142
1142
|
arrowProps = _ref2.arrowProps;
|
|
1143
1143
|
var popperWrapperStyle = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, style), transitionStyles), {}, {
|
|
1144
1144
|
backgroundColor: colors.white.base,
|
|
1145
|
-
transform:
|
|
1145
|
+
transform: transitionStyles.transform.to(function (t) {
|
|
1146
|
+
return "".concat(style.transform || "", " ").concat(t || "");
|
|
1147
|
+
}),
|
|
1146
1148
|
transformOrigin: "".concat(arrowProps.style.left || 0, "px ").concat(arrowProps.style.top || 0, "px"),
|
|
1147
1149
|
padding: padding
|
|
1148
1150
|
});
|
|
1149
|
-
return /*#__PURE__*/createElement(
|
|
1151
|
+
return /*#__PURE__*/createElement(animated.div, {
|
|
1150
1152
|
className: cx(dropDownStyle, dropDownClassName),
|
|
1151
1153
|
ref: ref,
|
|
1152
1154
|
style: popperWrapperStyle,
|
|
@@ -1884,17 +1886,15 @@ var Toast = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
1884
1886
|
pointerEvents: "none"
|
|
1885
1887
|
}, customStyles[position].transitions.leave),
|
|
1886
1888
|
config: animationConfig.config
|
|
1887
|
-
}, function (show) {
|
|
1888
|
-
return show &&
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
}), _this2.state.text);
|
|
1897
|
-
};
|
|
1889
|
+
}, function (styles, show) {
|
|
1890
|
+
return show && /*#__PURE__*/createElement(animated.div, {
|
|
1891
|
+
className: cx(toastWrapper, _this2.props.className),
|
|
1892
|
+
style: _objectSpread$b(_objectSpread$b({
|
|
1893
|
+
backgroundColor: bColor
|
|
1894
|
+
}, styles), customStyles[position].style)
|
|
1895
|
+
}, /*#__PURE__*/createElement("i", {
|
|
1896
|
+
className: iconClass
|
|
1897
|
+
}), _this2.state.text);
|
|
1898
1898
|
});
|
|
1899
1899
|
}
|
|
1900
1900
|
}], [{
|
|
@@ -2009,15 +2009,16 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
2009
2009
|
createElement(MountTransition, {
|
|
2010
2010
|
visible: visible
|
|
2011
2011
|
}, function (transitionStyles) {
|
|
2012
|
-
return /*#__PURE__*/createElement(
|
|
2012
|
+
return /*#__PURE__*/createElement(animated.div, {
|
|
2013
2013
|
style: {
|
|
2014
2014
|
opacity: transitionStyles.opacity
|
|
2015
2015
|
},
|
|
2016
2016
|
className: cx(modalContainer, backDropClassName)
|
|
2017
|
-
}, /*#__PURE__*/createElement(
|
|
2018
|
-
|
|
2017
|
+
}, /*#__PURE__*/createElement(animated.div, {
|
|
2018
|
+
style: {
|
|
2019
2019
|
transform: transitionStyles.transform
|
|
2020
|
-
},
|
|
2020
|
+
},
|
|
2021
|
+
className: modalClassName
|
|
2021
2022
|
}, children));
|
|
2022
2023
|
}), node);
|
|
2023
2024
|
}
|
|
@@ -2875,10 +2876,12 @@ var PebblePopper = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
2875
2876
|
arrowProps = _ref2.arrowProps;
|
|
2876
2877
|
var wrapperStyle = _objectSpread$i(_objectSpread$i(_objectSpread$i({}, style), transitionStyles), {}, {
|
|
2877
2878
|
backgroundColor: popperBackgroundColor,
|
|
2878
|
-
transform:
|
|
2879
|
+
transform: transitionStyles.transform.to(function (t) {
|
|
2880
|
+
return "".concat(style.transform || "", " ").concat(t || "");
|
|
2881
|
+
}),
|
|
2879
2882
|
transformOrigin: "".concat(arrowProps.style.left || 0, "px ").concat(arrowProps.style.top || 0, "px")
|
|
2880
2883
|
});
|
|
2881
|
-
return /*#__PURE__*/createElement(
|
|
2884
|
+
return /*#__PURE__*/createElement(animated.div, {
|
|
2882
2885
|
className: cx(popperStyle, popperClassName),
|
|
2883
2886
|
ref: ref,
|
|
2884
2887
|
style: wrapperStyle,
|
|
@@ -4470,8 +4473,7 @@ var TypeAhead = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
4470
4473
|
onFocus: this.onFocus,
|
|
4471
4474
|
value: value
|
|
4472
4475
|
}, this.props), /*#__PURE__*/createElement(MountTransition, {
|
|
4473
|
-
visible: showSuggestions
|
|
4474
|
-
native: true
|
|
4476
|
+
visible: showSuggestions
|
|
4475
4477
|
}, function (transitionStyles) {
|
|
4476
4478
|
return /*#__PURE__*/createElement(animated.div, {
|
|
4477
4479
|
style: transitionStyles,
|