@codyswann/lisa 2.110.1 → 2.112.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/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/commands/repair-intake.md +2 -2
- package/plugins/lisa/rules/config-resolution.md +2 -2
- package/plugins/lisa/skills/repair-intake/SKILL.md +86 -9
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.mcp.json +3 -3
- package/plugins/lisa-expo/THIRD-PARTY-NOTICES.md +57 -0
- package/plugins/lisa-expo/commands/e2e-coverage-gaps.md +7 -0
- package/plugins/lisa-expo/commands/exploratory-qa.md +2 -2
- package/plugins/lisa-expo/skills/add-app-clip/SKILL.md +280 -0
- package/plugins/lisa-expo/skills/add-app-clip/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/add-app-clip/references/native-module.md +96 -0
- package/plugins/lisa-expo/skills/building-native-ui/SKILL.md +321 -0
- package/plugins/lisa-expo/skills/building-native-ui/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/animations.md +220 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/controls.md +272 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/form-sheet.md +253 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/gradients.md +106 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/icons.md +213 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/media.md +198 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/route-structure.md +229 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/search.md +248 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/storage.md +121 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/tabs.md +433 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/toolbar-and-headers.md +284 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/visual-effects.md +197 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/webgpu-three.md +605 -0
- package/plugins/lisa-expo/skills/building-native-ui/references/zoom-transitions.md +158 -0
- package/plugins/lisa-expo/skills/e2e-coverage-gaps/SKILL.md +105 -0
- package/plugins/lisa-expo/skills/e2e-coverage-gaps/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/eas-update-insights/SKILL.md +228 -0
- package/plugins/lisa-expo/skills/eas-update-insights/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/eas-update-insights/references/channel-insights-schema.md +47 -0
- package/plugins/lisa-expo/skills/eas-update-insights/references/update-insights-schema.md +69 -0
- package/plugins/lisa-expo/skills/exploratory-qa/SKILL.md +100 -93
- package/plugins/lisa-expo/skills/exploratory-qa/agents/openai.yaml +2 -2
- package/plugins/lisa-expo/skills/expo-api-routes/SKILL.md +369 -0
- package/plugins/lisa-expo/skills/expo-api-routes/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/expo-brownfield/SKILL.md +54 -0
- package/plugins/lisa-expo/skills/expo-brownfield/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/expo-brownfield/references/brownfield-integrated.md +526 -0
- package/plugins/lisa-expo/skills/expo-brownfield/references/brownfield-isolated.md +402 -0
- package/plugins/lisa-expo/skills/expo-brownfield/references/comparison.md +63 -0
- package/plugins/lisa-expo/skills/expo-brownfield/references/troubleshooting.md +88 -0
- package/plugins/lisa-expo/skills/expo-cicd-workflows/SKILL.md +92 -0
- package/plugins/lisa-expo/skills/expo-cicd-workflows/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/expo-cicd-workflows/scripts/fetch.js +113 -0
- package/plugins/lisa-expo/skills/expo-cicd-workflows/scripts/package.json +11 -0
- package/plugins/lisa-expo/skills/expo-cicd-workflows/scripts/validate.js +85 -0
- package/plugins/lisa-expo/skills/expo-deployment/SKILL.md +190 -0
- package/plugins/lisa-expo/skills/expo-deployment/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/expo-deployment/references/app-store-metadata.md +479 -0
- package/plugins/lisa-expo/skills/expo-deployment/references/ios-app-store.md +355 -0
- package/plugins/lisa-expo/skills/expo-deployment/references/play-store.md +246 -0
- package/plugins/lisa-expo/skills/expo-deployment/references/testflight.md +58 -0
- package/plugins/lisa-expo/skills/expo-deployment/references/workflows.md +200 -0
- package/plugins/lisa-expo/skills/expo-dev-client/SKILL.md +164 -0
- package/plugins/lisa-expo/skills/expo-dev-client/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/expo-module/SKILL.md +141 -0
- package/plugins/lisa-expo/skills/expo-module/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/expo-module/references/config-plugin.md +90 -0
- package/plugins/lisa-expo/skills/expo-module/references/create-expo-module.md +206 -0
- package/plugins/lisa-expo/skills/expo-module/references/lifecycle.md +127 -0
- package/plugins/lisa-expo/skills/expo-module/references/module-config.md +48 -0
- package/plugins/lisa-expo/skills/expo-module/references/native-module.md +286 -0
- package/plugins/lisa-expo/skills/expo-module/references/native-view.md +171 -0
- package/plugins/lisa-expo/skills/expo-tailwind-setup/SKILL.md +480 -0
- package/plugins/lisa-expo/skills/expo-tailwind-setup/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/expo-ui-jetpack-compose/SKILL.md +40 -0
- package/plugins/lisa-expo/skills/expo-ui-jetpack-compose/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/expo-ui-swift-ui/SKILL.md +39 -0
- package/plugins/lisa-expo/skills/expo-ui-swift-ui/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/native-data-fetching/SKILL.md +507 -0
- package/plugins/lisa-expo/skills/native-data-fetching/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/native-data-fetching/references/expo-router-loaders.md +344 -0
- package/plugins/lisa-expo/skills/upgrading-expo/SKILL.md +134 -0
- package/plugins/lisa-expo/skills/upgrading-expo/agents/openai.yaml +4 -0
- package/plugins/lisa-expo/skills/upgrading-expo/references/expo-av-to-audio.md +132 -0
- package/plugins/lisa-expo/skills/upgrading-expo/references/expo-av-to-video.md +160 -0
- package/plugins/lisa-expo/skills/upgrading-expo/references/native-tabs.md +124 -0
- package/plugins/lisa-expo/skills/upgrading-expo/references/new-architecture.md +79 -0
- package/plugins/lisa-expo/skills/upgrading-expo/references/react-19.md +79 -0
- package/plugins/lisa-expo/skills/upgrading-expo/references/react-compiler.md +59 -0
- package/plugins/lisa-expo/skills/upgrading-expo/references/react-navigation-to-expo-router.md +61 -0
- package/plugins/lisa-expo/skills/use-dom/SKILL.md +417 -0
- package/plugins/lisa-expo/skills/use-dom/agents/openai.yaml +4 -0
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/commands/e2e-coverage-gaps.md +7 -0
- package/plugins/lisa-harper-fabric/commands/exploratory-qa.md +2 -2
- package/plugins/lisa-harper-fabric/skills/e2e-coverage-gaps/SKILL.md +105 -0
- package/plugins/lisa-harper-fabric/skills/e2e-coverage-gaps/agents/openai.yaml +4 -0
- package/plugins/lisa-harper-fabric/skills/exploratory-qa/SKILL.md +100 -93
- package/plugins/lisa-harper-fabric/skills/exploratory-qa/agents/openai.yaml +2 -2
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/commands/e2e-coverage-gaps.md +7 -0
- package/plugins/lisa-rails/commands/exploratory-qa.md +2 -2
- package/plugins/lisa-rails/skills/e2e-coverage-gaps/SKILL.md +105 -0
- package/plugins/lisa-rails/skills/e2e-coverage-gaps/agents/openai.yaml +4 -0
- package/plugins/lisa-rails/skills/exploratory-qa/SKILL.md +100 -93
- package/plugins/lisa-rails/skills/exploratory-qa/agents/openai.yaml +2 -2
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/templates/llm-wiki-contract.md +12 -0
- package/plugins/src/base/commands/repair-intake.md +2 -2
- package/plugins/src/base/rules/config-resolution.md +2 -2
- package/plugins/src/base/skills/repair-intake/SKILL.md +86 -9
- package/plugins/src/expo/.mcp.json +3 -3
- package/plugins/src/expo/THIRD-PARTY-NOTICES.md +57 -0
- package/plugins/src/expo/commands/e2e-coverage-gaps.md +7 -0
- package/plugins/src/expo/commands/exploratory-qa.md +2 -2
- package/plugins/src/expo/skills/add-app-clip/SKILL.md +280 -0
- package/plugins/src/expo/skills/add-app-clip/references/native-module.md +96 -0
- package/plugins/src/expo/skills/building-native-ui/SKILL.md +321 -0
- package/plugins/src/expo/skills/building-native-ui/references/animations.md +220 -0
- package/plugins/src/expo/skills/building-native-ui/references/controls.md +272 -0
- package/plugins/src/expo/skills/building-native-ui/references/form-sheet.md +253 -0
- package/plugins/src/expo/skills/building-native-ui/references/gradients.md +106 -0
- package/plugins/src/expo/skills/building-native-ui/references/icons.md +213 -0
- package/plugins/src/expo/skills/building-native-ui/references/media.md +198 -0
- package/plugins/src/expo/skills/building-native-ui/references/route-structure.md +229 -0
- package/plugins/src/expo/skills/building-native-ui/references/search.md +248 -0
- package/plugins/src/expo/skills/building-native-ui/references/storage.md +121 -0
- package/plugins/src/expo/skills/building-native-ui/references/tabs.md +433 -0
- package/plugins/src/expo/skills/building-native-ui/references/toolbar-and-headers.md +284 -0
- package/plugins/src/expo/skills/building-native-ui/references/visual-effects.md +197 -0
- package/plugins/src/expo/skills/building-native-ui/references/webgpu-three.md +605 -0
- package/plugins/src/expo/skills/building-native-ui/references/zoom-transitions.md +158 -0
- package/plugins/src/expo/skills/e2e-coverage-gaps/SKILL.md +105 -0
- package/plugins/src/expo/skills/eas-update-insights/SKILL.md +228 -0
- package/plugins/src/expo/skills/eas-update-insights/references/channel-insights-schema.md +47 -0
- package/plugins/src/expo/skills/eas-update-insights/references/update-insights-schema.md +69 -0
- package/plugins/src/expo/skills/exploratory-qa/SKILL.md +100 -93
- package/plugins/src/expo/skills/expo-api-routes/SKILL.md +369 -0
- package/plugins/src/expo/skills/expo-brownfield/SKILL.md +54 -0
- package/plugins/src/expo/skills/expo-brownfield/references/brownfield-integrated.md +526 -0
- package/plugins/src/expo/skills/expo-brownfield/references/brownfield-isolated.md +402 -0
- package/plugins/src/expo/skills/expo-brownfield/references/comparison.md +63 -0
- package/plugins/src/expo/skills/expo-brownfield/references/troubleshooting.md +88 -0
- package/plugins/src/expo/skills/expo-cicd-workflows/SKILL.md +92 -0
- package/plugins/src/expo/skills/expo-cicd-workflows/scripts/fetch.js +113 -0
- package/plugins/src/expo/skills/expo-cicd-workflows/scripts/package.json +11 -0
- package/plugins/src/expo/skills/expo-cicd-workflows/scripts/validate.js +85 -0
- package/plugins/src/expo/skills/expo-deployment/SKILL.md +190 -0
- package/plugins/src/expo/skills/expo-deployment/references/app-store-metadata.md +479 -0
- package/plugins/src/expo/skills/expo-deployment/references/ios-app-store.md +355 -0
- package/plugins/src/expo/skills/expo-deployment/references/play-store.md +246 -0
- package/plugins/src/expo/skills/expo-deployment/references/testflight.md +58 -0
- package/plugins/src/expo/skills/expo-deployment/references/workflows.md +200 -0
- package/plugins/src/expo/skills/expo-dev-client/SKILL.md +164 -0
- package/plugins/src/expo/skills/expo-module/SKILL.md +141 -0
- package/plugins/src/expo/skills/expo-module/references/config-plugin.md +90 -0
- package/plugins/src/expo/skills/expo-module/references/create-expo-module.md +206 -0
- package/plugins/src/expo/skills/expo-module/references/lifecycle.md +127 -0
- package/plugins/src/expo/skills/expo-module/references/module-config.md +48 -0
- package/plugins/src/expo/skills/expo-module/references/native-module.md +286 -0
- package/plugins/src/expo/skills/expo-module/references/native-view.md +171 -0
- package/plugins/src/expo/skills/expo-tailwind-setup/SKILL.md +480 -0
- package/plugins/src/expo/skills/expo-ui-jetpack-compose/SKILL.md +40 -0
- package/plugins/src/expo/skills/expo-ui-swift-ui/SKILL.md +39 -0
- package/plugins/src/expo/skills/native-data-fetching/SKILL.md +507 -0
- package/plugins/src/expo/skills/native-data-fetching/references/expo-router-loaders.md +344 -0
- package/plugins/src/expo/skills/upgrading-expo/SKILL.md +134 -0
- package/plugins/src/expo/skills/upgrading-expo/references/expo-av-to-audio.md +132 -0
- package/plugins/src/expo/skills/upgrading-expo/references/expo-av-to-video.md +160 -0
- package/plugins/src/expo/skills/upgrading-expo/references/native-tabs.md +124 -0
- package/plugins/src/expo/skills/upgrading-expo/references/new-architecture.md +79 -0
- package/plugins/src/expo/skills/upgrading-expo/references/react-19.md +79 -0
- package/plugins/src/expo/skills/upgrading-expo/references/react-compiler.md +59 -0
- package/plugins/src/expo/skills/upgrading-expo/references/react-navigation-to-expo-router.md +61 -0
- package/plugins/src/expo/skills/use-dom/SKILL.md +417 -0
- package/plugins/src/harper-fabric/commands/e2e-coverage-gaps.md +7 -0
- package/plugins/src/harper-fabric/commands/exploratory-qa.md +2 -2
- package/plugins/src/harper-fabric/skills/e2e-coverage-gaps/SKILL.md +105 -0
- package/plugins/src/harper-fabric/skills/exploratory-qa/SKILL.md +100 -93
- package/plugins/src/rails/commands/e2e-coverage-gaps.md +7 -0
- package/plugins/src/rails/commands/exploratory-qa.md +2 -2
- package/plugins/src/rails/skills/e2e-coverage-gaps/SKILL.md +105 -0
- package/plugins/src/rails/skills/exploratory-qa/SKILL.md +100 -93
- package/plugins/src/wiki/templates/llm-wiki-contract.md +12 -0
- package/scripts/generate-codex-plugin-artifacts.mjs +7 -2
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Animations
|
|
2
|
+
|
|
3
|
+
Use Reanimated v4. Avoid React Native's built-in Animated API.
|
|
4
|
+
|
|
5
|
+
## Entering and Exiting Animations
|
|
6
|
+
|
|
7
|
+
Use Animated.View with entering and exiting animations. Layout animations can animate state changes.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import Animated, {
|
|
11
|
+
FadeIn,
|
|
12
|
+
FadeOut,
|
|
13
|
+
LinearTransition,
|
|
14
|
+
} from "react-native-reanimated";
|
|
15
|
+
|
|
16
|
+
function App() {
|
|
17
|
+
return (
|
|
18
|
+
<Animated.View
|
|
19
|
+
entering={FadeIn}
|
|
20
|
+
exiting={FadeOut}
|
|
21
|
+
layout={LinearTransition}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## On-Scroll Animations
|
|
28
|
+
|
|
29
|
+
Create high-performance scroll animations using Reanimated's hooks:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import Animated, {
|
|
33
|
+
useAnimatedRef,
|
|
34
|
+
useScrollViewOffset,
|
|
35
|
+
useAnimatedStyle,
|
|
36
|
+
interpolate,
|
|
37
|
+
} from "react-native-reanimated";
|
|
38
|
+
|
|
39
|
+
function Page() {
|
|
40
|
+
const ref = useAnimatedRef();
|
|
41
|
+
const scroll = useScrollViewOffset(ref);
|
|
42
|
+
|
|
43
|
+
const style = useAnimatedStyle(() => ({
|
|
44
|
+
opacity: interpolate(scroll.value, [0, 30], [0, 1], "clamp"),
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Animated.ScrollView ref={ref}>
|
|
49
|
+
<Animated.View style={style} />
|
|
50
|
+
</Animated.ScrollView>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Common Animation Presets
|
|
56
|
+
|
|
57
|
+
### Entering Animations
|
|
58
|
+
|
|
59
|
+
- `FadeIn`, `FadeInUp`, `FadeInDown`, `FadeInLeft`, `FadeInRight`
|
|
60
|
+
- `SlideInUp`, `SlideInDown`, `SlideInLeft`, `SlideInRight`
|
|
61
|
+
- `ZoomIn`, `ZoomInUp`, `ZoomInDown`
|
|
62
|
+
- `BounceIn`, `BounceInUp`, `BounceInDown`
|
|
63
|
+
|
|
64
|
+
### Exiting Animations
|
|
65
|
+
|
|
66
|
+
- `FadeOut`, `FadeOutUp`, `FadeOutDown`, `FadeOutLeft`, `FadeOutRight`
|
|
67
|
+
- `SlideOutUp`, `SlideOutDown`, `SlideOutLeft`, `SlideOutRight`
|
|
68
|
+
- `ZoomOut`, `ZoomOutUp`, `ZoomOutDown`
|
|
69
|
+
- `BounceOut`, `BounceOutUp`, `BounceOutDown`
|
|
70
|
+
|
|
71
|
+
### Layout Animations
|
|
72
|
+
|
|
73
|
+
- `LinearTransition` — Smooth linear interpolation
|
|
74
|
+
- `SequencedTransition` — Sequenced property changes
|
|
75
|
+
- `FadingTransition` — Fade between states
|
|
76
|
+
|
|
77
|
+
## Customizing Animations
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
<Animated.View
|
|
81
|
+
entering={FadeInDown.duration(500).delay(200)}
|
|
82
|
+
exiting={FadeOut.duration(300)}
|
|
83
|
+
/>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Modifiers
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
// Duration in milliseconds
|
|
90
|
+
FadeIn.duration(300);
|
|
91
|
+
|
|
92
|
+
// Delay before starting
|
|
93
|
+
FadeIn.delay(100);
|
|
94
|
+
|
|
95
|
+
// Spring physics
|
|
96
|
+
FadeIn.springify();
|
|
97
|
+
FadeIn.springify().damping(15).stiffness(100);
|
|
98
|
+
|
|
99
|
+
// Easing curves
|
|
100
|
+
FadeIn.easing(Easing.bezier(0.25, 0.1, 0.25, 1));
|
|
101
|
+
|
|
102
|
+
// Chaining
|
|
103
|
+
FadeInDown.duration(400).delay(200).springify();
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Shared Value Animations
|
|
107
|
+
|
|
108
|
+
For imperative control over animations:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import {
|
|
112
|
+
useSharedValue,
|
|
113
|
+
withSpring,
|
|
114
|
+
withTiming,
|
|
115
|
+
} from "react-native-reanimated";
|
|
116
|
+
|
|
117
|
+
const offset = useSharedValue(0);
|
|
118
|
+
|
|
119
|
+
// Spring animation
|
|
120
|
+
offset.value = withSpring(100);
|
|
121
|
+
|
|
122
|
+
// Timing animation
|
|
123
|
+
offset.value = withTiming(100, { duration: 300 });
|
|
124
|
+
|
|
125
|
+
// Use in styles
|
|
126
|
+
const style = useAnimatedStyle(() => ({
|
|
127
|
+
transform: [{ translateX: offset.value }],
|
|
128
|
+
}));
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Gesture Animations
|
|
132
|
+
|
|
133
|
+
Combine with React Native Gesture Handler:
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
137
|
+
import Animated, {
|
|
138
|
+
useSharedValue,
|
|
139
|
+
useAnimatedStyle,
|
|
140
|
+
withSpring,
|
|
141
|
+
} from "react-native-reanimated";
|
|
142
|
+
|
|
143
|
+
function DraggableBox() {
|
|
144
|
+
const translateX = useSharedValue(0);
|
|
145
|
+
const translateY = useSharedValue(0);
|
|
146
|
+
|
|
147
|
+
const gesture = Gesture.Pan()
|
|
148
|
+
.onUpdate((e) => {
|
|
149
|
+
translateX.value = e.translationX;
|
|
150
|
+
translateY.value = e.translationY;
|
|
151
|
+
})
|
|
152
|
+
.onEnd(() => {
|
|
153
|
+
translateX.value = withSpring(0);
|
|
154
|
+
translateY.value = withSpring(0);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const style = useAnimatedStyle(() => ({
|
|
158
|
+
transform: [
|
|
159
|
+
{ translateX: translateX.value },
|
|
160
|
+
{ translateY: translateY.value },
|
|
161
|
+
],
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<GestureDetector gesture={gesture}>
|
|
166
|
+
<Animated.View style={[styles.box, style]} />
|
|
167
|
+
</GestureDetector>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Keyboard Animations
|
|
173
|
+
|
|
174
|
+
Animate with keyboard height changes:
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import Animated, {
|
|
178
|
+
useAnimatedKeyboard,
|
|
179
|
+
useAnimatedStyle,
|
|
180
|
+
} from "react-native-reanimated";
|
|
181
|
+
|
|
182
|
+
function KeyboardAwareView() {
|
|
183
|
+
const keyboard = useAnimatedKeyboard();
|
|
184
|
+
|
|
185
|
+
const style = useAnimatedStyle(() => ({
|
|
186
|
+
paddingBottom: keyboard.height.value,
|
|
187
|
+
}));
|
|
188
|
+
|
|
189
|
+
return <Animated.View style={style}>{/* content */}</Animated.View>;
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Staggered List Animations
|
|
194
|
+
|
|
195
|
+
Animate list items with delays:
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
{
|
|
199
|
+
items.map((item, index) => (
|
|
200
|
+
<Animated.View
|
|
201
|
+
key={item.id}
|
|
202
|
+
entering={FadeInUp.delay(index * 50)}
|
|
203
|
+
exiting={FadeOutUp}
|
|
204
|
+
>
|
|
205
|
+
<ListItem item={item} />
|
|
206
|
+
</Animated.View>
|
|
207
|
+
));
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Best Practices
|
|
212
|
+
|
|
213
|
+
- Add entering and exiting animations for state changes
|
|
214
|
+
- Use layout animations when items are added/removed from lists
|
|
215
|
+
- Use `useAnimatedStyle` for scroll-driven animations
|
|
216
|
+
- Prefer `interpolate` with "clamp" for bounded values
|
|
217
|
+
- You can't pass PlatformColors to reanimated views or styles; use static colors instead
|
|
218
|
+
- Keep animations under 300ms for responsive feel
|
|
219
|
+
- Use spring animations for natural movement
|
|
220
|
+
- Avoid animating layout properties (width, height) when possible — prefer transforms
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Native Controls
|
|
2
|
+
|
|
3
|
+
Native iOS controls provide built-in haptics, accessibility, and platform-appropriate styling.
|
|
4
|
+
|
|
5
|
+
## Switch
|
|
6
|
+
|
|
7
|
+
Use for binary on/off settings. Has built-in haptics.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Switch } from "react-native";
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
|
|
13
|
+
const [enabled, setEnabled] = useState(false);
|
|
14
|
+
|
|
15
|
+
<Switch value={enabled} onValueChange={setEnabled} />;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Customization
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<Switch
|
|
22
|
+
value={enabled}
|
|
23
|
+
onValueChange={setEnabled}
|
|
24
|
+
trackColor={{ false: "#767577", true: "#81b0ff" }}
|
|
25
|
+
thumbColor={enabled ? "#f5dd4b" : "#f4f3f4"}
|
|
26
|
+
ios_backgroundColor="#3e3e3e"
|
|
27
|
+
/>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Segmented Control
|
|
31
|
+
|
|
32
|
+
Use for non-navigational tabs or mode selection. Avoid changing default colors.
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import SegmentedControl from "@react-native-segmented-control/segmented-control";
|
|
36
|
+
import { useState } from "react";
|
|
37
|
+
|
|
38
|
+
const [index, setIndex] = useState(0);
|
|
39
|
+
|
|
40
|
+
<SegmentedControl
|
|
41
|
+
values={["All", "Active", "Done"]}
|
|
42
|
+
selectedIndex={index}
|
|
43
|
+
onChange={({ nativeEvent }) => setIndex(nativeEvent.selectedSegmentIndex)}
|
|
44
|
+
/>;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Rules
|
|
48
|
+
|
|
49
|
+
- Maximum 4 options — use a picker for more
|
|
50
|
+
- Keep labels short (1-2 words)
|
|
51
|
+
- Avoid custom colors — native styling adapts to dark mode
|
|
52
|
+
|
|
53
|
+
### With Icons (iOS 14+)
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
<SegmentedControl
|
|
57
|
+
values={[
|
|
58
|
+
{ label: "List", icon: "list.bullet" },
|
|
59
|
+
{ label: "Grid", icon: "square.grid.2x2" },
|
|
60
|
+
]}
|
|
61
|
+
selectedIndex={index}
|
|
62
|
+
onChange={({ nativeEvent }) => setIndex(nativeEvent.selectedSegmentIndex)}
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Slider
|
|
67
|
+
|
|
68
|
+
Continuous value selection.
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import Slider from "@react-native-community/slider";
|
|
72
|
+
import { useState } from "react";
|
|
73
|
+
|
|
74
|
+
const [value, setValue] = useState(0.5);
|
|
75
|
+
|
|
76
|
+
<Slider
|
|
77
|
+
value={value}
|
|
78
|
+
onValueChange={setValue}
|
|
79
|
+
minimumValue={0}
|
|
80
|
+
maximumValue={1}
|
|
81
|
+
/>;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Customization
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
<Slider
|
|
88
|
+
value={value}
|
|
89
|
+
onValueChange={setValue}
|
|
90
|
+
minimumValue={0}
|
|
91
|
+
maximumValue={100}
|
|
92
|
+
step={1}
|
|
93
|
+
minimumTrackTintColor="#007AFF"
|
|
94
|
+
maximumTrackTintColor="#E5E5EA"
|
|
95
|
+
thumbTintColor="#007AFF"
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Discrete Steps
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<Slider
|
|
103
|
+
value={value}
|
|
104
|
+
onValueChange={setValue}
|
|
105
|
+
minimumValue={0}
|
|
106
|
+
maximumValue={10}
|
|
107
|
+
step={1}
|
|
108
|
+
/>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Date/Time Picker
|
|
112
|
+
|
|
113
|
+
Compact pickers with popovers. Has built-in haptics.
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
import DateTimePicker from "@react-native-community/datetimepicker";
|
|
117
|
+
import { useState } from "react";
|
|
118
|
+
|
|
119
|
+
const [date, setDate] = useState(new Date());
|
|
120
|
+
|
|
121
|
+
<DateTimePicker
|
|
122
|
+
value={date}
|
|
123
|
+
onChange={(event, selectedDate) => {
|
|
124
|
+
if (selectedDate) setDate(selectedDate);
|
|
125
|
+
}}
|
|
126
|
+
mode="datetime"
|
|
127
|
+
/>;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Modes
|
|
131
|
+
|
|
132
|
+
- `date` — Date only
|
|
133
|
+
- `time` — Time only
|
|
134
|
+
- `datetime` — Date and time
|
|
135
|
+
|
|
136
|
+
### Display Styles
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
// Compact inline (default)
|
|
140
|
+
<DateTimePicker value={date} mode="date" />
|
|
141
|
+
|
|
142
|
+
// Spinner wheel
|
|
143
|
+
<DateTimePicker
|
|
144
|
+
value={date}
|
|
145
|
+
mode="date"
|
|
146
|
+
display="spinner"
|
|
147
|
+
style={{ width: 200, height: 150 }}
|
|
148
|
+
/>
|
|
149
|
+
|
|
150
|
+
// Full calendar
|
|
151
|
+
<DateTimePicker value={date} mode="date" display="inline" />
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Time Intervals
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
<DateTimePicker
|
|
158
|
+
value={date}
|
|
159
|
+
mode="time"
|
|
160
|
+
minuteInterval={15}
|
|
161
|
+
/>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Min/Max Dates
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
<DateTimePicker
|
|
168
|
+
value={date}
|
|
169
|
+
mode="date"
|
|
170
|
+
minimumDate={new Date(2020, 0, 1)}
|
|
171
|
+
maximumDate={new Date(2030, 11, 31)}
|
|
172
|
+
/>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Stepper
|
|
176
|
+
|
|
177
|
+
> Note: `Stepper` is not exported by React Native core. Use a maintained community package (e.g. `react-native-ui-stepper`) or build one from primitives. The snippet below illustrates the intended API.
|
|
178
|
+
|
|
179
|
+
Increment/decrement numeric values.
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
import { Stepper } from "react-native";
|
|
183
|
+
import { useState } from "react";
|
|
184
|
+
|
|
185
|
+
const [count, setCount] = useState(0);
|
|
186
|
+
|
|
187
|
+
<Stepper
|
|
188
|
+
value={count}
|
|
189
|
+
onValueChange={setCount}
|
|
190
|
+
minimumValue={0}
|
|
191
|
+
maximumValue={10}
|
|
192
|
+
/>;
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## TextInput
|
|
196
|
+
|
|
197
|
+
Native text input with various keyboard types.
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
import { TextInput } from "react-native";
|
|
201
|
+
|
|
202
|
+
<TextInput
|
|
203
|
+
placeholder="Enter text..."
|
|
204
|
+
placeholderTextColor="#999"
|
|
205
|
+
style={{
|
|
206
|
+
padding: 12,
|
|
207
|
+
fontSize: 16,
|
|
208
|
+
borderRadius: 8,
|
|
209
|
+
backgroundColor: "#f0f0f0",
|
|
210
|
+
}}
|
|
211
|
+
/>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Keyboard Types
|
|
215
|
+
|
|
216
|
+
```tsx
|
|
217
|
+
// Email
|
|
218
|
+
<TextInput keyboardType="email-address" autoCapitalize="none" />
|
|
219
|
+
|
|
220
|
+
// Phone
|
|
221
|
+
<TextInput keyboardType="phone-pad" />
|
|
222
|
+
|
|
223
|
+
// Number
|
|
224
|
+
<TextInput keyboardType="numeric" />
|
|
225
|
+
|
|
226
|
+
// Password
|
|
227
|
+
<TextInput secureTextEntry />
|
|
228
|
+
|
|
229
|
+
// Search
|
|
230
|
+
<TextInput
|
|
231
|
+
returnKeyType="search"
|
|
232
|
+
enablesReturnKeyAutomatically
|
|
233
|
+
/>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Multiline
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
<TextInput
|
|
240
|
+
multiline
|
|
241
|
+
numberOfLines={4}
|
|
242
|
+
textAlignVertical="top"
|
|
243
|
+
style={{ minHeight: 100 }}
|
|
244
|
+
/>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Picker (Wheel)
|
|
248
|
+
|
|
249
|
+
For selection from many options (5+ items).
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
import { Picker } from "@react-native-picker/picker";
|
|
253
|
+
import { useState } from "react";
|
|
254
|
+
|
|
255
|
+
const [selected, setSelected] = useState("js");
|
|
256
|
+
|
|
257
|
+
<Picker selectedValue={selected} onValueChange={setSelected}>
|
|
258
|
+
<Picker.Item label="JavaScript" value="js" />
|
|
259
|
+
<Picker.Item label="TypeScript" value="ts" />
|
|
260
|
+
<Picker.Item label="Python" value="py" />
|
|
261
|
+
<Picker.Item label="Go" value="go" />
|
|
262
|
+
</Picker>;
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Best Practices
|
|
266
|
+
|
|
267
|
+
- **Haptics**: Switch and DateTimePicker have built-in haptics — don't add extra
|
|
268
|
+
- **Accessibility**: Native controls have proper accessibility labels by default
|
|
269
|
+
- **Dark Mode**: Avoid custom colors — native styling adapts automatically
|
|
270
|
+
- **Spacing**: Use consistent padding around controls (12-16pt)
|
|
271
|
+
- **Labels**: Place labels above or to the left of controls
|
|
272
|
+
- **Grouping**: Group related controls in sections with headers
|