@inera/ids-react 8.0.0 → 8.1.0

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.
Files changed (116) hide show
  1. package/components/accordion/accordion.d.ts +1 -0
  2. package/components/accordion/accordion.js +5 -43
  3. package/components/badge/badge.d.ts +3 -5
  4. package/components/badge/badge.js +2 -2
  5. package/components/box-link/box-link.d.ts +3 -5
  6. package/components/box-link/box-link.js +3 -4
  7. package/components/breadcrumbs/breadcrumbs.d.ts +2 -3
  8. package/components/breadcrumbs/breadcrumbs.js +2 -3
  9. package/components/button/button.d.ts +1 -2
  10. package/components/button-group/button-group.d.ts +2 -3
  11. package/components/button-group/button-group.js +2 -2
  12. package/components/card/card.d.ts +3 -4
  13. package/components/card/card.js +12 -7
  14. package/components/date-label/date-label.d.ts +2 -2
  15. package/components/date-label/date-label.js +9 -31
  16. package/components/dialog/dialog.d.ts +1 -1
  17. package/components/dialog/dialog.js +5 -6
  18. package/components/dropdown/dropdown-content-link.d.ts +1 -1
  19. package/components/dropdown/dropdown-content-link.js +2 -2
  20. package/components/dropdown/dropdown.d.ts +1 -1
  21. package/components/dropdown/dropdown.js +2 -2
  22. package/components/footer-1177/footer-1177.d.ts +3 -4
  23. package/components/footer-1177/footer-1177.js +7 -44
  24. package/components/footer-1177-admin/footer-1177-admin.d.ts +1 -1
  25. package/components/footer-1177-admin/footer-1177-admin.js +4 -41
  26. package/components/footer-1177-pro/footer-1177-pro.d.ts +1 -1
  27. package/components/footer-1177-pro/footer-1177-pro.js +4 -41
  28. package/components/footer-inera/footer-inera.d.ts +1 -1
  29. package/components/footer-inera/footer-inera.js +4 -41
  30. package/components/footer-inera-admin/footer-inera-admin.d.ts +1 -1
  31. package/components/footer-inera-admin/footer-inera-admin.js +4 -41
  32. package/components/form/checkbox/checkbox.js +1 -1
  33. package/components/global-alert/global-alert.js +2 -2
  34. package/components/grid/column.d.ts +3 -4
  35. package/components/grid/column.js +2 -3
  36. package/components/grid/container.d.ts +4 -3
  37. package/components/grid/container.js +6 -17
  38. package/components/grid/row.d.ts +4 -4
  39. package/components/grid/row.js +6 -11
  40. package/components/header-1177/header-1177-item.d.ts +2 -2
  41. package/components/header-1177/header-1177-item.js +19 -14
  42. package/components/header-1177/header-1177-nav-item-mobile.js +5 -10
  43. package/components/header-1177/header-1177-nav-item.d.ts +4 -4
  44. package/components/header-1177/header-1177-nav-item.js +23 -17
  45. package/components/header-1177/header-1177-nav.d.ts +2 -2
  46. package/components/header-1177/header-1177-nav.js +4 -5
  47. package/components/header-1177/header-1177.d.ts +1 -1
  48. package/components/header-1177/header-1177.js +3 -16
  49. package/components/header-1177-admin/header-1177-admin-item.d.ts +2 -2
  50. package/components/header-1177-admin/header-1177-admin-item.js +21 -17
  51. package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +4 -4
  52. package/components/header-1177-admin/header-1177-admin-nav-item.js +20 -14
  53. package/components/header-1177-admin/header-1177-admin-nav.d.ts +2 -2
  54. package/components/header-1177-admin/header-1177-admin-nav.js +5 -6
  55. package/components/header-1177-admin/header-1177-admin.d.ts +2 -2
  56. package/components/header-1177-admin/header-1177-admin.js +3 -4
  57. package/components/header-1177-pro/header-1177-pro-item.d.ts +2 -2
  58. package/components/header-1177-pro/header-1177-pro-item.js +21 -14
  59. package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +5 -5
  60. package/components/header-1177-pro/header-1177-pro-nav-item.js +15 -19
  61. package/components/header-1177-pro/header-1177-pro-nav.d.ts +2 -3
  62. package/components/header-1177-pro/header-1177-pro-nav.js +5 -7
  63. package/components/header-1177-pro/header-1177-pro.d.ts +2 -2
  64. package/components/header-1177-pro/header-1177-pro.js +4 -8
  65. package/components/header-inera/header-inera-item.d.ts +3 -4
  66. package/components/header-inera/header-inera-item.js +30 -14
  67. package/components/header-inera/header-inera-nav-item.js +7 -20
  68. package/components/header-inera/header-inera-nav.d.ts +1 -1
  69. package/components/header-inera/header-inera-nav.js +5 -6
  70. package/components/header-inera/header-inera.d.ts +2 -2
  71. package/components/header-inera/header-inera.js +4 -8
  72. package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -4
  73. package/components/header-inera-admin/header-inera-admin-item.js +17 -13
  74. package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +1 -3
  75. package/components/header-inera-admin/header-inera-admin-nav-item.js +14 -27
  76. package/components/header-inera-admin/header-inera-admin-nav.d.ts +2 -3
  77. package/components/header-inera-admin/header-inera-admin-nav.js +3 -4
  78. package/components/header-inera-admin/header-inera-admin.d.ts +1 -1
  79. package/components/header-inera-admin/header-inera-admin.js +3 -4
  80. package/components/link/link.d.ts +1 -1
  81. package/components/link/link.js +15 -13
  82. package/components/navigation/content/navigation-content.d.ts +2 -3
  83. package/components/navigation/content/navigation-content.js +5 -12
  84. package/components/navigation/local/navigation-local.d.ts +2 -3
  85. package/components/navigation/local/navigation-local.js +2 -2
  86. package/components/notification/badge/notification-badge.d.ts +2 -3
  87. package/components/notification/badge/notification-badge.js +2 -2
  88. package/components/pagination/data-pagination/data-pagination.d.ts +1 -2
  89. package/components/pagination/data-pagination/data-pagination.js +0 -1
  90. package/components/pagination/list-pagination/list-pagination.d.ts +1 -1
  91. package/components/pagination/list-pagination/list-pagination.js +2 -3
  92. package/components/progressbar/progressbar.d.ts +5 -3
  93. package/components/progressbar/progressbar.js +4 -4
  94. package/components/puff-list/puff-list-item/puff-list-item-date.d.ts +13 -0
  95. package/components/puff-list/puff-list-item/puff-list-item-date.js +23 -0
  96. package/components/puff-list/puff-list-item/puff-list-item-header.d.ts +10 -0
  97. package/components/puff-list/puff-list-item/puff-list-item-header.js +11 -0
  98. package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +3 -5
  99. package/components/puff-list/puff-list-item/puff-list-item-info.js +4 -5
  100. package/components/puff-list/puff-list-item/puff-list-item.d.ts +9 -20
  101. package/components/puff-list/puff-list-item/puff-list-item.js +8 -78
  102. package/components/puff-list/puff-list.d.ts +1 -1
  103. package/components/puff-list/puff-list.js +4 -3
  104. package/components/region-icon/region-icon.d.ts +2 -2
  105. package/components/region-icon/region-icon.js +5 -4
  106. package/components/side-menu/side-menu.js +1 -1
  107. package/components/stepper/stepper.d.ts +1 -1
  108. package/components/stepper/stepper.js +2 -2
  109. package/components/tag/tag.d.ts +11 -4
  110. package/components/tag/tag.js +7 -7
  111. package/components/tooltip/tooltip.d.ts +1 -0
  112. package/components/tooltip/tooltip.js +8 -7
  113. package/components/utils/hooks/useFocusTrap.js +2 -1
  114. package/index.d.ts +2 -0
  115. package/index.js +2 -0
  116. package/package.json +2 -2
