@knocklabs/react 0.12.1 → 0.13.1

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 (335) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/cjs/_virtual/_rolldown/runtime.js +1 -0
  3. package/dist/cjs/index.css +1 -1
  4. package/dist/cjs/index.js +1 -2
  5. package/dist/cjs/modules/core/components/Button/Button.js +2 -2
  6. package/dist/cjs/modules/core/components/Button/Button.js.map +1 -1
  7. package/dist/cjs/modules/core/components/Button/ButtonGroup.js +2 -2
  8. package/dist/cjs/modules/core/components/Button/ButtonGroup.js.map +1 -1
  9. package/dist/cjs/modules/core/components/Button/ButtonSpinner.js +2 -2
  10. package/dist/cjs/modules/core/components/Button/ButtonSpinner.js.map +1 -1
  11. package/dist/cjs/modules/core/components/Button/index.js +1 -0
  12. package/dist/cjs/modules/core/components/Icons/Bell.js +2 -2
  13. package/dist/cjs/modules/core/components/Icons/Bell.js.map +1 -1
  14. package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js +2 -2
  15. package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js.map +1 -1
  16. package/dist/cjs/modules/core/components/Icons/ChevronDown.js +2 -2
  17. package/dist/cjs/modules/core/components/Icons/ChevronDown.js.map +1 -1
  18. package/dist/cjs/modules/core/components/Icons/CloseCircle.js +2 -2
  19. package/dist/cjs/modules/core/components/Icons/CloseCircle.js.map +1 -1
  20. package/dist/cjs/modules/core/components/Icons/index.js +1 -0
  21. package/dist/cjs/modules/core/components/Spinner/Spinner.js +3 -3
  22. package/dist/cjs/modules/core/components/Spinner/Spinner.js.map +1 -1
  23. package/dist/cjs/modules/core/components/Spinner/index.js +1 -0
  24. package/dist/cjs/modules/core/cx/index.js +2 -2
  25. package/dist/cjs/modules/core/cx/index.js.map +1 -1
  26. package/dist/cjs/modules/core/debounce/index.js +2 -2
  27. package/dist/cjs/modules/core/debounce/index.js.map +1 -1
  28. package/dist/cjs/modules/core/hooks/index.js +1 -0
  29. package/dist/cjs/modules/core/hooks/useComponentVisible.js +2 -2
  30. package/dist/cjs/modules/core/hooks/useComponentVisible.js.map +1 -1
  31. package/dist/cjs/modules/core/hooks/useOnBottomScroll.js +2 -2
  32. package/dist/cjs/modules/core/hooks/useOnBottomScroll.js.map +1 -1
  33. package/dist/cjs/modules/core/index.js +1 -0
  34. package/dist/cjs/modules/core/utils.js +2 -2
  35. package/dist/cjs/modules/core/utils.js.map +1 -1
  36. package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js +2 -2
  37. package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js.map +1 -1
  38. package/dist/cjs/modules/feed/components/EmptyFeed/index.js +1 -0
  39. package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js +2 -2
  40. package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js.map +1 -1
  41. package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js +2 -2
  42. package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js.map +1 -1
  43. package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js +2 -2
  44. package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js.map +1 -1
  45. package/dist/cjs/modules/feed/components/NotificationCell/index.js +1 -0
  46. package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js +2 -2
  47. package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js.map +1 -1
  48. package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js +2 -2
  49. package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js.map +1 -1
  50. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js +2 -2
  51. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js.map +1 -1
  52. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js +2 -2
  53. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js.map +1 -1
  54. package/dist/cjs/modules/feed/components/NotificationFeed/index.js +1 -0
  55. package/dist/cjs/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js +2 -2
  56. package/dist/cjs/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.js.map +1 -1
  57. package/dist/cjs/modules/feed/components/NotificationFeedContainer/index.js +1 -0
  58. package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js +2 -2
  59. package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js.map +1 -1
  60. package/dist/cjs/modules/feed/components/NotificationFeedPopover/index.js +1 -0
  61. package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js +2 -2
  62. package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js.map +1 -1
  63. package/dist/cjs/modules/feed/components/NotificationIconButton/index.js +1 -0
  64. package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js +2 -2
  65. package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js.map +1 -1
  66. package/dist/cjs/modules/feed/components/UnseenBadge/index.js +1 -0
  67. package/dist/cjs/modules/feed/index.js +1 -0
  68. package/dist/cjs/modules/guide/components/Banner/Banner.js +2 -2
  69. package/dist/cjs/modules/guide/components/Banner/Banner.js.map +1 -1
  70. package/dist/cjs/modules/guide/components/Banner/index.js +1 -0
  71. package/dist/cjs/modules/guide/components/Card/Card.js +2 -2
  72. package/dist/cjs/modules/guide/components/Card/Card.js.map +1 -1
  73. package/dist/cjs/modules/guide/components/Card/index.js +1 -0
  74. package/dist/cjs/modules/guide/components/Modal/Modal.js +2 -2
  75. package/dist/cjs/modules/guide/components/Modal/Modal.js.map +1 -1
  76. package/dist/cjs/modules/guide/components/Modal/index.js +1 -0
  77. package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js +2 -2
  78. package/dist/cjs/modules/guide/components/Toolbar/KnockButton.js.map +1 -1
  79. package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js +2 -2
  80. package/dist/cjs/modules/guide/components/Toolbar/V2/FocusChin.js.map +1 -1
  81. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js +2 -2
  82. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.js.map +1 -1
  83. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js +2 -2
  84. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideContextDetails.js.map +1 -1
  85. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js +2 -2
  86. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRow.js.map +1 -1
  87. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js +2 -2
  88. package/dist/cjs/modules/guide/components/Toolbar/V2/GuideRowDetails.js.map +1 -1
  89. package/dist/cjs/modules/guide/components/Toolbar/V2/Kbd.js +2 -2
  90. package/dist/cjs/modules/guide/components/Toolbar/V2/Kbd.js.map +1 -1
  91. package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js +2 -2
  92. package/dist/cjs/modules/guide/components/Toolbar/V2/V2.js.map +1 -1
  93. package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js +2 -2
  94. package/dist/cjs/modules/guide/components/Toolbar/V2/helpers.js.map +1 -1
  95. package/dist/cjs/modules/guide/components/Toolbar/V2/index.js +1 -0
  96. package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js +2 -2
  97. package/dist/cjs/modules/guide/components/Toolbar/V2/useDraggable.js.map +1 -1
  98. package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js +2 -2
  99. package/dist/cjs/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.js.map +1 -1
  100. package/dist/cjs/modules/guide/components/Toolbar/index.js +1 -0
  101. package/dist/cjs/modules/guide/components/Toolbar/shared.js +2 -2
  102. package/dist/cjs/modules/guide/components/Toolbar/shared.js.map +1 -1
  103. package/dist/cjs/modules/guide/components/Toolbar/styles.inline.js +2 -0
  104. package/dist/cjs/modules/guide/components/Toolbar/styles.inline.js.map +1 -0
  105. package/dist/cjs/modules/guide/components/Toolbar/useToolbarStyles.js +2 -2
  106. package/dist/cjs/modules/guide/components/Toolbar/useToolbarStyles.js.map +1 -1
  107. package/dist/cjs/modules/guide/components/helpers.js +2 -2
  108. package/dist/cjs/modules/guide/components/helpers.js.map +1 -1
  109. package/dist/cjs/modules/guide/components/index.js +1 -0
  110. package/dist/cjs/modules/guide/index.js +1 -0
  111. package/dist/cjs/modules/guide/providers/KnockGuideProvider.js +2 -2
  112. package/dist/cjs/modules/guide/providers/KnockGuideProvider.js.map +1 -1
  113. package/dist/cjs/modules/guide/providers/index.js +1 -0
  114. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js +2 -2
  115. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.js.map +1 -1
  116. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthButton/index.js +1 -0
  117. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js +2 -2
  118. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.js.map +1 -1
  119. package/dist/cjs/modules/ms-teams/components/MsTeamsAuthContainer/index.js +1 -0
  120. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js +2 -2
  121. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.js.map +1 -1
  122. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.js +2 -2
  123. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.js.map +1 -1
  124. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.js +2 -2
  125. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.js.map +1 -1
  126. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.js +2 -2
  127. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.js.map +1 -1
  128. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.js +2 -2
  129. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.js.map +1 -1
  130. package/dist/cjs/modules/ms-teams/components/MsTeamsChannelCombobox/index.js +1 -0
  131. package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js +2 -2
  132. package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.js.map +1 -1
  133. package/dist/cjs/modules/ms-teams/components/MsTeamsIcon/index.js +1 -0
  134. package/dist/cjs/modules/ms-teams/index.js +1 -0
  135. package/dist/cjs/modules/ms-teams/utils.js +2 -2
  136. package/dist/cjs/modules/ms-teams/utils.js.map +1 -1
  137. package/dist/cjs/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.js +2 -2
  138. package/dist/cjs/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.js.map +1 -1
  139. package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js +2 -2
  140. package/dist/cjs/modules/slack/components/SlackAuthButton/SlackAuthButton.js.map +1 -1
  141. package/dist/cjs/modules/slack/components/SlackAuthButton/index.js +1 -0
  142. package/dist/cjs/modules/slack/components/SlackAuthContainer/SlackAuthContainer.js +2 -2
  143. package/dist/cjs/modules/slack/components/SlackAuthContainer/SlackAuthContainer.js.map +1 -1
  144. package/dist/cjs/modules/slack/components/SlackAuthContainer/index.js +1 -0
  145. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js +2 -2
  146. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.js.map +1 -1
  147. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackConnectionError.js +2 -2
  148. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackConnectionError.js.map +1 -1
  149. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.js +2 -2
  150. package/dist/cjs/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.js.map +1 -1
  151. package/dist/cjs/modules/slack/components/SlackChannelCombobox/index.js +1 -0
  152. package/dist/cjs/modules/slack/components/SlackIcon/SlackIcon.js +2 -2
  153. package/dist/cjs/modules/slack/components/SlackIcon/SlackIcon.js.map +1 -1
  154. package/dist/cjs/modules/slack/components/SlackIcon/index.js +1 -0
  155. package/dist/cjs/modules/slack/index.js +1 -0
  156. package/dist/cjs/modules/slack/utils.js +2 -2
  157. package/dist/cjs/modules/slack/utils.js.map +1 -1
  158. package/dist/cjs/next/KnockGuideLocationSensor.js +2 -2
  159. package/dist/cjs/next/KnockGuideLocationSensor.js.map +1 -1
  160. package/dist/cjs/next.js +1 -2
  161. package/dist/cjs/tanstack/KnockGuideLocationSensor.js +2 -2
  162. package/dist/cjs/tanstack/KnockGuideLocationSensor.js.map +1 -1
  163. package/dist/cjs/tanstack.js +1 -2
  164. package/dist/esm/index.mjs +36 -118
  165. package/dist/esm/modules/core/components/Button/Button.mjs +28 -21
  166. package/dist/esm/modules/core/components/Button/Button.mjs.map +1 -1
  167. package/dist/esm/modules/core/components/Button/ButtonGroup.mjs +11 -9
  168. package/dist/esm/modules/core/components/Button/ButtonGroup.mjs.map +1 -1
  169. package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs +13 -10
  170. package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs.map +1 -1
  171. package/dist/esm/modules/core/components/Button/index.mjs +3 -0
  172. package/dist/esm/modules/core/components/Icons/Bell.mjs +26 -10
  173. package/dist/esm/modules/core/components/Icons/Bell.mjs.map +1 -1
  174. package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs +26 -10
  175. package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs.map +1 -1
  176. package/dist/esm/modules/core/components/Icons/ChevronDown.mjs +21 -10
  177. package/dist/esm/modules/core/components/Icons/ChevronDown.mjs.map +1 -1
  178. package/dist/esm/modules/core/components/Icons/CloseCircle.mjs +18 -10
  179. package/dist/esm/modules/core/components/Icons/CloseCircle.mjs.map +1 -1
  180. package/dist/esm/modules/core/components/Icons/index.mjs +5 -0
  181. package/dist/esm/modules/core/components/Spinner/Spinner.mjs +40 -30
  182. package/dist/esm/modules/core/components/Spinner/Spinner.mjs.map +1 -1
  183. package/dist/esm/modules/core/components/Spinner/index.mjs +2 -0
  184. package/dist/esm/modules/core/cx/index.mjs +6 -5
  185. package/dist/esm/modules/core/cx/index.mjs.map +1 -1
  186. package/dist/esm/modules/core/debounce/index.mjs +14 -14
  187. package/dist/esm/modules/core/debounce/index.mjs.map +1 -1
  188. package/dist/esm/modules/core/hooks/index.mjs +2 -0
  189. package/dist/esm/modules/core/hooks/useComponentVisible.mjs +17 -18
  190. package/dist/esm/modules/core/hooks/useComponentVisible.mjs.map +1 -1
  191. package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs +21 -21
  192. package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs.map +1 -1
  193. package/dist/esm/modules/core/index.mjs +14 -0
  194. package/dist/esm/modules/core/utils.mjs +10 -11
  195. package/dist/esm/modules/core/utils.mjs.map +1 -1
  196. package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs +23 -14
  197. package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs.map +1 -1
  198. package/dist/esm/modules/feed/components/EmptyFeed/index.mjs +2 -0
  199. package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs +42 -40
  200. package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs.map +1 -1
  201. package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs +24 -15
  202. package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs.map +1 -1
  203. package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs +88 -64
  204. package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs.map +1 -1
  205. package/dist/esm/modules/feed/components/NotificationCell/index.mjs +3 -0
  206. package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs +22 -17
  207. package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs.map +1 -1
  208. package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs +26 -21
  209. package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs.map +1 -1
  210. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs +78 -68
  211. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs.map +1 -1
  212. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs +33 -17
  213. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs.map +1 -1
  214. package/dist/esm/modules/feed/components/NotificationFeed/index.mjs +4 -0
  215. package/dist/esm/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs +11 -9
  216. package/dist/esm/modules/feed/components/NotificationFeedContainer/NotificationFeedContainer.mjs.map +1 -1
  217. package/dist/esm/modules/feed/components/NotificationFeedContainer/index.mjs +2 -0
  218. package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs +62 -65
  219. package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs.map +1 -1
  220. package/dist/esm/modules/feed/components/NotificationFeedPopover/index.mjs +2 -0
  221. package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs +22 -17
  222. package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs.map +1 -1
  223. package/dist/esm/modules/feed/components/NotificationIconButton/index.mjs +2 -0
  224. package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs +27 -23
  225. package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs.map +1 -1
  226. package/dist/esm/modules/feed/components/UnseenBadge/index.mjs +2 -0
  227. package/dist/esm/modules/feed/index.mjs +18 -0
  228. package/dist/esm/modules/guide/components/Banner/Banner.mjs +138 -129
  229. package/dist/esm/modules/guide/components/Banner/Banner.mjs.map +1 -1
  230. package/dist/esm/modules/guide/components/Banner/index.mjs +2 -0
  231. package/dist/esm/modules/guide/components/Card/Card.mjs +184 -167
  232. package/dist/esm/modules/guide/components/Card/Card.mjs.map +1 -1
  233. package/dist/esm/modules/guide/components/Card/index.mjs +2 -0
  234. package/dist/esm/modules/guide/components/Modal/Modal.mjs +188 -168
  235. package/dist/esm/modules/guide/components/Modal/Modal.mjs.map +1 -1
  236. package/dist/esm/modules/guide/components/Modal/index.mjs +2 -0
  237. package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs +46 -24
  238. package/dist/esm/modules/guide/components/Toolbar/KnockButton.mjs.map +1 -1
  239. package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs +174 -111
  240. package/dist/esm/modules/guide/components/Toolbar/V2/FocusChin.mjs.map +1 -1
  241. package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs +82 -19
  242. package/dist/esm/modules/guide/components/Toolbar/V2/GuideAnnotatedStatusDot.mjs.map +1 -1
  243. package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs +189 -47
  244. package/dist/esm/modules/guide/components/Toolbar/V2/GuideContextDetails.mjs.map +1 -1
  245. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs +229 -143
  246. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRow.mjs.map +1 -1
  247. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs +180 -68
  248. package/dist/esm/modules/guide/components/Toolbar/V2/GuideRowDetails.mjs.map +1 -1
  249. package/dist/esm/modules/guide/components/Toolbar/V2/Kbd.mjs +17 -14
  250. package/dist/esm/modules/guide/components/Toolbar/V2/Kbd.mjs.map +1 -1
  251. package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs +315 -159
  252. package/dist/esm/modules/guide/components/Toolbar/V2/V2.mjs.map +1 -1
  253. package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs +9 -11
  254. package/dist/esm/modules/guide/components/Toolbar/V2/helpers.mjs.map +1 -1
  255. package/dist/esm/modules/guide/components/Toolbar/V2/index.mjs +2 -0
  256. package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs +66 -74
  257. package/dist/esm/modules/guide/components/Toolbar/V2/useDraggable.mjs.map +1 -1
  258. package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs +136 -192
  259. package/dist/esm/modules/guide/components/Toolbar/V2/useInspectGuideClientStore.mjs.map +1 -1
  260. package/dist/esm/modules/guide/components/Toolbar/index.mjs +3 -0
  261. package/dist/esm/modules/guide/components/Toolbar/shared.mjs +6 -5
  262. package/dist/esm/modules/guide/components/Toolbar/shared.mjs.map +1 -1
  263. package/dist/esm/modules/guide/components/Toolbar/styles.inline.mjs +6 -0
  264. package/dist/esm/modules/guide/components/Toolbar/styles.inline.mjs.map +1 -0
  265. package/dist/esm/modules/guide/components/Toolbar/useToolbarStyles.mjs +13 -12
  266. package/dist/esm/modules/guide/components/Toolbar/useToolbarStyles.mjs.map +1 -1
  267. package/dist/esm/modules/guide/components/helpers.mjs +15 -15
  268. package/dist/esm/modules/guide/components/helpers.mjs.map +1 -1
  269. package/dist/esm/modules/guide/components/index.mjs +9 -0
  270. package/dist/esm/modules/guide/index.mjs +8 -0
  271. package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs +19 -17
  272. package/dist/esm/modules/guide/providers/KnockGuideProvider.mjs.map +1 -1
  273. package/dist/esm/modules/guide/providers/index.mjs +2 -0
  274. package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs +78 -52
  275. package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/MsTeamsAuthButton.mjs.map +1 -1
  276. package/dist/esm/modules/ms-teams/components/MsTeamsAuthButton/index.mjs +2 -0
  277. package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs +33 -16
  278. package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/MsTeamsAuthContainer.mjs.map +1 -1
  279. package/dist/esm/modules/ms-teams/components/MsTeamsAuthContainer/index.mjs +2 -0
  280. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs +60 -28
  281. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelCombobox.mjs.map +1 -1
  282. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.mjs +47 -39
  283. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsChannelInTeamCombobox.mjs.map +1 -1
  284. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.mjs +11 -14
  285. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsConnectionError.mjs.map +1 -1
  286. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.mjs +23 -11
  287. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsErrorMessage.mjs.map +1 -1
  288. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.mjs +41 -33
  289. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/MsTeamsTeamCombobox.mjs.map +1 -1
  290. package/dist/esm/modules/ms-teams/components/MsTeamsChannelCombobox/index.mjs +2 -0
  291. package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs +99 -15
  292. package/dist/esm/modules/ms-teams/components/MsTeamsIcon/MsTeamsIcon.mjs.map +1 -1
  293. package/dist/esm/modules/ms-teams/components/MsTeamsIcon/index.mjs +2 -0
  294. package/dist/esm/modules/ms-teams/index.mjs +7 -0
  295. package/dist/esm/modules/ms-teams/utils.mjs +6 -5
  296. package/dist/esm/modules/ms-teams/utils.mjs.map +1 -1
  297. package/dist/esm/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.mjs +48 -32
  298. package/dist/esm/modules/slack/components/SlackAddChannelInput/SlackAddChannelInput.mjs.map +1 -1
  299. package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs +82 -58
  300. package/dist/esm/modules/slack/components/SlackAuthButton/SlackAuthButton.mjs.map +1 -1
  301. package/dist/esm/modules/slack/components/SlackAuthButton/index.mjs +2 -0
  302. package/dist/esm/modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs +33 -16
  303. package/dist/esm/modules/slack/components/SlackAuthContainer/SlackAuthContainer.mjs.map +1 -1
  304. package/dist/esm/modules/slack/components/SlackAuthContainer/index.mjs +2 -0
  305. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs +100 -66
  306. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackChannelCombobox.mjs.map +1 -1
  307. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackConnectionError.mjs +11 -14
  308. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackConnectionError.mjs.map +1 -1
  309. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.mjs +23 -11
  310. package/dist/esm/modules/slack/components/SlackChannelCombobox/SlackErrorMessage.mjs.map +1 -1
  311. package/dist/esm/modules/slack/components/SlackChannelCombobox/index.mjs +2 -0
  312. package/dist/esm/modules/slack/components/SlackIcon/SlackIcon.mjs +32 -12
  313. package/dist/esm/modules/slack/components/SlackIcon/SlackIcon.mjs.map +1 -1
  314. package/dist/esm/modules/slack/components/SlackIcon/index.mjs +2 -0
  315. package/dist/esm/modules/slack/index.mjs +7 -0
  316. package/dist/esm/modules/slack/utils.mjs +6 -5
  317. package/dist/esm/modules/slack/utils.mjs.map +1 -1
  318. package/dist/esm/next/KnockGuideLocationSensor.mjs +37 -37
  319. package/dist/esm/next/KnockGuideLocationSensor.mjs.map +1 -1
  320. package/dist/esm/next.mjs +2 -5
  321. package/dist/esm/tanstack/KnockGuideLocationSensor.mjs +16 -19
  322. package/dist/esm/tanstack/KnockGuideLocationSensor.mjs.map +1 -1
  323. package/dist/esm/tanstack.mjs +2 -5
  324. package/dist/index.css +1 -1
  325. package/package.json +20 -22
  326. package/dist/cjs/index.js.map +0 -1
  327. package/dist/cjs/modules/guide/components/Toolbar/styles.css.inline.js +0 -2
  328. package/dist/cjs/modules/guide/components/Toolbar/styles.css.inline.js.map +0 -1
  329. package/dist/cjs/next.js.map +0 -1
  330. package/dist/cjs/tanstack.js.map +0 -1
  331. package/dist/esm/index.mjs.map +0 -1
  332. package/dist/esm/modules/guide/components/Toolbar/styles.css.inline.mjs +0 -5
  333. package/dist/esm/modules/guide/components/Toolbar/styles.css.inline.mjs.map +0 -1
  334. package/dist/esm/next.mjs.map +0 -1
  335. package/dist/esm/tanstack.mjs.map +0 -1
