@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,24 +1,13 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
2
|
+
import { forwardRef } from 'react';
|
|
4
3
|
import '@inera/ids-design/components/grid/container/container.css';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
|
|
7
|
-
const IDSContainer = ({
|
|
8
|
-
const
|
|
9
|
-
const classNames = clsx("ids-container",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (width && !fluid) {
|
|
14
|
-
el.style.maxWidth = `${width}px`;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
el.style.maxWidth = "";
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}, [width, fluid]);
|
|
21
|
-
return (jsx("div", { ref: containerRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
22
|
-
};
|
|
6
|
+
const IDSContainer = forwardRef(({ gutterless = false, width, maxWidth, children, className, style, ...props }, ref) => {
|
|
7
|
+
const mergedStyle = { ...style, width: width ?? style?.width, maxWidth: maxWidth ?? style?.maxWidth };
|
|
8
|
+
const classNames = clsx("ids-container", gutterless && `ids-container--gutterless-${gutterless}`, className);
|
|
9
|
+
return (jsx("div", { ref: ref, className: classNames, style: mergedStyle, ...props, children: children }));
|
|
10
|
+
});
|
|
11
|
+
IDSContainer.displayName = "IDSContainer";
|
|
23
12
|
|
|
24
13
|
export { IDSContainer };
|
package/components/grid/row.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, HTMLAttributes } from "react";
|
|
2
2
|
import "@inera/ids-design/components/grid/row/row.css";
|
|
3
|
-
export interface IDSRowProps extends
|
|
3
|
+
export interface IDSRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
gap?: string;
|
|
4
5
|
align?: "start" | "center" | "end" | "baseline" | "stretch";
|
|
5
6
|
justify?: "start" | "center" | "end" | "space-between" | "space-around";
|
|
6
|
-
gap?: string;
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare const IDSRow:
|
|
9
|
+
export declare const IDSRow: import("react").ForwardRefExoticComponent<IDSRowProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/components/grid/row.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
2
|
+
import { forwardRef } from 'react';
|
|
4
3
|
import '@inera/ids-design/components/grid/row/row.css';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
|
|
7
|
-
const IDSRow = ({ align, justify,
|
|
8
|
-
const rowRef = useRef(null);
|
|
6
|
+
const IDSRow = forwardRef(({ gap, align, justify, children, className, style, ...props }, ref) => {
|
|
9
7
|
const classNames = clsx("ids-row", align && `ids-row--align-${align}`, justify && `ids-row--justify-${justify}`, className);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, [gap]);
|
|
15
|
-
return (jsx("div", { ref: rowRef, className: classNames, style: { ...style }, ...props, children: children }));
|
|
16
|
-
};
|
|
8
|
+
const mergedStyle = { ...style, gap: gap ?? style?.gap };
|
|
9
|
+
return (jsx("div", { ref: ref, className: classNames, style: mergedStyle, ...props, children: children }));
|
|
10
|
+
});
|
|
11
|
+
IDSRow.displayName = "IDSRow";
|
|
17
12
|
|
|
18
13
|
export { IDSRow };
|
|
@@ -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 };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, HTMLAttributes, PropsWithChildren } 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;
|
|
8
9
|
link?: ReactNode;
|
|
9
10
|
onClick?: () => void;
|
|
10
11
|
}
|
|
11
|
-
export declare
|
|
12
|
+
export declare function IDSHeader1177Item({ mobile, keepTextOnMobile, text, href, icon, link, onClick, ...props }: PropsWithChildren<IDSHeader1177ItemProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { isValidElement, cloneElement } from 'react';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React, { isValidElement, cloneElement } from 'react';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
|
-
import '@inera/ids-design/components/header-1177/header-1177-item.css';
|
|
6
4
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
5
|
+
import '@inera/ids-design/components/header-1177/header-1177-item.css';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
const headerContext = useHeaderContext();
|
|
10
|
-
const classNames = clsx("ids-header-
|
|
11
|
-
"ids-header-
|
|
12
|
-
"ids-header-
|
|
7
|
+
function IDSHeader1177Item({ mobile = false, keepTextOnMobile = false, text = "", href = "", icon, link, onClick, ...props }) {
|
|
8
|
+
const headerContext = useHeaderContext() || { unresponsive: false };
|
|
9
|
+
const classNames = clsx("ids-header-1177-item", {
|
|
10
|
+
"ids-header-1177-item--unresponsive": headerContext.unresponsive,
|
|
11
|
+
"ids-header-1177-item--mobile": mobile,
|
|
12
|
+
"ids-header-1177-item--keep-text": keepTextOnMobile
|
|
13
13
|
});
|
|
14
|
-
const renderContent = () => (
|
|
14
|
+
const renderContent = () => (jsx("div", { className: "ids-header-1177-item-icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) }));
|
|
15
15
|
if (link && isValidElement(link)) {
|
|
16
|
-
|
|
16
|
+
const linkProps = link.props;
|
|
17
|
+
const hasChildren = !!linkProps.children &&
|
|
18
|
+
(typeof linkProps.children === "string"
|
|
19
|
+
? linkProps.children.trim().length > 0
|
|
20
|
+
: React.Children.count(linkProps.children) > 0);
|
|
21
|
+
const newLink = cloneElement(link, {
|
|
17
22
|
...props,
|
|
18
|
-
className: clsx(
|
|
19
|
-
children:
|
|
23
|
+
className: clsx(linkProps.className),
|
|
24
|
+
children: hasChildren ? linkProps.children : text
|
|
20
25
|
});
|
|
26
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), " ", newLink] }));
|
|
21
27
|
}
|
|
22
28
|
if (onClick) {
|
|
23
|
-
return (
|
|
29
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("button", { onClick: onClick, ...props, children: text })] }));
|
|
24
30
|
}
|
|
25
|
-
return (
|
|
26
|
-
}
|
|
31
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
|
|
32
|
+
}
|
|
27
33
|
|
|
28
34
|
export { IDSHeader1177Item };
|
|
@@ -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 };
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { isValidElement
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { isValidElement } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/header-1177/header-1177-nav-item-mobile.css';
|
|
5
5
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
6
|
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
|
-
return (
|
|
14
|
+
return (jsx("span", { className: "ids-header-1177-nav-item-mobile__icon", children: jsx("span", { className: `ids-icon-${icon}` }) }));
|
|
15
15
|
};
|
|
16
16
|
if (link && isValidElement(link)) {
|
|
17
|
-
return
|
|
18
|
-
...props,
|
|
19
|
-
style: { flexGrow: 1, textDecoration: "none" },
|
|
20
|
-
className: clsx(link.props.className, classNames),
|
|
21
|
-
children: renderContent()
|
|
22
|
-
});
|
|
17
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), link] }));
|
|
23
18
|
}
|
|
24
|
-
return (
|
|
19
|
+
return (jsxs("div", { className: classNames, children: [renderContent(), jsx("a", { href: href, ...props, children: text })] }));
|
|
25
20
|
};
|
|
26
21
|
|
|
27
22
|
export { IDSHeader1177NavItemMobile };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { ReactNode, ReactElement } from "react";
|
|
2
2
|
import "@inera/ids-design/components/header-1177/header-1177-nav-item.css";
|
|
3
3
|
import { IDSLinkProps } from "../link/link";
|
|
4
|
-
interface IDSHeader1177NavItemProps {
|
|
4
|
+
export interface IDSHeader1177NavItemProps {
|
|
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?: ReactNode;
|
|
12
|
-
children?: ReactNode;
|
|
13
14
|
}
|
|
14
15
|
export declare const IDSHeader1177NavItem: React.FC<IDSHeader1177NavItemProps>;
|
|
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/header-1177-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 IDSHeader1177NavItem = ({ active = false, expanded = false,
|
|
9
|
-
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
9
|
+
const IDSHeader1177NavItem = ({ label = "", active = false, expanded = false, notification, children, col1, col2, col3, col4, ...props }) => {
|
|
10
10
|
const headerContext = useHeaderContext();
|
|
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,22 +24,24 @@ const IDSHeader1177NavItem = ({ active = false, expanded = false, label = "", co
|
|
|
21
24
|
document.removeEventListener("click", handleClickOutside);
|
|
22
25
|
};
|
|
23
26
|
}, [expanded]);
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const renderNavItem = () => {
|
|
28
|
+
if (label) {
|
|
29
|
+
return (jsxs("button", { "aria-controls": contentId, "aria-expanded": isExpanded, className: "ids-header-1177-nav-item__button", onClick: () => setIsExpanded(prev => !prev), children: [label, " ", notification] }));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return (jsxs("span", { className: "ids-header-1177-nav-item__link", children: [children, " ", notification] }));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const renderContent = () => {
|
|
36
|
+
if (!isExpanded)
|
|
37
|
+
return null;
|
|
38
|
+
return (jsx("div", { id: contentId, 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-col-1", children: col1?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu-col-2", children: col2?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu-col-3", children: col3?.map((link, idx) => (jsx("div", { className: "ids-header-1177-nav__menu-item-wrapper", children: link }, idx))) }), jsx("div", { className: "ids-header-1177-nav-item__menu-col-4", children: col4 })] }) }));
|
|
33
39
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"ids-header-
|
|
37
|
-
"ids-header-
|
|
38
|
-
|
|
39
|
-
}), children: [label ? (jsx("button", { onClick: () => setIsExpanded(prev => !prev), "aria-expanded": isExpanded, "aria-controls": "ids-header-1177-nav-dropdown", children: label })) : (children), renderDropdown()] }));
|
|
40
|
+
return (jsxs("div", { ref: containerRef, className: clsx("ids-header-1177-nav-item", {
|
|
41
|
+
"ids-header-1177-nav-item--unresponsive": headerContext?.unresponsive,
|
|
42
|
+
"ids-header-1177-nav-item--expanded": isExpanded,
|
|
43
|
+
"ids-header-1177-nav-item--active": active
|
|
44
|
+
}), ...props, children: [renderNavItem(), renderContent()] }));
|
|
40
45
|
};
|
|
41
46
|
|
|
42
47
|
export { IDSHeader1177NavItem };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { 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
|
-
export declare
|
|
9
|
+
export declare function IDSHeader1177Nav({ hideOnTablet, mobileLeft, mobileRight, children, ...props }: IDSHeader1177NavProps): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export {};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import '@inera/ids-design/components/header-1177/header-1177-nav.css';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
4
|
import { useHeaderContext } from '../utils/contexts/HeaderContext.js';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
const headerContext = useHeaderContext();
|
|
6
|
+
function IDSHeader1177Nav({ hideOnTablet = false, mobileLeft, mobileRight, children, ...props }) {
|
|
7
|
+
const headerContext = useHeaderContext() || { unresponsive: false };
|
|
9
8
|
const navClass = clsx("ids-header-1177__nav", {
|
|
10
|
-
"ids-header-1177__nav--unresponsive": headerContext
|
|
11
|
-
"ids-header-1177__nav--fluid": headerContext?.fluid,
|
|
9
|
+
"ids-header-1177__nav--unresponsive": headerContext.unresponsive,
|
|
12
10
|
"ids-header-1177__nav--hide-on-tablet": hideOnTablet
|
|
13
11
|
});
|
|
14
|
-
return (
|
|
15
|
-
}
|
|
12
|
+
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 })] })] }));
|
|
13
|
+
}
|
|
16
14
|
|
|
17
15
|
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,22 +1,18 @@
|
|
|
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
|
-
export declare
|
|
17
|
+
export declare function IDSHeader1177({ srLogoText, hideRegionPicker, unresponsive, logoHref, logoProps, logo, regionPicker, skipToContentLink, items, avatar, className, children, ...props }: IDSHeader1177Props): import("react/jsx-runtime").JSX.Element;
|
|
22
18
|
export {};
|