@duffel/components 3.1.2--prototype.2 → 3.1.3--prototype.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/.circleci/config.yml +2 -2
  2. package/.prettierignore +5 -1
  3. package/.storybook/main.ts +1 -1
  4. package/.vscode/extensions.json +7 -0
  5. package/.vscode/settings.json +10 -0
  6. package/.yarn/releases/yarn-4.0.1.cjs +893 -0
  7. package/.yarn/sdks/eslint/bin/eslint.js +20 -0
  8. package/.yarn/sdks/eslint/lib/api.js +20 -0
  9. package/.yarn/sdks/eslint/lib/unsupported-api.js +20 -0
  10. package/.yarn/sdks/eslint/package.json +14 -0
  11. package/.yarn/sdks/integrations.yml +5 -0
  12. package/.yarn/sdks/prettier/bin-prettier.js +20 -0
  13. package/.yarn/sdks/prettier/index.js +20 -0
  14. package/.yarn/sdks/prettier/package.json +7 -0
  15. package/.yarn/sdks/typescript/bin/tsc +20 -0
  16. package/.yarn/sdks/typescript/bin/tsserver +20 -0
  17. package/.yarn/sdks/typescript/lib/tsc.js +20 -0
  18. package/.yarn/sdks/typescript/lib/tsserver.js +225 -0
  19. package/.yarn/sdks/typescript/lib/tsserverlibrary.js +225 -0
  20. package/.yarn/sdks/typescript/lib/typescript.js +20 -0
  21. package/.yarn/sdks/typescript/package.json +10 -0
  22. package/.yarnrc.yml +3 -0
  23. package/README.md +4 -0
  24. package/jest.config.ts +1 -1
  25. package/package.json +83 -134
  26. package/react-dist/custom-elements.js +40 -0
  27. package/react-dist/custom-elements.js.map +7 -0
  28. package/react-dist/index.js +21 -47
  29. package/react-dist/index.js.map +7 -0
  30. package/react-dist/scripts/generate-fixture.d.ts +3 -0
  31. package/react-dist/scripts/setup-suggestion-data.d.ts +28 -0
  32. package/react-dist/src/components/DuffelAncillaries/Card.d.ts +14 -0
  33. package/react-dist/src/components/DuffelAncillaries/Counter.d.ts +10 -0
  34. package/react-dist/src/components/DuffelAncillaries/DuffelAncillaries.d.ts +3 -0
  35. package/react-dist/src/components/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +12 -0
  36. package/react-dist/src/components/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +11 -0
  37. package/react-dist/src/components/DuffelAncillaries/bags/BaggageSelectionController.d.ts +13 -0
  38. package/react-dist/src/components/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +11 -0
  39. package/react-dist/src/components/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +11 -0
  40. package/react-dist/src/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +13 -0
  41. package/react-dist/src/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +14 -0
  42. package/react-dist/src/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +9 -0
  43. package/react-dist/src/components/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +7 -0
  44. package/react-dist/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +10 -0
  45. package/react-dist/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +11 -0
  46. package/react-dist/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +7 -0
  47. package/react-dist/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +4 -0
  48. package/react-dist/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +11 -0
  49. package/react-dist/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +2 -0
  50. package/react-dist/src/components/DuffelAncillaries/seats/Amenity.d.ts +6 -0
  51. package/react-dist/src/components/DuffelAncillaries/seats/DeckSelect.d.ts +15 -0
  52. package/react-dist/src/components/DuffelAncillaries/seats/Element.d.ts +15 -0
  53. package/react-dist/src/components/DuffelAncillaries/seats/EmptyElement.d.ts +2 -0
  54. package/react-dist/src/components/DuffelAncillaries/seats/ExitElement.d.ts +6 -0
  55. package/react-dist/src/components/DuffelAncillaries/seats/Legend.d.ts +12 -0
  56. package/react-dist/src/components/DuffelAncillaries/seats/Row.d.ts +13 -0
  57. package/react-dist/src/components/DuffelAncillaries/seats/RowSection.d.ts +17 -0
  58. package/react-dist/src/components/DuffelAncillaries/seats/SeatElement.d.ts +13 -0
  59. package/react-dist/src/components/DuffelAncillaries/seats/SeatInfo.d.ts +7 -0
  60. package/react-dist/src/components/DuffelAncillaries/seats/SeatMap.d.ts +12 -0
  61. package/react-dist/src/components/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +2 -0
  62. package/react-dist/src/components/DuffelAncillaries/seats/SeatSelectionCard.d.ts +13 -0
  63. package/react-dist/src/components/DuffelAncillaries/seats/SeatSelectionModal.d.ts +13 -0
  64. package/react-dist/src/components/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +4 -0
  65. package/react-dist/src/components/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +16 -0
  66. package/react-dist/src/components/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +10 -0
  67. package/react-dist/src/components/DuffelAncillaries/seats/SeatUnavailable.d.ts +5 -0
  68. package/react-dist/src/components/DuffelPayments/DuffelPayments.d.ts +11 -0
  69. package/react-dist/src/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +13 -0
  70. package/react-dist/src/components/PlacesLookup/PlacesLookup.d.ts +20 -0
  71. package/react-dist/src/components/shared/AnimatedLoaderEllipsis.d.ts +2 -0
  72. package/react-dist/src/components/shared/Button.d.ts +23 -0
  73. package/react-dist/src/components/shared/ErrorBoundary.d.ts +13 -0
  74. package/react-dist/src/components/shared/FetchOfferErrorState.d.ts +5 -0
  75. package/react-dist/src/components/shared/Icon.d.ts +46 -0
  76. package/react-dist/src/components/shared/IconButton.d.ts +16 -0
  77. package/react-dist/src/components/shared/Modal.d.ts +11 -0
  78. package/react-dist/src/components/shared/NonIdealState.d.ts +4 -0
  79. package/react-dist/src/components/shared/Stamp.d.ts +7 -0
  80. package/react-dist/src/components/shared/Tabs.d.ts +16 -0
  81. package/react-dist/src/custom-elements.d.ts +6 -0
  82. package/react-dist/src/index.d.ts +7 -0
  83. package/react-dist/src/lib/captureErrorInSentry.d.ts +1 -0
  84. package/react-dist/src/lib/compileCreateOrderPayload.d.ts +14 -0
  85. package/react-dist/src/lib/createPriceFormatters.d.ts +12 -0
  86. package/react-dist/src/lib/fetchFromDuffelAPI.d.ts +8 -0
  87. package/react-dist/src/lib/fetchFromFixtures.d.ts +4 -0
  88. package/react-dist/src/lib/formatAvailableServices.d.ts +12 -0
  89. package/react-dist/src/lib/formatDate.d.ts +2 -0
  90. package/react-dist/src/lib/formatSeatMaps.d.ts +4 -0
  91. package/react-dist/src/lib/getBaggageServiceDescription.d.ts +2 -0
  92. package/react-dist/src/lib/getCabinsForSegmentAndDeck.d.ts +2 -0
  93. package/react-dist/src/lib/getCurrencyForSeatMaps.d.ts +10 -0
  94. package/react-dist/src/lib/getCurrencyForServices.d.ts +11 -0
  95. package/react-dist/src/lib/getFirstSeatElementMatchingCriteria.d.ts +3 -0
  96. package/react-dist/src/lib/getPassengerBySegmentList.d.ts +6 -0
  97. package/react-dist/src/lib/getPassengerInitials.d.ts +1 -0
  98. package/react-dist/src/lib/getPassengerMapById.d.ts +3 -0
  99. package/react-dist/src/lib/getPassengerName.d.ts +3 -0
  100. package/react-dist/src/lib/getRowNumber.d.ts +2 -0
  101. package/react-dist/src/lib/getSegmentList.d.ts +2 -0
  102. package/react-dist/src/lib/getServicePriceMapById.d.ts +3 -0
  103. package/react-dist/src/lib/getSymbols.d.ts +2 -0
  104. package/react-dist/src/lib/getTotalAmountForServices.d.ts +6 -0
  105. package/react-dist/src/lib/getTotalQuantity.d.ts +2 -0
  106. package/react-dist/src/lib/hasHighLuminance.d.ts +1 -0
  107. package/react-dist/src/lib/hasService.d.ts +2 -0
  108. package/react-dist/src/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +3 -0
  109. package/react-dist/src/lib/hasWings.d.ts +2 -0
  110. package/react-dist/src/lib/isBaggageService.d.ts +2 -0
  111. package/react-dist/src/lib/isCancelForAnyReasonService.d.ts +2 -0
  112. package/react-dist/src/lib/isFixtureOfferId.d.ts +2 -0
  113. package/react-dist/src/lib/isPayloadComplete.d.ts +2 -0
  114. package/react-dist/src/lib/isSeatElement.d.ts +2 -0
  115. package/react-dist/src/lib/logging.d.ts +46 -0
  116. package/react-dist/src/lib/moneyStringFormatter.d.ts +8 -0
  117. package/react-dist/src/lib/offerIsExpired.d.ts +2 -0
  118. package/react-dist/src/lib/retrieveOffer.d.ts +2 -0
  119. package/react-dist/src/lib/retrieveOfferFromDuffelAPI.d.ts +1 -0
  120. package/react-dist/src/lib/retrieveSeatMaps.d.ts +2 -0
  121. package/react-dist/src/lib/retrieveSeatMapsFromDuffelAPI.d.ts +1 -0
  122. package/react-dist/src/lib/setBodyScrollability.d.ts +1 -0
  123. package/react-dist/src/lib/validateProps.d.ts +7 -0
  124. package/react-dist/src/lib/withPlural.d.ts +1 -0
  125. package/react-dist/src/types/Aircraft.d.ts +14 -0
  126. package/react-dist/src/types/Airline.d.ts +14 -0
  127. package/react-dist/src/types/Airport.d.ts +44 -0
  128. package/react-dist/src/types/City.d.ts +18 -0
  129. package/react-dist/src/types/CreateOrderPayload.d.ts +72 -0
  130. package/react-dist/src/types/CurrencyConversion.d.ts +10 -0
  131. package/react-dist/src/types/DuffelAncillariesProps.d.ts +70 -0
  132. package/react-dist/src/types/Offer.d.ts +711 -0
  133. package/react-dist/src/types/Order.d.ts +8 -0
  134. package/react-dist/src/types/Place.d.ts +8 -0
  135. package/react-dist/src/types/SeatMap.d.ts +190 -0
  136. package/react-dist/src/types/index.d.ts +11 -0
  137. package/scripts/build-and-publish.sh +42 -0
  138. package/scripts/generate-fixture.ts +2 -2
  139. package/scripts.tsconfig.json +1 -1
  140. package/src/components/PlacesLookup/PlacesLookup.tsx +2 -3
  141. package/src/custom-elements.ts +0 -4
  142. package/src/examples/just-typescript/.yarn/install-state.gz +0 -0
  143. package/src/examples/just-typescript/package.json +2 -2
  144. package/src/examples/just-typescript/yarn.lock +467 -0
  145. package/src/examples/next/README.md +28 -0
  146. package/src/examples/next/next-env.d.ts +5 -0
  147. package/src/examples/next/next.config.js +4 -0
  148. package/src/examples/next/package.json +24 -0
  149. package/src/examples/next/src/app/DuffelComponents.tsx +40 -0
  150. package/src/examples/next/src/app/layout.tsx +18 -0
  151. package/src/examples/next/src/app/page.tsx +9 -0
  152. package/src/examples/next/tsconfig.json +27 -0
  153. package/src/examples/next/yarn.lock +257 -0
  154. package/src/examples/payments-just-typescript/yarn.lock +154 -0
  155. package/src/examples/react-app/src/index.tsx +1 -1
  156. package/src/examples/react-app/yarn.lock +219 -0
  157. package/src/index.ts +0 -2
  158. package/src/lib/logging.ts +1 -1
  159. package/tsconfig.json +9 -3
  160. package/.github/workflows/autoapprove.yml +0 -18
  161. package/.github/workflows/release.yml +0 -89
  162. package/.husky/post-commit +0 -4
  163. package/.husky/pre-commit +0 -4
  164. package/.storybook/Storyshots.test.js +0 -3
  165. package/.storybook/__snapshots__/Storyshots.test.js.snap +0 -67984
  166. package/src/components/ShowData/ShowData.tsx +0 -38
  167. package/src/components/ShowData/ShowDataCustomElement.tsx +0 -85
  168. package/src/stories/ShowData.stories.tsx +0 -16
