@inera/ids-react 7.2.0 → 8.1.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.d.ts +1 -0
- package/components/accordion/accordion.js +5 -43
- package/components/alert/alert.d.ts +3 -3
- package/components/alert/alert.js +8 -5
- package/components/badge/badge.d.ts +3 -6
- package/components/badge/badge.js +3 -3
- package/components/box-link/box-link.d.ts +3 -5
- package/components/box-link/box-link.js +3 -4
- package/components/breadcrumbs/breadcrumbs.d.ts +2 -3
- package/components/breadcrumbs/breadcrumbs.js +5 -6
- package/components/button/button.d.ts +6 -8
- package/components/button/button.js +5 -79
- package/components/button-group/button-group.d.ts +2 -3
- package/components/button-group/button-group.js +2 -2
- package/components/card/card.d.ts +6 -7
- package/components/card/card.js +16 -10
- package/components/carousel/carousel-item.js +5 -5
- package/components/carousel/carousel.d.ts +0 -2
- package/components/carousel/carousel.js +22 -42
- package/components/date-label/date-label.d.ts +8 -2
- package/components/date-label/date-label.js +10 -17
- package/components/dialog/dialog.d.ts +13 -13
- package/components/dialog/dialog.js +10 -13
- package/components/dropdown/dropdown-content-button.d.ts +7 -0
- package/components/dropdown/dropdown-content-button.js +11 -0
- package/components/dropdown/dropdown-content-link.d.ts +1 -1
- package/components/dropdown/dropdown-content-link.js +4 -3
- package/components/dropdown/dropdown.d.ts +6 -5
- package/components/dropdown/dropdown.js +12 -11
- package/components/footer-1177/footer-1177.d.ts +3 -7
- package/components/footer-1177/footer-1177.js +9 -52
- package/components/footer-1177-admin/footer-1177-admin.d.ts +6 -8
- package/components/footer-1177-admin/footer-1177-admin.js +11 -53
- package/components/footer-1177-pro/footer-1177-pro.d.ts +16 -11
- package/components/footer-1177-pro/footer-1177-pro.js +13 -31
- package/components/footer-inera/footer-inera.d.ts +3 -7
- package/components/footer-inera/footer-inera.js +10 -53
- package/components/footer-inera-admin/footer-inera-admin.d.ts +3 -7
- package/components/footer-inera-admin/footer-inera-admin.js +12 -52
- package/components/form/check-button/check-button.d.ts +1 -0
- package/components/form/check-button/check-button.js +2 -2
- package/components/form/checkbox/checkbox-group.d.ts +1 -1
- package/components/form/checkbox/checkbox-group.js +6 -6
- package/components/form/checkbox/checkbox.d.ts +1 -0
- package/components/form/checkbox/checkbox.js +3 -3
- package/components/form/input/input.d.ts +2 -4
- package/components/form/input/input.js +16 -37
- package/components/form/radio/radio-group.d.ts +2 -2
- package/components/form/radio/radio-group.js +6 -6
- package/components/form/radio/radio.d.ts +3 -3
- package/components/form/radio/radio.js +2 -2
- package/components/form/radio-button/radio-button-group.d.ts +2 -2
- package/components/form/radio-button/radio-button-group.js +7 -7
- package/components/form/radio-button/radio-button.d.ts +4 -3
- package/components/form/radio-button/radio-button.js +2 -2
- package/components/form/range/range.d.ts +1 -0
- package/components/form/range/range.js +2 -2
- package/components/form/select/select.d.ts +1 -1
- package/components/form/select/select.js +5 -3
- package/components/form/select-multiple/select-multiple.d.ts +3 -0
- package/components/form/select-multiple/select-multiple.js +13 -6
- package/components/form/textarea/textarea.d.ts +1 -0
- package/components/form/textarea/textarea.js +2 -2
- package/components/form/time/time.d.ts +1 -0
- package/components/form/time/time.js +6 -6
- package/components/form/toggle/toggle.d.ts +1 -0
- package/components/form/toggle/toggle.js +5 -5
- package/components/global-alert/global-alert.d.ts +16 -0
- package/components/global-alert/global-alert.js +26 -0
- package/components/grid/column.d.ts +3 -4
- package/components/grid/column.js +2 -3
- package/components/grid/container.d.ts +4 -4
- package/components/grid/container.js +7 -18
- package/components/grid/row.d.ts +4 -4
- package/components/grid/row.js +6 -11
- package/components/header-1177/header-1177-avatar.d.ts +5 -2
- package/components/header-1177/header-1177-avatar.js +21 -10
- package/components/header-1177/header-1177-item.d.ts +3 -2
- package/components/header-1177/header-1177-item.js +22 -16
- package/components/header-1177/header-1177-menu-mobile.d.ts +1 -1
- package/components/header-1177/header-1177-menu-mobile.js +29 -18
- package/components/header-1177/header-1177-nav-item-mobile.js +7 -12
- package/components/header-1177/header-1177-nav-item.d.ts +4 -4
- package/components/header-1177/header-1177-nav-item.js +23 -18
- package/components/header-1177/header-1177-nav.d.ts +4 -2
- package/components/header-1177/header-1177-nav.js +6 -8
- package/components/header-1177/header-1177-region-picker-mobile.d.ts +9 -0
- package/components/header-1177/header-1177-region-picker-mobile.js +36 -0
- package/components/header-1177/header-1177-region-picker.d.ts +9 -0
- package/components/header-1177/header-1177-region-picker.js +34 -0
- package/components/header-1177/header-1177.d.ts +3 -7
- package/components/header-1177/header-1177.js +7 -36
- 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 +28 -3
- package/components/header-1177-admin/header-1177-admin-avatar.d.ts +3 -2
- package/components/header-1177-admin/header-1177-admin-avatar.js +31 -18
- package/components/header-1177-admin/header-1177-admin-item.d.ts +2 -2
- package/components/header-1177-admin/header-1177-admin-item.js +23 -19
- package/components/header-1177-admin/header-1177-admin-menu-mobile.d.ts +11 -0
- package/components/header-1177-admin/header-1177-admin-menu-mobile.js +53 -0
- package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +4 -4
- package/components/header-1177-admin/header-1177-admin-nav-item.js +22 -17
- package/components/header-1177-admin/header-1177-admin-nav.d.ts +2 -2
- package/components/header-1177-admin/header-1177-admin-nav.js +7 -9
- package/components/header-1177-admin/header-1177-admin.d.ts +3 -6
- package/components/header-1177-admin/header-1177-admin.js +7 -21
- 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 +28 -3
- package/components/header-1177-pro/header-1177-pro-avatar.d.ts +3 -2
- package/components/header-1177-pro/header-1177-pro-avatar.js +31 -18
- package/components/header-1177-pro/header-1177-pro-item.d.ts +2 -2
- package/components/header-1177-pro/header-1177-pro-item.js +23 -16
- package/components/header-1177-pro/{header-1177-pro-nav-menu-mobile.d.ts → header-1177-pro-menu-mobile.d.ts} +3 -3
- package/components/header-1177-pro/header-1177-pro-menu-mobile.js +53 -0
- package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +5 -5
- package/components/header-1177-pro/header-1177-pro-nav-item.js +17 -21
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +4 -5
- package/components/header-1177-pro/header-1177-pro-nav.js +8 -25
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.d.ts +9 -0
- package/components/header-1177-pro/header-1177-pro-region-picker-mobile.js +36 -0
- package/components/header-1177-pro/header-1177-pro-region-picker.d.ts +9 -0
- package/components/header-1177-pro/header-1177-pro-region-picker.js +34 -0
- package/components/header-1177-pro/header-1177-pro.d.ts +6 -9
- package/components/header-1177-pro/header-1177-pro.js +6 -34
- package/components/header-inera/header-inera-item.d.ts +3 -4
- package/components/header-inera/header-inera-item.js +30 -15
- package/components/header-inera/header-inera-menu-mobile.d.ts +11 -0
- package/components/header-inera/header-inera-menu-mobile.js +54 -0
- package/components/header-inera/header-inera-nav-item.js +9 -25
- package/components/header-inera/header-inera-nav.d.ts +1 -1
- package/components/header-inera/header-inera-nav.js +6 -8
- package/components/header-inera/header-inera.d.ts +3 -4
- package/components/header-inera/header-inera.js +6 -13
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.d.ts +5 -2
- package/components/header-inera-admin/header-inera-admin-avatar-mobile.js +23 -3
- package/components/header-inera-admin/header-inera-admin-avatar.d.ts +3 -4
- package/components/header-inera-admin/header-inera-admin-avatar.js +34 -22
- package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -4
- package/components/header-inera-admin/header-inera-admin-item.js +17 -13
- package/components/header-inera-admin/header-inera-admin-menu-mobile.d.ts +11 -0
- package/components/header-inera-admin/header-inera-admin-menu-mobile.js +53 -0
- package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +1 -3
- package/components/header-inera-admin/header-inera-admin-nav-item.js +15 -31
- package/components/header-inera-admin/header-inera-admin-nav.d.ts +2 -3
- package/components/header-inera-admin/header-inera-admin-nav.js +4 -6
- package/components/header-inera-admin/header-inera-admin.d.ts +2 -2
- package/components/header-inera-admin/header-inera-admin.js +6 -8
- package/components/header-patient/header-patient.d.ts +3 -3
- package/components/header-patient/header-patient.js +2 -2
- package/components/link/link.d.ts +4 -4
- package/components/link/link.js +17 -15
- package/components/mobile/menu/item/mobile-item.js +4 -4
- package/components/navigation/content/navigation-content.d.ts +3 -3
- package/components/navigation/content/navigation-content.js +7 -13
- package/components/navigation/local/navigation-local.d.ts +2 -3
- package/components/navigation/local/navigation-local.js +2 -2
- package/components/notification/badge/notification-badge.d.ts +2 -3
- package/components/notification/badge/notification-badge.js +2 -2
- package/components/pagination/data-pagination/data-pagination.d.ts +8 -13
- package/components/pagination/data-pagination/data-pagination.js +7 -8
- package/components/pagination/list-pagination/list-pagination.d.ts +1 -1
- package/components/pagination/list-pagination/list-pagination.js +7 -13
- package/components/popover/popover.js +9 -9
- package/components/progressbar/progressbar.d.ts +5 -3
- package/components/progressbar/progressbar.js +4 -4
- package/components/puff-list/puff-list-item/puff-list-item-date.d.ts +13 -0
- package/components/puff-list/puff-list-item/puff-list-item-date.js +23 -0
- package/components/puff-list/puff-list-item/puff-list-item-header.d.ts +10 -0
- package/components/puff-list/puff-list-item/puff-list-item-header.js +11 -0
- package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +4 -5
- package/components/puff-list/puff-list-item/puff-list-item-info.js +5 -3
- package/components/puff-list/puff-list-item/puff-list-item.d.ts +10 -13
- package/components/puff-list/puff-list-item/puff-list-item.js +10 -46
- package/components/puff-list/puff-list.d.ts +1 -1
- package/components/puff-list/puff-list.js +4 -3
- package/components/region-icon/region-icon.d.ts +2 -2
- package/components/region-icon/region-icon.js +6 -6
- package/components/side-menu/side-menu.d.ts +1 -1
- package/components/side-menu/side-menu.js +7 -7
- package/components/side-panel/side-panel.d.ts +2 -0
- package/components/side-panel/side-panel.js +5 -5
- package/components/stepper/step.js +2 -2
- package/components/stepper/stepper.d.ts +1 -1
- package/components/stepper/stepper.js +5 -5
- package/components/tabs/tab-panel.js +2 -2
- package/components/tabs/tab.js +2 -2
- package/components/tabs/tabs.js +13 -13
- package/components/tag/tag.d.ts +11 -4
- package/components/tag/tag.js +7 -7
- package/components/tooltip/tooltip.d.ts +1 -0
- package/components/tooltip/tooltip.js +8 -7
- package/components/utils/contexts/HeaderContext.d.ts +0 -2
- package/components/utils/hooks/useFocusTrap.js +2 -1
- package/index.d.ts +18 -144
- package/index.js +18 -144
- package/package.json +2 -3
- package/components/agent/agent.d.ts +0 -12
- package/components/agent/agent.js +0 -18
- package/components/alert-global/alert-global.d.ts +0 -16
- package/components/alert-global/alert-global.js +0 -28
- package/components/header-1177-pro/header-1177-pro-nav-menu-mobile.js +0 -35
- package/components/header-inera/header-inera-nav-mobile.d.ts +0 -11
- package/components/header-inera/header-inera-nav-mobile.js +0 -47
- package/components/header-inera-admin/header-inera-admin-nav-mobile.d.ts +0 -12
- package/components/header-inera-admin/header-inera-admin-nav-mobile.js +0 -35
- package/components/icons/icon-1177.d.ts +0 -3
- package/components/icons/icon-1177.js +0 -12
- package/components/icons/icon-activity.d.ts +0 -3
- package/components/icons/icon-activity.js +0 -12
- package/components/icons/icon-agent.d.ts +0 -3
- package/components/icons/icon-agent.js +0 -12
- package/components/icons/icon-alarm-clock-inactivity.d.ts +0 -3
- package/components/icons/icon-alarm-clock-inactivity.js +0 -12
- package/components/icons/icon-alarm-clock-neutral.d.ts +0 -3
- package/components/icons/icon-alarm-clock-neutral.js +0 -12
- package/components/icons/icon-archive.d.ts +0 -3
- package/components/icons/icon-archive.js +0 -12
- package/components/icons/icon-arrow.d.ts +0 -3
- package/components/icons/icon-arrow.js +0 -12
- package/components/icons/icon-attention.d.ts +0 -3
- package/components/icons/icon-attention.js +0 -12
- package/components/icons/icon-blekinge.d.ts +0 -3
- package/components/icons/icon-blekinge.js +0 -12
- package/components/icons/icon-bookmark.d.ts +0 -3
- package/components/icons/icon-bookmark.js +0 -12
- package/components/icons/icon-calendar.d.ts +0 -3
- package/components/icons/icon-calendar.js +0 -12
- package/components/icons/icon-call-active.d.ts +0 -3
- package/components/icons/icon-call-active.js +0 -12
- package/components/icons/icon-call.d.ts +0 -3
- package/components/icons/icon-call.js +0 -12
- package/components/icons/icon-camera-off.d.ts +0 -3
- package/components/icons/icon-camera-off.js +0 -12
- package/components/icons/icon-camera-on.d.ts +0 -3
- package/components/icons/icon-camera-on.js +0 -12
- package/components/icons/icon-camera-switch.d.ts +0 -3
- package/components/icons/icon-camera-switch.js +0 -12
- package/components/icons/icon-chart-bar.d.ts +0 -3
- package/components/icons/icon-chart-bar.js +0 -12
- package/components/icons/icon-chart-line.d.ts +0 -3
- package/components/icons/icon-chart-line.js +0 -12
- package/components/icons/icon-chat.d.ts +0 -3
- package/components/icons/icon-chat.js +0 -12
- package/components/icons/icon-check.d.ts +0 -3
- package/components/icons/icon-check.js +0 -12
- package/components/icons/icon-chevron-bold.d.ts +0 -3
- package/components/icons/icon-chevron-bold.js +0 -12
- package/components/icons/icon-chevron.d.ts +0 -3
- package/components/icons/icon-chevron.js +0 -12
- package/components/icons/icon-clipboard-cross.d.ts +0 -3
- package/components/icons/icon-clipboard-cross.js +0 -12
- package/components/icons/icon-clipboard-text.d.ts +0 -3
- package/components/icons/icon-clipboard-text.js +0 -12
- package/components/icons/icon-clipboard.d.ts +0 -3
- package/components/icons/icon-clipboard.js +0 -12
- package/components/icons/icon-clock.d.ts +0 -3
- package/components/icons/icon-clock.js +0 -12
- package/components/icons/icon-close-bold.d.ts +0 -3
- package/components/icons/icon-close-bold.js +0 -12
- package/components/icons/icon-close.d.ts +0 -3
- package/components/icons/icon-close.js +0 -12
- package/components/icons/icon-cog.d.ts +0 -3
- package/components/icons/icon-cog.js +0 -12
- package/components/icons/icon-computer-inera.d.ts +0 -3
- package/components/icons/icon-computer-inera.js +0 -12
- package/components/icons/icon-computer.d.ts +0 -3
- package/components/icons/icon-computer.js +0 -12
- package/components/icons/icon-copy-file.d.ts +0 -3
- package/components/icons/icon-copy-file.js +0 -12
- package/components/icons/icon-copy-link.d.ts +0 -3
- package/components/icons/icon-copy-link.js +0 -12
- package/components/icons/icon-dalarna.d.ts +0 -3
- package/components/icons/icon-dalarna.js +0 -12
- package/components/icons/icon-denied.d.ts +0 -3
- package/components/icons/icon-denied.js +0 -12
- package/components/icons/icon-doctors-bag.d.ts +0 -3
- package/components/icons/icon-doctors-bag.js +0 -12
- package/components/icons/icon-document.d.ts +0 -3
- package/components/icons/icon-document.js +0 -12
- package/components/icons/icon-download.d.ts +0 -3
- package/components/icons/icon-download.js +0 -12
- package/components/icons/icon-drag-n-drop.d.ts +0 -3
- package/components/icons/icon-drag-n-drop.js +0 -12
- package/components/icons/icon-ear-hearing.d.ts +0 -3
- package/components/icons/icon-ear-hearing.js +0 -12
- package/components/icons/icon-edit.d.ts +0 -3
- package/components/icons/icon-edit.js +0 -12
- package/components/icons/icon-email-sent.d.ts +0 -3
- package/components/icons/icon-email-sent.js +0 -12
- package/components/icons/icon-email-unread.d.ts +0 -3
- package/components/icons/icon-email-unread.js +0 -12
- package/components/icons/icon-email.d.ts +0 -3
- package/components/icons/icon-email.js +0 -12
- package/components/icons/icon-expand.d.ts +0 -3
- package/components/icons/icon-expand.js +0 -12
- package/components/icons/icon-external.d.ts +0 -3
- package/components/icons/icon-external.js +0 -12
- package/components/icons/icon-facebook.d.ts +0 -3
- package/components/icons/icon-facebook.js +0 -12
- package/components/icons/icon-file-csv.d.ts +0 -3
- package/components/icons/icon-file-csv.js +0 -12
- package/components/icons/icon-file-excel.d.ts +0 -3
- package/components/icons/icon-file-excel.js +0 -12
- package/components/icons/icon-file-other.d.ts +0 -3
- package/components/icons/icon-file-other.js +0 -12
- package/components/icons/icon-file-pdf.d.ts +0 -3
- package/components/icons/icon-file-pdf.js +0 -12
- package/components/icons/icon-file-picture.d.ts +0 -3
- package/components/icons/icon-file-picture.js +0 -12
- package/components/icons/icon-file-powerpoint.d.ts +0 -3
- package/components/icons/icon-file-powerpoint.js +0 -12
- package/components/icons/icon-file-word.d.ts +0 -3
- package/components/icons/icon-file-word.js +0 -12
- package/components/icons/icon-find-care.d.ts +0 -3
- package/components/icons/icon-find-care.js +0 -12
- package/components/icons/icon-find-region.d.ts +0 -3
- package/components/icons/icon-find-region.js +0 -12
- package/components/icons/icon-flag.d.ts +0 -3
- package/components/icons/icon-flag.js +0 -12
- package/components/icons/icon-form-numbered-reocurring.d.ts +0 -3
- package/components/icons/icon-form-numbered-reocurring.js +0 -12
- package/components/icons/icon-form-numbered.d.ts +0 -3
- package/components/icons/icon-form-numbered.js +0 -12
- package/components/icons/icon-gavleborg.d.ts +0 -3
- package/components/icons/icon-gavleborg.js +0 -12
- package/components/icons/icon-gotland.d.ts +0 -3
- package/components/icons/icon-gotland.js +0 -12
- package/components/icons/icon-halland.d.ts +0 -3
- package/components/icons/icon-halland.js +0 -12
- package/components/icons/icon-headphones.d.ts +0 -3
- package/components/icons/icon-headphones.js +0 -12
- package/components/icons/icon-hourglass-end.d.ts +0 -3
- package/components/icons/icon-hourglass-end.js +0 -12
- package/components/icons/icon-hourglass-start.d.ts +0 -3
- package/components/icons/icon-hourglass-start.js +0 -12
- package/components/icons/icon-hourglass.d.ts +0 -3
- package/components/icons/icon-hourglass.js +0 -12
- package/components/icons/icon-house.d.ts +0 -3
- package/components/icons/icon-house.js +0 -12
- package/components/icons/icon-id-card-locked.d.ts +0 -3
- package/components/icons/icon-id-card-locked.js +0 -12
- package/components/icons/icon-id-card.d.ts +0 -3
- package/components/icons/icon-id-card.js +0 -12
- package/components/icons/icon-image.d.ts +0 -3
- package/components/icons/icon-image.js +0 -12
- package/components/icons/icon-inera-legacy.d.ts +0 -3
- package/components/icons/icon-inera-legacy.js +0 -12
- package/components/icons/icon-inera.d.ts +0 -3
- package/components/icons/icon-inera.js +0 -12
- package/components/icons/icon-information.d.ts +0 -3
- package/components/icons/icon-information.js +0 -12
- package/components/icons/icon-jamtland-harjedalen.d.ts +0 -3
- package/components/icons/icon-jamtland-harjedalen.js +0 -12
- package/components/icons/icon-jonkoping.d.ts +0 -3
- package/components/icons/icon-jonkoping.js +0 -12
- package/components/icons/icon-kalmar.d.ts +0 -3
- package/components/icons/icon-kalmar.js +0 -12
- package/components/icons/icon-kronoberg.d.ts +0 -3
- package/components/icons/icon-kronoberg.js +0 -12
- package/components/icons/icon-lightbulb.d.ts +0 -3
- package/components/icons/icon-lightbulb.js +0 -12
- package/components/icons/icon-linkedin.d.ts +0 -3
- package/components/icons/icon-linkedin.js +0 -12
- package/components/icons/icon-list.d.ts +0 -3
- package/components/icons/icon-list.js +0 -12
- package/components/icons/icon-lock-open.d.ts +0 -3
- package/components/icons/icon-lock-open.js +0 -12
- package/components/icons/icon-lock.d.ts +0 -3
- package/components/icons/icon-lock.js +0 -12
- package/components/icons/icon-log-locked.d.ts +0 -3
- package/components/icons/icon-log-locked.js +0 -12
- package/components/icons/icon-log.d.ts +0 -3
- package/components/icons/icon-log.js +0 -12
- package/components/icons/icon-menu.d.ts +0 -3
- package/components/icons/icon-menu.js +0 -12
- package/components/icons/icon-minus.d.ts +0 -3
- package/components/icons/icon-minus.js +0 -12
- package/components/icons/icon-moment-start.d.ts +0 -3
- package/components/icons/icon-moment-start.js +0 -12
- package/components/icons/icon-moment-stop.d.ts +0 -3
- package/components/icons/icon-moment-stop.js +0 -12
- package/components/icons/icon-norrbotten.d.ts +0 -3
- package/components/icons/icon-norrbotten.js +0 -12
- package/components/icons/icon-office-building.d.ts +0 -3
- package/components/icons/icon-office-building.js +0 -12
- package/components/icons/icon-orebro.d.ts +0 -3
- package/components/icons/icon-orebro.js +0 -12
- package/components/icons/icon-organization.d.ts +0 -3
- package/components/icons/icon-organization.js +0 -12
- package/components/icons/icon-ostergotland.d.ts +0 -3
- package/components/icons/icon-ostergotland.js +0 -12
- package/components/icons/icon-plus.d.ts +0 -3
- package/components/icons/icon-plus.js +0 -12
- package/components/icons/icon-prescription.d.ts +0 -3
- package/components/icons/icon-prescription.js +0 -12
- package/components/icons/icon-print.d.ts +0 -3
- package/components/icons/icon-print.js +0 -12
- package/components/icons/icon-question.d.ts +0 -3
- package/components/icons/icon-question.js +0 -12
- package/components/icons/icon-reload.d.ts +0 -3
- package/components/icons/icon-reload.js +0 -12
- package/components/icons/icon-reply.d.ts +0 -3
- package/components/icons/icon-reply.js +0 -12
- package/components/icons/icon-search-inera.d.ts +0 -3
- package/components/icons/icon-search-inera.js +0 -12
- package/components/icons/icon-search.d.ts +0 -3
- package/components/icons/icon-search.js +0 -12
- package/components/icons/icon-share.d.ts +0 -3
- package/components/icons/icon-share.js +0 -12
- package/components/icons/icon-shield-locked-primary.d.ts +0 -3
- package/components/icons/icon-shield-locked-primary.js +0 -12
- package/components/icons/icon-shield-locked.d.ts +0 -3
- package/components/icons/icon-shield-locked.js +0 -12
- package/components/icons/icon-skane.d.ts +0 -3
- package/components/icons/icon-skane.js +0 -12
- package/components/icons/icon-sormland.d.ts +0 -3
- package/components/icons/icon-sormland.js +0 -12
- package/components/icons/icon-star-filled.d.ts +0 -3
- package/components/icons/icon-star-filled.js +0 -12
- package/components/icons/icon-star.d.ts +0 -3
- package/components/icons/icon-star.js +0 -12
- package/components/icons/icon-stockholm.d.ts +0 -3
- package/components/icons/icon-stockholm.js +0 -12
- package/components/icons/icon-success.d.ts +0 -3
- package/components/icons/icon-success.js +0 -12
- package/components/icons/icon-swap.d.ts +0 -3
- package/components/icons/icon-swap.js +0 -12
- package/components/icons/icon-switch-person.d.ts +0 -3
- package/components/icons/icon-switch-person.js +0 -12
- package/components/icons/icon-telephone.d.ts +0 -3
- package/components/icons/icon-telephone.js +0 -12
- package/components/icons/icon-test-tube-analyze.d.ts +0 -3
- package/components/icons/icon-test-tube-analyze.js +0 -12
- package/components/icons/icon-test-tube-empty.d.ts +0 -3
- package/components/icons/icon-test-tube-empty.js +0 -12
- package/components/icons/icon-test-tube.d.ts +0 -3
- package/components/icons/icon-test-tube.js +0 -12
- package/components/icons/icon-toggle-card.d.ts +0 -3
- package/components/icons/icon-toggle-card.js +0 -12
- package/components/icons/icon-toggle-list.d.ts +0 -3
- package/components/icons/icon-toggle-list.js +0 -12
- package/components/icons/icon-trash.d.ts +0 -3
- package/components/icons/icon-trash.js +0 -12
- package/components/icons/icon-twitter.d.ts +0 -3
- package/components/icons/icon-twitter.js +0 -12
- package/components/icons/icon-uppsala.d.ts +0 -3
- package/components/icons/icon-uppsala.js +0 -12
- package/components/icons/icon-user.d.ts +0 -3
- package/components/icons/icon-user.js +0 -12
- package/components/icons/icon-varmland.d.ts +0 -3
- package/components/icons/icon-varmland.js +0 -12
- package/components/icons/icon-vasterbotten.d.ts +0 -3
- package/components/icons/icon-vasterbotten.js +0 -12
- package/components/icons/icon-vasternorrland.d.ts +0 -3
- package/components/icons/icon-vasternorrland.js +0 -12
- package/components/icons/icon-vastmanland.d.ts +0 -3
- package/components/icons/icon-vastmanland.js +0 -12
- package/components/icons/icon-vastra-gotaland.d.ts +0 -3
- package/components/icons/icon-vastra-gotaland.js +0 -12
- package/components/icons/icon-video-off.d.ts +0 -3
- package/components/icons/icon-video-off.js +0 -12
- package/components/icons/icon-video-on.d.ts +0 -3
- package/components/icons/icon-video-on.js +0 -12
- package/components/icons/icon-video-switch.d.ts +0 -3
- package/components/icons/icon-video-switch.js +0 -12
- package/components/icons/icon-visibility-off.d.ts +0 -3
- package/components/icons/icon-visibility-off.js +0 -12
- package/components/icons/icon-visibility.d.ts +0 -3
- package/components/icons/icon-visibility.js +0 -12
- package/components/icons/icon-warning.d.ts +0 -3
- package/components/icons/icon-warning.js +0 -12
- package/components/icons/icon-x.d.ts +0 -3
|
@@ -9,6 +9,7 @@ interface IDSAccordionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
9
9
|
noBorder?: boolean;
|
|
10
10
|
onCollapsed?: () => void;
|
|
11
11
|
onExpanded?: () => void;
|
|
12
|
+
accordions?: ReactNode;
|
|
12
13
|
children?: ReactNode;
|
|
13
14
|
}
|
|
14
15
|
export declare const IDSAccordion: React.FC<IDSAccordionProps>;
|
|
@@ -1,47 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import '@inera/ids-design/components/accordion/accordion.css';
|
|
6
6
|
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
7
7
|
|
|
8
|
-
const IDSAccordion = ({ headline = "", level = 1, headlineSize = level === 2 ? "s" : "m", expanded = false, lean = false, noBorder = false, onCollapsed, onExpanded, children, className, ...props }) => {
|
|
8
|
+
const IDSAccordion = ({ headline = "", level = 1, headlineSize = level === 2 ? "s" : "m", expanded = false, lean = false, noBorder = false, onCollapsed, onExpanded, accordions, children, className, ...props }) => {
|
|
9
9
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
10
|
-
const [isLean, setIsLean] = useState(lean);
|
|
11
|
-
const [insideIDSCard, setInsideIDSCard] = useState(false);
|
|
12
|
-
const [hasChildren, setHasChildren] = useState(false);
|
|
13
10
|
const contentId = useElementId();
|
|
14
11
|
const accordionRef = useRef(null);
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
handleChildren();
|
|
17
|
-
checkIfInsideIDSCard();
|
|
18
|
-
}, []);
|
|
19
12
|
useEffect(() => {
|
|
20
13
|
setIsExpanded(expanded);
|
|
21
14
|
}, [expanded]);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
setIsLean(insideIDSCard);
|
|
24
|
-
}, [insideIDSCard]);
|
|
25
|
-
const checkIfInsideIDSCard = () => {
|
|
26
|
-
if (accordionRef.current?.closest(".ids-card")) {
|
|
27
|
-
setInsideIDSCard(true);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const handleChildren = () => {
|
|
31
|
-
const nestedAccordions = accordionRef.current?.querySelectorAll(".ids-accordion");
|
|
32
|
-
if (nestedAccordions && nestedAccordions.length > 0) {
|
|
33
|
-
setHasChildren(true);
|
|
34
|
-
nestedAccordions.forEach(acc => {
|
|
35
|
-
acc.setAttribute("level", "2");
|
|
36
|
-
if (headlineSize === "m") {
|
|
37
|
-
acc.setAttribute("headlineSize", "s");
|
|
38
|
-
}
|
|
39
|
-
else if (headlineSize === "s") {
|
|
40
|
-
acc.setAttribute("headlineSize", "xs");
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
15
|
const toggleExpansion = () => {
|
|
46
16
|
setIsExpanded(prev => !prev);
|
|
47
17
|
if (isExpanded) {
|
|
@@ -64,20 +34,12 @@ const IDSAccordion = ({ headline = "", level = 1, headlineSize = level === 2 ? "
|
|
|
64
34
|
return (jsxs("div", { ref: accordionRef, className: clsx("ids-accordion", {
|
|
65
35
|
"ids-accordion--expanded": isExpanded,
|
|
66
36
|
"ids-accordion--no-border": noBorder,
|
|
67
|
-
"ids-accordion--lean": lean
|
|
68
|
-
"ids-accordion--has-children":
|
|
37
|
+
"ids-accordion--lean": lean,
|
|
38
|
+
"ids-accordion--has-children": !!accordions,
|
|
69
39
|
"ids-accordion--is-child": level === 2
|
|
70
40
|
}, className), ...props, children: [jsx("div", { className: `ids-accordion__button ids-accordion__button--${headlineSize}`, role: "button", tabIndex: 0, onClick: toggleExpansion, onKeyDown: onKeyPress, "aria-expanded": isExpanded, "aria-controls": contentId, children: jsx("div", { className: clsx("ids-accordion__headline", `ids-accordion__headline-${level}`, `ids-accordion__headline--${headlineSize}`, {
|
|
71
41
|
"ids-accordion__headline--expanded": isExpanded
|
|
72
|
-
}), children: headline }) }),
|
|
73
|
-
if (React__default.isValidElement(child)) {
|
|
74
|
-
return React__default.cloneElement(child, {
|
|
75
|
-
level: 2,
|
|
76
|
-
headlineSize: headlineSize === "m" ? "s" : headlineSize === "s" ? "xs" : "xs"
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return child;
|
|
80
|
-
}) })] }));
|
|
42
|
+
}), children: headline }) }), jsxs("div", { "aria-hidden": !isExpanded, id: contentId, className: "ids-accordion__content", children: [children, accordions && accordions] })] }));
|
|
81
43
|
};
|
|
82
44
|
|
|
83
45
|
export { IDSAccordion };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/alert/alert.css";
|
|
3
3
|
interface IDSAlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
|
|
4
|
+
collapsible?: boolean;
|
|
5
5
|
ribbon?: boolean;
|
|
6
6
|
collapsed?: boolean;
|
|
7
7
|
dismissible?: boolean;
|
|
8
8
|
headline?: ReactNode;
|
|
9
|
+
collapsableHeadline?: string;
|
|
9
10
|
compact?: boolean;
|
|
10
11
|
type?: "info" | "attention" | "success" | "error";
|
|
11
12
|
srCloseText?: string;
|
|
12
13
|
srCollapseText?: string;
|
|
13
14
|
srExpandText?: string;
|
|
14
|
-
srIconTitle?: string;
|
|
15
15
|
noRole?: boolean;
|
|
16
16
|
children?: ReactNode;
|
|
17
17
|
onClose?: () => void;
|
|
18
|
-
onCollapsedChange?: (
|
|
18
|
+
onCollapsedChange?: (isCollapsed: boolean) => void;
|
|
19
19
|
}
|
|
20
20
|
export declare const IDSAlert: React.FC<IDSAlertProps>;
|
|
21
21
|
export {};
|
|
@@ -3,8 +3,10 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/alert/alert.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
+
import { useElementId } from '../utils/hooks/useElementId.js';
|
|
6
7
|
|
|
7
|
-
const IDSAlert = ({
|
|
8
|
+
const IDSAlert = ({ collapsible = false, ribbon = false, collapsed = false, dismissible = false, headline, collapsableHeadline = "", compact = false, type = "info", srCloseText = "Stäng alert", srCollapseText = "Minimera alertmeddelande", srExpandText = "Expandera alertmeddelande", noRole = false, onClose, onCollapsedChange, className, children, ...props }) => {
|
|
9
|
+
const contentId = useElementId();
|
|
8
10
|
const [isCollapsed, setIsCollapsed] = useState(collapsed);
|
|
9
11
|
useEffect(() => {
|
|
10
12
|
setIsCollapsed(collapsed);
|
|
@@ -17,13 +19,14 @@ const IDSAlert = ({ collapsable = false, ribbon = false, collapsed = false, dism
|
|
|
17
19
|
const handleClose = () => {
|
|
18
20
|
onClose?.();
|
|
19
21
|
};
|
|
20
|
-
return (jsx("div", { className: clsx("ids-alert", `ids-alert--${type}`, {
|
|
22
|
+
return (jsx("div", { role: !noRole ? "alert" : undefined, className: clsx("ids-alert", `ids-alert--${type}`, {
|
|
23
|
+
"ids-alert--collapsible": collapsible,
|
|
21
24
|
"ids-alert--collapsed": isCollapsed,
|
|
22
25
|
"ids-alert--ribbon": ribbon,
|
|
23
26
|
"ids-alert--compact": compact
|
|
24
|
-
}, className),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
}, className), ...props, children: compact || ribbon ? (jsxs(Fragment, { children: [jsxs("div", { className: "ids-alert__content", children: [jsx("span", { className: "ids-alert__content-icon", "aria-hidden": "true" }), jsx("span", { className: "ids-alert__content-text", children: children })] }), dismissible && jsx("button", { className: "ids-alert__close", onClick: handleClose, "aria-label": srCloseText })] })) : (jsxs(Fragment, { children: [jsxs("div", { className: "ids-alert__header", children: [collapsible && !compact && !ribbon && (jsx(Fragment, { children: jsx("button", { className: clsx("ids-alert__expand-button", {
|
|
28
|
+
"ids-alert__expand-button--expanded": !isCollapsed
|
|
29
|
+
}), onClick: handleToggleCollapse, "aria-controls": contentId, "aria-expanded": !isCollapsed, children: jsxs("div", { className: "ids-alert__icon_and_text", children: [jsx("span", { className: "ids-alert__state-icon", "aria-hidden": "true" }), jsx("div", { className: "ids-alert__headline", children: collapsableHeadline }), jsx("span", { className: "ids-alert__sr-only", children: isCollapsed ? srExpandText : srCollapseText })] }) }) })), !collapsible && (jsxs("div", { className: "ids-alert__icon_and_text", children: [jsx("span", { className: "ids-alert__state-icon", "aria-hidden": "true" }), jsx("div", { className: "ids-alert__headline", children: headline })] })), dismissible && !collapsible && (jsx("button", { className: "ids-alert__close", onClick: handleClose, "aria-label": srCloseText }))] }), jsx("div", { id: contentId, children: !isCollapsed && jsx("div", { className: "ids-alert__content", children: children }) })] })) }));
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
export { IDSAlert };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "@inera/ids-design/components/badge/badge.css";
|
|
3
|
-
interface IDSBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface IDSBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
type?: "primary" | "secondary" | "neutral" | "info" | "attention" | "success" | "error";
|
|
5
5
|
icon?: string;
|
|
6
|
-
oldIcon?: ReactNode;
|
|
7
|
-
children?: ReactNode;
|
|
8
6
|
}
|
|
9
|
-
export declare
|
|
10
|
-
export {};
|
|
7
|
+
export declare function IDSBadge({ type, icon, children, className, ...props }: IDSBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,8 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import '@inera/ids-design/components/badge/badge.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
return (jsx("div", { className: clsx(`ids-badge ids-badge--${type}`, className), ...props, children: jsxs("div", { className: "ids-badge__inner", children: [
|
|
7
|
-
}
|
|
5
|
+
function IDSBadge({ type = "primary", icon, children, className, ...props }) {
|
|
6
|
+
return (jsx("div", { className: clsx(`ids-badge ids-badge--${type}`, className), ...props, children: jsxs("div", { className: "ids-badge__inner", children: [icon && jsx("span", { className: `ids-icon-${icon}`, "aria-hidden": "true" }), icon && children && jsx("span", { className: "ids-badge__icon" }), children] }) }));
|
|
7
|
+
}
|
|
8
8
|
|
|
9
9
|
export { IDSBadge };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes
|
|
1
|
+
import React, { ButtonHTMLAttributes } from "react";
|
|
2
2
|
import "@inera/ids-design/components/box-link/box-link.css";
|
|
3
|
-
interface IDSBoxLinkProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface IDSBoxLinkProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
srButton?: string;
|
|
5
5
|
buttonIcon?: string;
|
|
6
6
|
onButtonClick?: () => void;
|
|
7
7
|
buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
8
|
-
children: ReactNode;
|
|
9
8
|
}
|
|
10
|
-
export declare
|
|
11
|
-
export {};
|
|
9
|
+
export declare function IDSBoxLink({ srButton, buttonIcon, onButtonClick, buttonProps, children, className, ...props }: IDSBoxLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { useRef } from 'react';
|
|
4
3
|
import '@inera/ids-design/components/box-link/box-link.css';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
function IDSBoxLink({ srButton = "", buttonIcon = "", onButtonClick, buttonProps = {}, children, className, ...props }) {
|
|
8
7
|
const boxLinkRef = useRef(null);
|
|
9
|
-
return (jsx("div", { className: clsx("ids-box-link", className), ref: boxLinkRef, children: jsxs("div", { className: "ids-box-link__inner", children: [jsx("span", { className: "ids-box-link__link", children: children }),
|
|
10
|
-
}
|
|
8
|
+
return (jsx("div", { className: clsx("ids-box-link", { "ids-box-link--has-button": !!onButtonClick }, className), ref: boxLinkRef, ...props, children: jsxs("div", { className: "ids-box-link__inner", children: [jsx("span", { className: "ids-box-link__link", children: children }), onButtonClick && (jsx("div", { className: "ids-box-link__button", children: jsx("button", { className: buttonIcon ? `ids-icon-${buttonIcon}` : undefined, onClick: onButtonClick, "aria-label": srButton, ...buttonProps }) }))] }) }));
|
|
9
|
+
}
|
|
11
10
|
|
|
12
11
|
export { IDSBoxLink };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "@inera/ids-design/components/breadcrumbs/breadcrumbs.css";
|
|
3
3
|
interface IDSBreadcrumbsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
lead?: string;
|
|
5
|
-
children?: ReactNode;
|
|
6
5
|
mobileLink?: React.ReactElement<React.AnchorHTMLAttributes<HTMLAnchorElement> | React.LinkHTMLAttributes<HTMLLinkElement>>;
|
|
7
6
|
}
|
|
8
|
-
export declare
|
|
7
|
+
export declare function IDSBreadcrumbs({ lead, mobileLink, children, className, ...props }: IDSBreadcrumbsProps): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export {};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import '@inera/ids-design/components/breadcrumbs/breadcrumbs.css';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
function IDSBreadcrumbs({ lead = "Du är här", mobileLink, children, className, ...props }) {
|
|
8
7
|
const getMobileLink = () => {
|
|
9
8
|
if (mobileLink) {
|
|
10
|
-
return
|
|
9
|
+
return React.cloneElement(mobileLink, { className: "ids-breadcrumbs__mobile-link" });
|
|
11
10
|
}
|
|
12
11
|
else {
|
|
13
12
|
return null;
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
15
|
const getLinks = () => {
|
|
17
|
-
const links =
|
|
16
|
+
const links = React.Children.toArray(children);
|
|
18
17
|
return links.flatMap((child, index) => {
|
|
19
18
|
const isLast = index === links.length - 1;
|
|
20
19
|
if (isLast) {
|
|
@@ -26,6 +25,6 @@ const IDSBreadcrumbs = ({ lead = "Du är här", mobileLink, children, className,
|
|
|
26
25
|
});
|
|
27
26
|
};
|
|
28
27
|
return (jsxs("nav", { className: clsx("ids-breadcrumbs", className), "aria-label": lead, ...props, children: [jsxs("ol", { className: "ids-breadcrumbs__desktop", children: [jsx("li", { className: "ids-breadcrumbs__lead", children: lead }), getLinks()] }), jsx("ol", { className: "ids-breadcrumbs__mobile", children: jsxs("li", { className: "ids-breadcrumbs__mobile-links", children: [jsx("span", { className: "ids-breadcrumbs__icon" }), getMobileLink()] }) })] }));
|
|
29
|
-
}
|
|
28
|
+
}
|
|
30
29
|
|
|
31
30
|
export { IDSBreadcrumbs };
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ButtonHTMLAttributes } from "react";
|
|
2
2
|
type ButtonSize = "s" | "m" | "l";
|
|
3
3
|
export interface IDSButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
active?: boolean;
|
|
5
5
|
block?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
fab?: boolean;
|
|
8
|
-
|
|
9
|
-
oldIcon?: ReactNode;
|
|
8
|
+
focusAnchor?: boolean;
|
|
10
9
|
icon?: string;
|
|
10
|
+
iconButton?: boolean;
|
|
11
|
+
loading?: boolean;
|
|
11
12
|
mBlock?: boolean;
|
|
12
13
|
sBlock?: boolean;
|
|
13
|
-
loading?: boolean;
|
|
14
|
-
tertiary?: boolean;
|
|
15
14
|
secondary?: boolean;
|
|
16
15
|
size?: ButtonSize;
|
|
17
16
|
submit?: boolean;
|
|
17
|
+
tertiary?: boolean;
|
|
18
18
|
toggle?: boolean;
|
|
19
|
-
focusAnchor?: boolean;
|
|
20
|
-
children?: ReactNode;
|
|
21
19
|
}
|
|
22
|
-
export declare const IDSButton:
|
|
20
|
+
export declare const IDSButton: import("react").ForwardRefExoticComponent<IDSButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
23
21
|
export {};
|
|
@@ -1,44 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
5
|
|
|
6
|
-
const IDSButton = forwardRef(({ active = false, block = false, disabled = false, fab = false, iconButton = false, icon = "",
|
|
7
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
8
|
-
const oldIconRef = useRef(null);
|
|
9
|
-
const handleMouseEnter = () => {
|
|
10
|
-
if (!disabled && oldIconRef.current) {
|
|
11
|
-
setIconHoveredAttributes(oldIconRef.current);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
const handleMouseLeave = () => {
|
|
15
|
-
if (oldIconRef.current) {
|
|
16
|
-
setOldIconAttributes(oldIconRef.current);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const handleFocus = () => {
|
|
20
|
-
setIsFocused(true);
|
|
21
|
-
if (!disabled && oldIconRef.current) {
|
|
22
|
-
setIconHoveredAttributes(oldIconRef.current);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const handleBlur = () => {
|
|
26
|
-
setIsFocused(false);
|
|
27
|
-
};
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (oldIconRef.current) {
|
|
30
|
-
oldIconRef.current.setAttribute("size", "s");
|
|
31
|
-
if (!fab) {
|
|
32
|
-
setOldIconAttributes(oldIconRef.current);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}, []);
|
|
6
|
+
const IDSButton = forwardRef(({ active = false, block = false, disabled = false, fab = false, iconButton = false, icon = "", mBlock = false, sBlock = false, loading = false, tertiary = false, secondary = false, size = "m", submit = false, toggle = false, focusAnchor = false, children, className, ...props }, ref) => {
|
|
36
7
|
const classNames = clsx("ids-button", size && `ids-button--${size}`, {
|
|
37
8
|
"ids-button--m-block": mBlock,
|
|
38
9
|
"ids-button--s-block": sBlock,
|
|
39
|
-
"ids-button--active": active
|
|
10
|
+
"ids-button--active": active,
|
|
40
11
|
"ids-button--fab": fab,
|
|
41
|
-
"ids-button--icon": (
|
|
12
|
+
"ids-button--icon": (icon && !children) || iconButton,
|
|
42
13
|
"ids-button--secondary": secondary,
|
|
43
14
|
"ids-button--tertiary": tertiary,
|
|
44
15
|
"ids-button--disabled": disabled,
|
|
@@ -47,52 +18,7 @@ const IDSButton = forwardRef(({ active = false, block = false, disabled = false,
|
|
|
47
18
|
"ids-button--loading": loading,
|
|
48
19
|
"ids-focus-anchor": focusAnchor
|
|
49
20
|
}, className);
|
|
50
|
-
|
|
51
|
-
if (iconComponent && !fab) {
|
|
52
|
-
let color = "var(--IDS-BUTTON__ICON-COLOR)";
|
|
53
|
-
let color2 = "var(--IDS-BUTTON__ICON-COLOR-2)";
|
|
54
|
-
if (secondary) {
|
|
55
|
-
color = active
|
|
56
|
-
? "var(--IDS-BUTTON--SECONDARY-ACTIVE__ICON-COLOR)"
|
|
57
|
-
: "var(--IDS-BUTTON--SECONDARY__ICON-COLOR)";
|
|
58
|
-
color2 = active
|
|
59
|
-
? "var(--IDS-BUTTON--SECONDARY-ACTIVE__ICON-COLOR-2)"
|
|
60
|
-
: "var(--IDS-BUTTON--SECONDARY__ICON-COLOR-2)";
|
|
61
|
-
}
|
|
62
|
-
else if (tertiary) {
|
|
63
|
-
color = "var(--IDS-BUTTON--TERTIARY__ICON-COLOR)";
|
|
64
|
-
color2 = "var(--IDS-BUTTON--TERTIARY__ICON-COLOR-2)";
|
|
65
|
-
}
|
|
66
|
-
if (disabled) {
|
|
67
|
-
color = "var(--IDS-BUTTON--DISABLED__COLOR)";
|
|
68
|
-
color2 = "var(--IDS-BUTTON--DISABLED__COLOR)";
|
|
69
|
-
}
|
|
70
|
-
setOldIconColors(iconComponent, color, color2);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
const setIconHoveredAttributes = (iconComponent) => {
|
|
74
|
-
if (oldIcon && !fab) {
|
|
75
|
-
let color = "var(--IDS-BUTTON--ACTIVE__ICON-COLOR)";
|
|
76
|
-
let color2 = "var(--IDS-BUTTON--ACTIVE__ICON-COLOR-2)";
|
|
77
|
-
if (secondary) {
|
|
78
|
-
color = "var(--IDS-BUTTON--SECONDARY-ACTIVE__ICON-COLOR)";
|
|
79
|
-
color2 = "var(--IDS-BUTTON--SECONDARY-ACTIVE__ICON-COLOR-2)";
|
|
80
|
-
}
|
|
81
|
-
else if (tertiary) {
|
|
82
|
-
color = "var(--IDS-BUTTON--TERTIARY-ACTIVE__ICON-COLOR)";
|
|
83
|
-
color2 = "var(--IDS-BUTTON--TERTIARY-ACTIVE__ICON-COLOR-2)";
|
|
84
|
-
}
|
|
85
|
-
setOldIconColors(iconComponent, color, color2);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
const setOldIconColors = (iconComponent, color, color2) => {
|
|
89
|
-
iconComponent.setAttribute("color", color);
|
|
90
|
-
iconComponent.setAttribute("color2", color2);
|
|
91
|
-
};
|
|
92
|
-
const renderOldIcon = oldIcon && React__default.isValidElement(oldIcon)
|
|
93
|
-
? React__default.cloneElement(oldIcon, { ref: oldIconRef })
|
|
94
|
-
: oldIcon;
|
|
95
|
-
return (jsxs("button", { ref: ref, className: classNames, "aria-disabled": disabled || loading, "aria-pressed": toggle, tabIndex: !disabled && !loading ? 0 : -1, disabled: disabled, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onFocus: handleFocus, onBlur: handleBlur, ...props, children: [icon && jsx("span", { className: `ids-icon-${icon}` }), oldIcon && renderOldIcon, children] }));
|
|
21
|
+
return (jsxs("button", { ref: ref, className: classNames, "aria-disabled": disabled || loading, "aria-pressed": toggle, tabIndex: !disabled && !loading ? 0 : -1, disabled: disabled, ...props, children: [icon && jsx("span", { className: `ids-icon-${icon}` }), children] }));
|
|
96
22
|
});
|
|
97
23
|
IDSButton.displayName = "IDSButton";
|
|
98
24
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "@inera/ids-design/components/button-group/button-group.css";
|
|
3
3
|
type Justify = "start" | "center" | "end";
|
|
4
4
|
type Break = "s" | "m";
|
|
@@ -7,7 +7,6 @@ interface IDSButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
justify?: Justify;
|
|
8
8
|
unresponsive?: boolean;
|
|
9
9
|
break?: Break;
|
|
10
|
-
children?: ReactNode;
|
|
11
10
|
}
|
|
12
|
-
export declare
|
|
11
|
+
export declare function IDSButtonGroup({ rtl, justify, unresponsive, break: breakpoint, children, className, ...props }: IDSButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -2,12 +2,12 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import '@inera/ids-design/components/button-group/button-group.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function IDSButtonGroup({ rtl = false, justify = "start", unresponsive = false, break: breakpoint = "m", children, className, ...props }) {
|
|
6
6
|
const classNames = clsx("ids-button-group", `ids-button-group--break-${breakpoint}`, `ids-button-group--${justify}`, {
|
|
7
7
|
"ids-button-group--rtl": rtl,
|
|
8
8
|
"ids-button-group--unresponsive": unresponsive
|
|
9
9
|
}, className);
|
|
10
10
|
return (jsx("div", { className: classNames, ...props, children: children }));
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
|
|
13
13
|
export { IDSButtonGroup };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "@inera/ids-design/components/card/card.css";
|
|
3
3
|
interface IDSCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
|
|
4
|
+
borderTop?: boolean;
|
|
5
|
+
cardLink?: React.ReactElement | React.AnchorHTMLAttributes<HTMLAnchorElement> | React.ReactNode;
|
|
5
6
|
fill?: boolean;
|
|
6
|
-
|
|
7
|
-
lean?: boolean;
|
|
7
|
+
focusCard?: boolean;
|
|
8
8
|
hideOnM?: boolean;
|
|
9
9
|
hideOnS?: boolean;
|
|
10
|
-
|
|
11
|
-
children?: ReactNode;
|
|
10
|
+
lean?: boolean;
|
|
12
11
|
}
|
|
13
|
-
export declare
|
|
12
|
+
export declare function IDSCard({ focusCard, fill, borderTop, lean, hideOnM, hideOnS, cardLink, children, className, ...props }: IDSCardProps): import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export {};
|
package/components/card/card.js
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { isValidElement, cloneElement } from 'react';
|
|
3
3
|
import '@inera/ids-design/components/card/card.css';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function IDSCard({ focusCard = false, fill = false, borderTop = false, lean = false, hideOnM = false, hideOnS = false, cardLink, children, className, ...props }) {
|
|
7
|
+
let enhancedCardLink = null;
|
|
8
|
+
if (isValidElement(cardLink)) {
|
|
9
|
+
enhancedCardLink = cloneElement(cardLink, {
|
|
9
10
|
className: clsx(cardLink.props.className, "ids-card--interactive-link")
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
else if (cardLink) {
|
|
14
|
+
const anchorProps = cardLink;
|
|
15
|
+
enhancedCardLink = jsx("a", { ...anchorProps, className: clsx(anchorProps.className, "ids-card--interactive-link") });
|
|
16
|
+
}
|
|
17
|
+
return (jsxs("div", { className: clsx("ids-card", {
|
|
13
18
|
"ids-card--fill": fill,
|
|
14
|
-
"ids-card--
|
|
19
|
+
"ids-card--border-top": !!borderTop && !focusCard,
|
|
20
|
+
"ids-card--focus-card": !!focusCard && !borderTop,
|
|
15
21
|
"ids-card--hide-on-m": hideOnM,
|
|
16
22
|
"ids-card--hide-on-s": hideOnS,
|
|
17
23
|
"ids-card--lean": lean,
|
|
18
24
|
"ids-card--interactive": !!cardLink
|
|
19
|
-
}, className), ...props, children: [borderTop
|
|
20
|
-
}
|
|
25
|
+
}, className), ...props, children: [!!borderTop && !focusCard && jsx("div", { className: "ids-card__border-top" }), jsx("div", { className: "ids-card__content", children: children }), enhancedCardLink] }));
|
|
26
|
+
}
|
|
21
27
|
|
|
22
28
|
export { IDSCard };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import '@inera/ids-design/components/carousel/carousel-item.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSCarouselItem = ({ headline, step, description, children, className }) => {
|
|
7
|
+
const IDSCarouselItem = ({ headline, step, description, children, className, ...props }) => {
|
|
8
8
|
const isImageElement = (child) => {
|
|
9
|
-
return
|
|
9
|
+
return React.isValidElement(child) && child.type === "img";
|
|
10
10
|
};
|
|
11
11
|
const findCarouselImage = (children) => {
|
|
12
12
|
return children.find(isImageElement);
|
|
@@ -14,11 +14,11 @@ const IDSCarouselItem = ({ headline, step, description, children, className }) =
|
|
|
14
14
|
const getNonImageContent = (children) => {
|
|
15
15
|
return children.filter(child => !isImageElement(child));
|
|
16
16
|
};
|
|
17
|
-
const childrenArray =
|
|
17
|
+
const childrenArray = React.Children.toArray(children);
|
|
18
18
|
const image = findCarouselImage(childrenArray);
|
|
19
19
|
const otherContent = getNonImageContent(childrenArray);
|
|
20
20
|
const hasFooterContent = description || step;
|
|
21
|
-
return (jsxs("div", { className: clsx("ids-carousel-item", className), children: [jsx("div", { className: "ids-carousel-item__image", children: image }), jsxs("div", { className: "ids-carousel-item__content", children: [headline && jsx("h2", { className: "ids-carousel-item__headline", children: headline }), otherContent, hasFooterContent && (jsxs("div", { className: "ids-carousel-item__footer", children: [description && jsx("div", { className: "ids-carousel-item__description", children: description }), step && (jsx("div", { className: "ids-carousel-item__step", children: jsx("div", { className: "ids-tag", children: step }) }))] }))] })] }));
|
|
21
|
+
return (jsxs("div", { className: clsx("ids-carousel-item", className), ...props, children: [jsx("div", { className: "ids-carousel-item__image", children: image }), jsxs("div", { className: "ids-carousel-item__content", children: [headline && jsx("h2", { className: "ids-carousel-item__headline", children: headline }), otherContent, hasFooterContent && (jsxs("div", { className: "ids-carousel-item__footer", children: [description && jsx("div", { className: "ids-carousel-item__description", children: description }), step && (jsx("div", { className: "ids-carousel-item__step", children: jsx("div", { className: "ids-tag", children: step }) }))] }))] })] }));
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export { IDSCarouselItem };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "@inera/ids-design/components/carousel/carousel.css";
|
|
3
3
|
interface IDSCarouselProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
autoplay?: boolean;
|
|
5
|
-
autoplayDelay?: number;
|
|
6
4
|
srNextLabel?: string;
|
|
7
5
|
srPrevLabel?: string;
|
|
8
6
|
children: React.ReactNode;
|