@ornikar/kitt-universal 31.1.1 → 31.2.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/definitions/Button/Button.d.ts +5 -0
  3. package/dist/definitions/Button/Button.d.ts.map +1 -1
  4. package/dist/definitions/Button/ButtonGauge.d.ts +9 -0
  5. package/dist/definitions/Button/ButtonGauge.d.ts.map +1 -0
  6. package/dist/definitions/CardModal/CardModalAnimation/CardModalAnimation.web.d.ts +4 -0
  7. package/dist/definitions/CardModal/CardModalAnimation/CardModalAnimation.web.d.ts.map +1 -0
  8. package/dist/definitions/CardModal/CardModalAnimation/NativeRotationAnimation.d.ts +1 -0
  9. package/dist/definitions/CardModal/CardModalAnimation/NativeRotationAnimation.d.ts.map +1 -1
  10. package/dist/index-metro.es.android.js +81 -9
  11. package/dist/index-metro.es.android.js.map +1 -1
  12. package/dist/index-metro.es.ios.js +81 -9
  13. package/dist/index-metro.es.ios.js.map +1 -1
  14. package/dist/index-node-22.17.cjs.js +82 -8
  15. package/dist/index-node-22.17.cjs.js.map +1 -1
  16. package/dist/index-node-22.17.cjs.web.css +8 -0
  17. package/dist/index-node-22.17.cjs.web.js +152 -152
  18. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  19. package/dist/index-node-22.17.es.mjs +83 -9
  20. package/dist/index-node-22.17.es.mjs.map +1 -1
  21. package/dist/index-node-22.17.es.web.css +8 -0
  22. package/dist/index-node-22.17.es.web.mjs +153 -153
  23. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  24. package/dist/index.es.js +83 -9
  25. package/dist/index.es.js.map +1 -1
  26. package/dist/index.es.web.js +168 -167
  27. package/dist/index.es.web.js.map +1 -1
  28. package/dist/styles.css +8 -0
  29. package/dist/tsbuildinfo +1 -1
  30. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [31.2.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@31.1.1...@ornikar/kitt-universal@31.2.0) (2025-11-26)
