@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.
Files changed (545) hide show
  1. package/accordion/accordion-item.styles_1j4eb32.css +2 -2
  2. package/accordion/accordion.d.ts +19 -0
  3. package/accordion/accordion.js.map +1 -1
  4. package/accordion/accordion.styles_bzrfrs.css +2 -2
  5. package/accordion/types.d.ts +42 -2
  6. package/alert/alert.d.ts +8 -0
  7. package/alert/alert.js.map +1 -1
  8. package/alert/alert.styles_patwo2.css +2 -2
  9. package/alert/types.d.ts +26 -2
  10. package/animations/loading-dots/loading-dots.styles_1rgrrmw.css +2 -2
  11. package/animations/loading-dots/lottie-animation.styles_1m15v69.css +1 -1
  12. package/animations/loading-dots-spinner/loading-dots-spinner.styles_1hcqkhs.css +2 -2
  13. package/animations/loading-dots-spinner/lottie-animation.styles_13d1unb.css +1 -1
  14. package/animations/loading-spinner/loading-spinner.styles_n6xoft.css +2 -2
  15. package/animations/loading-spinner/lottie-animation.styles_bnn4qt.css +1 -1
  16. package/avatar/avatar.d.ts +7 -0
  17. package/avatar/avatar.js.map +1 -1
  18. package/avatar/avatar.styles_16efw4.css +2 -2
  19. package/avatar/types.d.ts +11 -0
  20. package/badge/badge.d.ts +7 -0
  21. package/badge/badge.js.map +1 -1
  22. package/badge/badge.styles_1c3c6wj.css +2 -2
  23. package/badge/types.d.ts +20 -0
  24. package/box-container/box-container.d.ts +8 -0
  25. package/box-container/box-container.js.map +1 -1
  26. package/box-container/box-container.styles_5t2j9k.css +2 -2
  27. package/box-container/types.d.ts +24 -0
  28. package/breadcrumb/breadcrumb.styles_1nl4aua.css +2 -2
  29. package/button/button.styles_1pxy0co.css +2 -2
  30. package/calendar/calendar.styles_11ho5x8.css +2 -2
  31. package/card/card.styles_1gh9gs3.css +2 -2
  32. package/checkbox/checkbox.styles_gm5bu1.css +2 -2
  33. package/cjs/accordion/accordion-item.styles_1j4eb32.css +2 -2
  34. package/cjs/accordion/accordion.js.map +1 -1
  35. package/cjs/accordion/accordion.styles_bzrfrs.css +2 -2
  36. package/cjs/alert/alert.js.map +1 -1
  37. package/cjs/alert/alert.styles_patwo2.css +2 -2
  38. package/cjs/animations/loading-dots/loading-dots.styles_1rgrrmw.css +2 -2
  39. package/cjs/animations/loading-dots/lottie-animation.styles_1m15v69.css +1 -1
  40. package/cjs/animations/loading-dots-spinner/loading-dots-spinner.styles_1hcqkhs.css +2 -2
  41. package/cjs/animations/loading-dots-spinner/lottie-animation.styles_13d1unb.css +1 -1
  42. package/cjs/animations/loading-spinner/loading-spinner.styles_n6xoft.css +2 -2
  43. package/cjs/animations/loading-spinner/lottie-animation.styles_bnn4qt.css +1 -1
  44. package/cjs/avatar/avatar.js.map +1 -1
  45. package/cjs/avatar/avatar.styles_16efw4.css +2 -2
  46. package/cjs/badge/badge.js.map +1 -1
  47. package/cjs/badge/badge.styles_1c3c6wj.css +2 -2
  48. package/cjs/box-container/box-container.js.map +1 -1
  49. package/cjs/box-container/box-container.styles_5t2j9k.css +2 -2
  50. package/cjs/breadcrumb/breadcrumb.styles_1nl4aua.css +2 -2
  51. package/cjs/button/button.styles_1pxy0co.css +2 -2
  52. package/cjs/calendar/calendar.styles_11ho5x8.css +2 -2
  53. package/cjs/card/card.styles_1gh9gs3.css +2 -2
  54. package/cjs/checkbox/checkbox.styles_gm5bu1.css +2 -2
  55. package/cjs/countdown-timer/countdown-timer.js.map +1 -1
  56. package/cjs/countdown-timer/countdown-timer.styles_ipn1b0.css +2 -2
  57. package/cjs/dashed-border/dashed-border.js.map +1 -1
  58. package/cjs/dashed-border/dashed-border.styles_zszoox.css +2 -2
  59. package/cjs/data-table/data-table.js.map +1 -1
  60. package/cjs/data-table/data-table.styles_1iqq1g7.css +2 -2
  61. package/cjs/date-input/date-input.js.map +1 -1
  62. package/cjs/date-input/date-input.styles_1r5kcc7.css +1 -1
  63. package/cjs/date-navigator/date-navigator.js.map +1 -1
  64. package/cjs/date-navigator/date-navigator.styles_wokh56.css +2 -2
  65. package/cjs/date-range-input/date-range-input.js.map +1 -1
  66. package/cjs/date-range-input/date-range-input.styles_1s7ojnj.css +2 -2
  67. package/cjs/divider/divider.js.map +1 -1
  68. package/cjs/divider/divider.styles_1xpzh8p.css +2 -2
  69. package/cjs/drawer/drawer.js.map +1 -1
  70. package/cjs/drawer/drawer.styles_94hx3y.css +2 -2
  71. package/cjs/e-signature/e-signature-canvas.js +1 -1
  72. package/cjs/e-signature/e-signature-canvas.js.map +1 -1
  73. package/cjs/e-signature/e-signature.js.map +1 -1
  74. package/cjs/e-signature/e-signature.styles_lukd9f.css +2 -2
  75. package/cjs/error-display/error-display.js.map +1 -1
  76. package/cjs/error-display/error-display.styles_d3tql1.css +2 -2
  77. package/cjs/external/dompurify/dist/purify.es.js +3 -3
  78. package/cjs/external/dompurify/dist/purify.es.js.map +1 -1
  79. package/cjs/feedback-rating/feedback-rating-stars-container.styles_dmi8z9.css +2 -2
  80. package/cjs/feedback-rating/feedback-rating.js.map +1 -1
  81. package/cjs/feedback-rating/feedback-rating.styles_1kdklb6.css +2 -2
  82. package/cjs/file-download/file-download.js.map +1 -1
  83. package/cjs/file-download/file-download.styles_iggk8q.css +2 -2
  84. package/cjs/file-download/file-list-card/file-list-card.styles.js +1 -1
  85. package/cjs/file-download/file-list-card/file-list-card.styles.js.map +1 -1
  86. package/cjs/file-download/file-list-card/{file-list-card.styles_oom8ii.css → file-list-card.styles_18j2gut.css} +3 -3
  87. package/cjs/file-upload/dropzone.styles_1pllsau.css +2 -2
  88. package/cjs/file-upload/file-item-edit.js +1 -1
  89. package/cjs/file-upload/file-item-edit.js.map +1 -1
  90. package/cjs/file-upload/file-item-edit.styles.js +1 -1
  91. package/cjs/file-upload/file-item-edit.styles.js.map +1 -1
  92. package/cjs/file-upload/{file-item-edit.styles_1qbpbxj.css → file-item-edit.styles_19bvztn.css} +6 -5
  93. package/cjs/file-upload/file-list/file-list.js +1 -1
  94. package/cjs/file-upload/file-list/file-list.js.map +1 -1
  95. package/cjs/file-upload/file-list/file-list.styles.js +1 -1
  96. package/cjs/file-upload/file-list/file-list.styles.js.map +1 -1
  97. package/cjs/file-upload/file-list/file-list.styles_1w7so98.css +3 -0
  98. package/cjs/file-upload/file-list-item/file-list-item-thumbnail.styles_1y4si19.css +2 -2
  99. package/cjs/file-upload/file-list-item/file-list-item.js +1 -1
  100. package/cjs/file-upload/file-list-item/file-list-item.js.map +1 -1
  101. package/cjs/file-upload/file-list-item/file-list-item.styles.js +1 -1
  102. package/cjs/file-upload/file-list-item/file-list-item.styles.js.map +1 -1
  103. package/cjs/file-upload/file-list-item/file-list-item.styles_o8000f.css +17 -0
  104. package/cjs/file-upload/file-upload.js +1 -1
  105. package/cjs/file-upload/file-upload.js.map +1 -1
  106. package/cjs/file-upload/file-upload.styles_9ffwcd.css +2 -2
  107. package/cjs/filter/addons/filter-item-checkbox.styles_7degw7.css +2 -2
  108. package/cjs/filter/filter-item-page.styles_17ewfrz.css +1 -1
  109. package/cjs/filter/filter-item.js.map +1 -1
  110. package/cjs/filter/filter-item.styles_cphjnj.css +2 -2
  111. package/cjs/filter/filter-modal.styles_qw3xlg.css +2 -2
  112. package/cjs/filter/filter-sidebar.styles_1otwpjl.css +2 -2
  113. package/cjs/filter/filter.js.map +1 -1
  114. package/cjs/filter/filter.styles_1ykijwm.css +2 -2
  115. package/cjs/footer/footer-download-app.styles_1v1j2us.css +2 -2
  116. package/cjs/footer/footer-resource-addon.styles_1jepb1d.css +2 -2
  117. package/cjs/footer/footer.js +1 -1
  118. package/cjs/footer/footer.js.map +1 -1
  119. package/cjs/footer/footer.styles_1msorhc.css +2 -2
  120. package/cjs/form/form-label-addon.styles_b00z8p.css +1 -1
  121. package/cjs/form/form-label.styles.js +1 -1
  122. package/cjs/form/form-label.styles.js.map +1 -1
  123. package/cjs/form/{form-label.styles_11r0652.css → form-label.styles_1nbe0bm.css} +2 -2
  124. package/cjs/form/form-textarea.styles_3p9qoy.css +2 -2
  125. package/cjs/form/form-wrapper.styles_199rslu.css +1 -1
  126. package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.styles_vc6y5c.css +2 -2
  127. package/cjs/fullscreen-image-carousel/stateful-image.styles_1xe8ypm.css +2 -2
  128. package/cjs/histogram-slider/histogram-slider.styles_wvd4w.css +2 -2
  129. package/cjs/image-button/image-button.styles_6n1qsr.css +2 -2
  130. package/cjs/index.js +1 -1
  131. package/cjs/input/input.styles_1cblor0.css +2 -2
  132. package/cjs/input-group/input-group-list-addon.styles_17iuqtw.css +2 -2
  133. package/cjs/input-group/input-group.styles_bqye6f.css +2 -2
  134. package/cjs/input-range-select/input-range-select.styles_adbrbm.css +2 -2
  135. package/cjs/input-range-slider/input-range-slider.styles_aljl2v.css +2 -2
  136. package/cjs/input-textarea/textarea-counter.styles_1n3wsnv.css +1 -1
  137. package/cjs/input-textarea/textarea.styles_22z4n3.css +2 -2
  138. package/cjs/language-switcher/dropdown-panel.styles_1qsjf8d.css +2 -2
  139. package/cjs/language-switcher/dropdown-variant.styles_1vrdfky.css +2 -2
  140. package/cjs/language-switcher/link-container-variant.styles_1iw6zux.css +2 -2
  141. package/cjs/layout/col-div.styles_16o6mwx.css +1 -1
  142. package/cjs/layout/container.styles_v70ec6.css +2 -2
  143. package/cjs/layout/section.styles_hstcaf.css +1 -1
  144. package/cjs/link-list/link-list.styles_m57vks.css +2 -2
  145. package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles_uhd4xl.css +2 -2
  146. package/cjs/local-nav/local-nav-menu/local-nav-menu.styles_pq19dh.css +2 -2
  147. package/cjs/markup/markup.style_1iu40x9.css +2 -2
  148. package/cjs/masked-input/masked-input.styles_1cm388a.css +2 -2
  149. package/cjs/masthead/masthead.styles_1huzon9.css +2 -2
  150. package/cjs/menu/menu-content.styles_p7ijll.css +2 -2
  151. package/cjs/menu/menu-item.styles_liyed8.css +2 -2
  152. package/cjs/menu/menu-link.styles_hfxoez.css +2 -2
  153. package/cjs/menu/menu-section.styles_g7my4d.css +2 -2
  154. package/cjs/modal/modal-box.styles_y52cts.css +2 -2
  155. package/cjs/modal/modal.styles_1lbblx6.css +2 -2
  156. package/cjs/modal-v2/modal-v2.styles_a8gv5i.css +2 -2
  157. package/cjs/modal-v2/slots/slot-styles_13sd376.css +2 -2
  158. package/cjs/navbar/brand.styles_zcgddp.css +1 -1
  159. package/cjs/navbar/drawer.js +1 -1
  160. package/cjs/navbar/drawer.js.map +1 -1
  161. package/cjs/navbar/drawer.styles_7hnxp5.css +2 -2
  162. package/cjs/navbar/menu.styles_gdpqc.css +2 -2
  163. package/cjs/navbar/navbar-action-buttons.styles_1vpm0nk.css +2 -2
  164. package/cjs/navbar/navbar-items.styles_1i3ltot.css +2 -2
  165. package/cjs/navbar/navbar.js +1 -1
  166. package/cjs/navbar/navbar.js.map +1 -1
  167. package/cjs/navbar/navbar.styles_koy0c7.css +2 -2
  168. package/cjs/notification-banner/notification-banner.styles_uxlysy.css +2 -2
  169. package/cjs/otp-input/otp-input.styles_5sbutl.css +2 -2
  170. package/cjs/otp-verification/contact-input-section.styles_odrjvt.css +2 -2
  171. package/cjs/otp-verification/otp-verification.styles_dg9bm8.css +1 -1
  172. package/cjs/otp-verification/thumbnail/thumbnail.styles_shqylh.css +2 -2
  173. package/cjs/otp-verification/verification-section.styles_x8jj.css +2 -2
  174. package/cjs/overlay/overlay.js +1 -1
  175. package/cjs/overlay/overlay.js.map +1 -1
  176. package/cjs/overlay/overlay.styles_12wym18.css +2 -2
  177. package/cjs/pagination/pagination.styles_6bcgva.css +2 -2
  178. package/cjs/pill/pill.styles_xwrniu.css +2 -2
  179. package/cjs/popover/popover-inline/popover-inline.styles_bkopnt.css +2 -2
  180. package/cjs/popover/popover-trigger.styles_8zokig.css +1 -1
  181. package/cjs/popover/popover.styles_ujnf0h.css +2 -2
  182. package/cjs/progress-indicator/progress-indicator.styles_1c038s4.css +2 -2
  183. package/cjs/radio-button/radio-button.styles_1c4v6v.css +2 -2
  184. package/cjs/schedule/schedule-day-view/schedule-day-view.styles_8ti149.css +2 -2
  185. package/cjs/schedule/schedule-header/schedule-header.js +1 -1
  186. package/cjs/schedule/schedule-header/schedule-header.js.map +1 -1
  187. package/cjs/schedule/schedule-header/schedule-header.styles_1n2u5vj.css +2 -2
  188. package/cjs/schedule/schedule-week-view/schedule-week-view.styles_x7x50m.css +2 -2
  189. package/cjs/schedule/schedule-week-view/time-cell.styles_1sorjz8.css +2 -2
  190. package/cjs/schedule/schedule.styles_fdy5a1.css +2 -2
  191. package/cjs/schedule/shared/with-optional-popover.styles_7mv3p2.css +1 -1
  192. package/cjs/schedule/time-indicator/time-indicator.styles_1eaxyes.css +2 -2
  193. package/cjs/select-histogram/select-histogram.styles_n260dy.css +2 -2
  194. package/cjs/shared/accessibility/index_13g9vp.css +1 -1
  195. package/cjs/shared/clickable-icon/clickable-icon.styles_1v2imml.css +2 -2
  196. package/cjs/shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css +2 -2
  197. package/cjs/shared/dropdown-list/dropdown-label.styles_mloii0.css +2 -2
  198. package/cjs/shared/dropdown-list/dropdown-list.styles_konwm.css +2 -2
  199. package/cjs/shared/dropdown-list/dropdown-search.styles_1hc1gkh.css +2 -2
  200. package/cjs/shared/dropdown-list/expandable-element.styles_rkkvqr.css +2 -2
  201. package/cjs/shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css +2 -2
  202. package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles_15hwwoj.css +2 -2
  203. package/cjs/shared/fade-wrapper/fade-wrapper.styles_16iug7l.css +2 -2
  204. package/cjs/shared/image-placeholder/image-placeholder.styles_44nwil.css +1 -1
  205. package/cjs/shared/input-wrapper/input-wrapper.styles_je6maw.css +2 -2
  206. package/cjs/shared/internal-calendar/calendar-dropdown.styles_wybjai.css +1 -1
  207. package/cjs/shared/internal-calendar/calendar-manager.js +1 -1
  208. package/cjs/shared/internal-calendar/calendar-manager.js.map +1 -1
  209. package/cjs/shared/internal-calendar/calendar-manager.styles.js +1 -1
  210. package/cjs/shared/internal-calendar/calendar-manager.styles.js.map +1 -1
  211. package/cjs/shared/internal-calendar/{calendar-manager.styles_1iuq5zw.css → calendar-manager.styles_1njwkj2.css} +3 -3
  212. package/cjs/shared/internal-calendar/day-cell/day-cell.styles_1t5oqc1.css +2 -2
  213. package/cjs/shared/internal-calendar/internal-calendar-month.styles_14oh57f.css +2 -2
  214. package/cjs/shared/internal-calendar/internal-calendar-year.styles_therlc.css +2 -2
  215. package/cjs/shared/internal-calendar/internal-calendar.styles_gnc3eq.css +1 -1
  216. package/cjs/shared/internal-calendar/standard/standard-calendar-day-view.styles_1bw26au.css +2 -2
  217. package/cjs/shared/progress-bar/progress-bar.styles_125ri7a.css +1 -1
  218. package/cjs/shared/range-input-inner-container/range-input-inner-container.styles_1v61utg.css +2 -2
  219. package/cjs/shared/standalone-date-input/standalone-date-input.styles_157qo89.css +2 -2
  220. package/cjs/shared/time-slot/time-slot.styles_18s0to7.css +2 -2
  221. package/cjs/shared/timepicker-dropdown/timepicker-dropdown.styles_119l6k6.css +2 -2
  222. package/cjs/sidenav/sidenav-drawer-item.styles_1ljnyx2.css +2 -2
  223. package/cjs/sidenav/sidenav-drawer-subitem.styles_2y58kf.css +1 -1
  224. package/cjs/sidenav/sidenav-group.styles_1x604sw.css +2 -2
  225. package/cjs/sidenav/sidenav-item.styles_lqw3kh.css +2 -2
  226. package/cjs/sidenav/sidenav.styles_1vxezie.css +2 -2
  227. package/cjs/singpass-button/singpass-button.styles_1miyex3.css +2 -2
  228. package/cjs/smart-app-banner/smart-app-banner.styles_15u6yv4.css +2 -2
  229. package/cjs/tab/tab-link-chain.styles_49got4.css +2 -2
  230. package/cjs/tab/tab.styles_1najffw.css +1 -1
  231. package/cjs/table/table.styles_1af5ipv.css +2 -2
  232. package/cjs/tag/tag.style_d98c53.css +2 -2
  233. package/cjs/text-list/text-list.styles_w3fvyt.css +2 -2
  234. package/cjs/theme/types.js +1 -1
  235. package/cjs/theme/types.js.map +1 -1
  236. package/cjs/theme/utils/use-design-token-override.js +2 -0
  237. package/cjs/theme/utils/use-design-token-override.js.map +1 -0
  238. package/cjs/time-range-picker/combobox-picker/combobox-picker.styles_7i9vso.css +1 -1
  239. package/cjs/time-range-picker/common.styles_1qwp4xa.css +2 -2
  240. package/cjs/time-slot-bar/time-slot-bar.styles_wigbyd.css +2 -2
  241. package/cjs/time-slot-bar-week/time-slot-bar-week-days.styles_evdvs9.css +2 -2
  242. package/cjs/time-slot-bar-week/time-slot-bar-week.styles_11ybf42.css +1 -1
  243. package/cjs/time-slot-week-view/time-slot-week-days.styles_1h21vyw.css +2 -2
  244. package/cjs/time-slot-week-view/time-slot-week-view.styles_gqgsw2.css +1 -1
  245. package/cjs/timeline/timeline.styles_1jxzik4.css +2 -2
  246. package/cjs/timepicker/timepicker.styles_1jm33yw.css +1 -1
  247. package/cjs/timetable/timetable-header/timetable-header.styles_11gl1h4.css +2 -2
  248. package/cjs/timetable/timetable-row/row-bar.styles_1x0vrsz.css +1 -1
  249. package/cjs/timetable/timetable-row/row-cell.styles_y1dl5j.css +2 -2
  250. package/cjs/timetable/timetable.styles_7rp8kz.css +2 -2
  251. package/cjs/toast/toast.styles_1e0l60w.css +2 -2
  252. package/cjs/toggle/toggle-icon.styles_ba71y.css +2 -2
  253. package/cjs/toggle/toggle.styles_1t5qrye.css +2 -2
  254. package/cjs/typography/typography-text.styles_1734x2k.css +2 -2
  255. package/cjs/typography/typography.styles.js +1 -1
  256. package/cjs/typography/typography.styles.js.map +1 -1
  257. package/cjs/typography/{typography.styles_1155j4c.css → typography.styles_1wd82dn.css} +2 -2
  258. package/cjs/uneditable-section/section-item.styles_mwx8ht.css +2 -2
  259. package/cjs/uneditable-section/uneditable-section.js +1 -1
  260. package/cjs/uneditable-section/uneditable-section.js.map +1 -1
  261. package/cjs/uneditable-section/uneditable-section.styles_aj9zun.css +2 -2
  262. package/cjs/unit-number/unit-number-input.styles_8yizj.css +2 -2
  263. package/countdown-timer/countdown-timer.d.ts +6 -0
  264. package/countdown-timer/countdown-timer.js.map +1 -1
  265. package/countdown-timer/countdown-timer.styles_ipn1b0.css +2 -2
  266. package/countdown-timer/types.d.ts +55 -11
  267. package/dashed-border/dashed-border.d.ts +6 -0
  268. package/dashed-border/dashed-border.js.map +1 -1
  269. package/dashed-border/dashed-border.styles_zszoox.css +2 -2
  270. package/dashed-border/types.d.ts +27 -5
  271. package/data-table/data-table.d.ts +8 -0
  272. package/data-table/data-table.js.map +1 -1
  273. package/data-table/data-table.styles_1iqq1g7.css +2 -2
  274. package/data-table/types.d.ts +58 -12
  275. package/date-input/date-input.d.ts +5 -0
  276. package/date-input/date-input.js.map +1 -1
  277. package/date-input/date-input.styles_1r5kcc7.css +1 -1
  278. package/date-input/types.d.ts +32 -16
  279. package/date-navigator/date-navigator.d.ts +6 -0
  280. package/date-navigator/date-navigator.js.map +1 -1
  281. package/date-navigator/date-navigator.styles_wokh56.css +2 -2
  282. package/date-navigator/types.d.ts +44 -7
  283. package/date-range-input/date-range-input.d.ts +4 -0
  284. package/date-range-input/date-range-input.js.map +1 -1
  285. package/date-range-input/date-range-input.styles_1s7ojnj.css +2 -2
  286. package/date-range-input/types.d.ts +50 -14
  287. package/divider/divider.d.ts +6 -0
  288. package/divider/divider.js.map +1 -1
  289. package/divider/divider.styles_1xpzh8p.css +2 -2
  290. package/divider/types.d.ts +27 -4
  291. package/drawer/drawer.d.ts +7 -0
  292. package/drawer/drawer.js.map +1 -1
  293. package/drawer/drawer.styles_94hx3y.css +2 -2
  294. package/drawer/types.d.ts +16 -4
  295. package/e-signature/e-signature-canvas.js +1 -1
  296. package/e-signature/e-signature-canvas.js.map +1 -1
  297. package/e-signature/e-signature.d.ts +5 -0
  298. package/e-signature/e-signature.js.map +1 -1
  299. package/e-signature/e-signature.styles_lukd9f.css +2 -2
  300. package/e-signature/types.d.ts +23 -1
  301. package/error-display/error-display.d.ts +7 -0
  302. package/error-display/error-display.js.map +1 -1
  303. package/error-display/error-display.styles_d3tql1.css +2 -2
  304. package/error-display/types.d.ts +36 -6
  305. package/external/dompurify/dist/purify.es.js +2 -2
  306. package/external/dompurify/dist/purify.es.js.map +1 -1
  307. package/feedback-rating/feedback-rating-stars-container.styles_dmi8z9.css +2 -2
  308. package/feedback-rating/feedback-rating.d.ts +6 -0
  309. package/feedback-rating/feedback-rating.js.map +1 -1
  310. package/feedback-rating/feedback-rating.styles_1kdklb6.css +2 -2
  311. package/feedback-rating/types.d.ts +29 -0
  312. package/file-download/file-download.d.ts +6 -0
  313. package/file-download/file-download.js.map +1 -1
  314. package/file-download/file-download.styles_iggk8q.css +2 -2
  315. package/file-download/file-list-card/file-list-card.styles.js +1 -1
  316. package/file-download/file-list-card/file-list-card.styles.js.map +1 -1
  317. package/file-download/file-list-card/{file-list-card.styles_oom8ii.css → file-list-card.styles_18j2gut.css} +3 -3
  318. package/file-download/types.d.ts +44 -11
  319. package/file-upload/dropzone.styles_1pllsau.css +2 -2
  320. package/file-upload/file-item-edit.d.ts +4 -1
  321. package/file-upload/file-item-edit.js +1 -1
  322. package/file-upload/file-item-edit.js.map +1 -1
  323. package/file-upload/file-item-edit.styles.d.ts +1 -0
  324. package/file-upload/file-item-edit.styles.js +1 -1
  325. package/file-upload/file-item-edit.styles.js.map +1 -1
  326. package/file-upload/{file-item-edit.styles_1qbpbxj.css → file-item-edit.styles_19bvztn.css} +6 -5
  327. package/file-upload/file-list/file-list.d.ts +3 -0
  328. package/file-upload/file-list/file-list.js +1 -1
  329. package/file-upload/file-list/file-list.js.map +1 -1
  330. package/file-upload/file-list/file-list.styles.js +1 -1
  331. package/file-upload/file-list/file-list.styles.js.map +1 -1
  332. package/file-upload/file-list/file-list.styles_1w7so98.css +3 -0
  333. package/file-upload/file-list-item/file-list-item-thumbnail.styles_1y4si19.css +2 -2
  334. package/file-upload/file-list-item/file-list-item.d.ts +3 -1
  335. package/file-upload/file-list-item/file-list-item.js +1 -1
  336. package/file-upload/file-list-item/file-list-item.js.map +1 -1
  337. package/file-upload/file-list-item/file-list-item.styles.d.ts +3 -0
  338. package/file-upload/file-list-item/file-list-item.styles.js +1 -1
  339. package/file-upload/file-list-item/file-list-item.styles.js.map +1 -1
  340. package/file-upload/file-list-item/file-list-item.styles_o8000f.css +17 -0
  341. package/file-upload/file-upload.d.ts +2 -1
  342. package/file-upload/file-upload.js +1 -1
  343. package/file-upload/file-upload.js.map +1 -1
  344. package/file-upload/file-upload.styles_9ffwcd.css +2 -2
  345. package/file-upload/types.d.ts +125 -20
  346. package/filter/addons/filter-item-checkbox.styles_7degw7.css +2 -2
  347. package/filter/filter-item-page.styles_17ewfrz.css +1 -1
  348. package/filter/filter-item.js.map +1 -1
  349. package/filter/filter-item.styles_cphjnj.css +2 -2
  350. package/filter/filter-modal.styles_qw3xlg.css +2 -2
  351. package/filter/filter-sidebar.styles_1otwpjl.css +2 -2
  352. package/filter/filter.d.ts +21 -0
  353. package/filter/filter.js.map +1 -1
  354. package/filter/filter.styles_1ykijwm.css +2 -2
  355. package/filter/types.d.ts +161 -21
  356. package/footer/footer-download-app.styles_1v1j2us.css +2 -2
  357. package/footer/footer-resource-addon.styles_1jepb1d.css +2 -2
  358. package/footer/footer.d.ts +8 -1
  359. package/footer/footer.js +1 -1
  360. package/footer/footer.js.map +1 -1
  361. package/footer/footer.styles_1msorhc.css +2 -2
  362. package/footer/types.d.ts +55 -4
  363. package/form/form-label-addon.styles_b00z8p.css +1 -1
  364. package/form/form-label.styles.js +1 -1
  365. package/form/form-label.styles.js.map +1 -1
  366. package/form/{form-label.styles_11r0652.css → form-label.styles_1nbe0bm.css} +2 -2
  367. package/form/form-textarea.styles_3p9qoy.css +2 -2
  368. package/form/form-wrapper.styles_199rslu.css +1 -1
  369. package/fullscreen-image-carousel/fullscreen-image-carousel.styles_vc6y5c.css +2 -2
  370. package/fullscreen-image-carousel/stateful-image.styles_1xe8ypm.css +2 -2
  371. package/histogram-slider/histogram-slider.styles_wvd4w.css +2 -2
  372. package/image-button/image-button.styles_6n1qsr.css +2 -2
  373. package/index.d.ts +0 -1
  374. package/index.js +1 -1
  375. package/input/input.styles_1cblor0.css +2 -2
  376. package/input-group/input-group-list-addon.styles_17iuqtw.css +2 -2
  377. package/input-group/input-group.styles_bqye6f.css +2 -2
  378. package/input-range-select/input-range-select.styles_adbrbm.css +2 -2
  379. package/input-range-slider/input-range-slider.styles_aljl2v.css +2 -2
  380. package/input-textarea/textarea-counter.styles_1n3wsnv.css +1 -1
  381. package/input-textarea/textarea.styles_22z4n3.css +2 -2
  382. package/language-switcher/dropdown-panel.styles_1qsjf8d.css +2 -2
  383. package/language-switcher/dropdown-variant.styles_1vrdfky.css +2 -2
  384. package/language-switcher/link-container-variant.styles_1iw6zux.css +2 -2
  385. package/layout/col-div.styles_16o6mwx.css +1 -1
  386. package/layout/container.styles_v70ec6.css +2 -2
  387. package/layout/section.styles_hstcaf.css +1 -1
  388. package/link-list/link-list.styles_m57vks.css +2 -2
  389. package/local-nav/local-nav-dropdown/local-nav-dropdown.styles_uhd4xl.css +2 -2
  390. package/local-nav/local-nav-menu/local-nav-menu.styles_pq19dh.css +2 -2
  391. package/markup/markup.style_1iu40x9.css +2 -2
  392. package/masked-input/masked-input.styles_1cm388a.css +2 -2
  393. package/masthead/masthead.styles_1huzon9.css +2 -2
  394. package/menu/menu-content.styles_p7ijll.css +2 -2
  395. package/menu/menu-item.styles_liyed8.css +2 -2
  396. package/menu/menu-link.styles_hfxoez.css +2 -2
  397. package/menu/menu-section.styles_g7my4d.css +2 -2
  398. package/modal/modal-box.styles_y52cts.css +2 -2
  399. package/modal/modal.styles_1lbblx6.css +2 -2
  400. package/modal-v2/modal-v2.styles_a8gv5i.css +2 -2
  401. package/modal-v2/slots/slot-styles_13sd376.css +2 -2
  402. package/navbar/brand.styles_zcgddp.css +1 -1
  403. package/navbar/drawer.js +1 -1
  404. package/navbar/drawer.js.map +1 -1
  405. package/navbar/drawer.styles_7hnxp5.css +2 -2
  406. package/navbar/menu.styles_gdpqc.css +2 -2
  407. package/navbar/navbar-action-buttons.styles_1vpm0nk.css +2 -2
  408. package/navbar/navbar-items.styles_1i3ltot.css +2 -2
  409. package/navbar/navbar.js +1 -1
  410. package/navbar/navbar.js.map +1 -1
  411. package/navbar/navbar.styles_koy0c7.css +2 -2
  412. package/notification-banner/notification-banner.styles_uxlysy.css +2 -2
  413. package/otp-input/otp-input.styles_5sbutl.css +2 -2
  414. package/otp-verification/contact-input-section.styles_odrjvt.css +2 -2
  415. package/otp-verification/otp-verification.styles_dg9bm8.css +1 -1
  416. package/otp-verification/thumbnail/thumbnail.styles_shqylh.css +2 -2
  417. package/otp-verification/verification-section.styles_x8jj.css +2 -2
  418. package/overlay/overlay.js +1 -1
  419. package/overlay/overlay.js.map +1 -1
  420. package/overlay/overlay.styles_12wym18.css +2 -2
  421. package/overlay/types.d.ts +0 -13
  422. package/package.json +1 -7
  423. package/pagination/pagination.styles_6bcgva.css +2 -2
  424. package/pill/pill.styles_xwrniu.css +2 -2
  425. package/popover/popover-inline/popover-inline.styles_bkopnt.css +2 -2
  426. package/popover/popover-trigger.styles_8zokig.css +1 -1
  427. package/popover/popover.styles_ujnf0h.css +2 -2
  428. package/progress-indicator/progress-indicator.styles_1c038s4.css +2 -2
  429. package/radio-button/radio-button.styles_1c4v6v.css +2 -2
  430. package/schedule/schedule-day-view/schedule-day-view.styles_8ti149.css +2 -2
  431. package/schedule/schedule-header/schedule-header.js +1 -1
  432. package/schedule/schedule-header/schedule-header.js.map +1 -1
  433. package/schedule/schedule-header/schedule-header.styles_1n2u5vj.css +2 -2
  434. package/schedule/schedule-week-view/schedule-week-view.styles_x7x50m.css +2 -2
  435. package/schedule/schedule-week-view/time-cell.styles_1sorjz8.css +2 -2
  436. package/schedule/schedule.styles_fdy5a1.css +2 -2
  437. package/schedule/shared/with-optional-popover.styles_7mv3p2.css +1 -1
  438. package/schedule/time-indicator/time-indicator.styles_1eaxyes.css +2 -2
  439. package/select-histogram/select-histogram.styles_n260dy.css +2 -2
  440. package/shared/accessibility/index_13g9vp.css +1 -1
  441. package/shared/clickable-icon/clickable-icon.styles_1v2imml.css +2 -2
  442. package/shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css +2 -2
  443. package/shared/dropdown-list/dropdown-label.styles_mloii0.css +2 -2
  444. package/shared/dropdown-list/dropdown-list.styles_konwm.css +2 -2
  445. package/shared/dropdown-list/dropdown-search.styles_1hc1gkh.css +2 -2
  446. package/shared/dropdown-list/expandable-element.styles_rkkvqr.css +2 -2
  447. package/shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css +2 -2
  448. package/shared/dropdown-wrapper/dropdown-wrapper.styles_15hwwoj.css +2 -2
  449. package/shared/fade-wrapper/fade-wrapper.styles_16iug7l.css +2 -2
  450. package/shared/image-placeholder/image-placeholder.styles_44nwil.css +1 -1
  451. package/shared/input-wrapper/input-wrapper.styles_je6maw.css +2 -2
  452. package/shared/internal-calendar/calendar-dropdown.styles_wybjai.css +1 -1
  453. package/shared/internal-calendar/calendar-manager.js +1 -1
  454. package/shared/internal-calendar/calendar-manager.js.map +1 -1
  455. package/shared/internal-calendar/calendar-manager.styles.js +1 -1
  456. package/shared/internal-calendar/calendar-manager.styles.js.map +1 -1
  457. package/shared/internal-calendar/{calendar-manager.styles_1iuq5zw.css → calendar-manager.styles_1njwkj2.css} +3 -3
  458. package/shared/internal-calendar/day-cell/day-cell.styles_1t5oqc1.css +2 -2
  459. package/shared/internal-calendar/internal-calendar-month.styles_14oh57f.css +2 -2
  460. package/shared/internal-calendar/internal-calendar-year.styles_therlc.css +2 -2
  461. package/shared/internal-calendar/internal-calendar.styles_gnc3eq.css +1 -1
  462. package/shared/internal-calendar/standard/standard-calendar-day-view.styles_1bw26au.css +2 -2
  463. package/shared/progress-bar/progress-bar.styles_125ri7a.css +1 -1
  464. package/shared/range-input-inner-container/range-input-inner-container.styles_1v61utg.css +2 -2
  465. package/shared/standalone-date-input/standalone-date-input.styles_157qo89.css +2 -2
  466. package/shared/time-slot/time-slot.styles_18s0to7.css +2 -2
  467. package/shared/timepicker-dropdown/timepicker-dropdown.styles_119l6k6.css +2 -2
  468. package/sidenav/sidenav-drawer-item.styles_1ljnyx2.css +2 -2
  469. package/sidenav/sidenav-drawer-subitem.styles_2y58kf.css +1 -1
  470. package/sidenav/sidenav-group.styles_1x604sw.css +2 -2
  471. package/sidenav/sidenav-item.styles_lqw3kh.css +2 -2
  472. package/sidenav/sidenav.styles_1vxezie.css +2 -2
  473. package/singpass-button/singpass-button.styles_1miyex3.css +2 -2
  474. package/smart-app-banner/smart-app-banner.styles_15u6yv4.css +2 -2
  475. package/tab/tab-link-chain.styles_49got4.css +2 -2
  476. package/tab/tab.styles_1najffw.css +1 -1
  477. package/table/table.styles_1af5ipv.css +2 -2
  478. package/tag/tag.style_d98c53.css +2 -2
  479. package/text-list/text-list.styles_w3fvyt.css +2 -2
  480. package/theme/styles/a11y-playground.css +3 -0
  481. package/theme/styles/bookingsg.css +7 -4
  482. package/theme/styles/careercompass.css +4 -1
  483. package/theme/styles/ccube.css +3 -0
  484. package/theme/styles/default.css +9 -5
  485. package/theme/styles/imda.css +3 -0
  486. package/theme/styles/lifesg.css +3 -0
  487. package/theme/styles/mylegacy.css +7 -4
  488. package/theme/styles/oneservice.css +52 -0
  489. package/theme/styles/pa.css +3 -0
  490. package/theme/styles/rbs.css +3 -0
  491. package/theme/styles/sgw-digital-lobby.css +5 -2
  492. package/theme/styles/smgs.css +3 -0
  493. package/theme/styles/spf.css +3 -0
  494. package/theme/styles/supportgowhere.css +3 -0
  495. package/theme/types.d.ts +1 -1
  496. package/theme/types.js +1 -1
  497. package/theme/types.js.map +1 -1
  498. package/theme/utils/index.d.ts +1 -0
  499. package/theme/utils/use-design-token-override.d.ts +11 -0
  500. package/theme/utils/use-design-token-override.js +2 -0
  501. package/theme/utils/use-design-token-override.js.map +1 -0
  502. package/time-range-picker/combobox-picker/combobox-picker.styles_7i9vso.css +1 -1
  503. package/time-range-picker/common.styles_1qwp4xa.css +2 -2
  504. package/time-slot-bar/time-slot-bar.styles_wigbyd.css +2 -2
  505. package/time-slot-bar-week/time-slot-bar-week-days.styles_evdvs9.css +2 -2
  506. package/time-slot-bar-week/time-slot-bar-week.styles_11ybf42.css +1 -1
  507. package/time-slot-week-view/time-slot-week-days.styles_1h21vyw.css +2 -2
  508. package/time-slot-week-view/time-slot-week-view.styles_gqgsw2.css +1 -1
  509. package/timeline/timeline.styles_1jxzik4.css +2 -2
  510. package/timepicker/timepicker.styles_1jm33yw.css +1 -1
  511. package/timetable/timetable-header/timetable-header.styles_11gl1h4.css +2 -2
  512. package/timetable/timetable-row/row-bar.styles_1x0vrsz.css +1 -1
  513. package/timetable/timetable-row/row-cell.styles_y1dl5j.css +2 -2
  514. package/timetable/timetable.styles_7rp8kz.css +2 -2
  515. package/toast/toast.styles_1e0l60w.css +2 -2
  516. package/toggle/toggle-icon.styles_ba71y.css +2 -2
  517. package/toggle/toggle.styles_1t5qrye.css +2 -2
  518. package/typography/typography-text.styles_1734x2k.css +2 -2
  519. package/typography/typography.styles.js +1 -1
  520. package/typography/typography.styles.js.map +1 -1
  521. package/typography/{typography.styles_1155j4c.css → typography.styles_1wd82dn.css} +2 -2
  522. package/uneditable-section/index.d.ts +1 -1
  523. package/uneditable-section/section-item.styles_mwx8ht.css +2 -2
  524. package/uneditable-section/uneditable-section.d.ts +2 -1
  525. package/uneditable-section/uneditable-section.js +1 -1
  526. package/uneditable-section/uneditable-section.js.map +1 -1
  527. package/uneditable-section/uneditable-section.styles_aj9zun.css +2 -2
  528. package/unit-number/unit-number-input.styles_8yizj.css +2 -2
  529. package/cjs/example/example.js +0 -2
  530. package/cjs/example/example.js.map +0 -1
  531. package/cjs/example/example_r47nvz.css +0 -1
  532. package/cjs/example/index.js +0 -2
  533. package/cjs/example/index.js.map +0 -1
  534. package/cjs/file-upload/file-list/file-list.styles_1ea12kj.css +0 -3
  535. package/cjs/file-upload/file-list-item/file-list-item.styles_y7my2m.css +0 -14
  536. package/example/example.d.ts +0 -2
  537. package/example/example.js +0 -2
  538. package/example/example.js.map +0 -1
  539. package/example/example_r47nvz.css +0 -1
  540. package/example/index.d.ts +0 -1
  541. package/example/index.js +0 -2
  542. package/example/index.js.map +0 -1
  543. package/example/types.d.ts +0 -3
  544. package/file-upload/file-list/file-list.styles_1ea12kj.css +0 -3
  545. package/file-upload/file-list-item/file-list-item.styles_y7my2m.css +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"file-list-item.js","sources":["../../../../src/file-upload/file-list-item/file-list-item.tsx"],"sourcesContent":["import { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { BinIcon } from \"@lifesg/react-icons/bin\";\nimport { DragHandleIcon as DSDragHandleIcon } from \"@lifesg/react-icons/drag-handle\";\nimport { ExclamationCircleFillIcon } from \"@lifesg/react-icons/exclamation-circle-fill\";\nimport { PencilIcon } from \"@lifesg/react-icons/pencil\";\nimport {\n memo,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { Button } from \"../../button\";\nimport { ProgressBar } from \"../../shared/progress-bar\";\nimport { Typography } from \"../../typography\";\nimport { StringHelper } from \"../../util\";\nimport { FileUploadContext } from \"../context\";\nimport { FileUploadHelper } from \"../helper\";\nimport type { ItemFocusType } from \"./file-list-item.styles\";\nimport * as styles from \"./file-list-item.styles\";\nimport { FileListItemThumbnail } from \"./file-list-item-thumbnail\";\nimport type { FileListItemProps } from \"./types\";\n\ninterface Props extends FileListItemProps {\n readOnly?: boolean | undefined;\n}\n\nconst Component = ({\n fileItem,\n editable,\n sortable,\n wrapperWidth,\n disabled,\n readOnly,\n onDelete,\n onEditClick,\n}: Props) => {\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const {\n id,\n name,\n size,\n description,\n progress = 1,\n errorMessage,\n thumbnailImageDataUrl,\n truncateText = true,\n } = fileItem;\n const [formattedName, setFormattedName] = useState<string>();\n const { activeId } = useContext(FileUploadContext);\n\n // Sortable mechanism\n const { attributes, listeners, setNodeRef, transform, transition } =\n useSortable({ id });\n const detailSectionRef = useRef<HTMLDivElement>(null);\n const style = {\n transform: CSS.Translate.toString(transform),\n transition,\n };\n\n const sortableProps = {\n style,\n ...attributes,\n ...listeners,\n };\n\n // Local variables\n const isLoading = progress < 1;\n const fileSize = FileUploadHelper.formatFileSizeDisplay(size);\n const focusType: ItemFocusType = activeId\n ? activeId === id\n ? \"self\"\n : \"others\"\n : \"none\";\n\n // =========================================================================\n // HELPER FUNCTIONS\n // =========================================================================\n const getTruncatedText = useCallback(\n (value: string) => {\n if (!truncateText) return value;\n\n const widthOfElement =\n detailSectionRef && detailSectionRef.current\n ? detailSectionRef.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 // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleDelete = () => {\n onDelete();\n };\n\n const handleEdit = () => {\n if (onEditClick) {\n onEditClick();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n /**\n * Circumvent issue of keydown action activating the sort mechanism\n * rather than the actual action\n */\n if (sortable) {\n event.stopPropagation();\n }\n };\n\n const shouldDisable = () => disabled || !!activeId;\n\n const shouldEnableSort = () => !!sortable && !readOnly;\n\n const getItemState = () => {\n if (shouldDisable() && focusType === \"none\") {\n return \"disabled\";\n }\n\n if (shouldEnableSort() && focusType === \"self\") {\n return \"sortable-active\";\n }\n\n if (shouldEnableSort()) {\n return \"sortable\";\n }\n\n return undefined;\n };\n\n const getDragHandleState = () => {\n if (focusType === \"self\") {\n return \"active\";\n }\n\n if (shouldDisable()) {\n return \"disabled\";\n }\n\n return undefined;\n };\n\n const getBoxState = () => {\n if (focusType === \"self\") {\n return \"focused\";\n }\n\n if (shouldDisable()) {\n return \"disabled\";\n }\n\n if (errorMessage) {\n return \"error\";\n }\n\n return undefined;\n };\n\n const getActionContainerLayout = () => {\n if (!errorMessage && isLoading) {\n return \"loading\";\n }\n\n if (!errorMessage && editable) {\n return \"editable\";\n }\n\n return undefined;\n };\n\n // =========================================================================\n // RENDER FUNCTIONS\n // =========================================================================\n const renderNameDescription = () => (\n <>\n <Typography.BodyMD weight={description ? \"semibold\" : \"regular\"}>\n {formattedName}\n </Typography.BodyMD>\n {description && (\n <Typography.BodyMD className={styles.itemDescriptionText}>\n {description}\n </Typography.BodyMD>\n )}\n </>\n );\n\n const renderErrorState = () => (\n <>\n <div ref={detailSectionRef} className={styles.nameSection}>\n {renderNameDescription()}\n {errorMessage && (\n <Typography.BodySM\n className={styles.desktopErrorMessage}\n weight=\"semibold\"\n >\n <ExclamationCircleFillIcon\n className={styles.errorIcon}\n aria-hidden\n />\n {errorMessage}\n </Typography.BodySM>\n )}\n </div>\n <div\n className={styles.fileSizeSection}\n data-mobile-visibility={isLoading ? \"hidden\" : \"expand\"}\n >\n <Typography.BodyMD className={styles.fileSizeText}>\n {fileSize}\n </Typography.BodyMD>\n </div>\n {errorMessage && (\n <Typography.BodySM\n className={styles.mobileErrorMessage}\n weight=\"semibold\"\n >\n <ExclamationCircleFillIcon\n className={styles.errorIcon}\n aria-hidden\n />\n {errorMessage}\n </Typography.BodySM>\n )}\n </>\n );\n\n const renderWithThumbnail = (thumbnailImageDataUrl: string) => (\n <>\n <FileListItemThumbnail\n thumbnailImageDataUrl={thumbnailImageDataUrl}\n fileType={fileItem.type}\n data-testid={`${id}-thumbnail`}\n />\n <div className={styles.extendedNameSection}>\n <div ref={detailSectionRef} className={styles.nameSection}>\n {renderNameDescription()}\n </div>\n <div\n className={styles.fileSizeSection}\n data-mobile-visibility={isLoading ? \"hidden\" : \"expand\"}\n >\n <Typography.BodyMD className={styles.fileSizeText}>\n {fileSize}\n </Typography.BodyMD>\n </div>\n </div>\n </>\n );\n\n const renderDefault = () => (\n <>\n <div ref={detailSectionRef} className={styles.nameSection}>\n {renderNameDescription()}\n </div>\n <div\n className={styles.fileSizeSection}\n data-mobile-visibility={isLoading ? \"hidden\" : \"expand\"}\n >\n <Typography.BodyMD className={styles.fileSizeText}>\n {fileSize}\n </Typography.BodyMD>\n </div>\n </>\n );\n\n const renderContents = () => {\n let content: JSX.Element;\n const shouldShowThumbnail =\n !!thumbnailImageDataUrl ||\n fileItem.type === FileUploadHelper.PDF_MIME_TYPE;\n\n if (errorMessage) {\n content = renderErrorState();\n } else if (shouldShowThumbnail) {\n content = renderWithThumbnail(thumbnailImageDataUrl || \"\");\n } else {\n content = renderDefault();\n }\n\n return (\n <div\n className={styles.contentSection}\n data-has-thumbnail={shouldShowThumbnail}\n >\n {content}\n </div>\n );\n };\n\n const renderActions = () => {\n let content: JSX.Element;\n\n if (errorMessage) {\n content = (\n <Button\n data-testid={`${id}-error-delete-button`}\n data-no-dnd=\"true\"\n type=\"button\"\n styleType=\"light\"\n sizeType=\"small\"\n aria-label={`delete ${name}, error: ${errorMessage}`}\n onClick={handleDelete}\n className={styles.iconButton}\n icon={<BinIcon aria-hidden />}\n />\n );\n } else if (isLoading) {\n content = (\n <ProgressBar\n progress={progress}\n data-testid={`${id}-progress-bar`}\n />\n );\n } else {\n content = (\n <>\n {editable && (\n <Button\n key=\"edit\"\n data-testid={`${id}-edit-button`}\n data-no-dnd=\"true\"\n type=\"button\"\n styleType=\"light\"\n sizeType=\"small\"\n aria-label={`edit ${name}`}\n disabled={shouldDisable()}\n onClick={handleEdit}\n onKeyDown={handleKeyDown}\n icon={<PencilIcon aria-hidden />}\n className={styles.iconButton}\n />\n )}\n <Button\n key=\"delete\"\n data-testid={`${id}-delete-button`}\n data-no-dnd=\"true\"\n type=\"button\"\n styleType=\"light\"\n sizeType=\"small\"\n aria-label={`delete ${name}`}\n disabled={shouldDisable()}\n onClick={handleDelete}\n onKeyDown={handleKeyDown}\n icon={<BinIcon aria-hidden />}\n className={styles.iconButton}\n />\n </>\n );\n }\n\n return (\n <div\n className={styles.actionContainer}\n data-mobile-layout={getActionContainerLayout()}\n >\n {content}\n </div>\n );\n };\n\n return (\n <li\n id={id}\n ref={setNodeRef}\n className={styles.item}\n data-item-state={getItemState()}\n data-testid={`${id}-item`}\n {...(shouldEnableSort() ? sortableProps : {})}\n >\n {shouldEnableSort() && (\n <DSDragHandleIcon\n data-testid={`${id}-drag-handle`}\n className={styles.dragHandleIcon}\n data-drag-handle-state={getDragHandleState()}\n />\n )}\n <div\n className={styles.box}\n data-box-state={getBoxState()}\n data-stack-mobile={!errorMessage && (isLoading || editable)}\n >\n {renderContents()}\n {!readOnly && renderActions()}\n </div>\n </li>\n );\n};\n\nexport const FileListItem = memo(Component);\n"],"names":["FileListItem","memo","fileItem","editable","sortable","wrapperWidth","disabled","readOnly","onDelete","onEditClick","id","name","size","description","progress","errorMessage","thumbnailImageDataUrl","truncateText","formattedName","setFormattedName","useState","activeId","useContext","FileUploadContext","attributes","listeners","setNodeRef","transform","transition","useSortable","detailSectionRef","useRef","style","CSS","Translate","toString","sortableProps","isLoading","fileSize","FileUploadHelper","formatFileSizeDisplay","focusType","getTruncatedText","useCallback","value","widthOfElement","current","getBoundingClientRect","width","StringHelper","truncateOneLine","useEffect","handleDelete","handleEdit","handleKeyDown","event","stopPropagation","shouldDisable","shouldEnableSort","renderNameDescription","_jsxs","_Fragment","children","_jsx","Typography","BodyMD","weight","className","styles.itemDescriptionText","Object","assign","ref","styles.item","DSDragHandleIcon","styles.dragHandleIcon","styles.box","content","shouldShowThumbnail","type","PDF_MIME_TYPE","styles.nameSection","BodySM","styles.desktopErrorMessage","ExclamationCircleFillIcon","styles.errorIcon","styles.fileSizeSection","styles.fileSizeText","styles.mobileErrorMessage","FileListItemThumbnail","fileType","styles.extendedNameSection","renderWithThumbnail","styles.contentSection","renderContents","Button","styleType","sizeType","onClick","styles.iconButton","icon","BinIcon","ProgressBar","onKeyDown","PencilIcon","styles.actionContainer","renderActions"],"mappings":"k2BA8BA,MA6XaA,EAAeC,EAAAA,MA7XV,EACdC,WACAC,WACAC,WACAC,eACAC,WACAC,WACAC,WACAC,kBAKA,MAAMC,GACFA,EAAEC,KACFA,EAAIC,KACJA,EAAIC,YACJA,EAAWC,SACXA,EAAW,EAACC,aACZA,EAAYC,sBACZA,EAAqBC,aACrBA,GAAe,GACff,GACGgB,EAAeC,GAAoBC,cACpCC,SAAEA,GAAaC,EAAAA,WAAWC,sBAG1BC,WAAEA,EAAUC,UAAEA,EAASC,WAAEA,EAAUC,UAAEA,EAASC,WAAEA,GAClDC,EAAAA,YAAY,CAAEnB,OACZoB,EAAmBC,EAAAA,OAAuB,MAC1CC,EAAQ,CACVL,UAAWM,EAAAA,IAAIC,UAAUC,SAASR,GAClCC,cAGEQ,+BACFJ,SACGR,GACAC,GAIDY,EAAYvB,EAAW,EACvBwB,EAAWC,EAAAA,iBAAiBC,sBAAsB5B,GAClD6B,EAA2BpB,EAC3BA,IAAaX,EACT,OACA,SACJ,OAKAgC,EAAmBC,eACpBC,IACG,IAAK3B,EAAc,OAAO2B,EAE1B,MAAMC,EACFf,GAAoBA,EAAiBgB,QAC/BhB,EAAiBgB,QAAQC,wBAAwBC,MACjD,EAEV,OAAOC,EAAAA,aAAaC,gBAChBN,EACAC,EACAA,EAAiB,EACjBA,EAAiB,EAAI,EACrB,GACH,GAEL,CAAC5B,IAMLkC,EAAAA,WAAU,KACNhC,EAAiBuB,EAAiB/B,GAAM,GACzC,CAACN,EAAcqC,EAAkB/B,IAKpC,MAAMyC,EAAe,KACjB5C,GAAU,EAGR6C,EAAa,KACX5C,GACAA,GACJ,EAGE6C,EAAiBC,IAKfnD,GACAmD,EAAMC,iBACV,EAGEC,EAAgB,IAAMnD,KAAce,EAEpCqC,EAAmB,MAAQtD,IAAaG,EA6DxCoD,EAAwB,IAC1BC,EAAAA,KAAAC,E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,UAAW+B,EAAAA,WACXC,KAAMpC,EAAAA,IAACqC,UAAO,CAAA,eAAA,MAGf/D,EAEH0B,EAAAA,IAACsC,eACGvF,SAAUA,EAAQ,cACL,GAAGJ,mBAKpBkD,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACK3D,GACG4D,EAAAA,IAAC+B,EAAAA,OAAM,CAAA,cAEU,GAAGpF,8BACJ,OACZoE,KAAK,SACLiB,UAAU,QACVC,SAAS,QAAO,aACJ,QAAQrF,IACpBL,SAAUmD,IACVwC,QAAS5C,EACTiD,UAAWhD,EACX6C,KAAMpC,MAACwC,EAAAA,WAAU,CAAA,eAAA,IACjBpC,UAAW+B,EAAAA,YAXP,QAcZnC,EAAAA,IAAC+B,EAAAA,OAAM,CAAA,cAEU,GAAGpF,kBAAkB,cACtB,OACZoE,KAAK,SACLiB,UAAU,QACVC,SAAS,QAAO,aACJ,UAAUrF,IACtBL,SAAUmD,IACVwC,QAAS7C,EACTkD,UAAWhD,EACX6C,KAAMpC,EAAAA,IAACqC,EAAAA,QAAO,CAAA,eAAA,IACdjC,UAAW+B,EAAAA,YAXP,aAkBhBnC,EAAAA,IAAA,MAAA,CACII,UAAWqC,EAAAA,gBAAsB,sBAjMpCzF,GAAgBsB,EACV,WAGNtB,GAAgBZ,EACV,gBADX,EA8LsD2D,SAE7Cc,GACC,EA0BY6B,SAEjB"}
