react-native-platform-components 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/README.md +33 -31
  2. package/android/src/main/java/com/platformcomponents/PCButtonGroupView.kt +498 -0
  3. package/android/src/main/java/com/platformcomponents/PCButtonGroupViewManager.kt +191 -0
  4. package/android/src/main/java/com/platformcomponents/PCButtonSupport.kt +127 -0
  5. package/android/src/main/java/com/platformcomponents/PCButtonView.kt +345 -0
  6. package/android/src/main/java/com/platformcomponents/PCButtonViewManager.kt +126 -0
  7. package/android/src/main/java/com/platformcomponents/PCExpressive.kt +107 -0
  8. package/android/src/main/java/com/platformcomponents/PCFloatingToolbarView.kt +115 -0
  9. package/android/src/main/java/com/platformcomponents/PCFloatingToolbarViewManager.kt +65 -0
  10. package/android/src/main/java/com/platformcomponents/PCNativeThemeModule.kt +3 -0
  11. package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +13 -5
  12. package/android/src/main/java/com/platformcomponents/PCSegmentedControlViewManager.kt +6 -1
  13. package/android/src/main/java/com/platformcomponents/PCTextFieldView.kt +1018 -0
  14. package/android/src/main/java/com/platformcomponents/PCTextFieldViewManager.kt +248 -0
  15. package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +13 -6
  16. package/android/src/main/jni/CMakeLists.txt +13 -1
  17. package/android/src/main/res/values/attrs.xml +13 -0
  18. package/android/src/main/res/values/styles.xml +183 -0
  19. package/ios/PCButton.h +10 -0
  20. package/ios/PCButton.mm +196 -0
  21. package/ios/PCButtonGroup.h +10 -0
  22. package/ios/PCButtonGroup.mm +256 -0
  23. package/ios/PCButtonGroupView.swift +254 -0
  24. package/ios/PCButtonSupport.swift +141 -0
  25. package/ios/PCButtonView.swift +155 -0
  26. package/ios/PCFloatingToolbar.h +10 -0
  27. package/ios/PCFloatingToolbar.mm +76 -0
  28. package/ios/PCFloatingToolbarView.swift +95 -0
  29. package/ios/PCNativeThemeModule.mm +13 -0
  30. package/ios/PCSelectionMenu.swift +9 -1
  31. package/ios/PCTextField.h +10 -0
  32. package/ios/PCTextField.mm +391 -0
  33. package/ios/PCTextFieldView.swift +1012 -0
  34. package/lib/commonjs/Button.js +77 -0
  35. package/lib/commonjs/Button.js.map +1 -0
  36. package/lib/commonjs/ButtonGroup.js +99 -0
  37. package/lib/commonjs/ButtonGroup.js.map +1 -0
  38. package/lib/commonjs/ButtonGroupNativeComponent.ts +121 -0
  39. package/lib/commonjs/ButtonNativeComponent.ts +76 -0
  40. package/lib/commonjs/ContextMenuNativeComponent.ts +5 -4
  41. package/lib/commonjs/DatePickerNativeComponent.ts +17 -11
  42. package/lib/commonjs/FloatingToolbar.js +69 -0
  43. package/lib/commonjs/FloatingToolbar.js.map +1 -0
  44. package/lib/commonjs/FloatingToolbarNativeComponent.ts +31 -0
  45. package/lib/commonjs/LiquidGlass.js +24 -4
  46. package/lib/commonjs/LiquidGlass.js.map +1 -1
  47. package/lib/commonjs/LiquidGlassNativeComponent.ts +6 -5
  48. package/lib/commonjs/NativePlatformComponentsTheme.js.map +1 -1
  49. package/lib/commonjs/SegmentedControl.js +11 -85
  50. package/lib/commonjs/SegmentedControl.js.map +1 -1
  51. package/lib/commonjs/SegmentedControlNativeComponent.ts +15 -11
  52. package/lib/commonjs/SelectionMenuNativeComponent.ts +6 -5
  53. package/lib/commonjs/TextField.js +195 -0
  54. package/lib/commonjs/TextField.js.map +1 -0
  55. package/lib/commonjs/TextFieldNativeComponent.ts +218 -0
  56. package/lib/commonjs/codegenTypes.js +6 -0
  57. package/lib/commonjs/codegenTypes.js.map +1 -0
  58. package/lib/commonjs/focusRegistry.js +78 -0
  59. package/lib/commonjs/focusRegistry.js.map +1 -0
  60. package/lib/commonjs/icons.js +92 -0
  61. package/lib/commonjs/icons.js.map +1 -0
  62. package/lib/commonjs/index.js +66 -0
  63. package/lib/commonjs/index.js.map +1 -1
  64. package/lib/commonjs/index.web.js +32 -2
  65. package/lib/commonjs/index.web.js.map +1 -1
  66. package/lib/commonjs/labelStyle.js +27 -0
  67. package/lib/commonjs/labelStyle.js.map +1 -0
  68. package/lib/commonjs/reactNativeInternals.d.js +2 -0
  69. package/lib/commonjs/reactNativeInternals.d.js.map +1 -0
  70. package/lib/module/Button.js +70 -0
  71. package/lib/module/Button.js.map +1 -0
  72. package/lib/module/ButtonGroup.js +92 -0
  73. package/lib/module/ButtonGroup.js.map +1 -0
  74. package/lib/module/ButtonGroupNativeComponent.ts +121 -0
  75. package/lib/module/ButtonNativeComponent.ts +76 -0
  76. package/lib/module/ContextMenuNativeComponent.ts +5 -4
  77. package/lib/module/DatePickerNativeComponent.ts +17 -11
  78. package/lib/module/FloatingToolbar.js +62 -0
  79. package/lib/module/FloatingToolbar.js.map +1 -0
  80. package/lib/module/FloatingToolbarNativeComponent.ts +31 -0
  81. package/lib/module/LiquidGlass.js +24 -4
  82. package/lib/module/LiquidGlass.js.map +1 -1
  83. package/lib/module/LiquidGlassNativeComponent.ts +6 -5
  84. package/lib/module/NativePlatformComponentsTheme.js.map +1 -1
  85. package/lib/module/SegmentedControl.js +12 -87
  86. package/lib/module/SegmentedControl.js.map +1 -1
  87. package/lib/module/SegmentedControlNativeComponent.ts +15 -11
  88. package/lib/module/SelectionMenuNativeComponent.ts +6 -5
  89. package/lib/module/TextField.js +189 -0
  90. package/lib/module/TextField.js.map +1 -0
  91. package/lib/module/TextFieldNativeComponent.ts +218 -0
  92. package/lib/module/codegenTypes.js +4 -0
  93. package/lib/module/codegenTypes.js.map +1 -0
  94. package/lib/module/focusRegistry.js +74 -0
  95. package/lib/module/focusRegistry.js.map +1 -0
  96. package/lib/module/icons.js +87 -0
  97. package/lib/module/icons.js.map +1 -0
  98. package/lib/module/index.js +6 -0
  99. package/lib/module/index.js.map +1 -1
  100. package/lib/module/index.web.js +28 -0
  101. package/lib/module/index.web.js.map +1 -1
  102. package/lib/module/labelStyle.js +23 -0
  103. package/lib/module/labelStyle.js.map +1 -0
  104. package/lib/module/reactNativeInternals.d.js +2 -0
  105. package/lib/module/reactNativeInternals.d.js.map +1 -0
  106. package/lib/typescript/commonjs/docs/sidebars.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/src/Button.d.ts +76 -0
  108. package/lib/typescript/commonjs/src/Button.d.ts.map +1 -0
  109. package/lib/typescript/commonjs/src/ButtonGroup.d.ts +102 -0
  110. package/lib/typescript/commonjs/src/ButtonGroup.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts +93 -0
  112. package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts +57 -0
  114. package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts +5 -4
  116. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts +12 -11
  118. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/src/FloatingToolbar.d.ts +45 -0
  120. package/lib/typescript/commonjs/src/FloatingToolbar.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts +24 -0
  122. package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/src/LiquidGlass.d.ts +4 -3
  124. package/lib/typescript/commonjs/src/LiquidGlass.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts +6 -5
  126. package/lib/typescript/commonjs/src/LiquidGlassNativeComponent.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts +10 -2
  128. package/lib/typescript/commonjs/src/NativePlatformComponentsTheme.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/src/SegmentedControl.d.ts +17 -46
  130. package/lib/typescript/commonjs/src/SegmentedControl.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +9 -6
  132. package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts +6 -5
  134. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/src/TextField.d.ts +174 -0
  136. package/lib/typescript/commonjs/src/TextField.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts +162 -0
  138. package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/src/codegenTypes.d.ts +12 -0
  140. package/lib/typescript/commonjs/src/codegenTypes.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/src/focusRegistry.d.ts +13 -0
  142. package/lib/typescript/commonjs/src/focusRegistry.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/src/icons.d.ts +52 -0
  144. package/lib/typescript/commonjs/src/icons.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/src/index.d.ts +6 -0
  146. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  147. package/lib/typescript/commonjs/src/index.web.d.ts +121 -0
  148. package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/src/labelStyle.d.ts +20 -0
  150. package/lib/typescript/commonjs/src/labelStyle.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/src/sharedTypes.d.ts +8 -3
  152. package/lib/typescript/commonjs/src/sharedTypes.d.ts.map +1 -1
  153. package/lib/typescript/module/docs/sidebars.d.ts.map +1 -1
  154. package/lib/typescript/module/src/Button.d.ts +76 -0
  155. package/lib/typescript/module/src/Button.d.ts.map +1 -0
  156. package/lib/typescript/module/src/ButtonGroup.d.ts +102 -0
  157. package/lib/typescript/module/src/ButtonGroup.d.ts.map +1 -0
  158. package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts +93 -0
  159. package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts.map +1 -0
  160. package/lib/typescript/module/src/ButtonNativeComponent.d.ts +57 -0
  161. package/lib/typescript/module/src/ButtonNativeComponent.d.ts.map +1 -0
  162. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts +5 -4
  163. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts.map +1 -1
  164. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +12 -11
  165. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -1
  166. package/lib/typescript/module/src/FloatingToolbar.d.ts +45 -0
  167. package/lib/typescript/module/src/FloatingToolbar.d.ts.map +1 -0
  168. package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts +24 -0
  169. package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts.map +1 -0
  170. package/lib/typescript/module/src/LiquidGlass.d.ts +4 -3
  171. package/lib/typescript/module/src/LiquidGlass.d.ts.map +1 -1
  172. package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts +6 -5
  173. package/lib/typescript/module/src/LiquidGlassNativeComponent.d.ts.map +1 -1
  174. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts +10 -2
  175. package/lib/typescript/module/src/NativePlatformComponentsTheme.d.ts.map +1 -1
  176. package/lib/typescript/module/src/SegmentedControl.d.ts +17 -46
  177. package/lib/typescript/module/src/SegmentedControl.d.ts.map +1 -1
  178. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +9 -6
  179. package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
  180. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +6 -5
  181. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -1
  182. package/lib/typescript/module/src/TextField.d.ts +174 -0
  183. package/lib/typescript/module/src/TextField.d.ts.map +1 -0
  184. package/lib/typescript/module/src/TextFieldNativeComponent.d.ts +162 -0
  185. package/lib/typescript/module/src/TextFieldNativeComponent.d.ts.map +1 -0
  186. package/lib/typescript/module/src/codegenTypes.d.ts +12 -0
  187. package/lib/typescript/module/src/codegenTypes.d.ts.map +1 -0
  188. package/lib/typescript/module/src/focusRegistry.d.ts +13 -0
  189. package/lib/typescript/module/src/focusRegistry.d.ts.map +1 -0
  190. package/lib/typescript/module/src/icons.d.ts +52 -0
  191. package/lib/typescript/module/src/icons.d.ts.map +1 -0
  192. package/lib/typescript/module/src/index.d.ts +6 -0
  193. package/lib/typescript/module/src/index.d.ts.map +1 -1
  194. package/lib/typescript/module/src/index.web.d.ts +121 -0
  195. package/lib/typescript/module/src/index.web.d.ts.map +1 -1
  196. package/lib/typescript/module/src/labelStyle.d.ts +20 -0
  197. package/lib/typescript/module/src/labelStyle.d.ts.map +1 -0
  198. package/lib/typescript/module/src/sharedTypes.d.ts +8 -3
  199. package/lib/typescript/module/src/sharedTypes.d.ts.map +1 -1
  200. package/package.json +28 -6
  201. package/react-native.config.js +3 -0
  202. package/shared/PCButtonComponentDescriptors-custom.h +22 -0
  203. package/shared/PCButtonGroupComponentDescriptors-custom.h +22 -0
  204. package/shared/PCButtonGroupShadowNode-custom.cpp +48 -0
  205. package/shared/PCButtonGroupShadowNode-custom.h +55 -0
  206. package/shared/PCButtonGroupState-custom.h +61 -0
  207. package/shared/PCButtonShadowNode-custom.cpp +48 -0
  208. package/shared/PCButtonShadowNode-custom.h +55 -0
  209. package/shared/PCButtonState-custom.h +61 -0
  210. package/shared/PCDatePickerState-custom.h +2 -2
  211. package/shared/PCSegmentedControlState-custom.h +2 -2
  212. package/shared/PCSelectionMenuState-custom.h +2 -2
  213. package/shared/PCTextFieldComponentDescriptors-custom.h +22 -0
  214. package/shared/PCTextFieldShadowNode-custom.cpp +47 -0
  215. package/shared/PCTextFieldShadowNode-custom.h +55 -0
  216. package/shared/PCTextFieldState-custom.h +61 -0
  217. package/shared/react/renderer/components/PlatformComponentsViewSpec/ComponentDescriptors.h +3 -0
  218. package/src/Button.tsx +144 -0
  219. package/src/ButtonGroup.tsx +233 -0
  220. package/src/ButtonGroupNativeComponent.ts +121 -0
  221. package/src/ButtonNativeComponent.ts +76 -0
  222. package/src/ContextMenuNativeComponent.ts +5 -4
  223. package/src/DatePickerNativeComponent.ts +17 -11
  224. package/src/FloatingToolbar.tsx +113 -0
  225. package/src/FloatingToolbarNativeComponent.ts +31 -0
  226. package/src/LiquidGlass.tsx +24 -5
  227. package/src/LiquidGlassNativeComponent.ts +6 -5
  228. package/src/NativePlatformComponentsTheme.ts +11 -2
  229. package/src/SegmentedControl.tsx +26 -118
  230. package/src/SegmentedControlNativeComponent.ts +15 -11
  231. package/src/SelectionMenuNativeComponent.ts +6 -5
  232. package/src/TextField.tsx +494 -0
  233. package/src/TextFieldNativeComponent.ts +218 -0
  234. package/src/codegenTypes.ts +40 -0
  235. package/src/focusRegistry.ts +89 -0
  236. package/src/icons.ts +116 -0
  237. package/src/index.tsx +6 -0
  238. package/src/index.web.tsx +194 -0
  239. package/src/labelStyle.ts +36 -0
  240. package/src/reactNativeInternals.d.ts +22 -0
  241. package/src/sharedTypes.ts +9 -3
  242. /package/{app.plugin.cjs → app.plugin.js} +0 -0
