@lifesg/react-design-system 4.0.0-alpha.5 → 4.0.0-alpha.6

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 (445) hide show
  1. package/accordion/types.d.ts +1 -1
  2. package/breadcrumb/breadcrumb.d.ts +7 -0
  3. package/breadcrumb/breadcrumb.js.map +1 -1
  4. package/breadcrumb/types.d.ts +31 -0
  5. package/button/button.d.ts +1 -0
  6. package/button/button.js.map +1 -1
  7. package/button/types.d.ts +42 -9
  8. package/calendar/calendar.d.ts +3 -0
  9. package/calendar/calendar.js.map +1 -1
  10. package/calendar/types.d.ts +43 -7
  11. package/card/card.d.ts +1 -0
  12. package/card/card.js.map +1 -1
  13. package/card/types.d.ts +1 -0
  14. package/checkbox/checkbox.d.ts +3 -0
  15. package/checkbox/checkbox.js.map +1 -1
  16. package/checkbox/types.d.ts +19 -3
  17. package/cjs/breadcrumb/breadcrumb.js.map +1 -1
  18. package/cjs/button/button.js.map +1 -1
  19. package/cjs/calendar/calendar.js.map +1 -1
  20. package/cjs/card/card.js.map +1 -1
  21. package/cjs/checkbox/checkbox.js.map +1 -1
  22. package/cjs/data-table/data-table.js +1 -1
  23. package/cjs/data-table/data-table.js.map +1 -1
  24. package/cjs/data-table/data-table.styles.js +1 -1
  25. package/cjs/data-table/data-table.styles.js.map +1 -1
  26. package/cjs/data-table/data-table.styles_rxganh.css +27 -0
  27. package/cjs/external/dompurify/dist/purify.es.js +2 -2
  28. package/cjs/external/dompurify/dist/purify.es.js.map +1 -1
  29. package/cjs/external/lodash/_setCacheHas.js.map +1 -1
  30. package/cjs/external/lodash/lodash.js +1 -1
  31. package/cjs/external/lodash/lodash.js.map +1 -1
  32. package/cjs/form/form-label-addon.js +1 -1
  33. package/cjs/form/form-label-addon.js.map +1 -1
  34. package/cjs/form/index.js +1 -1
  35. package/cjs/form/index.js.map +1 -1
  36. package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
  37. package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
  38. package/cjs/histogram-slider/histogram-slider.js.map +1 -1
  39. package/cjs/image-button/image-button.js.map +1 -1
  40. package/cjs/index.js +1 -1
  41. package/cjs/input/input.js.map +1 -1
  42. package/cjs/input-group/input-group.js.map +1 -1
  43. package/cjs/input-multi-select/input-multi-select.js.map +1 -1
  44. package/cjs/input-nested-multi-select/input-nested-multi-select.js.map +1 -1
  45. package/cjs/input-nested-select/input-nested-select.js.map +1 -1
  46. package/cjs/input-range-select/input-range-select.js.map +1 -1
  47. package/cjs/input-range-slider/input-range-slider.js.map +1 -1
  48. package/cjs/input-select/input-select.js.map +1 -1
  49. package/cjs/input-slider/input-slider.js.map +1 -1
  50. package/cjs/input-textarea/textarea.js.map +1 -1
  51. package/cjs/language-switcher/language-switcher.js.map +1 -1
  52. package/cjs/layout/index.js +1 -1
  53. package/cjs/layout/index.js.map +1 -1
  54. package/cjs/link-list/link-list.js.map +1 -1
  55. package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.js.map +1 -1
  56. package/cjs/local-nav/local-nav-menu/local-nav-menu.js.map +1 -1
  57. package/cjs/markup/markup.js.map +1 -1
  58. package/cjs/masked-input/masked-input.js.map +1 -1
  59. package/cjs/masthead/masthead.js.map +1 -1
  60. package/cjs/menu/menu.js +1 -1
  61. package/cjs/menu/menu.js.map +1 -1
  62. package/cjs/modal/index.js.map +1 -1
  63. package/cjs/modal/modal-box.js +1 -1
  64. package/cjs/modal/modal-box.js.map +1 -1
  65. package/cjs/modal-v2/index.js +1 -1
  66. package/cjs/modal-v2/index.js.map +1 -1
  67. package/cjs/modal-v2/modal-v2.js +1 -1
  68. package/cjs/modal-v2/modal-v2.js.map +1 -1
  69. package/cjs/modal-v2/slots/card.js +1 -1
  70. package/cjs/modal-v2/slots/card.js.map +1 -1
  71. package/cjs/navbar/navbar.js.map +1 -1
  72. package/cjs/notification-banner/notification-banner-hoc.js.map +1 -1
  73. package/cjs/notification-banner/notification-banner.js.map +1 -1
  74. package/cjs/otp-input/otp-input.js.map +1 -1
  75. package/cjs/otp-verification/otp-verification.js.map +1 -1
  76. package/cjs/overlay/overlay.js.map +1 -1
  77. package/cjs/pagination/pagination.js.map +1 -1
  78. package/cjs/phone-number-input/phone-number-input.js.map +1 -1
  79. package/cjs/pill/pill.js.map +1 -1
  80. package/cjs/popover/popover-inline/popover-inline.js.map +1 -1
  81. package/cjs/popover/popover-trigger.js.map +1 -1
  82. package/cjs/popover/popover.js +1 -1
  83. package/cjs/popover/popover.js.map +1 -1
  84. package/cjs/predictive-text-input/predictive-text-input.js.map +1 -1
  85. package/cjs/progress-indicator/progress-indicator.js.map +1 -1
  86. package/cjs/radio-button/radio-button.js.map +1 -1
  87. package/cjs/schedule/schedule.js.map +1 -1
  88. package/cjs/schedule/shared/with-optional-popover.js +1 -1
  89. package/cjs/schedule/shared/with-optional-popover.js.map +1 -1
  90. package/cjs/select-histogram/select-histogram.js.map +1 -1
  91. package/cjs/sidenav/sidenav.js.map +1 -1
  92. package/cjs/singpass-button/singpass-button.js.map +1 -1
  93. package/cjs/smart-app-banner/smart-app-banner.js.map +1 -1
  94. package/cjs/tab/tab.js.map +1 -1
  95. package/cjs/table/table.js.map +1 -1
  96. package/cjs/table/table.styles.js +1 -1
  97. package/cjs/table/table.styles.js.map +1 -1
  98. package/{table/table.styles_1af5ipv.css → cjs/table/table.styles_1vjx31g.css} +1 -1
  99. package/cjs/tag/tag.js.map +1 -1
  100. package/cjs/text-list/index.js.map +1 -1
  101. package/cjs/theme/theme-provider/breakpoint.js +1 -1
  102. package/cjs/theme/theme-provider/breakpoint.js.map +1 -1
  103. package/cjs/theme/theme-provider/hooks.js.map +1 -1
  104. package/cjs/theme/theme-provider/index.js.map +1 -1
  105. package/cjs/theme/tokens/border.js.map +1 -1
  106. package/cjs/theme/tokens/breakpoint.js.map +1 -1
  107. package/cjs/theme/tokens/colour.js.map +1 -1
  108. package/cjs/theme/tokens/component.js.map +1 -1
  109. package/cjs/theme/tokens/font.js.map +1 -1
  110. package/cjs/theme/tokens/media-query.js.map +1 -1
  111. package/cjs/theme/tokens/motion.js.map +1 -1
  112. package/cjs/theme/tokens/radius.js.map +1 -1
  113. package/cjs/theme/tokens/shadow.js.map +1 -1
  114. package/cjs/theme/tokens/spacing.js.map +1 -1
  115. package/cjs/theme/types.js.map +1 -1
  116. package/cjs/theme/utils/css-variable.js.map +1 -1
  117. package/cjs/theme/utils/font.js.map +1 -1
  118. package/cjs/theme/utils/use-apply-styles.js +1 -1
  119. package/cjs/theme/utils/use-apply-styles.js.map +1 -1
  120. package/cjs/theme/utils/use-design-token-override.js.map +1 -1
  121. package/cjs/theme/utils/use-design-token.js.map +1 -1
  122. package/cjs/theme/utils/use-media-query.js.map +1 -1
  123. package/cjs/time-range-picker/combobox-picker/combobox-picker.js +1 -1
  124. package/cjs/time-range-picker/combobox-picker/combobox-picker.js.map +1 -1
  125. package/cjs/time-range-picker/common.styles.js +1 -1
  126. package/cjs/time-range-picker/common.styles.js.map +1 -1
  127. package/{time-range-picker/common.styles_1qwp4xa.css → cjs/time-range-picker/common.styles_cnkkax.css} +2 -1
  128. package/cjs/time-range-picker/dial-picker/dial-picker.js +1 -1
  129. package/cjs/time-range-picker/dial-picker/dial-picker.js.map +1 -1
  130. package/cjs/time-range-picker/time-range-picker.js.map +1 -1
  131. package/cjs/time-slot-bar/time-slot-bar.js.map +1 -1
  132. package/cjs/time-slot-bar-week/time-slot-bar-week.js.map +1 -1
  133. package/cjs/time-slot-week-view/time-slot-week-view.js.map +1 -1
  134. package/cjs/timeline/timeline.js.map +1 -1
  135. package/cjs/timepicker/timepicker.js +1 -1
  136. package/cjs/timepicker/timepicker.js.map +1 -1
  137. package/cjs/timepicker/timepicker.styles.js +1 -1
  138. package/cjs/timepicker/timepicker.styles.js.map +1 -1
  139. package/cjs/timepicker/timepicker.styles_lyizvq.css +2 -0
  140. package/cjs/timetable/timetable-row/with-optional-popover.js +1 -1
  141. package/cjs/timetable/timetable-row/with-optional-popover.js.map +1 -1
  142. package/cjs/timetable/timetable.js +1 -1
  143. package/cjs/timetable/timetable.js.map +1 -1
  144. package/cjs/toast/toast.js.map +1 -1
  145. package/cjs/toggle/toggle.js.map +1 -1
  146. package/cjs/typography/index.js.map +1 -1
  147. package/cjs/uneditable-section/index.js.map +1 -1
  148. package/cjs/unit-number/unit-number-input.js.map +1 -1
  149. package/cjs/util/merge-refs.js.map +1 -1
  150. package/cjs/util/use-throttle.js +2 -0
  151. package/cjs/util/use-throttle.js.map +1 -0
  152. package/countdown-timer/types.d.ts +3 -3
  153. package/data-table/data-table.js +1 -1
  154. package/data-table/data-table.js.map +1 -1
  155. package/data-table/data-table.styles.d.ts +2 -1
  156. package/data-table/data-table.styles.js +1 -1
  157. package/data-table/data-table.styles.js.map +1 -1
  158. package/data-table/data-table.styles_rxganh.css +27 -0
  159. package/date-range-input/types.d.ts +1 -1
  160. package/drawer/types.d.ts +1 -1
  161. package/e-signature/types.d.ts +1 -1
  162. package/external/dompurify/dist/purify.es.js +2 -2
  163. package/external/dompurify/dist/purify.es.js.map +1 -1
  164. package/external/lodash/_setCacheHas.js.map +1 -1
  165. package/external/lodash/lodash.js +1 -1
  166. package/external/lodash/lodash.js.map +1 -1
  167. package/file-upload/types.d.ts +0 -1
  168. package/filter/types.d.ts +6 -10
  169. package/form/form-label-addon.js +1 -1
  170. package/form/form-label-addon.js.map +1 -1
  171. package/form/index.d.ts +65 -8
  172. package/form/index.js +1 -1
  173. package/form/index.js.map +1 -1
  174. package/form/types.d.ts +155 -6
  175. package/fullscreen-image-carousel/fullscreen-image-carousel.d.ts +7 -0
  176. package/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
  177. package/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
  178. package/fullscreen-image-carousel/types.d.ts +91 -3
  179. package/histogram-slider/histogram-slider.d.ts +6 -0
  180. package/histogram-slider/histogram-slider.js.map +1 -1
  181. package/histogram-slider/types.d.ts +63 -3
  182. package/image-button/image-button.d.ts +6 -0
  183. package/image-button/image-button.js.map +1 -1
  184. package/image-button/types.d.ts +11 -1
  185. package/index.js +1 -1
  186. package/input/input.d.ts +6 -0
  187. package/input/input.js.map +1 -1
  188. package/input/types.d.ts +38 -2
  189. package/input-group/input-group.d.ts +7 -0
  190. package/input-group/input-group.js.map +1 -1
  191. package/input-group/types.d.ts +84 -8
  192. package/input-multi-select/input-multi-select.d.ts +6 -0
  193. package/input-multi-select/input-multi-select.js.map +1 -1
  194. package/input-multi-select/types.d.ts +46 -5
  195. package/input-nested-multi-select/input-nested-multi-select.d.ts +8 -0
  196. package/input-nested-multi-select/input-nested-multi-select.js.map +1 -1
  197. package/input-nested-multi-select/types.d.ts +35 -5
  198. package/input-nested-select/input-nested-select.d.ts +9 -2
  199. package/input-nested-select/input-nested-select.js.map +1 -1
  200. package/input-nested-select/types.d.ts +77 -8
  201. package/input-range-select/input-range-select.d.ts +6 -0
  202. package/input-range-select/input-range-select.js.map +1 -1
  203. package/input-range-select/types.d.ts +68 -1
  204. package/input-range-slider/input-range-slider.d.ts +7 -0
  205. package/input-range-slider/input-range-slider.js.map +1 -1
  206. package/input-range-slider/types.d.ts +91 -6
  207. package/input-select/input-select.d.ts +5 -0
  208. package/input-select/input-select.js.map +1 -1
  209. package/input-select/types.d.ts +70 -14
  210. package/input-slider/input-slider.d.ts +6 -0
  211. package/input-slider/input-slider.js.map +1 -1
  212. package/input-slider/types.d.ts +21 -2
  213. package/input-textarea/textarea.d.ts +3 -0
  214. package/input-textarea/textarea.js.map +1 -1
  215. package/input-textarea/types.d.ts +24 -1
  216. package/language-switcher/language-switcher.d.ts +6 -0
  217. package/language-switcher/language-switcher.js.map +1 -1
  218. package/language-switcher/types.d.ts +23 -0
  219. package/layout/index.d.ts +16 -2
  220. package/layout/index.js +1 -1
  221. package/layout/index.js.map +1 -1
  222. package/layout/types.d.ts +61 -3
  223. package/link-list/internal-types.d.ts +57 -3
  224. package/link-list/link-list.d.ts +6 -0
  225. package/link-list/link-list.js.map +1 -1
  226. package/link-list/types.d.ts +3 -0
  227. package/local-nav/local-nav-dropdown/local-nav-dropdown.d.ts +11 -0
  228. package/local-nav/local-nav-dropdown/local-nav-dropdown.js.map +1 -1
  229. package/local-nav/local-nav-menu/local-nav-menu.d.ts +6 -0
  230. package/local-nav/local-nav-menu/local-nav-menu.js.map +1 -1
  231. package/local-nav/types.d.ts +51 -0
  232. package/markup/markup.d.ts +6 -0
  233. package/markup/markup.js.map +1 -1
  234. package/markup/types.d.ts +6 -2
  235. package/masked-input/masked-input.d.ts +6 -0
  236. package/masked-input/masked-input.js.map +1 -1
  237. package/masked-input/types.d.ts +83 -8
  238. package/masthead/masthead.d.ts +6 -0
  239. package/masthead/masthead.js.map +1 -1
  240. package/masthead/types.d.ts +9 -0
  241. package/menu/menu.d.ts +27 -4
  242. package/menu/menu.js +1 -1
  243. package/menu/menu.js.map +1 -1
  244. package/menu/types.d.ts +32 -0
  245. package/modal/index.d.ts +13 -0
  246. package/modal/index.js.map +1 -1
  247. package/modal/modal-box.js +1 -1
  248. package/modal/modal-box.js.map +1 -1
  249. package/modal/types.d.ts +54 -7
  250. package/modal-v2/index.d.ts +1 -15
  251. package/modal-v2/index.js +1 -1
  252. package/modal-v2/index.js.map +1 -1
  253. package/modal-v2/modal-v2.d.ts +32 -1
  254. package/modal-v2/modal-v2.js +1 -1
  255. package/modal-v2/modal-v2.js.map +1 -1
  256. package/modal-v2/slots/card.js +1 -1
  257. package/modal-v2/slots/card.js.map +1 -1
  258. package/modal-v2/types.d.ts +75 -8
  259. package/navbar/navbar.d.ts +7 -0
  260. package/navbar/navbar.js.map +1 -1
  261. package/navbar/types.d.ts +200 -13
  262. package/notification-banner/notification-banner-hoc.d.ts +6 -0
  263. package/notification-banner/notification-banner-hoc.js.map +1 -1
  264. package/notification-banner/notification-banner.d.ts +7 -0
  265. package/notification-banner/notification-banner.js.map +1 -1
  266. package/notification-banner/types.d.ts +57 -2
  267. package/otp-input/otp-input.d.ts +7 -0
  268. package/otp-input/otp-input.js.map +1 -1
  269. package/otp-input/types.d.ts +54 -11
  270. package/otp-verification/internal-types.d.ts +22 -5
  271. package/otp-verification/otp-verification.d.ts +6 -0
  272. package/otp-verification/otp-verification.js.map +1 -1
  273. package/otp-verification/types.d.ts +125 -6
  274. package/overlay/overlay.d.ts +7 -0
  275. package/overlay/overlay.js.map +1 -1
  276. package/overlay/types.d.ts +57 -2
  277. package/package.json +1 -1
  278. package/pagination/pagination.d.ts +5 -0
  279. package/pagination/pagination.js.map +1 -1
  280. package/pagination/types.d.ts +48 -0
  281. package/phone-number-input/phone-number-input.d.ts +7 -0
  282. package/phone-number-input/phone-number-input.js.map +1 -1
  283. package/phone-number-input/types.d.ts +78 -13
  284. package/pill/pill.d.ts +6 -0
  285. package/pill/pill.js.map +1 -1
  286. package/pill/types.d.ts +19 -0
  287. package/popover/popover-inline/popover-inline.d.ts +5 -0
  288. package/popover/popover-inline/popover-inline.js.map +1 -1
  289. package/popover/popover-trigger.d.ts +6 -0
  290. package/popover/popover-trigger.js.map +1 -1
  291. package/popover/popover.d.ts +6 -0
  292. package/popover/popover.js +1 -1
  293. package/popover/popover.js.map +1 -1
  294. package/popover/types.d.ts +150 -3
  295. package/predictive-text-input/predictive-text-input.d.ts +6 -0
  296. package/predictive-text-input/predictive-text-input.js.map +1 -1
  297. package/predictive-text-input/types.d.ts +65 -11
  298. package/progress-indicator/progress-indicator.d.ts +7 -0
  299. package/progress-indicator/progress-indicator.js.map +1 -1
  300. package/progress-indicator/types.d.ts +18 -0
  301. package/radio-button/radio-button.d.ts +5 -0
  302. package/radio-button/radio-button.js.map +1 -1
  303. package/radio-button/types.d.ts +11 -0
  304. package/schedule/internal-types.d.ts +18 -0
  305. package/schedule/schedule-day-view/types.d.ts +2 -1
  306. package/schedule/schedule-week-view/types.d.ts +2 -1
  307. package/schedule/schedule.d.ts +3 -0
  308. package/schedule/schedule.js.map +1 -1
  309. package/schedule/shared/with-optional-popover.js +1 -1
  310. package/schedule/shared/with-optional-popover.js.map +1 -1
  311. package/schedule/types.d.ts +129 -10
  312. package/select-histogram/select-histogram.d.ts +5 -0
  313. package/select-histogram/select-histogram.js.map +1 -1
  314. package/select-histogram/types.d.ts +57 -4
  315. package/shared/dropdown-list/types.d.ts +52 -19
  316. package/shared/dropdown-wrapper/types.d.ts +6 -0
  317. package/sidenav/sidenav.d.ts +10 -0
  318. package/sidenav/sidenav.js.map +1 -1
  319. package/sidenav/types.d.ts +70 -21
  320. package/singpass-button/singpass-button.d.ts +6 -0
  321. package/singpass-button/singpass-button.js.map +1 -1
  322. package/singpass-button/types.d.ts +29 -2
  323. package/smart-app-banner/smart-app-banner.d.ts +5 -0
  324. package/smart-app-banner/smart-app-banner.js.map +1 -1
  325. package/smart-app-banner/types.d.ts +54 -0
  326. package/tab/tab.d.ts +7 -0
  327. package/tab/tab.js.map +1 -1
  328. package/tab/types.d.ts +55 -6
  329. package/table/table.d.ts +21 -0
  330. package/table/table.js.map +1 -1
  331. package/table/table.styles.js +1 -1
  332. package/table/table.styles.js.map +1 -1
  333. package/{cjs/table/table.styles_1af5ipv.css → table/table.styles_1vjx31g.css} +1 -1
  334. package/tag/tag.d.ts +5 -0
  335. package/tag/tag.js.map +1 -1
  336. package/tag/types.d.ts +24 -0
  337. package/text-list/index.d.ts +17 -0
  338. package/text-list/index.js.map +1 -1
  339. package/text-list/types.d.ts +33 -4
  340. package/theme/theme-provider/breakpoint.d.ts +0 -1
  341. package/theme/theme-provider/breakpoint.js +1 -1
  342. package/theme/theme-provider/breakpoint.js.map +1 -1
  343. package/theme/theme-provider/hooks.d.ts +16 -0
  344. package/theme/theme-provider/hooks.js.map +1 -1
  345. package/theme/theme-provider/index.d.ts +7 -0
  346. package/theme/theme-provider/index.js.map +1 -1
  347. package/theme/theme-provider/types.d.ts +14 -0
  348. package/theme/tokens/border.d.ts +3 -0
  349. package/theme/tokens/border.js.map +1 -1
  350. package/theme/tokens/breakpoint.d.ts +3 -0
  351. package/theme/tokens/breakpoint.js.map +1 -1
  352. package/theme/tokens/colour.d.ts +3 -0
  353. package/theme/tokens/colour.js.map +1 -1
  354. package/theme/tokens/component.d.ts +1 -0
  355. package/theme/tokens/component.js.map +1 -1
  356. package/theme/tokens/font.d.ts +2 -0
  357. package/theme/tokens/font.js.map +1 -1
  358. package/theme/tokens/media-query.d.ts +1 -0
  359. package/theme/tokens/media-query.js.map +1 -1
  360. package/theme/tokens/motion.d.ts +1 -0
  361. package/theme/tokens/motion.js.map +1 -1
  362. package/theme/tokens/radius.d.ts +1 -0
  363. package/theme/tokens/radius.js.map +1 -1
  364. package/theme/tokens/shadow.d.ts +1 -0
  365. package/theme/tokens/shadow.js.map +1 -1
  366. package/theme/tokens/spacing.d.ts +1 -0
  367. package/theme/tokens/spacing.js.map +1 -1
  368. package/theme/types.d.ts +23 -3
  369. package/theme/types.js.map +1 -1
  370. package/theme/utils/css-variable.d.ts +10 -2
  371. package/theme/utils/css-variable.js.map +1 -1
  372. package/theme/utils/font.d.ts +2 -1
  373. package/theme/utils/font.js.map +1 -1
  374. package/theme/utils/use-apply-styles.d.ts +8 -2
  375. package/theme/utils/use-apply-styles.js +1 -1
  376. package/theme/utils/use-apply-styles.js.map +1 -1
  377. package/theme/utils/use-design-token-override.d.ts +9 -1
  378. package/theme/utils/use-design-token-override.js.map +1 -1
  379. package/theme/utils/use-design-token.d.ts +9 -0
  380. package/theme/utils/use-design-token.js.map +1 -1
  381. package/theme/utils/use-media-query.d.ts +41 -3
  382. package/theme/utils/use-media-query.js.map +1 -1
  383. package/time-range-picker/combobox-picker/combobox-picker.js +1 -1
  384. package/time-range-picker/combobox-picker/combobox-picker.js.map +1 -1
  385. package/time-range-picker/common.styles.d.ts +1 -0
  386. package/time-range-picker/common.styles.js +1 -1
  387. package/time-range-picker/common.styles.js.map +1 -1
  388. package/{cjs/time-range-picker/common.styles_1qwp4xa.css → time-range-picker/common.styles_cnkkax.css} +2 -1
  389. package/time-range-picker/dial-picker/dial-picker.js +1 -1
  390. package/time-range-picker/dial-picker/dial-picker.js.map +1 -1
  391. package/time-range-picker/time-range-picker.d.ts +5 -0
  392. package/time-range-picker/time-range-picker.js.map +1 -1
  393. package/time-range-picker/types.d.ts +85 -25
  394. package/time-slot-bar/internal-types.d.ts +1 -0
  395. package/time-slot-bar/time-slot-bar.d.ts +7 -0
  396. package/time-slot-bar/time-slot-bar.js.map +1 -1
  397. package/time-slot-bar/types.d.ts +112 -20
  398. package/time-slot-bar-week/time-slot-bar-week.d.ts +8 -0
  399. package/time-slot-bar-week/time-slot-bar-week.js.map +1 -1
  400. package/time-slot-bar-week/types.d.ts +74 -13
  401. package/time-slot-week-view/time-slot-week-view.d.ts +7 -0
  402. package/time-slot-week-view/time-slot-week-view.js.map +1 -1
  403. package/time-slot-week-view/types.d.ts +53 -10
  404. package/timeline/timeline.d.ts +6 -0
  405. package/timeline/timeline.js.map +1 -1
  406. package/timeline/types.d.ts +58 -4
  407. package/timepicker/timepicker.d.ts +5 -0
  408. package/timepicker/timepicker.js +1 -1
  409. package/timepicker/timepicker.js.map +1 -1
  410. package/timepicker/timepicker.styles.d.ts +1 -0
  411. package/timepicker/timepicker.styles.js +1 -1
  412. package/timepicker/timepicker.styles.js.map +1 -1
  413. package/timepicker/timepicker.styles_lyizvq.css +2 -0
  414. package/timepicker/types.d.ts +49 -14
  415. package/timetable/timetable-row/with-optional-popover.js +1 -1
  416. package/timetable/timetable-row/with-optional-popover.js.map +1 -1
  417. package/timetable/timetable.d.ts +6 -0
  418. package/timetable/timetable.js +1 -1
  419. package/timetable/timetable.js.map +1 -1
  420. package/timetable/types.d.ts +175 -50
  421. package/toast/toast.d.ts +6 -0
  422. package/toast/toast.js.map +1 -1
  423. package/toast/types.d.ts +42 -8
  424. package/toggle/toggle.d.ts +6 -0
  425. package/toggle/toggle.js.map +1 -1
  426. package/toggle/types.d.ts +95 -17
  427. package/typography/index.d.ts +29 -0
  428. package/typography/index.js.map +1 -1
  429. package/typography/types.d.ts +51 -8
  430. package/uneditable-section/index.d.ts +15 -0
  431. package/uneditable-section/index.js.map +1 -1
  432. package/uneditable-section/types.d.ts +66 -23
  433. package/unit-number/types.d.ts +30 -4
  434. package/unit-number/unit-number-input.d.ts +6 -0
  435. package/unit-number/unit-number-input.js.map +1 -1
  436. package/util/index.d.ts +1 -0
  437. package/util/merge-refs.d.ts +1 -1
  438. package/util/merge-refs.js.map +1 -1
  439. package/util/use-throttle.d.ts +1 -0
  440. package/util/use-throttle.js +2 -0
  441. package/util/use-throttle.js.map +1 -0
  442. package/cjs/data-table/data-table.styles_1iqq1g7.css +0 -26
  443. package/cjs/timepicker/timepicker.styles_1jm33yw.css +0 -1
  444. package/data-table/data-table.styles_1iqq1g7.css +0 -26
  445. package/timepicker/timepicker.styles_1jm33yw.css +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"progress-indicator.js","sources":["../../src/progress-indicator/progress-indicator.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport kebabCase from \"lodash/kebabCase\";\n\nimport { VisuallyHidden } from \"../shared/accessibility\";\nimport { useMaxWidthMediaQuery } from \"../theme\";\nimport { Typography } from \"../typography\";\nimport * as styles from \"./progress-indicator.styles\";\nimport type { ProgressIndicatorProps } from \"./types\";\n\nexport const ProgressIndicator = <T,>({\n steps,\n currentIndex,\n displayExtractor,\n className,\n ...otherProps\n}: ProgressIndicatorProps<T>) => {\n // =============================================================================\n // CONST, STATE, REFS\n // =============================================================================\n const isTablet = useMaxWidthMediaQuery(\"lg\");\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const getDisplayValue = (item: T): string => {\n if (displayExtractor) {\n return displayExtractor(item);\n }\n return item?.toString() ?? \"\";\n };\n\n const getStepAriaLabel = (stepIndex: number, currentIndex: number) => {\n if (stepIndex < currentIndex) {\n return \"Completed step\";\n } else if (stepIndex === currentIndex) {\n return \"Current step\";\n } else {\n return \"Upcoming step\";\n }\n };\n\n const getId = (stepIndex: number, currentIndex: number) => {\n return kebabCase(\n `${getStepAriaLabel(stepIndex, currentIndex)} ${stepIndex}`\n );\n };\n\n // =============================================================================\n // RENDER\n // =============================================================================\n if (!steps.length) return null;\n\n const renderBars = () => {\n return steps.map((step: T, stepIndex: number) => {\n // previous and current index elements are highlighted\n const highlighted = stepIndex <= currentIndex;\n\n return (\n <div\n key={stepIndex}\n id={getId(stepIndex, currentIndex)}\n className={styles.indicator}\n >\n <div\n className={clsx(\n styles.indicatorBar,\n highlighted && styles.indicatorBarHighlighted\n )}\n />\n </div>\n );\n });\n };\n\n const renderStepTitleDesktop = () => {\n return steps.map((step: T, stepIndex: number) => {\n const highlighted = stepIndex <= currentIndex;\n const current = stepIndex === currentIndex;\n const fontWeight = current ? \"bold\" : \"regular\";\n\n return (\n <div\n key={stepIndex}\n id={`${getId(stepIndex, currentIndex)}-title`}\n className={styles.indicator}\n >\n <Typography.BodyMD\n className={clsx(\n styles.indicatorTitleDesktop,\n highlighted &&\n styles.indicatorTitleDesktopHighlighted\n )}\n weight={fontWeight}\n aria-current={current}\n >\n {getDisplayValue(step)}\n <VisuallyHidden>\n {getStepAriaLabel(stepIndex, currentIndex)}\n </VisuallyHidden>\n </Typography.BodyMD>\n </div>\n );\n });\n };\n\n const renderStepTitleTablet = () => {\n return (\n <div\n key={currentIndex}\n id={getId(currentIndex, currentIndex)}\n className={styles.indicator}\n >\n <Typography.BodyMD\n className={styles.indicatorTitleTablet}\n weight={\"semibold\"}\n id={`${getId(currentIndex, currentIndex)}-counter`}\n >\n Step {currentIndex + 1} of {steps.length}\n </Typography.BodyMD>\n <Typography.BodyMD\n className={styles.indicatorTitleTablet}\n weight={\"regular\"}\n id={`${getId(currentIndex, currentIndex)}-title`}\n >\n {getDisplayValue(steps[currentIndex])}\n </Typography.BodyMD>\n </div>\n );\n };\n\n return (\n <div className={clsx(styles.wrapper, className)} {...otherProps}>\n <div className={styles.content}>{renderBars()}</div>\n <div className={styles.content}>\n {isTablet ? renderStepTitleTablet() : renderStepTitleDesktop()}\n </div>\n </div>\n );\n};\n"],"names":["ProgressIndicator","_a","steps","currentIndex","displayExtractor","className","otherProps","__rest","isTablet","useMaxWidthMediaQuery","getDisplayValue","item","toString","getStepAriaLabel","stepIndex","getId","kebabCase","length","_jsxs","clsx","styles.wrapper","children","_jsx","styles.content","map","step","highlighted","id","styles.indicator","styles.indicatorBar","styles.indicatorBarHighlighted","Typography","BodyMD","styles.indicatorTitleTablet","weight","current","fontWeight","styles.indicatorTitleDesktop","styles.indicatorTitleDesktopHighlighted","VisuallyHidden"],"mappings":"q+BASO,MAAMA,EAAyBC,IAAA,IAAAC,MAClCA,EAAKC,aACLA,EAAYC,iBACZA,EAAgBC,UAChBA,GAASJ,EACNK,EAAUC,EAAAN,EALqB,CAAA,QAAA,eAAA,mBAAA,cAUlC,MAAMO,EAAWC,EAAsB,MAajCC,EAAmBC,UACrB,OAAIP,EACOA,EAAiBO,GAEL,QAAhBV,EAAAU,aAAI,EAAJA,EAAMC,kBAAU,IAAAX,EAAAA,EAAI,EAAE,EAG3BY,EAAmB,CAACC,EAAmBX,IACrCW,EAAYX,EACL,iBACAW,IAAcX,EACd,eAEA,gBAITY,EAAQ,CAACD,EAAmBX,IACvBa,EACH,GAAGH,EAAiBC,EAAWX,MAAiBW,KAOxD,IAAKZ,EAAMe,OAAQ,OAAO,KAgF1B,OACIC,uBAAKb,UAAWc,EAAKC,EAAgBf,IAAgBC,EAAU,CAAAe,SAAA,CAC3DC,EAAA,MAAA,CAAKjB,UAAWkB,EAAcF,SA/E3BnB,EAAMsB,KAAI,CAACC,EAASX,KAEvB,MAAMY,EAAcZ,GAAaX,EAEjC,OACImB,EAAA,MAAA,CAEIK,GAAIZ,EAAMD,EAAWX,GACrBE,UAAWuB,EAAgBP,SAE3BC,EAAA,MAAA,CACIjB,UAAWc,EACPU,EACAH,GAAeI,MAPlBhB,EAUH,MAgEVQ,SAAKjB,UAAWkB,EAAcF,SACzBb,EA3BLU,EAAA,MAAA,CAEIS,GAAIZ,EAAMZ,EAAcA,GACxBE,UAAWuB,EAAgBP,SAAA,CAE3BH,EAACa,EAAWC,QACR3B,UAAW4B,EACXC,OAAQ,WACRP,GAAI,GAAGZ,EAAMZ,EAAcA,+BAErBA,EAAe,EAAC,OAAMD,EAAMe,UAEtCK,EAACS,EAAWC,QACR3B,UAAW4B,EACXC,OAAQ,UACRP,GAAI,GAAGZ,EAAMZ,EAAcA,oBAE1BO,EAAgBR,EAAMC,QAhBtBA,GAjCND,EAAMsB,KAAI,CAACC,EAASX,KACvB,MAAMY,EAAcZ,GAAaX,EAC3BgC,EAAUrB,IAAcX,EACxBiC,EAAaD,EAAU,OAAS,UAEtC,OACIb,EAAA,MAAA,CAEIK,GAAI,GAAGZ,EAAMD,EAAWX,WACxBE,UAAWuB,EAAgBP,SAE3BH,EAACa,EAAWC,OAAM,CACd3B,UAAWc,EACPkB,EACAX,GACIY,GAERJ,OAAQE,EAAU,eACJD,EAAOd,SAAA,CAEpBX,EAAgBe,GACjBH,EAACiB,EAAc,CAAAlB,SACVR,EAAiBC,EAAWX,SAfhCW,EAkBH,SAoCR"}