1
+ {"version":3,"file":"file-list-item.js","sources":["../../../../src/file-upload/file-list-item/file-list-item.tsx"],"sourcesContent":["import { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { BinIcon } from \"@lifesg/react-icons/bin\";\nimport { DragHandleIcon as DSDragHandleIcon } from \"@lifesg/react-icons/drag-handle\";\nimport { ExclamationCircleFillIcon } from \"@lifesg/react-icons/exclamation-circle-fill\";\nimport { PencilIcon } from \"@lifesg/react-icons/pencil\";\nimport {\n memo,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { Button } from \"../../button\";\nimport type { FormLabelProps } from \"../../form/types\";\nimport { ProgressBar } from \"../../shared/progress-bar\";\nimport { Typography } from \"../../typography\";\nimport { StringHelper } from \"../../util\";\nimport { FileUploadContext } from \"../context\";\nimport { FileUploadHelper } from \"../helper\";\nimport type { ItemFocusType } from \"./file-list-item.styles\";\nimport * as styles from \"./file-list-item.styles\";\nimport { FileListItemThumbnail } from \"./file-list-item-thumbnail\";\nimport type { FileListItemProps } from \"./types\";\n\ninterface Props extends FileListItemProps {\n readOnly?: boolean | undefined;\n descriptionLabel?: FormLabelProps | undefined;\n}\n\nconst Component = ({\n fileItem,\n editable,\n sortable,\n wrapperWidth,\n disabled,\n readOnly,\n descriptionLabel,\n onDelete,\n onEditClick,\n}: Props) => {\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const {\n id,\n name,\n size,\n description,\n progress = 1,\n errorMessage,\n thumbnailImageDataUrl,\n truncateText = true,\n } = fileItem;\n const [formattedName, setFormattedName] = useState<string>();\n const { activeId } = useContext(FileUploadContext);\n\n // Sortable mechanism\n const { attributes, listeners, setNodeRef, transform, transition } =\n useSortable({ id });\n const detailSectionRef = useRef<HTMLDivElement>(null);\n const style = {\n transform: CSS.Translate.toString(transform),\n transition,\n };\n\n const sortableProps = {\n style,\n ...attributes,\n ...listeners,\n };\n\n // Local variables\n const isLoading = progress < 1;\n const fileSize = FileUploadHelper.formatFileSizeDisplay(size);\n const hasInlineActions = !!description && !!editable;\n const focusType: ItemFocusType = activeId\n ? activeId === id\n ? \"self\"\n : \"others\"\n : \"none\";\n\n // =========================================================================\n // HELPER FUNCTIONS\n // =========================================================================\n const getTruncatedText = useCallback(\n (value: string) => {\n if (!truncateText) return value;\n\n const widthOfElement =\n detailSectionRef && detailSectionRef.current\n ? detailSectionRef.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 // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleDelete = () => {\n onDelete();\n };\n\n const handleEdit = () => {\n if (onEditClick) {\n onEditClick();\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n /**\n * Circumvent issue of keydown action activating the sort mechanism\n * rather than the actual action\n */\n if (sortable) {\n event.stopPropagation();\n }\n };\n\n const shouldDisable = () => disabled || !!activeId;\n\n const shouldEnableSort = () => !!sortable && !readOnly;\n\n const getItemState = () => {\n if (shouldDisable() && focusType === \"none\") {\n return \"disabled\";\n }\n\n if (shouldEnableSort() && focusType === \"self\") {\n return \"sortable-active\";\n }\n\n if (shouldEnableSort()) {\n return \"sortable\";\n }\n\n return undefined;\n };\n\n const getDragHandleState = () => {\n if (focusType === \"self\") {\n return \"active\";\n }\n\n if (shouldDisable()) {\n return \"disabled\";\n }\n\n return undefined;\n };\n\n const getBoxState = () => {\n if (focusType === \"self\") {\n return \"focused\";\n }\n\n if (shouldDisable()) {\n return \"disabled\";\n }\n\n if (errorMessage) {\n return \"error\";\n }\n\n return undefined;\n };\n\n const getActionContainerLayout = () => {\n if (!errorMessage && isLoading) {\n return \"loading\";\n }\n\n if (!errorMessage && editable) {\n return \"editable\";\n }\n\n return undefined;\n };\n\n // =========================================================================\n // RENDER FUNCTIONS\n // =========================================================================\n const renderNameDescription = () => (\n <>\n <Typography.BodyMD weight={description ? \"semibold\" : \"regular\"}>\n {formattedName}\n </Typography.BodyMD>\n {description && (\n <>\n <Typography.BodyMD className={styles.itemDescriptionLabel}>\n {descriptionLabel?.children ?? \"Photo description\"}\n </Typography.BodyMD>\n <Typography.BodyMD className={styles.itemDescriptionText}>\n {description}\n </Typography.BodyMD>\n </>\n )}\n </>\n );\n\n const renderErrorState = () => (\n <>\n <div ref={detailSectionRef} className={styles.nameSection}>\n {renderNameDescription()}\n {errorMessage && (\n <Typography.BodySM\n className={styles.desktopErrorMessage}\n weight=\"semibold\"\n >\n <ExclamationCircleFillIcon\n className={styles.errorIcon}\n aria-hidden\n />\n {errorMessage}\n </Typography.BodySM>\n )}\n </div>\n <div\n className={styles.fileSizeSection}\n data-mobile-visibility={isLoading ? \"hidden\" : \"expand\"}\n >\n <Typography.BodyMD className={styles.fileSizeText}>\n {fileSize}\n </Typography.BodyMD>\n </div>\n {errorMessage && (\n <Typography.BodySM\n className={styles.mobileErrorMessage}\n weight=\"semibold\"\n >\n <ExclamationCircleFillIcon\n className={styles.errorIcon}\n aria-hidden\n />\n {errorMessage}\n </Typography.BodySM>\n )}\n </>\n );\n\n const renderInlineActions = () => (\n <div className={styles.inlineActionContainer}>\n <Button\n key=\"edit\"\n data-testid={`${id}-edit-button`}\n data-no-dnd=\"true\"\n type=\"button\"\n styleType=\"light\"\n sizeType=\"small\"\n aria-label={`edit ${name}`}\n disabled={shouldDisable()}\n onClick={handleEdit}\n onKeyDown={handleKeyDown}\n icon={<PencilIcon aria-hidden />}\n className={styles.iconButton}\n />\n <Button\n key=\"delete\"\n data-testid={`${id}-delete-button`}\n data-no-dnd=\"true\"\n type=\"button\"\n styleType=\"light\"\n sizeType=\"small\"\n aria-label={`delete ${name}`}\n disabled={shouldDisable()}\n onClick={handleDelete}\n onKeyDown={handleKeyDown}\n icon={<BinIcon aria-hidden />}\n className={styles.iconButton}\n />\n </div>\n );\n\n const renderDescriptionContent = () => (\n <div ref={detailSectionRef} className={styles.extendedNameSection}>\n <Typography.BodyMD weight=\"semibold\">\n {formattedName}\n </Typography.BodyMD>\n <Typography.BodyMD className={styles.itemDescriptionLabel}>\n {descriptionLabel?.children ?? \"Photo description\"}\n </Typography.BodyMD>\n <Typography.BodyMD className={styles.itemDescriptionText}>\n {description}\n </Typography.BodyMD>\n <Typography.BodyMD className={styles.descriptionFileSizeText}>\n {fileSize}\n </Typography.BodyMD>\n {!readOnly && hasInlineActions && renderInlineActions()}\n </div>\n );\n\n const renderFileContent = (thumbnailImageDataUrl?: string) => {\n const shouldShowThumbnail =\n !!thumbnailImageDataUrl ||\n fileItem.type === FileUploadHelper.PDF_MIME_TYPE;\n\n const thumbnail = shouldShowThumbnail ? (\n <FileListItemThumbnail\n thumbnailImageDataUrl={thumbnailImageDataUrl || \"\"}\n fileType={fileItem.type}\n data-testid={`${id}-thumbnail`}\n />\n ) : null;\n\n if (hasInlineActions) {\n return (\n <>\n {thumbnail}\n {renderDescriptionContent()}\n </>\n );\n }\n\n return (\n <>\n {thumbnail}\n <div ref={detailSectionRef} className={styles.nameSection}>\n {renderNameDescription()}\n {!isLoading && (\n <Typography.BodyMD\n className={styles.descriptionFileSizeText}\n >\n {fileSize}\n </Typography.BodyMD>\n )}\n </div>\n </>\n );\n };\n\n const renderContents = () => {\n const shouldShowThumbnail =\n !!thumbnailImageDataUrl ||\n fileItem.type === FileUploadHelper.PDF_MIME_TYPE;\n\n const content = errorMessage\n ? renderErrorState()\n : renderFileContent(thumbnailImageDataUrl);\n\n return (\n <div\n className={styles.contentSection}\n data-has-thumbnail={shouldShowThumbnail}\n >\n {content}\n </div>\n );\n };\n\n const renderActions = () => {\n let content: JSX.Element;\n\n if (errorMessage) {\n content = (\n <Button\n data-testid={`${id}-error-delete-button`}\n data-no-dnd=\"true\"\n type=\"button\"\n styleType=\"light\"\n sizeType=\"small\"\n aria-label={`delete ${name}, error: ${errorMessage}`}\n onClick={handleDelete}\n className={styles.iconButton}\n icon={<BinIcon aria-hidden />}\n />\n );\n } else if (isLoading) {\n content = (\n <ProgressBar\n progress={progress}\n data-testid={`${id}-progress-bar`}\n />\n );\n } else {\n content = (\n <>\n {editable && (\n <Button\n key=\"edit\"\n data-testid={`${id}-edit-button`}\n data-no-dnd=\"true\"\n type=\"button\"\n styleType=\"light\"\n sizeType=\"small\"\n aria-label={`edit ${name}`}\n disabled={shouldDisable()}\n onClick={handleEdit}\n onKeyDown={handleKeyDown}\n icon={<PencilIcon aria-hidden />}\n className={styles.iconButton}\n />\n )}\n <Button\n key=\"delete\"\n data-testid={`${id}-delete-button`}\n data-no-dnd=\"true\"\n type=\"button\"\n styleType=\"light\"\n sizeType=\"small\"\n aria-label={`delete ${name}`}\n disabled={shouldDisable()}\n onClick={handleDelete}\n onKeyDown={handleKeyDown}\n icon={<BinIcon aria-hidden />}\n className={styles.iconButton}\n />\n </>\n );\n }\n\n return (\n <div\n className={styles.actionContainer}\n data-mobile-layout={getActionContainerLayout()}\n >\n {content}\n </div>\n );\n };\n\n return (\n <li\n id={id}\n ref={setNodeRef}\n className={styles.item}\n data-item-state={getItemState()}\n data-testid={`${id}-item`}\n {...(shouldEnableSort() ? sortableProps : {})}\n >\n {shouldEnableSort() && (\n <DSDragHandleIcon\n data-testid={`${id}-drag-handle`}\n className={styles.dragHandleIcon}\n data-drag-handle-state={getDragHandleState()}\n />\n )}\n <div\n className={styles.box}\n data-box-state={getBoxState()}\n data-stack-mobile={!errorMessage && (isLoading || editable)}\n >\n {renderContents()}\n {!readOnly && !hasInlineActions && renderActions()}\n </div>\n </li>\n );\n};\n\nexport const FileListItem = memo(Component);\n"],"names":["FileListItem","memo","fileItem","editable","sortable","wrapperWidth","disabled","readOnly","descriptionLabel","onDelete","onEditClick","id","name","size","description","progress","errorMessage","thumbnailImageDataUrl","truncateText","formattedName","setFormattedName","useState","activeId","useContext","FileUploadContext","attributes","listeners","setNodeRef","transform","transition","useSortable","detailSectionRef","useRef","style","CSS","Translate","toString","sortableProps","isLoading","fileSize","FileUploadHelper","formatFileSizeDisplay","hasInlineActions","focusType","getTruncatedText","useCallback","value","widthOfElement","current","getBoundingClientRect","width","StringHelper","truncateOneLine","useEffect","handleDelete","handleEdit","handleKeyDown","event","stopPropagation","shouldDisable","shouldEnableSort","renderNameDescription","_jsxs","_Fragment","children","_jsx","Typography","BodyMD","weight","className","styles.itemDescriptionLabel","_a","styles.itemDescriptionText","Object","assign","ref","styles.item","DSDragHandleIcon","styles.dragHandleIcon","styles.box","shouldShowThumbnail","type","PDF_MIME_TYPE","content","styles.nameSection","BodySM","styles.desktopErrorMessage","ExclamationCircleFillIcon","styles.errorIcon","styles.fileSizeSection","styles.fileSizeText","styles.mobileErrorMessage","thumbnail","FileListItemThumbnail","fileType","styles.extendedNameSection","styles.descriptionFileSizeText","styles.inlineActionContainer","Button","styleType","sizeType","onClick","onKeyDown","icon","PencilIcon","styles.iconButton","BinIcon","renderFileContent","styles.contentSection","renderContents","ProgressBar","styles.actionContainer","renderActions"],"mappings":"k2BAgCA,MAkbaA,EAAeC,EAAAA,MAlbV,EACdC,WACAC,WACAC,WACAC,eACAC,WACAC,WACAC,mBACAC,WACAC,kBAKA,MAAMC,GACFA,EAAEC,KACFA,EAAIC,KACJA,EAAIC,YACJA,EAAWC,SACXA,EAAW,EAACC,aACZA,EAAYC,sBACZA,EAAqBC,aACrBA,GAAe,GACfhB,GACGiB,EAAeC,GAAoBC,cACpCC,SAAEA,GAAaC,EAAAA,WAAWC,sBAG1BC,WAAEA,EAAUC,UAAEA,EAASC,WAAEA,EAAUC,UAAEA,EAASC,WAAEA,GAClDC,EAAAA,YAAY,CAAEnB,OACZoB,EAAmBC,EAAAA,OAAuB,MAC1CC,EAAQ,CACVL,UAAWM,EAAAA,IAAIC,UAAUC,SAASR,GAClCC,cAGEQ,+BACFJ,SACGR,GACAC,GAIDY,EAAYvB,EAAW,EACvBwB,EAAWC,EAAAA,iBAAiBC,sBAAsB5B,GAClD6B,IAAqB5B,KAAiBX,EACtCwC,EAA2BrB,EAC3BA,IAAaX,EACT,OACA,SACJ,OAKAiC,EAAmBC,eACpBC,IACG,IAAK5B,EAAc,OAAO4B,EAE1B,MAAMC,EACFhB,GAAoBA,EAAiBiB,QAC/BjB,EAAiBiB,QAAQC,wBAAwBC,MACjD,EAEV,OAAOC,EAAAA,aAAaC,gBAChBN,EACAC,EACAA,EAAiB,EACjBA,EAAiB,EAAI,EACrB,GACH,G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5B,OACZsE,KAAK,SACLkB,UAAU,QACVC,SAAS,QAAO,aACJ,UAAUxF,aAAgBI,IACtCqF,QAAS/C,EACTe,UAAWoC,EAAAA,WACXF,KAAMtC,EAAAA,IAACyC,UAAO,CAAA,eAAA,MAGfpE,EAEH2B,EAAAA,IAAC6C,eACG/F,SAAUA,EAAQ,cACL,GAAGJ,mBAKpBmD,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACK7D,GACG8D,EAAAA,IAACiC,EAAAA,OAAM,CAAA,cAEU,GAAGvF,8BACJ,OACZsE,KAAK,SACLkB,UAAU,QACVC,SAAS,QAAO,aACJ,QAAQxF,IACpBN,SAAUqD,IACV0C,QAAS9C,EACT+C,UAAW9C,EACX+C,KAAMtC,MAACuC,EAAAA,WAAU,CAAA,eAAA,IACjBnC,UAAWoC,EAAAA,YAXP,QAcZxC,EAAAA,IAACiC,EAAAA,OAAM,CAAA,cAEU,GAAGvF,kBAAkB,cACtB,OACZsE,KAAK,SACLkB,UAAU,QACVC,SAAS,QAAO,aACJ,UAAUxF,IACtBN,SAAUqD,IACV0C,QAAS/C,EACTgD,UAAW9C,EACX+C,KAAMtC,EAAAA,IAACyC,EAAAA,QAAO,CAAA,eAAA,IACdrC,UAAWoC,EAAAA,YAXP,aAkBhBxC,EAAAA,IAAA,MAAA,CACII,UAAW0C,EAAAA,gBAAsB,sBApPpC/F,GAAgBsB,EACV,WAGNtB,GAAgBb,EACV,gBADX,EAiPsD6D,SAE7CmB,GACC,EA0BiC6B,SAEtC"}
@@ -1,2 +1,2 @@
1
- "use strict";require("./file-list-item.styles_y7my2m.css");exports.actionContainer="a1gk2zsk",exports.box="bddx9rr",exports.contentSection="c1dhzflv",exports.desktopErrorMessage="d1vgco4e",exports.dragHandleIcon="dqb8x5u",exports.errorIcon="e1jm950n",exports.extendedNameSection="elwke9e",exports.fileSizeSection="f14h64yt",exports.fileSizeText="f1wv8fjl",exports.iconButton="i1wh4bod",exports.item="i18pxk0j",exports.itemDescriptionText="iivlkvo",exports.mobileErrorMessage="map0p9n",exports.nameSection="nk38w4a";
1
+ "use strict";require("./file-list-item.styles_o8000f.css");exports.actionContainer="a3rvfgv",exports.box="bddx9rr",exports.contentSection="c1dhzflv",exports.descriptionFileSizeText="divlkvo",exports.desktopErrorMessage="d1gk2zsk",exports.dragHandleIcon="dqb8x5u",exports.errorIcon="eap0p9n",exports.extendedNameSection="elwke9e",exports.fileSizeSection="f14h64yt",exports.fileSizeText="f1wv8fjl",exports.iconButton="ilou5qo",exports.inlineActionContainer="i5ozu70",exports.item="i18pxk0j",exports.itemDescriptionLabel="i1jm950n",exports.itemDescriptionText="i1vgco4e",exports.mobileErrorMessage="m1wh4bod",exports.nameSection="nk38w4a";
2
2
  //# sourceMappingURL=file-list-item.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-list-item.styles.js","sources":["../../../../src/file-upload/file-list-item/file-list-item.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport {\n Border,\n Colour,\n MediaQuery,\n Radius,\n Shadow,\n Spacing,\n} from \"../../theme\";\n\nexport type ItemFocusType = \"self\" | \"others\" | \"none\";\n\nexport const item = css`\n display: flex;\n align-items: center;\n width: 100%;\n border: none;\n\n &:not(:last-child) {\n margin-bottom: ${Spacing[\"spacing-16\"]};\n }\n &[data-item-state=\"disabled\"] {\n cursor: not-allowed;\n }\n\n &[data-item-state=\"sortable\"] {\n &:hover {\n cursor: grab;\n }\n\n // Following recommendation by the library for touch events\n // https://docs.dndkit.com/api-documentation/sensors/touch#recommendations\n touch-action: manipulation;\n }\n\n &[data-item-state=\"sortable-active\"] {\n cursor: grabbing;\n\n // Following recommendation by the library for touch events\n // https://docs.dndkit.com/api-documentation/sensors/touch#recommendations\n touch-action: manipulation;\n }\n`;\n\nexport const dragHandleIcon = css`\n margin-right: ${Spacing[\"spacing-16\"]};\n height: 1.5rem;\n width: 1.5rem;\n color: ${Colour[\"icon\"]};\n\n &[data-drag-handle-state=\"active\"] {\n color: ${Colour[\"icon-primary\"]};\n }\n\n &[data-drag-handle-state=\"disabled\"] {\n color: ${Colour[\"icon-disabled\"]};\n }\n`;\n\nexport const box = css`\n background: ${Colour[\"bg-primary-subtlest\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n border-radius: ${Radius[\"sm\"]};\n padding: ${Spacing[\"spacing-16\"]} ${Spacing[\"spacing-32\"]};\n display: flex;\n align-items: center;\n width: 100%;\n\n ${MediaQuery.MaxWidth.md} {\n padding: ${Spacing[\"spacing-16\"]};\n }\n\n &[data-box-state=\"focused\"] {\n border-color: ${Colour[\"border-focus\"]};\n box-shadow: ${Shadow[\"xs-focus-strong\"]};\n }\n\n &[data-box-state=\"disabled\"] {\n border-color: ${Colour[\"border-disabled\"]};\n }\n\n &[data-box-state=\"error\"] {\n background: ${Colour[\"bg-error\"]};\n border-color: ${Colour[\"border-error\"]};\n }\n\n &[data-stack-mobile=\"true\"] {\n ${MediaQuery.MaxWidth.md} {\n flex-direction: column;\n align-items: flex-start;\n }\n }\n`;\n\nexport const contentSection = css`\n display: flex;\n flex: 1;\n align-items: center;\n\n ${MediaQuery.MaxWidth.md} {\n flex-direction: column;\n width: 100%;\n align-items: flex-start;\n }\n\n &[data-has-thumbnail=\"true\"] {\n ${MediaQuery.MaxWidth.md} {\n flex-direction: row;\n align-items: center;\n }\n }\n`;\n\nexport const nameSection = css`\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n`;\n\nexport const extendedNameSection = css`\n display: flex;\n flex: 1;\n align-items: center;\n\n ${MediaQuery.MaxWidth.md} {\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n }\n`;\n\nexport const fileSizeSection = css`\n display: flex;\n width: 5rem;\n margin-left: ${Spacing[\"spacing-8\"]};\n justify-content: flex-end;\n\n &[data-mobile-visibility=\"hidden\"] {\n ${MediaQuery.MaxWidth.md} {\n display: none;\n visibility: hidden;\n }\n }\n\n &[data-mobile-visibility=\"expand\"] {\n ${MediaQuery.MaxWidth.md} {\n width: 100%;\n margin-left: 0;\n margin-top: ${Spacing[\"spacing-8\"]};\n justify-content: flex-start;\n }\n }\n`;\n\nexport const fileSizeText = css`\n color: ${Colour[\"text-subtler\"]};\n`;\n\nexport const itemDescriptionText = css`\n margin-top: ${Spacing[\"spacing-4\"]};\n`;\n\nexport const errorIcon = css`\n height: 1lh;\n width: 1em;\n flex-shrink: 0;\n color: ${Colour[\"icon-error-strong\"]};\n`;\n\nexport const desktopErrorMessage = css`\n color: ${Colour[\"text-error\"]};\n margin-top: ${Spacing[\"spacing-4\"]};\n display: flex;\n gap: ${Spacing[\"spacing-4\"]};\n\n ${MediaQuery.MaxWidth.md} {\n display: none;\n visibility: hidden;\n }\n`;\n\nexport const mobileErrorMessage = css`\n color: ${Colour[\"text-error\"]};\n display: none;\n visibility: hidden;\n\n ${MediaQuery.MaxWidth.md} {\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 width: 6rem;\n margin-left: ${Spacing[\"spacing-32\"]};\n display: flex;\n justify-content: flex-end;\n align-items: center;\n\n ${MediaQuery.MaxWidth.md} {\n width: fit-content;\n }\n\n &[data-mobile-layout=\"loading\"] {\n ${MediaQuery.MaxWidth.md} {\n margin-left: 0;\n margin-top: ${Spacing[\"spacing-16\"]};\n width: 100%;\n }\n }\n\n &[data-mobile-layout=\"editable\"] {\n ${MediaQuery.MaxWidth.md} {\n margin-left: 0;\n margin-top: ${Spacing[\"spacing-16\"]};\n align-self: flex-end;\n }\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"],"names":[],"mappings":"6HAoM4B,uBAxIZ,iCAmCW,uCA4EK,kCA9HL,4BAuHL,uCA3CU,kCAYJ,gCAuBH,8BAoEF,wBAnNN,uCAmJe,qCAuBD,8BArEP"}
