react-native-keyboard-controller 1.11.0 → 1.11.2

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 (41) hide show
  1. package/android/src/main/java/com/reactnativekeyboardcontroller/extensions/EditText.kt +8 -0
  2. package/android/src/main/java/com/reactnativekeyboardcontroller/modules/KeyboardControllerModuleImpl.kt +1 -1
  3. package/android/src/main/java/com/reactnativekeyboardcontroller/traversal/FocusedInputHolder.kt +10 -5
  4. package/android/src/main/java/com/reactnativekeyboardcontroller/traversal/ViewHierarchyNavigator.kt +2 -6
  5. package/android/src/test/java/com/reactnativekeyboardcontroller/traversal/FocusedInputHolderTest.kt +45 -0
  6. package/android/src/test/java/com/reactnativekeyboardcontroller/traversal/ViewHierarchyNavigatorTest.kt +11 -10
  7. package/ios/traversal/FocusedInputHolder.swift +5 -5
  8. package/ios/traversal/TextInput.swift +3 -3
  9. package/ios/traversal/ViewHierarchyNavigator.swift +2 -2
  10. package/lib/commonjs/components/KeyboardToolbar/Arrow.js.map +1 -1
  11. package/lib/commonjs/components/KeyboardToolbar/Button.js.map +1 -1
  12. package/lib/commonjs/components/KeyboardToolbar/colors.js +6 -25
  13. package/lib/commonjs/components/KeyboardToolbar/colors.js.map +1 -1
  14. package/lib/commonjs/components/KeyboardToolbar/colors.native.js +41 -0
  15. package/lib/commonjs/components/KeyboardToolbar/colors.native.js.map +1 -0
  16. package/lib/commonjs/components/KeyboardToolbar/index.js.map +1 -1
  17. package/lib/commonjs/components/KeyboardToolbar/types.js +6 -0
  18. package/lib/commonjs/components/KeyboardToolbar/types.js.map +1 -0
  19. package/lib/module/components/KeyboardToolbar/Arrow.js.map +1 -1
  20. package/lib/module/components/KeyboardToolbar/Button.js.map +1 -1
  21. package/lib/module/components/KeyboardToolbar/colors.js +6 -25
  22. package/lib/module/components/KeyboardToolbar/colors.js.map +1 -1
  23. package/lib/module/components/KeyboardToolbar/colors.native.js +34 -0
  24. package/lib/module/components/KeyboardToolbar/colors.native.js.map +1 -0
  25. package/lib/module/components/KeyboardToolbar/index.js.map +1 -1
  26. package/lib/module/components/KeyboardToolbar/types.js +2 -0
  27. package/lib/module/components/KeyboardToolbar/types.js.map +1 -0
  28. package/lib/typescript/components/KeyboardToolbar/Arrow.d.ts +1 -1
  29. package/lib/typescript/components/KeyboardToolbar/Button.d.ts +1 -1
  30. package/lib/typescript/components/KeyboardToolbar/colors.d.ts +1 -16
  31. package/lib/typescript/components/KeyboardToolbar/colors.native.d.ts +2 -0
  32. package/lib/typescript/components/KeyboardToolbar/index.d.ts +1 -1
  33. package/lib/typescript/components/KeyboardToolbar/types.d.ts +16 -0
  34. package/package.json +2 -2
  35. package/react-native-keyboard-controller.podspec +27 -14
  36. package/src/components/KeyboardToolbar/Arrow.tsx +1 -1
  37. package/src/components/KeyboardToolbar/Button.tsx +1 -1
  38. package/src/components/KeyboardToolbar/colors.native.ts +37 -0
  39. package/src/components/KeyboardToolbar/colors.ts +7 -42
  40. package/src/components/KeyboardToolbar/index.tsx +1 -1
  41. package/src/components/KeyboardToolbar/types.ts +16 -0
@@ -86,3 +86,11 @@ val EditText.parentScrollViewTarget: Int
86
86
  // ScrollView was not found
87
87
  return -1
88
88
  }
