@micromag/core 0.3.178 → 0.3.180
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/assets/css/styles.css +4 -1
- package/es/components.js +2623 -2472
- package/es/hooks.js +185 -30
- package/es/index.js +1 -1
- package/es/utils.js +89 -1
- package/lib/components.js +2625 -2471
- package/lib/hooks.js +186 -29
- package/lib/index.js +1 -1
- package/lib/utils.js +89 -0
- package/package.json +2 -2
- package/scss/_placeholders.scss +31 -0
- package/scss/_theme.scss +11 -0
package/lib/hooks.js
CHANGED
|
@@ -10,6 +10,8 @@ var isString = require('lodash/isString');
|
|
|
10
10
|
var dayjs = require('dayjs');
|
|
11
11
|
var core = require('@micromag/core');
|
|
12
12
|
var utils = require('@micromag/core/utils');
|
|
13
|
+
var react$1 = require('@use-gesture/react');
|
|
14
|
+
var core$1 = require('@react-spring/core');
|
|
13
15
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
14
16
|
var forms = require('@folklore/forms');
|
|
15
17
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
@@ -21,8 +23,6 @@ var isObject = require('lodash/isObject');
|
|
|
21
23
|
var raf = require('raf');
|
|
22
24
|
var contexts = require('@micromag/core/contexts');
|
|
23
25
|
var cssMediaquery = require('css-mediaquery');
|
|
24
|
-
var core$1 = require('@react-spring/core');
|
|
25
|
-
var react$1 = require('@use-gesture/react');
|
|
26
26
|
var clamp = require('lodash/clamp');
|
|
27
27
|
|
|
28
28
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -234,6 +234,120 @@ var useFormattedTime = function useFormattedTime() {
|
|
|
234
234
|
var eventsManager$1 = typeof document !== 'undefined' ? new core.EventsManager(document) : null;
|
|
235
235
|
var useDocumentEvent = utils.createUseEvent(eventsManager$1);
|
|
236
236
|
|
|
237
|
+
var getValueFromSpring = function getValueFromSpring(s) {
|
|
238
|
+
var _ref = s || {},
|
|
239
|
+
_ref$value = _ref.value,
|
|
240
|
+
v = _ref$value === void 0 ? null : _ref$value;
|
|
241
|
+
|
|
242
|
+
var _ref2 = v || {},
|
|
243
|
+
p = _ref2.progress;
|
|
244
|
+
|
|
245
|
+
return p;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
function useSpringValue(wantedProgress, immediate, params) {
|
|
249
|
+
var _useState = react.useState(wantedProgress),
|
|
250
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
251
|
+
progress = _useState2[0],
|
|
252
|
+
setProgress = _useState2[1];
|
|
253
|
+
|
|
254
|
+
var onChange = react.useCallback(function (spring) {
|
|
255
|
+
return setProgress(getValueFromSpring(spring));
|
|
256
|
+
}, [setProgress]);
|
|
257
|
+
|
|
258
|
+
var _useSpring = core$1.useSpring(function () {
|
|
259
|
+
return _objectSpread__default["default"]({
|
|
260
|
+
progress: wantedProgress,
|
|
261
|
+
onChange: onChange,
|
|
262
|
+
immediate: immediate
|
|
263
|
+
}, params);
|
|
264
|
+
}),
|
|
265
|
+
_useSpring2 = _slicedToArray__default["default"](_useSpring, 2),
|
|
266
|
+
api = _useSpring2[1];
|
|
267
|
+
|
|
268
|
+
react.useEffect(function () {
|
|
269
|
+
if (wantedProgress !== null) {
|
|
270
|
+
api.start(_objectSpread__default["default"]({
|
|
271
|
+
progress: wantedProgress,
|
|
272
|
+
immediate: immediate
|
|
273
|
+
}, params));
|
|
274
|
+
}
|
|
275
|
+
}, [wantedProgress, immediate, params, api]);
|
|
276
|
+
return immediate ? wantedProgress : progress;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function useDragProgress() {
|
|
280
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
281
|
+
wantedProgress = _ref.progress,
|
|
282
|
+
_ref$onTap = _ref.onTap,
|
|
283
|
+
onTap = _ref$onTap === void 0 ? null : _ref$onTap,
|
|
284
|
+
_ref$disabled = _ref.disabled,
|
|
285
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
286
|
+
_ref$dragDisabled = _ref.dragDisabled,
|
|
287
|
+
dragDisabled = _ref$dragDisabled === void 0 ? false : _ref$dragDisabled,
|
|
288
|
+
_ref$computeProgress = _ref.computeProgress,
|
|
289
|
+
computeProgress = _ref$computeProgress === void 0 ? null : _ref$computeProgress,
|
|
290
|
+
_ref$onProgress = _ref.onProgress,
|
|
291
|
+
onProgress = _ref$onProgress === void 0 ? null : _ref$onProgress,
|
|
292
|
+
_ref$springParams = _ref.springParams,
|
|
293
|
+
springParams = _ref$springParams === void 0 ? undefined : _ref$springParams;
|
|
294
|
+
|
|
295
|
+
var _useState = react.useState({
|
|
296
|
+
dragging: false,
|
|
297
|
+
progress: wantedProgress
|
|
298
|
+
}),
|
|
299
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
300
|
+
_useState2$ = _useState2[0],
|
|
301
|
+
dragging = _useState2$.dragging,
|
|
302
|
+
progress = _useState2$.progress,
|
|
303
|
+
setDragState = _useState2[1];
|
|
304
|
+
|
|
305
|
+
var onDragContent = react.useCallback(function (gestureState) {
|
|
306
|
+
if (disabled) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
var active = gestureState.active,
|
|
311
|
+
tap = gestureState.tap;
|
|
312
|
+
|
|
313
|
+
if (tap) {
|
|
314
|
+
if (onTap !== null) onTap(gestureState);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if (dragDisabled) {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
var newProgress = computeProgress(gestureState);
|
|
323
|
+
setDragState({
|
|
324
|
+
dragging: active,
|
|
325
|
+
progress: newProgress
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
if (onProgress !== null) {
|
|
329
|
+
onProgress(newProgress, gestureState);
|
|
330
|
+
}
|
|
331
|
+
}, [setDragState, disabled, onTap, computeProgress, setDragState, onProgress]);
|
|
332
|
+
var bind = react$1.useDrag(onDragContent, {
|
|
333
|
+
filterTaps: true
|
|
334
|
+
});
|
|
335
|
+
var springedProgress = useSpringValue(progress, dragging || disabled, springParams);
|
|
336
|
+
react.useEffect(function () {
|
|
337
|
+
if (wantedProgress !== progress && !dragging) {
|
|
338
|
+
setDragState({
|
|
339
|
+
dragging: dragging,
|
|
340
|
+
progress: wantedProgress
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}, [wantedProgress]);
|
|
344
|
+
return {
|
|
345
|
+
bind: bind,
|
|
346
|
+
dragging: dragging,
|
|
347
|
+
progress: springedProgress
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
|
|
237
351
|
var _excluded$3 = ["fields", "injectInFields"],
|
|
238
352
|
_excluded2 = ["fields"];
|
|
239
353
|
|
|
@@ -789,25 +903,48 @@ var useLongPress = function useLongPress() {
|
|
|
789
903
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
790
904
|
_ref$onLongPress = _ref.onLongPress,
|
|
791
905
|
onLongPress = _ref$onLongPress === void 0 ? null : _ref$onLongPress,
|
|
906
|
+
_ref$onLongPressStart = _ref.onLongPressStart,
|
|
907
|
+
onLongPressStart = _ref$onLongPressStart === void 0 ? null : _ref$onLongPressStart,
|
|
908
|
+
_ref$onLongPressEnd = _ref.onLongPressEnd,
|
|
909
|
+
onLongPressEnd = _ref$onLongPressEnd === void 0 ? null : _ref$onLongPressEnd,
|
|
792
910
|
_ref$onClick = _ref.onClick,
|
|
793
911
|
onClick = _ref$onClick === void 0 ? null : _ref$onClick,
|
|
794
912
|
_ref$shouldPreventDef = _ref.shouldPreventDefault,
|
|
795
913
|
shouldPreventDefault = _ref$shouldPreventDef === void 0 ? true : _ref$shouldPreventDef,
|
|
914
|
+
_ref$shouldStopPropag = _ref.shouldStopPropagation,
|
|
915
|
+
shouldStopPropagation = _ref$shouldStopPropag === void 0 ? false : _ref$shouldStopPropag,
|
|
916
|
+
_ref$preventClick = _ref.preventClick,
|
|
917
|
+
preventClick = _ref$preventClick === void 0 ? false : _ref$preventClick,
|
|
796
918
|
_ref$delay = _ref.delay,
|
|
797
919
|
delay = _ref$delay === void 0 ? 350 : _ref$delay;
|
|
798
920
|
|
|
799
921
|
var _useState = react.useState(false),
|
|
800
922
|
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
801
|
-
|
|
802
|
-
|
|
923
|
+
pressed = _useState2[0],
|
|
924
|
+
setPressed = _useState2[1];
|
|
925
|
+
|
|
926
|
+
var _useState3 = react.useState(false),
|
|
927
|
+
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
928
|
+
triggered = _useState4[0],
|
|
929
|
+
setTriggered = _useState4[1];
|
|
803
930
|
|
|
804
931
|
var timeout = react.useRef(null);
|
|
805
932
|
var target = react.useRef(null);
|
|
806
|
-
var start = react.useCallback(function (event) {
|
|
933
|
+
var start = react.useCallback(function (event, props) {
|
|
934
|
+
setPressed(true);
|
|
935
|
+
|
|
936
|
+
if (shouldStopPropagation) {
|
|
937
|
+
event.stopPropagation();
|
|
938
|
+
}
|
|
939
|
+
|
|
807
940
|
if (event.target !== null) {
|
|
808
941
|
target.current = event.target;
|
|
809
942
|
}
|
|
810
943
|
|
|
944
|
+
if (onLongPressStart !== null) {
|
|
945
|
+
onLongPressStart(event, props);
|
|
946
|
+
}
|
|
947
|
+
|
|
811
948
|
timeout.current = setTimeout(function () {
|
|
812
949
|
if (shouldPreventDefault && target.current !== null) {
|
|
813
950
|
target.current.addEventListener('touchend', preventDefault, {
|
|
@@ -818,16 +955,23 @@ var useLongPress = function useLongPress() {
|
|
|
818
955
|
});
|
|
819
956
|
}
|
|
820
957
|
|
|
958
|
+
setTriggered(true);
|
|
959
|
+
|
|
821
960
|
if (onLongPress !== null) {
|
|
822
|
-
onLongPress(event);
|
|
961
|
+
onLongPress(event, props);
|
|
962
|
+
setPressed(false);
|
|
823
963
|
}
|
|
824
964
|
|
|
825
|
-
setLongPressTriggered(true);
|
|
826
965
|
timeout.current = null;
|
|
827
966
|
}, delay);
|
|
828
|
-
}, [onLongPress, delay, shouldPreventDefault]);
|
|
829
|
-
var clear = react.useCallback(function (event) {
|
|
830
|
-
var shouldTriggerClick = arguments.length >
|
|
967
|
+
}, [onLongPress, onLongPressStart, delay, setPressed, shouldPreventDefault]);
|
|
968
|
+
var clear = react.useCallback(function (event, props) {
|
|
969
|
+
var shouldTriggerClick = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
970
|
+
setPressed(false);
|
|
971
|
+
|
|
972
|
+
if (preventClick && triggered) {
|
|
973
|
+
return;
|
|
974
|
+
}
|
|
831
975
|
|
|
832
976
|
if (timeout.current !== null) {
|
|
833
977
|
clearTimeout(timeout.current);
|
|
@@ -839,28 +983,39 @@ var useLongPress = function useLongPress() {
|
|
|
839
983
|
}, 10);
|
|
840
984
|
}
|
|
841
985
|
|
|
842
|
-
if (shouldTriggerClick && !
|
|
843
|
-
onClick();
|
|
986
|
+
if (shouldTriggerClick && !triggered && onClick !== null) {
|
|
987
|
+
onClick(props);
|
|
844
988
|
}
|
|
845
989
|
|
|
846
|
-
|
|
847
|
-
|
|
990
|
+
onLongPressEnd(event, props, triggered);
|
|
991
|
+
setTriggered(false);
|
|
992
|
+
}, [shouldPreventDefault, onClick, onLongPressEnd, setPressed, triggered, preventClick]);
|
|
993
|
+
|
|
994
|
+
var bind = function bind() {
|
|
995
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
996
|
+
return {
|
|
997
|
+
onMouseDown: function onMouseDown(e) {
|
|
998
|
+
return start(e, props);
|
|
999
|
+
},
|
|
1000
|
+
onTouchStart: function onTouchStart(e) {
|
|
1001
|
+
return start(e, props);
|
|
1002
|
+
},
|
|
1003
|
+
onMouseUp: function onMouseUp(e) {
|
|
1004
|
+
return clear(e, props);
|
|
1005
|
+
},
|
|
1006
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
1007
|
+
return clear(e, props, false);
|
|
1008
|
+
},
|
|
1009
|
+
onTouchEnd: function onTouchEnd(e) {
|
|
1010
|
+
return clear(e, props);
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
};
|
|
1014
|
+
|
|
848
1015
|
return {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
onTouchStart: function onTouchStart(e) {
|
|
853
|
-
return start(e);
|
|
854
|
-
},
|
|
855
|
-
onMouseUp: function onMouseUp(e) {
|
|
856
|
-
return clear(e);
|
|
857
|
-
},
|
|
858
|
-
onMouseLeave: function onMouseLeave(e) {
|
|
859
|
-
return clear(e, false);
|
|
860
|
-
},
|
|
861
|
-
onTouchEnd: function onTouchEnd(e) {
|
|
862
|
-
return clear(e);
|
|
863
|
-
}
|
|
1016
|
+
bind: bind,
|
|
1017
|
+
pressed: pressed,
|
|
1018
|
+
triggered: triggered
|
|
864
1019
|
};
|
|
865
1020
|
};
|
|
866
1021
|
|
|
@@ -2215,6 +2370,7 @@ exports.useActivityDetector = useActivityDetector;
|
|
|
2215
2370
|
exports.useAnimationFrame = useAnimationFrame;
|
|
2216
2371
|
exports.useDimensionObserver = useDimensionObserver;
|
|
2217
2372
|
exports.useDocumentEvent = useDocumentEvent;
|
|
2373
|
+
exports.useDragProgress = useDragProgress;
|
|
2218
2374
|
exports.useForm = useForm;
|
|
2219
2375
|
exports.useFormTransition = useFormTransition;
|
|
2220
2376
|
exports.useFormattedDate = useFormattedDate;
|
|
@@ -2239,6 +2395,7 @@ exports.useProgressSteps = useProgressSteps;
|
|
|
2239
2395
|
exports.useResizeObserver = useResizeObserver;
|
|
2240
2396
|
exports.useScreenSizeFromElement = useScreenSizeFromElement;
|
|
2241
2397
|
exports.useScreenSizeFromWindow = useScreenSizeFromWindow;
|
|
2398
|
+
exports.useSpringValue = useSpringValue;
|
|
2242
2399
|
exports.useSwipe = useSwipe;
|
|
2243
2400
|
exports.useThemeParser = useThemeParser;
|
|
2244
2401
|
exports.useTrackEvent = useTrackEvent;
|
package/lib/index.js
CHANGED
|
@@ -604,7 +604,7 @@ var pageMetadata = PropTypes__default["default"].shape({
|
|
|
604
604
|
microformats: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({}))
|
|
605
605
|
});
|
|
606
606
|
var authorElement = PropTypes__default["default"].shape({
|
|
607
|
-
name:
|
|
607
|
+
name: textElement,
|
|
608
608
|
avatar: PropTypes__default["default"].shape({
|
|
609
609
|
url: PropTypes__default["default"].string
|
|
610
610
|
})
|
package/lib/utils.js
CHANGED
|
@@ -214,6 +214,94 @@ var createUseEvent = function createUseEvent(eventsManager) {
|
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
216
|
|
|
217
|
+
/* eslint-disable */
|
|
218
|
+
var easings = {
|
|
219
|
+
linear: function linear(x) {
|
|
220
|
+
return x;
|
|
221
|
+
},
|
|
222
|
+
easeInQuad: function easeInQuad(x) {
|
|
223
|
+
return x * x;
|
|
224
|
+
},
|
|
225
|
+
easeOutQuad: function easeOutQuad(x) {
|
|
226
|
+
return 1 - (1 - x) * (1 - x);
|
|
227
|
+
},
|
|
228
|
+
easeInOutQuad: function easeInOutQuad(x) {
|
|
229
|
+
return x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2;
|
|
230
|
+
},
|
|
231
|
+
easeInCubic: function easeInCubic(x) {
|
|
232
|
+
return x * x * x;
|
|
233
|
+
},
|
|
234
|
+
easeOutCubic: function easeOutCubic(x) {
|
|
235
|
+
return 1 - Math.pow(1 - x, 3);
|
|
236
|
+
},
|
|
237
|
+
easeInOutCubic: function easeInOutCubic(x) {
|
|
238
|
+
return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;
|
|
239
|
+
},
|
|
240
|
+
easeInQuart: function easeInQuart(x) {
|
|
241
|
+
return x * x * x * x;
|
|
242
|
+
},
|
|
243
|
+
easeOutQuart: function easeOutQuart(x) {
|
|
244
|
+
return 1 - Math.pow(1 - x, 4);
|
|
245
|
+
},
|
|
246
|
+
easeInOutQuart: function easeInOutQuart(x) {
|
|
247
|
+
return x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2;
|
|
248
|
+
},
|
|
249
|
+
easeInQuint: function easeInQuint(x) {
|
|
250
|
+
return x * x * x * x * x;
|
|
251
|
+
},
|
|
252
|
+
easeOutQuint: function easeOutQuint(x) {
|
|
253
|
+
return 1 - Math.pow(1 - x, 5);
|
|
254
|
+
},
|
|
255
|
+
easeInOutQuint: function easeInOutQuint(x) {
|
|
256
|
+
return x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2;
|
|
257
|
+
},
|
|
258
|
+
easeInSine: function easeInSine(x) {
|
|
259
|
+
return 1 - Math.cos(x * Math.PI / 2);
|
|
260
|
+
},
|
|
261
|
+
easeOutSine: function easeOutSine(x) {
|
|
262
|
+
return Math.sin(x * Math.PI / 2);
|
|
263
|
+
},
|
|
264
|
+
easeInOutSine: function easeInOutSine(x) {
|
|
265
|
+
return -(Math.cos(Math.PI * x) - 1) / 2;
|
|
266
|
+
},
|
|
267
|
+
easeInExpo: function easeInExpo(x) {
|
|
268
|
+
return x === 0 ? 0 : Math.pow(2, 10 * x - 10);
|
|
269
|
+
},
|
|
270
|
+
easeOutExpo: function easeOutExpo(x) {
|
|
271
|
+
return x === 1 ? 1 : 1 - Math.pow(2, -10 * x);
|
|
272
|
+
},
|
|
273
|
+
easeInOutExpo: function easeInOutExpo(x) {
|
|
274
|
+
return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2;
|
|
275
|
+
},
|
|
276
|
+
easeInCirc: function easeInCirc(x) {
|
|
277
|
+
return 1 - Math.sqrt(1 - Math.pow(x, 2));
|
|
278
|
+
},
|
|
279
|
+
easeOutCirc: function easeOutCirc(x) {
|
|
280
|
+
return Math.sqrt(1 - Math.pow(x - 1, 2));
|
|
281
|
+
},
|
|
282
|
+
easeInOutCirc: function easeInOutCirc(x) {
|
|
283
|
+
return x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2;
|
|
284
|
+
},
|
|
285
|
+
easeInBack: function easeInBack(x) {
|
|
286
|
+
return c3 * x * x * x - c1 * x * x;
|
|
287
|
+
},
|
|
288
|
+
easeOutBack: function easeOutBack(x) {
|
|
289
|
+
return 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2);
|
|
290
|
+
},
|
|
291
|
+
easeInOutBack: function easeInOutBack(x) {
|
|
292
|
+
return x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2;
|
|
293
|
+
},
|
|
294
|
+
easeInElastic: function easeInElastic(x) {
|
|
295
|
+
return x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4);
|
|
296
|
+
},
|
|
297
|
+
easeOutElastic: function easeOutElastic(x) {
|
|
298
|
+
return x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1;
|
|
299
|
+
},
|
|
300
|
+
easeInOutElastic: function easeInOutElastic(x) {
|
|
301
|
+
return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
217
305
|
var getColorAsString = function getColorAsString() {
|
|
218
306
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
219
307
|
var overideAlpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
@@ -1036,6 +1124,7 @@ exports.convertStyleToString = convertStyleToString;
|
|
|
1036
1124
|
exports.copyToClipboard = copyToClipboard;
|
|
1037
1125
|
exports.createNullableOnChange = createNullableOnChange;
|
|
1038
1126
|
exports.createUseEvent = createUseEvent;
|
|
1127
|
+
exports.easings = easings;
|
|
1039
1128
|
exports.getColorAsString = getColorAsString;
|
|
1040
1129
|
exports.getComponentFromName = getComponentFromName;
|
|
1041
1130
|
exports.getContrastingColor = getContrastingColor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.180",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"publishConfig": {
|
|
134
134
|
"access": "public"
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "5f49e01759f3350db673329db30ca542b9d2fa6e"
|
|
137
137
|
}
|
package/scss/_placeholders.scss
CHANGED
|
@@ -303,5 +303,36 @@
|
|
|
303
303
|
%focus-outline {
|
|
304
304
|
&:focus-visible {
|
|
305
305
|
outline: 3px solid $purple;
|
|
306
|
+
outline-offset: 4px;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Work in progress:
|
|
312
|
+
* - trying to set up sensible defaults for animating UI elements
|
|
313
|
+
*/
|
|
314
|
+
%transition-bump {
|
|
315
|
+
transition: transform 0.3s $ease-in-bump;
|
|
316
|
+
}
|
|
317
|
+
%transition-bounce {
|
|
318
|
+
transition: transform 0.3s $ease-in-bounce;
|
|
319
|
+
}
|
|
320
|
+
%transition-kickback {
|
|
321
|
+
transition: transform 0.5s $ease-in-kickback;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
%hover-bump {
|
|
325
|
+
@extend %transition-kickback;
|
|
326
|
+
|
|
327
|
+
&:hover {
|
|
328
|
+
transform: scale(1.1);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
%active-bump {
|
|
333
|
+
@extend %transition-bounce;
|
|
334
|
+
|
|
335
|
+
&:active {
|
|
336
|
+
transform: scale(0.95);
|
|
306
337
|
}
|
|
307
338
|
}
|
package/scss/_theme.scss
CHANGED
|
@@ -86,3 +86,14 @@ $btn-active-bg-shade-amount: 50% !default;
|
|
|
86
86
|
$btn-active-bg-tint-amount: 50% !default;
|
|
87
87
|
$btn-active-border-shade-amount: 50% !default;
|
|
88
88
|
$btn-active-border-tint-amount: 25% !default;
|
|
89
|
+
|
|
90
|
+
$ease-in-bounce: cubic-bezier(.075,1.5,.35,.95);
|
|
91
|
+
$ease-in-out-bounce: cubic-bezier(.9,-0.5,.1,1.5);
|
|
92
|
+
$ease-in-out-soft-sine: cubic-bezier(.4,0,.6,1);
|
|
93
|
+
$ease-in-out-sine: cubic-bezier(.6,0,.4,1);
|
|
94
|
+
$ease-in-out-hard-sine: cubic-bezier(.9,0,.1,1);
|
|
95
|
+
$ease-in-ramp: cubic-bezier(.6,0,1,.5);
|
|
96
|
+
$ease-out-ramp: cubic-bezier(0,.6,.5,1);
|
|
97
|
+
$ease-in-kickback: cubic-bezier(.41,1.69,.04,.67);
|
|
98
|
+
$ease-in-yo: cubic-bezier(.21,2.59,0,.9);
|
|
99
|
+
$ease-in-bump: cubic-bezier(.4,1.69,0,1);
|