react-native-theme-transition 1.0.6 → 2.0.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 (66) hide show
  1. package/README.md +55 -43
  2. package/README.npm.md +55 -43
  3. package/dist/constants.d.ts +1 -2
  4. package/dist/constants.d.ts.map +1 -1
  5. package/dist/constants.js +4 -0
  6. package/dist/constants.js.map +1 -1
  7. package/dist/createThemeTransition.d.ts +6 -18
  8. package/dist/createThemeTransition.d.ts.map +1 -1
  9. package/dist/createThemeTransition.js +37 -35
  10. package/dist/createThemeTransition.js.map +1 -1
  11. package/dist/index.d.ts +9 -9
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +8 -8
  14. package/dist/index.js.map +1 -1
  15. package/dist/overlay/SkiaOverlay.d.ts +17 -0
  16. package/dist/overlay/SkiaOverlay.d.ts.map +1 -0
  17. package/dist/overlay/SkiaOverlay.js +297 -0
  18. package/dist/overlay/SkiaOverlay.js.map +1 -0
  19. package/dist/overlay/captureView.d.ts +7 -0
  20. package/dist/overlay/captureView.d.ts.map +1 -0
  21. package/dist/overlay/captureView.js +31 -0
  22. package/dist/overlay/captureView.js.map +1 -0
  23. package/dist/overlay/resolveOrigin.d.ts +8 -0
  24. package/dist/overlay/resolveOrigin.d.ts.map +1 -0
  25. package/dist/overlay/resolveOrigin.js +68 -0
  26. package/dist/overlay/resolveOrigin.js.map +1 -0
  27. package/dist/overlay/types.d.ts +15 -0
  28. package/dist/overlay/types.d.ts.map +1 -0
  29. package/dist/overlay/types.js +61 -0
  30. package/dist/overlay/types.js.map +1 -0
  31. package/dist/setThemeDecision.d.ts +14 -0
  32. package/dist/setThemeDecision.d.ts.map +1 -0
  33. package/dist/setThemeDecision.js +27 -0
  34. package/dist/setThemeDecision.js.map +1 -0
  35. package/dist/transitionEngine.d.ts +48 -17
  36. package/dist/transitionEngine.d.ts.map +1 -1
  37. package/dist/transitionEngine.js +279 -208
  38. package/dist/transitionEngine.js.map +1 -1
  39. package/dist/transitionMeta.d.ts +136 -0
  40. package/dist/transitionMeta.d.ts.map +1 -0
  41. package/dist/transitionMeta.js +131 -0
  42. package/dist/transitionMeta.js.map +1 -0
  43. package/dist/types.d.ts +254 -193
  44. package/dist/types.d.ts.map +1 -1
  45. package/dist/validateSetThemeOptions.d.ts +15 -0
  46. package/dist/validateSetThemeOptions.d.ts.map +1 -0
  47. package/dist/validateSetThemeOptions.js +54 -0
  48. package/dist/validateSetThemeOptions.js.map +1 -0
  49. package/package.json +14 -6
  50. package/src/constants.ts +6 -0
  51. package/src/createThemeTransition.ts +57 -39
  52. package/src/index.ts +12 -9
  53. package/src/overlay/SkiaOverlay.tsx +629 -0
  54. package/src/overlay/captureView.ts +32 -0
  55. package/src/overlay/resolveOrigin.ts +81 -0
  56. package/src/overlay/types.ts +83 -0
  57. package/src/setThemeDecision.ts +48 -0
  58. package/src/transitionEngine.tsx +390 -247
  59. package/src/transitionMeta.ts +176 -0
  60. package/src/types.ts +272 -193
  61. package/src/validateSetThemeOptions.ts +76 -0
  62. package/dist/hooks/useTheme.d.ts +0 -14
  63. package/dist/hooks/useTheme.d.ts.map +0 -1
  64. package/dist/hooks/useTheme.js +0 -46
  65. package/dist/hooks/useTheme.js.map +0 -1
  66. package/src/hooks/useTheme.ts +0 -72
package/README.md CHANGED
@@ -1,110 +1,122 @@
1
1
  <h1 align="center">React Native Theme Transition</h1>
2
2
 
3
3
  <p align="center">
