@nylas/web-elements 0.0.0-canary-20241008193213 → 0.0.0-canary-20241015194719

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 (813) hide show
  1. package/dist/cdn/add-circle/add-circle.es.js +1 -1
  2. package/dist/cdn/add-circle-icon/add-circle-icon.es.js +1 -1
  3. package/dist/cdn/archive-icon/archive-icon.es.js +127 -127
  4. package/dist/cdn/arrow-icon/arrow-icon.es.js +248 -248
  5. package/dist/cdn/bold-icon/bold-icon.es.js +1 -1
  6. package/dist/cdn/button-component/button-component.es.js +2 -2
  7. package/dist/cdn/calendar/calendar.es.js +77 -77
  8. package/dist/cdn/calendar-agenda/calendar-agenda.es.js +1 -1
  9. package/dist/cdn/calendar-agenda-fill/calendar-agenda-fill.es.js +1 -1
  10. package/dist/cdn/calendar-agenda-fill-icon/calendar-agenda-fill-icon.es.js +1 -1
  11. package/dist/cdn/calendar-agenda-icon/calendar-agenda-icon.es.js +1 -1
  12. package/dist/cdn/calendar-cancel/calendar-cancel.es.js +1 -1
  13. package/dist/cdn/calendar-cancel-icon/calendar-cancel-icon.es.js +1 -1
  14. package/dist/cdn/calendar-check/calendar-check.es.js +139 -139
  15. package/dist/cdn/calendar-check-icon/calendar-check-icon.es.js +14 -14
  16. package/dist/cdn/calendar-icon/calendar-icon.es.js +24 -24
  17. package/dist/cdn/calendar-info/calendar-info.es.js +1 -1
  18. package/dist/cdn/calendar-info-icon/calendar-info-icon.es.js +1 -1
  19. package/dist/cdn/calendar-patterns/calendar-patterns.es.js +1 -1
  20. package/dist/cdn/calendar-patterns-icon/calendar-patterns-icon.es.js +1 -1
  21. package/dist/cdn/checkbox-component/checkbox-component.es.js +1 -1
  22. package/dist/cdn/checkmark/checkmark.es.js +86 -86
  23. package/dist/cdn/checkmark-circle/checkmark-circle.es.js +99 -99
  24. package/dist/cdn/checkmark-circle-icon/checkmark-circle-icon.es.js +14 -14
  25. package/dist/cdn/checkmark-icon/checkmark-icon.es.js +1 -1
  26. package/dist/cdn/chevron/chevron.es.js +16 -16
  27. package/dist/cdn/chevron-icon/chevron-icon.es.js +14 -14
  28. package/dist/cdn/clock/clock.es.js +16 -16
  29. package/dist/cdn/clock-icon/clock-icon.es.js +14 -14
  30. package/dist/cdn/close/close.es.js +1 -1
  31. package/dist/cdn/close-icon/close-icon.es.js +54 -54
  32. package/dist/cdn/constants/constants.es.js +3 -3
  33. package/dist/cdn/copy/copy.es.js +239 -239
  34. package/dist/cdn/copy-icon/copy-icon.es.js +271 -271
  35. package/dist/cdn/delete/delete.es.js +1 -1
  36. package/dist/cdn/delete-icon/delete-icon.es.js +1 -1
  37. package/dist/cdn/document-refresh-icon/document-refresh-icon.es.js +1 -1
  38. package/dist/cdn/dragable/dragable.es.js +54 -54
  39. package/dist/cdn/dragable-icon/dragable-icon.es.js +1 -1
  40. package/dist/cdn/edit/edit.es.js +1 -1
  41. package/dist/cdn/edit-icon/edit-icon.es.js +1 -1
  42. package/dist/cdn/envelope/envelope.es.js +25 -25
  43. package/dist/cdn/envelope-fill/envelope-fill.es.js +16 -16
  44. package/dist/cdn/envelope-fill-icon/envelope-fill-icon.es.js +97 -97
  45. package/dist/cdn/envelope-icon/envelope-icon.es.js +24 -24
  46. package/dist/cdn/eye/eye.es.js +1 -1
  47. package/dist/cdn/eye-icon/eye-icon.es.js +1 -1
  48. package/dist/cdn/feedback-icon/feedback-icon.es.js +86 -86
  49. package/dist/cdn/flow/flow.es.js +1 -1
  50. package/dist/cdn/flow-icon/flow-icon.es.js +1 -1
  51. package/dist/cdn/folder-icon/folder-icon.es.js +14 -14
  52. package/dist/cdn/forward-icon/forward-icon.es.js +240 -240
  53. package/dist/cdn/globe/globe.es.js +1 -1
  54. package/dist/cdn/globe-icon/globe-icon.es.js +1 -1
  55. package/dist/cdn/google-logo/google-logo.es.js +1 -1
  56. package/dist/cdn/google-logo-icon/google-logo-icon.es.js +1 -1
  57. package/dist/cdn/google-meet/google-meet.es.js +15 -15
  58. package/dist/cdn/google-meet-icon/google-meet-icon.es.js +1 -1
  59. package/dist/cdn/inbox-icon/inbox-icon.es.js +1 -1
  60. package/dist/cdn/info/info.es.js +239 -239
  61. package/dist/cdn/info-icon/info-icon.es.js +240 -240
  62. package/dist/cdn/input-color-picker/input-color-picker.es.js +3 -3
  63. package/dist/cdn/input-component/input-component.es.js +1 -1
  64. package/dist/cdn/input-dropdown/input-dropdown.es.js +1 -1
  65. package/dist/cdn/input-image-url/input-image-url.es.js +2 -2
  66. package/dist/cdn/italic-icon/italic-icon.es.js +86 -86
  67. package/dist/cdn/loading/loading.es.js +270 -270
  68. package/dist/cdn/loading-icon/loading-icon.es.js +271 -271
  69. package/dist/cdn/location/location.es.js +100 -100
  70. package/dist/cdn/location-icon/location-icon.es.js +19 -19
  71. package/dist/cdn/location-off/location-off.es.js +86 -86
  72. package/dist/cdn/location-off-icon/location-off-icon.es.js +1 -1
  73. package/dist/cdn/microsof-teams/microsof-teams.es.js +96 -96
  74. package/dist/cdn/microsoft-logo/microsoft-logo.es.js +1 -1
  75. package/dist/cdn/microsoft-logo-icon/microsoft-logo-icon.es.js +1 -1
  76. package/dist/cdn/microsoft-teams-icon/microsoft-teams-icon.es.js +97 -97
  77. package/dist/cdn/multi-select-dropdown/multi-select-dropdown.es.js +3 -3
  78. package/dist/cdn/nylas-additional-participants/nylas-additional-participants.es.js +12 -12
  79. package/dist/cdn/nylas-availability-picker/nylas-availability-picker.es.js +15 -15
  80. package/dist/cdn/nylas-booked-event-card/nylas-booked-event-card.es.js +10 -10
  81. package/dist/cdn/nylas-booking-calendar-picker/nylas-booking-calendar-picker.es.js +5 -5
  82. package/dist/cdn/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.es.js +7 -7
  83. package/dist/cdn/nylas-booking-confirmation-type/nylas-booking-confirmation-type.es.js +733 -734
  84. package/dist/cdn/nylas-booking-form/nylas-booking-form.es.js +154 -151
  85. package/dist/cdn/nylas-booking-form-config/nylas-booking-form-config.es.js +9 -9
  86. package/dist/cdn/nylas-buffer-time/nylas-buffer-time.es.js +5 -5
  87. package/dist/cdn/nylas-calendar-picker/nylas-calendar-picker.es.js +7 -7
  88. package/dist/cdn/nylas-cancel-booking-form/nylas-cancel-booking-form.es.js +10 -10
  89. package/dist/cdn/nylas-cancellation-policy/nylas-cancellation-policy.es.js +3 -3
  90. package/dist/cdn/nylas-cancelled-event-card/nylas-cancelled-event-card.es.js +7 -7
  91. package/dist/cdn/nylas-confirmation-email/nylas-confirmation-email.es.js +15 -15
  92. package/dist/cdn/nylas-confirmed-event-card/nylas-confirmed-event-card.es.js +723 -723
  93. package/dist/cdn/nylas-connected-calendars/nylas-connected-calendars.es.js +179 -179
  94. package/dist/cdn/nylas-custom-booking-flow/nylas-custom-booking-flow.es.js +2 -2
  95. package/dist/cdn/nylas-custom-event-slug/nylas-custom-event-slug.es.js +7 -7
  96. package/dist/cdn/nylas-customize-booking-settings/nylas-customize-booking-settings.es.js +147 -147
  97. package/dist/cdn/nylas-date-picker/nylas-date-picker.es.js +7 -7
  98. package/dist/cdn/nylas-editor-tabs/nylas-editor-tabs.es.js +6323 -5910
  99. package/dist/cdn/nylas-event-description/nylas-event-description.es.js +3 -3
  100. package/dist/cdn/nylas-event-duration/nylas-event-duration.es.js +5 -5
  101. package/dist/cdn/nylas-event-info/nylas-event-info.es.js +2 -2
  102. package/dist/cdn/nylas-event-limits/nylas-event-limits.es.js +2 -2
  103. package/dist/cdn/nylas-event-location/nylas-event-location.es.js +2558 -2533
  104. package/dist/cdn/nylas-event-title/nylas-event-title.es.js +10 -5
  105. package/dist/cdn/nylas-feedback-form/nylas-feedback-form.es.js +8 -8
  106. package/dist/cdn/nylas-form-card/nylas-form-card.es.js +1 -1
  107. package/dist/cdn/nylas-if-state/nylas-if-state.es.js +1 -1
  108. package/dist/cdn/nylas-limit-future-bookings/nylas-limit-future-bookings.es.js +8 -8
  109. package/dist/cdn/nylas-list-configurations/nylas-list-configurations.es.js +21 -17
  110. package/dist/cdn/nylas-locale-switch/nylas-locale-switch.es.js +1168 -1168
  111. package/dist/cdn/nylas-login/nylas-login.es.js +1 -1
  112. package/dist/cdn/nylas-logo/nylas-logo.es.js +125 -125
  113. package/dist/cdn/nylas-min-booking-notice/nylas-min-booking-notice.es.js +10 -10
  114. package/dist/cdn/nylas-min-cancellation-notice/nylas-min-cancellation-notice.es.js +10 -10
  115. package/dist/cdn/nylas-notification/nylas-notification.es.js +3 -3
  116. package/dist/cdn/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.es.js +6 -6
  117. package/dist/cdn/nylas-page-name/nylas-page-name.es.js +7 -7
  118. package/dist/cdn/nylas-page-styling/nylas-page-styling.es.js +4 -4
  119. package/dist/cdn/nylas-participant-booking-calendars/nylas-participant-booking-calendars.es.js +8 -8
  120. package/dist/cdn/nylas-participants-custom-availability/nylas-participants-custom-availability.es.js +176 -176
  121. package/dist/cdn/nylas-provider/nylas-provider.es.js +652 -644
  122. package/dist/cdn/nylas-reminder-emails/nylas-reminder-emails.es.js +17 -17
  123. package/dist/cdn/nylas-reminder-time/nylas-reminder-time.es.js +5 -5
  124. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +1364 -937
  125. package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +1077 -1053
  126. package/dist/cdn/nylas-scheduling-method/nylas-scheduling-method.es.js +10 -12
  127. package/dist/cdn/nylas-selected-event-card/nylas-selected-event-card.es.js +4 -4
  128. package/dist/cdn/nylas-time-window-picker/nylas-time-window-picker.es.js +1 -1
  129. package/dist/cdn/nylas-timeslot-interval/nylas-timeslot-interval.es.js +147 -149
  130. package/dist/cdn/nylas-timeslot-picker/nylas-timeslot-picker.es.js +6 -6
  131. package/dist/cdn/paintbrush/paintbrush.es.js +239 -239
  132. package/dist/cdn/paintbrush-fill/paintbrush-fill.es.js +1 -1
  133. package/dist/cdn/paintbrush-fill-icon/paintbrush-fill-icon.es.js +1 -1
  134. package/dist/cdn/paintbrush-icon/paintbrush-icon.es.js +240 -240
  135. package/dist/cdn/people/people.es.js +1 -1
  136. package/dist/cdn/people-icon/people-icon.es.js +1 -1
  137. package/dist/cdn/person/person.es.js +1 -1
  138. package/dist/cdn/person-clipboard/person-clipboard.es.js +1 -1
  139. package/dist/cdn/person-clipboard-icon/person-clipboard-icon.es.js +1 -1
  140. package/dist/cdn/person-icon/person-icon.es.js +1 -1
  141. package/dist/cdn/play-icon/play-icon.es.js +248 -248
  142. package/dist/cdn/plus/plus.es.js +16 -16
  143. package/dist/cdn/plus-icon/plus-icon.es.js +14 -14
  144. package/dist/cdn/radio-button-group/radio-button-group.es.js +1 -1
  145. package/dist/cdn/refresh-icon/refresh-icon.es.js +14 -14
  146. package/dist/cdn/reply-all-icon/reply-all-icon.es.js +14 -14
  147. package/dist/cdn/reply-icon/reply-icon.es.js +14 -14
  148. package/dist/cdn/scheduler-store/scheduler-store.es.js +654 -646
  149. package/dist/cdn/search/search.es.js +1 -1
  150. package/dist/cdn/search-icon/search-icon.es.js +86 -86
  151. package/dist/cdn/select-dropdown/select-dropdown.es.js +3 -3
  152. package/dist/cdn/sent-icon/sent-icon.es.js +1 -1
  153. package/dist/cdn/spam-icon/spam-icon.es.js +86 -86
  154. package/dist/cdn/star-icon/star-icon.es.js +1 -1
  155. package/dist/cdn/stop-icon/stop-icon.es.js +1 -1
  156. package/dist/cdn/textarea-component/textarea-component.es.js +3 -3
  157. package/dist/cdn/time-period-selector/time-period-selector.es.js +230 -230
  158. package/dist/cdn/toggle-switch/toggle-switch.es.js +1 -1
  159. package/dist/cdn/toolitp-component/toolitp-component.es.js +23 -23
  160. package/dist/cdn/tooltip-component/tooltip-component.es.js +26 -26
  161. package/dist/cdn/translate/translate.es.js +246 -246
  162. package/dist/cdn/translate-icon/translate-icon.es.js +247 -247
  163. package/dist/cdn/trash/trash.es.js +1 -1
  164. package/dist/cdn/trash-fill-icon/trash-fill-icon.es.js +14 -14
  165. package/dist/cdn/trash-icon/trash-icon.es.js +1 -1
  166. package/dist/cdn/underline-icon/underline-icon.es.js +1 -1
  167. package/dist/cdn/warning/warning.es.js +247 -247
  168. package/dist/cdn/warning-icon/warning-icon.es.js +248 -248
  169. package/dist/cdn/zoom/zoom.es.js +1 -1
  170. package/dist/cdn/zoom-icon/zoom-icon.es.js +1 -1
  171. package/dist/cjs/add-circle-icon_2.cjs.entry.js +2 -2
  172. package/dist/cjs/archive-icon.cjs.entry.js +1 -1
  173. package/dist/cjs/arrow-icon.cjs.entry.js +1 -1
  174. package/dist/cjs/bold-icon.cjs.entry.js +1 -1
  175. package/dist/cjs/button-component_2.cjs.entry.js +2 -2
  176. package/dist/cjs/{calendar-agenda-fill-icon_51.cjs.entry.js → calendar-agenda-fill-icon_54.cjs.entry.js} +703 -304
  177. package/dist/cjs/calendar-agenda-fill-icon_54.cjs.entry.js.map +1 -0
  178. package/dist/cjs/calendar-cancel-icon.cjs.entry.js +1 -1
  179. package/dist/cjs/calendar-check-icon_2.cjs.entry.js +2 -2
  180. package/dist/cjs/calendar-icon.cjs.entry.js +1 -1
  181. package/dist/cjs/checkbox-component_2.cjs.entry.js +2 -2
  182. package/dist/cjs/chevron-icon_3.cjs.entry.js +3 -3
  183. package/dist/cjs/clock-icon_4.cjs.entry.js +4 -4
  184. package/dist/cjs/copy-icon.cjs.entry.js +1 -1
  185. package/dist/cjs/delete-icon.cjs.entry.js +1 -1
  186. package/dist/cjs/document-refresh-icon.cjs.entry.js +1 -1
  187. package/dist/cjs/folder-icon.cjs.entry.js +1 -1
  188. package/dist/cjs/forward-icon.cjs.entry.js +1 -1
  189. package/dist/cjs/globe-icon.cjs.entry.js +1 -1
  190. package/dist/cjs/google-logo-icon_4.cjs.entry.js +34 -23
  191. package/dist/cjs/google-logo-icon_4.cjs.entry.js.map +1 -1
  192. package/dist/cjs/inbox-icon.cjs.entry.js +1 -1
  193. package/dist/cjs/index-7af03e3f.js +2 -10
  194. package/dist/cjs/info-icon_2.cjs.entry.js +2 -2
  195. package/dist/cjs/input-color-picker.cjs.entry.js +2 -2
  196. package/dist/cjs/input-component.cjs.entry.js +1 -1
  197. package/dist/cjs/input-dropdown.cjs.entry.js +1 -1
  198. package/dist/cjs/italic-icon.cjs.entry.js +1 -1
  199. package/dist/cjs/loader.cjs.js +1 -1
  200. package/dist/cjs/multi-select-dropdown.cjs.entry.js +1 -1
  201. package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js +33 -32
  202. package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js.map +1 -1
  203. package/dist/cjs/nylas-form-card.cjs.entry.js +1 -1
  204. package/dist/cjs/nylas-if-state.cjs.entry.js +1 -1
  205. package/dist/cjs/nylas-login.cjs.entry.js +1 -1
  206. package/dist/cjs/nylas-provider.cjs.entry.js +2 -2
  207. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
  208. package/dist/cjs/nylas-scheduling.cjs.entry.js +22 -9
  209. package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
  210. package/dist/cjs/nylas-time-window-picker.cjs.entry.js +1 -1
  211. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  212. package/dist/cjs/person-icon.cjs.entry.js +1 -1
  213. package/dist/cjs/play-icon.cjs.entry.js +1 -1
  214. package/dist/cjs/refresh-icon.cjs.entry.js +1 -1
  215. package/dist/cjs/reply-all-icon.cjs.entry.js +1 -1
  216. package/dist/cjs/reply-icon.cjs.entry.js +1 -1
  217. package/dist/cjs/{scheduler-store-4489a68b.js → scheduler-store-e3ddffc1.js} +13 -4
  218. package/dist/cjs/scheduler-store-e3ddffc1.js.map +1 -0
  219. package/dist/cjs/sent-icon.cjs.entry.js +1 -1
  220. package/dist/cjs/spam-icon.cjs.entry.js +1 -1
  221. package/dist/cjs/star-icon.cjs.entry.js +1 -1
  222. package/dist/cjs/stop-icon.cjs.entry.js +1 -1
  223. package/dist/cjs/textarea-component.cjs.entry.js +1 -1
  224. package/dist/cjs/time-period-selector.cjs.entry.js +1 -1
  225. package/dist/cjs/translate-icon.cjs.entry.js +1 -1
  226. package/dist/cjs/trash-fill-icon.cjs.entry.js +1 -1
  227. package/dist/cjs/underline-icon.cjs.entry.js +1 -1
  228. package/dist/cjs/warning-icon.cjs.entry.js +1 -1
  229. package/dist/collection/common/icons/add-circle.js +1 -1
  230. package/dist/collection/common/icons/archive.js +1 -1
  231. package/dist/collection/common/icons/arrow.js +1 -1
  232. package/dist/collection/common/icons/bold.js +1 -1
  233. package/dist/collection/common/icons/calendar-agenda-fill.js +1 -1
  234. package/dist/collection/common/icons/calendar-agenda.js +1 -1
  235. package/dist/collection/common/icons/calendar-cancel.js +1 -1
  236. package/dist/collection/common/icons/calendar-check.js +1 -1
  237. package/dist/collection/common/icons/calendar-info.js +1 -1
  238. package/dist/collection/common/icons/calendar-patterns.js +1 -1
  239. package/dist/collection/common/icons/calendar.js +1 -1
  240. package/dist/collection/common/icons/checkmark-circle.js +1 -1
  241. package/dist/collection/common/icons/checkmark.js +1 -1
  242. package/dist/collection/common/icons/chevron.js +1 -1
  243. package/dist/collection/common/icons/clock.js +1 -1
  244. package/dist/collection/common/icons/close.js +1 -1
  245. package/dist/collection/common/icons/copy.js +1 -1
  246. package/dist/collection/common/icons/delete.js +1 -1
  247. package/dist/collection/common/icons/document-refresh.js +1 -1
  248. package/dist/collection/common/icons/dragable.js +1 -1
  249. package/dist/collection/common/icons/edit.js +1 -1
  250. package/dist/collection/common/icons/envelope-fill.js +1 -1
  251. package/dist/collection/common/icons/envelope.js +1 -1
  252. package/dist/collection/common/icons/eye.js +1 -1
  253. package/dist/collection/common/icons/feedback-icon.js +1 -1
  254. package/dist/collection/common/icons/flow.js +1 -1
  255. package/dist/collection/common/icons/folder.js +1 -1
  256. package/dist/collection/common/icons/forward.js +1 -1
  257. package/dist/collection/common/icons/globe.js +1 -1
  258. package/dist/collection/common/icons/google-logo.js +1 -1
  259. package/dist/collection/common/icons/google-meet.js +1 -1
  260. package/dist/collection/common/icons/inbox.js +1 -1
  261. package/dist/collection/common/icons/info.js +1 -1
  262. package/dist/collection/common/icons/italic.js +1 -1
  263. package/dist/collection/common/icons/loading.js +1 -1
  264. package/dist/collection/common/icons/location-off.js +1 -1
  265. package/dist/collection/common/icons/location.js +1 -1
  266. package/dist/collection/common/icons/microsof-teams.js +1 -1
  267. package/dist/collection/common/icons/microsoft-logo.js +1 -1
  268. package/dist/collection/common/icons/nylas-logo.js +1 -1
  269. package/dist/collection/common/icons/paintbrush-fill.js +1 -1
  270. package/dist/collection/common/icons/paintbrush.js +1 -1
  271. package/dist/collection/common/icons/people.js +1 -1
  272. package/dist/collection/common/icons/person-clipboard.js +1 -1
  273. package/dist/collection/common/icons/person.js +1 -1
  274. package/dist/collection/common/icons/play.js +1 -1
  275. package/dist/collection/common/icons/plus.js +1 -1
  276. package/dist/collection/common/icons/refresh.js +1 -1
  277. package/dist/collection/common/icons/reply-all.js +1 -1
  278. package/dist/collection/common/icons/reply.js +1 -1
  279. package/dist/collection/common/icons/search.js +1 -1
  280. package/dist/collection/common/icons/sent.js +1 -1
  281. package/dist/collection/common/icons/spam.js +1 -1
  282. package/dist/collection/common/icons/star.js +1 -1
  283. package/dist/collection/common/icons/stop.js +1 -1
  284. package/dist/collection/common/icons/translate.js +1 -1
  285. package/dist/collection/common/icons/trash-fill.js +1 -1
  286. package/dist/collection/common/icons/trash.js +1 -1
  287. package/dist/collection/common/icons/underline.js +1 -1
  288. package/dist/collection/common/icons/warning.js +1 -1
  289. package/dist/collection/common/icons/zoom.js +1 -1
  290. package/dist/collection/common/types.js.map +1 -1
  291. package/dist/collection/components/design-system/button-component/button-component.js +1 -1
  292. package/dist/collection/components/design-system/checkbox-component/checkbox-component.js +1 -1
  293. package/dist/collection/components/design-system/input-color-picker/input-color-picker.js +2 -2
  294. package/dist/collection/components/design-system/input-component/input-component.js +1 -1
  295. package/dist/collection/components/design-system/input-dropdown/input-dropdown.js +1 -1
  296. package/dist/collection/components/design-system/input-image-url/input-image-url.js +1 -1
  297. package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js +1 -1
  298. package/dist/collection/components/design-system/radio-button-group/radio-button-group.js +1 -1
  299. package/dist/collection/components/design-system/select-dropdown/select-dropdown.js +1 -1
  300. package/dist/collection/components/design-system/textarea-component/textarea-component.js +1 -1
  301. package/dist/collection/components/design-system/time-period-selector/time-period-selector.js +1 -1
  302. package/dist/collection/components/design-system/toggle-switch/toggle-switch.js +1 -1
  303. package/dist/collection/components/design-system/tooltip-component/toolitp-component.js +1 -1
  304. package/dist/collection/components/nylas-if-state/nylas-if-state.js +1 -1
  305. package/dist/collection/components/nylas-login/nylas-login.js +1 -1
  306. package/dist/collection/components/nylas-provider/nylas-provider.js +1 -1
  307. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.css +23 -0
  308. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +66 -51
  309. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -1
  310. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.css +23 -0
  311. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +35 -24
  312. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -1
  313. package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.css +23 -0
  314. package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js +38 -29
  315. package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js.map +1 -1
  316. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.css +23 -0
  317. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +26 -23
  318. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js.map +1 -1
  319. package/dist/collection/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.js +26 -23
  320. package/dist/collection/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.js.map +1 -1
  321. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.css +23 -0
  322. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +26 -20
  323. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -1
  324. package/dist/collection/components/scheduler/nylas-feedback-form/nylas-feedback-form.js +2 -2
  325. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.css +23 -0
  326. package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js +1 -1
  327. package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js +29 -23
  328. package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js.map +1 -1
  329. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +24 -10
  330. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
  331. package/dist/collection/components/scheduler/nylas-scheduling/test/nylas-scheduling.spec.js +143 -0
  332. package/dist/collection/components/scheduler/nylas-scheduling/test/nylas-scheduling.spec.js.map +1 -1
  333. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.css +23 -0
  334. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +3 -3
  335. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js.map +1 -1
  336. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.css +23 -0
  337. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +48 -42
  338. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -1
  339. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +56 -41
  340. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js.map +1 -1
  341. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js +44 -28
  342. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js.map +1 -1
  343. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js +25 -10
  344. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js.map +1 -1
  345. package/dist/collection/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.js +21 -9
  346. package/dist/collection/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.js.map +1 -1
  347. package/dist/collection/components/scheduler-editor/nylas-booking-confirmation-type/nylas-booking-confirmation-type.js +19 -10
  348. package/dist/collection/components/scheduler-editor/nylas-booking-confirmation-type/nylas-booking-confirmation-type.js.map +1 -1
  349. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.js +6 -3
  350. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.js.map +1 -1
  351. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js +10 -4
  352. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js.map +1 -1
  353. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js +45 -33
  354. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js.map +1 -1
  355. package/dist/collection/components/scheduler-editor/nylas-cancellation-policy/nylas-cancellation-policy.css +2 -1
  356. package/dist/collection/components/scheduler-editor/nylas-cancellation-policy/nylas-cancellation-policy.js +16 -7
  357. package/dist/collection/components/scheduler-editor/nylas-cancellation-policy/nylas-cancellation-policy.js.map +1 -1
  358. package/dist/collection/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.js +8 -4
  359. package/dist/collection/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.js.map +1 -1
  360. package/dist/collection/components/scheduler-editor/nylas-connected-calendars/nylas-connected-calendars.js +26 -10
  361. package/dist/collection/components/scheduler-editor/nylas-connected-calendars/nylas-connected-calendars.js.map +1 -1
  362. package/dist/collection/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.js +1 -1
  363. package/dist/collection/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.js.map +1 -1
  364. package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.js +1 -0
  365. package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.js.map +1 -1
  366. package/dist/collection/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.js +17 -11
  367. package/dist/collection/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.js.map +1 -1
  368. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +62 -28
  369. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
  370. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js +1 -1
  371. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js.map +1 -1
  372. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/test/nylas-editor-tabs.spec.js +171 -1
  373. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/test/nylas-editor-tabs.spec.js.map +1 -1
  374. package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.js +16 -7
  375. package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.js.map +1 -1
  376. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js +16 -7
  377. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js.map +1 -1
  378. package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
  379. package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
  380. package/dist/collection/components/scheduler-editor/nylas-event-location/nylas-event-location.js +74 -29
  381. package/dist/collection/components/scheduler-editor/nylas-event-location/nylas-event-location.js.map +1 -1
  382. package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js +25 -11
  383. package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js.map +1 -1
  384. package/dist/collection/components/scheduler-editor/nylas-form-card/nylas-form-card.js +1 -1
  385. package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js +16 -7
  386. package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js.map +1 -1
  387. package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js +2 -2
  388. package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js.map +1 -1
  389. package/dist/collection/components/scheduler-editor/nylas-min-booking-notice/nylas-min-booking-notice.js +32 -23
  390. package/dist/collection/components/scheduler-editor/nylas-min-booking-notice/nylas-min-booking-notice.js.map +1 -1
  391. package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js +32 -23
  392. package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js.map +1 -1
  393. package/dist/collection/components/scheduler-editor/nylas-page-name/nylas-page-name.js +43 -28
  394. package/dist/collection/components/scheduler-editor/nylas-page-name/nylas-page-name.js.map +1 -1
  395. package/dist/collection/components/scheduler-editor/nylas-page-styling/nylas-page-styling.js +38 -26
  396. package/dist/collection/components/scheduler-editor/nylas-page-styling/nylas-page-styling.js.map +1 -1
  397. package/dist/collection/components/scheduler-editor/nylas-participant-booking-calendars/nylas-participant-booking-calendars.js +31 -12
  398. package/dist/collection/components/scheduler-editor/nylas-participant-booking-calendars/nylas-participant-booking-calendars.js.map +1 -1
  399. package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.js +18 -8
  400. package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.js.map +1 -1
  401. package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/test/nylas-participants-custom-availability.spec.js +47 -0
  402. package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/test/nylas-participants-custom-availability.spec.js.map +1 -0
  403. package/dist/collection/components/scheduler-editor/nylas-reminder-emails/nylas-reminder-emails.js +3 -3
  404. package/dist/collection/components/scheduler-editor/nylas-reminder-time/nylas-reminder-time.js +1 -1
  405. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +1 -1
  406. package/dist/collection/components/scheduler-editor/nylas-scheduling-method/nylas-scheduling-method.js +34 -27
  407. package/dist/collection/components/scheduler-editor/nylas-scheduling-method/nylas-scheduling-method.js.map +1 -1
  408. package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js +1 -1
  409. package/dist/collection/components/scheduler-editor/nylas-timeslot-interval/nylas-timeslot-interval.js +18 -53
  410. package/dist/collection/components/scheduler-editor/nylas-timeslot-interval/nylas-timeslot-interval.js.map +1 -1
  411. package/dist/collection/connector/shared/api/scheduler.js +12 -3
  412. package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
  413. package/dist/collection/types/index.js +7 -6
  414. package/dist/collection/types/index.js.map +1 -1
  415. package/dist/collection/utils/test-utils.js +9 -0
  416. package/dist/collection/utils/test-utils.js.map +1 -1
  417. package/dist/components/add-circle.js +1 -1
  418. package/dist/components/archive-icon.js +1 -1
  419. package/dist/components/arrow-icon.js +1 -1
  420. package/dist/components/bold-icon.js +1 -1
  421. package/dist/components/button-component2.js +1 -1
  422. package/dist/components/calendar-agenda-fill.js +1 -1
  423. package/dist/components/calendar-agenda.js +1 -1
  424. package/dist/components/calendar-cancel.js +1 -1
  425. package/dist/components/calendar-check.js +1 -1
  426. package/dist/components/calendar-info.js +1 -1
  427. package/dist/components/calendar-patterns.js +1 -1
  428. package/dist/components/calendar.js +1 -1
  429. package/dist/components/checkbox-component2.js +1 -1
  430. package/dist/components/checkmark-circle.js +1 -1
  431. package/dist/components/checkmark.js +1 -1
  432. package/dist/components/chevron.js +1 -1
  433. package/dist/components/clock.js +1 -1
  434. package/dist/components/close.js +1 -1
  435. package/dist/components/constants.js +1 -1
  436. package/dist/components/copy.js +1 -1
  437. package/dist/components/delete.js +1 -1
  438. package/dist/components/document-refresh-icon.js +1 -1
  439. package/dist/components/dragable.js +1 -1
  440. package/dist/components/edit.js +1 -1
  441. package/dist/components/envelope-fill.js +1 -1
  442. package/dist/components/envelope.js +1 -1
  443. package/dist/components/eye.js +1 -1
  444. package/dist/components/feedback-icon2.js +1 -1
  445. package/dist/components/flow.js +1 -1
  446. package/dist/components/folder-icon.js +1 -1
  447. package/dist/components/forward-icon.js +1 -1
  448. package/dist/components/globe.js +1 -1
  449. package/dist/components/google-logo.js +1 -1
  450. package/dist/components/google-meet.js +1 -1
  451. package/dist/components/inbox-icon.js +1 -1
  452. package/dist/components/info.js +1 -1
  453. package/dist/components/input-color-picker.js +2 -2
  454. package/dist/components/input-component2.js +1 -1
  455. package/dist/components/input-dropdown2.js +1 -1
  456. package/dist/components/input-image-url2.js +1 -1
  457. package/dist/components/italic-icon.js +1 -1
  458. package/dist/components/loading.js +1 -1
  459. package/dist/components/location-off.js +1 -1
  460. package/dist/components/location.js +1 -1
  461. package/dist/components/microsof-teams.js +1 -1
  462. package/dist/components/microsoft-logo.js +1 -1
  463. package/dist/components/multi-select-dropdown2.js +1 -1
  464. package/dist/components/nylas-additional-participants2.js +6 -6
  465. package/dist/components/nylas-additional-participants2.js.map +1 -1
  466. package/dist/components/nylas-availability-picker2.js +5 -4
  467. package/dist/components/nylas-availability-picker2.js.map +1 -1
  468. package/dist/components/nylas-booked-event-card2.js +8 -8
  469. package/dist/components/nylas-booked-event-card2.js.map +1 -1
  470. package/dist/components/nylas-booking-calendar-picker2.js.map +1 -1
  471. package/dist/components/nylas-booking-confirmation-redirect2.js +1 -1
  472. package/dist/components/nylas-booking-confirmation-redirect2.js.map +1 -1
  473. package/dist/components/nylas-booking-confirmation-type2.js +2 -2
  474. package/dist/components/nylas-booking-confirmation-type2.js.map +1 -1
  475. package/dist/components/nylas-booking-form-config2.js +1 -1
  476. package/dist/components/nylas-booking-form-config2.js.map +1 -1
  477. package/dist/components/nylas-booking-form2.js +6 -5
  478. package/dist/components/nylas-booking-form2.js.map +1 -1
  479. package/dist/components/nylas-buffer-time2.js.map +1 -1
  480. package/dist/components/nylas-calendar-picker2.js +4 -4
  481. package/dist/components/nylas-calendar-picker2.js.map +1 -1
  482. package/dist/components/nylas-cancel-booking-form2.js +4 -4
  483. package/dist/components/nylas-cancel-booking-form2.js.map +1 -1
  484. package/dist/components/nylas-cancellation-policy2.js +1 -1
  485. package/dist/components/nylas-cancellation-policy2.js.map +1 -1
  486. package/dist/components/nylas-cancelled-event-card2.js +4 -4
  487. package/dist/components/nylas-cancelled-event-card2.js.map +1 -1
  488. package/dist/components/nylas-confirmation-email2.js +3 -2
  489. package/dist/components/nylas-confirmation-email2.js.map +1 -1
  490. package/dist/components/nylas-confirmed-event-card2.js +3 -3
  491. package/dist/components/nylas-confirmed-event-card2.js.map +1 -1
  492. package/dist/components/nylas-connected-calendars2.js +6 -2
  493. package/dist/components/nylas-connected-calendars2.js.map +1 -1
  494. package/dist/components/nylas-custom-booking-flow2.js +1 -1
  495. package/dist/components/nylas-custom-booking-flow2.js.map +1 -1
  496. package/dist/components/nylas-custom-event-slug2.js +1 -0
  497. package/dist/components/nylas-custom-event-slug2.js.map +1 -1
  498. package/dist/components/nylas-customize-booking-settings2.js +4 -4
  499. package/dist/components/nylas-customize-booking-settings2.js.map +1 -1
  500. package/dist/components/nylas-date-picker2.js +4 -4
  501. package/dist/components/nylas-date-picker2.js.map +1 -1
  502. package/dist/components/nylas-editor-tabs2.js +196 -167
  503. package/dist/components/nylas-editor-tabs2.js.map +1 -1
  504. package/dist/components/nylas-event-description2.js +1 -1
  505. package/dist/components/nylas-event-description2.js.map +1 -1
  506. package/dist/components/nylas-event-duration2.js +1 -1
  507. package/dist/components/nylas-event-duration2.js.map +1 -1
  508. package/dist/components/nylas-event-info2.js +1 -1
  509. package/dist/components/nylas-event-limits2.js +1 -1
  510. package/dist/components/nylas-event-location2.js +39 -15
  511. package/dist/components/nylas-event-location2.js.map +1 -1
  512. package/dist/components/nylas-event-title2.js +10 -5
  513. package/dist/components/nylas-event-title2.js.map +1 -1
  514. package/dist/components/nylas-feedback-form2.js +2 -2
  515. package/dist/components/nylas-form-card2.js +1 -1
  516. package/dist/components/nylas-if-state.js +1 -1
  517. package/dist/components/nylas-limit-future-bookings2.js +1 -1
  518. package/dist/components/nylas-limit-future-bookings2.js.map +1 -1
  519. package/dist/components/nylas-list-configurations2.js +2 -2
  520. package/dist/components/nylas-list-configurations2.js.map +1 -1
  521. package/dist/components/nylas-locale-switch2.js +2 -2
  522. package/dist/components/nylas-locale-switch2.js.map +1 -1
  523. package/dist/components/nylas-login.js +1 -1
  524. package/dist/components/nylas-logo2.js +1 -1
  525. package/dist/components/nylas-min-booking-notice2.js +3 -3
  526. package/dist/components/nylas-min-booking-notice2.js.map +1 -1
  527. package/dist/components/nylas-min-cancellation-notice2.js +3 -3
  528. package/dist/components/nylas-min-cancellation-notice2.js.map +1 -1
  529. package/dist/components/nylas-notification2.js +1 -1
  530. package/dist/components/nylas-organizer-confirmation-card2.js +3 -3
  531. package/dist/components/nylas-organizer-confirmation-card2.js.map +1 -1
  532. package/dist/components/nylas-page-name2.js +3 -3
  533. package/dist/components/nylas-page-name2.js.map +1 -1
  534. package/dist/components/nylas-page-styling2.js +3 -3
  535. package/dist/components/nylas-page-styling2.js.map +1 -1
  536. package/dist/components/nylas-participant-booking-calendars2.js +6 -2
  537. package/dist/components/nylas-participant-booking-calendars2.js.map +1 -1
  538. package/dist/components/nylas-participants-custom-availability2.js +3 -2
  539. package/dist/components/nylas-participants-custom-availability2.js.map +1 -1
  540. package/dist/components/nylas-provider.js +1 -1
  541. package/dist/components/nylas-reminder-emails.js +1 -302
  542. package/dist/components/nylas-reminder-emails.js.map +1 -1
  543. package/dist/{esm/nylas-reminder-emails.entry.js → components/nylas-reminder-emails2.js} +123 -21
  544. package/dist/components/nylas-reminder-emails2.js.map +1 -0
  545. package/dist/components/nylas-reminder-time2.js +2 -2
  546. package/dist/components/nylas-scheduler-editor.js +179 -161
  547. package/dist/components/nylas-scheduler-editor.js.map +1 -1
  548. package/dist/components/nylas-scheduling-method2.js +4 -6
  549. package/dist/components/nylas-scheduling-method2.js.map +1 -1
  550. package/dist/components/nylas-scheduling.js +22 -8
  551. package/dist/components/nylas-scheduling.js.map +1 -1
  552. package/dist/components/nylas-selected-event-card2.js +3 -3
  553. package/dist/components/nylas-selected-event-card2.js.map +1 -1
  554. package/dist/components/nylas-time-window-picker2.js +1 -1
  555. package/dist/components/nylas-timeslot-interval2.js +4 -8
  556. package/dist/components/nylas-timeslot-interval2.js.map +1 -1
  557. package/dist/components/nylas-timeslot-picker2.js +5 -5
  558. package/dist/components/nylas-timeslot-picker2.js.map +1 -1
  559. package/dist/components/paintbrush-fill.js +1 -1
  560. package/dist/components/paintbrush.js +1 -1
  561. package/dist/components/people.js +1 -1
  562. package/dist/components/person-clipboard.js +1 -1
  563. package/dist/components/person.js +1 -1
  564. package/dist/components/play-icon.js +1 -1
  565. package/dist/components/plus.js +1 -1
  566. package/dist/components/radio-button-group2.js +1 -1
  567. package/dist/components/refresh-icon.js +1 -1
  568. package/dist/components/reply-all-icon.js +1 -1
  569. package/dist/components/reply-icon.js +1 -1
  570. package/dist/components/scheduler-store.js +12 -3
  571. package/dist/components/scheduler-store.js.map +1 -1
  572. package/dist/components/search.js +1 -1
  573. package/dist/components/select-dropdown2.js +1 -1
  574. package/dist/components/sent-icon.js +1 -1
  575. package/dist/components/spam-icon.js +1 -1
  576. package/dist/components/star-icon.js +1 -1
  577. package/dist/components/stop-icon.js +1 -1
  578. package/dist/components/textarea-component2.js +1 -1
  579. package/dist/components/time-period-selector2.js +1 -1
  580. package/dist/components/toggle-switch2.js +1 -1
  581. package/dist/components/toolitp-component.js +1 -1
  582. package/dist/components/translate.js +1 -1
  583. package/dist/components/trash-fill-icon.js +1 -1
  584. package/dist/components/trash.js +1 -1
  585. package/dist/components/underline-icon.js +1 -1
  586. package/dist/components/warning.js +1 -1
  587. package/dist/components/zoom.js +1 -1
  588. package/dist/esm/add-circle-icon_2.entry.js +2 -2
  589. package/dist/esm/archive-icon.entry.js +1 -1
  590. package/dist/esm/arrow-icon.entry.js +1 -1
  591. package/dist/esm/bold-icon.entry.js +1 -1
  592. package/dist/esm/button-component_2.entry.js +2 -2
  593. package/dist/esm/{calendar-agenda-fill-icon_51.entry.js → calendar-agenda-fill-icon_54.entry.js} +702 -306
  594. package/dist/esm/calendar-agenda-fill-icon_54.entry.js.map +1 -0
  595. package/dist/esm/calendar-cancel-icon.entry.js +1 -1
  596. package/dist/esm/calendar-check-icon_2.entry.js +2 -2
  597. package/dist/esm/calendar-icon.entry.js +1 -1
  598. package/dist/esm/checkbox-component_2.entry.js +2 -2
  599. package/dist/esm/chevron-icon_3.entry.js +3 -3
  600. package/dist/esm/clock-icon_4.entry.js +4 -4
  601. package/dist/esm/{constants-94520f89.js → constants-c549b12b.js} +2 -2
  602. package/dist/esm/{constants-94520f89.js.map → constants-c549b12b.js.map} +1 -1
  603. package/dist/esm/copy-icon.entry.js +1 -1
  604. package/dist/esm/delete-icon.entry.js +1 -1
  605. package/dist/esm/document-refresh-icon.entry.js +1 -1
  606. package/dist/esm/folder-icon.entry.js +1 -1
  607. package/dist/esm/forward-icon.entry.js +1 -1
  608. package/dist/esm/globe-icon.entry.js +1 -1
  609. package/dist/esm/google-logo-icon_4.entry.js +35 -24
  610. package/dist/esm/google-logo-icon_4.entry.js.map +1 -1
  611. package/dist/esm/inbox-icon.entry.js +1 -1
  612. package/dist/esm/index-7cb0dd3d.js +2 -10
  613. package/dist/esm/info-icon_2.entry.js +2 -2
  614. package/dist/esm/input-color-picker.entry.js +2 -2
  615. package/dist/esm/input-component.entry.js +1 -1
  616. package/dist/esm/input-dropdown.entry.js +1 -1
  617. package/dist/esm/italic-icon.entry.js +1 -1
  618. package/dist/esm/loader.js +1 -1
  619. package/dist/esm/multi-select-dropdown.entry.js +1 -1
  620. package/dist/esm/nylas-booked-event-card_12.entry.js +34 -33
  621. package/dist/esm/nylas-booked-event-card_12.entry.js.map +1 -1
  622. package/dist/esm/nylas-form-card.entry.js +1 -1
  623. package/dist/esm/nylas-if-state.entry.js +1 -1
  624. package/dist/esm/nylas-login.entry.js +1 -1
  625. package/dist/esm/nylas-provider.entry.js +2 -2
  626. package/dist/esm/nylas-scheduler-editor.entry.js +1 -1
  627. package/dist/esm/nylas-scheduling.entry.js +23 -10
  628. package/dist/esm/nylas-scheduling.entry.js.map +1 -1
  629. package/dist/esm/nylas-time-window-picker.entry.js +1 -1
  630. package/dist/esm/nylas-web-elements.js +1 -1
  631. package/dist/esm/person-icon.entry.js +1 -1
  632. package/dist/esm/play-icon.entry.js +1 -1
  633. package/dist/esm/refresh-icon.entry.js +1 -1
  634. package/dist/esm/reply-all-icon.entry.js +1 -1
  635. package/dist/esm/reply-icon.entry.js +1 -1
  636. package/dist/esm/{scheduler-store-24e5fb65.js → scheduler-store-d4784b24.js} +13 -4
  637. package/dist/esm/scheduler-store-d4784b24.js.map +1 -0
  638. package/dist/esm/sent-icon.entry.js +1 -1
  639. package/dist/esm/spam-icon.entry.js +1 -1
  640. package/dist/esm/star-icon.entry.js +1 -1
  641. package/dist/esm/stop-icon.entry.js +1 -1
  642. package/dist/esm/textarea-component.entry.js +1 -1
  643. package/dist/esm/time-period-selector.entry.js +1 -1
  644. package/dist/esm/translate-icon.entry.js +1 -1
  645. package/dist/esm/trash-fill-icon.entry.js +1 -1
  646. package/dist/esm/underline-icon.entry.js +1 -1
  647. package/dist/esm/warning-icon.entry.js +1 -1
  648. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  649. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
  650. package/dist/nylas-web-elements/{p-14493c1f.entry.js → p-04d397d3.entry.js} +2 -2
  651. package/dist/nylas-web-elements/{p-b6e4de5b.js → p-08a590fe.js} +2 -2
  652. package/dist/nylas-web-elements/{p-7943a9f3.entry.js → p-108bd821.entry.js} +2 -2
  653. package/dist/nylas-web-elements/p-12d690b8.js +2 -0
  654. package/dist/nylas-web-elements/p-12d690b8.js.map +1 -0
  655. package/dist/nylas-web-elements/{p-d902a356.entry.js → p-1546bd61.entry.js} +2 -2
  656. package/dist/nylas-web-elements/{p-651232a3.entry.js → p-1c25b695.entry.js} +2 -2
  657. package/dist/nylas-web-elements/{p-caad44c4.entry.js → p-2c1432a2.entry.js} +2 -2
  658. package/dist/nylas-web-elements/{p-21fb688e.entry.js → p-2f91359b.entry.js} +2 -2
  659. package/dist/nylas-web-elements/{p-27074ad6.entry.js → p-3268077f.entry.js} +2 -2
  660. package/dist/nylas-web-elements/p-32bc7f60.entry.js +2 -0
  661. package/dist/nylas-web-elements/p-33800554.entry.js +2 -0
  662. package/dist/nylas-web-elements/p-3971e86b.entry.js +2 -0
  663. package/dist/nylas-web-elements/p-483f2fb4.entry.js +2 -0
  664. package/dist/nylas-web-elements/{p-8a082b24.entry.js → p-4e57a9ee.entry.js} +2 -2
  665. package/dist/nylas-web-elements/p-4fb91c8b.entry.js +2 -0
  666. package/dist/nylas-web-elements/{p-effd77ed.entry.js → p-525bd709.entry.js} +2 -2
  667. package/dist/nylas-web-elements/{p-7d5b3918.entry.js → p-56834b7a.entry.js} +2 -2
  668. package/dist/nylas-web-elements/{p-faeec15a.entry.js → p-5ed596d7.entry.js} +2 -2
  669. package/dist/nylas-web-elements/{p-6fa4597b.entry.js → p-6089d6fa.entry.js} +2 -2
  670. package/dist/nylas-web-elements/{p-39af67b7.entry.js → p-61ea19c2.entry.js} +2 -2
  671. package/dist/nylas-web-elements/p-698d229c.entry.js +2 -0
  672. package/dist/nylas-web-elements/p-698d229c.entry.js.map +1 -0
  673. package/dist/nylas-web-elements/p-713505c9.entry.js +2 -0
  674. package/dist/nylas-web-elements/{p-bd85bf92.entry.js → p-7140bca8.entry.js} +2 -2
  675. package/dist/nylas-web-elements/{p-3f2f3b85.entry.js → p-762ae706.entry.js} +2 -2
  676. package/dist/nylas-web-elements/p-7919d41d.entry.js +2 -0
  677. package/dist/nylas-web-elements/p-7bed0959.entry.js +2 -0
  678. package/dist/nylas-web-elements/p-7bed0959.entry.js.map +1 -0
  679. package/dist/nylas-web-elements/{p-27b52475.entry.js → p-7c20444b.entry.js} +2 -2
  680. package/dist/nylas-web-elements/{p-d55f619c.entry.js → p-988eee6f.entry.js} +2 -2
  681. package/dist/nylas-web-elements/{p-0519e48e.entry.js → p-9d8ffc7b.entry.js} +2 -2
  682. package/dist/nylas-web-elements/{p-fbddb6fe.entry.js → p-9f009793.entry.js} +2 -2
  683. package/dist/nylas-web-elements/{p-1e2ffdc6.entry.js → p-aa4b24ce.entry.js} +2 -2
  684. package/dist/nylas-web-elements/{p-5973b208.entry.js → p-ac8386d1.entry.js} +2 -2
  685. package/dist/nylas-web-elements/{p-062f6da2.entry.js → p-acfe4f6e.entry.js} +2 -2
  686. package/dist/nylas-web-elements/p-af2ab331.entry.js +2 -0
  687. package/dist/nylas-web-elements/{p-100c9ff7.entry.js → p-b110d5c1.entry.js} +2 -2
  688. package/dist/nylas-web-elements/p-b9a8d404.entry.js +8 -0
  689. package/dist/nylas-web-elements/p-b9a8d404.entry.js.map +1 -0
  690. package/dist/nylas-web-elements/{p-e012eac3.entry.js → p-be938025.entry.js} +2 -2
  691. package/dist/nylas-web-elements/{p-36792b8a.entry.js → p-cad17478.entry.js} +2 -2
  692. package/dist/nylas-web-elements/p-ce2c8e67.entry.js +2 -0
  693. package/dist/nylas-web-elements/{p-68320c97.entry.js → p-d1abdef7.entry.js} +2 -2
  694. package/dist/nylas-web-elements/{p-8013d0a2.entry.js → p-dcdb47dd.entry.js} +2 -2
  695. package/dist/nylas-web-elements/{p-cc8f94f7.entry.js → p-e1cd1887.entry.js} +2 -2
  696. package/dist/nylas-web-elements/{p-00d89615.entry.js → p-eb2d8167.entry.js} +2 -2
  697. package/dist/nylas-web-elements/{p-9b62edf6.entry.js → p-ec302526.entry.js} +2 -2
  698. package/dist/nylas-web-elements/{p-bbcf8659.entry.js → p-ec528a20.entry.js} +2 -2
  699. package/dist/nylas-web-elements/{p-0e0c00cc.entry.js → p-eee29c7e.entry.js} +2 -2
  700. package/dist/nylas-web-elements/{p-f62df769.entry.js → p-f2ae34c9.entry.js} +2 -2
  701. package/dist/nylas-web-elements/{p-fecf68ef.entry.js → p-f4334e3a.entry.js} +2 -2
  702. package/dist/nylas-web-elements/p-fc6ae4ec.entry.js +2 -0
  703. package/dist/nylas-web-elements/p-fc6ae4ec.entry.js.map +1 -0
  704. package/dist/nylas-web-elements/p-fe34d0ee.entry.js +2 -0
  705. package/dist/nylas-web-elements/p-febf4adf.entry.js +2 -0
  706. package/dist/types/common/types.d.ts +3 -0
  707. package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +2 -2
  708. package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +3 -4
  709. package/dist/types/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.d.ts +1 -1
  710. package/dist/types/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.d.ts +1 -1
  711. package/dist/types/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.d.ts +1 -1
  712. package/dist/types/components/scheduler/nylas-date-picker/nylas-date-picker.d.ts +1 -1
  713. package/dist/types/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.d.ts +1 -1
  714. package/dist/types/components/scheduler/nylas-scheduling/nylas-scheduling.d.ts +5 -3
  715. package/dist/types/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.d.ts +2 -2
  716. package/dist/types/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.d.ts +2 -2
  717. package/dist/types/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.d.ts +1 -1
  718. package/dist/types/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.d.ts +2 -2
  719. package/dist/types/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.d.ts +2 -1
  720. package/dist/types/components/scheduler-editor/nylas-event-location/nylas-event-location.d.ts +2 -0
  721. package/dist/types/components/scheduler-editor/nylas-min-booking-notice/nylas-min-booking-notice.d.ts +1 -1
  722. package/dist/types/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.d.ts +1 -1
  723. package/dist/types/components/scheduler-editor/nylas-page-name/nylas-page-name.d.ts +1 -1
  724. package/dist/types/components/scheduler-editor/nylas-page-styling/nylas-page-styling.d.ts +1 -1
  725. package/dist/types/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.d.ts +1 -0
  726. package/dist/types/components/scheduler-editor/nylas-scheduling-method/nylas-scheduling-method.d.ts +1 -1
  727. package/dist/types/components/scheduler-editor/nylas-timeslot-interval/nylas-timeslot-interval.d.ts +0 -2
  728. package/dist/types/components.d.ts +252 -289
  729. package/dist/types/connector/shared/api/scheduler.d.ts +4 -4
  730. package/dist/types/types/index.d.ts +164 -32
  731. package/package.json +7 -5
  732. package/dist/cjs/calendar-agenda-fill-icon_51.cjs.entry.js.map +0 -1
  733. package/dist/cjs/nylas-reminder-emails.cjs.entry.js +0 -208
  734. package/dist/cjs/nylas-reminder-emails.cjs.entry.js.map +0 -1
  735. package/dist/cjs/nylas-reminder-time_2.cjs.entry.js +0 -175
  736. package/dist/cjs/nylas-reminder-time_2.cjs.entry.js.map +0 -1
  737. package/dist/cjs/scheduler-store-4489a68b.js.map +0 -1
  738. package/dist/esm/calendar-agenda-fill-icon_51.entry.js.map +0 -1
  739. package/dist/esm/nylas-reminder-emails.entry.js.map +0 -1
  740. package/dist/esm/nylas-reminder-time_2.entry.js +0 -170
  741. package/dist/esm/nylas-reminder-time_2.entry.js.map +0 -1
  742. package/dist/esm/scheduler-store-24e5fb65.js.map +0 -1
  743. package/dist/nylas-web-elements/p-06e44cfc.entry.js +0 -2
  744. package/dist/nylas-web-elements/p-06e44cfc.entry.js.map +0 -1
  745. package/dist/nylas-web-elements/p-2653e311.entry.js +0 -2
  746. package/dist/nylas-web-elements/p-3ff76491.entry.js +0 -2
  747. package/dist/nylas-web-elements/p-3ff76491.entry.js.map +0 -1
  748. package/dist/nylas-web-elements/p-51a66bf5.entry.js +0 -2
  749. package/dist/nylas-web-elements/p-5b237299.entry.js +0 -2
  750. package/dist/nylas-web-elements/p-63341f71.entry.js +0 -2
  751. package/dist/nylas-web-elements/p-6c833d5e.entry.js +0 -2
  752. package/dist/nylas-web-elements/p-6c833d5e.entry.js.map +0 -1
  753. package/dist/nylas-web-elements/p-742d7c3c.entry.js +0 -2
  754. package/dist/nylas-web-elements/p-76fc639b.entry.js +0 -2
  755. package/dist/nylas-web-elements/p-781e954b.entry.js +0 -2
  756. package/dist/nylas-web-elements/p-7f56a139.entry.js +0 -2
  757. package/dist/nylas-web-elements/p-7f56a139.entry.js.map +0 -1
  758. package/dist/nylas-web-elements/p-86194780.entry.js +0 -2
  759. package/dist/nylas-web-elements/p-86194780.entry.js.map +0 -1
  760. package/dist/nylas-web-elements/p-96bcc255.entry.js +0 -2
  761. package/dist/nylas-web-elements/p-aeab587c.entry.js +0 -2
  762. package/dist/nylas-web-elements/p-c417fd2f.entry.js +0 -2
  763. package/dist/nylas-web-elements/p-ef3561ae.js +0 -2
  764. package/dist/nylas-web-elements/p-ef3561ae.js.map +0 -1
  765. package/dist/nylas-web-elements/p-fbe814b2.entry.js +0 -8
  766. package/dist/nylas-web-elements/p-fbe814b2.entry.js.map +0 -1
  767. package/dist/nylas-web-elements/p-fdc60ce2.entry.js +0 -2
  768. /package/dist/nylas-web-elements/{p-14493c1f.entry.js.map → p-04d397d3.entry.js.map} +0 -0
  769. /package/dist/nylas-web-elements/{p-b6e4de5b.js.map → p-08a590fe.js.map} +0 -0
  770. /package/dist/nylas-web-elements/{p-7943a9f3.entry.js.map → p-108bd821.entry.js.map} +0 -0
  771. /package/dist/nylas-web-elements/{p-d902a356.entry.js.map → p-1546bd61.entry.js.map} +0 -0
  772. /package/dist/nylas-web-elements/{p-651232a3.entry.js.map → p-1c25b695.entry.js.map} +0 -0
  773. /package/dist/nylas-web-elements/{p-caad44c4.entry.js.map → p-2c1432a2.entry.js.map} +0 -0
  774. /package/dist/nylas-web-elements/{p-21fb688e.entry.js.map → p-2f91359b.entry.js.map} +0 -0
  775. /package/dist/nylas-web-elements/{p-27074ad6.entry.js.map → p-3268077f.entry.js.map} +0 -0
  776. /package/dist/nylas-web-elements/{p-aeab587c.entry.js.map → p-32bc7f60.entry.js.map} +0 -0
  777. /package/dist/nylas-web-elements/{p-76fc639b.entry.js.map → p-33800554.entry.js.map} +0 -0
  778. /package/dist/nylas-web-elements/{p-781e954b.entry.js.map → p-3971e86b.entry.js.map} +0 -0
  779. /package/dist/nylas-web-elements/{p-63341f71.entry.js.map → p-483f2fb4.entry.js.map} +0 -0
  780. /package/dist/nylas-web-elements/{p-8a082b24.entry.js.map → p-4e57a9ee.entry.js.map} +0 -0
  781. /package/dist/nylas-web-elements/{p-5b237299.entry.js.map → p-4fb91c8b.entry.js.map} +0 -0
  782. /package/dist/nylas-web-elements/{p-effd77ed.entry.js.map → p-525bd709.entry.js.map} +0 -0
  783. /package/dist/nylas-web-elements/{p-7d5b3918.entry.js.map → p-56834b7a.entry.js.map} +0 -0
  784. /package/dist/nylas-web-elements/{p-faeec15a.entry.js.map → p-5ed596d7.entry.js.map} +0 -0
  785. /package/dist/nylas-web-elements/{p-6fa4597b.entry.js.map → p-6089d6fa.entry.js.map} +0 -0
  786. /package/dist/nylas-web-elements/{p-39af67b7.entry.js.map → p-61ea19c2.entry.js.map} +0 -0
  787. /package/dist/nylas-web-elements/{p-fdc60ce2.entry.js.map → p-713505c9.entry.js.map} +0 -0
  788. /package/dist/nylas-web-elements/{p-bd85bf92.entry.js.map → p-7140bca8.entry.js.map} +0 -0
  789. /package/dist/nylas-web-elements/{p-3f2f3b85.entry.js.map → p-762ae706.entry.js.map} +0 -0
  790. /package/dist/nylas-web-elements/{p-c417fd2f.entry.js.map → p-7919d41d.entry.js.map} +0 -0
  791. /package/dist/nylas-web-elements/{p-27b52475.entry.js.map → p-7c20444b.entry.js.map} +0 -0
  792. /package/dist/nylas-web-elements/{p-d55f619c.entry.js.map → p-988eee6f.entry.js.map} +0 -0
  793. /package/dist/nylas-web-elements/{p-0519e48e.entry.js.map → p-9d8ffc7b.entry.js.map} +0 -0
  794. /package/dist/nylas-web-elements/{p-fbddb6fe.entry.js.map → p-9f009793.entry.js.map} +0 -0
  795. /package/dist/nylas-web-elements/{p-1e2ffdc6.entry.js.map → p-aa4b24ce.entry.js.map} +0 -0
  796. /package/dist/nylas-web-elements/{p-5973b208.entry.js.map → p-ac8386d1.entry.js.map} +0 -0
  797. /package/dist/nylas-web-elements/{p-062f6da2.entry.js.map → p-acfe4f6e.entry.js.map} +0 -0
  798. /package/dist/nylas-web-elements/{p-742d7c3c.entry.js.map → p-af2ab331.entry.js.map} +0 -0
  799. /package/dist/nylas-web-elements/{p-100c9ff7.entry.js.map → p-b110d5c1.entry.js.map} +0 -0
  800. /package/dist/nylas-web-elements/{p-e012eac3.entry.js.map → p-be938025.entry.js.map} +0 -0
  801. /package/dist/nylas-web-elements/{p-36792b8a.entry.js.map → p-cad17478.entry.js.map} +0 -0
  802. /package/dist/nylas-web-elements/{p-2653e311.entry.js.map → p-ce2c8e67.entry.js.map} +0 -0
  803. /package/dist/nylas-web-elements/{p-68320c97.entry.js.map → p-d1abdef7.entry.js.map} +0 -0
  804. /package/dist/nylas-web-elements/{p-8013d0a2.entry.js.map → p-dcdb47dd.entry.js.map} +0 -0
  805. /package/dist/nylas-web-elements/{p-cc8f94f7.entry.js.map → p-e1cd1887.entry.js.map} +0 -0
  806. /package/dist/nylas-web-elements/{p-00d89615.entry.js.map → p-eb2d8167.entry.js.map} +0 -0
  807. /package/dist/nylas-web-elements/{p-9b62edf6.entry.js.map → p-ec302526.entry.js.map} +0 -0
  808. /package/dist/nylas-web-elements/{p-bbcf8659.entry.js.map → p-ec528a20.entry.js.map} +0 -0
  809. /package/dist/nylas-web-elements/{p-0e0c00cc.entry.js.map → p-eee29c7e.entry.js.map} +0 -0
  810. /package/dist/nylas-web-elements/{p-f62df769.entry.js.map → p-f2ae34c9.entry.js.map} +0 -0
  811. /package/dist/nylas-web-elements/{p-fecf68ef.entry.js.map → p-f4334e3a.entry.js.map} +0 -0
  812. /package/dist/nylas-web-elements/{p-96bcc255.entry.js.map → p-fe34d0ee.entry.js.map} +0 -0
  813. /package/dist/nylas-web-elements/{p-51a66bf5.entry.js.map → p-febf4adf.entry.js.map} +0 -0
