@mond-design-system/react 4.10.1 → 4.11.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
@@ -150,6 +150,8 @@ function Button({
150
150
  children,
151
151
  ...rest
152
152
  }) {
153
+ const glyph = iconOnly && children != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: Button_module_default.slot, children }) : children;
154
+ const body = loading && iconOnly ? null : glyph;
153
155
  const Element = as ?? (href !== void 0 ? "a" : "button");
154
156
  const isButton = Element === "button";
155
157
  const own = isButton ? { type, disabled: disabled || loading } : { href };
@@ -171,7 +173,7 @@ function Button({
171
173
  ...rest,
172
174
  children: [
173
175
  loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: Button_module_default.slot, children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: ICON_PX[size], label: "", "aria-hidden": "true" }) }) : iconLeft ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: Button_module_default.slot, children: iconLeft }) : null,
174
- children,
176
+ body,
175
177
  !loading && iconRight ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: Button_module_default.slot, children: iconRight }) : null
176
178
  ]
177
179
  }
@@ -385,10 +387,10 @@ function CountButton({
385
387
  );
386
388
  }
387
389
  function CloseGlyph({ className }) {
388
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) });
390
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) });
389
391
  }
390
392
  function ChevronLeftGlyph({ className }) {
391
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx(
393
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx(
392
394
  "path",
393
395
  {
394
396
  d: "M10 3l-5 5 5 5",
@@ -401,7 +403,7 @@ function ChevronLeftGlyph({ className }) {
401
403
  ) });
402
404
  }
403
405
  function ChevronRightGlyph({ className }) {
404
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx(
406
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx(
405
407
  "path",
406
408
  {
407
409
  d: "M6 3l5 5-5 5",
@@ -414,7 +416,7 @@ function ChevronRightGlyph({ className }) {
414
416
  ) });
415
417
  }
416
418
  function Magnifier({ className, children }) {
417
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", children: [
419
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", children: [
418
420
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "7", cy: "7", r: "4.25" }),
419
421
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.2 10.2L14 14" }),
420
422
  children
@@ -427,35 +429,35 @@ function ZoomOutGlyph({ className }) {
427
429
  return /* @__PURE__ */ jsxRuntime.jsx(Magnifier, { className, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.75 7h4.5" }) });
428
430
  }
429
431
  function PlayGlyph({ className }) {
430
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 3.2l7.5 4.8L5 12.8z", fill: "currentColor" }) });
432
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 3.2l7.5 4.8L5 12.8z", fill: "currentColor" }) });
431
433
  }
432
434
  function PauseGlyph({ className }) {
433
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.5 3h2.25v10H4.5zM9.25 3h2.25v10H9.25z", fill: "currentColor" }) });
435
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.5 3h2.25v10H4.5zM9.25 3h2.25v10H9.25z", fill: "currentColor" }) });
434
436
  }
435
437
  function Speaker() {
436
438
  return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.5 6.25h2.25L8 3.4v9.2L4.75 9.75H2.5z", fill: "currentColor", stroke: "none" });
437
439
  }
438
440
  function VolumeGlyph({ className }) {
439
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
441
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
440
442
  /* @__PURE__ */ jsxRuntime.jsx(Speaker, {}),
441
443
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.5 5.75a3.25 3.25 0 010 4.5" }),
442
444
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12.5 3.9a5.75 5.75 0 010 8.2" })
443
445
  ] }) });
444
446
  }
445
447
  function VolumeOffGlyph({ className }) {
446
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
448
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
447
449
  /* @__PURE__ */ jsxRuntime.jsx(Speaker, {}),
448
450
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.75 6.25l3.5 3.5M14.25 6.25l-3.5 3.5" })
449
451
  ] }) });
450
452
  }
451
453
  function CaptionsGlyph({ className }) {
452
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
454
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: [
453
455
  /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1.75", y: "3.25", width: "12.5", height: "9.5", rx: "2" }),
454
456
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.25 6.75a2 2 0 100 2.5M11.25 6.75a2 2 0 100 2.5" })
455
457
  ] }) });
456
458
  }
