@anywayseo/tools 4.1.0 → 4.2.1

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 (48) hide show
  1. package/dist/components/base/index.d.ts +0 -1
  2. package/dist/components/base/link-button/index.d.ts +3 -3
  3. package/dist/components/game-demo/content/index.d.ts +1 -0
  4. package/dist/components/game-demo/index.d.ts +1 -0
  5. package/dist/components/game-demo/preview/index.d.ts +5 -4
  6. package/dist/components/index.cjs +1 -2
  7. package/dist/components/index.mjs +1 -2
  8. package/dist/hooks/index.cjs +1 -1
  9. package/dist/hooks/index.mjs +1 -1
  10. package/dist/hooks/use-primary-colors/index.d.ts +1 -0
  11. package/dist/i18n/index.cjs +1 -1
  12. package/dist/i18n/index.mjs +1 -1
  13. package/dist/i18n/resources/de/index.d.ts +2 -0
  14. package/dist/i18n/resources/en/index.d.ts +2 -0
  15. package/dist/i18n/resources/it/index.d.ts +2 -0
  16. package/dist/i18n/resources/ru/index.d.ts +2 -0
  17. package/dist/{index-NsIHOkeN.js → index-BClxYYix.js} +0 -46
  18. package/dist/{index-DoBCANwf.mjs → index-BE9gNdXx.mjs} +15 -7
  19. package/dist/{index-Biz1dDqA.js → index-BPLxhZG_.js} +15 -7
  20. package/dist/index-BV0hDmYP.js +11 -0
  21. package/dist/{index-BxPYJ5OB.js → index-BrOQF5EQ.js} +138 -89
  22. package/dist/{index-BKg1_9Hw.mjs → index-CaIyg0au.mjs} +132 -83
  23. package/dist/{index-DzEvPZny.mjs → index-Ca_M-II5.mjs} +0 -46
  24. package/dist/index-CkTgVjZS.mjs +12 -0
  25. package/dist/{index-Db-ZIQ0A.mjs → index-DPO0aIC3.mjs} +1 -19
  26. package/dist/index-DVcQxWMZ.js +36 -0
  27. package/dist/{index-CpjGjVVj.js → index-DuQjQMNN.js} +1 -19
  28. package/dist/index-MpNfBHkQ.mjs +37 -0
  29. package/dist/index.cjs +19 -19
  30. package/dist/index.mjs +8 -8
  31. package/dist/types/components/bonus-card/index.d.ts +2 -1
  32. package/dist/types/components/button/index.d.ts +6 -0
  33. package/dist/types/components/common/index.d.ts +12 -0
  34. package/dist/types/components/game-card/index.d.ts +3 -2
  35. package/dist/types/components/index.d.ts +2 -0
  36. package/dist/types/components/link/index.d.ts +5 -0
  37. package/dist/types/content/index.d.ts +0 -1
  38. package/dist/types/site/index.d.ts +4 -0
  39. package/dist/utils/animation/index.d.ts +2 -8
  40. package/dist/utils/index.cjs +16 -15
  41. package/dist/utils/index.mjs +5 -4
  42. package/dist/utils/theme/index.d.ts +2 -3
  43. package/package.json +1 -1
  44. package/dist/components/base/pulse-button/index.d.ts +0 -15
  45. package/dist/components/base/pulse-button/utils.d.ts +0 -4
  46. package/dist/index-IpSV-c71.js +0 -8
  47. package/dist/index-xuSxvz5z.mjs +0 -9
  48. package/dist/types/content/link/index.d.ts +0 -4
@@ -1,15 +1,15 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { Box, Collapse, Text, Button, Flex, Stack, Image, Center as Center$1, SimpleGrid, Link, Card, CardHeader, Heading, CardBody, Popover, PopoverTrigger, Portal, PopoverContent, PopoverBody, CardFooter, useToast, useColorModeValue, VStack, FormControl, FormLabel, InputGroup, InputLeftElement, Input, Textarea, Accordion, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, LinkBox, LinkOverlay, IconButton, AbsoluteCenter, Spinner, useDisclosure, Divider, Circle, Container as Container$1, List as List$1, ListItem, Icon, ListIcon, TableContainer, Table as Table$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, TabPanels, TabPanel } from "@chakra-ui/react";
2
+ import { Box, Collapse, Text, Button, Flex, Stack, Image, Center as Center$1, SimpleGrid, Link as Link$1, Card, CardHeader, Heading, CardBody, Popover, PopoverTrigger, Portal, PopoverContent, PopoverBody, CardFooter, useToast, useColorModeValue, VStack, FormControl, FormLabel, InputGroup, InputLeftElement, Input, Textarea, Accordion, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, LinkBox, LinkOverlay, IconButton, AbsoluteCenter, Spinner, useDisclosure, Divider, Circle, Container as Container$1, List as List$1, ListItem, Icon, ListIcon, TableContainer, Table as Table$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, TabPanels, TabPanel } from "@chakra-ui/react";
3
3
  import { useTranslation } from "react-i18next";
