@telia/teddy 0.1.23 → 0.1.25
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/navigation-menu/global-navigation/global-navigation-desktop.cjs +0 -2
- package/dist/components/navigation-menu/global-navigation/global-navigation-desktop.js +0 -2
- package/dist/components/navigation-menu/global-navigation/global-navigation-root.d.ts +3 -2
- package/dist/components/navigation-menu/global-navigation/utils.cjs +5 -21
- package/dist/components/navigation-menu/global-navigation/utils.d.ts +10 -10
- package/dist/components/navigation-menu/global-navigation/utils.js +5 -21
- package/dist/components/radio-card-group/radio-card-group-item-title.cjs +65 -122
- package/dist/components/radio-card-group/radio-card-group-item-title.js +65 -122
- package/dist/components/tabs/tabs-root.cjs +5 -5
- package/dist/components/tabs/tabs-root.js +5 -5
- package/dist/style.css +121 -227
- package/package.json +1 -1
|
@@ -63,7 +63,6 @@ import { Indicator as Indicator$1 } from "./radio-card-group-indicator.js";
|
|
|
63
63
|
import { Body } from "./radio-card-group-item-body.js";
|
|
64
64
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
65
65
|
import { useSize } from "../../utils/useSize.js";
|
|
66
|
-
import { useCallbackRef } from "../../utils/useCallbackRef.js";
|
|
67
66
|
const Title$1 = React__default.forwardRef(
|
|
68
67
|
({ className, children, asChild, ...props }, forwardRef) => {
|
|
69
68
|
const classes = clsx([styles$3[`${rootClassName$3}__title`]], className);
|
|
@@ -261,34 +260,22 @@ const Close = React__default.forwardRef(
|
|
|
261
260
|
);
|
|
262
261
|
Close.displayName = "Dialog.Close";
|
|
263
262
|
const Modal = Object.assign(Root$2, { Trigger: Trigger$1, Content: Content$1, Title, Overlay, Description, Close, Image, Group });
|
|
264
|
-
const scaleIn = "_scaleIn_gpawj_1";
|
|
265
|
-
const scaleOut = "_scaleOut_gpawj_1";
|
|
266
|
-
const enterFromRight = "_enterFromRight_gpawj_1";
|
|
267
|
-
const enterFromLeft = "_enterFromLeft_gpawj_1";
|
|
268
|
-
const exitToRight = "_exitToRight_gpawj_1";
|
|
269
|
-
const exitToLeft = "_exitToLeft_gpawj_1";
|
|
270
263
|
const styles$1 = {
|
|
271
|
-
"teddy-navigation-menu": "_teddy-navigation-
|
|
272
|
-
"teddy-navigation-menu__viewport": "_teddy-navigation-
|
|
273
|
-
"teddy-navigation-menu__separator": "_teddy-navigation-
|
|
274
|
-
"teddy-navigation-menu__list": "_teddy-navigation-
|
|
275
|
-
"teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-
|
|
276
|
-
"teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-
|
|
277
|
-
"teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--
|
|
278
|
-
"teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--
|
|
279
|
-
"teddy-navigation-menu__content": "_teddy-navigation-
|
|
280
|
-
"teddy-navigation-menu__trigger": "_teddy-navigation-
|
|
281
|
-
"teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--
|
|
282
|
-
"teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--
|
|
283
|
-
"teddy-navigation-menu__link": "_teddy-navigation-
|
|
284
|
-
"teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--
|
|
285
|
-
"teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--
|
|
286
|
-
scaleIn,
|
|
287
|
-
scaleOut,
|
|
288
|
-
enterFromRight,
|
|
289
|
-
enterFromLeft,
|
|
290
|
-
exitToRight,
|
|
291
|
-
exitToLeft
|
|
264
|
+
"teddy-navigation-menu": "_teddy-navigation-menu_6p30v_1",
|
|
265
|
+
"teddy-navigation-menu__viewport": "_teddy-navigation-menu__viewport_6p30v_34",
|
|
266
|
+
"teddy-navigation-menu__separator": "_teddy-navigation-menu__separator_6p30v_37",
|
|
267
|
+
"teddy-navigation-menu__list": "_teddy-navigation-menu__list_6p30v_40",
|
|
268
|
+
"teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-list_6p30v_66",
|
|
269
|
+
"teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-trigger_6p30v_87",
|
|
270
|
+
"teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--small_6p30v_106",
|
|
271
|
+
"teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--button_6p30v_112",
|
|
272
|
+
"teddy-navigation-menu__content": "_teddy-navigation-menu__content_6p30v_187",
|
|
273
|
+
"teddy-navigation-menu__trigger": "_teddy-navigation-menu__trigger_6p30v_219",
|
|
274
|
+
"teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--small_6p30v_239",
|
|
275
|
+
"teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--button_6p30v_245",
|
|
276
|
+
"teddy-navigation-menu__link": "_teddy-navigation-menu__link_6p30v_313",
|
|
277
|
+
"teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--small_6p30v_333",
|
|
278
|
+
"teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--button_6p30v_339"
|
|
292
279
|
};
|
|
293
280
|
const rootClassName$1 = "teddy-navigation-menu";
|
|
294
281
|
const NavigationMenuContext = React__default.createContext({
|
|
@@ -534,9 +521,6 @@ const Trigger = React__default.forwardRef(
|
|
|
534
521
|
return /* @__PURE__ */ jsx(
|
|
535
522
|
NavigationMenuPrimitive.Trigger,
|
|
536
523
|
{
|
|
537
|
-
onPointerEnter: (e) => e.preventDefault(),
|
|
538
|
-
onPointerMove: (e) => e.preventDefault(),
|
|
539
|
-
onPointerLeave: (e) => e.preventDefault(),
|
|
540
524
|
...props,
|
|
541
525
|
ref,
|
|
542
526
|
"data-active": active ? "true" : void 0,
|
|
@@ -557,8 +541,6 @@ const Content = React__default.forwardRef(
|
|
|
557
541
|
return /* @__PURE__ */ jsx(
|
|
558
542
|
NavigationMenuPrimitive.Content,
|
|
559
543
|
{
|
|
560
|
-
onPointerEnter: (e) => e.preventDefault(),
|
|
561
|
-
onPointerLeave: (e) => e.preventDefault(),
|
|
562
544
|
...props,
|
|
563
545
|
ref: forwardRef,
|
|
564
546
|
className: classes
|
|
@@ -678,27 +660,22 @@ const NavigationMenu = Object.assign(Root$1, {
|
|
|
678
660
|
TopMenuTrigger
|
|
679
661
|
});
|
|
680
662
|
const styles = {
|
|
681
|
-
"teddy-global-navigation": "_teddy-global-
|
|
682
|
-
"teddy-global-navigation__mobile
|
|
683
|
-
"teddy-global-
|
|
684
|
-
"teddy-global-
|
|
685
|
-
"teddy-global-
|
|
686
|
-
"teddy-global-
|
|
687
|
-
"teddy-global-
|
|
688
|
-
"teddy-global-
|
|
689
|
-
"teddy-global-
|
|
690
|
-
"teddy-global-
|
|
691
|
-
"teddy-global-
|
|
692
|
-
"teddy-global-
|
|
693
|
-
"teddy-global-
|
|
694
|
-
"teddy-global-
|
|
695
|
-
"teddy-global-
|
|
696
|
-
"teddy-global-
|
|
697
|
-
"close-viewport": "_close-viewport_1i7an_1",
|
|
698
|
-
"teddy-global-navigation__top-menu-color": "_teddy-global-navigation__top-menu-color_1i7an_97",
|
|
699
|
-
"teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_1i7an_100",
|
|
700
|
-
"teddy-global-navigation__accordion-look": "_teddy-global-navigation__accordion-look_1i7an_117",
|
|
701
|
-
"teddy-global-navigation__mobile-link--accordion-look": "_teddy-global-navigation__mobile-link--accordion-look_1i7an_133"
|
|
663
|
+
"teddy-global-navigation": "_teddy-global-navigation_19q4u_1",
|
|
664
|
+
"teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_19q4u_6",
|
|
665
|
+
"teddy-global-navigation__top-icon-wrapper": "_teddy-global-navigation__top-icon-wrapper_19q4u_26",
|
|
666
|
+
"teddy-global-navigation__top-menu-icons": "_teddy-global-navigation__top-menu-icons_19q4u_31",
|
|
667
|
+
"teddy-global-navigation__link": "_teddy-global-navigation__link_19q4u_35",
|
|
668
|
+
"teddy-global-navigation__header": "_teddy-global-navigation__header_19q4u_48",
|
|
669
|
+
"teddy-global-navigation__colored-box": "_teddy-global-navigation__colored-box_19q4u_51",
|
|
670
|
+
"teddy-global-navigation__colored-box--mobile": "_teddy-global-navigation__colored-box--mobile_19q4u_54",
|
|
671
|
+
"teddy-global-navigation__sublink-button--mobile": "_teddy-global-navigation__sublink-button--mobile_19q4u_58",
|
|
672
|
+
"teddy-global-navigation__list": "_teddy-global-navigation__list_19q4u_64",
|
|
673
|
+
"teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_19q4u_69",
|
|
674
|
+
"teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_19q4u_72",
|
|
675
|
+
"teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_19q4u_76",
|
|
676
|
+
"teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_19q4u_83",
|
|
677
|
+
"teddy-global-navigation__top-menu-color": "_teddy-global-navigation__top-menu-color_19q4u_98",
|
|
678
|
+
"teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_19q4u_101"
|
|
702
679
|
};
|
|
703
680
|
function MyPages(props) {
|
|
704
681
|
var _a, _b;
|
|
@@ -800,6 +777,7 @@ const SearchField = React__default.forwardRef(
|
|
|
800
777
|
SearchField.displayName = "SearchField";
|
|
801
778
|
function Search(props) {
|
|
802
779
|
const rootContext = React__default.useContext(RootContext);
|
|
780
|
+
const additionalSearchContent = rootContext == null ? void 0 : rootContext.additionalSearchContent;
|
|
803
781
|
const searchFieldRef = React__default.useRef(null);
|
|
804
782
|
return /* @__PURE__ */ jsxs(Drawer, { ...props, children: [
|
|
805
783
|
/* @__PURE__ */ jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: /* @__PURE__ */ jsx(Drawer.Trigger, { children: /* @__PURE__ */ jsxs("button", { children: [
|
|
@@ -819,6 +797,7 @@ function Search(props) {
|
|
|
819
797
|
/* @__PURE__ */ jsx(Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
|
|
820
798
|
/* @__PURE__ */ jsx(Drawer.Title, { children: "Hva leter du etter?" }),
|
|
821
799
|
/* @__PURE__ */ jsx(SearchField, { ref: searchFieldRef }),
|
|
800
|
+
additionalSearchContent ? additionalSearchContent : null,
|
|
822
801
|
/* @__PURE__ */ jsx(Drawer.Footer, { children: /* @__PURE__ */ jsx(Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", children: "Lukk" }) }) })
|
|
823
802
|
]
|
|
824
803
|
}
|
|
@@ -864,38 +843,13 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
864
843
|
(link) => {
|
|
865
844
|
const highlightedLinkSelected = [...link.highlightedLinks].some((highlightedLink) => highlightedLink.link === (rootContext == null ? void 0 : rootContext.pathname));
|
|
866
845
|
const linkSelected = [...link.links].some((subLink) => subLink.link === (rootContext == null ? void 0 : rootContext.pathname));
|
|
867
|
-
|
|
846
|
+
const sameParent = link.link.split("/")[1] === (rootContext == null ? void 0 : rootContext.pathname.split("/")[1]) || !link.link && (rootContext == null ? void 0 : rootContext.pathname) === "/";
|
|
847
|
+
return linkSelected || highlightedLinkSelected || link.links.length && link.name === (rootContext == null ? void 0 : rootContext.specifiedLink) && sameParent;
|
|
868
848
|
}
|
|
869
849
|
);
|
|
870
850
|
const topMenuSize = useSize(topMenuRef.current);
|
|
871
851
|
const topMenuHeight = (topMenuSize == null ? void 0 : topMenuSize.height) ? `${topMenuSize.height}px` : void 0;
|
|
872
|
-
const viewPortHeight = shouldShowViewport ? "
|
|
873
|
-
const [allowAnimationOfHeight, setAllowAnimationOfHeight] = React__default.useState(false);
|
|
874
|
-
const timerRef = React__default.useRef(void 0);
|
|
875
|
-
React__default.useEffect(() => {
|
|
876
|
-
timerRef.current = setTimeout(() => {
|
|
877
|
-
setAllowAnimationOfHeight(true);
|
|
878
|
-
}, 500);
|
|
879
|
-
return () => {
|
|
880
|
-
timerRef.current && clearTimeout(timerRef.current);
|
|
881
|
-
};
|
|
882
|
-
}, []);
|
|
883
|
-
const handleScroll = () => {
|
|
884
|
-
const scrollY = window.scrollY;
|
|
885
|
-
const scrollDirection = scrollY > lastScrollPos.current ? "down" : "up";
|
|
886
|
-
if (scrollDirection !== lastScrollDirection.current) {
|
|
887
|
-
scrollStartPos.current = scrollY;
|
|
888
|
-
}
|
|
889
|
-
lastScrollDirection.current = scrollDirection;
|
|
890
|
-
lastScrollPos.current = scrollY;
|
|
891
|
-
};
|
|
892
|
-
const throttledScrollHandler = useDebounceCallback(handleScroll, 5);
|
|
893
|
-
React__default.useEffect(() => {
|
|
894
|
-
window.addEventListener("scroll", throttledScrollHandler);
|
|
895
|
-
return () => {
|
|
896
|
-
window.removeEventListener("scroll", throttledScrollHandler);
|
|
897
|
-
};
|
|
898
|
-
}, [throttledScrollHandler]);
|
|
852
|
+
const viewPortHeight = shouldShowViewport ? "293px" : void 0;
|
|
899
853
|
if (!rootContext)
|
|
900
854
|
return null;
|
|
901
855
|
function resetAndShowMenu() {
|
|
@@ -905,13 +859,16 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
905
859
|
}
|
|
906
860
|
const { hideMenu, selectedMenuItem, setSelectedMenuItem, linkComponent: Link2, specifiedLink, setSpecifiedLink } = rootContext;
|
|
907
861
|
const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
|
|
862
|
+
const handleInteractions = (linkName) => {
|
|
863
|
+
setSpecifiedLink(linkName || "");
|
|
864
|
+
setSelectedMenuItem(linkName || "", true);
|
|
865
|
+
};
|
|
908
866
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
909
867
|
/* @__PURE__ */ jsx("div", { className: styles[`${rootClassName}__top-menu-color`], children: /* @__PURE__ */ jsx(
|
|
910
868
|
"div",
|
|
911
869
|
{
|
|
912
870
|
style: mergeStyles(
|
|
913
|
-
{ ["--teddy-top-menu-height"]: topMenuHeight }
|
|
914
|
-
allowAnimationOfHeight ? { ["--teddy-motion-duration-controlled"]: teddyMotionDuration300 } : {}
|
|
871
|
+
{ ["--teddy-top-menu-height"]: topMenuHeight }
|
|
915
872
|
),
|
|
916
873
|
className: styles[`${rootClassName}__top-menu-wrapper`],
|
|
917
874
|
children: /* @__PURE__ */ jsx(NavigationMenu.TopMenuList, { onFocus: resetAndShowMenu, ref: topMenuRef, children: LINKS.map((link) => /* @__PURE__ */ jsx(NavigationMenu.TopMenuItem, { children: /* @__PURE__ */ jsx(
|
|
@@ -935,52 +892,46 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
935
892
|
(subLink) => {
|
|
936
893
|
var _a2, _b, _c;
|
|
937
894
|
return /* @__PURE__ */ jsxs(NavigationMenu.Item, { value: subLink.name, children: [
|
|
938
|
-
subLink.name === "Logo" ? /* @__PURE__ */ jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: subLink.link, onClick: () =>
|
|
939
|
-
setSelectedMenuItem("", true);
|
|
940
|
-
setSpecifiedLink("");
|
|
941
|
-
}, children: /* @__PURE__ */ jsx(
|
|
895
|
+
subLink.name === "Logo" ? /* @__PURE__ */ jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: subLink.link, onMouseEnter: () => handleInteractions(), onClick: () => handleInteractions(), children: /* @__PURE__ */ jsx(
|
|
942
896
|
"img",
|
|
943
897
|
{
|
|
944
898
|
src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
|
|
945
899
|
draggable: "false",
|
|
946
900
|
alt: "Telia logo"
|
|
947
901
|
}
|
|
948
|
-
) }) : /* @__PURE__ */ jsx(
|
|
949
|
-
|
|
950
|
-
setSpecifiedLink("");
|
|
951
|
-
}, children: /* @__PURE__ */ jsx(
|
|
952
|
-
"img",
|
|
902
|
+
) }) : /* @__PURE__ */ jsx(
|
|
903
|
+
"a",
|
|
953
904
|
{
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
905
|
+
href: subLink.link,
|
|
906
|
+
onMouseEnter: () => handleInteractions(),
|
|
907
|
+
onClick: () => handleInteractions(),
|
|
908
|
+
children: /* @__PURE__ */ jsx(
|
|
909
|
+
"img",
|
|
910
|
+
{
|
|
911
|
+
src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
|
|
912
|
+
draggable: "false",
|
|
913
|
+
alt: "Telia logo"
|
|
914
|
+
}
|
|
915
|
+
)
|
|
957
916
|
}
|
|
958
|
-
) })
|
|
917
|
+
) }) : ((_a2 = subLink.links) == null ? void 0 : _a2.length) ? /* @__PURE__ */ jsx(
|
|
959
918
|
NavigationMenu.Trigger,
|
|
960
919
|
{
|
|
961
920
|
asChild: true,
|
|
962
921
|
active: currentLocation === subLink.link,
|
|
963
|
-
onClick: () =>
|
|
964
|
-
setSpecifiedLink(subLink.name);
|
|
965
|
-
setSelectedMenuItem(subLink.name, true);
|
|
966
|
-
},
|
|
967
|
-
children: /* @__PURE__ */ jsx(Button, { children: subLink.name })
|
|
922
|
+
children: /* @__PURE__ */ jsx(Button, { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), children: subLink.name })
|
|
968
923
|
}
|
|
969
924
|
) : /* @__PURE__ */ jsx(
|
|
970
925
|
NavigationMenu.Link,
|
|
971
926
|
{
|
|
972
927
|
asChild: true,
|
|
973
928
|
active: selectedMenuItem === subLink.name && currentLocation === subLink.link,
|
|
974
|
-
onClick: () => {
|
|
975
|
-
setSpecifiedLink(subLink.name);
|
|
976
|
-
setSelectedMenuItem(subLink.name, true);
|
|
977
|
-
},
|
|
978
|
-
children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsx("a", { href: subLink.link, children: subLink.name })
|
|
929
|
+
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 })
|
|
979
930
|
}
|
|
980
931
|
),
|
|
981
932
|
/* @__PURE__ */ jsx(NavigationMenu.Content, { children: !!specifiedLink && subLink.name === specifiedLink && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
982
933
|
((_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 }) }),
|
|
983
|
-
((_c = subLink.highlightedLinks) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsx(Flex, { direction: "column", pt: "400", pl: "400", pr: "400", pb: "
|
|
934
|
+
((_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 }) })
|
|
984
935
|
] }) })
|
|
985
936
|
] }, subLink.name);
|
|
986
937
|
}
|
|
@@ -991,13 +942,11 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
991
942
|
/* @__PURE__ */ jsx(NavigationMenu.Item, { children: /* @__PURE__ */ jsx(MyPages, {}) })
|
|
992
943
|
] }, link.name);
|
|
993
944
|
}),
|
|
994
|
-
/* @__PURE__ */ jsx(NavigationMenu.Separator, {}),
|
|
995
945
|
/* @__PURE__ */ jsx(
|
|
996
946
|
"div",
|
|
997
947
|
{
|
|
998
948
|
style: mergeStyles(
|
|
999
|
-
{ ["--teddy-viewport-wrapper-height"]: viewPortHeight }
|
|
1000
|
-
allowAnimationOfHeight ? { ["--teddy-motion-duration-controlled"]: teddyMotionDuration300 } : {}
|
|
949
|
+
{ ["--teddy-viewport-wrapper-height"]: viewPortHeight }
|
|
1001
950
|
),
|
|
1002
951
|
className: styles[`${rootClassName}__viewport-wrapper`],
|
|
1003
952
|
"data-state": hideMenu === null ? "" : hideMenu ? "closed" : "open",
|
|
@@ -1014,20 +963,11 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
1014
963
|
] });
|
|
1015
964
|
});
|
|
1016
965
|
Desktop.displayName = "Desktop";
|
|
1017
|
-
function useDebounceCallback(callback, delay) {
|
|
1018
|
-
const handleCallback = useCallbackRef(callback);
|
|
1019
|
-
const debounceTimerRef = React__default.useRef(0);
|
|
1020
|
-
React__default.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
|
|
1021
|
-
return React__default.useCallback(() => {
|
|
1022
|
-
window.clearTimeout(debounceTimerRef.current);
|
|
1023
|
-
debounceTimerRef.current = window.setTimeout(handleCallback, delay);
|
|
1024
|
-
}, [handleCallback, delay]);
|
|
1025
|
-
}
|
|
1026
966
|
const HightlightedLinksDesktop = ({ links, listName }) => {
|
|
1027
967
|
const rootContext = React__default.useContext(RootContext);
|
|
1028
968
|
if (!rootContext)
|
|
1029
969
|
return null;
|
|
1030
|
-
const { linkComponent: Link2 } = rootContext;
|
|
970
|
+
const { linkComponent: Link2, setSpecifiedLink, setSelectedMenuItem } = rootContext;
|
|
1031
971
|
const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
|
|
1032
972
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1033
973
|
/* @__PURE__ */ jsx(Heading, { pl: "100", pb: "100", variant: "title-200", as: "h2", children: listName }),
|
|
@@ -1040,6 +980,8 @@ const HightlightedLinksDesktop = ({ links, listName }) => {
|
|
|
1040
980
|
active: getActiveSubLink(currentLocation, links || []) === subSubLink.link,
|
|
1041
981
|
onClick: () => {
|
|
1042
982
|
rootContext.setPathname(subSubLink.link);
|
|
983
|
+
setSpecifiedLink("");
|
|
984
|
+
setSelectedMenuItem("", true);
|
|
1043
985
|
},
|
|
1044
986
|
children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: subSubLink.link, children: /* @__PURE__ */ jsxs(Flex, { as: "span", gap: "100", align: "center", children: [
|
|
1045
987
|
subSubLink.name,
|
|
@@ -1078,7 +1020,6 @@ function Mobile(props) {
|
|
|
1078
1020
|
/* @__PURE__ */ jsx(Drawer.Close, { ref: drawerRef, slot: "floating", "aria-label": "Lukk" }),
|
|
1079
1021
|
!specifiedLink ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1080
1022
|
/* @__PURE__ */ jsx(Drawer.Title, { children: "Meny" }),
|
|
1081
|
-
/* @__PURE__ */ jsx(SearchField, {}),
|
|
1082
1023
|
/* @__PURE__ */ jsxs(
|
|
1083
1024
|
Tabs,
|
|
1084
1025
|
{
|
|
@@ -1224,6 +1165,7 @@ function Root({
|
|
|
1224
1165
|
shoppingCart,
|
|
1225
1166
|
shoppingCartNumberOfItems,
|
|
1226
1167
|
onSearchSubmit,
|
|
1168
|
+
additionalSearchContent,
|
|
1227
1169
|
isCartOpen,
|
|
1228
1170
|
onCartOpenChange,
|
|
1229
1171
|
drawerSize = "md",
|
|
@@ -1269,6 +1211,7 @@ function Root({
|
|
|
1269
1211
|
shoppingCart,
|
|
1270
1212
|
shoppingCartNumberOfItems,
|
|
1271
1213
|
onSearchSubmit,
|
|
1214
|
+
additionalSearchContent,
|
|
1272
1215
|
isCartOpen,
|
|
1273
1216
|
onCartOpenChange,
|
|
1274
1217
|
drawerSize,
|
|
@@ -24,11 +24,11 @@ function _interopNamespaceDefault(e) {
|
|
|
24
24
|
}
|
|
25
25
|
const TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
|
|
26
26
|
const styles = {
|
|
27
|
-
"teddy-tabs__list": "_teddy-
|
|
28
|
-
"teddy-tabs--full-width": "_teddy-tabs--full-
|
|
29
|
-
"teddy-tabs__content": "_teddy-
|
|
30
|
-
"teddy-tabs__trigger": "_teddy-
|
|
31
|
-
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-
|
|
27
|
+
"teddy-tabs__list": "_teddy-tabs__list_e9ndq_1",
|
|
28
|
+
"teddy-tabs--full-width": "_teddy-tabs--full-width_e9ndq_28",
|
|
29
|
+
"teddy-tabs__content": "_teddy-tabs__content_e9ndq_31",
|
|
30
|
+
"teddy-tabs__trigger": "_teddy-tabs__trigger_e9ndq_35",
|
|
31
|
+
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-button_e9ndq_56"
|
|
32
32
|
};
|
|
33
33
|
const rootClassName = "teddy-tabs";
|
|
34
34
|
const RootContext = React.createContext(void 0);
|
|
@@ -5,11 +5,11 @@ import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
|
5
5
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
6
6
|
import { composeEventHandlers } from "../../utils/composeEventHandlers.js";
|
|
7
7
|
const styles = {
|
|
8
|
-
"teddy-tabs__list": "_teddy-
|
|
9
|
-
"teddy-tabs--full-width": "_teddy-tabs--full-
|
|
10
|
-
"teddy-tabs__content": "_teddy-
|
|
11
|
-
"teddy-tabs__trigger": "_teddy-
|
|
12
|
-
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-
|
|
8
|
+
"teddy-tabs__list": "_teddy-tabs__list_e9ndq_1",
|
|
9
|
+
"teddy-tabs--full-width": "_teddy-tabs--full-width_e9ndq_28",
|
|
10
|
+
"teddy-tabs__content": "_teddy-tabs__content_e9ndq_31",
|
|
11
|
+
"teddy-tabs__trigger": "_teddy-tabs__trigger_e9ndq_35",
|
|
12
|
+
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-button_e9ndq_56"
|
|
13
13
|
};
|
|
14
14
|
const rootClassName = "teddy-tabs";
|
|
15
15
|
const RootContext = React__default.createContext(void 0);
|