@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
|
@@ -3657,79 +3657,6 @@ function ButtonContent({
|
|
|
3657
3657
|
});
|
|
3658
3658
|
}
|
|
3659
3659
|
|
|
3660
|
-
function ButtonGauge({
|
|
3661
|
-
duration,
|
|
3662
|
-
running,
|
|
3663
|
-
onEnded
|
|
3664
|
-
}) {
|
|
3665
|
-
const [translate, setTranslate] = React.useState(100);
|
|
3666
|
-
const startTimeRef = React.useRef(0);
|
|
3667
|
-
const pauseTimeRef = React.useRef(0);
|
|
3668
|
-
const rafRef = React.useRef(undefined);
|
|
3669
|
-
const distance = 100;
|
|
3670
|
-
const draw = React.useCallback(timestamp => {
|
|
3671
|
-
const timeElapsedSinceStart = timestamp - startTimeRef.current;
|
|
3672
|
-
// Since the time between frame is not reliable and regular, we have to
|
|
3673
|
-
// limit the progress to prevent overflows
|
|
3674
|
-
const safeProgress = Math.min(distance * timeElapsedSinceStart / duration, distance);
|
|
3675
|
-
setTranslate(safeProgress);
|
|
3676
|
-
if (safeProgress < distance) {
|
|
3677
|
-
if (!rafRef) return;
|
|
3678
|
-
rafRef.current = requestAnimationFrame(draw);
|
|
3679
|
-
return;
|
|
3680
|
-
}
|
|
3681
|
-
onEnded();
|
|
3682
|
-
if (rafRef.current) {
|
|
3683
|
-
cancelAnimationFrame(rafRef.current);
|
|
3684
|
-
}
|
|
3685
|
-
},
|
|
3686
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3687
|
-
[]);
|
|
3688
|
-
React.useLayoutEffect(() => {
|
|
3689
|
-
if (running) {
|
|
3690
|
-
// Resuming from pause
|
|
3691
|
-
if (pauseTimeRef.current > 0) {
|
|
3692
|
-
startTimeRef.current += global.performance.now() - pauseTimeRef.current;
|
|
3693
|
-
draw(global.performance.now());
|
|
3694
|
-
return;
|
|
3695
|
-
}
|
|
3696
|
-
|
|
3697
|
-
// First launch
|
|
3698
|
-
startTimeRef.current = global.performance.now();
|
|
3699
|
-
draw(startTimeRef.current);
|
|
3700
|
-
}
|
|
3701
|
-
|
|
3702
|
-
// On pause
|
|
3703
|
-
if (!running && rafRef.current) {
|
|
3704
|
-
pauseTimeRef.current = global.performance.now();
|
|
3705
|
-
cancelAnimationFrame(rafRef.current);
|
|
3706
|
-
}
|
|
3707
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3708
|
-
}, [running]);
|
|
3709
|
-
React.useEffect(() => {
|
|
3710
|
-
return () => {
|
|
3711
|
-
if (rafRef.current) {
|
|
3712
|
-
cancelAnimationFrame(rafRef.current);
|
|
3713
|
-
}
|
|
3714
|
-
};
|
|
3715
|
-
}, []);
|
|
3716
|
-
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3717
|
-
position: "absolute",
|
|
3718
|
-
left: 0,
|
|
3719
|
-
right: 0,
|
|
3720
|
-
top: 0,
|
|
3721
|
-
bottom: 0,
|
|
3722
|
-
overflow: "hidden",
|
|
3723
|
-
alignItems: "flex-end",
|
|
3724
|
-
borderRadius: "kitt.button.borderRadius",
|
|
3725
|
-
children: /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3726
|
-
width: `${translate}%`,
|
|
3727
|
-
height: "100%",
|
|
3728
|
-
backgroundColor: "kitt.palettes.deepPurple['white-alpha.20']"
|
|
3729
|
-
})
|
|
3730
|
-
});
|
|
3731
|
-
}
|
|
3732
|
-
|
|
3733
3660
|
function ButtonPadding({
|
|
3734
3661
|
children,
|
|
3735
3662
|
size,
|
|
@@ -3820,7 +3747,6 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
3820
3747
|
hrefAttrs,
|
|
3821
3748
|
withBadge,
|
|
3822
3749
|
badgeCount,
|
|
3823
|
-
timerAttrs,
|
|
3824
3750
|
accessibilityRole = 'button',
|
|
3825
3751
|
innerSpacing = 'center',
|
|
3826
3752
|
isHoveredInternal,
|
|
@@ -3868,7 +3794,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
3868
3794
|
isHovered,
|
|
3869
3795
|
isPressed,
|
|
3870
3796
|
isFocused
|
|
3871
|
-
}) => /*#__PURE__*/jsxRuntime.
|
|
3797
|
+
}) => /*#__PURE__*/jsxRuntime.jsx(AnimatedContainer$2, {
|
|
3872
3798
|
animatedStyles: animatedStyles,
|
|
3873
3799
|
type: type,
|
|
3874
3800
|
isHovered: isHovered || isHoveredInternal,
|
|
@@ -3878,9 +3804,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
3878
3804
|
size: size,
|
|
3879
3805
|
isIconOnly: isIconOnly,
|
|
3880
3806
|
isStretch: stretch,
|
|
3881
|
-
children:
|
|
3882
|
-
...timerAttrs
|
|
3883
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsxs(ButtonPadding, {
|
|
3807
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(ButtonPadding, {
|
|
3884
3808
|
size: size,
|
|
3885
3809
|
isIconOnly: isIconOnly,
|
|
3886
3810
|
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
|
|
@@ -3902,7 +3826,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
3902
3826
|
isHovered: isHovered,
|
|
3903
3827
|
isPressed: isPressed
|
|
3904
3828
|
})]
|
|
3905
|
-
})
|
|
3829
|
+
})
|
|
3906
3830
|
})
|
|
3907
3831
|
});
|
|
3908
3832
|
});
|