4
- Smooth, animated theme transitions for React Native. Expo Go compatible, powered by Reanimated.
4
+ Nine animated theme transitions for React Native. Skia-powered, runs in Expo Go.
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/react-native-theme-transition"><img src="https://img.shields.io/npm/v/react-native-theme-transition.svg?t=1" alt="npm version" /></a>
9
- <a href="https://bundlephobia.com/package/react-native-theme-transition"><img src="https://img.shields.io/badge/gzip%20size-2.7%20kB-brightgreen" alt="bundle size" /></a>
9
+ <a href="https://bundlephobia.com/package/react-native-theme-transition"><img src="https://img.shields.io/bundlephobia/minzip/react-native-theme-transition" alt="bundle size" /></a>
10
10
  <img src="https://img.shields.io/badge/Expo_Go-compatible-000.svg?logo=expo&logoColor=white" alt="expo compatible" />
11
11
  <img src="https://img.shields.io/badge/React_Compiler-compatible-blueviolet.svg" alt="react compiler" />
12
12
  <a href="https://github.com/marioprieta/react-native-theme-transition/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/react-native-theme-transition?t=1" alt="license" /></a>
13
13
  </p>
14
14
 
15
- <table align="center">
16
- <tr>
17
- <td align="center"><b>iOS</b></td>
18
- <td align="center"><b>Android</b></td>
19
- </tr>
20
- <tr>
21
- <td>
22
- <img src="https://raw.githubusercontent.com/marioprieta/react-native-theme-transition/main/assets/videos/iOS_demo.gif" width="260" alt="iOS demo" />
23
- </td>
24
- <td>
25
- <img src="https://raw.githubusercontent.com/marioprieta/react-native-theme-transition/main/assets/videos/Android_demo.gif" width="260" alt="Android demo" />
26
- </td>
27
- </tr>
28
- </table>
15
+ <p align="center">
16
+ <img src="https://github.com/user-attachments/assets/32cdd33a-2c79-42f6-b70a-4a4644100683" width="400" alt="React Native Theme Transition demo" />
17
+ </p>
29
18
 
30
19
  ## Features
31
20
 
