@duffel/components 3.0.0-canary → 3.0.0
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/.eslintrc.js +14 -1
- package/.github/workflows/release.yml +4 -1
- package/.storybook/__snapshots__/Storyshots.test.js.snap +185 -0
- package/CONTRIBUTING.md +83 -0
- package/README.md +34 -109
- package/config/esbuild.base.config.js +7 -3
- package/config/esbuild.cdn.config.js +4 -3
- package/config/esbuild.dev.config.js +4 -3
- package/config/esbuild.react.config.js +3 -3
- package/package.json +16 -5
- package/react-dist/components/{Card.d.ts → DuffelAncillaries/Card.d.ts} +1 -1
- package/react-dist/components/{DuffelAncillaries.d.ts → DuffelAncillaries/DuffelAncillaries.d.ts} +1 -1
- package/react-dist/components/{DuffelAncillariesCustomElement.d.ts → DuffelAncillaries/DuffelAncillariesCustomElement.d.ts} +1 -1
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionCard.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionController.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModal.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBody.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBodyPassenger.d.ts +2 -2
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalFooter.d.ts +1 -1
- package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalHeader.d.ts +1 -1
- package/react-dist/components/{bags → DuffelAncillaries/bags}/IncludedBaggageBanner.d.ts +1 -1
- package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionCard.d.ts +2 -2
- package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModal.d.ts +2 -2
- package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalBody.d.ts +1 -1
- package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalFooter.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/Amenity.d.ts +1 -1
- package/react-dist/components/{seats → DuffelAncillaries/seats}/Element.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/Legend.d.ts +1 -1
- package/react-dist/components/{seats → DuffelAncillaries/seats}/Row.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/RowSection.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatElement.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatInfo.d.ts +1 -1
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatMap.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionCard.d.ts +3 -3
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModal.d.ts +3 -3
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalFooter.d.ts +2 -2
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalHeader.d.ts +1 -1
- package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatUnavailable.d.ts +1 -1
- package/react-dist/components/DuffelPayments/DuffelPayments.d.ts +11 -0
- package/react-dist/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +14 -0
- package/react-dist/components/{Button.d.ts → shared/Button.d.ts} +2 -2
- package/react-dist/components/{ErrorBoundary.d.ts → shared/ErrorBoundary.d.ts} +1 -1
- package/react-dist/components/{IconButton.d.ts → shared/IconButton.d.ts} +1 -1
- package/react-dist/components/{NonIdealState.d.ts → shared/NonIdealState.d.ts} +1 -1
- package/react-dist/custom-elements.d.ts +6 -0
- package/react-dist/custom-elements.js +37 -0
- package/react-dist/custom-elements.js.map +7 -0
- package/react-dist/index.d.ts +4 -5
- package/react-dist/index.js +21 -20
- package/react-dist/index.js.map +4 -4
- package/react-dist/lib/captureErrorInSentry.d.ts +1 -1
- package/react-dist/lib/fetchFromDuffelAPI.d.ts +7 -0
- package/react-dist/lib/logging.d.ts +7 -14
- package/react-dist/lib/retrieveSeatMaps.d.ts +1 -1
- package/react-dist/types/DuffelAncillariesProps.d.ts +1 -1
- package/scripts/generate-fixture.ts +13 -8
- package/scripts/upload-to-cdn.sh +4 -9
- package/src/components/{Card.tsx → DuffelAncillaries/Card.tsx} +1 -1
- package/src/components/{Counter.tsx → DuffelAncillaries/Counter.tsx} +1 -1
- package/src/components/{DuffelAncillaries.tsx → DuffelAncillaries/DuffelAncillaries.tsx} +61 -63
- package/src/components/{DuffelAncillariesCustomElement.tsx → DuffelAncillaries/DuffelAncillariesCustomElement.tsx} +2 -2
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionCard.tsx +4 -4
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionController.tsx +2 -2
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModal.tsx +3 -3
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBody.tsx +3 -3
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBodyPassenger.tsx +2 -2
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalFooter.tsx +2 -2
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalHeader.tsx +1 -1
- package/src/components/{bags → DuffelAncillaries/bags}/IncludedBaggageBanner.tsx +1 -1
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionCard.tsx +4 -4
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModal.tsx +3 -3
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalBody.tsx +3 -3
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalBodyListItem.tsx +1 -1
- package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalFooter.tsx +4 -4
- package/src/components/{seats → DuffelAncillaries/seats}/Amenity.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/DeckSelect.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/Element.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/ExitElement.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/Legend.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/Row.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/RowSection.tsx +5 -2
- package/src/components/{seats → DuffelAncillaries/seats}/SeatElement.tsx +3 -3
- package/src/components/{seats → DuffelAncillaries/seats}/SeatInfo.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/SeatMap.tsx +2 -2
- package/src/components/{seats → DuffelAncillaries/seats}/SeatMapUnavailable.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionCard.tsx +5 -5
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModal.tsx +4 -4
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalBody.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalFooter.tsx +3 -3
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalHeader.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/SeatUnavailable.tsx +2 -2
- package/src/components/DuffelPayments/DuffelPayments.tsx +218 -0
- package/src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx +130 -0
- package/src/components/{Button.tsx → shared/Button.tsx} +4 -3
- package/src/components/{ErrorBoundary.tsx → shared/ErrorBoundary.tsx} +2 -2
- package/src/components/{Icon.tsx → shared/Icon.tsx} +2 -1
- package/src/components/{IconButton.tsx → shared/IconButton.tsx} +1 -1
- package/src/components/{Modal.tsx → shared/Modal.tsx} +5 -1
- package/src/components/{NonIdealState.tsx → shared/NonIdealState.tsx} +1 -1
- package/src/custom-elements.ts +13 -0
- package/src/examples/client-side/README.md +30 -0
- package/src/examples/client-side/index.html +1 -1
- package/src/examples/full-stack/README.md +34 -0
- package/src/examples/full-stack/index.html +1 -1
- package/src/examples/full-stack/server.mjs +1 -0
- package/src/examples/just-typescript/src/index.html +2 -2
- package/src/examples/just-typescript/src/index.ts +2 -1
- package/src/examples/payments-custom-element/README.md +17 -0
- package/src/examples/payments-custom-element/index.html +43 -0
- package/src/examples/payments-just-typescript/README.md +37 -0
- package/src/examples/payments-just-typescript/package.json +16 -0
- package/src/examples/payments-just-typescript/src/index.html +23 -0
- package/src/examples/payments-just-typescript/src/index.ts +18 -0
- package/src/examples/payments-just-typescript/yarn.lock +154 -0
- package/src/examples/react-app/src/index.tsx +11 -6
- package/src/index.ts +4 -5
- package/src/lib/captureErrorInSentry.ts +2 -20
- package/src/lib/fetchFromDuffelAPI.ts +36 -6
- package/src/lib/formatDate.ts +3 -4
- package/src/lib/getBaggageServiceDescription.ts +2 -4
- package/src/lib/getTotalAmountForServices.ts +1 -1
- package/src/lib/logging.ts +52 -32
- package/src/lib/retrieveOffer.ts +11 -6
- package/src/lib/retrieveSeatMaps.ts +13 -8
- package/src/stories/BaggageSelectionModalHeader.stories.tsx +1 -1
- package/src/stories/Button.stories.tsx +12 -3
- package/src/stories/DuffelAncillaries.stories.tsx +1 -1
- package/src/stories/DuffelPayments.stories.tsx +34 -0
- package/src/stories/Icon.stories.tsx +3 -2
- package/src/stories/IconButton.stories.tsx +1 -1
- package/src/styles/components/DuffelPayments.css +42 -0
- package/src/styles/components/Modal.css +2 -1
- package/src/styles/global.css +1 -0
- package/src/tests/components/DuffelAncillaries.test.tsx +1 -1
- package/src/tests/lib/createPriceFormatters.test.tsx +1 -1
- package/src/tests/lib/formatAvailableServices.test.tsx +1 -1
- package/src/tests/lib/formatSeatMaps.test.tsx +2 -2
- package/src/tests/lib/getCurrencyForServices.test.tsx +1 -1
- package/src/tests/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.test.ts +1 -1
- package/src/tests/lib/logging.test.tsx +14 -14
- package/src/tests/lib/moneyStringFormatter.test.tsx +1 -1
- package/src/tests/lib/validateProps.test.tsx +1 -1
- package/src/types/DuffelAncillariesProps.ts +1 -1
- package/tsconfig.json +1 -1
- /package/react-dist/components/{Counter.d.ts → DuffelAncillaries/Counter.d.ts} +0 -0
- /package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalBodyListItem.d.ts +0 -0
- /package/react-dist/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalHeader.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/DeckSelect.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/EmptyElement.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/ExitElement.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatMapUnavailable.d.ts +0 -0
- /package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalBody.d.ts +0 -0
- /package/react-dist/components/{AnimatedLoaderEllipsis.d.ts → shared/AnimatedLoaderEllipsis.d.ts} +0 -0
- /package/react-dist/components/{FetchOfferErrorState.d.ts → shared/FetchOfferErrorState.d.ts} +0 -0
- /package/react-dist/components/{Icon.d.ts → shared/Icon.d.ts} +0 -0
- /package/react-dist/components/{Modal.d.ts → shared/Modal.d.ts} +0 -0
- /package/react-dist/components/{Stamp.d.ts → shared/Stamp.d.ts} +0 -0
- /package/react-dist/components/{Tabs.d.ts → shared/Tabs.d.ts} +0 -0
- /package/src/components/{cancel_for_any_reason → DuffelAncillaries/cancel_for_any_reason}/CfarSelectionModalHeader.tsx +0 -0
- /package/src/components/{seats → DuffelAncillaries/seats}/EmptyElement.tsx +0 -0
- /package/src/components/{AnimatedLoaderEllipsis.tsx → shared/AnimatedLoaderEllipsis.tsx} +0 -0
- /package/src/components/{FetchOfferErrorState.tsx → shared/FetchOfferErrorState.tsx} +0 -0
- /package/src/components/{Stamp.tsx → shared/Stamp.tsx} +0 -0
- /package/src/components/{Tabs.tsx → shared/Tabs.tsx} +0 -0
|
@@ -27,7 +27,7 @@ const COMPONENT_CDN = process.env.COMPONENT_CDN.startsWith("http://localhost:")
|
|
|
27
27
|
// the component will attempt to fetch it from the hosted folder.
|
|
28
28
|
require("esbuild-copy-static-files")({
|
|
29
29
|
src: "src/fixtures",
|
|
30
|
-
dest: "dist/
|
|
30
|
+
dest: "cdn-dist/fixtures",
|
|
31
31
|
dereference: true,
|
|
32
32
|
recursive: true,
|
|
33
33
|
}),
|
|
@@ -36,10 +36,11 @@ const COMPONENT_CDN = process.env.COMPONENT_CDN.startsWith("http://localhost:")
|
|
|
36
36
|
|
|
37
37
|
let { host, port } = await esbuildContext.serve({
|
|
38
38
|
host: "localhost",
|
|
39
|
-
servedir: "dist",
|
|
39
|
+
servedir: "cdn-dist",
|
|
40
40
|
port: 8000,
|
|
41
41
|
});
|
|
42
|
+
await esbuildContext.watch();
|
|
42
43
|
|
|
44
|
+
// eslint-disable-next-line
|
|
43
45
|
console.log(`\n🐄 Serving component on http://${host}:${port}`);
|
|
44
|
-
await esbuildContext.watch();
|
|
45
46
|
})();
|
|
@@ -20,11 +20,11 @@ const envVariablesToDefine = {
|
|
|
20
20
|
esbuild
|
|
21
21
|
.build({
|
|
22
22
|
define: envVariablesToDefine,
|
|
23
|
-
entryPoints: ["src/index.ts"],
|
|
23
|
+
entryPoints: ["src/index.ts", "src/custom-elements.ts"],
|
|
24
24
|
bundle: true,
|
|
25
25
|
minify: true,
|
|
26
26
|
sourcemap: true,
|
|
27
|
-
|
|
27
|
+
outdir: "react-dist",
|
|
28
28
|
format: "cjs",
|
|
29
29
|
external: ["react", "react-dom"],
|
|
30
30
|
plugins: [
|
|
@@ -35,7 +35,7 @@ esbuild
|
|
|
35
35
|
include: `./react-dist`,
|
|
36
36
|
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
37
37
|
logLevel: "info",
|
|
38
|
-
release:
|
|
38
|
+
release: VERSION,
|
|
39
39
|
}),
|
|
40
40
|
],
|
|
41
41
|
})
|
package/package.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duffel/components",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "react-dist/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./react-dist/index.js",
|
|
9
|
+
"./custom-elements": "./react-dist/custom-elements.js"
|
|
10
|
+
},
|
|
11
|
+
"maintainers": [
|
|
12
|
+
{
|
|
13
|
+
"name": "Duffel",
|
|
14
|
+
"email": "hello@duffel.com",
|
|
15
|
+
"url": "https://duffel.com"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
7
18
|
"scripts": {
|
|
8
19
|
"precdn-build": "rm -rf ./cdn-dist",
|
|
9
20
|
"cdn-build": "node config/esbuild.cdn.config.js",
|
|
@@ -49,6 +60,8 @@
|
|
|
49
60
|
},
|
|
50
61
|
"dependencies": {
|
|
51
62
|
"@sentry/browser": "^7.43.0",
|
|
63
|
+
"@stripe/react-stripe-js": "^2.1.0",
|
|
64
|
+
"@stripe/stripe-js": "^1.54.0",
|
|
52
65
|
"classnames": "^2.3.2",
|
|
53
66
|
"react": "18.2.0",
|
|
54
67
|
"react-dom": "18.2.0"
|
|
@@ -130,7 +143,7 @@
|
|
|
130
143
|
"main"
|
|
131
144
|
]
|
|
132
145
|
},
|
|
133
|
-
"description": "
|
|
146
|
+
"description": "Component library to build your travel product with Duffel.",
|
|
134
147
|
"repository": {
|
|
135
148
|
"type": "git",
|
|
136
149
|
"url": "git+https://github.com/duffelhq/duffel-checkout.git"
|
|
@@ -139,12 +152,10 @@
|
|
|
139
152
|
"Duffel",
|
|
140
153
|
"ancillaries",
|
|
141
154
|
"seats",
|
|
142
|
-
"seat",
|
|
143
|
-
"map",
|
|
155
|
+
"seat maps",
|
|
144
156
|
"baggage",
|
|
145
157
|
"travel"
|
|
146
158
|
],
|
|
147
|
-
"author": "duffel.com",
|
|
148
159
|
"bugs": {
|
|
149
160
|
"url": "https://github.com/duffelhq/duffel-checkout/issues"
|
|
150
161
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DuffelAncillariesPropsWithClientKeyAndOfferId, DuffelAncillariesPropsWithOfferIdForFixture, DuffelAncillariesPropsWithOffersAndSeatMaps, DuffelAncillariesPropWithOfferAndClientKey, OnPayloadReady } from "
|
|
2
|
+
import { DuffelAncillariesPropsWithClientKeyAndOfferId, DuffelAncillariesPropsWithOfferIdForFixture, DuffelAncillariesPropsWithOffersAndSeatMaps, DuffelAncillariesPropWithOfferAndClientKey, OnPayloadReady } from "../../types/DuffelAncillariesProps";
|
|
3
3
|
declare global {
|
|
4
4
|
namespace JSX {
|
|
5
5
|
interface IntrinsicElements {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayload, CreateOrderPayloadServices } from "
|
|
3
|
-
import { Offer } from "
|
|
2
|
+
import { CreateOrderPayload, CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { Offer } from "../../../types/Offer";
|
|
4
4
|
export interface BaggageSelectionCardProps {
|
|
5
5
|
isLoading: boolean;
|
|
6
6
|
offer?: Offer;
|
package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionController.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayloadServices } from "
|
|
3
|
-
import { OfferAvailableServiceBaggage } from "
|
|
2
|
+
import { CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { OfferAvailableServiceBaggage } from "../../../types/Offer";
|
|
4
4
|
interface BaggageSelectionControllerProps {
|
|
5
5
|
segmentId: string;
|
|
6
6
|
passengerId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayload, CreateOrderPayloadServices } from "
|
|
3
|
-
import { Offer } from "
|
|
2
|
+
import { CreateOrderPayload, CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { Offer } from "../../../types/Offer";
|
|
4
4
|
export interface BaggageSelectionModalProps {
|
|
5
5
|
isOpen: boolean;
|
|
6
6
|
offer?: Offer;
|
package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBody.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayloadPassenger, CreateOrderPayloadServices } from "
|
|
3
|
-
import { Offer, OfferSliceSegment } from "
|
|
2
|
+
import { CreateOrderPayloadPassenger, CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { Offer, OfferSliceSegment } from "../../../types/Offer";
|
|
4
4
|
export interface BaggageSelectionModalBodyProps {
|
|
5
5
|
offer: Offer;
|
|
6
6
|
segment: OfferSliceSegment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayloadServices } from "
|
|
3
|
-
import { OfferAvailableServiceBaggage, OfferSliceSegmentPassengerBaggage } from "
|
|
2
|
+
import { CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { OfferAvailableServiceBaggage, OfferSliceSegmentPassengerBaggage } from "../../../types/Offer";
|
|
4
4
|
export interface BaggageSelectionModalBodyPassengerProps {
|
|
5
5
|
segmentId: string;
|
|
6
6
|
passengerId: string;
|
package/react-dist/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalFooter.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ServicePriceMapById } from "@lib/getServicePriceMapById";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { CreateOrderPayloadServices } from "
|
|
3
|
+
import { CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
4
4
|
export interface BaggageSelectionModalFooterProps {
|
|
5
5
|
currency: string;
|
|
6
6
|
selectedServices: CreateOrderPayloadServices;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { OfferSliceSegmentPassengerBaggage } from "
|
|
2
|
+
import { OfferSliceSegmentPassengerBaggage } from "../../../types/Offer";
|
|
3
3
|
interface IncludedBaggageBannerProps {
|
|
4
4
|
includedBaggage: OfferSliceSegmentPassengerBaggage[];
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayloadServices } from "
|
|
3
|
-
import { Offer } from "
|
|
2
|
+
import { CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { Offer } from "../../../types/Offer";
|
|
4
4
|
export interface CfarSelectionCardProps {
|
|
5
5
|
isLoading: boolean;
|
|
6
6
|
offer?: Offer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayloadServices } from "
|
|
3
|
-
import { Offer, OfferAvailableServiceCancelForAnyReason } from "
|
|
2
|
+
import { CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { Offer, OfferAvailableServiceCancelForAnyReason } from "../../../types/Offer";
|
|
4
4
|
export interface CfarSelectionModalProps {
|
|
5
5
|
isOpen: boolean;
|
|
6
6
|
offerCurrency?: Offer["base_currency"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Offer, OfferAvailableServiceCancelForAnyReason } from "
|
|
2
|
+
import { Offer, OfferAvailableServiceCancelForAnyReason } from "../../../types/Offer";
|
|
3
3
|
export interface CfarSelectionModalBodyProps {
|
|
4
4
|
offerCurrency: Offer["base_currency"];
|
|
5
5
|
service: OfferAvailableServiceCancelForAnyReason;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayloadServices } from "
|
|
3
|
-
import { OfferAvailableServiceCancelForAnyReason } from "
|
|
2
|
+
import { CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { OfferAvailableServiceCancelForAnyReason } from "../../../types/Offer";
|
|
4
4
|
export interface CfarSelectionModalFooterProps {
|
|
5
5
|
service: OfferAvailableServiceCancelForAnyReason;
|
|
6
6
|
selectedServices: CreateOrderPayloadServices;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { SeatMapCabinRowSectionElementAmenity } from "
|
|
2
|
+
import { SeatMapCabinRowSectionElementAmenity } from "../../../types/SeatMap";
|
|
3
3
|
export interface AmenityProps {
|
|
4
4
|
type: SeatMapCabinRowSectionElementAmenity;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CreateOrderPayloadSeatService } from "
|
|
3
|
-
import { SeatMapCabinRowSectionElement } from "
|
|
2
|
+
import { CreateOrderPayloadSeatService } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { SeatMapCabinRowSectionElement } from "../../../types/SeatMap";
|
|
4
4
|
interface ElementProps {
|
|
5
5
|
sectionIndex: number;
|
|
6
6
|
elementIndex: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { SeatMapCabinRowSectionElementAmenity } from "
|
|
2
|
+
import { SeatMapCabinRowSectionElementAmenity } from "../../../types/SeatMap";
|
|
3
3
|
export interface LegendProps {
|
|
4
4
|
/**
|
|
5
5
|
* The set of additional symbols to display
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CreateOrderPayloadSeatService } from "
|
|
3
|
-
import { SeatMapCabinRow } from "
|
|
2
|
+
import { CreateOrderPayloadSeatService } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { SeatMapCabinRow } from "../../../types/SeatMap";
|
|
4
4
|
export interface RowProps {
|
|
5
5
|
row: SeatMapCabinRow;
|
|
6
6
|
hasWings: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CreateOrderPayloadSeatService } from "
|
|
3
|
-
import { SeatMapCabinRow, SeatMapCabinRowSection } from "
|
|
2
|
+
import { CreateOrderPayloadSeatService } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { SeatMapCabinRow, SeatMapCabinRowSection } from "../../../types/SeatMap";
|
|
4
4
|
interface RowSectionProps {
|
|
5
5
|
row: SeatMapCabinRow;
|
|
6
6
|
rowNumber: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CreateOrderPayloadSeatService } from "
|
|
3
|
-
import { SeatMapCabinRowSectionElementSeat } from "
|
|
2
|
+
import { CreateOrderPayloadSeatService } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { SeatMapCabinRowSectionElementSeat } from "../../../types/SeatMap";
|
|
4
4
|
interface SeatElementProps {
|
|
5
5
|
element: SeatMapCabinRowSectionElementSeat;
|
|
6
6
|
currentSegmentId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { SeatMapCabinRowSectionAvailableService, SeatMapCabinRowSectionElementSeat } from "
|
|
2
|
+
import { SeatMapCabinRowSectionAvailableService, SeatMapCabinRowSectionElementSeat } from "../../../types/SeatMap";
|
|
3
3
|
export interface SeatInfoProps {
|
|
4
4
|
seat: SeatMapCabinRowSectionElementSeat | null;
|
|
5
5
|
service: SeatMapCabinRowSectionAvailableService | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CreateOrderPayloadSeatService } from "
|
|
3
|
-
import { SeatMap as SeatMapType } from "
|
|
2
|
+
import { CreateOrderPayloadSeatService } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { SeatMap as SeatMapType } from "../../../types/SeatMap";
|
|
4
4
|
export interface SeatMapProps {
|
|
5
5
|
seatMap: SeatMapType;
|
|
6
6
|
selectedServicesMap: Record<string, CreateOrderPayloadSeatService>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayload, CreateOrderPayloadServices } from "
|
|
3
|
-
import { Offer } from "
|
|
4
|
-
import { SeatMap } from "
|
|
2
|
+
import { CreateOrderPayload, CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { Offer } from "../../../types/Offer";
|
|
4
|
+
import { SeatMap } from "../../../types/SeatMap";
|
|
5
5
|
export interface SeatSelectionCardProps {
|
|
6
6
|
isLoading: boolean;
|
|
7
7
|
offer?: Offer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CreateOrderPayload, CreateOrderPayloadSeatService } from "
|
|
3
|
-
import { Offer } from "
|
|
4
|
-
import { SeatMap } from "
|
|
2
|
+
import { CreateOrderPayload, CreateOrderPayloadSeatService } from "../../../types/CreateOrderPayload";
|
|
3
|
+
import { Offer } from "../../../types/Offer";
|
|
4
|
+
import { SeatMap } from "../../../types/SeatMap";
|
|
5
5
|
export interface SeatSelectionModalProps {
|
|
6
6
|
isOpen: boolean;
|
|
7
7
|
offer?: Offer;
|
package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalFooter.d.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServicePriceMapById } from "@lib/getServicePriceMapById";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { CreateOrderPayloadServices } from "
|
|
4
|
-
import { SeatMap } from "
|
|
3
|
+
import { CreateOrderPayloadServices } from "../../../types/CreateOrderPayload";
|
|
4
|
+
import { SeatMap } from "../../../types/SeatMap";
|
|
5
5
|
export interface SeatSelectionModalFooterProps {
|
|
6
6
|
currency: string;
|
|
7
7
|
selectedServices: CreateOrderPayloadServices;
|
package/react-dist/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalHeader.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { OfferSliceSegment } from "
|
|
2
|
+
import { OfferSliceSegment } from "../../../types/Offer";
|
|
3
3
|
export interface SeatSelectionModalHeaderProps {
|
|
4
4
|
segmentAndPassengerPermutationsCount: number;
|
|
5
5
|
currentSegment: OfferSliceSegment;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { SeatMapCabinRowSectionElementSeat } from "
|
|
2
|
+
import { SeatMapCabinRowSectionElementSeat } from "../../../types/SeatMap";
|
|
3
3
|
export declare const SeatUnavailable: React.FC<{
|
|
4
4
|
seat: SeatMapCabinRowSectionElementSeat;
|
|
5
5
|
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StripeError } from "@stripe/stripe-js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { CustomStyles } from "../../types";
|
|
4
|
+
export interface DuffelPaymentsProps {
|
|
5
|
+
paymentIntentClientToken: string;
|
|
6
|
+
onSuccessfulPayment: () => void;
|
|
7
|
+
onFailedPayment: (error: StripeError) => void;
|
|
8
|
+
styles?: CustomStyles;
|
|
9
|
+
debug?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const DuffelPayments: React.FC<DuffelPaymentsProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DuffelPaymentsProps } from "./DuffelPayments";
|
|
3
|
+
declare global {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
interface IntrinsicElements {
|
|
6
|
+
"duffel-payments": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
type DuffelPaymentsCustomElementRenderArguments = Pick<DuffelPaymentsProps, "paymentIntentClientToken" | "styles">;
|
|
11
|
+
export declare function renderDuffelPaymentsCustomElement(props: DuffelPaymentsCustomElementRenderArguments): void;
|
|
12
|
+
export declare function onDuffelPaymentsSuccessfulPayment(onSuccessfulPayment: DuffelPaymentsProps["onSuccessfulPayment"]): void;
|
|
13
|
+
export declare function onDuffelPaymentsFailedPayment(onFailedPayment: DuffelPaymentsProps["onFailedPayment"]): void;
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconName } from "@components/Icon";
|
|
1
|
+
import { IconName } from "@components/shared/Icon";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const BUTTON_VARIANTS: {
|
|
4
4
|
primary: string;
|
|
@@ -13,7 +13,7 @@ declare const BUTTON_SIZES: {
|
|
|
13
13
|
};
|
|
14
14
|
type ButtonSizes = keyof typeof BUTTON_SIZES;
|
|
15
15
|
type NativeButtonProps = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
16
|
-
export interface ButtonProps extends Pick<NativeButtonProps, "id" | "onClick" | "disabled" | "children" | "className"> {
|
|
16
|
+
export interface ButtonProps extends Pick<NativeButtonProps, "id" | "onClick" | "disabled" | "children" | "className" | "type"> {
|
|
17
17
|
"data-testid"?: string;
|
|
18
18
|
iconBefore?: IconName;
|
|
19
19
|
variant?: ButtonVariants;
|
|
@@ -8,6 +8,6 @@ export declare class ErrorBoundary extends React.Component<{
|
|
|
8
8
|
static getDerivedStateFromError(): {
|
|
9
9
|
hasError: boolean;
|
|
10
10
|
};
|
|
11
|
-
componentDidCatch(error: Error
|
|
11
|
+
componentDidCatch(error: Error): void;
|
|
12
12
|
render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
13
13
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is one of the entry points for the library -- `@duffel/components/custom-elements`.
|
|
3
|
+
* If you'd like to expose other custom element functions, please add them here.
|
|
4
|
+
*/
|
|
5
|
+
export { onDuffelAncillariesPayloadReady, renderDuffelAncillariesCustomElement, } from "./components/DuffelAncillaries/DuffelAncillariesCustomElement";
|
|
6
|
+
export { onDuffelPaymentsFailedPayment, onDuffelPaymentsSuccessfulPayment, renderDuffelPaymentsCustomElement, } from "./components/DuffelPayments/DuffelPaymentsCustomElement";
|