@inera/ids-react 9.1.1 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion-base.d.ts +4 -1
- package/components/accordion/accordion-base.js +33 -7
- package/components/accordion/accordion.d.ts +4 -1
- package/components/accordion/accordion.js +14 -11
- package/components/alert/alert-base.d.ts +3 -0
- package/components/alert/alert-base.js +4 -3
- package/components/alert/alert.d.ts +6 -1
- package/components/alert/alert.js +12 -9
- package/components/badge/badge.d.ts +1 -1
- package/components/badge/badge.js +6 -3
- package/components/breadcrumbs/breadcrumbs.d.ts +3 -0
- package/components/breadcrumbs/breadcrumbs.js +25 -4
- package/components/button/button-group.d.ts +3 -0
- package/components/button/button-group.js +1 -0
- package/components/button/button.js +22 -14
- package/components/card/card.d.ts +3 -0
- package/components/card/card.js +2 -1
- package/components/carousel/carousel-item.d.ts +3 -0
- package/components/carousel/carousel-item.js +1 -0
- package/components/date-label/date-label.d.ts +3 -0
- package/components/date-label/date-label.js +1 -0
- package/components/dialog/dialog-base.d.ts +0 -1
- package/components/dialog/dialog-base.js +3 -3
- package/components/dialog/dialog.d.ts +3 -0
- package/components/dialog/dialog.js +19 -19
- package/components/dropdown/dropdown-base.js +6 -3
- package/components/dropdown/dropdown-content-button.js +1 -1
- package/components/dropdown/dropdown-content-link.d.ts +3 -0
- package/components/dropdown/dropdown-content-link.js +1 -1
- package/components/dropdown/dropdown.d.ts +3 -0
- package/components/dropdown/dropdown.js +28 -31
- package/components/footer-1177/footer-1177.d.ts +3 -0
- package/components/footer-1177/footer-1177.js +1 -0
- package/components/footer-1177-admin/footer-1177-admin.d.ts +3 -0
- package/components/footer-1177-admin/footer-1177-admin.js +1 -0
- package/components/footer-1177-pro/footer-1177-pro.d.ts +3 -0
- package/components/footer-1177-pro/footer-1177-pro.js +1 -0
- package/components/footer-inera/footer-inera.d.ts +3 -0
- package/components/footer-inera/footer-inera.js +1 -0
- package/components/footer-inera-admin/footer-inera-admin.d.ts +3 -0
- package/components/footer-inera-admin/footer-inera-admin.js +2 -1
- package/components/footer-inera-general/footer-inera-general.d.ts +21 -0
- package/components/footer-inera-general/footer-inera-general.js +28 -0
- package/components/form/check-button/check-button.js +1 -0
- package/components/form/checkbox/checkbox-base.d.ts +7 -13
- package/components/form/checkbox/checkbox-base.js +10 -10
- package/components/form/checkbox/checkbox-group-base.d.ts +3 -0
- package/components/form/checkbox/checkbox-group-base.js +3 -2
- package/components/form/checkbox/checkbox-group.d.ts +3 -0
- package/components/form/checkbox/checkbox-group.js +1 -0
- package/components/form/checkbox/checkbox.d.ts +5 -15
- package/components/form/checkbox/checkbox.js +10 -2
- package/components/form/datepicker/datepicker.d.ts +8 -12
- package/components/form/datepicker/datepicker.js +25 -23
- package/components/form/error-message/error-message.d.ts +3 -0
- package/components/form/error-message/error-message.js +1 -0
- package/components/form/form-props/form-props.d.ts +18 -0
- package/components/form/input/input-base.d.ts +7 -16
- package/components/form/input/input-base.js +15 -16
- package/components/form/input/input.d.ts +3 -16
- package/components/form/input/input.js +3 -4
- package/components/form/radio/radio-base.d.ts +8 -13
- package/components/form/radio/radio-base.js +8 -10
- package/components/form/radio/radio-group-base.d.ts +3 -0
- package/components/form/radio/radio-group-base.js +1 -0
- package/components/form/radio/radio-group.d.ts +3 -0
- package/components/form/radio/radio-group.js +2 -2
- package/components/form/radio/radio.d.ts +2 -14
- package/components/form/radio/radio.js +11 -5
- package/components/form/radio-button/radio-button-group-base.d.ts +3 -0
- package/components/form/radio-button/radio-button-group-base.js +1 -0
- package/components/form/radio-button/radio-button-group.d.ts +3 -0
- package/components/form/radio-button/radio-button-group.js +4 -1
- package/components/form/radio-button/radio-button.js +1 -0
- package/components/form/range/range-base.d.ts +6 -8
- package/components/form/range/range-base.js +3 -2
- package/components/form/range/range.d.ts +2 -7
- package/components/form/range/range.js +13 -6
- package/components/form/select/select-base.d.ts +7 -15
- package/components/form/select/select-base.js +8 -8
- package/components/form/select/select.d.ts +2 -14
- package/components/form/select/select.js +12 -5
- package/components/form/select-multiple/select-multiple-base.d.ts +7 -14
- package/components/form/select-multiple/select-multiple-base.js +7 -5
- package/components/form/select-multiple/select-multiple.d.ts +4 -15
- package/components/form/select-multiple/select-multiple.js +4 -6
- package/components/form/spinner/spinner.d.ts +3 -0
- package/components/form/spinner/spinner.js +1 -0
- package/components/form/textarea/textarea-base.d.ts +7 -15
- package/components/form/textarea/textarea-base.js +7 -10
- package/components/form/textarea/textarea.d.ts +4 -14
- package/components/form/textarea/textarea.js +13 -6
- package/components/form/time/time-base.d.ts +6 -12
- package/components/form/time/time-base.js +7 -7
- package/components/form/time/time.d.ts +2 -14
- package/components/form/time/time.js +13 -6
- package/components/global-alert/global-alert-base.d.ts +3 -0
- package/components/global-alert/global-alert-base.js +3 -2
- package/components/global-alert/global-alert.d.ts +6 -1
- package/components/global-alert/global-alert.js +12 -9
- package/components/header-1177/header-1177-avatar-base.d.ts +3 -0
- package/components/header-1177/header-1177-avatar-base.js +1 -0
- package/components/header-1177/header-1177-avatar.d.ts +3 -0
- package/components/header-1177/header-1177-avatar.js +7 -15
- package/components/header-1177/header-1177-base.d.ts +3 -0
- package/components/header-1177/header-1177-base.js +1 -0
- package/components/header-1177/header-1177-item-base.d.ts +3 -0
- package/components/header-1177/header-1177-item-base.js +1 -0
- package/components/header-1177/header-1177-item.d.ts +3 -0
- package/components/header-1177/header-1177-item.js +1 -0
- package/components/header-1177/header-1177-menu-mobile-base.d.ts +3 -0
- package/components/header-1177/header-1177-menu-mobile-base.js +1 -0
- package/components/header-1177/header-1177-menu-mobile.d.ts +3 -0
- package/components/header-1177/header-1177-menu-mobile.js +7 -24
- package/components/header-1177/header-1177-nav-base.d.ts +3 -0
- package/components/header-1177/header-1177-nav-base.js +1 -0
- package/components/header-1177/header-1177-nav-item-base.d.ts +3 -0
- package/components/header-1177/header-1177-nav-item-base.js +1 -0
- package/components/header-1177/header-1177-nav-item-mobile-base.d.ts +3 -0
- package/components/header-1177/header-1177-nav-item-mobile-base.js +1 -0
- package/components/header-1177/header-1177-nav-item-mobile.d.ts +3 -0
- package/components/header-1177/header-1177-nav-item-mobile.js +1 -0
- package/components/header-1177/header-1177-nav-item.d.ts +3 -0
- package/components/header-1177/header-1177-nav-item.js +6 -29
- package/components/header-1177/header-1177-nav.d.ts +3 -0
- package/components/header-1177/header-1177-nav.js +2 -1
- package/components/header-1177/header-1177-region-picker-base.d.ts +3 -0
- package/components/header-1177/header-1177-region-picker-base.js +1 -0
- package/components/header-1177/header-1177-region-picker-mobile-base.d.ts +3 -0
- package/components/header-1177/header-1177-region-picker-mobile-base.js +1 -0
- package/components/header-1177/header-1177-region-picker-mobile.d.ts +3 -0
- package/components/header-1177/header-1177-region-picker-mobile.js +1 -0
- package/components/header-1177/header-1177-region-picker.d.ts +3 -0
- package/components/header-1177/header-1177-region-picker.js +1 -0
- package/components/header-1177/header-1177.d.ts +3 -0
- package/components/header-1177/header-1177.js +1 -0
- package/components/header-1177-admin/header-1177-admin-avatar-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar-base.js +2 -1
- package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar-mobile-base.js +2 -1
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar-mobile.js +7 -7
- package/components/header-1177-admin/header-1177-admin-avatar.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-avatar.js +7 -25
- package/components/header-1177-admin/header-1177-admin-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-item-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-item-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-item.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-item.js +1 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile.js +7 -26
- package/components/header-1177-admin/header-1177-admin-nav-base.d.ts +6 -1
- package/components/header-1177-admin/header-1177-admin-nav-base.js +5 -3
- package/components/header-1177-admin/header-1177-admin-nav-item-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile-base.js +1 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-nav-item-mobile.js +1 -0
- package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin-nav-item.js +6 -29
- package/components/header-1177-admin/header-1177-admin-nav.d.ts +6 -1
- package/components/header-1177-admin/header-1177-admin-nav.js +3 -2
- package/components/header-1177-admin/header-1177-admin.d.ts +3 -0
- package/components/header-1177-admin/header-1177-admin.js +1 -0
- package/components/header-1177-pro/header-1177-pro-avatar-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar-mobile.js +6 -5
- package/components/header-1177-pro/header-1177-pro-avatar.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-avatar.js +7 -26
- package/components/header-1177-pro/header-1177-pro-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-item-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-item-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-item.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-item.js +1 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-menu-mobile.js +7 -26
- package/components/header-1177-pro/header-1177-pro-nav-base.d.ts +6 -1
- package/components/header-1177-pro/header-1177-pro-nav-base.js +5 -3
- package/components/header-1177-pro/header-1177-pro-nav-item-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile-base.js +1 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-nav-item-mobile.js +1 -0
- package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-nav-item.js +6 -29
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +6 -1
- package/components/header-1177-pro/header-1177-pro-nav.js +3 -2
- package/components/header-1177-pro/header-1177-pro-region-picker-base.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-base.js +2 -1
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.d.ts +5 -1
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile-base.js +4 -2
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.js +2 -1
- package/components/header-1177-pro/header-1177-pro-region-picker.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro-region-picker.js +1 -0
- package/components/header-1177-pro/header-1177-pro.d.ts +3 -0
- package/components/header-1177-pro/header-1177-pro.js +1 -0
- package/components/header-inera/header-inera-base.d.ts +3 -0
- package/components/header-inera/header-inera-base.js +1 -0
- package/components/header-inera/header-inera-item-base.d.ts +3 -0
- package/components/header-inera/header-inera-item-base.js +1 -0
- package/components/header-inera/header-inera-item.d.ts +3 -0
- package/components/header-inera/header-inera-item.js +1 -0
- package/components/header-inera/header-inera-menu-mobile-base.d.ts +3 -0
- package/components/header-inera/header-inera-menu-mobile-base.js +1 -0
- package/components/header-inera/header-inera-menu-mobile.d.ts +3 -0
- package/components/header-inera/header-inera-menu-mobile.js +7 -26
- package/components/header-inera/header-inera-nav-base.d.ts +3 -0
- package/components/header-inera/header-inera-nav-base.js +1 -0
- package/components/header-inera/header-inera-nav-item-base.d.ts +3 -0
- package/components/header-inera/header-inera-nav-item-base.js +1 -0
- package/components/header-inera/header-inera-nav-item.d.ts +3 -0
- package/components/header-inera/header-inera-nav-item.js +6 -29
- package/components/header-inera/header-inera-nav.d.ts +3 -0
- package/components/header-inera/header-inera-nav.js +1 -0
- package/components/header-inera/header-inera.d.ts +3 -0
- package/components/header-inera/header-inera.js +1 -0
- package/components/header-inera-admin/header-inera-admin-avatar-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-avatar-base.js +2 -1
- package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-avatar-mobile-base.js +2 -1
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +6 -5
- package/components/header-inera-admin/header-inera-admin-avatar.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-avatar.js +7 -25
- package/components/header-inera-admin/header-inera-admin-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-base.js +1 -0
- package/components/header-inera-admin/header-inera-admin-item-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-item-base.js +1 -0
- package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-item.js +1 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile-base.js +2 -1
- package/components/header-inera-admin/header-inera-admin-menu-mobile.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile.js +7 -26
- package/components/header-inera-admin/header-inera-admin-nav-base.d.ts +6 -1
- package/components/header-inera-admin/header-inera-admin-nav-base.js +5 -3
- package/components/header-inera-admin/header-inera-admin-nav-item-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-base.js +1 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile-base.js +1 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-nav-item-mobile.js +1 -0
- package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin-nav-item.js +6 -29
- package/components/header-inera-admin/header-inera-admin-nav.d.ts +6 -1
- package/components/header-inera-admin/header-inera-admin-nav.js +3 -2
- package/components/header-inera-admin/header-inera-admin.d.ts +3 -0
- package/components/header-inera-admin/header-inera-admin.js +1 -0
- package/components/header-inera-general/header-inera-general-base.d.ts +16 -0
- package/components/header-inera-general/header-inera-general-base.js +12 -0
- package/components/header-inera-general/header-inera-general-item-base.d.ts +11 -0
- package/components/header-inera-general/header-inera-general-item-base.js +13 -0
- package/components/header-inera-general/header-inera-general-item.d.ts +10 -0
- package/components/header-inera-general/header-inera-general-item.js +12 -0
- package/components/header-inera-general/header-inera-general-menu-mobile-base.d.ts +15 -0
- package/components/header-inera-general/header-inera-general-menu-mobile-base.js +19 -0
- package/components/header-inera-general/header-inera-general-menu-mobile.d.ts +13 -0
- package/components/header-inera-general/header-inera-general-menu-mobile.js +31 -0
- package/components/header-inera-general/header-inera-general-nav-base.d.ts +10 -0
- package/components/header-inera-general/header-inera-general-nav-base.js +11 -0
- package/components/header-inera-general/header-inera-general-nav-item-base.d.ts +21 -0
- package/components/header-inera-general/header-inera-general-nav-item-base.js +27 -0
- package/components/header-inera-general/header-inera-general-nav-item.d.ts +18 -0
- package/components/header-inera-general/header-inera-general-nav-item.js +27 -0
- package/components/header-inera-general/header-inera-general-nav.d.ts +8 -0
- package/components/header-inera-general/header-inera-general-nav.js +12 -0
- package/components/header-inera-general/header-inera-general.d.ts +15 -0
- package/components/header-inera-general/header-inera-general.js +11 -0
- package/components/header-patient/header-patient.d.ts +3 -0
- package/components/header-patient/header-patient.js +1 -0
- package/components/link/action-link.d.ts +3 -0
- package/components/link/action-link.js +2 -1
- package/components/link/box-link.d.ts +3 -0
- package/components/link/box-link.js +1 -0
- package/components/link/link.d.ts +3 -0
- package/components/link/link.js +1 -0
- package/components/list-pagination/list-pagination-links.d.ts +3 -0
- package/components/list-pagination/list-pagination-links.js +1 -0
- package/components/list-pagination/list-pagination.d.ts +3 -0
- package/components/list-pagination/list-pagination.js +4 -3
- package/components/mobile-menu/mobile-item-base.d.ts +3 -0
- package/components/mobile-menu/mobile-item-base.js +1 -0
- package/components/mobile-menu/mobile-item.d.ts +3 -0
- package/components/mobile-menu/mobile-item.js +1 -0
- package/components/mobile-menu/mobile-menu.d.ts +3 -0
- package/components/mobile-menu/mobile-menu.js +1 -0
- package/components/navigation-content/navigation-content.d.ts +3 -0
- package/components/navigation-content/navigation-content.js +1 -0
- package/components/navigation-local/navigation-local.d.ts +3 -0
- package/components/navigation-local/navigation-local.js +1 -0
- package/components/notification-badge/notification-badge.d.ts +2 -4
- package/components/notification-badge/notification-badge.js +6 -3
- package/components/popover/popover-base.d.ts +4 -1
- package/components/popover/popover-base.js +1 -0
- package/components/popover/popover-content.d.ts +7 -1
- package/components/popover/popover-content.js +6 -10
- package/components/popover/popover.d.ts +3 -0
- package/components/popover/popover.js +141 -52
- package/components/progressbar/progressbar.d.ts +4 -4
- package/components/progressbar/progressbar.js +5 -3
- package/components/puff-list/puff-list-item-date.d.ts +3 -0
- package/components/puff-list/puff-list-item-date.js +1 -0
- package/components/puff-list/puff-list-item-info.d.ts +3 -0
- package/components/puff-list/puff-list-item-info.js +1 -0
- package/components/puff-list/puff-list-item.d.ts +1 -1
- package/components/puff-list/puff-list-item.js +11 -13
- package/components/puff-list/puff-list.d.ts +4 -1
- package/components/puff-list/puff-list.js +2 -1
- package/components/region-icon/region-icon.d.ts +3 -0
- package/components/region-icon/region-icon.js +1 -0
- package/components/side-menu/side-menu.d.ts +3 -0
- package/components/side-menu/side-menu.js +1 -0
- package/components/side-panel/side-panel-base.d.ts +1 -0
- package/components/side-panel/side-panel-base.js +1 -1
- package/components/side-panel/side-panel-provider.d.ts +3 -0
- package/components/side-panel/side-panel-provider.js +1 -0
- package/components/side-panel/side-panel.d.ts +3 -0
- package/components/side-panel/side-panel.js +29 -7
- package/components/stepper/step-base.js +1 -1
- package/components/stepper/step.js +11 -4
- package/components/stepper/stepper.d.ts +3 -0
- package/components/stepper/stepper.js +1 -0
- package/components/tabs/tabs-base.d.ts +3 -0
- package/components/tabs/tabs-base.js +1 -0
- package/components/tabs/tabs.d.ts +3 -0
- package/components/tabs/tabs.js +1 -0
- package/components/tag/tag.d.ts +1 -1
- package/components/tag/tag.js +4 -3
- package/components/toolbar/toolbar.d.ts +5 -0
- package/components/toolbar/toolbar.js +11 -0
- package/components/tooltip/tooltip-base.d.ts +5 -1
- package/components/tooltip/tooltip-base.js +3 -2
- package/components/tooltip/tooltip.d.ts +3 -0
- package/components/tooltip/tooltip.js +26 -1
- package/components/utils/hooks/useClickOutside.d.ts +1 -9
- package/components/utils/hooks/useClickOutside.js +9 -16
- package/components/utils/hooks/useEsc.d.ts +1 -9
- package/components/utils/hooks/useEsc.js +14 -17
- package/components/utils/hooks/useLinkClick.d.ts +2 -0
- package/components/utils/hooks/useLinkClick.js +22 -0
- package/index.d.ts +24 -0
- package/index.js +12 -0
- package/package.json +2 -2
|
@@ -6,4 +6,7 @@ interface IDSErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
}
|
|
8
8
|
export declare function IDSErrorMessage({ show, compact, id, children, className, ...props }: IDSErrorMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare namespace IDSErrorMessage {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
9
12
|
export {};
|
|
@@ -6,5 +6,6 @@ function IDSErrorMessage({ show = false, compact = false, id, children, classNam
|
|
|
6
6
|
"ids-error-message--show": show
|
|
7
7
|
}, className), ...props, children: jsxs("span", { className: "ids-error-message__text", children: [" ", children, " "] }) }));
|
|
8
8
|
}
|
|
9
|
+
IDSErrorMessage.displayName = "IDSErrorMessage";
|
|
9
10
|
|
|
10
11
|
export { IDSErrorMessage };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface CommonFormProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
noValidation?: boolean;
|
|
7
|
+
validationOnBlur?: boolean;
|
|
8
|
+
label?: string;
|
|
9
|
+
errorMsg?: string;
|
|
10
|
+
hint?: string | ReactNode;
|
|
11
|
+
tooltip?: ReactNode;
|
|
12
|
+
focusAnchor?: boolean;
|
|
13
|
+
dataTestId?: string;
|
|
14
|
+
light?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface CommonFormPropsWithReadOnly extends CommonFormProps {
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
}
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import React, { ReactNode,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type?: string;
|
|
1
|
+
import React, { ReactNode, CSSProperties } from "react";
|
|
2
|
+
import { CommonFormPropsWithReadOnly } from "../form-props/form-props";
|
|
3
|
+
export interface IDSInputBaseProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonFormPropsWithReadOnly {
|
|
5
4
|
icon?: string;
|
|
6
|
-
hint?: string | ReactNode;
|
|
7
5
|
unit?: string;
|
|
8
6
|
showSearchLabel?: boolean;
|
|
9
|
-
errorMsg?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
invalid?: boolean;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
focusAnchor?: boolean;
|
|
14
|
-
light?: boolean;
|
|
15
|
-
readOnly?: boolean;
|
|
16
|
-
tooltip?: ReactNode;
|
|
17
7
|
submitButton?: ReactNode;
|
|
18
|
-
dataTestId?: string;
|
|
19
|
-
id?: string;
|
|
20
8
|
hintId?: string;
|
|
21
9
|
errorMsgId?: string;
|
|
22
10
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
23
11
|
style?: CSSProperties;
|
|
24
12
|
}
|
|
25
|
-
export declare function IDSInputBase({ label, type, icon, hint, unit, showSearchLabel, errorMsg, dataTestId, disabled, invalid, required, focusAnchor, light, readOnly, tooltip, submitButton, className, id, hintId, errorMsgId, inputRef,
|
|
13
|
+
export declare function IDSInputBase({ label, type, icon, hint, unit, showSearchLabel, errorMsg, dataTestId, disabled, invalid, required, focusAnchor, light, readOnly, tooltip, submitButton, className, id, hintId, errorMsgId, inputRef, ...props }: IDSInputBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare namespace IDSInputBase {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
@@ -3,23 +3,21 @@ import { useId } from 'react';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
5
5
|
|
|
6
|
-
function IDSInputBase({ label, type = "text", icon, hint, unit, showSearchLabel = false, errorMsg, dataTestId, disabled = false, invalid = false, required = false, focusAnchor = false, light = false, readOnly = false, tooltip, submitButton, className, id, hintId, errorMsgId, inputRef,
|
|
6
|
+
function IDSInputBase({ label, type = "text", icon, hint, unit, showSearchLabel = false, errorMsg, dataTestId, disabled = false, invalid = false, required = false, focusAnchor = false, light = false, readOnly = false, tooltip, submitButton, className, id, hintId, errorMsgId, inputRef, ...props }) {
|
|
7
7
|
const reactId = useId();
|
|
8
|
-
const inputId =
|
|
9
|
-
const baseHintId =
|
|
10
|
-
const baseErrorMsgId =
|
|
8
|
+
const inputId = id ?? `input-base-${reactId}`;
|
|
9
|
+
const baseHintId = hintId ?? `input-base-hint-${reactId}`;
|
|
10
|
+
const baseErrorMsgId = errorMsgId ?? `input-base-error-${reactId}`;
|
|
11
11
|
const showErrorMsg = invalid && !!errorMsg;
|
|
12
|
-
const ariaHandler =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ariaHandler["aria-label"] = type === "search" && !showSearchLabel ? label : "";
|
|
22
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: clsx("ids-input", { "ids-input--search": type === "search", "ids-input--icon": !!icon }, className), "data-testid": dataTestId, style: style, children: [jsxs("div", { className: "ids-input__wrapper", children: [label && (jsxs("div", { className: clsx("ids-label-wrapper", "ids-label-wrapper--margin-bottom", {
|
|
12
|
+
const ariaHandler = {};
|
|
13
|
+
const describedByIds = [showErrorMsg && baseErrorMsgId, hint && baseHintId].filter(Boolean);
|
|
14
|
+
if (describedByIds.length) {
|
|
15
|
+
ariaHandler["aria-describedby"] = describedByIds.join(" ");
|
|
16
|
+
}
|
|
17
|
+
if (type === "search" && !showSearchLabel && label) {
|
|
18
|
+
ariaHandler["aria-label"] = label;
|
|
19
|
+
}
|
|
20
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: clsx("ids-input", { "ids-input--search": type === "search", "ids-input--icon": !!icon }, className), "data-testid": dataTestId, children: [jsxs("div", { className: "ids-input__wrapper", children: [label && (jsxs("div", { className: clsx("ids-label-wrapper", "ids-label-wrapper--margin-bottom", {
|
|
23
21
|
"ids-hidden": type === "search" && !showSearchLabel
|
|
24
22
|
}), children: [jsx("label", { className: clsx("ids-label", {
|
|
25
23
|
"ids-label--disabled": disabled || readOnly
|
|
@@ -27,7 +25,8 @@ function IDSInputBase({ label, type = "text", icon, hint, unit, showSearchLabel
|
|
|
27
25
|
"ids-input--light": light,
|
|
28
26
|
"ids-input--invalid": invalid,
|
|
29
27
|
"ids-focus-anchor": focusAnchor
|
|
30
|
-
}), "aria-invalid": invalid, required: required,
|
|
28
|
+
}), "aria-invalid": invalid, required: required, disabled: disabled, ...ariaHandler, ...props }), icon && type !== "search" && jsx("span", { className: `ids-input__icon ids-icon-${icon}` })] }), unit && (jsx("div", { className: "ids-input__unit", "aria-hidden": "true", children: unit }))] }), hint && (jsx("div", { className: "ids-input__hint", id: baseHintId, children: hint }))] }), !!submitButton && submitButton] }), showErrorMsg && (jsx(IDSErrorMessage, { id: baseErrorMsgId, show: true, children: errorMsg }))] }));
|
|
31
29
|
}
|
|
30
|
+
IDSInputBase.displayName = "IDSInputBase";
|
|
32
31
|
|
|
33
32
|
export { IDSInputBase };
|
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import { ReactNode
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type?: string;
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { CommonFormPropsWithReadOnly } from "../form-props/form-props";
|
|
3
|
+
interface IDSInputProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonFormPropsWithReadOnly {
|
|
5
4
|
icon?: string;
|
|
6
|
-
hint?: string | ReactNode;
|
|
7
5
|
unit?: string;
|
|
8
6
|
showSearchLabel?: boolean;
|
|
9
|
-
errorMsg?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
invalid?: boolean;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
noValidation?: boolean;
|
|
14
|
-
focusAnchor?: boolean;
|
|
15
|
-
light?: boolean;
|
|
16
|
-
readOnly?: boolean;
|
|
17
|
-
tooltip?: ReactNode;
|
|
18
7
|
submitButton?: ReactNode;
|
|
19
|
-
dataTestId?: string;
|
|
20
|
-
validationOnBlur?: boolean;
|
|
21
8
|
}
|
|
22
9
|
export declare const IDSInput: import("react").ForwardRefExoticComponent<IDSInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
23
10
|
export {};
|
|
@@ -6,6 +6,8 @@ import { IDSInputBase } from './input-base.js';
|
|
|
6
6
|
|
|
7
7
|
const IDSInput = forwardRef(({ invalid = false, noValidation = false, style, validationOnBlur = false, ...props }, ref) => {
|
|
8
8
|
const inputRef = useRef(null);
|
|
9
|
+
const hasValidValue = useInputValidity(inputRef, validationOnBlur);
|
|
10
|
+
const computedInvalid = (invalid || !hasValidValue) && !noValidation;
|
|
9
11
|
// Merge forwarded + local ref
|
|
10
12
|
const mergedRef = (node) => {
|
|
11
13
|
inputRef.current = node;
|
|
@@ -14,10 +16,7 @@ const IDSInput = forwardRef(({ invalid = false, noValidation = false, style, val
|
|
|
14
16
|
else if (ref)
|
|
15
17
|
ref.current = node;
|
|
16
18
|
};
|
|
17
|
-
|
|
18
|
-
const hasValidValue = useInputValidity(inputRef, validationOnBlur);
|
|
19
|
-
const isInvalid = (invalid || !hasValidValue) && !noValidation;
|
|
20
|
-
return jsx(IDSInputBase, { ...props, style: style, invalid: isInvalid, inputRef: mergedRef });
|
|
19
|
+
return jsx(IDSInputBase, { ...props, style: style, invalid: computedInvalid, inputRef: mergedRef });
|
|
21
20
|
});
|
|
22
21
|
IDSInput.displayName = "IDSInput";
|
|
23
22
|
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CommonFormPropsWithReadOnly } from "../form-props/form-props";
|
|
3
|
+
interface IDSRadioBaseProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonFormPropsWithReadOnly {
|
|
13
4
|
errorMsgId?: string;
|
|
14
5
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
15
6
|
}
|
|
16
|
-
export declare function IDSRadioBase({ id, name, light,
|
|
7
|
+
export declare function IDSRadioBase({ id, name, light, disabled, focusAnchor, tooltip, dataTestId, children, className, inputRef, invalid, errorMsgId, ...props }: IDSRadioBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare namespace IDSRadioBase {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -2,23 +2,21 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
|
|
5
|
-
function IDSRadioBase({ id, name, light,
|
|
6
|
-
const
|
|
7
|
-
const inputId = !!id ? id : `radio-base-${reactId}`;
|
|
5
|
+
function IDSRadioBase({ id, name, light, disabled, focusAnchor, tooltip, dataTestId, children, className, inputRef, invalid, errorMsgId, ...props }) {
|
|
6
|
+
const inputId = id ?? `radio-base-${useId()}`;
|
|
8
7
|
const showErrorMsg = invalid && !!errorMsgId;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
: {};
|
|
8
|
+
const ariaHandler = {};
|
|
9
|
+
if (showErrorMsg) {
|
|
10
|
+
ariaHandler["aria-describedby"] = errorMsgId;
|
|
11
|
+
}
|
|
15
12
|
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
13
|
"ids-input--light": light,
|
|
17
14
|
"ids-focus-anchor": focusAnchor
|
|
18
|
-
}), name: name, disabled: disabled, "aria-
|
|
15
|
+
}), name: name, 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
16
|
"ids-label--clickable": !disabled,
|
|
20
17
|
"ids-label--disabled": disabled
|
|
21
18
|
}), children: children }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] }))] }));
|
|
22
19
|
}
|
|
20
|
+
IDSRadioBase.displayName = "IDSRadioBase";
|
|
23
21
|
|
|
24
22
|
export { IDSRadioBase };
|
|
@@ -11,4 +11,7 @@ interface IDSRadioGroupBaseProps extends FieldsetHTMLAttributes<HTMLFieldSetElem
|
|
|
11
11
|
groupRef?: React.Ref<HTMLFieldSetElement>;
|
|
12
12
|
}
|
|
13
13
|
export declare function IDSRadioGroupBase({ legend, hideLegend, errorMsg, errorMsgId, compact, required, tooltip, className, children, invalid, groupRef, ...props }: IDSRadioGroupBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare namespace IDSRadioGroupBase {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
14
17
|
export {};
|
|
@@ -8,5 +8,6 @@ function IDSRadioGroupBase({ legend, hideLegend, errorMsg, errorMsgId, compact =
|
|
|
8
8
|
"ids-label-wrapper--sr-only": hideLegend
|
|
9
9
|
}, className), children: jsxs("legend", { children: [legend, tooltip && jsx("span", { className: "ids-legend__tooltip", children: tooltip })] }) })), children, showErrorMsg && (jsx(IDSErrorMessage, { id: errorMsgId, show: true, style: { marginTop: compact ? "0.75rem" : "auto" }, children: errorMsg }))] }));
|
|
10
10
|
}
|
|
11
|
+
IDSRadioGroupBase.displayName = "IDSRadioGroupBase";
|
|
11
12
|
|
|
12
13
|
export { IDSRadioGroupBase };
|
|
@@ -12,4 +12,7 @@ interface IDSRadioGroupProps extends FieldsetHTMLAttributes<HTMLFieldSetElement>
|
|
|
12
12
|
onRadioChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
13
13
|
}
|
|
14
14
|
export declare function IDSRadioGroup({ name, required, noValidation, invalid, errorMsg, children, onRadioChange, ...props }: IDSRadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace IDSRadioGroup {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
15
18
|
export {};
|
|
@@ -19,7 +19,6 @@ function IDSRadioGroup({ name, required, noValidation, invalid, errorMsg, childr
|
|
|
19
19
|
const { id, ...rest } = child.props;
|
|
20
20
|
const cloneProps = {
|
|
21
21
|
...rest,
|
|
22
|
-
key: child.key,
|
|
23
22
|
id: child.props.id,
|
|
24
23
|
name: groupName,
|
|
25
24
|
required: required && !noValidation,
|
|
@@ -28,11 +27,12 @@ function IDSRadioGroup({ name, required, noValidation, invalid, errorMsg, childr
|
|
|
28
27
|
groupInvalid: groupInvalid,
|
|
29
28
|
onChange: onRadioChange
|
|
30
29
|
};
|
|
31
|
-
return React.cloneElement(child, cloneProps);
|
|
30
|
+
return React.cloneElement(child, cloneProps, undefined);
|
|
32
31
|
}
|
|
33
32
|
return child;
|
|
34
33
|
});
|
|
35
34
|
return (jsx(IDSRadioGroupBase, { ...props, groupRef: groupRef, required: required, invalid: groupInvalid || invalid, errorMsg: !noValidation && errorMsg, errorMsgId: errorMsgId, children: clonedChildren }));
|
|
36
35
|
}
|
|
36
|
+
IDSRadioGroup.displayName = "IDSRadioGroup";
|
|
37
37
|
|
|
38
38
|
export { IDSRadioGroup };
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IDSRadioProps extends InputHTMLAttributes<HTMLInputElement
|
|
3
|
-
id?: string;
|
|
4
|
-
key?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
light?: boolean;
|
|
7
|
-
compact?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
invalid?: boolean;
|
|
1
|
+
import { CommonFormPropsWithReadOnly } from "../form-props/form-props";
|
|
2
|
+
export interface IDSRadioProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonFormPropsWithReadOnly {
|
|
10
3
|
groupInvalid?: boolean;
|
|
11
|
-
focusAnchor?: boolean;
|
|
12
|
-
tooltip?: ReactNode;
|
|
13
|
-
dataTestId?: string;
|
|
14
|
-
children?: ReactNode;
|
|
15
|
-
noValidation?: boolean;
|
|
16
4
|
groupErrorMsgId?: string;
|
|
17
5
|
}
|
|
18
6
|
export declare const IDSRadio: import("react").ForwardRefExoticComponent<IDSRadioProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useRef
|
|
3
|
+
import { forwardRef, useRef } from 'react';
|
|
4
4
|
import { IDSRadioBase } from './radio-base.js';
|
|
5
5
|
|
|
6
6
|
const IDSRadio = forwardRef(({ groupErrorMsgId, invalid = false, groupInvalid = false, noValidation = false, children, ...props }, ref) => {
|
|
7
7
|
const radioRef = useRef(null);
|
|
8
|
-
const
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const computedInvalid = invalid || groupInvalid;
|
|
9
|
+
// Merge forwarded + local ref
|
|
10
|
+
const mergedRef = (node) => {
|
|
11
|
+
radioRef.current = node;
|
|
12
|
+
if (typeof ref === "function")
|
|
13
|
+
ref(node);
|
|
14
|
+
else if (ref)
|
|
15
|
+
ref.current = node;
|
|
16
|
+
};
|
|
17
|
+
return (jsx(IDSRadioBase, { ...props, inputRef: mergedRef, errorMsgId: groupErrorMsgId, invalid: computedInvalid, children: children }));
|
|
12
18
|
});
|
|
13
19
|
IDSRadio.displayName = "IDSRadio";
|
|
14
20
|
|
|
@@ -6,3 +6,6 @@ export interface IDSRadioButtonGroupBaseProps extends InputHTMLAttributes<HTMLFi
|
|
|
6
6
|
groupRef?: React.Ref<HTMLFieldSetElement>;
|
|
7
7
|
}
|
|
8
8
|
export declare function IDSRadioButtonGroupBase({ legend, groupRef, tooltip, children, className, ...props }: IDSRadioButtonGroupBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare namespace IDSRadioButtonGroupBase {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
@@ -4,5 +4,6 @@ import clsx from 'clsx';
|
|
|
4
4
|
function IDSRadioButtonGroupBase({ legend, groupRef, tooltip, children, className, ...props }) {
|
|
5
5
|
return (jsxs("fieldset", { ref: groupRef, className: clsx("ids-form-group__fieldset", "ids-form-group__fieldset--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 })] }) })) : null, children] }));
|
|
6
6
|
}
|
|
7
|
+
IDSRadioButtonGroupBase.displayName = "IDSRadioButtonGroupBase";
|
|
7
8
|
|
|
8
9
|
export { IDSRadioButtonGroupBase };
|
|
@@ -7,4 +7,7 @@ interface IDSRadioButtonGroupProps extends InputHTMLAttributes<HTMLFieldSetEleme
|
|
|
7
7
|
onRadioChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare function IDSRadioButtonGroup({ name, legend, tooltip, children, onRadioChange, className, ...props }: IDSRadioButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace IDSRadioButtonGroup {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
10
13
|
export {};
|
|
@@ -9,7 +9,7 @@ function IDSRadioButtonGroup({ name, legend, tooltip, children, onRadioChange, c
|
|
|
9
9
|
if (!React.isValidElement(child))
|
|
10
10
|
return child;
|
|
11
11
|
if (child.type === IDSRadioButton) {
|
|
12
|
-
const { id, icon, ...rest } = child.props;
|
|
12
|
+
const { id, icon, defaultValue, ...rest } = child.props;
|
|
13
13
|
const cloneProps = {
|
|
14
14
|
...rest,
|
|
15
15
|
icon,
|
|
@@ -18,11 +18,14 @@ function IDSRadioButtonGroup({ name, legend, tooltip, children, onRadioChange, c
|
|
|
18
18
|
};
|
|
19
19
|
if (id)
|
|
20
20
|
cloneProps.id = id;
|
|
21
|
+
if (defaultValue)
|
|
22
|
+
cloneProps.defaultValue = defaultValue;
|
|
21
23
|
return React.cloneElement(child, cloneProps);
|
|
22
24
|
}
|
|
23
25
|
return child;
|
|
24
26
|
});
|
|
25
27
|
return (jsx(IDSRadioButtonGroupBase, { legend: legend, tooltip: tooltip, className: className, ...props, children: clonedChildren }));
|
|
26
28
|
}
|
|
29
|
+
IDSRadioButtonGroup.displayName = "IDSRadioButtonGroup";
|
|
27
30
|
|
|
28
31
|
export { IDSRadioButtonGroup };
|
|
@@ -8,5 +8,6 @@ const IDSRadioButton = forwardRef(function IDSRadioButton({ id, icon, name, data
|
|
|
8
8
|
"ids-focus-anchor": focusAnchor
|
|
9
9
|
}), ...props }), jsx("label", { htmlFor: inputId, className: `ids-radio-button__label ids-icon-${icon}`, children: children })] }));
|
|
10
10
|
});
|
|
11
|
+
IDSRadioButton.displayName = "IDSRadioButton";
|
|
11
12
|
|
|
12
13
|
export { IDSRadioButton };
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
label?: string;
|
|
1
|
+
import { Ref, CSSProperties } from "react";
|
|
2
|
+
import { CommonFormProps } from "../form-props/form-props";
|
|
3
|
+
export interface IDSRangeBaseProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonFormProps {
|
|
5
4
|
showTicks?: boolean;
|
|
6
5
|
ticks?: number[];
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
focusAnchor?: boolean;
|
|
9
|
-
dataTestId?: string;
|
|
10
|
-
tooltip?: ReactNode;
|
|
11
6
|
valueNow: number;
|
|
12
7
|
min?: number;
|
|
13
8
|
max?: number;
|
|
@@ -16,3 +11,6 @@ export interface IDSRangeBaseProps extends InputHTMLAttributes<HTMLInputElement>
|
|
|
16
11
|
style?: CSSProperties;
|
|
17
12
|
}
|
|
18
13
|
export declare function IDSRangeBase({ id, label, showTicks, ticks, disabled, focusAnchor, dataTestId, tooltip, valueNow, min, max, step, inputRef, style, className, ...props }: IDSRangeBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare namespace IDSRangeBase {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
@@ -2,15 +2,16 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
|
|
5
|
-
function IDSRangeBase({ id, label, showTicks, ticks = [], disabled, focusAnchor, dataTestId, tooltip, valueNow, min, max, step = 1, inputRef, style, className, ...props }) {
|
|
5
|
+
function IDSRangeBase({ id, label, showTicks, ticks = [], disabled, focusAnchor, dataTestId, tooltip, valueNow, min = 0, max = 10, step = 1, inputRef, style, className, ...props }) {
|
|
6
6
|
const inputId = !!id ? id : `range-${useId()}`;
|
|
7
7
|
return (jsxs("div", { className: clsx("ids-range", className), "data-testid": dataTestId, style: style, children: [label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { htmlFor: inputId, className: clsx("ids-label", { "ids-label--disabled": disabled }), children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsx("input", { id: inputId, ref: inputRef, type: "range", className: clsx("ids-range__input", {
|
|
8
8
|
"ids-focus-anchor": focusAnchor
|
|
9
9
|
}), min: min, "aria-valuemin": min, max: max, "aria-valuemax": max, "aria-valuenow": valueNow, "aria-disabled": disabled, disabled: disabled, step: step, style: {
|
|
10
|
-
backgroundSize: ((valueNow - min) * 100) / (max - min) + "% 100%"
|
|
10
|
+
backgroundSize: ((valueNow - (min ?? 0)) * 100) / ((max ?? 100) - (min ?? 0)) + "% 100%"
|
|
11
11
|
}, ...props }), showTicks && (jsx("div", { className: clsx("ids-range-ticks", {
|
|
12
12
|
"ids-range-ticks--disabled": disabled
|
|
13
13
|
}), children: ticks.map(tick => (jsx("div", { className: "ids-range-tick", children: tick }, tick))) }))] }));
|
|
14
14
|
}
|
|
15
|
+
IDSRangeBase.displayName = "IDSRangeBase";
|
|
15
16
|
|
|
16
17
|
export { IDSRangeBase };
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IDSRangeProps extends InputHTMLAttributes<HTMLInputElement
|
|
3
|
-
label?: string;
|
|
1
|
+
import { CommonFormProps } from "../form-props/form-props";
|
|
2
|
+
export interface IDSRangeProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonFormProps {
|
|
4
3
|
value?: number;
|
|
5
4
|
showTicks?: boolean;
|
|
6
5
|
interval?: number;
|
|
7
6
|
min?: number;
|
|
8
7
|
max?: number;
|
|
9
8
|
step?: number;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
focusAnchor?: boolean;
|
|
12
|
-
dataTestId?: string;
|
|
13
|
-
tooltip?: ReactNode;
|
|
14
9
|
}
|
|
15
10
|
export declare const IDSRange: import("react").ForwardRefExoticComponent<IDSRangeProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useState, useRef,
|
|
3
|
+
import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import { IDSRangeBase } from './range-base.js';
|
|
5
5
|
|
|
6
|
-
const IDSRange = forwardRef(({ label, value = 0, showTicks = false, interval = 0, min = 0, max = 0, step = 0, onChange,
|
|
6
|
+
const IDSRange = forwardRef(({ label, value = 0, showTicks = false, interval = 0, min = 0, max = 0, step = 0, onChange, ...props }, ref) => {
|
|
7
7
|
const [internalValue, setInternalValue] = useState(value ?? 0);
|
|
8
8
|
const [ticks, setTicks] = useState([]);
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const rangeRef = useRef(null);
|
|
10
|
+
// Merge forwarded + local ref
|
|
11
|
+
const mergedRef = (node) => {
|
|
12
|
+
rangeRef.current = node;
|
|
13
|
+
if (typeof ref === "function")
|
|
14
|
+
ref(node);
|
|
15
|
+
else if (ref)
|
|
16
|
+
ref.current = node;
|
|
17
|
+
};
|
|
11
18
|
useEffect(() => {
|
|
12
19
|
if (step > 0 && showTicks) {
|
|
13
20
|
const out = [];
|
|
14
21
|
const inc = interval > 0 ? interval : step;
|
|
15
22
|
for (let i = min; i <= max; i += inc) {
|
|
16
|
-
out.push(Math.floor(i));
|
|
23
|
+
out.push(Math.min(Math.floor(i), max));
|
|
17
24
|
}
|
|
18
25
|
setTicks(out);
|
|
19
26
|
}
|
|
@@ -29,7 +36,7 @@ const IDSRange = forwardRef(({ label, value = 0, showTicks = false, interval = 0
|
|
|
29
36
|
setInternalValue(newValue);
|
|
30
37
|
onChange?.(e);
|
|
31
38
|
};
|
|
32
|
-
return (jsx(IDSRangeBase, { ...props, label: label, inputRef:
|
|
39
|
+
return (jsx(IDSRangeBase, { ...props, label: label, inputRef: mergedRef, ticks: ticks, showTicks: showTicks, min: min, max: max, step: step, value: internalValue, valueNow: internalValue, onChange: handleChange }));
|
|
33
40
|
});
|
|
34
41
|
IDSRange.displayName = "IDSRange";
|
|
35
42
|
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import { CSSProperties
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
label?: string;
|
|
5
|
-
errorMsgId?: string;
|
|
6
|
-
errorMsg?: string;
|
|
7
|
-
invalid?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
light?: boolean;
|
|
11
|
-
focusAnchor?: boolean;
|
|
12
|
-
tooltip?: ReactNode;
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
className?: string;
|
|
15
|
-
dataTestId?: string;
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
import { CommonFormProps } from "../form-props/form-props";
|
|
3
|
+
export interface IDSSelectBaseProps extends React.SelectHTMLAttributes<HTMLSelectElement>, CommonFormProps {
|
|
16
4
|
selectRef?: React.Ref<HTMLSelectElement>;
|
|
5
|
+
errorMsgId?: string;
|
|
17
6
|
style?: CSSProperties;
|
|
18
7
|
}
|
|
19
8
|
export declare function IDSSelectBase({ id, label, errorMsgId, errorMsg, invalid, disabled, required, light, focusAnchor, tooltip, children, className, selectRef, dataTestId, style, ...props }: IDSSelectBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare namespace IDSSelectBase {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
@@ -5,20 +5,20 @@ import { IDSErrorMessage } from '../error-message/error-message.js';
|
|
|
5
5
|
|
|
6
6
|
function IDSSelectBase({ id, label, errorMsgId, errorMsg, invalid, disabled, required, light, focusAnchor, tooltip, children, className, selectRef, dataTestId, style, ...props }) {
|
|
7
7
|
const reactId = useId();
|
|
8
|
-
const selectId =
|
|
9
|
-
const baseErrorMsgId =
|
|
8
|
+
const selectId = id ?? `select-base-${reactId}`;
|
|
9
|
+
const baseErrorMsgId = errorMsgId ?? `select-base-error-${reactId}`;
|
|
10
10
|
const showErrorMsg = invalid && !!errorMsg;
|
|
11
|
-
const ariaHandler =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
: {};
|
|
11
|
+
const ariaHandler = {};
|
|
12
|
+
if (showErrorMsg) {
|
|
13
|
+
ariaHandler["aria-describedby"] = baseErrorMsgId;
|
|
14
|
+
}
|
|
16
15
|
return (jsxs("div", { className: clsx("ids-select", className), "data-testid": dataTestId, style: style, children: [label && (jsxs("div", { className: "ids-label-wrapper ids-label-wrapper--margin-bottom", children: [jsx("label", { htmlFor: selectId, className: clsx("ids-label", {
|
|
17
16
|
"ids-label--disabled": disabled
|
|
18
17
|
}), children: label }), tooltip && jsx("span", { className: "ids-label__tooltip", children: tooltip })] })), jsx("div", { className: "ids-select__wrapper", children: jsx("select", { id: selectId, ref: selectRef, className: clsx("ids-select__select", {
|
|
19
18
|
"ids-input--light": light,
|
|
20
19
|
"ids-focus-anchor": focusAnchor
|
|
21
|
-
}), "aria-invalid": invalid, "aria-
|
|
20
|
+
}), "aria-invalid": invalid, "aria-disabled": disabled, disabled: disabled, required: required, ...ariaHandler, ...props, children: children }) }), showErrorMsg && (jsx(IDSErrorMessage, { id: baseErrorMsgId, show: true, children: errorMsg }))] }));
|
|
22
21
|
}
|
|
22
|
+
IDSSelectBase.displayName = "IDSSelectBase";
|
|
23
23
|
|
|
24
24
|
export { IDSSelectBase };
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface IDSSelectProps extends SelectHTMLAttributes<HTMLSelectElement
|
|
3
|
-
id?: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
errorMsg?: string;
|
|
6
|
-
invalid?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
required?: boolean;
|
|
9
|
-
light?: boolean;
|
|
10
|
-
focusAnchor?: boolean;
|
|
11
|
-
tooltip?: ReactNode;
|
|
12
|
-
dataTestId?: string;
|
|
13
|
-
noValidation?: boolean;
|
|
14
|
-
validationOnBlur?: boolean;
|
|
1
|
+
import { CommonFormProps } from "../form-props/form-props";
|
|
2
|
+
export interface IDSSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement>, CommonFormProps {
|
|
15
3
|
}
|
|
16
4
|
export declare const IDSSelect: import("react").ForwardRefExoticComponent<IDSSelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useId, useRef
|
|
3
|
+
import { forwardRef, useId, useRef } from 'react';
|
|
4
4
|
import { useInputValidity } from '../form-hooks/useInputValidity.js';
|
|
5
5
|
import { IDSSelectBase } from './select-base.js';
|
|
6
6
|
|
|
7
|
-
const IDSSelect = forwardRef(({
|
|
7
|
+
const IDSSelect = forwardRef(({ invalid = false, noValidation = false, validationOnBlur = false, children, ...props }, ref) => {
|
|
8
8
|
const errorMsgId = `select-error-${useId()}`;
|
|
9
9
|
const selectRef = useRef(null);
|
|
10
10
|
const hasValidValue = useInputValidity(selectRef, validationOnBlur);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const computedInvalid = (invalid || !hasValidValue) && !noValidation;
|
|
12
|
+
// Merge forwarded + local ref
|
|
13
|
+
const mergedRef = (node) => {
|
|
14
|
+
selectRef.current = node;
|
|
15
|
+
if (typeof ref === "function")
|
|
16
|
+
ref(node);
|
|
17
|
+
else if (ref)
|
|
18
|
+
ref.current = node;
|
|
19
|
+
};
|
|
20
|
+
return (jsx(IDSSelectBase, { ...props, selectRef: mergedRef, errorMsgId: errorMsgId, invalid: computedInvalid, children: children }));
|
|
14
21
|
});
|
|
15
22
|
IDSSelect.displayName = "IDSSelect";
|
|
16
23
|
|