@manamerge/mana-atomic-ui 0.0.68 → 0.0.70

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.
Files changed (26) hide show
  1. package/dist/index.d.ts +47 -18
  2. package/dist/index.js +309 -16
  3. package/dist/index.js.map +1 -1
  4. package/dist/themes/themes/Manamerge.ts +8 -6
  5. package/dist/themes/themes/manamerge/atoms/button.ts +2 -2
  6. package/dist/themes/themes/manamerge/atoms/heading.ts +6 -6
  7. package/dist/themes/themes/manamerge/molecules/header.ts +60 -0
  8. package/dist/themes/themes/manamerge/molecules/navigation.ts +40 -1
  9. package/dist/types/components/Atoms/Button/Button.css.d.ts +1 -1
  10. package/dist/types/components/Atoms/Button/Button.d.ts +1 -1
  11. package/dist/types/components/Atoms/Heading/Heading.d.ts +1 -1
  12. package/dist/types/components/Atoms/Icon/Icon.d.ts +4 -0
  13. package/dist/types/components/Molecules/Footer/Footer.d.ts +2 -2
  14. package/dist/types/components/Molecules/Header/Header.css.d.ts +14 -0
  15. package/dist/types/components/Molecules/Header/Header.d.ts +15 -0
  16. package/dist/types/components/Molecules/Header/Header.stories.d.ts +6 -0
  17. package/dist/types/components/Molecules/Navigation/Navigation.css.d.ts +10 -0
  18. package/dist/types/components/Molecules/Navigation/Navigation.d.ts +10 -0
  19. package/dist/types/components/Molecules/Navigation/Navigation.stories.d.ts +6 -0
  20. package/dist/types/components/index.d.ts +3 -1
  21. package/dist/types/themes/Manamerge.d.ts +96 -21
  22. package/dist/types/themes/manamerge/atoms/button.d.ts +2 -2
  23. package/dist/types/themes/manamerge/atoms/heading.d.ts +6 -6
  24. package/dist/types/themes/manamerge/molecules/header.d.ts +48 -0
  25. package/dist/types/themes/manamerge/molecules/navigation.d.ts +35 -1
  26. package/package.json +4 -3
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import React, { ReactNode, FunctionComponent, SVGProps, AnchorHTMLAttributes, El
2
2
 
3
3
  interface ButtonTypes {
4
4
  disabled?: boolean;
5
- className?: string;
5
+ variant?: string;
6
6
  image?: string | null;
7
7
  background?: string;
8
8
  alt?: string;
@@ -54,8 +54,8 @@ interface ISizes {
54
54
  big?: string | number;
55
55
  }
56
56
  interface HeadingTypes {
57
+ variant?: string;
57
58
  children: ReactNode;
58
- className: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
59
59
  color?: string;
60
60
  margin?: ISizes;
61
61
  fontSize?: ISizes;
@@ -72,24 +72,13 @@ interface IconTypes {
72
72
  stroke?: string;
73
73
  hoverColor?: string;
74
74
  hoverStroke?: string;
75
+ onClick?: () => void;
76
+ onKeyDown?: (event: React.KeyboardEvent<SVGSVGElement>) => void;
77
+ tabIndex?: number;
78
+ role?: string;
75
79
  }
76
80
  declare const Icon: React.FC<IconTypes>;
77
81
 
78
- interface Route {
79
- order: number;
80
- type: "internal" | "external";
81
- url?: string;
82
- slug?: string;
83
- label: string;
84
- blank?: boolean;
85
- }
86
- interface FooterTypes {
87
- children?: string;
88
- svg?: FunctionComponent<SVGProps<SVGSVGElement>>;
89
- routes: Route[];
90
- }
91
- declare const Footer: React.FC<FooterTypes>;
92
-
93
82
  interface LinkTypes extends AnchorHTMLAttributes<HTMLAnchorElement> {
94
83
  to?: string;
95
84
  color?: string;
@@ -104,4 +93,44 @@ interface LinkTypes extends AnchorHTMLAttributes<HTMLAnchorElement> {
104
93
  }
105
94
  declare const Link: React.FC<LinkTypes>;
106
95
 
107
- export { Button, Footer, Heading, Icon, Link, LinkTypes, Text };
96
+ interface HeaderTypes {
97
+ iconTop?: FunctionComponent<SVGProps<SVGSVGElement>>;
98
+ iconDot?: FunctionComponent<SVGProps<SVGSVGElement>>;
99
+ iconLeft?: FunctionComponent<SVGProps<SVGSVGElement>>;
100
+ iconRight?: FunctionComponent<SVGProps<SVGSVGElement>>;
101
+ textBanner?: string;
102
+ headingTitle?: string;
103
+ textTitle?: string[];
104
+ buttonLeftText?: string;
105
+ buttonLeftClick?: React.MouseEventHandler<HTMLElement>;
106
+ buttonRightText?: string;
107
+ buttonRightClick?: React.MouseEventHandler<HTMLElement>;
108
+ }
109
+ declare const Header: React.FC<HeaderTypes>;
110
+
111
+ interface NavigationTypes {
112
+ iconBurger: FunctionComponent<SVGProps<SVGSVGElement>>;
113
+ tabs: {
114
+ label: string;
115
+ to: string;
116
+ }[];
117
+ onTabClick: (label: string) => void;
118
+ }
119
+ declare const Navigation: React.FC<NavigationTypes>;
120
+
121
+ interface RouteTypes {
122
+ order: number;
123
+ type: "internal" | "external";
124
+ url?: string;
125
+ slug?: string;
126
+ label: string;
127
+ blank?: boolean;
128
+ }
129
+ interface FooterTypes {
130
+ children?: string;
131
+ svg?: FunctionComponent<SVGProps<SVGSVGElement>>;
132
+ routes: RouteTypes[];
133
+ }
134
+ declare const Footer: React.FC<FooterTypes>;
135
+
136
+ export { Button, Footer, Header, Heading, Icon, Link, Navigation, Text };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import React, { useMemo } from 'react';
1
+ import React, { useState, useMemo } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import styled, { css } from 'styled-components';
4
- import { Link as Link$1 } from 'react-router-dom';
4
+ import { NavLink, useLocation } from 'react-router-dom';
5
5
 
6
6
  /******************************************************************************
7
7
  Copyright (c) Microsoft Corporation.
@@ -40,8 +40,8 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
40
40
  const ButtonStyle = styled.button `
41
41
  ${(_a) => {
42
42
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
43
- var { className, theme, disabled } = _a, props = __rest(_a, ["className", "theme", "disabled"]);
44
- const buttonStyles = (theme === null || theme === void 0 ? void 0 : theme.button[className]) || {};
43
+ var { variant, theme, disabled } = _a, props = __rest(_a, ["variant", "theme", "disabled"]);
44
+ const buttonStyles = (theme === null || theme === void 0 ? void 0 : theme.button[variant]) || {};
45
45
  return css `
46
46
  /* Default State */
47
47
  background: ${disabled
@@ -145,16 +145,17 @@ const ImgStyle = styled.svg `
145
145
  height: 1em;
146
146
  `;
147
147
 
148
- const Button = ({ className = "", disabled = false, image, opacity = "0", background, alt, children, onClick, type = "submit", color, altColor, frame, border, text, fill, effects, padding, flexbox, cursor, margin, display, radius, fontWeight, letterSpacing, shadow, transition, width, height, gap, align }) => {
148
+ const Button = (_a) => {
149
+ var { variant, disabled = false, image, opacity = "0", background, alt, children, onClick, type = "submit", color, altColor, frame, border, text, fill, effects, padding, flexbox, cursor, margin, display, radius, fontWeight, letterSpacing, shadow, transition, width, height, gap, align } = _a, props = __rest(_a, ["variant", "disabled", "image", "opacity", "background", "alt", "children", "onClick", "type", "color", "altColor", "frame", "border", "text", "fill", "effects", "padding", "flexbox", "cursor", "margin", "display", "radius", "fontWeight", "letterSpacing", "shadow", "transition", "width", "height", "gap", "align"]);
149
150
  // Log a warning if both `children` and `alt` are missing for accessibility
150
151
  if (!children && !alt) {
151
152
  console.error(`Provide either "children" or "alt" property to the Button.`);
152
153
  }
153
- return (React.createElement(ButtonStyle, { disabled: disabled, className: classNames("Button", className), type: type, "aria-label": alt || "", background: background, color: color, opacity: opacity, altColor: altColor, frame: frame, border: border, text: text, fill: fill, effects: effects, padding: padding, flexbox: flexbox, cursor: cursor, margin: margin, display: display, radius: radius, fontWeight: fontWeight, letterSpacing: letterSpacing, shadow: shadow, transition: transition, width: width, height: height, gap: gap, align: align, onClick: (e) => {
154
+ return (React.createElement(ButtonStyle, Object.assign({ disabled: disabled, className: classNames("Button", variant), variant: "Button-" + variant, type: type, "aria-label": alt || "", background: background, color: color, opacity: opacity, altColor: altColor, frame: frame, border: border, text: text, fill: fill, effects: effects, padding: padding, flexbox: flexbox, cursor: cursor, margin: margin, display: display, radius: radius, fontWeight: fontWeight, letterSpacing: letterSpacing, shadow: shadow, transition: transition, width: width, height: height, gap: gap, align: align, onClick: (e) => {
154
155
  if (!disabled && onClick) {
155
156
  onClick(e);
156
157
  }
157
- } },
158
+ } }, props),
158
159
  image && (React.createElement(ImgStyle, { viewBox: "0 0 100 100" },
159
160
  React.createElement("defs", null,
160
161
  React.createElement("mask", { id: `${image}-mask` },
@@ -206,10 +207,10 @@ const Text = (_a) => {
206
207
  };
207
208
 
208
209
  const HeadingContainer = styled.h1 `
209
- ${({ className, theme, color, margin, fontSize, fontWeight, lineHeight }) => {
210
+ ${({ variant = "h1", theme, margin, fontSize, fontWeight, lineHeight, color }) => {
210
211
  const { media, heading } = theme;
211
212
  const { tinyMobileUp, largeMobileUp, superLargeDesktopUp } = media;
212
- const headingStyles = (heading === null || heading === void 0 ? void 0 : heading[className]) || {};
213
+ const headingStyles = (heading === null || heading === void 0 ? void 0 : heading[variant]) || {};
213
214
  const { mobile, tablet, desktop } = headingStyles;
214
215
  return css `
215
216
  ${tinyMobileUp} {
@@ -237,7 +238,10 @@ const HeadingContainer = styled.h1 `
237
238
  }}
238
239
  `;
239
240
 
240
- const Heading = ({ className, children, margin, color, fontSize, lineHeight, fontWeight }) => (React.createElement(HeadingContainer, { className: classNames("Heading", className), as: className, margin: margin, color: color, fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight }, children));
241
+ const Heading = (_a) => {
242
+ var { variant, children, margin, color, fontSize, lineHeight, fontWeight } = _a, props = __rest(_a, ["variant", "children", "margin", "color", "fontSize", "lineHeight", "fontWeight"]);
243
+ return (React.createElement(HeadingContainer, Object.assign({ className: classNames("Heading-", variant), variant: "Heading-" + variant, as: variant, margin: margin, color: color, fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight }, props), children));
244
+ };
241
245
 
242
246
  const StyledSvg = styled.svg `
243
247
  ${(_a) => {
@@ -248,6 +252,7 @@ const StyledSvg = styled.svg `
248
252
  width: ${props.size || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.size) || "auto"};
249
253
  height: ${props.size || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.size) || "auto"};
250
254
  fill: ${props.color || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.color)};
255
+ color: ${props.color || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.color)};
251
256
  stroke: ${props.stroke || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.stroke)};
252
257
  &:hover {
253
258
  /* opacity: 0.8; */
@@ -258,15 +263,16 @@ const StyledSvg = styled.svg `
258
263
  }}
259
264
  `;
260
265
 
261
- const Icon = ({ variant, svg: SvgIcon, color, size, stroke, hoverColor, hoverStroke }) => {
266
+ const Icon = (_a) => {
267
+ var { variant, svg: SvgIcon, color, size, stroke, hoverColor, hoverStroke, onClick, onKeyDown, tabIndex, role } = _a, props = __rest(_a, ["variant", "svg", "color", "size", "stroke", "hoverColor", "hoverStroke", "onClick", "onKeyDown", "tabIndex", "role"]);
262
268
  if (!SvgIcon) {
263
269
  console.error("No SVG provided to the Icon component.");
264
270
  return null;
265
271
  }
266
- return (React.createElement(StyledSvg, { className: classNames("Icon-" + variant), variant: "Icon-" + variant, as: SvgIcon, size: size, color: color, stroke: stroke, hoverColor: hoverColor, hoverStroke: hoverStroke }));
272
+ return (React.createElement(StyledSvg, Object.assign({ className: classNames("Icon-" + variant), variant: "Icon-" + variant, as: SvgIcon, size: size, color: color, stroke: stroke, hoverColor: hoverColor, hoverStroke: hoverStroke, onClick: onClick, onKeyDown: onKeyDown, tabIndex: tabIndex, role: role }, props)));
267
273
  };
268
274
 
269
- const StyledLink$1 = styled.a `
275
+ const StyledLink$2 = styled.a `
270
276
  ${({ variant = "regular", theme, underline, hoverUnderline, color, hoverColor, fontSize, lineHeight, fontWeight }) => {
271
277
  var _a, _b;
272
278
  const linkStyles = ((_a = theme === null || theme === void 0 ? void 0 : theme.link) === null || _a === void 0 ? void 0 : _a[variant]) || {};
@@ -309,7 +315,7 @@ const Link = (_a) => {
309
315
  console.warn("A Link with an internal href should use the `to` prop instead for client-side routing.");
310
316
  }
311
317
  // Determine what component to render
312
- const Component = to ? Link$1 : as || "a";
318
+ const Component = to ? NavLink : as || "a";
313
319
  const componentProps = to
314
320
  ? { to } // Use react-router-dom's `to` prop
315
321
  : {
@@ -317,7 +323,294 @@ const Link = (_a) => {
317
323
  target,
318
324
  rel: target === "_blank" ? "noopener noreferrer" : undefined
319
325
  };
320
- return (React.createElement(StyledLink$1, Object.assign({ className: classNames("Link-" + variant), variant: "Link-" + variant, as: Component, fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight }, componentProps, props), children));
326
+ return (React.createElement(StyledLink$2, Object.assign({ className: classNames("Link-" + variant), variant: "Link-" + variant, as: Component, fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight }, componentProps, props), children));
327
+ };
328
+
329
+ const WrapperHeader = styled.div `
330
+ display: flex;
331
+ flex-direction: column;
332
+ align-items: center;
333
+ justify-content: center;
334
+ height: 100vh;
335
+ text-align: center;
336
+ gap: 15px;
337
+
338
+ border-radius: 50%;
339
+ position: relative;
340
+
341
+ &::before {
342
+ content: "";
343
+ position: absolute;
344
+ top: -200px;
345
+ left: -200px;
346
+ right: -200px;
347
+ bottom: -200px;
348
+ border-radius: 50%;
349
+ ${({ theme }) => {
350
+ const atomTheme = (theme === null || theme === void 0 ? void 0 : theme.header) || {};
351
+ return css `
352
+ background: radial-gradient(
353
+ circle,
354
+ ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.backgroundColor1) || "none"} 10%,
355
+ ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.backgroundColor2) || "none"} 30%,
356
+ transparent 50%
357
+ );
358
+ `;
359
+ }}
360
+
361
+ z-index: -1;
362
+ }
363
+
364
+ &::before {
365
+ animation: glow 3s infinite alternate ease-in-out;
366
+ }
367
+
368
+ @keyframes glow {
369
+ 0% {
370
+ transform: scale(1);
371
+ opacity: 0.5;
372
+ }
373
+ 100% {
374
+ transform: scale(1.5);
375
+ opacity: 1;
376
+ }
377
+ }
378
+ `;
379
+ const WrapperLineTop = styled.div `
380
+ display: flex;
381
+ align-items: center;
382
+ justify-content: center;
383
+ width: fit-content;
384
+ border-radius: 45px;
385
+ padding-left: 8px;
386
+ padding-right: 8px;
387
+ ${({ theme }) => {
388
+ const atomTheme = (theme === null || theme === void 0 ? void 0 : theme.header) || {};
389
+ return css `
390
+ background-color: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.bannerColor) || "none"};
391
+ `;
392
+ }}
393
+ gap: 5px;
394
+ `;
395
+ const AtomIconTop = styled(Icon).attrs(({ theme }) => {
396
+ var _a, _b;
397
+ return ({
398
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomIconTop) === null || _b === void 0 ? void 0 : _b.variant) || "large"
399
+ });
400
+ }) `
401
+ ${({ theme }) => {
402
+ var _a, _b, _c;
403
+ const atomTheme = ((_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomIconTop) || {};
404
+ return css `
405
+ stroke: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.stroke) || "none"};
406
+ fill: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.fill) || "none"};
407
+ &:hover {
408
+ stroke: ${((_b = atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.hover) === null || _b === void 0 ? void 0 : _b.stroke) || "gold"};
409
+ fill: ${((_c = atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.hover) === null || _c === void 0 ? void 0 : _c.fill) || "gold"};
410
+ }
411
+ `;
412
+ }}
413
+ `;
414
+ const AtomIconDot = styled(Icon).attrs(({ theme }) => {
415
+ var _a, _b, _c, _d;
416
+ return ({
417
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomIconDot) === null || _b === void 0 ? void 0 : _b.variant) || "small",
418
+ size: ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.header) === null || _c === void 0 ? void 0 : _c.atomIconDot) === null || _d === void 0 ? void 0 : _d.size) || "10px"
419
+ });
420
+ }) `
421
+ ${({ theme }) => {
422
+ var _a, _b;
423
+ const atomTheme = ((_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomIconDot) || {};
424
+ return css `
425
+ fill: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.fill) || "none"};
426
+ stroke: ${(atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.stroke) || "none"};
427
+ &:hover {
428
+ stroke: ${((_b = atomTheme === null || atomTheme === void 0 ? void 0 : atomTheme.hover) === null || _b === void 0 ? void 0 : _b.stroke) || "none"};
429
+ }
430
+ `;
431
+ }}
432
+ `;
433
+ const AtomHeading = styled(Heading).attrs(({ theme }) => {
434
+ var _a, _b;
435
+ return ({
436
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomHeading) === null || _b === void 0 ? void 0 : _b.variant) || "h1"
437
+ });
438
+ }) ``;
439
+ const AtomTextTitle = styled(Text).attrs(({ theme }) => {
440
+ var _a, _b;
441
+ return ({
442
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomTextTitle) === null || _b === void 0 ? void 0 : _b.variant) || "medium"
443
+ });
444
+ }) ``;
445
+ const WrapperLineBottom = styled.div `
446
+ display: flex;
447
+ align-items: center;
448
+ justify-content: center;
449
+ width: fit-content;
450
+ gap: 20px;
451
+ `;
452
+ const AtomButtonLeft = styled(Button).attrs(({ theme }) => {
453
+ var _a, _b;
454
+ return ({
455
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomButtonLeft) === null || _b === void 0 ? void 0 : _b.variant) || "primary"
456
+ });
457
+ }) ``;
458
+ const AtomButtonRight = styled(Button).attrs(({ theme }) => {
459
+ var _a, _b;
460
+ return ({
461
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomButtonRight) === null || _b === void 0 ? void 0 : _b.variant) || "secondary"
462
+ });
463
+ }) ``;
464
+ const AtomTextLeft = styled(Text).attrs(({ theme }) => {
465
+ var _a, _b;
466
+ return ({
467
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomTextLeft) === null || _b === void 0 ? void 0 : _b.variant) || "light"
468
+ });
469
+ }) ``;
470
+ const AtomTextRight = styled(Text).attrs(({ theme }) => {
471
+ var _a, _b;
472
+ return ({
473
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomTextRight) === null || _b === void 0 ? void 0 : _b.variant) || "light"
474
+ });
475
+ }) ``;
476
+ const AtomIconLeft = styled(Icon).attrs(({ theme }) => {
477
+ var _a, _b;
478
+ return ({
479
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomIconLeft) === null || _b === void 0 ? void 0 : _b.variant) || "small"
480
+ });
481
+ }) ``;
482
+ const AtomIconRight = styled(Icon).attrs(({ theme }) => {
483
+ var _a, _b;
484
+ return ({
485
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.header) === null || _a === void 0 ? void 0 : _a.atomIconRight) === null || _b === void 0 ? void 0 : _b.variant) || "small"
486
+ });
487
+ }) ``;
488
+
489
+ const Header = ({ iconTop, iconDot, iconLeft, iconRight, textBanner, headingTitle, textTitle, buttonLeftText, buttonLeftClick, buttonRightText, buttonRightClick }) => {
490
+ return (React.createElement(WrapperHeader, null,
491
+ React.createElement("div", null,
492
+ iconTop && React.createElement(AtomIconTop, { svg: iconTop }),
493
+ React.createElement(WrapperLineTop, null,
494
+ iconDot && React.createElement(AtomIconDot, { svg: iconDot }),
495
+ React.createElement(AtomTextTitle, null, textBanner))),
496
+ React.createElement(AtomHeading, null, headingTitle),
497
+ React.createElement("div", null, textTitle &&
498
+ textTitle.map((text, i) => (React.createElement(AtomTextTitle, { key: i }, text)))),
499
+ React.createElement(WrapperLineBottom, null,
500
+ React.createElement(AtomButtonLeft, { onClick: buttonLeftClick },
501
+ iconLeft && React.createElement(AtomIconLeft, { svg: iconLeft }),
502
+ React.createElement(AtomTextLeft, null, buttonLeftText)),
503
+ React.createElement(AtomButtonRight, { onClick: buttonRightClick },
504
+ React.createElement(AtomTextRight, null, buttonRightText),
505
+ iconRight && React.createElement(AtomIconRight, { svg: iconRight })))));
506
+ };
507
+
508
+ const NavBar = styled.nav `
509
+ ${({ theme }) => {
510
+ const navigationTheme = (theme === null || theme === void 0 ? void 0 : theme.navigation) || {};
511
+ return css `
512
+ background: ${navigationTheme.background || "#333"};
513
+ `;
514
+ }}
515
+
516
+ padding: 1rem;
517
+ `;
518
+ const BurgerWrapper = styled.div `
519
+ flex-direction: column;
520
+ align-items: flex-end;
521
+ display: flex;
522
+ padding: 3px;
523
+ ${({ theme }) => theme.media.largeMobileUp} {
524
+ display: none;
525
+ }
526
+ `;
527
+ const BurgerIcon = styled(Icon).attrs(({ theme }) => {
528
+ var _a, _b;
529
+ return ({
530
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.navigation) === null || _a === void 0 ? void 0 : _a.atomIcon) === null || _b === void 0 ? void 0 : _b.variant) || "medium"
531
+ });
532
+ }) `
533
+ ${({ theme }) => {
534
+ var _a, _b, _c, _d, _e, _f, _g;
535
+ const atomLinkTheme = ((_a = theme === null || theme === void 0 ? void 0 : theme.navigation) === null || _a === void 0 ? void 0 : _a.atomIcon) || {};
536
+ return css `
537
+ cursor: pointer;
538
+ color: ${(atomLinkTheme === null || atomLinkTheme === void 0 ? void 0 : atomLinkTheme.color) || "#1a3"};
539
+ &:focus {
540
+ color: ${((_b = atomLinkTheme === null || atomLinkTheme === void 0 ? void 0 : atomLinkTheme.focus) === null || _b === void 0 ? void 0 : _b.color) || "gold"};
541
+ outline: ${((_c = atomLinkTheme === null || atomLinkTheme === void 0 ? void 0 : atomLinkTheme.focus) === null || _c === void 0 ? void 0 : _c.outline) || "none"};
542
+ outline-offset: ${((_d = atomLinkTheme === null || atomLinkTheme === void 0 ? void 0 : atomLinkTheme.focus) === null || _d === void 0 ? void 0 : _d.outlineOffset) ||
543
+ "none"};
544
+ box-shadow: ${((_e = atomLinkTheme === null || atomLinkTheme === void 0 ? void 0 : atomLinkTheme.focus) === null || _e === void 0 ? void 0 : _e.boxShadow) || "none"};
545
+ }
546
+ &:hover {
547
+ color: ${((_f = atomLinkTheme === null || atomLinkTheme === void 0 ? void 0 : atomLinkTheme.hover) === null || _f === void 0 ? void 0 : _f.color) || "purple"};
548
+ transition: ${((_g = atomLinkTheme === null || atomLinkTheme === void 0 ? void 0 : atomLinkTheme.hover) === null || _g === void 0 ? void 0 : _g.color) || "none"};
549
+ }
550
+ `;
551
+ }}
552
+ `;
553
+ const NavLinks = styled.div `
554
+ flex-direction: column;
555
+ text-align: right;
556
+ display: ${({ isOpen }) => (isOpen ? "flex" : "none")};
557
+ width: 100%;
558
+ ${({ theme }) => theme.media.largeMobileUp} {
559
+ display: flex;
560
+ flex-direction: row;
561
+ justify-content: space-around;
562
+ }
563
+ `;
564
+ const StyledLink$1 = styled(Link).attrs(({ theme }) => {
565
+ var _a, _b;
566
+ return ({
567
+ variant: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.navigation) === null || _a === void 0 ? void 0 : _a.atomLink) === null || _b === void 0 ? void 0 : _b.variant) || "bold"
568
+ });
569
+ }) `
570
+ ${({ theme, currentPath }) => {
571
+ var _a, _b, _c, _d, _e, _f, _g, _h;
572
+ const linkTheme = ((_a = theme === null || theme === void 0 ? void 0 : theme.navigation) === null || _a === void 0 ? void 0 : _a.atomLink) || {};
573
+ return css `
574
+ color: ${currentPath
575
+ ? ((_b = linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.currentPath) === null || _b === void 0 ? void 0 : _b.color) || "#1ff"
576
+ : (linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.color) || "#1a3"};
577
+ font-weight: ${currentPath
578
+ ? ((_c = linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.currentPath) === null || _c === void 0 ? void 0 : _c.fontWeight) || "900"
579
+ : (linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.fontWeight) || "700"};
580
+ &:focus {
581
+ color: ${((_d = linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.focus) === null || _d === void 0 ? void 0 : _d.color) || "gold"};
582
+ box-shadow: ${((_e = linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.focus) === null || _e === void 0 ? void 0 : _e.boxShadow) || "none"};
583
+ transform: ${((_f = linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.focus) === null || _f === void 0 ? void 0 : _f.transform) || "none"};
584
+ }
585
+ &:hover {
586
+ color: ${((_g = linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.hover) === null || _g === void 0 ? void 0 : _g.color) || "purple"};
587
+ transition: ${((_h = linkTheme === null || linkTheme === void 0 ? void 0 : linkTheme.hover) === null || _h === void 0 ? void 0 : _h.transition) || "none"};
588
+ }
589
+ `;
590
+ }};
591
+ `;
592
+
593
+ const Navigation = ({ iconBurger, tabs, onTabClick }) => {
594
+ const location = useLocation();
595
+ const currentPath = location.pathname.slice(1);
596
+ const [isOpen, setIsOpen] = useState(false);
597
+ const handleToggle = () => {
598
+ setIsOpen(!isOpen);
599
+ };
600
+ const handleKeyDown = (event) => {
601
+ if (event.key === "Enter" || event.key === " ") {
602
+ handleToggle();
603
+ }
604
+ };
605
+ return (React.createElement(NavBar, null,
606
+ React.createElement(BurgerWrapper, null,
607
+ React.createElement(BurgerIcon, { onClick: handleToggle, onKeyDown: handleKeyDown, tabIndex: 0, role: "button", "aria-pressed": isOpen, svg: iconBurger })),
608
+ React.createElement(NavLinks, { isOpen: isOpen }, tabs.length > 0
609
+ ? tabs.map((tab) => (React.createElement(StyledLink$1, { key: tab.label, to: tab.to, currentPath: tab.label === currentPath, onClick: () => {
610
+ onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(tab.label);
611
+ setIsOpen(false);
612
+ } }, tab.label)))
613
+ : "no tabs available")));
321
614
  };
322
615
 
323
616
  // Wrapper for the footer
@@ -434,5 +727,5 @@ const Footer = ({ children, svg, routes }) => {
434
727
  React.createElement(FooterNav, null, sortedRoutes.map(renderRouteLink))));
435
728
  };
436
729
 
437
- export { Button, Footer, Heading, Icon, Link, Text };
730
+ export { Button, Footer, Header, Heading, Icon, Link, Navigation, Text };
438
731
  //# sourceMappingURL=index.js.map