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.
@@ -9,7 +9,7 @@ import addDays from 'date-fns/addDays';
9
9
  import startOfDay from 'date-fns/startOfDay';
10
10
  import endOfDay from 'date-fns/endOfDay';
11
11
  import isSameDay from 'date-fns/isSameDay';
12
- import { Transition, animated } from 'react-spring/renderprops.cjs';
12
+ import { Transition, animated } from 'react-spring';
13
13
  import { Manager, Reference, Popper } from 'react-popper';
14
14
  import { Rifm } from 'rifm';
15
15
  import format from 'date-fns/format';
@@ -994,7 +994,7 @@ const animationConfig = {
994
994
  transform: "scale(0.95)",
995
995
  pointerEvents: "none"
996
996
  },
997
- config: (_a, motion) => motion === "leave" ? {
997
+ config: (_show, _index, state) => state === "leave" ? {
998
998
  duration: 80
999
999
  } : {
1000
1000
  duration: 200
@@ -1002,9 +1002,15 @@ const animationConfig = {
1002
1002
  };
1003
1003
 
1004
1004
  const MountTransition = props => {
1005
- return /*#__PURE__*/createElement(Transition, Object.assign({
1005
+ return /*#__PURE__*/createElement(Transition
1006
+ , Object.assign({
1006
1007
  items: props.visible
1007
- }, animationConfig, props), (show, state, index) => show && (styles => props.children(styles, state, index)));
1008
+ }, animationConfig, props), (styles, show, {
1009
+ phase
1010
+ }, index) => {
1011
+ if (!show) return null;
1012
+ return props.children(styles, phase, index);
1013
+ });
1008
1014
  };
1009
1015
 
1010
1016
  class DropDown extends PureComponent {
@@ -1079,11 +1085,11 @@ class DropDown extends PureComponent {
1079
1085
  const popperWrapperStyle = { ...style,
1080
1086
  ...transitionStyles,
1081
1087
  backgroundColor: colors.white.base,
1082
- transform: `${style.transform || ""} ${transitionStyles.transform || ""}`,
1088
+ transform: transitionStyles.transform.to(t => `${style.transform || ""} ${t || ""}`),
1083
1089
  transformOrigin: `${arrowProps.style.left || 0}px ${arrowProps.style.top || 0}px`,
1084
1090
  padding
1085
1091
  };
1086
- return /*#__PURE__*/createElement("div", {
1092
+ return /*#__PURE__*/createElement(animated.div, {
1087
1093
  className: cx(dropDownStyle, dropDownClassName),
1088
1094
  ref: ref,
1089
1095
  style: popperWrapperStyle,
@@ -1753,7 +1759,7 @@ class Toast extends PureComponent {
1753
1759
  ...customStyles[position].transitions.leave
1754
1760
  },
1755
1761
  config: animationConfig.config
1756
- }, show => show && (styles => /*#__PURE__*/createElement(animated.div, {
1762
+ }, (styles, show) => show && /*#__PURE__*/createElement(animated.div, {
1757
1763
  className: cx(toastWrapper, this.props.className),
1758
1764
  style: {
1759
1765
  backgroundColor: bColor,
@@ -1762,7 +1768,7 @@ class Toast extends PureComponent {
1762
1768
  }
1763
1769
  }, /*#__PURE__*/createElement("i", {
1764
1770
  className: iconClass
1765
- }), this.state.text)));
1771
+ }), this.state.text));
1766
1772
  }
1767
1773
  }
1768
1774
 
@@ -1840,15 +1846,16 @@ class Modal extends PureComponent {
1840
1846
  /*#__PURE__*/
1841
1847
  createElement(MountTransition, {
1842
1848
  visible: visible
1843
- }, transitionStyles => /*#__PURE__*/createElement("div", {
1849
+ }, transitionStyles => /*#__PURE__*/createElement(animated.div, {
1844
1850
  style: {
1845
1851
  opacity: transitionStyles.opacity
1846
1852
  },
1847
1853
  className: cx(modalContainer, backDropClassName)
1848
- }, /*#__PURE__*/createElement("div", {
1849
- className: cx( /*#__PURE__*/css({
1854
+ }, /*#__PURE__*/createElement(animated.div, {
1855
+ style: {
1850
1856
  transform: transitionStyles.transform
1851
- }, ";label:Modal;" + ( "" )), modalClassName)
1857
+ },
1858
+ className: modalClassName
1852
1859
  }, children))), node);
1853
1860
  }
1854
1861
  }
@@ -2638,10 +2645,10 @@ class PebblePopper extends PureComponent {
2638
2645
  const wrapperStyle = { ...style,
2639
2646
  ...transitionStyles,
2640
2647
  backgroundColor: popperBackgroundColor,
2641
- transform: `${style.transform || ""} ${transitionStyles.transform || ""}`,
2648
+ transform: transitionStyles.transform.to(t => `${style.transform || ""} ${t || ""}`),
2642
2649
  transformOrigin: `${arrowProps.style.left || 0}px ${arrowProps.style.top || 0}px`
2643
2650
  };
2644
- return /*#__PURE__*/createElement("div", {
2651
+ return /*#__PURE__*/createElement(animated.div, {
2645
2652
  className: cx(popperStyle, popperClassName),
2646
2653
  ref: ref,
2647
2654
  style: wrapperStyle,
@@ -4116,8 +4123,7 @@ class TypeAhead extends PureComponent {
4116
4123
  onFocus: this.onFocus,
4117
4124
  value
4118
4125
  }, this.props), /*#__PURE__*/createElement(MountTransition, {
4119
- visible: showSuggestions,
4120
- native: true
4126
+ visible: showSuggestions
4121
4127
  }, transitionStyles => /*#__PURE__*/createElement(animated.div, {
4122
4128
  style: transitionStyles,
4123
4129
  className: cx(optionsWrapper$1, dropdownClassName)