@telia/teddy 0.1.32 → 0.1.33
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.
|
@@ -410,7 +410,10 @@ const TopMenuTrigger = React.forwardRef(
|
|
|
410
410
|
const context = React.useContext(NavigationMenuContext);
|
|
411
411
|
const innerRef = React.useRef(null);
|
|
412
412
|
const ref = utils_composeRefs.useComposedRefs(innerRef, forwardRef);
|
|
413
|
-
|
|
413
|
+
let isOpen = context.selectedTopMenu === props.value && props.value !== null && props.value !== "" && typeof props.value !== "undefined";
|
|
414
|
+
if (typeof window === "undefined") {
|
|
415
|
+
isOpen = false;
|
|
416
|
+
}
|
|
414
417
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
415
418
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
416
419
|
Comp,
|
|
@@ -539,6 +542,9 @@ const Trigger = React.forwardRef(
|
|
|
539
542
|
);
|
|
540
543
|
const innerRef = React.useRef(null);
|
|
541
544
|
const ref = utils_composeRefs.useComposedRefs(forwardRef, innerRef);
|
|
545
|
+
if (typeof window === "undefined") {
|
|
546
|
+
active = false;
|
|
547
|
+
}
|
|
542
548
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
543
549
|
NavigationMenuPrimitive__namespace.Trigger,
|
|
544
550
|
{
|
|
@@ -854,14 +860,6 @@ const ShoppingCart = React.forwardRef(() => {
|
|
|
854
860
|
] });
|
|
855
861
|
});
|
|
856
862
|
ShoppingCart.displayName = "ShoppingCart";
|
|
857
|
-
let hasUsedInitialLoadingState = false;
|
|
858
|
-
const getInitialLoadingState = () => {
|
|
859
|
-
if (hasUsedInitialLoadingState) {
|
|
860
|
-
return null;
|
|
861
|
-
}
|
|
862
|
-
hasUsedInitialLoadingState = true;
|
|
863
|
-
return typeof window === "undefined" ? "open" : "closed";
|
|
864
|
-
};
|
|
865
863
|
const Desktop = React.forwardRef(() => {
|
|
866
864
|
const rootContext = React.useContext(RootContext);
|
|
867
865
|
const lastScrollDirection = React.useRef();
|
|
@@ -891,7 +889,6 @@ const Desktop = React.forwardRef(() => {
|
|
|
891
889
|
setSelectedMenuItem(linkName || "", true);
|
|
892
890
|
};
|
|
893
891
|
const viewPortHeight = showMenu && shouldShowViewport ? "293px" : void 0;
|
|
894
|
-
const initialLoadingState = getInitialLoadingState();
|
|
895
892
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
896
893
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles[`${rootClassName}__top-menu-color`], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
897
894
|
"div",
|
|
@@ -984,7 +981,7 @@ const Desktop = React.forwardRef(() => {
|
|
|
984
981
|
{
|
|
985
982
|
onFocus: resetAndShowMenu,
|
|
986
983
|
ref: viewPortRef,
|
|
987
|
-
...
|
|
984
|
+
...typeof window === "undefined" ? { "data-state": "closed" } : {},
|
|
988
985
|
className: styles[`${rootClassName}__viewport`]
|
|
989
986
|
}
|
|
990
987
|
)
|
|
@@ -389,7 +389,10 @@ const TopMenuTrigger = React__default.forwardRef(
|
|
|
389
389
|
const context = React__default.useContext(NavigationMenuContext);
|
|
390
390
|
const innerRef = React__default.useRef(null);
|
|
391
391
|
const ref = useComposedRefs(innerRef, forwardRef);
|
|
392
|
-
|
|
392
|
+
let isOpen = context.selectedTopMenu === props.value && props.value !== null && props.value !== "" && typeof props.value !== "undefined";
|
|
393
|
+
if (typeof window === "undefined") {
|
|
394
|
+
isOpen = false;
|
|
395
|
+
}
|
|
393
396
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
394
397
|
/* @__PURE__ */ jsx(
|
|
395
398
|
Comp,
|
|
@@ -518,6 +521,9 @@ const Trigger = React__default.forwardRef(
|
|
|
518
521
|
);
|
|
519
522
|
const innerRef = React__default.useRef(null);
|
|
520
523
|
const ref = useComposedRefs(forwardRef, innerRef);
|
|
524
|
+
if (typeof window === "undefined") {
|
|
525
|
+
active = false;
|
|
526
|
+
}
|
|
521
527
|
return /* @__PURE__ */ jsx(
|
|
522
528
|
NavigationMenuPrimitive.Trigger,
|
|
523
529
|
{
|
|
@@ -833,14 +839,6 @@ const ShoppingCart = React__default.forwardRef(() => {
|
|
|
833
839
|
] });
|
|
834
840
|
});
|
|
835
841
|
ShoppingCart.displayName = "ShoppingCart";
|
|
836
|
-
let hasUsedInitialLoadingState = false;
|
|
837
|
-
const getInitialLoadingState = () => {
|
|
838
|
-
if (hasUsedInitialLoadingState) {
|
|
839
|
-
return null;
|
|
840
|
-
}
|
|
841
|
-
hasUsedInitialLoadingState = true;
|
|
842
|
-
return typeof window === "undefined" ? "open" : "closed";
|
|
843
|
-
};
|
|
844
842
|
const Desktop = React__default.forwardRef(() => {
|
|
845
843
|
const rootContext = React__default.useContext(RootContext);
|
|
846
844
|
const lastScrollDirection = React__default.useRef();
|
|
@@ -870,7 +868,6 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
870
868
|
setSelectedMenuItem(linkName || "", true);
|
|
871
869
|
};
|
|
872
870
|
const viewPortHeight = showMenu && shouldShowViewport ? "293px" : void 0;
|
|
873
|
-
const initialLoadingState = getInitialLoadingState();
|
|
874
871
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
875
872
|
/* @__PURE__ */ jsx("div", { className: styles[`${rootClassName}__top-menu-color`], children: /* @__PURE__ */ jsx(
|
|
876
873
|
"div",
|
|
@@ -963,7 +960,7 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
963
960
|
{
|
|
964
961
|
onFocus: resetAndShowMenu,
|
|
965
962
|
ref: viewPortRef,
|
|
966
|
-
...
|
|
963
|
+
...typeof window === "undefined" ? { "data-state": "closed" } : {},
|
|
967
964
|
className: styles[`${rootClassName}__viewport`]
|
|
968
965
|
}
|
|
969
966
|
)
|