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

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 (910) hide show
  1. package/accordion/accordion.js.map +1 -1
  2. package/accordion/types.d.ts +1 -1
  3. package/alert/alert.js.map +1 -1
  4. package/alert/types.d.ts +2 -0
  5. package/animations/loading-dots/loading-dots.d.ts +5 -2
  6. package/animations/loading-dots/loading-dots.js.map +1 -1
  7. package/animations/loading-dots-spinner/loading-dots-spinner.d.ts +3 -0
  8. package/animations/loading-dots-spinner/loading-dots-spinner.js.map +1 -1
  9. package/animations/loading-dots-spinner/lottie-animation.d.ts +2 -2
  10. package/animations/loading-dots-spinner/lottie-animation.js.map +1 -1
  11. package/animations/loading-spinner/loading-spinner.d.ts +5 -2
  12. package/animations/loading-spinner/loading-spinner.js.map +1 -1
  13. package/animations/themed-loading-spinner/themed-loading-spinner.d.ts +5 -2
  14. package/animations/themed-loading-spinner/themed-loading-spinner.js.map +1 -1
  15. package/animations/types.d.ts +13 -6
  16. package/avatar/avatar.js.map +1 -1
  17. package/badge/badge.js.map +1 -1
  18. package/badge/types.d.ts +13 -2
  19. package/box-container/box-container.js.map +1 -1
  20. package/box-container/types.d.ts +2 -0
  21. package/breadcrumb/breadcrumb.d.ts +7 -0
  22. package/breadcrumb/breadcrumb.js.map +1 -1
  23. package/breadcrumb/types.d.ts +36 -0
  24. package/button/button.d.ts +1 -0
  25. package/button/button.js.map +1 -1
  26. package/button/types.d.ts +47 -9
  27. package/calendar/calendar.d.ts +3 -0
  28. package/calendar/calendar.js.map +1 -1
  29. package/calendar/types.d.ts +46 -10
  30. package/card/card.d.ts +1 -0
  31. package/card/card.js.map +1 -1
  32. package/card/types.d.ts +1 -0
  33. package/checkbox/checkbox.d.ts +3 -0
  34. package/checkbox/checkbox.js.map +1 -1
  35. package/checkbox/types.d.ts +23 -3
  36. package/cjs/accordion/accordion.js.map +1 -1
  37. package/cjs/alert/alert.js.map +1 -1
  38. package/cjs/animations/loading-dots/loading-dots.js.map +1 -1
  39. package/cjs/animations/loading-dots-spinner/loading-dots-spinner.js.map +1 -1
  40. package/cjs/animations/loading-dots-spinner/lottie-animation.js.map +1 -1
  41. package/cjs/animations/loading-spinner/loading-spinner.js.map +1 -1
  42. package/cjs/animations/themed-loading-spinner/themed-loading-spinner.js.map +1 -1
  43. package/cjs/avatar/avatar.js.map +1 -1
  44. package/cjs/badge/badge.js.map +1 -1
  45. package/cjs/box-container/box-container.js.map +1 -1
  46. package/cjs/breadcrumb/breadcrumb.js.map +1 -1
  47. package/cjs/button/button.js.map +1 -1
  48. package/cjs/calendar/calendar.js.map +1 -1
  49. package/cjs/card/card.js.map +1 -1
  50. package/cjs/checkbox/checkbox.js.map +1 -1
  51. package/cjs/countdown-timer/countdown-timer.js.map +1 -1
  52. package/cjs/dashed-border/dashed-border.js.map +1 -1
  53. package/cjs/data-table/data-table.js +1 -1
  54. package/cjs/data-table/data-table.js.map +1 -1
  55. package/cjs/data-table/data-table.styles.js +1 -1
  56. package/cjs/data-table/data-table.styles.js.map +1 -1
  57. package/cjs/data-table/data-table.styles_rxganh.css +27 -0
  58. package/cjs/date-input/date-input.js.map +1 -1
  59. package/cjs/date-navigator/date-navigator.js.map +1 -1
  60. package/cjs/date-range-input/date-range-input.js.map +1 -1
  61. package/cjs/divider/divider.js.map +1 -1
  62. package/cjs/drawer/drawer.js.map +1 -1
  63. package/cjs/e-signature/e-signature.js.map +1 -1
  64. package/cjs/error-display/error-display.js.map +1 -1
  65. package/cjs/external/dompurify/dist/purify.es.js +2 -2
  66. package/cjs/external/dompurify/dist/purify.es.js.map +1 -1
  67. package/cjs/external/lodash/_setCacheHas.js.map +1 -1
  68. package/cjs/external/lodash/lodash.js +1 -1
  69. package/cjs/external/lodash/lodash.js.map +1 -1
  70. package/cjs/feedback-rating/feedback-rating.js.map +1 -1
  71. package/cjs/file-download/file-download.js.map +1 -1
  72. package/cjs/file-upload/file-item-edit.js.map +1 -1
  73. package/cjs/file-upload/file-list/file-list.js.map +1 -1
  74. package/cjs/file-upload/file-list-item/file-list-item.js.map +1 -1
  75. package/cjs/file-upload/file-list-item/file-list-item.styles.js +1 -1
  76. package/cjs/file-upload/file-list-item/file-list-item.styles.js.map +1 -1
  77. package/cjs/file-upload/file-list-item/{file-list-item.styles_o8000f.css → file-list-item.styles_kgtfke.css} +1 -1
  78. package/cjs/file-upload/file-upload.js.map +1 -1
  79. package/cjs/filter/addons/filter-item-checkbox-helpers.js.map +1 -1
  80. package/cjs/filter/addons/filter-item-checkbox.js.map +1 -1
  81. package/cjs/filter/filter-item.js +1 -1
  82. package/cjs/filter/filter-item.js.map +1 -1
  83. package/cjs/filter/filter.js.map +1 -1
  84. package/cjs/footer/footer.js.map +1 -1
  85. package/cjs/form/form-custom-field/form-custom-field.js +2 -0
  86. package/cjs/form/form-custom-field/form-custom-field.js.map +1 -0
  87. package/cjs/form/form-date-input/form-date-input.js +2 -0
  88. package/cjs/form/form-date-input/form-date-input.js.map +1 -0
  89. package/cjs/form/form-date-range-input/form-date-range-input.js +2 -0
  90. package/cjs/form/form-date-range-input/form-date-range-input.js.map +1 -0
  91. package/cjs/form/form-e-signature/form-e-signature.js +2 -0
  92. package/cjs/form/form-e-signature/form-e-signature.js.map +1 -0
  93. package/cjs/form/form-histogram-slider/form-histogram-slider.js +2 -0
  94. package/cjs/form/form-histogram-slider/form-histogram-slider.js.map +1 -0
  95. package/cjs/form/form-input/form-input.js +2 -0
  96. package/cjs/form/form-input/form-input.js.map +1 -0
  97. package/cjs/form/form-input-group/form-input-group.js +2 -0
  98. package/cjs/form/form-input-group/form-input-group.js.map +1 -0
  99. package/cjs/form/form-label/form-label-addon.js +2 -0
  100. package/cjs/form/form-label/form-label-addon.js.map +1 -0
  101. package/cjs/form/form-label/form-label-addon.styles.js +2 -0
  102. package/cjs/form/form-label/form-label-addon.styles.js.map +1 -0
  103. package/cjs/form/form-label/form-label-addon.styles_aztasj.css +1 -0
  104. package/cjs/form/form-label/form-label.js +2 -0
  105. package/cjs/form/form-label/form-label.js.map +1 -0
  106. package/cjs/form/form-label/form-label.styles.js +2 -0
  107. package/cjs/form/form-label/form-label.styles.js.map +1 -0
  108. package/cjs/form/form-label/form-label.styles_180zf7j.css +6 -0
  109. package/cjs/form/form-masked-input/form-masked-input.js +2 -0
  110. package/cjs/form/form-masked-input/form-masked-input.js.map +1 -0
  111. package/cjs/form/form-multi-select/form-multi-select.js +2 -0
  112. package/cjs/form/form-multi-select/form-multi-select.js.map +1 -0
  113. package/cjs/form/form-nested-multi-select/form-nested-multi-select.js +2 -0
  114. package/cjs/form/form-nested-multi-select/form-nested-multi-select.js.map +1 -0
  115. package/cjs/form/form-nested-select/form-nested-select.js +2 -0
  116. package/cjs/form/form-nested-select/form-nested-select.js.map +1 -0
  117. package/cjs/form/form-otp-verification/form-otp-verification.js +2 -0
  118. package/cjs/form/form-otp-verification/form-otp-verification.js.map +1 -0
  119. package/cjs/form/form-phone-number-input/form-phone-number-input.js +2 -0
  120. package/cjs/form/form-phone-number-input/form-phone-number-input.js.map +1 -0
  121. package/cjs/form/form-predictive-text-input/form-predictive-text-input.js +2 -0
  122. package/cjs/form/form-predictive-text-input/form-predictive-text-input.js.map +1 -0
  123. package/cjs/form/form-range-select/form-range-select.js +2 -0
  124. package/cjs/form/form-range-select/form-range-select.js.map +1 -0
  125. package/cjs/form/form-range-slider/form-range-slider.js +2 -0
  126. package/cjs/form/form-range-slider/form-range-slider.js.map +1 -0
  127. package/cjs/form/form-select/form-select.js +2 -0
  128. package/cjs/form/form-select/form-select.js.map +1 -0
  129. package/cjs/form/form-select-histogram/form-select-histogram.js +2 -0
  130. package/cjs/form/form-select-histogram/form-select-histogram.js.map +1 -0
  131. package/cjs/form/form-slider/form-slider.js +2 -0
  132. package/cjs/form/form-slider/form-slider.js.map +1 -0
  133. package/cjs/form/form-textarea/form-textarea.js +2 -0
  134. package/cjs/form/form-textarea/form-textarea.js.map +1 -0
  135. package/cjs/form/form-textarea/form-textarea.styles.js +2 -0
  136. package/cjs/form/form-textarea/form-textarea.styles.js.map +1 -0
  137. package/cjs/form/form-textarea/form-textarea.styles_1kneyif.css +3 -0
  138. package/cjs/form/form-time-range-picker/form-time-range-picker.js +2 -0
  139. package/cjs/form/form-time-range-picker/form-time-range-picker.js.map +1 -0
  140. package/cjs/form/form-timepicker/form-timepicker.js +2 -0
  141. package/cjs/form/form-timepicker/form-timepicker.js.map +1 -0
  142. package/cjs/form/form-unit-number-input/form-unit-number-input.js +2 -0
  143. package/cjs/form/form-unit-number-input/form-unit-number-input.js.map +1 -0
  144. package/cjs/form/form-wrapper.js +1 -1
  145. package/cjs/form/form-wrapper.js.map +1 -1
  146. package/cjs/form/index.js +1 -1
  147. package/cjs/form/index.js.map +1 -1
  148. package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
  149. package/cjs/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
  150. package/cjs/histogram-slider/histogram-slider.js.map +1 -1
  151. package/cjs/image-button/image-button.js.map +1 -1
  152. package/cjs/index.js +1 -1
  153. package/cjs/input/input.js.map +1 -1
  154. package/cjs/input-group/input-group.js.map +1 -1
  155. package/cjs/input-multi-select/input-multi-select.js.map +1 -1
  156. package/cjs/input-nested-multi-select/input-nested-multi-select.js.map +1 -1
  157. package/cjs/input-nested-select/input-nested-select.js.map +1 -1
  158. package/cjs/input-range-select/input-range-select.js.map +1 -1
  159. package/cjs/input-range-slider/input-range-slider.js.map +1 -1
  160. package/cjs/input-select/input-select.js.map +1 -1
  161. package/cjs/input-slider/input-slider.js.map +1 -1
  162. package/cjs/input-textarea/textarea.js.map +1 -1
  163. package/cjs/input-textarea/textarea.styles.js +1 -1
  164. package/cjs/input-textarea/textarea.styles.js.map +1 -1
  165. package/cjs/input-textarea/{textarea.styles_22z4n3.css → textarea.styles_q77m5x.css} +1 -1
  166. package/cjs/language-switcher/language-switcher.js.map +1 -1
  167. package/cjs/layout/index.js +1 -1
  168. package/cjs/layout/index.js.map +1 -1
  169. package/cjs/link-list/components/common.js.map +1 -1
  170. package/cjs/link-list/components/link-list-eager.js.map +1 -1
  171. package/cjs/link-list/components/link-list-lazy.js.map +1 -1
  172. package/cjs/link-list/link-list.js.map +1 -1
  173. package/cjs/local-nav/local-nav-dropdown/local-nav-dropdown.js.map +1 -1
  174. package/cjs/local-nav/local-nav-menu/local-nav-menu.js.map +1 -1
  175. package/cjs/markup/markup.js.map +1 -1
  176. package/cjs/masked-input/masked-input.js.map +1 -1
  177. package/cjs/masthead/masthead.js.map +1 -1
  178. package/cjs/menu/menu.js +1 -1
  179. package/cjs/menu/menu.js.map +1 -1
  180. package/cjs/modal/index.js.map +1 -1
  181. package/cjs/modal/modal-box.js +1 -1
  182. package/cjs/modal/modal-box.js.map +1 -1
  183. package/cjs/modal-v2/index.js +1 -1
  184. package/cjs/modal-v2/index.js.map +1 -1
  185. package/cjs/modal-v2/modal-v2.js +1 -1
  186. package/cjs/modal-v2/modal-v2.js.map +1 -1
  187. package/cjs/modal-v2/slots/card.js +1 -1
  188. package/cjs/modal-v2/slots/card.js.map +1 -1
  189. package/cjs/navbar/navbar.js.map +1 -1
  190. package/cjs/notification-banner/notification-banner-hoc.js.map +1 -1
  191. package/cjs/notification-banner/notification-banner.js.map +1 -1
  192. package/cjs/otp-input/otp-input.js +1 -1
  193. package/cjs/otp-input/otp-input.js.map +1 -1
  194. package/cjs/otp-verification/contact-input-section.js +1 -1
  195. package/cjs/otp-verification/contact-input-section.js.map +1 -1
  196. package/cjs/otp-verification/otp-verification.js.map +1 -1
  197. package/cjs/otp-verification/verification-section.js +1 -1
  198. package/cjs/otp-verification/verification-section.js.map +1 -1
  199. package/cjs/overlay/overlay.js.map +1 -1
  200. package/cjs/pagination/pagination.js.map +1 -1
  201. package/cjs/phone-number-input/phone-number-input.js.map +1 -1
  202. package/cjs/pill/pill.js.map +1 -1
  203. package/cjs/popover/popover-inline/popover-inline.js.map +1 -1
  204. package/cjs/popover/popover-trigger.js.map +1 -1
  205. package/cjs/popover/popover.js +1 -1
  206. package/cjs/popover/popover.js.map +1 -1
  207. package/cjs/predictive-text-input/predictive-text-input.js +1 -1
  208. package/cjs/predictive-text-input/predictive-text-input.js.map +1 -1
  209. package/cjs/progress-indicator/progress-indicator.js.map +1 -1
  210. package/cjs/radio-button/radio-button.js.map +1 -1
  211. package/cjs/schedule/schedule.js.map +1 -1
  212. package/cjs/schedule/shared/with-optional-popover.js +1 -1
  213. package/cjs/schedule/shared/with-optional-popover.js.map +1 -1
  214. package/cjs/select-histogram/select-histogram.js.map +1 -1
  215. package/cjs/shared/dropdown-list/dropdown-list.js +1 -1
  216. package/cjs/shared/dropdown-list/dropdown-list.js.map +1 -1
  217. package/cjs/shared/dropdown-wrapper/element-with-dropdown.js +1 -1
  218. package/cjs/shared/dropdown-wrapper/element-with-dropdown.js.map +1 -1
  219. package/cjs/sidenav/sidenav.js.map +1 -1
  220. package/cjs/singpass-button/singpass-button.js.map +1 -1
  221. package/cjs/smart-app-banner/smart-app-banner.js.map +1 -1
  222. package/cjs/tab/tab.js.map +1 -1
  223. package/cjs/table/table.js.map +1 -1
  224. package/cjs/table/table.styles.js +1 -1
  225. package/cjs/table/table.styles.js.map +1 -1
  226. package/cjs/table/{table.styles_1af5ipv.css → table.styles_1vjx31g.css} +1 -1
  227. package/cjs/tag/tag.js.map +1 -1
  228. package/cjs/text-list/index.js.map +1 -1
  229. package/cjs/theme/theme-provider/breakpoint.js +1 -1
  230. package/cjs/theme/theme-provider/breakpoint.js.map +1 -1
  231. package/cjs/theme/theme-provider/hooks.js.map +1 -1
  232. package/cjs/theme/theme-provider/index.js.map +1 -1
  233. package/cjs/theme/tokens/border.js.map +1 -1
  234. package/cjs/theme/tokens/breakpoint.js.map +1 -1
  235. package/cjs/theme/tokens/colour.js.map +1 -1
  236. package/cjs/theme/tokens/component.js.map +1 -1
  237. package/cjs/theme/tokens/font.js.map +1 -1
  238. package/cjs/theme/tokens/media-query.js.map +1 -1
  239. package/cjs/theme/tokens/motion.js.map +1 -1
  240. package/cjs/theme/tokens/radius.js.map +1 -1
  241. package/cjs/theme/tokens/shadow.js.map +1 -1
  242. package/cjs/theme/tokens/spacing.js.map +1 -1
  243. package/cjs/theme/types.js.map +1 -1
  244. package/cjs/theme/utils/css-variable.js.map +1 -1
  245. package/cjs/theme/utils/font.js.map +1 -1
  246. package/cjs/theme/utils/use-apply-styles.js +1 -1
  247. package/cjs/theme/utils/use-apply-styles.js.map +1 -1
  248. package/cjs/theme/utils/use-design-token-override.js.map +1 -1
  249. package/cjs/theme/utils/use-design-token.js.map +1 -1
  250. package/cjs/theme/utils/use-media-query.js.map +1 -1
  251. package/cjs/time-range-picker/combobox-picker/combobox-picker.js +1 -1
  252. package/cjs/time-range-picker/combobox-picker/combobox-picker.js.map +1 -1
  253. package/cjs/time-range-picker/common.styles.js +1 -1
  254. package/cjs/time-range-picker/common.styles.js.map +1 -1
  255. package/cjs/time-range-picker/{common.styles_1qwp4xa.css → common.styles_cnkkax.css} +2 -1
  256. package/cjs/time-range-picker/dial-picker/dial-picker.js +1 -1
  257. package/cjs/time-range-picker/dial-picker/dial-picker.js.map +1 -1
  258. package/cjs/time-range-picker/time-range-picker.js.map +1 -1
  259. package/cjs/time-slot-bar/time-slot-bar.js.map +1 -1
  260. package/cjs/time-slot-bar-week/time-slot-bar-week.js.map +1 -1
  261. package/cjs/time-slot-week-view/time-slot-week-view.js.map +1 -1
  262. package/cjs/timeline/timeline.js.map +1 -1
  263. package/cjs/timepicker/timepicker.js +1 -1
  264. package/cjs/timepicker/timepicker.js.map +1 -1
  265. package/cjs/timepicker/timepicker.styles.js +1 -1
  266. package/cjs/timepicker/timepicker.styles.js.map +1 -1
  267. package/cjs/timepicker/timepicker.styles_lyizvq.css +2 -0
  268. package/cjs/timetable/timetable-row/with-optional-popover.js +1 -1
  269. package/cjs/timetable/timetable-row/with-optional-popover.js.map +1 -1
  270. package/cjs/timetable/timetable.js +1 -1
  271. package/cjs/timetable/timetable.js.map +1 -1
  272. package/cjs/toast/toast.js.map +1 -1
  273. package/cjs/toggle/toggle.js.map +1 -1
  274. package/cjs/typography/index.js.map +1 -1
  275. package/cjs/uneditable-section/index.js.map +1 -1
  276. package/cjs/uneditable-section/section-item.js +1 -1
  277. package/cjs/uneditable-section/section-item.js.map +1 -1
  278. package/cjs/unit-number/unit-number-input.js.map +1 -1
  279. package/cjs/util/merge-refs.js.map +1 -1
  280. package/cjs/util/use-throttle.js +2 -0
  281. package/cjs/util/use-throttle.js.map +1 -0
  282. package/countdown-timer/countdown-timer.js.map +1 -1
  283. package/countdown-timer/types.d.ts +6 -6
  284. package/dashed-border/dashed-border.js.map +1 -1
  285. package/data-table/data-table.js +1 -1
  286. package/data-table/data-table.js.map +1 -1
  287. package/data-table/data-table.styles.d.ts +2 -1
  288. package/data-table/data-table.styles.js +1 -1
  289. package/data-table/data-table.styles.js.map +1 -1
  290. package/data-table/data-table.styles_rxganh.css +27 -0
  291. package/date-input/date-input.js.map +1 -1
  292. package/date-input/types.d.ts +1 -1
  293. package/date-navigator/date-navigator.js.map +1 -1
  294. package/date-navigator/types.d.ts +1 -1
  295. package/date-range-input/date-range-input.js.map +1 -1
  296. package/date-range-input/types.d.ts +2 -2
  297. package/divider/divider.js.map +1 -1
  298. package/divider/types.d.ts +1 -1
  299. package/docs/component-catalog.json +644 -0
  300. package/drawer/drawer.js.map +1 -1
  301. package/drawer/types.d.ts +1 -1
  302. package/e-signature/e-signature.js.map +1 -1
  303. package/e-signature/types.d.ts +1 -1
  304. package/error-display/error-display.js.map +1 -1
  305. package/external/dompurify/dist/purify.es.js +2 -2
  306. package/external/dompurify/dist/purify.es.js.map +1 -1
  307. package/external/lodash/_setCacheHas.js.map +1 -1
  308. package/external/lodash/lodash.js +1 -1
  309. package/external/lodash/lodash.js.map +1 -1
  310. package/feedback-rating/feedback-rating.js.map +1 -1
  311. package/file-download/file-download.js.map +1 -1
  312. package/file-download/types.d.ts +6 -1
  313. package/file-upload/file-item-edit.d.ts +1 -1
  314. package/file-upload/file-item-edit.js.map +1 -1
  315. package/file-upload/file-list/file-list.d.ts +1 -1
  316. package/file-upload/file-list/file-list.js.map +1 -1
  317. package/file-upload/file-list-item/file-list-item.d.ts +1 -1
  318. package/file-upload/file-list-item/file-list-item.js.map +1 -1
  319. package/file-upload/file-list-item/file-list-item.styles.js +1 -1
  320. package/file-upload/file-list-item/file-list-item.styles.js.map +1 -1
  321. package/file-upload/file-list-item/{file-list-item.styles_o8000f.css → file-list-item.styles_kgtfke.css} +1 -1
  322. package/file-upload/file-upload.js.map +1 -1
  323. package/file-upload/types.d.ts +6 -3
  324. package/filter/addons/filter-item-checkbox-helpers.d.ts +2 -2
  325. package/filter/addons/filter-item-checkbox-helpers.js.map +1 -1
  326. package/filter/addons/filter-item-checkbox.d.ts +1 -1
  327. package/filter/addons/filter-item-checkbox.js.map +1 -1
  328. package/filter/addons/internal-types.d.ts +12 -0
  329. package/filter/addons/types.d.ts +60 -9
  330. package/filter/filter-item.js +1 -1
  331. package/filter/filter-item.js.map +1 -1
  332. package/filter/filter.d.ts +1 -1
  333. package/filter/filter.js.map +1 -1
  334. package/filter/index.d.ts +1 -0
  335. package/filter/types.d.ts +36 -72
  336. package/footer/footer.js.map +1 -1
  337. package/form/form-custom-field/form-custom-field.js +2 -0
  338. package/form/form-custom-field/form-custom-field.js.map +1 -0
  339. package/form/form-custom-field/index.d.ts +2 -0
  340. package/form/form-custom-field/types.d.ts +7 -0
  341. package/form/form-date-input/form-date-input.js +2 -0
  342. package/form/form-date-input/form-date-input.js.map +1 -0
  343. package/form/form-date-input/index.d.ts +2 -0
  344. package/form/form-date-input/types.d.ts +8 -0
  345. package/form/form-date-range-input/form-date-range-input.js +2 -0
  346. package/form/form-date-range-input/form-date-range-input.js.map +1 -0
  347. package/form/form-date-range-input/index.d.ts +2 -0
  348. package/form/form-date-range-input/types.d.ts +8 -0
  349. package/form/form-e-signature/form-e-signature.js +2 -0
  350. package/form/form-e-signature/form-e-signature.js.map +1 -0
  351. package/form/form-e-signature/index.d.ts +2 -0
  352. package/form/form-e-signature/types.d.ts +8 -0
  353. package/form/form-histogram-slider/form-histogram-slider.js +2 -0
  354. package/form/form-histogram-slider/form-histogram-slider.js.map +1 -0
  355. package/form/form-histogram-slider/index.d.ts +2 -0
  356. package/form/form-histogram-slider/types.d.ts +8 -0
  357. package/form/form-input/form-input.js +2 -0
  358. package/form/form-input/form-input.js.map +1 -0
  359. package/form/form-input/index.d.ts +2 -0
  360. package/form/form-input/types.d.ts +8 -0
  361. package/form/form-input-group/form-input-group.js +2 -0
  362. package/form/form-input-group/form-input-group.js.map +1 -0
  363. package/form/form-input-group/index.d.ts +2 -0
  364. package/form/form-input-group/types.d.ts +10 -0
  365. package/form/form-label/form-label-addon.js +2 -0
  366. package/form/form-label/form-label-addon.js.map +1 -0
  367. package/form/form-label/form-label-addon.styles.js +2 -0
  368. package/form/form-label/form-label-addon.styles.js.map +1 -0
  369. package/form/form-label/form-label-addon.styles_aztasj.css +1 -0
  370. package/form/form-label/form-label.js +2 -0
  371. package/form/form-label/form-label.js.map +1 -0
  372. package/form/form-label/form-label.styles.js +2 -0
  373. package/form/form-label/form-label.styles.js.map +1 -0
  374. package/form/form-label/form-label.styles_180zf7j.css +6 -0
  375. package/form/form-label/index.d.ts +2 -0
  376. package/form/form-label/types.d.ts +39 -0
  377. package/form/form-masked-input/form-masked-input.js +2 -0
  378. package/form/form-masked-input/form-masked-input.js.map +1 -0
  379. package/form/form-masked-input/index.d.ts +2 -0
  380. package/form/form-masked-input/types.d.ts +8 -0
  381. package/form/form-multi-select/form-multi-select.js +2 -0
  382. package/form/form-multi-select/form-multi-select.js.map +1 -0
  383. package/form/form-multi-select/index.d.ts +2 -0
  384. package/form/form-multi-select/types.d.ts +10 -0
  385. package/form/form-nested-multi-select/form-nested-multi-select.js +2 -0
  386. package/form/form-nested-multi-select/form-nested-multi-select.js.map +1 -0
  387. package/form/form-nested-multi-select/index.d.ts +2 -0
  388. package/form/form-nested-multi-select/types.d.ts +11 -0
  389. package/form/form-nested-select/form-nested-select.js +2 -0
  390. package/form/form-nested-select/form-nested-select.js.map +1 -0
  391. package/form/form-nested-select/index.d.ts +2 -0
  392. package/form/form-nested-select/types.d.ts +11 -0
  393. package/form/{form-otp-verification.d.ts → form-otp-verification/form-otp-verification.d.ts} +1 -1
  394. package/form/form-otp-verification/form-otp-verification.js +2 -0
  395. package/form/form-otp-verification/form-otp-verification.js.map +1 -0
  396. package/form/form-otp-verification/index.d.ts +2 -0
  397. package/form/form-otp-verification/types.d.ts +1 -0
  398. package/form/form-phone-number-input/form-phone-number-input.js +2 -0
  399. package/form/form-phone-number-input/form-phone-number-input.js.map +1 -0
  400. package/form/form-phone-number-input/index.d.ts +2 -0
  401. package/form/form-phone-number-input/types.d.ts +8 -0
  402. package/form/form-predictive-text-input/form-predictive-text-input.js +2 -0
  403. package/form/form-predictive-text-input/form-predictive-text-input.js.map +1 -0
  404. package/form/form-predictive-text-input/index.d.ts +2 -0
  405. package/form/form-predictive-text-input/types.d.ts +10 -0
  406. package/form/form-range-select/form-range-select.js +2 -0
  407. package/form/form-range-select/form-range-select.js.map +1 -0
  408. package/form/form-range-select/index.d.ts +2 -0
  409. package/form/form-range-select/types.d.ts +10 -0
  410. package/form/form-range-slider/form-range-slider.js +2 -0
  411. package/form/form-range-slider/form-range-slider.js.map +1 -0
  412. package/form/form-range-slider/index.d.ts +2 -0
  413. package/form/form-range-slider/types.d.ts +8 -0
  414. package/form/form-select/form-select.js +2 -0
  415. package/form/form-select/form-select.js.map +1 -0
  416. package/form/form-select/index.d.ts +2 -0
  417. package/form/form-select/types.d.ts +10 -0
  418. package/form/form-select-histogram/form-select-histogram.js +2 -0
  419. package/form/form-select-histogram/form-select-histogram.js.map +1 -0
  420. package/form/form-select-histogram/index.d.ts +2 -0
  421. package/form/form-select-histogram/types.d.ts +8 -0
  422. package/form/form-slider/form-slider.js +2 -0
  423. package/form/form-slider/form-slider.js.map +1 -0
  424. package/form/form-slider/index.d.ts +2 -0
  425. package/form/form-slider/types.d.ts +8 -0
  426. package/form/form-textarea/form-textarea.js +2 -0
  427. package/form/form-textarea/form-textarea.js.map +1 -0
  428. package/form/form-textarea/form-textarea.styles.js +2 -0
  429. package/form/form-textarea/form-textarea.styles.js.map +1 -0
  430. package/form/form-textarea/form-textarea.styles_1kneyif.css +3 -0
  431. package/form/form-textarea/index.d.ts +2 -0
  432. package/form/form-textarea/types.d.ts +8 -0
  433. package/form/form-time-range-picker/form-time-range-picker.js +2 -0
  434. package/form/form-time-range-picker/form-time-range-picker.js.map +1 -0
  435. package/form/form-time-range-picker/index.d.ts +2 -0
  436. package/form/form-time-range-picker/types.d.ts +8 -0
  437. package/form/form-timepicker/form-timepicker.js +2 -0
  438. package/form/form-timepicker/form-timepicker.js.map +1 -0
  439. package/form/form-timepicker/index.d.ts +2 -0
  440. package/form/form-timepicker/types.d.ts +8 -0
  441. package/form/form-unit-number-input/form-unit-number-input.js +2 -0
  442. package/form/form-unit-number-input/form-unit-number-input.js.map +1 -0
  443. package/form/form-unit-number-input/index.d.ts +2 -0
  444. package/form/form-unit-number-input/types.d.ts +8 -0
  445. package/form/form-wrapper.js +1 -1
  446. package/form/form-wrapper.js.map +1 -1
  447. package/form/index.d.ts +104 -24
  448. package/form/index.js +1 -1
  449. package/form/index.js.map +1 -1
  450. package/form/types.d.ts +27 -85
  451. package/fullscreen-image-carousel/fullscreen-image-carousel.d.ts +7 -0
  452. package/fullscreen-image-carousel/fullscreen-image-carousel.js +1 -1
  453. package/fullscreen-image-carousel/fullscreen-image-carousel.js.map +1 -1
  454. package/fullscreen-image-carousel/types.d.ts +91 -3
  455. package/histogram-slider/histogram-slider.d.ts +6 -0
  456. package/histogram-slider/histogram-slider.js.map +1 -1
  457. package/histogram-slider/types.d.ts +63 -3
  458. package/image-button/image-button.d.ts +6 -0
  459. package/image-button/image-button.js.map +1 -1
  460. package/image-button/types.d.ts +11 -1
  461. package/index.js +1 -1
  462. package/input/input.d.ts +6 -0
  463. package/input/input.js.map +1 -1
  464. package/input/types.d.ts +38 -2
  465. package/input-group/input-group.d.ts +7 -0
  466. package/input-group/input-group.js.map +1 -1
  467. package/input-group/types.d.ts +84 -8
  468. package/input-multi-select/input-multi-select.d.ts +6 -0
  469. package/input-multi-select/input-multi-select.js.map +1 -1
  470. package/input-multi-select/types.d.ts +46 -5
  471. package/input-nested-multi-select/input-nested-multi-select.d.ts +8 -0
  472. package/input-nested-multi-select/input-nested-multi-select.js.map +1 -1
  473. package/input-nested-multi-select/types.d.ts +35 -5
  474. package/input-nested-select/input-nested-select.d.ts +9 -2
  475. package/input-nested-select/input-nested-select.js.map +1 -1
  476. package/input-nested-select/types.d.ts +77 -8
  477. package/input-range-select/input-range-select.d.ts +6 -0
  478. package/input-range-select/input-range-select.js.map +1 -1
  479. package/input-range-select/types.d.ts +68 -1
  480. package/input-range-slider/input-range-slider.d.ts +7 -0
  481. package/input-range-slider/input-range-slider.js.map +1 -1
  482. package/input-range-slider/types.d.ts +91 -6
  483. package/input-select/input-select.d.ts +5 -0
  484. package/input-select/input-select.js.map +1 -1
  485. package/input-select/types.d.ts +70 -14
  486. package/input-slider/input-slider.d.ts +6 -0
  487. package/input-slider/input-slider.js.map +1 -1
  488. package/input-slider/types.d.ts +21 -2
  489. package/input-textarea/textarea.d.ts +3 -0
  490. package/input-textarea/textarea.js.map +1 -1
  491. package/input-textarea/textarea.styles.js +1 -1
  492. package/input-textarea/textarea.styles.js.map +1 -1
  493. package/input-textarea/{textarea.styles_22z4n3.css → textarea.styles_q77m5x.css} +1 -1
  494. package/input-textarea/types.d.ts +24 -1
  495. package/language-switcher/language-switcher.d.ts +6 -0
  496. package/language-switcher/language-switcher.js.map +1 -1
  497. package/language-switcher/types.d.ts +23 -0
  498. package/layout/index.d.ts +16 -2
  499. package/layout/index.js +1 -1
  500. package/layout/index.js.map +1 -1
  501. package/layout/types.d.ts +61 -3
  502. package/link-list/components/common.d.ts +1 -1
  503. package/link-list/components/common.js.map +1 -1
  504. package/link-list/components/link-list-eager.d.ts +2 -2
  505. package/link-list/components/link-list-eager.js.map +1 -1
  506. package/link-list/components/link-list-lazy.d.ts +2 -2
  507. package/link-list/components/link-list-lazy.js.map +1 -1
  508. package/link-list/link-list.d.ts +6 -0
  509. package/link-list/link-list.js.map +1 -1
  510. package/link-list/types.d.ts +92 -3
  511. package/local-nav/local-nav-dropdown/local-nav-dropdown.d.ts +11 -0
  512. package/local-nav/local-nav-dropdown/local-nav-dropdown.js.map +1 -1
  513. package/local-nav/local-nav-menu/local-nav-menu.d.ts +6 -0
  514. package/local-nav/local-nav-menu/local-nav-menu.js.map +1 -1
  515. package/local-nav/types.d.ts +51 -0
  516. package/markup/markup.d.ts +6 -0
  517. package/markup/markup.js.map +1 -1
  518. package/markup/types.d.ts +6 -2
  519. package/masked-input/masked-input.d.ts +6 -0
  520. package/masked-input/masked-input.js.map +1 -1
  521. package/masked-input/types.d.ts +83 -8
  522. package/masthead/masthead.d.ts +6 -0
  523. package/masthead/masthead.js.map +1 -1
  524. package/masthead/types.d.ts +9 -0
  525. package/menu/menu.d.ts +27 -4
  526. package/menu/menu.js +1 -1
  527. package/menu/menu.js.map +1 -1
  528. package/menu/types.d.ts +49 -1
  529. package/modal/index.d.ts +13 -0
  530. package/modal/index.js.map +1 -1
  531. package/modal/modal-box.js +1 -1
  532. package/modal/modal-box.js.map +1 -1
  533. package/modal/types.d.ts +56 -7
  534. package/modal-v2/index.d.ts +1 -15
  535. package/modal-v2/index.js +1 -1
  536. package/modal-v2/index.js.map +1 -1
  537. package/modal-v2/modal-v2.d.ts +32 -1
  538. package/modal-v2/modal-v2.js +1 -1
  539. package/modal-v2/modal-v2.js.map +1 -1
  540. package/modal-v2/slots/card.js +1 -1
  541. package/modal-v2/slots/card.js.map +1 -1
  542. package/modal-v2/types.d.ts +92 -8
  543. package/navbar/navbar.d.ts +7 -0
  544. package/navbar/navbar.js.map +1 -1
  545. package/navbar/types.d.ts +201 -13
  546. package/notification-banner/notification-banner-hoc.d.ts +6 -0
  547. package/notification-banner/notification-banner-hoc.js.map +1 -1
  548. package/notification-banner/notification-banner.d.ts +7 -0
  549. package/notification-banner/notification-banner.js.map +1 -1
  550. package/notification-banner/types.d.ts +57 -2
  551. package/otp-input/otp-input.d.ts +7 -0
  552. package/otp-input/otp-input.js +1 -1
  553. package/otp-input/otp-input.js.map +1 -1
  554. package/otp-input/types.d.ts +63 -15
  555. package/otp-verification/contact-input-section.js +1 -1
  556. package/otp-verification/contact-input-section.js.map +1 -1
  557. package/otp-verification/internal-types.d.ts +22 -5
  558. package/otp-verification/otp-verification.d.ts +6 -0
  559. package/otp-verification/otp-verification.js.map +1 -1
  560. package/otp-verification/types.d.ts +125 -6
  561. package/otp-verification/verification-section.js +1 -1
  562. package/otp-verification/verification-section.js.map +1 -1
  563. package/overlay/overlay.d.ts +7 -0
  564. package/overlay/overlay.js.map +1 -1
  565. package/overlay/types.d.ts +57 -2
  566. package/package.json +1 -1
  567. package/pagination/pagination.d.ts +5 -0
  568. package/pagination/pagination.js.map +1 -1
  569. package/pagination/types.d.ts +48 -0
  570. package/phone-number-input/phone-number-input.d.ts +7 -0
  571. package/phone-number-input/phone-number-input.js.map +1 -1
  572. package/phone-number-input/types.d.ts +78 -13
  573. package/pill/pill.d.ts +6 -0
  574. package/pill/pill.js.map +1 -1
  575. package/pill/types.d.ts +19 -0
  576. package/popover/popover-inline/index.d.ts +1 -0
  577. package/popover/popover-inline/popover-inline.d.ts +6 -1
  578. package/popover/popover-inline/popover-inline.js.map +1 -1
  579. package/popover/popover-inline/types.d.ts +36 -0
  580. package/popover/popover-trigger.d.ts +6 -0
  581. package/popover/popover-trigger.js.map +1 -1
  582. package/popover/popover.d.ts +6 -0
  583. package/popover/popover.js +1 -1
  584. package/popover/popover.js.map +1 -1
  585. package/popover/types.d.ts +125 -11
  586. package/predictive-text-input/predictive-text-input.d.ts +6 -0
  587. package/predictive-text-input/predictive-text-input.js +1 -1
  588. package/predictive-text-input/predictive-text-input.js.map +1 -1
  589. package/predictive-text-input/types.d.ts +65 -11
  590. package/progress-indicator/progress-indicator.d.ts +7 -0
  591. package/progress-indicator/progress-indicator.js.map +1 -1
  592. package/progress-indicator/types.d.ts +18 -0
  593. package/radio-button/radio-button.d.ts +5 -0
  594. package/radio-button/radio-button.js.map +1 -1
  595. package/radio-button/types.d.ts +14 -0
  596. package/schedule/internal-types.d.ts +18 -0
  597. package/schedule/schedule-day-view/types.d.ts +2 -1
  598. package/schedule/schedule-week-view/types.d.ts +2 -1
  599. package/schedule/schedule.d.ts +3 -0
  600. package/schedule/schedule.js.map +1 -1
  601. package/schedule/shared/with-optional-popover.js +1 -1
  602. package/schedule/shared/with-optional-popover.js.map +1 -1
  603. package/schedule/types.d.ts +129 -10
  604. package/select-histogram/select-histogram.d.ts +5 -0
  605. package/select-histogram/select-histogram.js.map +1 -1
  606. package/select-histogram/types.d.ts +57 -4
  607. package/shared/dropdown-list/dropdown-list.js +1 -1
  608. package/shared/dropdown-list/dropdown-list.js.map +1 -1
  609. package/shared/dropdown-list/types.d.ts +52 -19
  610. package/shared/dropdown-wrapper/element-with-dropdown.d.ts +5 -4
  611. package/shared/dropdown-wrapper/element-with-dropdown.js +1 -1
  612. package/shared/dropdown-wrapper/element-with-dropdown.js.map +1 -1
  613. package/shared/dropdown-wrapper/types.d.ts +6 -0
  614. package/sidenav/sidenav.d.ts +10 -0
  615. package/sidenav/sidenav.js.map +1 -1
  616. package/sidenav/types.d.ts +71 -21
  617. package/singpass-button/singpass-button.d.ts +6 -0
  618. package/singpass-button/singpass-button.js.map +1 -1
  619. package/singpass-button/types.d.ts +29 -2
  620. package/smart-app-banner/smart-app-banner.d.ts +5 -0
  621. package/smart-app-banner/smart-app-banner.js.map +1 -1
  622. package/smart-app-banner/types.d.ts +56 -0
  623. package/tab/tab.d.ts +7 -0
  624. package/tab/tab.js.map +1 -1
  625. package/tab/types.d.ts +55 -6
  626. package/table/table.d.ts +30 -8
  627. package/table/table.js.map +1 -1
  628. package/table/table.styles.js +1 -1
  629. package/table/table.styles.js.map +1 -1
  630. package/table/{table.styles_1af5ipv.css → table.styles_1vjx31g.css} +1 -1
  631. package/table/types.d.ts +35 -0
  632. package/tag/tag.d.ts +5 -0
  633. package/tag/tag.js.map +1 -1
  634. package/tag/types.d.ts +24 -0
  635. package/text-list/index.d.ts +17 -0
  636. package/text-list/index.js.map +1 -1
  637. package/text-list/types.d.ts +33 -4
  638. package/theme/theme-provider/breakpoint.d.ts +0 -1
  639. package/theme/theme-provider/breakpoint.js +1 -1
  640. package/theme/theme-provider/breakpoint.js.map +1 -1
  641. package/theme/theme-provider/hooks.d.ts +16 -0
  642. package/theme/theme-provider/hooks.js.map +1 -1
  643. package/theme/theme-provider/index.d.ts +7 -0
  644. package/theme/theme-provider/index.js.map +1 -1
  645. package/theme/theme-provider/types.d.ts +14 -0
  646. package/theme/tokens/border.d.ts +9 -0
  647. package/theme/tokens/border.js.map +1 -1
  648. package/theme/tokens/breakpoint.d.ts +3 -0
  649. package/theme/tokens/breakpoint.js.map +1 -1
  650. package/theme/tokens/colour.d.ts +9 -0
  651. package/theme/tokens/colour.js.map +1 -1
  652. package/theme/tokens/component.d.ts +3 -0
  653. package/theme/tokens/component.js.map +1 -1
  654. package/theme/tokens/font.d.ts +6 -0
  655. package/theme/tokens/font.js.map +1 -1
  656. package/theme/tokens/media-query.d.ts +3 -0
  657. package/theme/tokens/media-query.js.map +1 -1
  658. package/theme/tokens/motion.d.ts +3 -0
  659. package/theme/tokens/motion.js.map +1 -1
  660. package/theme/tokens/radius.d.ts +3 -0
  661. package/theme/tokens/radius.js.map +1 -1
  662. package/theme/tokens/shadow.d.ts +3 -0
  663. package/theme/tokens/shadow.js.map +1 -1
  664. package/theme/tokens/spacing.d.ts +3 -0
  665. package/theme/tokens/spacing.js.map +1 -1
  666. package/theme/types.d.ts +23 -3
  667. package/theme/types.js.map +1 -1
  668. package/theme/utils/css-variable.d.ts +10 -2
  669. package/theme/utils/css-variable.js.map +1 -1
  670. package/theme/utils/font.d.ts +2 -1
  671. package/theme/utils/font.js.map +1 -1
  672. package/theme/utils/use-apply-styles.d.ts +8 -2
  673. package/theme/utils/use-apply-styles.js +1 -1
  674. package/theme/utils/use-apply-styles.js.map +1 -1
  675. package/theme/utils/use-design-token-override.d.ts +9 -1
  676. package/theme/utils/use-design-token-override.js.map +1 -1
  677. package/theme/utils/use-design-token.d.ts +9 -0
  678. package/theme/utils/use-design-token.js.map +1 -1
  679. package/theme/utils/use-media-query.d.ts +41 -3
  680. package/theme/utils/use-media-query.js.map +1 -1
  681. package/time-range-picker/combobox-picker/combobox-picker.js +1 -1
  682. package/time-range-picker/combobox-picker/combobox-picker.js.map +1 -1
  683. package/time-range-picker/common.styles.d.ts +1 -0
  684. package/time-range-picker/common.styles.js +1 -1
  685. package/time-range-picker/common.styles.js.map +1 -1
  686. package/time-range-picker/{common.styles_1qwp4xa.css → common.styles_cnkkax.css} +2 -1
  687. package/time-range-picker/dial-picker/dial-picker.js +1 -1
  688. package/time-range-picker/dial-picker/dial-picker.js.map +1 -1
  689. package/time-range-picker/time-range-picker.d.ts +5 -0
  690. package/time-range-picker/time-range-picker.js.map +1 -1
  691. package/time-range-picker/types.d.ts +85 -25
  692. package/time-slot-bar/internal-types.d.ts +1 -0
  693. package/time-slot-bar/time-slot-bar.d.ts +7 -0
  694. package/time-slot-bar/time-slot-bar.js.map +1 -1
  695. package/time-slot-bar/types.d.ts +116 -20
  696. package/time-slot-bar-week/time-slot-bar-week.d.ts +8 -0
  697. package/time-slot-bar-week/time-slot-bar-week.js.map +1 -1
  698. package/time-slot-bar-week/types.d.ts +80 -13
  699. package/time-slot-week-view/time-slot-week-view.d.ts +7 -0
  700. package/time-slot-week-view/time-slot-week-view.js.map +1 -1
  701. package/time-slot-week-view/types.d.ts +55 -10
  702. package/timeline/timeline.d.ts +6 -0
  703. package/timeline/timeline.js.map +1 -1
  704. package/timeline/types.d.ts +58 -4
  705. package/timepicker/timepicker.d.ts +5 -0
  706. package/timepicker/timepicker.js +1 -1
  707. package/timepicker/timepicker.js.map +1 -1
  708. package/timepicker/timepicker.styles.d.ts +1 -0
  709. package/timepicker/timepicker.styles.js +1 -1
  710. package/timepicker/timepicker.styles.js.map +1 -1
  711. package/timepicker/timepicker.styles_lyizvq.css +2 -0
  712. package/timepicker/types.d.ts +49 -14
  713. package/timetable/timetable-row/with-optional-popover.js +1 -1
  714. package/timetable/timetable-row/with-optional-popover.js.map +1 -1
  715. package/timetable/timetable.d.ts +6 -0
  716. package/timetable/timetable.js +1 -1
  717. package/timetable/timetable.js.map +1 -1
  718. package/timetable/types.d.ts +175 -50
  719. package/toast/toast.d.ts +6 -0
  720. package/toast/toast.js.map +1 -1
  721. package/toast/types.d.ts +44 -8
  722. package/toggle/toggle.d.ts +6 -0
  723. package/toggle/toggle.js.map +1 -1
  724. package/toggle/types.d.ts +95 -17
  725. package/tools/shared/generated-file-formatter.d.ts +6 -0
  726. package/tools/shared/jsdoc-parser.d.ts +36 -0
  727. package/tools/shared/ts-morph-project-factory.d.ts +9 -0
  728. package/tools/shared/typescript-source-provider.d.ts +9 -0
  729. package/tools/storybook-argtypes/adapters/file-system-adapter.d.ts +69 -0
  730. package/tools/storybook-argtypes/arg-types-generator.d.ts +85 -0
  731. package/tools/storybook-argtypes/config/arg-types-config.d.ts +31 -0
  732. package/tools/storybook-argtypes/index.d.ts +11 -0
  733. package/tools/storybook-argtypes/services/arg-types-row-builder.d.ts +43 -0
  734. package/tools/storybook-argtypes/services/file-path-resolver.d.ts +118 -0
  735. package/tools/storybook-argtypes/services/index.d.ts +6 -0
  736. package/tools/storybook-argtypes/services/jsdoc-metadata-extractor.d.ts +33 -0
  737. package/tools/storybook-argtypes/services/story-registry-generator.d.ts +27 -0
  738. package/tools/storybook-argtypes/services/type-dependency-resolver.d.ts +46 -0
  739. package/tools/storybook-argtypes/services/type-formatting-service.d.ts +27 -0
  740. package/tools/storybook-argtypes/types.d.ts +102 -0
  741. package/typography/index.d.ts +29 -0
  742. package/typography/index.js.map +1 -1
  743. package/typography/types.d.ts +51 -8
  744. package/uneditable-section/index.d.ts +15 -0
  745. package/uneditable-section/index.js.map +1 -1
  746. package/uneditable-section/section-item.js +1 -1
  747. package/uneditable-section/section-item.js.map +1 -1
  748. package/uneditable-section/types.d.ts +66 -23
  749. package/unit-number/types.d.ts +30 -4
  750. package/unit-number/unit-number-input.d.ts +6 -0
  751. package/unit-number/unit-number-input.js.map +1 -1
  752. package/util/index.d.ts +1 -0
  753. package/util/merge-refs.d.ts +1 -1
  754. package/util/merge-refs.js.map +1 -1
  755. package/util/use-throttle.d.ts +1 -0
  756. package/util/use-throttle.js +2 -0
  757. package/util/use-throttle.js.map +1 -0
  758. package/cjs/data-table/data-table.styles_1iqq1g7.css +0 -26
  759. package/cjs/form/form-custom-field.js +0 -2
  760. package/cjs/form/form-custom-field.js.map +0 -1
  761. package/cjs/form/form-date-input.js +0 -2
  762. package/cjs/form/form-date-input.js.map +0 -1
  763. package/cjs/form/form-date-range-input.js +0 -2
  764. package/cjs/form/form-date-range-input.js.map +0 -1
  765. package/cjs/form/form-e-signature.js +0 -2
  766. package/cjs/form/form-e-signature.js.map +0 -1
  767. package/cjs/form/form-histogram.js +0 -2
  768. package/cjs/form/form-histogram.js.map +0 -1
  769. package/cjs/form/form-input-group.js +0 -2
  770. package/cjs/form/form-input-group.js.map +0 -1
  771. package/cjs/form/form-input.js +0 -2
  772. package/cjs/form/form-input.js.map +0 -1
  773. package/cjs/form/form-label-addon.js +0 -2
  774. package/cjs/form/form-label-addon.js.map +0 -1
  775. package/cjs/form/form-label-addon.styles.js +0 -2
  776. package/cjs/form/form-label-addon.styles.js.map +0 -1
  777. package/cjs/form/form-label-addon.styles_b00z8p.css +0 -1
  778. package/cjs/form/form-label.js +0 -2
  779. package/cjs/form/form-label.js.map +0 -1
  780. package/cjs/form/form-label.styles.js +0 -2
  781. package/cjs/form/form-label.styles.js.map +0 -1
  782. package/cjs/form/form-label.styles_1nbe0bm.css +0 -6
  783. package/cjs/form/form-masked-input.js +0 -2
  784. package/cjs/form/form-masked-input.js.map +0 -1
  785. package/cjs/form/form-multi-select.js +0 -2
  786. package/cjs/form/form-multi-select.js.map +0 -1
  787. package/cjs/form/form-nested-multi-select.js +0 -2
  788. package/cjs/form/form-nested-multi-select.js.map +0 -1
  789. package/cjs/form/form-nested-select.js +0 -2
  790. package/cjs/form/form-nested-select.js.map +0 -1
  791. package/cjs/form/form-otp-verification.js +0 -2
  792. package/cjs/form/form-otp-verification.js.map +0 -1
  793. package/cjs/form/form-phone-number-input.js +0 -2
  794. package/cjs/form/form-phone-number-input.js.map +0 -1
  795. package/cjs/form/form-predictive-text-input.js +0 -2
  796. package/cjs/form/form-predictive-text-input.js.map +0 -1
  797. package/cjs/form/form-range-select.js +0 -2
  798. package/cjs/form/form-range-select.js.map +0 -1
  799. package/cjs/form/form-range-slider.js +0 -2
  800. package/cjs/form/form-range-slider.js.map +0 -1
  801. package/cjs/form/form-select-histogram.js +0 -2
  802. package/cjs/form/form-select-histogram.js.map +0 -1
  803. package/cjs/form/form-select.js +0 -2
  804. package/cjs/form/form-select.js.map +0 -1
  805. package/cjs/form/form-slider.js +0 -2
  806. package/cjs/form/form-slider.js.map +0 -1
  807. package/cjs/form/form-textarea.js +0 -2
  808. package/cjs/form/form-textarea.js.map +0 -1
  809. package/cjs/form/form-textarea.styles.js +0 -2
  810. package/cjs/form/form-textarea.styles.js.map +0 -1
  811. package/cjs/form/form-textarea.styles_3p9qoy.css +0 -3
  812. package/cjs/form/form-time-range-picker.js +0 -2
  813. package/cjs/form/form-time-range-picker.js.map +0 -1
  814. package/cjs/form/form-timepicker.js +0 -2
  815. package/cjs/form/form-timepicker.js.map +0 -1
  816. package/cjs/form/form-unit-number-input.js +0 -2
  817. package/cjs/form/form-unit-number-input.js.map +0 -1
  818. package/cjs/timepicker/timepicker.styles_1jm33yw.css +0 -1
  819. package/data-table/data-table.styles_1iqq1g7.css +0 -26
  820. package/form/form-custom-field.js +0 -2
  821. package/form/form-custom-field.js.map +0 -1
  822. package/form/form-date-input.js +0 -2
  823. package/form/form-date-input.js.map +0 -1
  824. package/form/form-date-range-input.js +0 -2
  825. package/form/form-date-range-input.js.map +0 -1
  826. package/form/form-e-signature.js +0 -2
  827. package/form/form-e-signature.js.map +0 -1
  828. package/form/form-histogram.js +0 -2
  829. package/form/form-histogram.js.map +0 -1
  830. package/form/form-input-group.js +0 -2
  831. package/form/form-input-group.js.map +0 -1
  832. package/form/form-input.js +0 -2
  833. package/form/form-input.js.map +0 -1
  834. package/form/form-label-addon.js +0 -2
  835. package/form/form-label-addon.js.map +0 -1
  836. package/form/form-label-addon.styles.js +0 -2
  837. package/form/form-label-addon.styles.js.map +0 -1
  838. package/form/form-label-addon.styles_b00z8p.css +0 -1
  839. package/form/form-label.js +0 -2
  840. package/form/form-label.js.map +0 -1
  841. package/form/form-label.styles.js +0 -2
  842. package/form/form-label.styles.js.map +0 -1
  843. package/form/form-label.styles_1nbe0bm.css +0 -6
  844. package/form/form-masked-input.js +0 -2
  845. package/form/form-masked-input.js.map +0 -1
  846. package/form/form-multi-select.js +0 -2
  847. package/form/form-multi-select.js.map +0 -1
  848. package/form/form-nested-multi-select.js +0 -2
  849. package/form/form-nested-multi-select.js.map +0 -1
  850. package/form/form-nested-select.js +0 -2
  851. package/form/form-nested-select.js.map +0 -1
  852. package/form/form-otp-verification.js +0 -2
  853. package/form/form-otp-verification.js.map +0 -1
  854. package/form/form-phone-number-input.js +0 -2
  855. package/form/form-phone-number-input.js.map +0 -1
  856. package/form/form-predictive-text-input.js +0 -2
  857. package/form/form-predictive-text-input.js.map +0 -1
  858. package/form/form-range-select.js +0 -2
  859. package/form/form-range-select.js.map +0 -1
  860. package/form/form-range-slider.js +0 -2
  861. package/form/form-range-slider.js.map +0 -1
  862. package/form/form-select-histogram.js +0 -2
  863. package/form/form-select-histogram.js.map +0 -1
  864. package/form/form-select.js +0 -2
  865. package/form/form-select.js.map +0 -1
  866. package/form/form-slider.js +0 -2
  867. package/form/form-slider.js.map +0 -1
  868. package/form/form-textarea.js +0 -2
  869. package/form/form-textarea.js.map +0 -1
  870. package/form/form-textarea.styles.js +0 -2
  871. package/form/form-textarea.styles.js.map +0 -1
  872. package/form/form-textarea.styles_3p9qoy.css +0 -3
  873. package/form/form-time-range-picker.js +0 -2
  874. package/form/form-time-range-picker.js.map +0 -1
  875. package/form/form-timepicker.js +0 -2
  876. package/form/form-timepicker.js.map +0 -1
  877. package/form/form-unit-number-input.js +0 -2
  878. package/form/form-unit-number-input.js.map +0 -1
  879. package/link-list/internal-types.d.ts +0 -31
  880. package/timepicker/timepicker.styles_1jm33yw.css +0 -1
  881. /package/{codemod-utils.d.ts → codemods/codemod-utils.d.ts} +0 -0
  882. /package/{migrate-popover → codemods/migrate-popover}/index.d.ts +0 -0
  883. /package/{run-codemod.d.ts → codemods/run-codemod.d.ts} +0 -0
  884. /package/form/{form-custom-field.d.ts → form-custom-field/form-custom-field.d.ts} +0 -0
  885. /package/form/{form-date-input.d.ts → form-date-input/form-date-input.d.ts} +0 -0
  886. /package/form/{form-date-range-input.d.ts → form-date-range-input/form-date-range-input.d.ts} +0 -0
  887. /package/form/{form-e-signature.d.ts → form-e-signature/form-e-signature.d.ts} +0 -0
  888. /package/form/{form-histogram.d.ts → form-histogram-slider/form-histogram-slider.d.ts} +0 -0
  889. /package/form/{form-input.d.ts → form-input/form-input.d.ts} +0 -0
  890. /package/form/{form-input-group.d.ts → form-input-group/form-input-group.d.ts} +0 -0
  891. /package/form/{form-label-addon.d.ts → form-label/form-label-addon.d.ts} +0 -0
  892. /package/form/{form-label-addon.styles.d.ts → form-label/form-label-addon.styles.d.ts} +0 -0
  893. /package/form/{form-label.d.ts → form-label/form-label.d.ts} +0 -0
  894. /package/form/{form-label.styles.d.ts → form-label/form-label.styles.d.ts} +0 -0
  895. /package/form/{form-masked-input.d.ts → form-masked-input/form-masked-input.d.ts} +0 -0
  896. /package/form/{form-multi-select.d.ts → form-multi-select/form-multi-select.d.ts} +0 -0
  897. /package/form/{form-nested-multi-select.d.ts → form-nested-multi-select/form-nested-multi-select.d.ts} +0 -0
  898. /package/form/{form-nested-select.d.ts → form-nested-select/form-nested-select.d.ts} +0 -0
  899. /package/form/{form-phone-number-input.d.ts → form-phone-number-input/form-phone-number-input.d.ts} +0 -0
  900. /package/form/{form-predictive-text-input.d.ts → form-predictive-text-input/form-predictive-text-input.d.ts} +0 -0
  901. /package/form/{form-range-select.d.ts → form-range-select/form-range-select.d.ts} +0 -0
  902. /package/form/{form-range-slider.d.ts → form-range-slider/form-range-slider.d.ts} +0 -0
  903. /package/form/{form-select.d.ts → form-select/form-select.d.ts} +0 -0
  904. /package/form/{form-select-histogram.d.ts → form-select-histogram/form-select-histogram.d.ts} +0 -0
  905. /package/form/{form-slider.d.ts → form-slider/form-slider.d.ts} +0 -0
  906. /package/form/{form-textarea.d.ts → form-textarea/form-textarea.d.ts} +0 -0
  907. /package/form/{form-textarea.styles.d.ts → form-textarea/form-textarea.styles.d.ts} +0 -0
  908. /package/form/{form-time-range-picker.d.ts → form-time-range-picker/form-time-range-picker.d.ts} +0 -0
  909. /package/form/{form-timepicker.d.ts → form-timepicker/form-timepicker.d.ts} +0 -0
  910. /package/form/{form-unit-number-input.d.ts → form-unit-number-input/form-unit-number-input.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sources":["../../../src/modal-v2/slots/card.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type { NamedExoticComponent } from \"react\";\nimport React from \"react\";\n\nimport isStyledComponent from \"../../util/is-styled-components\";\nimport type { ModalCardProps } from \"../types\";\nimport { CloseButton } from \"./close-button\";\nimport { Content } from \"./content\";\nimport { Footer } from \"./footer\";\nimport * as styles from \"./slot-styles\";\n\nfunction CardInner(\n {\n id,\n \"data-testid\": testId = \"modal-card\",\n children,\n className,\n ...otherProps\n }: ModalCardProps,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleOnClick = (event: React.MouseEvent) => {\n event.stopPropagation();\n };\n\n // =========================================================================\n // HELPERS\n // =========================================================================\n const isComponentType = (child: React.ReactPortal, type: any) =>\n isStyledComponent(child.type)\n ? (child.type as unknown as { target: any }).target === type\n : child.type === type;\n\n const findComponentOfType = (type: any) => {\n return React.Children.toArray(children).find((child) =>\n isComponentType(child as React.ReactPortal, type)\n );\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const CloseButtonSlot = findComponentOfType(CloseButton);\n const ContentSlot = findComponentOfType(Content);\n const FooterSlot = findComponentOfType(Footer);\n\n const hasCloseButton = !!CloseButtonSlot;\n\n return (\n <div\n ref={ref}\n id={id}\n data-testid={testId}\n {...otherProps}\n onClick={handleOnClick}\n className={clsx(styles.modalCard, className)}\n >\n <div\n data-has-close-button={hasCloseButton ? \"true\" : \"false\"}\n className={clsx(styles.slotSpacer)}\n >\n {ContentSlot}\n {FooterSlot}\n </div>\n {hasCloseButton && CloseButtonSlot}\n </div>\n );\n}\n\nexport const Card = React.forwardRef<HTMLDivElement, ModalCardProps>(CardInner);\n\n(Card as NamedExoticComponent).displayName = \"ModalV2.Card\";\n"],"names":["Card","React","forwardRef","_a","ref","id","testId","children","className","otherProps","__rest","findComponentOfType","type","Children","toArray","find","child","isStyledComponent","target","isComponentType","CloseButtonSlot","CloseButton","ContentSlot","Content","FooterSlot","Footer","hasCloseButton","_jsxs","Object","assign","onClick","event","stopPropagation","clsx","styles.modalCard","styles.slotSpacer","displayName"],"mappings":"+WAwEO,MAAMA,EAAOC,EAAMC,YA7D1B,SACIC,EAOAC,GAPA,IAAAC,GACIA,EACA,cAAeC,EAAS,aAAYC,SACpCA,EAAQC,UACRA,GAASL,EACNM,EAAUC,EAAAP,EALjB,6CAYA,MAYMQ,EAAuBC,GAClBX,EAAMY,SAASC,QAAQP,GAAUQ,MAAMC,GAN1B,EAACA,EAA0BJ,IAC/CK,EAAkBD,EAAMJ,MACjBI,EAAMJ,KAAoCM,SAAWN,EACtDI,EAAMJ,OAASA,EAIjBO,CAAgBH,EAA4BJ,KAO9CQ,EAAkBT,EAAoBU,GACtCC,EAAcX,EAAoBY,GAClCC,EAAab,EAAoBc,GAEjCC,IAAmBN,EAEzB,OACIO,EAAA,MAAAC,OAAAC,OAAA,CACIzB,IAAKA,EACLC,GAAIA,EAAE,cACOC,GACTG,EAAU,CACdqB,QAjCeC,IACnBA,EAAMC,iBAAiB,EAiCnBxB,UAAWyB,EAAKC,EAAkB1B,GAAUD,SAAA,CAE5CoB,EAAA,MAAA,CAAA,wBAC2BD,EAAiB,OAAS,QACjDlB,UAAWyB,EAAKE,GAAkB5B,SAAA,CAEjCe,EACAE,KAEJE,GAAkBN,KAG/B,IAICpB,EAA8BoC,YAAc"}
