@mond-design-system/react 4.5.0 → 4.6.1

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.d.cts CHANGED
@@ -859,8 +859,14 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
859
859
  description?: ReactNode;
860
860
  /** Slot before the text — Avatar, Icon, … */
861
861
  leading?: ReactNode;
862
- /** Slot after the text — Badge, chevron, … */
862
+ /** Slot after the text — Badge, chevron, … Inside the row's hit target, so
863
+ it is for things that are read, not pressed. */
863
864
  trailing?: ReactNode;
865
+ /** Controls of the row's own, beside it rather than in it. A roster row
866
+ navigates to the member and carries an add/remove button: put that in
867
+ `trailing` and it is a button inside the link. This slot sits outside
868
+ the hit target, where a second control can be reached. */
869
+ actions?: ReactNode;
864
870
  /** Makes the whole row a button. */
865
871
  onClick?: () => void;
866
872
  /** Marks an onClick row as a toggle — a picker row that selects rather than
@@ -886,7 +892,7 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
886
892
  * One row. Static by default; interactive as one whole-row button/link.
887
893
  * An `<li>` inside a ListGroup, a standalone `<div>` row anywhere else.
888
894
  */
889
- declare function ListItem({ title, description, leading, trailing, onClick, pressed, href, as, surface, className, ref, ...rest }: ListItemProps): ReactElement;
895
+ declare function ListItem({ title, description, leading, trailing, actions, onClick, pressed, href, as, surface, className, ref, ...rest }: ListItemProps): ReactElement;
890
896
 
