@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.
@@ -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 { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -3634,79 +3634,6 @@ function ButtonContent(_ref) {
3634
3634
  });
3635
3635
  }
3636
3636
 
3637
- function ButtonGauge({
3638
- duration,
3639
- running,
3640
- onEnded
3641
- }) {
3642
- const [translate, setTranslate] = useState(100);
3643
- const startTimeRef = useRef(0);
3644
- const pauseTimeRef = useRef(0);
3645
- const rafRef = useRef(undefined);
3646
- const distance = 100;
3647
- const draw = useCallback(timestamp => {
3648
- const timeElapsedSinceStart = timestamp - startTimeRef.current;
3649
- // Since the time between frame is not reliable and regular, we have to
3650
- // limit the progress to prevent overflows
3651
- const safeProgress = Math.min(distance * timeElapsedSinceStart / duration, distance);
3652
- setTranslate(safeProgress);
3653
- if (safeProgress < distance) {
3654
- if (!rafRef) return;
3655
- rafRef.current = requestAnimationFrame(draw);
3656
- return;
3657
- }
3658
- onEnded();
3659
- if (rafRef.current) {
3660
- cancelAnimationFrame(rafRef.current);
3661
- }
3662
- },
3663
- // eslint-disable-next-line react-hooks/exhaustive-deps
3664
- []);
3665
- useLayoutEffect(() => {
3666
- if (running) {
3667
- // Resuming from pause
3668
- if (pauseTimeRef.current > 0) {
3669
- startTimeRef.current += global.performance.now() - pauseTimeRef.current;
3670
- draw(global.performance.now());
3671
- return;
3672
- }
3673
-
3674
- // First launch
3675
- startTimeRef.current = global.performance.now();
3676
- draw(startTimeRef.current);
3677
- }
3678
-
3679
- // On pause
3680
- if (!running && rafRef.current) {
3681
- pauseTimeRef.current = global.performance.now();
3682
- cancelAnimationFrame(rafRef.current);
3683
- }
3684
- // eslint-disable-next-line react-hooks/exhaustive-deps
3685
- }, [running]);
3686
- useEffect(() => {
3687
- return () => {
3688
- if (rafRef.current) {
3689
- cancelAnimationFrame(rafRef.current);
3690
- }
3691
- };
3692
- }, []);
3693
- return /*#__PURE__*/jsx(View, {
3694
- position: "absolute",
3695
- left: 0,
3696
- right: 0,
3697
- top: 0,
3698
- bottom: 0,
3699
- overflow: "hidden",
3700
- alignItems: "flex-end",
3701
- borderRadius: "kitt.button.borderRadius",
3702
- children: /*#__PURE__*/jsx(View, {
3703
- width: `${translate}%`,
3704
- height: "100%",
3705
- backgroundColor: "kitt.palettes.deepPurple['white-alpha.20']"
3706
- })
3707
- });
3708
- }
3709
-
3710
3637
  function ButtonPadding({
3711
3638
  children,
3712
3639
  size,
@@ -3797,7 +3724,6 @@ const Button = /*#__PURE__*/forwardRef(({
3797
3724
  hrefAttrs,
3798
3725
  withBadge,
3799
3726
  badgeCount,
3800
- timerAttrs,
3801
3727
  accessibilityRole: _accessibilityRole = 'button',
3802
3728
  innerSpacing: _innerSpacing = 'center',
3803
3729
  isHoveredInternal,
@@ -3845,7 +3771,7 @@ const Button = /*#__PURE__*/forwardRef(({
3845
3771
  isHovered,
3846
3772
  isPressed,
3847
3773
  isFocused
3848
- }) => /*#__PURE__*/jsxs(AnimatedContainer$2, {
3774
+ }) => /*#__PURE__*/jsx(AnimatedContainer$2, {
3849
3775
  animatedStyles: animatedStyles,
3850
3776
  type: _type,
3851
3777
  isHovered: isHovered || isHoveredInternal,
@@ -3855,7 +3781,7 @@ const Button = /*#__PURE__*/forwardRef(({
3855
3781
  size: _size,
3856
3782
  isIconOnly: isIconOnly,
3857
3783
  isStretch: stretch,
3858
- children: [timerAttrs ? /*#__PURE__*/jsx(ButtonGauge, _objectSpread({}, timerAttrs)) : null, /*#__PURE__*/jsxs(ButtonPadding, {
3784
+ children: /*#__PURE__*/jsxs(ButtonPadding, {
3859
3785
  size: _size,
3860
3786
  isIconOnly: isIconOnly,
3861
3787
  children: [/*#__PURE__*/jsx(ButtonContent, {
@@ -3877,7 +3803,7 @@ const Button = /*#__PURE__*/forwardRef(({
3877
3803
  isHovered: isHovered,
3878
3804
  isPressed: isPressed
3879
3805
  })]
3880
- })]
3806
+ })
3881
3807
  })
3882
3808
  });
3883
3809
  });