1
+ {"version":3,"file":"card.js","sources":["../../../src/modal-v2/slots/card.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport type { NamedExoticComponent } from \"react\";\nimport React from \"react\";\n\nimport { mergeRefs } from \"../../util\";\nimport isStyledComponent from \"../../util/is-styled-components\";\nimport type { ModalCardProps } from \"../types\";\nimport { CloseButton } from \"./close-button\";\nimport { Content } from \"./content\";\nimport { Footer } from \"./footer\";\nimport * as styles from \"./slot-styles\";\n\nfunction CardInner(\n {\n id,\n \"data-testid\": testId = \"modal-card\",\n children,\n className,\n elementRef,\n ...otherProps\n }: ModalCardProps,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n // =============================================================================\n // EVENT HANDLERS\n // =============================================================================\n const handleOnClick = (event: React.MouseEvent) => {\n event.stopPropagation();\n };\n\n // =========================================================================\n // HELPERS\n // =========================================================================\n const isComponentType = (child: React.ReactPortal, type: any) =>\n isStyledComponent(child.type)\n ? (child.type as unknown as { target: any }).target === type\n : child.type === type;\n\n const findComponentOfType = (type: any) => {\n return React.Children.toArray(children).find((child) =>\n isComponentType(child as React.ReactPortal, type)\n );\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n const CloseButtonSlot = findComponentOfType(CloseButton);\n const ContentSlot = findComponentOfType(Content);\n const FooterSlot = findComponentOfType(Footer);\n\n const hasCloseButton = !!CloseButtonSlot;\n\n return (\n <div\n ref={mergeRefs(ref, elementRef)}\n id={id}\n data-testid={testId}\n {...otherProps}\n onClick={handleOnClick}\n className={clsx(styles.modalCard, className)}\n >\n <div\n data-has-close-button={hasCloseButton ? \"true\" : \"false\"}\n className={clsx(styles.slotSpacer)}\n >\n {ContentSlot}\n {FooterSlot}\n </div>\n {hasCloseButton && CloseButtonSlot}\n </div>\n );\n}\n\nexport const Card = React.forwardRef<HTMLDivElement, ModalCardProps>(CardInner);\n\n(Card as NamedExoticComponent).displayName = \"ModalV2.Card\";\n"],"names":["Card","React","forwardRef","_a","ref","id","testId","children","className","elementRef","otherProps","__rest","findComponentOfType","type","Children","toArray","find","child","isStyledComponent","target","isComponentType","CloseButtonSlot","CloseButton","ContentSlot","Content","FooterSlot","Footer","hasCloseButton","_jsxs","Object","assign","mergeRefs","onClick","event","stopPropagation","clsx","styles.modalCard","styles.slotSpacer","displayName"],"mappings":"qmBA0EO,MAAMA,EAAOC,EAAMC,YA9D1B,SACIC,EAQAC,GARA,IAAAC,GACIA,EACA,cAAeC,EAAS,aAAYC,SACpCA,EAAQC,UACRA,EAASC,WACTA,GAAUN,EACPO,EAAUC,EAAAR,EANjB,0DAaA,MAYMS,EAAuBC,GAClBZ,EAAMa,SAASC,QAAQR,GAAUS,MAAMC,GAN1B,EAACA,EAA0BJ,IAC/CK,EAAkBD,EAAMJ,MACjBI,EAAMJ,KAAoCM,SAAWN,EACtDI,EAAMJ,OAASA,EAIjBO,CAAgBH,EAA4BJ,KAO9CQ,EAAkBT,EAAoBU,GACtCC,EAAcX,EAAoBY,GAClCC,EAAab,EAAoBc,GAEjCC,IAAmBN,EAEzB,OACIO,EAAA,MAAAC,OAAAC,OAAA,CACI1B,IAAK2B,EAAU3B,EAAKK,GACpBJ,GAAIA,EAAE,cACOC,GACTI,EAAU,CACdsB,QAjCeC,IACnBA,EAAMC,iBAAiB,EAiCnB1B,UAAW2B,EAAKC,EAAkB5B,GAAUD,SAAA,CAE5CqB,EAAA,MAAA,CAAA,wBAC2BD,EAAiB,OAAS,QACjDnB,UAAW2B,EAAKE,GAAkB9B,SAAA,CAEjCgB,EACAE,KAEJE,GAAkBN,KAG/B,IAICrB,EAA8BsC,YAAc"}
@@ -1,38 +1,122 @@
1
+ /**
2
+ * Direction from which the modal animates in and out.
3
+ */
1
4
  export type ModalAnimationDirection = "top" | "bottom" | "left" | "right";