1
+ {"version":3,"file":"file-list-item.styles.js","sources":["../../../../src/file-upload/file-list-item/file-list-item.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport {\n Border,\n Colour,\n Font,\n MediaQuery,\n Radius,\n Shadow,\n Spacing,\n} from \"../../theme\";\n\nexport type ItemFocusType = \"self\" | \"others\" | \"none\";\n\nexport const item = css`\n display: flex;\n align-items: center;\n width: 100%;\n border: none;\n\n &:not(:last-child) {\n margin-bottom: ${Spacing[\"spacing-16\"]};\n }\n &[data-item-state=\"disabled\"] {\n cursor: not-allowed;\n }\n\n &[data-item-state=\"sortable\"] {\n &:hover {\n cursor: grab;\n }\n\n // Following recommendation by the library for touch events\n // https://docs.dndkit.com/api-documentation/sensors/touch#recommendations\n touch-action: manipulation;\n }\n\n &[data-item-state=\"sortable-active\"] {\n cursor: grabbing;\n\n // Following recommendation by the library for touch events\n // https://docs.dndkit.com/api-documentation/sensors/touch#recommendations\n touch-action: manipulation;\n }\n`;\n\nexport const dragHandleIcon = css`\n margin-right: ${Spacing[\"spacing-16\"]};\n height: 1.5rem;\n width: 1.5rem;\n color: ${Colour[\"icon\"]};\n\n &[data-drag-handle-state=\"active\"] {\n color: ${Colour[\"icon-primary\"]};\n }\n\n &[data-drag-handle-state=\"disabled\"] {\n color: ${Colour[\"icon-disabled\"]};\n }\n`;\n\nexport const box = css`\n background: ${Colour[\"bg-primary-subtlest\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n border-radius: ${Radius[\"sm\"]};\n padding: ${Spacing[\"spacing-16\"]} ${Spacing[\"spacing-32\"]};\n display: flex;\n align-items: center;\n width: 100%;\n\n ${MediaQuery.MaxWidth.md} {\n padding: ${Spacing[\"spacing-16\"]};\n }\n\n &[data-box-state=\"focused\"] {\n border-color: ${Colour[\"border-focus\"]};\n box-shadow: ${Shadow[\"xs-focus-strong\"]};\n }\n\n &[data-box-state=\"disabled\"] {\n border-color: ${Colour[\"border-disabled\"]};\n }\n\n &[data-box-state=\"error\"] {\n background: ${Colour[\"bg-error\"]};\n border-color: ${Colour[\"border-error\"]};\n }\n\n &[data-stack-mobile=\"true\"] {\n ${MediaQuery.MaxWidth.md} {\n flex-direction: column;\n align-items: flex-start;\n }\n }\n`;\n\nexport const contentSection = css`\n display: flex;\n flex: 1;\n align-items: center;\n\n ${MediaQuery.MaxWidth.md} {\n flex-direction: column;\n width: 100%;\n align-items: flex-start;\n }\n\n &[data-has-thumbnail=\"true\"] {\n ${MediaQuery.MaxWidth.md} {\n flex-direction: row;\n align-items: center;\n }\n }\n`;\n\nexport const nameSection = css`\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n`;\n\nexport const extendedNameSection = css`\n display: flex;\n flex: 1;\n flex-direction: column;\n align-items: flex-start;\n\n ${MediaQuery.MaxWidth.md} {\n width: 100%;\n }\n`;\n\nexport const fileSizeSection = css`\n display: flex;\n width: 5rem;\n margin-left: ${Spacing[\"spacing-8\"]};\n justify-content: flex-end;\n\n &[data-mobile-visibility=\"hidden\"] {\n ${MediaQuery.MaxWidth.md} {\n display: none;\n visibility: hidden;\n }\n }\n\n &[data-mobile-visibility=\"expand\"] {\n ${MediaQuery.MaxWidth.md} {\n width: 100%;\n margin-left: 0;\n margin-top: ${Spacing[\"spacing-8\"]};\n justify-content: flex-start;\n }\n }\n`;\n\nexport const fileSizeText = css`\n color: ${Colour[\"text-subtler\"]};\n`;\n\nexport const descriptionFileSizeText = css`\n color: ${Colour[\"text-subtler\"]};\n margin-top: ${Spacing[\"spacing-16\"]};\n`;\n\nexport const itemDescriptionLabel = css`\n ${Font[\"form-label\"]}\n font-weight: ${Font.Spec[\"weight-semibold\"]};\n color: ${Colour[\"text-subtle\"]};\n margin-top: ${Spacing[\"spacing-16\"]};\n`;\n\nexport const itemDescriptionText = css`\n margin-top: ${Spacing[\"spacing-4\"]};\n`;\n\nexport const errorIcon = css`\n height: 1lh;\n width: 1em;\n flex-shrink: 0;\n color: ${Colour[\"icon-error-strong\"]};\n`;\n\nexport const desktopErrorMessage = css`\n color: ${Colour[\"text-error\"]};\n margin-top: ${Spacing[\"spacing-4\"]};\n display: flex;\n gap: ${Spacing[\"spacing-4\"]};\n\n ${MediaQuery.MaxWidth.md} {\n display: none;\n visibility: hidden;\n }\n`;\n\nexport const mobileErrorMessage = css`\n color: ${Colour[\"text-error\"]};\n display: none;\n visibility: hidden;\n\n ${MediaQuery.MaxWidth.md} {\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 width: 6rem;\n margin-left: ${Spacing[\"spacing-32\"]};\n display: flex;\n justify-content: flex-end;\n align-items: center;\n\n ${MediaQuery.MaxWidth.md} {\n width: fit-content;\n }\n\n &[data-mobile-layout=\"loading\"] {\n ${MediaQuery.MaxWidth.md} {\n margin-left: 0;\n margin-top: ${Spacing[\"spacing-16\"]};\n width: 100%;\n }\n }\n\n &[data-mobile-layout=\"editable\"] {\n ${MediaQuery.MaxWidth.md} {\n margin-left: 0;\n margin-top: ${Spacing[\"spacing-16\"]};\n align-self: flex-end;\n }\n }\n`;\n\nexport const inlineActionContainer = css`\n width: 100%;\n margin-top: ${Spacing[\"spacing-16\"]};\n display: flex;\n justify-content: flex-end;\n align-items: center;\n`;\n\nexport const iconButton = css`\n min-width: unset;\n\n &:not(:last-child) {\n margin-right: ${Spacing[\"spacing-8\"]};\n }\n`;\n"],"names":[],"mappings":"6HAgN4B,sBAnJZ,iCAmCW,2CAgES,sCAuBJ,kCAzIL,4BAkIL,sCAtDU,kCAWJ,gCAuBH,8BAwFF,wCARW,uBA9NjB,wCAuJgB,uCAOD,sCAuBD,+BAhFP"}
@@ -0,0 +1,17 @@
1
+ @layer fds{.i18pxk0j{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;}.i18pxk0j:not(:last-child){margin-bottom:var(--fds-spacing-16);}.i18pxk0j[data-item-state="disabled"]{cursor:not-allowed;}.i18pxk0j[data-item-state="sortable"]{touch-action:manipulation;}.i18pxk0j[data-item-state="sortable"]:hover{cursor:-webkit-grab;cursor:grab;}.i18pxk0j[data-item-state="sortable-active"]{cursor:-webkit-grabbing;cursor:grabbing;touch-action:manipulation;}
2
+ .dqb8x5u{margin-right:var(--fds-spacing-16);height:1.5rem;width:1.5rem;color:var(--fds-colour-icon);}.dqb8x5u[data-drag-handle-state="active"]{color:var(--fds-colour-icon-primary);}.dqb8x5u[data-drag-handle-state="disabled"]{color:var(--fds-colour-icon-disabled);}
3
+ .bddx9rr{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);padding:var(--fds-spacing-16) var(--fds-spacing-32);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%;}:where(body.fds-breakpoint-md-max) .bddx9rr{padding:var(--fds-spacing-16);}.bddx9rr[data-box-state="focused"]{border-color:var(--fds-colour-border-focus);box-shadow:var(--fds-shadow-xs-focus-strong);}.bddx9rr[data-box-state="disabled"]{border-color:var(--fds-colour-border-disabled);}.bddx9rr[data-box-state="error"]{background:var(--fds-colour-bg-error);border-color:var(--fds-colour-border-error);}:where(body.fds-breakpoint-md-max) .bddx9rr[data-stack-mobile="true"]{-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;}
4
+ .c1dhzflv{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-md-max) .c1dhzflv{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}:where(body.fds-breakpoint-md-max) .c1dhzflv[data-has-thumbnail="true"]{-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;}
5
+ .nk38w4a{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;width:100%;}
6
+ .elwke9e{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;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}:where(body.fds-breakpoint-md-max) .elwke9e{width:100%;}
7
+ .f14h64yt{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:5rem;margin-left:var(--fds-spacing-8);-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;}:where(body.fds-breakpoint-md-max) .f14h64yt[data-mobile-visibility="hidden"]{display:none;visibility:hidden;}:where(body.fds-breakpoint-md-max) .f14h64yt[data-mobile-visibility="expand"]{width:100%;margin-left:0;margin-top:var(--fds-spacing-8);-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;}
8
+ .f1wv8fjl{color:var(--fds-colour-text-subtler);}
9
+ .divlkvo{color:var(--fds-colour-text-subtler);margin-top:var(--fds-spacing-16);}
10
+ .i1jm950n{font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-form-label-size);font-weight:var(--fds-font-weight-semibold);line-height:var(--fds-font-form-label-lh);letter-spacing:var(--fds-font-form-label-ls);font-weight:var(--fds-font-weight-semibold);color:var(--fds-colour-text-subtle);margin-top:var(--fds-spacing-16);}
11
+ .i1vgco4e{margin-top:var(--fds-spacing-4);}
12
+ .eap0p9n{height:1lh;width:1em;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:var(--fds-colour-icon-error-strong);}
13
+ .d1gk2zsk{color:var(--fds-colour-text-error);margin-top:var(--fds-spacing-4);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--fds-spacing-4);}:where(body.fds-breakpoint-md-max) .d1gk2zsk{display:none;visibility:hidden;}
14
+ .m1wh4bod{color:var(--fds-colour-text-error);display:none;visibility:hidden;}:where(body.fds-breakpoint-md-max) .m1wh4bod{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--fds-spacing-4);visibility:visible;margin-top:var(--fds-spacing-8);}
15
+ .a3rvfgv{width:6rem;margin-left:var(--fds-spacing-32);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;}:where(body.fds-breakpoint-md-max) .a3rvfgv{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}:where(body.fds-breakpoint-md-max) .a3rvfgv[data-mobile-layout="loading"]{margin-left:0;margin-top:var(--fds-spacing-16);width:100%;}:where(body.fds-breakpoint-md-max) .a3rvfgv[data-mobile-layout="editable"]{margin-left:0;margin-top:var(--fds-spacing-16);-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;}
16
+ .i5ozu70{width:100%;margin-top:var(--fds-spacing-16);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;}
17
+ .ilou5qo{min-width:unset;}.ilou5qo:not(:last-child){margin-right:var(--fds-spacing-8);}}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../alert/alert.js"),l=require("../button/button.js"),a=require("../markup/markup.js"),s=require("../typography/index.js"),i=require("./context.js"),n=require("./dropzone.js"),o=require("./file-list/file-list.js"),d=require("./file-upload.styles.js");exports.FileUpload=({styleType:u="bordered",fileItems:c,title:p,description:m,maxFiles:h,warning:y,className:x,name:b,id:j,"data-testid":g,accept:f,capture:v,multiple:B,disabled:N,sortable:q=!1,fileDescriptionMaxLength:D,editableFileItems:T=!1,errorMessage:C,readOnly:F,customLabels:I,onChange:M,onDelete:k,onEdit:z,onSort:L})=>{const A={uploadButton:(null==I?void 0:I.uploadButtonLabel)||"Upload files"},S=r.useRef(null),U=r.useRef(null),[w,O]=r.useState(),R=e=>{var r;if(void 0===h)return e;const t=null!==(r=null==c?void 0:c.length)&&void 0!==r?r:0,l=Math.max(h-t,0);return e.slice(0,l)},E=()=>!(!h||!c)&&c.length>=h;return e.jsx(i.FileUploadContext.Provider,{value:{activeId:w,setActiveId:O},children:e.jsxs(n.FileUploadDropzone,{ref:S,onChange:e=>{var r;const t=R(e);!N&&M&&t.length>0&&(M(t),null===(r=U.current)||void 0===r||r.focus())},id:j?`${j}-dropzone`:"dropzone",accept:f,capture:v,border:"bordered"===u,className:x,"data-testid":g,name:b,multiple:B,disabled:N||E()||F,children:[!(!p&&!m)&&e.jsxs("div",{className:d.textContainer,children:[p?"string"==typeof p?e.jsx(s.Typography.BodyBL,{children:p}):e.jsx(a.Markup,{className:d.markupContainer,baseTextSize:"body-baseline",children:p}):null,m?"string"==typeof m?e.jsx(s.Typography.BodyMD,{className:d.description,children:m}):e.jsx(a.Markup,{className:d.markupContainer,baseTextSize:"body-md",children:m}):null]}),!!y&&e.jsx(t.Alert,{className:d.warningAlert,type:"warning",children:y}),e.jsx(o.FileList,{ref:U,fileItems:c,editableFileItems:T,fileDescriptionMaxLength:D,sortable:q,disabled:N,readOnly:F,onItemDelete:e=>{var r;k&&(k(e),null===(r=U.current)||void 0===r||r.focus())},onItemUpdate:e=>{z&&z(e)},onSort:e=>{L&&L(e)}}),C&&e.jsx(t.Alert,{className:d.errorAlert,type:"error",children:C}),!F&&e.jsxs("div",{className:d.uploadButtonContainer,children:[e.jsx(l.Button,{type:"button",sizeType:"small",styleType:"secondary",disabled:!!w||N||E(),onClick:e=>{N||(e.preventDefault(),S.current&&S.current.openFileDialog())},className:d.uploadButton,children:A.uploadButton}),e.jsx(s.Typography.BodyMD,{className:d.uploadButtonText,weight:"semibold",children:"or drop them here"})]})]})})};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../alert/alert.js"),l=require("../button/button.js"),i=require("../markup/markup.js"),s=require("../typography/index.js"),a=require("./context.js"),n=require("./dropzone.js"),o=require("./file-list/file-list.js"),d=require("./file-upload.styles.js");exports.FileUpload=({styleType:u="bordered",fileItems:c,title:p,description:m,maxFiles:h,warning:y,className:x,name:b,id:j,"data-testid":g,accept:f,capture:v,multiple:q,disabled:B,sortable:N=!1,fileDescriptionMaxLength:D,editableFileItems:T=!1,descriptionRequired:C=!0,descriptionLabel:F,errorMessage:I,readOnly:L,customLabels:M,onChange:k,onDelete:z,onEdit:A,onSort:S})=>{const U={uploadButton:(null==M?void 0:M.uploadButtonLabel)||"Upload files"},w=r.useRef(null),R=r.useRef(null),[O,E]=r.useState(),P=e=>{var r;if(void 0===h)return e;const t=null!==(r=null==c?void 0:c.length)&&void 0!==r?r:0,l=Math.max(h-t,0);return e.slice(0,l)},$=()=>!(!h||!c)&&c.length>=h;return e.jsx(a.FileUploadContext.Provider,{value:{activeId:O,setActiveId:E},children:e.jsxs(n.FileUploadDropzone,{ref:w,onChange:e=>{var r;const t=P(e);!B&&k&&t.length>0&&(k(t),null===(r=R.current)||void 0===r||r.focus())},id:j?`${j}-dropzone`:"dropzone",accept:f,capture:v,border:"bordered"===u,className:x,"data-testid":g,name:b,multiple:q,disabled:B||$()||L,children:[!(!p&&!m)&&e.jsxs("div",{className:d.textContainer,children:[p?"string"==typeof p?e.jsx(s.Typography.BodyBL,{children:p}):e.jsx(i.Markup,{className:d.markupContainer,baseTextSize:"body-baseline",children:p}):null,m?"string"==typeof m?e.jsx(s.Typography.BodyMD,{className:d.description,children:m}):e.jsx(i.Markup,{className:d.markupContainer,baseTextSize:"body-md",children:m}):null]}),!!y&&e.jsx(t.Alert,{className:d.warningAlert,type:"warning",children:y}),e.jsx(o.FileList,{ref:R,fileItems:c,editableFileItems:T,descriptionRequired:C,descriptionLabel:F,fileDescriptionMaxLength:D,sortable:N,disabled:B,readOnly:L,onItemDelete:e=>{var r;z&&(z(e),null===(r=R.current)||void 0===r||r.focus())},onItemUpdate:e=>{A&&A(e)},onSort:e=>{S&&S(e)}}),I&&e.jsx(t.Alert,{className:d.errorAlert,type:"error",children:I}),!L&&e.jsxs("div",{className:d.uploadButtonContainer,children:[e.jsx(l.Button,{type:"button",sizeType:"small",styleType:"secondary",disabled:!!O||B||$(),onClick:e=>{B||(e.preventDefault(),w.current&&w.current.openFileDialog())},className:d.uploadButton,children:U.uploadButton}),e.jsx(s.Typography.BodyMD,{className:d.uploadButtonText,weight:"semibold",children:"or drop them here"})]})]})})};
2
2
  //# sourceMappingURL=file-upload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.js","sources":["../../../src/file-upload/file-upload.tsx"],"sourcesContent":["import { useRef, useState } from \"react\";\n\nimport { Alert } from \"../alert\";\nimport { Button } from \"../button\";\nimport { Markup } from \"../markup\";\nimport { Typography } from \"../typography\";\nimport { FileUploadContext } from \"./context\";\nimport type { DropzoneElement } from \"./dropzone\";\nimport { FileUploadDropzone } from \"./dropzone\";\nimport type { FileListRef } from \"./file-list\";\nimport { FileList } from \"./file-list\";\nimport * as styles from \"./file-upload.styles\";\nimport type { FileItemProps, FileUploadProps } from \"./types\";\n\nexport const FileUpload = ({\n styleType = \"bordered\",\n fileItems,\n title,\n description,\n maxFiles,\n warning,\n className,\n name,\n id,\n \"data-testid\": testId,\n accept,\n capture,\n multiple,\n disabled,\n sortable = false,\n fileDescriptionMaxLength,\n editableFileItems = false,\n errorMessage,\n readOnly,\n customLabels,\n onChange,\n onDelete,\n onEdit,\n onSort,\n}: FileUploadProps) => {\n const labels = {\n uploadButton: customLabels?.uploadButtonLabel || \"Upload files\",\n };\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const dropzoneRef = useRef<DropzoneElement>(null);\n const fileListRef = useRef<FileListRef>(null);\n const [activeId, setActiveId] = useState<string>();\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleChange = (files: File[]) => {\n const filesToProcess = limitIncomingFiles(files);\n\n if (!disabled && onChange && filesToProcess.length > 0) {\n onChange(filesToProcess);\n fileListRef.current?.focus();\n }\n };\n\n const handleItemDelete = (item: FileItemProps) => {\n if (onDelete) {\n onDelete(item);\n fileListRef.current?.focus();\n }\n };\n\n const handleUploadButtonClick = (\n event: React.MouseEvent<HTMLButtonElement>\n ) => {\n if (!disabled) {\n event.preventDefault();\n if (dropzoneRef.current) {\n dropzoneRef.current.openFileDialog();\n }\n }\n };\n\n const handleItemUpdate = (updatedItem: FileItemProps) => {\n if (onEdit) {\n onEdit(updatedItem);\n }\n };\n\n const handleSort = (updatedItems: FileItemProps[]) => {\n if (onSort) {\n onSort(updatedItems);\n }\n };\n\n // =========================================================================\n // HELPER FUNCTIONS\n // =========================================================================\n const limitIncomingFiles = (files: File[]) => {\n if (maxFiles === undefined) {\n return files;\n }\n\n const existingItemsCount = fileItems?.length ?? 0;\n const remainingSlots = Math.max(maxFiles - existingItemsCount, 0);\n\n return files.slice(0, remainingSlots);\n };\n\n const reachedMaxFiles = () => {\n return maxFiles && fileItems ? fileItems.length >= maxFiles : false;\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 <Typography.BodyBL>{title}</Typography.BodyBL>;\n }\n\n return (\n <Markup\n className={styles.markupContainer}\n baseTextSize=\"body-baseline\"\n >\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 (\n <Typography.BodyMD className={styles.description}>\n {description}\n </Typography.BodyMD>\n );\n }\n\n return (\n <Markup className={styles.markupContainer} baseTextSize=\"body-md\">\n {description}\n </Markup>\n );\n };\n\n return (\n <FileUploadContext.Provider value={{ activeId, setActiveId }}>\n <FileUploadDropzone\n ref={dropzoneRef}\n onChange={handleChange}\n id={id ? `${id}-dropzone` : \"dropzone\"}\n accept={accept}\n capture={capture}\n border={styleType === \"bordered\"}\n className={className}\n data-testid={testId}\n name={name}\n multiple={multiple}\n disabled={disabled || reachedMaxFiles() || readOnly}\n >\n {!!(title || description) && (\n <div className={styles.textContainer}>\n {renderTitle()}\n {renderDescription()}\n </div>\n )}\n {!!warning && (\n <Alert className={styles.warningAlert} type=\"warning\">\n {warning}\n </Alert>\n )}\n <FileList\n ref={fileListRef}\n fileItems={fileItems}\n editableFileItems={editableFileItems}\n fileDescriptionMaxLength={fileDescriptionMaxLength}\n sortable={sortable}\n disabled={disabled}\n readOnly={readOnly}\n onItemDelete={handleItemDelete}\n onItemUpdate={handleItemUpdate}\n onSort={handleSort}\n />\n {errorMessage && (\n <Alert className={styles.errorAlert} type=\"error\">\n {errorMessage}\n </Alert>\n )}\n {!readOnly && (\n <div className={styles.uploadButtonContainer}>\n <Button\n type=\"button\"\n sizeType=\"small\"\n styleType=\"secondary\"\n disabled={\n !!activeId || disabled || reachedMaxFiles()\n }\n onClick={handleUploadButtonClick}\n className={styles.uploadButton}\n >\n {labels.uploadButton}\n </Button>\n <Typography.BodyMD\n className={styles.uploadButtonText}\n weight=\"semibold\"\n >\n or drop them here\n </Typography.BodyMD>\n </div>\n )}\n </FileUploadDropzone>\n </FileUploadContext.Provider>\n );\n};\n"],"names":["styleType","fileItems","title","description","maxFiles","warning","className","name","id","testId","accept","capture","multiple","disabled","sortable","fileDescriptionMaxLength","editableFileItems","errorMessage","readOnly","customLabels","onChange","onDelete","onEdit","onSort","labels","uploadButton","uploadButtonLabel","dropzoneRef","useRef","fileListRef","activeId","setActiveId","useState","limitIncomingFiles","files","undefined","existingItemsCount","_a","length","remainingSlots","Math","max","slice","reachedMaxFiles","_jsx","FileUploadContext","Provider","value","children","_jsxs","FileUploadDropzone","ref","filesToProcess","current","focus","border","styles.textContainer","Typography","BodyBL","Markup","styles.markupContainer","baseTextSize","BodyMD","styles.description","Alert","styles.warningAlert","type","FileList","onItemDelete","item","onItemUpdate","updatedItem","updatedItems","styles.errorAlert","styles.uploadButtonContainer","Button","sizeType","onClick","event","preventDefault","openFileDialog","styles.uploadButton","styles.uploadButtonText","weight"],"mappings":"2VAc0B,EACtBA,YAAY,WACZC,YACAC,QACAC,cACAC,WACAC,UACAC,YACAC,OACAC,KACA,cAAeC,EACfC,SACAC,UACAC,WACAC,WACAC,YAAW,EACXC,2BACAC,qBAAoB,EACpBC,eACAC,WACAC,eACAC,WACAC,WACAC,SACAC,aAEA,MAAMC,EAAS,CACXC,cAAcN,eAAAA,EAAcO,oBAAqB,gBAK/CC,EAAcC,EAAAA,OAAwB,MACtCC,EAAcD,EAAAA,OAAoB,OACjCE,EAAUC,GAAeC,aA+C1BC,EAAsBC,UACxB,QAAiBC,IAAb/B,EACA,OAAO8B,EAGX,MAAME,EAAsC,QAAjBC,EAAApC,aAAS,EAATA,EAAWqC,cAAM,IAAAD,EAAAA,EAAI,EAC1CE,EAAiBC,KAAKC,IAAIrC,EAAWgC,EAAoB,GAE/D,OAAOF,EAAMQ,MAAM,EAAGH,EAAe,EAGnCI,EAAkB,OACbvC,IAAYH,IAAYA,EAAUqC,QAAUlC,EA6CvD,OACIwC,EAAAA,IAACC,EAAAA,kBAAkBC,SAAQ,CAACC,MAAO,CAAEjB,WAAUC,eAAaiB,SACxDC,EAAAA,KAACC,EAAAA,mBAAkB,CACfC,IAAKxB,EACLP,SAvGUc,UAClB,MAAMkB,EAAiBnB,EAAmBC,IAErCrB,GAAYO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KAGPC,GACE+B,EAAAA,KAAA,MAAA,CAAK3C,UAAWoE,EAAAA,sBAA4B1B,SAAA,CACxCJ,EAAAA,IAAC+B,EAAAA,OAAM,CACHT,KAAK,SACLU,SAAS,QACT5E,UAAU,YACVa,WACMiB,GAAYjB,GAAY8B,IAE9BkC,QAtIpBC,IAEKjE,IACDiE,EAAMC,iBACFpD,EAAY0B,SACZ1B,EAAY0B,QAAQ2B,iBAE5B,EAgIoB1E,UAAW2E,EAAAA,aAAmBjC,SAE7BxB,EAAOC,eAEZmB,EAAAA,IAACa,EAAAA,WAAWK,OAAM,CACdxD,UAAW4E,EAAAA,iBACXC,OAAO,WAAUnC,SAAA,6BAOR"}
