@anywayseo/tools 2.0.0 → 2.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.
- package/README.md +69 -62
- package/dist/components/base/pulse-button/index.d.ts +1 -0
- package/dist/components/base/pulse-button/utils.d.ts +4 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/layout/footer/navigation/index.d.ts +2 -2
- package/dist/components/layout/header/navigation/desktop/nav-list/index.d.ts +5 -0
- package/dist/components/layout/header/navigation/mobile/nav-list/index.d.ts +8 -0
- package/dist/components/layout/header/navigation/nav-link/index.d.ts +4 -0
- package/dist/components/layout/header/navigation/types.d.ts +2 -2
- package/dist/{index-CHSIkTv7.mjs → index-Bc2a2-SP.mjs} +110 -86
- package/dist/{index-CnohyDGd.js → index-Cn_SqfLz.js} +108 -84
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/components/bonus-card/index.d.ts +1 -1
- package/dist/types/components/game-card/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/navigation/index.d.ts +10 -0
- package/dist/types/index.d.ts +1 -2
- package/dist/types/site/index.d.ts +3 -3
- package/package.json +3 -2
- package/dist/components/layout/header/navigation/desktop/item/index.d.ts +0 -5
- package/dist/components/layout/header/navigation/mobile/item/index.d.ts +0 -5
- package/dist/types/navigation/index.d.ts +0 -9
- /package/dist/types/{models → content}/author/index.d.ts +0 -0
- /package/dist/types/{models → content}/bonus/index.d.ts +0 -0
- /package/dist/types/{models → content}/feature/index.d.ts +0 -0
- /package/dist/types/{models → content}/game/index.d.ts +0 -0
- /package/dist/types/{models → content}/index.d.ts +0 -0
- /package/dist/types/{models → content}/link/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,62 +1,69 @@
|
|
|
1
|
-
# Shared UI Components & Modules for Anywayseo projects
|
|
2
|
-
|
|
3
|
-
A modular UI component library designed for Anywayseo blog sites, offering reusable React components and utilities to enhance development speed and consistency.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @anywayseo/tools
|
|
9
|
-
# or
|
|
10
|
-
yarn add @anywayseo/tools
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Peer Dependencies
|
|
14
|
-
|
|
15
|
-
This package requires the following peer dependencies:
|
|
16
|
-
|
|
17
|
-
- "@chakra-ui/icons": "^2.0.0",
|
|
18
|
-
- "@chakra-ui/react": "^2.0.0",
|
|
19
|
-
- "@emotion/react": "^11.0.0",
|
|
20
|
-
- "@emotion/styled": "^11.0.0",
|
|
21
|
-
- "@mdx-js/react": "^2.0.0",
|
|
22
|
-
- "framer-motion": "^12.0.6",
|
|
23
|
-
- "gatsby": "^5.0.0",
|
|
24
|
-
- "
|
|
25
|
-
- "
|
|
26
|
-
- "react": "^18.3.1",
|
|
27
|
-
- "react-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
# Shared UI Components & Modules for Anywayseo projects
|
|
2
|
+
|
|
3
|
+
A modular UI component library designed for Anywayseo blog sites, offering reusable React components and utilities to enhance development speed and consistency.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @anywayseo/tools
|
|
9
|
+
# or
|
|
10
|
+
yarn add @anywayseo/tools
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Peer Dependencies
|
|
14
|
+
|
|
15
|
+
This package requires the following peer dependencies:
|
|
16
|
+
|
|
17
|
+
- "@chakra-ui/icons": "^2.0.0",
|
|
18
|
+
- "@chakra-ui/react": "^2.0.0",
|
|
19
|
+
- "@emotion/react": "^11.0.0",
|
|
20
|
+
- "@emotion/styled": "^11.0.0",
|
|
21
|
+
- "@mdx-js/react": "^2.0.0",
|
|
22
|
+
- "framer-motion": "^12.0.6",
|
|
23
|
+
- "gatsby": "^5.0.0",
|
|
24
|
+
- "i18next": "^24.0.0",
|
|
25
|
+
- "react": "^18.3.1",
|
|
26
|
+
- "react-dom": "^18.3.1",
|
|
27
|
+
- "react-i18next": "^15.0.0"
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
### Local Dev using Stand
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm start
|
|
35
|
+
# or
|
|
36
|
+
yarn start
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Importing Components
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import type { IAuthor } from '@anywayseo/tools';
|
|
43
|
+
import { Author, getCurrentYear } from '@anywayseo/tools';
|
|
44
|
+
|
|
45
|
+
const BlogPreview = ({ author }) => (
|
|
46
|
+
<div>
|
|
47
|
+
<Author author={author} />
|
|
48
|
+
{getCurrentYear()}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Available Modules:
|
|
54
|
+
|
|
55
|
+
- Components
|
|
56
|
+
|
|
57
|
+
- Hooks
|
|
58
|
+
|
|
59
|
+
- i18n
|
|
60
|
+
|
|
61
|
+
- Providers
|
|
62
|
+
|
|
63
|
+
- Types
|
|
64
|
+
|
|
65
|
+
- Utilities
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT License © 2025 Anywayseo
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("../index-
|
|
3
|
+
const index = require("../index-Cn_SqfLz.js");
|
|
4
4
|
exports.Author = index.Author;
|
|
5
5
|
exports.BonusCard = index.BonusCard;
|
|
6
6
|
exports.Center = index.Center;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { INavItem } from '../../../../types';
|
|
3
3
|
type NavigationProps = {
|
|
4
|
-
menu:
|
|
4
|
+
menu: INavItem[];
|
|
5
5
|
};
|
|
6
6
|
declare const Navigation: FC<NavigationProps>;
|
|
7
7
|
export default Navigation;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Center as Center$1, Box, Collapse, Text, Button, Flex, Stack, Image, SimpleGrid, Link, Card, CardHeader, Heading, CardBody, Popover, PopoverTrigger, 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,
|
|
2
|
+
import { Center as Center$1, Box, Collapse, Text, Button, Flex, Stack, Image, SimpleGrid, Link, Card, CardHeader, Heading, CardBody, Popover, PopoverTrigger, 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
4
|
import { A as Animation, b as formatNumber, c as getCurrencySymbol, f as formatDate, d as getDomain, g as getCurrentYear, a as getCurrentMonth } from "./index-j8Vo42fz.mjs";
|
|
5
5
|
import { a as GameCharacteristic } from "./index-DxLcykuT.mjs";
|
|
6
6
|
import "@ctrl/tinycolor";
|
|
7
7
|
import "@mdx-js/react";
|
|
8
8
|
import { u as useSiteContext } from "./index-BNb-P8a6.mjs";
|
|
9
|
-
import { useRef, useState, useLayoutEffect, Fragment as Fragment$1, useEffect, useMemo } from "react";
|
|
9
|
+
import { useRef, useState, useLayoutEffect, Fragment as Fragment$1, forwardRef, useEffect, useMemo } from "react";
|
|
10
10
|
import { EmailIcon, StarIcon, CloseIcon, ExternalLinkIcon, ChevronRightIcon, ChevronDownIcon, HamburgerIcon, ChevronUpIcon, WarningIcon, CheckCircleIcon } from "@chakra-ui/icons";
|
|
11
11
|
import { u as usePrimaryColors } from "./index-xuSxvz5z.mjs";
|
|
12
12
|
import { t } from "i18next";
|
|
@@ -85,12 +85,16 @@ const LinkButton = ({ label, url, width = "auto", ...boxProps }) => {
|
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
};
|
|
88
|
-
const
|
|
88
|
+
const ColorMap = {
|
|
89
|
+
light: "gray.200",
|
|
90
|
+
dark: "gray.700"
|
|
91
|
+
};
|
|
92
|
+
const PulseButton = ({ label, colorScheme = "light", onClick }) => {
|
|
89
93
|
return /* @__PURE__ */ jsx(
|
|
90
94
|
Button,
|
|
91
95
|
{
|
|
92
96
|
size: { base: "sm", md: "lg" },
|
|
93
|
-
color:
|
|
97
|
+
color: ColorMap[colorScheme],
|
|
94
98
|
bgColor: "brand.500",
|
|
95
99
|
animation: `${Animation.pulse} 2s infinite linear`,
|
|
96
100
|
_hover: { bgColor: "brand.200", color: "gray.700" },
|
|
@@ -544,18 +548,18 @@ const Navigation$1 = ({ menu }) => {
|
|
|
544
548
|
spacing: 4,
|
|
545
549
|
justifyItems: { base: "flex-start", md: "center" },
|
|
546
550
|
justifyContent: "space-between",
|
|
547
|
-
children: menu.map(({
|
|
551
|
+
children: menu.map(({ path, label }) => /* @__PURE__ */ jsx(
|
|
548
552
|
Text,
|
|
549
553
|
{
|
|
550
554
|
as: Link$1,
|
|
551
|
-
to:
|
|
555
|
+
to: path,
|
|
552
556
|
fontSize: "md",
|
|
553
557
|
fontWeight: "semibold",
|
|
554
558
|
colorScheme: "gray",
|
|
555
559
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
556
|
-
children:
|
|
560
|
+
children: label
|
|
557
561
|
},
|
|
558
|
-
|
|
562
|
+
path
|
|
559
563
|
))
|
|
560
564
|
}
|
|
561
565
|
);
|
|
@@ -583,114 +587,134 @@ const Footer = () => {
|
|
|
583
587
|
const Brand = ({ brand }) => {
|
|
584
588
|
return /* @__PURE__ */ jsx(Link$1, { to: "/", children: brand });
|
|
585
589
|
};
|
|
586
|
-
const
|
|
590
|
+
const NavLink = forwardRef(({ path, label }, ref) => {
|
|
591
|
+
return /* @__PURE__ */ jsx(
|
|
592
|
+
Text,
|
|
593
|
+
{
|
|
594
|
+
ref,
|
|
595
|
+
as: Link$1,
|
|
596
|
+
to: path,
|
|
597
|
+
p: 2,
|
|
598
|
+
fontWeight: "semibold",
|
|
599
|
+
_hover: { textDecoration: "none", color: "brand.400" },
|
|
600
|
+
children: label
|
|
601
|
+
}
|
|
602
|
+
);
|
|
603
|
+
});
|
|
604
|
+
NavLink.displayName = "NavLink";
|
|
605
|
+
const NavList$1 = ({ path, label, children }) => {
|
|
587
606
|
const background = useColorModeValue("white", "gray.800");
|
|
588
607
|
const backgroundHover = useColorModeValue("brand.50", "gray.900");
|
|
589
608
|
return /* @__PURE__ */ jsxs(Popover, { trigger: "hover", placement: "bottom-start", children: [
|
|
590
609
|
/* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(
|
|
591
610
|
Text,
|
|
592
611
|
{
|
|
593
|
-
as: Link$1,
|
|
594
|
-
to: url,
|
|
595
612
|
p: 2,
|
|
596
|
-
|
|
597
|
-
|
|
613
|
+
fontWeight: "semibold",
|
|
614
|
+
cursor: "pointer",
|
|
615
|
+
tabIndex: 0,
|
|
598
616
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
599
|
-
children:
|
|
617
|
+
children: label
|
|
600
618
|
}
|
|
601
619
|
) }),
|
|
602
|
-
|
|
603
|
-
|
|
620
|
+
/* @__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) => /* @__PURE__ */ jsx(ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxs(Flex, { as: Link$1, to: `${path}${child.path}`, p: 2, role: "group", children: [
|
|
621
|
+
/* @__PURE__ */ jsx(Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
|
|
622
|
+
/* @__PURE__ */ jsx(
|
|
623
|
+
Flex,
|
|
624
|
+
{
|
|
625
|
+
flex: 1,
|
|
626
|
+
justify: "flex-end",
|
|
627
|
+
align: "center",
|
|
628
|
+
opacity: 0,
|
|
629
|
+
transition: "all .3s ease",
|
|
630
|
+
transform: "translateX(-10px)",
|
|
631
|
+
_groupHover: { opacity: 1, transform: "translateX(0)" },
|
|
632
|
+
children: /* @__PURE__ */ jsx(Icon, { as: ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
|
|
633
|
+
}
|
|
634
|
+
)
|
|
635
|
+
] }) }, child.path)) }) })
|
|
636
|
+
] });
|
|
637
|
+
};
|
|
638
|
+
const DesktopNavigation = ({ menu }) => {
|
|
639
|
+
return /* @__PURE__ */ jsx(Flex, { as: "ul", role: "list", gap: 2, p: 0, display: { base: "none", md: "flex" }, children: menu.map((item) => {
|
|
640
|
+
var _a;
|
|
641
|
+
return /* @__PURE__ */ jsx(Flex, { as: "li", role: "listitem", children: ((_a = item.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsx(NavList$1, { ...item }) : /* @__PURE__ */ jsx(NavLink, { ...item }) }, item.path);
|
|
642
|
+
}) });
|
|
643
|
+
};
|
|
644
|
+
const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
645
|
+
function handleClick() {
|
|
646
|
+
onExpand(path);
|
|
647
|
+
}
|
|
648
|
+
return /* @__PURE__ */ jsxs(Stack, { w: "full", children: [
|
|
649
|
+
/* @__PURE__ */ jsxs(
|
|
650
|
+
Flex,
|
|
604
651
|
{
|
|
605
|
-
as: "
|
|
606
|
-
role: "group",
|
|
607
|
-
display: "block",
|
|
652
|
+
as: "button",
|
|
608
653
|
p: 2,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
] }),
|
|
654
|
+
pe: 1,
|
|
655
|
+
align: "center",
|
|
656
|
+
justifyContent: "space-between",
|
|
657
|
+
_hover: { textDecoration: "none", color: "brand.400" },
|
|
658
|
+
onClick: handleClick,
|
|
659
|
+
children: [
|
|
660
|
+
/* @__PURE__ */ jsx(Text, { isTruncated: true, fontWeight: 600, children: label }),
|
|
617
661
|
/* @__PURE__ */ jsx(
|
|
618
|
-
|
|
662
|
+
ChevronDownIcon,
|
|
619
663
|
{
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
transition: "all .3s ease",
|
|
625
|
-
transform: "translateX(-10px)",
|
|
626
|
-
_groupHover: { opacity: 1, transform: "translateX(0)" },
|
|
627
|
-
children: /* @__PURE__ */ jsx(Icon, { as: ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
|
|
664
|
+
w: 24,
|
|
665
|
+
h: 24,
|
|
666
|
+
transform: isExpanded ? "rotate(180deg)" : "",
|
|
667
|
+
transition: "all .25s ease-in-out"
|
|
628
668
|
}
|
|
629
669
|
)
|
|
630
|
-
]
|
|
631
|
-
},
|
|
632
|
-
child.url
|
|
633
|
-
)) }) })
|
|
634
|
-
] });
|
|
635
|
-
};
|
|
636
|
-
const DesktopNavigation = ({ menu }) => {
|
|
637
|
-
return /* @__PURE__ */ jsx(Flex, { as: "ul", direction: "row", gap: 4, p: 0, children: menu.map((item) => /* @__PURE__ */ jsx(Flex, { as: "li", children: /* @__PURE__ */ jsx(DesktopNavItem, { ...item }) }, item.url)) });
|
|
638
|
-
};
|
|
639
|
-
const MobileNavItem = ({ title, children, url }) => {
|
|
640
|
-
const { isOpen, onToggle } = useDisclosure();
|
|
641
|
-
return /* @__PURE__ */ jsxs(Stack, { w: "100%", p: 2, children: [
|
|
642
|
-
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: 2, justify: "space-between", children: [
|
|
643
|
-
/* @__PURE__ */ jsx(Text, { as: Link$1, to: url, isTruncated: true, fontWeight: 600, children: title }),
|
|
644
|
-
!!children && /* @__PURE__ */ jsx(Flex, { as: "button", onClick: onToggle, children: /* @__PURE__ */ jsx(
|
|
645
|
-
Icon,
|
|
646
|
-
{
|
|
647
|
-
as: ChevronDownIcon,
|
|
648
|
-
w: 6,
|
|
649
|
-
h: 6,
|
|
650
|
-
transform: isOpen ? "rotate(180deg)" : "",
|
|
651
|
-
transition: "all .25s ease-in-out"
|
|
652
|
-
}
|
|
653
|
-
) })
|
|
654
|
-
] }),
|
|
655
|
-
/* @__PURE__ */ jsx(Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsx(
|
|
656
|
-
Stack,
|
|
657
|
-
{
|
|
658
|
-
as: "ul",
|
|
659
|
-
pl: 2,
|
|
660
|
-
borderLeft: 1,
|
|
661
|
-
borderStyle: "solid",
|
|
662
|
-
borderColor: useColorModeValue("gray.200", "gray.700"),
|
|
663
|
-
children: !!children && children.map((child) => /* @__PURE__ */ jsx(Flex, { as: "li", children: /* @__PURE__ */ jsx(Text, { as: Link$1, to: `${url}${child.url}`, py: 2, children: child.title }) }, child.url))
|
|
670
|
+
]
|
|
664
671
|
}
|
|
665
|
-
)
|
|
672
|
+
),
|
|
673
|
+
/* @__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) => /* @__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 }) }, child.path)) }) })
|
|
666
674
|
] });
|
|
667
675
|
};
|
|
668
676
|
const MobileNavigation = ({ menu }) => {
|
|
677
|
+
const [selected, setSelected] = useState(null);
|
|
669
678
|
const { isOpen, onToggle } = useDisclosure();
|
|
670
|
-
const background = useColorModeValue("
|
|
671
|
-
|
|
679
|
+
const background = useColorModeValue("gray.50", "gray.900");
|
|
680
|
+
function handleExpand(id) {
|
|
681
|
+
setSelected((prev) => prev === id ? null : id);
|
|
682
|
+
}
|
|
683
|
+
function handleClick() {
|
|
684
|
+
setSelected(null);
|
|
685
|
+
onToggle();
|
|
686
|
+
}
|
|
687
|
+
return /* @__PURE__ */ jsxs(Box, { display: { base: "block", md: "none" }, children: [
|
|
672
688
|
/* @__PURE__ */ jsx(
|
|
673
689
|
IconButton,
|
|
674
690
|
{
|
|
675
|
-
icon: isOpen ? /* @__PURE__ */ jsx(CloseIcon, { w:
|
|
676
|
-
size: "
|
|
691
|
+
icon: isOpen ? /* @__PURE__ */ jsx(CloseIcon, { w: 12, h: 12 }) : /* @__PURE__ */ jsx(HamburgerIcon, { w: 18, h: 18 }),
|
|
692
|
+
size: "sm",
|
|
677
693
|
variant: "ghost",
|
|
678
|
-
"aria-label": "
|
|
679
|
-
|
|
694
|
+
"aria-label": `${isOpen ? "Close" : "Open"} navigation menu`,
|
|
695
|
+
"aria-expanded": isOpen,
|
|
696
|
+
onClick: handleClick
|
|
680
697
|
}
|
|
681
698
|
),
|
|
682
|
-
/* @__PURE__ */ jsx(Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsx(Box, { position: "absolute", top:
|
|
683
|
-
|
|
699
|
+
/* @__PURE__ */ jsx(Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsx(Box, { position: "absolute", top: 16, left: 0, right: 0, w: "100vw", px: 2, children: /* @__PURE__ */ jsx(List$1, { spacing: 2, p: 2, w: "full", borderRadius: "md", boxShadow: "md", bg: background, children: menu.map((item) => {
|
|
700
|
+
var _a;
|
|
701
|
+
return /* @__PURE__ */ jsx(Flex, { as: "li", role: "listitem", children: ((_a = item.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsx(NavList, { ...item, isExpanded: item.path === selected, onExpand: handleExpand }) : /* @__PURE__ */ jsx(NavLink, { ...item }) }, item.path);
|
|
702
|
+
}) }) }) })
|
|
703
|
+
] });
|
|
684
704
|
};
|
|
685
705
|
const Navigation = ({ menu }) => {
|
|
686
|
-
|
|
687
|
-
|
|
706
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
707
|
+
/* @__PURE__ */ jsx(DesktopNavigation, { menu }),
|
|
708
|
+
/* @__PURE__ */ jsx(MobileNavigation, { menu })
|
|
709
|
+
] });
|
|
688
710
|
};
|
|
689
711
|
const Header = () => {
|
|
690
712
|
var _a, _b;
|
|
691
713
|
const { configs } = useSiteContext();
|
|
692
714
|
const navigation = ((_a = configs == null ? void 0 : configs.header) == null ? void 0 : _a.navigation) ?? [];
|
|
693
715
|
const toolbar = (_b = configs == null ? void 0 : configs.header) == null ? void 0 : _b.toolbar;
|
|
716
|
+
const hasToolbar = !!toolbar;
|
|
717
|
+
const hasNavigation = navigation.length;
|
|
694
718
|
return /* @__PURE__ */ jsx(
|
|
695
719
|
Box,
|
|
696
720
|
{
|
|
@@ -701,20 +725,20 @@ const Header = () => {
|
|
|
701
725
|
color: useColorModeValue("gray.700", "gray.200"),
|
|
702
726
|
boxShadow: "sm",
|
|
703
727
|
zIndex: 100,
|
|
704
|
-
children: /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsxs(Flex, { as: "nav", gap: 2, py:
|
|
728
|
+
children: /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsxs(Flex, { as: "nav", gap: 2, py: 2, children: [
|
|
705
729
|
/* @__PURE__ */ jsx(Brand, { brand: /* @__PURE__ */ jsx(Logo, {}) }),
|
|
706
|
-
(
|
|
730
|
+
(hasNavigation || hasToolbar) && /* @__PURE__ */ jsxs(
|
|
707
731
|
Flex,
|
|
708
732
|
{
|
|
709
733
|
as: "section",
|
|
710
734
|
flex: 1,
|
|
711
735
|
flexDir: { base: "row-reverse", md: "row" },
|
|
712
|
-
justifyContent:
|
|
736
|
+
justifyContent: "end",
|
|
713
737
|
align: "center",
|
|
714
738
|
gap: 2,
|
|
715
739
|
children: [
|
|
716
|
-
|
|
717
|
-
|
|
740
|
+
hasNavigation && /* @__PURE__ */ jsx(Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsx(Navigation, { menu: navigation }) }),
|
|
741
|
+
hasToolbar && /* @__PURE__ */ jsx(Flex, { gap: 2, flex: { base: 1, md: 0 }, justifyContent: "flex-end", children: toolbar })
|
|
718
742
|
]
|
|
719
743
|
}
|
|
720
744
|
)
|
|
@@ -86,12 +86,16 @@ const LinkButton = ({ label, url, width = "auto", ...boxProps }) => {
|
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
88
|
};
|
|
89
|
-
const
|
|
89
|
+
const ColorMap = {
|
|
90
|
+
light: "gray.200",
|
|
91
|
+
dark: "gray.700"
|
|
92
|
+
};
|
|
93
|
+
const PulseButton = ({ label, colorScheme = "light", onClick }) => {
|
|
90
94
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
91
95
|
react.Button,
|
|
92
96
|
{
|
|
93
97
|
size: { base: "sm", md: "lg" },
|
|
94
|
-
color:
|
|
98
|
+
color: ColorMap[colorScheme],
|
|
95
99
|
bgColor: "brand.500",
|
|
96
100
|
animation: `${index$1.Animation.pulse} 2s infinite linear`,
|
|
97
101
|
_hover: { bgColor: "brand.200", color: "gray.700" },
|
|
@@ -545,18 +549,18 @@ const Navigation$1 = ({ menu }) => {
|
|
|
545
549
|
spacing: 4,
|
|
546
550
|
justifyItems: { base: "flex-start", md: "center" },
|
|
547
551
|
justifyContent: "space-between",
|
|
548
|
-
children: menu.map(({
|
|
552
|
+
children: menu.map(({ path, label }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
549
553
|
react.Text,
|
|
550
554
|
{
|
|
551
555
|
as: gatsby.Link,
|
|
552
|
-
to:
|
|
556
|
+
to: path,
|
|
553
557
|
fontSize: "md",
|
|
554
558
|
fontWeight: "semibold",
|
|
555
559
|
colorScheme: "gray",
|
|
556
560
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
557
|
-
children:
|
|
561
|
+
children: label
|
|
558
562
|
},
|
|
559
|
-
|
|
563
|
+
path
|
|
560
564
|
))
|
|
561
565
|
}
|
|
562
566
|
);
|
|
@@ -584,114 +588,134 @@ const Footer = () => {
|
|
|
584
588
|
const Brand = ({ brand }) => {
|
|
585
589
|
return /* @__PURE__ */ jsxRuntime.jsx(gatsby.Link, { to: "/", children: brand });
|
|
586
590
|
};
|
|
587
|
-
const
|
|
591
|
+
const NavLink = react$1.forwardRef(({ path, label }, ref) => {
|
|
592
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
593
|
+
react.Text,
|
|
594
|
+
{
|
|
595
|
+
ref,
|
|
596
|
+
as: gatsby.Link,
|
|
597
|
+
to: path,
|
|
598
|
+
p: 2,
|
|
599
|
+
fontWeight: "semibold",
|
|
600
|
+
_hover: { textDecoration: "none", color: "brand.400" },
|
|
601
|
+
children: label
|
|
602
|
+
}
|
|
603
|
+
);
|
|
604
|
+
});
|
|
605
|
+
NavLink.displayName = "NavLink";
|
|
606
|
+
const NavList$1 = ({ path, label, children }) => {
|
|
588
607
|
const background = react.useColorModeValue("white", "gray.800");
|
|
589
608
|
const backgroundHover = react.useColorModeValue("brand.50", "gray.900");
|
|
590
609
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Popover, { trigger: "hover", placement: "bottom-start", children: [
|
|
591
610
|
/* @__PURE__ */ jsxRuntime.jsx(react.PopoverTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
592
611
|
react.Text,
|
|
593
612
|
{
|
|
594
|
-
as: gatsby.Link,
|
|
595
|
-
to: url,
|
|
596
613
|
p: 2,
|
|
597
|
-
|
|
598
|
-
|
|
614
|
+
fontWeight: "semibold",
|
|
615
|
+
cursor: "pointer",
|
|
616
|
+
tabIndex: 0,
|
|
599
617
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
600
|
-
children:
|
|
618
|
+
children: label
|
|
601
619
|
}
|
|
602
620
|
) }),
|
|
603
|
-
|
|
604
|
-
react.
|
|
621
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.PopoverContent, { p: 2, border: 0, minW: "sm", rounded: "xl", boxShadow: "xl", bg: background, children: /* @__PURE__ */ jsxRuntime.jsx(react.List, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(react.ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: gatsby.Link, to: `${path}${child.path}`, p: 2, role: "group", children: [
|
|
622
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
|
|
623
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
624
|
+
react.Flex,
|
|
625
|
+
{
|
|
626
|
+
flex: 1,
|
|
627
|
+
justify: "flex-end",
|
|
628
|
+
align: "center",
|
|
629
|
+
opacity: 0,
|
|
630
|
+
transition: "all .3s ease",
|
|
631
|
+
transform: "translateX(-10px)",
|
|
632
|
+
_groupHover: { opacity: 1, transform: "translateX(0)" },
|
|
633
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { as: icons.ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
|
|
634
|
+
}
|
|
635
|
+
)
|
|
636
|
+
] }) }, child.path)) }) })
|
|
637
|
+
] });
|
|
638
|
+
};
|
|
639
|
+
const DesktopNavigation = ({ menu }) => {
|
|
640
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "ul", role: "list", gap: 2, p: 0, display: { base: "none", md: "flex" }, children: menu.map((item) => {
|
|
641
|
+
var _a;
|
|
642
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", role: "listitem", children: ((_a = item.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx(NavList$1, { ...item }) : /* @__PURE__ */ jsxRuntime.jsx(NavLink, { ...item }) }, item.path);
|
|
643
|
+
}) });
|
|
644
|
+
};
|
|
645
|
+
const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
646
|
+
function handleClick() {
|
|
647
|
+
onExpand(path);
|
|
648
|
+
}
|
|
649
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { w: "full", children: [
|
|
650
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
651
|
+
react.Flex,
|
|
605
652
|
{
|
|
606
|
-
as: "
|
|
607
|
-
role: "group",
|
|
608
|
-
display: "block",
|
|
653
|
+
as: "button",
|
|
609
654
|
p: 2,
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
] }),
|
|
655
|
+
pe: 1,
|
|
656
|
+
align: "center",
|
|
657
|
+
justifyContent: "space-between",
|
|
658
|
+
_hover: { textDecoration: "none", color: "brand.400" },
|
|
659
|
+
onClick: handleClick,
|
|
660
|
+
children: [
|
|
661
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { isTruncated: true, fontWeight: 600, children: label }),
|
|
618
662
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
619
|
-
|
|
663
|
+
icons.ChevronDownIcon,
|
|
620
664
|
{
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
transition: "all .3s ease",
|
|
626
|
-
transform: "translateX(-10px)",
|
|
627
|
-
_groupHover: { opacity: 1, transform: "translateX(0)" },
|
|
628
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { as: icons.ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
|
|
665
|
+
w: 24,
|
|
666
|
+
h: 24,
|
|
667
|
+
transform: isExpanded ? "rotate(180deg)" : "",
|
|
668
|
+
transition: "all .25s ease-in-out"
|
|
629
669
|
}
|
|
630
670
|
)
|
|
631
|
-
]
|
|
632
|
-
},
|
|
633
|
-
child.url
|
|
634
|
-
)) }) })
|
|
635
|
-
] });
|
|
636
|
-
};
|
|
637
|
-
const DesktopNavigation = ({ menu }) => {
|
|
638
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "ul", direction: "row", gap: 4, p: 0, children: menu.map((item) => /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(DesktopNavItem, { ...item }) }, item.url)) });
|
|
639
|
-
};
|
|
640
|
-
const MobileNavItem = ({ title, children, url }) => {
|
|
641
|
-
const { isOpen, onToggle } = react.useDisclosure();
|
|
642
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { w: "100%", p: 2, children: [
|
|
643
|
-
/* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { align: "center", gap: 2, justify: "space-between", children: [
|
|
644
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: gatsby.Link, to: url, isTruncated: true, fontWeight: 600, children: title }),
|
|
645
|
-
!!children && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "button", onClick: onToggle, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
646
|
-
react.Icon,
|
|
647
|
-
{
|
|
648
|
-
as: icons.ChevronDownIcon,
|
|
649
|
-
w: 6,
|
|
650
|
-
h: 6,
|
|
651
|
-
transform: isOpen ? "rotate(180deg)" : "",
|
|
652
|
-
transition: "all .25s ease-in-out"
|
|
653
|
-
}
|
|
654
|
-
) })
|
|
655
|
-
] }),
|
|
656
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
657
|
-
react.Stack,
|
|
658
|
-
{
|
|
659
|
-
as: "ul",
|
|
660
|
-
pl: 2,
|
|
661
|
-
borderLeft: 1,
|
|
662
|
-
borderStyle: "solid",
|
|
663
|
-
borderColor: react.useColorModeValue("gray.200", "gray.700"),
|
|
664
|
-
children: !!children && children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: gatsby.Link, to: `${url}${child.url}`, py: 2, children: child.title }) }, child.url))
|
|
671
|
+
]
|
|
665
672
|
}
|
|
666
|
-
)
|
|
673
|
+
),
|
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsxRuntime.jsx(react.List, { ml: 2, pl: 0, borderLeft: 1, borderStyle: "solid", borderColor: react.useColorModeValue("gray.200", "gray.700"), children: children == null ? void 0 : children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: gatsby.Link, to: `${path}${child.path}`, p: 2, fontSize: "sm", children: child.label }) }, child.path)) }) })
|
|
667
675
|
] });
|
|
668
676
|
};
|
|
669
677
|
const MobileNavigation = ({ menu }) => {
|
|
678
|
+
const [selected, setSelected] = react$1.useState(null);
|
|
670
679
|
const { isOpen, onToggle } = react.useDisclosure();
|
|
671
|
-
const background = react.useColorModeValue("
|
|
672
|
-
|
|
680
|
+
const background = react.useColorModeValue("gray.50", "gray.900");
|
|
681
|
+
function handleExpand(id) {
|
|
682
|
+
setSelected((prev) => prev === id ? null : id);
|
|
683
|
+
}
|
|
684
|
+
function handleClick() {
|
|
685
|
+
setSelected(null);
|
|
686
|
+
onToggle();
|
|
687
|
+
}
|
|
688
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: { base: "block", md: "none" }, children: [
|
|
673
689
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
674
690
|
react.IconButton,
|
|
675
691
|
{
|
|
676
|
-
icon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { w:
|
|
677
|
-
size: "
|
|
692
|
+
icon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { w: 12, h: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(icons.HamburgerIcon, { w: 18, h: 18 }),
|
|
693
|
+
size: "sm",
|
|
678
694
|
variant: "ghost",
|
|
679
|
-
"aria-label": "
|
|
680
|
-
|
|
695
|
+
"aria-label": `${isOpen ? "Close" : "Open"} navigation menu`,
|
|
696
|
+
"aria-expanded": isOpen,
|
|
697
|
+
onClick: handleClick
|
|
681
698
|
}
|
|
682
699
|
),
|
|
683
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { position: "absolute", top:
|
|
684
|
-
|
|
700
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Collapse, { in: isOpen, animateOpacity: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { position: "absolute", top: 16, left: 0, right: 0, w: "100vw", px: 2, children: /* @__PURE__ */ jsxRuntime.jsx(react.List, { spacing: 2, p: 2, w: "full", borderRadius: "md", boxShadow: "md", bg: background, children: menu.map((item) => {
|
|
701
|
+
var _a;
|
|
702
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "li", role: "listitem", children: ((_a = item.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx(NavList, { ...item, isExpanded: item.path === selected, onExpand: handleExpand }) : /* @__PURE__ */ jsxRuntime.jsx(NavLink, { ...item }) }, item.path);
|
|
703
|
+
}) }) }) })
|
|
704
|
+
] });
|
|
685
705
|
};
|
|
686
706
|
const Navigation = ({ menu }) => {
|
|
687
|
-
|
|
688
|
-
|
|
707
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
708
|
+
/* @__PURE__ */ jsxRuntime.jsx(DesktopNavigation, { menu }),
|
|
709
|
+
/* @__PURE__ */ jsxRuntime.jsx(MobileNavigation, { menu })
|
|
710
|
+
] });
|
|
689
711
|
};
|
|
690
712
|
const Header = () => {
|
|
691
713
|
var _a, _b;
|
|
692
714
|
const { configs } = index.useSiteContext();
|
|
693
715
|
const navigation = ((_a = configs == null ? void 0 : configs.header) == null ? void 0 : _a.navigation) ?? [];
|
|
694
716
|
const toolbar = (_b = configs == null ? void 0 : configs.header) == null ? void 0 : _b.toolbar;
|
|
717
|
+
const hasToolbar = !!toolbar;
|
|
718
|
+
const hasNavigation = navigation.length;
|
|
695
719
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
696
720
|
react.Box,
|
|
697
721
|
{
|
|
@@ -702,20 +726,20 @@ const Header = () => {
|
|
|
702
726
|
color: react.useColorModeValue("gray.700", "gray.200"),
|
|
703
727
|
boxShadow: "sm",
|
|
704
728
|
zIndex: 100,
|
|
705
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: "nav", gap: 2, py:
|
|
729
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { as: "nav", gap: 2, py: 2, children: [
|
|
706
730
|
/* @__PURE__ */ jsxRuntime.jsx(Brand, { brand: /* @__PURE__ */ jsxRuntime.jsx(Logo, {}) }),
|
|
707
|
-
(
|
|
731
|
+
(hasNavigation || hasToolbar) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
708
732
|
react.Flex,
|
|
709
733
|
{
|
|
710
734
|
as: "section",
|
|
711
735
|
flex: 1,
|
|
712
736
|
flexDir: { base: "row-reverse", md: "row" },
|
|
713
|
-
justifyContent:
|
|
737
|
+
justifyContent: "end",
|
|
714
738
|
align: "center",
|
|
715
739
|
gap: 2,
|
|
716
740
|
children: [
|
|
717
|
-
|
|
718
|
-
|
|
741
|
+
hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Navigation, { menu: navigation }) }),
|
|
742
|
+
hasToolbar && /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { gap: 2, flex: { base: 1, md: 0 }, justifyContent: "flex-end", children: toolbar })
|
|
719
743
|
]
|
|
720
744
|
}
|
|
721
745
|
)
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-Cn_SqfLz.js");
|
|
4
4
|
const index$1 = require("./index-IpSV-c71.js");
|
|
5
5
|
const i18n$1 = require("./index-DCIXk-YH.js");
|
|
6
6
|
const index$2 = require("./index-BWuTDC6H.js");
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, B, g, C, h, E, F, a, b, G, c, d, i, H, L, j, e, P, k, S, T, f } from "./index-
|
|
1
|
+
import { A, B, g, C, h, E, F, a, b, G, c, d, i, H, L, j, e, P, k, S, T, f } from "./index-Bc2a2-SP.mjs";
|
|
2
2
|
import { u } from "./index-xuSxvz5z.mjs";
|
|
3
3
|
import { a as a2, G as G2, r } from "./index-DxLcykuT.mjs";
|
|
4
4
|
import { M } from "./index-wbMOJRW_.mjs";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Path = `/${string}`;
|
|
2
|
+
type IndexPath = '/';
|
|
3
|
+
export interface INavItem<P extends Path = Path> {
|
|
4
|
+
path: P;
|
|
5
|
+
label: string;
|
|
6
|
+
children?: ISubNavItem[];
|
|
7
|
+
}
|
|
8
|
+
export interface ISubNavItem<P extends Path = Path> extends Omit<INavItem<P | IndexPath>, 'children'> {
|
|
9
|
+
}
|
|
10
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { INavItem } from '../components';
|
|
2
3
|
import { Currency, LanguageCode } from '../i18n';
|
|
3
|
-
import { INavigationItem } from '../navigation';
|
|
4
4
|
type ImageUrl = string;
|
|
5
5
|
type ImageComponent = ReactElement;
|
|
6
6
|
type Image = ImageUrl | ImageComponent;
|
|
@@ -12,11 +12,11 @@ export interface ISiteAssets {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
interface ISiteHeaderConfig {
|
|
15
|
-
navigation?:
|
|
15
|
+
navigation?: INavItem[];
|
|
16
16
|
toolbar?: ReactNode;
|
|
17
17
|
}
|
|
18
18
|
interface ISiteFooterConfig {
|
|
19
|
-
navigation?:
|
|
19
|
+
navigation?: INavItem[];
|
|
20
20
|
}
|
|
21
21
|
export interface ISiteConfigs {
|
|
22
22
|
header?: ISiteHeaderConfig;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anywayseo/tools",
|
|
3
3
|
"description": "Shared UI Components and Modules",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"ui",
|
|
@@ -64,10 +64,11 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
|
-
"start": "npm
|
|
67
|
+
"start": "npm run start --prefix stand",
|
|
68
68
|
"build": "tsc -b && vite build",
|
|
69
69
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
70
70
|
"prepack": "npm run build",
|
|
71
|
+
"preversion": "tsc -b && npm run lint",
|
|
71
72
|
"bump:patch": "npm version patch",
|
|
72
73
|
"bump:minor": "npm version minor",
|
|
73
74
|
"bump:major": "npm version major",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|