@ornikar/kitt-universal 31.1.2-canary.31eec21cbe0c2b92255fb1fa14d83757a05ea8b0.0 → 31.1.2-canary.4946783c3d0e6763db7a2d1dbe21658bc5dcdb4f.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/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
- import React, { useContext, createContext, forwardRef, useMemo, cloneElement, useState, useRef, useCallback, useLayoutEffect, useEffect, Children, useReducer, Fragment as Fragment$1 } from 'react';
3
+ import React, { useContext, createContext, forwardRef, useMemo, cloneElement, useRef, useEffect, useState, Children, useReducer, Fragment as Fragment$1, useCallback } from 'react';
4
4
  import { View as View$1, ScrollView as ScrollView$1, Pressable as Pressable$1, Image as Image$1, FlatList as FlatList$1, SectionList as SectionList$1, Stack as Stack$1, VStack as VStack$1, HStack as HStack$1, Center as Center$1, useBreakpointValue as useBreakpointValue$1, useSx, Text, Input, NativeBaseProvider, extendTheme, useMediaQuery } from 'native-base';
5
5
  export { useClipboard, useContrastText, useMediaQuery, useSx, useToken } from 'native-base';
6
6
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -3659,81 +3659,6 @@ function ButtonContent(_ref2) {
3659
3659
  });
3660
3660
  }
3661
3661
 
3662
- function ButtonGauge(_ref) {
3663
- var duration = _ref.duration,
3664
- running = _ref.running,
3665
- onEnded = _ref.onEnded;
3666
- var _useState = useState(100),
3667
- _useState2 = _slicedToArray(_useState, 2),
3668
- translate = _useState2[0],
3669
- setTranslate = _useState2[1];
3670
- var startTimeRef = useRef(0);
3671
- var pauseTimeRef = useRef(0);
3672
- var rafRef = useRef(undefined);
3673
- var distance = 100;
3674
- var draw = useCallback(function (timestamp) {
3675
- var timeElapsedSinceStart = timestamp - startTimeRef.current;
3676
- // Since the time between frame is not reliable and regular, we have to
3677
- // limit the progress to prevent overflows
3678
- var safeProgress = Math.min(distance * timeElapsedSinceStart / duration, distance);
3679
- setTranslate(safeProgress);
3680
- if (safeProgress < distance) {
3681
- if (!rafRef) return;
3682
- rafRef.current = requestAnimationFrame(draw);
3683
- return;
3684
- }
3685
- onEnded();
3686
- if (rafRef.current) {
3687
- cancelAnimationFrame(rafRef.current);
3688
- }
3689
- },
3690
- // eslint-disable-next-line react-hooks/exhaustive-deps
3691
- []);
3692
- useLayoutEffect(function () {
3693
- if (running) {
3694
- // Resuming from pause
3695
- if (pauseTimeRef.current > 0) {
3696
- startTimeRef.current += global.performance.now() - pauseTimeRef.current;
3697
- draw(global.performance.now());
3698
- return;
3699
- }
3700
-
3701
- // First launch
3702
- startTimeRef.current = global.performance.now();
3703
- draw(startTimeRef.current);
3704
- }
3705
-
3706
- // On pause
3707
- if (!running && rafRef.current) {
3708
- pauseTimeRef.current = global.performance.now();
3709
- cancelAnimationFrame(rafRef.current);
3710
- }
3711
- // eslint-disable-next-line react-hooks/exhaustive-deps
3712
- }, [running]);
3713
- useEffect(function () {
3714
- return function () {
3715
- if (rafRef.current) {
3716
- cancelAnimationFrame(rafRef.current);
3717
- }
3718
- };
3719
- }, []);
3720
- return /*#__PURE__*/jsx(View, {
3721
- position: "absolute",
3722
- left: 0,
3723
- right: 0,
3724
- top: 0,
3725
- bottom: 0,
3726
- overflow: "hidden",
3727
- alignItems: "flex-end",
3728
- borderRadius: "kitt.button.borderRadius",
3729
- children: /*#__PURE__*/jsx(View, {
3730
- width: "".concat(translate, "%"),
3731
- height: "100%",
3732
- backgroundColor: "kitt.palettes.deepPurple['white-alpha.20']"
3733
- })
3734
- });
3735
- }
3736
-
3737
3662
  function ButtonPadding(_ref) {
3738
3663
  var children = _ref.children,
3739
3664
  size = _ref.size,
@@ -3822,7 +3747,6 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3822
3747
  hrefAttrs = _ref.hrefAttrs,
3823
3748
  withBadge = _ref.withBadge,
3824
3749
  badgeCount = _ref.badgeCount,
3825
- timerAttrs = _ref.timerAttrs,
3826
3750
  _ref$accessibilityRol = _ref.accessibilityRole,
3827
3751
  accessibilityRole = _ref$accessibilityRol === void 0 ? 'button' : _ref$accessibilityRol,
3828
3752
  _ref$innerSpacing = _ref.innerSpacing,
@@ -3870,7 +3794,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3870
3794
  var isHovered = _ref2.isHovered,
3871
3795
  isPressed = _ref2.isPressed,
3872
3796
  isFocused = _ref2.isFocused;
3873
- return /*#__PURE__*/jsxs(AnimatedContainer$2, {
3797
+ return /*#__PURE__*/jsx(AnimatedContainer$2, {
3874
3798
  animatedStyles: animatedStyles,
3875
3799
  type: type,
3876
3800
  isHovered: isHovered || isHoveredInternal,
@@ -3880,7 +3804,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3880
3804
  size: size,
3881
3805
  isIconOnly: isIconOnly,
3882
3806
  isStretch: stretch,
3883
- children: [timerAttrs ? /*#__PURE__*/jsx(ButtonGauge, _objectSpread({}, timerAttrs)) : null, /*#__PURE__*/jsxs(ButtonPadding, {
3807
+ children: /*#__PURE__*/jsxs(ButtonPadding, {
3884
3808
  size: size,
3885
3809
  isIconOnly: isIconOnly,
3886
3810
  children: [/*#__PURE__*/jsx(ButtonContent, {
@@ -3902,7 +3826,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
3902
3826
  isHovered: isHovered,
3903
3827
  isPressed: isPressed
3904
3828
  })]
3905
- })]
3829
+ })
3906
3830
  });
3907
3831
  }
3908
3832
  });