1
+ {"version":3,"file":"file-upload.js","sources":["../../../src/file-upload/file-upload.tsx"],"sourcesContent":["import { useRef, useState } from \"react\";\n\nimport { Alert } from \"../alert\";\nimport { Button } from \"../button\";\nimport { Markup } from \"../markup\";\nimport { Typography } from \"../typography\";\nimport { FileUploadContext } from \"./context\";\nimport type { DropzoneElement } from \"./dropzone\";\nimport { FileUploadDropzone } from \"./dropzone\";\nimport type { FileListRef } from \"./file-list\";\nimport { FileList } from \"./file-list\";\nimport * as styles from \"./file-upload.styles\";\nimport type { FileItemProps, FileUploadProps } from \"./types\";\n\n/** Allows user to upload images via drag-and-drop or a native file dialog. */\nexport const FileUpload = ({\n styleType = \"bordered\",\n fileItems,\n title,\n description,\n maxFiles,\n warning,\n className,\n name,\n id,\n \"data-testid\": testId,\n accept,\n capture,\n multiple,\n disabled,\n sortable = false,\n fileDescriptionMaxLength,\n editableFileItems = false,\n descriptionRequired = true,\n descriptionLabel,\n errorMessage,\n readOnly,\n customLabels,\n onChange,\n onDelete,\n onEdit,\n onSort,\n}: FileUploadProps) => {\n const labels = {\n uploadButton: customLabels?.uploadButtonLabel || \"Upload files\",\n };\n // =========================================================================\n // CONST, STATE, REFS\n // =========================================================================\n const dropzoneRef = useRef<DropzoneElement>(null);\n const fileListRef = useRef<FileListRef>(null);\n const [activeId, setActiveId] = useState<string>();\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleChange = (files: File[]) => {\n const filesToProcess = limitIncomingFiles(files);\n\n if (!disabled && onChange && filesToProcess.length > 0) {\n onChange(filesToProcess);\n fileListRef.current?.focus();\n }\n };\n\n const handleItemDelete = (item: FileItemProps) => {\n if (onDelete) {\n onDelete(item);\n fileListRef.current?.focus();\n }\n };\n\n const handleUploadButtonClick = (\n event: React.MouseEvent<HTMLButtonElement>\n ) => {\n if (!disabled) {\n event.preventDefault();\n if (dropzoneRef.current) {\n dropzoneRef.current.openFileDialog();\n }\n }\n };\n\n const handleItemUpdate = (updatedItem: FileItemProps) => {\n if (onEdit) {\n onEdit(updatedItem);\n }\n };\n\n const handleSort = (updatedItems: FileItemProps[]) => {\n if (onSort) {\n onSort(updatedItems);\n }\n };\n\n // =========================================================================\n // HELPER FUNCTIONS\n // =========================================================================\n const limitIncomingFiles = (files: File[]) => {\n if (maxFiles === undefined) {\n return files;\n }\n\n const existingItemsCount = fileItems?.length ?? 0;\n const remainingSlots = Math.max(maxFiles - existingItemsCount, 0);\n\n return files.slice(0, remainingSlots);\n };\n\n const reachedMaxFiles = () => {\n return maxFiles && fileItems ? fileItems.length >= maxFiles : false;\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 <Typography.BodyBL>{title}</Typography.BodyBL>;\n }\n\n return (\n <Markup\n className={styles.markupContainer}\n baseTextSize=\"body-baseline\"\n >\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 (\n <Typography.BodyMD className={styles.description}>\n {description}\n </Typography.BodyMD>\n );\n }\n\n return (\n <Markup className={styles.markupContainer} baseTextSize=\"body-md\">\n {description}\n </Markup>\n );\n };\n\n return (\n <FileUploadContext.Provider value={{ activeId, setActiveId }}>\n <FileUploadDropzone\n ref={dropzoneRef}\n onChange={handleChange}\n id={id ? `${id}-dropzone` : \"dropzone\"}\n accept={accept}\n capture={capture}\n border={styleType === \"bordered\"}\n className={className}\n data-testid={testId}\n name={name}\n multiple={multiple}\n disabled={disabled || reachedMaxFiles() || readOnly}\n >\n {!!(title || description) && (\n <div className={styles.textContainer}>\n {renderTitle()}\n {renderDescription()}\n </div>\n )}\n {!!warning && (\n <Alert className={styles.warningAlert} type=\"warning\">\n {warning}\n </Alert>\n )}\n <FileList\n ref={fileListRef}\n fileItems={fileItems}\n editableFileItems={editableFileItems}\n descriptionRequired={descriptionRequired}\n descriptionLabel={descriptionLabel}\n fileDescriptionMaxLength={fileDescriptionMaxLength}\n sortable={sortable}\n disabled={disabled}\n readOnly={readOnly}\n onItemDelete={handleItemDelete}\n onItemUpdate={handleItemUpdate}\n onSort={handleSort}\n />\n {errorMessage && (\n <Alert className={styles.errorAlert} type=\"error\">\n {errorMessage}\n </Alert>\n )}\n {!readOnly && (\n <div className={styles.uploadButtonContainer}>\n <Button\n type=\"button\"\n sizeType=\"small\"\n styleType=\"secondary\"\n disabled={\n !!activeId || disabled || reachedMaxFiles()\n }\n onClick={handleUploadButtonClick}\n className={styles.uploadButton}\n >\n {labels.uploadButton}\n </Button>\n <Typography.BodyMD\n className={styles.uploadButtonText}\n weight=\"semibold\"\n >\n or drop them here\n </Typography.BodyMD>\n </div>\n )}\n </FileUploadDropzone>\n </FileUploadContext.Provider>\n );\n};\n"],"names":["styleType","fileItems","title","description","maxFiles","warning","className","name","id","testId","accept","capture","multiple","disabled","sortable","fileDescriptionMaxLength","editableFileItems","descriptionRequired","descriptionLabel","errorMessage","readOnly","customLabels","onChange","onDelete","onEdit","onSort","labels","uploadButton","uploadButtonLabel","dropzoneRef","useRef","fileListRef","activeId","setActiveId","useState","limitIncomingFiles","files","undefined","existingItemsCount","_a","length","remainingSlots","Math","max","slice","reachedMaxFiles","_jsx","FileUploadContext","Provider","value","children","_jsxs","FileUploadDropzone","ref","filesToProcess","current","focus","border","styles.textContainer","Typography","BodyBL","Markup","styles.markupContainer","baseTextSize","BodyMD","styles.description","Alert","styles.warningAlert","type","FileList","onItemDelete","item","onItemUpdate","updatedItem","updatedItems","styles.errorAlert","styles.uploadButtonContainer","Button","sizeType","onClick","event","preventDefault","openFileDialog","styles.uploadButton","styles.uploadButtonText","weight"],"mappings":"2VAe0B,EACtBA,YAAY,WACZC,YACAC,QACAC,cACAC,WACAC,UACAC,YACAC,OACAC,KACA,cAAeC,EACfC,SACAC,UACAC,WACAC,WACAC,YAAW,EACXC,2BACAC,qBAAoB,EACpBC,uBAAsB,EACtBC,mBACAC,eACAC,WACAC,eACAC,WACAC,WACAC,SACAC,aAEA,MAAMC,EAAS,CACXC,cAAcN,eAAAA,EAAcO,oBAAqB,gBAK/CC,EAAcC,EAAAA,OAAwB,MACtCC,EAAcD,EAAAA,OAAoB,OACjCE,EAAUC,GAAeC,aA+C1BC,EAAsBC,UACxB,QAAiBC,IAAbjC,EACA,OAAOgC,EAGX,MAAME,EAAsC,QAAjBC,EAAAtC,aAAS,EAATA,EAAWuC,cAAM,IAAAD,EAAAA,EAAI,EAC1CE,EAAiBC,KAAKC,IAAIvC,EAAWkC,EAAoB,GAE/D,OAAOF,EAAMQ,MAAM,EAAGH,EAAe,EAGnCI,EAAkB,OACbzC,IAAYH,IAAYA,EAAUuC,QAAUpC,EA6CvD,OACI0C,EAAAA,IAACC,EAAAA,kBAAkBC,SAAQ,CAACC,MAAO,CAAEjB,WAAUC,eAAaiB,SACxDC,EAAAA,KAACC,EAAAA,mBAAkB,CACfC,IAAKxB,EACLP,SAvGUc,UAClB,MAAMkB,EAAiBnB,EAAmBC,IAErCvB,GAAYS,GAAYgC,EAAed,OAAS,IACjDlB,EAASgC,GACU,QAAnBf,EAAAR,EAAYwB,eAAO,IAAAhB,GAAAA,EAAEiB,QACzB,EAkGQhD,GAAIA,EAAK,GAAGA,aAAgB,WAC5BE,OAAQA,EACRC,QAASA,EACT8C,OAA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,SACLU,SAAS,QACT9E,UAAU,YACVa,WACMmB,GAAYnB,GAAYgC,IAE9BkC,QAxIpBC,IAEKnE,IACDmE,EAAMC,iBACFpD,EAAY0B,SACZ1B,EAAY0B,QAAQ2B,iBAE5B,EAkIoB5E,UAAW6E,EAAAA,aAAmBjC,SAE7BxB,EAAOC,eAEZmB,EAAAA,IAACa,aAAWK,OAAM,CACd1D,UAAW8E,EAAAA,iBACXC,OAAO,WAAUnC,SAAA,6BAOR"}
@@ -1,8 +1,8 @@
1
- .t9vodht{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);gap:var(--fds-spacing-8);}
1
+ @layer fds{.t9vodht{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);gap:var(--fds-spacing-8);}
2
2
  .m7vp3hf{color:var(--fds-colour-text);}
