@underverse-ui/underverse 2.0.18 → 2.0.19

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,8 +1,8 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "sourceEntry": "src/index.ts",
5
- "totalExports": 259,
5
+ "totalExports": 260,
6
6
  "exports": [
7
7
  {
8
8
  "name": "*",
@@ -1533,6 +1533,13 @@
1533
1533
  "local": false,
1534
1534
  "aliasOf": "default"
1535
1535
  },
1536
+ {
1537
+ "name": "ToastProviderProps",
1538
+ "kind": "type",
1539
+ "source": "./components/Toast",
1540
+ "reexport": true,
1541
+ "local": false
1542
+ },
1536
1543
  {
1537
1544
  "name": "ToggleGroup",
1538
1545
  "kind": "value",
package/dist/index.cjs CHANGED
@@ -13213,7 +13213,12 @@ var useToast = () => {
13213
13213
  }
13214
13214
  return context;
13215
13215
  };
13216
- var ToastProvider = ({ children, position = "top-right", maxToasts = 5 }) => {
13216
+ var ToastProvider = ({
13217
+ children,
13218
+ position = "top-right",
13219
+ maxToasts = 5,
13220
+ viewportClassName
13221
+ }) => {
13217
13222
  const [toasts, setToasts] = (0, import_react13.useState)([]);
13218
13223
  const idRef = (0, import_react13.useRef)(0);
13219
13224
  const removeToast = (0, import_react13.useCallback)((id) => {
@@ -13240,7 +13245,15 @@ var ToastProvider = ({ children, position = "top-right", maxToasts = 5 }) => {
13240
13245
  };
13241
13246
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
13242
13247
  children,
13243
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cn("fixed z-99999 flex flex-col gap-2 pointer-events-none", positionClasses[position]), "aria-live": "polite", "aria-atomic": true, children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
13248
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
13249
+ "div",
13250
+ {
13251
+ className: cn("fixed z-99999 flex flex-col gap-2 pointer-events-none", positionClasses[position], viewportClassName),
13252
+ "aria-live": "polite",
13253
+ "aria-atomic": true,
13254
+ children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id))
13255
+ }
13256
+ )
13244
13257
  ] });
13245
13258
  };
13246
13259
  var ToastComponent = ({ toast, onRemove }) => {
@@ -13312,6 +13325,7 @@ var ToastComponent = ({ toast, onRemove }) => {
13312
13325
  isVisible ? "opacity-100 translate-x-0" : "opacity-0 translate-x-full"
13313
13326
  ),
13314
13327
  role: "status",
13328
+ "data-variant": toast.type,
13315
13329
  "aria-live": toast.type === "error" ? "assertive" : "polite",
13316
13330
  onMouseEnter: () => {
13317
13331
  if (toast.duration === 0) return;