sapo-components-ui-rn 1.0.47 → 1.0.49

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
@@ -389,6 +389,8 @@ var ref = {
389
389
  borderPrimaryFocused: blue.BLUE100,
390
390
  borderWarningInverseDefault: yellow.YELLOW40,
391
391
  borderSuccessInverseDefault: green.GREEN40,
392
+ toggleBackgroundDefault: ink.INK10,
393
+ toggleBackgroundActive: green.GREEN80,
392
394
  },
393
395
  },
394
396
  light: {
@@ -531,6 +533,8 @@ var ref = {
531
533
  borderPrimaryFocused: blue.BLUE100,
532
534
  borderWarningInverseDefault: yellow.YELLOW40,
533
535
  borderSuccessInverseDefault: green.GREEN40,
536
+ toggleBackgroundDefault: ink.INK10,
537
+ toggleBackgroundActive: green.GREEN80,
534
538
  },
535
539
  },
536
540
  },
@@ -1298,6 +1302,8 @@ var LightTheme = {
1298
1302
  borderPrimaryFocused: blue.BLUE100,
1299
1303
  borderWarningInverseDefault: yellow.YELLOW40,
1300
1304
  borderSuccessInverseDefault: green.GREEN40,
1305
+ toggleBackgroundDefault: ink.INK10,
1306
+ toggleBackgroundActive: green.GREEN80,
1301
1307
  },
1302
1308
  fonts: configureFonts(),
1303
1309
  animation: {
@@ -1444,6 +1450,8 @@ var DarkTheme = __assign(__assign({}, LightTheme), { dark: true, mode: "adaptive
1444
1450
  borderPrimaryFocused: blue.BLUE100,
1445
1451
  borderWarningInverseDefault: yellow.YELLOW40,
1446
1452
  borderSuccessInverseDefault: green.GREEN40,
1453
+ toggleBackgroundDefault: ink.INK10,
1454
+ toggleBackgroundActive: green.GREEN80,
1447
1455
  } });
1448
1456
 
1449
1457
  var DefaultTheme = LightTheme;
@@ -2060,7 +2068,7 @@ var getCheckedColor = function (_a) {
2060
2068
  if (color) {
2061
2069
  return color;
2062
2070
  }
2063
- return theme.colors.surfaceBrandDefault;
2071
+ return theme.colors.toggleBackgroundActive;
2064
2072
  };
2065
2073
  var getThumbTintColor = function (_a) {
2066
2074
  var theme = _a.theme, disabled = _a.disabled, value = _a.value, checkedColor = _a.checkedColor;
@@ -2070,17 +2078,17 @@ var getThumbTintColor = function (_a) {
2070
2078
  }
2071
2079
  if (disabled) {
2072
2080
  if (theme.dark) {
2073
- return theme.colors.backgroundPrimary;
2081
+ return theme.colors.toggleBackgroundDefault;
2074
2082
  }
2075
- return theme.colors.backgroundPrimary;
2083
+ return theme.colors.toggleBackgroundDefault;
2076
2084
  }
2077
2085
  if (value) {
2078
2086
  return checkedColor;
2079
2087
  }
2080
2088
  if (theme.dark) {
2081
- return theme.colors.backgroundPrimary;
2089
+ return theme.colors.toggleBackgroundDefault;
2082
2090
  }
2083
- return theme.colors.backgroundPrimary;
2091
+ return theme.colors.toggleBackgroundDefault;
2084
2092
  };
2085
2093
  var getOnTintColor = function (_a) {
2086
2094
  var theme = _a.theme, disabled = _a.disabled, value = _a.value, checkedColor = _a.checkedColor;
@@ -2090,17 +2098,17 @@ var getOnTintColor = function (_a) {
2090
2098
  }
2091
2099
  if (disabled) {
2092
2100
  if (theme.dark) {
2093
- return theme.colors.backgroundPrimary;
2101
+ return theme.colors.toggleBackgroundDefault;
2094
2102
  }
2095
- return theme.colors.backgroundPrimary;
2103
+ return theme.colors.toggleBackgroundDefault;
2096
2104
  }
2097
2105
  if (value) {
2098
2106
  return checkedColor;
2099
2107
  }
2100
2108
  if (theme.dark) {
2101
- return theme.colors.backgroundPrimary;
2109
+ return theme.colors.toggleBackgroundDefault;
2102
2110
  }
2103
- return theme.colors.backgroundPrimary;
2111
+ return theme.colors.toggleBackgroundDefault;
2104
2112
  };
