react-native-better-html 1.0.15 → 1.0.17

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/dist/index.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { BetterCoreProviderConfig, DeepPartialRecord, BetterCoreConfig, OmitProps, PartialRecord, IconName, AnyOtherString, AssetName, LoaderName } from 'react-better-core';
1
+ import { BetterCoreProviderConfig, DeepPartialRecord, BetterCoreConfig, OmitProps, IconName, AnyOtherString, PartialRecord, AssetName, LoaderName } from 'react-better-core';
2
2
  export { AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateRandomString, getPluralWord, lightenColor, loaderControls, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
3
3
  import * as react from 'react';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react_native from 'react-native';
6
- import { ViewStyle, TextInput, TextStyle, FocusEvent, NativeSyntheticEvent, NativeTouchEvent, TextInputSubmitEditingEvent, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, StatusBar as StatusBar$1 } from 'react-native';
6
+ import { ViewStyle, GestureResponderEvent, ViewProps as ViewProps$1, TextInput, TextStyle, NativeSyntheticEvent, NativeTouchEvent, FocusEvent, TextInputSubmitEditingEvent, TextProps as TextProps$1, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, StatusBar as StatusBar$1 } from 'react-native';
7
+ import { SymbolView } from 'expo-symbols';
7
8
  import { EaseFunction, PropsTransforms } from '@legendapp/motion';
8
9
 
9
10
  type AppConfig = {};
@@ -30,7 +31,7 @@ type BetterComponentsProviderProps = BetterProviderCommonProps & {
30
31
  config?: BetterComponentsProviderConfig;
31
32
  };
32
33
  declare function BetterComponentsProvider({ config, ...props }: BetterComponentsProviderProps): react_jsx_runtime.JSX.Element;
33
- declare const _default$1: react.MemoExoticComponent<typeof BetterComponentsProvider>;
34
+ declare const _default$2: react.MemoExoticComponent<typeof BetterComponentsProvider>;
34
35
 
35
36
  type ComponentStyle<Style extends ViewStyle = ViewStyle> = OmitProps<Style, "shadowOffset" | ComponentExcludeMarginProps | ComponentExcludePaddingProps> & {
36
37
  shadowOffsetWidth?: number;
@@ -44,7 +45,45 @@ type ComponentPropWithRef<ComponentRef, ComponentProps> = ComponentProps & {
44
45
  ref?: React.Ref<ComponentRef>;
45
46
  };
46
47
 
47
- declare const pressStrength: () => Record<"z05" | "z1" | "z2" | "z3", number>;
48
+ declare const pressStrength: () => Record<"p05" | "p1" | "p2" | "p3", number>;
49
+
50
+ type ViewProps<Value = unknown> = {
51
+ /** @default false */
52
+ isRow?: boolean;
53
+ value?: Value;
54
+ /** @default false */
55
+ disabled?: boolean;
56
+ /** @default "highlight" */
57
+ pressType?: "opacity" | "highlight";
58
+ /** @default 0.8 */
59
+ pressStrength?: number;
60
+ onPress?: (event: GestureResponderEvent) => void;
61
+ onPressIn?: (event: GestureResponderEvent) => void;
62
+ onPressOut?: (event: GestureResponderEvent) => void;
63
+ onLongPress?: (event: GestureResponderEvent) => void;
64
+ onPressWithValue?: (value: Value) => void;
65
+ } & OmitProps<ViewProps$1, "style" | "onBlur" | "onFocus"> & ComponentStyle;
66
+ type ViewComponentType = {
67
+ <Value>(props: ViewProps<Value>): React.ReactElement;
68
+ box: <Value>(props: ViewProps<Value> & {
69
+ /** @default false */
70
+ withShadow?: boolean;
71
+ }) => React.ReactElement;
72
+ };
73
+ declare const ViewComponent: ViewComponentType;
74
+ declare const View: typeof ViewComponent & {
75
+ box: typeof ViewComponent.box;
76
+ };
77
+
78
+ type IconProps = {
79
+ name: IconName | AnyOtherString;
80
+ nameIOS?: React.ComponentProps<typeof SymbolView>["name"];
81
+ /** @default 16 */
82
+ size?: number;
83
+ color?: string;
84
+ } & OmitProps<ViewProps, "width" | "height" | "pressType">;
85
+ declare function Icon({ name, nameIOS, size, color, ...props }: IconProps): react_jsx_runtime.JSX.Element;
86
+ declare const _default$1: react.MemoExoticComponent<typeof Icon>;
48
87
 
49
88
  type InputFieldProps = {
50
89
  flex?: ViewStyle["flex"];
@@ -92,6 +131,12 @@ type InputFieldProps = {
92
131
  multiline?: boolean;
93
132
  /** @default 2 */
94
133
  numberOfLines?: number;
134
+ leftIcon?: IconProps["name"];
135
+ leftIconIOS?: IconProps["nameIOS"];
136
+ onPressLeftIcon?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
137
+ rightIcon?: IconProps["name"];
138
+ rightIconIOS?: IconProps["nameIOS"];
139
+ onPressRightIcon?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
95
140
  onFocus?: (event: FocusEvent) => void;
96
141
  onBlur?: (event: FocusEvent) => void;
97
142
  onChange?: (text: string) => void;
@@ -105,6 +150,7 @@ type InputFieldComponentType = {
105
150
  (props: ComponentPropWithRef<TextInput, InputFieldProps>): React.ReactElement;
106
151
  email: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
107
152
  password: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
153
+ search: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
108
154
  code: (props: ComponentPropWithRef<TextInput, InputFieldProps & {
109
155
  /** @default false */
110
156
  isSmall?: boolean;
@@ -114,6 +160,7 @@ declare const InputFieldComponent: InputFieldComponentType;
114
160
  declare const InputField: typeof InputFieldComponent & {
115
161
  email: typeof InputFieldComponent.email;
116
162
  password: typeof InputFieldComponent.password;
163
+ search: typeof InputFieldComponent.search;
117
164
  code: typeof InputFieldComponent.code;
118
165
  };
119
166
 
@@ -170,6 +217,10 @@ declare function useForm<FormFields extends Record<string | number, FormFieldVal
170
217
  isValid: boolean;
171
218
  canSubmit: boolean;
172
219
  };
220
+ declare function useEventEmitter(): {
221
+ emit: <Params>(eventName: string, params?: Params) => void;
222
+ listen: <Params>(eventName: string, callback?: (params?: Params) => void) => react_native.EmitterSubscription;
223
+ };
173
224
 
174
225
  declare const getFormErrorObject: <FormFields extends ReturnType<typeof useForm>["values"]>(formValues: FormFields) => PartialRecord<keyof FormFields, string>;
175
226
 
@@ -180,34 +231,6 @@ declare function generateAsyncStorage<AsyncStorage extends object>(): {
180
231
  removeAllItems: () => void;
181
232
  };
182
233
 
183
- type ViewProps<Value = unknown> = {
184
- /** @default false */
185
- isRow?: boolean;
186
- value?: Value;
187
- /** @default false */
188
- disabled?: boolean;
189
- /** @default "highlight" */
190
- pressType?: "opacity" | "highlight";
191
- /** @default 0.8 */
192
- pressStrength?: number;
193
- onPress?: (event: GestureResponderEvent) => void;
194
- onPressIn?: (event: GestureResponderEvent) => void;
195
- onPressOut?: (event: GestureResponderEvent) => void;
196
- onLongPress?: (event: GestureResponderEvent) => void;
197
- onPressWithValue?: (value: Value) => void;
198
- } & OmitProps<ViewProps$1, "style" | "onBlur" | "onFocus"> & ComponentStyle;
199
- type ViewComponentType = {
200
- <Value>(props: ViewProps<Value>): React.ReactElement;
201
- box: <Value>(props: ViewProps<Value> & {
202
- /** @default false */
203
- withShadow?: boolean;
204
- }) => React.ReactElement;
205
- };
206
- declare const ViewComponent: ViewComponentType;
207
- declare const View: typeof ViewComponent & {
208
- box: typeof ViewComponent.box;
209
- };
210
-
211
234
  type TextProps = {} & OmitProps<TextProps$1, "style"> & ComponentStyle<TextStyle>;
212
235
  type TextComponentType = {
213
236
  (props: TextProps): React.ReactElement;
@@ -405,7 +428,8 @@ type ImageComponentType = {
405
428
  /** @default 50 */
406
429
  size?: number;
407
430
  letters?: string;
408
- backgroundColor?: string;
431
+ color?: ColorValue;
432
+ backgroundColor?: ColorValue;
409
433
  }) => React.ReactElement;
410
434
  };
411
435
  declare const ImageComponent: ImageComponentType;
@@ -429,4 +453,4 @@ type AsyncStoragePluginOptions = {};
429
453
  declare const defaultAsyncStoragePluginOptions: Required<AsyncStoragePluginOptions>;
430
454
  declare const asyncStoragePlugin: BetterComponentsPluginConstructor<AsyncStoragePluginOptions>;
431
455
 
432
- export { Animate, type AnimateTextProps, type AnimateViewProps, type AppConfig, type AsyncStoragePluginOptions, type BetterComponentsConfig, type BetterComponentsPlugin, _default$1 as BetterComponentsProvider, type BetterComponentsProviderConfig, Button, type ButtonProps, type ComponentMarginProps, type ComponentPaddingProps, type FooterProps, Image, type ImageProps, InputField, type InputFieldProps, type InputFieldRef, Loader, type LoaderProps, type LoaderSize, type PluginName, ScreenHolder, type ScreenHolderProps, _default as StatusBar, type StatusBarProps, Text, type TextProps, View, type ViewProps, asyncStoragePlugin, defaultAsyncStoragePluginOptions, generateAsyncStorage, getFormErrorObject, pressStrength, useBetterComponentsContext, useDevice, useForm, useKeyboard };
456
+ export { Animate, type AnimateTextProps, type AnimateViewProps, type AppConfig, type AsyncStoragePluginOptions, type BetterComponentsConfig, type BetterComponentsPlugin, _default$2 as BetterComponentsProvider, type BetterComponentsProviderConfig, Button, type ButtonProps, type ComponentMarginProps, type ComponentPaddingProps, type FooterProps, _default$1 as Icon, type IconProps, Image, type ImageProps, InputField, type InputFieldProps, type InputFieldRef, Loader, type LoaderProps, type LoaderSize, type PluginName, ScreenHolder, type ScreenHolderProps, _default as StatusBar, type StatusBarProps, Text, type TextProps, View, type ViewProps, asyncStoragePlugin, defaultAsyncStoragePluginOptions, generateAsyncStorage, getFormErrorObject, pressStrength, useBetterComponentsContext, useDevice, useEventEmitter, useForm, useKeyboard };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { BetterCoreProviderConfig, DeepPartialRecord, BetterCoreConfig, OmitProps, PartialRecord, IconName, AnyOtherString, AssetName, LoaderName } from 'react-better-core';
1
+ import { BetterCoreProviderConfig, DeepPartialRecord, BetterCoreConfig, OmitProps, IconName, AnyOtherString, PartialRecord, AssetName, LoaderName } from 'react-better-core';
2
2
  export { AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateRandomString, getPluralWord, lightenColor, loaderControls, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
3
3
  import * as react from 'react';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react_native from 'react-native';
6
- import { ViewStyle, TextInput, TextStyle, FocusEvent, NativeSyntheticEvent, NativeTouchEvent, TextInputSubmitEditingEvent, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, StatusBar as StatusBar$1 } from 'react-native';
6
+ import { ViewStyle, GestureResponderEvent, ViewProps as ViewProps$1, TextInput, TextStyle, NativeSyntheticEvent, NativeTouchEvent, FocusEvent, TextInputSubmitEditingEvent, TextProps as TextProps$1, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, StatusBar as StatusBar$1 } from 'react-native';
7
+ import { SymbolView } from 'expo-symbols';
7
8
  import { EaseFunction, PropsTransforms } from '@legendapp/motion';
8
9
 
9
10
  type AppConfig = {};
@@ -30,7 +31,7 @@ type BetterComponentsProviderProps = BetterProviderCommonProps & {
30
31
  config?: BetterComponentsProviderConfig;
31
32
  };
32
33
  declare function BetterComponentsProvider({ config, ...props }: BetterComponentsProviderProps): react_jsx_runtime.JSX.Element;
33
- declare const _default$1: react.MemoExoticComponent<typeof BetterComponentsProvider>;
34
+ declare const _default$2: react.MemoExoticComponent<typeof BetterComponentsProvider>;
34
35
 
35
36
  type ComponentStyle<Style extends ViewStyle = ViewStyle> = OmitProps<Style, "shadowOffset" | ComponentExcludeMarginProps | ComponentExcludePaddingProps> & {
36
37
  shadowOffsetWidth?: number;
@@ -44,7 +45,45 @@ type ComponentPropWithRef<ComponentRef, ComponentProps> = ComponentProps & {
44
45
  ref?: React.Ref<ComponentRef>;
45
46
  };
46
47
 
47
- declare const pressStrength: () => Record<"z05" | "z1" | "z2" | "z3", number>;
48
+ declare const pressStrength: () => Record<"p05" | "p1" | "p2" | "p3", number>;
49
+
50
+ type ViewProps<Value = unknown> = {
51
+ /** @default false */
52
+ isRow?: boolean;
53
+ value?: Value;
54
+ /** @default false */
55
+ disabled?: boolean;
56
+ /** @default "highlight" */
57
+ pressType?: "opacity" | "highlight";
58
+ /** @default 0.8 */
59
+ pressStrength?: number;
60
+ onPress?: (event: GestureResponderEvent) => void;
61
+ onPressIn?: (event: GestureResponderEvent) => void;
62
+ onPressOut?: (event: GestureResponderEvent) => void;
63
+ onLongPress?: (event: GestureResponderEvent) => void;
64
+ onPressWithValue?: (value: Value) => void;
65
+ } & OmitProps<ViewProps$1, "style" | "onBlur" | "onFocus"> & ComponentStyle;
66
+ type ViewComponentType = {
67
+ <Value>(props: ViewProps<Value>): React.ReactElement;
68
+ box: <Value>(props: ViewProps<Value> & {
69
+ /** @default false */
70
+ withShadow?: boolean;
71
+ }) => React.ReactElement;
72
+ };
73
+ declare const ViewComponent: ViewComponentType;
74
+ declare const View: typeof ViewComponent & {
75
+ box: typeof ViewComponent.box;
76
+ };
77
+
78
+ type IconProps = {
79
+ name: IconName | AnyOtherString;
80
+ nameIOS?: React.ComponentProps<typeof SymbolView>["name"];
81
+ /** @default 16 */
82
+ size?: number;
83
+ color?: string;
84
+ } & OmitProps<ViewProps, "width" | "height" | "pressType">;
85
+ declare function Icon({ name, nameIOS, size, color, ...props }: IconProps): react_jsx_runtime.JSX.Element;
86
+ declare const _default$1: react.MemoExoticComponent<typeof Icon>;
48
87
 
49
88
  type InputFieldProps = {
50
89
  flex?: ViewStyle["flex"];
@@ -92,6 +131,12 @@ type InputFieldProps = {
92
131
  multiline?: boolean;
93
132
  /** @default 2 */
94
133
  numberOfLines?: number;
134
+ leftIcon?: IconProps["name"];
135
+ leftIconIOS?: IconProps["nameIOS"];
136
+ onPressLeftIcon?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
137
+ rightIcon?: IconProps["name"];
138
+ rightIconIOS?: IconProps["nameIOS"];
139
+ onPressRightIcon?: (event: NativeSyntheticEvent<NativeTouchEvent>) => void;
95
140
  onFocus?: (event: FocusEvent) => void;
96
141
  onBlur?: (event: FocusEvent) => void;
97
142
  onChange?: (text: string) => void;
@@ -105,6 +150,7 @@ type InputFieldComponentType = {
105
150
  (props: ComponentPropWithRef<TextInput, InputFieldProps>): React.ReactElement;
106
151
  email: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
107
152
  password: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
153
+ search: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
108
154
  code: (props: ComponentPropWithRef<TextInput, InputFieldProps & {
109
155
  /** @default false */
110
156
  isSmall?: boolean;
@@ -114,6 +160,7 @@ declare const InputFieldComponent: InputFieldComponentType;
114
160
  declare const InputField: typeof InputFieldComponent & {
115
161
  email: typeof InputFieldComponent.email;
116
162
  password: typeof InputFieldComponent.password;
163
+ search: typeof InputFieldComponent.search;
117
164
  code: typeof InputFieldComponent.code;
118
165
  };
119
166
 
@@ -170,6 +217,10 @@ declare function useForm<FormFields extends Record<string | number, FormFieldVal
170
217
  isValid: boolean;
171
218
  canSubmit: boolean;
172
219
  };
220
+ declare function useEventEmitter(): {
221
+ emit: <Params>(eventName: string, params?: Params) => void;
222
+ listen: <Params>(eventName: string, callback?: (params?: Params) => void) => react_native.EmitterSubscription;
223
+ };
173
224
 
174
225
  declare const getFormErrorObject: <FormFields extends ReturnType<typeof useForm>["values"]>(formValues: FormFields) => PartialRecord<keyof FormFields, string>;
175
226
 
@@ -180,34 +231,6 @@ declare function generateAsyncStorage<AsyncStorage extends object>(): {
180
231
  removeAllItems: () => void;
181
232
  };
182
233
 
183
- type ViewProps<Value = unknown> = {
184
- /** @default false */
185
- isRow?: boolean;
186
- value?: Value;
187
- /** @default false */
188
- disabled?: boolean;
189
- /** @default "highlight" */
190
- pressType?: "opacity" | "highlight";
191
- /** @default 0.8 */
192
- pressStrength?: number;
193
- onPress?: (event: GestureResponderEvent) => void;
194
- onPressIn?: (event: GestureResponderEvent) => void;
195
- onPressOut?: (event: GestureResponderEvent) => void;
196
- onLongPress?: (event: GestureResponderEvent) => void;
197
- onPressWithValue?: (value: Value) => void;
198
- } & OmitProps<ViewProps$1, "style" | "onBlur" | "onFocus"> & ComponentStyle;
199
- type ViewComponentType = {
200
- <Value>(props: ViewProps<Value>): React.ReactElement;
201
- box: <Value>(props: ViewProps<Value> & {
202
- /** @default false */
203
- withShadow?: boolean;
204
- }) => React.ReactElement;
205
- };
206
- declare const ViewComponent: ViewComponentType;
207
- declare const View: typeof ViewComponent & {
208
- box: typeof ViewComponent.box;
209
- };
210
-
211
234
  type TextProps = {} & OmitProps<TextProps$1, "style"> & ComponentStyle<TextStyle>;
212
235
  type TextComponentType = {
213
236
  (props: TextProps): React.ReactElement;
@@ -405,7 +428,8 @@ type ImageComponentType = {
405
428
  /** @default 50 */
406
429
  size?: number;
407
430
  letters?: string;
408
- backgroundColor?: string;
431
+ color?: ColorValue;
432
+ backgroundColor?: ColorValue;
409
433
  }) => React.ReactElement;
410
434
  };
411
435
  declare const ImageComponent: ImageComponentType;
@@ -429,4 +453,4 @@ type AsyncStoragePluginOptions = {};
429
453
  declare const defaultAsyncStoragePluginOptions: Required<AsyncStoragePluginOptions>;
430
454
  declare const asyncStoragePlugin: BetterComponentsPluginConstructor<AsyncStoragePluginOptions>;
431
455
 
432
- export { Animate, type AnimateTextProps, type AnimateViewProps, type AppConfig, type AsyncStoragePluginOptions, type BetterComponentsConfig, type BetterComponentsPlugin, _default$1 as BetterComponentsProvider, type BetterComponentsProviderConfig, Button, type ButtonProps, type ComponentMarginProps, type ComponentPaddingProps, type FooterProps, Image, type ImageProps, InputField, type InputFieldProps, type InputFieldRef, Loader, type LoaderProps, type LoaderSize, type PluginName, ScreenHolder, type ScreenHolderProps, _default as StatusBar, type StatusBarProps, Text, type TextProps, View, type ViewProps, asyncStoragePlugin, defaultAsyncStoragePluginOptions, generateAsyncStorage, getFormErrorObject, pressStrength, useBetterComponentsContext, useDevice, useForm, useKeyboard };
456
+ export { Animate, type AnimateTextProps, type AnimateViewProps, type AppConfig, type AsyncStoragePluginOptions, type BetterComponentsConfig, type BetterComponentsPlugin, _default$2 as BetterComponentsProvider, type BetterComponentsProviderConfig, Button, type ButtonProps, type ComponentMarginProps, type ComponentPaddingProps, type FooterProps, _default$1 as Icon, type IconProps, Image, type ImageProps, InputField, type InputFieldProps, type InputFieldRef, Loader, type LoaderProps, type LoaderSize, type PluginName, ScreenHolder, type ScreenHolderProps, _default as StatusBar, type StatusBarProps, Text, type TextProps, View, type ViewProps, asyncStoragePlugin, defaultAsyncStoragePluginOptions, generateAsyncStorage, getFormErrorObject, pressStrength, useBetterComponentsContext, useDevice, useEventEmitter, useForm, useKeyboard };