Skip to content

Commit fd2083a

Browse files
committed
declare useCustomTheme globally on all components
1 parent fe36f8c commit fd2083a

File tree

17 files changed

+1225
-20
lines changed

17 files changed

+1225
-20
lines changed

generatedTypes/commons/asBaseComponent.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ export interface BaseComponentInjectedProps {
66
*/
77
modifiers: ReturnType<typeof Modifiers.generateModifiersStyle>;
88
}
9-
declare function asBaseComponent<PROPS, STATICS = {}>(WrappedComponent: React.ComponentType<any>): React.ComponentClass<PROPS> & STATICS;
9+
declare type ThemeComponent = {
10+
useCustomTheme?: boolean;
11+
};
12+
declare function asBaseComponent<PROPS, STATICS = {}>(WrappedComponent: React.ComponentType<any>): React.ComponentClass<PROPS & ThemeComponent> & STATICS;
1013
export default asBaseComponent;

generatedTypes/components/avatar/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,7 @@ declare function createStyles(props: AvatarPropTypes): {
162162
};
163163
};
164164
export { Avatar };
165-
declare const _default: React.ComponentClass<AvatarPropTypes, any> & typeof Avatar;
165+
declare const _default: React.ComponentClass<AvatarPropTypes & {
166+
useCustomTheme?: boolean | undefined;
167+
}, any> & typeof Avatar;
166168
export default _default;

generatedTypes/components/button/index.d.ts

Lines changed: 589 additions & 1 deletion
Large diffs are not rendered by default.

generatedTypes/components/card/CardSection.d.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,41 @@ export declare type CardSectionProps = ViewPropTypes & {
4141
*/
4242
imageProps?: ImageProps;
4343
};
44-
declare const _default: React.ComponentClass<CardSectionProps, any>;
44+
declare const _default: React.ComponentClass<ViewPropTypes & {
45+
/**
46+
* Text content for the CardSection.
47+
* Example: content={[{text: 'You’re Invited!', text70: true, dark10: true}]}
48+
*/
49+
content?: ContentType[] | undefined;
50+
/**
51+
* Style for the content
52+
*/
53+
contentStyle?: ViewStyle | undefined;
54+
/**
55+
* Give the section a background color
56+
*/
57+
backgroundColor?: string | undefined;
58+
/**
59+
* Image props for a leading icon to render before the text
60+
*/
61+
leadingIcon?: ImageProps | undefined;
62+
/**
63+
* Image props for a trailing icon to render after the text
64+
*/
65+
trailingIcon?: ImageProps | undefined;
66+
/**
67+
* Will be used for the background when provided
68+
*/
69+
imageSource?: number | import("react-native").ImageURISource | import("react-native").ImageURISource[] | undefined;
70+
/**
71+
* The style for the background image
72+
*/
73+
imageStyle?: ImageStyle | undefined;
74+
/**
75+
* Other image props that will be passed to the image
76+
*/
77+
imageProps?: ImageProps | undefined;
78+
} & {
79+
useCustomTheme?: boolean | undefined;
80+
}, any>;
4581
export default _default;

generatedTypes/components/card/index.d.ts