@@ -1,170 +1,187 @@
1
- import { useGuide as C } from "@knocklabs/react-core";
2
- import a from "react";
3
- import { cx as c } from "../../../core/cx/index.mjs";
4
- import { isValidHttpUrl as h, maybeNavigateToUrlWithDelay as V } from "../helpers.mjs";
5
- /* empty css */
6
- const v = "card", s = ({
7
- children: e,
8
- className: t,
9
- ...r
10
- }) => /* @__PURE__ */ a.createElement("div", { className: c("knock-guide-card", t), ...r }, e);
11
- s.displayName = "CardView.Root";
12
- const u = ({
13
- children: e,
14
- className: t,
15
- ...r
16
- }) => /* @__PURE__ */ a.createElement("div", { className: c("knock-guide-card__message", t), ...r }, e);
17
- u.displayName = "CardView.Content";
18
- const f = ({
19
- children: e,
20
- className: t,
21
- ...r
22
- }) => /* @__PURE__ */ a.createElement("div", { className: c("knock-guide-card__header", t), ...r }, e);
23
- f.displayName = "CardView.Header";
24
- const w = ({
25
- headline: e,
26
- className: t,
27
- ...r
28
- }) => /* @__PURE__ */ a.createElement("div", { className: c("knock-guide-card__headline", t), ...r }, e);
29
- w.displayName = "CardView.Headline";
30
- const y = ({
31
- title: e,
32
- className: t,
33
- ...r
34
- }) => /* @__PURE__ */ a.createElement("div", { className: c("knock-guide-card__title", t), ...r }, e);
35
- y.displayName = "CardView.Title";
36
- const _ = ({
37
- body: e,
38
- className: t,
39
- ...r
40
- }) => /* @__PURE__ */ a.createElement("div", { className: c("knock-guide-card__body", t), dangerouslySetInnerHTML: {
41
- __html: e
42
- }, ...r });
43
- _.displayName = "CardView.Body";
44
- const k = ({
45
- children: e,
46
- className: t,
47
- alt: r,
48
- ...i
49
- }) => /* @__PURE__ */ a.createElement("img", { className: c("knock-guide-card__img", t), alt: r || "", ...i }, e);
50
- k.displayName = "CardView.Img";
51
- const p = ({
52
- children: e,
53
- className: t,
54
- ...r
55
- }) => /* @__PURE__ */ a.createElement("div", { className: c("knock-guide-card__actions", t), ...r }, e);
56
- p.displayName = "CardView.Actions";
57
- const g = ({
58
- text: e,
59
- action: t,
60
- className: r,
61
- ...i
62
- }) => /* @__PURE__ */ a.createElement("button", { className: c("knock-guide-card__action", r), ...i }, e);
1
+ import { cx as e } from "../../../core/cx/index.mjs";
2
+ import { isValidHttpUrl as t, maybeNavigateToUrlWithDelay as n } from "../helpers.mjs";
3
+ /* empty css */
4
+ import { useGuide as r } from "@knocklabs/react-core";
5
+ import i from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ //#region src/modules/guide/components/Card/Card.tsx
8
+ var s = "card", c = ({ children: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
9
+ className: e("knock-guide-card", n),
10
+ ...r,
11
+ children: t
12
+ });
13
+ c.displayName = "CardView.Root";
14
+ var l = ({ children: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
15
+ className: e("knock-guide-card__message", n),
16
+ ...r,
17
+ children: t
18
+ });
19
+ l.displayName = "CardView.Content";
20
+ var u = ({ children: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
21
+ className: e("knock-guide-card__header", n),
22
+ ...r,
23
+ children: t
24
+ });
25
+ u.displayName = "CardView.Header";
26
+ var d = ({ headline: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
27
+ className: e("knock-guide-card__headline", n),
28
+ ...r,
29
+ children: t
30
+ });
31
+ d.displayName = "CardView.Headline";
32
+ var f = ({ title: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
33
+ className: e("knock-guide-card__title", n),
34
+ ...r,
35
+ children: t
36
+ });
37
+ f.displayName = "CardView.Title";
38
+ var p = ({ body: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
39
+ className: e("knock-guide-card__body", n),
40
+ dangerouslySetInnerHTML: { __html: t },
41
+ ...r
42
+ });
43
+ p.displayName = "CardView.Body";
44
+ var m = ({ children: t, className: n, alt: r, ...i }) => /* @__PURE__ */ a("img", {
45
+ className: e("knock-guide-card__img", n),
46
+ alt: r || "",
47
+ ...i,
48
+ children: t
49
+ });
50
+ m.displayName = "CardView.Img";
51
+ var h = ({ children: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
52
+ className: e("knock-guide-card__actions", n),
53
+ ...r,
54
+ children: t
55
+ });
56
+ h.displayName = "CardView.Actions";
57
+ var g = ({ text: t, action: n, className: r, ...i }) => /* @__PURE__ */ a("button", {
58
+ className: e("knock-guide-card__action", r),
59
+ ...i,
60
+ children: t
61
+ });
63
62
  g.displayName = "CardView.PrimaryButton";
