@inera/ids-react 6.2.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion.d.ts +1 -1
- package/components/accordion/accordion.js +6 -7
- package/components/agent/agent.d.ts +1 -1
- package/components/agent/agent.js +2 -2
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/alert.js +9 -2
- package/components/alert-global/alert-global.d.ts +2 -2
- package/components/alert-global/alert-global.js +6 -7
- package/components/badge/badge.d.ts +4 -3
- package/components/badge/badge.js +4 -3
- package/components/box-link/box-link.d.ts +11 -3
- package/components/box-link/box-link.js +9 -9
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/breadcrumbs.js +4 -2
- package/components/button/button.d.ts +23 -5
- package/components/button/button.js +94 -11
- package/components/button-group/button-group.d.ts +13 -3
- package/components/button-group/button-group.js +10 -9
- package/components/card/card.d.ts +4 -3
- package/components/card/card.js +16 -8
- package/components/carousel/carousel-item.d.ts +10 -0
- package/components/carousel/carousel-item.js +24 -0
- package/components/carousel/carousel.d.ts +11 -5
- package/components/carousel/carousel.js +167 -16
- package/components/date-label/date-label.d.ts +2 -2
- package/components/date-label/date-label.js +4 -40
- package/components/dialog/dialog.d.ts +23 -6
- package/components/dialog/dialog.js +75 -13
- package/components/dropdown/dropdown-content-link.d.ts +6 -0
- package/components/dropdown/dropdown-content-link.js +20 -0
- package/components/dropdown/dropdown.d.ts +16 -8
- package/components/dropdown/dropdown.js +72 -20
- package/components/footer-1177/footer-1177.d.ts +23 -3
- package/components/footer-1177/footer-1177.js +64 -9
- package/components/footer-1177-admin/footer-1177-admin.d.ts +21 -3
- package/components/footer-1177-admin/footer-1177-admin.js +63 -9
- package/components/footer-1177-pro/footer-1177-pro.d.ts +17 -3
- package/components/footer-1177-pro/footer-1177-pro.js +39 -9
- package/components/footer-inera/footer-inera.d.ts +23 -3
- package/components/footer-inera/footer-inera.js +64 -9
- package/components/footer-inera-admin/footer-inera-admin.d.ts +23 -3
- package/components/footer-inera-admin/footer-inera-admin.js +61 -9
- package/components/form/check-button/check-button.d.ts +7 -3
- package/components/form/check-button/check-button.js +8 -5
- package/components/form/checkbox/checkbox-group.d.ts +13 -3
- package/components/form/checkbox/checkbox-group.js +51 -9
- package/components/form/checkbox/checkbox.d.ts +17 -3
- package/components/form/checkbox/checkbox.js +50 -5
- package/components/form/error-message/error-message.d.ts +10 -0
- package/components/form/error-message/error-message.js +12 -0
- package/components/form/form-hooks/useAriaDescribedBy.d.ts +1 -0
- package/components/form/form-hooks/useAriaDescribedBy.js +26 -0
- package/components/form/form-hooks/useGroupValidity.d.ts +1 -0
- package/components/form/form-hooks/useGroupValidity.js +60 -0
- package/components/form/form-hooks/useInputValidity.d.ts +1 -0
- package/components/form/form-hooks/useInputValidity.js +27 -0
- package/components/form/input/input.d.ts +22 -3
- package/components/form/input/input.js +51 -9
- package/components/form/radio/radio-group.d.ts +13 -3
- package/components/form/radio/radio-group.js +28 -5
- package/components/form/radio/radio.d.ts +17 -3
- package/components/form/radio/radio.js +23 -9
- package/components/form/radio-button/radio-button-group.d.ts +9 -0
- package/components/form/radio-button/radio-button-group.js +22 -0
- package/components/form/radio-button/radio-button.d.ts +9 -0
- package/components/form/radio-button/radio-button.js +13 -0
- package/components/form/range/range.d.ts +16 -3
- package/components/form/range/range.js +29 -9
- package/components/form/select/select.d.ts +15 -3
- package/components/form/select/select.js +19 -9
- package/components/form/select-multiple/select-multiple.d.ts +18 -3
- package/components/form/select-multiple/select-multiple.js +60 -9
- package/components/form/spinner/spinner.d.ts +9 -3
- package/components/form/spinner/spinner.js +9 -9
- package/components/form/textarea/textarea.d.ts +18 -3
- package/components/form/textarea/textarea.js +26 -9
- package/components/form/time/time.d.ts +13 -3
- package/components/form/time/time.js +21 -9
- package/components/form/toggle/toggle.d.ts +8 -3
- package/components/form/toggle/toggle.js +10 -9
- package/components/grid/column.d.ts +16 -0
- package/components/grid/column.js +13 -0
- package/components/grid/container.d.ts +9 -0
- package/components/grid/container.js +24 -0
- package/components/grid/row.d.ts +9 -0
- package/components/grid/row.js +18 -0
- package/components/header-1177/header-1177-avatar.d.ts +10 -2
- package/components/header-1177/header-1177-avatar.js +30 -8
- package/components/header-1177/header-1177-item.d.ts +12 -2
- package/components/header-1177/header-1177-item.js +25 -8
- package/components/header-1177/header-1177-menu-mobile.d.ts +11 -0
- package/components/header-1177/header-1177-menu-mobile.js +42 -0
- package/components/header-1177/header-1177-nav-item-mobile.d.ts +11 -2
- package/components/header-1177/header-1177-nav-item-mobile.js +24 -8
- package/components/header-1177/header-1177-nav-item.d.ts +15 -2
- package/components/header-1177/header-1177-nav-item.js +22 -8
- package/components/header-1177/header-1177-nav.d.ts +8 -2
- package/components/header-1177/header-1177-nav.js +14 -8
- package/components/header-1177/header-1177.d.ts +22 -5
- package/components/header-1177/header-1177.js +41 -12
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.d.ts +9 -2
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.js +6 -8
- package/components/header-1177-admin/header-1177-admin-avatar.d.ts +10 -2
- package/components/header-1177-admin/header-1177-admin-avatar.js +31 -8
- package/components/header-1177-admin/header-1177-admin-item.d.ts +12 -2
- package/components/header-1177-admin/header-1177-admin-item.js +26 -8
- package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +15 -2
- package/components/header-1177-admin/header-1177-admin-nav-item.js +24 -8
- package/components/header-1177-admin/header-1177-admin-nav.d.ts +7 -2
- package/components/header-1177-admin/header-1177-admin-nav.js +12 -8
- package/components/header-1177-admin/header-1177-admin.d.ts +22 -3
- package/components/header-1177-admin/header-1177-admin.js +26 -9
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.d.ts +9 -2
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.js +6 -8
- package/components/header-1177-pro/header-1177-pro-avatar.d.ts +10 -2
- package/components/header-1177-pro/header-1177-pro-avatar.js +31 -8
- package/components/header-1177-pro/header-1177-pro-item.d.ts +12 -2
- package/components/header-1177-pro/header-1177-pro-item.js +23 -8
- package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +15 -2
- package/components/header-1177-pro/header-1177-pro-nav-item.js +33 -8
- package/components/header-1177-pro/header-1177-pro-nav-menu-mobile.d.ts +11 -5
- package/components/header-1177-pro/header-1177-pro-nav-menu-mobile.js +32 -12
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +10 -2
- package/components/header-1177-pro/header-1177-pro-nav.js +27 -8
- package/components/header-1177-pro/header-1177-pro.d.ts +23 -5
- package/components/header-1177-pro/header-1177-pro.js +37 -12
- package/components/header-inera/header-inera-item.d.ts +13 -2
- package/components/header-inera/header-inera-item.js +24 -8
- package/components/header-inera/header-inera-nav-item.d.ts +15 -2
- package/components/header-inera/header-inera-nav-item.js +54 -8
- package/components/header-inera/header-inera-nav-mobile.d.ts +11 -5
- package/components/header-inera/header-inera-nav-mobile.js +44 -12
- package/components/header-inera/header-inera-nav.d.ts +7 -2
- package/components/header-inera/header-inera-nav.js +13 -8
- package/components/header-inera/header-inera.d.ts +16 -3
- package/components/header-inera/header-inera.js +16 -9
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +9 -2
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +11 -8
- package/components/header-inera-admin/header-inera-admin-avatar.d.ts +12 -2
- package/components/header-inera-admin/header-inera-admin-avatar.js +32 -8
- package/components/header-inera-admin/header-inera-admin-item.d.ts +13 -2
- package/components/header-inera-admin/header-inera-admin-item.js +24 -8
- package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +16 -2
- package/components/header-inera-admin/header-inera-admin-nav-item.js +54 -8
- package/components/header-inera-admin/header-inera-admin-nav-mobile.d.ts +12 -5
- package/components/header-inera-admin/header-inera-admin-nav-mobile.js +32 -12
- package/components/header-inera-admin/header-inera-admin-nav.d.ts +8 -2
- package/components/header-inera-admin/header-inera-admin-nav.js +13 -8
- package/components/header-inera-admin/header-inera-admin.d.ts +15 -3
- package/components/header-inera-admin/header-inera-admin.js +24 -9
- package/components/header-patient/header-patient.d.ts +13 -0
- package/components/header-patient/header-patient.js +21 -0
- package/components/link/link.d.ts +17 -3
- package/components/link/link.js +42 -9
- package/components/mobile/menu/item/mobile-item.d.ts +15 -4
- package/components/mobile/menu/item/mobile-item.js +58 -11
- package/components/mobile/menu/mobile-menu.d.ts +7 -3
- package/components/mobile/menu/mobile-menu.js +9 -9
- package/components/navigation/content/navigation-content.d.ts +7 -3
- package/components/navigation/content/navigation-content.js +18 -9
- package/components/navigation/local/navigation-local.d.ts +7 -3
- package/components/navigation/local/navigation-local.js +6 -9
- package/components/notification/badge/notification-badge.d.ts +4 -2
- package/components/notification/badge/notification-badge.js +4 -3
- package/components/pagination/data-pagination/data-pagination.d.ts +24 -3
- package/components/pagination/data-pagination/data-pagination.js +14 -9
- package/components/pagination/list-pagination/list-pagination.d.ts +19 -7
- package/components/pagination/list-pagination/list-pagination.js +51 -14
- package/components/popover/popover.d.ts +20 -5
- package/components/popover/popover.js +192 -16
- package/components/progressbar/progressbar.d.ts +1 -1
- package/components/progressbar/progressbar.js +4 -2
- package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +7 -0
- package/components/puff-list/puff-list-item/puff-list-item-info.js +8 -0
- package/components/puff-list/puff-list-item/puff-list-item.d.ts +18 -3
- package/components/puff-list/puff-list-item/puff-list-item.js +58 -9
- package/components/puff-list/puff-list.d.ts +7 -3
- package/components/puff-list/puff-list.js +6 -9
- package/components/region-icon/region-icon.d.ts +12 -0
- package/components/region-icon/region-icon.js +25 -0
- package/components/side-menu/side-menu.d.ts +16 -6
- package/components/side-menu/side-menu.js +52 -13
- package/components/side-panel/side-panel.d.ts +21 -6
- package/components/side-panel/side-panel.js +74 -13
- package/components/stepper/step.d.ts +18 -0
- package/components/stepper/step.js +41 -0
- package/components/stepper/stepper.d.ts +9 -7
- package/components/stepper/stepper.js +21 -19
- package/components/tabs/tab-panel.d.ts +11 -0
- package/components/tabs/tab-panel.js +20 -0
- package/components/tabs/tab.d.ts +15 -0
- package/components/tabs/tab.js +19 -0
- package/components/tabs/tabs.d.ts +14 -9
- package/components/tabs/tabs.js +79 -25
- package/components/tag/tag.d.ts +5 -6
- package/components/tag/tag.js +9 -9
- package/components/tooltip/tooltip.d.ts +10 -3
- package/components/tooltip/tooltip.js +79 -9
- package/components/utils/contexts/HeaderContext.d.ts +9 -0
- package/components/utils/contexts/HeaderContext.js +7 -0
- package/components/utils/hooks/useElementId.d.ts +5 -0
- package/components/utils/hooks/useElementId.js +12 -0
- package/components/utils/hooks/useFocusTrap.d.ts +1 -0
- package/components/utils/hooks/useFocusTrap.js +44 -0
- package/components/utils/utils.d.ts +6 -0
- package/components/utils/utils.js +44 -0
- package/index.d.ts +15 -5
- package/index.js +20 -10
- package/package.json +2 -2
- package/components/form/errormessage/error-message.d.ts +0 -3
- package/components/form/errormessage/error-message.js +0 -12
- package/components/grid/grid.d.ts +0 -9
- package/components/grid/grid.js +0 -26
- package/components/header-1177/header-1177-nav-menu-mobile.d.ts +0 -5
- package/components/header-1177/header-1177-nav-menu-mobile.js +0 -15
- package/components/icon-region/icon-region.d.ts +0 -3
- package/components/icon-region/icon-region.js +0 -12
- package/components/puff-list/puff-list-item/puff-list-info/puff-list-item-info.d.ts +0 -3
- package/components/puff-list/puff-list-item/puff-list-info/puff-list-item-info.js +0 -12
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import '
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import '@inera/ids-design/components/form/spinner/spinner.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
|
-
const IDSSpinner =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
const IDSSpinner = ({ light = false, live = "polite", srText = "", className, ...props }) => {
|
|
7
|
+
return (jsxs("div", { role: "alert", className: clsx("ids-spinner", {
|
|
8
|
+
"ids-spinner--light": light
|
|
9
|
+
}, className), "aria-live": live, ...props, children: [jsx("p", { className: "ids-spinner-sr", children: srText }), jsx("div", { className: "ids-bounce-1" }), jsx("div", { className: "ids-bounce-2" }), jsx("div", { className: "ids-bounce-3" })] }));
|
|
10
|
+
};
|
|
11
11
|
|
|
12
12
|
export { IDSSpinner };
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React, { ReactNode, TextareaHTMLAttributes } from "react";
|
|
2
|
+
interface IDSTextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
hint?: string | ReactNode;
|
|
5
|
+
errorMsg?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
noValidation?: boolean;
|
|
10
|
+
autoSize?: boolean;
|
|
11
|
+
noResize?: boolean;
|
|
12
|
+
block?: boolean;
|
|
13
|
+
light?: boolean;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
tooltip?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const IDSTextarea: React.FC<IDSTextareaProps>;
|
|
18
|
+
export {};
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
4
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { useElementId } from '../../utils/hooks/useElementId.js';
|
|
5
|
+
import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
6
|
+
import { useInputValidity } from '../form-hooks/useInputValidity.js';
|
|
7
|
+
import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
|
|
8
|
+
import clsx from 'clsx';
|
|
5
9
|
|
|
6
|
-
const IDSTextarea =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const IDSTextarea = ({ label = "", hint, errorMsg = "", disabled = false, invalid = false, required = false, noValidation = false, autoSize = false, noResize = false, block = false, light = false, readOnly = false, id, tooltip, className, ...props }) => {
|
|
11
|
+
const fieldId = useElementId(id);
|
|
12
|
+
const errorMsgId = useElementId();
|
|
13
|
+
const hintId = useElementId();
|
|
14
|
+
const textareaRef = useRef(null);
|
|
15
|
+
const hasValidValue = useInputValidity(textareaRef);
|
|
16
|
+
const isInvalid = (invalid || !hasValidValue) && !noValidation;
|
|
17
|
+
useAriaDescribedBy(textareaRef, errorMsgId, isInvalid, !!errorMsg, !!hint, hintId);
|
|
18
|
+
return (jsxs("div", { className: clsx("ids-textarea", {
|
|
19
|
+
"ids-textarea--block": block,
|
|
20
|
+
"ids-textarea--autosize": autoSize,
|
|
21
|
+
"ids-textarea--no-resize": noResize
|
|
22
|
+
}, className), children: [jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { className: clsx("ids-label", {
|
|
23
|
+
"ids-label--disabled": disabled || readOnly
|
|
24
|
+
}), htmlFor: fieldId, children: label }), tooltip && tooltip] }), jsx("textarea", { ref: textareaRef, id: fieldId, className: clsx("ids-textarea__textarea", {
|
|
25
|
+
"ids-input--light": light
|
|
26
|
+
}), "aria-invalid": isInvalid, required: required, "aria-required": required, disabled: disabled, "aria-disabled": disabled, readOnly: readOnly, ...props }), hint && (jsx("div", { id: hintId, className: "ids-input__hint", children: hint })), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
|
|
27
|
+
};
|
|
11
28
|
|
|
12
29
|
export { IDSTextarea };
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React, { ReactNode, InputHTMLAttributes } from "react";
|
|
2
|
+
interface IDSTimeProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
errorMsg?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
invalid?: boolean;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
noValidation?: boolean;
|
|
9
|
+
light?: boolean;
|
|
10
|
+
tooltip?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const IDSTime: React.FC<IDSTimeProps>;
|
|
13
|
+
export {};
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
4
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { useElementId } from '../../utils/hooks/useElementId.js';
|
|
5
|
+
import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
6
|
+
import { useInputValidity } from '../form-hooks/useInputValidity.js';
|
|
7
|
+
import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
|
|
8
|
+
import clsx from 'clsx';
|
|
5
9
|
|
|
6
|
-
const IDSTime =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const IDSTime = ({ label = "", errorMsg = "", disabled = false, invalid = false, required = false, noValidation = false, light = false, id, tooltip, className, ...props }) => {
|
|
11
|
+
const fieldId = useElementId(id);
|
|
12
|
+
const errorMsgId = useElementId();
|
|
13
|
+
const timeRef = useRef(null);
|
|
14
|
+
const hasValidValue = useInputValidity(timeRef); // can this happen? i cannot enter an invalid value when i try
|
|
15
|
+
const isInvalid = (invalid || !hasValidValue) && !noValidation;
|
|
16
|
+
useAriaDescribedBy(timeRef, errorMsgId, isInvalid, !!errorMsg);
|
|
17
|
+
return (jsxs("div", { className: clsx("ids-time-component", className), children: [jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { className: clsx("ids-label", {
|
|
18
|
+
"ids-label--disabled": disabled
|
|
19
|
+
}), htmlFor: fieldId, children: label }), tooltip] }), jsx("div", { className: "ids-time", children: jsx("div", { className: "ids-time__input-wrapper", children: jsx("input", { ref: timeRef, id: fieldId, type: "time", className: clsx("ids-time__input", {
|
|
20
|
+
"ids-input--light": light
|
|
21
|
+
}), "aria-invalid": isInvalid, required: required, "aria-required": required, disabled: disabled, "aria-disabled": disabled, ...props }) }) }), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
|
|
22
|
+
};
|
|
11
23
|
|
|
12
24
|
export { IDSTime };
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React, { ReactNode, InputHTMLAttributes } from "react";
|
|
2
|
+
interface IDSToggleProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
tooltip?: ReactNode;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const IDSToggle: React.FC<IDSToggleProps>;
|
|
8
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import '
|
|
4
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { useElementId } from '../../utils/hooks/useElementId.js';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
|
|
6
|
-
const IDSToggle =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
7
|
+
const IDSToggle = ({ disabled = false, tooltip, id, children, className, ...props }) => {
|
|
8
|
+
const fieldId = useElementId(id);
|
|
9
|
+
const toggleRef = useRef(null);
|
|
10
|
+
return (jsx(Fragment, { children: jsxs("div", { className: clsx("ids-toggle", className), children: [jsx("input", { id: fieldId, ref: toggleRef, className: "ids-toggle__input", type: "checkbox", disabled: disabled, ...props }), jsxs("div", { className: "ids-label-tooltip-wrapper ids-label-tooltip-wrapper--inline", children: [jsx("label", { htmlFor: fieldId, className: "ids-toggle__label ids-label ids-label--clickable", children: children }), tooltip] })] }) }));
|
|
11
|
+
};
|
|
11
12
|
|
|
12
13
|
export { IDSToggle };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/grid/column/column.css";
|
|
3
|
+
export interface IDSColumnProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
cols?: ColSize;
|
|
5
|
+
s?: ColSize;
|
|
6
|
+
m?: ColSize;
|
|
7
|
+
offset?: OffsetSize;
|
|
8
|
+
sOffset?: OffsetSize | "none";
|
|
9
|
+
mOffset?: OffsetSize | "none";
|
|
10
|
+
alignSelf?: "start" | "center" | "end" | "auto" | "baseline" | "stretch";
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
type ColSize = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "auto";
|
|
14
|
+
type OffsetSize = Exclude<ColSize, "auto">;
|
|
15
|
+
export declare const IDSColumn: React.FC<IDSColumnProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/grid/column/column.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
const IDSColumn = ({ cols, s, m, offset, sOffset, mOffset, alignSelf, className, children, style, ...props }) => {
|
|
8
|
+
const colRef = useRef(null);
|
|
9
|
+
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
|
+
return (jsx("div", { ref: colRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { IDSColumn };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/grid/container/container.css";
|
|
3
|
+
export interface IDSContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
fluid?: boolean;
|
|
5
|
+
width?: string;
|
|
6
|
+
gutterless?: boolean;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDSContainer: React.FC<IDSContainerProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/grid/container/container.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
const IDSContainer = ({ fluid = false, width = "", gutterless = false, children, className, style, ...props }) => {
|
|
8
|
+
const containerRef = useRef(null);
|
|
9
|
+
const classNames = clsx("ids-container", fluid && `ids-container--align-${fluid}`, gutterless && `ids-container--gutterless-${gutterless}`, className);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const el = containerRef.current;
|
|
12
|
+
if (el) {
|
|
13
|
+
if (width && !fluid) {
|
|
14
|
+
el.style.maxWidth = `${width}px`;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
el.style.maxWidth = "";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}, [width, fluid]);
|
|
21
|
+
return (jsx("div", { ref: containerRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { IDSContainer };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/grid/row/row.css";
|
|
3
|
+
export interface IDSRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
align?: "start" | "center" | "end" | "baseline" | "stretch";
|
|
5
|
+
justify?: "start" | "center" | "end" | "space-between" | "space-around";
|
|
6
|
+
gap?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDSRow: React.FC<IDSRowProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/grid/row/row.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
const IDSRow = ({ align, justify, gap, className, children, style, ...props }) => {
|
|
8
|
+
const rowRef = useRef(null);
|
|
9
|
+
const classNames = clsx("ids-row", align && `ids-row--align-${align}`, justify && `ids-row--justify-${justify}`, className);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (rowRef.current) {
|
|
12
|
+
rowRef.current.style.gap = gap ?? "";
|
|
13
|
+
}
|
|
14
|
+
}, [gap]);
|
|
15
|
+
return (jsx("div", { ref: rowRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { IDSRow };
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177-avatar.css";
|
|
3
|
+
interface IDSHeader1177AvatarProps {
|
|
4
|
+
username: string;
|
|
5
|
+
agent?: ReactNode;
|
|
6
|
+
links?: ReactNode;
|
|
7
|
+
persistent?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDSHeader1177Avatar: React.FC<IDSHeader1177AvatarProps>;
|
|
10
|
+
export {};
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-1177/header-1177-avatar.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
4
7
|
|
|
5
|
-
const IDSHeader1177Avatar =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const IDSHeader1177Avatar = ({ username, agent, links, persistent = false }) => {
|
|
9
|
+
const [expanded, setExpanded] = useState(false);
|
|
10
|
+
const headerContext = useHeaderContext();
|
|
11
|
+
const avatarRef = useRef(null);
|
|
12
|
+
const toggleExpanded = () => setExpanded(prev => !prev);
|
|
13
|
+
const handleClickOutside = (event) => {
|
|
14
|
+
if (!persistent && avatarRef.current && !avatarRef.current.contains(event.target)) {
|
|
15
|
+
setExpanded(false);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
document.addEventListener("click", handleClickOutside);
|
|
20
|
+
return () => {
|
|
21
|
+
document.removeEventListener("click", handleClickOutside);
|
|
22
|
+
};
|
|
23
|
+
}, [persistent]);
|
|
24
|
+
return (jsx("div", { ref: avatarRef, className: clsx("ids-header-1177-avatar", {
|
|
25
|
+
"ids-header-1177-avatar--unresponsive": headerContext?.unresponsive
|
|
26
|
+
}), children: jsxs("div", { className: "ids-header-1177-avatar__dropdown-wrapper", children: [jsx("button", { className: clsx("ids-header-1177-avatar__button", {
|
|
27
|
+
"ids-header-1177-avatar__button--expanded": expanded
|
|
28
|
+
}), onClick: toggleExpanded, "aria-controls": "ids-header-1177-avatar__dropdown", "aria-expanded": expanded, children: jsx("div", { className: "ids-header-1177-avatar-content__name", title: username, children: username }) }), jsxs("div", { id: "ids-header-1177-avatar__dropdown", className: clsx("ids-header-1177-avatar__dropdown", {
|
|
29
|
+
"ids-header-1177-avatar__dropdown--expanded": expanded
|
|
30
|
+
}), children: [agent && jsx("div", { className: "ids-header-1177-avatar__agent", children: agent }), agent && links && jsx("div", { className: "ids-header-1177-avatar__menu-separator" }), links && jsx("div", { className: "ids-header-1177-avatar__menu-links", children: links })] })] }) }));
|
|
31
|
+
};
|
|
10
32
|
|
|
11
33
|
export { IDSHeader1177Avatar };
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import React, { ReactNode, PropsWithChildren, HTMLAttributes } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177-item.css";
|
|
3
|
+
interface IDSHeader1177ItemProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
mobile?: boolean;
|
|
5
|
+
icon?: string;
|
|
6
|
+
href?: string;
|
|
7
|
+
text?: string;
|
|
8
|
+
link?: ReactNode;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const IDSHeader1177Item: React.FC<PropsWithChildren<IDSHeader1177ItemProps>>;
|
|
12
|
+
export {};
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { isValidElement, cloneElement } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import '@inera/ids-design/components/header-1177/header-1177-item.css';
|
|
6
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
4
7
|
|
|
5
|
-
const IDSHeader1177Item =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const IDSHeader1177Item = ({ mobile = false, text = "", href = "", icon, link, onClick, ...props }) => {
|
|
9
|
+
const headerContext = useHeaderContext();
|
|
10
|
+
const classNames = clsx("ids-header-1177__items__item", {
|
|
11
|
+
"ids-header-1177__items__item--unresponsive": headerContext?.unresponsive,
|
|
12
|
+
"ids-header-1177__items__item--mobile": mobile
|
|
13
|
+
});
|
|
14
|
+
const renderContent = () => (jsxs(Fragment, { children: [icon && (jsx("div", { className: "ids-header-1177__items__item-icon", "aria-label": text, children: jsx("span", { className: `ids-icon-${icon}` }) })), jsx("div", { className: "ids-header-1177__items__item-text", children: text })] }));
|
|
15
|
+
if (link && isValidElement(link)) {
|
|
16
|
+
return cloneElement(link, {
|
|
17
|
+
...props,
|
|
18
|
+
className: clsx(link.props.className, classNames),
|
|
19
|
+
children: renderContent()
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (onClick) {
|
|
23
|
+
return (jsx("button", { className: classNames, onClick: onClick, style: { cursor: "pointer" }, ...props, children: renderContent() }));
|
|
24
|
+
}
|
|
25
|
+
return (jsx("a", { className: classNames, href: href, ...props, children: renderContent() }));
|
|
26
|
+
};
|
|
10
27
|
|
|
11
28
|
export { IDSHeader1177Item };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177-menu-mobile.css";
|
|
3
|
+
interface IDSHeader1177MenuMobileProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
persistent?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
onExpanded?: () => void;
|
|
8
|
+
onClosed?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const IDSHeader1177MenuMobile: React.FC<IDSHeader1177MenuMobileProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-1177/header-1177-menu-mobile.css';
|
|
5
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
|
|
8
|
+
const IDSHeader1177MenuMobile = ({ label = "", persistent = false, children, onExpanded, onClosed }) => {
|
|
9
|
+
const [expanded, setExpanded] = useState(false);
|
|
10
|
+
const headerContext = useHeaderContext();
|
|
11
|
+
const menuRef = useRef(null);
|
|
12
|
+
const handleLinkClick = () => {
|
|
13
|
+
setExpanded(false);
|
|
14
|
+
onClosed?.();
|
|
15
|
+
};
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!persistent && expanded) {
|
|
18
|
+
const links = menuRef.current?.querySelectorAll("a") || [];
|
|
19
|
+
links.forEach(link => link.addEventListener("click", handleLinkClick));
|
|
20
|
+
return () => {
|
|
21
|
+
links.forEach(link => link.removeEventListener("click", handleLinkClick));
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}, [expanded, persistent]);
|
|
25
|
+
const toggleExpansion = () => {
|
|
26
|
+
setExpanded(prev => {
|
|
27
|
+
const next = !prev;
|
|
28
|
+
if (next) {
|
|
29
|
+
onExpanded?.();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
onClosed?.();
|
|
33
|
+
}
|
|
34
|
+
return next;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return (jsxs("div", { className: "ids-header-1177-menu-mobile-component", children: [jsxs("button", { onClick: toggleExpansion, "aria-expanded": expanded, "aria-label": "Meny", className: clsx("ids-header-1177-menu-mobile", {
|
|
38
|
+
"ids-header-1177-menu-mobile--unresponsive": headerContext?.unresponsive
|
|
39
|
+
}), children: [label, jsx("div", { className: "ids-hamburger", children: jsx("span", { className: "ids-hamburger__lines" }) }), jsx("slot", {})] }), expanded && (jsx("div", { className: "ids-header-1177-menu-mobile__items", ref: menuRef, children: children }))] }));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { IDSHeader1177MenuMobile };
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177-nav-item-mobile.css";
|
|
3
|
+
interface IDSHeader1177NavItemMobileProps {
|
|
4
|
+
text?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
link?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const IDSHeader1177NavItemMobile: React.FC<IDSHeader1177NavItemMobileProps>;
|
|
11
|
+
export {};
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { isValidElement, cloneElement } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-1177/header-1177-nav-item-mobile.css';
|
|
5
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
|
+
import clsx from 'clsx';
|
|
4
7
|
|
|
5
|
-
const IDSHeader1177NavItemMobile =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
8
|
+
const IDSHeader1177NavItemMobile = ({ text = "", href = "", icon = "", link, children, ...props }) => {
|
|
9
|
+
const headerContext = useHeaderContext();
|
|
10
|
+
const classNames = clsx("ids-header-1177__nav-mobile__item", {
|
|
11
|
+
"ids-header-1177__nav-mobile__item--unresponsive": headerContext?.unresponsive
|
|
12
|
+
});
|
|
13
|
+
const renderContent = () => {
|
|
14
|
+
return (jsxs(Fragment, { children: [icon && (jsx("span", { className: "ids-header-1177-nav-item-mobile__icon", children: jsx("span", { className: `ids-icon-${icon}` }) })), text] }));
|
|
15
|
+
};
|
|
16
|
+
if (link && isValidElement(link)) {
|
|
17
|
+
return cloneElement(link, {
|
|
18
|
+
...props,
|
|
19
|
+
style: { flexGrow: 1, textDecoration: "none" },
|
|
20
|
+
className: clsx(link.props.className, classNames),
|
|
21
|
+
children: renderContent()
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return (jsx("a", { className: classNames, href: href, style: { flexGrow: 1, textDecoration: "none" }, ...props, children: renderContent() }));
|
|
25
|
+
};
|
|
10
26
|
|
|
11
27
|
export { IDSHeader1177NavItemMobile };
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import React, { ReactNode, ReactElement } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177-nav-item.css";
|
|
3
|
+
import { IDSLinkProps } from "../link/link";
|
|
4
|
+
interface IDSHeader1177NavItemProps {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
col1?: ReactElement<IDSLinkProps>[];
|
|
9
|
+
col2?: ReactElement<IDSLinkProps>[];
|
|
10
|
+
col3?: ReactElement<IDSLinkProps>[];
|
|
11
|
+
col4?: ReactNode;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const IDSHeader1177NavItem: React.FC<IDSHeader1177NavItemProps>;
|
|
15
|
+
export {};
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React__default, { useState } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-1177/header-1177-nav-item.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
4
7
|
|
|
5
|
-
const IDSHeader1177NavItem =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const IDSHeader1177NavItem = ({ active = false, expanded = false, label = "", col1, col2, col3, col4, children }) => {
|
|
9
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
10
|
+
const headerContext = useHeaderContext();
|
|
11
|
+
const toggleExpanded = () => setIsExpanded(prev => !prev);
|
|
12
|
+
const renderLink = (link) => {
|
|
13
|
+
return React__default.isValidElement(link)
|
|
14
|
+
? React__default.cloneElement(link, { activeIcon: true, block: true, colorPreset: 2 })
|
|
15
|
+
: link;
|
|
16
|
+
};
|
|
17
|
+
const renderDropdown = () => isExpanded && (jsx("div", { id: "ids-header-1177-nav-dropdown", className: "ids-header-1177__items__item-dropdown", children: jsxs("div", { className: "ids-header-1177__items__item-dropdown__content", children: [jsx("div", { className: "ids-header-1177__items__item-dropdown__content-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177__items-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177__items__item-dropdown__content-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177__items-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177__items__item-dropdown__content-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177__items-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177__items__item-dropdown__content-col-4", children: col4 })] }) }));
|
|
18
|
+
return (jsxs("div", { className: clsx("ids-header-1177__nav-item", {
|
|
19
|
+
"ids-header-1177__nav-item--unresponsive": headerContext?.unresponsive,
|
|
20
|
+
"ids-header-1177__nav-item--fluid": headerContext?.fluid,
|
|
21
|
+
"ids-header-1177__nav-item--active": active || isExpanded
|
|
22
|
+
}), children: [label ? (jsx("button", { onClick: toggleExpanded, "aria-expanded": isExpanded, "aria-controls": "ids-header-1177-nav-dropdown", children: label })) : (children), renderDropdown()] }));
|
|
23
|
+
};
|
|
10
24
|
|
|
11
25
|
export { IDSHeader1177NavItem };
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177-nav.css";
|
|
3
|
+
interface IDSHeader1177NavProps {
|
|
4
|
+
hideOnTablet?: boolean;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const IDSHeader1177Nav: React.FC<IDSHeader1177NavProps>;
|
|
8
|
+
export {};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import '@inera/ids-design/components/header-1177/header-1177-nav.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
4
6
|
|
|
5
|
-
const IDSHeader1177Nav =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const IDSHeader1177Nav = ({ hideOnTablet = false, children }) => {
|
|
8
|
+
const headerContext = useHeaderContext();
|
|
9
|
+
const navClass = clsx("ids-header-1177__nav", {
|
|
10
|
+
"ids-header-1177__nav--unresponsive": headerContext?.unresponsive,
|
|
11
|
+
"ids-header-1177__nav--fluid": headerContext?.fluid,
|
|
12
|
+
"ids-header-1177__nav--hide-on-tablet": hideOnTablet
|
|
13
|
+
});
|
|
14
|
+
return (jsx("nav", { className: navClass, slot: "nav", children: jsx("div", { className: "ids-header-1177__nav-inner", children: children }) }));
|
|
15
|
+
};
|
|
10
16
|
|
|
11
17
|
export { IDSHeader1177Nav };
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React, { ReactNode, AnchorHTMLAttributes } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177.css";
|
|
3
|
+
interface IDSHeader1177Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
regionPickerText?: string;
|
|
5
|
+
hideRegionPicker?: boolean;
|
|
6
|
+
regionPickerExpanded?: boolean;
|
|
7
|
+
fluid?: boolean;
|
|
8
|
+
unresponsive?: boolean;
|
|
9
|
+
logoHref?: string;
|
|
10
|
+
logoProps?: AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
11
|
+
logo?: ReactNode;
|
|
12
|
+
srLogoLabel?: string;
|
|
13
|
+
regionIcon?: ReactNode;
|
|
14
|
+
skipToContentLink?: ReactNode;
|
|
15
|
+
onToggleRegion?: (isExpanded: boolean) => void;
|
|
16
|
+
items?: ReactNode;
|
|
17
|
+
avatar?: ReactNode;
|
|
18
|
+
mobileMenu?: ReactNode;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare const IDSHeader1177: React.FC<IDSHeader1177Props>;
|
|
22
|
+
export {};
|