@telia/teddy 0.1.29 → 0.1.31

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.
@@ -29,8 +29,8 @@ type RootContext = {
29
29
  setPathname: (v: string) => void;
30
30
  specifiedLink?: string;
31
31
  setSpecifiedLink: (v: string) => void;
32
- hideMenu?: boolean | null;
33
- setHideMenu: (v: boolean) => void;
32
+ showMenu?: boolean | null;
33
+ setShowMenu: (v: boolean) => void;
34
34
  } & Pick<RootProps, 'onSearchSubmit' | 'additionalSearchContent' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize'>;
35
35
  export declare const RootContext: React.Context<RootContext | null>;
36
36
  export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, additionalSearchContent, isCartOpen, onCartOpenChange, drawerSize, isSimplified, currentPath, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
@@ -62,7 +62,7 @@ const BUSINESS_NET_LINKS = {
62
62
  icon: "doc"
63
63
  };
64
64
  const SMART_CONNECT_LINKS = {
65
- name: "Smart connect",
65
+ name: "Smart Connect",
66
66
  link: "https://teliasmartconnect.com/",
67
67
  appKey: APP_KEYS["open-pages"],
68
68
  links: [],
@@ -66,7 +66,7 @@ export declare const BUSINESS_NET_LINKS: {
66
66
  readonly icon: "doc";
67
67
  };
68
68
  export declare const SMART_CONNECT_LINKS: {
69
- readonly name: "Smart connect";
69
+ readonly name: "Smart Connect";
70
70
  readonly link: "https://teliasmartconnect.com/";
71
71
  readonly appKey: "open-pages";
72
72
  readonly links: [];
@@ -85,7 +85,7 @@ export declare const LOGGED_IN_LINKS_BUSINESS: [{
85
85
  readonly links: [];
86
86
  readonly icon: "end-user";
87
87
  }, {
88
- readonly name: "Smart connect";
88
+ readonly name: "Smart Connect";
89
89
  readonly link: "https://teliasmartconnect.com/";
90
90
  readonly appKey: "open-pages";
91
91
  readonly links: [];
@@ -135,7 +135,7 @@ export declare const LOGGED_IN_LINKS: [{
135
135
  readonly links: [];
136
136
  readonly icon: "end-user";
137
137
  }, {
138
- readonly name: "Smart connect";
138
+ readonly name: "Smart Connect";
139
139
  readonly link: "https://teliasmartconnect.com/";
140
140
  readonly appKey: "open-pages";
141
141
  readonly links: [];
@@ -60,7 +60,7 @@ const BUSINESS_NET_LINKS = {
60
60
  icon: "doc"
61
61
  };
62
62
  const SMART_CONNECT_LINKS = {
63
- name: "Smart connect",
63
+ name: "Smart Connect",
64
64
  link: "https://teliasmartconnect.com/",
65
65
  appKey: APP_KEYS["open-pages"],
66
66
  links: [],
@@ -876,13 +876,13 @@ const Desktop = React.forwardRef(() => {
876
876
  scrollStartPos.current = window.scrollY;
877
877
  lastScrollPos.current = window.scrollY;
878
878
  }
879
- const { hideMenu, selectedMenuItem, setSelectedMenuItem, linkComponent: Link2, specifiedLink, setSpecifiedLink } = rootContext;
879
+ const { showMenu, selectedMenuItem, setSelectedMenuItem, linkComponent: Link2, specifiedLink, setSpecifiedLink } = rootContext;
880
880
  const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
881
881
  const handleInteractions = (linkName) => {
882
882
  setSpecifiedLink(linkName || "");
883
883
  setSelectedMenuItem(linkName || "", true);
884
884
  };
885
- const viewPortHeight = !hideMenu && shouldShowViewport ? "293px" : void 0;
885
+ const viewPortHeight = showMenu && shouldShowViewport ? "293px" : void 0;
886
886
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
887
887
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles[`${rootClassName}__top-menu-color`], children: /* @__PURE__ */ jsxRuntime.jsx(
888
888
  "div",
@@ -969,12 +969,13 @@ const Desktop = React.forwardRef(() => {
969
969
  { ["--teddy-viewport-wrapper-height"]: viewPortHeight }
970
970
  ),
971
971
  className: styles[`${rootClassName}__viewport-wrapper`],
972
- "data-state": hideMenu ? "closed" : "open",
972
+ "data-state": showMenu ? "open" : "closed",
973
973
  children: /* @__PURE__ */ jsxRuntime.jsx(
974
974
  NavigationMenu.Viewport,
975
975
  {
976
976
  onFocus: resetAndShowMenu,
977
977
  ref: viewPortRef,
978
+ "data-state": showMenu ? "open" : "closed",
978
979
  className: styles[`${rootClassName}__viewport`]
979
980
  }
980
981
  )
@@ -987,7 +988,7 @@ const HightlightedLinksDesktop = ({ links, listName }) => {
987
988
  const rootContext = React.useContext(RootContext);
988
989
  if (!rootContext)
989
990
  return null;
990
- const { linkComponent: Link2, setSpecifiedLink, setSelectedMenuItem, setHideMenu } = rootContext;
991
+ const { linkComponent: Link2, setSpecifiedLink, setSelectedMenuItem, setShowMenu } = rootContext;
991
992
  const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
992
993
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
993
994
  /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { pl: "100", pb: "100", variant: "title-200", as: "h2", children: listName }),
@@ -1002,7 +1003,7 @@ const HightlightedLinksDesktop = ({ links, listName }) => {
1002
1003
  rootContext.setPathname(subSubLink.link);
1003
1004
  setSpecifiedLink("");
1004
1005
  setSelectedMenuItem("", true);
1005
- setHideMenu(true);
1006
+ setShowMenu(false);
1006
1007
  },
1007
1008
  children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", align: "center", children: [
1008
1009
  subSubLink.name,
@@ -1198,7 +1199,7 @@ function Root({
1198
1199
  const [selectedDomainItem, setSelectedDomainItem] = React.useState(getInitialDomain(currentPath));
1199
1200
  const [pathname, setPathname] = React.useState(currentPath || "");
1200
1201
  const [specifiedLink, setSpecifiedLink] = React.useState(getInitialMenuItem(currentPath));
1201
- const [hideMenu, setHideMenu] = React.useState(true);
1202
+ const [showMenu, setShowMenu] = React.useState(false);
1202
1203
  const classes = clsx([styles[`${rootClassName}`]], className);
1203
1204
  React.useEffect(() => {
1204
1205
  setPathname(currentPath || "");
@@ -1238,8 +1239,8 @@ function Root({
1238
1239
  drawerSize,
1239
1240
  specifiedLink,
1240
1241
  setSpecifiedLink,
1241
- hideMenu,
1242
- setHideMenu
1242
+ showMenu,
1243
+ setShowMenu
1243
1244
  },
1244
1245
  children: /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ...props, className: classes, children: /* @__PURE__ */ jsxRuntime.jsxs(
1245
1246
  NavigationMenu,
@@ -1252,8 +1253,8 @@ function Root({
1252
1253
  return;
1253
1254
  setSelectedMenuItem(v);
1254
1255
  },
1255
- onMouseEnter: () => setHideMenu(false),
1256
- onMouseLeave: () => setHideMenu(true),
1256
+ onMouseEnter: () => setShowMenu(true),
1257
+ onMouseLeave: () => setShowMenu(false),
1257
1258
  children: [
1258
1259
  /* @__PURE__ */ jsxRuntime.jsxs(components_box_box.Box, { display: { sm: "none", lg: "block" }, children: [
1259
1260
  isSimplified && /* @__PURE__ */ jsxRuntime.jsx(DesktopSimplified, {}),
@@ -855,13 +855,13 @@ const Desktop = React__default.forwardRef(() => {
855
855
  scrollStartPos.current = window.scrollY;
856
856
  lastScrollPos.current = window.scrollY;
857
857
  }
858
- const { hideMenu, selectedMenuItem, setSelectedMenuItem, linkComponent: Link2, specifiedLink, setSpecifiedLink } = rootContext;
858
+ const { showMenu, selectedMenuItem, setSelectedMenuItem, linkComponent: Link2, specifiedLink, setSpecifiedLink } = rootContext;
859
859
  const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
860
860
  const handleInteractions = (linkName) => {
861
861
  setSpecifiedLink(linkName || "");
862
862
  setSelectedMenuItem(linkName || "", true);
863
863
  };
864
- const viewPortHeight = !hideMenu && shouldShowViewport ? "293px" : void 0;
864
+ const viewPortHeight = showMenu && shouldShowViewport ? "293px" : void 0;
865
865
  return /* @__PURE__ */ jsxs(Fragment, { children: [
866
866
  /* @__PURE__ */ jsx("div", { className: styles[`${rootClassName}__top-menu-color`], children: /* @__PURE__ */ jsx(
867
867
  "div",
@@ -948,12 +948,13 @@ const Desktop = React__default.forwardRef(() => {
948
948
  { ["--teddy-viewport-wrapper-height"]: viewPortHeight }
949
949
  ),
950
950
  className: styles[`${rootClassName}__viewport-wrapper`],
951
- "data-state": hideMenu ? "closed" : "open",
951
+ "data-state": showMenu ? "open" : "closed",
952
952
  children: /* @__PURE__ */ jsx(
953
953
  NavigationMenu.Viewport,
954
954
  {
955
955
  onFocus: resetAndShowMenu,
956
956
  ref: viewPortRef,
957
+ "data-state": showMenu ? "open" : "closed",
957
958
  className: styles[`${rootClassName}__viewport`]
958
959
  }
959
960
  )
@@ -966,7 +967,7 @@ const HightlightedLinksDesktop = ({ links, listName }) => {
966
967
  const rootContext = React__default.useContext(RootContext);
967
968
  if (!rootContext)
968
969
  return null;
969
- const { linkComponent: Link2, setSpecifiedLink, setSelectedMenuItem, setHideMenu } = rootContext;
970
+ const { linkComponent: Link2, setSpecifiedLink, setSelectedMenuItem, setShowMenu } = rootContext;
970
971
  const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
971
972
  return /* @__PURE__ */ jsxs(Fragment, { children: [
972
973
  /* @__PURE__ */ jsx(Heading, { pl: "100", pb: "100", variant: "title-200", as: "h2", children: listName }),
@@ -981,7 +982,7 @@ const HightlightedLinksDesktop = ({ links, listName }) => {
981
982
  rootContext.setPathname(subSubLink.link);
982
983
  setSpecifiedLink("");
983
984
  setSelectedMenuItem("", true);
984
- setHideMenu(true);
985
+ setShowMenu(false);
985
986
  },
986
987
  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: [
987
988
  subSubLink.name,
@@ -1177,7 +1178,7 @@ function Root({
1177
1178
  const [selectedDomainItem, setSelectedDomainItem] = React__default.useState(getInitialDomain(currentPath));
1178
1179
  const [pathname, setPathname] = React__default.useState(currentPath || "");
1179
1180
  const [specifiedLink, setSpecifiedLink] = React__default.useState(getInitialMenuItem(currentPath));
1180
- const [hideMenu, setHideMenu] = React__default.useState(true);
1181
+ const [showMenu, setShowMenu] = React__default.useState(false);
1181
1182
  const classes = clsx([styles[`${rootClassName}`]], className);
1182
1183
  useEffect(() => {
1183
1184
  setPathname(currentPath || "");
@@ -1217,8 +1218,8 @@ function Root({
1217
1218
  drawerSize,
1218
1219
  specifiedLink,
1219
1220
  setSpecifiedLink,
1220
- hideMenu,
1221
- setHideMenu
1221
+ showMenu,
1222
+ setShowMenu
1222
1223
  },
1223
1224
  children: /* @__PURE__ */ jsx(Box, { ...props, className: classes, children: /* @__PURE__ */ jsxs(
1224
1225
  NavigationMenu,
@@ -1231,8 +1232,8 @@ function Root({
1231
1232
  return;
1232
1233
  setSelectedMenuItem(v);
1233
1234
  },
1234
- onMouseEnter: () => setHideMenu(false),
1235
- onMouseLeave: () => setHideMenu(true),
1235
+ onMouseEnter: () => setShowMenu(true),
1236
+ onMouseLeave: () => setShowMenu(false),
1236
1237
  children: [
1237
1238
  /* @__PURE__ */ jsxs(Box, { display: { sm: "none", lg: "block" }, children: [
1238
1239
  isSimplified && /* @__PURE__ */ jsx(DesktopSimplified, {}),
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "pnpm": ">=9"
21
21
  },
22
22
  "private": false,
23
- "version": "0.1.29",
23
+ "version": "0.1.31",
24
24
  "sideEffects": [
25
25
  "**/*.css",
26
26
  "**/*.svg"