dhre-ui-kit 0.0.376 → 0.0.378

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/lib/index.d.ts CHANGED
@@ -384,6 +384,7 @@ interface ToastProps {
384
384
  sucessIcon: React$1.ReactElement;
385
385
  errorIcon: React$1.ReactElement;
386
386
  warningIcon: React$1.ReactElement;
387
+ language?: string;
387
388
  }
388
389
  interface ToastRef {
389
390
  showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean) => void;
@@ -483,6 +484,7 @@ interface TypoTextProps extends TextProps {
483
484
  variant: keyof typeof FONT_STYLES;
484
485
  text?: string;
485
486
  testID?: string;
487
+ translateToArabic?: boolean;
486
488
  }
487
489
  declare const CustomTypography: React$1.FC<TypoTextProps>;
488
490
 
package/lib/index.js CHANGED
@@ -381,13 +381,14 @@ const CustomTypography = ({
381
381
  style,
382
382
  text,
383
383
  testID = "CUSTOM_TYPOGRAPHY",
384
+ translateToArabic = false,
384
385
  ...props
385
386
  }) => {
386
387
  const [translatedText, setTranslatedText] = React.useState(text || "");
387
388
  const textStyle = FONT_STYLES[variant];
388
389
  React.useEffect(() => {
389
390
  const translateText = async () => {
390
- if (!text || text.trim() === "") {
391
+ if (!translateToArabic || !text || text.trim() === "") {
391
392
  setTranslatedText(text || "");
392
393
  return;
393
394
  }
@@ -400,7 +401,7 @@ const CustomTypography = ({
400
401
  }
401
402
  };
402
403
  translateText();
403
- }, [text]);
404
+ }, [text, translateToArabic]);
404
405
  return /* @__PURE__ */ React__default["default"].createElement(
405
406
  reactNative.Text,
406
407
  {
@@ -3761,7 +3762,7 @@ const styles$l = reactNative.StyleSheet.create({
3761
3762
  });
3762
3763
 
3763
3764
  const Toast = React__default["default"].forwardRef(
3764
- ({ sucessIcon, errorIcon, warningIcon }, ref) => {
3765
+ ({ sucessIcon, errorIcon, warningIcon, language }, ref) => {
3765
3766
  const [visible, setVisible] = React.useState(false);
3766
3767
  const [message, setMessage] = React.useState("");
3767
3768
  const [isSuccess, setIsSuccess] = React.useState(true);
@@ -3833,6 +3834,7 @@ const Toast = React__default["default"].forwardRef(
3833
3834
  {
3834
3835
  variant: "L2_REGULAR",
3835
3836
  text: message,
3837
+ translateToArabic: language === "ar",
3836
3838
  style: styles$l.messageText
3837
3839
  }
3838
3840
  ), btnText && /* @__PURE__ */ React__default["default"].createElement(