@inera/ids-react 6.1.0 → 7.0.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 -1
- package/components/accordion/accordion.js +6 -7
- package/components/agent/agent.d.ts +1 -1
- package/components/agent/agent.js +2 -2
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/alert.js +9 -2
- package/components/alert-global/alert-global.d.ts +2 -2
- package/components/alert-global/alert-global.js +6 -7
- package/components/badge/badge.d.ts +4 -3
- package/components/badge/badge.js +4 -3
- package/components/box-link/box-link.d.ts +11 -3
- package/components/box-link/box-link.js +9 -9
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/breadcrumbs.js +4 -2
- package/components/button/button.d.ts +23 -5
- package/components/button/button.js +94 -11
- package/components/button-group/button-group.d.ts +13 -3
- package/components/button-group/button-group.js +10 -9
- package/components/card/card.d.ts +4 -3
- package/components/card/card.js +16 -8
- package/components/carousel/carousel-item.d.ts +10 -0
- package/components/carousel/carousel-item.js +24 -0
- package/components/carousel/carousel.d.ts +11 -5
- package/components/carousel/carousel.js +167 -16
- package/components/date-label/date-label.d.ts +2 -2
- package/components/date-label/date-label.js +4 -40
- package/components/dialog/dialog.d.ts +23 -6
- package/components/dialog/dialog.js +75 -13
- package/components/dropdown/dropdown-content-link.d.ts +6 -0
- package/components/dropdown/dropdown-content-link.js +20 -0
- package/components/dropdown/dropdown.d.ts +16 -8
- package/components/dropdown/dropdown.js +72 -20
- package/components/footer-1177/footer-1177.d.ts +23 -3
- package/components/footer-1177/footer-1177.js +64 -9
- package/components/footer-1177-admin/footer-1177-admin.d.ts +21 -3
- package/components/footer-1177-admin/footer-1177-admin.js +63 -9
- package/components/footer-1177-pro/footer-1177-pro.d.ts +17 -3
- package/components/footer-1177-pro/footer-1177-pro.js +39 -9
- package/components/footer-inera/footer-inera.d.ts +23 -3
- package/components/footer-inera/footer-inera.js +64 -9
- package/components/footer-inera-admin/footer-inera-admin.d.ts +23 -3
- package/components/footer-inera-admin/footer-inera-admin.js +61 -9
- package/components/form/check-button/check-button.d.ts +7 -3
- package/components/form/check-button/check-button.js +8 -5
- package/components/form/checkbox/checkbox-group.d.ts +13 -3
- package/components/form/checkbox/checkbox-group.js +51 -9
- package/components/form/checkbox/checkbox.d.ts +17 -3
- package/components/form/checkbox/checkbox.js +50 -5
- package/components/form/error-message/error-message.d.ts +10 -0
- package/components/form/error-message/error-message.js +12 -0
- package/components/form/form-hooks/useAriaDescribedBy.d.ts +1 -0
- package/components/form/form-hooks/useAriaDescribedBy.js +26 -0
- package/components/form/form-hooks/useGroupValidity.d.ts +1 -0
- package/components/form/form-hooks/useGroupValidity.js +60 -0
- package/components/form/form-hooks/useInputValidity.d.ts +1 -0
- package/components/form/form-hooks/useInputValidity.js +27 -0
- package/components/form/input/input.d.ts +22 -3
- package/components/form/input/input.js +51 -9
- package/components/form/radio/radio-group.d.ts +13 -3
- package/components/form/radio/radio-group.js +28 -5
- package/components/form/radio/radio.d.ts +17 -3
- package/components/form/radio/radio.js +23 -9
- package/components/form/radio-button/radio-button-group.d.ts +9 -0
- package/components/form/radio-button/radio-button-group.js +22 -0
- package/components/form/radio-button/radio-button.d.ts +9 -0
- package/components/form/radio-button/radio-button.js +13 -0
- package/components/form/range/range.d.ts +16 -3
- package/components/form/range/range.js +29 -9
- package/components/form/select/select.d.ts +15 -3
- package/components/form/select/select.js +19 -9
- package/components/form/select-multiple/select-multiple.d.ts +18 -3
- package/components/form/select-multiple/select-multiple.js +60 -9
- package/components/form/spinner/spinner.d.ts +9 -3
- package/components/form/spinner/spinner.js +9 -9
- package/components/form/textarea/textarea.d.ts +18 -3
- package/components/form/textarea/textarea.js +26 -9
- package/components/form/time/time.d.ts +13 -3
- package/components/form/time/time.js +21 -9
- package/components/form/toggle/toggle.d.ts +8 -3
- package/components/form/toggle/toggle.js +10 -9
- package/components/grid/column.d.ts +16 -0
- package/components/grid/column.js +13 -0
- package/components/grid/container.d.ts +9 -0
- package/components/grid/container.js +24 -0
- package/components/grid/row.d.ts +9 -0
- package/components/grid/row.js +18 -0
- package/components/header-1177/header-1177-avatar.d.ts +10 -2
- package/components/header-1177/header-1177-avatar.js +30 -8
- package/components/header-1177/header-1177-item.d.ts +12 -2
- package/components/header-1177/header-1177-item.js +25 -8
- package/components/header-1177/header-1177-menu-mobile.d.ts +11 -0
- package/components/header-1177/header-1177-menu-mobile.js +42 -0
- package/components/header-1177/header-1177-nav-item-mobile.d.ts +11 -2
- package/components/header-1177/header-1177-nav-item-mobile.js +24 -8
- package/components/header-1177/header-1177-nav-item.d.ts +15 -2
- package/components/header-1177/header-1177-nav-item.js +22 -8
- package/components/header-1177/header-1177-nav.d.ts +8 -2
- package/components/header-1177/header-1177-nav.js +14 -8
- package/components/header-1177/header-1177.d.ts +22 -5
- package/components/header-1177/header-1177.js +41 -12
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.d.ts +9 -2
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.js +6 -8
- package/components/header-1177-admin/header-1177-admin-avatar.d.ts +10 -2
- package/components/header-1177-admin/header-1177-admin-avatar.js +31 -8
- package/components/header-1177-admin/header-1177-admin-item.d.ts +12 -2
- package/components/header-1177-admin/header-1177-admin-item.js +26 -8
- package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +15 -2
- package/components/header-1177-admin/header-1177-admin-nav-item.js +24 -8
- package/components/header-1177-admin/header-1177-admin-nav.d.ts +7 -2
- package/components/header-1177-admin/header-1177-admin-nav.js +12 -8
- package/components/header-1177-admin/header-1177-admin.d.ts +22 -3
- package/components/header-1177-admin/header-1177-admin.js +26 -9
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.d.ts +9 -2
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.js +6 -8
- package/components/header-1177-pro/header-1177-pro-avatar.d.ts +10 -2
- package/components/header-1177-pro/header-1177-pro-avatar.js +31 -8
- package/components/header-1177-pro/header-1177-pro-item.d.ts +12 -2
- package/components/header-1177-pro/header-1177-pro-item.js +23 -8
- package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +15 -2
- package/components/header-1177-pro/header-1177-pro-nav-item.js +33 -8
- package/components/header-1177-pro/header-1177-pro-nav-menu-mobile.d.ts +11 -5
- package/components/header-1177-pro/header-1177-pro-nav-menu-mobile.js +32 -12
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +10 -2
- package/components/header-1177-pro/header-1177-pro-nav.js +27 -8
- package/components/header-1177-pro/header-1177-pro.d.ts +23 -5
- package/components/header-1177-pro/header-1177-pro.js +37 -12
- package/components/header-inera/header-inera-item.d.ts +13 -2
- package/components/header-inera/header-inera-item.js +24 -8
- package/components/header-inera/header-inera-nav-item.d.ts +15 -2
- package/components/header-inera/header-inera-nav-item.js +54 -8
- package/components/header-inera/header-inera-nav-mobile.d.ts +11 -5
- package/components/header-inera/header-inera-nav-mobile.js +44 -12
- package/components/header-inera/header-inera-nav.d.ts +7 -2
- package/components/header-inera/header-inera-nav.js +13 -8
- package/components/header-inera/header-inera.d.ts +16 -3
- package/components/header-inera/header-inera.js +16 -9
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +9 -2
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +11 -8
- package/components/header-inera-admin/header-inera-admin-avatar.d.ts +12 -2
- package/components/header-inera-admin/header-inera-admin-avatar.js +32 -8
- package/components/header-inera-admin/header-inera-admin-item.d.ts +13 -2
- package/components/header-inera-admin/header-inera-admin-item.js +24 -8
- package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +16 -2
- package/components/header-inera-admin/header-inera-admin-nav-item.js +54 -8
- package/components/header-inera-admin/header-inera-admin-nav-mobile.d.ts +12 -5
- package/components/header-inera-admin/header-inera-admin-nav-mobile.js +32 -12
- package/components/header-inera-admin/header-inera-admin-nav.d.ts +8 -2
- package/components/header-inera-admin/header-inera-admin-nav.js +13 -8
- package/components/header-inera-admin/header-inera-admin.d.ts +15 -3
- package/components/header-inera-admin/header-inera-admin.js +24 -9
- package/components/header-patient/header-patient.d.ts +13 -0
- package/components/header-patient/header-patient.js +21 -0
- package/components/link/link.d.ts +17 -3
- package/components/link/link.js +42 -9
- package/components/mobile/menu/item/mobile-item.d.ts +15 -4
- package/components/mobile/menu/item/mobile-item.js +58 -11
- package/components/mobile/menu/mobile-menu.d.ts +7 -3
- package/components/mobile/menu/mobile-menu.js +9 -9
- package/components/navigation/content/navigation-content.d.ts +7 -3
- package/components/navigation/content/navigation-content.js +18 -9
- package/components/navigation/local/navigation-local.d.ts +7 -3
- package/components/navigation/local/navigation-local.js +6 -9
- package/components/notification/badge/notification-badge.d.ts +4 -2
- package/components/notification/badge/notification-badge.js +4 -3
- package/components/pagination/data-pagination/data-pagination.d.ts +24 -3
- package/components/pagination/data-pagination/data-pagination.js +14 -9
- package/components/pagination/list-pagination/list-pagination.d.ts +19 -7
- package/components/pagination/list-pagination/list-pagination.js +51 -14
- package/components/popover/popover.d.ts +20 -5
- package/components/popover/popover.js +192 -16
- package/components/progressbar/progressbar.d.ts +2 -1
- package/components/progressbar/progressbar.js +4 -2
- package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +7 -0
- package/components/puff-list/puff-list-item/puff-list-item-info.js +8 -0
- package/components/puff-list/puff-list-item/puff-list-item.d.ts +18 -3
- package/components/puff-list/puff-list-item/puff-list-item.js +58 -9
- package/components/puff-list/puff-list.d.ts +7 -3
- package/components/puff-list/puff-list.js +6 -9
- package/components/region-icon/region-icon.d.ts +12 -0
- package/components/region-icon/region-icon.js +25 -0
- package/components/side-menu/side-menu.d.ts +16 -6
- package/components/side-menu/side-menu.js +52 -13
- package/components/side-panel/side-panel.d.ts +21 -6
- package/components/side-panel/side-panel.js +74 -13
- package/components/stepper/step.d.ts +18 -0
- package/components/stepper/step.js +41 -0
- package/components/stepper/stepper.d.ts +9 -7
- package/components/stepper/stepper.js +21 -19
- package/components/tabs/tab-panel.d.ts +11 -0
- package/components/tabs/tab-panel.js +20 -0
- package/components/tabs/tab.d.ts +15 -0
- package/components/tabs/tab.js +19 -0
- package/components/tabs/tabs.d.ts +14 -9
- package/components/tabs/tabs.js +79 -25
- package/components/tag/tag.d.ts +5 -6
- package/components/tag/tag.js +9 -9
- package/components/tooltip/tooltip.d.ts +10 -3
- package/components/tooltip/tooltip.js +79 -9
- package/components/utils/contexts/HeaderContext.d.ts +9 -0
- package/components/utils/contexts/HeaderContext.js +7 -0
- package/components/utils/hooks/useElementId.d.ts +5 -0
- package/components/utils/hooks/useElementId.js +12 -0
- package/components/utils/hooks/useFocusTrap.d.ts +1 -0
- package/components/utils/hooks/useFocusTrap.js +44 -0
- package/components/utils/utils.d.ts +6 -0
- package/components/utils/utils.js +44 -0
- package/index.d.ts +15 -5
- package/index.js +20 -10
- package/license.md +6 -6
- package/package.json +2 -2
- package/components/form/errormessage/error-message.d.ts +0 -3
- package/components/form/errormessage/error-message.js +0 -12
- package/components/grid/grid.d.ts +0 -9
- package/components/grid/grid.js +0 -26
- package/components/header-1177/header-1177-nav-menu-mobile.d.ts +0 -5
- package/components/header-1177/header-1177-nav-menu-mobile.js +0 -15
- package/components/icon-region/icon-region.d.ts +0 -3
- package/components/icon-region/icon-region.js +0 -12
- package/components/puff-list/puff-list-item/puff-list-info/puff-list-item-info.d.ts +0 -3
- package/components/puff-list/puff-list-item/puff-list-info/puff-list-item-info.js +0 -12
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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-inera-admin/header-inera-admin-item.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
4
7
|
|
|
5
|
-
const IDSHeaderIneraAdminItem =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const IDSHeaderIneraAdminItem = ({ mobile = false, separatorLeft = false, icon = "", text, href = "", link, onClick, ...props }) => {
|
|
9
|
+
const headerContext = useHeaderContext();
|
|
10
|
+
const classNames = clsx("ids-header-inera-admin-item", {
|
|
11
|
+
"ids-header-inera-admin-item--mobile": mobile,
|
|
12
|
+
"ids-header-inera-admin-item__separator": separatorLeft,
|
|
13
|
+
"ids-header-inera-admin-item--unresponsive": headerContext?.unresponsive
|
|
14
|
+
});
|
|
15
|
+
const renderContent = () => (jsxs(Fragment, { children: [icon && (jsx("div", { className: "ids-header-inera-admin-item__icon", "aria-label": text, children: jsx("span", { className: `ids-icon-${icon}` }) })), jsx("div", { className: "ids-header-inera-admin-item__text", children: text })] }));
|
|
16
|
+
if (link && isValidElement(link)) {
|
|
17
|
+
return cloneElement(link, {
|
|
18
|
+
...props,
|
|
19
|
+
style: { textDecoration: "none" },
|
|
20
|
+
className: clsx(link.props.className, classNames),
|
|
21
|
+
children: renderContent()
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return onClick ? (jsx("button", { className: classNames, onClick: onClick, ...props, children: renderContent() })) : (jsx("a", { className: classNames, href: href, style: { textDecoration: "none" }, ...props, children: renderContent() }));
|
|
25
|
+
};
|
|
10
26
|
|
|
11
27
|
export { IDSHeaderIneraAdminItem };
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import React, { ReactNode, ReactElement } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-inera-admin/header-inera-admin-nav-item.css";
|
|
3
|
+
import { IDSLinkProps } from "../link/link";
|
|
4
|
+
interface IDSHeaderIneraAdminNavItemProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
expanded?: boolean;
|
|
8
|
+
notification?: ReactNode;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
col1?: ReactElement<IDSLinkProps>[];
|
|
11
|
+
col2?: ReactElement<IDSLinkProps>[];
|
|
12
|
+
col3?: ReactElement<IDSLinkProps>[];
|
|
13
|
+
col4?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const IDSHeaderIneraAdminNavItem: React.FC<IDSHeaderIneraAdminNavItemProps>;
|
|
16
|
+
export {};
|
|
@@ -1,11 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React__default, { useState, useRef, useCallback, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-inera-admin/header-inera-admin-nav-item.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
|
+
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
4
8
|
|
|
5
|
-
const IDSHeaderIneraAdminNavItem =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const IDSHeaderIneraAdminNavItem = ({ label = "", active = false, expanded = false, notification, children, col1, col2, col3, col4 }) => {
|
|
10
|
+
const headerContext = useHeaderContext();
|
|
11
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
12
|
+
const containerRef = useRef(null);
|
|
13
|
+
const contentId = useElementId();
|
|
14
|
+
const handleClickOutside = useCallback((event) => {
|
|
15
|
+
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
16
|
+
setIsExpanded(false);
|
|
17
|
+
}
|
|
18
|
+
}, [containerRef]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setIsExpanded(expanded);
|
|
21
|
+
}, [expanded]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
document.addEventListener("click", handleClickOutside);
|
|
24
|
+
return () => document.removeEventListener("click", handleClickOutside);
|
|
25
|
+
}, [handleClickOutside]);
|
|
26
|
+
const renderNavItem = () => {
|
|
27
|
+
if (label) {
|
|
28
|
+
return (jsxs("button", { className: clsx("ids-header-inera-admin-nav-item__button", {
|
|
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] }));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return (jsxs("span", { className: clsx("ids-header-inera-admin-nav-item__link", {
|
|
35
|
+
"ids-header-inera-admin-nav-item__link--active": active
|
|
36
|
+
}), children: [children, notification] }));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const renderLink = (link) => {
|
|
40
|
+
return React__default.isValidElement(link)
|
|
41
|
+
? React__default.cloneElement(link, { activeIcon: true, block: true, colorPreset: 2 })
|
|
42
|
+
: link;
|
|
43
|
+
};
|
|
44
|
+
const renderContent = () => {
|
|
45
|
+
if (!isExpanded)
|
|
46
|
+
return null;
|
|
47
|
+
return (jsx("div", { id: contentId, className: "ids-header-inera-admin-nav-item__content", children: jsxs("div", { className: clsx("ids-header-inera-admin-nav-item__content-inner", {
|
|
48
|
+
"ids-header-inera-admin-nav-item__content-inner--fluid": headerContext?.fluid
|
|
49
|
+
}), children: [jsx("div", { className: "ids-header-inera-admin-nav-item__content-col", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-inera-admin-nav-item__wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-admin-nav-item__content-col", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-inera-admin-nav-item__wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-admin-nav-item__content-col", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-inera-admin-nav-item__wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-admin-nav-item__content-col", children: col4 })] }) }));
|
|
50
|
+
};
|
|
51
|
+
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-inera-admin-nav-item", {
|
|
52
|
+
"ids-header-inera-admin-nav-item--fluid": headerContext?.fluid,
|
|
53
|
+
"ids-header-inera-admin-nav-item--unresponsive": headerContext?.unresponsive
|
|
54
|
+
}), children: [renderNavItem(), renderContent()] }));
|
|
55
|
+
};
|
|
10
56
|
|
|
11
57
|
export { IDSHeaderIneraAdminNavItem };
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-inera-admin/header-inera-admin-nav-mobile.css";
|
|
3
|
+
interface IDSHeaderIneraAdminNavMobileProps {
|
|
4
|
+
expanded?: boolean;
|
|
5
|
+
persistent?: boolean;
|
|
6
|
+
srLabel?: string;
|
|
7
|
+
onExpanded?: () => void;
|
|
8
|
+
onClosed?: () => void;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const IDSHeaderIneraAdminNavMobile: React.FC<IDSHeaderIneraAdminNavMobileProps>;
|
|
12
|
+
export {};
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-inera-admin/header-inera-admin-nav-mobile.css';
|
|
5
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
|
+
import clsx from 'clsx';
|
|
4
7
|
|
|
5
|
-
const IDSHeaderIneraAdminNavMobile =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const IDSHeaderIneraAdminNavMobile = ({ expanded = false, persistent = false, srLabel = "Meny", onExpanded, onClosed, children }) => {
|
|
9
|
+
const headerContext = useHeaderContext();
|
|
10
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
11
|
+
const containerRef = useRef(null);
|
|
12
|
+
const menuRef = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!persistent) {
|
|
15
|
+
const links = menuRef.current?.querySelectorAll("a") || [];
|
|
16
|
+
links.forEach(link => link.addEventListener("click", closeMenu));
|
|
17
|
+
return () => links.forEach(link => link.removeEventListener("click", closeMenu));
|
|
18
|
+
}
|
|
19
|
+
}, [isExpanded, persistent]);
|
|
20
|
+
const toggleExpanded = () => {
|
|
21
|
+
const newExpanded = !isExpanded;
|
|
22
|
+
setIsExpanded(newExpanded);
|
|
23
|
+
newExpanded ? onExpanded?.() : onClosed?.();
|
|
24
|
+
};
|
|
25
|
+
const closeMenu = () => {
|
|
26
|
+
if (isExpanded)
|
|
27
|
+
toggleExpanded();
|
|
28
|
+
};
|
|
29
|
+
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-inera-admin-nav-mobile", {
|
|
30
|
+
"ids-header-inera-admin-nav-mobile--expanded": isExpanded,
|
|
31
|
+
"ids-header-inera-admin-nav-mobile--unresponsive": headerContext?.unresponsive
|
|
32
|
+
}), children: [jsx("button", { "aria-label": srLabel, "aria-expanded": isExpanded, className: "ids-header-inera-admin-nav-mobile__button", onClick: toggleExpanded, children: jsx("div", { className: "ids-hamburger", children: jsx("div", { className: "ids-hamburger__lines" }) }) }), isExpanded && (jsx("nav", { className: "ids-header-inera-admin-nav-mobile__menu-items", ref: menuRef, children: children }))] }));
|
|
33
|
+
};
|
|
14
34
|
|
|
15
35
|
export { IDSHeaderIneraAdminNavMobile };
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-inera-admin/header-inera-admin-nav.css";
|
|
3
|
+
interface IDSHeaderIneraAdminNavProps {
|
|
4
|
+
srText?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const IDSHeaderIneraAdminNav: React.FC<IDSHeaderIneraAdminNavProps>;
|
|
8
|
+
export {};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import '@inera/ids-design/components/header-inera-admin/header-inera-admin-nav.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
4
6
|
|
|
5
|
-
const IDSHeaderIneraAdminNav =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const IDSHeaderIneraAdminNav = ({ srText = "Huvudmeny", children }) => {
|
|
8
|
+
const headerContext = useHeaderContext();
|
|
9
|
+
const classNames = clsx("ids-header-inera-admin-nav", {
|
|
10
|
+
"ids-header-inera-admin-nav--fluid": headerContext?.fluid,
|
|
11
|
+
"ids-header-inera-admin-nav--unresponsive": headerContext?.unresponsive
|
|
12
|
+
});
|
|
13
|
+
return (jsx("nav", { className: classNames, "aria-label": srText, children: jsx("div", { className: "ids-header-inera-admin-nav__nav-items", children: children }) }));
|
|
14
|
+
};
|
|
10
15
|
|
|
11
16
|
export { IDSHeaderIneraAdminNav };
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-inera-admin/header-inera-admin.css";
|
|
3
|
+
export interface IDSHeaderIneraAdminProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
brandText?: string;
|
|
5
|
+
serviceName?: string;
|
|
6
|
+
fluid?: boolean;
|
|
7
|
+
unresponsive?: boolean;
|
|
8
|
+
items?: ReactNode;
|
|
9
|
+
avatar?: ReactNode;
|
|
10
|
+
skipToContent?: ReactNode;
|
|
11
|
+
brandLink?: ReactNode;
|
|
12
|
+
mobileMenu?: ReactNode;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const IDSHeaderIneraAdmin: React.FC<IDSHeaderIneraAdminProps>;
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { isValidElement, cloneElement } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-inera-admin/header-inera-admin.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { HeaderProvider } from '../utils/contexts/HeaderContext.js';
|
|
5
7
|
|
|
6
|
-
const IDSHeaderIneraAdmin =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const IDSHeaderIneraAdmin = ({ brandText = "", fluid = false, unresponsive = false, items, avatar, skipToContent, brandLink, serviceName = "EN TJÄNST FRÅN INERA", mobileMenu, className, children }) => {
|
|
9
|
+
const renderBrandText = () => {
|
|
10
|
+
if (brandLink && isValidElement(brandLink)) {
|
|
11
|
+
return (jsx("span", { className: "ids-header-inera-admin__brand-text-link", children: cloneElement(brandLink, {
|
|
12
|
+
...brandLink.props,
|
|
13
|
+
children: brandText
|
|
14
|
+
}) }));
|
|
15
|
+
}
|
|
16
|
+
if (brandText) {
|
|
17
|
+
return jsx("h1", { className: "ids-header-inera-admin__brand-text", children: brandText });
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
};
|
|
21
|
+
return (jsx(HeaderProvider, { value: { unresponsive, fluid, hideRegionPicker: true, regionPickerText: "" }, children: jsxs("header", { className: clsx("ids-header-inera-admin", {
|
|
22
|
+
"ids-header-inera-admin--unresponsive": unresponsive,
|
|
23
|
+
"ids-header-inera-admin--fluid": fluid
|
|
24
|
+
}, className), children: [skipToContent && (jsx("div", { className: "ids-header-inera-admin__skip-to-content", children: skipToContent })), jsxs("div", { className: "ids-header-inera-admin__inner", children: [jsxs("div", { className: "ids-header-inera-admin__service-wrapper", children: [renderBrandText(), jsx("h2", { className: "ids-header-inera-admin__service-name", children: serviceName })] }), jsxs("div", { className: "ids-header-inera-admin__items", children: [items, " ", avatar, " ", mobileMenu] })] }), children] }) }));
|
|
25
|
+
};
|
|
11
26
|
|
|
12
27
|
export { IDSHeaderIneraAdmin };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-patient/header-patient.css";
|
|
3
|
+
interface IDSHeaderPatientProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
srLabel?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
ssn?: string;
|
|
7
|
+
collapse?: boolean;
|
|
8
|
+
stack?: boolean;
|
|
9
|
+
buttons?: ReactNode;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const IDSHeaderPatient: React.FC<IDSHeaderPatientProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-patient/header-patient.css';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
|
|
7
|
+
const IDSHeaderPatient = ({ srLabel = "", name = "", ssn = "", collapse = false, stack = false, buttons, className, children }) => {
|
|
8
|
+
const isLong = useMemo(() => {
|
|
9
|
+
const trimmed = name.trim();
|
|
10
|
+
const whitespaceCount = (trimmed.match(/\s/g) || []).length;
|
|
11
|
+
return whitespaceCount > 2 && trimmed.length > 20;
|
|
12
|
+
}, [name]);
|
|
13
|
+
const classNames = clsx("ids-header-patient", {
|
|
14
|
+
"ids-header-patient--stack": stack,
|
|
15
|
+
"ids-header-patient--collapse": collapse,
|
|
16
|
+
"ids-header-patient--long-name": isLong
|
|
17
|
+
}, className);
|
|
18
|
+
return (jsx("section", { className: classNames, "aria-label": srLabel, children: jsxs("div", { className: "ids-patient-header__inner", children: [jsxs("div", { className: "ids-header-patient__content", children: [jsxs("div", { className: "ids-header-patient__id", children: [jsx("span", { className: "ids-header-patient__name", children: name }), jsx("span", { className: "ids-header-patient__ssn", children: ssn })] }), jsx("div", { className: "ids-header-patient__info", children: children })] }), buttons && jsx("div", { className: "ids-header-patient__buttons", children: buttons })] }) }));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { IDSHeaderPatient };
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import React, { ReactNode, HTMLAttributes, ReactElement } from "react";
|
|
2
|
+
export type ColorPreset = 0 | 1 | 2 | 3 | 4;
|
|
3
|
+
export interface IDSLinkProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
4
|
+
colorPreset?: ColorPreset;
|
|
5
|
+
light?: boolean;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
activeIcon?: boolean;
|
|
8
|
+
block?: boolean;
|
|
9
|
+
underlined?: boolean;
|
|
10
|
+
noUnderline?: boolean;
|
|
11
|
+
small?: boolean;
|
|
12
|
+
large?: boolean;
|
|
13
|
+
focusAnchor?: boolean;
|
|
14
|
+
endItem?: ReactNode;
|
|
15
|
+
children: ReactElement;
|
|
16
|
+
}
|
|
17
|
+
export declare const IDSLink: React.FC<IDSLinkProps>;
|
package/components/link/link.js
CHANGED
|
@@ -1,12 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, isValidElement, cloneElement } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const containsIcon = (node) => {
|
|
7
|
+
if (Array.isArray(node)) {
|
|
8
|
+
return node.some(containsIcon);
|
|
9
|
+
}
|
|
10
|
+
if (isValidElement(node)) {
|
|
11
|
+
const className = node.props.className ?? "";
|
|
12
|
+
const hasIconClass = className.split(" ").some(cls => cls.startsWith("ids-icon-"));
|
|
13
|
+
return hasIconClass || containsIcon(node.props.children);
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
};
|
|
17
|
+
const IDSLink = ({ colorPreset = 0, light = false, active = false, activeIcon = false, block = false, underlined = false, noUnderline = false, small = false, large = false, focusAnchor = false, endItem, children, className, ...props }) => {
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
if (!isValidElement(children)) {
|
|
20
|
+
console.error("IDSLink requires a single valid React element (e.g., <a> or <Link>) as a child.");
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const hasIcon = containsIcon(children.props.children);
|
|
24
|
+
const classNames = clsx("ids-link", colorPreset > 0 && `ids-link--color-${colorPreset}`, {
|
|
25
|
+
"ids-link--icon": hasIcon,
|
|
26
|
+
"ids-link--active-icon": activeIcon,
|
|
27
|
+
"ids-link--light": light || colorPreset === 4,
|
|
28
|
+
"ids-link--block": block,
|
|
29
|
+
"ids-link--small": small,
|
|
30
|
+
"ids-link--large": large,
|
|
31
|
+
"ids-link--active": active,
|
|
32
|
+
"ids-link--underlined": underlined,
|
|
33
|
+
"ids-link--no-underline": noUnderline,
|
|
34
|
+
"ids-focus-anchor": focusAnchor
|
|
35
|
+
}, children.props.className, className);
|
|
36
|
+
const linkContent = (jsxs(Fragment, { children: [children.props.children, endItem && jsx("span", { style: { marginLeft: "0.5rem" }, children: endItem })] }));
|
|
37
|
+
return cloneElement(children, {
|
|
38
|
+
...props,
|
|
39
|
+
className: classNames,
|
|
40
|
+
ref,
|
|
41
|
+
children: linkContent
|
|
42
|
+
});
|
|
43
|
+
};
|
|
11
44
|
|
|
12
45
|
export { IDSLink };
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/mobile-menu/mobile-menu.css";
|
|
3
|
+
export interface IDSMobileMenuItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
level?: number;
|
|
5
|
+
secondary?: boolean;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
headline?: string;
|
|
8
|
+
link?: ReactNode;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
showText?: string;
|
|
11
|
+
hideText?: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
onToggleExpansion?: (isExpanded: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const IDSMobileMenuItem: React.FC<IDSMobileMenuItemProps>;
|
|
@@ -1,14 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import React__default, { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/mobile-menu/mobile-menu.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useElementId } from '../../../utils/hooks/useElementId.js';
|
|
4
7
|
|
|
5
|
-
const IDSMobileMenuItem =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
8
|
+
const IDSMobileMenuItem = ({ level = 1, secondary = false, expanded = false, headline = "", link, active = false, showText = "Visa meddelande", hideText = "Dölj meddelande", children, onToggleExpansion, ...props }) => {
|
|
9
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
10
|
+
const subItemId = useRef(useElementId());
|
|
11
|
+
const contentRef = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setIsExpanded(expanded);
|
|
14
|
+
}, [expanded]);
|
|
15
|
+
const toggleExpanded = () => {
|
|
16
|
+
if (!!children || headline) {
|
|
17
|
+
const newExpanded = !isExpanded;
|
|
18
|
+
setIsExpanded(newExpanded);
|
|
19
|
+
onToggleExpansion?.(newExpanded);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const getItemLevelClass = () => {
|
|
23
|
+
switch (level) {
|
|
24
|
+
case 2:
|
|
25
|
+
return "ids-mobile-menu-item--2";
|
|
26
|
+
case 3:
|
|
27
|
+
return "ids-mobile-menu-item--3";
|
|
28
|
+
default:
|
|
29
|
+
return "ids-mobile-menu-item";
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const renderItem = () => {
|
|
33
|
+
const commonProps = {
|
|
34
|
+
"aria-label": isExpanded ? hideText : showText,
|
|
35
|
+
onClick: toggleExpanded,
|
|
36
|
+
"aria-expanded": isExpanded,
|
|
37
|
+
"aria-controls": subItemId.current,
|
|
38
|
+
className: clsx("ids-mobile-menu-item__expand-btn", !!level && `ids-mobile-menu-item__expand-btn--level-${level}`, {
|
|
39
|
+
"ids-mobile-menu-item__expand-btn--headline": headline,
|
|
40
|
+
"ids-mobile-menu__chevron--expanded": isExpanded
|
|
41
|
+
})
|
|
42
|
+
};
|
|
43
|
+
if (headline) {
|
|
44
|
+
return jsx("button", { ...commonProps, children: headline });
|
|
45
|
+
}
|
|
46
|
+
else if (link && !!children) {
|
|
47
|
+
return (jsxs(Fragment, { children: [link, jsx("button", { ...commonProps })] }));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return link;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return (jsxs("div", { ref: contentRef, className: clsx(getItemLevelClass(), isExpanded && "ids-mobile-menu-item--expanded", active && "ids-mobile-menu-item--active", secondary && "ids-mobile-menu-item--secondary"), ...props, children: [jsx("div", { className: `ids-mobile-menu-item__inner ${level && "ids-mobile-menu-item__inner--level-" + level}`, children: renderItem() }), jsx("div", { id: subItemId.current, className: "ids-mobile-menu-item__sub-items", children: React__default.Children.map(children, child => React__default.isValidElement(child)
|
|
54
|
+
? React__default.cloneElement(child, {
|
|
55
|
+
"data-ids-sub-item": true,
|
|
56
|
+
level: level + 1
|
|
57
|
+
})
|
|
58
|
+
: child) })] }));
|
|
59
|
+
};
|
|
13
60
|
|
|
14
61
|
export { IDSMobileMenuItem };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/mobile-menu/mobile-menu.css";
|
|
3
|
+
export interface IDSMobileMenuProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
variation?: number;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const IDSMobileMenu: React.FC<IDSMobileMenuProps>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import '@inera/ids-design/components/mobile-menu/mobile-menu.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
|
-
const IDSMobileMenu =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
const IDSMobileMenu = ({ variation = 1, children, className, ...props }) => {
|
|
7
|
+
return (jsx("div", { className: clsx("ids-mobile-menu", {
|
|
8
|
+
"ids-mobile-menu--variation-2": variation === 2
|
|
9
|
+
}, className), ...props, children: children }));
|
|
10
|
+
};
|
|
11
11
|
|
|
12
12
|
export { IDSMobileMenu };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/navigation/content/navigation-content.css";
|
|
3
|
+
export interface IDSNavigationContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
headline?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const IDSNavigationContent: React.FC<IDSNavigationContentProps>;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
4
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import '@inera/ids-design/components/navigation/content/navigation-content.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
|
|
6
|
-
const IDSNavigationContent =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const IDSNavigationContent = ({ headline = "", children, className, ...props }) => {
|
|
8
|
+
const enhancedLinks = React__default.Children.map(children, (link, i) => {
|
|
9
|
+
if (!React__default.isValidElement(link))
|
|
10
|
+
return link;
|
|
11
|
+
const cloned = React__default.cloneElement(link, {
|
|
12
|
+
key: `navigation-content-link-${i}`,
|
|
13
|
+
block: true,
|
|
14
|
+
noUnderline: true
|
|
15
|
+
});
|
|
16
|
+
return (jsx("div", { className: "ids-navigation-content__link-wrapper", children: cloned }, `link-wrapper-${i}`));
|
|
17
|
+
});
|
|
18
|
+
return (jsxs("div", { className: clsx("ids-navigation-content", className), ...props, children: [jsx("div", { className: "ids-navigation-content__border-top", children: jsx("div", { className: "ids-navigation-content__border-top-content" }) }), jsxs("nav", { className: "ids-navigation-content__inner", "aria-labelledby": "content-navigation-headline", id: "content-navigation-inner", children: [jsx("h2", { className: "ids-navigation-content__inner__headline", id: "content-navigation-headline", children: headline }), jsx("div", { className: "ids-navigation-content__links", children: enhancedLinks })] })] }));
|
|
19
|
+
};
|
|
11
20
|
|
|
12
21
|
export { IDSNavigationContent };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/navigation/local/navigation-local.css";
|
|
3
|
+
export interface IDSNavigationLocalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
headline?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const IDSNavigationLocal: React.FC<IDSNavigationLocalProps>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import '
|
|
4
|
-
import { IDSNavigationLocal as IDSNavigationLocal$1 } from '@inera/ids-core/components/navigation/local/navigation-local-element.js';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import '@inera/ids-design/components/navigation/local/navigation-local.css';
|
|
3
|
+
import clsx from 'clsx';
|
|
5
4
|
|
|
6
|
-
const IDSNavigationLocal =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
react: React
|
|
10
|
-
});
|
|
5
|
+
const IDSNavigationLocal = ({ headline = "", children, className, ...props }) => {
|
|
6
|
+
return (jsxs("div", { className: clsx("ids-navigation-local", className), ...props, children: [jsx("h2", { className: "ids-navigation-local__headline", children: headline }), jsx("div", { className: "ids-navigation-local__links", children: children })] }));
|
|
7
|
+
};
|
|
11
8
|
|
|
12
9
|
export { IDSNavigationLocal };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/notification-badge/notification-badge.css";
|
|
3
|
-
interface IDSNotificationBadgeProps {
|
|
4
|
-
|
|
3
|
+
interface IDSNotificationBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
type?: "primary" | "secondary" | "neutral" | "info" | "attention" | "success" | "error";
|
|
5
|
+
icon?: string;
|
|
6
|
+
onClick?: () => void;
|
|
5
7
|
children?: ReactNode;
|
|
6
8
|
}
|
|
7
9
|
export declare const IDSNotificationBadge: React.FC<IDSNotificationBadgeProps>;
|