sapo-components-ui-rn 1.0.51 → 1.0.53

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.
@@ -7,7 +7,7 @@ interface AvatarProps {
7
7
  backgroundColor?: string;
8
8
  style?: StyleProp<ViewStyle>;
9
9
  textColor?: string;
10
- size: 64 | 48 | 24;
10
+ size?: 64 | 48 | 32;
11
11
  source?: string;
12
12
  onPress?: () => void;
13
13
  textStyle?: StyleProp<TextStyle>;
@@ -7,6 +7,7 @@ export type Props = React.ComponentPropsWithRef<typeof NativeTextInput> & {
7
7
  mode?: "flat" | "default";
8
8
  left?: React.ReactNode;
9
9
  right?: React.ReactNode;
10
+ prefix?: string;
10
11
  /**
11
12
  * If true, user won't be able to interact with the component.
12
13
  */
@@ -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, placeholderTextColor, clearButton, contentStyle, scaledLabel, outlineStyle, outlineColor, value, ...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, placeholderTextColor, clearButton, contentStyle, scaledLabel, outlineStyle, outlineColor, value, ...rest }: ChildTextInputProps) => React.JSX.Element;
4
4
  export default TextInputFlat;
@@ -93,6 +93,7 @@ export type ChildTextInputProps = {
93
93
  onLeftAffixLayoutChange: (event: LayoutChangeEvent) => void;
94
94
  onRightAffixLayoutChange: (event: LayoutChangeEvent) => void;
95
95
  clearButton?: boolean;
96
+ prefix?: string;
96
97
  } & $Omit<TextInputTypesWithoutMode, "theme"> & {
97
98
  theme: InternalTheme;
98
99
  };