@@ -1,14 +1,17 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import React, { useState, useRef, useEffect } from 'react';
3
+ import { useState, useRef, useEffect } from 'react';
4
4
  import '@inera/ids-design/components/header-1177/header-1177-nav-item.css';
5
5
  import clsx from 'clsx';
6
6
  import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
7
+ import { useElementId } from '../utils/hooks/useElementId.js';
7
8
 
8
- const IDSHeader1177NavItem = ({ active = false, expanded = false, label = "", col1, col2, col3, col4, children, ...props }) => {
9
- const [isExpanded, setIsExpanded] = useState(expanded);
9
+ const IDSHeader1177NavItem = ({ label = "", active = false, expanded = false, notification, children, col1, col2, col3, col4, ...props }) => {
10
10
  const headerContext = useHeaderContext();
11
+ const [isExpanded, setIsExpanded] = useState(expanded);
11
12
  const containerRef = useRef(null);
13
+ const contentId = useElementId();
14
+ //FIXME click on link should also close menu
12
15
  const handleClickOutside = (event) => {
13
16
  if (containerRef.current && !containerRef.current.contains(event.target)) {
14
17
  setIsExpanded(false);
@@ -21,21 +24,24 @@ const IDSHeader1177NavItem = ({ active = false, expanded = false, label = "", co
21
24
  document.removeEventListener("click", handleClickOutside);
22
25
  };
23
26
  }, [expanded]);
24
- const renderLink = (link) => {
25
- return React.isValidElement(link)
26
- ? React.cloneElement(link, {
27
- activeIcon: true,
28
- block: true,
29
- colorPreset: 2,
30
- onClick: () => setIsExpanded(false)
31
- })
32
- : link;
27
+ const renderNavItem = () => {
28
+ if (label) {
29
+ return (jsxs("button", { "aria-controls": contentId, "aria-expanded": isExpanded, className: "ids-header-1177-nav-item__button", onClick: () => setIsExpanded(prev => !prev), children: [label, " ", notification] }));
30
+ }
31
+ else {
32
+ return (jsxs("span", { className: "ids-header-1177-nav-item__link", children: [children, " ", notification] }));
33
+ }
34
+ };
35
+ const renderContent = () => {
36
+ if (!isExpanded)
37
+ return null;
38
+ return (jsx("div", { id: contentId, className: "ids-header-1177-nav-item__menu ids-header-1177-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-1177-nav-item__menu-content", children: [jsx("div", { className: "ids-header-1177-nav-item__menu-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu-col-4", children: col4 })] }) }));
33
39
  };
34
- const renderDropdown = () => isExpanded && (jsx("div", { id: "ids-header-1177-nav-dropdown", className: "ids-header-1177-nav-item__menu ids-header-1177-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-1177-nav-item__menu__content", children: [jsx("div", { className: "ids-header-1177-nav-item__menu__content-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu__content-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu__content-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu__content-col-4", children: col4 })] }) }));
35
- return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177__nav-item", {
36
- "ids-header-1177__nav-item--unresponsive": headerContext?.unresponsive,
37
- "ids-header-1177__nav-item--active": active || isExpanded
38
- }), ...props, children: [label ? (jsx("button", { onClick: () => setIsExpanded(prev => !prev), "aria-expanded": isExpanded, "aria-controls": "ids-header-1177-nav-dropdown", children: label })) : (children), renderDropdown()] }));
40
+ return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-nav-item", {
41
+ "ids-header-1177-nav-item--unresponsive": headerContext?.unresponsive,
42
+ "ids-header-1177-nav-item--expanded": isExpanded,
43
+ "ids-header-1177-nav-item--active": active
44
+ }), ...props, children: [renderNavItem(), renderContent()] }));
39
45
  };
40
46
 
41
47
  export { IDSHeader1177NavItem };
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from "react";
1
+ import { ReactNode } from "react";
2
2
  import "@inera/ids-design/components/header-1177/header-1177-nav.css";
