@telia/teddy 0.1.31 → 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
|
{
|
|
@@ -975,7 +981,7 @@ const Desktop = React.forwardRef(() => {
|
|
|
975
981
|
{
|
|
976
982
|
onFocus: resetAndShowMenu,
|
|
977
983
|
ref: viewPortRef,
|
|
978
|
-
"data-state":
|
|
984
|
+
...typeof window === "undefined" ? { "data-state": "closed" } : {},
|
|
979
985
|
className: styles[`${rootClassName}__viewport`]
|
|
980
986
|
}
|
|
981
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
|
{
|
|
@@ -954,7 +960,7 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
954
960
|
{
|
|
955
961
|
onFocus: resetAndShowMenu,
|
|
956
962
|
ref: viewPortRef,
|
|
957
|
-
"data-state":
|
|
963
|
+
...typeof window === "undefined" ? { "data-state": "closed" } : {},
|
|
958
964
|
className: styles[`${rootClassName}__viewport`]
|
|
959
965
|
}
|
|
960
966
|
)
|