react-native-platform-components 1.3.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.
- package/README.md +24 -30
- package/android/src/main/java/com/platformcomponents/PCButtonGroupView.kt +498 -0
- package/android/src/main/java/com/platformcomponents/PCButtonGroupViewManager.kt +191 -0
- package/android/src/main/java/com/platformcomponents/PCButtonSupport.kt +127 -0
- package/android/src/main/java/com/platformcomponents/PCButtonView.kt +345 -0
- package/android/src/main/java/com/platformcomponents/PCButtonViewManager.kt +126 -0
- package/android/src/main/java/com/platformcomponents/PCExpressive.kt +107 -0
- package/android/src/main/java/com/platformcomponents/PCFloatingToolbarView.kt +115 -0
- package/android/src/main/java/com/platformcomponents/PCFloatingToolbarViewManager.kt +65 -0
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlView.kt +11 -3
- package/android/src/main/java/com/platformcomponents/PCSegmentedControlViewManager.kt +6 -1
- package/android/src/main/java/com/platformcomponents/PCTextFieldView.kt +1018 -0
- package/android/src/main/java/com/platformcomponents/PCTextFieldViewManager.kt +248 -0
- package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +4 -0
- package/android/src/main/res/values/attrs.xml +13 -0
- package/android/src/main/res/values/styles.xml +183 -0
- package/ios/PCButton.h +10 -0
- package/ios/PCButton.mm +196 -0
- package/ios/PCButtonGroup.h +10 -0
- package/ios/PCButtonGroup.mm +256 -0
- package/ios/PCButtonGroupView.swift +254 -0
- package/ios/PCButtonSupport.swift +141 -0
- package/ios/PCButtonView.swift +155 -0
- package/ios/PCFloatingToolbar.h +10 -0
- package/ios/PCFloatingToolbar.mm +76 -0
- package/ios/PCFloatingToolbarView.swift +95 -0
- package/ios/PCTextField.h +10 -0
- package/ios/PCTextField.mm +391 -0
- package/ios/PCTextFieldView.swift +1012 -0
- package/lib/commonjs/Button.js +77 -0
- package/lib/commonjs/Button.js.map +1 -0
- package/lib/commonjs/ButtonGroup.js +99 -0
- package/lib/commonjs/ButtonGroup.js.map +1 -0
- package/lib/commonjs/ButtonGroupNativeComponent.ts +121 -0
- package/lib/commonjs/ButtonNativeComponent.ts +76 -0
- package/lib/commonjs/FloatingToolbar.js +69 -0
- package/lib/commonjs/FloatingToolbar.js.map +1 -0
- package/lib/commonjs/FloatingToolbarNativeComponent.ts +31 -0
- package/lib/commonjs/SegmentedControl.js +11 -85
- package/lib/commonjs/SegmentedControl.js.map +1 -1
- package/lib/commonjs/SegmentedControlNativeComponent.ts +3 -0
- package/lib/commonjs/TextField.js +195 -0
- package/lib/commonjs/TextField.js.map +1 -0
- package/lib/commonjs/TextFieldNativeComponent.ts +218 -0
- package/lib/commonjs/focusRegistry.js +78 -0
- package/lib/commonjs/focusRegistry.js.map +1 -0
- package/lib/commonjs/icons.js +92 -0
- package/lib/commonjs/icons.js.map +1 -0
- package/lib/commonjs/index.js +66 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +32 -2
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/labelStyle.js +27 -0
- package/lib/commonjs/labelStyle.js.map +1 -0
- package/lib/commonjs/reactNativeInternals.d.js +2 -0
- package/lib/commonjs/reactNativeInternals.d.js.map +1 -0
- package/lib/module/Button.js +70 -0
- package/lib/module/Button.js.map +1 -0
- package/lib/module/ButtonGroup.js +92 -0
- package/lib/module/ButtonGroup.js.map +1 -0
- package/lib/module/ButtonGroupNativeComponent.ts +121 -0
- package/lib/module/ButtonNativeComponent.ts +76 -0
- package/lib/module/FloatingToolbar.js +62 -0
- package/lib/module/FloatingToolbar.js.map +1 -0
- package/lib/module/FloatingToolbarNativeComponent.ts +31 -0
- package/lib/module/SegmentedControl.js +12 -87
- package/lib/module/SegmentedControl.js.map +1 -1
- package/lib/module/SegmentedControlNativeComponent.ts +3 -0
- package/lib/module/TextField.js +189 -0
- package/lib/module/TextField.js.map +1 -0
- package/lib/module/TextFieldNativeComponent.ts +218 -0
- package/lib/module/focusRegistry.js +74 -0
- package/lib/module/focusRegistry.js.map +1 -0
- package/lib/module/icons.js +87 -0
- package/lib/module/icons.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +28 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/labelStyle.js +23 -0
- package/lib/module/labelStyle.js.map +1 -0
- package/lib/module/reactNativeInternals.d.js +2 -0
- package/lib/module/reactNativeInternals.d.js.map +1 -0
- package/lib/typescript/commonjs/docs/sidebars.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Button.d.ts +76 -0
- package/lib/typescript/commonjs/src/Button.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ButtonGroup.d.ts +102 -0
- package/lib/typescript/commonjs/src/ButtonGroup.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts +93 -0
- package/lib/typescript/commonjs/src/ButtonGroupNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts +57 -0
- package/lib/typescript/commonjs/src/ButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/FloatingToolbar.d.ts +45 -0
- package/lib/typescript/commonjs/src/FloatingToolbar.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts +24 -0
- package/lib/typescript/commonjs/src/FloatingToolbarNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts +17 -46
- package/lib/typescript/commonjs/src/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts +2 -0
- package/lib/typescript/commonjs/src/SegmentedControlNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/TextField.d.ts +174 -0
- package/lib/typescript/commonjs/src/TextField.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts +162 -0
- package/lib/typescript/commonjs/src/TextFieldNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/focusRegistry.d.ts +13 -0
- package/lib/typescript/commonjs/src/focusRegistry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/icons.d.ts +52 -0
- package/lib/typescript/commonjs/src/icons.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.web.d.ts +121 -0
- package/lib/typescript/commonjs/src/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/labelStyle.d.ts +20 -0
- package/lib/typescript/commonjs/src/labelStyle.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/sharedTypes.d.ts +6 -1
- package/lib/typescript/commonjs/src/sharedTypes.d.ts.map +1 -1
- package/lib/typescript/module/docs/sidebars.d.ts.map +1 -1
- package/lib/typescript/module/src/Button.d.ts +76 -0
- package/lib/typescript/module/src/Button.d.ts.map +1 -0
- package/lib/typescript/module/src/ButtonGroup.d.ts +102 -0
- package/lib/typescript/module/src/ButtonGroup.d.ts.map +1 -0
- package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts +93 -0
- package/lib/typescript/module/src/ButtonGroupNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/ButtonNativeComponent.d.ts +57 -0
- package/lib/typescript/module/src/ButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/FloatingToolbar.d.ts +45 -0
- package/lib/typescript/module/src/FloatingToolbar.d.ts.map +1 -0
- package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts +24 -0
- package/lib/typescript/module/src/FloatingToolbarNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/SegmentedControl.d.ts +17 -46
- package/lib/typescript/module/src/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts +2 -0
- package/lib/typescript/module/src/SegmentedControlNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/TextField.d.ts +174 -0
- package/lib/typescript/module/src/TextField.d.ts.map +1 -0
- package/lib/typescript/module/src/TextFieldNativeComponent.d.ts +162 -0
- package/lib/typescript/module/src/TextFieldNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/focusRegistry.d.ts +13 -0
- package/lib/typescript/module/src/focusRegistry.d.ts.map +1 -0
- package/lib/typescript/module/src/icons.d.ts +52 -0
- package/lib/typescript/module/src/icons.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +6 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.web.d.ts +121 -0
- package/lib/typescript/module/src/index.web.d.ts.map +1 -1
- package/lib/typescript/module/src/labelStyle.d.ts +20 -0
- package/lib/typescript/module/src/labelStyle.d.ts.map +1 -0
- package/lib/typescript/module/src/sharedTypes.d.ts +6 -1
- package/lib/typescript/module/src/sharedTypes.d.ts.map +1 -1
- package/package.json +25 -4
- package/react-native.config.js +3 -0
- package/shared/PCButtonComponentDescriptors-custom.h +22 -0
- package/shared/PCButtonGroupComponentDescriptors-custom.h +22 -0
- package/shared/PCButtonGroupShadowNode-custom.cpp +48 -0
- package/shared/PCButtonGroupShadowNode-custom.h +55 -0
- package/shared/PCButtonGroupState-custom.h +61 -0
- package/shared/PCButtonShadowNode-custom.cpp +48 -0
- package/shared/PCButtonShadowNode-custom.h +55 -0
- package/shared/PCButtonState-custom.h +61 -0
- package/shared/PCTextFieldComponentDescriptors-custom.h +22 -0
- package/shared/PCTextFieldShadowNode-custom.cpp +47 -0
- package/shared/PCTextFieldShadowNode-custom.h +55 -0
- package/shared/PCTextFieldState-custom.h +61 -0
- package/shared/react/renderer/components/PlatformComponentsViewSpec/ComponentDescriptors.h +3 -0
- package/src/Button.tsx +144 -0
- package/src/ButtonGroup.tsx +233 -0
- package/src/ButtonGroupNativeComponent.ts +121 -0
- package/src/ButtonNativeComponent.ts +76 -0
- package/src/FloatingToolbar.tsx +113 -0
- package/src/FloatingToolbarNativeComponent.ts +31 -0
- package/src/SegmentedControl.tsx +26 -118
- package/src/SegmentedControlNativeComponent.ts +3 -0
- package/src/TextField.tsx +494 -0
- package/src/TextFieldNativeComponent.ts +218 -0
- package/src/focusRegistry.ts +89 -0
- package/src/icons.ts +116 -0
- package/src/index.tsx +6 -0
- package/src/index.web.tsx +194 -0
- package/src/labelStyle.ts +36 -0
- package/src/reactNativeInternals.d.ts +22 -0
- package/src/sharedTypes.ts +7 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { ColorValue, StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
4
|
+
import type { PlatformIcon } from './icons.js';
|
|
5
|
+
import type { LabelStyle } from './labelStyle.js';
|
|
4
6
|
export type Visible = 'open' | 'closed';
|
|
5
7
|
export type Presentation = 'modal' | 'embedded';
|
|
6
8
|
export type AndroidMaterialMode = 'system' | 'm3';
|
|
@@ -116,6 +118,64 @@ export interface SegmentedControlProps extends ViewProps {
|
|
|
116
118
|
android?: Record<string, unknown>;
|
|
117
119
|
}
|
|
118
120
|
export declare const SegmentedControl: (_props: SegmentedControlProps) => React.ReactElement | null;
|
|
121
|
+
export type { PlatformIcon, PlatformIconSource, NativeIconFields, } from './icons.js';
|
|
122
|
+
export type { LabelStyle, NativeLabelStyle } from './labelStyle.js';
|
|
123
|
+
export type ButtonVariant = 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated';
|
|
124
|
+
export type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
125
|
+
export type ButtonShape = 'round' | 'square';
|
|
126
|
+
export interface ButtonProps extends ViewProps {
|
|
127
|
+
label?: string;
|
|
128
|
+
icon?: PlatformIcon;
|
|
129
|
+
variant?: ButtonVariant;
|
|
130
|
+
size?: ButtonSize;
|
|
131
|
+
shape?: ButtonShape;
|
|
132
|
+
disabled?: boolean;
|
|
133
|
+
color?: ColorValue;
|
|
134
|
+
tintColor?: ColorValue;
|
|
135
|
+
labelStyle?: LabelStyle;
|
|
136
|
+
accessibilityLabel?: string;
|
|
137
|
+
onPress?: () => void;
|
|
138
|
+
android?: Record<string, unknown>;
|
|
139
|
+
}
|
|
140
|
+
export declare const Button: (_props: ButtonProps) => React.ReactElement | null;
|
|
141
|
+
export type ButtonGroupSelection = 'none' | 'single' | 'multiple';
|
|
142
|
+
export type ButtonGroupOverflow = 'none' | 'menu' | 'wrap';
|
|
143
|
+
export interface ButtonGroupButtonProps {
|
|
144
|
+
label?: string;
|
|
145
|
+
value: string;
|
|
146
|
+
disabled?: boolean;
|
|
147
|
+
icon?: PlatformIcon;
|
|
148
|
+
accessibilityLabel?: string;
|
|
149
|
+
}
|
|
150
|
+
export interface ButtonGroupProps extends ViewProps {
|
|
151
|
+
buttons: readonly ButtonGroupButtonProps[];
|
|
152
|
+
variant?: ButtonVariant;
|
|
153
|
+
size?: ButtonSize;
|
|
154
|
+
shape?: ButtonShape;
|
|
155
|
+
connected?: boolean;
|
|
156
|
+
spacing?: number;
|
|
157
|
+
selection?: ButtonGroupSelection;
|
|
158
|
+
selectedValues?: readonly string[];
|
|
159
|
+
selectionRequired?: boolean;
|
|
160
|
+
disabled?: boolean;
|
|
161
|
+
color?: ColorValue;
|
|
162
|
+
tintColor?: ColorValue;
|
|
163
|
+
labelStyle?: LabelStyle;
|
|
164
|
+
onPress?: (value: string, index: number) => void;
|
|
165
|
+
onSelectionChange?: (values: string[]) => void;
|
|
166
|
+
android?: Record<string, unknown>;
|
|
167
|
+
}
|
|
168
|
+
export declare const ButtonGroup: (_props: ButtonGroupProps) => React.ReactElement | null;
|
|
169
|
+
export type FloatingToolbarIOSEffect = 'regular' | 'clear';
|
|
170
|
+
export type FloatingToolbarAndroidVariant = 'standard' | 'vibrant';
|
|
171
|
+
export interface FloatingToolbarProps extends ViewProps {
|
|
172
|
+
orientation?: 'horizontal' | 'vertical';
|
|
173
|
+
color?: ColorValue;
|
|
174
|
+
ios?: Record<string, unknown>;
|
|
175
|
+
android?: Record<string, unknown>;
|
|
176
|
+
children?: ReactNode;
|
|
177
|
+
}
|
|
178
|
+
export declare const FloatingToolbar: ({ children, }: FloatingToolbarProps) => React.ReactElement | null;
|
|
119
179
|
export interface LiquidGlassProps extends ViewProps {
|
|
120
180
|
cornerRadius?: number;
|
|
121
181
|
ios?: Record<string, unknown>;
|
|
@@ -124,6 +184,67 @@ export interface LiquidGlassProps extends ViewProps {
|
|
|
124
184
|
}
|
|
125
185
|
export declare const LiquidGlass: ({ children, }: LiquidGlassProps) => React.ReactElement | null;
|
|
126
186
|
export declare const isLiquidGlassSupported = false;
|
|
187
|
+
export type TextFieldKeyboardType = 'default' | 'number-pad' | 'decimal-pad' | 'numeric' | 'email-address' | 'phone-pad' | 'url' | 'ascii-capable' | 'numbers-and-punctuation' | 'name-phone-pad' | 'twitter' | 'web-search' | 'visible-password';
|
|
188
|
+
export type TextFieldReturnKeyType = 'default' | 'done' | 'go' | 'next' | 'search' | 'send' | 'none' | 'previous';
|
|
189
|
+
export type TextFieldAutoComplete = 'off' | 'username' | 'password' | 'new-password' | 'one-time-code' | 'email' | 'name' | 'given-name' | 'family-name' | 'tel' | 'street-address' | 'postal-code' | 'country' | 'cc-number' | 'cc-exp' | 'cc-csc' | 'url';
|
|
190
|
+
export type TextFieldAutoCapitalize = 'none' | 'sentences' | 'words' | 'characters';
|
|
191
|
+
export type TextFieldClearButtonMode = 'never' | 'while-editing' | 'unless-editing' | 'always';
|
|
192
|
+
export type TextFieldIOSChoice = 'default' | 'yes' | 'no';
|
|
193
|
+
export type TextFieldEvent = {
|
|
194
|
+
nativeEvent: {
|
|
195
|
+
text: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
export type TextFieldChangeEvent = {
|
|
199
|
+
nativeEvent: {
|
|
200
|
+
text: string;
|
|
201
|
+
eventCount: number;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
export interface TextFieldRef {
|
|
205
|
+
focus(): void;
|
|
206
|
+
blur(): void;
|
|
207
|
+
clear(): void;
|
|
208
|
+
isFocused(): boolean;
|
|
209
|
+
}
|
|
210
|
+
export interface TextFieldProps extends Omit<ViewProps, 'onFocus' | 'onBlur' | 'children'> {
|
|
211
|
+
value?: string;
|
|
212
|
+
defaultValue?: string;
|
|
213
|
+
onChangeText?: (text: string) => void;
|
|
214
|
+
onChange?: (event: TextFieldChangeEvent) => void;
|
|
215
|
+
onFocus?: (event: TextFieldEvent) => void;
|
|
216
|
+
onBlur?: (event: TextFieldEvent) => void;
|
|
217
|
+
onSubmitEditing?: (event: TextFieldEvent) => void;
|
|
218
|
+
label?: string;
|
|
219
|
+
placeholder?: string;
|
|
220
|
+
supportingText?: string;
|
|
221
|
+
error?: boolean | string;
|
|
222
|
+
prefix?: string;
|
|
223
|
+
suffix?: string;
|
|
224
|
+
leadingIcon?: PlatformIcon;
|
|
225
|
+
trailingIcon?: PlatformIcon;
|
|
226
|
+
onTrailingIconPress?: () => void;
|
|
227
|
+
clearButtonMode?: TextFieldClearButtonMode;
|
|
228
|
+
passwordToggle?: boolean;
|
|
229
|
+
showCharacterCount?: boolean;
|
|
230
|
+
maxLength?: number;
|
|
231
|
+
keyboardType?: TextFieldKeyboardType;
|
|
232
|
+
returnKeyType?: TextFieldReturnKeyType;
|
|
233
|
+
autoCapitalize?: TextFieldAutoCapitalize;
|
|
234
|
+
autoCorrect?: boolean;
|
|
235
|
+
secureTextEntry?: boolean;
|
|
236
|
+
multiline?: boolean;
|
|
237
|
+
editable?: boolean;
|
|
238
|
+
autoFocus?: boolean;
|
|
239
|
+
selectTextOnFocus?: boolean;
|
|
240
|
+
autoComplete?: TextFieldAutoComplete;
|
|
241
|
+
keyboardAppearance?: 'default' | 'light' | 'dark';
|
|
242
|
+
textStyle?: LabelStyle;
|
|
243
|
+
accessibilityLabel?: string;
|
|
244
|
+
ios?: Record<string, unknown>;
|
|
245
|
+
android?: Record<string, unknown>;
|
|
246
|
+
}
|
|
247
|
+
export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextFieldRef>>;
|
|
127
248
|
export type NativeTheme = {
|
|
128
249
|
colors: {
|
|
129
250
|
primary: ColorValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/index.web.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/index.web.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAM/C,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAMlD,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,YAAY,CAAC,EAAE,MAA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5B,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,kBAAkB,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAClD,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,SAAS,qFAUrB,CAAC;AAMF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE;QACN,OAAO,EAAE,UAAU,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,WAAW,GAAG,IAAI,KAAG,IAAU,CAAC;AAEvE,eAAO,MAAM,cAAc,GACzB,QAAQ,WAAW,GAAG,IAAI,GAAG,SAAS,KACrC,IAAU,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TextStyle } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Font for a control's labels. Each field falls back to the platform default.
|
|
4
|
+
*/
|
|
5
|
+
export interface LabelStyle {
|
|
6
|
+
fontFamily?: string;
|
|
7
|
+
fontSize?: number;
|
|
8
|
+
fontWeight?: TextStyle['fontWeight'];
|
|
9
|
+
fontStyle?: 'normal' | 'italic';
|
|
10
|
+
}
|
|
11
|
+
/** The flat font fields the native specs expect; empty / 0 = default. */
|
|
12
|
+
export type NativeLabelStyle = {
|
|
13
|
+
fontFamily: string;
|
|
14
|
+
fontSize: number;
|
|
15
|
+
fontWeight: string;
|
|
16
|
+
fontStyle: string;
|
|
17
|
+
};
|
|
18
|
+
/** Normalizes a label font for native; `undefined` keeps the platform font. */
|
|
19
|
+
export declare function normalizeLabelStyle(labelStyle: LabelStyle | undefined): NativeLabelStyle | undefined;
|
|
20
|
+
//# sourceMappingURL=labelStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labelStyle.d.ts","sourceRoot":"","sources":["../../../../src/labelStyle.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACjC;AAED,yEAAyE;AACzE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,gBAAgB,GAAG,SAAS,CAS9B"}
|
|
@@ -3,8 +3,13 @@ import type { BubblingEventHandler } from './codegenTypes.js';
|
|
|
3
3
|
export type Visible = 'open' | 'closed';
|
|
4
4
|
/** Shared presentation mode for pickers/menus. */
|
|
5
5
|
export type Presentation = 'modal' | 'embedded';
|
|
6
|
-
/** Shared Material preference (Android). */
|
|
6
|
+
/** Shared Material preference (Android): the platform widget or the Material one. */
|
|
7
7
|
export type AndroidMaterialMode = 'system' | 'm3';
|
|
8
|
+
/**
|
|
9
|
+
* Shared Material style for the Material-only components (Android):
|
|
10
|
+
* Material 3, or Material 3 Expressive (the default).
|
|
11
|
+
*/
|
|
12
|
+
export type AndroidMaterialStyle = 'm3' | 'expressive';
|
|
8
13
|
/** Common event empty payload type. */
|
|
9
14
|
export type EmptyEvent = Readonly<{}>;
|
|
10
15
|
/** Convenience alias (optional). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTypes.d.ts","sourceRoot":"","sources":["../../../../src/sharedTypes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAgB,CAAC;AAE3D,0CAA0C;AAC1C,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExC,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhD,
|
|
1
|
+
{"version":3,"file":"sharedTypes.d.ts","sourceRoot":"","sources":["../../../../src/sharedTypes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAgB,CAAC;AAE3D,0CAA0C;AAC1C,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExC,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhD,qFAAqF;AACrF,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,YAAY,CAAC;AAEvD,uCAAuC;AACvC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AAEtC,oCAAoC;AACpC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-platform-components",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Native UI components for React Native
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Native UI components for React Native, the real platform widgets on both iOS and Android: TextField, DatePicker, ContextMenu, SelectionMenu, SegmentedControl, Button, ButtonGroup, FloatingToolbar and LiquidGlass. UIKit and SwiftUI on iOS, Material 3 Expressive on Android. Fabric, TypeScript, Expo config plugin.",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
7
7
|
"browser": "./lib/module/index.web.js",
|
|
@@ -69,7 +69,8 @@
|
|
|
69
69
|
"test": "jest",
|
|
70
70
|
"upgrade:check": "yarn dlx npm-check-updates",
|
|
71
71
|
"upgrade:apply": "yarn dlx npm-check-updates -u && rm -rf node_modules && rm -rf package-lock.json && yarn install",
|
|
72
|
-
"generate:gifs": "./scripts/generate-readme-gifs.sh"
|
|
72
|
+
"generate:gifs": "./scripts/generate-readme-gifs.sh",
|
|
73
|
+
"generate:visuals": "node scripts/visuals/stills.mjs && node scripts/visuals/showreel.mjs"
|
|
73
74
|
},
|
|
74
75
|
"keywords": [
|
|
75
76
|
"react-native",
|
|
@@ -81,6 +82,12 @@
|
|
|
81
82
|
"new-architecture",
|
|
82
83
|
"native-ui",
|
|
83
84
|
"ui-components",
|
|
85
|
+
"textfield",
|
|
86
|
+
"text-field",
|
|
87
|
+
"textinput",
|
|
88
|
+
"text-input",
|
|
89
|
+
"textinputlayout",
|
|
90
|
+
"uitextfield",
|
|
84
91
|
"datepicker",
|
|
85
92
|
"date-picker",
|
|
86
93
|
"time-picker",
|
|
@@ -101,6 +108,16 @@
|
|
|
101
108
|
"segmentedbuttons",
|
|
102
109
|
"uisegmentedcontrol",
|
|
103
110
|
"tabs",
|
|
111
|
+
"button",
|
|
112
|
+
"buttons",
|
|
113
|
+
"button-group",
|
|
114
|
+
"toggle-buttons",
|
|
115
|
+
"floating-toolbar",
|
|
116
|
+
"toolbar",
|
|
117
|
+
"uibutton",
|
|
118
|
+
"material3-expressive",
|
|
119
|
+
"material-3-expressive",
|
|
120
|
+
"expressive",
|
|
104
121
|
"liquid-glass",
|
|
105
122
|
"liquidglass",
|
|
106
123
|
"glass-effect",
|
|
@@ -203,7 +220,11 @@
|
|
|
203
220
|
"PCDatePicker": "PCDatePicker",
|
|
204
221
|
"PCContextMenu": "PCContextMenu",
|
|
205
222
|
"PCSegmentedControl": "PCSegmentedControl",
|
|
206
|
-
"
|
|
223
|
+
"PCButton": "PCButton",
|
|
224
|
+
"PCButtonGroup": "PCButtonGroup",
|
|
225
|
+
"PCFloatingToolbar": "PCFloatingToolbar",
|
|
226
|
+
"PCLiquidGlass": "PCLiquidGlass",
|
|
227
|
+
"PCTextField": "PCTextField"
|
|
207
228
|
}
|
|
208
229
|
}
|
|
209
230
|
},
|
package/react-native.config.js
CHANGED
|
@@ -6,6 +6,9 @@ module.exports = {
|
|
|
6
6
|
'MeasuringPCSelectionMenuComponentDescriptor',
|
|
7
7
|
'MeasuringPCDatePickerComponentDescriptor',
|
|
8
8
|
'MeasuringPCSegmentedControlComponentDescriptor',
|
|
9
|
+
'MeasuringPCButtonComponentDescriptor',
|
|
10
|
+
'MeasuringPCButtonGroupComponentDescriptor',
|
|
11
|
+
'MeasuringPCTextFieldComponentDescriptor',
|
|
9
12
|
],
|
|
10
13
|
cmakeListsPath: 'src/main/jni/CMakeLists.txt',
|
|
11
14
|
},
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
4
|
+
|
|
5
|
+
// Forward declaration to avoid circular includes
|
|
6
|
+
namespace facebook::react {
|
|
7
|
+
class MeasuringPCButtonShadowNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Include the actual shadow node definition
|
|
11
|
+
#include "PCButtonShadowNode-custom.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Custom component descriptor that uses our measuring shadow node
|
|
17
|
+
* instead of the generated one.
|
|
18
|
+
*/
|
|
19
|
+
using MeasuringPCButtonComponentDescriptor =
|
|
20
|
+
ConcreteComponentDescriptor<MeasuringPCButtonShadowNode>;
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
4
|
+
|
|
5
|
+
// Forward declaration to avoid circular includes
|
|
6
|
+
namespace facebook::react {
|
|
7
|
+
class MeasuringPCButtonGroupShadowNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Include the actual shadow node definition
|
|
11
|
+
#include "PCButtonGroupShadowNode-custom.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Custom component descriptor that uses our measuring shadow node
|
|
17
|
+
* instead of the generated one.
|
|
18
|
+
*/
|
|
19
|
+
using MeasuringPCButtonGroupComponentDescriptor =
|
|
20
|
+
ConcreteComponentDescriptor<MeasuringPCButtonGroupShadowNode>;
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#include "PCButtonGroupShadowNode-custom.h"
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/core/LayoutConstraints.h>
|
|
4
|
+
#include <algorithm>
|
|
5
|
+
|
|
6
|
+
namespace facebook::react {
|
|
7
|
+
|
|
8
|
+
Size MeasuringPCButtonGroupShadowNode::measureContent(
|
|
9
|
+
const LayoutContext& /*layoutContext*/,
|
|
10
|
+
const LayoutConstraints& layoutConstraints) const {
|
|
11
|
+
|
|
12
|
+
// Native measures the actual group and reports its intrinsic size
|
|
13
|
+
const auto& stateData = this->getStateData();
|
|
14
|
+
Float measuredW = stateData.frameSize.width;
|
|
15
|
+
Float measuredH = stateData.frameSize.height;
|
|
16
|
+
|
|
17
|
+
const Float fallbackHeight =
|
|
18
|
+
#ifdef __ANDROID__
|
|
19
|
+
static_cast<Float>(kFallbackHeightAndroid);
|
|
20
|
+
#else
|
|
21
|
+
static_cast<Float>(kFallbackHeightIOS);
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
const bool usingFallback = (measuredH <= 0);
|
|
25
|
+
if (usingFallback) {
|
|
26
|
+
measuredH = fallbackHeight;
|
|
27
|
+
}
|
|
28
|
+
if (measuredW <= 0) {
|
|
29
|
+
measuredW = static_cast<Float>(kFallbackWidth);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const Float kHuge = static_cast<Float>(1.0e9);
|
|
33
|
+
|
|
34
|
+
measuredW = std::max<Float>(measuredW, layoutConstraints.minimumSize.width);
|
|
35
|
+
if (layoutConstraints.maximumSize.width > 0 && layoutConstraints.maximumSize.width < kHuge) {
|
|
36
|
+
measuredW = std::min<Float>(measuredW, layoutConstraints.maximumSize.width);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
measuredH = std::max<Float>(measuredH, layoutConstraints.minimumSize.height);
|
|
40
|
+
// Only clamp to max height if we have real measured data (not fallback)
|
|
41
|
+
if (!usingFallback && layoutConstraints.maximumSize.height > 0 && layoutConstraints.maximumSize.height < kHuge) {
|
|
42
|
+
measuredH = std::min<Float>(measuredH, layoutConstraints.maximumSize.height);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return Size{measuredW, measuredH};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
4
|
+
|
|
5
|
+
// Only include what we need for the shadow node definition
|
|
6
|
+
// Do NOT include ComponentDescriptors.h here to avoid circular dependency
|
|
7
|
+
#include <react/renderer/components/PlatformComponentsViewSpec/EventEmitters.h>
|
|
8
|
+
#include <react/renderer/components/PlatformComponentsViewSpec/Props.h>
|
|
9
|
+
|
|
10
|
+
#include "PCButtonGroupState-custom.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
extern const char PCButtonGroupComponentName[];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Custom ShadowNode for ButtonGroup that supports Yoga measurement.
|
|
18
|
+
*
|
|
19
|
+
* - Native measures the actual group and updates state with frameSize
|
|
20
|
+
* - measureContent() returns the size from state for proper Yoga layout
|
|
21
|
+
* - Falls back to platform-specific defaults if state hasn't been set yet
|
|
22
|
+
*/
|
|
23
|
+
class MeasuringPCButtonGroupShadowNode final : public ConcreteViewShadowNode<
|
|
24
|
+
PCButtonGroupComponentName,
|
|
25
|
+
PCButtonGroupProps,
|
|
26
|
+
PCButtonGroupEventEmitter,
|
|
27
|
+
PCButtonGroupStateFrameSize> {
|
|
28
|
+
public:
|
|
29
|
+
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
|
30
|
+
|
|
31
|
+
// Fallback sizes used when native hasn't reported measurements yet
|
|
32
|
+
// iOS: a row of small UIButtons
|
|
33
|
+
static constexpr float kFallbackHeightIOS = 34.0f;
|
|
34
|
+
|
|
35
|
+
// Android: small Material 3 buttons (40dp) plus their 4dp touch insets
|
|
36
|
+
static constexpr float kFallbackHeightAndroid = 48.0f;
|
|
37
|
+
|
|
38
|
+
static constexpr float kFallbackWidth = 160.0f;
|
|
39
|
+
|
|
40
|
+
static ShadowNodeTraits BaseTraits() {
|
|
41
|
+
auto traits = ConcreteViewShadowNode::BaseTraits();
|
|
42
|
+
traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
|
|
43
|
+
traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
|
|
44
|
+
return traits;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Called by Yoga when it needs the intrinsic size of the component.
|
|
49
|
+
*/
|
|
50
|
+
Size measureContent(
|
|
51
|
+
const LayoutContext& layoutContext,
|
|
52
|
+
const LayoutConstraints& layoutConstraints) const override;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/core/LayoutPrimitives.h>
|
|
4
|
+
#include <memory>
|
|
5
|
+
|
|
6
|
+
#if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
|
|
7
|
+
#include <folly/dynamic.h>
|
|
8
|
+
#include <react/renderer/mapbuffer/MapBuffer.h>
|
|
9
|
+
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Custom state for ButtonGroup that holds the measured frame size from native.
|
|
16
|
+
* The native side measures the actual group and communicates the size to
|
|
17
|
+
* the shadow node for proper Yoga layout.
|
|
18
|
+
*/
|
|
19
|
+
struct PCButtonGroupStateFrameSize {
|
|
20
|
+
using Shared = std::shared_ptr<const PCButtonGroupStateFrameSize>;
|
|
21
|
+
|
|
22
|
+
Size frameSize{}; // {width, height} in points
|
|
23
|
+
|
|
24
|
+
PCButtonGroupStateFrameSize() = default;
|
|
25
|
+
|
|
26
|
+
explicit PCButtonGroupStateFrameSize(Size size) : frameSize(size) {}
|
|
27
|
+
|
|
28
|
+
bool operator==(const PCButtonGroupStateFrameSize& other) const {
|
|
29
|
+
return frameSize.width == other.frameSize.width &&
|
|
30
|
+
frameSize.height == other.frameSize.height;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
bool operator!=(const PCButtonGroupStateFrameSize& other) const {
|
|
34
|
+
return !(*this == other);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#if defined(RN_SERIALIZABLE_STATE) || defined(ANDROID)
|
|
38
|
+
// Required for Android state serialization
|
|
39
|
+
PCButtonGroupStateFrameSize(
|
|
40
|
+
const PCButtonGroupStateFrameSize& previousState,
|
|
41
|
+
folly::dynamic data)
|
|
42
|
+
: frameSize(previousState.frameSize) {
|
|
43
|
+
if (data.isObject()) {
|
|
44
|
+
if (data.count("width") && data.count("height")) {
|
|
45
|
+
frameSize.width = static_cast<Float>(data["width"].asDouble());
|
|
46
|
+
frameSize.height = static_cast<Float>(data["height"].asDouble());
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
folly::dynamic getDynamic() const {
|
|
52
|
+
return folly::dynamic::object("width", frameSize.width)("height", frameSize.height);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
MapBuffer getMapBuffer() const {
|
|
56
|
+
return MapBufferBuilder::EMPTY();
|
|
57
|
+
}
|
|
58
|
+
#endif
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#include "PCButtonShadowNode-custom.h"
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/core/LayoutConstraints.h>
|
|
4
|
+
#include <algorithm>
|
|
5
|
+
|
|
6
|
+
namespace facebook::react {
|
|
7
|
+
|
|
8
|
+
Size MeasuringPCButtonShadowNode::measureContent(
|
|
9
|
+
const LayoutContext& /*layoutContext*/,
|
|
10
|
+
const LayoutConstraints& layoutConstraints) const {
|
|
11
|
+
|
|
12
|
+
// Native measures the actual button and reports its intrinsic size
|
|
13
|
+
const auto& stateData = this->getStateData();
|
|
14
|
+
Float measuredW = stateData.frameSize.width;
|
|
15
|
+
Float measuredH = stateData.frameSize.height;
|
|
16
|
+
|
|
17
|
+
const Float fallbackHeight =
|
|
18
|
+
#ifdef __ANDROID__
|
|
19
|
+
static_cast<Float>(kFallbackHeightAndroid);
|
|
20
|
+
#else
|
|
21
|
+
static_cast<Float>(kFallbackHeightIOS);
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
const bool usingFallback = (measuredH <= 0);
|
|
25
|
+
if (usingFallback) {
|
|
26
|
+
measuredH = fallbackHeight;
|
|
27
|
+
}
|
|
28
|
+
if (measuredW <= 0) {
|
|
29
|
+
measuredW = static_cast<Float>(kFallbackWidth);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const Float kHuge = static_cast<Float>(1.0e9);
|
|
33
|
+
|
|
34
|
+
measuredW = std::max<Float>(measuredW, layoutConstraints.minimumSize.width);
|
|
35
|
+
if (layoutConstraints.maximumSize.width > 0 && layoutConstraints.maximumSize.width < kHuge) {
|
|
36
|
+
measuredW = std::min<Float>(measuredW, layoutConstraints.maximumSize.width);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
measuredH = std::max<Float>(measuredH, layoutConstraints.minimumSize.height);
|
|
40
|
+
// Only clamp to max height if we have real measured data (not fallback)
|
|
41
|
+
if (!usingFallback && layoutConstraints.maximumSize.height > 0 && layoutConstraints.maximumSize.height < kHuge) {
|
|
42
|
+
measuredH = std::min<Float>(measuredH, layoutConstraints.maximumSize.height);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return Size{measuredW, measuredH};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
4
|
+
|
|
5
|
+
// Only include what we need for the shadow node definition
|
|
6
|
+
// Do NOT include ComponentDescriptors.h here to avoid circular dependency
|
|
7
|
+
#include <react/renderer/components/PlatformComponentsViewSpec/EventEmitters.h>
|
|
8
|
+
#include <react/renderer/components/PlatformComponentsViewSpec/Props.h>
|
|
9
|
+
|
|
10
|
+
#include "PCButtonState-custom.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
extern const char PCButtonComponentName[];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Custom ShadowNode for Button that supports Yoga measurement.
|
|
18
|
+
*
|
|
19
|
+
* - Native measures the actual button and updates state with frameSize
|
|
20
|
+
* - measureContent() returns the size from state for proper Yoga layout
|
|
21
|
+
* - Falls back to platform-specific defaults if state hasn't been set yet
|
|
22
|
+
*/
|
|
23
|
+
class MeasuringPCButtonShadowNode final : public ConcreteViewShadowNode<
|
|
24
|
+
PCButtonComponentName,
|
|
25
|
+
PCButtonProps,
|
|
26
|
+
PCButtonEventEmitter,
|
|
27
|
+
PCButtonStateFrameSize> {
|
|
28
|
+
public:
|
|
29
|
+
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
|
30
|
+
|
|
31
|
+
// Fallback sizes used when native hasn't reported measurements yet
|
|
32
|
+
// iOS UIButton.Configuration small size
|
|
33
|
+
static constexpr float kFallbackHeightIOS = 34.0f;
|
|
34
|
+
|
|
35
|
+
// Android Material 3 small button (40dp) plus its 4dp touch insets
|
|
36
|
+
static constexpr float kFallbackHeightAndroid = 48.0f;
|
|
37
|
+
|
|
38
|
+
static constexpr float kFallbackWidth = 64.0f;
|
|
39
|
+
|
|
40
|
+
static ShadowNodeTraits BaseTraits() {
|
|
41
|
+
auto traits = ConcreteViewShadowNode::BaseTraits();
|
|
42
|
+
traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
|
|
43
|
+
traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
|
|
44
|
+
return traits;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Called by Yoga when it needs the intrinsic size of the component.
|
|
49
|
+
*/
|
|
50
|
+
Size measureContent(
|
|
51
|
+
const LayoutContext& layoutContext,
|
|
52
|
+
const LayoutConstraints& layoutConstraints) const override;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace facebook::react
|