3
3
  interface IDSHeader1177NavProps {
4
4
  hideOnTablet?: boolean;
@@ -6,5 +6,5 @@ interface IDSHeader1177NavProps {
6
6
  mobileRight?: ReactNode;
7
7
  children?: ReactNode;
8
8
  }
9
- export declare const IDSHeader1177Nav: React.FC<IDSHeader1177NavProps>;
9
+ export declare function IDSHeader1177Nav({ hideOnTablet, mobileLeft, mobileRight, children, ...props }: IDSHeader1177NavProps): import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -1,16 +1,15 @@
1
- "use client";
2
1
  import { jsxs, jsx } from 'react/jsx-runtime';
3
2
  import '@inera/ids-design/components/header-1177/header-1177-nav.css';
4
3
  import clsx from 'clsx';
5
4
  import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
6
5
 
7
- const IDSHeader1177Nav = ({ hideOnTablet = false, mobileLeft, mobileRight, children, ...props }) => {
8
- const headerContext = useHeaderContext();
6
+ function IDSHeader1177Nav({ hideOnTablet = false, mobileLeft, mobileRight, children, ...props }) {
7
+ const headerContext = useHeaderContext() || { unresponsive: false };
9
8
  const navClass = clsx("ids-header-1177__nav", {
10
- "ids-header-1177__nav--unresponsive": headerContext?.unresponsive,
9
+ "ids-header-1177__nav--unresponsive": headerContext.unresponsive,
11
10
  "ids-header-1177__nav--hide-on-tablet": hideOnTablet
12
11
  });
13
12
  return (jsxs("nav", { className: navClass, ...props, children: [jsx("div", { className: "ids-header-1177__nav-inner", children: jsx("div", { className: "ids-header-1177__nav-content", children: children }) }), jsxs("div", { className: "ids-header-1177__nav-inner-mobile", children: [jsx("div", { className: "ids-header-1177__nav-inner-mobile-left", children: mobileLeft }), jsx("div", { className: "ids-header-1177__nav-inner-mobile-right", children: mobileRight })] })] }));
14
- };
13
+ }
15
14
 
16
15
  export { IDSHeader1177Nav };
@@ -14,5 +14,5 @@ interface IDSHeader1177Props extends React.HTMLAttributes<HTMLDivElement> {
14
14
  avatar?: ReactNode;
15
15
  children?: ReactNode;
16
16
  }
17
- export declare const IDSHeader1177: React.FC<IDSHeader1177Props>;
17
+ export declare function IDSHeader1177({ srLogoText, hideRegionPicker, unresponsive, logoHref, logoProps, logo, regionPicker, skipToContentLink, items, avatar, className, children, ...props }: IDSHeader1177Props): import("react/jsx-runtime").JSX.Element;
18
18
  export {};
@@ -1,28 +1,15 @@
1
- "use client";
2
1
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useState, useRef, useEffect } from 'react';
4
2
  import clsx from 'clsx';
5
- import '@inera/ids-design/components/header-1177/header-1177.css';
6
3
  import { HeaderProvider } from '../utils/contexts/HeaderContext.js';
4
+ import '@inera/ids-design/components/header-1177/header-1177.css';
7
5
 
8
- const IDSHeader1177 = ({ srLogoText = "Logotyp", hideRegionPicker: initialRegionPicker = false, unresponsive = false, logoHref = "", logoProps = {}, logo, regionPicker, skipToContentLink, items, avatar, className, children, ...props }) => {
9
- const [hideRegionPicker, setHideRegionPicker] = useState(initialRegionPicker);
10
- useRef(null);
11
- useEffect(() => {
12
- if (avatar) {
13
- // No region picker when avatar
14
- setHideRegionPicker(true);
15
- }
16
- else {
17
- setHideRegionPicker(initialRegionPicker);
18
- }
19
- }, [avatar]);
6
+ function IDSHeader1177({ srLogoText = "Logotyp", hideRegionPicker = false, unresponsive = false, logoHref = "", logoProps = {}, logo, regionPicker, skipToContentLink, items, avatar, className, children, ...props }) {
20
7
  const renderLogo = () => {
21
8
  return (jsx("div", { className: "ids-header-1177__logo-wrapper", children: jsx("div", { className: "ids-header-1177__logo", children: logo ? (jsx("span", { className: "ids-header-1177__link", children: logo })) : (jsx("a", { className: "ids-header-1177__logo-link", href: logoHref, "aria-label": srLogoText, ...logoProps })) }) }));
22
9
  };
23
10
  return (jsx(HeaderProvider, { value: { unresponsive, hideRegionPicker }, children: jsxs("header", { className: clsx("ids-header-1177", {
24
11
  "ids-header-1177--unresponsive": unresponsive
25
12
  }, className), ...props, children: [skipToContentLink && jsx("div", { className: "ids-header-1177__skip-to-content", children: skipToContentLink }), jsxs("div", { className: "ids-header-1177__container", children: [jsx("div", { className: "ids-header-1177__left" }), jsxs("div", { className: "ids-header-1177__inner", children: [jsxs("div", { className: "ids-header-1177__inner-left", children: [renderLogo(), !hideRegionPicker && regionPicker && jsx("div", { className: "ids-header-1177__region-picker", children: regionPicker })] }), jsxs("div", { className: "ids-header-1177__inner-right", children: [items, " ", avatar] })] }), jsx("div", { className: "ids-header-1177__right" })] }), children] }) }));
26
- };
13
+ }
27
14
 
28
15
  export { IDSHeader1177 };
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from "react";
1
+ import { ReactNode } from "react";
2
2
  import "@inera/ids-design/components/header-1177-admin/header-1177-admin-item.css";
