@fluxus-ui/native 0.1.0 → 0.3.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 (117) hide show
  1. package/README.md +16 -2
  2. package/lib/module/AudioPlayer.js +174 -0
  3. package/lib/module/AudioPlayer.js.map +1 -0
  4. package/lib/module/Bubble.js +182 -0
  5. package/lib/module/Bubble.js.map +1 -0
  6. package/lib/module/Button.js +87 -11
  7. package/lib/module/Button.js.map +1 -1
  8. package/lib/module/Card.js +10 -2
  9. package/lib/module/Card.js.map +1 -1
  10. package/lib/module/EmptyState.js +30 -2
  11. package/lib/module/EmptyState.js.map +1 -1
  12. package/lib/module/Link.js +97 -0
  13. package/lib/module/Link.js.map +1 -0
  14. package/lib/module/ListItem.js +9 -3
  15. package/lib/module/ListItem.js.map +1 -1
  16. package/lib/module/Skeleton.js +2 -1
  17. package/lib/module/Skeleton.js.map +1 -1
  18. package/lib/module/Swap.js +3 -3
  19. package/lib/module/Swap.js.map +1 -1
  20. package/lib/module/Toast.js +58 -9
  21. package/lib/module/Toast.js.map +1 -1
  22. package/lib/module/audio.js +54 -0
  23. package/lib/module/audio.js.map +1 -0
  24. package/lib/module/controls.js +61 -28
  25. package/lib/module/controls.js.map +1 -1
  26. package/lib/module/feel.js +24 -0
  27. package/lib/module/feel.js.map +1 -0
  28. package/lib/module/haptics.js +25 -0
  29. package/lib/module/haptics.js.map +1 -0
  30. package/lib/module/icon-host.js +42 -0
  31. package/lib/module/icon-host.js.map +1 -0
  32. package/lib/module/icon-shape.js +222 -0
  33. package/lib/module/icon-shape.js.map +1 -0
  34. package/lib/module/icon.js +293 -13
  35. package/lib/module/icon.js.map +1 -1
  36. package/lib/module/index.js +7 -1
  37. package/lib/module/index.js.map +1 -1
  38. package/lib/module/marks.js +99 -0
  39. package/lib/module/marks.js.map +1 -0
  40. package/lib/module/motion.js +71 -4
  41. package/lib/module/motion.js.map +1 -1
  42. package/lib/module/overlay.js +2 -2
  43. package/lib/module/overlay.js.map +1 -1
  44. package/lib/module/pending.js +11 -7
  45. package/lib/module/pending.js.map +1 -1
  46. package/lib/module/presence.js +8 -5
  47. package/lib/module/presence.js.map +1 -1
  48. package/lib/module/screen.js +6 -1
  49. package/lib/module/screen.js.map +1 -1
  50. package/lib/module/success.js +59 -0
  51. package/lib/module/success.js.map +1 -0
  52. package/lib/typescript/AudioPlayer.d.ts +26 -0
  53. package/lib/typescript/AudioPlayer.d.ts.map +1 -0
  54. package/lib/typescript/Bubble.d.ts +23 -0
  55. package/lib/typescript/Bubble.d.ts.map +1 -0
  56. package/lib/typescript/Button.d.ts +3 -1
  57. package/lib/typescript/Button.d.ts.map +1 -1
  58. package/lib/typescript/Card.d.ts.map +1 -1
  59. package/lib/typescript/EmptyState.d.ts +5 -3
  60. package/lib/typescript/EmptyState.d.ts.map +1 -1
  61. package/lib/typescript/Link.d.ts +23 -0
  62. package/lib/typescript/Link.d.ts.map +1 -0
  63. package/lib/typescript/ListItem.d.ts.map +1 -1
  64. package/lib/typescript/Skeleton.d.ts.map +1 -1
  65. package/lib/typescript/Toast.d.ts.map +1 -1
  66. package/lib/typescript/audio.d.ts +10 -0
  67. package/lib/typescript/audio.d.ts.map +1 -0
  68. package/lib/typescript/controls.d.ts.map +1 -1
  69. package/lib/typescript/feel.d.ts +10 -0
  70. package/lib/typescript/feel.d.ts.map +1 -0
  71. package/lib/typescript/haptics.d.ts +7 -0
  72. package/lib/typescript/haptics.d.ts.map +1 -0
  73. package/lib/typescript/icon-host.d.ts +30 -0
  74. package/lib/typescript/icon-host.d.ts.map +1 -0
  75. package/lib/typescript/icon-shape.d.ts +28 -0
  76. package/lib/typescript/icon-shape.d.ts.map +1 -0
  77. package/lib/typescript/icon.d.ts +13 -14
  78. package/lib/typescript/icon.d.ts.map +1 -1
  79. package/lib/typescript/index.d.ts +7 -1
  80. package/lib/typescript/index.d.ts.map +1 -1
  81. package/lib/typescript/marks.d.ts +23 -0
  82. package/lib/typescript/marks.d.ts.map +1 -0
  83. package/lib/typescript/motion.d.ts +23 -0
  84. package/lib/typescript/motion.d.ts.map +1 -1
  85. package/lib/typescript/pending.d.ts +3 -2
  86. package/lib/typescript/pending.d.ts.map +1 -1
  87. package/lib/typescript/presence.d.ts.map +1 -1
  88. package/lib/typescript/screen.d.ts +7 -2
  89. package/lib/typescript/screen.d.ts.map +1 -1
  90. package/lib/typescript/success.d.ts +13 -0
  91. package/lib/typescript/success.d.ts.map +1 -0
  92. package/package.json +26 -3
  93. package/src/AudioPlayer.tsx +106 -0
  94. package/src/Bubble.tsx +112 -0
  95. package/src/Button.tsx +65 -14
  96. package/src/Card.tsx +7 -2
  97. package/src/EmptyState.tsx +22 -3
  98. package/src/Link.tsx +61 -0
  99. package/src/ListItem.tsx +8 -3
  100. package/src/Skeleton.tsx +2 -1
  101. package/src/Swap.tsx +3 -3
  102. package/src/Toast.tsx +32 -4
  103. package/src/audio.tsx +56 -0
  104. package/src/controls.tsx +37 -9
  105. package/src/feel.ts +22 -0
  106. package/src/haptics.tsx +26 -0
  107. package/src/icon-host.tsx +46 -0
  108. package/src/icon-shape.ts +213 -0
  109. package/src/icon.tsx +252 -15
  110. package/src/index.ts +7 -1
  111. package/src/marks.tsx +79 -0
  112. package/src/motion.ts +76 -4
  113. package/src/overlay.tsx +2 -2
  114. package/src/pending.tsx +11 -7
  115. package/src/presence.tsx +10 -7
  116. package/src/screen.tsx +8 -3
  117. package/src/success.tsx +48 -0
