@inera/ids-react 8.0.0 → 8.2.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/action-link/action-link.d.ts +6 -0
- package/components/action-link/action-link.js +9 -0
- 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 +3 -2
- package/components/form/datepicker/datepicker.d.ts +29 -0
- package/components/form/datepicker/datepicker.js +179 -0
- package/components/form/input/input.js +1 -1
- package/components/form/radio/radio.js +2 -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 +5 -3
- package/components/grid/container.js +11 -18
- 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 +3 -3
- 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/popover/popover.js +1 -1
- 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/step.js +1 -1
- package/components/stepper/stepper.d.ts +1 -1
- package/components/stepper/stepper.js +2 -2
- package/components/tabs/tab.js +1 -1
- 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 +3 -2
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/package.json +2 -2
|
@@ -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;
|
|
@@ -1,26 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { isValidElement, cloneElement } from 'react';
|
|
4
|
-
import '@inera/ids-design/components/header-inera/header-inera-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-inera/header-inera-item.css';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
const headerContext = useHeaderContext();
|
|
7
|
+
function IDSHeaderIneraItem({ mobile = false, separatorLeft = false, icon = "", text = "", href = "", link, onClick, ...props }) {
|
|
8
|
+
const headerContext = useHeaderContext() || { unresponsive: false };
|
|
10
9
|
const classNames = clsx("ids-header-inera-item", {
|
|
11
10
|
"ids-header-inera-item--mobile": mobile,
|
|
12
|
-
"ids-header-inera-item--unresponsive": headerContext
|
|
11
|
+
"ids-header-inera-item--unresponsive": headerContext.unresponsive
|
|
13
12
|
});
|
|
14
|
-
const renderContent = () => (
|
|
13
|
+
const renderContent = () => (jsx("div", { className: "ids-header-inera-item__icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) }));
|
|
14
|
+
// FIXME 9.0 let the user provide a link or button for all react header items to align with structure for the other frameworks
|
|
15
|
+
/* if (link && isValidElement(link)) {
|
|
16
|
+
return (
|
|
17
|
+
<div className={classNames}>
|
|
18
|
+
{renderContent()}
|
|
19
|
+
{link}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
} */
|
|
15
23
|
if (link && isValidElement(link)) {
|
|
16
|
-
|
|
24
|
+
const linkProps = link.props;
|
|
25
|
+
const hasChildren = !!linkProps.children &&
|
|
26
|
+
(typeof linkProps.children === "string"
|
|
27
|
+
? linkProps.children.trim().length > 0
|
|
28
|
+
: React.Children.count(linkProps.children) > 0);
|
|
29
|
+
const newLink = cloneElement(link, {
|
|
17
30
|
...props,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
children: renderContent()
|
|
31
|
+
className: clsx(link.props.className),
|
|
32
|
+
children: hasChildren ? linkProps.children : text
|
|
21
33
|
});
|
|
34
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), " ", newLink] }));
|
|
35
|
+
}
|
|
36
|
+
if (onClick) {
|
|
37
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("button", { onClick: onClick, ...props, children: text })] }));
|
|
22
38
|
}
|
|
23
|
-
return
|
|
24
|
-
}
|
|
39
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
|
|
40
|
+
}
|
|
25
41
|
|
|
26
42
|
export { IDSHeaderIneraItem };
|
|
@@ -1,6 +1,6 @@
|
|
|
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-inera/header-inera-nav-item.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
@@ -25,34 +25,21 @@ const IDSHeaderIneraNavItem = ({ label = "", active = false, expanded = false, n
|
|
|
25
25
|
}, [expanded]);
|
|
26
26
|
const renderNavItem = () => {
|
|
27
27
|
if (label) {
|
|
28
|
-
return (jsxs("button", { "aria-controls": contentId, "aria-expanded": isExpanded, className:
|
|
29
|
-
"ids-header-inera-nav-item__button--expanded": isExpanded,
|
|
30
|
-
"ids-header-inera-nav-item__button--active": active
|
|
31
|
-
}), onClick: () => setIsExpanded(prev => !prev), children: [label, " ", notification] }));
|
|
28
|
+
return (jsxs("button", { "aria-controls": contentId, "aria-expanded": isExpanded, className: "ids-header-inera-nav-item__button", onClick: () => setIsExpanded(prev => !prev), children: [label, " ", notification] }));
|
|
32
29
|
}
|
|
33
30
|
else {
|
|
34
|
-
return (jsxs("span", { className:
|
|
35
|
-
"ids-header-inera-nav-item__link--active": active
|
|
36
|
-
}), children: [children, " ", notification] }));
|
|
31
|
+
return (jsxs("span", { className: "ids-header-inera-nav-item__link", children: [children, " ", notification] }));
|
|
37
32
|
}
|
|
38
33
|
};
|
|
39
|
-
const renderLink = (link) => {
|
|
40
|
-
return React.isValidElement(link)
|
|
41
|
-
? React.cloneElement(link, {
|
|
42
|
-
activeIcon: true,
|
|
43
|
-
block: true,
|
|
44
|
-
colorPreset: 2,
|
|
45
|
-
onClick: () => setIsExpanded(false)
|
|
46
|
-
})
|
|
47
|
-
: link;
|
|
48
|
-
};
|
|
49
34
|
const renderContent = () => {
|
|
50
35
|
if (!isExpanded)
|
|
51
36
|
return null;
|
|
52
|
-
return (jsx("div", { id: contentId, className: "ids-header-inera-nav-item__menu ids-header-inera-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-inera-nav-item__menu-
|
|
37
|
+
return (jsx("div", { id: contentId, className: "ids-header-inera-nav-item__menu ids-header-inera-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-inera-nav-item__menu-content", children: [jsx("div", { className: "ids-header-inera-nav-item__menu-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__menu-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__menu-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__menu-col-4", children: col4 })] }) }));
|
|
53
38
|
};
|
|
54
39
|
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-inera-nav-item", {
|
|
55
|
-
"ids-header-inera-nav-item--unresponsive": headerContext?.unresponsive
|
|
40
|
+
"ids-header-inera-nav-item--unresponsive": headerContext?.unresponsive,
|
|
41
|
+
"ids-header-inera-nav-item--expanded": isExpanded,
|
|
42
|
+
"ids-header-inera-nav-item--active": active
|
|
56
43
|
}), ...props, children: [renderNavItem(), renderContent()] }));
|
|
57
44
|
};
|
|
58
45
|
|
|
@@ -4,4 +4,4 @@ export interface IDSHeaderIneraNavProps {
|
|
|
4
4
|
srText?: string;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare function IDSHeaderIneraNav({ srText, children, ...props }: IDSHeaderIneraNavProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import '@inera/ids-design/components/header-inera/header-inera-nav.css';
|
|
4
2
|
import clsx from 'clsx';
|
|
5
3
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
4
|
+
import '@inera/ids-design/components/header-inera/header-inera-nav.css';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
const headerContext = useHeaderContext();
|
|
6
|
+
function IDSHeaderIneraNav({ srText = "Huvudmeny", children, ...props }) {
|
|
7
|
+
const headerContext = useHeaderContext() || { unresponsive: false };
|
|
9
8
|
const className = clsx("ids-header-inera-nav", {
|
|
10
|
-
"ids-header-inera-nav--unresponsive": headerContext
|
|
9
|
+
"ids-header-inera-nav--unresponsive": headerContext.unresponsive
|
|
11
10
|
});
|
|
12
11
|
return (jsx("nav", { className: className, "aria-label": srText, ...props, children: jsx("div", { className: "ids-header-inera-nav__nav-items", children: children }) }));
|
|
13
|
-
}
|
|
12
|
+
}
|
|
14
13
|
|
|
15
14
|
export { IDSHeaderIneraNav };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode,
|
|
1
|
+
import React, { ReactNode, AnchorHTMLAttributes } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-inera/header-inera.css";
|
|
3
3
|
interface IDSHeaderIneraProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
logoHref?: string;
|
|
@@ -11,5 +11,5 @@ interface IDSHeaderIneraProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
11
11
|
logo?: ReactNode;
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
}
|
|
14
|
-
export declare
|
|
14
|
+
export declare function IDSHeaderInera({ logoHref, logoProps, srLogoText, unresponsive, items, mobileMenu, skipToContent, logo, className, children, ...props }: IDSHeaderIneraProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
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-inera/header-inera.css';
|
|
5
3
|
import { HeaderProvider } from '../utils/contexts/HeaderContext.js';
|
|
4
|
+
import '@inera/ids-design/components/header-inera/header-inera.css';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
return (jsx(HeaderProvider, { value: {
|
|
9
|
-
unresponsive,
|
|
10
|
-
hideRegionPicker: true
|
|
11
|
-
}, children: jsxs("header", { className: clsx("ids-header-inera", {
|
|
6
|
+
function IDSHeaderInera({ logoHref = "", logoProps = {}, srLogoText = "Logotyp inera", unresponsive = false, items, mobileMenu, skipToContent, logo, className, children, ...props }) {
|
|
7
|
+
return (jsx(HeaderProvider, { value: { unresponsive, hideRegionPicker: true }, children: jsxs("header", { className: clsx("ids-header-inera", {
|
|
12
8
|
"ids-header-inera--unresponsive": unresponsive
|
|
13
9
|
}, className), ...props, children: [skipToContent && jsx("div", { className: "ids-header-inera__skip-to-content", children: skipToContent }), jsxs("div", { className: "ids-header-inera__inner", children: [jsxs("div", { className: "ids-header-inera__main", children: [logoHref ? (jsx("a", { href: logoHref, "aria-label": srLogoText, className: "ids-header-inera__logo", ...logoProps })) : logo ? (jsx("div", { className: "ids-header-inera__logo-custom", children: logo })) : (jsx("div", { className: "ids-header-inera__logo" })), jsxs("div", { className: "ids-header-inera__items", children: [items, " ", mobileMenu] })] }), children] })] }) }));
|
|
14
|
-
}
|
|
10
|
+
}
|
|
15
11
|
|
|
16
12
|
export { IDSHeaderInera };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-inera-admin/header-inera-admin-item.css";
|
|
3
|
-
interface IDSHeaderIneraAdminItemProps {
|
|
3
|
+
export interface IDSHeaderIneraAdminItemProps {
|
|
4
4
|
mobile?: boolean;
|
|
5
5
|
separatorLeft?: boolean;
|
|
6
6
|
icon?: string;
|
|
@@ -9,5 +9,4 @@ interface IDSHeaderIneraAdminItemProps {
|
|
|
9
9
|
link?: ReactNode;
|
|
10
10
|
onClick?: () => void;
|
|
11
11
|
}
|
|
12
|
-
export declare
|
|
13
|
-
export {};
|
|
12
|
+
export declare function IDSHeaderIneraAdminItem({ mobile, separatorLeft, icon, text, href, link, onClick, ...props }: IDSHeaderIneraAdminItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { isValidElement, cloneElement } from 'react';
|
|
4
|
-
import '@inera/ids-design/components/header-inera-admin/header-inera-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-inera-admin/header-inera-admin-item.css';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
function IDSHeaderIneraAdminItem({ mobile = false, separatorLeft = false, icon = "", text, href = "", link, onClick, ...props }) {
|
|
9
8
|
const headerContext = useHeaderContext();
|
|
10
9
|
const classNames = clsx("ids-header-inera-admin-item", {
|
|
11
10
|
"ids-header-inera-admin-item--mobile": mobile,
|
|
12
|
-
"ids-header-inera-admin-
|
|
11
|
+
"ids-header-inera-admin-item--separator": separatorLeft,
|
|
13
12
|
"ids-header-inera-admin-item--unresponsive": headerContext?.unresponsive
|
|
14
13
|
});
|
|
15
|
-
const renderContent = () => (
|
|
14
|
+
const renderContent = () => (jsx("div", { className: "ids-header-inera-admin-item__icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) }));
|
|
16
15
|
if (link && isValidElement(link)) {
|
|
17
|
-
|
|
16
|
+
const linkProps = link.props;
|
|
17
|
+
const hasChildren = !!linkProps.children &&
|
|
18
|
+
(typeof linkProps.children === "string"
|
|
19
|
+
? linkProps.children.trim().length > 0
|
|
20
|
+
: React.Children.count(linkProps.children) > 0);
|
|
21
|
+
const newLink = cloneElement(link, {
|
|
18
22
|
...props,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
children: renderContent()
|
|
23
|
+
className: clsx(link.props.className),
|
|
24
|
+
children: hasChildren ? linkProps.children : text
|
|
22
25
|
});
|
|
26
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), " ", newLink] }));
|
|
23
27
|
}
|
|
24
|
-
return onClick ? (
|
|
25
|
-
}
|
|
28
|
+
return onClick ? (jsxs("div", { className: classNames, children: [renderContent(), jsx("button", { onClick: onClick, ...props, children: text })] })) : (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
|
|
29
|
+
}
|
|
26
30
|
|
|
27
31
|
export { IDSHeaderIneraAdminItem };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode, ReactElement } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-inera-admin/header-inera-admin-nav-item.css";
|
|
3
3
|
import { IDSLinkProps } from "../link/link";
|
|
4
|
-
interface IDSHeaderIneraAdminNavItemProps {
|
|
4
|
+
export interface IDSHeaderIneraAdminNavItemProps {
|
|
5
5
|
label?: string;
|
|
6
6
|
active?: boolean;
|
|
7
7
|
expanded?: boolean;
|
|
8
|
-
notification?: ReactNode;
|
|
9
8
|
children?: ReactNode;
|
|
10
9
|
col1?: ReactElement<IDSLinkProps>[];
|
|
11
10
|
col2?: ReactElement<IDSLinkProps>[];
|
|
@@ -13,4 +12,3 @@ interface IDSHeaderIneraAdminNavItemProps {
|
|
|
13
12
|
col4?: ReactNode;
|
|
14
13
|
}
|
|
15
14
|
export declare const IDSHeaderIneraAdminNavItem: React.FC<IDSHeaderIneraAdminNavItemProps>;
|
|
16
|
-
export {};
|
|
@@ -1,58 +1,45 @@
|
|
|
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-inera-admin/header-inera-admin-nav-item.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
7
|
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
8
8
|
|
|
9
|
-
const IDSHeaderIneraAdminNavItem = ({ label = "", active = false, expanded = false,
|
|
9
|
+
const IDSHeaderIneraAdminNavItem = ({ label = "", active = false, expanded = false, children, col1, col2, col3, col4, ...props }) => {
|
|
10
10
|
const headerContext = useHeaderContext();
|
|
11
11
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
12
12
|
const containerRef = useRef(null);
|
|
13
13
|
const contentId = useElementId();
|
|
14
|
-
const handleClickOutside =
|
|
14
|
+
const handleClickOutside = (event) => {
|
|
15
15
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
16
16
|
setIsExpanded(false);
|
|
17
17
|
}
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
setIsExpanded(expanded);
|
|
21
|
-
}, [expanded]);
|
|
22
|
-
useEffect(() => {
|
|
23
21
|
document.addEventListener("click", handleClickOutside);
|
|
24
|
-
return () =>
|
|
25
|
-
|
|
22
|
+
return () => {
|
|
23
|
+
document.removeEventListener("click", handleClickOutside);
|
|
24
|
+
};
|
|
25
|
+
}, [expanded]);
|
|
26
26
|
const renderNavItem = () => {
|
|
27
27
|
if (label) {
|
|
28
|
-
return (
|
|
29
|
-
"ids-header-inera-admin-nav-item__button--expanded": isExpanded,
|
|
30
|
-
"ids-header-inera-admin-nav-item__button--active": active
|
|
31
|
-
}), "aria-controls": contentId, "aria-expanded": isExpanded, onClick: () => setIsExpanded(!isExpanded), children: [label, notification] }));
|
|
28
|
+
return (jsx("button", { "aria-controls": contentId, "aria-expanded": isExpanded, className: "ids-header-inera-admin-nav-item__button", onClick: () => setIsExpanded(prev => !prev), children: label }));
|
|
32
29
|
}
|
|
33
30
|
else {
|
|
34
|
-
return (
|
|
35
|
-
"ids-header-inera-admin-nav-item__link--active": active
|
|
36
|
-
}), children: [children, notification] }));
|
|
31
|
+
return jsx("span", { className: "ids-header-inera-admin-nav-item__link", children: children });
|
|
37
32
|
}
|
|
38
33
|
};
|
|
39
|
-
const renderLink = (link) => {
|
|
40
|
-
return React.isValidElement(link)
|
|
41
|
-
? React.cloneElement(link, {
|
|
42
|
-
activeIcon: true,
|
|
43
|
-
block: true,
|
|
44
|
-
colorPreset: 2,
|
|
45
|
-
onClick: () => setIsExpanded(false)
|
|
46
|
-
})
|
|
47
|
-
: link;
|
|
48
|
-
};
|
|
49
34
|
const renderContent = () => {
|
|
50
35
|
if (!isExpanded)
|
|
51
36
|
return null;
|
|
52
|
-
return (jsx("div", { id: contentId, className: "ids-header-inera-admin-nav-item__menu ids-header-inera-admin-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-inera-admin-nav-item__menu-
|
|
37
|
+
return (jsx("div", { id: contentId, className: "ids-header-inera-admin-nav-item__menu ids-header-inera-admin-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-inera-admin-nav-item__menu-content", children: [jsx("div", { className: "ids-header-inera-admin-nav-item__menu-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-inera-admin-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-inera-admin-nav-item__menu-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-inera-admin-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-inera-admin-nav-item__menu-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-inera-admin-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-inera-admin-nav-item__menu-col-4", children: col4 })] }) }));
|
|
53
38
|
};
|
|
54
39
|
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-inera-admin-nav-item", {
|
|
55
|
-
"ids-header-inera-admin-nav-item--unresponsive": headerContext?.unresponsive
|
|
40
|
+
"ids-header-inera-admin-nav-item--unresponsive": headerContext?.unresponsive,
|
|
41
|
+
"ids-header-inera-admin-nav-item--expanded": isExpanded,
|
|
42
|
+
"ids-header-inera-admin-nav-item--active": active
|
|
56
43
|
}), ...props, children: [renderNavItem(), renderContent()] }));
|
|
57
44
|
};
|
|
58
45
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-inera-admin/header-inera-admin-nav.css";
|
|
3
|
-
interface IDSHeaderIneraAdminNavProps {
|
|
3
|
+
export interface IDSHeaderIneraAdminNavProps {
|
|
4
4
|
srText?: string;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
8
|
-
export {};
|
|
7
|
+
export declare function IDSHeaderIneraAdminNav({ srText, children, ...props }: IDSHeaderIneraAdminNavProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import '@inera/ids-design/components/header-inera-admin/header-inera-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-inera-admin/header-inera-admin-nav.css';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
function IDSHeaderIneraAdminNav({ srText = "Huvudmeny", children, ...props }) {
|
|
8
7
|
const headerContext = useHeaderContext();
|
|
9
8
|
const classNames = clsx("ids-header-inera-admin-nav", {
|
|
10
9
|
"ids-header-inera-admin-nav--unresponsive": headerContext?.unresponsive
|
|
11
10
|
});
|
|
12
11
|
return (jsx("nav", { className: classNames, "aria-label": srText, ...props, children: jsx("div", { className: "ids-header-inera-admin-nav__nav-items", children: children }) }));
|
|
13
|
-
}
|
|
12
|
+
}
|
|
14
13
|
|
|
15
14
|
export { IDSHeaderIneraAdminNav };
|
|
@@ -13,4 +13,4 @@ export interface IDSHeaderIneraAdminProps extends React.HTMLAttributes<HTMLDivEl
|
|
|
13
13
|
mobileMenu?: ReactNode;
|
|
14
14
|
children?: ReactNode;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
16
|
+
export declare function IDSHeaderIneraAdmin({ brandText, unresponsive, showLogo, items, avatar, skipToContent, brandLink, srLogoText, serviceName, mobileMenu, className, children, ...props }: IDSHeaderIneraAdminProps): import("react/jsx-runtime").JSX.Element;
|