2105
2113
  var getSwitchColor = function (_a) {
2106
2114
  var theme = _a.theme, disabled = _a.disabled, value = _a.value, color = _a.color;
@@ -2142,25 +2150,19 @@ var Switch = function (_a) {
2142
2150
  disabled: disabled,
2143
2151
  value: value,
2144
2152
  color: color,
2145
- }), checkedColor = _b.checkedColor, onTintColor = _b.onTintColor, thumbTintColor = _b.thumbTintColor;
2153
+ }), onTintColor = _b.onTintColor, thumbTintColor = _b.thumbTintColor;
2146
2154
  var props = version && version.major === 0 && version.minor <= 56
2147
2155
  ? {
2148
2156
  onTintColor: onTintColor,
2149
2157
  thumbTintColor: thumbTintColor,
2150
2158
  }
2151
- : reactNative.Platform.OS === "web"
2152
- ? {
2153
- activeTrackColor: onTintColor,
2154
- thumbColor: thumbTintColor,
2155
- activeThumbColor: checkedColor,
2156
- }
2157
- : {
2158
- thumbColor: thumbTintColor,
2159
- trackColor: {
2160
- true: onTintColor,
2161
- false: onTintColor,
2162
- },
2163
- };
2159
+ : {
2160
+ thumbColor: thumbTintColor,
2161
+ trackColor: {
2162
+ true: onTintColor,
2163
+ false: onTintColor,
2164
+ },
2165
+ };
2164
2166
  return (React__namespace.createElement(View, { row: true },
2165
2167
  React__namespace.createElement(reactNative.Switch, __assign({ value: value, disabled: disabled, onValueChange: disabled ? undefined : onValueChange }, props, rest))));
2166
2168
  };