3
3
  interface IDSHeader1177AdminItemProps {
4
4
  mobile?: boolean;
@@ -8,5 +8,5 @@ interface IDSHeader1177AdminItemProps {
8
8
  link?: ReactNode;
9
9
  onClick?: () => void;
10
10
  }
11
- export declare const IDSHeader1177AdminItem: React.FC<IDSHeader1177AdminItemProps>;
11
+ export declare function IDSHeader1177AdminItem({ mobile, href, text, icon, link, onClick, ...props }: IDSHeader1177AdminItemProps): import("react/jsx-runtime").JSX.Element;
12
12
  export {};
@@ -1,29 +1,33 @@
1
- "use client";
2
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import { isValidElement, cloneElement } from 'react';
4
- import '@inera/ids-design/components/header-1177-admin/header-1177-admin-item.css';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React, { isValidElement, cloneElement } from 'react';
5
3
  import clsx from 'clsx';
6
4
  import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
5
+ import '@inera/ids-design/components/header-1177-admin/header-1177-admin-item.css';
7
6
 
8
- const IDSHeader1177AdminItem = ({ mobile = false, href = "", text = "", icon, link, onClick, ...props }) => {
9
- const headerContext = useHeaderContext();
7
+ function IDSHeader1177AdminItem({ mobile = false, href = "", text = "", icon, link, onClick, ...props }) {
8
+ const headerContext = useHeaderContext() || { unresponsive: false };
10
9
  const classNames = clsx("ids-header-1177-admin-item", {
11
- "ids-header-1177-admin-item--unresponsive": headerContext?.unresponsive,
10
+ "ids-header-1177-admin-item--unresponsive": headerContext.unresponsive,
12
11
  "ids-header-1177-admin-item--mobile": mobile
13
12
  });
14
- const renderContent = () => {
15
- return (jsxs(Fragment, { children: [jsx("div", { className: "ids-header-1177-admin-item-icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) }), jsx("div", { className: "ids-header-1177-admin-item-text", children: text })] }));
16
- };
13
+ const renderContent = () => (jsx("div", { className: "ids-header-1177-admin-item-icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) }));
17
14
  if (link && isValidElement(link)) {
18
- return cloneElement(link, {
15
+ const linkProps = link.props;
16
+ const hasChildren = !!linkProps.children &&
17
+ (typeof linkProps.children === "string"
18
+ ? linkProps.children.trim().length > 0
19
+ : React.Children.count(linkProps.children) > 0);
20
+ const newLink = cloneElement(link, {
19
21
  ...props,
20
- className: clsx(link.props.className, classNames),
21
- children: renderContent()
22
+ className: clsx(linkProps.className),
23
+ children: hasChildren ? linkProps.children : text
22
24
  });
25
+ return (jsxs("div", { className: classNames, children: [renderContent(), " ", newLink] }));
26
+ }
27
+ if (onClick) {
28
+ return (jsxs("div", { className: classNames, children: [renderContent(), jsx("button", { onClick: onClick, ...props, children: text })] }));
23
29
  }
24
- return onClick ? (jsx("button", { className: classNames, onClick: onClick, style: {
25
- cursor: "pointer"
26
- }, ...props, children: renderContent() })) : (jsx("a", { className: classNames, href: href, ...props, children: renderContent() }));
27
- };
30
+ return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
31
+ }
28
32
 
29
33
  export { IDSHeader1177AdminItem };
@@ -1,15 +1,15 @@
1
1
  import React, { ReactNode, ReactElement } from "react";
2
2
  import "@inera/ids-design/components/header-1177-admin/header-1177-admin-nav-item.css";
3
3
  import { IDSLinkProps } from "../link/link";
4
- interface IDSHeader1177AdminNavItemProps {
4
+ export interface IDSHeader1177AdminNavItemProps {
5
+ label?: string;
5
6
  active?: boolean;
6
7
  expanded?: boolean;
7
- label?: string;
8
+ notification?: ReactNode;
9
+ children?: ReactNode;
8
10
  col1?: ReactElement<IDSLinkProps>[];
9
11
  col2?: ReactElement<IDSLinkProps>[];
10
12
  col3?: ReactElement<IDSLinkProps>[];
11
13
  col4?: ReactElement<IDSLinkProps>[];
12
- children?: ReactNode;
13
14
  }
14
15
  export declare const IDSHeader1177AdminNavItem: React.FC<IDSHeader1177AdminNavItemProps>;
15
- export {};
@@ -1,14 +1,17 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import React, { useState, useRef, useEffect } from 'react';
3
+ import { useState, useRef, useEffect } from 'react';
4
4
  import '@inera/ids-design/components/header-1177-admin/header-1177-admin-nav-item.css';
5
5
  import clsx from 'clsx';
6
6
  import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
7
+ import { useElementId } from '../utils/hooks/useElementId.js';
7
8
 
8
- const IDSHeader1177AdminNavItem = ({ active = false, expanded = false, label = "", col1, col2, col3, col4, children, ...props }) => {
9
+ const IDSHeader1177AdminNavItem = ({ label = "", active = false, expanded = false, notification, children, col1, col2, col3, col4, ...props }) => {
9
10
  const headerContext = useHeaderContext();
10
11
  const [isExpanded, setIsExpanded] = useState(expanded);
11
12
  const containerRef = useRef(null);
13
+ const contentId = useElementId();
14
+ //FIXME click on link should also close menu
12
15
  const handleClickOutside = (event) => {
13
16
  if (containerRef.current && !containerRef.current.contains(event.target)) {
14
17
  setIsExpanded(false);
@@ -21,21 +24,24 @@ const IDSHeader1177AdminNavItem = ({ active = false, expanded = false, label = "
21
24
  document.removeEventListener("click", handleClickOutside);
22
25
  };
23
26
  }, [expanded]);
24
- const renderLink = (link) => {
25
- return React.isValidElement(link)
26
- ? React.cloneElement(link, {
27
- activeIcon: true,
28
- block: true,
29
- menu: true,
30
- onClick: () => setIsExpanded(false)
31
- })
32
- : link;
27
+ const renderNavItem = () => {
28
+ if (label) {
29
+ return (jsxs("button", { "aria-controls": contentId, "aria-expanded": isExpanded, className: "ids-header-1177-admin-nav-item__button", onClick: () => setIsExpanded(prev => !prev), children: [label, " ", notification] }));
30
+ }
31
+ else {
32
+ return (jsxs("span", { className: "ids-header-1177-admin-nav-item__link", children: [children, " ", notification] }));
33
+ }
34
+ };
35
+ const renderContent = () => {
36
+ if (!isExpanded)
37
+ return null;
38
+ return (jsx("div", { id: contentId, className: "ids-header-1177-admin-nav-item__menu ids-header-1177-admin-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-1177-admin-nav-item__menu-content", children: [jsx("div", { className: "ids-header-1177-admin-nav-item__menu-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-admin-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-admin-nav-item__menu-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-admin-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-admin-nav-item__menu-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-admin-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-admin-nav-item__menu-col-4", children: col4?.map((link, idx) => (jsx("div", { className: "ids-header-1177-admin-nav__menu-item-wrapper", children: link }, idx))) })] }) }));
33
39
  };
34
- const renderDropdown = () => isExpanded && (jsx("div", { id: "ids-header-1177-admin-nav-dropdown", className: "ids-header-1177-admin-nav-item__menu ids-header-1177-admin-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-1177-admin-nav-item__menu__content", children: [jsx("div", { className: "ids-header-1177-admin-nav-item__menu__content-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-admin-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-admin-nav-item__menu__content-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-admin-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-admin-nav-item__menu__content-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-admin-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-admin-nav-item__menu__content-col-4", children: col4?.map((link, idx) => (jsx("div", { className: "ids-header-1177-admin-nav__menu-item-wrapper", children: renderLink(link) }, idx))) })] }) }));
35
40
  return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-admin-nav-item", {
36
41
  "ids-header-1177-admin-nav-item--unresponsive": headerContext?.unresponsive,
37
- "ids-header-1177-admin-nav-item--active": active || isExpanded
38
- }), ...props, children: [label ? (jsx("button", { onClick: () => setIsExpanded(prev => !prev), "aria-expanded": isExpanded, "aria-controls": "ids-header-1177-admin-nav-dropdown", children: label })) : (children), renderDropdown()] }));
42
+ "ids-header-1177-admin-nav-item--expanded": isExpanded,
43
+ "ids-header-1177-admin-nav-item--active": active
44
+ }), ...props, children: [renderNavItem(), renderContent()] }));
39
45
  };
40
46
 
41
47
  export { IDSHeader1177AdminNavItem };
@@ -1,7 +1,7 @@
1
- import React, { ReactNode } from "react";
1
+ import { ReactNode } from "react";
2
2
  import "@inera/ids-design/components/header-1177-admin/header-1177-admin-nav.css";
3
3
  interface IDSHeader1177AdminNavProps {
4
4
  children?: ReactNode;
5
5
  }
6
- export declare const IDSHeader1177AdminNav: React.FC<IDSHeader1177AdminNavProps>;
6
+ export declare function IDSHeader1177AdminNav({ children, ...props }: IDSHeader1177AdminNavProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -1,14 +1,13 @@
1
- "use client";
2
1
  import { jsx } from 'react/jsx-runtime';
3
- import '@inera/ids-design/components/header-1177-admin/header-1177-admin-nav.css';
4
2
  import clsx from 'clsx';
5
3
  import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
4
+ import '@inera/ids-design/components/header-1177-admin/header-1177-admin-nav.css';
6
5
 
7
- const IDSHeader1177AdminNav = ({ children, ...props }) => {
8
- const headerContext = useHeaderContext();
6
+ function IDSHeader1177AdminNav({ children, ...props }) {
7
+ const headerContext = useHeaderContext() || { unresponsive: false };
9
8
  return (jsx("nav", { className: clsx("ids-header-1177-admin-nav", {
10
- "ids-header-1177-admin-nav--unresponsive": headerContext?.unresponsive
9
+ "ids-header-1177-admin-nav--unresponsive": headerContext.unresponsive
11
10
  }), ...props, children: jsx("div", { className: "ids-header-1177-admin-nav__inner", children: jsx("div", { className: "ids-header-1177-admin-nav__items", children: children }) }) }));
12
- };
11
+ }
13
12
 
14
13
  export { IDSHeader1177AdminNav };
@@ -1,4 +1,4 @@
1
- import React, { AnchorHTMLAttributes, ReactNode } from "react";
1
+ import React, { ReactNode, AnchorHTMLAttributes } from "react";
2
2
  import "@inera/ids-design/components/header-1177-admin/header-1177-admin.css";
3
3
  interface IDSHeader1177AdminProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  unresponsive?: boolean;
@@ -15,5 +15,5 @@ interface IDSHeader1177AdminProps extends React.HTMLAttributes<HTMLDivElement> {
15
15
  skipToContentLink?: ReactNode;
16
16
  children?: ReactNode;
17
17
  }
18
- export declare const IDSHeader1177Admin: React.FC<IDSHeader1177AdminProps>;
18
+ export declare function IDSHeader1177Admin({ unresponsive, srLogoText, brandTextTop, brandText, brandTextBottom, logoHref, logoProps, logo, avatar, mobileMenu, items, skipToContentLink, className, children, ...props }: IDSHeader1177AdminProps): import("react/jsx-runtime").JSX.Element;
19
19
  export {};
@@ -1,16 +1,15 @@
1
- "use client";
2
1
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import '@inera/ids-design/components/header-1177-admin/header-1177-admin.css';
4
2
  import clsx from 'clsx';
5
3
  import { HeaderProvider } from '../utils/contexts/HeaderContext.js';
4
+ import '@inera/ids-design/components/header-1177-admin/header-1177-admin.css';
6
5
 
7
- const IDSHeader1177Admin = ({ unresponsive = false, srLogoText = "Logotyp", brandTextTop = "", brandText = "", brandTextBottom = "", logoHref = "", logoProps = {}, logo, avatar, mobileMenu, items, skipToContentLink, className, children, ...props }) => {
6
+ function IDSHeader1177Admin({ unresponsive = false, srLogoText = "Logotyp", brandTextTop = "", brandText = "", brandTextBottom = "", logoHref = "", logoProps = {}, logo, avatar, mobileMenu, items, skipToContentLink, className, children, ...props }) {
8
7
  const renderLogo = () => {
9
8
  return logo ? (logo) : (jsx("a", { className: "ids-header-1177-admin__logo-link", href: logoHref, "aria-label": srLogoText, ...logoProps }));
10
9
  };
11
10
  return (jsx(HeaderProvider, { value: { unresponsive }, children: jsxs("header", { className: clsx("ids-header-1177-admin", {
12
11
  "ids-header-1177-admin--unresponsive": unresponsive
13
12
  }, className), style: { position: "relative", zIndex: 3 }, ...props, children: [skipToContentLink && jsx("div", { className: "ids-header-1177-admin__skip-to-content", children: skipToContentLink }), jsxs("div", { className: "ids-header-1177-admin__main", children: [jsxs("div", { className: "ids-header-1177-admin__main-left", children: [jsx("div", { className: "ids-header-1177-admin__logo", children: renderLogo() }), jsxs("div", { className: "ids-header-1177-admin__brand", children: [brandTextTop && jsx("div", { className: "ids-header-1177-admin__brand-text---supplement", children: brandTextTop }), brandText && jsx("div", { className: "ids-header-1177-admin__brand-text", children: brandText }), brandTextBottom && jsx("div", { className: "ids-header-1177-admin__brand-text---supplement", children: brandTextBottom })] })] }), jsxs("div", { className: "ids-header-1177-admin__main-right", children: [items, avatar, mobileMenu] })] }), children] }) }));
14
- };
13
+ }
15
14
 
16
15
  export { IDSHeader1177Admin };
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from "react";
1
+ import { ReactNode } from "react";
2
2
  import "@inera/ids-design/components/header-1177-pro/header-1177-pro-item.css";
3
3
  interface IDSHeader1177ProItemProps {
4
4
  mobile?: boolean;
@@ -8,5 +8,5 @@ interface IDSHeader1177ProItemProps {
8
8
  link?: ReactNode;
9
9
  onClick?: () => void;
10
10
  }
11
- export declare const IDSHeader1177ProItem: React.FC<IDSHeader1177ProItemProps>;
11
+ export declare function IDSHeader1177ProItem({ mobile, icon, text, href, link, onClick, ...props }: IDSHeader1177ProItemProps): import("react/jsx-runtime").JSX.Element;
12
12
  export {};
@@ -1,26 +1,33 @@
1
- "use client";
2
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import { isValidElement, cloneElement } from 'react';
4
- import '@inera/ids-design/components/header-1177-pro/header-1177-pro-item.css';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React, { isValidElement, cloneElement } from 'react';
5
3
  import clsx from 'clsx';
6
4
  import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
5
+ import '@inera/ids-design/components/header-1177-pro/header-1177-pro-item.css';
7
6
 
8
- const IDSHeader1177ProItem = ({ mobile = false, icon = "", text = "", href = "", link, onClick, ...props }) => {
9
- const headerContext = useHeaderContext();
7
+ function IDSHeader1177ProItem({ mobile = false, icon = "", text = "", href = "", link, onClick, ...props }) {
8
+ const headerContext = useHeaderContext() || { unresponsive: false };
10
9
  const classNames = clsx("ids-header-1177-pro-item", {
11
- "ids-header-1177-pro-item--unresponsive": headerContext?.unresponsive,
10
+ "ids-header-1177-pro-item--unresponsive": headerContext.unresponsive,
12
11
  "ids-header-1177-pro-item--mobile": mobile
13
12
  });
14
- const renderContent = () => (jsxs(Fragment, { children: [jsx("div", { className: "ids-header-1177-pro-item-icon", "aria-hidden": "true", children: icon && jsx("span", { className: `ids-icon-${icon}` }) }), jsx("div", { className: "ids-header-1177-pro-item-text", children: text })] }));
13
+ const renderContent = () => (jsx("div", { className: "ids-header-1177-pro-item-icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) }));
15
14
  if (link && isValidElement(link)) {
16
- return cloneElement(link, {
15
+ const linkProps = link.props;
16
+ const hasChildren = !!linkProps.children &&
17
+ (typeof linkProps.children === "string"
18
+ ? linkProps.children.trim().length > 0
19
+ : React.Children.count(linkProps.children) > 0);
20
+ const newLink = cloneElement(link, {
17
21
  ...props,
18
- style: { position: "relative", textDecoration: "none" },
19
- className: clsx(link.props.className, classNames),
20
- children: renderContent()
22
+ className: clsx(linkProps.className),
23
+ children: hasChildren ? linkProps.children : text
21
24
  });
25
+ return (jsxs("div", { className: classNames, children: [renderContent(), " ", newLink] }));
26
+ }
27
+ if (onClick) {
28
+ return (jsxs("div", { className: classNames, children: [renderContent(), jsx("button", { onClick: onClick, ...props, children: text })] }));
22
29
  }
23
- return onClick ? (jsx("button", { className: classNames, onClick: onClick, style: { cursor: "pointer", padding: 0 }, ...props, children: renderContent() })) : (jsx("a", { className: classNames, href: href, style: { position: "relative", textDecoration: "none" }, ...props, children: renderContent() }));
24
- };
30
+ return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
31
+ }
25
32
 
26
33
  export { IDSHeader1177ProItem };
@@ -1,15 +1,15 @@
1
- import React, { ReactElement, ReactNode } from "react";
1
+ import React, { ReactNode, ReactElement } from "react";
2
2
  import "@inera/ids-design/components/header-1177-pro/header-1177-pro-nav-item.css";
3
3
  import { IDSLinkProps } from "../link/link";
4
- interface IDSHeader1177ProNavItemProps {
4
+ export interface IDSHeader1177ProNavItemProps {
5
+ label?: string;
5
6
  active?: boolean;
6
7
  expanded?: boolean;
7
- label?: string;
8
+ notification?: ReactNode;
9
+ children?: ReactNode;
8
10
  col1?: ReactElement<IDSLinkProps>[];
9
11
  col2?: ReactElement<IDSLinkProps>[];
10
12
  col3?: ReactElement<IDSLinkProps>[];
11
13
  col4?: ReactElement<IDSLinkProps>[];
12
- children?: ReactNode;
13
14
  }
14
15
  export declare const IDSHeader1177ProNavItem: React.FC<IDSHeader1177ProNavItemProps>;
15
- export {};
@@ -1,14 +1,17 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import React, { useState, useRef, useEffect } from 'react';
3
+ import { useState, useRef, useEffect } from 'react';
4
4
  import '@inera/ids-design/components/header-1177-pro/header-1177-pro-nav-item.css';
5
5
  import clsx from 'clsx';
6
6
  import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
7
+ import { useElementId } from '../utils/hooks/useElementId.js';
7
8
 
8
- const IDSHeader1177ProNavItem = ({ active = false, expanded = false, label = "", col1, col2, col3, col4, children, ...props }) => {
9
+ const IDSHeader1177ProNavItem = ({ label = "", active = false, expanded = false, notification, children, col1, col2, col3, col4, ...props }) => {
9
10
  const headerContext = useHeaderContext();
10
11
  const [isExpanded, setIsExpanded] = useState(expanded);
11
12
  const containerRef = useRef(null);
13
+ const contentId = useElementId();
14
+ //FIXME click on link should also close menu
12
15
  const handleClickOutside = (event) => {
13
16
  if (containerRef.current && !containerRef.current.contains(event.target)) {
14
17
  setIsExpanded(false);
@@ -21,31 +24,24 @@ const IDSHeader1177ProNavItem = ({ active = false, expanded = false, label = "",
21
24
  document.removeEventListener("click", handleClickOutside);
22
25
  };
23
26
  }, [expanded]);
24
- const renderItem = () => {
27
+ const renderNavItem = () => {
25
28
  if (label) {
26
- return (jsx("button", { onClick: () => setIsExpanded(prev => !prev), "aria-expanded": isExpanded, "aria-controls": "ids-dropdown", children: label }));
29
+ return (jsxs("button", { "aria-controls": contentId, "aria-expanded": isExpanded, className: "ids-header-1177-pro-nav-item__button", onClick: () => setIsExpanded(prev => !prev), children: [label, " ", notification] }));
30
+ }
31
+ else {
32
+ return (jsxs("span", { className: "ids-header-1177-pro-nav-item__link", children: [children, " ", notification] }));
27
33
  }
28
- return children;
29
- };
30
- const renderDropdownLink = (link) => {
31
- return React.isValidElement(link)
32
- ? React.cloneElement(link, {
33
- activeIcon: true,
34
- block: true,
35
- menu: true,
36
- onClick: () => setIsExpanded(false)
37
- })
38
- : link;
39
34
  };
40
- const renderDropdown = () => {
35
+ const renderContent = () => {
41
36
  if (!isExpanded)
42
37
  return null;
43
- return (jsx("div", { id: "ids-dropdown", className: "ids-header-1177-pro-nav-item__menu ids-header-1177-pro-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-1177-pro-nav-item__menu__content", children: [jsx("div", { className: "ids-header-1177-pro-nav-item__menu__content-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: renderDropdownLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu__content-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: renderDropdownLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu__content-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: renderDropdownLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu__content-col-4", children: col4?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: renderDropdownLink(link) }, idx))) })] }) }));
38
+ return (jsx("div", { id: contentId, className: "ids-header-1177-pro-nav-item__menu ids-header-1177-pro-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-1177-pro-nav-item__menu-content", children: [jsx("div", { className: "ids-header-1177-pro-nav-item__menu-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu-col-4", children: col4?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: link }, idx))) })] }) }));
44
39
  };
45
40
  return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-pro-nav-item", {
46
41
  "ids-header-1177-pro-nav-item--unresponsive": headerContext?.unresponsive,
47
- "ids-header-1177-pro-nav-item--active": active || isExpanded
48
- }), ...props, children: [renderItem(), renderDropdown()] }));
42
+ "ids-header-1177-pro-nav-item--expanded": isExpanded,
43
+ "ids-header-1177-pro-nav-item--active": active
44
+ }), ...props, children: [renderNavItem(), renderContent()] }));
49
45
  };
