@mrfylke/contact-form 0.1.3
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/lib/ContactFormRoot.d.ts +37 -0
- package/lib/ContactFormRoot.d.ts.map +1 -0
- package/lib/ContactFormRoot.js +53 -0
- package/lib/commoneEvents.d.ts +16 -0
- package/lib/commoneEvents.d.ts.map +1 -0
- package/lib/commoneEvents.js +4 -0
- package/lib/components/button/button.d.ts +17 -0
- package/lib/components/button/button.d.ts.map +1 -0
- package/lib/components/button/button.js +15 -0
- package/lib/components/button/button.module.css +399 -0
- package/lib/components/button/index.d.ts +5 -0
- package/lib/components/button/index.d.ts.map +1 -0
- package/lib/components/button/index.js +10 -0
- package/lib/components/button/link.d.ts +27 -0
- package/lib/components/button/link.d.ts.map +1 -0
- package/lib/components/button/link.js +19 -0
- package/lib/components/button/utils.d.ts +69 -0
- package/lib/components/button/utils.d.ts.map +1 -0
- package/lib/components/button/utils.js +33 -0
- package/lib/components/checkbox/checkbox.d.ts +13 -0
- package/lib/components/checkbox/checkbox.d.ts.map +1 -0
- package/lib/components/checkbox/checkbox.js +23 -0
- package/lib/components/checkbox/checkbox.module.css +96 -0
- package/lib/components/checkbox/index.d.ts +3 -0
- package/lib/components/checkbox/index.d.ts.map +1 -0
- package/lib/components/checkbox/index.js +8 -0
- package/lib/components/error-message/error-message.d.ts +6 -0
- package/lib/components/error-message/error-message.d.ts.map +1 -0
- package/lib/components/error-message/error-message.js +13 -0
- package/lib/components/error-message/error-message.module.css +6 -0
- package/lib/components/error-message/index.d.ts +3 -0
- package/lib/components/error-message/index.d.ts.map +1 -0
- package/lib/components/error-message/index.js +8 -0
- package/lib/components/external-link-page.d.ts +14 -0
- package/lib/components/external-link-page.d.ts.map +1 -0
- package/lib/components/external-link-page.js +27 -0
- package/lib/components/external-link-page.module.css +29 -0
- package/lib/components/form/date-selector.d.ts +11 -0
- package/lib/components/form/date-selector.d.ts.map +1 -0
- package/lib/components/form/date-selector.js +21 -0
- package/lib/components/form/description-modal.d.ts +13 -0
- package/lib/components/form/description-modal.d.ts.map +1 -0
- package/lib/components/form/description-modal.js +43 -0
- package/lib/components/form/field-wrapper-with-error/index.d.ts +8 -0
- package/lib/components/form/field-wrapper-with-error/index.d.ts.map +1 -0
- package/lib/components/form/field-wrapper-with-error/index.js +12 -0
- package/lib/components/form/fieldset/fieldset.module.css +26 -0
- package/lib/components/form/fieldset/index.d.ts +8 -0
- package/lib/components/form/fieldset/index.d.ts.map +1 -0
- package/lib/components/form/fieldset/index.js +17 -0
- package/lib/components/form/file-input.d.ts +10 -0
- package/lib/components/form/file-input.d.ts.map +1 -0
- package/lib/components/form/file-input.js +68 -0
- package/lib/components/form/form-component-label/form-component-label.module.css +10 -0
- package/lib/components/form/form-component-label/index.d.ts +9 -0
- package/lib/components/form/form-component-label/index.d.ts.map +1 -0
- package/lib/components/form/form-component-label/index.js +18 -0
- package/lib/components/form/form.module.css +573 -0
- package/lib/components/form/index.d.ts +11 -0
- package/lib/components/form/index.d.ts.map +1 -0
- package/lib/components/form/index.js +28 -0
- package/lib/components/form/input.d.ts +17 -0
- package/lib/components/form/input.d.ts.map +1 -0
- package/lib/components/form/input.js +42 -0
- package/lib/components/form/radio.d.ts +7 -0
- package/lib/components/form/radio.d.ts.map +1 -0
- package/lib/components/form/radio.js +14 -0
- package/lib/components/form/searchable-select/index.d.ts +3 -0
- package/lib/components/form/searchable-select/index.d.ts.map +1 -0
- package/lib/components/form/searchable-select/index.js +11 -0
- package/lib/components/form/searchable-select/searchable-select.d.ts +18 -0
- package/lib/components/form/searchable-select/searchable-select.d.ts.map +1 -0
- package/lib/components/form/searchable-select/searchable-select.js +55 -0
- package/lib/components/form/searchable-select/utils.d.ts +5 -0
- package/lib/components/form/searchable-select/utils.d.ts.map +1 -0
- package/lib/components/form/searchable-select/utils.js +19 -0
- package/lib/components/form/select.d.ts +15 -0
- package/lib/components/form/select.d.ts.map +1 -0
- package/lib/components/form/select.js +22 -0
- package/lib/components/form/textarea.d.ts +11 -0
- package/lib/components/form/textarea.d.ts.map +1 -0
- package/lib/components/form/textarea.js +17 -0
- package/lib/components/form/time-selector.d.ts +11 -0
- package/lib/components/form/time-selector.d.ts.map +1 -0
- package/lib/components/form/time-selector.js +22 -0
- package/lib/components/icon/checkbox-icon.d.ts +14 -0
- package/lib/components/icon/checkbox-icon.d.ts.map +1 -0
- package/lib/components/icon/checkbox-icon.js +18 -0
- package/lib/components/icon/color-icon.d.ts +17 -0
- package/lib/components/icon/color-icon.d.ts.map +1 -0
- package/lib/components/icon/color-icon.js +27 -0
- package/lib/components/icon/generated-icons.d.ts +1797 -0
- package/lib/components/icon/generated-icons.d.ts.map +1 -0
- package/lib/components/icon/generated-icons.js +1782 -0
- package/lib/components/icon/icon-wrapper.d.ts +30 -0
- package/lib/components/icon/icon-wrapper.d.ts.map +1 -0
- package/lib/components/icon/icon-wrapper.js +39 -0
- package/lib/components/icon/illustration.d.ts +7 -0
- package/lib/components/icon/illustration.d.ts.map +1 -0
- package/lib/components/icon/illustration.js +25 -0
- package/lib/components/icon/image.d.ts +7 -0
- package/lib/components/icon/image.d.ts.map +1 -0
- package/lib/components/icon/image.js +26 -0
- package/lib/components/icon/index.d.ts +6 -0
- package/lib/components/icon/index.d.ts.map +1 -0
- package/lib/components/icon/index.js +20 -0
- package/lib/components/icon/mono-icon-new.d.ts +32 -0
- package/lib/components/icon/mono-icon-new.d.ts.map +1 -0
- package/lib/components/icon/mono-icon-new.js +43 -0
- package/lib/components/icon/mono-icon.d.ts +29 -0
- package/lib/components/icon/mono-icon.d.ts.map +1 -0
- package/lib/components/icon/mono-icon.js +39 -0
- package/lib/components/icon/utils.d.ts +3 -0
- package/lib/components/icon/utils.d.ts.map +1 -0
- package/lib/components/icon/utils.js +12 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +18 -0
- package/lib/components/loading/index.d.ts +15 -0
- package/lib/components/loading/index.d.ts.map +1 -0
- package/lib/components/loading/index.js +19 -0
- package/lib/components/loading/loading.module.css +17 -0
- package/lib/components/section-card/index.d.ts +2 -0
- package/lib/components/section-card/index.d.ts.map +1 -0
- package/lib/components/section-card/index.js +8 -0
- package/lib/components/section-card/section-card.d.ts +7 -0
- package/lib/components/section-card/section-card.d.ts.map +1 -0
- package/lib/components/section-card/section-card.js +14 -0
- package/lib/components/section-card/section-card.module.css +15 -0
- package/lib/components/typography/index.d.ts +19 -0
- package/lib/components/typography/index.d.ts.map +1 -0
- package/lib/components/typography/index.js +27 -0
- package/lib/components/typography/utils.d.ts +2 -0
- package/lib/components/typography/utils.d.ts.map +1 -0
- package/lib/components/typography/utils.js +4 -0
- package/lib/contact.module.css +76 -0
- package/lib/error-content/error-content.d.ts +2 -0
- package/lib/error-content/error-content.d.ts.map +1 -0
- package/lib/error-content/error-content.js +19 -0
- package/lib/error-content/error-content.module.css +11 -0
- package/lib/group-travel/index.d.ts +2 -0
- package/lib/group-travel/index.d.ts.map +1 -0
- package/lib/group-travel/index.js +15 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +73 -0
- package/lib/journey-info/events.d.ts +14 -0
- package/lib/journey-info/events.d.ts.map +1 -0
- package/lib/journey-info/events.js +5 -0
- package/lib/journey-info/index.d.ts +2 -0
- package/lib/journey-info/index.d.ts.map +1 -0
- package/lib/journey-info/index.js +66 -0
- package/lib/journey-info/journeyInfoStateMachine.d.ts +179 -0
- package/lib/journey-info/journeyInfoStateMachine.d.ts.map +1 -0
- package/lib/journey-info/journeyInfoStateMachine.js +160 -0
- package/lib/layouts/contact-form-container.d.ts +10 -0
- package/lib/layouts/contact-form-container.d.ts.map +1 -0
- package/lib/layouts/contact-form-container.js +12 -0
- package/lib/layouts/contact-form-footer.d.ts +5 -0
- package/lib/layouts/contact-form-footer.d.ts.map +1 -0
- package/lib/layouts/contact-form-footer.js +59 -0
- package/lib/layouts/contact-form-header.d.ts +9 -0
- package/lib/layouts/contact-form-header.d.ts.map +1 -0
- package/lib/layouts/contact-form-header.js +45 -0
- package/lib/layouts/contact-page-layout.d.ts +24 -0
- package/lib/layouts/contact-page-layout.d.ts.map +1 -0
- package/lib/layouts/contact-page-layout.js +104 -0
- package/lib/layouts/container.module.css +15 -0
- package/lib/layouts/footer.module.css +109 -0
- package/lib/layouts/header.module.css +39 -0
- package/lib/layouts/index.d.ts +3 -0
- package/lib/layouts/index.d.ts.map +1 -0
- package/lib/layouts/index.js +11 -0
- package/lib/layouts/layout.module.css +80 -0
- package/lib/lines/use-lines.d.ts +25 -0
- package/lib/lines/use-lines.d.ts.map +1 -0
- package/lib/lines/use-lines.js +77 -0
- package/lib/lost-property/index.d.ts +2 -0
- package/lib/lost-property/index.d.ts.map +1 -0
- package/lib/lost-property/index.js +11 -0
- package/lib/means-of-transport/events.d.ts +17 -0
- package/lib/means-of-transport/events.d.ts.map +1 -0
- package/lib/means-of-transport/events.js +5 -0
- package/lib/means-of-transport/forms/delayForm.d.ts +11 -0
- package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/delayForm.js +88 -0
- package/lib/means-of-transport/forms/driverForm.d.ts +11 -0
- package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/driverForm.js +88 -0
- package/lib/means-of-transport/forms/index.d.ts +7 -0
- package/lib/means-of-transport/forms/index.d.ts.map +1 -0
- package/lib/means-of-transport/forms/index.js +18 -0
- package/lib/means-of-transport/forms/injuryForm.d.ts +11 -0
- package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/injuryForm.js +88 -0
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts +11 -0
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/serviceOfferingForm.js +64 -0
- package/lib/means-of-transport/forms/stopForm.d.ts +11 -0
- package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/stopForm.js +76 -0
- package/lib/means-of-transport/forms/transportationForm.d.ts +11 -0
- package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -0
- package/lib/means-of-transport/forms/transportationForm.js +88 -0
- package/lib/means-of-transport/index.d.ts +3 -0
- package/lib/means-of-transport/index.d.ts.map +1 -0
- package/lib/means-of-transport/index.js +47 -0
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +291 -0
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -0
- package/lib/means-of-transport/means-of-transport-form-machine.js +287 -0
- package/lib/modules/api-browser/index.d.ts +8 -0
- package/lib/modules/api-browser/index.d.ts.map +1 -0
- package/lib/modules/api-browser/index.js +54 -0
- package/lib/modules/api-server/external-client.d.ts +22 -0
- package/lib/modules/api-server/external-client.d.ts.map +1 -0
- package/lib/modules/api-server/external-client.js +86 -0
- package/lib/modules/api-server/index.d.ts +9 -0
- package/lib/modules/api-server/index.d.ts.map +1 -0
- package/lib/modules/api-server/index.js +24 -0
- package/lib/modules/api-server/requesters/graphql-requester.d.ts +6 -0
- package/lib/modules/api-server/requesters/graphql-requester.d.ts.map +1 -0
- package/lib/modules/api-server/requesters/graphql-requester.js +63 -0
- package/lib/modules/api-server/requesters/http-requester.d.ts +3 -0
- package/lib/modules/api-server/requesters/http-requester.d.ts.map +1 -0
- package/lib/modules/api-server/requesters/http-requester.js +110 -0
- package/lib/modules/api-server/requesters/types.d.ts +37 -0
- package/lib/modules/api-server/requesters/types.d.ts.map +1 -0
- package/lib/modules/api-server/requesters/types.js +34 -0
- package/lib/modules/api-server/requesters/utils.d.ts +17 -0
- package/lib/modules/api-server/requesters/utils.d.ts.map +1 -0
- package/lib/modules/api-server/requesters/utils.js +75 -0
- package/lib/modules/config/context.d.ts +54 -0
- package/lib/modules/config/context.d.ts.map +1 -0
- package/lib/modules/config/context.js +112 -0
- package/lib/modules/config/index.d.ts +4 -0
- package/lib/modules/config/index.d.ts.map +1 -0
- package/lib/modules/config/index.js +19 -0
- package/lib/modules/config/theme-adapter.d.ts +20 -0
- package/lib/modules/config/theme-adapter.d.ts.map +1 -0
- package/lib/modules/config/theme-adapter.js +56 -0
- package/lib/modules/config/types.d.ts +348 -0
- package/lib/modules/config/types.d.ts.map +1 -0
- package/lib/modules/config/types.js +6 -0
- package/lib/modules/cookies/constants.d.ts +4 -0
- package/lib/modules/cookies/constants.d.ts.map +1 -0
- package/lib/modules/cookies/constants.js +6 -0
- package/lib/modules/cookies/cookies-context.d.ts +17 -0
- package/lib/modules/cookies/cookies-context.d.ts.map +1 -0
- package/lib/modules/cookies/cookies-context.js +61 -0
- package/lib/modules/cookies/index.d.ts +15 -0
- package/lib/modules/cookies/index.d.ts.map +1 -0
- package/lib/modules/cookies/index.js +22 -0
- package/lib/modules/firebase/analytics.d.ts +3 -0
- package/lib/modules/firebase/analytics.d.ts.map +1 -0
- package/lib/modules/firebase/analytics.js +40 -0
- package/lib/modules/firebase/firebase.d.ts +4 -0
- package/lib/modules/firebase/firebase.d.ts.map +1 -0
- package/lib/modules/firebase/firebase.js +19 -0
- package/lib/modules/firebase/index.d.ts +5 -0
- package/lib/modules/firebase/index.d.ts.map +1 -0
- package/lib/modules/firebase/index.js +25 -0
- package/lib/modules/firebase/preassigned-fare-products.d.ts +8 -0
- package/lib/modules/firebase/preassigned-fare-products.d.ts.map +1 -0
- package/lib/modules/firebase/preassigned-fare-products.js +35 -0
- package/lib/modules/firebase/tariff-zones.d.ts +17 -0
- package/lib/modules/firebase/tariff-zones.d.ts.map +1 -0
- package/lib/modules/firebase/tariff-zones.js +32 -0
- package/lib/modules/firebase/transport-mode-filter.d.ts +27 -0
- package/lib/modules/firebase/transport-mode-filter.d.ts.map +1 -0
- package/lib/modules/firebase/transport-mode-filter.js +27 -0
- package/lib/modules/firebase/types.d.ts +19 -0
- package/lib/modules/firebase/types.d.ts.map +1 -0
- package/lib/modules/firebase/types.js +15 -0
- package/lib/modules/graphql-types/index.d.ts +1998 -0
- package/lib/modules/graphql-types/index.d.ts.map +1 -0
- package/lib/modules/graphql-types/index.js +442 -0
- package/lib/modules/graphql-types/journeyplanner-types_v3.generated.d.ts +2419 -0
- package/lib/modules/graphql-types/journeyplanner-types_v3.generated.d.ts.map +1 -0
- package/lib/modules/graphql-types/journeyplanner-types_v3.generated.js +524 -0
- package/lib/modules/logging/index.d.ts +6 -0
- package/lib/modules/logging/index.d.ts.map +1 -0
- package/lib/modules/logging/index.js +13 -0
- package/lib/modules/logging/log-api-response.d.ts +15 -0
- package/lib/modules/logging/log-api-response.d.ts.map +1 -0
- package/lib/modules/logging/log-api-response.js +52 -0
- package/lib/modules/logging/log-page-access.d.ts +20 -0
- package/lib/modules/logging/log-page-access.d.ts.map +1 -0
- package/lib/modules/logging/log-page-access.js +60 -0
- package/lib/modules/logging/logger.d.ts +3 -0
- package/lib/modules/logging/logger.d.ts.map +1 -0
- package/lib/modules/logging/logger.js +32 -0
- package/lib/modules/logging/timer.d.ts +6 -0
- package/lib/modules/logging/timer.d.ts.map +1 -0
- package/lib/modules/logging/timer.js +13 -0
- package/lib/modules/logging/with-access-logging.d.ts +5 -0
- package/lib/modules/logging/with-access-logging.d.ts.map +1 -0
- package/lib/modules/logging/with-access-logging.js +20 -0
- package/lib/modules/org-data/compat-layer.d.ts +8 -0
- package/lib/modules/org-data/compat-layer.d.ts.map +1 -0
- package/lib/modules/org-data/compat-layer.js +8 -0
- package/lib/modules/org-data/index.d.ts +12 -0
- package/lib/modules/org-data/index.d.ts.map +1 -0
- package/lib/modules/org-data/index.js +27 -0
- package/lib/modules/theme/index.d.ts +3 -0
- package/lib/modules/theme/index.d.ts.map +1 -0
- package/lib/modules/theme/index.js +9 -0
- package/lib/modules/theme/theme-context.d.ts +43 -0
- package/lib/modules/theme/theme-context.d.ts.map +1 -0
- package/lib/modules/theme/theme-context.js +73 -0
- package/lib/modules/transport-mode/filter/filter.d.ts +9 -0
- package/lib/modules/transport-mode/filter/filter.d.ts.map +1 -0
- package/lib/modules/transport-mode/filter/filter.js +64 -0
- package/lib/modules/transport-mode/filter/filter.module.css +98 -0
- package/lib/modules/transport-mode/filter/index.d.ts +3 -0
- package/lib/modules/transport-mode/filter/index.d.ts.map +1 -0
- package/lib/modules/transport-mode/filter/index.js +11 -0
- package/lib/modules/transport-mode/filter/types.d.ts +2 -0
- package/lib/modules/transport-mode/filter/types.d.ts.map +1 -0
- package/lib/modules/transport-mode/filter/types.js +2 -0
- package/lib/modules/transport-mode/filter/utils.d.ts +9 -0
- package/lib/modules/transport-mode/filter/utils.d.ts.map +1 -0
- package/lib/modules/transport-mode/filter/utils.js +21 -0
- package/lib/modules/transport-mode/icon/icon.module.css +33 -0
- package/lib/modules/transport-mode/icon/index.d.ts +29 -0
- package/lib/modules/transport-mode/icon/index.d.ts.map +1 -0
- package/lib/modules/transport-mode/icon/index.js +116 -0
- package/lib/modules/transport-mode/icon/transport-icon-new.d.ts +28 -0
- package/lib/modules/transport-mode/icon/transport-icon-new.d.ts.map +1 -0
- package/lib/modules/transport-mode/icon/transport-icon-new.js +114 -0
- package/lib/modules/transport-mode/index.d.ts +5 -0
- package/lib/modules/transport-mode/index.d.ts.map +1 -0
- package/lib/modules/transport-mode/index.js +29 -0
- package/lib/modules/transport-mode/types.d.ts +10 -0
- package/lib/modules/transport-mode/types.d.ts.map +1 -0
- package/lib/modules/transport-mode/types.js +141 -0
- package/lib/modules/transport-mode/utils.d.ts +9 -0
- package/lib/modules/transport-mode/utils.d.ts.map +1 -0
- package/lib/modules/transport-mode/utils.js +53 -0
- package/lib/refund/events.d.ts +32 -0
- package/lib/refund/events.d.ts.map +1 -0
- package/lib/refund/events.js +5 -0
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts +10 -0
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -0
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +37 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts +11 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +133 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts +11 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -0
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +133 -0
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts +12 -0
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -0
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +82 -0
- package/lib/refund/forms/refund-ticket/index.d.ts +10 -0
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -0
- package/lib/refund/forms/refund-ticket/index.js +38 -0
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts +11 -0
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -0
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +109 -0
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts +2 -0
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -0
- package/lib/refund/forms/residualValueOnTravelCard/index.js +19 -0
- package/lib/refund/index.d.ts +3 -0
- package/lib/refund/index.d.ts.map +1 -0
- package/lib/refund/index.js +50 -0
- package/lib/refund/refundFormMachine.d.ts +406 -0
- package/lib/refund/refundFormMachine.d.ts.map +1 -0
- package/lib/refund/refundFormMachine.js +404 -0
- package/lib/server/contact/index.d.ts +11 -0
- package/lib/server/contact/index.d.ts.map +1 -0
- package/lib/server/contact/index.js +47 -0
- package/lib/server/index.d.ts +9 -0
- package/lib/server/index.d.ts.map +1 -0
- package/lib/server/index.js +14 -0
- package/lib/server/journey-planner/authority.d.ts +26 -0
- package/lib/server/journey-planner/authority.d.ts.map +1 -0
- package/lib/server/journey-planner/authority.js +48 -0
- package/lib/server/journey-planner/entur-client.d.ts +7 -0
- package/lib/server/journey-planner/entur-client.d.ts.map +1 -0
- package/lib/server/journey-planner/entur-client.js +46 -0
- package/lib/server/journey-planner/index.d.ts +11 -0
- package/lib/server/journey-planner/index.d.ts.map +1 -0
- package/lib/server/journey-planner/index.js +63 -0
- package/lib/server/journey-planner/journey-gql/lines.generated.d.ts +25 -0
- package/lib/server/journey-planner/journey-gql/lines.generated.d.ts.map +1 -0
- package/lib/server/journey-planner/journey-gql/lines.generated.js +30 -0
- package/lib/server/journey-planner/validators.d.ts +25 -0
- package/lib/server/journey-planner/validators.d.ts.map +1 -0
- package/lib/server/journey-planner/validators.js +17 -0
- package/lib/server/types.d.ts +5 -0
- package/lib/server/types.d.ts.map +1 -0
- package/lib/server/types.js +2 -0
- package/lib/success-content/success-content.d.ts +2 -0
- package/lib/success-content/success-content.d.ts.map +1 -0
- package/lib/success-content/success-content.js +19 -0
- package/lib/success-content/success-content.module.css +11 -0
- package/lib/ticket-control/events.d.ts +16 -0
- package/lib/ticket-control/events.d.ts.map +1 -0
- package/lib/ticket-control/events.js +5 -0
- package/lib/ticket-control/forms/feeComplaintForm.d.ts +11 -0
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -0
- package/lib/ticket-control/forms/feeComplaintForm.js +130 -0
- package/lib/ticket-control/forms/feedbackForm.d.ts +11 -0
- package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -0
- package/lib/ticket-control/forms/feedbackForm.js +75 -0
- package/lib/ticket-control/forms/postponePayment.d.ts +11 -0
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -0
- package/lib/ticket-control/forms/postponePayment.js +37 -0
- package/lib/ticket-control/index.d.ts +3 -0
- package/lib/ticket-control/index.d.ts.map +1 -0
- package/lib/ticket-control/index.js +53 -0
- package/lib/ticket-control/ticket-control-form-machine.d.ts +277 -0
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -0
- package/lib/ticket-control/ticket-control-form-machine.js +262 -0
- package/lib/ticketing/events.d.ts +28 -0
- package/lib/ticketing/events.d.ts.map +1 -0
- package/lib/ticketing/events.js +5 -0
- package/lib/ticketing/forms/app/appAccountForm.d.ts +11 -0
- package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -0
- package/lib/ticketing/forms/app/appAccountForm.js +51 -0
- package/lib/ticketing/forms/app/appTicketingForm.d.ts +11 -0
- package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -0
- package/lib/ticketing/forms/app/appTicketingForm.js +59 -0
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts +11 -0
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -0
- package/lib/ticketing/forms/app/appTravelSuggestionForm.js +41 -0
- package/lib/ticketing/forms/app/index.d.ts +10 -0
- package/lib/ticketing/forms/app/index.d.ts.map +1 -0
- package/lib/ticketing/forms/app/index.js +23 -0
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts +11 -0
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -0
- package/lib/ticketing/forms/priceAndTicketTypesForm.js +41 -0
- package/lib/ticketing/forms/travel-card/index.d.ts +10 -0
- package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -0
- package/lib/ticketing/forms/travel-card/index.js +24 -0
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts +3 -0
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -0
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +21 -0
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts +11 -0
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -0
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +52 -0
- package/lib/ticketing/forms/webshop/index.d.ts +10 -0
- package/lib/ticketing/forms/webshop/index.d.ts.map +1 -0
- package/lib/ticketing/forms/webshop/index.js +22 -0
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts +11 -0
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -0
- package/lib/ticketing/forms/webshop/webshopAccountForm.js +51 -0
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts +11 -0
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -0
- package/lib/ticketing/forms/webshop/webshopTicketingForm.js +58 -0
- package/lib/ticketing/index.d.ts +3 -0
- package/lib/ticketing/index.d.ts.map +1 -0
- package/lib/ticketing/index.js +52 -0
- package/lib/ticketing/ticketingStateMachine.d.ts +438 -0
- package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -0
- package/lib/ticketing/ticketingStateMachine.js +435 -0
- package/lib/translations/__tests__/utils.test.d.ts +2 -0
- package/lib/translations/__tests__/utils.test.d.ts.map +1 -0
- package/lib/translations/__tests__/utils.test.js +35 -0
- package/lib/translations/common/index.d.ts +3 -0
- package/lib/translations/common/index.d.ts.map +1 -0
- package/lib/translations/common/index.js +7 -0
- package/lib/translations/common/layout.d.ts +8 -0
- package/lib/translations/common/layout.d.ts.map +1 -0
- package/lib/translations/common/layout.js +39 -0
- package/lib/translations/common/titles.d.ts +4 -0
- package/lib/translations/common/titles.d.ts.map +1 -0
- package/lib/translations/common/titles.js +25 -0
- package/lib/translations/commons.d.ts +21 -0
- package/lib/translations/commons.d.ts.map +1 -0
- package/lib/translations/commons.js +39 -0
- package/lib/translations/components/clear-button.d.ts +4 -0
- package/lib/translations/components/clear-button.d.ts.map +1 -0
- package/lib/translations/components/clear-button.js +7 -0
- package/lib/translations/components/departure-date-selector.d.ts +8 -0
- package/lib/translations/components/departure-date-selector.d.ts.map +1 -0
- package/lib/translations/components/departure-date-selector.js +11 -0
- package/lib/translations/components/departure-time.d.ts +8 -0
- package/lib/translations/components/departure-time.d.ts.map +1 -0
- package/lib/translations/components/departure-time.js +11 -0
- package/lib/translations/components/empty-search.d.ts +18 -0
- package/lib/translations/components/empty-search.d.ts.map +1 -0
- package/lib/translations/components/empty-search.js +21 -0
- package/lib/translations/components/geolocation-button.d.ts +10 -0
- package/lib/translations/components/geolocation-button.d.ts.map +1 -0
- package/lib/translations/components/geolocation-button.js +13 -0
- package/lib/translations/components/index.d.ts +14 -0
- package/lib/translations/components/index.d.ts.map +1 -0
- package/lib/translations/components/index.js +29 -0
- package/lib/translations/components/loading.d.ts +4 -0
- package/lib/translations/components/loading.d.ts.map +1 -0
- package/lib/translations/components/loading.js +7 -0
- package/lib/translations/components/map.d.ts +19 -0
- package/lib/translations/components/map.d.ts.map +1 -0
- package/lib/translations/components/map.js +22 -0
- package/lib/translations/components/search.d.ts +9 -0
- package/lib/translations/components/search.d.ts.map +1 -0
- package/lib/translations/components/search.js +12 -0
- package/lib/translations/components/swap-button.d.ts +4 -0
- package/lib/translations/components/swap-button.d.ts.map +1 -0
- package/lib/translations/components/swap-button.js +7 -0
- package/lib/translations/components/tab-link.d.ts +5 -0
- package/lib/translations/components/tab-link.d.ts.map +1 -0
- package/lib/translations/components/tab-link.js +8 -0
- package/lib/translations/components/transport-mode-filter.d.ts +6 -0
- package/lib/translations/components/transport-mode-filter.d.ts.map +1 -0
- package/lib/translations/components/transport-mode-filter.js +9 -0
- package/lib/translations/components/transport-mode.d.ts +3 -0
- package/lib/translations/components/transport-mode.d.ts.map +1 -0
- package/lib/translations/components/transport-mode.js +28 -0
- package/lib/translations/components/venue-icon.d.ts +9 -0
- package/lib/translations/components/venue-icon.d.ts.map +1 -0
- package/lib/translations/components/venue-icon.js +12 -0
- package/lib/translations/dictionary.d.ts +33 -0
- package/lib/translations/dictionary.d.ts.map +1 -0
- package/lib/translations/dictionary.js +59 -0
- package/lib/translations/index.d.ts +16 -0
- package/lib/translations/index.d.ts.map +1 -0
- package/lib/translations/index.js +65 -0
- package/lib/translations/json-to-override.d.ts +19 -0
- package/lib/translations/json-to-override.d.ts.map +1 -0
- package/lib/translations/json-to-override.js +61 -0
- package/lib/translations/language-context.d.ts +37 -0
- package/lib/translations/language-context.d.ts.map +1 -0
- package/lib/translations/language-context.js +98 -0
- package/lib/translations/load-org-translations.d.ts +19 -0
- package/lib/translations/load-org-translations.d.ts.map +1 -0
- package/lib/translations/load-org-translations.js +23 -0
- package/lib/translations/merge-overrides.d.ts +28 -0
- package/lib/translations/merge-overrides.d.ts.map +1 -0
- package/lib/translations/merge-overrides.js +126 -0
- package/lib/translations/modules/index.d.ts +4 -0
- package/lib/translations/modules/index.d.ts.map +1 -0
- package/lib/translations/modules/index.js +9 -0
- package/lib/translations/modules/layout.d.ts +73 -0
- package/lib/translations/modules/layout.d.ts.map +1 -0
- package/lib/translations/modules/layout.js +106 -0
- package/lib/translations/modules/search-time.d.ts +8 -0
- package/lib/translations/modules/search-time.d.ts.map +1 -0
- package/lib/translations/modules/search-time.js +11 -0
- package/lib/translations/modules/situation.d.ts +8 -0
- package/lib/translations/modules/situation.d.ts.map +1 -0
- package/lib/translations/modules/situation.js +11 -0
- package/lib/translations/pages/assistant.d.ts +2 -0
- package/lib/translations/pages/assistant.d.ts.map +1 -0
- package/lib/translations/pages/assistant.js +303 -0
- package/lib/translations/pages/contact.d.ts +589 -0
- package/lib/translations/pages/contact.d.ts.map +1 -0
- package/lib/translations/pages/contact.js +679 -0
- package/lib/translations/pages/departures.d.ts +64 -0
- package/lib/translations/pages/departures.d.ts.map +1 -0
- package/lib/translations/pages/departures.js +75 -0
- package/lib/translations/pages/error.d.ts +8 -0
- package/lib/translations/pages/error.d.ts.map +1 -0
- package/lib/translations/pages/error.js +11 -0
- package/lib/translations/pages/index.d.ts +4 -0
- package/lib/translations/pages/index.d.ts.map +1 -0
- package/lib/translations/pages/index.js +9 -0
- package/lib/translations/server/endpoints.d.ts +67 -0
- package/lib/translations/server/endpoints.d.ts.map +1 -0
- package/lib/translations/server/endpoints.js +146 -0
- package/lib/translations/server/index.d.ts +2 -0
- package/lib/translations/server/index.d.ts.map +1 -0
- package/lib/translations/server/index.js +5 -0
- package/lib/translations/translations-context.d.ts +10 -0
- package/lib/translations/translations-context.d.ts.map +1 -0
- package/lib/translations/translations-context.js +20 -0
- package/lib/translations/types.d.ts +41 -0
- package/lib/translations/types.d.ts.map +1 -0
- package/lib/translations/types.js +24 -0
- package/lib/translations/utils.d.ts +16 -0
- package/lib/translations/utils.d.ts.map +1 -0
- package/lib/translations/utils.js +56 -0
- package/lib/types/submit-payloads.d.ts +119 -0
- package/lib/types/submit-payloads.d.ts.map +1 -0
- package/lib/types/submit-payloads.js +7 -0
- package/lib/types.d.ts +20 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +12 -0
- package/lib/utils/color.d.ts +2 -0
- package/lib/utils/color.d.ts.map +1 -0
- package/lib/utils/color.js +50 -0
- package/lib/utils/css.d.ts +3 -0
- package/lib/utils/css.d.ts.map +1 -0
- package/lib/utils/css.js +15 -0
- package/lib/utils/date.d.ts +4 -0
- package/lib/utils/date.d.ts.map +1 -0
- package/lib/utils/date.js +21 -0
- package/lib/utils/enum-from-string.d.ts +4 -0
- package/lib/utils/enum-from-string.d.ts.map +1 -0
- package/lib/utils/enum-from-string.js +9 -0
- package/lib/utils/env.d.ts +10 -0
- package/lib/utils/env.d.ts.map +1 -0
- package/lib/utils/env.js +49 -0
- package/lib/utils/only-uniques.d.ts +3 -0
- package/lib/utils/only-uniques.d.ts.map +1 -0
- package/lib/utils/only-uniques.js +7 -0
- package/lib/utils/org-theme-definitions.d.ts +5 -0
- package/lib/utils/org-theme-definitions.d.ts.map +1 -0
- package/lib/utils/org-theme-definitions.js +13 -0
- package/lib/utils/presence.d.ts +2 -0
- package/lib/utils/presence.d.ts.map +1 -0
- package/lib/utils/presence.js +5 -0
- package/lib/utils/reference-data.d.ts +15 -0
- package/lib/utils/reference-data.d.ts.map +1 -0
- package/lib/utils/reference-data.js +15 -0
- package/lib/utils/use-client-width.d.ts +2 -0
- package/lib/utils/use-client-width.d.ts.map +1 -0
- package/lib/utils/use-client-width.js +18 -0
- package/lib/utils/use-debounce.d.ts +3 -0
- package/lib/utils/use-debounce.d.ts.map +1 -0
- package/lib/utils/use-debounce.js +14 -0
- package/lib/utils/use-interval.d.ts +2 -0
- package/lib/utils/use-interval.d.ts.map +1 -0
- package/lib/utils/use-interval.js +22 -0
- package/lib/utils/use-localstorage.d.ts +2 -0
- package/lib/utils/use-localstorage.d.ts.map +1 -0
- package/lib/utils/use-localstorage.js +40 -0
- package/lib/utils/use-now.d.ts +2 -0
- package/lib/utils/use-now.d.ts.map +1 -0
- package/lib/utils/use-now.js +13 -0
- package/lib/utils/user-media-query.d.ts +2 -0
- package/lib/utils/user-media-query.d.ts.map +1 -0
- package/lib/utils/user-media-query.js +36 -0
- package/lib/utils.d.ts +19 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +126 -0
- package/lib/validation/commonInputValidator.d.ts +7 -0
- package/lib/validation/commonInputValidator.d.ts.map +1 -0
- package/lib/validation/commonInputValidator.js +28 -0
- package/lib/validation/index.d.ts +2 -0
- package/lib/validation/index.d.ts.map +1 -0
- package/lib/validation/index.js +8 -0
- package/lib/validation/validationRules.d.ts +11 -0
- package/lib/validation/validationRules.d.ts.map +1 -0
- package/lib/validation/validationRules.js +372 -0
- package/package.json +99 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration types for the contact-form package.
|
|
3
|
+
* These types define the contract between the package and consuming applications.
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { ContactFormTranslationsOverride } from "../../translations/types";
|
|
7
|
+
/**
|
|
8
|
+
* Icon component type - consumers provide components that render icons
|
|
9
|
+
*/
|
|
10
|
+
export type IconComponent = (props: {
|
|
11
|
+
size?: 'small' | 'normal' | 'large';
|
|
12
|
+
className?: string;
|
|
13
|
+
role?: string;
|
|
14
|
+
alt?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}) => React.ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* Icon names used throughout the contact form
|
|
19
|
+
*/
|
|
20
|
+
export type IconName = 'transportation/BusFill' | 'transportation/TramFill' | 'transportation/TrainFill' | 'transportation/WalkFill' | 'transportation/BicycleFill' | 'transportation/PlaneFill' | 'transportation/BoatFill' | 'transportation/FerryFill' | 'transportation/MetroFill' | 'transportation/UnknownFill' | 'actions/Close' | 'actions/Clear' | 'actions/Add' | 'status/CheckmarkFill' | 'status/ErrorFill';
|
|
21
|
+
/**
|
|
22
|
+
* Icon set that consumers must provide
|
|
23
|
+
*/
|
|
24
|
+
export type IconSet = {
|
|
25
|
+
[key in IconName]: IconComponent;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Color object used for theming
|
|
29
|
+
*/
|
|
30
|
+
export type ContrastColor = {
|
|
31
|
+
background: string;
|
|
32
|
+
foreground: {
|
|
33
|
+
primary: string;
|
|
34
|
+
secondary?: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Transport mode colors
|
|
39
|
+
*/
|
|
40
|
+
export type TransportColors = {
|
|
41
|
+
city: {
|
|
42
|
+
primary: ContrastColor;
|
|
43
|
+
};
|
|
44
|
+
region: {
|
|
45
|
+
primary: ContrastColor;
|
|
46
|
+
};
|
|
47
|
+
train: {
|
|
48
|
+
primary: ContrastColor;
|
|
49
|
+
};
|
|
50
|
+
boat: {
|
|
51
|
+
primary: ContrastColor;
|
|
52
|
+
};
|
|
53
|
+
bike: {
|
|
54
|
+
primary: ContrastColor;
|
|
55
|
+
};
|
|
56
|
+
airportExpress: {
|
|
57
|
+
primary: ContrastColor;
|
|
58
|
+
};
|
|
59
|
+
flexible: {
|
|
60
|
+
primary: ContrastColor;
|
|
61
|
+
};
|
|
62
|
+
other: {
|
|
63
|
+
primary: ContrastColor;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Interactive state colors
|
|
68
|
+
*/
|
|
69
|
+
export type InteractiveColor = {
|
|
70
|
+
default: ContrastColor;
|
|
71
|
+
hover?: ContrastColor;
|
|
72
|
+
active?: ContrastColor;
|
|
73
|
+
disabled?: ContrastColor;
|
|
74
|
+
};
|
|
75
|
+
export type InteractiveState = 'default' | 'hover' | 'active' | 'disabled';
|
|
76
|
+
/**
|
|
77
|
+
* Status colors
|
|
78
|
+
*/
|
|
79
|
+
export type StatusColors = {
|
|
80
|
+
valid: {
|
|
81
|
+
primary: ContrastColor;
|
|
82
|
+
};
|
|
83
|
+
info: {
|
|
84
|
+
primary: ContrastColor;
|
|
85
|
+
};
|
|
86
|
+
warning: {
|
|
87
|
+
primary: ContrastColor;
|
|
88
|
+
};
|
|
89
|
+
error: {
|
|
90
|
+
primary: ContrastColor;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Background colors for different surfaces
|
|
95
|
+
*/
|
|
96
|
+
export type BackgroundColors = {
|
|
97
|
+
neutral: {
|
|
98
|
+
0: ContrastColor;
|
|
99
|
+
1: ContrastColor;
|
|
100
|
+
2: ContrastColor;
|
|
101
|
+
3: ContrastColor;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Complete theme object
|
|
106
|
+
*/
|
|
107
|
+
export type Theme = {
|
|
108
|
+
light: ThemeColors;
|
|
109
|
+
dark: ThemeColors;
|
|
110
|
+
};
|
|
111
|
+
export type ThemeColors = {
|
|
112
|
+
color: {
|
|
113
|
+
transport: TransportColors;
|
|
114
|
+
status: StatusColors;
|
|
115
|
+
background: BackgroundColors;
|
|
116
|
+
interactive: {
|
|
117
|
+
primary: InteractiveColor;
|
|
118
|
+
secondary: InteractiveColor;
|
|
119
|
+
destructive: InteractiveColor;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
spacer: {
|
|
123
|
+
small: string;
|
|
124
|
+
medium: string;
|
|
125
|
+
large: string;
|
|
126
|
+
xLarge: string;
|
|
127
|
+
};
|
|
128
|
+
border: {
|
|
129
|
+
radius: {
|
|
130
|
+
small: string;
|
|
131
|
+
regular: string;
|
|
132
|
+
circle: string;
|
|
133
|
+
};
|
|
134
|
+
width: {
|
|
135
|
+
slim: string;
|
|
136
|
+
medium: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
export type TextColorType = 'light' | 'dark';
|
|
141
|
+
/**
|
|
142
|
+
* Typography configuration
|
|
143
|
+
*/
|
|
144
|
+
export type TypographyConfig = {
|
|
145
|
+
fontFamily?: string;
|
|
146
|
+
textTypes?: {
|
|
147
|
+
heading__title?: string;
|
|
148
|
+
heading__component?: string;
|
|
149
|
+
body__primary?: string;
|
|
150
|
+
body__secondary?: string;
|
|
151
|
+
body__xs?: string;
|
|
152
|
+
label__uppercase?: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Form schema names that identify different form types.
|
|
157
|
+
* Consumers can use this to route submissions to different endpoints or handle them differently.
|
|
158
|
+
*/
|
|
159
|
+
export type FormSchemaName = 'ticketControl' | 'refund' | 'meansOfTransport' | 'ticketing' | 'journeyInfo';
|
|
160
|
+
/**
|
|
161
|
+
* API configuration
|
|
162
|
+
*/
|
|
163
|
+
export type ApiConfig = {
|
|
164
|
+
baseUrl: string;
|
|
165
|
+
endpoints: {
|
|
166
|
+
submitForm: string;
|
|
167
|
+
uploadFile?: string;
|
|
168
|
+
lines?: string;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Submit callback that receives the schema name and form state.
|
|
172
|
+
* Consumers can use the schema name to route to different endpoints or handle submissions differently.
|
|
173
|
+
*
|
|
174
|
+
* @param schemaName - The form schema identifier ('ticketControl' | 'refund' | 'meansOfTransport' | 'ticketing' | 'journeyInfo')
|
|
175
|
+
* @param state - The form data as a record of field values
|
|
176
|
+
* @returns Promise<Response> - The fetch Response from the submission
|
|
177
|
+
*/
|
|
178
|
+
onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Organization/branding configuration
|
|
182
|
+
*/
|
|
183
|
+
export type OrgConfig = {
|
|
184
|
+
name: string;
|
|
185
|
+
supportEmail: string;
|
|
186
|
+
authorityId?: string;
|
|
187
|
+
logo?: {
|
|
188
|
+
src: string;
|
|
189
|
+
srcDark?: string;
|
|
190
|
+
alt: string;
|
|
191
|
+
/** Override for header/footer (accent bar). When set, used instead of src/srcDark. Default: srcDark ?? src (light variant on dark bar). */
|
|
192
|
+
accentBar?: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
/** Label type for layout links - compatible with TranslatedString */
|
|
196
|
+
export type LayoutLinkLabel = Record<string, string>;
|
|
197
|
+
/**
|
|
198
|
+
* Layout configuration for container, back link, and footer URLs.
|
|
199
|
+
* Optional; hosts can override via ContactFormContainer slots.
|
|
200
|
+
*/
|
|
201
|
+
export type LayoutConfig = {
|
|
202
|
+
basePath?: string;
|
|
203
|
+
backLinkDefault?: {
|
|
204
|
+
href: string;
|
|
205
|
+
label: LayoutLinkLabel;
|
|
206
|
+
};
|
|
207
|
+
footerUrls?: {
|
|
208
|
+
privacy?: string;
|
|
209
|
+
accessibility?: string;
|
|
210
|
+
help?: string;
|
|
211
|
+
tickets?: string;
|
|
212
|
+
homePage?: {
|
|
213
|
+
href: string;
|
|
214
|
+
name: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Override header links. When set, header renders exactly these links (order and count).
|
|
219
|
+
* When not set, uses standard behavior (single optional home link from footerUrls.homePage).
|
|
220
|
+
* Empty array = no header links.
|
|
221
|
+
*/
|
|
222
|
+
headerLinksOverride?: Array<{
|
|
223
|
+
href: string;
|
|
224
|
+
label: LayoutLinkLabel;
|
|
225
|
+
}>;
|
|
226
|
+
/**
|
|
227
|
+
* Override footer links. When set, footer link area renders this list (order and count).
|
|
228
|
+
* When not set, uses standard behavior (tickets, help, privacy, accessibility from footerUrls).
|
|
229
|
+
* Optional section can group links if footer UI supports it.
|
|
230
|
+
* Empty array = no footer links.
|
|
231
|
+
*/
|
|
232
|
+
footerLinksOverride?: Array<{
|
|
233
|
+
href: string;
|
|
234
|
+
label: LayoutLinkLabel;
|
|
235
|
+
section?: string;
|
|
236
|
+
}>;
|
|
237
|
+
/**
|
|
238
|
+
* Path for success page after form submission.
|
|
239
|
+
* Default: basePath ? `${basePath}/success` : '/contact/success'
|
|
240
|
+
*/
|
|
241
|
+
successPath?: string;
|
|
242
|
+
/**
|
|
243
|
+
* Path for error page when form submission fails.
|
|
244
|
+
* Default: basePath ? `${basePath}/error` : '/contact/error'
|
|
245
|
+
*/
|
|
246
|
+
errorPath?: string;
|
|
247
|
+
/**
|
|
248
|
+
* Override success page content. When set, host provides custom UI instead of default SuccessContent.
|
|
249
|
+
*/
|
|
250
|
+
successContent?: React.ReactNode;
|
|
251
|
+
/**
|
|
252
|
+
* Override error page content. When set, host provides custom UI instead of default ErrorContent.
|
|
253
|
+
*/
|
|
254
|
+
errorContent?: React.ReactNode;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Override configuration for contact pages (tabs).
|
|
258
|
+
* Standard pages are defined in the package; overrides allow hiding or marking as external.
|
|
259
|
+
*/
|
|
260
|
+
export type PagesOverrides = {
|
|
261
|
+
/**
|
|
262
|
+
* Page IDs to hide from the tab navigation.
|
|
263
|
+
* Page IDs match the href slugs (e.g. 'lost-property', 'refund').
|
|
264
|
+
*/
|
|
265
|
+
hidePageIds?: string[];
|
|
266
|
+
/**
|
|
267
|
+
* Map of page IDs to external URLs.
|
|
268
|
+
* When a page ID has an external URL, it should render an external link experience instead of the form.
|
|
269
|
+
*/
|
|
270
|
+
externalUrlByPageId?: Record<string, string>;
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Form schema overrides for XState-driven form flows.
|
|
274
|
+
* Each area can specify which form types/categories are enabled (all others are hidden).
|
|
275
|
+
* When an area is omitted, all options for that area are enabled (standard behavior).
|
|
276
|
+
*/
|
|
277
|
+
export type FormSchemaOverrides = {
|
|
278
|
+
ticketControl?: {
|
|
279
|
+
enabledFormTypes?: string[];
|
|
280
|
+
};
|
|
281
|
+
meansOfTransport?: {
|
|
282
|
+
enabledFormTypes?: string[];
|
|
283
|
+
};
|
|
284
|
+
refund?: {
|
|
285
|
+
enabledFormCategories?: string[];
|
|
286
|
+
};
|
|
287
|
+
ticketing?: {
|
|
288
|
+
enabledFormCategories?: string[];
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Main configuration object for the contact form
|
|
293
|
+
*/
|
|
294
|
+
export type ContactFormConfig = {
|
|
295
|
+
/** Theme configuration (light/dark variants) */
|
|
296
|
+
theme: Theme;
|
|
297
|
+
/**
|
|
298
|
+
* Optional theme overrides that will be merged on top of the base theme.
|
|
299
|
+
* This is intended for small brand tweaks without having to rebuild the
|
|
300
|
+
* full theme from @atb-as/theme.
|
|
301
|
+
*/
|
|
302
|
+
themeOverrides?: DeepPartial<Theme>;
|
|
303
|
+
/** Icon set for all icons used in the form */
|
|
304
|
+
icons: IconSet;
|
|
305
|
+
/** Typography configuration */
|
|
306
|
+
typography?: TypographyConfig;
|
|
307
|
+
/** API endpoints for form submission */
|
|
308
|
+
api: ApiConfig;
|
|
309
|
+
/** Organization/branding information */
|
|
310
|
+
org: OrgConfig;
|
|
311
|
+
/** Feature flags */
|
|
312
|
+
features?: {
|
|
313
|
+
enableDarkMode?: boolean;
|
|
314
|
+
enableFileUploads?: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Include ferry as a transport mode option.
|
|
317
|
+
* Default: true (ferry included).
|
|
318
|
+
* When false, ferry is excluded from transport mode dropdowns and Entur/lines queries.
|
|
319
|
+
*/
|
|
320
|
+
includeFerry?: boolean;
|
|
321
|
+
};
|
|
322
|
+
/** Optional layout config: basePath, backLinkDefault, footerUrls */
|
|
323
|
+
layout?: LayoutConfig;
|
|
324
|
+
/**
|
|
325
|
+
* Translations for all text used in the contact form.
|
|
326
|
+
* Host app must provide all translations - there are no defaults in the package.
|
|
327
|
+
*/
|
|
328
|
+
translations: ContactFormTranslationsOverride;
|
|
329
|
+
/**
|
|
330
|
+
* Override which contact pages (tabs) are shown and whether they link externally.
|
|
331
|
+
* When not set, all standard pages are shown and all are internal (form-based).
|
|
332
|
+
*/
|
|
333
|
+
pagesOverrides?: PagesOverrides;
|
|
334
|
+
/**
|
|
335
|
+
* Override which form options are available in each XState-driven form flow.
|
|
336
|
+
* Can be loaded from a JSON/YAML/TAML file by the host and passed here.
|
|
337
|
+
* When not set, all form types/categories are available (standard behavior).
|
|
338
|
+
*/
|
|
339
|
+
formSchemaOverrides?: FormSchemaOverrides;
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Utility type to represent a deeply partial structure.
|
|
343
|
+
* Used for themeOverrides.
|
|
344
|
+
*/
|
|
345
|
+
export type DeepPartial<T> = {
|
|
346
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
347
|
+
};
|
|
348
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAC,+BAA+B,EAAC,MAAM,0BAA0B,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B,KAAK,KAAK,CAAC,YAAY,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,QAAQ,GACd,wBAAwB,GACxB,yBAAyB,GACzB,0BAA0B,GAC1B,yBAAyB,GACzB,4BAA4B,GAC5B,0BAA0B,GAC1B,yBAAyB,GACzB,0BAA0B,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AC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/cookies/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,oBAAoB,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DARKMODE_COOKIE_NAME = exports.LANGUAGE_COOKIE_NAME = exports.SETTINGS_STORETIME_DAYS = void 0;
|
|
4
|
+
exports.SETTINGS_STORETIME_DAYS = 60;
|
|
5
|
+
exports.LANGUAGE_COOKIE_NAME = 'selectedLanguage';
|
|
6
|
+
exports.DARKMODE_COOKIE_NAME = 'dark-mode-enabled';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
export type AppCookiesContextState = {
|
|
3
|
+
darkmode: [boolean | undefined, (val: boolean) => void];
|
|
4
|
+
language: [string | undefined, (val: string) => void];
|
|
5
|
+
};
|
|
6
|
+
export type InitialCookieData = {
|
|
7
|
+
darkmode: boolean | null;
|
|
8
|
+
language: string | null;
|
|
9
|
+
};
|
|
10
|
+
export type AppCookiesProviderProps = PropsWithChildren<{
|
|
11
|
+
initialCookies: InitialCookieData;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function AppCookiesProvider({ children, initialCookies, }: AppCookiesProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function useCookieSettings(): AppCookiesContextState | undefined;
|
|
15
|
+
export declare function useDarkmodeCookie(): [boolean | undefined, (val: boolean) => void];
|
|
16
|
+
export declare function useLanguageCookie(): [string | undefined, (val: string) => void];
|
|
17
|
+
//# sourceMappingURL=cookies-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookies-context.d.ts","sourceRoot":"","sources":["../../../src/modules/cookies/cookies-context.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAMvB,MAAM,OAAO,CAAC;AAQf,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,CAAC,OAAO,GAAG,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC;CACvD,CAAC;AAMF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD,cAAc,EAAE,iBAAiB,CAAC;CACnC,CAAC,CAAC;AAEH,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,cAAc,GACf,EAAE,uBAAuB,2CAiBzB;AAED,wBAAgB,iBAAiB,uCAGhC;AACD,wBAAgB,iBAAiB,gCA3CO,OAAO,KAAK,IAAI,EA8CvD;AACD,wBAAgB,iBAAiB,+BA9CM,MAAM,KAAK,IAAI,EAiDrD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppCookiesProvider = AppCookiesProvider;
|
|
4
|
+
exports.useCookieSettings = useCookieSettings;
|
|
5
|
+
exports.useDarkmodeCookie = useDarkmodeCookie;
|
|
6
|
+
exports.useLanguageCookie = useLanguageCookie;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const cookies_next_1 = require("cookies-next");
|
|
9
|
+
const date_fns_1 = require("date-fns");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const constants_1 = require("./constants");
|
|
12
|
+
const CookiesContext = (0, react_1.createContext)(undefined);
|
|
13
|
+
function AppCookiesProvider({ children, initialCookies, }) {
|
|
14
|
+
const language = useCookie(constants_1.LANGUAGE_COOKIE_NAME, initialCookies.language ?? undefined, (i) => String(i ?? ''));
|
|
15
|
+
const darkmode = useCookie(constants_1.DARKMODE_COOKIE_NAME, initialCookies.darkmode ?? undefined, (i) => (typeof i === 'string' ? i === 'true' : i === true));
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(CookiesContext.Provider, { value: { language, darkmode }, children: children }));
|
|
17
|
+
}
|
|
18
|
+
function useCookieSettings() {
|
|
19
|
+
const context = (0, react_1.useContext)(CookiesContext);
|
|
20
|
+
return context;
|
|
21
|
+
}
|
|
22
|
+
function useDarkmodeCookie() {
|
|
23
|
+
const ctx = useCookieSettings();
|
|
24
|
+
return ctx?.darkmode ?? [undefined, () => { }];
|
|
25
|
+
}
|
|
26
|
+
function useLanguageCookie() {
|
|
27
|
+
const ctx = useCookieSettings();
|
|
28
|
+
return ctx?.language ?? [undefined, () => { }];
|
|
29
|
+
}
|
|
30
|
+
function useCookie(key, initialValue, mapper) {
|
|
31
|
+
const [storedValue, setStoredValue] = (0, react_1.useState)(initialValue);
|
|
32
|
+
(0, react_1.useEffect)(() => {
|
|
33
|
+
async function getData() {
|
|
34
|
+
try {
|
|
35
|
+
const data = await (0, cookies_next_1.getCookie)(key);
|
|
36
|
+
if (typeof data !== 'undefined') {
|
|
37
|
+
setStoredValue(mapper(data));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
console.warn('Failed to load cookie:', key, e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
getData();
|
|
45
|
+
}, [key, mapper]);
|
|
46
|
+
const setValue = (0, react_1.useCallback)((value) => {
|
|
47
|
+
try {
|
|
48
|
+
setStoredValue(value);
|
|
49
|
+
if (typeof window !== 'undefined') {
|
|
50
|
+
(0, cookies_next_1.setCookie)(key, value, {
|
|
51
|
+
expires: (0, date_fns_1.addDays)(new Date(), constants_1.SETTINGS_STORETIME_DAYS),
|
|
52
|
+
path: '/',
|
|
53
|
+
sameSite: 'lax',
|
|
54
|
+
secure: process.env.NEXT_PUBLIC_COOKIE_SECURE === 'true',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (error) { }
|
|
59
|
+
}, [key]);
|
|
60
|
+
return [storedValue, setValue];
|
|
61
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IncomingHttpHeaders } from 'http';
|
|
2
|
+
import { NextApiRequestCookies } from 'next/dist/server/api-utils';
|
|
3
|
+
import { InitialCookieData } from './cookies-context';
|
|
4
|
+
export { AppCookiesProvider, useCookieSettings, useDarkmodeCookie, useLanguageCookie, } from './cookies-context';
|
|
5
|
+
export type { InitialCookieData };
|
|
6
|
+
export type GlobalCookiesData = {
|
|
7
|
+
initialCookies: InitialCookieData;
|
|
8
|
+
headersAcceptLanguage: string;
|
|
9
|
+
referer: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function getGlobalCookies(req?: {
|
|
12
|
+
cookies: NextApiRequestCookies;
|
|
13
|
+
headers: IncomingHttpHeaders;
|
|
14
|
+
}): GlobalCookiesData;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/cookies/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,iBAAiB,CAAC;IAClC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE;IACrC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,OAAO,EAAE,mBAAmB,CAAC;CAC9B,GAAG,iBAAiB,CAYpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLanguageCookie = exports.useDarkmodeCookie = exports.useCookieSettings = exports.AppCookiesProvider = void 0;
|
|
4
|
+
exports.getGlobalCookies = getGlobalCookies;
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
var cookies_context_1 = require("./cookies-context");
|
|
7
|
+
Object.defineProperty(exports, "AppCookiesProvider", { enumerable: true, get: function () { return cookies_context_1.AppCookiesProvider; } });
|
|
8
|
+
Object.defineProperty(exports, "useCookieSettings", { enumerable: true, get: function () { return cookies_context_1.useCookieSettings; } });
|
|
9
|
+
Object.defineProperty(exports, "useDarkmodeCookie", { enumerable: true, get: function () { return cookies_context_1.useDarkmodeCookie; } });
|
|
10
|
+
Object.defineProperty(exports, "useLanguageCookie", { enumerable: true, get: function () { return cookies_context_1.useLanguageCookie; } });
|
|
11
|
+
function getGlobalCookies(req) {
|
|
12
|
+
return {
|
|
13
|
+
initialCookies: {
|
|
14
|
+
darkmode: typeof req?.cookies[constants_1.DARKMODE_COOKIE_NAME] === 'undefined'
|
|
15
|
+
? null
|
|
16
|
+
: req.cookies[constants_1.DARKMODE_COOKIE_NAME] == 'true',
|
|
17
|
+
language: req?.cookies[constants_1.LANGUAGE_COOKIE_NAME] ?? null,
|
|
18
|
+
},
|
|
19
|
+
headersAcceptLanguage: req?.headers['accept-language'] ?? '',
|
|
20
|
+
referer: req?.headers.referer ?? '',
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/modules/firebase/analytics.ts"],"names":[],"mappings":"AAQA,wBAAsB,IAAI,kBAqBzB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EACD,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,gBAAgB,QAYrB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.init = init;
|
|
7
|
+
exports.logSpecificEvent = logSpecificEvent;
|
|
8
|
+
const analytics_1 = require("firebase/analytics");
|
|
9
|
+
const firebase_1 = __importDefault(require("./firebase"));
|
|
10
|
+
async function init() {
|
|
11
|
+
if (!(await (0, analytics_1.isSupported)())) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// Default all consents to denied.
|
|
15
|
+
(0, analytics_1.setConsent)({
|
|
16
|
+
ad_storage: 'denied',
|
|
17
|
+
ad_personalization: 'denied',
|
|
18
|
+
ad_user_data: 'denied',
|
|
19
|
+
functionality_storage: 'denied',
|
|
20
|
+
security_storage: 'denied',
|
|
21
|
+
personalization_storage: 'denied',
|
|
22
|
+
analytics_storage: 'denied',
|
|
23
|
+
});
|
|
24
|
+
// Initialize Firebase
|
|
25
|
+
const analytics = (0, analytics_1.getAnalytics)(firebase_1.default);
|
|
26
|
+
// Disable automatic data collection.
|
|
27
|
+
analytics.app.automaticDataCollectionEnabled = false;
|
|
28
|
+
}
|
|
29
|
+
function logSpecificEvent(event) {
|
|
30
|
+
if (!(0, analytics_1.isSupported)()) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const analytics = (0, analytics_1.getAnalytics)(firebase_1.default);
|
|
35
|
+
(0, analytics_1.logEvent)(analytics, event, {});
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
// ignore, fire and forget
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firebase.d.ts","sourceRoot":"","sources":["../../../src/modules/firebase/firebase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAoB3C,QAAA,MAAM,GAAG,EAAE,WAAmE,CAAC;AAE/E,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const app_1 = require("firebase/app");
|
|
4
|
+
if (!process.env.NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY ||
|
|
5
|
+
!process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN ||
|
|
6
|
+
!process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID ||
|
|
7
|
+
!process.env.NEXT_PUBLIC_FIREBASE_APP_ID) {
|
|
8
|
+
throw new Error('Missing required Firebase environment variables');
|
|
9
|
+
}
|
|
10
|
+
const firebaseConfig = {
|
|
11
|
+
apiKey: process.env.NEXT_PUBLIC_FIREBASE_PUBLIC_API_KEY,
|
|
12
|
+
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
|
|
13
|
+
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
|
|
14
|
+
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
|
|
15
|
+
measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID, // optional
|
|
16
|
+
};
|
|
17
|
+
const apps = (0, app_1.getApps)();
|
|
18
|
+
const app = apps.length ? apps[0] : (0, app_1.initializeApp)(firebaseConfig);
|
|
19
|
+
exports.default = app;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/firebase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.getPreassignedFareProducts = exports.getTariffZones = exports.logSpecificEvent = exports.init = void 0;
|
|
18
|
+
var analytics_1 = require("./analytics");
|
|
19
|
+
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return analytics_1.init; } });
|
|
20
|
+
Object.defineProperty(exports, "logSpecificEvent", { enumerable: true, get: function () { return analytics_1.logSpecificEvent; } });
|
|
21
|
+
var tariff_zones_1 = require("./tariff-zones");
|
|
22
|
+
Object.defineProperty(exports, "getTariffZones", { enumerable: true, get: function () { return tariff_zones_1.getTariffZones; } });
|
|
23
|
+
var preassigned_fare_products_1 = require("./preassigned-fare-products");
|
|
24
|
+
Object.defineProperty(exports, "getPreassignedFareProducts", { enumerable: true, get: function () { return preassigned_fare_products_1.getPreassignedFareProducts; } });
|
|
25
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type PreassignedFareProduct as PreassignedFareProductType } from '@atb-as/config-specs';
|
|
2
|
+
/**
|
|
3
|
+
* NB! This retrieves preassignedFareProducts_v2 directly from firestore instead of via sales svc.
|
|
4
|
+
* Be aware - future use cases may require going through sales svc.
|
|
5
|
+
* Any personalised tickets such as HjemJobbHjem need to go throug sales svc.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getPreassignedFareProducts(): Promise<PreassignedFareProductType[]>;
|
|
8
|
+
//# sourceMappingURL=preassigned-fare-products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preassigned-fare-products.d.ts","sourceRoot":"","sources":["../../../src/modules/firebase/preassigned-fare-products.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,sBAAsB,IAAI,0BAA0B,EAE1D,MAAM,sBAAsB,CAAC;AAG9B;;;;GAIG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CACzD,0BAA0B,EAAE,CAC7B,CAuBA"}
|