@react-navigation/native 8.0.0-alpha.3 → 8.0.0-alpha.5

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 (162) hide show
  1. package/android/build/.transforms/586a73aab4c351d3f13dc604ca6964e8/transformed/classes/classes_dex/classes.dex +0 -0
  2. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.dex +0 -0
  3. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.dex +0 -0
  4. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.dex +0 -0
  5. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.dex +0 -0
  6. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule$getImageSource$1.dex +0 -0
  7. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolModule.dex +0 -0
  8. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypeface.dex +0 -0
  9. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolTypefaceResult.dex +0 -0
  10. package/android/build/.transforms/fb9c4b42fa16b6541a5819cb4bf06272/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/org/reactnavigation/MaterialSymbolView.dex +0 -0
  11. package/android/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.java +2 -1
  12. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.java +1 -1
  13. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.java +42 -0
  14. package/android/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.java +14 -0
  15. package/android/build/generated/source/codegen/jni/ReactNavigationSpec-generated.cpp +2 -2
  16. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.cpp +72 -2
  17. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/Props.h +21 -2
  18. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI-generated.cpp +4 -5
  19. package/android/build/generated/source/codegen/jni/react/renderer/components/ReactNavigationSpec/ReactNavigationSpecJSI.h +5 -5
  20. package/android/build/generated/source/codegen/schema.json +1 -1
  21. package/android/build/intermediates/assets/debug/mergeDebugAssets/fonts/MaterialSymbols.hash +1 -0
  22. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  23. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +1 -1
  24. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
  25. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
  26. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
  27. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
  28. package/android/build/intermediates/react-navigation/fonts/MaterialSymbols.hash +1 -0
  29. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/fbreact/specs/NativeMaterialSymbolModuleSpec.class +0 -0
  30. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationMaterialSymbolViewManagerDelegate.class +0 -0
  31. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerDelegate.class +0 -0
  32. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/facebook/react/viewmanagers/ReactNavigationSFSymbolViewManagerInterface.class +0 -0
  33. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule$getImageSource$1.class +0 -0
  34. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolModule.class +0 -0
  35. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
  36. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolTypefaceResult.class +0 -0
  37. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/org/reactnavigation/MaterialSymbolView.class +0 -0
  38. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  59. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  60. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  61. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  62. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  63. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  65. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  68. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  69. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  70. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  71. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
  74. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  91. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/ReactNavigationSFSymbolViewManagerDelegate.class.uniqueId0 +0 -0
  92. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/ReactNavigationSFSymbolViewManagerInterface.class.uniqueId1 +0 -0
  93. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  94. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule$getImageSource$1.class +0 -0
  95. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolModule.class +0 -0
  96. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypeface.class +0 -0
  97. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolTypefaceResult.class +0 -0
  98. package/android/build/tmp/kotlin-classes/debug/org/reactnavigation/MaterialSymbolView.class +0 -0
  99. package/android/build.gradle +80 -6
  100. package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +14 -4
  101. package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +40 -10
  102. package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +15 -1
  103. package/assets/fonts/MaterialSymbolsOutlined_100.ttf +0 -0
  104. package/assets/fonts/MaterialSymbolsOutlined_200.ttf +0 -0
  105. package/assets/fonts/MaterialSymbolsOutlined_300.ttf +0 -0
  106. package/assets/fonts/MaterialSymbolsOutlined_500.ttf +0 -0
  107. package/assets/fonts/MaterialSymbolsOutlined_600.ttf +0 -0
  108. package/assets/fonts/MaterialSymbolsOutlined_700.ttf +0 -0
  109. package/assets/fonts/MaterialSymbolsRounded.codepoints +4102 -0
  110. package/assets/fonts/MaterialSymbolsRounded_100.ttf +0 -0
  111. package/assets/fonts/MaterialSymbolsRounded_200.ttf +0 -0
  112. package/assets/fonts/MaterialSymbolsRounded_300.ttf +0 -0
  113. package/assets/fonts/MaterialSymbolsRounded_400.ttf +0 -0
  114. package/assets/fonts/MaterialSymbolsRounded_500.ttf +0 -0
  115. package/assets/fonts/MaterialSymbolsRounded_600.ttf +0 -0
  116. package/assets/fonts/MaterialSymbolsRounded_700.ttf +0 -0
  117. package/assets/fonts/MaterialSymbolsSharp.codepoints +4102 -0
  118. package/assets/fonts/MaterialSymbolsSharp_100.ttf +0 -0
  119. package/assets/fonts/MaterialSymbolsSharp_200.ttf +0 -0
  120. package/assets/fonts/MaterialSymbolsSharp_300.ttf +0 -0
  121. package/assets/fonts/MaterialSymbolsSharp_400.ttf +0 -0
  122. package/assets/fonts/MaterialSymbolsSharp_500.ttf +0 -0
  123. package/assets/fonts/MaterialSymbolsSharp_600.ttf +0 -0
  124. package/assets/fonts/MaterialSymbolsSharp_700.ttf +0 -0
  125. package/ios/ReactNavigationSFSymbolView.mm +21 -0
  126. package/ios/ReactNavigationSFSymbolView.swift +257 -7
  127. package/lib/module/native/MaterialSymbol.android.js +11 -13
  128. package/lib/module/native/MaterialSymbol.android.js.map +1 -1
  129. package/lib/module/native/MaterialSymbolData.js +0 -7
  130. package/lib/module/native/MaterialSymbolData.js.map +1 -1
  131. package/lib/module/native/MaterialSymbolViewNativeComponent.ts +3 -3
  132. package/lib/module/native/NativeMaterialSymbolModule.js.map +1 -1
  133. package/lib/module/native/SFSymbol.ios.js +24 -1
  134. package/lib/module/native/SFSymbol.ios.js.map +1 -1
  135. package/lib/module/native/SFSymbolViewNativeComponent.ts +15 -1
  136. package/lib/module/native/constants.js +14 -0
  137. package/lib/module/native/constants.js.map +1 -0
  138. package/lib/typescript/src/native/MaterialSymbol.android.d.ts +2 -2
  139. package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
  140. package/lib/typescript/src/native/MaterialSymbolData.d.ts +0 -3
  141. package/lib/typescript/src/native/MaterialSymbolData.d.ts.map +1 -1
  142. package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts +2 -2
  143. package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
  144. package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts +1 -1
  145. package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts.map +1 -1
  146. package/lib/typescript/src/native/SFSymbol.ios.d.ts +1 -1
  147. package/lib/typescript/src/native/SFSymbol.ios.d.ts.map +1 -1
  148. package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts +15 -1
  149. package/lib/typescript/src/native/SFSymbolViewNativeComponent.d.ts.map +1 -1
  150. package/lib/typescript/src/native/constants.d.ts +12 -0
  151. package/lib/typescript/src/native/constants.d.ts.map +1 -0
  152. package/lib/typescript/src/native/types.d.ts +144 -0
  153. package/lib/typescript/src/native/types.d.ts.map +1 -1
  154. package/package.json +2 -2
  155. package/src/native/MaterialSymbol.android.tsx +12 -15
  156. package/src/native/MaterialSymbolData.tsx +0 -4
  157. package/src/native/MaterialSymbolViewNativeComponent.ts +3 -3
  158. package/src/native/NativeMaterialSymbolModule.ts +3 -4
  159. package/src/native/SFSymbol.ios.tsx +24 -1
  160. package/src/native/SFSymbolViewNativeComponent.ts +15 -1
  161. package/src/native/constants.tsx +11 -0
  162. package/src/native/types.tsx +179 -0