5
+ /**
6
+ * Props for the `ModalV2.Card` sub-component.
7
+ */
2
8
  export interface ModalCardProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ /**
10
+ * @default "modal-card"
11
+ */
3
12
  "data-testid"?: string | undefined;
4
13
  children: React.ReactNode;
14
+ /**
15
+ * Ref to the modal card DOM element. When used within `Modal`, the default `ref` is not available and you can specify this instead.
16
+ */
17
+ elementRef?: React.Ref<HTMLDivElement> | undefined;
5
18
  }
19
+ /**
20
+ * Props for the `ModalV2.CloseButton` slot.
21
+ */
6
22
  export interface ModalCloseButtonProps extends React.HTMLAttributes<HTMLDivElement> {
23
+ /**
24
+ * @default "modal-close-button"
25
+ */
7
26
  "data-testid"?: string | undefined;
8
27
  }
28
+ /**
29
+ * Props for the `ModalV2.Content` slot.
30
+ */
9
31
  export interface ModalContentProps extends React.HTMLAttributes<HTMLDivElement> {
32
+ /**
33
+ * @default "modal-content"
34
+ */
10
35
  "data-testid"?: string | undefined;
11
36
  children: React.ReactNode;
12
37
  }
38
+ /**
39
+ * Props for the `ModalV2.Footer` slot.
40
+ */
13
41
  export interface ModalFooterProps extends React.HTMLAttributes<HTMLDivElement> {
42
+ /**
43
+ * @default "modal-footer"
44
+ */
14
45
  "data-testid"?: string | undefined;
46
+ /**
47
+ * Node rendered in the primary action position.
48
+ */
15
49
  primaryButton?: React.ReactNode | undefined;
50
+ /**
51
+ * Node rendered in the secondary action position.
52
+ */
16
53
  secondaryButton?: React.ReactNode | undefined;
17
54
  }
