@lifesg/react-design-system 4.0.0-alpha.4 → 4.0.0-alpha.5
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/accordion/accordion-item.styles_1j4eb32.css +2 -2
- package/accordion/accordion.d.ts +19 -0
- package/accordion/accordion.js.map +1 -1
- package/accordion/accordion.styles_bzrfrs.css +2 -2
- package/accordion/types.d.ts +42 -2
- package/alert/alert.d.ts +8 -0
- package/alert/alert.js.map +1 -1
- package/alert/alert.styles_patwo2.css +2 -2
- package/alert/types.d.ts +26 -2
- package/animations/loading-dots/loading-dots.styles_1rgrrmw.css +2 -2
- package/animations/loading-dots/lottie-animation.styles_1m15v69.css +1 -1
- package/animations/loading-dots-spinner/loading-dots-spinner.styles_1hcqkhs.css +2 -2
- package/animations/loading-dots-spinner/lottie-animation.styles_13d1unb.css +1 -1
- package/animations/loading-spinner/loading-spinner.styles_n6xoft.css +2 -2
- package/animations/loading-spinner/lottie-animation.styles_bnn4qt.css +1 -1
- package/avatar/avatar.d.ts +7 -0
- package/avatar/avatar.js.map +1 -1
- package/avatar/avatar.styles_16efw4.css +2 -2
- package/avatar/types.d.ts +11 -0
- package/badge/badge.d.ts +7 -0
- package/badge/badge.js.map +1 -1
- package/badge/badge.styles_1c3c6wj.css +2 -2
- package/badge/types.d.ts +20 -0
- package/box-container/box-container.d.ts +8 -0
- package/box-container/box-container.js.map +1 -1
- package/box-container/box-container.styles_5t2j9k.css +2 -2
- package/box-container/types.d.ts +24 -0
- package/breadcrumb/breadcrumb.styles_1nl4aua.css +2 -2
- package/button/button.styles_1pxy0co.css +2 -2
- package/calendar/calendar.styles_11ho5x8.css +2 -2
- package/card/card.styles_1gh9gs3.css +2 -2
- package/checkbox/checkbox.styles_gm5bu1.css +2 -2
- package/cjs/accordion/accordion-item.styles_1j4eb32.css +2 -2
- package/cjs/accordion/accordion.js.map +1 -1
- package/cjs/accordion/accordion.styles_bzrfrs.css +2 -2
- package/cjs/alert/alert.js.map +1 -1
- package/cjs/alert/alert.styles_patwo2.css +2 -2
- package/cjs/animations/loading-dots/loading-dots.styles_1rgrrmw.css +2 -2
- package/cjs/animations/loading-dots/lottie-animation.styles_1m15v69.css +1 -1
- package/cjs/animations/loading-dots-spinner/loading-dots-spinner.styles_1hcqkhs.css +2 -2
- package/cjs/animations/loading-dots-spinner/lottie-animation.styles_13d1unb.css +1 -1
- package/cjs/animations/loading-spinner/loading-spinner.styles_n6xoft.css +2 -2
- package/cjs/animations/loading-spinner/lottie-animation.styles_bnn4qt.css +1 -1
- package/cjs/avatar/avatar.js.map +1 -1
- package/cjs/avatar/avatar.styles_16efw4.css +2 -2
- package/cjs/badge/badge.js.map +1 -1
- package/cjs/badge/badge.styles_1c3c6wj.css +2 -2
- package/cjs/box-container/box-container.js.map +1 -1
- package/cjs/box-container/box-container.styles_5t2j9k.css +2 -2
- package/cjs/breadcrumb/breadcrumb.styles_1nl4aua.css +2 -2
- package/cjs/button/button.styles_1pxy0co.css +2 -2
- package/cjs/calendar/calendar.styles_11ho5x8.css +2 -2
- package/cjs/card/card.styles_1gh9gs3.css +2 -2
- package/cjs/checkbox/checkbox.styles_gm5bu1.css +2 -2
- package/cjs/countdown-timer/countdown-timer.js.map +1 -1
- package/cjs/countdown-timer/countdown-timer.styles_ipn1b0.css +2 -2
- package/cjs/dashed-border/dashed-border.js.map +1 -1
- package/cjs/dashed-border/dashed-border.styles_zszoox.css +2 -2
- package/cjs/data-table/data-table.js.map +1 -1
- package/cjs/data-table/data-table.styles_1iqq1g7.css +2 -2
- package/cjs/date-input/date-input.js.map +1 -1
- package/cjs/date-input/date-input.styles_1r5kcc7.css +1 -1
- package/cjs/date-navigator/date-navigator.js.map +1 -1
- package/cjs/date-navigator/date-navigator.styles_wokh56.css +2 -2
- package/cjs/date-range-input/date-range-input.js.map +1 -1
- package/cjs/date-range-input/date-range-input.styles_1s7ojnj.css +2 -2
- package/cjs/divider/divider.js.map +1 -1
- package/cjs/divider/divider.styles_1xpzh8p.css +2 -2
- package/cjs/drawer/drawer.js.map +1 -1
- package/cjs/drawer/drawer.styles_94hx3y.css +2 -2
- package/cjs/e-signature/e-signature-canvas.js +1 -1
- package/cjs/e-signature/e-signature-canvas.js.map +1 -1
- package/cjs/e-signature/e-signature.js.map +1 -1
- package/cjs/e-signature/e-signature.styles_lukd9f.css +2 -2
- package/cjs/error-display/error-display.js.map +1 -1
- package/cjs/error-display/error-display.styles_d3tql1.css +2 -2
- package/cjs/external/dompurify/dist/purify.es.js +3 -3
- package/cjs/external/dompurify/dist/purify.es.js.map +1 -1
- package/cjs/feedback-rating/feedback-rating-stars-container.styles_dmi8z9.css +2 -2
- package/cjs/feedback-rating/feedback-rating.js.map +1 -1
- package/cjs/feedback-rating/feedback-rating.styles_1kdklb6.css +2 -2
- package/cjs/file-download/file-download.js.map +1 -1
- package/cjs/file-download/file-download.styles_iggk8q.css +2 -2
- package/cjs/file-download/file-list-card/file-list-card.styles.js +1 -1
- package/cjs/file-download/file-list-card/file-list-card.styles.js.map +1 -1
- package/cjs/file-download/file-list-card/{file-list-card.styles_oom8ii.css → file-list-card.styles_18j2gut.css} +3 -3
- package/cjs/file-upload/dropzone.styles_1pllsau.css +2 -2
- package/cjs/file-upload/file-item-edit.js +1 -1
- package/cjs/file-upload/file-item-edit.js.map +1 -1
- package/cjs/file-upload/file-item-edit.styles.js +1 -1
- package/cjs/file-upload/file-item-edit.styles.js.map +1 -1
- package/cjs/file-upload/{file-item-edit.styles_1qbpbxj.css → file-item-edit.styles_19bvztn.css} +6 -5
- package/cjs/file-upload/file-list/file-list.js +1 -1
- package/cjs/file-upload/file-list/file-list.js.map +1 -1
- package/cjs/file-upload/file-list/file-list.styles.js +1 -1
- package/cjs/file-upload/file-list/file-list.styles.js.map +1 -1
- package/cjs/file-upload/file-list/file-list.styles_1w7so98.css +3 -0
- package/cjs/file-upload/file-list-item/file-list-item-thumbnail.styles_1y4si19.css +2 -2
- package/cjs/file-upload/file-list-item/file-list-item.js +1 -1
- package/cjs/file-upload/file-list-item/file-list-item.js.map +1 -1
- package/cjs/file-upload/file-list-item/file-list-item.styles.js +1 -1
- package/cjs/file-upload/file-list-item/file-list-item.styles.js.map +1 -1
- package/cjs/file-upload/file-list-item/file-list-item.styles_o8000f.css +17 -0
- package/cjs/file-upload/file-upload.js +1 -1
- package/cjs/file-upload/file-upload.js.map +1 -1
- package/cjs/file-upload/file-upload.styles_9ffwcd.css +2 -2
- package/cjs/filter/addons/filter-item-checkbox.styles_7degw7.css +2 -2
- package/cjs/filter/filter-item-page.styles_17ewfrz.css +1 -1
- package/cjs/filter/filter-item.js.map +1 -1
- package/cjs/filter/filter-item.styles_cphjnj.css +2 -2
- package/cjs/filter/filter-modal.styles_qw3xlg.css +2 -2
- package/cjs/filter/filter-sidebar.styles_1otwpjl.css +2 -2
- package/cjs/filter/filter.js.map +1 -1
- package/cjs/filter/filter.styles_1ykijwm.css +2 -2
- package/cjs/footer/footer-download-app.styles_1v1j2us.css +2 -2
- package/cjs/footer/footer-resource-addon.styles_1jepb1d.css +2 -2
- package/cjs/footer/footer.js +1 -1
- package/cjs/footer/footer.js.map +1 -1
- package/cjs/footer/footer.styles_1msorhc.css +2 -2
- package/cjs/form/form-label-addon.styles_b00z8p.css +1 -1
- package/cjs/form/form-label.styles.js +1 -1
- package/cjs/form/form-label.styles.js.map +1 -1
- package/cjs/form/{form-label.styles_11r0652.css → form-label.styles_1nbe0bm.css} +2 -2
- package/cjs/form/form-textarea.styles_3p9qoy.css +2 -2
- package/cjs/form/form-wrapper.styles_199rslu.css +1 -1
- package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.styles_vc6y5c.css +2 -2
- package/cjs/fullscreen-image-carousel/stateful-image.styles_1xe8ypm.css +2 -2
- package/cjs/histogram-slider/histogram-slider.styles_wvd4w.css +2 -2
- package/cjs/image-button/image-button.styles_6n1qsr.css +2 -2
- package/cjs/index.js +1 -1
- package/cjs/input/input.styles_1cblor0.css +2 -2
- package/cjs/input-group/input-group-list-addon.styles_17iuqtw.css +2 -2
- package/cjs/input-group/input-group.styles_bqye6f.css +2 -2
- package/cjs/input-range-select/input-range-select.styles_adbrbm.css +2 -2
- package/cjs/input-range-slider/input-range-slider.styles_aljl2v.css +2 -2
- package/cjs/input-textarea/textarea-counter.styles_1n3wsnv.css +1 -1
- package/cjs/input-textarea/textarea.styles_22z4n3.css +2 -2
- package/cjs/language-switcher/dropdown-panel.styles_1qsjf8d.css +2 -2
- package/cjs/language-switcher/dropdown-variant.styles_1vrdfky.css +2 -2
- package/cjs/language-switcher/link-container-variant.styles_1iw6zux.css +2 -2
- package/cjs/layout/col-div.styles_16o6mwx.css +1 -1
- package/cjs/layout/container.styles_v70ec6.css +2 -2
- package/cjs/layout/section.styles_hstcaf.css +1 -1
- package/cjs/link-list/link-list.styles_m57vks.css +2 -2
- package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles_uhd4xl.css +2 -2
- package/cjs/local-nav/local-nav-menu/local-nav-menu.styles_pq19dh.css +2 -2
- package/cjs/markup/markup.style_1iu40x9.css +2 -2
- package/cjs/masked-input/masked-input.styles_1cm388a.css +2 -2
- package/cjs/masthead/masthead.styles_1huzon9.css +2 -2
- package/cjs/menu/menu-content.styles_p7ijll.css +2 -2
- package/cjs/menu/menu-item.styles_liyed8.css +2 -2
- package/cjs/menu/menu-link.styles_hfxoez.css +2 -2
- package/cjs/menu/menu-section.styles_g7my4d.css +2 -2
- package/cjs/modal/modal-box.styles_y52cts.css +2 -2
- package/cjs/modal/modal.styles_1lbblx6.css +2 -2
- package/cjs/modal-v2/modal-v2.styles_a8gv5i.css +2 -2
- package/cjs/modal-v2/slots/slot-styles_13sd376.css +2 -2
- package/cjs/navbar/brand.styles_zcgddp.css +1 -1
- package/cjs/navbar/drawer.js +1 -1
- package/cjs/navbar/drawer.js.map +1 -1
- package/cjs/navbar/drawer.styles_7hnxp5.css +2 -2
- package/cjs/navbar/menu.styles_gdpqc.css +2 -2
- package/cjs/navbar/navbar-action-buttons.styles_1vpm0nk.css +2 -2
- package/cjs/navbar/navbar-items.styles_1i3ltot.css +2 -2
- package/cjs/navbar/navbar.js +1 -1
- package/cjs/navbar/navbar.js.map +1 -1
- package/cjs/navbar/navbar.styles_koy0c7.css +2 -2
- package/cjs/notification-banner/notification-banner.styles_uxlysy.css +2 -2
- package/cjs/otp-input/otp-input.styles_5sbutl.css +2 -2
- package/cjs/otp-verification/contact-input-section.styles_odrjvt.css +2 -2
- package/cjs/otp-verification/otp-verification.styles_dg9bm8.css +1 -1
- package/cjs/otp-verification/thumbnail/thumbnail.styles_shqylh.css +2 -2
- package/cjs/otp-verification/verification-section.styles_x8jj.css +2 -2
- package/cjs/overlay/overlay.js +1 -1
- package/cjs/overlay/overlay.js.map +1 -1
- package/cjs/overlay/overlay.styles_12wym18.css +2 -2
- package/cjs/pagination/pagination.styles_6bcgva.css +2 -2
- package/cjs/pill/pill.styles_xwrniu.css +2 -2
- package/cjs/popover/popover-inline/popover-inline.styles_bkopnt.css +2 -2
- package/cjs/popover/popover-trigger.styles_8zokig.css +1 -1
- package/cjs/popover/popover.styles_ujnf0h.css +2 -2
- package/cjs/progress-indicator/progress-indicator.styles_1c038s4.css +2 -2
- package/cjs/radio-button/radio-button.styles_1c4v6v.css +2 -2
- package/cjs/schedule/schedule-day-view/schedule-day-view.styles_8ti149.css +2 -2
- package/cjs/schedule/schedule-header/schedule-header.js +1 -1
- package/cjs/schedule/schedule-header/schedule-header.js.map +1 -1
- package/cjs/schedule/schedule-header/schedule-header.styles_1n2u5vj.css +2 -2
- package/cjs/schedule/schedule-week-view/schedule-week-view.styles_x7x50m.css +2 -2
- package/cjs/schedule/schedule-week-view/time-cell.styles_1sorjz8.css +2 -2
- package/cjs/schedule/schedule.styles_fdy5a1.css +2 -2
- package/cjs/schedule/shared/with-optional-popover.styles_7mv3p2.css +1 -1
- package/cjs/schedule/time-indicator/time-indicator.styles_1eaxyes.css +2 -2
- package/cjs/select-histogram/select-histogram.styles_n260dy.css +2 -2
- package/cjs/shared/accessibility/index_13g9vp.css +1 -1
- package/cjs/shared/clickable-icon/clickable-icon.styles_1v2imml.css +2 -2
- package/cjs/shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css +2 -2
- package/cjs/shared/dropdown-list/dropdown-label.styles_mloii0.css +2 -2
- package/cjs/shared/dropdown-list/dropdown-list.styles_konwm.css +2 -2
- package/cjs/shared/dropdown-list/dropdown-search.styles_1hc1gkh.css +2 -2
- package/cjs/shared/dropdown-list/expandable-element.styles_rkkvqr.css +2 -2
- package/cjs/shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css +2 -2
- package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles_15hwwoj.css +2 -2
- package/cjs/shared/fade-wrapper/fade-wrapper.styles_16iug7l.css +2 -2
- package/cjs/shared/image-placeholder/image-placeholder.styles_44nwil.css +1 -1
- package/cjs/shared/input-wrapper/input-wrapper.styles_je6maw.css +2 -2
- package/cjs/shared/internal-calendar/calendar-dropdown.styles_wybjai.css +1 -1
- package/cjs/shared/internal-calendar/calendar-manager.js +1 -1
- package/cjs/shared/internal-calendar/calendar-manager.js.map +1 -1
- package/cjs/shared/internal-calendar/calendar-manager.styles.js +1 -1
- package/cjs/shared/internal-calendar/calendar-manager.styles.js.map +1 -1
- package/cjs/shared/internal-calendar/{calendar-manager.styles_1iuq5zw.css → calendar-manager.styles_1njwkj2.css} +3 -3
- package/cjs/shared/internal-calendar/day-cell/day-cell.styles_1t5oqc1.css +2 -2
- package/cjs/shared/internal-calendar/internal-calendar-month.styles_14oh57f.css +2 -2
- package/cjs/shared/internal-calendar/internal-calendar-year.styles_therlc.css +2 -2
- package/cjs/shared/internal-calendar/internal-calendar.styles_gnc3eq.css +1 -1
- package/cjs/shared/internal-calendar/standard/standard-calendar-day-view.styles_1bw26au.css +2 -2
- package/cjs/shared/progress-bar/progress-bar.styles_125ri7a.css +1 -1
- package/cjs/shared/range-input-inner-container/range-input-inner-container.styles_1v61utg.css +2 -2
- package/cjs/shared/standalone-date-input/standalone-date-input.styles_157qo89.css +2 -2
- package/cjs/shared/time-slot/time-slot.styles_18s0to7.css +2 -2
- package/cjs/shared/timepicker-dropdown/timepicker-dropdown.styles_119l6k6.css +2 -2
- package/cjs/sidenav/sidenav-drawer-item.styles_1ljnyx2.css +2 -2
- package/cjs/sidenav/sidenav-drawer-subitem.styles_2y58kf.css +1 -1
- package/cjs/sidenav/sidenav-group.styles_1x604sw.css +2 -2
- package/cjs/sidenav/sidenav-item.styles_lqw3kh.css +2 -2
- package/cjs/sidenav/sidenav.styles_1vxezie.css +2 -2
- package/cjs/singpass-button/singpass-button.styles_1miyex3.css +2 -2
- package/cjs/smart-app-banner/smart-app-banner.styles_15u6yv4.css +2 -2
- package/cjs/tab/tab-link-chain.styles_49got4.css +2 -2
- package/cjs/tab/tab.styles_1najffw.css +1 -1
- package/cjs/table/table.styles_1af5ipv.css +2 -2
- package/cjs/tag/tag.style_d98c53.css +2 -2
- package/cjs/text-list/text-list.styles_w3fvyt.css +2 -2
- package/cjs/theme/types.js +1 -1
- package/cjs/theme/types.js.map +1 -1
- package/cjs/theme/utils/use-design-token-override.js +2 -0
- package/cjs/theme/utils/use-design-token-override.js.map +1 -0
- package/cjs/time-range-picker/combobox-picker/combobox-picker.styles_7i9vso.css +1 -1
- package/cjs/time-range-picker/common.styles_1qwp4xa.css +2 -2
- package/cjs/time-slot-bar/time-slot-bar.styles_wigbyd.css +2 -2
- package/cjs/time-slot-bar-week/time-slot-bar-week-days.styles_evdvs9.css +2 -2
- package/cjs/time-slot-bar-week/time-slot-bar-week.styles_11ybf42.css +1 -1
- package/cjs/time-slot-week-view/time-slot-week-days.styles_1h21vyw.css +2 -2
- package/cjs/time-slot-week-view/time-slot-week-view.styles_gqgsw2.css +1 -1
- package/cjs/timeline/timeline.styles_1jxzik4.css +2 -2
- package/cjs/timepicker/timepicker.styles_1jm33yw.css +1 -1
- package/cjs/timetable/timetable-header/timetable-header.styles_11gl1h4.css +2 -2
- package/cjs/timetable/timetable-row/row-bar.styles_1x0vrsz.css +1 -1
- package/cjs/timetable/timetable-row/row-cell.styles_y1dl5j.css +2 -2
- package/cjs/timetable/timetable.styles_7rp8kz.css +2 -2
- package/cjs/toast/toast.styles_1e0l60w.css +2 -2
- package/cjs/toggle/toggle-icon.styles_ba71y.css +2 -2
- package/cjs/toggle/toggle.styles_1t5qrye.css +2 -2
- package/cjs/typography/typography-text.styles_1734x2k.css +2 -2
- package/cjs/typography/typography.styles.js +1 -1
- package/cjs/typography/typography.styles.js.map +1 -1
- package/cjs/typography/{typography.styles_1155j4c.css → typography.styles_1wd82dn.css} +2 -2
- package/cjs/uneditable-section/section-item.styles_mwx8ht.css +2 -2
- package/cjs/uneditable-section/uneditable-section.js +1 -1
- package/cjs/uneditable-section/uneditable-section.js.map +1 -1
- package/cjs/uneditable-section/uneditable-section.styles_aj9zun.css +2 -2
- package/cjs/unit-number/unit-number-input.styles_8yizj.css +2 -2
- package/countdown-timer/countdown-timer.d.ts +6 -0
- package/countdown-timer/countdown-timer.js.map +1 -1
- package/countdown-timer/countdown-timer.styles_ipn1b0.css +2 -2
- package/countdown-timer/types.d.ts +55 -11
- package/dashed-border/dashed-border.d.ts +6 -0
- package/dashed-border/dashed-border.js.map +1 -1
- package/dashed-border/dashed-border.styles_zszoox.css +2 -2
- package/dashed-border/types.d.ts +27 -5
- package/data-table/data-table.d.ts +8 -0
- package/data-table/data-table.js.map +1 -1
- package/data-table/data-table.styles_1iqq1g7.css +2 -2
- package/data-table/types.d.ts +58 -12
- package/date-input/date-input.d.ts +5 -0
- package/date-input/date-input.js.map +1 -1
- package/date-input/date-input.styles_1r5kcc7.css +1 -1
- package/date-input/types.d.ts +32 -16
- package/date-navigator/date-navigator.d.ts +6 -0
- package/date-navigator/date-navigator.js.map +1 -1
- package/date-navigator/date-navigator.styles_wokh56.css +2 -2
- package/date-navigator/types.d.ts +44 -7
- package/date-range-input/date-range-input.d.ts +4 -0
- package/date-range-input/date-range-input.js.map +1 -1
- package/date-range-input/date-range-input.styles_1s7ojnj.css +2 -2
- package/date-range-input/types.d.ts +50 -14
- package/divider/divider.d.ts +6 -0
- package/divider/divider.js.map +1 -1
- package/divider/divider.styles_1xpzh8p.css +2 -2
- package/divider/types.d.ts +27 -4
- package/drawer/drawer.d.ts +7 -0
- package/drawer/drawer.js.map +1 -1
- package/drawer/drawer.styles_94hx3y.css +2 -2
- package/drawer/types.d.ts +16 -4
- package/e-signature/e-signature-canvas.js +1 -1
- package/e-signature/e-signature-canvas.js.map +1 -1
- package/e-signature/e-signature.d.ts +5 -0
- package/e-signature/e-signature.js.map +1 -1
- package/e-signature/e-signature.styles_lukd9f.css +2 -2
- package/e-signature/types.d.ts +23 -1
- package/error-display/error-display.d.ts +7 -0
- package/error-display/error-display.js.map +1 -1
- package/error-display/error-display.styles_d3tql1.css +2 -2
- package/error-display/types.d.ts +36 -6
- package/external/dompurify/dist/purify.es.js +2 -2
- package/external/dompurify/dist/purify.es.js.map +1 -1
- package/feedback-rating/feedback-rating-stars-container.styles_dmi8z9.css +2 -2
- package/feedback-rating/feedback-rating.d.ts +6 -0
- package/feedback-rating/feedback-rating.js.map +1 -1
- package/feedback-rating/feedback-rating.styles_1kdklb6.css +2 -2
- package/feedback-rating/types.d.ts +29 -0
- package/file-download/file-download.d.ts +6 -0
- package/file-download/file-download.js.map +1 -1
- package/file-download/file-download.styles_iggk8q.css +2 -2
- package/file-download/file-list-card/file-list-card.styles.js +1 -1
- package/file-download/file-list-card/file-list-card.styles.js.map +1 -1
- package/file-download/file-list-card/{file-list-card.styles_oom8ii.css → file-list-card.styles_18j2gut.css} +3 -3
- package/file-download/types.d.ts +44 -11
- package/file-upload/dropzone.styles_1pllsau.css +2 -2
- package/file-upload/file-item-edit.d.ts +4 -1
- package/file-upload/file-item-edit.js +1 -1
- package/file-upload/file-item-edit.js.map +1 -1
- package/file-upload/file-item-edit.styles.d.ts +1 -0
- package/file-upload/file-item-edit.styles.js +1 -1
- package/file-upload/file-item-edit.styles.js.map +1 -1
- package/file-upload/{file-item-edit.styles_1qbpbxj.css → file-item-edit.styles_19bvztn.css} +6 -5
- package/file-upload/file-list/file-list.d.ts +3 -0
- package/file-upload/file-list/file-list.js +1 -1
- package/file-upload/file-list/file-list.js.map +1 -1
- package/file-upload/file-list/file-list.styles.js +1 -1
- package/file-upload/file-list/file-list.styles.js.map +1 -1
- package/file-upload/file-list/file-list.styles_1w7so98.css +3 -0
- package/file-upload/file-list-item/file-list-item-thumbnail.styles_1y4si19.css +2 -2
- package/file-upload/file-list-item/file-list-item.d.ts +3 -1
- package/file-upload/file-list-item/file-list-item.js +1 -1
- package/file-upload/file-list-item/file-list-item.js.map +1 -1
- package/file-upload/file-list-item/file-list-item.styles.d.ts +3 -0
- package/file-upload/file-list-item/file-list-item.styles.js +1 -1
- package/file-upload/file-list-item/file-list-item.styles.js.map +1 -1
- package/file-upload/file-list-item/file-list-item.styles_o8000f.css +17 -0
- package/file-upload/file-upload.d.ts +2 -1
- package/file-upload/file-upload.js +1 -1
- package/file-upload/file-upload.js.map +1 -1
- package/file-upload/file-upload.styles_9ffwcd.css +2 -2
- package/file-upload/types.d.ts +125 -20
- package/filter/addons/filter-item-checkbox.styles_7degw7.css +2 -2
- package/filter/filter-item-page.styles_17ewfrz.css +1 -1
- package/filter/filter-item.js.map +1 -1
- package/filter/filter-item.styles_cphjnj.css +2 -2
- package/filter/filter-modal.styles_qw3xlg.css +2 -2
- package/filter/filter-sidebar.styles_1otwpjl.css +2 -2
- package/filter/filter.d.ts +21 -0
- package/filter/filter.js.map +1 -1
- package/filter/filter.styles_1ykijwm.css +2 -2
- package/filter/types.d.ts +161 -21
- package/footer/footer-download-app.styles_1v1j2us.css +2 -2
- package/footer/footer-resource-addon.styles_1jepb1d.css +2 -2
- package/footer/footer.d.ts +8 -1
- package/footer/footer.js +1 -1
- package/footer/footer.js.map +1 -1
- package/footer/footer.styles_1msorhc.css +2 -2
- package/footer/types.d.ts +55 -4
- package/form/form-label-addon.styles_b00z8p.css +1 -1
- package/form/form-label.styles.js +1 -1
- package/form/form-label.styles.js.map +1 -1
- package/form/{form-label.styles_11r0652.css → form-label.styles_1nbe0bm.css} +2 -2
- package/form/form-textarea.styles_3p9qoy.css +2 -2
- package/form/form-wrapper.styles_199rslu.css +1 -1
- package/fullscreen-image-carousel/fullscreen-image-carousel.styles_vc6y5c.css +2 -2
- package/fullscreen-image-carousel/stateful-image.styles_1xe8ypm.css +2 -2
- package/histogram-slider/histogram-slider.styles_wvd4w.css +2 -2
- package/image-button/image-button.styles_6n1qsr.css +2 -2
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/input/input.styles_1cblor0.css +2 -2
- package/input-group/input-group-list-addon.styles_17iuqtw.css +2 -2
- package/input-group/input-group.styles_bqye6f.css +2 -2
- package/input-range-select/input-range-select.styles_adbrbm.css +2 -2
- package/input-range-slider/input-range-slider.styles_aljl2v.css +2 -2
- package/input-textarea/textarea-counter.styles_1n3wsnv.css +1 -1
- package/input-textarea/textarea.styles_22z4n3.css +2 -2
- package/language-switcher/dropdown-panel.styles_1qsjf8d.css +2 -2
- package/language-switcher/dropdown-variant.styles_1vrdfky.css +2 -2
- package/language-switcher/link-container-variant.styles_1iw6zux.css +2 -2
- package/layout/col-div.styles_16o6mwx.css +1 -1
- package/layout/container.styles_v70ec6.css +2 -2
- package/layout/section.styles_hstcaf.css +1 -1
- package/link-list/link-list.styles_m57vks.css +2 -2
- package/local-nav/local-nav-dropdown/local-nav-dropdown.styles_uhd4xl.css +2 -2
- package/local-nav/local-nav-menu/local-nav-menu.styles_pq19dh.css +2 -2
- package/markup/markup.style_1iu40x9.css +2 -2
- package/masked-input/masked-input.styles_1cm388a.css +2 -2
- package/masthead/masthead.styles_1huzon9.css +2 -2
- package/menu/menu-content.styles_p7ijll.css +2 -2
- package/menu/menu-item.styles_liyed8.css +2 -2
- package/menu/menu-link.styles_hfxoez.css +2 -2
- package/menu/menu-section.styles_g7my4d.css +2 -2
- package/modal/modal-box.styles_y52cts.css +2 -2
- package/modal/modal.styles_1lbblx6.css +2 -2
- package/modal-v2/modal-v2.styles_a8gv5i.css +2 -2
- package/modal-v2/slots/slot-styles_13sd376.css +2 -2
- package/navbar/brand.styles_zcgddp.css +1 -1
- package/navbar/drawer.js +1 -1
- package/navbar/drawer.js.map +1 -1
- package/navbar/drawer.styles_7hnxp5.css +2 -2
- package/navbar/menu.styles_gdpqc.css +2 -2
- package/navbar/navbar-action-buttons.styles_1vpm0nk.css +2 -2
- package/navbar/navbar-items.styles_1i3ltot.css +2 -2
- package/navbar/navbar.js +1 -1
- package/navbar/navbar.js.map +1 -1
- package/navbar/navbar.styles_koy0c7.css +2 -2
- package/notification-banner/notification-banner.styles_uxlysy.css +2 -2
- package/otp-input/otp-input.styles_5sbutl.css +2 -2
- package/otp-verification/contact-input-section.styles_odrjvt.css +2 -2
- package/otp-verification/otp-verification.styles_dg9bm8.css +1 -1
- package/otp-verification/thumbnail/thumbnail.styles_shqylh.css +2 -2
- package/otp-verification/verification-section.styles_x8jj.css +2 -2
- package/overlay/overlay.js +1 -1
- package/overlay/overlay.js.map +1 -1
- package/overlay/overlay.styles_12wym18.css +2 -2
- package/overlay/types.d.ts +0 -13
- package/package.json +1 -7
- package/pagination/pagination.styles_6bcgva.css +2 -2
- package/pill/pill.styles_xwrniu.css +2 -2
- package/popover/popover-inline/popover-inline.styles_bkopnt.css +2 -2
- package/popover/popover-trigger.styles_8zokig.css +1 -1
- package/popover/popover.styles_ujnf0h.css +2 -2
- package/progress-indicator/progress-indicator.styles_1c038s4.css +2 -2
- package/radio-button/radio-button.styles_1c4v6v.css +2 -2
- package/schedule/schedule-day-view/schedule-day-view.styles_8ti149.css +2 -2
- package/schedule/schedule-header/schedule-header.js +1 -1
- package/schedule/schedule-header/schedule-header.js.map +1 -1
- package/schedule/schedule-header/schedule-header.styles_1n2u5vj.css +2 -2
- package/schedule/schedule-week-view/schedule-week-view.styles_x7x50m.css +2 -2
- package/schedule/schedule-week-view/time-cell.styles_1sorjz8.css +2 -2
- package/schedule/schedule.styles_fdy5a1.css +2 -2
- package/schedule/shared/with-optional-popover.styles_7mv3p2.css +1 -1
- package/schedule/time-indicator/time-indicator.styles_1eaxyes.css +2 -2
- package/select-histogram/select-histogram.styles_n260dy.css +2 -2
- package/shared/accessibility/index_13g9vp.css +1 -1
- package/shared/clickable-icon/clickable-icon.styles_1v2imml.css +2 -2
- package/shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css +2 -2
- package/shared/dropdown-list/dropdown-label.styles_mloii0.css +2 -2
- package/shared/dropdown-list/dropdown-list.styles_konwm.css +2 -2
- package/shared/dropdown-list/dropdown-search.styles_1hc1gkh.css +2 -2
- package/shared/dropdown-list/expandable-element.styles_rkkvqr.css +2 -2
- package/shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css +2 -2
- package/shared/dropdown-wrapper/dropdown-wrapper.styles_15hwwoj.css +2 -2
- package/shared/fade-wrapper/fade-wrapper.styles_16iug7l.css +2 -2
- package/shared/image-placeholder/image-placeholder.styles_44nwil.css +1 -1
- package/shared/input-wrapper/input-wrapper.styles_je6maw.css +2 -2
- package/shared/internal-calendar/calendar-dropdown.styles_wybjai.css +1 -1
- package/shared/internal-calendar/calendar-manager.js +1 -1
- package/shared/internal-calendar/calendar-manager.js.map +1 -1
- package/shared/internal-calendar/calendar-manager.styles.js +1 -1
- package/shared/internal-calendar/calendar-manager.styles.js.map +1 -1
- package/shared/internal-calendar/{calendar-manager.styles_1iuq5zw.css → calendar-manager.styles_1njwkj2.css} +3 -3
- package/shared/internal-calendar/day-cell/day-cell.styles_1t5oqc1.css +2 -2
- package/shared/internal-calendar/internal-calendar-month.styles_14oh57f.css +2 -2
- package/shared/internal-calendar/internal-calendar-year.styles_therlc.css +2 -2
- package/shared/internal-calendar/internal-calendar.styles_gnc3eq.css +1 -1
- package/shared/internal-calendar/standard/standard-calendar-day-view.styles_1bw26au.css +2 -2
- package/shared/progress-bar/progress-bar.styles_125ri7a.css +1 -1
- package/shared/range-input-inner-container/range-input-inner-container.styles_1v61utg.css +2 -2
- package/shared/standalone-date-input/standalone-date-input.styles_157qo89.css +2 -2
- package/shared/time-slot/time-slot.styles_18s0to7.css +2 -2
- package/shared/timepicker-dropdown/timepicker-dropdown.styles_119l6k6.css +2 -2
- package/sidenav/sidenav-drawer-item.styles_1ljnyx2.css +2 -2
- package/sidenav/sidenav-drawer-subitem.styles_2y58kf.css +1 -1
- package/sidenav/sidenav-group.styles_1x604sw.css +2 -2
- package/sidenav/sidenav-item.styles_lqw3kh.css +2 -2
- package/sidenav/sidenav.styles_1vxezie.css +2 -2
- package/singpass-button/singpass-button.styles_1miyex3.css +2 -2
- package/smart-app-banner/smart-app-banner.styles_15u6yv4.css +2 -2
- package/tab/tab-link-chain.styles_49got4.css +2 -2
- package/tab/tab.styles_1najffw.css +1 -1
- package/table/table.styles_1af5ipv.css +2 -2
- package/tag/tag.style_d98c53.css +2 -2
- package/text-list/text-list.styles_w3fvyt.css +2 -2
- package/theme/styles/a11y-playground.css +3 -0
- package/theme/styles/bookingsg.css +7 -4
- package/theme/styles/careercompass.css +4 -1
- package/theme/styles/ccube.css +3 -0
- package/theme/styles/default.css +9 -5
- package/theme/styles/imda.css +3 -0
- package/theme/styles/lifesg.css +3 -0
- package/theme/styles/mylegacy.css +7 -4
- package/theme/styles/oneservice.css +52 -0
- package/theme/styles/pa.css +3 -0
- package/theme/styles/rbs.css +3 -0
- package/theme/styles/sgw-digital-lobby.css +5 -2
- package/theme/styles/smgs.css +3 -0
- package/theme/styles/spf.css +3 -0
- package/theme/styles/supportgowhere.css +3 -0
- package/theme/types.d.ts +1 -1
- package/theme/types.js +1 -1
- package/theme/types.js.map +1 -1
- package/theme/utils/index.d.ts +1 -0
- package/theme/utils/use-design-token-override.d.ts +11 -0
- package/theme/utils/use-design-token-override.js +2 -0
- package/theme/utils/use-design-token-override.js.map +1 -0
- package/time-range-picker/combobox-picker/combobox-picker.styles_7i9vso.css +1 -1
- package/time-range-picker/common.styles_1qwp4xa.css +2 -2
- package/time-slot-bar/time-slot-bar.styles_wigbyd.css +2 -2
- package/time-slot-bar-week/time-slot-bar-week-days.styles_evdvs9.css +2 -2
- package/time-slot-bar-week/time-slot-bar-week.styles_11ybf42.css +1 -1
- package/time-slot-week-view/time-slot-week-days.styles_1h21vyw.css +2 -2
- package/time-slot-week-view/time-slot-week-view.styles_gqgsw2.css +1 -1
- package/timeline/timeline.styles_1jxzik4.css +2 -2
- package/timepicker/timepicker.styles_1jm33yw.css +1 -1
- package/timetable/timetable-header/timetable-header.styles_11gl1h4.css +2 -2
- package/timetable/timetable-row/row-bar.styles_1x0vrsz.css +1 -1
- package/timetable/timetable-row/row-cell.styles_y1dl5j.css +2 -2
- package/timetable/timetable.styles_7rp8kz.css +2 -2
- package/toast/toast.styles_1e0l60w.css +2 -2
- package/toggle/toggle-icon.styles_ba71y.css +2 -2
- package/toggle/toggle.styles_1t5qrye.css +2 -2
- package/typography/typography-text.styles_1734x2k.css +2 -2
- package/typography/typography.styles.js +1 -1
- package/typography/typography.styles.js.map +1 -1
- package/typography/{typography.styles_1155j4c.css → typography.styles_1wd82dn.css} +2 -2
- package/uneditable-section/index.d.ts +1 -1
- package/uneditable-section/section-item.styles_mwx8ht.css +2 -2
- package/uneditable-section/uneditable-section.d.ts +2 -1
- package/uneditable-section/uneditable-section.js +1 -1
- package/uneditable-section/uneditable-section.js.map +1 -1
- package/uneditable-section/uneditable-section.styles_aj9zun.css +2 -2
- package/unit-number/unit-number-input.styles_8yizj.css +2 -2
- package/cjs/example/example.js +0 -2
- package/cjs/example/example.js.map +0 -1
- package/cjs/example/example_r47nvz.css +0 -1
- package/cjs/example/index.js +0 -2
- package/cjs/example/index.js.map +0 -1
- package/cjs/file-upload/file-list/file-list.styles_1ea12kj.css +0 -3
- package/cjs/file-upload/file-list-item/file-list-item.styles_y7my2m.css +0 -14
- package/example/example.d.ts +0 -2
- package/example/example.js +0 -2
- package/example/example.js.map +0 -1
- package/example/example_r47nvz.css +0 -1
- package/example/index.d.ts +0 -1
- package/example/index.js +0 -2
- package/example/index.js.map +0 -1
- package/example/types.d.ts +0 -3
- package/file-upload/file-list/file-list.styles_1ea12kj.css +0 -3
- package/file-upload/file-list-item/file-list-item.styles_y7my2m.css +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.sk1h6mz{width:2.75rem;height:2.75rem;color:var(--fds-colour-icon-primary);}
|
|
1
|
+
@layer fds{.sk1h6mz{width:2.75rem;height:2.75rem;color:var(--fds-colour-icon-primary);}
|
|
2
2
|
.lg72zyg{margin:0 var(--fds-spacing-8);line-height:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;}
|
|
3
3
|
.c1w9ub4z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;margin:var(--fds-spacing-8) var(--fds-spacing-16);border-radius:var(--fds-radius-sm);outline:none;}
|
|
4
|
-
.chyiool{outline:var(--fds-border-width-020) var(--fds-border-style-solid) var(--fds-colour-icon-primary);outline-offset:2px;}
|
|
4
|
+
.chyiool{outline:var(--fds-border-width-020) var(--fds-border-style-solid) var(--fds-colour-icon-primary);outline-offset:2px;}}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import type { FeedbackRatingProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* A star-rating widget for collecting user feedback.
|
|
4
|
+
*
|
|
5
|
+
* Use `FeedbackRating` to prompt users for a 1–5 star rating.
|
|
6
|
+
* The submit button remains disabled until a star is selected.
|
|
7
|
+
*/
|
|
2
8
|
export declare const FeedbackRating: (props: FeedbackRatingProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback-rating.js","sources":["../../src/feedback-rating/feedback-rating.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { Button } from \"../button\";\nimport { VisuallyHidden } from \"../shared/accessibility\";\nimport { Typography } from \"../typography\";\nimport { useId } from \"../util\";\nimport * as styles from \"./feedback-rating.styles\";\nimport { FeedbackRatingData } from \"./feedback-rating-data\";\nimport { FeedbackRatingStarsContainer } from \"./feedback-rating-stars-container\";\nimport type { FeedbackRatingProps } from \"./types\";\n\nexport const FeedbackRating = (props: FeedbackRatingProps): JSX.Element => {\n // =========================================================================\n // CONST, STATE, REF\n // =========================================================================\n const {\n imgSrc,\n buttonLabel,\n description,\n rating,\n onRatingChange,\n onSubmit,\n className,\n id,\n \"data-testid\": testId,\n ...otherProps\n } = props;\n const [hasImageError, setHasImageError] = useState(false);\n const imgRef = useRef<HTMLImageElement>(null);\n const internalId = useId();\n const descriptionId = `${internalId}-description`;\n const bannerSrc = imgSrc ?? FeedbackRatingData.IMG;\n const componentDescription =\n description ?? FeedbackRatingData.DEFAULT_DESCRIPTION;\n const resolvedButtonLabel =\n buttonLabel ?? FeedbackRatingData.DEFAULT_BUTTON_LABEL;\n const isSubmitDisabled = !rating;\n\n useEffect(() => {\n setHasImageError(false);\n\n if (imgRef.current?.complete && imgRef.current.naturalWidth === 0) {\n setHasImageError(true);\n }\n }, [bannerSrc]);\n\n const handleImgError = () => {\n setHasImageError(true);\n };\n\n return (\n <div\n role=\"group\"\n aria-labelledby={internalId}\n className={clsx(styles.mainContainer, className)}\n id={id}\n data-testid={testId}\n {...otherProps}\n >\n {bannerSrc && !hasImageError && (\n <img\n ref={imgRef}\n className={styles.image}\n data-testid=\"feedback-banner-image\"\n src={bannerSrc}\n alt=\"\"\n onError={handleImgError}\n />\n )}\n <div className={styles.childContainer}>\n <Typography.HeadingSM as=\"h2\" id={internalId} weight=\"semibold\">\n {componentDescription}\n </Typography.HeadingSM>\n <FeedbackRatingStarsContainer\n ariaLabelledBy={internalId}\n ariaDescribedBy={descriptionId}\n rating={rating}\n onRatingChange={onRatingChange}\n />\n <VisuallyHidden id={descriptionId}>\n Minimum, 1 star. Maximum, 5 stars.\n </VisuallyHidden>\n <Button\n className={styles.submitButton}\n disabled={isSubmitDisabled}\n focusableWhenDisabled\n onClick={onSubmit}\n type=\"button\"\n >\n {resolvedButtonLabel}\n </Button>\n </div>\n </div>\n );\n};\n"],"names":["FeedbackRating","props","imgSrc","buttonLabel","description","rating","onRatingChange","onSubmit","className","id","testId","otherProps","__rest","hasImageError","setHasImageError","useState","imgRef","useRef","internalId","useId","descriptionId","bannerSrc","FeedbackRatingData","IMG","componentDescription","DEFAULT_DESCRIPTION","resolvedButtonLabel","DEFAULT_BUTTON_LABEL","isSubmitDisabled","useEffect","_a","current","complete","naturalWidth","_jsxs","Object","assign","role","clsx","styles.mainContainer","children","_jsx","ref","styles.image","src","alt","onError","styles.childContainer","Typography","HeadingSM","as","weight","FeedbackRatingStarsContainer","ariaLabelledBy","ariaDescribedBy","VisuallyHidden","Button","styles.submitButton","disabled","focusableWhenDisabled","onClick","type"],"mappings":"
|
|
1
|
+
{"version":3,"file":"feedback-rating.js","sources":["../../src/feedback-rating/feedback-rating.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { Button } from \"../button\";\nimport { VisuallyHidden } from \"../shared/accessibility\";\nimport { Typography } from \"../typography\";\nimport { useId } from \"../util\";\nimport * as styles from \"./feedback-rating.styles\";\nimport { FeedbackRatingData } from \"./feedback-rating-data\";\nimport { FeedbackRatingStarsContainer } from \"./feedback-rating-stars-container\";\nimport type { FeedbackRatingProps } from \"./types\";\n\n/**\n * A star-rating widget for collecting user feedback.\n *\n * Use `FeedbackRating` to prompt users for a 1–5 star rating.\n * The submit button remains disabled until a star is selected.\n */\nexport const FeedbackRating = (props: FeedbackRatingProps): JSX.Element => {\n // =========================================================================\n // CONST, STATE, REF\n // =========================================================================\n const {\n imgSrc,\n buttonLabel,\n description,\n rating,\n onRatingChange,\n onSubmit,\n className,\n id,\n \"data-testid\": testId,\n ...otherProps\n } = props;\n const [hasImageError, setHasImageError] = useState(false);\n const imgRef = useRef<HTMLImageElement>(null);\n const internalId = useId();\n const descriptionId = `${internalId}-description`;\n const bannerSrc = imgSrc ?? FeedbackRatingData.IMG;\n const componentDescription =\n description ?? FeedbackRatingData.DEFAULT_DESCRIPTION;\n const resolvedButtonLabel =\n buttonLabel ?? FeedbackRatingData.DEFAULT_BUTTON_LABEL;\n const isSubmitDisabled = !rating;\n\n useEffect(() => {\n setHasImageError(false);\n\n if (imgRef.current?.complete && imgRef.current.naturalWidth === 0) {\n setHasImageError(true);\n }\n }, [bannerSrc]);\n\n const handleImgError = () => {\n setHasImageError(true);\n };\n\n return (\n <div\n role=\"group\"\n aria-labelledby={internalId}\n className={clsx(styles.mainContainer, className)}\n id={id}\n data-testid={testId}\n {...otherProps}\n >\n {bannerSrc && !hasImageError && (\n <img\n ref={imgRef}\n className={styles.image}\n data-testid=\"feedback-banner-image\"\n src={bannerSrc}\n alt=\"\"\n onError={handleImgError}\n />\n )}\n <div className={styles.childContainer}>\n <Typography.HeadingSM as=\"h2\" id={internalId} weight=\"semibold\">\n {componentDescription}\n </Typography.HeadingSM>\n <FeedbackRatingStarsContainer\n ariaLabelledBy={internalId}\n ariaDescribedBy={descriptionId}\n rating={rating}\n onRatingChange={onRatingChange}\n />\n <VisuallyHidden id={descriptionId}>\n Minimum, 1 star. Maximum, 5 stars.\n </VisuallyHidden>\n <Button\n className={styles.submitButton}\n disabled={isSubmitDisabled}\n focusableWhenDisabled\n onClick={onSubmit}\n type=\"button\"\n >\n {resolvedButtonLabel}\n </Button>\n </div>\n </div>\n );\n};\n"],"names":["FeedbackRating","props","imgSrc","buttonLabel","description","rating","onRatingChange","onSubmit","className","id","testId","otherProps","__rest","hasImageError","setHasImageError","useState","imgRef","useRef","internalId","useId","descriptionId","bannerSrc","FeedbackRatingData","IMG","componentDescription","DEFAULT_DESCRIPTION","resolvedButtonLabel","DEFAULT_BUTTON_LABEL","isSubmitDisabled","useEffect","_a","current","complete","naturalWidth","_jsxs","Object","assign","role","clsx","styles.mainContainer","children","_jsx","ref","styles.image","src","alt","onError","styles.childContainer","Typography","HeadingSM","as","weight","FeedbackRatingStarsContainer","ariaLabelledBy","ariaDescribedBy","VisuallyHidden","Button","styles.submitButton","disabled","focusableWhenDisabled","onClick","type"],"mappings":"yxBAkBO,MAAMA,EAAkBC,IAI3B,MAAMC,OACFA,EAAMC,YACNA,EAAWC,YACXA,EAAWC,OACXA,EAAMC,eACNA,EAAcC,SACdA,EAAQC,UACRA,EAASC,GACTA,EACA,cAAeC,GAEfT,EADGU,EAAUC,EACbX,EAXE,CAAA,SAAA,cAAA,cAAA,SAAA,iBAAA,WAAA,YAAA,KAAA,iBAYCY,EAAeC,GAAoBC,GAAS,GAC7CC,EAASC,EAAyB,MAClCC,EAAaC,IACbC,EAAgB,GAAGF,gBACnBG,EAAYnB,QAAAA,EAAUoB,EAAmBC,IACzCC,EACFpB,QAAAA,EAAekB,EAAmBG,oBAChCC,EACFvB,QAAAA,EAAemB,EAAmBK,qBAChCC,GAAoBvB,EAE1BwB,GAAU,WACNf,GAAiB,YAEbgB,EAAAd,EAAOe,8BAASC,WAA4C,IAAhChB,EAAOe,QAAQE,cAC3CnB,GAAiB,EACrB,GACD,CAACO,IAMJ,OACIa,EAAA,MAAAC,OAAAC,OAAA,CACIC,KAAK,QAAO,kBACKnB,EACjBV,UAAW8B,EAAKC,EAAsB/B,GACtCC,GAAIA,gBACSC,GACTC,EAAU,CAAA6B,SAAA,CAEbnB,IAAcR,GACX4B,EAAA,MAAA,CACIC,IAAK1B,EACLR,UAAWmC,EAAY,cACX,wBACZC,IAAKvB,EACLwB,IAAI,GACJC,QApBO,KACnBhC,GAAiB,EAAK,IAsBlBoB,EAAA,MAAA,CAAK1B,UAAWuC,EAAqBP,SAAA,CACjCC,EAACO,EAAWC,UAAS,CAACC,GAAG,KAAKzC,GAAIS,EAAYiC,OAAO,WAAUX,SAC1DhB,IAELiB,EAACW,EAA4B,CACzBC,eAAgBnC,EAChBoC,gBAAiBlC,EACjBf,OAAQA,EACRC,eAAgBA,IAEpBmC,EAACc,EAAc,CAAC9C,GAAIW,EAAaoB,SAAA,uCAGjCC,EAACe,EAAM,CACHhD,UAAWiD,EACXC,SAAU9B,EACV+B,uBAAqB,EACrBC,QAASrD,EACTsD,KAAK,kBAEJnC,UAGP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.i1kvxt6e{width:9.5rem;height:9.5rem;margin:0 1rem;}:where(body.fds-breakpoint-md-max) .i1kvxt6e{width:5.5rem;height:5.5rem;margin:0;}
|
|
1
|
+
@layer fds{.i1kvxt6e{width:9.5rem;height:9.5rem;margin:0 1rem;}:where(body.fds-breakpoint-md-max) .i1kvxt6e{width:5.5rem;height:5.5rem;margin:0;}
|
|
2
2
|
.m12gz8bh{border-top:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);border-bottom:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;padding:1rem 3rem;}:where(body.fds-breakpoint-md-max) .m12gz8bh{padding:2rem 0 1rem;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
3
3
|
.c2of6av{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:1rem 1rem;width:100%;text-align:center;}:where(body.fds-breakpoint-md-max) .c2of6av{margin:1rem 1.25rem;max-width:calc(100% - 2.5rem);}
|
|
4
|
-
.sopm87z{margin-top:1rem;width:100%;}
|
|
4
|
+
.sopm87z{margin-top:1rem;width:100%;}}
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the `FeedbackRating` component.
|
|
3
|
+
*/
|
|
1
4
|
export interface FeedbackRatingProps {
|
|
5
|
+
/**
|
|
6
|
+
* URL of the banner image displayed above the star rating.
|
|
7
|
+
* Falls back to the default Life SG feedback banner when omitted.
|
|
8
|
+
* Hidden automatically if the image fails to load.
|
|
9
|
+
*/
|
|
2
10
|
imgSrc?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Heading text displayed above the star rating.
|
|
13
|
+
*
|
|
14
|
+
* @default "Rate your experience"
|
|
15
|
+
*/
|
|
3
16
|
description?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Label for the submit button.
|
|
19
|
+
*
|
|
20
|
+
* @default "Submit"
|
|
21
|
+
*/
|
|
4
22
|
buttonLabel?: string | undefined;
|
|
5
23
|
className?: string | undefined;
|
|
6
24
|
id?: string | undefined;
|
|
7
25
|
"data-testid"?: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The currently selected star rating (1–5).
|
|
28
|
+
*/
|
|
8
29
|
rating: number;
|
|
30
|
+
/**
|
|
31
|
+
* Called when the user selects a star.
|
|
32
|
+
*
|
|
33
|
+
* @param value The new rating value (1–5).
|
|
34
|
+
*/
|
|
9
35
|
onRatingChange: (value: number) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Called when the user clicks the submit button.
|
|
38
|
+
*/
|
|
10
39
|
onSubmit: () => void;
|
|
11
40
|
}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import type { FileDownloadProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Displays a list of downloadable files, optionally grouped under a title and description.
|
|
4
|
+
*
|
|
5
|
+
* Use `FileDownload` to present one or more files that users can download individually.
|
|
6
|
+
* Each file item renders as a card with file metadata and a download trigger.
|
|
7
|
+
*/
|
|
2
8
|
export declare const FileDownload: ({ id, fileItems, title, description, onDownload, "data-testid": testId, className, styleType, }: FileDownloadProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-download.js","sources":["../../src/file-download/file-download.tsx"],"sourcesContent":["import clsx from \"clsx\";\n\nimport { DashedBorder } from \"../dashed-border\";\nimport { Markup } from \"../markup\";\nimport { Border, Colour, Radius } from \"../theme\";\nimport * as styles from \"./file-download.styles\";\nimport { FileListCard } from \"./file-list-card\";\nimport type { FileDownloadProps, FileItemDownloadProps } from \"./types\";\n\nexport const FileDownload = ({\n id,\n fileItems,\n title,\n description,\n onDownload,\n \"data-testid\": testId,\n className,\n styleType = \"bordered\",\n}: FileDownloadProps) => {\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleDownloadItem = async (item: FileItemDownloadProps) => {\n if (onDownload) {\n await onDownload(item);\n }\n };\n\n // =========================================================================\n // RENDER FUNCTIONS\n // =========================================================================\n const renderTitle = () => {\n if (!title) {\n return null;\n }\n\n if (typeof title === \"string\") {\n return <p className={styles.title}>{title}</p>;\n }\n\n return (\n <Markup className={styles.titleContainer} baseTextSize=\"heading-xs\">\n {title}\n </Markup>\n );\n };\n\n const renderDescription = () => {\n if (!description) {\n return null;\n }\n\n if (typeof description === \"string\") {\n return <p className={styles.description}>{description}</p>;\n }\n\n return (\n <Markup\n className={styles.descriptionContainer}\n baseTextSize=\"body-md\"\n >\n {description}\n </Markup>\n );\n };\n\n const isBordered = styleType === \"bordered\";\n\n return (\n <DashedBorder\n id={id ? `${id}-file-download` : \"file-download\"}\n className={clsx(\n styles.container,\n isBordered && styles.containerBordered,\n className\n )}\n data-testid={testId}\n enabled={isBordered}\n thickness={Border[\"width-040\"]}\n radius={Radius[\"sm\"]}\n colour={Colour[\"border\"]}\n >\n {(title || description) && (\n <div className={styles.textContainer}>\n {renderTitle()}\n {renderDescription()}\n </div>\n )}\n <ul className={styles.listWrapper}>\n {fileItems &&\n fileItems.length > 0 &&\n fileItems.map((item) => (\n <FileListCard\n key={item.id}\n fileItem={item}\n onDownload={handleDownloadItem}\n />\n ))}\n </ul>\n </DashedBorder>\n );\n};\n"],"names":["FileDownload","id","fileItems","title","description","onDownload","testId","className","styleType","handleDownloadItem","item","__awaiter","isBordered","_jsxs","DashedBorder","clsx","styles.container","styles.containerBordered","enabled","thickness","Border","radius","Radius","colour","Colour","children","styles.textContainer","_jsx","styles.title","Markup","styles.titleContainer","baseTextSize","styles.description","styles.descriptionContainer","styles.listWrapper","length","map","FileListCard","fileItem"],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-download.js","sources":["../../src/file-download/file-download.tsx"],"sourcesContent":["import clsx from \"clsx\";\n\nimport { DashedBorder } from \"../dashed-border\";\nimport { Markup } from \"../markup\";\nimport { Border, Colour, Radius } from \"../theme\";\nimport * as styles from \"./file-download.styles\";\nimport { FileListCard } from \"./file-list-card\";\nimport type { FileDownloadProps, FileItemDownloadProps } from \"./types\";\n\n/**\n * Displays a list of downloadable files, optionally grouped under a title and description.\n *\n * Use `FileDownload` to present one or more files that users can download individually.\n * Each file item renders as a card with file metadata and a download trigger.\n */\nexport const FileDownload = ({\n id,\n fileItems,\n title,\n description,\n onDownload,\n \"data-testid\": testId,\n className,\n styleType = \"bordered\",\n}: FileDownloadProps) => {\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleDownloadItem = async (item: FileItemDownloadProps) => {\n if (onDownload) {\n await onDownload(item);\n }\n };\n\n // =========================================================================\n // RENDER FUNCTIONS\n // =========================================================================\n const renderTitle = () => {\n if (!title) {\n return null;\n }\n\n if (typeof title === \"string\") {\n return <p className={styles.title}>{title}</p>;\n }\n\n return (\n <Markup className={styles.titleContainer} baseTextSize=\"heading-xs\">\n {title}\n </Markup>\n );\n };\n\n const renderDescription = () => {\n if (!description) {\n return null;\n }\n\n if (typeof description === \"string\") {\n return <p className={styles.description}>{description}</p>;\n }\n\n return (\n <Markup\n className={styles.descriptionContainer}\n baseTextSize=\"body-md\"\n >\n {description}\n </Markup>\n );\n };\n\n const isBordered = styleType === \"bordered\";\n\n return (\n <DashedBorder\n id={id ? `${id}-file-download` : \"file-download\"}\n className={clsx(\n styles.container,\n isBordered && styles.containerBordered,\n className\n )}\n data-testid={testId}\n enabled={isBordered}\n thickness={Border[\"width-040\"]}\n radius={Radius[\"sm\"]}\n colour={Colour[\"border\"]}\n >\n {(title || description) && (\n <div className={styles.textContainer}>\n {renderTitle()}\n {renderDescription()}\n </div>\n )}\n <ul className={styles.listWrapper}>\n {fileItems &&\n fileItems.length > 0 &&\n fileItems.map((item) => (\n <FileListCard\n key={item.id}\n fileItem={item}\n onDownload={handleDownloadItem}\n />\n ))}\n </ul>\n </DashedBorder>\n );\n};\n"],"names":["FileDownload","id","fileItems","title","description","onDownload","testId","className","styleType","handleDownloadItem","item","__awaiter","isBordered","_jsxs","DashedBorder","clsx","styles.container","styles.containerBordered","enabled","thickness","Border","radius","Radius","colour","Colour","children","styles.textContainer","_jsx","styles.title","Markup","styles.titleContainer","baseTextSize","styles.description","styles.descriptionContainer","styles.listWrapper","length","map","FileListCard","fileItem"],"mappings":"ogCAeO,MAAMA,EAAe,EACxBC,KACAC,YAASC,MACTA,EAAKC,YACLA,EACAC,aACA,cAAeC,EACfC,YACAC,YAAY,eAKZ,MAAMC,EAA4BC,GAA+BC,OAAA,OAAA,OAAA,GAAA,YACzDN,UACMA,EAAWK,GAEzB,IAwCME,EAA2B,aAAdJ,EAEnB,OACIK,EAACC,GACGb,GAAIA,EAAK,GAAGA,kBAAqB,gBACjCM,UAAWQ,EACPC,EACAJ,GAAcK,EACdV,GACH,cACYD,EACbY,QAASN,EACTO,UAAWC,EAAO,aAClBC,OAAQC,EAAW,GACnBC,OAAQC,EAAe,OAACC,SAAA,EAEtBtB,GAASC,IACPS,SAAKN,UAAWmB,YAnDnBvB,EAIgB,iBAAVA,EACAwB,EAAA,IAAA,CAAGpB,UAAWqB,EAAYH,SAAGtB,IAIpCwB,EAACE,EAAM,CAACtB,UAAWuB,EAAuBC,aAAa,sBAClD5B,IATE,KAeNC,EAIsB,iBAAhBA,EACAuB,EAAA,IAAA,CAAGpB,UAAWyB,EAAkBP,SAAGrB,IAI1CuB,EAACE,EAAM,CACHtB,UAAW0B,EACXF,aAAa,mBAEZ3B,IAZE,QAuCPuB,QAAIpB,UAAW2B,WACVhC,GACGA,EAAUiC,OAAS,GACnBjC,EAAUkC,KAAK1B,GACXiB,EAACU,EAAY,CAETC,SAAU5B,EACVL,WAAYI,GAFPC,EAAKT,UAMf"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
.cjjybuq{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
1
|
+
@layer fds{.cjjybuq{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
2
2
|
.c18jz6ma{padding:var(--fds-spacing-32);}:where(body.fds-breakpoint-sm-max) .c18jz6ma{padding:var(--fds-spacing-32) var(--fds-spacing-20);}
|
|
3
3
|
.t1wreszr{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-bottom:var(--fds-spacing-32);}
|
|
4
4
|
.t1gdh0v3{font-family:var(--fds-font-family-heading);font-variant:var(--fds-font-variant);font-size:var(--fds-font-heading-size-xs);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-heading-lh-xs);letter-spacing:var(--fds-font-heading-ls-xs);color:var(--fds-colour-text);margin-bottom:var(--fds-spacing-8);}
|
|
5
5
|
.t15acma1{color:var(--fds-colour-text);}
|
|
6
6
|
.ds68p96{font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-md);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-md);letter-spacing:var(--fds-font-body-ls-md);color:var(--fds-colour-text-subtler);}
|
|
7
7
|
.djmu0xz{color:var(--fds-colour-text-subtler);}
|
|
8
|
-
.l12vx512{list-style-type:none;}
|
|
8
|
+
.l12vx512{list-style-type:none;}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./file-list-card.
|
|
1
|
+
import"./file-list-card.styles_18j2gut.css";const i="ifkrwze",t="b7grm6i",e="b1ryf4f4",f="casceiz",l="c83cih3",o="n13wqyhg",c="ethi1vt",d="ff8ofzq",r="iytzo9z",s="e4y82lx",a="dga23xt",y="m1qdniby",z="a1xq0zd",g="i18nltf5",n="tmpqdeo",q="t4orgj8";export{z as actionContainer,t as box,e as boxError,f as contentSection,l as contentSectionHasThumbnail,a as desktopErrorMessage,s as errorIcon,c as extendedNameSection,d as fileSizeSection,g as iconButton,i as item,r as itemNameText,y as mobileErrorMessage,o as nameSection,q as thumbnail,n as thumbnailContainer};
|
|
2
2
|
//# sourceMappingURL=file-list-card.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-list-card.styles.js","sources":["../../../src/file-download/file-list-card/file-list-card.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { lineClampCss } from \"../../shared/styles\";\nimport { Border, Colour, Font, MediaQuery, Radius, Spacing } from \"../../theme\";\n\n// =============================================================================\n// STYLING\n// =============================================================================\nexport const item = css`\n display: flex;\n align-items: center;\n\n width: 100%;\n border: none;\n\n &:not(:last-child) {\n margin-bottom: ${Spacing[\"spacing-16\"]};\n }\n`;\n\nexport const box = css`\n display: flex;\n align-items: center;\n\n width: 100%;\n padding: ${Spacing[\"spacing-16\"]} ${Spacing[\"spacing-32\"]};\n cursor: pointer;\n\n background: ${Colour[\"bg-primary-subtlest\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n border-radius: ${Radius[\"sm\"]};\n\n ${MediaQuery.MaxWidth.lg} {\n padding: ${Spacing[\"spacing-16\"]};\n }\n\n &:hover {\n background: ${Colour[\"bg-hover\"]};\n }\n`;\n\nexport const boxError = css`\n background: ${Colour[\"bg-error\"]};\n border-color: ${Colour[\"border-error\"]};\n\n &:hover {\n background: ${Colour[\"bg-error\"]};\n }\n`;\n\nexport const contentSection = css`\n display: flex;\n flex: 1;\n align-items: center;\n\n ${MediaQuery.MaxWidth.lg} {\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n }\n`;\n\nexport const contentSectionHasThumbnail = css`\n ${MediaQuery.MaxWidth.lg} {\n flex-direction: row;\n align-items: center;\n }\n`;\n\nexport const nameSection = css`\n display: flex;\n flex: 1;\n flex-direction: column;\n\n width: 100%;\n\n overflow-wrap: break-word;\n word-break: break-all;\n white-space: normal;\n`;\n\nexport const extendedNameSection = css`\n display: flex;\n flex: 1;\n align-items: center;\n\n ${MediaQuery.MaxWidth.lg} {\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n }\n`;\n\nexport const fileSizeSection = css`\n display: flex;\n justify-content: flex-end;\n\n width: 5rem;\n margin-left: ${Spacing[\"spacing-8\"]};\n\n ${Font[\"body-md-regular\"]}\n color: ${Colour[\"text\"]};\n\n ${MediaQuery.MaxWidth.lg} {\n justify-content: flex-start;\n\n width: 100%;\n margin-left: 0;\n margin-top: ${Spacing[\"spacing-8\"]};\n\n ${lineClampCss(2)}\n }\n`;\n\nexport const itemNameText = css`\n ${Font[\"body-md-regular\"]}\n color: ${Colour[\"text\"]};\n\n ${MediaQuery.MaxWidth.lg} {\n ${lineClampCss(2)}\n }\n`;\n\nexport const errorIcon = css`\n height: 1lh;\n width: 1em;\n flex-shrink: 0;\n color: ${Colour[\"icon-error-strong\"]};\n`;\n\nconst baseErrorMessage = `\n ${Font[\"body-sm-semibold\"]}\n color: ${Colour[\"text-error\"]};\n`;\n\nexport const desktopErrorMessage = css`\n ${baseErrorMessage}\n margin-top: ${Spacing[\"spacing-
|
|
1
|
+
{"version":3,"file":"file-list-card.styles.js","sources":["../../../src/file-download/file-list-card/file-list-card.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { lineClampCss } from \"../../shared/styles\";\nimport { Border, Colour, Font, MediaQuery, Radius, Spacing } from \"../../theme\";\n\n// =============================================================================\n// STYLING\n// =============================================================================\nexport const item = css`\n display: flex;\n align-items: center;\n\n width: 100%;\n border: none;\n\n &:not(:last-child) {\n margin-bottom: ${Spacing[\"spacing-16\"]};\n }\n`;\n\nexport const box = css`\n display: flex;\n align-items: center;\n\n width: 100%;\n padding: ${Spacing[\"spacing-16\"]} ${Spacing[\"spacing-32\"]};\n cursor: pointer;\n\n background: ${Colour[\"bg-primary-subtlest\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n border-radius: ${Radius[\"sm\"]};\n\n ${MediaQuery.MaxWidth.lg} {\n padding: ${Spacing[\"spacing-16\"]};\n }\n\n &:hover {\n background: ${Colour[\"bg-hover\"]};\n }\n`;\n\nexport const boxError = css`\n background: ${Colour[\"bg-error\"]};\n border-color: ${Colour[\"border-error\"]};\n\n &:hover {\n background: ${Colour[\"bg-error\"]};\n }\n`;\n\nexport const contentSection = css`\n display: flex;\n flex: 1;\n align-items: center;\n\n ${MediaQuery.MaxWidth.lg} {\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n }\n`;\n\nexport const contentSectionHasThumbnail = css`\n ${MediaQuery.MaxWidth.lg} {\n flex-direction: row;\n align-items: center;\n }\n`;\n\nexport const nameSection = css`\n display: flex;\n flex: 1;\n flex-direction: column;\n\n width: 100%;\n\n overflow-wrap: break-word;\n word-break: break-all;\n white-space: normal;\n`;\n\nexport const extendedNameSection = css`\n display: flex;\n flex: 1;\n align-items: center;\n\n ${MediaQuery.MaxWidth.lg} {\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n }\n`;\n\nexport const fileSizeSection = css`\n display: flex;\n justify-content: flex-end;\n\n width: 5rem;\n margin-left: ${Spacing[\"spacing-8\"]};\n\n ${Font[\"body-md-regular\"]}\n color: ${Colour[\"text\"]};\n\n ${MediaQuery.MaxWidth.lg} {\n justify-content: flex-start;\n\n width: 100%;\n margin-left: 0;\n margin-top: ${Spacing[\"spacing-8\"]};\n\n ${lineClampCss(2)}\n }\n`;\n\nexport const itemNameText = css`\n ${Font[\"body-md-regular\"]}\n color: ${Colour[\"text\"]};\n\n ${MediaQuery.MaxWidth.lg} {\n ${lineClampCss(2)}\n }\n`;\n\nexport const errorIcon = css`\n height: 1lh;\n width: 1em;\n flex-shrink: 0;\n color: ${Colour[\"icon-error-strong\"]};\n`;\n\nconst baseErrorMessage = `\n ${Font[\"body-sm-semibold\"]}\n color: ${Colour[\"text-error\"]};\n`;\n\nexport const desktopErrorMessage = css`\n ${baseErrorMessage}\n margin-top: ${Spacing[\"spacing-8\"]};\n display: flex;\n gap: ${Spacing[\"spacing-4\"]};\n\n ${MediaQuery.MaxWidth.lg} {\n display: none;\n visibility: hidden;\n }\n`;\n\nexport const mobileErrorMessage = css`\n ${baseErrorMessage}\n display: none;\n visibility: hidden;\n\n ${MediaQuery.MaxWidth.lg} {\n display: flex;\n gap: ${Spacing[\"spacing-4\"]};\n visibility: visible;\n margin-top: ${Spacing[\"spacing-8\"]};\n }\n`;\n\nexport const actionContainer = css`\n display: flex;\n justify-content: flex-end;\n align-items: center;\n\n margin-left: ${Spacing[\"spacing-32\"]};\n\n ${MediaQuery.MaxWidth.lg} {\n margin-left: ${Spacing[\"spacing-16\"]};\n }\n`;\n\nexport const iconButton = css`\n min-width: unset;\n\n &:not(:last-child) {\n margin-right: ${Spacing[\"spacing-16\"]};\n }\n`;\n\nexport const thumbnailContainer = css`\n width: auto;\n margin-right: ${Spacing[\"spacing-32\"]};\n\n display: flex;\n flex-shrink: 0;\n flex-direction: column;\n justify-content: center;\n\n ${MediaQuery.MaxWidth.lg} {\n margin-right: ${Spacing[\"spacing-16\"]};\n }\n`;\n\nexport const thumbnail = css`\n border-radius: ${Radius[\"sm\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n\n width: 96px;\n height: 96px;\n aspect-ratio: 1;\n object-fit: cover;\n\n ${MediaQuery.MaxWidth.lg} {\n width: 64px;\n height: 64px;\n }\n`;\n"],"names":["item","box","boxError","contentSection","contentSectionHasThumbnail","nameSection","extendedNameSection","fileSizeSection","itemNameText","errorIcon","desktopErrorMessage","mobileErrorMessage","actionContainer","iconButton","thumbnailContainer","thumbnail"],"mappings":"wFAQO,MAAMA,EAAI,UAYJC,EAAG,UAqBHC,EAAQ,WASRC,EAAc,UAYdC,EAA0B,UAO1BC,EAAW,WAYXC,EAAmB,UAYnBC,EAAe,UAqBfC,EAAY,UASZC,EAAS,UAYTC,EAAmB,UAYnBC,EAAkB,WAalBC,EAAe,UAYfC,EAAU,WAQVC,EAAkB,UAclBC,EAAS"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.ifkrwze{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;border:none;}.ifkrwze:not(:last-child){margin-bottom:var(--fds-spacing-16);}
|
|
1
|
+
@layer fds{.ifkrwze{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;border:none;}.ifkrwze:not(:last-child){margin-bottom:var(--fds-spacing-16);}
|
|
2
2
|
.b7grm6i{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;padding:var(--fds-spacing-16) var(--fds-spacing-32);cursor:pointer;background:var(--fds-colour-bg-primary-subtlest);border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);border-radius:var(--fds-radius-sm);}:where(body.fds-breakpoint-lg-max) .b7grm6i{padding:var(--fds-spacing-16);}.b7grm6i:hover{background:var(--fds-colour-bg-hover);}
|
|
3
3
|
.b1ryf4f4{background:var(--fds-colour-bg-error);border-color:var(--fds-colour-border-error);}.b1ryf4f4:hover{background:var(--fds-colour-bg-error);}
|
|
4
4
|
.casceiz{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}:where(body.fds-breakpoint-lg-max) .casceiz{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;width:100%;}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
.ff8ofzq{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;width:5rem;margin-left:var(--fds-spacing-8);font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-md);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-md);letter-spacing:var(--fds-font-body-ls-md);color:var(--fds-colour-text);}:where(body.fds-breakpoint-lg-max) .ff8ofzq{-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;width:100%;margin-left:0;margin-top:var(--fds-spacing-8);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
|
|
9
9
|
.iytzo9z{font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-md);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-md);letter-spacing:var(--fds-font-body-ls-md);color:var(--fds-colour-text);}:where(body.fds-breakpoint-lg-max) .iytzo9z{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
|
|
10
10
|
.e4y82lx{height:1lh;width:1em;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:var(--fds-colour-icon-error-strong);}
|
|
11
|
-
.dga23xt{font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-sm);font-weight:var(--fds-font-weight-semibold);line-height:var(--fds-font-body-lh-sm);letter-spacing:var(--fds-font-body-ls-sm);color:var(--fds-colour-text-error);margin-top:var(--fds-spacing-
|
|
11
|
+
.dga23xt{font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-sm);font-weight:var(--fds-font-weight-semibold);line-height:var(--fds-font-body-lh-sm);letter-spacing:var(--fds-font-body-ls-sm);color:var(--fds-colour-text-error);margin-top:var(--fds-spacing-8);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--fds-spacing-4);}:where(body.fds-breakpoint-lg-max) .dga23xt{display:none;visibility:hidden;}
|
|
12
12
|
.m1qdniby{font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-sm);font-weight:var(--fds-font-weight-semibold);line-height:var(--fds-font-body-lh-sm);letter-spacing:var(--fds-font-body-ls-sm);color:var(--fds-colour-text-error);display:none;visibility:hidden;}:where(body.fds-breakpoint-lg-max) .m1qdniby{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--fds-spacing-4);visibility:visible;margin-top:var(--fds-spacing-8);}
|
|
13
13
|
.a1xq0zd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-left:var(--fds-spacing-32);}:where(body.fds-breakpoint-lg-max) .a1xq0zd{margin-left:var(--fds-spacing-16);}
|
|
14
14
|
.i18nltf5{min-width:unset;}.i18nltf5:not(:last-child){margin-right:var(--fds-spacing-16);}
|
|
15
15
|
.tmpqdeo{width:auto;margin-right:var(--fds-spacing-32);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}:where(body.fds-breakpoint-lg-max) .tmpqdeo{margin-right:var(--fds-spacing-16);}
|
|
16
|
-
.t4orgj8{border-radius:var(--fds-radius-sm);border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);width:96px;height:96px;aspect-ratio:1;object-fit:cover;}:where(body.fds-breakpoint-lg-max) .t4orgj8{width:64px;height:64px;}
|
|
16
|
+
.t4orgj8{border-radius:var(--fds-radius-sm);border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);width:96px;height:96px;aspect-ratio:1;object-fit:cover;}:where(body.fds-breakpoint-lg-max) .t4orgj8{width:64px;height:64px;}}
|
package/file-download/types.d.ts
CHANGED
|
@@ -1,33 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata describing a single downloadable file item.
|
|
3
|
+
*/
|
|
1
4
|
export interface FileItemDownloadProps {
|
|
2
5
|
id: string;
|
|
3
|
-
/** The name of the file */
|
|
6
|
+
/** The display name of the file. */
|
|
4
7
|
name: string;
|
|
5
|
-
/** The MIME type of the file */
|
|
8
|
+
/** The MIME type of the file (e.g. `"application/pdf"`). */
|
|
6
9
|
mimeType: string;
|
|
7
|
-
/** The size of the file in bytes */
|
|
10
|
+
/** The size of the file in bytes. Displayed as formatted text when provided. */
|
|
8
11
|
size?: number | undefined;
|
|
9
|
-
/** The remote path
|
|
12
|
+
/** The remote path or URL used to fetch the file for download. */
|
|
10
13
|
filePath: string;
|
|
11
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Error message shown on the file item to indicate a download failure.
|
|
16
|
+
* Accepts a plain string or a React node for richer error display.
|
|
17
|
+
*/
|
|
12
18
|
errorMessage?: string | React.ReactNode | undefined;
|
|
13
|
-
/**
|
|
19
|
+
/** URL or data URL for a thumbnail image shown alongside the file entry. */
|
|
14
20
|
thumbnailImageDataUrl?: string | undefined;
|
|
15
|
-
/**
|
|
21
|
+
/** Truncates long file names with an ellipsis when `true`. */
|
|
16
22
|
truncateText?: boolean | undefined;
|
|
17
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Indicates the file is available and ready to be downloaded.
|
|
25
|
+
*
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
18
28
|
ready?: boolean | undefined;
|
|
19
29
|
}
|
|
30
|
+
/** Visual style variant controlling whether the component renders with a dashed border. */
|
|
20
31
|
export type FileDownloadStyle = "bordered" | "no-border";
|
|
32
|
+
/**
|
|
33
|
+
* Props for the `FileDownload` component.
|
|
34
|
+
*/
|
|
21
35
|
export interface FileDownloadProps {
|
|
22
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Optional heading rendered above the file list.
|
|
38
|
+
* Accepts a plain string or a JSX element for rich content.
|
|
39
|
+
*/
|
|
23
40
|
title?: string | JSX.Element | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Optional text rendered beneath the title.
|
|
43
|
+
* Accepts a plain string or a JSX element for rich content.
|
|
44
|
+
*/
|
|
24
45
|
description?: string | JSX.Element | undefined;
|
|
46
|
+
/** The list of file items to display. When empty, no file cards are rendered. */
|
|
25
47
|
fileItems: FileItemDownloadProps[];
|
|
26
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Controls whether the component is wrapped in a dashed border.
|
|
50
|
+
*
|
|
51
|
+
* @default "bordered"
|
|
52
|
+
*/
|
|
27
53
|
styleType?: FileDownloadStyle | undefined;
|
|
28
54
|
className?: string | undefined;
|
|
29
55
|
"data-testid"?: string | undefined;
|
|
30
56
|
id?: string | undefined;
|
|
31
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Called when the user triggers a download for an individual file item.
|
|
59
|
+
* May return a `Promise` to handle async download logic; the component awaits resolution.
|
|
60
|
+
* If the callback throws or the promise rejects, the item is marked as failed
|
|
61
|
+
* and the error UI is shown for that file card.
|
|
62
|
+
*
|
|
63
|
+
* @param file The file item that was activated for download.
|
|
64
|
+
*/
|
|
32
65
|
onDownload: (file: FileItemDownloadProps) => void | Promise<void>;
|
|
33
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.c1mdy24p{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
1
|
+
@layer fds{.c1mdy24p{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
2
2
|
.c1vk9wvq{padding:var(--fds-spacing-32);}:where(body.fds-breakpoint-md-max) .c1vk9wvq{padding:var(--fds-spacing-32) var(--fds-spacing-20);}
|
|
3
3
|
.h1ogyved{display:none;}
|
|
4
4
|
.dtq8bte{position:absolute;top:0;left:0;width:100%;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
|
5
5
|
.ozzxgak{color:var(--fds-colour-text-primary);text-align:center;}
|
|
6
|
-
.o1seqaul{color:var(--fds-colour-icon-primary);height:4rem;width:4rem;}
|
|
6
|
+
.o1seqaul{color:var(--fds-colour-icon-primary);height:4rem;width:4rem;}}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { FormLabelProps } from "../form/types";
|
|
1
2
|
import type { FileItemProps } from "./types";
|
|
2
3
|
interface Props {
|
|
3
4
|
fileItem: FileItemProps;
|
|
4
5
|
wrapperWidth: number;
|
|
5
6
|
fileDescriptionMaxLength?: number | undefined;
|
|
7
|
+
descriptionRequired?: boolean | undefined;
|
|
8
|
+
descriptionLabel?: FormLabelProps | undefined;
|
|
6
9
|
onSave: (description: string) => void;
|
|
7
10
|
onCancel: () => void;
|
|
8
11
|
onBlur: (value: string) => void;
|
|
9
12
|
}
|
|
10
|
-
export declare const FileItemEdit: ({ fileItem, fileDescriptionMaxLength, wrapperWidth, onSave, onCancel, onBlur, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const FileItemEdit: ({ fileItem, fileDescriptionMaxLength, descriptionRequired, descriptionLabel, wrapperWidth, onSave, onCancel, onBlur, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import i from"clsx";import{useState as r,useRef as a,useCallback as l,useEffect as n}from"react";import{Button as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import i from"clsx";import{useState as r,useRef as a,useCallback as l,useEffect as n}from"react";import{Button as s}from"../button/button.js";import{Form as o}from"../form/index.js";import{Typography as m}from"../typography/index.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import"../util/simple-id-generator.js";import{StringHelper as c}from"../util/string-helper.js";import"@react-aria/live-announcer";import{item as d,contentSection as p,detailsSection as u,actionButton as h,actionButtonsSection as f,actionButtonsSectionWithThumbnail as y,nameSection as b,fileNameText as g,fileSizeText as j}from"./file-item-edit.styles.js";import{FileListItemThumbnail as v}from"./file-list-item/file-list-item-thumbnail.js";import{FileUploadHelper as x}from"./helper.js";const N=({fileItem:N,fileDescriptionMaxLength:D,descriptionRequired:T=!0,descriptionLabel:C,wrapperWidth:w,onSave:B,onCancel:M,onBlur:$})=>{const{id:z,name:I,size:L,type:P,truncateText:S=!0,thumbnailImageDataUrl:k}=N,[E,F]=r(),[R,U]=r(""),_=a(null),q=a(null),O=l((e=>{if(!S)return e;const t=q&&q.current?q.current.getBoundingClientRect().width:0;return c.truncateOneLine(e,t,t/2,t/2/8,16)}),[S]);n((()=>{F(O(I))}),[w,O,I]),n((()=>{U(N.description||"")}),[N]);const W=!!k||P===x.PDF_MIME_TYPE;return e("li",{"data-testid":`${z}-edit-display`,className:d,children:[e("div",{className:p,children:[W&&t(v,{thumbnailImageDataUrl:k,fileType:P}),e("div",{className:u,children:[e("div",{ref:q,className:b,children:[t(m.BodyMD,{className:g,weight:"semibold",children:E}),t(m.BodyMD,{className:j,children:x.formatFileSizeDisplay(L)})]}),t(o.Textarea,{ref:_,id:`${z}-description-textarea`,"data-testid":`${z}-textarea`,value:R,maxLength:D,onChange:e=>{U(e.target.value)},onBlur:e=>{$(e.target.value)},rows:3,label:null!=C?C:{children:"Photo description",subtitle:"Describe this photo to users who may not be able to see the image."}})]})]}),e("div",{className:i(f,W&&y),children:[t(s,{"data-testid":`${z}-save-button`,type:"button",sizeType:"small",disabled:(()=>{if(!T)return!1;return 0===R.trim().length})(),onClick:()=>{_.current&&B(_.current.value.trim())},className:h,children:"Save"}),t(s,{type:"button",sizeType:"small",styleType:"secondary","data-testid":`${z}-cancel-button`,onClick:M,className:h,children:"Cancel"})]})]})};export{N as FileItemEdit};
|
|
2
2
|
//# sourceMappingURL=file-item-edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-item-edit.js","sources":["../../src/file-upload/file-item-edit.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { Button } from \"../button\";\nimport { Form } from \"../form\";\nimport { Typography } from \"../typography\";\nimport { StringHelper } from \"../util\";\nimport * as styles from \"./file-item-edit.styles\";\nimport { FileListItemThumbnail } from \"./file-list-item/file-list-item-thumbnail\";\nimport { FileUploadHelper } from \"./helper\";\nimport type { FileItemProps } from \"./types\";\n\ninterface Props {\n fileItem: FileItemProps;\n wrapperWidth: number;\n fileDescriptionMaxLength?: number | undefined;\n onSave: (description: string) => void;\n onCancel: () => void;\n onBlur: (value: string) => void;\n}\n\nexport const FileItemEdit = ({\n fileItem,\n fileDescriptionMaxLength,\n wrapperWidth,\n onSave,\n onCancel,\n onBlur,\n}: Props) => {\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const {\n id,\n name,\n size,\n type,\n truncateText = true,\n thumbnailImageDataUrl,\n } = fileItem;\n\n const [formattedName, setFormattedName] = useState<string>();\n const [currentDescription, setCurrentDescription] = useState<string>(\"\");\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const nameSectionRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // HELPER FUNCTIONS\n // =========================================================================\n const getTruncatedText = useCallback(\n (value: string) => {\n if (!truncateText) return value;\n\n const widthOfElement =\n nameSectionRef && nameSectionRef.current\n ? nameSectionRef.current.getBoundingClientRect().width\n : 0;\n\n return StringHelper.truncateOneLine(\n value,\n widthOfElement,\n widthOfElement / 2,\n widthOfElement / 2 / 8, // Arbitrary\n 16 // Font size\n );\n },\n [truncateText]\n );\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n setFormattedName(getTruncatedText(name));\n }, [wrapperWidth, getTruncatedText, name]);\n\n useEffect(() => {\n setCurrentDescription(fileItem.description || \"\");\n }, [fileItem]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleSave = () => {\n if (textareaRef.current) {\n onSave(textareaRef.current.value.trim());\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n setCurrentDescription(event.target.value);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLTextAreaElement>) => {\n onBlur(event.target.value);\n };\n\n const shouldDisableSave = () => {\n const trimmedDescription = currentDescription.trim();\n return trimmedDescription.length === 0;\n };\n\n const shouldShowThumbnail =\n !!thumbnailImageDataUrl || type === FileUploadHelper.PDF_MIME_TYPE;\n\n // =========================================================================\n // RENDER FUNCTIONS\n // =========================================================================\n const renderFileNameAndSize = () => (\n <div ref={nameSectionRef} className={styles.nameSection}>\n <Typography.BodyMD\n className={styles.fileNameText}\n weight=\"semibold\"\n >\n {formattedName}\n </Typography.BodyMD>\n <Typography.BodyMD>\n {FileUploadHelper.formatFileSizeDisplay(size)}\n </Typography.BodyMD>\n </div>\n );\n\n return (\n <li data-testid={`${id}-edit-display`} className={styles.item}>\n <div className={styles.contentSection}>\n {shouldShowThumbnail && (\n <FileListItemThumbnail\n thumbnailImageDataUrl={thumbnailImageDataUrl}\n fileType={type}\n />\n )}\n <div className={styles.detailsSection}>\n {renderFileNameAndSize()}\n <Form.Textarea\n ref={textareaRef}\n id={`${id}-description-textarea`}\n data-testid={`${id}-textarea`}\n value={currentDescription}\n maxLength={fileDescriptionMaxLength}\n onChange={handleChange}\n onBlur={handleBlur}\n rows={3}\n
|
|
1
|
+
{"version":3,"file":"file-item-edit.js","sources":["../../src/file-upload/file-item-edit.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport { Button } from \"../button\";\nimport { Form } from \"../form\";\nimport type { FormLabelProps } from \"../form/types\";\nimport { Typography } from \"../typography\";\nimport { StringHelper } from \"../util\";\nimport * as styles from \"./file-item-edit.styles\";\nimport { FileListItemThumbnail } from \"./file-list-item/file-list-item-thumbnail\";\nimport { FileUploadHelper } from \"./helper\";\nimport type { FileItemProps } from \"./types\";\n\ninterface Props {\n fileItem: FileItemProps;\n wrapperWidth: number;\n fileDescriptionMaxLength?: number | undefined;\n descriptionRequired?: boolean | undefined;\n descriptionLabel?: FormLabelProps | undefined;\n onSave: (description: string) => void;\n onCancel: () => void;\n onBlur: (value: string) => void;\n}\n\nexport const FileItemEdit = ({\n fileItem,\n fileDescriptionMaxLength,\n descriptionRequired = true,\n descriptionLabel,\n wrapperWidth,\n onSave,\n onCancel,\n onBlur,\n}: Props) => {\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const {\n id,\n name,\n size,\n type,\n truncateText = true,\n thumbnailImageDataUrl,\n } = fileItem;\n\n const [formattedName, setFormattedName] = useState<string>();\n const [currentDescription, setCurrentDescription] = useState<string>(\"\");\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const nameSectionRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // HELPER FUNCTIONS\n // =========================================================================\n const getTruncatedText = useCallback(\n (value: string) => {\n if (!truncateText) return value;\n\n const widthOfElement =\n nameSectionRef && nameSectionRef.current\n ? nameSectionRef.current.getBoundingClientRect().width\n : 0;\n\n return StringHelper.truncateOneLine(\n value,\n widthOfElement,\n widthOfElement / 2,\n widthOfElement / 2 / 8, // Arbitrary\n 16 // Font size\n );\n },\n [truncateText]\n );\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n setFormattedName(getTruncatedText(name));\n }, [wrapperWidth, getTruncatedText, name]);\n\n useEffect(() => {\n setCurrentDescription(fileItem.description || \"\");\n }, [fileItem]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleSave = () => {\n if (textareaRef.current) {\n onSave(textareaRef.current.value.trim());\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n setCurrentDescription(event.target.value);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLTextAreaElement>) => {\n onBlur(event.target.value);\n };\n\n const shouldDisableSave = () => {\n if (!descriptionRequired) return false;\n const trimmedDescription = currentDescription.trim();\n return trimmedDescription.length === 0;\n };\n\n const shouldShowThumbnail =\n !!thumbnailImageDataUrl || type === FileUploadHelper.PDF_MIME_TYPE;\n\n // =========================================================================\n // RENDER FUNCTIONS\n // =========================================================================\n const renderFileNameAndSize = () => (\n <div ref={nameSectionRef} className={styles.nameSection}>\n <Typography.BodyMD\n className={styles.fileNameText}\n weight=\"semibold\"\n >\n {formattedName}\n </Typography.BodyMD>\n <Typography.BodyMD className={styles.fileSizeText}>\n {FileUploadHelper.formatFileSizeDisplay(size)}\n </Typography.BodyMD>\n </div>\n );\n\n return (\n <li data-testid={`${id}-edit-display`} className={styles.item}>\n <div className={styles.contentSection}>\n {shouldShowThumbnail && (\n <FileListItemThumbnail\n thumbnailImageDataUrl={thumbnailImageDataUrl}\n fileType={type}\n />\n )}\n <div className={styles.detailsSection}>\n {renderFileNameAndSize()}\n <Form.Textarea\n ref={textareaRef}\n id={`${id}-description-textarea`}\n data-testid={`${id}-textarea`}\n value={currentDescription}\n maxLength={fileDescriptionMaxLength}\n onChange={handleChange}\n onBlur={handleBlur}\n rows={3}\n label={\n descriptionLabel ?? {\n children: \"Photo description\",\n subtitle:\n \"Describe this photo to users who may not be able to see the image.\",\n }\n }\n />\n </div>\n </div>\n <div\n className={clsx(\n styles.actionButtonsSection,\n shouldShowThumbnail &&\n styles.actionButtonsSectionWithThumbnail\n )}\n >\n <Button\n data-testid={`${id}-save-button`}\n type=\"button\"\n sizeType=\"small\"\n disabled={shouldDisableSave()}\n onClick={handleSave}\n className={styles.actionButton}\n >\n Save\n </Button>\n <Button\n type=\"button\"\n sizeType=\"small\"\n styleType=\"secondary\"\n data-testid={`${id}-cancel-button`}\n onClick={onCancel}\n className={styles.actionButton}\n >\n Cancel\n </Button>\n </div>\n </li>\n );\n};\n"],"names":["FileItemEdit","fileItem","fileDescriptionMaxLength","descriptionRequired","descriptionLabel","wrapperWidth","onSave","onCancel","onBlur","id","name","size","type","truncateText","thumbnailImageDataUrl","formattedName","setFormattedName","useState","currentDescription","setCurrentDescription","textareaRef","useRef","nameSectionRef","getTruncatedText","useCallback","value","widthOfElement","current","getBoundingClientRect","width","StringHelper","truncateOneLine","useEffect","description","shouldShowThumbnail","FileUploadHelper","PDF_MIME_TYPE","_jsxs","className","styles.item","children","styles.contentSection","_jsx","FileListItemThumbnail","fileType","styles.detailsSection","ref","styles.nameSection","Typography","BodyMD","styles.fileNameText","weight","styles.fileSizeText","formatFileSizeDisplay","Form","Textarea","maxLength","onChange","event","target","rows","label","subtitle","clsx","styles.actionButtonsSection","styles.actionButtonsSectionWithThumbnail","Button","sizeType","disabled","trim","length","shouldDisableSave","onClick","styles.actionButton","styleType"],"mappings":"80BAwBO,MAAMA,EAAe,EACxBC,WACAC,2BACAC,uBAAsB,EACtBC,mBACAC,eACAC,SACAC,WACAC,aAKA,MAAMC,GACFA,EAAEC,KACFA,EAAIC,KACJA,EAAIC,KACJA,EAAIC,aACJA,GAAe,EAAIC,sBACnBA,GACAb,GAEGc,EAAeC,GAAoBC,KACnCC,EAAoBC,GAAyBF,EAAiB,IAE/DG,EAAcC,EAA4B,MAC1CC,EAAiBD,EAAuB,MAKxCE,EAAmBC,GACpBC,IACG,IAAKZ,EAAc,OAAOY,EAE1B,MAAMC,EACFJ,GAAkBA,EAAeK,QAC3BL,EAAeK,QAAQC,wBAAwBC,MAC/C,EAEV,OAAOC,EAAaC,gBAChBN,EACAC,EACAA,EAAiB,EACjBA,EAAiB,EAAI,EACrB,GACH,GAEL,CAACb,IAMLmB,GAAU,KACNhB,EAAiBO,EAAiBb,GAAM,GACzC,CAACL,EAAckB,EAAkBb,IAEpCsB,GAAU,KACNb,EAAsBlB,EAASgC,aAAe,GAAG,GAClD,CAAChC,IAKJ,MAoBMiC,IACApB,GAAyBF,IAASuB,EAAiBC,cAmBzD,OACIC,EAAA,KAAA,CAAA,cAAiB,GAAG5B,iBAAmB6B,UAAWC,EAAWC,SAAA,CACzDH,SAAKC,UAAWG,YACXP,GACGQ,EAACC,GACG7B,sBAAuBA,EACvB8B,SAAUhC,IAGlByB,EAAA,MAAA,CAAKC,UAAWO,EAAqBL,SAAA,CAtB7CH,EAAA,MAAA,CAAKS,IAAKxB,EAAgBgB,UAAWS,EAAkBP,SAAA,CACnDE,EAACM,EAAWC,OAAM,CACdX,UAAWY,EACXC,OAAO,WAAUX,SAEhBzB,IAEL2B,EAACM,EAAWC,OAAM,CAACX,UAAWc,EAAmBZ,SAC5CL,EAAiBkB,sBAAsB1C,QAgBpC+B,EAACY,EAAKC,SAAQ,CACVT,IAAK1B,EACLX,GAAI,GAAGA,yBAAyB,cACnB,GAAGA,aAChBgB,MAAOP,EACPsC,UAAWtD,EACXuD,SAnDEC,IAClBvC,EAAsBuC,EAAMC,OAAOlC,MAAM,EAmDzBjB,OAhDAkD,IAChBlD,EAAOkD,EAAMC,OAAOlC,MAAM,EAgDVmC,KAAM,EACNC,MACIzD,QAAAA,EAAoB,CAChBoC,SAAU,oBACVsB,SACI,8EAMxBzB,EAAA,MAAA,CACIC,UAAWyB,EACPC,EACA9B,GACI+B,GACPzB,SAAA,CAEDE,EAACwB,EAAM,CAAA,cACU,GAAGzD,gBAChBG,KAAK,SACLuD,SAAS,QACTC,SAnEU,MACtB,IAAKjE,EAAqB,OAAO,EAEjC,OAAqC,IADVe,EAAmBmD,OACpBC,MAAY,EAgEhBC,GACVC,QAlFG,KACXpD,EAAYO,SACZrB,EAAOc,EAAYO,QAAQF,MAAM4C,OACrC,EAgFY/B,UAAWmC,EAAmBjC,SAAA,SAIlCE,EAACwB,EAAM,CACHtD,KAAK,SACLuD,SAAS,QACTO,UAAU,YAAW,cACR,GAAGjE,kBAChB+D,QAASjE,EACT+B,UAAWmC,EAAmBjC,SAAA,gBAKrC"}
|
|
@@ -3,6 +3,7 @@ export declare const contentSection: import("@linaria/core").LinariaClassName;
|
|
|
3
3
|
export declare const detailsSection: import("@linaria/core").LinariaClassName;
|
|
4
4
|
export declare const nameSection: import("@linaria/core").LinariaClassName;
|
|
5
5
|
export declare const fileNameText: import("@linaria/core").LinariaClassName;
|
|
6
|
+
export declare const fileSizeText: import("@linaria/core").LinariaClassName;
|
|
6
7
|
export declare const actionButtonsSection: import("@linaria/core").LinariaClassName;
|
|
7
8
|
export declare const actionButtonsSectionWithThumbnail: import("@linaria/core").LinariaClassName;
|
|
8
9
|
export declare const actionButton: import("@linaria/core").LinariaClassName;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./file-item-edit.
|
|
1
|
+
import"./file-item-edit.styles_19bvztn.css";const i="i1432lvs",t="c1i0crev",c="d4rbbwx",e="n18lt6ho",l="fuau9z6",s="f18dc1yj",a="ajknckh",d="awg16zc",f="aigdfjq";export{f as actionButton,a as actionButtonsSection,d as actionButtonsSectionWithThumbnail,t as contentSection,c as detailsSection,l as fileNameText,s as fileSizeText,i as item,e as nameSection};
|
|
2
2
|
//# sourceMappingURL=file-item-edit.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-item-edit.styles.js","sources":["../../src/file-upload/file-item-edit.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Border, Colour, MediaQuery, Spacing } from \"../theme\";\n\nexport const item = css`\n display: flex;\n flex-direction: column;\n padding: ${Spacing[\"spacing-32\"]}
|
|
1
|
+
{"version":3,"file":"file-item-edit.styles.js","sources":["../../src/file-upload/file-item-edit.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Border, Colour, MediaQuery, Radius, Spacing } from \"../theme\";\n\nexport const item = css`\n display: flex;\n flex-direction: column;\n padding: ${Spacing[\"spacing-32\"]};\n background: ${Colour[\"bg-primary-subtlest\"]};\n border: ${Border[\"width-010\"]} ${Border.solid} ${Colour.border};\n border-radius: ${Radius[\"sm\"]};\n\n &:not(:last-child) {\n margin-bottom: ${Spacing[\"spacing-16\"]};\n }\n`;\n\nexport const contentSection = css`\n display: flex;\n align-items: flex-start;\n margin-bottom: ${Spacing[\"spacing-16\"]};\n width: 100%;\n`;\n\nexport const detailsSection = css`\n display: flex;\n flex: 1;\n flex-direction: column;\n`;\n\nexport const nameSection = css`\n width: 100%;\n display: flex;\n justify-content: space-between;\n margin-bottom: ${Spacing[\"spacing-16\"]};\n\n ${MediaQuery.MaxWidth.md} {\n flex-direction: column;\n justify-content: flex-start;\n }\n`;\n\nexport const fileNameText = css`\n display: flex;\n flex: 1;\n margin-right: ${Spacing[\"spacing-16\"]};\n\n ${MediaQuery.MaxWidth.md} {\n margin-right: 0;\n margin-bottom: ${Spacing[\"spacing-8\"]};\n }\n`;\n\nexport const fileSizeText = css`\n color: ${Colour[\"text-subtler\"]};\n`;\n\nexport const actionButtonsSection = css`\n display: flex;\n justify-content: flex-end;\n\n ${MediaQuery.MaxWidth.md} {\n flex-direction: column;\n }\n`;\n\nexport const actionButtonsSectionWithThumbnail = css`\n margin-left: calc(\n 96px + ${Spacing[\"spacing-32\"]}\n ); // thumbnail width + right margin\n\n ${MediaQuery.MaxWidth.md} {\n margin-left: 0;\n }\n`;\n\nexport const actionButton = css`\n width: 7.5rem;\n\n &:not(:last-of-type) {\n margin-right: ${Spacing[\"spacing-16\"]};\n }\n\n ${MediaQuery.MaxWidth.md} {\n width: 100%;\n\n &:not(:last-of-type) {\n margin-bottom: ${Spacing[\"spacing-16\"]};\n }\n }\n`;\n"],"names":["item","contentSection","detailsSection","nameSection","fileNameText","fileSizeText","actionButtonsSection","actionButtonsSectionWithThumbnail","actionButton"],"mappings":"uEAIO,MAAMA,EAAI,WAaJC,EAAc,WAOdC,EAAc,UAMdC,EAAW,WAYXC,EAAY,UAWZC,EAAY,WAIZC,EAAoB,UASpBC,EAAiC,UAUjCC,EAAY"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
.i1432lvs{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:var(--fds-spacing-32)
|
|
1
|
+
@layer fds{.i1432lvs{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding:var(--fds-spacing-32);background:var(--fds-colour-bg-primary-subtlest);border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);border-radius:var(--fds-radius-sm);}.i1432lvs:not(:last-child){margin-bottom:var(--fds-spacing-16);}
|
|
2
2
|
.c1i0crev{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin-bottom:var(--fds-spacing-16);width:100%;}
|
|
3
3
|
.d4rbbwx{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
4
4
|
.n18lt6ho{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:space-between;-webkit-justify-content:space-between;justify-content:space-between;margin-bottom:var(--fds-spacing-16);}:where(body.fds-breakpoint-md-max) .n18lt6ho{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;}
|
|
5
5
|
.fuau9z6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;margin-right:var(--fds-spacing-16);}:where(body.fds-breakpoint-md-max) .fuau9z6{margin-right:0;margin-bottom:var(--fds-spacing-8);}
|
|
6
|
-
.
|
|
7
|
-
.ajknckh{
|
|
6
|
+
.f18dc1yj{color:var(--fds-colour-text-subtler);}
|
|
7
|
+
.ajknckh{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;}:where(body.fds-breakpoint-md-max) .ajknckh{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
8
|
+
.awg16zc{margin-left:calc(
|
|
8
9
|
96px + var(--fds-spacing-32)
|
|
9
|
-
);}:where(body.fds-breakpoint-md-max) .
|
|
10
|
-
.
|
|
10
|
+
);}:where(body.fds-breakpoint-md-max) .awg16zc{margin-left:0;}
|
|
11
|
+
.aigdfjq{width:7.5rem;}.aigdfjq:not(:last-of-type){margin-right:var(--fds-spacing-16);}:where(body.fds-breakpoint-md-max) .aigdfjq{width:100%;}:where(body.fds-breakpoint-md-max) .aigdfjq:not(:last-of-type){margin-bottom:var(--fds-spacing-16);}}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
+
import type { FormLabelProps } from "../../form/types";
|
|
2
3
|
import type { FileItemProps } from "../types";
|
|
3
4
|
interface Props {
|
|
4
5
|
fileItems: FileItemProps[] | undefined;
|
|
5
6
|
editableFileItems: boolean;
|
|
6
7
|
fileDescriptionMaxLength?: number | undefined;
|
|
8
|
+
descriptionRequired?: boolean | undefined;
|
|
9
|
+
descriptionLabel?: FormLabelProps | undefined;
|
|
7
10
|
sortable?: boolean | undefined;
|
|
8
11
|
disabled?: boolean | undefined;
|
|
9
12
|
readOnly?: boolean | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useSensors as i,useSensor as s,DndContext as o,KeyboardSensor as n,TouchSensor as l}from"../../external/@dnd-kit/core/dist/core.esm.js";import{SortableContext as
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useSensors as i,useSensor as s,DndContext as o,KeyboardSensor as n,TouchSensor as l}from"../../external/@dnd-kit/core/dist/core.esm.js";import{SortableContext as d,verticalListSortingStrategy as a,arrayMove as c,sortableKeyboardCoordinates as p}from"../../external/@dnd-kit/sortable/dist/sortable.esm.js";import f from"clsx";import{forwardRef as u,useState as m,useContext as g,useRef as h,useImperativeHandle as b,useEffect as y}from"react";import{useResizeDetector as v}from"../../external/react-resize-detector/build/index.esm.js";import{VisuallyHidden as j}from"../../shared/accessibility/index.js";import{FileUploadContext as x}from"../context.js";import{MouseSensor as $}from"../custom-sensors.js";import{FileItemEdit as I}from"../file-item-edit.js";import{FileListItem as O}from"../file-list-item/file-list-item.js";import{FileUploadHelper as M}from"../helper.js";import{listWrapper as D,listWrapperReadOnly as S,editableItemsContainer as k}from"./file-list.styles.js";const w=u((function({fileItems:u=[],editableFileItems:w,fileDescriptionMaxLength:A,descriptionRequired:L,descriptionLabel:C,sortable:E,disabled:F,readOnly:N,onItemUpdate:R,onItemDelete:q,onSort:B},W){const[z,G]=m({}),{setActiveId:K}=g(x),[T,U]=m(""),H=h({});b(W,(()=>({focus:()=>{var e;null===(e=P.current)||void 0===e||e.focus()}})));const{width:J=0,ref:P}=v(),Q=h({}),V=i(s($,{activationConstraint:{distance:8}}),s(l,{activationConstraint:{delay:150,tolerance:5}}),s(n,{coordinateGetter:p})),X=e=>{delete Q.current[e]};y((()=>{const e=ne(u);((e,r)=>{const t=Object.keys(e),i=Object.keys(r);if(t.length!==i.length)return!1;for(const t of i)if(e[t]!==r[t])return!1;return!0})(z,e)||G(e)}),[u,w,N]),y((()=>{var e;if(!u||0===u.length)return void U("");const r=Date.now(),t=[];for(const i of u){const s=H.current[i.id];if(i.errorMessage)"error"!==(null==s?void 0:s.status)&&(t.push("string"==typeof i.errorMessage?`Error uploading ${i.name}: ${i.errorMessage}`:`Error uploading ${i.name}`),H.current[i.id]={progress:null!==(e=i.progress)&&void 0!==e?e:1,timestamp:r,status:"error"});else if(void 0!==i.progress)if(i.progress>=1)"complete"!==(null==s?void 0:s.status)&&(t.push(`${i.name} upload is complete`),H.current[i.id]={progress:1,timestamp:r,status:"complete"});else if("number"==typeof i.progress&&i.progress<1){(!s||"in-progress"!==s.status)&&(t.push(`Starting upload of ${i.name}`),H.current[i.id]={progress:i.progress,timestamp:r,status:"in-progress"})}}t.length>0&&U(t.join(", "))}),[u]);const Y=e=>r=>{le(e.id,"display"),X(e.id);const t=Object.assign(Object.assign({},e),{description:r});R(t)},Z=e=>r=>{Q.current[e.id]=r},_=e=>()=>{e.description&&0!==e.description.length?le(e.id,"display"):q(e),X(e.id)},ee=e=>()=>{le(e.id,"edit")},re=e=>()=>{q(e),P.current&&P.current.focus()},te=e=>{if(B&&u){const{active:r,over:t}=e;if(t&&r.id!==t.id){const e=u.findIndex((e=>e.id===r.id)),i=u.findIndex((e=>e.id===t.id)),s=c(u,e,i);B(s)}}K(void 0)},ie=e=>{const{active:r}=e;K(r.id)},se=e=>w&&M.isSupportedImageType(e.type),oe=e=>!e.errorMessage&&!N&&!("number"==typeof e.progress&&e.progress<1)&&se(e)&&!e.description,ne=e=>{if(!e||0===e.length)return{};const r={};for(const t of e)t.errorMessage?r[t.id]="error":z[t.id]?r[t.id]=z[t.id]:r[t.id]=oe(t)?"edit":"display";return r},le=(e,r)=>{G((t=>Object.assign(Object.assign({},t),{[e]:r})))},de=()=>u&&u.length>1&&E&&Object.values(z).every((e=>"display"===e)),ae=()=>{if(0===u.length)return"No files uploaded";const e=u.filter((e=>!(null==e?void 0:e.errorMessage)&&(1===e.progress||void 0===e.progress))).length,r=u.filter((e=>"number"==typeof e.progress&&e.progress<1)).length,t=u.filter((e=>e.errorMessage)).length;if(0===e&&0===r&&0===t)return"File list";const i=[e>0?`${e} completed files`:"",r>0?`${r} file in progress`:"",t>0?`${t} ${t>1?"files":"file"} with error`:""].filter(Boolean);return`${N?"Read-only file list":"File list"}. ${i.join(", ")}`},ce=()=>{const r=((e,r)=>{if(!e||0===e.length)return[];const t=[];for(const i of e)if("edit"===r[i.id]){const e=t[t.length-1];Array.isArray(e)?e.push(i):t.push([i])}else t.push(i);return t})(u,z);return 0===r.length?null:r.map(((r,t)=>Array.isArray(r)?((r,t)=>{const i=r.map((r=>{const t=Object.assign({},r);return void 0!==Q.current[r.id]&&(t.description=Q.current[r.id]),e(I,{fileItem:t,wrapperWidth:J,fileDescriptionMaxLength:A,descriptionRequired:L,descriptionLabel:C,onSave:Y(r),onCancel:_(r),onBlur:Z(r)},r.id)}));return e("li",{className:k,children:e("ul",{children:i})},`editable-${t}`)})(r,t):e(O,{fileItem:r,editable:se(r),wrapperWidth:J,sortable:de(),disabled:F,readOnly:N,descriptionLabel:C,onDelete:re(r),onEditClick:ee(r)},r.id)))},pe=()=>r(t,{children:[e(j,{"aria-live":"polite","aria-atomic":"true",children:T}),e("ul",{tabIndex:-1,className:f(D,N&&S),ref:P,"aria-label":ae(),children:ce()})]});return F||N||!de()?pe():e(o,{sensors:V,onDragEnd:te,onDragStart:ie,children:e(d,{items:u,strategy:a,children:pe()})})}));export{w as FileList};
|
|
2
2
|
//# sourceMappingURL=file-list.js.map
|