@@ -1,10 +1,59 @@
1
1
  import type { ColorValue } from 'react-native';
2
+ import type { FONT_WEIGHTS } from './constants';
2
3
  import type { MaterialSymbolName } from './MaterialSymbolData';
3
4
  export type MaterialSymbolOptions = {
4
5
  /**
5
6
  * The name of the Material Symbol to display.
6
7
  */
7
8
  name: MaterialSymbolName;
9
+ /**
10
+ * The variant of the symbol.
11
+ *
12
+ * Can be customized using `react-navigation` key in `package.json`:
13
+ *
14
+ * ```json
15
+ * "react-navigation": {
16
+ * "material-symbol": {
17
+ * "fonts": [
18
+ * {
19
+ * "variant": "rounded",
20
+ * "weight": 300,
21
+ * },
22
+ * ]
23
+ * }
24
+ * }
25
+ * ```
26
+ *
27
+ * Automatically set if a single variant is available.
28
+ *
29
+ * @default 'outlined'
30
+ */
31
+ variant?: 'outlined' | 'rounded' | 'sharp';
32
+ /**
33
+ * The weight of the symbol.
34
+ *
35
+ * Can be customized using `react-navigation` key in `package.json`:
36
+ *
37
+ * ```json
38
+ * "react-navigation": {
39
+ * "material-symbol": {
40
+ * "fonts": [
41
+ * {
42
+ * "variant": "rounded",
43
+ * "weight": 300,
44
+ * },
45
+ * ]
46
+ * }
47
+ * }
48
+ * ```
49
+ *
50
+ * Only numeric weights are supported in the configuration.
51
+ *
52
+ * Automatically set if a single weight is available.
53
+ *
54
+ * @default 400
55
+ */
56
+ weight?: 'thin' | 'ultralight' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 100 | 200 | 300 | 400 | 500 | 600 | 700;
8
57
  /**
9
58
  * The size of the symbol.
10
59
  *
@@ -18,6 +67,58 @@ export type MaterialSymbolOptions = {
18
67
  */
19
68
  color?: ColorValue;
20
69
  };
