@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,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,8 +47,9 @@ 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("
|
|
51
|
-
"ids-label--clickable": disabled,
|
|
50
|
+
}), children: [jsx("label", { htmlFor: fieldId, className: clsx("ids-checkbox__label ids-label", {
|
|
51
|
+
"ids-label--clickable": !disabled,
|
|
52
|
+
"ids-label--disabled": disabled,
|
|
52
53
|
"ids-label--no-label": noLabel
|
|
53
54
|
}), children: !noLabel && children }), tooltip] })] }), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, compact: true, children: errorMsg }))] }));
|
|
54
55
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Matcher, Modifiers } from "react-day-picker";
|
|
3
|
+
import "@inera/ids-design/components/form/datepicker/datepicker.css";
|
|
4
|
+
export interface IDSDatePickerProps extends React.HTMLAttributes<HTMLElement> {
|
|
5
|
+
label: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
light?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
calendarHeader?: string;
|
|
10
|
+
defaultMonth?: Date;
|
|
11
|
+
startMonth?: Date;
|
|
12
|
+
endMonth?: Date;
|
|
13
|
+
srOpenText?: string;
|
|
14
|
+
srCloseText?: string;
|
|
15
|
+
focusedDay?: Date;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
noValidation?: boolean;
|
|
19
|
+
errorMsg?: string;
|
|
20
|
+
missingDateErrorMsg?: string;
|
|
21
|
+
invalidDateErrorMsg?: string;
|
|
22
|
+
invalid?: boolean;
|
|
23
|
+
disableNavigation?: boolean;
|
|
24
|
+
modifiers?: Record<string, Matcher | Matcher[]>;
|
|
25
|
+
onOpen?: () => void;
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
onDayClick?: (date: Date, modifiers: Modifiers, e: React.MouseEvent) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function IDSDatePicker({ label, value, light, placeholder, errorMsg, missingDateErrorMsg, invalidDateErrorMsg, calendarHeader, srOpenText, srCloseText, defaultMonth, startMonth, endMonth, noValidation, disabled, required, invalid, disableNavigation, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }: IDSDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { getWeek, format, isValid, subMonths, addMonths } from 'date-fns';
|
|
4
|
+
import { sv } from 'react-day-picker/locale';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useElementId } from '../../utils/hooks/useElementId.js';
|
|
7
|
+
import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
8
|
+
import { DayPicker, WeekNumberHeader, MonthsDropdown, YearsDropdown, useDayPicker, DropdownNav } from 'react-day-picker';
|
|
9
|
+
import { useFocusTrap } from '../../utils/hooks/useFocusTrap.js';
|
|
10
|
+
import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
|
|
11
|
+
import '@inera/ids-design/components/form/datepicker/datepicker.css';
|
|
12
|
+
|
|
13
|
+
const locale = { locale: sv };
|
|
14
|
+
const createNewDate = (dateString) => {
|
|
15
|
+
return new Date(dateString + "T00:00:00Z");
|
|
16
|
+
};
|
|
17
|
+
const getSweMonth = (date) => {
|
|
18
|
+
return `${format(date, "MMMM", locale)}`;
|
|
19
|
+
};
|
|
20
|
+
const getSweYear = (date) => {
|
|
21
|
+
return `${format(date, "yyyy", locale)}`;
|
|
22
|
+
};
|
|
23
|
+
const getPrevMonthYear = (date) => {
|
|
24
|
+
return `${getSweMonth(subMonths(date, 1))} ${getSweYear(subMonths(date, 1))}`;
|
|
25
|
+
};
|
|
26
|
+
const getNextMonthYear = (date) => {
|
|
27
|
+
return `${getSweMonth(addMonths(date, 1))} ${getSweYear(addMonths(date, 1))}`;
|
|
28
|
+
};
|
|
29
|
+
function IDSDatePicker({ label, value = "", light = false, placeholder = "åååå/mm/dd", errorMsg = "", missingDateErrorMsg = "Datum saknas", invalidDateErrorMsg = "Ogiltigt datum", calendarHeader = "Välj datum", srOpenText = "Öppna kalendern", srCloseText = "Stäng kalendern", defaultMonth, startMonth = new Date(1900, 0, 1), endMonth = new Date(2050, 0, 1), noValidation = false, disabled = false, required = false, invalid = false, disableNavigation = false, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }) {
|
|
30
|
+
const shortWeek = "v.";
|
|
31
|
+
const inputRef = useRef(null);
|
|
32
|
+
const triggerRef = useRef(null);
|
|
33
|
+
const dialogRef = useRef(null);
|
|
34
|
+
const headerRef = useRef(null);
|
|
35
|
+
const prevMonthButtonRef = useRef(null);
|
|
36
|
+
const nextMonthButtonRef = useRef(null);
|
|
37
|
+
const dialogId = useElementId();
|
|
38
|
+
const headerId = useElementId();
|
|
39
|
+
const inputId = useElementId();
|
|
40
|
+
const errorMsgId = useElementId();
|
|
41
|
+
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
|
42
|
+
const [inputValue, setInputValue] = useState(value);
|
|
43
|
+
const initialSelectedDate = !!value ? createNewDate(value) : undefined;
|
|
44
|
+
const [selectedDate, setSelectedDate] = useState(initialSelectedDate || defaultMonth);
|
|
45
|
+
const [month, setMonth] = useState(initialSelectedDate || defaultMonth || new Date());
|
|
46
|
+
const [hasDateError, setHasDateError] = useState(false);
|
|
47
|
+
const [hasMissingError, setHasMissingError] = useState(false);
|
|
48
|
+
const [isInvalid, setIsInvalid] = useState(invalid);
|
|
49
|
+
const showInvalidError = !!hasDateError && !!invalidDateErrorMsg;
|
|
50
|
+
const showMissingError = !!hasMissingError && !!missingDateErrorMsg;
|
|
51
|
+
const showError = !!invalid && !!errorMsg;
|
|
52
|
+
useAriaDescribedBy(inputRef, errorMsgId, isInvalid, (showError || showMissingError || showInvalidError) && !noValidation);
|
|
53
|
+
useFocusTrap(dialogRef.current, isDialogOpen);
|
|
54
|
+
const handleOpenDialog = (e) => {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
setIsDialogOpen(true);
|
|
57
|
+
onOpen?.();
|
|
58
|
+
};
|
|
59
|
+
const closeDialog = () => {
|
|
60
|
+
setIsDialogOpen(false);
|
|
61
|
+
triggerRef.current.focus();
|
|
62
|
+
onClose?.();
|
|
63
|
+
};
|
|
64
|
+
const handleDayPickerSelect = (date) => {
|
|
65
|
+
const dateString = format(date, "yyyy-MM-dd");
|
|
66
|
+
setHasMissingError(false);
|
|
67
|
+
setIsInvalid(false);
|
|
68
|
+
setHasDateError(false);
|
|
69
|
+
if (!date) {
|
|
70
|
+
setInputValue("");
|
|
71
|
+
setSelectedDate(undefined);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
setSelectedDate(date);
|
|
75
|
+
setInputValue(dateString);
|
|
76
|
+
}
|
|
77
|
+
requestAnimationFrame(() => {
|
|
78
|
+
if (inputRef.current) {
|
|
79
|
+
inputRef.current.reportValidity();
|
|
80
|
+
inputRef.current.dispatchEvent(new Event("input", { bubbles: true }));
|
|
81
|
+
inputRef.current.dispatchEvent(new Event("change", { bubbles: true }));
|
|
82
|
+
setHasMissingError(!noValidation && required && inputRef.current.validity.valueMissing);
|
|
83
|
+
setIsInvalid(!inputRef.current.validity.valid || invalid);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
emitValue(dateString, date);
|
|
87
|
+
closeDialog();
|
|
88
|
+
};
|
|
89
|
+
const handleInvalid = (e) => {
|
|
90
|
+
setHasMissingError(!noValidation && required && e.target.validity.valueMissing);
|
|
91
|
+
setIsInvalid(!e.target.validity.valid || invalid);
|
|
92
|
+
};
|
|
93
|
+
const handleInputChange = (e) => {
|
|
94
|
+
setHasMissingError(false);
|
|
95
|
+
setIsInvalid(false);
|
|
96
|
+
setHasDateError(false);
|
|
97
|
+
setInputValue(e.target.value);
|
|
98
|
+
const parsedDate = createNewDate(e.target.value);
|
|
99
|
+
if (isValid(parsedDate)) {
|
|
100
|
+
setSelectedDate(parsedDate);
|
|
101
|
+
setMonth(parsedDate);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
setSelectedDate(undefined);
|
|
105
|
+
}
|
|
106
|
+
emitValue(e.target.value, parsedDate);
|
|
107
|
+
};
|
|
108
|
+
const emitValue = (val, parsedDate) => {
|
|
109
|
+
const isMissing = required && !val;
|
|
110
|
+
const isValidDate = parsedDate instanceof Date && isValid(parsedDate);
|
|
111
|
+
const customEvent = new CustomEvent("change", {
|
|
112
|
+
detail: {
|
|
113
|
+
value: val,
|
|
114
|
+
valueAsDate: isValidDate ? createNewDate(val) : undefined,
|
|
115
|
+
invalidDate: !isValid(parsedDate),
|
|
116
|
+
missingDate: isMissing
|
|
117
|
+
},
|
|
118
|
+
bubbles: true
|
|
119
|
+
});
|
|
120
|
+
onChange?.(customEvent);
|
|
121
|
+
};
|
|
122
|
+
const handleBlur = () => {
|
|
123
|
+
setHasDateError(!noValidation && value.trim().length && !isValid(selectedDate));
|
|
124
|
+
};
|
|
125
|
+
function CustomNav(props) {
|
|
126
|
+
// Add the nav buttons after the dropdowns for correct tab order
|
|
127
|
+
const { children } = props;
|
|
128
|
+
const { goToMonth, previousMonth, nextMonth } = useDayPicker();
|
|
129
|
+
const currentMonth = "aktuell månad";
|
|
130
|
+
const goTo = "gå till";
|
|
131
|
+
const goToPrevMonth = () => {
|
|
132
|
+
previousMonth && goToMonth(previousMonth);
|
|
133
|
+
requestAnimationFrame(() => {
|
|
134
|
+
if (prevMonthButtonRef.current) {
|
|
135
|
+
prevMonthButtonRef.current.focus();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
const goToNextMonth = () => {
|
|
140
|
+
nextMonth && goToMonth(nextMonth);
|
|
141
|
+
requestAnimationFrame(() => {
|
|
142
|
+
if (nextMonthButtonRef.current) {
|
|
143
|
+
nextMonthButtonRef.current.focus();
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
return (jsxs(DropdownNav, { className: "ids-datepicker__nav", ...props, children: [jsx("div", { className: "ids-datepicker__nav-dropdowns", children: children }), jsxs("div", { className: "ids-datepicker__nav-buttons", children: [jsx("button", { type: "button", ref: prevMonthButtonRef, className: "ids-datepicker__nav-prev", onClick: goToPrevMonth, disabled: !previousMonth || disableNavigation, "aria-label": `${currentMonth} ${getSweMonth(month)}. ${goTo} ${getPrevMonthYear(month)}` }), jsx("button", { type: "button", ref: nextMonthButtonRef, className: "ids-datepicker__nav-next", onClick: goToNextMonth, disabled: !nextMonth || disableNavigation, "aria-label": `${currentMonth} ${getSweMonth(month)}. ${goTo} ${getNextMonthYear(month)}` })] })] }));
|
|
148
|
+
}
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
const header = headerRef.current;
|
|
151
|
+
if (!header)
|
|
152
|
+
return;
|
|
153
|
+
header?.focus();
|
|
154
|
+
}, [isDialogOpen]);
|
|
155
|
+
return (jsxs("div", { className: clsx("ids-datepicker", { "ids-datepicker--invalid": !noValidation && (isInvalid || hasDateError) }, className), ...props, children: [isDialogOpen && jsx("div", { className: "ids-datepicker__overlay" }), jsx("label", { htmlFor: inputId, className: "ids-label", children: label }), jsxs("div", { className: "ids-datepicker__input-wrapper", children: [jsx("input", { className: clsx("ids-datepicker__input", { "ids-input--light": light }), ref: inputRef, style: { fontSize: "inherit" }, id: inputId, type: "text", value: inputValue, required: required, disabled: disabled, "aria-invalid": !noValidation && (isInvalid || hasDateError), placeholder: placeholder, onChange: handleInputChange, onInvalid: handleInvalid, onBlur: handleBlur }), jsx("button", { ref: triggerRef, className: "ids-datepicker__trigger", style: { fontSize: "inherit" }, disabled: disabled, onClick: handleOpenDialog, "aria-controls": "dialog", "aria-haspopup": "dialog", "aria-expanded": isDialogOpen, "aria-label": srOpenText }), jsxs("div", { className: clsx("ids-datepicker__dialog", { "ids-datepicker__dialog--show": isDialogOpen }), role: "dialog", ref: dialogRef, id: dialogId, "aria-modal": true, "aria-labelledby": headerId, children: [jsxs("div", { className: "ids-datepicker__dialog-bar", children: [jsx("div", { className: "ids-datepicker__dialog-header", id: headerId, ref: headerRef, tabIndex: -1, children: calendarHeader }), jsx("button", { className: "ids-datepicker__dialog-close-button", onClick: closeDialog, "aria-label": srCloseText })] }), jsx(DayPicker, { mode: "single", locale: sv, labels: {
|
|
156
|
+
labelWeekNumberHeader: () => "Veckonumer",
|
|
157
|
+
labelWeekNumber: (weekNumber) => `vecka`,
|
|
158
|
+
labelDayButton(date, modifiers, options, dateLib) {
|
|
159
|
+
const formattedDate = dateLib.format(date, "EEEE d MMMM yyyy", { locale: sv });
|
|
160
|
+
const weekNumber = getWeek(date, {
|
|
161
|
+
weekStartsOn: 1,
|
|
162
|
+
firstWeekContainsDate: 4
|
|
163
|
+
});
|
|
164
|
+
return `${formattedDate}, vecka ${weekNumber}`;
|
|
165
|
+
},
|
|
166
|
+
labelNext: () => "Nästa månad",
|
|
167
|
+
labelPrevious: () => "Föregående månad",
|
|
168
|
+
labelMonthDropdown: () => "Välj månad",
|
|
169
|
+
labelYearDropdown: () => "Välj år"
|
|
170
|
+
}, modifiers: modifiers, captionLayout: "dropdown", showWeekNumber: true, autoFocus: true, components: {
|
|
171
|
+
Nav: () => null,
|
|
172
|
+
DropdownNav: CustomNav,
|
|
173
|
+
WeekNumberHeader: props => (jsx(WeekNumberHeader, { ...props, className: "ids-datepicker__week-number-header", children: shortWeek })),
|
|
174
|
+
MonthsDropdown: props => (jsx(MonthsDropdown, { ...props, disabled: disableNavigation, className: "ids-datepicker__month-select" })),
|
|
175
|
+
YearsDropdown: props => (jsx(YearsDropdown, { ...props, disabled: disableNavigation, className: "ids-datepicker__year-select" }))
|
|
176
|
+
}, startMonth: startMonth, endMonth: endMonth, month: month, onMonthChange: setMonth, defaultMonth: defaultMonth, selected: selectedDate, onSelect: handleDayPickerSelect, onDayClick: onDayClick })] })] }), (showError || showInvalidError || showMissingError) && (jsxs(IDSErrorMessage, { id: errorMsgId, show: true, children: [showInvalidError && !showMissingError && invalidDateErrorMsg, showMissingError && missingDateErrorMsg, showError && errorMsg] }))] }));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export { IDSDatePicker };
|
|
@@ -33,7 +33,7 @@ const IDSInput = forwardRef(({ label = "", type = "text", icon = "", hint = "",
|
|
|
33
33
|
"ids-label--disabled": disabled || readOnly,
|
|
34
34
|
"ids-hidden": type === "search" && !showSearchLabel
|
|
35
35
|
}), htmlFor: fieldId, children: label }), tooltip] }));
|
|
36
|
-
return (jsxs("div", { className: clsx("ids-input", { "ids-input--search": type === "search" }, className), children: [type === "search" ? (jsxs(Fragment, { children: [jsxs("div", { className: "ids-input__search-wrapper", children: [labelElement, inputElement] }), submitButton] })) : (jsxs(Fragment, { children: [labelElement, inputElement] })), hint && (jsx("div", { id: hintId, className: "ids-input__hint", children: hint })), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
|
|
36
|
+
return (jsxs("div", { className: "ids-input-component", children: [jsxs("div", { className: clsx("ids-input", { "ids-input--search": type === "search" }, className), children: [type === "search" ? (jsxs(Fragment, { children: [jsxs("div", { className: "ids-input__search-wrapper", children: [labelElement, inputElement] }), submitButton] })) : (jsxs(Fragment, { children: [labelElement, inputElement] })), hint && (jsx("div", { id: hintId, className: "ids-input__hint", children: hint }))] }), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
|
|
37
37
|
});
|
|
38
38
|
IDSInput.displayName = "IDSInput";
|
|
39
39
|
|
|
@@ -21,7 +21,8 @@ const IDSRadio = forwardRef(({ name = "", groupErrorMsgId = "", invalid = false,
|
|
|
21
21
|
}), disabled: disabled, "aria-disabled": disabled, "aria-invalid": isInvalid, name: name, onChange: onChange, ...props }), jsxs("div", { className: clsx("ids-label-tooltip-wrapper", {
|
|
22
22
|
"ids-label-tooltip-wrapper--inline": tooltip
|
|
23
23
|
}), children: [jsx("label", { htmlFor: fieldId, className: clsx("ids-radio__label ids-label", {
|
|
24
|
-
"ids-
|
|
24
|
+
"ids-label--clickable": !disabled,
|
|
25
|
+
"ids-label--disabled": disabled
|
|
25
26
|
}), children: children }), tooltip] })] }));
|
|
26
27
|
});
|
|
27
28
|
IDSRadio.displayName = "IDSRadio";
|
|
@@ -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;
|