@flikk/ui 1.0.0-beta.1 → 1.0.0-beta.3

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 (383) hide show
  1. package/dist/components/ai/ApprovalCard/ApprovalCard.js +2 -2
  2. package/dist/components/ai/ApprovalCard/ApprovalCard.types.d.ts +2 -2
  3. package/dist/components/ai/PromptInput/PromptInput.js +173 -13
  4. package/dist/components/ai/PromptInput/PromptInput.theme.js +1 -0
  5. package/dist/components/ai/PromptInput/PromptInput.types.d.ts +20 -0
  6. package/dist/components/core/Accordion/Accordion.theme.js +2 -2
  7. package/dist/components/core/Alert/Alert.js +2 -2
  8. package/dist/components/core/Alert/Alert.types.d.ts +2 -2
  9. package/dist/components/core/AlertDialog/AlertDialog.d.ts +1 -1
  10. package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
  11. package/dist/components/core/AlertDialog/AlertDialog.types.d.ts +2 -2
  12. package/dist/components/core/Badge/Badge.js +11 -9
  13. package/dist/components/core/Badge/Badge.theme.js +13 -14
  14. package/dist/components/core/Badge/Badge.types.d.ts +6 -1
  15. package/dist/components/core/Button/Button.theme.js +8 -9
  16. package/dist/components/core/Calendar/Calendar.theme.js +1 -1
  17. package/dist/components/core/Card/Card.d.ts +2 -2
  18. package/dist/components/core/Card/Card.js +6 -7
  19. package/dist/components/core/Card/Card.theme.js +4 -4
  20. package/dist/components/core/Card/Card.types.d.ts +5 -20
  21. package/dist/components/core/Card/CardSubtitle.d.ts +3 -0
  22. package/dist/components/core/Card/CardSubtitle.js +11 -0
  23. package/dist/components/core/Card/index.d.ts +2 -2
  24. package/dist/components/core/CommandPalette/CommandItem.d.ts +1 -1
  25. package/dist/components/core/CommandPalette/CommandItem.js +2 -2
  26. package/dist/components/core/CommandPalette/CommandPalette.js +2 -2
  27. package/dist/components/core/CommandPalette/CommandPalette.theme.js +2 -2
  28. package/dist/components/core/CommandPalette/CommandPalette.types.d.ts +2 -2
  29. package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +1 -1
  30. package/dist/components/core/ContextMenu/ContextMenuItem.js +2 -2
  31. package/dist/components/core/Drawer/Drawer.d.ts +13 -1
  32. package/dist/components/core/Drawer/Drawer.js +23 -10
  33. package/dist/components/core/Drawer/Drawer.theme.js +1 -1
  34. package/dist/components/core/Drawer/Drawer.types.d.ts +21 -4
  35. package/dist/components/core/Drawer/DrawerHeader.d.ts +5 -0
  36. package/dist/components/core/Drawer/DrawerHeader.js +14 -0
  37. package/dist/components/core/Drawer/DrawerSubtitle.d.ts +5 -0
  38. package/dist/components/core/Drawer/DrawerSubtitle.js +11 -0
  39. package/dist/components/core/Drawer/DrawerTitle.d.ts +5 -0
  40. package/dist/components/core/Drawer/DrawerTitle.js +11 -0
  41. package/dist/components/core/Drawer/index.d.ts +1 -1
  42. package/dist/components/core/Dropdown/Dropdown.types.d.ts +4 -4
  43. package/dist/components/core/Dropdown/DropdownItem.js +2 -2
  44. package/dist/components/core/Empty/Empty.js +2 -2
  45. package/dist/components/core/Empty/Empty.theme.d.ts +1 -1
  46. package/dist/components/core/Empty/Empty.theme.js +3 -3
  47. package/dist/components/core/Empty/Empty.types.d.ts +2 -2
  48. package/dist/components/core/MenuItem/MenuItem.js +2 -2
  49. package/dist/components/core/MenuItem/MenuItem.theme.d.ts +1 -2
  50. package/dist/components/core/MenuItem/MenuItem.theme.js +7 -9
  51. package/dist/components/core/MenuItem/MenuItem.types.d.ts +1 -1
  52. package/dist/components/core/Message/Message.d.ts +3 -2
  53. package/dist/components/core/Message/Message.js +30 -24
  54. package/dist/components/core/Message/Message.theme.d.ts +1 -1
  55. package/dist/components/core/Message/Message.theme.js +22 -24
  56. package/dist/components/core/Message/Message.types.d.ts +0 -7
  57. package/dist/components/core/Message/MessageList.animations.d.ts +6 -0
  58. package/dist/components/core/Message/MessageList.animations.js +32 -0
  59. package/dist/components/core/Message/MessageList.d.ts +5 -0
  60. package/dist/components/core/Message/MessageList.js +78 -0
  61. package/dist/components/core/Message/MessageList.theme.d.ts +2 -0
  62. package/dist/components/core/Message/MessageList.theme.js +6 -0
  63. package/dist/components/core/Message/MessageList.types.d.ts +32 -0
  64. package/dist/components/core/Message/index.d.ts +2 -0
  65. package/dist/components/core/Modal/Modal.d.ts +2 -2
  66. package/dist/components/core/Modal/Modal.js +5 -5
  67. package/dist/components/core/Modal/Modal.theme.js +5 -5
  68. package/dist/components/core/Modal/Modal.types.d.ts +4 -4
  69. package/dist/components/core/Modal/ModalSubtitle.d.ts +5 -0
  70. package/dist/components/core/Modal/ModalSubtitle.js +11 -0
  71. package/dist/components/core/ModalStack/ModalStack.animations.js +3 -3
  72. package/dist/components/core/ModalStack/ModalStackModal.js +3 -3
  73. package/dist/components/core/PageHeading/PageHeading.d.ts +8 -0
  74. package/dist/components/core/PageHeading/PageHeading.js +28 -0
  75. package/dist/components/core/PageHeading/PageHeading.theme.d.ts +2 -0
  76. package/dist/components/core/PageHeading/PageHeading.theme.js +11 -0
  77. package/dist/components/core/PageHeading/PageHeading.types.d.ts +55 -0
  78. package/dist/components/core/PageHeading/PageHeadingActions.d.ts +3 -0
  79. package/dist/components/core/PageHeading/PageHeadingActions.js +11 -0
  80. package/dist/components/core/PageHeading/PageHeadingBackButton.d.ts +3 -0
  81. package/dist/components/core/PageHeading/PageHeadingBackButton.js +12 -0
  82. package/dist/components/core/PageHeading/PageHeadingIcon.d.ts +3 -0
  83. package/dist/components/core/PageHeading/PageHeadingIcon.js +11 -0
  84. package/dist/components/core/PageHeading/PageHeadingSubtitle.d.ts +3 -0
  85. package/dist/components/core/PageHeading/PageHeadingSubtitle.js +11 -0
  86. package/dist/components/core/PageHeading/PageHeadingTitle.d.ts +3 -0
  87. package/dist/components/core/PageHeading/PageHeadingTitle.js +11 -0
  88. package/dist/components/core/PageHeading/index.d.ts +2 -0
  89. package/dist/components/core/Popover/Popover.theme.js +1 -1
  90. package/dist/components/core/Segmented/Segmented.theme.js +3 -3
  91. package/dist/components/core/Sidebar/Sidebar.js +1 -0
  92. package/dist/components/core/SocialIcon/SocialIcon.d.ts +3 -0
  93. package/dist/components/core/SocialIcon/SocialIcon.js +30 -0
  94. package/dist/components/core/SocialIcon/SocialIcon.theme.d.ts +2 -0
  95. package/dist/components/core/SocialIcon/SocialIcon.theme.js +12 -0
  96. package/dist/components/core/SocialIcon/SocialIcon.types.d.ts +18 -0
  97. package/dist/components/core/SocialIcon/index.d.ts +2 -0
  98. package/dist/components/core/SocialIcon/platforms.d.ts +17 -0
  99. package/dist/components/core/SocialIcon/platforms.js +234 -0
  100. package/dist/components/core/Toast/Toast.js +4 -4
  101. package/dist/components/core/Toast/Toast.theme.js +1 -1
  102. package/dist/components/core/Toast/Toast.types.d.ts +9 -9
  103. package/dist/components/core/Toast/useToast.js +6 -6
  104. package/dist/components/core/index.d.ts +2 -7
  105. package/dist/components/core/index.js +9 -19
  106. package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.js +1 -1
  107. package/dist/components/{core → data-display}/Feed/Feed.js +2 -2
  108. package/dist/components/data-display/GanttChart/GanttChart.animations.d.ts +4 -0
  109. package/dist/components/data-display/GanttChart/GanttChart.animations.js +21 -0
  110. package/dist/components/data-display/GanttChart/GanttChart.d.ts +8 -0
  111. package/dist/components/data-display/GanttChart/GanttChart.js +170 -0
  112. package/dist/components/data-display/GanttChart/GanttChart.theme.d.ts +2 -0
  113. package/dist/components/data-display/GanttChart/GanttChart.theme.js +23 -0
  114. package/dist/components/data-display/GanttChart/GanttChart.types.d.ts +162 -0
  115. package/dist/components/data-display/GanttChart/GanttChart.types.js +9 -0
  116. package/dist/components/data-display/GanttChart/GanttChart.utils.d.ts +80 -0
  117. package/dist/components/data-display/GanttChart/GanttChart.utils.js +274 -0
  118. package/dist/components/data-display/GanttChart/GanttChartPanel.d.ts +9 -0
  119. package/dist/components/data-display/GanttChart/GanttChartPanel.js +82 -0
  120. package/dist/components/data-display/GanttChart/GanttDependencyArrows.d.ts +2 -0
  121. package/dist/components/data-display/GanttChart/GanttDependencyArrows.js +35 -0
  122. package/dist/components/data-display/GanttChart/GanttGroupBar.d.ts +8 -0
  123. package/dist/components/data-display/GanttChart/GanttGroupBar.js +26 -0
  124. package/dist/components/data-display/GanttChart/GanttMilestone.d.ts +9 -0
  125. package/dist/components/data-display/GanttChart/GanttMilestone.js +44 -0
  126. package/dist/components/data-display/GanttChart/GanttProgressCircle.d.ts +9 -0
  127. package/dist/components/data-display/GanttChart/GanttProgressCircle.js +11 -0
  128. package/dist/components/data-display/GanttChart/GanttSplitter.d.ts +2 -0
  129. package/dist/components/data-display/GanttChart/GanttSplitter.js +39 -0
  130. package/dist/components/data-display/GanttChart/GanttTableGroupRow.d.ts +7 -0
  131. package/dist/components/data-display/GanttChart/GanttTableGroupRow.js +23 -0
  132. package/dist/components/data-display/GanttChart/GanttTableHeader.d.ts +2 -0
  133. package/dist/components/data-display/GanttChart/GanttTableHeader.js +13 -0
  134. package/dist/components/data-display/GanttChart/GanttTablePanel.d.ts +6 -0
  135. package/dist/components/data-display/GanttChart/GanttTablePanel.js +20 -0
  136. package/dist/components/data-display/GanttChart/GanttTableTaskRow.d.ts +8 -0
  137. package/dist/components/data-display/GanttChart/GanttTableTaskRow.js +30 -0
  138. package/dist/components/data-display/GanttChart/GanttTaskBar.d.ts +9 -0
  139. package/dist/components/data-display/GanttChart/GanttTaskBar.js +206 -0
  140. package/dist/components/data-display/GanttChart/GanttTaskContextMenu.d.ts +8 -0
  141. package/dist/components/data-display/GanttChart/GanttTaskContextMenu.js +17 -0
  142. package/dist/components/data-display/GanttChart/GanttTimelineGrid.d.ts +7 -0
  143. package/dist/components/data-display/GanttChart/GanttTimelineGrid.js +33 -0
  144. package/dist/components/data-display/GanttChart/GanttTimelineHeader.d.ts +8 -0
  145. package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +43 -0
  146. package/dist/components/data-display/GanttChart/GanttToolbar.d.ts +2 -0
  147. package/dist/components/data-display/GanttChart/GanttToolbar.js +28 -0
  148. package/dist/components/data-display/GanttChart/hooks/useGanttDates.d.ts +12 -0
  149. package/dist/components/data-display/GanttChart/hooks/useGanttDates.js +25 -0
  150. package/dist/components/data-display/GanttChart/hooks/useGanttDrag.d.ts +25 -0
  151. package/dist/components/data-display/GanttChart/hooks/useGanttDrag.js +144 -0
  152. package/dist/components/data-display/GanttChart/hooks/useGanttLayout.d.ts +2 -0
  153. package/dist/components/data-display/GanttChart/hooks/useGanttLayout.js +33 -0
  154. package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.d.ts +6 -0
  155. package/dist/components/data-display/GanttChart/hooks/useGanttScrollSync.js +32 -0
  156. package/dist/components/data-display/GanttChart/index.d.ts +3 -0
  157. package/dist/components/{core → data-display}/KPI/KPI.js +10 -8
  158. package/dist/components/{core → data-display}/KPI/KPI.theme.js +2 -1
  159. package/dist/components/{core → data-display}/KPI/KPI.types.d.ts +5 -5
  160. package/dist/components/{core → data-display}/KPI/index.d.ts +1 -0
  161. package/dist/components/{core → data-display}/Metric/Metric.js +4 -7
  162. package/dist/components/{core → data-display}/Metric/Metric.theme.js +9 -9
  163. package/dist/components/{core → data-display}/Metric/Metric.types.d.ts +6 -6
  164. package/dist/components/{core → data-display}/Table/Table.theme.js +2 -2
  165. package/dist/components/{core → data-display}/Table/TableActions.js +8 -8
  166. package/dist/components/{core → data-display}/Table/TableColumnManager.js +4 -4
  167. package/dist/components/{core → data-display}/Table/TableFilter.js +3 -3
  168. package/dist/components/data-display/Table/TablePagination.js +25 -0
  169. package/dist/components/{core → data-display}/Table/TableRow.js +1 -1
  170. package/dist/components/{core → data-display}/Table/TableSelectionHeader.js +1 -1
  171. package/dist/components/data-display/index.d.ts +7 -0
  172. package/dist/components/data-display/index.js +20 -0
  173. package/dist/components/effects/Aurora/Aurora.d.ts +24 -0
  174. package/dist/components/effects/Aurora/Aurora.js +119 -0
  175. package/dist/components/effects/Aurora/Aurora.types.d.ts +15 -0
  176. package/dist/components/effects/Aurora/index.d.ts +2 -0
  177. package/dist/components/effects/DotPattern/DotPattern.d.ts +18 -0
  178. package/dist/components/effects/DotPattern/DotPattern.js +65 -0
  179. package/dist/components/effects/DotPattern/DotPattern.types.d.ts +47 -0
  180. package/dist/components/effects/DotPattern/index.d.ts +2 -0
  181. package/dist/components/effects/GridPattern/GridPattern.d.ts +18 -0
  182. package/dist/components/effects/GridPattern/GridPattern.js +64 -0
  183. package/dist/components/effects/GridPattern/GridPattern.types.d.ts +47 -0
  184. package/dist/components/effects/GridPattern/index.d.ts +2 -0
  185. package/dist/components/effects/MagneticElement/MagneticElement.d.ts +30 -0
  186. package/dist/components/effects/MagneticElement/MagneticElement.js +110 -0
  187. package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +44 -0
  188. package/dist/components/effects/MagneticElement/index.d.ts +2 -0
  189. package/dist/components/effects/MorphingText/MorphingText.d.ts +17 -0
  190. package/dist/components/effects/MorphingText/MorphingText.js +91 -0
  191. package/dist/components/effects/MorphingText/MorphingText.types.d.ts +18 -0
  192. package/dist/components/effects/MorphingText/index.d.ts +2 -0
  193. package/dist/components/effects/NoiseOverlay/NoiseOverlay.d.ts +28 -0
  194. package/dist/components/effects/NoiseOverlay/NoiseOverlay.js +61 -0
  195. package/dist/components/effects/NoiseOverlay/NoiseOverlay.types.d.ts +35 -0
  196. package/dist/components/effects/NoiseOverlay/index.d.ts +2 -0
  197. package/dist/components/effects/ParallaxSection/ParallaxSection.d.ts +26 -0
  198. package/dist/components/effects/ParallaxSection/ParallaxSection.js +71 -0
  199. package/dist/components/effects/ParallaxSection/ParallaxSection.types.d.ts +11 -0
  200. package/dist/components/effects/ParallaxSection/index.d.ts +2 -0
  201. package/dist/components/effects/Particles/Particles.d.ts +22 -0
  202. package/dist/components/effects/Particles/Particles.js +33 -0
  203. package/dist/components/effects/Particles/Particles.scene.d.ts +3 -0
  204. package/dist/components/effects/Particles/Particles.scene.js +284 -0
  205. package/dist/components/effects/Particles/Particles.types.d.ts +65 -0
  206. package/dist/components/effects/Particles/index.d.ts +2 -0
  207. package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.d.ts +3 -0
  208. package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.js +75 -0
  209. package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.d.ts +7 -0
  210. package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.theme.js +12 -0
  211. package/dist/components/effects/ProgressiveBlur/ProgressiveBlur.types.d.ts +47 -0
  212. package/dist/components/effects/ProgressiveBlur/index.d.ts +2 -0
  213. package/dist/components/effects/ScrollReveal/ScrollReveal.d.ts +29 -0
  214. package/dist/components/effects/ScrollReveal/ScrollReveal.js +121 -0
  215. package/dist/components/effects/ScrollReveal/ScrollReveal.types.d.ts +25 -0
  216. package/dist/components/effects/ScrollReveal/index.d.ts +2 -0
  217. package/dist/components/effects/Spotlight/Spotlight.d.ts +36 -0
  218. package/dist/components/effects/Spotlight/Spotlight.js +112 -0
  219. package/dist/components/effects/Spotlight/Spotlight.types.d.ts +29 -0
  220. package/dist/components/effects/Spotlight/index.d.ts +2 -0
  221. package/dist/components/effects/StickyScroll/StickyScroll.d.ts +30 -0
  222. package/dist/components/effects/StickyScroll/StickyScroll.js +128 -0
  223. package/dist/components/effects/StickyScroll/StickyScroll.types.d.ts +19 -0
  224. package/dist/components/effects/StickyScroll/index.d.ts +2 -0
  225. package/dist/components/effects/index.d.ts +24 -0
  226. package/dist/components/effects/index.js +12 -0
  227. package/dist/components/forms/Checkbox/Checkbox.js +3 -3
  228. package/dist/components/forms/Checkbox/Checkbox.theme.js +3 -5
  229. package/dist/components/forms/ColorPicker/ColorPicker.theme.js +2 -2
  230. package/dist/components/forms/CronInput/CronInput.d.ts +3 -0
  231. package/dist/components/forms/CronInput/CronInput.js +107 -0
  232. package/dist/components/forms/CronInput/CronInput.theme.d.ts +6 -0
  233. package/dist/components/forms/CronInput/CronInput.theme.js +84 -0
  234. package/dist/components/forms/CronInput/CronInput.types.d.ts +98 -0
  235. package/dist/components/forms/CronInput/CronInput.utils.d.ts +67 -0
  236. package/dist/components/forms/CronInput/CronInput.utils.js +505 -0
  237. package/dist/components/forms/CronInput/index.d.ts +4 -0
  238. package/dist/components/forms/DatePicker/DatePicker.theme.js +2 -2
  239. package/dist/components/forms/FileUpload/FileUpload.js +78 -0
  240. package/dist/components/forms/InputOTP/InputOTP.theme.js +1 -1
  241. package/dist/components/forms/Mention/Mention.d.ts +3 -0
  242. package/dist/components/forms/Mention/Mention.js +410 -0
  243. package/dist/components/forms/Mention/Mention.theme.d.ts +6 -0
  244. package/dist/components/forms/Mention/Mention.theme.js +56 -0
  245. package/dist/components/forms/Mention/Mention.types.d.ts +111 -0
  246. package/dist/components/forms/Mention/index.d.ts +3 -0
  247. package/dist/components/forms/Radio/Radio.js +8 -12
  248. package/dist/components/forms/Radio/Radio.theme.js +28 -5
  249. package/dist/components/forms/SelectableCard/SelectableCard.animations.d.ts +2 -0
  250. package/dist/components/forms/SelectableCard/SelectableCard.animations.js +9 -0
  251. package/dist/components/forms/SelectableCard/SelectableCard.d.ts +5 -0
  252. package/dist/components/forms/SelectableCard/SelectableCard.js +58 -0
  253. package/dist/components/forms/SelectableCard/SelectableCard.theme.d.ts +2 -0
  254. package/dist/components/forms/SelectableCard/SelectableCard.theme.js +38 -0
  255. package/dist/components/forms/SelectableCard/SelectableCard.types.d.ts +34 -0
  256. package/dist/components/forms/SelectableCard/SelectableCardContext.d.ts +3 -0
  257. package/dist/components/forms/SelectableCard/SelectableCardContext.js +12 -0
  258. package/dist/components/forms/SelectableCard/SelectableCardGroup.d.ts +3 -0
  259. package/dist/components/forms/SelectableCard/SelectableCardGroup.js +37 -0
  260. package/dist/components/forms/SelectableCard/index.d.ts +3 -0
  261. package/dist/components/forms/TimePicker/TimePickerContent.js +78 -1
  262. package/dist/components/forms/TransferList/TransferList.animations.d.ts +10 -0
  263. package/dist/components/forms/TransferList/TransferList.animations.js +32 -0
  264. package/dist/components/forms/TransferList/TransferList.d.ts +28 -0
  265. package/dist/components/forms/TransferList/TransferList.js +199 -0
  266. package/dist/components/forms/TransferList/TransferList.theme.d.ts +6 -0
  267. package/dist/components/forms/TransferList/TransferList.theme.js +60 -0
  268. package/dist/components/forms/TransferList/TransferList.types.d.ts +101 -0
  269. package/dist/components/forms/TransferList/index.d.ts +3 -0
  270. package/dist/components/forms/index.d.ts +13 -0
  271. package/dist/components/forms/index.js +87 -0
  272. package/dist/components/layout/FormLayout/FormLayout.d.ts +8 -0
  273. package/dist/components/layout/FormLayout/FormLayout.js +22 -0
  274. package/dist/components/layout/FormLayout/FormLayout.theme.d.ts +2 -0
  275. package/dist/components/layout/FormLayout/FormLayout.theme.js +16 -0
  276. package/dist/components/layout/FormLayout/FormLayout.types.d.ts +61 -0
  277. package/dist/components/layout/FormLayout/FormLayoutBody.d.ts +3 -0
  278. package/dist/components/layout/FormLayout/FormLayoutBody.js +91 -0
  279. package/dist/components/layout/FormLayout/FormLayoutFooter.d.ts +3 -0
  280. package/dist/components/layout/FormLayout/FormLayoutFooter.js +12 -0
  281. package/dist/components/layout/FormLayout/FormLayoutHeader.d.ts +3 -0
  282. package/dist/components/layout/FormLayout/FormLayoutHeader.js +12 -0
  283. package/dist/components/layout/FormLayout/FormLayoutSection.d.ts +3 -0
  284. package/dist/components/layout/FormLayout/FormLayoutSection.js +12 -0
  285. package/dist/components/layout/FormLayout/index.d.ts +3 -0
  286. package/dist/components/layout/PageLayout/PageLayout.d.ts +7 -0
  287. package/dist/components/layout/PageLayout/PageLayout.js +33 -0
  288. package/dist/components/layout/PageLayout/PageLayout.theme.d.ts +2 -0
  289. package/dist/components/layout/PageLayout/PageLayout.theme.js +10 -0
  290. package/dist/components/layout/PageLayout/PageLayout.types.d.ts +39 -0
  291. package/dist/components/layout/PageLayout/PageLayoutContent.d.ts +3 -0
  292. package/dist/components/layout/PageLayout/PageLayoutContent.js +12 -0
  293. package/dist/components/layout/PageLayout/PageLayoutHeader.d.ts +3 -0
  294. package/dist/components/layout/PageLayout/PageLayoutHeader.js +12 -0
  295. package/dist/components/layout/PageLayout/PageLayoutSidebar.d.ts +3 -0
  296. package/dist/components/layout/PageLayout/PageLayoutSidebar.js +12 -0
  297. package/dist/components/layout/PageLayout/index.d.ts +3 -0
  298. package/dist/components/layout/index.d.ts +2 -0
  299. package/dist/index.d.ts +2 -0
  300. package/dist/index.js +208 -167
  301. package/dist/styles.css +1 -1
  302. package/dist/utils/dateUtils.d.ts +30 -0
  303. package/dist/utils/dateUtils.js +58 -1
  304. package/dist/utils/index.d.ts +1 -1
  305. package/package.json +9 -2
  306. package/dist/components/core/Card/CardDescription.d.ts +0 -3
  307. package/dist/components/core/Card/CardDescription.js +0 -11
  308. package/dist/components/core/Modal/ModalDescription.d.ts +0 -5
  309. package/dist/components/core/Modal/ModalDescription.js +0 -11
  310. package/dist/components/core/ProgressiveBlur/ProgressiveBlur.d.ts +0 -34
  311. package/dist/components/core/ProgressiveBlur/ProgressiveBlur.js +0 -218
  312. package/dist/components/core/ProgressiveBlur/ProgressiveBlur.theme.d.ts +0 -9
  313. package/dist/components/core/ProgressiveBlur/ProgressiveBlur.types.d.ts +0 -48
  314. package/dist/components/core/ProgressiveBlur/index.d.ts +0 -2
  315. package/dist/components/core/Table/TablePagination.js +0 -25
  316. /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.d.ts +0 -0
  317. /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.js +0 -0
  318. /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.theme.d.ts +0 -0
  319. /package/dist/components/{core → data-display}/DescriptionList/DescriptionList.types.d.ts +0 -0
  320. /package/dist/components/{core → data-display}/DescriptionList/index.d.ts +0 -0
  321. /package/dist/components/{core → data-display}/Feed/Feed.d.ts +0 -0
  322. /package/dist/components/{core → data-display}/Feed/Feed.theme.d.ts +0 -0
  323. /package/dist/components/{core → data-display}/Feed/Feed.theme.js +0 -0
  324. /package/dist/components/{core → data-display}/Feed/Feed.types.d.ts +0 -0
  325. /package/dist/components/{core → data-display}/Feed/index.d.ts +0 -0
  326. /package/dist/components/{core → data-display}/KPI/KPI.d.ts +0 -0
  327. /package/dist/components/{core → data-display}/KPI/KPI.theme.d.ts +0 -0
  328. /package/dist/components/{core → data-display}/Metric/Metric.d.ts +0 -0
  329. /package/dist/components/{core → data-display}/Metric/Metric.theme.d.ts +0 -0
  330. /package/dist/components/{core → data-display}/Metric/index.d.ts +0 -0
  331. /package/dist/components/{core → data-display}/Table/Table.animations.d.ts +0 -0
  332. /package/dist/components/{core → data-display}/Table/Table.animations.js +0 -0
  333. /package/dist/components/{core → data-display}/Table/Table.d.ts +0 -0
  334. /package/dist/components/{core → data-display}/Table/Table.filterUtils.d.ts +0 -0
  335. /package/dist/components/{core → data-display}/Table/Table.filterUtils.js +0 -0
  336. /package/dist/components/{core → data-display}/Table/Table.js +0 -0
  337. /package/dist/components/{core → data-display}/Table/Table.theme.d.ts +0 -0
  338. /package/dist/components/{core → data-display}/Table/Table.types.d.ts +0 -0
  339. /package/dist/components/{core → data-display}/Table/Table.utils.d.ts +0 -0
  340. /package/dist/components/{core → data-display}/Table/Table.utils.js +0 -0
  341. /package/dist/components/{core → data-display}/Table/TableActions.d.ts +0 -0
  342. /package/dist/components/{core → data-display}/Table/TableActionsMenu.d.ts +0 -0
  343. /package/dist/components/{core → data-display}/Table/TableActionsMenu.js +0 -0
  344. /package/dist/components/{core → data-display}/Table/TableBody.d.ts +0 -0
  345. /package/dist/components/{core → data-display}/Table/TableBody.js +0 -0
  346. /package/dist/components/{core → data-display}/Table/TableCell.d.ts +0 -0
  347. /package/dist/components/{core → data-display}/Table/TableCell.js +0 -0
  348. /package/dist/components/{core → data-display}/Table/TableColumnManager.d.ts +0 -0
  349. /package/dist/components/{core → data-display}/Table/TableDeclarative.d.ts +0 -0
  350. /package/dist/components/{core → data-display}/Table/TableDeclarative.js +0 -0
  351. /package/dist/components/{core → data-display}/Table/TableFilter.d.ts +0 -0
  352. /package/dist/components/{core → data-display}/Table/TableHeader.d.ts +0 -0
  353. /package/dist/components/{core → data-display}/Table/TableHeader.js +0 -0
  354. /package/dist/components/{core → data-display}/Table/TablePagination.d.ts +0 -0
  355. /package/dist/components/{core → data-display}/Table/TableRow.d.ts +0 -0
  356. /package/dist/components/{core → data-display}/Table/TableSelectionHeader.d.ts +0 -0
  357. /package/dist/components/{core → data-display}/Table/hooks/index.d.ts +0 -0
  358. /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.d.ts +0 -0
  359. /package/dist/components/{core → data-display}/Table/hooks/useTableColumns.js +0 -0
  360. /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.d.ts +0 -0
  361. /package/dist/components/{core → data-display}/Table/hooks/useTableExpansion.js +0 -0
  362. /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.d.ts +0 -0
  363. /package/dist/components/{core → data-display}/Table/hooks/useTableFilter.js +0 -0
  364. /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.d.ts +0 -0
  365. /package/dist/components/{core → data-display}/Table/hooks/useTablePagination.js +0 -0
  366. /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.d.ts +0 -0
  367. /package/dist/components/{core → data-display}/Table/hooks/useTableSelection.js +0 -0
  368. /package/dist/components/{core → data-display}/Table/index.d.ts +0 -0
  369. /package/dist/components/{core → data-display}/Table/index.js +0 -0
  370. /package/dist/components/{core → data-display}/Timeline/Timeline.animations.d.ts +0 -0
  371. /package/dist/components/{core → data-display}/Timeline/Timeline.animations.js +0 -0
  372. /package/dist/components/{core → data-display}/Timeline/Timeline.d.ts +0 -0
  373. /package/dist/components/{core → data-display}/Timeline/Timeline.js +0 -0
  374. /package/dist/components/{core → data-display}/Timeline/Timeline.theme.d.ts +0 -0
  375. /package/dist/components/{core → data-display}/Timeline/Timeline.theme.js +0 -0
  376. /package/dist/components/{core → data-display}/Timeline/Timeline.types.d.ts +0 -0
  377. /package/dist/components/{core → data-display}/Timeline/TimelineContent.d.ts +0 -0
  378. /package/dist/components/{core → data-display}/Timeline/TimelineContent.js +0 -0
  379. /package/dist/components/{core → data-display}/Timeline/TimelineItem.d.ts +0 -0
  380. /package/dist/components/{core → data-display}/Timeline/TimelineItem.js +0 -0
  381. /package/dist/components/{core → data-display}/Timeline/TimelineMarker.d.ts +0 -0
  382. /package/dist/components/{core → data-display}/Timeline/TimelineMarker.js +0 -0
  383. /package/dist/components/{core → data-display}/Timeline/index.d.ts +0 -0
