@inera/ids-react 8.2.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 -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 -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/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,7 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { Matcher, Modifiers } from "react-day-picker";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface IDSDatePickerChangeEvent {
|
|
4
|
+
value: string;
|
|
5
|
+
valueAsDate?: Date;
|
|
6
|
+
invalidDate: boolean;
|
|
7
|
+
missingDate: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface IDSDatePickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange"> {
|
|
5
10
|
label: string;
|
|
6
11
|
value?: string;
|
|
7
12
|
light?: boolean;
|
|
@@ -21,9 +26,11 @@ export interface IDSDatePickerProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
21
26
|
invalidDateErrorMsg?: string;
|
|
22
27
|
invalid?: boolean;
|
|
23
28
|
disableNavigation?: boolean;
|
|
29
|
+
tooltip?: ReactNode;
|
|
24
30
|
modifiers?: Record<string, Matcher | Matcher[]>;
|
|
31
|
+
onChange?: (event: IDSDatePickerChangeEvent) => void;
|
|
25
32
|
onOpen?: () => void;
|
|
26
33
|
onClose?: () => void;
|
|
27
34
|
onDayClick?: (date: Date, modifiers: Modifiers, e: React.MouseEvent) => void;
|
|
28
35
|
}
|
|
29
|
-
export declare function IDSDatePicker({ label, value, light, placeholder, errorMsg, missingDateErrorMsg, invalidDateErrorMsg, calendarHeader, srOpenText, srCloseText, defaultMonth, startMonth, endMonth, noValidation, disabled, required, invalid, disableNavigation, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }: IDSDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function IDSDatePicker({ label, value, light, placeholder, errorMsg, missingDateErrorMsg, invalidDateErrorMsg, calendarHeader, srOpenText, srCloseText, defaultMonth, startMonth, endMonth, noValidation, disabled, required, invalid, tooltip, disableNavigation, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }: IDSDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRef, useState, useEffect } from 'react';
|
|
3
|
-
import { getWeek, format,
|
|
2
|
+
import { useRef, useId, useState, useEffect } from 'react';
|
|
3
|
+
import { isValid, getWeek, format, subMonths, addMonths } from 'date-fns';
|
|
4
4
|
import { sv } from 'react-day-picker/locale';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { useElementId } from '../../utils/hooks/useElementId.js';
|
|
7
6
|
import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
8
7
|
import { DayPicker, WeekNumberHeader, MonthsDropdown, YearsDropdown, useDayPicker, DropdownNav } from 'react-day-picker';
|
|
9
8
|
import { useFocusTrap } from '../../utils/hooks/useFocusTrap.js';
|
|
10
9
|
import { useAriaDescribedBy } from '../form-hooks/useAriaDescribedBy.js';
|
|
11
|
-
import '@inera/ids-design/components/form/datepicker/datepicker.css';
|
|
12
10
|
|
|
13
11
|
const locale = { locale: sv };
|
|
14
12
|
const createNewDate = (dateString) => {
|
|
@@ -26,7 +24,7 @@ const getPrevMonthYear = (date) => {
|
|
|
26
24
|
const getNextMonthYear = (date) => {
|
|
27
25
|
return `${getSweMonth(addMonths(date, 1))} ${getSweYear(addMonths(date, 1))}`;
|
|
28
26
|
};
|
|
29
|
-
function IDSDatePicker({ label, value
|
|
27
|
+
function IDSDatePicker({ label, value, light = false, placeholder = "åååå/mm/dd", errorMsg = "", missingDateErrorMsg = "Datum saknas", invalidDateErrorMsg = "Ogiltigt datum", calendarHeader = "Välj datum", srOpenText = "Öppna kalendern", srCloseText = "Stäng kalendern", defaultMonth, startMonth = new Date(1900, 0, 1), endMonth = new Date(2050, 0, 1), noValidation = false, disabled = false, required = false, invalid = false, tooltip, disableNavigation = false, modifiers, focusedDay, onChange, onFocus, onBlur, onOpen, onClose, onDayClick, className, ...props }) {
|
|
30
28
|
const shortWeek = "v.";
|
|
31
29
|
const inputRef = useRef(null);
|
|
32
30
|
const triggerRef = useRef(null);
|
|
@@ -34,10 +32,10 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
|
|
|
34
32
|
const headerRef = useRef(null);
|
|
35
33
|
const prevMonthButtonRef = useRef(null);
|
|
36
34
|
const nextMonthButtonRef = useRef(null);
|
|
37
|
-
const dialogId =
|
|
38
|
-
const headerId =
|
|
39
|
-
const inputId =
|
|
40
|
-
const errorMsgId =
|
|
35
|
+
const dialogId = `datepicker-dialog-${useId()}`;
|
|
36
|
+
const headerId = `datepicker-header-${useId()}`;
|
|
37
|
+
const inputId = `datepicker-input-${useId()}`;
|
|
38
|
+
const errorMsgId = `datepicker-error-${useId()}`;
|
|
41
39
|
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
|
42
40
|
const [inputValue, setInputValue] = useState(value);
|
|
43
41
|
const initialSelectedDate = !!value ? createNewDate(value) : undefined;
|
|
@@ -48,7 +46,7 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
|
|
|
48
46
|
const [isInvalid, setIsInvalid] = useState(invalid);
|
|
49
47
|
const showInvalidError = !!hasDateError && !!invalidDateErrorMsg;
|
|
50
48
|
const showMissingError = !!hasMissingError && !!missingDateErrorMsg;
|
|
51
|
-
const showError = !!invalid && !!errorMsg;
|
|
49
|
+
const showError = !!invalid && !!errorMsg && !isDialogOpen;
|
|
52
50
|
useAriaDescribedBy(inputRef, errorMsgId, isInvalid, (showError || showMissingError || showInvalidError) && !noValidation);
|
|
53
51
|
useFocusTrap(dialogRef.current, isDialogOpen);
|
|
54
52
|
const handleOpenDialog = (e) => {
|
|
@@ -61,6 +59,27 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
|
|
|
61
59
|
triggerRef.current.focus();
|
|
62
60
|
onClose?.();
|
|
63
61
|
};
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const handleClickOutside = (event) => {
|
|
64
|
+
if (dialogRef.current && !dialogRef.current.contains(event.target)) {
|
|
65
|
+
setIsDialogOpen(false);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
69
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
70
|
+
}, []);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (!isDialogOpen)
|
|
73
|
+
return;
|
|
74
|
+
const handleKeyDown = (event) => {
|
|
75
|
+
if (event.key === "Escape") {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
setIsDialogOpen(false);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
81
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
82
|
+
}, [isDialogOpen]);
|
|
64
83
|
const handleDayPickerSelect = (date) => {
|
|
65
84
|
const dateString = format(date, "yyyy-MM-dd");
|
|
66
85
|
setHasMissingError(false);
|
|
@@ -76,7 +95,7 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
|
|
|
76
95
|
}
|
|
77
96
|
requestAnimationFrame(() => {
|
|
78
97
|
if (inputRef.current) {
|
|
79
|
-
inputRef.current.
|
|
98
|
+
inputRef.current.checkValidity();
|
|
80
99
|
inputRef.current.dispatchEvent(new Event("input", { bubbles: true }));
|
|
81
100
|
inputRef.current.dispatchEvent(new Event("change", { bubbles: true }));
|
|
82
101
|
setHasMissingError(!noValidation && required && inputRef.current.validity.valueMissing);
|
|
@@ -87,37 +106,56 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
|
|
|
87
106
|
closeDialog();
|
|
88
107
|
};
|
|
89
108
|
const handleInvalid = (e) => {
|
|
90
|
-
setHasMissingError(!noValidation && required && e.
|
|
91
|
-
setIsInvalid(!e.
|
|
109
|
+
setHasMissingError(!noValidation && required && e.currentTarget.validity.valueMissing);
|
|
110
|
+
setIsInvalid(!e.currentTarget.validity.valid || invalid);
|
|
111
|
+
emitValue(e.currentTarget.value, undefined);
|
|
92
112
|
};
|
|
113
|
+
// if the input value is changed programmatically
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
if (value !== inputValue && inputRef.current) {
|
|
116
|
+
setIsInvalid(false);
|
|
117
|
+
setHasDateError(false);
|
|
118
|
+
setInputValue(value);
|
|
119
|
+
setHasMissingError(!noValidation && required && !value);
|
|
120
|
+
if (value) {
|
|
121
|
+
const parsedDate = createNewDate(value);
|
|
122
|
+
if (isValid(parsedDate)) {
|
|
123
|
+
setSelectedDate(parsedDate);
|
|
124
|
+
setMonth(parsedDate);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
setSelectedDate(undefined);
|
|
128
|
+
setIsInvalid(true);
|
|
129
|
+
setHasDateError(true);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}, [value, inputRef]);
|
|
93
134
|
const handleInputChange = (e) => {
|
|
94
135
|
setHasMissingError(false);
|
|
95
136
|
setIsInvalid(false);
|
|
96
137
|
setHasDateError(false);
|
|
97
|
-
setInputValue(e.
|
|
98
|
-
const parsedDate = createNewDate(e.
|
|
138
|
+
setInputValue(e.currentTarget.value);
|
|
139
|
+
const parsedDate = createNewDate(e.currentTarget.value);
|
|
99
140
|
if (isValid(parsedDate)) {
|
|
100
141
|
setSelectedDate(parsedDate);
|
|
101
142
|
setMonth(parsedDate);
|
|
102
143
|
}
|
|
103
144
|
else {
|
|
104
145
|
setSelectedDate(undefined);
|
|
146
|
+
setIsInvalid(!e.currentTarget.validity.valid || invalid);
|
|
105
147
|
}
|
|
106
|
-
emitValue(e.
|
|
148
|
+
emitValue(e.currentTarget.value, parsedDate);
|
|
107
149
|
};
|
|
108
150
|
const emitValue = (val, parsedDate) => {
|
|
109
151
|
const isMissing = required && !val;
|
|
110
|
-
const isValidDate = parsedDate instanceof Date && isValid(parsedDate);
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
missingDate: isMissing
|
|
117
|
-
},
|
|
118
|
-
bubbles: true
|
|
152
|
+
const isValidDate = parsedDate && parsedDate instanceof Date && isValid(parsedDate);
|
|
153
|
+
onChange?.({
|
|
154
|
+
value: val,
|
|
155
|
+
valueAsDate: isValidDate ? createNewDate(val) : undefined,
|
|
156
|
+
invalidDate: !isValid(parsedDate),
|
|
157
|
+
missingDate: isMissing
|
|
119
158
|
});
|
|
120
|
-
onChange?.(customEvent);
|
|
121
159
|
};
|
|
122
160
|
const handleBlur = () => {
|
|
123
161
|
setHasDateError(!noValidation && value.trim().length && !isValid(selectedDate));
|
|
@@ -152,7 +190,7 @@ function IDSDatePicker({ label, value = "", light = false, placeholder = "ååå
|
|
|
152
190
|
return;
|
|
153
191
|
header?.focus();
|
|
154
192
|
}, [isDialogOpen]);
|
|
155
|
-
return (jsxs("div", { className: clsx("ids-datepicker", { "ids-datepicker--invalid": !noValidation && (isInvalid || hasDateError) }, className), ...props, children: [isDialogOpen && jsx("div", { className: "ids-datepicker__overlay" }), jsx("label", { htmlFor: inputId, className: "ids-label", children: label }), jsxs("div", { className: "ids-datepicker__input-wrapper", children: [jsx("input", { className: clsx("ids-datepicker__input", { "ids-input--light": light }), ref: inputRef, style: { fontSize: "inherit" }, id: inputId, type: "text", value: inputValue, required: required, disabled: disabled, "aria-invalid": !noValidation && (isInvalid || hasDateError), placeholder: placeholder, onChange: handleInputChange, onInvalid: handleInvalid, onBlur: handleBlur }), jsx("button", { ref: triggerRef, className: "ids-datepicker__trigger", style: { fontSize: "inherit" }, disabled: disabled, onClick: handleOpenDialog, "aria-controls": "dialog", "aria-haspopup": "dialog", "aria-expanded": isDialogOpen, "aria-label": srOpenText }), jsxs("div", { className: clsx("ids-datepicker__dialog", { "ids-datepicker__dialog--show": isDialogOpen }), role: "dialog", ref: dialogRef, id: dialogId, "aria-modal": true, "aria-labelledby": headerId, children: [jsxs("div", { className: "ids-datepicker__dialog-bar", children: [jsx("div", { className: "ids-datepicker__dialog-header", id: headerId, ref: headerRef, tabIndex: -1, children: calendarHeader }), jsx("button", { className: "ids-datepicker__dialog-close-button", onClick: closeDialog, "aria-label": srCloseText })] }), jsx(DayPicker, { mode: "single", locale: sv, labels: {
|
|
193
|
+
return (jsxs("div", { className: clsx("ids-datepicker", { "ids-datepicker--invalid": !noValidation && (isInvalid || hasDateError) }, className), ...props, children: [isDialogOpen && jsx("div", { className: "ids-datepicker__overlay" }), label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { htmlFor: inputId, className: "ids-label", children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsxs("div", { className: "ids-datepicker__input-wrapper", children: [jsx("input", { className: clsx("ids-datepicker__input", { "ids-input--light": light }), ref: inputRef, style: { fontSize: "inherit" }, id: inputId, type: "text", value: inputValue, required: required, disabled: disabled, "aria-invalid": !noValidation && (isInvalid || hasDateError), placeholder: placeholder, onChange: handleInputChange, onInvalid: handleInvalid, onBlur: handleBlur }), jsx("button", { ref: triggerRef, type: "button", className: "ids-datepicker__trigger", style: { fontSize: "inherit" }, disabled: disabled, onClick: handleOpenDialog, "aria-controls": "dialog", "aria-haspopup": "dialog", "aria-expanded": isDialogOpen, "aria-label": srOpenText }), jsxs("div", { className: clsx("ids-datepicker__dialog", { "ids-datepicker__dialog--show": isDialogOpen }), role: "dialog", ref: dialogRef, id: dialogId, "aria-modal": true, "aria-labelledby": headerId, children: [jsxs("div", { className: "ids-datepicker__dialog-bar", children: [jsx("div", { className: "ids-datepicker__dialog-header", id: headerId, ref: headerRef, tabIndex: -1, children: calendarHeader }), jsx("button", { className: "ids-datepicker__dialog-close-button", onClick: closeDialog, "aria-label": srCloseText })] }), jsx(DayPicker, { mode: "single", locale: sv, labels: {
|
|
156
194
|
labelWeekNumberHeader: () => "Veckonumer",
|
|
157
195
|
labelWeekNumber: (weekNumber) => `vecka`,
|
|
158
196
|
labelDayButton(date, modifiers, options, dateLib) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import "@inera/ids-design/components/form/error-message/error-message.css";
|
|
3
2
|
interface IDSErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
3
|
id?: string;
|
|
5
4
|
show?: boolean;
|
|
6
5
|
compact?: boolean;
|
|
7
6
|
children?: ReactNode;
|
|
8
7
|
}
|
|
9
|
-
export declare
|
|
8
|
+
export declare function IDSErrorMessage({ show, compact, id, children, className, ...props }: IDSErrorMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import '@inera/ids-design/components/form/error-message/error-message.css';
|
|
4
2
|
import clsx from 'clsx';
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
function IDSErrorMessage({ show = false, compact = false, id, children, className, ...props }) {
|
|
7
5
|
return (jsx("div", { id: id, style: { marginTop: compact && "0" }, className: clsx("ids-error-message", {
|
|
8
6
|
"ids-error-message--show": show
|
|
9
7
|
}, className), ...props, children: jsxs("span", { className: "ids-error-message__text", children: [" ", children, " "] }) }));
|
|
10
|
-
}
|
|
8
|
+
}
|
|
11
9
|
|
|
12
10
|
export { IDSErrorMessage };
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare function useGroupValidity(ref: React.RefObject<HTMLFieldSetElement>, type: "checkbox" | "radio", onInvalid?: () => void):
|
|
1
|
+
export declare function useGroupValidity(ref: React.RefObject<HTMLFieldSetElement>, type: "checkbox" | "radio", onInvalid?: () => void): {
|
|
2
|
+
isValid: boolean;
|
|
3
|
+
hasInteracted: boolean;
|
|
4
|
+
};
|
|
@@ -34,7 +34,9 @@ function useGroupValidity(ref, type, onInvalid) {
|
|
|
34
34
|
validate();
|
|
35
35
|
};
|
|
36
36
|
const handleChange = () => {
|
|
37
|
-
|
|
37
|
+
if (isValid) {
|
|
38
|
+
setHasInteracted(false);
|
|
39
|
+
}
|
|
38
40
|
validate();
|
|
39
41
|
};
|
|
40
42
|
inputs.forEach(cb => {
|
|
@@ -55,7 +57,10 @@ function useGroupValidity(ref, type, onInvalid) {
|
|
|
55
57
|
form?.removeEventListener("submit", handleSubmit);
|
|
56
58
|
};
|
|
57
59
|
}, [ref, onInvalid]);
|
|
58
|
-
return
|
|
60
|
+
return {
|
|
61
|
+
isValid,
|
|
62
|
+
hasInteracted
|
|
63
|
+
};
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
export { useGroupValidity };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useInputValidity(ref: React.RefObject<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement
|
|
1
|
+
export declare function useInputValidity(ref: React.RefObject<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>, validateOnBlur?: boolean): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
|
|
3
|
-
function useInputValidity(ref) {
|
|
3
|
+
function useInputValidity(ref, validateOnBlur) {
|
|
4
4
|
const [isValid, setIsValid] = useState(true);
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
const inputEl = ref.current;
|
|
@@ -11,13 +11,17 @@ function useInputValidity(ref) {
|
|
|
11
11
|
};
|
|
12
12
|
const form = inputEl.closest("form");
|
|
13
13
|
form?.addEventListener("submit", updateValidity);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
if (validateOnBlur) {
|
|
15
|
+
inputEl.addEventListener("blur", updateValidity);
|
|
16
|
+
}
|
|
17
|
+
inputEl.addEventListener("input", updateValidity);
|
|
16
18
|
inputEl.addEventListener("invalid", updateValidity);
|
|
17
19
|
return () => {
|
|
18
20
|
form?.removeEventListener("submit", updateValidity);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
if (validateOnBlur) {
|
|
22
|
+
inputEl.removeEventListener("blur", updateValidity);
|
|
23
|
+
}
|
|
24
|
+
inputEl.removeEventListener("input", updateValidity);
|
|
21
25
|
inputEl.removeEventListener("invalid", updateValidity);
|
|
22
26
|
};
|
|
23
27
|
}, [ref]);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ReactNode, InputHTMLAttributes, CSSProperties } from "react";
|
|
2
|
+
export interface IDSInputBaseProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
label: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
hint?: string | ReactNode;
|
|
7
|
+
showSearchLabel?: boolean;
|
|
8
|
+
errorMsg?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
focusAnchor?: boolean;
|
|
13
|
+
light?: boolean;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
tooltip?: ReactNode;
|
|
16
|
+
submitButton?: ReactNode;
|
|
17
|
+
dataTestId?: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
hintId?: string;
|
|
20
|
+
errorMsgId?: string;
|
|
21
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
export declare function IDSInputBase({ label, type, icon, hint, showSearchLabel, errorMsg, dataTestId, disabled, invalid, required, focusAnchor, light, readOnly, tooltip, submitButton, className, id, hintId, errorMsgId, inputRef, style, ...props }: IDSInputBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
5
|
+
|
|
6
|
+
function IDSInputBase({ label, type = "text", icon, hint, showSearchLabel = false, errorMsg, dataTestId, disabled = false, invalid = false, required = false, focusAnchor = false, light = false, readOnly = false, tooltip, submitButton, className, id, hintId, errorMsgId, inputRef, style, ...props }) {
|
|
7
|
+
const reactId = useId();
|
|
8
|
+
const inputId = !!id ? id : `input-base-${reactId}`;
|
|
9
|
+
const baseHintId = !!hintId ? hintId : `input-base-hint-${reactId}`;
|
|
10
|
+
const baseErrorMsgId = !!errorMsgId ? errorMsgId : `input-base-error-${reactId}`;
|
|
11
|
+
const showErrorMsg = invalid && !!errorMsg;
|
|
12
|
+
const ariaHandler = showErrorMsg
|
|
13
|
+
? {
|
|
14
|
+
"aria-describedby": baseErrorMsgId
|
|
15
|
+
}
|
|
16
|
+
: !!hint
|
|
17
|
+
? {
|
|
18
|
+
"aria-describedby": baseHintId
|
|
19
|
+
}
|
|
20
|
+
: {};
|
|
21
|
+
ariaHandler["aria-label"] = type === "search" && !showSearchLabel ? label : "";
|
|
22
|
+
return (jsx("div", { className: clsx("ids-input", { "ids-input--search": type === "search", "ids-inout--icon": !!icon }, className), "data-testid": dataTestId, style: style, children: jsxs("div", { className: "ids-input__wrapper", children: [label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { className: clsx("ids-label", {
|
|
23
|
+
"ids-label--disabled": disabled || readOnly,
|
|
24
|
+
"ids-hidden": type === "search" && !showSearchLabel
|
|
25
|
+
}), htmlFor: inputId, children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsxs("div", { className: "ids-input__input-wrapper", children: [type === "search" && jsx("span", { className: "ids-input__search-icon" }), jsx("input", { ref: inputRef, id: inputId, type: type, readOnly: readOnly, className: clsx("ids-input__input", {
|
|
26
|
+
"ids-input--light": light,
|
|
27
|
+
"ids-input--invalid": invalid,
|
|
28
|
+
"ids-focus-anchor": focusAnchor
|
|
29
|
+
}), "aria-invalid": invalid, required: required, "aria-required": required, disabled: disabled, "aria-disabled": disabled, ...ariaHandler, ...props }), icon && type !== "search" && jsx("span", { className: `ids-input__icon ids-icon-${icon}` })] }), hint && (jsx("div", { id: baseHintId, className: "ids-input__hint", children: hint })), showErrorMsg && (jsx(IDSErrorMessage, { id: baseErrorMsgId, show: true, children: errorMsg }))] }) }));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { IDSInputBase };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, InputHTMLAttributes } from "react";
|
|
2
2
|
interface IDSInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
label: string;
|
|
4
4
|
type?: string;
|
|
@@ -16,6 +16,7 @@ interface IDSInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
16
16
|
tooltip?: ReactNode;
|
|
17
17
|
submitButton?: ReactNode;
|
|
18
18
|
dataTestId?: string;
|
|
19
|
+
validationOnBlur?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export declare const IDSInput:
|
|
21
|
+
export declare const IDSInput: import("react").ForwardRefExoticComponent<IDSInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
21
22
|
export {};
|
|
@@ -1,39 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef, useRef } from 'react';
|
|
4
|
-
import { useElementId } from '../../utils/hooks/useElementId.js';
|
|
5
|
-
import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
6
4
|
import { useInputValidity } from '../form-hooks/useInputValidity.js';
|
|
7
|
-
import {
|
|
8
|
-
import clsx from 'clsx';
|
|
5
|
+
import { IDSInputBase } from './input-base.js';
|
|
9
6
|
|
|
10
|
-
const IDSInput = forwardRef(({
|
|
11
|
-
const fieldId = useElementId(id);
|
|
12
|
-
const errorMsgId = useElementId();
|
|
13
|
-
const hintId = useElementId();
|
|
7
|
+
const IDSInput = forwardRef(({ invalid = false, noValidation = false, style, validationOnBlur = false, ...props }, ref) => {
|
|
14
8
|
const inputRef = useRef(null);
|
|
15
|
-
|
|
9
|
+
// Merge forwarded + local ref
|
|
10
|
+
const mergedRef = (node) => {
|
|
16
11
|
inputRef.current = node;
|
|
17
12
|
if (typeof ref === "function")
|
|
18
13
|
ref(node);
|
|
19
14
|
else if (ref)
|
|
20
15
|
ref.current = node;
|
|
21
16
|
};
|
|
22
|
-
|
|
17
|
+
// Validation
|
|
18
|
+
const hasValidValue = useInputValidity(inputRef, validationOnBlur);
|
|
23
19
|
const isInvalid = (invalid || !hasValidValue) && !noValidation;
|
|
24
|
-
|
|
25
|
-
const inputElement = (jsxs("div", { className: clsx("ids-input__wrapper", {
|
|
26
|
-
"ids-input--icon": icon
|
|
27
|
-
}), "data-testid": dataTestId, children: [type === "search" && jsx("span", { className: "ids-input__search-icon" }), jsx("input", { ref: combinedRef, id: fieldId, type: type, readOnly: readOnly, className: clsx("ids-input__input", {
|
|
28
|
-
"ids-input--light": light,
|
|
29
|
-
"ids-input--invalid": invalid,
|
|
30
|
-
"ids-focus-anchor": focusAnchor
|
|
31
|
-
}), "aria-invalid": isInvalid, required: required, "aria-required": required, disabled: disabled, "aria-disabled": disabled, ...props }), icon && type !== "search" && jsx("span", { className: `ids-input__icon ids-icon-${icon}` })] }));
|
|
32
|
-
const labelElement = (jsxs("div", { className: "ids-label-tooltip-wrapper", children: [jsx("label", { className: clsx("ids-label", {
|
|
33
|
-
"ids-label--disabled": disabled || readOnly,
|
|
34
|
-
"ids-hidden": type === "search" && !showSearchLabel
|
|
35
|
-
}), htmlFor: fieldId, children: label }), tooltip] }));
|
|
36
|
-
return (jsxs("div", { className: "ids-input-component", children: [jsxs("div", { className: clsx("ids-input", { "ids-input--search": type === "search" }, className), children: [type === "search" ? (jsxs(Fragment, { children: [jsxs("div", { className: "ids-input__search-wrapper", children: [labelElement, inputElement] }), submitButton] })) : (jsxs(Fragment, { children: [labelElement, inputElement] })), hint && (jsx("div", { id: hintId, className: "ids-input__hint", children: hint }))] }), isInvalid && errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
|
|
20
|
+
return jsx(IDSInputBase, { ...props, style: style, invalid: isInvalid, inputRef: mergedRef });
|
|
37
21
|
});
|
|
38
22
|
IDSInput.displayName = "IDSInput";
|
|
39
23
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode, InputHTMLAttributes } from "react";
|
|
2
|
+
export interface IDSRadioBaseProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
light?: boolean;
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
focusAnchor?: boolean;
|
|
10
|
+
tooltip?: ReactNode;
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
errorMsgId?: string;
|
|
14
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
15
|
+
}
|
|
16
|
+
export declare function IDSRadioBase({ id, name, light, compact, disabled, focusAnchor, tooltip, dataTestId, children, className, inputRef, invalid, errorMsgId, ...props }: IDSRadioBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
function IDSRadioBase({ id, name, light, compact, disabled, focusAnchor, tooltip, dataTestId, children, className, inputRef, invalid, errorMsgId, ...props }) {
|
|
6
|
+
const reactId = useId();
|
|
7
|
+
const inputId = !!id ? id : `radio-base-${reactId}`;
|
|
8
|
+
const showErrorMsg = invalid && !!errorMsgId;
|
|
9
|
+
// for radio the errorMsgId always comes from the group
|
|
10
|
+
const ariaHandler = showErrorMsg
|
|
11
|
+
? {
|
|
12
|
+
"aria-describedby": errorMsgId
|
|
13
|
+
}
|
|
14
|
+
: {};
|
|
15
|
+
return (jsxs("div", { className: clsx("ids-radio", className), "data-testid": dataTestId, children: [jsx("input", { id: inputId, ref: inputRef, type: "radio", className: clsx("ids-radio__input", {
|
|
16
|
+
"ids-input--light": light,
|
|
17
|
+
"ids-focus-anchor": focusAnchor
|
|
18
|
+
}), name: name, disabled: disabled, "aria-disabled": disabled, "aria-invalid": invalid, ...ariaHandler, ...props }), !!children && (jsxs("div", { className: "ids-label-wrapper", children: [jsx("label", { htmlFor: inputId, className: clsx("ids-radio__label ids-label", {
|
|
19
|
+
"ids-label--clickable": !disabled,
|
|
20
|
+
"ids-label--disabled": disabled
|
|
21
|
+
}), children: children }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] }))] }));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { IDSRadioBase };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode, FieldsetHTMLAttributes } from "react";
|
|
2
|
+
interface IDSRadioGroupBaseProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
3
|
+
legend?: string;
|
|
4
|
+
errorMsg?: string | ReactNode;
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
tooltip?: ReactNode;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
errorMsgId?: string;
|
|
10
|
+
groupRef?: React.Ref<HTMLFieldSetElement>;
|
|
11
|
+
}
|
|
12
|
+
export declare function IDSRadioGroupBase({ legend, errorMsg, errorMsgId, compact, required, tooltip, className, children, invalid, groupRef, ...props }: IDSRadioGroupBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
function IDSRadioGroupBase({ legend, errorMsg, errorMsgId, compact = false, required = false, tooltip, className, children, invalid, groupRef, ...props }) {
|
|
6
|
+
const showErrorMsg = invalid && !!errorMsg && !!errorMsgId;
|
|
7
|
+
return (jsxs("fieldset", { ref: groupRef, "aria-required": required, className: clsx("ids-form-group__fieldset", { "ids-form-group__fieldset--compact": compact }, className), ...props, children: [legend && (jsx("div", { className: "ids-label-wrapper", children: jsxs("legend", { children: [legend, tooltip && jsx("span", { className: "ids-legend__tooltip", children: tooltip })] }) })), children, showErrorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { IDSRadioGroupBase };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
interface IDSRadioGroupProps extends
|
|
3
|
-
name
|
|
1
|
+
import { ChangeEvent, ReactNode, FieldsetHTMLAttributes } from "react";
|
|
2
|
+
interface IDSRadioGroupProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
3
|
+
name?: string;
|
|
4
4
|
legend?: string;
|
|
5
5
|
errorMsg?: string | ReactNode;
|
|
6
6
|
compact?: boolean;
|
|
7
|
+
invalid?: boolean;
|
|
7
8
|
required?: boolean;
|
|
8
9
|
tooltip?: ReactNode;
|
|
9
|
-
|
|
10
|
+
noValidation?: boolean;
|
|
10
11
|
onRadioChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
11
12
|
}
|
|
12
|
-
export declare
|
|
13
|
+
export declare function IDSRadioGroup({ name, required, noValidation, invalid, errorMsg, children, onRadioChange, ...props }: IDSRadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React, { useRef, useId } from 'react';
|
|
4
|
+
import { IDSRadioGroupBase } from './radio-group-base.js';
|
|
5
|
+
import { IDSRadio } from './radio.js';
|
|
6
6
|
import { useGroupValidity } from '../form-hooks/useGroupValidity.js';
|
|
7
|
-
import clsx from 'clsx';
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
function IDSRadioGroup({ name, required, noValidation, invalid, errorMsg, children, onRadioChange, ...props }) {
|
|
10
9
|
const groupRef = useRef(null);
|
|
11
|
-
const isValid = useGroupValidity(groupRef, "radio");
|
|
12
|
-
const
|
|
10
|
+
const { isValid, hasInteracted } = useGroupValidity(groupRef, "radio");
|
|
11
|
+
const reactId = useId();
|
|
12
|
+
const groupName = !!name ? name : `radio-group-name-${reactId}`;
|
|
13
|
+
const errorMsgId = `radio-error-${reactId}`;
|
|
13
14
|
const clonedChildren = React.Children.map(children, child => {
|
|
14
|
-
if (React.isValidElement(child)
|
|
15
|
-
return
|
|
15
|
+
if (!React.isValidElement(child))
|
|
16
|
+
return child;
|
|
17
|
+
if (child.type === IDSRadio) {
|
|
18
|
+
const { id, ...rest } = child.props;
|
|
19
|
+
const cloneProps = {
|
|
20
|
+
...rest,
|
|
16
21
|
key: child.props.id,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
id: child.props.id,
|
|
23
|
+
name: groupName,
|
|
24
|
+
required: required && !noValidation,
|
|
25
|
+
noValidation,
|
|
26
|
+
groupErrorMsgId: errorMsg ? errorMsgId : undefined,
|
|
27
|
+
groupInvalid: !isValid && hasInteracted && !noValidation,
|
|
21
28
|
onChange: onRadioChange
|
|
22
|
-
}
|
|
29
|
+
};
|
|
30
|
+
return React.cloneElement(child, cloneProps);
|
|
23
31
|
}
|
|
24
32
|
return child;
|
|
25
33
|
});
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
}, className), ...props, children: [jsxs("legend", { children: [legend, tooltip] }), clonedChildren, !isValid && !!errorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, children: errorMsg }))] }));
|
|
29
|
-
};
|
|
34
|
+
return (jsx(IDSRadioGroupBase, { ...props, groupRef: groupRef, invalid: !isValid && hasInteracted || invalid, errorMsg: !noValidation && errorMsg, errorMsgId: errorMsgId, children: clonedChildren }));
|
|
35
|
+
}
|
|
30
36
|
|
|
31
37
|
export { IDSRadioGroup };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ReactNode,
|
|
1
|
+
import { ReactNode, InputHTMLAttributes } from "react";
|
|
2
2
|
export interface IDSRadioProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
-
name?: string;
|
|
4
3
|
id?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
groupInvalid?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
noValidation?: boolean;
|
|
4
|
+
key?: string;
|
|
5
|
+
name?: string;
|
|
10
6
|
light?: boolean;
|
|
11
7
|
compact?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
groupInvalid?: boolean;
|
|
12
11
|
focusAnchor?: boolean;
|
|
13
12
|
tooltip?: ReactNode;
|
|
14
|
-
children?: ReactNode;
|
|
15
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
16
13
|
dataTestId?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
noValidation?: boolean;
|
|
16
|
+
groupErrorMsgId?: string;
|
|
17
17
|
}
|
|
18
18
|
export declare const IDSRadio: import("react").ForwardRefExoticComponent<IDSRadioProps & import("react").RefAttributes<HTMLInputElement>>;
|