3
3
  .dhybrj2{color:var(--fds-colour-text-subtler);}
4
4
  .wq1el8u{margin-bottom:var(--fds-spacing-32);}
5
5
  .u723luu{width:100%;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:flex-end;-webkit-box-align:flex-end;-ms-flex-align:flex-end;align-items:flex-end;}:where(body.fds-breakpoint-md-max) .u723luu{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}
6
6
  .u7dp799{width:10rem;}:where(body.fds-breakpoint-md-max) .u7dp799{width:100%;}
7
7
  .u1rz06ff{color:var(--fds-colour-text-subtler);margin-top:var(--fds-spacing-8);width:10rem;text-align:center;}:where(body.fds-breakpoint-md-max) .u1rz06ff{display:none;visibility:hidden;}
8
- .emjmrml{margin-bottom:var(--fds-spacing-32);}
8
+ .emjmrml{margin-bottom:var(--fds-spacing-32);}}
@@ -1,4 +1,4 @@
1
- .f1m3a5f4{padding:0 0 var(--fds-spacing-16);}.f1m3a5f4 [data-id="content-container"]{position:relative;padding:var(--fds-spacing-8) var(--fds-spacing-8) 0;}:where(body.fds-breakpoint-lg-max) .f1m3a5f4 [data-id="content-container"]{padding:var(--fds-spacing-16) var(--fds-spacing-20) var(--fds-spacing-8);}.f1m3a5f4 [data-id="minimise-button"]{margin:var(--fds-spacing-8) var(--fds-spacing-20) 0;}
1
+ @layer fds{.f1m3a5f4{padding:0 0 var(--fds-spacing-16);}.f1m3a5f4 [data-id="content-container"]{position:relative;padding:var(--fds-spacing-8) var(--fds-spacing-8) 0;}:where(body.fds-breakpoint-lg-max) .f1m3a5f4 [data-id="content-container"]{padding:var(--fds-spacing-16) var(--fds-spacing-20) var(--fds-spacing-8);}.f1m3a5f4 [data-id="minimise-button"]{margin:var(--fds-spacing-8) var(--fds-spacing-20) 0;}
2
2
  .g11488am{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}:where(body.fds-breakpoint-lg-max) .g11488am{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:0;}
3
3
  :where(body.fds-breakpoint-lg-max) .g1nnu0tt{gap:var(--fds-spacing-16);}
4
4
  .i4hhc1a{--fds-internal-filterItemCheckbox-item-level:0;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;position:relative;width:100%;min-height:1.5rem;padding:var(--fds-spacing-8) var(--fds-spacing-12);padding-left:calc(
@@ -13,4 +13,4 @@
13
13
  .c13wglju{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;margin-right:var(--fds-spacing-8);}
14
14
  .twhh8xx{min-width:5rem;}
15
15
  .tb2fwos{visibility:hidden;}
16
- .sbvftpe{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:0;margin:var(--fds-spacing-16) 0 var(--fds-spacing-8) var(--fds-spacing-12);}:where(body.fds-breakpoint-lg-max) .sbvftpe{margin:0 0 var(--fds-spacing-16) 0;}
16
+ .sbvftpe{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:0;margin:var(--fds-spacing-16) 0 var(--fds-spacing-8) var(--fds-spacing-12);}:where(body.fds-breakpoint-lg-max) .sbvftpe{margin:0 0 var(--fds-spacing-16) 0;}}
@@ -1 +1 @@
1
- .f94l7xt{background-color:var(--fds-colour-bg);height:100%;width:100%;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{.f94l7xt{background-color:var(--fds-colour-bg);height:100%;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}}
@@ -1 +1 @@
1
- {"version":3,"file":"filter-item.js","sources":["../../../src/filter/filter-item.tsx"],"sourcesContent":["import { ChevronDownIcon } from \"@lifesg/react-icons/chevron-down\";\nimport { animated, useSpring } from \"@react-spring/web\";\nimport clsx from \"clsx\";\nimport isNil from \"lodash/isNil\";\nimport { useContext, useEffect, useRef, useState } from \"react\";\nimport { useResizeDetector } from \"react-resize-detector\";\n\nimport { Button } from \"../button\";\nimport { PopoverAddon } from \"../form/form-label-addon\";\nimport { inertValue, VisuallyHidden } from \"../shared/accessibility\";\nimport { ClickableIcon } from \"../shared/clickable-icon\";\nimport { useApplyStyle } from \"../theme\";\nimport { useId } from \"../util\";\nimport { FilterContext } from \"./filter-context\";\nimport * as styles from \"./filter-item.styles\";\nimport type { FilterItemProps } from \"./types\";\n\nexport const FilterItem = ({\n collapsible: desktopCollapsible = true,\n initialExpanded = false,\n expanded: controlledExpanded,\n onExpandChange,\n minimisable = false,\n minimisedHeight,\n showDivider = true,\n showMobileDivider = true,\n title,\n addon,\n children,\n className,\n ...otherProps\n}: FilterItemProps) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const { mode, rootNode } = useContext(FilterContext);\n const isMobile = mode === \"mobile\";\n const [expanded, setExpanded] = useState(getInitialExpandState());\n const [contentMinimised, setContentMinimised] = useState(minimisable);\n const collapsible = !isMobile && desktopCollapsible;\n\n const itemResizeDetector = useResizeDetector();\n const contentResizeDetector = useResizeDetector();\n const itemAnimationStyles = useSpring({\n height: expanded ? itemResizeDetector.height : 0,\n });\n const contentHeight = contentMinimised\n ? minimisedHeight ??\n Math.min((contentResizeDetector.height ?? 0) * 0.5, 216)\n : contentResizeDetector.height;\n const internalId = useId();\n const contentId = `${internalId}-content`;\n const titleId = `${internalId}-title`;\n const minimisableContentRef = useRef<HTMLDivElement | null>(null);\n\n useApplyStyle(minimisableContentRef, {\n [styles.tokens.minimisableContent.height]: contentHeight\n ? `${contentHeight}px`\n : null,\n });\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setExpanded(getInitialExpandState());\n }, [desktopCollapsible, controlledExpanded]);\n\n useEffect(() => {\n setContentMinimised(minimisable);\n }, [minimisable]);\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleExpandCollapse = () => {\n const nextState = !expanded;\n\n if (isNil(controlledExpanded)) {\n setExpanded(nextState);\n }\n\n if (onExpandChange) {\n onExpandChange(nextState);\n }\n };\n\n const handleMinimise = () => {\n setContentMinimised(!contentMinimised);\n };\n\n // =============================================================================\n // HELPERS\n // =============================================================================\n function getInitialExpandState() {\n if (isMobile) {\n return true;\n }\n if (isNil(controlledExpanded)) {\n return !desktopCollapsible || initialExpanded;\n }\n return controlledExpanded;\n }\n\n // =============================================================================\n // RENDER\n // =============================================================================\n\n const renderAddon = () => {\n switch (addon?.type) {\n case \"popover\":\n return (\n <PopoverAddon\n addon={addon}\n rootNode={isMobile ? rootNode : undefined}\n />\n );\n default:\n return null;\n }\n };\n\n return (\n <div\n aria-labelledby={titleId}\n className={clsx(\n styles.filterItemWrapper,\n (collapsible || isMobile) && styles.filterItemWrapperDarker\n )}\n >\n <div\n className={clsx(\n styles.divider,\n (isMobile ? showMobileDivider : showDivider) &&\n styles.dividerVisible,\n isMobile && styles.dividerMobile\n )}\n />\n {(title || collapsible) && (\n <div\n className={clsx(\n styles.filterItemHeader,\n isMobile && styles.filterItemHeaderMobile\n )}\n >\n {title && (\n <h3\n id={titleId}\n data-testid=\"filter-item-title\"\n className={clsx(\n styles.filterItemTitle,\n isMobile && styles.filterItemTitleMobile\n )}\n >\n {title} {addon && renderAddon()}\n </h3>\n )}\n {collapsible && (\n <ClickableIcon\n className={styles.filterItemExpandButton}\n data-testid={\"expand-collapse-button\"}\n focusHighlight={false}\n focusOutline=\"browser\"\n onClick={handleExpandCollapse}\n aria-expanded={expanded}\n aria-disabled={!collapsible}\n aria-controls={contentId}\n >\n {title && <VisuallyHidden>{title}</VisuallyHidden>}\n <ChevronDownIcon\n aria-hidden\n className={clsx(\n styles.chevronIcon,\n expanded && styles.chevronIconExpanded\n )}\n />\n </ClickableIcon>\n )}\n </div>\n )}\n <animated.div\n className={styles.expandableItem}\n id={contentId}\n data-testid={\"expandable-container\"}\n data-expanded={expanded}\n style={itemAnimationStyles}\n inert={inertValue(!expanded)}\n >\n <div ref={itemResizeDetector.ref}>\n <div\n className={clsx(styles.filterItemBody, className)}\n {...otherProps}\n >\n <div\n ref={minimisableContentRef}\n data-testid=\"minimisable-container\"\n className={clsx(\n styles.minimisableContent,\n minimisable &&\n styles.minimisableContentMinimisable\n )}\n >\n <div ref={contentResizeDetector.ref}>\n <div data-id=\"content-container\">\n {typeof children === \"function\"\n ? children(mode, {\n minimised: contentMinimised,\n })\n : children}\n </div>\n </div>\n </div>\n {minimisable && (\n <Button\n className={styles.filterItemMinimiseButton}\n data-id=\"minimise-button\"\n sizeType=\"small\"\n styleType=\"link\"\n type=\"button\"\n onClick={handleMinimise}\n >\n <VisuallyHidden>{`view ${\n contentMinimised ? \"more\" : \"less\"\n } in ${title}`}</VisuallyHidden>\n <span aria-hidden>\n View {contentMinimised ? \"more\" : \"less\"}\n </span>\n </Button>\n )}\n </div>\n </div>\n </animated.div>\n </div>\n );\n};\n\nFilterItem.displayName = \"Filter.Item\";\n"],"names":["FilterItem","_a","collapsible","desktopCollapsible","initialExpanded","expanded","controlledExpanded","onExpandChange","minimisable","minimisedHeight","showDivider","showMobileDivider","title","addon","children","className","otherProps","__rest","mode","rootNode","useContext","FilterContext","isMobile","setExpanded","useState","getInitialExpandState","contentMinimised","setContentMinimised","itemResizeDetector","useResizeDetector","contentResizeDetector","itemAnimationStyles","useSpring","height","contentHeight","Math","min","_b","internalId","useId","contentId","titleId","minimisableContentRef","useRef","useApplyStyle","styles.tokens","minimisableContent","useEffect","isNil","_jsxs","clsx","styles.filterItemWrapper","styles.filterItemWrapperDarker","_jsx","styles.divider","styles.dividerVisible","styles.dividerMobile","styles.filterItemHeader","styles.filterItemHeaderMobile","id","styles.filterItemTitle","styles.filterItemTitleMobile","type","PopoverAddon","undefined","ClickableIcon","styles.filterItemExpandButton","focusHighlight","focusOutline","onClick","nextState","VisuallyHidden","ChevronDownIcon","styles.chevronIcon","styles.chevronIconExpanded","animated","div","styles.expandableItem","style","inert","inertValue","ref","Object","assign","styles.filterItemBody","styles.minimisableContent","styles.minimisableContentMinimisable","minimised","Button","styles.filterItemMinimiseButton","sizeType","styleType","displayName"],"mappings":"ypCAiBO,MAAMA,EAAcC,WACvBC,YAAaC,GAAqB,EAAIC,gBACtCA,GAAkB,EAClBC,SAAUC,EAAkBC,eAC5BA,EAAcC,YACdA,GAAc,EAAKC,gBACnBA,EAAeC,YACfA,GAAc,EAAIC,kBAClBA,GAAoB,EAAIC,MACxBA,EAAKC,MACLA,EAAKC,SACLA,EAAQC,UACRA,GAASd,EACNe,EAAUC,EAAAA,OAAAhB,EAbU,wKAkBvB,MAAMiB,KAAEA,EAAIC,SAAEA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SAAS,QACTC,UAAU,OACV7B,KAAK,SACLO,QApIL,KACnB1C,GAAqBD,EAAiB,EAmISZ,SAAA,CAEvBuC,EAAAA,IAACkB,iBAAc,CAAAzD,SAAE,QACbY,EAAmB,OAAS,aACzBd,MACPqC,EAAAA,KAAA,OAAA,CAAA,eAAA,EAAAnC,SAAA,CAAA,QACUY,EAAmB,OAAS,uBAOxD,EAId1B,EAAW4F,YAAc"}
1
+ {"version":3,"file":"filter-item.js","sources":["../../../src/filter/filter-item.tsx"],"sourcesContent":["import { ChevronDownIcon } from \"@lifesg/react-icons/chevron-down\";\nimport { animated, useSpring } from \"@react-spring/web\";\nimport clsx from \"clsx\";\nimport isNil from \"lodash/isNil\";\nimport { useContext, useEffect, useRef, useState } from \"react\";\nimport { useResizeDetector } from \"react-resize-detector\";\n\nimport { Button } from \"../button\";\nimport { PopoverAddon } from \"../form/form-label-addon\";\nimport { inertValue, VisuallyHidden } from \"../shared/accessibility\";\nimport { ClickableIcon } from \"../shared/clickable-icon\";\nimport { useApplyStyle } from \"../theme\";\nimport { useId } from \"../util\";\nimport { FilterContext } from \"./filter-context\";\nimport * as styles from \"./filter-item.styles\";\nimport type { FilterItemProps } from \"./types\";\n\nconst DEFAULT_MINIMISED_HEIGHT_CAP = 216;\n\nexport const FilterItem = ({\n collapsible: desktopCollapsible = true,\n initialExpanded = false,\n expanded: controlledExpanded,\n onExpandChange,\n minimisable = false,\n minimisedHeight,\n showDivider = true,\n showMobileDivider = true,\n title,\n addon,\n children,\n className,\n ...otherProps\n}: FilterItemProps) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const { mode, rootNode } = useContext(FilterContext);\n const isMobile = mode === \"mobile\";\n const [expanded, setExpanded] = useState(getInitialExpandState());\n const [contentMinimised, setContentMinimised] = useState(minimisable);\n const collapsible = !isMobile && desktopCollapsible;\n\n const itemResizeDetector = useResizeDetector();\n const contentResizeDetector = useResizeDetector();\n const itemAnimationStyles = useSpring({\n height: expanded ? itemResizeDetector.height : 0,\n });\n const contentHeight = contentMinimised\n ? minimisedHeight ??\n Math.min(\n (contentResizeDetector.height ?? 0) * 0.5,\n DEFAULT_MINIMISED_HEIGHT_CAP\n )\n : contentResizeDetector.height;\n const internalId = useId();\n const contentId = `${internalId}-content`;\n const titleId = `${internalId}-title`;\n const minimisableContentRef = useRef<HTMLDivElement | null>(null);\n\n useApplyStyle(minimisableContentRef, {\n [styles.tokens.minimisableContent.height]: contentHeight\n ? `${contentHeight}px`\n : null,\n });\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setExpanded(getInitialExpandState());\n }, [desktopCollapsible, controlledExpanded]);\n\n useEffect(() => {\n setContentMinimised(minimisable);\n }, [minimisable]);\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleExpandCollapse = () => {\n const nextState = !expanded;\n\n if (isNil(controlledExpanded)) {\n setExpanded(nextState);\n }\n\n if (onExpandChange) {\n onExpandChange(nextState);\n }\n };\n\n const handleMinimise = () => {\n setContentMinimised(!contentMinimised);\n };\n\n // =============================================================================\n // HELPERS\n // =============================================================================\n function getInitialExpandState() {\n if (isMobile) {\n return true;\n }\n if (isNil(controlledExpanded)) {\n return !desktopCollapsible || initialExpanded;\n }\n return controlledExpanded;\n }\n\n // =============================================================================\n // RENDER\n // =============================================================================\n\n const renderAddon = () => {\n switch (addon?.type) {\n case \"popover\":\n return (\n <PopoverAddon\n addon={addon}\n rootNode={isMobile ? rootNode : undefined}\n />\n );\n default:\n return null;\n }\n };\n\n return (\n <div\n aria-labelledby={titleId}\n className={clsx(\n styles.filterItemWrapper,\n (collapsible || isMobile) && styles.filterItemWrapperDarker\n )}\n >\n <div\n className={clsx(\n styles.divider,\n (isMobile ? showMobileDivider : showDivider) &&\n styles.dividerVisible,\n isMobile && styles.dividerMobile\n )}\n />\n {(title || collapsible) && (\n <div\n className={clsx(\n styles.filterItemHeader,\n isMobile && styles.filterItemHeaderMobile\n )}\n >\n {title && (\n <h3\n id={titleId}\n data-testid=\"filter-item-title\"\n className={clsx(\n styles.filterItemTitle,\n isMobile && styles.filterItemTitleMobile\n )}\n >\n {title} {addon && renderAddon()}\n </h3>\n )}\n {collapsible && (\n <ClickableIcon\n className={styles.filterItemExpandButton}\n data-testid={\"expand-collapse-button\"}\n focusHighlight={false}\n focusOutline=\"browser\"\n onClick={handleExpandCollapse}\n aria-expanded={expanded}\n aria-disabled={!collapsible}\n aria-controls={contentId}\n >\n {title && <VisuallyHidden>{title}</VisuallyHidden>}\n <ChevronDownIcon\n aria-hidden\n className={clsx(\n styles.chevronIcon,\n expanded && styles.chevronIconExpanded\n )}\n />\n </ClickableIcon>\n )}\n </div>\n )}\n <animated.div\n className={styles.expandableItem}\n id={contentId}\n data-testid={\"expandable-container\"}\n data-expanded={expanded}\n style={itemAnimationStyles}\n inert={inertValue(!expanded)}\n >\n <div ref={itemResizeDetector.ref}>\n <div\n className={clsx(styles.filterItemBody, className)}\n {...otherProps}\n >\n <div\n ref={minimisableContentRef}\n data-testid=\"minimisable-container\"\n className={clsx(\n styles.minimisableContent,\n minimisable &&\n styles.minimisableContentMinimisable\n )}\n >\n <div ref={contentResizeDetector.ref}>\n <div data-id=\"content-container\">\n {typeof children === \"function\"\n ? children(mode, {\n minimised: contentMinimised,\n })\n : children}\n </div>\n </div>\n </div>\n {minimisable && (\n <Button\n className={styles.filterItemMinimiseButton}\n data-id=\"minimise-button\"\n sizeType=\"small\"\n styleType=\"link\"\n type=\"button\"\n onClick={handleMinimise}\n >\n <VisuallyHidden>{`view ${\n contentMinimised ? \"more\" : \"less\"\n } in ${title}`}</VisuallyHidden>\n <span aria-hidden>\n View {contentMinimised ? \"more\" : \"less\"}\n </span>\n </Button>\n )}\n </div>\n </div>\n </animated.div>\n </div>\n );\n};\n\nFilterItem.displayName = \"Filter.Item\";\n"],"names":["FilterItem","_a","collapsible","desktopCollapsible","initialExpanded","expanded","controlledExpanded","onExpandChange","minimisable","minimisedHeight","showDivider","showMobileDivider","title","addon","children","className","otherProps","__rest","mode","rootNode","useContext","FilterContext","isMobile","setExpanded","useState","getInitialExpandState","contentMinimised","setContentMinimised","itemResizeDetector","useResizeDetector","contentResizeDetector","itemAnimationStyles","useSpring","height","contentHeight","Math","min","_b","internalId","useId","contentId","titleId","minimisableContentRef","useRef","useApplyStyle","styles.tokens","minimisableContent","useEffect","isNil","_jsxs","clsx","styles.filterItemWrapper","styles.filterItemWrapperDarker","_jsx","styles.divider","styles.dividerVisible","styles.dividerMobile","styles.filterItemHeader","styles.filterItemHeaderMobile","id","styles.filterItemTitle","styles.filterItemTitleMobile","type","PopoverAddon","undefined","ClickableIcon","styles.filterItemExpandButton","focusHighlight","focusOutline","onClick","nextState","VisuallyHidden","ChevronDownIcon","styles.chevronIcon","styles.chevronIconExpanded","animated","div","styles.expandableItem","style","inert","inertValue","ref","Object","assign","styles.filterItemBody","styles.minimisableContent","styles.minimisableContentMinimisable","minimised","Button","styles.filterItemMinimiseButton","sizeType","styleType","displayName"],"mappings":"ypCAiBA,MAEaA,EAAcC,WACvBC,YAAaC,GAAqB,EAAIC,gBACtCA,GAAkB,EAClBC,SAAUC,EAAkBC,eAC5BA,EAAcC,YACdA,GAAc,EAAKC,gBACnBA,EAAeC,YACfA,GAAc,EAAIC,kBAClBA,GAAoB,EAAIC,MACxBA,EAAKC,MACLA,EAAKC,SACLA,EAAQC,UACRA,GAASd,EACNe,EAAUC,EAAAA,OAAAhB,EAbU,wKAkBvB,MAAMiB,KAAEA,EAAIC,SAAEA,GAAaC,EAAAA,WAAWC,EAAAA,eAChCC,EAAoB,WAATJ,GACVb,EAAUkB,GAAeC,EAAAA,SAASC,MAClCC,EAAkBC,GAAuBH,EAAAA,SAAShB,GACnDN,GAAeoB,GAAYnB,EAE3ByB,EAAqBC,EAAAA,oBACrBC,EAAwBD,EAAAA,oBACxBE,EAAsBC,EAAAA,UAAU,CAClCC,OAAQ5B,EAAWuB,EAAmBK,OAAS,IAE7CC,EAAgBR,EAChBjB,QAAAA,EACA0B,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fds-colour-bg);}
1
+ @layer fds{.f1afprn0{background-color:var(--fds-colour-bg);}
2
2
  .fo96iku{background-color:var(--fds-colour-bg-strong);}
3
3
  .d136l108{display:none;height:1px;background-color:var(--fds-colour-border);}
4
4
  .d89ue12{display:block;}
@@ -14,4 +14,4 @@
14
14
  .fu0jz3r{padding:var(--fds-spacing-24) var(--fds-spacing-20);}
15
15
  .m1n17l6q{--fds-internal-filter-minimisableContent-height:initial;height:var(--fds-internal-filter-minimisableContent-height);}
16
16
  .my7z4fl{overflow:hidden;}
17
- .fw516jj{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:0;margin:var(--fds-spacing-16) 0 0 0;}
17
+ .fw516jj{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding:0;margin:var(--fds-spacing-16) 0 0 0;}}
@@ -1,4 +1,4 @@
1
- .m19agezm{background-color:var(--fds-colour-bg-strong);height:100%;width:100%;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{.m19agezm{background-color:var(--fds-colour-bg-strong);height:100%;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
2
2
  .m11wuwo8{background-color:var(--fds-colour-bg);height:100%;width:100%;}
3
3
  .fidypou{height:100%;}
4
4
  .f1ijv0o9{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;background-color:var(--fds-colour-bg);}
@@ -7,4 +7,4 @@
7
7
  .f14huz7l{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-semibold);line-height:var(--fds-font-heading-lh-xs);letter-spacing:var(--fds-font-heading-ls-xs);color:var(--fds-colour-text);}
8
8
  .fxpov9b{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--fds-spacing-8);}
9
9
  .f14zog8f{background-color:transparent;height:100%;padding:var(--fds-spacing-24) var(--fds-spacing-20);}
10
- .flrfycx{width:100%;}
10
+ .flrfycx{width:100%;}}
@@ -1,5 +1,5 @@
1
- .d1a2pl71{background-color:var(--fds-colour-bg);border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);border-radius:var(--fds-radius-md);overflow:hidden;width:100%;}
1
+ @layer fds{.d1a2pl71{background-color:var(--fds-colour-bg);border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);border-radius:var(--fds-radius-md);overflow:hidden;width:100%;}
2
2
  .fq9unar{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;background-color:var(--fds-colour-bg);color:var(--fds-colour-text);}
3
3
  .fjfy2r5{-webkit-flex:1;-ms-flex:1;flex:1;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;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;gap:var(--fds-spacing-8);margin:var(--fds-spacing-24) 0 var(--fds-spacing-24) var(--fds-spacing-20);}
4
4
  .f1i4s84l{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-semibold);line-height:var(--fds-font-heading-lh-xs);letter-spacing:var(--fds-font-heading-ls-xs);}
5
- .f122t6n9{background-color:transparent;padding-right:var(--fds-spacing-20);padding-left:var(--fds-spacing-20);height:100%;}
5
+ .f122t6n9{background-color:transparent;padding-right:var(--fds-spacing-20);padding-left:var(--fds-spacing-20);height:100%;}}
@@ -1 +1 @@
1
- {"version":3,"file":"filter.js","sources":["../../../src/filter/filter.tsx"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { useMaxWidthMediaQuery } from \"../theme\";\nimport { FilterItemCheckbox } from \"./addons/filter-item-checkbox\";\nimport { FilterItem } from \"./filter-item\";\nimport { FilterItemPage } from \"./filter-item-page\";\nimport { FilterModal } from \"./filter-modal\";\nimport { FilterSidebar } from \"./filter-sidebar\";\nimport type { FilterProps } from \"./types\";\n\nexport const Filter = ({\n children,\n className,\n style,\n onDismiss,\n onDone,\n onModalOpen,\n toggleFilterButtonStyle,\n insets,\n id,\n \"data-testid\": testId,\n ...props\n}: FilterProps) => {\n const isMobile = useMaxWidthMediaQuery(\"lg\");\n\n useEffect(() => {\n if (!isMobile) {\n onDismiss?.();\n }\n }, [isMobile]);\n\n return (\n <div className={className} style={style} id={id} data-testid={testId}>\n {isMobile ? (\n <FilterModal\n onDismiss={onDismiss}\n onDone={onDone}\n onModalOpen={onModalOpen}\n toggleFilterButtonStyle={toggleFilterButtonStyle}\n insets={insets}\n {...props}\n >\n {typeof children === \"function\"\n ? children(\"mobile\")\n : children}\n </FilterModal>\n ) : (\n <FilterSidebar {...props}>\n {typeof children === \"function\"\n ? children(\"default\")\n : children}\n </FilterSidebar>\n )}\n </div>\n );\n};\n\nFilter.Sidebar = FilterSidebar;\nFilter.Modal = FilterModal;\nFilter.Item = FilterItem;\nFilter.Page = FilterItemPage;\nFilter.Checkbox = FilterItemCheckbox;\n"],"names":["Filter","_a","children","className","style","onDismiss","onDone","onModalOpen","toggleFilterButtonStyle","insets","id","testId","props","__rest","isMobile","useMaxWidthMediaQuery","useEffect","_jsx","FilterModal","Object","assign","FilterSidebar","Sidebar","Modal","Item","FilterItem","Page","FilterItemPage","Checkbox","FilterItemCheckbox"],"mappings":"6vBAUO,MAAMA,EAAUC,QAAAC,SACnBA,EAAQC,UACRA,EAASC,MACTA,EAAKC,UACLA,EAASC,OACTA,EAAMC,YACNA,EAAWC,wBACXA,EAAuBC,OACvBA,EAAMC,GACNA,EACA,cAAeC,GAAMV,EAClBW,EAAKC,EAAAA,OAAAZ,EAXW,CAAA,WAAA,YAAA,QAAA,YAAA,SAAA,cAAA,0BAAA,SAAA,KAAA,gBAanB,MAAMa,EAAWC,EAAAA,sBAAsB,MAQvC,OANAC,EAAAA,WAAU,KACDF,GACDT,SAAAA,GACJ,GACD,CAACS,IAGAG,EAAAA,WAAKd,UAAWA,EAAWC,MAAOA,EAAOM,GAAIA,EAAE,cAAeC,EAAMT,SAC/DY,EACGG,EAAAA,IAACC,cAAWC,OAAAC,OAAA,CACRf,UAAWA,EACXC,OAAQA,EACRC,YAAaA,EACbC,wBAAyBA,EACzBC,OAAQA,GACJG,EAAK,CAAAV,SAEY,mBAAbA,EACFA,EAAS,UACTA,KAGVe,EAAAA,IAACI,EAAAA,+BAAkBT,EAAK,CAAAV,SACC,mBAAbA,EACFA,EAAS,WACTA,MAGZ,EAIdF,EAAOsB,QAAUD,EAAAA,cACjBrB,EAAOuB,MAAQL,EAAAA,YACflB,EAAOwB,KAAOC,EAAAA,WACdzB,EAAO0B,KAAOC,EAAAA,eACd3B,EAAO4B,SAAWC,EAAAA"}
1
+ {"version":3,"file":"filter.js","sources":["../../../src/filter/filter.tsx"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { useMaxWidthMediaQuery } from \"../theme\";\nimport { FilterItemCheckbox } from \"./addons/filter-item-checkbox\";\nimport { FilterItem } from \"./filter-item\";\nimport { FilterItemPage } from \"./filter-item-page\";\nimport { FilterModal } from \"./filter-modal\";\nimport { FilterSidebar } from \"./filter-sidebar\";\nimport type { FilterProps } from \"./types\";\n\n/**\n * A responsive filter panel that switches between a persistent sidebar on\n * desktop and a modal overlay on mobile.\n *\n * Use `Filter` to let users narrow a result set by one or more criteria.\n * On mobile (below lg breakpoint) the panel is hidden behind a toggle button and\n * rendered in a full-screen modal; otherwise it is displayed as a\n * fixed sidebar.\n *\n * Sub-components:\n * - `Filter.Sidebar` — standalone desktop sidebar, used by `Filter` internally.\n * - `Filter.Modal` — standalone mobile modal, used by `Filter` internally.\n * - `Filter.Item` — a collapsible section within the panel.\n * - `Filter.Page` — a drill-down sub-page inside the mobile modal.\n * - `Filter.Checkbox` — a filter item with selectable checkbox or toggle options.\n */\nexport const Filter = ({\n children,\n className,\n style,\n onDismiss,\n onDone,\n onModalOpen,\n toggleFilterButtonStyle,\n insets,\n id,\n \"data-testid\": testId,\n ...props\n}: FilterProps) => {\n const isMobile = useMaxWidthMediaQuery(\"lg\");\n\n useEffect(() => {\n if (!isMobile) {\n onDismiss?.();\n }\n }, [isMobile]);\n\n return (\n <div className={className} style={style} id={id} data-testid={testId}>\n {isMobile ? (\n <FilterModal\n onDismiss={onDismiss}\n onDone={onDone}\n onModalOpen={onModalOpen}\n toggleFilterButtonStyle={toggleFilterButtonStyle}\n insets={insets}\n {...props}\n >\n {typeof children === \"function\"\n ? children(\"mobile\")\n : children}\n </FilterModal>\n ) : (\n <FilterSidebar {...props}>\n {typeof children === \"function\"\n ? children(\"default\")\n : children}\n </FilterSidebar>\n )}\n </div>\n );\n};\n\n/** Standalone desktop sidebar variant of the filter panel. */\nFilter.Sidebar = FilterSidebar;\n/** Standalone mobile modal variant of the filter panel. */\nFilter.Modal = FilterModal;\n/** A collapsible section within a filter panel. */\nFilter.Item = FilterItem;\n/** A full-screen sub-page overlay for drill-down selection in the mobile modal. */\nFilter.Page = FilterItemPage;\n/** A filter item that renders selectable checkboxes (desktop) or toggle chips (mobile). */\nFilter.Checkbox = FilterItemCheckbox;\n"],"names":["Filter","_a","children","className","style","onDismiss","onDone","onModalOpen","toggleFilterButtonStyle","insets","id","testId","props","__rest","isMobile","useMaxWidthMediaQuery","useEffect","_jsx","FilterModal","Object","assign","FilterSidebar","Sidebar","Modal","Item","FilterItem","Page","FilterItemPage","Checkbox","FilterItemCheckbox"],"mappings":"6vBA0BO,MAAMA,EAAUC,QAAAC,SACnBA,EAAQC,UACRA,EAASC,MACTA,EAAKC,UACLA,EAASC,OACTA,EAAMC,YACNA,EAAWC,wBACXA,EAAuBC,OACvBA,EAAMC,GACNA,EACA,cAAeC,GAAMV,EAClBW,EAAKC,EAAAA,OAAAZ,EAXW,CAAA,WAAA,YAAA,QAAA,YAAA,SAAA,cAAA,0BAAA,SAAA,KAAA,gBAanB,MAAMa,EAAWC,EAAAA,sBAAsB,MAQvC,OANAC,EAAAA,WAAU,KACDF,GACDT,SAAAA,GACJ,GACD,CAACS,IAGAG,EAAAA,WAAKd,UAAWA,EAAWC,MAAOA,EAAOM,GAAIA,EAAE,cAAeC,EAAMT,SAC/DY,EACGG,EAAAA,IAACC,cAAWC,OAAAC,OAAA,CACRf,UAAWA,EACXC,OAAQA,EACRC,YAAaA,EACbC,wBAAyBA,EACzBC,OAAQA,GACJG,EAAK,CAAAV,SAEY,mBAAbA,EACFA,EAAS,UACTA,KAGVe,EAAAA,IAACI,EAAAA,+BAAkBT,EAAK,CAAAV,SACC,mBAAbA,EACFA,EAAS,WACTA,MAGZ,EAKdF,EAAOsB,QAAUD,EAAAA,cAEjBrB,EAAOuB,MAAQL,EAAAA,YAEflB,EAAOwB,KAAOC,EAAAA,WAEdzB,EAAO0B,KAAOC,EAAAA,eAEd3B,EAAO4B,SAAWC,EAAAA"}
@@ -1,5 +1,5 @@
1
- .fh4ozpc{-webkit-flex:1;-ms-flex:1;flex:1;width:100%;overflow-y:auto;color:var(--fds-colour-text);}
1
+ @layer fds{.fh4ozpc{-webkit-flex:1;-ms-flex:1;flex:1;width:100%;overflow-y:auto;color:var(--fds-colour-text);}
2
2
  .f3bn9l4{padding:var(--fds-spacing-24) var(--fds-spacing-20);margin-right:auto;color:var(--fds-colour-icon);}.f3bn9l4 svg{height:1.5rem;width:1.5rem;}.f3bn9l4:hover{color:var(--fds-colour-icon-hover);}
3
3
  .fp6e1r1{padding:var(--fds-spacing-24) var(--fds-spacing-20);background-color:var(--fds-colour-bg);border-top:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);}
4
4
  .f8nn92t{--fds-internal-filter-filterFooter-insetBottom:initial;padding-bottom:var(--fds-internal-filter-filterFooter-insetBottom);}
5
- .f1iv2dy9{width:100%;}
5
+ .f1iv2dy9{width:100%;}}
@@ -1,4 +1,4 @@
1
- .wmm1xbv{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;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}:where(body.fds-breakpoint-lg-max) .wmm1xbv{-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;padding:0;}
1
+ @layer fds{.wmm1xbv{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;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}:where(body.fds-breakpoint-lg-max) .wmm1xbv{-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;padding:0;}
2
2
  .l171bo4j{margin-bottom:var(--fds-spacing-16);color:var(--fds-footer-colour-text);}
3
3
  .a17bpz54{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;row-gap:var(--fds-spacing-16);-webkit-column-gap:var(--fds-spacing-16);column-gap:var(--fds-spacing-16);}
4
- .a30jq0e img{width:auto;height:3.75rem;object-fit:contain;display:block;}:where(body.fds-breakpoint-lg-max) .a30jq0e img{height:3rem;width:100%;}
4
+ .a30jq0e img{width:auto;height:3.75rem;object-fit:contain;display:block;}:where(body.fds-breakpoint-lg-max) .a30jq0e img{height:3rem;width:100%;}}
@@ -1,4 +1,4 @@
1
- .ieulqso{max-height:var(--fds-spacing-72);max-width:100%;}
1
+ @layer fds{.ieulqso{max-height:var(--fds-spacing-72);max-width:100%;}
2
2
  .gaeoncc{height:4.5rem;}
3
3
  .prt8kdt{height:3.5rem;}
4
- .ich52w2{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;gap:var(--fds-spacing-32);margin-top:var(--fds-spacing-16);}
4
+ .ich52w2{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;gap:var(--fds-spacing-32);margin-top:var(--fds-spacing-16);}}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("../_virtual/_tslib.js"),o=require("react/jsx-runtime"),t=require("clsx"),r=require("react"),s=require("../divider/divider.js"),i=require("../layout/index.js"),n=require("../theme/theme-provider/context.js"),l=require("../typography/index.js"),a=require("./footer.styles.js"),c=require("./footer-download-app.js"),d=require("./footer-helper.js"),u=require("./footer-resource-addon.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=h(t);exports.Footer=t=>{var{children:h,links:p,lastUpdated:j,disclaimerLinks:g,showDownloadAddon:x,showResourceAddon:y,logoSrc:f,copyrightInfo:k,onFooterLinkClick:v,layout:N="default",hideLogo:S,className:L}=t,b=e.__rest(t,["children","links","lastUpdated","disclaimerLinks","showDownloadAddon","showResourceAddon","logoSrc","copyrightInfo","onFooterLinkClick","layout","hideLogo","className"]);const q="stretch"===N,C=r.useContext(n.ThemeContext),F=t=>t.map(((t,r)=>{const{"data-options":s}=t,i=e.__rest(t,["data-options"]);return o.jsx("li",{children:o.jsx(l.Typography.LinkMD,Object.assign({underlineStyle:"none",className:a.footerLink},i,{onClick:e=>((e,o)=>{o.onClick?(e.preventDefault(),o.onClick(e)):v&&(e.preventDefault(),v(o))})(e,t)}))},r)}));return o.jsxs("footer",Object.assign({},b,{className:m.default(a.baseFooter,L),children:[(()=>{let t=null;if(h)return h;if(p||x){const r=d.FooterHelper.getFooterLogoAttribute(null==C?void 0:C.theme),{src:s,logoType:i}=r,n=e.__rest(r,["src","logoType"]);t=o.jsxs(o.Fragment,{children:[(f||s)&&!S&&o.jsx("div",{"data-testid":"logo-section",className:a.logoSection,children:o.jsx("img",Object.assign({src:f||s,"data-testid":"logo",className:m.default(a.logoImage,i&&a.logoSize[i])},n))}),o.jsx("div",{className:a.linkSectionWrapper,children:null==p?void 0:p.map(((e,t)=>o.jsx("ul",{"data-testid":`link-col-${t}`,className:a.linkSection,children:F(e)},`link-col-${t}`)))}),x&&o.jsx("div",{className:a.addonSection,children:o.jsx(c.DownloadApp,{})}),!x&&y&&o.jsx("div",{className:a.addonSection,children:o.jsx(u.ResourceAddon,{})})]})}return t?o.jsxs(o.Fragment,{children:[o.jsx(i.Layout.Content,{className:a.topSection,stretch:q,children:t}),o.jsx(s.Divider,{className:a.fullWidthDivider})]}):null})(),o.jsxs(i.Layout.Content,{className:a.bottomSection,stretch:q,children:[o.jsx("div",{className:a.bottomSectionContent,children:(()=>{const e=d.FooterHelper.getDisclaimerLinks(null==C?void 0:C.theme,g);return Object.keys(e).map((t=>o.jsx(l.Typography.LinkXS,Object.assign({underlineStyle:"none",className:a.disclaimerTextLink},e[t]),t)))})()},"disclaimer"),o.jsx("div",{className:m.default(a.bottomSectionContent,a.copyrightSection),children:o.jsx(l.Typography.BodyXS,{"data-testid":"copyright-text",className:a.copyrightText,children:k||o.jsxs(o.Fragment,{children:["©"," ",d.FooterHelper.getCopyrightInfo(j,null==C?void 0:C.theme)]})})},"copyright")]})]}))};
1
+ "use strict";var e=require("../_virtual/_tslib.js"),t=require("react/jsx-runtime"),o=require("clsx"),r=require("react"),s=require("../divider/divider.js"),i=require("../layout/index.js"),n=require("../theme/theme-provider/context.js"),l=require("../typography/index.js"),a=require("./footer.styles.js"),c=require("./footer-download-app.js"),d=require("./footer-helper.js"),u=require("./footer-resource-addon.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=h(o);exports.Footer=o=>{var{children:h,links:p,lastUpdated:g,disclaimerLinks:j,showDownloadAddon:x,showResourceAddon:y,logoSrc:f,logoAlt:k="",copyrightInfo:v,onFooterLinkClick:N,layout:S="default",hideLogo:L,className:b}=o,q=e.__rest(o,["children","links","lastUpdated","disclaimerLinks","showDownloadAddon","showResourceAddon","logoSrc","logoAlt","copyrightInfo","onFooterLinkClick","layout","hideLogo","className"]);const C="stretch"===S,F=r.useContext(n.ThemeContext),A=o=>o.map(((o,r)=>{const{"data-options":s}=o,i=e.__rest(o,["data-options"]);return t.jsx("li",{children:t.jsx(l.Typography.LinkMD,Object.assign({underlineStyle:"none",className:a.footerLink},i,{onClick:e=>((e,t)=>{t.onClick?(e.preventDefault(),t.onClick(e)):N&&(e.preventDefault(),N(t))})(e,o)}))},r)}));return t.jsxs("footer",Object.assign({},q,{className:m.default(a.baseFooter,b),children:[(()=>{let o=null;if(h)return h;if(p||x){const r=d.FooterHelper.getFooterLogoAttribute(null==F?void 0:F.theme),{src:s,alt:i,logoType:n}=r,l=e.__rest(r,["src","alt","logoType"]);o=t.jsxs(t.Fragment,{children:[(f||s)&&!L&&t.jsx("div",{"data-testid":"logo-section",className:a.logoSection,children:t.jsx("img",Object.assign({src:f||s,"data-testid":"logo",className:m.default(a.logoImage,n&&a.logoSize[n]),alt:k||i},l))}),t.jsx("div",{className:a.linkSectionWrapper,children:null==p?void 0:p.map(((e,o)=>t.jsx("ul",{"data-testid":`link-col-${o}`,className:a.linkSection,children:A(e)},`link-col-${o}`)))}),x&&t.jsx("div",{className:a.addonSection,children:t.jsx(c.DownloadApp,{})}),!x&&y&&t.jsx("div",{className:a.addonSection,children:t.jsx(u.ResourceAddon,{})})]})}return o?t.jsxs(t.Fragment,{children:[t.jsx(i.Layout.Content,{className:a.topSection,stretch:C,children:o}),t.jsx(s.Divider,{className:a.fullWidthDivider})]}):null})(),t.jsxs(i.Layout.Content,{className:a.bottomSection,stretch:C,children:[t.jsx("div",{className:a.bottomSectionContent,children:(()=>{const e=d.FooterHelper.getDisclaimerLinks(null==F?void 0:F.theme,j);return Object.keys(e).map((o=>t.jsx(l.Typography.LinkXS,Object.assign({underlineStyle:"none",className:a.disclaimerTextLink},e[o]),o)))})()},"disclaimer"),t.jsx("div",{className:m.default(a.bottomSectionContent,a.copyrightSection),children:t.jsx(l.Typography.BodyXS,{"data-testid":"copyright-text",className:a.copyrightText,children:v||t.jsxs(t.Fragment,{children:["©"," ",d.FooterHelper.getCopyrightInfo(g,null==F?void 0:F.theme)]})})},"copyright")]})]}))};
2
2
  //# sourceMappingURL=footer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"footer.js","sources":["../../../src/footer/footer.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type React from \"react\";\nimport { useContext } from \"react\";\n\nimport { Divider } from \"../divider\";\nimport { Layout } from \"../layout\";\nimport { ThemeContext } from \"../theme/theme-provider/context\";\nimport { Typography } from \"../typography\";\nimport * as styles from \"./footer.styles\";\nimport { DownloadApp } from \"./footer-download-app\";\nimport type { InternalDisclaimerLinks } from \"./footer-helper\";\nimport { FooterHelper } from \"./footer-helper\";\nimport { ResourceAddon } from \"./footer-resource-addon\";\nimport type { FooterLinkProps, FooterProps } from \"./types\";\n\nexport const Footer = <T,>({\n children,\n links,\n lastUpdated,\n disclaimerLinks,\n showDownloadAddon,\n showResourceAddon,\n logoSrc,\n copyrightInfo,\n onFooterLinkClick,\n layout = \"default\",\n hideLogo,\n className,\n ...otherProps\n}: FooterProps<T>) => {\n // =============================================================================\n // CONST, STATE, REFS\n // =============================================================================\n const isStretch = layout === \"stretch\";\n const theme = useContext(ThemeContext);\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleLinkClick = <K extends T>(\n event: React.MouseEvent<HTMLAnchorElement>,\n item: FooterLinkProps<K>\n ) => {\n /**\n * Individual link onClick will override\n * the onFooterLinkClick callback\n */\n if (item.onClick) {\n event.preventDefault();\n item.onClick(event);\n } else if (onFooterLinkClick) {\n event.preventDefault();\n onFooterLinkClick(item);\n } else {\n // do nothing, let default behaviour happen\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderDisclaimerLinks = () => {\n const links = FooterHelper.getDisclaimerLinks(\n theme?.theme,\n disclaimerLinks\n );\n\n return (Object.keys(links) as (keyof InternalDisclaimerLinks)[]).map(\n (key) => {\n return (\n <Typography.LinkXS\n key={key}\n underlineStyle=\"none\"\n className={styles.disclaimerTextLink}\n {...links[key]}\n />\n );\n }\n );\n };\n\n const renderFooterLinks = (links: FooterLinkProps<T>[]) => {\n return links.map((link, index) => {\n const { \"data-options\": _options, ...otherProps } = link;\n\n return (\n <li key={index}>\n <Typography.LinkMD\n underlineStyle=\"none\"\n className={styles.footerLink}\n {...otherProps}\n onClick={(event) => handleLinkClick(event, link)}\n />\n </li>\n );\n });\n };\n\n const renderTopSection = () => {\n let component: React.ReactNode = null;\n\n if (children) {\n return children;\n }\n\n if (links || showDownloadAddon) {\n const { src, logoType, ...otherLogoAttributes } =\n FooterHelper.getFooterLogoAttribute(theme?.theme);\n component = (\n <>\n {(logoSrc || src) && !hideLogo && (\n <div\n data-testid=\"logo-section\"\n className={styles.logoSection}\n >\n <img\n src={logoSrc || src}\n data-testid=\"logo\"\n className={clsx(\n styles.logoImage,\n logoType && styles.logoSize[logoType]\n )}\n {...otherLogoAttributes}\n />\n </div>\n )}\n <div className={styles.linkSectionWrapper}>\n {links?.map((columnLinks, columnIndex) => (\n <ul\n key={`link-col-${columnIndex}`}\n data-testid={`link-col-${columnIndex}`}\n className={styles.linkSection}\n >\n {renderFooterLinks(columnLinks)}\n </ul>\n ))}\n </div>\n {showDownloadAddon && (\n <div className={styles.addonSection}>\n <DownloadApp />\n </div>\n )}\n {/* when showDownloadAddon and showResourceAddon are enabled, showDownloadAddon should take priority to being rendered */}\n {!showDownloadAddon && showResourceAddon && (\n <div className={styles.addonSection}>\n <ResourceAddon />\n </div>\n )}\n </>\n );\n }\n\n if (component) {\n return (\n <>\n <Layout.Content\n className={styles.topSection}\n stretch={isStretch}\n >\n {component}\n </Layout.Content>\n <Divider className={styles.fullWidthDivider} />\n </>\n );\n }\n\n return null;\n };\n return (\n <footer {...otherProps} className={clsx(styles.baseFooter, className)}>\n {renderTopSection()}\n <Layout.Content\n className={styles.bottomSection}\n stretch={isStretch}\n >\n <div key=\"disclaimer\" className={styles.bottomSectionContent}>\n {renderDisclaimerLinks()}\n </div>\n <div\n key=\"copyright\"\n className={clsx(\n styles.bottomSectionContent,\n styles.copyrightSection\n )}\n >\n <Typography.BodyXS\n data-testid={\"copyright-text\"}\n className={styles.copyrightText}\n >\n {copyrightInfo || (\n <>\n &copy;{\" \"}\n {FooterHelper.getCopyrightInfo(\n lastUpdated,\n theme?.theme\n )}\n </>\n )}\n </Typography.BodyXS>\n </div>\n </Layout.Content>\n </footer>\n );\n};\n"],"names":["_a","children","links","lastUpdated","disclaimerLinks","showDownloadAddon","showResourceAddon","logoSrc","copyrightInfo","onFooterLinkClick","layout","hideLogo","className","otherProps","__rest","isStretch","theme","useContext","ThemeContext","renderFooterLinks","map","link","index","_options","_jsx","Typography","LinkMD","Object","assign","underlineStyle","styles.footerLink","onClick","event","item","preventDefault","handleLinkClick","_jsxs","clsx","styles.baseFooter","component","FooterHelper","getFooterLogoAttribute","src","logoType","otherLogoAttributes","_Fragment","styles.logoSection","styles.logoImage","styles.logoSize","styles.linkSectionWrapper","columnLinks","columnIndex","styles.linkSection","styles.addonSection","DownloadApp","ResourceAddon","Layout","Content","styles.topSection","stretch","Divider","styles.fullWidthDivider","renderTopSection","styles.bottomSection","styles.bottomSectionContent","getDisclaimerLinks","keys","key","LinkXS","styles.disclaimerTextLink","renderDisclaimerLinks","styles.copyrightSection","BodyXS","styles.copyrightText","getCopyrightInfo"],"mappings":"+fAe2BA,IAAA,IAAAC,SACvBA,EAAQC,MACRA,EAAKC,YACLA,EAAWC,gBACXA,EAAeC,kBACfA,EAAiBC,kBACjBA,EAAiBC,QACjBA,EAAOC,cACPA,EAAaC,kBACbA,EAAiBC,OACjBA,EAA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AALA,EAAOA,aAfnB,mBAsBP"}
1
+ {"version":3,"file":"footer.js","sources":["../../../src/footer/footer.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type React from \"react\";\nimport { useContext } from \"react\";\n\nimport { Divider } from \"../divider\";\nimport { Layout } from \"../layout\";\nimport { ThemeContext } from \"../theme/theme-provider/context\";\nimport { Typography } from \"../typography\";\nimport * as styles from \"./footer.styles\";\nimport { DownloadApp } from \"./footer-download-app\";\nimport type { InternalDisclaimerLinks } from \"./footer-helper\";\nimport { FooterHelper } from \"./footer-helper\";\nimport { ResourceAddon } from \"./footer-resource-addon\";\nimport type { FooterLinkProps, FooterProps } from \"./types\";\n\n/**\n * Site-wide footer with navigation links, branding, and legal copy.\n *\n * Use `Footer` at the bottom of a page to surface navigation links grouped\n * into columns, a theme-appropriate logo, download-app or resource add-ons,\n * and disclaimer links with auto-generated copyright text.\n */\nexport const Footer = <T,>({\n children,\n links,\n lastUpdated,\n disclaimerLinks,\n showDownloadAddon,\n showResourceAddon,\n logoSrc,\n logoAlt = \"\",\n copyrightInfo,\n onFooterLinkClick,\n layout = \"default\",\n hideLogo,\n className,\n ...otherProps\n}: FooterProps<T>) => {\n // =============================================================================\n // CONST, STATE, REFS\n // =============================================================================\n const isStretch = layout === \"stretch\";\n const theme = useContext(ThemeContext);\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleLinkClick = <K extends T>(\n event: React.MouseEvent<HTMLAnchorElement>,\n item: FooterLinkProps<K>\n ) => {\n /**\n * Individual link onClick will override\n * the onFooterLinkClick callback\n */\n if (item.onClick) {\n event.preventDefault();\n item.onClick(event);\n } else if (onFooterLinkClick) {\n event.preventDefault();\n onFooterLinkClick(item);\n } else {\n // do nothing, let default behaviour happen\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderDisclaimerLinks = () => {\n const links = FooterHelper.getDisclaimerLinks(\n theme?.theme,\n disclaimerLinks\n );\n\n return (Object.keys(links) as (keyof InternalDisclaimerLinks)[]).map(\n (key) => {\n return (\n <Typography.LinkXS\n key={key}\n underlineStyle=\"none\"\n className={styles.disclaimerTextLink}\n {...links[key]}\n />\n );\n }\n );\n };\n\n const renderFooterLinks = (links: FooterLinkProps<T>[]) => {\n return links.map((link, index) => {\n const { \"data-options\": _options, ...otherProps } = link;\n\n return (\n <li key={index}>\n <Typography.LinkMD\n underlineStyle=\"none\"\n className={styles.footerLink}\n {...otherProps}\n onClick={(event) => handleLinkClick(event, link)}\n />\n </li>\n );\n });\n };\n\n const renderTopSection = () => {\n let component: React.ReactNode = null;\n\n if (children) {\n return children;\n }\n\n if (links || showDownloadAddon) {\n const { src, alt, logoType, ...otherLogoAttributes } =\n FooterHelper.getFooterLogoAttribute(theme?.theme);\n component = (\n <>\n {(logoSrc || src) && !hideLogo && (\n <div\n data-testid=\"logo-section\"\n className={styles.logoSection}\n >\n <img\n src={logoSrc || src}\n data-testid=\"logo\"\n className={clsx(\n styles.logoImage,\n logoType && styles.logoSize[logoType]\n )}\n alt={logoAlt || alt}\n {...otherLogoAttributes}\n />\n </div>\n )}\n <div className={styles.linkSectionWrapper}>\n {links?.map((columnLinks, columnIndex) => (\n <ul\n key={`link-col-${columnIndex}`}\n data-testid={`link-col-${columnIndex}`}\n className={styles.linkSection}\n >\n {renderFooterLinks(columnLinks)}\n </ul>\n ))}\n </div>\n {showDownloadAddon && (\n <div className={styles.addonSection}>\n <DownloadApp />\n </div>\n )}\n {/* when showDownloadAddon and showResourceAddon are enabled, showDownloadAddon should take priority to being rendered */}\n {!showDownloadAddon && showResourceAddon && (\n <div className={styles.addonSection}>\n <ResourceAddon />\n </div>\n )}\n </>\n );\n }\n\n if (component) {\n return (\n <>\n <Layout.Content\n className={styles.topSection}\n stretch={isStretch}\n >\n {component}\n </Layout.Content>\n <Divider className={styles.fullWidthDivider} />\n </>\n );\n }\n\n return null;\n };\n return (\n <footer {...otherProps} className={clsx(styles.baseFooter, className)}>\n {renderTopSection()}\n <Layout.Content\n className={styles.bottomSection}\n stretch={isStretch}\n >\n <div key=\"disclaimer\" className={styles.bottomSectionContent}>\n {renderDisclaimerLinks()}\n </div>\n <div\n key=\"copyright\"\n className={clsx(\n styles.bottomSectionContent,\n styles.copyrightSection\n )}\n >\n <Typography.BodyXS\n data-testid={\"copyright-text\"}\n className={styles.copyrightText}\n >\n {copyrightInfo || (\n <>\n &copy;{\" \"}\n {FooterHelper.getCopyrightInfo(\n lastUpdated,\n theme?.theme\n )}\n </>\n )}\n </Typography.BodyXS>\n </div>\n </Layout.Content>\n </footer>\n );\n};\n"],"names":["_a","children","links","lastUpdated","disclaimerLinks","showDownloadAddon","showResourceAddon","logoSrc","logoAlt","copyrightInfo","onFooterLinkClick","layout","hideLogo","className","otherProps","__rest","isStretch","theme","useContext","ThemeContext","renderFooterLinks","map","link","index","_options","_jsx","Typography","LinkMD","Object","assign","underlineStyle","styles.footerLink","onClick","event","item","preventDefault","handleLinkClick","_jsxs","clsx","styles.baseFooter","component","FooterHelper","getFooterLogoAttribute","src","alt","logoType","otherLogoAttributes","_Fragment","styles.logoSection","styles.logoImage","styles.logoSize","styles.linkSectionWrapper","columnLinks","columnIndex","styles.linkSection","styles.addonSection","DownloadApp","ResourceAddon","Layout","Content","styles.topSection","stretch","Divider","styles.fullWidthDivider","renderTopSection","styles.bottomSection","styles.bottomSectionContent","getDisclaimerLinks","keys","key","LinkXS","styles.disclaimerTextLink","renderDisclaimerLinks","styles.copyrightSection","BodyXS","styles.copyrightText","getCopyrightInfo"],"mappings":"+fAsB2BA,IAAA,IAAAC,SACvBA,EAAQC,MACRA,EAAKC,YACLA,EAAWC,gBACXA,EAAeC,kBACfA,EAAiBC,kBACjBA,EAAiBC,QACjBA,EAAOC,QACPA,EAAU,GAAEC,cACZA,EAAaC,kBACbA,EAAiBC,OACjBA,EAAS,UAASC,SAClBA,EAAQC,UACRA,GAASb,EACNc,EAAUC,EAAAA,OAAAf,EAdU,sLAmBvB,MAAMgB,EAAuB,YAAXL,EACZM,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
1
+ @layer fds{.b1ozupxm{background:var(--fds-footer-colour-bg);}
2
2
  .f1b3ng0m{color:var(--fds-footer-link-colour-text);}.f1b3ng0m:hover{color:var(--fds-footer-link-colour-text-hover);}
3
3
  .f1f7a2pi{width:100%;}
4
4
  .t1nab4kr{padding:var(--fds-spacing-64) 0;}:where(body.fds-breakpoint-lg-max) .t1nab4kr{padding:var(--fds-spacing-32) 0;}:where(body.fds-breakpoint-lg-max) .t1nab4kr [data-id="container"]{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--fds-spacing-32);}
@@ -16,4 +16,4 @@
16
16
  .bakpusz{-webkit-flex:1 1 50%;-ms-flex:1 1 50%;flex:1 1 50%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}:where(body.fds-breakpoint-lg-max) .bakpusz{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--fds-spacing-8);}:where(body.fds-breakpoint-lg-max) .bakpusz:not(:last-child){margin-right:0;}
17
17
  .cb1d27e{-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;}:where(body.fds-breakpoint-lg-max) .cb1d27e{margin-top:var(--fds-spacing-16);-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;}
18
18
  .cntgl6w{color:var(--fds-footer-colour-text);}
19
- .d2vgmpj{color:var(--fds-footer-disclaimer-link-colour-text);}.d2vgmpj:not(:last-child){margin-right:var(--fds-spacing-16);}.d2vgmpj:hover{color:var(--fds-footer-disclaimer-link-colour-text-hover);}:where(body.fds-breakpoint-lg-max) .d2vgmpj:not(:last-child){margin-right:0;}
19
+ .d2vgmpj{color:var(--fds-footer-disclaimer-link-colour-text);}.d2vgmpj:not(:last-child){margin-right:var(--fds-spacing-16);}.d2vgmpj:hover{color:var(--fds-footer-disclaimer-link-colour-text-hover);}:where(body.fds-breakpoint-lg-max) .d2vgmpj:not(:last-child){margin-right:0;}}
@@ -1 +1 @@
1
- .akbk9y1{padding-left:var(--fds-spacing-4);display:inline;}
1
+ @layer fds{.akbk9y1{padding-left:var(--fds-spacing-4);display:inline;}}
@@ -1,2 +1,2 @@
1
- "use strict";require("./form-label.styles_11r0652.css");exports.errorIcon="eyg2zu6",exports.errorMessage="e39ds6s",exports.errorMessageContainer="e4aab9k",exports.label="lf1tnj",exports.labelContainer="l170pjsx",exports.subtitle="s1n6ixex";
1
+ "use strict";require("./form-label.styles_1nbe0bm.css");exports.errorIcon="eyg2zu6",exports.errorMessage="e39ds6s",exports.errorMessageContainer="e4aab9k",exports.label="lf1tnj",exports.labelContainer="l170pjsx",exports.subtitle="s1n6ixex";
2
2
  //# sourceMappingURL=form-label.styles.js.map