@inera/ids-react 7.2.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion.js +4 -4
- package/components/alert/alert.d.ts +3 -3
- package/components/alert/alert.js +8 -5
- package/components/badge/badge.d.ts +0 -1
- package/components/badge/badge.js +2 -2
- package/components/box-link/box-link.js +2 -2
- package/components/breadcrumbs/breadcrumbs.js +3 -3
- package/components/button/button.d.ts +6 -7
- package/components/button/button.js +5 -79
- package/components/card/card.d.ts +4 -4
- package/components/card/card.js +5 -4
- 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 +6 -0
- package/components/date-label/date-label.js +18 -3
- package/components/dialog/dialog.d.ts +12 -12
- package/components/dialog/dialog.js +5 -7
- 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.js +2 -1
- package/components/dropdown/dropdown.d.ts +5 -4
- package/components/dropdown/dropdown.js +11 -10
- package/components/footer-1177/footer-1177.d.ts +0 -3
- package/components/footer-1177/footer-1177.js +17 -23
- package/components/footer-1177-admin/footer-1177-admin.d.ts +5 -7
- package/components/footer-1177-admin/footer-1177-admin.js +21 -26
- package/components/footer-1177-pro/footer-1177-pro.d.ts +15 -10
- package/components/footer-1177-pro/footer-1177-pro.js +41 -22
- package/components/footer-inera/footer-inera.d.ts +2 -6
- package/components/footer-inera/footer-inera.js +21 -27
- package/components/footer-inera-admin/footer-inera-admin.d.ts +2 -6
- package/components/footer-inera-admin/footer-inera-admin.js +23 -26
- 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 +2 -2
- 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/container.d.ts +0 -1
- package/components/grid/container.js +4 -4
- 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 +1 -0
- package/components/header-1177/header-1177-item.js +6 -5
- 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 +4 -4
- package/components/header-1177/header-1177-nav-item.js +6 -7
- package/components/header-1177/header-1177-nav.d.ts +2 -0
- package/components/header-1177/header-1177-nav.js +3 -4
- 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 +2 -6
- package/components/header-1177/header-1177.js +6 -22
- 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.js +4 -4
- 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.js +10 -11
- package/components/header-1177-admin/header-1177-admin-nav.js +4 -5
- package/components/header-1177-admin/header-1177-admin.d.ts +1 -4
- package/components/header-1177-admin/header-1177-admin.js +5 -18
- 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.js +5 -5
- 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.js +11 -11
- package/components/header-1177-pro/header-1177-pro-nav.d.ts +2 -2
- package/components/header-1177-pro/header-1177-pro-nav.js +5 -20
- 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 +4 -7
- package/components/header-1177-pro/header-1177-pro.js +4 -28
- package/components/header-inera/header-inera-item.js +1 -2
- 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 +6 -9
- package/components/header-inera/header-inera-nav.js +2 -3
- package/components/header-inera/header-inera.d.ts +1 -2
- package/components/header-inera/header-inera.js +4 -7
- 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.js +1 -1
- 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.js +6 -9
- package/components/header-inera-admin/header-inera-admin-nav.js +2 -3
- package/components/header-inera-admin/header-inera-admin.d.ts +1 -1
- package/components/header-inera-admin/header-inera-admin.js +4 -5
- 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 +3 -3
- package/components/link/link.js +3 -3
- package/components/mobile/menu/item/mobile-item.js +4 -4
- package/components/navigation/content/navigation-content.d.ts +1 -0
- package/components/navigation/content/navigation-content.js +7 -6
- package/components/pagination/data-pagination/data-pagination.d.ts +7 -11
- package/components/pagination/data-pagination/data-pagination.js +7 -7
- package/components/pagination/list-pagination/list-pagination.js +6 -11
- package/components/popover/popover.js +9 -9
- package/components/progressbar/progressbar.js +2 -2
- package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +1 -0
- package/components/puff-list/puff-list-item/puff-list-item-info.js +5 -2
- package/components/puff-list/puff-list-item/puff-list-item.d.ts +8 -0
- package/components/puff-list/puff-list-item/puff-list-item.js +47 -13
- package/components/puff-list/puff-list.js +2 -2
- package/components/region-icon/region-icon.js +1 -2
- package/components/side-menu/side-menu.d.ts +1 -1
- package/components/side-menu/side-menu.js +6 -6
- 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.js +4 -4
- package/components/tabs/tab-panel.js +2 -2
- package/components/tabs/tab.js +2 -2
- package/components/tabs/tabs.js +13 -13
- package/components/tooltip/tooltip.js +2 -2
- package/components/utils/contexts/HeaderContext.d.ts +0 -2
- package/index.d.ts +16 -144
- package/index.js +16 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { 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';
|
|
@@ -69,9 +69,9 @@ const IDSAccordion = ({ headline = "", level = 1, headlineSize = level === 2 ? "
|
|
|
69
69
|
"ids-accordion--is-child": level === 2
|
|
70
70
|
}, 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
71
|
"ids-accordion__headline--expanded": isExpanded
|
|
72
|
-
}), children: headline }) }), jsx("div", { "aria-hidden": !isExpanded, id: contentId, className: "ids-accordion__content", children:
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
72
|
+
}), children: headline }) }), jsx("div", { "aria-hidden": !isExpanded, id: contentId, className: "ids-accordion__content", children: React.Children.map(children, child => {
|
|
73
|
+
if (React.isValidElement(child)) {
|
|
74
|
+
return React.cloneElement(child, {
|
|
75
75
|
level: 2,
|
|
76
76
|
headlineSize: headlineSize === "m" ? "s" : headlineSize === "s" ? "xs" : "xs"
|
|
77
77
|
});
|
|
@@ -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 };
|
|
@@ -3,7 +3,6 @@ import "@inera/ids-design/components/badge/badge.css";
|
|
|
3
3
|
interface IDSBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
type?: "primary" | "secondary" | "neutral" | "info" | "attention" | "success" | "error";
|
|
5
5
|
icon?: string;
|
|
6
|
-
oldIcon?: ReactNode;
|
|
7
6
|
children?: ReactNode;
|
|
8
7
|
}
|
|
9
8
|
export declare const IDSBadge: React.FC<IDSBadgeProps>;
|
|
@@ -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
|
-
const IDSBadge = ({ type = "primary", icon,
|
|
6
|
-
return (jsx("div", { className: clsx(`ids-badge ids-badge--${type}`, className), ...props, children: jsxs("div", { className: "ids-badge__inner", children: [
|
|
5
|
+
const 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
7
|
};
|
|
8
8
|
|
|
9
9
|
export { IDSBadge };
|
|
@@ -4,9 +4,9 @@ import { useRef } from 'react';
|
|
|
4
4
|
import '@inera/ids-design/components/box-link/box-link.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const IDSBoxLink = ({ srButton = "", buttonIcon = "", onButtonClick, children, className, buttonProps = {} }) => {
|
|
7
|
+
const IDSBoxLink = ({ srButton = "", buttonIcon = "", onButtonClick, children, className, buttonProps = {}, ...props }) => {
|
|
8
8
|
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 }), !!onButtonClick && (jsx("div", { className: "ids-box-link__button", children: jsx("button", { className: `ids-icon-${buttonIcon}`, onClick: onButtonClick, "aria-label": srButton, ...buttonProps }) }))] }) }));
|
|
9
|
+
return (jsx("div", { className: clsx("ids-box-link", 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: `ids-icon-${buttonIcon}`, onClick: onButtonClick, "aria-label": srButton, ...buttonProps }) }))] }) }));
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export { IDSBoxLink };
|
|
@@ -1,20 +1,20 @@
|
|
|
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/breadcrumbs/breadcrumbs.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
7
|
const IDSBreadcrumbs = ({ lead = "Du är här", mobileLink, children, className, ...props }) => {
|
|
8
8
|
const getMobileLink = () => {
|
|
9
9
|
if (mobileLink) {
|
|
10
|
-
return
|
|
10
|
+
return React.cloneElement(mobileLink, { className: "ids-breadcrumbs__mobile-link" });
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
const getLinks = () => {
|
|
17
|
-
const links =
|
|
17
|
+
const links = React.Children.toArray(children);
|
|
18
18
|
return links.flatMap((child, index) => {
|
|
19
19
|
const isLast = index === links.length - 1;
|
|
20
20
|
if (isLast) {
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, 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
19
|
children?: ReactNode;
|
|
21
20
|
}
|
|
22
|
-
export declare const IDSButton:
|
|
21
|
+
export declare const IDSButton: import("react").ForwardRefExoticComponent<IDSButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
23
22
|
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,13 +1,13 @@
|
|
|
1
1
|
import React, { ReactNode } 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?: ReactNode;
|
|
5
6
|
fill?: boolean;
|
|
6
|
-
|
|
7
|
-
lean?: boolean;
|
|
7
|
+
focusCard?: boolean;
|
|
8
8
|
hideOnM?: boolean;
|
|
9
9
|
hideOnS?: boolean;
|
|
10
|
-
|
|
10
|
+
lean?: boolean;
|
|
11
11
|
children?: ReactNode;
|
|
12
12
|
}
|
|
13
13
|
export declare const IDSCard: React.FC<IDSCardProps>;
|
package/components/card/card.js
CHANGED
|
@@ -3,20 +3,21 @@ import { isValidElement, cloneElement } from 'react';
|
|
|
3
3
|
import '@inera/ids-design/components/card/card.css';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
|
|
6
|
-
const IDSCard = ({ focusCard = false, fill = false, borderTop =
|
|
6
|
+
const IDSCard = ({ focusCard = false, fill = false, borderTop = false, lean = false, hideOnM = false, hideOnS = false, cardLink, children, className, ...props }) => {
|
|
7
7
|
const enhancedCardLink = isValidElement(cardLink)
|
|
8
8
|
? cloneElement(cardLink, {
|
|
9
9
|
className: clsx(cardLink.props.className, "ids-card--interactive-link")
|
|
10
10
|
})
|
|
11
11
|
: cardLink;
|
|
12
|
-
return (jsxs("div", { className: clsx("ids-card",
|
|
12
|
+
return (jsxs("div", { className: clsx("ids-card", {
|
|
13
13
|
"ids-card--fill": fill,
|
|
14
|
-
"ids-card--
|
|
14
|
+
"ids-card--border-top": !!borderTop && !focusCard,
|
|
15
|
+
"ids-card--focus-card": !!focusCard && !borderTop,
|
|
15
16
|
"ids-card--hide-on-m": hideOnM,
|
|
16
17
|
"ids-card--hide-on-s": hideOnS,
|
|
17
18
|
"ids-card--lean": lean,
|
|
18
19
|
"ids-card--interactive": !!cardLink
|
|
19
|
-
}, className), ...props, children: [borderTop
|
|
20
|
+
}, className), ...props, children: [!!borderTop && !focusCard && jsx("div", { className: "ids-card__border-top" }), jsx("div", { className: "ids-card__content", children: children }), enhancedCardLink] }));
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
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;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import { useState, useRef, Children, useEffect } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/carousel/carousel.css';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { breakPoints } from '../utils/utils.js';
|
|
7
7
|
|
|
8
|
-
const IDSCarousel = ({
|
|
8
|
+
const IDSCarousel = ({ srNextLabel = "Nästa", srPrevLabel = "Föregående", className, children, ...props }) => {
|
|
9
9
|
const [activeSlideIndex, setActiveSlideIndex] = useState(0);
|
|
10
10
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
11
11
|
const [isAnimatingLeft, setIsAnimatingLeft] = useState(false);
|
|
@@ -61,9 +61,7 @@ const IDSCarousel = ({ autoplay = false, autoplayDelay = 5000, srNextLabel = "N
|
|
|
61
61
|
}, []);
|
|
62
62
|
// Set button location
|
|
63
63
|
const setButtonLocation = () => {
|
|
64
|
-
const imageHeight = carouselRef.current
|
|
65
|
-
?.querySelector(".ids-carousel-item__image")
|
|
66
|
-
?.getBoundingClientRect().height;
|
|
64
|
+
const imageHeight = carouselRef.current?.querySelector(".ids-carousel-item__image")?.getBoundingClientRect().height;
|
|
67
65
|
const buttonPlacement = imageHeight / 2;
|
|
68
66
|
if (imageHeight && buttonPlacement) {
|
|
69
67
|
setButtonPosition({
|
|
@@ -72,15 +70,6 @@ const IDSCarousel = ({ autoplay = false, autoplayDelay = 5000, srNextLabel = "N
|
|
|
72
70
|
});
|
|
73
71
|
}
|
|
74
72
|
};
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
if (!autoplay)
|
|
77
|
-
return;
|
|
78
|
-
const delay = Math.max(autoplayDelay, 500);
|
|
79
|
-
const timer = setInterval(() => {
|
|
80
|
-
handleNext();
|
|
81
|
-
}, delay);
|
|
82
|
-
return () => clearInterval(timer);
|
|
83
|
-
}, [autoplay, autoplayDelay]);
|
|
84
73
|
// change slide
|
|
85
74
|
const handleNext = () => {
|
|
86
75
|
if (isAnimating)
|
|
@@ -93,7 +82,6 @@ const IDSCarousel = ({ autoplay = false, autoplayDelay = 5000, srNextLabel = "N
|
|
|
93
82
|
setIsAnimatingRight(false);
|
|
94
83
|
}, 500);
|
|
95
84
|
};
|
|
96
|
-
// Previous slide
|
|
97
85
|
const handlePrev = () => {
|
|
98
86
|
if (isAnimating)
|
|
99
87
|
return;
|
|
@@ -105,6 +93,22 @@ const IDSCarousel = ({ autoplay = false, autoplayDelay = 5000, srNextLabel = "N
|
|
|
105
93
|
setIsAnimatingLeft(false);
|
|
106
94
|
}, 500);
|
|
107
95
|
};
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (!carouselRef.current)
|
|
98
|
+
return;
|
|
99
|
+
const allSlides = carouselRef.current.querySelectorAll(".ids-carousel-item-wrapper");
|
|
100
|
+
allSlides.forEach((slide, index) => {
|
|
101
|
+
const isActive = index === activeSlideIndex;
|
|
102
|
+
if (isActive) {
|
|
103
|
+
slide.removeAttribute("inert");
|
|
104
|
+
slide.setAttribute("aria-hidden", "false");
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
slide.setAttribute("inert", "");
|
|
108
|
+
slide.setAttribute("aria-hidden", "true");
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}, [activeSlideIndex]);
|
|
108
112
|
// Touch/swipe
|
|
109
113
|
const touchStartX = useRef(null);
|
|
110
114
|
const handleTouchStart = (e) => {
|
|
@@ -118,28 +122,6 @@ const IDSCarousel = ({ autoplay = false, autoplayDelay = 5000, srNextLabel = "N
|
|
|
118
122
|
handleNext();
|
|
119
123
|
touchStartX.current = null;
|
|
120
124
|
};
|
|
121
|
-
const setTabIndexRecursively = (node, tabIndex) => {
|
|
122
|
-
if (React__default.isValidElement(node)) {
|
|
123
|
-
const props = {};
|
|
124
|
-
// Skip recursion into IDSLink — set tabIndex only at the top level if needed
|
|
125
|
-
if (node.type.displayName === "IDSLink" || node.type.name === "IDSLink") {
|
|
126
|
-
return React__default.cloneElement(node, {
|
|
127
|
-
tabIndex
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
if (typeof node.type === "string") {
|
|
131
|
-
const focusableTags = ["a", "button", "input", "select", "textarea"];
|
|
132
|
-
if (focusableTags.includes(node.type)) {
|
|
133
|
-
props.tabIndex = tabIndex;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (node.props && node.props.children) {
|
|
137
|
-
props.children = React__default.Children.map(node.props.children, child => setTabIndexRecursively(child, tabIndex));
|
|
138
|
-
}
|
|
139
|
-
return React__default.cloneElement(node, props);
|
|
140
|
-
}
|
|
141
|
-
return node;
|
|
142
|
-
};
|
|
143
125
|
const slides = Children.map(children, (child, index) => {
|
|
144
126
|
const isActive = index === activeSlideIndex;
|
|
145
127
|
const isPrev = index === (activeSlideIndex - 1 + slideCount) % slideCount;
|
|
@@ -151,16 +133,14 @@ const IDSCarousel = ({ autoplay = false, autoplayDelay = 5000, srNextLabel = "N
|
|
|
151
133
|
itemClass += " prev";
|
|
152
134
|
else if (isNext)
|
|
153
135
|
itemClass += " next";
|
|
154
|
-
|
|
155
|
-
const processedChild = isActive ? child : setTabIndexRecursively(child, -1);
|
|
156
|
-
return (jsx("div", { className: itemClass, "aria-hidden": !isActive, children: processedChild }, index));
|
|
136
|
+
return isActive ? (jsx("div", { className: itemClass, "aria-hidden": "false", children: child }, index)) : (jsx("div", { className: itemClass, "aria-hidden": "true", inert: true, children: child }, index));
|
|
157
137
|
});
|
|
158
138
|
const isMobile = windowWidth < breakPoints.medium;
|
|
159
|
-
return (jsxs("div", { className: clsx("ids-carousel", className), ref: carouselRef, children: [jsx("button", { "aria-label": srPrevLabel, className: clsx("ids-carousel__button-prev", {
|
|
139
|
+
return (jsxs("div", { className: clsx("ids-carousel", className), ref: carouselRef, ...props, children: [jsx("button", { "aria-label": srPrevLabel, className: clsx("ids-carousel__button-prev", {
|
|
160
140
|
"ids-carousel__button-prev--mobile": isMobile
|
|
161
141
|
}), onClick: handlePrev, style: buttonPosition, children: isMobile && jsx("div", { className: "ids-carousel-btn__inner" }) }), jsx("button", { "aria-label": srNextLabel, className: clsx("ids-carousel__button-next", {
|
|
162
142
|
"ids-carousel__button-next--mobile": isMobile
|
|
163
|
-
}), onClick: handleNext, style: buttonPosition, children: isMobile && jsx("div", { className: "ids-carousel-btn__inner" }) }), jsx("div", { className: clsx("ids-carousel-
|
|
143
|
+
}), onClick: handleNext, style: buttonPosition, children: isMobile && jsx("div", { className: "ids-carousel-btn__inner" }) }), jsx("div", { className: clsx("ids-carousel-content js-carousel-slide", {
|
|
164
144
|
"animating-left": isAnimatingLeft,
|
|
165
145
|
"animating-right": isAnimatingRight
|
|
166
146
|
}), onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, children: jsx("div", { "aria-live": "polite", children: slides }) })] }));
|
|
@@ -6,6 +6,12 @@ interface IDSDateLabelProps extends DetailedHTMLProps<TimeHTMLAttributes<HTMLTim
|
|
|
6
6
|
month?: number;
|
|
7
7
|
monthLabel?: string;
|
|
8
8
|
day?: number;
|
|
9
|
+
dateTo?: Date | null;
|
|
10
|
+
yearTo?: number;
|
|
11
|
+
monthTo?: number;
|
|
12
|
+
monthToLabel?: string;
|
|
13
|
+
dayTo?: number;
|
|
14
|
+
srText?: string;
|
|
9
15
|
}
|
|
10
16
|
export declare const IDSDateLabel: React.FC<IDSDateLabelProps>;
|
|
11
17
|
export {};
|
|
@@ -5,21 +5,36 @@ import '@inera/ids-design/components/date-label/date-label.css';
|
|
|
5
5
|
import { getDayAsText, getMonthAsSweText } from '../utils/utils.js';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
|
|
8
|
-
const IDSDateLabel = ({ date = null, year = 0, month = 0, monthLabel = "",
|
|
9
|
-
const [presentedDate, setPresentedDate] = useState(null);
|
|
8
|
+
const IDSDateLabel = ({ date = null, year = 0, month = 0, day = 0, monthLabel = "", dateTo = null, yearTo = 0, monthTo = 0, monthToLabel = "", srText = "", dayTo = 0, className, ...props }) => {
|
|
9
|
+
const [presentedDate, setPresentedDate] = useState(date ? new Date(date) : null);
|
|
10
|
+
const [presentedToDate, setPresentedToDate] = useState(dateTo ? new Date(dateTo) : null);
|
|
10
11
|
useEffect(() => {
|
|
11
12
|
if (date) {
|
|
12
13
|
setPresentedDate(new Date(date));
|
|
13
14
|
}
|
|
14
15
|
}, [date]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (dateTo) {
|
|
18
|
+
setPresentedToDate(new Date(dateTo));
|
|
19
|
+
}
|
|
20
|
+
}, [dateTo]);
|
|
15
21
|
const getYear = () => (presentedDate ? presentedDate.getFullYear() : year);
|
|
22
|
+
const getYearTo = () => (presentedToDate ? presentedToDate.getFullYear() : yearTo);
|
|
16
23
|
const getMonth = () => (presentedDate ? presentedDate.getMonth() + 1 : month);
|
|
24
|
+
const getMonthTo = () => (presentedToDate ? presentedToDate.getMonth() + 1 : monthTo);
|
|
17
25
|
const getDay = () => {
|
|
18
26
|
const dayNumber = presentedDate ? presentedDate.getDate() : day;
|
|
19
27
|
return getDayAsText(dayNumber);
|
|
20
28
|
};
|
|
29
|
+
const getDayTo = () => {
|
|
30
|
+
const dayNumber = presentedToDate ? presentedToDate.getDate() : dayTo;
|
|
31
|
+
return getDayAsText(dayNumber);
|
|
32
|
+
};
|
|
21
33
|
const getMonthText = () => (monthLabel ? monthLabel : getMonthAsSweText(getMonth() - 1, 3));
|
|
22
|
-
|
|
34
|
+
const getMonthToText = () => (monthToLabel ? monthToLabel : getMonthAsSweText(getMonthTo() - 1, 3));
|
|
35
|
+
// dateTime={`${getDay()}-${getMonth().toString().padStart(2, "0")}-${getYear()}`}
|
|
36
|
+
// dateTime={`${getDayTo()}-${getMonthTo().toString().padStart(2, "0")}-${getYearTo()}`}
|
|
37
|
+
return (jsxs("span", { className: "ids-date-label", "aria-label": srText, ...props, role: "text", children: [jsxs("time", { className: clsx("ids-date-label__time", className), "aria-hidden": "true", children: [jsx("span", { className: "ids-date-label__day", children: getDay() }), jsx("span", { className: "ids-date-label__month", children: getMonthText() }), jsx("span", { className: "ids-date-label__year", children: getYear() })] }), !!(!!dateTo || (dayTo && monthTo && yearTo)) && (jsxs("time", { className: clsx("ids-date-label__time ids-date-label__time--separator", className), "aria-hidden": "true", children: [jsx("span", { className: "ids-date-label__day", children: getDayTo() }), jsx("span", { className: "ids-date-label__month", children: getMonthToText() }), jsx("span", { className: "ids-date-label__year", children: getYearTo() })] }))] }));
|
|
23
38
|
};
|
|
24
39
|
|
|
25
40
|
export { IDSDateLabel };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import "@inera/ids-design/components/dialog/dialog.css";
|
|
3
3
|
interface IDSDialogProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
|
|
5
|
-
srClose?: string;
|
|
6
|
-
dismissible?: boolean;
|
|
4
|
+
actions?: ReactNode;
|
|
7
5
|
autoFocus?: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
dismissible?: boolean;
|
|
7
|
+
headline?: ReactNode;
|
|
8
|
+
height?: string;
|
|
10
9
|
keepScrollbar?: boolean;
|
|
11
|
-
persistent?: boolean;
|
|
12
|
-
noScrollAreaFocus?: boolean;
|
|
13
|
-
width?: string;
|
|
14
10
|
maxWidth?: string;
|
|
15
|
-
|
|
11
|
+
noFocusTrap?: boolean;
|
|
12
|
+
noOverlay?: boolean;
|
|
13
|
+
noScrollAreaFocus?: boolean;
|
|
14
|
+
persistent?: boolean;
|
|
15
|
+
show?: boolean;
|
|
16
|
+
srClose?: string;
|
|
16
17
|
trigger?: ReactNode;
|
|
17
|
-
|
|
18
|
-
actions?: ReactNode;
|
|
18
|
+
width?: string;
|
|
19
19
|
children?: ReactNode;
|
|
20
|
-
onVisibilityChange?: (
|
|
20
|
+
onVisibilityChange?: (isVisible: boolean) => void;
|
|
21
21
|
}
|
|
22
22
|
export declare const IDSDialog: React.FC<IDSDialogProps>;
|
|
23
23
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useRef,
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import '@inera/ids-design/components/dialog/dialog.css';
|
|
5
5
|
import { useFocusTrap } from '../utils/hooks/useFocusTrap.js';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -9,8 +9,6 @@ const IDSDialog = ({ show = false, srClose = "Stäng", dismissible = false, auto
|
|
|
9
9
|
const [isVisible, setIsVisible] = useState(show);
|
|
10
10
|
const dialogRef = useRef(null);
|
|
11
11
|
const bodyRef = useRef(null);
|
|
12
|
-
const headlineId = useId();
|
|
13
|
-
const contentId = useId();
|
|
14
12
|
const [hasScrollbar, setHasScrollbar] = useState(false);
|
|
15
13
|
useFocusTrap(dialogRef.current, isVisible && !noFocusTrap);
|
|
16
14
|
useEffect(() => {
|
|
@@ -50,7 +48,7 @@ const IDSDialog = ({ show = false, srClose = "Stäng", dismissible = false, auto
|
|
|
50
48
|
setTimeout(() => {
|
|
51
49
|
const focusable = bodyRef.current?.querySelector(".ids-focus-anchor") ||
|
|
52
50
|
bodyRef.current?.querySelector("h1, h2, h3, [tabindex]:not([tabindex='-1']), button:not([disabled]), a, input:not([disabled]), textarea:not([disabled])") ||
|
|
53
|
-
dialogRef.current?.querySelector("button.ids-
|
|
51
|
+
dialogRef.current?.querySelector("button.ids-dialog__close-button");
|
|
54
52
|
console.log("focusable", focusable);
|
|
55
53
|
focusable?.focus();
|
|
56
54
|
});
|
|
@@ -65,15 +63,15 @@ const IDSDialog = ({ show = false, srClose = "Stäng", dismissible = false, auto
|
|
|
65
63
|
"ids-dialog-overlay--hidden": !isVisible || noOverlay
|
|
66
64
|
}), onClick: overlayClick }), jsxs("div", { ref: dialogRef, className: clsx("ids-dialog", {
|
|
67
65
|
"ids-dialog--hidden": !isVisible
|
|
68
|
-
}, className), role: "dialog", "aria-modal": "true",
|
|
66
|
+
}, className), role: "dialog", "aria-modal": "true", style: {
|
|
69
67
|
width,
|
|
70
68
|
maxWidth,
|
|
71
69
|
height,
|
|
72
70
|
maxHeight: height || undefined
|
|
73
|
-
}, ...props, children: [dismissible && (jsx("div", { className: "ids-
|
|
71
|
+
}, ...props, children: [dismissible && (jsx("div", { className: "ids-dialog__dismissible", children: jsx("button", { "aria-label": srClose, className: "ids-dialog__close-button", onClick: () => setIsVisible(false) }) })), jsxs("div", { ref: bodyRef, className: clsx("ids-dialog__body", {
|
|
74
72
|
"ids-dialog__body--has-scrollbar": hasScrollbar,
|
|
75
73
|
"ids-dialog__body--scroll-area-focus": !noScrollAreaFocus
|
|
76
|
-
}), tabIndex: noScrollAreaFocus ? -1 : 0, children: [jsx("div", {
|
|
74
|
+
}), tabIndex: noScrollAreaFocus ? -1 : 0, children: [jsx("div", { className: "ids-dialog__body-headline", children: headline }), jsx("div", { className: "ids-dialog__body-content", children: children }), actions && jsx("div", { className: "ids-dialog__footer", children: actions })] })] })] }));
|
|
77
75
|
};
|
|
78
76
|
|
|
79
77
|
export { IDSDialog };
|