@telia/teddy 0.1.33 → 0.1.35
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,10 +410,7 @@ 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
|
-
|
|
414
|
-
if (typeof window === "undefined") {
|
|
415
|
-
isOpen = false;
|
|
416
|
-
}
|
|
413
|
+
const isOpen = context.selectedTopMenu === props.value;
|
|
417
414
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
418
415
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
419
416
|
Comp,
|
|
@@ -542,9 +539,6 @@ const Trigger = React.forwardRef(
|
|
|
542
539
|
);
|
|
543
540
|
const innerRef = React.useRef(null);
|
|
544
541
|
const ref = utils_composeRefs.useComposedRefs(forwardRef, innerRef);
|
|
545
|
-
if (typeof window === "undefined") {
|
|
546
|
-
active = false;
|
|
547
|
-
}
|
|
548
542
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
549
543
|
NavigationMenuPrimitive__namespace.Trigger,
|
|
550
544
|
{
|
|
@@ -955,7 +949,7 @@ const Desktop = React.forwardRef(() => {
|
|
|
955
949
|
children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), href: subLink.link, children: subLink.name })
|
|
956
950
|
}
|
|
957
951
|
),
|
|
958
|
-
/* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Content, { children: !!specifiedLink && subLink.name === specifiedLink && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
952
|
+
typeof window !== "undefined" && /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Content, { children: !!specifiedLink && subLink.name === specifiedLink && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
959
953
|
((_b = subLink.links) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { direction: "column", pt: "400", pl: "150", children: /* @__PURE__ */ jsxRuntime.jsx(HightlightedLinksDesktop, { listName: subLink.name, links: subLink.links }) }),
|
|
960
954
|
((_c = subLink.highlightedLinks) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { direction: "column", pt: "400", pl: "400", pr: "400", pb: "250", className: styles[`${rootClassName}__colored-box`], children: /* @__PURE__ */ jsxRuntime.jsx(HightlightedLinksDesktop, { listName: "Nyttige snarveier", links: subLink.highlightedLinks }) })
|
|
961
955
|
] }) })
|
|
@@ -981,7 +975,6 @@ const Desktop = React.forwardRef(() => {
|
|
|
981
975
|
{
|
|
982
976
|
onFocus: resetAndShowMenu,
|
|
983
977
|
ref: viewPortRef,
|
|
984
|
-
...typeof window === "undefined" ? { "data-state": "closed" } : {},
|
|
985
978
|
className: styles[`${rootClassName}__viewport`]
|
|
986
979
|
}
|
|
987
980
|
)
|
|
@@ -389,10 +389,7 @@ 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
|
-
|
|
393
|
-
if (typeof window === "undefined") {
|
|
394
|
-
isOpen = false;
|
|
395
|
-
}
|
|
392
|
+
const isOpen = context.selectedTopMenu === props.value;
|
|
396
393
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
397
394
|
/* @__PURE__ */ jsx(
|
|
398
395
|
Comp,
|
|
@@ -521,9 +518,6 @@ const Trigger = React__default.forwardRef(
|
|
|
521
518
|
);
|
|
522
519
|
const innerRef = React__default.useRef(null);
|
|
523
520
|
const ref = useComposedRefs(forwardRef, innerRef);
|
|
524
|
-
if (typeof window === "undefined") {
|
|
525
|
-
active = false;
|
|
526
|
-
}
|
|
527
521
|
return /* @__PURE__ */ jsx(
|
|
528
522
|
NavigationMenuPrimitive.Trigger,
|
|
529
523
|
{
|
|
@@ -934,7 +928,7 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
934
928
|
children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsx("a", { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), href: subLink.link, children: subLink.name })
|
|
935
929
|
}
|
|
936
930
|
),
|
|
937
|
-
/* @__PURE__ */ jsx(NavigationMenu.Content, { children: !!specifiedLink && subLink.name === specifiedLink && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
931
|
+
typeof window !== "undefined" && /* @__PURE__ */ jsx(NavigationMenu.Content, { children: !!specifiedLink && subLink.name === specifiedLink && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
938
932
|
((_b = subLink.links) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */ jsx(Flex, { direction: "column", pt: "400", pl: "150", children: /* @__PURE__ */ jsx(HightlightedLinksDesktop, { listName: subLink.name, links: subLink.links }) }),
|
|
939
933
|
((_c = subLink.highlightedLinks) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsx(Flex, { direction: "column", pt: "400", pl: "400", pr: "400", pb: "250", className: styles[`${rootClassName}__colored-box`], children: /* @__PURE__ */ jsx(HightlightedLinksDesktop, { listName: "Nyttige snarveier", links: subLink.highlightedLinks }) })
|
|
940
934
|
] }) })
|
|
@@ -960,7 +954,6 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
960
954
|
{
|
|
961
955
|
onFocus: resetAndShowMenu,
|
|
962
956
|
ref: viewPortRef,
|
|
963
|
-
...typeof window === "undefined" ? { "data-state": "closed" } : {},
|
|
964
957
|
className: styles[`${rootClassName}__viewport`]
|
|
965
958
|
}
|
|
966
959
|
)
|