@@ -1,5 +1,7 @@
1
1
  import { newSpecPage } from "@stencil/core/testing";
2
2
  import { NylasScheduling } from "../nylas-scheduling";
3
+ import { NylasBookingForm } from "../../nylas-booking-form/nylas-booking-form";
4
+ import { NylasSelectedEventCard } from "../../nylas-selected-event-card/nylas-selected-event-card";
3
5
  import { h } from "@stencil/core";
4
6
  describe('nylas-scheduling', () => {
5
7
  const REAL_DATE = Date;
@@ -162,5 +164,146 @@ describe('nylas-scheduling', () => {
162
164
  const footer = page?.root?.shadowRoot?.querySelector('.footer');
163
165
  expect(footer?.textContent).not.toContain('Powered by Nylas');
164
166
  });
167
+ it('redirects with the query params when redirectUrl is set', async () => {
168
+ const configSettings = {
169
+ name: '',
170
+ slug: '',
171
+ configuration_id: '19ca4a10-be05-4d1b-a830-5b639a362cef',
172
+ scheduler: {
173
+ available_days_in_future: 30,
174
+ min_cancellation_notice: 0,
175
+ min_booking_notice: 60,
176
+ rescheduling_url: 'https://book.nylas.com/scheduler/reschedule/:booking_ref',
177
+ cancellation_url: 'https://book.nylas.com/scheduler/cancel/:booking_ref',
178
+ organizer_confirmation_url: 'https://book.nylas.com/scheduler/confirm/:booking_ref',
179
+ confirmation_redirect_url: 'https://nylas.com',
180
+ hide_rescheduling_options: false,
181
+ hide_cancellation_options: false,
182
+ hide_additional_guests: false,
183
+ cancellation_policy: '',
184
+ additional_fields: {
185
+ dropdown: {
186
+ label: 'Dropdown Label',
187
+ type: 'dropdown',
188
+ required: false,
189
+ order: 2,
190
+ options: ['option 1', 'option 2'],
191
+ },
192
+ short_text: {
193
+ label: 'Short Text Label',
194
+ type: 'text',
195
+ required: false,
196
+ order: 1,
197
+ },
198
+ },
199
+ },
200
+ organizer: {
201
+ email: 'pooja.g@nylas.com',
202
+ name: '',
203
+ },
204
+ booking_type: 'booking',
205
+ appearance: {
206
+ company_logo_url: '',
207
+ },
208
+ };
209
+ const defaultSchedulerState = {
210
+ showBookingForm: true,
211
+ availability: [
212
+ {
213
+ emails: ['pooja.g@nylas.com'],
214
+ end_time: 1728639000,
215
+ start_time: 1728637200,
216
+ },
217
+ ],
218
+ selectableDates: [new Date(1728639000000)],
219
+ selectedDate: new Date(1728639000000),
220
+ selectedTimeslot: {
221
+ end_time: 1728639000,
222
+ start_time: 1728637200,
223
+ emails: ['janedoe@example.com'],
224
+ },
225
+ selectedTimezone: 'America/Los_Angeles',
226
+ bookingInfo: {
227
+ primaryParticipant: {
228
+ name: 'John Doe',
229
+ email: 'johndoe@example.com',
230
+ },
231
+ guests: [],
232
+ additionalFields: {
233
+ short_text: {
234
+ value: 'some value',
235
+ type: 'text',
236
+ },
237
+ dropdown: {
238
+ value: 'option 2',
239
+ type: 'dropdown',
240
+ },
241
+ field2: {
242
+ value: 'some value',
243
+ type: 'text',
244
+ },
245
+ },
246
+ },
247
+ configSettings: { ...configSettings },
248
+ };
249
+ jest.spyOn(global, 'fetch').mockImplementation(url => {
250
+ if (url === 'https://api.us.nylas.com/v3/scheduling/ui-settings?configuration_id=19ca4a10-be05-4d1b-a830-5b639a362cef') {
251
+ return Promise.resolve({ request_id: 'test', data: configSettings });
252
+ }
253
+ else if (url === 'https://api.us.nylas.com/v3/scheduling/bookings?configuration_id=19ca4a10-be05-4d1b-a830-5b639a362cef') {
254
+ return Promise.resolve({
255
+ json: () => Promise.resolve({
256
+ request_id: '1729109187-ffa7e86e-c276-45c2-8cda-e3205e46d234',
257
+ data: {
258
+ event_id: 'jlid5nji0nmoupl87ls85iv8do',
259
+ booking_id: '8f9f5145-c40c-4477-8d30-5c43256ddb60',
260
+ title: 'm',
261
+ description: '',
262
+ organizer: {
263
+ email: 'johndoe@example.com',
264
+ name: '',
265
+ },
266
+ status: 'booked',
267
+ },
268
+ }),
269
+ });
270
+ }
271
+ return fetch(url);
272
+ });
273
+ let nylasScheduling;
274
+ const page = await newSpecPage({
275
+ components: [NylasSelectedEventCard, NylasBookingForm, NylasScheduling],
276
+ template: () => (h("nylas-scheduling", { mode: "app", configurationId: '19ca4a10-be05-4d1b-a830-5b639a362cef', bookingInfo: defaultSchedulerState.bookingInfo, defaultSchedulerState: defaultSchedulerState })),
277
+ });
278
+ nylasScheduling = page.rootInstance;
279
+ const redirectSpy = jest.spyOn(nylasScheduling, 'redirectToCustomUrl');
280
+ await page.waitForChanges();
281
+ expect(page.root).toMatchSnapshot();
282
+ const nylasBookingForm = page?.root?.shadowRoot?.querySelector('nylas-booking-form');
283
+ nylasBookingForm.bookingInfo = defaultSchedulerState.bookingInfo;
284
+ await page.waitForChanges();
285
+ const form = nylasBookingForm?.shadowRoot?.querySelector('form');
286
+ expect(form).not.toBeNull();
287
+ const detailsConfirmedEvent = new CustomEvent('detailsConfirmed', {
288
+ detail: {
289
+ additionalFields: { dropdown: 'option 2', short_text: 'hello' },
290
+ guests: [],
291
+ start_time: new Date(1729013400000),
292
+ timezone: 'America/Toronto',
293
+ email_language: 'en-US',
294
+ end_time: new Date(1729015200000),
295
+ timeslot: {
296
+ start_time: new Date(1729013400000),
297
+ end_time: new Date(1729015200000),
298
+ },
299
+ primaryParticipant: { name: 'John Doe', email: 'johndoe@example.com' },
300
+ },
301
+ bubbles: true,
302
+ });
303
+ await nylasScheduling.bookButtonClickedHandler(detailsConfirmedEvent);
304
+ await page.waitForChanges();
305
+ expect(redirectSpy).toHaveBeenCalled();
306
+ expect(redirectSpy).toHaveBeenCalledWith('https://nylas.com?booking_id=8f9f5145-c40c-4477-8d30-5c43256ddb60&name=John+Doe&email=johndoe%40example.com&start_time=1728637.2&end_time=1728639&tz=America%2FLos_Angeles&additional_values=%7B%22dropdown%22%3A%22option+2%22%2C%22short_text%22%3A%22hello%22%2C%22field2%22%3A%22some+value%22%7D&config_id=19ca4a10-be05-4d1b-a830-5b639a362cef');
307
+ });
165
308
  });
