@altimateai/ui-components 0.0.79 → 0.0.80

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 (521) hide show
  1. package/dist/0~315.js +46635 -0
  2. package/dist/0~315.js.LICENSE.txt +73 -0
  3. package/dist/0~315.js.map +1 -0
  4. package/dist/131.js +14352 -0
  5. package/dist/131.js.map +1 -0
  6. package/dist/3~315.js +46635 -0
  7. package/dist/3~315.js.LICENSE.txt +73 -0
  8. package/dist/3~315.js.map +1 -0
  9. package/dist/582.js +1299 -0
  10. package/dist/582.js.map +1 -0
  11. package/dist/assets/icons/index.d.ts +45 -110
  12. package/dist/assets/icons/index.d.ts.map +1 -0
  13. package/dist/chatbotV2.js +5233 -0
  14. package/dist/chatbotV2.js.map +1 -0
  15. package/dist/components/api/index.d.ts +7 -0
  16. package/dist/components/api/index.d.ts.map +1 -0
  17. package/dist/components/api/useMutation.d.ts +12 -0
  18. package/dist/components/api/useMutation.d.ts.map +1 -0
  19. package/dist/components/api/useQuery.d.ts +12 -0
  20. package/dist/components/api/useQuery.d.ts.map +1 -0
  21. package/dist/components/chatbotV2/ChatProvider.d.ts +17 -0
  22. package/dist/components/chatbotV2/ChatProvider.d.ts.map +1 -0
  23. package/dist/components/chatbotV2/Chatbot.d.ts +4 -0
  24. package/dist/components/chatbotV2/Chatbot.d.ts.map +1 -0
  25. package/dist/components/chatbotV2/HelloMessageSample.d.ts +3 -0
  26. package/dist/components/chatbotV2/HelloMessageSample.d.ts.map +1 -0
  27. package/dist/components/chatbotV2/components/action-buttons/DownloadMessage.d.ts +9 -0
  28. package/dist/components/chatbotV2/components/action-buttons/DownloadMessage.d.ts.map +1 -0
  29. package/dist/components/chatbotV2/components/action-buttons/ShareMessage.d.ts +9 -0
  30. package/dist/components/chatbotV2/components/action-buttons/ShareMessage.d.ts.map +1 -0
  31. package/dist/components/chatbotV2/components/artifacts/Artifacts.d.ts +8 -0
  32. package/dist/components/chatbotV2/components/artifacts/Artifacts.d.ts.map +1 -0
  33. package/dist/components/chatbotV2/components/artifacts/index.d.ts +2 -0
  34. package/dist/components/chatbotV2/components/artifacts/index.d.ts.map +1 -0
  35. package/dist/components/chatbotV2/components/attachmentList/AttachmentList.d.ts +8 -0
  36. package/dist/components/chatbotV2/components/attachmentList/AttachmentList.d.ts.map +1 -0
  37. package/dist/components/chatbotV2/components/attachmentList/index.d.ts +2 -0
  38. package/dist/components/chatbotV2/components/attachmentList/index.d.ts.map +1 -0
  39. package/dist/components/chatbotV2/components/cancelGenerationButton/CancelGenerationButton.d.ts +3 -0
  40. package/dist/components/chatbotV2/components/cancelGenerationButton/CancelGenerationButton.d.ts.map +1 -0
  41. package/dist/components/chatbotV2/components/cancelGenerationButton/index.d.ts +2 -0
  42. package/dist/components/chatbotV2/components/cancelGenerationButton/index.d.ts.map +1 -0
  43. package/dist/components/chatbotV2/components/chatMessageActions/ChatFeedbackActions.d.ts +8 -0
  44. package/dist/components/chatbotV2/components/chatMessageActions/ChatFeedbackActions.d.ts.map +1 -0
  45. package/dist/components/chatbotV2/components/chatMessageActions/ChatLastMessageActions.d.ts +8 -0
  46. package/dist/components/chatbotV2/components/chatMessageActions/ChatLastMessageActions.d.ts.map +1 -0
  47. package/dist/components/chatbotV2/components/chatMessageActions/ChatMessageActions.d.ts +10 -0
  48. package/dist/components/chatbotV2/components/chatMessageActions/ChatMessageActions.d.ts.map +1 -0
  49. package/dist/components/chatbotV2/components/chatMessageActions/ChatMessageEndActions.d.ts +9 -0
  50. package/dist/components/chatbotV2/components/chatMessageActions/ChatMessageEndActions.d.ts.map +1 -0
  51. package/dist/components/chatbotV2/components/chatMessageActions/index.d.ts +4 -0
  52. package/dist/components/chatbotV2/components/chatMessageActions/index.d.ts.map +1 -0
  53. package/dist/components/chatbotV2/components/chatTriggerLink/ChatTriggerLink.d.ts +7 -0
  54. package/dist/components/chatbotV2/components/chatTriggerLink/ChatTriggerLink.d.ts.map +1 -0
  55. package/dist/components/chatbotV2/components/citations/Citations.d.ts +28 -0
  56. package/dist/components/chatbotV2/components/citations/Citations.d.ts.map +1 -0
  57. package/dist/components/chatbotV2/components/coachAI/CoachAI.d.ts +2 -0
  58. package/dist/components/chatbotV2/components/coachAI/CoachAI.d.ts.map +1 -0
  59. package/dist/components/chatbotV2/components/coachAI/index.d.ts +2 -0
  60. package/dist/components/chatbotV2/components/coachAI/index.d.ts.map +1 -0
  61. package/dist/components/chatbotV2/components/contextPanel/ContextPanel.d.ts +13 -0
  62. package/dist/components/chatbotV2/components/contextPanel/ContextPanel.d.ts.map +1 -0
  63. package/dist/components/chatbotV2/components/contextPanel/index.d.ts +2 -0
  64. package/dist/components/chatbotV2/components/contextPanel/index.d.ts.map +1 -0
  65. package/dist/components/chatbotV2/components/emailDialog/EmailDialog.d.ts +10 -0
  66. package/dist/components/chatbotV2/components/emailDialog/EmailDialog.d.ts.map +1 -0
  67. package/dist/components/chatbotV2/components/entityItem/EntityItem.d.ts +7 -0
  68. package/dist/components/chatbotV2/components/entityItem/EntityItem.d.ts.map +1 -0
  69. package/dist/components/chatbotV2/components/entityItem/index.d.ts +2 -0
  70. package/dist/components/chatbotV2/components/entityItem/index.d.ts.map +1 -0
  71. package/dist/components/chatbotV2/components/followup/Followup.d.ts +3 -0
  72. package/dist/components/chatbotV2/components/followup/Followup.d.ts.map +1 -0
  73. package/dist/components/chatbotV2/components/index.d.ts +18 -0
  74. package/dist/components/chatbotV2/components/index.d.ts.map +1 -0
  75. package/dist/components/chatbotV2/components/interactionPrompt/InteractionPrompt.d.ts +8 -0
  76. package/dist/components/chatbotV2/components/interactionPrompt/InteractionPrompt.d.ts.map +1 -0
  77. package/dist/components/chatbotV2/components/interactionPrompt/index.d.ts +2 -0
  78. package/dist/components/chatbotV2/components/interactionPrompt/index.d.ts.map +1 -0
  79. package/dist/components/chatbotV2/components/loadingIndicator/LoadingIndicator.d.ts +3 -0
  80. package/dist/components/chatbotV2/components/loadingIndicator/LoadingIndicator.d.ts.map +1 -0
  81. package/dist/components/chatbotV2/components/loadingIndicator/index.d.ts +2 -0
  82. package/dist/components/chatbotV2/components/loadingIndicator/index.d.ts.map +1 -0
  83. package/dist/components/chatbotV2/components/messageItem/MessageItem.d.ts +12 -0
  84. package/dist/components/chatbotV2/components/messageItem/MessageItem.d.ts.map +1 -0
  85. package/dist/components/chatbotV2/components/messageItem/index.d.ts +2 -0
  86. package/dist/components/chatbotV2/components/messageItem/index.d.ts.map +1 -0
  87. package/dist/components/chatbotV2/components/messageList/MessageList.d.ts +11 -0
  88. package/dist/components/chatbotV2/components/messageList/MessageList.d.ts.map +1 -0
  89. package/dist/components/chatbotV2/components/messageList/index.d.ts +2 -0
  90. package/dist/components/chatbotV2/components/messageList/index.d.ts.map +1 -0
  91. package/dist/components/chatbotV2/components/questionForm/QuestionForm.d.ts +15 -0
  92. package/dist/components/chatbotV2/components/questionForm/QuestionForm.d.ts.map +1 -0
  93. package/dist/components/chatbotV2/components/questionForm/index.d.ts +2 -0
  94. package/dist/components/chatbotV2/components/questionForm/index.d.ts.map +1 -0
  95. package/dist/components/chatbotV2/components/refetchSession/RefetchSession.d.ts +8 -0
  96. package/dist/components/chatbotV2/components/refetchSession/RefetchSession.d.ts.map +1 -0
  97. package/dist/components/chatbotV2/components/regenerateButton/RegenerateButton.d.ts +7 -0
  98. package/dist/components/chatbotV2/components/regenerateButton/RegenerateButton.d.ts.map +1 -0
  99. package/dist/components/chatbotV2/components/regenerateButton/index.d.ts +2 -0
  100. package/dist/components/chatbotV2/components/regenerateButton/index.d.ts.map +1 -0
  101. package/dist/components/chatbotV2/components/selectedContexts/SelectedContexts.d.ts +8 -0
  102. package/dist/components/chatbotV2/components/selectedContexts/SelectedContexts.d.ts.map +1 -0
  103. package/dist/components/chatbotV2/components/statusUpdates/StatusUpdates.d.ts +10 -0
  104. package/dist/components/chatbotV2/components/statusUpdates/StatusUpdates.d.ts.map +1 -0
  105. package/dist/components/chatbotV2/components/statusUpdates/index.d.ts +2 -0
  106. package/dist/components/chatbotV2/components/statusUpdates/index.d.ts.map +1 -0
  107. package/dist/components/chatbotV2/components/todoProgress/TodoProgress.d.ts +8 -0
  108. package/dist/components/chatbotV2/components/todoProgress/TodoProgress.d.ts.map +1 -0
  109. package/dist/components/chatbotV2/components/todoProgress/index.d.ts +2 -0
  110. package/dist/components/chatbotV2/components/todoProgress/index.d.ts.map +1 -0
  111. package/dist/components/chatbotV2/hooks/transports.d.ts +126 -0
  112. package/dist/components/chatbotV2/hooks/transports.d.ts.map +1 -0
  113. package/dist/components/chatbotV2/hooks/useAgentChat.d.ts +41 -0
  114. package/dist/components/chatbotV2/hooks/useAgentChat.d.ts.map +1 -0
  115. package/dist/components/chatbotV2/hooks/useEntityDetection.d.ts +4 -0
  116. package/dist/components/chatbotV2/hooks/useEntityDetection.d.ts.map +1 -0
  117. package/dist/components/chatbotV2/hooks/useFeedback.d.ts +5 -0
  118. package/dist/components/chatbotV2/hooks/useFeedback.d.ts.map +1 -0
  119. package/dist/components/chatbotV2/index.d.ts +22 -0
  120. package/dist/components/chatbotV2/index.d.ts.map +1 -0
  121. package/dist/components/chatbotV2/store/chatSlice.d.ts +65 -0
  122. package/dist/components/chatbotV2/store/chatSlice.d.ts.map +1 -0
  123. package/dist/components/chatbotV2/store/index.d.ts +10 -0
  124. package/dist/components/chatbotV2/store/index.d.ts.map +1 -0
  125. package/dist/{types-ByRPUpXR.d.ts → components/chatbotV2/types.d.ts} +77 -195
  126. package/dist/components/chatbotV2/types.d.ts.map +1 -0
  127. package/dist/components/chatbotV2/utils/entityDetection.d.ts +12 -0
  128. package/dist/components/chatbotV2/utils/entityDetection.d.ts.map +1 -0
  129. package/dist/components/chatbotV2/utils/streamProcessor.d.ts +98 -0
  130. package/dist/components/chatbotV2/utils/streamProcessor.d.ts.map +1 -0
  131. package/dist/components/chatbotV2/utils.d.ts +3 -0
  132. package/dist/components/chatbotV2/utils.d.ts.map +1 -0
  133. package/dist/components/dbtDocs/api/index.d.ts +16 -0
  134. package/dist/components/dbtDocs/api/index.d.ts.map +1 -0
  135. package/dist/components/dbtDocs/collaboration/ConversationHighlighter.d.ts +6 -0
  136. package/dist/components/dbtDocs/collaboration/ConversationHighlighter.d.ts.map +1 -0
  137. package/dist/components/dbtDocs/collaboration/ConversationInputForm.d.ts +13 -0
  138. package/dist/components/dbtDocs/collaboration/ConversationInputForm.d.ts.map +1 -0
  139. package/dist/components/dbtDocs/collaboration/ConversationsHighlighter.d.ts +3 -0
  140. package/dist/components/dbtDocs/collaboration/ConversationsHighlighter.d.ts.map +1 -0
  141. package/dist/components/dbtDocs/collaboration/DbtDocsCollaborationComponents.d.ts +3 -0
  142. package/dist/components/dbtDocs/collaboration/DbtDocsCollaborationComponents.d.ts.map +1 -0
  143. package/dist/components/dbtDocs/collaboration/DbtDocsCollaborationProvider.d.ts +22 -0
  144. package/dist/components/dbtDocs/collaboration/DbtDocsCollaborationProvider.d.ts.map +1 -0
  145. package/dist/components/dbtDocs/collaboration/DbtDocsConversationsRightPanel.d.ts +3 -0
  146. package/dist/components/dbtDocs/collaboration/DbtDocsConversationsRightPanel.d.ts.map +1 -0
  147. package/dist/components/dbtDocs/collaboration/DbtDocsReducer.d.ts +1931 -0
  148. package/dist/components/dbtDocs/collaboration/DbtDocsReducer.d.ts.map +1 -0
  149. package/dist/components/dbtDocs/collaboration/HighlightAnchor.d.ts +12 -0
  150. package/dist/components/dbtDocs/collaboration/HighlightAnchor.d.ts.map +1 -0
  151. package/dist/components/dbtDocs/collaboration/HighlightBlocker.d.ts +7 -0
  152. package/dist/components/dbtDocs/collaboration/HighlightBlocker.d.ts.map +1 -0
  153. package/dist/components/dbtDocs/collaboration/HotspotButton.d.ts +7 -0
  154. package/dist/components/dbtDocs/collaboration/HotspotButton.d.ts.map +1 -0
  155. package/dist/components/dbtDocs/collaboration/NewConversationForm.d.ts +3 -0
  156. package/dist/components/dbtDocs/collaboration/NewConversationForm.d.ts.map +1 -0
  157. package/dist/components/dbtDocs/collaboration/ShowConversationsButton.d.ts +3 -0
  158. package/dist/components/dbtDocs/collaboration/ShowConversationsButton.d.ts.map +1 -0
  159. package/dist/components/dbtDocs/collaboration/constants.d.ts +20 -0
  160. package/dist/components/dbtDocs/collaboration/constants.d.ts.map +1 -0
  161. package/dist/components/dbtDocs/collaboration/conversations/Conversation.d.ts +9 -0
  162. package/dist/components/dbtDocs/collaboration/conversations/Conversation.d.ts.map +1 -0
  163. package/dist/components/dbtDocs/collaboration/conversations/ConversationGroup.d.ts +10 -0
  164. package/dist/components/dbtDocs/collaboration/conversations/ConversationGroup.d.ts.map +1 -0
  165. package/dist/components/dbtDocs/collaboration/conversations/ConversationGroups.d.ts +3 -0
  166. package/dist/components/dbtDocs/collaboration/conversations/ConversationGroups.d.ts.map +1 -0
  167. package/dist/components/dbtDocs/collaboration/conversations/ConversationHeader.d.ts +13 -0
  168. package/dist/components/dbtDocs/collaboration/conversations/ConversationHeader.d.ts.map +1 -0
  169. package/dist/components/dbtDocs/collaboration/conversations/ConversationHighlightText.d.ts +6 -0
  170. package/dist/components/dbtDocs/collaboration/conversations/ConversationHighlightText.d.ts.map +1 -0
  171. package/dist/components/dbtDocs/collaboration/conversations/ConversationReplyForm.d.ts +9 -0
  172. package/dist/components/dbtDocs/collaboration/conversations/ConversationReplyForm.d.ts.map +1 -0
  173. package/dist/components/dbtDocs/collaboration/conversations/ResolveButton.d.ts +8 -0
  174. package/dist/components/dbtDocs/collaboration/conversations/ResolveButton.d.ts.map +1 -0
  175. package/dist/components/dbtDocs/collaboration/conversations/context/ConversationsProvider.d.ts +18 -0
  176. package/dist/components/dbtDocs/collaboration/conversations/context/ConversationsProvider.d.ts.map +1 -0
  177. package/dist/components/dbtDocs/collaboration/conversations/context/types.d.ts +44 -0
  178. package/dist/components/dbtDocs/collaboration/conversations/context/types.d.ts.map +1 -0
  179. package/dist/components/dbtDocs/collaboration/conversations/useConversations.d.ts +5 -0
  180. package/dist/components/dbtDocs/collaboration/conversations/useConversations.d.ts.map +1 -0
  181. package/dist/components/dbtDocs/collaboration/highlightUtils.d.ts +28 -0
  182. package/dist/components/dbtDocs/collaboration/highlightUtils.d.ts.map +1 -0
  183. package/dist/components/dbtDocs/collaboration/mentions/MentionsInput.d.ts +11 -0
  184. package/dist/components/dbtDocs/collaboration/mentions/MentionsInput.d.ts.map +1 -0
  185. package/dist/components/dbtDocs/collaboration/mentions/index.d.ts +32 -0
  186. package/dist/components/dbtDocs/collaboration/mentions/index.d.ts.map +1 -0
  187. package/dist/components/dbtDocs/collaboration/newConversationUtils.d.ts +15 -0
  188. package/dist/components/dbtDocs/collaboration/newConversationUtils.d.ts.map +1 -0
  189. package/dist/components/dbtDocs/collaboration/selectionEndEvent.d.ts +17 -0
  190. package/dist/components/dbtDocs/collaboration/selectionEndEvent.d.ts.map +1 -0
  191. package/dist/components/dbtDocs/collaboration/types.d.ts +15 -0
  192. package/dist/components/dbtDocs/collaboration/types.d.ts.map +1 -0
  193. package/dist/components/dbtDocs/collaboration/useConversationUsers.d.ts +5 -0
  194. package/dist/components/dbtDocs/collaboration/useConversationUsers.d.ts.map +1 -0
  195. package/dist/components/dbtDocs/collaboration/useDbtDocsCollaboration.d.ts +7 -0
  196. package/dist/components/dbtDocs/collaboration/useDbtDocsCollaboration.d.ts.map +1 -0
  197. package/dist/components/dbtDocs/collaboration/useHighlight.d.ts +12 -0
  198. package/dist/components/dbtDocs/collaboration/useHighlight.d.ts.map +1 -0
  199. package/dist/components/dbtDocs/details/AddCommentButton.d.ts +3 -0
  200. package/dist/components/dbtDocs/details/AddCommentButton.d.ts.map +1 -0
  201. package/dist/components/dbtDocs/details/AddCommentOnCodeButton.d.ts +3 -0
  202. package/dist/components/dbtDocs/details/AddCommentOnCodeButton.d.ts.map +1 -0
  203. package/dist/components/dbtDocs/details/AddCommentOnModelDescriptionButton.d.ts +3 -0
  204. package/dist/components/dbtDocs/details/AddCommentOnModelDescriptionButton.d.ts.map +1 -0
  205. package/dist/components/dbtDocs/details/DbtDocs.d.ts +10 -0
  206. package/dist/components/dbtDocs/details/DbtDocs.d.ts.map +1 -0
  207. package/dist/components/dbtDocs/details/DbtDocsDetails.d.ts +3 -0
  208. package/dist/components/dbtDocs/details/DbtDocsDetails.d.ts.map +1 -0
  209. package/dist/components/dbtDocs/details/DbtDocsRenderer.d.ts +8 -0
  210. package/dist/components/dbtDocs/details/DbtDocsRenderer.d.ts.map +1 -0
  211. package/dist/components/dbtDocs/details/dbtDocsUtils.d.ts +5 -0
  212. package/dist/components/dbtDocs/details/dbtDocsUtils.d.ts.map +1 -0
  213. package/dist/components/dbtDocs/index.d.ts +8 -0
  214. package/dist/components/dbtDocs/index.d.ts.map +1 -0
  215. package/dist/components/dbtDocs/resources/dbtDocsAngularApp.d.ts +3 -0
  216. package/dist/components/dbtDocs/resources/dbtDocsAngularApp.d.ts.map +1 -0
  217. package/dist/components/lineage/api/index.d.ts +65 -0
  218. package/dist/components/lineage/api/index.d.ts.map +1 -0
  219. package/dist/components/lineage/assets/icons/index.d.ts +61 -0
  220. package/dist/components/lineage/assets/icons/index.d.ts.map +1 -0
  221. package/dist/components/lineage/cllUtils.d.ts +17 -0
  222. package/dist/components/lineage/cllUtils.d.ts.map +1 -0
  223. package/dist/components/lineage/components/AutoExpansionPopover.d.ts +3 -0
  224. package/dist/components/lineage/components/AutoExpansionPopover.d.ts.map +1 -0
  225. package/dist/components/lineage/components/BetterPopover.d.ts +14 -0
  226. package/dist/components/lineage/components/BetterPopover.d.ts.map +1 -0
  227. package/dist/components/lineage/components/Chip.d.ts +6 -0
  228. package/dist/components/lineage/components/Chip.d.ts.map +1 -0
  229. package/dist/components/lineage/components/Column.d.ts +52 -0
  230. package/dist/components/lineage/components/Column.d.ts.map +1 -0
  231. package/dist/components/lineage/components/ColumnRow.d.ts +8 -0
  232. package/dist/components/lineage/components/ColumnRow.d.ts.map +1 -0
  233. package/dist/components/lineage/components/CustomNodes.d.ts +16 -0
  234. package/dist/components/lineage/components/CustomNodes.d.ts.map +1 -0
  235. package/dist/components/lineage/components/DashboardDetails.d.ts +12 -0
  236. package/dist/components/lineage/components/DashboardDetails.d.ts.map +1 -0
  237. package/dist/components/lineage/components/DynamicLineage.d.ts +9 -0
  238. package/dist/components/lineage/components/DynamicLineage.d.ts.map +1 -0
  239. package/dist/components/lineage/components/ExpandWithConfidenceCard.d.ts +3 -0
  240. package/dist/components/lineage/components/ExpandWithConfidenceCard.d.ts.map +1 -0
  241. package/dist/components/lineage/components/ExportButton.d.ts +6 -0
  242. package/dist/components/lineage/components/ExportButton.d.ts.map +1 -0
  243. package/dist/components/lineage/components/ExportFinalLineageModal.d.ts +5 -0
  244. package/dist/components/lineage/components/ExportFinalLineageModal.d.ts.map +1 -0
  245. package/dist/components/lineage/components/ExposureDetails.d.ts +6 -0
  246. package/dist/components/lineage/components/ExposureDetails.d.ts.map +1 -0
  247. package/dist/components/lineage/components/Feedback.d.ts +5 -0
  248. package/dist/components/lineage/components/Feedback.d.ts.map +1 -0
  249. package/dist/components/lineage/components/Form.d.ts +5 -0
  250. package/dist/components/lineage/components/Form.d.ts.map +1 -0
  251. package/dist/components/lineage/components/FunctionDetails.d.ts +3 -0
  252. package/dist/components/lineage/components/FunctionDetails.d.ts.map +1 -0
  253. package/dist/components/lineage/components/LineageLegend.d.ts +3 -0
  254. package/dist/components/lineage/components/LineageLegend.d.ts.map +1 -0
  255. package/dist/components/lineage/components/LineageModals.d.ts +3 -0
  256. package/dist/components/lineage/components/LineageModals.d.ts.map +1 -0
  257. package/dist/components/lineage/components/Loader/index.d.ts +7 -0
  258. package/dist/components/lineage/components/Loader/index.d.ts.map +1 -0
  259. package/dist/components/lineage/components/MoreTables.d.ts +11 -0
  260. package/dist/components/lineage/components/MoreTables.d.ts.map +1 -0
  261. package/dist/components/lineage/components/Purpose.d.ts +6 -0
  262. package/dist/components/lineage/components/Purpose.d.ts.map +1 -0
  263. package/dist/components/lineage/components/ResetButton.d.ts +6 -0
  264. package/dist/components/lineage/components/ResetButton.d.ts.map +1 -0
  265. package/dist/components/lineage/components/Settings.d.ts +6 -0
  266. package/dist/components/lineage/components/Settings.d.ts.map +1 -0
  267. package/dist/components/lineage/components/SettingsButton.d.ts +3 -0
  268. package/dist/components/lineage/components/SettingsButton.d.ts.map +1 -0
  269. package/dist/components/lineage/components/SidebarErrorBoundary.d.ts +13 -0
  270. package/dist/components/lineage/components/SidebarErrorBoundary.d.ts.map +1 -0
  271. package/dist/components/lineage/components/SnowflakeStageDetails.d.ts +3 -0
  272. package/dist/components/lineage/components/SnowflakeStageDetails.d.ts.map +1 -0
  273. package/dist/components/lineage/components/SqlLineage.d.ts +12 -0
  274. package/dist/components/lineage/components/SqlLineage.d.ts.map +1 -0
  275. package/dist/components/lineage/components/StaticLineage.d.ts +17 -0
  276. package/dist/components/lineage/components/StaticLineage.d.ts.map +1 -0
  277. package/dist/components/lineage/components/TableDetails.d.ts +53 -0
  278. package/dist/components/lineage/components/TableDetails.d.ts.map +1 -0
  279. package/dist/components/lineage/components/Tags/index.d.ts +5 -0
  280. package/dist/components/lineage/components/Tags/index.d.ts.map +1 -0
  281. package/dist/components/lineage/components/ViewsTypeBadge.d.ts +5 -0
  282. package/dist/components/lineage/components/ViewsTypeBadge.d.ts.map +1 -0
  283. package/dist/components/lineage/components/sidebarModal/SidebarModal.d.ts +9 -0
  284. package/dist/components/lineage/components/sidebarModal/SidebarModal.d.ts.map +1 -0
  285. package/dist/components/lineage/constants.d.ts +12 -0
  286. package/dist/components/lineage/constants.d.ts.map +1 -0
  287. package/dist/components/lineage/context/LineageProvider.d.ts +35 -0
  288. package/dist/components/lineage/context/LineageProvider.d.ts.map +1 -0
  289. package/dist/components/lineage/context/LineageSlice.d.ts +4673 -0
  290. package/dist/components/lineage/context/LineageSlice.d.ts.map +1 -0
  291. package/dist/components/lineage/context/types.d.ts +57 -0
  292. package/dist/components/lineage/context/types.d.ts.map +1 -0
  293. package/dist/components/lineage/graph.d.ts +43 -0
  294. package/dist/components/lineage/graph.d.ts.map +1 -0
  295. package/dist/components/lineage/index.d.ts +8 -0
  296. package/dist/components/lineage/index.d.ts.map +1 -0
  297. package/dist/{lineage/index.d.ts → components/lineage/types.d.ts} +59 -92
  298. package/dist/components/lineage/types.d.ts.map +1 -0
  299. package/dist/components/lineage/utils.d.ts +100 -0
  300. package/dist/components/lineage/utils.d.ts.map +1 -0
  301. package/dist/components/shared/index.d.ts +2 -0
  302. package/dist/components/shared/index.d.ts.map +1 -0
  303. package/dist/components/shared/types.d.ts +18 -0
  304. package/dist/components/shared/types.d.ts.map +1 -0
  305. package/dist/components/teammate/AddLearningForm.d.ts +13 -0
  306. package/dist/components/teammate/AddLearningForm.d.ts.map +1 -0
  307. package/dist/components/teammate/CoachForm.d.ts +10 -0
  308. package/dist/components/teammate/CoachForm.d.ts.map +1 -0
  309. package/dist/components/teammate/CoachFormButton.d.ts +3 -0
  310. package/dist/components/teammate/CoachFormButton.d.ts.map +1 -0
  311. package/dist/components/teammate/CoachFormInput.d.ts +8 -0
  312. package/dist/components/teammate/CoachFormInput.d.ts.map +1 -0
  313. package/dist/components/teammate/LearningRow.d.ts +10 -0
  314. package/dist/components/teammate/LearningRow.d.ts.map +1 -0
  315. package/dist/components/teammate/LearningsList.d.ts +11 -0
  316. package/dist/components/teammate/LearningsList.d.ts.map +1 -0
  317. package/dist/components/teammate/TeamMateProvider.d.ts +8 -0
  318. package/dist/components/teammate/TeamMateProvider.d.ts.map +1 -0
  319. package/dist/components/teammate/TeamMates.d.ts +10 -0
  320. package/dist/components/teammate/TeamMates.d.ts.map +1 -0
  321. package/dist/components/teammate/TeamMatesCard.d.ts +10 -0
  322. package/dist/components/teammate/TeamMatesCard.d.ts.map +1 -0
  323. package/dist/components/teammate/alertManager/AlertManagerDisplay.d.ts +4 -0
  324. package/dist/components/teammate/alertManager/AlertManagerDisplay.d.ts.map +1 -0
  325. package/dist/components/teammate/assets/index.d.ts +8 -0
  326. package/dist/components/teammate/assets/index.d.ts.map +1 -0
  327. package/dist/components/teammate/index.d.ts +11 -0
  328. package/dist/components/teammate/index.d.ts.map +1 -0
  329. package/dist/components/teammate/projectGovernor/ChecksInput.d.ts +7 -0
  330. package/dist/components/teammate/projectGovernor/ChecksInput.d.ts.map +1 -0
  331. package/dist/components/teammate/projectGovernor/ProjectGovernanceCheck.d.ts +8 -0
  332. package/dist/components/teammate/projectGovernor/ProjectGovernanceCheck.d.ts.map +1 -0
  333. package/dist/components/teammate/projectGovernor/ProjectGovernorDisplay.d.ts +3 -0
  334. package/dist/components/teammate/projectGovernor/ProjectGovernorDisplay.d.ts.map +1 -0
  335. package/dist/components/teammate/projectGovernor/ProjectGovernorForm.d.ts +7 -0
  336. package/dist/components/teammate/projectGovernor/ProjectGovernorForm.d.ts.map +1 -0
  337. package/dist/components/teammate/projectGovernor/types.d.ts +48 -0
  338. package/dist/components/teammate/projectGovernor/types.d.ts.map +1 -0
  339. package/dist/components/teammate/teamMateSlice.d.ts +15 -0
  340. package/dist/components/teammate/teamMateSlice.d.ts.map +1 -0
  341. package/dist/components/teammate/teamMatesConfig.d.ts +3 -0
  342. package/dist/components/teammate/teamMatesConfig.d.ts.map +1 -0
  343. package/dist/components/teammate/teradata/HelloMessage.d.ts +3 -0
  344. package/dist/components/teammate/teradata/HelloMessage.d.ts.map +1 -0
  345. package/dist/components/teammate/teradata/MigratorDisplay.d.ts +4 -0
  346. package/dist/components/teammate/teradata/MigratorDisplay.d.ts.map +1 -0
  347. package/dist/components/teammate/types.d.ts +113 -0
  348. package/dist/components/teammate/types.d.ts.map +1 -0
  349. package/dist/components/teammate/useTeamMateContext.d.ts +3 -0
  350. package/dist/components/teammate/useTeamMateContext.d.ts.map +1 -0
  351. package/dist/components/user/ProfileImageByUser.d.ts +7 -0
  352. package/dist/components/user/ProfileImageByUser.d.ts.map +1 -0
  353. package/dist/components/user/index.d.ts +3 -0
  354. package/dist/components/user/index.d.ts.map +1 -0
  355. package/dist/components/user/types.d.ts +7 -0
  356. package/dist/components/user/types.d.ts.map +1 -0
  357. package/dist/dbtDocs.css +297 -0
  358. package/dist/dbtDocs.css.map +1 -0
  359. package/dist/dbtDocs.js +1 -0
  360. package/dist/index.d.ts +14 -285
  361. package/dist/index.d.ts.map +1 -0
  362. package/dist/index.js +1 -40
  363. package/dist/lineage.css +1221 -0
  364. package/dist/lineage.css.map +1 -0
  365. package/dist/lineage.js +7267 -0
  366. package/dist/lineage.js.map +1 -0
  367. package/dist/rslib-runtime.js +20 -0
  368. package/dist/rslib-runtime.js.map +1 -0
  369. package/dist/shared/AutosizeTextarea.d.ts +19 -0
  370. package/dist/shared/AutosizeTextarea.d.ts.map +1 -0
  371. package/dist/shared/Collapse.d.ts +7 -0
  372. package/dist/shared/Collapse.d.ts.map +1 -0
  373. package/dist/shared/Table.d.ts +4 -0
  374. package/dist/shared/Table.d.ts.map +1 -0
  375. package/dist/shared/index.d.ts +3 -0
  376. package/dist/shared/index.d.ts.map +1 -0
  377. package/dist/shared/utils.d.ts +3 -0
  378. package/dist/shared/utils.d.ts.map +1 -0
  379. package/dist/static/image/postgres.png +0 -0
  380. package/dist/static/image/s3.png +0 -0
  381. package/dist/static/image/snowflake.png +0 -0
  382. package/dist/static/svg/botIcon.svg +15 -0
  383. package/dist/static/svg/brackets.svg +5 -0
  384. package/dist/static/svg/case-sensitive.svg +5 -0
  385. package/dist/static/svg/docgen.svg +23 -0
  386. package/dist/static/svg/half-circle.svg +5 -0
  387. package/dist/static/svg/opportunities.svg +25 -0
  388. package/dist/static/svg/split-horizontal.svg +5 -0
  389. package/dist/static/svg/sqlExpert.svg +24 -0
  390. package/dist/static/svg/summary.svg +25 -0
  391. package/dist/styles.css +1638 -0
  392. package/dist/styles.css.map +1 -0
  393. package/dist/teammate.css +124 -0
  394. package/dist/teammate.css.map +1 -0
  395. package/dist/teammate.js +5655 -0
  396. package/dist/teammate.js.map +1 -0
  397. package/dist/user.css +14 -0
  398. package/dist/user.css.map +1 -0
  399. package/dist/user.js +13 -0
  400. package/dist/user.js.map +1 -0
  401. package/package.json +116 -34
  402. package/dist/Button-42Dj_nRE.d.ts +0 -28
  403. package/dist/CoachForm.css +0 -1
  404. package/dist/CoachForm.js +0 -44445
  405. package/dist/DbtDocsRenderer.js +0 -45647
  406. package/dist/IconEye.js +0 -11
  407. package/dist/Stack.js +0 -7170
  408. package/dist/Switch.js +0 -128
  409. package/dist/ToggleGroup.js +0 -8543
  410. package/dist/_basePickBy.js +0 -151
  411. package/dist/_baseUniq.js +0 -615
  412. package/dist/arc.js +0 -83
  413. package/dist/architecture-U656AL7Q.js +0 -5
  414. package/dist/architectureDiagram-VXUJARFQ.js +0 -4666
  415. package/dist/assets/icons/index.js +0 -56
  416. package/dist/blockDiagram-VD42YOAC.js +0 -2266
  417. package/dist/c4Diagram-YG6GDRKO.js +0 -1582
  418. package/dist/channel.js +0 -5
  419. package/dist/chatbotV2/index.d.ts +0 -359
  420. package/dist/chatbotV2/index.js +0 -58
  421. package/dist/chunk-4BX2VUAB.js +0 -9
  422. package/dist/chunk-55IACEB6.js +0 -9
  423. package/dist/chunk-B4BG7PRW.js +0 -1377
  424. package/dist/chunk-DI55MBZ5.js +0 -1382
  425. package/dist/chunk-FMBD7UC4.js +0 -19
  426. package/dist/chunk-QN33PNHL.js +0 -20
  427. package/dist/chunk-QZHKN3VN.js +0 -15
  428. package/dist/chunk-TZMSLE5B.js +0 -64
  429. package/dist/classDiagram-2ON5EDUG.js +0 -17
  430. package/dist/classDiagram-v2-WZHVMYZB.js +0 -17
  431. package/dist/clone.js +0 -8
  432. package/dist/cose-bilkent-S5V4N54A.js +0 -2606
  433. package/dist/cytoscape.esm.js +0 -18731
  434. package/dist/dagre-6UL2VRFP.js +0 -447
  435. package/dist/dayjs.min.js +0 -302
  436. package/dist/defaultLocale.js +0 -171
  437. package/dist/diagram-PSM6KHXK.js +0 -535
  438. package/dist/diagram-QEK2KX5R.js +0 -221
  439. package/dist/diagram-S2PKOQOG.js +0 -143
  440. package/dist/erDiagram-Q2GNP2WA.js +0 -843
  441. package/dist/flowDiagram-NV44I4VS.js +0 -1628
  442. package/dist/ganttDiagram-LVOFAZNH.js +0 -2500
  443. package/dist/gitGraph-F6HP7TQM.js +0 -5
  444. package/dist/gitGraphDiagram-NY62KEGX.js +0 -713
  445. package/dist/graph.js +0 -247
  446. package/dist/index.css +0 -1
  447. package/dist/index2.js +0 -689
  448. package/dist/info-NVLQJR56.js +0 -5
  449. package/dist/infoDiagram-F6ZHWCRC.js +0 -24
  450. package/dist/init.js +0 -16
  451. package/dist/journeyDiagram-XKPGCS4Q.js +0 -837
  452. package/dist/kanban-definition-3W4ZIXB7.js +0 -720
  453. package/dist/katex.js +0 -11691
  454. package/dist/layout.js +0 -1324
  455. package/dist/lineage/index.js +0 -7328
  456. package/dist/linear.js +0 -259
  457. package/dist/main.css +0 -1
  458. package/dist/main.js +0 -4566
  459. package/dist/mermaid-parser.core.js +0 -12921
  460. package/dist/mindmap-definition-VGOIOE7T.js +0 -786
  461. package/dist/ordinal.js +0 -61
  462. package/dist/packet-BFZMPI3H.js +0 -5
  463. package/dist/pie-7BOR55EZ.js +0 -5
  464. package/dist/pieDiagram-ADFJNKIX.js +0 -163
  465. package/dist/quadrantDiagram-AYHSOK5B.js +0 -1025
  466. package/dist/radar-NHE76QYJ.js +0 -5
  467. package/dist/redux-toolkit.css +0 -1
  468. package/dist/redux-toolkit.modern.js +0 -12525
  469. package/dist/requirementDiagram-UZGBJVZJ.js +0 -852
  470. package/dist/sankeyDiagram-TZEHDZUN.js +0 -811
  471. package/dist/sequenceDiagram-WL72ISMW.js +0 -2523
  472. package/dist/shadcn/index.d.ts +0 -761
  473. package/dist/shadcn/index.js +0 -8680
  474. package/dist/stateDiagram-FKZM4ZOC.js +0 -264
  475. package/dist/stateDiagram-v2-4FDKWEC3.js +0 -17
  476. package/dist/storybook/Accordion.stories.tsx +0 -52
  477. package/dist/storybook/Alert.stories.tsx +0 -101
  478. package/dist/storybook/AlertDialog.stories.tsx +0 -161
  479. package/dist/storybook/AutosizeTextarea.stories.tsx +0 -52
  480. package/dist/storybook/Avatar.stories.tsx +0 -58
  481. package/dist/storybook/Badge.stories.tsx +0 -43
  482. package/dist/storybook/Button.stories.tsx +0 -67
  483. package/dist/storybook/Calendar.stories.tsx +0 -103
  484. package/dist/storybook/Card.stories.tsx +0 -69
  485. package/dist/storybook/Carousel.stories.tsx +0 -274
  486. package/dist/storybook/Checkbox.stories.tsx +0 -65
  487. package/dist/storybook/Combobox.stories.tsx +0 -1629
  488. package/dist/storybook/Command.stories.tsx +0 -35
  489. package/dist/storybook/DateRange.stories.tsx +0 -540
  490. package/dist/storybook/DebouncedInput.stories.tsx +0 -179
  491. package/dist/storybook/DropdownMenu.stories.tsx +0 -36
  492. package/dist/storybook/Form.stories.tsx +0 -114
  493. package/dist/storybook/HoverCard.stories.tsx +0 -99
  494. package/dist/storybook/Input.stories.tsx +0 -156
  495. package/dist/storybook/InputGroup.stories.tsx +0 -352
  496. package/dist/storybook/Label.stories.tsx +0 -42
  497. package/dist/storybook/Menubar.stories.tsx +0 -159
  498. package/dist/storybook/Pagination.stories.tsx +0 -152
  499. package/dist/storybook/Popover.stories.tsx +0 -23
  500. package/dist/storybook/Progress.stories.tsx +0 -89
  501. package/dist/storybook/RadioGroup.stories.tsx +0 -58
  502. package/dist/storybook/Resizable.stories.tsx +0 -119
  503. package/dist/storybook/ScrollArea.stories.tsx +0 -101
  504. package/dist/storybook/Select.stories.tsx +0 -145
  505. package/dist/storybook/Sheet.stories.tsx +0 -69
  506. package/dist/storybook/Sidebar.stories.tsx +0 -97
  507. package/dist/storybook/Slider.stories.tsx +0 -79
  508. package/dist/storybook/Switch.stories.tsx +0 -90
  509. package/dist/storybook/Tabs.stories.tsx +0 -147
  510. package/dist/storybook/TagsInput.stories.tsx +0 -261
  511. package/dist/storybook/Textarea.stories.tsx +0 -50
  512. package/dist/storybook/Toast.stories.tsx +0 -107
  513. package/dist/storybook/Toggle.stories.tsx +0 -106
  514. package/dist/storybook/ToggleGroup.stories.tsx +0 -178
  515. package/dist/storybook/Tooltip.stories.tsx +0 -25
  516. package/dist/storybook/Typography.stories.tsx +0 -231
  517. package/dist/storybook/drag-and-drop-file-upload.stories.tsx +0 -99
  518. package/dist/timeline-definition-IT6M3QCI.js +0 -802
  519. package/dist/treemap-KMMF4GRG.js +0 -5
  520. package/dist/xychartDiagram-PRI3JC2R.js +0 -1341
  521. package/readme.md +0 -11