50
46
 
51
47
  export { IDSHeader1177ProNavItem };
@@ -1,10 +1,9 @@
1
- import React, { ReactNode } from "react";
1
+ import { ReactNode } from "react";
2
2
  import "@inera/ids-design/components/header-1177-pro/header-1177-pro-nav.css";
3
- import "@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css";
4
3
  interface IDSHeader1177ProNavProps {
5
4
  mobileRegionPicker?: ReactNode;
6
5
  mobileAvatar?: ReactNode;
7
6
  children?: ReactNode;
8
7
  }
9
- export declare const IDSHeader1177ProNav: React.FC<IDSHeader1177ProNavProps>;
8
+ export declare function IDSHeader1177ProNav({ mobileRegionPicker, mobileAvatar, children, ...props }: IDSHeader1177ProNavProps): import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,15 +1,13 @@
1
- "use client";
2
1
  import { jsxs, jsx } from 'react/jsx-runtime';
3
- import '@inera/ids-design/components/header-1177-pro/header-1177-pro-nav.css';
4
- import '@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css';
5
2
  import clsx from 'clsx';
6
3
  import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
4
+ import '@inera/ids-design/components/header-1177-pro/header-1177-pro-nav.css';
7
5
 
8
- const IDSHeader1177ProNav = ({ mobileRegionPicker, mobileAvatar, children, ...props }) => {
9
- const headerContext = useHeaderContext();
6
+ function IDSHeader1177ProNav({ mobileRegionPicker, mobileAvatar, children, ...props }) {
7
+ const headerContext = useHeaderContext() || { unresponsive: false };
10
8
  return (jsxs("nav", { className: clsx("ids-header-1177-pro-nav", {
11
- "ids-header-1177-pro-nav--unresponsive": headerContext?.unresponsive
9
+ "ids-header-1177-pro-nav--unresponsive": headerContext.unresponsive
12
10
  }), ...props, children: [jsx("div", { className: "ids-header-1177-pro-nav__inner", children: children }), jsxs("div", { className: "ids-header-1177-pro-nav__inner-mobile", children: [mobileRegionPicker, mobileAvatar] })] }));
13
- };
11
+ }
14
12
 
