bookito-widget 0.43.1 → 1.0.0-beta.2
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.
- package/README.md +191 -7
- package/dist/bookito-widget.css +3 -0
- package/dist/bookito-widget.iife.js +112 -0
- package/dist/bookito-widget.js +40173 -0
- package/dist/bookito-widget.umd.js +104 -1992
- package/dist/bookito-widget.window.js +104 -1992
- package/dist/src/app/i18n/index.d.ts +868 -0
- package/dist/src/app/i18n/locales/de.d.ts +86 -0
- package/dist/src/app/i18n/locales/en.d.ts +86 -0
- package/dist/src/app/i18n/locales/fr.d.ts +86 -0
- package/dist/src/app/i18n/locales/it.d.ts +86 -0
- package/dist/src/app/i18n/locales/pl.d.ts +86 -0
- package/dist/src/app/providers/BookitoWidgetRoot.vue.d.ts +8 -0
- package/dist/src/app/query/query-client.d.ts +2 -0
- package/dist/src/embed/global-api.d.ts +9 -0
- package/dist/src/embed/mount-registry.d.ts +10 -0
- package/dist/src/embed/mount.d.ts +12 -0
- package/dist/src/embed/open-modal.d.ts +11 -0
- package/dist/src/embed/shadow-dom.d.ts +5 -0
- package/dist/src/embed/vue-plugin.d.ts +14 -0
- package/dist/src/embed.d.ts +1 -0
- package/dist/src/features/booking-flow/api/bookito-booking.client.d.ts +2 -0
- package/dist/src/features/booking-flow/api/bookito-booking.dto.d.ts +25 -0
- package/dist/src/features/booking-flow/api/bookito-booking.mutations.d.ts +2 -0
- package/dist/src/features/booking-flow/components/AnimatedSuccessCheckmark.vue.d.ts +2 -0
- package/dist/src/features/booking-flow/components/BookingCheckbox.vue.d.ts +11 -0
- package/dist/src/features/booking-flow/components/BookingDetailsDateOfBirthInput.vue.d.ts +10 -0
- package/dist/src/features/booking-flow/components/BookingDetailsDialCodePicker.vue.d.ts +11 -0
- package/dist/src/features/booking-flow/components/BookingDetailsDialCodePickerContent.vue.d.ts +9 -0
- package/dist/src/features/booking-flow/components/BookingDetailsField.vue.d.ts +20 -0
- package/dist/src/features/booking-flow/components/BookingDetailsLanguageSelect.vue.d.ts +9 -0
- package/dist/src/features/booking-flow/components/BookingDetailsPhoneInput.vue.d.ts +12 -0
- package/dist/src/features/booking-flow/components/BookingDetailsSection.vue.d.ts +30 -0
- package/dist/src/features/booking-flow/components/BookingDetailsTextInput.vue.d.ts +13 -0
- package/dist/src/features/booking-flow/components/BookingExtras.vue.d.ts +15 -0
- package/dist/src/features/booking-flow/components/BookingFlowNextButton.vue.d.ts +10 -0
- package/dist/src/features/booking-flow/components/BookingFlowPanel.vue.d.ts +7 -0
- package/dist/src/features/booking-flow/components/BookingFlowStepper.vue.d.ts +13 -0
- package/dist/src/features/booking-flow/components/BookingFlowSuccess.vue.d.ts +5 -0
- package/dist/src/features/booking-flow/components/BookingGuestChips.vue.d.ts +11 -0
- package/dist/src/features/booking-flow/components/BookingGuestsStep.vue.d.ts +15 -0
- package/dist/src/features/booking-flow/components/BookingParticipantCounter.vue.d.ts +13 -0
- package/dist/src/features/booking-flow/components/BookingTimeSection.vue.d.ts +24 -0
- package/dist/src/features/booking-flow/components/booking-flow.props.d.ts +31 -0
- package/dist/src/features/booking-flow/composables/create-booking-flow-api.d.ts +70 -0
- package/dist/src/features/booking-flow/composables/useBookingFlow.d.ts +52 -0
- package/dist/src/features/booking-flow/composables/useBookingFlowActions.d.ts +13 -0
- package/dist/src/features/booking-flow/composables/useBookingFlowActions.types.d.ts +31 -0
- package/dist/src/features/booking-flow/composables/useBookingFlowFormSync.d.ts +12 -0
- package/dist/src/features/booking-flow/composables/useBookingFlowWaitlist.d.ts +17 -0
- package/dist/src/features/booking-flow/composables/useBookingGuestsStepLabels.d.ts +26 -0
- package/dist/src/features/booking-flow/composables/useBookingTimeSectionState.d.ts +19 -0
- package/dist/src/features/booking-flow/composables/useBookingTimeSlots.d.ts +18 -0
- package/dist/src/features/booking-flow/lib/booking-calendar-bounds.d.ts +9 -0
- package/dist/src/features/booking-flow/lib/booking-details-flow.helpers.d.ts +11 -0
- package/dist/src/features/booking-flow/lib/booking-details.helpers.d.ts +26 -0
- package/dist/src/features/booking-flow/lib/booking-external-participant.helpers.d.ts +10 -0
- package/dist/src/features/booking-flow/lib/booking-flow-stepper.helpers.d.ts +17 -0
- package/dist/src/features/booking-flow/lib/booking-flow.actions.d.ts +34 -0
- package/dist/src/features/booking-flow/lib/booking-flow.helpers.d.ts +32 -0
- package/dist/src/features/booking-flow/lib/booking-participants.helpers.d.ts +4 -0
- package/dist/src/features/booking-flow/lib/booking-payload-label.helpers.d.ts +14 -0
- package/dist/src/features/booking-flow/lib/booking-payload.helpers.d.ts +11 -0
- package/dist/src/features/booking-flow/lib/booking-step-completion.helpers.d.ts +2 -0
- package/dist/src/features/booking-flow/lib/booking-time-slot-payload.helpers.d.ts +8 -0
- package/dist/src/features/booking-flow/lib/filter-phone-dial-codes.d.ts +2 -0
- package/dist/src/features/booking-flow/lib/format-booking-time-slot-label.d.ts +13 -0
- package/dist/src/features/booking-flow/lib/phone-dial-code-countries.data.d.ts +2 -0
- package/dist/src/features/booking-flow/lib/phone-dial-codes.d.ts +6 -0
- package/dist/src/features/booking-flow/lib/reset-booking-auth.helpers.d.ts +1 -0
- package/dist/src/features/booking-flow/lib/reset-booking-confirm-step.helpers.d.ts +2 -0
- package/dist/src/features/booking-flow/lib/resolve-booking-total-price.d.ts +10 -0
- package/dist/src/features/booking-flow/lib/resolve-booking-waitlist.d.ts +19 -0
- package/dist/src/features/booking-flow/model/booking-display-step.types.d.ts +6 -0
- package/dist/src/features/booking-flow/model/booking-form-date.helpers.d.ts +10 -0
- package/dist/src/features/booking-flow/model/booking-form-navigation.helpers.d.ts +2 -0
- package/dist/src/features/booking-flow/model/booking-form.types.d.ts +27 -0
- package/dist/src/features/bookito-settings/api/bookito-settings.client.d.ts +2 -0
- package/dist/src/features/bookito-settings/api/bookito-settings.keys.d.ts +4 -0
- package/dist/src/features/bookito-settings/api/bookito-settings.queries.d.ts +2 -0
- package/dist/src/features/bookito-settings/model/bookito-settings.types.d.ts +27 -0
- package/dist/src/features/event-feed/api/bookito-event-category.client.d.ts +4 -0
- package/dist/src/features/event-feed/api/bookito-event-category.dto.d.ts +11 -0
- package/dist/src/features/event-feed/api/bookito-event-category.queries.d.ts +9 -0
- package/dist/src/features/event-feed/api/bookito-event-modal-dates.helpers.d.ts +6 -0
- package/dist/src/features/event-feed/api/bookito-event.client.d.ts +5 -0
- package/dist/src/features/event-feed/api/bookito-event.dto.d.ts +102 -0
- package/dist/src/features/event-feed/api/bookito-event.keys.d.ts +7 -0
- package/dist/src/features/event-feed/api/bookito-event.mapper-helpers.d.ts +17 -0
- package/dist/src/features/event-feed/api/bookito-event.mapper-image.helpers.d.ts +2 -0
- package/dist/src/features/event-feed/api/bookito-event.mapper-variant.helpers.d.ts +3 -0
- package/dist/src/features/event-feed/api/bookito-event.mapper.d.ts +6 -0
- package/dist/src/features/event-feed/api/bookito-event.queries.d.ts +24 -0
- package/dist/src/features/event-feed/api/bookito-time-slots.queries.d.ts +9 -0
- package/dist/src/features/event-feed/components/BookitoWidget.vue.d.ts +5 -0
- package/dist/src/features/event-feed/components/EventFeed.vue.d.ts +21 -0
- package/dist/src/features/event-feed/components/EventFeedScrollControls.vue.d.ts +13 -0
- package/dist/src/features/event-feed/components/ExperienceCard.vue.d.ts +13 -0
- package/dist/src/features/event-feed/components/PoweredByCarlito.vue.d.ts +2 -0
- package/dist/src/features/event-feed/composables/useBookitoWidgetTheme.d.ts +2 -0
- package/dist/src/features/event-feed/composables/useEventFeedScroll.d.ts +8 -0
- package/dist/src/features/event-feed/lib/event-feed-date.utils.d.ts +15 -0
- package/dist/src/features/event-feed/lib/event-feed-item.helpers.d.ts +9 -0
- package/dist/src/features/event-feed/lib/event-feed-occurrence.helpers.d.ts +7 -0
- package/dist/src/features/event-feed/lib/event-feed.utils.d.ts +8 -0
- package/dist/src/features/event-feed/lib/resolve-localized-text.d.ts +2 -0
- package/dist/src/features/event-feed/model/widget.types.d.ts +96 -0
- package/dist/src/features/experience-detail/components/BookitoEventModal.vue.d.ts +14 -0
- package/dist/src/features/experience-detail/components/ExperienceDetailPanel.vue.d.ts +9 -0
- package/dist/src/features/experience-detail/components/ExperienceOverlay.vue.d.ts +16 -0
- package/dist/src/features/experience-detail/components/ExperienceOverlayContent.vue.d.ts +29 -0
- package/dist/src/features/experience-detail/components/ExperienceOverlayHeader.vue.d.ts +15 -0
- package/dist/src/features/experience-detail/composables/useExperienceOverlayBooking.d.ts +20 -0
- package/dist/src/features/experience-detail/lib/bookito-event-modal.helpers.d.ts +7 -0
- package/dist/src/features/experience-detail/lib/experience-booking-cancellation.helpers.d.ts +2 -0
- package/dist/src/features/experience-detail/lib/experience-booking-cutoff.helpers.d.ts +3 -0
- package/dist/src/features/experience-detail/lib/experience-booking-date.helpers.d.ts +3 -0
- package/dist/src/features/experience-detail/lib/experience-overlay.helpers.d.ts +3 -0
- package/dist/src/features/experience-detail/lib/resolve-experience-booking-availability.d.ts +39 -0
- package/dist/src/features/guest-auth/api/guest-auth.client.d.ts +2 -0
- package/dist/src/features/guest-auth/api/guest-auth.dto.d.ts +36 -0
- package/dist/src/features/guest-auth/api/guest-auth.mutations.d.ts +2 -0
- package/dist/src/features/guest-auth/lib/map-login-guests.d.ts +2 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/shared/api/api-config.d.ts +5 -0
- package/dist/src/shared/api/auth-tokens.d.ts +3 -0
- package/dist/src/shared/api/federation-client.d.ts +14 -0
- package/dist/src/shared/api/federation-errors.d.ts +9 -0
- package/dist/src/shared/api/graphql-client.d.ts +22 -0
- package/dist/src/shared/api/subdomain-parameter.d.ts +8 -0
- package/dist/src/shared/calendar/BookingCalendar.vue.d.ts +15 -0
- package/dist/src/shared/calendar/BookingCalendarGrid.vue.d.ts +8 -0
- package/dist/src/shared/calendar/BookingCalendarNavigation.vue.d.ts +17 -0
- package/dist/src/shared/calendar/calendar-date-key.d.ts +4 -0
- package/dist/src/shared/calendar/calendar-date-value.d.ts +11 -0
- package/dist/src/shared/calendar/calendar-date.types.d.ts +1 -0
- package/dist/src/shared/calendar/hotel-calendar-date.d.ts +10 -0
- package/dist/src/shared/calendar/index.d.ts +1 -0
- package/dist/src/shared/calendar/useBookingCalendarState.d.ts +29 -0
- package/dist/src/shared/config/languages.d.ts +3 -0
- package/dist/src/shared/lib/format-booking-price.d.ts +2 -0
- package/dist/src/shared/lib/is-ios-platform.d.ts +1 -0
- package/dist/src/shared/lib/map-language-to-intl-locale.d.ts +2 -0
- package/dist/src/shared/lib/normalize-widget-background-color.d.ts +1 -0
- package/dist/src/shared/lib/resolve-widget-title.d.ts +2 -0
- package/dist/src/shared/markdown/components/CarlitoMarkdownRenderer.vue.d.ts +8 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfEmbed.vue.d.ts +6 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfLoading.vue.d.ts +2 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfRenderer.vue.d.ts +14 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfViewer.vue.d.ts +38 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfViewerError.vue.d.ts +5 -0
- package/dist/src/shared/markdown/components/PdfEmbed/composables/usePdfViewerState.d.ts +24 -0
- package/dist/src/shared/markdown/components/PdfEmbed/composables/useRenderPdf.d.ts +17 -0
- package/dist/src/shared/markdown/components/PdfEmbed/lib/pdf-canvas.d.ts +40 -0
- package/dist/src/shared/markdown/components/PdfEmbed/lib/pdf-render-watches.d.ts +15 -0
- package/dist/src/shared/markdown/has-meaningful-markdown-content.d.ts +5 -0
- package/dist/src/shared/markdown/process-markdown.d.ts +1 -0
- package/dist/src/shared/markdown/remark-center.d.ts +3 -0
- package/dist/src/shared/markdown/transform-markdown-url.d.ts +1 -0
- package/dist/src/shared/pdf/create-pdf-panzoom-session.d.ts +18 -0
- package/dist/src/shared/pdf/index.d.ts +5 -0
- package/dist/src/shared/pdf/pdf-panzoom.d.ts +14 -0
- package/dist/src/shared/pdf/pdfjs.d.ts +2 -0
- package/dist/src/shared/pdf/setup-pdf-panzoom-watches.d.ts +14 -0
- package/dist/src/shared/pdf/usePdfPanzoom.d.ts +6 -0
- package/dist/src/shared/pdf/usePdfPanzoom.types.d.ts +11 -0
- package/dist/src/shared/theme/theme-loader.d.ts +19 -0
- package/dist/src/shared/utils/cn.d.ts +2 -0
- package/dist/src/shared/utils/dom-events.d.ts +4 -0
- package/package.json +102 -4
- package/.babelrc +0 -12
- package/.eslintrc.json +0 -18
- package/CHANGELOG.md +0 -1931
- package/dist/1219.js +0 -1
- package/dist/1229.js +0 -2
- package/dist/1229.js.LICENSE.txt +0 -3
- package/dist/135.js +0 -2
- package/dist/135.js.LICENSE.txt +0 -3
- package/dist/1385.js +0 -2
- package/dist/1385.js.LICENSE.txt +0 -3
- package/dist/1421.js +0 -2
- package/dist/1421.js.LICENSE.txt +0 -3
- package/dist/1426.js +0 -2
- package/dist/1426.js.LICENSE.txt +0 -3
- package/dist/1428.js +0 -2
- package/dist/1428.js.LICENSE.txt +0 -3
- package/dist/1677.js +0 -2
- package/dist/1677.js.LICENSE.txt +0 -3
- package/dist/173.js +0 -2
- package/dist/173.js.LICENSE.txt +0 -3
- package/dist/1798.js +0 -2
- package/dist/1798.js.LICENSE.txt +0 -3
- package/dist/1813.js +0 -2
- package/dist/1813.js.LICENSE.txt +0 -3
- package/dist/2411.js +0 -2
- package/dist/2411.js.LICENSE.txt +0 -3
- package/dist/2782.js +0 -2
- package/dist/2782.js.LICENSE.txt +0 -3
- package/dist/2827.js +0 -2
- package/dist/2827.js.LICENSE.txt +0 -3
- package/dist/2939.js +0 -2
- package/dist/2939.js.LICENSE.txt +0 -3
- package/dist/3002.js +0 -2
- package/dist/3002.js.LICENSE.txt +0 -3
- package/dist/3140.js +0 -1
- package/dist/3rdpartylicenses.txt +0 -3609
- package/dist/4189.js +0 -2
- package/dist/4189.js.LICENSE.txt +0 -3
- package/dist/4194.js +0 -2
- package/dist/4194.js.LICENSE.txt +0 -3
- package/dist/4220.js +0 -2
- package/dist/4220.js.LICENSE.txt +0 -3
- package/dist/434.js +0 -2
- package/dist/434.js.LICENSE.txt +0 -3
- package/dist/4606.js +0 -2
- package/dist/4606.js.LICENSE.txt +0 -3
- package/dist/4614.js +0 -2
- package/dist/4614.js.LICENSE.txt +0 -3
- package/dist/5065.js +0 -2
- package/dist/5065.js.LICENSE.txt +0 -3
- package/dist/5090.js +0 -2
- package/dist/5090.js.LICENSE.txt +0 -3
- package/dist/5143.js +0 -2
- package/dist/5143.js.LICENSE.txt +0 -3
- package/dist/5309.js +0 -2
- package/dist/5309.js.LICENSE.txt +0 -3
- package/dist/5397.js +0 -2
- package/dist/5397.js.LICENSE.txt +0 -3
- package/dist/5427.js +0 -2
- package/dist/5427.js.LICENSE.txt +0 -3
- package/dist/5941.js +0 -2
- package/dist/5941.js.LICENSE.txt +0 -3
- package/dist/5956.js +0 -2
- package/dist/5956.js.LICENSE.txt +0 -3
- package/dist/6016.js +0 -2
- package/dist/6016.js.LICENSE.txt +0 -3
- package/dist/6250.js +0 -2
- package/dist/6250.js.LICENSE.txt +0 -3
- package/dist/6290.js +0 -2
- package/dist/6290.js.LICENSE.txt +0 -3
- package/dist/6335.js +0 -2
- package/dist/6335.js.LICENSE.txt +0 -3
- package/dist/6462.js +0 -2
- package/dist/6462.js.LICENSE.txt +0 -3
- package/dist/650.js +0 -2
- package/dist/650.js.LICENSE.txt +0 -3
- package/dist/6531.js +0 -2
- package/dist/6531.js.LICENSE.txt +0 -3
- package/dist/6878.js +0 -2
- package/dist/6878.js.LICENSE.txt +0 -3
- package/dist/6892.js +0 -2
- package/dist/6892.js.LICENSE.txt +0 -3
- package/dist/6979.js +0 -2
- package/dist/6979.js.LICENSE.txt +0 -3
- package/dist/7120.js +0 -2
- package/dist/7120.js.LICENSE.txt +0 -3
- package/dist/7149.js +0 -2
- package/dist/7149.js.LICENSE.txt +0 -3
- package/dist/7202.js +0 -2
- package/dist/7202.js.LICENSE.txt +0 -3
- package/dist/7213.js +0 -2
- package/dist/7213.js.LICENSE.txt +0 -3
- package/dist/7290.js +0 -2
- package/dist/7290.js.LICENSE.txt +0 -3
- package/dist/7373.js +0 -2
- package/dist/7373.js.LICENSE.txt +0 -3
- package/dist/7515.js +0 -2
- package/dist/7515.js.LICENSE.txt +0 -3
- package/dist/7797.js +0 -2
- package/dist/7797.js.LICENSE.txt +0 -3
- package/dist/7804.js +0 -2
- package/dist/7804.js.LICENSE.txt +0 -3
- package/dist/7813.js +0 -2
- package/dist/7813.js.LICENSE.txt +0 -3
- package/dist/7843.js +0 -2
- package/dist/7843.js.LICENSE.txt +0 -3
- package/dist/8199.js +0 -2
- package/dist/8199.js.LICENSE.txt +0 -3
- package/dist/821.js +0 -2
- package/dist/821.js.LICENSE.txt +0 -3
- package/dist/8365.js +0 -2
- package/dist/8365.js.LICENSE.txt +0 -3
- package/dist/8599.js +0 -2
- package/dist/8599.js.LICENSE.txt +0 -3
- package/dist/880.js +0 -2
- package/dist/880.js.LICENSE.txt +0 -3
- package/dist/8831.js +0 -2
- package/dist/8831.js.LICENSE.txt +0 -3
- package/dist/885.js +0 -2
- package/dist/885.js.LICENSE.txt +0 -3
- package/dist/9079.js +0 -2
- package/dist/9079.js.LICENSE.txt +0 -3
- package/dist/9104.js +0 -2
- package/dist/9104.js.LICENSE.txt +0 -3
- package/dist/9236.js +0 -2
- package/dist/9236.js.LICENSE.txt +0 -3
- package/dist/942.js +0 -2
- package/dist/942.js.LICENSE.txt +0 -3
- package/dist/9456.js +0 -2
- package/dist/9456.js.LICENSE.txt +0 -3
- package/dist/951.js +0 -2
- package/dist/951.js.LICENSE.txt +0 -3
- package/dist/9636.js +0 -2
- package/dist/9636.js.LICENSE.txt +0 -3
- package/dist/9742.js +0 -2
- package/dist/9742.js.LICENSE.txt +0 -3
- package/dist/9792.js +0 -2
- package/dist/9792.js.LICENSE.txt +0 -3
- package/dist/9875.js +0 -2
- package/dist/9875.js.LICENSE.txt +0 -3
- package/dist/Carlito.eot +0 -0
- package/dist/Carlito.svg +0 -321
- package/dist/Carlito.ttf +0 -0
- package/dist/Carlito.woff +0 -0
- package/dist/Carlito.woff2 +0 -0
- package/dist/bookito-widget.umd.js.LICENSE.txt +0 -128
- package/dist/bookito-widget.window.js.LICENSE.txt +0 -128
- package/dist/layers-2x.png +0 -0
- package/dist/layers.png +0 -0
- package/dist/marker-icon.png +0 -0
- package/e2e-tests/e2e.html +0 -77
- package/index.html +0 -92
- package/jest.config.ts +0 -9
- package/postcss.config.js +0 -3
- package/project.json +0 -72
- package/src/BookitoEventDetail/index.tsx +0 -101
- package/src/BookitoEventModal/ModalLoader.tsx +0 -43
- package/src/BookitoEventModal/index.tsx +0 -71
- package/src/BookitoForm/EventInfo.tsx +0 -68
- package/src/BookitoForm/FormSubmitButton/AnimatedSuccessCheckmark/index.module.css +0 -45
- package/src/BookitoForm/FormSubmitButton/AnimatedSuccessCheckmark/index.tsx +0 -24
- package/src/BookitoForm/FormSubmitButton/index.tsx +0 -58
- package/src/BookitoForm/NewBookingForm.tsx +0 -199
- package/src/BookitoWidget/index.tsx +0 -299
- package/src/BookitoWidgetProvider/BookitoWidgetProvider.tsx +0 -36
- package/src/Card/EmptyCard.tsx +0 -30
- package/src/Card/index.tsx +0 -103
- package/src/CardHolder/index.tsx +0 -32
- package/src/Modal/index.tsx +0 -34
- package/src/assets/carlito-logo.svg +0 -10
- package/src/calendar-styles.css +0 -22
- package/src/index.module.css +0 -27
- package/src/index.tsx +0 -166
- package/src/types.ts +0 -8
- package/src/utils/index.tsx +0 -7
- package/tailwind.config.js +0 -13
- package/tsconfig.json +0 -26
- package/tsconfig.lib.json +0 -23
- package/tsconfig.spec.json +0 -20
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConditionallyLocalizedListEventsResponse,
|
|
3
|
-
LocalizedEventData,
|
|
4
|
-
SupportedLanguages,
|
|
5
|
-
useListLocalizedEventCategories,
|
|
6
|
-
useListPaginatedLocalizedEvents,
|
|
7
|
-
} from '@carlito/bookito-client';
|
|
8
|
-
import { cssModuleClassNames } from '@carlito/css';
|
|
9
|
-
import { InfiniteData } from '@tanstack/react-query';
|
|
10
|
-
import classNames from 'classnames';
|
|
11
|
-
import { DateTime } from 'luxon';
|
|
12
|
-
import { useEffect, useLayoutEffect, useMemo, useState } from 'react';
|
|
13
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
14
|
-
import BookitoEventDetail from '../BookitoEventDetail';
|
|
15
|
-
import EmptyCard from '../Card/EmptyCard';
|
|
16
|
-
import ExperienceCardHolder from '../CardHolder';
|
|
17
|
-
import Modal from '../Modal';
|
|
18
|
-
import CarlitoLogo from '../assets/carlito-logo.svg';
|
|
19
|
-
import styles from '../index.module.css';
|
|
20
|
-
import { BookitoWidgetViewMode, ResolvedOccurrence } from '../types';
|
|
21
|
-
import { useApp, useHotelDate } from '@carlito/api';
|
|
22
|
-
const { getCssModuleClassName } = cssModuleClassNames(styles);
|
|
23
|
-
|
|
24
|
-
// Helper function to extract actual data from InfiniteData or return the data directly
|
|
25
|
-
function extractEventsData(
|
|
26
|
-
data:
|
|
27
|
-
| InfiniteData<ConditionallyLocalizedListEventsResponse<true>>
|
|
28
|
-
| ConditionallyLocalizedListEventsResponse<true>
|
|
29
|
-
| undefined
|
|
30
|
-
): ConditionallyLocalizedListEventsResponse<true> | undefined {
|
|
31
|
-
if (!data) return undefined;
|
|
32
|
-
if ('pages' in data && Array.isArray(data.pages) && data.pages.length > 0) {
|
|
33
|
-
return data.pages[0];
|
|
34
|
-
}
|
|
35
|
-
return data as ConditionallyLocalizedListEventsResponse<true>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type BookitoWidgetProps = {
|
|
39
|
-
authId: string;
|
|
40
|
-
categoryId?: string;
|
|
41
|
-
title?: string;
|
|
42
|
-
language?: SupportedLanguages;
|
|
43
|
-
viewMode?: BookitoWidgetViewMode;
|
|
44
|
-
excludeNonBookable?: boolean;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
type SelectedEvent = {
|
|
48
|
-
event: LocalizedEventData;
|
|
49
|
-
date: Date;
|
|
50
|
-
occurrence?: ResolvedOccurrence;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const BookitoWidget = (props: BookitoWidgetProps) => {
|
|
54
|
-
const { viewMode = 'Date' } = props;
|
|
55
|
-
const { i18n } = useTranslation();
|
|
56
|
-
const { timezone } = useApp();
|
|
57
|
-
const dateToday = useHotelDate();
|
|
58
|
-
const [canFetchCategoryList, setFetchingCategoryList] = useState(false);
|
|
59
|
-
const [categoryTitle, setCategoryTitle] = useState('');
|
|
60
|
-
|
|
61
|
-
useLayoutEffect(() => {
|
|
62
|
-
if (props?.language) {
|
|
63
|
-
i18n.changeLanguage(props?.language);
|
|
64
|
-
}
|
|
65
|
-
}, [props?.language, i18n]);
|
|
66
|
-
|
|
67
|
-
const onCloseModal = () => {
|
|
68
|
-
setSelectedEvent(undefined);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const [selectedEvent, setSelectedEvent] = useState<SelectedEvent>();
|
|
72
|
-
|
|
73
|
-
const EmptyEventsList = () => {
|
|
74
|
-
return (
|
|
75
|
-
<>
|
|
76
|
-
{Array(10)
|
|
77
|
-
.fill(undefined)
|
|
78
|
-
.map((_, key) => (
|
|
79
|
-
<EmptyCard key={key} />
|
|
80
|
-
))}
|
|
81
|
-
</>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const listEventsQuery = useListPaginatedLocalizedEvents({
|
|
86
|
-
fromDate: dateToday.toISOString(),
|
|
87
|
-
excludeCancelled: true,
|
|
88
|
-
includeHidden: false,
|
|
89
|
-
authId: props?.authId,
|
|
90
|
-
categoryId: props?.categoryId,
|
|
91
|
-
excludeNonBookable: props.excludeNonBookable,
|
|
92
|
-
resolveOccurrences: true,
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const listEventCategoriesQuery = useListLocalizedEventCategories(
|
|
96
|
-
{ authId: props?.authId },
|
|
97
|
-
canFetchCategoryList
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const extractedEventsData = extractEventsData(listEventsQuery.data);
|
|
101
|
-
const isListLoadingOrEmpty =
|
|
102
|
-
listEventsQuery.isLoading ||
|
|
103
|
-
(listEventCategoriesQuery.isLoading && canFetchCategoryList) ||
|
|
104
|
-
(listEventsQuery.isSuccess &&
|
|
105
|
-
(!extractedEventsData?.events || extractedEventsData.events.length === 0));
|
|
106
|
-
|
|
107
|
-
useEffect(() => {
|
|
108
|
-
if (!props.title && props.categoryId) {
|
|
109
|
-
setFetchingCategoryList(true);
|
|
110
|
-
}
|
|
111
|
-
}, [props.title, props.categoryId]);
|
|
112
|
-
|
|
113
|
-
const eventCategories = listEventCategoriesQuery.data?.eventCategories;
|
|
114
|
-
|
|
115
|
-
useEffect(() => {
|
|
116
|
-
if (eventCategories) {
|
|
117
|
-
const categoryId = props.categoryId;
|
|
118
|
-
|
|
119
|
-
const eventCategory = eventCategories.find(({ id }: { id: string }) => id === categoryId);
|
|
120
|
-
|
|
121
|
-
if (eventCategory) {
|
|
122
|
-
const title = eventCategory.displayName;
|
|
123
|
-
if (title) {
|
|
124
|
-
setCategoryTitle(title);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}, [eventCategories, i18n.language, props.categoryId]);
|
|
129
|
-
|
|
130
|
-
const eventsData = extractedEventsData;
|
|
131
|
-
type EventsDataType = ConditionallyLocalizedListEventsResponse<true>;
|
|
132
|
-
|
|
133
|
-
const getAvailabilityDates = (eventId: string) => {
|
|
134
|
-
if (!eventsData?.dates) {
|
|
135
|
-
return [];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return Object.entries(eventsData.dates)
|
|
139
|
-
.map(([dateKey, values]) => {
|
|
140
|
-
const dateValues = values as { events: Array<{ id: string }> };
|
|
141
|
-
const isEventOnDate = dateValues.events.filter(
|
|
142
|
-
(event: { id: string }) => event.id === eventId
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
if (isEventOnDate.length) {
|
|
146
|
-
return dateKey;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return '';
|
|
150
|
-
})
|
|
151
|
-
.filter((el: string) => !!el);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const ListView = ({ eventsData }: { eventsData: EventsDataType | undefined }) => {
|
|
155
|
-
if (!eventsData?.events) {
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Earliest server-resolved occurrence per event across the loaded range
|
|
160
|
-
// (resolveOccurrences=true), so the flat list renders times without client RRULE.
|
|
161
|
-
const occurrencesByEventId: Record<string, ResolvedOccurrence> = {};
|
|
162
|
-
if (eventsData.dates) {
|
|
163
|
-
const sortedDays = Object.entries(eventsData.dates).sort(
|
|
164
|
-
([a], [b]) => new Date(a).getTime() - new Date(b).getTime()
|
|
165
|
-
);
|
|
166
|
-
for (const [, day] of sortedDays) {
|
|
167
|
-
for (const entry of day.events) {
|
|
168
|
-
const occurrence = entry.occurrences?.[0];
|
|
169
|
-
if (occurrence && !occurrencesByEventId[entry.id]) {
|
|
170
|
-
occurrencesByEventId[entry.id] = occurrence;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
<ExperienceCardHolder
|
|
178
|
-
events={eventsData.events}
|
|
179
|
-
occurrences={occurrencesByEventId}
|
|
180
|
-
openModal={(event) =>
|
|
181
|
-
setSelectedEvent({ event, date: dateToday, occurrence: occurrencesByEventId[event.id] })
|
|
182
|
-
}
|
|
183
|
-
/>
|
|
184
|
-
);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
function uppercaseFirstLetter(value: string) {
|
|
188
|
-
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const DateView = ({ eventsData }: { eventsData: EventsDataType | undefined }) => {
|
|
192
|
-
if (!eventsData?.dates) {
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const sortedDates = Object.entries(eventsData.dates).sort(([a], [b]) => {
|
|
197
|
-
const aDate = new Date(a);
|
|
198
|
-
const bDate = new Date(b);
|
|
199
|
-
return aDate.getTime() - bDate.getTime();
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
return sortedDates.map(([dateStr, dateEntry]) => {
|
|
203
|
-
const events = dateEntry.events;
|
|
204
|
-
const eventsToRender = events
|
|
205
|
-
.map((dateEntry: { id: string }) => {
|
|
206
|
-
const foundEvent = eventsData.events.find(
|
|
207
|
-
(pageEv: LocalizedEventData) => pageEv.id === dateEntry.id
|
|
208
|
-
) as LocalizedEventData | undefined;
|
|
209
|
-
return foundEvent;
|
|
210
|
-
})
|
|
211
|
-
.filter((ev: LocalizedEventData | undefined): ev is LocalizedEventData => Boolean(ev));
|
|
212
|
-
|
|
213
|
-
if (eventsToRender.length === 0) {
|
|
214
|
-
return null;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Server-resolved occurrence per event for this day (resolveOccurrences=true),
|
|
218
|
-
// so Cards render times without client RRULE.
|
|
219
|
-
const occurrencesByEventId: Record<string, ResolvedOccurrence> = {};
|
|
220
|
-
for (const entry of events) {
|
|
221
|
-
const occurrence = entry.occurrences?.[0];
|
|
222
|
-
if (occurrence) {
|
|
223
|
-
occurrencesByEventId[entry.id] = occurrence;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Interpret dateStr as local date in hotel's timezone
|
|
228
|
-
const date = DateTime.fromISO(dateStr, { zone: timezone }).startOf('day').toJSDate();
|
|
229
|
-
|
|
230
|
-
return (
|
|
231
|
-
<div key={dateStr}>
|
|
232
|
-
<span className="bookito-widget__events-date text-lg font-bold ml-4 mb-6 !text-left">
|
|
233
|
-
{uppercaseFirstLetter(
|
|
234
|
-
date.toLocaleDateString(i18n.language, {
|
|
235
|
-
weekday: 'long',
|
|
236
|
-
month: 'long',
|
|
237
|
-
day: 'numeric',
|
|
238
|
-
timeZone: timezone,
|
|
239
|
-
})
|
|
240
|
-
)}
|
|
241
|
-
</span>
|
|
242
|
-
<ExperienceCardHolder
|
|
243
|
-
events={eventsToRender}
|
|
244
|
-
occurrences={occurrencesByEventId}
|
|
245
|
-
openModal={(event) =>
|
|
246
|
-
setSelectedEvent({ event, date, occurrence: occurrencesByEventId[event.id] })
|
|
247
|
-
}
|
|
248
|
-
/>
|
|
249
|
-
</div>
|
|
250
|
-
);
|
|
251
|
-
});
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
return (
|
|
255
|
-
<div className="bookito-widget mx-8">
|
|
256
|
-
<div className="bookito-widget__title font-extrabold text-4xl non-italic">
|
|
257
|
-
{props?.title || categoryTitle || <Trans i18nKey="weekly-programs"></Trans>}
|
|
258
|
-
</div>
|
|
259
|
-
<div className="mb-10 p-2 ">
|
|
260
|
-
<div
|
|
261
|
-
className={classNames(
|
|
262
|
-
'pb-6 flex flex-initial flex- max-w-screen overflow-x-auto',
|
|
263
|
-
getCssModuleClassName('custom-scrollbar')
|
|
264
|
-
)}
|
|
265
|
-
>
|
|
266
|
-
{isListLoadingOrEmpty && <EmptyEventsList />}
|
|
267
|
-
|
|
268
|
-
{listEventsQuery.isSuccess && eventsData && viewMode === 'Date' && (
|
|
269
|
-
<DateView eventsData={eventsData} />
|
|
270
|
-
)}
|
|
271
|
-
|
|
272
|
-
{listEventsQuery.isSuccess && eventsData && viewMode === 'List' && (
|
|
273
|
-
<ListView eventsData={eventsData} />
|
|
274
|
-
)}
|
|
275
|
-
</div>
|
|
276
|
-
<div className="ml-auto min-w-min flex justify-end items-center opacity-30 pt-1">
|
|
277
|
-
<p className="text-sm mr-2">powered by</p>
|
|
278
|
-
<a href={'https://carlito-app.com'} target={'__blank'}>
|
|
279
|
-
<img src={CarlitoLogo} alt="logo" width={'80px'} />
|
|
280
|
-
</a>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
|
|
284
|
-
{selectedEvent && (
|
|
285
|
-
<Modal onCloseModal={onCloseModal}>
|
|
286
|
-
<BookitoEventDetail
|
|
287
|
-
event={selectedEvent.event}
|
|
288
|
-
date={selectedEvent.date}
|
|
289
|
-
authId={props?.authId}
|
|
290
|
-
availableOnDates={getAvailabilityDates(selectedEvent.event.id)}
|
|
291
|
-
viewMode={viewMode}
|
|
292
|
-
resolvedOccurrence={selectedEvent.occurrence}
|
|
293
|
-
/>
|
|
294
|
-
</Modal>
|
|
295
|
-
)}
|
|
296
|
-
</div>
|
|
297
|
-
);
|
|
298
|
-
};
|
|
299
|
-
export default BookitoWidget;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ApolloProvider } from '@apollo/client';
|
|
2
|
-
import { ContentLanguageProvider, AppProvider, client, SupportedLocalesCode } from '@carlito/api';
|
|
3
|
-
import { BookitoProvider } from '@carlito/bookito-client';
|
|
4
|
-
import { trackEvent } from '@carlito/external-api-gateway-client';
|
|
5
|
-
import i18n from '@carlito/react-intl';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
// Once per page load per hotel, even with several widgets or modals on the page.
|
|
9
|
-
const trackedHotelIds = new Set<string>();
|
|
10
|
-
|
|
11
|
-
const BookitoWidgetProvider: React.FC<{
|
|
12
|
-
language?: SupportedLocalesCode;
|
|
13
|
-
hotelId?: string;
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
}> = (props) => {
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
if (!props.hotelId || trackedHotelIds.has(props.hotelId)) return;
|
|
18
|
-
trackedHotelIds.add(props.hotelId);
|
|
19
|
-
trackEvent({ event: 'web_widget_loaded', hotelId: props.hotelId });
|
|
20
|
-
}, [props.hotelId]);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<ApolloProvider client={client}>
|
|
24
|
-
<AppProvider defaultLanguage={props.language} hotelId={props.hotelId}>
|
|
25
|
-
<ContentLanguageProvider
|
|
26
|
-
skipHotelLanguages={true}
|
|
27
|
-
browserLocale={props.language ?? (i18n.language as SupportedLocalesCode)}
|
|
28
|
-
>
|
|
29
|
-
<BookitoProvider language={props.language}>{props.children}</BookitoProvider>
|
|
30
|
-
</ContentLanguageProvider>
|
|
31
|
-
</AppProvider>
|
|
32
|
-
</ApolloProvider>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default BookitoWidgetProvider;
|
package/src/Card/EmptyCard.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const EmptyCard = () => {
|
|
2
|
-
return (
|
|
3
|
-
<div className="bookito-card__loader mr-5 animate-pulse min-w-min min-w-lg bg-white border border-gray-200 rounded-3xl shadow dark:bg-gray-800 dark:border-gray-700 text-left">
|
|
4
|
-
<div className="p-5 w-[80vw] md:w-80 lg:w-96">
|
|
5
|
-
<h5 className="mb-3 rounded-md max-w-fit px-2 bg-white text-md font-black tracking-tight text-gray-900 dark:text-black">
|
|
6
|
-
<div className="h-2 bg-slate-200 rounded"></div>
|
|
7
|
-
</h5>
|
|
8
|
-
|
|
9
|
-
<h5 className="mb-10 text-2xl font-bold tracking-tight text-gray-50 dark:text-white">
|
|
10
|
-
<div className="grid grid-cols-3 gap-4 mt-1">
|
|
11
|
-
<div className="h-4 bg-slate-200 rounded col-span-2"></div>
|
|
12
|
-
</div>
|
|
13
|
-
<div className="grid grid-cols-3 gap-4 mt-2">
|
|
14
|
-
<div className="h-4 bg-slate-200 rounded col-span-1"></div>
|
|
15
|
-
</div>
|
|
16
|
-
</h5>
|
|
17
|
-
|
|
18
|
-
<div className="mb-2 dark:text-white text-gray-50 mt-6">
|
|
19
|
-
{new Array(4).fill(undefined).map((_, key) => (
|
|
20
|
-
<div className="grid grid-cols-3 gap-4 mt-2" key={key}>
|
|
21
|
-
<div className="h-2 bg-slate-200 rounded col-span-3"></div>
|
|
22
|
-
</div>
|
|
23
|
-
))}
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default EmptyCard;
|
package/src/Card/index.tsx
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { LocalizedEventData } from '@carlito/bookito-client';
|
|
2
|
-
import { LineClamper } from '@carlito/dashboard-ui';
|
|
3
|
-
import { useApp } from '@carlito/api';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import formatPrice from '../utils';
|
|
6
|
-
import { ResolvedOccurrence } from '../types';
|
|
7
|
-
|
|
8
|
-
type CardProps = {
|
|
9
|
-
event: LocalizedEventData;
|
|
10
|
-
openModal: () => void;
|
|
11
|
-
occurrence?: ResolvedOccurrence;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const ExperienceCard = ({ event, openModal, occurrence }: CardProps) => {
|
|
15
|
-
const { title, basePrice, description, bannerImg } = event;
|
|
16
|
-
const { hotelCurrency, timezone } = useApp();
|
|
17
|
-
|
|
18
|
-
// Times come straight from the server-resolved occurrence (resolveOccurrences=true):
|
|
19
|
-
// startDateTime is an absolute instant and isAllDay is precomputed — no client RRULE.
|
|
20
|
-
// When no occurrence is supplied the time block is simply hidden.
|
|
21
|
-
const startDateTime = occurrence ? new Date(occurrence.startDateTime) : undefined;
|
|
22
|
-
const endDateTime =
|
|
23
|
-
startDateTime && occurrence
|
|
24
|
-
? new Date(startDateTime.getTime() + occurrence.durationMs)
|
|
25
|
-
: undefined;
|
|
26
|
-
|
|
27
|
-
const startDateTimeStr = startDateTime?.toLocaleString(undefined, {
|
|
28
|
-
hour: '2-digit',
|
|
29
|
-
minute: '2-digit',
|
|
30
|
-
timeZone: timezone,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const endDateTimeStr = endDateTime?.toLocaleString(undefined, {
|
|
34
|
-
hour: '2-digit',
|
|
35
|
-
minute: '2-digit',
|
|
36
|
-
timeZone: timezone,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const isAllDay = occurrence?.isAllDay ?? false;
|
|
40
|
-
|
|
41
|
-
const shouldShowPrice = Boolean(basePrice?.amount);
|
|
42
|
-
const shouldShowTimes = !isAllDay && Boolean(startDateTimeStr && endDateTimeStr);
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div
|
|
46
|
-
onClick={() => {
|
|
47
|
-
openModal();
|
|
48
|
-
}}
|
|
49
|
-
role="button"
|
|
50
|
-
style={{ backgroundImage: `url(${bannerImg?.url})` }}
|
|
51
|
-
className="bookito-widget__card relative mr-5 min-h-full p-5 min-w-lg bg-no-repeat bg-cover bg-white border border-gray-200 rounded-3xl shadow dark:bg-gray-800 dark:border-gray-700 text-left overflow-hidden"
|
|
52
|
-
>
|
|
53
|
-
<div className="bookito-widget__card__gradient absolute w-full h-full top-0 left-0 bg-gradient-to-t from-neutral-900"></div>
|
|
54
|
-
<div className="w-[80vw] md:w-80 lg:w-96 relative z-1 flex flex-col justify-between h-full">
|
|
55
|
-
{title && (
|
|
56
|
-
<div className="mb-10">
|
|
57
|
-
<h5 className="bookito-widget_card__title rounded-md w-fit max-w-full truncate px-2 bg-white text-xl font-black tracking-tight text-gray-900 dark:text-black">
|
|
58
|
-
{title}
|
|
59
|
-
</h5>
|
|
60
|
-
</div>
|
|
61
|
-
)}
|
|
62
|
-
|
|
63
|
-
<div>
|
|
64
|
-
{description && (
|
|
65
|
-
<div
|
|
66
|
-
className={classNames(
|
|
67
|
-
'bookito-widget__card__description pb-3 dark:text-white text-gray-50 text-xs',
|
|
68
|
-
{
|
|
69
|
-
'text-justify': shouldShowPrice && shouldShowTimes,
|
|
70
|
-
'text-left': shouldShowPrice && !shouldShowTimes,
|
|
71
|
-
'text-right': !shouldShowPrice && shouldShowTimes,
|
|
72
|
-
}
|
|
73
|
-
)}
|
|
74
|
-
>
|
|
75
|
-
<LineClamper lines={3}>{description}</LineClamper>
|
|
76
|
-
</div>
|
|
77
|
-
)}
|
|
78
|
-
|
|
79
|
-
<div className="flex items-end justify-between">
|
|
80
|
-
<h5 className="bookito-widget__card__price text-2xl font-bold tracking-tight text-gray-50 dark:text-white">
|
|
81
|
-
{shouldShowPrice
|
|
82
|
-
? formatPrice(basePrice?.amount ?? 0, undefined, hotelCurrency)
|
|
83
|
-
: undefined}
|
|
84
|
-
</h5>
|
|
85
|
-
|
|
86
|
-
<h5
|
|
87
|
-
className={classNames(
|
|
88
|
-
'bookito-widget__card__time text-lg font-bold tracking-tight text-gray-50 dark:text-white',
|
|
89
|
-
{
|
|
90
|
-
invisible: !shouldShowTimes,
|
|
91
|
-
}
|
|
92
|
-
)}
|
|
93
|
-
>
|
|
94
|
-
{startDateTimeStr} - {endDateTimeStr}
|
|
95
|
-
</h5>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export default ExperienceCard;
|
package/src/CardHolder/index.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { LocalizedEventData } from '@carlito/bookito-client';
|
|
2
|
-
import ExperienceCard from '../Card';
|
|
3
|
-
import { ResolvedOccurrence } from '../types';
|
|
4
|
-
|
|
5
|
-
type Props = {
|
|
6
|
-
events: LocalizedEventData[];
|
|
7
|
-
openModal(event: LocalizedEventData): void;
|
|
8
|
-
/** Server-resolved occurrence per event id (resolveOccurrences=true). */
|
|
9
|
-
occurrences?: Record<string, ResolvedOccurrence>;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const ExperienceCardHolder = ({ events, openModal, occurrences }: Props) => {
|
|
13
|
-
return (
|
|
14
|
-
<div
|
|
15
|
-
className="bookito-widget__events-list flex max-h-[200px]"
|
|
16
|
-
style={{
|
|
17
|
-
flexFlow: 'inherit',
|
|
18
|
-
}}
|
|
19
|
-
>
|
|
20
|
-
{events.map((event) => (
|
|
21
|
-
<ExperienceCard
|
|
22
|
-
key={event.id}
|
|
23
|
-
event={event}
|
|
24
|
-
openModal={() => openModal(event)}
|
|
25
|
-
occurrence={occurrences?.[event.id]}
|
|
26
|
-
/>
|
|
27
|
-
))}
|
|
28
|
-
</div>
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default ExperienceCardHolder;
|
package/src/Modal/index.tsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { cssModuleClassNames } from '@carlito/css';
|
|
2
|
-
import styles from '../index.module.css';
|
|
3
|
-
import cn from 'classnames';
|
|
4
|
-
import { PropsWithChildren } from 'react';
|
|
5
|
-
|
|
6
|
-
const { getCssModuleClassName } = cssModuleClassNames(styles);
|
|
7
|
-
export type ModalProps = PropsWithChildren<{
|
|
8
|
-
onCloseModal: () => void;
|
|
9
|
-
}>;
|
|
10
|
-
|
|
11
|
-
export default function Modal({ children, onCloseModal }: ModalProps) {
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<div className="bookito-widget__modal justify-center items-center flex overflow-x-hidden overflow-y-auto fixed inset-0 z-[2000] outline-none focus:outline-none">
|
|
15
|
-
<div className="relative w-full my-6 max-w-[70rem] max-h-[95%]">
|
|
16
|
-
<div className="border-0 rounded-lg shadow-lg relative flex flex-col w-full !bg-light-default outline-none focus:outline-none mb-10">
|
|
17
|
-
<button className="ml-auto mr-5 mt-2 font-extrabold text-lg" onClick={onCloseModal}>
|
|
18
|
-
X
|
|
19
|
-
</button>
|
|
20
|
-
<div
|
|
21
|
-
className={cn(
|
|
22
|
-
'max-h-[80vh] overflow-y-auto relative',
|
|
23
|
-
getCssModuleClassName('custom-scrollbar')
|
|
24
|
-
)}
|
|
25
|
-
>
|
|
26
|
-
{children}
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
<div className="bookito-widget__modal-overlay opacity-25 fixed inset-0 z-[1999] bg-black"></div>
|
|
32
|
-
</>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<svg width="785" height="335" viewBox="0 0 785 335" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M399.436 149.909C402.498 149.909 405.285 150.263 407.797 150.969C410.388 151.597 412.507 152.422 414.156 153.442C416.197 154.698 417.767 156.268 418.866 158.152C420.044 159.958 420.633 162.078 420.633 164.511C420.633 167.259 419.769 169.536 418.042 171.341C416.315 173.068 414.077 173.932 411.33 173.932C408.582 173.932 406.384 173.147 404.735 171.577C403.087 170.007 402.262 167.887 402.262 165.218C402.262 162.706 403.047 160.625 404.617 158.977C406.188 157.25 407.993 156.111 410.034 155.562C409.406 154.777 408.464 154.109 407.208 153.56C405.952 153.01 404.539 152.736 402.969 152.736C400.535 152.736 398.376 153.442 396.492 154.855C394.687 156.268 393.156 158.231 391.9 160.743C390.644 163.255 389.662 166.199 388.956 169.575C388.328 172.951 388.014 176.64 388.014 180.644C388.014 186.689 388.759 191.439 390.251 194.893C391.821 198.347 393.784 200.781 396.139 202.194C398.573 203.607 401.085 204.314 403.675 204.314C405.167 204.314 406.776 204.078 408.503 203.607C410.309 203.136 412.115 202.194 413.92 200.781C415.804 199.368 417.532 197.366 419.102 194.775L421.104 195.482C420.24 198.386 418.827 201.291 416.864 204.196C414.902 207.101 412.35 209.495 409.21 211.379C406.07 213.185 402.223 214.088 397.67 214.088C392.567 214.088 387.935 212.988 383.774 210.79C379.692 208.514 376.395 205.059 373.883 200.428C371.449 195.717 370.232 189.672 370.232 182.293C370.232 175.227 371.488 169.3 374 164.511C376.591 159.644 380.085 155.994 384.481 153.56C388.877 151.126 393.862 149.909 399.436 149.909Z" fill="black"/>
|
|
3
|
-
<path d="M443.489 213.263C439.956 213.263 437.012 212.596 434.657 211.261C432.302 209.927 430.575 208.16 429.475 205.962C428.376 203.686 427.827 201.213 427.827 198.543C427.827 195.168 428.573 192.42 430.064 190.3C431.634 188.181 433.636 186.454 436.07 185.119C438.504 183.784 441.055 182.685 443.724 181.822C446.472 180.958 449.063 180.134 451.496 179.349C454.008 178.485 456.01 177.504 457.502 176.405C459.072 175.227 459.857 173.736 459.857 171.93V162.745C459.857 160.704 459.504 158.898 458.797 157.328C458.169 155.68 457.149 154.423 455.735 153.56C454.401 152.696 452.635 152.265 450.436 152.265C448.866 152.265 447.296 152.5 445.726 152.971C444.156 153.364 442.861 154.07 441.84 155.091C444.038 155.876 445.726 157.093 446.904 158.741C448.16 160.311 448.788 162.117 448.788 164.158C448.788 166.827 447.846 168.947 445.962 170.517C444.156 172.087 441.997 172.872 439.485 172.872C436.659 172.872 434.5 172.009 433.008 170.282C431.595 168.476 430.889 166.317 430.889 163.805C430.889 161.528 431.438 159.644 432.537 158.152C433.715 156.661 435.324 155.248 437.365 153.913C439.563 152.657 442.193 151.676 445.255 150.969C448.395 150.263 451.771 149.909 455.382 149.909C458.993 149.909 462.251 150.302 465.156 151.087C468.061 151.794 470.495 153.128 472.457 155.091C474.263 156.896 475.44 159.134 475.99 161.803C476.539 164.394 476.814 167.691 476.814 171.695V203.725C476.814 205.687 477.01 207.061 477.403 207.846C477.796 208.553 478.463 208.906 479.405 208.906C480.111 208.906 480.779 208.71 481.407 208.317C482.113 207.925 482.859 207.454 483.644 206.904L484.822 208.906C483.173 210.319 481.25 211.418 479.052 212.203C476.932 212.91 474.538 213.263 471.868 213.263C468.964 213.263 466.648 212.871 464.921 212.086C463.194 211.222 461.937 210.084 461.152 208.671C460.446 207.258 460.093 205.609 460.093 203.725C458.208 206.708 455.932 209.063 453.263 210.79C450.593 212.439 447.335 213.263 443.489 213.263ZM451.849 205.727C453.42 205.727 454.833 205.373 456.089 204.667C457.423 203.882 458.679 202.626 459.857 200.899V176.758C459.15 177.936 458.169 178.996 456.913 179.938C455.657 180.88 454.322 181.861 452.909 182.882C451.496 183.824 450.122 184.884 448.788 186.061C447.532 187.239 446.511 188.691 445.726 190.418C444.941 192.145 444.548 194.226 444.548 196.659C444.548 199.721 445.216 201.998 446.55 203.489C447.885 204.981 449.651 205.727 451.849 205.727Z" fill="black"/>
|
|
4
|
-
<path d="M528.696 149.909C531.208 149.909 533.249 150.459 534.819 151.558C536.389 152.579 537.528 153.913 538.234 155.562C539.019 157.21 539.412 158.938 539.412 160.743C539.412 163.648 538.548 166.042 536.821 167.926C535.173 169.732 532.974 170.635 530.227 170.635C527.479 170.635 525.32 169.968 523.75 168.633C522.258 167.22 521.513 165.375 521.513 163.098C521.513 160.9 521.984 159.095 522.926 157.681C523.946 156.19 525.202 154.934 526.694 153.913C525.595 153.599 524.496 153.638 523.397 154.031C521.905 154.266 520.492 154.894 519.157 155.915C517.823 156.857 516.684 158.074 515.742 159.566C514.8 160.979 514.055 162.549 513.505 164.276C512.955 165.924 512.681 167.534 512.681 169.104V200.31C512.681 204.078 513.584 206.63 515.389 207.964C517.273 209.299 520.06 209.966 523.75 209.966V212.439C521.944 212.36 519.314 212.282 515.86 212.203C512.406 212.046 508.795 211.968 505.026 211.968C501.886 211.968 498.707 212.046 495.488 212.203C492.269 212.282 489.836 212.36 488.187 212.439V209.966C490.935 209.966 492.858 209.377 493.957 208.2C495.135 207.022 495.724 204.785 495.724 201.487V164.394C495.724 160.861 495.174 158.27 494.075 156.622C493.054 154.894 491.092 154.031 488.187 154.031V151.558C490.699 151.794 493.133 151.911 495.488 151.911C498.785 151.911 501.847 151.794 504.673 151.558C507.578 151.244 510.247 150.812 512.681 150.263V161.214C513.623 159.095 514.879 157.171 516.449 155.444C518.019 153.717 519.825 152.382 521.866 151.44C523.907 150.42 526.184 149.909 528.696 149.909Z" fill="black"/>
|
|
5
|
-
<path d="M564.189 120.234V201.487C564.189 204.785 564.738 207.022 565.837 208.2C567.015 209.377 568.978 209.966 571.725 209.966V212.439C570.234 212.36 567.996 212.282 565.013 212.203C562.03 212.046 559.007 211.968 555.946 211.968C552.884 211.968 549.783 212.046 546.643 212.203C543.581 212.282 541.265 212.36 539.695 212.439V209.966C542.443 209.966 544.366 209.377 545.465 208.2C546.643 207.022 547.232 204.785 547.232 201.487V134.365C547.232 130.833 546.682 128.242 545.583 126.593C544.562 124.866 542.6 124.003 539.695 124.003V121.53C542.207 121.765 544.641 121.883 546.996 121.883C550.215 121.883 553.277 121.765 556.181 121.53C559.086 121.216 561.755 120.784 564.189 120.234Z" fill="black"/>
|
|
6
|
-
<path d="M592.044 121.176C595.341 121.176 597.932 122.001 599.816 123.649C601.779 125.219 602.76 127.418 602.76 130.244C602.76 133.07 601.779 135.307 599.816 136.956C597.932 138.526 595.341 139.311 592.044 139.311C588.747 139.311 586.117 138.526 584.154 136.956C582.27 135.307 581.328 133.07 581.328 130.244C581.328 127.418 582.27 125.219 584.154 123.649C586.117 122.001 588.747 121.176 592.044 121.176ZM601.229 150.263V201.487C601.229 204.785 601.779 207.022 602.878 208.2C604.055 209.377 606.018 209.966 608.766 209.966V212.439C607.353 212.36 605.154 212.282 602.171 212.203C599.188 212.046 596.166 211.968 593.104 211.968C590.042 211.968 586.941 212.046 583.801 212.203C580.661 212.282 578.306 212.36 576.736 212.439V209.966C579.483 209.966 581.407 209.377 582.506 208.2C583.683 207.022 584.272 204.785 584.272 201.487V164.394C584.272 160.861 583.723 158.27 582.623 156.622C581.603 154.894 579.64 154.031 576.736 154.031V151.558C579.248 151.794 581.681 151.911 584.037 151.911C587.334 151.911 590.395 151.794 593.222 151.558C596.126 151.244 598.796 150.812 601.229 150.263Z" fill="black"/>
|
|
7
|
-
<path d="M637.785 132.246V151.558H651.68V153.913H637.785V201.487C637.785 203.843 638.217 205.53 639.08 206.551C639.944 207.493 641.239 207.964 642.966 207.964C644.379 207.964 645.792 207.454 647.205 206.433C648.619 205.334 649.875 203.489 650.974 200.899L652.976 201.958C651.72 205.491 649.796 208.396 647.205 210.673C644.693 212.949 641.239 214.088 636.843 214.088C634.252 214.088 631.975 213.734 630.013 213.028C628.05 212.4 626.402 211.418 625.067 210.084C623.34 208.357 622.201 206.237 621.652 203.725C621.102 201.134 620.828 197.798 620.828 193.715V153.913H610.936V151.558H620.828V136.014C624.125 136.014 627.147 135.739 629.895 135.19C632.721 134.562 635.351 133.58 637.785 132.246Z" fill="black"/>
|
|
8
|
-
<path d="M685.201 149.909C690.932 149.909 695.956 150.969 700.274 153.089C704.592 155.209 707.967 158.623 710.401 163.334C712.835 168.044 714.052 174.285 714.052 182.057C714.052 189.829 712.835 196.071 710.401 200.781C707.967 205.413 704.592 208.788 700.274 210.908C695.956 213.028 690.932 214.088 685.201 214.088C679.627 214.088 674.642 213.028 670.246 210.908C665.928 208.788 662.513 205.413 660.001 200.781C657.567 196.071 656.35 189.829 656.35 182.057C656.35 174.285 657.567 168.044 660.001 163.334C662.513 158.623 665.928 155.209 670.246 153.089C674.642 150.969 679.627 149.909 685.201 149.909ZM685.201 152.265C682.061 152.265 679.431 154.62 677.311 159.33C675.191 163.962 674.132 171.538 674.132 182.057C674.132 192.577 675.191 200.153 677.311 204.785C679.431 209.416 682.061 211.732 685.201 211.732C688.42 211.732 691.049 209.416 693.091 204.785C695.21 200.153 696.27 192.577 696.27 182.057C696.27 171.538 695.21 163.962 693.091 159.33C691.049 154.62 688.42 152.265 685.201 152.265Z" fill="black"/>
|
|
9
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M81.4996 39.5923C57.4122 39.5923 37.8856 59.119 37.8856 83.2064V257.663C37.8856 281.75 57.4123 301.277 81.4997 301.277H255.956C280.043 301.277 299.57 281.75 299.57 257.663V83.2064C299.57 59.119 280.043 39.5923 255.956 39.5923H81.4996ZM239.747 200.025C240.917 198.855 241.687 197.26 241.767 195.479C241.98 191.491 238.471 188.222 234.51 188.222H233.234C233.207 188.222 233.181 188.168 233.181 188.142C233.127 153.157 206.543 131.172 172.463 127.69C172.436 127.69 172.409 127.663 172.409 127.636V126.095C172.409 122.08 175.653 118.837 179.667 118.837C181.581 118.837 183.282 118.066 184.532 116.817C185.701 115.647 186.472 114.052 186.552 112.271C186.738 108.283 183.229 105.013 179.241 105.013H151.302C149.388 105.013 147.66 105.784 146.41 107.034C145.241 108.204 144.47 109.799 144.39 111.58C144.204 115.567 147.713 118.837 151.7 118.837C155.502 118.837 158.586 121.921 158.586 125.722V127.663C158.586 127.69 158.559 127.716 158.533 127.716C124.399 131.199 97.8146 153.237 97.8146 188.248H96.1132C94.1991 188.248 92.4712 189.019 91.2217 190.268C90.052 191.438 89.3077 193.007 89.2013 194.761C88.9621 198.749 92.4712 202.045 96.4854 202.045H234.855C236.769 202.045 238.497 201.274 239.747 200.025ZM77.1335 226.316H253.838V225.838C253.838 216.985 246.66 209.834 237.834 209.834H93.1371C84.2846 209.834 77.1335 217.012 77.1335 225.838V226.316ZM166.2 185.994C175.349 185.994 181.733 180.721 182.612 172.399H175.013C174.186 176.818 170.852 179.532 166.226 179.532C160.255 179.532 156.508 174.621 156.508 166.661C156.508 158.804 160.307 153.867 166.2 153.867C170.749 153.867 174.264 156.865 174.987 161.44H182.586C181.992 153.092 175.168 147.406 166.2 147.406C155.396 147.406 148.547 154.668 148.547 166.687C148.547 178.731 155.345 185.994 166.2 185.994Z" fill="black"/>
|
|
10
|
-
</svg>
|
package/src/calendar-styles.css
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
@import 'react-calendar/dist/Calendar.css';
|
|
2
|
-
|
|
3
|
-
.react-calendar {
|
|
4
|
-
border: none;
|
|
5
|
-
background: none;
|
|
6
|
-
}
|
|
7
|
-
.calendar-tile {
|
|
8
|
-
flex: 0 0 2.8rem !important;
|
|
9
|
-
height: 2.8rem;
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
align-items: center;
|
|
13
|
-
}
|
|
14
|
-
.calendar-tile.active {
|
|
15
|
-
border: 1px solid var(--theme-color-primary) !important;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.react-calendar__month-view__weekdays,
|
|
19
|
-
.react-calendar__month-view__days {
|
|
20
|
-
justify-content: space-around;
|
|
21
|
-
row-gap: 5px;
|
|
22
|
-
}
|
package/src/index.module.css
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
|
|
2
|
-
|
|
3
|
-
.custom-scrollbar::-webkit-scrollbar {
|
|
4
|
-
width: 10px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.custom-scrollbar::-webkit-scrollbar-track {
|
|
8
|
-
background: #f1f1f1;
|
|
9
|
-
border-radius: 10px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.custom-scrollbar::-webkit-scrollbar-thumb {
|
|
13
|
-
background: #d9d9d9; /* dark gray */
|
|
14
|
-
border-radius: 10px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
|
18
|
-
background: #555555; /* darker gray on hover */
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* For Firefox */
|
|
22
|
-
.custom-scrollbar {
|
|
23
|
-
scrollbar-width: thin;
|
|
24
|
-
scrollbar-color: #555555 #f1f1f1;
|
|
25
|
-
/* For IE and Edge */
|
|
26
|
-
-ms-overflow-style: -ms-autohiding-scrollbar;
|
|
27
|
-
}
|