@@ -1,1629 +0,0 @@
1
- import { Meta, StoryFn } from "@storybook/react";
2
- import { Combobox, Button } from "../shadcn";
3
- import type { ComboboxOption } from "./Combobox";
4
- import { DatabaseIcon } from "@ac-assets/icons";
5
- import { useCallback, useState } from "react";
6
-
7
- export default {
8
- title: "Shadcn/Components/Combobox",
9
- component: Combobox,
10
- } as Meta;
11
-
12
- export const ComboboxSearchModeExample: StoryFn = () => {
13
- const options = [
14
- { value: "react", label: "React" },
15
- { value: "vue", label: "Vue" },
16
- { value: "angular", label: "Angular" },
17
- { value: "svelte", label: "Svelte" },
18
- { value: "nextjs", label: "Next.js" },
19
- { value: "remix", label: "Remix" },
20
- { value: "gatsby", label: "Gatsby" },
21
- ];
22
-
23
- const [searchModeValue, setSearchModeValue] = useState("");
24
- const [normalModeValue, setNormalModeValue] = useState("");
25
-
26
- return (
27
- <div className="al-flex al-flex-col al-gap-8 al-justify-start al-items-start">
28
- <div className="al-flex al-flex-col al-gap-2">
29
- <h3 className="al-text-lg al-font-medium">Search Mode Comparison</h3>
30
- <p className="al-text-sm al-text-muted-foreground">
31
- Compare search mode (shows input directly) with normal mode (shows button)
32
- </p>
33
- </div>
34
-
35
- <div className="al-flex al-flex-col al-gap-4">
36
- <div className="al-flex al-flex-col al-gap-2">
37
- <label className="al-text-sm al-font-medium">Search Mode (searchMode=true)</label>
38
- <p className="al-text-xs al-text-muted-foreground">
39
- Shows an input field directly. Click or focus to open dropdown.
40
- </p>
41
- <Combobox
42
- options={options}
43
- value={searchModeValue}
44
- onChange={value => setSearchModeValue(value as string)}
45
- placeholder="Search frameworks..."
46
- searchMode={true}
47
- />
48
- <div className="al-text-sm">Selected: {searchModeValue || "None"}</div>
49
- </div>
50
-
51
- <div className="al-flex al-flex-col al-gap-2">
52
- <label className="al-text-sm al-font-medium">Search Mode with Icon</label>
53
- <p className="al-text-xs al-text-muted-foreground">Search mode with custom icon</p>
54
- <Combobox
55
- options={options}
56
- value={searchModeValue}
57
- onChange={value => setSearchModeValue(value as string)}
58
- placeholder="Type to search..."
59
- searchMode={true}
60
- icon={<DatabaseIcon className="al-h-4 al-w-4" />}
61
- buttonProps={{ className: "al-w-[300px]" }}
62
- />
63
- </div>
64
-
65
- <div className="al-flex al-flex-col al-gap-2">
66
- <label className="al-text-sm al-font-medium">Normal Mode (Default)</label>
67
- <p className="al-text-xs al-text-muted-foreground">
68
- Shows a button. Click to open dropdown with search inside.
69
- </p>
70
- <Combobox
71
- options={options}
72
- value={normalModeValue}
73
- onChange={value => setNormalModeValue(value as string)}
74
- placeholder="Select framework..."
75
- searchMode={false}
76
- buttonProps={{ className: "al-w-[300px]" }}
77
- />
78
- <div className="al-text-sm">Selected: {normalModeValue || "None"}</div>
79
- </div>
80
- </div>
81
- </div>
82
- );
83
- };
84
-
85
- export const ComboboxExample: StoryFn = () => {
86
- const options = [
87
- { value: "react", label: "React" },
88
- { value: "vue", label: "Vue" },
89
- { value: "angular", label: "Angular" },
90
- { value: "svelte", label: "Svelte" },
91
- { value: "nextjs", label: "Next.js" },
92
- ];
93
-
94
- const [value, setValue] = useState("");
95
-
96
- const handleChange = (newValue: string) => {
97
- setValue(newValue);
98
- };
99
-
100
- return (
101
- <div className="al-flex al-flex-col al-gap-4 al-justify-start al-items-start">
102
- <h3 className="al-text-lg al-font-medium">Single Select</h3>
103
- <Combobox
104
- options={options}
105
- value={value}
106
- onChange={handleChange}
107
- placeholder="Select framework..."
108
- />
109
-
110
- <Combobox
111
- options={options}
112
- value={value}
113
- onChange={handleChange}
114
- placeholder="Custom width..."
115
- buttonProps={{ className: "al-w-[300px]" }}
116
- />
117
-
118
- <Combobox
119
- options={options}
120
- value={value}
121
- onChange={handleChange}
122
- placeholder="With icon..."
123
- icon={<DatabaseIcon className="al-mr-2" />}
124
- />
125
- </div>
126
- );
127
- };
128
-
129
- export const ComboboxMultiSelectExample: StoryFn = () => {
130
- const options = [
131
- { value: "react", label: "React" },
132
- { value: "vue", label: "Vue" },
133
- { value: "angular", label: "Angular" },
134
- { value: "svelte", label: "Svelte" },
135
- { value: "nextjs", label: "Next.js" },
136
- { value: "remix", label: "Remix" },
137
- { value: "gatsby", label: "Gatsby" },
138
- { value: "ember", label: "Ember.js" },
139
- ];
140
-
141
- const [selectedValues, setSelectedValues] = useState<string[]>([]);
142
- const [selectedValuesWithApply, setSelectedValuesWithApply] = useState<string[]>([
143
- "react",
144
- "vue",
145
- ]);
146
-
147
- const handleMultiSelectChange = (newValue: string[]) => {
148
- setSelectedValues(Array.isArray(newValue) ? newValue : []);
149
- };
150
-
151
- const handleMultiSelectWithApplyChange = (newValue: string | string[]) => {
152
- setSelectedValuesWithApply(Array.isArray(newValue) ? newValue : []);
153
- };
154
-
155
- return (
156
- <div className="al-flex al-flex-col al-gap-8 al-justify-start al-items-start">
157
- <div className="al-flex al-flex-col al-gap-4">
158
- <h3 className="al-text-lg al-font-medium">Multi-Select (Auto-Apply)</h3>
159
- <p className="al-text-sm al-text-muted-foreground">
160
- Changes are applied immediately when selecting/deselecting options
161
- </p>
162
- <div className="al-w-40">
163
- <Combobox
164
- options={options}
165
- value={selectedValues}
166
- placeholder="Select frameworks..."
167
- multiSelect={true}
168
- buttonProps={{ className: "al-w-full" }}
169
- onChange={handleMultiSelectChange}
170
- />
171
- </div>
172
- <div className="al-text-sm">
173
- Selected: {selectedValues.length > 0 ? selectedValues.join(", ") : "None"}
174
- </div>
175
- </div>
176
-
177
- <div className="al-flex al-flex-col al-gap-4">
178
- <h3 className="al-text-lg al-font-medium">Multi-Select with Apply Button</h3>
179
- <p className="al-text-sm al-text-muted-foreground">
180
- Changes are only applied when clicking the Apply button
181
- </p>
182
- <Combobox
183
- options={options}
184
- value={selectedValuesWithApply}
185
- onChange={handleMultiSelectWithApplyChange}
186
- placeholder="Select frameworks..."
187
- multiSelect={true}
188
- showApplyButton={true}
189
- buttonProps={{ className: "al-w-[250px]" }}
190
- />
191
- <div className="al-text-sm">
192
- Selected:{" "}
193
- {selectedValuesWithApply.length > 0 ? selectedValuesWithApply.join(", ") : "None"}
194
- </div>
195
- </div>
196
-
197
- <div className="al-flex al-flex-col al-gap-4">
198
- <h3 className="al-text-lg al-font-medium">Columns Selector Example</h3>
199
- <p className="al-text-sm al-text-muted-foreground">
200
- Similar to the UI shown in the screenshot
201
- </p>
202
- <ComboboxColumnsExample />
203
- </div>
204
- </div>
205
- );
206
- };
207
-
208
- const ComboboxColumnsExample = () => {
209
- const options = [
210
- { value: "est_cost", label: "Est. Cost" },
211
- { value: "exec_time", label: "Exec. Time" },
212
- { value: "insights", label: "Insights" },
213
- { value: "query_hash", label: "Query Hash" },
214
- { value: "query_text", label: "Query Text" },
215
- { value: "query_type", label: "Query Type" },
216
- { value: "timestamp", label: "Timestamp" },
217
- { value: "user", label: "User" },
218
- ];
219
-
220
- const [selectedColumns, setSelectedColumns] = useState<string[]>([
221
- "est_cost",
222
- "exec_time",
223
- "insights",
224
- "query_hash",
225
- "query_text",
226
- "query_type",
227
- "timestamp",
228
- "user",
229
- ]);
230
-
231
- const handleColumnsChange = (newValue: string | string[]) => {
232
- setSelectedColumns(Array.isArray(newValue) ? newValue : []);
233
- };
234
-
235
- return (
236
- <Combobox
237
- options={options}
238
- value={selectedColumns}
239
- onChange={handleColumnsChange}
240
- placeholder="Columns"
241
- multiSelect={true}
242
- showApplyButton={true}
243
- buttonProps={{ className: "al-w-auto" }}
244
- />
245
- );
246
- };
247
-
248
- export const ComboboxAdvancedExample: StoryFn = () => {
249
- const options = [
250
- { value: "react", label: "React" },
251
- { value: "vue", label: "Vue" },
252
- { value: "angular", label: "Angular" },
253
- { value: "svelte", label: "Svelte" },
254
- { value: "nextjs", label: "Next.js" },
255
- { value: "remix", label: "Remix" },
256
- { value: "gatsby", label: "Gatsby" },
257
- { value: "ember", label: "Ember.js" },
258
- ];
259
-
260
- const [singleValue, setSingleValue] = useState("");
261
- const [multiValue, setMultiValue] = useState<string[]>(["react", "vue"]);
262
- const [clearableValue, setClearableValue] = useState("angular");
263
- const [multiClearableValue, setMultiClearableValue] = useState<string[]>(["nextjs", "remix"]);
264
- const [multiApplyValue, setMultiApplyValue] = useState<string[]>(["gatsby", "ember"]);
265
-
266
- return (
267
- <div className="al-flex al-flex-col al-gap-8 al-justify-start al-items-start">
268
- <div className="al-flex al-flex-col al-gap-4">
269
- <h3 className="al-text-lg al-font-medium">Search Placeholders</h3>
270
- <p className="al-text-sm al-text-muted-foreground">Different search placeholder examples</p>
271
-
272
- <div className="al-flex al-flex-col al-gap-2">
273
- <label className="al-text-sm al-font-medium">Default Search Placeholder</label>
274
- <Combobox
275
- options={options}
276
- value={singleValue}
277
- onChange={value => setSingleValue(value as string)}
278
- placeholder="Select framework..."
279
- buttonProps={{ className: "al-w-[250px]" }}
280
- />
281
- </div>
282
-
283
- <div className="al-flex al-flex-col al-gap-2">
284
- <label className="al-text-sm al-font-medium">Custom Search Placeholder</label>
285
- <Combobox
286
- options={options}
287
- value={singleValue}
288
- onChange={value => setSingleValue(value as string)}
289
- placeholder="Select framework..."
290
- searchPlaceholder="Type to find frameworks..."
291
- buttonProps={{ className: "al-w-[250px]" }}
292
- />
293
- </div>
294
-
295
- <div className="al-flex al-flex-col al-gap-2">
296
- <label className="al-text-sm al-font-medium">Empty Search Placeholder</label>
297
- <Combobox
298
- options={options}
299
- value={singleValue}
300
- onChange={value => setSingleValue(value as string)}
301
- placeholder="Select framework..."
302
- searchPlaceholder=""
303
- buttonProps={{ className: "al-w-[250px]" }}
304
- />
305
- </div>
306
- </div>
307
-
308
- <div className="al-flex al-flex-col al-gap-4">
309
- <h3 className="al-text-lg al-font-medium">Clear Button Examples</h3>
310
- <p className="al-text-sm al-text-muted-foreground">
311
- Demonstrating showClearButton prop with different configurations
312
- </p>
313
-
314
- <div className="al-flex al-flex-col al-gap-2">
315
- <label className="al-text-sm al-font-medium">
316
- Single Select - No Clear Button (Default)
317
- </label>
318
- <Combobox
319
- options={options}
320
- value={clearableValue}
321
- onChange={value => setClearableValue(value as string)}
322
- placeholder="Select framework..."
323
- searchPlaceholder="Search frameworks..."
324
- showClearButton={false}
325
- buttonProps={{ className: "al-w-[250px]" }}
326
- />
327
- </div>
328
-
329
- <div className="al-flex al-flex-col al-gap-2">
330
- <label className="al-text-sm al-font-medium">Single Select - With Clear Button</label>
331
- <Combobox
332
- options={options}
333
- value={clearableValue}
334
- onChange={value => setClearableValue(value as string)}
335
- placeholder="Select framework..."
336
- searchPlaceholder="Search frameworks..."
337
- showClearButton={true}
338
- buttonProps={{ className: "al-w-[250px]" }}
339
- />
340
- </div>
341
-
342
- <div className="al-flex al-flex-col al-gap-2">
343
- <label className="al-text-sm al-font-medium">Multi Select - No Clear Button</label>
344
- <Combobox
345
- options={options}
346
- value={multiValue}
347
- onChange={value => setMultiValue(value as string[])}
348
- placeholder="Select frameworks..."
349
- searchPlaceholder="Find your frameworks..."
350
- multiSelect={true}
351
- showClearButton={false}
352
- buttonProps={{ className: "al-w-[250px]" }}
353
- />
354
- <div className="al-text-sm">
355
- Selected: {multiValue.length > 0 ? multiValue.join(", ") : "None"}
356
- </div>
357
- </div>
358
-
359
- <div className="al-flex al-flex-col al-gap-2">
360
- <label className="al-text-sm al-font-medium">Multi Select - With Clear Button</label>
361
- <Combobox
362
- options={options}
363
- value={multiClearableValue}
364
- onChange={value => setMultiClearableValue(value as string[])}
365
- placeholder="Select frameworks..."
366
- searchPlaceholder="Find your frameworks..."
367
- multiSelect={true}
368
- showClearButton={true}
369
- buttonProps={{ className: "al-w-[250px]" }}
370
- />
371
- <div className="al-text-sm">
372
- Selected: {multiClearableValue.length > 0 ? multiClearableValue.join(", ") : "None"}
373
- </div>
374
- </div>
375
-
376
- <div className="al-flex al-flex-col al-gap-2">
377
- <label className="al-text-sm al-font-medium">
378
- Multi Select - With Apply Button & Clear Button
379
- </label>
380
- <Combobox
381
- options={options}
382
- value={multiApplyValue}
383
- onChange={value => setMultiApplyValue(value as string[])}
384
- placeholder="Select frameworks..."
385
- searchPlaceholder="Filter options..."
386
- multiSelect={true}
387
- showApplyButton={true}
388
- showClearButton={true}
389
- buttonProps={{ className: "al-w-[250px]" }}
390
- />
391
- <div className="al-text-sm">
392
- Selected: {multiApplyValue.length > 0 ? multiApplyValue.join(", ") : "None"}
393
- </div>
394
- </div>
395
- </div>
396
- </div>
397
- );
398
- };
399
-
400
- export const ComboboxInfiniteScrollExample: StoryFn = () => {
401
- const [allOptions] = useState(() => {
402
- // Generate a large dataset for demonstration
403
- return Array.from({ length: 1000 }, (_, i) => ({
404
- value: `option-${i + 1}`,
405
- label: `Option ${i + 1}`,
406
- }));
407
- });
408
-
409
- const [displayedOptions, setDisplayedOptions] = useState(() => allOptions.slice(0, 20));
410
- const [hasMore, setHasMore] = useState(true);
411
- const [selectedValue, setSelectedValue] = useState("option-500"); // Pre-select a value not in initial load
412
- const [multiSelectedValue, setMultiSelectedValue] = useState<string[]>([
413
- "option-100",
414
- "option-200",
415
- ]); // Pre-select values not in initial load
416
-
417
- const loadMore = async () => {
418
- if (!hasMore) return;
419
-
420
- // Simulate API call delay
421
- await new Promise(resolve => setTimeout(resolve, 500));
422
-
423
- const currentLength = displayedOptions.length;
424
- const nextBatch = allOptions.slice(currentLength, currentLength + 20);
425
-
426
- if (nextBatch.length === 0) {
427
- setHasMore(false);
428
- } else {
429
- setDisplayedOptions(prev => [...prev, ...nextBatch]);
430
- setHasMore(currentLength + nextBatch.length < allOptions.length);
431
- }
432
- };
433
-
434
- const resetData = () => {
435
- setDisplayedOptions(allOptions.slice(0, 20));
436
- setHasMore(true);
437
- setSelectedValue("");
438
- setMultiSelectedValue([]);
439
- };
440
-
441
- return (
442
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
443
- <div className="al-flex al-flex-col al-gap-2">
444
- <div className="al-flex al-gap-4 al-items-center">
445
- <h3 className="al-text-lg al-font-medium">Infinite Scroll Examples</h3>
446
- <Button onClick={resetData} size="sm" variant="outline">
447
- Reset Data
448
- </Button>
449
- </div>
450
- <p className="al-text-sm al-text-muted-foreground">
451
- Notice how pre-selected values (Option 500, Option 100, Option 200) show proper labels
452
- even though they&apos;re not in the initial 20 options. This demonstrates the valueLabels
453
- prop functionality.
454
- </p>
455
- </div>
456
-
457
- <div className="al-flex al-flex-col al-gap-4">
458
- <div className="al-flex al-flex-col al-gap-2">
459
- <label className="al-text-sm al-font-medium">Single Select with Infinite Scroll</label>
460
- <p className="al-text-xs al-text-muted-foreground">
461
- Showing {displayedOptions.length} of {allOptions.length} options
462
- </p>
463
- <Combobox
464
- options={displayedOptions}
465
- value={selectedValue}
466
- onChange={value => setSelectedValue(value as string)}
467
- placeholder="Select an option..."
468
- onLoadMore={loadMore}
469
- hasMore={hasMore}
470
- valueLabels={{
471
- "option-500": "Option 500",
472
- }}
473
- buttonProps={{ className: "al-w-[250px]" }}
474
- />
475
- </div>
476
-
477
- <div className="al-flex al-flex-col al-gap-2">
478
- <label className="al-text-sm al-font-medium">Multi-Select with Infinite Scroll</label>
479
- <p className="al-text-xs al-text-muted-foreground">
480
- Selected: {multiSelectedValue.length} items
481
- </p>
482
- <Combobox
483
- options={displayedOptions}
484
- value={multiSelectedValue}
485
- onChange={value => setMultiSelectedValue(value as string[])}
486
- placeholder="Select multiple options..."
487
- multiSelect={true}
488
- onLoadMore={loadMore}
489
- hasMore={hasMore}
490
- valueLabels={{
491
- "option-100": "Option 100",
492
- "option-200": "Option 200",
493
- }}
494
- buttonProps={{ className: "al-w-[250px]" }}
495
- />
496
- </div>
497
-
498
- <div className="al-flex al-flex-col al-gap-2">
499
- <label className="al-text-sm al-font-medium">
500
- Standard Combobox (No Infinite Scroll)
501
- </label>
502
- <Combobox
503
- options={displayedOptions.slice(0, 10)}
504
- value="option-5" // Use a value that exists in the first 10 options
505
- onChange={value => setSelectedValue(value as string)}
506
- placeholder="Standard combobox..."
507
- buttonProps={{ className: "al-w-[250px]" }}
508
- />
509
- </div>
510
- </div>
511
- </div>
512
- );
513
- };
514
-
515
- export const ComboboxCallbacksExample: StoryFn = () => {
516
- const options = [
517
- { value: "react", label: "React" },
518
- { value: "vue", label: "Vue" },
519
- { value: "angular", label: "Angular" },
520
- { value: "svelte", label: "Svelte" },
521
- { value: "nextjs", label: "Next.js" },
522
- ];
523
-
524
- const [selectedValue, setSelectedValue] = useState("");
525
- const [isOpen, setIsOpen] = useState(false);
526
- const [openHistory, setOpenHistory] = useState<string[]>([]);
527
-
528
- const handleOpenChange = (open: boolean) => {
529
- setIsOpen(open);
530
- const timestamp = new Date().toLocaleTimeString();
531
- setOpenHistory(prev => [`${timestamp}: ${open ? "opened" : "closed"}`, ...prev.slice(0, 4)]);
532
- };
533
-
534
- const clearHistory = () => {
535
- setOpenHistory([]);
536
- };
537
-
538
- return (
539
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
540
- <div className="al-flex al-gap-4 al-items-center">
541
- <h3 className="al-text-lg al-font-medium">Open/Close Callback Example</h3>
542
- <Button onClick={clearHistory} size="sm" variant="outline">
543
- Clear History
544
- </Button>
545
- </div>
546
-
547
- <div className="al-flex al-flex-col al-gap-4">
548
- <div className="al-flex al-flex-col al-gap-2">
549
- <label className="al-text-sm al-font-medium">Combobox with onOpenChange Callback</label>
550
- <p className="al-text-xs al-text-muted-foreground">
551
- Open and close the combobox to see the callback events
552
- </p>
553
- <Combobox
554
- options={options}
555
- value={selectedValue}
556
- onChange={value => setSelectedValue(value as string)}
557
- placeholder="Select framework..."
558
- onOpenChange={handleOpenChange}
559
- buttonProps={{ className: "al-w-[250px]" }}
560
- />
561
- </div>
562
-
563
- <div className="al-flex al-flex-col al-gap-2">
564
- <label className="al-text-sm al-font-medium">Current State:</label>
565
- <code className="al-text-sm al-bg-muted al-p-2 al-rounded">
566
- Popover is {isOpen ? "open" : "closed"}
567
- </code>
568
- </div>
569
-
570
- {openHistory.length > 0 && (
571
- <div className="al-flex al-flex-col al-gap-2">
572
- <label className="al-text-sm al-font-medium">Open/Close History:</label>
573
- <ul className="al-text-sm al-bg-muted al-p-2 al-rounded al-space-y-1">
574
- {openHistory.map((event, index) => (
575
- <li key={index} className="al-font-mono">
576
- {event}
577
- </li>
578
- ))}
579
- </ul>
580
- </div>
581
- )}
582
- </div>
583
- </div>
584
- );
585
- };
586
-
587
- export const ComboboxCustomNodesExample: StoryFn = () => {
588
- const [singleValue, setSingleValue] = useState("");
589
- const [multiValue, setMultiValue] = useState<string[]>([]);
590
-
591
- // Options with custom node rendering
592
- const optionsWithNodes = [
593
- {
594
- value: "react",
595
- label: "React",
596
- labelNode: (
597
- <div className="al-flex al-items-center al-justify-between al-w-full">
598
- <div className="al-flex al-items-center al-gap-2">
599
- <div className="al-w-4 al-h-4 al-bg-blue-500 al-rounded"></div>
600
- <span>React</span>
601
- </div>
602
- <span className="al-text-xs al-text-muted-foreground">Meta</span>
603
- </div>
604
- ),
605
- },
606
- {
607
- value: "vue",
608
- label: "Vue",
609
- labelNode: (
610
- <div className="al-flex al-items-center al-justify-between al-w-full">
611
- <div className="al-flex al-items-center al-gap-2">
612
- <div className="al-w-4 al-h-4 al-bg-green-500 al-rounded"></div>
613
- <span>Vue.js</span>
614
- </div>
615
- <span className="al-text-xs al-text-muted-foreground">Evan You</span>
616
- </div>
617
- ),
618
- },
619
- {
620
- value: "angular",
621
- label: "Angular",
622
- labelNode: (
623
- <div className="al-flex al-items-center al-justify-between al-w-full">
624
- <div className="al-flex al-items-center al-gap-2">
625
- <div className="al-w-4 al-h-4 al-bg-red-500 al-rounded"></div>
626
- <span>Angular</span>
627
- </div>
628
- <span className="al-text-xs al-text-muted-foreground">Google</span>
629
- </div>
630
- ),
631
- },
632
- {
633
- value: "svelte",
634
- label: "Svelte",
635
- labelNode: (
636
- <div className="al-flex al-items-center al-justify-between al-w-full">
637
- <div className="al-flex al-items-center al-gap-2">
638
- <div className="al-w-4 al-h-4 al-bg-orange-500 al-rounded"></div>
639
- <span>Svelte</span>
640
- </div>
641
- <span className="al-text-xs al-text-muted-foreground">Rich Harris</span>
642
- </div>
643
- ),
644
- },
645
- ];
646
-
647
- // Options with interactive elements
648
- const optionsWithButtons = [
649
- {
650
- value: "typescript",
651
- label: "TypeScript",
652
- labelNode: (
653
- <div className="al-flex al-items-center al-justify-between al-w-full">
654
- <div className="al-flex al-items-center al-gap-2">
655
- <div className="al-w-4 al-h-4 al-bg-blue-600 al-rounded"></div>
656
- <div>
657
- <div className="al-font-medium">TypeScript</div>
658
- <div className="al-text-xs al-text-muted-foreground">Strongly typed JavaScript</div>
659
- </div>
660
- </div>
661
- <button
662
- onClick={e => {
663
- e.stopPropagation();
664
- alert("TypeScript info clicked!");
665
- }}
666
- className="al-text-xs al-px-2 al-py-1 al-bg-blue-100 al-text-blue-700 al-rounded hover:al-bg-blue-200"
667
- >
668
- Info
669
- </button>
670
- </div>
671
- ),
672
- },
673
- {
674
- value: "javascript",
675
- label: "JavaScript",
676
- labelNode: (
677
- <div className="al-flex al-items-center al-justify-between al-w-full">
678
- <div className="al-flex al-items-center al-gap-2">
679
- <div className="al-w-4 al-h-4 al-bg-yellow-500 al-rounded"></div>
680
- <div>
681
- <div className="al-font-medium">JavaScript</div>
682
- <div className="al-text-xs al-text-muted-foreground">Dynamic scripting language</div>
683
- </div>
684
- </div>
685
- <button
686
- onClick={e => {
687
- e.stopPropagation();
688
- alert("JavaScript info clicked!");
689
- }}
690
- className="al-text-xs al-px-2 al-py-1 al-bg-yellow-100 al-text-yellow-700 al-rounded hover:al-bg-yellow-200"
691
- >
692
- Info
693
- </button>
694
- </div>
695
- ),
696
- },
697
- {
698
- value: "python",
699
- label: "Python",
700
- labelNode: (
701
- <div className="al-flex al-items-center al-justify-between al-w-full">
702
- <div className="al-flex al-items-center al-gap-2">
703
- <div className="al-w-4 al-h-4 al-bg-green-600 al-rounded"></div>
704
- <div>
705
- <div className="al-font-medium">Python</div>
706
- <div className="al-text-xs al-text-muted-foreground">
707
- High-level programming language
708
- </div>
709
- </div>
710
- </div>
711
- <button
712
- onClick={e => {
713
- e.stopPropagation();
714
- alert("Python info clicked!");
715
- }}
716
- className="al-text-xs al-px-2 al-py-1 al-bg-green-100 al-text-green-700 al-rounded hover:al-bg-green-200"
717
- >
718
- Info
719
- </button>
720
- </div>
721
- ),
722
- },
723
- ];
724
-
725
- // Mixed options - some with nodes, some without
726
- const mixedOptions = [
727
- { value: "standard1", label: "Standard Option 1" },
728
- {
729
- value: "custom1",
730
- label: "Custom Option 1",
731
- labelNode: (
732
- <div className="al-flex al-items-center al-gap-2">
733
- <div className="al-w-2 al-h-2 al-bg-purple-500 al-rounded-full"></div>
734
- <span className="al-italic">Custom with node</span>
735
- </div>
736
- ),
737
- },
738
- { value: "standard2", label: "Standard Option 2" },
739
- {
740
- value: "custom2",
741
- label: "Custom Option 2",
742
- labelNode: (
743
- <div className="al-flex al-items-center al-gap-2">
744
- <div className="al-w-2 al-h-2 al-bg-pink-500 al-rounded-full"></div>
745
- <span className="al-font-bold">Another custom node</span>
746
- </div>
747
- ),
748
- },
749
- ];
750
-
751
- return (
752
- <div className="al-flex al-flex-col al-gap-8 al-justify-start al-items-start">
753
- <div className="al-flex al-flex-col al-gap-2">
754
- <h3 className="al-text-lg al-font-medium">Custom Node Rendering</h3>
755
- <p className="al-text-sm al-text-muted-foreground">
756
- Use the optional <code>node</code> property to provide custom ReactNode rendering for
757
- dropdown options while keeping <code>label</code> as a string for text operations.
758
- </p>
759
- </div>
760
-
761
- <div className="al-flex al-flex-col al-gap-6">
762
- <div className="al-flex al-flex-col al-gap-4">
763
- <h4 className="al-text-md al-font-medium">Framework Selector with Icons & Authors</h4>
764
- <p className="al-text-sm al-text-muted-foreground">
765
- Custom nodes with colored indicators and author information
766
- </p>
767
-
768
- <div className="al-flex al-flex-col al-gap-2">
769
- <label className="al-text-sm al-font-medium">Single Select</label>
770
- <Combobox
771
- options={optionsWithNodes}
772
- value={singleValue}
773
- onChange={value => setSingleValue(value as string)}
774
- placeholder="Select a framework..."
775
- buttonProps={{ className: "al-w-[300px]" }}
776
- />
777
- <div className="al-text-sm">Selected: {singleValue || "None"}</div>
778
- </div>
779
-
780
- <div className="al-flex al-flex-col al-gap-2">
781
- <label className="al-text-sm al-font-medium">Multi Select</label>
782
- <Combobox
783
- options={optionsWithNodes}
784
- value={multiValue}
785
- onChange={value => setMultiValue(value as string[])}
786
- placeholder="Select frameworks..."
787
- multiSelect={true}
788
- buttonProps={{ className: "al-w-[300px]" }}
789
- />
790
- <div className="al-text-sm">
791
- Selected: {multiValue.length > 0 ? multiValue.join(", ") : "None"}
792
- </div>
793
- </div>
794
- </div>
795
-
796
- <div className="al-flex al-flex-col al-gap-4">
797
- <h4 className="al-text-md al-font-medium">Interactive Elements in Options</h4>
798
- <p className="al-text-sm al-text-muted-foreground">
799
- Options with interactive buttons that can be clicked without selecting the option
800
- </p>
801
-
802
- <div className="al-flex al-flex-col al-gap-2">
803
- <label className="al-text-sm al-font-medium">
804
- Programming Languages with Info Buttons
805
- </label>
806
- <Combobox
807
- options={optionsWithButtons}
808
- value={singleValue}
809
- onChange={value => setSingleValue(value as string)}
810
- placeholder="Select a language..."
811
- buttonProps={{ className: "al-w-[350px]" }}
812
- popoverContentProps={{ className: "al-w-[350px]" }}
813
- />
814
- </div>
815
- </div>
816
-
817
- <div className="al-flex al-flex-col al-gap-4">
818
- <h4 className="al-text-md al-font-medium">Mixed Standard and Custom Options</h4>
819
- <p className="al-text-sm al-text-muted-foreground">
820
- Demonstrating that you can mix standard string labels with custom node rendering
821
- </p>
822
-
823
- <div className="al-flex al-flex-col al-gap-2">
824
- <label className="al-text-sm al-font-medium">Mixed Options</label>
825
- <Combobox
826
- options={mixedOptions}
827
- value={singleValue}
828
- onChange={value => setSingleValue(value as string)}
829
- placeholder="Select an option..."
830
- buttonProps={{ className: "al-w-[250px]" }}
831
- />
832
- <div className="al-text-sm">Selected: {singleValue || "None"}</div>
833
- </div>
834
- </div>
835
- </div>
836
- </div>
837
- );
838
- };
839
-
840
- export const ComboboxPopoverCustomizationExample: StoryFn = () => {
841
- const options = [
842
- { value: "react", label: "React" },
843
- { value: "vue", label: "Vue" },
844
- { value: "angular", label: "Angular" },
845
- { value: "svelte", label: "Svelte" },
846
- { value: "nextjs", label: "Next.js" },
847
- ];
848
-
849
- const [selectedValue1, setSelectedValue1] = useState("");
850
- const [selectedValue2, setSelectedValue2] = useState("");
851
- const [selectedValue3, setSelectedValue3] = useState("");
852
-
853
- return (
854
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
855
- <h3 className="al-text-lg al-font-medium">Popover Customization Examples</h3>
856
-
857
- <div className="al-flex al-flex-col al-gap-4">
858
- <div className="al-flex al-flex-col al-gap-2">
859
- <label className="al-text-sm al-font-medium">Default Popover (Bottom)</label>
860
- <Combobox
861
- options={options}
862
- value={selectedValue1}
863
- onChange={value => setSelectedValue1(value as string)}
864
- placeholder="Default positioning..."
865
- buttonProps={{ className: "al-w-[250px]" }}
866
- />
867
- </div>
868
-
869
- <div className="al-flex al-flex-col al-gap-2">
870
- <label className="al-text-sm al-font-medium">
871
- Right Side Popover (with right chevron)
872
- </label>
873
- <Combobox
874
- options={options}
875
- value={selectedValue2}
876
- onChange={value => setSelectedValue2(value as string)}
877
- placeholder="Right side popover..."
878
- popoverContentProps={{ side: "right" }}
879
- buttonProps={{ className: "al-w-[250px]" }}
880
- />
881
- </div>
882
-
883
- <div className="al-flex al-flex-col al-gap-2">
884
- <label className="al-text-sm al-font-medium">Custom Styled Popover</label>
885
- <p className="al-text-xs al-text-muted-foreground">
886
- Popover with custom styling and wider width
887
- </p>
888
- <Combobox
889
- options={options}
890
- value={selectedValue3}
891
- onChange={value => setSelectedValue3(value as string)}
892
- placeholder="Custom styled popover..."
893
- popoverContentProps={{
894
- className: "al-w-[350px] al-border-2 al-border-blue-200",
895
- side: "top",
896
- }}
897
- buttonProps={{ className: "al-w-[250px]" }}
898
- />
899
- </div>
900
- </div>
901
- </div>
902
- );
903
- };
904
-
905
- export const ComboboxValidationExample: StoryFn = () => {
906
- const options = [
907
- { value: "databases", label: "Databases" },
908
- { value: "api", label: "API" },
909
- { value: "frontend", label: "Frontend" },
910
- { value: "backend", label: "Backend" },
911
- { value: "devops", label: "DevOps" },
912
- { value: "mobile", label: "Mobile" },
913
- ];
914
-
915
- const [selectedValue, setSelectedValue] = useState<string[]>(["databases"]);
916
- const [selectedValueWithoutValidation, setSelectedValueWithoutValidation] = useState<string[]>(
917
- []
918
- );
919
-
920
- return (
921
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
922
- <div className="al-flex al-flex-col al-gap-2">
923
- <h3 className="al-text-lg al-font-medium">Validation Examples</h3>
924
- <p className="al-text-sm al-text-muted-foreground">
925
- Demonstrating the disableAllDeselect prop for preventing empty selections
926
- </p>
927
- </div>
928
-
929
- <div className="al-flex al-flex-col al-gap-6">
930
- <div className="al-flex al-flex-col al-gap-2">
931
- <label className="al-text-sm al-font-medium">
932
- With Validation (disableAllDeselect=true)
933
- </label>
934
- <p className="al-text-xs al-text-muted-foreground">
935
- Try to deselect all items and click Apply - you&apos;ll see a warning message
936
- </p>
937
- <Combobox
938
- options={options}
939
- value={selectedValue}
940
- onChange={value => setSelectedValue(value as string[])}
941
- placeholder="Select at least one skill..."
942
- multiSelect={true}
943
- showApplyButton={true}
944
- showClearButton={true}
945
- disableAllDeselect={true}
946
- buttonProps={{ className: "al-w-[300px]" }}
947
- />
948
- <div className="al-text-sm">
949
- Selected: {selectedValue.length > 0 ? selectedValue.join(", ") : "None"}
950
- </div>
951
- </div>
952
-
953
- <div className="al-flex al-flex-col al-gap-2">
954
- <label className="al-text-sm al-font-medium">
955
- Without Validation (disableAllDeselect=false)
956
- </label>
957
- <p className="al-text-xs al-text-muted-foreground">
958
- You can deselect all items and apply with an empty selection
959
- </p>
960
- <Combobox
961
- options={options}
962
- value={selectedValueWithoutValidation}
963
- onChange={value => setSelectedValueWithoutValidation(value as string[])}
964
- placeholder="Select skills (optional)..."
965
- multiSelect={true}
966
- showApplyButton={true}
967
- showClearButton={true}
968
- disableAllDeselect={false}
969
- buttonProps={{ className: "al-w-[300px]" }}
970
- />
971
- <div className="al-text-sm">
972
- Selected:{" "}
973
- {selectedValueWithoutValidation.length > 0
974
- ? selectedValueWithoutValidation.join(", ")
975
- : "None"}
976
- </div>
977
- </div>
978
- </div>
979
- </div>
980
- );
981
- };
982
-
983
- export const ComboboxDebouncedSearchExample: StoryFn = () => {
984
- const allOptions = [
985
- { value: "javascript", label: "JavaScript" },
986
- { value: "typescript", label: "TypeScript" },
987
- { value: "python", label: "Python" },
988
- { value: "java", label: "Java" },
989
- { value: "csharp", label: "C#" },
990
- { value: "cpp", label: "C++" },
991
- { value: "go", label: "Go" },
992
- { value: "rust", label: "Rust" },
993
- { value: "php", label: "PHP" },
994
- { value: "ruby", label: "Ruby" },
995
- { value: "swift", label: "Swift" },
996
- { value: "kotlin", label: "Kotlin" },
997
- ];
998
-
999
- const [selectedValue, setSelectedValue] = useState("");
1000
- const [filteredOptions, setFilteredOptions] = useState(allOptions);
1001
- const [searchHistory, setSearchHistory] = useState<string[]>([]);
1002
-
1003
- const clearHistory = () => {
1004
- setSearchHistory([]);
1005
- setFilteredOptions(allOptions);
1006
- };
1007
-
1008
- return (
1009
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
1010
- <div className="al-flex al-gap-4 al-items-center">
1011
- <h3 className="al-text-lg al-font-medium">Debounced Search Example</h3>
1012
- <Button onClick={clearHistory} size="sm" variant="outline">
1013
- Clear History
1014
- </Button>
1015
- </div>
1016
-
1017
- <div className="al-flex al-flex-col al-gap-4">
1018
- <div className="al-flex al-flex-col al-gap-2">
1019
- <label className="al-text-sm al-font-medium">Search with Default Debounce (300ms)</label>
1020
- <p className="al-text-xs al-text-muted-foreground">
1021
- Type quickly to see how the search is debounced. The search function will only be called
1022
- 300ms after you stop typing.
1023
- </p>
1024
- <Combobox
1025
- options={filteredOptions}
1026
- value={selectedValue}
1027
- onChange={value => setSelectedValue(value as string)}
1028
- placeholder="Search programming languages..."
1029
- searchPlaceholder="Type to search languages..."
1030
- buttonProps={{ className: "al-w-[300px]" }}
1031
- />
1032
- <div className="al-text-sm">
1033
- Showing {filteredOptions.length} of {allOptions.length} languages
1034
- </div>
1035
- </div>
1036
-
1037
- {searchHistory.length > 0 && (
1038
- <div className="al-flex al-flex-col al-gap-2">
1039
- <label className="al-text-sm al-font-medium">Search History (Last 10 calls):</label>
1040
- <ul className="al-text-xs al-bg-muted al-p-2 al-rounded al-space-y-1 al-max-h-40 al-overflow-y-auto">
1041
- {searchHistory.map((entry, index) => (
1042
- <li key={index} className="al-font-mono">
1043
- {entry}
1044
- </li>
1045
- ))}
1046
- </ul>
1047
- </div>
1048
- )}
1049
- </div>
1050
- </div>
1051
- );
1052
- };
1053
-
1054
- export const ComboboxFilterDropdownCompatibilityExample: StoryFn = () => {
1055
- const tagOptions = [
1056
- { value: "urgent", label: "Urgent" },
1057
- { value: "bug", label: "Bug" },
1058
- { value: "feature", label: "Feature" },
1059
- { value: "enhancement", label: "Enhancement" },
1060
- { value: "documentation", label: "Documentation" },
1061
- { value: "question", label: "Question" },
1062
- { value: "duplicate", label: "Duplicate" },
1063
- { value: "wontfix", label: "Won't Fix" },
1064
- ];
1065
-
1066
- const [selectedTags, setSelectedTags] = useState<string[]>(["urgent", "bug"]);
1067
- const [requiredTags, setRequiredTags] = useState<string[]>(["urgent"]);
1068
-
1069
- return (
1070
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
1071
- <div className="al-flex al-flex-col al-gap-2">
1072
- <h3 className="al-text-lg al-font-medium">FilterDropdown Compatibility</h3>
1073
- <p className="al-text-sm al-text-muted-foreground">
1074
- Demonstrating all FilterDropdown features: debounced search, validation, apply button, and
1075
- clear functionality
1076
- </p>
1077
- </div>
1078
-
1079
- <div className="al-flex al-flex-col al-gap-6">
1080
- <div className="al-flex al-flex-col al-gap-2">
1081
- <label className="al-text-sm al-font-medium">Full Feature Set</label>
1082
- <p className="al-text-xs al-text-muted-foreground">
1083
- Multi-select with apply button, clear button, debounced search, and validation
1084
- </p>
1085
- <Combobox
1086
- options={tagOptions}
1087
- value={selectedTags}
1088
- onChange={value => setSelectedTags(value as string[])}
1089
- placeholder="Select tags..."
1090
- searchPlaceholder="Search tags..."
1091
- multiSelect={true}
1092
- showApplyButton={true}
1093
- showClearButton={true}
1094
- disableAllDeselect={false}
1095
- buttonProps={{ className: "al-w-[300px]" }}
1096
- />
1097
- <div className="al-text-sm">
1098
- Selected tags: {selectedTags.length > 0 ? selectedTags.join(", ") : "None"}
1099
- </div>
1100
- </div>
1101
-
1102
- <div className="al-flex al-flex-col al-gap-2">
1103
- <label className="al-text-sm al-font-medium">
1104
- Required Tags (disableAllDeselect=true)
1105
- </label>
1106
- <p className="al-text-xs al-text-muted-foreground">
1107
- At least one tag must always be selected. Try to deselect all and apply.
1108
- </p>
1109
- <Combobox
1110
- options={tagOptions}
1111
- value={requiredTags}
1112
- onChange={value => setRequiredTags(value as string[])}
1113
- placeholder="Select required tags..."
1114
- searchPlaceholder="Find tags..."
1115
- multiSelect={true}
1116
- showApplyButton={true}
1117
- showClearButton={true}
1118
- disableAllDeselect={true}
1119
- buttonProps={{ className: "al-w-[300px]" }}
1120
- />
1121
- <div className="al-text-sm">
1122
- Required tags: {requiredTags.length > 0 ? requiredTags.join(", ") : "None"}
1123
- </div>
1124
- </div>
1125
- </div>
1126
- </div>
1127
- );
1128
- };
1129
-
1130
- export const ComboboxHierarchicalExample: StoryFn = () => {
1131
- const [selectedDepartment, setSelectedDepartment] = useState("");
1132
- const [selectedMultiDepartment, setSelectedMultiDepartment] = useState<string[]>([]);
1133
- const [hierarchicalSelection, setHierarchicalSelection] = useState<{
1134
- value: string;
1135
- label: string;
1136
- parent?: { value: string; label: string };
1137
- } | null>(null);
1138
-
1139
- // Helper function to handle hierarchical selection
1140
- const handleHierarchicalSelect = (value: string, parentValue: string, parentLabel: string) => {
1141
- // Update single select state
1142
- setSelectedDepartment(value);
1143
- setHierarchicalSelection({
1144
- value,
1145
- label:
1146
- departmentOptions.find(opt => opt.nestedLabels?.[value])?.nestedLabels?.[value] || value,
1147
- parent: { value: parentValue, label: parentLabel },
1148
- });
1149
-
1150
- // Also update multi-select state (toggle the value) since no apply button
1151
- setSelectedMultiDepartment(prev => {
1152
- if (prev.includes(value)) {
1153
- return prev.filter(v => v !== value);
1154
- } else {
1155
- return [...prev, value];
1156
- }
1157
- });
1158
- };
1159
-
1160
- // Helper function to get the selected value for a nested combobox
1161
- const getNestedValue = (parentValue: string): string => {
1162
- const parentOption = departmentOptions.find(opt => opt.value === parentValue);
1163
- if (parentOption?.nestedLabels && selectedDepartment in parentOption.nestedLabels) {
1164
- return selectedDepartment;
1165
- }
1166
- return "";
1167
- };
1168
-
1169
- // Hierarchical options with subcomponents for single select
1170
- const departmentOptions: ComboboxOption[] = [
1171
- {
1172
- value: "engineering",
1173
- label: "Engineering",
1174
- nestedLabels: {
1175
- frontend: "Frontend",
1176
- backend: "Backend",
1177
- devops: "DevOps",
1178
- mobile: "Mobile",
1179
- },
1180
- children: (close: () => void) => (
1181
- <div className="al-flex al-flex-col al-gap-2">
1182
- <h4 className="al-font-medium al-text-sm">Engineering Teams</h4>
1183
- <div className="al-grid al-grid-cols-2 al-gap-2">
1184
- <Button
1185
- size="sm"
1186
- variant="outline"
1187
- onClick={() => {
1188
- handleHierarchicalSelect("frontend", "engineering", "Engineering");
1189
- close();
1190
- }}
1191
- >
1192
- Frontend
1193
- </Button>
1194
- <Button
1195
- size="sm"
1196
- variant="outline"
1197
- onClick={() => {
1198
- handleHierarchicalSelect("backend", "engineering", "Engineering");
1199
- close();
1200
- }}
1201
- >
1202
- Backend
1203
- </Button>
1204
- <Button
1205
- size="sm"
1206
- variant="outline"
1207
- onClick={() => {
1208
- handleHierarchicalSelect("devops", "engineering", "Engineering");
1209
- close();
1210
- }}
1211
- >
1212
- DevOps
1213
- </Button>
1214
- <Button
1215
- size="sm"
1216
- variant="outline"
1217
- onClick={() => {
1218
- handleHierarchicalSelect("mobile", "engineering", "Engineering");
1219
- close();
1220
- }}
1221
- >
1222
- Mobile
1223
- </Button>
1224
- </div>
1225
- <div className="al-text-xs al-text-muted-foreground al-mt-2">
1226
- Click a team to select and close
1227
- </div>
1228
- </div>
1229
- ),
1230
- },
1231
- {
1232
- value: "design",
1233
- label: "Design",
1234
- nestedLabels: {
1235
- "ux-design": "UX Designer",
1236
- "ui-design": "UI Designer",
1237
- "product-design": "Product Designer",
1238
- },
1239
- children: (close: () => void) => (
1240
- <div className="al-flex al-flex-col al-gap-2">
1241
- <h4 className="al-font-medium al-text-sm">Design Roles</h4>
1242
- <div className="al-space-y-1">
1243
- <Button
1244
- size="sm"
1245
- variant="ghost"
1246
- className="al-w-full al-justify-start"
1247
- onClick={() => {
1248
- handleHierarchicalSelect("ux-design", "design", "Design");
1249
- close();
1250
- }}
1251
- >
1252
- UX Designer
1253
- </Button>
1254
- <Button
1255
- size="sm"
1256
- variant="ghost"
1257
- className="al-w-full al-justify-start"
1258
- onClick={() => {
1259
- handleHierarchicalSelect("ui-design", "design", "Design");
1260
- close();
1261
- }}
1262
- >
1263
- UI Designer
1264
- </Button>
1265
- <Button
1266
- size="sm"
1267
- variant="ghost"
1268
- className="al-w-full al-justify-start"
1269
- onClick={() => {
1270
- handleHierarchicalSelect("product-design", "design", "Design");
1271
- close();
1272
- }}
1273
- >
1274
- Product Designer
1275
- </Button>
1276
- </div>
1277
- </div>
1278
- ),
1279
- },
1280
- {
1281
- value: "marketing",
1282
- label: "Marketing",
1283
- nestedLabels: {
1284
- content: "Content Marketing",
1285
- social: "Social Media",
1286
- email: "Email Marketing",
1287
- seo: "SEO/SEM",
1288
- },
1289
- children: (close: () => void) => (
1290
- <div className="al-flex al-flex-col al-gap-2">
1291
- <h4 className="al-font-medium al-text-sm">Marketing Channels</h4>
1292
- <Combobox
1293
- options={[
1294
- { value: "content", label: "Content Marketing" },
1295
- { value: "social", label: "Social Media" },
1296
- { value: "email", label: "Email Marketing" },
1297
- { value: "seo", label: "SEO/SEM" },
1298
- ]}
1299
- value={getNestedValue("marketing")}
1300
- onChange={value => {
1301
- handleHierarchicalSelect(value as string, "marketing", "Marketing");
1302
- close();
1303
- }}
1304
- placeholder="Select marketing area..."
1305
- buttonProps={{ className: "al-w-full" }}
1306
- />
1307
- <div className="al-text-xs al-text-muted-foreground">
1308
- Nested combobox for marketing specializations
1309
- </div>
1310
- </div>
1311
- ),
1312
- },
1313
- {
1314
- value: "sales",
1315
- label: "Sales",
1316
- // No subComponent - regular option
1317
- },
1318
- {
1319
- value: "hr",
1320
- label: "Human Resources",
1321
- // No subComponent - regular option
1322
- },
1323
- ];
1324
-
1325
- return (
1326
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
1327
- <div className="al-flex al-flex-col al-gap-2">
1328
- <h3 className="al-text-lg al-font-medium">Hierarchical Options</h3>
1329
- <p className="al-text-sm al-text-muted-foreground">
1330
- NEW FEATURE: Options with subComponent show a chevron and display nested content on hover.
1331
- Mix hierarchical and regular options freely.
1332
- </p>
1333
- </div>
1334
-
1335
- <div className="al-flex al-flex-col al-gap-6">
1336
- <div className="al-flex al-flex-col al-gap-2">
1337
- <label className="al-text-sm al-font-medium">Department Selection (Single)</label>
1338
- <p className="al-text-xs al-text-muted-foreground">
1339
- Hover over Engineering, Design, or Marketing to see subcomponents. Sales and HR are
1340
- regular options.
1341
- </p>
1342
- <Combobox
1343
- options={departmentOptions}
1344
- value={selectedDepartment}
1345
- onChange={value => setSelectedDepartment(value as string)}
1346
- placeholder="Select department..."
1347
- searchPlaceholder="Search departments..."
1348
- hoverDelayMs={200}
1349
- buttonProps={{ className: "al-w-[300px]" }}
1350
- />
1351
- <div className="al-text-sm">Selected: {selectedDepartment || "None"}</div>
1352
- {hierarchicalSelection && (
1353
- <div className="al-text-sm al-bg-blue-50 al-p-2 al-rounded">
1354
- <strong>Hierarchical Selection:</strong>
1355
- <br />
1356
- Value: {hierarchicalSelection.value}
1357
- <br />
1358
- Label: {hierarchicalSelection.label}
1359
- <br />
1360
- {hierarchicalSelection.parent && (
1361
- <>
1362
- Parent: {hierarchicalSelection.parent.label} ({hierarchicalSelection.parent.value}
1363
- )
1364
- </>
1365
- )}
1366
- </div>
1367
- )}
1368
- </div>
1369
-
1370
- <div className="al-flex al-flex-col al-gap-2">
1371
- <label className="al-text-sm al-font-medium">Department Selection (Multi-Select)</label>
1372
- <p className="al-text-xs al-text-muted-foreground">
1373
- Multi-select mode also supports hierarchical options. Regular options (Sales/HR) can be
1374
- selected from dropdown, hierarchical options (Engineering/Design/Marketing) show nested
1375
- selections on hover.
1376
- </p>
1377
- <Combobox
1378
- options={departmentOptions}
1379
- value={selectedMultiDepartment}
1380
- onChange={value => setSelectedMultiDepartment(value as string[])}
1381
- placeholder="Select departments..."
1382
- searchPlaceholder="Search departments..."
1383
- multiSelect={true}
1384
- showApplyButton={false}
1385
- hoverDelayMs={300}
1386
- buttonProps={{ className: "al-w-[300px]" }}
1387
- />
1388
- <div className="al-text-sm">
1389
- Selected:{" "}
1390
- {selectedMultiDepartment.length > 0 ? selectedMultiDepartment.join(", ") : "None"}
1391
- </div>
1392
- </div>
1393
- </div>
1394
- </div>
1395
- );
1396
- };
1397
-
1398
- export const ComboboxEnhancedAsyncExample: StoryFn = () => {
1399
- const [selectedValue, setSelectedValue] = useState("");
1400
- const [multiSelectedValue, setMultiSelectedValue] = useState<string[]>([]);
1401
- const [displayedOptions, setDisplayedOptions] = useState<Array<{ value: string; label: string }>>(
1402
- []
1403
- );
1404
- const [hasMore, setHasMore] = useState(true);
1405
- const [currentPage, setCurrentPage] = useState(1);
1406
- const [currentSearch, setCurrentSearch] = useState("");
1407
-
1408
- // Simulate API data
1409
- const generateApiData = (search: string = "", page: number = 1) => {
1410
- const allItems = Array.from({ length: 100 }, (_, i) => ({
1411
- value: `item-${i + 1}`,
1412
- label: `${search ? "Filtered " : ""}API Item ${i + 1}`,
1413
- }));
1414
-
1415
- const filteredItems = search
1416
- ? allItems.filter(item => item.label.toLowerCase().includes(search.toLowerCase()))
1417
- : allItems;
1418
-
1419
- const startIndex = (page - 1) * 20;
1420
- const endIndex = startIndex + 20;
1421
- const pageItems = filteredItems.slice(startIndex, endIndex);
1422
-
1423
- return {
1424
- items: pageItems,
1425
- hasMore: endIndex < filteredItems.length,
1426
- total: filteredItems.length,
1427
- page,
1428
- };
1429
- };
1430
-
1431
- const handleLoadMore = useCallback(async (searchValue?: string, page?: number) => {
1432
- // Simulate API delay
1433
- await new Promise(resolve => setTimeout(resolve, 800));
1434
-
1435
- const isNewSearch = searchValue !== currentSearch;
1436
- const targetPage = page || (isNewSearch ? 1 : currentPage + 1);
1437
-
1438
- const result = generateApiData(searchValue || "", targetPage);
1439
-
1440
- if (isNewSearch || targetPage === 1) {
1441
- setDisplayedOptions(result.items);
1442
- } else {
1443
- setDisplayedOptions(prev => [...prev, ...result.items]);
1444
- }
1445
-
1446
- setHasMore(result.hasMore);
1447
- setCurrentPage(targetPage);
1448
- setCurrentSearch(searchValue || "");
1449
- // eslint-disable-next-line react-hooks/exhaustive-deps
1450
- }, []);
1451
-
1452
- const handlePageReset = () => {
1453
- setDisplayedOptions([]);
1454
- setCurrentPage(1);
1455
- setHasMore(true);
1456
- };
1457
-
1458
- const resetDemo = () => {
1459
- setSelectedValue("");
1460
- setMultiSelectedValue([]);
1461
- setDisplayedOptions([]);
1462
- setCurrentPage(1);
1463
- setCurrentSearch("");
1464
- setHasMore(true);
1465
- };
1466
-
1467
- return (
1468
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
1469
- <div className="al-flex al-gap-4 al-items-center">
1470
- <h3 className="al-text-lg al-font-medium">Enhanced Async Loading</h3>
1471
- <Button onClick={resetDemo} size="sm" variant="outline">
1472
- Reset Demo
1473
- </Button>
1474
- </div>
1475
-
1476
- <div className="al-flex al-flex-col al-gap-2">
1477
- <p className="al-text-sm al-text-muted-foreground">
1478
- NEW FEATURES: Enhanced onLoadMore with search and page parameters, automatic page
1479
- management, debounced search with page reset, and improved loading states.
1480
- </p>
1481
- <div className="al-text-xs al-bg-blue-50 al-p-2 al-rounded">
1482
- <strong>Try this:</strong> Open dropdown → scroll to load more → search → see how
1483
- pagination resets → search again
1484
- </div>
1485
- </div>
1486
-
1487
- <div className="al-flex al-flex-col al-gap-6">
1488
- <div className="al-flex al-flex-col al-gap-2">
1489
- <label className="al-text-sm al-font-medium">Single Select with Enhanced Async</label>
1490
- <p className="al-text-xs al-text-muted-foreground">
1491
- Page: {currentPage} | Showing: {displayedOptions.length} items | Search: &quot;
1492
- {currentSearch}&quot; | Has more: {hasMore ? "Yes" : "No"}
1493
- </p>
1494
- <Combobox
1495
- options={displayedOptions}
1496
- value={selectedValue}
1497
- onChange={value => setSelectedValue(value as string)}
1498
- placeholder="Select item..."
1499
- searchPlaceholder="Search items (debounced)..."
1500
- onLoadMore={handleLoadMore}
1501
- hasMore={hasMore}
1502
- onPageReset={handlePageReset}
1503
- buttonProps={{ className: "al-w-[300px]" }}
1504
- />
1505
- <div className="al-text-sm">Selected: {selectedValue || "None"}</div>
1506
- </div>
1507
-
1508
- <div className="al-flex al-flex-col al-gap-2">
1509
- <label className="al-text-sm al-font-medium">Multi-Select with Enhanced Async</label>
1510
- <p className="al-text-xs al-text-muted-foreground">
1511
- Multi-select mode with apply button and async loading
1512
- </p>
1513
- <Combobox
1514
- options={displayedOptions}
1515
- value={multiSelectedValue}
1516
- onChange={value => setMultiSelectedValue(value as string[])}
1517
- placeholder="Select multiple items..."
1518
- searchPlaceholder="Search and select..."
1519
- multiSelect={true}
1520
- showApplyButton={true}
1521
- onLoadMore={handleLoadMore}
1522
- hasMore={hasMore}
1523
- onPageReset={handlePageReset}
1524
- buttonProps={{ className: "al-w-[300px]" }}
1525
- />
1526
- <div className="al-text-sm">
1527
- Selected: {multiSelectedValue.length} items{" "}
1528
- {multiSelectedValue.length > 0 &&
1529
- `(${multiSelectedValue.slice(0, 3).join(", ")}${multiSelectedValue.length > 3 ? "..." : ""})`}
1530
- </div>
1531
- </div>
1532
- </div>
1533
- </div>
1534
- );
1535
- };
1536
-
1537
- export const ComboboxSheetIntegrationExample: StoryFn = () => {
1538
- const [isSheetOpen, setIsSheetOpen] = useState(false);
1539
- const [selectedValue, setSelectedValue] = useState("");
1540
- const [multiSelectedValue, setSelectedMultiValue] = useState<string[]>([]);
1541
-
1542
- const options = [
1543
- { value: "react", label: "React" },
1544
- { value: "vue", label: "Vue" },
1545
- { value: "angular", label: "Angular" },
1546
- { value: "svelte", label: "Svelte" },
1547
- { value: "nextjs", label: "Next.js" },
1548
- { value: "remix", label: "Remix" },
1549
- { value: "gatsby", label: "Gatsby" },
1550
- { value: "ember", label: "Ember.js" },
1551
- { value: "solid", label: "Solid.js" },
1552
- { value: "qwik", label: "Qwik" },
1553
- { value: "alpine", label: "Alpine.js" },
1554
- { value: "lit", label: "Lit" },
1555
- ];
1556
-
1557
- return (
1558
- <div className="al-flex al-flex-col al-gap-6 al-justify-start al-items-start">
1559
- <div className="al-flex al-flex-col al-gap-2">
1560
- <h3 className="al-text-lg al-font-medium">Sheet Integration</h3>
1561
- <p className="al-text-sm al-text-muted-foreground">
1562
- BUG FIX: Fixed scrolling issues when Combobox is used inside Sheet components. Added
1563
- onWheel stopPropagation to prevent scroll conflicts.
1564
- </p>
1565
- </div>
1566
-
1567
- <Button onClick={() => setIsSheetOpen(true)}>Open Sheet with Combobox</Button>
1568
-
1569
- {/* Note: This is a simulated sheet for the story. In real usage, you'd use the actual Sheet component */}
1570
- {isSheetOpen && (
1571
- <div className="al-fixed al-inset-0 al-bg-black/50 al-z-50 al-flex al-items-center al-justify-center">
1572
- <div className="al-bg-white al-rounded-lg al-p-6 al-w-[500px] al-max-h-[80vh] al-overflow-y-auto">
1573
- <div className="al-flex al-justify-between al-items-center al-mb-4">
1574
- <h4 className="al-text-lg al-font-medium">Sheet with Combobox</h4>
1575
- <Button variant="ghost" size="sm" onClick={() => setIsSheetOpen(false)}>
1576
-
1577
- </Button>
1578
- </div>
1579
-
1580
- <div className="al-space-y-4">
1581
- <div className="al-text-sm al-text-muted-foreground">
1582
- Try scrolling in the combobox dropdown - it should work properly now!
1583
- </div>
1584
-
1585
- <div className="al-flex al-flex-col al-gap-2">
1586
- <label className="al-text-sm al-font-medium">Single Select in Sheet</label>
1587
- <Combobox
1588
- options={options}
1589
- value={selectedValue}
1590
- onChange={value => setSelectedValue(value as string)}
1591
- placeholder="Select framework..."
1592
- searchPlaceholder="Search frameworks..."
1593
- buttonProps={{ className: "al-w-full" }}
1594
- />
1595
- <div className="al-text-xs">Selected: {selectedValue || "None"}</div>
1596
- </div>
1597
-
1598
- <div className="al-flex al-flex-col al-gap-2">
1599
- <label className="al-text-sm al-font-medium">Multi-Select in Sheet</label>
1600
- <Combobox
1601
- options={options}
1602
- value={multiSelectedValue}
1603
- onChange={value => setSelectedMultiValue(value as string[])}
1604
- placeholder="Select frameworks..."
1605
- searchPlaceholder="Search frameworks..."
1606
- multiSelect={true}
1607
- showApplyButton={true}
1608
- buttonProps={{ className: "al-w-full" }}
1609
- />
1610
- <div className="al-text-xs">
1611
- Selected: {multiSelectedValue.length > 0 ? multiSelectedValue.join(", ") : "None"}
1612
- </div>
1613
- </div>
1614
-
1615
- <div className="al-text-xs al-text-muted-foreground al-bg-green-50 al-p-2 al-rounded">
1616
- ✅ Mouse wheel scrolling now works properly in both comboboxes!
1617
- </div>
1618
- </div>
1619
- </div>
1620
- </div>
1621
- )}
1622
-
1623
- <div className="al-text-sm">
1624
- Selected in sheet: {selectedValue || "None"} | Multi:{" "}
1625
- {multiSelectedValue.join(", ") || "None"}
1626
- </div>
1627
- </div>
1628
- );
1629
- };