166
309
  //# sourceMappingURL=nylas-scheduling.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-scheduling.spec.js","sourceRoot":"","sources":["../../../../../src/components/scheduler/nylas-scheduling/test/nylas-scheduling.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,SAAS,GAAG,IAAI,CAAC;IACvB,MAAM,cAAc,GAAG,8CAA8C,CAAC;IACtE,UAAU,CAAC,GAAG,EAAE;QAEd,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,IAAI,CAAC;QAC1B,MAAM,CAAC,IAAI,GAAG,KAAM,SAAQ,YAAY;YACtC,YAAY,IAAsB;gBAChC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC;YAClD,CAAC;SACiB,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,EAAE;QACZ,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,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C;QACH,MAAM,SAAS,GAAG,IAAI,CAAC,YAA+B,CAAC;QAEvD,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,0BAA0B,EAAE,CAAC;QAC/D,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,KAAK,IAAI,EAAE;QAClF,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,eAAe,CAAC;YAC7B,IAAI,EAAE,4CAA4C,cAAc,sBAAsB;SACvF,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,aAAa,GAAG,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;QAC/E,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;QAC1E,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,eAAe,CAAC;YAC7B,QAAQ,EAAE,GAAG,EAAE,CAAC,qCAA4B,UAAU,EAAC,aAAa,EAAE,KAAK,GAAqB;SACjG,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;QAChE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { NylasScheduling } from '../nylas-scheduling';\nimport { h } from '@stencil/core';\n\ndescribe('nylas-scheduling', () => {\n const REAL_DATE = Date;\n const testBookingRef = 'Of_H8WLEQ4aZTtx0NKajeAF1l9qpekHbo4by7AaZc8M=';\n beforeEach(() => {\n // Clear and reset the mock before each test if needed\n jest.clearAllMocks();\n });\n\n beforeAll(() => {\n const originalDate = Date;\n global.Date = class extends originalDate {\n constructor(date?: string | number) {\n super(date ? date : '2022-01-01T00:00:00.000Z');\n }\n } as DateConstructor;\n });\n\n afterAll(() => {\n global.Date = REAL_DATE;\n });\n\n it('renders', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling></nylas-scheduling>`,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it('listens for NylasSchedulingError event and updates state', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling></nylas-scheduling>`,\n });\n\n const mockError = { title: 'Error', description: 'Test Error', type: 'error', category: 'component', ttl: 'none' };\n const errorEvent = new CustomEvent('NylasSchedulingError', { detail: mockError, bubbles: true });\n page.win.dispatchEvent(errorEvent);\n await page.waitForChanges();\n\n const notification = page?.root?.shadowRoot?.querySelector('nylas-notification');\n expect(notification).not.toBeNull();\n const notifRoot = notification?.shadowRoot?.querySelector('.notif');\n expect(notifRoot).not.toBeNull();\n });\n\n it('shows no error when configID is set, and no sessionID is set', async () => {\n const availability = [\n {\n emails: ['xyz@gmail.com'],\n end_time: new Date(1709303400000),\n start_time: new Date(1709301600000),\n },\n ];\n const page = await newSpecPage({\n components: [NylasScheduling],\n template: () => (\n <nylas-scheduling\n config-id=\"configid\"\n defaultSchedulerState={{\n availability,\n }}\n ></nylas-scheduling>\n ),\n });\n\n await page.waitForChanges();\n\n const notification = page?.root?.shadowRoot?.querySelector('nylas-notification');\n const notifRoot = notification?.shadowRoot?.querySelector('.notif');\n expect(notifRoot).toBeUndefined();\n });\n\n it('listens for dateSelected event and updates date label', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling></nylas-scheduling>`,\n });\n\n const selectedDate = new Date();\n const dateSelectedEvent = new CustomEvent('dateSelected', { detail: selectedDate, bubbles: true });\n page.win.dispatchEvent(dateSelectedEvent);\n await page.waitForChanges();\n\n const selectedDateLabel = page?.root?.shadowRoot?.querySelector('#selectedDate');\n expect(selectedDateLabel?.textContent).toBe('No date selected');\n });\n\n it('conditionally renders cancel flow based on cancelBookingRef prop', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling cancel-booking-ref=${testBookingRef}></nylas-scheduling>`,\n });\n\n await page.waitForChanges();\n const cancelFlowPage = page?.root?.shadowRoot?.querySelector('.cancel-flow-page');\n expect(cancelFlowPage).not.toBeNull();\n });\n\n it('renders composable UI when mode is set to composable', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling mode=\"composable\">\n <nylas-if-state state=\"scheduler.eventInfo\" is-state-set=\"false\">\n <div class=\"flex\">\n <div class=\"flex flex-col gap-4 px-6 pt-4 h-[514px] w-[433px] border-slate-200 dark:border-slate-700 border-r\">\n <nylas-if-state state=\"scheduler.showBookingForm\" is-boolean=\"false\">\n <nylas-date-picker></nylas-date-picker>\n <div class=\"border-slate-200 dark:border-slate-700 border-t -mx-6 h-px\"></div>\n <nylas-locale-switch></nylas-locale-switch>\n </nylas-if-state>\n <nylas-if-state state=\"scheduler.showBookingForm\" is-boolean=\"true\">\n <div class=\"flex flex-col justify-center h-[496px]\">\n <nylas-selected-event-card></nylas-selected-event-card>\n </div>\n </nylas-if-state>\n </div>\n <div class=\"flex flex-col items-center min-w-[360px] overflow-hidden bg-slate-50 dark:bg-slate-700\">\n <nylas-if-state state=\"scheduler.showBookingForm\" is-boolean=\"false\" class=\"w-full\">\n <div class=\"flex flex-col justify-start w-full\">\n <nylas-if-state state=\"scheduler.selectableDates\" is-state-set=\"true\">\n <h2 class=\"flex items-center justify-center text-lg font-semibold w-full text-center gap-1 mb-4 mt-6 text-slate-700 dark:text-white\">\n <calendar-icon></calendar-icon>\n <nylas-if-state state=\"scheduler.selectedDate\" is-state-set=\"false\">\n <span>No date selected</span>\n </nylas-if-state>\n <nylas-if-state state=\"scheduler.selectedDate\" is-state-set=\"true\">\n <span id=\"selectedDate\"></span>\n </nylas-if-state>\n </h2>\n </nylas-if-state>\n <nylas-timeslot-picker></nylas-timeslot-picker>\n </div>\n </nylas-if-state>\n <nylas-if-state state=\"scheduler.showBookingForm\" is-boolean=\"true\" class=\"w-full\">\n <div class=\"flex flex-col justify-center h-[496px]\">\n <nylas-booking-form></nylas-booking-form>\n </div>\n </nylas-if-state>\n </div>\n </div>\n </nylas-if-state>\n </nylas-scheduling>`,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it('exposes getNylasSchedulingStore method and returns store', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling session-id=\"sessionid\"></nylas-scheduling>`,\n });\n const scheduler = page.rootInstance as NylasScheduling;\n\n const store = await scheduler.getNylasSchedulerStore();\n expect(store).toBeDefined();\n });\n\n it('exposes getNylasSchedulingConnector method and returns connector', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling session-id=\"sessionid\"></nylas-scheduling>`,\n });\n const scheduler = page.rootInstance as NylasScheduling;\n\n const connector = await scheduler.getNylasSchedulerConnector();\n expect(connector).toBeDefined();\n });\n\n it('should render the reschedule flow when rescheduleBookingRef is set', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling reschedule-booking-ref=${testBookingRef}></nylas-scheduling>`,\n });\n\n await page.waitForChanges();\n\n const messageBanner = page?.root?.shadowRoot?.querySelector('.message-banner');\n expect(messageBanner).not.toBeNull();\n });\n\n it('hides the nylas logo in the footer if nylasBranding is set', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n template: () => <nylas-scheduling config-id=\"configid\" nylasBranding={false}></nylas-scheduling>,\n });\n\n await page.waitForChanges();\n\n const footer = page?.root?.shadowRoot?.querySelector('.footer');\n expect(footer?.textContent).not.toContain('Powered by Nylas');\n });\n});\n"]}
