@mond-design-system/react 4.1.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.cjs CHANGED
@@ -1239,6 +1239,7 @@ function SegmentedControl({
1239
1239
  fullWidth = false,
1240
1240
  size = "md",
1241
1241
  bare = false,
1242
+ repick = false,
1242
1243
  className
1243
1244
  }) {
1244
1245
  const name = react.useId();
@@ -1263,6 +1264,7 @@ function SegmentedControl({
1263
1264
  value: option.value,
1264
1265
  checked: option.value === value,
1265
1266
  onChange: () => onChange(option.value),
1267
+ onClick: repick && option.value === value ? () => onChange(option.value) : void 0,
1266
1268
  disabled,
1267
1269
  className: SegmentedControl_module_default.input
1268
1270
  }
@@ -1521,34 +1523,42 @@ function ToastProvider({
1521
1523
  const value = react.useMemo(() => ({ toast, dismiss }), [toast, dismiss]);
1522
1524
  return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1523
1525
  children,
1524
- /* @__PURE__ */ jsxRuntime.jsx("div", { role: "region", "aria-label": regionLabel, className: Toast_module_default.viewport, children: toasts.map((entry) => /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "status", className: cx(Toast_module_default.toast, Toast_module_default[`tone-${entry.tone}`]), children: [
1525
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Toast_module_default.body, children: [
1526
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: Toast_module_default.title, children: entry.title }),
1527
- entry.description !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Toast_module_default.description, children: entry.description })
1528
- ] }),
1529
- entry.action !== void 0 && /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.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__ */ jsxRuntime.jsx(CloseGlyph, { className: Toast_module_default.closeGlyph })
1549
- }
1550
- )
1551
- ] }, entry.id)) })
1526
+ /* @__PURE__ */ jsxRuntime.jsx("div", { role: "region", "aria-label": regionLabel, className: Toast_module_default.viewport, children: toasts.map((entry) => /* @__PURE__ */ jsxRuntime.jsxs(
1527
+ "div",
1528
+ {
1529
+ role: entry.tone === "danger" ? "alert" : "status",
1530
+ className: cx(Toast_module_default.toast, Toast_module_default[`tone-${entry.tone}`]),
1531
+ children: [
1532
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Toast_module_default.body, children: [
1533
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: Toast_module_default.title, children: entry.title }),
1534
+ entry.description !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Toast_module_default.description, children: entry.description })
1535
+ ] }),
1536
+ entry.action !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
1537
+ "button",
1538
+ {
1539
+ type: "button",
1540
+ className: Toast_module_default.action,
1541
+ onClick: () => {
1542
+ entry.action?.onClick();
1543
+ dismiss(entry.id);
1544
+ },
1545
+ children: entry.action.label
1546
+ }
1547
+ ),
1548
+ /* @__PURE__ */ jsxRuntime.jsx(
1549
+ "button",
1550
+ {
1551
+ type: "button",
1552
+ "aria-label": `${dismissLabel}: ${entry.title}`,
1553
+ className: Toast_module_default.close,
1554
+ onClick: () => dismiss(entry.id),
1555
+ children: /* @__PURE__ */ jsxRuntime.jsx(CloseGlyph, { className: Toast_module_default.closeGlyph })
1556
+ }
1557
+ )
1558
+ ]
1559
+ },
1560
+ entry.id
1561
+ )) })
1552
1562
  ] });
1553
1563
  }
1554
1564