package/dist/index.esm.js CHANGED
@@ -563,6 +563,7 @@ var CONSTANTS = {
563
563
  BUTTON_HEIGHT_SMALL: 36,
564
564
  RADIO_BUTTON_HEIGHT: 20,
565
565
  BUTTON_ICON: 36,
566
+ BUTTON_ICON_SMALL: 36,
566
567
  SPACE_0: 0,
567
568
  SPACE_2: 2,
568
569
  SPACE_4: 4,
@@ -2876,233 +2877,6 @@ var Icon = function (_a) {
2876
2877
  };
2877
2878
  var Icon$1 = React__default.memo(Icon);
2878
2879
 
2879
- var TextInputFlat = function (_a) {
2880
- 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, placeholderTextColor = _a.placeholderTextColor, clearButton = _a.clearButton, contentStyle = _a.contentStyle, scaledLabel = _a.scaledLabel, outlineStyle = _a.outlineStyle, outlineColor = _a.outlineColor, value = _a.value, 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", "placeholderTextColor", "clearButton", "contentStyle", "scaledLabel", "outlineStyle", "outlineColor", "value"]);
2881
- var _g = React$3.useState(value || ""), inputValue = _g[0], setInputValue = _g[1];
2882
- React$3.useEffect(function () {
2883
- setInputValue(value || "");
2884
- }, [value]);
2885
- var handleChangeText = function (text) {
2886
- setInputValue(text);
2887
- onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
2888
- };
2889
- var handleClear = function () {
2890
- setInputValue("");
2891
- onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText("");
2892
- };
2893
- var isAndroid = Platform.OS === "android";
2894
- var roundness = theme.roundness;
2895
- var font = theme.fonts.bodyLarge;
2896
- var hasActiveOutline = parentState.focused || error;
2897
- var _h = getConstants(), LABEL_PADDING_TOP = _h.LABEL_PADDING_TOP, FLAT_INPUT_OFFSET = _h.FLAT_INPUT_OFFSET, MIN_HEIGHT = _h.MIN_HEIGHT;
2898
- var _j = (StyleSheet.flatten(style) || {}), fontSizeStyle = _j.fontSize, lineHeightStyle = _j.lineHeight, fontWeight = _j.fontWeight, height = _j.height, paddingHorizontal = _j.paddingHorizontal, textAlign = _j.textAlign; __rest(_j, ["fontSize", "lineHeight", "fontWeight", "height", "paddingHorizontal", "textAlign"]);
2899
- var fontSize = fontSizeStyle || MAXIMIZED_LABEL_FONT_SIZE;
2900
- var lineHeight = lineHeightStyle || (Platform.OS === "web" ? fontSize * 1.2 : undefined);
2901
- var isPaddingHorizontalPassed = paddingHorizontal !== undefined && typeof paddingHorizontal === "number";
2902
- var adornmentConfig = getAdornmentConfig({
2903
- left: left,
2904
- right: right,
2905
- });
2906
- var _k = calculateFlatInputHorizontalPadding({
2907
- adornmentConfig: adornmentConfig,
2908
- }), paddingLeft = _k.paddingLeft, paddingRight = _k.paddingRight;
2909
- if (isPaddingHorizontalPassed) {
2910
- paddingLeft = paddingHorizontal;
2911
- paddingRight = paddingHorizontal;
2912
- }
2913
- var _l = getFlatInputColors({
2914
- underlineColor: underlineColor,
2915
- activeUnderlineColor: activeUnderlineColor,
2916
- customSelectionColor: customSelectionColor,
2917
- textColor: textColor,
2918
- disabled: disabled,
2919
- error: error,
2920
- theme: theme,
2921
- }), inputTextColor = _l.inputTextColor, activeColor = _l.activeColor, placeholderColor = _l.placeholderColor, errorColor = _l.errorColor, backgroundColor = _l.backgroundColor, selectionColor = _l.selectionColor;
2922
- ({
2923
- backgroundColor: backgroundColor,
2924
- borderTopLeftRadius: theme.roundness,
2925
- borderTopRightRadius: theme.roundness,
2926
- });
2927
- var labelScale = MINIMIZED_LABEL_FONT_SIZE / fontSize;
2928
- var fontScale = MAXIMIZED_LABEL_FONT_SIZE / fontSize;
2929
- var labelWidth = parentState.labelLayout.width;
2930
- var labelHeight = parentState.labelLayout.height;
2931
- var labelHalfWidth = labelWidth / 2;
2932
- var labelHalfHeight = labelHeight / 2;
2933
- var baseLabelTranslateX = (I18nManager.getConstants().isRTL ? 1 : -1) *
2934
- (labelHalfWidth - (labelScale * labelWidth) / 2) +
2935
- (1 - labelScale) *
2936
- (I18nManager.getConstants().isRTL ? -1 : 1) *
2937
- paddingLeft;
2938
- var minInputHeight = dense
2939
- ? (label ? MIN_DENSE_HEIGHT_WL : MIN_DENSE_HEIGHT) - LABEL_PADDING_TOP_DENSE
2940
- : MIN_HEIGHT - LABEL_PADDING_TOP;
2941
- var inputHeight = calculateInputHeight(labelHeight, height, minInputHeight);
2942
- var topPosition = calculateLabelTopPosition(labelHeight, inputHeight, multiline && height ? 0 : !height ? minInputHeight / 2 : 0);
2943
- if (height && typeof height !== "number") {
2944
- // eslint-disable-next-line
2945
- console.warn("Currently we support only numbers in height prop");
2946
- }
2947
- var paddingSettings = {
2948
- height: height ? +height : null,
2949
- labelHalfHeight: labelHalfHeight,
2950
- offset: FLAT_INPUT_OFFSET,
2951
- multiline: multiline ? multiline : null,
2952
- dense: dense ? dense : null,
2953
- topPosition: topPosition,
2954
- fontSize: fontSize,
2955
- lineHeight: lineHeight,
2956
- label: label,
2957
- scale: fontScale,
2958
- isAndroid: isAndroid,
2959
- styles: StyleSheet.flatten(dense ? styles$b.inputFlatDense : styles$b.inputFlat),
2960
- };
2961
- var pad = calculatePadding(paddingSettings);
2962
- adjustPaddingFlat(__assign(__assign({}, paddingSettings), { pad: pad }));
2963
- var baseLabelTranslateY = -labelHalfHeight - (topPosition + MINIMIZED_LABEL_Y_OFFSET);
2964
- var placeholderOpacityAnims = React$3.useRef([
2965
- new Animated.Value(0),
2966
- new Animated.Value(1),
2967
- ]).current;
2968
- var placeholderOpacity = hasActiveOutline
2969
- ? parentState.labeled
2970
- : placeholderOpacityAnims[parentState.labelLayout.measured ? 1 : 0];
2971
- // We don't want to show placeholder if label is displayed, because they overlap.
2972
- // Before it was done by setting placeholder's value to " ", but inputs have the same props
2973
- // what causes broken styles due to: https://github.com/facebook/react-native/issues/48249
2974
- var placeholderTextColorBasedOnState = parentState.displayPlaceholder
2975
- ? placeholderTextColor !== null && placeholderTextColor !== void 0 ? placeholderTextColor : placeholderColor
2976
- : "transparent";
2977
- var minHeight = height ||
2978
- (dense ? (label ? MIN_DENSE_HEIGHT_WL : MIN_DENSE_HEIGHT) : MIN_HEIGHT);
2979
- var labelProps = {
2980
- label: label,
2981
- onLayoutAnimatedText: onLayoutAnimatedText,
2982
- onLabelTextLayout: onLabelTextLayout,
2983
- placeholderOpacity: placeholderOpacity,
2984
- labelError: error,
2985
- placeholderStyle: styles$b.placeholder,
2986
- baseLabelTranslateY: baseLabelTranslateY,
2987
- baseLabelTranslateX: baseLabelTranslateX,
2988
- font: font,
2989
- fontSize: fontSize,
2990
- lineHeight: lineHeight,
2991
- fontWeight: fontWeight,
2992
- labelScale: labelScale,
2993
- wiggleOffsetX: LABEL_WIGGLE_X_OFFSET,
2994
- topPosition: topPosition,
2995
- paddingLeft: isAndroid
2996
- ? I18nManager.isRTL
2997
- ? paddingRight
2998
- : paddingLeft
2999
- : paddingLeft,
3000
- paddingRight: isAndroid
3001
- ? I18nManager.isRTL
3002
- ? paddingLeft
3003
- : paddingRight
3004
- : paddingRight,
3005
- hasActiveOutline: hasActiveOutline,
3006
- activeColor: activeColor,
3007
- placeholderColor: placeholderColor,
3008
- errorColor: errorColor,
3009
- roundness: roundness,
3010
- maxFontSizeMultiplier: rest.maxFontSizeMultiplier,
3011
- contentStyle: contentStyle,
3012
- inputContainerLayout: parentState.inputContainerLayout,
3013
- labelTextLayout: parentState.labelTextLayout,
3014
- opacity: parentState.value || parentState.focused
3015
- ? parentState.labelLayout.measured
3016
- ? 1
3017
- : 0
3018
- : 1,
3019
- };
3020
- var getBorderColor = function () {
3021
- if (disabled) {
3022
- return theme.colors.surfacePrimaryDisabled;
3023
- }
3024
- else if (parentState.focused) {
3025
- return activeColor;
3026
- }
3027
- else {
3028
- return theme.colors.borderPrimaryDefault;
3029
- }
3030
- };
3031
- return (React$3.createElement(View$1, { style: {
3032
- flexDirection: "row",
3033
- alignItems: "center",
3034
- borderRadius: BORDER_RADIUS_6,
3035
- borderWidth: 1,
3036
- borderColor: getBorderColor(),
3037
- height: 44,
3038
- overflow: "hidden",
3039
- backgroundColor: disabled
3040
- ? theme.colors.surfacePrimaryDisabled
3041
- : theme.colors.surfacePrimaryDefault,
3042
- } },
3043
- React$3.createElement(View$1, { style: { flexDirection: "row" } },
3044
- left && React$3.createElement(View$1, { style: { paddingLeft: SPACE_12 } }, left),
3045
- left ? React$3.createElement(Spacer, { width: SPACE_8 }) : React$3.createElement(Spacer, { width: SPACE_12 })),
3046
- React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
3047
- React$3.createElement(View$1, { onLayout: onInputLayout, style: [
3048
- styles$b.labelContainer,
3049
- {
3050
- minHeight: minHeight,
3051
- flex: 1,
3052
- },
3053
- ] },
3054
- label ? (React$3.createElement(InputLabel$1, __assign({ labeled: parentState.labeled, error: parentState.error, focused: parentState.focused, scaledLabel: scaledLabel, wiggle: Boolean(parentState.value && labelProps.labelError), labelLayoutMeasured: parentState.labelLayout.measured, labelLayoutWidth: parentState.labelLayout.width, labelLayoutHeight: parentState.labelLayout.height }, labelProps))) : null, render === null || render === void 0 ? void 0 :
3055
- render(__assign(__assign({}, rest), { ref: innerRef, onChangeText: handleChangeText, value: inputValue, placeholder: rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined" ? activeColor : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
3056
- styles$b.input,
3057
- __assign(__assign({ paddingLeft: paddingLeft, paddingRight: paddingRight, paddingTop: parentState.focused || parentState.value ? SPACE_12 : 0 }, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
3058
- ? textAlign
3059
- : I18nManager.getConstants().isRTL
3060
- ? "right"
3061
- : "left", marginTop: Platform.OS === "android" ? SPACE_8 : 0 }),
3062
- contentStyle,
3063
- ] }))),
3064
- !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$b.clearButton },
3065
- React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
3066
- React$3.createElement(View$1, { style: { flexDirection: "row" } },
3067
- right && React$3.createElement(Spacer, { width: SPACE_8 }),
3068
- right && React$3.createElement(View$1, { style: { paddingRight: SPACE_12 } }, right))));
3069
- };
3070
- var styles$b = StyleSheet.create({
3071
- placeholder: {
3072
- position: "absolute",
3073
- left: 0,
3074
- },
3075
- labelContainer: {
3076
- paddingTop: 0,
3077
- paddingBottom: 0,
3078
- // flex: 1,
3079
- },
3080
- input: {
3081
- // margin: 0,
3082
- flex: 1,
3083
- height: 44,
3084
- },
3085
- inputFlat: {
3086
- paddingTop: 24,
3087
- paddingBottom: 4,
3088
- },
3089
- inputFlatDense: {
3090
- paddingTop: 22,
3091
- paddingBottom: 2,
3092
- },
3093
- patchContainer: {
3094
- height: 24,
3095
- zIndex: 2,
3096
- },
3097
- densePatchContainer: {
3098
- height: 22,
3099
- zIndex: 2,
3100
- },
3101
- clearButton: {
3102
- padding: SPACE_8,
3103
- },
3104
- });
3105
-
3106
2880
  /**
3107
2881
  * Removes all key-value entries from the list cache.
3108
2882
  *
@@ -5607,6 +5381,256 @@ var Text = function (props) {
5607
5381
  };
5608
5382
  var Text$1 = memoDeepEqual(Text);
5609
5383
 
5384
+ var TextInputFlat = function (_a) {
5385
+ 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, placeholderTextColor = _a.placeholderTextColor, clearButton = _a.clearButton, contentStyle = _a.contentStyle, scaledLabel = _a.scaledLabel, outlineStyle = _a.outlineStyle, outlineColor = _a.outlineColor, value = _a.value, 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", "placeholderTextColor", "clearButton", "contentStyle", "scaledLabel", "outlineStyle", "outlineColor", "value"]);
5386
+ var _g = React$3.useState(value || ""), inputValue = _g[0], setInputValue = _g[1];
5387
+ React$3.useEffect(function () {
5388
+ setInputValue(value || "");
5389
+ }, [value]);
5390
+ var handleChangeText = function (text) {
5391
+ setInputValue(text);
5392
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
5393
+ };
5394
+ var handleClear = function () {
5395
+ setInputValue("");
5396
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText("");
5397
+ };
5398
+ var isAndroid = Platform.OS === "android";
5399
+ var roundness = theme.roundness;
5400
+ var font = theme.fonts.bodyLarge;
5401
+ var hasActiveOutline = parentState.focused || error;
5402
+ var _h = getConstants(), LABEL_PADDING_TOP = _h.LABEL_PADDING_TOP, FLAT_INPUT_OFFSET = _h.FLAT_INPUT_OFFSET, MIN_HEIGHT = _h.MIN_HEIGHT;
5403
+ var _j = (StyleSheet.flatten(style) || {}), fontSizeStyle = _j.fontSize, lineHeightStyle = _j.lineHeight, fontWeight = _j.fontWeight, height = _j.height, paddingHorizontal = _j.paddingHorizontal, textAlign = _j.textAlign; __rest(_j, ["fontSize", "lineHeight", "fontWeight", "height", "paddingHorizontal", "textAlign"]);
5404
+ var fontSize = fontSizeStyle || MAXIMIZED_LABEL_FONT_SIZE;
5405
+ var lineHeight = lineHeightStyle || (Platform.OS === "web" ? fontSize * 1.2 : undefined);
5406
+ var isPaddingHorizontalPassed = paddingHorizontal !== undefined && typeof paddingHorizontal === "number";
5407
+ var adornmentConfig = getAdornmentConfig({
5408
+ left: left,
5409
+ right: right,
5410
+ });
5411
+ var _k = calculateFlatInputHorizontalPadding({
5412
+ adornmentConfig: adornmentConfig,
5413
+ }), paddingLeft = _k.paddingLeft, paddingRight = _k.paddingRight;
5414
+ if (isPaddingHorizontalPassed) {
5415
+ paddingLeft = paddingHorizontal;
5416
+ paddingRight = paddingHorizontal;
5417
+ }
5418
+ var _l = getFlatInputColors({
5419
+ underlineColor: underlineColor,
5420
+ activeUnderlineColor: activeUnderlineColor,
5421
+ customSelectionColor: customSelectionColor,
5422
+ textColor: textColor,
5423
+ disabled: disabled,
5424
+ error: error,
5425
+ theme: theme,
5426
+ }), inputTextColor = _l.inputTextColor, activeColor = _l.activeColor, placeholderColor = _l.placeholderColor, errorColor = _l.errorColor, backgroundColor = _l.backgroundColor, selectionColor = _l.selectionColor;
5427
+ ({
5428
+ backgroundColor: backgroundColor,
5429
+ borderTopLeftRadius: theme.roundness,
5430
+ borderTopRightRadius: theme.roundness,
5431
+ });
5432
+ var labelScale = MINIMIZED_LABEL_FONT_SIZE / fontSize;
5433
+ var fontScale = MAXIMIZED_LABEL_FONT_SIZE / fontSize;
5434
+ var labelWidth = parentState.labelLayout.width;
5435
+ var labelHeight = parentState.labelLayout.height;
5436
+ var labelHalfWidth = labelWidth / 2;
5437
+ var labelHalfHeight = labelHeight / 2;
5438
+ var baseLabelTranslateX = (I18nManager.getConstants().isRTL ? 1 : -1) *
5439
+ (labelHalfWidth - (labelScale * labelWidth) / 2) +
5440
+ (1 - labelScale) *
5441
+ (I18nManager.getConstants().isRTL ? -1 : 1) *
5442
+ paddingLeft;
5443
+ var minInputHeight = dense
5444
+ ? (label ? MIN_DENSE_HEIGHT_WL : MIN_DENSE_HEIGHT) - LABEL_PADDING_TOP_DENSE
5445
+ : MIN_HEIGHT - LABEL_PADDING_TOP;
5446
+ var inputHeight = calculateInputHeight(labelHeight, height, minInputHeight);
5447
+ var topPosition = calculateLabelTopPosition(labelHeight, inputHeight, multiline && height ? 0 : !height ? minInputHeight / 2 : 0);
5448
+ if (height && typeof height !== "number") {
5449
+ // eslint-disable-next-line
5450
+ console.warn("Currently we support only numbers in height prop");
5451
+ }
5452
+ var paddingSettings = {
5453
+ height: height ? +height : null,
5454
+ labelHalfHeight: labelHalfHeight,
5455
+ offset: FLAT_INPUT_OFFSET,
5456
+ multiline: multiline ? multiline : null,
5457
+ dense: dense ? dense : null,
5458
+ topPosition: topPosition,
5459
+ fontSize: fontSize,
5460
+ lineHeight: lineHeight,
5461
+ label: label,
5462
+ scale: fontScale,
5463
+ isAndroid: isAndroid,
5464
+ styles: StyleSheet.flatten(dense ? styles$b.inputFlatDense : styles$b.inputFlat),
5465
+ };
5466
+ var pad = calculatePadding(paddingSettings);
5467
+ adjustPaddingFlat(__assign(__assign({}, paddingSettings), { pad: pad }));
5468
+ var baseLabelTranslateY = -labelHalfHeight - (topPosition + MINIMIZED_LABEL_Y_OFFSET);
5469
+ var placeholderOpacityAnims = React$3.useRef([
5470
+ new Animated.Value(0),
5471
+ new Animated.Value(1),
5472
+ ]).current;
5473
+ var placeholderOpacity = hasActiveOutline
5474
+ ? parentState.labeled
5475
+ : placeholderOpacityAnims[parentState.labelLayout.measured ? 1 : 0];
5476
+ // We don't want to show placeholder if label is displayed, because they overlap.
5477
+ // Before it was done by setting placeholder's value to " ", but inputs have the same props
5478
+ // what causes broken styles due to: https://github.com/facebook/react-native/issues/48249
5479
+ var placeholderTextColorBasedOnState = parentState.displayPlaceholder
5480
+ ? placeholderTextColor !== null && placeholderTextColor !== void 0 ? placeholderTextColor : placeholderColor
5481
+ : "transparent";
5482
+ var minHeight = height ||
5483
+ (dense ? (label ? MIN_DENSE_HEIGHT_WL : MIN_DENSE_HEIGHT) : MIN_HEIGHT);
5484
+ var labelProps = {
5485
+ label: label,
5486
+ onLayoutAnimatedText: onLayoutAnimatedText,
5487
+ onLabelTextLayout: onLabelTextLayout,
5488
+ placeholderOpacity: placeholderOpacity,
5489
+ labelError: error,
5490
+ placeholderStyle: styles$b.placeholder,
5491
+ baseLabelTranslateY: baseLabelTranslateY,
5492
+ baseLabelTranslateX: baseLabelTranslateX,
5493
+ font: font,
5494
+ fontSize: fontSize,
5495
+ lineHeight: lineHeight,
5496
+ fontWeight: fontWeight,
5497
+ labelScale: labelScale,
5498
+ wiggleOffsetX: LABEL_WIGGLE_X_OFFSET,
5499
+ topPosition: topPosition,
5500
+ paddingLeft: isAndroid
5501
+ ? I18nManager.isRTL
5502
+ ? paddingRight
5503
+ : paddingLeft
5504
+ : paddingLeft,
5505
+ paddingRight: isAndroid
5506
+ ? I18nManager.isRTL
5507
+ ? paddingLeft
5508
+ : paddingRight
5509
+ : paddingRight,
5510
+ hasActiveOutline: hasActiveOutline,
5511
+ activeColor: activeColor,
5512
+ placeholderColor: placeholderColor,
5513
+ errorColor: errorColor,
5514
+ roundness: roundness,
5515
+ maxFontSizeMultiplier: rest.maxFontSizeMultiplier,
5516
+ contentStyle: contentStyle,
5517
+ inputContainerLayout: parentState.inputContainerLayout,
5518
+ labelTextLayout: parentState.labelTextLayout,
5519
+ opacity: parentState.value || parentState.focused
5520
+ ? parentState.labelLayout.measured
5521
+ ? 1
5522
+ : 0
5523
+ : 1,
5524
+ };
5525
+ var getBorderColor = function () {
5526
+ if (disabled) {
5527
+ return theme.colors.surfacePrimaryDisabled;
5528
+ }
5529
+ else if (parentState.focused) {
5530
+ return activeColor;
5531
+ }
5532
+ else {
5533
+ return theme.colors.borderPrimaryDefault;
5534
+ }
5535
+ };
5536
+ var renderPrefix = function () {
5537
+ var _a;
5538
+ if (parentState.focused) {
5539
+ return (React$3.createElement(View$1, { style: {
5540
+ paddingBottom: Platform.OS === "ios" ? 9 : 13,
5541
+ } },
5542
+ React$3.createElement(Text$1, { color: theme.colors.textSecondary },
5543
+ prefix, " ")));
5544
+ }
5545
+ else if (parentState.value !== undefined &&
5546
+ ((_a = parentState.value) === null || _a === void 0 ? void 0 : _a.toString()) !== "") {
5547
+ return (React$3.createElement(View$1, { style: {
5548
+ paddingBottom: Platform.OS === "ios" ? 9 : 13,
5549
+ } },
5550
+ React$3.createElement(Text$1, { color: theme.colors.textSecondary },
5551
+ prefix, " ")));
5552
+ }
5553
+ return React$3.createElement(View$1, null);
5554
+ };
5555
+ return (React$3.createElement(View$1, { style: {
5556
+ flexDirection: "row",
5557
+ alignItems: "center",
5558
+ borderRadius: BORDER_RADIUS_6,
5559
+ borderWidth: 1,
5560
+ borderColor: getBorderColor(),
5561
+ height: 48,
5562
+ overflow: "hidden",
5563
+ backgroundColor: disabled
5564
+ ? theme.colors.surfacePrimaryDisabled
5565
+ : theme.colors.surfacePrimaryDefault,
5566
+ } },
5567
+ React$3.createElement(View$1, { style: { flexDirection: "row", height: "100%" } },
5568
+ left && React$3.createElement(View$1, { style: { paddingLeft: SPACE_12 } }, left),
5569
+ left ? React$3.createElement(Spacer, { width: SPACE_8 }) : React$3.createElement(Spacer, { width: SPACE_12 })),
5570
+ React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
5571
+ React$3.createElement(View$1, { onLayout: onInputLayout, style: [
5572
+ styles$b.labelContainer,
5573
+ {
5574
+ minHeight: minHeight,
5575
+ flex: 1,
5576
+ },
5577
+ ] },
5578
+ label ? (React$3.createElement(InputLabel$1, __assign({ labeled: parentState.labeled, error: parentState.error, focused: parentState.focused, scaledLabel: scaledLabel, wiggle: Boolean(parentState.value && labelProps.labelError), labelLayoutMeasured: parentState.labelLayout.measured, labelLayoutWidth: parentState.labelLayout.width, labelLayoutHeight: parentState.labelLayout.height }, labelProps))) : null,
5579
+ React$3.createElement(View$1, { style: { flexDirection: "row", alignItems: "flex-end" } },
5580
+ renderPrefix(), render === null || render === void 0 ? void 0 :
5581
+ render(__assign(__assign({}, rest), { ref: innerRef, onChangeText: handleChangeText, value: inputValue, placeholder: rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined" ? activeColor : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
5582
+ styles$b.input,
5583
+ __assign(__assign({ paddingLeft: paddingLeft, paddingRight: paddingRight, paddingTop: parentState.focused || parentState.value ? SPACE_12 : 0 }, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
5584
+ ? textAlign
5585
+ : I18nManager.getConstants().isRTL
5586
+ ? "right"
5587
+ : "left", marginTop: Platform.OS === "android" ? SPACE_8 : 0 }),
5588
+ contentStyle,
5589
+ ] })))),
5590
+ !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$b.clearButton },
5591
+ React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
5592
+ React$3.createElement(View$1, { style: { flexDirection: "row", height: "100%", paddingBottom: SPACE_6 } },
5593
+ right && !clearButton && React$3.createElement(Spacer, { width: SPACE_8 }),
5594
+ right && (React$3.createElement(View$1, { style: {
5595
+ paddingRight: SPACE_12,
5596
+ } }, right)))));
5597
+ };
5598
+ var styles$b = StyleSheet.create({
5599
+ placeholder: {
5600
+ position: "absolute",
5601
+ left: 0,
5602
+ },
5603
+ labelContainer: {
5604
+ paddingTop: 0,
5605
+ paddingBottom: 0,
5606
+ // flex: 1,
5607
+ },
5608
+ input: {
5609
+ // margin: 0,
5610
+ flex: 1,
5611
+ height: 48,
5612
+ },
5613
+ inputFlat: {
5614
+ paddingTop: 24,
5615
+ paddingBottom: 4,
5616
+ },
5617
+ inputFlatDense: {
5618
+ paddingTop: 22,
5619
+ paddingBottom: 2,
5620
+ },
5621
+ patchContainer: {
5622
+ height: 24,
5623
+ zIndex: 2,
5624
+ },
5625
+ densePatchContainer: {
5626
+ height: 22,
5627
+ zIndex: 2,
5628
+ },
5629
+ clearButton: {
5630
+ padding: SPACE_8,
5631
+ },
5632
+ });
5633
+
5610
5634
  var TextInputDefault = function (_a) {
5611
5635
  var _b;
5612
5636
  var _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.editable, editable = _d === void 0 ? true : _d, label = _a.label, _e = _a.error, error = _e === void 0 ? false : _e, 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, _f = _a.render, render = _f === void 0 ? function (props) { return React$3.createElement(TextInput$1, __assign({}, props)); } : _f, _g = _a.multiline, multiline = _g === void 0 ? false : _g, 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, placeholderTextColor = _a.placeholderTextColor, _h = _a.clearButton, clearButton = _h === void 0 ? false : _h, contentStyle = _a.contentStyle, _j = _a.value, value = _j === void 0 ? "" : _j, 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", "placeholderTextColor", "clearButton", "contentStyle", "value"]);
@@ -5700,7 +5724,7 @@ var TextInputDefault = function (_a) {
5700
5724
  left && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
5701
5725
  React$3.createElement(View, { full: true, style: [
5702
5726
  {
5703
- height: height || 44,
5727
+ height: height || 48,
5704
5728
  },
5705
5729
  ] },
5706
5730
  multiline && renderLabel(), render === null || render === void 0 ? void 0 :
@@ -5714,19 +5738,23 @@ var TextInputDefault = function (_a) {
5714
5738
  ? textAlign
5715
5739
  : I18nManager.getConstants().isRTL
5716
5740
  ? "right"
5717
- : "left", height: height ? height : 44, paddingTop: getPaddingTopValue(), paddingBottom: multiline ? CONSTANTS.SPACE_4 : 0 }),
5741
+ : "left", height: height ? height : 48, paddingTop: getPaddingTopValue(), paddingBottom: multiline ? CONSTANTS.SPACE_4 : 0 }),
5718
5742
  contentStyle,
5719
5743
  ] }))),
5720
5744
  !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$a.clearButtonMultiline : styles$a.clearButton },
5721
5745
  React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
5722
- right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
5723
- right && (React$3.createElement(View, { center: true, paddingRight: CONSTANTS.SPACE_12 }, right)))));
5746
+ right && !clearButton && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_2 }),
5747
+ right && (React$3.createElement(View, { style: {
5748
+ height: "100%",
5749
+ paddingBottom: CONSTANTS.SPACE_12,
5750
+ paddingRight: CONSTANTS.SPACE_12,
5751
+ } }, right)))));
5724
5752
  };
5725
5753
  var styles$a = StyleSheet.create({
5726
5754
  input: {
5727
5755
  margin: 0,
5728
5756
  flex: 1,
5729
- height: 44,
5757
+ height: 48,
5730
5758
  paddingLeft: 0,
5731
5759
  // paddingTop: Platform.OS === "ios" ? CONSTANTS.SPACE_4 : CONSTANTS.SPACE_2,
5732
5760
  },
@@ -6738,7 +6766,7 @@ var styles$3 = StyleSheet.create(__assign(__assign({}, containerStyles), { icon:
6738
6766
  } }));
6739
6767
 
6740
6768
  var Avatar = function (_a) {
6741
- var children = _a.children, _b = _a.name, name = _b === void 0 ? "Sapo" : _b, backgroundColor = _a.backgroundColor, style = _a.style, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? 64 : _c, source = _a.source, onPress = _a.onPress, textStyle = _a.textStyle, imageStyle = _a.imageStyle;
6769
+ var children = _a.children, _b = _a.name, name = _b === void 0 ? "Sapo" : _b, backgroundColor = _a.backgroundColor, style = _a.style, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? 32 : _c, source = _a.source, onPress = _a.onPress, textStyle = _a.textStyle, imageStyle = _a.imageStyle;
6742
6770
  var theme = useInternalTheme();
6743
6771
  var colors = theme.colors;
6744
6772
  var getInitials = function (name) {
@@ -6757,7 +6785,7 @@ var Avatar = function (_a) {
6757
6785
  return 28;
6758
6786
  case 48:
6759
6787
  return 20;
6760
- case 24:
6788
+ case 32:
6761
6789
  return 16;
6762
6790
  default:
6763
6791
  return 16;