1
+ {"version":3,"file":"progress-indicator.js","sources":["../../src/progress-indicator/progress-indicator.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport kebabCase from \"lodash/kebabCase\";\n\nimport { VisuallyHidden } from \"../shared/accessibility\";\nimport { useMaxWidthMediaQuery } from \"../theme\";\nimport { Typography } from \"../typography\";\nimport * as styles from \"./progress-indicator.styles\";\nimport type { ProgressIndicatorProps } from \"./types\";\n\n/**\n * A horizontal step-progress bar that tracks a user's position through a\n * multi-step flow.\n *\n * Use `ProgressIndicator` when you need to communicate progress through an\n * ordered sequence of steps.\n */\nexport const ProgressIndicator = <T,>({\n steps,\n currentIndex,\n displayExtractor,\n className,\n ...otherProps\n}: ProgressIndicatorProps<T>) => {\n // =============================================================================\n // CONST, STATE, REFS\n // =============================================================================\n const isTablet = useMaxWidthMediaQuery(\"lg\");\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const getDisplayValue = (item: T): string => {\n if (displayExtractor) {\n return displayExtractor(item);\n }\n return item?.toString() ?? \"\";\n };\n\n const getStepAriaLabel = (stepIndex: number, currentIndex: number) => {\n if (stepIndex < currentIndex) {\n return \"Completed step\";\n } else if (stepIndex === currentIndex) {\n return \"Current step\";\n } else {\n return \"Upcoming step\";\n }\n };\n\n const getId = (stepIndex: number, currentIndex: number) => {\n return kebabCase(\n `${getStepAriaLabel(stepIndex, currentIndex)} ${stepIndex}`\n );\n };\n\n // =============================================================================\n // RENDER\n // =============================================================================\n if (!steps.length) return null;\n\n const renderBars = () => {\n return steps.map((step: T, stepIndex: number) => {\n // previous and current index elements are highlighted\n const highlighted = stepIndex <= currentIndex;\n\n return (\n <div\n key={stepIndex}\n id={getId(stepIndex, currentIndex)}\n className={styles.indicator}\n >\n <div\n className={clsx(\n styles.indicatorBar,\n highlighted && styles.indicatorBarHighlighted\n )}\n />\n </div>\n );\n });\n };\n\n const renderStepTitleDesktop = () => {\n return steps.map((step: T, stepIndex: number) => {\n const highlighted = stepIndex <= currentIndex;\n const current = stepIndex === currentIndex;\n const fontWeight = current ? \"bold\" : \"regular\";\n\n return (\n <div\n key={stepIndex}\n id={`${getId(stepIndex, currentIndex)}-title`}\n className={styles.indicator}\n >\n <Typography.BodyMD\n className={clsx(\n styles.indicatorTitleDesktop,\n highlighted &&\n styles.indicatorTitleDesktopHighlighted\n )}\n weight={fontWeight}\n aria-current={current}\n >\n {getDisplayValue(step)}\n <VisuallyHidden>\n {getStepAriaLabel(stepIndex, currentIndex)}\n </VisuallyHidden>\n </Typography.BodyMD>\n </div>\n );\n });\n };\n\n const renderStepTitleTablet = () => {\n return (\n <div\n key={currentIndex}\n id={getId(currentIndex, currentIndex)}\n className={styles.indicator}\n >\n <Typography.BodyMD\n className={styles.indicatorTitleTablet}\n weight={\"semibold\"}\n id={`${getId(currentIndex, currentIndex)}-counter`}\n >\n Step {currentIndex + 1} of {steps.length}\n </Typography.BodyMD>\n <Typography.BodyMD\n className={styles.indicatorTitleTablet}\n weight={\"regular\"}\n id={`${getId(currentIndex, currentIndex)}-title`}\n >\n {getDisplayValue(steps[currentIndex])}\n </Typography.BodyMD>\n </div>\n );\n };\n\n return (\n <div className={clsx(styles.wrapper, className)} {...otherProps}>\n <div className={styles.content}>{renderBars()}</div>\n <div className={styles.content}>\n {isTablet ? renderStepTitleTablet() : renderStepTitleDesktop()}\n </div>\n </div>\n );\n};\n"],"names":["ProgressIndicator","_a","steps","currentIndex","displayExtractor","className","otherProps","__rest","isTablet","useMaxWidthMediaQuery","getDisplayValue","item","toString","getStepAriaLabel","stepIndex","getId","kebabCase","length","_jsxs","clsx","styles.wrapper","children","_jsx","styles.content","map","step","highlighted","id","styles.indicator","styles.indicatorBar","styles.indicatorBarHighlighted","Typography","BodyMD","styles.indicatorTitleTablet","weight","current","fontWeight","styles.indicatorTitleDesktop","styles.indicatorTitleDesktopHighlighted","VisuallyHidden"],"mappings":"q+BAgBO,MAAMA,EAAyBC,IAAA,IAAAC,MAClCA,EAAKC,aACLA,EAAYC,iBACZA,EAAgBC,UAChBA,GAASJ,EACNK,EAAUC,EAAAN,EALqB,CAAA,QAAA,eAAA,mBAAA,cAUlC,MAAMO,EAAWC,EAAsB,MAajCC,EAAmBC,UACrB,OAAIP,EACOA,EAAiBO,GAEL,QAAhBV,EAAAU,aAAI,EAAJA,EAAMC,kBAAU,IAAAX,EAAAA,EAAI,EAAE,EAG3BY,EAAmB,CAACC,EAAmBX,IACrCW,EAAYX,EACL,iBACAW,IAAcX,EACd,eAEA,gBAITY,EAAQ,CAACD,EAAmBX,IACvBa,EACH,GAAGH,EAAiBC,EAAWX,MAAiBW,KAOxD,IAAKZ,EAAMe,OAAQ,OAAO,KAgF1B,OACIC,uBAAKb,UAAWc,EAAKC,EAAgBf,IAAgBC,EAAU,CAAAe,SAAA,CAC3DC,EAAA,MAAA,CAAKjB,UAAWkB,EAAcF,SA/E3BnB,EAAMsB,KAAI,CAACC,EAASX,KAEvB,MAAMY,EAAcZ,GAAaX,EAEjC,OACImB,EAAA,MAAA,CAEIK,GAAIZ,EAAMD,EAAWX,GACrBE,UAAWuB,EAAgBP,SAE3BC,EAAA,MAAA,CACIjB,UAAWc,EACPU,EACAH,GAAeI,MAPlBhB,EAUH,MAgEVQ,SAAKjB,UAAWkB,EAAcF,SACzBb,EA3BLU,EAAA,MAAA,CAEIS,GAAIZ,EAAMZ,EAAcA,GACxBE,UAAWuB,EAAgBP,SAAA,CAE3BH,EAACa,EAAWC,QACR3B,UAAW4B,EACXC,OAAQ,WACRP,GAAI,GAAGZ,EAAMZ,EAAcA,+BAErBA,EAAe,EAAC,OAAMD,EAAMe,UAEtCK,EAACS,EAAWC,QACR3B,UAAW4B,EACXC,OAAQ,UACRP,GAAI,GAAGZ,EAAMZ,EAAcA,oBAE1BO,EAAgBR,EAAMC,QAhBtBA,GAjCND,EAAMsB,KAAI,CAACC,EAASX,KACvB,MAAMY,EAAcZ,GAAaX,EAC3BgC,EAAUrB,IAAcX,EACxBiC,EAAaD,EAAU,OAAS,UAEtC,OACIb,EAAA,MAAA,CAEIK,GAAI,GAAGZ,EAAMD,EAAWX,WACxBE,UAAWuB,EAAgBP,SAE3BH,EAACa,EAAWC,OAAM,CACd3B,UAAWc,EACPkB,EACAX,GACIY,GAERJ,OAAQE,EAAU,eACJD,EAAOd,SAAA,CAEpBX,EAAgBe,GACjBH,EAACiB,EAAc,CAAAlB,SACVR,EAAiBC,EAAWX,SAfhCW,EAkBH,SAoCR"}
@@ -1,6 +1,24 @@
1
+ /**
2
+ * Props for the `ProgressIndicator` component.
3
+ *
4
+ * The type parameter `T` represents the shape of each step item in the
5
+ * `steps` array.
6
+ */
1
7
  export interface ProgressIndicatorProps<T> {
8
+ /**
9
+ * Ordered list of step items to render as progress bars and labels.
10
+ */
2
11
  steps: T[];
12
+ /**
13
+ * Zero-based index of the current active step.
14
+ * All steps at or before this index are visually highlighted.
15
+ */
3
16
  currentIndex: number;
17
+ /**
18
+ * Derives the display label for a step item.
19
+ *
20
+ * @remarks Falls back to `item.toString()` when omitted.
21
+ */
4
22
  displayExtractor?: ((item: T) => string) | undefined;
5
23
  className?: string | undefined;
6
24
  id?: string | undefined;
@@ -1,2 +1,7 @@
1
1
  import type { RadioButtonProps } from "./types";
2
+ /**
3
+ * A single radio button input.
4
+ *
5
+ * Use `RadioButton` as an input within a radio group.
6
+ */
2
7
  export declare const RadioButton: ({ className, checked, disabled, displaySize, focusableWhenDisabled, onChange, tabIndex, ...otherProps }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"radio-button.js","sources":["../../src/radio-button/radio-button.tsx"],"sourcesContent":["import { CircleDotIcon, CircleIcon } from \"@lifesg/react-icons\";\nimport clsx from \"clsx\";\nimport type { ChangeEvent } from \"react\";\n\nimport * as styles from \"./radio-button.styles\";\nimport type { RadioButtonProps } from \"./types\";\n\nexport const RadioButton = ({\n className,\n checked,\n disabled,\n displaySize = \"default\",\n focusableWhenDisabled,\n onChange,\n tabIndex,\n ...otherProps\n}: RadioButtonProps) => {\n // =============================================================================\n // CONST\n // =============================================================================\n const isFocusableWhenDisabled = !!disabled && !!focusableWhenDisabled;\n const isNativeDisabled = !!disabled && !focusableWhenDisabled;\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleOnChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n onChange?.(event);\n };\n\n // =============================================================================\n // RENDER FUNCTION\n // =============================================================================\n const renderIcon = () => {\n return checked ? (\n <CircleDotIcon\n data-testid=\"radio-checked\"\n className={clsx(\n styles.icon,\n disabled ? styles.checkedIconDisabled : styles.checkedIcon\n )}\n aria-hidden\n />\n ) : (\n <CircleIcon\n data-testid=\"radio-unchecked\"\n className={clsx(\n styles.icon,\n disabled\n ? styles.uncheckedIconDisabled\n : styles.uncheckedIcon\n )}\n aria-hidden\n />\n );\n };\n\n return (\n <div\n className={clsx(styles.container, className)}\n data-display-size={displaySize}\n data-testid=\"radio-button\"\n >\n <input\n type=\"radio\"\n data-testid=\"radio-input\"\n onChange={handleOnChange}\n checked={checked}\n disabled={isNativeDisabled}\n aria-disabled={isFocusableWhenDisabled}\n tabIndex={isFocusableWhenDisabled ? 0 : tabIndex}\n className={clsx(styles.input, !disabled && styles.inputActive)}\n {...otherProps}\n />\n {renderIcon()}\n </div>\n );\n};\n"],"names":["RadioButton","_a","className","checked","disabled","displaySize","focusableWhenDisabled","onChange","tabIndex","otherProps","__rest","isFocusableWhenDisabled","isNativeDisabled","_jsxs","clsx","styles.container","children","_jsx","Object","assign","type","event","preventDefault","styles.input","styles.inputActive","CircleDotIcon","styles.icon","styles.checkedIconDisabled","styles.checkedIcon","CircleIcon","styles.uncheckedIconDisabled","styles.uncheckedIcon"],"mappings":"4WAOO,MAAMA,EAAeC,QAAAC,UACxBA,EAASC,QACTA,EAAOC,SACPA,EAAQC,YACRA,EAAc,UAASC,sBACvBA,EAAqBC,SACrBA,EAAQC,SACRA,GAAQP,EACLQ,EAAUC,EAAAT,EARW,gGAaxB,MAAMU,IAA4BP,KAAcE,EAC1CM,IAAqBR,IAAaE,EAyCxC,OACIO,EAAA,MAAA,CACIX,UAAWY,EAAKC,EAAkBb,GAAU,oBACzBG,gBACP,eAAcW,SAAA,CAE1BC,EAAA,QAAAC,OAAAC,OAAA,CACIC,KAAK,QAAO,cACA,cACZb,SA7CYc,IAChBjB,EACAiB,EAAMC,iBAIVf,SAAAA,EAAWc,EAAM,EAwCTlB,QAASA,EACTC,SAAUQ,EAAgB,gBACXD,EACfH,SAAUG,EAA0B,EAAIH,EACxCN,UAAWY,EAAKS,GAAenB,GAAYoB,IACvCf,IAtCLN,EACHc,EAACQ,EAAa,CAAA,cACE,gBACZvB,UAAWY,EACPY,EACAtB,EAAWuB,EAA6BC,sBAKhDX,EAACY,EAAU,CAAA,cACK,kBACZ3B,UAAWY,EACPY,EACAtB,EACM0B,EACAC,GACT,eAAA,MAwBH"}
1
+ {"version":3,"file":"radio-button.js","sources":["../../src/radio-button/radio-button.tsx"],"sourcesContent":["import { CircleDotIcon, CircleIcon } from \"@lifesg/react-icons\";\nimport clsx from \"clsx\";\nimport type { ChangeEvent } from \"react\";\n\nimport * as styles from \"./radio-button.styles\";\nimport type { RadioButtonProps } from \"./types\";\n\n/**\n * A single radio button input.\n *\n * Use `RadioButton` as an input within a radio group.\n */\nexport const RadioButton = ({\n className,\n checked,\n disabled,\n displaySize = \"default\",\n focusableWhenDisabled,\n onChange,\n tabIndex,\n ...otherProps\n}: RadioButtonProps) => {\n // =============================================================================\n // CONST\n // =============================================================================\n const isFocusableWhenDisabled = !!disabled && !!focusableWhenDisabled;\n const isNativeDisabled = !!disabled && !focusableWhenDisabled;\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleOnChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n onChange?.(event);\n };\n\n // =============================================================================\n // RENDER FUNCTION\n // =============================================================================\n const renderIcon = () => {\n return checked ? (\n <CircleDotIcon\n data-testid=\"radio-checked\"\n className={clsx(\n styles.icon,\n disabled ? styles.checkedIconDisabled : styles.checkedIcon\n )}\n aria-hidden\n />\n ) : (\n <CircleIcon\n data-testid=\"radio-unchecked\"\n className={clsx(\n styles.icon,\n disabled\n ? styles.uncheckedIconDisabled\n : styles.uncheckedIcon\n )}\n aria-hidden\n />\n );\n };\n\n return (\n <div\n className={clsx(styles.container, className)}\n data-display-size={displaySize}\n data-testid=\"radio-button\"\n >\n <input\n type=\"radio\"\n data-testid=\"radio-input\"\n onChange={handleOnChange}\n checked={checked}\n disabled={isNativeDisabled}\n aria-disabled={isFocusableWhenDisabled}\n tabIndex={isFocusableWhenDisabled ? 0 : tabIndex}\n className={clsx(styles.input, !disabled && styles.inputActive)}\n {...otherProps}\n />\n {renderIcon()}\n </div>\n );\n};\n"],"names":["RadioButton","_a","className","checked","disabled","displaySize","focusableWhenDisabled","onChange","tabIndex","otherProps","__rest","isFocusableWhenDisabled","isNativeDisabled","_jsxs","clsx","styles.container","children","_jsx","Object","assign","type","event","preventDefault","styles.input","styles.inputActive","CircleDotIcon","styles.icon","styles.checkedIconDisabled","styles.checkedIcon","CircleIcon","styles.uncheckedIconDisabled","styles.uncheckedIcon"],"mappings":"4WAYO,MAAMA,EAAeC,QAAAC,UACxBA,EAASC,QACTA,EAAOC,SACPA,EAAQC,YACRA,EAAc,UAASC,sBACvBA,EAAqBC,SACrBA,EAAQC,SACRA,GAAQP,EACLQ,EAAUC,EAAAT,EARW,gGAaxB,MAAMU,IAA4BP,KAAcE,EAC1CM,IAAqBR,IAAaE,EAyCxC,OACIO,EAAA,MAAA,CACIX,UAAWY,EAAKC,EAAkBb,GAAU,oBACzBG,gBACP,eAAcW,SAAA,CAE1BC,EAAA,QAAAC,OAAAC,OAAA,CACIC,KAAK,QAAO,cACA,cACZb,SA7CYc,IAChBjB,EACAiB,EAAMC,iBAIVf,SAAAA,EAAWc,EAAM,EAwCTlB,QAASA,EACTC,SAAUQ,EAAgB,gBACXD,EACfH,SAAUG,EAA0B,EAAIH,EACxCN,UAAWY,EAAKS,GAAenB,GAAYoB,IACvCf,IAtCLN,EACHc,EAACQ,EAAa,CAAA,cACE,gBACZvB,UAAWY,EACPY,EACAtB,EAAWuB,EAA6BC,sBAKhDX,EAACY,EAAU,CAAA,cACK,kBACZ3B,UAAWY,EACPY,EACAtB,EACM0B,EACAC,GACT,eAAA,MAwBH"}
@@ -1,5 +1,16 @@
1
+ /** Visual size variant for the radio button. */
1
2
  export type RadioButtonSize = "small" | "default";
3
+ /** Props for the `RadioButton` component. */
2
4
  export interface RadioButtonProps extends React.InputHTMLAttributes<HTMLInputElement> {
5
+ /**
6
+ * Visual size of the radio button icon.
7
+ *
8
+ * @default "default"
9
+ */
3
10
  displaySize?: RadioButtonSize | undefined;
11
+ /**
12
+ * When `true` and `disabled` is also `true`, the radio button remains
13
+ * keyboard-focusable. `onChange` is still suppressed.
14
+ */
4
15
  focusableWhenDisabled?: boolean | undefined;
5
16
  }
@@ -0,0 +1,18 @@
1
+ import type { RefObject } from "react";
2
+ /** Shared props passed to the day-view and week-view sub-components. */
3
+ export interface CommonScheduleViewProps {
4
+ /** The currently displayed date in `YYYY-MM-DD` format. */
5
+ date: string;
6
+ /** Whether the schedule is in a loading state. */
7
+ loading: boolean;
8
+ /** Earliest visible time in `HH:mm` format. */
9
+ minTime: string;
10
+ /** Latest visible time in `HH:mm` format. */
11
+ maxTime: string;
12
+ /** Time in `HH:mm` format to scroll into view on mount. */
13
+ initialScrollTime?: string | undefined;
14
+ /** Ref to the scrollable container element. */
15
+ containerRef: RefObject<HTMLDivElement>;
16
+ /** Message displayed inside blocked time slots. */
17
+ blockedMessage?: string | undefined;
18
+ }
@@ -1,4 +1,5 @@
1
- import type { CommonScheduleViewProps, ScheduleEmptySlotProps, ScheduleEntityProps, SchedulePopoverProps } from "../types";
1
+ import type { CommonScheduleViewProps } from "../internal-types";
2
+ import type { ScheduleEmptySlotProps, ScheduleEntityProps, SchedulePopoverProps } from "../types";
2
3
  export interface ScheduleDayViewProps extends CommonScheduleViewProps {
3
4
  serviceData: ScheduleEntityProps[];
4
5
  isMobile: boolean;
@@ -1,4 +1,5 @@
1
- import type { CommonScheduleViewProps, ScheduleEntityProps, ScheduleSlotProps } from "../types";
1
+ import type { CommonScheduleViewProps } from "../internal-types";
2
+ import type { ScheduleEntityProps, ScheduleSlotProps } from "../types";
2
3
  export interface ScheduleWeekViewProps extends CommonScheduleViewProps {
3
4
  serviceData: ScheduleEntityProps[];
4
5
  onSlotClick?: (data: ScheduleSlotProps, e: React.MouseEvent) => void | undefined;
@@ -1,2 +1,5 @@
1
1
  import type { ScheduleProps } from "./types";
2
+ /**
3
+ * A grid visualisation of slot-based time availability for services across day and week views.
4
+ */
2
5
  export declare const Schedule: ({ id, className, view, date, serviceData, loading, minTime, maxTime, initialScrollTime, minDate, maxDate, emptyContentMessage, emptySlotPopover, onPreviousDayClick, onNextDayClick, onCalendarDateSelect, onTodayClick, onEmptySlotClick, blockedMessage, onClickHiddenSlots, "data-testid": testId, ...otherProps }: ScheduleProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.js","sources":["../../src/schedule/schedule.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { isEmpty } from \"lodash\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { ErrorDisplay } from \"../error-display\";\nimport { useMaxWidthMediaQuery } from \"../theme\";\nimport * as styles from \"./schedule.styles\";\nimport { ScheduleDayView } from \"./schedule-day-view/schedule-day-view\";\nimport { ScheduleHeader } from \"./schedule-header/schedule-header\";\nimport { ScheduleWeekView } from \"./schedule-week-view/schedule-week-view\";\nimport type { CommonScheduleViewProps, ScheduleProps } from \"./types\";\n\nexport const Schedule = ({\n id,\n className,\n view = \"day\",\n date,\n serviceData,\n loading = false,\n minTime = \"00:00\",\n maxTime = \"23:59\",\n initialScrollTime = minTime,\n minDate,\n maxDate,\n emptyContentMessage,\n emptySlotPopover,\n onPreviousDayClick,\n onNextDayClick,\n onCalendarDateSelect,\n onTodayClick,\n onEmptySlotClick,\n blockedMessage,\n onClickHiddenSlots,\n \"data-testid\": testId = \"schedule\",\n ...otherProps\n}: ScheduleProps) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [currentView, setCurrentView] = useState<\"day\" | \"week\">(view);\n const isSmallScreen = useMaxWidthMediaQuery(\"lg\");\n const effectiveView = isSmallScreen ? \"day\" : currentView;\n const contentContainerRef = useRef<HTMLDivElement>(null);\n const [visibleServiceIdx, setVisibleServiceIdx] = useState(0);\n const isEmptyContent = serviceData.length === 0 || isEmpty(serviceData);\n const filteredServiceData = useMemo(\n () =>\n serviceData.map((service) => ({\n ...service,\n slots: service.slots.filter((slot) => slot.date === date),\n })),\n [serviceData, date]\n );\n let visibleServiceData = filteredServiceData;\n if (isSmallScreen) {\n visibleServiceData =\n filteredServiceData.length > 0\n ? [filteredServiceData[visibleServiceIdx]]\n : [];\n }\n const showPrevArrow = isSmallScreen && visibleServiceIdx > 0;\n const showNextArrow =\n isSmallScreen && visibleServiceIdx < filteredServiceData.length - 1;\n\n useEffect(() => {\n setVisibleServiceIdx(0);\n }, [filteredServiceData]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleViewChange = (newView: \"day\" | \"week\") => {\n setCurrentView(newView);\n };\n\n const handleTodayClick = useCallback(() => {\n onTodayClick?.();\n }, [onTodayClick]);\n\n const handleNextService = useCallback(() => {\n if (!filteredServiceData) return;\n setVisibleServiceIdx((idx) =>\n idx < filteredServiceData.length - 1 ? idx + 1 : idx\n );\n }, [filteredServiceData]);\n\n const handlePrevService = useCallback(() => {\n setVisibleServiceIdx((idx) => (idx > 0 ? idx - 1 : idx));\n }, []);\n\n // =============================================================================\n // RENDER FUNCTION\n // =============================================================================\n\n const renderEmptyContent = () => (\n <div className={clsx(styles.emptyTableContainer, \"empty-container\")}>\n <ErrorDisplay\n className={styles.noResultsFound}\n type=\"no-item-found\"\n description={emptyContentMessage}\n />\n </div>\n );\n\n const commonScheduleViewProps: CommonScheduleViewProps = {\n date,\n loading,\n minTime,\n maxTime,\n initialScrollTime,\n containerRef: contentContainerRef,\n blockedMessage,\n };\n\n const renderScheduleView = () => (\n <div\n className={styles.scheduleBodyContainer}\n ref={contentContainerRef}\n data-id=\"schedule-container\"\n >\n {effectiveView === \"day\" ? (\n <ScheduleDayView\n {...commonScheduleViewProps}\n serviceData={visibleServiceData}\n emptySlotPopover={emptySlotPopover}\n isMobile={isSmallScreen}\n onNextService={handleNextService}\n onPrevService={handlePrevService}\n showPrevArrow={showPrevArrow}\n showNextArrow={showNextArrow}\n onEmptySlotClick={onEmptySlotClick}\n />\n ) : (\n <ScheduleWeekView\n {...commonScheduleViewProps}\n serviceData={serviceData}\n onClickHiddenSlots={onClickHiddenSlots}\n />\n )}\n </div>\n );\n\n return (\n <div\n id={id}\n className={clsx(\n styles.container,\n loading && styles.containerLoading,\n className\n )}\n data-testid={testId}\n {...otherProps}\n >\n <ScheduleHeader\n data-id=\"schedule-header\"\n date={date}\n view={effectiveView}\n minDate={minDate}\n maxDate={maxDate}\n onPreviousDayClick={onPreviousDayClick}\n onNextDayClick={onNextDayClick}\n onCalendarDateSelect={onCalendarDateSelect}\n onViewChange={handleViewChange}\n onTodayClick={handleTodayClick}\n />\n\n {isEmptyContent ? renderEmptyContent() : renderScheduleView()}\n </div>\n );\n};\n"],"names":["Schedule","_a","id","className","view","date","serviceData","loading","minTime","maxTime","initialScrollTime","minDate","maxDate","emptyContentMessage","emptySlotPopover","onPreviousDayClick","onNextDayClick","onCalendarDateSelect","onTodayClick","onEmptySlotClick","blockedMessage","onClickHiddenSlots","testId","otherProps","__rest","currentView","setCurrentView","useState","isSmallScreen","useMaxWidthMediaQuery","effectiveView","contentContainerRef","useRef","visibleServiceIdx","setVisibleServiceIdx","isEmptyContent","length","isEmpty","filteredServiceData","useMemo","map","service","slots","filter","slot","visibleServiceData","showPrevArrow","showNextArrow","useEffect","handleTodayClick","useCallback","handleNextService","idx","handlePrevService","commonScheduleViewProps","containerRef","_jsxs","Object","assign","clsx","styles.container","styles.containerLoading","children","_jsx","ScheduleHeader","onViewChange","newView","styles.emptyTableContainer","ErrorDisplay","styles.noResultsFound","type","description","styles.scheduleBodyContainer","ref","ScheduleDayView","isMobile","onNextService","onPrevService","ScheduleWeekView"],"mappings":"6oCAYO,MAAMA,EAAYC,IAAA,IAAAC,GACrBA,EAAEC,UACFA,EAASC,KACTA,EAAO,MAAKC,KACZA,EAAIC,YACJA,EAAWC,QACXA,GAAU,EAAKC,QACfA,EAAU,QAAOC,QACjBA,EAAU,QAAOC,kBACjBA,EAAoBF,EAAOG,QAC3BA,EAAOC,QACPA,EAAOC,oBACPA,EAAmBC,iBACnBA,EAAgBC,mBAChBA,EAAkBC,eAClBA,EAAcC,qBACdA,EAAoBC,aACpBA,EAAYC,iBACZA,EAAgBC,eAChBA,EAAcC,mBACdA,EACA,cAAeC,EAAS,YAAUrB,EAC/BsB,EAAUC,EAAAvB,EAtBQ,CAAA,KAAA,YAAA,OAAA,OAAA,cAAA,UAAA,UAAA,UAAA,oBAAA,UAAA,UAAA,sBAAA,mBAAA,qBAAA,iBAAA,uBAAA,eAAA,mBAAA,iBAAA,qBAAA,gBA2BrB,MAAOwB,EAAaC,GAAkBC,EAAyBvB,GACzDwB,EAAgBC,EAAsB,MACtCC,EAAgBF,EAAgB,MAAQH,EACxCM,EAAsBC,EAAuB,OAC5CC,EAAmBC,GAAwBP,EAAS,GACrDQ,EAAwC,IAAvB7B,EAAY8B,QAAgBC,EAAAA,QAAQ/B,GACrDgC,EAAsBC,GACxB,IACIjC,EAAYkC,KAAKC,kCACVA,GAAO,CACVC,MAAOD,EAAQC,MAAMC,QAAQC,GAASA,EAAKvC,OAASA,SAE5D,CAACC,EAAaD,IAElB,IAAIwC,EAAqBP,EACrBV,IACAiB,EACIP,EAAoBF,OAAS,EACvB,CAACE,EAAoBL,IACrB,IAEd,MAAMa,EAAgBlB,GAAiBK,EAAoB,EACrDc,GACFnB,GAAiBK,EAAoBK,EAAoBF,OAAS,EAEtEY,GAAU,KACNd,EAAqB,EAAE,GACxB,CAACI,IAKJ,MAIMW,GAAmBC,GAAY,KACjChC,SAAAA,GAAgB,GACjB,CAACA,IAEEiC,GAAoBD,GAAY,KAC7BZ,GACLJ,GAAsBkB,GAClBA,EAAMd,EAAoBF,OAAS,EAAIgB,EAAM,EAAIA,GACpD,GACF,CAACd,IAEEe,GAAoBH,GAAY,KAClChB,GAAsBkB,GAASA,EAAM,EAAIA,EAAM,EAAIA,GAAK,GACzD,IAgBGE,GAAmD,CACrDjD,OACAE,UACAC,UACAC,UACAC,oBACA6C,aAAcxB,EACdX,kBA+BJ,OACIoC,EAAA,MAAAC,OAAAC,OAAA,CACIxD,GAAIA,EACJC,UAAWwD,EACPC,EACArD,GAAWsD,EACX1D,GACH,cACYmB,GACTC,EAAU,CAAAuC,SAAA,CAEdC,EAACC,EAAc,CAAA,UACH,kBACR3D,KAAMA,EACND,KAAM0B,EACNnB,QAASA,EACTC,QAASA,EACTG,mBAAoBA,EACpBC,eAAgBA,EAChBC,qBAAsBA,EACtBgD,aA3FcC,IACtBxC,EAAewC,EAAQ,EA2FfhD,aAAc+B,KApEtBc,EAAA,MAuEK5B,EAvEL,CAAKhC,UAAWwD,EAAKQ,EAA4B,mBAAkBL,SAC/DC,EAACK,GACGjE,UAAWkE,EACXC,KAAK,gBACLC,YAAa1D,MAiBjBV,UAAWqE,EACXC,IAAK1C,EAAmB,UAChB,qBAAoB+B,SAET,QAAlBhC,EACGiC,EAACW,mBACOpB,GAAuB,CAC3BhD,YAAauC,EACb/B,iBAAkBA,EAClB6D,SAAU/C,EACVgD,cAAezB,GACf0B,cAAexB,GACfP,cAAeA,EACfC,cAAeA,GACf5B,iBAAkBA,KAGtB4C,EAACe,EAAgBrB,OAAAC,OAAA,CAAA,EACTJ,IACJhD,YAAaA,EACbe,mBAAoBA,UA+B1B"}
1
+ {"version":3,"file":"schedule.js","sources":["../../src/schedule/schedule.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { isEmpty } from \"lodash\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { ErrorDisplay } from \"../error-display\";\nimport { useMaxWidthMediaQuery } from \"../theme\";\nimport type { CommonScheduleViewProps } from \"./internal-types\";\nimport * as styles from \"./schedule.styles\";\nimport { ScheduleDayView } from \"./schedule-day-view/schedule-day-view\";\nimport { ScheduleHeader } from \"./schedule-header/schedule-header\";\nimport { ScheduleWeekView } from \"./schedule-week-view/schedule-week-view\";\nimport type { ScheduleProps } from \"./types\";\n\n/**\n * A grid visualisation of slot-based time availability for services across day and week views.\n */\nexport const Schedule = ({\n id,\n className,\n view = \"day\",\n date,\n serviceData,\n loading = false,\n minTime = \"00:00\",\n maxTime = \"23:59\",\n initialScrollTime = minTime,\n minDate,\n maxDate,\n emptyContentMessage,\n emptySlotPopover,\n onPreviousDayClick,\n onNextDayClick,\n onCalendarDateSelect,\n onTodayClick,\n onEmptySlotClick,\n blockedMessage,\n onClickHiddenSlots,\n \"data-testid\": testId = \"schedule\",\n ...otherProps\n}: ScheduleProps) => {\n // =============================================================================\n // CONST, STATE, REF\n // =============================================================================\n const [currentView, setCurrentView] = useState<\"day\" | \"week\">(view);\n const isSmallScreen = useMaxWidthMediaQuery(\"lg\");\n const effectiveView = isSmallScreen ? \"day\" : currentView;\n const contentContainerRef = useRef<HTMLDivElement>(null);\n const [visibleServiceIdx, setVisibleServiceIdx] = useState(0);\n const isEmptyContent = serviceData.length === 0 || isEmpty(serviceData);\n const filteredServiceData = useMemo(\n () =>\n serviceData.map((service) => ({\n ...service,\n slots: service.slots.filter((slot) => slot.date === date),\n })),\n [serviceData, date]\n );\n let visibleServiceData = filteredServiceData;\n if (isSmallScreen) {\n visibleServiceData =\n filteredServiceData.length > 0\n ? [filteredServiceData[visibleServiceIdx]]\n : [];\n }\n const showPrevArrow = isSmallScreen && visibleServiceIdx > 0;\n const showNextArrow =\n isSmallScreen && visibleServiceIdx < filteredServiceData.length - 1;\n\n useEffect(() => {\n setVisibleServiceIdx(0);\n }, [filteredServiceData]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleViewChange = (newView: \"day\" | \"week\") => {\n setCurrentView(newView);\n };\n\n const handleTodayClick = useCallback(() => {\n onTodayClick?.();\n }, [onTodayClick]);\n\n const handleNextService = useCallback(() => {\n if (!filteredServiceData) return;\n setVisibleServiceIdx((idx) =>\n idx < filteredServiceData.length - 1 ? idx + 1 : idx\n );\n }, [filteredServiceData]);\n\n const handlePrevService = useCallback(() => {\n setVisibleServiceIdx((idx) => (idx > 0 ? idx - 1 : idx));\n }, []);\n\n // =============================================================================\n // RENDER FUNCTION\n // =============================================================================\n\n const renderEmptyContent = () => (\n <div className={clsx(styles.emptyTableContainer, \"empty-container\")}>\n <ErrorDisplay\n className={styles.noResultsFound}\n type=\"no-item-found\"\n description={emptyContentMessage}\n />\n </div>\n );\n\n const commonScheduleViewProps: CommonScheduleViewProps = {\n date,\n loading,\n minTime,\n maxTime,\n initialScrollTime,\n containerRef: contentContainerRef,\n blockedMessage,\n };\n\n const renderScheduleView = () => (\n <div\n className={styles.scheduleBodyContainer}\n ref={contentContainerRef}\n data-id=\"schedule-container\"\n >\n {effectiveView === \"day\" ? (\n <ScheduleDayView\n {...commonScheduleViewProps}\n serviceData={visibleServiceData}\n emptySlotPopover={emptySlotPopover}\n isMobile={isSmallScreen}\n onNextService={handleNextService}\n onPrevService={handlePrevService}\n showPrevArrow={showPrevArrow}\n showNextArrow={showNextArrow}\n onEmptySlotClick={onEmptySlotClick}\n />\n ) : (\n <ScheduleWeekView\n {...commonScheduleViewProps}\n serviceData={serviceData}\n onClickHiddenSlots={onClickHiddenSlots}\n />\n )}\n </div>\n );\n\n return (\n <div\n id={id}\n className={clsx(\n styles.container,\n loading && styles.containerLoading,\n className\n )}\n data-testid={testId}\n {...otherProps}\n >\n <ScheduleHeader\n data-id=\"schedule-header\"\n date={date}\n view={effectiveView}\n minDate={minDate}\n maxDate={maxDate}\n onPreviousDayClick={onPreviousDayClick}\n onNextDayClick={onNextDayClick}\n onCalendarDateSelect={onCalendarDateSelect}\n onViewChange={handleViewChange}\n onTodayClick={handleTodayClick}\n />\n\n {isEmptyContent ? renderEmptyContent() : renderScheduleView()}\n </div>\n );\n};\n"],"names":["Schedule","_a","id","className","view","date","serviceData","loading","minTime","maxTime","initialScrollTime","minDate","maxDate","emptyContentMessage","emptySlotPopover","onPreviousDayClick","onNextDayClick","onCalendarDateSelect","onTodayClick","onEmptySlotClick","blockedMessage","onClickHiddenSlots","testId","otherProps","__rest","currentView","setCurrentView","useState","isSmallScreen","useMaxWidthMediaQuery","effectiveView","contentContainerRef","useRef","visibleServiceIdx","setVisibleServiceIdx","isEmptyContent","length","isEmpty","filteredServiceData","useMemo","map","service","slots","filter","slot","visibleServiceData","showPrevArrow","showNextArrow","useEffect","handleTodayClick","useCallback","handleNextService","idx","handlePrevService","commonScheduleViewProps","containerRef","_jsxs","Object","assign","clsx","styles.container","styles.containerLoading","children","_jsx","ScheduleHeader","onViewChange","newView","styles.emptyTableContainer","ErrorDisplay","styles.noResultsFound","type","description","styles.scheduleBodyContainer","ref","ScheduleDayView","isMobile","onNextService","onPrevService","ScheduleWeekView"],"mappings":"6oCAgBO,MAAMA,EAAYC,IAAA,IAAAC,GACrBA,EAAEC,UACFA,EAASC,KACTA,EAAO,MAAKC,KACZA,EAAIC,YACJA,EAAWC,QACXA,GAAU,EAAKC,QACfA,EAAU,QAAOC,QACjBA,EAAU,QAAOC,kBACjBA,EAAoBF,EAAOG,QAC3BA,EAAOC,QACPA,EAAOC,oBACPA,EAAmBC,iBACnBA,EAAgBC,mBAChBA,EAAkBC,eAClBA,EAAcC,qBACdA,EAAoBC,aACpBA,EAAYC,iBACZA,EAAgBC,eAChBA,EAAcC,mBACdA,EACA,cAAeC,EAAS,YAAUrB,EAC/BsB,EAAUC,EAAAvB,EAtBQ,CAAA,KAAA,YAAA,OAAA,OAAA,cAAA,UAAA,UAAA,UAAA,oBAAA,UAAA,UAAA,sBAAA,mBAAA,qBAAA,iBAAA,uBAAA,eAAA,mBAAA,iBAAA,qBAAA,gBA2BrB,MAAOwB,EAAaC,GAAkBC,EAAyBvB,GACzDwB,EAAgBC,EAAsB,MACtCC,EAAgBF,EAAgB,MAAQH,EACxCM,EAAsBC,EAAuB,OAC5CC,EAAmBC,GAAwBP,EAAS,GACrDQ,EAAwC,IAAvB7B,EAAY8B,QAAgBC,EAAAA,QAAQ/B,GACrDgC,EAAsBC,GACxB,IACIjC,EAAYkC,KAAKC,kCACVA,GAAO,CACVC,MAAOD,EAAQC,MAAMC,QAAQC,GAASA,EAAKvC,OAASA,SAE5D,CAACC,EAAaD,IAElB,IAAIwC,EAAqBP,EACrBV,IACAiB,EACIP,EAAoBF,OAAS,EACvB,CAACE,EAAoBL,IACrB,IAEd,MAAMa,EAAgBlB,GAAiBK,EAAoB,EACrDc,GACFnB,GAAiBK,EAAoBK,EAAoBF,OAAS,EAEtEY,GAAU,KACNd,EAAqB,EAAE,GACxB,CAACI,IAKJ,MAIMW,GAAmBC,GAAY,KACjChC,SAAAA,GAAgB,GACjB,CAACA,IAEEiC,GAAoBD,GAAY,KAC7BZ,GACLJ,GAAsBkB,GAClBA,EAAMd,EAAoBF,OAAS,EAAIgB,EAAM,EAAIA,GACpD,GACF,CAACd,IAEEe,GAAoBH,GAAY,KAClChB,GAAsBkB,GAASA,EAAM,EAAIA,EAAM,EAAIA,GAAK,GACzD,IAgBGE,GAAmD,CACrDjD,OACAE,UACAC,UACAC,UACAC,oBACA6C,aAAcxB,EACdX,kBA+BJ,OACIoC,EAAA,MAAAC,OAAAC,OAAA,CACIxD,GAAIA,EACJC,UAAWwD,EACPC,EACArD,GAAWsD,EACX1D,GACH,cACYmB,GACTC,EAAU,CAAAuC,SAAA,CAEdC,EAACC,EAAc,CAAA,UACH,kBACR3D,KAAMA,EACND,KAAM0B,EACNnB,QAASA,EACTC,QAASA,EACTG,mBAAoBA,EACpBC,eAAgBA,EAChBC,qBAAsBA,EACtBgD,aA3FcC,IACtBxC,EAAewC,EAAQ,EA2FfhD,aAAc+B,KApEtBc,EAAA,MAuEK5B,EAvEL,CAAKhC,UAAWwD,EAAKQ,EAA4B,mBAAkBL,SAC/DC,EAACK,GACGjE,UAAWkE,EACXC,KAAK,gBACLC,YAAa1D,MAiBjBV,UAAWqE,EACXC,IAAK1C,EAAmB,UAChB,qBAAoB+B,SAET,QAAlBhC,EACGiC,EAACW,mBACOpB,GAAuB,CAC3BhD,YAAauC,EACb/B,iBAAkBA,EAClB6D,SAAU/C,EACVgD,cAAezB,GACf0B,cAAexB,GACfP,cAAeA,EACfC,cAAeA,GACf5B,iBAAkBA,KAGtB4C,EAACe,EAAgBrB,OAAAC,OAAA,CAAA,EACTJ,IACJhD,YAAaA,EACbe,mBAAoBA,UA+B1B"}
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import"../../_virtual/_tslib.js";import"clsx";import"react";import"../../theme/theme-provider/context.js";import"../../typography/typography.js";import"../../card/card.styles_1gh9gs3.css";import"../../markup/markup.js";import"../../modal-v2/index.js";import"../../theme/theme-provider/index.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"../../util/simple-id-generator.js";import"../../util/string-helper.js";import"@react-aria/live-announcer";import"../../theme/utils/use-media-query.js";import"../../popover/popover.styles_ujnf0h.css";import{PopoverTrigger as e}from"../../popover/popover-trigger.js";import"../../popover/popover-inline/popover-inline.styles_bkopnt.css";import{popoverTrigger as o}from"./with-optional-popover.styles.js";const r=({containerRef:r,children:i,customPopover:p})=>{if(!p)return i;const s={position:"bottom-start",rootNode:r,customOffset:p.offset,children:i,trigger:p.trigger,delay:p.delay,popoverContent:p.content};return t(e,Object.assign({className:o,zIndex:2},s))};export{r as WithOptionalPopover};
1
+ import{jsx as t}from"react/jsx-runtime";import"../../_virtual/_tslib.js";import"clsx";import"react";import"../../theme/theme-provider/context.js";import"../../typography/typography.js";import"../../card/card.styles_1gh9gs3.css";import"../../markup/markup.js";import"../../modal-v2/modal-v2.js";import"../../theme/theme-provider/index.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"../../util/simple-id-generator.js";import"../../util/string-helper.js";import"@react-aria/live-announcer";import"../../theme/utils/use-media-query.js";import"../../popover/popover.styles_ujnf0h.css";import{PopoverTrigger as e}from"../../popover/popover-trigger.js";import"../../popover/popover-inline/popover-inline.styles_bkopnt.css";import{popoverTrigger as o}from"./with-optional-popover.styles.js";const r=({containerRef:r,children:i,customPopover:p})=>{if(!p)return i;const s={position:"bottom-start",rootNode:r,customOffset:p.offset,children:i,trigger:p.trigger,delay:p.delay,popoverContent:p.content};return t(e,Object.assign({className:o,zIndex:2},s))};export{r as WithOptionalPopover};
2
2
  //# sourceMappingURL=with-optional-popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"with-optional-popover.js","sources":["../../../src/schedule/shared/with-optional-popover.tsx"],"sourcesContent":["import type { RefObject } from \"react\";\n\nimport type { PopoverTriggerProps } from \"../../popover\";\nimport { PopoverTrigger } from \"../../popover\";\nimport type { SchedulePopoverProps } from \"../types\";\nimport * as styles from \"./with-optional-popover.styles\";\n\ninterface ConditionalCellWrapperProps {\n containerRef: RefObject<HTMLDivElement>;\n children: JSX.Element;\n customPopover?: SchedulePopoverProps;\n}\n\nexport const WithOptionalPopover = ({\n containerRef,\n children,\n customPopover,\n}: ConditionalCellWrapperProps) => {\n if (!customPopover) {\n return children;\n }\n\n const popoverTriggerProps: PopoverTriggerProps = {\n position: \"bottom-start\",\n rootNode: containerRef,\n customOffset: customPopover.offset,\n children: children,\n trigger: customPopover.trigger,\n delay: customPopover.delay,\n popoverContent: customPopover.content,\n };\n\n return (\n <PopoverTrigger\n className={styles.popoverTrigger}\n zIndex={2}\n {...popoverTriggerProps}\n />\n );\n};\n"],"names":["WithOptionalPopover","containerRef","children","customPopover","popoverTriggerProps","position","rootNode","customOffset","offset","trigger","delay","popoverContent","content","_jsx","PopoverTrigger","Object","assign","className","styles.popoverTrigger","zIndex"],"mappings":"g/BAaO,MAAMA,EAAsB,EAC/BC,eACAC,WACAC,oBAEA,IAAKA,EACD,OAAOD,EAGX,MAAME,EAA2C,CAC7CC,SAAU,eACVC,SAAUL,EACVM,aAAcJ,EAAcK,OAC5BN,SAAUA,EACVO,QAASN,EAAcM,QACvBC,MAAOP,EAAcO,MACrBC,eAAgBR,EAAcS,SAGlC,OACIC,EAACC,EAAcC,OAAAC,OAAA,CACXC,UAAWC,EACXC,OAAQ,GACJf,GACN"}
1
+ {"version":3,"file":"with-optional-popover.js","sources":["../../../src/schedule/shared/with-optional-popover.tsx"],"sourcesContent":["import type { RefObject } from \"react\";\n\nimport type { PopoverTriggerProps } from \"../../popover\";\nimport { PopoverTrigger } from \"../../popover\";\nimport type { SchedulePopoverProps } from \"../types\";\nimport * as styles from \"./with-optional-popover.styles\";\n\ninterface ConditionalCellWrapperProps {\n containerRef: RefObject<HTMLDivElement>;\n children: JSX.Element;\n customPopover?: SchedulePopoverProps;\n}\n\nexport const WithOptionalPopover = ({\n containerRef,\n children,\n customPopover,\n}: ConditionalCellWrapperProps) => {\n if (!customPopover) {\n return children;\n }\n\n const popoverTriggerProps: PopoverTriggerProps = {\n position: \"bottom-start\",\n rootNode: containerRef,\n customOffset: customPopover.offset,\n children: children,\n trigger: customPopover.trigger,\n delay: customPopover.delay,\n popoverContent: customPopover.content,\n };\n\n return (\n <PopoverTrigger\n className={styles.popoverTrigger}\n zIndex={2}\n {...popoverTriggerProps}\n />\n );\n};\n"],"names":["WithOptionalPopover","containerRef","children","customPopover","popoverTriggerProps","position","rootNode","customOffset","offset","trigger","delay","popoverContent","content","_jsx","PopoverTrigger","Object","assign","className","styles.popoverTrigger","zIndex"],"mappings":"m/BAaO,MAAMA,EAAsB,EAC/BC,eACAC,WACAC,oBAEA,IAAKA,EACD,OAAOD,EAGX,MAAME,EAA2C,CAC7CC,SAAU,eACVC,SAAUL,EACVM,aAAcJ,EAAcK,OAC5BN,SAAUA,EACVO,QAASN,EAAcM,QACvBC,MAAOP,EAAcO,MACrBC,eAAgBR,EAAcS,SAGlC,OACIC,EAACC,EAAcC,OAAAC,OAAA,CACXC,UAAWC,EACXC,OAAQ,GACJf,GACN"}
@@ -1,66 +1,185 @@
1
- import type { RefObject } from "react";
2
1
  import type { PopoverTriggerType } from "../popover";
2
+ /**
3
+ * Visual state of a schedule time slot.
4
+ *
5
+ * - `"booked"` — the slot has confirmed bookings.
6
+ * - `"available"` — the slot is open for booking.
7
+ * - `"blocked"` — the slot is unavailable.
8
+ * - `"pending"` — the slot is under review or awaiting confirmation.
9
+ */
3
10
  export type ScheduleCellType = "booked" | "available" | "blocked" | "pending";
11
+ /**
12
+ * The active layout for the schedule.
13
+ */
4
14
  export type ScheduleView = "day" | "week";
15
+ /**
16
+ * A single entity displayed as a column or carousel item.
17
+ */
5
18
  export interface ScheduleEntityProps {
19
+ /** Unique identifier. */
6
20
  id: string;
21
+ /** Display name shown in the column header. */
7
22
  name: string;
23
+ /** All time slots belonging to this service across all dates. */
8
24
  slots: ScheduleSlotProps[];
9
25
  }
26
+ /**
27
+ * Configuration for a popover attached to a schedule slot.
28
+ */
10
29
  export interface SchedulePopoverProps {
30
+ /** Interaction type that opens the popover. */
11
31
  trigger: PopoverTriggerType;
32
+ /** The popover body. */
12
33
  content: string | JSX.Element | (() => React.ReactNode);
34
+ /**
35
+ * Open and close delay in milliseconds.
36
+ */
13
37
  delay?: {
14
38
  open?: number;
15
39
  close?: number;
16
40
  } | undefined;
41
+ /** Distance in pixels between the slot element and the popover. */
17
42
  offset?: number | undefined;
18
43
  }
44
+ /**
45
+ * Props for the `Schedule` component.
46
+ */
19
47
  export interface ScheduleProps {
20
48
  id?: string | undefined;
21
49
  className?: string | undefined;
22
50
  "data-testid"?: string | undefined;
51
+ /**
52
+ * The layout view.
53
+ *
54
+ * @default "day"
55
+ *
56
+ * @remarks `"week"` is automatically overridden to `"day"`
57
+ * on small screens.
58
+ */
23
59
  view?: ScheduleView | undefined;
60
+ /**
61
+ * The currently displayed date in `YYYY-MM-DD` format.
62
+ * Slots are filtered to match this date in the day view.
63
+ */
24
64
  date: string;
65
+ /**
66
+ * Message shown inside the empty-state illustration when `serviceData` is
67
+ * empty.
68
+ */
25
69
  emptyContentMessage?: string | undefined;
70
+ /**
71
+ * Array of service entities to render. Each entity maps to a column in the
72
+ * week view, or to a carousel item in the day view.
73
+ */
26
74
  serviceData: ScheduleEntityProps[];
75
+ /**
76
+ * When `true` the schedule renders a loading animation in place of slot
77
+ * content.
78
+ *
79
+ * @default false
80
+ */
27
81
  loading?: boolean | undefined;
82
+ /**
83
+ * Earliest time shown on the time axis, in `HH:mm` format.
84
+ *
85
+ * @default "00:00"
86
+ */
28
87
  minTime?: string | undefined;
88
+ /**
89
+ * Latest time shown on the time axis, in `HH:mm` format.
90
+ *
91
+ * @default "23:59"
92
+ */
29
93
  maxTime?: string | undefined;
94
+ /**
95
+ * Time the schedule scrolls to on first render, in `HH:mm` format.
96
+ *
97
+ * @remarks Falls back to `minTime` when not provided.
98
+ */
30
99
  initialScrollTime?: string | undefined;
100
+ /** Earliest selectable date in the calendar picker, in `YYYY-MM-DD` format. */
31
101
  minDate?: string | undefined;
102
+ /** Latest selectable date in the calendar picker, in `YYYY-MM-DD` format. */
32
103
  maxDate?: string | undefined;
104
+ /**
105
+ * Called when the user navigates to the previous day.
106
+ *
107
+ * @param currentDate The date that was active before the navigation, in `YYYY-MM-DD` format.
108
+ */
33
109
  onPreviousDayClick: (currentDate: string) => void;
110
+ /**
111
+ * Called when the user navigates to the next day.
112
+ *
113
+ * @param currentDate The date that was active before the navigation, in `YYYY-MM-DD` format.
114
+ */
34
115
  onNextDayClick: (currentDate: string) => void;
116
+ /**
117
+ * Called when the user picks a date from the calendar popover.
118
+ *
119
+ * @param currentDate The selected date in `YYYY-MM-DD` format.
120
+ */
35
121
  onCalendarDateSelect: (currentDate: string) => void;
122
+ /** Called when the user clicks the "Today" button in the header. */
36
123
  onTodayClick: () => void;
124
+ /**
125
+ * Called when the user clicks a cell without any time slots in the day view.
126
+ *
127
+ * @param slot Details about the clicked empty slot.
128
+ */
37
129
  onEmptySlotClick?: ((slot: ScheduleEmptySlotProps) => void) | undefined;
130
+ /**
131
+ * When provided, a popover is attached to each empty slot in the day view
132
+ * instead of calling `onEmptySlotClick` directly.
133
+ */
38
134
  emptySlotPopover?: ((slot: ScheduleEmptySlotProps) => SchedulePopoverProps) | undefined;
135
+ /** Message displayed inside blocked slots. */
39
136
  blockedMessage?: string | undefined;
137
+ /**
138
+ * Called in the week view when the user clicks a cell that contains hidden
139
+ * overflow slots.
140
+ *
141
+ * @param hiddenServices Names of the services whose slots are hidden in the
142
+ * clicked cell.
143
+ */
40
144
  onClickHiddenSlots?: ((hiddenServices: string[]) => void) | undefined;
41
145
  }
42
- export interface CommonScheduleViewProps {
43
- date: string;
44
- loading: boolean;
45
- minTime: string;
46
- maxTime: string;
47
- initialScrollTime?: string | undefined;
48
- containerRef: RefObject<HTMLDivElement>;
49
- blockedMessage?: string | undefined;
50
- }
146
+ /**
147
+ * A single bookable time slot within a `ScheduleEntityProps`.
148
+ */
51
149
  export interface ScheduleSlotProps {
150
+ /** Unique identifier for the slot. */
52
151
  id: string;
152
+ /** Slot start time in `HH:mm` format. */
53
153
  startTime: string;
154
+ /** Slot end time in `HH:mm` format. */
54
155
  endTime: string;
156
+ /** Visual state of the slot. */
55
157
  status: ScheduleCellType;
158
+ /** Total number of bookable places in this slot. */
56
159
  capacity?: number | undefined;
160
+ /** Date this slot belongs to in `YYYY-MM-DD` format. */
57
161
  date: string | undefined;
162
+ /** Number of confirmed bookings already made for this slot. */
58
163
  booked?: number | undefined;
164
+ /** Attaches a popover to this slot with custom configuration. */
59
165
  customPopover?: SchedulePopoverProps | undefined;
166
+ /**
167
+ * Called when the user clicks this slot.
168
+ *
169
+ * @param data The full slot data at the time of the click.
170
+ * @param e The originating mouse event.
171
+ */
60
172
  onClick?: ((data: ScheduleSlotProps, e: React.MouseEvent) => void) | undefined;
61
173
  }
174
+ /**
175
+ * Describes an empty time slot passed to `onEmptySlotClick` and the
176
+ * `emptySlotPopover`.
177
+ */
62
178
  export interface ScheduleEmptySlotProps {
179
+ /** Slot start time in `HH:mm` format. */
63
180
  startTime: string;
181
+ /** Slot end time in `HH:mm` format. */
64
182
  endTime: string;
183
+ /** Name of the service this empty slot belongs to. */
65
184
  name: string;
66
185
  }
@@ -1,2 +1,7 @@
1
1
  import type { SelectHistogramProps } from "./types";
2
+ /**
3
+ * A form input that displays the selected range and reveals a histogram slider in a dropdown.
4
+ *
5
+ * Use `SelectHistogram` when users need to select a numeric range against a data distribution.
6
+ */
2
7
  export declare const SelectHistogram: ({ alignment, className, disabled, dropdownZIndex, error, histogramSlider, id, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, onBlur, onChange, onChangeEnd, optionTruncationType, placeholder, rangeLabelPrefix, rangeLabelSuffix, readOnly, renderRangeLabel, value, dropdownRootNode, ...otherProps }: SelectHistogramProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"select-histogram.js","sources":["../../src/select-histogram/select-histogram.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { HistogramSlider } from \"../histogram-slider\";\nimport { DropdownListState, ExpandableElement } from \"../shared/dropdown-list\";\nimport type { DropdownRenderProps } from \"../shared/dropdown-wrapper\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport * as dropdownWrapperStyles from \"../shared/dropdown-wrapper/dropdown-wrapper.styles\";\nimport { InputBox } from \"../shared/input-wrapper\";\nimport { Typography } from \"../typography\";\nimport { useId } from \"../util\";\nimport * as styles from \"./select-histogram.styles\";\nimport type { SelectHistogramProps } from \"./types\";\n\nexport const SelectHistogram = ({\n alignment = \"left\",\n className,\n disabled,\n dropdownZIndex,\n error,\n histogramSlider,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n onBlur,\n onChange,\n onChangeEnd,\n optionTruncationType = \"end\",\n placeholder = \"Select\",\n rangeLabelPrefix,\n rangeLabelSuffix,\n readOnly,\n renderRangeLabel,\n value,\n dropdownRootNode,\n ...otherProps\n}: SelectHistogramProps): JSX.Element => {\n const {\n interval,\n bins = [],\n renderEmptyView,\n ariaLabels,\n } = histogramSlider;\n // =============================================================================\n // CONST, STATE\n // =============================================================================\n const values = bins.map((item) => item.minValue);\n const minValue = Math.min(...values);\n const [selection, setSelection] = useState<[number, number]>(\n initSelection()\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 const testId = otherProps[\"data-testid\"] || \"select-histogram\";\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n if (value !== selection) {\n setSelection(initSelection());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleOpen = () => {\n setShowOptions(true);\n };\n\n const handleClose = () => {\n setShowOptions(false);\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n };\n\n const onSliderChange = (values: [number, number]) => {\n setSelection(values);\n onChange?.(values);\n };\n\n const onSliderChangeEnd = (values: [number, number]) => {\n setSelection(values);\n onChangeEnd?.(values);\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 // HELPER FUNCTIONS\n // =============================================================================\n function initSelection(): [number, number] {\n return value ?? [minValue, minValue + interval];\n }\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderSelector = (value: number) => {\n if (renderRangeLabel) {\n return renderRangeLabel(value);\n }\n\n return (\n <Typography.BodyBL>\n {rangeLabelPrefix}\n {value}\n {rangeLabelSuffix}\n </Typography.BodyBL>\n );\n };\n\n const getDisplayValue = () => {\n return !values || values.length === 0 ? (\n <div\n className={clsx(\n styles.placeholderLabel,\n optionTruncationType !== \"middle\" &&\n styles.placeholderLabelTruncateEnd\n )}\n >\n {placeholder}\n </div>\n ) : (\n <div className={styles.label}>\n {renderSelector(selection[0])}\n <div className={styles.separator}>-</div>\n {renderSelector(selection[1])}\n </div>\n );\n };\n\n const renderSelectorContent = () => (\n <div\n className={dropdownWrapperStyles.labelContainer}\n ref={labelContainerRef}\n data-disabled={disabled || undefined}\n >\n {getDisplayValue()}\n </div>\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=\"dialog\"\n readOnly={readOnly}\n variant=\"default\"\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 elementWidth,\n styles: floatingStyles,\n setFloatingRef,\n getFloatingProps,\n }: DropdownRenderProps) => (\n <div\n className={styles.histogramSliderDropdownContainer}\n style={{ ...floatingStyles, width: elementWidth }}\n ref={setFloatingRef}\n data-testid={`${testId}-dropdown`}\n {...getFloatingProps()}\n >\n <HistogramSlider\n interval={interval}\n value={selection}\n bins={bins}\n onChange={onSliderChange}\n onChangeEnd={onSliderChangeEnd}\n showRangeLabels={false}\n renderEmptyView={renderEmptyView}\n ariaLabels={ariaLabels}\n />\n </div>\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":["SelectHistogram","_a","alignment","className","disabled","dropdownZIndex","error","histogramSlider","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","onBlur","onChange","onChangeEnd","optionTruncationType","placeholder","rangeLabelPrefix","rangeLabelSuffix","readOnly","renderRangeLabel","value","dropdownRootNode","otherProps","__rest","interval","bins","renderEmptyView","ariaLabels","values","map","item","minValue","Math","min","selection","setSelection","useState","initSelection","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","testId","useEffect","onSliderChange","onSliderChangeEnd","handleNodeFocus","handleNodeBlur","e","current","contains","relatedTarget","renderSelector","_jsxs","Typography","BodyBL","children","_jsx","DropdownListState","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","variant","dropdownWrapperStyles.labelContainer","undefined","length","styles.label","styles.separator","clsx","styles.placeholderLabel","styles.placeholderLabelTruncateEnd","renderDropdown","elementWidth","styles","floatingStyles","setFloatingRef","getFloatingProps","Object","assign","styles.histogramSliderDropdownContainer","style","width","HistogramSlider","showRangeLabels","onOpen","onClose","onDismiss","focus","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"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"}
1
+ {"version":3,"file":"select-histogram.js","sources":["../../src/select-histogram/select-histogram.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { HistogramSlider } from \"../histogram-slider\";\nimport { DropdownListState, ExpandableElement } from \"../shared/dropdown-list\";\nimport type { DropdownRenderProps } from \"../shared/dropdown-wrapper\";\nimport { ElementWithDropdown } from \"../shared/dropdown-wrapper\";\nimport * as dropdownWrapperStyles from \"../shared/dropdown-wrapper/dropdown-wrapper.styles\";\nimport { InputBox } from \"../shared/input-wrapper\";\nimport { Typography } from \"../typography\";\nimport { useId } from \"../util\";\nimport * as styles from \"./select-histogram.styles\";\nimport type { SelectHistogramProps } from \"./types\";\n\n/**\n * A form input that displays the selected range and reveals a histogram slider in a dropdown.\n *\n * Use `SelectHistogram` when users need to select a numeric range against a data distribution.\n */\nexport const SelectHistogram = ({\n alignment = \"left\",\n className,\n disabled,\n dropdownZIndex,\n error,\n histogramSlider,\n id,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n onBlur,\n onChange,\n onChangeEnd,\n optionTruncationType = \"end\",\n placeholder = \"Select\",\n rangeLabelPrefix,\n rangeLabelSuffix,\n readOnly,\n renderRangeLabel,\n value,\n dropdownRootNode,\n ...otherProps\n}: SelectHistogramProps): JSX.Element => {\n const {\n interval,\n bins = [],\n renderEmptyView,\n ariaLabels,\n } = histogramSlider;\n // =============================================================================\n // CONST, STATE\n // =============================================================================\n const values = bins.map((item) => item.minValue);\n const minValue = Math.min(...values);\n const [selection, setSelection] = useState<[number, number]>(\n initSelection()\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 const testId = otherProps[\"data-testid\"] || \"select-histogram\";\n // =========================================================================\n // EFFECTS\n // =========================================================================\n useEffect(() => {\n if (value !== selection) {\n setSelection(initSelection());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleOpen = () => {\n setShowOptions(true);\n };\n\n const handleClose = () => {\n setShowOptions(false);\n };\n\n const handleDismiss = () => {\n selectorRef.current?.focus();\n setShowOptions(false);\n };\n\n const onSliderChange = (values: [number, number]) => {\n setSelection(values);\n onChange?.(values);\n };\n\n const onSliderChangeEnd = (values: [number, number]) => {\n setSelection(values);\n onChangeEnd?.(values);\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 // HELPER FUNCTIONS\n // =============================================================================\n function initSelection(): [number, number] {\n return value ?? [minValue, minValue + interval];\n }\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const renderSelector = (value: number) => {\n if (renderRangeLabel) {\n return renderRangeLabel(value);\n }\n\n return (\n <Typography.BodyBL>\n {rangeLabelPrefix}\n {value}\n {rangeLabelSuffix}\n </Typography.BodyBL>\n );\n };\n\n const getDisplayValue = () => {\n return !values || values.length === 0 ? (\n <div\n className={clsx(\n styles.placeholderLabel,\n optionTruncationType !== \"middle\" &&\n styles.placeholderLabelTruncateEnd\n )}\n >\n {placeholder}\n </div>\n ) : (\n <div className={styles.label}>\n {renderSelector(selection[0])}\n <div className={styles.separator}>-</div>\n {renderSelector(selection[1])}\n </div>\n );\n };\n\n const renderSelectorContent = () => (\n <div\n className={dropdownWrapperStyles.labelContainer}\n ref={labelContainerRef}\n data-disabled={disabled || undefined}\n >\n {getDisplayValue()}\n </div>\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=\"dialog\"\n readOnly={readOnly}\n variant=\"default\"\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 elementWidth,\n styles: floatingStyles,\n setFloatingRef,\n getFloatingProps,\n }: DropdownRenderProps) => (\n <div\n className={styles.histogramSliderDropdownContainer}\n style={{ ...floatingStyles, width: elementWidth }}\n ref={setFloatingRef}\n data-testid={`${testId}-dropdown`}\n {...getFloatingProps()}\n >\n <HistogramSlider\n interval={interval}\n value={selection}\n bins={bins}\n onChange={onSliderChange}\n onChangeEnd={onSliderChangeEnd}\n showRangeLabels={false}\n renderEmptyView={renderEmptyView}\n ariaLabels={ariaLabels}\n />\n </div>\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":["SelectHistogram","_a","alignment","className","disabled","dropdownZIndex","error","histogramSlider","id","ariaLabelledBy","ariaDescribedBy","ariaInvalid","onBlur","onChange","onChangeEnd","optionTruncationType","placeholder","rangeLabelPrefix","rangeLabelSuffix","readOnly","renderRangeLabel","value","dropdownRootNode","otherProps","__rest","interval","bins","renderEmptyView","ariaLabels","values","map","item","minValue","Math","min","selection","setSelection","useState","initSelection","showOptions","setShowOptions","focused","setFocused","internalId","useId","nodeRef","useRef","selectorRef","labelContainerRef","testId","useEffect","onSliderChange","onSliderChangeEnd","handleNodeFocus","handleNodeBlur","e","current","contains","relatedTarget","renderSelector","_jsxs","Typography","BodyBL","children","_jsx","DropdownListState","ElementWithDropdown","enabled","isOpen","renderElement","InputBox","ref","tabIndex","onFocus","ExpandableElement","expanded","listboxId","popupRole","variant","dropdownWrapperStyles.labelContainer","undefined","length","styles.label","styles.separator","clsx","styles.placeholderLabel","styles.placeholderLabelTruncateEnd","renderDropdown","elementWidth","styles","floatingStyles","setFloatingRef","getFloatingProps","Object","assign","styles.histogramSliderDropdownContainer","style","width","HistogramSlider","showRangeLabels","onOpen","onClose","onDismiss","focus","clickToToggle","offset","fitAvailableHeight","customZIndex","rootNode"],"mappings":"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"}
@@ -2,32 +2,85 @@ import type { AriaAttributes, RefObject } from "react";
2
2
  import type { HistogramSliderProps } from "../histogram-slider";
3
3
  import type { TruncateType } from "../shared/dropdown-list/types";
4
4
  import type { DropdownAlignmentType } from "../shared/dropdown-wrapper";
5
+ /**
6
+ * Subset of `HistogramSliderProps` passed to `SelectHistogram` to configure the
7
+ * embedded histogram slider rendered inside the dropdown.
8
+ */
5
9
  export type SelectHistogramSliderProps = Pick<HistogramSliderProps, "bins" | "interval" | "renderEmptyView" | "ariaLabels">;
10
+ /**
11
+ * Props for the `SelectHistogram` component.
12
+ */
6
13
  export interface SelectHistogramProps extends Pick<AriaAttributes, "aria-labelledby" | "aria-describedby" | "aria-invalid"> {
14
+ /**
15
+ * Horizontal alignment of the dropdown relative to the trigger element.
16
+ *
17
+ * @default "left"
18
+ */
7
19
  alignment?: DropdownAlignmentType | undefined;
8
20
  className?: string | undefined;
9
21
  "data-testid"?: string | undefined;
10
22
  disabled?: boolean | undefined;
23
+ /** CSS `z-index` applied to the dropdown overlay. */
11
24
  dropdownZIndex?: number | undefined;
25
+ /** Renders the trigger in an error state when `true`. */
12
26
  error?: boolean | undefined;
13
27
  id?: string | undefined;
28
+ /** Configuration for the histogram slider rendered inside the dropdown. */
14
29
  histogramSlider: SelectHistogramSliderProps;
15
- /** Specifies the truncation type. Truncated text will be replaced with ellipsis. Values: "middle" | "end" */
30
+ /**
31
+ * Controls how long option labels are truncated when they overflow.
32
+ *
33
+ * @default "end"
34
+ */
16
35
  optionTruncationType?: TruncateType | undefined;
36
+ /**
37
+ * Text shown in the trigger when no range is selected or no bins are provided.
38
+ *
39
+ * @default "Select"
40
+ */
17
41
  placeholder?: string | undefined;
42
+ /** Text prepended to each range label value. */
18
43
  rangeLabelPrefix?: string | undefined;
44
+ /** Text appended to each range label value. */
19
45
  rangeLabelSuffix?: string | undefined;
20
46
  readOnly?: boolean | undefined;
47
+ /**
48
+ * The currently selected range as `[min, max]`. When omitted, the selection
49
+ * initialises to `[minValue, minValue + interval]` derived from the first bin.
50
+ */
21
51
  value?: [number, number] | undefined;
22
52
  /**
23
- * The root element that contains the dropdown element. Defaults to the document body.
53
+ * The root element that contains the dropdown element.
24
54
  *
25
- * If the parent that contains the trigger element has a higher z-index than the dropdown,
26
- * the dropdown may not be visible. Specify the parent element here instead
55
+ * @remarks Specify this if you need to change the parent of the
56
+ * dropdown in the HTML DOM.
57
+ * Possible use case: sharing a stacking context.
58
+ *
59
+ * Note: if a parent of the trigger has a higher `z-index` than the dropdown,
60
+ * the dropdown may be obscured.
61
+ *
62
+ * @default `document.body`
27
63
  */
28
64
  dropdownRootNode?: RefObject<HTMLElement> | undefined;
65
+ /** Called when focus leaves both the input and the dropdown. */
29
66
  onBlur?: (() => void) | undefined;
67
+ /**
68
+ * Called on every selection change.
69
+ *
70
+ * @param value The current `[min, max]` selection.
71
+ */
30
72
  onChange?: ((value: [number, number]) => void) | undefined;
73
+ /**
74
+ * Called when a thumb is released after selection is complete.
75
+ *
76
+ * @param value The settled `[min, max]` selection.
77
+ */
31
78
  onChangeEnd?: ((value: [number, number]) => void) | undefined;
79
+ /**
80
+ * Custom renderer for each bound value displayed in the trigger label.
81
+ * Overrides `rangeLabelPrefix`, `rangeLabelSuffix`, and the default `Typography.BodyBL` wrapper.
82
+ *
83
+ * @param value The numeric bound to render.
84
+ */
32
85
  renderRangeLabel?: ((value: number) => React.ReactNode) | undefined;
33
86
  }