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 1
1
import { type PropsWithChildren } from "react" ;
2
2
import { SwiftUIParentIdProvider } from "../contexts" ;
3
3
import { useSwiftUINode } from "../hooks" ;
4
- import type { FunctionComponentWithId } from "../types" ;
4
+ import type { FunctionComponentWithId , NativeViewStyle } from "../types" ;
5
5
6
6
// https://developer.apple.com/documentation/swiftui/form
7
7
8
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
9
- export type NativeFormProps = { } ;
8
+ export type NativeFormProps = {
9
+ style ?: NativeViewStyle ;
10
+ } ;
10
11
11
12
export const Form : FunctionComponentWithId < PropsWithChildren < NativeFormProps > > = ( {
12
13
children,
Original file line number Diff line number Diff line change 1
1
import { ReactNode , useMemo } from "react" ;
2
2
import { useSwiftUINode } from "../hooks" ;
3
+ import type { NativeTextStyle } from "../types" ;
3
4
4
5
// https://developer.apple.com/documentation/swiftui/picker
5
6
@@ -11,6 +12,7 @@ export type NativePickerProps<T extends string> = {
11
12
label ?: string ;
12
13
pickerStyle ?: NativePickerStyle ;
13
14
disabled ?: boolean ;
15
+ style ?: NativeTextStyle ;
14
16
onChange ?: ( value : T ) => void ;
15
17
onFocus ?: ( ) => void ;
16
18
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" ;
2
3
import { useSwiftUINode } from "../hooks" ;
3
- import type { FunctionComponentWithId } from "../types" ;
4
+ import type { FunctionComponentWithId , NativeTextStyle } from "../types" ;
4
5
5
6
// https://developer.apple.com/documentation/swiftui/stepper
6
7
@@ -10,12 +11,14 @@ export type NativeStepperProps = {
10
11
minimum ?: number ;
11
12
maximum ?: number ;
12
13
step ?: number ;
14
+ style ?: NativeTextStyle ;
13
15
onChange ?: ( value : number ) => void ;
14
16
onFocus ?: ( ) => void ;
15
17
onBlur ?: ( ) => void ;
16
18
} ;
17
19
18
- export const Stepper : FunctionComponentWithId < NativeStepperProps > = ( {
20
+ export const Stepper : FunctionComponentWithId < PropsWithChildren < NativeStepperProps > > = ( {
21
+ children,
19
22
onChange : onChangeProp ,
20
23
onFocus,
21
24
onBlur,
@@ -31,12 +34,12 @@ export const Stepper: FunctionComponentWithId<NativeStepperProps> = ({
31
34
[ onChangeProp ] ,
32
35
) ;
33
36
34
- useSwiftUINode ( "Stepper" , otherProps , {
37
+ const { id } = useSwiftUINode ( "Stepper" , otherProps , {
35
38
change : onChange ,
36
39
focus : onFocus ,
37
40
blur : onBlur ,
38
41
} ) ;
39
42
40
- return null ;
43
+ return < SwiftUIParentIdProvider id = { id } > { children } </ SwiftUIParentIdProvider > ;
41
44
} ;
42
45
Stepper . displayName = "Stepper" ;
Original file line number Diff line number Diff line change 4
4
// export { default as NativePopoverView } from "./PopoverViewNativeComponent";
5
5
// export { default as NativeSectionView } from "./SectionNativeComponent";
6
6
// export * from "./native/SwiftUIRootNativeComponent";
7
+ export * from "./components" ;
7
8
export { default as NativeContainerView } from "./native/SwiftUIRootNativeComponent" ;
8
9
export * from "./styles" ;
9
10
export * from "./SwiftUI" ;
Original file line number Diff line number Diff line change @@ -25,12 +25,14 @@ export type NativeViewStyle = Pick<
25
25
| "right"
26
26
| "bottom"
27
27
> & {
28
+ tint ?: string ;
29
+ accentColor ?: string ;
30
+ foregroundColor ?: string ;
28
31
cornerRadius ?: number ;
29
32
} ;
30
33
31
34
export type NativeTextStyle = NativeViewStyle &
32
35
Pick < TextStyle , "color" | "fontSize" | "fontWeight" | "textAlign" | "fontFamily" > & {
33
- foregroundColor ?: string ;
34
36
font ?: NativeFont ;
35
37
} ;
36
38
You can’t perform that action at this time.
0 commit comments