@opengovsg/oui 0.0.0-snapshot-20251203100754 → 0.0.0-snapshot-20260126025301

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 (264) hide show
  1. package/dist/cjs/accordion/accordion.cjs +189 -0
  2. package/dist/cjs/accordion/index.cjs +13 -0
  3. package/dist/cjs/avatar/avatar-context.cjs +12 -0
  4. package/dist/cjs/avatar/avatar-group-context.cjs +88 -0
  5. package/dist/cjs/avatar/avatar-group.cjs +60 -0
  6. package/dist/cjs/avatar/avatar.cjs +132 -0
  7. package/dist/cjs/avatar/hooks/use-img-loading-status.cjs +68 -0
  8. package/dist/cjs/avatar/index.cjs +23 -0
  9. package/dist/cjs/avatar/utils.cjs +9 -0
  10. package/dist/cjs/badge/badge.cjs +5 -5
  11. package/dist/cjs/badge/use-badge.cjs +6 -6
  12. package/dist/cjs/banner/banner.cjs +6 -6
  13. package/dist/cjs/button/button.cjs +15 -12
  14. package/dist/cjs/calendar/calendar-bottom-content.cjs +3 -3
  15. package/dist/cjs/calendar/calendar-header.cjs +4 -4
  16. package/dist/cjs/calendar/calendar-month-day-selector.cjs +2 -2
  17. package/dist/cjs/calendar/calendar.cjs +4 -4
  18. package/dist/cjs/calendar/hooks/use-calendar-selectors.cjs +4 -4
  19. package/dist/cjs/calendar/utils.cjs +3 -3
  20. package/dist/cjs/checkbox/checkbox.cjs +4 -4
  21. package/dist/cjs/combo-box/combo-box-fuzzy.cjs +6 -6
  22. package/dist/cjs/combo-box/combo-box-item.cjs +2 -2
  23. package/dist/cjs/combo-box/combo-box.cjs +6 -6
  24. package/dist/cjs/date-field/date-field.cjs +3 -3
  25. package/dist/cjs/date-picker/date-picker.cjs +6 -5
  26. package/dist/cjs/date-range-picker/date-range-picker.cjs +5 -5
  27. package/dist/cjs/field/field.cjs +3 -3
  28. package/dist/cjs/file-dropzone/file-dropzone.cjs +22 -18
  29. package/dist/cjs/file-dropzone/file-info.cjs +7 -6
  30. package/dist/cjs/file-dropzone/utils.cjs +4 -4
  31. package/dist/cjs/govt-banner/govt-banner.cjs +7 -7
  32. package/dist/cjs/hooks/use-callback-ref.cjs +4 -4
  33. package/dist/cjs/hooks/use-controllable-state.cjs +2 -2
  34. package/dist/cjs/hooks/use-draggable.cjs +8 -8
  35. package/dist/cjs/hooks/use-scroll-position.cjs +53 -0
  36. package/dist/cjs/index.cjs +67 -20
  37. package/dist/cjs/input/input.cjs +2 -2
  38. package/dist/cjs/menu/menu.cjs +8 -8
  39. package/dist/cjs/modal/modal-body.cjs +2 -2
  40. package/dist/cjs/modal/modal-content.cjs +5 -5
  41. package/dist/cjs/modal/modal-footer.cjs +2 -2
  42. package/dist/cjs/modal/modal-header.cjs +2 -2
  43. package/dist/cjs/modal/modal.cjs +3 -3
  44. package/dist/cjs/navbar/index.cjs +25 -0
  45. package/dist/cjs/navbar/navbar-brand.cjs +28 -0
  46. package/dist/cjs/navbar/navbar-content.cjs +33 -0
  47. package/dist/cjs/navbar/navbar-context.cjs +14 -0
  48. package/dist/cjs/navbar/navbar-item.cjs +29 -0
  49. package/dist/cjs/navbar/navbar-menu/i18n.cjs +23 -0
  50. package/dist/cjs/navbar/navbar-menu/item.cjs +44 -0
  51. package/dist/cjs/navbar/navbar-menu/menu.cjs +62 -0
  52. package/dist/cjs/navbar/navbar-menu/toggle.cjs +95 -0
  53. package/dist/cjs/navbar/navbar.cjs +50 -0
  54. package/dist/cjs/navbar/use-navbar.cjs +126 -0
  55. package/dist/cjs/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/Overlay.cjs +55 -0
  56. package/dist/cjs/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/PortalProvider.cjs +23 -0
  57. package/dist/cjs/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs +208 -0
  58. package/dist/cjs/node_modules/.pnpm/@react-aria_ssr@3.9.10_react@19.2.3/node_modules/@react-aria/ssr/dist/SSRProvider.cjs +104 -0
  59. package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/Icon.cjs +4 -4
  60. package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +3 -3
  61. package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/user.cjs +22 -0
  62. package/dist/cjs/number-field/number-field.cjs +3 -3
  63. package/dist/cjs/pagination/hooks/use-pagination.cjs +7 -7
  64. package/dist/cjs/pagination/pagination.cjs +9 -9
  65. package/dist/cjs/pagination/use-pagination-item.cjs +3 -3
  66. package/dist/cjs/pagination/use-pagination.cjs +8 -8
  67. package/dist/cjs/range-calendar/range-calendar.cjs +7 -7
  68. package/dist/cjs/ripple/use-ripple.cjs +4 -4
  69. package/dist/cjs/select/select.cjs +90 -18
  70. package/dist/cjs/spinner/use-spinner.cjs +3 -3
  71. package/dist/cjs/system/react-utils/children.cjs +33 -0
  72. package/dist/cjs/system/react-utils/context.cjs +3 -3
  73. package/dist/cjs/system/react-utils/refs.cjs +3 -3
  74. package/dist/cjs/system/utils.cjs +2 -50
  75. package/dist/cjs/tabs/tabs.cjs +2 -2
  76. package/dist/cjs/tag-field/tag-field-item.cjs +2 -2
  77. package/dist/cjs/tag-field/tag-field-list.cjs +4 -4
  78. package/dist/cjs/tag-field/tag-field-root.cjs +14 -14
  79. package/dist/cjs/tag-field/tag-field-state-context.cjs +2 -2
  80. package/dist/cjs/tag-field/tag-field-tag-list.cjs +4 -4
  81. package/dist/cjs/tag-field/tag-field-trigger.cjs +2 -2
  82. package/dist/cjs/tag-field/tag-field.cjs +3 -3
  83. package/dist/cjs/tag-field/use-tag-field-state.cjs +6 -6
  84. package/dist/cjs/tag-field/use-tag-field.cjs +4 -4
  85. package/dist/cjs/text-area/text-area.cjs +2 -2
  86. package/dist/cjs/toast/index.cjs +13 -0
  87. package/dist/cjs/toast/toast.cjs +91 -0
  88. package/dist/cjs/toggle/toggle.cjs +3 -3
  89. package/dist/esm/accordion/accordion.js +182 -0
  90. package/dist/esm/accordion/index.js +2 -0
  91. package/dist/esm/avatar/avatar-context.js +9 -0
  92. package/dist/esm/avatar/avatar-group-context.js +84 -0
  93. package/dist/esm/avatar/avatar-group.js +58 -0
  94. package/dist/esm/avatar/avatar.js +128 -0
  95. package/dist/esm/avatar/hooks/use-img-loading-status.js +66 -0
  96. package/dist/esm/avatar/index.js +13 -0
  97. package/dist/esm/avatar/utils.js +7 -0
  98. package/dist/esm/badge/badge.js +1 -1
  99. package/dist/esm/banner/banner.js +3 -3
  100. package/dist/esm/button/button.js +12 -9
  101. package/dist/esm/calendar/calendar-header.js +2 -2
  102. package/dist/esm/checkbox/checkbox.js +4 -4
  103. package/dist/esm/combo-box/combo-box.js +3 -3
  104. package/dist/esm/date-picker/date-picker.js +4 -3
  105. package/dist/esm/date-range-picker/date-range-picker.js +2 -2
  106. package/dist/esm/field/field.js +1 -1
  107. package/dist/esm/file-dropzone/file-dropzone.js +12 -8
  108. package/dist/esm/file-dropzone/file-info.js +4 -3
  109. package/dist/esm/file-dropzone/utils.js +4 -4
  110. package/dist/esm/govt-banner/govt-banner.js +4 -4
  111. package/dist/esm/hooks/use-scroll-position.js +51 -0
  112. package/dist/esm/index.js +24 -7
  113. package/dist/esm/menu/menu.js +2 -2
  114. package/dist/esm/modal/modal-content.js +2 -2
  115. package/dist/esm/navbar/index.js +10 -0
  116. package/dist/esm/navbar/navbar-brand.js +26 -0
  117. package/dist/esm/navbar/navbar-content.js +31 -0
  118. package/dist/esm/navbar/navbar-context.js +11 -0
  119. package/dist/esm/navbar/navbar-item.js +27 -0
  120. package/dist/esm/navbar/navbar-menu/i18n.js +21 -0
  121. package/dist/esm/navbar/navbar-menu/item.js +42 -0
  122. package/dist/esm/navbar/navbar-menu/menu.js +60 -0
  123. package/dist/esm/navbar/navbar-menu/toggle.js +93 -0
  124. package/dist/esm/navbar/navbar.js +48 -0
  125. package/dist/esm/navbar/use-navbar.js +124 -0
  126. package/dist/esm/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/Overlay.js +52 -0
  127. package/dist/esm/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/PortalProvider.js +20 -0
  128. package/dist/esm/node_modules/.pnpm/@react-aria_overlays@3.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@react-aria/overlays/dist/usePreventScroll.js +206 -0
  129. package/dist/esm/node_modules/.pnpm/@react-aria_ssr@3.9.10_react@19.2.3/node_modules/@react-aria/ssr/dist/SSRProvider.js +102 -0
  130. package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/user.js +17 -0
  131. package/dist/esm/number-field/number-field.js +3 -3
  132. package/dist/esm/pagination/pagination.js +3 -3
  133. package/dist/esm/pagination/use-pagination-item.js +1 -1
  134. package/dist/esm/range-calendar/range-calendar.js +1 -1
  135. package/dist/esm/select/select.js +91 -19
  136. package/dist/esm/system/react-utils/children.js +29 -0
  137. package/dist/esm/system/utils.js +2 -49
  138. package/dist/esm/tag-field/tag-field-tag-list.js +1 -1
  139. package/dist/esm/tag-field/tag-field.js +1 -1
  140. package/dist/esm/toast/index.js +3 -0
  141. package/dist/esm/toast/toast.js +86 -0
  142. package/dist/types/accordion/accordion.d.ts +50 -0
  143. package/dist/types/accordion/accordion.d.ts.map +1 -0
  144. package/dist/types/accordion/index.d.ts +2 -0
  145. package/dist/types/accordion/index.d.ts.map +1 -0
  146. package/dist/types/avatar/avatar-context.d.ts +12 -0
  147. package/dist/types/avatar/avatar-context.d.ts.map +1 -0
  148. package/dist/types/avatar/avatar-group-context.d.ts +70 -0
  149. package/dist/types/avatar/avatar-group-context.d.ts.map +1 -0
  150. package/dist/types/avatar/avatar-group.d.ts +5 -0
  151. package/dist/types/avatar/avatar-group.d.ts.map +1 -0
  152. package/dist/types/avatar/avatar.d.ts +18 -0
  153. package/dist/types/avatar/avatar.d.ts.map +1 -0
  154. package/dist/types/avatar/hooks/use-img-loading-status.d.ts +4 -0
  155. package/dist/types/avatar/hooks/use-img-loading-status.d.ts.map +1 -0
  156. package/dist/types/avatar/index.d.ts +15 -0
  157. package/dist/types/avatar/index.d.ts.map +1 -0
  158. package/dist/types/avatar/utils.d.ts +2 -0
  159. package/dist/types/avatar/utils.d.ts.map +1 -0
  160. package/dist/types/button/button.d.ts +12 -6
  161. package/dist/types/button/button.d.ts.map +1 -1
  162. package/dist/types/calendar/calendar.d.ts.map +1 -1
  163. package/dist/types/checkbox/checkbox-group-style-context.d.ts +1 -1
  164. package/dist/types/checkbox/checkbox-group-style-context.d.ts.map +1 -1
  165. package/dist/types/date-field/date-field.d.ts.map +1 -1
  166. package/dist/types/file-dropzone/file-dropzone.d.ts +8 -2
  167. package/dist/types/file-dropzone/file-dropzone.d.ts.map +1 -1
  168. package/dist/types/file-dropzone/file-info.d.ts.map +1 -1
  169. package/dist/types/file-dropzone/types.d.ts +1 -0
  170. package/dist/types/file-dropzone/types.d.ts.map +1 -1
  171. package/dist/types/file-dropzone/utils.d.ts +2 -1
  172. package/dist/types/file-dropzone/utils.d.ts.map +1 -1
  173. package/dist/types/hooks/use-scroll-position.d.ts +29 -0
  174. package/dist/types/hooks/use-scroll-position.d.ts.map +1 -0
  175. package/dist/types/index.d.mts +4 -0
  176. package/dist/types/index.d.ts +4 -0
  177. package/dist/types/index.d.ts.map +1 -1
  178. package/dist/types/menu/menu.d.ts.map +1 -1
  179. package/dist/types/navbar/index.d.ts +17 -0
  180. package/dist/types/navbar/index.d.ts.map +1 -0
  181. package/dist/types/navbar/navbar-brand.d.ts +6 -0
  182. package/dist/types/navbar/navbar-brand.d.ts.map +1 -0
  183. package/dist/types/navbar/navbar-content.d.ts +14 -0
  184. package/dist/types/navbar/navbar-content.d.ts.map +1 -0
  185. package/dist/types/navbar/navbar-context.d.ts +182 -0
  186. package/dist/types/navbar/navbar-context.d.ts.map +1 -0
  187. package/dist/types/navbar/navbar-item.d.ts +11 -0
  188. package/dist/types/navbar/navbar-item.d.ts.map +1 -0
  189. package/dist/types/navbar/navbar-menu/i18n.d.ts +3 -0
  190. package/dist/types/navbar/navbar-menu/i18n.d.ts.map +1 -0
  191. package/dist/types/navbar/navbar-menu/item.d.ts +16 -0
  192. package/dist/types/navbar/navbar-menu/item.d.ts.map +1 -0
  193. package/dist/types/navbar/navbar-menu/menu.d.ts +11 -0
  194. package/dist/types/navbar/navbar-menu/menu.d.ts.map +1 -0
  195. package/dist/types/navbar/navbar-menu/toggle.d.ts +12 -0
  196. package/dist/types/navbar/navbar-menu/toggle.d.ts.map +1 -0
  197. package/dist/types/navbar/navbar.d.ts +6 -0
  198. package/dist/types/navbar/navbar.d.ts.map +1 -0
  199. package/dist/types/navbar/use-navbar.d.ts +163 -0
  200. package/dist/types/navbar/use-navbar.d.ts.map +1 -0
  201. package/dist/types/range-calendar/range-calendar.d.ts.map +1 -1
  202. package/dist/types/select/select-item.d.ts +1 -2
  203. package/dist/types/select/select-item.d.ts.map +1 -1
  204. package/dist/types/select/select.d.ts +14 -0
  205. package/dist/types/select/select.d.ts.map +1 -1
  206. package/dist/types/spinner/use-spinner.d.ts +8 -8
  207. package/dist/types/system/react-utils/children.d.ts +13 -0
  208. package/dist/types/system/react-utils/children.d.ts.map +1 -0
  209. package/dist/types/system/react-utils/context.d.ts +4 -4
  210. package/dist/types/system/react-utils/context.d.ts.map +1 -1
  211. package/dist/types/system/react-utils/index.d.ts +5 -3
  212. package/dist/types/system/react-utils/index.d.ts.map +1 -1
  213. package/dist/types/system/utils.d.ts +1 -833
  214. package/dist/types/system/utils.d.ts.map +1 -1
  215. package/dist/types/tabs/tabs.d.ts.map +1 -1
  216. package/dist/types/tag-field/tag-field-item.d.ts.map +1 -1
  217. package/dist/types/tag-field/tag-field-list.d.ts.map +1 -1
  218. package/dist/types/toast/index.d.ts +3 -0
  219. package/dist/types/toast/index.d.ts.map +1 -0
  220. package/dist/types/toast/toast.d.ts +9 -0
  221. package/dist/types/toast/toast.d.ts.map +1 -0
  222. package/package.json +13 -12
  223. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +0 -0
  224. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/calendar.cjs +0 -0
  225. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/check.cjs +0 -0
  226. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs +0 -0
  227. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +0 -0
  228. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +0 -0
  229. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +0 -0
  230. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevrons-right.cjs +0 -0
  231. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs +0 -0
  232. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/ellipsis.cjs +0 -0
  233. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/external-link.cjs +0 -0
  234. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/info.cjs +0 -0
  235. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/landmark.cjs +0 -0
  236. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/lock.cjs +0 -0
  237. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/minus.cjs +0 -0
  238. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/plus.cjs +0 -0
  239. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/trash-2.cjs +0 -0
  240. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/upload.cjs +0 -0
  241. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/x.cjs +0 -0
  242. /package/dist/cjs/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +0 -0
  243. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/Icon.js +0 -0
  244. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -0
  245. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -0
  246. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/calendar.js +0 -0
  247. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/check.js +0 -0
  248. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -0
  249. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -0
  250. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -0
  251. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -0
  252. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/chevrons-right.js +0 -0
  253. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/circle-alert.js +0 -0
  254. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -0
  255. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/external-link.js +0 -0
  256. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/info.js +0 -0
  257. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/landmark.js +0 -0
  258. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/lock.js +0 -0
  259. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/minus.js +0 -0
  260. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/plus.js +0 -0
  261. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/trash-2.js +0 -0
  262. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/upload.js +0 -0
  263. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/icons/x.js +0 -0
  264. /package/dist/esm/node_modules/.pnpm/{lucide-react@0.475.0_react@19.0.0 → lucide-react@0.475.0_react@19.2.3}/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -0
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  'use strict';
3
3
 
