@reactfast/nav 0.2.19 → 0.2.21
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/realfastnav.es.js +142 -16
- package/package.json +1 -1
package/dist/realfastnav.es.js
CHANGED
|
@@ -616,14 +616,27 @@ function xe({ item: a, onHover: h }) {
|
|
|
616
616
|
},
|
|
617
617
|
children: [
|
|
618
618
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-x-1", children: [
|
|
619
|
-
a.useLink ? /* @__PURE__ */ e(
|
|
619
|
+
a.useLink ? /* @__PURE__ */ e(
|
|
620
|
+
k,
|
|
621
|
+
{
|
|
622
|
+
href: a.href,
|
|
623
|
+
className: "text-sm/6 font-semibold text-gray-900 dark:text-white",
|
|
624
|
+
children: a.title
|
|
625
|
+
}
|
|
626
|
+
) : /* @__PURE__ */ e("span", { className: "text-sm/6 font-semibold text-gray-900 dark:text-white", children: a.title }),
|
|
620
627
|
/* @__PURE__ */ e(
|
|
621
628
|
z,
|
|
622
629
|
{
|
|
623
630
|
ref: s,
|
|
624
631
|
className: "inline-flex items-center p-1 text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-white",
|
|
625
632
|
"aria-label": `Open ${a.title} menu`,
|
|
626
|
-
children: /* @__PURE__ */ e(
|
|
633
|
+
children: /* @__PURE__ */ e(
|
|
634
|
+
w,
|
|
635
|
+
{
|
|
636
|
+
"aria-hidden": "true",
|
|
637
|
+
className: "size-5 flex-none"
|
|
638
|
+
}
|
|
639
|
+
)
|
|
627
640
|
}
|
|
628
641
|
)
|
|
629
642
|
] }),
|
|
@@ -643,7 +656,13 @@ function xe({ item: a, onHover: h }) {
|
|
|
643
656
|
return n ? x.isValidElement(n) ? x.cloneElement(n, {
|
|
644
657
|
className: "size-6 text-gray-600 group-hover:text-primary",
|
|
645
658
|
"aria-hidden": !0
|
|
646
|
-
}) : typeof n == "function" ? /* @__PURE__ */ e(
|
|
659
|
+
}) : typeof n == "function" ? /* @__PURE__ */ e(
|
|
660
|
+
n,
|
|
661
|
+
{
|
|
662
|
+
"aria-hidden": !0,
|
|
663
|
+
className: "size-6 text-gray-600 group-hover:text-primary"
|
|
664
|
+
}
|
|
665
|
+
) : null : null;
|
|
647
666
|
})() }),
|
|
648
667
|
/* @__PURE__ */ t("div", { className: "flex-auto", children: [
|
|
649
668
|
/* @__PURE__ */ t(
|
|
@@ -674,7 +693,13 @@ function xe({ item: a, onHover: h }) {
|
|
|
674
693
|
return n ? x.isValidElement(n) ? x.cloneElement(n, {
|
|
675
694
|
className: "size-5 flex-none text-gray-400",
|
|
676
695
|
"aria-hidden": !0
|
|
677
|
-
}) : typeof n == "function" ? /* @__PURE__ */ e(
|
|
696
|
+
}) : typeof n == "function" ? /* @__PURE__ */ e(
|
|
697
|
+
n,
|
|
698
|
+
{
|
|
699
|
+
"aria-hidden": !0,
|
|
700
|
+
className: "size-5 flex-none text-gray-400"
|
|
701
|
+
}
|
|
702
|
+
) : null : null;
|
|
678
703
|
})(),
|
|
679
704
|
i.title
|
|
680
705
|
]
|
|
@@ -703,14 +728,27 @@ function fe({ item: a, onHover: h }) {
|
|
|
703
728
|
},
|
|
704
729
|
children: [
|
|
705
730
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-x-1", children: [
|
|
706
|
-
a.useLink ? /* @__PURE__ */ e(
|
|
731
|
+
a.useLink ? /* @__PURE__ */ e(
|
|
732
|
+
k,
|
|
733
|
+
{
|
|
734
|
+
href: a.href,
|
|
735
|
+
className: "text-sm/6 font-semibold text-gray-900",
|
|
736
|
+
children: a.title
|
|
737
|
+
}
|
|
738
|
+
) : /* @__PURE__ */ e("span", { className: "text-sm/6 font-semibold text-gray-900", children: a.title }),
|
|
707
739
|
/* @__PURE__ */ e(
|
|
708
740
|
z,
|
|
709
741
|
{
|
|
710
742
|
ref: s,
|
|
711
743
|
className: "inline-flex items-center p-1 text-gray-700 hover:text-gray-900",
|
|
712
744
|
"aria-label": `Open ${a.title} menu`,
|
|
713
|
-
children: /* @__PURE__ */ e(
|
|
745
|
+
children: /* @__PURE__ */ e(
|
|
746
|
+
w,
|
|
747
|
+
{
|
|
748
|
+
"aria-hidden": "true",
|
|
749
|
+
className: "size-5 flex-none"
|
|
750
|
+
}
|
|
751
|
+
)
|
|
714
752
|
}
|
|
715
753
|
)
|
|
716
754
|
] }),
|
|
@@ -737,7 +775,13 @@ function fe({ item: a, onHover: h }) {
|
|
|
737
775
|
return n ? x.isValidElement(n) ? x.cloneElement(n, {
|
|
738
776
|
className: "size-6 text-gray-600 group-hover:text-primary",
|
|
739
777
|
"aria-hidden": !0
|
|
740
|
-
}) : typeof n == "function" ? /* @__PURE__ */ e(
|
|
778
|
+
}) : typeof n == "function" ? /* @__PURE__ */ e(
|
|
779
|
+
n,
|
|
780
|
+
{
|
|
781
|
+
"aria-hidden": !0,
|
|
782
|
+
className: "size-6 text-gray-600 group-hover:text-primary"
|
|
783
|
+
}
|
|
784
|
+
) : null : null;
|
|
741
785
|
})() }),
|
|
742
786
|
/* @__PURE__ */ t(
|
|
743
787
|
"a",
|
|
@@ -766,7 +810,13 @@ function fe({ item: a, onHover: h }) {
|
|
|
766
810
|
return n ? x.isValidElement(n) ? x.cloneElement(n, {
|
|
767
811
|
className: "size-5 flex-none text-gray-400",
|
|
768
812
|
"aria-hidden": !0
|
|
769
|
-
}) : typeof n == "function" ? /* @__PURE__ */ e(
|
|
813
|
+
}) : typeof n == "function" ? /* @__PURE__ */ e(
|
|
814
|
+
n,
|
|
815
|
+
{
|
|
816
|
+
"aria-hidden": !0,
|
|
817
|
+
className: "size-5 flex-none text-gray-400"
|
|
818
|
+
}
|
|
819
|
+
) : null : null;
|
|
770
820
|
})(),
|
|
771
821
|
i.title
|
|
772
822
|
]
|
|
@@ -798,14 +848,27 @@ function pe({ item: a, onHover: h }) {
|
|
|
798
848
|
},
|
|
799
849
|
children: [
|
|
800
850
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-x-1", children: [
|
|
801
|
-
a.useLink ? /* @__PURE__ */ e(
|
|
851
|
+
a.useLink ? /* @__PURE__ */ e(
|
|
852
|
+
k,
|
|
853
|
+
{
|
|
854
|
+
href: a.href,
|
|
855
|
+
className: "text-sm/6 font-semibold text-gray-900",
|
|
856
|
+
children: a.title
|
|
857
|
+
}
|
|
858
|
+
) : /* @__PURE__ */ e("span", { className: "text-sm/6 font-semibold text-gray-900", children: a.title }),
|
|
802
859
|
/* @__PURE__ */ e(
|
|
803
860
|
z,
|
|
804
861
|
{
|
|
805
862
|
ref: s,
|
|
806
863
|
className: "inline-flex items-center p-1 text-gray-700 hover:text-gray-900",
|
|
807
864
|
"aria-label": `Open ${a.title} menu`,
|
|
808
|
-
children: /* @__PURE__ */ e(
|
|
865
|
+
children: /* @__PURE__ */ e(
|
|
866
|
+
w,
|
|
867
|
+
{
|
|
868
|
+
"aria-hidden": "true",
|
|
869
|
+
className: "size-5 flex-none"
|
|
870
|
+
}
|
|
871
|
+
)
|
|
809
872
|
}
|
|
810
873
|
)
|
|
811
874
|
] }),
|
|
@@ -826,7 +889,13 @@ function pe({ item: a, onHover: h }) {
|
|
|
826
889
|
return m ? x.isValidElement(m) ? x.cloneElement(m, {
|
|
827
890
|
className: "mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary",
|
|
828
891
|
"aria-hidden": !0
|
|
829
|
-
}) : typeof m == "function" ? /* @__PURE__ */ e(
|
|
892
|
+
}) : typeof m == "function" ? /* @__PURE__ */ e(
|
|
893
|
+
m,
|
|
894
|
+
{
|
|
895
|
+
"aria-hidden": !0,
|
|
896
|
+
className: "mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"
|
|
897
|
+
}
|
|
898
|
+
) : null : /* @__PURE__ */ e(F, { className: "mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary" });
|
|
830
899
|
})(),
|
|
831
900
|
/* @__PURE__ */ e("span", { children: c.title })
|
|
832
901
|
]
|
|
@@ -843,7 +912,13 @@ function pe({ item: a, onHover: h }) {
|
|
|
843
912
|
return m ? x.isValidElement(m) ? x.cloneElement(m, {
|
|
844
913
|
className: "mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary",
|
|
845
914
|
"aria-hidden": !0
|
|
846
|
-
}) : typeof m == "function" ? /* @__PURE__ */ e(
|
|
915
|
+
}) : typeof m == "function" ? /* @__PURE__ */ e(
|
|
916
|
+
m,
|
|
917
|
+
{
|
|
918
|
+
"aria-hidden": !0,
|
|
919
|
+
className: "mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary"
|
|
920
|
+
}
|
|
921
|
+
) : null : /* @__PURE__ */ e(F, { className: "mr-2 h-5 w-5 text-gray-500 transition-all duration-300 group-hover:mr-3 group-hover:text-primary" });
|
|
847
922
|
})(),
|
|
848
923
|
/* @__PURE__ */ e("span", { children: c.title })
|
|
849
924
|
]
|
|
@@ -857,7 +932,12 @@ function pe({ item: a, onHover: h }) {
|
|
|
857
932
|
);
|
|
858
933
|
} });
|
|
859
934
|
}
|
|
860
|
-
function ye({
|
|
935
|
+
function ye({
|
|
936
|
+
config: a,
|
|
937
|
+
onScrolledChange: h,
|
|
938
|
+
scrollThreshold: s = 10,
|
|
939
|
+
quickSearchResults: u = []
|
|
940
|
+
}) {
|
|
861
941
|
const [i, n] = N(!1), [c, m] = N(!1), [y, b] = N(!1), [S, M] = N("");
|
|
862
942
|
return Q(() => {
|
|
863
943
|
typeof (a == null ? void 0 : a.onSearchOpenChange) == "function" && a.onSearchOpenChange(y), y || (M(""), typeof (a == null ? void 0 : a.onClearQuickResults) == "function" && a.onClearQuickResults());
|
|
@@ -885,7 +965,19 @@ function ye({ config: a, onScrolledChange: h, scrollThreshold: s = 10, quickSear
|
|
|
885
965
|
src: a.logo,
|
|
886
966
|
className: `w-auto transition-all duration-300 ${c ? "h-8 md:h-14" : "h-12 md:h-20"}`
|
|
887
967
|
}
|
|
888
|
-
) : /* @__PURE__ */ e(
|
|
968
|
+
) : /* @__PURE__ */ e(
|
|
969
|
+
"div",
|
|
970
|
+
{
|
|
971
|
+
className: `h-auto transition-all duration-300 ${c ? "w-28" : "w-32"}`,
|
|
972
|
+
children: /* @__PURE__ */ e(
|
|
973
|
+
"h1",
|
|
974
|
+
{
|
|
975
|
+
className: `transition-all duration-300 ${c ? "text-xl" : "text-2xl"}`,
|
|
976
|
+
children: a.fallbackText || "<NovaNav>"
|
|
977
|
+
}
|
|
978
|
+
)
|
|
979
|
+
}
|
|
980
|
+
) }) }),
|
|
889
981
|
/* @__PURE__ */ e("div", { className: "flex lg:hidden", children: /* @__PURE__ */ t(
|
|
890
982
|
"button",
|
|
891
983
|
{
|
|
@@ -900,7 +992,28 @@ function ye({ config: a, onScrolledChange: h, scrollThreshold: s = 10, quickSear
|
|
|
900
992
|
) }),
|
|
901
993
|
/* @__PURE__ */ e(G, { className: "hidden lg:flex lg:gap-x-12", children: a.menuItems.map((r) => {
|
|
902
994
|
const d = r.type || (r.full ? "full" : "default");
|
|
903
|
-
return r.subMenu ? d === "full" ? /* @__PURE__ */ e(
|
|
995
|
+
return r.subMenu ? d === "full" ? /* @__PURE__ */ e(
|
|
996
|
+
fe,
|
|
997
|
+
{
|
|
998
|
+
item: r,
|
|
999
|
+
onHover: r.onHover
|
|
1000
|
+
},
|
|
1001
|
+
r.id || r.title
|
|
1002
|
+
) : d === "simple" ? /* @__PURE__ */ e(
|
|
1003
|
+
pe,
|
|
1004
|
+
{
|
|
1005
|
+
item: r,
|
|
1006
|
+
onHover: r.onHover
|
|
1007
|
+
},
|
|
1008
|
+
r.id || r.title
|
|
1009
|
+
) : /* @__PURE__ */ e(
|
|
1010
|
+
xe,
|
|
1011
|
+
{
|
|
1012
|
+
item: r,
|
|
1013
|
+
onHover: r.onHover
|
|
1014
|
+
},
|
|
1015
|
+
r.id || r.title
|
|
1016
|
+
) : r.useLink ? /* @__PURE__ */ e(
|
|
904
1017
|
k,
|
|
905
1018
|
{
|
|
906
1019
|
href: r.href,
|
|
@@ -1008,7 +1121,20 @@ function ye({ config: a, onScrolledChange: h, scrollThreshold: s = 10, quickSear
|
|
|
1008
1121
|
Array.isArray(u) && u.length > 0 && /* @__PURE__ */ e("div", { className: "mt-4 divide-y divide-gray-200", children: u.map((r, d) => {
|
|
1009
1122
|
if (!r || typeof r != "object") return null;
|
|
1010
1123
|
const g = r.title || r.q || r.name || "Result", v = r.desc || r.description || r.summary || r.a || "", o = typeof (a == null ? void 0 : a.searchTitleMax) == "number" ? a.searchTitleMax : 60, E = typeof (a == null ? void 0 : a.searchDescMax) == "number" ? a.searchDescMax : 100, A = typeof g == "string" && g.length > o ? `${g.slice(0, o - 1)}…` : g, L = typeof v == "string" && v.length > E ? `${v.slice(0, E - 1)}…` : v, l = typeof r.link == "string" ? r.link : void 0, f = typeof l == "string" && l.startsWith("/"), O = /* @__PURE__ */ t("div", { className: "flex items-start gap-3 py-3", children: [
|
|
1011
|
-
r != null && r.icon ? /* @__PURE__ */ e("div", { className: "mt-0.5 h-6 w-6 text-gray-500", children: r.icon }) : r != null && r.image ? /* @__PURE__ */ e(
|
|
1124
|
+
r != null && r.icon ? /* @__PURE__ */ e("div", { className: "mt-0.5 h-6 w-6 text-gray-500", children: r.icon }) : r != null && r.image ? /* @__PURE__ */ e(
|
|
1125
|
+
"img",
|
|
1126
|
+
{
|
|
1127
|
+
src: r.image,
|
|
1128
|
+
alt: g,
|
|
1129
|
+
className: "mt-0.5 h-6 w-6 rounded object-cover"
|
|
1130
|
+
}
|
|
1131
|
+
) : /* @__PURE__ */ e(
|
|
1132
|
+
q,
|
|
1133
|
+
{
|
|
1134
|
+
"aria-hidden": "true",
|
|
1135
|
+
className: "mt-0.5 size-6 text-gray-400"
|
|
1136
|
+
}
|
|
1137
|
+
),
|
|
1012
1138
|
/* @__PURE__ */ t("div", { children: [
|
|
1013
1139
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-gray-900 truncate", children: A }),
|
|
1014
1140
|
L ? /* @__PURE__ */ e("div", { className: "text-sm text-gray-500 truncate", children: L }) : null
|
package/package.json
CHANGED