@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/CHANGELOG.md +1 -3
- package/dist/definitions/Button/Button.d.ts +0 -5
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLinkWebWrapper.web.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +4 -78
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +4 -78
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +3 -79
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.css +2 -20
- package/dist/index-node-22.17.cjs.web.js +7 -83
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +4 -80
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.css +2 -20
- package/dist/index-node-22.17.es.web.mjs +8 -84
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +4 -80
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +8 -84
- package/dist/index.es.web.js.map +1 -1
- package/dist/styles.css +2 -20
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/definitions/Button/ButtonGauge.d.ts +0 -9
- package/dist/definitions/Button/ButtonGauge.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext, createContext, forwardRef, useMemo, cloneElement,
|
|
1
|
+
import React, { useContext, createContext, forwardRef, useMemo, cloneElement, useRef, useEffect, useState, Children, useReducer, Fragment as Fragment$1, useCallback } from 'react';
|
|
2
2
|
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';
|
|
3
3
|
export { useClipboard, useContrastText, useMediaQuery, useSx, useToken } from 'native-base';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -3633,79 +3633,6 @@ function ButtonContent({
|
|
|
3633
3633
|
});
|
|
3634
3634
|
}
|
|
3635
3635
|
|
|
3636
|
-
function ButtonGauge({
|
|
3637
|
-
duration,
|
|
3638
|
-
running,
|
|
3639
|
-
onEnded
|
|
3640
|
-
}) {
|
|
3641
|
-
const [translate, setTranslate] = useState(100);
|
|
3642
|
-
const startTimeRef = useRef(0);
|
|
3643
|
-
const pauseTimeRef = useRef(0);
|
|
3644
|
-
const rafRef = useRef(undefined);
|
|
3645
|
-
const distance = 100;
|
|
3646
|
-
const draw = useCallback(timestamp => {
|
|
3647
|
-
const timeElapsedSinceStart = timestamp - startTimeRef.current;
|
|
3648
|
-
// Since the time between frame is not reliable and regular, we have to
|
|
3649
|
-
// limit the progress to prevent overflows
|
|
3650
|
-
const safeProgress = Math.min(distance * timeElapsedSinceStart / duration, distance);
|
|
3651
|
-
setTranslate(safeProgress);
|
|
3652
|
-
if (safeProgress < distance) {
|
|
3653
|
-
if (!rafRef) return;
|
|
3654
|
-
rafRef.current = requestAnimationFrame(draw);
|
|
3655
|
-
return;
|
|
3656
|
-
}
|
|
3657
|
-
onEnded();
|
|
3658
|
-
if (rafRef.current) {
|
|
3659
|
-
cancelAnimationFrame(rafRef.current);
|
|
3660
|
-
}
|
|
3661
|
-
},
|
|
3662
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3663
|
-
[]);
|
|
3664
|
-
useLayoutEffect(() => {
|
|
3665
|
-
if (running) {
|
|
3666
|
-
// Resuming from pause
|
|
3667
|
-
if (pauseTimeRef.current > 0) {
|
|
3668
|
-
startTimeRef.current += global.performance.now() - pauseTimeRef.current;
|
|
3669
|
-
draw(global.performance.now());
|
|
3670
|
-
return;
|
|
3671
|
-
}
|
|
3672
|
-
|
|
3673
|
-
// First launch
|
|
3674
|
-
startTimeRef.current = global.performance.now();
|
|
3675
|
-
draw(startTimeRef.current);
|
|
3676
|
-
}
|
|
3677
|
-
|
|
3678
|
-
// On pause
|
|
3679
|
-
if (!running && rafRef.current) {
|
|
3680
|
-
pauseTimeRef.current = global.performance.now();
|
|
3681
|
-
cancelAnimationFrame(rafRef.current);
|
|
3682
|
-
}
|
|
3683
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3684
|
-
}, [running]);
|
|
3685
|
-
useEffect(() => {
|
|
3686
|
-
return () => {
|
|
3687
|
-
if (rafRef.current) {
|
|
3688
|
-
cancelAnimationFrame(rafRef.current);
|
|
3689
|
-
}
|
|
3690
|
-
};
|
|
3691
|
-
}, []);
|
|
3692
|
-
return /*#__PURE__*/jsx(View, {
|
|
3693
|
-
position: "absolute",
|
|
3694
|
-
left: 0,
|
|
3695
|
-
right: 0,
|
|
3696
|
-
top: 0,
|
|
3697
|
-
bottom: 0,
|
|
3698
|
-
overflow: "hidden",
|
|
3699
|
-
alignItems: "flex-end",
|
|
3700
|
-
borderRadius: "kitt.button.borderRadius",
|
|
3701
|
-
children: /*#__PURE__*/jsx(View, {
|
|
3702
|
-
width: `${translate}%`,
|
|
3703
|
-
height: "100%",
|
|
3704
|
-
backgroundColor: "kitt.palettes.deepPurple['white-alpha.20']"
|
|
3705
|
-
})
|
|
3706
|
-
});
|
|
3707
|
-
}
|
|
3708
|
-
|
|
3709
3636
|
function ButtonPadding({
|
|
3710
3637
|
children,
|
|
3711
3638
|
size,
|
|
@@ -3796,7 +3723,6 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
3796
3723
|
hrefAttrs,
|
|
3797
3724
|
withBadge,
|
|
3798
3725
|
badgeCount,
|
|
3799
|
-
timerAttrs,
|
|
3800
3726
|
accessibilityRole = 'button',
|
|
3801
3727
|
innerSpacing = 'center',
|
|
3802
3728
|
isHoveredInternal,
|
|
@@ -3844,7 +3770,7 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
3844
3770
|
isHovered,
|
|
3845
3771
|
isPressed,
|
|
3846
3772
|
isFocused
|
|
3847
|
-
}) => /*#__PURE__*/
|
|
3773
|
+
}) => /*#__PURE__*/jsx(AnimatedContainer$2, {
|
|
3848
3774
|
animatedStyles: animatedStyles,
|
|
3849
3775
|
type: type,
|
|
3850
3776
|
isHovered: isHovered || isHoveredInternal,
|
|
@@ -3854,9 +3780,7 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
3854
3780
|
size: size,
|
|
3855
3781
|
isIconOnly: isIconOnly,
|
|
3856
3782
|
isStretch: stretch,
|
|
3857
|
-
children:
|
|
3858
|
-
...timerAttrs
|
|
3859
|
-
}) : null, /*#__PURE__*/jsxs(ButtonPadding, {
|
|
3783
|
+
children: /*#__PURE__*/jsxs(ButtonPadding, {
|
|
3860
3784
|
size: size,
|
|
3861
3785
|
isIconOnly: isIconOnly,
|
|
3862
3786
|
children: [/*#__PURE__*/jsx(ButtonContent, {
|
|
@@ -3878,7 +3802,7 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
3878
3802
|
isHovered: isHovered,
|
|
3879
3803
|
isPressed: isPressed
|
|
3880
3804
|
})]
|
|
3881
|
-
})
|
|
3805
|
+
})
|
|
3882
3806
|
})
|
|
3883
3807
|
});
|
|
3884
3808
|
});
|