@inera/ids-react 7.2.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion.js +4 -4
- package/components/alert/alert.d.ts +3 -3
- package/components/alert/alert.js +8 -5
- package/components/badge/badge.d.ts +0 -1
- package/components/badge/badge.js +2 -2
- package/components/box-link/box-link.js +2 -2
- package/components/breadcrumbs/breadcrumbs.js +3 -3
- package/components/button/button.d.ts +6 -7
- package/components/button/button.js +5 -79
- package/components/card/card.d.ts +4 -4
- package/components/card/card.js +5 -4
- package/components/carousel/carousel-item.js +5 -5
- package/components/carousel/carousel.d.ts +0 -2
- package/components/carousel/carousel.js +22 -42
- package/components/date-label/date-label.d.ts +6 -0
- package/components/date-label/date-label.js +18 -3
- package/components/dialog/dialog.d.ts +12 -12
- package/components/dialog/dialog.js +5 -7
- package/components/dropdown/dropdown-content-button.d.ts +7 -0
- package/components/dropdown/dropdown-content-button.js +11 -0
- package/components/dropdown/dropdown-content-link.js +2 -1
- package/components/dropdown/dropdown.d.ts +5 -4
- package/components/dropdown/dropdown.js +11 -10
- package/components/footer-1177/footer-1177.d.ts +0 -3
- package/components/footer-1177/footer-1177.js +17 -23
- package/components/footer-1177-admin/footer-1177-admin.d.ts +5 -7
- package/components/footer-1177-admin/footer-1177-admin.js +21 -26
- package/components/footer-1177-pro/footer-1177-pro.d.ts +15 -10
- package/components/footer-1177-pro/footer-1177-pro.js +41 -22
- package/components/footer-inera/footer-inera.d.ts +2 -6
- package/components/footer-inera/footer-inera.js +21 -27
- package/components/footer-inera-admin/footer-inera-admin.d.ts +2 -6
- package/components/footer-inera-admin/footer-inera-admin.js +23 -26
- package/components/form/check-button/check-button.d.ts +1 -0
- package/components/form/check-button/check-button.js +2 -2
- package/components/form/checkbox/checkbox-group.d.ts +1 -1
- package/components/form/checkbox/checkbox-group.js +6 -6
- package/components/form/checkbox/checkbox.d.ts +1 -0
- package/components/form/checkbox/checkbox.js +2 -2
- package/components/form/input/input.d.ts +2 -4
- package/components/form/input/input.js +16 -37
- package/components/form/radio/radio-group.d.ts +2 -2
- package/components/form/radio/radio-group.js +6 -6
- package/components/form/radio/radio.d.ts +3 -3
- package/components/form/radio/radio.js +2 -2
- package/components/form/radio-button/radio-button-group.d.ts +2 -2
- package/components/form/radio-button/radio-button-group.js +7 -7
- package/components/form/radio-button/radio-button.d.ts +4 -3
- package/components/form/radio-button/radio-button.js +2 -2
- package/components/form/range/range.d.ts +1 -0
- package/components/form/range/range.js +2 -2
- package/components/form/select/select.d.ts +1 -1
- package/components/form/select/select.js +5 -3
- package/components/form/select-multiple/select-multiple.d.ts +3 -0
- package/components/form/select-multiple/select-multiple.js +13 -6
- package/components/form/textarea/textarea.d.ts +1 -0
- package/components/form/textarea/textarea.js +2 -2
- package/components/form/time/time.d.ts +1 -0
- package/components/form/time/time.js +6 -6
- package/components/form/toggle/toggle.d.ts +1 -0
- package/components/form/toggle/toggle.js +5 -5
- package/components/global-alert/global-alert.d.ts +16 -0
- package/components/global-alert/global-alert.js +26 -0
- package/components/grid/container.d.ts +0 -1
- package/components/grid/container.js +4 -4
- package/components/header-1177/header-1177-avatar.d.ts +5 -2
- package/components/header-1177/header-1177-avatar.js +21 -10
- package/components/header-1177/header-1177-item.d.ts +1 -0
- package/components/header-1177/header-1177-item.js +6 -5
- package/components/header-1177/header-1177-menu-mobile.d.ts +1 -1
- package/components/header-1177/header-1177-menu-mobile.js +29 -18
- package/components/header-1177/header-1177-nav-item-mobile.js +4 -4
- package/components/header-1177/header-1177-nav-item.js +6 -7
- package/components/header-1177/header-1177-nav.d.ts +2 -0
- package/components/header-1177/header-1177-nav.js +3 -4
- package/components/header-1177/header-1177-region-picker-mobile.d.ts +9 -0
- package/components/header-1177/header-1177-region-picker-mobile.js +36 -0
- package/components/header-1177/header-1177-region-picker.d.ts +9 -0
- package/components/header-1177/header-1177-region-picker.js +34 -0
- package/components/header-1177/header-1177.d.ts +2 -6
- package/components/header-1177/header-1177.js +6 -22
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.js +28 -3
- package/components/header-1177-admin/header-1177-admin-avatar.d.ts +3 -2
- package/components/header-1177-admin/header-1177-admin-avatar.js +31 -18
- package/components/header-1177-admin/header-1177-admin-item.js +4 -4
- package/components/header-1177-admin/header-1177-admin-menu-mobile.d.ts +11 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile.js +53 -0
- package/components/header-1177-admin/header-1177-admin-nav-item.js +10 -11
- package/components/header-1177-admin/header-1177-admin-nav.js +4 -5
- package/components/header-1177-admin/header-1177-admin.d.ts +1 -4
- package/components/header-1177-admin/header-1177-admin.js +5 -18
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.js +28 -3
- package/components/header-1177-pro/header-1177-pro-avatar.d.ts +3 -2
- package/components/header-1177-pro/header-1177-pro-avatar.js +31 -18
- package/components/header-1177-pro/header-1177-pro-item.js +5 -5
- package/components/header-1177-pro/{header-1177-pro-nav-menu-mobile.d.ts → header-1177-pro-menu-mobile.d.ts} +3 -3
- package/components/header-1177-pro/header-1177-pro-menu-mobile.js +53 -0
- package/components/header-1177-pro/header-1177-pro-nav-item.js +11 -11
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +2 -2
- package/components/header-1177-pro/header-1177-pro-nav.js +5 -20
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.d.ts +9 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.js +36 -0
- package/components/header-1177-pro/header-1177-pro-region-picker.d.ts +9 -0
- package/components/header-1177-pro/header-1177-pro-region-picker.js +34 -0
- package/components/header-1177-pro/header-1177-pro.d.ts +4 -7
- package/components/header-1177-pro/header-1177-pro.js +4 -28
- package/components/header-inera/header-inera-item.js +1 -2
- package/components/header-inera/header-inera-menu-mobile.d.ts +11 -0
- package/components/header-inera/header-inera-menu-mobile.js +54 -0
- package/components/header-inera/header-inera-nav-item.js +6 -9
- package/components/header-inera/header-inera-nav.js +2 -3
- package/components/header-inera/header-inera.d.ts +1 -2
- package/components/header-inera/header-inera.js +4 -7
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +5 -2
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +23 -3
- package/components/header-inera-admin/header-inera-admin-avatar.d.ts +3 -4
- package/components/header-inera-admin/header-inera-admin-avatar.js +34 -22
- package/components/header-inera-admin/header-inera-admin-item.js +1 -1
- package/components/header-inera-admin/header-inera-admin-menu-mobile.d.ts +11 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile.js +53 -0
- package/components/header-inera-admin/header-inera-admin-nav-item.js +6 -9
- package/components/header-inera-admin/header-inera-admin-nav.js +2 -3
- package/components/header-inera-admin/header-inera-admin.d.ts +1 -1
- package/components/header-inera-admin/header-inera-admin.js +4 -5
- package/components/header-patient/header-patient.d.ts +3 -3
- package/components/header-patient/header-patient.js +2 -2
- package/components/link/link.d.ts +3 -3
- package/components/link/link.js +3 -3
- package/components/mobile/menu/item/mobile-item.js +4 -4
- package/components/navigation/content/navigation-content.d.ts +1 -0
- package/components/navigation/content/navigation-content.js +7 -6
- package/components/pagination/data-pagination/data-pagination.d.ts +7 -11
- package/components/pagination/data-pagination/data-pagination.js +7 -7
- package/components/pagination/list-pagination/list-pagination.js +6 -11
- package/components/popover/popover.js +9 -9
- package/components/progressbar/progressbar.js +2 -2
- package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +1 -0
- package/components/puff-list/puff-list-item/puff-list-item-info.js +5 -2
- package/components/puff-list/puff-list-item/puff-list-item.d.ts +8 -0
- package/components/puff-list/puff-list-item/puff-list-item.js +47 -13
- package/components/puff-list/puff-list.js +2 -2
- package/components/region-icon/region-icon.js +1 -2
- package/components/side-menu/side-menu.d.ts +1 -1
- package/components/side-menu/side-menu.js +6 -6
- package/components/side-panel/side-panel.d.ts +2 -0
- package/components/side-panel/side-panel.js +5 -5
- package/components/stepper/step.js +2 -2
- package/components/stepper/stepper.js +4 -4
- package/components/tabs/tab-panel.js +2 -2
- package/components/tabs/tab.js +2 -2
- package/components/tabs/tabs.js +13 -13
- package/components/tooltip/tooltip.js +2 -2
- package/components/utils/contexts/HeaderContext.d.ts +0 -2
- package/index.d.ts +16 -144
- package/index.js +16 -144
- package/package.json +2 -3
- package/components/agent/agent.d.ts +0 -12
- package/components/agent/agent.js +0 -18
- package/components/alert-global/alert-global.d.ts +0 -16
- package/components/alert-global/alert-global.js +0 -28
- package/components/header-1177-pro/header-1177-pro-nav-menu-mobile.js +0 -35
- package/components/header-inera/header-inera-nav-mobile.d.ts +0 -11
- package/components/header-inera/header-inera-nav-mobile.js +0 -47
- package/components/header-inera-admin/header-inera-admin-nav-mobile.d.ts +0 -12
- package/components/header-inera-admin/header-inera-admin-nav-mobile.js +0 -35
- package/components/icons/icon-1177.d.ts +0 -3
- package/components/icons/icon-1177.js +0 -12
- package/components/icons/icon-activity.d.ts +0 -3
- package/components/icons/icon-activity.js +0 -12
- package/components/icons/icon-agent.d.ts +0 -3
- package/components/icons/icon-agent.js +0 -12
- package/components/icons/icon-alarm-clock-inactivity.d.ts +0 -3
- package/components/icons/icon-alarm-clock-inactivity.js +0 -12
- package/components/icons/icon-alarm-clock-neutral.d.ts +0 -3
- package/components/icons/icon-alarm-clock-neutral.js +0 -12
- package/components/icons/icon-archive.d.ts +0 -3
- package/components/icons/icon-archive.js +0 -12
- package/components/icons/icon-arrow.d.ts +0 -3
- package/components/icons/icon-arrow.js +0 -12
- package/components/icons/icon-attention.d.ts +0 -3
- package/components/icons/icon-attention.js +0 -12
- package/components/icons/icon-blekinge.d.ts +0 -3
- package/components/icons/icon-blekinge.js +0 -12
- package/components/icons/icon-bookmark.d.ts +0 -3
- package/components/icons/icon-bookmark.js +0 -12
- package/components/icons/icon-calendar.d.ts +0 -3
- package/components/icons/icon-calendar.js +0 -12
- package/components/icons/icon-call-active.d.ts +0 -3
- package/components/icons/icon-call-active.js +0 -12
- package/components/icons/icon-call.d.ts +0 -3
- package/components/icons/icon-call.js +0 -12
- package/components/icons/icon-camera-off.d.ts +0 -3
- package/components/icons/icon-camera-off.js +0 -12
- package/components/icons/icon-camera-on.d.ts +0 -3
- package/components/icons/icon-camera-on.js +0 -12
- package/components/icons/icon-camera-switch.d.ts +0 -3
- package/components/icons/icon-camera-switch.js +0 -12
- package/components/icons/icon-chart-bar.d.ts +0 -3
- package/components/icons/icon-chart-bar.js +0 -12
- package/components/icons/icon-chart-line.d.ts +0 -3
- package/components/icons/icon-chart-line.js +0 -12
- package/components/icons/icon-chat.d.ts +0 -3
- package/components/icons/icon-chat.js +0 -12
- package/components/icons/icon-check.d.ts +0 -3
- package/components/icons/icon-check.js +0 -12
- package/components/icons/icon-chevron-bold.d.ts +0 -3
- package/components/icons/icon-chevron-bold.js +0 -12
- package/components/icons/icon-chevron.d.ts +0 -3
- package/components/icons/icon-chevron.js +0 -12
- package/components/icons/icon-clipboard-cross.d.ts +0 -3
- package/components/icons/icon-clipboard-cross.js +0 -12
- package/components/icons/icon-clipboard-text.d.ts +0 -3
- package/components/icons/icon-clipboard-text.js +0 -12
- package/components/icons/icon-clipboard.d.ts +0 -3
- package/components/icons/icon-clipboard.js +0 -12
- package/components/icons/icon-clock.d.ts +0 -3
- package/components/icons/icon-clock.js +0 -12
- package/components/icons/icon-close-bold.d.ts +0 -3
- package/components/icons/icon-close-bold.js +0 -12
- package/components/icons/icon-close.d.ts +0 -3
- package/components/icons/icon-close.js +0 -12
- package/components/icons/icon-cog.d.ts +0 -3
- package/components/icons/icon-cog.js +0 -12
- package/components/icons/icon-computer-inera.d.ts +0 -3
- package/components/icons/icon-computer-inera.js +0 -12
- package/components/icons/icon-computer.d.ts +0 -3
- package/components/icons/icon-computer.js +0 -12
- package/components/icons/icon-copy-file.d.ts +0 -3
- package/components/icons/icon-copy-file.js +0 -12
- package/components/icons/icon-copy-link.d.ts +0 -3
- package/components/icons/icon-copy-link.js +0 -12
- package/components/icons/icon-dalarna.d.ts +0 -3
- package/components/icons/icon-dalarna.js +0 -12
- package/components/icons/icon-denied.d.ts +0 -3
- package/components/icons/icon-denied.js +0 -12
- package/components/icons/icon-doctors-bag.d.ts +0 -3
- package/components/icons/icon-doctors-bag.js +0 -12
- package/components/icons/icon-document.d.ts +0 -3
- package/components/icons/icon-document.js +0 -12
- package/components/icons/icon-download.d.ts +0 -3
- package/components/icons/icon-download.js +0 -12
- package/components/icons/icon-drag-n-drop.d.ts +0 -3
- package/components/icons/icon-drag-n-drop.js +0 -12
- package/components/icons/icon-ear-hearing.d.ts +0 -3
- package/components/icons/icon-ear-hearing.js +0 -12
- package/components/icons/icon-edit.d.ts +0 -3
- package/components/icons/icon-edit.js +0 -12
- package/components/icons/icon-email-sent.d.ts +0 -3
- package/components/icons/icon-email-sent.js +0 -12
- package/components/icons/icon-email-unread.d.ts +0 -3
- package/components/icons/icon-email-unread.js +0 -12
- package/components/icons/icon-email.d.ts +0 -3
- package/components/icons/icon-email.js +0 -12
- package/components/icons/icon-expand.d.ts +0 -3
- package/components/icons/icon-expand.js +0 -12
- package/components/icons/icon-external.d.ts +0 -3
- package/components/icons/icon-external.js +0 -12
- package/components/icons/icon-facebook.d.ts +0 -3
- package/components/icons/icon-facebook.js +0 -12
- package/components/icons/icon-file-csv.d.ts +0 -3
- package/components/icons/icon-file-csv.js +0 -12
- package/components/icons/icon-file-excel.d.ts +0 -3
- package/components/icons/icon-file-excel.js +0 -12
- package/components/icons/icon-file-other.d.ts +0 -3
- package/components/icons/icon-file-other.js +0 -12
- package/components/icons/icon-file-pdf.d.ts +0 -3
- package/components/icons/icon-file-pdf.js +0 -12
- package/components/icons/icon-file-picture.d.ts +0 -3
- package/components/icons/icon-file-picture.js +0 -12
- package/components/icons/icon-file-powerpoint.d.ts +0 -3
- package/components/icons/icon-file-powerpoint.js +0 -12
- package/components/icons/icon-file-word.d.ts +0 -3
- package/components/icons/icon-file-word.js +0 -12
- package/components/icons/icon-find-care.d.ts +0 -3
- package/components/icons/icon-find-care.js +0 -12
- package/components/icons/icon-find-region.d.ts +0 -3
- package/components/icons/icon-find-region.js +0 -12
- package/components/icons/icon-flag.d.ts +0 -3
- package/components/icons/icon-flag.js +0 -12
- package/components/icons/icon-form-numbered-reocurring.d.ts +0 -3
- package/components/icons/icon-form-numbered-reocurring.js +0 -12
- package/components/icons/icon-form-numbered.d.ts +0 -3
- package/components/icons/icon-form-numbered.js +0 -12
- package/components/icons/icon-gavleborg.d.ts +0 -3
- package/components/icons/icon-gavleborg.js +0 -12
- package/components/icons/icon-gotland.d.ts +0 -3
- package/components/icons/icon-gotland.js +0 -12
- package/components/icons/icon-halland.d.ts +0 -3
- package/components/icons/icon-halland.js +0 -12
- package/components/icons/icon-headphones.d.ts +0 -3
- package/components/icons/icon-headphones.js +0 -12
- package/components/icons/icon-hourglass-end.d.ts +0 -3
- package/components/icons/icon-hourglass-end.js +0 -12
- package/components/icons/icon-hourglass-start.d.ts +0 -3
- package/components/icons/icon-hourglass-start.js +0 -12
- package/components/icons/icon-hourglass.d.ts +0 -3
- package/components/icons/icon-hourglass.js +0 -12
- package/components/icons/icon-house.d.ts +0 -3
- package/components/icons/icon-house.js +0 -12
- package/components/icons/icon-id-card-locked.d.ts +0 -3
- package/components/icons/icon-id-card-locked.js +0 -12
- package/components/icons/icon-id-card.d.ts +0 -3
- package/components/icons/icon-id-card.js +0 -12
- package/components/icons/icon-image.d.ts +0 -3
- package/components/icons/icon-image.js +0 -12
- package/components/icons/icon-inera-legacy.d.ts +0 -3
- package/components/icons/icon-inera-legacy.js +0 -12
- package/components/icons/icon-inera.d.ts +0 -3
- package/components/icons/icon-inera.js +0 -12
- package/components/icons/icon-information.d.ts +0 -3
- package/components/icons/icon-information.js +0 -12
- package/components/icons/icon-jamtland-harjedalen.d.ts +0 -3
- package/components/icons/icon-jamtland-harjedalen.js +0 -12
- package/components/icons/icon-jonkoping.d.ts +0 -3
- package/components/icons/icon-jonkoping.js +0 -12
- package/components/icons/icon-kalmar.d.ts +0 -3
- package/components/icons/icon-kalmar.js +0 -12
- package/components/icons/icon-kronoberg.d.ts +0 -3
- package/components/icons/icon-kronoberg.js +0 -12
- package/components/icons/icon-lightbulb.d.ts +0 -3
- package/components/icons/icon-lightbulb.js +0 -12
- package/components/icons/icon-linkedin.d.ts +0 -3
- package/components/icons/icon-linkedin.js +0 -12
- package/components/icons/icon-list.d.ts +0 -3
- package/components/icons/icon-list.js +0 -12
- package/components/icons/icon-lock-open.d.ts +0 -3
- package/components/icons/icon-lock-open.js +0 -12
- package/components/icons/icon-lock.d.ts +0 -3
- package/components/icons/icon-lock.js +0 -12
- package/components/icons/icon-log-locked.d.ts +0 -3
- package/components/icons/icon-log-locked.js +0 -12
- package/components/icons/icon-log.d.ts +0 -3
- package/components/icons/icon-log.js +0 -12
- package/components/icons/icon-menu.d.ts +0 -3
- package/components/icons/icon-menu.js +0 -12
- package/components/icons/icon-minus.d.ts +0 -3
- package/components/icons/icon-minus.js +0 -12
- package/components/icons/icon-moment-start.d.ts +0 -3
- package/components/icons/icon-moment-start.js +0 -12
- package/components/icons/icon-moment-stop.d.ts +0 -3
- package/components/icons/icon-moment-stop.js +0 -12
- package/components/icons/icon-norrbotten.d.ts +0 -3
- package/components/icons/icon-norrbotten.js +0 -12
- package/components/icons/icon-office-building.d.ts +0 -3
- package/components/icons/icon-office-building.js +0 -12
- package/components/icons/icon-orebro.d.ts +0 -3
- package/components/icons/icon-orebro.js +0 -12
- package/components/icons/icon-organization.d.ts +0 -3
- package/components/icons/icon-organization.js +0 -12
- package/components/icons/icon-ostergotland.d.ts +0 -3
- package/components/icons/icon-ostergotland.js +0 -12
- package/components/icons/icon-plus.d.ts +0 -3
- package/components/icons/icon-plus.js +0 -12
- package/components/icons/icon-prescription.d.ts +0 -3
- package/components/icons/icon-prescription.js +0 -12
- package/components/icons/icon-print.d.ts +0 -3
- package/components/icons/icon-print.js +0 -12
- package/components/icons/icon-question.d.ts +0 -3
- package/components/icons/icon-question.js +0 -12
- package/components/icons/icon-reload.d.ts +0 -3
- package/components/icons/icon-reload.js +0 -12
- package/components/icons/icon-reply.d.ts +0 -3
- package/components/icons/icon-reply.js +0 -12
- package/components/icons/icon-search-inera.d.ts +0 -3
- package/components/icons/icon-search-inera.js +0 -12
- package/components/icons/icon-search.d.ts +0 -3
- package/components/icons/icon-search.js +0 -12
- package/components/icons/icon-share.d.ts +0 -3
- package/components/icons/icon-share.js +0 -12
- package/components/icons/icon-shield-locked-primary.d.ts +0 -3
- package/components/icons/icon-shield-locked-primary.js +0 -12
- package/components/icons/icon-shield-locked.d.ts +0 -3
- package/components/icons/icon-shield-locked.js +0 -12
- package/components/icons/icon-skane.d.ts +0 -3
- package/components/icons/icon-skane.js +0 -12
- package/components/icons/icon-sormland.d.ts +0 -3
- package/components/icons/icon-sormland.js +0 -12
- package/components/icons/icon-star-filled.d.ts +0 -3
- package/components/icons/icon-star-filled.js +0 -12
- package/components/icons/icon-star.d.ts +0 -3
- package/components/icons/icon-star.js +0 -12
- package/components/icons/icon-stockholm.d.ts +0 -3
- package/components/icons/icon-stockholm.js +0 -12
- package/components/icons/icon-success.d.ts +0 -3
- package/components/icons/icon-success.js +0 -12
- package/components/icons/icon-swap.d.ts +0 -3
- package/components/icons/icon-swap.js +0 -12
- package/components/icons/icon-switch-person.d.ts +0 -3
- package/components/icons/icon-switch-person.js +0 -12
- package/components/icons/icon-telephone.d.ts +0 -3
- package/components/icons/icon-telephone.js +0 -12
- package/components/icons/icon-test-tube-analyze.d.ts +0 -3
- package/components/icons/icon-test-tube-analyze.js +0 -12
- package/components/icons/icon-test-tube-empty.d.ts +0 -3
- package/components/icons/icon-test-tube-empty.js +0 -12
- package/components/icons/icon-test-tube.d.ts +0 -3
- package/components/icons/icon-test-tube.js +0 -12
- package/components/icons/icon-toggle-card.d.ts +0 -3
- package/components/icons/icon-toggle-card.js +0 -12
- package/components/icons/icon-toggle-list.d.ts +0 -3
- package/components/icons/icon-toggle-list.js +0 -12
- package/components/icons/icon-trash.d.ts +0 -3
- package/components/icons/icon-trash.js +0 -12
- package/components/icons/icon-twitter.d.ts +0 -3
- package/components/icons/icon-twitter.js +0 -12
- package/components/icons/icon-uppsala.d.ts +0 -3
- package/components/icons/icon-uppsala.js +0 -12
- package/components/icons/icon-user.d.ts +0 -3
- package/components/icons/icon-user.js +0 -12
- package/components/icons/icon-varmland.d.ts +0 -3
- package/components/icons/icon-varmland.js +0 -12
- package/components/icons/icon-vasterbotten.d.ts +0 -3
- package/components/icons/icon-vasterbotten.js +0 -12
- package/components/icons/icon-vasternorrland.d.ts +0 -3
- package/components/icons/icon-vasternorrland.js +0 -12
- package/components/icons/icon-vastmanland.d.ts +0 -3
- package/components/icons/icon-vastmanland.js +0 -12
- package/components/icons/icon-vastra-gotaland.d.ts +0 -3
- package/components/icons/icon-vastra-gotaland.js +0 -12
- package/components/icons/icon-video-off.d.ts +0 -3
- package/components/icons/icon-video-off.js +0 -12
- package/components/icons/icon-video-on.d.ts +0 -3
- package/components/icons/icon-video-on.js +0 -12
- package/components/icons/icon-video-switch.d.ts +0 -3
- package/components/icons/icon-video-switch.js +0 -12
- package/components/icons/icon-visibility-off.d.ts +0 -3
- package/components/icons/icon-visibility-off.js +0 -12
- package/components/icons/icon-visibility.d.ts +0 -3
- package/components/icons/icon-visibility.js +0 -12
- package/components/icons/icon-warning.d.ts +0 -3
- package/components/icons/icon-warning.js +0 -12
- package/components/icons/icon-x.d.ts +0 -3
|
@@ -11,8 +11,16 @@ interface IDSPuffListItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
11
11
|
monthLabel?: string;
|
|
12
12
|
day?: number;
|
|
13
13
|
time?: string;
|
|
14
|
+
dateTo?: Date | null;
|
|
15
|
+
yearTo?: string;
|
|
16
|
+
monthTo?: number;
|
|
17
|
+
monthToLabel?: string;
|
|
18
|
+
dayTo?: number;
|
|
19
|
+
timeTo?: string;
|
|
14
20
|
noContent?: boolean;
|
|
21
|
+
lean?: boolean;
|
|
15
22
|
noMargin?: boolean;
|
|
23
|
+
noListItem?: boolean;
|
|
16
24
|
dateLabel?: ReactNode;
|
|
17
25
|
children?: ReactNode;
|
|
18
26
|
}
|
|
@@ -1,22 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { useState, useEffect, isValidElement, cloneElement } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/puff-list/puff-list.css';
|
|
5
|
-
import {
|
|
5
|
+
import { getDayAsText, getMonthAsSweText } from '../../utils/utils.js';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
|
|
8
|
-
const IDSPuffListItem = ({ headline = "", headlineLevel = 2, headlineLink, itemLink, date = null, year = "", month = -1, monthLabel = "", day = -1, time = "", noContent = false, noMargin = false, dateLabel, className, children }) => {
|
|
9
|
-
const [presentedDate, setPresentedDate] = useState(date);
|
|
8
|
+
const IDSPuffListItem = ({ headline = "", headlineLevel = 2, headlineLink, itemLink, date = null, year = "", month = -1, monthLabel = "", day = -1, time = "", dateTo = null, yearTo = "", monthTo = -1, monthToLabel = "", dayTo = -1, timeTo = "", noContent = false, noMargin = false, noListItem = false, lean = false, dateLabel, className, children, ...props }) => {
|
|
9
|
+
const [presentedDate, setPresentedDate] = useState(date ? new Date(date) : null);
|
|
10
|
+
const [presentedToDate, setPresentedToDate] = useState(dateTo ? new Date(dateTo) : null);
|
|
10
11
|
useEffect(() => {
|
|
11
12
|
if (date) {
|
|
12
13
|
setPresentedDate(new Date(date));
|
|
13
14
|
}
|
|
14
15
|
}, [date]);
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (dateTo) {
|
|
18
|
+
setPresentedToDate(new Date(dateTo));
|
|
19
|
+
}
|
|
20
|
+
}, [dateTo]);
|
|
21
|
+
const hasDate = () => date !== null ||
|
|
22
|
+
(year !== "" && year !== undefined) ||
|
|
23
|
+
(month !== null && month !== undefined && month > 0) ||
|
|
24
|
+
(day !== null && day !== undefined && day > 0);
|
|
25
|
+
const hasToDate = () => dateTo !== null ||
|
|
26
|
+
(yearTo !== "" && yearTo !== undefined) ||
|
|
27
|
+
(monthTo !== null && monthTo !== undefined && monthTo > 0) ||
|
|
28
|
+
(dayTo !== null && dayTo !== undefined && dayTo > 0);
|
|
29
|
+
const getYear = () => (presentedDate ? presentedDate.getFullYear() : year);
|
|
30
|
+
const getYearTo = () => (presentedToDate ? presentedToDate.getFullYear() : yearTo);
|
|
17
31
|
const getMonth = () => (presentedDate ? presentedDate.getMonth() + 1 : month);
|
|
32
|
+
const getMonthTo = () => (presentedToDate ? presentedToDate.getMonth() + 1 : monthTo);
|
|
33
|
+
const getDay = () => {
|
|
34
|
+
const dayNumber = presentedDate ? presentedDate.getDate() : day;
|
|
35
|
+
return getDayAsText(dayNumber);
|
|
36
|
+
};
|
|
37
|
+
const getDayTo = () => {
|
|
38
|
+
const dayNumber = presentedToDate ? presentedToDate.getDate() : dayTo;
|
|
39
|
+
return getDayAsText(dayNumber);
|
|
40
|
+
};
|
|
18
41
|
const getMonthText = () => (monthLabel ? monthLabel : getMonthAsSweText(getMonth() - 1, 3));
|
|
19
|
-
const
|
|
42
|
+
const getMonthToText = () => (monthToLabel ? monthToLabel : getMonthAsSweText(getMonthTo() - 1, 3));
|
|
20
43
|
const getTime = () => {
|
|
21
44
|
if (time)
|
|
22
45
|
return time;
|
|
@@ -27,20 +50,30 @@ const IDSPuffListItem = ({ headline = "", headlineLevel = 2, headlineLink, itemL
|
|
|
27
50
|
}
|
|
28
51
|
return "";
|
|
29
52
|
};
|
|
53
|
+
const getTimeTo = () => {
|
|
54
|
+
if (timeTo)
|
|
55
|
+
return timeTo;
|
|
56
|
+
if (presentedToDate) {
|
|
57
|
+
const hour = presentedToDate.getHours();
|
|
58
|
+
const min = presentedToDate.getMinutes();
|
|
59
|
+
return `${hour.toString().padStart(2, "0")}:${min.toString().padStart(2, "0")}`;
|
|
60
|
+
}
|
|
61
|
+
return "";
|
|
62
|
+
};
|
|
30
63
|
const getHeaderClass = (noMargin) => clsx("ids-puff-list-item__header", {
|
|
31
|
-
"ids-puff-list-
|
|
64
|
+
"ids-puff-list-item__header--no-margin": noMargin
|
|
32
65
|
});
|
|
33
66
|
const renderHeadline = () => {
|
|
34
67
|
const level = [2, 3, 4, 5].includes(headlineLevel) ? headlineLevel : 2;
|
|
35
68
|
const Tag = `h${level}`;
|
|
36
69
|
const headlineContent = jsx(Fragment, { children: headline });
|
|
37
70
|
if (headlineLink && isValidElement(headlineLink)) {
|
|
38
|
-
return
|
|
71
|
+
return React.createElement(Tag, { className: getHeaderClass(noMargin) }, cloneElement(headlineLink, {
|
|
39
72
|
...headlineLink.props,
|
|
40
73
|
children: headlineContent
|
|
41
74
|
}));
|
|
42
75
|
}
|
|
43
|
-
return
|
|
76
|
+
return React.createElement(Tag, { className: getHeaderClass(noMargin) }, headline);
|
|
44
77
|
};
|
|
45
78
|
const renderBody = () => {
|
|
46
79
|
const content = (jsxs(Fragment, { children: [renderHeadline(), !noContent && jsx("div", { className: "ids-puff-list-item__body", children: children })] }));
|
|
@@ -53,9 +86,10 @@ const IDSPuffListItem = ({ headline = "", headlineLevel = 2, headlineLink, itemL
|
|
|
53
86
|
}
|
|
54
87
|
return content;
|
|
55
88
|
};
|
|
56
|
-
return (jsx("
|
|
57
|
-
"ids-puff-list-item--interactive": !!itemLink
|
|
58
|
-
|
|
89
|
+
return (jsx("div", { className: clsx("ids-puff-list-item", {
|
|
90
|
+
"ids-puff-list-item--interactive": !!itemLink,
|
|
91
|
+
"ids-puff-list-item--lean": !!lean
|
|
92
|
+
}, className), ...props, children: jsxs("div", { className: "ids-puff-list-item__inner", children: [dateLabel && jsx("div", { className: "ids-puff-list-item__date-label", children: dateLabel }), jsxs("div", { className: "ids-puff-list-item__content", children: [hasDate() && (jsxs("span", { className: "ids-puff-list-item__date", children: [`${getDay()} ${getMonthText()} ${getYear()}`, !!getTime() && jsx("span", { className: "ids-puff-list-item__time", children: getTime() })] })), hasDate() && hasToDate() && (jsxs("span", { className: "ids-puff-list-item__date", children: [jsx("span", { className: "ids-puff-list-item__date-spacer", children: "\u2015" }), `${getDayTo()} ${getMonthToText()} ${getYearTo()}`, !!getTimeTo() && jsx("span", { className: "ids-puff-list-item__time", children: getTimeTo() })] })), renderBody()] })] }) }));
|
|
59
93
|
};
|
|
60
94
|
|
|
61
95
|
export { IDSPuffListItem };
|
|
@@ -2,8 +2,8 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import '@inera/ids-design/components/puff-list/puff-list.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
|
|
5
|
-
const IDSPuffList = ({ children, className }) => {
|
|
6
|
-
return jsx("
|
|
5
|
+
const IDSPuffList = ({ children, className, ...props }) => {
|
|
6
|
+
return (jsx("div", { className: clsx("ids-puff-list", className), ...props, children: children }));
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { IDSPuffList };
|
|
@@ -18,8 +18,7 @@ const IDSRegionIcon = ({ name, size = "m", colorPreset = 1, light = false, inlin
|
|
|
18
18
|
return "2.5rem";
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
return jsx("span", { className: classNames, style: { fontSize: getSize() }, ...props });
|
|
21
|
+
return (jsx("span", { className: clsx("ids-region-icon", `ids-region-icon--${name}`, `ids-region-icon--color-preset-${light ? 3 : colorPreset}`, { "ids-region-icon--inline": inline }, className), style: { fontSize: getSize() }, ...props }));
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
export { IDSRegionIcon };
|
|
@@ -10,7 +10,7 @@ interface IDSSideMenuProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
labelNotification?: ReactNode;
|
|
11
11
|
link?: ReactNode;
|
|
12
12
|
children?: ReactNode;
|
|
13
|
-
onExpandedChange?: (
|
|
13
|
+
onExpandedChange?: (isExpanded: boolean) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const IDSSideMenu: React.FC<IDSSideMenuProps>;
|
|
16
16
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/side-menu/side-menu.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSSideMenu = ({ label = "", srToggleText = "Sektion", expanded = false, active = false, level = 1, icon = "", labelNotification, link, children, className, onExpandedChange }) => {
|
|
7
|
+
const IDSSideMenu = ({ label = "", srToggleText = "Sektion", expanded = false, active = false, level = 1, icon = "", labelNotification, link, children, className, onExpandedChange, ...props }) => {
|
|
8
8
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
9
|
-
const hasChildren =
|
|
9
|
+
const hasChildren = React.Children.toArray(children).some(child => React.isValidElement(child) && child.type === IDSSideMenu);
|
|
10
10
|
const toggleExpanded = (e) => {
|
|
11
11
|
e.stopPropagation();
|
|
12
12
|
if (hasChildren) {
|
|
@@ -30,7 +30,7 @@ const IDSSideMenu = ({ label = "", srToggleText = "Sektion", expanded = false, a
|
|
|
30
30
|
"ids-side-menu__chevron-button--expanded": isExpanded
|
|
31
31
|
}), onClick: toggleExpanded, onKeyDown: handleKeyDown, "aria-expanded": isExpanded, "aria-label": srToggleText }));
|
|
32
32
|
}
|
|
33
|
-
return icon ? (jsx("div", { className: "ids-side-menu__leaf-icon", children: jsx("span", { className: `ids-icon-${icon}` }) })) : (jsx("div", { className: "ids-side-menu__leaf-icon--empty" }));
|
|
33
|
+
return icon ? (jsx("div", { className: "ids-side-menu__leaf-icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) })) : (jsx("div", { className: "ids-side-menu__leaf-icon--empty" }));
|
|
34
34
|
};
|
|
35
35
|
const renderLabel = () => {
|
|
36
36
|
if (hasChildren) {
|
|
@@ -38,7 +38,7 @@ const IDSSideMenu = ({ label = "", srToggleText = "Sektion", expanded = false, a
|
|
|
38
38
|
"ids-side-menu__label-chevron--expanded": isExpanded
|
|
39
39
|
}) }), jsxs("div", { className: "ids-side-menu__label", children: [label, labelNotification] })] }));
|
|
40
40
|
}
|
|
41
|
-
return (jsxs(Fragment, { children: [icon ? (jsx("div", { className: "ids-side-menu__leaf-icon", children: jsx("span", { className: `ids-icon-${icon}` }) })) : (jsx("div", { className: "ids-side-menu__leaf-icon--empty" })), jsxs("div", { className: "ids-side-menu__label", children: [jsx("span", { className: "ids-side-menu__label-text", children: label }), labelNotification] })] }));
|
|
41
|
+
return (jsxs(Fragment, { children: [icon ? (jsx("div", { className: "ids-side-menu__leaf-icon", "aria-hidden": "true", children: jsx("span", { className: `ids-icon-${icon}` }) })) : (jsx("div", { className: "ids-side-menu__leaf-icon--empty" })), jsxs("div", { className: "ids-side-menu__label", children: [jsx("span", { className: "ids-side-menu__label-text", children: label }), labelNotification] })] }));
|
|
42
42
|
};
|
|
43
43
|
const renderMenuPost = () => {
|
|
44
44
|
if (label) {
|
|
@@ -46,7 +46,7 @@ const IDSSideMenu = ({ label = "", srToggleText = "Sektion", expanded = false, a
|
|
|
46
46
|
}
|
|
47
47
|
return (jsxs(Fragment, { children: [renderExpandButton(), jsx("div", { className: "ids-side-menu__link", onClick: e => e.stopPropagation(), onKeyDown: e => e.code !== "Escape" && e.stopPropagation(), children: link })] }));
|
|
48
48
|
};
|
|
49
|
-
return (jsxs("div", { className: clsx("ids-side-menu", className), children: [jsx("div", { className: clsx("ids-side-menu__header", `ids-side-menu--level-${level}`, {
|
|
49
|
+
return (jsxs("div", { className: clsx("ids-side-menu", className), ...props, children: [jsx("div", { className: clsx("ids-side-menu__header", `ids-side-menu--level-${level}`, {
|
|
50
50
|
"ids-side-menu--active": active,
|
|
51
51
|
"ids-side-menu--node-label": hasChildren && label
|
|
52
52
|
}), children: jsx("div", { className: "ids-side-menu__header-inner", children: renderMenuPost() }) }), isExpanded && jsx("div", { className: "ids-side-menu__children", children: children })] }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/side-panel/side-panel.css";
|
|
3
|
+
type PanelSize = "s" | "m" | "l";
|
|
3
4
|
interface IDSSidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
5
|
show?: boolean;
|
|
5
6
|
left?: boolean;
|
|
@@ -9,6 +10,7 @@ interface IDSSidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
9
10
|
srLabel?: string;
|
|
10
11
|
srClose?: string;
|
|
11
12
|
srOpen?: string;
|
|
13
|
+
size?: PanelSize;
|
|
12
14
|
onVisibilityChange?: (visible: boolean) => void;
|
|
13
15
|
onOpen?: () => void;
|
|
14
16
|
onClose?: () => void;
|
|
@@ -4,11 +4,11 @@ import { useState, useRef, useEffect } from 'react';
|
|
|
4
4
|
import '@inera/ids-design/components/side-panel/side-panel.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSSidePanel = ({ show = false, left = false, elevated = false, menu = false, footer = false, srLabel = "Sidopanel", srClose = "Stäng", srOpen = "Öppna", onVisibilityChange, onOpen, onClose, footerLinks, footerText, headline, className, children, ...props }) => {
|
|
7
|
+
const IDSSidePanel = ({ show = false, left = false, elevated = false, menu = false, footer = false, size = "m", srLabel = "Sidopanel", srClose = "Stäng", srOpen = "Öppna", onVisibilityChange, onOpen, onClose, footerLinks, footerText, headline, className, children, ...props }) => {
|
|
8
8
|
const [isVisible, setIsVisible] = useState(show);
|
|
9
9
|
const hamburgerRef = useRef(null);
|
|
10
10
|
const panelRef = useRef(null);
|
|
11
|
-
const classNames = clsx("ids-side-panel", "ids-focus-trap--tablet", menu ? "ids-side-panel--menu" : "ids-side-panel--regular", {
|
|
11
|
+
const classNames = clsx("ids-side-panel", "ids-focus-trap--tablet", size && !menu && `ids-side-panel--${size}`, menu ? "ids-side-panel--menu" : "ids-side-panel--regular", {
|
|
12
12
|
"ids-side-panel--show": isVisible,
|
|
13
13
|
"ids-side-panel--elevated": elevated,
|
|
14
14
|
"ids-side-panel--left": !menu && left
|
|
@@ -48,9 +48,9 @@ const IDSSidePanel = ({ show = false, left = false, elevated = false, menu = fal
|
|
|
48
48
|
onVisibilityChange?.(isVisible);
|
|
49
49
|
if (isVisible) {
|
|
50
50
|
onOpen?.();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const heading = panelRef.current?.querySelector("h1, h2, h3, h4, h5, h6");
|
|
52
|
+
heading?.setAttribute("tabindex", "-1");
|
|
53
|
+
heading?.focus();
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
56
|
onClose?.();
|
|
@@ -4,7 +4,7 @@ import { useState, useEffect } from 'react';
|
|
|
4
4
|
import '@inera/ids-design/components/stepper/stepper.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSStep = ({ state = "", headline, label = "", stepNumber = "", srIndicatorText = "", last = "false", expanded: expandedProp = false, disabled = false, onToggleExpansion, onExpanded, onClosed, className, children }) => {
|
|
7
|
+
const IDSStep = ({ state = "", headline, label = "", stepNumber = "", srIndicatorText = "", last = "false", expanded: expandedProp = false, disabled = false, onToggleExpansion, onExpanded, onClosed, className, children, ...props }) => {
|
|
8
8
|
const [expanded, setExpanded] = useState(expandedProp);
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
setExpanded(expandedProp);
|
|
@@ -29,7 +29,7 @@ const IDSStep = ({ state = "", headline, label = "", stepNumber = "", srIndicato
|
|
|
29
29
|
return null;
|
|
30
30
|
return stepNumber;
|
|
31
31
|
};
|
|
32
|
-
return (jsxs("div", { className: clsx("ids-step", className), ...(last ? { last } : {}), children: [jsx("div", { role: "button", tabIndex: disabled ? -1 : 0, className: clsx("ids-step__button", {
|
|
32
|
+
return (jsxs("div", { className: clsx("ids-step", className), ...(last ? { last } : {}), ...props, children: [jsx("div", { role: "button", tabIndex: disabled ? -1 : 0, className: clsx("ids-step__button", {
|
|
33
33
|
"ids-step__button--disabled": disabled
|
|
34
34
|
}), "aria-expanded": expanded, onClick: toggleExpansion, onKeyDown: handleKeyPress, children: jsxs("div", { className: "ids-step__button-inner", children: [jsx("div", { className: "ids-step__indicator-wrapper", children: jsx("div", { "aria-label": srIndicatorText || stepNumber, role: "img", className: `ids-step__indicator ids-step__indicator--${state}`, children: renderStepIndicator() }) }), jsxs("div", { className: "ids-step__button-text", children: [jsxs("div", { className: "ids-step__headline-label", children: [label && jsx("div", { className: "ids-step__label", children: label }), headline && jsx("div", { className: "ids-step__headline", children: headline })] }), jsx("div", { className: clsx("ids-step__chevron", {
|
|
35
35
|
"ids-step__chevron--expanded": expanded
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { isValidElement, cloneElement } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/stepper/stepper.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSStepper = ({ children, onToggleExpansion, className }) => {
|
|
8
|
-
const stepsArray =
|
|
7
|
+
const IDSStepper = ({ children, onToggleExpansion, className, ...props }) => {
|
|
8
|
+
const stepsArray = React.Children.toArray(children).filter(isValidElement);
|
|
9
9
|
const handleExpansion = (step, expanded) => {
|
|
10
10
|
onToggleExpansion?.(step, expanded);
|
|
11
11
|
};
|
|
@@ -17,7 +17,7 @@ const IDSStepper = ({ children, onToggleExpansion, className }) => {
|
|
|
17
17
|
onToggleExpansion: handleExpansion
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
-
return jsx("div", { className: clsx("ids-stepper", className), children: enhancedSteps });
|
|
20
|
+
return (jsx("div", { className: clsx("ids-stepper", className), ...props, children: enhancedSteps }));
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export { IDSStepper };
|
|
@@ -4,7 +4,7 @@ import { useRef, useEffect } from 'react';
|
|
|
4
4
|
import '@inera/ids-design/components/tabs/tab-panel.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSTabPanel = ({ compact = false, noFocus = false, selected = false, id = "", tabId = "", children, className }) => {
|
|
7
|
+
const IDSTabPanel = ({ compact = false, noFocus = false, selected = false, id = "", tabId = "", children, className, ...props }) => {
|
|
8
8
|
const panelRef = useRef(null);
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
if (panelRef.current && !noFocus) {
|
|
@@ -14,7 +14,7 @@ const IDSTabPanel = ({ compact = false, noFocus = false, selected = false, id =
|
|
|
14
14
|
return (jsx("div", { ref: panelRef, role: "tabpanel", id: id, "aria-hidden": !selected, "aria-labelledby": tabId, hidden: !selected, className: clsx("ids-tab-panel", {
|
|
15
15
|
"ids-tab-panel--selected": selected,
|
|
16
16
|
"ids-tab-panel--compact": compact
|
|
17
|
-
}, className), children: children }));
|
|
17
|
+
}, className), ...props, children: children }));
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export { IDSTabPanel };
|
package/components/tabs/tab.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useRef } from 'react';
|
|
|
4
4
|
import '@inera/ids-design/components/tabs/tab.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSTab = ({ label, index, id = "", panelId = "", selected = false, icon = "", notification, className, onTabClick, onKeyDown }) => {
|
|
7
|
+
const IDSTab = ({ label, index, id = "", panelId = "", selected = false, icon = "", notification, className, onTabClick, onKeyDown, ...props }) => {
|
|
8
8
|
const tabRef = useRef(null);
|
|
9
9
|
const handleClick = () => {
|
|
10
10
|
if (!selected) {
|
|
@@ -13,7 +13,7 @@ const IDSTab = ({ label, index, id = "", panelId = "", selected = false, icon =
|
|
|
13
13
|
};
|
|
14
14
|
return (jsx("div", { id: id, ref: tabRef, role: "tab", tabIndex: 0, onClick: handleClick, onKeyDown: onKeyDown, className: clsx("ids-tab", {
|
|
15
15
|
"ids-tab--selected": selected
|
|
16
|
-
}, className), "aria-selected": selected, "aria-controls": panelId, children: jsxs("div", { className: "ids-tab__label", children: [icon && jsx("span", { className: `ids-icon-${icon} ids-icon--m
|
|
16
|
+
}, className), "aria-selected": selected, "aria-controls": panelId, ...props, children: jsxs("div", { className: "ids-tab__label", children: [icon && jsx("span", { className: `ids-icon-${icon} ids-icon--m`, "aria-hidden": "true" }), label, notification] }) }));
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { IDSTab };
|
package/components/tabs/tabs.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
4
|
import { IDSSelect } from '../form/select/select.js';
|
|
5
5
|
import '@inera/ids-design/components/tabs/tabs.css';
|
|
6
6
|
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
|
|
9
|
-
const IDSTabs = ({ unresponsive = false, light = false, compact = false, breakpoint = "m", selectLabel = "", tabs = [], children, className, onTabChange }) => {
|
|
9
|
+
const IDSTabs = ({ unresponsive = false, light = false, compact = false, breakpoint = "m", selectLabel = "", tabs = [], children, className, onTabChange, ...props }) => {
|
|
10
10
|
const tabsId = useElementId();
|
|
11
|
-
const initialSelectedIndex = tabs.findIndex(tab =>
|
|
11
|
+
const initialSelectedIndex = tabs.findIndex(tab => React.isValidElement(tab) && tab.props.selected === true);
|
|
12
12
|
const [activeTab, setActiveTab] = useState(initialSelectedIndex !== -1 ? initialSelectedIndex : 0);
|
|
13
13
|
const responsiveOnM = breakpoint === "m" && !unresponsive;
|
|
14
14
|
const responsiveOnS = breakpoint === "s" && !unresponsive;
|
|
@@ -36,10 +36,10 @@ const IDSTabs = ({ unresponsive = false, light = false, compact = false, breakpo
|
|
|
36
36
|
const getTabPanelId = (index) => {
|
|
37
37
|
return `${tabsId}-tab-panel-${index}`;
|
|
38
38
|
};
|
|
39
|
-
const enhancedTabs =
|
|
40
|
-
if (!
|
|
39
|
+
const enhancedTabs = React.Children.map(tabs, (tab, idx) => {
|
|
40
|
+
if (!React.isValidElement(tab))
|
|
41
41
|
return tab;
|
|
42
|
-
return
|
|
42
|
+
return React.cloneElement(tab, {
|
|
43
43
|
key: `tab-key-${idx}`,
|
|
44
44
|
id: getTabId(idx),
|
|
45
45
|
panelId: getTabPanelId(idx),
|
|
@@ -50,10 +50,10 @@ const IDSTabs = ({ unresponsive = false, light = false, compact = false, breakpo
|
|
|
50
50
|
onKeyDown: (e) => handleKeydown(e, idx)
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
|
-
const enhancedTabPanels =
|
|
54
|
-
if (!
|
|
53
|
+
const enhancedTabPanels = React.Children.map(children, (panel, idx) => {
|
|
54
|
+
if (!React.isValidElement(panel))
|
|
55
55
|
return panel;
|
|
56
|
-
return
|
|
56
|
+
return React.cloneElement(panel, {
|
|
57
57
|
key: `tab-panel-key-${idx}`,
|
|
58
58
|
id: getTabPanelId(idx),
|
|
59
59
|
tabId: getTabId(idx),
|
|
@@ -68,16 +68,16 @@ const IDSTabs = ({ unresponsive = false, light = false, compact = false, breakpo
|
|
|
68
68
|
handleSelect(index);
|
|
69
69
|
};
|
|
70
70
|
const renderTabOptions = () => tabs?.map((tab, i) => {
|
|
71
|
-
if (!
|
|
71
|
+
if (!React.isValidElement(tab))
|
|
72
72
|
return null;
|
|
73
73
|
const { label, notification } = tab.props;
|
|
74
74
|
let notificationText = "";
|
|
75
75
|
if (typeof notification === "string" || typeof notification === "number") {
|
|
76
76
|
notificationText = String(notification);
|
|
77
77
|
}
|
|
78
|
-
else if (
|
|
78
|
+
else if (React.isValidElement(notification)) {
|
|
79
79
|
const badge = notification;
|
|
80
|
-
const childTexts =
|
|
80
|
+
const childTexts = React.Children.toArray(badge.props.children)
|
|
81
81
|
.map(child => (typeof child === "string" || typeof child === "number" ? child : ""))
|
|
82
82
|
.join("");
|
|
83
83
|
notificationText = childTexts.trim();
|
|
@@ -89,7 +89,7 @@ const IDSTabs = ({ unresponsive = false, light = false, compact = false, breakpo
|
|
|
89
89
|
"ids-tabs--unresponsive": unresponsive,
|
|
90
90
|
"ids-tabs--responsive-on-m": responsiveOnM,
|
|
91
91
|
"ids-tabs--responsive-on-s": responsiveOnS
|
|
92
|
-
}, className), children: [jsx("div", { className: "ids-tabs__select", children: jsx(IDSSelect, { label: selectLabel, onChange: tabChangedFromSelect, value: activeTab, light: light, children: renderTabOptions() }) }), jsx("div", { className: "ids-tabs__tabs", role: "tablist", children: enhancedTabs }), jsx("div", { className: "ids-tabs__panels", children: enhancedTabPanels })] }));
|
|
92
|
+
}, className), ...props, children: [jsx("div", { className: "ids-tabs__select", children: jsx(IDSSelect, { label: selectLabel, onChange: tabChangedFromSelect, value: activeTab, light: light, children: renderTabOptions() }) }), jsx("div", { className: "ids-tabs__tabs", role: "tablist", children: enhancedTabs }), jsx("div", { className: "ids-tabs__panels", children: enhancedTabPanels })] }));
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
export { IDSTabs };
|
|
@@ -5,7 +5,7 @@ import '@inera/ids-design/components/tooltip/tooltip.css';
|
|
|
5
5
|
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
|
|
8
|
-
const IDSTooltip = ({ position = "top", trigger, children, className }) => {
|
|
8
|
+
const IDSTooltip = ({ position = "top", trigger, children, className, ...props }) => {
|
|
9
9
|
const [translateX, setTranslateX] = useState(position === "top" || position === "bottom" ? "-50%" : "0");
|
|
10
10
|
const [translateY, setTranslateY] = useState(position.includes("top") ? "-100%" : "100%");
|
|
11
11
|
const tooltipContentRef = useRef(null);
|
|
@@ -76,7 +76,7 @@ const IDSTooltip = ({ position = "top", trigger, children, className }) => {
|
|
|
76
76
|
triggerWrapper.removeEventListener("focusin", handleOverflow);
|
|
77
77
|
};
|
|
78
78
|
}, [triggerRef]);
|
|
79
|
-
return (jsxs("span", { className: clsx("ids-tooltip", className), children: [jsx("span", { className: "ids-tooltip__trigger", ref: triggerRef, children: trigger }), jsx("span", { className: clsx("ids-tooltip__content", `ids-tooltip__content--${position}`), ref: tooltipContentRef, id: tooltipId, style: { transform: `translate(${translateX}, ${translateY})` }, children: children })] }));
|
|
79
|
+
return (jsxs("span", { className: clsx("ids-tooltip", className), ...props, children: [jsx("span", { className: "ids-tooltip__trigger", ref: triggerRef, children: trigger }), jsx("span", { className: clsx("ids-tooltip__content", `ids-tooltip__content--${position}`), ref: tooltipContentRef, id: tooltipId, style: { transform: `translate(${translateX}, ${translateY})` }, children: children })] }));
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
export { IDSTooltip };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export interface IDSHeaderConfig {
|
|
2
2
|
unresponsive: boolean;
|
|
3
|
-
fluid: boolean;
|
|
4
3
|
hideRegionPicker?: boolean;
|
|
5
|
-
regionPickerText?: string;
|
|
6
4
|
}
|
|
7
5
|
export declare const HeaderContext: import("react").Context<IDSHeaderConfig>;
|
|
8
6
|
export declare const useHeaderContext: () => IDSHeaderConfig;
|