package/src/motion.ts CHANGED
@@ -1,22 +1,94 @@
1
1
  /**
2
2
  * The motion vocabulary of Fluxus on Reanimated: the same names, durations and
3
3
  * springs as the web (core/src/tokens.ts). With reduced motion on in the system,
4
- * a value goes to its end at once. (SPEC §15)
4
+ * a value goes to its end at once. (SPEC §15, §15.12)
5
5
  */
6
- import { Easing, ReduceMotion, withSpring, withTiming } from 'react-native-reanimated';
6
+ import { Easing, ReduceMotion, defineAnimation, makeMutable, withSpring, withTiming, type AnimationCallback } from 'react-native-reanimated';
7
7
  import { motion } from './generated/tokens';
8
8
 
9
9
  export type SpringPreset = keyof typeof motion.spring;
10
10
  export type DurationToken = keyof typeof motion.duration;
11
11
  export type EasingToken = keyof typeof motion.easing;
12
12
 
13
+ /** How many times slower than real every animation of Fluxus runs: 1 is real time. The UI thread reads `slow`. */
14
+ const slow = makeMutable(1);
15
+ let scale = 1;
16
+
17
+ /** For a screen that shows the motion, or to look at it closely: 4 makes everything four times slower. */
18
+ export const setMotionScale = (k: number): void => {
19
+ scale = Math.max(1, k);
20
+ slow.value = scale;
21
+ };
22
+
23
+ /** A duration in ms, at the speed the motion runs. On the JS thread, and safe while rendering. */
24
+ export const ms = (duration: number): number => duration * scale;
25
+
13
26
  export const spring = (to: number, preset: SpringPreset = 'smooth'): number => {
14
27
  'worklet';
15
- return withSpring(to, { ...motion.spring[preset], reduceMotion: ReduceMotion.System });
28
+ const k = slow.value;
29
+ const { stiffness, damping, mass } = motion.spring[preset];
30
+ // The same curve, k times longer: time stretches, the shape stays.
31
+ return withSpring(to, { stiffness: stiffness / (k * k), damping: damping / k, mass, reduceMotion: ReduceMotion.System });
16
32
  };