891
897
  interface EmptyStateProps {
892
898
  title: string;
@@ -1002,7 +1008,7 @@ interface ToastProviderProps {
1002
1008
  */
1003
1009
  declare function ToastProvider({ children, regionLabel, dismissLabel, }: ToastProviderProps): ReactElement;
1004
1010
 
1005
- type StackGap = "hairline" | "tight" | "base" | "loose" | "section";
1011
+ type StackGap = "hairline" | "tight" | "base" | "loose" | "group" | "section";
1006
1012
  type StackAlign = "start" | "center" | "end" | "stretch";
1007
1013
  interface StackProps extends HTMLAttributes<HTMLElement> {
1008
1014
  /** Space between children, on the gap scale. Default "base". */
package/dist/index.d.ts CHANGED
@@ -859,8 +859,14 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
859
859
  description?: ReactNode;
860
860
  /** Slot before the text — Avatar, Icon, … */
861
861
  leading?: ReactNode;
862
- /** Slot after the text — Badge, chevron, … */
862
+ /** Slot after the text — Badge, chevron, … Inside the row's hit target, so
863
+ it is for things that are read, not pressed. */
863
864
  trailing?: ReactNode;
865
+ /** Controls of the row's own, beside it rather than in it. A roster row
866
+ navigates to the member and carries an add/remove button: put that in
867
+ `trailing` and it is a button inside the link. This slot sits outside
868
+ the hit target, where a second control can be reached. */
869
+ actions?: ReactNode;
864
870
  /** Makes the whole row a button. */
865
871
  onClick?: () => void;
866
872
  /** Marks an onClick row as a toggle — a picker row that selects rather than
@@ -886,7 +892,7 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
886
892
  * One row. Static by default; interactive as one whole-row button/link.
887
893
  * An `<li>` inside a ListGroup, a standalone `<div>` row anywhere else.
888
894
  */
889
- declare function ListItem({ title, description, leading, trailing, onClick, pressed, href, as, surface, className, ref, ...rest }: ListItemProps): ReactElement;
895
+ declare function ListItem({ title, description, leading, trailing, actions, onClick, pressed, href, as, surface, className, ref, ...rest }: ListItemProps): ReactElement;
890
896
 
891
897
  interface EmptyStateProps {
892
898
  title: string;
@@ -1002,7 +1008,7 @@ interface ToastProviderProps {
1002
1008
  */
1003
1009
  declare function ToastProvider({ children, regionLabel, dismissLabel, }: ToastProviderProps): ReactElement;
1004
1010
 
1005
- type StackGap = "hairline" | "tight" | "base" | "loose" | "section";
1011
+ type StackGap = "hairline" | "tight" | "base" | "loose" | "group" | "section";
1006
1012
  type StackAlign = "start" | "center" | "end" | "stretch";
1007
1013
  interface StackProps extends HTMLAttributes<HTMLElement> {
1008
1014
  /** Space between children, on the gap scale. Default "base". */
package/dist/index.js CHANGED
@@ -658,7 +658,7 @@ function Sheet({ open, onClose, label, closeOnScrimClick = true, children }) {
658
658
  }
659
659
  function SheetHeader({ children, onClose, closeLabel }) {
660
660
  return /* @__PURE__ */ jsxs("div", { className: Sheet_module_default.header, children: [
661
- /* @__PURE__ */ jsx("span", { className: Sheet_module_default.headerTitle, children }),
661
+ /* @__PURE__ */ jsx("h2", { className: Sheet_module_default.headerTitle, children }),
662
662
  onClose !== void 0 && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": closeLabel, className: Sheet_module_default.close, onClick: onClose, children: /* @__PURE__ */ jsx(CloseGlyph, { className: Sheet_module_default.closeGlyph }) })
663
663
  ] });
664
664
  }
@@ -1324,7 +1324,7 @@ function SearchField({
1324
1324
  }
1325
1325
 
1326
1326
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/List/List.module.css?mds-scoped
1327
- var List_module_default = { "group": "mds-List__group", "labelledGroup": "mds-List__labelledGroup", "label": "mds-List__label", "item": "mds-List__item", "surface-card": "mds-List__surface-card", "surface-sunken": "mds-List__surface-sunken", "surface-accent": "mds-List__surface-accent", "surface-plain": "mds-List__surface-plain", "row": "mds-List__row", "interactive": "mds-List__interactive", "leading": "mds-List__leading", "trailing": "mds-List__trailing", "text": "mds-List__text", "title": "mds-List__title", "description": "mds-List__description" };
1327
+ var List_module_default = { "group": "mds-List__group", "labelledGroup": "mds-List__labelledGroup", "label": "mds-List__label", "item": "mds-List__item", "surface-card": "mds-List__surface-card", "surface-sunken": "mds-List__surface-sunken", "surface-accent": "mds-List__surface-accent", "surface-plain": "mds-List__surface-plain", "row": "mds-List__row", "interactive": "mds-List__interactive", "withActions": "mds-List__withActions", "actions": "mds-List__actions", "leading": "mds-List__leading", "trailing": "mds-List__trailing", "text": "mds-List__text", "title": "mds-List__title", "description": "mds-List__description" };
1328
1328
  var ListGroupContext = createContext(false);
1329
1329
  function ListGroup({ label, className, ...rest }) {
1330
1330
  const headingId = useId();
@@ -1347,6 +1347,7 @@ function ListItem({
1347
1347
  description,
1348
1348
  leading,
1349
1349
  trailing,
1350
+ actions,
1350
1351
  onClick,
1351
1352
  pressed,
1352
1353
  href,
@@ -1368,22 +1369,30 @@ function ListItem({
1368
1369
  ] }),
1369
1370
  trailing != null && /* @__PURE__ */ jsx("span", { className: List_module_default.trailing, children: trailing })
1370
1371
  ] });
1371
- return /* @__PURE__ */ jsx(
1372
+ return /* @__PURE__ */ jsxs(
1372
1373
  Root,
1373
1374
  {
1374
- className: cx(List_module_default.item, resolved && List_module_default[`surface-${resolved}`], className),
1375
+ className: cx(
1376
+ List_module_default.item,
1377
+ actions != null && List_module_default.withActions,
1378
+ resolved && List_module_default[`surface-${resolved}`],
1379
+ className
1380
+ ),
1375
1381
  ref,
1376
1382
  ...rest,
1377
- children: href !== void 0 ? /* @__PURE__ */ jsx(LinkElement, { className: cx(List_module_default.row, List_module_default.interactive), href, children: content }) : onClick !== void 0 ? /* @__PURE__ */ jsx(
1378
- "button",
1379
- {
1380
- type: "button",
1381
- className: cx(List_module_default.row, List_module_default.interactive),
1382
- onClick,
1383
- "aria-pressed": pressed,
1384
- children: content
1385
- }
1386
- ) : /* @__PURE__ */ jsx("span", { className: List_module_default.row, children: content })
1383
+ children: [
1384
+ href !== void 0 ? /* @__PURE__ */ jsx(LinkElement, { className: cx(List_module_default.row, List_module_default.interactive), href, children: content }) : onClick !== void 0 ? /* @__PURE__ */ jsx(
1385
+ "button",
1386
+ {
1387
+ type: "button",
1388
+ className: cx(List_module_default.row, List_module_default.interactive),
1389
+ onClick,
1390
+ "aria-pressed": pressed,
1391
+ children: content
1392
+ }
1393
+ ) : /* @__PURE__ */ jsx("span", { className: List_module_default.row, children: content }),
1394
+ actions != null && /* @__PURE__ */ jsx("span", { className: List_module_default.actions, children: actions })
1395
+ ]
1387
1396
  }
1388
1397
  );
1389
1398
  }
@@ -1566,7 +1575,7 @@ function ToastProvider({
1566
1575
  }
1567
1576
 
1568
1577
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Stack/Stack.module.css?mds-scoped
1569
- 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-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" };
1578
+ 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" };
1570
1579
 
1571
1580
  // src/components/Stack/Stack.tsx
1572
1581
  function Stack({
@@ -1659,7 +1668,7 @@ function CardFooter({ className, ...rest }) {
1659
1668
  }
1660
1669
 
1661
1670
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Modal/Modal.module.css?mds-scoped
1662
- var Modal_module_default = { "panel": "mds-Modal__panel", "header": "mds-Modal__header", "body": "mds-Modal__body", "footer": "mds-Modal__footer" };
1671
+ var Modal_module_default = { "panel": "mds-Modal__panel", "header": "mds-Modal__header", "headerTitle": "mds-Modal__headerTitle", "body": "mds-Modal__body", "footer": "mds-Modal__footer" };
1663
1672
  function Modal({ open, onClose, label, closeOnScrimClick = true, role = "dialog", children }) {
1664
1673
  return /* @__PURE__ */ jsx(
1665
1674
  Overlay,
@@ -1676,7 +1685,7 @@ function Modal({ open, onClose, label, closeOnScrimClick = true, role = "dialog"
1676
1685
  );
1677
1686
  }
1678
1687
  function ModalHeader({ children }) {
1679
- return /* @__PURE__ */ jsx("div", { className: Modal_module_default.header, children });
1688
+ return /* @__PURE__ */ jsx("div", { className: Modal_module_default.header, children: /* @__PURE__ */ jsx("h2", { className: Modal_module_default.headerTitle, children }) });
1680
1689
  }
1681
1690
  function ModalBody({ children }) {
1682
1691
  return /* @__PURE__ */ jsx("div", { className: Modal_module_default.body, children });