55
+ /**
56
+ * Props for the `ModalV2` component.
57
+ */
18
58
  export interface ModalV2Props extends React.HTMLAttributes<HTMLDivElement> {
59
+ /**
60
+ * @default "modal"
61
+ */
19
62
  "data-testid"?: string | undefined;
63
+ /**
64
+ * Controls whether the modal is visible.
65
+ *
66
+ * @default false
67
+ */
20
68
  show: boolean;
21
- /** The content of the modal. The parent element must be a valid HTML
22
- * element or a component that forwards a ref to a valid HTML element. This
23
- * element is used to determine the boundaries for overlay click
24
- * detection. Fragments are not supported. */
69
+ /**
70
+ * The content of the modal. The parent element must be a valid HTML
71
+ * element or a component that forwards a ref to a valid HTML element.
72
+ *
73
+ * @remarks This element is used to determine the boundaries for overlay click detection.
74
+ */
25
75
  children: React.JSX.Element;
26
- /** Animation direction of appearance and dismissal. Values: "top" | "bottom" | "left" | "right" */
76
+ /**
77
+ * Direction from which the modal animates in and out.
78
+ *
79
+ * @default "bottom"
80
+ */
27
81
  animationFrom?: ModalAnimationDirection | undefined;
82
+ /**
83
+ * Whether clicking the overlay backdrop triggers `onOverlayClick`.
84
+ * The caller is responsible for dismissing the modal in the callback.
85
+ *
86
+ * @default true
87
+ */
28
88
  enableOverlayClick?: boolean | undefined;
29
- /** The identifier of the element to inject the Modal into */
89
+ /**
90
+ * The `id` of the DOM element to portal the modal into.
91
+ */
30
92
  rootComponentId?: string | undefined;
93
+ /**
94
+ * The z-index applied to the overlay stack.
95
+ */
31
96
  zIndex?: number | undefined;
97
+ /**
98
+ * Called when the modal is dismissed via the Escape key and close button.
99
+ */
32
100
  onClose?: (() => void) | undefined;
101
+ /**
102
+ * Called when the overlay backdrop is clicked and `enableOverlayClick` is
103
+ * `true`.
104
+ */
33
105
  onOverlayClick?: (() => void) | undefined;
34
- /** Dismiss keyboard to keep modal in fullscreen */
106
+ /**
107
+ * Blurs the currently focused element when the modal becomes visible,
108
+ * dismissing the on-screen keyboard on mobile to prevent it from
109
+ * obscuring the modal.
110
+ *
111
+ * @default true
112
+ */
35
113
  dismissKeyboardOnShow?: boolean | undefined;
36
- /** Disable automatic initial focus on show. Consumer must focus an element within the modal. */
114
+ /**
115
+ * Disables automatic focus on the modal container when it opens. When
116
+ * `true`, the consumer is responsible for focusing an element within the
117
+ * modal.
118
+ *
119
+ * @default false
120
+ */
37
121
  disableInitialFocus?: boolean | undefined;
38
122
  }