@@ -0,0 +1,410 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import React__default, { useMemo, useState, useRef, useCallback, useEffect, useLayoutEffect } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { AnimatePresence, motion } from 'motion/react';
5
+ import { mentionTheme } from './Mention.theme.js';
6
+ import { cn } from '../../../utils/cn.js';
7
+ import { useIsClient } from '../../../hooks/useIsClient.js';
8
+
9
+ // ---------------------------------------------------------------------------
10
+ // Helpers
11
+ // ---------------------------------------------------------------------------
12
+ /**
13
+ * Extract the first two initials from a label string.
14
+ */
15
+ const getInitials = (label) => {
16
+ const parts = label.trim().split(/\s+/);
17
+ if (parts.length === 1)
18
+ return parts[0].charAt(0).toUpperCase();
19
+ return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
20
+ };
21
+ /**
22
+ * Walk backward from the caret and detect if the user is mid-mention.
23
+ * Returns the active mention context or null.
24
+ */
25
+ const detectActiveMention = (text, caretPos, triggerChars) => {
26
+ if (caretPos === 0)
27
+ return null;
28
+ // Scan backward from caret to find a trigger character
29
+ for (let i = caretPos - 1; i >= 0; i--) {
30
+ const ch = text[i];
31
+ // If we hit a whitespace or newline before finding a trigger, stop
32
+ // UNLESS the character is the very first character after a newline/space
33
+ // (which means we're looking at a potential trigger at position 0
34
+ // or right after whitespace).
35
+ if (ch === "\n")
36
+ return null;
37
+ if (triggerChars.includes(ch)) {
38
+ // The trigger must be at the start of the text or preceded by whitespace
39
+ if (i === 0 || /\s/.test(text[i - 1])) {
40
+ const query = text.slice(i + 1, caretPos);
41
+ // Reject if the query contains whitespace (multi-word queries not supported)
42
+ // Actually, allow spaces in the query for multi-word searches
43
+ return {
44
+ trigger: ch,
45
+ query,
46
+ startIndex: i,
47
+ };
48
+ }
49
+ return null;
50
+ }
51
+ }
52
+ return null;
53
+ };
54
+ /**
55
+ * Filter suggestions by a query string (case-insensitive label match).
56
+ */
57
+ const filterSuggestions = (suggestions, query, max) => {
58
+ if (!query)
59
+ return suggestions.slice(0, max);
60
+ const lower = query.toLowerCase();
61
+ return suggestions
62
+ .filter((s) => s.label.toLowerCase().includes(lower) ||
63
+ (s.description && s.description.toLowerCase().includes(lower)))
64
+ .slice(0, max);
65
+ };
66
+ // ---------------------------------------------------------------------------
67
+ // Dropdown animation
68
+ // ---------------------------------------------------------------------------
69
+ const dropdownVariants = {
70
+ initial: { opacity: 0, y: -6, scale: 0.96 },
71
+ visible: {
72
+ opacity: 1,
73
+ y: 0,
74
+ scale: 1,
75
+ transition: { duration: 0.18, ease: "easeOut" },
76
+ },
77
+ exit: {
78
+ opacity: 0,
79
+ y: -6,
80
+ scale: 0.96,
81
+ transition: { duration: 0.12, ease: "easeIn" },
82
+ },
83
+ };
84
+ // ---------------------------------------------------------------------------
85
+ // Mention component
86
+ // ---------------------------------------------------------------------------
87
+ const Mention = React__default.forwardRef(({ triggers: triggersProp, suggestions: suggestionsProp, onSearch: onSearchProp, value: controlledValue, defaultValue = "", onChange, onMentionSelect, placeholder, size = "md", maxSuggestions = 8, className, wrapperClassName, dropdownClassName, theme: themeOverrides, disabled = false, renderSuggestion, emptyMessage = "No results found", loading = false, rows = 3, ...props }, ref) => {
88
+ // Merge theme
89
+ const theme = useMemo(() => ({ ...mentionTheme, ...(themeOverrides || {}) }), [themeOverrides]);
90
+ // Normalize triggers from both APIs
91
+ const triggers = useMemo(() => {
92
+ if (triggersProp && triggersProp.length > 0)
93
+ return triggersProp;
94
+ // Simple API: wrap suggestions + onSearch into a single '@' trigger
95
+ return [
96
+ {
97
+ trigger: "@",
98
+ suggestions: suggestionsProp || [],
99
+ onSearch: onSearchProp,
100
+ },
101
+ ];
102
+ }, [triggersProp, suggestionsProp, onSearchProp]);
103
+ const triggerChars = useMemo(() => triggers.map((t) => t.trigger), [triggers]);
104
+ // Value state (controlled / uncontrolled)
105
+ const [internalValue, setInternalValue] = useState(defaultValue);
106
+ const isControlled = controlledValue !== undefined;
107
+ const textValue = isControlled ? controlledValue : internalValue;
108
+ // Focus state for input group styling
109
+ const [isFocused, setIsFocused] = useState(false);
110
+ // Active mention context
111
+ const [activeMention, setActiveMention] = useState(null);
112
+ const [highlightedIndex, setHighlightedIndex] = useState(-1);
113
+ // Dropdown position
114
+ const [dropdownPos, setDropdownPos] = useState({
115
+ top: -9999,
116
+ left: -9999,
117
+ width: 280,
118
+ });
119
+ // Refs
120
+ const textareaRef = useRef(null);
121
+ const wrapperRef = useRef(null);
122
+ const dropdownRef = useRef(null);
123
+ // SSR guard for portal
124
+ const isClient = useIsClient();
125
+ // Combine forwarded ref with internal ref
126
+ const setTextareaRef = useCallback((el) => {
127
+ textareaRef.current = el;
128
+ if (typeof ref === "function") {
129
+ ref(el);
130
+ }
131
+ else if (ref) {
132
+ ref.current =
133
+ el;
134
+ }
135
+ }, [ref]);
136
+ // Get the current trigger config for the active mention
137
+ const activeTriggerConfig = useMemo(() => {
138
+ if (!activeMention)
139
+ return null;
140
+ return triggers.find((t) => t.trigger === activeMention.trigger) || null;
141
+ }, [activeMention, triggers]);
142
+ // Filtered suggestions for the current query
143
+ const filteredSuggestions = useMemo(() => {
144
+ if (!activeTriggerConfig)
145
+ return [];
146
+ return filterSuggestions(activeTriggerConfig.suggestions, (activeMention === null || activeMention === void 0 ? void 0 : activeMention.query) || "", maxSuggestions);
147
+ }, [activeTriggerConfig, activeMention === null || activeMention === void 0 ? void 0 : activeMention.query, maxSuggestions]);
148
+ const isDropdownOpen = activeMention !== null && (filteredSuggestions.length > 0 || loading);
149
+ // Fire onSearch when query changes
150
+ useEffect(() => {
151
+ if (!activeMention || !(activeTriggerConfig === null || activeTriggerConfig === void 0 ? void 0 : activeTriggerConfig.onSearch))
152
+ return;
153
+ activeTriggerConfig.onSearch(activeMention.query);
154
+ }, [activeMention === null || activeMention === void 0 ? void 0 : activeMention.query, activeMention === null || activeMention === void 0 ? void 0 : activeMention.trigger]); // eslint-disable-line react-hooks/exhaustive-deps
155
+ // Reset highlighted index when suggestions change
156
+ useEffect(() => {
157
+ setHighlightedIndex(filteredSuggestions.length > 0 ? 0 : -1);
158
+ }, [filteredSuggestions.length, activeMention === null || activeMention === void 0 ? void 0 : activeMention.query]);
159
+ // -----------------------------------------------------------------------
160
+ // Dropdown positioning via caret coordinates
161
+ // -----------------------------------------------------------------------
162
+ /**
163
+ * Calculate the pixel coordinates of the caret inside the textarea using
164
+ * a hidden mirror div. This is the standard technique for textarea caret
165
+ * positioning since browsers don't expose it natively.
166
+ */
167
+ const measureCaretPosition = useCallback(() => {
168
+ var _a;
169
+ const textarea = textareaRef.current;
170
+ if (!textarea)
171
+ return null;
172
+ const mirror = document.createElement("div");
173
+ const computed = window.getComputedStyle(textarea);
174
+ // Copy all relevant styles so that text wraps identically
175
+ const stylesToCopy = [
176
+ "fontFamily",
177
+ "fontSize",
178
+ "fontWeight",
179
+ "fontStyle",
180
+ "letterSpacing",
181
+ "textTransform",
182
+ "wordSpacing",
183
+ "textIndent",
184
+ "whiteSpace",
185
+ "wordWrap",
186
+ "overflowWrap",
187
+ "lineHeight",
188
+ "paddingTop",
189
+ "paddingRight",
190
+ "paddingBottom",
191
+ "paddingLeft",
192
+ "borderTopWidth",
193
+ "borderRightWidth",
194
+ "borderBottomWidth",
195
+ "borderLeftWidth",
196
+ "boxSizing",
197
+ ];
198
+ mirror.style.position = "absolute";
199
+ mirror.style.top = "0";
200
+ mirror.style.left = "-9999px";
201
+ mirror.style.visibility = "hidden";
202
+ mirror.style.overflow = "hidden";
203
+ mirror.style.width = `${textarea.offsetWidth}px`;
204
+ for (const prop of stylesToCopy) {
205
+ mirror.style[prop] = computed.getPropertyValue(prop.replace(/([A-Z])/g, "-$1").toLowerCase());
206
+ }
207
+ // Text up to the caret
208
+ const caretPos = (_a = textarea.selectionStart) !== null && _a !== void 0 ? _a : 0;
209
+ const textBefore = textarea.value.substring(0, caretPos);
210
+ // Replace spaces with non-breaking spaces so whitespace is preserved
211
+ mirror.textContent = textBefore.replace(/ /g, "\u00a0");
212
+ // Place a span at the caret position to measure its coordinates
213
+ const caretSpan = document.createElement("span");
214
+ caretSpan.textContent = "\u200b"; // zero-width space
215
+ mirror.appendChild(caretSpan);
216
+ document.body.appendChild(mirror);
217
+ const spanRect = caretSpan.getBoundingClientRect();
218
+ const textareaRect = textarea.getBoundingClientRect();
219
+ // The span position is in the mirror; we need to offset by the textarea's
220
+ // actual position and account for scrollTop.
221
+ const relativeTop = spanRect.top - mirror.getBoundingClientRect().top - textarea.scrollTop;
222
+ const relativeLeft = spanRect.left - mirror.getBoundingClientRect().left;
223
+ document.body.removeChild(mirror);
224
+ return {
225
+ top: textareaRect.top + relativeTop,
226
+ left: textareaRect.left + relativeLeft,
227
+ };
228
+ }, []);
229
+ const updateDropdownPosition = useCallback(() => {
230
+ const pos = measureCaretPosition();
231
+ if (!pos)
232
+ return;
233
+ const lineHeight = parseFloat(window.getComputedStyle(textareaRef.current).lineHeight || "20");
234
+ setDropdownPos({
235
+ top: pos.top + lineHeight + 4,
236
+ left: pos.left,
237
+ width: 280,
238
+ });
239
+ }, [measureCaretPosition]);
240
+ // Reposition dropdown whenever the active mention changes
241
+ useLayoutEffect(() => {
242
+ if (activeMention) {
243
+ updateDropdownPosition();
244
+ }
245
+ }, [activeMention, updateDropdownPosition]);
246
+ // Reposition on scroll / resize
247
+ useEffect(() => {
248
+ if (!isDropdownOpen)
249
+ return;
250
+ const handleReposition = () => updateDropdownPosition();
251
+ window.addEventListener("scroll", handleReposition, {
252
+ passive: true,
253
+ capture: true,
254
+ });
255
+ window.addEventListener("resize", handleReposition, { passive: true });
256
+ return () => {
257
+ window.removeEventListener("scroll", handleReposition, true);
258
+ window.removeEventListener("resize", handleReposition);
259
+ };
260
+ }, [isDropdownOpen, updateDropdownPosition]);
261
+ // -----------------------------------------------------------------------
262
+ // Click outside to close dropdown
263
+ // -----------------------------------------------------------------------
264
+ useEffect(() => {
265
+ if (!isDropdownOpen)
266
+ return;
267
+ const handleClickOutside = (e) => {
268
+ if (dropdownRef.current &&
269
+ !dropdownRef.current.contains(e.target) &&
270
+ textareaRef.current &&
271
+ !textareaRef.current.contains(e.target)) {
272
+ setActiveMention(null);
273
+ }
274
+ };
275
+ document.addEventListener("mousedown", handleClickOutside);
276
+ return () => document.removeEventListener("mousedown", handleClickOutside);
277
+ }, [isDropdownOpen]);
278
+ // -----------------------------------------------------------------------
279
+ // Handlers
280
+ // -----------------------------------------------------------------------
281
+ const setValue = useCallback((newValue) => {
282
+ if (!isControlled) {
283
+ setInternalValue(newValue);
284
+ }
285
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
286
+ }, [isControlled, onChange]);
287
+ const handleChange = useCallback((e) => {
288
+ var _a;
289
+ const newValue = e.target.value;
290
+ setValue(newValue);
291
+ // Detect active mention from the caret position
292
+ const caretPos = (_a = e.target.selectionStart) !== null && _a !== void 0 ? _a : newValue.length;
293
+ const mention = detectActiveMention(newValue, caretPos, triggerChars);
294
+ setActiveMention(mention);
295
+ }, [setValue, triggerChars]);
296
+ const handleSelect = useCallback((e) => {
297
+ var _a;
298
+ // When the caret moves (click, arrow keys), recheck for active mention
299
+ const textarea = e.currentTarget;
300
+ const caretPos = (_a = textarea.selectionStart) !== null && _a !== void 0 ? _a : 0;
301
+ const mention = detectActiveMention(textarea.value, caretPos, triggerChars);
302
+ setActiveMention(mention);
303
+ }, [triggerChars]);
304
+ const insertMention = useCallback((suggestion) => {
305
+ if (!activeMention || !textareaRef.current)
306
+ return;
307
+ const { trigger, startIndex, query } = activeMention;
308
+ const before = textValue.slice(0, startIndex);
309
+ const after = textValue.slice(startIndex + 1 + query.length); // +1 for trigger char
310
+ const insertText = `${trigger}${suggestion.label} `;
311
+ const newValue = before + insertText + after;
312
+ setValue(newValue);
313
+ setActiveMention(null);
314
+ setHighlightedIndex(-1);
315
+ onMentionSelect === null || onMentionSelect === void 0 ? void 0 : onMentionSelect(suggestion, trigger);
316
+ // Move the caret to after the inserted mention
317
+ const newCaretPos = before.length + insertText.length;
318
+ requestAnimationFrame(() => {
319
+ if (textareaRef.current) {
320
+ textareaRef.current.focus();
321
+ textareaRef.current.selectionStart = newCaretPos;
322
+ textareaRef.current.selectionEnd = newCaretPos;
323
+ }
324
+ });
325
+ }, [activeMention, textValue, setValue, onMentionSelect]);
326
+ const handleKeyDown = useCallback((e) => {
327
+ if (!isDropdownOpen)
328
+ return;
329
+ switch (e.key) {
330
+ case "ArrowDown":
331
+ e.preventDefault();
332
+ setHighlightedIndex((prev) => prev >= filteredSuggestions.length - 1 ? 0 : prev + 1);
333
+ break;
334
+ case "ArrowUp":
335
+ e.preventDefault();
336
+ setHighlightedIndex((prev) => prev <= 0 ? filteredSuggestions.length - 1 : prev - 1);
337
+ break;
338
+ case "Enter":
339
+ if (highlightedIndex >= 0 && highlightedIndex < filteredSuggestions.length) {
340
+ e.preventDefault();
341
+ insertMention(filteredSuggestions[highlightedIndex]);
342
+ }
343
+ break;
344
+ case "Escape":
345
+ e.preventDefault();
346
+ setActiveMention(null);
347
+ break;
348
+ case "Tab":
349
+ // Close dropdown on tab without preventing default
350
+ setActiveMention(null);
351
+ break;
352
+ }
353
+ }, [isDropdownOpen, highlightedIndex, filteredSuggestions, insertMention]);
354
+ const handleFocus = useCallback((e) => {
355
+ var _a;
356
+ setIsFocused(true);
357
+ (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
358
+ }, [props.onFocus]);
359
+ const handleBlur = useCallback((e) => {
360
+ var _a;
361
+ setIsFocused(false);
362
+ (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
363
+ }, [props.onBlur]);
364
+ // Scroll highlighted suggestion into view
365
+ useEffect(() => {
366
+ if (highlightedIndex >= 0 && dropdownRef.current) {
367
+ const item = dropdownRef.current.querySelector(`[data-suggestion-index="${highlightedIndex}"]`);
368
+ if (item) {
369
+ item.scrollIntoView({ block: "nearest" });
370
+ }
371
+ }
372
+ }, [highlightedIndex]);
373
+ // -----------------------------------------------------------------------
374
+ // Render suggestion item
375
+ // -----------------------------------------------------------------------
376
+ const renderSuggestionItem = (suggestion, index) => {
377
+ const isHighlighted = index === highlightedIndex;
378
+ const triggerChar = (activeMention === null || activeMention === void 0 ? void 0 : activeMention.trigger) || "@";
379
+ // Custom renderer
380
+ if (renderSuggestion) {
381
+ return (jsx("div", { role: "option", "aria-selected": isHighlighted, "data-suggestion-index": index, className: cn(theme.suggestionStyle, isHighlighted && theme.suggestionHighlightedStyle), onMouseEnter: () => setHighlightedIndex(index), onMouseDown: (e) => {
382
+ e.preventDefault(); // Prevent textarea blur
383
+ insertMention(suggestion);
384
+ }, children: renderSuggestion(suggestion, isHighlighted, triggerChar) }, suggestion.id));
385
+ }
386
+ return (jsxs("div", { role: "option", "aria-selected": isHighlighted, "data-suggestion-index": index, className: cn(theme.suggestionStyle, isHighlighted && theme.suggestionHighlightedStyle), onMouseEnter: () => setHighlightedIndex(index), onMouseDown: (e) => {
387
+ e.preventDefault(); // Prevent textarea blur
388
+ insertMention(suggestion);
389
+ }, children: [suggestion.avatar ? (jsx("img", { src: suggestion.avatar, alt: suggestion.label, className: theme.suggestionAvatarStyle })) : (jsx("div", { className: theme.suggestionAvatarFallbackStyle, children: getInitials(suggestion.label) })), jsxs("div", { className: "flex flex-col min-w-0", children: [jsx("span", { className: theme.suggestionLabelStyle, children: suggestion.label }), suggestion.description && (jsx("span", { className: theme.suggestionDescriptionStyle, children: suggestion.description }))] })] }, suggestion.id));
390
+ };
391
+ // -----------------------------------------------------------------------
392
+ // Dropdown portal content
393
+ // -----------------------------------------------------------------------
394
+ const dropdownContent = (jsx(AnimatePresence, { mode: "wait", children: isDropdownOpen && (jsx(motion.div, { ref: dropdownRef, role: "listbox", "aria-label": "Suggestions", className: cn(theme.dropdownStyle, dropdownClassName), style: {
395
+ position: "fixed",
396
+ top: `${dropdownPos.top}px`,
397
+ left: `${dropdownPos.left}px`,
398
+ minWidth: `${dropdownPos.width}px`,
399
+ maxWidth: "360px",
400
+ zIndex: 1000,
401
+ overscrollBehavior: "contain",
402
+ }, variants: dropdownVariants, initial: "initial", animate: "visible", exit: "exit", children: loading ? (jsx("div", { className: theme.loadingStyle, children: "Searching..." })) : filteredSuggestions.length === 0 ? (jsx("div", { className: theme.emptyMessageStyle, children: emptyMessage })) : (filteredSuggestions.map((suggestion, index) => renderSuggestionItem(suggestion, index))) })) }));
403
+ // -----------------------------------------------------------------------
404
+ // Render
405
+ // -----------------------------------------------------------------------
406
+ return (jsxs("div", { className: cn(theme.wrapperStyle, wrapperClassName), children: [jsx("div", { ref: wrapperRef, className: cn(theme.inputGroupStyle, isFocused && theme.inputGroupFocusStyle), children: jsx("textarea", { ref: setTextareaRef, value: textValue, onChange: handleChange, onSelect: handleSelect, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, placeholder: placeholder, disabled: disabled, rows: rows, role: "textbox", "aria-multiline": "true", "aria-autocomplete": "list", "aria-expanded": isDropdownOpen, "aria-haspopup": "listbox", className: cn(theme.textareaStyle, theme.sizes[size], className), ...props }) }), isClient && createPortal(dropdownContent, document.body)] }));
407
+ });
408
+ Mention.displayName = "Mention";
409
+
410
+ export { Mention };
@@ -0,0 +1,6 @@
1
+ import type { MentionTheme } from "./Mention.types";
2
+ /**
3
+ * Default theme for the Mention component.
4
+ * Uses the shared forms base theme for consistency with Input/Textarea.
5
+ */
6
+ export declare const mentionTheme: MentionTheme;
@@ -0,0 +1,56 @@
1
+ import { formsBaseTheme } from '../forms.theme.js';
2
+
3
+ /**
4
+ * Default theme for the Mention component.
5
+ * Uses the shared forms base theme for consistency with Input/Textarea.
6
+ */
7
+ const mentionTheme = {
8
+ // Outermost wrapper
9
+ wrapperStyle: formsBaseTheme.wrapperStyle,
10
+ // Input group container with outline and focus ring
11
+ inputGroupStyle: formsBaseTheme.inputGroupBaseStyle,
12
+ // JS-driven focus ring (applied when textarea is focused)
13
+ inputGroupFocusStyle: "outline-2 outline-[var(--color-primary-600)] -outline-offset-1 " +
14
+ "ring-4 ring-[var(--color-primary)]/10 " +
15
+ "dark:outline-[var(--color-primary-500)] dark:ring-[var(--color-primary-500)]/20",
16
+ // Base textarea styles
17
+ textareaStyle: `${formsBaseTheme.controlBaseStyle} resize-y`,
18
+ // Size variants
19
+ sizes: {
20
+ sm: `${formsBaseTheme.sizes.sm.text} ${formsBaseTheme.sizes.sm.padding} ${formsBaseTheme.sizes.sm.textareaHeight}`,
21
+ md: `${formsBaseTheme.sizes.md.text} ${formsBaseTheme.sizes.md.padding} ${formsBaseTheme.sizes.md.textareaHeight}`,
22
+ lg: `${formsBaseTheme.sizes.lg.text} ${formsBaseTheme.sizes.lg.padding} ${formsBaseTheme.sizes.lg.textareaHeight}`,
23
+ },
24
+ // Dropdown container - reuses the shared dropdown styles
25
+ dropdownStyle: formsBaseTheme.dropdownStyles.container + " py-1",
26
+ // Individual suggestion item
27
+ suggestionStyle: "relative flex items-center gap-2.5 cursor-pointer select-none py-2 px-3 " +
28
+ "text-[var(--color-text-primary)] " +
29
+ "hover:text-[var(--color-primary)] hover:bg-[var(--color-primary-50)]/50 " +
30
+ "dark:hover:text-[var(--color-primary-400)] dark:hover:bg-[var(--color-primary-400)]/10",
31
+ // Highlighted suggestion (keyboard navigation)
32
+ suggestionHighlightedStyle: "text-[var(--color-primary)] bg-[var(--color-primary-50)]/50 " +
33
+ "dark:text-[var(--color-primary-400)] dark:bg-[var(--color-primary-400)]/10",
34
+ // Avatar image
35
+ suggestionAvatarStyle: "size-7 rounded-full object-cover shrink-0 " +
36
+ "bg-[var(--color-background-tertiary)] dark:bg-[var(--color-neutral-700)]",
37
+ // Avatar fallback (initials circle)
38
+ suggestionAvatarFallbackStyle: "size-7 rounded-full shrink-0 flex items-center justify-center text-xs font-medium " +
39
+ "bg-[var(--color-primary-100)] text-[var(--color-primary-700)] " +
40
+ "dark:bg-[var(--color-primary-900)] dark:text-[var(--color-primary-300)]",
41
+ // Suggestion label text
42
+ suggestionLabelStyle: "text-sm font-medium truncate",
43
+ // Suggestion description text
44
+ suggestionDescriptionStyle: "text-xs text-[var(--color-text-muted)] truncate " +
45
+ "dark:text-[var(--color-neutral-500)]",
46
+ // Empty state
47
+ emptyMessageStyle: formsBaseTheme.dropdownStyles.emptyMessage,
48
+ // Loading state
49
+ loadingStyle: "py-3 px-3 text-center text-[var(--color-text-muted)] " +
50
+ "dark:text-[var(--color-neutral-500)]",
51
+ // Highlighted mention text in the overlay
52
+ mentionHighlightStyle: "text-[var(--color-primary)] font-medium " +
53
+ "dark:text-[var(--color-primary-400)]",
54
+ };
55
+
56
+ export { mentionTheme };
@@ -0,0 +1,111 @@
1
+ import React from "react";
2
+ /**
3
+ * A single suggestion item displayed in the mention dropdown.
4
+ */
5
+ export interface MentionSuggestion {
6
+ /** Unique identifier for the suggestion */
7
+ id: string;
8
+ /** Display label (e.g. user name, tag name) */
9
+ label: string;
10
+ /** Optional avatar URL */
11
+ avatar?: string;
12
+ /** Optional description line (e.g. job title, email) */
13
+ description?: string;
14
+ /** Allow arbitrary metadata */
15
+ [key: string]: unknown;
16
+ }
17
+ /**
18
+ * Configuration for a single trigger character and its suggestions.
19
+ */
20
+ export interface MentionTrigger {
21
+ /** The trigger character (e.g. '@', '#') */
22
+ trigger: string;
23
+ /** Available suggestions for this trigger */
24
+ suggestions: MentionSuggestion[];
25
+ /** Async search callback invoked when the user types after the trigger */
26
+ onSearch?: (query: string) => void | Promise<void>;
27
+ }
28
+ /**
29
+ * Size variants for the Mention component.
30
+ */
31
+ export type MentionSize = "sm" | "md" | "lg";
32
+ /**
33
+ * Theme configuration for the Mention component.
34
+ */
35
+ export interface MentionTheme {
36
+ /** Outermost wrapper style */
37
+ wrapperStyle: string;
38
+ /** Input group container style (border, focus ring) */
39
+ inputGroupStyle: string;
40
+ /** JS-driven focus ring style */
41
+ inputGroupFocusStyle: string;
42
+ /** Base textarea style */
43
+ textareaStyle: string;
44
+ /** Size variants for the textarea */
45
+ sizes: Record<MentionSize, string>;
46
+ /** Dropdown container style */
47
+ dropdownStyle: string;
48
+ /** Individual suggestion item style */
49
+ suggestionStyle: string;
50
+ /** Highlighted (keyboard-focused) suggestion style */
51
+ suggestionHighlightedStyle: string;
52
+ /** Avatar style inside a suggestion */
53
+ suggestionAvatarStyle: string;
54
+ /** Avatar fallback (initials) style */
55
+ suggestionAvatarFallbackStyle: string;
56
+ /** Suggestion label text style */
57
+ suggestionLabelStyle: string;
58
+ /** Suggestion description text style */
59
+ suggestionDescriptionStyle: string;
60
+ /** Empty state message style */
61
+ emptyMessageStyle: string;
62
+ /** Loading state style */
63
+ loadingStyle: string;
64
+ /** Highlighted mention text overlay style */
65
+ mentionHighlightStyle: string;
66
+ }
67
+ /**
68
+ * Partial theme overrides for the Mention component.
69
+ */
70
+ export type MentionThemeOverrides = Partial<MentionTheme>;
71
+ /**
72
+ * Props for the Mention component.
73
+ */
74
+ export interface MentionProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "value" | "defaultValue"> {
75
+ /** Multiple trigger configurations (e.g. '@' for users, '#' for tags) */
76
+ triggers?: MentionTrigger[];
77
+ /** Simple API: suggestions for the default '@' trigger */
78
+ suggestions?: MentionSuggestion[];
79
+ /** Simple API: async search callback for the default '@' trigger */
80
+ onSearch?: (query: string) => void;
81
+ /** Controlled value */
82
+ value?: string;
83
+ /** Uncontrolled default value */
84
+ defaultValue?: string;
85
+ /** Change callback with the full text value */
86
+ onChange?: (value: string) => void;
87
+ /** Callback when a suggestion is selected */
88
+ onMentionSelect?: (suggestion: MentionSuggestion, trigger: string) => void;
89
+ /** Placeholder text */
90
+ placeholder?: string;
91
+ /** Size variant */
92
+ size?: MentionSize;
93
+ /** Maximum number of suggestions shown */
94
+ maxSuggestions?: number;
95
+ /** Additional className for the textarea */
96
+ className?: string;
97
+ /** Additional className for the wrapper */
98
+ wrapperClassName?: string;
99
+ /** Additional className for the dropdown */
100
+ dropdownClassName?: string;
101
+ /** Theme overrides */
102
+ theme?: MentionThemeOverrides;
103
+ /** Whether the mention input is disabled */
104
+ disabled?: boolean;
105
+ /** Custom renderer for suggestion items */
106
+ renderSuggestion?: (suggestion: MentionSuggestion, isHighlighted: boolean, trigger: string) => React.ReactNode;
107
+ /** Message shown when no suggestions match */
108
+ emptyMessage?: string;
109
+ /** Whether a search is currently loading */
110
+ loading?: boolean;
111
+ }
@@ -0,0 +1,3 @@
1
+ export { Mention } from "./Mention";
2
+ export type { MentionProps, MentionSuggestion, MentionTrigger, MentionSize, MentionTheme, MentionThemeOverrides, } from "./Mention.types";
3
+ export { mentionTheme } from "./Mention.theme";
@@ -1,28 +1,24 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import React__default, { useState } from 'react';
2
+ import React__default from 'react';
3
3
  import { radioTheme } from './Radio.theme.js';
4
- import { FormLabel } from '../FormLabel/FormLabel.js';
4
+ import { formLabelTheme } from '../FormLabel/FormLabel.theme.js';
5
5
  import { cn } from '../../../utils/cn.js';
6
6
 
7
7
  /**
8
8
  * Radio component for selecting one option from a group
9
9
  */
10
- const Radio = React__default.forwardRef(({ id, name, value, checked: controlledChecked, onChange, label, description, state = "default", size = "md", className, ...restProps }, ref) => {
11
- const [internalChecked, setInternalChecked] = useState(false);
12
- // Determine if component is controlled or uncontrolled
13
- const isControlled = controlledChecked !== undefined;
14
- const isChecked = isControlled ? controlledChecked : internalChecked;
15
- // Derive state flags
10
+ const Radio = React__default.forwardRef(({ id, name, value, checked, defaultChecked, onChange, label, description, state = "default", size = "md", className, ...restProps }, ref) => {
11
+ const isControlled = checked !== undefined;
16
12
  const isDisabled = state === "disabled";
17
13
  const handleChange = (e) => {
18
14
  if (isDisabled)
19
15
  return;
20
- if (!isControlled) {
21
- setInternalChecked(e.target.checked);
22
- }
23
16
  onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked, value);
24
17
  };
25
- return (jsxs("div", { className: cn(radioTheme.baseStyle, className), ...restProps, children: [jsxs("div", { className: cn(radioTheme.inputContainerStyle, radioTheme.sizes[size]), children: [jsx("input", { ref: ref, type: "radio", id: id, name: name, value: value, checked: isChecked, onChange: handleChange, disabled: isDisabled, "aria-describedby": description ? `${id}-description` : undefined, "data-state": isDisabled ? "disabled" : "default", className: cn(radioTheme.inputStyle, radioTheme.sizes[size]) }), isChecked && (jsx("div", { className: cn(radioTheme.dotStyle, size === "sm" ? "size-2" : "size-3", "opacity-100") }))] }), (label || description) && (jsxs("div", { className: "cursor-pointer", children: [label && (jsx(FormLabel, { htmlFor: id, className: "!mb-0", state: state, children: label })), description && (jsx("div", { id: `${id}-description`, className: radioTheme.descriptionStyle, children: description }))] }))] }));
18
+ const inputProps = isControlled
19
+ ? { checked }
20
+ : { defaultChecked };
21
+ return (jsxs("div", { className: cn(radioTheme.baseStyle, className), ...restProps, children: [jsxs("div", { className: cn(radioTheme.inputContainerStyle, radioTheme.sizes[size]), children: [jsx("input", { ref: ref, type: "radio", id: id, name: name, value: value, ...inputProps, onChange: handleChange, disabled: isDisabled, "aria-describedby": description ? `${id}-description` : undefined, "data-state": isDisabled ? "disabled" : "default", className: cn("peer", radioTheme.inputStyle, radioTheme.sizes[size]) }), jsx("div", { className: cn(radioTheme.dotStyle, size === "sm" ? "size-2.5 top-0.25" : "size-3") })] }), (label || description) && (jsxs("label", { htmlFor: id, className: cn("cursor-pointer", isDisabled && "cursor-not-allowed"), children: [label && (jsx("span", { className: cn(formLabelTheme.baseStyle, formLabelTheme.stateStyles[state], "mb-0"), children: label })), description && (jsx("div", { id: `${id}-description`, className: radioTheme.descriptionStyle, children: description }))] }))] }));
26
22
  });
27
23
  Radio.displayName = "Radio";
28
24