@ornikar/kitt-universal 31.1.0 → 31.1.2-canary.31eec21cbe0c2b92255fb1fa14d83757a05ea8b0.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 +20 -0
- package/dist/definitions/Button/Button.d.ts +5 -0
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/ButtonGauge.d.ts +9 -0
- package/dist/definitions/Button/ButtonGauge.d.ts.map +1 -0
- package/dist/definitions/NavigationBottomSheet/NavigationBottomSheet.d.ts +3 -0
- package/dist/definitions/NavigationBottomSheet/NavigationBottomSheet.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLinkWebWrapper.web.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +81 -6
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +81 -6
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.17.cjs.js +82 -5
- package/dist/index-node-22.17.cjs.js.map +1 -1
- package/dist/index-node-22.17.cjs.web.css +20 -2
- package/dist/index-node-22.17.cjs.web.js +83 -7
- package/dist/index-node-22.17.cjs.web.js.map +1 -1
- package/dist/index-node-22.17.es.mjs +83 -6
- package/dist/index-node-22.17.es.mjs.map +1 -1
- package/dist/index-node-22.17.es.web.css +20 -2
- package/dist/index-node-22.17.es.web.mjs +84 -8
- package/dist/index-node-22.17.es.web.mjs.map +1 -1
- package/dist/index.es.js +84 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +84 -8
- package/dist/index.es.web.js.map +1 -1
- package/dist/styles.css +20 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -20,5 +20,23 @@
|
|
|
20
20
|
.kitt-u_enterActive_e1jmsjrm{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;}
|
|
21
21
|
.kitt-u_exit_e1mwnccz{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;}
|
|
22
22
|
.kitt-u_exitActive_e1004d1h{-webkit-transform:translateY(8px);-ms-transform:translateY(8px);transform:translateY(8px);opacity:0;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;}
|
|
23
|
-
|
|
24
|
-
.
|
|
23
|
+
/* overrides :global(a) in Link styles.module.css */
|
|
24
|
+
.TypographyLinkWebWrapper-module_displayUnderline__KxwMp > * {
|
|
25
|
+
text-decoration: underline;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.TypographyLinkWebWrapper-module_displayUnderline__KxwMp > *:hover,
|
|
29
|
+
.TypographyLinkWebWrapper-module_displayUnderline__KxwMp > *:active,
|
|
30
|
+
.TypographyLinkWebWrapper-module_kitt-hover__CyENw .TypographyLinkWebWrapper-module_displayUnderline__KxwMp > * {
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl > * {
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl > *:hover,
|
|
39
|
+
.TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl > *:active,
|
|
40
|
+
.TypographyLinkWebWrapper-module_kitt-hover__CyENw .TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl > * {
|
|
41
|
+
text-decoration: underline;
|
|
42
|
+
}
|
|
@@ -3651,6 +3651,79 @@ function ButtonContent({
|
|
|
3651
3651
|
});
|
|
3652
3652
|
}
|
|
3653
3653
|
|
|
3654
|
+
function ButtonGauge({
|
|
3655
|
+
duration,
|
|
3656
|
+
running,
|
|
3657
|
+
onEnded
|
|
3658
|
+
}) {
|
|
3659
|
+
const [translate, setTranslate] = react.useState(100);
|
|
3660
|
+
const startTimeRef = react.useRef(0);
|
|
3661
|
+
const pauseTimeRef = react.useRef(0);
|
|
3662
|
+
const rafRef = react.useRef(undefined);
|
|
3663
|
+
const distance = 100;
|
|
3664
|
+
const draw = react.useCallback(timestamp => {
|
|
3665
|
+
const timeElapsedSinceStart = timestamp - startTimeRef.current;
|
|
3666
|
+
// Since the time between frame is not reliable and regular, we have to
|
|
3667
|
+
// limit the progress to prevent overflows
|
|
3668
|
+
const safeProgress = Math.min(distance * timeElapsedSinceStart / duration, distance);
|
|
3669
|
+
setTranslate(safeProgress);
|
|
3670
|
+
if (safeProgress < distance) {
|
|
3671
|
+
if (!rafRef) return;
|
|
3672
|
+
rafRef.current = requestAnimationFrame(draw);
|
|
3673
|
+
return;
|
|
3674
|
+
}
|
|
3675
|
+
onEnded();
|
|
3676
|
+
if (rafRef.current) {
|
|
3677
|
+
cancelAnimationFrame(rafRef.current);
|
|
3678
|
+
}
|
|
3679
|
+
},
|
|
3680
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3681
|
+
[]);
|
|
3682
|
+
react.useLayoutEffect(() => {
|
|
3683
|
+
if (running) {
|
|
3684
|
+
// Resuming from pause
|
|
3685
|
+
if (pauseTimeRef.current > 0) {
|
|
3686
|
+
startTimeRef.current += global.performance.now() - pauseTimeRef.current;
|
|
3687
|
+
draw(global.performance.now());
|
|
3688
|
+
return;
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
// First launch
|
|
3692
|
+
startTimeRef.current = global.performance.now();
|
|
3693
|
+
draw(startTimeRef.current);
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
// On pause
|
|
3697
|
+
if (!running && rafRef.current) {
|
|
3698
|
+
pauseTimeRef.current = global.performance.now();
|
|
3699
|
+
cancelAnimationFrame(rafRef.current);
|
|
3700
|
+
}
|
|
3701
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3702
|
+
}, [running]);
|
|
3703
|
+
react.useEffect(() => {
|
|
3704
|
+
return () => {
|
|
3705
|
+
if (rafRef.current) {
|
|
3706
|
+
cancelAnimationFrame(rafRef.current);
|
|
3707
|
+
}
|
|
3708
|
+
};
|
|
3709
|
+
}, []);
|
|
3710
|
+
return /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3711
|
+
position: "absolute",
|
|
3712
|
+
left: 0,
|
|
3713
|
+
right: 0,
|
|
3714
|
+
top: 0,
|
|
3715
|
+
bottom: 0,
|
|
3716
|
+
overflow: "hidden",
|
|
3717
|
+
alignItems: "flex-end",
|
|
3718
|
+
borderRadius: "kitt.button.borderRadius",
|
|
3719
|
+
children: /*#__PURE__*/jsxRuntime.jsx(View, {
|
|
3720
|
+
width: `${translate}%`,
|
|
3721
|
+
height: "100%",
|
|
3722
|
+
backgroundColor: "kitt.palettes.deepPurple['white-alpha.20']"
|
|
3723
|
+
})
|
|
3724
|
+
});
|
|
3725
|
+
}
|
|
3726
|
+
|
|
3654
3727
|
function ButtonPadding({
|
|
3655
3728
|
children,
|
|
3656
3729
|
size,
|
|
@@ -3723,6 +3796,7 @@ const Button = /*#__PURE__*/react.forwardRef(({
|
|
|
3723
3796
|
hrefAttrs,
|
|
3724
3797
|
withBadge,
|
|
3725
3798
|
badgeCount,
|
|
3799
|
+
timerAttrs,
|
|
3726
3800
|
accessibilityRole = 'button',
|
|
3727
3801
|
innerSpacing = 'center',
|
|
3728
3802
|
isHoveredInternal,
|
|
@@ -3767,7 +3841,7 @@ const Button = /*#__PURE__*/react.forwardRef(({
|
|
|
3767
3841
|
isHovered,
|
|
3768
3842
|
isPressed,
|
|
3769
3843
|
isFocused
|
|
3770
|
-
}) => /*#__PURE__*/jsxRuntime.
|
|
3844
|
+
}) => /*#__PURE__*/jsxRuntime.jsxs(AnimatedContainer$2, {
|
|
3771
3845
|
animatedStyles: animatedStyles,
|
|
3772
3846
|
type: type,
|
|
3773
3847
|
isHovered: isHovered || isHoveredInternal,
|
|
@@ -3777,7 +3851,9 @@ const Button = /*#__PURE__*/react.forwardRef(({
|
|
|
3777
3851
|
size: size,
|
|
3778
3852
|
isIconOnly: isIconOnly,
|
|
3779
3853
|
isStretch: stretch,
|
|
3780
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
3854
|
+
children: [timerAttrs ? /*#__PURE__*/jsxRuntime.jsx(ButtonGauge, {
|
|
3855
|
+
...timerAttrs
|
|
3856
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsxs(ButtonPadding, {
|
|
3781
3857
|
size: size,
|
|
3782
3858
|
isIconOnly: isIconOnly,
|
|
3783
3859
|
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
|
|
@@ -3799,7 +3875,7 @@ const Button = /*#__PURE__*/react.forwardRef(({
|
|
|
3799
3875
|
isHovered: isHovered,
|
|
3800
3876
|
isPressed: isPressed
|
|
3801
3877
|
})]
|
|
3802
|
-
})
|
|
3878
|
+
})]
|
|
3803
3879
|
})
|
|
3804
3880
|
});
|
|
3805
3881
|
});
|
|
@@ -13219,15 +13295,15 @@ function TypographyEmoji({
|
|
|
13219
13295
|
});
|
|
13220
13296
|
}
|
|
13221
13297
|
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
const displayUnderlineWhenHovered = "kitt-u_displayUnderlineWhenHovered_d80w0t7";
|
|
13298
|
+
const styles = {"displayUnderline":"TypographyLinkWebWrapper-module_displayUnderline__KxwMp","kitt-hover":"TypographyLinkWebWrapper-module_kitt-hover__CyENw","displayUnderlineWhenHovered":"TypographyLinkWebWrapper-module_displayUnderlineWhenHovered__5V5Cl"};
|
|
13299
|
+
|
|
13225
13300
|
function TypographyLinkWebWrapper({
|
|
13226
13301
|
children,
|
|
13227
13302
|
hasNoUnderline
|
|
13228
13303
|
}) {
|
|
13304
|
+
const className = hasNoUnderline ? `${styles.displayUnderline} ${styles.displayUnderlineWhenHovered}` : styles.displayUnderline;
|
|
13229
13305
|
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
13230
|
-
className:
|
|
13306
|
+
className: className,
|
|
13231
13307
|
children: children
|
|
13232
13308
|
});
|
|
13233
13309
|
}
|