@chekinapp/ui 0.0.59 → 0.0.60

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.cjs CHANGED
@@ -519,6 +519,7 @@ __export(index_exports, {
519
519
  tabsTriggerVariants: () => tabsTriggerVariants,
520
520
  toCssSize: () => toCssSize,
521
521
  toast: () => import_sonner2.toast,
522
+ toastResponseError: () => toastResponseError,
522
523
  toggleVariants: () => toggleVariants,
523
524
  uiKitI18nResources: () => uiKitI18nResources,
524
525
  uiKitTranslations: () => uiKitTranslations,
@@ -14511,6 +14512,9 @@ var DEVICE_BREAKPOINTS = {
14511
14512
  desktop: "2560px"
14512
14513
  };
14513
14514
 
14515
+ // src/lib/toastResponseError.tsx
14516
+ var import_sonner3 = require("sonner");
14517
+
14514
14518
  // src/lib/getErrorMessage.ts
14515
14519
  function getErrorMessage(error) {
14516
14520
  let message = "";
@@ -14548,6 +14552,29 @@ function getErrorMessage(error) {
14548
14552
  }
14549
14553
  return message;
14550
14554
  }
14555
+
14556
+ // src/lib/toastResponseError.tsx
14557
+ var import_i18next = __toESM(require("i18next"), 1);
14558
+ var import_jsx_runtime156 = require("react/jsx-runtime");
14559
+ function addSupportEmailToMessage(message, prefixText) {
14560
+ if (typeof message !== "string") {
14561
+ return message;
14562
+ }
14563
+ const builtMessage = `${prefixText ? `${prefixText} ` : ""}${message}`;
14564
+ return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { children: [
14565
+ /* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { children: builtMessage }),
14566
+ import_i18next.default.t("reach_us_at_email")
14567
+ ] });
14568
+ }
14569
+ function toastResponseError(error, options = {}) {
14570
+ const message = typeof error === "string" ? error : addSupportEmailToMessage(getErrorMessage(error), options?.prefixText);
14571
+ const toastId = error?.message || typeof error === "string" && error || "toastId";
14572
+ import_sonner3.toast.error(message, {
14573
+ id: toastId,
14574
+ duration: options?.autoClose || Infinity,
14575
+ ...options
14576
+ });
14577
+ }
14551
14578
  // Annotate the CommonJS export names for ESM import in node:
14552
14579
  0 && (module.exports = {
14553
14580
  Accordion,
@@ -14849,6 +14876,7 @@ function getErrorMessage(error) {
14849
14876
  tabsTriggerVariants,
14850
14877
  toCssSize,
14851
14878
  toast,
14879
+ toastResponseError,
14852
14880
  toggleVariants,
14853
14881
  uiKitI18nResources,
14854
14882
  uiKitTranslations,