@@ -1,3 +1,10 @@
1
1
  import type React from "react";
2
2
  import type { NavbarDrawerHandle, NavbarProps } from "./types";
3
+ /**
4
+ * The main site navigation bar with desktop and mobile drawer views.
5
+ *
6
+ * Use `Navbar` to render the primary navigation header. It displays brand
7
+ * logos, navigation items, and action buttons in a desktop bar, and
8
+ * automatically collapses items into a slide-in drawer for mobile viewports.
9
+ */
3
10
  export declare const Navbar: <T>(props: NavbarProps<T> & React.RefAttributes<NavbarDrawerHandle>) => React.ReactElement | null;
@@ -1 +1 @@
1
- {"version":3,"file":"navbar.js","sources":["../../src/navbar/navbar.tsx"],"sourcesContent":["import { MenuIcon } from \"@lifesg/react-icons/menu\";\nimport clsx from \"clsx\";\nimport type React from \"react\";\nimport {\n forwardRef,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\n\nimport { Layout } from \"../layout\";\nimport { Masthead } from \"../masthead/masthead\";\nimport { Overlay } from \"../overlay/overlay\";\nimport { ClickableIcon } from \"../shared/clickable-icon\";\nimport {\n Breakpoint,\n parsePxOrRemValue,\n useResolvedBreakpointToken,\n} from \"../theme\";\nimport { ThemeContext } from \"../theme/theme-provider/context\";\nimport { Brand } from \"./brand\";\nimport { Drawer } from \"./drawer\";\nimport * as styles from \"./navbar.styles\";\nimport { NavbarActionButtons } from \"./navbar-action-buttons\";\nimport { NavbarHelper } from \"./navbar-helper\";\nimport { NavbarItems } from \"./navbar-items\";\nimport { getDefaultResourceLogo } from \"./navbar-logo-data\";\nimport type {\n BrandType,\n DrawerDismissalMethod,\n NavbarActionButtonsProps,\n NavbarButtonProps,\n NavbarDrawerApi,\n NavbarDrawerHandle,\n NavbarProps,\n NavItemCommonProps,\n NavItemProps,\n} from \"./types\";\n\nconst Component = <T,>(\n {\n items,\n className,\n id,\n selectedId,\n compress = false,\n fixed = true,\n resources,\n hideNavElements = false,\n hideNavBranding = false,\n hideLinkIndicator = false,\n drawerDismissalExclusions: blockDrawerDismissalMethods = [],\n actionButtons,\n onItemClick,\n onActionButtonClick,\n onBrandClick,\n masthead = true,\n layout = \"default\",\n headerLabel = \"Main navigation menu\",\n drawerLabel,\n ...otherProps\n }: NavbarProps<T>,\n ref: React.Ref<NavbarDrawerHandle>\n) => {\n // =============================================================================\n // CONST, STATE, REFS\n // =============================================================================\n const [showDrawer, setShowDrawer] = useState<boolean>(false);\n const [showOverlay, setShowOverlay] = useState<boolean>(false);\n const mobileMenuRef = useRef<HTMLButtonElement>(null);\n const isStretch = layout === \"stretch\";\n const elementRef = useRef<HTMLDivElement>(null);\n const theme = useContext(ThemeContext);\n const defaultResource = getDefaultResourceLogo(theme?.theme);\n const tabletWidth = parsePxOrRemValue(\n useResolvedBreakpointToken(Breakpoint[\"lg-max\"])\n );\n\n const primary = resources?.primary || defaultResource.primary;\n const secondary = resources?.secondary;\n\n useImperativeHandle(\n ref,\n () =>\n Object.assign<HTMLDivElement, NavbarDrawerApi>(\n elementRef.current!,\n {\n dismissDrawer: () => {\n dismissDrawer();\n },\n }\n ),\n [showDrawer]\n );\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n handleResize();\n window.addEventListener(\"resize\", handleResize);\n\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n }, []);\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const dismissDrawer = () => {\n setShowDrawer(false);\n setTimeout(() => {\n setShowOverlay(false);\n }, 550); // For drawer animation to complete + buffer\n };\n\n const shouldDismissDrawer = (dismissalMethod: DrawerDismissalMethod) => {\n return (\n showDrawer &&\n blockDrawerDismissalMethods.indexOf(dismissalMethod) === -1\n );\n };\n\n const hasCollapsibleActionButtons = (\n actionButtons: NavbarActionButtonsProps\n ) => {\n const drawerActionButtons =\n actionButtons.mobile || actionButtons.desktop;\n if (drawerActionButtons) {\n return (\n drawerActionButtons.length &&\n drawerActionButtons.some(\n (actionButton) => !actionButton.uncollapsible\n )\n );\n }\n\n return false;\n };\n\n // =============================================================================\n // EVENT HANDLER\n // =============================================================================\n const handleResize = () => {\n if (window.innerWidth <= tabletWidth && showDrawer) {\n dismissDrawer();\n }\n };\n\n const handleBrandClick = (\n _event: React.MouseEvent<HTMLAnchorElement>,\n type: BrandType\n ) => {\n if (onBrandClick) {\n onBrandClick(type);\n }\n\n if (shouldDismissDrawer(\"brand-click\")) {\n dismissDrawer();\n }\n };\n\n const handleNavItemClick = <K extends T>(\n event: React.MouseEvent<HTMLAnchorElement>,\n item: NavItemProps<K> | NavItemCommonProps<K>\n ) => {\n if (NavbarHelper.isNavItemCommon(item) && item.onClick) {\n item.onClick(event);\n } else if (onItemClick) {\n event.preventDefault();\n onItemClick(item);\n }\n\n if (\n NavbarHelper.isNavItemLink(item) &&\n !item.subMenu &&\n shouldDismissDrawer(\"item-click\")\n ) {\n dismissDrawer();\n }\n };\n\n const handleActionButtonClick = (\n event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<Element>,\n actionButton: NavbarButtonProps\n ) => {\n if (\n (actionButton.type === \"button\" ||\n actionButton.type === \"download\") &&\n actionButton.args?.onClick\n ) {\n actionButton.args.onClick(\n event as React.MouseEvent<HTMLButtonElement>\n );\n } else if (onActionButtonClick) {\n event.preventDefault();\n onActionButtonClick(actionButton);\n }\n\n if (shouldDismissDrawer(\"item-click\")) {\n dismissDrawer();\n }\n };\n\n const handleMobileMenuButtonClick = () => {\n setShowDrawer(true);\n setShowOverlay(true);\n };\n\n const handleDrawerClose = () => {\n if (shouldDismissDrawer(\"close-button-click\")) {\n dismissDrawer();\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n\n const renderDrawer = () => (\n <Overlay\n show={showOverlay}\n enableOverlayClick\n onOverlayClick={handleDrawerClose}\n >\n <Drawer\n show={showDrawer}\n resources={{ primary, secondary }}\n onClose={handleDrawerClose}\n onBrandClick={handleBrandClick}\n actionButtons={actionButtons}\n hideNavBranding={hideNavBranding}\n mobileMenuRef={mobileMenuRef}\n drawerLabel={drawerLabel}\n >\n <NavbarItems\n items={items.mobile || items.desktop}\n onItemClick={handleNavItemClick}\n selectedId={selectedId}\n mobile\n hideLinkIndicator={hideLinkIndicator}\n />\n <NavbarActionButtons\n actionButtons={actionButtons}\n onActionButtonClick={handleActionButtonClick}\n mobile\n />\n </Drawer>\n </Overlay>\n );\n\n const renderBrand = () => (\n <div\n className={clsx(\n styles.navBrandContainer,\n compress\n ? styles.navBrandContainerCompressed\n : styles.navBrandContainerFull,\n styles.navBrandContainerResponsive\n )}\n data-id=\"brand-container\"\n >\n {primary && (\n <Brand\n resources={primary}\n onClick={handleBrandClick}\n data-id=\"brand-primary\"\n data-testid=\"main__brand\"\n type=\"primary\"\n />\n )}\n {secondary && (\n <>\n <div\n className={clsx(\n styles.navSeparator,\n compress\n ? styles.navSeparatorCompressed\n : styles.navSeparatorFull,\n styles.navSeparatorResponsive\n )}\n />\n <Brand\n resources={secondary}\n onClick={handleBrandClick}\n data-id=\"brand-secondary\"\n data-testid=\"main__brand-secondary\"\n type=\"secondary\"\n />\n </>\n )}\n </div>\n );\n\n const renderMobileMenuButton = () => {\n const drawerItems = items.mobile || items.desktop;\n if (\n (drawerItems && drawerItems.length > 0) ||\n (actionButtons && hasCollapsibleActionButtons(actionButtons))\n ) {\n return (\n <ClickableIcon\n ref={mobileMenuRef}\n className={styles.mobileMenuButton}\n aria-label={showDrawer ? \"Close nav menu\" : \"Open nav menu\"}\n aria-expanded={showDrawer}\n data-testid=\"button__mobile-menu\"\n onClick={handleMobileMenuButtonClick}\n focusHighlight={true}\n >\n <MenuIcon className={styles.mobileMenuIcon} />\n </ClickableIcon>\n );\n }\n\n return null;\n };\n\n const renderNavbar = () => {\n return (\n <Layout.Content stretch={isStretch}>\n <nav\n className={clsx(\n styles.nav,\n compress && styles.navCompressed,\n theme?.mode === \"dark\" && styles.navDark\n )}\n aria-label={headerLabel}\n >\n {!hideNavBranding && renderBrand()}\n {!hideNavElements && (\n <div\n className={clsx(\n styles.navElementsContainer,\n !hideNavBranding &&\n styles.navElementsContainerWithBranding\n )}\n >\n <NavbarItems\n items={items.desktop}\n onItemClick={handleNavItemClick}\n selectedId={selectedId}\n hideNavBranding={hideNavBranding}\n hideLinkIndicator={hideLinkIndicator}\n />\n <NavbarActionButtons\n actionButtons={actionButtons}\n onActionButtonClick={handleActionButtonClick}\n />\n {renderMobileMenuButton()}\n </div>\n )}\n </nav>\n\n {!hideNavElements && renderDrawer()}\n </Layout.Content>\n );\n };\n\n return (\n <div\n ref={elementRef}\n className={clsx(\n styles.wrapper,\n fixed ? styles.wrapperFixed : styles.wrapperRelative,\n theme?.mode === \"dark\"\n ? styles.wrapperDark\n : styles.wrapperLight,\n className\n )}\n id={id || \"navbar-wrapper\"}\n data-testid={otherProps[\"data-testid\"] || \"navbar-wrapper\"}\n >\n {masthead && <Masthead stretch={isStretch} />}\n {renderNavbar()}\n </div>\n );\n};\n\nexport const Navbar = forwardRef(Component);\n"],"names":["Navbar","forwardRef","_a","ref","items","className","id","selectedId","compress","fixed","resources","hideNavElements","hideNavBranding","hideLinkIndicator","drawerDismissalExclusions","blockDrawerDismissalMethods","actionButtons","onItemClick","onActionButtonClick","onBrandClick","masthead","layout","headerLabel","drawerLabel","otherProps","__rest","showDrawer","setShowDrawer","useState","showOverlay","setShowOverlay","mobileMenuRef","useRef","isStretch","elementRef","theme","useContext","ThemeContext","defaultResource","getDefaultResourceLogo","tabletWidth","parsePxOrRemValue","useResolvedBreakpointToken","Breakpoint","primary","secondary","useImperativeHandle","Object","assign","current","dismissDrawer","useEffect","handleResize","window","addEventListener","removeEventListener","setTimeout","shouldDismissDrawer","dismissalMethod","indexOf","innerWidth","handleBrandClick","_event","type","handleNavItemClick","event","item","NavbarHelper","isNavItemCommon","onClick","preventDefault","isNavItemLink","subMenu","handleActionButtonClick","actionButton","args","handleMobileMenuButtonClick","handleDrawerClose","renderMobileMenuButton","drawerItems","mobile","desktop","length","drawerActionButtons","some","uncollapsible","hasCollapsibleActionButtons","_jsx","ClickableIcon","styles.mobileMenuButton","focusHighlight","children","MenuIcon","styles.mobileMenuIcon","_jsxs","clsx","styles.wrapper","styles.wrapperFixed","styles.wrapperRelative","mode","styles.wrapperDark","styles.wrapperLight","Masthead","stretch","Layout","Content","styles.nav","styles.navCompressed","styles.navDark","styles.navBrandContainer","styles.navBrandContainerCompressed","styles.navBrandContainerFull","styles.navBrandContainerResponsive","Brand","_Fragment","styles.navSeparator","styles.navSeparatorCompressed","styles.navSeparatorFull","styles.navSeparatorResponsive","styles.navElementsContainer","styles.navElementsContainerWithBranding","NavbarItems","NavbarActionButtons","Overlay","show","enableOverlayClick","onOverlayClick","Drawer","onClose"],"mappings":"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"}
1
+ {"version":3,"file":"navbar.js","sources":["../../src/navbar/navbar.tsx"],"sourcesContent":["import { MenuIcon } from \"@lifesg/react-icons/menu\";\nimport clsx from \"clsx\";\nimport type React from \"react\";\nimport {\n forwardRef,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\n\nimport { Layout } from \"../layout\";\nimport { Masthead } from \"../masthead/masthead\";\nimport { Overlay } from \"../overlay/overlay\";\nimport { ClickableIcon } from \"../shared/clickable-icon\";\nimport {\n Breakpoint,\n parsePxOrRemValue,\n useResolvedBreakpointToken,\n} from \"../theme\";\nimport { ThemeContext } from \"../theme/theme-provider/context\";\nimport { Brand } from \"./brand\";\nimport { Drawer } from \"./drawer\";\nimport * as styles from \"./navbar.styles\";\nimport { NavbarActionButtons } from \"./navbar-action-buttons\";\nimport { NavbarHelper } from \"./navbar-helper\";\nimport { NavbarItems } from \"./navbar-items\";\nimport { getDefaultResourceLogo } from \"./navbar-logo-data\";\nimport type {\n BrandType,\n DrawerDismissalMethod,\n NavbarActionButtonsProps,\n NavbarButtonProps,\n NavbarDrawerApi,\n NavbarDrawerHandle,\n NavbarProps,\n NavItemCommonProps,\n NavItemProps,\n} from \"./types\";\n\nconst Component = <T,>(\n {\n items,\n className,\n id,\n selectedId,\n compress = false,\n fixed = true,\n resources,\n hideNavElements = false,\n hideNavBranding = false,\n hideLinkIndicator = false,\n drawerDismissalExclusions: blockDrawerDismissalMethods = [],\n actionButtons,\n onItemClick,\n onActionButtonClick,\n onBrandClick,\n masthead = true,\n layout = \"default\",\n headerLabel = \"Main navigation menu\",\n drawerLabel,\n ...otherProps\n }: NavbarProps<T>,\n ref: React.Ref<NavbarDrawerHandle>\n) => {\n // =============================================================================\n // CONST, STATE, REFS\n // =============================================================================\n const [showDrawer, setShowDrawer] = useState<boolean>(false);\n const [showOverlay, setShowOverlay] = useState<boolean>(false);\n const mobileMenuRef = useRef<HTMLButtonElement>(null);\n const isStretch = layout === \"stretch\";\n const elementRef = useRef<HTMLDivElement>(null);\n const theme = useContext(ThemeContext);\n const defaultResource = getDefaultResourceLogo(theme?.theme);\n const tabletWidth = parsePxOrRemValue(\n useResolvedBreakpointToken(Breakpoint[\"lg-max\"])\n );\n\n const primary = resources?.primary || defaultResource.primary;\n const secondary = resources?.secondary;\n\n useImperativeHandle(\n ref,\n () =>\n Object.assign<HTMLDivElement, NavbarDrawerApi>(\n elementRef.current!,\n {\n dismissDrawer: () => {\n dismissDrawer();\n },\n }\n ),\n [showDrawer]\n );\n\n // =============================================================================\n // EFFECTS\n // =============================================================================\n useEffect(() => {\n handleResize();\n window.addEventListener(\"resize\", handleResize);\n\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n }, []);\n\n // =============================================================================\n // HELPER FUNCTIONS\n // =============================================================================\n const dismissDrawer = () => {\n setShowDrawer(false);\n setTimeout(() => {\n setShowOverlay(false);\n }, 550); // For drawer animation to complete + buffer\n };\n\n const shouldDismissDrawer = (dismissalMethod: DrawerDismissalMethod) => {\n return (\n showDrawer &&\n blockDrawerDismissalMethods.indexOf(dismissalMethod) === -1\n );\n };\n\n const hasCollapsibleActionButtons = (\n actionButtons: NavbarActionButtonsProps\n ) => {\n const drawerActionButtons =\n actionButtons.mobile || actionButtons.desktop;\n if (drawerActionButtons) {\n return (\n drawerActionButtons.length &&\n drawerActionButtons.some(\n (actionButton) => !actionButton.uncollapsible\n )\n );\n }\n\n return false;\n };\n\n // =============================================================================\n // EVENT HANDLER\n // =============================================================================\n const handleResize = () => {\n if (window.innerWidth <= tabletWidth && showDrawer) {\n dismissDrawer();\n }\n };\n\n const handleBrandClick = (\n _event: React.MouseEvent<HTMLAnchorElement>,\n type: BrandType\n ) => {\n if (onBrandClick) {\n onBrandClick(type);\n }\n\n if (shouldDismissDrawer(\"brand-click\")) {\n dismissDrawer();\n }\n };\n\n const handleNavItemClick = <K extends T>(\n event: React.MouseEvent<HTMLAnchorElement>,\n item: NavItemProps<K> | NavItemCommonProps<K>\n ) => {\n if (NavbarHelper.isNavItemCommon(item) && item.onClick) {\n item.onClick(event);\n } else if (onItemClick) {\n event.preventDefault();\n onItemClick(item);\n }\n\n if (\n NavbarHelper.isNavItemLink(item) &&\n !item.subMenu &&\n shouldDismissDrawer(\"item-click\")\n ) {\n dismissDrawer();\n }\n };\n\n const handleActionButtonClick = (\n event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<Element>,\n actionButton: NavbarButtonProps\n ) => {\n if (\n (actionButton.type === \"button\" ||\n actionButton.type === \"download\") &&\n actionButton.args?.onClick\n ) {\n actionButton.args.onClick(\n event as React.MouseEvent<HTMLButtonElement>\n );\n } else if (onActionButtonClick) {\n event.preventDefault();\n onActionButtonClick(actionButton);\n }\n\n if (shouldDismissDrawer(\"item-click\")) {\n dismissDrawer();\n }\n };\n\n const handleMobileMenuButtonClick = () => {\n setShowDrawer(true);\n setShowOverlay(true);\n };\n\n const handleDrawerClose = () => {\n if (shouldDismissDrawer(\"close-button-click\")) {\n dismissDrawer();\n }\n };\n\n // =============================================================================\n // RENDER FUNCTIONS\n // =============================================================================\n\n const renderDrawer = () => (\n <Overlay\n show={showOverlay}\n enableOverlayClick\n onOverlayClick={handleDrawerClose}\n >\n <Drawer\n show={showDrawer}\n resources={{ primary, secondary }}\n onClose={handleDrawerClose}\n onBrandClick={handleBrandClick}\n actionButtons={actionButtons}\n hideNavBranding={hideNavBranding}\n mobileMenuRef={mobileMenuRef}\n drawerLabel={drawerLabel}\n >\n <NavbarItems\n items={items.mobile || items.desktop}\n onItemClick={handleNavItemClick}\n selectedId={selectedId}\n mobile\n hideLinkIndicator={hideLinkIndicator}\n />\n <NavbarActionButtons\n actionButtons={actionButtons}\n onActionButtonClick={handleActionButtonClick}\n mobile\n />\n </Drawer>\n </Overlay>\n );\n\n const renderBrand = () => (\n <div\n className={clsx(\n styles.navBrandContainer,\n compress\n ? styles.navBrandContainerCompressed\n : styles.navBrandContainerFull,\n styles.navBrandContainerResponsive\n )}\n data-id=\"brand-container\"\n >\n {primary && (\n <Brand\n resources={primary}\n onClick={handleBrandClick}\n data-id=\"brand-primary\"\n data-testid=\"main__brand\"\n type=\"primary\"\n />\n )}\n {secondary && (\n <>\n <div\n className={clsx(\n styles.navSeparator,\n compress\n ? styles.navSeparatorCompressed\n : styles.navSeparatorFull,\n styles.navSeparatorResponsive\n )}\n />\n <Brand\n resources={secondary}\n onClick={handleBrandClick}\n data-id=\"brand-secondary\"\n data-testid=\"main__brand-secondary\"\n type=\"secondary\"\n />\n </>\n )}\n </div>\n );\n\n const renderMobileMenuButton = () => {\n const drawerItems = items.mobile || items.desktop;\n if (\n (drawerItems && drawerItems.length > 0) ||\n (actionButtons && hasCollapsibleActionButtons(actionButtons))\n ) {\n return (\n <ClickableIcon\n ref={mobileMenuRef}\n className={styles.mobileMenuButton}\n aria-label={showDrawer ? \"Close nav menu\" : \"Open nav menu\"}\n aria-expanded={showDrawer}\n data-testid=\"button__mobile-menu\"\n onClick={handleMobileMenuButtonClick}\n focusHighlight={true}\n >\n <MenuIcon className={styles.mobileMenuIcon} />\n </ClickableIcon>\n );\n }\n\n return null;\n };\n\n const renderNavbar = () => {\n return (\n <Layout.Content stretch={isStretch}>\n <nav\n className={clsx(\n styles.nav,\n compress && styles.navCompressed,\n theme?.mode === \"dark\" && styles.navDark\n )}\n aria-label={headerLabel}\n >\n {!hideNavBranding && renderBrand()}\n {!hideNavElements && (\n <div\n className={clsx(\n styles.navElementsContainer,\n !hideNavBranding &&\n styles.navElementsContainerWithBranding\n )}\n >\n <NavbarItems\n items={items.desktop}\n onItemClick={handleNavItemClick}\n selectedId={selectedId}\n hideNavBranding={hideNavBranding}\n hideLinkIndicator={hideLinkIndicator}\n />\n <NavbarActionButtons\n actionButtons={actionButtons}\n onActionButtonClick={handleActionButtonClick}\n />\n {renderMobileMenuButton()}\n </div>\n )}\n </nav>\n\n {!hideNavElements && renderDrawer()}\n </Layout.Content>\n );\n };\n\n return (\n <div\n ref={elementRef}\n className={clsx(\n styles.wrapper,\n fixed ? styles.wrapperFixed : styles.wrapperRelative,\n theme?.mode === \"dark\"\n ? styles.wrapperDark\n : styles.wrapperLight,\n className\n )}\n id={id || \"navbar-wrapper\"}\n data-testid={otherProps[\"data-testid\"] || \"navbar-wrapper\"}\n >\n {masthead && <Masthead stretch={isStretch} />}\n {renderNavbar()}\n </div>\n );\n};\n\n// @catalog\n/**\n * The main site navigation bar with desktop and mobile drawer views.\n *\n * Use `Navbar` to render the primary navigation header. It displays brand\n * logos, navigation items, and action buttons in a desktop bar, and\n * automatically collapses items into a slide-in drawer for mobile viewports.\n */\nexport const Navbar = forwardRef(Component);\n"],"names":["Navbar","forwardRef","_a","ref","items","className","id","selectedId","compress","fixed","resources","hideNavElements","hideNavBranding","hideLinkIndicator","drawerDismissalExclusions","blockDrawerDismissalMethods","actionButtons","onItemClick","onActionButtonClick","onBrandClick","masthead","layout","headerLabel","drawerLabel","otherProps","__rest","showDrawer","setShowDrawer","useState","showOverlay","setShowOverlay","mobileMenuRef","useRef","isStretch","elementRef","theme","useContext","ThemeContext","defaultResource","getDefaultResourceLogo","tabletWidth","parsePxOrRemValue","useResolvedBreakpointToken","Breakpoint","primary","secondary","useImperativeHandle","Object","assign","current","dismissDrawer","useEffect","handleResize","window","addEventListener","removeEventListener","setTimeout","shouldDismissDrawer","dismissalMethod","indexOf","innerWidth","handleBrandClick","_event","type","handleNavItemClick","event","item","NavbarHelper","isNavItemCommon","onClick","preventDefault","isNavItemLink","subMenu","handleActionButtonClick","actionButton","args","handleMobileMenuButtonClick","handleDrawerClose","renderMobileMenuButton","drawerItems","mobile","desktop","length","drawerActionButtons","some","uncollapsible","hasCollapsibleActionButtons","_jsx","ClickableIcon","styles.mobileMenuButton","focusHighlight","children","MenuIcon","styles.mobileMenuIcon","_jsxs","clsx","styles.wrapper","styles.wrapperFixed","styles.wrapperRelative","mode","styles.wrapperDark","styles.wrapperLight","Masthead","stretch","Layout","Content","styles.nav","styles.navCompressed","styles.navDark","styles.navBrandContainer","styles.navBrandContainerCompressed","styles.navBrandContainerFull","styles.navBrandContainerResponsive","Brand","_Fragment","styles.navSeparator","styles.navSeparatorCompressed","styles.navSeparatorFull","styles.navSeparatorResponsive","styles.navElementsContainer","styles.navElementsContainerWithBranding","NavbarItems","NavbarActionButtons","Overlay","show","enableOverlayClick","onOverlayClick","Drawer","onClose"],"mappings":"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"}
package/navbar/types.d.ts CHANGED
@@ -1,101 +1,289 @@
1
1
  import type { ButtonProps } from "../button";