@@ -2805,6 +2807,24 @@ var IconSearch = function (props) { return (React__namespace.createElement(Svg__
2805
2807
  var IconClose = function (props) { return (React__namespace.createElement(Svg__default["default"], __assign({ width: 24, height: 24, viewBox: "0 0 24 24", fill: "none" }, props),
2806
2808
  React__namespace.createElement(Svg.Path, { d: "M19 6.40958L13.4102 12.0004L19 17.5902L17.5898 19.0004L12 13.4096L6.41016 19.0004L5 17.5902L10.5898 12.0004L5 6.40958L6.41016 5.0004L12 10.5902L17.5898 5.0004L19 6.40958Z", fill: "currentColor" }))); };
2807
2809
 
2810
+ var IconSuccess = function (props) { return (React__default["default"].createElement(Svg__default["default"], __assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, props),
2811
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM3.86364 10C3.86364 6.61098 6.61098 3.86364 10 3.86364C13.389 3.86364 16.1364 6.61098 16.1364 10C16.1364 13.389 13.389 16.1364 10 16.1364C6.61098 16.1364 3.86364 13.389 3.86364 10Z", fill: "white" }),
2812
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M8.875 10.9242L12.8447 6.9545L13.9053 8.01516L8.875 13.0455L6.09467 10.2652L7.15533 9.2045L8.875 10.9242Z", fill: "white" }))); };
2813
+
2814
+ var IconError = function (props) { return (React__default["default"].createElement(Svg__default["default"], __assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, props),
2815
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM3.86364 10C3.86364 6.61098 6.61098 3.86364 10 3.86364C13.389 3.86364 16.1364 6.61098 16.1364 10C16.1364 13.389 13.389 16.1364 10 16.1364C6.61098 16.1364 3.86364 13.389 3.86364 10Z", fill: "white" }),
2816
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M13.3333 6.66667L10 10L6.66667 6.66667L5.83333 7.5L9.16667 10.8333L5.83333 14.1667L6.66667 15L10 11.6667L13.3333 15L14.1667 14.1667L10.8333 10.8333L14.1667 7.5L13.3333 6.66667Z", fill: "white" }))); };
2817
+
2818
+ var IconInfo = function (props) { return (React__default["default"].createElement(Svg__default["default"], __assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, props),
2819
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM3.86364 10C3.86364 6.61098 6.61098 3.86364 10 3.86364C13.389 3.86364 16.1364 6.61098 16.1364 10C16.1364 13.389 13.389 16.1364 10 16.1364C6.61098 16.1364 3.86364 13.389 3.86364 10Z", fill: "white" }),
2820
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 6.66667C10.4602 6.66667 10.8333 7.03976 10.8333 7.5V10.8333C10.8333 11.2936 10.4602 11.6667 10 11.6667C9.53976 11.6667 9.16667 11.2936 9.16667 10.8333V7.5C9.16667 7.03976 9.53976 6.66667 10 6.66667Z", fill: "white" }),
2821
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 12.5C10.4602 12.5 10.8333 12.8731 10.8333 13.3333C10.8333 13.7936 10.4602 14.1667 10 14.1667C9.53976 14.1667 9.16667 13.7936 9.16667 13.3333C9.16667 12.8731 9.53976 12.5 10 12.5Z", fill: "white" }))); };
2822
+
2823
+ var IconWarning = function (props) { return (React__default["default"].createElement(Svg__default["default"], __assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, props),
2824
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 2.5L17.5 17.5H2.5L10 2.5ZM10 5.83333L4.16667 15.8333H15.8333L10 5.83333Z", fill: "white" }),
2825
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 7.5C10.4602 7.5 10.8333 7.8731 10.8333 8.33333V11.6667C10.8333 12.1269 10.4602 12.5 10 12.5C9.53976 12.5 9.16667 12.1269 9.16667 11.6667V8.33333C9.16667 7.8731 9.53976 7.5 10 7.5Z", fill: "white" }),
2826
+ React__default["default"].createElement(Svg.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 13.3333C10.4602 13.3333 10.8333 13.7064 10.8333 14.1667C10.8333 14.6269 10.4602 15 10 15C9.53976 15 9.16667 14.6269 9.16667 14.1667C9.16667 13.7064 9.53976 13.3333 10 13.3333Z", fill: "white" }))); };
2827
+
2808
2828
  var getIconComponent = function (type) {
2809
2829
  switch (type) {
2810
2830
  case "MaterialIcons":
@@ -2841,6 +2861,14 @@ var Icon = function (_a) {
2841
2861
  return IconSearch;
2842
2862
  case "IconClose":
2843
2863
  return IconClose;
2864
+ case "IconSuccess":
2865
+ return IconSuccess;
2866
+ case "IconError":
2867
+ return IconError;
2868
+ case "IconInfo":
2869
+ return IconInfo;
2870
+ case "IconWarning":
2871
+ return IconWarning;
2844
2872
  default:
2845
2873
  return IconCheckbox;
2846
2874
  }
@@ -6352,15 +6380,15 @@ var Toast = memoWithRef(function (_props, ref) {
6352
6380
  var getSourceIcon = function () {
6353
6381
  switch (options.type) {
6354
6382
  case "success":
6355
- return require("./assets/images/success.png");
6383
+ return "IconSuccess";
6356
6384
  case "error":
6357
- return require("./assets/images/error.png");
6385
+ return "IconError";
6358
6386
  case "info":
6359
- return require("./assets/images/info.png");
6387
+ return "IconInfo";
6360
6388
  case "warning":
6361
- return require("./assets/images/warning.png");
6389
+ return "IconWarning";
6362
6390
  default:
6363
- return require("./assets/images/success.png");
6391
+ return "IconSuccess";
6364
6392
  }
6365
6393
  };
6366
6394
  var handleToastBottomHeight = function () {
@@ -6405,7 +6433,7 @@ var Toast = memoWithRef(function (_props, ref) {
6405
6433
  ] },
6406
6434
  React__default["default"].createElement(View, { row: true, style: { alignItems: "flex-start" } },
6407
6435
  React__default["default"].createElement(View, null,
6408
- React__default["default"].createElement(reactNative.Image, { source: getSourceIcon(), style: styles$7.img })),
6436
+ React__default["default"].createElement(Icon$1, { name: getSourceIcon(), type: "Svg", size: 20 })),
6409
6437
  React__default["default"].createElement(View, { full: true, paddingLeft: CONSTANTS.SPACE_8 },
6410
6438
  React__default["default"].createElement(Text$1, { bold: true, color: colors.textOnFillDefault }, options.title),
6411
6439
  message.toString().length > 0 && (React__default["default"].createElement(Text$1, { color: colors.textOnFillDefault, numberOfLines: 4, style: !options.title && styles$7.wrapMess }, message)))))));