15
13
  export { IDSHeader1177ProNav };
@@ -1,4 +1,4 @@
1
- import React, { ReactNode, PropsWithChildren, AnchorHTMLAttributes } from "react";
1
+ import React, { ReactNode, AnchorHTMLAttributes } from "react";
2
2
  import "@inera/ids-design/components/header-1177-pro/header-1177-pro.css";
3
3
  interface IDSHeader1177ProProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  hideRegionPicker?: boolean;
@@ -16,5 +16,5 @@ interface IDSHeader1177ProProps extends React.HTMLAttributes<HTMLDivElement> {
16
16
  mobileMenu?: ReactNode;
17
17
  children?: ReactNode;
18
18
  }
19
- export declare const IDSHeader1177Pro: React.FC<PropsWithChildren<IDSHeader1177ProProps>>;
19
+ export declare function IDSHeader1177Pro({ hideRegionPicker, unresponsive, logoText, srLogoText, logoHref, logoProps, avatar, logoLink, regionPicker, items, skipToContentLink, mobileMenu, className, children, ...props }: IDSHeader1177ProProps): import("react/jsx-runtime").JSX.Element;
20
20
  export {};
@@ -1,16 +1,12 @@
1
- "use client";
2
1
  import { jsx, jsxs } from 'react/jsx-runtime';