4
- var react = require('react');
4
+ var $670gB$react = require('react');
5
5
  var form = require('@react-stately/form');
6
6
  var utils = require('@react-stately/utils');
7
7
  var useControllableState = require('../hooks/use-controllable-state.cjs');
8
8
 
9
9
  function useTagFieldState(props) {
10
10
  const { itemToText, itemToKey, defaultFilter } = props;
11
- const itemsByKey = react.useMemo(() => {
11
+ const itemsByKey = $670gB$react.useMemo(() => {
12
12
  const items = props.items ?? props.defaultItems ?? [];
13
13
  return items.reduce(
14
14
  (acc, item) => {
@@ -18,7 +18,7 @@ function useTagFieldState(props) {
18
18
  {}
19
19
  ) ?? {};
20
20
  }, [itemToKey, props.defaultItems, props.items]);
21
- const getSelectedItemsByKey = react.useCallback(
21
+ const getSelectedItemsByKey = $670gB$react.useCallback(
22
22
  (keys) => {
23
23
  if (!keys) return;
24
24
  return [...keys].map((key) => itemsByKey[key]);
@@ -36,13 +36,13 @@ function useTagFieldState(props) {
36
36
  defaultInputValue,
37
37
  props.onInputChange
38
38
  );
39
- const controlledSelectedKeys = react.useMemo(
39
+ const controlledSelectedKeys = $670gB$react.useMemo(
40
40
  () => new Set(selectedItems.map(itemToKey)),
41
41
  [itemToKey, selectedItems]
42
42
  );
43
43
  const validation = form.useFormValidationState({
44
44
  ...props,
45
- value: react.useMemo(
45
+ value: $670gB$react.useMemo(
46
46
  () => ({
47
47
  inputValue,
48
48
  selectedKeys: controlledSelectedKeys
@@ -50,7 +50,7 @@ function useTagFieldState(props) {
50
50
  [controlledSelectedKeys, inputValue]
51
51
  )
52
52
  });
53
- const filteredItems = react.useMemo(
53
+ const filteredItems = $670gB$react.useMemo(
54
54
  () => (
55
55
  // No default filter if items are controlled.
56
56
  !!props.items || !defaultFilter ? props.items ?? [] : filterItems({
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  'use strict';
3
3
 
4
- var react = require('react');
4
+ var $670gB$react = require('react');
5
5
  var utils = require('@react-aria/utils');
6
6
  var reactVirtual = require('@tanstack/react-virtual');
7
7
  var downshift = require('downshift');
@@ -23,7 +23,7 @@ function useTagField(props, state) {
23
23
  label,
24
24
  virtualRowHeight = 40
25
25
  } = props;
26
- const backupBtnRef = react.useRef(null);
26
+ const backupBtnRef = $670gB$react.useRef(null);
27
27
  buttonRef = buttonRef ?? backupBtnRef;
28
28
  const {
29
29
  selectedItems,
@@ -48,14 +48,14 @@ function useTagField(props, state) {
48
48
  }
49
49
  }
50
50
  });
51
- const disabledKeysSet = react.useMemo(() => {
51
+ const disabledKeysSet = $670gB$react.useMemo(() => {
52
52
  return new Set(disabledKeys);
53
53
  }, [disabledKeys]);
54
54
  const rowVirtualizer = reactVirtual.useVirtualizer({
55
55
  count: items.length,
56
56
  getScrollElement: () => listBoxRef.current,
57
57
  estimateSize: () => virtualRowHeight,
58
- getItemKey: react.useCallback(
58
+ getItemKey: $670gB$react.useCallback(
59
59
  (index) => itemToKey(items[index]),
60
60
  [itemToKey, items]
61
61
  ),
@@ -3,11 +3,11 @@
3
3
  'use strict';
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
6
+ var $670gB$react = require('react');
7
7
  var reactAriaComponents = require('react-aria-components');
8
8
  var ouiTheme = require('@opengovsg/oui-theme');
9
9
 
10
- const TextArea = react.forwardRef(
10
+ const TextArea = $670gB$react.forwardRef(
11
11
  ({ size, variant, isDisabled, ...props }, ref) => {
12
12
  return /* @__PURE__ */ jsxRuntime.jsx(
13
13
  reactAriaComponents.TextArea,
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ 'use strict';
3
+
4
+ var toast = require('./toast.cjs');
5
+ var sonner = require('sonner');
6
+
7
+
8
+
9
+ exports.Toaster = toast.Toaster;
10
+ Object.defineProperty(exports, "toast", {
11
+ enumerable: true,
12
+ get: function () { return sonner.toast; }
13
+ });
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ "use client";
3
+ 'use strict';
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var sonner = require('sonner');
7
+ var ouiTheme = require('@opengovsg/oui-theme');
8
+ var spinner = require('../spinner/spinner.cjs');
9
+ var utils = require('../system/utils.cjs');
10
+ var x = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.cjs');
11
+
12
+ function Toaster(originalProps) {
13
+ const [{ toastOptions, closeButton = true, ...props }, variantProps] = utils.mapPropsVariants(originalProps, ouiTheme.toastStyles.variantKeys);
14
+ const styles = ouiTheme.toastStyles(variantProps);
15
+ return /* @__PURE__ */ jsxRuntime.jsx(
16
+ sonner.Toaster,
17
+ {
18
+ className: styles.base({
19
+ className: props.className ?? props.classNames?.base
20
+ }),
21
+ position: "top-center",
22
+ icons: {
23
+ loading: /* @__PURE__ */ jsxRuntime.jsx(spinner.Spinner, { size: "xs" }),
24
+ close: /* @__PURE__ */ jsxRuntime.jsx(x.default, {})
25
+ },
26
+ mobileOffset: 8,
27
+ offset: {
28
+ top: 8
29
+ },
30
+ closeButton,
31
+ toastOptions: {
32
+ classNames: {
33
+ toast: styles.toast({
34
+ className: props.classNames?.toast
35
+ }),
36
+ title: styles.title({
37
+ className: props.classNames?.title
38
+ }),
39
+ description: styles.description({
40
+ className: props.classNames?.description
41
+ }),
42
+ loader: styles.loader({
43
+ className: props.classNames?.loader
44
+ }),
45
+ closeButton: styles.closeButton({
46
+ className: props.classNames?.closeButton
47
+ }),
48
+ success: styles.success({
49
+ className: props.classNames?.success
50
+ }),
51
+ error: styles.error({
52
+ className: props.classNames?.error
53
+ }),
54
+ info: styles.info({
55
+ className: props.classNames?.info
56
+ }),
57
+ warning: styles.warning({
58
+ className: props.classNames?.warning
59
+ }),
60
+ loading: styles.loading({
61
+ className: props.classNames?.loading
62
+ }),
63
+ default: styles.default({
64
+ className: props.classNames?.default
65
+ }),
66
+ content: styles.content({
67
+ className: props.classNames?.content
68
+ }),
69
+ icon: styles.icon({
70
+ className: props.classNames?.icon
71
+ }),
72
+ actionButton: styles.actionButton({
73
+ className: props.classNames?.actionButton
74
+ }),
75
+ cancelButton: styles.cancelButton({
76
+ className: props.classNames?.cancelButton
77
+ })
78
+ },
79
+ unstyled: true,
80
+ ...toastOptions
81
+ },
82
+ ...props
83
+ }
84
+ );
85
+ }
86
+
87
+ Object.defineProperty(exports, "toast", {
88
+ enumerable: true,
89
+ get: function () { return sonner.toast; }
90
+ });
91
+ exports.Toaster = Toaster;
@@ -3,7 +3,7 @@
3
3
  'use strict';
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
6
+ var $670gB$react = require('react');
7
7
  var reactAria = require('react-aria');
8
8
  var reactAriaComponents = require('react-aria-components');
9
9
  var ouiTheme = require('@opengovsg/oui-theme');
@@ -21,12 +21,12 @@ const Toggle = ({
21
21
  ouiTheme.toggleStyles.variantKeys
22
22
  );
23
23
  const slots = ouiTheme.toggleStyles(variantProps);
24
- const clonedThumbIcon = react.useCallback(
24
+ const clonedThumbIcon = $670gB$react.useCallback(
25
25
  (renderProps) => {
26
26
  const baseProps = {
27
27
  className: slots.thumbIcon({ className: classNames?.thumbIcon })
28
28
  };
29
- return typeof thumbIcon === "function" ? thumbIcon(reactAria.mergeProps(baseProps, renderProps)) : thumbIcon && react.cloneElement(thumbIcon, baseProps);
29
+ return typeof thumbIcon === "function" ? thumbIcon(reactAria.mergeProps(baseProps, renderProps)) : thumbIcon && $670gB$react.cloneElement(thumbIcon, baseProps);
30
30
  },
31
31
  [classNames?.thumbIcon, slots, thumbIcon]
32
32
  );
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ "use client";
3
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
+ import { useContext } from 'react';
5
+ import { Disclosure, composeRenderProps, DisclosureGroup, DisclosureStateContext, Heading, Button, DisclosurePanel } from 'react-aria-components';
6
+ import { cn, accordionStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
7
+ import { renderChildren } from '../system/react-utils/children.js';
8
+ import { forwardRef, mapPropsVariants } from '../system/utils.js';
9
+ import { createContext } from '../system/react-utils/context.js';
10
+ import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
11
+
12
+ const [AccordionStyleContext, useAccordionStyleContext] = createContext({
13
+ name: "AccordionStyleContext",
14
+ strict: true
15
+ });
16
+ const AccordionItem = forwardRef(
17
+ ({ classNames, className, children, ...props }, ref) => {
18
+ const { slots } = useContext(AccordionStyleContext);
19
+ return /* @__PURE__ */ jsx(
20
+ Disclosure,
21
+ {
22
+ ...props,
23
+ ref,
24
+ className: composeRenderProps(
25
+ className,
26
+ (className2, renderProps) => slots.item({
27
+ ...renderProps,
28
+ className: cn(classNames?.item, className2)
29
+ })
30
+ ),
31
+ children
32
+ }
33
+ );
34
+ }
35
+ );
36
+ AccordionItem.displayName = "AccordionItem";
37
+ function AccordionHeader({
38
+ children,
39
+ classNames,
40
+ indicator,
41
+ startContent,
42
+ endContent,
43
+ hideIndicator = false
44
+ }) {
45
+ const { slots, classNames: contextClassNames } = useContext(
46
+ AccordionStyleContext
47
+ );
48
+ const { isExpanded } = useContext(DisclosureStateContext);
49
+ return /* @__PURE__ */ jsx(
50
+ Heading,
51
+ {
52
+ className: slots.heading({
53
+ className: cn(contextClassNames?.heading, classNames?.heading)
54
+ }),
55
+ children: /* @__PURE__ */ jsx(
56
+ Button,
57
+ {
58
+ slot: "trigger",
59
+ className: slots.trigger({
60
+ className: cn(contextClassNames?.trigger, classNames?.trigger)
61
+ }),
62
+ children: (buttonRenderProps) => {
63
+ const headerRenderProps = { ...buttonRenderProps, isExpanded };
64
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
65
+ startContent && /* @__PURE__ */ jsx(
66
+ "div",
67
+ {
68
+ className: slots.startContentWrapper({
69
+ className: cn(
70
+ contextClassNames?.startContentWrapper,
71
+ classNames?.startContentWrapper
72
+ )
73
+ }),
74
+ children: renderChildren(headerRenderProps, startContent)
75
+ }
76
+ ),
77
+ /* @__PURE__ */ jsx(
78
+ "span",
79
+ {
80
+ className: slots.title({
81
+ className: cn(contextClassNames?.title, classNames?.title)
82
+ }),
83
+ children: renderChildren(headerRenderProps, children)
84
+ }
85
+ ),
86
+ !hideIndicator && /* @__PURE__ */ jsx(
87
+ "span",
88
+ {
89
+ "aria-hidden": true,
90
+ className: slots.indicator({
91
+ isExpanded,
92
+ className: cn(
93
+ contextClassNames?.indicator,
94
+ classNames?.indicator
95
+ )
96
+ }),
97
+ children: renderChildren(
98
+ headerRenderProps,
99
+ indicator ?? /* @__PURE__ */ jsx(ChevronDown, {})
100
+ )
101
+ }
102
+ ),
103
+ endContent && /* @__PURE__ */ jsx(
104
+ "div",
105
+ {
106
+ className: slots.endContentWrapper({
107
+ className: cn(
108
+ contextClassNames?.endContentWrapper,
109
+ classNames?.endContentWrapper
110
+ )
111
+ }),
112
+ children: renderChildren(headerRenderProps, endContent)
113
+ }
114
+ )
115
+ ] });
116
+ }
117
+ }
118
+ )
119
+ }
120
+ );
121
+ }
122
+ function AccordionContent({
123
+ children,
124
+ classNames,
125
+ ...props
126
+ }) {
127
+ const { slots, classNames: contextClassNames } = useContext(
128
+ AccordionStyleContext
129
+ );
130
+ return /* @__PURE__ */ jsx(
131
+ DisclosurePanel,
132
+ {
133
+ ...props,
134
+ className: composeTailwindRenderProps(
135
+ props.className,
136
+ slots.panel({
137
+ className: cn(contextClassNames?.panel, classNames?.panel)
138
+ })
139
+ ),
140
+ children: /* @__PURE__ */ jsx(
141
+ "div",
142
+ {
143
+ className: slots.content({
144
+ className: cn(contextClassNames?.content, classNames?.content)
145
+ }),
146
+ children
147
+ }
148
+ )
149
+ }
150
+ );
151
+ }
152
+ const Accordion = forwardRef(
153
+ (originalProps, ref) => {
154
+ const [
155
+ { classNames, className, ...props },
156
+ { size = "md", ...variantProps }
157
+ ] = mapPropsVariants(originalProps, accordionStyles.variantKeys);
158
+ const slots = accordionStyles({ size, ...variantProps });
159
+ return /* @__PURE__ */ jsx(
160
+ AccordionStyleContext.Provider,
161
+ {
162
+ value: {
163
+ slots,
164
+ classNames
165
+ },
166
+ children: /* @__PURE__ */ jsx(
167
+ DisclosureGroup,
168
+ {
169
+ className: slots.base({
170
+ className: cn(classNames?.base, className)
171
+ }),
172
+ ...props,
173
+ ref
174
+ }
175
+ )
176
+ }
177
+ );
178
+ }
179
+ );
180
+ Accordion.displayName = "Accordion";
181
+
182
+ export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionStyleContext, useAccordionStyleContext };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionStyleContext, useAccordionStyleContext } from './accordion.js';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ import { createContext } from '../system/react-utils/context.js';
3
+
4
+ const [AvatarContext, useAvatarContext] = createContext({
5
+ name: "AvatarContext",
6
+ strict: true
7
+ });
8
+
9
+ export { AvatarContext, useAvatarContext };
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ import { useMemo, cloneElement } from 'react';
3
+ import { avatarGroupStyles, cn } from '@opengovsg/oui-theme';
4
+ import { getValidChildren } from '../system/react-utils/children.js';
5
+ import { createContext } from '../system/react-utils/context.js';
6
+ import { useDomRef } from '../system/react-utils/refs.js';
7
+
8
+ const [AvatarGroupProvider, useAvatarGroupContext] = createContext({
9
+ name: "AvatarGroupContext",
10
+ strict: false
11
+ });
12
+ function useAvatarGroup(props = {}) {
13
+ const {
14
+ as,
15
+ ref,
16
+ max = 5,
17
+ total,
18
+ size,
19
+ color,
20
+ prominence,
21
+ radius,
22
+ children,
23
+ renderCount,
24
+ className,
25
+ classNames,
26
+ countProps,
27
+ ...otherProps
28
+ } = props;
29
+ const domRef = useDomRef(ref);
30
+ const Component = as || "div";
31
+ const context = useMemo(
32
+ () => ({
33
+ size,
34
+ color,
35
+ radius,
36
+ prominence
37
+ }),
38
+ [size, color, radius, prominence]
39
+ );
40
+ const slots = useMemo(
41
+ () => avatarGroupStyles({ className: className ?? classNames?.base }),
42
+ [className, classNames?.base]
43
+ );
44
+ const validChildren = getValidChildren(children);
45
+ const childrenWithinMax = max ? validChildren.slice(0, max) : validChildren;
46
+ const remainingCount = total ? total : max != null ? validChildren.length - max : -1;
47
+ const clones = childrenWithinMax.map((child, index) => {
48
+ return cloneElement(child, {
49
+ // @ts-expect-error: CSS variable is not recognized as a valid style property
50
+ style: {
51
+ "--avatar-zindex": childrenWithinMax.length - index
52
+ }
53
+ });
54
+ });
55
+ const getAvatarGroupProps = () => {
56
+ return {
57
+ ref: domRef,
58
+ className: slots.base({
59
+ class: cn(classNames?.base, className)
60
+ }),
61
+ role: "group",
62
+ ...otherProps
63
+ };
64
+ };
65
+ const getAvatarGroupCountProps = () => {
66
+ return {
67
+ className: slots.counter({
68
+ class: classNames?.counter
69
+ }),
70
+ ...countProps
71
+ };
72
+ };
73
+ return {
74
+ Component,
75
+ context,
76
+ remainingCount,
77
+ clones,
78
+ renderCount,
79
+ getAvatarGroupProps,
80
+ getAvatarGroupCountProps
81
+ };
82
+ }
83
+
84
+ export { AvatarGroupProvider, useAvatarGroup, useAvatarGroupContext };
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { useMemo } from 'react';
4
+ import { forwardRef } from '../system/utils.js';
5
+ import { AvatarRoot, AvatarFallback } from './avatar.js';
6
+ import { useAvatarGroup, AvatarGroupProvider } from './avatar-group-context.js';
7
+
8
+ const AvatarGroup = forwardRef((props, ref) => {
9
+ const {
10
+ Component,
11
+ clones,
12
+ context,
13
+ remainingCount,
14
+ getAvatarGroupCountProps,
15
+ getAvatarGroupProps,
16
+ renderCount
17
+ } = useAvatarGroup({
18
+ ...props,
19
+ ref
20
+ });
21
+ const renderedCount = useMemo(() => {
22
+ if (remainingCount <= 0) return null;
23
+ if (renderCount) {
24
+ return renderCount(remainingCount);
25
+ }
26
+ const countAvatarVariantProps = {
27
+ prominence: "subtle",
28
+ color: "primary"
29
+ };
30
+ if (context.prominence === "subtle") {
31
+ countAvatarVariantProps.color = "white";
32
+ }
33
+ return /* @__PURE__ */ jsx(
34
+ AvatarRoot,
35
+ {
36
+ ...countAvatarVariantProps,
37
+ ...getAvatarGroupCountProps(),
38
+ name: `+${remainingCount}`,
39
+ children: /* @__PURE__ */ jsxs(AvatarFallback, { children: [
40
+ "+",
41
+ remainingCount
42
+ ] })
43
+ }
44
+ );
45
+ }, [
46
+ context.prominence,
47
+ getAvatarGroupCountProps,
48
+ remainingCount,
49
+ renderCount
50
+ ]);
51
+ return /* @__PURE__ */ jsx(Component, { ...getAvatarGroupProps(), children: /* @__PURE__ */ jsxs(AvatarGroupProvider, { value: context, children: [
52
+ clones,
53
+ renderedCount
54
+ ] }) });
55
+ });
56
+ AvatarGroup.displayName = "AvatarGroup";
57
+
58
+ export { AvatarGroup };
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ "use client";
3
+ import { jsx } from 'react/jsx-runtime';
4
+ import { useState, useMemo } from 'react';
5
+ import { useLayoutEffect } from '@react-aria/utils';
6
+ import { avatarStyles, dataAttr } from '@opengovsg/oui-theme';
7
+ import { forwardRef, mapPropsVariants } from '../system/utils.js';
8
+ import { AvatarContext, useAvatarContext } from './avatar-context.js';
9
+ import { useAvatarGroupContext } from './avatar-group-context.js';
10
+ import { useImageLoadingStatus } from './hooks/use-img-loading-status.js';
11
+ import { getInitialsFromText } from './utils.js';
12
+ import { useDomRef } from '../system/react-utils/refs.js';
13
+ import User from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/user.js';
14
+
15
+ const AvatarRoot = forwardRef(
16
+ (originalProps, ref) => {
17
+ const groupContext = useAvatarGroupContext();
18
+ const [
19
+ {
20
+ name,
21
+ getInitials = getInitialsFromText,
22
+ classNames,
23
+ className,
24
+ children,
25
+ as,
26
+ ...props
27
+ },
28
+ {
29
+ color = groupContext?.color,
30
+ prominence = groupContext?.prominence,
31
+ size = groupContext?.size,
32
+ radius = groupContext?.radius,
33
+ ...variantProps
34
+ }
35
+ ] = mapPropsVariants(originalProps, avatarStyles.variantKeys);
36
+ const isInGroup = !!groupContext;
37
+ const domRef = useDomRef(ref);
38
+ const slots = avatarStyles({
39
+ color,
40
+ prominence,
41
+ size,
42
+ radius,
43
+ isInGroup,
44
+ ...variantProps
45
+ });
46
+ const [imageLoadingStatus, setImageLoadingStatus] = useState("idle");
47
+ const Component = as || "span";
48
+ return /* @__PURE__ */ jsx(
49
+ AvatarContext,
50
+ {
51
+ value: {
52
+ imageLoadingStatus,
53
+ setImageLoadingStatus,
54
+ slots,
55
+ classNames,
56
+ getInitials,
57
+ name
58
+ },
59
+ children: /* @__PURE__ */ jsx(
60
+ Component,
61
+ {
62
+ ref: domRef,
63
+ ...props,
64
+ className: slots.base({ className: className ?? classNames?.base }),
65
+ children
66
+ }
67
+ )
68
+ }
69
+ );
70
+ }
71
+ );
72
+ const AvatarImage = forwardRef(
73
+ ({ src, as, ...props }, ref) => {
74
+ const domRef = useDomRef(ref);
75
+ const {
76
+ setImageLoadingStatus,
77
+ imageLoadingStatus,
78
+ slots,
79
+ name,
80
+ classNames
81
+ } = useAvatarContext();
82
+ const currentImageStatus = useImageLoadingStatus(src, props);
83
+ const Component = as || "img";
84
+ useLayoutEffect(() => {
85
+ setImageLoadingStatus(currentImageStatus);
86
+ }, [currentImageStatus, setImageLoadingStatus]);
87
+ return /* @__PURE__ */ jsx(
88
+ Component,
89
+ {
90
+ ref: domRef,
91
+ alt: name,
92
+ "data-loaded": dataAttr(imageLoadingStatus === "loaded"),
93
+ ...props,
94
+ src,
95
+ className: slots.image({ className: classNames?.image })
96
+ }
97
+ );
98
+ }
99
+ );
100
+ const AvatarFallback = forwardRef(
101
+ ({ children, as, ...props }, ref) => {
102
+ const domRef = useDomRef(ref);
103
+ const { slots, classNames, imageLoadingStatus, name, getInitials } = useAvatarContext();
104
+ const childrenToRender = useMemo(() => {
105
+ if (children) return children;
106
+ if (name) {
107
+ return getInitials(name);
108
+ }
109
+ return /* @__PURE__ */ jsx(User, { className: slots.icon({ className: classNames?.icon }) });
110
+ }, [children, classNames?.icon, getInitials, name, slots]);
111
+ const Component = as || "div";
112
+ if (imageLoadingStatus === "loaded") {
113
+ return null;
114
+ }
115
+ return /* @__PURE__ */ jsx(
116
+ Component,
117
+ {
118
+ title: name,
119
+ className: slots.fallback({ className: classNames?.fallback }),
120
+ ref: domRef,
121
+ ...props,
122
+ children: childrenToRender
123
+ }
124
+ );
125
+ }
126
+ );
127
+
128
+ export { AvatarFallback, AvatarImage, AvatarRoot };