17
33
 
18
34
  export const timing = (to: number, duration: DurationToken = 'normal', easing: EasingToken = 'standard'): number => {
19
35
  'worklet';
20
36
  const [a, b, c, d] = motion.easing[easing];
21
- return withTiming(to, { duration: motion.duration[duration], easing: Easing.bezier(a, b, c, d), reduceMotion: ReduceMotion.System });
37
+ return withTiming(to, { duration: motion.duration[duration] * slow.value, easing: Easing.bezier(a, b, c, d), reduceMotion: ReduceMotion.System });
22
38
  };
39
+
40
+ interface FluxSpring {
41
+ onFrame: (animation: FluxSpring, now: number) => boolean;
42
+ onStart: (animation: FluxSpring, value: number, now: number, previous: FluxSpring | undefined) => void;
43
+ toValue: number;
44
+ current: number;
45
+ velocity: number;
46
+ last: number;
47
+ callback?: AnimationCallback;
48
+ }
49
+
50
+ export interface FluxSpringConfig {
51
+ stiffness: number;
52
+ damping: number;
53
+ /** Units per second, added to the speed it already has. */
54
+ velocity?: number;
55
+ restDelta?: number;
56
+ restSpeed?: number;
57
+ }
58
+
59
+ /**
60
+ * The spring of the web (core/src/spring.ts): semi-implicit Euler in steps of 1/120 s. Started over another,
61
+ * it keeps its speed, wherever that points: a value sent back turns round, as `retarget` does on the web.
62
+ */
63
+ export function withFluxSpring(toValue: number, config: FluxSpringConfig, callback?: AnimationCallback): number {
64
+ 'worklet';
65
+ const k = slow.value;
66
+ return defineAnimation<FluxSpring>(toValue, () => {
67
+ 'worklet';
68
+ const restDelta = config.restDelta ?? 0.01;
69
+ const restSpeed = config.restSpeed ?? 0.01;
70
+ const onFrame = (a: FluxSpring, now: number): boolean => {
71
+ let left = Math.min(Math.max(0, now - a.last) / 1000, 4 / 60) / k;
72
+ a.last = now;
73
+ while (left > 0) {
74
+ const dt = Math.min(1 / 120, left);
75
+ left -= dt;
76
+ a.velocity += (-config.stiffness * (a.current - a.toValue) - config.damping * a.velocity) * dt;
77
+ a.current += a.velocity * dt;
78
+ }
79
+ if (Math.abs(a.current - a.toValue) < restDelta && Math.abs(a.velocity) < restSpeed) {
80
+ a.current = a.toValue;
81
+ a.velocity = 0;
82
+ return true;
83
+ }
84
+ return false;
85
+ };
86
+ const onStart = (a: FluxSpring, value: number, now: number, previous: FluxSpring | undefined): void => {
87
+ a.current = value;
88
+ a.last = now;
89
+ a.velocity = (previous?.velocity ?? 0) + (config.velocity ?? 0);
90
+ };
91
+ // Not its target: Reanimated skips an animation whose target is where the value already is, and a push starts there.
92
+ return { onFrame, onStart, toValue, current: Number.NaN, velocity: 0, last: 0, callback } as FluxSpring;
93
+ }) as unknown as number;
94
+ }
package/src/overlay.tsx CHANGED
@@ -7,7 +7,7 @@ import { useEffect, useState, type ReactNode } from 'react';
7
7
  import { AccessibilityInfo, Modal, Platform, Pressable, StyleSheet, View, type HostInstance, type ViewStyle } from 'react-native';
8
8
  import Animated, { useAnimatedStyle, useReducedMotion, useSharedValue, type SharedValue } from 'react-native-reanimated';
9
9
  import { motion } from './generated/tokens';
10
- import { spring, timing } from './motion';
10
+ import { ms, spring, timing } from './motion';
11
11
  import { useTheme, type Theme } from './theme';
12
12
  import { ToastLayer } from './Toast';
13
13
 