70
+ export type SFSymbolScale = 'small' | 'medium' | 'large';
71
+ export type SFSymbolMode = 'monochrome' | 'hierarchical' | 'palette' | 'multicolor';
72
+ export type SFSymbolAnimationEffect = 'bounce' | 'pulse' | 'appear' | 'disappear' | 'variableColor' | 'breathe' | 'wiggle' | 'rotate';
73
+ export type SFSymbolAnimationConfig = {
74
+ /**
75
+ * The animation effect to apply.
76
+ */
77
+ effect: SFSymbolAnimationEffect;
78
+ /**
79
+ * Whether the animation repeats continuously.
80
+ *
81
+ * @default false
82
+ */
83
+ repeating?: boolean;
84
+ /**
85
+ * Number of times to repeat the animation.
86
+ * Ignored if `repeating` is `true`.
87
+ */
88
+ repeatCount?: number;
89
+ /**
90
+ * Speed multiplier for the animation.
91
+ *
92
+ * @default 1
93
+ */
94
+ speed?: number;
95
+ /**
96
+ * Whether to animate the whole symbol at once or layer by layer.
97
+ *
98
+ * @default false
99
+ */
100
+ wholeSymbol?: boolean;
101
+ /**
102
+ * Direction of the animation.
103
+ * Applicable to `bounce` and `wiggle`.
104
+ */
105
+ direction?: 'up' | 'down';
106
+ /**
107
+ * Whether the variable color effect reverses with each cycle.
108
+ * Only applicable to `variableColor`.
109
+ *
110
+ * @default false
111
+ */
112
+ reversing?: boolean;
113
+ /**
114
+ * Whether each layer remains changed until the end of the cycle.
115
+ * Only applicable to `variableColor`.
116
+ *
117
+ * @default false
118
+ */
119
+ cumulative?: boolean;
120
+ };
121
+ export type SFSymbolAnimation = SFSymbolAnimationEffect | SFSymbolAnimationConfig;
21
122
  export type SFSymbolOptions = {
22
123
  /**
23
124
  * The name of the SF Symbol to display.
@@ -30,8 +131,51 @@ export type SFSymbolOptions = {
30
131
  size?: number;
31
132
  /**
32
133
  * The color of the symbol.
134
+ * Used as the tint color in monochrome mode, and as the fallback for
135
+ * `colors.primary` in hierarchical and palette modes.
136
+ *
33
137
  * @default 'black'
34
138
  */
35
139
  color?: ColorValue;
140
+ /**
141
+ * The weight of the symbol.
142
+ *
143
+ * @default 'regular'
144
+ */
145
+ weight?: keyof typeof FONT_WEIGHTS | (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];
146
+ /**
147
+ * The scale of the symbol relative to the font size.
148
+ *
149
+ * @default 'medium'
150
+ */
151
+ scale?: SFSymbolScale;
152
+ /**
153
+ * The rendering mode of the symbol.
154
+ * - `monochrome`: Single color tint (default).
155
+ * - `hierarchical`: Derived hierarchy from a single color.
156
+ * - `palette`: Explicit colors for each layer.
157
+ * - `multicolor`: Uses the symbol's built-in multicolor scheme.
158
+ *
159
+ * @default 'monochrome'
160
+ */
161
+ mode?: SFSymbolMode;
162
+ /**
163
+ * The colors for non-monochrome rendering modes.
164
+ * - `hierarchical`: uses `primary` as the base color.
165
+ * - `palette`: uses `primary`, `secondary`, and `tertiary` for each layer.
166
+ * - `multicolor`: ignored.
167
+ *
168
+ * Falls back to `color` for `primary` if not specified.
169
+ */
170
+ colors?: {
171
+ primary?: ColorValue;
172
+ secondary?: ColorValue;
173
+ tertiary?: ColorValue;
174
+ };
175
+ /**
176
+ * The animation effect to apply to the symbol.
177
+ * Requires iOS 17+. Ignored on earlier versions.
178
+ */
179
+ animation?: SFSymbolAnimation;
36
180
  };