4
- import { A as Animation, e as getSeededRandomComparator, d as randomComparator, b as formatNumber, c as getCurrencySymbol, f as formatDate, g as getCurrentYear, a as getCurrentMonth } from "./index-Db-ZIQ0A.mjs";
5
- import { a as GameCharacteristic } from "./index-DoBCANwf.mjs";
6
- import "@ctrl/tinycolor";
7
- import { useRef, useState, useLayoutEffect, Fragment as Fragment$1, forwardRef, useEffect, useMemo } from "react";
8
- import { EmailIcon, StarIcon, CloseIcon, ExternalLinkIcon, ChevronRightIcon, ChevronDownIcon, HamburgerIcon, ChevronUpIcon, WarningIcon, CheckCircleIcon } from "@chakra-ui/icons";
4
+ import { Link } from "gatsby";
5
+ import { A as Animation } from "./index-MpNfBHkQ.mjs";
6
+ import { a as GameCharacteristic } from "./index-BE9gNdXx.mjs";
9
7
  import { useMDXComponents } from "@mdx-js/react";
10
- import { Link as Link$1 } from "gatsby";
11
8
  import { u as useSiteContext } from "./index-BNb-P8a6.mjs";
12
- import { u as usePrimaryColors } from "./index-xuSxvz5z.mjs";
9
+ import { useRef, useState, useLayoutEffect, Fragment as Fragment$1, forwardRef, useEffect, useMemo } from "react";
10
+ import { EmailIcon, StarIcon, CloseIcon, ViewOffIcon, ViewIcon, ChevronRightIcon, ChevronDownIcon, HamburgerIcon, ChevronUpIcon, WarningIcon, CheckCircleIcon } from "@chakra-ui/icons";
11
+ import { e as getSeededRandomComparator, d as randomComparator, b as formatNumber, c as getCurrencySymbol, f as formatDate, g as getCurrentYear, a as getCurrentMonth } from "./index-DPO0aIC3.mjs";
12
+ import { u as usePrimaryColors } from "./index-CkTgVjZS.mjs";
13
13
  import { t } from "i18next";
14
14
  import Markdown from "react-markdown";
15
15
  const ONE_LINE_HEIGHT = 24;
@@ -67,36 +67,44 @@ const defaultColumns = { base: 1, sm: 2, md: 3, lg: 4, xl: 5 };
67
67
  const Grid = ({ items, columns = defaultColumns, gap, render, getKey, ...boxProps }) => {
68
68
  return /* @__PURE__ */ jsx(SimpleGrid, { as: "ul", columns, spacing: gap, p: 0, m: 0, listStyleType: "none", ...boxProps, children: items.map((item, index) => /* @__PURE__ */ jsx(Box, { as: "li", children: render(item) }, getKey ? getKey(item) : index)) });
69
69
  };
70
- const LinkButton = ({ label, url, width = "auto", ...boxProps }) => {
70
+ const LinkButton = ({
71
+ label,
72
+ href,
73
+ linkType = "redirect",
74
+ size = "auto",
75
+ width = "auto",
76
+ textTransform,
77
+ textDecoration,
78
+ animation,
79
+ onClick,
80
+ ...boxProps
81
+ }) => {
82
+ var _a;
83
+ const { configs } = useSiteContext();
84
+ const { color, invertedColor } = usePrimaryColors();
85
+ const isInvertedColor = (_a = configs == null ? void 0 : configs.theme) == null ? void 0 : _a.isInvertedColor;
86
+ const isInternalLink = linkType === "redirect" || (href == null ? void 0 : href.startsWith("/"));
87
+ const LinkComponent = isInternalLink ? Link : Link$1;
88
+ const hrefKey = isInternalLink ? "to" : "href";
89
+ const hrefValue = linkType === "redirect" ? `/follow?to=${href}` : href;
71
90
  return /* @__PURE__ */ jsx(
72
91
  Button,
73
92
  {
74
- as: Link,
75
- href: url,
76
93
  w: width,
77
- bg: "brand.600",
78
- textTransform: "uppercase",
79
- _hover: { textDecoration: "none", bg: "brand.300" },
94
+ size: size === "auto" ? { base: "sm", md: "lg" } : size,
95
+ bg: "brand.500",
96
+ color: isInvertedColor ? invertedColor : color,
97
+ animation: animation ? Animation[animation.type](animation.params) : void 0,
98
+ textTransform,
99
+ _hover: { textDecoration, bg: "brand.200" },
80
100
  _active: { transform: "scale(0.95)" },
101
+ onClick,
81
102
  ...boxProps,
82
- children: label
83
- }
84
- );
85
- };
86
- const ColorMap = {
87
- light: "gray.200",
88
- dark: "gray.700"
89
- };
90
- const PulseButton = ({ label, colorScheme = "light", to, onClick }) => {
91
- return /* @__PURE__ */ jsx(
92
- Button,
93
- {
94
- size: { base: "sm", md: "lg" },
95
- color: ColorMap[colorScheme],
96
- bgColor: "brand.500",
97
- animation: `${Animation.pulse} 2s infinite linear`,
98
- _hover: { bgColor: "brand.200", color: "gray.700" },
99
- ...to ? { as: Link, href: to } : { onClick },
103
+ ...href ? {
104
+ as: LinkComponent,
105
+ [hrefKey]: hrefValue,
106
+ rel: "nofollow"
107
+ } : {},
100
108
  children: label
101
109
  }
102
110
  );
@@ -180,7 +188,7 @@ const BonusCard = ({
180
188
  /* @__PURE__ */ jsx(Text, { fontSize: "2xl", fontWeight: "bold", my: 2, children: subtitle }),
181
189
  /* @__PURE__ */ jsx(BonusCardContent, { content, buttonColor: textColor })
182
190
  ] }),
183
- /* @__PURE__ */ jsx(CardFooter, { as: "footer", p: 4, children: /* @__PURE__ */ jsx(LinkButton, { ...link, width: "full" }) })
191
+ /* @__PURE__ */ jsx(CardFooter, { as: "footer", p: 4, children: /* @__PURE__ */ jsx(LinkButton, { ...link, width: "full", size: "md", textDecoration: "none" }) })
184
192
  ]