@@ -37,7 +37,7 @@ export function useOverlay(open: boolean): { mounted: boolean; t: SharedValue<nu
37
37
  return;
38
38
  }
39
39
  t.value = timing(0, 'fast', 'accelerate');
40
- const timer = setTimeout(() => setMounted(false), reduced ? 0 : motion.duration.fast);
40
+ const timer = setTimeout(() => setMounted(false), reduced ? 0 : ms(motion.duration.fast));
41
41
  return () => clearTimeout(timer);
42
42
  }, [open, reduced, t]);
43
43
  return { mounted, t };
package/src/pending.tsx CHANGED
@@ -8,6 +8,7 @@ import { useEffect, useRef, useState, type ReactNode } from 'react';
8
8
  import type { GestureResponderEvent, LayoutChangeEvent } from 'react-native';
9
9
  import Animated, { Easing, ReduceMotion, useAnimatedStyle, useReducedMotion, useSharedValue, withDelay, withTiming } from 'react-native-reanimated';
10
10
  import { motion } from './generated/tokens';
11
+ import { ms } from './motion';
11
12
 
12
13
  const DELAY = 150;
13
14
  const MIN_VISIBLE = 400;
@@ -17,9 +18,10 @@ const TINT = 0.14;
17
18
 
18
19
  /**
19
20
  * `onPress` may return a promise: until it settles, what was pressed waits. If it is rejected, it failed: the
20
- * third value is true until the next press. The rejection goes no further: the app has its own `catch`.
21
+ * third value is true until the next press. The rejection goes no further: the app has its own `catch`. `onEnd`
22
+ * hears how it ended, even when it ends before a render shows it waiting.
21
23
  */
