sapo-components-ui-rn 1.0.31 → 1.0.32

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,
2611
+ top: topPosition - (Platform.OS === "android" ? 3 : 2),
2612
2612
  },
2613
2613
  {
2614
2614
  maxWidth: labelWidth,
@@ -2701,6 +2701,21 @@ 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
+
2704
2719
  var SvgIcon = function (_a) {
2705
2720
  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;
2706
2721
  // Kiểm tra kỹ hơn
@@ -2819,7 +2834,7 @@ var TextInputFlat = function (_a) {
2819
2834
  var font = theme.fonts.bodyLarge;
2820
2835
  var hasActiveOutline = parentState.focused || error;
2821
2836
  var _h = getConstants(), LABEL_PADDING_TOP = _h.LABEL_PADDING_TOP, FLAT_INPUT_OFFSET = _h.FLAT_INPUT_OFFSET, MIN_HEIGHT = _h.MIN_HEIGHT;
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"]);
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"]);
2823
2838
  var fontSize = fontSizeStyle || MAXIMIZED_LABEL_FONT_SIZE;
2824
2839
  var lineHeight = lineHeightStyle || (Platform.OS === "web" ? fontSize * 1.2 : undefined);
2825
2840
  var isPaddingHorizontalPassed = paddingHorizontal !== undefined && typeof paddingHorizontal === "number";
@@ -2843,11 +2858,11 @@ var TextInputFlat = function (_a) {
2843
2858
  error: error,
2844
2859
  theme: theme,
2845
2860
  }), inputTextColor = _l.inputTextColor, activeColor = _l.activeColor, placeholderColor = _l.placeholderColor, errorColor = _l.errorColor, backgroundColor = _l.backgroundColor, selectionColor = _l.selectionColor;
2846
- var containerStyle = {
2861
+ ({
2847
2862
  backgroundColor: backgroundColor,
2848
2863
  borderTopLeftRadius: theme.roundness,
2849
2864
  borderTopRightRadius: theme.roundness,
2850
- };
2865
+ });
2851
2866
  var labelScale = MINIMIZED_LABEL_FONT_SIZE / fontSize;
2852
2867
  var fontScale = MAXIMIZED_LABEL_FONT_SIZE / fontSize;
2853
2868
  var labelWidth = parentState.labelLayout.width;
@@ -2955,18 +2970,18 @@ var TextInputFlat = function (_a) {
2955
2970
  return (React$3.createElement(View$1, { style: {
2956
2971
  flexDirection: "row",
2957
2972
  alignItems: "center",
2958
- borderRadius: CONSTANTS.BORDER_RADIUS_6,
2973
+ borderRadius: BORDER_RADIUS_6,
2959
2974
  borderWidth: 1,
2960
2975
  borderColor: getBorderColor(),
2961
- height: 48,
2976
+ height: 44,
2962
2977
  overflow: "hidden",
2963
2978
  backgroundColor: disabled
2964
2979
  ? theme.colors.surfacePrimaryDisabled
2965
2980
  : theme.colors.surfacePrimaryDefault,
2966
2981
  } },
2967
2982
  React$3.createElement(View$1, { style: { flexDirection: "row" } },
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 }))),
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 })),
2970
2985
  React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
2971
2986
  React$3.createElement(View$1, { onLayout: onInputLayout, style: [
2972
2987
  styles$c.labelContainer,
@@ -2975,31 +2990,21 @@ var TextInputFlat = function (_a) {
2975
2990
  flex: 1,
2976
2991
  },
2977
2992
  ] },
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
- ] })),
2987
2993
  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 :
2988
2994
  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: [
2989
2995
  styles$c.input,
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
2996
+ __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
2991
2997
  ? textAlign
2992
2998
  : I18nManager.getConstants().isRTL
2993
2999
  ? "right"
2994
- : "left" }),
2995
- Platform.OS === "web" && { outline: "none" },
3000
+ : "left", marginTop: Platform.OS === "android" ? SPACE_8 : 0 }),
2996
3001
  contentStyle,
2997
3002
  ] }))),
2998
3003
  !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$c.clearButton },
2999
- React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
3004
+ React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
3000
3005
  React$3.createElement(View$1, { style: { flexDirection: "row" } },
3001
- right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
3002
- right && (React$3.createElement(View$1, { style: { paddingRight: CONSTANTS.SPACE_12 } }, right)))));
3006
+ right && React$3.createElement(Spacer, { width: SPACE_8 }),
3007
+ right && React$3.createElement(View$1, { style: { paddingRight: SPACE_12 } }, right))));
3003
3008
  };
3004
3009
  var styles$c = StyleSheet.create({
3005
3010
  placeholder: {
@@ -3014,7 +3019,7 @@ var styles$c = StyleSheet.create({
3014
3019
  input: {
3015
3020
  // margin: 0,
3016
3021
  flex: 1,
3017
- height: 48,
3022
+ height: 44,
3018
3023
  },
3019
3024
  inputFlat: {
3020
3025
  paddingTop: 24,
@@ -3033,7 +3038,7 @@ var styles$c = StyleSheet.create({
3033
3038
  zIndex: 2,
3034
3039
  },
3035
3040
  clearButton: {
3036
- padding: CONSTANTS.SPACE_8,
3041
+ padding: SPACE_8,
3037
3042
  },
3038
3043
  });
3039
3044
 
@@ -6046,21 +6051,6 @@ var styles$9 = StyleSheet.create({
6046
6051
  });
6047
6052
  var index$2 = memoDeepEqual(ButtonIcon);
6048
6053
 
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
-
6064
6054
  var FloatingButton = function (_a) {
6065
6055
  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;
6066
6056
  var colors = useInternalTheme().colors;