@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,41 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
|
-
import '
|
|
5
|
-
import clsx from 'clsx';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React, { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
4
|
+
import { IDSStepBase } from './step-base.js';
|
|
6
5
|
|
|
7
|
-
const IDSStep = ({ state = "", headline, label
|
|
8
|
-
const [
|
|
6
|
+
const IDSStep = forwardRef(({ state = "", headline, label, stepNumber = "", srIndicatorText = "", expanded: expandedProp = false, disabled = false, onToggleStep, onExpanded, onClosed, className, ...props }, ref) => {
|
|
7
|
+
const [isExpanded, setIsExpanded] = useState(expandedProp);
|
|
8
|
+
const internalRef = React.useRef(null);
|
|
9
9
|
useEffect(() => {
|
|
10
|
-
|
|
10
|
+
setIsExpanded(expandedProp);
|
|
11
11
|
}, [expandedProp]);
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
onToggleStep?.(stepNumber, isExpanded);
|
|
14
|
+
isExpanded ? onExpanded?.() : onClosed?.();
|
|
15
|
+
}, [isExpanded]);
|
|
16
|
+
useImperativeHandle(ref, () => internalRef.current);
|
|
17
|
+
const handleToggleStep = () => {
|
|
18
|
+
if (!disabled)
|
|
19
|
+
setIsExpanded(prev => !prev);
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
toggleExpansion();
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const renderStepIndicator = () => {
|
|
28
|
-
if (state === "valid" || state === "invalid")
|
|
29
|
-
return null;
|
|
30
|
-
return stepNumber;
|
|
31
|
-
};
|
|
32
|
-
return (jsxs("div", { className: clsx("ids-step", className), ...(last && { last }), ...props, children: [jsx("div", { role: "button", tabIndex: disabled ? -1 : 0, className: clsx("ids-step__button", {
|
|
33
|
-
"ids-step__button--disabled": disabled
|
|
34
|
-
}), "aria-expanded": expanded, onClick: toggleExpansion, onKeyDown: handleKeyPress, children: jsxs("div", { className: "ids-step__button-inner", children: [jsx("div", { className: "ids-step__indicator-wrapper", children: jsx("div", { "aria-label": srIndicatorText || stepNumber, role: "img", className: `ids-step__indicator ids-step__indicator--${state}`, children: renderStepIndicator() }) }), jsxs("div", { className: "ids-step__button-text", children: [jsxs("div", { className: "ids-step__headline-label", children: [label && jsx("div", { className: "ids-step__label", children: label }), headline && jsx("div", { className: "ids-step__headline", children: headline })] }), jsx("div", { className: clsx("ids-step__chevron", {
|
|
35
|
-
"ids-step__chevron--expanded": expanded
|
|
36
|
-
}) })] })] }) }), jsx("div", { className: clsx("ids-step__content", {
|
|
37
|
-
"ids-step__content--expanded": expanded
|
|
38
|
-
}), children: children })] }));
|
|
39
|
-
};
|
|
21
|
+
return (jsx(IDSStepBase, { client: true, ref: internalRef, state: state, headline: headline, label: label, stepNumber: stepNumber, srIndicatorText: srIndicatorText, expanded: isExpanded, disabled: disabled, onToggleStep: handleToggleStep, className: className, ...props }));
|
|
22
|
+
});
|
|
23
|
+
IDSStep.displayName = "IDSStep";
|
|
40
24
|
|
|
41
25
|
export { IDSStep };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
|
-
import { IDSStepProps } from "./step";
|
|
3
|
-
|
|
4
|
-
interface IDSStepperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
import type { IDSStepProps } from "./step";
|
|
3
|
+
export interface IDSStepperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
4
|
children: ReactElement<IDSStepProps>[] | ReactElement<IDSStepProps>;
|
|
6
|
-
|
|
5
|
+
onToggleStep?: (step: string, expanded: boolean) => void;
|
|
7
6
|
}
|
|
8
|
-
export declare function IDSStepper({ children,
|
|
9
|
-
export {};
|
|
7
|
+
export declare function IDSStepper({ children, onToggleStep, className, ...props }: IDSStepperProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import React, { isValidElement, cloneElement } from 'react';
|
|
4
|
-
import '@inera/ids-design/components/stepper/stepper.css';
|
|
5
3
|
import clsx from 'clsx';
|
|
6
4
|
|
|
7
|
-
function IDSStepper({ children,
|
|
5
|
+
function IDSStepper({ children, onToggleStep, className, ...props }) {
|
|
8
6
|
const stepsArray = React.Children.toArray(children).filter(isValidElement);
|
|
9
|
-
const
|
|
10
|
-
|
|
7
|
+
const handleToggleStep = (step, expanded) => {
|
|
8
|
+
onToggleStep?.(step, expanded);
|
|
11
9
|
};
|
|
12
|
-
const enhancedSteps = stepsArray.map((step, index) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
onToggleExpansion: handleExpansion
|
|
18
|
-
});
|
|
19
|
-
});
|
|
10
|
+
const enhancedSteps = stepsArray.map((step, index) => cloneElement(step, {
|
|
11
|
+
key: `step-key-${index}`,
|
|
12
|
+
stepNumber: `${index + 1}`,
|
|
13
|
+
onToggleStep: handleToggleStep
|
|
14
|
+
}));
|
|
20
15
|
return (jsx("div", { className: clsx("ids-stepper", className), ...props, children: enhancedSteps }));
|
|
21
16
|
}
|
|
22
17
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode, KeyboardEventHandler } from "react";
|
|
2
|
+
export interface IDSTabLinkProps {
|
|
3
|
+
notices?: number;
|
|
4
|
+
href: string;
|
|
5
|
+
label: string;
|
|
6
|
+
index?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
panelId?: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
notification?: ReactNode;
|
|
12
|
+
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const IDSTabLink: React.ForwardRefExoticComponent<IDSTabLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
const IDSTabLink = forwardRef(({ label, index = "", href, id = "", panelId = "", selected = false, icon = "", notification, onKeyDown, className, ...props }, ref) => {
|
|
6
|
+
return (jsx("a", { ...props, ref: ref, href: href, id: id, role: "tab", "aria-selected": selected, "aria-controls": panelId, className: clsx("ids-tab", { "ids-tab--selected": selected }, className), onKeyDown: onKeyDown, children: jsxs("div", { className: "ids-tab__label", children: [icon && jsx("span", { className: `ids-tab-icon ids-icon-${icon} ids-icon--m`, "aria-hidden": "true" }), label, notification] }) }));
|
|
7
|
+
});
|
|
8
|
+
IDSTabLink.displayName = "IDSTabLink";
|
|
9
|
+
|
|
10
|
+
export { IDSTabLink };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import "@inera/ids-design/components/tabs/tab-panel.css";
|
|
1
|
+
import React from "react";
|
|
3
2
|
export interface IDSTabPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
3
|
compact?: boolean;
|
|
5
4
|
noFocus?: boolean;
|
|
6
5
|
selected?: boolean;
|
|
7
|
-
children?: ReactNode;
|
|
8
6
|
id?: string;
|
|
9
7
|
tabId?: string;
|
|
10
8
|
}
|
|
11
|
-
export declare const IDSTabPanel: React.
|
|
9
|
+
export declare const IDSTabPanel: React.ForwardRefExoticComponent<IDSTabPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
4
|
-
import '@inera/ids-design/components/tabs/tab-panel.css';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
5
3
|
import clsx from 'clsx';
|
|
6
4
|
|
|
7
|
-
const IDSTabPanel = ({ compact = false, noFocus = false, selected = false, id = "", tabId = "",
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (panelRef.current && !noFocus) {
|
|
11
|
-
panelRef.current.setAttribute("tabindex", "0");
|
|
12
|
-
}
|
|
13
|
-
}, [noFocus]);
|
|
14
|
-
return (jsx("div", { ref: panelRef, role: "tabpanel", id: id, "aria-hidden": !selected, "aria-labelledby": tabId, hidden: !selected, className: clsx("ids-tab-panel", {
|
|
5
|
+
const IDSTabPanel = forwardRef(({ compact = false, noFocus = false, selected = false, id = "", tabId = "", className, children, ...props }, ref) => {
|
|
6
|
+
return (jsx("div", { ref: ref, role: "tabpanel", id: id, "aria-hidden": !selected, "aria-labelledby": tabId, hidden: !selected, tabIndex: noFocus ? undefined : 0, className: clsx("ids-tab-panel", {
|
|
15
7
|
"ids-tab-panel--selected": selected,
|
|
16
8
|
"ids-tab-panel--compact": compact
|
|
17
9
|
}, className), ...props, children: children }));
|
|
18
|
-
};
|
|
10
|
+
});
|
|
11
|
+
IDSTabPanel.displayName = "IDSTabPanel";
|
|
19
12
|
|
|
20
13
|
export { IDSTabPanel };
|
package/components/tabs/tab.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React, { ReactNode,
|
|
2
|
-
|
|
3
|
-
export interface IDSTabProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1
|
+
import React, { ReactNode, KeyboardEventHandler } from "react";
|
|
2
|
+
export interface IDSTabProps {
|
|
4
3
|
notices?: number;
|
|
5
4
|
label: string;
|
|
6
5
|
index?: string;
|
|
@@ -10,6 +9,7 @@ export interface IDSTabProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
10
9
|
selected?: boolean;
|
|
11
10
|
notification?: ReactNode;
|
|
12
11
|
onTabClick?: (index: string) => void;
|
|
13
|
-
onKeyDown?:
|
|
12
|
+
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
|
13
|
+
className?: string;
|
|
14
14
|
}
|
|
15
|
-
export declare const IDSTab: React.
|
|
15
|
+
export declare const IDSTab: React.ForwardRefExoticComponent<IDSTabProps & React.RefAttributes<HTMLDivElement>>;
|
package/components/tabs/tab.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
4
|
-
import '@inera/ids-design/components/tabs/tab.css';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
|
|
7
|
-
const IDSTab = ({ label, index, id = "", panelId = "", selected = false, icon = "", notification,
|
|
8
|
-
const tabRef = useRef(null);
|
|
6
|
+
const IDSTab = forwardRef(({ label, index = "", id = "", panelId = "", selected = false, icon = "", notification, onTabClick, onKeyDown, className, ...props }, ref) => {
|
|
9
7
|
const handleClick = () => {
|
|
10
8
|
if (!selected) {
|
|
11
9
|
onTabClick?.(index);
|
|
12
10
|
}
|
|
13
11
|
};
|
|
14
|
-
return (jsx("div", {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
12
|
+
return (jsx("div", { ...props, ref: ref, id: id, role: "tab", "aria-selected": selected, "aria-controls": panelId, tabIndex: 0, className: clsx("ids-tab", { "ids-tab--selected": selected }, className), onKeyDown: onKeyDown, onClick: handleClick, children: jsxs("div", { className: "ids-tab__label", children: [icon && jsx("span", { className: `ids-tab-icon ids-icon-${icon} ids-icon--m`, "aria-hidden": "true" }), label, notification && jsx("span", { className: "ids-tab-extra", children: notification })] }) }));
|
|
13
|
+
});
|
|
14
|
+
IDSTab.displayName = "IDSTab";
|
|
18
15
|
|
|
19
16
|
export { IDSTab };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { IDSTabProps } from "./tab";
|
|
3
|
+
import "@inera/ids-design/components/tabs/tabs.css";
|
|
4
|
+
interface IDSTabsBaseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
activeTab?: number;
|
|
6
|
+
unresponsive?: boolean;
|
|
7
|
+
light?: boolean;
|
|
8
|
+
compact?: boolean;
|
|
9
|
+
breakpoint?: "m" | "s";
|
|
10
|
+
selectLabel?: string;
|
|
11
|
+
tabs?: ReactElement<IDSTabProps>[];
|
|
12
|
+
select?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function IDSTabsBase({ unresponsive, light, compact, breakpoint, selectLabel, tabs, className, children, select, ...props }: IDSTabsBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import '@inera/ids-design/components/tabs/tabs.css';
|
|
4
|
+
|
|
5
|
+
function IDSTabsBase({ unresponsive = false, light = false, compact = false, breakpoint = "m", selectLabel = "", tabs = [], className, children, select, ...props }) {
|
|
6
|
+
const responsiveOnM = breakpoint === "m" && !unresponsive;
|
|
7
|
+
const responsiveOnS = breakpoint === "s" && !unresponsive;
|
|
8
|
+
return (jsxs("div", { ...props, className: clsx("ids-tabs", {
|
|
9
|
+
"ids-tabs--unresponsive": unresponsive,
|
|
10
|
+
"ids-tabs--responsive-on-m": responsiveOnM,
|
|
11
|
+
"ids-tabs--responsive-on-s": responsiveOnS
|
|
12
|
+
}, className), children: [jsx("div", { className: "ids-tabs__select", children: select }), jsx("div", { className: "ids-tabs__tabs", role: "tablist", children: tabs }), jsx("div", { className: "ids-tabs__panels", children: children })] }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { IDSTabsBase };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import "@inera/ids-design/components/tabs/tabs.css";
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
3
2
|
import { IDSTabProps } from "./tab";
|
|
4
|
-
interface IDSTabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface IDSTabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
tabs?: ReactElement<IDSTabProps>[];
|
|
5
|
+
onTabChange?: (index: number) => void;
|
|
5
6
|
unresponsive?: boolean;
|
|
6
7
|
light?: boolean;
|
|
7
8
|
compact?: boolean;
|
|
8
9
|
breakpoint?: "m" | "s";
|
|
9
10
|
selectLabel?: string;
|
|
10
|
-
tabs?: ReactElement<IDSTabProps>[];
|
|
11
|
-
children?: ReactNode;
|
|
12
|
-
onTabChange?: (index: number) => void;
|
|
13
11
|
}
|
|
14
|
-
export declare
|
|
15
|
-
export {};
|
|
12
|
+
export declare function IDSTabs({ tabs, selectLabel, light, compact, breakpoint, children, onTabChange, ...props }: IDSTabsProps): import("react/jsx-runtime").JSX.Element;
|
package/components/tabs/tabs.js
CHANGED
|
@@ -1,52 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import React, { useState } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React, { useId, useState } from 'react';
|
|
4
|
+
import { IDSTabsBase } from './tabs-base.js';
|
|
4
5
|
import { IDSSelect } from '../form/select/select.js';
|
|
5
|
-
import '@inera/ids-design/components/tabs/tabs.css';
|
|
6
|
-
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
7
|
-
import clsx from 'clsx';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
const
|
|
7
|
+
function IDSTabs({ tabs = [], selectLabel, light, compact, breakpoint, children, onTabChange, ...props }) {
|
|
8
|
+
const reactId = useId();
|
|
9
|
+
const getTabId = (index) => `tab-${reactId}-${index}`;
|
|
10
|
+
const getTabPanelId = (index) => `tab-panel-${reactId}-${index}`;
|
|
11
11
|
const initialSelectedIndex = tabs.findIndex(tab => React.isValidElement(tab) && tab.props.selected === true);
|
|
12
12
|
const [activeTab, setActiveTab] = useState(initialSelectedIndex !== -1 ? initialSelectedIndex : 0);
|
|
13
|
-
const
|
|
14
|
-
const responsiveOnS = breakpoint === "s" && !unresponsive;
|
|
15
|
-
const handleSelect = (index) => {
|
|
13
|
+
const handleTabChange = (index) => {
|
|
16
14
|
setActiveTab(index);
|
|
17
15
|
onTabChange?.(index);
|
|
18
16
|
};
|
|
17
|
+
const tabChangedFromSelect = (e) => {
|
|
18
|
+
handleTabChange?.(Number(e.target.value));
|
|
19
|
+
};
|
|
20
|
+
const renderTabOptions = () => tabs?.map((tab, i) => {
|
|
21
|
+
if (!React.isValidElement(tab))
|
|
22
|
+
return null;
|
|
23
|
+
const { label, notification } = tab.props;
|
|
24
|
+
let notificationText = "";
|
|
25
|
+
if (typeof notification === "string" || typeof notification === "number") {
|
|
26
|
+
notificationText = String(notification);
|
|
27
|
+
}
|
|
28
|
+
else if (React.isValidElement(notification)) {
|
|
29
|
+
const badge = notification;
|
|
30
|
+
const childTexts = React.Children.toArray(badge.props.children)
|
|
31
|
+
.map(child => (typeof child === "string" || typeof child === "number" ? child : ""))
|
|
32
|
+
.join("");
|
|
33
|
+
notificationText = childTexts.trim();
|
|
34
|
+
}
|
|
35
|
+
const optionLabel = notificationText ? `${label} (${notificationText})` : label;
|
|
36
|
+
return (jsx("option", { value: i, children: optionLabel }, i));
|
|
37
|
+
});
|
|
19
38
|
const handleKeydown = (e, index) => {
|
|
20
39
|
if (e.key === "Enter" || e.key === " ") {
|
|
21
40
|
e.preventDefault();
|
|
22
|
-
|
|
41
|
+
handleTabChange?.(index);
|
|
23
42
|
}
|
|
24
43
|
else if (e.key === "ArrowLeft" && index > 0) {
|
|
25
44
|
e.preventDefault();
|
|
26
|
-
document.getElementById(getTabId(index - 1))?.focus();
|
|
45
|
+
document.getElementById(getTabId?.(index - 1))?.focus();
|
|
27
46
|
}
|
|
28
47
|
else if (e.key === "ArrowRight" && index < tabs.length - 1) {
|
|
29
48
|
e.preventDefault();
|
|
30
49
|
document.getElementById(getTabId(index + 1))?.focus();
|
|
31
50
|
}
|
|
32
51
|
};
|
|
33
|
-
const getTabId = (index) => {
|
|
34
|
-
return `${tabsId}-tab-${index}`;
|
|
35
|
-
};
|
|
36
|
-
const getTabPanelId = (index) => {
|
|
37
|
-
return `${tabsId}-tab-panel-${index}`;
|
|
38
|
-
};
|
|
39
52
|
const enhancedTabs = React.Children.map(tabs, (tab, idx) => {
|
|
40
53
|
if (!React.isValidElement(tab))
|
|
41
54
|
return tab;
|
|
42
55
|
return React.cloneElement(tab, {
|
|
43
56
|
key: `tab-key-${idx}`,
|
|
44
|
-
id: getTabId(idx),
|
|
45
|
-
panelId: getTabPanelId(idx),
|
|
57
|
+
id: getTabId?.(idx),
|
|
58
|
+
panelId: getTabPanelId?.(idx),
|
|
46
59
|
index: `${idx}`,
|
|
47
60
|
label: tab.props.label,
|
|
48
61
|
selected: activeTab === idx,
|
|
49
|
-
onTabClick: () =>
|
|
62
|
+
onTabClick: () => handleTabChange?.(idx),
|
|
50
63
|
onKeyDown: (e) => handleKeydown(e, idx)
|
|
51
64
|
});
|
|
52
65
|
});
|
|
@@ -55,41 +68,15 @@ const IDSTabs = ({ unresponsive = false, light = false, compact = false, breakpo
|
|
|
55
68
|
return panel;
|
|
56
69
|
return React.cloneElement(panel, {
|
|
57
70
|
key: `tab-panel-key-${idx}`,
|
|
58
|
-
id: getTabPanelId(idx),
|
|
59
|
-
tabId: getTabId(idx),
|
|
71
|
+
id: getTabPanelId?.(idx),
|
|
72
|
+
tabId: getTabId?.(idx),
|
|
60
73
|
role: "tabpanel",
|
|
61
74
|
hidden: activeTab !== idx,
|
|
62
75
|
selected: activeTab === idx,
|
|
63
76
|
compact
|
|
64
77
|
});
|
|
65
78
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
handleSelect(index);
|
|
69
|
-
};
|
|
70
|
-
const renderTabOptions = () => tabs?.map((tab, i) => {
|
|
71
|
-
if (!React.isValidElement(tab))
|
|
72
|
-
return null;
|
|
73
|
-
const { label, notification } = tab.props;
|
|
74
|
-
let notificationText = "";
|
|
75
|
-
if (typeof notification === "string" || typeof notification === "number") {
|
|
76
|
-
notificationText = String(notification);
|
|
77
|
-
}
|
|
78
|
-
else if (React.isValidElement(notification)) {
|
|
79
|
-
const badge = notification;
|
|
80
|
-
const childTexts = React.Children.toArray(badge.props.children)
|
|
81
|
-
.map(child => (typeof child === "string" || typeof child === "number" ? child : ""))
|
|
82
|
-
.join("");
|
|
83
|
-
notificationText = childTexts.trim();
|
|
84
|
-
}
|
|
85
|
-
const optionLabel = notificationText ? `${label} (${notificationText})` : label;
|
|
86
|
-
return (jsx("option", { value: i, children: optionLabel }, i));
|
|
87
|
-
});
|
|
88
|
-
return (jsxs("div", { className: clsx("ids-tabs", {
|
|
89
|
-
"ids-tabs--unresponsive": unresponsive,
|
|
90
|
-
"ids-tabs--responsive-on-m": responsiveOnM,
|
|
91
|
-
"ids-tabs--responsive-on-s": responsiveOnS
|
|
92
|
-
}, className), ...props, children: [jsx("div", { className: "ids-tabs__select", children: jsx(IDSSelect, { label: selectLabel, onChange: tabChangedFromSelect, value: activeTab, light: light, children: renderTabOptions() }) }), jsx("div", { className: "ids-tabs__tabs", role: "tablist", children: enhancedTabs }), jsx("div", { className: "ids-tabs__panels", children: enhancedTabPanels })] }));
|
|
93
|
-
};
|
|
79
|
+
return (jsx(IDSTabsBase, { ...props, tabs: enhancedTabs, breakpoint: breakpoint, select: jsx(IDSSelect, { label: selectLabel, onChange: tabChangedFromSelect, value: activeTab, light: light, children: renderTabOptions() }), children: enhancedTabPanels }));
|
|
80
|
+
}
|
|
94
81
|
|
|
95
82
|
export { IDSTabs };
|
package/components/tag/tag.d.ts
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/tag/tag.css";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
type SpanTagProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
10
|
-
onClick?: undefined;
|
|
11
|
-
onClose?: () => void;
|
|
12
|
-
srCloseLabel?: string;
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
};
|
|
15
|
-
type IDSTagProps = ButtonTagProps | SpanTagProps;
|
|
16
|
-
export declare const IDSTag: React.ForwardRefExoticComponent<IDSTagProps & React.RefAttributes<HTMLButtonElement | HTMLSpanElement>>;
|
|
17
|
-
export {};
|
|
3
|
+
export interface IDSTagProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
closeButton?: ReactNode;
|
|
5
|
+
clickable?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const IDSTag: React.ForwardRefExoticComponent<IDSTagProps & React.RefAttributes<HTMLSpanElement>>;
|
package/components/tag/tag.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import '@inera/ids-design/components/tag/tag.css';
|
|
4
3
|
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/tag/tag.css';
|
|
5
5
|
|
|
6
|
-
const IDSTag = forwardRef(({
|
|
7
|
-
|
|
8
|
-
const TagWrapper = isClickable ? "button" : "span";
|
|
9
|
-
return (jsx(TagWrapper, { ref: ref, ...props, className: clsx("ids-tag", { "ids-tag--clickable": isClickable }, className), onClick: isClickable ? onClick : undefined, children: jsxs("div", { className: "ids-tag__content", children: [children, !isClickable && !!onClose && (jsx("button", { type: "button", className: "ids-tag__close-btn", "aria-label": srCloseLabel, onClick: e => {
|
|
10
|
-
e.stopPropagation();
|
|
11
|
-
onClose?.();
|
|
12
|
-
} }))] }) }));
|
|
6
|
+
const IDSTag = forwardRef(({ clickable, closeButton, className, children, ...props }, ref) => {
|
|
7
|
+
return (jsx("span", { ref: ref, ...props, className: clsx("ids-tag", { "ids-tag--clickable": clickable }, className), children: jsxs("div", { className: "ids-tag__content", children: [children, !!closeButton && jsx("span", { className: "ids-tag__close-btn", children: closeButton })] }) }));
|
|
13
8
|
});
|
|
14
9
|
IDSTag.displayName = "IDSTag";
|
|
15
10
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import "@inera/ids-design/components/tooltip/tooltip.css";
|
|
3
|
+
export type TooltipPosition = "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right";
|
|
4
|
+
export interface IDSTooltipBaseProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
position?: TooltipPosition;
|
|
6
|
+
maxWidth?: string;
|
|
7
|
+
translateX?: string;
|
|
8
|
+
translateY?: string;
|
|
9
|
+
trigger: ReactNode;
|
|
10
|
+
triggerIsIcon?: boolean;
|
|
11
|
+
triggerRef?: React.Ref<HTMLSpanElement>;
|
|
12
|
+
tooltipContentRef?: React.Ref<HTMLSpanElement>;
|
|
13
|
+
}
|
|
14
|
+
export declare function IDSTooltipBase({ position, maxWidth, translateX, translateY, trigger, triggerIsIcon, triggerRef, tooltipContentRef, className, children, ...props }: IDSTooltipBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import '@inera/ids-design/components/tooltip/tooltip.css';
|
|
5
|
+
|
|
6
|
+
function IDSTooltipBase({ position = "top", maxWidth = "20rem", translateX = position === "top" || position === "bottom" ? "-50%" : "0", translateY = position.includes("top") ? "-100%" : "100%", trigger, triggerIsIcon, triggerRef, tooltipContentRef, className, children, ...props }) {
|
|
7
|
+
const tooltipId = `tooltip-${useId()}`;
|
|
8
|
+
const ariaHandler = triggerIsIcon
|
|
9
|
+
? {
|
|
10
|
+
"aria-labelledby": tooltipId
|
|
11
|
+
}
|
|
12
|
+
: {
|
|
13
|
+
"aria-describedby": tooltipId
|
|
14
|
+
};
|
|
15
|
+
return (jsxs("span", { className: clsx("ids-tooltip", className), ...props, children: [jsx("span", { className: "ids-tooltip__trigger", ...ariaHandler, ref: triggerRef, children: trigger }), jsx("span", { className: clsx("ids-tooltip__content", `ids-tooltip__content--${position}`), ref: tooltipContentRef, role: "tooltip", id: tooltipId, style: { transform: `translate(${translateX}, ${translateY})`, maxWidth }, children: children })] }));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { IDSTooltipBase };
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export type TooltipPosition = "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right";
|
|
4
|
-
interface IDSTooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
position?: TooltipPosition;
|
|
6
|
-
maxWidth?: string;
|
|
7
|
-
trigger: ReactNode;
|
|
8
|
-
children?: ReactNode;
|
|
1
|
+
import { IDSTooltipBaseProps } from "./tooltip-base";
|
|
2
|
+
export interface IDSTooltipProps extends Omit<IDSTooltipBaseProps, "translateX" | "translateY"> {
|
|
9
3
|
}
|
|
10
|
-
export declare
|
|
11
|
-
export {};
|
|
4
|
+
export declare function IDSTooltip({ position, maxWidth, trigger, className, ...props }: IDSTooltipProps): import("react/jsx-runtime").JSX.Element;
|