@servesall/atoms 1.1.7 → 1.1.10

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.
@@ -233,6 +233,7 @@
233
233
  greenLight: "#F3FFFC",
234
234
  greenDark: "#236A56",
235
235
  greyText: "#b2bec3",
236
+ greyButton: "#94A3A9",
236
237
  red: "#ff7675",
237
238
  redlight: "#FFFAF9",
238
239
  redDark: "#9C4140",
@@ -288,8 +289,8 @@
288
289
  return React__default["default"].useContext(styled.ThemeContext);
289
290
  };
290
291
 
291
- var _templateObject$m, _templateObject2$d, _templateObject3$6, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
292
- var H1 = styled__default["default"].Text(_templateObject$m || (_templateObject$m = _taggedTemplateLiteral(["\n font-size: ", ";\n font-family: ", ";\n text-align: ", ";\n color: ", ";\n line-height: ", ";\n ", ";\n"])), function (props) {
292
+ var _templateObject$n, _templateObject2$e, _templateObject3$7, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
293
+ var H1 = styled__default["default"].Text(_templateObject$n || (_templateObject$n = _taggedTemplateLiteral(["\n font-size: ", ";\n font-family: ", ";\n text-align: ", ";\n color: ", ";\n line-height: ", ";\n ", ";\n"])), function (props) {
293
294
  return props.theme.large;
294
295
  }, function (props) {
295
296
  return props.fontFamily || props.theme.fontFamily1;
@@ -302,7 +303,7 @@
302
303
  }, function (props) {
303
304
  return props.style;
304
305
  });
305
- var H2 = styled__default["default"].Text(_templateObject2$d || (_templateObject2$d = _taggedTemplateLiteral(["\n font-size: ", ";\n font-family: ", ";\n text-align: ", ";\n color: ", ";\n line-height: ", ";\n ", ";\n"])), function (props) {
306
+ var H2 = styled__default["default"].Text(_templateObject2$e || (_templateObject2$e = _taggedTemplateLiteral(["\n font-size: ", ";\n font-family: ", ";\n text-align: ", ";\n color: ", ";\n line-height: ", ";\n ", ";\n"])), function (props) {
306
307
  return props.theme.medium;
307
308
  }, function (props) {
308
309
  return props.fontFamily || props.theme.fontFamily1;
@@ -315,7 +316,7 @@
315
316
  }, function (props) {
316
317
  return props.style;
317
318
  });
318
- var H3 = styled__default["default"].Text(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteral(["\n font-size: ", ";\n font-family: ", ";\n text-align: ", ";\n color: ", ";\n line-height: ", ";\n ", ";\n"])), function (props) {
319
+ var H3 = styled__default["default"].Text(_templateObject3$7 || (_templateObject3$7 = _taggedTemplateLiteral(["\n font-size: ", ";\n font-family: ", ";\n text-align: ", ";\n color: ", ";\n line-height: ", ";\n ", ";\n"])), function (props) {
319
320
  return props.theme.small;
320
321
  }, function (props) {
321
322
  return props.fontFamily || props.theme.fontFamily1;
@@ -542,14 +543,14 @@
542
543
  style: PropTypes__default["default"].object
543
544
  };
544
545
 
545
- var _templateObject$l, _templateObject2$c, _templateObject3$5, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
546
+ var _templateObject$m, _templateObject2$d, _templateObject3$6, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
546
547
  var DEFAULT_FLEX_DIRECTION = reactNative.Platform.OS === "web" ? "column" : "column";
547
- var CenterElement = styled__default["default"].View(_templateObject$l || (_templateObject$l = _taggedTemplateLiteral(["\n align-items: center;\n justify-content: center;\n flex: 1;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
548
+ var CenterElement = styled__default["default"].View(_templateObject$m || (_templateObject$m = _taggedTemplateLiteral(["\n align-items: center;\n justify-content: center;\n flex: 1;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
548
549
  return props.flexDirection || DEFAULT_FLEX_DIRECTION;
549
550
  }, function (props) {
550
551
  return props.style;
551
552
  });
552
- var CenterLeftElement = styled__default["default"].View(_templateObject2$c || (_templateObject2$c = _taggedTemplateLiteral(["\n align-items: ", ";\n justify-content: ", ";\n flex: 1;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
553
+ var CenterLeftElement = styled__default["default"].View(_templateObject2$d || (_templateObject2$d = _taggedTemplateLiteral(["\n align-items: ", ";\n justify-content: ", ";\n flex: 1;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
553
554
  return (props.flexDirection || DEFAULT_FLEX_DIRECTION) === "row" ? "center" : "flex-start";
554
555
  }, function (props) {
555
556
  return (props.flexDirection || DEFAULT_FLEX_DIRECTION) === "row" ? "flex-start" : "center";
@@ -558,7 +559,7 @@
558
559
  }, function (props) {
559
560
  return props.style;
560
561
  });
561
- var CenterRightElement = styled__default["default"].View(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteral(["\n align-items: ", ";\n justify-content: ", ";\n flex: 1;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
562
+ var CenterRightElement = styled__default["default"].View(_templateObject3$6 || (_templateObject3$6 = _taggedTemplateLiteral(["\n align-items: ", ";\n justify-content: ", ";\n flex: 1;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
562
563
  return (props.flexDirection || DEFAULT_FLEX_DIRECTION) === "row" ? "center" : "flex-end";
563
564
  }, function (props) {
564
565
  return (props.flexDirection || DEFAULT_FLEX_DIRECTION) === "row" ? "flex-end" : "center";
@@ -644,25 +645,39 @@
644
645
  }, function (props) {
645
646
  return props.style;
646
647
  });
647
- var RowElement = styled__default["default"].View(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n flex-direction: row;\n ", ";\n"])), function (props) {
648
+ var PaddingLeftElement = styled__default["default"].View(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n padding-left: ", ";\n flex-direction: ", ";\n ", ";\n"])), function (props) {
649
+ return props.theme.padding;
650
+ }, function (props) {
651
+ return props.flexDirection || DEFAULT_FLEX_DIRECTION;
652
+ }, function (props) {
653
+ return props.style;
654
+ });
655
+ var PaddingRightElement = styled__default["default"].View(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n padding-right: ", ";\n flex-direction: ", ";\n ", ";\n"])), function (props) {
656
+ return props.theme.padding;
657
+ }, function (props) {
658
+ return props.flexDirection || DEFAULT_FLEX_DIRECTION;
659
+ }, function (props) {
648
660
  return props.style;
649
661
  });
650
- var StretchElement = styled__default["default"].View(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n align-items: stretch;\n align-self: stretch;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
662
+ var RowElement = styled__default["default"].View(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n flex-direction: row;\n ", ";\n"])), function (props) {
663
+ return props.style;
664
+ });
665
+ var StretchElement = styled__default["default"].View(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n align-items: stretch;\n align-self: stretch;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
651
666
  return props.flexDirection || DEFAULT_FLEX_DIRECTION;
652
667
  }, function (props) {
653
668
  return props.style;
654
669
  });
655
- var BoxElement = styled__default["default"].View(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n flex: 1;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
670
+ var BoxElement = styled__default["default"].View(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n flex: 1;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
656
671
  return props.flexDirection || DEFAULT_FLEX_DIRECTION;
657
672
  }, function (props) {
658
673
  return props.style;
659
674
  });
660
- var FullScreenElement = styled__default["default"].View(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 11;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
675
+ var FullScreenElement = styled__default["default"].View(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 11;\n flex-direction: ", ";\n ", ";\n"])), function (props) {
661
676
  return props.flexDirection || DEFAULT_FLEX_DIRECTION;
662
677
  }, function (props) {
663
678
  return props.style;
664
679
  });
665
- var WebSmallWrapperElement = styled__default["default"].View(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n flex-direction: ", ";\n width: 500px;\n ", ";\n"])), function (props) {
680
+ var WebSmallWrapperElement = styled__default["default"].View(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n flex-direction: ", ";\n width: 500px;\n ", ";\n"])), function (props) {
666
681
  return props.flexDirection || DEFAULT_FLEX_DIRECTION;
667
682
  }, function (props) {
668
683
  return props.style;
@@ -822,6 +837,28 @@
822
837
  }, children);
823
838
  };
824
839
 
840
+ var PaddingLeft = function PaddingLeft(_ref) {
841
+ var children = _ref.children,
842
+ style = _ref.style,
843
+ _ref$direction = _ref.direction,
844
+ direction = _ref$direction === void 0 ? false : _ref$direction;
845
+ return /*#__PURE__*/React__default["default"].createElement(PaddingLeftElement, {
846
+ style: style,
847
+ flexDirection: direction
848
+ }, children);
849
+ };
850
+
851
+ var PaddingRight = function PaddingRight(_ref) {
852
+ var children = _ref.children,
853
+ style = _ref.style,
854
+ _ref$direction = _ref.direction,
855
+ direction = _ref$direction === void 0 ? false : _ref$direction;
856
+ return /*#__PURE__*/React__default["default"].createElement(PaddingRightElement, {
857
+ style: style,
858
+ flexDirection: direction
859
+ }, children);
860
+ };
861
+
825
862
  var Row = function Row(_ref) {
826
863
  var children = _ref.children,
827
864
  style = _ref.style;
@@ -893,22 +930,22 @@
893
930
  }, children);
894
931
  };
895
932
 
896
- var _templateObject$k, _templateObject2$b, _templateObject3$4;
897
- var InputWrapper$1 = styled__default["default"].Pressable(_templateObject$k || (_templateObject$k = _taggedTemplateLiteral(["\n min-height: 80px;\n"])));
898
- var InputElement$1 = styled__default["default"].TextInput(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteral(["\n margin-top: 26px;\n min-height: 50px;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n"])), function (props) {
933
+ var _templateObject$l, _templateObject2$c, _templateObject3$5;
934
+ var InputWrapper$2 = styled__default["default"].Pressable(_templateObject$l || (_templateObject$l = _taggedTemplateLiteral(["\n min-height: 80px;\n"])));
935
+ var InputElement$2 = styled__default["default"].TextInput(_templateObject2$c || (_templateObject2$c = _taggedTemplateLiteral(["\n margin-top: 26px;\n min-height: 50px;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n"])), function (props) {
899
936
  return props.theme.fontFamily2;
900
937
  }, function (props) {
901
938
  return props.theme.small;
902
939
  }, function (props) {
903
940
  return props.theme.color2;
904
941
  });
905
- var BorderWrapper$2 = styled__default["default"].View(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n height: 4px;\n"])));
942
+ var BorderWrapper$3 = styled__default["default"].View(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteral(["\n height: 4px;\n"])));
906
943
 
907
- var _templateObject$j, _templateObject2$a;
908
- var BorderIdle$1 = styled__default["default"].View(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n height: 4px;\n background-color: ", ";\n flex: 1;\n position: absolute;\n width: 100%;\n z-index: 10;\n"])), function (props) {
944
+ var _templateObject$k, _templateObject2$b;
945
+ var BorderIdle$1 = styled__default["default"].View(_templateObject$k || (_templateObject$k = _taggedTemplateLiteral(["\n height: 4px;\n background-color: ", ";\n flex: 1;\n position: absolute;\n width: 100%;\n z-index: 10;\n"])), function (props) {
909
946
  return props.color;
910
947
  });
911
- var BorderActive$1 = styled__default["default"].View(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteral(["\n height: 4px;\n background-color: ", ";\n z-index: 11;\n"])), function (props) {
948
+ var BorderActive$1 = styled__default["default"].View(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteral(["\n height: 4px;\n background-color: ", ";\n z-index: 11;\n"])), function (props) {
912
949
  return props.color;
913
950
  });
914
951
 
@@ -944,7 +981,7 @@
944
981
  })));
945
982
  };
946
983
 
947
- var PlaceholderElement$1 = /*#__PURE__*/React__default["default"].memo(function (_ref) {
984
+ var PlaceholderElement$2 = /*#__PURE__*/React__default["default"].memo(function (_ref) {
948
985
  var children = _ref.children,
949
986
  active = _ref.active;
950
987
  var bottom = Animated.useSharedValue(active ? 50 : 4);
@@ -1024,18 +1061,18 @@
1024
1061
  return /*#__PURE__*/React__default["default"].createElement(reactNative.KeyboardAvoidingView, {
1025
1062
  behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
1026
1063
  keyboardVerticalOffset: keyboardVerticalOffset
1027
- }, /*#__PURE__*/React__default["default"].createElement(InputWrapper$1, {
1064
+ }, /*#__PURE__*/React__default["default"].createElement(InputWrapper$2, {
1028
1065
  onPress: function onPress() {
1029
1066
  var _inputRef$current2;
1030
1067
 
1031
1068
  setIsFocused(true);
1032
1069
  (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
1033
1070
  }
1034
- }, /*#__PURE__*/React__default["default"].createElement(PlaceholderElement$1, {
1071
+ }, /*#__PURE__*/React__default["default"].createElement(PlaceholderElement$2, {
1035
1072
  active: isFocused || textValue && textValue.length > 0
1036
1073
  }, !hasError ? children : /*#__PURE__*/React__default["default"].createElement(H3Text, {
1037
1074
  color: borderColorError
1038
- }, error || hasError)), /*#__PURE__*/React__default["default"].createElement(InputElement$1, {
1075
+ }, error || hasError)), /*#__PURE__*/React__default["default"].createElement(InputElement$2, {
1039
1076
  ref: inputRef,
1040
1077
  onFocus: function onFocus() {
1041
1078
  return setIsFocused(true);
@@ -1055,7 +1092,7 @@
1055
1092
  keyboardType: keyboardType,
1056
1093
  editable: editable,
1057
1094
  style: style
1058
- }), /*#__PURE__*/React__default["default"].createElement(BorderWrapper$2, null, /*#__PURE__*/React__default["default"].createElement(Line$1, {
1095
+ }), /*#__PURE__*/React__default["default"].createElement(BorderWrapper$3, null, /*#__PURE__*/React__default["default"].createElement(Line$1, {
1059
1096
  active: isFocused,
1060
1097
  borderColorActive: borderColorActive,
1061
1098
  borderColorIdle: borderColorIdle,
@@ -1202,9 +1239,9 @@
1202
1239
  }))));
1203
1240
  };
1204
1241
 
1205
- var _templateObject$i, _templateObject2$9, _templateObject3$3;
1206
- var InputWrapper = styled__default["default"].Pressable(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n min-height: 70px;\n"])));
1207
- var InputElement = styled__default["default"].TextInput(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteral(["\n min-height: 40px;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n"])), function (props) {
1242
+ var _templateObject$j, _templateObject2$a, _templateObject3$4;
1243
+ var InputWrapper$1 = styled__default["default"].Pressable(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n min-height: 70px;\n"])));
1244
+ var InputElement$1 = styled__default["default"].TextInput(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteral(["\n min-height: 40px;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n"])), function (props) {
1208
1245
  return props.theme.fontFamily2;
1209
1246
  }, function (props) {
1210
1247
  return props.theme.small;
@@ -1213,15 +1250,31 @@
1213
1250
  }, function (props) {
1214
1251
  return props.active ? props.theme.color1 : props.theme.color10;
1215
1252
  });
1216
- var BorderWrapper$1 = styled__default["default"].View(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n min-height: 70px;\n padding-top: 26px;\n border-width: 2px;\n border-color: ", ";\n border-radius: ", ";\n background-color: ", ";\n"])), function (props) {
1253
+ var BorderWrapper$2 = styled__default["default"].View(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n min-height: 70px;\n padding-top: 26px;\n border-width: 2px;\n border-color: ", ";\n border-radius: ", ";\n background-color: ", ";\n ", "\n"])), function (props) {
1217
1254
  return props.color;
1218
1255
  }, function (props) {
1219
1256
  return props.theme.borderRadiusSmall;
1220
1257
  }, function (props) {
1221
1258
  return props.active ? props.theme.color1 : props.theme.color10;
1259
+ }, function (_ref) {
1260
+ var isRightBound = _ref.isRightBound,
1261
+ isLeftBound = _ref.isLeftBound,
1262
+ active = _ref.active;
1263
+
1264
+ if (isRightBound) {
1265
+ if (!active) {
1266
+ return "borderTopRightRadius: 0px; borderBottomRightRadius: 0px; border-right-width: 0px;";
1267
+ }
1268
+
1269
+ return "borderTopRightRadius: 0px; borderBottomRightRadius: 0px;";
1270
+ }
1271
+
1272
+ if (isLeftBound) {
1273
+ return "borderTopLeftRadius: 0px; borderBottomLeftRadius: 0px;";
1274
+ }
1222
1275
  });
1223
1276
 
1224
- var PlaceholderElement = /*#__PURE__*/React__default["default"].memo(function (_ref) {
1277
+ var PlaceholderElement$1 = /*#__PURE__*/React__default["default"].memo(function (_ref) {
1225
1278
  var children = _ref.children,
1226
1279
  active = _ref.active;
1227
1280
  var top = Animated.useSharedValue(active ? 10 : 30);
@@ -1278,7 +1331,11 @@
1278
1331
  keyboardVerticalOffset = _ref$keyboardVertical === void 0 ? 0 : _ref$keyboardVertical,
1279
1332
  _ref$hasError = _ref.hasError,
1280
1333
  hasError = _ref$hasError === void 0 ? false : _ref$hasError,
1281
- error = _ref.error;
1334
+ error = _ref.error,
1335
+ _ref$isRightBound = _ref.isRightBound,
1336
+ isRightBound = _ref$isRightBound === void 0 ? false : _ref$isRightBound,
1337
+ _ref$isLeftBound = _ref.isLeftBound,
1338
+ isLeftBound = _ref$isLeftBound === void 0 ? false : _ref$isLeftBound;
1282
1339
 
1283
1340
  var _useState = React.useState(false),
1284
1341
  _useState2 = _slicedToArray(_useState, 2),
@@ -1302,7 +1359,7 @@
1302
1359
  return /*#__PURE__*/React__default["default"].createElement(reactNative.KeyboardAvoidingView, {
1303
1360
  behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
1304
1361
  keyboardVerticalOffset: keyboardVerticalOffset
1305
- }, /*#__PURE__*/React__default["default"].createElement(InputWrapper, {
1362
+ }, /*#__PURE__*/React__default["default"].createElement(InputWrapper$1, {
1306
1363
  onPress: function onPress() {
1307
1364
  var _inputRef$current2;
1308
1365
 
@@ -1311,14 +1368,16 @@
1311
1368
  editable && setIsFocused(true);
1312
1369
  editable && ((_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus());
1313
1370
  }
1314
- }, /*#__PURE__*/React__default["default"].createElement(BorderWrapper$1, {
1371
+ }, /*#__PURE__*/React__default["default"].createElement(BorderWrapper$2, {
1372
+ isRightBound: isRightBound,
1373
+ isLeftBound: isLeftBound,
1315
1374
  active: isFocused,
1316
1375
  color: !hasError ? isFocused ? borderColorActive : borderColorIdle : borderColorError
1317
- }, /*#__PURE__*/React__default["default"].createElement(PlaceholderElement, {
1376
+ }, /*#__PURE__*/React__default["default"].createElement(PlaceholderElement$1, {
1318
1377
  active: isFocused || textValue && textValue.length > 0 || value && value.length > 0
1319
1378
  }, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, !hasError ? children : /*#__PURE__*/React__default["default"].createElement(H4Text, {
1320
1379
  color: borderColorError
1321
- }, error || hasError))), /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(InputElement, {
1380
+ }, error || hasError))), /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(InputElement$1, {
1322
1381
  ref: inputRef,
1323
1382
  onFocus: function onFocus() {
1324
1383
  return setIsFocused(true);
@@ -1342,6 +1401,192 @@
1342
1401
  })))));
1343
1402
  };
1344
1403
 
1404
+ var _templateObject$i, _templateObject2$9, _templateObject3$3;
1405
+ var InputWrapper = styled__default["default"].Pressable(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n min-height: 70px;\n"])));
1406
+ var InputElement = styled__default["default"].TextInput(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteral(["\n min-height: 40px;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n"])), function (props) {
1407
+ return props.theme.fontFamily2;
1408
+ }, function (props) {
1409
+ return props.theme.small;
1410
+ }, function (props) {
1411
+ return props.theme.color2;
1412
+ }, function (props) {
1413
+ return props.active ? props.theme.color1 : props.theme.color10;
1414
+ });
1415
+ var BorderWrapper$1 = styled__default["default"].View(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n min-height: 70px;\n padding-top: 26px;\n border-width: 2px;\n border-color: ", ";\n border-radius: ", ";\n background-color: ", ";\n"])), function (props) {
1416
+ return props.color;
1417
+ }, function (props) {
1418
+ return props.theme.borderRadiusSmall;
1419
+ }, function (props) {
1420
+ return props.active ? props.theme.color1 : props.theme.color10;
1421
+ });
1422
+
1423
+ var PlaceholderElement = /*#__PURE__*/React__default["default"].memo(function (_ref) {
1424
+ var children = _ref.children,
1425
+ active = _ref.active;
1426
+ var top = Animated.useSharedValue(active ? 10 : 30);
1427
+ var animatedStyle = Animated.useAnimatedStyle(function () {
1428
+ return {
1429
+ top: Animated.withTiming(top.value, {
1430
+ duration: 250,
1431
+ easing: Animated.Easing.bezier(0.19, 1.0, 0.22, 1.0)
1432
+ })
1433
+ };
1434
+ });
1435
+ React.useEffect(function () {
1436
+ if (active) {
1437
+ top.value = 10;
1438
+ }
1439
+
1440
+ if (!active) {
1441
+ top.value = 30;
1442
+ }
1443
+ }, [active]);
1444
+ return /*#__PURE__*/React__default["default"].createElement(Animated__default["default"].View, {
1445
+ style: [{
1446
+ position: "absolute",
1447
+ zIndex: 1,
1448
+ justifyContent: "center"
1449
+ }, animatedStyle]
1450
+ }, children);
1451
+ });
1452
+
1453
+ var InputPhone = function InputPhone(_ref) {
1454
+ var children = _ref.children,
1455
+ style = _ref.style,
1456
+ borderColorIdle = _ref.borderColorIdle,
1457
+ borderColorActive = _ref.borderColorActive,
1458
+ borderColorError = _ref.borderColorError,
1459
+ _ref$textChangePrefix = _ref.textChangePrefix,
1460
+ textChangePrefix = _ref$textChangePrefix === void 0 ? function () {} : _ref$textChangePrefix,
1461
+ _ref$textChangeNumber = _ref.textChangeNumber,
1462
+ textChangeNumber = _ref$textChangeNumber === void 0 ? function () {} : _ref$textChangeNumber,
1463
+ _ref$onPress = _ref.onPress,
1464
+ _onPress = _ref$onPress === void 0 ? function () {} : _ref$onPress,
1465
+ valuePrefix = _ref.valuePrefix,
1466
+ valueNumber = _ref.valueNumber,
1467
+ defaultValuePrefix = _ref.defaultValuePrefix,
1468
+ defaultValueNumber = _ref.defaultValueNumber,
1469
+ _ref$multiline = _ref.multiline,
1470
+ multiline = _ref$multiline === void 0 ? false : _ref$multiline,
1471
+ _ref$numberOfLines = _ref.numberOfLines,
1472
+ numberOfLines = _ref$numberOfLines === void 0 ? 1 : _ref$numberOfLines,
1473
+ _ref$maxLength = _ref.maxLength,
1474
+ maxLength = _ref$maxLength === void 0 ? 1000 : _ref$maxLength,
1475
+ _ref$autoFocus = _ref.autoFocus,
1476
+ autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus,
1477
+ keyboardType = _ref.keyboardType,
1478
+ _ref$editable = _ref.editable,
1479
+ editable = _ref$editable === void 0 ? true : _ref$editable,
1480
+ _ref$keyboardVertical = _ref.keyboardVerticalOffset,
1481
+ keyboardVerticalOffset = _ref$keyboardVertical === void 0 ? 0 : _ref$keyboardVertical,
1482
+ _ref$hasError = _ref.hasError,
1483
+ hasError = _ref$hasError === void 0 ? false : _ref$hasError,
1484
+ error = _ref.error;
1485
+
1486
+ var _useState = React.useState(false),
1487
+ _useState2 = _slicedToArray(_useState, 2),
1488
+ isFocused = _useState2[0],
1489
+ setIsFocused = _useState2[1];
1490
+
1491
+ var _useState3 = React.useState(valuePrefix || defaultValuePrefix),
1492
+ _useState4 = _slicedToArray(_useState3, 2),
1493
+ textValue = _useState4[0],
1494
+ setTextValue = _useState4[1];
1495
+
1496
+ var _useState5 = React.useState(false),
1497
+ _useState6 = _slicedToArray(_useState5, 2),
1498
+ isFocusedPrefix = _useState6[0],
1499
+ setIsFocusedPrefix = _useState6[1];
1500
+
1501
+ var _useState7 = React.useState(valueNumber || defaultValueNumber),
1502
+ _useState8 = _slicedToArray(_useState7, 2),
1503
+ textPrefixValue = _useState8[0],
1504
+ setTextPrefixValue = _useState8[1];
1505
+
1506
+ var inputRef = React.useRef();
1507
+ React.useEffect(function () {
1508
+ textChangeNumber(textValue);
1509
+ }, [textValue]);
1510
+ React.useEffect(function () {
1511
+ textChangePrefix(textPrefixValue);
1512
+ }, [textPrefixValue]);
1513
+ React.useEffect(function () {
1514
+ var _inputRef$current;
1515
+
1516
+ autoFocus && ((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus());
1517
+ }, [autoFocus]);
1518
+ return /*#__PURE__*/React__default["default"].createElement(reactNative.KeyboardAvoidingView, {
1519
+ behavior: reactNative.Platform.OS === "ios" ? "padding" : "height",
1520
+ keyboardVerticalOffset: keyboardVerticalOffset
1521
+ }, /*#__PURE__*/React__default["default"].createElement(InputWrapper, {
1522
+ onPress: function onPress() {
1523
+ var _inputRef$current2;
1524
+
1525
+ _onPress();
1526
+
1527
+ editable && setIsFocused(true);
1528
+ editable && ((_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus());
1529
+ }
1530
+ }, /*#__PURE__*/React__default["default"].createElement(BorderWrapper$1, {
1531
+ active: isFocused,
1532
+ color: !hasError ? isFocused ? borderColorActive : borderColorIdle : borderColorError
1533
+ }, /*#__PURE__*/React__default["default"].createElement(Row, {
1534
+ style: {
1535
+ backgroundColor: "red",
1536
+ width: "100%"
1537
+ }
1538
+ }, /*#__PURE__*/React__default["default"].createElement(Box, null, /*#__PURE__*/React__default["default"].createElement(PlaceholderElement, {
1539
+ active: isFocusedPrefix || textPrefixValue && textPrefixValue.length > 0 || valuePrefix && valuePrefix.length > 0
1540
+ }, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, !hasError ? children[0] : /*#__PURE__*/React__default["default"].createElement(H4Text, {
1541
+ color: borderColorError
1542
+ }, error || hasError)))), /*#__PURE__*/React__default["default"].createElement(Box, null, /*#__PURE__*/React__default["default"].createElement(PlaceholderElement, {
1543
+ active: isFocused || textValue && textValue.length > 0 || valueNumber && valueNumber.length > 0
1544
+ }, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, !hasError ? children[1] : /*#__PURE__*/React__default["default"].createElement(H4Text, {
1545
+ color: borderColorError
1546
+ }, error || hasError))))), /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(Row, null, /*#__PURE__*/React__default["default"].createElement(InputElement, {
1547
+ onFocus: function onFocus() {
1548
+ return setIsFocusedPrefix(true);
1549
+ },
1550
+ onBlur: function onBlur() {
1551
+ return setIsFocusedPrefix(false);
1552
+ },
1553
+ onChangeText: function onChangeText(text) {
1554
+ return setTextPrefixValue(text);
1555
+ },
1556
+ defaultValue: defaultValuePrefix,
1557
+ value: valuePrefix,
1558
+ multiline: multiline,
1559
+ numberOfLines: numberOfLines,
1560
+ maxLength: maxLength,
1561
+ autoFocus: autoFocus,
1562
+ keyboardType: keyboardType,
1563
+ editable: editable,
1564
+ active: isFocusedPrefix,
1565
+ style: style
1566
+ }), /*#__PURE__*/React__default["default"].createElement(InputElement, {
1567
+ ref: inputRef,
1568
+ onFocus: function onFocus() {
1569
+ return setIsFocused(true);
1570
+ },
1571
+ onBlur: function onBlur() {
1572
+ return setIsFocused(false);
1573
+ },
1574
+ onChangeText: function onChangeText(text) {
1575
+ return setTextValue(text);
1576
+ },
1577
+ defaultValue: defaultValueNumber,
1578
+ value: valueNumber,
1579
+ multiline: multiline,
1580
+ numberOfLines: numberOfLines,
1581
+ maxLength: maxLength,
1582
+ autoFocus: autoFocus,
1583
+ keyboardType: keyboardType,
1584
+ editable: editable,
1585
+ active: isFocused,
1586
+ style: style
1587
+ }))))));
1588
+ };
1589
+
1345
1590
  var _templateObject$h, _templateObject2$8, _templateObject3$2;
1346
1591
  var ButtonWrapper = styled__default["default"].Pressable(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral([""])));
1347
1592
  var BorderWrapper = styled__default["default"].View(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteral(["\n height: 18px;\n position: absolute;\n width: 100%;\n bottom: 10;\n z-index: 0;\n"])));
@@ -1419,14 +1664,12 @@
1419
1664
 
1420
1665
  var _templateObject$f, _templateObject2$6;
1421
1666
  styled__default["default"].View(_templateObject$f || (_templateObject$f = _taggedTemplateLiteral([""])));
1422
- var ButtonStyle$4 = styled__default["default"].Pressable(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n min-height: ", ";\n width: 100%;\n border-radius: ", ";\n background-color: ", ";\n opacity: ", ";\n ", ";\n"])), function (props) {
1667
+ var ButtonStyle$4 = styled__default["default"].Pressable(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n min-height: ", ";\n width: 100%;\n border-radius: ", ";\n background-color: ", ";\n ", ";\n"])), function (props) {
1423
1668
  return props.size === "big" ? "60px" : "54px";
1424
1669
  }, function (props) {
1425
- return props.theme.borderRadiusMedium;
1670
+ return props.smallBorder ? props.theme.borderRadiusSmall : props.theme.borderRadiusMedium;
1426
1671
  }, function (props) {
1427
- return props.color;
1428
- }, function (props) {
1429
- return props.active ? 1 : 0.7;
1672
+ return props.active ? props.color : props.theme.greyButton;
1430
1673
  }, function (props) {
1431
1674
  return props.style;
1432
1675
  });
@@ -1441,6 +1684,8 @@
1441
1684
  style = _ref.style,
1442
1685
  _ref$size = _ref.size,
1443
1686
  size = _ref$size === void 0 ? "big" : _ref$size,
1687
+ _ref$smallBorder = _ref.smallBorder,
1688
+ smallBorder = _ref$smallBorder === void 0 ? false : _ref$smallBorder,
1444
1689
  _ref$hitSlop = _ref.hitSlop,
1445
1690
  hitSlop = _ref$hitSlop === void 0 ? 0 : _ref$hitSlop;
1446
1691
  var scale = Animated.useSharedValue(1);
@@ -1455,6 +1700,7 @@
1455
1700
  return /*#__PURE__*/React__default["default"].createElement(Animated__default["default"].View, {
1456
1701
  style: [animatedStyle]
1457
1702
  }, /*#__PURE__*/React__default["default"].createElement(ButtonStyle$4, {
1703
+ smallBorder: smallBorder,
1458
1704
  hitSlop: hitSlop,
1459
1705
  size: size,
1460
1706
  active: active,
@@ -54227,11 +54473,19 @@
54227
54473
  source: {
54228
54474
  uri: item.src
54229
54475
  }
54230
- }), /*#__PURE__*/React__default["default"].createElement(Row, null, /*#__PURE__*/React__default["default"].createElement(Box, {
54476
+ }), /*#__PURE__*/React__default["default"].createElement(Row, {
54477
+ style: {
54478
+ alignItems: "center"
54479
+ }
54480
+ }, /*#__PURE__*/React__default["default"].createElement(Box, {
54231
54481
  style: {
54232
54482
  flex: 4
54233
54483
  }
54234
- }, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(H4Text, null, item.name))), variant === "countryCode" && /*#__PURE__*/React__default["default"].createElement(Box, null, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(H4Text, null, item.code)))))))));
54484
+ }, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(H4Text, null, item.name))), variant === "countryCode" && /*#__PURE__*/React__default["default"].createElement(Box, {
54485
+ style: {
54486
+ flex: 3
54487
+ }
54488
+ }, /*#__PURE__*/React__default["default"].createElement(MarginHorizontal, null, /*#__PURE__*/React__default["default"].createElement(H4Text, null, item.code)))))))));
54235
54489
  };
54236
54490
 
54237
54491
  function NewCustomer(_ref2) {
@@ -54373,6 +54627,7 @@
54373
54627
  exports.Input = Input$1;
54374
54628
  exports.InputNormal = Input;
54375
54629
  exports.InputOtp = InputOtp;
54630
+ exports.InputPhone = InputPhone;
54376
54631
  exports.Loader = Loader;
54377
54632
  exports.Margin = Margin;
54378
54633
  exports.MarginBottom = MarginBottom;
@@ -54384,6 +54639,8 @@
54384
54639
  exports.Padding = Padding;
54385
54640
  exports.PaddingBottom = PaddingBottom;
54386
54641
  exports.PaddingHorizontal = PaddingHorizontal;
54642
+ exports.PaddingLeft = PaddingLeft;
54643
+ exports.PaddingRight = PaddingRight;
54387
54644
  exports.PaddingTop = PaddingTop;
54388
54645
  exports.PaddingVertical = PaddingVertical;
54389
54646
  exports.RoundBtn = RoundBtn$3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servesall/atoms",
3
- "version": "1.1.7",
3
+ "version": "1.1.10",
4
4
  "description": "Atoms for react-native",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "scripts": {
12
12
  "test": "echo \"Error: no test specified\" && exit 1",
13
- "build": "npm i --legacy-peer-deps && rollup -c && npm publish"
13
+ "build": "npm i && rollup -c && npm publish"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -23,8 +23,7 @@
23
23
  "react-native-reanimated": "*"
24
24
  },
25
25
  "dependencies": {
26
- "react-native-status-bar-height": "^2.6.0",
27
- "styled-components": "^5.3.5"
26
+ "react-native-status-bar-height": "^2.6.0"
28
27
  },
29
28
  "devDependencies": {
30
29
  "@babel/cli": "^7.17.10",
@@ -5,8 +5,11 @@ export const ButtonWrapper = styled.View``;
5
5
  export const ButtonStyle = styled.Pressable`
6
6
  min-height: ${(props) => (props.size === "big" ? "60px" : "54px")};
7
7
  width: 100%;
8
- border-radius: ${(props) => props.theme.borderRadiusMedium};
9
- background-color: ${(props) => props.color};
10
- opacity: ${(props) => (props.active ? 1 : 0.7)};
8
+ border-radius: ${(props) =>
9
+ props.smallBorder
10
+ ? props.theme.borderRadiusSmall
11
+ : props.theme.borderRadiusMedium};
12
+ background-color: ${(props) =>
13
+ props.active ? props.color : props.theme.greyButton};
11
14
  ${(props) => props.style};
12
15
  `;
@@ -14,6 +14,7 @@ const RoundedBtn = ({
14
14
  onClick = () => {},
15
15
  style,
16
16
  size = "big",
17
+ smallBorder = false,
17
18
  hitSlop = 0,
18
19
  }) => {
19
20
  const scale = useSharedValue(1);
@@ -32,6 +33,7 @@ const RoundedBtn = ({
32
33
  return (
33
34
  <Animated.View style={[animatedStyle]}>
34
35
  <ButtonStyle
36
+ smallBorder={smallBorder}
35
37
  hitSlop={hitSlop}
36
38
  size={size}
37
39
  active={active}
@@ -31,14 +31,14 @@ const Item = ({ item, setSelected, variant }) => {
31
31
  uri: item.src,
32
32
  }}
33
33
  />
34
- <Row>
34
+ <Row style={{ alignItems: "center" }}>
35
35
  <Box style={{ flex: 4 }}>
36
36
  <MarginHorizontal>
37
37
  <H4>{item.name}</H4>
38
38
  </MarginHorizontal>
39
39
  </Box>
40
40
  {variant === "countryCode" && (
41
- <Box>
41
+ <Box style={{ flex: 3 }}>
42
42
  <MarginHorizontal>
43
43
  <H4>{item.code}</H4>
44
44
  </MarginHorizontal>
@@ -20,4 +20,15 @@ export const BorderWrapper = styled.View`
20
20
  border-radius: ${(props) => props.theme.borderRadiusSmall};
21
21
  background-color: ${(props) =>
22
22
  props.active ? props.theme.color1 : props.theme.color10};
23
+ ${({ isRightBound, isLeftBound, active }) => {
24
+ if (isRightBound) {
25
+ if (!active) {
26
+ return "borderTopRightRadius: 0px; borderBottomRightRadius: 0px; border-right-width: 0px;";
27
+ }
28
+ return "borderTopRightRadius: 0px; borderBottomRightRadius: 0px;";
29
+ }
30
+ if (isLeftBound) {
31
+ return "borderTopLeftRadius: 0px; borderBottomLeftRadius: 0px;";
32
+ }
33
+ }}
23
34
  `;