7
+
8
+
9
+ ### Features
10
+
11
+ * **kitt-universal/Button:** add timer gauge option OSE-21414 ([#2771](https://github.com/ornikar/kitt/issues/2771)) ([c1f1e27](https://github.com/ornikar/kitt/commit/c1f1e27fe5dd78718338bab01178bca075c4ae07))
12
+ * upgrade RTL [OSE-18110] ([#2769](https://github.com/ornikar/kitt/issues/2769)) ([56bcbe4](https://github.com/ornikar/kitt/commit/56bcbe4d1933bb4ae099f85b546790ba537d18f7))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **card-modal:** revert remove linaria from card modal OSE-21655 ([#2774](https://github.com/ornikar/kitt/issues/2774)) ([de7c058](https://github.com/ornikar/kitt/commit/de7c058a9b5e228f39de923d7d28e48deb0bb466))
18
+
19
+
20
+
6
21
  ## [31.1.1](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@31.1.0...@ornikar/kitt-universal@31.1.1) (2025-11-24)
7
22
 
8
23
 
@@ -14,6 +14,11 @@ export interface ButtonProps extends Pick<PressableProps, 'onPress' | 'onFocus'
14
14
  iconPosition?: IconPosition;
15
15
  withBadge?: boolean;
16
16
  badgeCount?: number;
17
+ timerAttrs?: {
18
+ duration: number;
19
+ running: boolean;
20
+ onEnded: () => void;
21
+ };
17
22
  testID?: PressableProps['testID'];
18
23
  href?: PressableProps['href'];
19
24
  hrefAttrs?: PressableProps['hrefAttrs'];
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO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M,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAC;IACxD,YAAY,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAChC,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;CACrC;AAED,eAAO,MAAM,MAAM,uOAoGlB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ interface ButtonGaugeProps {
3
+ duration: number;
4
+ running: boolean;
5
+ onEnded: () => void;
6
+ }
7
+ export declare function ButtonGauge({ duration, running, onEnded }: ButtonGaugeProps): ReactNode;
8
+ export {};
9
+ //# sourceMappingURL=ButtonGauge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGauge.d.ts","sourceRoot":"","sources":["../../../src/Button/ButtonGauge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,gBAAgB,GAAG,SAAS,CAgFvF"}
@@ -0,0 +1,4 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { CardModalAnimationProps } from './CardModalAnimation';
3
+ export declare function CardModalAnimation({ children, appear, visible, unmountOnExit, isAnimationEnabled, onEnter, onEntered, onExit, onExited, onClose, ...props }: CardModalAnimationProps): ReactNode;
4
+ //# sourceMappingURL=CardModalAnimation.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardModalAnimation.web.d.ts","sourceRoot":"","sources":["../../../../src/CardModal/CardModalAnimation/CardModalAnimation.web.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAW/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAiEpE,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,MAAa,EACb,OAAO,EACP,aAAoB,EACpB,kBAAyB,EACzB,OAAO,EACP,SAAS,EACT,MAAM,EACN,QAAQ,EACR,OAAO,EACP,GAAG,KAAK,EACT,EAAE,uBAAuB,GAAG,SAAS,CA0CrC"}
@@ -2,6 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import type { CardModalAnimationProps } from './CardModalAnimation';
3
3
  export interface NativeRotationAnimationProps {
4
4
  children: ReactNode;
5
+ topInset?: number;
5
6
  visible?: CardModalAnimationProps['visible'];
6
7
  onEntered?: CardModalAnimationProps['onEntered'];
7
8
  onExited: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeRotationAnimation.d.ts","sourceRoot":"","sources":["../../../../src/CardModal/CardModalAnimation/NativeRotationAnimation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE,4BAA4B,GAAG,SAAS,CAsC1C"}
1
+ {"version":3,"file":"NativeRotationAnimation.d.ts","sourceRoot":"","sources":["../../../../src/CardModal/CardModalAnimation/NativeRotationAnimation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE,4BAA4B,GAAG,SAAS,CAsC1C"}
@@ -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, useRef, useEffect, useState, Children, useReducer, Fragment as Fragment$1, useCallback } from 'react';
3
+ import React, { useContext, createContext, forwardRef, useMemo, cloneElement, useState, useRef, useCallback, useLayoutEffect, useEffect, Children, useReducer, Fragment as Fragment$1 } 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,6 +3634,79 @@ 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
+
3637
3710
  function ButtonPadding({
3638
3711
  children,
3639
3712
  size,
@@ -3724,6 +3797,7 @@ const Button = /*#__PURE__*/forwardRef(({
3724
3797
  hrefAttrs,
3725
3798
  withBadge,
3726
3799
  badgeCount,
3800
+ timerAttrs,
3727
3801
  accessibilityRole: _accessibilityRole = 'button',
3728
3802
  innerSpacing: _innerSpacing = 'center',
3729
3803
  isHoveredInternal,
@@ -3771,7 +3845,7 @@ const Button = /*#__PURE__*/forwardRef(({
3771
3845
  isHovered,
3772
3846
  isPressed,
3773
3847
  isFocused
3774
- }) => /*#__PURE__*/jsx(AnimatedContainer$2, {
3848
+ }) => /*#__PURE__*/jsxs(AnimatedContainer$2, {
3775
3849
  animatedStyles: animatedStyles,
3776
3850
  type: _type,
3777
3851
  isHovered: isHovered || isHoveredInternal,
@@ -3781,7 +3855,7 @@ const Button = /*#__PURE__*/forwardRef(({
3781
3855
  size: _size,
3782
3856
  isIconOnly: isIconOnly,
3783
3857
  isStretch: stretch,
3784
- children: /*#__PURE__*/jsxs(ButtonPadding, {
3858
+ children: [timerAttrs ? /*#__PURE__*/jsx(ButtonGauge, _objectSpread({}, timerAttrs)) : null, /*#__PURE__*/jsxs(ButtonPadding, {
3785
3859
  size: _size,
3786
3860
  isIconOnly: isIconOnly,
3787
3861
  children: [/*#__PURE__*/jsx(ButtonContent, {
@@ -3803,7 +3877,7 @@ const Button = /*#__PURE__*/forwardRef(({
3803
3877
  isHovered: isHovered,
3804
3878
  isPressed: isPressed
3805
3879
  })]
3806
- })
3880
+ })]
3807
3881
  })
3808
3882
  });
3809
3883
  });
@@ -4317,7 +4391,7 @@ function NativeOpacityAnimation$2({
4317
4391
  runOnJS(handleAnimationFinished)();
4318
4392
  })
4319
4393
  };
4320
- }, [visible]);
4394
+ });
4321
4395
  return /*#__PURE__*/jsx(Animated.View, {
4322
4396
  style: [StyleSheet.absoluteFillObject, opacityStyle],
4323
4397
  children: children
@@ -4372,11 +4446,9 @@ function NativeRotationAnimation$1({
4372
4446
  rotateZ: `${rotation.value}deg`
4373
4447
  }]
4374
4448
  };
4375
- }, [rotation, visible]);
4449
+ });
4376
4450
  return /*#__PURE__*/jsx(Animated.View, {
4377
- style: [{
4378
- flexShrink: 1
4379
- }, animatedStyle],
4451
+ style: [animatedStyle],
4380
4452
  children: children
4381
4453
  });
4382
4454
  }