File tree Expand file tree Collapse file tree 5 files changed +18
-9
lines changed Expand file tree Collapse file tree 5 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 11import { type PropsWithChildren } from "react" ;
22import { SwiftUIParentIdProvider } from "../contexts" ;
33import { useSwiftUINode } from "../hooks" ;
4- import type { FunctionComponentWithId } from "../types" ;
4+ import type { FunctionComponentWithId , NativeViewStyle } from "../types" ;
55
66// https://developer.apple.com/documentation/swiftui/form
77
8- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
9- export type NativeFormProps = { } ;
8+ export type NativeFormProps = {
9+ style ?: NativeViewStyle ;
10+ } ;
1011
1112export const Form : FunctionComponentWithId < PropsWithChildren < NativeFormProps > > = ( {
1213 children,
Original file line number Diff line number Diff line change 11import { ReactNode , useMemo } from "react" ;
22import { useSwiftUINode } from "../hooks" ;
3+ import type { NativeTextStyle } from "../types" ;
34
45// https://developer.apple.com/documentation/swiftui/picker
56
@@ -11,6 +12,7 @@ export type NativePickerProps<T extends string> = {
1112 label ?: string ;
1213 pickerStyle ?: NativePickerStyle ;
1314 disabled ?: boolean ;
15+ style ?: NativeTextStyle ;
1416 onChange ?: ( value : T ) => void ;
1517 onFocus ?: ( ) => void ;
1618 onBlur ?: ( ) => void ;
Original file line number Diff line number Diff line change 1- import { useMemo } from "react" ;
1+ import { type PropsWithChildren , useMemo } from "react" ;
2+ import { SwiftUIParentIdProvider } from "../contexts" ;
23import { useSwiftUINode } from "../hooks" ;
3- import type { FunctionComponentWithId } from "../types" ;
4+ import type { FunctionComponentWithId , NativeTextStyle } from "../types" ;
45
56// https://developer.apple.com/documentation/swiftui/stepper
67
@@ -10,12 +11,14 @@ export type NativeStepperProps = {
1011 minimum ?: number ;
1112 maximum ?: number ;
1213 step ?: number ;
14+ style ?: NativeTextStyle ;
1315 onChange ?: ( value : number ) => void ;
1416 onFocus ?: ( ) => void ;
1517 onBlur ?: ( ) => void ;
1618} ;
1719
18- export const Stepper : FunctionComponentWithId < NativeStepperProps > = ( {
20+ export const Stepper : FunctionComponentWithId < PropsWithChildren < NativeStepperProps > > = ( {
21+ children,
1922 onChange : onChangeProp ,
2023 onFocus,
2124 onBlur,
@@ -31,12 +34,12 @@ export const Stepper: FunctionComponentWithId<NativeStepperProps> = ({
3134 [ onChangeProp ] ,
3235 ) ;
3336
34- useSwiftUINode ( "Stepper" , otherProps , {
37+ const { id } = useSwiftUINode ( "Stepper" , otherProps , {
3538 change : onChange ,
3639 focus : onFocus ,
3740 blur : onBlur ,
3841 } ) ;
3942
40- return null ;
43+ return < SwiftUIParentIdProvider id = { id } > { children } </ SwiftUIParentIdProvider > ;
4144} ;
4245Stepper . displayName = "Stepper" ;
Original file line number Diff line number Diff line change 44// export { default as NativePopoverView } from "./PopoverViewNativeComponent";
55// export { default as NativeSectionView } from "./SectionNativeComponent";
66// export * from "./native/SwiftUIRootNativeComponent";
7+ export * from "./components" ;
78export { default as NativeContainerView } from "./native/SwiftUIRootNativeComponent" ;
89export * from "./styles" ;
910export * from "./SwiftUI" ;
Original file line number Diff line number Diff line change @@ -25,12 +25,14 @@ export type NativeViewStyle = Pick<
2525 | "right"
2626 | "bottom"
2727> & {
28+ tint ?: string ;
29+ accentColor ?: string ;
30+ foregroundColor ?: string ;
2831 cornerRadius ?: number ;
2932} ;
3033
3134export type NativeTextStyle = NativeViewStyle &
3235 Pick < TextStyle , "color" | "fontSize" | "fontWeight" | "textAlign" | "fontFamily" > & {
33- foregroundColor ?: string ;
3436 font ?: NativeFont ;
3537 } ;
3638
You can’t perform that action at this time.
0 commit comments