@anywayseo/tools 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/layout/header/navigation/nav-link/index.d.ts +2 -2
- package/dist/{index-Cn_SqfLz.js → index-B-J8fcfm.js} +26 -11
- package/dist/{index-Bc2a2-SP.mjs → index-CAcPXV4F.mjs} +26 -11
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/components/navigation/index.d.ts +5 -2
- package/package.json +1 -1
|
@@ -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-B-J8fcfm.js");
|
|
4
4
|
exports.Author = index.Author;
|
|
5
5
|
exports.BonusCard = index.BonusCard;
|
|
6
6
|
exports.Center = index.Center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type NavLinkProps =
|
|
1
|
+
import { INavItem } from '../../../../../types';
|
|
2
|
+
type NavLinkProps = Omit<INavItem, 'children'>;
|
|
3
3
|
declare const NavLink: import('react').ForwardRefExoticComponent<NavLinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
4
4
|
export default NavLink;
|
|
@@ -637,22 +637,23 @@ const NavList$1 = ({ path, label, children }) => {
|
|
|
637
637
|
] });
|
|
638
638
|
};
|
|
639
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) => {
|
|
640
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { as: "ul", role: "list", gap: 2, p: 0, display: { base: "none", md: "flex" }, children: menu.map((item, index2) => {
|
|
641
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);
|
|
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 || index2);
|
|
643
643
|
}) });
|
|
644
644
|
};
|
|
645
|
+
const CHEVRON_DOWN_ICON_SIZE = "1.5rem";
|
|
645
646
|
const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
646
647
|
function handleClick() {
|
|
647
648
|
onExpand(path);
|
|
648
649
|
}
|
|
649
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, {
|
|
650
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { flex: 1, children: [
|
|
650
651
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
651
652
|
react.Flex,
|
|
652
653
|
{
|
|
653
654
|
as: "button",
|
|
654
655
|
p: 2,
|
|
655
|
-
|
|
656
|
+
pr: "3px",
|
|
656
657
|
align: "center",
|
|
657
658
|
justifyContent: "space-between",
|
|
658
659
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
@@ -662,8 +663,8 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
|
662
663
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
663
664
|
icons.ChevronDownIcon,
|
|
664
665
|
{
|
|
665
|
-
w:
|
|
666
|
-
h:
|
|
666
|
+
w: CHEVRON_DOWN_ICON_SIZE,
|
|
667
|
+
h: CHEVRON_DOWN_ICON_SIZE,
|
|
667
668
|
transform: isExpanded ? "rotate(180deg)" : "",
|
|
668
669
|
transition: "all .25s ease-in-out"
|
|
669
670
|
}
|
|
@@ -674,6 +675,8 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
|
674
675
|
/* @__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)) }) })
|
|
675
676
|
] });
|
|
676
677
|
};
|
|
678
|
+
const CLOSE_ICON_SIZE = "0.75rem";
|
|
679
|
+
const HAMBURGER_ICON_SIZE = "1rem";
|
|
677
680
|
const MobileNavigation = ({ menu }) => {
|
|
678
681
|
const [selected, setSelected] = react$1.useState(null);
|
|
679
682
|
const { isOpen, onToggle } = react.useDisclosure();
|
|
@@ -689,7 +692,7 @@ const MobileNavigation = ({ menu }) => {
|
|
|
689
692
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
690
693
|
react.IconButton,
|
|
691
694
|
{
|
|
692
|
-
icon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { w:
|
|
695
|
+
icon: isOpen ? /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { w: CLOSE_ICON_SIZE, h: CLOSE_ICON_SIZE }) : /* @__PURE__ */ jsxRuntime.jsx(icons.HamburgerIcon, { w: HAMBURGER_ICON_SIZE, h: HAMBURGER_ICON_SIZE }),
|
|
693
696
|
size: "sm",
|
|
694
697
|
variant: "ghost",
|
|
695
698
|
"aria-label": `${isOpen ? "Close" : "Open"} navigation menu`,
|
|
@@ -697,10 +700,22 @@ const MobileNavigation = ({ menu }) => {
|
|
|
697
700
|
onClick: handleClick
|
|
698
701
|
}
|
|
699
702
|
),
|
|
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(
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
703
|
+
/* @__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(
|
|
704
|
+
react.List,
|
|
705
|
+
{
|
|
706
|
+
spacing: 2,
|
|
707
|
+
p: 2,
|
|
708
|
+
boxShadow: "md",
|
|
709
|
+
borderWidth: "1px",
|
|
710
|
+
borderColor: react.useColorModeValue("gray.200", "gray.700"),
|
|
711
|
+
borderRadius: "md",
|
|
712
|
+
bg: background,
|
|
713
|
+
children: menu.map((item, index2) => {
|
|
714
|
+
var _a;
|
|
715
|
+
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 || index2);
|
|
716
|
+
})
|
|
717
|
+
}
|
|
718
|
+
) }) })
|
|
704
719
|
] });
|
|
705
720
|
};
|
|
706
721
|
const Navigation = ({ menu }) => {
|
|
@@ -636,22 +636,23 @@ const NavList$1 = ({ path, label, children }) => {
|
|
|
636
636
|
] });
|
|
637
637
|
};
|
|
638
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) => {
|
|
639
|
+
return /* @__PURE__ */ jsx(Flex, { as: "ul", role: "list", gap: 2, p: 0, display: { base: "none", md: "flex" }, children: menu.map((item, index) => {
|
|
640
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);
|
|
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 || index);
|
|
642
642
|
}) });
|
|
643
643
|
};
|
|
644
|
+
const CHEVRON_DOWN_ICON_SIZE = "1.5rem";
|
|
644
645
|
const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
645
646
|
function handleClick() {
|
|
646
647
|
onExpand(path);
|
|
647
648
|
}
|
|
648
|
-
return /* @__PURE__ */ jsxs(Stack, {
|
|
649
|
+
return /* @__PURE__ */ jsxs(Stack, { flex: 1, children: [
|
|
649
650
|
/* @__PURE__ */ jsxs(
|
|
650
651
|
Flex,
|
|
651
652
|
{
|
|
652
653
|
as: "button",
|
|
653
654
|
p: 2,
|
|
654
|
-
|
|
655
|
+
pr: "3px",
|
|
655
656
|
align: "center",
|
|
656
657
|
justifyContent: "space-between",
|
|
657
658
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
@@ -661,8 +662,8 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
|
661
662
|
/* @__PURE__ */ jsx(
|
|
662
663
|
ChevronDownIcon,
|
|
663
664
|
{
|
|
664
|
-
w:
|
|
665
|
-
h:
|
|
665
|
+
w: CHEVRON_DOWN_ICON_SIZE,
|
|
666
|
+
h: CHEVRON_DOWN_ICON_SIZE,
|
|
666
667
|
transform: isExpanded ? "rotate(180deg)" : "",
|
|
667
668
|
transition: "all .25s ease-in-out"
|
|
668
669
|
}
|
|
@@ -673,6 +674,8 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
|
673
674
|
/* @__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)) }) })
|
|
674
675
|
] });
|
|
675
676
|
};
|
|
677
|
+
const CLOSE_ICON_SIZE = "0.75rem";
|
|
678
|
+
const HAMBURGER_ICON_SIZE = "1rem";
|
|
676
679
|
const MobileNavigation = ({ menu }) => {
|
|
677
680
|
const [selected, setSelected] = useState(null);
|
|
678
681
|
const { isOpen, onToggle } = useDisclosure();
|
|
@@ -688,7 +691,7 @@ const MobileNavigation = ({ menu }) => {
|
|
|
688
691
|
/* @__PURE__ */ jsx(
|
|
689
692
|
IconButton,
|
|
690
693
|
{
|
|
691
|
-
icon: isOpen ? /* @__PURE__ */ jsx(CloseIcon, { w:
|
|
694
|
+
icon: isOpen ? /* @__PURE__ */ jsx(CloseIcon, { w: CLOSE_ICON_SIZE, h: CLOSE_ICON_SIZE }) : /* @__PURE__ */ jsx(HamburgerIcon, { w: HAMBURGER_ICON_SIZE, h: HAMBURGER_ICON_SIZE }),
|
|
692
695
|
size: "sm",
|
|
693
696
|
variant: "ghost",
|
|
694
697
|
"aria-label": `${isOpen ? "Close" : "Open"} navigation menu`,
|
|
@@ -696,10 +699,22 @@ const MobileNavigation = ({ menu }) => {
|
|
|
696
699
|
onClick: handleClick
|
|
697
700
|
}
|
|
698
701
|
),
|
|
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(
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
702
|
+
/* @__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(
|
|
703
|
+
List$1,
|
|
704
|
+
{
|
|
705
|
+
spacing: 2,
|
|
706
|
+
p: 2,
|
|
707
|
+
boxShadow: "md",
|
|
708
|
+
borderWidth: "1px",
|
|
709
|
+
borderColor: useColorModeValue("gray.200", "gray.700"),
|
|
710
|
+
borderRadius: "md",
|
|
711
|
+
bg: background,
|
|
712
|
+
children: menu.map((item, index) => {
|
|
713
|
+
var _a;
|
|
714
|
+
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 || index);
|
|
715
|
+
})
|
|
716
|
+
}
|
|
717
|
+
) }) })
|
|
703
718
|
] });
|
|
704
719
|
};
|
|
705
720
|
const Navigation = ({ menu }) => {
|
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-B-J8fcfm.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-CAcPXV4F.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";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
type Path = `/${string}`;
|
|
2
|
+
type EmptyPath = '';
|
|
2
3
|
type IndexPath = '/';
|
|
3
4
|
export interface INavItem<P extends Path = Path> {
|
|
4
|
-
path: P;
|
|
5
|
+
path: P | EmptyPath;
|
|
5
6
|
label: string;
|
|
6
7
|
children?: ISubNavItem[];
|
|
7
8
|
}
|
|
8
|
-
export interface ISubNavItem<P extends Path = Path>
|
|
9
|
+
export interface ISubNavItem<P extends Path = Path> {
|
|
10
|
+
path: P | IndexPath;
|
|
11
|
+
label: string;
|
|
9
12
|
}
|
|
10
13
|
export {};
|