@manamerge/mana-atomic-ui 1.0.227 → 1.0.229
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.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode, FunctionComponent, SVGProps, AnchorHTMLAttributes, ElementType } from 'react';
|
|
1
|
+
import React, { ReactNode, HTMLAttributes, FunctionComponent, SVGProps, AnchorHTMLAttributes, ElementType } from 'react';
|
|
2
2
|
|
|
3
3
|
interface ButtonTypes {
|
|
4
4
|
disabled?: boolean;
|
|
@@ -26,7 +26,7 @@ interface TextTypes {
|
|
|
26
26
|
}
|
|
27
27
|
declare const Text: React.FC<TextTypes>;
|
|
28
28
|
|
|
29
|
-
interface HeadingTypes {
|
|
29
|
+
interface HeadingTypes extends HTMLAttributes<HTMLHeadingElement> {
|
|
30
30
|
variant?: string;
|
|
31
31
|
children: ReactNode;
|
|
32
32
|
vColor?: string;
|
package/dist/index.js
CHANGED
|
@@ -705,9 +705,10 @@ const WrapperTextTitle = styled.div `
|
|
|
705
705
|
}}
|
|
706
706
|
`;
|
|
707
707
|
|
|
708
|
-
const Header = (
|
|
708
|
+
const Header = (_a) => {
|
|
709
|
+
var { moleculeVariant = "primary", iconTop, iconDot, buttonLeftIcon, buttonRightIcon, textBanner, headingTitle, textTitle, buttonLeftText, buttonLeftClick, buttonRightText, buttonRightClick, imageURLBackground, withOverlay } = _a, props = __rest(_a, ["moleculeVariant", "iconTop", "iconDot", "buttonLeftIcon", "buttonRightIcon", "textBanner", "headingTitle", "textTitle", "buttonLeftText", "buttonLeftClick", "buttonRightText", "buttonRightClick", "imageURLBackground", "withOverlay"]);
|
|
709
710
|
const compVariant = `Header-${moleculeVariant}`;
|
|
710
|
-
return (jsx(WrapperBackground, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant, imageURLBackground: imageURLBackground, withOverlay: withOverlay }, { children: jsxs(WrapperHeader, Object.assign({ moleculeVariant: compVariant }, { children: [jsxs("div", { children: [iconTop && (jsx(AtomIconTop, { moleculeVariant: compVariant, svg: iconTop })), textBanner && (jsxs(WrapperLineTop, Object.assign({ moleculeVariant: compVariant }, { children: [iconDot && (jsx(AtomIconDot, { moleculeVariant: compVariant, svg: iconDot })), jsx(AtomTextBanner, Object.assign({ moleculeVariant: compVariant }, { children: textBanner }))] })))] }), headingTitle && (jsx(AtomHeading$3, Object.assign({ moleculeVariant: compVariant }, { children: headingTitle }))), jsx(WrapperTextTitle, Object.assign({ moleculeVariant: compVariant }, { children: textTitle &&
|
|
711
|
+
return (jsx(WrapperBackground, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant, imageURLBackground: imageURLBackground, withOverlay: withOverlay }, props, { children: jsxs(WrapperHeader, Object.assign({ moleculeVariant: compVariant }, { children: [jsxs("div", { children: [iconTop && (jsx(AtomIconTop, { moleculeVariant: compVariant, svg: iconTop })), textBanner && (jsxs(WrapperLineTop, Object.assign({ moleculeVariant: compVariant }, { children: [iconDot && (jsx(AtomIconDot, { moleculeVariant: compVariant, svg: iconDot })), jsx(AtomTextBanner, Object.assign({ moleculeVariant: compVariant }, { children: textBanner }))] })))] }), headingTitle && (jsx(AtomHeading$3, Object.assign({ moleculeVariant: compVariant }, { children: headingTitle }))), jsx(WrapperTextTitle, Object.assign({ moleculeVariant: compVariant }, { children: textTitle &&
|
|
711
712
|
(textTitle === null || textTitle === void 0 ? void 0 : textTitle.map((text, i) => (jsx(AtomTextTitle, Object.assign({ moleculeVariant: compVariant }, { children: text }), i)))) })), jsxs(WrapperLineBottom, { children: [(buttonLeftIcon || buttonLeftText) && (jsxs(AtomButtonLeft, Object.assign({ moleculeVariant: compVariant, onClick: buttonLeftClick }, { children: [buttonLeftIcon && (jsx(AtomIconLeft, { moleculeVariant: compVariant, svg: buttonLeftIcon })), buttonLeftText] }))), (buttonRightIcon || buttonRightText) && (jsxs(AtomButtonRight, Object.assign({ moleculeVariant: compVariant, onClick: buttonRightClick }, { children: [buttonRightText, buttonRightIcon && (jsx(AtomIconRight, { moleculeVariant: compVariant, svg: buttonRightIcon }))] })))] })] })) })));
|
|
712
713
|
};
|
|
713
714
|
|
|
@@ -873,7 +874,8 @@ const Backdrop = styled.div `
|
|
|
873
874
|
z-index: 0;
|
|
874
875
|
`;
|
|
875
876
|
|
|
876
|
-
const Navigation = (
|
|
877
|
+
const Navigation = (_a) => {
|
|
878
|
+
var { moleculeVariant = "primary", logo, onLogoClick, iconBurger, tabs } = _a, props = __rest(_a, ["moleculeVariant", "logo", "onLogoClick", "iconBurger", "tabs"]);
|
|
877
879
|
const location = useLocation();
|
|
878
880
|
const currentPath = location.pathname;
|
|
879
881
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -881,7 +883,7 @@ const Navigation = ({ moleculeVariant = "primary", logo, onLogoClick, iconBurger
|
|
|
881
883
|
setIsOpen(!isOpen);
|
|
882
884
|
};
|
|
883
885
|
const compVariant = `Navigation-${moleculeVariant}`;
|
|
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
|
|
886
|
+
return (jsxs(Fragment, { children: [jsx(Backdrop, { isOpen: isOpen, onClick: () => setIsOpen(false) }), jsxs(NavBar, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, props, { 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
887
|
? 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
888
|
: "no tabs available" }))] }))] }))] }));
|
|
887
889
|
};
|
|
@@ -976,7 +978,8 @@ const FooterChildren = styled(Text).attrs(({ theme, moleculeVariant }) => {
|
|
|
976
978
|
}}
|
|
977
979
|
`;
|
|
978
980
|
|
|
979
|
-
const Footer = (
|
|
981
|
+
const Footer = (_a) => {
|
|
982
|
+
var { moleculeVariant = "primary", children, svg, routes } = _a, props = __rest(_a, ["moleculeVariant", "children", "svg", "routes"]);
|
|
980
983
|
// Memoize sorted routes to prevent redundant sorting
|
|
981
984
|
const sortedRoutes = useMemo(() => [...routes].sort((a, b) => a.order - b.order), [routes]);
|
|
982
985
|
const compVariant = "Footer-" + moleculeVariant;
|
|
@@ -987,7 +990,7 @@ const Footer = ({ moleculeVariant = "primary", children, svg, routes }) => {
|
|
|
987
990
|
const target = route.blank ? "_blank" : undefined;
|
|
988
991
|
return (jsxs(StyledLink, Object.assign({ moleculeVariant: compVariant, href: href, to: to, target: target }, { children: [route.label, svg && jsx(IconFooter, { moleculeVariant: compVariant, svg: svg })] }), route.order));
|
|
989
992
|
};
|
|
990
|
-
return (jsxs(FooterWrapper, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, { children: [children && (jsx(StyledGradient, Object.assign({ moleculeVariant: compVariant }, { children: jsx(FooterChildren, Object.assign({ moleculeVariant: compVariant }, { children: children })) }))), jsx(FooterNav, Object.assign({ moleculeVariant: compVariant }, { children: sortedRoutes.map(renderRouteLink) }))] })));
|
|
993
|
+
return (jsxs(FooterWrapper, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, props, { children: [children && (jsx(StyledGradient, Object.assign({ moleculeVariant: compVariant }, { children: jsx(FooterChildren, Object.assign({ moleculeVariant: compVariant }, { children: children })) }))), jsx(FooterNav, Object.assign({ moleculeVariant: compVariant }, { children: sortedRoutes.map(renderRouteLink) }))] })));
|
|
991
994
|
};
|
|
992
995
|
|
|
993
996
|
const CardContainer = styled.div `
|
|
@@ -1325,11 +1328,12 @@ const TextBreakerTape = styled(Text).attrs(({ theme, moleculeVariant }) => {
|
|
|
1325
1328
|
}}
|
|
1326
1329
|
`;
|
|
1327
1330
|
|
|
1328
|
-
const BreakerTape = (
|
|
1331
|
+
const BreakerTape = (_a) => {
|
|
1332
|
+
var { moleculeVariant = "primary", words, svg } = _a, props = __rest(_a, ["moleculeVariant", "words", "svg"]);
|
|
1329
1333
|
// Duplicate words to ensure continuous flow
|
|
1330
1334
|
const repeatedWords = [...words, ...words];
|
|
1331
1335
|
const compVariant = `BreakerTape-${moleculeVariant}`;
|
|
1332
|
-
return (jsx(TapeContainer, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, { children: jsx(FadeOverlay, { children: jsx(TapeContent, Object.assign({ moleculeVariant: compVariant }, { children: repeatedWords.map((word, index) => (jsxs(Fragment, { children: [svg && (jsx(IconBreakerTape, { moleculeVariant: compVariant, svg: svg })), jsx(TextBreakerTape, Object.assign({ moleculeVariant: compVariant }, { children: word }), index)] }))) })) }) })));
|
|
1336
|
+
return (jsx(TapeContainer, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, props, { children: jsx(FadeOverlay, { children: jsx(TapeContent, Object.assign({ moleculeVariant: compVariant }, { children: repeatedWords.map((word, index) => (jsxs(Fragment, { children: [svg && (jsx(IconBreakerTape, { moleculeVariant: compVariant, svg: svg })), jsx(TextBreakerTape, Object.assign({ moleculeVariant: compVariant }, { children: word }), index)] }))) })) }) })));
|
|
1333
1337
|
};
|
|
1334
1338
|
|
|
1335
1339
|
const Card$1 = styled.div `
|
|
@@ -1447,9 +1451,10 @@ const BackgroundSvg = styled(Icon) `
|
|
|
1447
1451
|
height: 100%;
|
|
1448
1452
|
`;
|
|
1449
1453
|
|
|
1450
|
-
const CardSimpleRender = (
|
|
1454
|
+
const CardSimpleRender = (_a) => {
|
|
1455
|
+
var { moleculeVariant = "primary", icon, backgroundSvg, title, description, gradientPosition, children, onClick } = _a, props = __rest(_a, ["moleculeVariant", "icon", "backgroundSvg", "title", "description", "gradientPosition", "children", "onClick"]);
|
|
1451
1456
|
const compVariant = `CardSimpleRender-${moleculeVariant}`;
|
|
1452
|
-
return (jsxs(Card$1, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant, as: onClick ? "button" : "div", onClick: onClick, cardHover: !!onClick, gradientPosition: gradientPosition }, { children: [backgroundSvg && (jsx(BackgroundSvg, { moleculeVariant: compVariant, svg: backgroundSvg })), (icon || title || description) && (jsxs("div", { children: [(icon || title) && (jsxs(WrapperLine, Object.assign({ moleculeVariant: compVariant }, { children: [icon && (jsx(AtomIcon$2, { moleculeVariant: compVariant, svg: icon })), title && (jsx(AtomHeading$2, Object.assign({ moleculeVariant: compVariant }, { children: title })))] }))), description && (jsx(AtomText$2, Object.assign({ moleculeVariant: compVariant }, { children: description })))] })), children] })));
|
|
1457
|
+
return (jsxs(Card$1, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant, as: onClick ? "button" : "div", onClick: onClick, cardHover: !!onClick, gradientPosition: gradientPosition }, props, { children: [backgroundSvg && (jsx(BackgroundSvg, { moleculeVariant: compVariant, svg: backgroundSvg })), (icon || title || description) && (jsxs("div", { children: [(icon || title) && (jsxs(WrapperLine, Object.assign({ moleculeVariant: compVariant }, { children: [icon && (jsx(AtomIcon$2, { moleculeVariant: compVariant, svg: icon })), title && (jsx(AtomHeading$2, Object.assign({ moleculeVariant: compVariant }, { children: title })))] }))), description && (jsx(AtomText$2, Object.assign({ moleculeVariant: compVariant }, { children: description })))] })), children] })));
|
|
1453
1458
|
};
|
|
1454
1459
|
|
|
1455
1460
|
const Card = styled.div `
|
|
@@ -1510,8 +1515,9 @@ const AtomIcon$1 = styled(Icon).attrs(({ theme, moleculeVariant }) => {
|
|
|
1510
1515
|
});
|
|
1511
1516
|
}) ``;
|
|
1512
1517
|
|
|
1513
|
-
const CardBanner = (
|
|
1514
|
-
|
|
1518
|
+
const CardBanner = (_a) => {
|
|
1519
|
+
var { moleculeVariant = "primary", icon, title, description, buttonText, buttonClick } = _a, props = __rest(_a, ["moleculeVariant", "icon", "title", "description", "buttonText", "buttonClick"]);
|
|
1520
|
+
return (jsxs(Card, Object.assign({ className: classNames("CardBanner-", moleculeVariant), moleculeVariant: "CardBanner-" + moleculeVariant }, props, { children: [jsxs("div", { children: [jsx(AtomHeading$1, Object.assign({ moleculeVariant: "CardBanner-" + moleculeVariant }, { children: title })), jsx(AtomText$1, Object.assign({ moleculeVariant: "CardBanner-" + moleculeVariant }, { children: description }))] }), buttonClick && (jsxs(AtomButton, Object.assign({ moleculeVariant: "CardBanner-" + moleculeVariant, onClick: buttonClick }, { children: [buttonText, icon && (jsx(AtomIcon$1, { moleculeVariant: "CardBanner-" + moleculeVariant, svg: icon }))] })))] })));
|
|
1515
1521
|
};
|
|
1516
1522
|
|
|
1517
1523
|
const AccordionContainer = styled.div `
|
|
@@ -1610,7 +1616,8 @@ const AtomText = styled(Text).attrs(({ theme, moleculeVariant }) => {
|
|
|
1610
1616
|
}};
|
|
1611
1617
|
`;
|
|
1612
1618
|
|
|
1613
|
-
const Accordion = (
|
|
1619
|
+
const Accordion = (_a) => {
|
|
1620
|
+
var { moleculeVariant = "primary", iconPlus, iconMinus, content = [] } = _a, props = __rest(_a, ["moleculeVariant", "iconPlus", "iconMinus", "content"]);
|
|
1614
1621
|
const [openIndices, setOpenIndices] = useState([]);
|
|
1615
1622
|
const toggleAccordion = (index) => {
|
|
1616
1623
|
setOpenIndices((prev) => {
|
|
@@ -1620,7 +1627,7 @@ const Accordion = ({ moleculeVariant = "primary", iconPlus, iconMinus, content =
|
|
|
1620
1627
|
});
|
|
1621
1628
|
};
|
|
1622
1629
|
const compVariant = `Accordion-${moleculeVariant}`;
|
|
1623
|
-
return (jsx(AccordionContainer, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, { children: content === null || content === void 0 ? void 0 : content.map((item, index) => (jsxs("div", { children: [jsxs(AccordionTitle, Object.assign({ moleculeVariant: compVariant, onClick: () => toggleAccordion(index), "aria-pressed": openIndices[index] }, { children: [jsx(AtomHeading, Object.assign({ moleculeVariant: compVariant }, { children: item.title })), iconPlus && iconMinus && (jsx(AtomIcon, { moleculeVariant: compVariant, svg: openIndices[index] ? iconMinus : iconPlus }))] })), jsx(AccordionDescription, Object.assign({ moleculeVariant: compVariant, isOpen: openIndices[index], onTransitionEnd: () => !openIndices[index] }, { children: jsx(AtomText, Object.assign({ moleculeVariant: compVariant }, { children: item.description })) }))] }, index))) })));
|
|
1630
|
+
return (jsx(AccordionContainer, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, props, { children: content === null || content === void 0 ? void 0 : content.map((item, index) => (jsxs("div", { children: [jsxs(AccordionTitle, Object.assign({ moleculeVariant: compVariant, onClick: () => toggleAccordion(index), "aria-pressed": openIndices[index] }, { children: [jsx(AtomHeading, Object.assign({ moleculeVariant: compVariant }, { children: item.title })), iconPlus && iconMinus && (jsx(AtomIcon, { moleculeVariant: compVariant, svg: openIndices[index] ? iconMinus : iconPlus }))] })), jsx(AccordionDescription, Object.assign({ moleculeVariant: compVariant, isOpen: openIndices[index], onTransitionEnd: () => !openIndices[index] }, { children: jsx(AtomText, Object.assign({ moleculeVariant: compVariant }, { children: item.description })) }))] }, index))) })));
|
|
1624
1631
|
};
|
|
1625
1632
|
|
|
1626
1633
|
const Layout = styled.div `
|
|
@@ -1663,9 +1670,10 @@ const Element = styled.div `
|
|
|
1663
1670
|
}}
|
|
1664
1671
|
`;
|
|
1665
1672
|
|
|
1666
|
-
const Pint3 = (
|
|
1673
|
+
const Pint3 = (_a) => {
|
|
1674
|
+
var { moleculeVariant = "primary", cards, minHeight } = _a, props = __rest(_a, ["moleculeVariant", "cards", "minHeight"]);
|
|
1667
1675
|
const compVariant = `Pint3-${moleculeVariant}`;
|
|
1668
|
-
return (jsxs(Layout, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant, minHeight: minHeight }, { children: [jsxs(Column, Object.assign({ moleculeVariant: compVariant, minHeight: minHeight }, { children: [jsx(Element, Object.assign({ weight: 2 }, { children: cards === null || cards === void 0 ? void 0 : cards[0] })), jsx(Element, Object.assign({ weight: 8 }, { children: cards === null || cards === void 0 ? void 0 : cards[1] }))] })), jsxs(Column, Object.assign({ moleculeVariant: compVariant, minHeight: minHeight }, { children: [jsx(Element, Object.assign({ weight: 2 }, { children: cards === null || cards === void 0 ? void 0 : cards[2] })), jsx(Element, Object.assign({ weight: 1 }, { children: cards === null || cards === void 0 ? void 0 : cards[3] })), jsx(Element, Object.assign({ weight: 7 }, { children: cards === null || cards === void 0 ? void 0 : cards[4] }))] })), jsxs(Column, Object.assign({ moleculeVariant: compVariant, minHeight: minHeight }, { children: [jsx(Element, Object.assign({ weight: 3.5 }, { children: cards === null || cards === void 0 ? void 0 : cards[5] })), jsx(Element, Object.assign({ weight: 6.5 }, { children: cards === null || cards === void 0 ? void 0 : cards[6] }))] }))] })));
|
|
1676
|
+
return (jsxs(Layout, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant, minHeight: minHeight }, props, { children: [jsxs(Column, Object.assign({ moleculeVariant: compVariant, minHeight: minHeight }, { children: [jsx(Element, Object.assign({ weight: 2 }, { children: cards === null || cards === void 0 ? void 0 : cards[0] })), jsx(Element, Object.assign({ weight: 8 }, { children: cards === null || cards === void 0 ? void 0 : cards[1] }))] })), jsxs(Column, Object.assign({ moleculeVariant: compVariant, minHeight: minHeight }, { children: [jsx(Element, Object.assign({ weight: 2 }, { children: cards === null || cards === void 0 ? void 0 : cards[2] })), jsx(Element, Object.assign({ weight: 1 }, { children: cards === null || cards === void 0 ? void 0 : cards[3] })), jsx(Element, Object.assign({ weight: 7 }, { children: cards === null || cards === void 0 ? void 0 : cards[4] }))] })), jsxs(Column, Object.assign({ moleculeVariant: compVariant, minHeight: minHeight }, { children: [jsx(Element, Object.assign({ weight: 3.5 }, { children: cards === null || cards === void 0 ? void 0 : cards[5] })), jsx(Element, Object.assign({ weight: 6.5 }, { children: cards === null || cards === void 0 ? void 0 : cards[6] }))] }))] })));
|
|
1669
1677
|
};
|
|
1670
1678
|
|
|
1671
1679
|
export { Accordion, BreakerTape, Button, CDNImage, CardBanner, CardSimpleRender, CardTeaser, Divider, Footer, Gradient, Header, Heading, Icon, Link, Navigation, Pint3, Text };
|