2
2
  import type { TypographyLinkProps } from "../typography";
3
+ /**
4
+ * Props for a standard navigation link item.
5
+ */
3
6
  export interface NavItemLinkProps<T> extends NavItemCommonProps<T> {
4
7
  itemType?: "link";
5
8
  subMenu?: NavItemCommonProps<T>[] | undefined;
6
9
  }
10
+ /**
11
+ * Props for a custom component slot navigation item.
12
+ */
7
13
  export interface NavItemComponentProps {
8
14
  itemType: "component";
9
15
  children: JSX.Element;
10
16
  }
17
+ /**
18
+ * A single navigation item rendered by the navbar.
19
+ */
11
20
  export type NavItemProps<T> = NavItemLinkProps<T> | NavItemComponentProps;
21
+ /**
22
+ * Shared props for link-type navigation items.
23
+ *
24
+ * `T` is the type of the arbitrary `options` payload.
25
+ */
12
26
  export interface NavItemCommonProps<T> extends TypographyLinkProps {
13
27
  id: string;
14
28
  "data-testid"?: string | undefined;
29
+ /**
30
+ * Arbitrary data passed through to callback arguments such as `onItemClick`.
31
+ */
15
32
  options?: T | undefined;
16
33
  }
34
+ /**
35
+ * Desktop and mobile navigation item lists for the navbar.
36
+ *
37
+ * `T` is the type of the arbitrary `options` payload on each item.
38
+ */
17
39
  export interface NavItemsProps<T> {
40
+ /**
41
+ * Items rendered in the desktop navbar.
42
+ */
18
43
  desktop: NavItemProps<T>[];
44
+ /**
45
+ * Items rendered in the mobile drawer. Falls back to `desktop` when omitted.
46
+ */
19
47
  mobile?: NavItemProps<T>[] | undefined;
20
48
  }
