sapo-components-ui-rn 1.0.30 → 1.0.31

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.esm.js CHANGED
@@ -2608,7 +2608,7 @@ var InputLabel = function (props) {
2608
2608
  var commonStyles = [
2609
2609
  placeholderStyle,
2610
2610
  {
2611
- top: topPosition - (Platform.OS === "android" ? 3 : 2),
2611
+ top: topPosition,
2612
2612
  },
2613
2613
  {
2614
2614
  maxWidth: labelWidth,
@@ -2701,21 +2701,6 @@ var Spacer = function (_a) {
2701
2701
  return React__default.createElement(View, { width: width, height: height, style: [style] });
2702
2702
  };
2703
2703
 
2704
- Dimensions.get("window").height;
2705
- Dimensions.get("window").width;
2706
- var BUTTON_HEIGHT = 48;
2707
- var BUTTON_HEIGHT_SMALL = 40;
2708
- var SPACE_4 = 4;
2709
- var SPACE_6 = 6;
2710
- var SPACE_8 = 8;
2711
- var SPACE_12 = 12;
2712
- var SPACE_16 = 16;
2713
- //MARK: Border radius
2714
- var BORDER_RADIUS_6 = 6;
2715
- //MARK: Border width
2716
- StyleSheet.hairlineWidth; //0.3-0.5
2717
- var BORDER_WIDTH_1 = 1;
2718
-
2719
2704
  var SvgIcon = function (_a) {
2720
2705
  var name = _a.name, _b = _a.width, width = _b === void 0 ? 24 : _b, _c = _a.height, height = _c === void 0 ? 24 : _c, _d = _a.color, color = _d === void 0 ? colors.ink.INK40 : _d, style = _a.style, onPress = _a.onPress, _e = _a.disabled, disabled = _e === void 0 ? false : _e;
2721
2706
  // Kiểm tra kỹ hơn
@@ -2834,7 +2819,7 @@ var TextInputFlat = function (_a) {
2834
2819
  var font = theme.fonts.bodyLarge;
2835
2820
  var hasActiveOutline = parentState.focused || error;
2836
2821
  var _h = getConstants(), LABEL_PADDING_TOP = _h.LABEL_PADDING_TOP, FLAT_INPUT_OFFSET = _h.FLAT_INPUT_OFFSET, MIN_HEIGHT = _h.MIN_HEIGHT;
2837
- 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"]);
2822
+ var _j = (StyleSheet.flatten(style) || {}), fontSizeStyle = _j.fontSize, lineHeightStyle = _j.lineHeight, fontWeight = _j.fontWeight, height = _j.height, paddingHorizontal = _j.paddingHorizontal, textAlign = _j.textAlign, viewStyle = __rest(_j, ["fontSize", "lineHeight", "fontWeight", "height", "paddingHorizontal", "textAlign"]);
2838
2823
  var fontSize = fontSizeStyle || MAXIMIZED_LABEL_FONT_SIZE;
2839
2824
  var lineHeight = lineHeightStyle || (Platform.OS === "web" ? fontSize * 1.2 : undefined);
2840
2825
  var isPaddingHorizontalPassed = paddingHorizontal !== undefined && typeof paddingHorizontal === "number";
@@ -2858,11 +2843,11 @@ var TextInputFlat = function (_a) {
2858
2843
  error: error,
2859
2844
  theme: theme,
2860
2845
  }), inputTextColor = _l.inputTextColor, activeColor = _l.activeColor, placeholderColor = _l.placeholderColor, errorColor = _l.errorColor, backgroundColor = _l.backgroundColor, selectionColor = _l.selectionColor;
2861
- ({
2846
+ var containerStyle = {
2862
2847
  backgroundColor: backgroundColor,
2863
2848
  borderTopLeftRadius: theme.roundness,
2864
2849
  borderTopRightRadius: theme.roundness,
2865
- });
2850
+ };
2866
2851
  var labelScale = MINIMIZED_LABEL_FONT_SIZE / fontSize;
2867
2852
  var fontScale = MAXIMIZED_LABEL_FONT_SIZE / fontSize;
2868
2853
  var labelWidth = parentState.labelLayout.width;
@@ -2970,18 +2955,18 @@ var TextInputFlat = function (_a) {
2970
2955
  return (React$3.createElement(View$1, { style: {
2971
2956
  flexDirection: "row",
2972
2957
  alignItems: "center",
2973
- borderRadius: BORDER_RADIUS_6,
2958
+ borderRadius: CONSTANTS.BORDER_RADIUS_6,
2974
2959
  borderWidth: 1,
2975
2960
  borderColor: getBorderColor(),
2976
- height: 44,
2961
+ height: 48,
2977
2962
  overflow: "hidden",
2978
2963
  backgroundColor: disabled
2979
2964
  ? theme.colors.surfacePrimaryDisabled
2980
2965
  : theme.colors.surfacePrimaryDefault,
2981
2966
  } },
2982
2967
  React$3.createElement(View$1, { style: { flexDirection: "row" } },
2983
- left && React$3.createElement(View$1, { style: { paddingLeft: SPACE_12 } }, left),
2984
- left ? React$3.createElement(Spacer, { width: SPACE_8 }) : React$3.createElement(Spacer, { width: SPACE_12 })),
2968
+ left && (React$3.createElement(View$1, { style: { paddingLeft: CONSTANTS.SPACE_12 } }, left)),
2969
+ left ? (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 })) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 }))),
2985
2970
  React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
2986
2971
  React$3.createElement(View$1, { onLayout: onInputLayout, style: [
2987
2972
  styles$c.labelContainer,
@@ -2990,21 +2975,31 @@ var TextInputFlat = function (_a) {
2990
2975
  flex: 1,
2991
2976
  },
2992
2977
  ] },
2978
+ !isAndroid && multiline && !!label && !disabled && (React$3.createElement(View$1, { pointerEvents: "none", style: [
2979
+ StyleSheet.absoluteFill,
2980
+ dense ? styles$c.densePatchContainer : styles$c.patchContainer,
2981
+ {
2982
+ backgroundColor: viewStyle.backgroundColor || containerStyle.backgroundColor,
2983
+ left: paddingLeft,
2984
+ right: paddingRight,
2985
+ },
2986
+ ] })),
2993
2987
  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 :
2994
2988
  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: [
2995
2989
  styles$c.input,
2996
- __assign(__assign({ paddingLeft: paddingLeft, paddingRight: paddingRight, paddingTop: SPACE_12 }, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
2990
+ __assign(__assign({ paddingLeft: paddingLeft, paddingRight: paddingRight, paddingTop: CONSTANTS.SPACE_12 }, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
2997
2991
  ? textAlign
2998
2992
  : I18nManager.getConstants().isRTL
2999
2993
  ? "right"
3000
- : "left", marginTop: Platform.OS === "android" ? SPACE_8 : 0 }),
2994
+ : "left" }),
2995
+ Platform.OS === "web" && { outline: "none" },
3001
2996
  contentStyle,
3002
2997
  ] }))),
