@duffel/components 3.1.3--prototype.4 → 3.1.3--prototype.7
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/{react-dist/custom-elements.js → custom-elements.js} +2 -2
- package/{react-dist/custom-elements.js.map → custom-elements.js.map} +1 -1
- package/{react-dist/index.js → index.js} +2 -2
- package/{react-dist/index.js.map → index.js.map} +1 -1
- package/package.json +3 -3
- package/scripts/generate-fixture.d.ts +3 -0
- package/scripts/setup-suggestion-data.d.ts +28 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/.circleci/config.yml +0 -67
- package/.eslintrc.js +0 -47
- package/.github/CODEOWNERS +0 -4
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -29
- package/.github/renovate.json +0 -12
- package/.nvmrc +0 -1
- package/.prettierignore +0 -6
- package/.storybook/main.ts +0 -33
- package/.storybook/preview.tsx +0 -28
- package/.tool-versions +0 -1
- package/.vscode/extensions.json +0 -7
- package/.vscode/settings.json +0 -10
- package/.yarn/releases/yarn-4.0.1.cjs +0 -893
- package/.yarn/sdks/eslint/bin/eslint.js +0 -20
- package/.yarn/sdks/eslint/lib/api.js +0 -20
- package/.yarn/sdks/eslint/lib/unsupported-api.js +0 -20
- package/.yarn/sdks/eslint/package.json +0 -14
- package/.yarn/sdks/integrations.yml +0 -5
- package/.yarn/sdks/prettier/bin-prettier.js +0 -20
- package/.yarn/sdks/prettier/index.js +0 -20
- package/.yarn/sdks/prettier/package.json +0 -7
- package/.yarn/sdks/typescript/bin/tsc +0 -20
- package/.yarn/sdks/typescript/bin/tsserver +0 -20
- package/.yarn/sdks/typescript/lib/tsc.js +0 -20
- package/.yarn/sdks/typescript/lib/tsserver.js +0 -225
- package/.yarn/sdks/typescript/lib/tsserverlibrary.js +0 -225
- package/.yarn/sdks/typescript/lib/typescript.js +0 -20
- package/.yarn/sdks/typescript/package.json +0 -10
- package/.yarnrc.yml +0 -3
- package/CONTRIBUTING.md +0 -83
- package/README.md +0 -68
- package/__mocks__/styleMock.js +0 -6
- package/babel.config.js +0 -20
- package/commitlint.config.js +0 -4
- package/config/esbuild.base.config.js +0 -18
- package/config/esbuild.cdn.config.js +0 -51
- package/config/esbuild.dev.config.js +0 -46
- package/config/esbuild.react.config.js +0 -42
- package/data/airports.csv +0 -9084
- package/data/cities.csv +0 -256
- package/jest.config.ts +0 -14
- package/scripts/build-and-publish.sh +0 -42
- package/scripts/generate-fixture.ts +0 -200
- package/scripts/setup-suggestion-data.ts +0 -100
- package/scripts/upload-to-cdn.sh +0 -34
- package/scripts.tsconfig.json +0 -11
- package/src/components/DuffelAncillaries/Card.tsx +0 -126
- package/src/components/DuffelAncillaries/Counter.tsx +0 -40
- package/src/components/DuffelAncillaries/DuffelAncillaries.tsx +0 -350
- package/src/components/DuffelAncillaries/DuffelAncillariesCustomElement.tsx +0 -124
- package/src/components/DuffelAncillaries/bags/BaggageSelectionCard.tsx +0 -101
- package/src/components/DuffelAncillaries/bags/BaggageSelectionController.tsx +0 -88
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModal.tsx +0 -81
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBody.tsx +0 -60
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.tsx +0 -122
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.tsx +0 -88
- package/src/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.tsx +0 -82
- package/src/components/DuffelAncillaries/bags/IncludedBaggageBanner.tsx +0 -51
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.tsx +0 -90
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.tsx +0 -63
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.tsx +0 -56
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.tsx +0 -11
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.tsx +0 -74
- package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.tsx +0 -9
- package/src/components/DuffelAncillaries/seats/Amenity.tsx +0 -21
- package/src/components/DuffelAncillaries/seats/DeckSelect.tsx +0 -27
- package/src/components/DuffelAncillaries/seats/Element.tsx +0 -52
- package/src/components/DuffelAncillaries/seats/EmptyElement.tsx +0 -5
- package/src/components/DuffelAncillaries/seats/ExitElement.tsx +0 -17
- package/src/components/DuffelAncillaries/seats/Legend.tsx +0 -60
- package/src/components/DuffelAncillaries/seats/Row.tsx +0 -47
- package/src/components/DuffelAncillaries/seats/RowSection.tsx +0 -78
- package/src/components/DuffelAncillaries/seats/SeatElement.tsx +0 -120
- package/src/components/DuffelAncillaries/seats/SeatInfo.tsx +0 -32
- package/src/components/DuffelAncillaries/seats/SeatMap.tsx +0 -85
- package/src/components/DuffelAncillaries/seats/SeatMapUnavailable.tsx +0 -21
- package/src/components/DuffelAncillaries/seats/SeatSelectionCard.tsx +0 -103
- package/src/components/DuffelAncillaries/seats/SeatSelectionModal.tsx +0 -142
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalBody.tsx +0 -13
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalFooter.tsx +0 -89
- package/src/components/DuffelAncillaries/seats/SeatSelectionModalHeader.tsx +0 -97
- package/src/components/DuffelAncillaries/seats/SeatUnavailable.tsx +0 -14
- package/src/components/DuffelPayments/DuffelPayments.tsx +0 -224
- package/src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx +0 -130
- package/src/components/PlacesLookup/PlacesLookup.tsx +0 -122
- package/src/components/shared/AnimatedLoaderEllipsis.tsx +0 -5
- package/src/components/shared/Button.tsx +0 -63
- package/src/components/shared/ErrorBoundary.tsx +0 -54
- package/src/components/shared/FetchOfferErrorState.tsx +0 -35
- package/src/components/shared/Icon.tsx +0 -151
- package/src/components/shared/IconButton.tsx +0 -42
- package/src/components/shared/Modal.tsx +0 -40
- package/src/components/shared/NonIdealState.tsx +0 -28
- package/src/components/shared/Stamp.tsx +0 -29
- package/src/components/shared/Tabs.tsx +0 -36
- package/src/custom-elements.ts +0 -13
- package/src/examples/client-side/README.md +0 -30
- package/src/examples/client-side/index.html +0 -57
- package/src/examples/full-stack/README.md +0 -34
- package/src/examples/full-stack/index.html +0 -48
- package/src/examples/full-stack/server.mjs +0 -158
- package/src/examples/just-typescript/.yarn/install-state.gz +0 -0
- package/src/examples/just-typescript/README.md +0 -37
- package/src/examples/just-typescript/package.json +0 -16
- package/src/examples/just-typescript/src/index.html +0 -23
- package/src/examples/just-typescript/src/index.ts +0 -36
- package/src/examples/just-typescript/yarn.lock +0 -467
- package/src/examples/next/README.md +0 -28
- package/src/examples/next/next-env.d.ts +0 -5
- package/src/examples/next/next.config.js +0 -4
- package/src/examples/next/package.json +0 -24
- package/src/examples/next/src/app/DuffelComponents.tsx +0 -40
- package/src/examples/next/src/app/layout.tsx +0 -18
- package/src/examples/next/src/app/page.tsx +0 -9
- package/src/examples/next/tsconfig.json +0 -27
- package/src/examples/next/yarn.lock +0 -257
- package/src/examples/payments-custom-element/README.md +0 -17
- package/src/examples/payments-custom-element/index.html +0 -43
- package/src/examples/payments-just-typescript/README.md +0 -37
- package/src/examples/payments-just-typescript/package.json +0 -16
- package/src/examples/payments-just-typescript/src/index.html +0 -23
- package/src/examples/payments-just-typescript/src/index.ts +0 -18
- package/src/examples/payments-just-typescript/yarn.lock +0 -154
- package/src/examples/react-app/README.md +0 -37
- package/src/examples/react-app/package.json +0 -20
- package/src/examples/react-app/src/index.html +0 -19
- package/src/examples/react-app/src/index.tsx +0 -48
- package/src/examples/react-app/yarn.lock +0 -219
- package/src/fixtures/offers/off_0000AUde3KwTztSRK1cznH.json +0 -497
- package/src/fixtures/offers/off_0000AVx4lUFFKW8PsPeQeQ.json +0 -307
- package/src/fixtures/offers/off_1.json +0 -488
- package/src/fixtures/passengers/mock_passengers.ts +0 -26
- package/src/fixtures/seat-maps/off_0000AUde3KwTztSRK1cznH.json +0 -6852
- package/src/fixtures/seat-maps/off_0000AVx4lUFFKW8PsPeQeQ.json +0 -1
- package/src/fixtures/seat-maps/off_1.json +0 -6852
- package/src/index.ts +0 -7
- package/src/lib/captureErrorInSentry.ts +0 -42
- package/src/lib/compileCreateOrderPayload.ts +0 -63
- package/src/lib/createPriceFormatters.ts +0 -73
- package/src/lib/fetchFromDuffelAPI.ts +0 -54
- package/src/lib/fetchFromFixtures.ts +0 -18
- package/src/lib/formatAvailableServices.ts +0 -91
- package/src/lib/formatDate.ts +0 -20
- package/src/lib/formatSeatMaps.ts +0 -81
- package/src/lib/getBaggageServiceDescription.ts +0 -39
- package/src/lib/getCabinsForSegmentAndDeck.ts +0 -4
- package/src/lib/getCurrencyForSeatMaps.ts +0 -22
- package/src/lib/getCurrencyForServices.ts +0 -24
- package/src/lib/getFirstSeatElementMatchingCriteria.ts +0 -22
- package/src/lib/getPassengerBySegmentList.ts +0 -10
- package/src/lib/getPassengerInitials.ts +0 -6
- package/src/lib/getPassengerMapById.ts +0 -17
- package/src/lib/getPassengerName.ts +0 -41
- package/src/lib/getRowNumber.ts +0 -16
- package/src/lib/getSegmentList.ts +0 -7
- package/src/lib/getServicePriceMapById.ts +0 -20
- package/src/lib/getSymbols.ts +0 -22
- package/src/lib/getTotalAmountForServices.ts +0 -72
- package/src/lib/getTotalQuantity.ts +0 -5
- package/src/lib/hasHighLuminance.ts +0 -9
- package/src/lib/hasService.ts +0 -24
- package/src/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.ts +0 -35
- package/src/lib/hasWings.ts +0 -8
- package/src/lib/isBaggageService.ts +0 -8
- package/src/lib/isCancelForAnyReasonService.ts +0 -9
- package/src/lib/isFixtureOfferId.ts +0 -4
- package/src/lib/isPayloadComplete.ts +0 -11
- package/src/lib/isSeatElement.ts +0 -10
- package/src/lib/logging.ts +0 -120
- package/src/lib/moneyStringFormatter.ts +0 -34
- package/src/lib/offerIsExpired.ts +0 -5
- package/src/lib/retrieveOffer.ts +0 -56
- package/src/lib/retrieveOfferFromDuffelAPI.ts +0 -13
- package/src/lib/retrieveSeatMaps.ts +0 -55
- package/src/lib/retrieveSeatMapsFromDuffelAPI.ts +0 -13
- package/src/lib/setBodyScrollability.ts +0 -7
- package/src/lib/validateProps.ts +0 -37
- package/src/lib/withPlural.ts +0 -8
- package/src/stories/BaggageSelectionModalHeader.stories.tsx +0 -21
- package/src/stories/Button.stories.tsx +0 -91
- package/src/stories/DuffelAncillaries.stories.tsx +0 -166
- package/src/stories/DuffelPayments.stories.tsx +0 -34
- package/src/stories/Icon.stories.tsx +0 -35
- package/src/stories/IconButton.stories.tsx +0 -25
- package/src/stories/PlacesLookup.stories.tsx +0 -22
- package/src/styles/colors.css +0 -22
- package/src/styles/components/Amenity.css +0 -23
- package/src/styles/components/BaggageDisplay.css +0 -25
- package/src/styles/components/Button.css +0 -169
- package/src/styles/components/Card.css +0 -52
- package/src/styles/components/CfarSelectionModal.css +0 -34
- package/src/styles/components/Counter.css +0 -18
- package/src/styles/components/DuffelPayments.css +0 -42
- package/src/styles/components/IconButton.css +0 -63
- package/src/styles/components/Legend.css +0 -62
- package/src/styles/components/Loader.css +0 -37
- package/src/styles/components/LoadingState.css +0 -87
- package/src/styles/components/Modal.css +0 -84
- package/src/styles/components/PassengerSelect.css +0 -99
- package/src/styles/components/PassengersLayout.css +0 -90
- package/src/styles/components/PlacesLookup.css +0 -36
- package/src/styles/components/Row.css +0 -70
- package/src/styles/components/Seat.css +0 -59
- package/src/styles/components/SeatInfo.css +0 -61
- package/src/styles/components/SeatMap.css +0 -24
- package/src/styles/components/SeatSelect.css +0 -92
- package/src/styles/components/Segment.css +0 -17
- package/src/styles/components/SelectionSegment.css +0 -10
- package/src/styles/components/Summary.css +0 -70
- package/src/styles/components/Tabs.css +0 -52
- package/src/styles/flex.css +0 -5
- package/src/styles/font-families.css +0 -47
- package/src/styles/global.css +0 -52
- package/src/styles/margin.css +0 -3
- package/src/styles/spacing.css +0 -18
- package/src/styles/transitions.css +0 -3
- package/src/styles/typography.css +0 -13
- package/src/tests/components/DuffelAncillaries.test.tsx +0 -342
- package/src/tests/lib/createPriceFormatters.test.tsx +0 -152
- package/src/tests/lib/formatAvailableServices.test.tsx +0 -79
- package/src/tests/lib/formatSeatMaps.test.tsx +0 -49
- package/src/tests/lib/getCurrencyForServices.test.tsx +0 -44
- package/src/tests/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.test.ts +0 -86
- package/src/tests/lib/logging.test.tsx +0 -32
- package/src/tests/lib/moneyStringFormatter.test.tsx +0 -12
- package/src/tests/lib/validateProps.test.tsx +0 -57
- package/src/types/Aircraft.ts +0 -16
- package/src/types/Airline.ts +0 -16
- package/src/types/Airport.ts +0 -54
- package/src/types/City.ts +0 -21
- package/src/types/CreateOrderPayload.ts +0 -99
- package/src/types/CurrencyConversion.ts +0 -10
- package/src/types/DuffelAncillariesProps.ts +0 -108
- package/src/types/Offer.ts +0 -851
- package/src/types/Order.ts +0 -6
- package/src/types/Place.ts +0 -6
- package/src/types/SeatMap.ts +0 -231
- package/src/types/index.ts +0 -11
- package/tsconfig.json +0 -58
- /package/{react-dist/components → components}/DuffelAncillaries/Card.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/Counter.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/DuffelAncillaries.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/bags/BaggageSelectionController.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/Amenity.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/DeckSelect.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/Element.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/EmptyElement.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/ExitElement.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/Legend.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/Row.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/RowSection.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatElement.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatInfo.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatMap.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatSelectionCard.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatSelectionModal.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelAncillaries/seats/SeatUnavailable.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelPayments/DuffelPayments.d.ts +0 -0
- /package/{react-dist/components → components}/DuffelPayments/DuffelPaymentsCustomElement.d.ts +0 -0
- /package/{react-dist/components → components}/PlacesLookup/PlacesLookup.d.ts +0 -0
- /package/{react-dist/components → components}/shared/AnimatedLoaderEllipsis.d.ts +0 -0
- /package/{react-dist/components → components}/shared/Button.d.ts +0 -0
- /package/{react-dist/components → components}/shared/ErrorBoundary.d.ts +0 -0
- /package/{react-dist/components → components}/shared/FetchOfferErrorState.d.ts +0 -0
- /package/{react-dist/components → components}/shared/Icon.d.ts +0 -0
- /package/{react-dist/components → components}/shared/IconButton.d.ts +0 -0
- /package/{react-dist/components → components}/shared/Modal.d.ts +0 -0
- /package/{react-dist/components → components}/shared/NonIdealState.d.ts +0 -0
- /package/{react-dist/components → components}/shared/Stamp.d.ts +0 -0
- /package/{react-dist/components → components}/shared/Tabs.d.ts +0 -0
- /package/{react-dist/custom-elements.d.ts → custom-elements.d.ts} +0 -0
- /package/{react-dist/index.d.ts → index.d.ts} +0 -0
- /package/{react-dist/lib → lib}/captureErrorInSentry.d.ts +0 -0
- /package/{react-dist/lib → lib}/compileCreateOrderPayload.d.ts +0 -0
- /package/{react-dist/lib → lib}/createPriceFormatters.d.ts +0 -0
- /package/{react-dist/lib → lib}/fetchFromDuffelAPI.d.ts +0 -0
- /package/{react-dist/lib → lib}/fetchFromFixtures.d.ts +0 -0
- /package/{react-dist/lib → lib}/formatAvailableServices.d.ts +0 -0
- /package/{react-dist/lib → lib}/formatDate.d.ts +0 -0
- /package/{react-dist/lib → lib}/formatSeatMaps.d.ts +0 -0
- /package/{react-dist/lib → lib}/getBaggageServiceDescription.d.ts +0 -0
- /package/{react-dist/lib → lib}/getCabinsForSegmentAndDeck.d.ts +0 -0
- /package/{react-dist/lib → lib}/getCurrencyForSeatMaps.d.ts +0 -0
- /package/{react-dist/lib → lib}/getCurrencyForServices.d.ts +0 -0
- /package/{react-dist/lib → lib}/getFirstSeatElementMatchingCriteria.d.ts +0 -0
- /package/{react-dist/lib → lib}/getPassengerBySegmentList.d.ts +0 -0
- /package/{react-dist/lib → lib}/getPassengerInitials.d.ts +0 -0
- /package/{react-dist/lib → lib}/getPassengerMapById.d.ts +0 -0
- /package/{react-dist/lib → lib}/getPassengerName.d.ts +0 -0
- /package/{react-dist/lib → lib}/getRowNumber.d.ts +0 -0
- /package/{react-dist/lib → lib}/getSegmentList.d.ts +0 -0
- /package/{react-dist/lib → lib}/getServicePriceMapById.d.ts +0 -0
- /package/{react-dist/lib → lib}/getSymbols.d.ts +0 -0
- /package/{react-dist/lib → lib}/getTotalAmountForServices.d.ts +0 -0
- /package/{react-dist/lib → lib}/getTotalQuantity.d.ts +0 -0
- /package/{react-dist/lib → lib}/hasHighLuminance.d.ts +0 -0
- /package/{react-dist/lib → lib}/hasService.d.ts +0 -0
- /package/{react-dist/lib → lib}/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +0 -0
- /package/{react-dist/lib → lib}/hasWings.d.ts +0 -0
- /package/{react-dist/lib → lib}/isBaggageService.d.ts +0 -0
- /package/{react-dist/lib → lib}/isCancelForAnyReasonService.d.ts +0 -0
- /package/{react-dist/lib → lib}/isFixtureOfferId.d.ts +0 -0
- /package/{react-dist/lib → lib}/isPayloadComplete.d.ts +0 -0
- /package/{react-dist/lib → lib}/isSeatElement.d.ts +0 -0
- /package/{react-dist/lib → lib}/logging.d.ts +0 -0
- /package/{react-dist/lib → lib}/moneyStringFormatter.d.ts +0 -0
- /package/{react-dist/lib → lib}/offerIsExpired.d.ts +0 -0
- /package/{react-dist/lib → lib}/retrieveOffer.d.ts +0 -0
- /package/{react-dist/lib → lib}/retrieveOfferFromDuffelAPI.d.ts +0 -0
- /package/{react-dist/lib → lib}/retrieveSeatMaps.d.ts +0 -0
- /package/{react-dist/lib → lib}/retrieveSeatMapsFromDuffelAPI.d.ts +0 -0
- /package/{react-dist/lib → lib}/setBodyScrollability.d.ts +0 -0
- /package/{react-dist/lib → lib}/validateProps.d.ts +0 -0
- /package/{react-dist/lib → lib}/withPlural.d.ts +0 -0
- /package/{react-dist/types → types}/Aircraft.d.ts +0 -0
- /package/{react-dist/types → types}/Airline.d.ts +0 -0
- /package/{react-dist/types → types}/Airport.d.ts +0 -0
- /package/{react-dist/types → types}/City.d.ts +0 -0
- /package/{react-dist/types → types}/CreateOrderPayload.d.ts +0 -0
- /package/{react-dist/types → types}/CurrencyConversion.d.ts +0 -0
- /package/{react-dist/types → types}/DuffelAncillariesProps.d.ts +0 -0
- /package/{react-dist/types → types}/Offer.d.ts +0 -0
- /package/{react-dist/types → types}/Order.d.ts +0 -0
- /package/{react-dist/types → types}/Place.d.ts +0 -0
- /package/{react-dist/types → types}/SeatMap.d.ts +0 -0
- /package/{react-dist/types → types}/index.d.ts +0 -0
package/.yarnrc.yml
DELETED
package/CONTRIBUTING.md
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
## Debug mode
|
|
2
|
-
|
|
3
|
-
The component takes a `debug` boolean prop. When enabled, debug output is logged to the console, with useful info like the props that were passed in. This is intended both for our internal use and for users integrating it.
|
|
4
|
-
|
|
5
|
-
Debug mode is enabled by default in all of this repository's local environments (e.g. Storybook).
|
|
6
|
-
|
|
7
|
-
Debug mode makes use of a logger, which selectively outputs to the console based on whether or not debug mode is enabled. When it makes sense, make use of the logger to output useful information. See `@lib/logging` for how to use it.
|
|
8
|
-
|
|
9
|
-
## How to upload new changes to our CDN
|
|
10
|
-
|
|
11
|
-
### Setup `gcloud`
|
|
12
|
-
|
|
13
|
-
Our CDN is [hosted on Google Cloud Platform](<https://console.cloud.google.com/storage/browser/duffel-assets/components/ancillaries?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&project=duffel-prod-fda1bc52&prefix=&forceOnObjectsSortingFiltering=false>). To upload new changes you'll need to have `gcloud` intalled and authenticate with GCP. You can do this by running `gcloud auth login` and following the instructions.
|
|
14
|
-
|
|
15
|
-
### Setup environment
|
|
16
|
-
|
|
17
|
-
Make sure you have an up-to-date version of `.env.build`:
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
# .env.build
|
|
21
|
-
|
|
22
|
-
# Include the base url for the Duffel API.
|
|
23
|
-
# This variable is here to give us the ability to build a dist version that points to a local environment.
|
|
24
|
-
# If no value is provided, the default `https://api.duffel.com` will be used.
|
|
25
|
-
DUFFEL_API_URL=https://api.duffel.com
|
|
26
|
-
|
|
27
|
-
# This is needed so the component knows the url base to use for its stylesheet
|
|
28
|
-
# This variable is here so we can release component versions that may point to local environments or bypass the cache.
|
|
29
|
-
# If no value is provided, the default `https://assets.duffel.com/ancillaries-component` will be used.
|
|
30
|
-
COMPONENT_CDN=https://assets.duffel.com/components
|
|
31
|
-
|
|
32
|
-
# The auth token is so we send data
|
|
33
|
-
# to sentry during the build.
|
|
34
|
-
# This is helpful when CI is
|
|
35
|
-
# building releases, locally not as much.
|
|
36
|
-
# You can get it here: https://duffel.sentry.io/settings/account/api/auth-tokens
|
|
37
|
-
SENTRY_AUTH_TOKEN=
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Upload to CDN
|
|
41
|
-
|
|
42
|
-
To upload the latest version of the component to the CDN, run:
|
|
43
|
-
|
|
44
|
-
```sh
|
|
45
|
-
yarn upload-to-cdn
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
This command will:
|
|
49
|
-
|
|
50
|
-
1. Build the component. the output will be in the `dist` folder.
|
|
51
|
-
|
|
52
|
-
2. Upload the build to the version folder on GCP storage.
|
|
53
|
-
|
|
54
|
-
- The build version is defined in [`package.json`](/package.json) under the `version` attribute.
|
|
55
|
-
- [You can find uploaded versions here](<https://console.cloud.google.com/storage/browser/duffel-assets/components/ancillaries?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&project=duffel-prod-fda1bc52&prefix=&forceOnObjectsSortingFiltering=false>)
|
|
56
|
-
- A version folder will be created if it doesn't exist.
|
|
57
|
-
- The version folder will be overwritten if it already exists.
|
|
58
|
-
|
|
59
|
-
3. Upload the sourcemaps for that version to Sentry
|
|
60
|
-
|
|
61
|
-
### Build component
|
|
62
|
-
|
|
63
|
-
#### Build for CDN upload
|
|
64
|
-
|
|
65
|
-
```sh
|
|
66
|
-
yarn cdn-build # Build will output to ./cdn-dist
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
You can see this build referenced on:
|
|
70
|
-
|
|
71
|
-
- `src/examples/client-side`
|
|
72
|
-
- `src/examples/full-stack`
|
|
73
|
-
|
|
74
|
-
#### Build for npm publishing
|
|
75
|
-
|
|
76
|
-
```sh
|
|
77
|
-
yarn react-build # Build will output to ./react-dist
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
You can see this build referenced on:
|
|
81
|
-
|
|
82
|
-
- `src/examples/react-app`
|
|
83
|
-
- `src/examples/just-typescript`
|
package/README.md
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# @duffel/components
|
|
2
|
-
|
|
3
|
-
This package is a component library to help you build your travel product using the [Duffel API](https://duffel.com/docs).
|
|
4
|
-
|
|
5
|
-
## Get started
|
|
6
|
-
|
|
7
|
-
### Installing
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
yarn add @duffel/components
|
|
11
|
-
# -- or --
|
|
12
|
-
npm i @duffel/components
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### (alternative) Load from CDN:
|
|
16
|
-
|
|
17
|
-
```html
|
|
18
|
-
<script src="https://assets.duffel.com/components/VERSION/duffel-ancillaries.js"></script>
|
|
19
|
-
<script src="https://assets.duffel.com/components/VERSION/duffel-payments.js"></script>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## How do I integrate this into my website?
|
|
23
|
-
|
|
24
|
-
1. Please start by reading our integration guide on https://duffel.com/docs/guides/ancillaries-component
|
|
25
|
-
|
|
26
|
-
## Integration examples
|
|
27
|
-
|
|
28
|
-
1. **client-side** | This example loads a local version of the components using a `script` tag. It uses a fixture for the offer and seat maps.
|
|
29
|
-
|
|
30
|
-
- [Find it on src/examples/client-side](src/examples/client-side)
|
|
31
|
-
|
|
32
|
-
2. **full-stack** | This example loads a local version of the components using a `script` tag. It will search and retrieve an offer from the Duffel API and render the ancillaries component custom element with its `offer_id` and `client_key`. As soon as a service modal is closed it will create a test order with the given payload.
|
|
33
|
-
|
|
34
|
-
- [Find it on src/examples/full-stack](src/examples/full-stack)
|
|
35
|
-
|
|
36
|
-
3. **just-typescript** | This example imports a local version of `@duffel/components` and renders the custom element with an offer fixture once the page loads.
|
|
37
|
-
|
|
38
|
-
- [Find it on src/examples/just-typescript](src/examples/just-typescript)
|
|
39
|
-
|
|
40
|
-
4. **react-app** | This example imports a local version of `@duffel/components` and renders the a react element with an offer fixture.
|
|
41
|
-
|
|
42
|
-
- [Find it on src/examples/react-app](src/examples/react-app)
|
|
43
|
-
|
|
44
|
-
5. **payments-custom-element** | This example demonstrates the use of the payments component loaded through a script tag
|
|
45
|
-
|
|
46
|
-
- [Find it on src/examples/payments-custom-element](src/examples/payments-custom-element)
|
|
47
|
-
|
|
48
|
-
6. **payments-just-typescript** | This example imports a local version of `@duffel/components` and renders the payments custom element with a fixture of the payment intent.
|
|
49
|
-
|
|
50
|
-
- [Find it on src/examples/payments-just-typescript](src/examples/payments-just-typescript)
|
|
51
|
-
|
|
52
|
-
7. **next** | This example imports and renders `@duffel/components` into a `next.js` project.
|
|
53
|
-
|
|
54
|
-
- [Find it on src/examples/payments-just-typescript](src/examples/next)
|
|
55
|
-
|
|
56
|
-
## What components are available?
|
|
57
|
-
|
|
58
|
-
### Ancillaries component
|
|
59
|
-
|
|
60
|
-
The ancillaries component allows your customers to add ancillaries to their order. It's simple to add to your website and can be customised to fit your brand. This component is avaiable through npm and our cdn.
|
|
61
|
-
|
|
62
|
-
- [Find live demo on codesandbox.io ↗](https://codesandbox.io/s/duffel-ancillaries-example-1nxuu7)
|
|
63
|
-
|
|
64
|
-
### Payments component
|
|
65
|
-
|
|
66
|
-
The payments component provides a [PCI-compliant](https://help.duffel.com/hc/en-gb/articles/4409049543058) way for you to collect card payments for online bookings from your customers. To learn more about how to work with Duffel payments please visit the [Collecting customer card payments guide](https://duffel.com/docs/guides/collecting-customer-card-payments).
|
|
67
|
-
|
|
68
|
-
#### more coming soon...
|
package/__mocks__/styleMock.js
DELETED
package/babel.config.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is used by Storybook and Jest.
|
|
3
|
-
*/
|
|
4
|
-
module.exports = {
|
|
5
|
-
sourceType: "unambiguous",
|
|
6
|
-
presets: [
|
|
7
|
-
[
|
|
8
|
-
"@babel/preset-env",
|
|
9
|
-
{
|
|
10
|
-
targets: {
|
|
11
|
-
chrome: 100,
|
|
12
|
-
node: "current",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
"@babel/preset-typescript",
|
|
17
|
-
["@babel/preset-react", { runtime: "automatic" }],
|
|
18
|
-
],
|
|
19
|
-
plugins: [],
|
|
20
|
-
};
|
package/commitlint.config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
entryPoints: [
|
|
3
|
-
{
|
|
4
|
-
out: "duffel-ancillaries",
|
|
5
|
-
in: "src/components/DuffelAncillaries/DuffelAncillariesCustomElement.tsx",
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
out: "duffel-payments",
|
|
9
|
-
in: "src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx",
|
|
10
|
-
},
|
|
11
|
-
{ out: "global", in: "src/styles/global.css" },
|
|
12
|
-
],
|
|
13
|
-
bundle: true,
|
|
14
|
-
minify: true,
|
|
15
|
-
sourcemap: true,
|
|
16
|
-
treeShaking: true,
|
|
17
|
-
outdir: "cdn-dist",
|
|
18
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
const { sentryEsbuildPlugin } = require("@sentry/esbuild-plugin");
|
|
3
|
-
const esbuild = require("esbuild");
|
|
4
|
-
const dotenv = require("dotenv");
|
|
5
|
-
const esbuildCopyStaticFiles = require("esbuild-copy-static-files");
|
|
6
|
-
|
|
7
|
-
dotenv.config({ path: ".env.build" });
|
|
8
|
-
if (process.env.SENTRY_AUTH_TOKEN === undefined) {
|
|
9
|
-
// eslint-disable-next-line
|
|
10
|
-
console.error(
|
|
11
|
-
"'process.env.SENTRY_AUTH_TOKEN' is required but missing." +
|
|
12
|
-
"Make sure it's included in your .env.build file."
|
|
13
|
-
);
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const VERSION = require("../package.json").version;
|
|
18
|
-
const envVariablesToDefine = {
|
|
19
|
-
"process.env.COMPONENT_VERSION": `"${VERSION}"`,
|
|
20
|
-
"process.env.DUFFEL_API_URL": `"${process.env.DUFFEL_API_URL}"`,
|
|
21
|
-
"process.env.COMPONENT_CDN": `"${
|
|
22
|
-
process.env.COMPONENT_CDN.startsWith("http://localhost:")
|
|
23
|
-
? process.env.COMPONENT_CDN
|
|
24
|
-
: `${process.env.COMPONENT_CDN}/${VERSION}`
|
|
25
|
-
}"`,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
esbuild
|
|
29
|
-
.build({
|
|
30
|
-
...require("./esbuild.base.config"),
|
|
31
|
-
define: envVariablesToDefine,
|
|
32
|
-
plugins: [
|
|
33
|
-
// Learn more on https://www.npmjs.com/package/@sentry/esbuild-plugin
|
|
34
|
-
sentryEsbuildPlugin({
|
|
35
|
-
org: "duffel",
|
|
36
|
-
project: "ancillaries-component",
|
|
37
|
-
// Specify the directory containing build artifacts
|
|
38
|
-
include: "./cdn-dist",
|
|
39
|
-
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
40
|
-
logLevel: "info",
|
|
41
|
-
release: VERSION,
|
|
42
|
-
}),
|
|
43
|
-
esbuildCopyStaticFiles({
|
|
44
|
-
src: "src/fixtures",
|
|
45
|
-
dest: "cdn-dist/fixtures",
|
|
46
|
-
dereference: true,
|
|
47
|
-
recursive: true,
|
|
48
|
-
}),
|
|
49
|
-
],
|
|
50
|
-
})
|
|
51
|
-
.catch(() => process.exit(1));
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
const esbuild = require("esbuild");
|
|
3
|
-
const dotenv = require("dotenv");
|
|
4
|
-
dotenv.config({ path: ".env.local" });
|
|
5
|
-
|
|
6
|
-
const DUFFEL_API_URL = process.env.DUFFEL_API_URL;
|
|
7
|
-
const VERSION = require("../package.json").version;
|
|
8
|
-
|
|
9
|
-
const COMPONENT_CDN = process.env.COMPONENT_CDN.startsWith("http://localhost:")
|
|
10
|
-
? process.env.COMPONENT_CDN
|
|
11
|
-
: `${process.env.COMPONENT_CDN}/${VERSION}`;
|
|
12
|
-
|
|
13
|
-
(async function () {
|
|
14
|
-
const esbuildContext = await esbuild.context({
|
|
15
|
-
...require("./esbuild.base.config"),
|
|
16
|
-
// The `define` config will replace the values in the code with the ones we scecify below.
|
|
17
|
-
// This is needed since the component will be used in the browser,
|
|
18
|
-
// where we don't have access to environment variables.
|
|
19
|
-
define: {
|
|
20
|
-
"process.env.COMPONENT_CDN": `"${COMPONENT_CDN}"`,
|
|
21
|
-
"process.env.DUFFEL_API_URL": `"${DUFFEL_API_URL}"`,
|
|
22
|
-
"process.env.COMPONENT_VERSION": `"${VERSION}"`,
|
|
23
|
-
},
|
|
24
|
-
plugins: [
|
|
25
|
-
// This plugin copies the offer and seat maps fixtures to the dist folder.
|
|
26
|
-
// When using the component with an offer id prefixed with `fixture_`
|
|
27
|
-
// the component will attempt to fetch it from the hosted folder.
|
|
28
|
-
require("esbuild-copy-static-files")({
|
|
29
|
-
src: "src/fixtures",
|
|
30
|
-
dest: "cdn-dist/fixtures",
|
|
31
|
-
dereference: true,
|
|
32
|
-
recursive: true,
|
|
33
|
-
}),
|
|
34
|
-
],
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
let { host, port } = await esbuildContext.serve({
|
|
38
|
-
host: "localhost",
|
|
39
|
-
servedir: "cdn-dist",
|
|
40
|
-
port: 8000,
|
|
41
|
-
});
|
|
42
|
-
await esbuildContext.watch();
|
|
43
|
-
|
|
44
|
-
// eslint-disable-next-line
|
|
45
|
-
console.log(`\n🐄 Serving component on http://${host}:${port}`);
|
|
46
|
-
})();
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
const esbuild = require("esbuild");
|
|
3
|
-
const dotenv = require("dotenv");
|
|
4
|
-
const { sentryEsbuildPlugin } = require("@sentry/esbuild-plugin");
|
|
5
|
-
|
|
6
|
-
dotenv.config({ path: ".env.build" });
|
|
7
|
-
|
|
8
|
-
const VERSION = require("../package.json").version;
|
|
9
|
-
const envVariablesToDefine = {
|
|
10
|
-
"process.env.COMPONENT_VERSION": `"${VERSION}"`,
|
|
11
|
-
"process.env.DUFFEL_API_URL": `"${process.env.DUFFEL_API_URL}"`,
|
|
12
|
-
"process.env.COMPONENT_CDN": `"${
|
|
13
|
-
process.env.COMPONENT_CDN.startsWith("http://localhost:")
|
|
14
|
-
? process.env.COMPONENT_CDN
|
|
15
|
-
: `${process.env.COMPONENT_CDN}/${VERSION}`
|
|
16
|
-
}"`,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// Builds for react environment
|
|
20
|
-
esbuild
|
|
21
|
-
.build({
|
|
22
|
-
define: envVariablesToDefine,
|
|
23
|
-
entryPoints: ["src/index.ts", "src/custom-elements.ts"],
|
|
24
|
-
bundle: true,
|
|
25
|
-
minify: true,
|
|
26
|
-
sourcemap: true,
|
|
27
|
-
outdir: "react-dist",
|
|
28
|
-
format: "cjs",
|
|
29
|
-
external: ["react", "react-dom"],
|
|
30
|
-
plugins: [
|
|
31
|
-
// Learn more on https://www.npmjs.com/package/@sentry/esbuild-plugin
|
|
32
|
-
sentryEsbuildPlugin({
|
|
33
|
-
org: "duffel",
|
|
34
|
-
project: "ancillaries-component",
|
|
35
|
-
include: `./react-dist`,
|
|
36
|
-
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
37
|
-
logLevel: "info",
|
|
38
|
-
release: VERSION,
|
|
39
|
-
}),
|
|
40
|
-
],
|
|
41
|
-
})
|
|
42
|
-
.catch(() => process.exit(1));
|