pebble-web 2.26.1 → 3.0.0-alpha.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/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 +2 -2
- 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
package/dist/pebble-web.es.js
CHANGED
|
@@ -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
|
|
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';
|
|
@@ -1084,7 +1084,7 @@ const animationConfig = {
|
|
|
1084
1084
|
transform: "scale(0.95)",
|
|
1085
1085
|
pointerEvents: "none"
|
|
1086
1086
|
},
|
|
1087
|
-
config: (
|
|
1087
|
+
config: (_show, _index, state) => state === "leave" ? {
|
|
1088
1088
|
duration: 80
|
|
1089
1089
|
} : {
|
|
1090
1090
|
duration: 200
|
|
@@ -1094,7 +1094,12 @@ const animationConfig = {
|
|
|
1094
1094
|
const MountTransition = props => {
|
|
1095
1095
|
return /*#__PURE__*/createElement(Transition, Object.assign({
|
|
1096
1096
|
items: props.visible
|
|
1097
|
-
}, animationConfig, props), (
|
|
1097
|
+
}, animationConfig, props), (styles, show, {
|
|
1098
|
+
phase
|
|
1099
|
+
}, index) => {
|
|
1100
|
+
if (!show) return null;
|
|
1101
|
+
return props.children(styles, phase, index);
|
|
1102
|
+
});
|
|
1098
1103
|
};
|
|
1099
1104
|
|
|
1100
1105
|
class DropDown extends PureComponent {
|
|
@@ -1171,11 +1176,11 @@ class DropDown extends PureComponent {
|
|
|
1171
1176
|
const popperWrapperStyle = { ...style,
|
|
1172
1177
|
...transitionStyles,
|
|
1173
1178
|
backgroundColor: colors.white.base,
|
|
1174
|
-
transform: `${style.transform || ""} ${
|
|
1179
|
+
transform: transitionStyles.transform.to(t => `${style.transform || ""} ${t || ""}`),
|
|
1175
1180
|
transformOrigin: `${arrowProps.style.left || 0}px ${arrowProps.style.top || 0}px`,
|
|
1176
1181
|
padding
|
|
1177
1182
|
};
|
|
1178
|
-
return /*#__PURE__*/createElement(
|
|
1183
|
+
return /*#__PURE__*/createElement(animated.div, {
|
|
1179
1184
|
className: cx(dropDownStyle, dropDownClassName),
|
|
1180
1185
|
ref: ref,
|
|
1181
1186
|
style: popperWrapperStyle,
|
|
@@ -1882,7 +1887,7 @@ class Toast extends PureComponent {
|
|
|
1882
1887
|
...customStyles[position].transitions.leave
|
|
1883
1888
|
},
|
|
1884
1889
|
config: animationConfig.config
|
|
1885
|
-
}, show => show &&
|
|
1890
|
+
}, (styles, show) => show && /*#__PURE__*/createElement(animated.div, {
|
|
1886
1891
|
className: cx(toastWrapper, this.props.className),
|
|
1887
1892
|
style: {
|
|
1888
1893
|
backgroundColor: bColor,
|
|
@@ -1891,7 +1896,7 @@ class Toast extends PureComponent {
|
|
|
1891
1896
|
}
|
|
1892
1897
|
}, /*#__PURE__*/createElement("i", {
|
|
1893
1898
|
className: iconClass
|
|
1894
|
-
}), this.state.text))
|
|
1899
|
+
}), this.state.text));
|
|
1895
1900
|
}
|
|
1896
1901
|
}
|
|
1897
1902
|
|
|
@@ -1971,15 +1976,16 @@ class Modal extends PureComponent {
|
|
|
1971
1976
|
/*#__PURE__*/
|
|
1972
1977
|
createElement(MountTransition, {
|
|
1973
1978
|
visible: visible
|
|
1974
|
-
}, transitionStyles => /*#__PURE__*/createElement(
|
|
1979
|
+
}, transitionStyles => /*#__PURE__*/createElement(animated.div, {
|
|
1975
1980
|
style: {
|
|
1976
1981
|
opacity: transitionStyles.opacity
|
|
1977
1982
|
},
|
|
1978
1983
|
className: cx(modalContainer, backDropClassName)
|
|
1979
|
-
}, /*#__PURE__*/createElement(
|
|
1980
|
-
|
|
1984
|
+
}, /*#__PURE__*/createElement(animated.div, {
|
|
1985
|
+
style: {
|
|
1981
1986
|
transform: transitionStyles.transform
|
|
1982
|
-
},
|
|
1987
|
+
},
|
|
1988
|
+
className: modalClassName
|
|
1983
1989
|
}, children))), node);
|
|
1984
1990
|
}
|
|
1985
1991
|
}
|
|
@@ -2796,10 +2802,10 @@ class PebblePopper extends PureComponent {
|
|
|
2796
2802
|
const wrapperStyle = { ...style,
|
|
2797
2803
|
...transitionStyles,
|
|
2798
2804
|
backgroundColor: popperBackgroundColor,
|
|
2799
|
-
transform: `${style.transform || ""} ${
|
|
2805
|
+
transform: transitionStyles.transform.to(t => `${style.transform || ""} ${t || ""}`),
|
|
2800
2806
|
transformOrigin: `${arrowProps.style.left || 0}px ${arrowProps.style.top || 0}px`
|
|
2801
2807
|
};
|
|
2802
|
-
return /*#__PURE__*/createElement(
|
|
2808
|
+
return /*#__PURE__*/createElement(animated.div, {
|
|
2803
2809
|
className: cx(popperStyle, popperClassName),
|
|
2804
2810
|
ref: ref,
|
|
2805
2811
|
style: wrapperStyle,
|
|
@@ -4302,8 +4308,7 @@ class TypeAhead extends PureComponent {
|
|
|
4302
4308
|
}, { ...this.props,
|
|
4303
4309
|
testId: testIds.searchBoxId
|
|
4304
4310
|
}), /*#__PURE__*/createElement(MountTransition, {
|
|
4305
|
-
visible: showSuggestions
|
|
4306
|
-
native: true
|
|
4311
|
+
visible: showSuggestions
|
|
4307
4312
|
}, transitionStyles => /*#__PURE__*/createElement(animated.div, {
|
|
4308
4313
|
style: transitionStyles,
|
|
4309
4314
|
className: cx(optionsWrapper$1, dropdownClassName)
|