@mond-design-system/react 4.7.0 → 4.8.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/README.md CHANGED
@@ -60,7 +60,7 @@ Dark mode is `data-theme="dark"` on `<html>`. Nothing else changes.
60
60
 
61
61
  **Layout** — `Stack`, `Inline`, `Container`, `Screen`, `ScreenContent`
62
62
 
63
- **Navigation** — `Tabs`, `TabList`, `Tab`, `TabPanel`, `AppBar`, `TabBar`
63
+ **Navigation** — `Tabs`, `TabList`, `Tab`, `TabPanel`, `AppBar`, `TabBar`, `SideNav`
64
64
 
65
65
  **Overlays** — `Modal`, `Sheet`, `ConfirmDialog`
66
66
 
package/dist/index.cjs CHANGED
@@ -1944,6 +1944,59 @@ function TabBarAction({ label, icon, onClick }) {
1944
1944
  return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": label, className: TabBar_module_default.action, onClick, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: TabBar_module_default.icon, "aria-hidden": "true", children: icon }) });
1945
1945
  }
1946
1946
 
1947
+ // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/SideNav/SideNav.module.css?mds-scoped
1948
+ var SideNav_module_default = { "nav": "mds-SideNav__nav", "group": "mds-SideNav__group", "heading": "mds-SideNav__heading", "item": "mds-SideNav__item", "active": "mds-SideNav__active", "icon": "mds-SideNav__icon", "label": "mds-SideNav__label", "count": "mds-SideNav__count" };
1949
+ function SideNav({ label, className, children, ref, ...rest }) {
1950
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": label, className: cx(SideNav_module_default.nav, className), ...rest, children });
1951
+ }
1952
+ function SideNavGroup({
1953
+ label,
1954
+ className,
1955
+ children,
1956
+ ref,
1957
+ ...rest
1958
+ }) {
1959
+ const headingId = react.useId();
1960
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1961
+ "div",
1962
+ {
1963
+ ref,
1964
+ className: cx(SideNav_module_default.group, className),
1965
+ role: label != null ? "group" : void 0,
1966
+ "aria-labelledby": label != null ? headingId : void 0,
1967
+ ...rest,
1968
+ children: [
1969
+ label != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: SideNav_module_default.heading, id: headingId, children: label }),
1970
+ children
1971
+ ]
1972
+ }
1973
+ );
1974
+ }
1975
+ function SideNavItem({
1976
+ label,
1977
+ icon,
1978
+ href,
1979
+ onClick,
1980
+ active = false,
1981
+ count,
1982
+ countLabel,
1983
+ max = 99,
1984
+ as
1985
+ }) {
1986
+ const className = cx(SideNav_module_default.item, active && SideNav_module_default.active);
1987
+ const current = active ? "page" : void 0;
1988
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1989
+ icon != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: SideNav_module_default.icon, "aria-hidden": "true", children: icon }),
1990
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: SideNav_module_default.label, children: label }),
1991
+ count !== void 0 && count > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { tone: "accent", role: "status", "aria-label": countLabel, className: SideNav_module_default.count, children: count > max ? `${max}+` : count })
1992
+ ] });
1993
+ if (href !== void 0) {
1994
+ const Element = as ?? "a";
1995
+ return /* @__PURE__ */ jsxRuntime.jsx(Element, { href, className, "aria-current": current, onClick, children: content });
1996
+ }
1997
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className, "aria-current": current, onClick, children: content });
1998
+ }
1999
+
1947
2000
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/MediaPlaceholder/MediaPlaceholder.module.css?mds-scoped
1948
2001
  var MediaPlaceholder_module_default = { "media": "mds-MediaPlaceholder__media", "fill": "mds-MediaPlaceholder__fill", "image": "mds-MediaPlaceholder__image", "caption": "mds-MediaPlaceholder__caption", "cover": "mds-MediaPlaceholder__cover", "blurred": "mds-MediaPlaceholder__blurred" };
1949
2002
  function MediaPlaceholder({
@@ -2660,6 +2713,9 @@ exports.Sheet = Sheet;
2660
2713
  exports.SheetBody = SheetBody;
2661
2714
  exports.SheetFooter = SheetFooter;
2662
2715
  exports.SheetHeader = SheetHeader;
2716
+ exports.SideNav = SideNav;
2717
+ exports.SideNavGroup = SideNavGroup;
2718
+ exports.SideNavItem = SideNavItem;
2663
2719
  exports.Skeleton = Skeleton;
2664
2720
  exports.Spinner = Spinner;
2665
2721
  exports.Stack = Stack;