sapo-components-ui-rn 1.1.45 → 1.1.47
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/components/TextInput/TextInputDefault.d.ts +1 -1
- package/dist/components/TextInput/TextInputFlat.d.ts +1 -1
- package/dist/components/TextInput/types.d.ts +4 -1
- package/dist/index.esm.js +55 -32
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +55 -32
- package/dist/index.js.map +1 -1
- package/dist/styles/themes/tokens.d.ts +4 -0
- package/dist/theme/themes.d.ts +50 -0
- package/package.json +1 -1
- package/src/components/TextInput/TextInputDefault.tsx +5 -5
- package/src/components/TextInput/TextInputFlat.tsx +2 -1
- package/src/components/TextInput/types.tsx +4 -0
- package/src/styles/themes/DarkTheme.tsx +19 -10
- package/src/styles/themes/LightTheme.tsx +19 -10
- package/src/styles/themes/tokens.tsx +2 -0
- package/src/theme/themes.tsx +101 -51
- package/src/types.tsx +9 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChildTextInputProps } from "./types";
|
|
3
|
-
declare const TextInputDefault: ({ disabled, editable, label, error, selectionColor: customSelectionColor, cursorColor, outlineColor: customOutlineColor, activeOutlineColor, outlineStyle, textColor, dense, style, theme, render, multiline, parentState, innerRef, onFocus, forceFocus, onBlur, onChangeText, onLayout, left, right, prefix, suffix, placeholderTextColor, clearButton, contentStyle, value, textError, required, ...rest }: ChildTextInputProps) => React.JSX.Element;
|
|
3
|
+
declare const TextInputDefault: ({ disabled, editable, label, error, selectionColor: customSelectionColor, cursorColor, outlineColor: customOutlineColor, activeOutlineColor, outlineStyle, textColor, dense, style, theme, render, multiline, parentState, innerRef, onFocus, forceFocus, onBlur, onChangeText, onLayout, left, right, prefix, suffix, placeholderTextColor, clearButton, contentStyle, labelStyle, value, textError, required, ...rest }: ChildTextInputProps) => React.JSX.Element;
|
|
4
4
|
export default TextInputDefault;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ChildTextInputProps } from "./types";
|
|
3
|
-
declare const TextInputFlat: ({ disabled, editable, label, error, selectionColor: customSelectionColor, cursorColor, underlineColor, underlineStyle, activeUnderlineColor, textColor, dense, style, theme, render, multiline, parentState, innerRef, onFocus, forceFocus, onBlur, onChangeText, onLayoutAnimatedText, onLabelTextLayout, onLeftAffixLayoutChange, onRightAffixLayoutChange, onInputLayout, left, right, prefix, suffix, placeholderTextColor, clearButton, contentStyle, scaledLabel, outlineStyle, outlineColor, value, textError, required, ...rest }: ChildTextInputProps) => React.JSX.Element;
|
|
3
|
+
declare const TextInputFlat: ({ disabled, editable, label, error, selectionColor: customSelectionColor, cursorColor, underlineColor, underlineStyle, activeUnderlineColor, textColor, dense, style, theme, render, multiline, parentState, innerRef, onFocus, forceFocus, onBlur, onChangeText, onLayoutAnimatedText, onLabelTextLayout, onLeftAffixLayoutChange, onRightAffixLayoutChange, onInputLayout, left, right, prefix, suffix, placeholderTextColor, clearButton, contentStyle, scaledLabel, outlineStyle, outlineColor, value, textError, required, labelScaleValue, ...rest }: ChildTextInputProps) => React.JSX.Element;
|
|
4
4
|
export default TextInputFlat;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { TextInput as NativeTextInput, Animated, TextStyle, LayoutChangeEvent, ColorValue, StyleProp, ViewProps, ViewStyle, NativeSyntheticEvent, TextLayoutEventData } from "react-native";
|
|
2
|
+
import type { TextInput as NativeTextInput, Animated, TextStyle, LayoutChangeEvent, ColorValue, StyleProp, ViewProps, ViewStyle, NativeSyntheticEvent, TextLayoutEventData, TextProps } from "react-native";
|
|
3
3
|
import type { $Omit, InternalTheme, ThemeProp } from "./../../types";
|
|
4
4
|
export type TextInputLabelProp = string | React.ReactElement;
|
|
5
5
|
type TextInputProps = React.ComponentPropsWithRef<typeof NativeTextInput> & {
|
|
@@ -79,6 +79,7 @@ export type State = {
|
|
|
79
79
|
width: number;
|
|
80
80
|
};
|
|
81
81
|
contentStyle?: StyleProp<ViewProps>;
|
|
82
|
+
labelStyle?: StyleProp<TextProps>;
|
|
82
83
|
};
|
|
83
84
|
export type ChildTextInputProps = {
|
|
84
85
|
parentState: State;
|
|
@@ -97,6 +98,8 @@ export type ChildTextInputProps = {
|
|
|
97
98
|
suffix?: string;
|
|
98
99
|
textError?: string;
|
|
99
100
|
required?: boolean;
|
|
101
|
+
labelStyle?: StyleProp<TextProps>;
|
|
102
|
+
labelScaleValue?: number;
|
|
100
103
|
} & $Omit<TextInputTypesWithoutMode, "theme"> & {
|
|
101
104
|
theme: InternalTheme;
|
|
102
105
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -274,6 +274,7 @@ var ref = {
|
|
|
274
274
|
iconPrimaryPressed: ink.INK60,
|
|
275
275
|
iconSuccessDefault: green.GREEN100,
|
|
276
276
|
iconWarningDefault: yellow.YELLOW100,
|
|
277
|
+
iconActionPressed: ink.INK80,
|
|
277
278
|
iconActionDefault: ink.INK60,
|
|
278
279
|
iconActionHovered: ink.INK40,
|
|
279
280
|
iconActionInversePressed: ink.INK60,
|
|
@@ -433,6 +434,7 @@ var ref = {
|
|
|
433
434
|
iconPrimaryPressed: ink.INK60,
|
|
434
435
|
iconSuccessDefault: green.GREEN100,
|
|
435
436
|
iconWarningDefault: yellow.YELLOW100,
|
|
437
|
+
iconActionPressed: ink.INK80,
|
|
436
438
|
iconActionDefault: ink.INK60,
|
|
437
439
|
iconActionHovered: ink.INK40,
|
|
438
440
|
iconActionInversePressed: ink.INK60,
|
|
@@ -1319,16 +1321,18 @@ var LightTheme = {
|
|
|
1319
1321
|
backgroundPrimary: ink.INK5,
|
|
1320
1322
|
backgroundSecondary: white.WHITE100,
|
|
1321
1323
|
borderBrandDefault: blue.BLUE100,
|
|
1324
|
+
borderBrandDisabled: ink.INK20,
|
|
1325
|
+
borderCriticalDisabled: ink.INK20,
|
|
1322
1326
|
borderCriticalDefault: red.RED100,
|
|
1323
1327
|
borderCriticalHover: red.RED80,
|
|
1324
1328
|
borderCriticalPressed: red.RED120,
|
|
1325
1329
|
borderErrorDefault: red.RED100,
|
|
1326
1330
|
borderInfoDefault: blue.BLUE100,
|
|
1327
|
-
borderPrimaryDefault: ink.
|
|
1328
|
-
borderPrimaryDisabled: ink.
|
|
1329
|
-
borderPrimaryHovered: ink.
|
|
1331
|
+
borderPrimaryDefault: ink.INK20,
|
|
1332
|
+
borderPrimaryDisabled: ink.INK20,
|
|
1333
|
+
borderPrimaryHovered: ink.INK40,
|
|
1330
1334
|
borderPrimaryInverseDefault: blue.BLUE100,
|
|
1331
|
-
borderPrimaryPressed: ink.
|
|
1335
|
+
borderPrimaryPressed: ink.INK60,
|
|
1332
1336
|
borderSuccessDefault: green.GREEN100,
|
|
1333
1337
|
borderWarningDefault: yellow.YELLOW100,
|
|
1334
1338
|
iconBrandDefault: blue.BLUE100,
|
|
@@ -1350,29 +1354,36 @@ var LightTheme = {
|
|
|
1350
1354
|
iconPrimaryPressed: ink.INK60,
|
|
1351
1355
|
iconSuccessDefault: green.GREEN100,
|
|
1352
1356
|
iconWarningDefault: yellow.YELLOW100,
|
|
1357
|
+
iconActionPressed: ink.INK80,
|
|
1358
|
+
iconActionDefault: ink.INK60,
|
|
1359
|
+
iconActionHovered: ink.INK40,
|
|
1360
|
+
iconActionInversePressed: ink.INK60,
|
|
1361
|
+
iconActionInverseDefault: white.WHITE100,
|
|
1362
|
+
iconActionInverseHovered: white.WHITE80,
|
|
1363
|
+
iconActionDisabled: ink.INK20,
|
|
1353
1364
|
surfaceBrandDefault: blue.BLUE100,
|
|
1354
|
-
surfaceBrandDisabled: ink.
|
|
1365
|
+
surfaceBrandDisabled: ink.INK5,
|
|
1355
1366
|
surfaceBrandHover: blue.BLUE80,
|
|
1356
1367
|
surfaceBrandInverseDefault: blue.BLUE5,
|
|
1357
1368
|
surfaceBrandInverseHover: blue.BLUE10,
|
|
1358
1369
|
surfaceBrandInversePressed: blue.BLUE20,
|
|
1359
1370
|
surfaceBrandPressed: blue.BLUE120,
|
|
1360
1371
|
surfaceCriticalDefault: red.RED100,
|
|
1361
|
-
surfaceCriticalDisabled: ink.
|
|
1372
|
+
surfaceCriticalDisabled: ink.INK5,
|
|
1362
1373
|
surfaceCriticalHover: red.RED80,
|
|
1363
1374
|
surfaceCriticalInverseDefault: red.RED10,
|
|
1364
1375
|
surfaceCriticalInverseHover: red.RED20,
|
|
1365
1376
|
surfaceCriticalInversePressed: red.RED40,
|
|
1366
1377
|
surfaceCriticalPressed: red.RED120,
|
|
1367
1378
|
surfaceErrorDefault: red.RED100,
|
|
1368
|
-
surfaceErrorDisabled: ink.
|
|
1379
|
+
surfaceErrorDisabled: ink.INK5,
|
|
1369
1380
|
surfaceErrorHover: red.RED80,
|
|
1370
1381
|
surfaceErrorInverseDefault: red.RED10,
|
|
1371
1382
|
surfaceErrorInverseHover: red.RED20,
|
|
1372
1383
|
surfaceErrorInversePressed: red.RED40,
|
|
1373
1384
|
surfaceErrorPressed: red.RED_STATUS,
|
|
1374
1385
|
surfaceInfoDefault: blue.BLUE100,
|
|
1375
|
-
surfaceInfoDisabled: ink.
|
|
1386
|
+
surfaceInfoDisabled: ink.INK5,
|
|
1376
1387
|
surfaceInfoHover: blue.BLUE80,
|
|
1377
1388
|
surfaceInfoInverseDefault: blue.BLUE10,
|
|
1378
1389
|
surfaceInfoInverseHover: blue.BLUE20,
|
|
@@ -1390,14 +1401,14 @@ var LightTheme = {
|
|
|
1390
1401
|
surfaceSecondaryHover: ink.INK10,
|
|
1391
1402
|
surfaceSecondaryPressed: ink.INK20,
|
|
1392
1403
|
surfaceSuccessDefault: green.GREEN100,
|
|
1393
|
-
surfaceSuccessDisabled: ink.
|
|
1404
|
+
surfaceSuccessDisabled: ink.INK5,
|
|
1394
1405
|
surfaceSuccessHover: green.GREEN80,
|
|
1395
1406
|
surfaceSuccessInverseDefault: green.GREEN5,
|
|
1396
1407
|
surfaceSuccessInverseHover: green.GREEN10,
|
|
1397
1408
|
surfaceSuccessInversePressed: green.GREEN20,
|
|
1398
1409
|
surfaceSuccessPressed: green.GREEN_STATUS,
|
|
1399
1410
|
surfaceWarningDefault: yellow.YELLOW100,
|
|
1400
|
-
surfaceWarningDisabled: ink.
|
|
1411
|
+
surfaceWarningDisabled: ink.INK5,
|
|
1401
1412
|
surfaceWarningHover: yellow.YELLOW80,
|
|
1402
1413
|
surfaceWarningInverseDefault: yellow.YELLOW10,
|
|
1403
1414
|
surfaceWarningInverseHover: yellow.YELLOW20,
|
|
@@ -1474,16 +1485,18 @@ var DarkTheme = __assign(__assign({}, LightTheme), { dark: true, mode: "adaptive
|
|
|
1474
1485
|
backgroundPrimary: ink.INK5,
|
|
1475
1486
|
backgroundSecondary: white.WHITE100,
|
|
1476
1487
|
borderBrandDefault: blue.BLUE100,
|
|
1488
|
+
borderBrandDisabled: ink.INK20,
|
|
1489
|
+
borderCriticalDisabled: ink.INK20,
|
|
1477
1490
|
borderCriticalDefault: red.RED100,
|
|
1478
1491
|
borderCriticalHover: red.RED80,
|
|
1479
1492
|
borderCriticalPressed: red.RED120,
|
|
1480
1493
|
borderErrorDefault: red.RED100,
|
|
1481
1494
|
borderInfoDefault: blue.BLUE100,
|
|
1482
|
-
borderPrimaryDefault: ink.
|
|
1483
|
-
borderPrimaryDisabled: ink.
|
|
1484
|
-
borderPrimaryHovered: ink.
|
|
1495
|
+
borderPrimaryDefault: ink.INK20,
|
|
1496
|
+
borderPrimaryDisabled: ink.INK20,
|
|
1497
|
+
borderPrimaryHovered: ink.INK40,
|
|
1485
1498
|
borderPrimaryInverseDefault: blue.BLUE100,
|
|
1486
|
-
borderPrimaryPressed: ink.
|
|
1499
|
+
borderPrimaryPressed: ink.INK60,
|
|
1487
1500
|
borderSuccessDefault: green.GREEN100,
|
|
1488
1501
|
borderWarningDefault: yellow.YELLOW100,
|
|
1489
1502
|
iconBrandDefault: blue.BLUE100,
|
|
@@ -1505,29 +1518,36 @@ var DarkTheme = __assign(__assign({}, LightTheme), { dark: true, mode: "adaptive
|
|
|
1505
1518
|
iconPrimaryPressed: ink.INK60,
|
|
1506
1519
|
iconSuccessDefault: green.GREEN100,
|
|
1507
1520
|
iconWarningDefault: yellow.YELLOW100,
|
|
1521
|
+
iconActionPressed: ink.INK80,
|
|
1522
|
+
iconActionDefault: ink.INK60,
|
|
1523
|
+
iconActionHovered: ink.INK40,
|
|
1524
|
+
iconActionInversePressed: ink.INK60,
|
|
1525
|
+
iconActionInverseDefault: white.WHITE100,
|
|
1526
|
+
iconActionInverseHovered: white.WHITE80,
|
|
1527
|
+
iconActionDisabled: ink.INK20,
|
|
1508
1528
|
surfaceBrandDefault: blue.BLUE100,
|
|
1509
|
-
surfaceBrandDisabled: ink.
|
|
1529
|
+
surfaceBrandDisabled: ink.INK5,
|
|
1510
1530
|
surfaceBrandHover: blue.BLUE80,
|
|
1511
1531
|
surfaceBrandInverseDefault: blue.BLUE5,
|
|
1512
1532
|
surfaceBrandInverseHover: blue.BLUE10,
|
|
1513
1533
|
surfaceBrandInversePressed: blue.BLUE20,
|
|
1514
1534
|
surfaceBrandPressed: blue.BLUE120,
|
|
1515
1535
|
surfaceCriticalDefault: red.RED100,
|
|
1516
|
-
surfaceCriticalDisabled: ink.
|
|
1536
|
+
surfaceCriticalDisabled: ink.INK5,
|
|
1517
1537
|
surfaceCriticalHover: red.RED80,
|
|
1518
1538
|
surfaceCriticalInverseDefault: red.RED10,
|
|
1519
1539
|
surfaceCriticalInverseHover: red.RED20,
|
|
1520
1540
|
surfaceCriticalInversePressed: red.RED40,
|
|
1521
1541
|
surfaceCriticalPressed: red.RED120,
|
|
1522
1542
|
surfaceErrorDefault: red.RED100,
|
|
1523
|
-
surfaceErrorDisabled: ink.
|
|
1543
|
+
surfaceErrorDisabled: ink.INK5,
|
|
1524
1544
|
surfaceErrorHover: red.RED80,
|
|
1525
1545
|
surfaceErrorInverseDefault: red.RED10,
|
|
1526
1546
|
surfaceErrorInverseHover: red.RED20,
|
|
1527
1547
|
surfaceErrorInversePressed: red.RED40,
|
|
1528
1548
|
surfaceErrorPressed: red.RED_STATUS,
|
|
1529
1549
|
surfaceInfoDefault: blue.BLUE100,
|
|
1530
|
-
surfaceInfoDisabled: ink.
|
|
1550
|
+
surfaceInfoDisabled: ink.INK5,
|
|
1531
1551
|
surfaceInfoHover: blue.BLUE80,
|
|
1532
1552
|
surfaceInfoInverseDefault: blue.BLUE10,
|
|
1533
1553
|
surfaceInfoInverseHover: blue.BLUE20,
|
|
@@ -1545,14 +1565,14 @@ var DarkTheme = __assign(__assign({}, LightTheme), { dark: true, mode: "adaptive
|
|
|
1545
1565
|
surfaceSecondaryHover: ink.INK10,
|
|
1546
1566
|
surfaceSecondaryPressed: ink.INK20,
|
|
1547
1567
|
surfaceSuccessDefault: green.GREEN100,
|
|
1548
|
-
surfaceSuccessDisabled: ink.
|
|
1568
|
+
surfaceSuccessDisabled: ink.INK5,
|
|
1549
1569
|
surfaceSuccessHover: green.GREEN80,
|
|
1550
1570
|
surfaceSuccessInverseDefault: green.GREEN5,
|
|
1551
1571
|
surfaceSuccessInverseHover: green.GREEN10,
|
|
1552
1572
|
surfaceSuccessInversePressed: green.GREEN20,
|
|
1553
1573
|
surfaceSuccessPressed: green.GREEN_STATUS,
|
|
1554
1574
|
surfaceWarningDefault: yellow.YELLOW100,
|
|
1555
|
-
surfaceWarningDisabled: ink.
|
|
1575
|
+
surfaceWarningDisabled: ink.INK5,
|
|
1556
1576
|
surfaceWarningHover: yellow.YELLOW80,
|
|
1557
1577
|
surfaceWarningInverseDefault: yellow.YELLOW10,
|
|
1558
1578
|
surfaceWarningInverseHover: yellow.YELLOW20,
|
|
@@ -5064,8 +5084,8 @@ var SvgIcon = function (_a) {
|
|
|
5064
5084
|
};
|
|
5065
5085
|
|
|
5066
5086
|
var TextInputFlat = function (_a) {
|
|
5067
|
-
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.editable, editable = _c === void 0 ? true : _c, label = _a.label, _d = _a.error, error = _d === void 0 ? false : _d, customSelectionColor = _a.selectionColor, cursorColor = _a.cursorColor, underlineColor = _a.underlineColor; _a.underlineStyle; var activeUnderlineColor = _a.activeUnderlineColor, textColor = _a.textColor, dense = _a.dense, style = _a.style, theme = _a.theme, _e = _a.render, render = _e === void 0 ? function (props) { return React$3.createElement(TextInput$1, __assign({}, props)); } : _e, _f = _a.multiline, multiline = _f === void 0 ? false : _f, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus; _a.forceFocus; var onBlur = _a.onBlur, onChangeText = _a.onChangeText, onLayoutAnimatedText = _a.onLayoutAnimatedText, onLabelTextLayout = _a.onLabelTextLayout; _a.onLeftAffixLayoutChange; _a.onRightAffixLayoutChange; var onInputLayout = _a.onInputLayout, left = _a.left, right = _a.right, prefix = _a.prefix, suffix = _a.suffix, placeholderTextColor = _a.placeholderTextColor, clearButton = _a.clearButton, contentStyle = _a.contentStyle, scaledLabel = _a.scaledLabel, outlineStyle = _a.outlineStyle, outlineColor = _a.outlineColor, value = _a.value, textError = _a.textError, required = _a.required, rest = __rest(_a, ["disabled", "editable", "label", "error", "selectionColor", "cursorColor", "underlineColor", "underlineStyle", "activeUnderlineColor", "textColor", "dense", "style", "theme", "render", "multiline", "parentState", "innerRef", "onFocus", "forceFocus", "onBlur", "onChangeText", "onLayoutAnimatedText", "onLabelTextLayout", "onLeftAffixLayoutChange", "onRightAffixLayoutChange", "onInputLayout", "left", "right", "prefix", "suffix", "placeholderTextColor", "clearButton", "contentStyle", "scaledLabel", "outlineStyle", "outlineColor", "value", "textError", "required"]);
|
|
5068
|
-
var
|
|
5087
|
+
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.editable, editable = _c === void 0 ? true : _c, label = _a.label, _d = _a.error, error = _d === void 0 ? false : _d, customSelectionColor = _a.selectionColor, cursorColor = _a.cursorColor, underlineColor = _a.underlineColor; _a.underlineStyle; var activeUnderlineColor = _a.activeUnderlineColor, textColor = _a.textColor, dense = _a.dense, style = _a.style, theme = _a.theme, _e = _a.render, render = _e === void 0 ? function (props) { return React$3.createElement(TextInput$1, __assign({}, props)); } : _e, _f = _a.multiline, multiline = _f === void 0 ? false : _f, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus; _a.forceFocus; var onBlur = _a.onBlur, onChangeText = _a.onChangeText, onLayoutAnimatedText = _a.onLayoutAnimatedText, onLabelTextLayout = _a.onLabelTextLayout; _a.onLeftAffixLayoutChange; _a.onRightAffixLayoutChange; var onInputLayout = _a.onInputLayout, left = _a.left, right = _a.right, prefix = _a.prefix, suffix = _a.suffix, placeholderTextColor = _a.placeholderTextColor, clearButton = _a.clearButton, contentStyle = _a.contentStyle, scaledLabel = _a.scaledLabel, outlineStyle = _a.outlineStyle, outlineColor = _a.outlineColor, value = _a.value, textError = _a.textError, required = _a.required, _g = _a.labelScaleValue, labelScaleValue = _g === void 0 ? MINIMIZED_LABEL_FONT_SIZE : _g, rest = __rest(_a, ["disabled", "editable", "label", "error", "selectionColor", "cursorColor", "underlineColor", "underlineStyle", "activeUnderlineColor", "textColor", "dense", "style", "theme", "render", "multiline", "parentState", "innerRef", "onFocus", "forceFocus", "onBlur", "onChangeText", "onLayoutAnimatedText", "onLabelTextLayout", "onLeftAffixLayoutChange", "onRightAffixLayoutChange", "onInputLayout", "left", "right", "prefix", "suffix", "placeholderTextColor", "clearButton", "contentStyle", "scaledLabel", "outlineStyle", "outlineColor", "value", "textError", "required", "labelScaleValue"]);
|
|
5088
|
+
var _h = React$3.useState(value || ""), inputValue = _h[0], setInputValue = _h[1];
|
|
5069
5089
|
React$3.useEffect(function () {
|
|
5070
5090
|
if (value === undefined) {
|
|
5071
5091
|
setInputValue("");
|
|
@@ -5087,8 +5107,8 @@ var TextInputFlat = function (_a) {
|
|
|
5087
5107
|
var roundness = theme.roundness;
|
|
5088
5108
|
var font = theme.fonts.bodyLarge;
|
|
5089
5109
|
var hasActiveOutline = parentState.focused || error;
|
|
5090
|
-
var
|
|
5091
|
-
var
|
|
5110
|
+
var _j = getConstants(), LABEL_PADDING_TOP = _j.LABEL_PADDING_TOP, FLAT_INPUT_OFFSET = _j.FLAT_INPUT_OFFSET, MIN_HEIGHT = _j.MIN_HEIGHT;
|
|
5111
|
+
var _k = (StyleSheet.flatten(style) || {}), fontSizeStyle = _k.fontSize, lineHeightStyle = _k.lineHeight, fontWeight = _k.fontWeight, height = _k.height, paddingHorizontal = _k.paddingHorizontal; _k.textAlign; __rest(_k, ["fontSize", "lineHeight", "fontWeight", "height", "paddingHorizontal", "textAlign"]);
|
|
5092
5112
|
var fontSize = fontSizeStyle || MAXIMIZED_LABEL_FONT_SIZE;
|
|
5093
5113
|
var lineHeight = lineHeightStyle || (Platform.OS === "web" ? fontSize * 1.2 : undefined);
|
|
5094
5114
|
var isPaddingHorizontalPassed = paddingHorizontal !== undefined && typeof paddingHorizontal === "number";
|
|
@@ -5096,14 +5116,14 @@ var TextInputFlat = function (_a) {
|
|
|
5096
5116
|
left: left,
|
|
5097
5117
|
right: right,
|
|
5098
5118
|
});
|
|
5099
|
-
var
|
|
5119
|
+
var _l = calculateFlatInputHorizontalPadding({
|
|
5100
5120
|
adornmentConfig: adornmentConfig,
|
|
5101
|
-
}), paddingLeft =
|
|
5121
|
+
}), paddingLeft = _l.paddingLeft, paddingRight = _l.paddingRight;
|
|
5102
5122
|
if (isPaddingHorizontalPassed) {
|
|
5103
5123
|
paddingLeft = paddingHorizontal;
|
|
5104
5124
|
paddingRight = paddingHorizontal;
|
|
5105
5125
|
}
|
|
5106
|
-
var
|
|
5126
|
+
var _m = getFlatInputColors({
|
|
5107
5127
|
underlineColor: underlineColor,
|
|
5108
5128
|
activeUnderlineColor: activeUnderlineColor,
|
|
5109
5129
|
customSelectionColor: customSelectionColor,
|
|
@@ -5111,13 +5131,13 @@ var TextInputFlat = function (_a) {
|
|
|
5111
5131
|
disabled: disabled,
|
|
5112
5132
|
error: error,
|
|
5113
5133
|
theme: theme,
|
|
5114
|
-
}), inputTextColor =
|
|
5134
|
+
}), inputTextColor = _m.inputTextColor, activeColor = _m.activeColor, placeholderColor = _m.placeholderColor, errorColor = _m.errorColor, backgroundColor = _m.backgroundColor, selectionColor = _m.selectionColor;
|
|
5115
5135
|
({
|
|
5116
5136
|
backgroundColor: backgroundColor,
|
|
5117
5137
|
borderTopLeftRadius: theme.roundness,
|
|
5118
5138
|
borderTopRightRadius: theme.roundness,
|
|
5119
5139
|
});
|
|
5120
|
-
var labelScale =
|
|
5140
|
+
var labelScale = labelScaleValue / fontSize;
|
|
5121
5141
|
var fontScale = MAXIMIZED_LABEL_FONT_SIZE / fontSize;
|
|
5122
5142
|
var labelWidth = parentState.labelLayout.width;
|
|
5123
5143
|
var labelHeight = parentState.labelLayout.height;
|
|
@@ -5376,7 +5396,7 @@ var styles$e = StyleSheet.create({
|
|
|
5376
5396
|
|
|
5377
5397
|
var TextInputDefault = function (_a) {
|
|
5378
5398
|
var _b, _c;
|
|
5379
|
-
var _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.editable, editable = _e === void 0 ? true : _e, label = _a.label, _f = _a.error, error = _f === void 0 ? false : _f, customSelectionColor = _a.selectionColor, cursorColor = _a.cursorColor, customOutlineColor = _a.outlineColor, activeOutlineColor = _a.activeOutlineColor; _a.outlineStyle; var textColor = _a.textColor; _a.dense; var style = _a.style, theme = _a.theme, _g = _a.render, render = _g === void 0 ? function (props) { return React$3.createElement(TextInput$1, __assign({}, props)); } : _g, _h = _a.multiline, multiline = _h === void 0 ? false : _h, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus; _a.forceFocus; var onBlur = _a.onBlur, onChangeText = _a.onChangeText; _a.onLayout; var left = _a.left, right = _a.right, prefix = _a.prefix, suffix = _a.suffix, placeholderTextColor = _a.placeholderTextColor, _j = _a.clearButton, clearButton = _j === void 0 ? false : _j, contentStyle = _a.contentStyle, _k = _a.value, value = _k === void 0 ? "" : _k, textError = _a.textError, required = _a.required, rest = __rest(_a, ["disabled", "editable", "label", "error", "selectionColor", "cursorColor", "outlineColor", "activeOutlineColor", "outlineStyle", "textColor", "dense", "style", "theme", "render", "multiline", "parentState", "innerRef", "onFocus", "forceFocus", "onBlur", "onChangeText", "onLayout", "left", "right", "prefix", "suffix", "placeholderTextColor", "clearButton", "contentStyle", "value", "textError", "required"]);
|
|
5399
|
+
var _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.editable, editable = _e === void 0 ? true : _e, label = _a.label, _f = _a.error, error = _f === void 0 ? false : _f, customSelectionColor = _a.selectionColor, cursorColor = _a.cursorColor, customOutlineColor = _a.outlineColor, activeOutlineColor = _a.activeOutlineColor; _a.outlineStyle; var textColor = _a.textColor; _a.dense; var style = _a.style, theme = _a.theme, _g = _a.render, render = _g === void 0 ? function (props) { return React$3.createElement(TextInput$1, __assign({}, props)); } : _g, _h = _a.multiline, multiline = _h === void 0 ? false : _h, parentState = _a.parentState, innerRef = _a.innerRef, onFocus = _a.onFocus; _a.forceFocus; var onBlur = _a.onBlur, onChangeText = _a.onChangeText; _a.onLayout; var left = _a.left, right = _a.right, prefix = _a.prefix, suffix = _a.suffix, placeholderTextColor = _a.placeholderTextColor, _j = _a.clearButton, clearButton = _j === void 0 ? false : _j, contentStyle = _a.contentStyle, labelStyle = _a.labelStyle, _k = _a.value, value = _k === void 0 ? "" : _k, textError = _a.textError, required = _a.required, rest = __rest(_a, ["disabled", "editable", "label", "error", "selectionColor", "cursorColor", "outlineColor", "activeOutlineColor", "outlineStyle", "textColor", "dense", "style", "theme", "render", "multiline", "parentState", "innerRef", "onFocus", "forceFocus", "onBlur", "onChangeText", "onLayout", "left", "right", "prefix", "suffix", "placeholderTextColor", "clearButton", "contentStyle", "labelStyle", "value", "textError", "required"]);
|
|
5380
5400
|
var colors = theme.colors;
|
|
5381
5401
|
var font = theme.fonts.bodyLarge;
|
|
5382
5402
|
var _l = (StyleSheet.flatten(style) || {}), fontSizeStyle = _l.fontSize, fontWeight = _l.fontWeight, lineHeightStyle = _l.lineHeight, height = _l.height, _m = _l.backgroundColor; _m === void 0 ? colors === null || colors === void 0 ? void 0 : colors.backgroundPrimary : _m; var textAlign = _l.textAlign; _l.minHeight; var viewStyle = __rest(_l, ["fontSize", "fontWeight", "lineHeight", "height", "backgroundColor", "textAlign", "minHeight"]);
|
|
@@ -5431,6 +5451,9 @@ var TextInputDefault = function (_a) {
|
|
|
5431
5451
|
if (disabled) {
|
|
5432
5452
|
return theme.colors.textSecondary;
|
|
5433
5453
|
}
|
|
5454
|
+
else if (error) {
|
|
5455
|
+
return theme.colors.textErrorDefault;
|
|
5456
|
+
}
|
|
5434
5457
|
else if (parentState.focused) {
|
|
5435
5458
|
return activeColor;
|
|
5436
5459
|
}
|
|
@@ -5449,9 +5472,9 @@ var TextInputDefault = function (_a) {
|
|
|
5449
5472
|
}
|
|
5450
5473
|
else if (((_b = parentState.value) === null || _b === void 0 ? void 0 : _b.toString()) == "") {
|
|
5451
5474
|
return (React$3.createElement(View, { paddingTop: CONSTANTS.SPACE_12 },
|
|
5452
|
-
React$3.createElement(Text$1, { color: getLabelColor(), style: [
|
|
5475
|
+
React$3.createElement(Text$1, { color: getLabelColor(), style: [labelStyle] },
|
|
5453
5476
|
label,
|
|
5454
|
-
required && (React$3.createElement(Text$1, { style: [
|
|
5477
|
+
required && (React$3.createElement(Text$1, { style: [labelStyle], color: theme.colors.textErrorDefault },
|
|
5455
5478
|
" ",
|
|
5456
5479
|
"*")))));
|
|
5457
5480
|
}
|