package/tsconfig.json CHANGED
@@ -28,19 +28,25 @@
28
28
  "@lib/*": ["./src/lib/*"]
29
29
  },
30
30
  "jsx": "react-jsx",
31
+ "types": ["node"],
31
32
  "esModuleInterop": true,
32
33
  "forceConsistentCasingInFileNames": true,
33
34
  "downlevelIteration": true,
34
- "typeRoots": ["node_modules/@types", "node_modules/**/types"],
35
35
  "incremental": true,
36
36
  "declaration": true,
37
37
  "emitDeclarationOnly": true,
38
38
  "outDir": "react-dist",
39
39
  "declarationDir": "react-dist"
40
40
  },
41
- "include": ["src"],
41
+ "include": [
42
+ "src/**/*.ts",
43
+ "src/**/*.d.ts",
44
+ "src/**/*.tsx",
45
+ "scripts/**/*.ts",
46
+ "scripts/**/*.d.ts",
47
+ "scripts/**/*.tsx"
48
+ ],
42
49
  "exclude": [
43
- "node_modules",
44
50
  "**/**.css.js",
45
51
  "./cdn-dist/**/*",
46
52
  "./react-dist/**/*",
@@ -1,18 +0,0 @@
1
- # Our automated release process (see release.yml) creates PRs
2
- # to bump the version in package.json.
3
- #
4
- # This workflow automatically approves these PRs so they can
5
- # be merged without human intervention.
6
-
7
- name: Auto approve bump version PR
8
-
9
- on: pull_request_target
10
-
11
- jobs:
12
- auto-approve:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: hmarr/auto-approve-action@v2
16
- if: github.actor == 'duffel-bot'
17
- with:
18
- github-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -1,89 +0,0 @@
1
- name: Release to npm
2
- on:
3
- push:
4
- branches:
5
- - main
6
- jobs:
7
- Release:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - name: Checkout
11
- uses: actions/checkout@v2
12
- with:
13
- fetch-depth: 0
14
-
15
- - name: Setup Node.js
16
- uses: actions/setup-node@v1
17
- with:
18
- node-version: "18.x"
19
-
20
- - name: Get yarn cache directory path
21
- id: yarn-cache-dir-path
22
- run: echo "::set-output name=dir::$(yarn cache dir)"
23
-
24
- - uses: actions/cache@v2
25
- id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
26
- with:
27
- path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29
- restore-keys: |
30
- ${{ runner.os }}-yarn-
31
-
32
- - name: Install dependencies
33
- run: yarn install --frozen-lock-file --prefer-offline
34
-
35
- - name: Get version from package.json before release step
36
- id: initversion
37
- run: echo "::set-output name=version::$(npm run get-version --silent)"
38
-
39
- - name: Release to NPM
40
- id: release
41
- env:
42
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44
- GIT_AUTHOR_NAME: duffel-bot
45
- GIT_AUTHOR_EMAIL: duffel-bot-read-write@duffel.com
46
- GIT_COMMITTER_NAME: duffel-bot
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 }}
51
- run: yarn release
52
-
53
- - name: Get version from package.json after release step
54
- id: extractver
55
- run: echo "::set-output name=extractver::$(npm run get-version --silent)"
56
-
57
- - name: Check if package versions are different
58
- run: |
59
- echo "Init Version - ${{ steps.initversion.outputs.version }}"
60
- echo "extract version - ${{ steps.extractver.outputs.extractver }}"
61
- echo "extract version - ${{ steps.initversion.outputs.version != steps.extractver.outputs.extractver }}"
62
-
63
- - name: Create Pull Request with updated package files
64
- id: cpr
65
- if: steps.initversion.outputs.version != steps.extractver.outputs.extractver
66
- uses: peter-evans/create-pull-request@v3.10.0
67
- with:
68
- token: ${{ secrets.PAT }} # You can fin this on https://duffel.1password.com/vaults/all/allitems/m3heg3y3ijclli4tmmp4bsyxna
69
- commit-message: "chore(release): ${{ steps.extractver.outputs.extractver }}"
70
- committer: duffel-bot <duffel-bot-read-write@duffel.com>
71
- author: duffel-bot <duffel-bot-read-write@duffel.com>
72
- title: "chore(release): ${{ steps.extractver.outputs.extractver }}"
73
- body: "Version bump in package.json for release [${{ steps.extractver.outputs.extractver }}](https://github.com/${{github.repository}}/releases/tag/v${{ steps.extractver.outputs.extractver }})"
74
- branch: version-bump/${{ steps.extractver.outputs.extractver }}
75
- labels: |
76
- automated pr
77
-
78
- - name: Check outputs
79
- run: |
80
- echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
81
- echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
82
-
83
- - name: Enable Pull Request Automerge
84
- if: steps.cpr.outputs.pull-request-operation == 'created'
85
- uses: peter-evans/enable-pull-request-automerge@v1
86
- with:
87
- token: ${{ secrets.PAT }}
88
- pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
89
- merge-method: squash
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- yarn post-commit-check
package/.husky/pre-commit DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- yarn pre-commit-check
@@ -1,3 +0,0 @@
1
- import initStoryshots from "@storybook/addon-storyshots";
2
-
3
- initStoryshots();