37
181
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/native/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,IAAI,EAAE,kBAAkB,CAAC;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,OAAO,uBAAuB,EAAE,QAAQ,CAAC;IAC/C;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/native/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,IAAI,EAAE,kBAAkB,CAAC;IACzB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;IAC3C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,EACH,MAAM,GACN,YAAY,GACZ,OAAO,GACP,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;IACR;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,cAAc,GACd,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,WAAW,GACX,eAAe,GACf,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;AAEb,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,MAAM,EAAE,uBAAuB,CAAC;IAChC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB,uBAAuB,GACvB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,OAAO,uBAAuB,EAAE,QAAQ,CAAC;IAC/C;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EACH,MAAM,OAAO,YAAY,GACzB,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;IACrD;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,UAAU,CAAC;QACrB,SAAS,CAAC,EAAE,UAAU,CAAC;QACvB,QAAQ,CAAC,EAAE,UAAU,CAAC;KACvB,CAAC;IACF;;;OAGG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-navigation/native",
3
3
  "description": "React Native integration for React Navigation",
4
- "version": "8.0.0-alpha.3",
4
+ "version": "8.0.0-alpha.5",
5
5
  "keywords": [
6
6
  "react-native",
7
7
  "react-navigation",
@@ -107,5 +107,5 @@
107
107
  }
108
108
  }
109
109
  },
110
- "gitHead": "4579b7cfdf8b149ef04cfb585e2cb6b35ded52d7"
110
+ "gitHead": "e70fcf951732df83d28fe5157408974346a1abbc"
111
111
  }
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  type ImageSourcePropType,
3
3
  PixelRatio,
4
+ PlatformColor,
4
5
  processColor,
5
6
  type ViewProps,
6
7
  } from 'react-native';
7
8
 
8
- import { MATERIAL_SYMBOL_FONT_HASHES } from './MaterialSymbolData';
9
+ import { FONT_WEIGHTS } from './constants';
9
10
  import MaterialSymbolViewNativeComponent from './MaterialSymbolViewNativeComponent';
10
11
  import NativeMaterialSymbolModule from './NativeMaterialSymbolModule';
11
12
  import type { MaterialSymbolOptions } from './types';
@@ -14,21 +15,20 @@ export type MaterialSymbolProps = MaterialSymbolOptions & ViewProps;
14
15
 
15
16
  const imageSourceCache = new Map<string, ImageSourcePropType>();
16
17
 