3003
2998
  !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$c.clearButton },
3004
- React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
2999
+ React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
3005
3000
  React$3.createElement(View$1, { style: { flexDirection: "row" } },
3006
- right && React$3.createElement(Spacer, { width: SPACE_8 }),
3007
- right && React$3.createElement(View$1, { style: { paddingRight: SPACE_12 } }, right))));
3001
+ right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
3002
+ right && (React$3.createElement(View$1, { style: { paddingRight: CONSTANTS.SPACE_12 } }, right)))));
3008
3003
  };
3009
3004
  var styles$c = StyleSheet.create({
3010
3005
  placeholder: {
@@ -3019,7 +3014,7 @@ var styles$c = StyleSheet.create({
3019
3014
  input: {
3020
3015
  // margin: 0,
3021
3016
  flex: 1,
3022
- height: 44,
3017
+ height: 48,
3023
3018
  },
3024
3019
  inputFlat: {
3025
3020
  paddingTop: 24,
@@ -3038,7 +3033,7 @@ var styles$c = StyleSheet.create({
3038
3033
  zIndex: 2,
3039
3034
  },
3040
3035
  clearButton: {
3041
- padding: SPACE_8,
3036
+ padding: CONSTANTS.SPACE_8,
3042
3037
  },
3043
3038
  });
3044
3039
 
@@ -6051,6 +6046,21 @@ var styles$9 = StyleSheet.create({
6051
6046
  });
6052
6047
  var index$2 = memoDeepEqual(ButtonIcon);
6053
6048
 
6049
+ Dimensions.get("window").height;
6050
+ Dimensions.get("window").width;
6051
+ var BUTTON_HEIGHT = 48;
6052
+ var BUTTON_HEIGHT_SMALL = 40;
6053
+ var SPACE_4 = 4;
6054
+ var SPACE_6 = 6;
6055
+ var SPACE_8 = 8;
6056
+ var SPACE_12 = 12;
6057
+ var SPACE_16 = 16;
6058
+ //MARK: Border radius
6059
+ var BORDER_RADIUS_6 = 6;
6060
+ //MARK: Border width
6061
+ StyleSheet.hairlineWidth; //0.3-0.5
6062
+ var BORDER_WIDTH_1 = 1;
6063
+
6054
6064
  var FloatingButton = function (_a) {
6055
6065
  var isLoading = _a.isLoading, disabled = _a.disabled, onPress = _a.onPress, style = _a.style, _b = _a.hiddenBackground, hiddenBackground = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? BUTTON_HEIGHT : _c, children = _a.children, backgroundColor = _a.backgroundColor, props = _a.props, _d = _a.top, top = _d === void 0 ? 0 : _d, _e = _a.right, right = _e === void 0 ? 0 : _e, _f = _a.left, left = _f === void 0 ? 0 : _f, _g = _a.bottom, bottom = _g === void 0 ? 0 : _g;
6056
6066
  var colors = useInternalTheme().colors;