@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.
- package/components/accordion/accordion.d.ts +1 -0
- package/components/accordion/accordion.js +5 -43
- package/components/badge/badge.d.ts +3 -5
- package/components/badge/badge.js +2 -2
- package/components/box-link/box-link.d.ts +3 -5
- package/components/box-link/box-link.js +3 -4
- package/components/breadcrumbs/breadcrumbs.d.ts +2 -3
- package/components/breadcrumbs/breadcrumbs.js +2 -3
- package/components/button/button.d.ts +1 -2
- package/components/button-group/button-group.d.ts +2 -3
- package/components/button-group/button-group.js +2 -2
- package/components/card/card.d.ts +3 -4
- package/components/card/card.js +12 -7
- package/components/date-label/date-label.d.ts +2 -2
- package/components/date-label/date-label.js +9 -31
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.js +5 -6
- package/components/dropdown/dropdown-content-link.d.ts +1 -1
- package/components/dropdown/dropdown-content-link.js +2 -2
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/dropdown.js +2 -2
- package/components/footer-1177/footer-1177.d.ts +3 -4
- package/components/footer-1177/footer-1177.js +7 -44
- package/components/footer-1177-admin/footer-1177-admin.d.ts +1 -1
- package/components/footer-1177-admin/footer-1177-admin.js +4 -41
- package/components/footer-1177-pro/footer-1177-pro.d.ts +1 -1
- package/components/footer-1177-pro/footer-1177-pro.js +4 -41
- package/components/footer-inera/footer-inera.d.ts +1 -1
- package/components/footer-inera/footer-inera.js +4 -41
- package/components/footer-inera-admin/footer-inera-admin.d.ts +1 -1
- package/components/footer-inera-admin/footer-inera-admin.js +4 -41
- package/components/form/checkbox/checkbox.js +1 -1
- package/components/global-alert/global-alert.js +2 -2
- package/components/grid/column.d.ts +3 -4
- package/components/grid/column.js +2 -3
- package/components/grid/container.d.ts +4 -3
- package/components/grid/container.js +6 -17
- package/components/grid/row.d.ts +4 -4
- package/components/grid/row.js +6 -11
- package/components/header-1177/header-1177-item.d.ts +2 -2
- package/components/header-1177/header-1177-item.js +19 -14
- package/components/header-1177/header-1177-nav-item-mobile.js +5 -10
- package/components/header-1177/header-1177-nav-item.d.ts +4 -4
- package/components/header-1177/header-1177-nav-item.js +23 -17
- package/components/header-1177/header-1177-nav.d.ts +2 -2
- package/components/header-1177/header-1177-nav.js +4 -5
- package/components/header-1177/header-1177.d.ts +1 -1
- package/components/header-1177/header-1177.js +3 -16
- package/components/header-1177-admin/header-1177-admin-item.d.ts +2 -2
- package/components/header-1177-admin/header-1177-admin-item.js +21 -17
- package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +4 -4
- package/components/header-1177-admin/header-1177-admin-nav-item.js +20 -14
- package/components/header-1177-admin/header-1177-admin-nav.d.ts +2 -2
- package/components/header-1177-admin/header-1177-admin-nav.js +5 -6
- package/components/header-1177-admin/header-1177-admin.d.ts +2 -2
- package/components/header-1177-admin/header-1177-admin.js +3 -4
- package/components/header-1177-pro/header-1177-pro-item.d.ts +2 -2
- package/components/header-1177-pro/header-1177-pro-item.js +21 -14
- package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +5 -5
- package/components/header-1177-pro/header-1177-pro-nav-item.js +15 -19
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +2 -3
- package/components/header-1177-pro/header-1177-pro-nav.js +5 -7
- package/components/header-1177-pro/header-1177-pro.d.ts +2 -2
- package/components/header-1177-pro/header-1177-pro.js +4 -8
- package/components/header-inera/header-inera-item.d.ts +3 -4
- package/components/header-inera/header-inera-item.js +30 -14
- package/components/header-inera/header-inera-nav-item.js +7 -20
- package/components/header-inera/header-inera-nav.d.ts +1 -1
- package/components/header-inera/header-inera-nav.js +5 -6
- package/components/header-inera/header-inera.d.ts +2 -2
- package/components/header-inera/header-inera.js +4 -8
- package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -4
- package/components/header-inera-admin/header-inera-admin-item.js +17 -13
- package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +1 -3
- package/components/header-inera-admin/header-inera-admin-nav-item.js +14 -27
- package/components/header-inera-admin/header-inera-admin-nav.d.ts +2 -3
- package/components/header-inera-admin/header-inera-admin-nav.js +3 -4
- package/components/header-inera-admin/header-inera-admin.d.ts +1 -1
- package/components/header-inera-admin/header-inera-admin.js +3 -4
- package/components/link/link.d.ts +1 -1
- package/components/link/link.js +15 -13
- package/components/navigation/content/navigation-content.d.ts +2 -3
- package/components/navigation/content/navigation-content.js +5 -12
- package/components/navigation/local/navigation-local.d.ts +2 -3
- package/components/navigation/local/navigation-local.js +2 -2
- package/components/notification/badge/notification-badge.d.ts +2 -3
- package/components/notification/badge/notification-badge.js +2 -2
- package/components/pagination/data-pagination/data-pagination.d.ts +1 -2
- package/components/pagination/data-pagination/data-pagination.js +0 -1
- package/components/pagination/list-pagination/list-pagination.d.ts +1 -1
- package/components/pagination/list-pagination/list-pagination.js +2 -3
- package/components/progressbar/progressbar.d.ts +5 -3
- package/components/progressbar/progressbar.js +4 -4
- package/components/puff-list/puff-list-item/puff-list-item-date.d.ts +13 -0
- package/components/puff-list/puff-list-item/puff-list-item-date.js +23 -0
- package/components/puff-list/puff-list-item/puff-list-item-header.d.ts +10 -0
- package/components/puff-list/puff-list-item/puff-list-item-header.js +11 -0
- package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +3 -5
- package/components/puff-list/puff-list-item/puff-list-item-info.js +4 -5
- package/components/puff-list/puff-list-item/puff-list-item.d.ts +9 -20
- package/components/puff-list/puff-list-item/puff-list-item.js +8 -78
- package/components/puff-list/puff-list.d.ts +1 -1
- package/components/puff-list/puff-list.js +4 -3
- package/components/region-icon/region-icon.d.ts +2 -2
- package/components/region-icon/region-icon.js +5 -4
- package/components/side-menu/side-menu.js +1 -1
- package/components/stepper/stepper.d.ts +1 -1
- package/components/stepper/stepper.js +2 -2
- package/components/tag/tag.d.ts +11 -4
- package/components/tag/tag.js +7 -7
- package/components/tooltip/tooltip.d.ts +1 -0
- package/components/tooltip/tooltip.js +8 -7
- package/components/utils/hooks/useFocusTrap.js +2 -1
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +2 -2
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
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,
|
|
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
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
"ids-header-
|
|
37
|
-
"ids-header-
|
|
38
|
-
}), ...props, children: [
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
2
|
-
import {
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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(
|
|
21
|
-
children:
|
|
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
|
|
25
|
-
|
|
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
|
-
|
|
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
|
|
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,
|
|
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
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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--
|
|
38
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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, {
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
2
|
-
import {
|
|
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
|
-
|
|
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
|
|
10
|
+
"ids-header-1177-pro-item--unresponsive": headerContext.unresponsive,
|
|
12
11
|
"ids-header-1177-pro-item--mobile": mobile
|
|
13
12
|
});
|
|
14
|
-
const renderContent = () => (
|
|
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
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
|
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, {
|
|
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
|
-
|
|
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
|
|
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,
|
|
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
|
|
27
|
+
const renderNavItem = () => {
|
|
25
28
|
if (label) {
|
|
26
|
-
return (
|
|
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
|
|
35
|
+
const renderContent = () => {
|
|
41
36
|
if (!isExpanded)
|
|
42
37
|
return null;
|
|
43
|
-
return (jsx("div", { id:
|
|
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--
|
|
48
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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,
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
13
|
-
export {};
|
|
12
|
+
export declare function IDSHeaderIneraItem({ mobile, separatorLeft, icon, text, href, link, onClick, ...props }: IDSHeaderIneraItemProps): import("react/jsx-runtime").JSX.Element;
|