64
- const E = ({
65
- text: e,
66
- action: t,
67
- className: r,
68
- ...i
69
- }) => /* @__PURE__ */ a.createElement("button", { className: c("knock-guide-card__action knock-guide-card__action--secondary", r), ...i }, e);
70
- E.displayName = "CardView.SecondaryButton";
71
- const N = ({
72
- className: e,
73
- ...t
74
- }) => /* @__PURE__ */ a.createElement("button", { className: c("knock-guide-card__close", e), ...t }, /* @__PURE__ */ a.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", fill: "none" }, /* @__PURE__ */ a.createElement("g", { fill: "#60646C", fillRule: "evenodd", clipRule: "evenodd" }, /* @__PURE__ */ a.createElement("path", { d: "M14.03 3.97a.75.75 0 0 1 0 1.06l-9 9a.75.75 0 0 1-1.06-1.06l9-9a.75.75 0 0 1 1.06 0Z" }), /* @__PURE__ */ a.createElement("path", { d: "M3.97 3.97a.75.75 0 0 1 1.06 0l9 9a.75.75 0 1 1-1.06 1.06l-9-9a.75.75 0 0 1 0-1.06Z" }))));
75
- N.displayName = "CardView.DismissButton";
76
- const b = ({
77
- content: e,
78
- colorMode: t = "light",
79
- onDismiss: r,
80
- onButtonClick: i,
81
- onImageClick: n
82
- }) => /* @__PURE__ */ a.createElement(s, { "data-knock-color-mode": t }, /* @__PURE__ */ a.createElement(u, null, /* @__PURE__ */ a.createElement(f, null, /* @__PURE__ */ a.createElement(w, { headline: e.headline }), e.dismissible && /* @__PURE__ */ a.createElement(N, { onClick: r })), /* @__PURE__ */ a.createElement(y, { title: e.title }), /* @__PURE__ */ a.createElement(_, { body: e.body })), e.image && /* @__PURE__ */ a.createElement("a", { href: h(e.image.action) ? e.image.action : void 0, target: "_blank" }, /* @__PURE__ */ a.createElement(k, { src: e.image.url, alt: e.image.alt, onClick: (d) => {
83
- n && n(d, e.image);
84
- } })), (e.primary_button || e.secondary_button) && /* @__PURE__ */ a.createElement(p, null, e.primary_button && /* @__PURE__ */ a.createElement(g, { text: e.primary_button.text, action: e.primary_button.action, onClick: (d) => {
85
- if (i) {
86
- const {
87
- text: m,
88
- action: l
89
- } = e.primary_button;
90
- i(d, {
91
- name: "primary_button",
92
- text: m,
93
- action: l
94
- });
95
- }
96
- } }), e.secondary_button && /* @__PURE__ */ a.createElement(E, { text: e.secondary_button.text, action: e.secondary_button.action, onClick: (d) => {
97
- if (i) {
98
- const {
99
- text: m,
100
- action: l
101
- } = e.secondary_button;
102
- i(d, {
103
- name: "secondary_button",
104
- text: m,
105
- action: l
106
- });
107
- }
108
- } })));
109
- b.displayName = "CardView.Default";
110
- const x = ({
111
- guideKey: e,
112
- onButtonClick: t,
113
- onImageClick: r
114
- }) => {
115
- const {
116
- guide: i,
117
- step: n,
118
- colorMode: d
119
- } = C({
120
- key: e,
121
- type: v
122
- });
123
- return a.useEffect(() => {
124
- n && n.markAsSeen();
125
- }, [n]), !i || !n ? null : /* @__PURE__ */ a.createElement(b, { content: n.content, colorMode: d, onDismiss: () => n.markAsArchived(), onButtonClick: (m, l) => {
126
- const o = {
127
- ...l,
128
- type: "button_click"
129
- };
130
- return n.markAsInteracted({
131
- metadata: o
132
- }), t ? t(m, {
133
- button: l,
134
- step: n,
135
- guide: i
136
- }) : V(l.action);
137
- }, onImageClick: (m, l) => {
138
- const o = {
139
- ...l,
140
- type: "image_click"
141
- };
142
- if (n.markAsInteracted({
143
- metadata: o
144
- }), r)
145
- return r(m, {
146
- image: l,
147
- step: n,
148
- guide: i
149
- });
150
- } });
151
- };
152
- x.displayName = "Card";
153
- const A = {};
154
- Object.assign(A, {
155
- Default: b,
156
- Root: s,
157
- Content: u,
158
- Title: y,
159
- Body: _,
160
- Img: k,
161
- Actions: p,
162
- PrimaryButton: g,
163
- SecondaryButton: E,
164
- DismissButton: N
63
+ var _ = ({ text: t, action: n, className: r, ...i }) => /* @__PURE__ */ a("button", {
64
+ className: e("knock-guide-card__action knock-guide-card__action--secondary", r),
65
+ ...i,
66
+ children: t
165
67
  });
166
- export {
167
- x as Card,
168
- A as CardView
68
+ _.displayName = "CardView.SecondaryButton";
69
+ var v = ({ className: t, ...n }) => /* @__PURE__ */ a("button", {
70
+ className: e("knock-guide-card__close", t),
71
+ ...n,
72
+ children: /* @__PURE__ */ a("svg", {
73
+ xmlns: "http://www.w3.org/2000/svg",
74
+ width: "18",
75
+ height: "18",
76
+ fill: "none",
77
+ children: /* @__PURE__ */ o("g", {
78
+ fill: "#60646C",
79
+ fillRule: "evenodd",
80
+ clipRule: "evenodd",
81
+ children: [/* @__PURE__ */ a("path", { d: "M14.03 3.97a.75.75 0 0 1 0 1.06l-9 9a.75.75 0 0 1-1.06-1.06l9-9a.75.75 0 0 1 1.06 0Z" }), /* @__PURE__ */ a("path", { d: "M3.97 3.97a.75.75 0 0 1 1.06 0l9 9a.75.75 0 1 1-1.06 1.06l-9-9a.75.75 0 0 1 0-1.06Z" })]
82
+ })
83
+ })
84
+ });
85
+ v.displayName = "CardView.DismissButton";
86
+ var y = ({ content: e, colorMode: n = "light", onDismiss: r, onButtonClick: i, onImageClick: s }) => /* @__PURE__ */ o(c, {
87
+ "data-knock-color-mode": n,
88
+ children: [
89
+ /* @__PURE__ */ o(l, { children: [
90
+ /* @__PURE__ */ o(u, { children: [/* @__PURE__ */ a(d, { headline: e.headline }), e.dismissible && /* @__PURE__ */ a(v, { onClick: r })] }),
91
+ /* @__PURE__ */ a(f, { title: e.title }),
92
+ /* @__PURE__ */ a(p, { body: e.body })
93
+ ] }),
94
+ e.image && /* @__PURE__ */ a("a", {
95
+ href: t(e.image.action) ? e.image.action : void 0,
96
+ target: "_blank",
97
+ children: /* @__PURE__ */ a(m, {
98
+ src: e.image.url,
99
+ alt: e.image.alt,
100
+ onClick: (t) => {
101
+ s && s(t, e.image);
102
+ }
103
+ })
104
+ }),
105
+ (e.primary_button || e.secondary_button) && /* @__PURE__ */ o(h, { children: [e.primary_button && /* @__PURE__ */ a(g, {
106
+ text: e.primary_button.text,
107
+ action: e.primary_button.action,
108
+ onClick: (t) => {
109
+ if (i) {
110
+ let { text: n, action: r } = e.primary_button;
111
+ i(t, {
112
+ name: "primary_button",
113
+ text: n,
114
+ action: r
115
+ });
116
+ }
117
+ }
118
+ }), e.secondary_button && /* @__PURE__ */ a(_, {
119
+ text: e.secondary_button.text,
120
+ action: e.secondary_button.action,
121
+ onClick: (t) => {
122
+ if (i) {
123
+ let { text: n, action: r } = e.secondary_button;
124
+ i(t, {
125
+ name: "secondary_button",
126
+ text: n,
127
+ action: r
128
+ });
129
+ }
130
+ }
131
+ })] })
132
+ ]
133
+ });
134
+ y.displayName = "CardView.Default";
135
+ var b = ({ guideKey: e, onButtonClick: t, onImageClick: o }) => {
136
+ let { guide: c, step: l, colorMode: u } = r({
137
+ key: e,
138
+ type: s
139
+ });
140
+ return i.useEffect(() => {
141
+ l && l.markAsSeen();
142
+ }, [l]), !c || !l ? null : /* @__PURE__ */ a(y, {
143
+ content: l.content,
144
+ colorMode: u,
145
+ onDismiss: () => l.markAsArchived(),
146
+ onButtonClick: (e, r) => {
147
+ let i = {
148
+ ...r,
149
+ type: "button_click"
150
+ };
151
+ return l.markAsInteracted({ metadata: i }), t ? t(e, {
152
+ button: r,
153
+ step: l,
154
+ guide: c
155
+ }) : n(r.action);
156
+ },
157
+ onImageClick: (e, t) => {
158
+ let n = {
159
+ ...t,
160
+ type: "image_click"
161
+ };
162
+ if (l.markAsInteracted({ metadata: n }), o) return o(e, {
163
+ image: t,
164
+ step: l,
165
+ guide: c
166
+ });
167
+ }
168
+ });
169
169
  };
170
- //# sourceMappingURL=Card.mjs.map
170
+ b.displayName = "Card";
171
+ var x = {};
172
+ Object.assign(x, {
173
+ Default: y,
174
+ Root: c,
175
+ Content: l,
176
+ Title: f,
177
+ Body: p,
178
+ Img: m,
179
+ Actions: h,
180
+ PrimaryButton: g,
181
+ SecondaryButton: _,
182
+ DismissButton: v
183
+ });
184
+ //#endregion
185
+ export { b as Card, x as CardView };
186
+
187
+ //# sourceMappingURL=Card.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.mjs","sources":["../../../../../../src/modules/guide/components/Card/Card.tsx"],"sourcesContent":["import { ColorMode, useGuide } from \"@knocklabs/react-core\";\nimport React from \"react\";\n\nimport { cx } from \"../../../core/cx\";\nimport { isValidHttpUrl, maybeNavigateToUrlWithDelay } from \"../helpers\";\nimport {\n ButtonContent,\n ImageContent,\n TargetButton,\n TargetButtonWithGuide,\n TargetImage,\n TargetImageWithGuide,\n} from \"../types\";\n\nimport \"./styles.css\";\n\nconst MESSAGE_TYPE = \"card\";\n\nconst Root: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card\", className)} {...props}>\n {children}\n </div>\n );\n};\nRoot.displayName = \"CardView.Root\";\n\nconst Content: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__message\", className)} {...props}>\n {children}\n </div>\n );\n};\nContent.displayName = \"CardView.Content\";\n\nconst Header: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__header\", className)} {...props}>\n {children}\n </div>\n );\n};\nHeader.displayName = \"CardView.Header\";\n\nconst Headline: React.FC<\n { headline: string } & React.ComponentPropsWithRef<\"div\">\n> = ({ headline, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__headline\", className)} {...props}>\n {headline}\n </div>\n );\n};\nHeadline.displayName = \"CardView.Headline\";\n\nconst Title: React.FC<\n { title: string } & React.ComponentPropsWithRef<\"div\">\n> = ({ title, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__title\", className)} {...props}>\n {title}\n </div>\n );\n};\nTitle.displayName = \"CardView.Title\";\n\nconst Body: React.FC<{ body: string } & React.ComponentPropsWithRef<\"div\">> = ({\n body,\n className,\n ...props\n}) => {\n return (\n <div\n className={cx(\"knock-guide-card__body\", className)}\n dangerouslySetInnerHTML={{ __html: body }}\n {...props}\n />\n );\n};\nBody.displayName = \"CardView.Body\";\n\nconst Img: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"img\">>\n> = ({ children, className, alt, ...props }) => {\n return (\n <img\n className={cx(\"knock-guide-card__img\", className)}\n alt={alt || \"\"}\n {...props}\n >\n {children}\n </img>\n );\n};\nImg.displayName = \"CardView.Img\";\n\nconst Actions: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__actions\", className)} {...props}>\n {children}\n </div>\n );\n};\nActions.displayName = \"CardView.Actions\";\n\nconst PrimaryButton: React.FC<\n ButtonContent & React.ComponentPropsWithRef<\"button\">\n> = ({ text, action, className, ...props }) => {\n return (\n <button className={cx(\"knock-guide-card__action\", className)} {...props}>\n {text}\n </button>\n );\n};\nPrimaryButton.displayName = \"CardView.PrimaryButton\";\n\nconst SecondaryButton: React.FC<\n ButtonContent & React.ComponentPropsWithRef<\"button\">\n> = ({ text, action, className, ...props }) => {\n return (\n <button\n className={cx(\n \"knock-guide-card__action knock-guide-card__action--secondary\",\n className,\n )}\n {...props}\n >\n {text}\n </button>\n );\n};\nSecondaryButton.displayName = \"CardView.SecondaryButton\";\n\nconst DismissButton: React.FC<React.ComponentPropsWithRef<\"button\">> = ({\n className,\n ...props\n}) => {\n return (\n <button className={cx(\"knock-guide-card__close\", className)} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n >\n <g fill=\"#60646C\" fillRule=\"evenodd\" clipRule=\"evenodd\">\n <path d=\"M14.03 3.97a.75.75 0 0 1 0 1.06l-9 9a.75.75 0 0 1-1.06-1.06l9-9a.75.75 0 0 1 1.06 0Z\" />\n <path d=\"M3.97 3.97a.75.75 0 0 1 1.06 0l9 9a.75.75 0 1 1-1.06 1.06l-9-9a.75.75 0 0 1 0-1.06Z\" />\n </g>\n </svg>\n </button>\n );\n};\nDismissButton.displayName = \"CardView.DismissButton\";\n\ntype CardContent = {\n headline: string;\n title: string;\n body: string;\n image?: ImageContent;\n primary_button?: ButtonContent;\n secondary_button?: ButtonContent;\n dismissible?: boolean;\n};\n\nconst DefaultView: React.FC<{\n content: CardContent;\n colorMode?: ColorMode;\n onDismiss?: () => void;\n onButtonClick?: (e: React.MouseEvent, button: TargetButton) => void;\n onImageClick?: (e: React.MouseEvent, image: TargetImage) => void;\n}> = ({\n content,\n colorMode = \"light\",\n onDismiss,\n onButtonClick,\n onImageClick,\n}) => {\n return (\n <Root data-knock-color-mode={colorMode}>\n <Content>\n <Header>\n <Headline headline={content.headline} />\n {content.dismissible && <DismissButton onClick={onDismiss} />}\n </Header>\n\n <Title title={content.title} />\n <Body body={content.body} />\n </Content>\n {content.image && (\n <a\n href={\n isValidHttpUrl(content.image.action)\n ? content.image.action\n : undefined\n }\n target=\"_blank\"\n >\n <Img\n src={content.image.url}\n alt={content.image.alt}\n onClick={(e) => {\n if (onImageClick) {\n onImageClick(e, content.image!);\n }\n }}\n />\n </a>\n )}\n {(content.primary_button || content.secondary_button) && (\n <Actions>\n {content.primary_button && (\n <PrimaryButton\n text={content.primary_button.text}\n action={content.primary_button.action}\n onClick={(e) => {\n if (onButtonClick) {\n const { text, action } = content.primary_button!;\n onButtonClick(e, { name: \"primary_button\", text, action });\n }\n }}\n />\n )}\n {content.secondary_button && (\n <SecondaryButton\n text={content.secondary_button.text}\n action={content.secondary_button.action}\n onClick={(e) => {\n if (onButtonClick) {\n const { text, action } = content.secondary_button!;\n onButtonClick(e, { name: \"secondary_button\", text, action });\n }\n }}\n />\n )}\n </Actions>\n )}\n </Root>\n );\n};\nDefaultView.displayName = \"CardView.Default\";\n\ntype CardProps = {\n guideKey?: string;\n onButtonClick?: (e: React.MouseEvent, target: TargetButtonWithGuide) => void;\n onImageClick?: (e: React.MouseEvent, target: TargetImageWithGuide) => void;\n};\n\nexport const Card: React.FC<CardProps> = ({\n guideKey,\n onButtonClick,\n onImageClick,\n}) => {\n const { guide, step, colorMode } = useGuide({\n key: guideKey,\n type: MESSAGE_TYPE,\n });\n\n React.useEffect(() => {\n if (step) step.markAsSeen();\n }, [step]);\n\n if (!guide || !step) return null;\n\n return (\n <DefaultView\n content={step.content as CardContent}\n colorMode={colorMode}\n onDismiss={() => step.markAsArchived()}\n onButtonClick={(e, button) => {\n const metadata = { ...button, type: \"button_click\" };\n step.markAsInteracted({ metadata });\n\n return onButtonClick\n ? onButtonClick(e, { button, step, guide })\n : maybeNavigateToUrlWithDelay(button.action);\n }}\n onImageClick={(e, image) => {\n const metadata = { ...image, type: \"image_click\" };\n step.markAsInteracted({ metadata });\n\n if (onImageClick) {\n return onImageClick(e, { image, step, guide });\n }\n }}\n />\n );\n};\nCard.displayName = \"Card\";\n\nexport const CardView = {} as {\n Default: typeof DefaultView;\n Root: typeof Root;\n Content: typeof Content;\n Headline: typeof Headline;\n Title: typeof Title;\n Body: typeof Body;\n Img: typeof Img;\n Actions: typeof Actions;\n PrimaryButton: typeof PrimaryButton;\n SecondaryButton: typeof SecondaryButton;\n DismissButton: typeof DismissButton;\n};\n\nObject.assign(CardView, {\n Default: DefaultView,\n Root,\n Content,\n Title,\n Body,\n Img,\n Actions,\n PrimaryButton,\n SecondaryButton,\n DismissButton,\n});\n"],"names":["MESSAGE_TYPE","Root","children","className","props","React","cx","displayName","Content","Header","Headline","headline","Title","title","Body","body","__html","Img","alt","Actions","PrimaryButton","text","action","SecondaryButton","DismissButton","DefaultView","content","colorMode","onDismiss","onButtonClick","onImageClick","dismissible","image","isValidHttpUrl","undefined","url","e","primary_button","secondary_button","name","Card","guideKey","guide","step","useGuide","key","type","useEffect","markAsSeen","markAsArchived","button","metadata","markAsInteracted","maybeNavigateToUrlWithDelay","CardView","Object","assign","Default"],"mappings":";;;;;AAgBA,MAAMA,IAAe,QAEfC,IAEFA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,WAAAA;AAAAA,EAAW,GAAGC;AAAM,MAEjCC,gBAAAA,EAAA,cAAC,SAAI,WAAWC,EAAG,oBAAoBH,CAAS,GAAG,GAAIC,EAAAA,GACpDF,CACH;AAGJD,EAAKM,cAAc;AAEnB,MAAMC,IAEFA,CAAC;AAAA,EAAEN,UAAAA;AAAAA,EAAUC,WAAAA;AAAAA,EAAW,GAAGC;AAAM,MAEjCC,gBAAAA,EAAA,cAAC,SAAI,WAAWC,EAAG,6BAA6BH,CAAS,GAAG,GAAIC,EAAAA,GAC7DF,CACH;AAGJM,EAAQD,cAAc;AAEtB,MAAME,IAEFA,CAAC;AAAA,EAAE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;AAAAA,QAAOW,MAAAA;AAAAA,QAAMD,OAAAA;AAAAA,MAAAA,CAAO;AAAA,EAC/C,GAEF;AAEN;AACAF,EAAKjC,cAAc;AAEZ,MAAM+C,IAAW,CAAA;AAcxBC,OAAOC,OAAOF,GAAU;AAAA,EACtBG,SAAShC;AAAAA,EACTxB,MAAAA;AAAAA,EACAO,SAAAA;AAAAA,EACAI,OAAAA;AAAAA,EACAE,MAAAA;AAAAA,EACAG,KAAAA;AAAAA,EACAE,SAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAG,iBAAAA;AAAAA,EACAC,eAAAA;AACF,CAAC;"}
1
+ {"version":3,"file":"Card.mjs","names":[],"sources":["../../../../../../src/modules/guide/components/Card/Card.tsx"],"sourcesContent":["import { ColorMode, useGuide } from \"@knocklabs/react-core\";\nimport React from \"react\";\n\nimport { cx } from \"../../../core/cx\";\nimport { isValidHttpUrl, maybeNavigateToUrlWithDelay } from \"../helpers\";\nimport {\n ButtonContent,\n ImageContent,\n TargetButton,\n TargetButtonWithGuide,\n TargetImage,\n TargetImageWithGuide,\n} from \"../types\";\n\nimport \"./styles.css\";\n\nconst MESSAGE_TYPE = \"card\";\n\nconst Root: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card\", className)} {...props}>\n {children}\n </div>\n );\n};\nRoot.displayName = \"CardView.Root\";\n\nconst Content: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__message\", className)} {...props}>\n {children}\n </div>\n );\n};\nContent.displayName = \"CardView.Content\";\n\nconst Header: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__header\", className)} {...props}>\n {children}\n </div>\n );\n};\nHeader.displayName = \"CardView.Header\";\n\nconst Headline: React.FC<\n { headline: string } & React.ComponentPropsWithRef<\"div\">\n> = ({ headline, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__headline\", className)} {...props}>\n {headline}\n </div>\n );\n};\nHeadline.displayName = \"CardView.Headline\";\n\nconst Title: React.FC<\n { title: string } & React.ComponentPropsWithRef<\"div\">\n> = ({ title, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__title\", className)} {...props}>\n {title}\n </div>\n );\n};\nTitle.displayName = \"CardView.Title\";\n\nconst Body: React.FC<{ body: string } & React.ComponentPropsWithRef<\"div\">> = ({\n body,\n className,\n ...props\n}) => {\n return (\n <div\n className={cx(\"knock-guide-card__body\", className)}\n dangerouslySetInnerHTML={{ __html: body }}\n {...props}\n />\n );\n};\nBody.displayName = \"CardView.Body\";\n\nconst Img: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"img\">>\n> = ({ children, className, alt, ...props }) => {\n return (\n <img\n className={cx(\"knock-guide-card__img\", className)}\n alt={alt || \"\"}\n {...props}\n >\n {children}\n </img>\n );\n};\nImg.displayName = \"CardView.Img\";\n\nconst Actions: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-card__actions\", className)} {...props}>\n {children}\n </div>\n );\n};\nActions.displayName = \"CardView.Actions\";\n\nconst PrimaryButton: React.FC<\n ButtonContent & React.ComponentPropsWithRef<\"button\">\n> = ({ text, action, className, ...props }) => {\n return (\n <button className={cx(\"knock-guide-card__action\", className)} {...props}>\n {text}\n </button>\n );\n};\nPrimaryButton.displayName = \"CardView.PrimaryButton\";\n\nconst SecondaryButton: React.FC<\n ButtonContent & React.ComponentPropsWithRef<\"button\">\n> = ({ text, action, className, ...props }) => {\n return (\n <button\n className={cx(\n \"knock-guide-card__action knock-guide-card__action--secondary\",\n className,\n )}\n {...props}\n >\n {text}\n </button>\n );\n};\nSecondaryButton.displayName = \"CardView.SecondaryButton\";\n\nconst DismissButton: React.FC<React.ComponentPropsWithRef<\"button\">> = ({\n className,\n ...props\n}) => {\n return (\n <button className={cx(\"knock-guide-card__close\", className)} {...props}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n >\n <g fill=\"#60646C\" fillRule=\"evenodd\" clipRule=\"evenodd\">\n <path d=\"M14.03 3.97a.75.75 0 0 1 0 1.06l-9 9a.75.75 0 0 1-1.06-1.06l9-9a.75.75 0 0 1 1.06 0Z\" />\n <path d=\"M3.97 3.97a.75.75 0 0 1 1.06 0l9 9a.75.75 0 1 1-1.06 1.06l-9-9a.75.75 0 0 1 0-1.06Z\" />\n </g>\n </svg>\n </button>\n );\n};\nDismissButton.displayName = \"CardView.DismissButton\";\n\ntype CardContent = {\n headline: string;\n title: string;\n body: string;\n image?: ImageContent;\n primary_button?: ButtonContent;\n secondary_button?: ButtonContent;\n dismissible?: boolean;\n};\n\nconst DefaultView: React.FC<{\n content: CardContent;\n colorMode?: ColorMode;\n onDismiss?: () => void;\n onButtonClick?: (e: React.MouseEvent, button: TargetButton) => void;\n onImageClick?: (e: React.MouseEvent, image: TargetImage) => void;\n}> = ({\n content,\n colorMode = \"light\",\n onDismiss,\n onButtonClick,\n onImageClick,\n}) => {\n return (\n <Root data-knock-color-mode={colorMode}>\n <Content>\n <Header>\n <Headline headline={content.headline} />\n {content.dismissible && <DismissButton onClick={onDismiss} />}\n </Header>\n\n <Title title={content.title} />\n <Body body={content.body} />\n </Content>\n {content.image && (\n <a\n href={\n isValidHttpUrl(content.image.action)\n ? content.image.action\n : undefined\n }\n target=\"_blank\"\n >\n <Img\n src={content.image.url}\n alt={content.image.alt}\n onClick={(e) => {\n if (onImageClick) {\n onImageClick(e, content.image!);\n }\n }}\n />\n </a>\n )}\n {(content.primary_button || content.secondary_button) && (\n <Actions>\n {content.primary_button && (\n <PrimaryButton\n text={content.primary_button.text}\n action={content.primary_button.action}\n onClick={(e) => {\n if (onButtonClick) {\n const { text, action } = content.primary_button!;\n onButtonClick(e, { name: \"primary_button\", text, action });\n }\n }}\n />\n )}\n {content.secondary_button && (\n <SecondaryButton\n text={content.secondary_button.text}\n action={content.secondary_button.action}\n onClick={(e) => {\n if (onButtonClick) {\n const { text, action } = content.secondary_button!;\n onButtonClick(e, { name: \"secondary_button\", text, action });\n }\n }}\n />\n )}\n </Actions>\n )}\n </Root>\n );\n};\nDefaultView.displayName = \"CardView.Default\";\n\ntype CardProps = {\n guideKey?: string;\n onButtonClick?: (e: React.MouseEvent, target: TargetButtonWithGuide) => void;\n onImageClick?: (e: React.MouseEvent, target: TargetImageWithGuide) => void;\n};\n\nexport const Card: React.FC<CardProps> = ({\n guideKey,\n onButtonClick,\n onImageClick,\n}) => {\n const { guide, step, colorMode } = useGuide({\n key: guideKey,\n type: MESSAGE_TYPE,\n });\n\n React.useEffect(() => {\n if (step) step.markAsSeen();\n }, [step]);\n\n if (!guide || !step) return null;\n\n return (\n <DefaultView\n content={step.content as CardContent}\n colorMode={colorMode}\n onDismiss={() => step.markAsArchived()}\n onButtonClick={(e, button) => {\n const metadata = { ...button, type: \"button_click\" };\n step.markAsInteracted({ metadata });\n\n return onButtonClick\n ? onButtonClick(e, { button, step, guide })\n : maybeNavigateToUrlWithDelay(button.action);\n }}\n onImageClick={(e, image) => {\n const metadata = { ...image, type: \"image_click\" };\n step.markAsInteracted({ metadata });\n\n if (onImageClick) {\n return onImageClick(e, { image, step, guide });\n }\n }}\n />\n );\n};\nCard.displayName = \"Card\";\n\nexport const CardView = {} as {\n Default: typeof DefaultView;\n Root: typeof Root;\n Content: typeof Content;\n Headline: typeof Headline;\n Title: typeof Title;\n Body: typeof Body;\n Img: typeof Img;\n Actions: typeof Actions;\n PrimaryButton: typeof PrimaryButton;\n SecondaryButton: typeof SecondaryButton;\n DismissButton: typeof DismissButton;\n};\n\nObject.assign(CardView, {\n Default: DefaultView,\n Root,\n Content,\n Title,\n Body,\n Img,\n Actions,\n PrimaryButton,\n SecondaryButton,\n D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