49
+ /** Props for a `"download"` type action button in the navbar. */
21
50
  export interface NavbarActionButtonDownloadProps {
22
51
  type: "download";
23
52
  args?: ButtonProps | undefined;
53
+ /**
54
+ * When `true`, the button remains visible outside the mobile drawer rather
55
+ * than being collapsed into it.
56
+ *
57
+ * @default false
58
+ */
24
59
  uncollapsible?: boolean | undefined;
25
60
  }
61
+ /** Props for a `"button"` type action button in the navbar. */
26
62
  export interface NavbarActionButtonCtaProps {
27
63
  type: "button";
28
64
  args: ButtonProps;
65
+ /**
66
+ * When `true`, the button remains visible outside the mobile drawer rather
67
+ * than being collapsed into it.
68
+ *
69
+ * @default false
70
+ */
29
71
  uncollapsible?: boolean | undefined;
30
72
  }
31
- export interface NavbarButtonComponentProps {
73
+ /** Props for the internal `"component"` type action button wrapper. */
74
+ interface NavbarButtonComponentProps {
75
+ /** The custom component to be rendered */
32
76
  render: JSX.Element;
33
77
  }
78
+ /** Props for a `"component"` type action button in the navbar. */
34
79
  export interface NavbarActionButtonComponentProps {
35
80
  type: "component";
36
81
  args?: NavbarButtonComponentProps | undefined;
82
+ /**
83
+ * When `true`, the button remains visible outside the mobile drawer rather
84
+ * than being collapsed into it.
85
+ *
86
+ * @default false
87
+ */
37
88
  uncollapsible?: boolean | undefined;
38
89
  }
90
+ /**
91
+ * Props for a single action button in the navbar.
92
+ *
93
+ * `type` discriminates between `"button"`, `"download"`, and `"component"`.
94
+ */
39
95
  export type NavbarButtonProps = NavbarActionButtonDownloadProps | NavbarActionButtonCtaProps | NavbarActionButtonComponentProps;
96
+ /** Props for the desktop and mobile action button lists in the navbar. */
40
97
  export interface NavbarActionButtonsProps {
98
+ /**
99
+ * Action buttons rendered in the desktop navbar.
100
+ */
41
101
  desktop: NavbarButtonProps[];
42
- /** Navbar action buttons for mobile drawer. Takes desktop if not specified */
102
+ /**
103
+ * Action buttons rendered in the mobile drawer. Falls back to `desktop`
104
+ * when omitted.
105
+ */
43
106
  mobile?: NavbarButtonProps[] | undefined;
44
107
  }
108
+ /**
109
+ * Branding identity for a primary or secondary brand slot in the navbar.
110
+ */
45
111
  export interface NavbarBrandingProps {
112
+ /** The name of the brand, used for accessibility and alt text. */
46
113
  brandName: string;
114
+ /** The source URL for the brand logo image. */
47
115
  logoSrc: string;
48
116
  }
117
+ /**
118
+ * Logo resources for the primary and secondary brand slots in the navbar.
119
+ *
120
+ */
49
121
  export interface NavbarResourcesProps {
122
+ /**
123
+ * When omitted, a default logo derived from the active theme is used.
124
+ */
50
125
  primary?: NavbarBrandingProps | undefined;
126
+ /**
127
+ * When omitted, the secondary brand slot is hidden.
128
+ */
51
129
  secondary?: NavbarBrandingProps | undefined;
52
130
  }
131
+ /**
132
+ * Props shared between `NavbarProps` and `NavbarDrawerProps`.
133
+ */
53
134
  export interface NavbarSharedProps {
135
+ /**
136
+ * Branding and logo resources for the navbar.
137
+ */
54
138
  resources?: NavbarResourcesProps | undefined;
139
+ /** Action buttons rendered in the navbar and mobile drawer. */
55
140
  actionButtons?: NavbarActionButtonsProps | undefined;
56
- /** Specifies if brand logos are visible */
141
+ /**
142
+ * Hides all brand logos from the navbar and drawer.
143
+ *
144
+ * @default false
145
+ */
57
146
  hideNavBranding?: boolean | undefined;
58
- /** Hide the selected link indicator across the navbar */
147
+ /**
148
+ * Hides the active-item underline indicator across desktop and drawer views.
149
+ *
150
+ * @default false
151
+ */
59
152
  hideLinkIndicator?: boolean | undefined;
60
153
  }
154
+ /**
155
+ * Identifies the user action that can dismiss the mobile navigation drawer.
156
+ *
157
+ * Pass one or more values to `drawerDismissalExclusions` on `NavbarProps` to
158
+ * prevent those actions from closing the drawer.
159
+ *
160
+ * - `"close-button-click"` — the drawer's close button or overlay click
161
+ * - `"item-click"` — clicking a nav item or action button
162
+ * - `"brand-click"` — clicking a brand logo
163
+ */
61
164
  export type DrawerDismissalMethod = "close-button-click" | "item-click" | "brand-click";
165
+ /**
166
+ * Props for the internal mobile navigation drawer panel.
167
+ */
62
168
  export interface NavbarDrawerProps extends NavbarSharedProps {
169
+ /**
170
+ * Controls whether the drawer is visible.
171
+ */
63
172
  show: boolean;
64
173
  children: JSX.Element | JSX.Element[];
174
+ /**
175
+ * Called when the drawer requests to be closed via the close button or
176
+ * overlay click.
177
+ */
65
178
  onClose?: (() => void) | undefined;
66
- /** Triggered when the brand icon is being clicked */
179
+ /**
180
+ * Called when a brand logo inside the drawer is clicked.
181
+ */
67
182
  onBrandClick?: ((event: React.MouseEvent<HTMLAnchorElement>, type: BrandType) => void) | undefined;
68
- /** Custom aria-label for the mobile navigation drawer */
183
+ /**
184
+ * Accessible label announced for the mobile navigation drawer.
185
+ */
69
186
  drawerLabel?: string | undefined;
70
- /** Ref to the mobile menu button for focus management */
187
+ /**
188
+ * Ref to the mobile menu button used to return focus when the drawer closes.
189
+ */
71
190
  mobileMenuRef?: React.RefObject<HTMLButtonElement> | undefined;
72
191
  }
192
+ /**
193
+ * Identifies which brand slot was interacted with in brand-related callbacks.
194
+ */
73
195
  export type BrandType = "primary" | "secondary";
196
+ /**
197
+ * Imperative methods exposed by the `Navbar` component via `ref`.
198
+ */
74
199
  export type NavbarDrawerApi = {
200
+ /**
201
+ * Programmatically closes the mobile navigation drawer with its exit
202
+ * animation.
203
+ */
75
204
  dismissDrawer: () => void;
76
205
  };
206
+ /**
207
+ * Imperative handle returned by `Navbar` via `ref`.
208
+ *
209
+ * Extends `HTMLDivElement` with `NavbarDrawerApi`. Use the ref to dismiss the
210
+ * mobile drawer programmatically without needing to manage drawer state
211
+ * externally.
212
+ */
77
213
  export type NavbarDrawerHandle = HTMLDivElement & NavbarDrawerApi;
214
+ /**
215
+ * Props for the `Navbar` component.
216
+ */
78
217
  export interface NavbarProps<T = void> extends NavbarSharedProps {
79
218
  items: NavItemsProps<T>;
80
219
  className?: string | undefined;
81
220
  id?: string | undefined;
82
221
  "data-testid"?: string | undefined;
222
+ /**
223
+ * The currently selected navigation item identifier.
224
+ * Must match the `id` of one of the rendered items.
225
+ */
83
226
  selectedId?: string | undefined;
84
- /** Specifies if the Navbar should be compressed */
227
+ /**
228
+ * Reduces the height and logo size of the navbar.
229
+ *
230
+ * @default false
231
+ */
85
232
  compress?: boolean | undefined;
86
- /** Specifies if Navbar should be fixed to top */
233
+ /**
234
+ * Pins the navbar to the top of the viewport while the page scrolls.
235
+ *
236
+ * @default true
237
+ */
87
238
  fixed?: boolean | undefined;
88
- /** Specifies which methods will not dismiss the drawer */
239
+ /**
240
+ * Drawer dismissal methods that should be suppressed. The drawer will not
241
+ * close when the user performs any of the listed actions.
242
+ */
89
243
  drawerDismissalExclusions?: DrawerDismissalMethod[] | undefined;
244
+ /**
245
+ * Hides nav items and action buttons, leaving only the brand area visible.
246
+ *
247
+ * @default false
248
+ */
90
249
  hideNavElements?: boolean | undefined;
250
+ /**
251
+ * Called when a brand logo is clicked. `type` identifies which brand slot
252
+ * was activated.
253
+ */
91
254
  onBrandClick?: ((type: BrandType) => void) | undefined;
255
+ /**
256
+ * Called when a navigation item is activated from the desktop bar or the
257
+ * mobile drawer. The item's full props object is passed as the argument.
258
+ */
92
259
  onItemClick?: ((item: NavItemProps<T> | NavItemCommonProps<T>) => void) | undefined;
260
+ /**
261
+ * Called when an action button without its own `onClick` handler is
262
+ * activated. The button's full props object is passed as the argument.
263
+ */
93
264
  onActionButtonClick?: ((actionButton: NavbarButtonProps) => void) | undefined;
94
- /** Specifies if masthead should be rendered */
265
+ /**
266
+ * Renders the `Masthead` (SGDS official government banner) above the navbar.
267
+ *
268
+ * @default true
269
+ */
95
270
  masthead?: boolean | undefined;
271
+ /**
272
+ * Controls how the navbar content fills its container. `"stretch"` expands
273
+ * to the full container width; `"default"` uses the standard content width.
274
+ *
275
+ * @default "default"
276
+ */
96
277
  layout?: "default" | "stretch" | undefined;
97
- /** Custom aria-label for the main navigation header */
278
+ /**
279
+ * Accessible label announced for the main navigation header.
280
+ *
281
+ * @default "Main navigation menu"
282
+ */
98
283
  headerLabel?: string | undefined;
99
- /** Custom aria-label for the mobile navigation drawer */
284
+ /**
285
+ * Accessible label announced for the mobile navigation drawer.
286
+ */
100
287
  drawerLabel?: string | undefined;
101
288
  }
289
+ export {};
@@ -1,3 +1,9 @@
1
1
  import React from "react";
2
2
  import type { NotificationBannerWithForwardedRefProps, NotificationContentAttributes } from "./types";
3
+ /**
4
+ * Higher-order component that wraps `NotificationBanner` and renders its
5
+ * content from a structured data array.
6
+ * *
7
+ * @param data Content items to render inside the banner.
8
+ */
3
9
  export declare const withNotificationBanner: (data: NotificationContentAttributes[]) => (props: NotificationBannerWithForwardedRefProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
@@ -1 +1 @@
1
- {"version":3,"file":"notification-banner-hoc.js","sources":["../../src/notification-banner/notification-banner-hoc.tsx"],"sourcesContent":["import DOMPurify from \"dompurify\";\nimport React from \"react\";\n\nimport { NBComponent, NotificationBanner } from \"./notification-banner\";\nimport type {\n ContentLinkAttributes,\n ContentTextAttributes,\n NotificationBannerWithForwardedRefProps,\n NotificationContentAttributes,\n} from \"./types\";\n\nexport const withNotificationBanner = (\n data: NotificationContentAttributes[]\n) => {\n const ComponentToReturn = (\n props: NotificationBannerWithForwardedRefProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const renderContent = () => {\n if (data.length > 0) {\n return data.map((attribute, index) => {\n if (attribute.type === \"text\") {\n const otherAttributes =\n attribute.otherAttributes as ContentTextAttributes;\n\n const sanitizedContent = DOMPurify.sanitize(\n attribute.content\n );\n return (\n <p\n key={index}\n {...otherAttributes}\n dangerouslySetInnerHTML={{\n __html: sanitizedContent,\n }}\n />\n );\n } else {\n const otherAttributes =\n attribute.otherAttributes as ContentLinkAttributes;\n return (\n <NotificationBanner.Link\n key={index}\n {...otherAttributes}\n >\n {attribute.content}\n </NotificationBanner.Link>\n );\n }\n });\n }\n\n console.error(\"[NotificationBannerHOC] Empty data passed\");\n return null;\n };\n\n return (\n <NBComponent forwardedRef={ref} {...props}>\n {renderContent()}\n </NBComponent>\n );\n };\n\n return React.forwardRef(ComponentToReturn);\n};\n"],"names":["withNotificationBanner","data","React","forwardRef","props","ref","_jsx","NBComponent","Object","assign","forwardedRef","children","length","map","attribute","index","type","otherAttributes","sanitizedContent","DOMPurify","sanitize","content","dangerouslySetInnerHTML","__html","NotificationBanner","Link","console","error"],"mappings":"mMAWO,MAAMA,EACTC,GAmDOC,EAAMC,YAjDa,CACtBC,EACAC,IAyCIC,EAACC,EAAWC,OAAAC,OAAA,CAACC,aAAcL,GAASD,EAAK,CAAAO,SAtCrCV,EAAKW,OAAS,EACPX,EAAKY,KAAI,CAACC,EAAWC,KACxB,GAAuB,SAAnBD,EAAUE,KAAiB,CAC3B,MAAMC,EACFH,EAAUG,gBAERC,EAAmBC,EAAUC,SAC/BN,EAAUO,SAEd,OACIf,EAAA,IAAAE,OAAAC,OAAA,GAEQQ,EAAe,CACnBK,wBAAyB,CACrBC,OAAQL,KAHPH,EAOjB,CAAO,CACH,MAAME,EACFH,EAAUG,gBACd,OACIX,EAACkB,EAAmBC,KAAIjB,OAAAC,OAAA,CAAA,EAEhBQ,EAAe,CAAAN,SAElBG,EAAUO,UAHNN,EAMjB,MAIRW,QAAQC,MAAM,6CACP"}
1
+ {"version":3,"file":"notification-banner-hoc.js","sources":["../../src/notification-banner/notification-banner-hoc.tsx"],"sourcesContent":["import DOMPurify from \"dompurify\";\nimport React from \"react\";\n\nimport { NBComponent, NotificationBanner } from \"./notification-banner\";\nimport type {\n ContentLinkAttributes,\n ContentTextAttributes,\n NotificationBannerWithForwardedRefProps,\n NotificationContentAttributes,\n} from \"./types\";\n\n/**\n * Higher-order component that wraps `NotificationBanner` and renders its\n * content from a structured data array.\n * *\n * @param data Content items to render inside the banner.\n */\nexport const withNotificationBanner = (\n data: NotificationContentAttributes[]\n) => {\n const ComponentToReturn = (\n props: NotificationBannerWithForwardedRefProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const renderContent = () => {\n if (data.length > 0) {\n return data.map((attribute, index) => {\n if (attribute.type === \"text\") {\n const otherAttributes =\n attribute.otherAttributes as ContentTextAttributes;\n\n const sanitizedContent = DOMPurify.sanitize(\n attribute.content\n );\n return (\n <p\n key={index}\n {...otherAttributes}\n dangerouslySetInnerHTML={{\n __html: sanitizedContent,\n }}\n />\n );\n } else {\n const otherAttributes =\n attribute.otherAttributes as ContentLinkAttributes;\n return (\n <NotificationBanner.Link\n key={index}\n {...otherAttributes}\n >\n {attribute.content}\n </NotificationBanner.Link>\n );\n }\n });\n }\n\n console.error(\"[NotificationBannerHOC] Empty data passed\");\n return null;\n };\n\n return (\n <NBComponent forwardedRef={ref} {...props}>\n {renderContent()}\n </NBComponent>\n );\n };\n\n return React.forwardRef(ComponentToReturn);\n};\n"],"names":["withNotificationBanner","data","React","forwardRef","props","ref","_jsx","NBComponent","Object","assign","forwardedRef","children","length","map","attribute","index","type","otherAttributes","sanitizedContent","DOMPurify","sanitize","content","dangerouslySetInnerHTML","__html","NotificationBanner","Link","console","error"],"mappings":"mMAiBO,MAAMA,EACTC,GAmDOC,EAAMC,YAjDa,CACtBC,EACAC,IAyCIC,EAACC,EAAWC,OAAAC,OAAA,CAACC,aAAcL,GAASD,EAAK,CAAAO,SAtCrCV,EAAKW,OAAS,EACPX,EAAKY,KAAI,CAACC,EAAWC,KACxB,GAAuB,SAAnBD,EAAUE,KAAiB,CAC3B,MAAMC,EACFH,EAAUG,gBAERC,EAAmBC,EAAUC,SAC/BN,EAAUO,SAEd,OACIf,EAAA,IAAAE,OAAAC,OAAA,GAEQQ,EAAe,CACnBK,wBAAyB,CACrBC,OAAQL,KAHPH,EAOjB,CAAO,CACH,MAAME,EACFH,EAAUG,gBACd,OACIX,EAACkB,EAAmBC,KAAIjB,OAAAC,OAAA,CAAA,EAEhBQ,EAAe,CAAAN,SAElBG,EAAUO,UAHNN,EAMjB,MAIRW,QAAQC,MAAM,6CACP"}
@@ -1,6 +1,13 @@
1
1
  import React from "react";
2
2
  import type { NotificationBannerProps, NotificationBannerWithForwardedRefProps } from "./types";
3
3
  export declare const NBComponent: ({ children, visible, dismissible, sticky, onDismiss, id, forwardedRef, maxCollapsedHeight, onClick, actionButton, icon, className, ...otherProps }: NotificationBannerWithForwardedRefProps) => import("react/jsx-runtime").JSX.Element | null;
4
+ /**
5
+ * A full-width informational banner that sits at the top of the page.
6
+ *
7
+ * Use `NotificationBanner` to surface important or persistent messages that
8
+ * should remain visible until the user dismisses them.
9
+ */
4
10
  export declare const NotificationBanner: ((props: NotificationBannerProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null) & {
11
+ /** Renders an inline link styled for use inside a `NotificationBanner`. */
5
12
  Link: (props: import("..").TypographyLinkProps & React.RefAttributes<HTMLAnchorElement>) => React.ReactElement | null;
6
13
  };