sapo-components-ui-rn 1.0.48 → 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.
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { StyleProp, TextStyle } from "react-native";
3
3
  export type IconType = "FontAwesome" | "Image" | "MaterialIcons" | "Feather" | "MaterialCommunityIcons" | "Svg";
4
4
  export interface IconProps {
5
- name: "IconCheckboxActive" | "IconCheckbox" | "IconRadio" | "IconRadioActive" | "IconRadioDisable" | "IconArrowDown" | "IconClearText" | "IconSearch" | "IconClose";
5
+ name: "IconCheckboxActive" | "IconCheckbox" | "IconRadio" | "IconRadioActive" | "IconRadioDisable" | "IconArrowDown" | "IconClearText" | "IconSearch" | "IconClose" | "IconSuccess" | "IconError" | "IconInfo" | "IconWarning";
6
6
  backgroundColor?: string;
7
7
  size?: number;
8
8
  color?: string;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SvgProps } from "react-native-svg";
3
+ declare const IconError: (props: SvgProps) => React.JSX.Element;
4
+ export default IconError;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SvgProps } from "react-native-svg";
3
+ declare const IconInfo: (props: SvgProps) => React.JSX.Element;
4
+ export default IconInfo;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SvgProps } from "react-native-svg";
3
+ declare const IconSuccess: (props: SvgProps) => React.JSX.Element;
4
+ export default IconSuccess;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SvgProps } from "react-native-svg";
3
+ declare const IconWarning: (props: SvgProps) => React.JSX.Element;
4
+ export default IconWarning;
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Platform, Dimensions, StyleSheet, useColorScheme, Animated, Easing, View as View$1, I18nManager, TouchableOpacity, NativeModules, Switch as Switch$1, Text as Text$2, Pressable, useWindowDimensions, TextInput as TextInput$1, ActivityIndicator as ActivityIndicator$1, Image as Image$2, ImageBackground } from 'react-native';
1
+ import { Platform, Dimensions, StyleSheet, useColorScheme, Animated, Easing, View as View$1, I18nManager, TouchableOpacity, NativeModules, Switch as Switch$1, Text as Text$2, Pressable, useWindowDimensions, TextInput as TextInput$1, ActivityIndicator as ActivityIndicator$1, ImageBackground, Image as Image$2 } from 'react-native';
2
2
  import * as React$3 from 'react';
3
3
  import React__default, { useMemo, memo, forwardRef as forwardRef$1, useRef, useImperativeHandle, useState, useEffect, useCallback } from 'react';
4
4
  import require$$1 from 'deepmerge';
@@ -2774,6 +2774,24 @@ var IconSearch = function (props) { return (React$3.createElement(Svg, __assign(
2774
2774
  var IconClose = function (props) { return (React$3.createElement(Svg, __assign({ width: 24, height: 24, viewBox: "0 0 24 24", fill: "none" }, props),
2775
2775
  React$3.createElement(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" }))); };
2776
2776
 
2777
+ var IconSuccess = function (props) { return (React__default.createElement(Svg, __assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, props),
2778
+ React__default.createElement(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" }),
2779
+ React__default.createElement(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" }))); };
2780
+
2781
+ var IconError = function (props) { return (React__default.createElement(Svg, __assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, props),
2782
+ React__default.createElement(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" }),
2783
+ React__default.createElement(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" }))); };
2784
+
2785
+ var IconInfo = function (props) { return (React__default.createElement(Svg, __assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, props),
2786
+ React__default.createElement(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" }),
2787
+ React__default.createElement(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" }),
2788
+ React__default.createElement(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" }))); };
2789
+
2790
+ var IconWarning = function (props) { return (React__default.createElement(Svg, __assign({ width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, props),
2791
+ React__default.createElement(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" }),
2792
+ React__default.createElement(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" }),
2793
+ React__default.createElement(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" }))); };
2794
+
2777
2795
  var getIconComponent = function (type) {
2778
2796
  switch (type) {
2779
2797
  case "MaterialIcons":
@@ -2810,6 +2828,14 @@ var Icon = function (_a) {
2810
2828
  return IconSearch;
2811
2829
  case "IconClose":
2812
2830
  return IconClose;
2831
+ case "IconSuccess":
2832
+ return IconSuccess;
2833
+ case "IconError":
2834
+ return IconError;
2835
+ case "IconInfo":
2836
+ return IconInfo;
2837
+ case "IconWarning":
2838
+ return IconWarning;
2813
2839
  default:
2814
2840
  return IconCheckbox;
2815
2841
  }
@@ -6321,15 +6347,15 @@ var Toast = memoWithRef(function (_props, ref) {
6321
6347
  var getSourceIcon = function () {
6322
6348
  switch (options.type) {
6323
6349
  case "success":
6324
- return require("./assets/images/success.png");
6350
+ return "IconSuccess";
6325
6351
  case "error":
6326
- return require("./assets/images/error.png");
6352
+ return "IconError";
6327
6353
  case "info":
6328
- return require("./assets/images/info.png");
6354
+ return "IconInfo";
6329
6355
  case "warning":
6330
- return require("./assets/images/warning.png");
6356
+ return "IconWarning";
6331
6357
  default:
6332
- return require("./assets/images/success.png");
6358
+ return "IconSuccess";
6333
6359
  }
6334
6360
  };
6335
6361
  var handleToastBottomHeight = function () {
@@ -6374,7 +6400,7 @@ var Toast = memoWithRef(function (_props, ref) {
6374
6400
  ] },
6375
6401
  React__default.createElement(View, { row: true, style: { alignItems: "flex-start" } },
6376
6402
  React__default.createElement(View, null,
6377
- React__default.createElement(Image$2, { source: getSourceIcon(), style: styles$7.img })),
6403
+ React__default.createElement(Icon$1, { name: getSourceIcon(), type: "Svg", size: 20 })),
6378
6404
  React__default.createElement(View, { full: true, paddingLeft: CONSTANTS.SPACE_8 },
6379
6405
  React__default.createElement(Text$1, { bold: true, color: colors.textOnFillDefault }, options.title),
6380
6406
  message.toString().length > 0 && (React__default.createElement(Text$1, { color: colors.textOnFillDefault, numberOfLines: 4, style: !options.title && styles$7.wrapMess }, message)))))));