32
- - **Smooth cross-fade transitions** — powered by Reanimated on the native UI thread (60-120 FPS)
33
- - **Expo Go compatible** — no native code, no prebuilds required
34
- - **Multi-theme support** — define as many themes as you need with full TypeScript inference
35
- - **System theme sync** — follows OS appearance automatically with zero-flash startup
36
- - **Native UI sync** — alerts, keyboards, and date pickers automatically match your active theme
37
- - **Transition safe** — blocks concurrent transitions and exposes `isTransitioning`
38
- - **React Compiler ready** — all hooks follow the [Rules of React](https://react.dev/reference/rules)
39
- - **Lightweight** — ~2.7 kB gzipped, zero runtime dependencies
21
+ - **Nine transition styles.** `fade`, `circularReveal`, `heart`, `star`, `wipe`, `slide`, `split`, `pixelize`, `dissolve`.
22
+ - **Expo Go ready.** Works on Expo SDK 54+ out of the box. Bare React Native CLI also supported.
23
+ - **Full TypeScript inference.** `useTheme()` and `setTheme()` know your theme names and color tokens without manual generics.
24
+ - **System theme built in.** Follows OS appearance with zero-flash startup.
25
+ - **Strict runtime validation.** Invalid options throw immediately with clear error messages.
26
+ - **React Compiler compatible.** All hooks follow the [Rules of React](https://react.dev/reference/rules).
27
+
28
+ ## Requirements
29
+
30
+ - React **19.0.0+** and React Native **0.78.0+**
31
+ - `@shopify/react-native-skia` **2.0.0+**
32
+ - `react-native-reanimated` **4.0.0+**
33
+ - `react-native-worklets` **0.5.0+**
40
34
 
41
- ## Documentation
35
+ ## Try it
42
36
 
43
- For full docs, API reference, examples, and recipes, visit **[react-native-theme-transition.vercel.app](https://react-native-theme-transition.vercel.app)**.
37
+ - [Snack](https://snack.expo.dev/@mariops03/react-native-theme-transition) Live playground with the 9 transitions in a browser phone preview.
38
+ - [Docs](https://react-native-theme-transition.vercel.app) API reference, recipes, migration guide.
44
39
 
45
40
  ## Installation
46
41
 
47
42
  ```bash
48
- # Expo (SDK 54+ already has reanimated and view-shot)
49
- npx expo install react-native-theme-transition react-native-worklets
43
+ # Expo (SDK 54+)
44
+ npx expo install react-native-theme-transition @shopify/react-native-skia react-native-worklets
50
45
 
51
46
  # React Native CLI
52
- npm install react-native-theme-transition react-native-reanimated react-native-view-shot react-native-worklets
47
+ npm install react-native-theme-transition @shopify/react-native-skia react-native-reanimated react-native-worklets
53
48
  ```
54
49
 
55
- Add `react-native-worklets/plugin` as the **last plugin** in your `babel.config.js`.
50
+ Add `react-native-worklets/plugin` as the **last plugin** in your `babel.config.js`. On Expo SDK 55+, do NOT add `react-native-reanimated/plugin`, since `babel-preset-expo` already includes it.
56
51
 
57
- ## Quick start
52
+ > Using Claude Code, Cursor, or Codex? Install the [AI-assisted setup](#ai-assisted-setup) skill first and the agent can run the installation from the v2 API reference.
53
+
54
+ ## Quick Start
58
55
 
59
56
  ```ts
60
57
  // theme.ts
61
- import { createThemeTransition } from 'react-native-theme-transition';
58
+ import { createThemeTransition } from 'react-native-theme-transition'
62
59
 
63
60
  export const { ThemeTransitionProvider, useTheme } = createThemeTransition({
64
61
  themes: {
65
62
  light: { background: '#ffffff', text: '#000000', primary: '#007AFF' },
66
63
  dark: { background: '#000000', text: '#ffffff', primary: '#0A84FF' },
67
64
  },
68
- });
65
+ })
69
66
  ```
70
67
 
71
68
  ```tsx
72
69
  // App.tsx
73
- import { ThemeTransitionProvider } from './theme';
70
+ import { ThemeTransitionProvider } from './theme'
74
71
 
75
72
  export default function App() {
76
73
  return (
77
74
  <ThemeTransitionProvider initialTheme="system">
78
75
  <MyApp />
79
76
  </ThemeTransitionProvider>
80
- );
77
+ )
81
78
  }
82
79
  ```
83
80
 
84
81
  ```tsx
85
82
  // MyScreen.tsx
86
- import { useTheme } from './theme';
83
+ import { Pressable, Text, View } from 'react-native'
84
+ import { useTheme } from './theme'
87
85
 
88
86
  function MyScreen() {
89
- const { colors, name, setTheme, isTransitioning } = useTheme();
87
+ const { theme, setTheme, isTransitioning } = useTheme()
90
88
 
91
89
  return (
92
- <View style={{ flex: 1, backgroundColor: colors.background }}>
93
- <Text style={{ color: colors.text }}>Current: {name}</Text>
90
+ <View style={{ flex: 1, backgroundColor: theme.colors.background }}>
91
+ <Text style={{ color: theme.colors.text }}>Current: {theme.name}</Text>
94
92
  <Pressable
95
- onPress={() => setTheme(name === 'light' ? 'dark' : 'light')}
93
+ onPress={() => setTheme(theme.name === 'dark' ? 'light' : 'dark', { transition: 'circularReveal' })}
96
94
  disabled={isTransitioning}
97
95
  >
98
- <Text style={{ color: colors.primary }}>Toggle theme</Text>
96
+ <Text style={{ color: theme.colors.primary }}>Toggle</Text>
99
97
  </Pressable>
100
98
  </View>
101
- );
99
+ )
102
100
  }
103
101
  ```
104
102
 
103
+ `useTheme()` returns `theme`, `preference`, `setTheme`, and `isTransitioning`. See the [useTheme reference](https://react-native-theme-transition.vercel.app/docs/api/use-theme) for the full API.
104
+
105
+ > Want the agent to write all three files? With the [AI-assisted setup](#ai-assisted-setup) skill installed, Claude Code or Cursor has these steps as a recipe and applies them to your project directly.
106
+
107
+ ## AI-assisted setup
108
+
109
+ For agentic coding with Claude Code, Cursor, or Codex, the library ships a skill:
110
+
111
+ ```bash
112
+ npx skills add https://skills.sh/marioprieta/skills/react-native-theme-transition
113
+ ```
114
+
115
+ It's the same content as the docs site, split into files so the agent can pull the relevant one (api, guides, recipes, examples) instead of loading everything.
116
+
105
117
  ## Contributing
106
118
 
107
- Contributions are welcome! Please read the [contributing guide](./CONTRIBUTING.md) and open an issue first to discuss what you'd like to change.
119
+ Contributions are welcome. Please read the [contributing guide](./CONTRIBUTING.md) and open an issue first to discuss what you'd like to change.
108
120
 
109
121
  ## License
110
122
 
package/README.npm.md CHANGED
@@ -1,110 +1,122 @@
1
1
  <h1 align="center">React Native Theme Transition</h1>
2
2
 
3
3
  <p align="center">
4
- Smooth, animated theme transitions for React Native. Expo Go compatible, powered by Reanimated.
4
+ Nine animated theme transitions for React Native. Skia-powered, runs in Expo Go.
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/react-native-theme-transition"><img src="https://img.shields.io/npm/v/react-native-theme-transition.svg?t=1" alt="npm version" /></a>
9
- <a href="https://bundlephobia.com/package/react-native-theme-transition"><img src="https://img.shields.io/badge/gzip%20size-2.7%20kB-brightgreen" alt="bundle size" /></a>
9
+ <a href="https://bundlephobia.com/package/react-native-theme-transition"><img src="https://img.shields.io/bundlephobia/minzip/react-native-theme-transition" alt="bundle size" /></a>
10
10
  <img src="https://img.shields.io/badge/Expo_Go-compatible-000.svg?logo=expo&logoColor=white" alt="expo compatible" />
11
11
  <img src="https://img.shields.io/badge/React_Compiler-compatible-blueviolet.svg" alt="react compiler" />
12
12
  <a href="https://github.com/marioprieta/react-native-theme-transition/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/react-native-theme-transition?t=1" alt="license" /></a>
13
13
  </p>
14
14
 
15
- <table align="center">
16
- <tr>
17
- <td align="center"><b>iOS</b></td>
18
- <td align="center"><b>Android</b></td>
19
- </tr>
20
- <tr>
21
- <td>
22
- <img src="https://raw.githubusercontent.com/marioprieta/react-native-theme-transition/main/assets/videos/iOS_demo.gif" width="260" alt="iOS demo" />
23
- </td>
24
- <td>
25
- <img src="https://raw.githubusercontent.com/marioprieta/react-native-theme-transition/main/assets/videos/Android_demo.gif" width="260" alt="Android demo" />
26
- </td>
27
- </tr>
28
- </table>
15
+ <p align="center">
16
+ <img src="https://github.com/user-attachments/assets/32cdd33a-2c79-42f6-b70a-4a4644100683" width="400" alt="React Native Theme Transition demo" />
17
+ </p>
29
18
 
30
19
  ## Features
31
20
 
32
- - **Smooth cross-fade transitions** — powered by Reanimated on the native UI thread (60-120 FPS)
33
- - **Expo Go compatible** — no native code, no prebuilds required
34
- - **Multi-theme support** — define as many themes as you need with full TypeScript inference
35
- - **System theme sync** — follows OS appearance automatically with zero-flash startup
36
- - **Native UI sync** — alerts, keyboards, and date pickers automatically match your active theme
37
- - **Transition safe** — blocks concurrent transitions and exposes `isTransitioning`
38
- - **React Compiler ready** — all hooks follow the [Rules of React](https://react.dev/reference/rules)
39
- - **Lightweight** — ~2.7 kB gzipped, zero runtime dependencies
21
+ - **Nine transition styles.** `fade`, `circularReveal`, `heart`, `star`, `wipe`, `slide`, `split`, `pixelize`, `dissolve`.
22
+ - **Expo Go ready.** Works on Expo SDK 54+ out of the box. Bare React Native CLI also supported.
23
+ - **Full TypeScript inference.** `useTheme()` and `setTheme()` know your theme names and color tokens without manual generics.
24
+ - **System theme built in.** Follows OS appearance with zero-flash startup.
25
+ - **Strict runtime validation.** Invalid options throw immediately with clear error messages.
26
+ - **React Compiler compatible.** All hooks follow the [Rules of React](https://react.dev/reference/rules).
27
+
28
+ ## Requirements
29
+
30
+ - React **19.0.0+** and React Native **0.78.0+**
31
+ - `@shopify/react-native-skia` **2.0.0+**
32
+ - `react-native-reanimated` **4.0.0+**
33
+ - `react-native-worklets` **0.5.0+**
40
34
 
41
- ## Documentation
35
+ ## Try it
42
36
 
43
- For full docs, API reference, examples, and recipes, visit **[react-native-theme-transition.vercel.app](https://react-native-theme-transition.vercel.app)**.
37
+ - [Snack](https://snack.expo.dev/@mariops03/react-native-theme-transition) Live playground with the 9 transitions in a browser phone preview.
38
+ - [Docs](https://react-native-theme-transition.vercel.app) API reference, recipes, migration guide.
44
39
 
45
40
  ## Installation
46
41
 
47
42
  ```bash
48
- # Expo (SDK 54+ already has reanimated and view-shot)
49
- npx expo install react-native-theme-transition react-native-worklets
43
+ # Expo (SDK 54+)
44
+ npx expo install react-native-theme-transition @shopify/react-native-skia react-native-worklets
50
45
 
51
46
  # React Native CLI
52
- npm install react-native-theme-transition react-native-reanimated react-native-view-shot react-native-worklets
47
+ npm install react-native-theme-transition @shopify/react-native-skia react-native-reanimated react-native-worklets
53
48
  ```
54
49
 
55
- Add `react-native-worklets/plugin` as the **last plugin** in your `babel.config.js`.
50
+ Add `react-native-worklets/plugin` as the **last plugin** in your `babel.config.js`. On Expo SDK 55+, do NOT add `react-native-reanimated/plugin`, since `babel-preset-expo` already includes it.
56
51
 
57
- ## Quick start
52
+ > Using Claude Code, Cursor, or Codex? Install the [AI-assisted setup](#ai-assisted-setup) skill first and the agent can run the installation from the v2 API reference.
53
+
54
+ ## Quick Start
58
55
 
59
56
  ```ts
60
57
  // theme.ts
61
- import { createThemeTransition } from 'react-native-theme-transition';
58
+ import { createThemeTransition } from 'react-native-theme-transition'
62
59
 
63
60
  export const { ThemeTransitionProvider, useTheme } = createThemeTransition({
64
61
  themes: {
65
62
  light: { background: '#ffffff', text: '#000000', primary: '#007AFF' },
66
63
  dark: { background: '#000000', text: '#ffffff', primary: '#0A84FF' },
67
64
  },
68
- });
65
+ })
69
66
  ```
70
67
 
71
68
  ```tsx
72
69
  // App.tsx
73
- import { ThemeTransitionProvider } from './theme';
70
+ import { ThemeTransitionProvider } from './theme'
74
71
 
75
72
  export default function App() {
76
73
  return (
77
74
  <ThemeTransitionProvider initialTheme="system">
78
75
  <MyApp />
79
76
  </ThemeTransitionProvider>
80
- );
77
+ )
81
78
  }
82
79
  ```
83
80
 
84
81
  ```tsx
85
82
  // MyScreen.tsx
86
- import { useTheme } from './theme';
83
+ import { Pressable, Text, View } from 'react-native'
84
+ import { useTheme } from './theme'
87
85
 
88
86
  function MyScreen() {
89
- const { colors, name, setTheme, isTransitioning } = useTheme();
87
+ const { theme, setTheme, isTransitioning } = useTheme()
90
88
 
91
89
  return (
92
- <View style={{ flex: 1, backgroundColor: colors.background }}>
93
- <Text style={{ color: colors.text }}>Current: {name}</Text>
90
+ <View style={{ flex: 1, backgroundColor: theme.colors.background }}>
91
+ <Text style={{ color: theme.colors.text }}>Current: {theme.name}</Text>
94
92
  <Pressable
95
- onPress={() => setTheme(name === 'light' ? 'dark' : 'light')}
93
+ onPress={() => setTheme(theme.name === 'dark' ? 'light' : 'dark', { transition: 'circularReveal' })}
96
94
  disabled={isTransitioning}
97
95
  >
98
- <Text style={{ color: colors.primary }}>Toggle theme</Text>
96
+ <Text style={{ color: theme.colors.primary }}>Toggle</Text>
99
97
  </Pressable>
100
98
  </View>
101
- );
99
+ )
102
100
  }
103
101
  ```
104
102
 
103
+ `useTheme()` returns `theme`, `preference`, `setTheme`, and `isTransitioning`. See the [useTheme reference](https://react-native-theme-transition.vercel.app/docs/api/use-theme) for the full API.
104
+
105
+ > Want the agent to write all three files? With the [AI-assisted setup](#ai-assisted-setup) skill installed, Claude Code or Cursor has these steps as a recipe and applies them to your project directly.
106
+
107
+ ## AI-assisted setup
108
+
109
+ For agentic coding with Claude Code, Cursor, or Codex, the library ships a skill:
110
+
111
+ ```bash
112
+ npx skills add https://skills.sh/marioprieta/skills/react-native-theme-transition
113
+ ```
114
+
115
+ It's the same content as the docs site, split into files so the agent can pull the relevant one (api, guides, recipes, examples) instead of loading everything.
116
+
105
117
  ## Contributing
106
118
 
107
- Contributions are welcome! Please read the [contributing guide](./CONTRIBUTING.md) and open an issue first to discuss what you'd like to change.
119
+ Contributions are welcome. Please read the [contributing guide](./CONTRIBUTING.md) and open an issue first to discuss what you'd like to change.
108
120
 
109
121
  ## License
110
122
 
@@ -1,3 +1,2 @@
1
- /** Log/error prefix shared across the package. @internal */
2
- export declare const TAG = "[react-native-theme-transition]";
1
+ export {};
3
2
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,eAAO,MAAM,GAAG,oCAAoC,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":""}
package/dist/constants.js CHANGED
@@ -1,3 +1,7 @@
1
1
  /** Log/error prefix shared across the package. @internal */
2
2
  export const TAG = '[react-native-theme-transition]';
3
+ /** Absolute fill style for overlays. @internal */
4
+ export const ABSOLUTE_FILL = { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 };
5
+ /** Flex fill for the provider's root and inner wrappers. @internal */
6
+ export const FLEX_FILL = { flex: 1 };
3
7
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,MAAM,CAAC,MAAM,GAAG,GAAG,iCAAiC,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,MAAM,CAAC,MAAM,GAAG,GAAG,iCAAiC,CAAA;AAEpD,kDAAkD;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAW,CAAA;AAEpG,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,CAAC,EAAW,CAAA"}
@@ -1,28 +1,16 @@
1
1
  /**
2
- * Factory that wires the theme transition provider, context, and hooks.
3
- *
4
- * @remarks
5
- * Validates theme configuration at initialization: ensures at least one theme
6
- * exists and that all themes share identical token keys.
7
- * Returns a self-contained API ({@link ThemeTransitionAPI}) with no singletons,
8
- * so multiple theme scopes can coexist in the same app.
2
+ * Factory entry point for the theme transition system.
9
3
  *
10
4
  * @module
11
5
  */
12
6
  import type { ThemeDefinition, ThemeTransitionAPI, ThemeTransitionConfig } from './types';
13
7
  /**
14
- * Creates a fully typed theme transition system.
15
- *
16
- * @typeParam T - Your application's theme map, keyed by theme name.
17
- * @param config - Theme configuration including available themes and defaults.
18
- * @returns A provider component and hooks scoped to the supplied themes.
8
+ * Builds a fully typed theme transition system from a map of themes.
19
9
  *
20
- * @example
21
- * ```tsx
22
- * const { ThemeTransitionProvider, useTheme } = createThemeTransition({
23
- * themes: { light: { bg: '#fff' }, dark: { bg: '#000' } },
24
- * });
25
- * ```
10
+ * @param config - Theme configuration.
11
+ * @returns A {@link ThemeTransitionAPI} bound to the supplied themes.
12
+ * @throws Error on invalid configuration.
13
+ * @see https://react-native-theme-transition.vercel.app/docs/api/create-theme-transition
26
14
  */
27
15
  export declare function createThemeTransition<T extends Record<string, ThemeDefinition>>(config: ThemeTransitionConfig<T>): ThemeTransitionAPI<T>;
28
16
  //# sourceMappingURL=createThemeTransition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createThemeTransition.d.ts","sourceRoot":"","sources":["../src/createThemeTransition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EACV,eAAe,EAEf,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EAC7E,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAC/B,kBAAkB,CAAC,CAAC,CAAC,CAsDvB"}
1
+ {"version":3,"file":"createThemeTransition.d.ts","sourceRoot":"","sources":["../src/createThemeTransition.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACV,eAAe,EAEf,kBAAkB,EAClB,qBAAqB,EAGtB,MAAM,SAAS,CAAA;AAEhB;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EAC7E,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAC/B,kBAAkB,CAAC,CAAC,CAAC,CAiFvB"}
@@ -1,38 +1,27 @@
1
1
  /**
2
- * Factory that wires the theme transition provider, context, and hooks.
3
- *
4
- * @remarks
5
- * Validates theme configuration at initialization: ensures at least one theme
6
- * exists and that all themes share identical token keys.
7
- * Returns a self-contained API ({@link ThemeTransitionAPI}) with no singletons,
8
- * so multiple theme scopes can coexist in the same app.
2
+ * Factory entry point for the theme transition system.
9
3
  *
10
4
  * @module
11
5
  */
6
+ import { use } from 'react';
12
7
  import { TAG } from './constants';
13
- import { createUseTheme } from './hooks/useTheme';
14
8
  import { createProviderAndContext } from './transitionEngine';
9
+ import { TRANSITION_TYPES } from './transitionMeta';
15
10
  /**
16
- * Creates a fully typed theme transition system.
17
- *
18
- * @typeParam T - Your application's theme map, keyed by theme name.
19
- * @param config - Theme configuration including available themes and defaults.
20
- * @returns A provider component and hooks scoped to the supplied themes.
11
+ * Builds a fully typed theme transition system from a map of themes.
21
12
  *
22
- * @example
23
- * ```tsx
24
- * const { ThemeTransitionProvider, useTheme } = createThemeTransition({
25
- * themes: { light: { bg: '#fff' }, dark: { bg: '#000' } },
26
- * });
27
- * ```
13
+ * @param config - Theme configuration.
14
+ * @returns A {@link ThemeTransitionAPI} bound to the supplied themes.
15
+ * @throws Error on invalid configuration.
16
+ * @see https://react-native-theme-transition.vercel.app/docs/api/create-theme-transition
28
17
  */
29
18
  export function createThemeTransition(config) {
30
19
  const themeNames = Object.keys(config.themes);
31
20
  if (themeNames.length === 0) {
32
21
  throw new Error(`${TAG} \`themes\` must contain at least one theme.`);
33
22
  }
34
- if ('system' in config.themes) {
35
- throw new Error(`${TAG} \`"system"\` is a reserved name and cannot be used as a theme key. Rename the theme and use \`systemThemeMap\` to map OS appearance to it.`);
23
+ if (Object.hasOwn(config.themes, 'system')) {
24
+ throw new Error(`${TAG} \`"system"\` is a reserved name and cannot be used as a theme key.\n Hint: rename the theme and use \`systemThemeMap\` to map OS appearance to it.`);
36
25
  }
37
26
  const referenceTheme = themeNames[0];
38
27
  const referenceKeys = Object.keys(config.themes[referenceTheme]).sort();
@@ -41,29 +30,42 @@ export function createThemeTransition(config) {
41
30
  continue;
42
31
  const keys = Object.keys(config.themes[name]).sort();
43
32
  if (keys.length !== referenceKeys.length || keys.some((k, i) => k !== referenceKeys[i])) {
44
- throw new Error(`${TAG} Theme "${name}" has different token keys than "${referenceTheme}". All themes must share identical keys.`);
33
+ throw new Error(`${TAG} Theme "${name}" has different token keys than "${referenceTheme}".\n Hint: every theme must share identical token keys.`);
45
34
  }
46
35
  }
47
- if (config.duration != null &&
48
- (typeof config.duration !== 'number' ||
49
- !Number.isFinite(config.duration) ||
50
- config.duration < 0)) {
51
- throw new Error(`${TAG} \`duration\` must be a finite non-negative number.`);
36
+ if (config.transition != null && !TRANSITION_TYPES.includes(config.transition)) {
37
+ throw new Error(`${TAG} \`transition\` must be one of: ${TRANSITION_TYPES.join(', ')}. Got "${config.transition}".`);
52
38
  }
39
+ const assertThemeExists = (name, source, hint) => {
40
+ if (!Object.hasOwn(config.themes, name)) {
41
+ throw new Error(`${TAG} ${source} refers to "${name}" which does not exist in themes.\n Hint: ${hint}`);
42
+ }
43
+ };
53
44
  if (config.systemThemeMap) {
54
- if (!('light' in config.systemThemeMap) || !('dark' in config.systemThemeMap)) {
45
+ if (!Object.hasOwn(config.systemThemeMap, 'light') ||
46
+ !Object.hasOwn(config.systemThemeMap, 'dark')) {
55
47
  throw new Error(`${TAG} \`systemThemeMap\` must provide both \`light\` and \`dark\` keys.`);
56
48
  }
57
49
  for (const [scheme, name] of Object.entries(config.systemThemeMap)) {
58
- if (!(name in config.themes)) {
59
- throw new Error(`${TAG} \`systemThemeMap.${scheme}\` maps to "${name}" which does not exist in themes.`);
60
- }
50
+ assertThemeExists(name, `\`systemThemeMap.${scheme}\``, 'the value must match a key in `themes`.');
51
+ }
52
+ }
53
+ if (config.darkThemes) {
54
+ if (config.darkThemes.length === 0) {
55
+ throw new Error(`${TAG} \`darkThemes\` cannot be an empty array.\n Hint: omit the field to use the default (\`['dark']\` or \`[systemThemeMap.dark]\`), or list at least one theme name.`);
56
+ }
57
+ for (const name of config.darkThemes) {
58
+ assertThemeExists(name, '`darkThemes`', 'every entry in `darkThemes` must match a key in `themes`.');
61
59
  }
62
60
  }
63
61
  const { Context, ThemeTransitionProvider } = createProviderAndContext(config);
64
- return {
65
- ThemeTransitionProvider,
66
- useTheme: createUseTheme(Context),
67
- };
62
+ function useTheme() {
63
+ const ctx = use(Context);
64
+ if (!ctx) {
65
+ throw new Error(`${TAG} \`useTheme\` must be used inside a \`ThemeTransitionProvider\`.`);
66
+ }
67
+ return ctx;
68
+ }
69
+ return { ThemeTransitionProvider, useTheme };
68
70
  }
69
71
  //# sourceMappingURL=createThemeTransition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createThemeTransition.js","sourceRoot":"","sources":["../src/createThemeTransition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAQ7D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAgC;IAEhC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM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AC,GAAG,GAAG,kEAAkE,CAAC,CAAA;QAC3F,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,CAAA;AAC9C,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,17 +2,17 @@
2
2
  * Public entry point for react-native-theme-transition.
3
3
  *
4
4
  * @remarks
5
- * The transition mechanism works in five steps:
6
- * 1. Blocks touch input via a Reanimated shared value (instant, no React re-render).
7
- * 2. Captures the current native view via `react-native-view-shot`.
8
- * 3. Overlays the snapshot as an absolute-positioned `Image` (`onLoad` confirms decode).
9
- * 4. Mutates context to inject new theme colors underneath.
10
- * 5. Fades the overlay to zero via `react-native-reanimated` — the native repaint
11
- * completes during the first frames while the overlay is still near-opaque.
5
+ * The transition engine snapshots the current native view into a Skia
6
+ * `SkImage`, swaps the theme tokens underneath, and animates the
7
+ * snapshot away with one of nine styles (fade, circular reveal, heart,
8
+ * star, wipe, slide, split, pixelize, dissolve). Touch input is blocked
9
+ * by a shared value on the UI thread so React never sees the blocking
10
+ * state change.
12
11
  *
13
- * @see {@link createThemeTransition} for the main API surface.
12
+ * @see {@link createThemeTransition} for the main API entry.
14
13
  * @packageDocumentation
15
14
  */
16
15
  export { createThemeTransition } from './createThemeTransition';
17
- export type { SetThemeOptions, SystemThemeMap, ThemeDefinition, ThemeNames, ThemeSelectionResult, ThemeTransitionAPI, ThemeTransitionConfig, TokenNames, UseThemeResult, } from './types';
16
+ export { TRANSITION_META, TRANSITION_TYPES } from './transitionMeta';
17
+ export type { ColorScheme, OriginSpec, SetThemeOptions, SystemThemeMap, ThemeDefinition, ThemeNames, ThemeTransitionAPI, ThemeTransitionConfig, TokenNames, TransitionOrigin, TransitionType, UseThemeResult, } from './types';
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,YAAY,EACV,eAAe,EACf,cAAc,EACd,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACV,cAAc,GACf,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEpE,YAAY,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,GACf,MAAM,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -2,16 +2,16 @@
2
2
  * Public entry point for react-native-theme-transition.
3
3
  *
4
4
  * @remarks
5
- * The transition mechanism works in five steps:
6
- * 1. Blocks touch input via a Reanimated shared value (instant, no React re-render).
7
- * 2. Captures the current native view via `react-native-view-shot`.
8
- * 3. Overlays the snapshot as an absolute-positioned `Image` (`onLoad` confirms decode).
9
- * 4. Mutates context to inject new theme colors underneath.
10
- * 5. Fades the overlay to zero via `react-native-reanimated` — the native repaint
11
- * completes during the first frames while the overlay is still near-opaque.
5
+ * The transition engine snapshots the current native view into a Skia
6
+ * `SkImage`, swaps the theme tokens underneath, and animates the
7
+ * snapshot away with one of nine styles (fade, circular reveal, heart,
8
+ * star, wipe, slide, split, pixelize, dissolve). Touch input is blocked
9
+ * by a shared value on the UI thread so React never sees the blocking
10
+ * state change.
12
11
  *
13
- * @see {@link createThemeTransition} for the main API surface.
12
+ * @see {@link createThemeTransition} for the main API entry.
14
13
  * @packageDocumentation
15
14
  */
16
15
  export { createThemeTransition } from './createThemeTransition';
16
+ export { TRANSITION_META, TRANSITION_TYPES } from './transitionMeta';
17
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Skia-powered overlay for theme transitions.
3
+ *
4
+ * @remarks
5
+ * Top-level `SkiaOverlay` keeps a `<Canvas>` permanently mounted (so
6
+ * starting a transition never pays for a native-view layout pass on
7
+ * Android) and dispatches to a per-mode component that owns the
8
+ * `useDerivedValue` hooks for that mode only. The active mode's hooks
9
+ * mount when the transition starts and unmount when it ends. `fade`
10
+ * never pays for `slide`'s slot machine, `pixelize` never pays for
11
+ * `heart`'s path interpolation, etc.
12
+ *
13
+ * @module
14
+ * @internal
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=SkiaOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkiaOverlay.d.ts","sourceRoot":"","sources":["../../src/overlay/SkiaOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}