18
+ const DEFAULT_COLOR = PlatformColor('?attr/colorForeground');
19
+
17
20
  export function MaterialSymbol({
18
21
  name,
22
+ weight,
19
23
  size = 24,
20
- color = 'black',
24
+ color = DEFAULT_COLOR,
21
25
  style,
22
26
  ...rest
23
27
  }: MaterialSymbolProps): React.ReactElement {
24
- const variant = 'outlined';
25
- const weight = 400;
26
-
27
28
  return (
28
29
  <MaterialSymbolViewNativeComponent
29
30
  name={name}
30
- variant={variant}
31
- weight={weight}
31
+ weight={typeof weight === 'string' ? FONT_WEIGHTS[weight] : (weight ?? 0)}
32
32
  size={size}
33
33
  color={color}
34
34
  style={[
@@ -45,13 +45,11 @@ export function MaterialSymbol({
45
45
 
46
46
  MaterialSymbol.getImageSource = ({
47
47
  name,
48
+ variant,
49
+ weight,
48
50
  size = 24,
49
51
  color = 'black',
50
52
  }: MaterialSymbolOptions): ImageSourcePropType => {
51
- const variant = 'outlined';
52
- const weight = 400;
53
-
54
- const hash = MATERIAL_SYMBOL_FONT_HASHES[`${variant}-${weight}`];
55
53
  const processedColor = processColor(color);
56
54
 
57
55
  if (processedColor == null) {
@@ -60,7 +58,7 @@ MaterialSymbol.getImageSource = ({
60
58
 
61
59
  const scale = PixelRatio.get();
62
60
 
63
- const cacheKey = `${name}:${variant}:${weight}:${size}:${scale}:${JSON.stringify(processedColor)}:${hash}`;
61
+ const cacheKey = `${name}:${variant}:${weight}:${size}:${scale}:${JSON.stringify(processedColor)}`;
64
62
  const cached = imageSourceCache.get(cacheKey);
65
63
 
66
64
  if (cached !== undefined) {
@@ -70,10 +68,9 @@ MaterialSymbol.getImageSource = ({
70
68
  const uri = NativeMaterialSymbolModule.getImageSource(
71
69
  name,
72
70
  variant,
71
+ typeof weight === 'string' ? FONT_WEIGHTS[weight] : weight,
73
72
  size,
74
- weight,
75
- { value: processedColor },
76
- hash
73
+ { value: processedColor }
77
74
  );
78
75
 
79
76
  const source: ImageSourcePropType = {
@@ -1,10 +1,6 @@
1
1
  // Auto-generated by scripts/update-material-symbols.ts
2
2
  // Do not edit manually
3
3
 
4
- export const MATERIAL_SYMBOL_FONT_HASHES = {
5
- 'outlined-400': 'ec67dff9',
6
- } as const;
7
-
8
4
  export type MaterialSymbolName =
9
5
  | '10k'
10
6
  | '10mp'
@@ -9,10 +9,10 @@ import {
9
9
 
10
10
  export interface NativeProps extends ViewProps {
11
11
  name: string;
12
- variant: string;
12
+ variant?: string;
13
13
  weight?: CodegenTypes.WithDefault<
14
- 100 | 200 | 300 | 400 | 500 | 600 | 700,
15
- 400
14
+ 0 | 100 | 200 | 300 | 400 | 500 | 600 | 700,
15
+ 0
16
16
  >;
17
17
  size: CodegenTypes.Float;
18
18
  color: ColorValue;
@@ -5,13 +5,12 @@ import { type TurboModule, TurboModuleRegistry } from 'react-native';
5
5
  export interface Spec extends TurboModule {
6
6
  getImageSource(
7
7
  name: string,
8
- variant: string,
8
+ variant: string | undefined,
9
+ weight: 100 | 200 | 300 | 400 | 500 | 600 | 700 | undefined,
9
10
  size: number,
10
- weight: 100 | 200 | 300 | 400 | 500 | 600 | 700,
11
11
  // Codegen requires using `Object` instead of `object
12
12
  // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
13
- color: Object,
14
- hash: string
13
+ color: Object
15
14
  ): string;
16
15
  }
17
16
 
@@ -1,5 +1,6 @@
1
1
  import type { ViewProps } from 'react-native';
2
2
 
3
+ import { FONT_WEIGHTS } from './constants';
3
4
  import SFSymbolViewNativeComponent from './SFSymbolViewNativeComponent';
4
5
  import type { SFSymbolOptions } from './types';
5
6
 
@@ -8,15 +9,37 @@ export type SFSymbolProps = SFSymbolOptions & ViewProps;
8
9
  export function SFSymbol({
9
10
  name,
10
11
  size = 24,
11
- color = 'black',
12
+ color,
13
+ weight,
14
+ scale = 'medium',
15
+ mode = 'monochrome',
16
+ colors,
17
+ animation,
12
18
  style,
13
19
  ...rest
14
20
  }: SFSymbolProps): React.ReactElement {
21
+ const animConfig =
22
+ typeof animation === 'string' ? { effect: animation } : animation;
23
+
15
24
  return (
16
25
  <SFSymbolViewNativeComponent
17
26
  name={name}
18
27
  size={size}
19
28
  color={color}
29
+ weight={typeof weight === 'string' ? FONT_WEIGHTS[weight] : (weight ?? 0)}
30
+ scale={scale}
31
+ mode={mode}
32
+ colorPrimary={colors?.primary ?? color}
33
+ colorSecondary={colors?.secondary}
34
+ colorTertiary={colors?.tertiary}
35
+ animation={animConfig?.effect ?? ''}
36
+ animationRepeating={animConfig?.repeating ?? false}
37
+ animationRepeatCount={animConfig?.repeatCount ?? 0}
38
+ animationSpeed={animConfig?.speed ?? 1}
39
+ animationWholeSymbol={animConfig?.wholeSymbol ?? false}
40
+ animationDirection={animConfig?.direction ?? ''}
41
+ animationReversing={animConfig?.reversing ?? false}
42
+ animationCumulative={animConfig?.cumulative ?? false}
20
43
  style={[
21
44
  {
22
45
  width: size,
@@ -10,7 +10,21 @@ import {
10
10
  export interface NativeProps extends ViewProps {
11
11
  name: string;
12
12
  size: CodegenTypes.Float;
13
- color: ColorValue;
13
+ color?: ColorValue;
14
+ weight: CodegenTypes.Int32;
15
+ scale: string;
16
+ mode: string;
17
+ colorPrimary?: ColorValue;
18
+ colorSecondary?: ColorValue;
19
+ colorTertiary?: ColorValue;
20
+ animation: string;
21
+ animationRepeating: boolean;
22
+ animationRepeatCount: CodegenTypes.Int32;
23
+ animationSpeed: CodegenTypes.Float;
24
+ animationWholeSymbol: boolean;
25
+ animationDirection: string;
26
+ animationReversing: boolean;
27
+ animationCumulative: boolean;
14
28
  }
15
29
 
16
30
  export default codegenNativeComponent<NativeProps>(
@@ -0,0 +1,11 @@
1
+ export const FONT_WEIGHTS = {
2
+ thin: 100,
3
+ ultralight: 200,
4
+ light: 300,
5
+ regular: 400,
6
+ medium: 500,
7
+ semibold: 600,
8
+ bold: 700,
9
+ extrabold: 800,
10
+ black: 900,
11
+ } as const;
@@ -1,5 +1,6 @@
1
1
  import type { ColorValue } from 'react-native';
2
2
 
3
+ import type { FONT_WEIGHTS } from './constants';
3
4
  import type { MaterialSymbolName } from './MaterialSymbolData';
4
5
 
5
6
  export type MaterialSymbolOptions = {
@@ -7,6 +8,68 @@ export type MaterialSymbolOptions = {
7
8
  * The name of the Material Symbol to display.
8
9
  */
9
10
  name: MaterialSymbolName;
11
+ /**
12
+ * The variant of the symbol.
13
+ *
14
+ * Can be customized using `react-navigation` key in `package.json`:
15
+ *
16
+ * ```json
17
+ * "react-navigation": {
18
+ * "material-symbol": {
19
+ * "fonts": [
20
+ * {
21
+ * "variant": "rounded",
22
+ * "weight": 300,
23
+ * },
24
+ * ]
25
+ * }
26
+ * }
27
+ * ```
28
+ *
29
+ * Automatically set if a single variant is available.
30
+ *
31
+ * @default 'outlined'
32
+ */
33
+ variant?: 'outlined' | 'rounded' | 'sharp';
34
+ /**
35
+ * The weight of the symbol.
36
+ *
37
+ * Can be customized using `react-navigation` key in `package.json`:
38
+ *
39
+ * ```json
40
+ * "react-navigation": {
41
+ * "material-symbol": {
42
+ * "fonts": [
43
+ * {
44
+ * "variant": "rounded",
45
+ * "weight": 300,
46
+ * },
47
+ * ]
48
+ * }
49
+ * }
50
+ * ```
51
+ *
52
+ * Only numeric weights are supported in the configuration.
53
+ *
54
+ * Automatically set if a single weight is available.
55
+ *
56
+ * @default 400
57
+ */
58
+ weight?:
59
+ | 'thin'
60
+ | 'ultralight'
61
+ | 'light'
62
+ | 'regular'
63
+ | 'medium'
64
+ | 'semibold'
65
+ | 'bold'
66
+ | 100
67
+ | 200
68
+ | 300
69
+ | 400
70
+ | 500
71
+ | 600
72
+ | 700;
10
73
  /**
11
74
  * The size of the symbol.
12
75
  *
@@ -21,6 +84,77 @@ export type MaterialSymbolOptions = {
21
84
  color?: ColorValue;
22
85
  };
23
86
 
87
+ export type SFSymbolScale = 'small' | 'medium' | 'large';
88
+
89
+ export type SFSymbolMode =
90
+ | 'monochrome'
91
+ | 'hierarchical'
92
+ | 'palette'
93
+ | 'multicolor';
94
+
95
+ export type SFSymbolAnimationEffect =
96
+ | 'bounce'
97
+ | 'pulse'
98
+ | 'appear'
99
+ | 'disappear'
100
+ | 'variableColor'
101
+ | 'breathe'
102
+ | 'wiggle'
103
+ | 'rotate';
104
+
105
+ export type SFSymbolAnimationConfig = {
106
+ /**
107
+ * The animation effect to apply.
108
+ */
109
+ effect: SFSymbolAnimationEffect;
110
+ /**
111
+ * Whether the animation repeats continuously.
112
+ *
113
+ * @default false
114
+ */
115
+ repeating?: boolean;
116
+ /**
117
+ * Number of times to repeat the animation.
118
+ * Ignored if `repeating` is `true`.
119
+ */
120
+ repeatCount?: number;
121
+ /**
122
+ * Speed multiplier for the animation.
123
+ *
124
+ * @default 1
125
+ */
126
+ speed?: number;
127
+ /**
128
+ * Whether to animate the whole symbol at once or layer by layer.
129
+ *
130
+ * @default false
131
+ */
132
+ wholeSymbol?: boolean;
133
+ /**
134
+ * Direction of the animation.
135
+ * Applicable to `bounce` and `wiggle`.
136
+ */
137
+ direction?: 'up' | 'down';
138
+ /**
139
+ * Whether the variable color effect reverses with each cycle.
140
+ * Only applicable to `variableColor`.
141
+ *
142
+ * @default false
143
+ */
144
+ reversing?: boolean;
145
+ /**
146
+ * Whether each layer remains changed until the end of the cycle.
147
+ * Only applicable to `variableColor`.
148
+ *
149
+ * @default false
150
+ */
151
+ cumulative?: boolean;
152
+ };
153
+
154
+ export type SFSymbolAnimation =
155
+ | SFSymbolAnimationEffect
156
+ | SFSymbolAnimationConfig;
157
+
24
158
  export type SFSymbolOptions = {
25
159
  /**
26
160
  * The name of the SF Symbol to display.
@@ -33,7 +167,52 @@ export type SFSymbolOptions = {
33
167
  size?: number;
34
168
  /**
35
169
  * The color of the symbol.
170
+ * Used as the tint color in monochrome mode, and as the fallback for
171
+ * `colors.primary` in hierarchical and palette modes.
172
+ *
36
173
  * @default 'black'
37
174
  */
38
175
  color?: ColorValue;
176
+ /**
177
+ * The weight of the symbol.
178
+ *
179
+ * @default 'regular'
180
+ */
181
+ weight?:
182
+ | keyof typeof FONT_WEIGHTS
183
+ | (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];
184
+ /**
185
+ * The scale of the symbol relative to the font size.
186
+ *
187
+ * @default 'medium'
188
+ */
189
+ scale?: SFSymbolScale;
190
+ /**
191
+ * The rendering mode of the symbol.
192
+ * - `monochrome`: Single color tint (default).
193
+ * - `hierarchical`: Derived hierarchy from a single color.
194
+ * - `palette`: Explicit colors for each layer.
195
+ * - `multicolor`: Uses the symbol's built-in multicolor scheme.
196
+ *
197
+ * @default 'monochrome'
198
+ */
199
+ mode?: SFSymbolMode;
200
+ /**
201
+ * The colors for non-monochrome rendering modes.
202
+ * - `hierarchical`: uses `primary` as the base color.
203
+ * - `palette`: uses `primary`, `secondary`, and `tertiary` for each layer.
204
+ * - `multicolor`: ignored.
205
+ *
206
+ * Falls back to `color` for `primary` if not specified.
207
+ */
208
+ colors?: {
209
+ primary?: ColorValue;
210
+ secondary?: ColorValue;
211
+ tertiary?: ColorValue;
212
+ };
213
+ /**
214
+ * The animation effect to apply to the symbol.
215
+ * Requires iOS 17+. Ignored on earlier versions.
216
+ */
217
+ animation?: SFSymbolAnimation;
39
218
  };