@inera/ids-react 7.1.1 → 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 +2 -1
- package/components/header-inera-admin/header-inera-admin.js +6 -11
- 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.d.ts +1 -0
- package/components/tabs/tabs.js +26 -12
- 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
|
@@ -7,7 +7,7 @@ import { useInputValidity } from '../form-hooks/useInputValidity.js';
|
|
|
7
7
|
import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
|
|
10
|
-
const IDSTextarea = forwardRef(({ label = "", hint, errorMsg = "", disabled = false, invalid = false, required = false, noValidation = false, autoSize = false, noResize = false, block = false, light = false, readOnly = false, focusAnchor = false, id, tooltip, className, ...props }, ref) => {
|
|
10
|
+
const IDSTextarea = forwardRef(({ label = "", hint, errorMsg = "", dataTestId = "", disabled = false, invalid = false, required = false, noValidation = false, autoSize = false, noResize = false, block = false, light = false, readOnly = false, focusAnchor = false, id, tooltip, className, ...props }, ref) => {
|
|
11
11
|
const fieldId = useElementId(id);
|
|
12
12
|
const errorMsgId = useElementId();
|
|
13
13
|
const hintId = useElementId();
|
|
@@ -20,7 +20,7 @@ const IDSTextarea = forwardRef(({ label = "", hint, errorMsg = "", disabled = fa
|
|
|
20
20
|
"ids-textarea--block": block,
|
|
21
21
|
"ids-textarea--autosize": autoSize,
|
|
22
22
|
"ids-textarea--no-resize": noResize
|
|
23
|
-
}, className), children: [jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { className: clsx("ids-label", {
|
|
23
|
+
}, className), "data-testid": dataTestId, children: [jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { className: clsx("ids-label", {
|
|
24
24
|
"ids-label--disabled": disabled || readOnly
|
|
25
25
|
}), htmlFor: fieldId, children: label }), tooltip && tooltip] }), jsx("textarea", { ref: textareaRef, id: fieldId, className: clsx("ids-textarea__textarea", {
|
|
26
26
|
"ids-input--light": light,
|
|
@@ -9,6 +9,7 @@ interface IDSTimeProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
9
9
|
focusAnchor?: boolean;
|
|
10
10
|
light?: boolean;
|
|
11
11
|
tooltip?: ReactNode;
|
|
12
|
+
dataTestId?: string;
|
|
12
13
|
}
|
|
13
14
|
export declare const IDSTime: import("react").ForwardRefExoticComponent<IDSTimeProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
14
15
|
export {};
|
|
@@ -7,7 +7,7 @@ import { useInputValidity } from '../form-hooks/useInputValidity.js';
|
|
|
7
7
|
import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
|
|
10
|
-
const IDSTime = forwardRef(({ label = "", errorMsg = "", disabled = false, invalid = false, required = false, noValidation = false, light = false, focusAnchor = false, id, tooltip, className, ...props }, ref) => {
|
|
10
|
+
const IDSTime = forwardRef(({ label = "", errorMsg = "", disabled = false, invalid = false, required = false, noValidation = false, light = false, focusAnchor = false, dataTestId = "", id, tooltip, className, ...props }, ref) => {
|
|
11
11
|
const fieldId = useElementId(id);
|
|
12
12
|
const errorMsgId = useElementId();
|
|
13
13
|
const inputRef = useRef(null);
|
|
@@ -15,12 +15,12 @@ const IDSTime = forwardRef(({ label = "", errorMsg = "", disabled = false, inval
|
|
|
15
15
|
const hasValidValue = useInputValidity(inputRef);
|
|
16
16
|
const isInvalid = (invalid || !hasValidValue) && !noValidation;
|
|
17
17
|
useAriaDescribedBy(inputRef, errorMsgId, isInvalid, !!errorMsg);
|
|
18
|
-
return (jsxs("div", { className: clsx("ids-time
|
|
18
|
+
return (jsxs("div", { className: clsx("ids-time", className), "data-testid": dataTestId, children: [jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { className: clsx("ids-label", {
|
|
19
19
|
"ids-label--disabled": disabled
|
|
20
|
-
}), htmlFor: fieldId, children: label }), tooltip] }), jsx("div", { className: "ids-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
}), htmlFor: fieldId, children: label }), tooltip] }), jsx("div", { className: "ids-time__input-wrapper", children: jsx("input", { ref: inputRef, id: fieldId, type: "time", className: clsx("ids-time__input", {
|
|
21
|
+
"ids-input--light": light,
|
|
22
|
+
"ids-focus-anchor": focusAnchor
|
|
23
|
+
}), "aria-invalid": isInvalid, required: required, "aria-required": required, disabled: disabled, "aria-disabled": disabled, ...props }) }), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
|
|
24
24
|
});
|
|
25
25
|
IDSTime.displayName = "IDSTime";
|
|
26
26
|
|
|
@@ -4,6 +4,7 @@ interface IDSToggleProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
4
4
|
tooltip?: ReactNode;
|
|
5
5
|
focusAnchor?: boolean;
|
|
6
6
|
children?: ReactNode;
|
|
7
|
+
dataTestId?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const IDSToggle: import("react").ForwardRefExoticComponent<IDSToggleProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
10
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef, useRef, useImperativeHandle } from 'react';
|
|
4
4
|
import { useElementId } from '../../utils/hooks/useElementId.js';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSToggle = forwardRef(({ disabled = false, focusAnchor = false, tooltip, id, children, className, ...props }, ref) => {
|
|
7
|
+
const IDSToggle = forwardRef(({ disabled = false, focusAnchor = false, tooltip, id, children, dataTestId = "", className, ...props }, ref) => {
|
|
8
8
|
const fieldId = useElementId(id);
|
|
9
9
|
const toggleRef = useRef(null);
|
|
10
10
|
useImperativeHandle(ref, () => toggleRef.current);
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
return (jsxs("div", { className: clsx("ids-toggle", className), "data-testid": dataTestId, children: [jsx("input", { id: fieldId, ref: toggleRef, className: clsx("ids-toggle__input", {
|
|
12
|
+
"ids-focus-anchor": focusAnchor
|
|
13
|
+
}), type: "checkbox", disabled: disabled, ...props }), jsxs("div", { className: "ids-label-tooltip-wrapper ids-label-tooltip-wrapper--inline", children: [jsx("label", { htmlFor: fieldId, className: "ids-toggle__label ids-label ids-label--clickable", children: children }), tooltip] })] }));
|
|
14
14
|
});
|
|
15
15
|
IDSToggle.displayName = "IDSToggle";
|
|
16
16
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/global-alert/global-alert.css";
|
|
3
|
+
interface IDSGlobalAlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
agent?: boolean;
|
|
5
|
+
srExpandText?: string;
|
|
6
|
+
srCollapseText?: string;
|
|
7
|
+
collapsed?: boolean;
|
|
8
|
+
noRole?: boolean;
|
|
9
|
+
onCollapsedChange?: (isCollapsed: boolean) => void;
|
|
10
|
+
icon?: string;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
headline: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const IDSGlobalAlert: React.FC<IDSGlobalAlertProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import '@inera/ids-design/components/global-alert/global-alert.css';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
7
|
+
|
|
8
|
+
const IDSGlobalAlert = ({ agent = false, srExpandText = "Visa meddelande", srCollapseText = "Dölj meddelande", collapsed = false, noRole = false, onCollapsedChange, icon = "", actions, headline = "", children, className, ...props }) => {
|
|
9
|
+
const [isCollapsed, setIsCollapsed] = useState(collapsed);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setIsCollapsed(collapsed);
|
|
12
|
+
}, [collapsed]);
|
|
13
|
+
const handleToggleCollapse = () => {
|
|
14
|
+
setIsCollapsed(!isCollapsed);
|
|
15
|
+
onCollapsedChange?.(!isCollapsed);
|
|
16
|
+
};
|
|
17
|
+
const contentId = useElementId();
|
|
18
|
+
return (jsx("div", { role: noRole ? null : "alert", className: clsx("ids-global-alert", {
|
|
19
|
+
"ids-global-alert--collapsed": isCollapsed,
|
|
20
|
+
"ids-global-alert--agent": agent
|
|
21
|
+
}, className), ...props, children: jsxs("div", { className: "ids-global-alert__inner", children: [jsx("div", { className: "ids-global-alert__header", children: jsx("button", { className: clsx("ids-global-alert__button", {
|
|
22
|
+
"ids-global-alert__button--expanded": !isCollapsed
|
|
23
|
+
}), "aria-controls": contentId, "aria-expanded": !isCollapsed, onClick: handleToggleCollapse, children: jsxs("div", { className: "ids-global-alert__icon-headline", children: [icon && (jsx("div", { className: "ids-global-alert__icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) })), jsx("div", { className: "ids-global-alert__headline", children: headline }), jsx("span", { className: "ids-global-alert__sr-only", children: isCollapsed ? srExpandText : srCollapseText })] }) }) }), jsxs("div", { id: contentId, className: "ids-global-alert__content", children: [children, actions && jsx("div", { className: "ids-global-alert__sub-content", children: actions })] })] }) }));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { IDSGlobalAlert };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/grid/container/container.css";
|
|
3
3
|
export interface IDSContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
fluid?: boolean;
|
|
5
4
|
width?: string;
|
|
6
5
|
gutterless?: boolean;
|
|
7
6
|
children?: ReactNode;
|
|
@@ -4,20 +4,20 @@ import { useRef, useEffect } from 'react';
|
|
|
4
4
|
import '@inera/ids-design/components/grid/container/container.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSContainer = ({
|
|
7
|
+
const IDSContainer = ({ width = "", gutterless = false, children, className, style, ...props }) => {
|
|
8
8
|
const containerRef = useRef(null);
|
|
9
|
-
const classNames = clsx("ids-container",
|
|
9
|
+
const classNames = clsx("ids-container", gutterless && `ids-container--gutterless-${gutterless}`, className);
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
const el = containerRef.current;
|
|
12
12
|
if (el) {
|
|
13
|
-
if (width
|
|
13
|
+
if (width) {
|
|
14
14
|
el.style.maxWidth = `${width}px`;
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
17
|
el.style.maxWidth = "";
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
}, [width
|
|
20
|
+
}, [width]);
|
|
21
21
|
return (jsx("div", { ref: containerRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177/header-1177-avatar.css";
|
|
3
3
|
interface IDSHeader1177AvatarProps {
|
|
4
|
-
username
|
|
4
|
+
username?: string;
|
|
5
|
+
expanded?: boolean;
|
|
5
6
|
agent?: ReactNode;
|
|
6
|
-
|
|
7
|
+
children?: ReactNode;
|
|
7
8
|
persistent?: boolean;
|
|
9
|
+
noMobileMenu?: boolean;
|
|
10
|
+
mobileMenu?: ReactNode;
|
|
8
11
|
}
|
|
9
12
|
export declare const IDSHeader1177Avatar: React.FC<IDSHeader1177AvatarProps>;
|
|
10
13
|
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useId, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/header-1177/header-1177-avatar.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
7
|
|
|
8
|
-
const IDSHeader1177Avatar = ({ username, agent,
|
|
9
|
-
const
|
|
8
|
+
const IDSHeader1177Avatar = ({ username, expanded = false, agent, children, persistent = false, noMobileMenu = false, mobileMenu, ...props }) => {
|
|
9
|
+
const dropdownId = useId();
|
|
10
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
10
11
|
const headerContext = useHeaderContext();
|
|
11
12
|
const containerRef = useRef(null);
|
|
12
13
|
const dropdownRef = useRef(null);
|
|
@@ -22,6 +23,15 @@ const IDSHeader1177Avatar = ({ username, agent, links, persistent = false }) =>
|
|
|
22
23
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
23
24
|
};
|
|
24
25
|
}, [persistent]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!persistent && isExpanded) {
|
|
28
|
+
const links = dropdownRef.current?.querySelectorAll("a") || [];
|
|
29
|
+
links.forEach(link => link.addEventListener("click", handleLinkClick));
|
|
30
|
+
return () => {
|
|
31
|
+
links.forEach(link => link.removeEventListener("click", handleLinkClick));
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}, [isExpanded, persistent]);
|
|
25
35
|
const handleLinkClick = () => {
|
|
26
36
|
setIsExpanded(false);
|
|
27
37
|
};
|
|
@@ -34,13 +44,14 @@ const IDSHeader1177Avatar = ({ username, agent, links, persistent = false }) =>
|
|
|
34
44
|
};
|
|
35
45
|
}
|
|
36
46
|
}, [isExpanded, persistent]);
|
|
37
|
-
return (
|
|
47
|
+
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-avatar", {
|
|
38
48
|
"ids-header-1177-avatar--unresponsive": headerContext?.unresponsive
|
|
39
|
-
}), children: jsxs("div", { className: "ids-header-1177-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
}), style: { flexGrow: username ? "1" : "0" }, ...props, children: [username && (jsx("div", { className: "ids-header-1177-avatar__avatar", children: jsxs("div", { className: "ids-header-1177-avatar__menu-wrapper", children: [jsx("button", { className: clsx("ids-header-1177-avatar__button", {
|
|
50
|
+
"ids-header-1177-avatar__button--expanded": isExpanded
|
|
51
|
+
}), onClick: toggleExpanded, "aria-controls": dropdownId, "aria-expanded": isExpanded, children: jsx("div", { className: "ids-header-1177-avatar__name", title: username, children: username }) }), jsxs("div", { ref: dropdownRef, id: dropdownId, className: clsx("ids-header-1177-avatar__menu", {
|
|
52
|
+
"ids-header-1177-avatar__menu--expanded": isExpanded,
|
|
53
|
+
"ids-header-1177-avatar__menu--mobile-menu": !noMobileMenu
|
|
54
|
+
}), children: [agent && jsx("div", { className: "ids-header-1177-avatar__agent", children: agent }), agent && children && jsx("hr", {}), children && jsx("div", { className: "ids-header-1177-avatar__menu-links", children: children })] })] }) })), mobileMenu] }));
|
|
44
55
|
};
|
|
45
56
|
|
|
46
57
|
export { IDSHeader1177Avatar };
|
|
@@ -2,6 +2,7 @@ import React, { ReactNode, PropsWithChildren, HTMLAttributes } from "react";
|
|
|
2
2
|
import "@inera/ids-design/components/header-1177/header-1177-item.css";
|
|
3
3
|
interface IDSHeader1177ItemProps extends HTMLAttributes<HTMLElement> {
|
|
4
4
|
mobile?: boolean;
|
|
5
|
+
keepTextOnMobile?: boolean;
|
|
5
6
|
icon?: string;
|
|
6
7
|
href?: string;
|
|
7
8
|
text?: string;
|
|
@@ -5,13 +5,14 @@ import clsx from 'clsx';
|
|
|
5
5
|
import '@inera/ids-design/components/header-1177/header-1177-item.css';
|
|
6
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
7
|
|
|
8
|
-
const IDSHeader1177Item = ({ mobile = false, text = "", href = "", icon, link, onClick, ...props }) => {
|
|
8
|
+
const IDSHeader1177Item = ({ mobile = false, keepTextOnMobile = false, text = "", href = "", icon, link, onClick, ...props }) => {
|
|
9
9
|
const headerContext = useHeaderContext();
|
|
10
|
-
const classNames = clsx("ids-header-
|
|
11
|
-
"ids-header-
|
|
12
|
-
"ids-header-
|
|
10
|
+
const classNames = clsx("ids-header-1177-item", {
|
|
11
|
+
"ids-header-1177-item--unresponsive": headerContext?.unresponsive,
|
|
12
|
+
"ids-header-1177-item--mobile": mobile,
|
|
13
|
+
"ids-header-1177-item--keep-text": keepTextOnMobile
|
|
13
14
|
});
|
|
14
|
-
const renderContent = () => (jsxs(Fragment, { children: [icon && (jsx("div", { className: "ids-header-
|
|
15
|
+
const renderContent = () => (jsxs(Fragment, { children: [icon && (jsx("div", { className: "ids-header-1177-item-icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) })), jsx("div", { className: "ids-header-1177-item-text", children: text })] }));
|
|
15
16
|
if (link && isValidElement(link)) {
|
|
16
17
|
return cloneElement(link, {
|
|
17
18
|
...props,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177/header-1177-menu-mobile.css";
|
|
3
3
|
interface IDSHeader1177MenuMobileProps {
|
|
4
|
-
|
|
4
|
+
srLabel?: string;
|
|
5
5
|
persistent?: boolean;
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
onExpanded?: () => void;
|
|
@@ -5,38 +5,49 @@ import '@inera/ids-design/components/header-1177/header-1177-menu-mobile.css';
|
|
|
5
5
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
|
|
8
|
-
const IDSHeader1177MenuMobile = ({
|
|
9
|
-
const [
|
|
8
|
+
const IDSHeader1177MenuMobile = ({ srLabel = "Meny", persistent = false, children, onExpanded, onClosed, ...props }) => {
|
|
9
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
10
10
|
const headerContext = useHeaderContext();
|
|
11
|
+
const containerRef = useRef(null);
|
|
11
12
|
const menuRef = useRef(null);
|
|
12
13
|
const handleLinkClick = () => {
|
|
13
|
-
|
|
14
|
+
setIsExpanded(false);
|
|
14
15
|
onClosed?.();
|
|
15
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]);
|
|
16
29
|
useEffect(() => {
|
|
17
|
-
if (!persistent &&
|
|
30
|
+
if (!persistent && isExpanded) {
|
|
18
31
|
const links = menuRef.current?.querySelectorAll("a") || [];
|
|
19
32
|
links.forEach(link => link.addEventListener("click", handleLinkClick));
|
|
20
33
|
return () => {
|
|
21
34
|
links.forEach(link => link.removeEventListener("click", handleLinkClick));
|
|
22
35
|
};
|
|
23
36
|
}
|
|
24
|
-
}, [
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return next;
|
|
35
|
-
});
|
|
37
|
+
}, [isExpanded, persistent]);
|
|
38
|
+
const toggleExpanded = () => {
|
|
39
|
+
const newExpanded = !isExpanded;
|
|
40
|
+
setIsExpanded(newExpanded);
|
|
41
|
+
if (newExpanded) {
|
|
42
|
+
onExpanded?.();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
onClosed?.();
|
|
46
|
+
}
|
|
36
47
|
};
|
|
37
|
-
return (jsxs("div", { className: "ids-header-1177-menu-mobile-component", children: [
|
|
48
|
+
return (jsxs("div", { className: "ids-header-1177-menu-mobile-component", ref: containerRef, ...props, children: [jsx("button", { onClick: toggleExpanded, "aria-expanded": isExpanded, "aria-label": srLabel, className: clsx("ids-header-1177-menu-mobile", {
|
|
38
49
|
"ids-header-1177-menu-mobile--unresponsive": headerContext?.unresponsive
|
|
39
|
-
}), children:
|
|
50
|
+
}), children: jsx("div", { className: "ids-hamburger", children: jsx("span", { className: "ids-hamburger__lines" }) }) }), isExpanded && (jsx("div", { className: "ids-header-1177-menu-mobile__items", ref: menuRef, children: children }))] }));
|
|
40
51
|
};
|
|
41
52
|
|
|
42
53
|
export { IDSHeader1177MenuMobile };
|
|
@@ -7,8 +7,8 @@ import clsx from 'clsx';
|
|
|
7
7
|
|
|
8
8
|
const IDSHeader1177NavItemMobile = ({ text = "", href = "", icon = "", link, children, ...props }) => {
|
|
9
9
|
const headerContext = useHeaderContext();
|
|
10
|
-
const classNames = clsx("ids-header-
|
|
11
|
-
"ids-header-
|
|
10
|
+
const classNames = clsx("ids-header-1177-nav-item-mobile", {
|
|
11
|
+
"ids-header-1177-nav-item-mobile--unresponsive": headerContext?.unresponsive
|
|
12
12
|
});
|
|
13
13
|
const renderContent = () => {
|
|
14
14
|
return (jsxs(Fragment, { children: [icon && (jsx("span", { className: "ids-header-1177-nav-item-mobile__icon", children: jsx("span", { className: `ids-icon-${icon}` }) })), text] }));
|
|
@@ -16,12 +16,12 @@ const IDSHeader1177NavItemMobile = ({ text = "", href = "", icon = "", link, chi
|
|
|
16
16
|
if (link && isValidElement(link)) {
|
|
17
17
|
return cloneElement(link, {
|
|
18
18
|
...props,
|
|
19
|
-
style: {
|
|
19
|
+
style: { textDecoration: "none" },
|
|
20
20
|
className: clsx(link.props.className, classNames),
|
|
21
21
|
children: renderContent()
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
return (jsx("a", { className: classNames, href: href, style: {
|
|
24
|
+
return (jsx("a", { className: classNames, href: href, style: { textDecoration: "none" }, ...props, children: renderContent() }));
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export { IDSHeader1177NavItemMobile };
|
|
@@ -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/header-1177-nav-item.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
7
7
|
|
|
8
|
-
const IDSHeader1177NavItem = ({ active = false, expanded = false, label = "", col1, col2, col3, col4, children }) => {
|
|
8
|
+
const IDSHeader1177NavItem = ({ active = false, expanded = false, label = "", col1, col2, col3, col4, children, ...props }) => {
|
|
9
9
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
10
10
|
const headerContext = useHeaderContext();
|
|
11
11
|
const containerRef = useRef(null);
|
|
@@ -22,8 +22,8 @@ const IDSHeader1177NavItem = ({ active = false, expanded = false, label = "", co
|
|
|
22
22
|
};
|
|
23
23
|
}, [expanded]);
|
|
24
24
|
const renderLink = (link) => {
|
|
25
|
-
return
|
|
26
|
-
?
|
|
25
|
+
return React.isValidElement(link)
|
|
26
|
+
? React.cloneElement(link, {
|
|
27
27
|
activeIcon: true,
|
|
28
28
|
block: true,
|
|
29
29
|
colorPreset: 2,
|
|
@@ -31,12 +31,11 @@ const IDSHeader1177NavItem = ({ active = false, expanded = false, label = "", co
|
|
|
31
31
|
})
|
|
32
32
|
: link;
|
|
33
33
|
};
|
|
34
|
-
const renderDropdown = () => isExpanded && (jsx("div", { id: "ids-header-1177-nav-dropdown", className: "ids-header-
|
|
34
|
+
const renderDropdown = () => isExpanded && (jsx("div", { id: "ids-header-1177-nav-dropdown", className: "ids-header-1177-nav-item__menu ids-header-1177-nav-item__menu--expanded", children: jsxs("div", { className: "ids-header-1177-nav-item__menu__content", children: [jsx("div", { className: "ids-header-1177-nav-item__menu__content-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu__content-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu__content-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: renderLink(link) }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu__content-col-4", children: col4 })] }) }));
|
|
35
35
|
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177__nav-item", {
|
|
36
36
|
"ids-header-1177__nav-item--unresponsive": headerContext?.unresponsive,
|
|
37
|
-
"ids-header-1177__nav-item--fluid": headerContext?.fluid,
|
|
38
37
|
"ids-header-1177__nav-item--active": active || isExpanded
|
|
39
|
-
}), children: [label ? (jsx("button", { onClick: () => setIsExpanded(prev => !prev), "aria-expanded": isExpanded, "aria-controls": "ids-header-1177-nav-dropdown", children: label })) : (children), renderDropdown()] }));
|
|
38
|
+
}), ...props, children: [label ? (jsx("button", { onClick: () => setIsExpanded(prev => !prev), "aria-expanded": isExpanded, "aria-controls": "ids-header-1177-nav-dropdown", children: label })) : (children), renderDropdown()] }));
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
export { IDSHeader1177NavItem };
|
|
@@ -2,6 +2,8 @@ import React, { ReactNode } from "react";
|
|
|
2
2
|
import "@inera/ids-design/components/header-1177/header-1177-nav.css";
|
|
3
3
|
interface IDSHeader1177NavProps {
|
|
4
4
|
hideOnTablet?: boolean;
|
|
5
|
+
mobileLeft?: ReactNode;
|
|
6
|
+
mobileRight?: ReactNode;
|
|
5
7
|
children?: ReactNode;
|
|
6
8
|
}
|
|
7
9
|
export declare const IDSHeader1177Nav: React.FC<IDSHeader1177NavProps>;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import '@inera/ids-design/components/header-1177/header-1177-nav.css';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
6
|
|
|
7
|
-
const IDSHeader1177Nav = ({ hideOnTablet = false, children }) => {
|
|
7
|
+
const IDSHeader1177Nav = ({ hideOnTablet = false, mobileLeft, mobileRight, children, ...props }) => {
|
|
8
8
|
const headerContext = useHeaderContext();
|
|
9
9
|
const navClass = clsx("ids-header-1177__nav", {
|
|
10
10
|
"ids-header-1177__nav--unresponsive": headerContext?.unresponsive,
|
|
11
|
-
"ids-header-1177__nav--fluid": headerContext?.fluid,
|
|
12
11
|
"ids-header-1177__nav--hide-on-tablet": hideOnTablet
|
|
13
12
|
});
|
|
14
|
-
return (
|
|
13
|
+
return (jsxs("nav", { className: navClass, ...props, children: [jsx("div", { className: "ids-header-1177__nav-inner", children: jsx("div", { className: "ids-header-1177__nav-content", children: children }) }), jsxs("div", { className: "ids-header-1177__nav-inner-mobile", children: [jsx("div", { className: "ids-header-1177__nav-inner-mobile-left", children: mobileLeft }), jsx("div", { className: "ids-header-1177__nav-inner-mobile-right", children: mobileRight })] })] }));
|
|
15
14
|
};
|
|
16
15
|
|
|
17
16
|
export { IDSHeader1177Nav };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177-region-picker-mobile.css";
|
|
3
|
+
export interface IDSHeader1177RegionPickerMobileProps {
|
|
4
|
+
text?: string;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
onToggleRegion?: (isExpanded: boolean) => void;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDSHeader1177RegionPickerMobile: React.FC<IDSHeader1177RegionPickerMobileProps>;
|
|
@@ -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/header-1177-region-picker-mobile.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
|
+
|
|
7
|
+
const IDSHeader1177RegionPickerMobile = ({ 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-region-picker-mobile", {
|
|
30
|
+
"ids-header-1177-region-picker-mobile--selected-region": hasChildren
|
|
31
|
+
}), ...props, children: jsxs("button", { onClick: toggleRegion, className: clsx("ids-header-1177-region-picker-mobile__button", {
|
|
32
|
+
"ids-header-1177-region-picker-mobile__button--expanded": isExpanded
|
|
33
|
+
}), "aria-label": text, children: [jsx("div", { className: "ids-header-1177-region-picker-mobile__region-icon", children: renderChild(children) }), jsxs("span", { className: "ids-header-1177-region-picker-mobile__button-text", children: [" ", text] })] }) }));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { IDSHeader1177RegionPickerMobile };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/header-1177/header-1177-region-picker.css";
|
|
3
|
+
export interface IDSHeader1177RegionPickerProps {
|
|
4
|
+
text?: string;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
onToggleRegion?: (isExpanded: boolean) => void;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDSHeader1177RegionPicker: React.FC<IDSHeader1177RegionPickerProps>;
|
|
@@ -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/header-1177-region-picker.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
const IDSHeader1177RegionPicker = ({ 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: 3,
|
|
22
|
+
className: clsx(existingClass)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
return (jsxs("div", { className: clsx("ids-header-1177-region-picker", {
|
|
28
|
+
"ids-header-1177-region-picker--selected-region": hasChildren
|
|
29
|
+
}), ...props, children: [jsx("div", { className: "ids-header-1177-region-picker__region-icon", children: renderChild(children) }), jsx("div", { className: "ids-header-1177-region-picker__selector", children: jsx("button", { onClick: toggleRegion, className: clsx("ids-header-1177-region-picker__button", {
|
|
30
|
+
"ids-header-1177-region-picker__button--expanded": isExpanded
|
|
31
|
+
}), "aria-label": text, children: text }) })] }));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { IDSHeader1177RegionPicker };
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import React, { ReactNode, AnchorHTMLAttributes } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177/header-1177.css";
|
|
3
3
|
interface IDSHeader1177Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
regionPickerText?: string;
|
|
5
4
|
hideRegionPicker?: boolean;
|
|
6
|
-
regionPickerExpanded?: boolean;
|
|
7
|
-
fluid?: boolean;
|
|
8
5
|
unresponsive?: boolean;
|
|
9
6
|
logoHref?: string;
|
|
10
7
|
logoProps?: AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
11
8
|
logo?: ReactNode;
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
srLogoText?: string;
|
|
10
|
+
regionPicker?: ReactNode;
|
|
14
11
|
skipToContentLink?: ReactNode;
|
|
15
12
|
onToggleRegion?: (isExpanded: boolean) => void;
|
|
16
13
|
items?: ReactNode;
|
|
17
14
|
avatar?: ReactNode;
|
|
18
|
-
mobileMenu?: ReactNode;
|
|
19
15
|
children?: ReactNode;
|
|
20
16
|
}
|
|
21
17
|
export declare const IDSHeader1177: React.FC<IDSHeader1177Props>;
|