react-native-better-html 1.0.10 → 1.0.11
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 +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +109 -76
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +110 -77
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ export { AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme,
|
|
|
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, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1, TextStyle, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, TextInput, FocusEvent, NativeSyntheticEvent, NativeTouchEvent, TextInputSubmitEditingEvent } from 'react-native';
|
|
6
|
+
import { ViewStyle, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1, TextStyle, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, TextInput, FocusEvent, NativeSyntheticEvent, NativeTouchEvent, TextInputSubmitEditingEvent, StatusBar as StatusBar$1 } from 'react-native';
|
|
7
7
|
import { EaseFunction, PropsTransforms } from '@legendapp/motion';
|
|
8
8
|
|
|
9
9
|
type AppConfig = {};
|
|
@@ -316,12 +316,16 @@ declare const Image: typeof ImageComponent & {
|
|
|
316
316
|
|
|
317
317
|
type InputFieldProps = {
|
|
318
318
|
placeholder?: string;
|
|
319
|
-
prefix?: string;
|
|
320
|
-
suffix?: string;
|
|
319
|
+
prefix?: string | React.ReactNode;
|
|
320
|
+
suffix?: string | React.ReactNode;
|
|
321
321
|
defaultValue?: string;
|
|
322
322
|
value?: string | number;
|
|
323
323
|
/** @default true */
|
|
324
324
|
editable?: boolean;
|
|
325
|
+
label?: string;
|
|
326
|
+
isError?: boolean;
|
|
327
|
+
infoMessage?: string;
|
|
328
|
+
errorMessage?: string;
|
|
325
329
|
/** @default false */
|
|
326
330
|
autoFocus?: boolean;
|
|
327
331
|
autoCapitalize?: React.ComponentProps<typeof TextInput>["autoCapitalize"];
|
|
@@ -353,7 +357,10 @@ type InputFieldComponentType = {
|
|
|
353
357
|
(props: ComponentPropWithRef<TextInput, InputFieldProps>): React.ReactElement;
|
|
354
358
|
email: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
355
359
|
password: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
356
|
-
code: (props: ComponentPropWithRef<TextInput, InputFieldProps
|
|
360
|
+
code: (props: ComponentPropWithRef<TextInput, InputFieldProps & {
|
|
361
|
+
/** @default false */
|
|
362
|
+
isSmall?: boolean;
|
|
363
|
+
}>) => React.ReactElement;
|
|
357
364
|
};
|
|
358
365
|
declare const InputFieldComponent: InputFieldComponentType;
|
|
359
366
|
declare const InputField: typeof InputFieldComponent & {
|
|
@@ -366,8 +373,11 @@ type StatusBarProps = {
|
|
|
366
373
|
darkStatusBar?: boolean;
|
|
367
374
|
/** @default false */
|
|
368
375
|
hidden?: boolean;
|
|
376
|
+
barStyle?: React.ComponentProps<typeof StatusBar$1>["barStyle"];
|
|
377
|
+
androidBarStyle?: React.ComponentProps<typeof StatusBar$1>["barStyle"];
|
|
378
|
+
iOSBarStyle?: React.ComponentProps<typeof StatusBar$1>["barStyle"];
|
|
369
379
|
};
|
|
370
|
-
declare function StatusBar({ darkStatusBar, hidden }: StatusBarProps): react_jsx_runtime.JSX.Element;
|
|
380
|
+
declare function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }: StatusBarProps): react_jsx_runtime.JSX.Element;
|
|
371
381
|
declare const _default: react.MemoExoticComponent<typeof StatusBar>;
|
|
372
382
|
|
|
373
383
|
type AsyncStoragePluginOptions = {};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme,
|
|
|
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, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1, TextStyle, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, TextInput, FocusEvent, NativeSyntheticEvent, NativeTouchEvent, TextInputSubmitEditingEvent } from 'react-native';
|
|
6
|
+
import { ViewStyle, GestureResponderEvent, ViewProps as ViewProps$1, TextProps as TextProps$1, TextStyle, ColorValue, ImageSourcePropType, ImageProps as ImageProps$1, ImageStyle, TextInput, FocusEvent, NativeSyntheticEvent, NativeTouchEvent, TextInputSubmitEditingEvent, StatusBar as StatusBar$1 } from 'react-native';
|
|
7
7
|
import { EaseFunction, PropsTransforms } from '@legendapp/motion';
|
|
8
8
|
|
|
9
9
|
type AppConfig = {};
|
|
@@ -316,12 +316,16 @@ declare const Image: typeof ImageComponent & {
|
|
|
316
316
|
|
|
317
317
|
type InputFieldProps = {
|
|
318
318
|
placeholder?: string;
|
|
319
|
-
prefix?: string;
|
|
320
|
-
suffix?: string;
|
|
319
|
+
prefix?: string | React.ReactNode;
|
|
320
|
+
suffix?: string | React.ReactNode;
|
|
321
321
|
defaultValue?: string;
|
|
322
322
|
value?: string | number;
|
|
323
323
|
/** @default true */
|
|
324
324
|
editable?: boolean;
|
|
325
|
+
label?: string;
|
|
326
|
+
isError?: boolean;
|
|
327
|
+
infoMessage?: string;
|
|
328
|
+
errorMessage?: string;
|
|
325
329
|
/** @default false */
|
|
326
330
|
autoFocus?: boolean;
|
|
327
331
|
autoCapitalize?: React.ComponentProps<typeof TextInput>["autoCapitalize"];
|
|
@@ -353,7 +357,10 @@ type InputFieldComponentType = {
|
|
|
353
357
|
(props: ComponentPropWithRef<TextInput, InputFieldProps>): React.ReactElement;
|
|
354
358
|
email: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
355
359
|
password: (props: ComponentPropWithRef<TextInput, InputFieldProps>) => React.ReactElement;
|
|
356
|
-
code: (props: ComponentPropWithRef<TextInput, InputFieldProps
|
|
360
|
+
code: (props: ComponentPropWithRef<TextInput, InputFieldProps & {
|
|
361
|
+
/** @default false */
|
|
362
|
+
isSmall?: boolean;
|
|
363
|
+
}>) => React.ReactElement;
|
|
357
364
|
};
|
|
358
365
|
declare const InputFieldComponent: InputFieldComponentType;
|
|
359
366
|
declare const InputField: typeof InputFieldComponent & {
|
|
@@ -366,8 +373,11 @@ type StatusBarProps = {
|
|
|
366
373
|
darkStatusBar?: boolean;
|
|
367
374
|
/** @default false */
|
|
368
375
|
hidden?: boolean;
|
|
376
|
+
barStyle?: React.ComponentProps<typeof StatusBar$1>["barStyle"];
|
|
377
|
+
androidBarStyle?: React.ComponentProps<typeof StatusBar$1>["barStyle"];
|
|
378
|
+
iOSBarStyle?: React.ComponentProps<typeof StatusBar$1>["barStyle"];
|
|
369
379
|
};
|
|
370
|
-
declare function StatusBar({ darkStatusBar, hidden }: StatusBarProps): react_jsx_runtime.JSX.Element;
|
|
380
|
+
declare function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }: StatusBarProps): react_jsx_runtime.JSX.Element;
|
|
371
381
|
declare const _default: react.MemoExoticComponent<typeof StatusBar>;
|
|
372
382
|
|
|
373
383
|
type AsyncStoragePluginOptions = {};
|
package/dist/index.js
CHANGED
|
@@ -1187,6 +1187,10 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1187
1187
|
defaultValue,
|
|
1188
1188
|
value,
|
|
1189
1189
|
editable = true,
|
|
1190
|
+
label,
|
|
1191
|
+
isError,
|
|
1192
|
+
infoMessage,
|
|
1193
|
+
errorMessage,
|
|
1190
1194
|
autoFocus,
|
|
1191
1195
|
autoCapitalize,
|
|
1192
1196
|
autoComplete,
|
|
@@ -1257,81 +1261,108 @@ var InputFieldComponent = (0, import_react10.forwardRef)(
|
|
|
1257
1261
|
[]
|
|
1258
1262
|
);
|
|
1259
1263
|
const prefixSuffixBackgroundColor = colorTheme === "light" ? (0, import_react_better_core9.darkenColor)(theme2.colors.backgroundContent, 0.03) : (0, import_react_better_core9.lightenColor)(theme2.colors.backgroundContent, 0.1);
|
|
1260
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(View_default, {
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(View_default, { flex: 1, gap: theme2.styles.gap / 3, children: [
|
|
1265
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { fontSize: 14, color: theme2.colors.textSecondary, children: label }),
|
|
1266
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(View_default, { isRow: true, position: "relative", alignItems: "center", flex: 1, height: readyHeight, children: [
|
|
1267
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1268
|
+
View_default,
|
|
1269
|
+
{
|
|
1270
|
+
isRow: true,
|
|
1271
|
+
height: "100%",
|
|
1272
|
+
backgroundColor: prefixSuffixBackgroundColor,
|
|
1273
|
+
alignItems: "center",
|
|
1274
|
+
borderWidth,
|
|
1275
|
+
borderRightWidth: 0,
|
|
1276
|
+
borderTopLeftRadius: theme2.styles.borderRadius,
|
|
1277
|
+
borderBottomLeftRadius: theme2.styles.borderRadius,
|
|
1278
|
+
borderColor: theme2.colors.border,
|
|
1279
|
+
paddingHorizontal: readyPaddingHorizontal,
|
|
1280
|
+
children: typeof prefix === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { fontWeight: 700, children: prefix }) : prefix
|
|
1281
|
+
}
|
|
1282
|
+
),
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1284
|
+
Animate_default.View,
|
|
1285
|
+
{
|
|
1286
|
+
flex: 1,
|
|
1287
|
+
backgroundColor: theme2.colors.backgroundContent,
|
|
1288
|
+
borderTopLeftRadius: prefix ? 0 : theme2.styles.borderRadius,
|
|
1289
|
+
borderBottomLeftRadius: prefix ? 0 : theme2.styles.borderRadius,
|
|
1290
|
+
borderTopRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1291
|
+
borderBottomRightRadius: suffix ? 0 : theme2.styles.borderRadius,
|
|
1292
|
+
borderWidth,
|
|
1293
|
+
initialBorderColor: theme2.colors.border,
|
|
1294
|
+
animateBorderColor: isFocused ? theme2.colors.primary : isError ? theme2.colors.error : theme2.colors.border,
|
|
1295
|
+
overflow: "hidden",
|
|
1296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1297
|
+
import_react_native8.TextInput,
|
|
1298
|
+
{
|
|
1299
|
+
style: textInputStyle,
|
|
1300
|
+
value: internalValue,
|
|
1301
|
+
defaultValue,
|
|
1302
|
+
autoCapitalize,
|
|
1303
|
+
autoComplete,
|
|
1304
|
+
autoCorrect,
|
|
1305
|
+
autoFocus,
|
|
1306
|
+
placeholder,
|
|
1307
|
+
placeholderTextColor: theme2.colors.textSecondary + "80",
|
|
1308
|
+
enterKeyHint: returnKeyLabel,
|
|
1309
|
+
returnKeyType,
|
|
1310
|
+
onSubmitEditing: onPressEnter,
|
|
1311
|
+
readOnly: !editable,
|
|
1312
|
+
textAlign,
|
|
1313
|
+
keyboardAppearance,
|
|
1314
|
+
keyboardType,
|
|
1315
|
+
cursorColor: theme2.colors.primary,
|
|
1316
|
+
selectionColor: theme2.colors.primary,
|
|
1317
|
+
secureTextEntry,
|
|
1318
|
+
onFocus: onFocusElement,
|
|
1319
|
+
onBlur: onBlurElement,
|
|
1320
|
+
onChangeText,
|
|
1321
|
+
onPress,
|
|
1322
|
+
ref: textInputRef
|
|
1323
|
+
}
|
|
1324
|
+
)
|
|
1325
|
+
}
|
|
1326
|
+
),
|
|
1327
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1328
|
+
View_default,
|
|
1329
|
+
{
|
|
1330
|
+
isRow: true,
|
|
1331
|
+
height: "100%",
|
|
1332
|
+
backgroundColor: prefixSuffixBackgroundColor,
|
|
1333
|
+
alignItems: "center",
|
|
1334
|
+
borderWidth,
|
|
1335
|
+
borderLeftWidth: 0,
|
|
1336
|
+
borderTopRightRadius: theme2.styles.borderRadius,
|
|
1337
|
+
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
1338
|
+
borderColor: theme2.colors.border,
|
|
1339
|
+
paddingHorizontal: readyPaddingHorizontal,
|
|
1340
|
+
children: typeof suffix === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { fontWeight: 700, children: suffix }) : suffix
|
|
1341
|
+
}
|
|
1342
|
+
)
|
|
1343
|
+
] }),
|
|
1344
|
+
infoMessage && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1345
|
+
Animate_default.Text,
|
|
1279
1346
|
{
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
initialBorderColor: theme2.colors.border,
|
|
1288
|
-
animateBorderColor: isFocused ? theme2.colors.primary : theme2.colors.border,
|
|
1289
|
-
overflow: "hidden",
|
|
1290
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1291
|
-
import_react_native8.TextInput,
|
|
1292
|
-
{
|
|
1293
|
-
style: textInputStyle,
|
|
1294
|
-
value: internalValue,
|
|
1295
|
-
defaultValue,
|
|
1296
|
-
autoCapitalize,
|
|
1297
|
-
autoComplete,
|
|
1298
|
-
autoCorrect,
|
|
1299
|
-
autoFocus,
|
|
1300
|
-
placeholder,
|
|
1301
|
-
placeholderTextColor: theme2.colors.textSecondary + "80",
|
|
1302
|
-
enterKeyHint: returnKeyLabel,
|
|
1303
|
-
returnKeyType,
|
|
1304
|
-
onSubmitEditing: onPressEnter,
|
|
1305
|
-
readOnly: !editable,
|
|
1306
|
-
textAlign,
|
|
1307
|
-
keyboardAppearance,
|
|
1308
|
-
keyboardType,
|
|
1309
|
-
cursorColor: theme2.colors.primary,
|
|
1310
|
-
selectionColor: theme2.colors.primary,
|
|
1311
|
-
secureTextEntry,
|
|
1312
|
-
onFocus: onFocusElement,
|
|
1313
|
-
onBlur: onBlurElement,
|
|
1314
|
-
onChangeText,
|
|
1315
|
-
onPress,
|
|
1316
|
-
ref: textInputRef
|
|
1317
|
-
}
|
|
1318
|
-
)
|
|
1347
|
+
fontSize: 14,
|
|
1348
|
+
color: theme2.colors.textSecondary,
|
|
1349
|
+
initialHeight: 0,
|
|
1350
|
+
initialOpacity: 0,
|
|
1351
|
+
animateHeight: 17,
|
|
1352
|
+
animateOpacity: 1,
|
|
1353
|
+
children: infoMessage
|
|
1319
1354
|
}
|
|
1320
1355
|
),
|
|
1321
|
-
|
|
1322
|
-
|
|
1356
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1357
|
+
Animate_default.Text,
|
|
1323
1358
|
{
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
borderBottomRightRadius: theme2.styles.borderRadius,
|
|
1332
|
-
borderColor: theme2.colors.border,
|
|
1333
|
-
paddingHorizontal: readyPaddingHorizontal,
|
|
1334
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { fontWeight: 700, children: suffix })
|
|
1359
|
+
fontSize: 14,
|
|
1360
|
+
color: theme2.colors.error,
|
|
1361
|
+
initialHeight: 0,
|
|
1362
|
+
initialOpacity: 0,
|
|
1363
|
+
animateHeight: 17,
|
|
1364
|
+
animateOpacity: 1,
|
|
1365
|
+
children: errorMessage
|
|
1335
1366
|
}
|
|
1336
1367
|
)
|
|
1337
1368
|
] });
|
|
@@ -1365,15 +1396,16 @@ InputFieldComponent.password = (0, import_react10.forwardRef)(function Password(
|
|
|
1365
1396
|
}
|
|
1366
1397
|
);
|
|
1367
1398
|
});
|
|
1368
|
-
InputFieldComponent.code = (0, import_react10.forwardRef)(function Password2(props, ref) {
|
|
1399
|
+
InputFieldComponent.code = (0, import_react10.forwardRef)(function Password2({ isSmall, ...props }, ref) {
|
|
1369
1400
|
const theme2 = (0, import_react_better_core9.useTheme)();
|
|
1370
1401
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1371
1402
|
InputFieldComponent,
|
|
1372
1403
|
{
|
|
1373
|
-
fontSize: 42,
|
|
1404
|
+
fontSize: isSmall ? 36 : 42,
|
|
1374
1405
|
fontWeight: 900,
|
|
1375
|
-
lineHeight: 50,
|
|
1376
|
-
paddingVertical: theme2.styles.space * 2,
|
|
1406
|
+
lineHeight: isSmall ? 42 : 50,
|
|
1407
|
+
paddingVertical: isSmall ? theme2.styles.space : theme2.styles.space * 2,
|
|
1408
|
+
paddingHorizontal: isSmall ? theme2.styles.gap : void 0,
|
|
1377
1409
|
textAlign: "center",
|
|
1378
1410
|
...props,
|
|
1379
1411
|
ref
|
|
@@ -1391,12 +1423,13 @@ var import_react11 = require("react");
|
|
|
1391
1423
|
var import_react_better_core10 = require("react-better-core");
|
|
1392
1424
|
var import_react_native9 = require("react-native");
|
|
1393
1425
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1394
|
-
function StatusBar({ darkStatusBar, hidden }) {
|
|
1426
|
+
function StatusBar({ darkStatusBar, hidden, barStyle, androidBarStyle, iOSBarStyle }) {
|
|
1395
1427
|
const theme2 = (0, import_react_better_core10.useTheme)();
|
|
1396
1428
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1397
1429
|
import_react_native9.StatusBar,
|
|
1398
1430
|
{
|
|
1399
1431
|
backgroundColor: darkStatusBar ? theme2.colors.backgroundSecondary : void 0,
|
|
1432
|
+
barStyle: barStyle ?? (import_react_native9.Platform.OS === "android" ? androidBarStyle : iOSBarStyle),
|
|
1400
1433
|
hidden
|
|
1401
1434
|
}
|
|
1402
1435
|
);
|