@inera/ids-react 7.2.0 → 8.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.js +4 -4
- package/components/alert/alert.d.ts +3 -3
- package/components/alert/alert.js +8 -5
- package/components/badge/badge.d.ts +0 -1
- package/components/badge/badge.js +2 -2
- package/components/box-link/box-link.js +2 -2
- package/components/breadcrumbs/breadcrumbs.js +3 -3
- package/components/button/button.d.ts +6 -7
- package/components/button/button.js +5 -79
- package/components/card/card.d.ts +4 -4
- package/components/card/card.js +5 -4
- package/components/carousel/carousel-item.js +5 -5
- package/components/carousel/carousel.d.ts +0 -2
- package/components/carousel/carousel.js +22 -42
- package/components/date-label/date-label.d.ts +6 -0
- package/components/date-label/date-label.js +18 -3
- package/components/dialog/dialog.d.ts +12 -12
- package/components/dialog/dialog.js +5 -7
- package/components/dropdown/dropdown-content-button.d.ts +7 -0
- package/components/dropdown/dropdown-content-button.js +11 -0
- package/components/dropdown/dropdown-content-link.js +2 -1
- package/components/dropdown/dropdown.d.ts +5 -4
- package/components/dropdown/dropdown.js +11 -10
- package/components/footer-1177/footer-1177.d.ts +0 -3
- package/components/footer-1177/footer-1177.js +17 -23
- package/components/footer-1177-admin/footer-1177-admin.d.ts +5 -7
- package/components/footer-1177-admin/footer-1177-admin.js +21 -26
- package/components/footer-1177-pro/footer-1177-pro.d.ts +15 -10
- package/components/footer-1177-pro/footer-1177-pro.js +41 -22
- package/components/footer-inera/footer-inera.d.ts +2 -6
- package/components/footer-inera/footer-inera.js +21 -27
- package/components/footer-inera-admin/footer-inera-admin.d.ts +2 -6
- package/components/footer-inera-admin/footer-inera-admin.js +23 -26
- package/components/form/check-button/check-button.d.ts +1 -0
- package/components/form/check-button/check-button.js +2 -2
- package/components/form/checkbox/checkbox-group.d.ts +1 -1
- package/components/form/checkbox/checkbox-group.js +6 -6
- package/components/form/checkbox/checkbox.d.ts +1 -0
- package/components/form/checkbox/checkbox.js +2 -2
- package/components/form/input/input.d.ts +2 -4
- package/components/form/input/input.js +16 -37
- package/components/form/radio/radio-group.d.ts +2 -2
- package/components/form/radio/radio-group.js +6 -6
- package/components/form/radio/radio.d.ts +3 -3
- package/components/form/radio/radio.js +2 -2
- package/components/form/radio-button/radio-button-group.d.ts +2 -2
- package/components/form/radio-button/radio-button-group.js +7 -7
- package/components/form/radio-button/radio-button.d.ts +4 -3
- package/components/form/radio-button/radio-button.js +2 -2
- package/components/form/range/range.d.ts +1 -0
- package/components/form/range/range.js +2 -2
- package/components/form/select/select.d.ts +1 -1
- package/components/form/select/select.js +5 -3
- package/components/form/select-multiple/select-multiple.d.ts +3 -0
- package/components/form/select-multiple/select-multiple.js +13 -6
- package/components/form/textarea/textarea.d.ts +1 -0
- package/components/form/textarea/textarea.js +2 -2
- package/components/form/time/time.d.ts +1 -0
- package/components/form/time/time.js +6 -6
- package/components/form/toggle/toggle.d.ts +1 -0
- package/components/form/toggle/toggle.js +5 -5
- package/components/global-alert/global-alert.d.ts +16 -0
- package/components/global-alert/global-alert.js +26 -0
- package/components/grid/container.d.ts +0 -1
- package/components/grid/container.js +4 -4
- package/components/header-1177/header-1177-avatar.d.ts +5 -2
- package/components/header-1177/header-1177-avatar.js +21 -10
- package/components/header-1177/header-1177-item.d.ts +1 -0
- package/components/header-1177/header-1177-item.js +6 -5
- package/components/header-1177/header-1177-menu-mobile.d.ts +1 -1
- package/components/header-1177/header-1177-menu-mobile.js +29 -18
- package/components/header-1177/header-1177-nav-item-mobile.js +4 -4
- package/components/header-1177/header-1177-nav-item.js +6 -7
- package/components/header-1177/header-1177-nav.d.ts +2 -0
- package/components/header-1177/header-1177-nav.js +3 -4
- package/components/header-1177/header-1177-region-picker-mobile.d.ts +9 -0
- package/components/header-1177/header-1177-region-picker-mobile.js +36 -0
- package/components/header-1177/header-1177-region-picker.d.ts +9 -0
- package/components/header-1177/header-1177-region-picker.js +34 -0
- package/components/header-1177/header-1177.d.ts +2 -6
- package/components/header-1177/header-1177.js +6 -22
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.js +28 -3
- package/components/header-1177-admin/header-1177-admin-avatar.d.ts +3 -2
- package/components/header-1177-admin/header-1177-admin-avatar.js +31 -18
- package/components/header-1177-admin/header-1177-admin-item.js +4 -4
- package/components/header-1177-admin/header-1177-admin-menu-mobile.d.ts +11 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile.js +53 -0
- package/components/header-1177-admin/header-1177-admin-nav-item.js +10 -11
- package/components/header-1177-admin/header-1177-admin-nav.js +4 -5
- package/components/header-1177-admin/header-1177-admin.d.ts +1 -4
- package/components/header-1177-admin/header-1177-admin.js +5 -18
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.js +28 -3
- package/components/header-1177-pro/header-1177-pro-avatar.d.ts +3 -2
- package/components/header-1177-pro/header-1177-pro-avatar.js +31 -18
- package/components/header-1177-pro/header-1177-pro-item.js +5 -5
- package/components/header-1177-pro/{header-1177-pro-nav-menu-mobile.d.ts → header-1177-pro-menu-mobile.d.ts} +3 -3
- package/components/header-1177-pro/header-1177-pro-menu-mobile.js +53 -0
- package/components/header-1177-pro/header-1177-pro-nav-item.js +11 -11
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +2 -2
- package/components/header-1177-pro/header-1177-pro-nav.js +5 -20
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.d.ts +9 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.js +36 -0
- package/components/header-1177-pro/header-1177-pro-region-picker.d.ts +9 -0
- package/components/header-1177-pro/header-1177-pro-region-picker.js +34 -0
- package/components/header-1177-pro/header-1177-pro.d.ts +4 -7
- package/components/header-1177-pro/header-1177-pro.js +4 -28
- package/components/header-inera/header-inera-item.js +1 -2
- package/components/header-inera/header-inera-menu-mobile.d.ts +11 -0
- package/components/header-inera/header-inera-menu-mobile.js +54 -0
- package/components/header-inera/header-inera-nav-item.js +6 -9
- package/components/header-inera/header-inera-nav.js +2 -3
- package/components/header-inera/header-inera.d.ts +1 -2
- package/components/header-inera/header-inera.js +4 -7
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +5 -2
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +23 -3
- package/components/header-inera-admin/header-inera-admin-avatar.d.ts +3 -4
- package/components/header-inera-admin/header-inera-admin-avatar.js +34 -22
- package/components/header-inera-admin/header-inera-admin-item.js +1 -1
- package/components/header-inera-admin/header-inera-admin-menu-mobile.d.ts +11 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile.js +53 -0
- package/components/header-inera-admin/header-inera-admin-nav-item.js +6 -9
- package/components/header-inera-admin/header-inera-admin-nav.js +2 -3
- package/components/header-inera-admin/header-inera-admin.d.ts +1 -1
- package/components/header-inera-admin/header-inera-admin.js +4 -5
- package/components/header-patient/header-patient.d.ts +3 -3
- package/components/header-patient/header-patient.js +2 -2
- package/components/link/link.d.ts +3 -3
- package/components/link/link.js +3 -3
- package/components/mobile/menu/item/mobile-item.js +4 -4
- package/components/navigation/content/navigation-content.d.ts +1 -0
- package/components/navigation/content/navigation-content.js +7 -6
- package/components/pagination/data-pagination/data-pagination.d.ts +7 -11
- package/components/pagination/data-pagination/data-pagination.js +7 -7
- package/components/pagination/list-pagination/list-pagination.js +6 -11
- package/components/popover/popover.js +9 -9
- package/components/progressbar/progressbar.js +2 -2
- package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +1 -0
- package/components/puff-list/puff-list-item/puff-list-item-info.js +5 -2
- package/components/puff-list/puff-list-item/puff-list-item.d.ts +8 -0
- package/components/puff-list/puff-list-item/puff-list-item.js +47 -13
- package/components/puff-list/puff-list.js +2 -2
- package/components/region-icon/region-icon.js +1 -2
- package/components/side-menu/side-menu.d.ts +1 -1
- package/components/side-menu/side-menu.js +6 -6
- package/components/side-panel/side-panel.d.ts +2 -0
- package/components/side-panel/side-panel.js +5 -5
- package/components/stepper/step.js +2 -2
- package/components/stepper/stepper.js +4 -4
- package/components/tabs/tab-panel.js +2 -2
- package/components/tabs/tab.js +2 -2
- package/components/tabs/tabs.js +13 -13
- package/components/tooltip/tooltip.js +2 -2
- package/components/utils/contexts/HeaderContext.d.ts +0 -2
- package/index.d.ts +16 -144
- package/index.js +16 -144
- package/package.json +2 -3
- package/components/agent/agent.d.ts +0 -12
- package/components/agent/agent.js +0 -18
- package/components/alert-global/alert-global.d.ts +0 -16
- package/components/alert-global/alert-global.js +0 -28
- package/components/header-1177-pro/header-1177-pro-nav-menu-mobile.js +0 -35
- package/components/header-inera/header-inera-nav-mobile.d.ts +0 -11
- package/components/header-inera/header-inera-nav-mobile.js +0 -47
- package/components/header-inera-admin/header-inera-admin-nav-mobile.d.ts +0 -12
- package/components/header-inera-admin/header-inera-admin-nav-mobile.js +0 -35
- package/components/icons/icon-1177.d.ts +0 -3
- package/components/icons/icon-1177.js +0 -12
- package/components/icons/icon-activity.d.ts +0 -3
- package/components/icons/icon-activity.js +0 -12
- package/components/icons/icon-agent.d.ts +0 -3
- package/components/icons/icon-agent.js +0 -12
- package/components/icons/icon-alarm-clock-inactivity.d.ts +0 -3
- package/components/icons/icon-alarm-clock-inactivity.js +0 -12
- package/components/icons/icon-alarm-clock-neutral.d.ts +0 -3
- package/components/icons/icon-alarm-clock-neutral.js +0 -12
- package/components/icons/icon-archive.d.ts +0 -3
- package/components/icons/icon-archive.js +0 -12
- package/components/icons/icon-arrow.d.ts +0 -3
- package/components/icons/icon-arrow.js +0 -12
- package/components/icons/icon-attention.d.ts +0 -3
- package/components/icons/icon-attention.js +0 -12
- package/components/icons/icon-blekinge.d.ts +0 -3
- package/components/icons/icon-blekinge.js +0 -12
- package/components/icons/icon-bookmark.d.ts +0 -3
- package/components/icons/icon-bookmark.js +0 -12
- package/components/icons/icon-calendar.d.ts +0 -3
- package/components/icons/icon-calendar.js +0 -12
- package/components/icons/icon-call-active.d.ts +0 -3
- package/components/icons/icon-call-active.js +0 -12
- package/components/icons/icon-call.d.ts +0 -3
- package/components/icons/icon-call.js +0 -12
- package/components/icons/icon-camera-off.d.ts +0 -3
- package/components/icons/icon-camera-off.js +0 -12
- package/components/icons/icon-camera-on.d.ts +0 -3
- package/components/icons/icon-camera-on.js +0 -12
- package/components/icons/icon-camera-switch.d.ts +0 -3
- package/components/icons/icon-camera-switch.js +0 -12
- package/components/icons/icon-chart-bar.d.ts +0 -3
- package/components/icons/icon-chart-bar.js +0 -12
- package/components/icons/icon-chart-line.d.ts +0 -3
- package/components/icons/icon-chart-line.js +0 -12
- package/components/icons/icon-chat.d.ts +0 -3
- package/components/icons/icon-chat.js +0 -12
- package/components/icons/icon-check.d.ts +0 -3
- package/components/icons/icon-check.js +0 -12
- package/components/icons/icon-chevron-bold.d.ts +0 -3
- package/components/icons/icon-chevron-bold.js +0 -12
- package/components/icons/icon-chevron.d.ts +0 -3
- package/components/icons/icon-chevron.js +0 -12
- package/components/icons/icon-clipboard-cross.d.ts +0 -3
- package/components/icons/icon-clipboard-cross.js +0 -12
- package/components/icons/icon-clipboard-text.d.ts +0 -3
- package/components/icons/icon-clipboard-text.js +0 -12
- package/components/icons/icon-clipboard.d.ts +0 -3
- package/components/icons/icon-clipboard.js +0 -12
- package/components/icons/icon-clock.d.ts +0 -3
- package/components/icons/icon-clock.js +0 -12
- package/components/icons/icon-close-bold.d.ts +0 -3
- package/components/icons/icon-close-bold.js +0 -12
- package/components/icons/icon-close.d.ts +0 -3
- package/components/icons/icon-close.js +0 -12
- package/components/icons/icon-cog.d.ts +0 -3
- package/components/icons/icon-cog.js +0 -12
- package/components/icons/icon-computer-inera.d.ts +0 -3
- package/components/icons/icon-computer-inera.js +0 -12
- package/components/icons/icon-computer.d.ts +0 -3
- package/components/icons/icon-computer.js +0 -12
- package/components/icons/icon-copy-file.d.ts +0 -3
- package/components/icons/icon-copy-file.js +0 -12
- package/components/icons/icon-copy-link.d.ts +0 -3
- package/components/icons/icon-copy-link.js +0 -12
- package/components/icons/icon-dalarna.d.ts +0 -3
- package/components/icons/icon-dalarna.js +0 -12
- package/components/icons/icon-denied.d.ts +0 -3
- package/components/icons/icon-denied.js +0 -12
- package/components/icons/icon-doctors-bag.d.ts +0 -3
- package/components/icons/icon-doctors-bag.js +0 -12
- package/components/icons/icon-document.d.ts +0 -3
- package/components/icons/icon-document.js +0 -12
- package/components/icons/icon-download.d.ts +0 -3
- package/components/icons/icon-download.js +0 -12
- package/components/icons/icon-drag-n-drop.d.ts +0 -3
- package/components/icons/icon-drag-n-drop.js +0 -12
- package/components/icons/icon-ear-hearing.d.ts +0 -3
- package/components/icons/icon-ear-hearing.js +0 -12
- package/components/icons/icon-edit.d.ts +0 -3
- package/components/icons/icon-edit.js +0 -12
- package/components/icons/icon-email-sent.d.ts +0 -3
- package/components/icons/icon-email-sent.js +0 -12
- package/components/icons/icon-email-unread.d.ts +0 -3
- package/components/icons/icon-email-unread.js +0 -12
- package/components/icons/icon-email.d.ts +0 -3
- package/components/icons/icon-email.js +0 -12
- package/components/icons/icon-expand.d.ts +0 -3
- package/components/icons/icon-expand.js +0 -12
- package/components/icons/icon-external.d.ts +0 -3
- package/components/icons/icon-external.js +0 -12
- package/components/icons/icon-facebook.d.ts +0 -3
- package/components/icons/icon-facebook.js +0 -12
- package/components/icons/icon-file-csv.d.ts +0 -3
- package/components/icons/icon-file-csv.js +0 -12
- package/components/icons/icon-file-excel.d.ts +0 -3
- package/components/icons/icon-file-excel.js +0 -12
- package/components/icons/icon-file-other.d.ts +0 -3
- package/components/icons/icon-file-other.js +0 -12
- package/components/icons/icon-file-pdf.d.ts +0 -3
- package/components/icons/icon-file-pdf.js +0 -12
- package/components/icons/icon-file-picture.d.ts +0 -3
- package/components/icons/icon-file-picture.js +0 -12
- package/components/icons/icon-file-powerpoint.d.ts +0 -3
- package/components/icons/icon-file-powerpoint.js +0 -12
- package/components/icons/icon-file-word.d.ts +0 -3
- package/components/icons/icon-file-word.js +0 -12
- package/components/icons/icon-find-care.d.ts +0 -3
- package/components/icons/icon-find-care.js +0 -12
- package/components/icons/icon-find-region.d.ts +0 -3
- package/components/icons/icon-find-region.js +0 -12
- package/components/icons/icon-flag.d.ts +0 -3
- package/components/icons/icon-flag.js +0 -12
- package/components/icons/icon-form-numbered-reocurring.d.ts +0 -3
- package/components/icons/icon-form-numbered-reocurring.js +0 -12
- package/components/icons/icon-form-numbered.d.ts +0 -3
- package/components/icons/icon-form-numbered.js +0 -12
- package/components/icons/icon-gavleborg.d.ts +0 -3
- package/components/icons/icon-gavleborg.js +0 -12
- package/components/icons/icon-gotland.d.ts +0 -3
- package/components/icons/icon-gotland.js +0 -12
- package/components/icons/icon-halland.d.ts +0 -3
- package/components/icons/icon-halland.js +0 -12
- package/components/icons/icon-headphones.d.ts +0 -3
- package/components/icons/icon-headphones.js +0 -12
- package/components/icons/icon-hourglass-end.d.ts +0 -3
- package/components/icons/icon-hourglass-end.js +0 -12
- package/components/icons/icon-hourglass-start.d.ts +0 -3
- package/components/icons/icon-hourglass-start.js +0 -12
- package/components/icons/icon-hourglass.d.ts +0 -3
- package/components/icons/icon-hourglass.js +0 -12
- package/components/icons/icon-house.d.ts +0 -3
- package/components/icons/icon-house.js +0 -12
- package/components/icons/icon-id-card-locked.d.ts +0 -3
- package/components/icons/icon-id-card-locked.js +0 -12
- package/components/icons/icon-id-card.d.ts +0 -3
- package/components/icons/icon-id-card.js +0 -12
- package/components/icons/icon-image.d.ts +0 -3
- package/components/icons/icon-image.js +0 -12
- package/components/icons/icon-inera-legacy.d.ts +0 -3
- package/components/icons/icon-inera-legacy.js +0 -12
- package/components/icons/icon-inera.d.ts +0 -3
- package/components/icons/icon-inera.js +0 -12
- package/components/icons/icon-information.d.ts +0 -3
- package/components/icons/icon-information.js +0 -12
- package/components/icons/icon-jamtland-harjedalen.d.ts +0 -3
- package/components/icons/icon-jamtland-harjedalen.js +0 -12
- package/components/icons/icon-jonkoping.d.ts +0 -3
- package/components/icons/icon-jonkoping.js +0 -12
- package/components/icons/icon-kalmar.d.ts +0 -3
- package/components/icons/icon-kalmar.js +0 -12
- package/components/icons/icon-kronoberg.d.ts +0 -3
- package/components/icons/icon-kronoberg.js +0 -12
- package/components/icons/icon-lightbulb.d.ts +0 -3
- package/components/icons/icon-lightbulb.js +0 -12
- package/components/icons/icon-linkedin.d.ts +0 -3
- package/components/icons/icon-linkedin.js +0 -12
- package/components/icons/icon-list.d.ts +0 -3
- package/components/icons/icon-list.js +0 -12
- package/components/icons/icon-lock-open.d.ts +0 -3
- package/components/icons/icon-lock-open.js +0 -12
- package/components/icons/icon-lock.d.ts +0 -3
- package/components/icons/icon-lock.js +0 -12
- package/components/icons/icon-log-locked.d.ts +0 -3
- package/components/icons/icon-log-locked.js +0 -12
- package/components/icons/icon-log.d.ts +0 -3
- package/components/icons/icon-log.js +0 -12
- package/components/icons/icon-menu.d.ts +0 -3
- package/components/icons/icon-menu.js +0 -12
- package/components/icons/icon-minus.d.ts +0 -3
- package/components/icons/icon-minus.js +0 -12
- package/components/icons/icon-moment-start.d.ts +0 -3
- package/components/icons/icon-moment-start.js +0 -12
- package/components/icons/icon-moment-stop.d.ts +0 -3
- package/components/icons/icon-moment-stop.js +0 -12
- package/components/icons/icon-norrbotten.d.ts +0 -3
- package/components/icons/icon-norrbotten.js +0 -12
- package/components/icons/icon-office-building.d.ts +0 -3
- package/components/icons/icon-office-building.js +0 -12
- package/components/icons/icon-orebro.d.ts +0 -3
- package/components/icons/icon-orebro.js +0 -12
- package/components/icons/icon-organization.d.ts +0 -3
- package/components/icons/icon-organization.js +0 -12
- package/components/icons/icon-ostergotland.d.ts +0 -3
- package/components/icons/icon-ostergotland.js +0 -12
- package/components/icons/icon-plus.d.ts +0 -3
- package/components/icons/icon-plus.js +0 -12
- package/components/icons/icon-prescription.d.ts +0 -3
- package/components/icons/icon-prescription.js +0 -12
- package/components/icons/icon-print.d.ts +0 -3
- package/components/icons/icon-print.js +0 -12
- package/components/icons/icon-question.d.ts +0 -3
- package/components/icons/icon-question.js +0 -12
- package/components/icons/icon-reload.d.ts +0 -3
- package/components/icons/icon-reload.js +0 -12
- package/components/icons/icon-reply.d.ts +0 -3
- package/components/icons/icon-reply.js +0 -12
- package/components/icons/icon-search-inera.d.ts +0 -3
- package/components/icons/icon-search-inera.js +0 -12
- package/components/icons/icon-search.d.ts +0 -3
- package/components/icons/icon-search.js +0 -12
- package/components/icons/icon-share.d.ts +0 -3
- package/components/icons/icon-share.js +0 -12
- package/components/icons/icon-shield-locked-primary.d.ts +0 -3
- package/components/icons/icon-shield-locked-primary.js +0 -12
- package/components/icons/icon-shield-locked.d.ts +0 -3
- package/components/icons/icon-shield-locked.js +0 -12
- package/components/icons/icon-skane.d.ts +0 -3
- package/components/icons/icon-skane.js +0 -12
- package/components/icons/icon-sormland.d.ts +0 -3
- package/components/icons/icon-sormland.js +0 -12
- package/components/icons/icon-star-filled.d.ts +0 -3
- package/components/icons/icon-star-filled.js +0 -12
- package/components/icons/icon-star.d.ts +0 -3
- package/components/icons/icon-star.js +0 -12
- package/components/icons/icon-stockholm.d.ts +0 -3
- package/components/icons/icon-stockholm.js +0 -12
- package/components/icons/icon-success.d.ts +0 -3
- package/components/icons/icon-success.js +0 -12
- package/components/icons/icon-swap.d.ts +0 -3
- package/components/icons/icon-swap.js +0 -12
- package/components/icons/icon-switch-person.d.ts +0 -3
- package/components/icons/icon-switch-person.js +0 -12
- package/components/icons/icon-telephone.d.ts +0 -3
- package/components/icons/icon-telephone.js +0 -12
- package/components/icons/icon-test-tube-analyze.d.ts +0 -3
- package/components/icons/icon-test-tube-analyze.js +0 -12
- package/components/icons/icon-test-tube-empty.d.ts +0 -3
- package/components/icons/icon-test-tube-empty.js +0 -12
- package/components/icons/icon-test-tube.d.ts +0 -3
- package/components/icons/icon-test-tube.js +0 -12
- package/components/icons/icon-toggle-card.d.ts +0 -3
- package/components/icons/icon-toggle-card.js +0 -12
- package/components/icons/icon-toggle-list.d.ts +0 -3
- package/components/icons/icon-toggle-list.js +0 -12
- package/components/icons/icon-trash.d.ts +0 -3
- package/components/icons/icon-trash.js +0 -12
- package/components/icons/icon-twitter.d.ts +0 -3
- package/components/icons/icon-twitter.js +0 -12
- package/components/icons/icon-uppsala.d.ts +0 -3
- package/components/icons/icon-uppsala.js +0 -12
- package/components/icons/icon-user.d.ts +0 -3
- package/components/icons/icon-user.js +0 -12
- package/components/icons/icon-varmland.d.ts +0 -3
- package/components/icons/icon-varmland.js +0 -12
- package/components/icons/icon-vasterbotten.d.ts +0 -3
- package/components/icons/icon-vasterbotten.js +0 -12
- package/components/icons/icon-vasternorrland.d.ts +0 -3
- package/components/icons/icon-vasternorrland.js +0 -12
- package/components/icons/icon-vastmanland.d.ts +0 -3
- package/components/icons/icon-vastmanland.js +0 -12
- package/components/icons/icon-vastra-gotaland.d.ts +0 -3
- package/components/icons/icon-vastra-gotaland.js +0 -12
- package/components/icons/icon-video-off.d.ts +0 -3
- package/components/icons/icon-video-off.js +0 -12
- package/components/icons/icon-video-on.d.ts +0 -3
- package/components/icons/icon-video-on.js +0 -12
- package/components/icons/icon-video-switch.d.ts +0 -3
- package/components/icons/icon-video-switch.js +0 -12
- package/components/icons/icon-visibility-off.d.ts +0 -3
- package/components/icons/icon-visibility-off.js +0 -12
- package/components/icons/icon-visibility.d.ts +0 -3
- package/components/icons/icon-visibility.js +0 -12
- package/components/icons/icon-warning.d.ts +0 -3
- package/components/icons/icon-warning.js +0 -12
- package/components/icons/icon-x.d.ts +0 -3
|
@@ -0,0 +1,53 @@
|
|
|
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-pro/header-1177-pro-menu-mobile.css';
|
|
5
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
|
|
8
|
+
const IDSHeader1177ProMenuMobile = ({ label = "", persistent = false, children, onExpanded, onClosed, ...props }) => {
|
|
9
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
10
|
+
const headerContext = useHeaderContext();
|
|
11
|
+
const containerRef = useRef(null);
|
|
12
|
+
const menuRef = useRef(null);
|
|
13
|
+
const handleLinkClick = () => {
|
|
14
|
+
setIsExpanded(false);
|
|
15
|
+
onClosed?.();
|
|
16
|
+
};
|
|
17
|
+
const handleClickOutside = (event) => {
|
|
18
|
+
if (!persistent && containerRef.current && !containerRef.current.contains(event.target)) {
|
|
19
|
+
setIsExpanded(false);
|
|
20
|
+
onClosed?.();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
document.addEventListener("click", handleClickOutside);
|
|
25
|
+
return () => {
|
|
26
|
+
document.removeEventListener("click", handleClickOutside);
|
|
27
|
+
};
|
|
28
|
+
}, [persistent]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!persistent && isExpanded) {
|
|
31
|
+
const links = menuRef.current?.querySelectorAll("a") || [];
|
|
32
|
+
links.forEach(link => link.addEventListener("click", handleLinkClick));
|
|
33
|
+
return () => {
|
|
34
|
+
links.forEach(link => link.removeEventListener("click", handleLinkClick));
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}, [isExpanded, persistent]);
|
|
38
|
+
const toggleExpanded = () => {
|
|
39
|
+
const newExpanded = !isExpanded;
|
|
40
|
+
setIsExpanded(newExpanded);
|
|
41
|
+
if (newExpanded) {
|
|
42
|
+
onExpanded?.();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
onClosed?.();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return (jsxs("div", { className: "ids-header-1177-pro-menu-mobile-component", ref: containerRef, ...props, children: [jsxs("button", { onClick: toggleExpanded, "aria-expanded": isExpanded, "aria-label": "Meny", className: clsx("ids-header-1177-pro-menu-mobile", {
|
|
49
|
+
"ids-header-1177-pro-menu-mobile--unresponsive": headerContext?.unresponsive
|
|
50
|
+
}), children: [label, jsx("div", { className: "ids-hamburger", children: jsx("span", { className: "ids-hamburger__lines" }) })] }), isExpanded && (jsx("div", { className: "ids-header-1177-pro-menu-mobile__items", ref: menuRef, children: children }))] }));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { IDSHeader1177ProMenuMobile };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-nav-item.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
7
|
|
|
8
|
-
const IDSHeader1177ProNavItem = ({ active = false, expanded = false, label = "", col1, col2, col3, col4, children }) => {
|
|
8
|
+
const IDSHeader1177ProNavItem = ({ active = false, expanded = false, label = "", col1, col2, col3, col4, children, ...props }) => {
|
|
9
9
|
const headerContext = useHeaderContext();
|
|
10
10
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
11
11
|
const containerRef = useRef(null);
|
|
@@ -27,12 +27,12 @@ const IDSHeader1177ProNavItem = ({ active = false, expanded = false, label = "",
|
|
|
27
27
|
}
|
|
28
28
|
return children;
|
|
29
29
|
};
|
|
30
|
-
const
|
|
31
|
-
return
|
|
32
|
-
?
|
|
30
|
+
const renderDropdownLink = (link) => {
|
|
31
|
+
return React.isValidElement(link)
|
|
32
|
+
? React.cloneElement(link, {
|
|
33
33
|
activeIcon: true,
|
|
34
34
|
block: true,
|
|
35
|
-
|
|
35
|
+
menu: true,
|
|
36
36
|
onClick: () => setIsExpanded(false)
|
|
37
37
|
})
|
|
38
38
|
: link;
|
|
@@ -40,12 +40,12 @@ const IDSHeader1177ProNavItem = ({ active = false, expanded = false, label = "",
|
|
|
40
40
|
const renderDropdown = () => {
|
|
41
41
|
if (!isExpanded)
|
|
42
42
|
return null;
|
|
43
|
-
return (jsx("div", { id: "ids-dropdown", className: "ids-header-1177-
|
|
43
|
+
return (jsx("div", { id: "ids-dropdown", className: "ids-header-1177-pro-nav-item__menu ids-header-1177-pro-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-1177-pro-nav-item__menu__content", children: [jsx("div", { className: "ids-header-1177-pro-nav-item__menu__content-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: renderDropdownLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu__content-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: renderDropdownLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu__content-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: renderDropdownLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu__content-col-4", children: col4?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: renderDropdownLink(link) }, idx))) })] }) }));
|
|
44
44
|
};
|
|
45
|
-
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-
|
|
46
|
-
"ids-header-1177-
|
|
47
|
-
"ids-header-1177-
|
|
48
|
-
}), children: [renderItem(), renderDropdown()] }));
|
|
45
|
+
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-pro-nav-item", {
|
|
46
|
+
"ids-header-1177-pro-nav-item--unresponsive": headerContext?.unresponsive,
|
|
47
|
+
"ids-header-1177-pro-nav-item--active": active || isExpanded
|
|
48
|
+
}), ...props, children: [renderItem(), renderDropdown()] }));
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
export { IDSHeader1177ProNavItem };
|
|
@@ -2,8 +2,8 @@ import React, { ReactNode } from "react";
|
|
|
2
2
|
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-nav.css";
|
|
3
3
|
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css";
|
|
4
4
|
interface IDSHeader1177ProNavProps {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
mobileRegionPicker?: ReactNode;
|
|
6
|
+
mobileAvatar?: ReactNode;
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export declare const IDSHeader1177ProNav: React.FC<IDSHeader1177ProNavProps>;
|
|
@@ -1,30 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useState } from 'react';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
3
|
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-nav.css';
|
|
5
4
|
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css';
|
|
6
5
|
import clsx from 'clsx';
|
|
7
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
8
7
|
|
|
9
|
-
const IDSHeader1177ProNav = ({
|
|
8
|
+
const IDSHeader1177ProNav = ({ mobileRegionPicker, mobileAvatar, children, ...props }) => {
|
|
10
9
|
const headerContext = useHeaderContext();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
const renderRegionPicker = () => {
|
|
16
|
-
if (headerContext?.hideRegionPicker)
|
|
17
|
-
return null;
|
|
18
|
-
return (jsx("button", { className: clsx("ids-header-1177-pro__region-picker-button--mobile", {
|
|
19
|
-
"ids-header-1177-pro__region-picker-button--mobile--expanded": regionPickerExpanded
|
|
20
|
-
}), "aria-label": headerContext?.regionPickerText, "aria-expanded": regionPickerExpanded, onClick: toggleRegion, children: regionIconMobile ? (regionIconMobile) : (jsxs("div", { className: "ids-header-1177-pro__region-picker__text", children: [jsx("span", { className: "ids-header-1177-pro__region-picker-icon" }), headerContext?.regionPickerText] })) }));
|
|
21
|
-
};
|
|
22
|
-
return (jsx("nav", { className: clsx("ids-header-1177-pro__nav", {
|
|
23
|
-
"ids-header-1177-pro__nav--fluid": headerContext?.fluid,
|
|
24
|
-
"ids-header-1177-pro__nav--unresponsive": headerContext?.unresponsive
|
|
25
|
-
}), children: jsxs("div", { className: clsx("ids-header-1177-pro__nav-inner", {
|
|
26
|
-
"ids-header-1177-pro__nav-inner--no-region-picker": headerContext?.hideRegionPicker
|
|
27
|
-
}), children: [renderRegionPicker(), children, mobileMenu] }) }));
|
|
10
|
+
return (jsxs("nav", { className: clsx("ids-header-1177-pro-nav", {
|
|
11
|
+
"ids-header-1177-pro-nav--unresponsive": headerContext?.unresponsive
|
|
12
|
+
}), ...props, children: [jsx("div", { className: "ids-header-1177-pro-nav__inner", children: children }), jsxs("div", { className: "ids-header-1177-pro-nav__inner-mobile", children: [mobileRegionPicker, mobileAvatar] })] }));
|
|
28
13
|
};
|
|
29
14
|
|
|
30
15
|
export { IDSHeader1177ProNav };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker-mobile.css";
|
|
3
|
+
export interface IDSHeader1177ProRegionPickerMobileProps {
|
|
4
|
+
text?: string;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
onToggleRegion?: (isExpanded: boolean) => void;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDSHeader1177ProRegionPickerMobile: React.FC<IDSHeader1177ProRegionPickerMobileProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import React, { useState, useRef, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker-mobile.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
|
+
|
|
7
|
+
const IDSHeader1177ProRegionPickerMobile = ({ text = "Välj region", expanded: propExpanded = false, onToggleRegion, children, ...props }) => {
|
|
8
|
+
const [isExpanded, setIsExpanded] = useState(propExpanded);
|
|
9
|
+
const regionIconRef = useRef(null);
|
|
10
|
+
const headerContext = useHeaderContext();
|
|
11
|
+
const toggleRegion = () => {
|
|
12
|
+
const newExpanded = !isExpanded;
|
|
13
|
+
setIsExpanded(newExpanded);
|
|
14
|
+
onToggleRegion?.(newExpanded);
|
|
15
|
+
};
|
|
16
|
+
const hasChildren = React.Children.count(children) > 0;
|
|
17
|
+
const renderChild = (child) => {
|
|
18
|
+
if (isValidElement(child)) {
|
|
19
|
+
const existingClass = child.props.className;
|
|
20
|
+
return cloneElement(child, {
|
|
21
|
+
ref: regionIconRef,
|
|
22
|
+
size: "m",
|
|
23
|
+
colorPreset: 4,
|
|
24
|
+
className: clsx(existingClass)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
return headerContext?.hideRegionPicker ? null : (jsx("div", { className: clsx("ids-header-1177-pro-region-picker-mobile", {
|
|
30
|
+
"ids-header-1177-pro-region-picker-mobile--selected-region": hasChildren
|
|
31
|
+
}), ...props, children: jsxs("button", { onClick: toggleRegion, className: clsx("ids-header-1177-pro-region-picker-mobile__button", {
|
|
32
|
+
"ids-header-1177-pro-region-picker-mobile__button--expanded": isExpanded
|
|
33
|
+
}), "aria-label": text, children: [jsx("div", { className: "ids-header-1177-pro-region-picker-mobile__region-icon", children: renderChild(children) }), jsxs("span", { className: "ids-header-1177-pro-region-picker-mobile__button-text", children: [" ", text] })] }) }));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { IDSHeader1177ProRegionPickerMobile };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css";
|
|
3
|
+
export interface IDSHeader1177ProRegionPickerProps {
|
|
4
|
+
text?: string;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
onToggleRegion?: (isExpanded: boolean) => void;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDSHeader1177ProRegionPicker: React.FC<IDSHeader1177ProRegionPickerProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React, { useState, useRef, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
const IDSHeader1177ProRegionPicker = ({ text = "Välj region", expanded: propExpanded = false, onToggleRegion, children, ...props }) => {
|
|
7
|
+
const [isExpanded, setIsExpanded] = useState(propExpanded);
|
|
8
|
+
const regionIconRef = useRef(null);
|
|
9
|
+
const toggleRegion = () => {
|
|
10
|
+
const newExpanded = !isExpanded;
|
|
11
|
+
setIsExpanded(newExpanded);
|
|
12
|
+
onToggleRegion?.(newExpanded);
|
|
13
|
+
};
|
|
14
|
+
const hasChildren = React.Children.count(children) > 0;
|
|
15
|
+
const renderChild = (child) => {
|
|
16
|
+
if (isValidElement(child)) {
|
|
17
|
+
const existingClass = child.props.className;
|
|
18
|
+
return cloneElement(child, {
|
|
19
|
+
ref: regionIconRef,
|
|
20
|
+
size: "m",
|
|
21
|
+
colorPreset: 4,
|
|
22
|
+
className: clsx(existingClass)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
return (jsxs("div", { className: clsx("ids-header-1177-pro-region-picker", {
|
|
28
|
+
"ids-header-1177-pro-region-picker--selected-region": hasChildren
|
|
29
|
+
}), ...props, children: [jsx("div", { className: "ids-header-1177-pro-region-picker__region-icon", children: renderChild(children) }), jsx("div", { className: "ids-header-1177-pro-region-picker__selector", children: jsx("button", { onClick: toggleRegion, className: clsx("ids-header-1177-pro-region-picker__button", {
|
|
30
|
+
"ids-header-1177-pro-region-picker__button--expanded": isExpanded
|
|
31
|
+
}), "aria-label": text, children: text }) })] }));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { IDSHeader1177ProRegionPicker };
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import React, { ReactNode, PropsWithChildren, AnchorHTMLAttributes } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177-pro/header-1177-pro.css";
|
|
3
|
-
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css";
|
|
4
3
|
interface IDSHeader1177ProProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
regionPickerText?: string;
|
|
6
|
-
regionPickerExpanded?: boolean;
|
|
7
4
|
hideRegionPicker?: boolean;
|
|
8
|
-
fluid?: boolean;
|
|
9
5
|
unresponsive?: boolean;
|
|
10
6
|
logoText?: string;
|
|
11
|
-
|
|
7
|
+
srLogoText?: string;
|
|
12
8
|
logoHref?: string;
|
|
13
9
|
logoProps?: AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
14
|
-
|
|
10
|
+
regionPicker?: ReactNode;
|
|
15
11
|
avatar?: ReactNode;
|
|
16
|
-
|
|
12
|
+
logoLink?: ReactNode;
|
|
17
13
|
regionIcon?: ReactNode;
|
|
18
14
|
items?: ReactNode;
|
|
19
15
|
skipToContentLink?: ReactNode;
|
|
16
|
+
mobileMenu?: ReactNode;
|
|
20
17
|
children?: ReactNode;
|
|
21
18
|
}
|
|
22
19
|
export declare const IDSHeader1177Pro: React.FC<PropsWithChildren<IDSHeader1177ProProps>>;
|
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
4
|
import '@inera/ids-design/components/header-1177-pro/header-1177-pro.css';
|
|
6
|
-
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css';
|
|
7
5
|
import { HeaderProvider } from '../utils/contexts/HeaderContext.js';
|
|
8
6
|
|
|
9
|
-
const IDSHeader1177Pro = ({
|
|
10
|
-
const [isRegionExpanded, setIsRegionExpanded] = useState(initialExpanded);
|
|
11
|
-
const [hideRegionPicker, setHideRegionPicker] = useState(initialRegionPicker);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (avatar) {
|
|
14
|
-
// No region picker when avatar
|
|
15
|
-
setIsRegionExpanded(false);
|
|
16
|
-
setHideRegionPicker(true);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
setHideRegionPicker(initialRegionPicker);
|
|
20
|
-
}
|
|
21
|
-
}, [avatar]);
|
|
22
|
-
const toggleRegion = () => {
|
|
23
|
-
const newValue = !isRegionExpanded;
|
|
24
|
-
setIsRegionExpanded(newValue);
|
|
25
|
-
onToggleRegion?.(newValue);
|
|
26
|
-
};
|
|
7
|
+
const IDSHeader1177Pro = ({ hideRegionPicker = false, unresponsive = false, logoText = "för vårdpersonal", srLogoText = "Logotyp", logoHref = "", logoProps = {}, avatar, logoLink, regionPicker, items, skipToContentLink, mobileMenu, className, children, ...props }) => {
|
|
27
8
|
return (jsx(HeaderProvider, { value: {
|
|
28
9
|
unresponsive,
|
|
29
|
-
|
|
30
|
-
hideRegionPicker,
|
|
31
|
-
regionPickerText
|
|
10
|
+
hideRegionPicker
|
|
32
11
|
}, children: jsxs("header", { className: clsx("ids-header-1177-pro", {
|
|
33
|
-
"ids-header-1177-pro--unresponsive": unresponsive
|
|
34
|
-
|
|
35
|
-
}, className), children: [skipToContentLink && (jsx("div", { className: "ids-header-1177-pro__skip-to-content", children: skipToContentLink })), jsx("div", { className: "ids-header-1177-pro__container", children: jsxs("div", { className: "ids-header-1177-pro__inner", children: [jsxs("div", { className: "ids-header-1177-pro__logo-col", children: [jsx("div", { className: "ids-header-1177-pro__logo", children: logo ? (logo) : (jsx("a", { className: "ids-header-1177-pro__logo-link", href: logoHref, "aria-label": srLogoLabel, ...logoProps })) }), jsx("div", { className: "ids-header-1177-pro__logo-text", children: logoText }), !hideRegionPicker && !avatar && (jsx("button", { className: clsx("ids-header-1177-pro__region-picker-button", {
|
|
36
|
-
"ids-header-1177-pro__region-picker-button--expanded": isRegionExpanded
|
|
37
|
-
}), onClick: toggleRegion, "aria-label": regionPickerText, "aria-expanded": isRegionExpanded, children: regionIcon || regionPickerText }))] }), jsx("div", { className: "ids-header-1177-pro__items", children: jsxs("div", { className: "ids-header-1177-pro__items-inner", children: [items, " ", avatar] }) })] }) }), children] }) }));
|
|
12
|
+
"ids-header-1177-pro--unresponsive": unresponsive
|
|
13
|
+
}, className), ...props, children: [skipToContentLink && jsx("div", { className: "ids-header-1177-pro__skip-to-content", children: skipToContentLink }), jsxs("div", { className: "ids-header-1177-pro__main", children: [jsxs("div", { className: "ids-header-1177-pro__main-left", children: [jsx("div", { className: "ids-header-1177-pro__logo", children: logoLink ? (logoLink) : (jsx("a", { className: "ids-header-1177-pro__logo-link", href: logoHref, "aria-label": srLogoText, ...logoProps })) }), jsx("div", { className: "ids-header-1177-pro__logo-text", children: logoText }), !hideRegionPicker && regionPicker && jsx("div", { className: "ids-header-1177-pro__region-picker", children: regionPicker })] }), jsx("div", { className: "ids-header-1177-pro__main-right", children: jsxs("div", { className: "ids-header-1177-pro__items", children: [items, " ", avatar, mobileMenu && jsx("div", { className: "ids-header-1177-pro__mobile-menu", children: mobileMenu })] }) })] }), children] }) }));
|
|
38
14
|
};
|
|
39
15
|
|
|
40
16
|
export { IDSHeader1177Pro };
|
|
@@ -9,10 +9,9 @@ const IDSHeaderIneraItem = ({ mobile = false, separatorLeft = false, icon = "",
|
|
|
9
9
|
const headerContext = useHeaderContext();
|
|
10
10
|
const classNames = clsx("ids-header-inera-item", {
|
|
11
11
|
"ids-header-inera-item--mobile": mobile,
|
|
12
|
-
"ids-header-inera-item__separator": separatorLeft,
|
|
13
12
|
"ids-header-inera-item--unresponsive": headerContext?.unresponsive
|
|
14
13
|
});
|
|
15
|
-
const renderContent = () => (jsxs(Fragment, { children: [jsx("div", { className: "ids-header-inera-item__icon", "aria-
|
|
14
|
+
const renderContent = () => (jsxs(Fragment, { children: [jsx("div", { className: "ids-header-inera-item__icon", "aria-hidden": "true", children: icon && jsx("span", { className: `ids-icon-${icon}` }) }), jsx("div", { className: "ids-header-inera-item__text", children: text })] }));
|
|
16
15
|
if (link && isValidElement(link)) {
|
|
17
16
|
return cloneElement(link, {
|
|
18
17
|
...props,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-inera/header-inera-menu-mobile.css";
|
|
3
|
+
export interface IDSHeaderIneraMenuMobileProps {
|
|
4
|
+
expanded?: boolean;
|
|
5
|
+
persistent?: boolean;
|
|
6
|
+
srLabel?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
onExpanded?: () => void;
|
|
9
|
+
onClosed?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const IDSHeaderIneraMenuMobile: React.FC<IDSHeaderIneraMenuMobileProps>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/header-inera/header-inera-menu-mobile.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
|
+
|
|
8
|
+
const IDSHeaderIneraMenuMobile = ({ expanded = false, persistent = false, srLabel = "Meny", children, onExpanded, onClosed, ...props }) => {
|
|
9
|
+
const headerContext = useHeaderContext();
|
|
10
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
11
|
+
const containerRef = useRef(null);
|
|
12
|
+
const menuRef = useRef(null);
|
|
13
|
+
const handleLinkClick = () => {
|
|
14
|
+
setIsExpanded(false);
|
|
15
|
+
onClosed?.();
|
|
16
|
+
};
|
|
17
|
+
const handleClickOutside = (event) => {
|
|
18
|
+
if (!persistent && containerRef.current && !containerRef.current.contains(event.target)) {
|
|
19
|
+
setIsExpanded(false);
|
|
20
|
+
onClosed?.();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
document.addEventListener("click", handleClickOutside);
|
|
25
|
+
return () => {
|
|
26
|
+
document.removeEventListener("click", handleClickOutside);
|
|
27
|
+
};
|
|
28
|
+
}, [persistent]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!persistent && isExpanded) {
|
|
31
|
+
const links = menuRef.current?.querySelectorAll("a") || [];
|
|
32
|
+
links.forEach(link => link.addEventListener("click", handleLinkClick));
|
|
33
|
+
return () => {
|
|
34
|
+
links.forEach(link => link.removeEventListener("click", handleLinkClick));
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}, [isExpanded, persistent]);
|
|
38
|
+
const toggleExpanded = () => {
|
|
39
|
+
const newExpanded = !isExpanded;
|
|
40
|
+
setIsExpanded(newExpanded);
|
|
41
|
+
if (newExpanded) {
|
|
42
|
+
onExpanded?.();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
onClosed?.();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-inera-menu-mobile", {
|
|
49
|
+
"ids-header-inera-menu-mobile--expanded": isExpanded,
|
|
50
|
+
"ids-header-inera-menu-mobile--unresponsive": headerContext?.unresponsive
|
|
51
|
+
}), ...props, children: [jsx("button", { "aria-label": srLabel, "aria-expanded": isExpanded, onClick: toggleExpanded, className: "ids-header-inera-menu-mobile__button", children: jsx("div", { className: "ids-hamburger", children: jsx("div", { className: "ids-hamburger__lines" }) }) }), isExpanded && (jsx("nav", { className: "ids-header-inera-menu-mobile__menu-items", ref: menuRef, children: children }))] }));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { IDSHeaderIneraMenuMobile };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/header-inera/header-inera-nav-item.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
7
|
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
8
8
|
|
|
9
|
-
const IDSHeaderIneraNavItem = ({ label = "", active = false, expanded = false, notification, children, col1, col2, col3, col4 }) => {
|
|
9
|
+
const IDSHeaderIneraNavItem = ({ label = "", active = false, expanded = false, notification, children, col1, col2, col3, col4, ...props }) => {
|
|
10
10
|
const headerContext = useHeaderContext();
|
|
11
11
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
12
12
|
const containerRef = useRef(null);
|
|
@@ -37,8 +37,8 @@ const IDSHeaderIneraNavItem = ({ label = "", active = false, expanded = false, n
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
const renderLink = (link) => {
|
|
40
|
-
return
|
|
41
|
-
?
|
|
40
|
+
return React.isValidElement(link)
|
|
41
|
+
? React.cloneElement(link, {
|
|
42
42
|
activeIcon: true,
|
|
43
43
|
block: true,
|
|
44
44
|
colorPreset: 2,
|
|
@@ -49,14 +49,11 @@ const IDSHeaderIneraNavItem = ({ label = "", active = false, expanded = false, n
|
|
|
49
49
|
const renderContent = () => {
|
|
50
50
|
if (!isExpanded)
|
|
51
51
|
return null;
|
|
52
|
-
return (jsx("div", { id: contentId, className: "ids-header-inera-nav-
|
|
53
|
-
"ids-header-inera-nav-item__content-inner--fluid": headerContext?.fluid
|
|
54
|
-
}), children: [jsx("div", { className: "ids-header-inera-nav-item__content-col", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav-item__wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__content-col", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav-item__wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__content-col", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav-item__wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__content-col", children: col4 })] }) }));
|
|
52
|
+
return (jsx("div", { id: contentId, className: "ids-header-inera-nav-item__menu ids-header-inera-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-inera-nav-item__menu-inner", children: [jsx("div", { className: "ids-header-inera-nav-item__menu-col", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__menu-col", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__menu-col", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-inera-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-inera-nav-item__menu-col", children: col4 })] }) }));
|
|
55
53
|
};
|
|
56
54
|
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-inera-nav-item", {
|
|
57
|
-
"ids-header-inera-nav-item--fluid": headerContext?.fluid,
|
|
58
55
|
"ids-header-inera-nav-item--unresponsive": headerContext?.unresponsive
|
|
59
|
-
}), children: [renderNavItem(), renderContent()] }));
|
|
56
|
+
}), ...props, children: [renderNavItem(), renderContent()] }));
|
|
60
57
|
};
|
|
61
58
|
|
|
62
59
|
export { IDSHeaderIneraNavItem };
|
|
@@ -4,13 +4,12 @@ import '@inera/ids-design/components/header-inera/header-inera-nav.css';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
6
|
|
|
7
|
-
const IDSHeaderIneraNav = ({ srText = "Huvudmeny", children }) => {
|
|
7
|
+
const IDSHeaderIneraNav = ({ srText = "Huvudmeny", children, ...props }) => {
|
|
8
8
|
const headerContext = useHeaderContext();
|
|
9
9
|
const className = clsx("ids-header-inera-nav", {
|
|
10
|
-
"ids-header-inera-nav--fluid": headerContext?.fluid,
|
|
11
10
|
"ids-header-inera-nav--unresponsive": headerContext?.unresponsive
|
|
12
11
|
});
|
|
13
|
-
return (jsx("nav", { className: className, "aria-label": srText, children: jsx("div", { className: "ids-header-inera-nav__nav-items", children: children }) }));
|
|
12
|
+
return (jsx("nav", { className: className, "aria-label": srText, ...props, children: jsx("div", { className: "ids-header-inera-nav__nav-items", children: children }) }));
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
export { IDSHeaderIneraNav };
|
|
@@ -3,8 +3,7 @@ import "@inera/ids-design/components/header-inera/header-inera.css";
|
|
|
3
3
|
interface IDSHeaderIneraProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
logoHref?: string;
|
|
5
5
|
logoProps?: AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
6
|
-
|
|
7
|
-
fluid?: boolean;
|
|
6
|
+
srLogoText?: string;
|
|
8
7
|
unresponsive?: boolean;
|
|
9
8
|
items?: ReactNode;
|
|
10
9
|
mobileMenu?: ReactNode;
|
|
@@ -4,16 +4,13 @@ import clsx from 'clsx';
|
|
|
4
4
|
import '@inera/ids-design/components/header-inera/header-inera.css';
|
|
5
5
|
import { HeaderProvider } from '../utils/contexts/HeaderContext.js';
|
|
6
6
|
|
|
7
|
-
const IDSHeaderInera = ({ logoHref = "", logoProps = {},
|
|
7
|
+
const IDSHeaderInera = ({ logoHref = "", logoProps = {}, srLogoText = "Logotyp inera", unresponsive = false, items, mobileMenu, skipToContent, logo, className, children, ...props }) => {
|
|
8
8
|
return (jsx(HeaderProvider, { value: {
|
|
9
9
|
unresponsive,
|
|
10
|
-
|
|
11
|
-
hideRegionPicker: true,
|
|
12
|
-
regionPickerText: ""
|
|
10
|
+
hideRegionPicker: true
|
|
13
11
|
}, children: jsxs("header", { className: clsx("ids-header-inera", {
|
|
14
|
-
"ids-header-inera--unresponsive": unresponsive
|
|
15
|
-
|
|
16
|
-
}, className), children: [skipToContent && jsx("div", { className: "ids-header-inera__skip-to-content", children: skipToContent }), jsxs("div", { className: "ids-header-inera__inner", children: [logoHref ? (jsx("a", { href: logoHref, "aria-label": srLogoLabel, className: "ids-header-inera__logo", ...logoProps })) : logo ? (jsx("div", { className: "ids-header-inera__logo-custom", children: logo })) : (jsx("div", { className: "ids-header-inera__logo" })), jsxs("div", { className: "ids-header-inera__items", children: [items, " ", mobileMenu] })] }), children] }) }));
|
|
12
|
+
"ids-header-inera--unresponsive": unresponsive
|
|
13
|
+
}, className), ...props, children: [skipToContent && jsx("div", { className: "ids-header-inera__skip-to-content", children: skipToContent }), jsxs("div", { className: "ids-header-inera__inner", children: [jsxs("div", { className: "ids-header-inera__main", children: [logoHref ? (jsx("a", { href: logoHref, "aria-label": srLogoText, className: "ids-header-inera__logo", ...logoProps })) : logo ? (jsx("div", { className: "ids-header-inera__logo-custom", children: logo })) : (jsx("div", { className: "ids-header-inera__logo" })), jsxs("div", { className: "ids-header-inera__items", children: [items, " ", mobileMenu] })] }), children] })] }) }));
|
|
17
14
|
};
|
|
18
15
|
|
|
19
16
|
export { IDSHeaderInera };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-inera-admin/header-inera-admin-avatar-mobile.css";
|
|
3
3
|
interface IDSHeaderIneraAdminAvatarMobileProps {
|
|
4
4
|
username?: string;
|
|
5
5
|
unit?: string;
|
|
6
|
-
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
loginLink?: ReactNode;
|
|
8
|
+
persistent?: boolean;
|
|
9
|
+
children?: ReactNode;
|
|
7
10
|
}
|
|
8
11
|
export declare const IDSHeaderIneraAdminAvatarMobile: React.FC<IDSHeaderIneraAdminAvatarMobileProps>;
|
|
9
12
|
export {};
|
|
@@ -1,14 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useId, useState, useRef, useEffect } from 'react';
|
|
3
4
|
import '@inera/ids-design/components/header-inera-admin/header-inera-admin-avatar-mobile.css';
|
|
4
5
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
|
|
7
|
-
const IDSHeaderIneraAdminAvatarMobile = ({ username = "", unit = "", children }) => {
|
|
8
|
+
const IDSHeaderIneraAdminAvatarMobile = ({ username = "", unit = "", expanded = false, loginLink, persistent = false, children, ...props }) => {
|
|
9
|
+
const dropdownId = useId();
|
|
10
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
8
11
|
const headerContext = useHeaderContext();
|
|
12
|
+
const containerRef = useRef(null);
|
|
13
|
+
const toggleExpanded = () => setIsExpanded(prev => !prev);
|
|
14
|
+
const handleClickOutside = (event) => {
|
|
15
|
+
if (!persistent && containerRef.current && !containerRef.current.contains(event.target)) {
|
|
16
|
+
setIsExpanded(false);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
document.addEventListener("click", handleClickOutside);
|
|
21
|
+
return () => {
|
|
22
|
+
document.removeEventListener("click", handleClickOutside);
|
|
23
|
+
};
|
|
24
|
+
}, [persistent]);
|
|
9
25
|
return (jsxs("div", { className: clsx("ids-header-inera-admin-avatar-mobile", {
|
|
10
26
|
"ids-header-inera-admin-avatar-mobile--unresponsive": headerContext?.unresponsive
|
|
11
|
-
}),
|
|
27
|
+
}), ref: containerRef, ...props, children: [!username && loginLink && jsx("span", { className: "ids-header-inera-admin-avatar-mobile__login-link", children: loginLink }), username && (jsxs("div", { className: "ids-header-inera-admin-avatar-mobile__menu-wrapper", children: [jsx("button", { className: clsx("ids-header-inera-admin-avatar-mobile__button", {
|
|
28
|
+
"ids-header-inera-admin-avatar-mobile__button--expanded": isExpanded
|
|
29
|
+
}), onClick: toggleExpanded, "aria-controls": dropdownId, "aria-expanded": isExpanded, children: jsx("div", { className: "ids-header-inera-admin-avatar-mobile-content__name", title: username, children: username }) }), jsxs("div", { id: dropdownId, className: clsx("ids-header-inera-admin-avatar-mobile__menu", {
|
|
30
|
+
"ids-header-inera-admin-avatar-mobile__menu--expanded": isExpanded
|
|
31
|
+
}), children: [unit && jsx("div", { className: "ids-header-inera-admin-avatar-mobile__unit", children: unit }), jsx("div", { className: "ids-header-inera-admin-avatar-mobile__menu-links", children: children })] })] }))] }));
|
|
12
32
|
};
|
|
13
33
|
|
|
14
34
|
export { IDSHeaderIneraAdminAvatarMobile };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-inera-admin/header-inera-admin-avatar.css";
|
|
3
3
|
interface IDSHeaderIneraAdminAvatarProps {
|
|
4
|
-
username
|
|
4
|
+
username: string;
|
|
5
5
|
unit?: string;
|
|
6
|
-
|
|
7
|
-
onExpanded?: () => void;
|
|
8
|
-
onClosed?: () => void;
|
|
6
|
+
expanded?: boolean;
|
|
9
7
|
children?: ReactNode;
|
|
8
|
+
persistent?: boolean;
|
|
10
9
|
}
|
|
11
10
|
export declare const IDSHeaderIneraAdminAvatar: React.FC<IDSHeaderIneraAdminAvatarProps>;
|
|
12
11
|
export {};
|