@inera/ids-react 8.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion-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 -40
- 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 +36 -0
- package/components/form/datepicker/datepicker.js +217 -0
- 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 -19
- 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.d.ts +1 -0
- package/components/grid/container.js +9 -5
- 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/link/action-link.d.ts +6 -0
- package/components/link/action-link.js +9 -0
- 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 +2 -2
- 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 -2
- package/components/puff-list/{puff-list-item/puff-list-item.js → puff-list-item.js} +2 -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/components/utils/hooks/useFocusTrap.js +1 -1
- package/index.d.ts +91 -15
- package/index.js +91 -15
- 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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/data-pagination/data-pagination.css';
|
|
5
|
+
|
|
6
|
+
const IDSDataPagination = forwardRef(({ from, to, of = "av", total, defaultValue = "", firstPageButton, previousButton, nextButton, lastPageButton, light = false, className, children, ...props }, ref) => {
|
|
7
|
+
const summaryText = `${from} - ${to} ${of} ${total}`;
|
|
8
|
+
return (jsxs("div", { className: clsx("ids-data-pagination", { "ids-data-pagination--light": light }, className), ...props, children: [!!children && jsx("div", { className: "ids-data-pagination__select", children: children }), jsx("div", { className: "ids-data-pagination__summary", children: summaryText }), jsxs("div", { className: "ids-data-pagination__buttons", children: [firstPageButton && jsx("div", { className: "ids-data-pagination__first-page-button", children: firstPageButton }), previousButton && jsx("div", { className: "ids-data-pagination__prev-button", children: previousButton }), nextButton && jsx("div", { className: "ids-data-pagination__next-button", children: nextButton }), lastPageButton && jsx("div", { className: "ids-data-pagination__last-page-button", children: lastPageButton })] })] }));
|
|
9
|
+
});
|
|
10
|
+
IDSDataPagination.displayName = "IDSDataPagination";
|
|
11
|
+
|
|
12
|
+
export { IDSDataPagination };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import '@inera/ids-design/components/date-label/date-label.css';
|
|
3
2
|
import { getDayAsText, getMonthAsSweText } from '../utils/utils.js';
|
|
4
3
|
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/date-label/date-label.css';
|
|
5
5
|
|
|
6
6
|
function IDSDateLabel({ date = null, year = 0, month = 0, day = 0, monthLabel = "", dateTo = null, yearTo = 0, monthTo = 0, monthToLabel = "", srText = "", dayTo = 0, children, className, ...props }) {
|
|
7
7
|
const getYear = () => (date ? date.getFullYear() : year);
|
|
@@ -12,7 +12,7 @@ function IDSDateLabel({ date = null, year = 0, month = 0, day = 0, monthLabel =
|
|
|
12
12
|
const getDayTo = () => (dateTo ? getDayAsText(dateTo.getDate()) : getDayAsText(dayTo));
|
|
13
13
|
const getMonthText = () => (monthLabel ? monthLabel : getMonthAsSweText(getMonth() - 1, 3));
|
|
14
14
|
const getMonthToText = () => (monthToLabel ? monthToLabel : getMonthAsSweText(getMonthTo() - 1, 3));
|
|
15
|
-
return (jsxs("span", { className: clsx("ids-date-label", className), "aria-label": srText,
|
|
15
|
+
return (jsxs("span", { ...props, className: clsx("ids-date-label", className), "aria-label": srText, role: "text", children: [jsxs("time", { className: "ids-date-label__time", "aria-hidden": "true", children: [jsx("span", { className: "ids-date-label__day", children: getDay() }), jsx("span", { className: "ids-date-label__month", children: getMonthText() }), jsx("span", { className: "ids-date-label__year", children: getYear() })] }), !!(dateTo || (dayTo && monthTo && yearTo)) && (jsxs("time", { className: "ids-date-label__time ids-date-label__time--separator", "aria-hidden": "true", children: [jsx("span", { className: "ids-date-label__day", children: getDayTo() }), jsx("span", { className: "ids-date-label__month", children: getMonthToText() }), jsx("span", { className: "ids-date-label__year", children: getYearTo() })] }))] }));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export { IDSDateLabel };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from "react";
|
|
2
|
+
import "@inera/ids-design/components/dialog/dialog.css";
|
|
3
|
+
export interface IDSDialogBaseProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
show?: boolean;
|
|
5
|
+
noFocusTrap?: boolean;
|
|
6
|
+
width?: string;
|
|
7
|
+
maxWidth?: string;
|
|
8
|
+
height?: string;
|
|
9
|
+
headline?: ReactNode;
|
|
10
|
+
onCloseDialog?: () => void;
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
srClose?: string;
|
|
14
|
+
noScrollAreaFocus?: boolean;
|
|
15
|
+
noOverlay?: boolean;
|
|
16
|
+
dialogRef?: React.Ref<HTMLDivElement>;
|
|
17
|
+
scrollAreaRef?: React.Ref<HTMLDivElement>;
|
|
18
|
+
onOverlayClick?: () => void;
|
|
19
|
+
client?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const IDSDialogBase: import("react").ForwardRefExoticComponent<IDSDialogBaseProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useId } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/dialog/dialog.css';
|
|
5
|
+
|
|
6
|
+
const IDSDialogBase = forwardRef(({ show = false, width, maxWidth, height, headline, actions, dismissible, onCloseDialog, srClose = "Stäng", noScrollAreaFocus, noOverlay = false, noFocusTrap = false, dialogRef, scrollAreaRef, onOverlayClick, client = false, children, className, ...props }, ref) => {
|
|
7
|
+
const reactId = useId();
|
|
8
|
+
const headlineId = `dialog-header-${reactId}`;
|
|
9
|
+
const overlayHandler = client && onOverlayClick
|
|
10
|
+
? {
|
|
11
|
+
onClick: onOverlayClick
|
|
12
|
+
}
|
|
13
|
+
: {};
|
|
14
|
+
const closeHandler = client && onCloseDialog
|
|
15
|
+
? {
|
|
16
|
+
onClick: onCloseDialog
|
|
17
|
+
}
|
|
18
|
+
: {};
|
|
19
|
+
return (jsxs(Fragment, { children: [!noOverlay && (jsx("div", { className: `ids-dialog-overlay ${!show ? "ids-dialog-overlay--hidden" : ""}`, ...overlayHandler })), jsxs("div", { ...props, className: clsx("ids-dialog", {
|
|
20
|
+
"ids-dialog--hidden": !show,
|
|
21
|
+
"ids-focus-trap": !noFocusTrap,
|
|
22
|
+
"ids-dialog--dismissible": !!dismissible
|
|
23
|
+
}), ref: dialogRef, role: "dialog", "aria-modal": "true", "aria-labelledby": headline ? headlineId : undefined, style: { width, maxWidth, height, maxHeight: height || undefined }, children: [dismissible && (jsx("div", { className: "ids-dialog__dismissible", children: jsx("button", { "aria-label": srClose, ...closeHandler, className: "ids-dialog__close-button" }) })), jsxs("div", { ref: scrollAreaRef, className: clsx("ids-dialog__body", {
|
|
24
|
+
"ids-dialog__body--scroll-area-focus": !noScrollAreaFocus
|
|
25
|
+
}), tabIndex: noScrollAreaFocus ? -1 : 0, children: [jsx("div", { className: "ids-dialog__body-headline", id: headlineId, children: headline }), jsx("div", { className: "ids-dialog__body-content", children: children }), actions && jsx("div", { className: "ids-dialog__footer", children: actions })] })] })] }));
|
|
26
|
+
});
|
|
27
|
+
IDSDialogBase.displayName = "IDSDialogBase";
|
|
28
|
+
|
|
29
|
+
export { IDSDialogBase };
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
autoFocus?: boolean;
|
|
6
|
-
dismissible?: boolean;
|
|
1
|
+
import { ReactNode, HTMLAttributes } from "react";
|
|
2
|
+
export interface IDSDialogProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
show?: boolean;
|
|
4
|
+
srClose?: string;
|
|
7
5
|
headline?: ReactNode;
|
|
8
|
-
|
|
9
|
-
keepScrollbar?: boolean;
|
|
6
|
+
width?: string;
|
|
10
7
|
maxWidth?: string;
|
|
11
|
-
|
|
8
|
+
height?: string;
|
|
9
|
+
trigger?: ReactNode;
|
|
10
|
+
dismissible?: boolean;
|
|
12
11
|
noOverlay?: boolean;
|
|
13
|
-
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
autoFocus?: boolean;
|
|
14
14
|
persistent?: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
width?: string;
|
|
19
|
-
children?: ReactNode;
|
|
15
|
+
noFocusTrap?: boolean;
|
|
16
|
+
keepScrollbar?: boolean;
|
|
17
|
+
noScrollAreaFocus?: boolean;
|
|
20
18
|
onVisibilityChange?: (isVisible: boolean) => void;
|
|
21
19
|
}
|
|
22
|
-
export declare function IDSDialog({ show, srClose,
|
|
23
|
-
export {};
|
|
20
|
+
export declare function IDSDialog({ show, srClose, headline, width, maxWidth, height, trigger, actions, noOverlay, dismissible, autoFocus, noFocusTrap, persistent, keepScrollbar, noScrollAreaFocus, onVisibilityChange, children, className, ...props }: IDSDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useRef, useEffect } from 'react';
|
|
4
|
-
import '
|
|
3
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
4
|
+
import { IDSDialogBase } from './dialog-base.js';
|
|
5
5
|
import { useFocusTrap } from '../utils/hooks/useFocusTrap.js';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
6
|
|
|
8
|
-
function IDSDialog({ show = false, srClose = "Stäng",
|
|
7
|
+
function IDSDialog({ show = false, srClose = "Stäng", headline, width, maxWidth, height, trigger, actions, noOverlay = false, dismissible = false, autoFocus = true, noFocusTrap = false, persistent = false, keepScrollbar = false, noScrollAreaFocus = false, onVisibilityChange, children, className, ...props }) {
|
|
9
8
|
const [isVisible, setIsVisible] = useState(show);
|
|
9
|
+
const triggerRef = useRef(null);
|
|
10
10
|
const dialogRef = useRef(null);
|
|
11
|
-
const
|
|
12
|
-
const [hasScrollbar, setHasScrollbar] = useState(false);
|
|
11
|
+
const scrollAreaRef = useRef(null);
|
|
13
12
|
useFocusTrap(dialogRef.current, isVisible && !noFocusTrap);
|
|
13
|
+
// Sync prop show
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
setIsVisible(show);
|
|
16
16
|
}, [show]);
|
|
17
|
+
// Notify visibility change
|
|
17
18
|
useEffect(() => {
|
|
18
19
|
onVisibilityChange?.(isVisible);
|
|
19
20
|
}, [isVisible]);
|
|
21
|
+
// Body scroll and scrollbar detection
|
|
20
22
|
useEffect(() => {
|
|
21
|
-
const checkScrollbar = () => {
|
|
22
|
-
if (bodyRef.current) {
|
|
23
|
-
setHasScrollbar(bodyRef.current.clientHeight < bodyRef.current.scrollHeight);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
23
|
if (isVisible) {
|
|
27
24
|
!keepScrollbar && document.body.classList.add("ids-hide-overflow");
|
|
28
|
-
checkScrollbar();
|
|
29
25
|
}
|
|
30
26
|
else {
|
|
31
27
|
document.body.classList.remove("ids-hide-overflow");
|
|
@@ -34,6 +30,7 @@ function IDSDialog({ show = false, srClose = "Stäng", dismissible = false, auto
|
|
|
34
30
|
document.body.classList.remove("ids-hide-overflow");
|
|
35
31
|
};
|
|
36
32
|
}, [isVisible, keepScrollbar]);
|
|
33
|
+
// Escape key
|
|
37
34
|
useEffect(() => {
|
|
38
35
|
const handleKeyDown = (e) => {
|
|
39
36
|
if (e.key === "Escape" && isVisible && !persistent) {
|
|
@@ -42,35 +39,38 @@ function IDSDialog({ show = false, srClose = "Stäng", dismissible = false, auto
|
|
|
42
39
|
};
|
|
43
40
|
document.addEventListener("keydown", handleKeyDown);
|
|
44
41
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
45
|
-
}, [isVisible, persistent
|
|
42
|
+
}, [isVisible, persistent]);
|
|
43
|
+
// Auto focus
|
|
46
44
|
useEffect(() => {
|
|
47
45
|
if (isVisible && autoFocus) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
if (!dialogRef?.current)
|
|
47
|
+
return;
|
|
48
|
+
const wrapper = dialogRef.current;
|
|
49
|
+
const focusAnchor = wrapper.querySelector(".ids-focus-anchor");
|
|
50
|
+
if (focusAnchor) {
|
|
51
|
+
focusAnchor.focus();
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
focusAnchor?.scrollIntoView({
|
|
54
|
+
behavior: "smooth",
|
|
55
|
+
block: "nearest"
|
|
56
|
+
});
|
|
57
|
+
}, 2);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
wrapper.focus();
|
|
61
|
+
}
|
|
54
62
|
}
|
|
55
63
|
}, [isVisible, autoFocus]);
|
|
56
|
-
const overlayClick = () => {
|
|
57
|
-
if (!persistent)
|
|
64
|
+
const overlayClick = useCallback(() => {
|
|
65
|
+
if (!persistent)
|
|
58
66
|
setIsVisible(false);
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
width,
|
|
67
|
-
maxWidth,
|
|
68
|
-
height,
|
|
69
|
-
maxHeight: height || undefined
|
|
70
|
-
}, ...props, children: [dismissible && (jsx("div", { className: "ids-dialog__dismissible", children: jsx("button", { "aria-label": srClose, className: "ids-dialog__close-button", onClick: () => setIsVisible(false) }) })), jsxs("div", { ref: bodyRef, className: clsx("ids-dialog__body", {
|
|
71
|
-
"ids-dialog__body--has-scrollbar": hasScrollbar,
|
|
72
|
-
"ids-dialog__body--scroll-area-focus": !noScrollAreaFocus
|
|
73
|
-
}), tabIndex: noScrollAreaFocus ? -1 : 0, children: [jsx("div", { className: "ids-dialog__body-headline", children: headline }), jsx("div", { className: "ids-dialog__body-content", children: children }), actions && jsx("div", { className: "ids-dialog__footer", children: actions })] })] })] }));
|
|
67
|
+
triggerRef.current?.focus();
|
|
68
|
+
}, []);
|
|
69
|
+
const closeDialog = useCallback(() => {
|
|
70
|
+
setIsVisible(false);
|
|
71
|
+
triggerRef.current?.focus();
|
|
72
|
+
}, []);
|
|
73
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: "ids-dialog__trigger", "aria-haspopup": "dialog", ref: triggerRef, children: trigger }), jsx(IDSDialogBase, { ...props, client: true, show: isVisible, noOverlay: noOverlay, headline: headline, dismissible: dismissible, width: width, maxWidth: maxWidth, height: height, dialogRef: dialogRef, scrollAreaRef: scrollAreaRef, actions: actions, noFocusTrap: noFocusTrap, noScrollAreaFocus: noScrollAreaFocus, onCloseDialog: closeDialog, onOverlayClick: overlayClick, children: children })] }));
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export { IDSDialog };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/dropdown/dropdown.css";
|
|
3
|
+
type Position = "left" | "right";
|
|
4
|
+
export interface IDSDropdownBaseProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
mBlock?: boolean;
|
|
7
|
+
sBlock?: boolean;
|
|
8
|
+
position?: Position;
|
|
9
|
+
maxHeight?: string;
|
|
10
|
+
minWidth?: string;
|
|
11
|
+
triggerRef?: React.Ref<HTMLSpanElement>;
|
|
12
|
+
contentRef?: React.Ref<HTMLDivElement>;
|
|
13
|
+
trigger?: ReactNode;
|
|
14
|
+
onTriggerClick?: () => void;
|
|
15
|
+
client?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function IDSDropdownBase({ expanded, trigger, triggerRef, onTriggerClick, position, mBlock, sBlock, client, children, className, maxHeight, minWidth, contentRef, ...props }: IDSDropdownBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React, { useId } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/dropdown/dropdown.css';
|
|
5
|
+
|
|
6
|
+
function IDSDropdownBase({ expanded, trigger, triggerRef, onTriggerClick, position, mBlock = false, sBlock = false, client = false, children, className, maxHeight, minWidth, contentRef, ...props }) {
|
|
7
|
+
const triggerId = `dropdown-trigger-${useId()}`;
|
|
8
|
+
const handleKeyPress = (e) => {
|
|
9
|
+
if (!!onTriggerClick && (e.key === "Enter" || e.key === " ")) {
|
|
10
|
+
e.preventDefault();
|
|
11
|
+
onTriggerClick();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const triggerHandlers = client && onTriggerClick
|
|
15
|
+
? {
|
|
16
|
+
onClick: onTriggerClick,
|
|
17
|
+
onKeyDown: handleKeyPress
|
|
18
|
+
}
|
|
19
|
+
: {};
|
|
20
|
+
const enhancedTrigger = React.isValidElement(trigger)
|
|
21
|
+
? React.cloneElement(trigger, {
|
|
22
|
+
ref: triggerRef,
|
|
23
|
+
id: triggerId,
|
|
24
|
+
"aria-expanded": expanded,
|
|
25
|
+
"aria-haspopup": "dialog",
|
|
26
|
+
...triggerHandlers,
|
|
27
|
+
...trigger.props
|
|
28
|
+
})
|
|
29
|
+
: trigger;
|
|
30
|
+
return (jsxs("span", { ...props, className: clsx(`ids-dropdown`, className, {
|
|
31
|
+
"ids-dropdown--m-block": mBlock,
|
|
32
|
+
"ids-dropdown--s-block": sBlock,
|
|
33
|
+
"ids-dropdown--expanded": expanded
|
|
34
|
+
}), children: [enhancedTrigger, jsx("div", { ...props, ref: contentRef, "aria-labelledby": triggerId, "aria-hidden": !expanded, className: clsx(`ids-dropdown-content ids-dropdown-content--position-${position}`, {
|
|
35
|
+
"ids-dropdown-content--show": expanded,
|
|
36
|
+
"ids-dropdown-content--mblock": mBlock,
|
|
37
|
+
"ids-dropdown-content--sblock": sBlock,
|
|
38
|
+
"ids-dropdown-content--scrollable": !!maxHeight
|
|
39
|
+
}, className), style: { minWidth }, children: jsx("div", { className: "ids-dropdown-content__scroll-area", role: "menu", style: { maxHeight: maxHeight || "auto" }, tabIndex: !!maxHeight ? 0 : -1, children: children }) })] }));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { IDSDropdownBase };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import "@inera/ids-design/components/dropdown/dropdown.css";
|
|
3
2
|
export interface IDSDropdownContentButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
4
3
|
icon?: string;
|
|
5
4
|
children: ReactNode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import '@inera/ids-design/components/dropdown/dropdown.css';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
4
|
|
|
6
5
|
const IDSDropdownContentButton = forwardRef(({ icon, children, className, ...props }, ref) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "@inera/ids-design/components/dropdown/dropdown.css";
|
|
1
|
+
import { ReactElement, HTMLAttributes } from "react";
|
|
3
2
|
export interface IDSDropdownContentLinkProps extends Omit<HTMLAttributes<HTMLAnchorElement>, "children"> {
|
|
4
3
|
children: ReactElement;
|
|
5
4
|
}
|
|
6
|
-
export declare function IDSDropdownContentLink({ children, className, ...props }: IDSDropdownContentLinkProps):
|
|
5
|
+
export declare function IDSDropdownContentLink({ children, className, ...props }: IDSDropdownContentLinkProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isValidElement, cloneElement } from 'react';
|
|
3
|
-
import '@inera/ids-design/components/dropdown/dropdown.css';
|
|
1
|
+
import { cloneElement } from 'react';
|
|
4
2
|
import clsx from 'clsx';
|
|
5
3
|
|
|
6
4
|
function IDSDropdownContentLink({ children, className, ...props }) {
|
|
7
|
-
|
|
8
|
-
console.error("IDSDropdownContentLink expects a single <a> element as its child.");
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
const childClassName = clsx("ids-dropdown-content__link", children.props.className, className);
|
|
12
|
-
const content = jsx(Fragment, { children: children.props.children });
|
|
5
|
+
const content = children.props.children;
|
|
13
6
|
return cloneElement(children, {
|
|
14
7
|
...props,
|
|
15
|
-
className:
|
|
8
|
+
className: clsx("ids-dropdown-content__link", className),
|
|
16
9
|
role: "menuitem",
|
|
17
10
|
children: content
|
|
18
11
|
});
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import "
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IDSDropdownBaseProps } from "./dropdown-base";
|
|
3
|
+
type Props = Omit<IDSDropdownBaseProps, "onTriggerClick" | "triggerRef" | "contentRef"> & {
|
|
4
|
+
button: React.ReactNode;
|
|
5
|
+
position?: "left" | "right";
|
|
6
|
+
maxHeight?: string;
|
|
7
|
+
minWidth?: string;
|
|
8
|
+
persistent?: boolean;
|
|
9
|
+
sBlock?: boolean;
|
|
7
10
|
mBlock?: boolean;
|
|
8
11
|
onClosed?: () => void;
|
|
9
12
|
onOpened?: () => void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
sBlock?: boolean;
|
|
13
|
-
maxHeight?: string;
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
export declare function IDSDropdown({ expanded, persistent, position, sBlock, mBlock, maxHeight, onOpened, onClosed, children, className, button, ...props }: IDSDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export declare function IDSDropdown({ button, position, maxHeight, minWidth, sBlock, mBlock, expanded, persistent, onClosed, onOpened, children, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
15
|
export {};
|
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import '
|
|
5
|
-
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
6
|
-
import clsx from 'clsx';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { IDSDropdownBase } from './dropdown-base.js';
|
|
7
5
|
|
|
8
|
-
function IDSDropdown({
|
|
6
|
+
function IDSDropdown({ button, position, maxHeight, minWidth, sBlock, mBlock, expanded = false, persistent = false, onClosed, onOpened, children, className, ...props }) {
|
|
9
7
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
10
8
|
const triggerRef = useRef(null);
|
|
11
9
|
const contentRef = useRef(null);
|
|
12
|
-
const buttonId = useElementId();
|
|
13
10
|
useEffect(() => {
|
|
14
11
|
setIsExpanded(expanded);
|
|
15
12
|
}, [expanded]);
|
|
13
|
+
// Click outside to close
|
|
16
14
|
useEffect(() => {
|
|
17
|
-
if (!
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
if (!isExpanded || persistent)
|
|
16
|
+
return;
|
|
17
|
+
const handleClickOutside = (event) => {
|
|
18
|
+
if (triggerRef.current &&
|
|
19
|
+
!triggerRef.current.contains(event.target) &&
|
|
20
|
+
contentRef.current &&
|
|
21
|
+
!contentRef.current.contains(event.target)) {
|
|
22
|
+
setIsExpanded(false);
|
|
23
|
+
onClosed?.();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
27
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
28
|
+
}, [isExpanded, persistent, onClosed]);
|
|
29
|
+
// Escape should also close
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!isExpanded || persistent)
|
|
32
|
+
return;
|
|
33
|
+
const handleKeyDown = (event) => {
|
|
34
|
+
if (event.key === "Escape") {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
setIsExpanded(false);
|
|
37
|
+
onClosed?.();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
41
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
30
42
|
}, [isExpanded, persistent, onClosed]);
|
|
31
|
-
const
|
|
43
|
+
const toggleDropdown = () => {
|
|
32
44
|
setIsExpanded(prev => {
|
|
33
45
|
const next = !prev;
|
|
34
46
|
if (next)
|
|
@@ -38,38 +50,7 @@ function IDSDropdown({ expanded = false, persistent = false, position = "right",
|
|
|
38
50
|
return next;
|
|
39
51
|
});
|
|
40
52
|
};
|
|
41
|
-
|
|
42
|
-
if (isValidElement(button)) {
|
|
43
|
-
return cloneElement(button, {
|
|
44
|
-
id: buttonId,
|
|
45
|
-
ref: triggerRef,
|
|
46
|
-
onClick: handleToggle,
|
|
47
|
-
"aria-expanded": isExpanded,
|
|
48
|
-
"aria-haspopup": "menu",
|
|
49
|
-
className: clsx(button.props.className)
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
};
|
|
54
|
-
const renderDropdownContent = () => {
|
|
55
|
-
const enhancedChildren = React.Children.map(children, (child, i) => {
|
|
56
|
-
if (!React.isValidElement(child))
|
|
57
|
-
return child;
|
|
58
|
-
return cloneElement(child, {
|
|
59
|
-
key: `dropdown-content-link-${i}`
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
return (jsx("div", { ref: contentRef, "aria-labelledby": buttonId, "aria-hidden": !isExpanded, role: "menu", className: clsx(`ids-dropdown-content ids-dropdown-content--position-${position}`, {
|
|
63
|
-
"ids-dropdown-content--show": isExpanded,
|
|
64
|
-
"ids-dropdown-content--mblock": mBlock,
|
|
65
|
-
"ids-dropdown-content--sblock": sBlock,
|
|
66
|
-
"ids-dropdown-content--scrollable": !!maxHeight
|
|
67
|
-
}), ...props, children: jsx("div", { className: "ids-dropdown-content__scroll-area", role: "menu", style: { maxHeight: maxHeight || "auto" }, tabIndex: !!maxHeight ? 0 : -1, children: enhancedChildren }) }));
|
|
68
|
-
};
|
|
69
|
-
return (jsxs("span", { className: clsx(`ids-dropdown`, className, {
|
|
70
|
-
"ids-dropdown--mblock": mBlock,
|
|
71
|
-
"ids-dropdown--sblock": sBlock
|
|
72
|
-
}), children: [renderTrigger(), isExpanded && renderDropdownContent()] }));
|
|
53
|
+
return (jsx(IDSDropdownBase, { ...props, client: true, className: className, expanded: isExpanded, trigger: button, triggerRef: triggerRef, contentRef: contentRef, maxHeight: maxHeight, sBlock: sBlock, mBlock: mBlock, minWidth: minWidth, position: position, onTriggerClick: toggleDropdown, children: children }));
|
|
73
54
|
}
|
|
74
55
|
|
|
75
56
|
export { IDSDropdown };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { IDSLinkProps } from "../link/link";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
3
2
|
import "@inera/ids-design/components/footer-1177/footer-1177.css";
|
|
4
3
|
export interface Footer1177Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
4
|
headline?: string;
|
|
5
|
+
toggle?: ReactNode;
|
|
6
6
|
srHeadline?: string;
|
|
7
7
|
subHeadline?: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
col3?: ReactElement<IDSLinkProps>[];
|
|
8
|
+
col1?: ReactNode;
|
|
9
|
+
col2?: ReactNode;
|
|
10
|
+
col3?: ReactNode;
|
|
12
11
|
subFooterLeft?: ReactNode;
|
|
13
12
|
subFooterRight?: ReactNode;
|
|
14
13
|
mobileMenu?: ReactNode;
|
|
@@ -16,4 +15,4 @@ export interface Footer1177Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
16
15
|
subFooterMobile?: ReactNode;
|
|
17
16
|
children?: ReactNode;
|
|
18
17
|
}
|
|
19
|
-
export declare function IDSFooter1177({ headline, srHeadline, subHeadline,
|
|
18
|
+
export declare function IDSFooter1177({ headline, srHeadline, subHeadline, col1, col2, col3, toggle, subFooterLeft, subFooterRight, mobileMenu, mobileLinks, subFooterMobile, children, className, ...props }: Footer1177Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import '@inera/ids-design/components/footer-1177/footer-1177.css';
|
|
4
4
|
|
|
5
|
-
function IDSFooter1177({ headline = "", srHeadline = "", subHeadline = "",
|
|
5
|
+
function IDSFooter1177({ headline = "", srHeadline = "", subHeadline = "", col1, col2, col3, toggle, subFooterLeft, subFooterRight, mobileMenu, mobileLinks, subFooterMobile, children, className, ...props }) {
|
|
6
6
|
const renderHeadline = () => {
|
|
7
7
|
if (srHeadline) {
|
|
8
8
|
return (jsxs(Fragment, { children: [jsxs("h2", { className: "ids-footer-1177__headline--sr", children: [srHeadline, jsx("span", { className: "ids-footer-1177__headline--sub", children: subHeadline })] }), jsxs("h2", { "aria-hidden": "true", className: "ids-footer-1177__headline", children: [headline, jsx("span", { className: "ids-footer-1177__headline--sub", children: subHeadline })] })] }));
|
|
@@ -10,15 +10,18 @@ function IDSFooter1177({ headline = "", srHeadline = "", subHeadline = "", cols
|
|
|
10
10
|
return (jsxs("h2", { className: "ids-footer-1177__headline", children: [headline, jsx("span", { className: "ids-footer-1177__headline--sub", children: subHeadline })] }));
|
|
11
11
|
};
|
|
12
12
|
const renderCols = () => {
|
|
13
|
-
if (
|
|
13
|
+
if (!!col1 && !col2 && !col3) {
|
|
14
14
|
return jsx("div", { className: clsx("ids-footer-1177__link-col", "ids-footer-1177__link-col--100"), children: col1 });
|
|
15
15
|
}
|
|
16
|
-
if (
|
|
16
|
+
if (!!col1 && !!col2 && !col3) {
|
|
17
17
|
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-1177__link-col", "ids-footer-1177__link-col--50"), children: col1 }), jsx("div", { className: clsx("ids-footer-1177__link-col", "ids-footer-1177__link-col--50"), children: col2 })] }));
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
else if (!!col1 && !!col2 && !!col3) {
|
|
20
|
+
return (jsxs(Fragment, { children: [jsx("div", { className: clsx("ids-footer-1177__link-col", "ids-footer-1177__link-col--33"), children: col1 }), jsx("div", { className: clsx("ids-footer-1177__link-col", "ids-footer-1177__link-col--33"), children: col2 }), jsx("div", { className: clsx("ids-footer-1177__link-col", "ids-footer-1177__link-col--33"), children: col3 })] }));
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
20
23
|
};
|
|
21
|
-
return (jsxs("footer", { className: clsx("ids-footer-1177", className), ...props, children: [jsx("div", { className: "ids-footer-1177__inner-wrapper", children: jsxs("div", { className: "ids-footer-1177__inner", children: [jsx("div", { className: "ids-footer-1177__headline-wrapper", children: renderHeadline() }), jsxs("div", { className: "ids-footer-1177__content", children: [
|
|
24
|
+
return (jsxs("footer", { className: clsx("ids-footer-1177", className), ...props, children: [jsx("div", { className: "ids-footer-1177__inner-wrapper", children: jsxs("div", { className: "ids-footer-1177__inner", children: [jsx("div", { className: "ids-footer-1177__headline-wrapper", children: renderHeadline() }), jsxs("div", { className: "ids-footer-1177__content", children: [jsxs("div", { className: "ids-footer-1177__text", children: [children, toggle && jsx("div", { className: "ids-footer-1177__darkmode-toggle", children: toggle })] }), jsx("div", { className: "ids-footer-1177__cols", children: renderCols() })] })] }) }), jsx("div", { className: "ids-footer-1177__mobile-menu", children: mobileMenu }), jsxs("div", { className: "ids-footer-1177__sub-footer", children: [jsx("div", { className: "ids-footer-1177__sub-footer-container", children: jsxs("div", { className: "ids-footer-1177__sub-footer-inner", children: [jsx("div", { className: "ids-footer-1177__sub-footer-left", children: subFooterLeft }), jsx("div", { className: "ids-footer-1177__sub-footer-right", children: subFooterRight }), jsx("div", { className: "ids-footer-1177__mobile-links", children: mobileLinks })] }) }), jsx("div", { className: "ids-footer-1177__sub-footer-mobile", children: jsx("div", { className: "ids-footer-1177__sub-footer-mobile-text", children: subFooterMobile }) })] })] }));
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
export { IDSFooter1177 };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { IDSLinkProps } from "../link/link";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
3
2
|
import "@inera/ids-design/components/footer-1177-admin/footer-1177-admin.css";
|
|
4
3
|
interface Footer1177AdminProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
4
|
headline?: string;
|
|
5
|
+
toggle?: ReactNode;
|
|
6
6
|
srHeadline?: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
col3?: ReactElement<IDSLinkProps>[];
|
|
7
|
+
col1?: ReactNode;
|
|
8
|
+
col2?: ReactNode;
|
|
9
|
+
col3?: ReactNode;
|
|
11
10
|
subFooterLeft?: ReactNode;
|
|
12
11
|
subFooterRight?: ReactNode;
|
|
13
12
|
mobileMenu?: ReactNode;
|
|
@@ -15,5 +14,5 @@ interface Footer1177AdminProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
15
14
|
subFooterMobile?: ReactNode;
|
|
16
15
|
children?: ReactNode;
|
|
17
16
|
}
|
|
18
|
-
export declare
|
|
17
|
+
export declare function IDSFooter1177Admin({ headline, srHeadline, col1, col2, col3, toggle, subFooterLeft, subFooterRight, mobileMenu, mobileLinks, subFooterMobile, children, className, ...props }: Footer1177AdminProps): import("react/jsx-runtime").JSX.Element;
|
|
19
18
|
export {};
|