@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,172 +1,192 @@
1
- import { useGuide as V } from "@knocklabs/react-core";
2
- import * as d from "@radix-ui/react-dialog";
3
- import a from "react";
4
- import { cx as n } from "../../../core/cx/index.mjs";
5
- import { isValidHttpUrl as v, maybeNavigateToUrlWithDelay as h } from "../helpers.mjs";
6
- /* empty css */
7
- const x = "modal", u = ({
8
- children: e,
9
- onOpenChange: t,
10
- ...l
11
- }) => /* @__PURE__ */ a.createElement(d.Root, { defaultOpen: !0, onOpenChange: t, ...l }, /* @__PURE__ */ a.createElement(d.Portal, null, e));
12
- u.displayName = "ModalView.Root";
13
- const y = a.forwardRef(({
14
- className: e,
15
- ...t
16
- }, l) => /* @__PURE__ */ a.createElement(d.Overlay, { className: n("knock-guide-modal__overlay", e), ref: l, ...t }));
17
- y.displayName = "ModalView.Overlay";
18
- const _ = a.forwardRef(({
19
- children: e,
20
- className: t,
21
- ...l
22
- }, r) => /* @__PURE__ */ a.createElement(d.Content, { className: n("knock-guide-modal", t), ref: r, ...l }, e));
23
- _.displayName = "ModalView.Content";
24
- const M = ({
25
- children: e,
26
- className: t,
27
- ...l
28
- }) => /* @__PURE__ */ a.createElement("div", { className: n("knock-guide-modal__header", t), ...l }, e);
29
- M.displayName = "ModalView.Header";
30
- const p = ({
31
- title: e,
32
- className: t,
33
- ...l
34
- }) => /* @__PURE__ */ a.createElement(d.Title, { className: n("knock-guide-modal__title", t), ...l }, 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
+ import * as s from "@radix-ui/react-dialog";
8
+ //#region src/modules/guide/components/Modal/Modal.tsx
9
+ var c = "modal", l = ({ children: e, onOpenChange: t, ...n }) => /* @__PURE__ */ a(s.Root, {
10
+ defaultOpen: !0,
11
+ onOpenChange: t,
12
+ ...n,
13
+ children: /* @__PURE__ */ a(s.Portal, { children: e })
14
+ });
15
+ l.displayName = "ModalView.Root";
16
+ var u = i.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(s.Overlay, {
17
+ className: e("knock-guide-modal__overlay", t),
18
+ ref: r,
19
+ ...n
20
+ }));
21
+ u.displayName = "ModalView.Overlay";
22
+ var d = i.forwardRef(({ children: t, className: n, ...r }, i) => /* @__PURE__ */ a(s.Content, {
23
+ className: e("knock-guide-modal", n),
24
+ ref: i,
25
+ ...r,
26
+ children: t
27
+ }));
28
+ d.displayName = "ModalView.Content";
29
+ var f = ({ children: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
30
+ className: e("knock-guide-modal__header", n),
31
+ ...r,
32
+ children: t
33
+ });
34
+ f.displayName = "ModalView.Header";
35
+ var p = ({ title: t, className: n, ...r }) => /* @__PURE__ */ a(s.Title, {
36
+ className: e("knock-guide-modal__title", n),
37
+ ...r,
38
+ children: t
39
+ });
35
40
  p.displayName = "ModalView.Title";