457
459
  function FullscreenGlyph({ className }) {
458
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx(
460
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx(
459
461
  "path",
460
462
  {
461
463
  d: "M6 2.5H2.5V6M10 2.5h3.5V6M6 13.5H2.5V10M10 13.5h3.5V10",
@@ -468,7 +470,7 @@ function FullscreenGlyph({ className }) {
468
470
  ) });
469
471
  }
470
472
  function FullscreenExitGlyph({ className }) {
471
- return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx(
473
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", width: "1em", height: "1em", "aria-hidden": "true", className, children: /* @__PURE__ */ jsxRuntime.jsx(
472
474
  "path",
473
475
  {
474
476
  d: "M2.5 6H6V2.5M13.5 6H10V2.5M2.5 10H6v3.5M13.5 10H10v3.5",
@@ -1786,13 +1788,14 @@ function ToastProvider({
1786
1788
  var Stack_module_default = { "stack": "mds-Stack__stack", "gap-hairline": "mds-Stack__gap-hairline", "gap-tight": "mds-Stack__gap-tight", "gap-base": "mds-Stack__gap-base", "gap-loose": "mds-Stack__gap-loose", "gap-group": "mds-Stack__gap-group", "gap-section": "mds-Stack__gap-section", "align-start": "mds-Stack__align-start", "align-center": "mds-Stack__align-center", "align-end": "mds-Stack__align-end", "align-stretch": "mds-Stack__align-stretch" };
1787
1789
 
1788
1790
  // src/components/Stack/Stack.tsx
1789
- function Stack({
1790
- gap = "base",
1791
- align = "stretch",
1792
- as = "div",
1793
- className,
1794
- ...rest
1795
- }) {
1791
+ function Stack(props) {
1792
+ const {
1793
+ gap = "base",
1794
+ align = "stretch",
1795
+ as = "div",
1796
+ className,
1797
+ ...rest
1798
+ } = props;
1796
1799
  return react.createElement(as, {
1797
1800
  className: cx(Stack_module_default.stack, Stack_module_default[`gap-${gap}`], Stack_module_default[`align-${align}`], className),
1798
1801
  ...rest
@@ -1803,15 +1806,16 @@ function Stack({
1803
1806
  var Inline_module_default = { "inline": "mds-Inline__inline", "gap-hairline": "mds-Inline__gap-hairline", "gap-tight": "mds-Inline__gap-tight", "gap-base": "mds-Inline__gap-base", "gap-loose": "mds-Inline__gap-loose", "align-start": "mds-Inline__align-start", "align-center": "mds-Inline__align-center", "align-end": "mds-Inline__align-end", "align-baseline": "mds-Inline__align-baseline", "justify-start": "mds-Inline__justify-start", "justify-center": "mds-Inline__justify-center", "justify-end": "mds-Inline__justify-end", "justify-between": "mds-Inline__justify-between", "wrap": "mds-Inline__wrap" };
1804
1807
 
1805
1808
  // src/components/Inline/Inline.tsx
1806
- function Inline({
1807
- gap = "base",
1808
- align = "center",
1809
- justify = "start",
1810
- wrap = false,
1811
- as = "div",
1812
- className,
1813
- ...rest
1814
- }) {
1809
+ function Inline(props) {
1810
+ const {
1811
+ gap = "base",
1812
+ align = "center",
1813
+ justify = "start",
1814
+ wrap = false,
1815
+ as = "div",
1816
+ className,
1817
+ ...rest
1818
+ } = props;
1815
1819
  return react.createElement(as, {
1816
1820
  className: cx(
1817
1821
  Inline_module_default.inline,
@@ -1829,12 +1833,8 @@ function Inline({
1829
1833
  var Container_module_default = { "container": "mds-Container__container", "width-content": "mds-Container__width-content", "width-wide": "mds-Container__width-wide" };
1830
1834
 
1831
1835
  // src/components/Container/Container.tsx
1832
- function Container({
1833
- width = "content",
1834
- as = "div",
1835
- className,
1836
- ...rest
1837
- }) {
1836
+ function Container(props) {
1837
+ const { width = "content", as = "div", className, ...rest } = props;
1838
1838
  return react.createElement(as, {
1839
1839
  className: cx(Container_module_default.container, Container_module_default[`width-${width}`], className),
1840
1840
  ...rest