@manamerge/mana-atomic-ui 1.0.8 → 1.0.10
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 +6 -2
- package/dist/index.js +118 -29
- package/dist/index.js.map +1 -1
- package/dist/themes/themes/davidWeb/molecules/header.ts +49 -4
- package/dist/themes/themes/davidWeb/molecules/navigation.ts +9 -2
- package/dist/themes/themes/manamerge/molecules/header.ts +49 -4
- package/dist/themes/themes/manamerge/molecules/navigation.ts +9 -2
- package/dist/types/components/Molecules/Header/Header.css.d.ts +8 -1
- package/dist/types/components/Molecules/Header/Header.d.ts +4 -2
- package/dist/types/components/Molecules/Header/Header.stories.d.ts +1 -0
- package/dist/types/components/Molecules/Navigation/Navigation.css.d.ts +2 -4
- package/dist/types/components/Molecules/Navigation/Navigation.d.ts +2 -0
- package/dist/types/themes/DavidWebTheme.d.ts +55 -4
- package/dist/types/themes/ManamergeTheme.d.ts +55 -4
- package/dist/types/themes/davidWeb/molecules/header.d.ts +46 -2
- package/dist/types/themes/davidWeb/molecules/navigation.d.ts +9 -2
- package/dist/types/themes/manamerge/molecules/header.d.ts +46 -2
- package/dist/types/themes/manamerge/molecules/navigation.d.ts +9 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -141,8 +141,8 @@ interface HeaderTypes {
|
|
|
141
141
|
moleculeVariant?: string;
|
|
142
142
|
iconTop?: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
143
143
|
iconDot?: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
buttonLeftIcon?: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
145
|
+
buttonRightIcon?: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
146
146
|
textBanner?: string;
|
|
147
147
|
headingTitle?: string;
|
|
148
148
|
textTitle?: string[];
|
|
@@ -150,16 +150,20 @@ interface HeaderTypes {
|
|
|
150
150
|
buttonLeftClick?: React.MouseEventHandler<HTMLElement>;
|
|
151
151
|
buttonRightText?: string;
|
|
152
152
|
buttonRightClick?: React.MouseEventHandler<HTMLElement>;
|
|
153
|
+
imageURLBackground?: string;
|
|
154
|
+
withOverlay?: boolean;
|
|
153
155
|
}
|
|
154
156
|
declare const Header: React.FC<HeaderTypes>;
|
|
155
157
|
|
|
156
158
|
interface NavigationTypes {
|
|
157
159
|
moleculeVariant?: string;
|
|
160
|
+
logo?: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
158
161
|
iconBurger: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
159
162
|
tabs: {
|
|
160
163
|
label: string;
|
|
161
164
|
to: string;
|
|
162
165
|
}[];
|
|
166
|
+
onLogoClick?: () => void;
|
|
163
167
|
onTabClick: (label: string) => void;
|
|
164
168
|
}
|
|
165
169
|
declare const Navigation: React.FC<NavigationTypes>;
|
package/dist/index.js
CHANGED
|
@@ -502,20 +502,62 @@ const CDNImage = ({ src, alt = "", fetchPriority = "auto", decoding = "async", b
|
|
|
502
502
|
};
|
|
503
503
|
|
|
504
504
|
const WrapperBackground = styled.div `
|
|
505
|
-
position: relative;
|
|
506
505
|
display: flex;
|
|
506
|
+
position: relative;
|
|
507
507
|
align-items: center;
|
|
508
|
-
justify-content: center;
|
|
509
508
|
width: 100%;
|
|
509
|
+
${({ theme, moleculeVariant, imageURLBackground, withOverlay }) => {
|
|
510
|
+
var _a;
|
|
511
|
+
const thisTheme = ((_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) || {};
|
|
512
|
+
return css `
|
|
513
|
+
background-image: url(${imageURLBackground});
|
|
514
|
+
background-size: cover;
|
|
515
|
+
background-repeat: no-repeat;
|
|
516
|
+
background-position: center;
|
|
517
|
+
justify-content: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.justifyContent) || "center"};
|
|
518
|
+
height: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.height) || "unset"};
|
|
519
|
+
background-color: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.backgroundColor) || "unset"};
|
|
520
|
+
|
|
521
|
+
/* Overlay */
|
|
522
|
+
${withOverlay &&
|
|
523
|
+
css `
|
|
524
|
+
&::before {
|
|
525
|
+
content: "";
|
|
526
|
+
position: absolute;
|
|
527
|
+
inset: 0;
|
|
528
|
+
|
|
529
|
+
background: linear-gradient(
|
|
530
|
+
${thisTheme.gradientStyles.orientation},
|
|
531
|
+
${thisTheme.gradientStyles.primaryColor},
|
|
532
|
+
${thisTheme.gradientStyles.secondaryColor},
|
|
533
|
+
${thisTheme.gradientStyles.tertiaryColor}
|
|
534
|
+
);
|
|
535
|
+
|
|
536
|
+
opacity: 0;
|
|
537
|
+
transition: opacity 0.7s ease;
|
|
538
|
+
pointer-events: none;
|
|
539
|
+
}
|
|
540
|
+
&:hover::before {
|
|
541
|
+
opacity: 1;
|
|
542
|
+
}
|
|
543
|
+
`}
|
|
544
|
+
`;
|
|
545
|
+
}};
|
|
510
546
|
`;
|
|
511
547
|
const WrapperHeader = styled.div `
|
|
512
548
|
display: flex;
|
|
513
549
|
flex-direction: column;
|
|
514
|
-
align-items: center;
|
|
515
550
|
justify-content: center;
|
|
516
551
|
text-align: center;
|
|
517
552
|
gap: 15px;
|
|
518
553
|
position: relative;
|
|
554
|
+
${({ theme, moleculeVariant }) => {
|
|
555
|
+
var _a, _b;
|
|
556
|
+
const thisTheme = ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.wrapperHeader) || {};
|
|
557
|
+
return css `
|
|
558
|
+
align-items: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.alignItems) || "center"};
|
|
559
|
+
`;
|
|
560
|
+
}}
|
|
519
561
|
`;
|
|
520
562
|
const WrapperLineTop = styled.div `
|
|
521
563
|
display: flex;
|
|
@@ -597,13 +639,35 @@ const AtomButtonLeft = styled(Button).attrs(({ theme, moleculeVariant }) => {
|
|
|
597
639
|
return ({
|
|
598
640
|
variant: (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.atomButtonLeft) === null || _c === void 0 ? void 0 : _c.variant
|
|
599
641
|
});
|
|
600
|
-
})
|
|
642
|
+
}) `
|
|
643
|
+
display: flex;
|
|
644
|
+
|
|
645
|
+
${({ theme, moleculeVariant }) => {
|
|
646
|
+
var _a, _b;
|
|
647
|
+
const atomTheme = ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.atomButtonLeft) || {};
|
|
648
|
+
return css `
|
|
649
|
+
flex-direction: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.flexDirection) || "none"};
|
|
650
|
+
gap: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.gap) || "none"};
|
|
651
|
+
`;
|
|
652
|
+
}}
|
|
653
|
+
`;
|
|
601
654
|
const AtomButtonRight = styled(Button).attrs(({ theme, moleculeVariant }) => {
|
|
602
655
|
var _a, _b, _c;
|
|
603
656
|
return ({
|
|
604
657
|
variant: (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.atomButtonRight) === null || _c === void 0 ? void 0 : _c.variant
|
|
605
658
|
});
|
|
606
|
-
})
|
|
659
|
+
}) `
|
|
660
|
+
display: flex;
|
|
661
|
+
|
|
662
|
+
${({ theme, moleculeVariant }) => {
|
|
663
|
+
var _a, _b;
|
|
664
|
+
const atomTheme = ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.atomButtonRight) || {};
|
|
665
|
+
return css `
|
|
666
|
+
flex-direction: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.flexDirection) || "none"};
|
|
667
|
+
gap: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.gap) || "none"};
|
|
668
|
+
`;
|
|
669
|
+
}}
|
|
670
|
+
`;
|
|
607
671
|
const AtomTextLeft = styled(Text).attrs(({ theme, moleculeVariant }) => {
|
|
608
672
|
var _a, _b, _c;
|
|
609
673
|
return ({
|
|
@@ -628,18 +692,39 @@ const AtomIconRight = styled(Icon).attrs(({ theme, moleculeVariant }) => {
|
|
|
628
692
|
variant: (_c = (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.atomIconRight) === null || _c === void 0 ? void 0 : _c.variant
|
|
629
693
|
});
|
|
630
694
|
}) ``;
|
|
695
|
+
const WrapperTextTitle = styled.div `
|
|
696
|
+
display: flex;
|
|
697
|
+
flex-direction: column;
|
|
698
|
+
|
|
699
|
+
${({ theme, moleculeVariant }) => {
|
|
700
|
+
var _a, _b;
|
|
701
|
+
const atomTheme = ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) === null || _b === void 0 ? void 0 : _b.wrapperTextTitle) || {};
|
|
702
|
+
return css `
|
|
703
|
+
align-items: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.alignItems) || "none"};
|
|
704
|
+
`;
|
|
705
|
+
}}
|
|
706
|
+
`;
|
|
631
707
|
|
|
632
|
-
const Header = ({ moleculeVariant = "primary", iconTop, iconDot,
|
|
708
|
+
const Header = ({ moleculeVariant = "primary", iconTop, iconDot, buttonLeftIcon, buttonRightIcon, textBanner, headingTitle, textTitle, buttonLeftText, buttonLeftClick, buttonRightText, buttonRightClick, imageURLBackground, withOverlay }) => {
|
|
633
709
|
const compVariant = `Header-${moleculeVariant}`;
|
|
634
|
-
return (jsx(WrapperBackground, Object.assign({ className: classNames(compVariant), moleculeVariant: compVariant }, { children: jsxs(WrapperHeader, { children: [jsxs("div", { children: [iconTop && (jsx(AtomIconTop, { moleculeVariant: compVariant, svg: iconTop })), jsxs(WrapperLineTop, Object.assign({ moleculeVariant: compVariant }, { children: [iconDot && (jsx(AtomIconDot, { moleculeVariant: compVariant, svg: iconDot })), jsx(AtomTextTitle, Object.assign({ moleculeVariant: compVariant }, { children: textBanner }))] }))] }),
|
|
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(AtomTextTitle, 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
|
+
(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 && (jsx(AtomTextLeft, Object.assign({ moleculeVariant: compVariant }, { children: buttonLeftText })))] }))), (buttonRightIcon || buttonRightText) && (jsxs(AtomButtonRight, Object.assign({ moleculeVariant: compVariant, onClick: buttonRightClick }, { children: [buttonRightText && (jsx(AtomTextRight, Object.assign({ moleculeVariant: compVariant }, { children: buttonRightText }))), buttonRightIcon && (jsx(AtomIconRight, { moleculeVariant: compVariant, svg: buttonRightIcon }))] })))] })] })) })));
|
|
635
712
|
};
|
|
636
713
|
|
|
637
714
|
const NavBar = styled.nav `
|
|
715
|
+
display: flex;
|
|
716
|
+
align-items: flex-start;
|
|
717
|
+
|
|
638
718
|
${({ theme, moleculeVariant }) => {
|
|
639
719
|
var _a;
|
|
640
720
|
const navigationTheme = ((_a = theme === null || theme === void 0 ? void 0 : theme.navigation) === null || _a === void 0 ? void 0 : _a[moleculeVariant]) || {};
|
|
721
|
+
const { largeMobileUp } = theme.media;
|
|
641
722
|
return css `
|
|
642
|
-
|
|
723
|
+
${largeMobileUp} {
|
|
724
|
+
align-items: center;
|
|
725
|
+
}
|
|
726
|
+
gap: ${navigationTheme === null || navigationTheme === void 0 ? void 0 : navigationTheme.gap};
|
|
727
|
+
background: ${(navigationTheme === null || navigationTheme === void 0 ? void 0 : navigationTheme.background) || "#333"};
|
|
643
728
|
`;
|
|
644
729
|
}}
|
|
645
730
|
|
|
@@ -649,12 +734,11 @@ const BurgerWrapper = styled.div `
|
|
|
649
734
|
flex-direction: column;
|
|
650
735
|
align-items: flex-end;
|
|
651
736
|
display: flex;
|
|
652
|
-
padding: 3px;
|
|
653
737
|
${({ theme }) => theme.media.largeMobileUp} {
|
|
654
738
|
display: none;
|
|
655
739
|
}
|
|
656
740
|
`;
|
|
657
|
-
const
|
|
741
|
+
const AtomIcon$3 = styled(Icon).attrs(({ theme, moleculeVariant }) => {
|
|
658
742
|
var _a, _b, _c;
|
|
659
743
|
return ({
|
|
660
744
|
variant: (_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.atomIcon) === null || _c === void 0 ? void 0 : _c.variant
|
|
@@ -685,11 +769,21 @@ const NavLinks = styled.div `
|
|
|
685
769
|
text-align: right;
|
|
686
770
|
display: ${({ isOpen }) => (isOpen ? "flex" : "none")};
|
|
687
771
|
width: 100%;
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
}
|
|
772
|
+
|
|
773
|
+
${({ theme, moleculeVariant }) => {
|
|
774
|
+
var _a, _b, _c, _d;
|
|
775
|
+
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) || {};
|
|
776
|
+
const { largeMobileUp } = theme.media;
|
|
777
|
+
return css `
|
|
778
|
+
${largeMobileUp} {
|
|
779
|
+
padding: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.padding) || "none"};
|
|
780
|
+
display: flex;
|
|
781
|
+
flex-direction: row;
|
|
782
|
+
gap: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.gap) || "none"};
|
|
783
|
+
justify-content: ${(thisTheme === null || thisTheme === void 0 ? void 0 : thisTheme.justifyContent) || "space-around"};
|
|
784
|
+
}
|
|
785
|
+
`;
|
|
786
|
+
}}
|
|
693
787
|
`;
|
|
694
788
|
const StyledLink$1 = styled(Link).attrs(({ theme, moleculeVariant }) => {
|
|
695
789
|
var _a, _b, _c;
|
|
@@ -719,26 +813,21 @@ const StyledLink$1 = styled(Link).attrs(({ theme, moleculeVariant }) => {
|
|
|
719
813
|
`;
|
|
720
814
|
}};
|
|
721
815
|
`;
|
|
722
|
-
const AtomButton$1 = styled(Button).attrs(({ theme, moleculeVariant }) => {
|
|
723
|
-
var _a, _b, _c;
|
|
724
|
-
return ({
|
|
725
|
-
variant: (_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.atomButton) === null || _c === void 0 ? void 0 : _c.variant
|
|
726
|
-
});
|
|
727
|
-
}) ``;
|
|
728
816
|
|
|
729
|
-
const Navigation = ({ moleculeVariant = "primary", iconBurger, tabs, onTabClick }) => {
|
|
817
|
+
const Navigation = ({ moleculeVariant = "primary", logo, onLogoClick, iconBurger, tabs, onTabClick }) => {
|
|
730
818
|
const location = useLocation();
|
|
731
819
|
const currentPath = location.pathname.slice(1);
|
|
732
820
|
const [isOpen, setIsOpen] = useState(false);
|
|
733
821
|
const handleToggle = () => {
|
|
734
822
|
setIsOpen(!isOpen);
|
|
735
823
|
};
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
824
|
+
const compVariant = `Navigation-${moleculeVariant}`;
|
|
825
|
+
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
|
|
826
|
+
? tabs.map((tab) => (jsx(StyledLink$1, Object.assign({ moleculeVariant: compVariant, to: tab.to, currentPath: tab.label === currentPath, onClick: () => {
|
|
827
|
+
onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(tab.label);
|
|
828
|
+
setIsOpen(false);
|
|
829
|
+
} }, { children: tab.label }), tab.label)))
|
|
830
|
+
: "no tabs available" }))] }))] })));
|
|
742
831
|
};
|
|
743
832
|
|
|
744
833
|
// Wrapper for the footer
|
|
@@ -1065,7 +1154,7 @@ const scroll = keyframes `
|
|
|
1065
1154
|
transform: translateX(0);
|
|
1066
1155
|
}
|
|
1067
1156
|
100% {
|
|
1068
|
-
transform: translateX(-
|
|
1157
|
+
transform: translateX(-5%);
|
|
1069
1158
|
}
|
|
1070
1159
|
`;
|
|
1071
1160
|
const TapeContainer = styled.div `
|