@mond-design-system/react 4.2.0 → 4.3.0

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.js CHANGED
@@ -1521,34 +1521,42 @@ function ToastProvider({
1521
1521
  const value = useMemo(() => ({ toast, dismiss }), [toast, dismiss]);
1522
1522
  return /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
1523
1523
  children,
1524
- /* @__PURE__ */ jsx("div", { role: "region", "aria-label": regionLabel, className: Toast_module_default.viewport, children: toasts.map((entry) => /* @__PURE__ */ jsxs("div", { role: "status", className: cx(Toast_module_default.toast, Toast_module_default[`tone-${entry.tone}`]), children: [
1525
- /* @__PURE__ */ jsxs("span", { className: Toast_module_default.body, children: [
1526
- /* @__PURE__ */ jsx("span", { className: Toast_module_default.title, children: entry.title }),
1527
- entry.description !== void 0 && /* @__PURE__ */ jsx("span", { className: Toast_module_default.description, children: entry.description })
1528
- ] }),
1529
- entry.action !== void 0 && /* @__PURE__ */ jsx(
1530
- "button",
1531
- {
1532
- type: "button",
1533
- className: Toast_module_default.action,
1534
- onClick: () => {
1535
- entry.action?.onClick();
1536
- dismiss(entry.id);
1537
- },
1538
- children: entry.action.label
1539
- }
1540
- ),
1541
- /* @__PURE__ */ jsx(
1542
- "button",
1543
- {
1544
- type: "button",
1545
- "aria-label": `${dismissLabel}: ${entry.title}`,
1546
- className: Toast_module_default.close,
1547
- onClick: () => dismiss(entry.id),
1548
- children: /* @__PURE__ */ jsx(CloseGlyph, { className: Toast_module_default.closeGlyph })
1549
- }
1550
- )
1551
- ] }, entry.id)) })
1524
+ /* @__PURE__ */ jsx("div", { role: "region", "aria-label": regionLabel, className: Toast_module_default.viewport, children: toasts.map((entry) => /* @__PURE__ */ jsxs(
1525
+ "div",
1526
+ {
1527
+ role: entry.tone === "danger" ? "alert" : "status",
1528
+ className: cx(Toast_module_default.toast, Toast_module_default[`tone-${entry.tone}`]),
1529
+ children: [
1530
+ /* @__PURE__ */ jsxs("span", { className: Toast_module_default.body, children: [
1531
+ /* @__PURE__ */ jsx("span", { className: Toast_module_default.title, children: entry.title }),
1532
+ entry.description !== void 0 && /* @__PURE__ */ jsx("span", { className: Toast_module_default.description, children: entry.description })
1533
+ ] }),
1534
+ entry.action !== void 0 && /* @__PURE__ */ jsx(
1535
+ "button",
1536
+ {
1537
+ type: "button",
1538
+ className: Toast_module_default.action,
1539
+ onClick: () => {
1540
+ entry.action?.onClick();
1541
+ dismiss(entry.id);
1542
+ },
1543
+ children: entry.action.label
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ jsx(
1547
+ "button",
1548
+ {
1549
+ type: "button",
1550
+ "aria-label": `${dismissLabel}: ${entry.title}`,
1551
+ className: Toast_module_default.close,
1552
+ onClick: () => dismiss(entry.id),
1553
+ children: /* @__PURE__ */ jsx(CloseGlyph, { className: Toast_module_default.closeGlyph })
1554
+ }
1555
+ )
1556
+ ]
1557
+ },
1558
+ entry.id
1559
+ )) })
1552
1560
  ] });
1553
1561
  }
1554
1562