89
+
90
+ fun EditText?.focus() {
91
+ if (this is ReactEditText) {
92
+ this.requestFocusFromJS()
93
+ } else {
94
+ this?.requestFocus()
95
+ }
96
+ }
@@ -32,7 +32,7 @@ class KeyboardControllerModuleImpl(private val mReactContext: ReactApplicationCo
32
32
 
33
33
  fun setFocusTo(direction: String) {
34
34
  if (direction == "current") {
35
- return FocusedInputHolder.requestFocus()
35
+ return FocusedInputHolder.focus()
36
36
  }
37
37
 
38
38
  val activity = mReactContext.currentActivity
@@ -1,16 +1,21 @@
1
1
  package com.reactnativekeyboardcontroller.traversal
2
2
 
3
- import com.facebook.react.views.textinput.ReactEditText
3
+ import android.widget.EditText
4
+ import com.reactnativekeyboardcontroller.extensions.focus
4
5
  import java.lang.ref.WeakReference
5
6
 
6
7
  object FocusedInputHolder {
7
- private var input: WeakReference<ReactEditText?>? = null
8
+ private var input: WeakReference<EditText?>? = null
8
9
 
9
- fun set(textInput: ReactEditText) {
10
+ fun set(textInput: EditText) {
10
11
  input = WeakReference(textInput)
11
12
  }
12
13
 
13
- fun requestFocus() {
14
- input?.get()?.requestFocusFromJS()
14
+ fun get(): EditText? {
15
+ return input?.get()
16
+ }
17
+
18
+ fun focus() {
19
+ input?.get()?.focus()
15
20
  }
16
21
  }
@@ -4,18 +4,14 @@ import android.view.View
4
4
  import android.view.ViewGroup
5
5
  import android.widget.EditText
6
6
  import com.facebook.react.bridge.UiThreadUtil
7
- import com.facebook.react.views.textinput.ReactEditText
7
+ import com.reactnativekeyboardcontroller.extensions.focus
8
8
 
9
9
  object ViewHierarchyNavigator {
10
10
  fun setFocusTo(direction: String, view: View) {
11
11
  val input = if (direction == "next") findNextEditText(view) else findPreviousEditText(view)
12
12
 
13
13
  UiThreadUtil.runOnUiThread {
14
- if (input is ReactEditText) {
15
- input.requestFocusFromJS()
16
- } else {
17
- input?.requestFocus()
18
- }
14
+ input.focus()
19
15
  }
20
16
  }
21
17
 
@@ -0,0 +1,45 @@
1
+ package com.reactnativekeyboardcontroller.traversal
2
+
3
+ import android.content.Context
4
+ import android.widget.EditText
5
+ import androidx.test.core.app.ApplicationProvider
6
+ import org.junit.Assert.assertEquals
7
+ import org.junit.Assert.assertFalse
8
+ import org.junit.Assert.assertNull
9
+ import org.junit.Assert.assertTrue
10
+ import org.junit.Test
11
+ import org.junit.runner.RunWith
12
+ import org.robolectric.RobolectricTestRunner
13
+
14
+ @RunWith(RobolectricTestRunner::class)
15
+ class FocusedInputHolderTest {
16
+ @Test
17
+ fun `FocusedInputHolder should hold a weak reference`() {
18
+ val context = ApplicationProvider.getApplicationContext<Context>()
19
+ var input: EditText? = EditText(context)
20
+
21
+ FocusedInputHolder.set(input as EditText)
22
+
23
+ assertEquals(FocusedInputHolder.get(), input)
24
+
25
+ input = null
26
+
27
+ @Suppress("detekt:ExplicitGarbageCollectionCall")
28
+ System.gc()
29
+
30
+ assertNull(FocusedInputHolder.get())
31
+ }
32
+
33
+ @Test
34
+ fun `focus() should request focus on expected field`() {
35
+ val context = ApplicationProvider.getApplicationContext<Context>()
36
+ val input = EditText(context)
37
+
38
+ assertFalse(input.hasFocus())
39
+
40
+ FocusedInputHolder.set(input)
41
+ FocusedInputHolder.focus()
42
+
43
+ assertTrue(input.hasFocus())
44
+ }
45
+ }
@@ -4,6 +4,7 @@ import android.content.Context
4
4
  import android.widget.EditText
5
5
  import android.widget.LinearLayout
6
6
  import androidx.test.core.app.ApplicationProvider
7
+ import com.reactnativekeyboardcontroller.extensions.focus
7
8
  import org.junit.Assert.assertTrue
8
9
  import org.junit.Before
9
10
  import org.junit.Test
@@ -78,7 +79,7 @@ class ViewHierarchyNavigatorTest {
78
79
 
79
80
  @Test
80
81
  fun `setFocusTo to 'next' should set focus to next field`() {
81
- editText1.requestFocus()
82
+ editText1.focus()
82
83
 
83
84
  ViewHierarchyNavigator.setFocusTo("next", editText1)
84
85
 
@@ -89,7 +90,7 @@ class ViewHierarchyNavigatorTest {
89
90
 
90
91
  @Test
91
92
  fun `setFocusTo to 'prev' should set focus to previous field`() {
92
- editText2.requestFocus()
93
+ editText2.focus()
93
94
 
94
95
  ViewHierarchyNavigator.setFocusTo("prev", editText2)
95
96
 
@@ -100,7 +101,7 @@ class ViewHierarchyNavigatorTest {
100
101
 
101
102
  @Test
102
103
  fun `setFocusTo to 'next' should skip non-editable fields`() {
103
- editText2.requestFocus()
104
+ editText2.focus()
104
105
 
105
106
  ViewHierarchyNavigator.setFocusTo("next", editText2)
106
107
 
@@ -111,7 +112,7 @@ class ViewHierarchyNavigatorTest {
111
112
 
112
113
  @Test
113
114
  fun `setFocusTo to 'prev' should skip non-editable fields`() {
114
- editText5.requestFocus()
115
+ editText5.focus()
115
116
 
116
117
  ViewHierarchyNavigator.setFocusTo("prev", editText5)
117
118
 
@@ -122,7 +123,7 @@ class ViewHierarchyNavigatorTest {
122
123
 
123
124
  @Test
124
125
  fun `setFocusTo to 'next' should set focus relatively to current group`() {
125
- editText5.requestFocus()
126
+ editText5.focus()
126
127
 
127
128
  ViewHierarchyNavigator.setFocusTo("next", editText5)
128
129
 
@@ -133,7 +134,7 @@ class ViewHierarchyNavigatorTest {
133
134
 
134
135
  @Test
135
136
  fun `setFocusTo to 'prev' should set focus relatively to current group`() {
136
- editText7.requestFocus()
137
+ editText7.focus()
137
138
 
138
139
  ViewHierarchyNavigator.setFocusTo("prev", editText7)
139
140
 
@@ -144,7 +145,7 @@ class ViewHierarchyNavigatorTest {
144
145
 
145
146
  @Test
146
147
  fun `setFocusTo to 'next' should correctly exit from current group`() {
147
- editText7.requestFocus()
148
+ editText7.focus()
148
149
 
149
150
  ViewHierarchyNavigator.setFocusTo("next", editText7)
150
151
 
@@ -155,7 +156,7 @@ class ViewHierarchyNavigatorTest {
155
156
 
156
157
  @Test
157
158
  fun `setFocusTo to 'prev' should set focus to last element in group`() {
158
- editText8.requestFocus()
159
+ editText8.focus()
159
160
 
160
161
  ViewHierarchyNavigator.setFocusTo("prev", editText8)
161
162
 
@@ -166,7 +167,7 @@ class ViewHierarchyNavigatorTest {
166
167
 
167
168
  @Test
168
169
  fun `setFocusTo to 'next' should do nothing if it's last element`() {
169
- editText13.requestFocus()
170
+ editText13.focus()
170
171
 
171
172
  ViewHierarchyNavigator.setFocusTo("next", editText13)
172
173
 
@@ -177,7 +178,7 @@ class ViewHierarchyNavigatorTest {
177
178
 
178
179
  @Test
179
180
  fun `setFocusTo to 'prev' should do nothing if it's first element`() {
180
- editText1.requestFocus()
181
+ editText1.focus()
181
182
 
182
183
  ViewHierarchyNavigator.setFocusTo("prev", editText1)
183
184
 
@@ -19,14 +19,14 @@ class FocusedInputHolder {
19
19
  currentFocusedInput = input
20
20
  }
21
21
 
22
- // Requests focus for the currentFocusedInput if it's set
23
- func requestFocus() {
24
- currentFocusedInput?.requestFocus()
25
- }
26
-
27
22
  func get() -> TextInput? {
28
23
  return currentFocusedInput
29
24
  }
30
25
 
26
+ // Requests focus for the currentFocusedInput if it's set
27
+ func focus() {
28
+ currentFocusedInput?.focus()
29
+ }
30
+
31
31
  private init() {}
32
32
  }
@@ -10,17 +10,17 @@ import Foundation
10
10
  import UIKit
11
11
 
12
12
  public protocol TextInput: AnyObject {
13
- func requestFocus()
13
+ func focus()
14
14
  }
15
15
 
16
16
  extension UITextField: TextInput {
17
- public func requestFocus() {
17
+ public func focus() {
18
18
  becomeFirstResponder()
19
19
  }
20
20
  }
21
21
 
22
22
  extension UITextView: TextInput {
23
- public func requestFocus() {
23
+ public func focus() {
24
24
  becomeFirstResponder()
25
25
  }
26
26
  }
@@ -14,7 +14,7 @@ public class ViewHierarchyNavigator: NSObject {
14
14
  @objc public static func setFocusTo(direction: String) {
15
15
  DispatchQueue.main.async {
16
16
  if direction == "current" {
17
- FocusedInputHolder.shared.requestFocus()
17
+ FocusedInputHolder.shared.focus()
18
18
  return
19
19
  }
20
20
 
@@ -22,7 +22,7 @@ public class ViewHierarchyNavigator: NSObject {
22
22
  guard let view = input else { return }
23
23
 
24
24
  let textField = findTextInputInDirection(currentFocus: view, direction: direction)
25
- textField?.requestFocus()
25
+ textField?.focus()
26
26
  }
27
27
  }
28
28
 
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useColorScheme","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ArrowComponent","_ref","type","disabled","theme","colorScheme","useColorScheme","color","useMemo","backgroundColor","primary","left","styles","arrowLeftLine","right","arrowRightLine","createElement","View","style","arrowDownContainer","arrowUpContainer","arrow","Animated","arrowLine","width","height","borderRadius","marginHorizontal","justifyContent","alignItems","StyleSheet","create","transform","rotate","flexDirection","_default","exports"],"sources":["Arrow.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./colors\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ArrowProps = {\n type: \"prev\" | \"next\";\n disabled?: boolean;\n theme: KeyboardToolbarTheme;\n};\n\nconst ArrowComponent: React.FC<ArrowProps> = ({ type, disabled, theme }) => {\n const colorScheme = useColorScheme();\n\n const color = useMemo(\n () => ({\n backgroundColor: disabled\n ? theme[colorScheme].disabled\n : theme[colorScheme].primary,\n }),\n [disabled, theme, colorScheme],\n );\n const left = useMemo(() => [styles.arrowLeftLine, color], [color]);\n const right = useMemo(() => [styles.arrowRightLine, color], [color]);\n\n return (\n <View\n style={\n type === \"next\" ? styles.arrowDownContainer : styles.arrowUpContainer\n }\n >\n <View style={styles.arrow}>\n <Animated.View style={left} />\n <Animated.View style={right} />\n </View>\n </View>\n );\n};\n\nconst arrowLine: ViewStyle = {\n width: 13,\n height: 2,\n borderRadius: 1,\n};\nconst arrowUpContainer: ViewStyle = {\n marginHorizontal: 5,\n width: 30,\n height: 30,\n justifyContent: \"center\",\n alignItems: \"center\",\n};\nconst styles = StyleSheet.create({\n arrowUpContainer: arrowUpContainer,\n arrowDownContainer: {\n ...arrowUpContainer,\n transform: [{ rotate: \"180deg\" }],\n },\n arrow: {\n width: 20,\n height: 20,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n arrowLeftLine: {\n ...arrowLine,\n transform: [{ rotate: \"-45deg\" }],\n left: -0.5,\n },\n arrowRightLine: {\n ...arrowLine,\n transform: [{ rotate: \"45deg\" }],\n left: -5.5,\n },\n});\n\nexport default ArrowComponent;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GA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C,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,CAAC;EACTC,YAAY,EAAE;AAChB,CAAC;AACD,MAAMN,gBAA2B,GAAG;EAClCO,gBAAgB,EAAE,CAAC;EACnBH,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVG,cAAc,EAAE,QAAQ;EACxBC,UAAU,EAAE;AACd,CAAC;AACD,MAAMjB,MAAM,GAAGkB,uBAAU,CAACC,MAAM,CAAC;EAC/BX,gBAAgB,EAAEA,gBAAgB;EAClCD,kBAAkB,EAAE;IAClB,GAAGC,gBAAgB;IACnBY,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC,CAAC;EACDZ,KAAK,EAAE;IACLG,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVS,aAAa,EAAE,KAAK;IACpBL,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EAClB,CAAC;EACDf,aAAa,EAAE;IACb,GAAGU,SAAS;IACZS,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC,CAAC;IACjCtB,IAAI,EAAE,CAAC;EACT,CAAC;EACDI,cAAc,EAAE;IACd,GAAGQ,SAAS;IACZS,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAQ,CAAC,CAAC;IAChCtB,IAAI,EAAE,CAAC;EACT;AACF,CAAC,CAAC;AAAC,IAAAwB,QAAA,GAEYnC,cAAc;AAAAoC,OAAA,CAAAxD,OAAA,GAAAuD,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useColorScheme","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ArrowComponent","_ref","type","disabled","theme","colorScheme","useColorScheme","color","useMemo","backgroundColor","primary","left","styles","arrowLeftLine","right","arrowRightLine","createElement","View","style","arrowDownContainer","arrowUpContainer","arrow","Animated","arrowLine","width","height","borderRadius","marginHorizontal","justifyContent","alignItems","StyleSheet","create","transform","rotate","flexDirection","_default","exports"],"sources":["Arrow.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ArrowProps = {\n type: \"prev\" | \"next\";\n disabled?: boolean;\n theme: KeyboardToolbarTheme;\n};\n\nconst ArrowComponent: React.FC<ArrowProps> = ({ type, disabled, theme }) => {\n const colorScheme = useColorScheme();\n\n const color = useMemo(\n () => ({\n backgroundColor: disabled\n ? theme[colorScheme].disabled\n : theme[colorScheme].primary,\n }),\n [disabled, theme, colorScheme],\n );\n const left = useMemo(() => [styles.arrowLeftLine, color], [color]);\n const right = useMemo(() => [styles.arrowRightLine, color], [color]);\n\n return (\n <View\n style={\n type === \"next\" ? styles.arrowDownContainer : styles.arrowUpContainer\n }\n >\n <View style={styles.arrow}>\n <Animated.View style={left} />\n <Animated.View style={right} />\n </View>\n </View>\n );\n};\n\nconst arrowLine: ViewStyle = {\n width: 13,\n height: 2,\n borderRadius: 1,\n};\nconst arrowUpContainer: ViewStyle = {\n marginHorizontal: 5,\n width: 30,\n height: 30,\n justifyContent: \"center\",\n alignItems: \"center\",\n};\nconst styles = StyleSheet.create({\n arrowUpContainer: arrowUpContainer,\n arrowDownContainer: {\n ...arrowUpContainer,\n transform: [{ rotate: \"180deg\" }],\n },\n arrow: {\n width: 20,\n height: 20,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n arrowLeftLine: {\n ...arrowLine,\n transform: [{ rotate: \"-45deg\" }],\n left: -0.5,\n },\n arrowRightLine: {\n ...arrowLine,\n transform: [{ rotate: \"45deg\" }],\n left: -5.5,\n },\n});\n\nexport default Arrow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,CAAA+C,QAAQ,CAACL,IAAI;IAACC,KAAK,EAAEJ;EAAM,CAAE,CAC1B,CACF,CAAC;AAEX,CAAC;AAED,MAAMS,SAAoB,GAAG;EAC3BC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,CAAC;EACTC,YAAY,EAAE;AAChB,CAAC;AACD,MAAMN,gBAA2B,GAAG;EAClCO,gBAAgB,EAAE,CAAC;EACnBH,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVG,cAAc,EAAE,QAAQ;EACxBC,UAAU,EAAE;AACd,CAAC;AACD,MAAMjB,MAAM,GAAGkB,uBAAU,CAACC,MAAM,CAAC;EAC/BX,gBAAgB,EAAEA,gBAAgB;EAClCD,kBAAkB,EAAE;IAClB,GAAGC,gBAAgB;IACnBY,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC;EAClC,CAAC;EACDZ,KAAK,EAAE;IACLG,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVS,aAAa,EAAE,KAAK;IACpBL,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EAClB,CAAC;EACDf,aAAa,EAAE;IACb,GAAGU,SAAS;IACZS,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC,CAAC;IACjCtB,IAAI,EAAE,CAAC;EACT,CAAC;EACDI,cAAc,EAAE;IACd,GAAGQ,SAAS;IACZS,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAQ,CAAC,CAAC;IAChCtB,IAAI,EAAE,CAAC;EACT;AACF,CAAC,CAAC;AAAC,IAAAwB,QAAA,GAEYnC,cAAc;AAAAoC,OAAA,CAAAxD,OAAA,GAAAuD,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useColorScheme","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ButtonIOS","_ref","children","onPress","disabled","accessibilityLabel","accessibilityHint","testID","style","Container","View","TouchableOpacity","accessibilityState","useMemo","createElement","accessibilityRole","ButtonAndroid","_ref2","rippleRadius","theme","colorScheme","useColorScheme","ripple","TouchableNativeFeedback","Ripple","background","_default","Platform","select","android","exports"],"sources":["Button.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport {\n Platform,\n TouchableNativeFeedback,\n TouchableOpacity,\n View,\n} from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./colors\";\nimport type { PropsWithChildren } from \"react\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ButtonProps = {\n disabled?: boolean;\n onPress: () => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n rippleRadius?: number;\n style?: ViewStyle;\n theme: KeyboardToolbarTheme;\n};\n\nconst ButtonIOS = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n style,\n}: PropsWithChildren<ButtonProps>) => {\n // immediately switch to plain view to avoid animation flickering\n // when fade out animation happens and view becomes disabled\n const Container = disabled\n ? (View as unknown as typeof TouchableOpacity)\n : TouchableOpacity;\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n\n return (\n <Container\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n style={style}\n testID={testID}\n >\n {children}\n </Container>\n );\n};\nconst ButtonAndroid = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n rippleRadius = 18,\n style,\n theme,\n}: PropsWithChildren<ButtonProps>) => {\n const colorScheme = useColorScheme();\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n const ripple = useMemo(\n () =>\n TouchableNativeFeedback.Ripple(\n theme[colorScheme].ripple,\n true,\n rippleRadius,\n ),\n [colorScheme, rippleRadius, theme],\n );\n\n return (\n <TouchableNativeFeedback\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n background={ripple}\n testID={testID}\n style={style}\n >\n <View style={style}>{children}</View>\n </TouchableNativeFeedback>\n );\n};\n\nexport default Platform.select({\n android: ButtonAndroid,\n default: ButtonIOS,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAqD,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAK,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAn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K;IACLW;EAC8B,CAAC,GAAAF,KAAA;EAC/B,MAAMG,WAAW,GAAG,IAAAC,uBAAc,EAAC,CAAC;EACpC,MAAMT,kBAAkB,GAAG,IAAAC,cAAO,EAAC,OAAO;IAAET;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACpE,MAAMkB,MAAM,GAAG,IAAAT,cAAO,EACpB,MACEU,oCAAuB,CAACC,MAAM,CAC5BL,KAAK,CAACC,WAAW,CAAC,CAACE,MAAM,EACzB,IAAI,EACJJ,YACF,CAAC,EACH,CAACE,WAAW,EAAEF,YAAY,EAAEC,KAAK,CACnC,CAAC;EAED,oBACE/C,MAAA,CAAAQ,OAAA,CAAAkC,aAAA,CAACvC,YAAA,CAAAgD,uBAAuB;IACtBX,kBAAkB,EAAEA,kBAAmB;IACvCG,iBAAiB,EAAC,QAAQ;IAC1BV,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBsB,UAAU,EAAEH,MAAO;IACnBf,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA;EAAM,gBAEbpC,MAAA,CAAAQ,OAAA,CAAAkC,aAAA,CAACvC,YAAA,CAAAmC,IAAI;IAACF,KAAK,EAAEA;EAAM,GAAEN,QAAe,CACb,CAAC;AAE9B,CAAC;AAAC,IAAAwB,QAAA,GAEaC,qBAAQ,CAACC,MAAM,CAAC;EAC7BC,OAAO,EAAEb,aAAa;EACtBpC,OAAO,EAAEoB;AACX,CAAC,CAAC;AAAA8B,OAAA,CAAAlD,OAAA,GAAA8C,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useColorScheme","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ButtonIOS","_ref","children","onPress","disabled","accessibilityLabel","accessibilityHint","testID","style","Container","View","TouchableOpacity","accessibilityState","useMemo","createElement","accessibilityRole","ButtonAndroid","_ref2","rippleRadius","theme","colorScheme","useColorScheme","ripple","TouchableNativeFeedback","Ripple","background","_default","Platform","select","android","exports"],"sources":["Button.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport {\n Platform,\n TouchableNativeFeedback,\n TouchableOpacity,\n View,\n} from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { PropsWithChildren } from \"react\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ButtonProps = {\n disabled?: boolean;\n onPress: () => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n rippleRadius?: number;\n style?: ViewStyle;\n theme: KeyboardToolbarTheme;\n};\n\nconst ButtonIOS = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n style,\n}: PropsWithChildren<ButtonProps>) => {\n // immediately switch to plain view to avoid animation flickering\n // when fade out animation happens and view becomes disabled\n const Container = disabled\n ? (View as unknown as typeof TouchableOpacity)\n : TouchableOpacity;\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n\n return (\n <Container\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n style={style}\n testID={testID}\n >\n {children}\n </Container>\n );\n};\nconst ButtonAndroid = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n rippleRadius = 18,\n style,\n theme,\n}: PropsWithChildren<ButtonProps>) => {\n const colorScheme = useColorScheme();\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n const ripple = useMemo(\n () =>\n TouchableNativeFeedback.Ripple(\n theme[colorScheme].ripple,\n true,\n rippleRadius,\n ),\n [colorScheme, rippleRadius, theme],\n );\n\n return (\n <TouchableNativeFeedback\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n background={ripple}\n testID={testID}\n style={style}\n >\n <View style={style}>{children}</View>\n </TouchableNativeFeedback>\n );\n};\n\nexport default Platform.select({\n android: ButtonAndroid,\n default: ButtonIOS,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAqD,SAAAG,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAK,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAnB,GAAA,EAAAgB,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,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AAc,EAAC,CAAC;EACpC,MAAMT,kBAAkB,GAAG,IAAAC,cAAO,EAAC,OAAO;IAAET;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACpE,MAAMkB,MAAM,GAAG,IAAAT,cAAO,EACpB,MACEU,oCAAuB,CAACC,MAAM,CAC5BL,KAAK,CAACC,WAAW,CAAC,CAACE,MAAM,EACzB,IAAI,EACJJ,YACF,CAAC,EACH,CAACE,WAAW,EAAEF,YAAY,EAAEC,KAAK,CACnC,CAAC;EAED,oBACE/C,MAAA,CAAAQ,OAAA,CAAAkC,aAAA,CAACvC,YAAA,CAAAgD,uBAAuB;IACtBX,kBAAkB,EAAEA,kBAAmB;IACvCG,iBAAiB,EAAC,QAAQ;IAC1BV,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBsB,UAAU,EAAEH,MAAO;IACnBf,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA;EAAM,gBAEbpC,MAAA,CAAAQ,OAAA,CAAAkC,aAAA,CAACvC,YAAA,CAAAmC,IAAI;IAACF,KAAK,EAAEA;EAAM,GAAEN,QAAe,CACb,CAAC;AAE9B,CAAC;AAAC,IAAAwB,QAAA,GAEaC,qBAAQ,CAACC,MAAM,CAAC;EAC7BC,OAAO,EAAEb,aAAa;EACtBpC,OAAO,EAAEoB;AACX,CAAC,CAAC;AAAA8B,OAAA,CAAAlD,OAAA,GAAA8C,QAAA"}
@@ -4,36 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.colors = void 0;
7
- var _reactNative = require("react-native");
8
7
  const colors = {
9
8
  light: {
10
- primary: _reactNative.Platform.select({
11
- ios: (0, _reactNative.PlatformColor)("link"),
12
- default: "#2c2c2c"
13
- }),
14
- disabled: _reactNative.Platform.select({
15
- ios: (0, _reactNative.PlatformColor)("systemGray4"),
16
- default: "#B0BEC5"
17
- }),
18
- background: _reactNative.Platform.select({
19
- ios: "#F8F8F8",
20
- default: "#f3f3f4"
21
- }),
9
+ primary: "#2c2c2c",
10
+ disabled: "#B0BEC5",
11
+ background: "#f3f3f4",
22
12
  ripple: "#bcbcbcbc"
23
13
  },
24
14
  dark: {
25
- primary: _reactNative.Platform.select({
26
- ios: (0, _reactNative.PlatformColor)("label"),
27
- default: "#fafafa"
28
- }),
29
- disabled: _reactNative.Platform.select({
30
- ios: (0, _reactNative.PlatformColor)("systemGray"),
31
- default: "#707070"
32
- }),
33
- background: _reactNative.Platform.select({
34
- ios: "#555756",
35
- default: "#2C2C2E"
36
- }),
15
+ primary: "#fafafa",
16
+ disabled: "#707070",
17
+ background: "#2C2C2E",
37
18
  ripple: "#F8F8F888"
38
19
  }
39
20
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","colors","light","primary","Platform","select","ios","PlatformColor","default","disabled","background","ripple","dark","exports"],"sources":["colors.ts"],"sourcesContent":["import { Platform, PlatformColor } from \"react-native\";\n\nimport type { ColorValue } from \"react-native\";\n\ntype Theme = {\n /** Color for arrow when it's enabled */\n primary: ColorValue;\n /** Color for arrow when it's disabled */\n disabled: ColorValue;\n /** Keyboard toolbar background color */\n background: ColorValue;\n /** Color for ripple effect (on button touch) on Android */\n ripple: ColorValue;\n};\nexport type KeyboardToolbarTheme = {\n light: Theme;\n dark: Theme;\n};\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"link\"),\n default: \"#2c2c2c\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray4\"),\n default: \"#B0BEC5\",\n }),\n background: Platform.select({\n ios: \"#F8F8F8\",\n default: \"#f3f3f4\",\n }),\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"label\"),\n default: \"#fafafa\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray\"),\n default: \"#707070\",\n }),\n background: Platform.select({\n ios: \"#555756\",\n default: \"#2C2C2E\",\n }),\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAmBO,MAAMC,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAEC,qBAAQ,CAACC,MAAM,CAAa;MACnCC,GAAG,EAAE,IAAAC,0BAAa,EAAC,MAAM,CAAC;MAC1BC,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAEL,qBAAQ,CAACC,MAAM,CAAa;MACpCC,GAAG,EAAE,IAAAC,0BAAa,EAAC,aAAa,CAAC;MACjCC,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAEN,qBAAQ,CAACC,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdE,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJT,OAAO,EAAEC,qBAAQ,CAACC,MAAM,CAAa;MACnCC,GAAG,EAAE,IAAAC,0BAAa,EAAC,OAAO,CAAC;MAC3BC,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAEL,qBAAQ,CAACC,MAAM,CAAa;MACpCC,GAAG,EAAE,IAAAC,0BAAa,EAAC,YAAY,CAAC;MAChCC,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAEN,qBAAQ,CAACC,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdE,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV;AACF,CAAC;AAACE,OAAA,CAAAZ,MAAA,GAAAA,MAAA"}
1
+ {"version":3,"names":["colors","light","primary","disabled","background","ripple","dark","exports"],"sources":["colors.ts"],"sourcesContent":["import type { KeyboardToolbarTheme } from \"./types\";\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: \"#2c2c2c\",\n disabled: \"#B0BEC5\",\n background: \"#f3f3f4\",\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: \"#fafafa\",\n disabled: \"#707070\",\n background: \"#2C2C2E\",\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":";;;;;;AAEO,MAAMA,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAE,SAAS;IAClBC,QAAQ,EAAE,SAAS;IACnBC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJJ,OAAO,EAAE,SAAS;IAClBC,QAAQ,EAAE,SAAS;IACnBC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE;EACV;AACF,CAAC;AAACE,OAAA,CAAAP,MAAA,GAAAA,MAAA"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.colors = void 0;
7
+ var _reactNative = require("react-native");
8
+ const colors = {
9
+ light: {
10
+ primary: _reactNative.Platform.select({
11
+ ios: (0, _reactNative.PlatformColor)("link"),
12
+ default: "#2c2c2c"
13
+ }),
14
+ disabled: _reactNative.Platform.select({
15
+ ios: (0, _reactNative.PlatformColor)("systemGray4"),
16
+ default: "#B0BEC5"
17
+ }),
18
+ background: _reactNative.Platform.select({
19
+ ios: "#F8F8F8",
20
+ default: "#f3f3f4"
21
+ }),
22
+ ripple: "#bcbcbcbc"
23
+ },
24
+ dark: {
25
+ primary: _reactNative.Platform.select({
26
+ ios: (0, _reactNative.PlatformColor)("label"),
27
+ default: "#fafafa"
28
+ }),
29
+ disabled: _reactNative.Platform.select({
30
+ ios: (0, _reactNative.PlatformColor)("systemGray"),
31
+ default: "#707070"
32
+ }),
33
+ background: _reactNative.Platform.select({
34
+ ios: "#555756",
35
+ default: "#2C2C2E"
36
+ }),
37
+ ripple: "#F8F8F888"
38
+ }
39
+ };
40
+ exports.colors = colors;
41
+ //# sourceMappingURL=colors.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","colors","light","primary","Platform","select","ios","PlatformColor","default","disabled","background","ripple","dark","exports"],"sources":["colors.native.ts"],"sourcesContent":["import { Platform, PlatformColor } from \"react-native\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ColorValue } from \"react-native\";\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"link\"),\n default: \"#2c2c2c\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray4\"),\n default: \"#B0BEC5\",\n }),\n background: Platform.select({\n ios: \"#F8F8F8\",\n default: \"#f3f3f4\",\n }),\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"label\"),\n default: \"#fafafa\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray\"),\n default: \"#707070\",\n }),\n background: Platform.select({\n ios: \"#555756\",\n default: \"#2C2C2E\",\n }),\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKO,MAAMC,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAEC,qBAAQ,CAACC,MAAM,CAAa;MACnCC,GAAG,EAAE,IAAAC,0BAAa,EAAC,MAAM,CAAC;MAC1BC,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAEL,qBAAQ,CAACC,MAAM,CAAa;MACpCC,GAAG,EAAE,IAAAC,0BAAa,EAAC,aAAa,CAAC;MACjCC,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAEN,qBAAQ,CAACC,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdE,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJT,OAAO,EAAEC,qBAAQ,CAACC,MAAM,CAAa;MACnCC,GAAG,EAAE,IAAAC,0BAAa,EAAC,OAAO,CAAC;MAC3BC,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAEL,qBAAQ,CAACC,MAAM,CAAa;MACpCC,GAAG,EAAE,IAAAC,0BAAa,EAAC,YAAY,CAAC;MAChCC,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAEN,qBAAQ,CAACC,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdE,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV;AACF,CAAC;AAACE,OAAA,CAAAZ,MAAA,GAAAA,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeKeyboardController","_bindings","_useColorScheme","_interopRequireDefault","_Arrow","_Button","_colors","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TEST_ID_KEYBOARD_TOOLBAR","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","offset","closed","dismissKeyboard","KeyboardController","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","_ref","content","theme","colors","doneText","button","icon","colorScheme","useColorScheme","inputs","setInputs","useState","current","count","isPrevDisabled","isNextDisabled","useEffect","subscription","FocusedInputEvents","addListener","e","remove","doneStyle","useMemo","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","Button","IconContainer","Arrow","createElement","KeyboardStickyView","View","style","testID","accessibilityLabel","accessibilityHint","disabled","onPress","type","flex","rippleRadius","doneButtonContainer","Text","maxFontSizeMultiplier","StyleSheet","create","position","bottom","alignItems","width","flexDirection","height","paddingHorizontal","fontWeight","fontSize","marginRight","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n KeyboardStickyView,\n} from \"react-native-keyboard-controller\";\n\nimport { KeyboardController } from \"../../bindings\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\n\nimport type { KeyboardToolbarTheme } from \"./colors\";\nimport type { ReactNode } from \"react\";\n\nexport type KeyboardToolbarProps = {\n /** An element that is shown in the middle of the toolbar. */\n content?: JSX.Element | null;\n /** A set of dark/light colors consumed by toolbar component. */\n theme?: KeyboardToolbarTheme;\n /** Custom text for done button. */\n doneText?: ReactNode;\n /** Custom touchable component for toolbar (used for prev/next/done buttons). */\n button?: typeof Button;\n /** Custom icon component used to display next/prev buttons. */\n icon?: typeof Arrow;\n};\nconst TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nconst TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nconst TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nconst TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nconst TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nconst KEYBOARD_TOOLBAR_HEIGHT = 42;\nconst offset = { closed: KEYBOARD_TOOLBAR_HEIGHT };\n\nconst dismissKeyboard = () => KeyboardController.dismiss();\nconst goToNextField = () => KeyboardController.setFocusTo(\"next\");\nconst goToPrevField = () => KeyboardController.setFocusTo(\"prev\");\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and\n * `Done` buttons.\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({\n content,\n theme = colors,\n doneText,\n button,\n icon,\n}) => {\n const colorScheme = useColorScheme();\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const doneStyle = useMemo(\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\n [colorScheme, theme],\n );\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: theme[colorScheme].background,\n },\n ],\n [colorScheme, theme],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n return (\n <KeyboardStickyView offset={offset}>\n <View style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n <ButtonContainer\n accessibilityLabel=\"Previous\"\n accessibilityHint=\"Will move focus to previous field\"\n disabled={isPrevDisabled}\n onPress={goToPrevField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n >\n <IconContainer disabled={isPrevDisabled} type=\"prev\" theme={theme} />\n </ButtonContainer>\n <ButtonContainer\n accessibilityLabel=\"Next\"\n accessibilityHint=\"Will move focus to next field\"\n disabled={isNextDisabled}\n onPress={goToNextField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n >\n <IconContainer disabled={isNextDisabled} type=\"next\" theme={theme} />\n </ButtonContainer>\n\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {content}\n </View>\n <ButtonContainer\n accessibilityLabel=\"Done\"\n accessibilityHint=\"Will close the keyboard\"\n onPress={dismissKeyboard}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n rippleRadius={28}\n style={styles.doneButtonContainer}\n theme={theme}\n >\n <Text style={doneStyle} maxFontSizeMultiplier={1.3}>\n {doneText || \"Done\"}\n </Text>\n </ButtonContainer>\n </View>\n </KeyboardStickyView>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n paddingHorizontal: 8,\n },\n doneButton: {\n fontWeight: \"600\",\n fontSize: 15,\n },\n doneButtonContainer: {\n marginRight: 8,\n },\n});\n\nexport { colors as DefaultKeyboardToolbarTheme };\nexport default KeyboardToolbar;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,8BAAA,GAAAF,OAAA;AAKA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,OAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAkC,SAAAK,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAd,wBAAAU,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GA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MAAM;IACzBC,iBAAiB,EAAC,yBAAyB;IAC3CE,OAAO,EAAEnD,eAAgB;IACzB+C,MAAM,EAAEnD,6BAA8B;IACtC0D,YAAY,EAAE,EAAG;IACjBR,KAAK,EAAEf,MAAM,CAACwB,mBAAoB;IAClC9C,KAAK,EAAEA;EAAM,gBAEblD,MAAA,CAAAa,OAAA,CAAAuE,aAAA,CAACjF,YAAA,CAAA8F,IAAI;IAACV,KAAK,EAAEjB,SAAU;IAAC4B,qBAAqB,EAAE;EAAI,GAChD9C,QAAQ,IAAI,MACT,CACS,CACb,CACY,CAAC;AAEzB,CAAC;AAED,MAAMoB,MAAM,GAAG2B,uBAAU,CAACC,MAAM,CAAC;EAC/BN,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDjB,OAAO,EAAE;IACPwB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAEpE,uBAAuB;IAC/BqE,iBAAiB,EAAE;EACrB,CAAC;EACDlC,UAAU,EAAE;IACVmC,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDb,mBAAmB,EAAE;IACnBc,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAGYhE,eAAe;AAAAiE,OAAA,CAAAnG,OAAA,GAAAkG,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeKeyboardController","_bindings","_useColorScheme","_interopRequireDefault","_Arrow","_Button","_colors","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TEST_ID_KEYBOARD_TOOLBAR","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","offset","closed","dismissKeyboard","KeyboardController","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","_ref","content","theme","colors","doneText","button","icon","colorScheme","useColorScheme","inputs","setInputs","useState","current","count","isPrevDisabled","isNextDisabled","useEffect","subscription","FocusedInputEvents","addListener","e","remove","doneStyle","useMemo","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","Button","IconContainer","Arrow","createElement","KeyboardStickyView","View","style","testID","accessibilityLabel","accessibilityHint","disabled","onPress","type","flex","rippleRadius","doneButtonContainer","Text","maxFontSizeMultiplier","StyleSheet","create","position","bottom","alignItems","width","flexDirection","height","paddingHorizontal","fontWeight","fontSize","marginRight","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n KeyboardStickyView,\n} from \"react-native-keyboard-controller\";\n\nimport { KeyboardController } from \"../../bindings\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ReactNode } from \"react\";\n\nexport type KeyboardToolbarProps = {\n /** An element that is shown in the middle of the toolbar. */\n content?: JSX.Element | null;\n /** A set of dark/light colors consumed by toolbar component. */\n theme?: KeyboardToolbarTheme;\n /** Custom text for done button. */\n doneText?: ReactNode;\n /** Custom touchable component for toolbar (used for prev/next/done buttons). */\n button?: typeof Button;\n /** Custom icon component used to display next/prev buttons. */\n icon?: typeof Arrow;\n};\nconst TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nconst TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nconst TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nconst TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nconst TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nconst KEYBOARD_TOOLBAR_HEIGHT = 42;\nconst offset = { closed: KEYBOARD_TOOLBAR_HEIGHT };\n\nconst dismissKeyboard = () => KeyboardController.dismiss();\nconst goToNextField = () => KeyboardController.setFocusTo(\"next\");\nconst goToPrevField = () => KeyboardController.setFocusTo(\"prev\");\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and\n * `Done` buttons.\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({\n content,\n theme = colors,\n doneText,\n button,\n icon,\n}) => {\n const colorScheme = useColorScheme();\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const doneStyle = useMemo(\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\n [colorScheme, theme],\n );\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: theme[colorScheme].background,\n },\n ],\n [colorScheme, theme],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n return (\n <KeyboardStickyView offset={offset}>\n <View style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n <ButtonContainer\n accessibilityLabel=\"Previous\"\n accessibilityHint=\"Will move focus to previous field\"\n disabled={isPrevDisabled}\n onPress={goToPrevField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n >\n <IconContainer disabled={isPrevDisabled} type=\"prev\" theme={theme} />\n </ButtonContainer>\n <ButtonContainer\n accessibilityLabel=\"Next\"\n accessibilityHint=\"Will move focus to next field\"\n disabled={isNextDisabled}\n onPress={goToNextField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n >\n <IconContainer disabled={isNextDisabled} type=\"next\" theme={theme} />\n </ButtonContainer>\n\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {content}\n </View>\n <ButtonContainer\n accessibilityLabel=\"Done\"\n accessibilityHint=\"Will close the keyboard\"\n onPress={dismissKeyboard}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n rippleRadius={28}\n style={styles.doneButtonContainer}\n theme={theme}\n >\n <Text style={doneStyle} maxFontSizeMultiplier={1.3}>\n {doneText || \"Done\"}\n </Text>\n </ButtonContainer>\n </View>\n </KeyboardStickyView>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n paddingHorizontal: 8,\n },\n doneButton: {\n fontWeight: \"600\",\n fontSize: 15,\n },\n doneButtonContainer: {\n marginRight: 8,\n },\n});\n\nexport { colors as DefaultKeyboardToolbarTheme };\nexport default KeyboardToolbar;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,8BAAA,GAAAF,OAAA;AAKA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,OAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAkC,SAAA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AAE;EACZ,CAAC;EACDb,mBAAmB,EAAE;IACnBc,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAGYhE,eAAe;AAAAiE,OAAA,CAAAnG,OAAA,GAAAkG,QAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ColorValue } from \"react-native\";\n\ntype Theme = {\n /** Color for arrow when it's enabled */\n primary: ColorValue;\n /** Color for arrow when it's disabled */\n disabled: ColorValue;\n /** Keyboard toolbar background color */\n background: ColorValue;\n /** Color for ripple effect (on button touch) on Android */\n ripple: ColorValue;\n};\nexport type KeyboardToolbarTheme = {\n light: Theme;\n dark: Theme;\n};\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","Animated","StyleSheet","View","useColorScheme","ArrowComponent","_ref","type","disabled","theme","colorScheme","color","backgroundColor","primary","left","styles","arrowLeftLine","right","arrowRightLine","createElement","style","arrowDownContainer","arrowUpContainer","arrow","arrowLine","width","height","borderRadius","marginHorizontal","justifyContent","alignItems","create","transform","rotate","flexDirection"],"sources":["Arrow.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./colors\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ArrowProps = {\n type: \"prev\" | \"next\";\n disabled?: boolean;\n theme: KeyboardToolbarTheme;\n};\n\nconst ArrowComponent: React.FC<ArrowProps> = ({ type, disabled, theme }) => {\n const colorScheme = useColorScheme();\n\n const color = useMemo(\n () => ({\n backgroundColor: disabled\n ? theme[colorScheme].disabled\n : theme[colorScheme].primary,\n }),\n [disabled, theme, colorScheme],\n );\n const left = useMemo(() => [styles.arrowLeftLine, color], [color]);\n const right = useMemo(() => [styles.arrowRightLine, color], [color]);\n\n return (\n <View\n style={\n type === \"next\" ? styles.arrowDownContainer : styles.arrowUpContainer\n }\n >\n <View style={styles.arrow}>\n <Animated.View style={left} />\n <Animated.View style={right} />\n </View>\n </View>\n );\n};\n\nconst arrowLine: ViewStyle = {\n width: 13,\n height: 2,\n borderRadius: 1,\n};\nconst arrowUpContainer: ViewStyle = {\n marginHorizontal: 5,\n width: 30,\n height: 30,\n justifyContent: \"center\",\n alignItems: \"center\",\n};\nconst styles = StyleSheet.create({\n arrowUpContainer: arrowUpContainer,\n arrowDownContainer: {\n ...arrowUpContainer,\n transform: [{ rotate: \"180deg\" }],\n },\n arrow: {\n width: 20,\n height: 20,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n arrowLeftLine: {\n ...arrowLine,\n transform: [{ rotate: \"-45deg\" }],\n left: -0.5,\n },\n arrowRightLine: {\n ...arrowLine,\n transform: [{ rotate: \"45deg\" }],\n left: -5.5,\n },\n});\n\nexport default ArrowComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,OAAOC,cAAc,MAAM,yBAAyB;AAWpD,MAAMC,cAAoC,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC,IAAI;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAAH,IAAA;EACrE,MAAMI,WAAW,GAAGN,cAAc,CAAC,CAAC;EAEpC,MAAMO,KAAK,GAAGX,OAAO,CACnB,OAAO;IACLY,eAAe,EAAEJ,QAAQ,GACrBC,KAAK,CAACC,WAAW,CAAC,CAACF,QAAQ,GAC3BC,KAAK,CAACC,WAAW,CAAC,CAACG;EACzB,CAAC,CAAC,EACF,CAACL,QAAQ,EAAEC,KAAK,EAAEC,WAAW,CAC/B,CAAC;EACD,MAAMI,IAAI,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;IACpBD,cAAc,EAAE;EAClB,CAAC;EACDb,aAAa,EAAE;IACb,GAAGQ,SAAS;IACZQ,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAS,CAAC,CAAC;IACjCnB,IAAI,EAAE,CAAC;EACT,CAAC;EACDI,cAAc,EAAE;IACd,GAAGM,SAAS;IACZQ,SAAS,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAQ,CAAC,CAAC;IAChCnB,IAAI,EAAE,CAAC;EACT;AACF,CAAC,CAAC;AAEF,eAAeT,cAAc"}
1
+ {"version":3,"names":["React","useMemo","Animated","StyleSheet","View","useColorScheme","ArrowComponent","_ref","type","disabled","theme","colorScheme","color","backgroundColor","primary","left","styles","arrowLeftLine","right","arrowRightLine","createElement","style","arrowDownContainer","arrowUpContainer","arrow","arrowLine","width","height","borderRadius","marginHorizontal","justifyContent","alignItems","create","transform","rotate","flexDirection"],"sources":["Arrow.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Animated, StyleSheet, View } from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ArrowProps = {\n type: \"prev\" | \"next\";\n disabled?: boolean;\n theme: KeyboardToolbarTheme;\n};\n\nconst ArrowComponent: React.FC<ArrowProps> = ({ type, disabled, theme }) => {\n const colorScheme = useColorScheme();\n\n const color = useMemo(\n () => ({\n backgroundColor: disabled\n ? theme[colorScheme].disabled\n : theme[colorScheme].primary,\n }),\n [disabled, theme, colorScheme],\n );\n const left = useMemo(() => [styles.arrowLeftLine, color], [color]);\n const right = useMemo(() => [styles.arrowRightLine, color], [color]);\n\n return (\n <View\n style={\n type === \"next\" ? styles.arrowDownContainer : styles.arrowUpContainer\n }\n >\n <View style={styles.arrow}>\n <Animated.View style={left} />\n <Animated.View style={right} />\n </View>\n </View>\n );\n};\n\nconst arrowLine: ViewStyle = {\n width: 13,\n height: 2,\n borderRadius: 1,\n};\nconst arrowUpContainer: ViewStyle = {\n marginHorizontal: 5,\n width: 30,\n height: 30,\n justifyContent: \"center\",\n alignItems: \"center\",\n};\nconst styles = StyleSheet.create({\n arrowUpContainer: arrowUpContainer,\n arrowDownContainer: {\n ...arrowUpContainer,\n transform: [{ rotate: \"180deg\" }],\n },\n arrow: {\n width: 20,\n height: 20,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n arrowLeftLine: {\n ...arrowLine,\n transform: [{ rotate: \"-45deg\" }],\n left: -0.5,\n },\n arrowRightLine: {\n ...arrowLine,\n transform: [{ rotate: \"45deg\" }],\n left: -5.5,\n },\n});\n\nexport default ArrowComponent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,OAAOC,cAAc,MAAM,yBAAyB;AAWpD,MAAMC,cAAoC,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC,IAAI;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAAH,IAAA;EACrE,MAAMI,WAAW,GAAGN,cAAc,CAAC,CAAC;EAEpC,MAAMO,KAAK,GAAGX,OAAO,CACnB,OAAO;IACLY,eAAe,EAAEJ,QAAQ,GACrBC,KAAK,CAACC,WAAW,CAAC,CAACF,QAAQ,GAC3BC,KAAK,CAACC,WAAW,CAAC,CAACG;EACzB,CAAC,CAAC,EACF,CAACL,QAAQ,EAAEC,KAAK,EAAEC,WAAW,CAC/B,CAAC;EACD,MAAMI,IAAI,GAAGd,OAAO,CAAC,MAAM,CAACe,MAAM,CAACC,aAAa,EAAEL,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAClE,MAAMM,KAAK,GAAGjB,OAAO,CAAC,MAAM,CAACe,MAAM,CAACG,cAAc,EAAEP,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEpE,oBACEZ,KAA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C,MAAM,EAAE;IAAQ,CAAC,CAAC;IAChCnB,IAAI,EAAE,CAAC;EACT;AACF,CAAC,CAAC;AAEF,eAAeT,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","Platform","TouchableNativeFeedback","TouchableOpacity","View","useColorScheme","ButtonIOS","_ref","children","onPress","disabled","accessibilityLabel","accessibilityHint","testID","style","Container","accessibilityState","createElement","accessibilityRole","ButtonAndroid","_ref2","rippleRadius","theme","colorScheme","ripple","Ripple","background","select","android","default"],"sources":["Button.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport {\n Platform,\n TouchableNativeFeedback,\n TouchableOpacity,\n View,\n} from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./colors\";\nimport type { PropsWithChildren } from \"react\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ButtonProps = {\n disabled?: boolean;\n onPress: () => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n rippleRadius?: number;\n style?: ViewStyle;\n theme: KeyboardToolbarTheme;\n};\n\nconst ButtonIOS = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n style,\n}: PropsWithChildren<ButtonProps>) => {\n // immediately switch to plain view to avoid animation flickering\n // when fade out animation happens and view becomes disabled\n const Container = disabled\n ? (View as unknown as typeof TouchableOpacity)\n : TouchableOpacity;\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n\n return (\n <Container\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n style={style}\n testID={testID}\n >\n {children}\n </Container>\n );\n};\nconst ButtonAndroid = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n rippleRadius = 18,\n style,\n theme,\n}: PropsWithChildren<ButtonProps>) => {\n const colorScheme = useColorScheme();\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n const ripple = useMemo(\n () =>\n TouchableNativeFeedback.Ripple(\n theme[colorScheme].ripple,\n true,\n rippleRadius,\n ),\n [colorScheme, rippleRadius, theme],\n );\n\n return (\n <TouchableNativeFeedback\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n background={ripple}\n testID={testID}\n style={style}\n >\n <View style={style}>{children}</View>\n </TouchableNativeFeedback>\n );\n};\n\nexport default Platform.select({\n android: ButtonAndroid,\n default: ButtonIOS,\n});\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SACEC,QAAQ,EACRC,uBAAuB,EACvBC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AAErB,OAAOC,cAAc,MAAM,yBAAyB;AAiBpD,MAAMC,SAAS,GAAGC,IAAA,IAQoB;EAAA,IARnB;IACjBC,QAAQ;IACRC,OAAO;IACPC,QAAQ;IACRC,kBAAkB;IAClBC,iBAAiB;IACjBC,MAAM;IACNC;EAC8B,CAAC,GAAAP,IAAA;EAC/B;EACA;EACA,MAAMQ,SAAS,GAAGL,QAAQ,GACrBN,IAAI,GACLD,gBAAgB;EACpB,MAAMa,kBAAkB,GAAGhB,OAAO,CAAC,OAAO;IAAEU;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEpE,oBACEX,KAAA,CAAAkB,aAAA,CAACF,SAAS;IACRC,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBK,KAAK,EAAEA,KAAM;IACbD,MAAM,EAAEA;EAAO,GAEdL,QACQ,CAAC;AAEhB,CAAC;AACD,MAAMW,aAAa,GAAGC,KAAA,IAUgB;EAAA,IAVf;IACrBZ,QAAQ;IACRC,OAAO;IACPC,QAAQ;IACRC,kBAAkB;IAClBC,iBAAiB;IACjBC,MAAM;IACNQ,YAAY,GAAG,EAAE;IACjBP,KAAK;IACLQ;EAC8B,CAAC,GAAAF,KAAA;EAC/B,MAAMG,WAAW,GAAGlB,cAAc,CAAC,CAAC;EACpC,MAAMW,kBAAkB,GAAGhB,OAAO,CAAC,OAAO;IAAEU;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACpE,MAAMc,MAAM,GAAGxB,OAAO,CACpB,MACEE,uBAAuB,CAACuB,MAAM,CAC5BH,KAAK,CAACC,WAAW,CAAC,CAACC,MAAM,EACzB,IAAI,EACJH,YACF,CAAC,EACH,CAACE,WAAW,EAAEF,YAAY,EAAEC,KAAK,CACnC,CAAC;EAED,oBACEvB,KAAA,CAAAkB,aAAA,CAACf,uBAAuB;IACtBc,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBiB,UAAU,EAAEF,MAAO;IACnBX,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA;EAAM,gBAEbf,KAAA,CAAAkB,aAAA,CAACb,IAAI;IAACU,KAAK,EAAEA;EAAM,GAAEN,QAAe,CACb,CAAC;AAE9B,CAAC;AAED,eAAeP,QAAQ,CAAC0B,MAAM,CAAC;EAC7BC,OAAO,EAAET,aAAa;EACtBU,OAAO,EAAEvB;AACX,CAAC,CAAC"}
1
+ {"version":3,"names":["React","useMemo","Platform","TouchableNativeFeedback","TouchableOpacity","View","useColorScheme","ButtonIOS","_ref","children","onPress","disabled","accessibilityLabel","accessibilityHint","testID","style","Container","accessibilityState","createElement","accessibilityRole","ButtonAndroid","_ref2","rippleRadius","theme","colorScheme","ripple","Ripple","background","select","android","default"],"sources":["Button.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport {\n Platform,\n TouchableNativeFeedback,\n TouchableOpacity,\n View,\n} from \"react-native\";\n\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { PropsWithChildren } from \"react\";\nimport type { ViewStyle } from \"react-native\";\n\ntype ButtonProps = {\n disabled?: boolean;\n onPress: () => void;\n accessibilityLabel: string;\n accessibilityHint: string;\n testID: string;\n rippleRadius?: number;\n style?: ViewStyle;\n theme: KeyboardToolbarTheme;\n};\n\nconst ButtonIOS = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n style,\n}: PropsWithChildren<ButtonProps>) => {\n // immediately switch to plain view to avoid animation flickering\n // when fade out animation happens and view becomes disabled\n const Container = disabled\n ? (View as unknown as typeof TouchableOpacity)\n : TouchableOpacity;\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n\n return (\n <Container\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n style={style}\n testID={testID}\n >\n {children}\n </Container>\n );\n};\nconst ButtonAndroid = ({\n children,\n onPress,\n disabled,\n accessibilityLabel,\n accessibilityHint,\n testID,\n rippleRadius = 18,\n style,\n theme,\n}: PropsWithChildren<ButtonProps>) => {\n const colorScheme = useColorScheme();\n const accessibilityState = useMemo(() => ({ disabled }), [disabled]);\n const ripple = useMemo(\n () =>\n TouchableNativeFeedback.Ripple(\n theme[colorScheme].ripple,\n true,\n rippleRadius,\n ),\n [colorScheme, rippleRadius, theme],\n );\n\n return (\n <TouchableNativeFeedback\n accessibilityState={accessibilityState}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n onPress={onPress}\n background={ripple}\n testID={testID}\n style={style}\n >\n <View style={style}>{children}</View>\n </TouchableNativeFeedback>\n );\n};\n\nexport default Platform.select({\n android: ButtonAndroid,\n default: ButtonIOS,\n});\n"],"mappings":"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W,CAAC,CAACC,MAAM,EACzB,IAAI,EACJH,YACF,CAAC,EACH,CAACE,WAAW,EAAEF,YAAY,EAAEC,KAAK,CACnC,CAAC;EAED,oBACEvB,KAAA,CAAAkB,aAAA,CAACf,uBAAuB;IACtBc,kBAAkB,EAAEA,kBAAmB;IACvCE,iBAAiB,EAAC,QAAQ;IAC1BP,kBAAkB,EAAEA,kBAAmB;IACvCC,iBAAiB,EAAEA,iBAAkB;IACrCH,OAAO,EAAEA,OAAQ;IACjBiB,UAAU,EAAEF,MAAO;IACnBX,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA;EAAM,gBAEbf,KAAA,CAAAkB,aAAA,CAACb,IAAI;IAACU,KAAK,EAAEA;EAAM,GAAEN,QAAe,CACb,CAAC;AAE9B,CAAC;AAED,eAAeP,QAAQ,CAAC0B,MAAM,CAAC;EAC7BC,OAAO,EAAET,aAAa;EACtBU,OAAO,EAAEvB;AACX,CAAC,CAAC"}
@@ -1,33 +1,14 @@
1
- import { Platform, PlatformColor } from "react-native";
2
1
  export const colors = {
3
2
  light: {
4
- primary: Platform.select({
5
- ios: PlatformColor("link"),
6
- default: "#2c2c2c"
7
- }),
8
- disabled: Platform.select({
9
- ios: PlatformColor("systemGray4"),
10
- default: "#B0BEC5"
11
- }),
12
- background: Platform.select({
13
- ios: "#F8F8F8",
14
- default: "#f3f3f4"
15
- }),
3
+ primary: "#2c2c2c",
4
+ disabled: "#B0BEC5",
5
+ background: "#f3f3f4",
16
6
  ripple: "#bcbcbcbc"
17
7
  },
18
8
  dark: {
19
- primary: Platform.select({
20
- ios: PlatformColor("label"),
21
- default: "#fafafa"
22
- }),
23
- disabled: Platform.select({
24
- ios: PlatformColor("systemGray"),
25
- default: "#707070"
26
- }),
27
- background: Platform.select({
28
- ios: "#555756",
29
- default: "#2C2C2E"
30
- }),
9
+ primary: "#fafafa",
10
+ disabled: "#707070",
11
+ background: "#2C2C2E",
31
12
  ripple: "#F8F8F888"
32
13
  }
33
14
  };
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","PlatformColor","colors","light","primary","select","ios","default","disabled","background","ripple","dark"],"sources":["colors.ts"],"sourcesContent":["import { Platform, PlatformColor } from \"react-native\";\n\nimport type { ColorValue } from \"react-native\";\n\ntype Theme = {\n /** Color for arrow when it's enabled */\n primary: ColorValue;\n /** Color for arrow when it's disabled */\n disabled: ColorValue;\n /** Keyboard toolbar background color */\n background: ColorValue;\n /** Color for ripple effect (on button touch) on Android */\n ripple: ColorValue;\n};\nexport type KeyboardToolbarTheme = {\n light: Theme;\n dark: Theme;\n};\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"link\"),\n default: \"#2c2c2c\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray4\"),\n default: \"#B0BEC5\",\n }),\n background: Platform.select({\n ios: \"#F8F8F8\",\n default: \"#f3f3f4\",\n }),\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"label\"),\n default: \"#fafafa\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray\"),\n default: \"#707070\",\n }),\n background: Platform.select({\n ios: \"#555756\",\n default: \"#2C2C2E\",\n }),\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,cAAc;AAmBtD,OAAO,MAAMC,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAEJ,QAAQ,CAACK,MAAM,CAAa;MACnCC,GAAG,EAAEL,aAAa,CAAC,MAAM,CAAC;MAC1BM,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAER,QAAQ,CAACK,MAAM,CAAa;MACpCC,GAAG,EAAEL,aAAa,CAAC,aAAa,CAAC;MACjCM,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAET,QAAQ,CAACK,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdC,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJP,OAAO,EAAEJ,QAAQ,CAACK,MAAM,CAAa;MACnCC,GAAG,EAAEL,aAAa,CAAC,OAAO,CAAC;MAC3BM,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAER,QAAQ,CAACK,MAAM,CAAa;MACpCC,GAAG,EAAEL,aAAa,CAAC,YAAY,CAAC;MAChCM,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAET,QAAQ,CAACK,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdC,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV;AACF,CAAC"}
1
+ {"version":3,"names":["colors","light","primary","disabled","background","ripple","dark"],"sources":["colors.ts"],"sourcesContent":["import type { KeyboardToolbarTheme } from \"./types\";\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: \"#2c2c2c\",\n disabled: \"#B0BEC5\",\n background: \"#f3f3f4\",\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: \"#fafafa\",\n disabled: \"#707070\",\n background: \"#2C2C2E\",\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":"AAEA,OAAO,MAAMA,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAE,SAAS;IAClBC,QAAQ,EAAE,SAAS;IACnBC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJJ,OAAO,EAAE,SAAS;IAClBC,QAAQ,EAAE,SAAS;IACnBC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE;EACV;AACF,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { Platform, PlatformColor } from "react-native";
2
+ export const colors = {
3
+ light: {
4
+ primary: Platform.select({
5
+ ios: PlatformColor("link"),
6
+ default: "#2c2c2c"
7
+ }),
8
+ disabled: Platform.select({
9
+ ios: PlatformColor("systemGray4"),
10
+ default: "#B0BEC5"
11
+ }),
12
+ background: Platform.select({
13
+ ios: "#F8F8F8",
14
+ default: "#f3f3f4"
15
+ }),
16
+ ripple: "#bcbcbcbc"
17
+ },
18
+ dark: {
19
+ primary: Platform.select({
20
+ ios: PlatformColor("label"),
21
+ default: "#fafafa"
22
+ }),
23
+ disabled: Platform.select({
24
+ ios: PlatformColor("systemGray"),
25
+ default: "#707070"
26
+ }),
27
+ background: Platform.select({
28
+ ios: "#555756",
29
+ default: "#2C2C2E"
30
+ }),
31
+ ripple: "#F8F8F888"
32
+ }
33
+ };
34
+ //# sourceMappingURL=colors.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","PlatformColor","colors","light","primary","select","ios","default","disabled","background","ripple","dark"],"sources":["colors.native.ts"],"sourcesContent":["import { Platform, PlatformColor } from \"react-native\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ColorValue } from \"react-native\";\n\nexport const colors: KeyboardToolbarTheme = {\n light: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"link\"),\n default: \"#2c2c2c\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray4\"),\n default: \"#B0BEC5\",\n }),\n background: Platform.select({\n ios: \"#F8F8F8\",\n default: \"#f3f3f4\",\n }),\n ripple: \"#bcbcbcbc\",\n },\n dark: {\n primary: Platform.select<ColorValue>({\n ios: PlatformColor(\"label\"),\n default: \"#fafafa\",\n }),\n disabled: Platform.select<ColorValue>({\n ios: PlatformColor(\"systemGray\"),\n default: \"#707070\",\n }),\n background: Platform.select({\n ios: \"#555756\",\n default: \"#2C2C2E\",\n }),\n ripple: \"#F8F8F888\",\n },\n};\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,cAAc;AAKtD,OAAO,MAAMC,MAA4B,GAAG;EAC1CC,KAAK,EAAE;IACLC,OAAO,EAAEJ,QAAQ,CAACK,MAAM,CAAa;MACnCC,GAAG,EAAEL,aAAa,CAAC,MAAM,CAAC;MAC1BM,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAER,QAAQ,CAACK,MAAM,CAAa;MACpCC,GAAG,EAAEL,aAAa,CAAC,aAAa,CAAC;MACjCM,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAET,QAAQ,CAACK,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdC,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJP,OAAO,EAAEJ,QAAQ,CAACK,MAAM,CAAa;MACnCC,GAAG,EAAEL,aAAa,CAAC,OAAO,CAAC;MAC3BM,OAAO,EAAE;IACX,CAAC,CAAC;IACFC,QAAQ,EAAER,QAAQ,CAACK,MAAM,CAAa;MACpCC,GAAG,EAAEL,aAAa,CAAC,YAAY,CAAC;MAChCM,OAAO,EAAE;IACX,CAAC,CAAC;IACFE,UAAU,EAAET,QAAQ,CAACK,MAAM,CAAC;MAC1BC,GAAG,EAAE,SAAS;MACdC,OAAO,EAAE;IACX,CAAC,CAAC;IACFG,MAAM,EAAE;EACV;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useMemo","useState","StyleSheet","Text","View","FocusedInputEvents","KeyboardStickyView","KeyboardController","useColorScheme","Arrow","Button","colors","TEST_ID_KEYBOARD_TOOLBAR","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","offset","closed","dismissKeyboard","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","_ref","content","theme","doneText","button","icon","colorScheme","inputs","setInputs","current","count","isPrevDisabled","isNextDisabled","subscription","addListener","e","remove","doneStyle","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","IconContainer","createElement","style","testID","accessibilityLabel","accessibilityHint","disabled","onPress","type","flex","rippleRadius","doneButtonContainer","maxFontSizeMultiplier","create","position","bottom","alignItems","width","flexDirection","height","paddingHorizontal","fontWeight","fontSize","marginRight","DefaultKeyboardToolbarTheme"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n KeyboardStickyView,\n} from \"react-native-keyboard-controller\";\n\nimport { KeyboardController } from \"../../bindings\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\n\nimport type { KeyboardToolbarTheme } from \"./colors\";\nimport type { ReactNode } from \"react\";\n\nexport type KeyboardToolbarProps = {\n /** An element that is shown in the middle of the toolbar. */\n content?: JSX.Element | null;\n /** A set of dark/light colors consumed by toolbar component. */\n theme?: KeyboardToolbarTheme;\n /** Custom text for done button. */\n doneText?: ReactNode;\n /** Custom touchable component for toolbar (used for prev/next/done buttons). */\n button?: typeof Button;\n /** Custom icon component used to display next/prev buttons. */\n icon?: typeof Arrow;\n};\nconst TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nconst TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nconst TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nconst TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nconst TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nconst KEYBOARD_TOOLBAR_HEIGHT = 42;\nconst offset = { closed: KEYBOARD_TOOLBAR_HEIGHT };\n\nconst dismissKeyboard = () => KeyboardController.dismiss();\nconst goToNextField = () => KeyboardController.setFocusTo(\"next\");\nconst goToPrevField = () => KeyboardController.setFocusTo(\"prev\");\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and\n * `Done` buttons.\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({\n content,\n theme = colors,\n doneText,\n button,\n icon,\n}) => {\n const colorScheme = useColorScheme();\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const doneStyle = useMemo(\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\n [colorScheme, theme],\n );\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: theme[colorScheme].background,\n },\n ],\n [colorScheme, theme],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n return (\n <KeyboardStickyView offset={offset}>\n <View style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n <ButtonContainer\n accessibilityLabel=\"Previous\"\n accessibilityHint=\"Will move focus to previous field\"\n disabled={isPrevDisabled}\n onPress={goToPrevField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n >\n <IconContainer disabled={isPrevDisabled} type=\"prev\" theme={theme} />\n </ButtonContainer>\n <ButtonContainer\n accessibilityLabel=\"Next\"\n accessibilityHint=\"Will move focus to next field\"\n disabled={isNextDisabled}\n onPress={goToNextField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n >\n <IconContainer disabled={isNextDisabled} type=\"next\" theme={theme} />\n </ButtonContainer>\n\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {content}\n </View>\n <ButtonContainer\n accessibilityLabel=\"Done\"\n accessibilityHint=\"Will close the keyboard\"\n onPress={dismissKeyboard}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n rippleRadius={28}\n style={styles.doneButtonContainer}\n theme={theme}\n >\n <Text style={doneStyle} maxFontSizeMultiplier={1.3}>\n {doneText || \"Done\"}\n </Text>\n </ButtonContainer>\n </View>\n </KeyboardStickyView>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n paddingHorizontal: 8,\n },\n doneButton: {\n fontWeight: \"600\",\n fontSize: 15,\n },\n doneButtonContainer: {\n marginRight: 8,\n },\n});\n\nexport { colors as DefaultKeyboardToolbarTheme };\nexport default KeyboardToolbar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SACEC,kBAAkB,EAClBC,kBAAkB,QACb,kCAAkC;AAEzC,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,OAAOC,cAAc,MAAM,yBAAyB;AAEpD,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,MAAM,QAAQ,UAAU;AAiBjC,MAAMC,wBAAwB,GAAG,kBAAkB;AACnD,MAAMC,iCAAiC,GAAI,GAAED,wBAAyB,WAAU;AAChF,MAAME,6BAA6B,GAAI,GAAEF,wBAAyB,OAAM;AACxE,MAAMG,gCAAgC,GAAI,GAAEH,wBAAyB,UAAS;AAC9E,MAAMI,6BAA6B,GAAI,GAAEJ,wBAAyB,OAAM;AAExE,MAAMK,uBAAuB,GAAG,EAAE;AAClC,MAAMC,MAAM,GAAG;EAAEC,MAAM,EAAEF;AAAwB,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AAe;IACdK,kBAAkB,EAAC,MAAM;IACzBC,iBAAiB,EAAC,yBAAyB;IAC3CE,OAAO,EAAExC,eAAgB;IACzBoC,MAAM,EAAExC,6BAA8B;IACtC+C,YAAY,EAAE,EAAG;IACjBR,KAAK,EAAEX,MAAM,CAACoB,mBAAoB;IAClCpC,KAAK,EAAEA;EAAM,gBAEb9B,KAAA,CAAAwD,aAAA,CAACnD,IAAI;IAACoD,KAAK,EAAEZ,SAAU;IAACsB,qBAAqB,EAAE;EAAI,GAChDpC,QAAQ,IAAI,MACT,CACS,CACb,CACY,CAAC;AAEzB,CAAC;AAED,MAAMe,MAAM,GAAG1C,UAAU,CAACgE,MAAM,CAAC;EAC/BJ,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDb,OAAO,EAAE;IACPkB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAEvD,uBAAuB;IAC/BwD,iBAAiB,EAAE;EACrB,CAAC;EACD5B,UAAU,EAAE;IACV6B,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDX,mBAAmB,EAAE;IACnBY,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,SAASjE,MAAM,IAAIkE,2BAA2B;AAC9C,eAAepD,eAAe"}
1
+ {"version":3,"names":["React","useEffect","useMemo","useState","StyleSheet","Text","View","FocusedInputEvents","KeyboardStickyView","KeyboardController","useColorScheme","Arrow","Button","colors","TEST_ID_KEYBOARD_TOOLBAR","TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS","TEST_ID_KEYBOARD_TOOLBAR_NEXT","TEST_ID_KEYBOARD_TOOLBAR_CONTENT","TEST_ID_KEYBOARD_TOOLBAR_DONE","KEYBOARD_TOOLBAR_HEIGHT","offset","closed","dismissKeyboard","dismiss","goToNextField","setFocusTo","goToPrevField","KeyboardToolbar","_ref","content","theme","doneText","button","icon","colorScheme","inputs","setInputs","current","count","isPrevDisabled","isNextDisabled","subscription","addListener","e","remove","doneStyle","styles","doneButton","color","primary","toolbarStyle","toolbar","backgroundColor","background","ButtonContainer","IconContainer","createElement","style","testID","accessibilityLabel","accessibilityHint","disabled","onPress","type","flex","rippleRadius","doneButtonContainer","maxFontSizeMultiplier","create","position","bottom","alignItems","width","flexDirection","height","paddingHorizontal","fontWeight","fontSize","marginRight","DefaultKeyboardToolbarTheme"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\n\nimport {\n FocusedInputEvents,\n KeyboardStickyView,\n} from \"react-native-keyboard-controller\";\n\nimport { KeyboardController } from \"../../bindings\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\nimport Arrow from \"./Arrow\";\nimport Button from \"./Button\";\nimport { colors } from \"./colors\";\n\nimport type { KeyboardToolbarTheme } from \"./types\";\nimport type { ReactNode } from \"react\";\n\nexport type KeyboardToolbarProps = {\n /** An element that is shown in the middle of the toolbar. */\n content?: JSX.Element | null;\n /** A set of dark/light colors consumed by toolbar component. */\n theme?: KeyboardToolbarTheme;\n /** Custom text for done button. */\n doneText?: ReactNode;\n /** Custom touchable component for toolbar (used for prev/next/done buttons). */\n button?: typeof Button;\n /** Custom icon component used to display next/prev buttons. */\n icon?: typeof Arrow;\n};\nconst TEST_ID_KEYBOARD_TOOLBAR = \"keyboard.toolbar\";\nconst TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS = `${TEST_ID_KEYBOARD_TOOLBAR}.previous`;\nconst TEST_ID_KEYBOARD_TOOLBAR_NEXT = `${TEST_ID_KEYBOARD_TOOLBAR}.next`;\nconst TEST_ID_KEYBOARD_TOOLBAR_CONTENT = `${TEST_ID_KEYBOARD_TOOLBAR}.content`;\nconst TEST_ID_KEYBOARD_TOOLBAR_DONE = `${TEST_ID_KEYBOARD_TOOLBAR}.done`;\n\nconst KEYBOARD_TOOLBAR_HEIGHT = 42;\nconst offset = { closed: KEYBOARD_TOOLBAR_HEIGHT };\n\nconst dismissKeyboard = () => KeyboardController.dismiss();\nconst goToNextField = () => KeyboardController.setFocusTo(\"next\");\nconst goToPrevField = () => KeyboardController.setFocusTo(\"prev\");\n\n/**\n * `KeyboardToolbar` is a component that is shown above the keyboard with `Prev`/`Next` and\n * `Done` buttons.\n */\nconst KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({\n content,\n theme = colors,\n doneText,\n button,\n icon,\n}) => {\n const colorScheme = useColorScheme();\n const [inputs, setInputs] = useState({\n current: 0,\n count: 0,\n });\n const isPrevDisabled = inputs.current === 0;\n const isNextDisabled = inputs.current === inputs.count - 1;\n\n useEffect(() => {\n const subscription = FocusedInputEvents.addListener(\"focusDidSet\", (e) => {\n setInputs(e);\n });\n\n return subscription.remove;\n }, []);\n const doneStyle = useMemo(\n () => [styles.doneButton, { color: theme[colorScheme].primary }],\n [colorScheme, theme],\n );\n const toolbarStyle = useMemo(\n () => [\n styles.toolbar,\n {\n backgroundColor: theme[colorScheme].background,\n },\n ],\n [colorScheme, theme],\n );\n const ButtonContainer = button || Button;\n const IconContainer = icon || Arrow;\n\n return (\n <KeyboardStickyView offset={offset}>\n <View style={toolbarStyle} testID={TEST_ID_KEYBOARD_TOOLBAR}>\n <ButtonContainer\n accessibilityLabel=\"Previous\"\n accessibilityHint=\"Will move focus to previous field\"\n disabled={isPrevDisabled}\n onPress={goToPrevField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_PREVIOUS}\n theme={theme}\n >\n <IconContainer disabled={isPrevDisabled} type=\"prev\" theme={theme} />\n </ButtonContainer>\n <ButtonContainer\n accessibilityLabel=\"Next\"\n accessibilityHint=\"Will move focus to next field\"\n disabled={isNextDisabled}\n onPress={goToNextField}\n testID={TEST_ID_KEYBOARD_TOOLBAR_NEXT}\n theme={theme}\n >\n <IconContainer disabled={isNextDisabled} type=\"next\" theme={theme} />\n </ButtonContainer>\n\n <View style={styles.flex} testID={TEST_ID_KEYBOARD_TOOLBAR_CONTENT}>\n {content}\n </View>\n <ButtonContainer\n accessibilityLabel=\"Done\"\n accessibilityHint=\"Will close the keyboard\"\n onPress={dismissKeyboard}\n testID={TEST_ID_KEYBOARD_TOOLBAR_DONE}\n rippleRadius={28}\n style={styles.doneButtonContainer}\n theme={theme}\n >\n <Text style={doneStyle} maxFontSizeMultiplier={1.3}>\n {doneText || \"Done\"}\n </Text>\n </ButtonContainer>\n </View>\n </KeyboardStickyView>\n );\n};\n\nconst styles = StyleSheet.create({\n flex: {\n flex: 1,\n },\n toolbar: {\n position: \"absolute\",\n bottom: 0,\n alignItems: \"center\",\n width: \"100%\",\n flexDirection: \"row\",\n height: KEYBOARD_TOOLBAR_HEIGHT,\n paddingHorizontal: 8,\n },\n doneButton: {\n fontWeight: \"600\",\n fontSize: 15,\n },\n doneButtonContainer: {\n marginRight: 8,\n },\n});\n\nexport { colors as DefaultKeyboardToolbarTheme };\nexport default KeyboardToolbar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC3D,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SACEC,kBAAkB,EAClBC,kBAAkB,QACb,kCAAkC;AAEzC,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,OAAOC,cAAc,MAAM,yBAAyB;AAEpD,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,MAAM,QAAQ,UAAU;AAiBjC,MAAMC,wBAAwB,GAAG,kBAAkB;AACnD,MAAMC,iCAAiC,GAAI,GAAED,wBAAyB,WAAU;AAChF,MAAME,6BAA6B,GAAI,GAAEF,wBAAyB,OAAM;AACxE,MAAMG,gCAAgC,GAAI,GAAEH,wBAAyB,UAAS;AAC9E,MAAMI,6BAA6B,GAAI,GAAEJ,wBAAyB,OAAM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,IAAK;IAACN,MAAM,EAAEzC;EAAiC,GAChEY,OACG,CAAC,eACP7B,KAAA,CAAAwD,aAAA,CAACF,eAAe;IACdK,kBAAkB,EAAC,MAAM;IACzBC,iBAAiB,EAAC,yBAAyB;IAC3CE,OAAO,EAAExC,eAAgB;IACzBoC,MAAM,EAAExC,6BAA8B;IACtC+C,YAAY,EAAE,EAAG;IACjBR,KAAK,EAAEX,MAAM,CAACoB,mBAAoB;IAClCpC,KAAK,EAAEA;EAAM,gBAEb9B,KAAA,CAAAwD,aAAA,CAACnD,IAAI;IAACoD,KAAK,EAAEZ,SAAU;IAACsB,qBAAqB,EAAE;EAAI,GAChDpC,QAAQ,IAAI,MACT,CACS,CACb,CACY,CAAC;AAEzB,CAAC;AAED,MAAMe,MAAM,GAAG1C,UAAU,CAACgE,MAAM,CAAC;EAC/BJ,IAAI,EAAE;IACJA,IAAI,EAAE;EACR,CAAC;EACDb,OAAO,EAAE;IACPkB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAEvD,uBAAuB;IAC/BwD,iBAAiB,EAAE;EACrB,CAAC;EACD5B,UAAU,EAAE;IACV6B,UAAU,EAAE,KAAK;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACDX,mBAAmB,EAAE;IACnBY,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,SAASjE,MAAM,IAAIkE,2BAA2B;AAC9C,eAAepD,eAAe"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { ColorValue } from \"react-native\";\n\ntype Theme = {\n /** Color for arrow when it's enabled */\n primary: ColorValue;\n /** Color for arrow when it's disabled */\n disabled: ColorValue;\n /** Keyboard toolbar background color */\n background: ColorValue;\n /** Color for ripple effect (on button touch) on Android */\n ripple: ColorValue;\n};\nexport type KeyboardToolbarTheme = {\n light: Theme;\n dark: Theme;\n};\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { KeyboardToolbarTheme } from "./colors";
2
+ import type { KeyboardToolbarTheme } from "./types";
3
3
  type ArrowProps = {
4
4
  type: "prev" | "next";
5
5
  disabled?: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { KeyboardToolbarTheme } from "./colors";
2
+ import type { KeyboardToolbarTheme } from "./types";
3
3
  import type { ViewStyle } from "react-native";
4
4
  type ButtonProps = {
5
5
  disabled?: boolean;
@@ -1,17 +1,2 @@
1
- import type { ColorValue } from "react-native";
2
- type Theme = {
3
- /** Color for arrow when it's enabled */
4
- primary: ColorValue;
5
- /** Color for arrow when it's disabled */
6
- disabled: ColorValue;
7
- /** Keyboard toolbar background color */
8
- background: ColorValue;
9
- /** Color for ripple effect (on button touch) on Android */
10
- ripple: ColorValue;
11
- };
12
- export type KeyboardToolbarTheme = {
13
- light: Theme;
14
- dark: Theme;
15
- };
1
+ import type { KeyboardToolbarTheme } from "./types";
16
2
  export declare const colors: KeyboardToolbarTheme;
17
- export {};
@@ -0,0 +1,2 @@
1
+ import type { KeyboardToolbarTheme } from "./types";
2
+ export declare const colors: KeyboardToolbarTheme;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import Arrow from "./Arrow";
3
3
  import Button from "./Button";
4
4
  import { colors } from "./colors";
5
- import type { KeyboardToolbarTheme } from "./colors";
5
+ import type { KeyboardToolbarTheme } from "./types";
6
6
  import type { ReactNode } from "react";
7
7
  export type KeyboardToolbarProps = {
8
8
  /** An element that is shown in the middle of the toolbar. */
@@ -0,0 +1,16 @@
1
+ import type { ColorValue } from "react-native";
2
+ type Theme = {
3
+ /** Color for arrow when it's enabled */
4
+ primary: ColorValue;
5
+ /** Color for arrow when it's disabled */
6
+ disabled: ColorValue;
7
+ /** Keyboard toolbar background color */
8
+ background: ColorValue;
9
+ /** Color for ripple effect (on button touch) on Android */
10
+ ripple: ColorValue;
11
+ };
12
+ export type KeyboardToolbarTheme = {
13
+ light: Theme;
14
+ dark: Theme;
15
+ };
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-keyboard-controller",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "description": "Keyboard manager which works in identical way on both iOS and Android",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -86,7 +86,7 @@
86
86
  "pod-install": "^0.1.0",
87
87
  "prettier": "^2.8.8",
88
88
  "react": "18.2.0",
89
- "react-native": "0.72.4",
89
+ "react-native": "0.72.11",
90
90
  "react-native-builder-bob": "^0.18.0",
91
91
  "react-native-reanimated": "3.6.1",
92
92
  "release-it": "^14.2.2",
@@ -4,6 +4,8 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
5
  folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
6
6
 
7
+ new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
8
+
7
9
  Pod::Spec.new do |s|
8
10
  s.name = "react-native-keyboard-controller"
9
11
  s.version = package["version"]
@@ -18,15 +20,9 @@ Pod::Spec.new do |s|
18
20
  s.source_files = "ios/**/*.{h,m,mm,swift}"
19
21
  s.public_header_files = "ios/**/*.h"
20
22
 
21
- s.dependency "React-Core"
22
-
23
23
  # This guard prevent to install the dependencies when we run `pod install` in the old architecture.
24
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
25
- s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
26
- s.pod_target_xcconfig = {
27
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"${PODS_ROOT}/Headers/Private/Yoga\"",
28
- "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
29
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
24
+ if new_arch_enabled then
25
+ s.pod_target_xcconfig = {
30
26
  # This is handy when we want to detect if new arch is enabled in Swift code
31
27
  # and can be used like:
32
28
  # #if KEYBOARD_CONTROLLER_NEW_ARCH_ENABLED
@@ -36,12 +32,29 @@ Pod::Spec.new do |s|
36
32
  # #endif
37
33
  "OTHER_SWIFT_FLAGS" => "-DKEYBOARD_CONTROLLER_NEW_ARCH_ENABLED"
38
34
  }
35
+ end
39
36
 
40
- s.dependency "React-RCTFabric"
41
- s.dependency "React-Codegen"
42
- s.dependency "RCT-Folly"
43
- s.dependency "RCTRequired"
44
- s.dependency "RCTTypeSafety"
45
- s.dependency "ReactCommon/turbomodule/core"
37
+ # install_modules_dependencies has been defined since React Native 71
38
+ if defined?(install_modules_dependencies)
39
+ install_modules_dependencies(s)
40
+ else
41
+ s.dependency 'React-Core'
42
+
43
+ # This guard prevent to install the dependencies when we run `pod install` in the old architecture.
44
+ if new_arch_enabled then
45
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
46
+ s.pod_target_xcconfig = s.pod_target_xcconfig | {
47
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
48
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
49
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
50
+ }
51
+
52
+ s.dependency "React-RCTFabric"
53
+ s.dependency "React-Codegen"
54
+ s.dependency "RCT-Folly"
55
+ s.dependency "RCTRequired"
56
+ s.dependency "RCTTypeSafety"
57
+ s.dependency "ReactCommon/turbomodule/core"
58
+ end
46
59
  end
47
60
  end
@@ -3,7 +3,7 @@ import { Animated, StyleSheet, View } from "react-native";
3
3
 
4
4
  import useColorScheme from "../hooks/useColorScheme";
5
5
 
6
- import type { KeyboardToolbarTheme } from "./colors";
6
+ import type { KeyboardToolbarTheme } from "./types";
7
7
  import type { ViewStyle } from "react-native";
8
8
 
9
9
  type ArrowProps = {
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  import useColorScheme from "../hooks/useColorScheme";
10
10
 
11
- import type { KeyboardToolbarTheme } from "./colors";
11
+ import type { KeyboardToolbarTheme } from "./types";
12
12
  import type { PropsWithChildren } from "react";
13
13
  import type { ViewStyle } from "react-native";
14
14
 
@@ -0,0 +1,37 @@
1
+ import { Platform, PlatformColor } from "react-native";
2
+
3
+ import type { KeyboardToolbarTheme } from "./types";
4
+ import type { ColorValue } from "react-native";
5
+
6
+ export const colors: KeyboardToolbarTheme = {
7
+ light: {
8
+ primary: Platform.select<ColorValue>({
9
+ ios: PlatformColor("link"),
10
+ default: "#2c2c2c",
11
+ }),
12
+ disabled: Platform.select<ColorValue>({
13
+ ios: PlatformColor("systemGray4"),
14
+ default: "#B0BEC5",
15
+ }),
16
+ background: Platform.select({
17
+ ios: "#F8F8F8",
18
+ default: "#f3f3f4",
19
+ }),
20
+ ripple: "#bcbcbcbc",
21
+ },
22
+ dark: {
23
+ primary: Platform.select<ColorValue>({
24
+ ios: PlatformColor("label"),
25
+ default: "#fafafa",
26
+ }),
27
+ disabled: Platform.select<ColorValue>({
28
+ ios: PlatformColor("systemGray"),
29
+ default: "#707070",
30
+ }),
31
+ background: Platform.select({
32
+ ios: "#555756",
33
+ default: "#2C2C2E",
34
+ }),
35
+ ripple: "#F8F8F888",
36
+ },
37
+ };
@@ -1,51 +1,16 @@
1
- import { Platform, PlatformColor } from "react-native";
2
-
3
- import type { ColorValue } from "react-native";
4
-
5
- type Theme = {
6
- /** Color for arrow when it's enabled */
7
- primary: ColorValue;
8
- /** Color for arrow when it's disabled */
9
- disabled: ColorValue;
10
- /** Keyboard toolbar background color */
11
- background: ColorValue;
12
- /** Color for ripple effect (on button touch) on Android */
13
- ripple: ColorValue;
14
- };
15
- export type KeyboardToolbarTheme = {
16
- light: Theme;
17
- dark: Theme;
18
- };
1
+ import type { KeyboardToolbarTheme } from "./types";
19
2
 
20
3
  export const colors: KeyboardToolbarTheme = {
21
4
  light: {
22
- primary: Platform.select<ColorValue>({
23
- ios: PlatformColor("link"),
24
- default: "#2c2c2c",
25
- }),
26
- disabled: Platform.select<ColorValue>({
27
- ios: PlatformColor("systemGray4"),
28
- default: "#B0BEC5",
29
- }),
30
- background: Platform.select({
31
- ios: "#F8F8F8",
32
- default: "#f3f3f4",
33
- }),
5
+ primary: "#2c2c2c",
6
+ disabled: "#B0BEC5",
7
+ background: "#f3f3f4",
34
8
  ripple: "#bcbcbcbc",
35
9
  },
36
10
  dark: {
37
- primary: Platform.select<ColorValue>({
38
- ios: PlatformColor("label"),
39
- default: "#fafafa",
40
- }),
41
- disabled: Platform.select<ColorValue>({
42
- ios: PlatformColor("systemGray"),
43
- default: "#707070",
44
- }),
45
- background: Platform.select({
46
- ios: "#555756",
47
- default: "#2C2C2E",
48
- }),
11
+ primary: "#fafafa",
12
+ disabled: "#707070",
13
+ background: "#2C2C2E",
49
14
  ripple: "#F8F8F888",
50
15
  },
51
16
  };
@@ -13,7 +13,7 @@ import Arrow from "./Arrow";
13
13
  import Button from "./Button";
14
14
  import { colors } from "./colors";
15
15
 
16
- import type { KeyboardToolbarTheme } from "./colors";
16
+ import type { KeyboardToolbarTheme } from "./types";
17
17
  import type { ReactNode } from "react";
18
18
 
19
19
  export type KeyboardToolbarProps = {
@@ -0,0 +1,16 @@
1
+ import type { ColorValue } from "react-native";
2
+
3
+ type Theme = {
4
+ /** Color for arrow when it's enabled */
5
+ primary: ColorValue;
6
+ /** Color for arrow when it's disabled */
7
+ disabled: ColorValue;
8
+ /** Keyboard toolbar background color */
9
+ background: ColorValue;
10
+ /** Color for ripple effect (on button touch) on Android */
11
+ ripple: ColorValue;
12
+ };
13
+ export type KeyboardToolbarTheme = {
14
+ light: Theme;
15
+ dark: Theme;
16
+ };