@inera/ids-react 7.2.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion.d.ts +1 -0
- package/components/accordion/accordion.js +5 -43
- package/components/alert/alert.d.ts +3 -3
- package/components/alert/alert.js +8 -5
- package/components/badge/badge.d.ts +3 -6
- package/components/badge/badge.js +3 -3
- package/components/box-link/box-link.d.ts +3 -5
- package/components/box-link/box-link.js +3 -4
- package/components/breadcrumbs/breadcrumbs.d.ts +2 -3
- package/components/breadcrumbs/breadcrumbs.js +5 -6
- package/components/button/button.d.ts +6 -8
- package/components/button/button.js +5 -79
- package/components/button-group/button-group.d.ts +2 -3
- package/components/button-group/button-group.js +2 -2
- package/components/card/card.d.ts +6 -7
- package/components/card/card.js +16 -10
- 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 +8 -2
- package/components/date-label/date-label.js +10 -17
- package/components/dialog/dialog.d.ts +13 -13
- package/components/dialog/dialog.js +10 -13
- 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.d.ts +1 -1
- package/components/dropdown/dropdown-content-link.js +4 -3
- package/components/dropdown/dropdown.d.ts +6 -5
- package/components/dropdown/dropdown.js +12 -11
- package/components/footer-1177/footer-1177.d.ts +3 -7
- package/components/footer-1177/footer-1177.js +9 -52
- package/components/footer-1177-admin/footer-1177-admin.d.ts +6 -8
- package/components/footer-1177-admin/footer-1177-admin.js +11 -53
- package/components/footer-1177-pro/footer-1177-pro.d.ts +16 -11
- package/components/footer-1177-pro/footer-1177-pro.js +13 -31
- package/components/footer-inera/footer-inera.d.ts +3 -7
- package/components/footer-inera/footer-inera.js +10 -53
- package/components/footer-inera-admin/footer-inera-admin.d.ts +3 -7
- package/components/footer-inera-admin/footer-inera-admin.js +12 -52
- 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 +3 -3
- 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/column.d.ts +3 -4
- package/components/grid/column.js +2 -3
- package/components/grid/container.d.ts +4 -4
- package/components/grid/container.js +7 -18
- package/components/grid/row.d.ts +4 -4
- package/components/grid/row.js +6 -11
- 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 +3 -2
- package/components/header-1177/header-1177-item.js +22 -16
- 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 +7 -12
- package/components/header-1177/header-1177-nav-item.d.ts +4 -4
- package/components/header-1177/header-1177-nav-item.js +23 -18
- package/components/header-1177/header-1177-nav.d.ts +4 -2
- package/components/header-1177/header-1177-nav.js +6 -8
- 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 +3 -7
- package/components/header-1177/header-1177.js +7 -36
- 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.d.ts +2 -2
- package/components/header-1177-admin/header-1177-admin-item.js +23 -19
- 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.d.ts +4 -4
- package/components/header-1177-admin/header-1177-admin-nav-item.js +22 -17
- package/components/header-1177-admin/header-1177-admin-nav.d.ts +2 -2
- package/components/header-1177-admin/header-1177-admin-nav.js +7 -9
- package/components/header-1177-admin/header-1177-admin.d.ts +3 -6
- package/components/header-1177-admin/header-1177-admin.js +7 -21
- 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.d.ts +2 -2
- package/components/header-1177-pro/header-1177-pro-item.js +23 -16
- 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.d.ts +5 -5
- package/components/header-1177-pro/header-1177-pro-nav-item.js +17 -21
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +4 -5
- package/components/header-1177-pro/header-1177-pro-nav.js +8 -25
- 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 +6 -9
- package/components/header-1177-pro/header-1177-pro.js +6 -34
- package/components/header-inera/header-inera-item.d.ts +3 -4
- package/components/header-inera/header-inera-item.js +30 -15
- 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 +9 -25
- package/components/header-inera/header-inera-nav.d.ts +1 -1
- package/components/header-inera/header-inera-nav.js +6 -8
- package/components/header-inera/header-inera.d.ts +3 -4
- package/components/header-inera/header-inera.js +6 -13
- 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.d.ts +3 -4
- package/components/header-inera-admin/header-inera-admin-item.js +17 -13
- 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.d.ts +1 -3
- package/components/header-inera-admin/header-inera-admin-nav-item.js +15 -31
- package/components/header-inera-admin/header-inera-admin-nav.d.ts +2 -3
- package/components/header-inera-admin/header-inera-admin-nav.js +4 -6
- package/components/header-inera-admin/header-inera-admin.d.ts +2 -2
- package/components/header-inera-admin/header-inera-admin.js +6 -8
- 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 +4 -4
- package/components/link/link.js +17 -15
- package/components/mobile/menu/item/mobile-item.js +4 -4
- package/components/navigation/content/navigation-content.d.ts +3 -3
- package/components/navigation/content/navigation-content.js +7 -13
- package/components/navigation/local/navigation-local.d.ts +2 -3
- package/components/navigation/local/navigation-local.js +2 -2
- package/components/notification/badge/notification-badge.d.ts +2 -3
- package/components/notification/badge/notification-badge.js +2 -2
- package/components/pagination/data-pagination/data-pagination.d.ts +8 -13
- package/components/pagination/data-pagination/data-pagination.js +7 -8
- package/components/pagination/list-pagination/list-pagination.d.ts +1 -1
- package/components/pagination/list-pagination/list-pagination.js +7 -13
- package/components/popover/popover.js +9 -9
- package/components/progressbar/progressbar.d.ts +5 -3
- package/components/progressbar/progressbar.js +4 -4
- package/components/puff-list/puff-list-item/puff-list-item-date.d.ts +13 -0
- package/components/puff-list/puff-list-item/puff-list-item-date.js +23 -0
- package/components/puff-list/puff-list-item/puff-list-item-header.d.ts +10 -0
- package/components/puff-list/puff-list-item/puff-list-item-header.js +11 -0
- package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +4 -5
- package/components/puff-list/puff-list-item/puff-list-item-info.js +5 -3
- package/components/puff-list/puff-list-item/puff-list-item.d.ts +10 -13
- package/components/puff-list/puff-list-item/puff-list-item.js +10 -46
- package/components/puff-list/puff-list.d.ts +1 -1
- package/components/puff-list/puff-list.js +4 -3
- package/components/region-icon/region-icon.d.ts +2 -2
- package/components/region-icon/region-icon.js +6 -6
- package/components/side-menu/side-menu.d.ts +1 -1
- package/components/side-menu/side-menu.js +7 -7
- 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.d.ts +1 -1
- package/components/stepper/stepper.js +5 -5
- package/components/tabs/tab-panel.js +2 -2
- package/components/tabs/tab.js +2 -2
- package/components/tabs/tabs.js +13 -13
- package/components/tag/tag.d.ts +11 -4
- package/components/tag/tag.js +7 -7
- package/components/tooltip/tooltip.d.ts +1 -0
- package/components/tooltip/tooltip.js +8 -7
- package/components/utils/contexts/HeaderContext.d.ts +0 -2
- package/components/utils/hooks/useFocusTrap.js +2 -1
- package/index.d.ts +18 -144
- package/index.js +18 -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
|
@@ -1,34 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useId, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-avatar.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
7
|
|
|
8
|
-
const IDSHeader1177ProAvatar = ({ username
|
|
8
|
+
const IDSHeader1177ProAvatar = ({ username, unit, expanded = false, children, persistent = false, ...props }) => {
|
|
9
|
+
const dropdownId = useId();
|
|
10
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
9
11
|
const headerContext = useHeaderContext();
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const toggleExpanded = () =>
|
|
13
|
-
|
|
12
|
+
const containerRef = useRef(null);
|
|
13
|
+
const dropdownRef = useRef(null);
|
|
14
|
+
const toggleExpanded = () => setIsExpanded(prev => !prev);
|
|
15
|
+
const handleClickOutside = (event) => {
|
|
16
|
+
if (!persistent && containerRef.current && !containerRef.current.contains(event.target)) {
|
|
17
|
+
setIsExpanded(false);
|
|
18
|
+
}
|
|
14
19
|
};
|
|
15
20
|
useEffect(() => {
|
|
16
|
-
const handleClickOutside = (event) => {
|
|
17
|
-
if (avatarRef.current && !avatarRef.current.contains(event.target) && !persistent) {
|
|
18
|
-
setExpanded(false);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
21
|
document.addEventListener("mousedown", handleClickOutside);
|
|
22
22
|
return () => {
|
|
23
23
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
24
24
|
};
|
|
25
25
|
}, [persistent]);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const handleLinkClick = () => {
|
|
27
|
+
setIsExpanded(false);
|
|
28
|
+
};
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!persistent && isExpanded) {
|
|
31
|
+
const links = dropdownRef.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
|
+
return (jsx("div", { ref: containerRef, className: clsx("ids-header-1177-pro-avatar", {
|
|
39
|
+
"ids-header-1177-pro-avatar--unresponsive": headerContext?.unresponsive
|
|
40
|
+
}), ...props, children: jsxs("div", { className: "ids-header-1177-pro-avatar__menu-wrapper", children: [jsxs("button", { className: clsx("ids-header-1177-pro-avatar__button", {
|
|
41
|
+
"ids-header-1177-pro-avatar__button--expanded": isExpanded
|
|
42
|
+
}), onClick: toggleExpanded, "aria-controls": dropdownId, "aria-expanded": isExpanded, children: [jsx("div", { className: "ids-header-1177-pro-avatar__name", title: username, children: username }), unit && (jsx("div", { className: "ids-header-1177-pro-avatar__unit", title: unit, children: unit }))] }), jsx("div", { ref: dropdownRef, id: dropdownId, className: clsx("ids-header-1177-pro-avatar__menu", {
|
|
43
|
+
"ids-header-1177-pro-avatar__menu--expanded": isExpanded
|
|
44
|
+
}), children: children && jsx("div", { className: "ids-header-1177-pro-avatar__menu-links", children: children }) })] }) }));
|
|
32
45
|
};
|
|
33
46
|
|
|
34
47
|
export { IDSHeader1177ProAvatar };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-item.css";
|
|
3
3
|
interface IDSHeader1177ProItemProps {
|
|
4
4
|
mobile?: boolean;
|
|
@@ -8,5 +8,5 @@ interface IDSHeader1177ProItemProps {
|
|
|
8
8
|
link?: ReactNode;
|
|
9
9
|
onClick?: () => void;
|
|
10
10
|
}
|
|
11
|
-
export declare
|
|
11
|
+
export declare function IDSHeader1177ProItem({ mobile, icon, text, href, link, onClick, ...props }: IDSHeader1177ProItemProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { isValidElement, cloneElement } from 'react';
|
|
4
|
-
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-item.css';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React, { isValidElement, cloneElement } from 'react';
|
|
5
3
|
import clsx from 'clsx';
|
|
6
4
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
5
|
+
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-item.css';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
const headerContext = useHeaderContext();
|
|
10
|
-
const classNames = clsx("ids-header-1177-
|
|
11
|
-
"ids-header-1177-
|
|
12
|
-
"ids-header-1177-
|
|
7
|
+
function IDSHeader1177ProItem({ mobile = false, icon = "", text = "", href = "", link, onClick, ...props }) {
|
|
8
|
+
const headerContext = useHeaderContext() || { unresponsive: false };
|
|
9
|
+
const classNames = clsx("ids-header-1177-pro-item", {
|
|
10
|
+
"ids-header-1177-pro-item--unresponsive": headerContext.unresponsive,
|
|
11
|
+
"ids-header-1177-pro-item--mobile": mobile
|
|
13
12
|
});
|
|
14
|
-
const renderContent = () => (
|
|
13
|
+
const renderContent = () => (jsx("div", { className: "ids-header-1177-pro-item-icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) }));
|
|
15
14
|
if (link && isValidElement(link)) {
|
|
16
|
-
|
|
15
|
+
const linkProps = link.props;
|
|
16
|
+
const hasChildren = !!linkProps.children &&
|
|
17
|
+
(typeof linkProps.children === "string"
|
|
18
|
+
? linkProps.children.trim().length > 0
|
|
19
|
+
: React.Children.count(linkProps.children) > 0);
|
|
20
|
+
const newLink = cloneElement(link, {
|
|
17
21
|
...props,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
children: renderContent()
|
|
22
|
+
className: clsx(linkProps.className),
|
|
23
|
+
children: hasChildren ? linkProps.children : text
|
|
21
24
|
});
|
|
25
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), " ", newLink] }));
|
|
26
|
+
}
|
|
27
|
+
if (onClick) {
|
|
28
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("button", { onClick: onClick, ...props, children: text })] }));
|
|
22
29
|
}
|
|
23
|
-
return
|
|
24
|
-
}
|
|
30
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
|
|
31
|
+
}
|
|
25
32
|
|
|
26
33
|
export { IDSHeader1177ProItem };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-
|
|
3
|
-
interface
|
|
2
|
+
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-menu-mobile.css";
|
|
3
|
+
interface IDSHeader1177ProMenuMobileProps {
|
|
4
4
|
label?: string;
|
|
5
5
|
persistent?: boolean;
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
onExpanded?: () => void;
|
|
8
8
|
onClosed?: () => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const IDSHeader1177ProMenuMobile: React.FC<IDSHeader1177ProMenuMobileProps>;
|
|
11
11
|
export {};
|
|
@@ -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,15 +1,15 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode, ReactElement } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-nav-item.css";
|
|
3
3
|
import { IDSLinkProps } from "../link/link";
|
|
4
|
-
interface IDSHeader1177ProNavItemProps {
|
|
4
|
+
export interface IDSHeader1177ProNavItemProps {
|
|
5
|
+
label?: string;
|
|
5
6
|
active?: boolean;
|
|
6
7
|
expanded?: boolean;
|
|
7
|
-
|
|
8
|
+
notification?: ReactNode;
|
|
9
|
+
children?: ReactNode;
|
|
8
10
|
col1?: ReactElement<IDSLinkProps>[];
|
|
9
11
|
col2?: ReactElement<IDSLinkProps>[];
|
|
10
12
|
col3?: ReactElement<IDSLinkProps>[];
|
|
11
13
|
col4?: ReactElement<IDSLinkProps>[];
|
|
12
|
-
children?: ReactNode;
|
|
13
14
|
}
|
|
14
15
|
export declare const IDSHeader1177ProNavItem: React.FC<IDSHeader1177ProNavItemProps>;
|
|
15
|
-
export {};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import { 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
|
+
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
7
8
|
|
|
8
|
-
const IDSHeader1177ProNavItem = ({ active = false, expanded = false,
|
|
9
|
+
const IDSHeader1177ProNavItem = ({ label = "", active = false, expanded = false, notification, children, col1, col2, col3, col4, ...props }) => {
|
|
9
10
|
const headerContext = useHeaderContext();
|
|
10
11
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
11
12
|
const containerRef = useRef(null);
|
|
13
|
+
const contentId = useElementId();
|
|
14
|
+
//FIXME click on link should also close menu
|
|
12
15
|
const handleClickOutside = (event) => {
|
|
13
16
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
14
17
|
setIsExpanded(false);
|
|
@@ -21,31 +24,24 @@ const IDSHeader1177ProNavItem = ({ active = false, expanded = false, label = "",
|
|
|
21
24
|
document.removeEventListener("click", handleClickOutside);
|
|
22
25
|
};
|
|
23
26
|
}, [expanded]);
|
|
24
|
-
const
|
|
27
|
+
const renderNavItem = () => {
|
|
25
28
|
if (label) {
|
|
26
|
-
return (
|
|
29
|
+
return (jsxs("button", { "aria-controls": contentId, "aria-expanded": isExpanded, className: "ids-header-1177-pro-nav-item__button", onClick: () => setIsExpanded(prev => !prev), children: [label, " ", notification] }));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return (jsxs("span", { className: "ids-header-1177-pro-nav-item__link", children: [children, " ", notification] }));
|
|
27
33
|
}
|
|
28
|
-
return children;
|
|
29
|
-
};
|
|
30
|
-
const renderLink = (link) => {
|
|
31
|
-
return React__default.isValidElement(link)
|
|
32
|
-
? React__default.cloneElement(link, {
|
|
33
|
-
activeIcon: true,
|
|
34
|
-
block: true,
|
|
35
|
-
colorPreset: 1,
|
|
36
|
-
onClick: () => setIsExpanded(false)
|
|
37
|
-
})
|
|
38
|
-
: link;
|
|
39
34
|
};
|
|
40
|
-
const
|
|
35
|
+
const renderContent = () => {
|
|
41
36
|
if (!isExpanded)
|
|
42
37
|
return null;
|
|
43
|
-
return (jsx("div", { id:
|
|
38
|
+
return (jsx("div", { id: contentId, 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-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-pro-nav-item__menu-col-4", children: col4?.map((link, idx) => (jsx("div", { className: "ids-header-1177-pro-nav__menu-item-wrapper", children: link }, idx))) })] }) }));
|
|
44
39
|
};
|
|
45
|
-
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-
|
|
46
|
-
"ids-header-1177-
|
|
47
|
-
"ids-header-1177-
|
|
48
|
-
|
|
40
|
+
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-pro-nav-item", {
|
|
41
|
+
"ids-header-1177-pro-nav-item--unresponsive": headerContext?.unresponsive,
|
|
42
|
+
"ids-header-1177-pro-nav-item--expanded": isExpanded,
|
|
43
|
+
"ids-header-1177-pro-nav-item--active": active
|
|
44
|
+
}), ...props, children: [renderNavItem(), renderContent()] }));
|
|
49
45
|
};
|
|
50
46
|
|
|
51
47
|
export { IDSHeader1177ProNavItem };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-nav.css";
|
|
3
|
-
import "@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css";
|
|
4
3
|
interface IDSHeader1177ProNavProps {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
mobileRegionPicker?: ReactNode;
|
|
5
|
+
mobileAvatar?: ReactNode;
|
|
7
6
|
children?: ReactNode;
|
|
8
7
|
}
|
|
9
|
-
export declare
|
|
8
|
+
export declare function IDSHeader1177ProNav({ mobileRegionPicker, mobileAvatar, children, ...props }: IDSHeader1177ProNavProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-nav.css';
|
|
5
|
-
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-region-picker.css';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
2
|
import clsx from 'clsx';
|
|
7
3
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
4
|
+
import '@inera/ids-design/components/header-1177-pro/header-1177-pro-nav.css';
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
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] }) }));
|
|
28
|
-
};
|
|
6
|
+
function IDSHeader1177ProNav({ mobileRegionPicker, mobileAvatar, children, ...props }) {
|
|
7
|
+
const headerContext = useHeaderContext() || { unresponsive: false };
|
|
8
|
+
return (jsxs("nav", { className: clsx("ids-header-1177-pro-nav", {
|
|
9
|
+
"ids-header-1177-pro-nav--unresponsive": headerContext.unresponsive
|
|
10
|
+
}), ...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] })] }));
|
|
11
|
+
}
|
|
29
12
|
|
|
30
13
|
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,23 +1,20 @@
|
|
|
1
|
-
import React, { ReactNode,
|
|
1
|
+
import React, { ReactNode, 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
|
-
export declare
|
|
19
|
+
export declare function IDSHeader1177Pro({ hideRegionPicker, unresponsive, logoText, srLogoText, logoHref, logoProps, avatar, logoLink, regionPicker, items, skipToContentLink, mobileMenu, className, children, ...props }: IDSHeader1177ProProps): import("react/jsx-runtime").JSX.Element;
|
|
23
20
|
export {};
|
|
@@ -1,40 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
2
|
import clsx from 'clsx';
|
|
5
|
-
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
3
|
import { HeaderProvider } from '../utils/contexts/HeaderContext.js';
|
|
4
|
+
import '@inera/ids-design/components/header-1177-pro/header-1177-pro.css';
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
};
|
|
27
|
-
return (jsx(HeaderProvider, { value: {
|
|
28
|
-
unresponsive,
|
|
29
|
-
fluid,
|
|
30
|
-
hideRegionPicker,
|
|
31
|
-
regionPickerText
|
|
32
|
-
}, children: jsxs("header", { className: clsx("ids-header-1177-pro", {
|
|
33
|
-
"ids-header-1177-pro--unresponsive": unresponsive,
|
|
34
|
-
"ids-header-1177-pro--fluid": fluid
|
|
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] }) }));
|
|
38
|
-
};
|
|
6
|
+
function IDSHeader1177Pro({ hideRegionPicker = false, unresponsive = false, logoText = "för vårdpersonal", srLogoText = "Logotyp", logoHref = "", logoProps = {}, avatar, logoLink, regionPicker, items, skipToContentLink, mobileMenu, className, children, ...props }) {
|
|
7
|
+
return (jsx(HeaderProvider, { value: { unresponsive, hideRegionPicker }, children: jsxs("header", { className: clsx("ids-header-1177-pro", {
|
|
8
|
+
"ids-header-1177-pro--unresponsive": unresponsive
|
|
9
|
+
}, 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] }) }));
|
|
10
|
+
}
|
|
39
11
|
|
|
40
12
|
export { IDSHeader1177Pro };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-inera/header-inera-item.css";
|
|
3
|
-
interface IDSHeaderIneraItemProps {
|
|
3
|
+
export interface IDSHeaderIneraItemProps {
|
|
4
4
|
mobile?: boolean;
|
|
5
5
|
separatorLeft?: boolean;
|
|
6
6
|
icon?: string;
|
|
@@ -9,5 +9,4 @@ interface IDSHeaderIneraItemProps {
|
|
|
9
9
|
link?: ReactNode;
|
|
10
10
|
onClick?: () => void;
|
|
11
11
|
}
|
|
12
|
-
export declare
|
|
13
|
-
export {};
|
|
12
|
+
export declare function IDSHeaderIneraItem({ mobile, separatorLeft, icon, text, href, link, onClick, ...props }: IDSHeaderIneraItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { isValidElement, cloneElement } from 'react';
|
|
4
|
-
import '@inera/ids-design/components/header-inera/header-inera-item.css';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React, { isValidElement, cloneElement } from 'react';
|
|
5
3
|
import clsx from 'clsx';
|
|
6
4
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
5
|
+
import '@inera/ids-design/components/header-inera/header-inera-item.css';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
const headerContext = useHeaderContext();
|
|
7
|
+
function IDSHeaderIneraItem({ mobile = false, separatorLeft = false, icon = "", text = "", href = "", link, onClick, ...props }) {
|
|
8
|
+
const headerContext = useHeaderContext() || { unresponsive: false };
|
|
10
9
|
const classNames = clsx("ids-header-inera-item", {
|
|
11
10
|
"ids-header-inera-item--mobile": mobile,
|
|
12
|
-
"ids-header-inera-
|
|
13
|
-
"ids-header-inera-item--unresponsive": headerContext?.unresponsive
|
|
11
|
+
"ids-header-inera-item--unresponsive": headerContext.unresponsive
|
|
14
12
|
});
|
|
15
|
-
const renderContent = () => (
|
|
13
|
+
const renderContent = () => (jsx("div", { className: "ids-header-inera-item__icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) }));
|
|
14
|
+
// FIXME 9.0 let the user provide a link or button for all react header items to align with structure for the other frameworks
|
|
15
|
+
/* if (link && isValidElement(link)) {
|
|
16
|
+
return (
|
|
17
|
+
<div className={classNames}>
|
|
18
|
+
{renderContent()}
|
|
19
|
+
{link}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
} */
|
|
16
23
|
if (link && isValidElement(link)) {
|
|
17
|
-
|
|
24
|
+
const linkProps = link.props;
|
|
25
|
+
const hasChildren = !!linkProps.children &&
|
|
26
|
+
(typeof linkProps.children === "string"
|
|
27
|
+
? linkProps.children.trim().length > 0
|
|
28
|
+
: React.Children.count(linkProps.children) > 0);
|
|
29
|
+
const newLink = cloneElement(link, {
|
|
18
30
|
...props,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
children: renderContent()
|
|
31
|
+
className: clsx(link.props.className),
|
|
32
|
+
children: hasChildren ? linkProps.children : text
|
|
22
33
|
});
|
|
34
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), " ", newLink] }));
|
|
35
|
+
}
|
|
36
|
+
if (onClick) {
|
|
37
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("button", { onClick: onClick, ...props, children: text })] }));
|
|
23
38
|
}
|
|
24
|
-
return
|
|
25
|
-
}
|
|
39
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
|
|
40
|
+
}
|
|
26
41
|
|
|
27
42
|
export { IDSHeaderIneraItem };
|
|
@@ -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>;
|