185
193
  }
186
194
  );
@@ -274,10 +282,10 @@ const ContactForm = ({ ...boxProps }) => {
274
282
  );
275
283
  };
276
284
  const Faq = ({ items, ...boxProps }) => {
277
- const { bgColor, color } = usePrimaryColors();
285
+ const { bgColor, invertedColor } = usePrimaryColors();
278
286
  return /* @__PURE__ */ jsx(Accordion, { allowToggle: true, ...boxProps, children: items.map(({ question, answer }) => {
279
287
  return /* @__PURE__ */ jsxs(AccordionItem, { border: 0, children: [
280
- /* @__PURE__ */ jsx(Box, { as: "h3", children: /* @__PURE__ */ jsxs(AccordionButton, { _hover: { color, bgColor }, children: [
288
+ /* @__PURE__ */ jsx(Box, { as: "h3", children: /* @__PURE__ */ jsxs(AccordionButton, { _hover: { color: invertedColor, bgColor }, children: [
281
289
  /* @__PURE__ */ jsx(Box, { as: "span", flex: "1", textAlign: "left", fontWeight: "bold", children: question }),
282
290
  /* @__PURE__ */ jsx(AccordionIcon, {})
283
291
  ] }) }),
@@ -313,7 +321,7 @@ const FeatureCardGrid = ({
313
321
  }
314
322
  );
315
323
  };
316
- const GameCard = ({ name, description, image, link, height = "auto" }) => {
324
+ const GameCard = ({ name, description, image, href, height = "auto" }) => {
317
325
  return /* @__PURE__ */ jsxs(
318
326
  LinkBox,
319
327
  {
@@ -321,15 +329,15 @@ const GameCard = ({ name, description, image, link, height = "auto" }) => {
321
329
  rounded: "md",
322
330
  borderWidth: 1,
323
331
  transition: "transform 0.2s ease",
324
- cursor: link ? "pointer" : "default",
332
+ cursor: href ? "pointer" : "default",
325
333
  overflow: "hidden",
326
334
  bg: "blackAlpha.200",
327
335
  height,
328
- _hover: { transform: "scale(1.1)" },
336
+ _hover: { transform: "scale(1.05)" },
329
337
  children: [
330
338
  typeof image === "string" ? /* @__PURE__ */ jsx(Image, { src: image, alt: name, w: "100%", aspectRatio: "16/9", objectFit: "cover", objectPosition: "center" }) : !!image && /* @__PURE__ */ jsx(Box, { w: "100%", aspectRatio: "16/9", children: image }),
331
339
  /* @__PURE__ */ jsxs(Box, { as: "section", rounded: "md", p: 4, children: [
332
- /* @__PURE__ */ jsx(Text, { as: "span", children: link ? /* @__PURE__ */ jsx(LinkOverlay, { href: link, children: name }) : name }),
340
+ /* @__PURE__ */ jsx(Text, { as: "span", children: href ? /* @__PURE__ */ jsx(LinkOverlay, { href, children: name }) : name }),
333
341
  !!description && /* @__PURE__ */ jsx(Text, { fontSize: "sm", color: "gray.600", children: description })
334
342
  ] })
335
343
  ]
@@ -338,7 +346,7 @@ const GameCard = ({ name, description, image, link, height = "auto" }) => {
338
346
  };
339
347
  const GameCardGrid = ({
340
348
  items,
341
- columns = { base: 1, md: 2, lg: 3 },
349
+ columns = { base: 1, sm: 2, md: 3, lg: 4 },
342
350
  gap = 4,
343
351
  cardHeight = "full",
344
352
  order = "default",
@@ -360,7 +368,14 @@ const GameCardGrid = ({
360
368
  }
361
369
  );
362
370
  };
363
- const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscreen }) => {
371
+ const GameDemoContent = ({
372
+ src,
373
+ isFullscreen,
374
+ isLoaded,
375
+ onLoad,
376
+ onExit,
377
+ onToggleFullscreen
378
+ }) => {
364
379
  const { t: t2 } = useTranslation("gameDemo");
365
380
  return /* @__PURE__ */ jsxs(Fragment, { children: [
366
381
  /* @__PURE__ */ jsx(
@@ -377,50 +392,74 @@ const GameDemoContent = ({ src, isFullscreen, isLoaded, onLoad, onToggleFullscre
377
392
  children: /* @__PURE__ */ jsx("p", { children: t2("warning") })
378
393
  }
379
394
  ),
380
- /* @__PURE__ */ jsx(
381
- IconButton,
382
- {
383
- icon: isFullscreen ? /* @__PURE__ */ jsx(CloseIcon, { w: 3, h: 3 }) : /* @__PURE__ */ jsx(ExternalLinkIcon, { w: 4, h: 4 }),
384
- size: "sm",
385
- variant: "outline",
386
- title: t2(isFullscreen ? "action.deactivateFullscreen" : "action.activateFullscreen"),
387
- "aria-label": "Fullscreen mode Toggle",
388
- isRound: true,
389
- disabled: !isLoaded,
390
- position: "absolute",
391
- top: 2,
392
- left: 2,
393
- border: "none",
394
- color: "white",
395
- _hover: { bgColor: "whiteAlpha.400" },
396
- onClick: onToggleFullscreen
397
- }
398
- ),
395
+ /* @__PURE__ */ jsxs(Flex, { position: "absolute", top: 2, left: 2, gap: 2, children: [
396
+ /* @__PURE__ */ jsx(
397
+ IconButton,
398
+ {
399
+ icon: /* @__PURE__ */ jsx(CloseIcon, { w: 3, h: 3 }),
400
+ title: t2("action.exit"),
401
+ "aria-label": t2("action.exit"),
402
+ size: "sm",
403
+ color: "white",
404
+ variant: "ghost",
405
+ disabled: !isLoaded,
406
+ isRound: true,
407
+ onClick: onExit
408
+ }
409
+ ),
410
+ /* @__PURE__ */ jsx(
411
+ IconButton,
412
+ {
413
+ icon: isFullscreen ? /* @__PURE__ */ jsx(ViewOffIcon, { w: 3, h: 3 }) : /* @__PURE__ */ jsx(ViewIcon, { w: 4, h: 4 }),
414
+ title: t2(isFullscreen ? "action.deactivateFullscreen" : "action.activateFullscreen"),
415
+ "aria-label": t2(isFullscreen ? "action.deactivateFullscreen" : "action.activateFullscreen"),
416
+ size: "sm",
417
+ color: "white",
418
+ variant: "ghost",
419
+ disabled: !isLoaded,
420
+ isRound: true,
421
+ onClick: onToggleFullscreen
422
+ }
423
+ )
424
+ ] }),
399
425
  /* @__PURE__ */ jsx(AbsoluteCenter, { children: /* @__PURE__ */ jsx(Spinner, { size: "xl", thickness: "0.6rem", display: isLoaded ? "none" : "block", color: "brand.100" }) })
400
426
  ] });
401
427
  };
402
- const GameDemoPreview = ({ image, alt, imageFit = "contain", onPlay }) => {
428
+ const GameDemoPreview = ({ image, alt, href, imageFit = "contain", onPlayDemo }) => {
403
429
  const { t: t2 } = useTranslation("gameDemo");
404
- const imageComponent = typeof image === "string" ? /* @__PURE__ */ jsx(Image, { src: image, alt, objectFit: imageFit }) : image;
430
+ const imageComponent = typeof image === "string" ? /* @__PURE__ */ jsx(Image, { src: image, alt, objectFit: imageFit, w: "100%", h: "100%" }) : image;
405
431
  return /* @__PURE__ */ jsxs(Fragment, { children: [
406
432
  imageComponent,
407
- /* @__PURE__ */ jsx(AbsoluteCenter, { children: /* @__PURE__ */ jsx(PulseButton, { label: t2("action.playForFree"), onClick: onPlay }) })
433
+ /* @__PURE__ */ jsx(AbsoluteCenter, { children: /* @__PURE__ */ jsxs(Stack, { spacing: 4, children: [
434
+ /* @__PURE__ */ jsx(
435
+ LinkButton,
436
+ {
437
+ animation: { type: "pulse", params: { duration: 2, timingFunction: "ease-out", isInfinite: true } },
438
+ ...href ? { label: t2("action.playForReal"), href } : { label: t2("action.playForFree"), onClick: onPlayDemo }
439
+ }
440
+ ),
441
+ !!href && /* @__PURE__ */ jsx(Button, { variant: "outline", colorScheme: "brand", size: { base: "sm", md: "md" }, onClick: onPlayDemo, children: t2("action.playForFree") })
442
+ ] }) })
408
443
  ] });
409
444
  };
410
- const GameDemo = ({ name, src, previewImage, previewImageFit, ...boxProps }) => {
445
+ const GameDemo = ({ name, src, href, previewImage, previewImageFit, ...boxProps }) => {
411
446
  const [isRunning, setIsRunning] = useState(false);
412
447
  const [isLoaded, setIsLoaded] = useState(false);
413
- const { isOpen: isFullscreen, onToggle } = useDisclosure({ defaultIsOpen: false });
414
- function handlePlay() {
415
- setIsRunning(true);
416
- }
417
- function onLoad() {
448
+ const { isOpen: isFullscreen, onToggle, onClose } = useDisclosure({ defaultIsOpen: false });
449
+ function handleLoad() {
418
450
  setIsLoaded(true);
419
451
  }
452
+ function handleExit() {
453
+ onClose();
454
+ setIsRunning(false);
455
+ }
420
456
  function handleToggleFullscreen() {
421
457
  document.body.style.overflowY = isFullscreen ? "auto" : "hidden";
422
458
  onToggle();
423
459
  }
460
+ function handlePlayDemo() {
461
+ setIsRunning(true);
462
+ }
424
463
  return /* @__PURE__ */ jsx(
425
464
  Box,
426
465
  {
@@ -436,10 +475,20 @@ const GameDemo = ({ name, src, previewImage, previewImageFit, ...boxProps }) =>
436
475
  src,
437
476
  isFullscreen,
438
477
  isLoaded,
439
- onLoad,
478
+ onLoad: handleLoad,
479
+ onExit: handleExit,
440
480
  onToggleFullscreen: handleToggleFullscreen
441
481
  }
442
- ) : /* @__PURE__ */ jsx(GameDemoPreview, { image: previewImage, alt: name, imageFit: previewImageFit, onPlay: handlePlay })
482
+ ) : /* @__PURE__ */ jsx(
483
+ GameDemoPreview,
484
+ {
485
+ image: previewImage,
486
+ alt: name,
487
+ href,
488
+ imageFit: previewImageFit,
489
+ onPlayDemo: handlePlayDemo
490
+ }
491
+ )
443
492
  }
444
493
  );
445
494
  };
@@ -532,9 +581,9 @@ const GameInfo = ({ info }) => {
532
581
  );
533
582
  };
534
583
  const HowTo = ({ steps, ...boxProps }) => {
535
- const { color, bgColor } = usePrimaryColors();
584
+ const { bgColor, invertedColor } = usePrimaryColors();
536
585
  return /* @__PURE__ */ jsx(SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description, thumbnail }, index) => /* @__PURE__ */ jsxs(Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
537
- /* @__PURE__ */ jsx(Circle, { size: 12, bgColor, color, fontSize: "lg", fontWeight: "bold", children: String(index + 1) }),
586
+ /* @__PURE__ */ jsx(Circle, { size: 12, bgColor, color: invertedColor, fontSize: "lg", fontWeight: "bold", children: String(index + 1) }),
538
587
  /* @__PURE__ */ jsxs(Stack, { flex: 1, children: [
539
588
  /* @__PURE__ */ jsx(Text, { fontSize: "lg", fontWeight: "bold", children: title }),
540
589
  typeof thumbnail === "string" ? /* @__PURE__ */ jsx(Image, { src: thumbnail, alt: title, aspectRatio: "16/9", objectFit: "cover" }) : thumbnail,
@@ -556,7 +605,7 @@ const Logo = () => {
556
605
  const Brand$1 = ({ brand }) => {
557
606
  return /* @__PURE__ */ jsxs(Box, { position: "relative", my: 2, py: 8, children: [
558
607
  /* @__PURE__ */ jsx(Divider, {}),
559
- /* @__PURE__ */ jsx(AbsoluteCenter, { display: "flex", bgColor: useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsx(Link$1, { to: "/", children: brand }) })
608
+ /* @__PURE__ */ jsx(AbsoluteCenter, { display: "flex", bgColor: useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsx(Link, { to: "/", children: brand }) })
560
609
  ] });
561
610
  };
562
611
  const Copyright = () => {
@@ -592,7 +641,7 @@ const Navigation$1 = ({ menu }) => {
592
641
  children: menu.map(({ path, label }, index) => /* @__PURE__ */ jsx(Flex, { as: "li", children: /* @__PURE__ */ jsx(
593
642
  Text,
594
643
  {
595
- as: Link$1,
644
+ as: Link,
596
645
  to: path,
597
646
  fontSize: "md",
598
647
  fontWeight: "semibold",
@@ -631,14 +680,14 @@ const Footer = () => {
631
680
  );
632
681
  };
633
682
  const Brand = ({ brand }) => {
634
- return /* @__PURE__ */ jsx(Link$1, { to: "/", children: brand });
683
+ return /* @__PURE__ */ jsx(Link, { to: "/", children: brand });
635
684
  };
636
685
  const NavLink = forwardRef(({ path, label }, ref) => {
637
686
  return /* @__PURE__ */ jsx(
638
687
  Text,
639
688
  {
640
689
  ref,
641
- as: Link$1,
690
+ as: Link,
642
691
  to: path,
643
692
  p: 2,
644
693
  fontWeight: "semibold",
@@ -663,7 +712,7 @@ const NavList$1 = ({ path, label, children }) => {
663
712
  children: label
664
713
  }
665
714
  ) }),
666
- /* @__PURE__ */ jsx(PopoverContent, { p: 2, border: 0, minW: "sm", rounded: "xl", boxShadow: "xl", bg: background, children: /* @__PURE__ */ jsx(List$1, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child, index) => /* @__PURE__ */ jsx(ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxs(Flex, { as: Link$1, to: `${path}${child.path}`, p: 2, role: "group", children: [
715
+ /* @__PURE__ */ jsx(PopoverContent, { p: 2, border: 0, minW: "sm", rounded: "xl", boxShadow: "xl", bg: background, children: /* @__PURE__ */ jsx(List$1, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child, index) => /* @__PURE__ */ jsx(ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxs(Flex, { as: Link, to: `${path}${child.path}`, p: 2, role: "group", children: [
667
716
  /* @__PURE__ */ jsx(Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
668
717
  /* @__PURE__ */ jsx(
669
718
  Flex,
@@ -714,7 +763,7 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
714
763
  ]
715
764
  }
716
765
  ),
717
- /* @__PURE__ */ jsx(Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsx(List$1, { ml: 2, pl: 0, borderLeft: 1, borderStyle: "solid", borderColor: useColorModeValue("gray.200", "gray.700"), children: children == null ? void 0 : children.map((child, index) => /* @__PURE__ */ jsx(Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsx(Text, { as: Link$1, to: `${path}${child.path}`, p: 2, fontSize: "sm", children: child.label }) }, index)) }) })
766
+ /* @__PURE__ */ jsx(Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsx(List$1, { ml: 2, pl: 0, borderLeft: 1, borderStyle: "solid", borderColor: useColorModeValue("gray.200", "gray.700"), children: children == null ? void 0 : children.map((child, index) => /* @__PURE__ */ jsx(Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsx(Text, { as: Link, to: `${path}${child.path}`, p: 2, fontSize: "sm", children: child.label }) }, index)) }) })
718
767
  ] });
719
768
  };
720
769
  const CLOSE_ICON_SIZE = "0.75rem";
@@ -817,7 +866,7 @@ const Hero = ({ title, subtitle, content, link, image }) => {
817
866
  /* @__PURE__ */ jsx(Text, { as: "span", display: "block", color: "brand.400", children: subtitle })
818
867
  ] }),
819
868
  /* @__PURE__ */ jsx(Text, { fontSize: { base: "md", lg: "lg" }, color: "gray.500", children: content }),
820
- !!link && /* @__PURE__ */ jsx(Flex, { direction: { base: "column", md: "row" }, children: /* @__PURE__ */ jsx(LinkButton, { ...link }) })
869
+ !!link && /* @__PURE__ */ jsx(Flex, { direction: { base: "column", md: "row" }, children: /* @__PURE__ */ jsx(LinkButton, { ...link, size: "md", textDecoration: "none" }) })
821
870
  ] }) }),
822
871
  image && /* @__PURE__ */ jsx(Flex, { display: { base: "none", md: "flex" }, flex: 1, children: image })
823
872
  ] }) }) });
@@ -900,7 +949,7 @@ const NotFound = () => {
900
949
  /* @__PURE__ */ jsxs(Text, { fontSize: "xl", children: [
901
950
  t2("description"),
902
951
  " ",
903
- /* @__PURE__ */ jsx(Button, { as: Link$1, to: "/", variant: "link", colorScheme: "brand", fontSize: "xl", children: t2("action") })
952
+ /* @__PURE__ */ jsx(Button, { as: Link, to: "/", variant: "link", colorScheme: "brand", fontSize: "xl", children: t2("action") })
904
953
  ] })
905
954
  ] });
906
955
  };
@@ -1075,6 +1124,7 @@ const StrapiComponent = ({ type, props, imageComponent }) => {
1075
1124
  {
1076
1125
  name: props.name,
1077
1126
  src: props.src,
1127
+ href: props.href,
1078
1128
  previewImage: /* @__PURE__ */ jsx(ExternalImage, { image: props.previewImage, alt: props.name, component: imageComponent }),
1079
1129
  mb: 4
1080
1130
  }
@@ -1198,6 +1248,5 @@ export {
1198
1248
  Author as k,
1199
1249
  Center as l,
1200
1250
  Grid as m,
1201
- LinkButton as n,
1202
- PulseButton as o
1251
+ LinkButton as n
1203
1252
  };
@@ -1,4 +1,3 @@
1
- import { TinyColor } from "@ctrl/tinycolor";
2
1
  const DUMMY_PAGE_TYPE = "DUMMY";
3
2
  function isValidPath(value) {
4
3
  return typeof value === "string" && (value === "" || value.startsWith("/"));
@@ -37,51 +36,6 @@ function transformSiteNavigation(strapiNavigation) {
37
36
  footer: transformNavItems(footerNav == null ? void 0 : footerNav.items)
38
37
  };
39
38
  }
40
- const DEFAULT_THEME = "system";
41
- const DEFAULT_COLOR = "#333333";
42
- const DefaultColorShadeMap = {
43
- 50: 52,
44
- 100: 40,
45
- 200: 30,
46
- 300: 20,
47
- 400: 10,
48
- 600: 10,
49
- 700: 20,
50
- 800: 30,
51
- 900: 40
52
- };
53
- function extractTheme(value, defaultTheme = DEFAULT_THEME) {
54
- let theme = defaultTheme;
55
- if (value) {
56
- const themes = ["dark", "light", "system"];
57
- const probablyTheme = value;
58
- if (themes.includes(probablyTheme)) {
59
- theme = probablyTheme;
60
- }
61
- }
62
- return theme;
63
- }
64
- function generateColorPalette(value, defaultColor = DEFAULT_COLOR, colorShadeMap = DefaultColorShadeMap) {
65
- let baseColor = defaultColor;
66
- if (value && typeof value === "string") {
67
- baseColor = value;
68
- }
69
- const color = new TinyColor(baseColor);
70
- return {
71
- 50: color.lighten(colorShadeMap[50]).toHexString(),
72
- 100: color.lighten(colorShadeMap[100]).toHexString(),
73
- 200: color.lighten(colorShadeMap[200]).toHexString(),
74
- 300: color.lighten(colorShadeMap[300]).toHexString(),
75
- 400: color.lighten(colorShadeMap[400]).toHexString(),
76
- 500: color.toHexString(),
77
- 600: color.darken(colorShadeMap[600]).toHexString(),
78
- 700: color.darken(colorShadeMap[700]).toHexString(),
79
- 800: color.darken(colorShadeMap[800]).toHexString(),
80
- 900: color.darken(colorShadeMap[900]).toHexString()
81
- };
82
- }
83
39
  export {
84
- extractTheme as e,
85
- generateColorPalette as g,
86
40
  transformSiteNavigation as t
87
41
  };
@@ -0,0 +1,12 @@
1
+ import { useColorModeValue } from "@chakra-ui/react";
2
+ import { L as LIGHT_THEME_COLOR, D as DARK_THEME_COLOR } from "./index-MpNfBHkQ.mjs";
3
+ import "./index-BE9gNdXx.mjs";
4
+ function usePrimaryColors() {
5
+ const color = useColorModeValue(LIGHT_THEME_COLOR, DARK_THEME_COLOR);
6
+ const bgColor = useColorModeValue("brand.500", "brand.200");
7
+ const invertedColor = useColorModeValue(DARK_THEME_COLOR, LIGHT_THEME_COLOR);
8
+ return { color, bgColor, invertedColor };
9
+ }
10
+ export {
11
+ usePrimaryColors as u
12
+ };
@@ -1,22 +1,5 @@
1
- import { keyframes } from "@emotion/react";
2
- import "./index-DoBCANwf.mjs";
1
+ import "./index-BE9gNdXx.mjs";
3
2
  import i18n from "i18next";
4
- const pulse = keyframes`
5
- 0% {
6
- box-shadow: 0 0 0 0 var(--chakra-colors-brand-100);
7
- }
8
-
9
- 50% {
10
- box-shadow: 0 0 0 0.8rem rgba(0, 0, 0, 0);
11
- }
12
-
13
- 100% {
14
- box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
15
- }
16
- `;
17
- const Animation = {
18
- pulse
19
- };
20
3
  function getCurrentYear() {
21
4
  const locale = i18n.language;
22
5
  const currentDate = /* @__PURE__ */ new Date();
@@ -102,7 +85,6 @@ function getSeededRandomComparator(seed) {
102
85
  return () => seededRandom(safeSeed + index++) - 0.5;
103
86
  }
104
87
  export {
105
- Animation as A,
106
88
  getCurrentMonth as a,
107
89
  formatNumber as b,
108
90
  getCurrencySymbol as c,
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ const react = require("@emotion/react");
3
+ const pulse = react.keyframes`
4
+ 0% {
5
+ box-shadow: 0 0 0 0 var(--chakra-colors-brand-100);
6
+ }
7
+
8
+ 50% {
9
+ box-shadow: 0 0 0 0.8rem rgba(0, 0, 0, 0);
10
+ }
11
+
12
+ 100% {
13
+ box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
14
+ }
15
+ `;
16
+ const defaultAnimationParams = {
17
+ duration: 1,
18
+ timingFunction: "linear",
19
+ isInfinite: false
20
+ };
21
+ function animation(keyframes2) {
22
+ return (params) => {
23
+ const duration = (params == null ? void 0 : params.duration) || defaultAnimationParams.duration;
24
+ const timingFunction = (params == null ? void 0 : params.timingFunction) || defaultAnimationParams.timingFunction;
25
+ const isInfinite = (params == null ? void 0 : params.isInfinite) || defaultAnimationParams.isInfinite;
26
+ return `${keyframes2} ${duration}s ${timingFunction} ${isInfinite ? "infinite" : ""}`.trim();
27
+ };
28
+ }
29
+ const Animation = {
30
+ pulse: animation(pulse)
31
+ };
32
+ const DARK_THEME_COLOR = "white";
33
+ const LIGHT_THEME_COLOR = "gray.800";
34
+ exports.Animation = Animation;
35
+ exports.DARK_THEME_COLOR = DARK_THEME_COLOR;
36
+ exports.LIGHT_THEME_COLOR = LIGHT_THEME_COLOR;
@@ -1,23 +1,6 @@
1
1
  "use strict";
2
- const react = require("@emotion/react");
3
- require("./index-Biz1dDqA.js");
2
+ require("./index-BPLxhZG_.js");
4
3
  const i18n = require("i18next");
5
- const pulse = react.keyframes`
6
- 0% {
7
- box-shadow: 0 0 0 0 var(--chakra-colors-brand-100);
8
- }
9
-
10
- 50% {
11
- box-shadow: 0 0 0 0.8rem rgba(0, 0, 0, 0);
12
- }
13
-
14
- 100% {
15
- box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
16
- }
17
- `;
18
- const Animation = {
19
- pulse
20
- };
21
4
  function getCurrentYear() {
22
5
  const locale = i18n.language;
23
6
  const currentDate = /* @__PURE__ */ new Date();
@@ -102,7 +85,6 @@ function getSeededRandomComparator(seed) {
102
85
  let index = 0;
103
86
  return () => seededRandom(safeSeed + index++) - 0.5;
104
87
  }
105
- exports.Animation = Animation;
106
88
  exports.formatDate = formatDate;
107
89
  exports.formatNumber = formatNumber;
108
90
  exports.getCurrencySymbol = getCurrencySymbol;
@@ -0,0 +1,37 @@
1
+ import { keyframes } from "@emotion/react";
2
+ const pulse = keyframes`
3
+ 0% {
4
+ box-shadow: 0 0 0 0 var(--chakra-colors-brand-100);
5
+ }
6
+
7
+ 50% {
8
+ box-shadow: 0 0 0 0.8rem rgba(0, 0, 0, 0);
9
+ }
10
+
11
+ 100% {
12
+ box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
13
+ }
14
+ `;
15
+ const defaultAnimationParams = {
16
+ duration: 1,
17
+ timingFunction: "linear",
18
+ isInfinite: false
19
+ };
20
+ function animation(keyframes2) {
21
+ return (params) => {
22
+ const duration = (params == null ? void 0 : params.duration) || defaultAnimationParams.duration;
23
+ const timingFunction = (params == null ? void 0 : params.timingFunction) || defaultAnimationParams.timingFunction;
24
+ const isInfinite = (params == null ? void 0 : params.isInfinite) || defaultAnimationParams.isInfinite;
25
+ return `${keyframes2} ${duration}s ${timingFunction} ${isInfinite ? "infinite" : ""}`.trim();
26
+ };
27
+ }
28
+ const Animation = {
29
+ pulse: animation(pulse)
30
+ };
31
+ const DARK_THEME_COLOR = "white";
32
+ const LIGHT_THEME_COLOR = "gray.800";
33
+ export {
34
+ Animation as A,
35
+ DARK_THEME_COLOR as D,
36
+ LIGHT_THEME_COLOR as L
37
+ };
package/dist/index.cjs CHANGED
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-BxPYJ5OB.js");
4
- const index$1 = require("./index-IpSV-c71.js");
5
- const i18n$1 = require("./index-Biz1dDqA.js");
3
+ const index = require("./index-BrOQF5EQ.js");
4
+ const index$1 = require("./index-BV0hDmYP.js");
5
+ const i18n$1 = require("./index-BPLxhZG_.js");
6
6
  const index$2 = require("./index-DF_u_tzx.js");
7
7
  const index$3 = require("./index-BhsXlbd8.js");
8
- const index$4 = require("./index-CpjGjVVj.js");
9
- const index$5 = require("./index-NsIHOkeN.js");
8
+ const index$4 = require("./index-DVcQxWMZ.js");
9
+ const index$5 = require("./index-DuQjQMNN.js");
10
+ const index$6 = require("./index-BClxYYix.js");
10
11
  const i18n = require("i18next");
11
12
  exports.Author = index.Author;
12
13
  exports.AuthorCard = index.AuthorCard;
@@ -28,7 +29,6 @@ exports.LinkButton = index.LinkButton;
28
29
  exports.List = index.List;
29
30
  exports.NotFound = index.NotFound;
30
31
  exports.ProsCons = index.ProsCons;
31
- exports.PulseButton = index.PulseButton;
32
32
  exports.Seo = index.Seo;
33
33
  exports.StrapiContentRenderer = index.StrapiContentRenderer;
34
34
  exports.Table = index.Table;
@@ -42,17 +42,17 @@ exports.MdxProvider = index$2.MdxProvider;
42
42
  exports.SiteProvider = index$3.SiteProvider;
43
43
  exports.useSiteContext = index$3.useSiteContext;
44
44
  exports.Animation = index$4.Animation;
45
- exports.formatDate = index$4.formatDate;
46
- exports.formatNumber = index$4.formatNumber;
47
- exports.getCurrencySymbol = index$4.getCurrencySymbol;
48
- exports.getCurrentMonth = index$4.getCurrentMonth;
49
- exports.getCurrentYear = index$4.getCurrentYear;
50
- exports.getSeededRandomComparator = index$4.getSeededRandomComparator;
51
- exports.parseNumber = index$4.parseNumber;
52
- exports.randomComparator = index$4.randomComparator;
53
- exports.round = index$4.round;
54
- exports.toFixedTwo = index$4.toFixedTwo;
55
- exports.extractTheme = index$5.extractTheme;
56
- exports.generateColorPalette = index$5.generateColorPalette;
57
- exports.transformSiteNavigation = index$5.transformSiteNavigation;
45
+ exports.DARK_THEME_COLOR = index$4.DARK_THEME_COLOR;
46
+ exports.LIGHT_THEME_COLOR = index$4.LIGHT_THEME_COLOR;
47
+ exports.formatDate = index$5.formatDate;
48
+ exports.formatNumber = index$5.formatNumber;
49
+ exports.getCurrencySymbol = index$5.getCurrencySymbol;
50
+ exports.getCurrentMonth = index$5.getCurrentMonth;
51
+ exports.getCurrentYear = index$5.getCurrentYear;
52
+ exports.getSeededRandomComparator = index$5.getSeededRandomComparator;
53
+ exports.parseNumber = index$5.parseNumber;
54
+ exports.randomComparator = index$5.randomComparator;
55
+ exports.round = index$5.round;
56
+ exports.toFixedTwo = index$5.toFixedTwo;
57
+ exports.transformSiteNavigation = index$6.transformSiteNavigation;
58
58
  exports.i18n = i18n;