@inera/ids-react 9.1.2 → 9.2.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-base.d.ts +4 -1
- package/components/accordion/accordion-base.js +33 -7
- package/components/accordion/accordion.d.ts +4 -1
- package/components/accordion/accordion.js +14 -11
- package/components/alert/alert-base.d.ts +3 -0
- package/components/alert/alert-base.js +4 -3
- package/components/alert/alert.d.ts +6 -1
- package/components/alert/alert.js +12 -9
- package/components/badge/badge.d.ts +1 -1
- package/components/badge/badge.js +6 -3
- package/components/breadcrumbs/breadcrumbs.d.ts +3 -0
- package/components/breadcrumbs/breadcrumbs.js +25 -4
- package/components/button/button-group.d.ts +3 -0
- package/components/button/button-group.js +1 -0
- package/components/button/button.js +22 -14
- package/components/card/card.d.ts +3 -0
- package/components/card/card.js +2 -1
- package/components/carousel/carousel-item.d.ts +3 -0
- package/components/carousel/carousel-item.js +1 -0
- package/components/date-label/date-label.d.ts +3 -0
- package/components/date-label/date-label.js +1 -0
- package/components/dialog/dialog-base.d.ts +0 -1
- package/components/dialog/dialog-base.js +3 -3
- package/components/dialog/dialog.d.ts +3 -0
- package/components/dialog/dialog.js +19 -19
- package/components/dropdown/dropdown-base.js +6 -3
- package/components/dropdown/dropdown-content-button.js +1 -1
- package/components/dropdown/dropdown-content-link.d.ts +3 -0
- package/components/dropdown/dropdown-content-link.js +1 -1
- package/components/dropdown/dropdown.d.ts +3 -0
- package/components/dropdown/dropdown.js +28 -31
- package/components/footer-1177/footer-1177.d.ts +3 -0
- package/components/footer-1177/footer-1177.js +1 -0
- package/components/footer-1177-admin/footer-1177-admin.d.ts +3 -0
- package/components/footer-1177-admin/footer-1177-admin.js +1 -0
- package/components/footer-1177-pro/footer-1177-pro.d.ts +3 -0
- package/components/footer-1177-pro/footer-1177-pro.js +1 -0
- package/components/footer-inera/footer-inera.d.ts +3 -0
- package/components/footer-inera/footer-inera.js +1 -0
- package/components/footer-inera-admin/footer-inera-admin.d.ts +3 -0
- package/components/footer-inera-admin/footer-inera-admin.js +2 -1
- package/components/footer-inera-general/footer-inera-general.d.ts +21 -0
- package/components/footer-inera-general/footer-inera-general.js +28 -0
- package/components/form/check-button/check-button.js +1 -0
- package/components/form/checkbox/checkbox-base.d.ts +7 -13
- package/components/form/checkbox/checkbox-base.js +10 -10
- package/components/form/checkbox/checkbox-group-base.d.ts +3 -0
- package/components/form/checkbox/checkbox-group-base.js +3 -2
- package/components/form/checkbox/checkbox-group.d.ts +3 -0
- package/components/form/checkbox/checkbox-group.js +1 -0
- package/components/form/checkbox/checkbox.d.ts +5 -15
- package/components/form/checkbox/checkbox.js +10 -2
- package/components/form/datepicker/datepicker.d.ts +7 -11
- package/components/form/datepicker/datepicker.js +17 -16
- package/components/form/error-message/error-message.d.ts +3 -0
- package/components/form/error-message/error-message.js +1 -0
- package/components/form/form-props/form-props.d.ts +18 -0
- package/components/form/input/input-base.d.ts +7 -16
- package/components/form/input/input-base.js +15 -16
- package/components/form/input/input.d.ts +3 -16
- package/components/form/input/input.js +3 -4
- package/components/form/radio/radio-base.d.ts +8 -13
- package/components/form/radio/radio-base.js +8 -10
- package/components/form/radio/radio-group-base.d.ts +3 -0
- package/components/form/radio/radio-group-base.js +1 -0
- package/components/form/radio/radio-group.d.ts +3 -0
- package/components/form/radio/radio-group.js +2 -2
- package/components/form/radio/radio.d.ts +2 -14
- package/components/form/radio/radio.js +11 -5
- package/components/form/radio-button/radio-button-group-base.d.ts +3 -0
- package/components/form/radio-button/radio-button-group-base.js +1 -0
- package/components/form/radio-button/radio-button-group.d.ts +3 -0
- package/components/form/radio-button/radio-button-group.js +4 -1
- package/components/form/radio-button/radio-button.js +1 -0
- package/components/form/range/range-base.d.ts +6 -8
- package/components/form/range/range-base.js +3 -2
- package/components/form/range/range.d.ts +2 -7
- package/components/form/range/range.js +13 -6
- package/components/form/select/select-base.d.ts +7 -15
- package/components/form/select/select-base.js +8 -8
- package/components/form/select/select.d.ts +2 -14
- package/components/form/select/select.js +12 -5
- package/components/form/select-multiple/select-multiple-base.d.ts +7 -14
- package/components/form/select-multiple/select-multiple-base.js +7 -5
- package/components/form/select-multiple/select-multiple.d.ts +4 -15
- package/components/form/select-multiple/select-multiple.js +3 -5
- package/components/form/spinner/spinner.d.ts +3 -0
- package/components/form/spinner/spinner.js +1 -0
- package/components/form/textarea/textarea-base.d.ts +7 -15
- package/components/form/textarea/textarea-base.js +7 -10
- package/components/form/textarea/textarea.d.ts +4 -14
- package/components/form/textarea/textarea.js +13 -6
- package/components/form/time/time-base.d.ts +6 -12
- package/components/form/time/time-base.js +7 -7
- package/components/form/time/time.d.ts +2 -14
- package/components/form/time/time.js +13 -6
- package/components/global-alert/global-alert-base.d.ts +3 -0
- package/components/global-alert/global-alert-base.js +3 -2
- package/components/global-alert/global-alert.d.ts +6 -1
- package/components/global-alert/global-alert.js +12 -9
- package/components/header-1177/header-1177-avatar-base.d.ts +3 -0
- package/components/header-1177/header-1177-avatar-base.js +1 -0
- package/components/header-1177/header-1177-avatar.d.ts +3 -0
- package/components/header-1177/header-1177-avatar.js +7 -15
- package/components/header-1177/header-1177-base.d.ts +3 -0
- package/components/header-1177/header-1177-base.js +1 -0
- package/components/header-1177/header-1177-item-base.d.ts +3 -0
- package/components/header-1177/header-1177-item-base.js +1 -0
- package/components/header-1177/header-1177-item.d.ts +3 -0
- package/components/header-1177/header-1177-item.js +1 -0
- package/components/header-1177/header-1177-menu-mobile-base.d.ts +3 -0
- package/components/header-1177/header-1177-menu-mobile-base.js +1 -0
- package/components/header-1177/header-1177-menu-mobile.d.ts +3 -0
- package/components/header-1177/header-1177-menu-mobile.js +7 -24
- package/components/header-1177/header-1177-nav-base.d.ts +3 -0
- package/components/header-1177/header-1177-nav-base.js +1 -0
- package/components/header-1177/header-1177-nav-item-base.d.ts +3 -0
- package/components/header-1177/header-1177-nav-item-base.js +1 -0
- package/components/header-1177/header-1177-nav-item-mobile-base.d.ts +3 -0
- package/components/header-1177/header-1177-nav-item-mobile-base.js +1 -0
- package/components/header-1177/header-1177-nav-item-mobile.d.ts +3 -0
- package/components/header-1177/header-1177-nav-item-mobile.js +1 -0
- package/components/header-1177/header-1177-nav-item.d.ts +3 -0
- package/components/header-1177/header-1177-nav-item.js +6 -29
- package/components/header-1177/header-1177-nav.d.ts +3 -0
- package/components/header-1177/header-1177-nav.js +2 -1
- package/components/header-1177/header-1177-region-picker-base.d.ts +3 -0
- package/components/header-1177/header-1177-region-picker-base.js +1 -0
- package/components/header-1177/header-1177-region-picker-mobile-base.d.ts +3 -0
- package/components/header-1177/header-1177-region-picker-mobile-base.js +1 -0
- package/components/header-1177/header-1177-region-picker-mobile.d.ts +3 -0
- package/components/header-1177/header-1177-region-picker-mobile.js +1 -0
- package/components/header-1177/header-1177-region-picker.d.ts +3 -0
- package/components/header-1177/header-1177-region-picker.js +1 -0
- package/components/header-1177/header-1177.d.ts +3 -0
- package/components/header-1177/header-1177.js +1 -0
- package/components/header-1177-admin/header-1177-admin-avatar-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar-base.js +2 -1
- package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.js +2 -1
- 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 +7 -7
- package/components/header-1177-admin/header-1177-admin-avatar.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar.js +7 -25
- package/components/header-1177-admin/header-1177-admin-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-item-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-item-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-item.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-item.js +1 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile.js +7 -26
- package/components/header-1177-admin/header-1177-admin-nav-base.d.ts +6 -1
- package/components/header-1177-admin/header-1177-admin-nav-base.js +5 -3
- package/components/header-1177-admin/header-1177-admin-nav-item-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile.js +1 -0
- package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-nav-item.js +6 -29
- package/components/header-1177-admin/header-1177-admin-nav.d.ts +6 -1
- package/components/header-1177-admin/header-1177-admin-nav.js +3 -2
- package/components/header-1177-admin/header-1177-admin.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin.js +1 -0
- package/components/header-1177-pro/header-1177-pro-avatar-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.js +1 -0
- 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 +6 -5
- package/components/header-1177-pro/header-1177-pro-avatar.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar.js +7 -26
- package/components/header-1177-pro/header-1177-pro-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-item-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-item-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-item.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-item.js +1 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile.js +7 -26
- package/components/header-1177-pro/header-1177-pro-nav-base.d.ts +6 -1
- package/components/header-1177-pro/header-1177-pro-nav-base.js +5 -3
- package/components/header-1177-pro/header-1177-pro-nav-item-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile.js +1 -0
- package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-nav-item.js +6 -29
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +6 -1
- package/components/header-1177-pro/header-1177-pro-nav.js +3 -2
- package/components/header-1177-pro/header-1177-pro-region-picker-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-base.js +2 -1
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.d.ts +5 -1
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.js +4 -2
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.js +2 -1
- package/components/header-1177-pro/header-1177-pro-region-picker.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-region-picker.js +1 -0
- package/components/header-1177-pro/header-1177-pro.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro.js +1 -0
- package/components/header-inera/header-inera-base.d.ts +3 -0
- package/components/header-inera/header-inera-base.js +1 -0
- package/components/header-inera/header-inera-item-base.d.ts +3 -0
- package/components/header-inera/header-inera-item-base.js +1 -0
- package/components/header-inera/header-inera-item.d.ts +3 -0
- package/components/header-inera/header-inera-item.js +1 -0
- package/components/header-inera/header-inera-menu-mobile-base.d.ts +3 -0
- package/components/header-inera/header-inera-menu-mobile-base.js +1 -0
- package/components/header-inera/header-inera-menu-mobile.d.ts +3 -0
- package/components/header-inera/header-inera-menu-mobile.js +7 -26
- package/components/header-inera/header-inera-nav-base.d.ts +3 -0
- package/components/header-inera/header-inera-nav-base.js +1 -0
- package/components/header-inera/header-inera-nav-item-base.d.ts +3 -0
- package/components/header-inera/header-inera-nav-item-base.js +1 -0
- package/components/header-inera/header-inera-nav-item.d.ts +3 -0
- package/components/header-inera/header-inera-nav-item.js +6 -29
- package/components/header-inera/header-inera-nav.d.ts +3 -0
- package/components/header-inera/header-inera-nav.js +1 -0
- package/components/header-inera/header-inera.d.ts +3 -0
- package/components/header-inera/header-inera.js +1 -0
- package/components/header-inera-admin/header-inera-admin-avatar-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-avatar-base.js +2 -1
- package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.js +2 -1
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +6 -5
- package/components/header-inera-admin/header-inera-admin-avatar.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-avatar.js +7 -25
- package/components/header-inera-admin/header-inera-admin-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-base.js +1 -0
- package/components/header-inera-admin/header-inera-admin-item-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-item-base.js +1 -0
- package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-item.js +1 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile-base.js +2 -1
- package/components/header-inera-admin/header-inera-admin-menu-mobile.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile.js +7 -26
- package/components/header-inera-admin/header-inera-admin-nav-base.d.ts +6 -1
- package/components/header-inera-admin/header-inera-admin-nav-base.js +5 -3
- package/components/header-inera-admin/header-inera-admin-nav-item-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-base.js +1 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.js +1 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile.js +1 -0
- package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-nav-item.js +6 -29
- package/components/header-inera-admin/header-inera-admin-nav.d.ts +6 -1
- package/components/header-inera-admin/header-inera-admin-nav.js +3 -2
- package/components/header-inera-admin/header-inera-admin.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin.js +1 -0
- package/components/header-inera-general/header-inera-general-base.d.ts +16 -0
- package/components/header-inera-general/header-inera-general-base.js +12 -0
- package/components/header-inera-general/header-inera-general-item-base.d.ts +11 -0
- package/components/header-inera-general/header-inera-general-item-base.js +13 -0
- package/components/header-inera-general/header-inera-general-item.d.ts +10 -0
- package/components/header-inera-general/header-inera-general-item.js +12 -0
- package/components/header-inera-general/header-inera-general-menu-mobile-base.d.ts +15 -0
- package/components/header-inera-general/header-inera-general-menu-mobile-base.js +19 -0
- package/components/header-inera-general/header-inera-general-menu-mobile.d.ts +13 -0
- package/components/header-inera-general/header-inera-general-menu-mobile.js +31 -0
- package/components/header-inera-general/header-inera-general-nav-base.d.ts +10 -0
- package/components/header-inera-general/header-inera-general-nav-base.js +11 -0
- package/components/header-inera-general/header-inera-general-nav-item-base.d.ts +21 -0
- package/components/header-inera-general/header-inera-general-nav-item-base.js +27 -0
- package/components/header-inera-general/header-inera-general-nav-item.d.ts +18 -0
- package/components/header-inera-general/header-inera-general-nav-item.js +27 -0
- package/components/header-inera-general/header-inera-general-nav.d.ts +8 -0
- package/components/header-inera-general/header-inera-general-nav.js +12 -0
- package/components/header-inera-general/header-inera-general.d.ts +15 -0
- package/components/header-inera-general/header-inera-general.js +11 -0
- package/components/header-patient/header-patient.d.ts +3 -0
- package/components/header-patient/header-patient.js +1 -0
- package/components/link/action-link.d.ts +3 -0
- package/components/link/action-link.js +2 -1
- package/components/link/box-link.d.ts +3 -0
- package/components/link/box-link.js +1 -0
- package/components/link/link.d.ts +3 -0
- package/components/link/link.js +1 -0
- package/components/list-pagination/list-pagination-links.d.ts +3 -0
- package/components/list-pagination/list-pagination-links.js +1 -0
- package/components/list-pagination/list-pagination.d.ts +3 -0
- package/components/list-pagination/list-pagination.js +4 -3
- package/components/mobile-menu/mobile-item-base.d.ts +3 -0
- package/components/mobile-menu/mobile-item-base.js +1 -0
- package/components/mobile-menu/mobile-item.d.ts +3 -0
- package/components/mobile-menu/mobile-item.js +1 -0
- package/components/mobile-menu/mobile-menu.d.ts +3 -0
- package/components/mobile-menu/mobile-menu.js +1 -0
- package/components/navigation-content/navigation-content.d.ts +3 -0
- package/components/navigation-content/navigation-content.js +1 -0
- package/components/navigation-local/navigation-local.d.ts +3 -0
- package/components/navigation-local/navigation-local.js +1 -0
- package/components/notification-badge/notification-badge.d.ts +2 -4
- package/components/notification-badge/notification-badge.js +6 -3
- package/components/popover/popover-base.d.ts +4 -1
- package/components/popover/popover-base.js +1 -0
- package/components/popover/popover-content.d.ts +7 -1
- package/components/popover/popover-content.js +6 -10
- package/components/popover/popover.d.ts +3 -0
- package/components/popover/popover.js +141 -52
- package/components/progressbar/progressbar.d.ts +4 -4
- package/components/progressbar/progressbar.js +5 -3
- package/components/puff-list/puff-list-item-date.d.ts +3 -0
- package/components/puff-list/puff-list-item-date.js +1 -0
- package/components/puff-list/puff-list-item-info.d.ts +3 -0
- package/components/puff-list/puff-list-item-info.js +1 -0
- package/components/puff-list/puff-list-item.d.ts +1 -1
- package/components/puff-list/puff-list-item.js +11 -13
- package/components/puff-list/puff-list.d.ts +4 -1
- package/components/puff-list/puff-list.js +2 -1
- package/components/region-icon/region-icon.d.ts +3 -0
- package/components/region-icon/region-icon.js +1 -0
- package/components/side-menu/side-menu.d.ts +3 -0
- package/components/side-menu/side-menu.js +1 -0
- package/components/side-panel/side-panel-base.d.ts +1 -0
- package/components/side-panel/side-panel-base.js +1 -1
- package/components/side-panel/side-panel-provider.d.ts +3 -0
- package/components/side-panel/side-panel-provider.js +1 -0
- package/components/side-panel/side-panel.d.ts +3 -0
- package/components/side-panel/side-panel.js +29 -7
- package/components/stepper/step-base.js +1 -1
- package/components/stepper/step.js +11 -4
- package/components/stepper/stepper.d.ts +3 -0
- package/components/stepper/stepper.js +1 -0
- package/components/tabs/tabs-base.d.ts +3 -0
- package/components/tabs/tabs-base.js +1 -0
- package/components/tabs/tabs.d.ts +3 -0
- package/components/tabs/tabs.js +1 -0
- package/components/tag/tag.d.ts +1 -1
- package/components/tag/tag.js +4 -3
- package/components/toolbar/toolbar.d.ts +5 -0
- package/components/toolbar/toolbar.js +11 -0
- package/components/tooltip/tooltip-base.d.ts +5 -1
- package/components/tooltip/tooltip-base.js +3 -2
- package/components/tooltip/tooltip.d.ts +3 -0
- package/components/tooltip/tooltip.js +26 -1
- package/components/utils/hooks/useClickOutside.d.ts +1 -9
- package/components/utils/hooks/useClickOutside.js +9 -16
- package/components/utils/hooks/useLinkClick.d.ts +2 -0
- package/components/utils/hooks/useLinkClick.js +22 -0
- package/index.d.ts +24 -0
- package/index.js +12 -0
- package/package.json +2 -2
|
@@ -3,7 +3,8 @@ import clsx from 'clsx';
|
|
|
3
3
|
import '@inera/ids-design/components/action-link/action-link.css';
|
|
4
4
|
|
|
5
5
|
function IDSActionLink({ image, children, className, ...props }) {
|
|
6
|
-
return (jsx("div", { ...props, className: clsx("ids-action-link", className), children: jsxs("div", { className: "ids-action-link__inner", children: [jsx("div", { className: "ids-action-link__image", children: image }), children, jsx("div", { className: "ids-action-link__icon", "aria-hidden": "true" })] }) }));
|
|
6
|
+
return (jsx("div", { ...props, className: clsx("ids-action-link", className), children: jsxs("div", { className: "ids-action-link__inner", children: [jsx("div", { className: "ids-action-link__image", children: image }), jsx("span", { className: "ids-action-link__text", children: children }), jsx("div", { className: "ids-action-link__icon-wrapper", children: jsx("div", { className: "ids-action-link__icon", "aria-hidden": "true" }) })] }) }));
|
|
7
7
|
}
|
|
8
|
+
IDSActionLink.displayName = "IDSActionLink";
|
|
8
9
|
|
|
9
10
|
export { IDSActionLink };
|
|
@@ -4,3 +4,6 @@ export interface IDSBoxLinkProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
button?: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare function IDSBoxLink({ button, children, className, ...props }: IDSBoxLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace IDSBoxLink {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
@@ -5,5 +5,6 @@ import '@inera/ids-design/components/box-link/box-link.css';
|
|
|
5
5
|
function IDSBoxLink({ button, children, className, ...props }) {
|
|
6
6
|
return (jsx("div", { ...props, className: clsx("ids-box-link", { "ids-box-link--has-button": !!button }, className), children: jsxs("div", { className: "ids-box-link__inner", children: [jsx("span", { className: "ids-box-link__link", children: children }), !!button && jsx("div", { className: "ids-box-link__button", children: button })] }) }));
|
|
7
7
|
}
|
|
8
|
+
IDSBoxLink.displayName = "IDSBoxLink";
|
|
8
9
|
|
|
9
10
|
export { IDSBoxLink };
|
|
@@ -15,3 +15,6 @@ export interface IDSLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElemen
|
|
|
15
15
|
children?: ReactElement;
|
|
16
16
|
}
|
|
17
17
|
export declare function IDSLink({ colorPreset, menu, footer, active, activeIcon, block, underlined, noUnderline, small, focusAnchor, endItem, className, children, ...props }: IDSLinkProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
18
|
+
export declare namespace IDSLink {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
package/components/link/link.js
CHANGED
|
@@ -17,3 +17,6 @@ export interface IDSListPaginationLinksProps extends React.HTMLAttributes<HTMLDi
|
|
|
17
17
|
nextHref?: string;
|
|
18
18
|
}
|
|
19
19
|
export declare function IDSListPaginationLinks({ showing, from, to, of, total, current, pages, srCurrentPage, srGoToPage, srPrevious, srNext, linkPrefix, prevHref, nextHref, className, ...props }: IDSListPaginationLinksProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare namespace IDSListPaginationLinks {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
@@ -44,5 +44,6 @@ function IDSListPaginationLinks({ showing = "Visar", from = 0, to = 0, of = "av"
|
|
|
44
44
|
};
|
|
45
45
|
return (jsxs("div", { className: clsx("ids-list-pagination", className), ...props, children: [renderSummary(), jsxs("div", { className: "ids-list-pagination__content", children: [jsx("div", { className: "ids-list-pagination__prev-link", children: renderPrevLink() }), jsx("div", { className: "ids-list-pagination__nav-links", children: renderLinks() }), jsx("div", { className: "ids-list-pagination__next-link", children: renderNextLink() })] })] }));
|
|
46
46
|
}
|
|
47
|
+
IDSListPaginationLinks.displayName = "IDSListPaginationLinks";
|
|
47
48
|
|
|
48
49
|
export { IDSListPaginationLinks };
|
|
@@ -18,3 +18,6 @@ export interface IDSListPaginationProps extends React.HTMLAttributes<HTMLDivElem
|
|
|
18
18
|
onNextPage?: (page: number) => void;
|
|
19
19
|
}
|
|
20
20
|
export declare function IDSListPagination({ showing, from, to, of, total, current, pages, srCurrentPage, srGoToPage, srPrevious, srNext, srNav, onChangePage, onPrevPage, onNextPage, className, ...props }: IDSListPaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace IDSListPagination {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
@@ -12,13 +12,13 @@ function IDSListPagination({ showing = "Visar", from = 0, to = 0, of = "av", tot
|
|
|
12
12
|
};
|
|
13
13
|
const renderPrevButton = () => {
|
|
14
14
|
if (current > 1) {
|
|
15
|
-
return jsx("button", { "aria-label": srPrevious, onClick: () => onPrevPage?.(current - 1), id: "prev-button" });
|
|
15
|
+
return (jsx("button", { type: "button", "aria-label": srPrevious, onClick: () => onPrevPage?.(current - 1), id: "prev-button" }));
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
18
|
};
|
|
19
19
|
const renderNextButton = () => {
|
|
20
20
|
if (current < pages) {
|
|
21
|
-
return jsx("button", { "aria-label": srNext, onClick: () => onNextPage?.(current + 1), id: "next-button" });
|
|
21
|
+
return jsx("button", { type: "button", "aria-label": srNext, onClick: () => onNextPage?.(current + 1), id: "next-button" });
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
};
|
|
@@ -37,7 +37,7 @@ function IDSListPagination({ showing = "Visar", from = 0, to = 0, of = "av", tot
|
|
|
37
37
|
current + 1,
|
|
38
38
|
...(current < 4 ? [2, 3, 4] : []),
|
|
39
39
|
...(current > pages - 3 ? [pages - 1, pages - 2, pages - 3] : [])
|
|
40
|
-
].includes(i), "data-hidden-before": pages > 7 && i > 1 && buttonArray[i - 2]?.props.hidden && !buttonArray[i - 1]?.props.hidden ? true : undefined, children: jsx("button", { className: clsx("ids-list-pagination__button", {
|
|
40
|
+
].includes(i), "data-hidden-before": pages > 7 && i > 1 && buttonArray[i - 2]?.props.hidden && !buttonArray[i - 1]?.props.hidden ? true : undefined, children: jsx("button", { type: "button", className: clsx("ids-list-pagination__button", {
|
|
41
41
|
"ids-list-pagination__button--current": isCurrent
|
|
42
42
|
}), "aria-label": isCurrent ? srCurrentPage : `${srGoToPage} ${i}`, onClick: () => !isCurrent && onChangePage?.(i), disabled: isCurrent, children: i }) }, i));
|
|
43
43
|
}
|
|
@@ -45,5 +45,6 @@ function IDSListPagination({ showing = "Visar", from = 0, to = 0, of = "av", tot
|
|
|
45
45
|
};
|
|
46
46
|
return (jsxs("div", { className: clsx("ids-list-pagination", className), ...props, children: [renderSummary(), jsxs("div", { className: "ids-list-pagination__content", children: [jsx("div", { className: "ids-list-pagination__prev-button", children: renderPrevButton() }), jsx("div", { className: "ids-list-pagination__nav-buttons", children: renderButtons() }), jsx("div", { className: "ids-list-pagination__next-button", children: renderNextButton() })] })] }));
|
|
47
47
|
}
|
|
48
|
+
IDSListPagination.displayName = "IDSListPagination";
|
|
48
49
|
|
|
49
50
|
export { IDSListPagination };
|
|
@@ -12,3 +12,6 @@ export interface IDSMobileMenuItemBaseProps extends React.HTMLAttributes<HTMLDiv
|
|
|
12
12
|
client?: boolean;
|
|
13
13
|
}
|
|
14
14
|
export declare function IDSMobileMenuItemBase({ level, secondary, expanded, headline, link, active, showText, hideText, onToggleMenu, className, children, client, ...props }: IDSMobileMenuItemBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace IDSMobileMenuItemBase {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
@@ -42,5 +42,6 @@ function IDSMobileMenuItemBase({ level = 1, secondary = false, expanded = false,
|
|
|
42
42
|
};
|
|
43
43
|
return (jsxs("div", { ...props, className: clsx(getItemLevelClass(), expanded && "ids-mobile-menu-item--expanded", active && "ids-mobile-menu-item--active", secondary && "ids-mobile-menu-item--secondary"), children: [jsx("div", { className: `ids-mobile-menu-item__inner ${level && "ids-mobile-menu-item__inner--level-" + level}`, children: renderItem() }), jsx("div", { id: subItemId, className: "ids-mobile-menu-item__sub-items", children: children })] }));
|
|
44
44
|
}
|
|
45
|
+
IDSMobileMenuItemBase.displayName = "IDSMobileMenuItemBase";
|
|
45
46
|
|
|
46
47
|
export { IDSMobileMenuItemBase };
|
|
@@ -4,3 +4,6 @@ export interface IDSMobileMenuItemProps extends Omit<React.ComponentProps<typeof
|
|
|
4
4
|
onToggleMenu?: (isExpanded: boolean) => void;
|
|
5
5
|
}
|
|
6
6
|
export declare function IDSMobileMenuItem({ expanded, level, onToggleMenu, className, children, ...rest }: IDSMobileMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace IDSMobileMenuItem {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
@@ -4,3 +4,6 @@ export interface IDSMobileMenuProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
variation?: number;
|
|
5
5
|
}
|
|
6
6
|
export declare function IDSMobileMenu({ variation, children, className, ...props }: IDSMobileMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace IDSMobileMenu {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
@@ -6,5 +6,6 @@ function IDSMobileMenu({ variation = 1, children, className, ...props }) {
|
|
|
6
6
|
const menuClass = clsx("ids-mobile-menu", variation === 2 && "ids-mobile-menu--variation-2", className);
|
|
7
7
|
return (jsx("div", { className: menuClass, ...props, children: children }));
|
|
8
8
|
}
|
|
9
|
+
IDSMobileMenu.displayName = "IDSMobileMenu";
|
|
9
10
|
|
|
10
11
|
export { IDSMobileMenu };
|
|
@@ -5,3 +5,6 @@ export interface IDSNavigationContentProps extends React.HTMLAttributes<HTMLDivE
|
|
|
5
5
|
maxHeight?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function IDSNavigationContent({ headline, maxHeight, className, children, ...props }: IDSNavigationContentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare namespace IDSNavigationContent {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
@@ -11,5 +11,6 @@ function IDSNavigationContent({ headline = "", maxHeight = "", className, childr
|
|
|
11
11
|
});
|
|
12
12
|
return (jsxs("div", { className: clsx("ids-navigation-content", { "ids-navigation-content--scrollable": maxHeight }, className), ...props, children: [jsx("div", { className: "ids-navigation-content__border-top", children: jsx("div", { className: "ids-navigation-content__border-top-content" }) }), jsxs("nav", { className: "ids-navigation-content__inner", "aria-labelledby": "content-navigation-headline", id: "content-navigation-inner", children: [headline && (jsx("h2", { className: "ids-navigation-content__inner__headline", id: "content-navigation-headline", children: headline })), jsx("div", { className: "ids-navigation-content__links", style: { maxHeight: maxHeight || "none" }, children: linkWrappers })] })] }));
|
|
13
13
|
}
|
|
14
|
+
IDSNavigationContent.displayName = "IDSNavigationContent";
|
|
14
15
|
|
|
15
16
|
export { IDSNavigationContent };
|
|
@@ -4,3 +4,6 @@ export interface IDSNavigationLocalProps extends React.HTMLAttributes<HTMLDivEle
|
|
|
4
4
|
headline?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function IDSNavigationLocal({ headline, className, children, ...props }: IDSNavigationLocalProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace IDSNavigationLocal {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
@@ -5,5 +5,6 @@ import '@inera/ids-design/components/navigation-local/navigation-local.css';
|
|
|
5
5
|
function IDSNavigationLocal({ headline = "", className, children, ...props }) {
|
|
6
6
|
return (jsxs("div", { className: clsx("ids-navigation-local", className), ...props, children: [jsx("h2", { className: "ids-navigation-local__headline", children: headline }), jsx("div", { className: "ids-navigation-local__links", children: children })] }));
|
|
7
7
|
}
|
|
8
|
+
IDSNavigationLocal.displayName = "IDSNavigationLocal";
|
|
8
9
|
|
|
9
10
|
export { IDSNavigationLocal };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "@inera/ids-design/components/notification-badge/notification-badge.css";
|
|
3
|
-
interface IDSNotificationBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface IDSNotificationBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
type?: "primary" | "secondary" | "neutral" | "info" | "attention" | "success" | "error";
|
|
5
5
|
icon?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
6
|
}
|
|
8
|
-
export declare
|
|
9
|
-
export {};
|
|
7
|
+
export declare const IDSNotificationBadge: React.NamedExoticComponent<IDSNotificationBadgeProps>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import '@inera/ids-design/components/notification-badge/notification-badge.css';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
const IDSNotificationBadge = React.memo(function IDSNotificationBadge(props) {
|
|
7
|
+
const { type = "primary", icon, children, className, ...rest } = props;
|
|
8
|
+
return (jsxs("div", { ...rest, className: clsx("ids-notification-badge", `ids-notification-badge--${type}`, className), children: [icon && jsx("span", { className: `ids-icon-${icon}`, "aria-hidden": "true" }), children] }));
|
|
9
|
+
});
|
|
10
|
+
IDSNotificationBadge.displayName = "IDSNotificationBadge";
|
|
8
11
|
|
|
9
12
|
export { IDSNotificationBadge };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import "@inera/ids-design/components/popover/popover.css";
|
|
3
2
|
import React from "react";
|
|
3
|
+
import "@inera/ids-design/components/popover/popover.css";
|
|
4
4
|
interface IDSPopoverBaseProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
5
5
|
trigger: ReactNode;
|
|
6
6
|
triggerRef?: React.Ref<HTMLSpanElement>;
|
|
@@ -12,4 +12,7 @@ interface IDSPopoverBaseProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
12
12
|
client?: boolean;
|
|
13
13
|
}
|
|
14
14
|
export declare function IDSPopoverBase({ trigger, triggerRef, togglePopover, handleKeyPress, client, expanded, className, children, ...props }: IDSPopoverBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace IDSPopoverBase {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
15
18
|
export {};
|
|
@@ -23,5 +23,6 @@ function IDSPopoverBase({ trigger, triggerRef, togglePopover, handleKeyPress, cl
|
|
|
23
23
|
: trigger;
|
|
24
24
|
return (jsxs("span", { ...props, className: clsx("ids-popover", className), children: [enhancedTrigger, expanded && children] }));
|
|
25
25
|
}
|
|
26
|
+
IDSPopoverBase.displayName = "IDSPopoverBase";
|
|
26
27
|
|
|
27
28
|
export { IDSPopoverBase };
|
|
@@ -3,6 +3,7 @@ import "@inera/ids-design/components/popover/popover.css";
|
|
|
3
3
|
export type PopoverPosition = "top" | "top-left" | "top-right" | "right" | "right-top" | "right-bottom" | "bottom" | "bottom-left" | "bottom-right" | "left" | "left-top" | "left-bottom";
|
|
4
4
|
interface IDSPopoverContentProps {
|
|
5
5
|
position?: PopoverPosition;
|
|
6
|
+
caretPosition?: PopoverPosition;
|
|
6
7
|
headline?: ReactNode;
|
|
7
8
|
children?: ReactNode;
|
|
8
9
|
contentScrollAreaStyle?: CSSProperties;
|
|
@@ -12,8 +13,13 @@ interface IDSPopoverContentProps {
|
|
|
12
13
|
closePopover?: () => void;
|
|
13
14
|
contentRef?: React.Ref<HTMLDivElement>;
|
|
14
15
|
scrollAreaRef?: React.Ref<HTMLDivElement>;
|
|
16
|
+
closeButtonRef?: React.Ref<HTMLButtonElement>;
|
|
15
17
|
noScrollAreaFocus?: boolean;
|
|
16
18
|
client?: boolean;
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
export declare function IDSPopoverContent({ position, caretPosition, srCloseText, headline, contentScrollAreaStyle, noFocusTrap, noScrollAreaFocus, contentRef, scrollAreaRef, closeButtonRef, closePopover, client, children, style }: IDSPopoverContentProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare namespace IDSPopoverContent {
|
|
23
|
+
var displayName: string;
|
|
17
24
|
}
|
|
18
|
-
export declare const IDSPopoverContent: React.ForwardRefExoticComponent<IDSPopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
25
|
export {};
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useId } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import '@inera/ids-design/components/popover/popover.css';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function IDSPopoverContent({ position = "bottom", caretPosition = "bottom", srCloseText = "Stäng", headline, contentScrollAreaStyle, noFocusTrap = false, noScrollAreaFocus = false, contentRef, scrollAreaRef, closeButtonRef, closePopover, client, children, style }) {
|
|
7
7
|
const contentId = `popover-content-${useId()}`;
|
|
8
|
-
const closeHandler = client && closePopover
|
|
9
|
-
? {
|
|
10
|
-
onClick: closePopover
|
|
11
|
-
}
|
|
12
|
-
: {};
|
|
8
|
+
const closeHandler = client && closePopover ? { onClick: closePopover } : {};
|
|
13
9
|
const renderCaret = (pos) => (jsxs("div", { className: `ids-popover-content__caret ids-popover-content__caret--${pos}`, children: [jsx("span", { className: `ids-popover-content__caret-body ids-popover-content__caret--${pos}` }), jsx("span", { className: `ids-popover-content__caret-border ids-popover-content__caret--${pos}` }), jsx("span", { className: `ids-popover-content__caret-shadow ids-popover-content__caret--${pos}` })] }));
|
|
14
|
-
return (jsxs("div", { ref: contentRef, className: clsx("ids-popover-content", `ids-popover-content--${position}`, {
|
|
10
|
+
return (jsxs("div", { ref: contentRef, style: style, className: clsx("ids-popover-content", `ids-popover-content--${position}`, {
|
|
15
11
|
"ids-focus-trap": !noFocusTrap
|
|
16
|
-
}), role: "tooltip", id: contentId, "data-position": position, children: [renderCaret(
|
|
17
|
-
}
|
|
12
|
+
}), role: "tooltip", id: contentId, "data-position": position, children: [renderCaret(caretPosition), jsx("div", { className: "ids-popover-content__close-btn-wrapper", children: jsx("button", { "aria-label": srCloseText, className: "ids-popover-content__close-btn", ...closeHandler, ref: closeButtonRef }) }), jsx("div", { ref: scrollAreaRef, className: "ids-popover-content__content-wrapper", tabIndex: noScrollAreaFocus ? -1 : 0, style: contentScrollAreaStyle, children: jsxs("div", { className: "ids-popover-content__content-wrapper-inner", children: [!!headline && jsx("div", { className: "ids-popover-content__headline", children: headline }), children] }) })] }));
|
|
13
|
+
}
|
|
18
14
|
IDSPopoverContent.displayName = "IDSPopoverContent";
|
|
19
15
|
|
|
20
16
|
export { IDSPopoverContent };
|
|
@@ -16,4 +16,7 @@ interface IDSPopoverProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
}
|
|
18
18
|
export declare function IDSPopover({ position, category, trigger, maxWidth, maxHeight, show, noFocusTrap, autoFocus, noScrollAreaFocus, srCloseText, headline, children, className, onVisibilityChange, ...props }: IDSPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare namespace IDSPopover {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
19
22
|
export {};
|
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useRef, useState, useCallback, useEffect } from 'react';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useState, useCallback, useEffect, useLayoutEffect } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
4
5
|
import { IDSPopoverBase } from './popover-base.js';
|
|
5
6
|
import { useFocusTrap } from '../utils/hooks/useFocusTrap.js';
|
|
6
7
|
import { IDSPopoverContent } from './popover-content.js';
|
|
8
|
+
import { useEsc } from '../utils/hooks/useEsc.js';
|
|
7
9
|
|
|
8
10
|
function IDSPopover({ position = "bottom", category = "", trigger, maxWidth = 260, maxHeight = 260, show = false, noFocusTrap = false, autoFocus = false, noScrollAreaFocus = false, srCloseText = "Stäng", headline, children, className, onVisibilityChange, ...props }) {
|
|
9
11
|
const popoverRef = useRef(null);
|
|
10
12
|
const triggerRef = useRef(null);
|
|
11
13
|
const contentRef = useRef(null);
|
|
12
14
|
const scrollAreaRef = useRef(null);
|
|
15
|
+
const closeButtonRef = useRef(null);
|
|
13
16
|
const [isExpanded, setIsExpanded] = useState(show);
|
|
14
|
-
const [
|
|
17
|
+
const [mounted, setMounted] = useState(false);
|
|
18
|
+
const [ready, setReady] = useState(false);
|
|
19
|
+
const [coords, setCoords] = useState({ top: 0, left: 0 });
|
|
20
|
+
const GAP = 4;
|
|
21
|
+
const CARET_SIZE = 8;
|
|
22
|
+
const closePopover = useCallback(() => {
|
|
23
|
+
handleVisibilityChange(false);
|
|
24
|
+
triggerRef.current?.focus();
|
|
25
|
+
}, []);
|
|
15
26
|
useFocusTrap(contentRef.current, isExpanded && !noFocusTrap);
|
|
27
|
+
useEsc(closePopover, triggerRef, contentRef, isExpanded);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setMounted(true);
|
|
30
|
+
}, []);
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
if (isExpanded) {
|
|
33
|
+
setReady(false);
|
|
34
|
+
setTimeout(() => requestAnimationFrame(() => setReady(true)), 100);
|
|
35
|
+
}
|
|
36
|
+
}, [isExpanded]);
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
if (!ready)
|
|
39
|
+
return;
|
|
40
|
+
requestAnimationFrame(() => updatePosition());
|
|
41
|
+
}, [ready]);
|
|
16
42
|
const handleVisibilityChange = (visible) => {
|
|
17
43
|
setIsExpanded(visible);
|
|
18
44
|
onVisibilityChange?.(visible);
|
|
19
45
|
};
|
|
20
|
-
const closePopover = useCallback(() => {
|
|
21
|
-
handleVisibilityChange(false);
|
|
22
|
-
triggerRef.current?.focus();
|
|
23
|
-
}, []);
|
|
24
46
|
const togglePopover = () => (isExpanded ? closePopover() : handleVisibilityChange(true));
|
|
25
47
|
const handleKeyPress = (e) => {
|
|
26
48
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -28,32 +50,7 @@ function IDSPopover({ position = "bottom", category = "", trigger, maxWidth = 26
|
|
|
28
50
|
togglePopover();
|
|
29
51
|
}
|
|
30
52
|
};
|
|
31
|
-
|
|
32
|
-
if (!isExpanded)
|
|
33
|
-
return;
|
|
34
|
-
const handleEsc = (e) => {
|
|
35
|
-
if (e.key === "Escape")
|
|
36
|
-
closePopover();
|
|
37
|
-
};
|
|
38
|
-
document.addEventListener("keydown", handleEsc);
|
|
39
|
-
return () => document.removeEventListener("keydown", handleEsc);
|
|
40
|
-
}, [isExpanded, closePopover]);
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
if (!scrollAreaRef.current)
|
|
43
|
-
return;
|
|
44
|
-
const contentWrapperHeight = scrollAreaRef.current.getBoundingClientRect().height;
|
|
45
|
-
if (contentWrapperHeight >= maxHeight - 40) {
|
|
46
|
-
setPopoverScrollAreaStyle({
|
|
47
|
-
height: `${maxHeight - 40}px`
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
setPopoverScrollAreaStyle({
|
|
52
|
-
height: "100%"
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}, [scrollAreaRef, isExpanded, maxHeight]);
|
|
56
|
-
// Send events if you have a category and open the popup
|
|
53
|
+
// Category sync
|
|
57
54
|
useEffect(() => {
|
|
58
55
|
if (!category || !isExpanded)
|
|
59
56
|
return;
|
|
@@ -62,39 +59,131 @@ function IDSPopover({ position = "bottom", category = "", trigger, maxWidth = 26
|
|
|
62
59
|
});
|
|
63
60
|
window.dispatchEvent(event);
|
|
64
61
|
}, [isExpanded, category]);
|
|
65
|
-
// Listen for other popovers opening in same category
|
|
66
62
|
useEffect(() => {
|
|
67
|
-
const
|
|
63
|
+
const handler = (e) => {
|
|
68
64
|
if (e.detail.category !== category)
|
|
69
65
|
return;
|
|
70
66
|
if (e.detail.source !== popoverRef.current) {
|
|
71
67
|
setIsExpanded(false);
|
|
72
68
|
}
|
|
73
69
|
};
|
|
74
|
-
window.addEventListener("ids-popover-toggle",
|
|
75
|
-
return () =>
|
|
76
|
-
window.removeEventListener("ids-popover-toggle", handleOtherPopoverToggle);
|
|
77
|
-
};
|
|
70
|
+
window.addEventListener("ids-popover-toggle", handler);
|
|
71
|
+
return () => window.removeEventListener("ids-popover-toggle", handler);
|
|
78
72
|
}, [category]);
|
|
73
|
+
// Autofocus
|
|
79
74
|
useEffect(() => {
|
|
80
|
-
if (isExpanded
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
if (isExpanded) {
|
|
76
|
+
if (autoFocus && scrollAreaRef.current) {
|
|
77
|
+
const container = scrollAreaRef.current;
|
|
78
|
+
const anchor = container.querySelector(".ids-focus-anchor");
|
|
79
|
+
if (anchor) {
|
|
80
|
+
const containerRect = container.getBoundingClientRect();
|
|
81
|
+
const anchorRect = anchor.getBoundingClientRect();
|
|
82
|
+
const offsetTop = anchorRect.top - containerRect.top;
|
|
83
|
+
container.scrollTo({
|
|
84
|
+
top: container.scrollTop + offsetTop,
|
|
85
|
+
behavior: "smooth"
|
|
89
86
|
});
|
|
90
|
-
|
|
87
|
+
anchor.focus({ preventScroll: true });
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
container.focus({ preventScroll: true });
|
|
91
|
+
}
|
|
91
92
|
}
|
|
92
|
-
else {
|
|
93
|
-
|
|
93
|
+
else if (closeButtonRef.current) {
|
|
94
|
+
closeButtonRef.current.focus({ preventScroll: true });
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
}, [isExpanded, autoFocus]);
|
|
97
|
-
|
|
98
|
+
const updatePosition = useCallback(() => {
|
|
99
|
+
if (!triggerRef.current || !contentRef.current)
|
|
100
|
+
return;
|
|
101
|
+
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
102
|
+
const contentRect = contentRef.current.getBoundingClientRect();
|
|
103
|
+
let top = 0;
|
|
104
|
+
let left = 0;
|
|
105
|
+
switch (position) {
|
|
106
|
+
case "top":
|
|
107
|
+
top = triggerRect.top - contentRect.height - GAP - CARET_SIZE;
|
|
108
|
+
left = triggerRect.left + triggerRect.width / 2;
|
|
109
|
+
break;
|
|
110
|
+
case "bottom":
|
|
111
|
+
top = triggerRect.bottom + GAP + CARET_SIZE;
|
|
112
|
+
left = triggerRect.left + triggerRect.width / 2;
|
|
113
|
+
break;
|
|
114
|
+
case "left":
|
|
115
|
+
top = triggerRect.top + triggerRect.height / 2 - contentRect.height / 2;
|
|
116
|
+
left = triggerRect.left - contentRect.width / 2 - GAP - CARET_SIZE;
|
|
117
|
+
break;
|
|
118
|
+
case "left-bottom":
|
|
119
|
+
top = triggerRect.bottom - triggerRect.height;
|
|
120
|
+
left = triggerRect.left - contentRect.width / 2 - GAP - CARET_SIZE;
|
|
121
|
+
break;
|
|
122
|
+
case "left-top":
|
|
123
|
+
top = triggerRect.top + triggerRect.height - contentRect.height;
|
|
124
|
+
left = triggerRect.left - contentRect.width / 2 - GAP - CARET_SIZE;
|
|
125
|
+
break;
|
|
126
|
+
case "right":
|
|
127
|
+
top = triggerRect.top + triggerRect.height / 2 - contentRect.height / 2;
|
|
128
|
+
left = triggerRect.left + triggerRect.width + contentRect.width / 2 + GAP + CARET_SIZE;
|
|
129
|
+
break;
|
|
130
|
+
case "right-top":
|
|
131
|
+
top = triggerRect.top + triggerRect.height - contentRect.height;
|
|
132
|
+
left = triggerRect.left + triggerRect.width + contentRect.width / 2 + GAP + CARET_SIZE;
|
|
133
|
+
break;
|
|
134
|
+
case "right-bottom":
|
|
135
|
+
top = triggerRect.bottom - triggerRect.height;
|
|
136
|
+
left = triggerRect.left + triggerRect.width + contentRect.width / 2 + GAP + CARET_SIZE;
|
|
137
|
+
break;
|
|
138
|
+
case "bottom-left":
|
|
139
|
+
top = triggerRect.bottom + GAP + CARET_SIZE;
|
|
140
|
+
left = triggerRect.left + contentRect.width / 2;
|
|
141
|
+
break;
|
|
142
|
+
case "bottom-right":
|
|
143
|
+
top = triggerRect.bottom + GAP + CARET_SIZE;
|
|
144
|
+
left = triggerRect.right - contentRect.width / 2;
|
|
145
|
+
break;
|
|
146
|
+
case "top-left":
|
|
147
|
+
top = triggerRect.top - contentRect.height - GAP - CARET_SIZE;
|
|
148
|
+
left = triggerRect.left + contentRect.width / 2;
|
|
149
|
+
break;
|
|
150
|
+
case "top-right":
|
|
151
|
+
top = triggerRect.top - contentRect.height - GAP - CARET_SIZE;
|
|
152
|
+
left = triggerRect.right - contentRect.width / 2;
|
|
153
|
+
break;
|
|
154
|
+
default:
|
|
155
|
+
top = triggerRect.bottom;
|
|
156
|
+
left = triggerRect.left;
|
|
157
|
+
}
|
|
158
|
+
setCoords({
|
|
159
|
+
top: top + window.scrollY,
|
|
160
|
+
left: left + window.scrollX
|
|
161
|
+
});
|
|
162
|
+
}, [position]);
|
|
163
|
+
useLayoutEffect(() => {
|
|
164
|
+
if (!isExpanded || !triggerRef.current || !contentRef.current)
|
|
165
|
+
return;
|
|
166
|
+
updatePosition();
|
|
167
|
+
window.addEventListener("resize", updatePosition);
|
|
168
|
+
window.addEventListener("scroll", updatePosition);
|
|
169
|
+
return () => {
|
|
170
|
+
window.removeEventListener("resize", updatePosition);
|
|
171
|
+
window.removeEventListener("scroll", updatePosition);
|
|
172
|
+
};
|
|
173
|
+
}, [isExpanded, position]);
|
|
174
|
+
return (jsxs("span", { "data-popover-category": category, ref: popoverRef, children: [jsx(IDSPopoverBase, { ...props, client: true, expanded: isExpanded, triggerRef: triggerRef, togglePopover: togglePopover, handleKeyPress: handleKeyPress, trigger: trigger, className: className }), mounted &&
|
|
175
|
+
isExpanded &&
|
|
176
|
+
createPortal(jsx(IDSPopoverContent, { client: true, headline: headline, contentRef: contentRef, scrollAreaRef: scrollAreaRef, noScrollAreaFocus: noScrollAreaFocus, caretPosition: position, srCloseText: srCloseText, closeButtonRef: closeButtonRef, closePopover: closePopover, contentScrollAreaStyle: {
|
|
177
|
+
maxHeight: `${maxHeight - 40}px`,
|
|
178
|
+
overflowY: "auto",
|
|
179
|
+
paddingBottom: ".25rem"
|
|
180
|
+
}, noFocusTrap: noFocusTrap, style: {
|
|
181
|
+
position: "absolute",
|
|
182
|
+
top: coords.top,
|
|
183
|
+
left: coords.left,
|
|
184
|
+
zIndex: 9999
|
|
185
|
+
}, children: children }), document.body)] }));
|
|
98
186
|
}
|
|
187
|
+
IDSPopover.displayName = "IDSPopover";
|
|
99
188
|
|
|
100
189
|
export { IDSPopover };
|
|
@@ -6,7 +6,7 @@ export interface IDSProgressbarProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
6
6
|
value?: number;
|
|
7
7
|
srLabel: string;
|
|
8
8
|
}
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
9
|
+
export declare const IDSProgressbar: React.MemoExoticComponent<{
|
|
10
|
+
({ label, hideLabel, value, srLabel, className, ...props }: IDSProgressbarProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
}>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { memo } from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import '@inera/ids-design/components/progressbar/progressbar.css';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const IDSProgressbarBase = ({ label = "", hideLabel = false, value = 0, srLabel = "", className, ...props }) => {
|
|
6
7
|
return (jsxs("div", { className: clsx("ids-progressbar", className), ...props, children: [!hideLabel && (jsxs("div", { className: "ids-progressbar__label", children: [label, " ", value, "%"] })), jsx("div", { className: "ids-progressbar__bar", role: "progressbar", ...(srLabel ? { "aria-label": srLabel } : {}), "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": value, children: value > 0 && jsx("div", { className: "ids-progressbar__progress", style: { width: `calc(${value}% + 0.125rem)` } }) })] }));
|
|
7
|
-
}
|
|
8
|
-
|
|
8
|
+
};
|
|
9
|
+
IDSProgressbarBase.displayName = "IDSProgressbar";
|
|
10
|
+
const IDSProgressbar = memo(IDSProgressbarBase);
|
|
9
11
|
|
|
10
12
|
export { IDSProgressbar };
|
|
@@ -9,4 +9,7 @@ interface IDSPuffListItemDateProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
9
9
|
time?: string;
|
|
10
10
|
}
|
|
11
11
|
export declare function IDSPuffListItemDate({ date, showTime, day, year, month, monthLabel, time, ...props }: IDSPuffListItemDateProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare namespace IDSPuffListItemDate {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
12
15
|
export {};
|
|
@@ -18,5 +18,6 @@ function IDSPuffListItemDate({ date, showTime = false, day = 0, year = 0, month
|
|
|
18
18
|
};
|
|
19
19
|
return (jsxs("span", { ...props, className: "ids-puff-list-item__date", children: [`${getDay()} ${getMonthText()} ${getYear()}`, !!getTime() && jsx("span", { className: "ids-puff-list-item__time", children: getTime() })] }));
|
|
20
20
|
}
|
|
21
|
+
IDSPuffListItemDate.displayName = "IDSPuffListItemDate";
|
|
21
22
|
|
|
22
23
|
export { IDSPuffListItemDate };
|
|
@@ -3,3 +3,6 @@ export interface IDSPuffListItemInfoProps extends React.HTMLAttributes<HTMLDivEl
|
|
|
3
3
|
bottom?: boolean;
|
|
4
4
|
}
|
|
5
5
|
export declare function IDSPuffListItemInfo({ bottom, children, ...props }: IDSPuffListItemInfoProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare namespace IDSPuffListItemInfo {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
@@ -4,5 +4,6 @@ import clsx from 'clsx';
|
|
|
4
4
|
function IDSPuffListItemInfo({ bottom = false, children, ...props }) {
|
|
5
5
|
return (jsx("div", { ...props, className: clsx("ids-puff-list-item__info", { "ids-puff-list-item__info--bottom": bottom }), children: children }));
|
|
6
6
|
}
|
|
7
|
+
IDSPuffListItemInfo.displayName = "IDSPuffListItemInfo";
|
|
7
8
|
|
|
8
9
|
export { IDSPuffListItemInfo };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/puff-list/puff-list.css";
|
|
3
|
-
export interface IDSPuffListItemProps extends React.HTMLAttributes<
|
|
3
|
+
export interface IDSPuffListItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
4
|
header?: ReactNode;
|
|
5
5
|
itemLink?: React.ReactElement;
|
|
6
6
|
date?: React.ReactElement;
|