@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,61 +1,24 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
2
|
import clsx from 'clsx';
|
|
5
3
|
import '@inera/ids-design/components/footer-1177-admin/footer-1177-admin.css';
|
|
6
4
|
|
|
7
5
|
const IDSFooter1177Admin = ({ headline = "", srHeadline = "", cols = 3, col1 = [], col2 = [], col3 = [], subFooterLeft, subFooterRight, mobileMenu, mobileLinks, subFooterMobile, children, className, ...props }) => {
|
|
8
|
-
const ref = useRef(null);
|
|
9
6
|
const renderHeadline = () => {
|
|
10
7
|
if (srHeadline) {
|
|
11
8
|
return (jsxs(Fragment, { children: [jsx("h2", { className: "ids-footer-1177-admin__headline--sr", children: srHeadline }), jsx("h2", { "aria-hidden": "true", className: "ids-footer-1177-admin__headline", children: headline })] }));
|
|
12
9
|
}
|
|
13
10
|
return jsx("h2", { className: "ids-footer-1177-admin__headline", children: headline });
|
|
14
11
|
};
|
|
15
|
-
const renderCol = (column) => {
|
|
16
|
-
return column?.map((link, idx) => {
|
|
17
|
-
if (React.isValidElement(link)) {
|
|
18
|
-
return React.cloneElement(link, {
|
|
19
|
-
key: `footer-link-${idx}`,
|
|
20
|
-
footer: true,
|
|
21
|
-
block: true
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return link;
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
12
|
const renderCols = () => {
|
|
28
13
|
if (cols === 1) {
|
|
29
|
-
return
|
|
14
|
+
return jsx("div", { className: clsx("ids-footer-1177-admin__link-col", "ids-footer-1177-admin__link-col--100"), children: col1 });
|
|
30
15
|
}
|
|
31
16
|
else if (cols === 2) {
|
|
32
|
-
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-1177-admin__link-col", "ids-footer-1177-admin__link-col--50"), children:
|
|
17
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-1177-admin__link-col", "ids-footer-1177-admin__link-col--50"), children: col1 }), jsx("div", { className: clsx("ids-footer-1177-admin__link-col", "ids-footer-1177-admin__link-col--50"), children: col2 })] }));
|
|
33
18
|
}
|
|
34
|
-
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-1177-admin__link-col", "ids-footer-1177-admin__link-col--33"), children:
|
|
35
|
-
};
|
|
36
|
-
const renderLinks = (content) => {
|
|
37
|
-
const applyProps = (node, keyPrefix = "") => {
|
|
38
|
-
if (!node)
|
|
39
|
-
return null;
|
|
40
|
-
if (Array.isArray(node)) {
|
|
41
|
-
return node.map((child, idx) => applyProps(child, `${keyPrefix}-${idx}`));
|
|
42
|
-
}
|
|
43
|
-
if (React.isValidElement(node)) {
|
|
44
|
-
if (node.type === React.Fragment) {
|
|
45
|
-
return (jsx(React.Fragment, { children: applyProps(node.props.children, keyPrefix) }, keyPrefix));
|
|
46
|
-
}
|
|
47
|
-
return React.cloneElement(node, {
|
|
48
|
-
key: `footer-sub-footer-right-link-${keyPrefix}`,
|
|
49
|
-
colorPreset: 3,
|
|
50
|
-
small: true,
|
|
51
|
-
...node.props
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return node;
|
|
55
|
-
};
|
|
56
|
-
return applyProps(content, "root");
|
|
19
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-1177-admin__link-col", "ids-footer-1177-admin__link-col--33"), children: col1 }), jsx("div", { className: clsx("ids-footer-1177-admin__link-col", "ids-footer-1177-admin__link-col--33"), children: col2 }), jsx("div", { className: clsx("ids-footer-1177-admin__link-col", "ids-footer-1177-admin__link-col--33"), children: col3 })] }));
|
|
57
20
|
};
|
|
58
|
-
return (jsxs("footer", { className: clsx("ids-footer-1177-admin", className),
|
|
21
|
+
return (jsxs("footer", { className: clsx("ids-footer-1177-admin", className), ...props, children: [jsx("div", { className: "ids-footer-1177-admin__inner-wrapper", children: jsxs("div", { className: "ids-footer-1177-admin__inner", children: [jsx("div", { className: "ids-footer-1177-admin__headline-wrapper", children: renderHeadline() }), jsxs("div", { className: "ids-footer-1177-admin__content", children: [jsx("div", { className: "ids-footer-1177-admin__text", children: children }), jsx("div", { className: "ids-footer-1177-admin__cols", children: renderCols() })] })] }) }), jsx("div", { className: "ids-footer-1177-admin__mobile-menu", children: mobileMenu }), jsxs("div", { className: "ids-footer-1177-admin__sub-footer", children: [jsx("div", { className: "ids-footer-1177-admin__sub-footer-container", children: jsxs("div", { className: "ids-footer-1177-admin__sub-footer-inner", children: [jsx("div", { className: "ids-footer-1177-admin__sub-footer-left", children: subFooterLeft }), jsx("div", { className: "ids-footer-1177-admin__sub-footer-right", children: subFooterRight }), jsx("div", { className: "ids-footer-1177-admin__mobile-links", children: mobileLinks })] }) }), jsxs("div", { className: "ids-footer-1177-admin__sub-footer-mobile", children: [jsxs("div", { className: "ids-footer-1177-admin__sub-footer-mobile-headline-wrapper", children: [jsx("div", { className: "ids-footer-1177-admin__sub-footer-mobile-logo" }), jsx("div", { className: "ids-footer-1177-admin__sub-footer-mobile-headline", children: headline })] }), jsx("div", { className: "ids-footer-1177-admin__sub-footer-mobile-text", children: subFooterMobile })] })] })] }));
|
|
59
22
|
};
|
|
60
23
|
|
|
61
24
|
export { IDSFooter1177Admin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement, ReactNode } from "react";
|
|
2
|
-
import "@inera/ids-design/components/footer-1177-pro/footer-1177-pro.css";
|
|
3
2
|
import { IDSLinkProps } from "../link/link";
|
|
3
|
+
import "@inera/ids-design/components/footer-1177-pro/footer-1177-pro.css";
|
|
4
4
|
interface Footer1177ProProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
headline?: string;
|
|
6
6
|
srHeadline?: string;
|
|
@@ -1,61 +1,24 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
2
|
import clsx from 'clsx';
|
|
5
3
|
import '@inera/ids-design/components/footer-1177-pro/footer-1177-pro.css';
|
|
6
4
|
|
|
7
5
|
const IDSFooter1177Pro = ({ headline = "", srHeadline = "", cols = 3, col1 = [], col2 = [], col3 = [], col1Headline, col2Headline, col3Headline, subFooterLeft, subFooterRight, mobileMenu, mobileLinks, subFooterMobile, children, className, ...props }) => {
|
|
8
|
-
const ref = useRef(null);
|
|
9
6
|
const renderHeadline = () => {
|
|
10
7
|
if (srHeadline) {
|
|
11
8
|
return (jsxs(Fragment, { children: [jsx("h2", { className: "ids-footer-1177-pro__headline--sr", children: srHeadline }), jsx("h2", { "aria-hidden": "true", className: "ids-footer-1177-pro__headline", children: headline })] }));
|
|
12
9
|
}
|
|
13
10
|
return jsx("h2", { className: "ids-footer-1177-pro__headline", children: headline });
|
|
14
11
|
};
|
|
15
|
-
const renderCol = (column) => {
|
|
16
|
-
return column?.map((link, idx) => {
|
|
17
|
-
if (React.isValidElement(link)) {
|
|
18
|
-
return React.cloneElement(link, {
|
|
19
|
-
key: `footer-link-${idx}`,
|
|
20
|
-
footer: true,
|
|
21
|
-
block: true
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return link;
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
12
|
const renderCols = () => {
|
|
28
13
|
if (cols === 1) {
|
|
29
|
-
return (jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--100"), children: [col1Headline,
|
|
14
|
+
return (jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--100"), children: [col1Headline, col1] }));
|
|
30
15
|
}
|
|
31
16
|
else if (cols === 2) {
|
|
32
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--50"), children: [col1Headline,
|
|
17
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--50"), children: [col1Headline, col1] }), jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--50"), children: [col2Headline, col2] })] }));
|
|
33
18
|
}
|
|
34
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--33"), children: [col1Headline,
|
|
35
|
-
};
|
|
36
|
-
const renderLinks = (content) => {
|
|
37
|
-
const applyProps = (node, keyPrefix = "") => {
|
|
38
|
-
if (!node)
|
|
39
|
-
return null;
|
|
40
|
-
if (Array.isArray(node)) {
|
|
41
|
-
return node.map((child, idx) => applyProps(child, `${keyPrefix}-${idx}`));
|
|
42
|
-
}
|
|
43
|
-
if (React.isValidElement(node)) {
|
|
44
|
-
if (node.type === React.Fragment) {
|
|
45
|
-
return (jsx(React.Fragment, { children: applyProps(node.props.children, keyPrefix) }, keyPrefix));
|
|
46
|
-
}
|
|
47
|
-
return React.cloneElement(node, {
|
|
48
|
-
key: `footer-sub-footer-right-link-${keyPrefix}`,
|
|
49
|
-
colorPreset: 3,
|
|
50
|
-
small: true,
|
|
51
|
-
...node.props
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return node;
|
|
55
|
-
};
|
|
56
|
-
return applyProps(content, "root");
|
|
19
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--33"), children: [col1Headline, col1] }), jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--33"), children: [col2Headline, col2] }), jsxs("div", { className: clsx("ids-footer-1177-pro__link-col", "ids-footer-1177-pro__link-col--33"), children: [col3Headline, col3] })] }));
|
|
57
20
|
};
|
|
58
|
-
return (jsxs("footer", { className: clsx("ids-footer-1177-pro", className),
|
|
21
|
+
return (jsxs("footer", { className: clsx("ids-footer-1177-pro", className), ...props, children: [jsx("div", { className: "ids-footer-1177-pro__inner-wrapper", children: jsxs("div", { className: "ids-footer-1177-pro__inner", children: [jsx("div", { className: "ids-footer-1177-pro__headline-wrapper", children: renderHeadline() }), jsxs("div", { className: "ids-footer-1177-pro__content", children: [jsx("div", { className: "ids-footer-1177-pro__text", children: children }), jsx("div", { className: "ids-footer-1177-pro__cols", children: renderCols() })] })] }) }), jsx("div", { className: "ids-footer-1177-pro__mobile-menu", children: mobileMenu }), jsxs("div", { className: "ids-footer-1177-pro__sub-footer", children: [jsx("div", { className: "ids-footer-1177-pro__sub-footer-container", children: jsxs("div", { className: "ids-footer-1177-pro__sub-footer-inner", children: [jsx("div", { className: "ids-footer-1177-pro__sub-footer-left", children: subFooterLeft }), jsx("div", { className: "ids-footer-1177-pro__sub-footer-right", children: subFooterRight }), jsx("div", { className: "ids-footer-1177-pro__mobile-links", children: mobileLinks })] }) }), jsxs("div", { className: "ids-footer-1177-pro__sub-footer-mobile", children: [jsxs("div", { className: "ids-footer-1177-pro__sub-footer-mobile-headline-wrapper", children: [jsx("div", { className: "ids-footer-1177-pro__sub-footer-mobile-logo" }), jsx("div", { className: "ids-footer-1177-pro__sub-footer-mobile-headline", children: headline })] }), jsx("div", { className: "ids-footer-1177-pro__sub-footer-mobile-text", children: subFooterMobile })] })] })] }));
|
|
59
22
|
};
|
|
60
23
|
|
|
61
24
|
export { IDSFooter1177Pro };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement, ReactNode } from "react";
|
|
2
|
-
import "@inera/ids-design/components/footer-inera/footer-inera.css";
|
|
3
2
|
import { IDSLinkProps } from "../link/link";
|
|
3
|
+
import "@inera/ids-design/components/footer-inera/footer-inera.css";
|
|
4
4
|
interface FooterIneraProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
headline?: string;
|
|
6
6
|
srHeadline?: string;
|
|
@@ -1,61 +1,24 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
2
|
import clsx from 'clsx';
|
|
5
3
|
import '@inera/ids-design/components/footer-inera/footer-inera.css';
|
|
6
4
|
|
|
7
5
|
const IDSFooterInera = ({ headline = "", srHeadline = "", cols = 3, col1 = [], col2 = [], col3 = [], subFooterLeft, subFooterRight, mobileMenu, mobileLinks, subFooterMobile, children, className, ...props }) => {
|
|
8
|
-
const ref = useRef(null);
|
|
9
6
|
const renderHeadline = () => {
|
|
10
7
|
if (srHeadline) {
|
|
11
8
|
return (jsxs(Fragment, { children: [jsx("h2", { className: "ids-footer-inera__headline--sr", children: srHeadline }), jsx("h2", { "aria-hidden": "true", className: "ids-footer-inera__headline", children: headline })] }));
|
|
12
9
|
}
|
|
13
10
|
return jsx("h2", { className: "ids-footer-inera__headline", children: headline });
|
|
14
11
|
};
|
|
15
|
-
const renderCol = (column) => {
|
|
16
|
-
return column?.map((link, idx) => {
|
|
17
|
-
if (React.isValidElement(link)) {
|
|
18
|
-
return React.cloneElement(link, {
|
|
19
|
-
key: `footer-link-${idx}`,
|
|
20
|
-
footer: true,
|
|
21
|
-
block: true
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return link;
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
12
|
const renderCols = () => {
|
|
28
13
|
if (cols === 1) {
|
|
29
|
-
return jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--100"), children:
|
|
14
|
+
return jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--100"), children: col1 });
|
|
30
15
|
}
|
|
31
16
|
else if (cols === 2) {
|
|
32
|
-
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--50"), children:
|
|
17
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--50"), children: col1 }), jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--50"), children: col2 })] }));
|
|
33
18
|
}
|
|
34
|
-
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--33"), children:
|
|
35
|
-
};
|
|
36
|
-
const renderLinks = (content) => {
|
|
37
|
-
const applyProps = (node, keyPrefix = "") => {
|
|
38
|
-
if (!node)
|
|
39
|
-
return null;
|
|
40
|
-
if (Array.isArray(node)) {
|
|
41
|
-
return node.map((child, idx) => applyProps(child, `${keyPrefix}-${idx}`));
|
|
42
|
-
}
|
|
43
|
-
if (React.isValidElement(node)) {
|
|
44
|
-
if (node.type === React.Fragment) {
|
|
45
|
-
return (jsx(React.Fragment, { children: applyProps(node.props.children, keyPrefix) }, keyPrefix));
|
|
46
|
-
}
|
|
47
|
-
return React.cloneElement(node, {
|
|
48
|
-
key: `footer-sub-footer-right-link-${keyPrefix}`,
|
|
49
|
-
colorPreset: 3,
|
|
50
|
-
small: true,
|
|
51
|
-
...node.props
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return node;
|
|
55
|
-
};
|
|
56
|
-
return applyProps(content, "root");
|
|
19
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--33"), children: col1 }), jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--33"), children: col2 }), jsx("div", { className: clsx("ids-footer-inera__link-col", "ids-footer-inera__link-col--33"), children: col3 })] }));
|
|
57
20
|
};
|
|
58
|
-
return (jsxs("footer", { className: clsx("ids-footer-inera", className),
|
|
21
|
+
return (jsxs("footer", { className: clsx("ids-footer-inera", className), ...props, children: [jsx("div", { className: "ids-footer-inera__inner-wrapper", children: jsxs("div", { className: "ids-footer-inera__inner", children: [jsx("div", { className: "ids-footer-inera__headline-wrapper", children: renderHeadline() }), jsxs("div", { className: "ids-footer-inera__content", children: [jsx("div", { className: "ids-footer-inera__text", children: children }), jsx("div", { className: "ids-footer-inera__cols", children: renderCols() })] })] }) }), jsx("div", { className: "ids-footer-inera__mobile-menu", children: mobileMenu }), jsxs("div", { className: "ids-footer-inera__sub-footer", children: [jsx("div", { className: "ids-footer-inera__sub-footer-container", children: jsxs("div", { className: "ids-footer-inera__sub-footer-inner", children: [jsx("div", { className: "ids-footer-inera__sub-footer-left", children: subFooterLeft }), jsx("div", { className: "ids-footer-inera__sub-footer-right", children: subFooterRight }), jsx("div", { className: "ids-footer-inera__mobile-links", children: mobileLinks })] }) }), jsx("div", { className: "ids-footer-inera__sub-footer-mobile", children: jsx("div", { className: "ids-footer-inera__sub-footer-mobile-text", children: subFooterMobile }) })] })] }));
|
|
59
22
|
};
|
|
60
23
|
|
|
61
24
|
export { IDSFooterInera };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement, ReactNode } from "react";
|
|
2
|
-
import "@inera/ids-design/components/footer-inera-admin/footer-inera-admin.css";
|
|
3
2
|
import { IDSLinkProps } from "../link/link";
|
|
3
|
+
import "@inera/ids-design/components/footer-inera-admin/footer-inera-admin.css";
|
|
4
4
|
interface FooterIneraAdminProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
headline?: string;
|
|
6
6
|
srHeadline?: string;
|
|
@@ -1,61 +1,24 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
2
|
import clsx from 'clsx';
|
|
5
3
|
import '@inera/ids-design/components/footer-inera-admin/footer-inera-admin.css';
|
|
6
4
|
|
|
7
5
|
const IDSFooterIneraAdmin = ({ headline = "", srHeadline = "", cols = 3, col1 = [], col2 = [], col3 = [], subFooterLeft, subFooterRight, mobileMenu, mobileLinks, subFooterMobile, children, className, ...props }) => {
|
|
8
|
-
const ref = useRef(null);
|
|
9
6
|
const renderHeadline = () => {
|
|
10
7
|
if (srHeadline) {
|
|
11
8
|
return (jsxs(Fragment, { children: [jsx("h2", { className: "ids-footer-inera-admin__headline--sr", children: srHeadline }), jsx("h2", { "aria-hidden": "true", className: "ids-footer-inera-admin__headline", children: headline })] }));
|
|
12
9
|
}
|
|
13
10
|
return jsx("h2", { className: "ids-footer-inera-admin__headline", children: headline });
|
|
14
11
|
};
|
|
15
|
-
const renderCol = (column) => {
|
|
16
|
-
return column?.map((link, idx) => {
|
|
17
|
-
if (React.isValidElement(link)) {
|
|
18
|
-
return React.cloneElement(link, {
|
|
19
|
-
key: `footer-link-${idx}`,
|
|
20
|
-
footer: true,
|
|
21
|
-
block: true
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return link;
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
12
|
const renderCols = () => {
|
|
28
13
|
if (cols === 1) {
|
|
29
|
-
return (jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--100"), children:
|
|
14
|
+
return (jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--100"), children: col1 }));
|
|
30
15
|
}
|
|
31
16
|
else if (cols === 2) {
|
|
32
|
-
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--50"), children:
|
|
17
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--50"), children: col1 }), jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--50"), children: col2 })] }));
|
|
33
18
|
}
|
|
34
|
-
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--33"), children:
|
|
35
|
-
};
|
|
36
|
-
const renderLinks = (content) => {
|
|
37
|
-
const applyProps = (node, keyPrefix = "") => {
|
|
38
|
-
if (!node)
|
|
39
|
-
return null;
|
|
40
|
-
if (Array.isArray(node)) {
|
|
41
|
-
return node.map((child, idx) => applyProps(child, `${keyPrefix}-${idx}`));
|
|
42
|
-
}
|
|
43
|
-
if (React.isValidElement(node)) {
|
|
44
|
-
if (node.type === React.Fragment) {
|
|
45
|
-
return (jsx(React.Fragment, { children: applyProps(node.props.children, keyPrefix) }, keyPrefix));
|
|
46
|
-
}
|
|
47
|
-
return React.cloneElement(node, {
|
|
48
|
-
key: `footer-sub-footer-right-link-${keyPrefix}`,
|
|
49
|
-
colorPreset: 3,
|
|
50
|
-
small: true,
|
|
51
|
-
...node.props
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return node;
|
|
55
|
-
};
|
|
56
|
-
return applyProps(content, "root");
|
|
19
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--33"), children: col1 }), jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--33"), children: col2 }), jsx("div", { className: clsx("ids-footer-inera-admin__link-col", "ids-footer-inera-admin__link-col--33"), children: col3 })] }));
|
|
57
20
|
};
|
|
58
|
-
return (jsxs("footer", { className: clsx("ids-footer-inera-admin", className),
|
|
21
|
+
return (jsxs("footer", { className: clsx("ids-footer-inera-admin", className), ...props, children: [jsx("div", { className: "ids-footer-inera-admin__inner-wrapper", children: jsxs("div", { className: "ids-footer-inera-admin__inner", children: [jsx("div", { className: "ids-footer-inera-admin__headline-wrapper", children: renderHeadline() }), jsxs("div", { className: "ids-footer-inera-admin__content", children: [jsx("div", { className: "ids-footer-inera-admin__text", children: children }), jsx("div", { className: "ids-footer-inera-admin__cols", children: renderCols() })] })] }) }), jsx("div", { className: "ids-footer-inera-admin__mobile-menu", children: mobileMenu }), jsxs("div", { className: "ids-footer-inera-admin__sub-footer", children: [jsx("div", { className: "ids-footer-inera-admin__sub-footer-container", children: jsxs("div", { className: "ids-footer-inera-admin__sub-footer-inner", children: [jsx("div", { className: "ids-footer-inera-admin__sub-footer-left", children: subFooterLeft }), jsx("div", { className: "ids-footer-inera-admin__sub-footer-right", children: subFooterRight }), jsx("div", { className: "ids-footer-inera-admin__mobile-links", children: mobileLinks })] }) }), jsxs("div", { className: "ids-footer-inera-admin__sub-footer-mobile", children: [jsxs("div", { className: "ids-footer-inera-admin__sub-footer-mobile-headline-wrapper", children: [jsx("div", { className: "ids-footer-inera-admin__sub-footer-mobile-logo" }), jsx("div", { className: "ids-footer-inera-admin__sub-footer-mobile-headline", children: headline })] }), jsx("div", { className: "ids-footer-inera-admin__sub-footer-mobile-text", children: subFooterMobile })] })] })] }));
|
|
59
22
|
};
|
|
60
23
|
|
|
61
24
|
export { IDSFooterIneraAdmin };
|
|
@@ -47,7 +47,7 @@ const IDSCheckbox = forwardRef(({ invalid = false, disabled = false, required =
|
|
|
47
47
|
}), "aria-invalid": isInvalid, disabled: disabled, "aria-disabled": disabled, required: !noValidation && required, "aria-required": !noValidation && required, ...props }), jsxs("div", { className: clsx("ids-label-tooltip-wrapper", {
|
|
48
48
|
"ids-label-tooltip-wrapper--block": block,
|
|
49
49
|
"ids-label-tooltip-wrapper--inline": tooltip
|
|
50
|
-
}), children: [jsx("label", { htmlFor: fieldId, className: clsx("
|
|
50
|
+
}), children: [jsx("label", { htmlFor: fieldId, className: clsx("ids-checkbox__label", {
|
|
51
51
|
"ids-label--clickable": disabled,
|
|
52
52
|
"ids-label--no-label": noLabel
|
|
53
53
|
}), children: !noLabel && children }), tooltip] })] }), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, compact: true, children: errorMsg }))] }));
|
|
@@ -5,7 +5,7 @@ import '@inera/ids-design/components/global-alert/global-alert.css';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
7
7
|
|
|
8
|
-
const IDSGlobalAlert = ({ agent = false, srExpandText = "Visa meddelande", srCollapseText = "Dölj meddelande", collapsed = false, noRole = false, onCollapsedChange,
|
|
8
|
+
const IDSGlobalAlert = ({ agent = false, srExpandText = "Visa meddelande", srCollapseText = "Dölj meddelande", collapsed = false, noRole = false, onCollapsedChange, actions, headline = "", children, className, ...props }) => {
|
|
9
9
|
const [isCollapsed, setIsCollapsed] = useState(collapsed);
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
setIsCollapsed(collapsed);
|
|
@@ -20,7 +20,7 @@ const IDSGlobalAlert = ({ agent = false, srExpandText = "Visa meddelande", srCol
|
|
|
20
20
|
"ids-global-alert--agent": agent
|
|
21
21
|
}, className), ...props, children: jsxs("div", { className: "ids-global-alert__inner", children: [jsx("div", { className: "ids-global-alert__header", children: jsx("button", { className: clsx("ids-global-alert__button", {
|
|
22
22
|
"ids-global-alert__button--expanded": !isCollapsed
|
|
23
|
-
}), "aria-controls": contentId, "aria-expanded": !isCollapsed, onClick: handleToggleCollapse, children: jsxs("div", { className: "ids-global-alert__icon-headline", children: [
|
|
23
|
+
}), "aria-controls": contentId, "aria-expanded": !isCollapsed, onClick: handleToggleCollapse, children: jsxs("div", { className: "ids-global-alert__icon-headline", children: [jsx("div", { className: "ids-global-alert__headline", children: headline }), jsx("span", { className: "ids-global-alert__sr-only", children: isCollapsed ? srExpandText : srCollapseText })] }) }) }), jsxs("div", { id: contentId, className: "ids-global-alert__content", children: [children, actions && jsx("div", { className: "ids-global-alert__sub-content", children: actions })] })] }) }));
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export { IDSGlobalAlert };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/grid/column/column.css";
|
|
3
|
+
export type ColSize = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "auto";
|
|
4
|
+
export type OffsetSize = Exclude<ColSize, "auto">;
|
|
3
5
|
export interface IDSColumnProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
6
|
cols?: ColSize;
|
|
5
7
|
s?: ColSize;
|
|
@@ -10,7 +12,4 @@ export interface IDSColumnProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
10
12
|
alignSelf?: "start" | "center" | "end" | "auto" | "baseline" | "stretch";
|
|
11
13
|
children?: ReactNode;
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
type OffsetSize = Exclude<ColSize, "auto">;
|
|
15
|
-
export declare const IDSColumn: React.FC<IDSColumnProps>;
|
|
16
|
-
export {};
|
|
15
|
+
export declare function IDSColumn({ cols, s, m, offset, sOffset, mOffset, alignSelf, className, children, style, ...props }: IDSColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { useRef } from 'react';
|
|
4
3
|
import '@inera/ids-design/components/grid/column/column.css';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
function IDSColumn({ cols, s, m, offset, sOffset, mOffset, alignSelf, className, children, style, ...props }) {
|
|
8
7
|
const colRef = useRef(null);
|
|
9
8
|
const classNames = clsx("ids-col", cols && `ids-col--${cols}`, s && `ids-col--s-${s}`, m && `ids-col--m-${m}`, offset && `ids-col--offset-${offset}`, sOffset && `ids-col--s-offset-${sOffset}`, mOffset && `ids-col--m-offset-${mOffset}`, alignSelf && `ids-col--align-${alignSelf}`, className);
|
|
10
9
|
return (jsx("div", { ref: colRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
11
|
-
}
|
|
10
|
+
}
|
|
12
11
|
|
|
13
12
|
export { IDSColumn };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, HTMLAttributes } from "react";
|
|
2
2
|
import "@inera/ids-design/components/grid/container/container.css";
|
|
3
|
-
export interface IDSContainerProps extends
|
|
3
|
+
export interface IDSContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
width?: string;
|
|
5
|
+
maxWidth?: string;
|
|
5
6
|
gutterless?: boolean;
|
|
6
7
|
children?: ReactNode;
|
|
7
8
|
}
|
|
8
|
-
export declare const IDSContainer:
|
|
9
|
+
export declare const IDSContainer: import("react").ForwardRefExoticComponent<IDSContainerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
2
|
+
import { forwardRef } from 'react';
|
|
4
3
|
import '@inera/ids-design/components/grid/container/container.css';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
|
|
7
|
-
const IDSContainer = ({
|
|
8
|
-
const
|
|
6
|
+
const IDSContainer = forwardRef(({ gutterless = false, width, maxWidth, children, className, style, ...props }, ref) => {
|
|
7
|
+
const mergedStyle = { ...style, width: width ?? style?.width, maxWidth: maxWidth ?? style?.maxWidth };
|
|
9
8
|
const classNames = clsx("ids-container", gutterless && `ids-container--gutterless-${gutterless}`, className);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (width) {
|
|
14
|
-
el.style.maxWidth = `${width}px`;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
el.style.maxWidth = "";
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}, [width]);
|
|
21
|
-
return (jsx("div", { ref: containerRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
22
|
-
};
|
|
9
|
+
return (jsx("div", { ref: ref, className: classNames, style: mergedStyle, ...props, children: children }));
|
|
10
|
+
});
|
|
11
|
+
IDSContainer.displayName = "IDSContainer";
|
|
23
12
|
|
|
24
13
|
export { IDSContainer };
|
package/components/grid/row.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, HTMLAttributes } from "react";
|
|
2
2
|
import "@inera/ids-design/components/grid/row/row.css";
|
|
3
|
-
export interface IDSRowProps extends
|
|
3
|
+
export interface IDSRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
gap?: string;
|
|
4
5
|
align?: "start" | "center" | "end" | "baseline" | "stretch";
|
|
5
6
|
justify?: "start" | "center" | "end" | "space-between" | "space-around";
|
|
6
|
-
gap?: string;
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare const IDSRow:
|
|
9
|
+
export declare const IDSRow: import("react").ForwardRefExoticComponent<IDSRowProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/components/grid/row.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
2
|
+
import { forwardRef } from 'react';
|
|
4
3
|
import '@inera/ids-design/components/grid/row/row.css';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
|
|
7
|
-
const IDSRow = ({ align, justify,
|
|
8
|
-
const rowRef = useRef(null);
|
|
6
|
+
const IDSRow = forwardRef(({ gap, align, justify, children, className, style, ...props }, ref) => {
|
|
9
7
|
const classNames = clsx("ids-row", align && `ids-row--align-${align}`, justify && `ids-row--justify-${justify}`, className);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, [gap]);
|
|
15
|
-
return (jsx("div", { ref: rowRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
16
|
-
};
|
|
8
|
+
const mergedStyle = { ...style, gap: gap ?? style?.gap };
|
|
9
|
+
return (jsx("div", { ref: ref, className: classNames, style: mergedStyle, ...props, children: children }));
|
|
10
|
+
});
|
|
11
|
+
IDSRow.displayName = "IDSRow";
|
|
17
12
|
|
|
18
13
|
export { IDSRow };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, HTMLAttributes, PropsWithChildren } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177/header-1177-item.css";
|
|
3
3
|
interface IDSHeader1177ItemProps extends HTMLAttributes<HTMLElement> {
|
|
4
4
|
mobile?: boolean;
|
|
@@ -9,5 +9,5 @@ interface IDSHeader1177ItemProps extends HTMLAttributes<HTMLElement> {
|
|
|
9
9
|
link?: ReactNode;
|
|
10
10
|
onClick?: () => void;
|
|
11
11
|
}
|
|
12
|
-
export declare
|
|
12
|
+
export declare function IDSHeader1177Item({ mobile, keepTextOnMobile, text, href, icon, link, onClick, ...props }: PropsWithChildren<IDSHeader1177ItemProps>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { isValidElement, cloneElement } from 'react';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React, { isValidElement, cloneElement } from 'react';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
|
-
import '@inera/ids-design/components/header-1177/header-1177-item.css';
|
|
6
4
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
5
|
+
import '@inera/ids-design/components/header-1177/header-1177-item.css';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
const headerContext = useHeaderContext();
|
|
7
|
+
function IDSHeader1177Item({ mobile = false, keepTextOnMobile = false, text = "", href = "", icon, link, onClick, ...props }) {
|
|
8
|
+
const headerContext = useHeaderContext() || { unresponsive: false };
|
|
10
9
|
const classNames = clsx("ids-header-1177-item", {
|
|
11
|
-
"ids-header-1177-item--unresponsive": headerContext
|
|
10
|
+
"ids-header-1177-item--unresponsive": headerContext.unresponsive,
|
|
12
11
|
"ids-header-1177-item--mobile": mobile,
|
|
13
12
|
"ids-header-1177-item--keep-text": keepTextOnMobile
|
|
14
13
|
});
|
|
15
|
-
const renderContent = () => (
|
|
14
|
+
const renderContent = () => (jsx("div", { className: "ids-header-1177-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
|
-
className: clsx(
|
|
20
|
-
children:
|
|
23
|
+
className: clsx(linkProps.className),
|
|
24
|
+
children: hasChildren ? linkProps.children : text
|
|
21
25
|
});
|
|
26
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), " ", newLink] }));
|
|
22
27
|
}
|
|
23
28
|
if (onClick) {
|
|
24
|
-
return (
|
|
29
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("button", { onClick: onClick, ...props, children: text })] }));
|
|
25
30
|
}
|
|
26
|
-
return (
|
|
27
|
-
}
|
|
31
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
|
|
32
|
+
}
|
|
28
33
|
|
|
29
34
|
export { IDSHeader1177Item };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { isValidElement
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { isValidElement } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/header-1177/header-1177-nav-item-mobile.css';
|
|
5
5
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -11,17 +11,12 @@ const IDSHeader1177NavItemMobile = ({ text = "", href = "", icon = "", link, chi
|
|
|
11
11
|
"ids-header-1177-nav-item-mobile--unresponsive": headerContext?.unresponsive
|
|
12
12
|
});
|
|
13
13
|
const renderContent = () => {
|
|
14
|
-
return (
|
|
14
|
+
return (jsx("span", { className: "ids-header-1177-nav-item-mobile__icon", children: jsx("span", { className: `ids-icon-${icon}` }) }));
|
|
15
15
|
};
|
|
16
16
|
if (link && isValidElement(link)) {
|
|
17
|
-
return
|
|
18
|
-
...props,
|
|
19
|
-
style: { textDecoration: "none" },
|
|
20
|
-
className: clsx(link.props.className, classNames),
|
|
21
|
-
children: renderContent()
|
|
22
|
-
});
|
|
17
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), link] }));
|
|
23
18
|
}
|
|
24
|
-
return (
|
|
19
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
|
|
25
20
|
};
|
|
26
21
|
|
|
27
22
|
export { IDSHeader1177NavItemMobile };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { ReactNode, ReactElement } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177/header-1177-nav-item.css";
|
|
3
3
|
import { IDSLinkProps } from "../link/link";
|
|
4
|
-
interface IDSHeader1177NavItemProps {
|
|
4
|
+
export interface IDSHeader1177NavItemProps {
|
|
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?: ReactNode;
|
|
12
|
-
children?: ReactNode;
|
|
13
14
|
}
|
|
14
15
|
export declare const IDSHeader1177NavItem: React.FC<IDSHeader1177NavItemProps>;
|
|
15
|
-
export {};
|