36
- const E = ({
37
- body: e,
38
- className: t,
39
- ...l
40
- }) => /* @__PURE__ */ a.createElement(d.Description, { className: n("knock-guide-modal__body", t), dangerouslySetInnerHTML: {
41
- __html: e
42
- }, ...l });
43
- E.displayName = "ModalView.Body";
44
- const g = ({
45
- children: e,
46
- className: t,
47
- alt: l,
48
- ...r
49
- }) => /* @__PURE__ */ a.createElement("img", { className: n("knock-guide-modal__img", t), alt: l || "", ...r }, e);
50
- g.displayName = "ModalView.Img";
51
- const k = ({
52
- children: e,
53
- className: t,
54
- ...l
55
- }) => /* @__PURE__ */ a.createElement("div", { className: n("knock-guide-modal__actions", t), ...l }, e);
56
- k.displayName = "ModalView.Actions";
57
- const f = ({
58
- text: e,
59
- action: t,
60
- className: l,
61
- ...r
62
- }) => /* @__PURE__ */ a.createElement("button", { className: n("knock-guide-modal__action", l), ...r }, e);
63
- f.displayName = "ModalView.PrimaryButton";
64
- const N = ({
65
- text: e,
66
- action: t,
67
- className: l,
68
- ...r
69
- }) => /* @__PURE__ */ a.createElement("button", { className: n("knock-guide-modal__action knock-guide-modal__action--secondary", l), ...r }, e);
70
- N.displayName = "ModalView.SecondaryButton";
71
- const w = ({
72
- className: e,
73
- ...t
74
- }) => /* @__PURE__ */ a.createElement(d.Close, { className: n("knock-guide-modal__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
- w.displayName = "ModalView.Close";
76
- const b = ({
77
- content: e,
78
- colorMode: t = "light",
79
- onOpenChange: l,
80
- onDismiss: r,
81
- onButtonClick: o,
82
- onImageClick: s
83
- }) => /* @__PURE__ */ a.createElement(u, { onOpenChange: l }, /* @__PURE__ */ a.createElement(y, null), /* @__PURE__ */ a.createElement(_, { "data-knock-color-mode": t, onPointerDownOutside: r }, /* @__PURE__ */ a.createElement(M, null, /* @__PURE__ */ a.createElement(p, { title: e.title }), e.dismissible && /* @__PURE__ */ a.createElement(w, { onClick: r })), /* @__PURE__ */ a.createElement(E, { body: e.body }), e.image && /* @__PURE__ */ a.createElement("a", { href: v(e.image.action) ? e.image.action : void 0, target: "_blank" }, /* @__PURE__ */ a.createElement(g, { src: e.image.url, alt: e.image.alt, onClick: (m) => {
84
- s && s(m, e.image);
85
- } })), (e.primary_button || e.secondary_button) && /* @__PURE__ */ a.createElement(k, null, e.secondary_button && /* @__PURE__ */ a.createElement(N, { text: e.secondary_button.text, action: e.secondary_button.action, onClick: (m) => {
86
- if (o) {
87
- const {
88
- text: i,
89
- action: c
90
- } = e.secondary_button;
91
- o(m, {
92
- name: "secondary_button",
93
- text: i,
94
- action: c
95
- });
96
- }
97
- } }), e.primary_button && /* @__PURE__ */ a.createElement(f, { text: e.primary_button.text, action: e.primary_button.action, onClick: (m) => {
98
- if (o) {
99
- const {
100
- text: i,
101
- action: c
102
- } = e.primary_button;
103
- o(m, {
104
- name: "primary_button",
105
- text: i,
106
- action: c
107
- });
108
- }
109
- } }))));
41
+ var m = ({ body: t, className: n, ...r }) => /* @__PURE__ */ a(s.Description, {
42
+ className: e("knock-guide-modal__body", n),
43
+ dangerouslySetInnerHTML: { __html: t },
44
+ ...r
45
+ });
46
+ m.displayName = "ModalView.Body";
47
+ var h = ({ children: t, className: n, alt: r, ...i }) => /* @__PURE__ */ a("img", {
48
+ className: e("knock-guide-modal__img", n),
49
+ alt: r || "",
50
+ ...i,
51
+ children: t
52
+ });
53
+ h.displayName = "ModalView.Img";
54
+ var g = ({ children: t, className: n, ...r }) => /* @__PURE__ */ a("div", {
55
+ className: e("knock-guide-modal__actions", n),
56
+ ...r,
57
+ children: t
58
+ });
59
+ g.displayName = "ModalView.Actions";
60
+ var _ = ({ text: t, action: n, className: r, ...i }) => /* @__PURE__ */ a("button", {
61
+ className: e("knock-guide-modal__action", r),
62
+ ...i,
63
+ children: t
64
+ });
65
+ _.displayName = "ModalView.PrimaryButton";
66
+ var v = ({ text: t, action: n, className: r, ...i }) => /* @__PURE__ */ a("button", {
67
+ className: e("knock-guide-modal__action knock-guide-modal__action--secondary", r),
68
+ ...i,
69
+ children: t
70
+ });
71
+ v.displayName = "ModalView.SecondaryButton";
72
+ var y = ({ className: t, ...n }) => /* @__PURE__ */ a(s.Close, {
73
+ className: e("knock-guide-modal__close", t),
74
+ ...n,
75
+ children: /* @__PURE__ */ a("svg", {
76
+ xmlns: "http://www.w3.org/2000/svg",
77
+ width: "18",
78
+ height: "18",
79
+ fill: "none",
80
+ children: /* @__PURE__ */ o("g", {
81
+ fill: "#60646C",
82
+ fillRule: "evenodd",
83
+ clipRule: "evenodd",
84
+ 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" })]
85
+ })
86
+ })
87
+ });
88
+ y.displayName = "ModalView.Close";
89
+ var b = ({ content: e, colorMode: n = "light", onOpenChange: r, onDismiss: i, onButtonClick: s, onImageClick: c }) => /* @__PURE__ */ o(l, {
90
+ onOpenChange: r,
91
+ children: [/* @__PURE__ */ a(u, {}), /* @__PURE__ */ o(d, {
92
+ "data-knock-color-mode": n,
93
+ onPointerDownOutside: i,
94
+ children: [
95
+ /* @__PURE__ */ o(f, { children: [/* @__PURE__ */ a(p, { title: e.title }), e.dismissible && /* @__PURE__ */ a(y, { onClick: i })] }),
96
+ /* @__PURE__ */ a(m, { body: e.body }),
97
+ e.image && /* @__PURE__ */ a("a", {
98
+ href: t(e.image.action) ? e.image.action : void 0,
99
+ target: "_blank",
100
+ children: /* @__PURE__ */ a(h, {
101
+ src: e.image.url,
102
+ alt: e.image.alt,
103
+ onClick: (t) => {
104
+ c && c(t, e.image);
105
+ }
106
+ })
107
+ }),
108
+ (e.primary_button || e.secondary_button) && /* @__PURE__ */ o(g, { children: [e.secondary_button && /* @__PURE__ */ a(v, {
109
+ text: e.secondary_button.text,
110
+ action: e.secondary_button.action,
111
+ onClick: (t) => {
112
+ if (s) {
113
+ let { text: n, action: r } = e.secondary_button;
114
+ s(t, {
115
+ name: "secondary_button",
116
+ text: n,
117
+ action: r
118
+ });
119
+ }
120
+ }
121
+ }), e.primary_button && /* @__PURE__ */ a(_, {
122
+ text: e.primary_button.text,
123
+ action: e.primary_button.action,
124
+ onClick: (t) => {
125
+ if (s) {
126
+ let { text: n, action: r } = e.primary_button;
127
+ s(t, {
128
+ name: "primary_button",
129
+ text: n,
130
+ action: r
131
+ });
132
+ }
133
+ }
134
+ })] })
135
+ ]
136
+ })]
137
+ });
110
138
  b.displayName = "ModalView.Default";
111
- const A = ({
112
- guideKey: e,
113
- onButtonClick: t,
114
- onImageClick: l
115
- }) => {
116
- const {
117
- guide: r,
118
- step: o,
119
- colorMode: s
120
- } = V({
121
- key: e,
122
- type: x
123
- });
124
- return a.useEffect(() => {
125
- o && o.markAsSeen();
126
- }, [o]), !r || !o ? null : /* @__PURE__ */ a.createElement(b, { content: o.content, colorMode: s, onDismiss: () => o.markAsArchived(), onButtonClick: (m, i) => {
127
- const c = {
128
- ...i,
129
- type: "button_click"
130
- };
131
- return o.markAsInteracted({
132
- metadata: c
133
- }), t ? t(m, {
134
- button: i,
135
- step: o,
136
- guide: r
137
- }) : h(i.action);
138
- }, onImageClick: (m, i) => {
139
- const c = {
140
- ...i,
141
- type: "image_click"
142
- };
143
- if (o.markAsInteracted({
144
- metadata: c
145
- }), l)
146
- return l(m, {
147
- image: i,
148
- step: o,
149
- guide: r
150
- });
151
- } });
139
+ var x = ({ guideKey: e, onButtonClick: t, onImageClick: o }) => {
140
+ let { guide: s, step: l, colorMode: u } = r({
141
+ key: e,
142
+ type: c
143
+ });
144
+ return i.useEffect(() => {
145
+ l && l.markAsSeen();
146
+ }, [l]), !s || !l ? null : /* @__PURE__ */ a(b, {
147
+ content: l.content,
148
+ colorMode: u,
149
+ onDismiss: () => l.markAsArchived(),
150
+ onButtonClick: (e, r) => {
151
+ let i = {
152
+ ...r,
153
+ type: "button_click"
154
+ };
155
+ return l.markAsInteracted({ metadata: i }), t ? t(e, {
156
+ button: r,
157
+ step: l,
158
+ guide: s
159
+ }) : n(r.action);
160
+ },
161
+ onImageClick: (e, t) => {
162
+ let n = {
163
+ ...t,
164
+ type: "image_click"
165
+ };
166
+ if (l.markAsInteracted({ metadata: n }), o) return o(e, {
167
+ image: t,
168
+ step: l,
169
+ guide: s
170
+ });
171
+ }
172
+ });
152
173
  };
153
- A.displayName = "Modal";
154
- const R = {};
155
- Object.assign(R, {
156
- Default: b,
157
- Root: u,
158
- Overlay: y,
159
- Content: _,
160
- Title: p,
161
- Body: E,
162
- Img: g,
163
- Actions: k,
164
- PrimaryButton: f,
165
- SecondaryButton: N,
166
- Close: w
174
+ x.displayName = "Modal";
175
+ var S = {};
176
+ Object.assign(S, {
177
+ Default: b,
178
+ Root: l,
179
+ Overlay: u,
180
+ Content: d,
181
+ Title: p,
182
+ Body: m,
183
+ Img: h,
184
+ Actions: g,
185
+ PrimaryButton: _,
186
+ SecondaryButton: v,
187
+ Close: y
167
188
  });
168
- export {
169
- A as Modal,
170
- R as ModalView
171
- };
172
- //# sourceMappingURL=Modal.mjs.map
189
+ //#endregion
190
+ export { x as Modal, S as ModalView };
191
+
192
+ //# sourceMappingURL=Modal.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.mjs","sources":["../../../../../../src/modules/guide/components/Modal/Modal.tsx"],"sourcesContent":["import { ColorMode, useGuide } from \"@knocklabs/react-core\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\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 = \"modal\";\n\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>;\n\nconst Root = ({ children, onOpenChange, ...props }: RootProps) => {\n return (\n <Dialog.Root defaultOpen onOpenChange={onOpenChange} {...props}>\n <Dialog.Portal>{children}</Dialog.Portal>\n </Dialog.Root>\n );\n};\nRoot.displayName = \"ModalView.Root\";\n\ntype OverlayProps = React.ComponentPropsWithoutRef<typeof Dialog.Overlay> &\n React.ComponentPropsWithRef<\"div\">;\ntype OverlayRef = React.ElementRef<\"div\">;\n\nconst Overlay = React.forwardRef<OverlayRef, OverlayProps>(\n ({ className, ...props }, forwardedRef) => {\n return (\n <Dialog.Overlay\n className={cx(\"knock-guide-modal__overlay\", className)}\n ref={forwardedRef}\n {...props}\n />\n );\n },\n);\nOverlay.displayName = \"ModalView.Overlay\";\n\ntype ContentProps = React.ComponentPropsWithoutRef<typeof Dialog.Content> &\n React.ComponentPropsWithRef<\"div\">;\ntype ContentRef = React.ElementRef<\"div\">;\n\nconst Content = React.forwardRef<ContentRef, ContentProps>(\n ({ children, className, ...props }, forwardedRef) => {\n return (\n <Dialog.Content\n className={cx(\"knock-guide-modal\", className)}\n ref={forwardedRef}\n {...props}\n >\n {children}\n </Dialog.Content>\n );\n },\n);\nContent.displayName = \"ModalView.Content\";\n\nconst Header: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-modal__header\", className)} {...props}>\n {children}\n </div>\n );\n};\nHeader.displayName = \"ModalView.Header\";\n\ntype TitleProps = React.ComponentPropsWithoutRef<typeof Dialog.Title> &\n React.ComponentPropsWithRef<\"div\"> & {\n title: string;\n };\n\nconst Title = ({ title, className, ...props }: TitleProps) => {\n return (\n <Dialog.Title\n className={cx(\"knock-guide-modal__title\", className)}\n {...props}\n >\n {title}\n </Dialog.Title>\n );\n};\nTitle.displayName = \"ModalView.Title\";\n\nconst Body: React.FC<{ body: string } & React.ComponentPropsWithRef<\"div\">> = ({\n body,\n className,\n ...props\n}) => {\n return (\n <Dialog.Description\n className={cx(\"knock-guide-modal__body\", className)}\n dangerouslySetInnerHTML={{ __html: body }}\n {...props}\n />\n );\n};\nBody.displayName = \"ModalView.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-modal__img\", className)}\n alt={alt || \"\"}\n {...props}\n >\n {children}\n </img>\n );\n};\nImg.displayName = \"ModalView.Img\";\n\nconst Actions: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-modal__actions\", className)} {...props}>\n {children}\n </div>\n );\n};\nActions.displayName = \"ModalView.Actions\";\n\nconst PrimaryButton: React.FC<\n ButtonContent & React.ComponentPropsWithRef<\"button\">\n> = ({ text, action, className, ...props }) => {\n return (\n <button className={cx(\"knock-guide-modal__action\", className)} {...props}>\n {text}\n </button>\n );\n};\nPrimaryButton.displayName = \"ModalView.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-modal__action knock-guide-modal__action--secondary\",\n className,\n )}\n {...props}\n >\n {text}\n </button>\n );\n};\nSecondaryButton.displayName = \"ModalView.SecondaryButton\";\n\ntype CloseProps = React.ComponentPropsWithoutRef<typeof Dialog.Close> &\n React.ComponentPropsWithRef<\"button\">;\n\nconst Close = ({ className, ...props }: CloseProps) => {\n return (\n <Dialog.Close\n className={cx(\"knock-guide-modal__close\", className)}\n {...props}\n >\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 </Dialog.Close>\n );\n};\nClose.displayName = \"ModalView.Close\";\n\ntype ModalContent = {\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: ModalContent;\n colorMode?: ColorMode;\n onOpenChange?: (open: boolean) => void;\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 onOpenChange,\n onDismiss,\n onButtonClick,\n onImageClick,\n}) => {\n return (\n <Root onOpenChange={onOpenChange}>\n <Overlay />\n {/* Must pass color mode to content for css variables to be set properly */}\n <Content\n data-knock-color-mode={colorMode}\n onPointerDownOutside={onDismiss}\n >\n <Header>\n <Title title={content.title} />\n {content.dismissible && <Close onClick={onDismiss} />}\n </Header>\n\n <Body body={content.body} />\n\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\n {(content.primary_button || content.secondary_button) && (\n <Actions>\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, {\n name: \"secondary_button\",\n text,\n action,\n });\n }\n }}\n />\n )}\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 </Actions>\n )}\n </Content>\n </Root>\n );\n};\nDefaultView.displayName = \"ModalView.Default\";\n\ntype ModalProps = {\n guideKey?: string;\n onButtonClick?: (e: React.MouseEvent, target: TargetButtonWithGuide) => void;\n onImageClick?: (e: React.MouseEvent, target: TargetImageWithGuide) => void;\n};\n\nexport const Modal: React.FC<ModalProps> = ({\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 ModalContent}\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};\nModal.displayName = \"Modal\";\n\nexport const ModalView = {} as {\n Default: typeof DefaultView;\n Root: typeof Root;\n Overlay: typeof Overlay;\n Content: typeof Content;\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 Close: typeof Close;\n};\n\nObject.assign(ModalView, {\n Default: DefaultView,\n Root,\n Overlay,\n Content,\n Title,\n Body,\n Img,\n Actions,\n PrimaryButton,\n SecondaryButton,\n Close,\n});\n"],"names":["MESSAGE_TYPE","Root","children","onOpenChange","props","React","Dialog","displayName","Overlay","forwardRef","className","forwardedRef","cx","Content","Header","Title","title","Body","body","__html","Img","alt","Actions","PrimaryButton","text","action","SecondaryButton","Close","DefaultView","content","colorMode","onDismiss","onButtonClick","onImageClick","dismissible","image","isValidHttpUrl","undefined","url","e","primary_button","secondary_button","name","Modal","guideKey","guide","step","useGuide","key","type","useEffect","markAsSeen","markAsArchived","button","metadata","markAsInteracted","maybeNavigateToUrlWithDelay","ModalView","Object","assign","Default"],"mappings":";;;;;;AAiBA,MAAMA,IAAe,SAQfC,IAAOA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,cAAAA;AAAAA,EAAc,GAAGC;AAAiB,MAEvDC,gBAAAA,EAAA,cAAAC,EAAO,MAAP,EAAY,aAAW,IAAC,cAAAH,GAA4B,GAAIC,EAAAA,GACtDC,gBAAAA,EAAA,cAAAC,EAAO,QAAP,MAAeJ,CAAS,CAC3B;AAGJD,EAAKM,cAAc;AAMnB,MAAMC,IAAUH,EAAMI,WACpB,CAAC;AAAA,EAAEC,WAAAA;AAAAA,EAAW,GAAGN;AAAM,GAAGO,MAErBN,gBAAAA,EAAA,cAAAC,EAAO,SAAP,EACC,WAAWM,EAAG,8BAA8BF,CAAS,GACrD,KAAKC,GACL,GAAIP,EACJ,CAAA,CAGR;AACAI,EAAQD,cAAc;AAMtB,MAAMM,IAAUR,EAAMI,WACpB,CAAC;AAAA,EAAEP,UAAAA;AAAAA,EAAUQ,WAAAA;AAAAA,EAAW,GAAGN;AAAM,GAAG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BrB;AACF,aAAOA,EAAaM,GAAG;AAAA,QAAEJ,OAAAA;AAAAA,QAAOW,MAAAA;AAAAA,QAAMD,OAAAA;AAAAA,MAAAA,CAAO;AAAA,EAC/C,GAEF;AAEN;AACAF,EAAMpC,cAAc;AAEb,MAAMkD,IAAY,CAAA;AAczBC,OAAOC,OAAOF,GAAW;AAAA,EACvBG,SAAShC;AAAAA,EACT3B,MAAAA;AAAAA,EACAO,SAAAA;AAAAA,EACAK,SAAAA;AAAAA,EACAE,OAAAA;AAAAA,EACAE,MAAAA;AAAAA,EACAG,KAAAA;AAAAA,EACAE,SAAAA;AAAAA,EACAC,eAAAA;AAAAA,EACAG,iBAAAA;AAAAA,EACAC,OAAAA;AACF,CAAC;"}
1
+ {"version":3,"file":"Modal.mjs","names":[],"sources":["../../../../../../src/modules/guide/components/Modal/Modal.tsx"],"sourcesContent":["import { ColorMode, useGuide } from \"@knocklabs/react-core\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\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 = \"modal\";\n\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>;\n\nconst Root = ({ children, onOpenChange, ...props }: RootProps) => {\n return (\n <Dialog.Root defaultOpen onOpenChange={onOpenChange} {...props}>\n <Dialog.Portal>{children}</Dialog.Portal>\n </Dialog.Root>\n );\n};\nRoot.displayName = \"ModalView.Root\";\n\ntype OverlayProps = React.ComponentPropsWithoutRef<typeof Dialog.Overlay> &\n React.ComponentPropsWithRef<\"div\">;\ntype OverlayRef = React.ElementRef<\"div\">;\n\nconst Overlay = React.forwardRef<OverlayRef, OverlayProps>(\n ({ className, ...props }, forwardedRef) => {\n return (\n <Dialog.Overlay\n className={cx(\"knock-guide-modal__overlay\", className)}\n ref={forwardedRef}\n {...props}\n />\n );\n },\n);\nOverlay.displayName = \"ModalView.Overlay\";\n\ntype ContentProps = React.ComponentPropsWithoutRef<typeof Dialog.Content> &\n React.ComponentPropsWithRef<\"div\">;\ntype ContentRef = React.ElementRef<\"div\">;\n\nconst Content = React.forwardRef<ContentRef, ContentProps>(\n ({ children, className, ...props }, forwardedRef) => {\n return (\n <Dialog.Content\n className={cx(\"knock-guide-modal\", className)}\n ref={forwardedRef}\n {...props}\n >\n {children}\n </Dialog.Content>\n );\n },\n);\nContent.displayName = \"ModalView.Content\";\n\nconst Header: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-modal__header\", className)} {...props}>\n {children}\n </div>\n );\n};\nHeader.displayName = \"ModalView.Header\";\n\ntype TitleProps = React.ComponentPropsWithoutRef<typeof Dialog.Title> &\n React.ComponentPropsWithRef<\"div\"> & {\n title: string;\n };\n\nconst Title = ({ title, className, ...props }: TitleProps) => {\n return (\n <Dialog.Title\n className={cx(\"knock-guide-modal__title\", className)}\n {...props}\n >\n {title}\n </Dialog.Title>\n );\n};\nTitle.displayName = \"ModalView.Title\";\n\nconst Body: React.FC<{ body: string } & React.ComponentPropsWithRef<\"div\">> = ({\n body,\n className,\n ...props\n}) => {\n return (\n <Dialog.Description\n className={cx(\"knock-guide-modal__body\", className)}\n dangerouslySetInnerHTML={{ __html: body }}\n {...props}\n />\n );\n};\nBody.displayName = \"ModalView.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-modal__img\", className)}\n alt={alt || \"\"}\n {...props}\n >\n {children}\n </img>\n );\n};\nImg.displayName = \"ModalView.Img\";\n\nconst Actions: React.FC<\n React.PropsWithChildren<React.ComponentPropsWithRef<\"div\">>\n> = ({ children, className, ...props }) => {\n return (\n <div className={cx(\"knock-guide-modal__actions\", className)} {...props}>\n {children}\n </div>\n );\n};\nActions.displayName = \"ModalView.Actions\";\n\nconst PrimaryButton: React.FC<\n ButtonContent & React.ComponentPropsWithRef<\"button\">\n> = ({ text, action, className, ...props }) => {\n return (\n <button className={cx(\"knock-guide-modal__action\", className)} {...props}>\n {text}\n </button>\n );\n};\nPrimaryButton.displayName = \"ModalView.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-modal__action knock-guide-modal__action--secondary\",\n className,\n )}\n {...props}\n >\n {text}\n </button>\n );\n};\nSecondaryButton.displayName = \"ModalView.SecondaryButton\";\n\ntype CloseProps = React.ComponentPropsWithoutRef<typeof Dialog.Close> &\n React.ComponentPropsWithRef<\"button\">;\n\nconst Close = ({ className, ...props }: CloseProps) => {\n return (\n <Dialog.Close\n className={cx(\"knock-guide-modal__close\", className)}\n {...props}\n >\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 </Dialog.Close>\n );\n};\nClose.displayName = \"ModalView.Close\";\n\ntype ModalContent = {\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: ModalContent;\n colorMode?: ColorMode;\n onOpenChange?: (open: boolean) => void;\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 onOpenChange,\n onDismiss,\n onButtonClick,\n onImageClick,\n}) => {\n return (\n <Root onOpenChange={onOpenChange}>\n <Overlay />\n {/* Must pass color mode to content for css variables to be set properly */}\n <Content\n data-knock-color-mode={colorMode}\n onPointerDownOutside={onDismiss}\n >\n <Header>\n <Title title={content.title} />\n {content.dismissible && <Close onClick={onDismiss} />}\n </Header>\n\n <Body body={content.body} />\n\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\n {(content.primary_button || content.secondary_button) && (\n <Actions>\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, {\n name: \"secondary_button\",\n text,\n action,\n });\n }\n }}\n />\n )}\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 </Actions>\n )}\n </Content>\n </Root>\n );\n};\nDefaultView.displayName = \"ModalView.Default\";\n\ntype ModalProps = {\n guideKey?: string;\n onButtonClick?: (e: React.MouseEvent, target: TargetButtonWithGuide) => void;\n onImageClick?: (e: React.MouseEvent, target: TargetImageWithGuide) => void;\n};\n\nexport const Modal: React.FC<ModalProps> = ({\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 ModalContent}\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};\nModal.displayName = \"Modal\";\n\nexport const ModalView = {} as {\n Default: typeof DefaultView;\n Root: typeof Root;\n Overlay: typeof Overlay;\n Content: typeof Content;\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 Close: typeof Close;\n};\n\nObject.assign(ModalView, {\n Default: DefaultView,\n Root,\n Overlay,\n Content,\n Title,\n Body,\n Img,\n Actions,\n PrimaryButton,\n SecondaryButton,\n Close,\n});\n"],"mappings":";;;;;;;;AAiBA,IAAM,IAAe,SAQf,KAAQ,EAAE,aAAU,iBAAc,GAAG,QAEvC,kBAAC,EAAO,MAAR;CAAa,aAAA;CAA0B;CAAc,GAAI;WACvD,kBAAC,EAAO,QAAR,EAAgB,YAAwB,CAAA;AAC7B,CAAA;AAGjB,EAAK,cAAc;AAMnB,IAAM,IAAU,EAAM,YACnB,EAAE,cAAW,GAAG,KAAS,MAEtB,kBAAC,EAAO,SAAR;CACE,WAAW,EAAG,8BAA8B,CAAS;CACrD,KAAK;CACL,GAAI;AACL,CAAA,CAGP;AACA,EAAQ,cAAc;AAMtB,IAAM,IAAU,EAAM,YACnB,EAAE,aAAU,cAAW,GAAG,KAAS,MAEhC,kBAAC,EAAO,SAAR;CACE,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as ModalView };
@@ -1,24 +1,46 @@
1
- import t from "react";
2
- import { Button as a } from "@telegraph/button";
3
- import { TOOLBAR_Z_INDEX as r } from "./shared.mjs";
4
- /* empty css */
5
- const s = ({
6
- onClick: e,
7
- positioned: o = !0
8
- }) => /* @__PURE__ */ t.createElement(a, { onClick: e, ...o && {
9
- position: "fixed",
10
- top: "4",
11
- right: "4",
12
- style: {
13
- zIndex: r
14
- }
15
- }, bg: "surface-2", shadow: "3", rounded: "3", w: "10", h: "10", variant: "soft", "data-tgph-appearance": "dark", "aria-label": "Expand guide toolbar" }, /* @__PURE__ */ t.createElement("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
16
- position: "absolute",
17
- top: "50%",
18
- left: "50%",
19
- transform: "translate(-50%, -50%)"
20
- } }, /* @__PURE__ */ t.createElement("path", { d: "M11.6001 32.4V7.59998H16.6365V21.8219H16.7774L22.3067 14.8525H27.9418L21.8138 22.0696L28.4001 32.4H22.7996L18.8555 25.572L16.6365 28.0839V32.4H11.6001Z", fill: "#EDEEEF" }), /* @__PURE__ */ t.createElement("path", { d: "M28.4 10.4C28.4 11.9464 27.1467 13.2 25.6 13.2C24.0534 13.2 22.8 11.9464 22.8 10.4C22.8 8.85358 24.0534 7.59998 25.6 7.59998C27.1467 7.59998 28.4 8.85358 28.4 10.4Z", fill: "#FF573A" })));
21
- export {
22
- s as KnockButton
23
- };
24
- //# sourceMappingURL=KnockButton.mjs.map
1
+ import "./shared.mjs";
2
+ /* empty css */
3
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
4
+ import { Button as n } from "@telegraph/button";
5
+ //#region src/modules/guide/components/Toolbar/KnockButton.tsx
6
+ var r = ({ onClick: r, positioned: i = !0 }) => /* @__PURE__ */ e(n, {
7
+ onClick: r,
8
+ ...i && {
9
+ position: "fixed",
10
+ top: "4",
11
+ right: "4",
12
+ style: { zIndex: "var(--tgph-zIndex-tooltip)" }
13
+ },
14
+ bg: "surface-2",
15
+ shadow: "3",
16
+ rounded: "3",
17
+ w: "10",
18
+ h: "10",
19
+ variant: "soft",
20
+ "data-tgph-appearance": "dark",
21
+ "aria-label": "Expand guide toolbar",
22
+ children: /* @__PURE__ */ t("svg", {
23
+ width: "40",
24
+ height: "40",
25
+ viewBox: "0 0 40 40",
26
+ fill: "none",
27
+ xmlns: "http://www.w3.org/2000/svg",
28
+ style: {
29
+ position: "absolute",
30
+ top: "50%",
31
+ left: "50%",
32
+ transform: "translate(-50%, -50%)"
33
+ },
34
+ children: [/* @__PURE__ */ e("path", {
35
+ d: "M11.6001 32.4V7.59998H16.6365V21.8219H16.7774L22.3067 14.8525H27.9418L21.8138 22.0696L28.4001 32.4H22.7996L18.8555 25.572L16.6365 28.0839V32.4H11.6001Z",
36
+ fill: "#EDEEEF"
37
+ }), /* @__PURE__ */ e("path", {
38
+ d: "M28.4 10.4C28.4 11.9464 27.1467 13.2 25.6 13.2C24.0534 13.2 22.8 11.9464 22.8 10.4C22.8 8.85358 24.0534 7.59998 25.6 7.59998C27.1467 7.59998 28.4 8.85358 28.4 10.4Z",
39
+ fill: "#FF573A"
40
+ })]
41
+ })
42
+ });
43
+ //#endregion
44
+ export { r as KnockButton };
45
+
46
+ //# sourceMappingURL=KnockButton.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"KnockButton.mjs","sources":["../../../../../../src/modules/guide/components/Toolbar/KnockButton.tsx"],"sourcesContent":["import { Button } from \"@telegraph/button\";\n\nimport { TOOLBAR_Z_INDEX } from \"./shared\";\nimport \"./styles.css\";\n\ntype Props = {\n onClick: () => void;\n positioned?: boolean;\n};\n\nexport const KnockButton = ({ onClick, positioned = true }: Props) => {\n return (\n <Button\n onClick={onClick}\n {...(positioned && {\n position: \"fixed\" as const,\n top: \"4\" as const,\n right: \"4\" as const,\n style: { zIndex: TOOLBAR_Z_INDEX },\n })}\n bg=\"surface-2\"\n shadow=\"3\"\n rounded=\"3\"\n w=\"10\"\n h=\"10\"\n variant=\"soft\"\n data-tgph-appearance=\"dark\"\n aria-label=\"Expand guide toolbar\"\n >\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n }}\n >\n <path\n d=\"M11.6001 32.4V7.59998H16.6365V21.8219H16.7774L22.3067 14.8525H27.9418L21.8138 22.0696L28.4001 32.4H22.7996L18.8555 25.572L16.6365 28.0839V32.4H11.6001Z\"\n fill=\"#EDEEEF\"\n />\n <path\n d=\"M28.4 10.4C28.4 11.9464 27.1467 13.2 25.6 13.2C24.0534 13.2 22.8 11.9464 22.8 10.4C22.8 8.85358 24.0534 7.59998 25.6 7.59998C27.1467 7.59998 28.4 8.85358 28.4 10.4Z\"\n fill=\"#FF573A\"\n />\n </svg>\n </Button>\n );\n};\n"],"names":["KnockButton","onClick","positioned","React","Button","position","top","right","style","zIndex","TOOLBAR_Z_INDEX","left","transform"],"mappings":";;;;AAUO,MAAMA,IAAcA,CAAC;AAAA,EAAEC,SAAAA;AAAAA,EAASC,YAAAA,IAAa;AAAY,MAE3DC,gBAAAA,EAAA,cAAAC,GAAA,EACC,SAAAH,GACKC,GAAAA,KAAc;AAAA,EACjBG,UAAU;AAAA,EACVC,KAAK;AAAA,EACLC,OAAO;AAAA,EACPC,OAAO;AAAA,IAAEC,QAAQC;AAAAA,EAAAA;AAAgB,GAEnC,IAAG,aACH,QAAO,KACP,SAAQ,KACR,GAAE,MACF,GAAE,MACF,SAAQ,QACR,wBAAqB,QACrB,cAAW,uBAEX,GAAAP,gBAAAA,EAAA,cAAC,OACC,EAAA,OAAM,MACN,QAAO,MACP,SAAQ,aACR,MAAK,QACL,OAAM,8BACN,OAAO;AAAA,EACLE,UAAU;AAAA,EACVC,KAAK;AAAA,EACLK,MAAM;AAAA,EACNC,WAAW;AAAA,KAGbT,gBAAAA,EAAA,cAAC,QACC,EAAA,GAAE,2JACF,MAAK,UAAS,CAAA,GAEhBA,gBAAAA,EAAA,cAAC,UACC,GAAE,wKACF,MAAK,UAAS,CAAA,CAElB,CACF;"}
1
+ {"version":3,"file":"KnockButton.mjs","names":[],"sources":["../../../../../../src/modules/guide/components/Toolbar/KnockButton.tsx"],"sourcesContent":["import { Button } from \"@telegraph/button\";\n\nimport { TOOLBAR_Z_INDEX } from \"./shared\";\nimport \"./styles.css\";\n\ntype Props = {\n onClick: () => void;\n positioned?: boolean;\n};\n\nexport const KnockButton = ({ onClick, positioned = true }: Props) => {\n return (\n <Button\n onClick={onClick}\n {...(positioned && {\n position: \"fixed\" as const,\n top: \"4\" as const,\n right: \"4\" as const,\n style: { zIndex: TOOLBAR_Z_INDEX },\n })}\n bg=\"surface-2\"\n shadow=\"3\"\n rounded=\"3\"\n w=\"10\"\n h=\"10\"\n variant=\"soft\"\n data-tgph-appearance=\"dark\"\n aria-label=\"Expand guide toolbar\"\n >\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n }}\n >\n <path\n d=\"M11.6001 32.4V7.59998H16.6365V21.8219H16.7774L22.3067 14.8525H27.9418L21.8138 22.0696L28.4001 32.4H22.7996L18.8555 25.572L16.6365 28.0839V32.4H11.6001Z\"\n fill=\"#EDEEEF\"\n />\n <path\n d=\"M28.4 10.4C28.4 11.9464 27.1467 13.2 25.6 13.2C24.0534 13.2 22.8 11.9464 22.8 10.4C22.8 8.85358 24.0534 7.59998 25.6 7.59998C27.1467 7.59998 28.4 8.85358 28.4 10.4Z\"\n fill=\"#FF573A\"\n />\n </svg>\n </Button>\n );\n};\n"],"mappings":";;;;;AAUA,IAAa,KAAe,EAAE,YAAS,gBAAa,SAEhD,kBAAC,GAAD;CACW;CACT,GAAK,KAAc;EACjB,UAAU;EACV,KAAK;EACL,OAAO;EACP,OAAO,EAAE,QAAA,6BAAwB;CACnC;CACA,IAAG;CACH,QAAO;CACP,SAAQ;CACR,GAAE;CACF,GAAE;CACF,SAAQ;CACR,wBAAqB;CACrB,cAAW;WAEX,kBAAC,OAAD;EACE,OAAM;EACN,QAAO;EACP,SAAQ;EACR,MAAK;EACL,OAAM;EACN,OAAO;GACL,UAAU;GACV,KAAK;GACL,MAAM;GACN,WAAW;EACb;YAXF,CAaE,kBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA,GACD,kBAAC,QAAD;GACE,GAAE;GACF,MAAK;EACN,CAAA,CACE;;AACC,CAAA"}