3
2
  import clsx from 'clsx';
4
- import '@inera/ids-design/components/header-1177-pro/header-1177-pro.css';
5
3
  import { HeaderProvider } from '../utils/contexts/HeaderContext.js';
4
+ import '@inera/ids-design/components/header-1177-pro/header-1177-pro.css';
6
5
 
7
- const IDSHeader1177Pro = ({ hideRegionPicker = false, unresponsive = false, logoText = "för vårdpersonal", srLogoText = "Logotyp", logoHref = "", logoProps = {}, avatar, logoLink, regionPicker, items, skipToContentLink, mobileMenu, className, children, ...props }) => {
8
- return (jsx(HeaderProvider, { value: {
9
- unresponsive,
10
- hideRegionPicker
11
- }, children: jsxs("header", { className: clsx("ids-header-1177-pro", {
6
+ function IDSHeader1177Pro({ hideRegionPicker = false, unresponsive = false, logoText = "för vårdpersonal", srLogoText = "Logotyp", logoHref = "", logoProps = {}, avatar, logoLink, regionPicker, items, skipToContentLink, mobileMenu, className, children, ...props }) {
7
+ return (jsx(HeaderProvider, { value: { unresponsive, hideRegionPicker }, children: jsxs("header", { className: clsx("ids-header-1177-pro", {
12
8
  "ids-header-1177-pro--unresponsive": unresponsive
13
9
  }, className), ...props, children: [skipToContentLink && jsx("div", { className: "ids-header-1177-pro__skip-to-content", children: skipToContentLink }), jsxs("div", { className: "ids-header-1177-pro__main", children: [jsxs("div", { className: "ids-header-1177-pro__main-left", children: [jsx("div", { className: "ids-header-1177-pro__logo", children: logoLink ? (logoLink) : (jsx("a", { className: "ids-header-1177-pro__logo-link", href: logoHref, "aria-label": srLogoText, ...logoProps })) }), jsx("div", { className: "ids-header-1177-pro__logo-text", children: logoText }), !hideRegionPicker && regionPicker && jsx("div", { className: "ids-header-1177-pro__region-picker", children: regionPicker })] }), jsx("div", { className: "ids-header-1177-pro__main-right", children: jsxs("div", { className: "ids-header-1177-pro__items", children: [items, " ", avatar, mobileMenu && jsx("div", { className: "ids-header-1177-pro__mobile-menu", children: mobileMenu })] }) })] }), children] }) }));
14
- };
10
+ }
15
11
 
16
12
  export { IDSHeader1177Pro };
@@ -1,6 +1,6 @@
1
- import React, { ReactNode } from "react";
1
+ import { ReactNode } from "react";
2
2
  import "@inera/ids-design/components/header-inera/header-inera-item.css";
3
- interface IDSHeaderIneraItemProps {
3
+ export interface IDSHeaderIneraItemProps {
4
4
  mobile?: boolean;
5
5
  separatorLeft?: boolean;
6
6
  icon?: string;
@@ -9,5 +9,4 @@ interface IDSHeaderIneraItemProps {
9
9
  link?: ReactNode;
10
10
  onClick?: () => void;
11
11
  }
12
- export declare const IDSHeaderIneraItem: React.FC<IDSHeaderIneraItemProps>;
13
- export {};
12
+ export declare function IDSHeaderIneraItem({ mobile, separatorLeft, icon, text, href, link, onClick, ...props }: IDSHeaderIneraItemProps): import("react/jsx-runtime").JSX.Element;