@lifesg/react-design-system 4.0.0-alpha.3 → 4.0.0-alpha.4

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 (1304) hide show
  1. package/accordion/accordion-item.styles.js +1 -1
  2. package/accordion/accordion-item.styles.js.map +1 -1
  3. package/accordion/{accordion-item.styles_kchcad.css → accordion-item.styles_1j4eb32.css} +2 -2
  4. package/accordion/accordion.styles.js +1 -1
  5. package/{cjs/accordion/accordion.styles_ijglff.css → accordion/accordion.styles_bzrfrs.css} +1 -1
  6. package/alert/alert.styles.js +1 -1
  7. package/alert/alert.styles.js.map +1 -1
  8. package/{cjs/alert/alert.styles_1ygel36.css → alert/alert.styles_patwo2.css} +4 -4
  9. package/badge/badge.js +1 -1
  10. package/badge/badge.js.map +1 -1
  11. package/badge/badge.styles.js +1 -1
  12. package/badge/badge.styles_1c3c6wj.css +16 -0
  13. package/badge/types.d.ts +1 -1
  14. package/box-container/box-container.styles.js +1 -1
  15. package/box-container/box-container.styles.js.map +1 -1
  16. package/box-container/{box-container.styles_5y84d5.css → box-container.styles_5t2j9k.css} +2 -2
  17. package/breadcrumb/breadcrumb.js +1 -1
  18. package/breadcrumb/breadcrumb.js.map +1 -1
  19. package/button/button.styles.js +1 -1
  20. package/button/button.styles.js.map +1 -1
  21. package/button/{button.styles_bcpkzm.css → button.styles_1pxy0co.css} +3 -3
  22. package/calendar/calendar.js +1 -1
  23. package/calendar/calendar.js.map +1 -1
  24. package/cjs/accordion/accordion-item.styles.js +1 -1
  25. package/cjs/accordion/accordion-item.styles.js.map +1 -1
  26. package/cjs/accordion/{accordion-item.styles_kchcad.css → accordion-item.styles_1j4eb32.css} +2 -2
  27. package/cjs/accordion/accordion.styles.js +1 -1
  28. package/{accordion/accordion.styles_ijglff.css → cjs/accordion/accordion.styles_bzrfrs.css} +1 -1
  29. package/cjs/alert/alert.styles.js +1 -1
  30. package/cjs/alert/alert.styles.js.map +1 -1
  31. package/{alert/alert.styles_1ygel36.css → cjs/alert/alert.styles_patwo2.css} +4 -4
  32. package/cjs/badge/badge.js +1 -1
  33. package/cjs/badge/badge.js.map +1 -1
  34. package/cjs/badge/badge.styles.js +1 -1
  35. package/cjs/badge/badge.styles_1c3c6wj.css +16 -0
  36. package/cjs/box-container/box-container.styles.js +1 -1
  37. package/cjs/box-container/box-container.styles.js.map +1 -1
  38. package/cjs/box-container/{box-container.styles_5y84d5.css → box-container.styles_5t2j9k.css} +2 -2
  39. package/cjs/breadcrumb/breadcrumb.js +1 -1
  40. package/cjs/breadcrumb/breadcrumb.js.map +1 -1
  41. package/cjs/button/button.styles.js +1 -1
  42. package/cjs/button/button.styles.js.map +1 -1
  43. package/cjs/button/{button.styles_bcpkzm.css → button.styles_1pxy0co.css} +3 -3
  44. package/cjs/calendar/calendar.js +1 -1
  45. package/cjs/calendar/calendar.js.map +1 -1
  46. package/cjs/countdown-timer/countdown-timer.styles.js +1 -1
  47. package/cjs/countdown-timer/{countdown-timer.styles_k50tkw.css → countdown-timer.styles_ipn1b0.css} +1 -1
  48. package/cjs/dashed-border/dashed-border.js +1 -1
  49. package/cjs/dashed-border/dashed-border.js.map +1 -1
  50. package/cjs/data-table/data-table.js +1 -1
  51. package/cjs/data-table/data-table.js.map +1 -1
  52. package/cjs/data-table/data-table.styles.js +1 -1
  53. package/cjs/data-table/{data-table.styles_1nj2uzq.css → data-table.styles_1iqq1g7.css} +1 -1
  54. package/cjs/date-input/date-input.js +1 -1
  55. package/cjs/date-input/date-input.js.map +1 -1
  56. package/cjs/date-navigator/date-navigator.styles.js +1 -1
  57. package/cjs/date-navigator/date-navigator.styles.js.map +1 -1
  58. package/cjs/date-navigator/date-navigator.styles_wokh56.css +4 -0
  59. package/cjs/divider/divider.js.map +1 -1
  60. package/cjs/e-signature/e-signature-canvas.js +1 -1
  61. package/cjs/e-signature/e-signature-canvas.js.map +1 -1
  62. package/cjs/e-signature/e-signature.js +1 -1
  63. package/cjs/e-signature/e-signature.js.map +1 -1
  64. package/cjs/e-signature/e-signature.styles.js +1 -168
  65. package/cjs/e-signature/e-signature.styles.js.map +1 -1
  66. package/cjs/e-signature/e-signature.styles_lukd9f.css +17 -0
  67. package/cjs/error-display/error-display-data.js +1 -1
  68. package/cjs/error-display/error-display-data.js.map +1 -1
  69. package/cjs/external/lodash/get.js +1 -1
  70. package/cjs/external/lodash/get.js.map +1 -1
  71. package/cjs/file-download/file-download.js +1 -1
  72. package/cjs/file-download/file-download.js.map +1 -1
  73. package/cjs/file-download/file-download.styles.js +1 -32
  74. package/cjs/file-download/file-download.styles.js.map +1 -1
  75. package/cjs/file-download/file-download.styles_iggk8q.css +8 -0
  76. package/cjs/file-download/file-list-card/file-list-card.js +1 -1
  77. package/cjs/file-download/file-list-card/file-list-card.js.map +1 -1
  78. package/cjs/file-download/file-list-card/file-list-card.styles.js +1 -177
  79. package/cjs/file-download/file-list-card/file-list-card.styles.js.map +1 -1
  80. package/cjs/file-download/file-list-card/file-list-card.styles_oom8ii.css +16 -0
  81. package/cjs/file-upload/file-list/file-list.js +2 -0
  82. package/cjs/file-upload/file-list/file-list.js.map +1 -0
  83. package/cjs/file-upload/file-list/file-list.styles.js +2 -0
  84. package/cjs/file-upload/file-list/file-list.styles.js.map +1 -0
  85. package/cjs/file-upload/file-list/file-list.styles_1ea12kj.css +3 -0
  86. package/cjs/file-upload/file-list-item/file-list-item-thumbnail.styles.js +1 -1
  87. package/cjs/file-upload/file-list-item/{file-list-item-thumbnail.styles_1vrh1ve.css → file-list-item-thumbnail.styles_1y4si19.css} +1 -1
  88. package/cjs/file-upload/file-upload.js +1 -1
  89. package/cjs/file-upload/file-upload.js.map +1 -1
  90. package/cjs/filter/addons/filter-item-checkbox.styles.js +1 -1
  91. package/cjs/filter/addons/filter-item-checkbox.styles.js.map +1 -1
  92. package/cjs/filter/addons/{filter-item-checkbox.styles_18l87i2.css → filter-item-checkbox.styles_7degw7.css} +1 -1
  93. package/cjs/filter/filter-badge.js +2 -0
  94. package/cjs/filter/filter-badge.js.map +1 -0
  95. package/cjs/filter/filter-item-page.js +1 -1
  96. package/cjs/filter/filter-item-page.js.map +1 -1
  97. package/cjs/filter/filter-item.styles.js +1 -1
  98. package/cjs/filter/filter-item.styles.js.map +1 -1
  99. package/{filter/filter-item.styles_1e3v6qq.css → cjs/filter/filter-item.styles_cphjnj.css} +2 -2
  100. package/cjs/filter/filter-modal.js +1 -1
  101. package/cjs/filter/filter-modal.js.map +1 -1
  102. package/cjs/filter/filter-modal.styles.js +1 -1
  103. package/cjs/filter/filter-modal.styles.js.map +1 -1
  104. package/cjs/filter/filter-modal.styles_qw3xlg.css +10 -0
  105. package/cjs/filter/filter-sidebar.js +1 -1
  106. package/cjs/filter/filter-sidebar.js.map +1 -1
  107. package/cjs/filter/filter-sidebar.styles.js +1 -1
  108. package/cjs/filter/filter-sidebar.styles.js.map +1 -1
  109. package/cjs/filter/filter-sidebar.styles_1otwpjl.css +5 -0
  110. package/cjs/filter/filter.styles.js +1 -1
  111. package/cjs/filter/filter.styles.js.map +1 -1
  112. package/cjs/filter/{filter.styles_2fmaok.css → filter.styles_1ykijwm.css} +1 -1
  113. package/cjs/form/form-label.styles.js +1 -1
  114. package/cjs/form/form-label.styles.js.map +1 -1
  115. package/cjs/form/form-label.styles_11r0652.css +6 -0
  116. package/cjs/form/form-wrapper.js +1 -1
  117. package/cjs/form/form-wrapper.js.map +1 -1
  118. package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
  119. package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
  120. package/cjs/image-button/image-button.styles.js +1 -1
  121. package/cjs/image-button/{image-button.styles_qtt605.css → image-button.styles_6n1qsr.css} +1 -1
  122. package/cjs/index.js +1 -1
  123. package/cjs/input-group/input-group-list-addon.js +1 -1
  124. package/cjs/input-group/input-group-list-addon.js.map +1 -1
  125. package/cjs/input-group/input-group.styles.js +1 -1
  126. package/{input-group/input-group.styles_fpy81r.css → cjs/input-group/input-group.styles_bqye6f.css} +1 -1
  127. package/cjs/input-multi-select/input-multi-select.js +1 -1
  128. package/cjs/input-multi-select/input-multi-select.js.map +1 -1
  129. package/cjs/input-nested-multi-select/input-nested-multi-select.js +1 -1
  130. package/cjs/input-nested-multi-select/input-nested-multi-select.js.map +1 -1
  131. package/cjs/input-nested-select/input-nested-select.js +1 -1
  132. package/cjs/input-nested-select/input-nested-select.js.map +1 -1
  133. package/cjs/input-range-select/input-range-select.js +1 -1
  134. package/cjs/input-range-select/input-range-select.js.map +1 -1
  135. package/cjs/input-select/input-select.js +1 -1
  136. package/cjs/input-select/input-select.js.map +1 -1
  137. package/cjs/input-textarea/textarea-counter.styles.js +1 -1
  138. package/cjs/input-textarea/textarea-counter.styles.js.map +1 -1
  139. package/cjs/input-textarea/textarea-counter.styles_1n3wsnv.css +1 -0
  140. package/cjs/input-textarea/textarea.styles.js +1 -1
  141. package/cjs/input-textarea/textarea.styles_22z4n3.css +5 -0
  142. package/cjs/language-switcher/dropdown-panel.styles.js +1 -1
  143. package/cjs/language-switcher/dropdown-panel.styles.js.map +1 -1
  144. package/cjs/language-switcher/{dropdown-panel.styles_1z0n7qq.css → dropdown-panel.styles_1qsjf8d.css} +1 -1
  145. package/cjs/language-switcher/dropdown-variant.js +1 -1
  146. package/cjs/language-switcher/dropdown-variant.js.map +1 -1
  147. package/cjs/language-switcher/dropdown-variant.styles.js +1 -1
  148. package/cjs/language-switcher/dropdown-variant.styles_1vrdfky.css +2 -0
  149. package/cjs/language-switcher/link-container-variant.styles.js +1 -1
  150. package/cjs/language-switcher/{link-container-variant.styles_1blx9qm.css → link-container-variant.styles_1iw6zux.css} +1 -1
  151. package/cjs/layout/col-div.js +1 -1
  152. package/cjs/layout/col-div.js.map +1 -1
  153. package/cjs/link-list/link-list.styles.js +1 -1
  154. package/cjs/link-list/link-list.styles.js.map +1 -1
  155. package/{link-list/link-list.styles_1g33nb4.css → cjs/link-list/link-list.styles_m57vks.css} +2 -2
  156. package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles.js +1 -1
  157. package/{local-nav/local-nav-dropdown/local-nav-dropdown.styles_ftv36t.css → cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles_uhd4xl.css} +1 -1
  158. package/cjs/markup/markup.js +1 -1
  159. package/cjs/markup/markup.js.map +1 -1
  160. package/cjs/markup/markup.style.js +1 -1
  161. package/cjs/markup/markup.style.js.map +1 -1
  162. package/cjs/masked-input/masked-input.styles.js +1 -1
  163. package/cjs/masked-input/masked-input.styles.js.map +1 -1
  164. package/{masked-input/masked-input.styles_4i1qsy.css → cjs/masked-input/masked-input.styles_1cm388a.css} +2 -2
  165. package/cjs/masthead/masthead.js +1 -1
  166. package/cjs/masthead/masthead.js.map +1 -1
  167. package/cjs/modal/modal-box.styles.js +1 -1
  168. package/cjs/modal/modal-box.styles.js.map +1 -1
  169. package/cjs/modal/modal-box.styles_y52cts.css +11 -0
  170. package/cjs/modal/modal.js +1 -1
  171. package/cjs/modal/modal.js.map +1 -1
  172. package/cjs/modal/modal.styles.js +1 -1
  173. package/cjs/modal/modal.styles.js.map +1 -1
  174. package/cjs/modal/{modal.styles_1sav73f.css → modal.styles_1lbblx6.css} +1 -1
  175. package/cjs/modal-v2/modal-v2.js +1 -1
  176. package/cjs/modal-v2/modal-v2.js.map +1 -1
  177. package/cjs/modal-v2/modal-v2.styles.js +1 -1
  178. package/cjs/modal-v2/modal-v2.styles.js.map +1 -1
  179. package/cjs/modal-v2/modal-v2.styles_a8gv5i.css +3 -0
  180. package/cjs/modal-v2/slots/card.js +1 -1
  181. package/cjs/modal-v2/slots/card.js.map +1 -1
  182. package/cjs/navbar/navbar-items.styles.js +1 -1
  183. package/cjs/navbar/navbar-items.styles.js.map +1 -1
  184. package/cjs/navbar/{navbar-items.styles_i9cunu.css → navbar-items.styles_1i3ltot.css} +7 -7
  185. package/cjs/navbar/navbar.js +1 -1
  186. package/cjs/navbar/navbar.js.map +1 -1
  187. package/cjs/notification-banner/notification-banner.styles.js +1 -1
  188. package/cjs/notification-banner/notification-banner.styles.js.map +1 -1
  189. package/{notification-banner/notification-banner.styles_130loac.css → cjs/notification-banner/notification-banner.styles_uxlysy.css} +2 -2
  190. package/cjs/otp-verification/contact-input-section.js +1 -1
  191. package/cjs/otp-verification/contact-input-section.js.map +1 -1
  192. package/cjs/otp-verification/contact-input-section.styles.js +2 -0
  193. package/cjs/otp-verification/contact-input-section.styles.js.map +1 -0
  194. package/cjs/otp-verification/contact-input-section.styles_odrjvt.css +14 -0
  195. package/cjs/otp-verification/otp-verification.js +1 -1
  196. package/cjs/otp-verification/otp-verification.js.map +1 -1
  197. package/cjs/otp-verification/otp-verification.styles.js +2 -0
  198. package/cjs/otp-verification/otp-verification.styles.js.map +1 -0
  199. package/cjs/otp-verification/otp-verification.styles_dg9bm8.css +1 -0
  200. package/cjs/otp-verification/thumbnail/email-thumbnail.js +1 -21
  201. package/cjs/otp-verification/thumbnail/email-thumbnail.js.map +1 -1
  202. package/cjs/otp-verification/thumbnail/phone-thumbnail.js +1 -17
  203. package/cjs/otp-verification/thumbnail/phone-thumbnail.js.map +1 -1
  204. package/cjs/otp-verification/thumbnail/thumbnail.styles.js +2 -0
  205. package/cjs/otp-verification/thumbnail/thumbnail.styles.js.map +1 -0
  206. package/cjs/otp-verification/thumbnail/thumbnail.styles_shqylh.css +3 -0
  207. package/cjs/otp-verification/verification-section.js +1 -1
  208. package/cjs/otp-verification/verification-section.js.map +1 -1
  209. package/cjs/otp-verification/verification-section.styles.js +2 -0
  210. package/cjs/otp-verification/verification-section.styles.js.map +1 -0
  211. package/cjs/otp-verification/verification-section.styles_x8jj.css +5 -0
  212. package/cjs/pagination/pagination.styles.js +1 -1
  213. package/cjs/pagination/pagination.styles.js.map +1 -1
  214. package/{pagination/pagination.styles_1u898rb.css → cjs/pagination/pagination.styles_6bcgva.css} +3 -3
  215. package/cjs/pill/pill.styles.js +1 -1
  216. package/{pill/pill.styles_1wiyl8.css → cjs/pill/pill.styles_xwrniu.css} +1 -1
  217. package/cjs/predictive-text-input/predictive-text-input.js +1 -1
  218. package/cjs/predictive-text-input/predictive-text-input.js.map +1 -1
  219. package/cjs/schedule/const.js +1 -1
  220. package/cjs/schedule/const.js.map +1 -1
  221. package/cjs/schedule/schedule-day-view/schedule-day-view.js +1 -1
  222. package/cjs/schedule/schedule-day-view/schedule-day-view.js.map +1 -1
  223. package/cjs/schedule/schedule-day-view/schedule-day-view.styles.js +1 -152
  224. package/cjs/schedule/schedule-day-view/schedule-day-view.styles.js.map +1 -1
  225. package/cjs/schedule/schedule-day-view/schedule-day-view.styles_8ti149.css +30 -0
  226. package/cjs/schedule/schedule-header/schedule-header.js +1 -1
  227. package/cjs/schedule/schedule-header/schedule-header.js.map +1 -1
  228. package/cjs/schedule/schedule-header/schedule-header.styles.js +2 -0
  229. package/cjs/schedule/schedule-header/schedule-header.styles.js.map +1 -0
  230. package/cjs/schedule/schedule-header/schedule-header.styles_1n2u5vj.css +6 -0
  231. package/cjs/schedule/schedule-slot-content/schedule-slot-content.js +2 -0
  232. package/cjs/schedule/schedule-slot-content/schedule-slot-content.js.map +1 -0
  233. package/cjs/schedule/schedule-slot-content/style-helper.js +2 -0
  234. package/cjs/schedule/schedule-slot-content/style-helper.js.map +1 -0
  235. package/cjs/schedule/schedule-week-view/schedule-week-view.js +1 -1
  236. package/cjs/schedule/schedule-week-view/schedule-week-view.js.map +1 -1
  237. package/cjs/schedule/schedule-week-view/schedule-week-view.styles.js +1 -74
  238. package/cjs/schedule/schedule-week-view/schedule-week-view.styles.js.map +1 -1
  239. package/cjs/schedule/schedule-week-view/schedule-week-view.styles_x7x50m.css +10 -0
  240. package/cjs/schedule/schedule-week-view/time-cell.js +1 -1
  241. package/cjs/schedule/schedule-week-view/time-cell.js.map +1 -1
  242. package/cjs/schedule/schedule-week-view/time-cell.styles.js +1 -34
  243. package/cjs/schedule/schedule-week-view/time-cell.styles.js.map +1 -1
  244. package/cjs/schedule/schedule-week-view/time-cell.styles_1sorjz8.css +14 -0
  245. package/cjs/schedule/schedule-week-view/week-view-utils.js +1 -1
  246. package/cjs/schedule/schedule-week-view/week-view-utils.js.map +1 -1
  247. package/cjs/schedule/schedule.js +1 -1
  248. package/cjs/schedule/schedule.js.map +1 -1
  249. package/cjs/schedule/schedule.styles.js +1 -26
  250. package/cjs/schedule/schedule.styles.js.map +1 -1
  251. package/cjs/schedule/schedule.styles_fdy5a1.css +5 -0
  252. package/cjs/schedule/shared/with-optional-popover.js +1 -5
  253. package/cjs/schedule/shared/with-optional-popover.js.map +1 -1
  254. package/cjs/schedule/shared/with-optional-popover.styles.js +2 -0
  255. package/cjs/schedule/shared/with-optional-popover.styles.js.map +1 -0
  256. package/cjs/schedule/shared/with-optional-popover.styles_7mv3p2.css +1 -0
  257. package/cjs/schedule/time-indicator/time-indicator.js +1 -1
  258. package/cjs/schedule/time-indicator/time-indicator.js.map +1 -1
  259. package/cjs/schedule/time-indicator/time-indicator.styles.js +1 -33
  260. package/cjs/schedule/time-indicator/time-indicator.styles.js.map +1 -1
  261. package/cjs/schedule/time-indicator/time-indicator.styles_1eaxyes.css +6 -0
  262. package/cjs/select-histogram/select-histogram.js +1 -1
  263. package/cjs/select-histogram/select-histogram.js.map +1 -1
  264. package/cjs/select-histogram/select-histogram.styles.js +1 -1
  265. package/cjs/select-histogram/select-histogram.styles.js.map +1 -1
  266. package/cjs/select-histogram/{select-histogram.styles_11916eo.css → select-histogram.styles_n260dy.css} +1 -1
  267. package/cjs/shared/dropdown-list/dropdown-label.js +1 -1
  268. package/cjs/shared/dropdown-list/dropdown-label.js.map +1 -1
  269. package/cjs/shared/dropdown-list/dropdown-label.styles.js +1 -1
  270. package/cjs/shared/dropdown-list/dropdown-label.styles.js.map +1 -1
  271. package/{shared/dropdown-list/dropdown-label.styles_1dwmd8f.css → cjs/shared/dropdown-list/dropdown-label.styles_mloii0.css} +4 -4
  272. package/cjs/shared/dropdown-list/dropdown-list.styles.js +1 -1
  273. package/cjs/shared/dropdown-list/dropdown-list.styles.js.map +1 -1
  274. package/{shared/dropdown-list/dropdown-list.styles_1kt4zhf.css → cjs/shared/dropdown-list/dropdown-list.styles_konwm.css} +4 -4
  275. package/cjs/shared/dropdown-list/dropdown-search.styles.js +1 -1
  276. package/cjs/shared/dropdown-list/dropdown-search.styles.js.map +1 -1
  277. package/{shared/dropdown-list/dropdown-search.styles_4r9oma.css → cjs/shared/dropdown-list/dropdown-search.styles_1hc1gkh.css} +2 -2
  278. package/cjs/shared/dropdown-list/expandable-element.js +1 -1
  279. package/cjs/shared/dropdown-list/expandable-element.js.map +1 -1
  280. package/cjs/shared/dropdown-list/expandable-element.styles.js +1 -1
  281. package/cjs/shared/dropdown-list/expandable-element.styles.js.map +1 -1
  282. package/cjs/shared/dropdown-list/expandable-element.styles_rkkvqr.css +5 -0
  283. package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles.js +1 -1
  284. package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles.js.map +1 -1
  285. package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles_15hwwoj.css +3 -0
  286. package/cjs/shared/hooks/useViewport.js +1 -1
  287. package/cjs/shared/hooks/useViewport.js.map +1 -1
  288. package/cjs/shared/input-wrapper/input-wrapper.styles.js +1 -1
  289. package/cjs/shared/input-wrapper/{input-wrapper.styles_19fpzb.css → input-wrapper.styles_je6maw.css} +2 -2
  290. package/cjs/shared/internal-calendar/calendar-manager.styles.js +1 -1
  291. package/cjs/shared/internal-calendar/{calendar-manager.styles_1q13ylk.css → calendar-manager.styles_1iuq5zw.css} +1 -1
  292. package/cjs/shared/internal-calendar/day-cell/day-cell.styles.js +1 -1
  293. package/cjs/shared/internal-calendar/day-cell/day-cell.styles.js.map +1 -1
  294. package/{shared/internal-calendar/day-cell/day-cell.styles_vazxvn.css → cjs/shared/internal-calendar/day-cell/day-cell.styles_1t5oqc1.css} +1 -1
  295. package/cjs/shared/internal-calendar/internal-calendar-month.styles.js +1 -1
  296. package/{shared/internal-calendar/internal-calendar-month.styles_1pk3ynj.css → cjs/shared/internal-calendar/internal-calendar-month.styles_14oh57f.css} +1 -1
  297. package/cjs/shared/internal-calendar/internal-calendar-year.styles.js +1 -1
  298. package/cjs/shared/internal-calendar/internal-calendar-year.styles.js.map +1 -1
  299. package/cjs/shared/internal-calendar/{internal-calendar-year.styles_1azy42u.css → internal-calendar-year.styles_therlc.css} +1 -1
  300. package/cjs/shared/internal-calendar/single/single-cell.js +1 -1
  301. package/cjs/shared/internal-calendar/single/single-cell.js.map +1 -1
  302. package/cjs/shared/internal-calendar/standard/standard-calendar-day-view.styles.js +1 -1
  303. package/{shared/internal-calendar/standard/standard-calendar-day-view.styles_1dbvup3.css → cjs/shared/internal-calendar/standard/standard-calendar-day-view.styles_1bw26au.css} +1 -1
  304. package/cjs/shared/standalone-date-input/standalone-date-input.js +1 -1
  305. package/cjs/shared/standalone-date-input/standalone-date-input.js.map +1 -1
  306. package/cjs/shared/standalone-date-input/standalone-date-input.styles.js +1 -1
  307. package/cjs/shared/standalone-date-input/standalone-date-input.styles.js.map +1 -1
  308. package/cjs/shared/standalone-date-input/standalone-date-input.styles_157qo89.css +15 -0
  309. package/cjs/shared/time-slot/time-slot.js +1 -1
  310. package/cjs/shared/time-slot/time-slot.js.map +1 -1
  311. package/cjs/shared/time-slot/time-slot.styles.js +1 -1
  312. package/cjs/shared/time-slot/time-slot.styles.js.map +1 -1
  313. package/cjs/shared/time-slot/time-slot.styles_18s0to7.css +29 -0
  314. package/cjs/sidenav/sidenav-drawer-item.styles.js +1 -1
  315. package/cjs/sidenav/sidenav-drawer-item.styles.js.map +1 -1
  316. package/cjs/sidenav/{sidenav-drawer-item.styles_yp8cga.css → sidenav-drawer-item.styles_1ljnyx2.css} +1 -1
  317. package/cjs/sidenav/sidenav-drawer-subitem.styles.js +1 -1
  318. package/cjs/sidenav/sidenav-drawer-subitem.styles.js.map +1 -1
  319. package/cjs/sidenav/sidenav-drawer-subitem.styles_2y58kf.css +1 -0
  320. package/cjs/sidenav/sidenav-item.styles.js +1 -1
  321. package/cjs/sidenav/sidenav-item.styles.js.map +1 -1
  322. package/cjs/sidenav/{sidenav-item.styles_1eew8px.css → sidenav-item.styles_lqw3kh.css} +2 -2
  323. package/cjs/smart-app-banner/smart-app-banner.styles.js +1 -1
  324. package/cjs/smart-app-banner/smart-app-banner.styles.js.map +1 -1
  325. package/cjs/smart-app-banner/{smart-app-banner.styles_m5dtgh.css → smart-app-banner.styles_15u6yv4.css} +2 -2
  326. package/cjs/tab/tab-link-chain.styles.js +1 -1
  327. package/cjs/tab/tab-link-chain.styles.js.map +1 -1
  328. package/cjs/tab/{tab-link-chain.styles_1nreqrp.css → tab-link-chain.styles_49got4.css} +2 -2
  329. package/cjs/tag/tag.style.js +1 -1
  330. package/cjs/tag/{tag.style_10tn8i.css → tag.style_d98c53.css} +2 -2
  331. package/cjs/text-list/text-list.styles.js +1 -1
  332. package/cjs/text-list/text-list.styles.js.map +1 -1
  333. package/cjs/text-list/text-list.styles_w3fvyt.css +16 -0
  334. package/cjs/theme/index.js +1 -1
  335. package/cjs/theme/theme-provider/hooks.js +1 -1
  336. package/cjs/theme/theme-provider/hooks.js.map +1 -1
  337. package/cjs/theme/tokens/colour.js +1 -1
  338. package/cjs/theme/tokens/colour.js.map +1 -1
  339. package/cjs/theme/tokens/font.js +1 -1
  340. package/cjs/theme/tokens/font.js.map +1 -1
  341. package/cjs/theme/types.js +1 -1
  342. package/cjs/theme/types.js.map +1 -1
  343. package/cjs/theme/utils/css-variable.js +1 -1
  344. package/cjs/theme/utils/css-variable.js.map +1 -1
  345. package/cjs/theme/utils/font.js +1 -1
  346. package/cjs/theme/utils/font.js.map +1 -1
  347. package/cjs/theme/utils/token-resolver.js +1 -1
  348. package/cjs/theme/utils/token-resolver.js.map +1 -1
  349. package/cjs/theme/utils/use-design-token.js +1 -1
  350. package/cjs/theme/utils/use-design-token.js.map +1 -1
  351. package/cjs/theme/utils/use-media-query.js +1 -1
  352. package/cjs/theme/utils/use-media-query.js.map +1 -1
  353. package/cjs/time-range-picker/combobox-picker/combobox-picker.js +1 -1
  354. package/cjs/time-range-picker/combobox-picker/combobox-picker.js.map +1 -1
  355. package/cjs/time-slot-bar-week/consts.js +2 -0
  356. package/cjs/time-slot-bar-week/consts.js.map +1 -0
  357. package/cjs/time-slot-bar-week/time-slot-bar-week-days.js +1 -1
  358. package/cjs/time-slot-bar-week/time-slot-bar-week-days.js.map +1 -1
  359. package/cjs/time-slot-bar-week/time-slot-bar-week-days.styles.js +2 -0
  360. package/cjs/time-slot-bar-week/time-slot-bar-week-days.styles.js.map +1 -0
  361. package/cjs/time-slot-bar-week/time-slot-bar-week-days.styles_evdvs9.css +17 -0
  362. package/cjs/time-slot-bar-week/time-slot-bar-week.js +1 -1
  363. package/cjs/time-slot-bar-week/time-slot-bar-week.js.map +1 -1
  364. package/cjs/time-slot-bar-week/time-slot-bar-week.styles.js +2 -0
  365. package/cjs/time-slot-bar-week/time-slot-bar-week.styles.js.map +1 -0
  366. package/cjs/time-slot-bar-week/time-slot-bar-week.styles_11ybf42.css +1 -0
  367. package/cjs/time-slot-bar-week/time-slot-cell.js +2 -0
  368. package/cjs/time-slot-bar-week/time-slot-cell.js.map +1 -0
  369. package/cjs/time-slot-week-view/time-slot-week-days.js +1 -1
  370. package/cjs/time-slot-week-view/time-slot-week-days.js.map +1 -1
  371. package/cjs/time-slot-week-view/time-slot-week-days.styles.js +2 -0
  372. package/cjs/time-slot-week-view/time-slot-week-days.styles.js.map +1 -0
  373. package/cjs/time-slot-week-view/time-slot-week-days.styles_1h21vyw.css +9 -0
  374. package/cjs/time-slot-week-view/time-slot-week-view.js +1 -1
  375. package/cjs/time-slot-week-view/time-slot-week-view.js.map +1 -1
  376. package/cjs/time-slot-week-view/time-slot-week-view.styles.js +1 -9
  377. package/cjs/time-slot-week-view/time-slot-week-view.styles.js.map +1 -1
  378. package/cjs/time-slot-week-view/time-slot-week-view.styles_gqgsw2.css +1 -0
  379. package/cjs/timeline/timeline.styles.js +1 -1
  380. package/{timeline/timeline.styles_1wcnzot.css → cjs/timeline/timeline.styles_1jxzik4.css} +1 -1
  381. package/cjs/timepicker/timepicker.js +1 -1
  382. package/cjs/timepicker/timepicker.js.map +1 -1
  383. package/cjs/timepicker/timepicker.styles.js +1 -1
  384. package/cjs/timepicker/timepicker.styles.js.map +1 -1
  385. package/cjs/timepicker/timepicker.styles_1jm33yw.css +1 -0
  386. package/cjs/toast/toast.styles.js +1 -1
  387. package/cjs/toast/toast.styles.js.map +1 -1
  388. package/cjs/toast/{toast.styles_ngrlup.css → toast.styles_1e0l60w.css} +1 -1
  389. package/cjs/toggle/toggle.styles.js +1 -1
  390. package/cjs/toggle/toggle.styles.js.map +1 -1
  391. package/{toggle/toggle.styles_1yzqsu.css → cjs/toggle/toggle.styles_1t5qrye.css} +5 -5
  392. package/cjs/typography/typography.js +1 -1
  393. package/cjs/typography/typography.js.map +1 -1
  394. package/cjs/typography/typography.styles.js +1 -1
  395. package/cjs/typography/typography.styles.js.map +1 -1
  396. package/cjs/typography/typography.styles_1155j4c.css +11 -0
  397. package/cjs/uneditable-section/section-item.styles.js +1 -1
  398. package/cjs/uneditable-section/section-item.styles.js.map +1 -1
  399. package/cjs/uneditable-section/{section-item.styles_1dfjzc4.css → section-item.styles_mwx8ht.css} +2 -2
  400. package/cjs/util/is-styled-components.js +2 -0
  401. package/cjs/util/is-styled-components.js.map +1 -0
  402. package/cjs/util/styling-helper.js +1 -1
  403. package/cjs/util/styling-helper.js.map +1 -1
  404. package/codemod-utils.d.ts +1 -0
  405. package/codemods/codemod-utils.ts +17 -0
  406. package/codemods/index.ts +231 -75
  407. package/codemods/migrate-popover/index.ts +267 -0
  408. package/codemods/run-codemod.js +6 -53
  409. package/codemods/run-codemod.js.map +1 -1
  410. package/codemods/run-codemod.ts +7 -54
  411. package/countdown-timer/countdown-timer.styles.js +1 -1
  412. package/countdown-timer/{countdown-timer.styles_k50tkw.css → countdown-timer.styles_ipn1b0.css} +1 -1
  413. package/dashed-border/dashed-border.js +1 -1
  414. package/dashed-border/dashed-border.js.map +1 -1
  415. package/data-table/data-table.js +1 -1
  416. package/data-table/data-table.js.map +1 -1
  417. package/data-table/data-table.styles.js +1 -1
  418. package/data-table/{data-table.styles_1nj2uzq.css → data-table.styles_1iqq1g7.css} +1 -1
  419. package/date-input/date-input.js +1 -1
  420. package/date-input/date-input.js.map +1 -1
  421. package/date-navigator/date-navigator.styles.js +1 -1
  422. package/date-navigator/date-navigator.styles.js.map +1 -1
  423. package/date-navigator/date-navigator.styles_wokh56.css +4 -0
  424. package/divider/divider.js.map +1 -1
  425. package/e-signature/e-signature-canvas.js +1 -1
  426. package/e-signature/e-signature-canvas.js.map +1 -1
  427. package/e-signature/e-signature.js +1 -1
  428. package/e-signature/e-signature.js.map +1 -1
  429. package/e-signature/e-signature.styles.d.ts +17 -45
  430. package/e-signature/e-signature.styles.js +1 -168
  431. package/e-signature/e-signature.styles.js.map +1 -1
  432. package/e-signature/e-signature.styles_lukd9f.css +17 -0
  433. package/error-display/error-display-data.js +1 -1
  434. package/error-display/error-display-data.js.map +1 -1
  435. package/external/lodash/get.js +1 -1
  436. package/external/lodash/get.js.map +1 -1
  437. package/file-download/file-download.js +1 -1
  438. package/file-download/file-download.js.map +1 -1
  439. package/file-download/file-download.styles.d.ts +8 -11
  440. package/file-download/file-download.styles.js +1 -32
  441. package/file-download/file-download.styles.js.map +1 -1
  442. package/file-download/file-download.styles_iggk8q.css +8 -0
  443. package/file-download/file-list-card/file-list-card.js +1 -1
  444. package/file-download/file-list-card/file-list-card.js.map +1 -1
  445. package/file-download/file-list-card/file-list-card.styles.d.ts +16 -64
  446. package/file-download/file-list-card/file-list-card.styles.js +1 -177
  447. package/file-download/file-list-card/file-list-card.styles.js.map +1 -1
  448. package/file-download/file-list-card/file-list-card.styles_oom8ii.css +16 -0
  449. package/file-upload/{file-list.d.ts → file-list/file-list.d.ts} +1 -1
  450. package/file-upload/file-list/file-list.js +2 -0
  451. package/file-upload/file-list/file-list.js.map +1 -0
  452. package/file-upload/file-list/file-list.styles.js +2 -0
  453. package/file-upload/file-list/file-list.styles.js.map +1 -0
  454. package/file-upload/file-list/file-list.styles_1ea12kj.css +3 -0
  455. package/file-upload/file-list/index.d.ts +1 -0
  456. package/file-upload/file-list-item/file-list-item-thumbnail.styles.js +1 -1
  457. package/file-upload/file-list-item/{file-list-item-thumbnail.styles_1vrh1ve.css → file-list-item-thumbnail.styles_1y4si19.css} +1 -1
  458. package/file-upload/file-upload.js +1 -1
  459. package/file-upload/file-upload.js.map +1 -1
  460. package/filter/addons/filter-item-checkbox.styles.js +1 -1
  461. package/filter/addons/filter-item-checkbox.styles.js.map +1 -1
  462. package/filter/addons/{filter-item-checkbox.styles_18l87i2.css → filter-item-checkbox.styles_7degw7.css} +1 -1
  463. package/filter/filter-badge.d.ts +5 -0
  464. package/filter/filter-badge.js +2 -0
  465. package/filter/filter-badge.js.map +1 -0
  466. package/filter/filter-item-page.d.ts +1 -1
  467. package/filter/filter-item-page.js +1 -1
  468. package/filter/filter-item-page.js.map +1 -1
  469. package/filter/filter-item.styles.js +1 -1
  470. package/filter/filter-item.styles.js.map +1 -1
  471. package/{cjs/filter/filter-item.styles_1e3v6qq.css → filter/filter-item.styles_cphjnj.css} +2 -2
  472. package/filter/filter-modal.d.ts +1 -1
  473. package/filter/filter-modal.js +1 -1
  474. package/filter/filter-modal.js.map +1 -1
  475. package/filter/filter-modal.styles.d.ts +2 -0
  476. package/filter/filter-modal.styles.js +1 -1
  477. package/filter/filter-modal.styles.js.map +1 -1
  478. package/filter/filter-modal.styles_qw3xlg.css +10 -0
  479. package/filter/filter-sidebar.d.ts +1 -1
  480. package/filter/filter-sidebar.js +1 -1
  481. package/filter/filter-sidebar.js.map +1 -1
  482. package/filter/filter-sidebar.styles.d.ts +1 -0
  483. package/filter/filter-sidebar.styles.js +1 -1
  484. package/filter/filter-sidebar.styles.js.map +1 -1
  485. package/filter/filter-sidebar.styles_1otwpjl.css +5 -0
  486. package/filter/filter.d.ts +3 -3
  487. package/filter/filter.styles.js +1 -1
  488. package/filter/filter.styles.js.map +1 -1
  489. package/filter/{filter.styles_2fmaok.css → filter.styles_1ykijwm.css} +1 -1
  490. package/filter/types.d.ts +2 -0
  491. package/form/form-label.styles.js +1 -1
  492. package/form/form-label.styles.js.map +1 -1
  493. package/form/form-label.styles_11r0652.css +6 -0
  494. package/form/form-wrapper.js +1 -1
  495. package/form/form-wrapper.js.map +1 -1
  496. package/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
  497. package/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
  498. package/image-button/image-button.styles.js +1 -1
  499. package/image-button/{image-button.styles_qtt605.css → image-button.styles_6n1qsr.css} +1 -1
  500. package/index.d.ts +0 -1
  501. package/index.js +1 -1
  502. package/input-group/input-group-list-addon.js +1 -1
  503. package/input-group/input-group-list-addon.js.map +1 -1
  504. package/input-group/input-group.styles.js +1 -1
  505. package/{cjs/input-group/input-group.styles_fpy81r.css → input-group/input-group.styles_bqye6f.css} +1 -1
  506. package/input-multi-select/input-multi-select.js +1 -1
  507. package/input-multi-select/input-multi-select.js.map +1 -1
  508. package/input-nested-multi-select/input-nested-multi-select.js +1 -1
  509. package/input-nested-multi-select/input-nested-multi-select.js.map +1 -1
  510. package/input-nested-select/input-nested-select.js +1 -1
  511. package/input-nested-select/input-nested-select.js.map +1 -1
  512. package/input-range-select/input-range-select.js +1 -1
  513. package/input-range-select/input-range-select.js.map +1 -1
  514. package/input-select/input-select.js +1 -1
  515. package/input-select/input-select.js.map +1 -1
  516. package/input-textarea/textarea-counter.styles.js +1 -1
  517. package/input-textarea/textarea-counter.styles.js.map +1 -1
  518. package/input-textarea/textarea-counter.styles_1n3wsnv.css +1 -0
  519. package/input-textarea/textarea.styles.js +1 -1
  520. package/input-textarea/textarea.styles_22z4n3.css +5 -0
  521. package/language-switcher/dropdown-panel.styles.js +1 -1
  522. package/language-switcher/dropdown-panel.styles.js.map +1 -1
  523. package/language-switcher/{dropdown-panel.styles_1z0n7qq.css → dropdown-panel.styles_1qsjf8d.css} +1 -1
  524. package/language-switcher/dropdown-variant.js +1 -1
  525. package/language-switcher/dropdown-variant.js.map +1 -1
  526. package/language-switcher/dropdown-variant.styles.js +1 -1
  527. package/language-switcher/dropdown-variant.styles_1vrdfky.css +2 -0
  528. package/language-switcher/link-container-variant.styles.js +1 -1
  529. package/language-switcher/{link-container-variant.styles_1blx9qm.css → link-container-variant.styles_1iw6zux.css} +1 -1
  530. package/layout/col-div.js +1 -1
  531. package/layout/col-div.js.map +1 -1
  532. package/layout/types.d.ts +8 -11
  533. package/link-list/link-list.styles.js +1 -1
  534. package/link-list/link-list.styles.js.map +1 -1
  535. package/{cjs/link-list/link-list.styles_1g33nb4.css → link-list/link-list.styles_m57vks.css} +2 -2
  536. package/local-nav/local-nav-dropdown/local-nav-dropdown.styles.js +1 -1
  537. package/{cjs/local-nav/local-nav-dropdown/local-nav-dropdown.styles_ftv36t.css → local-nav/local-nav-dropdown/local-nav-dropdown.styles_uhd4xl.css} +1 -1
  538. package/markup/markup.js +1 -1
  539. package/markup/markup.js.map +1 -1
  540. package/markup/markup.style.js +1 -1
  541. package/markup/markup.style.js.map +1 -1
  542. package/markup/types.d.ts +2 -1
  543. package/masked-input/masked-input.styles.js +1 -1
  544. package/masked-input/masked-input.styles.js.map +1 -1
  545. package/{cjs/masked-input/masked-input.styles_4i1qsy.css → masked-input/masked-input.styles_1cm388a.css} +2 -2
  546. package/masthead/masthead.js +1 -1
  547. package/masthead/masthead.js.map +1 -1
  548. package/modal/modal-box.styles.js +1 -1
  549. package/modal/modal-box.styles.js.map +1 -1
  550. package/modal/modal-box.styles_y52cts.css +11 -0
  551. package/modal/modal.js +1 -1
  552. package/modal/modal.js.map +1 -1
  553. package/modal/modal.styles.d.ts +4 -1
  554. package/modal/modal.styles.js +1 -1
  555. package/modal/modal.styles.js.map +1 -1
  556. package/modal/{modal.styles_1sav73f.css → modal.styles_1lbblx6.css} +1 -1
  557. package/modal-v2/modal-v2.js +1 -1
  558. package/modal-v2/modal-v2.js.map +1 -1
  559. package/modal-v2/modal-v2.styles.d.ts +0 -1
  560. package/modal-v2/modal-v2.styles.js +1 -1
  561. package/modal-v2/modal-v2.styles.js.map +1 -1
  562. package/modal-v2/modal-v2.styles_a8gv5i.css +3 -0
  563. package/modal-v2/slots/card.js +1 -1
  564. package/modal-v2/slots/card.js.map +1 -1
  565. package/navbar/navbar-items.styles.js +1 -1
  566. package/navbar/navbar-items.styles.js.map +1 -1
  567. package/navbar/{navbar-items.styles_i9cunu.css → navbar-items.styles_1i3ltot.css} +7 -7
  568. package/navbar/navbar.js +1 -1
  569. package/navbar/navbar.js.map +1 -1
  570. package/notification-banner/notification-banner.styles.js +1 -1
  571. package/notification-banner/notification-banner.styles.js.map +1 -1
  572. package/{cjs/notification-banner/notification-banner.styles_130loac.css → notification-banner/notification-banner.styles_uxlysy.css} +2 -2
  573. package/otp-verification/contact-input-section.js +1 -1
  574. package/otp-verification/contact-input-section.js.map +1 -1
  575. package/otp-verification/contact-input-section.styles.d.ts +14 -0
  576. package/otp-verification/contact-input-section.styles.js +2 -0
  577. package/otp-verification/contact-input-section.styles.js.map +1 -0
  578. package/otp-verification/contact-input-section.styles_odrjvt.css +14 -0
  579. package/otp-verification/otp-verification.js +1 -1
  580. package/otp-verification/otp-verification.js.map +1 -1
  581. package/otp-verification/otp-verification.styles.d.ts +1 -0
  582. package/otp-verification/otp-verification.styles.js +2 -0
  583. package/otp-verification/otp-verification.styles.js.map +1 -0
  584. package/otp-verification/otp-verification.styles_dg9bm8.css +1 -0
  585. package/otp-verification/thumbnail/email-thumbnail.d.ts +1 -3
  586. package/otp-verification/thumbnail/email-thumbnail.js +1 -21
  587. package/otp-verification/thumbnail/email-thumbnail.js.map +1 -1
  588. package/otp-verification/thumbnail/phone-thumbnail.d.ts +1 -3
  589. package/otp-verification/thumbnail/phone-thumbnail.js +1 -17
  590. package/otp-verification/thumbnail/phone-thumbnail.js.map +1 -1
  591. package/otp-verification/thumbnail/thumbnail.styles.d.ts +3 -0
  592. package/otp-verification/thumbnail/thumbnail.styles.js +2 -0
  593. package/otp-verification/thumbnail/thumbnail.styles.js.map +1 -0
  594. package/otp-verification/thumbnail/thumbnail.styles_shqylh.css +3 -0
  595. package/otp-verification/verification-section.js +1 -1
  596. package/otp-verification/verification-section.js.map +1 -1
  597. package/otp-verification/verification-section.styles.d.ts +5 -0
  598. package/otp-verification/verification-section.styles.js +2 -0
  599. package/otp-verification/verification-section.styles.js.map +1 -0
  600. package/otp-verification/verification-section.styles_x8jj.css +5 -0
  601. package/package.json +14 -9
  602. package/pagination/pagination.styles.js +1 -1
  603. package/pagination/pagination.styles.js.map +1 -1
  604. package/{cjs/pagination/pagination.styles_1u898rb.css → pagination/pagination.styles_6bcgva.css} +3 -3
  605. package/pill/pill.styles.js +1 -1
  606. package/{cjs/pill/pill.styles_1wiyl8.css → pill/pill.styles_xwrniu.css} +1 -1
  607. package/predictive-text-input/predictive-text-input.js +1 -1
  608. package/predictive-text-input/predictive-text-input.js.map +1 -1
  609. package/schedule/const.js +1 -1
  610. package/schedule/const.js.map +1 -1
  611. package/schedule/schedule-day-view/schedule-day-view.js +1 -1
  612. package/schedule/schedule-day-view/schedule-day-view.js.map +1 -1
  613. package/schedule/schedule-day-view/schedule-day-view.styles.d.ts +39 -99
  614. package/schedule/schedule-day-view/schedule-day-view.styles.js +1 -152
  615. package/schedule/schedule-day-view/schedule-day-view.styles.js.map +1 -1
  616. package/schedule/schedule-day-view/schedule-day-view.styles_8ti149.css +30 -0
  617. package/schedule/schedule-day-view/types.d.ts +2 -10
  618. package/schedule/schedule-header/schedule-header.js +1 -1
  619. package/schedule/schedule-header/schedule-header.js.map +1 -1
  620. package/schedule/schedule-header/schedule-header.styles.d.ts +7 -0
  621. package/schedule/schedule-header/schedule-header.styles.js +2 -0
  622. package/schedule/schedule-header/schedule-header.styles.js.map +1 -0
  623. package/schedule/schedule-header/schedule-header.styles_1n2u5vj.css +6 -0
  624. package/schedule/schedule-slot-content/index.d.ts +4 -0
  625. package/schedule/schedule-slot-content/schedule-slot-content.d.ts +21 -0
  626. package/schedule/schedule-slot-content/schedule-slot-content.js +2 -0
  627. package/schedule/schedule-slot-content/schedule-slot-content.js.map +1 -0
  628. package/schedule/schedule-slot-content/style-helper.d.ts +8 -0
  629. package/schedule/schedule-slot-content/style-helper.js +2 -0
  630. package/schedule/schedule-slot-content/style-helper.js.map +1 -0
  631. package/schedule/schedule-week-view/schedule-week-view.js +1 -1
  632. package/schedule/schedule-week-view/schedule-week-view.js.map +1 -1
  633. package/schedule/schedule-week-view/schedule-week-view.styles.d.ts +15 -32
  634. package/schedule/schedule-week-view/schedule-week-view.styles.js +1 -74
  635. package/schedule/schedule-week-view/schedule-week-view.styles.js.map +1 -1
  636. package/schedule/schedule-week-view/schedule-week-view.styles_x7x50m.css +10 -0
  637. package/schedule/schedule-week-view/time-cell.js +1 -1
  638. package/schedule/schedule-week-view/time-cell.js.map +1 -1
  639. package/schedule/schedule-week-view/time-cell.styles.d.ts +23 -14
  640. package/schedule/schedule-week-view/time-cell.styles.js +1 -34
  641. package/schedule/schedule-week-view/time-cell.styles.js.map +1 -1
  642. package/schedule/schedule-week-view/time-cell.styles_1sorjz8.css +14 -0
  643. package/schedule/schedule-week-view/types.d.ts +2 -15
  644. package/schedule/schedule-week-view/week-view-utils.js +1 -1
  645. package/schedule/schedule-week-view/week-view-utils.js.map +1 -1
  646. package/schedule/schedule.js +1 -1
  647. package/schedule/schedule.js.map +1 -1
  648. package/schedule/schedule.styles.d.ts +5 -8
  649. package/schedule/schedule.styles.js +1 -26
  650. package/schedule/schedule.styles.js.map +1 -1
  651. package/schedule/schedule.styles_fdy5a1.css +5 -0
  652. package/schedule/shared/with-optional-popover.d.ts +1 -1
  653. package/schedule/shared/with-optional-popover.js +1 -5
  654. package/schedule/shared/with-optional-popover.js.map +1 -1
  655. package/schedule/shared/with-optional-popover.styles.d.ts +1 -0
  656. package/schedule/shared/with-optional-popover.styles.js +2 -0
  657. package/schedule/shared/with-optional-popover.styles.js.map +1 -0
  658. package/schedule/shared/with-optional-popover.styles_7mv3p2.css +1 -0
  659. package/schedule/time-indicator/time-indicator.js +1 -1
  660. package/schedule/time-indicator/time-indicator.js.map +1 -1
  661. package/schedule/time-indicator/time-indicator.styles.d.ts +11 -28
  662. package/schedule/time-indicator/time-indicator.styles.js +1 -33
  663. package/schedule/time-indicator/time-indicator.styles.js.map +1 -1
  664. package/schedule/time-indicator/time-indicator.styles_1eaxyes.css +6 -0
  665. package/schedule/types.d.ts +10 -0
  666. package/select-histogram/select-histogram.js +1 -1
  667. package/select-histogram/select-histogram.js.map +1 -1
  668. package/select-histogram/select-histogram.styles.js +1 -1
  669. package/select-histogram/select-histogram.styles.js.map +1 -1
  670. package/select-histogram/{select-histogram.styles_11916eo.css → select-histogram.styles_n260dy.css} +1 -1
  671. package/shared/dropdown-list/dropdown-label.js +1 -1
  672. package/shared/dropdown-list/dropdown-label.js.map +1 -1
  673. package/shared/dropdown-list/dropdown-label.styles.js +1 -1
  674. package/shared/dropdown-list/dropdown-label.styles.js.map +1 -1
  675. package/{cjs/shared/dropdown-list/dropdown-label.styles_1dwmd8f.css → shared/dropdown-list/dropdown-label.styles_mloii0.css} +4 -4
  676. package/shared/dropdown-list/dropdown-list.styles.js +1 -1
  677. package/shared/dropdown-list/dropdown-list.styles.js.map +1 -1
  678. package/{cjs/shared/dropdown-list/dropdown-list.styles_1kt4zhf.css → shared/dropdown-list/dropdown-list.styles_konwm.css} +4 -4
  679. package/shared/dropdown-list/dropdown-search.styles.js +1 -1
  680. package/shared/dropdown-list/dropdown-search.styles.js.map +1 -1
  681. package/{cjs/shared/dropdown-list/dropdown-search.styles_4r9oma.css → shared/dropdown-list/dropdown-search.styles_1hc1gkh.css} +2 -2
  682. package/shared/dropdown-list/expandable-element.js +1 -1
  683. package/shared/dropdown-list/expandable-element.js.map +1 -1
  684. package/shared/dropdown-list/expandable-element.styles.d.ts +0 -1
  685. package/shared/dropdown-list/expandable-element.styles.js +1 -1
  686. package/shared/dropdown-list/expandable-element.styles.js.map +1 -1
  687. package/shared/dropdown-list/expandable-element.styles_rkkvqr.css +5 -0
  688. package/shared/dropdown-wrapper/dropdown-wrapper.styles.js +1 -1
  689. package/shared/dropdown-wrapper/dropdown-wrapper.styles.js.map +1 -1
  690. package/shared/dropdown-wrapper/dropdown-wrapper.styles_15hwwoj.css +3 -0
  691. package/shared/hooks/useViewport.d.ts +7 -2
  692. package/shared/hooks/useViewport.js +1 -1
  693. package/shared/hooks/useViewport.js.map +1 -1
  694. package/shared/input-wrapper/input-wrapper.styles.js +1 -1
  695. package/shared/input-wrapper/{input-wrapper.styles_19fpzb.css → input-wrapper.styles_je6maw.css} +2 -2
  696. package/shared/internal-calendar/calendar-manager.styles.js +1 -1
  697. package/shared/internal-calendar/{calendar-manager.styles_1q13ylk.css → calendar-manager.styles_1iuq5zw.css} +1 -1
  698. package/shared/internal-calendar/day-cell/day-cell.styles.js +1 -1
  699. package/shared/internal-calendar/day-cell/day-cell.styles.js.map +1 -1
  700. package/{cjs/shared/internal-calendar/day-cell/day-cell.styles_vazxvn.css → shared/internal-calendar/day-cell/day-cell.styles_1t5oqc1.css} +1 -1
  701. package/shared/internal-calendar/internal-calendar-month.styles.js +1 -1
  702. package/{cjs/shared/internal-calendar/internal-calendar-month.styles_1pk3ynj.css → shared/internal-calendar/internal-calendar-month.styles_14oh57f.css} +1 -1
  703. package/shared/internal-calendar/internal-calendar-year.styles.js +1 -1
  704. package/shared/internal-calendar/internal-calendar-year.styles.js.map +1 -1
  705. package/shared/internal-calendar/{internal-calendar-year.styles_1azy42u.css → internal-calendar-year.styles_therlc.css} +1 -1
  706. package/shared/internal-calendar/single/single-cell.js +1 -1
  707. package/shared/internal-calendar/single/single-cell.js.map +1 -1
  708. package/shared/internal-calendar/standard/standard-calendar-day-view.styles.js +1 -1
  709. package/{cjs/shared/internal-calendar/standard/standard-calendar-day-view.styles_1dbvup3.css → shared/internal-calendar/standard/standard-calendar-day-view.styles_1bw26au.css} +1 -1
  710. package/shared/standalone-date-input/standalone-date-input.js +1 -1
  711. package/shared/standalone-date-input/standalone-date-input.js.map +1 -1
  712. package/shared/standalone-date-input/standalone-date-input.styles.d.ts +2 -0
  713. package/shared/standalone-date-input/standalone-date-input.styles.js +1 -1
  714. package/shared/standalone-date-input/standalone-date-input.styles.js.map +1 -1
  715. package/shared/standalone-date-input/standalone-date-input.styles_157qo89.css +15 -0
  716. package/shared/time-slot/time-slot.d.ts +1 -0
  717. package/shared/time-slot/time-slot.js +1 -1
  718. package/shared/time-slot/time-slot.js.map +1 -1
  719. package/shared/time-slot/time-slot.styles.d.ts +2 -0
  720. package/shared/time-slot/time-slot.styles.js +1 -1
  721. package/shared/time-slot/time-slot.styles.js.map +1 -1
  722. package/shared/time-slot/time-slot.styles_18s0to7.css +29 -0
  723. package/sidenav/sidenav-drawer-item.styles.js +1 -1
  724. package/sidenav/sidenav-drawer-item.styles.js.map +1 -1
  725. package/sidenav/{sidenav-drawer-item.styles_yp8cga.css → sidenav-drawer-item.styles_1ljnyx2.css} +1 -1
  726. package/sidenav/sidenav-drawer-subitem.styles.js +1 -1
  727. package/sidenav/sidenav-drawer-subitem.styles.js.map +1 -1
  728. package/sidenav/sidenav-drawer-subitem.styles_2y58kf.css +1 -0
  729. package/sidenav/sidenav-item.styles.js +1 -1
  730. package/sidenav/sidenav-item.styles.js.map +1 -1
  731. package/sidenav/{sidenav-item.styles_1eew8px.css → sidenav-item.styles_lqw3kh.css} +2 -2
  732. package/smart-app-banner/smart-app-banner.styles.js +1 -1
  733. package/smart-app-banner/smart-app-banner.styles.js.map +1 -1
  734. package/smart-app-banner/{smart-app-banner.styles_m5dtgh.css → smart-app-banner.styles_15u6yv4.css} +2 -2
  735. package/tab/tab-link-chain.styles.js +1 -1
  736. package/tab/tab-link-chain.styles.js.map +1 -1
  737. package/tab/{tab-link-chain.styles_1nreqrp.css → tab-link-chain.styles_49got4.css} +2 -2
  738. package/tag/tag.style.js +1 -1
  739. package/tag/{tag.style_10tn8i.css → tag.style_d98c53.css} +2 -2
  740. package/text-list/text-list.styles.js +1 -1
  741. package/text-list/text-list.styles.js.map +1 -1
  742. package/text-list/text-list.styles_w3fvyt.css +16 -0
  743. package/theme/index.d.ts +4 -1
  744. package/theme/index.js +1 -1
  745. package/theme/styles/a11y-playground.css +30 -1
  746. package/theme/styles/bookingsg.css +30 -1
  747. package/theme/styles/careercompass.css +516 -0
  748. package/theme/styles/ccube.css +28 -0
  749. package/theme/styles/default.css +2 -1
  750. package/theme/styles/imda.css +30 -1
  751. package/theme/styles/lifesg.css +28 -0
  752. package/theme/styles/mylegacy.css +30 -1
  753. package/theme/styles/oneservice.css +28 -0
  754. package/theme/styles/pa.css +30 -1
  755. package/theme/styles/rbs.css +28 -0
  756. package/theme/styles/sgw-digital-lobby.css +32 -3
  757. package/theme/styles/smgs.css +516 -0
  758. package/theme/styles/spf.css +143 -114
  759. package/theme/styles/supportgowhere.css +30 -1
  760. package/theme/theme-provider/hooks.d.ts +2 -1
  761. package/theme/theme-provider/hooks.js +1 -1
  762. package/theme/theme-provider/hooks.js.map +1 -1
  763. package/theme/tokens/colour.d.ts +28 -0
  764. package/theme/tokens/colour.js +1 -1
  765. package/theme/tokens/colour.js.map +1 -1
  766. package/theme/tokens/font.d.ts +4 -2
  767. package/theme/tokens/font.js +1 -1
  768. package/theme/tokens/font.js.map +1 -1
  769. package/theme/types.d.ts +1 -1
  770. package/theme/types.js +1 -1
  771. package/theme/types.js.map +1 -1
  772. package/theme/utils/css-variable.d.ts +0 -5
  773. package/theme/utils/css-variable.js +1 -1
  774. package/theme/utils/css-variable.js.map +1 -1
  775. package/theme/utils/font.d.ts +2 -2
  776. package/theme/utils/font.js +1 -1
  777. package/theme/utils/font.js.map +1 -1
  778. package/theme/utils/token-resolver.js +1 -1
  779. package/theme/utils/token-resolver.js.map +1 -1
  780. package/theme/utils/use-design-token.js +1 -1
  781. package/theme/utils/use-design-token.js.map +1 -1
  782. package/theme/utils/use-media-query.d.ts +1 -2
  783. package/theme/utils/use-media-query.js +1 -1
  784. package/theme/utils/use-media-query.js.map +1 -1
  785. package/time-range-picker/combobox-picker/combobox-picker.js +1 -1
  786. package/time-range-picker/combobox-picker/combobox-picker.js.map +1 -1
  787. package/time-slot-bar-week/consts.d.ts +3 -0
  788. package/time-slot-bar-week/consts.js +2 -0
  789. package/time-slot-bar-week/consts.js.map +1 -0
  790. package/time-slot-bar-week/time-slot-bar-week-days.js +1 -1
  791. package/time-slot-bar-week/time-slot-bar-week-days.js.map +1 -1
  792. package/time-slot-bar-week/time-slot-bar-week-days.styles.d.ts +25 -0
  793. package/time-slot-bar-week/time-slot-bar-week-days.styles.js +2 -0
  794. package/time-slot-bar-week/time-slot-bar-week-days.styles.js.map +1 -0
  795. package/time-slot-bar-week/time-slot-bar-week-days.styles_evdvs9.css +17 -0
  796. package/time-slot-bar-week/time-slot-bar-week.js +1 -1
  797. package/time-slot-bar-week/time-slot-bar-week.js.map +1 -1
  798. package/time-slot-bar-week/time-slot-bar-week.styles.d.ts +1 -0
  799. package/time-slot-bar-week/time-slot-bar-week.styles.js +2 -0
  800. package/time-slot-bar-week/time-slot-bar-week.styles.js.map +1 -0
  801. package/time-slot-bar-week/time-slot-bar-week.styles_11ybf42.css +1 -0
  802. package/time-slot-bar-week/time-slot-cell.d.ts +28 -0
  803. package/time-slot-bar-week/time-slot-cell.js +2 -0
  804. package/time-slot-bar-week/time-slot-cell.js.map +1 -0
  805. package/time-slot-week-view/time-slot-week-days.js +1 -1
  806. package/time-slot-week-view/time-slot-week-days.js.map +1 -1
  807. package/time-slot-week-view/time-slot-week-days.styles.d.ts +14 -0
  808. package/time-slot-week-view/time-slot-week-days.styles.js +2 -0
  809. package/time-slot-week-view/time-slot-week-days.styles.js.map +1 -0
  810. package/time-slot-week-view/time-slot-week-days.styles_1h21vyw.css +9 -0
  811. package/time-slot-week-view/time-slot-week-view.js +1 -1
  812. package/time-slot-week-view/time-slot-week-view.js.map +1 -1
  813. package/time-slot-week-view/time-slot-week-view.styles.d.ts +1 -1
  814. package/time-slot-week-view/time-slot-week-view.styles.js +1 -9
  815. package/time-slot-week-view/time-slot-week-view.styles.js.map +1 -1
  816. package/time-slot-week-view/time-slot-week-view.styles_gqgsw2.css +1 -0
  817. package/timeline/timeline.styles.js +1 -1
  818. package/{cjs/timeline/timeline.styles_1wcnzot.css → timeline/timeline.styles_1jxzik4.css} +1 -1
  819. package/timepicker/timepicker.js +1 -1
  820. package/timepicker/timepicker.js.map +1 -1
  821. package/timepicker/timepicker.styles.js +1 -1
  822. package/timepicker/timepicker.styles.js.map +1 -1
  823. package/timepicker/timepicker.styles_1jm33yw.css +1 -0
  824. package/toast/toast.styles.js +1 -1
  825. package/toast/toast.styles.js.map +1 -1
  826. package/toast/{toast.styles_ngrlup.css → toast.styles_1e0l60w.css} +1 -1
  827. package/toggle/toggle.styles.js +1 -1
  828. package/toggle/toggle.styles.js.map +1 -1
  829. package/{cjs/toggle/toggle.styles_1yzqsu.css → toggle/toggle.styles_1t5qrye.css} +5 -5
  830. package/typography/index.js +1 -1
  831. package/typography/typography.js +1 -1
  832. package/typography/typography.js.map +1 -1
  833. package/typography/typography.styles.d.ts +2 -0
  834. package/typography/typography.styles.js +1 -1
  835. package/typography/typography.styles.js.map +1 -1
  836. package/typography/typography.styles_1155j4c.css +11 -0
  837. package/uneditable-section/section-item.styles.js +1 -1
  838. package/uneditable-section/section-item.styles.js.map +1 -1
  839. package/uneditable-section/{section-item.styles_1dfjzc4.css → section-item.styles_mwx8ht.css} +2 -2
  840. package/util/is-styled-components.d.ts +5 -0
  841. package/util/is-styled-components.js +2 -0
  842. package/util/is-styled-components.js.map +1 -0
  843. package/util/styling-helper.js +1 -1
  844. package/util/styling-helper.js.map +1 -1
  845. package/badge/badge.styles_1yrxocm.css +0 -16
  846. package/cjs/badge/badge.styles_1yrxocm.css +0 -16
  847. package/cjs/date-navigator/date-navigator.styles_1cotsgz.css +0 -4
  848. package/cjs/file-upload/file-list.js +0 -2
  849. package/cjs/file-upload/file-list.js.map +0 -1
  850. package/cjs/file-upload/file-list.styles.js +0 -2
  851. package/cjs/file-upload/file-list.styles.js.map +0 -1
  852. package/cjs/file-upload/file-list.styles_16vplxk.css +0 -3
  853. package/cjs/filter/filter-modal.styles_e0ev97.css +0 -8
  854. package/cjs/filter/filter-sidebar.styles_cwvqql.css +0 -4
  855. package/cjs/form/form-label.styles_rk98yd.css +0 -6
  856. package/cjs/input-textarea/textarea-counter.styles_adg5h1.css +0 -1
  857. package/cjs/input-textarea/textarea.styles_g0zgyq.css +0 -5
  858. package/cjs/language-switcher/dropdown-variant.styles_16c4wc1.css +0 -2
  859. package/cjs/markup/markup.utils.js +0 -2
  860. package/cjs/markup/markup.utils.js.map +0 -1
  861. package/cjs/modal/modal-box.styles_1xrlxhd.css +0 -2
  862. package/cjs/modal-v2/modal-v2.styles_1irpyi6.css +0 -3
  863. package/cjs/otp-verification/contact-input-section-styles.js +0 -115
  864. package/cjs/otp-verification/contact-input-section-styles.js.map +0 -1
  865. package/cjs/otp-verification/otp-verification-styles.js +0 -6
  866. package/cjs/otp-verification/otp-verification-styles.js.map +0 -1
  867. package/cjs/otp-verification/verification-section-styles.js +0 -27
  868. package/cjs/otp-verification/verification-section-styles.js.map +0 -1
  869. package/cjs/schedule/schedule-header/schedule-header.style.js +0 -38
  870. package/cjs/schedule/schedule-header/schedule-header.style.js.map +0 -1
  871. package/cjs/schedule/schedule-week-view/slot-content.js +0 -2
  872. package/cjs/schedule/schedule-week-view/slot-content.js.map +0 -1
  873. package/cjs/schedule/schedule-week-view/slot-content.styles.js +0 -40
  874. package/cjs/schedule/schedule-week-view/slot-content.styles.js.map +0 -1
  875. package/cjs/shared/dropdown-list/expandable-element.styles_5o9f9w.css +0 -6
  876. package/cjs/shared/dropdown-wrapper/dropdown-wrapper.styles_v10jbi.css +0 -3
  877. package/cjs/shared/standalone-date-input/standalone-date-input.styles_1m0da43.css +0 -13
  878. package/cjs/shared/styles/index.js +0 -2
  879. package/cjs/shared/styles/index.js.map +0 -1
  880. package/cjs/shared/time-slot/time-slot.styles_1r9na3f.css +0 -17
  881. package/cjs/sidenav/sidenav-drawer-subitem.styles_1ylzfn5.css +0 -1
  882. package/cjs/text-list/text-list.styles_1gohl3f.css +0 -16
  883. package/cjs/time-slot-bar-week/time-slot-bar-week-days.style.js +0 -104
  884. package/cjs/time-slot-bar-week/time-slot-bar-week-days.style.js.map +0 -1
  885. package/cjs/time-slot-bar-week/time-slot-bar-week.style.js +0 -10
  886. package/cjs/time-slot-bar-week/time-slot-bar-week.style.js.map +0 -1
  887. package/cjs/time-slot-week-view/time-slot-week-days.style.js +0 -59
  888. package/cjs/time-slot-week-view/time-slot-week-days.style.js.map +0 -1
  889. package/cjs/timepicker/timepicker.styles_zmkhl8.css +0 -1
  890. package/cjs/typography/typography.styles_1jqils.css +0 -9
  891. package/cjs/v3_theme/border/specs/default-border-set.js +0 -2
  892. package/cjs/v3_theme/border/specs/default-border-set.js.map +0 -1
  893. package/cjs/v3_theme/border/theme-helper.js +0 -2
  894. package/cjs/v3_theme/border/theme-helper.js.map +0 -1
  895. package/cjs/v3_theme/border-util/specs/default-border-util-set.js +0 -2
  896. package/cjs/v3_theme/border-util/specs/default-border-util-set.js.map +0 -1
  897. package/cjs/v3_theme/border-util/theme-helper.js +0 -2
  898. package/cjs/v3_theme/border-util/theme-helper.js.map +0 -1
  899. package/cjs/v3_theme/border-util/utils.js +0 -8
  900. package/cjs/v3_theme/border-util/utils.js.map +0 -1
  901. package/cjs/v3_theme/breakpoint/media-query-helper.js +0 -2
  902. package/cjs/v3_theme/breakpoint/media-query-helper.js.map +0 -1
  903. package/cjs/v3_theme/breakpoint/specs/default-breakpoint-set.js +0 -2
  904. package/cjs/v3_theme/breakpoint/specs/default-breakpoint-set.js.map +0 -1
  905. package/cjs/v3_theme/breakpoint/theme-helper.js +0 -2
  906. package/cjs/v3_theme/breakpoint/theme-helper.js.map +0 -1
  907. package/cjs/v3_theme/colour-primitive/specs/a11yplayground-colour-set.js +0 -2
  908. package/cjs/v3_theme/colour-primitive/specs/a11yplayground-colour-set.js.map +0 -1
  909. package/cjs/v3_theme/colour-primitive/specs/bookingsg-colour-set.js +0 -2
  910. package/cjs/v3_theme/colour-primitive/specs/bookingsg-colour-set.js.map +0 -1
  911. package/cjs/v3_theme/colour-primitive/specs/ccube-colour-set.js +0 -2
  912. package/cjs/v3_theme/colour-primitive/specs/ccube-colour-set.js.map +0 -1
  913. package/cjs/v3_theme/colour-primitive/specs/imda-colour-set.js +0 -2
  914. package/cjs/v3_theme/colour-primitive/specs/imda-colour-set.js.map +0 -1
  915. package/cjs/v3_theme/colour-primitive/specs/lifesg-colour-set.js +0 -2
  916. package/cjs/v3_theme/colour-primitive/specs/lifesg-colour-set.js.map +0 -1
  917. package/cjs/v3_theme/colour-primitive/specs/mylegacy-colour-set.js +0 -2
  918. package/cjs/v3_theme/colour-primitive/specs/mylegacy-colour-set.js.map +0 -1
  919. package/cjs/v3_theme/colour-primitive/specs/oneservice-colour-set.js +0 -2
  920. package/cjs/v3_theme/colour-primitive/specs/oneservice-colour-set.js.map +0 -1
  921. package/cjs/v3_theme/colour-primitive/specs/pa-colour-set.js +0 -2
  922. package/cjs/v3_theme/colour-primitive/specs/pa-colour-set.js.map +0 -1
  923. package/cjs/v3_theme/colour-primitive/specs/rbs-colour-set.js +0 -2
  924. package/cjs/v3_theme/colour-primitive/specs/rbs-colour-set.js.map +0 -1
  925. package/cjs/v3_theme/colour-primitive/specs/smgs-colour-set.js +0 -2
  926. package/cjs/v3_theme/colour-primitive/specs/smgs-colour-set.js.map +0 -1
  927. package/cjs/v3_theme/colour-primitive/specs/spf-colour-set.js +0 -2
  928. package/cjs/v3_theme/colour-primitive/specs/spf-colour-set.js.map +0 -1
  929. package/cjs/v3_theme/colour-primitive/specs/supportgowhere-colour-set.js +0 -2
  930. package/cjs/v3_theme/colour-primitive/specs/supportgowhere-colour-set.js.map +0 -1
  931. package/cjs/v3_theme/colour-primitive/theme-helper.js +0 -2
  932. package/cjs/v3_theme/colour-primitive/theme-helper.js.map +0 -1
  933. package/cjs/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.js +0 -2
  934. package/cjs/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.js.map +0 -1
  935. package/cjs/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.js +0 -2
  936. package/cjs/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.js.map +0 -1
  937. package/cjs/v3_theme/colour-semantic/specs/pa-semantic-tokens.js +0 -2
  938. package/cjs/v3_theme/colour-semantic/specs/pa-semantic-tokens.js.map +0 -1
  939. package/cjs/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.js +0 -2
  940. package/cjs/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.js.map +0 -1
  941. package/cjs/v3_theme/colour-semantic/theme-helper.js +0 -2
  942. package/cjs/v3_theme/colour-semantic/theme-helper.js.map +0 -1
  943. package/cjs/v3_theme/ds-theme-provider.js +0 -2
  944. package/cjs/v3_theme/ds-theme-provider.js.map +0 -1
  945. package/cjs/v3_theme/font/specs/a11yplayground-font-set.js +0 -2
  946. package/cjs/v3_theme/font/specs/a11yplayground-font-set.js.map +0 -1
  947. package/cjs/v3_theme/font/specs/bookingsg-font-set.js +0 -2
  948. package/cjs/v3_theme/font/specs/bookingsg-font-set.js.map +0 -1
  949. package/cjs/v3_theme/font/specs/default-font-set.js +0 -2
  950. package/cjs/v3_theme/font/specs/default-font-set.js.map +0 -1
  951. package/cjs/v3_theme/font/specs/imda-font-set.js +0 -2
  952. package/cjs/v3_theme/font/specs/imda-font-set.js.map +0 -1
  953. package/cjs/v3_theme/font/specs/oneservice-font-set.js +0 -2
  954. package/cjs/v3_theme/font/specs/oneservice-font-set.js.map +0 -1
  955. package/cjs/v3_theme/font/specs/pa-font-set.js +0 -2
  956. package/cjs/v3_theme/font/specs/pa-font-set.js.map +0 -1
  957. package/cjs/v3_theme/font/specs/smgs-font-set.js +0 -2
  958. package/cjs/v3_theme/font/specs/smgs-font-set.js.map +0 -1
  959. package/cjs/v3_theme/font/specs/spf-font-set.js +0 -2
  960. package/cjs/v3_theme/font/specs/spf-font-set.js.map +0 -1
  961. package/cjs/v3_theme/font/specs/supportgowhere-font-set.js +0 -2
  962. package/cjs/v3_theme/font/specs/supportgowhere-font-set.js.map +0 -1
  963. package/cjs/v3_theme/font/theme-helper.js +0 -2
  964. package/cjs/v3_theme/font/theme-helper.js.map +0 -1
  965. package/cjs/v3_theme/font/utils.js +0 -10
  966. package/cjs/v3_theme/font/utils.js.map +0 -1
  967. package/cjs/v3_theme/font-spec/specs/a11yplayground-font-spec-set.js +0 -2
  968. package/cjs/v3_theme/font-spec/specs/a11yplayground-font-spec-set.js.map +0 -1
  969. package/cjs/v3_theme/font-spec/specs/bookingsg-font-spec-set.js +0 -2
  970. package/cjs/v3_theme/font-spec/specs/bookingsg-font-spec-set.js.map +0 -1
  971. package/cjs/v3_theme/font-spec/specs/default-font-spec-set.js +0 -2
  972. package/cjs/v3_theme/font-spec/specs/default-font-spec-set.js.map +0 -1
  973. package/cjs/v3_theme/font-spec/specs/imda-font-spec-set.js +0 -2
  974. package/cjs/v3_theme/font-spec/specs/imda-font-spec-set.js.map +0 -1
  975. package/cjs/v3_theme/font-spec/specs/mylegacy-font-spec-set.js +0 -2
  976. package/cjs/v3_theme/font-spec/specs/mylegacy-font-spec-set.js.map +0 -1
  977. package/cjs/v3_theme/font-spec/specs/oneservice-font-spec-set.js +0 -2
  978. package/cjs/v3_theme/font-spec/specs/oneservice-font-spec-set.js.map +0 -1
  979. package/cjs/v3_theme/font-spec/specs/pa-font-spec-set.js +0 -2
  980. package/cjs/v3_theme/font-spec/specs/pa-font-spec-set.js.map +0 -1
  981. package/cjs/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.js +0 -2
  982. package/cjs/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.js.map +0 -1
  983. package/cjs/v3_theme/font-spec/specs/smgs-font-spec-set.js +0 -2
  984. package/cjs/v3_theme/font-spec/specs/smgs-font-spec-set.js.map +0 -1
  985. package/cjs/v3_theme/font-spec/specs/spf-font-spec-set.js +0 -2
  986. package/cjs/v3_theme/font-spec/specs/spf-font-spec-set.js.map +0 -1
  987. package/cjs/v3_theme/font-spec/specs/supportgowhere-font-spec-set.js +0 -2
  988. package/cjs/v3_theme/font-spec/specs/supportgowhere-font-spec-set.js.map +0 -1
  989. package/cjs/v3_theme/font-spec/theme-helper.js +0 -2
  990. package/cjs/v3_theme/font-spec/theme-helper.js.map +0 -1
  991. package/cjs/v3_theme/helpers.js +0 -2
  992. package/cjs/v3_theme/helpers.js.map +0 -1
  993. package/cjs/v3_theme/index.js +0 -2
  994. package/cjs/v3_theme/index.js.map +0 -1
  995. package/cjs/v3_theme/motion/specs/default-motion-set.js +0 -2
  996. package/cjs/v3_theme/motion/specs/default-motion-set.js.map +0 -1
  997. package/cjs/v3_theme/motion/theme-helper.js +0 -2
  998. package/cjs/v3_theme/motion/theme-helper.js.map +0 -1
  999. package/cjs/v3_theme/radius/specs/default-radius-set.js +0 -2
  1000. package/cjs/v3_theme/radius/specs/default-radius-set.js.map +0 -1
  1001. package/cjs/v3_theme/radius/specs/spf-radius-set.js +0 -2
  1002. package/cjs/v3_theme/radius/specs/spf-radius-set.js.map +0 -1
  1003. package/cjs/v3_theme/radius/theme-helper.js +0 -2
  1004. package/cjs/v3_theme/radius/theme-helper.js.map +0 -1
  1005. package/cjs/v3_theme/shadow/specs/default-shadow-set.js +0 -2
  1006. package/cjs/v3_theme/shadow/specs/default-shadow-set.js.map +0 -1
  1007. package/cjs/v3_theme/shadow/theme-helper.js +0 -2
  1008. package/cjs/v3_theme/shadow/theme-helper.js.map +0 -1
  1009. package/cjs/v3_theme/spacing/specs/default-spacing-set.js +0 -2
  1010. package/cjs/v3_theme/spacing/specs/default-spacing-set.js.map +0 -1
  1011. package/cjs/v3_theme/spacing/theme-helper.js +0 -2
  1012. package/cjs/v3_theme/spacing/theme-helper.js.map +0 -1
  1013. package/cjs/v3_theme/use-theme-mode.js +0 -2
  1014. package/cjs/v3_theme/use-theme-mode.js.map +0 -1
  1015. package/codemods/common.ts +0 -8
  1016. package/codemods/data.ts +0 -16
  1017. package/codemods/deprecate-v2-tokens/data.ts +0 -283
  1018. package/codemods/deprecate-v2-tokens/index.ts +0 -89
  1019. package/codemods/migrate-colour/data.ts +0 -95
  1020. package/codemods/migrate-colour/index.ts +0 -104
  1021. package/codemods/migrate-layout/data.ts +0 -5
  1022. package/codemods/migrate-layout/index.ts +0 -108
  1023. package/codemods/migrate-media-query/data.ts +0 -20
  1024. package/codemods/migrate-media-query/index.ts +0 -113
  1025. package/codemods/migrate-text/data.ts +0 -48
  1026. package/codemods/migrate-text/index.ts +0 -196
  1027. package/codemods/migrate-text-list/data.ts +0 -16
  1028. package/codemods/migrate-text-list/index.ts +0 -111
  1029. package/common.d.ts +0 -8
  1030. package/date-navigator/date-navigator.styles_1cotsgz.css +0 -4
  1031. package/deprecate-v2-tokens/data.d.ts +0 -8
  1032. package/file-upload/file-list.js +0 -2
  1033. package/file-upload/file-list.js.map +0 -1
  1034. package/file-upload/file-list.styles.js +0 -2
  1035. package/file-upload/file-list.styles.js.map +0 -1
  1036. package/file-upload/file-list.styles_16vplxk.css +0 -3
  1037. package/filter/filter-modal.styles_e0ev97.css +0 -8
  1038. package/filter/filter-sidebar.styles_cwvqql.css +0 -4
  1039. package/form/form-label.styles_rk98yd.css +0 -6
  1040. package/input-textarea/textarea-counter.styles_adg5h1.css +0 -1
  1041. package/input-textarea/textarea.styles_g0zgyq.css +0 -5
  1042. package/language-switcher/dropdown-variant.styles_16c4wc1.css +0 -2
  1043. package/markup/markup.utils.d.ts +0 -2
  1044. package/markup/markup.utils.js +0 -2
  1045. package/markup/markup.utils.js.map +0 -1
  1046. package/migrate-colour/data.d.ts +0 -270
  1047. package/migrate-colour/index.d.ts +0 -7
  1048. package/migrate-layout/data.d.ts +0 -5
  1049. package/migrate-layout/index.d.ts +0 -2
  1050. package/migrate-media-query/data.d.ts +0 -20
  1051. package/migrate-media-query/index.d.ts +0 -2
  1052. package/migrate-text/data.d.ts +0 -46
  1053. package/migrate-text/index.d.ts +0 -2
  1054. package/migrate-text-list/data.d.ts +0 -16
  1055. package/migrate-text-list/index.d.ts +0 -2
  1056. package/modal/modal-box.styles_1xrlxhd.css +0 -2
  1057. package/modal-v2/modal-v2.styles_1irpyi6.css +0 -3
  1058. package/otp-verification/contact-input-section-styles.d.ts +0 -14
  1059. package/otp-verification/contact-input-section-styles.js +0 -115
  1060. package/otp-verification/contact-input-section-styles.js.map +0 -1
  1061. package/otp-verification/otp-verification-styles.d.ts +0 -1
  1062. package/otp-verification/otp-verification-styles.js +0 -6
  1063. package/otp-verification/otp-verification-styles.js.map +0 -1
  1064. package/otp-verification/verification-section-styles.d.ts +0 -23
  1065. package/otp-verification/verification-section-styles.js +0 -27
  1066. package/otp-verification/verification-section-styles.js.map +0 -1
  1067. package/schedule/schedule-header/schedule-header.style.d.ts +0 -25
  1068. package/schedule/schedule-header/schedule-header.style.js +0 -38
  1069. package/schedule/schedule-header/schedule-header.style.js.map +0 -1
  1070. package/schedule/schedule-week-view/slot-content.d.ts +0 -8
  1071. package/schedule/schedule-week-view/slot-content.js +0 -2
  1072. package/schedule/schedule-week-view/slot-content.js.map +0 -1
  1073. package/schedule/schedule-week-view/slot-content.styles.d.ts +0 -27
  1074. package/schedule/schedule-week-view/slot-content.styles.js +0 -40
  1075. package/schedule/schedule-week-view/slot-content.styles.js.map +0 -1
  1076. package/schedule/shared/index.d.ts +0 -2
  1077. package/shared/dropdown-list/expandable-element.styles_5o9f9w.css +0 -6
  1078. package/shared/dropdown-wrapper/dropdown-wrapper.styles_v10jbi.css +0 -3
  1079. package/shared/standalone-date-input/standalone-date-input.styles_1m0da43.css +0 -13
  1080. package/shared/styles/index.js +0 -2
  1081. package/shared/styles/index.js.map +0 -1
  1082. package/shared/time-slot/time-slot.styles_1r9na3f.css +0 -17
  1083. package/sidenav/sidenav-drawer-subitem.styles_1ylzfn5.css +0 -1
  1084. package/text-list/text-list.styles_1gohl3f.css +0 -16
  1085. package/time-slot-bar-week/time-slot-bar-week-days.style.d.ts +0 -54
  1086. package/time-slot-bar-week/time-slot-bar-week-days.style.js +0 -104
  1087. package/time-slot-bar-week/time-slot-bar-week-days.style.js.map +0 -1
  1088. package/time-slot-bar-week/time-slot-bar-week.style.d.ts +0 -1
  1089. package/time-slot-bar-week/time-slot-bar-week.style.js +0 -10
  1090. package/time-slot-bar-week/time-slot-bar-week.style.js.map +0 -1
  1091. package/time-slot-week-view/time-slot-week-days.style.d.ts +0 -12
  1092. package/time-slot-week-view/time-slot-week-days.style.js +0 -59
  1093. package/time-slot-week-view/time-slot-week-days.style.js.map +0 -1
  1094. package/timepicker/timepicker.styles_zmkhl8.css +0 -1
  1095. package/typography/typography.styles_1jqils.css +0 -9
  1096. package/v3_theme/border/specs/default-border-set.d.ts +0 -2
  1097. package/v3_theme/border/specs/default-border-set.js +0 -2
  1098. package/v3_theme/border/specs/default-border-set.js.map +0 -1
  1099. package/v3_theme/border/theme-helper.d.ts +0 -10
  1100. package/v3_theme/border/theme-helper.js +0 -2
  1101. package/v3_theme/border/theme-helper.js.map +0 -1
  1102. package/v3_theme/border/types.d.ts +0 -12
  1103. package/v3_theme/border-util/specs/default-border-util-set.d.ts +0 -2
  1104. package/v3_theme/border-util/specs/default-border-util-set.js +0 -2
  1105. package/v3_theme/border-util/specs/default-border-util-set.js.map +0 -1
  1106. package/v3_theme/border-util/theme-helper.d.ts +0 -8
  1107. package/v3_theme/border-util/theme-helper.js +0 -2
  1108. package/v3_theme/border-util/theme-helper.js.map +0 -1
  1109. package/v3_theme/border-util/types.d.ts +0 -19
  1110. package/v3_theme/border-util/utils.d.ts +0 -11
  1111. package/v3_theme/border-util/utils.js +0 -8
  1112. package/v3_theme/border-util/utils.js.map +0 -1
  1113. package/v3_theme/breakpoint/media-query-helper.d.ts +0 -9
  1114. package/v3_theme/breakpoint/media-query-helper.js +0 -2
  1115. package/v3_theme/breakpoint/media-query-helper.js.map +0 -1
  1116. package/v3_theme/breakpoint/specs/default-breakpoint-set.d.ts +0 -2
  1117. package/v3_theme/breakpoint/specs/default-breakpoint-set.js +0 -2
  1118. package/v3_theme/breakpoint/specs/default-breakpoint-set.js.map +0 -1
  1119. package/v3_theme/breakpoint/theme-helper.d.ts +0 -39
  1120. package/v3_theme/breakpoint/theme-helper.js +0 -2
  1121. package/v3_theme/breakpoint/theme-helper.js.map +0 -1
  1122. package/v3_theme/breakpoint/types.d.ts +0 -41
  1123. package/v3_theme/colour-primitive/specs/a11yplayground-colour-set.d.ts +0 -2
  1124. package/v3_theme/colour-primitive/specs/a11yplayground-colour-set.js +0 -2
  1125. package/v3_theme/colour-primitive/specs/a11yplayground-colour-set.js.map +0 -1
  1126. package/v3_theme/colour-primitive/specs/bookingsg-colour-set.d.ts +0 -2
  1127. package/v3_theme/colour-primitive/specs/bookingsg-colour-set.js +0 -2
  1128. package/v3_theme/colour-primitive/specs/bookingsg-colour-set.js.map +0 -1
  1129. package/v3_theme/colour-primitive/specs/ccube-colour-set.d.ts +0 -2
  1130. package/v3_theme/colour-primitive/specs/ccube-colour-set.js +0 -2
  1131. package/v3_theme/colour-primitive/specs/ccube-colour-set.js.map +0 -1
  1132. package/v3_theme/colour-primitive/specs/imda-colour-set.d.ts +0 -2
  1133. package/v3_theme/colour-primitive/specs/imda-colour-set.js +0 -2
  1134. package/v3_theme/colour-primitive/specs/imda-colour-set.js.map +0 -1
  1135. package/v3_theme/colour-primitive/specs/lifesg-colour-set.d.ts +0 -2
  1136. package/v3_theme/colour-primitive/specs/lifesg-colour-set.js +0 -2
  1137. package/v3_theme/colour-primitive/specs/lifesg-colour-set.js.map +0 -1
  1138. package/v3_theme/colour-primitive/specs/mylegacy-colour-set.d.ts +0 -2
  1139. package/v3_theme/colour-primitive/specs/mylegacy-colour-set.js +0 -2
  1140. package/v3_theme/colour-primitive/specs/mylegacy-colour-set.js.map +0 -1
  1141. package/v3_theme/colour-primitive/specs/oneservice-colour-set.d.ts +0 -2
  1142. package/v3_theme/colour-primitive/specs/oneservice-colour-set.js +0 -2
  1143. package/v3_theme/colour-primitive/specs/oneservice-colour-set.js.map +0 -1
  1144. package/v3_theme/colour-primitive/specs/pa-colour-set.d.ts +0 -2
  1145. package/v3_theme/colour-primitive/specs/pa-colour-set.js +0 -2
  1146. package/v3_theme/colour-primitive/specs/pa-colour-set.js.map +0 -1
  1147. package/v3_theme/colour-primitive/specs/rbs-colour-set.d.ts +0 -2
  1148. package/v3_theme/colour-primitive/specs/rbs-colour-set.js +0 -2
  1149. package/v3_theme/colour-primitive/specs/rbs-colour-set.js.map +0 -1
  1150. package/v3_theme/colour-primitive/specs/smgs-colour-set.d.ts +0 -2
  1151. package/v3_theme/colour-primitive/specs/smgs-colour-set.js +0 -2
  1152. package/v3_theme/colour-primitive/specs/smgs-colour-set.js.map +0 -1
  1153. package/v3_theme/colour-primitive/specs/spf-colour-set.d.ts +0 -2
  1154. package/v3_theme/colour-primitive/specs/spf-colour-set.js +0 -2
  1155. package/v3_theme/colour-primitive/specs/spf-colour-set.js.map +0 -1
  1156. package/v3_theme/colour-primitive/specs/supportgowhere-colour-set.d.ts +0 -2
  1157. package/v3_theme/colour-primitive/specs/supportgowhere-colour-set.js +0 -2
  1158. package/v3_theme/colour-primitive/specs/supportgowhere-colour-set.js.map +0 -1
  1159. package/v3_theme/colour-primitive/theme-helper.d.ts +0 -10
  1160. package/v3_theme/colour-primitive/theme-helper.js +0 -2
  1161. package/v3_theme/colour-primitive/theme-helper.js.map +0 -1
  1162. package/v3_theme/colour-primitive/types.d.ts +0 -98
  1163. package/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.d.ts +0 -3
  1164. package/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.js +0 -2
  1165. package/v3_theme/colour-semantic/specs/a11yplayground-semantic-tokens.js.map +0 -1
  1166. package/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.d.ts +0 -3
  1167. package/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.js +0 -2
  1168. package/v3_theme/colour-semantic/specs/lifesg-semantic-tokens.js.map +0 -1
  1169. package/v3_theme/colour-semantic/specs/pa-semantic-tokens.d.ts +0 -2
  1170. package/v3_theme/colour-semantic/specs/pa-semantic-tokens.js +0 -2
  1171. package/v3_theme/colour-semantic/specs/pa-semantic-tokens.js.map +0 -1
  1172. package/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.d.ts +0 -3
  1173. package/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.js +0 -2
  1174. package/v3_theme/colour-semantic/specs/sgwdigitallobby-tokens.js.map +0 -1
  1175. package/v3_theme/colour-semantic/theme-helper.d.ts +0 -10
  1176. package/v3_theme/colour-semantic/theme-helper.js +0 -2
  1177. package/v3_theme/colour-semantic/theme-helper.js.map +0 -1
  1178. package/v3_theme/colour-semantic/types.d.ts +0 -123
  1179. package/v3_theme/components/specs/a11yplayground-component-token-set.d.ts +0 -2
  1180. package/v3_theme/components/specs/default-component-token-set.d.ts +0 -2
  1181. package/v3_theme/components/specs/lifesg-component-token-set.d.ts +0 -2
  1182. package/v3_theme/components/specs/pa-component-token-set.d.ts +0 -2
  1183. package/v3_theme/components/specs/smgs-component-token-set.d.ts +0 -2
  1184. package/v3_theme/components/specs/spf-component-token-set.d.ts +0 -2
  1185. package/v3_theme/components/theme-helper.d.ts +0 -17
  1186. package/v3_theme/components/types.d.ts +0 -44
  1187. package/v3_theme/ds-theme-provider.d.ts +0 -2
  1188. package/v3_theme/ds-theme-provider.js +0 -2
  1189. package/v3_theme/ds-theme-provider.js.map +0 -1
  1190. package/v3_theme/font/specs/a11yplayground-font-set.d.ts +0 -2
  1191. package/v3_theme/font/specs/a11yplayground-font-set.js +0 -2
  1192. package/v3_theme/font/specs/a11yplayground-font-set.js.map +0 -1
  1193. package/v3_theme/font/specs/bookingsg-font-set.d.ts +0 -2
  1194. package/v3_theme/font/specs/bookingsg-font-set.js +0 -2
  1195. package/v3_theme/font/specs/bookingsg-font-set.js.map +0 -1
  1196. package/v3_theme/font/specs/default-font-set.d.ts +0 -2
  1197. package/v3_theme/font/specs/default-font-set.js +0 -2
  1198. package/v3_theme/font/specs/default-font-set.js.map +0 -1
  1199. package/v3_theme/font/specs/imda-font-set.d.ts +0 -2
  1200. package/v3_theme/font/specs/imda-font-set.js +0 -2
  1201. package/v3_theme/font/specs/imda-font-set.js.map +0 -1
  1202. package/v3_theme/font/specs/oneservice-font-set.d.ts +0 -2
  1203. package/v3_theme/font/specs/oneservice-font-set.js +0 -2
  1204. package/v3_theme/font/specs/oneservice-font-set.js.map +0 -1
  1205. package/v3_theme/font/specs/pa-font-set.d.ts +0 -2
  1206. package/v3_theme/font/specs/pa-font-set.js +0 -2
  1207. package/v3_theme/font/specs/pa-font-set.js.map +0 -1
  1208. package/v3_theme/font/specs/smgs-font-set.d.ts +0 -2
  1209. package/v3_theme/font/specs/smgs-font-set.js +0 -2
  1210. package/v3_theme/font/specs/smgs-font-set.js.map +0 -1
  1211. package/v3_theme/font/specs/spf-font-set.d.ts +0 -2
  1212. package/v3_theme/font/specs/spf-font-set.js +0 -2
  1213. package/v3_theme/font/specs/spf-font-set.js.map +0 -1
  1214. package/v3_theme/font/specs/supportgowhere-font-set.d.ts +0 -2
  1215. package/v3_theme/font/specs/supportgowhere-font-set.js +0 -2
  1216. package/v3_theme/font/specs/supportgowhere-font-set.js.map +0 -1
  1217. package/v3_theme/font/theme-helper.d.ts +0 -7
  1218. package/v3_theme/font/theme-helper.js +0 -2
  1219. package/v3_theme/font/theme-helper.js.map +0 -1
  1220. package/v3_theme/font/types.d.ts +0 -54
  1221. package/v3_theme/font/utils.d.ts +0 -4
  1222. package/v3_theme/font/utils.js +0 -10
  1223. package/v3_theme/font/utils.js.map +0 -1
  1224. package/v3_theme/font-spec/specs/a11yplayground-font-spec-set.d.ts +0 -2
  1225. package/v3_theme/font-spec/specs/a11yplayground-font-spec-set.js +0 -2
  1226. package/v3_theme/font-spec/specs/a11yplayground-font-spec-set.js.map +0 -1
  1227. package/v3_theme/font-spec/specs/bookingsg-font-spec-set.d.ts +0 -2
  1228. package/v3_theme/font-spec/specs/bookingsg-font-spec-set.js +0 -2
  1229. package/v3_theme/font-spec/specs/bookingsg-font-spec-set.js.map +0 -1
  1230. package/v3_theme/font-spec/specs/default-font-spec-set.d.ts +0 -2
  1231. package/v3_theme/font-spec/specs/default-font-spec-set.js +0 -2
  1232. package/v3_theme/font-spec/specs/default-font-spec-set.js.map +0 -1
  1233. package/v3_theme/font-spec/specs/imda-font-spec-set.d.ts +0 -2
  1234. package/v3_theme/font-spec/specs/imda-font-spec-set.js +0 -2
  1235. package/v3_theme/font-spec/specs/imda-font-spec-set.js.map +0 -1
  1236. package/v3_theme/font-spec/specs/mylegacy-font-spec-set.d.ts +0 -2
  1237. package/v3_theme/font-spec/specs/mylegacy-font-spec-set.js +0 -2
  1238. package/v3_theme/font-spec/specs/mylegacy-font-spec-set.js.map +0 -1
  1239. package/v3_theme/font-spec/specs/oneservice-font-spec-set.d.ts +0 -2
  1240. package/v3_theme/font-spec/specs/oneservice-font-spec-set.js +0 -2
  1241. package/v3_theme/font-spec/specs/oneservice-font-spec-set.js.map +0 -1
  1242. package/v3_theme/font-spec/specs/pa-font-spec-set.d.ts +0 -2
  1243. package/v3_theme/font-spec/specs/pa-font-spec-set.js +0 -2
  1244. package/v3_theme/font-spec/specs/pa-font-spec-set.js.map +0 -1
  1245. package/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.d.ts +0 -2
  1246. package/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.js +0 -2
  1247. package/v3_theme/font-spec/specs/sgw-digital-lobby-font-spec-set.js.map +0 -1
  1248. package/v3_theme/font-spec/specs/smgs-font-spec-set.d.ts +0 -2
  1249. package/v3_theme/font-spec/specs/smgs-font-spec-set.js +0 -2
  1250. package/v3_theme/font-spec/specs/smgs-font-spec-set.js.map +0 -1
  1251. package/v3_theme/font-spec/specs/spf-font-spec-set.d.ts +0 -2
  1252. package/v3_theme/font-spec/specs/spf-font-spec-set.js +0 -2
  1253. package/v3_theme/font-spec/specs/spf-font-spec-set.js.map +0 -1
  1254. package/v3_theme/font-spec/specs/supportgowhere-font-spec-set.d.ts +0 -2
  1255. package/v3_theme/font-spec/specs/supportgowhere-font-spec-set.js +0 -2
  1256. package/v3_theme/font-spec/specs/supportgowhere-font-spec-set.js.map +0 -1
  1257. package/v3_theme/font-spec/theme-helper.d.ts +0 -6
  1258. package/v3_theme/font-spec/theme-helper.js +0 -2
  1259. package/v3_theme/font-spec/theme-helper.js.map +0 -1
  1260. package/v3_theme/font-spec/types.d.ts +0 -53
  1261. package/v3_theme/helpers.d.ts +0 -7
  1262. package/v3_theme/helpers.js +0 -2
  1263. package/v3_theme/helpers.js.map +0 -1
  1264. package/v3_theme/index.d.ts +0 -696
  1265. package/v3_theme/index.js +0 -2
  1266. package/v3_theme/index.js.map +0 -1
  1267. package/v3_theme/internal-types.d.ts +0 -4
  1268. package/v3_theme/motion/specs/default-motion-set.d.ts +0 -2
  1269. package/v3_theme/motion/specs/default-motion-set.js +0 -2
  1270. package/v3_theme/motion/specs/default-motion-set.js.map +0 -1
  1271. package/v3_theme/motion/theme-helper.d.ts +0 -6
  1272. package/v3_theme/motion/theme-helper.js +0 -2
  1273. package/v3_theme/motion/theme-helper.js.map +0 -1
  1274. package/v3_theme/motion/types.d.ts +0 -17
  1275. package/v3_theme/radius/specs/default-radius-set.d.ts +0 -2
  1276. package/v3_theme/radius/specs/default-radius-set.js +0 -2
  1277. package/v3_theme/radius/specs/default-radius-set.js.map +0 -1
  1278. package/v3_theme/radius/specs/spf-radius-set.d.ts +0 -2
  1279. package/v3_theme/radius/specs/spf-radius-set.js +0 -2
  1280. package/v3_theme/radius/specs/spf-radius-set.js.map +0 -1
  1281. package/v3_theme/radius/theme-helper.d.ts +0 -6
  1282. package/v3_theme/radius/theme-helper.js +0 -2
  1283. package/v3_theme/radius/theme-helper.js.map +0 -1
  1284. package/v3_theme/radius/types.d.ts +0 -13
  1285. package/v3_theme/shadow/specs/default-shadow-set.d.ts +0 -2
  1286. package/v3_theme/shadow/specs/default-shadow-set.js +0 -2
  1287. package/v3_theme/shadow/specs/default-shadow-set.js.map +0 -1
  1288. package/v3_theme/shadow/theme-helper.d.ts +0 -7
  1289. package/v3_theme/shadow/theme-helper.js +0 -2
  1290. package/v3_theme/shadow/theme-helper.js.map +0 -1
  1291. package/v3_theme/shadow/types.d.ts +0 -21
  1292. package/v3_theme/spacing/specs/default-spacing-set.d.ts +0 -2
  1293. package/v3_theme/spacing/specs/default-spacing-set.js +0 -2
  1294. package/v3_theme/spacing/specs/default-spacing-set.js.map +0 -1
  1295. package/v3_theme/spacing/theme-helper.d.ts +0 -6
  1296. package/v3_theme/spacing/theme-helper.js +0 -2
  1297. package/v3_theme/spacing/theme-helper.js.map +0 -1
  1298. package/v3_theme/spacing/types.d.ts +0 -26
  1299. package/v3_theme/types.d.ts +0 -78
  1300. package/v3_theme/use-theme-mode.d.ts +0 -4
  1301. package/v3_theme/use-theme-mode.js +0 -2
  1302. package/v3_theme/use-theme-mode.js.map +0 -1
  1303. /package/file-upload/{file-list.styles.d.ts → file-list/file-list.styles.d.ts} +0 -0
  1304. /package/{deprecate-v2-tokens → migrate-popover}/index.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"input-nested-multi-select.js","sources":["../../src/input-nested-multi-select/input-nested-multi-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isEqual from \"lodash/isEqual\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type {\n NestedDropdownListItemProps,\n NestedDropdownListLocalItem,\n} from \"../shared/dropdown-list\";\nimport {\n buildKeyPathToSet,\n ExpandableElement,\n NestedDropdownList,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { StringHelper, useId } from \"../util\";\nimport type { SelectedItem } from \"./helpers\";\nimport { getSelectedItems, getSelectedSubItems } from \"./helpers\";\nimport type { InputNestedMultiSelectProps } from \"./types\";\n\nexport const InputNestedMultiSelect = <V1, V2, V3>({\n placeholder = \"Select\",\n options: _options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n selectedKeyPaths: _selectedKeyPaths,\n mode,\n valueToStringFunction,\n enableSearch,\n searchPlaceholder,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n readOnly,\n onSearch,\n onSelectOptions,\n onShowOptions,\n onHideOptions,\n onRetry,\n onBlur,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n variant = \"default\",\n alignment,\n dropdownZIndex,\n dropdownWidth,\n dropdownRootNode,\n}: InputNestedMultiSelectProps<V1, V2, V3>): JSX.Element => {\n // =========================================================================\n // CONST, STATE\n // =========================================================================\n const { multiSelectedLabel } = customLabels || {};\n const options = _options as NestedDropdownListItemProps<V1 | V2 | V3>[];\n const [selectedKeyPaths, setSelectedKeyPaths] = useState<Set<string>>(\n _selectedKeyPaths\n ? buildKeyPathToSet(_selectedKeyPaths)\n : new Set<string>()\n );\n const [selectedItems, setSelectedItems] = useState<\n SelectedItem<V1 | V2 | V3>[]\n >([]);\n\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n const newKeyPath = _selectedKeyPaths || [];\n const selectedItems = getSelectedItems(options, newKeyPath);\n\n setSelectedKeyPaths(buildKeyPathToSet(newKeyPath));\n setSelectedItems(selectedItems);\n }, [_selectedKeyPaths, options]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleSelectAll = (\n keyPaths: string[][],\n items: NestedDropdownListLocalItem<V1 | V2 | V3>[]\n ) => {\n const selectedItems = items.map((item) => ({\n keyPath: item.keyPath,\n label: item.item.label,\n value: item.item.value,\n }));\n setSelectedKeyPaths(buildKeyPathToSet(keyPaths));\n setSelectedItems(selectedItems);\n performOnSelectOptions(keyPaths, selectedItems);\n };\n\n const handleListItemClick = (\n listItem: NestedDropdownListLocalItem<V1 | V2 | V3>\n ) => {\n const newSelectedItems: SelectedItem<V1 | V2 | V3>[] =\n getNewSelection(listItem);\n const newKeyPaths = newSelectedItems.map((item) => item.keyPath);\n setSelectedItems(newSelectedItems);\n setSelectedKeyPaths(buildKeyPathToSet(newKeyPaths));\n performOnSelectOptions(newKeyPaths, newSelectedItems);\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =========================================================================\n // HELPER FUNCTION\n // =========================================================================\n const getDisplayValue = (): string => {\n if (selectedItems.length > 1) {\n return multiSelectedLabel || `${selectedItems.length} selected`;\n }\n\n const { label, value } = selectedItems[0];\n if (valueToStringFunction) {\n return valueToStringFunction(value);\n } else {\n return label;\n }\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 6);\n }\n\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show && onHideOptions) {\n onHideOptions();\n }\n\n if (show && onShowOptions) {\n onShowOptions();\n }\n };\n\n const performOnSelectOptions = (\n keyPaths: string[][],\n items: SelectedItem<V1 | V2 | V3>[]\n ) => {\n if (onSelectOptions) {\n const returnValue = items.map((item) => item.value);\n onSelectOptions(keyPaths, returnValue);\n }\n };\n\n const getNewSelection = (\n item: NestedDropdownListLocalItem<V1 | V2 | V3>\n ): SelectedItem<V1 | V2 | V3>[] => {\n if (item.checked === true) {\n // remove item or subitems\n return selectedItems.filter((selectedItem) => {\n const ancestorKeyPath = selectedItem.keyPath.slice(\n 0,\n item.keyPath.length\n );\n return !isEqual(item.keyPath, ancestorKeyPath);\n });\n } else {\n // select item or all subitems\n const nextSelection = [...selectedItems];\n const newItemsToAdd = item.hasSubItems\n ? getSelectedSubItems(options, item.keyPath)\n : [\n {\n value: item.item.value,\n label: item.item.label,\n keyPath: item.keyPath,\n },\n ];\n newItemsToAdd.forEach((addedItem) => {\n if (\n !selectedItems.find((selectedItem) =>\n isEqual(selectedItem.keyPath, addedItem.keyPath)\n )\n ) {\n nextSelection.push(addedItem);\n }\n });\n return nextSelection;\n }\n };\n\n // =========================================================================\n // RENDER FUNCTION\n // =========================================================================\n const renderLabel = () => {\n if (isEmpty(selectedItems)) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {placeholder}\n </PlaceholderLabel>\n );\n } else {\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"tree\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <NestedDropdownList\n listboxId={internalId}\n listItems={options}\n multiSelect\n selectedKeyPaths={selectedKeyPaths}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n onSelectItem={handleListItemClick}\n onSelectAll={handleSelectAll}\n onRetry={onRetry}\n onSearch={onSearch}\n variant={variant}\n mode={mode}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["InputNestedMultiSelect","placeholder","options","_options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","selectedKeyPaths","_selectedKeyPaths","mode","valueToStringFunction","enableSearch","searchPlaceholder","hideNoResultsDisplay","noResultsDescription","customLabels","readOnly","onSearch","onSelectOptions","onShowOptions","onHideOptions","onRetry","onBlur","optionsLoadState","optionTruncationType","variant","alignment","dropdownZIndex","dropdownWidth","dropdownRootNode","multiSelectedLabel","setSelectedKeyPaths","useState","buildKeyPathToSet","Set","selectedItems","setSelectedItems","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","newKeyPath","getSelectedItems","handleSelectAll","keyPaths","items","map","item","keyPath","label","value","performOnSelectOptions","handleListItemClick","listItem","newSelectedItems","getNewSelection","newKeyPaths","handleNodeFocus","handleNodeBlur","e","current","contains","relatedTarget","getDisplayValue","length","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","triggerOptionDisplayCallback","show","returnValue","checked","filter","selectedItem","ancestorKeyPath","slice","isEqual","nextSelection","hasSubItems","getSelectedSubItems","forEach","addedItem","find","push","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","children","LabelContainer","isEmpty","PlaceholderLabel","truncateType","ValueLabel","renderDropdown","NestedDropdownList","listItems","multiSelect","itemsLoadState","itemTruncationType","onSelectItem","onSelectAll","matchElementWidth","onOpen","onClose","reason","onDismiss","_a","focus","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"w8CA2BO,MAAMA,EAAyB,EAClCC,cAAc,SACdC,QAASC,EACTC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,iBAAkBC,EAClBC,OACAC,wBACAC,eACAC,oBACAC,uBACAC,uBACAC,eACAC,WACAC,WACAC,kBACAC,gBACAC,gBACAC,UACAC,SACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,UAAU,UACVC,YACAC,iBACAC,gB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EAAO,kBACCrB,qBACCC,EAAe,eACnBC,EAAWqG,SA9BrCb,EAACc,EAAc,CAACR,IAAKtD,GAAmB/C,SAAUA,WAhB9C8G,EAAQ1E,IAEJ2D,EAACgB,EAAgB,CAACC,aAAcvF,EAAoBmF,SAC/C/G,IAKLkG,EAACkB,EAAU,CAACD,aAAcvF,EAAoBmF,SACzCnC,GAAcF,cA4EvB2C,eA/Be,IAEfnB,EAACoB,EAAkB,CACfT,UAAWhE,GACX0E,UAAWtH,EACXuH,aAAW,EACX7G,iBAAkBA,EAClB8G,eAAgB9F,EAChB+F,mBAAoB9F,EACpBb,aAAcA,EACdC,kBAAmBA,EACnBC,qBAAsBA,EACtBC,qBAAsBA,EACtBC,aAAcA,EACdwG,aAAc5D,GACd6D,YAAatE,GACb7B,QAASA,EACTJ,SAAUA,EACVQ,QAASA,EACThB,KAAMA,EACNkE,MAAO/C,EACP6F,mBAAiB,IAWrBC,OAvMW,KACfpF,IAAe,GACfwC,IAA6B,GAC7BtC,IAAW,EAAK,EAqMZmF,QAlMaC,IACjBtF,IAAe,GACfwC,IAA6B,GAGd,UAAX8C,IACApF,IAAW,GACXlB,SAAAA,IACJ,EA2LIuG,UAxLc,WACC,QAAnBC,EAAAjF,GAAYsB,eAAO,IAAA2D,GAAAA,EAAEC,QACrBzF,IAAe,GACfwC,IAA6B,EAAM,EAsL/BkD,eAAa,EACbC,OAAQ,EACRvG,UAAWA,EACXwG,oBAAkB,EAClBC,aAAcxG,EACdyG,SAAUvG,GACZ"}
1
+ {"version":3,"file":"input-nested-multi-select.js","sources":["../../src/input-nested-multi-select/input-nested-multi-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport isEmpty from \"lodash/isEmpty\";\nimport isEqual from \"lodash/isEqual\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type {\n NestedDropdownListItemProps,\n NestedDropdownListLocalItem,\n} from \"../shared/dropdown-list\";\nimport {\n buildKeyPathToSet,\n ExpandableElement,\n NestedDropdownList,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { StringHelper, useId } from \"../util\";\nimport type { SelectedItem } from \"./helpers\";\nimport { getSelectedItems, getSelectedSubItems } from \"./helpers\";\nimport type { InputNestedMultiSelectProps } from \"./types\";\n\nexport const InputNestedMultiSelect = <V1, V2, V3>({\n placeholder = \"Select\",\n options: _options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n selectedKeyPaths: _selectedKeyPaths,\n mode,\n valueToStringFunction,\n enableSearch,\n searchPlaceholder,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n readOnly,\n onSearch,\n onSelectOptions,\n onShowOptions,\n onHideOptions,\n onRetry,\n onBlur,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n variant = \"default\",\n alignment,\n dropdownZIndex,\n dropdownWidth,\n dropdownRootNode,\n}: InputNestedMultiSelectProps<V1, V2, V3>): JSX.Element => {\n // =========================================================================\n // CONST, STATE\n // =========================================================================\n const { multiSelectedLabel } = customLabels || {};\n const options = _options as NestedDropdownListItemProps<V1 | V2 | V3>[];\n const [selectedKeyPaths, setSelectedKeyPaths] = useState<Set<string>>(\n _selectedKeyPaths\n ? buildKeyPathToSet(_selectedKeyPaths)\n : new Set<string>()\n );\n const [selectedItems, setSelectedItems] = useState<\n SelectedItem<V1 | V2 | V3>[]\n >([]);\n\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n const newKeyPath = _selectedKeyPaths || [];\n const selectedItems = getSelectedItems(options, newKeyPath);\n\n setSelectedKeyPaths(buildKeyPathToSet(newKeyPath));\n setSelectedItems(selectedItems);\n }, [_selectedKeyPaths, options]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleSelectAll = (\n keyPaths: string[][],\n items: NestedDropdownListLocalItem<V1 | V2 | V3>[]\n ) => {\n const selectedItems = items.map((item) => ({\n keyPath: item.keyPath,\n label: item.item.label,\n value: item.item.value,\n }));\n setSelectedKeyPaths(buildKeyPathToSet(keyPaths));\n setSelectedItems(selectedItems);\n performOnSelectOptions(keyPaths, selectedItems);\n };\n\n const handleListItemClick = (\n listItem: NestedDropdownListLocalItem<V1 | V2 | V3>\n ) => {\n const newSelectedItems: SelectedItem<V1 | V2 | V3>[] =\n getNewSelection(listItem);\n const newKeyPaths = newSelectedItems.map((item) => item.keyPath);\n setSelectedItems(newSelectedItems);\n setSelectedKeyPaths(buildKeyPathToSet(newKeyPaths));\n performOnSelectOptions(newKeyPaths, newSelectedItems);\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =========================================================================\n // HELPER FUNCTION\n // =========================================================================\n const getDisplayValue = (): string => {\n if (selectedItems.length > 1) {\n return multiSelectedLabel || `${selectedItems.length} selected`;\n }\n\n const { label, value } = selectedItems[0];\n if (valueToStringFunction) {\n return valueToStringFunction(value);\n } else {\n return label;\n }\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 6);\n }\n\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show && onHideOptions) {\n onHideOptions();\n }\n\n if (show && onShowOptions) {\n onShowOptions();\n }\n };\n\n const performOnSelectOptions = (\n keyPaths: string[][],\n items: SelectedItem<V1 | V2 | V3>[]\n ) => {\n if (onSelectOptions) {\n const returnValue = items.map((item) => item.value);\n onSelectOptions(keyPaths, returnValue);\n }\n };\n\n const getNewSelection = (\n item: NestedDropdownListLocalItem<V1 | V2 | V3>\n ): SelectedItem<V1 | V2 | V3>[] => {\n if (item.checked === true) {\n // remove item or subitems\n return selectedItems.filter((selectedItem) => {\n const ancestorKeyPath = selectedItem.keyPath.slice(\n 0,\n item.keyPath.length\n );\n return !isEqual(item.keyPath, ancestorKeyPath);\n });\n } else {\n // select item or all subitems\n const nextSelection = [...selectedItems];\n const newItemsToAdd = item.hasSubItems\n ? getSelectedSubItems(options, item.keyPath)\n : [\n {\n value: item.item.value,\n label: item.item.label,\n keyPath: item.keyPath,\n },\n ];\n newItemsToAdd.forEach((addedItem) => {\n if (\n !selectedItems.find((selectedItem) =>\n isEqual(selectedItem.keyPath, addedItem.keyPath)\n )\n ) {\n nextSelection.push(addedItem);\n }\n });\n return nextSelection;\n }\n };\n\n // =========================================================================\n // RENDER FUNCTION\n // =========================================================================\n const renderLabel = () => {\n if (isEmpty(selectedItems)) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {placeholder}\n </PlaceholderLabel>\n );\n } else {\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"tree\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <NestedDropdownList\n listboxId={internalId}\n listItems={options}\n multiSelect\n selectedKeyPaths={selectedKeyPaths}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n onSelectItem={handleListItemClick}\n onSelectAll={handleSelectAll}\n onRetry={onRetry}\n onSearch={onSearch}\n variant={variant}\n mode={mode}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["InputNestedMultiSelect","placeholder","options","_options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","selectedKeyPaths","_selectedKeyPaths","mode","valueToStringFunction","enableSearch","searchPlaceholder","hideNoResultsDisplay","noResultsDescription","customLabels","readOnly","onSearch","onSelectOptions","onShowOptions","onHideOptions","onRetry","onBlur","optionsLoadState","optionTruncationType","variant","alignment","dropdownZIndex","dropdownWidth","dropdownRootNode","multiSelectedLabel","setSelectedKeyPaths","useState","buildKeyPathToSet","Set","selectedItems","setSelectedItems","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","newKeyPath","getSelectedItems","handleSelectAll","keyPaths","items","map","item","keyPath","label","value","performOnSelectOptions","handleListItemClick","listItem","newSelectedItems","getNewSelection","newKeyPaths","handleNodeFocus","handleNodeBlur","e","current","contains","relatedTarget","getDisplayValue","length","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","triggerOptionDisplayCallback","show","returnValue","checked","filter","selectedItem","ancestorKeyPath","slice","isEqual","nextSelection","hasSubItems","getSelectedSubItems","forEach","addedItem","find","push","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","children","LabelContainer","isEmpty","PlaceholderLabel","truncateType","ValueLabel","renderDropdown","NestedDropdownList","listItems","multiSelect","itemsLoadState","itemTruncationType","onSelectItem","onSelectAll","matchElementWidth","onOpen","onClose","reason","onDismiss","_a","focus","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"u8CA2BO,MAAMA,EAAyB,EAClCC,cAAc,SACdC,QAASC,EACTC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,iBAAkBC,EAClBC,OACAC,wBACAC,eACAC,oBACAC,uBACAC,uBACAC,eACAC,WACAC,WACAC,kBACAC,gBACAC,gBACAC,UACAC,SACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,UAAU,UACVC,YACAC,iBAC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QAASA,EAAO,kBACCrB,qBACCC,EAAe,eACnBC,EAAWqG,SA9BrCb,EAACc,EAAc,CAACR,IAAKtD,GAAmB/C,SAAUA,WAhB9C8G,EAAQ1E,IAEJ2D,EAACgB,EAAgB,CAACC,aAAcvF,EAAoBmF,SAC/C/G,IAKLkG,EAACkB,EAAU,CAACD,aAAcvF,EAAoBmF,SACzCnC,GAAcF,cA4EvB2C,eA/Be,IAEfnB,EAACoB,EAAkB,CACfT,UAAWhE,GACX0E,UAAWtH,EACXuH,aAAW,EACX7G,iBAAkBA,EAClB8G,eAAgB9F,EAChB+F,mBAAoB9F,EACpBb,aAAcA,EACdC,kBAAmBA,EACnBC,qBAAsBA,EACtBC,qBAAsBA,EACtBC,aAAcA,EACdwG,aAAc5D,GACd6D,YAAatE,GACb7B,QAASA,EACTJ,SAAUA,EACVQ,QAASA,EACThB,KAAMA,EACNkE,MAAO/C,EACP6F,mBAAiB,IAWrBC,OAvMW,KACfpF,IAAe,GACfwC,IAA6B,GAC7BtC,IAAW,EAAK,EAqMZmF,QAlMaC,IACjBtF,IAAe,GACfwC,IAA6B,GAGd,UAAX8C,IACApF,IAAW,GACXlB,SAAAA,IACJ,EA2LIuG,UAxLc,WACC,QAAnBC,EAAAjF,GAAYsB,eAAO,IAAA2D,GAAAA,EAAEC,QACrBzF,IAAe,GACfwC,IAA6B,EAAM,EAsL/BkD,eAAa,EACbC,OAAQ,EACRvG,UAAWA,EACXwG,oBAAkB,EAClBC,aAAcxG,EACdyG,SAAUvG,GACZ"}
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import r from"../external/lodash/isEmpty.js";import{useState as t,useRef as o,useEffect as n}from"react";import"clsx";import"../theme/theme-provider/index.js";import"../theme/theme-provider/context.js";import"../theme/tokens/border.js";import"../theme/tokens/colour.js";import"../theme/tokens/font.js";import"../theme/tokens/media-query.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import{useId as i}from"../util/simple-id-generator.js";import{StringHelper as d}from"../util/string-helper.js";import"@react-aria/live-announcer";import"../theme/utils/use-media-query.js";import"../shared/dropdown-list/dropdown-label.styles_1dwmd8f.css";import"../shared/dropdown-list/dropdown-list.js";import"../shared/dropdown-list/dropdown-list-state.js";import{ExpandableElement as l}from"../shared/dropdown-list/expandable-element.js";import{NestedDropdownList as s}from"../shared/dropdown-list/nested-dropdown-list.js";import{buildKeyPathToSet as a,findItemByKeyPath as p}from"../shared/dropdown-list/nested-dropdown-list-helpers.js";import{ElementWithDropdown as m}from"../shared/dropdown-wrapper/element-with-dropdown.js";import{LabelContainer as c,PlaceholderLabel as u,ValueLabel as h}from"../shared/dropdown-wrapper/dropdown-wrapper.js";import{InputBox as w}from"../shared/input-wrapper/input-wrapper.js";const b=({placeholder:b="Select",options:y,disabled:f,error:j,className:v,"data-testid":x,id:g,"aria-labelledby":S,"aria-describedby":T,"aria-invalid":O,selectedKeyPath:R,mode:I,valueToStringFunction:k,enableSearch:D,searchPlaceholder:N,selectableCategory:P,hideNoResultsDisplay:C,noResultsDescription:L,customLabels:_,readOnly:A,onBlur:B,onSearch:E,onSelectOption:H,onShowOptions:q,onHideOptions:F,onRetry:K,optionsLoadState:W="success",optionTruncationType:Z="end",variant:G="default",alignment:M,dropdownZIndex:z,dropdownWidth:J,dropdownRootNode:Q})=>{const U=y,[V,X]=t(R?a([R]):new Set),[Y,$]=t(),[ee,re]=t(!1),[te,oe]=t(!1),ne=i(),ie=o(null),de=o(null),le=o(null);n((()=>{X(R?a([R]):new Set);const e=p(U,R||[]);$(null!=e?e:void 0)}),[R,U]);const se=e=>{var r;const{keyPath:t,item:{label:o,value:n}}=e;X(a([t])),$({label:o,value:n}),re(!1),ue(!1),null===(r=de.current)||void 0===r||r.focus(),null==H||H(t,n)},ae=()=>{te||ee||oe(!0)},pe=e=>{te&&!ee&&ie.current&&!ie.current.contains(e.relatedTarget)&&(oe(!1),null==B||B())},me=()=>{if(!Y)return"";const{label:e,value:r}=Y;return k?k(r):e},ce=e=>{if("middle"===Z){let r=0;return le&&le.current&&(r=le.current.getBoundingClientRect().width),d.truncateOneLine(e,r,120,6)}return e},ue=e=>{!e&&F&&F(),e&&q&&q()};return e(m,{enabled:!A&&!f,isOpen:ee,renderElement:()=>e(w,{className:v,"data-testid":x,id:g,ref:ie,tabIndex:-1,onFocus:ae,onBlur:pe,focused:te,disabled:f,readOnly:A,error:j,children:e(l,{ref:de,disabled:f,expanded:ee,listboxId:ne,popupRole:"tree",readOnly:A,variant:G,"aria-labelledby":S,"aria-describedby":T,"aria-invalid":O,children:e(c,{ref:le,disabled:f,children:r(Y)?e(u,{truncateType:Z,children:b}):e(h,{truncateType:Z,children:ce(me())})})})}),renderDropdown:()=>e(s,{listboxId:ne,listItems:U,selectedKeyPaths:V,selectableCategory:P,itemsLoadState:W,itemTruncationType:Z,enableSearch:D,searchPlaceholder:N,hideNoResultsDisplay:C,noResultsDescription:L,customLabels:_,onSelectItem:se,onRetry:K,onSearch:E,variant:G,mode:I,width:J,matchElementWidth:!0}),onOpen:()=>{re(!0),ue(!0),oe(!0)},onClose:e=>{re(!1),ue(!1),"click"!==e&&(oe(!1),null==B||B())},onDismiss:()=>{var e;null===(e=de.current)||void 0===e||e.focus(),re(!1),ue(!1)},clickToToggle:!0,offset:8,alignment:M,fitAvailableHeight:!0,customZIndex:z,rootNode:Q})};export{b as InputNestedSelect};
1
+ import{jsx as e}from"react/jsx-runtime";import r from"../external/lodash/isEmpty.js";import{useState as t,useRef as o,useEffect as n}from"react";import"clsx";import"../theme/theme-provider/index.js";import"../theme/theme-provider/context.js";import"../theme/tokens/border.js";import"../theme/tokens/colour.js";import"../theme/tokens/font.js";import"../theme/tokens/media-query.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import{useId as i}from"../util/simple-id-generator.js";import{StringHelper as l}from"../util/string-helper.js";import"@react-aria/live-announcer";import"../theme/utils/use-media-query.js";import"../shared/dropdown-list/dropdown-label.styles_mloii0.css";import"../shared/dropdown-list/dropdown-list.js";import"../shared/dropdown-list/dropdown-list-state.js";import{ExpandableElement as d}from"../shared/dropdown-list/expandable-element.js";import{NestedDropdownList as s}from"../shared/dropdown-list/nested-dropdown-list.js";import{buildKeyPathToSet as a,findItemByKeyPath as p}from"../shared/dropdown-list/nested-dropdown-list-helpers.js";import{ElementWithDropdown as m}from"../shared/dropdown-wrapper/element-with-dropdown.js";import{LabelContainer as c,PlaceholderLabel as u,ValueLabel as h}from"../shared/dropdown-wrapper/dropdown-wrapper.js";import{InputBox as w}from"../shared/input-wrapper/input-wrapper.js";const b=({placeholder:b="Select",options:y,disabled:f,error:j,className:v,"data-testid":x,id:g,"aria-labelledby":S,"aria-describedby":T,"aria-invalid":O,selectedKeyPath:R,mode:I,valueToStringFunction:k,enableSearch:D,searchPlaceholder:N,selectableCategory:P,hideNoResultsDisplay:C,noResultsDescription:L,customLabels:_,readOnly:A,onBlur:B,onSearch:E,onSelectOption:H,onShowOptions:q,onHideOptions:F,onRetry:K,optionsLoadState:W="success",optionTruncationType:Z="end",variant:G="default",alignment:M,dropdownZIndex:z,dropdownWidth:J,dropdownRootNode:Q})=>{const U=y,[V,X]=t(R?a([R]):new Set),[Y,$]=t(),[ee,re]=t(!1),[te,oe]=t(!1),ne=i(),ie=o(null),le=o(null),de=o(null);n((()=>{X(R?a([R]):new Set);const e=p(U,R||[]);$(null!=e?e:void 0)}),[R,U]);const se=e=>{var r;const{keyPath:t,item:{label:o,value:n}}=e;X(a([t])),$({label:o,value:n}),re(!1),ue(!1),null===(r=le.current)||void 0===r||r.focus(),null==H||H(t,n)},ae=()=>{te||ee||oe(!0)},pe=e=>{te&&!ee&&ie.current&&!ie.current.contains(e.relatedTarget)&&(oe(!1),null==B||B())},me=()=>{if(!Y)return"";const{label:e,value:r}=Y;return k?k(r):e},ce=e=>{if("middle"===Z){let r=0;return de&&de.current&&(r=de.current.getBoundingClientRect().width),l.truncateOneLine(e,r,120,6)}return e},ue=e=>{!e&&F&&F(),e&&q&&q()};return e(m,{enabled:!A&&!f,isOpen:ee,renderElement:()=>e(w,{className:v,"data-testid":x,id:g,ref:ie,tabIndex:-1,onFocus:ae,onBlur:pe,focused:te,disabled:f,readOnly:A,error:j,children:e(d,{ref:le,disabled:f,expanded:ee,listboxId:ne,popupRole:"tree",readOnly:A,variant:G,"aria-labelledby":S,"aria-describedby":T,"aria-invalid":O,children:e(c,{ref:de,disabled:f,children:r(Y)?e(u,{truncateType:Z,children:b}):e(h,{truncateType:Z,children:ce(me())})})})}),renderDropdown:()=>e(s,{listboxId:ne,listItems:U,selectedKeyPaths:V,selectableCategory:P,itemsLoadState:W,itemTruncationType:Z,enableSearch:D,searchPlaceholder:N,hideNoResultsDisplay:C,noResultsDescription:L,customLabels:_,onSelectItem:se,onRetry:K,onSearch:E,variant:G,mode:I,width:J,matchElementWidth:!0}),onOpen:()=>{re(!0),ue(!0),oe(!0)},onClose:e=>{re(!1),ue(!1),"click"!==e&&(oe(!1),null==B||B())},onDismiss:()=>{var e;null===(e=le.current)||void 0===e||e.focus(),re(!1),ue(!1)},clickToToggle:!0,offset:8,alignment:M,fitAvailableHeight:!0,customZIndex:z,rootNode:Q})};export{b as InputNestedSelect};
2
2
  //# sourceMappingURL=input-nested-select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-nested-select.js","sources":["../../src/input-nested-select/input-nested-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport isEmpty from \"lodash/isEmpty\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type {\n NestedDropdownListItemProps,\n NestedDropdownListLocalItem,\n} from \"../shared/dropdown-list\";\nimport {\n buildKeyPathToSet,\n ExpandableElement,\n findItemByKeyPath,\n NestedDropdownList,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { StringHelper, useId } from \"../util\";\nimport type {\n InputNestedSelectProps,\n L1OptionProps,\n L2OptionProps,\n L3OptionProps,\n} from \"./types\";\n\nexport type CombinedOptionProps<V1, V2, V3> =\n | L1OptionProps<V1, V2, V3>\n | L2OptionProps<V2, V3>\n | L3OptionProps<V3>;\n\ninterface SelectedItemType<V1, V2, V3> {\n label: string;\n value: V1 | V2 | V3;\n}\n\nexport const InputNestedSelect = <V1, V2, V3>({\n placeholder = \"Select\",\n options: _options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n selectedKeyPath: _selectedKeyPath,\n mode,\n valueToStringFunction,\n enableSearch,\n searchPlaceholder,\n selectableCategory,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n readOnly,\n onBlur,\n onSearch,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n variant = \"default\",\n alignment,\n dropdownZIndex,\n dropdownWidth,\n dropdownRootNode,\n}: InputNestedSelectProps<V1, V2, V3>): JSX.Element => {\n // =========================================================================\n // CONST, STATE\n // =========================================================================\n const options = _options as NestedDropdownListItemProps<V1 | V2 | V3>[];\n const [selectedKeyPaths, setSelectedKeyPaths] = useState<Set<string>>(\n _selectedKeyPath\n ? buildKeyPathToSet([_selectedKeyPath])\n : new Set<string>()\n );\n const [selectedItem, setSelectedItem] =\n useState<SelectedItemType<V1, V2, V3>>();\n\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n setSelectedKeyPaths(\n _selectedKeyPath\n ? buildKeyPathToSet([_selectedKeyPath])\n : new Set<string>()\n );\n const selectedItem = findItemByKeyPath(options, _selectedKeyPath || []);\n setSelectedItem(selectedItem ?? undefined);\n }, [_selectedKeyPath, options]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleListItemClick = (\n listItem: NestedDropdownListLocalItem<V1 | V2 | V3>\n ) => {\n const {\n keyPath,\n item: { label, value },\n } = listItem;\n setSelectedKeyPaths(buildKeyPathToSet([keyPath]));\n setSelectedItem({ label, value });\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n selectorRef.current?.focus();\n onSelectOption?.(keyPath, value);\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =========================================================================\n // HELPER FUNCTION\n // =========================================================================\n const getDisplayValue = (): string => {\n if (!selectedItem) return \"\";\n const { label, value } = selectedItem;\n\n if (valueToStringFunction) {\n return valueToStringFunction(value);\n } else {\n return label;\n }\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 6);\n }\n\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show && onHideOptions) {\n onHideOptions();\n }\n\n if (show && onShowOptions) {\n onShowOptions();\n }\n };\n\n // =========================================================================\n // RENDER FUNCTION\n // =========================================================================\n const renderLabel = () => {\n if (isEmpty(selectedItem)) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {placeholder}\n </PlaceholderLabel>\n );\n } else {\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"tree\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <NestedDropdownList\n listboxId={internalId}\n listItems={options}\n selectedKeyPaths={selectedKeyPaths}\n selectableCategory={selectableCategory}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n onSelectItem={handleListItemClick}\n onRetry={onRetry}\n onSearch={onSearch}\n variant={variant}\n mode={mode}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["InputNestedSelect","placeholder","options","_options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","selectedKeyPath","_selectedKeyPath","mode","valueToStringFunction","enableSearch","searchPlaceholder","selectableCategory","hideNoResultsDisplay","noResultsDescription","customLabels","readOnly","onBlur","onSearch","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","variant","alignment","dropdownZIndex","dropdownWidth","dropdownRootNode","selectedKeyPaths","setSelectedKeyPaths","useState","buildKeyPathToSet","Set","selectedItem","setSelectedItem","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","findItemByKeyPath","undefined","handleListItemClick","listItem","keyPath","item","label","value","triggerOptionDisplayCallback","_a","current","focus","handleNodeFocus","handleNodeBlur","e","contains","relatedTarget","getDisplayValue","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","show","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","children","LabelContainer","isEmpty","PlaceholderLabel","truncateType","ValueLabel","renderDropdown","NestedDropdownList","listItems","itemsLoadState","itemTruncationType","onSelectItem","matchElementWidth","onOpen","onClose","reason","onDismiss","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"+2CAwCaA,EAAoB,EAC7BC,cAAc,SACdC,QAASC,EACTC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,gBAAiBC,EACjBC,OACAC,wBACAC,eACAC,oBACAC,qBACAC,uBACAC,uBACAC,eACAC,WACAC,SACAC,WACAC,iBACAC,gBACAC,gBACAC,UACAC,mBAAmB,UACnB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,GAAAA,EAAEE,QACrBrB,IAAe,GACfkB,IAA6B,EAAM,EAoI/B+C,eAAa,EACbC,OAAQ,EACR9E,UAAWA,EACX+E,oBAAkB,EAClBC,aAAc/E,EACdgF,SAAU9E,GACZ"}
1
+ {"version":3,"file":"input-nested-select.js","sources":["../../src/input-nested-select/input-nested-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport isEmpty from \"lodash/isEmpty\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type {\n NestedDropdownListItemProps,\n NestedDropdownListLocalItem,\n} from \"../shared/dropdown-list\";\nimport {\n buildKeyPathToSet,\n ExpandableElement,\n findItemByKeyPath,\n NestedDropdownList,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { StringHelper, useId } from \"../util\";\nimport type {\n InputNestedSelectProps,\n L1OptionProps,\n L2OptionProps,\n L3OptionProps,\n} from \"./types\";\n\nexport type CombinedOptionProps<V1, V2, V3> =\n | L1OptionProps<V1, V2, V3>\n | L2OptionProps<V2, V3>\n | L3OptionProps<V3>;\n\ninterface SelectedItemType<V1, V2, V3> {\n label: string;\n value: V1 | V2 | V3;\n}\n\nexport const InputNestedSelect = <V1, V2, V3>({\n placeholder = \"Select\",\n options: _options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n selectedKeyPath: _selectedKeyPath,\n mode,\n valueToStringFunction,\n enableSearch,\n searchPlaceholder,\n selectableCategory,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n readOnly,\n onBlur,\n onSearch,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n variant = \"default\",\n alignment,\n dropdownZIndex,\n dropdownWidth,\n dropdownRootNode,\n}: InputNestedSelectProps<V1, V2, V3>): JSX.Element => {\n // =========================================================================\n // CONST, STATE\n // =========================================================================\n const options = _options as NestedDropdownListItemProps<V1 | V2 | V3>[];\n const [selectedKeyPaths, setSelectedKeyPaths] = useState<Set<string>>(\n _selectedKeyPath\n ? buildKeyPathToSet([_selectedKeyPath])\n : new Set<string>()\n );\n const [selectedItem, setSelectedItem] =\n useState<SelectedItemType<V1, V2, V3>>();\n\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n setSelectedKeyPaths(\n _selectedKeyPath\n ? buildKeyPathToSet([_selectedKeyPath])\n : new Set<string>()\n );\n const selectedItem = findItemByKeyPath(options, _selectedKeyPath || []);\n setSelectedItem(selectedItem ?? undefined);\n }, [_selectedKeyPath, options]);\n\n // =========================================================================\n // EVENT HANDLERS\n // =========================================================================\n const handleListItemClick = (\n listItem: NestedDropdownListLocalItem<V1 | V2 | V3>\n ) => {\n const {\n keyPath,\n item: { label, value },\n } = listItem;\n setSelectedKeyPaths(buildKeyPathToSet([keyPath]));\n setSelectedItem({ label, value });\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n selectorRef.current?.focus();\n onSelectOption?.(keyPath, value);\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =========================================================================\n // HELPER FUNCTION\n // =========================================================================\n const getDisplayValue = (): string => {\n if (!selectedItem) return \"\";\n const { label, value } = selectedItem;\n\n if (valueToStringFunction) {\n return valueToStringFunction(value);\n } else {\n return label;\n }\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 6);\n }\n\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show && onHideOptions) {\n onHideOptions();\n }\n\n if (show && onShowOptions) {\n onShowOptions();\n }\n };\n\n // =========================================================================\n // RENDER FUNCTION\n // =========================================================================\n const renderLabel = () => {\n if (isEmpty(selectedItem)) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {placeholder}\n </PlaceholderLabel>\n );\n } else {\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"tree\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <NestedDropdownList\n listboxId={internalId}\n listItems={options}\n selectedKeyPaths={selectedKeyPaths}\n selectableCategory={selectableCategory}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n onSelectItem={handleListItemClick}\n onRetry={onRetry}\n onSearch={onSearch}\n variant={variant}\n mode={mode}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n );\n};\n"],"names":["InputNestedSelect","placeholder","options","_options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","selectedKeyPath","_selectedKeyPath","mode","valueToStringFunction","enableSearch","searchPlaceholder","selectableCategory","hideNoResultsDisplay","noResultsDescription","customLabels","readOnly","onBlur","onSearch","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","variant","alignment","dropdownZIndex","dropdownWidth","dropdownRootNode","selectedKeyPaths","setSelectedKeyPaths","useState","buildKeyPathToSet","Set","selectedItem","setSelectedItem","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","findItemByKeyPath","undefined","handleListItemClick","listItem","keyPath","item","label","value","triggerOptionDisplayCallback","_a","current","focus","handleNodeFocus","handleNodeBlur","e","contains","relatedTarget","getDisplayValue","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","show","_jsx","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","children","LabelContainer","isEmpty","PlaceholderLabel","truncateType","ValueLabel","renderDropdown","NestedDropdownList","listItems","itemsLoadState","itemTruncationType","onSelectItem","matchElementWidth","onOpen","onClose","reason","onDismiss","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"82CAwCaA,EAAoB,EAC7BC,cAAc,SACdC,QAASC,EACTC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,gBAAiBC,EACjBC,OACAC,wBACAC,eACAC,oBACAC,qBACAC,uBACAC,uBACAC,eACAC,WACAC,SACAC,WACAC,iBACAC,gBACAC,gBACAC,UACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,UAAU,UACVC,YACAC,iBACAC,gBACAC,uBAKA,MAAMjC,EAAUC,GACTiC,EAAkBC,GAAuBC,EAC5CzB,EACM0B,EAAkB,CAAC1B,IACnB,IAAI2B,MAEPC,EAAcC,GACjBJ,KAEGK,GAAaC,IAAkBN,GAAkB,IACjDO,GAASC,IAAcR,GAAkB,GAC1CS,GAAaC,IAEbC,GAAUC,EAAuB,MACjCC,GAAcD,EAA0B,MACxCE,GAAoBF,EAAuB,MAKjDG,GAAU,KACNhB,EACIxB,EACM0B,EAAkB,CAAC1B,IACnB,IAAI2B,KAEd,MAAMC,EAAea,EAAkBpD,EAASW,GAAoB,IACpE6B,EAAgBD,QAAAA,OAAgBc,EAAU,GAC3C,CAAC1C,EAAkBX,IAKtB,MAAMsD,GACFC,UAEA,MAAMC,QACFA,EACAC,MAAMC,MAAEA,EAAKC,MAAEA,IACfJ,EACJpB,EAAoBE,EAAkB,CAACmB,KACvChB,EAAgB,CAAEkB,QAAOC,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,SAC/C3F,IAKL8E,EAACkB,EAAU,CAACD,aAAclE,EAAoB8D,SACzCpB,GAAcD,cA2EvB2B,eA9Be,IAEfnB,EAACoB,EAAkB,CACfT,UAAW3C,GACXqD,UAAWlG,EACXkC,iBAAkBA,EAClBlB,mBAAoBA,EACpBmF,eAAgBxE,EAChByE,mBAAoBxE,EACpBd,aAAcA,EACdC,kBAAmBA,EACnBE,qBAAsBA,EACtBC,qBAAsBA,EACtBC,aAAcA,EACdkF,aAAc/C,GACd5B,QAASA,EACTJ,SAAUA,EACVO,QAASA,EACTjB,KAAMA,EACN6D,MAAOzC,EACPsE,mBAAiB,IAWrBC,OArJW,KACf7D,IAAe,GACfkB,IAA6B,GAC7BhB,IAAW,EAAK,EAmJZ4D,QAhJaC,IACjB/D,IAAe,GACfkB,IAA6B,GAGd,UAAX6C,IACA7D,IAAW,GACXvB,SAAAA,IACJ,EAyIIqF,UAtIc,WACC,QAAnB7C,EAAAZ,GAAYa,eAAO,IAAAD,GAAAA,EAAEE,QACrBrB,IAAe,GACfkB,IAA6B,EAAM,EAoI/B+C,eAAa,EACbC,OAAQ,EACR9E,UAAWA,EACX+E,oBAAkB,EAClBC,aAAc/E,EACdgF,SAAU9E,GACZ"}
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"../_virtual/_tslib.js";import{jsx as r,jsxs as o}from"react/jsx-runtime";import t from"clsx";import{useState as n,useRef as i,useEffect as s,useMemo as l}from"react";import{VisuallyHidden as a,concatIds as d}from"../shared/accessibility/index.js";import"../theme/theme-provider/index.js";import"../theme/theme-provider/context.js";import"../theme/tokens/border.js";import"../theme/tokens/colour.js";import"../theme/tokens/font.js";import"../theme/tokens/media-query.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import{useId as c}from"../util/simple-id-generator.js";import{StringHelper as p}from"../util/string-helper.js";import"@react-aria/live-announcer";import"../theme/utils/use-media-query.js";import"../shared/dropdown-list/dropdown-label.styles_1dwmd8f.css";import{DropdownList as m}from"../shared/dropdown-list/dropdown-list.js";import{DropdownListState as u}from"../shared/dropdown-list/dropdown-list-state.js";import"../shared/dropdown-list/expandable-element.js";import"@lifesg/react-icons/caret-right";import"@lifesg/react-icons/exclamation-circle-fill";import"@lifesg/react-icons/minus-square-fill";import"@lifesg/react-icons/square";import"@lifesg/react-icons/square-tick-fill";import"@lifesg/react-icons/tick";import"react-virtuoso";import"../markup/markup.js";import"../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css";import{ElementWithDropdown as h}from"../shared/dropdown-wrapper/element-with-dropdown.js";import{InputWrapper as f,ClearButton as v}from"../shared/input-wrapper/input-wrapper.js";import"../shared/dropdown-list/dropdown-list.styles_1kt4zhf.css";import"../shared/dropdown-list/dropdown-search.js";import"../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css";import"immer";import"../external/lodash/_getTag.js";import"../external/lodash/isArguments.js";import"../external/lodash/_baseGetTag.js";import"../external/lodash/isBuffer.js";import"../external/lodash/isTypedArray.js";import"../external/lodash/_Stack.js";import"../external/lodash/_SetCache.js";import"../external/lodash/_equalByTag.js";import"../shared/dropdown-list/virtuoso-components.js";import{PlaceholderLabel as w,ValueLabel as b}from"../shared/dropdown-wrapper/dropdown-wrapper.js";import{clearButtonContainer as y}from"../shared/input-wrapper/input-wrapper.styles.js";import{RangeInputInnerContainer as g}from"../shared/range-input-inner-container/range-input-inner-container.js";import{styledInputWrapper as j,rangeSelectorButton as x}from"./input-range-select.styles.js";const S=S=>{var{selectedOptions:T,placeholders:_={from:"Select",to:"Select"},options:C,disabled:O,className:A,readOnly:I,error:k,"data-testid":E,id:P,enableSearch:D=!1,searchFunction:L,searchPlaceholder:N,valueExtractor:q,valueToStringFunction:H,listExtractor:F,displayValueExtractor:R,onSelectOption:$,onShowOptions:G,onHideOptions:M,onRetry:B,optionsLoadState:W={from:"success",to:"success"},optionTruncationType:Z="middle",renderCustomSelectedOption:V,renderListItem:z,renderCustomCallToAction:K,alignment:J,dropdownZIndex:Q,dropdownRootNode:U,dropdownWidth:X,"aria-labelledby":Y,"aria-describedby":ee}=S,re=e(S,["selectedOptions","placeholders","options","disabled","className","readOnly","error","data-testid","id","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","renderCustomCallToAction","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","aria-labelledby","aria-describedby"]);const[oe,te]=n(),[ne,ie]=n(),[se,le]=n("none"),ae="none"!==se,de={from:i(null),to:i(null)},ce=i(null),pe=c(),me=`${pe}-range-listbox`,ue=`${pe}-from-label`,he=`${pe}-to-label`;s((()=>{te(null==T?void 0:T.from),ie(null==T?void 0:T.to)}),[T]),s((()=>{var e;ae&&"to"===se&&(null===(e=ce.current)||void 0===e||e.refocus({index:0}))}),[ae,se]);const fe=e=>{e||null==M||M(),e&&(null==G||G())},ve=e=>{var r,o;const t="from"===e?oe:ne;if(!t)return"";if(R)return R(t);if(q){const e=q(t);return H?H(e):null!==(o=null===(r=null==e?void 0:e.toString)||void 0===r?void 0:r.call(e))&&void 0!==o?o:""}return t.toString()},we=(e,r)=>{var o;if("middle"===Z){let t=0;return(null===(o=de[e])||void 0===o?void 0:o.current)&&(t=de[e].current.getBoundingClientRect().width),p.truncateOneLine(r,t,120,8)}return r},be=()=>{switch(se){case"from":return"start";case"to":return"end";case"none":return se}},ye=l((()=>{var e;return"none"===se?[]:null!==(e=null==C?void 0:C[se])&&void 0!==e?e:[]}),[se,C]),ge=l((()=>{if("none"===se)return[];const e="from"===se?oe:ne;return e?[e]:[]}),[se,oe,ne]),je=e=>{if(O||I)return;le("to"!==e||oe?e:"from"),fe(!0)},xe=e=>{var r;null===(r=de[e].current)||void 0===r||r.focus()},Se=e=>d("from"===e?ue:he,Y),Te=e=>r=>{r.stopPropagation(),r.preventDefault(),je(e)},_e=e=>r=>{if(!O&&!I)switch(r.key){case"Enter":case" ":case"ArrowDown":r.preventDefault(),je(e)}},Ce=(e,r)=>{if("none"!==se){if("from"===se)return te(e),null==$||$({from:e},r),ie(void 0),le("to"),fe(!0),void xe("to");ie(e),null==$||$({to:e},r),le("none"),fe(!1),xe("to")}},Oe=()=>{const e=se;le("none"),fe(!1),xe("to"===e?"to":"from"),oe&&ne||(te(void 0),ie(void 0))},Ae=e=>{e.stopPropagation(),e.preventDefault(),te(void 0),ie(void 0),null==$||$({from:void 0,to:void 0},void 0),xe("from")},Ie=e=>{const o="from"===e?oe:ne;return o?V?V(o):r(b,{truncateType:Z,children:we(e,ve(e))}):r(w,{truncateType:Z,children:we(e,(null==_?void 0:_[e])||"")})},ke=e=>r("button",{type:"button",role:"combobox","aria-labelledby":Se(e),"aria-describedby":ee,"aria-expanded":ae&&se===e,"aria-controls":me,"aria-disabled":O,"aria-readonly":I,onClick:Te(e),onKeyDown:_e(e),ref:de[e],tabIndex:0,className:x,children:Ie(e)});return r("div",Object.assign({id:P},re,{children:r(u,{children:r(h,{enabled:!I&&!O,isOpen:ae,renderElement:()=>o(f,{className:t(j,A),"data-testid":E,disabled:O,readOnly:I,error:k,focused:ae,children:[r(a,{id:ue,children:(null==_?void 0:_.from)||"Select From"}),r(a,{id:he,children:(null==_?void 0:_.to)||"Select To"}),o(g,{currentActive:be(),error:k,children:[ke("from"),ke("to")]}),!ae&&oe&&ne&&!I&&!O&&r("div",{className:y,children:r(v,{onClick:Ae,type:"button","aria-label":"Clear"})})]}),renderDropdown:()=>r(m,{ref:ce,"data-testid":`${E}-dropdown`,listboxId:me,ariaLabel:"from"===se?`Selecting for: ${null==_?void 0:_.from}`:"to"===se?`Selecting for: ${null==_?void 0:_.to}`:void 0,listItems:ye,onSelectItem:Ce,onDismiss:Oe,valueExtractor:q,listExtractor:F,selectedItems:ge,itemsLoadState:W[se],itemTruncationType:Z,onRetry:B,width:X,matchElementWidth:!X,enableSearch:D,searchFunction:L,searchPlaceholder:N,renderListItem:z,renderCustomCallToAction:K}),onOpen:()=>{O||I||"none"===se&&(le("from"),fe(!0))},onClose:()=>{le("none"),fe(!1),oe&&ne||(te(void 0),ie(void 0))},onDismiss:Oe,clickToToggle:!1,offset:8,alignment:J,fitAvailableHeight:!0,customZIndex:Q,rootNode:U})})}))};export{S as InputRangeSelect};
1
+ import{__rest as e}from"../_virtual/_tslib.js";import{jsx as o,jsxs as r}from"react/jsx-runtime";import t from"clsx";import{useState as n,useRef as i,useEffect as s,useMemo as l}from"react";import{VisuallyHidden as a,concatIds as d}from"../shared/accessibility/index.js";import"../theme/theme-provider/index.js";import"../theme/theme-provider/context.js";import"../theme/tokens/border.js";import"../theme/tokens/colour.js";import"../theme/tokens/font.js";import"../theme/tokens/media-query.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import{useId as c}from"../util/simple-id-generator.js";import{StringHelper as p}from"../util/string-helper.js";import"@react-aria/live-announcer";import"../theme/utils/use-media-query.js";import"../shared/dropdown-list/dropdown-label.styles_mloii0.css";import{DropdownList as m}from"../shared/dropdown-list/dropdown-list.js";import{DropdownListState as u}from"../shared/dropdown-list/dropdown-list-state.js";import"../shared/dropdown-list/expandable-element.js";import"@lifesg/react-icons/caret-right";import"@lifesg/react-icons/exclamation-circle-fill";import"@lifesg/react-icons/minus-square-fill";import"@lifesg/react-icons/square";import"@lifesg/react-icons/square-tick-fill";import"@lifesg/react-icons/tick";import"react-virtuoso";import"../markup/markup.js";import"../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css";import{ElementWithDropdown as h}from"../shared/dropdown-wrapper/element-with-dropdown.js";import{InputWrapper as f,ClearButton as v}from"../shared/input-wrapper/input-wrapper.js";import"../shared/dropdown-list/dropdown-list.styles_konwm.css";import"../shared/dropdown-list/dropdown-search.js";import"../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css";import"immer";import"../external/lodash/_getTag.js";import"../external/lodash/isArguments.js";import"../external/lodash/_baseGetTag.js";import"../external/lodash/isBuffer.js";import"../external/lodash/isTypedArray.js";import"../external/lodash/_Stack.js";import"../external/lodash/_SetCache.js";import"../external/lodash/_equalByTag.js";import"../shared/dropdown-list/virtuoso-components.js";import{PlaceholderLabel as w,ValueLabel as b}from"../shared/dropdown-wrapper/dropdown-wrapper.js";import{clearButtonContainer as y}from"../shared/input-wrapper/input-wrapper.styles.js";import{RangeInputInnerContainer as g}from"../shared/range-input-inner-container/range-input-inner-container.js";import{styledInputWrapper as j,rangeSelectorButton as x}from"./input-range-select.styles.js";const S=S=>{var{selectedOptions:T,placeholders:_={from:"Select",to:"Select"},options:C,disabled:O,className:A,readOnly:I,error:k,"data-testid":E,id:P,enableSearch:D=!1,searchFunction:L,searchPlaceholder:N,valueExtractor:q,valueToStringFunction:H,listExtractor:F,displayValueExtractor:R,onSelectOption:$,onShowOptions:G,onHideOptions:M,onRetry:B,optionsLoadState:W={from:"success",to:"success"},optionTruncationType:Z="middle",renderCustomSelectedOption:V,renderListItem:K,renderCustomCallToAction:z,alignment:J,dropdownZIndex:Q,dropdownRootNode:U,dropdownWidth:X,"aria-labelledby":Y,"aria-describedby":ee}=S,oe=e(S,["selectedOptions","placeholders","options","disabled","className","readOnly","error","data-testid","id","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","renderCustomCallToAction","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","aria-labelledby","aria-describedby"]);const[re,te]=n(),[ne,ie]=n(),[se,le]=n("none"),ae="none"!==se,de={from:i(null),to:i(null)},ce=i(null),pe=c(),me=`${pe}-range-listbox`,ue=`${pe}-from-label`,he=`${pe}-to-label`;s((()=>{te(null==T?void 0:T.from),ie(null==T?void 0:T.to)}),[T]),s((()=>{var e;ae&&"to"===se&&(null===(e=ce.current)||void 0===e||e.refocus({index:0}))}),[ae,se]);const fe=e=>{e||null==M||M(),e&&(null==G||G())},ve=e=>{var o,r;const t="from"===e?re:ne;if(!t)return"";if(R)return R(t);if(q){const e=q(t);return H?H(e):null!==(r=null===(o=null==e?void 0:e.toString)||void 0===o?void 0:o.call(e))&&void 0!==r?r:""}return t.toString()},we=(e,o)=>{var r;if("middle"===Z){let t=0;return(null===(r=de[e])||void 0===r?void 0:r.current)&&(t=de[e].current.getBoundingClientRect().width),p.truncateOneLine(o,t,120,8)}return o},be=()=>{switch(se){case"from":return"start";case"to":return"end";case"none":return se}},ye=l((()=>{var e;return"none"===se?[]:null!==(e=null==C?void 0:C[se])&&void 0!==e?e:[]}),[se,C]),ge=l((()=>{if("none"===se)return[];const e="from"===se?re:ne;return e?[e]:[]}),[se,re,ne]),je=e=>{if(O||I)return;le("to"!==e||re?e:"from"),fe(!0)},xe=e=>{var o;null===(o=de[e].current)||void 0===o||o.focus()},Se=e=>d("from"===e?ue:he,Y),Te=e=>o=>{o.stopPropagation(),o.preventDefault(),je(e)},_e=e=>o=>{if(!O&&!I)switch(o.key){case"Enter":case" ":case"ArrowDown":o.preventDefault(),je(e)}},Ce=(e,o)=>{if("none"!==se){if("from"===se)return te(e),null==$||$({from:e},o),ie(void 0),le("to"),fe(!0),void xe("to");ie(e),null==$||$({to:e},o),le("none"),fe(!1),xe("to")}},Oe=()=>{const e=se;le("none"),fe(!1),xe("to"===e?"to":"from"),re&&ne||(te(void 0),ie(void 0))},Ae=e=>{e.stopPropagation(),e.preventDefault(),te(void 0),ie(void 0),null==$||$({from:void 0,to:void 0},void 0),xe("from")},Ie=e=>{const r="from"===e?re:ne;return r?V?V(r):o(b,{truncateType:Z,children:we(e,ve(e))}):o(w,{truncateType:Z,children:we(e,(null==_?void 0:_[e])||"")})},ke=e=>o("button",{type:"button",role:"combobox","aria-labelledby":Se(e),"aria-describedby":ee,"aria-expanded":ae&&se===e,"aria-controls":me,"aria-disabled":O,"aria-readonly":I,onClick:Te(e),onKeyDown:_e(e),ref:de[e],tabIndex:0,className:x,children:Ie(e)});return o("div",Object.assign({id:P},oe,{children:o(u,{children:o(h,{enabled:!I&&!O,isOpen:ae,renderElement:()=>r(f,{className:t(j,A),"data-testid":E,disabled:O,readOnly:I,error:k,focused:ae,children:[o(a,{id:ue,children:(null==_?void 0:_.from)||"Select From"}),o(a,{id:he,children:(null==_?void 0:_.to)||"Select To"}),r(g,{currentActive:be(),error:k,children:[ke("from"),ke("to")]}),!ae&&re&&ne&&!I&&!O&&o("div",{className:y,children:o(v,{onClick:Ae,type:"button","aria-label":"Clear"})})]}),renderDropdown:()=>o(m,{ref:ce,"data-testid":`${E}-dropdown`,listboxId:me,ariaLabel:"from"===se?`Selecting for: ${null==_?void 0:_.from}`:"to"===se?`Selecting for: ${null==_?void 0:_.to}`:void 0,listItems:ye,onSelectItem:Ce,onDismiss:Oe,valueExtractor:q,listExtractor:F,selectedItems:ge,itemsLoadState:W[se],itemTruncationType:Z,onRetry:B,width:X,matchElementWidth:!X,enableSearch:D,searchFunction:L,searchPlaceholder:N,renderListItem:K,renderCustomCallToAction:z}),onOpen:()=>{O||I||"none"===se&&(le("from"),fe(!0))},onClose:()=>{le("none"),fe(!1),re&&ne||(te(void 0),ie(void 0))},onDismiss:Oe,clickToToggle:!1,offset:8,alignment:J,fitAvailableHeight:!0,customZIndex:Q,rootNode:U})})}))};export{S as InputRangeSelect};
2
2
  //# sourceMappingURL=input-range-select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-range-select.js","sources":["../../src/input-range-select/input-range-select.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type React from \"react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { concatIds, VisuallyHidden } from \"../shared/accessibility\";\nimport type { DropdownListApi } from \"../shared/dropdown-list\";\nimport { DropdownList, DropdownListState } from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { ClearButton, InputWrapper } from \"../shared/input-wrapper\";\nimport * as inputWrapperStyles from \"../shared/input-wrapper/input-wrapper.styles\";\nimport { RangeInputInnerContainer } from \"../shared/range-input-inner-container\";\nimport { useId } from \"../util\";\nimport { StringHelper } from \"../util/string-helper\";\nimport * as styles from \"./input-range-select.styles\";\nimport type { InputRangeSelectProps } from \"./types\";\n\ntype RangeType = \"from\" | \"to\";\n\nexport const InputRangeSelect = <T, V>({\n selectedOptions,\n placeholders = { from: \"Select\", to: \"Select\" },\n options,\n disabled,\n className,\n readOnly,\n error,\n \"data-testid\": testId,\n id,\n enableSearch = false,\n searchFunction,\n searchPlaceholder,\n valueExtractor,\n valueToStringFunction,\n listExtractor,\n displayValueExtractor,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = { from: \"success\", to: \"success\" },\n optionTruncationType = \"middle\",\n renderCustomSelectedOption,\n renderListItem,\n renderCustomCallToAction,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n dropdownWidth,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n}: InputRangeSelectProps<T, V>): JSX.Element => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [selectedFromValue, setSelectedFromValue] = useState<T | undefined>();\n const [selectedToValue, setSelectedToValue] = useState<T | undefined>();\n const [focusedInput, setFocusedInput] = useState<RangeType | \"none\">(\n \"none\"\n );\n const isOpen = focusedInput !== \"none\";\n\n const labelButtonRef = {\n from: useRef<HTMLButtonElement>(null),\n to: useRef<HTMLButtonElement>(null),\n };\n const dropdownRef = useRef<DropdownListApi>(null);\n\n const internalId = useId();\n const listboxId = `${internalId}-range-listbox`;\n const fromLabelId = `${internalId}-from-label`;\n const toLabelId = `${internalId}-to-label`;\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setSelectedFromValue(selectedOptions?.from);\n setSelectedToValue(selectedOptions?.to);\n }, [selectedOptions]);\n\n useEffect(() => {\n if (!isOpen) return;\n\n if (focusedInput === \"to\") {\n dropdownRef.current?.refocus({ index: 0 });\n }\n }, [isOpen, focusedInput]);\n\n // =============================================================================\n // HELPERS\n // =============================================================================\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show) onHideOptions?.();\n if (show) onShowOptions?.();\n };\n\n const getDisplayValue = (rangeType: RangeType): string => {\n const selected =\n rangeType === \"from\" ? selectedFromValue : selectedToValue;\n if (!selected) return \"\";\n\n if (displayValueExtractor) return displayValueExtractor(selected);\n\n if (valueExtractor) {\n const value = valueExtractor(selected);\n return valueToStringFunction\n ? valueToStringFunction(value)\n : value?.toString?.() ?? \"\";\n }\n\n return selected.toString();\n };\n\n const truncateValue = (type: RangeType, value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelButtonRef[type]?.current) {\n widthOfElement =\n labelButtonRef[type].current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 8);\n }\n return value;\n };\n\n const getCurrentFocused = (): \"none\" | \"start\" | \"end\" => {\n switch (focusedInput) {\n case \"from\":\n return \"start\";\n case \"to\":\n return \"end\";\n case \"none\":\n return focusedInput;\n }\n };\n\n const currentOptions = useMemo(() => {\n if (focusedInput === \"none\") return [];\n return options?.[focusedInput] ?? [];\n }, [focusedInput, options]);\n\n const currentSelectedItems = useMemo(() => {\n if (focusedInput === \"none\") return [];\n const selected =\n focusedInput === \"from\" ? selectedFromValue : selectedToValue;\n return selected ? [selected] : [];\n }, [focusedInput, selectedFromValue, selectedToValue]);\n\n const openDropdownFor = (rangeType: RangeType) => {\n if (disabled || readOnly) return;\n\n const nextFocusedInput =\n rangeType === \"to\" && !selectedFromValue ? \"from\" : rangeType;\n\n setFocusedInput(nextFocusedInput);\n triggerOptionDisplayCallback(true);\n };\n\n const focusButton = (type: RangeType) => {\n labelButtonRef[type].current?.focus();\n };\n\n const getButtonLabelledBy = (rangeType: RangeType) => {\n const rangeLabelId = rangeType === \"from\" ? fromLabelId : toLabelId;\n return concatIds(rangeLabelId, ariaLabelledBy);\n };\n\n const getDropdownAriaLabel = () => {\n if (focusedInput === \"from\") {\n return `Selecting for: ${placeholders?.from}`;\n }\n\n if (focusedInput === \"to\") {\n return `Selecting for: ${placeholders?.to}`;\n }\n\n return undefined;\n };\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleSelectorClick =\n (rangeType: RangeType) => (event: React.MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n openDropdownFor(rangeType);\n };\n\n const handleSelectorKeyDown =\n (rangeType: RangeType) =>\n (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) return;\n\n switch (event.key) {\n case \"Enter\":\n case \" \":\n case \"ArrowDown\":\n event.preventDefault();\n openDropdownFor(rangeType);\n break;\n default:\n break;\n }\n };\n\n const handleListItemClick = (item: T, extractedValue: V) => {\n if (focusedInput === \"none\") return;\n\n if (focusedInput === \"from\") {\n setSelectedFromValue(item);\n onSelectOption?.({ from: item }, extractedValue);\n\n setSelectedToValue(undefined);\n setFocusedInput(\"to\");\n triggerOptionDisplayCallback(true);\n focusButton(\"to\");\n return;\n }\n\n setSelectedToValue(item);\n onSelectOption?.({ to: item }, extractedValue);\n\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n focusButton(\"to\");\n };\n\n const handleDismiss = () => {\n const last = focusedInput;\n\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n\n if (last === \"to\") focusButton(\"to\");\n else focusButton(\"from\");\n\n if (!selectedFromValue || !selectedToValue) {\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n }\n };\n\n const handleClose = () => {\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n\n if (!selectedFromValue || !selectedToValue) {\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n }\n };\n\n const handleOpen = () => {\n if (disabled || readOnly) return;\n\n if (focusedInput === \"none\") {\n setFocusedInput(\"from\");\n triggerOptionDisplayCallback(true);\n }\n };\n\n const handleClear = (event: React.MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n onSelectOption?.({ from: undefined, to: undefined }, undefined);\n\n focusButton(\"from\");\n };\n\n // =============================================================================\n // RENDER\n // =============================================================================\n const renderLabel = (rangeType: RangeType) => {\n const selected =\n rangeType === \"from\" ? selectedFromValue : selectedToValue;\n\n if (!selected) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {truncateValue(rangeType, placeholders?.[rangeType] || \"\")}\n </PlaceholderLabel>\n );\n }\n\n if (renderCustomSelectedOption) {\n return renderCustomSelectedOption(selected);\n }\n\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(rangeType, getDisplayValue(rangeType))}\n </ValueLabel>\n );\n };\n\n const renderSelectorContent = (rangeType: RangeType) => (\n <button\n type=\"button\"\n role=\"combobox\"\n aria-labelledby={getButtonLabelledBy(rangeType)}\n aria-describedby={ariaDescribedBy}\n aria-expanded={isOpen && focusedInput === rangeType}\n aria-controls={listboxId}\n aria-disabled={disabled}\n aria-readonly={readOnly}\n onClick={handleSelectorClick(rangeType)}\n onKeyDown={handleSelectorKeyDown(rangeType)}\n ref={labelButtonRef[rangeType]}\n tabIndex={0}\n className={styles.rangeSelectorButton}\n >\n {renderLabel(rangeType)}\n </button>\n );\n\n const renderElement = () => {\n return (\n <InputWrapper\n className={clsx(styles.styledInputWrapper, className)}\n data-testid={testId}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n focused={isOpen}\n >\n <VisuallyHidden id={fromLabelId}>\n {placeholders?.from || \"Select From\"}\n </VisuallyHidden>\n <VisuallyHidden id={toLabelId}>\n {placeholders?.to || \"Select To\"}\n </VisuallyHidden>\n\n <RangeInputInnerContainer\n currentActive={getCurrentFocused()}\n error={error}\n >\n {renderSelectorContent(\"from\")}\n {renderSelectorContent(\"to\")}\n </RangeInputInnerContainer>\n\n {!isOpen &&\n selectedFromValue &&\n selectedToValue &&\n !readOnly &&\n !disabled && (\n <div\n className={inputWrapperStyles.clearButtonContainer}\n >\n <ClearButton\n onClick={handleClear}\n type=\"button\"\n aria-label=\"Clear\"\n />\n </div>\n )}\n </InputWrapper>\n );\n };\n\n const renderDropdown = () => {\n return (\n <DropdownList\n ref={dropdownRef}\n data-testid={`${testId}-dropdown`}\n listboxId={listboxId}\n ariaLabel={getDropdownAriaLabel()}\n listItems={currentOptions}\n onSelectItem={handleListItemClick}\n onDismiss={handleDismiss}\n valueExtractor={valueExtractor}\n listExtractor={listExtractor}\n selectedItems={currentSelectedItems}\n itemsLoadState={optionsLoadState[focusedInput as RangeType]}\n itemTruncationType={optionTruncationType}\n onRetry={onRetry}\n width={dropdownWidth}\n matchElementWidth={!dropdownWidth}\n enableSearch={enableSearch}\n searchFunction={searchFunction}\n searchPlaceholder={searchPlaceholder}\n renderListItem={renderListItem}\n renderCustomCallToAction={renderCustomCallToAction}\n />\n );\n };\n\n return (\n <div id={id} {...otherProps}>\n <DropdownListState>\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={isOpen}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle={false}\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n </DropdownListState>\n </div>\n );\n};\n"],"names":["InputRangeSelect","_a","selectedOptions","placeholders","from","to","options","disabled","className","readOnly","error","testId","id","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","renderCustomCallToAction","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","ariaLabelledBy","ariaDescribedBy","otherProps","__rest","selectedFromValue","setSelectedFromValue","useState","selectedToValue","setSelectedToValue","focusedInput","setFocusedInput","isOpen","labelButtonRef","useRef","dropdownRef","internalId","useId","listboxId","fromLabelId","toLabelId","useEffect","current","refocus","index","triggerOptionDisplayCallback","show","getDisplayValue","rangeType","selected","value","_b","toString","call","truncateValue","type","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","getCurrentFocused","currentOptions","useMemo","currentSelectedItems","openDropdownFor","focusButton","focus","getButtonLabelledBy","concatIds","handleSelectorClick","event","stopPropagation","preventDefault","handleSelectorKeyDown","key","handleListItemClick","item","extractedValue","undefined","handleDismiss","last","handleClear","renderLabel","_jsx","ValueLabel","truncateType","children","PlaceholderLabel","renderSelectorContent","role","onClick","onKeyDown","ref","tabIndex","styles.rangeSelectorButton","Object","assign","DropdownListState","ElementWithDropdown","enabled","renderElement","_jsxs","InputWrapper","clsx","styles.styledInputWrapper","focused","VisuallyHidden","RangeInputInnerContainer","currentActive","inputWrapperStyles.clearButtonContainer","ClearButton","renderDropdown","DropdownList","ariaLabel","listItems","onSelectItem","onDismiss","selectedItems","itemsLoadState","itemTruncationType","matchElementWidth","onOpen","onClose","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"kkFAsBO,MAAMA,EAA0BC,QAAAC,gBACnCA,EAAeC,aACfA,EAAe,CAAEC,KAAM,SAAUC,GAAI,UAAUC,QAC/CA,EAAOC,SACPA,EAAQC,UACRA,EAASC,SACTA,EAAQC,MACRA,EACA,cAAeC,EAAMC,GACrBA,EAAEC,aACFA,GAAe,EAAKC,eACpBA,EAAcC,kBACdA,EAAiBC,eACjBA,EAAcC,sBACdA,EAAqBC,cACrBA,EAAaC,sBACbA,EAAqBC,eACrBA,EAAcC,cACdA,EAAaC,cACbA,EAAaC,QACbA,EAAOC,iBACPA,EAAmB,CAAEpB,KAAM,UAAWC,GAAI,WAAWoB,qBACrDA,EAAuB,SAAQC,2BAC/BA,EAA0BC,eAC1BA,EAAcC,yBACdA,EAAwBC,UACxBA,EAASC,eACTA,EAAcC,iBACdA,EAAgBC,cAChBA,EACA,kBAAmBC,EACnB,mBAAoBC,M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AAsBG,KACvBF,QAAqBqD,GACrBlD,QAAmBkD,GACvB,EAqJYsC,UAAWrC,GACX4C,eAAe,EACfC,OAAQ,EACR5G,UAAWA,EACX6G,oBAAkB,EAClBC,aAAc7G,EACd8G,SAAU7G,QAGhB"}
1
+ {"version":3,"file":"input-range-select.js","sources":["../../src/input-range-select/input-range-select.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type React from \"react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { concatIds, VisuallyHidden } from \"../shared/accessibility\";\nimport type { DropdownListApi } from \"../shared/dropdown-list\";\nimport { DropdownList, DropdownListState } from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { ClearButton, InputWrapper } from \"../shared/input-wrapper\";\nimport * as inputWrapperStyles from \"../shared/input-wrapper/input-wrapper.styles\";\nimport { RangeInputInnerContainer } from \"../shared/range-input-inner-container\";\nimport { useId } from \"../util\";\nimport { StringHelper } from \"../util/string-helper\";\nimport * as styles from \"./input-range-select.styles\";\nimport type { InputRangeSelectProps } from \"./types\";\n\ntype RangeType = \"from\" | \"to\";\n\nexport const InputRangeSelect = <T, V>({\n selectedOptions,\n placeholders = { from: \"Select\", to: \"Select\" },\n options,\n disabled,\n className,\n readOnly,\n error,\n \"data-testid\": testId,\n id,\n enableSearch = false,\n searchFunction,\n searchPlaceholder,\n valueExtractor,\n valueToStringFunction,\n listExtractor,\n displayValueExtractor,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = { from: \"success\", to: \"success\" },\n optionTruncationType = \"middle\",\n renderCustomSelectedOption,\n renderListItem,\n renderCustomCallToAction,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n dropdownWidth,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...otherProps\n}: InputRangeSelectProps<T, V>): JSX.Element => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [selectedFromValue, setSelectedFromValue] = useState<T | undefined>();\n const [selectedToValue, setSelectedToValue] = useState<T | undefined>();\n const [focusedInput, setFocusedInput] = useState<RangeType | \"none\">(\n \"none\"\n );\n const isOpen = focusedInput !== \"none\";\n\n const labelButtonRef = {\n from: useRef<HTMLButtonElement>(null),\n to: useRef<HTMLButtonElement>(null),\n };\n const dropdownRef = useRef<DropdownListApi>(null);\n\n const internalId = useId();\n const listboxId = `${internalId}-range-listbox`;\n const fromLabelId = `${internalId}-from-label`;\n const toLabelId = `${internalId}-to-label`;\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setSelectedFromValue(selectedOptions?.from);\n setSelectedToValue(selectedOptions?.to);\n }, [selectedOptions]);\n\n useEffect(() => {\n if (!isOpen) return;\n\n if (focusedInput === \"to\") {\n dropdownRef.current?.refocus({ index: 0 });\n }\n }, [isOpen, focusedInput]);\n\n // =============================================================================\n // HELPERS\n // =============================================================================\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (!show) onHideOptions?.();\n if (show) onShowOptions?.();\n };\n\n const getDisplayValue = (rangeType: RangeType): string => {\n const selected =\n rangeType === \"from\" ? selectedFromValue : selectedToValue;\n if (!selected) return \"\";\n\n if (displayValueExtractor) return displayValueExtractor(selected);\n\n if (valueExtractor) {\n const value = valueExtractor(selected);\n return valueToStringFunction\n ? valueToStringFunction(value)\n : value?.toString?.() ?? \"\";\n }\n\n return selected.toString();\n };\n\n const truncateValue = (type: RangeType, value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelButtonRef[type]?.current) {\n widthOfElement =\n labelButtonRef[type].current.getBoundingClientRect().width;\n }\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 8);\n }\n return value;\n };\n\n const getCurrentFocused = (): \"none\" | \"start\" | \"end\" => {\n switch (focusedInput) {\n case \"from\":\n return \"start\";\n case \"to\":\n return \"end\";\n case \"none\":\n return focusedInput;\n }\n };\n\n const currentOptions = useMemo(() => {\n if (focusedInput === \"none\") return [];\n return options?.[focusedInput] ?? [];\n }, [focusedInput, options]);\n\n const currentSelectedItems = useMemo(() => {\n if (focusedInput === \"none\") return [];\n const selected =\n focusedInput === \"from\" ? selectedFromValue : selectedToValue;\n return selected ? [selected] : [];\n }, [focusedInput, selectedFromValue, selectedToValue]);\n\n const openDropdownFor = (rangeType: RangeType) => {\n if (disabled || readOnly) return;\n\n const nextFocusedInput =\n rangeType === \"to\" && !selectedFromValue ? \"from\" : rangeType;\n\n setFocusedInput(nextFocusedInput);\n triggerOptionDisplayCallback(true);\n };\n\n const focusButton = (type: RangeType) => {\n labelButtonRef[type].current?.focus();\n };\n\n const getButtonLabelledBy = (rangeType: RangeType) => {\n const rangeLabelId = rangeType === \"from\" ? fromLabelId : toLabelId;\n return concatIds(rangeLabelId, ariaLabelledBy);\n };\n\n const getDropdownAriaLabel = () => {\n if (focusedInput === \"from\") {\n return `Selecting for: ${placeholders?.from}`;\n }\n\n if (focusedInput === \"to\") {\n return `Selecting for: ${placeholders?.to}`;\n }\n\n return undefined;\n };\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleSelectorClick =\n (rangeType: RangeType) => (event: React.MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n openDropdownFor(rangeType);\n };\n\n const handleSelectorKeyDown =\n (rangeType: RangeType) =>\n (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) return;\n\n switch (event.key) {\n case \"Enter\":\n case \" \":\n case \"ArrowDown\":\n event.preventDefault();\n openDropdownFor(rangeType);\n break;\n default:\n break;\n }\n };\n\n const handleListItemClick = (item: T, extractedValue: V) => {\n if (focusedInput === \"none\") return;\n\n if (focusedInput === \"from\") {\n setSelectedFromValue(item);\n onSelectOption?.({ from: item }, extractedValue);\n\n setSelectedToValue(undefined);\n setFocusedInput(\"to\");\n triggerOptionDisplayCallback(true);\n focusButton(\"to\");\n return;\n }\n\n setSelectedToValue(item);\n onSelectOption?.({ to: item }, extractedValue);\n\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n focusButton(\"to\");\n };\n\n const handleDismiss = () => {\n const last = focusedInput;\n\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n\n if (last === \"to\") focusButton(\"to\");\n else focusButton(\"from\");\n\n if (!selectedFromValue || !selectedToValue) {\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n }\n };\n\n const handleClose = () => {\n setFocusedInput(\"none\");\n triggerOptionDisplayCallback(false);\n\n if (!selectedFromValue || !selectedToValue) {\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n }\n };\n\n const handleOpen = () => {\n if (disabled || readOnly) return;\n\n if (focusedInput === \"none\") {\n setFocusedInput(\"from\");\n triggerOptionDisplayCallback(true);\n }\n };\n\n const handleClear = (event: React.MouseEvent) => {\n event.stopPropagation();\n event.preventDefault();\n setSelectedFromValue(undefined);\n setSelectedToValue(undefined);\n onSelectOption?.({ from: undefined, to: undefined }, undefined);\n\n focusButton(\"from\");\n };\n\n // =============================================================================\n // RENDER\n // =============================================================================\n const renderLabel = (rangeType: RangeType) => {\n const selected =\n rangeType === \"from\" ? selectedFromValue : selectedToValue;\n\n if (!selected) {\n return (\n <PlaceholderLabel truncateType={optionTruncationType}>\n {truncateValue(rangeType, placeholders?.[rangeType] || \"\")}\n </PlaceholderLabel>\n );\n }\n\n if (renderCustomSelectedOption) {\n return renderCustomSelectedOption(selected);\n }\n\n return (\n <ValueLabel truncateType={optionTruncationType}>\n {truncateValue(rangeType, getDisplayValue(rangeType))}\n </ValueLabel>\n );\n };\n\n const renderSelectorContent = (rangeType: RangeType) => (\n <button\n type=\"button\"\n role=\"combobox\"\n aria-labelledby={getButtonLabelledBy(rangeType)}\n aria-describedby={ariaDescribedBy}\n aria-expanded={isOpen && focusedInput === rangeType}\n aria-controls={listboxId}\n aria-disabled={disabled}\n aria-readonly={readOnly}\n onClick={handleSelectorClick(rangeType)}\n onKeyDown={handleSelectorKeyDown(rangeType)}\n ref={labelButtonRef[rangeType]}\n tabIndex={0}\n className={styles.rangeSelectorButton}\n >\n {renderLabel(rangeType)}\n </button>\n );\n\n const renderElement = () => {\n return (\n <InputWrapper\n className={clsx(styles.styledInputWrapper, className)}\n data-testid={testId}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n focused={isOpen}\n >\n <VisuallyHidden id={fromLabelId}>\n {placeholders?.from || \"Select From\"}\n </VisuallyHidden>\n <VisuallyHidden id={toLabelId}>\n {placeholders?.to || \"Select To\"}\n </VisuallyHidden>\n\n <RangeInputInnerContainer\n currentActive={getCurrentFocused()}\n error={error}\n >\n {renderSelectorContent(\"from\")}\n {renderSelectorContent(\"to\")}\n </RangeInputInnerContainer>\n\n {!isOpen &&\n selectedFromValue &&\n selectedToValue &&\n !readOnly &&\n !disabled && (\n <div\n className={inputWrapperStyles.clearButtonContainer}\n >\n <ClearButton\n onClick={handleClear}\n type=\"button\"\n aria-label=\"Clear\"\n />\n </div>\n )}\n </InputWrapper>\n );\n };\n\n const renderDropdown = () => {\n return (\n <DropdownList\n ref={dropdownRef}\n data-testid={`${testId}-dropdown`}\n listboxId={listboxId}\n ariaLabel={getDropdownAriaLabel()}\n listItems={currentOptions}\n onSelectItem={handleListItemClick}\n onDismiss={handleDismiss}\n valueExtractor={valueExtractor}\n listExtractor={listExtractor}\n selectedItems={currentSelectedItems}\n itemsLoadState={optionsLoadState[focusedInput as RangeType]}\n itemTruncationType={optionTruncationType}\n onRetry={onRetry}\n width={dropdownWidth}\n matchElementWidth={!dropdownWidth}\n enableSearch={enableSearch}\n searchFunction={searchFunction}\n searchPlaceholder={searchPlaceholder}\n renderListItem={renderListItem}\n renderCustomCallToAction={renderCustomCallToAction}\n />\n );\n };\n\n return (\n <div id={id} {...otherProps}>\n <DropdownListState>\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={isOpen}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle={false}\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n </DropdownListState>\n </div>\n );\n};\n"],"names":["InputRangeSelect","_a","selectedOptions","placeholders","from","to","options","disabled","className","readOnly","error","testId","id","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","renderCustomCallToAction","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","ariaLabelledBy","ariaDescribedBy","otherProps","__rest","selectedFromValue","setSelectedFromValue","useState","selectedToValue","setSelectedToValue","focusedInput","setFocusedInput","isOpen","labelButtonRef","useRef","dropdownRef","internalId","useId","listboxId","fromLabelId","toLabelId","useEffect","current","refocus","index","triggerOptionDisplayCallback","show","getDisplayValue","rangeType","selected","value","_b","toString","call","truncateValue","type","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","getCurrentFocused","currentOptions","useMemo","currentSelectedItems","openDropdownFor","focusButton","focus","getButtonLabelledBy","concatIds","handleSelectorClick","event","stopPropagation","preventDefault","handleSelectorKeyDown","key","handleListItemClick","item","extractedValue","undefined","handleDismiss","last","handleClear","renderLabel","_jsx","ValueLabel","truncateType","children","PlaceholderLabel","renderSelectorContent","role","onClick","onKeyDown","ref","tabIndex","styles.rangeSelectorButton","Object","assign","DropdownListState","ElementWithDropdown","enabled","renderElement","_jsxs","InputWrapper","clsx","styles.styledInputWrapper","focused","VisuallyHidden","RangeInputInnerContainer","currentActive","inputWrapperStyles.clearButtonContainer","ClearButton","renderDropdown","DropdownList","ariaLabel","listItems","onSelectItem","onDismiss","selectedItems","itemsLoadState","itemTruncationType","matchElementWidth","onOpen","onClose","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings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B,IAAK1D,GAAW,cACH,GAAGpC,aAChBuC,UAAWA,GACX4E,UAxMa,SAAjBpF,GACO,kBAAkBvC,eAAAA,EAAcC,OAGtB,OAAjBsC,GACO,kBAAkBvC,eAAAA,EAAcE,UAD3C,EAqMQ0H,UAAWrD,GACXsD,aAAcxC,GACdyC,UAAWrC,GACX5E,eAAgBA,EAChBE,cAAeA,EACfgH,cAAetD,GACfuD,eAAgB3G,EAAiBkB,IACjC0F,mBAAoB3G,EACpBF,QAASA,EACT+C,MAAOtC,EACPqG,mBAAoBrG,EACpBnB,aAAcA,EACdC,eAAgBA,EAChBC,kBAAmBA,EACnBY,eAAgBA,EAChBC,yBAA0BA,IAatB0G,OAhJG,KACX/H,GAAYE,GAEK,SAAjBiC,KACAC,GAAgB,QAChBc,IAA6B,GACjC,EA2IY8E,QA3JI,KAChB5F,GAAgB,QAChBc,IAA6B,GAExBpB,IAAsBG,KACvBF,QAAqBqD,GACrBlD,QAAmBkD,GACvB,EAqJYsC,UAAWrC,GACX4C,eAAe,EACfC,OAAQ,EACR5G,UAAWA,EACX6G,oBAAkB,EAClBC,aAAc7G,EACd8G,SAAU7G,QAGhB"}
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as r,useRef as t,useEffect as o}from"react";import"clsx";import"../theme/theme-provider/index.js";import"../theme/theme-provider/context.js";import"../theme/tokens/border.js";import"../theme/tokens/colour.js";import"../theme/tokens/font.js";import"../theme/tokens/media-query.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import{useId as i}from"../util/simple-id-generator.js";import{StringHelper as s}from"../util/string-helper.js";import"@react-aria/live-announcer";import"../theme/utils/use-media-query.js";import"../shared/dropdown-list/dropdown-label.styles_1dwmd8f.css";import{DropdownList as n}from"../shared/dropdown-list/dropdown-list.js";import{DropdownListState as l}from"../shared/dropdown-list/dropdown-list-state.js";import{ExpandableElement as a}from"../shared/dropdown-list/expandable-element.js";import"@lifesg/react-icons/caret-right";import"@lifesg/react-icons/exclamation-circle-fill";import"@lifesg/react-icons/minus-square-fill";import"@lifesg/react-icons/square";import"@lifesg/react-icons/square-tick-fill";import"@lifesg/react-icons/tick";import"react-virtuoso";import"../markup/markup.js";import"../_virtual/_tslib.js";import"../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css";import{ElementWithDropdown as d}from"../shared/dropdown-wrapper/element-with-dropdown.js";import{InputBox as p}from"../shared/input-wrapper/input-wrapper.js";import"../shared/dropdown-list/dropdown-list.styles_1kt4zhf.css";import"../shared/dropdown-list/dropdown-search.js";import"../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css";import"immer";import"../external/lodash/_getTag.js";import"../external/lodash/isArguments.js";import"../external/lodash/_baseGetTag.js";import"../external/lodash/isBuffer.js";import"../external/lodash/isTypedArray.js";import"../external/lodash/_Stack.js";import"../external/lodash/_SetCache.js";import"../external/lodash/_equalByTag.js";import"../shared/dropdown-list/virtuoso-components.js";import{LabelContainer as c,PlaceholderLabel as m,ValueLabel as u}from"../shared/dropdown-wrapper/dropdown-wrapper.js";const h=({selectedOption:h,placeholder:f="Select",options:w,disabled:j,error:x,className:b,"data-testid":g,id:y,"aria-labelledby":v,"aria-describedby":_,"aria-invalid":T,enableSearch:I=!1,searchFunction:S,searchPlaceholder:A,valueExtractor:k,valueToStringFunction:C,listExtractor:O,displayValueExtractor:R,onSelectOption:q,onShowOptions:D,onHideOptions:E,onRetry:L,optionsLoadState:H="success",optionTruncationType:N="end",renderCustomSelectedOption:P,renderListItem:B,hideNoResultsDisplay:G,noResultsDescription:F,customLabels:M,renderCustomCallToAction:W,onBlur:Z,variant:z="default",readOnly:V,alignment:J,dropdownZIndex:K,dropdownRootNode:Q,dropdownWidth:U})=>{const[X,Y]=r(h),[$,ee]=r(!1),[re,te]=r(!1),oe=i(),ie=t(null),se=t(null),ne=t(null);o((()=>{Y(h)}),[h]);const le=(e,r)=>{var t;null===(t=se.current)||void 0===t||t.focus(),Y(e),ee(!1),ue(!1),null==q||q(e,r)},ae=()=>{$&&(ee(!1),ue(!1))},de=()=>{re||$||te(!0)},pe=e=>{re&&!$&&ie.current&&!ie.current.contains(e.relatedTarget)&&(te(!1),null==Z||Z())},ce=()=>{var e;if(!X)return"";if(R)return R(X);if(k){const r=k(X);return C?C(r):null!==(e=null==r?void 0:r.toString())&&void 0!==e?e:""}return X.toString()},me=e=>{if("middle"===N){let r=0;return ne&&ne.current&&(r=ne.current.getBoundingClientRect().width),s.truncateOneLine(e,r,120,8)}return e},ue=e=>{e?null==D||D():null==E||E()};return e(l,{children:e(d,{enabled:!V&&!j,isOpen:$,renderElement:()=>e(p,{className:b,"data-testid":g,id:y,ref:ie,tabIndex:-1,onFocus:de,onBlur:pe,focused:re,disabled:j,readOnly:V,error:x,children:e(a,{ref:se,disabled:j,expanded:$,listboxId:oe,popupRole:"listbox",readOnly:V,variant:z,"aria-labelledby":v,"aria-describedby":_,"aria-invalid":T,children:e(c,{ref:ne,disabled:j,children:X?P?P(X):e(u,{variant:z,truncateType:N,children:me(ce())}):e(m,{variant:z,truncateType:N,children:f})})})}),renderDropdown:()=>e(n,{listboxId:oe,listItems:w,onSelectItem:le,onDismiss:ae,valueExtractor:k,listExtractor:O,enableSearch:I,searchPlaceholder:A,searchFunction:S,selectedItems:X?[X]:[],onRetry:L,itemsLoadState:H,itemTruncationType:N,renderListItem:B,hideNoResultsDisplay:G,noResultsDescription:F,customLabels:M,renderCustomCallToAction:W,variant:z,width:U,matchElementWidth:!0}),onOpen:()=>{ee(!0),ue(!0),te(!0)},onClose:e=>{ee(!1),ue(!1),"click"!==e&&(te(!1),null==Z||Z())},onDismiss:()=>{var e;null===(e=se.current)||void 0===e||e.focus(),ee(!1),ue(!1)},clickToToggle:!0,offset:8,alignment:J,fitAvailableHeight:!0,customZIndex:K,rootNode:Q})})};export{h as InputSelect};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as r,useRef as t,useEffect as o}from"react";import"clsx";import"../theme/theme-provider/index.js";import"../theme/theme-provider/context.js";import"../theme/tokens/border.js";import"../theme/tokens/colour.js";import"../theme/tokens/font.js";import"../theme/tokens/media-query.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import{useId as i}from"../util/simple-id-generator.js";import{StringHelper as s}from"../util/string-helper.js";import"@react-aria/live-announcer";import"../theme/utils/use-media-query.js";import"../shared/dropdown-list/dropdown-label.styles_mloii0.css";import{DropdownList as n}from"../shared/dropdown-list/dropdown-list.js";import{DropdownListState as l}from"../shared/dropdown-list/dropdown-list-state.js";import{ExpandableElement as a}from"../shared/dropdown-list/expandable-element.js";import"@lifesg/react-icons/caret-right";import"@lifesg/react-icons/exclamation-circle-fill";import"@lifesg/react-icons/minus-square-fill";import"@lifesg/react-icons/square";import"@lifesg/react-icons/square-tick-fill";import"@lifesg/react-icons/tick";import"react-virtuoso";import"../markup/markup.js";import"../_virtual/_tslib.js";import"../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css";import{ElementWithDropdown as d}from"../shared/dropdown-wrapper/element-with-dropdown.js";import{InputBox as p}from"../shared/input-wrapper/input-wrapper.js";import"../shared/dropdown-list/dropdown-list.styles_konwm.css";import"../shared/dropdown-list/dropdown-search.js";import"../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css";import"immer";import"../external/lodash/_getTag.js";import"../external/lodash/isArguments.js";import"../external/lodash/_baseGetTag.js";import"../external/lodash/isBuffer.js";import"../external/lodash/isTypedArray.js";import"../external/lodash/_Stack.js";import"../external/lodash/_SetCache.js";import"../external/lodash/_equalByTag.js";import"../shared/dropdown-list/virtuoso-components.js";import{LabelContainer as m,PlaceholderLabel as c,ValueLabel as u}from"../shared/dropdown-wrapper/dropdown-wrapper.js";const h=({selectedOption:h,placeholder:f="Select",options:w,disabled:j,error:x,className:b,"data-testid":g,id:y,"aria-labelledby":v,"aria-describedby":_,"aria-invalid":T,enableSearch:I=!1,searchFunction:S,searchPlaceholder:A,valueExtractor:k,valueToStringFunction:C,listExtractor:O,displayValueExtractor:R,onSelectOption:q,onShowOptions:D,onHideOptions:E,onRetry:L,optionsLoadState:H="success",optionTruncationType:N="end",renderCustomSelectedOption:P,renderListItem:B,hideNoResultsDisplay:G,noResultsDescription:F,customLabels:M,renderCustomCallToAction:W,onBlur:Z,variant:V="default",readOnly:z,alignment:J,dropdownZIndex:K,dropdownRootNode:Q,dropdownWidth:U})=>{const[X,Y]=r(h),[$,ee]=r(!1),[re,te]=r(!1),oe=i(),ie=t(null),se=t(null),ne=t(null);o((()=>{Y(h)}),[h]);const le=(e,r)=>{var t;null===(t=se.current)||void 0===t||t.focus(),Y(e),ee(!1),ue(!1),null==q||q(e,r)},ae=()=>{$&&(ee(!1),ue(!1))},de=()=>{re||$||te(!0)},pe=e=>{re&&!$&&ie.current&&!ie.current.contains(e.relatedTarget)&&(te(!1),null==Z||Z())},me=()=>{var e;if(!X)return"";if(R)return R(X);if(k){const r=k(X);return C?C(r):null!==(e=null==r?void 0:r.toString())&&void 0!==e?e:""}return X.toString()},ce=e=>{if("middle"===N){let r=0;return ne&&ne.current&&(r=ne.current.getBoundingClientRect().width),s.truncateOneLine(e,r,120,8)}return e},ue=e=>{e?null==D||D():null==E||E()};return e(l,{children:e(d,{enabled:!z&&!j,isOpen:$,renderElement:()=>e(p,{className:b,"data-testid":g,id:y,ref:ie,tabIndex:-1,onFocus:de,onBlur:pe,focused:re,disabled:j,readOnly:z,error:x,children:e(a,{ref:se,disabled:j,expanded:$,listboxId:oe,popupRole:"listbox",readOnly:z,variant:V,"aria-labelledby":v,"aria-describedby":_,"aria-invalid":T,children:e(m,{ref:ne,disabled:j,children:X?P?P(X):e(u,{variant:V,truncateType:N,children:ce(me())}):e(c,{variant:V,truncateType:N,children:f})})})}),renderDropdown:()=>e(n,{listboxId:oe,listItems:w,onSelectItem:le,onDismiss:ae,valueExtractor:k,listExtractor:O,enableSearch:I,searchPlaceholder:A,searchFunction:S,selectedItems:X?[X]:[],onRetry:L,itemsLoadState:H,itemTruncationType:N,renderListItem:B,hideNoResultsDisplay:G,noResultsDescription:F,customLabels:M,renderCustomCallToAction:W,variant:V,width:U,matchElementWidth:!0}),onOpen:()=>{ee(!0),ue(!0),te(!0)},onClose:e=>{ee(!1),ue(!1),"click"!==e&&(te(!1),null==Z||Z())},onDismiss:()=>{var e;null===(e=se.current)||void 0===e||e.focus(),ee(!1),ue(!1)},clickToToggle:!0,offset:8,alignment:J,fitAvailableHeight:!0,customZIndex:K,rootNode:Q})})};export{h as InputSelect};
2
2
  //# sourceMappingURL=input-select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-select.js","sources":["../../src/input-select/input-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n DropdownList,\n DropdownListState,\n ExpandableElement,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { useId } from \"../util\";\nimport { StringHelper } from \"../util/string-helper\";\nimport type { InputSelectProps } from \"./types\";\n\nexport const InputSelect = <T, V>({\n selectedOption,\n placeholder = \"Select\",\n options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n enableSearch = false,\n searchFunction,\n searchPlaceholder,\n valueExtractor,\n valueToStringFunction,\n listExtractor,\n displayValueExtractor,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n renderCustomSelectedOption,\n renderListItem,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n renderCustomCallToAction,\n onBlur,\n variant = \"default\",\n readOnly,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n dropdownWidth,\n}: InputSelectProps<T, V>): JSX.Element => {\n // =============================================================================\n // CONST, STATE\n // =============================================================================\n const [selected, setSelected] = useState<T | undefined>(selectedOption);\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setSelected(selectedOption);\n }, [selectedOption]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleListItemClick = (item: T, extractedValue: V) => {\n selectorRef.current?.focus();\n setSelected(item);\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n onSelectOption?.(item, extractedValue);\n };\n\n const handleListDismiss = () => {\n if (showOptions) {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n }\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =============================================================================\n // HELPER FUNCTION\n // =============================================================================\n const getDisplayValue = (): string => {\n if (!selected) return \"\";\n\n if (displayValueExtractor) {\n return displayValueExtractor(selected);\n }\n\n if (valueExtractor) {\n const value = valueExtractor(selected);\n return valueToStringFunction\n ? valueToStringFunction(value)\n : value?.toString() ?? \"\";\n }\n\n return selected.toString();\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 8);\n }\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (show) {\n onShowOptions?.();\n } else {\n onHideOptions?.();\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderLabel = () => {\n if (!selected) {\n return (\n <PlaceholderLabel\n variant={variant}\n truncateType={optionTruncationType}\n >\n {placeholder}\n </PlaceholderLabel>\n );\n } else if (renderCustomSelectedOption) {\n return renderCustomSelectedOption(selected);\n } else {\n return (\n <ValueLabel\n variant={variant}\n truncateType={optionTruncationType}\n >\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"listbox\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <DropdownList\n listboxId={internalId}\n listItems={options}\n onSelectItem={handleListItemClick}\n onDismiss={handleListDismiss}\n valueExtractor={valueExtractor}\n listExtractor={listExtractor}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n searchFunction={searchFunction}\n selectedItems={selected ? [selected] : []}\n onRetry={onRetry}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n renderListItem={renderListItem}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n renderCustomCallToAction={renderCustomCallToAction}\n variant={variant}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <DropdownListState>\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n </DropdownListState>\n );\n};\n"],"names":["InputSelect","selectedOption","placeholder","options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","hideNoResultsDisplay","noResultsDescription","customLabels","renderCustomCallToAction","onBlur","variant","readOnly","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","selected","setSelected","useState","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","handleListItemClick","item","extractedValue","_a","current","focus","triggerOptionDisplayCallback","handleListDismiss","handleNodeFocus","handleNodeBlur","e","contains","relatedTarget","getDisplayValue","value","toString","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","show","_jsx","DropdownListState","children","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","LabelContainer","ValueLabel","truncateType","PlaceholderLabel","renderDropdown","DropdownList","listItems","onSelectItem","onDismiss","selectedItems","itemsLoadState","itemTruncationType","matchElementWidth","onOpen","onClose","reason","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"+rEAoBaA,EAAc,EACvBC,iBACAC,cAAc,SACdC,UACAC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,gBAAe,EACfC,iBACAC,oBACAC,iBACAC,wBACAC,gBACAC,wBACAC,iBACAC,gBACAC,gBACAC,UACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,6BACAC,iBACAC,uBACAC,uBACAC,eACAC,2BACAC,SACAC,UAAU,UACVC,WACAC,YACAC,iBACAC,mBACAC,oBAKA,MAAOC,EAAUC,GAAeC,EAAwBvC,IACjDwC,EAAaC,IAAkBF,GAAkB,IACjDG,GAASC,IAAcJ,GAAkB,GAC1CK,GAAaC,IAEbC,GAAUC,EAAuB,MACjCC,GAAcD,EAA0B,MACxCE,GAAoBF,EAAuB,MAKjDG,GAAU,KACNZ,EAAYtC,EAAe,GAC5B,CAACA,IAKJ,MAAMmD,GAAsB,CAACC,EAASC,WACf,QAAnBC,EAAAN,GAAYO,eAAO,IAAAD,GAAAA,EAAEE,QACrBlB,EAAYc,GACZX,IAAe,GACfgB,IAA6B,GAE7BvC,SAAAA,EAAiBkC,EAAMC,EAAe,EAGpCK,GAAoB,KAClBlB,IACAC,IAAe,GACfgB,IAA6B,GACjC,EAGEE,GAAkB,KACfjB,IAAYF,GACbG,IAAW,EACf,EAGEiB,GAAkBC,IAEhBnB,KACCF,GACDM,GAAQS,UACPT,GAAQS,QAAQO,SAASD,EAAEE,iBAE5BpB,IAAW,GACXb,SAAAA,IACJ,EA6BEkC,GAAkB,WACpB,IAAK3B,EAAU,MAAO,GAEtB,GAAIpB,EACA,OAAOA,EAAsBoB,GAGjC,GAAIvB,EAAgB,CAChB,MAAMmD,EAAQnD,EAAeuB,GAC7B,OAAOtB,EACDA,EAAsBkD,GACL,QAAjBX,E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GACvChB,QAASA,EACT8E,eAAgB7E,EAChB8E,mBAAoB7E,EACpBE,eAAgBA,EAChBC,qBAAsBA,EACtBC,qBAAsBA,EACtBC,aAAcA,EACdC,yBAA0BA,EAC1BE,QAASA,EACTuC,MAAOlC,EACPiE,mBAAiB,IAYjBC,OArKO,KACf7D,IAAe,GACfgB,IAA6B,GAC7Bd,IAAW,EAAK,EAmKR4D,QAhKSC,IACjB/D,IAAe,GACfgB,IAA6B,GAGd,UAAX+C,IACA7D,IAAW,GACXb,SAAAA,IACJ,EAyJQmE,UAtJU,WACC,QAAnB3C,EAAAN,GAAYO,eAAO,IAAAD,GAAAA,EAAEE,QACrBf,IAAe,GACfgB,IAA6B,EAAM,EAoJ3BgD,eAAa,EACbC,OAAQ,EACRzE,UAAWA,EACX0E,oBAAkB,EAClBC,aAAc1E,EACd2E,SAAU1E,KAEE"}
1
+ {"version":3,"file":"input-select.js","sources":["../../src/input-select/input-select.tsx"],"sourcesContent":["import type { OpenChangeReason } from \"@floating-ui/react\";\nimport type React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n DropdownList,\n DropdownListState,\n ExpandableElement,\n} from \"../shared/dropdown-list\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport {\n LabelContainer,\n PlaceholderLabel,\n ValueLabel,\n} from \"../shared/dropdown-wrapper/dropdown-wrapper\";\nimport { InputBox } from \"../shared/input-wrapper/input-wrapper\";\nimport { useId } from \"../util\";\nimport { StringHelper } from \"../util/string-helper\";\nimport type { InputSelectProps } from \"./types\";\n\nexport const InputSelect = <T, V>({\n selectedOption,\n placeholder = \"Select\",\n options,\n disabled,\n error,\n className,\n \"data-testid\": testId,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n enableSearch = false,\n searchFunction,\n searchPlaceholder,\n valueExtractor,\n valueToStringFunction,\n listExtractor,\n displayValueExtractor,\n onSelectOption,\n onShowOptions,\n onHideOptions,\n onRetry,\n optionsLoadState = \"success\",\n optionTruncationType = \"end\",\n renderCustomSelectedOption,\n renderListItem,\n hideNoResultsDisplay,\n noResultsDescription,\n customLabels,\n renderCustomCallToAction,\n onBlur,\n variant = \"default\",\n readOnly,\n alignment,\n dropdownZIndex,\n dropdownRootNode,\n dropdownWidth,\n}: InputSelectProps<T, V>): JSX.Element => {\n // =============================================================================\n // CONST, STATE\n // =============================================================================\n const [selected, setSelected] = useState<T | undefined>(selectedOption);\n const [showOptions, setShowOptions] = useState<boolean>(false);\n const [focused, setFocused] = useState<boolean>(false);\n const internalId = useId();\n\n const nodeRef = useRef<HTMLDivElement>(null);\n const selectorRef = useRef<HTMLButtonElement>(null);\n const labelContainerRef = useRef<HTMLDivElement>(null);\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n setSelected(selectedOption);\n }, [selectedOption]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleListItemClick = (item: T, extractedValue: V) => {\n selectorRef.current?.focus();\n setSelected(item);\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n onSelectOption?.(item, extractedValue);\n };\n\n const handleListDismiss = () => {\n if (showOptions) {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n }\n };\n\n const handleNodeFocus = () => {\n if (!focused && !showOptions) {\n setFocused(true);\n }\n };\n\n const handleNodeBlur = (e: React.FocusEvent) => {\n if (\n focused &&\n !showOptions &&\n nodeRef.current &&\n !nodeRef.current.contains(e.relatedTarget as Node)\n ) {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleOpen = () => {\n setShowOptions(true);\n triggerOptionDisplayCallback(true);\n setFocused(true);\n };\n\n const handleClose = (reason: OpenChangeReason | undefined) => {\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n\n // click to toggle should not blur the input\n if (reason !== \"click\") {\n setFocused(false);\n onBlur?.();\n }\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n triggerOptionDisplayCallback(false);\n };\n\n // =============================================================================\n // HELPER FUNCTION\n // =============================================================================\n const getDisplayValue = (): string => {\n if (!selected) return \"\";\n\n if (displayValueExtractor) {\n return displayValueExtractor(selected);\n }\n\n if (valueExtractor) {\n const value = valueExtractor(selected);\n return valueToStringFunction\n ? valueToStringFunction(value)\n : value?.toString() ?? \"\";\n }\n\n return selected.toString();\n };\n\n const truncateValue = (value: string) => {\n if (optionTruncationType === \"middle\") {\n let widthOfElement = 0;\n if (labelContainerRef && labelContainerRef.current) {\n widthOfElement =\n labelContainerRef.current.getBoundingClientRect().width;\n }\n\n return StringHelper.truncateOneLine(value, widthOfElement, 120, 8);\n }\n return value;\n };\n\n const triggerOptionDisplayCallback = (show: boolean) => {\n if (show) {\n onShowOptions?.();\n } else {\n onHideOptions?.();\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderLabel = () => {\n if (!selected) {\n return (\n <PlaceholderLabel\n variant={variant}\n truncateType={optionTruncationType}\n >\n {placeholder}\n </PlaceholderLabel>\n );\n } else if (renderCustomSelectedOption) {\n return renderCustomSelectedOption(selected);\n } else {\n return (\n <ValueLabel\n variant={variant}\n truncateType={optionTruncationType}\n >\n {truncateValue(getDisplayValue())}\n </ValueLabel>\n );\n }\n };\n\n const renderSelectorContent = () => (\n <LabelContainer ref={labelContainerRef} disabled={disabled}>\n {renderLabel()}\n </LabelContainer>\n );\n\n const renderElement = () => {\n return (\n <InputBox\n className={className}\n data-testid={testId}\n id={id}\n ref={nodeRef}\n tabIndex={-1}\n onFocus={handleNodeFocus}\n onBlur={handleNodeBlur}\n focused={focused}\n disabled={disabled}\n readOnly={readOnly}\n error={error}\n >\n <ExpandableElement\n ref={selectorRef}\n disabled={disabled}\n expanded={showOptions}\n listboxId={internalId}\n popupRole=\"listbox\"\n readOnly={readOnly}\n variant={variant}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n >\n {renderSelectorContent()}\n </ExpandableElement>\n </InputBox>\n );\n };\n\n const renderDropdown = () => {\n return (\n <DropdownList\n listboxId={internalId}\n listItems={options}\n onSelectItem={handleListItemClick}\n onDismiss={handleListDismiss}\n valueExtractor={valueExtractor}\n listExtractor={listExtractor}\n enableSearch={enableSearch}\n searchPlaceholder={searchPlaceholder}\n searchFunction={searchFunction}\n selectedItems={selected ? [selected] : []}\n onRetry={onRetry}\n itemsLoadState={optionsLoadState}\n itemTruncationType={optionTruncationType}\n renderListItem={renderListItem}\n hideNoResultsDisplay={hideNoResultsDisplay}\n noResultsDescription={noResultsDescription}\n customLabels={customLabels}\n renderCustomCallToAction={renderCustomCallToAction}\n variant={variant}\n width={dropdownWidth}\n matchElementWidth\n />\n );\n };\n\n return (\n <DropdownListState>\n <ElementWithDropdown\n enabled={!readOnly && !disabled}\n isOpen={showOptions}\n renderElement={renderElement}\n renderDropdown={renderDropdown}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n clickToToggle\n offset={8}\n alignment={alignment}\n fitAvailableHeight\n customZIndex={dropdownZIndex}\n rootNode={dropdownRootNode}\n />\n </DropdownListState>\n );\n};\n"],"names":["InputSelect","selectedOption","placeholder","options","disabled","error","className","testId","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","enableSearch","searchFunction","searchPlaceholder","valueExtractor","valueToStringFunction","listExtractor","displayValueExtractor","onSelectOption","onShowOptions","onHideOptions","onRetry","optionsLoadState","optionTruncationType","renderCustomSelectedOption","renderListItem","hideNoResultsDisplay","noResultsDescription","customLabels","renderCustomCallToAction","onBlur","variant","readOnly","alignment","dropdownZIndex","dropdownRootNode","dropdownWidth","selected","setSelected","useState","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","useEffect","handleListItemClick","item","extractedValue","_a","current","focus","triggerOptionDisplayCallback","handleListDismiss","handleNodeFocus","handleNodeBlur","e","contains","relatedTarget","getDisplayValue","value","toString","truncateValue","widthOfElement","getBoundingClientRect","width","StringHelper","truncateOneLine","show","_jsx","DropdownListState","children","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","LabelContainer","ValueLabel","truncateType","PlaceholderLabel","renderDropdown","DropdownList","listItems","onSelectItem","onDismiss","selectedItems","itemsLoadState","itemTruncationType","matchElementWidth","onOpen","onClose","reason","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"4rEAoBaA,EAAc,EACvBC,iBACAC,cAAc,SACdC,UACAC,WACAC,QACAC,YACA,cAAeC,EACfC,KACA,kBAAmBC,EACnB,mBAAoBC,EACpB,eAAgBC,EAChBC,gBAAe,EACfC,iBACAC,oBACAC,iBACAC,wBACAC,gBACAC,wBACAC,iBACAC,gBACAC,gBACAC,UACAC,mBAAmB,UACnBC,uBAAuB,MACvBC,6BACAC,iBACAC,uBACAC,uBACAC,eACAC,2BACAC,SACAC,UAAU,UACVC,WACAC,YACAC,iBACAC,mBACAC,oBAKA,MAAOC,EAAUC,GAAeC,EAAwBvC,IACjDwC,EAAaC,IAAkBF,GAAkB,IACjDG,GAASC,IAAcJ,GAAkB,GAC1CK,GAAaC,IAEbC,GAAUC,EAAuB,MACjCC,GAAcD,EAA0B,MACxCE,GAAoBF,EAAuB,MAKjDG,GAAU,KACNZ,EAAYtC,EAAe,GAC5B,CAACA,IAKJ,MAAMmD,GAAsB,CAACC,EAASC,WACf,QAAnBC,EAAAN,GAAYO,eAAO,IAAAD,GAAAA,EAAEE,QACrBlB,EAAYc,GACZX,IAAe,GACfgB,IAA6B,GAE7BvC,SAAAA,EAAiBkC,EAAMC,EAAe,EAGpCK,GAAoB,KAClBlB,IACAC,IAAe,GACfgB,IAA6B,GACjC,EAGEE,GAAkB,KACfjB,IAAYF,GACbG,IAAW,EACf,EAGEiB,GAAkBC,IAEhBnB,KACCF,GACDM,GAAQS,UACPT,GAAQS,QAAQO,SAASD,EAAEE,iBAE5Bp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A0FL4F,eAlCW,IAEfnB,EAACoB,EAAY,CACTP,UAAW3C,GACXmD,UAAW7F,EACX8F,aAAc7C,GACd8C,UAAWvC,GACX5C,eAAgBA,EAChBE,cAAeA,EACfL,aAAcA,EACdE,kBAAmBA,EACnBD,eAAgBA,EAChBsF,cAAe7D,EAAW,CAACA,GAAY,GACvChB,QAASA,EACT8E,eAAgB7E,EAChB8E,mBAAoB7E,EACpBE,eAAgBA,EAChBC,qBAAsBA,EACtBC,qBAAsBA,EACtBC,aAAcA,EACdC,yBAA0BA,EAC1BE,QAASA,EACTuC,MAAOlC,EACPiE,mBAAiB,IAYjBC,OArKO,KACf7D,IAAe,GACfgB,IAA6B,GAC7Bd,IAAW,EAAK,EAmKR4D,QAhKSC,IACjB/D,IAAe,GACfgB,IAA6B,GAGd,UAAX+C,IACA7D,IAAW,GACXb,SAAAA,IACJ,EAyJQmE,UAtJU,WACC,QAAnB3C,EAAAN,GAAYO,eAAO,IAAAD,GAAAA,EAAEE,QACrBf,IAAe,GACfgB,IAA6B,EAAM,EAoJ3BgD,eAAa,EACbC,OAAQ,EACRzE,UAAWA,EACX0E,oBAAkB,EAClBC,aAAc1E,EACd2E,SAAU1E,KAEE"}
@@ -1,2 +1,2 @@
1
- import"./textarea-counter.styles_adg5h1.css";const t="c1d4l1yp";export{t as counterLabel};
1
+ import"./textarea-counter.styles_1n3wsnv.css";const t="c1d4l1yp";export{t as counterLabel};
2
2
  //# sourceMappingURL=textarea-counter.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textarea-counter.styles.js","sources":["../../src/input-textarea/textarea-counter.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Colour, Font } from \"../theme\";\n\nexport const counterLabel = css`\n text-align: right;\n ${Font[\"body-sm-semibold\"]}\n color: ${Colour[\"text-subtler\"]};\n`;\n"],"names":["counterLabel"],"mappings":"2EAIO,MAAMA,EAAY"}
1
+ {"version":3,"file":"textarea-counter.styles.js","sources":["../../src/input-textarea/textarea-counter.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Colour, Font } from \"../theme\";\n\nexport const counterLabel = css`\n text-align: right;\n ${Font[\"body-sm-semibold\"]}\n color: ${Colour[\"text-subtler\"]};\n`;\n"],"names":["counterLabel"],"mappings":"4EAIO,MAAMA,EAAY"}
@@ -0,0 +1 @@
1
+ .c1d4l1yp{text-align:right;font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-sm);font-weight:var(--fds-font-weight-semibold);line-height:var(--fds-font-body-lh-sm);letter-spacing:var(--fds-font-body-ls-sm);color:var(--fds-colour-text-subtler);}
@@ -1,2 +1,2 @@
1
- import"./textarea.styles_g0zgyq.css";const t="w1xqauhq",e="e10c6rk9",a="e1kovz0t",r="e9uwuyt",s="etmlvbn";export{e as element,r as elementDisabled,s as elementError,a as elementReadOnly,t as wrapper};
1
+ import"./textarea.styles_22z4n3.css";const t="w1xqauhq",e="e10c6rk9",a="e1kovz0t",r="e9uwuyt",s="etmlvbn";export{e as element,r as elementDisabled,s as elementError,a as elementReadOnly,t as wrapper};
2
2
  //# sourceMappingURL=textarea.styles.js.map
@@ -0,0 +1,5 @@
1
+ .w1xqauhq{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
2
+ .e10c6rk9{border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);border-radius:var(--fds-radius-sm);background:var(--fds-colour-bg);outline:none;overflow:auto;display:block;padding:var(--fds-spacing-12) var(--fds-spacing-16);width:100%;font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-baseline);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-baseline);letter-spacing:var(--fds-font-body-ls-baseline);color:var(--fds-colour-text);}.e10c6rk9:focus,.e10c6rk9:active{outline-offset:-1px;outline:var(--fds-border-width-020) var(--fds-border-style-solid) var(--fds-colour-border-focus);}.e10c6rk9::-webkit-input-placeholder{color:var(--fds-colour-text-subtler);}.e10c6rk9::-webkit-scrollbar{width:14px;}.e10c6rk9::-webkit-scrollbar-track{background:transparent;}.e10c6rk9::-webkit-scrollbar-thumb{background:var(--fds-colour-bg-inverse-subtlest);border:5px solid transparent;border-radius:var(--fds-radius-full);-webkit-background-clip:padding-box;background-clip:padding-box;}.e10c6rk9::-webkit-input-placeholder{color:var(--fds-colour-text-subtler);}.e10c6rk9::-moz-placeholder{color:var(--fds-colour-text-subtler);}.e10c6rk9:-ms-input-placeholder{color:var(--fds-colour-text-subtler);}.e10c6rk9::placeholder{color:var(--fds-colour-text-subtler);}
3
+ .e1kovz0t{border-color:transparent;background:transparent!important;padding:var(--fds-spacing-12) 0;}.e1kovz0t:focus,.e1kovz0t:active{outline-color:var(--fds-colour-border-focus);}
4
+ .e9uwuyt{background:var(--fds-colour-bg-disabled);cursor:not-allowed;}.e9uwuyt:focus,.e9uwuyt:active{outline-color:var(--fds-colour-border-disabled);}
5
+ .etmlvbn{border-color:var(--fds-colour-border-error);}.etmlvbn:focus,.etmlvbn:active{outline-color:var(--fds-colour-border-error-focus);}
@@ -1,2 +1,2 @@
1
- import"../shared/dropdown-list/dropdown-list.styles_1kt4zhf.css";import"./dropdown-panel.styles_1z0n7qq.css";const d={width:"--fds-internal-languageSwitcher-dropdown-width"},s="dbl9jc4",t="dogrnw8",o="d4xkcjy",n="ddiq5up";export{o as dropdownItem,n as dropdownItemSelected,t as dropdownList,s as dropdownPanel,d as tokens};
1
+ import"../shared/dropdown-list/dropdown-list.styles_konwm.css";import"./dropdown-panel.styles_1qsjf8d.css";const d={width:"--fds-internal-languageSwitcher-dropdown-width"},s="dbl9jc4",o="dogrnw8",t="d4xkcjy",n="ddiq5up";export{t as dropdownItem,n as dropdownItemSelected,o as dropdownList,s as dropdownPanel,d as tokens};
2
2
  //# sourceMappingURL=dropdown-panel.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-panel.styles.js","sources":["../../src/language-switcher/dropdown-panel.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Border, Colour, Font, Radius, Spacing } from \"../theme\";\n\nexport const tokens = {\n width: \"--fds-internal-languageSwitcher-dropdown-width\",\n} as const;\n\nexport const dropdownPanel = css`\n ${tokens.width}: initial;\n\n width: var(${tokens.width});\n border-radius: ${Radius[\"sm\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n background: ${Colour[\"bg\"]};\n overflow: hidden;\n`;\n\nexport const dropdownList = css`\n list-style: none;\n margin: 0;\n padding: ${Spacing[\"spacing-8\"]};\n`;\n\nexport {\n baseIndicatorStyle,\n selectedIndicator,\n} from \"../shared/dropdown-list/dropdown-list.styles\";\n\nexport const dropdownItem = css`\n align-items: center;\n ${Font[\"body-md-regular\"]}\n color: ${Colour[\"text\"]};\n\n &:hover {\n background: ${Colour[\"bg-hover-subtle\"]};\n }\n`;\n\nexport const dropdownItemSelected = css`\n background: transparent;\n color: ${Colour[\"text-selected\"]};\n\n &:hover {\n background: ${Colour[\"bg-hover\"]};\n }\n`;\n"],"names":["tokens","width","dropdownPanel","dropdownList","dropdownItem","dropdownItemSelected"],"mappings":"4JAIO,MAAMA,EAAS,CAClBC,MAAO,kDAGEC,EAAa,UAUbC,EAAY,UAWZC,EAAY,UAUZC,EAAoB"}
1
+ {"version":3,"file":"dropdown-panel.styles.js","sources":["../../src/language-switcher/dropdown-panel.styles.ts"],"sourcesContent":["import { css } from \"@linaria/core\";\n\nimport { Border, Colour, Font, Radius, Spacing } from \"../theme\";\n\nexport const tokens = {\n width: \"--fds-internal-languageSwitcher-dropdown-width\",\n} as const;\n\nexport const dropdownPanel = css`\n ${tokens.width}: initial;\n\n width: var(${tokens.width});\n border-radius: ${Radius[\"sm\"]};\n border: ${Border[\"width-010\"]} ${Border[\"solid\"]} ${Colour[\"border\"]};\n background: ${Colour[\"bg\"]};\n overflow: hidden;\n`;\n\nexport const dropdownList = css`\n list-style: none;\n margin: 0;\n padding: ${Spacing[\"spacing-8\"]};\n`;\n\nexport {\n baseIndicatorStyle,\n selectedIndicator,\n} from \"../shared/dropdown-list/dropdown-list.styles\";\n\nexport const dropdownItem = css`\n align-items: center;\n ${Font[\"body-md-regular\"]}\n color: ${Colour[\"text\"]};\n\n &:hover {\n background: ${Colour[\"bg-hover-subtle\"]};\n }\n`;\n\nexport const dropdownItemSelected = css`\n background: transparent;\n color: ${Colour[\"text-selected\"]};\n\n &:hover {\n background: ${Colour[\"bg-hover\"]};\n }\n`;\n"],"names":["tokens","width","dropdownPanel","dropdownList","dropdownItem","dropdownItemSelected"],"mappings":"0JAIO,MAAMA,EAAS,CAClBC,MAAO,kDAGEC,EAAa,UAUbC,EAAY,UAWZC,EAAY,UAUZC,EAAoB"}
@@ -1,4 +1,4 @@
1
1
  .dbl9jc4{--fds-internal-languageSwitcher-dropdown-width:initial;width:var(--fds-internal-languageSwitcher-dropdown-width);border-radius:var(--fds-radius-sm);border:var(--fds-border-width-010) var(--fds-border-style-solid) var(--fds-colour-border);background:var(--fds-colour-bg);overflow:hidden;}
2
2
  .dogrnw8{list-style:none;margin:0;padding:var(--fds-spacing-8);}
3
- .d4xkcjy{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-family:var(--fds-font-family);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-md);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-md);letter-spacing:var(--fds-font-body-ls-md);color:var(--fds-colour-text);}.d4xkcjy:hover{background:var(--fds-colour-bg-hover-subtle);}
3
+ .d4xkcjy{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-family:var(--fds-font-family-body);font-variant:var(--fds-font-variant);font-size:var(--fds-font-body-size-md);font-weight:var(--fds-font-weight-regular);line-height:var(--fds-font-body-lh-md);letter-spacing:var(--fds-font-body-ls-md);color:var(--fds-colour-text);}.d4xkcjy:hover{background:var(--fds-colour-bg-hover-subtle);}
4
4
  .ddiq5up{background:transparent;color:var(--fds-colour-text-selected);}.ddiq5up:hover{background:var(--fds-colour-bg-hover);}
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"../_virtual/_tslib.js";import{jsx as r,jsxs as t}from"react/jsx-runtime";import{LanguageIcon as o}from"@lifesg/react-icons/language";import{useState as s,useRef as i,useEffect as a}from"react";import"clsx";import"../theme/theme-provider/index.js";import"../theme/theme-provider/context.js";import"../theme/tokens/border.js";import"../theme/tokens/colour.js";import"../theme/tokens/font.js";import"../theme/tokens/media-query.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import{useId as n}from"../util/simple-id-generator.js";import"../util/string-helper.js";import"@react-aria/live-announcer";import"../theme/utils/use-media-query.js";import"../shared/dropdown-list/dropdown-label.styles_1dwmd8f.css";import"../shared/dropdown-list/dropdown-list.js";import"../shared/dropdown-list/dropdown-list-state.js";import{ExpandableElement as l}from"../shared/dropdown-list/expandable-element.js";import"@lifesg/react-icons/caret-right";import"@lifesg/react-icons/exclamation-circle-fill";import"@lifesg/react-icons/minus-square-fill";import"@lifesg/react-icons/square";import"@lifesg/react-icons/square-tick-fill";import"@lifesg/react-icons/tick";import"react-virtuoso";import"../markup/markup.js";import"../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css";import{ElementWithDropdown as d}from"../shared/dropdown-wrapper/element-with-dropdown.js";import"../shared/input-wrapper/input-wrapper.js";import"../shared/dropdown-list/dropdown-list.styles_1kt4zhf.css";import"../shared/dropdown-list/dropdown-search.js";import"../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css";import"immer";import"../external/lodash/_getTag.js";import"../external/lodash/isArguments.js";import"../external/lodash/_baseGetTag.js";import"../external/lodash/isBuffer.js";import"../external/lodash/isTypedArray.js";import"../external/lodash/_Stack.js";import"../external/lodash/_SetCache.js";import"../external/lodash/_equalByTag.js";import"../shared/dropdown-list/virtuoso-components.js";import{LANGUAGE_CODES as p,LANGUAGE_DISPLAY_MAP as m,ARIA_LABEL as c}from"./data.js";import{DropdownPanel as u}from"./dropdown-panel.js";import{expandableElement as h,languageIconWrapper as f}from"./dropdown-variant.styles.js";const g=g=>{var{selectedLanguage:j,onSelectLanguage:w,testId:v}=g,x=e(g,["selectedLanguage","onSelectLanguage","testId"]);const[_,b]=s(!1),[k,y]=s(-1),A=i(null),I=i([]),T=`listbox-${n()}`;a((()=>{if(_){const e=p.indexOf(j),r=e>=0?e:0;y(r),setTimeout((()=>{var e;null===(e=I.current[r])||void 0===e||e.focus()}),0)}else y(-1)}),[_,j]);const D=e=>{var r;w(e),b(!1),null===(r=A.current)||void 0===r||r.focus()},q=e=>{var r,t,o,s;switch(e.key){case"ArrowDown":{e.preventDefault();const t=Math.min(k+1,p.length-1);y(t),null===(r=I.current[t])||void 0===r||r.focus();break}case"ArrowUp":{e.preventDefault();const r=Math.max(k-1,0);y(r),null===(t=I.current[r])||void 0===t||t.focus();break}case"Home":e.preventDefault(),y(0),null===(o=I.current[0])||void 0===o||o.focus();break;case"End":{e.preventDefault();const r=p.length-1;y(r),null===(s=I.current[r])||void 0===s||s.focus();break}case"Enter":case" ":e.preventDefault(),k>=0&&D(p[k])}};return r("div",Object.assign({"data-testid":v},x,{children:r(d,{enabled:!0,isOpen:_,renderElement:()=>t(l,{ref:A,className:h,disabled:!1,expanded:_,listboxId:T,popupRole:"listbox",readOnly:!1,"aria-label":`${c}, ${m[j]}`,"data-testid":`${v}--trigger`,children:[r("span",{className:f,"aria-hidden":!0,children:r(o,{})}),m[j]]}),renderDropdown:()=>r(u,{focusedIndex:k,handleItemSelect:D,handleListKeyDown:q,itemRefs:I,listboxId:T,selectedLanguage:j,testId:v}),onOpen:()=>{b(!0)},onClose:()=>{b(!1)},onDismiss:()=>{var e;b(!1),null===(e=A.current)||void 0===e||e.focus()},clickToToggle:!0,offset:8})}))};export{g as DropdownVariant};
1
+ import{__rest as e}from"../_virtual/_tslib.js";import{jsx as r,jsxs as t}from"react/jsx-runtime";import{LanguageIcon as o}from"@lifesg/react-icons/language";import{useState as s,useRef as i,useEffect as n}from"react";import"clsx";import"../theme/theme-provider/index.js";import"../theme/theme-provider/context.js";import"../theme/tokens/border.js";import"../theme/tokens/colour.js";import"../theme/tokens/font.js";import"../theme/tokens/media-query.js";import"../util/calendar-helper.js";import"../external/dayjs/dayjs.min.js";import{useId as a}from"../util/simple-id-generator.js";import"../util/string-helper.js";import"@react-aria/live-announcer";import"../theme/utils/use-media-query.js";import"../shared/dropdown-list/dropdown-label.styles_mloii0.css";import"../shared/dropdown-list/dropdown-list.js";import"../shared/dropdown-list/dropdown-list-state.js";import{ExpandableElement as l}from"../shared/dropdown-list/expandable-element.js";import"@lifesg/react-icons/caret-right";import"@lifesg/react-icons/exclamation-circle-fill";import"@lifesg/react-icons/minus-square-fill";import"@lifesg/react-icons/square";import"@lifesg/react-icons/square-tick-fill";import"@lifesg/react-icons/tick";import"react-virtuoso";import"../markup/markup.js";import"../shared/component-loading-spinner/component-loading-spinner.styles_15eq02i.css";import{ElementWithDropdown as d}from"../shared/dropdown-wrapper/element-with-dropdown.js";import"../shared/input-wrapper/input-wrapper.js";import"../shared/dropdown-list/dropdown-list.styles_konwm.css";import"../shared/dropdown-list/dropdown-search.js";import"../shared/dropdown-list/nested-dropdown-list.styles_wdhxoe.css";import"immer";import"../external/lodash/_getTag.js";import"../external/lodash/isArguments.js";import"../external/lodash/_baseGetTag.js";import"../external/lodash/isBuffer.js";import"../external/lodash/isTypedArray.js";import"../external/lodash/_Stack.js";import"../external/lodash/_SetCache.js";import"../external/lodash/_equalByTag.js";import"../shared/dropdown-list/virtuoso-components.js";import{LANGUAGE_CODES as p,LANGUAGE_DISPLAY_MAP as m,ARIA_LABEL as c}from"./data.js";import{DropdownPanel as u}from"./dropdown-panel.js";import{expandableElement as h,languageIconWrapper as f}from"./dropdown-variant.styles.js";const g=g=>{var{selectedLanguage:j,onSelectLanguage:w,testId:v}=g,x=e(g,["selectedLanguage","onSelectLanguage","testId"]);const[_,b]=s(!1),[k,y]=s(-1),A=i(null),I=i([]),T=`listbox-${a()}`;n((()=>{if(_){const e=p.indexOf(j),r=e>=0?e:0;y(r),setTimeout((()=>{var e;null===(e=I.current[r])||void 0===e||e.focus()}),0)}else y(-1)}),[_,j]);const D=e=>{var r;w(e),b(!1),null===(r=A.current)||void 0===r||r.focus()},q=e=>{var r,t,o,s;switch(e.key){case"ArrowDown":{e.preventDefault();const t=Math.min(k+1,p.length-1);y(t),null===(r=I.current[t])||void 0===r||r.focus();break}case"ArrowUp":{e.preventDefault();const r=Math.max(k-1,0);y(r),null===(t=I.current[r])||void 0===t||t.focus();break}case"Home":e.preventDefault(),y(0),null===(o=I.current[0])||void 0===o||o.focus();break;case"End":{e.preventDefault();const r=p.length-1;y(r),null===(s=I.current[r])||void 0===s||s.focus();break}case"Enter":case" ":e.preventDefault(),k>=0&&D(p[k])}};return r("div",Object.assign({"data-testid":v},x,{children:r(d,{enabled:!0,isOpen:_,renderElement:()=>t(l,{ref:A,className:h,disabled:!1,expanded:_,listboxId:T,popupRole:"listbox",readOnly:!1,"aria-label":`${c}, ${m[j]}`,"data-testid":`${v}--trigger`,children:[r("span",{className:f,"aria-hidden":!0,children:r(o,{})}),m[j]]}),renderDropdown:()=>r(u,{focusedIndex:k,handleItemSelect:D,handleListKeyDown:q,itemRefs:I,listboxId:T,selectedLanguage:j,testId:v}),onOpen:()=>{b(!0)},onClose:()=>{b(!1)},onDismiss:()=>{var e;b(!1),null===(e=A.current)||void 0===e||e.focus()},clickToToggle:!0,offset:8})}))};export{g as DropdownVariant};
2
2
  //# sourceMappingURL=dropdown-variant.js.map