sapo-components-ui-rn 1.0.0 → 1.0.2

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.js CHANGED
@@ -259,7 +259,7 @@ var ref = {
259
259
  gray: ink.INK60,
260
260
  backgroundLight: ink.INK80,
261
261
  //new theme colors
262
- backgroundPrimary: ink.INK100,
262
+ backgroundPrimary: ink.INK5,
263
263
  backgroundSecondary: white.WHITE100,
264
264
  borderBrandDefault: blue.BLUE100,
265
265
  borderCriticalDefault: red.RED100,
@@ -340,7 +340,7 @@ var ref = {
340
340
  surfaceWarningInverseHover: yellow.YELLOW20,
341
341
  surfaceWarningInversePressed: yellow.YELLOW40,
342
342
  surfaceWarningPressed: yellow.YELLOW120,
343
- textDefault: ink.INK5,
343
+ textDefault: ink.INK100,
344
344
  textDisabled: ink.INK20,
345
345
  textPlaceholder: ink.INK40,
346
346
  textSecondary: ink.INK60,
@@ -1301,7 +1301,7 @@ var DarkTheme = __assign(__assign({}, LightTheme), { dark: true, mode: "adaptive
1301
1301
  level5: "rgb(52, 49, 63)",
1302
1302
  },
1303
1303
  //new theme colors
1304
- backgroundPrimary: ink.INK100,
1304
+ backgroundPrimary: ink.INK5,
1305
1305
  backgroundSecondary: white.WHITE100,
1306
1306
  borderBrandDefault: blue.BLUE100,
1307
1307
  borderCriticalDefault: red.RED100,
@@ -1382,7 +1382,7 @@ var DarkTheme = __assign(__assign({}, LightTheme), { dark: true, mode: "adaptive
1382
1382
  surfaceWarningInverseHover: yellow.YELLOW20,
1383
1383
  surfaceWarningInversePressed: yellow.YELLOW40,
1384
1384
  surfaceWarningPressed: yellow.YELLOW120,
1385
- textDefault: ink.INK5,
1385
+ textDefault: ink.INK100,
1386
1386
  textDisabled: ink.INK20,
1387
1387
  textPlaceholder: ink.INK40,
1388
1388
  textSecondary: ink.INK60,
@@ -1940,7 +1940,7 @@ var styles$g = reactNative.StyleSheet.create({
1940
1940
  });
1941
1941
 
1942
1942
  var ViewCustom = function (_a) {
1943
- var row = _a.row, full = _a.full, justifyCenter = _a.justifyCenter, justifyBetween = _a.justifyBetween, alignCenter = _a.alignCenter, center = _a.center, color = _a.color, backgroundColor = _a.backgroundColor, width = _a.width, height = _a.height, padding = _a.padding, paddingHorizontal = _a.paddingHorizontal, paddingVertical = _a.paddingVertical, marginHorizontal = _a.marginHorizontal, marginVertical = _a.marginVertical, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight, paddingTop = _a.paddingTop, alignEnd = _a.alignEnd, wrap = _a.wrap, borderBottomWidth = _a.borderBottomWidth, borderBottomColor = _a.borderBottomColor, borderRadius = _a.borderRadius, borderWidth = _a.borderWidth, borderColor = _a.borderColor, style = _a.style, onPress = _a.onPress, activeOpacity = _a.activeOpacity, children = _a.children;
1943
+ var row = _a.row, full = _a.full, justifyCenter = _a.justifyCenter, justifyBetween = _a.justifyBetween, alignCenter = _a.alignCenter, center = _a.center, color = _a.color, backgroundColor = _a.backgroundColor, width = _a.width, height = _a.height, padding = _a.padding, paddingHorizontal = _a.paddingHorizontal, paddingVertical = _a.paddingVertical, marginHorizontal = _a.marginHorizontal, marginVertical = _a.marginVertical, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight, paddingTop = _a.paddingTop, alignEnd = _a.alignEnd, wrap = _a.wrap, borderBottomWidth = _a.borderBottomWidth, borderBottomColor = _a.borderBottomColor, borderRadius = _a.borderRadius, borderWidth = _a.borderWidth, borderColor = _a.borderColor, style = _a.style, onPress = _a.onPress, activeOpacity = _a.activeOpacity, children = _a.children, disabled = _a.disabled;
1944
1944
  var getStyle = function () {
1945
1945
  var styleCustom = {};
1946
1946
  if (row) {
@@ -2023,7 +2023,7 @@ var ViewCustom = function (_a) {
2023
2023
  };
2024
2024
  var defaultStyle = getStyle();
2025
2025
  var Component = onPress ? reactNative.TouchableOpacity : reactNative.View;
2026
- return (React__default["default"].createElement(Component, { activeOpacity: activeOpacity, onPress: onPress, style: [defaultStyle, style] }, children));
2026
+ return (React__default["default"].createElement(Component, { activeOpacity: activeOpacity, onPress: onPress, disabled: disabled, style: [defaultStyle, style] }, children));
2027
2027
  };
2028
2028
  var View = React__default["default"].memo(ViewCustom);
2029
2029
 
@@ -2756,6 +2756,9 @@ var IconArrowDown = function (props) { return (React__namespace.createElement(Sv
2756
2756
  var IconClearText = function (props) { return (React__namespace.createElement(Svg__default["default"], __assign({ width: 24, height: 24, viewBox: "0 0 24 24", fill: "none" }, props),
2757
2757
  React__namespace.createElement(Svg.Path, { d: "M12 2.00043C17.53 2.00043 22 6.47046 22 12.0004C21.9997 17.5302 17.5298 22.0004 12 22.0004C6.47016 22.0004 2.00026 17.5302 2 12.0004C2.00004 6.47046 6.47003 2.00043 12 2.00043ZM12 10.5903L9.41016 8.00043L8 9.40961L10.5898 12.0004L8 14.5903L9.41016 16.0004L12 13.4096L14.5898 16.0004L16 14.5903L13.4102 12.0004L16 9.40961L14.5898 8.00043L12 10.5903Z", fill: "currentColor" }))); };
2758
2758
 
2759
+ var IconSearch = function (props) { return (React__namespace.createElement(Svg__default["default"], __assign({ width: 16, height: 16, viewBox: "0 0 16 16", fill: "none" }, props),
2760
+ React__namespace.createElement(Svg.Path, { d: "M15.7 14.3L11.5 10.1C11.3 9.9 11 9.8 10.7 9.8C11.5 8.8 12 7.4 12 6C12 2.7 9.3 0 6 0C2.7 0 0 2.7 0 6C0 9.3 2.7 12 6 12C7.4 12 8.8 11.5 9.8 10.6C9.8 10.9 9.8 11.2 10.1 11.4L14.3 15.6C14.5 15.8 14.8 15.9 15 15.9C15.2 15.9 15.5 15.8 15.7 15.6C16.1 15.3 16.1 14.7 15.7 14.3ZM6 10.5C3.5 10.5 1.5 8.5 1.5 6C1.5 3.5 3.5 1.5 6 1.5C8.5 1.5 10.5 3.5 10.5 6C10.5 8.5 8.5 10.5 6 10.5Z", fill: "currentColor" }))); };
2761
+
2759
2762
  var getIconComponent = function (type) {
2760
2763
  switch (type) {
2761
2764
  case "MaterialIcons":
@@ -2788,6 +2791,8 @@ var Icon = function (_a) {
2788
2791
  return IconArrowDown;
2789
2792
  case "IconClearText":
2790
2793
  return IconClearText;
2794
+ case "IconSearch":
2795
+ return IconSearch;
2791
2796
  default:
2792
2797
  return IconCheckbox;
2793
2798
  }
@@ -6529,11 +6534,11 @@ var ChipBar = function (_a) {
6529
6534
  }, [isActive]);
6530
6535
  return (React__default["default"].createElement(View, { row: true },
6531
6536
  React__default["default"].createElement(View, { row: true, disabled: disabled, paddingHorizontal: CONSTANTS.SPACE_12, paddingVertical: CONSTANTS.SPACE_8, borderRadius: borderRadius, borderWidth: 1, alignCenter: true, style: [
6532
- style,
6533
6537
  disabled && {
6534
6538
  backgroundColor: colors.surfaceSecondaryDefault,
6535
6539
  borderColor: colors.surfaceSecondaryDefault,
6536
6540
  },
6541
+ style,
6537
6542
  ], onPress: handlePressChipBar, borderColor: active ? colors.borderBrandDefault : colors.borderPrimaryDefault, backgroundColor: active
6538
6543
  ? colors.surfaceBrandInverseDefault
6539
6544
  : colors.backgroundSecondary },
@@ -6738,6 +6743,17 @@ var styles = reactNative.StyleSheet.create(__assign(__assign({}, containerStyles
6738
6743
  } }));
6739
6744
  var index = React__default["default"].memo(SelectionField);
6740
6745
 
6746
+ var SearchInput = function (_a) {
6747
+ var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, rightIcon = _a.rightIcon, _d = _a.clearButton, clearButton = _d === void 0 ? false : _d, _e = _a.placeholder, placeholder = _e === void 0 ? "Tìm kiếm" : _e, onFocus = _a.onFocus, onBlur = _a.onBlur, onChangeText = _a.onChangeText, style = _a.style;
6748
+ return (React__default["default"].createElement(TextInput, { left: React__default["default"].createElement(View, { paddingRight: SPACE_8 },
6749
+ React__default["default"].createElement(Icon$1, { name: "IconSearch", type: "Svg", size: 24 })), disabled: disabled, value: value, clearButton: clearButton, mode: "default", placeholder: placeholder, right: rightIcon, onFocus: onFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: onChangeText, contentStyle: [
6750
+ {
6751
+ height: 36,
6752
+ },
6753
+ style,
6754
+ ] }));
6755
+ };
6756
+
6741
6757
  var toastRef = React__default["default"].createRef();
6742
6758
  var showToast = function (_a) {
6743
6759
  var message = _a.message, _b = _a.duration, duration = _b === void 0 ? 5000 : _b, _c = _a.position, position = _c === void 0 ? "top" : _c, _d = _a.type, type = _d === void 0 ? "success" : _d, _e = _a.onPress, onPress = _e === void 0 ? function () { } : _e, title = _a.title;
@@ -6803,6 +6819,7 @@ exports.Image = Image$1;
6803
6819
  exports.LightTheme = LightTheme;
6804
6820
  exports.ProgressBar = ProgressBar;
6805
6821
  exports.RadioButton = RadioButton;
6822
+ exports.SearchInput = SearchInput;
6806
6823
  exports.SelectionField = index;
6807
6824
  exports.Spacer = Spacer;
6808
6825
  exports.Switch = Switch;