@manamerge/mana-atomic-ui 1.0.199 → 1.0.201

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
@@ -772,15 +772,32 @@ const NavLinks = styled.div `
772
772
  flex-direction: column;
773
773
  text-align: right;
774
774
  align-items: flex-end;
775
- display: ${({ isOpen }) => (isOpen ? "flex" : "none")};
775
+ display: flex;
776
+
776
777
  width: 100%;
777
778
 
779
+ overflow: hidden;
780
+ transition:
781
+ max-height 0.55s ease,
782
+ opacity 0.55s ease,
783
+ transform 0.55s ease,
784
+ margin-top 0.55s ease;
785
+
786
+ max-height: ${({ isOpen }) => (isOpen ? "400px" : "0px")};
787
+ opacity: ${({ isOpen }) => (isOpen ? 1 : 0)};
788
+ transform: ${({ isOpen }) => isOpen ? "translateY(0)" : "translateY(-10px)"};
789
+ margin-top: ${({ isOpen }) => (isOpen ? "20px" : 0)};
790
+
778
791
  ${({ theme, moleculeVariant }) => {
779
- var _a, _b, _c, _d;
792
+ var _a, _b, _c, _d, _e, _f, _g;
780
793
  const thisTheme = ((_d = (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.navigation) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.navLinks) === null || _c === void 0 ? void 0 : _c.responsive) === null || _d === void 0 ? void 0 : _d.largeMobileUp) || {};
781
794
  const { largeMobileUp } = theme.media;
782
795
  return css `
796
+ gap: ${(_g = (_f = (_e = theme === null || theme === void 0 ? void 0 : theme.navigation) === null || _e === void 0 ? void 0 : _e[moleculeVariant]) === null || _f === void 0 ? void 0 : _f.navLinks) === null || _g === void 0 ? void 0 : _g.mobileGap};
783
797
  ${largeMobileUp} {
798
+ max-height: none;
799
+ opacity: 1;
800
+ transform: none;
784
801
  margin: ${thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.margin};
785
802
  display: flex;
786
803
  flex-direction: row;
@@ -844,6 +861,17 @@ const StyledLink$1 = styled(Link).attrs(({ theme, moleculeVariant }) => {
844
861
  `;
845
862
  }};
846
863
  `;
864
+ const Backdrop = styled.div `
865
+ position: fixed;
866
+ inset: 0;
867
+ background: rgba(0, 0, 0, 0.3);
868
+
869
+ opacity: ${({ isOpen }) => (isOpen ? 1 : 0)};
870
+ pointer-events: ${({ isOpen }) => (isOpen ? "auto" : "none")};
871
+
872
+ transition: opacity 0.25s ease;
873
+ z-index: 0;
874
+ `;
847
875
 
848
876
  const Navigation = ({ moleculeVariant = "primary", logo, onLogoClick, iconBurger, tabs }) => {
849
877
  const location = useLocation();
@@ -853,9 +881,9 @@ const Navigation = ({ moleculeVariant = "primary", logo, onLogoClick, iconBurger
853
881
  setIsOpen(!isOpen);
854
882
  };
855
883
  const compVariant = `Navigation-${moleculeVariant}`;
856
- return (jsxs(NavBar, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, { children: [logo && (jsx(AtomIcon$3, { moleculeVariant: compVariant, svg: logo, onClick: onLogoClick, onKeyDown: onLogoClick, "aria-label": "Logo", tabIndex: 0, role: "button" })), jsxs("div", Object.assign({ style: { width: "100%" } }, { children: [jsx(BurgerWrapper, { children: jsx(AtomIcon$3, { moleculeVariant: compVariant, svg: iconBurger, onClick: handleToggle, onKeyDown: handleToggle, "aria-pressed": isOpen, "aria-label": "Burger", tabIndex: 0, role: "button" }) }), jsx(NavLinks, Object.assign({ isOpen: isOpen, moleculeVariant: compVariant }, { children: tabs.length > 0
857
- ? tabs.map((tab) => (jsx(StyledLink$1, Object.assign({ moleculeVariant: compVariant, to: tab.to, currentPath: tab.to === currentPath }, { children: tab.label }), tab.label)))
858
- : "no tabs available" }))] }))] })));
884
+ return (jsxs(Fragment, { children: [jsx(Backdrop, { isOpen: isOpen, onClick: () => setIsOpen(false) }), jsxs(NavBar, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, { children: [logo && (jsx(AtomIcon$3, { moleculeVariant: compVariant, svg: logo, onClick: onLogoClick, onKeyDown: onLogoClick, "aria-label": "Logo", tabIndex: 0, role: "button" })), jsxs("div", Object.assign({ style: { width: "100%" } }, { children: [jsx(BurgerWrapper, { children: jsx(AtomIcon$3, { moleculeVariant: compVariant, svg: iconBurger, onClick: handleToggle, onKeyDown: handleToggle, "aria-pressed": isOpen, "aria-label": "Burger", tabIndex: 0, role: "button" }) }), jsx(NavLinks, Object.assign({ isOpen: isOpen, moleculeVariant: compVariant }, { children: tabs.length > 0
885
+ ? tabs.map((tab) => (jsx(StyledLink$1, Object.assign({ moleculeVariant: compVariant, to: tab.to, currentPath: tab.to === currentPath, onClick: () => setIsOpen(false) }, { children: tab.label }), tab.label)))
886
+ : "no tabs available" }))] }))] }))] }));
859
887
  };
860
888
 
861
889
  // Wrapper for the footer
@@ -1485,6 +1513,7 @@ const AccordionTitle = styled.button `
1485
1513
  const thisTheme = ((_a = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) || {};
1486
1514
  return css `
1487
1515
  all: unset;
1516
+ user-select: text;
1488
1517
  width: 100%;
1489
1518
  display: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.display) || "flex"};
