@duffel/components 3.0.7-canary → 3.1.2--prototype
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 +8 -0
- package/.github/CODEOWNERS +4 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- package/.github/renovate.json +1 -5
- package/.github/workflows/release.yml +3 -0
- package/.storybook/__snapshots__/Storyshots.test.js.snap +20384 -533
- package/.tool-versions +1 -1
- package/README.md +16 -2
- package/config/esbuild.base.config.js +6 -2
- package/config/esbuild.cdn.config.js +2 -1
- package/config/esbuild.dev.config.js +2 -1
- package/config/esbuild.react.config.js +1 -1
- package/data/airports.csv +9084 -0
- package/data/cities.csv +256 -0
- package/package.json +11 -1
- package/react-dist/index.js +51 -21
- package/scripts/generate-fixture.ts +13 -8
- package/scripts/setup-suggestion-data.ts +100 -0
- package/scripts/upload-to-cdn.sh +1 -1
- 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} +68 -64
- package/src/components/{DuffelAncillariesCustomElement.tsx → DuffelAncillaries/DuffelAncillariesCustomElement.tsx} +2 -2
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionCard.tsx +10 -5
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionController.tsx +2 -2
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModal.tsx +4 -4
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBody.tsx +3 -3
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalBodyPassenger.tsx +4 -4
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalFooter.tsx +23 -16
- package/src/components/{bags → DuffelAncillaries/bags}/BaggageSelectionModalHeader.tsx +24 -18
- 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 +5 -5
- 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 +6 -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 +5 -5
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalBody.tsx +1 -1
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalFooter.tsx +24 -17
- package/src/components/{seats → DuffelAncillaries/seats}/SeatSelectionModalHeader.tsx +30 -20
- package/src/components/{seats → DuffelAncillaries/seats}/SeatUnavailable.tsx +2 -2
- package/src/components/DuffelPayments/DuffelPayments.tsx +224 -0
- package/src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx +130 -0
- package/src/components/PlacesLookup/PlacesLookup.tsx +123 -0
- package/src/components/ShowData/ShowData.tsx +38 -0
- package/src/components/ShowData/ShowDataCustomElement.tsx +85 -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} +11 -11
- 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 +6 -1
- package/src/examples/client-side/index.html +1 -1
- 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/react-app/src/index.tsx +11 -6
- package/src/fixtures/offers/off_1.json +1 -10
- package/src/index.ts +3 -1
- 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 +1 -6
- package/src/lib/getPassengerName.ts +4 -0
- package/src/lib/getTotalAmountForServices.ts +1 -1
- package/src/lib/hasHighLuminance.ts +9 -0
- package/src/lib/logging.ts +52 -32
- package/src/lib/retrieveOffer.ts +13 -6
- package/src/lib/retrieveSeatMaps.ts +13 -8
- package/src/stories/BaggageSelectionModalHeader.stories.tsx +1 -1
- package/src/stories/Button.stories.tsx +33 -2
- package/src/stories/DuffelAncillaries.stories.tsx +42 -2
- 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/stories/PlacesLookup.stories.tsx +22 -0
- package/src/stories/ShowData.stories.tsx +16 -0
- package/src/styles/components/Button.css +11 -3
- package/src/styles/components/Card.css +3 -3
- package/src/styles/components/CfarSelectionModal.css +1 -1
- package/src/styles/components/DuffelPayments.css +42 -0
- package/src/styles/components/Legend.css +10 -6
- package/src/styles/components/LoadingState.css +8 -2
- package/src/styles/components/Modal.css +2 -1
- package/src/styles/components/PassengerSelect.css +8 -2
- package/src/styles/components/PlacesLookup.css +36 -0
- package/src/styles/components/Seat.css +9 -7
- package/src/styles/components/SeatInfo.css +1 -1
- package/src/styles/components/Tabs.css +5 -2
- package/src/styles/global.css +2 -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/react-dist/components/AnimatedLoaderEllipsis.d.ts +0 -2
- package/react-dist/components/Button.d.ts +0 -23
- package/react-dist/components/Card.d.ts +0 -14
- package/react-dist/components/Counter.d.ts +0 -10
- package/react-dist/components/DuffelAncillaries.d.ts +0 -3
- package/react-dist/components/DuffelAncillariesCustomElement.d.ts +0 -13
- package/react-dist/components/ErrorBoundary.d.ts +0 -13
- package/react-dist/components/FetchOfferErrorState.d.ts +0 -5
- package/react-dist/components/Icon.d.ts +0 -44
- package/react-dist/components/IconButton.d.ts +0 -16
- package/react-dist/components/Modal.d.ts +0 -11
- package/react-dist/components/NonIdealState.d.ts +0 -4
- package/react-dist/components/Stamp.d.ts +0 -7
- package/react-dist/components/Tabs.d.ts +0 -16
- package/react-dist/components/bags/BaggageSelectionCard.d.ts +0 -11
- package/react-dist/components/bags/BaggageSelectionController.d.ts +0 -13
- package/react-dist/components/bags/BaggageSelectionModal.d.ts +0 -11
- package/react-dist/components/bags/BaggageSelectionModalBody.d.ts +0 -11
- package/react-dist/components/bags/BaggageSelectionModalBodyPassenger.d.ts +0 -13
- package/react-dist/components/bags/BaggageSelectionModalFooter.d.ts +0 -14
- package/react-dist/components/bags/BaggageSelectionModalHeader.d.ts +0 -9
- package/react-dist/components/bags/IncludedBaggageBanner.d.ts +0 -7
- package/react-dist/components/cancel_for_any_reason/CfarSelectionCard.d.ts +0 -10
- package/react-dist/components/cancel_for_any_reason/CfarSelectionModal.d.ts +0 -11
- package/react-dist/components/cancel_for_any_reason/CfarSelectionModalBody.d.ts +0 -7
- package/react-dist/components/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +0 -4
- package/react-dist/components/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +0 -11
- package/react-dist/components/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +0 -2
- package/react-dist/components/seats/Amenity.d.ts +0 -6
- package/react-dist/components/seats/DeckSelect.d.ts +0 -15
- package/react-dist/components/seats/Element.d.ts +0 -15
- package/react-dist/components/seats/EmptyElement.d.ts +0 -2
- package/react-dist/components/seats/ExitElement.d.ts +0 -6
- package/react-dist/components/seats/Legend.d.ts +0 -12
- package/react-dist/components/seats/Row.d.ts +0 -13
- package/react-dist/components/seats/RowSection.d.ts +0 -17
- package/react-dist/components/seats/SeatElement.d.ts +0 -13
- package/react-dist/components/seats/SeatInfo.d.ts +0 -7
- package/react-dist/components/seats/SeatMap.d.ts +0 -12
- package/react-dist/components/seats/SeatMapUnavailable.d.ts +0 -2
- package/react-dist/components/seats/SeatSelectionCard.d.ts +0 -13
- package/react-dist/components/seats/SeatSelectionModal.d.ts +0 -13
- package/react-dist/components/seats/SeatSelectionModalBody.d.ts +0 -4
- package/react-dist/components/seats/SeatSelectionModalFooter.d.ts +0 -16
- package/react-dist/components/seats/SeatSelectionModalHeader.d.ts +0 -10
- package/react-dist/components/seats/SeatUnavailable.d.ts +0 -5
- package/react-dist/custom-elements.d.ts +0 -5
- package/react-dist/custom-elements.js +0 -36
- package/react-dist/custom-elements.js.map +0 -7
- package/react-dist/index.d.ts +0 -6
- package/react-dist/index.js.map +0 -7
- package/react-dist/lib/captureErrorInSentry.d.ts +0 -1
- package/react-dist/lib/compileCreateOrderPayload.d.ts +0 -14
- package/react-dist/lib/createPriceFormatters.d.ts +0 -12
- package/react-dist/lib/fetchFromDuffelAPI.d.ts +0 -1
- package/react-dist/lib/fetchFromFixtures.d.ts +0 -4
- package/react-dist/lib/formatAvailableServices.d.ts +0 -12
- package/react-dist/lib/formatDate.d.ts +0 -2
- package/react-dist/lib/formatSeatMaps.d.ts +0 -4
- package/react-dist/lib/getBaggageServiceDescription.d.ts +0 -2
- package/react-dist/lib/getCabinsForSegmentAndDeck.d.ts +0 -2
- package/react-dist/lib/getCurrencyForSeatMaps.d.ts +0 -10
- package/react-dist/lib/getCurrencyForServices.d.ts +0 -11
- package/react-dist/lib/getFirstSeatElementMatchingCriteria.d.ts +0 -3
- package/react-dist/lib/getPassengerBySegmentList.d.ts +0 -6
- package/react-dist/lib/getPassengerInitials.d.ts +0 -1
- package/react-dist/lib/getPassengerMapById.d.ts +0 -3
- package/react-dist/lib/getPassengerName.d.ts +0 -3
- package/react-dist/lib/getRowNumber.d.ts +0 -2
- package/react-dist/lib/getSegmentList.d.ts +0 -2
- package/react-dist/lib/getServicePriceMapById.d.ts +0 -3
- package/react-dist/lib/getSymbols.d.ts +0 -2
- package/react-dist/lib/getTotalAmountForServices.d.ts +0 -6
- package/react-dist/lib/getTotalQuantity.d.ts +0 -2
- package/react-dist/lib/hasService.d.ts +0 -2
- package/react-dist/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +0 -3
- package/react-dist/lib/hasWings.d.ts +0 -2
- package/react-dist/lib/isBaggageService.d.ts +0 -2
- package/react-dist/lib/isCancelForAnyReasonService.d.ts +0 -2
- package/react-dist/lib/isFixtureOfferId.d.ts +0 -2
- package/react-dist/lib/isPayloadComplete.d.ts +0 -2
- package/react-dist/lib/isSeatElement.d.ts +0 -2
- package/react-dist/lib/logging.d.ts +0 -53
- package/react-dist/lib/moneyStringFormatter.d.ts +0 -8
- package/react-dist/lib/offerIsExpired.d.ts +0 -2
- package/react-dist/lib/retrieveOffer.d.ts +0 -2
- package/react-dist/lib/retrieveOfferFromDuffelAPI.d.ts +0 -1
- package/react-dist/lib/retrieveSeatMaps.d.ts +0 -2
- package/react-dist/lib/retrieveSeatMapsFromDuffelAPI.d.ts +0 -1
- package/react-dist/lib/setBodyScrollability.d.ts +0 -1
- package/react-dist/lib/validateProps.d.ts +0 -7
- package/react-dist/lib/withPlural.d.ts +0 -1
- package/react-dist/types/Aircraft.d.ts +0 -14
- package/react-dist/types/Airline.d.ts +0 -14
- package/react-dist/types/Airport.d.ts +0 -44
- package/react-dist/types/City.d.ts +0 -18
- package/react-dist/types/CreateOrderPayload.d.ts +0 -72
- package/react-dist/types/CurrencyConversion.d.ts +0 -10
- package/react-dist/types/DuffelAncillariesProps.d.ts +0 -70
- package/react-dist/types/Offer.d.ts +0 -711
- package/react-dist/types/Order.d.ts +0 -8
- package/react-dist/types/Place.d.ts +0 -8
- package/react-dist/types/SeatMap.d.ts +0 -190
- package/react-dist/types/index.d.ts +0 -11
- package/src/examples/just-typescript/yarn.lock +0 -154
- package/src/examples/react-app/yarn.lock +0 -219
- /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
package/.eslintrc.js
CHANGED
|
@@ -35,5 +35,13 @@ module.exports = {
|
|
|
35
35
|
"react/react-in-jsx-scope": 0,
|
|
36
36
|
"react/prop-types": 0,
|
|
37
37
|
"react-hooks/exhaustive-deps": 0,
|
|
38
|
+
"no-restricted-syntax": [
|
|
39
|
+
"error",
|
|
40
|
+
{
|
|
41
|
+
selector: "CallExpression[callee.object.name='console']",
|
|
42
|
+
message:
|
|
43
|
+
"Prefer 'log' or 'logGroup' from 'src/lib/logging.ts' instead of 'console'.",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
38
46
|
},
|
|
39
47
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ""
|
|
5
|
+
labels: ""
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Describe the bug**
|
|
10
|
+
A clear and concise description of what the bug is.
|
|
11
|
+
|
|
12
|
+
**Version of duffel-components**
|
|
13
|
+
Please add:
|
|
14
|
+
|
|
15
|
+
1. the version of the library you are using
|
|
16
|
+
2. how you are installing it (npm or script tag)
|
|
17
|
+
3. Your framework (React, vanilla JS, etc..)
|
|
18
|
+
|
|
19
|
+
**Code sample to reproduce**
|
|
20
|
+
Please re-create your issue in a code sandbox, if possible. Otherwise share as much as you can of your setup to help us narrow down what the issue is. Information such as request IDs can be helpful as well.
|
|
21
|
+
|
|
22
|
+
**Expected behavior**
|
|
23
|
+
A clear and concise description of what you expected to happen.
|
|
24
|
+
|
|
25
|
+
**Screenshots**
|
|
26
|
+
If applicable, please add screenshots to help explain your problem.
|
|
27
|
+
|
|
28
|
+
**Additional context**
|
|
29
|
+
Add any other context about the problem here.
|
package/.github/renovate.json
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"extends": [
|
|
4
|
-
"config:base",
|
|
5
|
-
"schedule:earlyMondays",
|
|
6
|
-
":combinePatchMinorReleases"
|
|
7
|
-
],
|
|
3
|
+
"extends": ["config:base", "schedule:monthly", ":combinePatchMinorReleases"],
|
|
8
4
|
"labels": ["dependencies"],
|
|
9
5
|
"enabledManagers": ["github-actions", "npm"],
|
|
10
6
|
"packageRules": [
|
|
@@ -45,6 +45,9 @@ jobs:
|
|
|
45
45
|
GIT_AUTHOR_EMAIL: duffel-bot-read-write@duffel.com
|
|
46
46
|
GIT_COMMITTER_NAME: duffel-bot
|
|
47
47
|
GIT_COMMITTER_EMAIL: duffel-bot-read-write@duffel.com
|
|
48
|
+
DUFFEL_API_URL: https://api.duffel.com
|
|
49
|
+
COMPONENT_CDN: https://assets.duffel.com/components
|
|
50
|
+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
48
51
|
run: yarn release
|
|
49
52
|
|
|
50
53
|
- name: Get version from package.json after release step
|