@@ -0,0 +1,218 @@
1
+ // TextFieldNativeComponent.ts
2
+ import type * as React from 'react';
3
+ import type { HostComponent, ViewProps } from 'react-native';
4
+ import { codegenNativeCommands, codegenNativeComponent } from 'react-native';
5
+ import type { BubblingEventHandler, Double, Int32 } from './codegenTypes';
6
+
7
+ /**
8
+ * Icon fields, pre-resolved on the JS side (see icons.ts).
9
+ */
10
+ export type TextFieldIconProps = Readonly<{
11
+ iconType: string; // '' | 'sfSymbol' | 'drawable' | 'image'
12
+ iconName: string; // SF Symbol (iOS) or drawable resource name (Android)
13
+ iconUri: string; // Resolved image URI when iconType === 'image'
14
+ iconScale: Double; // Resolved image scale when iconType === 'image'
15
+ iconTinted: string; // 'true' | 'false' — draw the image as a tinted template
16
+ }>;
17
+
18
+ /**
19
+ * Text font. Empty strings / 0 mean "platform default".
20
+ */
21
+ export type TextFieldTextStyleProps = Readonly<{
22
+ fontFamily?: string;
23
+ fontSize?: Double;
24
+ fontWeight?: string; // 'normal' | 'bold' | '100'..'900'
25
+ fontStyle?: string; // 'normal' | 'italic'
26
+ }>;
27
+
28
+ /**
29
+ * Fired on every edit. `eventCount` is the native edit counter that JS hands
30
+ * back with `setText`, so a stale controlled value can't overwrite what the
31
+ * user typed since.
32
+ */
33
+ export type TextFieldChangeEvent = Readonly<{
34
+ text: string;
35
+ eventCount: Int32;
36
+ }>;
37
+
38
+ /** Focus, blur and submit carry the text at that moment. */
39
+ export type TextFieldTextEvent = Readonly<{
40
+ text: string;
41
+ }>;
42
+
43
+ /**
44
+ * iOS-specific configuration. Every field is '' for the platform default.
45
+ */
46
+ export type TextFieldIOSProps = Readonly<{
47
+ /** 'default' | 'complete' | 'limited' | 'none' (iOS 18) */
48
+ writingTools?: string;
49
+ /** 'default' | 'yes' | 'no' (iOS 17) */
50
+ inlinePrediction?: string;
51
+ /** 'default' | 'yes' | 'no' */
52
+ smartQuotes?: string;
53
+ /** 'default' | 'yes' | 'no' */
54
+ smartDashes?: string;
55
+ /** 'default' | 'yes' | 'no' */
56
+ smartInsertDelete?: string;
57
+ /** 'default' | 'yes' | 'no' (iOS 18) */
58
+ mathExpressionCompletion?: string;
59
+ /** 'roundedRect' | 'none' | 'line' | 'bezel' */
60
+ borderStyle?: string;
61
+ /** 'above' | 'leading': where the label sits */
62
+ labelPlacement?: string;
63
+ /** Width of a leading label column in points; 0 = default */
64
+ labelWidth?: Double;
65
+ }>;
66
+
67
+ /**
68
+ * Android-specific configuration.
69
+ */
70
+ export type TextFieldAndroidProps = Readonly<{
71
+ /** 'm3' | 'system' (AndroidMaterialMode) */
72
+ material?: string;
73
+ /** 'outlined' | 'filled' */
74
+ variant?: string;
75
+ /** 'standard' | 'dense' */
76
+ density?: string;
77
+ }>;
78
+
79
+ export interface TextFieldNativeProps extends ViewProps {
80
+ /**
81
+ * Text applied when the native view is created. Later updates go through
82
+ * the `setText` command so they can be checked against `eventCount`.
83
+ */
84
+ initialText?: string;
85
+
86
+ /** Floating label (Android) / caption above the field (iOS). */
87
+ label?: string;
88
+
89
+ /** Placeholder shown while the field is empty. */
90
+ placeholder?: string;
91
+
92
+ /** Helper text below the field. */
93
+ supportingText?: string;
94
+
95
+ /** 'none' | 'error' */
96
+ errorState?: string;
97
+
98
+ /** Error message shown instead of the supporting text. */
99
+ errorText?: string;
100
+
101
+ /** Text shown before the input, inside the field. */
102
+ prefix?: string;
103
+
104
+ /** Text shown after the input, inside the field. */
105
+ suffix?: string;
106
+
107
+ /** Icon at the start of the field. */
108
+ leadingIcon?: TextFieldIconProps;
109
+
110
+ /** Icon at the end of the field; pressing it fires onTrailingIconPress. */
111
+ trailingIcon?: TextFieldIconProps;
112
+
113
+ /** 'never' | 'while-editing' | 'unless-editing' | 'always' */
114
+ clearButtonMode?: string;
115
+
116
+ /** 'shown' | 'hidden': a button that toggles secure text entry. */
117
+ passwordToggle?: string;
118
+
119
+ /** 'shown' | 'hidden': the character counter. */
120
+ characterCount?: string;
121
+
122
+ /** Maximum number of UTF-16 characters; 0 = unlimited. */
123
+ maxLength?: Int32;
124
+
125
+ /** React Native keyboardType value. */
126
+ keyboardType?: string;
127
+
128
+ /** React Native returnKeyType value. */
129
+ returnKeyType?: string;
130
+
131
+ /** 'none' | 'sentences' | 'words' | 'characters' */
132
+ autoCapitalize?: string;
133
+
134
+ /** 'enabled' | 'disabled' */
135
+ autoCorrect?: string;
136
+
137
+ /** 'secure' | 'plain' */
138
+ secureTextEntry?: string;
139
+
140
+ /** 'single' | 'multiline' */
141
+ lines?: string;
142
+
143
+ /** 'enabled' | 'disabled' */
144
+ interactivity?: string;
145
+
146
+ /** 'focus' | 'none': focus the field when it mounts. */
147
+ autoFocus?: string;
148
+
149
+ /** 'select' | 'keep': select all text on focus. */
150
+ selectTextOnFocus?: string;
151
+
152
+ /** React Native autoComplete value; '' = platform default. */
153
+ autoComplete?: string;
154
+
155
+ /** 'default' | 'light' | 'dark' (iOS keyboard appearance) */
156
+ keyboardAppearance?: string;
157
+
158
+ /** Font of the input text. */
159
+ textStyle?: TextFieldTextStyleProps;
160
+
161
+ /**
162
+ * Screen-reader label, applied to the native field rather than the host
163
+ * view. Empty means "use the label".
164
+ */
165
+ spokenLabel?: string;
166
+
167
+ ios?: TextFieldIOSProps;
168
+ android?: TextFieldAndroidProps;
169
+
170
+ /** Fired on every user edit. */
171
+ onFieldChange?: BubblingEventHandler<TextFieldChangeEvent>;
172
+
173
+ /** Fired when the field gains focus. */
174
+ onFieldFocus?: BubblingEventHandler<TextFieldTextEvent>;
175
+
176
+ /** Fired when the field loses focus. */
177
+ onFieldBlur?: BubblingEventHandler<TextFieldTextEvent>;
178
+
179
+ /** Fired when the keyboard's return key is pressed (single-line). */
180
+ onFieldSubmit?: BubblingEventHandler<TextFieldTextEvent>;
181
+
182
+ /** Fired when the trailing icon is pressed. */
183
+ onTrailingIconPress?: BubblingEventHandler<Readonly<{}>>;
184
+ }
185
+
186
+ type NativeTextFieldComponent = HostComponent<TextFieldNativeProps>;
187
+
188
+ // `React.ElementRef` rather than `React.ComponentRef`: the codegen shipped with
189
+ // React Native 0.81 (and the 0.76 Android floor) only accepts the former.
190
+ interface NativeCommands {
191
+ /** Focuses the field and shows the keyboard. */
192
+ focus: (viewRef: React.ElementRef<NativeTextFieldComponent>) => void;
193
+
194
+ /** Removes focus and hides the keyboard. */
195
+ blur: (viewRef: React.ElementRef<NativeTextFieldComponent>) => void;
196
+
197
+ /** Clears the text; fires onFieldChange like a user edit. */
198
+ clear: (viewRef: React.ElementRef<NativeTextFieldComponent>) => void;
199
+
200
+ /**
201
+ * Replaces the text, unless the user has edited since `eventCount` was
202
+ * reported, in which case the update is dropped and the next edit event
203
+ * brings JS back in sync.
204
+ */
205
+ setText: (
206
+ viewRef: React.ElementRef<NativeTextFieldComponent>,
207
+ eventCount: Int32,
208
+ text: string
209
+ ) => void;
210
+ }
211
+
212
+ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
213
+ supportedCommands: ['focus', 'blur', 'clear', 'setText'],
214
+ });
215
+
216
+ export default codegenNativeComponent<TextFieldNativeProps>(
217
+ 'PCTextField'
218
+ ) as NativeTextFieldComponent;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=codegenTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["codegenTypes.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ // focusRegistry.ts
4
+ //
5
+ // TextField's link to React Native's focused-input bookkeeping. The core
6
+ // TextInput registers its host node with `TextInputState`, and that registry is
7
+ // what `Keyboard.dismiss()`, a ScrollView's `keyboardShouldPersistTaps` and
8
+ // `keyboardDismissMode`, and `KeyboardAvoidingView` act on. Registering the
9
+ // same way makes a TextField behave like a TextInput for all of them.
10
+ //
11
+ // `TextInputState` is a stable internal (it has kept this shape since 0.63),
12
+ // but React Native's Babel preset adds a dev-time warning to every static
13
+ // `import` or `require` of a deep path. A dynamic `import()` is resolved by
14
+ // Metro the same way and carries no warning; it settles in a microtask at
15
+ // startup, so a node registered before then is kept and registered once the
16
+ // module arrives. If a future release drops the path, the registry is simply
17
+ // absent and the field falls back to the public `TextInput.State` calls for
18
+ // focus and blur, keeping `Keyboard.dismiss()` working.
19
+ import { TextInput } from 'react-native';
20
+ let registry;
21
+ const pendingRegistrations = new Set();
22
+
23
+ // A stable internal without a public counterpart; see reactNativeInternals.d.ts.
24
+
25
+ import('react-native/Libraries/Components/TextInput/TextInputState').then(module => {
26
+ registry = module.default;
27
+ pendingRegistrations.forEach(node => registry?.registerInput(node));
28
+ pendingRegistrations.clear();
29
+ }).catch(() => {
30
+ // Not available: focus and blur still go through TextInput.State below.
31
+ });
32
+ export const focusRegistry = {
33
+ /** Called when the field mounts. */
34
+ register(node) {
35
+ if (registry) {
36
+ registry.registerInput(node);
37
+ } else {
38
+ pendingRegistrations.add(node);
39
+ }
40
+ },
41
+ /** Called when the field unmounts; drops the focus if the field held it. */
42
+ unregister(node) {
43
+ pendingRegistrations.delete(node);
44
+ if (registry) {
45
+ registry.unregisterInput(node);
46
+ if (registry.currentlyFocusedInput() === node) {
47
+ registry.blurInput(node);
48
+ }
49
+ } else if (TextInput.State.currentlyFocusedInput() === node) {
50
+ TextInput.State.blurTextInput(node);
51
+ }
52
+ },
53
+ /** The field gained focus natively. */
54
+ focused(node) {
55
+ if (node == null) return;
56
+ if (registry) {
57
+ registry.focusInput(node);
58
+ } else {
59
+ // Also re-sends the focus command, which the focused field ignores
60
+ TextInput.State.focusTextInput(node);
61
+ }
62
+ },
63
+ /** The field lost focus natively. */
64
+ blurred(node) {
65
+ if (node == null) return;
66
+ if (registry) {
67
+ registry.blurInput(node);
68
+ } else {
69
+ // Also re-sends the blur command, which the unfocused field ignores
70
+ TextInput.State.blurTextInput(node);
71
+ }
72
+ }
73
+ };
74
+ //# sourceMappingURL=focusRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TextInput","registry","pendingRegistrations","Set","then","module","default","forEach","node","registerInput","clear","catch","focusRegistry","register","add","unregister","delete","unregisterInput","currentlyFocusedInput","blurInput","State","blurTextInput","focused","focusInput","focusTextInput","blurred"],"sourceRoot":"../../src","sources":["focusRegistry.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,cAAc;AAaxC,IAAIC,QAA8B;AAClC,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAAW,CAAC;;AAEhD;;AAEA,MAAM,CAAC,4DAA4D,CAAC,CACjEC,IAAI,CAAEC,MAAM,IAAK;EAChBJ,QAAQ,GAAGI,MAAM,CAACC,OAAO;EACzBJ,oBAAoB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ACX,IAAI,CAAC;IAC1B,CAAC,MAAM;MACL;MACAR,SAAS,CAACoB,KAAK,CAACC,aAAa,CAACb,IAAa,CAAC;IAC9C;EACF;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ // icons.ts
4
+ //
5
+ // Icon props shared by SegmentedControl, Button and ButtonGroup. Icons are
6
+ // resolved on the JS side so native only deals with flat strings.
7
+ import { Image, Platform } from 'react-native';
8
+
9
+ /**
10
+ * A single icon source.
11
+ *
12
+ * - `string`: shorthand for an SF Symbol name on iOS and a drawable resource
13
+ * name on Android.
14
+ * - `{ type: 'sfSymbol' }`: an SF Symbol. iOS only; ignored on Android.
15
+ * - `{ type: 'drawable' }`: a drawable from the app's `res/drawable`.
16
+ * Android only; ignored on iOS.
17
+ * - `{ type: 'image' }`: an image asset (`require('./icon.png')`) or a
18
+ * `{ uri }` source. Works on both platforms. Images are drawn as tinted
19
+ * templates unless `tinted` is `false`.
20
+ */
21
+
22
+ /**
23
+ * An icon: a single source used on both platforms, or a per-platform pair so
24
+ * callers don't need to branch on `Platform.OS`.
25
+ */
26
+
27
+ /** The flat icon fields the native specs expect. */
28
+
29
+ export const NO_ICON = {
30
+ iconType: '',
31
+ iconName: '',
32
+ iconUri: '',
33
+ iconScale: 1,
34
+ iconTinted: 'true'
35
+ };
36
+ function pickIconSource(icon) {
37
+ if (icon === undefined || typeof icon === 'string' || 'type' in icon) {
38
+ return icon;
39
+ }
40
+ return Platform.OS === 'ios' ? icon.ios : icon.android;
41
+ }
42
+
43
+ /**
44
+ * Flattens the public icon shape into the strings native expects, dropping
45
+ * sources that don't apply to the current platform.
46
+ */
47
+ export function resolveIcon(icon) {
48
+ const source = pickIconSource(icon);
49
+ if (source === undefined) return NO_ICON;
50
+ if (typeof source === 'string') {
51
+ if (source.length === 0) return NO_ICON;
52
+ return {
53
+ ...NO_ICON,
54
+ iconType: Platform.OS === 'ios' ? 'sfSymbol' : 'drawable',
55
+ iconName: source
56
+ };
57
+ }
58
+ switch (source.type) {
59
+ case 'sfSymbol':
60
+ return Platform.OS === 'ios' ? {
61
+ ...NO_ICON,
62
+ iconType: 'sfSymbol',
63
+ iconName: source.name
64
+ } : NO_ICON;
65
+ case 'drawable':
66
+ return Platform.OS === 'android' ? {
67
+ ...NO_ICON,
68
+ iconType: 'drawable',
69
+ iconName: source.name
70
+ } : NO_ICON;
71
+ case 'image':
72
+ {
73
+ const resolved = Image.resolveAssetSource(source.source);
74
+ if (!resolved?.uri) return NO_ICON;
75
+ return {
76
+ iconType: 'image',
77
+ iconName: '',
78
+ iconUri: resolved.uri,
79
+ iconScale: resolved.scale > 0 ? resolved.scale : 1,
80
+ iconTinted: source.tinted === false ? 'false' : 'true'
81
+ };
82
+ }
83
+ default:
84
+ return NO_ICON;
85
+ }
86
+ }
87
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Image","Platform","NO_ICON","iconType","iconName","iconUri","iconScale","iconTinted","pickIconSource","icon","undefined","OS","ios","android","resolveIcon","source","length","type","name","resolved","resolveAssetSource","uri","scale","tinted"],"sourceRoot":"../../src","sources":["icons.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,SACEA,KAAK,EACLC,QAAQ,QAGH,cAAc;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;;AAQA;;AAcA,OAAO,MAAMC,OAAyB,GAAG;EACvCC,QAAQ,EAAE,EAAE;EACZC,QAAQ,EAAE,EAAE;EACZC,OAAO,EAAE,EAAE;EACXC,SAAS,EAAE,CAAC;EACZC,UAAU,EAAE;AACd,CAAC;AAED,SAASC,cAAcA,CACrBC,IAA8B,EACE;EAChC,IAAIA,IAAI,KAAKC,SAAS,IAAI,OAAOD,IAAI,KAAK,QAAQ,IAAI,MAAM,IAAIA,IAAI,EAAE;IACpE,OAAOA,IAAI;EACb;EACA,OAAOR,QAAQ,CAACU,EAAE,KAA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UAAU,EAAEQ,MAAM,CAACQ,MAAM,KAAK,KAAK,GAAG,OAAO,GAAG;QAClD,CAAC;MACH;IACA;MACE,OAAOrB,OAAO;EAClB;AACF","ignoreList":[]}
@@ -4,7 +4,13 @@ export * from "./DatePicker.js";
4
4
  export * from "./SelectionMenu.js";
5
5
  export * from "./ContextMenu.js";
6
6
  export * from "./SegmentedControl.js";
7
+ export * from "./Button.js";
8
+ export * from "./ButtonGroup.js";
9
+ export * from "./FloatingToolbar.js";
7
10
  export * from "./LiquidGlass.js";
11
+ export * from "./TextField.js";
12
+ export * from "./icons.js";
13
+ export * from "./labelStyle.js";
8
14
  export * from "./sharedTypes.js";
9
15
  export * from "./NativeTheme.js";
10
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,iBAAc;AAC5B,cAAc,oBAAiB;AAC/B,cAAc,kBAAe;AAC7B,cAAc,uBAAoB;AAClC,cAAc,kBAAe;AAC7B,cAAc,kBAAe;AAC7B,cAAc,kBAAe","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,iBAAc;AAC5B,cAAc,oBAAiB;AAC/B,cAAc,kBAAe;AAC7B,cAAc,uBAAoB;AAClC,cAAc,aAAU;AACxB,cAAc,kBAAe;AAC7B,cAAc,sBAAmB;AACjC,cAAc,kBAAe;AAC7B,cAAc,gBAAa;AAC3B,cAAc,YAAS;AACvB,cAAc,iBAAc;AAC5B,cAAc,kBAAe;AAC7B,cAAc,kBAAe","ignoreList":[]}
@@ -41,6 +41,20 @@ export const ContextMenu = ({
41
41
 
42
42
  export const SegmentedControl = _props => null;
43
43
 
44
+ // ============================================================================
45
+ // Button, ButtonGroup, FloatingToolbar
46
+ // ============================================================================
47
+
48
+ export const Button = _props => null;
49
+ export const ButtonGroup = _props => null;
50
+ export const FloatingToolbar = ({
51
+ children
52
+ }) => {
53
+ return /*#__PURE__*/_jsx(_Fragment, {
54
+ children: children
55
+ });
56
+ };
57
+
44
58
  // ============================================================================
45
59
  // LiquidGlass
46
60
  // ============================================================================
@@ -54,6 +68,20 @@ export const LiquidGlass = ({
54
68
  };
55
69
  export const isLiquidGlassSupported = false;
56
70
 
71
+ // ============================================================================
72
+ // TextField
73
+ // ============================================================================
74
+
75
+ export const TextField = /*#__PURE__*/React.forwardRef(function TextFieldComponent(_props, ref) {
76
+ React.useImperativeHandle(ref, () => ({
77
+ focus: () => {},
78
+ blur: () => {},
79
+ clear: () => {},
80
+ isFocused: () => false
81
+ }));
82
+ return null;
83
+ });
84
+
57
85
  // ============================================================================
58
86
  // Native theme
59
87
  // ============================================================================
@@ -1 +1 @@
1
- {"version":3,"names":["React","Fragment","_Fragment","jsx","_jsx","DatePicker","_props","SelectionMenu","ContextMenu","children","SegmentedControl","LiquidGlass","isLiquidGlassSupported","setNativeTheme","_theme","useNativeTheme"],"sourceRoot":"../../src","sources":["index.web.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;;AAIzB;AACA;AACA;;AAMA;AACA;AACA;AAAA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAoBA,OAAO,MAAMC,UAAU,GACrBC,MAAuB,IACO,IAAI;;AAEpC;AACA;AACA;;AAoBA,OAAO,MAAMC,aAAa,GACxBD,MAA0B,IACI,IAAI;;AAEpC;AACA;AACA;;AAgCA,OAAO,MAAME,WAAW,GAAGA,CAAC;EAC1BC;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;;AAmDA,OAAO,MAAMC,gBAAgB,GAC3BJ,MAA6B,IACC,IAAI;;AAEpC;AACA;AACA;;AASA,OAAO,MAAMK,WAAW,GAAGA,CAAC;EAC1BF;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;AAED,OAAO,MAAMG,sBAAsB,GAAG,KAAK;;AAE3C;AACA;AACA;;AAQA,OAAO,MAAMC,cAAc,GAAIC,MAA0B,IAAW,CAAC,CAAC;AAEtE,OAAO,MAAMC,cAAc,GACzBD,MAAsC,IAC7B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","Fragment","_Fragment","jsx","_jsx","DatePicker","_props","SelectionMenu","ContextMenu","children","SegmentedControl","Button","ButtonGroup","FloatingToolbar","LiquidGlass","isLiquidGlassSupported","TextField","forwardRef","TextFieldComponent","ref","useImperativeHandle","focus","blur","clear","isFocused","setNativeTheme","_theme","useNativeTheme"],"sourceRoot":"../../src","sources":["index.web.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;;AAMzB;AACA;AACA;;AAMA;AACA;AACA;AAAA,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AAoBA,OAAO,MAAMC,UAAU,GACrBC,MAAuB,IACO,IAAI;;AAEpC;AACA;AACA;;AAoBA,OAAO,MAAMC,aAAa,GACxBD,MAA0B,IACI,IAAI;;AAEpC;AACA;AACA;;AAgCA,OAAO,MAAME,WAAW,GAAGA,CAAC;EAC1BC;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;;AAmDA,OAAO,MAAMC,gBAAgB,GAC3BJ,MAA6B,IACC,IAAI;;AAEpC;AACA;AACA;;AA6BA,OAAO,MAAMK,MAAM,GAAIL,MAAmB,IAAgC,IAAI;AAgC9E,OAAO,MAAMM,WAAW,GACtBN,MAAwB,IACM,IAAI;AAapC,OAAO,MAAMO,eAAe,GAAGA,CAAC;EAC9BJ;AACoB,CAAC,KAAgC;EACrD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;;AAED;AACA;AACA;;AASA,OAAO,MAAMK,WAAW,GAAGA,CAAC;EAC1BL;AACgB,CAAC,KAAgC;EACjD,oBAAOL,IAAA,CAAAF,SAAA;IAAAO,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB,CAAC;AAED,OAAO,MAAMM,sBAAsB,GAAG,KAAK;;AAE3C;AACA;AACA;;AA8FA,OAAO,MAAMC,SAAS,gBAAGhB,KAAK,CAACiB,UAAU,CACvC,SAASC,kBAAkBA,CAACZ,MAAM,EAAEa,GAAG,EAA6B;EAClEnB,KAAK,CAACoB,mBAAmB,CAACD,GAAG,EAAE,OAAO;IACpCE,KAAK,EAAEA,CAAA,KAAM,CAAC,CAAC;IACfC,IAAI,EAAEA,CAAA,KAAM,CAAC,CAAC;IACdC,KAAK,EAAEA,CAAA,KAAM,CAAC,CAAC;IACfC,SAAS,EAAEA,CAAA,KAAM;EACnB,CAAC,CAAC,CAAC;EACH,OAAO,IAAI;AACb,CACF,CAAC;;AAED;AACA;AACA;;AAQA,OAAO,MAAMC,cAAc,GAAIC,MAA0B,IAAW,CAAC,CAAC;AAEtE,OAAO,MAAMC,cAAc,GACzBD,MAAsC,IAC7B,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ // labelStyle.ts
4
+ //
5
+ // Label font props shared by SegmentedControl, Button and ButtonGroup.
6
+
7
+ /**
8
+ * Font for a control's labels. Each field falls back to the platform default.
9
+ */
10
+
11
+ /** The flat font fields the native specs expect; empty / 0 = default. */
12
+
13
+ /** Normalizes a label font for native; `undefined` keeps the platform font. */
14
+ export function normalizeLabelStyle(labelStyle) {
15
+ if (!labelStyle) return undefined;
16
+ return {
17
+ fontFamily: labelStyle.fontFamily ?? '',
18
+ fontSize: labelStyle.fontSize ?? 0,
19
+ fontWeight: labelStyle.fontWeight === undefined ? '' : String(labelStyle.fontWeight),
20
+ fontStyle: labelStyle.fontStyle ?? ''
21
+ };
22
+ }
23
+ //# sourceMappingURL=labelStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeLabelStyle","labelStyle","undefined","fontFamily","fontSize","fontWeight","String","fontStyle"],"sourceRoot":"../../src","sources":["labelStyle.ts"],"mappings":";;AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;;AAQA;AACA,OAAO,SAASA,mBAAmBA,CACjCC,UAAkC,EACJ;EAC9B,IAAI,CAACA,UAAU,EAAE,OAAOC,SAAS;EACjC,OAAO;IACLC,UAAU,EAAEF,UAAU,CAACE,UAAU,IAAI,EAAE;IACvCC,QAAQ,EAAEH,UAAU,CAACG,QAAQ,IAAI,CAAC;IAClCC,UAAU,EACRJ,UAAU,CAACI,UAAU,KAAKH,SAAS,GAAG,EAAE,GAAGI,MAAM,CAACL,UAAU,CAACI,UAAU,CAAC;IAC1EE,SAAS,EAAEN,UAAU,CAACM,SAAS,IAAI;EACrC,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=reactNativeInternals.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["reactNativeInternals.d.ts"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"sidebars.d.ts","sourceRoot":"","sources":["../../../../docs/sidebars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,QAAA,MAAM,QAAQ,EAAE,cAwBf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"sidebars.d.ts","sourceRoot":"","sources":["../../../../docs/sidebars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,QAAA,MAAM,QAAQ,EAAE,cA4Bf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,76 @@
1
+ import React from 'react';
2
+ import type { ColorValue, ViewProps } from 'react-native';
3
+ import { type PlatformIcon } from './icons';
4
+ import { type LabelStyle } from './labelStyle';
5
+ import type { AndroidMaterialStyle } from './sharedTypes';
6
+ /**
7
+ * Emphasis of the button, from highest to lowest.
8
+ *
9
+ * | Variant | Android (Material 3 Expressive) | iOS (`UIButton.Configuration`) |
10
+ * | ---------- | ------------------------------- | ------------------------------ |
11
+ * | `filled` | Filled button | `.filled()` |
12
+ * | `tonal` | Filled tonal button | `.tinted()` |
13
+ * | `outlined` | Outlined button | `.bordered()` |
14
+ * | `text` | Text button | `.plain()` |
15
+ * | `elevated` | Elevated button | `.gray()` |
16
+ */
17
+ export type ButtonVariant = 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated';
18
+ /**
19
+ * Button size. Material 3 Expressive defines five sizes; iOS maps them onto
20
+ * `UIButton.Configuration.Size` (`xsmall` → mini, `xlarge` → large).
21
+ */
22
+ export type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
23
+ /**
24
+ * Corner shape. `round` is a pill; `square` keeps rounded corners. Unset
25
+ * means the platform default (round on Android, dynamic on iOS).
26
+ */
27
+ export type ButtonShape = 'round' | 'square';
28
+ export interface ButtonProps extends ViewProps {
29
+ /** Button text. Omit for an icon-only button. */
30
+ label?: string;
31
+ /** Icon shown before the label, or alone when there is no label. */
32
+ icon?: PlatformIcon;
33
+ /** Emphasis. Default: `'filled'`. See {@link ButtonVariant}. */
34
+ variant?: ButtonVariant;
35
+ /** Size. Default: `'small'`, the Material 3 default. */
36
+ size?: ButtonSize;
37
+ /** Corner shape. Default: platform default. */
38
+ shape?: ButtonShape;
39
+ /** Whether the button is disabled. */
40
+ disabled?: boolean;
41
+ /**
42
+ * Container (background) color.
43
+ * Android: `backgroundTint`. iOS: `baseBackgroundColor`.
44
+ */
45
+ color?: ColorValue;
46
+ /**
47
+ * Label and icon color.
48
+ * Android: text color and `iconTint`. iOS: `baseForegroundColor`.
49
+ */
50
+ tintColor?: ColorValue;
51
+ /** Label font. */
52
+ labelStyle?: LabelStyle;
53
+ /** Screen-reader label. Defaults to `label`. */
54
+ accessibilityLabel?: string;
55
+ /** Called when the button is pressed. */
56
+ onPress?: () => void;
57
+ /**
58
+ * Android-specific configuration
59
+ */
60
+ android?: {
61
+ /** Ripple color shown while pressing. */
62
+ rippleColor?: ColorValue;
63
+ /** Outline color (outlined variant). */
64
+ strokeColor?: ColorValue;
65
+ /**
66
+ * Material style: Material 3 Expressive (default), or the classic
67
+ * Material 3 button, which has one size and shape (`size` and `shape`
68
+ * are ignored).
69
+ */
70
+ material?: AndroidMaterialStyle;
71
+ };
72
+ /** Test identifier */
73
+ testID?: string;
74
+ }
75
+ export declare function Button(props: ButtonProps): React.ReactElement;
76
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GACvB,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7C,MAAM,WAAW,WAAY,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