1490
1519
  align-items: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.alignItems) || "center"};
@@ -1533,13 +1562,16 @@ const AtomHeading = styled(Heading).attrs(({ theme, moleculeVariant }) => {
1533
1562
  });
1534
1563
  }) ``;
1535
1564
  const AtomIcon = styled(Icon).attrs(({ theme, moleculeVariant }) => {
1536
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1565
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
1537
1566
  return ({
1538
1567
  variant: (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.atomIcon) === null || _c === void 0 ? void 0 : _c.variant,
1539
1568
  size: (_f = (_e = (_d = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _d === void 0 ? void 0 : _d[moleculeVariant]) === null || _e === void 0 ? void 0 : _e.atomIcon) === null || _f === void 0 ? void 0 : _f.size,
1540
1569
  color: (_j = (_h = (_g = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _g === void 0 ? void 0 : _g[moleculeVariant]) === null || _h === void 0 ? void 0 : _h.atomIcon) === null || _j === void 0 ? void 0 : _j.color,
1541
1570
  fill: (_m = (_l = (_k = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _k === void 0 ? void 0 : _k[moleculeVariant]) === null || _l === void 0 ? void 0 : _l.atomIcon) === null || _m === void 0 ? void 0 : _m.fill,
1542
- stroke: (_q = (_p = (_o = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _o === void 0 ? void 0 : _o[moleculeVariant]) === null || _p === void 0 ? void 0 : _p.atomIcon) === null || _q === void 0 ? void 0 : _q.stroke
1571
+ stroke: (_q = (_p = (_o = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _o === void 0 ? void 0 : _o[moleculeVariant]) === null || _p === void 0 ? void 0 : _p.atomIcon) === null || _q === void 0 ? void 0 : _q.stroke,
1572
+ hoverColor: (_u = (_t = (_s = (_r = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _r === void 0 ? void 0 : _r[moleculeVariant]) === null || _s === void 0 ? void 0 : _s.atomIcon) === null || _t === void 0 ? void 0 : _t.hover) === null || _u === void 0 ? void 0 : _u.color,
1573
+ hoverFill: (_y = (_x = (_w = (_v = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _v === void 0 ? void 0 : _v[moleculeVariant]) === null || _w === void 0 ? void 0 : _w.atomIcon) === null || _x === void 0 ? void 0 : _x.hover) === null || _y === void 0 ? void 0 : _y.fill,
1574
+ hoverStroke: (_2 = (_1 = (_0 = (_z = theme === null || theme === void 0 ? void 0 : theme.accordion) === null || _z === void 0 ? void 0 : _z[moleculeVariant]) === null || _0 === void 0 ? void 0 : _0.atomIcon) === null || _1 === void 0 ? void 0 : _1.hover) === null || _2 === void 0 ? void 0 : _2.stroke
1543
1575
  });
1544
1576
  }) `
1545
1577
  min-width: fit-content;