Lines changed: 121 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,127 @@ export declare type CardPropTypes = ViewPropTypes & TouchableOpacityProps & {
6161
hideIndicator?: boolean;
6262
};
6363
};
64-
declare const _default: React.ComponentClass<CardPropTypes, any> & {
64+
declare const _default: React.ComponentClass<ViewPropTypes & import("react-native").TouchableOpacityProps & Partial<Record<import("../../commons/modifiers").AlignmentLiterals, boolean>> & Partial<Record<import("../../commons/modifiers").PositionLiterals, boolean>> & Partial<Record<"padding" | "paddingL" | "paddingT" | "paddingR" | "paddingB" | "paddingH" | "paddingV", boolean>> & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & Partial<Record<"flex" | "flexG" | "flexS", boolean>> & Partial<Record<"br0" | "br10" | "br20" | "br30" | "br40" | "br50" | "br60" | "br100", boolean>> & Partial<Record<"bg", boolean>> & {
65+
backgroundColor?: string | undefined;
66+
throttleTime?: number | undefined;
67+
throttleOptions?: {
68+
leading: boolean;
69+
trailing: boolean;
70+
} | undefined;
71+
activeBackgroundColor?: string | undefined;
72+
useNative?: boolean | undefined;
73+
ref?: any;
74+
} & {
75+
/**
76+
* card custom width
77+
*/
78+
width?: string | number | undefined;
79+
/**
80+
* card custom height
81+
*/
82+
height?: string | number | undefined;
83+
/**
84+
* should inner card flow direction be horizontal
85+
*/
86+
row?: boolean | undefined;
87+
/**
88+
* card border radius (will be passed to inner Card.Image component)
89+
*/
90+
borderRadius?: number | undefined;
91+
/**
92+
* action for when pressing the card
93+
*/
94+
onPress?: (() => void) | undefined;
95+
/**
96+
* whether the card should have shadow or not
97+
*/
98+
enableShadow?: boolean | undefined;
99+
/**
100+
* elevation value (Android only)
101+
*/
102+
elevation?: number | undefined;
103+
/**
104+
* enable blur effect (iOS only)
105+
*/
106+
enableBlur?: boolean | undefined;
107+
/**
108+
* blur option for blur effect according to @react-native-community/blur lib (make sure enableBlur is on)
109+
*/
110+
blurOptions?: object | undefined;
111+
/**
112+
* Additional styles for the top container
113+
*/
114+
containerStyle?: ViewStyle | undefined;
115+
/**
116+
* Adds visual indication that the card is selected
117+
*/
118+
selected?: boolean | undefined;
119+
/**
120+
* Custom options for styling the selection indication
121+
*/
122+
selectionOptions?: {
123+
icon?: number | undefined;
124+
iconColor?: string | undefined;
125+
color?: string | undefined;
126+
borderWidth?: number | undefined;
127+
indicatorSize?: number | undefined;
128+
hideIndicator?: boolean | undefined;
129+
} | undefined;
130+
} & {
131+
useCustomTheme?: boolean | undefined;
132+
}, any> & {
65133
Image: React.ComponentType<import("./CardImage").CardImageProps>;
66-
Section: React.ComponentClass<CardSectionProps, any>;
134+
Section: React.ComponentClass<ViewPropTypes & {
135+
content?: ((import("react-native").TextProps & import("../../commons/modifiers").CustomModifier & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & {
136+
color?: string | undefined;
137+
center?: boolean | undefined;
138+
uppercase?: boolean | undefined;
139+
highlightString?: string | undefined;
140+
highlightStyle?: import("react-native").TextStyle | undefined;
141+
animated?: boolean | undefined;
142+
textAlign?: string | undefined;
143+
} & {
144+
text?: string | undefined;
145+
}) | (import("react-native").TextProps & import("../../commons/modifiers").CustomModifier & Partial<Record<"black" | "white" | "dark10" | "dark20" | "dark30" | "dark40" | "dark50" | "dark60" | "dark70" | "dark80" | "grey10" | "grey20" | "grey30" | "grey40" | "grey50" | "grey60" | "grey70" | "grey80" | "blue10" | "blue20" | "blue30" | "blue40" | "blue50" | "blue60" | "blue70" | "blue80" | "cyan10" | "cyan20" | "cyan30" | "cyan40" | "cyan50" | "cyan60" | "cyan70" | "cyan80" | "green10" | "green20" | "green30" | "green40" | "green50" | "green60" | "green70" | "green80" | "yellow10" | "yellow20" | "yellow30" | "yellow40" | "yellow50" | "yellow60" | "yellow70" | "yellow80" | "orange10" | "orange20" | "orange30" | "orange40" | "orange50" | "orange60" | "orange70" | "orange80" | "red10" | "red20" | "red30" | "red40" | "red50" | "red60" | "red70" | "red80" | "purple10" | "purple20" | "purple30" | "purple40" | "purple50" | "purple60" | "purple70" | "purple80" | "violet10" | "violet20" | "violet30" | "violet40" | "violet50" | "violet60" | "violet70" | "violet80", boolean>> & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & {
146+
color?: string | undefined;
147+
center?: boolean | undefined;
148+
uppercase?: boolean | undefined;
149+
highlightString?: string | undefined;
150+
highlightStyle?: import("react-native").TextStyle | undefined;
151+
animated?: boolean | undefined;
152+
textAlign?: string | undefined;
153+
} & {
154+
text?: string | undefined;
155+
}) | (import("react-native").TextProps & Partial<Record<"text10" | "text20" | "text30" | "text40" | "text50" | "text60" | "text65" | "text70" | "text80" | "text90" | "text100" | "text10T" | "text10L" | "text10R" | "text10M" | "text10BO" | "text10H" | "text10BL" | "text20T" | "text20L" | "text20R" | "text20M" | "text20BO" | "text20H" | "text20BL" | "text30T" | "text30L" | "text30R" | "text30M" | "text30BO" | "text30H" | "text30BL" | "text40T" | "text40L" | "text40R" | "text40M" | "text40BO" | "text40H" | "text40BL" | "text50T" | "text50L" | "text50R" | "text50M" | "text50BO" | "text50H" | "text50BL" | "text60T" | "text60L" | "text60R" | "text60M" | "text60BO" | "text60H" | "text60BL" | "text65T" | "text65L" | "text65R" | "text65M" | "text65BO" | "text65H" | "text65BL" | "text70T" | "text70L" | "text70R" | "text70M" | "text70BO" | "text70H" | "text70BL" | "text80T" | "text80L" | "text80R" | "text80M" | "text80BO" | "text80H" | "text80BL" | "text90T" | "text90L" | "text90R" | "text90M" | "text90BO" | "text90H" | "text90BL" | "text100T" | "text100L" | "text100R" | "text100M" | "text100BO" | "text100H" | "text100BL", boolean>> & import("../../commons/modifiers").CustomModifier & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & {
156+
color?: string | undefined;
157+
center?: boolean | undefined;
158+
uppercase?: boolean | undefined;
159+
highlightString?: string | undefined;
160+
highlightStyle?: import("react-native").TextStyle | undefined;
161+
animated?: boolean | undefined;
162+
textAlign?: string | undefined;
163+
} & {
164+
text?: string | undefined;
165+
}) | (import("react-native").TextProps & Partial<Record<"text10" | "text20" | "text30" | "text40" | "text50" | "text60" | "text65" | "text70" | "text80" | "text90" | "text100" | "text10T" | "text10L" | "text10R" | "text10M" | "text10BO" | "text10H" | "text10BL" | "text20T" | "text20L" | "text20R" | "text20M" | "text20BO" | "text20H" | "text20BL" | "text30T" | "text30L" | "text30R" | "text30M" | "text30BO" | "text30H" | "text30BL" | "text40T" | "text40L" | "text40R" | "text40M" | "text40BO" | "text40H" | "text40BL" | "text50T" | "text50L" | "text50R" | "text50M" | "text50BO" | "text50H" | "text50BL" | "text60T" | "text60L" | "text60R" | "text60M" | "text60BO" | "text60H" | "text60BL" | "text65T" | "text65L" | "text65R" | "text65M" | "text65BO" | "text65H" | "text65BL" | "text70T" | "text70L" | "text70R" | "text70M" | "text70BO" | "text70H" | "text70BL" | "text80T" | "text80L" | "text80R" | "text80M" | "text80BO" | "text80H" | "text80BL" | "text90T" | "text90L" | "text90R" | "text90M" | "text90BO" | "text90H" | "text90BL" | "text100T" | "text100L" | "text100R" | "text100M" | "text100BO" | "text100H" | "text100BL", boolean>> & Partial<Record<"black" | "white" | "dark10" | "dark20" | "dark30" | "dark40" | "dark50" | "dark60" | "dark70" | "dark80" | "grey10" | "grey20" | "grey30" | "grey40" | "grey50" | "grey60" | "grey70" | "grey80" | "blue10" | "blue20" | "blue30" | "blue40" | "blue50" | "blue60" | "blue70" | "blue80" | "cyan10" | "cyan20" | "cyan30" | "cyan40" | "cyan50" | "cyan60" | "cyan70" | "cyan80" | "green10" | "green20" | "green30" | "green40" | "green50" | "green60" | "green70" | "green80" | "yellow10" | "yellow20" | "yellow30" | "yellow40" | "yellow50" | "yellow60" | "yellow70" | "yellow80" | "orange10" | "orange20" | "orange30" | "orange40" | "orange50" | "orange60" | "orange70" | "orange80" | "red10" | "red20" | "red30" | "red40" | "red50" | "red60" | "red70" | "red80" | "purple10" | "purple20" | "purple30" | "purple40" | "purple50" | "purple60" | "purple70" | "purple80" | "violet10" | "violet20" | "violet30" | "violet40" | "violet50" | "violet60" | "violet70" | "violet80", boolean>> & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & {
166+
color?: string | undefined;
167+
center?: boolean | undefined;
168+
uppercase?: boolean | undefined;
169+
highlightString?: string | undefined;
170+
highlightStyle?: import("react-native").TextStyle | undefined;
171+
animated?: boolean | undefined;
172+
textAlign?: string | undefined;
173+
} & {
174+
text?: string | undefined;
175+
}))[] | undefined;
176+
contentStyle?: ViewStyle | undefined;
177+
backgroundColor?: string | undefined;
178+
leadingIcon?: import("../image").ImageProps | undefined;
179+
trailingIcon?: import("../image").ImageProps | undefined;
180+
imageSource?: number | import("react-native").ImageURISource | import("react-native").ImageURISource[] | undefined;
181+
imageStyle?: import("react-native").ImageStyle | undefined;
182+
imageProps?: import("../image").ImageProps | undefined;
183+
} & {
184+
useCustomTheme?: boolean | undefined;
185+
}, any>;
67186
};
68187
export default _default;

generatedTypes/components/checkbox/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@ export interface CheckboxPropTypes extends TouchableOpacityProps {
3838
*/
3939
style?: StyleProp<ViewStyle>;
4040
}
41-
declare const _default: React.ComponentClass<CheckboxPropTypes, any>;
41+
declare const _default: React.ComponentClass<CheckboxPropTypes & {
42+
useCustomTheme?: boolean | undefined;
43+
}, any>;
4244
export default _default;

generatedTypes/components/chip/index.d.ts

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,95 @@ export declare type ChipPropTypes = ViewProps & TouchableOpacityProps & {
9191
*/
9292
dismissContainerStyle?: StyleProp<ImageStyle>;
9393
};
94-
declare const _default: React.ComponentClass<ChipPropTypes, any>;
94+
declare const _default: React.ComponentClass<ViewProps & TouchableOpacityProps & {
95+
/**
96+
* Chip's size. Number or a width and height object.
97+
*/
98+
size?: number | {
99+
width: number;
100+
height: number;
101+
} | undefined;
102+
/**
103+
* On Chip press callback
104+
*/
105+
onPress?: ((props: any) => void) | undefined;
106+
/**
107+
* Chip's background color
108+
*/
109+
backgroundColor?: string | undefined;
110+
/**
111+
* The Chip borderRadius
112+
*/
113+
borderRadius?: number | undefined;
114+
/**
115+
* Chip's container style
116+
*/
117+
containerStyle?: StyleProp<ViewStyle>;
118+
/**
119+
* Uses size as minWidth and minHeight - default is true
120+
*/
121+
useSizeAsMinimum?: boolean | undefined;
122+
/**
123+
* Disables all internal elements default spacings. Helps reach a custom design
124+
*/
125+
resetSpacings?: boolean | undefined;
126+
/**
127+
* Used as testing identifier
128+
*/
129+
testID?: string | undefined;
130+
/**
131+
* Main Chip text
132+
*/
133+
label?: string | undefined;
134+
/**
135+
* Color of the label.
136+
*/
137+
labelColor?: string | undefined;
138+
/**
139+
* Label's style
140+
*/
141+
labelStyle?: StyleProp<TextStyle>;
142+
/**
143+
* Badge props object
144+
*/
145+
badgeProps?: BadgeProps | undefined;
146+
/**
147+
* Avatar props object
148+
*/
149+
avatarProps?: AvatarPropTypes | undefined;
150+
/**
151+
* Icon's source
152+
*/
153+
iconSource?: number | import("react-native").ImageURISource | import("react-native").ImageURISource[] | undefined;
154+
/**
155+
* Icon's color
156+
*/
157+
iconColor?: string | undefined;
158+
/**
159+
* Icon style
160+
*/
161+
iconStyle?: StyleProp<ImageStyle>;
162+
/**
163+
* Adds a dismiss button and serves as its callback
164+
*/
165+
onDismiss?: ((props: any) => void) | undefined;
166+
/**
167+
* Dismiss color
168+
*/
169+
dismissColor?: string | undefined;
170+
/**
171+
* Dismiss asset
172+
*/
173+
dismissIcon?: number | import("react-native").ImageURISource | import("react-native").ImageURISource[] | undefined;
174+
/**
175+
* Dismiss style
176+
*/
177+
dismissIconStyle?: StyleProp<ImageStyle>;
178+
/**
179+
* Dismiss container style
180+
*/
181+
dismissContainerStyle?: StyleProp<ImageStyle>;
182+
} & {
183+
useCustomTheme?: boolean | undefined;
184+
}, any>;
95185
export default _default;

generatedTypes/components/image/index.d.ts

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,49 @@ declare class Image extends PureComponent<Props> {
7070
render(): JSX.Element;
7171
}
7272
export { Image };
73-
declare const _default: React.ComponentClass<ImageProps, any>;
73+
declare const _default: React.ComponentClass<RNImageProps & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & {
74+
/**
75+
* custom source transform handler for manipulating the image source (great for size control)
76+
*/
77+
sourceTransformer?: ((props: any) => ImageSourcePropType) | undefined;
78+
/**
79+
* if provided image source will be driven from asset name
80+
*/
81+
assetName?: string | undefined;
82+
/**
83+
* the asset group, default is "icons"
84+
*/
85+
assetGroup?: string | undefined;
86+
/**
87+
* the asset tint
88+
*/
89+
tintColor?: string | undefined;
90+
/**
91+
* whether the image should flip horizontally on RTL locals
92+
*/
93+
supportRTL?: boolean | undefined;
94+
/**
95+
* Show image as a cover, full width, image (according to aspect ratio, default: 16:8)
96+
*/
97+
cover?: boolean | undefined;
98+
/**
99+
* The aspect ratio for the image
100+
*/
101+
aspectRatio?: number | undefined;
102+
/**
103+
* The type of overly to place on top of the image. Note: the image MUST have proper size, see examples in:
104+
* https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/OverlaysScreen.js
105+
*/
106+
overlayType?: string | undefined;
107+
/**
108+
* Pass a custom color for the overlay
109+
*/
110+
overlayColor?: string | undefined;
111+
/**
112+
* Render an overlay with custom content
113+
*/
114+
customOverlayContent?: JSX.Element | undefined;
115+
} & {
116+
useCustomTheme?: boolean | undefined;
117+
}, any>;
74118
export default _default;

0 commit comments

Comments
 (0)