@underverse-ui/underverse 2.0.43 → 2.0.44

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "2.0.43",
3
+ "version": "2.0.44",
4
4
  "sourceEntry": "src/index.ts",
5
5
  "totalExports": 264,
6
6
  "exports": [
package/dist/index.cjs CHANGED
@@ -21984,7 +21984,8 @@ var ToastProvider = ({
21984
21984
  children,
21985
21985
  position = "top-right",
21986
21986
  maxToasts = 5,
21987
- viewportClassName
21987
+ viewportClassName,
21988
+ showProgress = true
21988
21989
  }) => {
21989
21990
  const [toasts, setToasts] = (0, import_react13.useState)([]);
21990
21991
  const idRef = (0, import_react13.useRef)(0);
@@ -22018,12 +22019,12 @@ var ToastProvider = ({
22018
22019
  className: cn("fixed z-99999 flex flex-col gap-2 pointer-events-none", positionClasses[position], viewportClassName),
22019
22020
  "aria-live": "polite",
22020
22021
  "aria-atomic": true,
22021
- children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id))
22022
+ children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToastComponent, { toast, onRemove: removeToast, defaultShowProgress: showProgress }, toast.id))
22022
22023
  }
22023
22024
  )
22024
22025
  ] });
22025
22026
  };
22026
- var ToastComponent = ({ toast, onRemove }) => {
22027
+ var ToastComponent = ({ toast, onRemove, defaultShowProgress = true }) => {
22027
22028
  const gi18n = useGlobalI18n();
22028
22029
  const [isVisible, setIsVisible] = (0, import_react13.useState)(true);
22029
22030
  const [progress, setProgress] = (0, import_react13.useState)(100);
@@ -22080,6 +22081,7 @@ var ToastComponent = ({ toast, onRemove }) => {
22080
22081
  };
22081
22082
  const config = typeConfig[toast.type];
22082
22083
  const Icon = config.icon;
22084
+ const shouldShowProgress = toast.showProgress ?? defaultShowProgress;
22083
22085
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
22084
22086
  "div",
22085
22087
  {
@@ -22137,7 +22139,7 @@ var ToastComponent = ({ toast, onRemove }) => {
22137
22139
  }
22138
22140
  )
22139
22141
  ] }),
22140
- toast.duration !== 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute left-0 right-0 bottom-0 h-1 bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
22142
+ shouldShowProgress && toast.duration !== 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute left-0 right-0 bottom-0 h-1 bg-transparent", "data-testid": "toast-progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
22141
22143
  "div",
22142
22144
  {
22143
22145
  className: cn(