1
+ {"version":3,"file":"nylas-scheduling.spec.js","sourceRoot":"","sources":["../../../../../src/components/scheduler/nylas-scheduling/test/nylas-scheduling.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AACnG,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,SAAS,GAAG,IAAI,CAAC;IACvB,MAAM,cAAc,GAAG,8CAA8C,CAAC;IACtE,UAAU,CAAC,GAAG,EAAE;QAEd,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,IAAI,CAAC;QAC1B,MAAM,CAAC,IAAI,GAAG,KAAM,SAAQ,YAAY;YACtC,YAAY,IAAsB;gBAChC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC;YAClD,CAAC;SACiB,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,EAAE;QACZ,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,eAAe,CAAC;YAC7B,IAAI,EAAE,uCAAuC;SAC9C,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACtC,CAAC,CAAC,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C;iBAClC;gBACD,kBAAkB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE;aACvE;YACD,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;QAEH,MAAM,eAAe,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;QACtE,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAEvC,MAAM,CAAC,WAAW,CAAC,CAAC,oBAAoB,CACtC,sVAAsV,CACvV,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { NylasScheduling } from '../nylas-scheduling';\nimport { NylasBookingForm } from '../../nylas-booking-form/nylas-booking-form';\nimport { NylasSelectedEventCard } from '../../nylas-selected-event-card/nylas-selected-event-card';\nimport { h } from '@stencil/core';\n\ndescribe('nylas-scheduling', () => {\n const REAL_DATE = Date;\n const testBookingRef = 'Of_H8WLEQ4aZTtx0NKajeAF1l9qpekHbo4by7AaZc8M=';\n beforeEach(() => {\n // Clear and reset the mock before each test if needed\n jest.clearAllMocks();\n });\n\n beforeAll(() => {\n const originalDate = Date;\n global.Date = class extends originalDate {\n constructor(date?: string | number) {\n super(date ? date : '2022-01-01T00:00:00.000Z');\n }\n } as DateConstructor;\n });\n\n afterAll(() => {\n global.Date = REAL_DATE;\n });\n\n it('renders', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling></nylas-scheduling>`,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it('listens for NylasSchedulingError event and updates state', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling></nylas-scheduling>`,\n });\n\n const mockError = { title: 'Error', description: 'Test Error', type: 'error', category: 'component', ttl: 'none' };\n const errorEvent = new CustomEvent('NylasSchedulingError', { detail: mockError, bubbles: true });\n page.win.dispatchEvent(errorEvent);\n await page.waitForChanges();\n\n const notification = page?.root?.shadowRoot?.querySelector('nylas-notification');\n expect(notification).not.toBeNull();\n const notifRoot = notification?.shadowRoot?.querySelector('.notif');\n expect(notifRoot).not.toBeNull();\n });\n\n it('shows no error when configID is set, and no sessionID is set', async () => {\n const availability = [\n {\n emails: ['xyz@gmail.com'],\n end_time: new Date(1709303400000),\n start_time: new Date(1709301600000),\n },\n ];\n const page = await newSpecPage({\n components: [NylasScheduling],\n template: () => (\n <nylas-scheduling\n config-id=\"configid\"\n defaultSchedulerState={{\n availability,\n }}\n ></nylas-scheduling>\n ),\n });\n\n await page.waitForChanges();\n\n const notification = page?.root?.shadowRoot?.querySelector('nylas-notification');\n const notifRoot = notification?.shadowRoot?.querySelector('.notif');\n expect(notifRoot).toBeUndefined();\n });\n\n it('listens for dateSelected event and updates date label', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling></nylas-scheduling>`,\n });\n\n const selectedDate = new Date();\n const dateSelectedEvent = new CustomEvent('dateSelected', { detail: selectedDate, bubbles: true });\n page.win.dispatchEvent(dateSelectedEvent);\n await page.waitForChanges();\n\n const selectedDateLabel = page?.root?.shadowRoot?.querySelector('#selectedDate');\n expect(selectedDateLabel?.textContent).toBe('No date selected');\n });\n\n it('conditionally renders cancel flow based on cancelBookingRef prop', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling cancel-booking-ref=${testBookingRef}></nylas-scheduling>`,\n });\n\n await page.waitForChanges();\n const cancelFlowPage = page?.root?.shadowRoot?.querySelector('.cancel-flow-page');\n expect(cancelFlowPage).not.toBeNull();\n });\n\n it('renders composable UI when mode is set to composable', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling mode=\"composable\">\n <nylas-if-state state=\"scheduler.eventInfo\" is-state-set=\"false\">\n <div class=\"flex\">\n <div class=\"flex flex-col gap-4 px-6 pt-4 h-[514px] w-[433px] border-slate-200 dark:border-slate-700 border-r\">\n <nylas-if-state state=\"scheduler.showBookingForm\" is-boolean=\"false\">\n <nylas-date-picker></nylas-date-picker>\n <div class=\"border-slate-200 dark:border-slate-700 border-t -mx-6 h-px\"></div>\n <nylas-locale-switch></nylas-locale-switch>\n </nylas-if-state>\n <nylas-if-state state=\"scheduler.showBookingForm\" is-boolean=\"true\">\n <div class=\"flex flex-col justify-center h-[496px]\">\n <nylas-selected-event-card></nylas-selected-event-card>\n </div>\n </nylas-if-state>\n </div>\n <div class=\"flex flex-col items-center min-w-[360px] overflow-hidden bg-slate-50 dark:bg-slate-700\">\n <nylas-if-state state=\"scheduler.showBookingForm\" is-boolean=\"false\" class=\"w-full\">\n <div class=\"flex flex-col justify-start w-full\">\n <nylas-if-state state=\"scheduler.selectableDates\" is-state-set=\"true\">\n <h2 class=\"flex items-center justify-center text-lg font-semibold w-full text-center gap-1 mb-4 mt-6 text-slate-700 dark:text-white\">\n <calendar-icon></calendar-icon>\n <nylas-if-state state=\"scheduler.selectedDate\" is-state-set=\"false\">\n <span>No date selected</span>\n </nylas-if-state>\n <nylas-if-state state=\"scheduler.selectedDate\" is-state-set=\"true\">\n <span id=\"selectedDate\"></span>\n </nylas-if-state>\n </h2>\n </nylas-if-state>\n <nylas-timeslot-picker></nylas-timeslot-picker>\n </div>\n </nylas-if-state>\n <nylas-if-state state=\"scheduler.showBookingForm\" is-boolean=\"true\" class=\"w-full\">\n <div class=\"flex flex-col justify-center h-[496px]\">\n <nylas-booking-form></nylas-booking-form>\n </div>\n </nylas-if-state>\n </div>\n </div>\n </nylas-if-state>\n </nylas-scheduling>`,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it('exposes getNylasSchedulingStore method and returns store', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling session-id=\"sessionid\"></nylas-scheduling>`,\n });\n const scheduler = page.rootInstance as NylasScheduling;\n\n const store = await scheduler.getNylasSchedulerStore();\n expect(store).toBeDefined();\n });\n\n it('exposes getNylasSchedulingConnector method and returns connector', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling session-id=\"sessionid\"></nylas-scheduling>`,\n });\n const scheduler = page.rootInstance as NylasScheduling;\n\n const connector = await scheduler.getNylasSchedulerConnector();\n expect(connector).toBeDefined();\n });\n\n it('should render the reschedule flow when rescheduleBookingRef is set', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n html: `<nylas-scheduling reschedule-booking-ref=${testBookingRef}></nylas-scheduling>`,\n });\n\n await page.waitForChanges();\n\n const messageBanner = page?.root?.shadowRoot?.querySelector('.message-banner');\n expect(messageBanner).not.toBeNull();\n });\n\n it('hides the nylas logo in the footer if nylasBranding is set', async () => {\n const page = await newSpecPage({\n components: [NylasScheduling],\n template: () => <nylas-scheduling config-id=\"configid\" nylasBranding={false}></nylas-scheduling>,\n });\n\n await page.waitForChanges();\n\n const footer = page?.root?.shadowRoot?.querySelector('.footer');\n expect(footer?.textContent).not.toContain('Powered by Nylas');\n });\n\n it('redirects with the query params when redirectUrl is set', async () => {\n const configSettings = {\n name: '',\n slug: '',\n configuration_id: '19ca4a10-be05-4d1b-a830-5b639a362cef',\n scheduler: {\n available_days_in_future: 30,\n min_cancellation_notice: 0,\n min_booking_notice: 60,\n rescheduling_url: 'https://book.nylas.com/scheduler/reschedule/:booking_ref',\n cancellation_url: 'https://book.nylas.com/scheduler/cancel/:booking_ref',\n organizer_confirmation_url: 'https://book.nylas.com/scheduler/confirm/:booking_ref',\n confirmation_redirect_url: 'https://nylas.com',\n hide_rescheduling_options: false,\n hide_cancellation_options: false,\n hide_additional_guests: false,\n cancellation_policy: '',\n additional_fields: {\n dropdown: {\n label: 'Dropdown Label',\n type: 'dropdown',\n required: false,\n order: 2,\n options: ['option 1', 'option 2'],\n },\n short_text: {\n label: 'Short Text Label',\n type: 'text',\n required: false,\n order: 1,\n },\n },\n },\n organizer: {\n email: 'pooja.g@nylas.com',\n name: '',\n },\n booking_type: 'booking',\n appearance: {\n company_logo_url: '',\n },\n };\n const defaultSchedulerState = {\n showBookingForm: true,\n availability: [\n {\n emails: ['pooja.g@nylas.com'],\n end_time: 1728639000 as any,\n start_time: 1728637200 as any,\n },\n ],\n selectableDates: [new Date(1728639000000)],\n selectedDate: new Date(1728639000000),\n selectedTimeslot: {\n end_time: 1728639000 as any,\n start_time: 1728637200 as any,\n emails: ['janedoe@example.com'],\n },\n selectedTimezone: 'America/Los_Angeles',\n bookingInfo: {\n primaryParticipant: {\n name: 'John Doe',\n email: 'johndoe@example.com',\n },\n guests: [],\n additionalFields: {\n short_text: {\n value: 'some value',\n type: 'text',\n },\n dropdown: {\n value: 'option 2',\n type: 'dropdown',\n },\n field2: {\n value: 'some value',\n type: 'text',\n },\n },\n },\n configSettings: { ...configSettings },\n };\n jest.spyOn(global, 'fetch').mockImplementation(url => {\n if (url === 'https://api.us.nylas.com/v3/scheduling/ui-settings?configuration_id=19ca4a10-be05-4d1b-a830-5b639a362cef') {\n return Promise.resolve({ request_id: 'test', data: configSettings } as any);\n } else if (url === 'https://api.us.nylas.com/v3/scheduling/bookings?configuration_id=19ca4a10-be05-4d1b-a830-5b639a362cef') {\n return Promise.resolve({\n json: () =>\n Promise.resolve({\n request_id: '1729109187-ffa7e86e-c276-45c2-8cda-e3205e46d234',\n data: {\n event_id: 'jlid5nji0nmoupl87ls85iv8do',\n booking_id: '8f9f5145-c40c-4477-8d30-5c43256ddb60',\n title: 'm',\n description: '',\n organizer: {\n email: 'johndoe@example.com',\n name: '',\n },\n status: 'booked',\n },\n } as any),\n } as Response);\n }\n\n return fetch(url); // Fallback for unmocked URLs\n });\n let nylasScheduling: NylasScheduling;\n const page = await newSpecPage({\n components: [NylasSelectedEventCard, NylasBookingForm, NylasScheduling],\n template: () => (\n <nylas-scheduling\n mode=\"app\"\n configurationId={'19ca4a10-be05-4d1b-a830-5b639a362cef'}\n bookingInfo={defaultSchedulerState.bookingInfo}\n defaultSchedulerState={defaultSchedulerState}\n ></nylas-scheduling>\n ),\n });\n nylasScheduling = page.rootInstance as NylasScheduling;\n const redirectSpy = jest.spyOn(nylasScheduling, 'redirectToCustomUrl');\n await page.waitForChanges();\n expect(page.root).toMatchSnapshot();\n const nylasBookingForm = page?.root?.shadowRoot?.querySelector('nylas-booking-form') as HTMLNylasBookingFormElement;\n nylasBookingForm.bookingInfo = defaultSchedulerState.bookingInfo;\n await page.waitForChanges();\n const form = nylasBookingForm?.shadowRoot?.querySelector('form');\n expect(form).not.toBeNull();\n\n const detailsConfirmedEvent = new CustomEvent('detailsConfirmed', {\n detail: {\n additionalFields: { dropdown: 'option 2', short_text: 'hello' },\n guests: [],\n start_time: new Date(1729013400000),\n timezone: 'America/Toronto',\n email_language: 'en-US',\n end_time: new Date(1729015200000),\n timeslot: {\n start_time: new Date(1729013400000),\n end_time: new Date(1729015200000),\n },\n primaryParticipant: { name: 'John Doe', email: 'johndoe@example.com' },\n },\n bubbles: true,\n });\n\n await nylasScheduling.bookButtonClickedHandler(detailsConfirmedEvent);\n await page.waitForChanges();\n expect(redirectSpy).toHaveBeenCalled();\n // Assert that the redirect happened with the correct URL (includes field_2 in the additional_values)\n expect(redirectSpy).toHaveBeenCalledWith(\n 'https://nylas.com?booking_id=8f9f5145-c40c-4477-8d30-5c43256ddb60&name=John+Doe&email=johndoe%40example.com&start_time=1728637.2&end_time=1728639&tz=America%2FLos_Angeles&additional_values=%7B%22dropdown%22%3A%22option+2%22%2C%22short_text%22%3A%22hello%22%2C%22field2%22%3A%22some+value%22%7D&config_id=19ca4a10-be05-4d1b-a830-5b639a362cef',\n );\n });\n});\n"]}
@@ -1,4 +1,27 @@
1
1
  :host {
2
+ --nylas-primary: #2563eb;
3
+ --nylas-error: #cc4841;
4
+ --nylas-error-pressed: #992222;
5
+ --nylas-wraning: #f06c00;
6
+ --nylas-success: #16a392;
7
+ --nylas-info: #2b8fc2;
8
+ --nylas-base-0: #ffffff;
9
+ --nylas-base-25: #fcfcfd;
10
+ --nylas-base-50: #f8f9fc;
11
+ --nylas-base-100: #eaecf5;
12
+ --nylas-base-200: #d5d9eb;
13
+ --nylas-base-300: #b3b8d8;
14
+ --nylas-base-400: #717bbc;
15
+ --nylas-base-500: #4e5ba6;
16
+ --nylas-base-600: #3e4784;
17
+ --nylas-base-700: #263f72;
18
+ --nylas-base-800: #293056;
19
+ --nylas-base-900: #101323;
20
+ --nylas-base-950: #0e101b;
21
+ --nylas-border-radius: 0.25rem;
22
+ --nylas-border-radius-2x: 0.5rem;
23
+ --nylas-border-radius-3x: 0.75rem;
24
+ --nylas-font-family: "Inter", sans-serif;
2
25
  display: block;
3
26
  position: relative;
4
27
  height: inherit;
@@ -47,9 +47,9 @@ export class NylasSelectedEventCard {
47
47
  this.endTime = timeFormat.format(new Date(this.selectedTimeslot?.end_time));
48
48
  }
49
49
  render() {
50
- return (h(Host, { key: '2b4257d6793fd263e7978504b88e270d77e2e78f', part: "nsec" }, h("div", { key: '8eb84c0c375afd9824d88337003d09b7fe3db171', class: "event-card", part: "nsec__card" }, h("div", { key: 'bc7d364f1ec772f06f5eab4549b0433cb947f68d', class: "calendar-icon", part: "nsec__icon" }, h("calendar-icon", { key: 'a3f38777fea8b17714ad0dc34cd236a93e4360fd' })), h("div", { key: '1d23698c5a8d627bc10c7969e269a381584b6477', class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate
50
+ return (h(Host, { key: '988d5270aa9dbd656c11d70ae0f3058dd25b4eb8', part: "nsec" }, h("div", { key: '21681211baf07faa5b09cec29611859a8dbdd37b', class: "event-card", part: "nsec__card" }, h("div", { key: '9b478bc27a5469a7c67786e3b1958e20e2f59d9e', class: "calendar-icon", part: "nsec__icon" }, h("calendar-icon", { key: '9a9f4cd2551747874876d8a32943a8cd98032d1e' })), h("div", { key: 'f9dcde6ca9cffbfeb2f5dcd4e3586433bf2fd055', class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate
51
51
  ? capitalizeFirstLetter(this.selectedDate?.toLocaleDateString(LANGUAGE_CODE_MAP[this.selectedLanguage || navigator.language], { dateStyle: 'full', timeZone: this.selectedTimezone }))
52
- : '-'), h("div", { key: '4e02d04cc6918076935614be321619a9df16430d', class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), h("div", { key: 'ad39ae7e3df5e6652b0dad88b98695cfee00e3db', class: "event-timezone", part: "nsec__timezone" }, h("globe-icon", { key: '23b1e1fd15842a65278a969e1ce3aea0313ea46e' }), TIMEZONE_MAP[this.selectedTimezone])));
52
+ : '-'), h("div", { key: 'a6151b6f505de22f748fcd959c5aa04721a4dd52', class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), h("div", { key: '9190417c554a5e960841a8e132f3995574da14be', class: "event-timezone", part: "nsec__timezone" }, h("globe-icon", { key: '16f199ce28c18cc975bd8ade52f6b4fccfbe4455' }), TIMEZONE_MAP[this.selectedTimezone])));
53
53
  }
54
54
  static get is() { return "nylas-selected-event-card"; }
55
55
  static get encapsulation() { return "shadow"; }
@@ -118,7 +118,7 @@ export class NylasSelectedEventCard {
118
118
  "optional": false,
119
119
  "docs": {
120
120
  "tags": [],
121
- "text": "*\nThe selected timezone."
121
+ "text": "The selected timezone."
122
122
  },
123
123
  "attribute": "selected-timezone",
124
124
  "reflect": false,
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-selected-event-card.js","sourceRoot":"","sources":["../../../../src/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiBrE,MAAM,OAAO,sB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AAY;oBAChB,CAAC,CAAC,qBAAqB,CACnB,IAAI,CAAC,YAAY,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAC9J;oBACH,CAAC,CAAC,GAAG,CACH;gBACN,4DAAK,KAAK,EAAC,iCAAiC,EAAC,IAAI,EAAC,YAAY;oBAC3D,IAAI,CAAC,SAAS;;oBAAK,IAAI,CAAC,OAAO,CAC5B,CACF;YACN,4DAAK,KAAK,EAAC,gBAAgB,EAAC,IAAI,EAAC,gBAAgB;gBAC/C,oEAAyB;gBACxB,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAChC,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAzBC;IAXC,iBAAiB,CAAiG;QACjH,IAAI,EAAE,2BAA2B;QACjC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wBAAwB,EAAE,cAAc,CAAC;YAC1C,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;SACnD,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;oDAyBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { Component, h, Host, Prop, State } from '@stencil/core';\nimport type { NylasSchedulerConnector } from '../../..';\nimport type { Timeslot } from '@nylas/core';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { capitalizeFirstLetter, debug } from '@/utils/utils';\nimport { LANGUAGE_CODE_MAP, TIMEZONE_MAP } from '@/common/constants';\n\n/**\n * The `nylas-selected-event-card` component is a UI component that displays the selected event card.\n *\n * @part nsec - The selected event card component.\n * @part nsec__card - The card component.\n * @part nsec__icon - The calendar icon.\n * @part nsec__date - The date selected.\n * @part nsec__time - The timeslot selected.\n * @part nsec__timezone - The timezone selected.\n */\n@Component({\n tag: 'nylas-selected-event-card',\n styleUrl: 'nylas-selected-event-card.scss',\n shadow: true,\n})\nexport class NylasSelectedEventCard {\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date;\n\n /**\n * The selected time.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n\n /***\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * The selected language.\n */\n @Prop({ attribute: 'selected-language' }) readonly selectedLanguage?: string;\n\n @State() startTime: string = '';\n @State() endTime: string = '';\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-selected-event-card] Component will load`);\n }\n\n async componentDidLoad() {\n debug(`[nylas-selected-event-card] Component did load`);\n if (!this.selectedDate) {\n console.warn('[nylas-selected-event-card] \"selectedDate\" prop is not provided.');\n }\n if (!this.selectedTimeslot) {\n console.warn('[nylas-selected-event-card] \"selectedTimeslot\" prop is not provided.');\n }\n const timeFormat = new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: this.selectedTimezone,\n });\n\n this.startTime = timeFormat.format(new Date(this.selectedTimeslot?.start_time as Date));\n this.endTime = timeFormat.format(new Date(this.selectedTimeslot?.end_time as Date));\n }\n\n @RegisterComponent<NylasSelectedEventCard, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-selected-event-card',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"nsec\">\n <div class=\"event-card\" part=\"nsec__card\">\n <div class=\"calendar-icon\" part=\"nsec__icon\">\n <calendar-icon />\n </div>\n <div class=\"nylas-selected-event-card__date\" part=\"nsec__date\">\n {this.selectedDate\n ? capitalizeFirstLetter(\n this.selectedDate?.toLocaleDateString(LANGUAGE_CODE_MAP[this.selectedLanguage || navigator.language], { dateStyle: 'full', timeZone: this.selectedTimezone }),\n )\n : '-'}\n </div>\n <div class=\"nylas-selected-event-card__time\" part=\"nsec__time\">\n {this.startTime} - {this.endTime}\n </div>\n </div>\n <div class=\"event-timezone\" part=\"nsec__timezone\">\n <globe-icon></globe-icon>\n {TIMEZONE_MAP[this.selectedTimezone]}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-selected-event-card.js","sourceRoot":"","sources":["../../../../src/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiBrE,MAAM,OAAO,sBAAsB;;;;gCAc6C,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;;yBAOjG,EAAE;uBACJ,EAAE;;IAE7B,iBAAiB,KAAI,CAAC;IAEtB,oBAAoB,KAAI,CAAC;IAEzB,KAAK,CAAC,iBAAiB;QACrB,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC3D,CAA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H,CAAC,CAAC,GAAG,CACH;gBACN,4DAAK,KAAK,EAAC,iCAAiC,EAAC,IAAI,EAAC,YAAY;oBAC3D,IAAI,CAAC,SAAS;;oBAAK,IAAI,CAAC,OAAO,CAC5B,CACF;YACN,4DAAK,KAAK,EAAC,gBAAgB,EAAC,IAAI,EAAC,gBAAgB;gBAC/C,oEAAyB;gBACxB,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAChC,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAzBC;IAXC,iBAAiB,CAAiG;QACjH,IAAI,EAAE,2BAA2B;QACjC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wBAAwB,EAAE,cAAc,CAAC;YAC1C,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;SACnD,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;oDAyBD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { Component, h, Host, Prop, State } from '@stencil/core';\nimport type { NylasSchedulerConnector } from '../../..';\nimport type { Timeslot } from '@nylas/core';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { capitalizeFirstLetter, debug } from '@/utils/utils';\nimport { LANGUAGE_CODE_MAP, TIMEZONE_MAP } from '@/common/constants';\n\n/**\n * The `nylas-selected-event-card` component is a UI component that displays the selected event card.\n *\n * @part nsec - The selected event card component.\n * @part nsec__card - The card component.\n * @part nsec__icon - The calendar icon.\n * @part nsec__date - The date selected.\n * @part nsec__time - The timeslot selected.\n * @part nsec__timezone - The timezone selected.\n */\n@Component({\n tag: 'nylas-selected-event-card',\n styleUrl: 'nylas-selected-event-card.scss',\n shadow: true,\n})\nexport class NylasSelectedEventCard {\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date;\n\n /**\n * The selected time.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * The selected language.\n */\n @Prop({ attribute: 'selected-language' }) readonly selectedLanguage?: string;\n\n @State() startTime: string = '';\n @State() endTime: string = '';\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-selected-event-card] Component will load`);\n }\n\n async componentDidLoad() {\n debug(`[nylas-selected-event-card] Component did load`);\n if (!this.selectedDate) {\n console.warn('[nylas-selected-event-card] \"selectedDate\" prop is not provided.');\n }\n if (!this.selectedTimeslot) {\n console.warn('[nylas-selected-event-card] \"selectedTimeslot\" prop is not provided.');\n }\n const timeFormat = new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: this.selectedTimezone,\n });\n\n this.startTime = timeFormat.format(new Date(this.selectedTimeslot?.start_time as Date));\n this.endTime = timeFormat.format(new Date(this.selectedTimeslot?.end_time as Date));\n }\n\n @RegisterComponent<NylasSelectedEventCard, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-selected-event-card',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"nsec\">\n <div class=\"event-card\" part=\"nsec__card\">\n <div class=\"calendar-icon\" part=\"nsec__icon\">\n <calendar-icon />\n </div>\n <div class=\"nylas-selected-event-card__date\" part=\"nsec__date\">\n {this.selectedDate\n ? capitalizeFirstLetter(\n this.selectedDate?.toLocaleDateString(LANGUAGE_CODE_MAP[this.selectedLanguage || navigator.language], { dateStyle: 'full', timeZone: this.selectedTimezone }),\n )\n : '-'}\n </div>\n <div class=\"nylas-selected-event-card__time\" part=\"nsec__time\">\n {this.startTime} - {this.endTime}\n </div>\n </div>\n <div class=\"event-timezone\" part=\"nsec__timezone\">\n <globe-icon></globe-icon>\n {TIMEZONE_MAP[this.selectedTimezone]}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -1,6 +1,29 @@
1
1
  :host {
2
2
  display: block;
3
3
  height: calc(100% - 48px);
4
+ --nylas-primary: #2563eb;
5
+ --nylas-error: #cc4841;
6
+ --nylas-error-pressed: #992222;
7
+ --nylas-wraning: #f06c00;
8
+ --nylas-success: #16a392;
9
+ --nylas-info: #2b8fc2;
10
+ --nylas-base-0: #ffffff;
11
+ --nylas-base-25: #fcfcfd;
12
+ --nylas-base-50: #f8f9fc;
13
+ --nylas-base-100: #eaecf5;
14
+ --nylas-base-200: #d5d9eb;
15
+ --nylas-base-300: #b3b8d8;
16
+ --nylas-base-400: #717bbc;
17
+ --nylas-base-500: #4e5ba6;
18
+ --nylas-base-600: #3e4784;
19
+ --nylas-base-700: #263f72;
20
+ --nylas-base-800: #293056;
21
+ --nylas-base-900: #101323;
22
+ --nylas-base-950: #0e101b;
23
+ --nylas-border-radius: 0.25rem;
24
+ --nylas-border-radius-2x: 0.5rem;
25
+ --nylas-border-radius-3x: 0.75rem;
26
+ --nylas-font-family: "Inter", sans-serif;
4
27
  }
5
28
 
6
29
  .time-picker-wrapper {
@@ -29,11 +29,11 @@ export class NylasTimeslotPicker {
29
29
  this.handleMouseLeave = () => {
30
30
  this.hoveredTimeslotIndex = -1;
31
31
  };
32
- this.selectedDate = new Date();
33
32
  this.availability = undefined;
34
- this.selectedTimeslot = undefined;
35
33
  this.isLoading = undefined;
34
+ this.selectedTimeslot = undefined;
36
35
  this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
36
+ this.selectedDate = new Date();
37
37
  this.selectedLanguage = undefined;
38
38
  this.times = [];
39
39
  this.hoveredTimeslotIndex = undefined;
@@ -122,27 +122,6 @@ export class NylasTimeslotPicker {
122
122
  }
123
123
  static get properties() {
124
124
  return {
125
- "selectedDate": {
126
- "type": "unknown",
127
- "mutable": false,
128
- "complexType": {
129
- "original": "Date",
130
- "resolved": "Date | undefined",
131
- "references": {
132
- "Date": {
133
- "location": "global",
134
- "id": "global::Date"
135
- }
136
- }
137
- },
138
- "required": false,
139
- "optional": true,
140
- "docs": {
141
- "tags": [],
142
- "text": "The selected date."
143
- },
144
- "defaultValue": "new Date()"
145
- },
146
125
  "availability": {
147
126
  "type": "unknown",
148
127
  "mutable": false,
@@ -160,10 +139,33 @@ export class NylasTimeslotPicker {
160
139
  "required": false,
161
140
  "optional": true,
162
141
  "docs": {
163
- "tags": [],
164
- "text": "The available timeslots."
142
+ "tags": [{
143
+ "name": "standalone",
144
+ "text": "The available timeslots."
145
+ }],
146
+ "text": ""
165
147
  }
166
148
  },
149
+ "isLoading": {
150
+ "type": "boolean",
151
+ "mutable": false,
152
+ "complexType": {
153
+ "original": "boolean",
154
+ "resolved": "boolean | undefined",
155
+ "references": {}
156
+ },
157
+ "required": false,
158
+ "optional": true,
159
+ "docs": {
160
+ "tags": [{
161
+ "name": "standalone",
162
+ "text": "The loading state prop. Used to display loading state when fetching availability."
163
+ }],
164
+ "text": ""
165
+ },
166
+ "attribute": "loading-state",
167
+ "reflect": false
168
+ },
167
169
  "selectedTimeslot": {
168
170
  "type": "unknown",
169
171
  "mutable": false,
@@ -185,23 +187,6 @@ export class NylasTimeslotPicker {
185
187
  "text": "The selected timeslot."
186
188
  }
187
189
  },
188
- "isLoading": {
189
- "type": "boolean",
190
- "mutable": false,
191
- "complexType": {
192
- "original": "boolean",
193
- "resolved": "boolean | undefined",
194
- "references": {}
195
- },
196
- "required": false,
197
- "optional": true,
198
- "docs": {
199
- "tags": [],
200
- "text": "The loading state prop. Used to display loading state when fetching availability."
201
- },
202
- "attribute": "loading-state",
203
- "reflect": false
204
- },
205
190
  "selectedTimezone": {
206
191
  "type": "string",
207
192
  "mutable": false,
@@ -220,6 +205,27 @@ export class NylasTimeslotPicker {
220
205
  "reflect": false,
221
206
  "defaultValue": "Intl.DateTimeFormat().resolvedOptions().timeZone"
222
207
  },
208
+ "selectedDate": {
209
+ "type": "unknown",
210
+ "mutable": false,
211
+ "complexType": {
212
+ "original": "Date",
213
+ "resolved": "Date | undefined",
214
+ "references": {
215
+ "Date": {
216
+ "location": "global",
217
+ "id": "global::Date"
218
+ }
219
+ }
220
+ },
221
+ "required": false,
222
+ "optional": true,
223
+ "docs": {
224
+ "tags": [],
225
+ "text": "The selected date."
226
+ },
227
+ "defaultValue": "new Date()"
228
+ },
223
229
  "selectedLanguage": {
224
230
  "type": "string",
225
231
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-timeslot-picker.js","sourceRoot":"","sources":["../../../../src/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAK5F,OAAO,OAAO,MAAM,cAAc,CAAC;AAgBnC,MAAM,OAAO,mBAAmB;;QA+FtB,4BAAuB,GAAG,KAAK,EAAE,KAAY,EAAE,QAA8B,EAAE,EAAE;YACvF,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,KAAK,CAAC,0CAA0C,EAAE,QAAQ,CAAC,CAAC;YAC5D,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC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SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC7D,CAAC;YACD,iBAAiB,EAAE,KAAK,EAAE,KAA4B,EAAE,uBAAgD,EAAE,EAAE;gBAC1G,KAAK,CAAC,uBAAuB,EAAE,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBAClE,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;oBACjB,uBAAuB,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;gBAC/D,CAAC;YACH,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;iDAoED","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { debug, isSameDay } from '@/utils/utils';\nimport { Component, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerConnector } from '../../..';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { AvailabilityTimeslot } from '@/stores/scheduler-store';\nimport type { Timeslot } from '@nylas/core';\nimport i18next from '@/utils/i18n';\n\n/**\n * The `nylas-timeslot-picker` component is a UI component that allows users to select a timeslot from a list of available timeslots.\n *\n * @slot timeslot-picker-cta-label - The label for the timeslot picker CTA. Default is \"Next\".\n * @part ntp - The timeslot picker component.\n * @part ntp__timeslot - The timeslot button.\n * @part ntp__timeslot--selected - The selected timeslot button.\n * @part ntp__button-primary - The timeslot picker CTA.\n */\n@Component({\n tag: 'nylas-timeslot-picker',\n styleUrl: 'nylas-timeslot-picker.scss',\n shadow: true,\n})\nexport class NylasTimeslotPicker {\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date = new Date();\n /**\n * The available timeslots.\n */\n @Prop({ attribute: 'availability' }) readonly availability?: AvailabilityTimeslot[];\n /**\n * The selected timeslot.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n /**\n * The loading state prop. Used to display loading state when fetching availability.\n */\n @Prop({ attribute: 'loading-state' }) readonly isLoading?: boolean;\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: string;\n\n /**\n * This event is fired when a timeslot is selected.\n */\n @Event() readonly timeslotSelected!: EventEmitter<Timeslot>;\n /**\n * This event is fired when a timeslot is confirmed. By default, this will proceed to the booking form page.\n */\n @Event() readonly timeslotConfirmed!: EventEmitter<Timeslot>;\n\n @State() times: AvailabilityTimeslot[] = [];\n @State() hoveredTimeslotIndex?: number;\n @State() selectedTimeslotIndex?: string;\n\n @Watch('selectedLanguage')\n selectedLanguageChanged(newLanguage: string) {\n i18next.changeLanguage(newLanguage);\n }\n\n @Watch('selectedDate')\n selectedDateChanged(newVal: Date | null | undefined) {\n debug(`[nylas-timeslot-picker] Selected date changed`, { newVal });\n\n if (newVal) {\n this.selectedTimeslotIndex = '';\n if (typeof newVal !== 'undefined') {\n const availableTimes = this.availability?.filter(timeslot => isSameDay(timeslot.start_time, newVal)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n }\n\n @Watch('availability')\n availabilityChanged(newVal: AvailabilityTimeslot[] | undefined) {\n debug(`[nylas-timeslot-picker] Available times changed`, { newVal, selectedDate: this.selectedDate });\n\n if (typeof newVal !== 'undefined') {\n const availableTimes = newVal?.filter(timeslot => this.selectedDate && isSameDay(timeslot.start_time, this.selectedDate)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n const availableTimes = this.availability?.filter(timeslot => this.selectedDate && isSameDay(timeslot.start_time, this.selectedDate)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n debug(`[nylas-timeslot-picker] Component will load`, { selectedDate: this.selectedDate, availability: this.availability, times: this.times });\n }\n\n async componentDidLoad() {\n debug(`[nylas-timeslot-picker] Component did load`);\n }\n\n private getTimeslotId(date: Date, index: number) {\n return `${date.toLocaleDateString()}-${index}`;\n }\n\n private onClickSelectTime(timeslot: Timeslot, index: number) {\n debug(`[nylas-timeslot-picker] Time selected`, timeslot, index);\n this.selectedTimeslotIndex = this.getTimeslotId(timeslot.start_time, index);\n this.timeslotSelected.emit({\n start_time: timeslot.start_time,\n end_time: timeslot.end_time,\n emails: timeslot.emails,\n });\n }\n\n private handleConfirmedTimeslot = async (event: Event, timeslot: Timeslot | undefined) => {\n event.preventDefault();\n debug(`[nylas-timeslot-picker] Confirm timeslot`, timeslot);\n this.timeslotConfirmed.emit(timeslot);\n };\n\n private handleMouseEnter = (index: number) => {\n this.hoveredTimeslotIndex = index;\n };\n\n private handleMouseLeave = () => {\n this.hoveredTimeslotIndex = -1;\n };\n\n private getTimeSlotLabel(timeslot: Timeslot) {\n const timeFormat = new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: this.selectedTimezone,\n });\n return `${timeFormat.format(timeslot.start_time)} - ${timeFormat.format(timeslot.end_time)}`;\n }\n\n @RegisterComponent<NylasTimeslotPicker, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-timeslot-picker',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.availability', 'availability'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.isLoading', 'isLoading'],\n ]),\n eventToProps: {\n timeslotSelected: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'timeslotSelected', event.detail);\n nylasSchedulerConnector.scheduler.selectTime(event.detail);\n },\n timeslotConfirmed: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'timeslotConfirmed', event.detail);\n if (event.detail) {\n nylasSchedulerConnector.scheduler.toggleAdditionalData(true);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n if (this.isLoading) {\n return (\n <Host>\n <div class={'loading'}>\n {new Array(6).fill(0).map((_, i) => (\n <div class={'timeslot-skeleton'} style={{ animationDelay: `${i * 20}ms` }} />\n ))}\n </div>\n </Host>\n );\n }\n\n if (this.availability && this.availability.length === 0) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No dates available</span>\n </div>\n </Host>\n );\n }\n\n if ((!this.times || this.times.length === 0) && !!this.selectedDate) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No time slots available for selected date</span>\n </div>\n </Host>\n );\n }\n\n if (!this.selectedDate) return <Host></Host>;\n\n return (\n <Host part=\"ntp\">\n <div class={'time-picker-wrapper'}>\n <div class={'timeslots'}>\n {this.times.map((timeslot, index) => (\n <button\n part={`ntp__timeslot ${this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime() ? 'ntp__timeslot--selected' : ''}`}\n aria-role=\"button\"\n class={{\n time: true,\n selected: typeof this.selectedTimeslot !== 'undefined' && this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime(),\n }}\n onClick={() => this.onClickSelectTime(timeslot, index)}\n onMouseEnter={() => this.handleMouseEnter(index)}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n {this.hoveredTimeslotIndex == index || this.selectedTimeslotIndex == this.getTimeslotId(timeslot.start_time, index)\n ? this.getTimeSlotLabel(timeslot)\n : timeslot.start_time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', timeZone: this.selectedTimezone })}\n </button>\n ))}\n </div>\n {this.selectedTimeslot && (\n <div class={'footer'}>\n <button-component variant={'primary'} onClick={(event: Event) => this.handleConfirmedTimeslot(event, this.selectedTimeslot)} part=\"ntp__button-primary\">\n <slot name=\"timeslot-picker-cta-label\">{i18next.t('nextButton')}</slot>\n </button-component>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"n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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AApEC;IAxBC,iBAAiB,CAA8F;QAC9G,IAAI,EAAE,uBAAuB;QAC7B,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wBAAwB,EAAE,cAAc,CAAC;YAC1C,CAAC,wBAAwB,EAAE,cAAc,CAAC;YAC1C,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;YAClD,CAAC,qBAAqB,EAAE,WAAW,CAAC;SACrC,CAAC;QACF,YAAY,EAAE;YACZ,gBAAgB,EAAE,KAAK,EAAE,KAA4B,EAAE,uBAAgD,EAAE,EAAE;gBACzG,KAAK,CAAC,uBAAuB,EAAE,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBACjE,uBAAuB,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC7D,CAAC;YACD,iBAAiB,EAAE,KAAK,EAAE,KAA4B,EAAE,uBAAgD,EAAE,EAAE;gBAC1G,KAAK,CAAC,uBAAuB,EAAE,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBAClE,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;oBACjB,uBAAuB,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;gBAC/D,CAAC;YACH,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;iDAoED","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { debug, isSameDay } from '@/utils/utils';\nimport { Component, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerConnector } from '../../..';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { AvailabilityTimeslot } from '@/stores/scheduler-store';\nimport type { Timeslot } from '@nylas/core';\nimport i18next from '@/utils/i18n';\n\n/**\n * The `nylas-timeslot-picker` component is a UI component that allows users to select a timeslot from a list of available timeslots.\n *\n * @slot timeslot-picker-cta-label - The label for the timeslot picker CTA. Default is \"Next\".\n * @part ntp - The timeslot picker component.\n * @part ntp__timeslot - The timeslot button.\n * @part ntp__timeslot--selected - The selected timeslot button.\n * @part ntp__button-primary - The timeslot picker CTA.\n */\n@Component({\n tag: 'nylas-timeslot-picker',\n styleUrl: 'nylas-timeslot-picker.scss',\n shadow: true,\n})\nexport class NylasTimeslotPicker {\n /**\n * @standalone\n * The available timeslots.\n */\n @Prop({ attribute: 'availability' }) readonly availability?: AvailabilityTimeslot[];\n /**\n * @standalone\n * The loading state prop. Used to display loading state when fetching availability.\n */\n @Prop({ attribute: 'loading-state' }) readonly isLoading?: boolean;\n /**\n * The selected timeslot.\n */\n @Prop({ attribute: 'selected-timeslot' }) readonly selectedTimeslot?: Timeslot;\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n /**\n * The selected date.\n */\n @Prop({ attribute: 'selected-date' }) readonly selectedDate?: Date = new Date();\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: string;\n\n /**\n * This event is fired when a timeslot is selected.\n */\n @Event() readonly timeslotSelected!: EventEmitter<Timeslot>;\n /**\n * This event is fired when a timeslot is confirmed. By default, this will proceed to the booking form page.\n */\n @Event() readonly timeslotConfirmed!: EventEmitter<Timeslot>;\n\n @State() times: AvailabilityTimeslot[] = [];\n @State() hoveredTimeslotIndex?: number;\n @State() selectedTimeslotIndex?: string;\n\n @Watch('selectedLanguage')\n selectedLanguageChanged(newLanguage: string) {\n i18next.changeLanguage(newLanguage);\n }\n\n @Watch('selectedDate')\n selectedDateChanged(newVal: Date | null | undefined) {\n debug(`[nylas-timeslot-picker] Selected date changed`, { newVal });\n\n if (newVal) {\n this.selectedTimeslotIndex = '';\n if (typeof newVal !== 'undefined') {\n const availableTimes = this.availability?.filter(timeslot => isSameDay(timeslot.start_time, newVal)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n }\n\n @Watch('availability')\n availabilityChanged(newVal: AvailabilityTimeslot[] | undefined) {\n debug(`[nylas-timeslot-picker] Available times changed`, { newVal, selectedDate: this.selectedDate });\n\n if (typeof newVal !== 'undefined') {\n const availableTimes = newVal?.filter(timeslot => this.selectedDate && isSameDay(timeslot.start_time, this.selectedDate)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n }\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n const availableTimes = this.availability?.filter(timeslot => this.selectedDate && isSameDay(timeslot.start_time, this.selectedDate)).map(timeslot => timeslot);\n this.times = availableTimes || [];\n debug(`[nylas-timeslot-picker] Component will load`, { selectedDate: this.selectedDate, availability: this.availability, times: this.times });\n }\n\n async componentDidLoad() {\n debug(`[nylas-timeslot-picker] Component did load`);\n }\n\n private getTimeslotId(date: Date, index: number) {\n return `${date.toLocaleDateString()}-${index}`;\n }\n\n private onClickSelectTime(timeslot: Timeslot, index: number) {\n debug(`[nylas-timeslot-picker] Time selected`, timeslot, index);\n this.selectedTimeslotIndex = this.getTimeslotId(timeslot.start_time, index);\n this.timeslotSelected.emit({\n start_time: timeslot.start_time,\n end_time: timeslot.end_time,\n emails: timeslot.emails,\n });\n }\n\n private handleConfirmedTimeslot = async (event: Event, timeslot: Timeslot | undefined) => {\n event.preventDefault();\n debug(`[nylas-timeslot-picker] Confirm timeslot`, timeslot);\n this.timeslotConfirmed.emit(timeslot);\n };\n\n private handleMouseEnter = (index: number) => {\n this.hoveredTimeslotIndex = index;\n };\n\n private handleMouseLeave = () => {\n this.hoveredTimeslotIndex = -1;\n };\n\n private getTimeSlotLabel(timeslot: Timeslot) {\n const timeFormat = new Intl.DateTimeFormat('en-US', {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: this.selectedTimezone,\n });\n return `${timeFormat.format(timeslot.start_time)} - ${timeFormat.format(timeslot.end_time)}`;\n }\n\n @RegisterComponent<NylasTimeslotPicker, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-timeslot-picker',\n stateToProps: new Map([\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.availability', 'availability'],\n ['scheduler.selectedTimeslot', 'selectedTimeslot'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.isLoading', 'isLoading'],\n ]),\n eventToProps: {\n timeslotSelected: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'timeslotSelected', event.detail);\n nylasSchedulerConnector.scheduler.selectTime(event.detail);\n },\n timeslotConfirmed: async (event: CustomEvent<Timeslot>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-timeslot-picker', 'timeslotConfirmed', event.detail);\n if (event.detail) {\n nylasSchedulerConnector.scheduler.toggleAdditionalData(true);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n if (this.isLoading) {\n return (\n <Host>\n <div class={'loading'}>\n {new Array(6).fill(0).map((_, i) => (\n <div class={'timeslot-skeleton'} style={{ animationDelay: `${i * 20}ms` }} />\n ))}\n </div>\n </Host>\n );\n }\n\n if (this.availability && this.availability.length === 0) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No dates available</span>\n </div>\n </Host>\n );\n }\n\n if ((!this.times || this.times.length === 0) && !!this.selectedDate) {\n return (\n <Host>\n <div class={'empty'}>\n <span>No time slots available for selected date</span>\n </div>\n </Host>\n );\n }\n\n if (!this.selectedDate) return <Host></Host>;\n\n return (\n <Host part=\"ntp\">\n <div class={'time-picker-wrapper'}>\n <div class={'timeslots'}>\n {this.times.map((timeslot, index) => (\n <button\n part={`ntp__timeslot ${this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime() ? 'ntp__timeslot--selected' : ''}`}\n aria-role=\"button\"\n class={{\n time: true,\n selected: typeof this.selectedTimeslot !== 'undefined' && this.selectedTimeslot?.start_time?.getTime() === timeslot.start_time.getTime(),\n }}\n onClick={() => this.onClickSelectTime(timeslot, index)}\n onMouseEnter={() => this.handleMouseEnter(index)}\n onMouseLeave={() => this.handleMouseLeave()}\n >\n {this.hoveredTimeslotIndex == index || this.selectedTimeslotIndex == this.getTimeslotId(timeslot.start_time, index)\n ? this.getTimeSlotLabel(timeslot)\n : timeslot.start_time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', timeZone: this.selectedTimezone })}\n </button>\n ))}\n </div>\n {this.selectedTimeslot && (\n <div class={'footer'}>\n <button-component variant={'primary'} onClick={(event: Event) => this.handleConfirmedTimeslot(event, this.selectedTimeslot)} part=\"ntp__button-primary\">\n <slot name=\"timeslot-picker-cta-label\">{i18next.t('nextButton')}</slot>\n </button-component>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}