@inera/ids-react 8.2.0 → 9.0.1
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 +18 -0
- package/components/accordion/accordion-base.js +33 -0
- package/components/accordion/accordion.d.ts +5 -4
- package/components/accordion/accordion.js +16 -35
- package/components/alert/alert-base.d.ts +21 -0
- package/components/alert/alert-base.js +29 -0
- package/components/alert/alert.d.ts +3 -19
- package/components/alert/alert.js +8 -18
- package/components/alert/global-alert-base.d.ts +15 -0
- package/components/alert/global-alert-base.js +21 -0
- package/components/alert/global-alert.d.ts +7 -0
- package/components/alert/global-alert.js +19 -0
- package/components/badge/badge.js +2 -2
- package/components/breadcrumbs/breadcrumbs.js +2 -2
- package/components/{button-group → button}/button-group.js +2 -2
- package/components/button/button.js +3 -3
- package/components/card/card.js +3 -3
- package/components/carousel/carousel-item.d.ts +5 -4
- package/components/carousel/carousel-item.js +8 -6
- package/components/carousel/carousel.d.ts +4 -1
- package/components/carousel/carousel.js +24 -39
- package/components/{pagination/data-pagination → data-pagination}/data-pagination.d.ts +2 -6
- package/components/data-pagination/data-pagination.js +12 -0
- package/components/date-label/date-label.js +2 -2
- package/components/dialog/dialog-base.d.ts +21 -0
- package/components/dialog/dialog-base.js +29 -0
- package/components/dialog/dialog.d.ts +14 -17
- package/components/dialog/dialog.js +36 -36
- package/components/dropdown/dropdown-base.d.ts +18 -0
- package/components/dropdown/dropdown-base.js +42 -0
- package/components/dropdown/dropdown-content-button.d.ts +0 -1
- package/components/dropdown/dropdown-content-button.js +0 -1
- package/components/dropdown/dropdown-content-link.d.ts +2 -3
- package/components/dropdown/dropdown-content-link.js +3 -10
- package/components/dropdown/dropdown.d.ts +11 -13
- package/components/dropdown/dropdown.js +34 -53
- package/components/footer-1177/footer-1177.d.ts +6 -7
- package/components/footer-1177/footer-1177.js +8 -5
- package/components/footer-1177-admin/footer-1177-admin.d.ts +6 -7
- package/components/footer-1177-admin/footer-1177-admin.js +9 -6
- package/components/footer-1177-pro/footer-1177-pro.d.ts +6 -7
- package/components/footer-1177-pro/footer-1177-pro.js +9 -6
- package/components/footer-inera/footer-inera.d.ts +6 -7
- package/components/footer-inera/footer-inera.js +9 -6
- package/components/footer-inera-admin/footer-inera-admin.d.ts +6 -7
- package/components/footer-inera-admin/footer-inera-admin.js +9 -6
- package/components/form/check-button/check-button.d.ts +5 -6
- package/components/form/check-button/check-button.js +5 -10
- package/components/form/checkbox/checkbox-base.d.ts +19 -0
- package/components/form/checkbox/checkbox-base.js +29 -0
- package/components/form/checkbox/checkbox-group-base.d.ts +12 -0
- package/components/form/checkbox/checkbox-group-base.js +13 -0
- package/components/form/checkbox/checkbox-group.d.ts +4 -5
- package/components/form/checkbox/checkbox-group.js +26 -30
- package/components/form/checkbox/checkbox.d.ts +3 -3
- package/components/form/checkbox/checkbox.js +17 -41
- package/components/form/darkmode-toggle/darkmode-toggle.d.ts +11 -0
- package/components/form/darkmode-toggle/darkmode-toggle.js +13 -0
- package/components/form/datepicker/datepicker.d.ts +11 -4
- package/components/form/datepicker/datepicker.js +65 -27
- package/components/form/error-message/error-message.d.ts +1 -2
- package/components/form/error-message/error-message.js +2 -4
- package/components/form/form-hooks/useGroupValidity.d.ts +4 -1
- package/components/form/form-hooks/useGroupValidity.js +7 -2
- package/components/form/form-hooks/useInputValidity.d.ts +1 -1
- package/components/form/form-hooks/useInputValidity.js +9 -5
- package/components/form/input/input-base.d.ts +24 -0
- package/components/form/input/input-base.js +32 -0
- package/components/form/input/input.d.ts +3 -2
- package/components/form/input/input.js +8 -24
- package/components/form/radio/radio-base.d.ts +16 -0
- package/components/form/radio/radio-base.js +24 -0
- package/components/form/radio/radio-group-base.d.ts +13 -0
- package/components/form/radio/radio-group-base.js +10 -0
- package/components/form/radio/radio-group.d.ts +6 -5
- package/components/form/radio/radio-group.js +25 -19
- package/components/form/radio/radio.d.ts +9 -9
- package/components/form/radio/radio.js +7 -20
- package/components/form/radio-button/radio-button-group-base.d.ts +8 -0
- package/components/form/radio-button/radio-button-group-base.js +8 -0
- package/components/form/radio-button/radio-button-group.d.ts +4 -3
- package/components/form/radio-button/radio-button-group.js +18 -12
- package/components/form/radio-button/radio-button.d.ts +4 -5
- package/components/form/radio-button/radio-button.js +5 -10
- package/components/form/range/range-base.d.ts +18 -0
- package/components/form/range/range-base.js +16 -0
- package/components/form/range/range.d.ts +3 -6
- package/components/form/range/range.js +23 -23
- package/components/form/select/select-base.d.ts +19 -0
- package/components/form/select/select-base.js +24 -0
- package/components/form/select/select.d.ts +7 -7
- package/components/form/select/select.js +8 -18
- package/components/form/select-multiple/select-multiple-base.d.ts +27 -0
- package/components/form/select-multiple/select-multiple-base.js +27 -0
- package/components/form/select-multiple/select-multiple.d.ts +10 -7
- package/components/form/select-multiple/select-multiple.js +29 -54
- package/components/form/spinner/spinner.d.ts +3 -4
- package/components/form/spinner/spinner.js +3 -7
- package/components/form/textarea/textarea-base.d.ts +24 -0
- package/components/form/textarea/textarea-base.js +34 -0
- package/components/form/textarea/textarea.d.ts +4 -5
- package/components/form/textarea/textarea.js +6 -22
- package/components/form/time/time-base.d.ts +17 -0
- package/components/form/time/time-base.js +24 -0
- package/components/form/time/time.d.ts +8 -7
- package/components/form/time/time.js +5 -16
- package/components/form/toggle/toggle.d.ts +1 -2
- package/components/form/toggle/toggle.js +5 -8
- package/components/grid/column.d.ts +1 -1
- package/components/grid/column.js +6 -7
- package/components/grid/container.js +1 -1
- package/components/grid/row.js +1 -1
- package/components/grid-layout/grid-column.d.ts +19 -0
- package/components/grid-layout/grid-column.js +14 -0
- package/components/grid-layout/grid-container.d.ts +10 -0
- package/components/grid-layout/grid-container.js +17 -0
- package/components/grid-layout/grid-row.d.ts +8 -0
- package/components/grid-layout/grid-row.js +12 -0
- package/components/header-1177/header-1177-avatar-base.d.ts +16 -0
- package/components/header-1177/header-1177-avatar-base.js +24 -0
- package/components/header-1177/header-1177-avatar.d.ts +4 -7
- package/components/header-1177/header-1177-avatar.js +35 -42
- package/components/header-1177/header-1177-base.d.ts +18 -0
- package/components/header-1177/header-1177-base.js +14 -0
- package/components/header-1177/header-1177-item-base.d.ts +9 -0
- package/components/header-1177/header-1177-item-base.js +13 -0
- package/components/header-1177/header-1177-item.d.ts +2 -7
- package/components/header-1177/header-1177-item.js +6 -29
- package/components/header-1177/header-1177-menu-mobile-base.d.ts +12 -0
- package/components/header-1177/header-1177-menu-mobile-base.js +18 -0
- package/components/header-1177/header-1177-menu-mobile.d.ts +4 -5
- package/components/header-1177/header-1177-menu-mobile.js +29 -28
- package/components/header-1177/header-1177-nav-base.d.ts +9 -0
- package/components/header-1177/header-1177-nav-base.js +12 -0
- package/components/header-1177/header-1177-nav-item-base.d.ts +18 -0
- package/components/header-1177/header-1177-nav-item-base.js +31 -0
- package/components/header-1177/header-1177-nav-item-mobile-base.d.ts +7 -0
- package/components/header-1177/header-1177-nav-item-mobile-base.js +10 -0
- package/components/header-1177/header-1177-nav-item-mobile.d.ts +4 -8
- package/components/header-1177/header-1177-nav-item-mobile.js +5 -16
- package/components/header-1177/header-1177-nav-item.d.ts +7 -7
- package/components/header-1177/header-1177-nav-item.js +44 -35
- package/components/header-1177/header-1177-nav.d.ts +2 -4
- package/components/header-1177/header-1177-nav.js +5 -9
- package/components/header-1177/header-1177-region-picker-base.d.ts +9 -0
- package/components/header-1177/header-1177-region-picker-base.js +21 -0
- package/components/header-1177/header-1177-region-picker-mobile-base.d.ts +9 -0
- package/components/header-1177/header-1177-region-picker-mobile-base.js +21 -0
- package/components/header-1177/header-1177-region-picker-mobile.d.ts +3 -6
- package/components/header-1177/header-1177-region-picker-mobile.js +13 -29
- package/components/header-1177/header-1177-region-picker.d.ts +3 -6
- package/components/header-1177/header-1177-region-picker.js +15 -29
- package/components/header-1177/header-1177.d.ts +3 -3
- package/components/header-1177/header-1177.js +5 -10
- package/components/header-1177-admin/header-1177-admin-avatar-base.d.ts +14 -0
- package/components/header-1177-admin/header-1177-admin-avatar-base.js +23 -0
- package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.d.ts +13 -0
- package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.js +23 -0
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.d.ts +3 -5
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.js +27 -23
- package/components/header-1177-admin/header-1177-admin-avatar.d.ts +3 -5
- package/components/header-1177-admin/header-1177-admin-avatar.js +26 -25
- package/components/header-1177-admin/header-1177-admin-base.d.ts +18 -0
- package/components/header-1177-admin/header-1177-admin-base.js +14 -0
- package/components/header-1177-admin/header-1177-admin-item-base.d.ts +8 -0
- package/components/header-1177-admin/header-1177-admin-item-base.js +12 -0
- package/components/header-1177-admin/header-1177-admin-item.d.ts +3 -8
- package/components/header-1177-admin/header-1177-admin-item.js +5 -27
- package/components/header-1177-admin/header-1177-admin-menu-mobile-base.d.ts +11 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile-base.js +18 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile.d.ts +4 -5
- package/components/header-1177-admin/header-1177-admin-menu-mobile.js +27 -25
- package/components/header-1177-admin/header-1177-admin-nav-base.d.ts +7 -0
- package/components/header-1177-admin/header-1177-admin-nav-base.js +10 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-base.d.ts +18 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-base.js +31 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.d.ts +7 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.js +10 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile.d.ts +7 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile.js +11 -0
- package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +6 -6
- package/components/header-1177-admin/header-1177-admin-nav-item.js +44 -35
- package/components/header-1177-admin/header-1177-admin-nav.d.ts +2 -4
- package/components/header-1177-admin/header-1177-admin-nav.js +4 -6
- package/components/header-1177-admin/header-1177-admin.d.ts +2 -3
- package/components/header-1177-admin/header-1177-admin.js +5 -10
- package/components/header-1177-pro/header-1177-pro-avatar-base.d.ts +14 -0
- package/components/header-1177-pro/header-1177-pro-avatar-base.js +23 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.d.ts +13 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.js +24 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.d.ts +3 -6
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.js +23 -20
- package/components/header-1177-pro/header-1177-pro-avatar.d.ts +4 -6
- package/components/header-1177-pro/header-1177-pro-avatar.js +32 -30
- package/components/header-1177-pro/header-1177-pro-base.d.ts +19 -0
- package/components/header-1177-pro/header-1177-pro-base.js +11 -0
- package/components/header-1177-pro/header-1177-pro-item-base.d.ts +8 -0
- package/components/header-1177-pro/header-1177-pro-item-base.js +12 -0
- package/components/header-1177-pro/header-1177-pro-item.d.ts +3 -8
- package/components/header-1177-pro/header-1177-pro-item.js +5 -27
- package/components/header-1177-pro/header-1177-pro-menu-mobile-base.d.ts +11 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile-base.js +18 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile.d.ts +5 -6
- package/components/header-1177-pro/header-1177-pro-menu-mobile.js +27 -25
- package/components/header-1177-pro/header-1177-pro-nav-base.d.ts +10 -0
- package/components/header-1177-pro/header-1177-pro-nav-base.js +10 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-base.d.ts +18 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-base.js +31 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.d.ts +7 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.js +10 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile.d.ts +7 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile.js +11 -0
- package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +6 -6
- package/components/header-1177-pro/header-1177-pro-nav-item.js +44 -35
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +4 -5
- package/components/header-1177-pro/header-1177-pro-nav.js +5 -7
- package/components/header-1177-pro/header-1177-pro-region-picker-base.d.ts +9 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-base.js +19 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.d.ts +9 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.js +19 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.d.ts +3 -5
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.js +13 -29
- package/components/header-1177-pro/header-1177-pro-region-picker.d.ts +3 -5
- package/components/header-1177-pro/header-1177-pro-region-picker.js +15 -29
- package/components/header-1177-pro/header-1177-pro.d.ts +4 -5
- package/components/header-1177-pro/header-1177-pro.js +5 -7
- package/components/header-inera/header-inera-base.d.ts +14 -0
- package/components/header-inera/header-inera-base.js +11 -0
- package/components/header-inera/header-inera-item-base.d.ts +8 -0
- package/components/header-inera/header-inera-item-base.js +12 -0
- package/components/header-inera/header-inera-item.d.ts +3 -8
- package/components/header-inera/header-inera-item.js +5 -36
- package/components/header-inera/header-inera-menu-mobile-base.d.ts +11 -0
- package/components/header-inera/header-inera-menu-mobile-base.js +18 -0
- package/components/header-inera/header-inera-menu-mobile.d.ts +5 -6
- package/components/header-inera/header-inera-menu-mobile.js +27 -26
- package/components/header-inera/header-inera-nav-base.d.ts +7 -0
- package/components/header-inera/header-inera-nav-base.js +10 -0
- package/components/header-inera/header-inera-nav-item-base.d.ts +17 -0
- package/components/header-inera/header-inera-nav-item-base.js +26 -0
- package/components/header-inera/header-inera-nav-item.d.ts +7 -7
- package/components/header-inera/header-inera-nav-item.js +44 -34
- package/components/header-inera/header-inera-nav.d.ts +4 -6
- package/components/header-inera/header-inera-nav.js +4 -7
- package/components/header-inera/header-inera.d.ts +1 -3
- package/components/header-inera/header-inera.js +5 -7
- package/components/header-inera-admin/header-inera-admin-avatar-base.d.ts +14 -0
- package/components/header-inera-admin/header-inera-admin-avatar-base.js +23 -0
- package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.d.ts +13 -0
- package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.js +23 -0
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +3 -6
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +26 -21
- package/components/header-inera-admin/header-inera-admin-avatar.d.ts +4 -6
- package/components/header-inera-admin/header-inera-admin-avatar.js +35 -31
- package/components/header-inera-admin/header-inera-admin-base.d.ts +15 -0
- package/components/header-inera-admin/header-inera-admin-base.js +20 -0
- package/components/header-inera-admin/header-inera-admin-item-base.d.ts +8 -0
- package/components/header-inera-admin/header-inera-admin-item-base.js +13 -0
- package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -8
- package/components/header-inera-admin/header-inera-admin-item.js +6 -26
- package/components/header-inera-admin/header-inera-admin-menu-mobile-base.d.ts +11 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile-base.js +18 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile.d.ts +4 -5
- package/components/header-inera-admin/header-inera-admin-menu-mobile.js +27 -25
- package/components/header-inera-admin/header-inera-admin-nav-base.d.ts +7 -0
- package/components/header-inera-admin/header-inera-admin-nav-base.js +10 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-base.d.ts +18 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-base.js +31 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.d.ts +7 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.js +10 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile.d.ts +7 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile.js +11 -0
- package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +7 -6
- package/components/header-inera-admin/header-inera-admin-nav-item.js +44 -34
- package/components/header-inera-admin/header-inera-admin-nav.d.ts +4 -6
- package/components/header-inera-admin/header-inera-admin-nav.js +5 -8
- package/components/header-inera-admin/header-inera-admin.d.ts +3 -4
- package/components/header-inera-admin/header-inera-admin.js +5 -16
- package/components/header-patient/header-patient.d.ts +2 -4
- package/components/header-patient/header-patient.js +6 -10
- package/components/{action-link → link}/action-link.js +2 -2
- package/components/link/box-link.d.ts +6 -0
- package/components/link/box-link.js +9 -0
- package/components/link/link.d.ts +2 -2
- package/components/link/link.js +3 -10
- package/components/list-pagination/list-pagination-links.d.ts +19 -0
- package/components/list-pagination/list-pagination-links.js +48 -0
- package/components/{pagination/list-pagination → list-pagination}/list-pagination.d.ts +3 -2
- package/components/{pagination/list-pagination → list-pagination}/list-pagination.js +4 -3
- package/components/mobile-menu/mobile-item-base.d.ts +14 -0
- package/components/mobile-menu/mobile-item-base.js +46 -0
- package/components/mobile-menu/mobile-item.d.ts +6 -0
- package/components/mobile-menu/mobile-item.js +26 -0
- package/components/mobile-menu/mobile-menu.d.ts +6 -0
- package/components/mobile-menu/mobile-menu.js +10 -0
- package/components/{navigation/content → navigation-content}/navigation-content.d.ts +1 -1
- package/components/{navigation/content → navigation-content}/navigation-content.js +1 -1
- package/components/{navigation/local → navigation-local}/navigation-local.d.ts +1 -1
- package/components/{navigation/local → navigation-local}/navigation-local.js +1 -1
- package/components/{notification/badge → notification-badge}/notification-badge.d.ts +1 -1
- package/components/notification-badge/notification-badge.js +9 -0
- package/components/popover/popover-base.d.ts +15 -0
- package/components/popover/popover-base.js +27 -0
- package/components/popover/popover-content.d.ts +19 -0
- package/components/popover/popover-content.js +20 -0
- package/components/popover/popover.d.ts +7 -8
- package/components/popover/popover.js +67 -161
- package/components/progressbar/progressbar.js +2 -2
- package/components/puff-list/{puff-list-item/puff-list-item-date.d.ts → puff-list-item-date.d.ts} +0 -1
- package/components/puff-list/{puff-list-item/puff-list-item-date.js → puff-list-item-date.js} +2 -3
- package/components/puff-list/{puff-list-item/puff-list-item-header.d.ts → puff-list-item-header.d.ts} +1 -1
- package/components/puff-list/puff-list-item-header.js +12 -0
- package/components/puff-list/{puff-list-item/puff-list-item-info.d.ts → puff-list-item-info.d.ts} +1 -2
- package/components/puff-list/puff-list-item-info.js +8 -0
- package/components/puff-list/{puff-list-item/puff-list-item.d.ts → puff-list-item.d.ts} +0 -1
- package/components/puff-list/{puff-list-item/puff-list-item.js → puff-list-item.js} +3 -3
- package/components/puff-list/puff-list.js +2 -3
- package/components/region-icon/region-icon.js +2 -2
- package/components/side-menu/side-menu-base.d.ts +22 -0
- package/components/side-menu/side-menu-base.js +42 -0
- package/components/side-menu/side-menu.d.ts +6 -9
- package/components/side-menu/side-menu.js +13 -43
- package/components/side-panel/side-panel-base.d.ts +24 -0
- package/components/side-panel/side-panel-base.js +33 -0
- package/components/side-panel/side-panel-provider.d.ts +7 -0
- package/components/side-panel/side-panel-provider.js +12 -0
- package/components/side-panel/side-panel.d.ts +14 -15
- package/components/side-panel/side-panel.js +49 -54
- package/components/stepper/step-base.d.ts +15 -0
- package/components/stepper/step-base.js +36 -0
- package/components/stepper/step.d.ts +5 -8
- package/components/stepper/step.js +17 -33
- package/components/stepper/stepper.d.ts +4 -6
- package/components/stepper/stepper.js +8 -13
- package/components/tabs/tab-link.d.ts +15 -0
- package/components/tabs/tab-link.js +10 -0
- package/components/tabs/tab-panel.d.ts +2 -4
- package/components/tabs/tab-panel.js +5 -12
- package/components/tabs/tab.d.ts +5 -5
- package/components/tabs/tab.js +5 -8
- package/components/tabs/tabs-base.d.ts +15 -0
- package/components/tabs/tabs-base.js +15 -0
- package/components/tabs/tabs.d.ts +5 -8
- package/components/tabs/tabs.js +38 -51
- package/components/tag/tag.d.ts +5 -15
- package/components/tag/tag.js +3 -8
- package/components/tooltip/tooltip-base.d.ts +14 -0
- package/components/tooltip/tooltip-base.js +18 -0
- package/components/tooltip/tooltip.d.ts +3 -10
- package/components/tooltip/tooltip.js +59 -43
- package/components/utils/contexts/HeaderContext.d.ts +1 -0
- package/index.d.ts +90 -16
- package/index.js +90 -16
- package/package.json +2 -2
- package/components/box-link/box-link.d.ts +0 -9
- package/components/box-link/box-link.js +0 -11
- package/components/global-alert/global-alert.d.ts +0 -16
- package/components/global-alert/global-alert.js +0 -26
- package/components/mobile/menu/item/mobile-item.d.ts +0 -15
- package/components/mobile/menu/item/mobile-item.js +0 -61
- package/components/mobile/menu/mobile-menu.d.ts +0 -7
- package/components/mobile/menu/mobile-menu.js +0 -12
- package/components/notification/badge/notification-badge.js +0 -9
- package/components/pagination/data-pagination/data-pagination.js +0 -16
- package/components/puff-list/puff-list-item/puff-list-item-header.js +0 -11
- package/components/puff-list/puff-list-item/puff-list-item-info.js +0 -10
- package/components/utils/hooks/useElementId.d.ts +0 -5
- package/components/utils/hooks/useElementId.js +0 -12
- /package/components/{button-group → button}/button-group.d.ts +0 -0
- /package/components/{action-link → link}/action-link.d.ts +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import '@inera/ids-design/components/pagination/list-pagination/list-pagination.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/list-pagination/list-pagination.css';
|
|
4
5
|
|
|
5
|
-
function IDSListPagination({ showing = "Visar", from = 0, to = 0, of = "av", total = 0, current = 1, pages = 1, srCurrentPage = "Aktuell sida", srGoToPage = "Gå till sida", srPrevious = "Föregående sida", srNext = "Nästa sida", onChangePage, onPrevPage, onNextPage, className, ...props }) {
|
|
6
|
+
function IDSListPagination({ showing = "Visar", from = 0, to = 0, of = "av", total = 0, current = 1, pages = 1, srCurrentPage = "Aktuell sida", srGoToPage = "Gå till sida", srPrevious = "Föregående sida", srNext = "Nästa sida", srNav = "Paginering", onChangePage, onPrevPage, onNextPage, className, ...props }) {
|
|
6
7
|
const renderSummary = () => {
|
|
7
8
|
if (from && to && total) {
|
|
8
9
|
return jsx("div", { className: "ids-list-pagination__summary", children: `${showing} ${from} - ${to} ${of} ${total}` });
|
|
@@ -40,7 +41,7 @@ function IDSListPagination({ showing = "Visar", from = 0, to = 0, of = "av", tot
|
|
|
40
41
|
"ids-list-pagination__button--current": isCurrent
|
|
41
42
|
}), "aria-label": isCurrent ? srCurrentPage : `${srGoToPage} ${i}`, onClick: () => !isCurrent && onChangePage?.(i), disabled: isCurrent, children: i }) }, i));
|
|
42
43
|
}
|
|
43
|
-
return (jsx("nav", { children: jsx("ul", { className: "ids-list-pagination__list", children: buttonArray }) }));
|
|
44
|
+
return (jsx("nav", { "aria-label": srNav, children: jsx("ul", { className: "ids-list-pagination__list", children: buttonArray }) }));
|
|
44
45
|
};
|
|
45
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() })] })] }));
|
|
46
47
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface IDSMobileMenuItemBaseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
level?: number;
|
|
4
|
+
secondary?: boolean;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
headline?: string;
|
|
7
|
+
link?: ReactNode;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
showText?: string;
|
|
10
|
+
hideText?: string;
|
|
11
|
+
onToggleMenu?: () => void;
|
|
12
|
+
client?: boolean;
|
|
13
|
+
}
|
|
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;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
function IDSMobileMenuItemBase({ level = 1, secondary = false, expanded = false, headline = "", link, active = false, showText = "Expandera", hideText = "Minimera", onToggleMenu, className, children, client = false, ...props }) {
|
|
6
|
+
const subItemId = `mobile-menu-sub-item-${useId()}`;
|
|
7
|
+
const toggleHandler = client && onToggleMenu
|
|
8
|
+
? {
|
|
9
|
+
onClick: onToggleMenu
|
|
10
|
+
}
|
|
11
|
+
: {};
|
|
12
|
+
const getItemLevelClass = () => {
|
|
13
|
+
switch (level) {
|
|
14
|
+
case 2:
|
|
15
|
+
return "ids-mobile-menu-item--2";
|
|
16
|
+
case 3:
|
|
17
|
+
return "ids-mobile-menu-item--3";
|
|
18
|
+
default:
|
|
19
|
+
return "ids-mobile-menu-item";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const renderItem = () => {
|
|
23
|
+
const commonProps = {
|
|
24
|
+
"aria-label": expanded ? hideText : showText,
|
|
25
|
+
"aria-expanded": expanded,
|
|
26
|
+
"aria-controls": subItemId,
|
|
27
|
+
className: clsx("ids-mobile-menu-item__expand-btn", !!level && `ids-mobile-menu-item__expand-btn--level-${level}`, {
|
|
28
|
+
"ids-mobile-menu-item__expand-btn--headline": headline,
|
|
29
|
+
"ids-mobile-menu__chevron--expanded": expanded
|
|
30
|
+
}),
|
|
31
|
+
...toggleHandler
|
|
32
|
+
};
|
|
33
|
+
if (headline) {
|
|
34
|
+
return jsx("button", { ...commonProps, children: headline });
|
|
35
|
+
}
|
|
36
|
+
else if (link && !!children) {
|
|
37
|
+
return (jsxs(Fragment, { children: [link, jsx("button", { ...commonProps })] }));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return link;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
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
|
+
}
|
|
45
|
+
|
|
46
|
+
export { IDSMobileMenuItemBase };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IDSMobileMenuItemBase } from "./mobile-item-base";
|
|
3
|
+
export interface IDSMobileMenuItemProps extends Omit<React.ComponentProps<typeof IDSMobileMenuItemBase>, "subItemId" | "onToggleMenu"> {
|
|
4
|
+
onToggleMenu?: (isExpanded: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function IDSMobileMenuItem({ expanded, level, onToggleMenu, className, children, ...rest }: IDSMobileMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
4
|
+
import { IDSMobileMenuItemBase } from './mobile-item-base.js';
|
|
5
|
+
|
|
6
|
+
function IDSMobileMenuItem({ expanded = false, level = 1, onToggleMenu, className, children, ...rest }) {
|
|
7
|
+
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setIsExpanded(expanded);
|
|
10
|
+
}, [expanded]);
|
|
11
|
+
const handleToggleMenu = () => {
|
|
12
|
+
if (!!children || rest.headline) {
|
|
13
|
+
const newValue = !isExpanded;
|
|
14
|
+
setIsExpanded(newValue);
|
|
15
|
+
onToggleMenu?.(newValue);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return (jsx(IDSMobileMenuItemBase, { ...rest, client: true, className: className, level: level, expanded: isExpanded, onToggleMenu: handleToggleMenu, children: React.Children.map(children, child => React.isValidElement(child)
|
|
19
|
+
? React.cloneElement(child, {
|
|
20
|
+
"data-ids-sub-item": true,
|
|
21
|
+
level: level + 1
|
|
22
|
+
})
|
|
23
|
+
: child) }));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { IDSMobileMenuItem };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import "@inera/ids-design/components/mobile-menu/mobile-menu.css";
|
|
3
|
+
export interface IDSMobileMenuProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
variation?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function IDSMobileMenu({ variation, children, className, ...props }: IDSMobileMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '@inera/ids-design/components/mobile-menu/mobile-menu.css';
|
|
4
|
+
|
|
5
|
+
function IDSMobileMenu({ variation = 1, children, className, ...props }) {
|
|
6
|
+
const menuClass = clsx("ids-mobile-menu", variation === 2 && "ids-mobile-menu--variation-2", className);
|
|
7
|
+
return (jsx("div", { className: menuClass, ...props, children: children }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { IDSMobileMenu };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import "@inera/ids-design/components/navigation
|
|
2
|
+
import "@inera/ids-design/components/navigation-content/navigation-content.css";
|
|
3
3
|
export interface IDSNavigationContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
headline?: string;
|
|
5
5
|
maxHeight?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import '@inera/ids-design/components/navigation/content/navigation-content.css';
|
|
4
3
|
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/navigation-content/navigation-content.css';
|
|
5
5
|
|
|
6
6
|
function IDSNavigationContent({ headline = "", maxHeight = "", className, children, ...props }) {
|
|
7
7
|
const linkWrappers = React.Children.map(children, (link, i) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import "@inera/ids-design/components/navigation
|
|
2
|
+
import "@inera/ids-design/components/navigation-local/navigation-local.css";
|
|
3
3
|
export interface IDSNavigationLocalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
headline?: string;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import '@inera/ids-design/components/navigation/local/navigation-local.css';
|
|
3
2
|
import clsx from 'clsx';
|
|
3
|
+
import '@inera/ids-design/components/navigation-local/navigation-local.css';
|
|
4
4
|
|
|
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 })] }));
|
|
@@ -5,5 +5,5 @@ interface IDSNotificationBadgeProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
5
5
|
icon?: string;
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function IDSNotificationBadge({ type, icon,
|
|
8
|
+
export declare function IDSNotificationBadge({ type, icon, className, children, ...props }: IDSNotificationBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '@inera/ids-design/components/notification-badge/notification-badge.css';
|
|
4
|
+
|
|
5
|
+
function IDSNotificationBadge({ type = "primary", icon = "", className, children, ...props }) {
|
|
6
|
+
return (jsxs("div", { className: clsx("ids-notification-badge", `ids-notification-badge--${type}`, className), ...props, children: [icon && jsx("span", { className: `ids-icon-${icon}`, "aria-hidden": "true" }), children] }));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { IDSNotificationBadge };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/popover/popover.css";
|
|
3
|
+
import React from "react";
|
|
4
|
+
interface IDSPopoverBaseProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
trigger: ReactNode;
|
|
6
|
+
triggerRef?: React.Ref<HTMLSpanElement>;
|
|
7
|
+
togglePopover?: () => void;
|
|
8
|
+
handleKeyPress?: (e: React.KeyboardEvent<HTMLSpanElement>) => void;
|
|
9
|
+
expanded: boolean;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
client?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function IDSPopoverBase({ trigger, triggerRef, togglePopover, handleKeyPress, client, expanded, className, children, ...props }: IDSPopoverBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import React, { useId } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/popover/popover.css';
|
|
5
|
+
|
|
6
|
+
function IDSPopoverBase({ trigger, triggerRef, togglePopover, handleKeyPress, client, expanded = false, className, children, ...props }) {
|
|
7
|
+
const triggerId = `popover-trigger-${useId()}`;
|
|
8
|
+
const triggerHandlers = client && togglePopover
|
|
9
|
+
? {
|
|
10
|
+
onClick: togglePopover,
|
|
11
|
+
onKeyDown: handleKeyPress
|
|
12
|
+
}
|
|
13
|
+
: {};
|
|
14
|
+
const enhancedTrigger = React.isValidElement(trigger)
|
|
15
|
+
? React.cloneElement(trigger, {
|
|
16
|
+
ref: triggerRef,
|
|
17
|
+
id: triggerId,
|
|
18
|
+
"aria-expanded": expanded,
|
|
19
|
+
"aria-haspopup": "dialog",
|
|
20
|
+
...triggerHandlers,
|
|
21
|
+
...trigger.props
|
|
22
|
+
})
|
|
23
|
+
: trigger;
|
|
24
|
+
return (jsxs("span", { ...props, className: clsx("ids-popover", className), children: [enhancedTrigger, expanded && children] }));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { IDSPopoverBase };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactNode, CSSProperties } from "react";
|
|
2
|
+
import "@inera/ids-design/components/popover/popover.css";
|
|
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
|
+
interface IDSPopoverContentProps {
|
|
5
|
+
position?: PopoverPosition;
|
|
6
|
+
headline?: ReactNode;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
contentScrollAreaStyle?: CSSProperties;
|
|
9
|
+
noFocusTrap?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
srCloseText?: string;
|
|
12
|
+
closePopover?: () => void;
|
|
13
|
+
contentRef?: React.Ref<HTMLDivElement>;
|
|
14
|
+
scrollAreaRef?: React.Ref<HTMLDivElement>;
|
|
15
|
+
noScrollAreaFocus?: boolean;
|
|
16
|
+
client?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const IDSPopoverContent: React.ForwardRefExoticComponent<IDSPopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useId } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/popover/popover.css';
|
|
5
|
+
|
|
6
|
+
const IDSPopoverContent = forwardRef(({ position = "bottom", srCloseText = "Stäng", headline, contentScrollAreaStyle, noFocusTrap = false, noScrollAreaFocus = false, contentRef, scrollAreaRef, closePopover, client, children }, ref) => {
|
|
7
|
+
const contentId = `popover-content-${useId()}`;
|
|
8
|
+
const closeHandler = client && closePopover
|
|
9
|
+
? {
|
|
10
|
+
onClick: closePopover
|
|
11
|
+
}
|
|
12
|
+
: {};
|
|
13
|
+
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}`, {
|
|
15
|
+
"ids-focus-trap": !noFocusTrap
|
|
16
|
+
}), role: "tooltip", id: contentId, "data-position": position, children: [renderCaret(position), jsx("div", { className: "ids-popover-content__close-btn-wrapper", children: jsx("button", { "aria-label": srCloseText, className: "ids-popover-content__close-btn", ...closeHandler }) }), 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] }) })] }));
|
|
17
|
+
});
|
|
18
|
+
IDSPopoverContent.displayName = "IDSPopoverContent";
|
|
19
|
+
|
|
20
|
+
export { IDSPopoverContent };
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import "
|
|
3
|
-
import "@inera/ids-design/components/popover/popover-content.css";
|
|
4
|
-
export type PopoverPosition = "top" | "top-left" | "top-right" | "right" | "right-top" | "right-bottom" | "bottom" | "bottom-left" | "bottom-right" | "left" | "left-top" | "left-bottom";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PopoverPosition } from "./popover-content";
|
|
5
3
|
interface IDSPopoverProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
4
|
position?: PopoverPosition;
|
|
7
5
|
category?: string;
|
|
8
|
-
trigger: ReactNode;
|
|
6
|
+
trigger: React.ReactNode;
|
|
9
7
|
maxWidth?: number;
|
|
10
8
|
maxHeight?: number;
|
|
11
9
|
show?: boolean;
|
|
12
10
|
noFocusTrap?: boolean;
|
|
13
11
|
autoFocus?: boolean;
|
|
14
12
|
srCloseText?: string;
|
|
13
|
+
noScrollAreaFocus?: boolean;
|
|
15
14
|
onVisibilityChange?: (isVisible: boolean) => void;
|
|
16
|
-
headline?: ReactNode;
|
|
17
|
-
children?: ReactNode;
|
|
15
|
+
headline?: React.ReactNode;
|
|
16
|
+
children?: React.ReactNode;
|
|
18
17
|
}
|
|
19
|
-
export declare
|
|
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;
|
|
20
19
|
export {};
|
|
@@ -1,87 +1,84 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import '
|
|
5
|
-
import '@inera/ids-design/components/popover/popover-content.css';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { IDSPopoverBase } from './popover-base.js';
|
|
6
5
|
import { useFocusTrap } from '../utils/hooks/useFocusTrap.js';
|
|
7
|
-
import
|
|
8
|
-
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
6
|
+
import { IDSPopoverContent } from './popover-content.js';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
const contentId = useElementId();
|
|
12
|
-
const [isVisible, setIsVisible] = useState(show);
|
|
13
|
-
const [popoverContentStyle, setPopoverContentStyle] = useState({
|
|
14
|
-
position: "absolute",
|
|
15
|
-
maxWidth: `${maxWidth}px`,
|
|
16
|
-
maxHeight: `${maxHeight}px`,
|
|
17
|
-
boxSizing: "initial"
|
|
18
|
-
});
|
|
19
|
-
const [popoverContentWrapperStyle, setPopoverContentWrapperStyle] = useState({
|
|
20
|
-
height: "100%"
|
|
21
|
-
});
|
|
8
|
+
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 }) {
|
|
22
9
|
const popoverRef = useRef(null);
|
|
23
10
|
const triggerRef = useRef(null);
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
const contentRef = useRef(null);
|
|
12
|
+
const scrollAreaRef = useRef(null);
|
|
13
|
+
const [isExpanded, setIsExpanded] = useState(show);
|
|
14
|
+
const [contentScrollAreaStyle, setPopoverScrollAreaStyle] = useState({ height: "100%" });
|
|
15
|
+
useFocusTrap(contentRef.current, isExpanded && !noFocusTrap);
|
|
16
|
+
const handleVisibilityChange = (visible) => {
|
|
17
|
+
setIsExpanded(visible);
|
|
18
|
+
onVisibilityChange?.(visible);
|
|
30
19
|
};
|
|
31
20
|
const closePopover = useCallback(() => {
|
|
32
21
|
handleVisibilityChange(false);
|
|
33
22
|
triggerRef.current?.focus();
|
|
34
23
|
}, []);
|
|
24
|
+
const togglePopover = () => (isExpanded ? closePopover() : handleVisibilityChange(true));
|
|
25
|
+
const handleKeyPress = (e) => {
|
|
26
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
togglePopover();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
35
31
|
useEffect(() => {
|
|
36
|
-
|
|
37
|
-
if (!wrapper)
|
|
32
|
+
if (!isExpanded)
|
|
38
33
|
return;
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, [closePopover]);
|
|
54
|
-
const showPopover = useCallback(() => {
|
|
55
|
-
if (category) {
|
|
56
|
-
const others = document.querySelectorAll(`[data-popover-category="${category}"]`);
|
|
57
|
-
others.forEach(el => {
|
|
58
|
-
if (el !== popoverRef.current) {
|
|
59
|
-
el.removeAttribute("data-show");
|
|
60
|
-
}
|
|
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`
|
|
61
48
|
});
|
|
62
49
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
isVisible ? closePopover() : showPopover();
|
|
68
|
-
};
|
|
69
|
-
const handleEsc = (e) => {
|
|
70
|
-
if (e.key === "Escape" && isVisible) {
|
|
71
|
-
closePopover();
|
|
50
|
+
else {
|
|
51
|
+
setPopoverScrollAreaStyle({
|
|
52
|
+
height: "100%"
|
|
53
|
+
});
|
|
72
54
|
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
55
|
+
}, [scrollAreaRef, isExpanded, maxHeight]);
|
|
56
|
+
// Send events if you have a category and open the popup
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!category || !isExpanded)
|
|
59
|
+
return;
|
|
60
|
+
const event = new CustomEvent("ids-popover-toggle", {
|
|
61
|
+
detail: { category, source: popoverRef.current }
|
|
62
|
+
});
|
|
63
|
+
window.dispatchEvent(event);
|
|
64
|
+
}, [isExpanded, category]);
|
|
65
|
+
// Listen for other popovers opening in same category
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
const handleOtherPopoverToggle = (e) => {
|
|
68
|
+
if (e.detail.category !== category)
|
|
69
|
+
return;
|
|
70
|
+
if (e.detail.source !== popoverRef.current) {
|
|
71
|
+
setIsExpanded(false);
|
|
79
72
|
}
|
|
80
|
-
}
|
|
81
|
-
|
|
73
|
+
};
|
|
74
|
+
window.addEventListener("ids-popover-toggle", handleOtherPopoverToggle);
|
|
75
|
+
return () => {
|
|
76
|
+
window.removeEventListener("ids-popover-toggle", handleOtherPopoverToggle);
|
|
77
|
+
};
|
|
78
|
+
}, [category]);
|
|
82
79
|
useEffect(() => {
|
|
83
|
-
if (
|
|
84
|
-
const wrapper =
|
|
80
|
+
if (isExpanded && autoFocus) {
|
|
81
|
+
const wrapper = scrollAreaRef.current;
|
|
85
82
|
const focusAnchor = wrapper.querySelector(".ids-focus-anchor");
|
|
86
83
|
if (focusAnchor) {
|
|
87
84
|
focusAnchor.focus();
|
|
@@ -96,99 +93,8 @@ const IDSPopover = ({ position = "bottom", category = "", trigger, maxWidth = 26
|
|
|
96
93
|
wrapper.focus();
|
|
97
94
|
}
|
|
98
95
|
}
|
|
99
|
-
}, [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return;
|
|
103
|
-
document.addEventListener("keydown", handleEsc);
|
|
104
|
-
return () => document.removeEventListener("keydown", handleEsc);
|
|
105
|
-
}, [isVisible]);
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
if (contentWrapperRef.current) {
|
|
108
|
-
const contentWrapperHeight = contentWrapperRef.current.getBoundingClientRect().height;
|
|
109
|
-
if (contentWrapperHeight >= maxHeight - 40) {
|
|
110
|
-
setPopoverContentWrapperStyle({
|
|
111
|
-
height: `${maxHeight - 40}px`,
|
|
112
|
-
paddingRight: "1rem"
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
setPopoverContentWrapperStyle({
|
|
117
|
-
height: "100%",
|
|
118
|
-
paddingRight: "0.25rem"
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}, [contentWrapperRef, isVisible]);
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
const content = popoverContentRef?.current;
|
|
125
|
-
if (!content)
|
|
126
|
-
return;
|
|
127
|
-
const width = content.offsetWidth;
|
|
128
|
-
const height = content.offsetHeight;
|
|
129
|
-
const triggerWidth = triggerRef.current.offsetWidth;
|
|
130
|
-
const triggerHeight = triggerRef.current.offsetHeight;
|
|
131
|
-
let top, left, right, bottom;
|
|
132
|
-
if (position === "top") {
|
|
133
|
-
left = `-${width / 2 - triggerWidth / 2}px`;
|
|
134
|
-
bottom = `calc(100% + 0.875rem)`;
|
|
135
|
-
}
|
|
136
|
-
if (position === "top-right") {
|
|
137
|
-
right = "0";
|
|
138
|
-
bottom = `calc(100% + 0.875rem)`;
|
|
139
|
-
}
|
|
140
|
-
if (position === "top-left") {
|
|
141
|
-
left = "0";
|
|
142
|
-
bottom = `calc(100% + 0.875rem)`;
|
|
143
|
-
}
|
|
144
|
-
if (position === "right") {
|
|
145
|
-
left = `calc(100% + 0.875rem)`;
|
|
146
|
-
top = `-${height / 2 - triggerHeight / 2}px`;
|
|
147
|
-
}
|
|
148
|
-
if (position === "right-top") {
|
|
149
|
-
left = `calc(100% + 0.875rem)`;
|
|
150
|
-
bottom = "0";
|
|
151
|
-
}
|
|
152
|
-
if (position === "right-bottom") {
|
|
153
|
-
left = `calc(100% + 0.875rem)`;
|
|
154
|
-
top = "0";
|
|
155
|
-
}
|
|
156
|
-
if (position === "bottom") {
|
|
157
|
-
left = `-${width / 2 - triggerWidth / 2}px`;
|
|
158
|
-
top = `calc(100% + 0.875rem)`;
|
|
159
|
-
}
|
|
160
|
-
if (position === "bottom-right") {
|
|
161
|
-
right = "0";
|
|
162
|
-
top = `calc(100% + 0.875rem)`;
|
|
163
|
-
}
|
|
164
|
-
if (position === "bottom-left") {
|
|
165
|
-
left = `-8px`;
|
|
166
|
-
top = `calc(100% + 0.875rem)`;
|
|
167
|
-
}
|
|
168
|
-
if (position === "left") {
|
|
169
|
-
right = `calc(100% + 0.875rem)`;
|
|
170
|
-
top = `-${height / 2 - triggerHeight / 2}px`;
|
|
171
|
-
}
|
|
172
|
-
if (position === "left-top") {
|
|
173
|
-
right = `calc(100% + 0.875rem)`;
|
|
174
|
-
bottom = "0";
|
|
175
|
-
}
|
|
176
|
-
if (position === "left-bottom") {
|
|
177
|
-
right = `calc(100% + 0.875rem)`;
|
|
178
|
-
top = "0";
|
|
179
|
-
}
|
|
180
|
-
setPopoverContentStyle(prev => ({
|
|
181
|
-
...prev,
|
|
182
|
-
top: top ?? undefined,
|
|
183
|
-
left: left ?? undefined,
|
|
184
|
-
right: right ?? undefined,
|
|
185
|
-
bottom: bottom ?? undefined
|
|
186
|
-
}));
|
|
187
|
-
}, [position, isVisible]);
|
|
188
|
-
const renderCaret = (pos) => {
|
|
189
|
-
return (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}` })] }));
|
|
190
|
-
};
|
|
191
|
-
return (jsxs("span", { className: clsx("ids-popover", className), ref: popoverRef, "data-popover-category": category, ...(isVisible && { "data-show": "true" }), ...props, children: [jsx("span", { className: "ids-popover-trigger", "aria-haspopup": "dialog", onClick: togglePopover, onKeyDown: handleTriggerKeyDown, ref: triggerRef, children: trigger }), isVisible && (jsxs("div", { className: `ids-popover-content ${!noFocusTrap && "ids-focus-trap"}`, role: "tooltip", id: contentId, ref: popoverContentRef, style: popoverContentStyle, "data-position": position, children: [renderCaret(position), jsx("div", { className: "ids-popover-content__close-btn-wrapper", children: jsx("button", { "aria-label": srCloseText, className: "ids-popover-content__close-btn", onClick: closePopover }) }), jsx("div", { className: "ids-popover-content__content-wrapper", tabIndex: 0, ref: contentWrapperRef, style: popoverContentWrapperStyle, children: jsxs("div", { className: "ids-popover-content__content-wrapper-inner", children: [headline && jsx("div", { className: "ids-popover-content__headline", children: headline }), children] }) })] }))] }));
|
|
192
|
-
};
|
|
96
|
+
}, [isExpanded, autoFocus]);
|
|
97
|
+
return (jsx("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, children: jsx(IDSPopoverContent, { client: true, contentRef: contentRef, scrollAreaRef: scrollAreaRef, noScrollAreaFocus: noScrollAreaFocus, position: position, srCloseText: srCloseText, closePopover: closePopover, contentScrollAreaStyle: contentScrollAreaStyle, noFocusTrap: noFocusTrap, children: children }) }) }));
|
|
98
|
+
}
|
|
193
99
|
|
|
194
100
|
export { IDSPopover };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import '@inera/ids-design/components/progressbar/progressbar.css';
|
|
3
2
|
import clsx from 'clsx';
|
|
3
|
+
import '@inera/ids-design/components/progressbar/progressbar.css';
|
|
4
4
|
|
|
5
5
|
function IDSProgressbar({ label = "", hideLabel = false, value = 0, srLabel = "", className, ...props }) {
|
|
6
|
-
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", "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)` } }) })] }));
|
|
6
|
+
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
7
|
}
|
|
8
8
|
IDSProgressbar.displayName = "IDSProgressbar";
|
|
9
9
|
|
package/components/puff-list/{puff-list-item/puff-list-item-date.js → puff-list-item-date.js}
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import '
|
|
3
|
-
import { getDayAsText, getMonthAsSweText } from '../../utils/utils.js';
|
|
2
|
+
import { getDayAsText, getMonthAsSweText } from '../utils/utils.js';
|
|
4
3
|
|
|
5
4
|
function IDSPuffListItemDate({ date, showTime = false, day = 0, year = 0, month = 0, monthLabel = "", time = "", ...props }) {
|
|
6
5
|
const getDay = () => getDayAsText(date ? date.getDate() : day);
|
|
@@ -17,7 +16,7 @@ function IDSPuffListItemDate({ date, showTime = false, day = 0, year = 0, month
|
|
|
17
16
|
}
|
|
18
17
|
return "";
|
|
19
18
|
};
|
|
20
|
-
return (jsxs("span", { className: "ids-puff-list-item__date",
|
|
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() })] }));
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
export { IDSPuffListItemDate };
|
|
@@ -4,7 +4,7 @@ export interface IDSPuffListItemHeaderProps extends React.HTMLAttributes<HTMLHea
|
|
|
4
4
|
headlineExtra?: ReactNode;
|
|
5
5
|
noMargin?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function IDSPuffListItemHeader({ headlineLevel, headlineExtra, noMargin,
|
|
7
|
+
export declare function IDSPuffListItemHeader({ headlineLevel, headlineExtra, noMargin, children, ...props }: IDSPuffListItemHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare namespace IDSPuffListItemHeader {
|
|
9
9
|
var displayName: string;
|
|
10
10
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
|
|
4
|
+
function IDSPuffListItemHeader({ headlineLevel = 2, headlineExtra, noMargin = false, children, ...props }) {
|
|
5
|
+
const Tag = `h${headlineLevel}`;
|
|
6
|
+
return (jsxs(Tag, { ...props, className: clsx("ids-puff-list-item-header__headline", {
|
|
7
|
+
"ids-puff-list-item-header__headline--no-margin": noMargin
|
|
8
|
+
}), children: [children, headlineExtra && jsx("span", { className: "ids-puff-list-item-header__extra-content", children: headlineExtra })] }));
|
|
9
|
+
}
|
|
10
|
+
IDSPuffListItemHeader.displayName = "IDSPuffListItemHeader";
|
|
11
|
+
|
|
12
|
+
export { IDSPuffListItemHeader };
|