22
- export function useAsyncPress<E>(onPress: ((event: E) => unknown) | null | undefined): [waiting: boolean, run: (event: E) => void, failed: boolean] {
24
+ export function useAsyncPress<E>(onPress: ((event: E) => unknown) | null | undefined, onEnd?: (failed: boolean) => void): [waiting: boolean, run: (event: E) => void, failed: boolean] {
23
25
  const [state, setState] = useState<'idle' | 'waiting' | 'failed'>('idle');
24
26
  const alive = useRef(true);
25
27
  useEffect(() => {
@@ -33,7 +35,9 @@ export function useAsyncPress<E>(onPress: ((event: E) => unknown) | null | undef
33
35
  if (typeof result?.then !== 'function') return;
34
36
  setState('waiting');
35
37
  const end = (next: 'idle' | 'failed') => (): void => {
36
- if (alive.current) setState(next);
38
+ if (!alive.current) return;
39
+ setState(next);
40
+ onEnd?.(next === 'failed');
37
41
  };
38
42
  result.then(end('idle'), end('failed'));
39
43
  };
@@ -63,13 +67,13 @@ function Fill({ x, y, radius, ink, ending }: FillProps) {
63
67
  const grow = useSharedValue(reduced ? 1 : 0);
64
68
  const fade = useSharedValue(1);
65
69
  useEffect(() => {
66
- const fast = motion.duration.fast;
67
- if (ending === 'failed') grow.value = withTiming(0, { duration: motion.duration.normal, reduceMotion: ReduceMotion.System });
70
+ const fast = ms(motion.duration.fast);
71
+ if (ending === 'failed') grow.value = withTiming(0, { duration: ms(motion.duration.normal), reduceMotion: ReduceMotion.System });
68
72
  else if (ending) {
69
73
  grow.value = withTiming(1, { duration: fast, reduceMotion: ReduceMotion.System });
70
74
  fade.value = withDelay(fast, withTiming(0, { duration: fast, reduceMotion: ReduceMotion.System }));
71
75
  // It slows as it goes and never gets there: it does not pretend to know how long.
72
- } else if (!reduced) grow.value = withTiming(REACH, { duration: 4000, easing: Easing.out(Easing.exp) });
76
+ } else if (!reduced) grow.value = withTiming(REACH, { duration: ms(4000), easing: Easing.out(Easing.exp) });
73
77
  }, [ending, reduced, grow, fade]);
74
78
  const style = useAnimatedStyle(() => ({ opacity: fade.value * TINT, transform: [{ scale: grow.value }] }));
75
79
  // Where the finger was, in the points of the element: `left` and `top`, not the direction of the language.
@@ -100,7 +104,7 @@ export function usePending(waiting: boolean, ink: string, failed = false): { onP
100
104
  const timer = setTimeout(
101
105
  () => {
102
106
  setPhase(how.current ? 'failed' : 'done');
103
- last = setTimeout(() => setPhase('idle'), how.current ? motion.duration.normal : motion.duration.fast * 2);
107
+ last = setTimeout(() => setPhase('idle'), ms(how.current ? motion.duration.normal : motion.duration.fast * 2));
104
108
  },
105
109
  Math.max(0, MIN_VISIBLE - (Date.now() - since.current)),
106
110
  );
package/src/presence.tsx CHANGED
@@ -8,6 +8,7 @@ import type { ComponentRef, Ref } from 'react';
8
8
  import { Platform, type ViewProps } from 'react-native';
9
9
  import Animated, { Easing, FadeInDown, FadeOut, LinearTransition, ReduceMotion } from 'react-native-reanimated';
10
10
  import { motion } from './generated/tokens';
11
+ import { ms } from './motion';
11
12
 
12
13
  const curve = (name: keyof typeof motion.easing) => {
13
14
  const [a, b, c, d] = motion.easing[name];
@@ -19,19 +20,20 @@ export const STAGGER = 70;
19
20
 
20
21
  /** For `entering`: it fades in as it rises; `index` is its place in a group that comes together. */
21
22
  export const enter = (index = 0) =>
22
- FadeInDown.duration(motion.duration.normal)
23
- .delay(index * STAGGER)
23
+ FadeInDown.duration(ms(motion.duration.normal))
24
+ .delay(ms(index * STAGGER))
24
25
  .easing(curve('decelerate'))
25
26
  .withInitialValues({ transform: [{ translateY: RISE }] })
26
27
  .reduceMotion(ReduceMotion.System);
27
28
 
28
29
  /** For `exiting`: it fades out, fast. */
29
- export const exit = () => FadeOut.duration(motion.duration.fast).easing(curve('accelerate')).reduceMotion(ReduceMotion.System);
30
+ export const exit = () => FadeOut.duration(ms(motion.duration.fast)).easing(curve('accelerate')).reduceMotion(ReduceMotion.System);
30
31
 
31
32
  /** For `layout`: it glides to where it is now, on the smooth spring. */
32
33
  export const shift = () => {
33
34
  const { stiffness, damping, mass } = motion.spring.smooth;
34
- return LinearTransition.springify().stiffness(stiffness).damping(damping).mass(mass).reduceMotion(ReduceMotion.System);
35
+ const k = ms(1);
36
+ return LinearTransition.springify().stiffness(stiffness / (k * k)).damping(damping / k).mass(mass).reduceMotion(ReduceMotion.System);
35
37
  };
36
38
 
37
39
  interface Presence {
@@ -39,7 +41,7 @@ interface Presence {
39
41
  exiting: ReturnType<typeof exit>;
40
42
  layout: ReturnType<typeof shift>;
41
43
  }
42
- const MADE = new Map<number, Presence>();
44
+ const MADE = new Map<string, Presence>();
43
45
 
44
46
  /**
45
47
  * The three, for a view that comes, goes and moves. In a browser they are off: there Reanimated pins a view
@@ -48,8 +50,9 @@ const MADE = new Map<number, Presence>();
48
50
  export const presence = (index = 0): Partial<Presence> => {
49
51
  if (Platform.OS === 'web') return {};
50
52
  // One set for each place in a group, made once: a render does not build them again.
51
- let made = MADE.get(index);
52
- if (!made) MADE.set(index, (made = { entering: enter(index), exiting: exit(), layout: shift() }));
53
+ const key = `${index}:${ms(1)}`;
54
+ let made = MADE.get(key);
55
+ if (!made) MADE.set(key, (made = { entering: enter(index), exiting: exit(), layout: shift() }));
53
56
  return made;
54
57
  };
55
58
 
package/src/screen.tsx CHANGED
@@ -2,7 +2,8 @@
2
2
  * `@fluxus-ui/native/screen`: the ground of a screen, inside the safe area. Its own entry, so that an app that
3
3
  * lays out its screens some other way does not need react-native-safe-area-context. (SPEC §15.5)
4
4
  */
5
- import { ScrollView, View, type ViewProps } from 'react-native';
5
+ import type { ComponentRef, Ref } from 'react';
6
+ import { ScrollView, View, type ScrollViewProps, type ViewProps } from 'react-native';
6
7
  import { SafeAreaView, type Edge } from 'react-native-safe-area-context';
7
8
  import { useTheme } from './theme';
8
9
 
@@ -13,15 +14,19 @@ export interface ScreenProps extends ViewProps {
13
14
  edges?: readonly Edge[];
14
15
  /** The gutter of the theme around what it holds, and its gap between. Default: true. */
15
16
  padded?: boolean;
17
+ /** With `scroll`: its ScrollView, to take it somewhere (`scrollToEnd` in a chat). */
18
+ scrollRef?: Ref<ComponentRef<typeof ScrollView>>;
19
+ /** With `scroll`: what else its ScrollView takes (`onScroll`, `testID`…). Its padding stays the one of the theme. */
20
+ scrollProps?: Omit<ScrollViewProps, 'children'>;
16
21
  }
17
22
 
18
- export function Screen({ scroll = false, edges, padded = true, style, children, ...rest }: ScreenProps) {
23
+ export function Screen({ scroll = false, edges, padded = true, scrollRef, scrollProps, style, children, ...rest }: ScreenProps) {
19
24
  const theme = useTheme();
20
25
  const inner = padded ? { padding: theme.size['layout.gutter'], gap: theme.size['space.4'] } : null;
21
26
  return (
22
27
  <SafeAreaView edges={edges} {...rest} style={[{ flex: 1, backgroundColor: theme.color['surface.page'] }, style]}>
23
28
  {scroll ? (
24
- <ScrollView keyboardShouldPersistTaps="handled" keyboardDismissMode="interactive" automaticallyAdjustKeyboardInsets contentContainerStyle={inner}>
29
+ <ScrollView keyboardShouldPersistTaps="handled" keyboardDismissMode="interactive" automaticallyAdjustKeyboardInsets {...scrollProps} ref={scrollRef} contentContainerStyle={[inner, scrollProps?.contentContainerStyle]}>
25
30
  {children}
26
31
  </ScrollView>
27
32
  ) : (
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `Success`, of the `icon` entry: a tick drawn inside a circle, as it comes. «Tema completado», «Solicitud
3
+ * habilitada», «Pago enviado». It grows on the bouncy spring while the `check` icon goes from `off` to rest: the
4
+ * circle is drawn, then the tick. With haptics registered (`enableHaptics`), it is felt when the tick is there.
5
+ * (SPEC §15.14)
6
+ */
7
+ import { useEffect, useState } from 'react';
8
+ import Animated, { useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
9
+ import { check } from '@fluxus-ui/icons';
10
+ import { feel } from './feel';
11
+ import { motion } from './generated/tokens';
12
+ import { Icon } from './icon';
13
+ import { ms, spring } from './motion';
14
+ import { useTheme } from './theme';
15
+
16
+ export interface SuccessProps {
17
+ /** What went well, for a screen reader. */
18
+ label: string;
19
+ /** Points. Default: 64. */
20
+ size?: number;
21
+ /** Default: the solid colour of success. */
22
+ color?: string;
23
+ /** When the tick is there: after `slow`. */
24
+ onShown?: () => void;
25
+ testID?: string;
26
+ }
27
+
28
+ export function Success({ label, size = 64, color, onShown, testID }: SuccessProps) {
29
+ const theme = useTheme();
30
+ const [state, setState] = useState<'off' | 'rest'>('off');
31
+ const grow = useSharedValue(0.6);
32
+ useEffect(() => {
33
+ setState('rest');
34
+ grow.value = spring(1, 'bouncy');
35
+ const timer = setTimeout(() => {
36
+ feel('success');
37
+ onShown?.();
38
+ }, ms(motion.duration.slow));
39
+ return () => clearTimeout(timer);
40
+ // Once, as it comes.
41
+ }, []);
42
+ const style = useAnimatedStyle(() => ({ transform: [{ scale: grow.value }] }));
43
+ return (
44
+ <Animated.View testID={testID} accessible role="img" aria-label={label} style={[{ alignSelf: 'center' }, style]}>
45
+ <Icon icon={check} state={state} size={size} color={color ?? theme.color['state.success.solid']} />
46
+ </Animated.View>
47
+ );
48
+ }