@duffel/components 3.1.3 → 3.1.4

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 (330) hide show
  1. package/components/DuffelAncillaries/Card.d.ts +14 -0
  2. package/components/DuffelAncillaries/Counter.d.ts +10 -0
  3. package/components/DuffelAncillaries/DuffelAncillaries.d.ts +3 -0
  4. package/components/DuffelAncillaries/DuffelAncillariesCustomElement.d.ts +12 -0
  5. package/components/DuffelAncillaries/bags/BaggageSelectionCard.d.ts +11 -0
  6. package/components/DuffelAncillaries/bags/BaggageSelectionController.d.ts +13 -0
  7. package/components/DuffelAncillaries/bags/BaggageSelectionModal.d.ts +11 -0
  8. package/components/DuffelAncillaries/bags/BaggageSelectionModalBody.d.ts +11 -0
  9. package/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.d.ts +13 -0
  10. package/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.d.ts +14 -0
  11. package/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.d.ts +9 -0
  12. package/components/DuffelAncillaries/bags/IncludedBaggageBanner.d.ts +7 -0
  13. package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.d.ts +10 -0
  14. package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.d.ts +11 -0
  15. package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.d.ts +7 -0
  16. package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +4 -0
  17. package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +11 -0
  18. package/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +2 -0
  19. package/components/DuffelAncillaries/seats/Amenity.d.ts +6 -0
  20. package/components/DuffelAncillaries/seats/DeckSelect.d.ts +15 -0
  21. package/components/DuffelAncillaries/seats/Element.d.ts +15 -0
  22. package/components/DuffelAncillaries/seats/EmptyElement.d.ts +2 -0
  23. package/components/DuffelAncillaries/seats/ExitElement.d.ts +6 -0
  24. package/components/DuffelAncillaries/seats/Legend.d.ts +12 -0
  25. package/components/DuffelAncillaries/seats/Row.d.ts +13 -0
  26. package/components/DuffelAncillaries/seats/RowSection.d.ts +17 -0
  27. package/components/DuffelAncillaries/seats/SeatElement.d.ts +13 -0
  28. package/components/DuffelAncillaries/seats/SeatInfo.d.ts +7 -0
  29. package/components/DuffelAncillaries/seats/SeatMap.d.ts +12 -0
  30. package/components/DuffelAncillaries/seats/SeatMapUnavailable.d.ts +2 -0
  31. package/components/DuffelAncillaries/seats/SeatSelectionCard.d.ts +13 -0
  32. package/components/DuffelAncillaries/seats/SeatSelectionModal.d.ts +13 -0
  33. package/components/DuffelAncillaries/seats/SeatSelectionModalBody.d.ts +4 -0
  34. package/components/DuffelAncillaries/seats/SeatSelectionModalFooter.d.ts +16 -0
  35. package/components/DuffelAncillaries/seats/SeatSelectionModalHeader.d.ts +10 -0
  36. package/components/DuffelAncillaries/seats/SeatUnavailable.d.ts +5 -0
  37. package/components/DuffelPayments/DuffelPayments.d.ts +11 -0
  38. package/components/DuffelPayments/DuffelPaymentsCustomElement.d.ts +13 -0
  39. package/components/PlacesLookup/PlacesLookup.d.ts +20 -0
  40. package/components/shared/AnimatedLoaderEllipsis.d.ts +2 -0
  41. package/components/shared/Button.d.ts +23 -0
  42. package/components/shared/ErrorBoundary.d.ts +13 -0
  43. package/components/shared/FetchOfferErrorState.d.ts +5 -0
  44. package/components/shared/Icon.d.ts +46 -0
  45. package/components/shared/IconButton.d.ts +16 -0
  46. package/components/shared/Modal.d.ts +11 -0
  47. package/components/shared/NonIdealState.d.ts +4 -0
  48. package/components/shared/Stamp.d.ts +7 -0
  49. package/components/shared/Tabs.d.ts +16 -0
  50. package/custom-elements.d.ts +6 -0
  51. package/custom-elements.js +40 -0
  52. package/custom-elements.js.map +7 -0
  53. package/index.js +40 -0
  54. package/index.js.map +7 -0
  55. package/lib/captureErrorInSentry.d.ts +1 -0
  56. package/lib/compileCreateOrderPayload.d.ts +14 -0
  57. package/lib/createPriceFormatters.d.ts +12 -0
  58. package/lib/fetchFromDuffelAPI.d.ts +8 -0
  59. package/lib/fetchFromFixtures.d.ts +4 -0
  60. package/lib/formatAvailableServices.d.ts +12 -0
  61. package/lib/formatDate.d.ts +2 -0
  62. package/lib/formatSeatMaps.d.ts +4 -0
  63. package/lib/getBaggageServiceDescription.d.ts +2 -0
  64. package/lib/getCabinsForSegmentAndDeck.d.ts +2 -0
  65. package/lib/getCurrencyForSeatMaps.d.ts +10 -0
  66. package/lib/getCurrencyForServices.d.ts +11 -0
  67. package/lib/getFirstSeatElementMatchingCriteria.d.ts +3 -0
  68. package/lib/getPassengerBySegmentList.d.ts +6 -0
  69. package/lib/getPassengerInitials.d.ts +1 -0
  70. package/lib/getPassengerMapById.d.ts +3 -0
  71. package/lib/getPassengerName.d.ts +3 -0
  72. package/lib/getRowNumber.d.ts +2 -0
  73. package/lib/getSegmentList.d.ts +2 -0
  74. package/lib/getServicePriceMapById.d.ts +3 -0
  75. package/lib/getSymbols.d.ts +2 -0
  76. package/lib/getTotalAmountForServices.d.ts +6 -0
  77. package/lib/getTotalQuantity.d.ts +2 -0
  78. package/lib/hasHighLuminance.d.ts +1 -0
  79. package/lib/hasService.d.ts +2 -0
  80. package/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +3 -0
  81. package/lib/hasWings.d.ts +2 -0
  82. package/lib/isBaggageService.d.ts +2 -0
  83. package/lib/isCancelForAnyReasonService.d.ts +2 -0
  84. package/lib/isFixtureOfferId.d.ts +2 -0
  85. package/lib/isPayloadComplete.d.ts +2 -0
  86. package/lib/isSeatElement.d.ts +2 -0
  87. package/lib/logging.d.ts +46 -0
  88. package/lib/moneyStringFormatter.d.ts +8 -0
  89. package/lib/offerIsExpired.d.ts +2 -0
  90. package/lib/retrieveOffer.d.ts +2 -0
  91. package/lib/retrieveOfferFromDuffelAPI.d.ts +1 -0
  92. package/lib/retrieveSeatMaps.d.ts +2 -0
  93. package/lib/retrieveSeatMapsFromDuffelAPI.d.ts +1 -0
  94. package/lib/setBodyScrollability.d.ts +1 -0
  95. package/lib/validateProps.d.ts +7 -0
  96. package/lib/withPlural.d.ts +1 -0
  97. package/package.json +84 -134
  98. package/tsconfig.tsbuildinfo +1 -0
  99. package/types/Aircraft.d.ts +14 -0
  100. package/types/Airline.d.ts +14 -0
  101. package/types/Airport.d.ts +44 -0
  102. package/types/City.d.ts +18 -0
  103. package/types/CreateOrderPayload.d.ts +72 -0
  104. package/types/CurrencyConversion.d.ts +10 -0
  105. package/types/DuffelAncillariesProps.d.ts +70 -0
  106. package/types/Offer.d.ts +711 -0
  107. package/types/Order.d.ts +8 -0
  108. package/types/Place.d.ts +8 -0
  109. package/types/SeatMap.d.ts +190 -0
  110. package/.circleci/config.yml +0 -67
  111. package/.eslintrc.js +0 -47
  112. package/.github/CODEOWNERS +0 -4
  113. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -29
  114. package/.github/renovate.json +0 -12
  115. package/.github/workflows/autoapprove.yml +0 -18
  116. package/.github/workflows/release.yml +0 -89
  117. package/.husky/post-commit +0 -4
  118. package/.husky/pre-commit +0 -4
  119. package/.nvmrc +0 -1
  120. package/.prettierignore +0 -2
  121. package/.storybook/Storyshots.test.js +0 -3
  122. package/.storybook/__snapshots__/Storyshots.test.js.snap +0 -67984
  123. package/.storybook/main.ts +0 -33
  124. package/.storybook/preview.tsx +0 -28
  125. package/.tool-versions +0 -1
  126. package/CONTRIBUTING.md +0 -83
  127. package/README.md +0 -68
  128. package/__mocks__/styleMock.js +0 -6
  129. package/babel.config.js +0 -20
  130. package/commitlint.config.js +0 -4
  131. package/config/esbuild.base.config.js +0 -18
  132. package/config/esbuild.cdn.config.js +0 -51
  133. package/config/esbuild.dev.config.js +0 -46
  134. package/config/esbuild.react.config.js +0 -42
  135. package/data/airports.csv +0 -9084
  136. package/data/cities.csv +0 -256
  137. package/jest.config.ts +0 -14
  138. package/react-dist/index.js +0 -37
  139. package/scripts/generate-fixture.ts +0 -200
  140. package/scripts/setup-suggestion-data.ts +0 -100
  141. package/scripts/upload-to-cdn.sh +0 -34
  142. package/scripts.tsconfig.json +0 -11
  143. package/src/components/DuffelAncillaries/Card.tsx +0 -126
  144. package/src/components/DuffelAncillaries/Counter.tsx +0 -40
  145. package/src/components/DuffelAncillaries/DuffelAncillaries.tsx +0 -350
  146. package/src/components/DuffelAncillaries/DuffelAncillariesCustomElement.tsx +0 -124
  147. package/src/components/DuffelAncillaries/bags/BaggageSelectionCard.tsx +0 -101
  148. package/src/components/DuffelAncillaries/bags/BaggageSelectionController.tsx +0 -88
  149. package/src/components/DuffelAncillaries/bags/BaggageSelectionModal.tsx +0 -81
  150. package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBody.tsx +0 -60
  151. package/src/components/DuffelAncillaries/bags/BaggageSelectionModalBodyPassenger.tsx +0 -122
  152. package/src/components/DuffelAncillaries/bags/BaggageSelectionModalFooter.tsx +0 -88
  153. package/src/components/DuffelAncillaries/bags/BaggageSelectionModalHeader.tsx +0 -82
  154. package/src/components/DuffelAncillaries/bags/IncludedBaggageBanner.tsx +0 -51
  155. package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionCard.tsx +0 -90
  156. package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModal.tsx +0 -63
  157. package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBody.tsx +0 -56
  158. package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalBodyListItem.tsx +0 -11
  159. package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalFooter.tsx +0 -74
  160. package/src/components/DuffelAncillaries/cancel_for_any_reason/CfarSelectionModalHeader.tsx +0 -9
  161. package/src/components/DuffelAncillaries/seats/Amenity.tsx +0 -21
  162. package/src/components/DuffelAncillaries/seats/DeckSelect.tsx +0 -27
  163. package/src/components/DuffelAncillaries/seats/Element.tsx +0 -52
  164. package/src/components/DuffelAncillaries/seats/EmptyElement.tsx +0 -5
  165. package/src/components/DuffelAncillaries/seats/ExitElement.tsx +0 -17
  166. package/src/components/DuffelAncillaries/seats/Legend.tsx +0 -60
  167. package/src/components/DuffelAncillaries/seats/Row.tsx +0 -47
  168. package/src/components/DuffelAncillaries/seats/RowSection.tsx +0 -78
  169. package/src/components/DuffelAncillaries/seats/SeatElement.tsx +0 -120
  170. package/src/components/DuffelAncillaries/seats/SeatInfo.tsx +0 -32
  171. package/src/components/DuffelAncillaries/seats/SeatMap.tsx +0 -85
  172. package/src/components/DuffelAncillaries/seats/SeatMapUnavailable.tsx +0 -21
  173. package/src/components/DuffelAncillaries/seats/SeatSelectionCard.tsx +0 -103
  174. package/src/components/DuffelAncillaries/seats/SeatSelectionModal.tsx +0 -142
  175. package/src/components/DuffelAncillaries/seats/SeatSelectionModalBody.tsx +0 -13
  176. package/src/components/DuffelAncillaries/seats/SeatSelectionModalFooter.tsx +0 -89
  177. package/src/components/DuffelAncillaries/seats/SeatSelectionModalHeader.tsx +0 -97
  178. package/src/components/DuffelAncillaries/seats/SeatUnavailable.tsx +0 -14
  179. package/src/components/DuffelPayments/DuffelPayments.tsx +0 -224
  180. package/src/components/DuffelPayments/DuffelPaymentsCustomElement.tsx +0 -130
  181. package/src/components/PlacesLookup/PlacesLookup.tsx +0 -123
  182. package/src/components/shared/AnimatedLoaderEllipsis.tsx +0 -5
  183. package/src/components/shared/Button.tsx +0 -63
  184. package/src/components/shared/ErrorBoundary.tsx +0 -54
  185. package/src/components/shared/FetchOfferErrorState.tsx +0 -35
  186. package/src/components/shared/Icon.tsx +0 -151
  187. package/src/components/shared/IconButton.tsx +0 -42
  188. package/src/components/shared/Modal.tsx +0 -40
  189. package/src/components/shared/NonIdealState.tsx +0 -28
  190. package/src/components/shared/Stamp.tsx +0 -29
  191. package/src/components/shared/Tabs.tsx +0 -36
  192. package/src/custom-elements.ts +0 -13
  193. package/src/examples/client-side/README.md +0 -30
  194. package/src/examples/client-side/index.html +0 -57
  195. package/src/examples/full-stack/README.md +0 -34
  196. package/src/examples/full-stack/index.html +0 -48
  197. package/src/examples/full-stack/server.mjs +0 -158
  198. package/src/examples/just-typescript/README.md +0 -37
  199. package/src/examples/just-typescript/package.json +0 -16
  200. package/src/examples/just-typescript/src/index.html +0 -23
  201. package/src/examples/just-typescript/src/index.ts +0 -36
  202. package/src/examples/next/README.md +0 -28
  203. package/src/examples/next/next-env.d.ts +0 -5
  204. package/src/examples/next/next.config.js +0 -4
  205. package/src/examples/next/package.json +0 -24
  206. package/src/examples/next/src/app/DuffelComponents.tsx +0 -40
  207. package/src/examples/next/src/app/layout.tsx +0 -18
  208. package/src/examples/next/src/app/page.tsx +0 -9
  209. package/src/examples/next/tsconfig.json +0 -27
  210. package/src/examples/payments-custom-element/README.md +0 -17
  211. package/src/examples/payments-custom-element/index.html +0 -43
  212. package/src/examples/payments-just-typescript/README.md +0 -37
  213. package/src/examples/payments-just-typescript/package.json +0 -16
  214. package/src/examples/payments-just-typescript/src/index.html +0 -23
  215. package/src/examples/payments-just-typescript/src/index.ts +0 -18
  216. package/src/examples/react-app/README.md +0 -37
  217. package/src/examples/react-app/package.json +0 -20
  218. package/src/examples/react-app/src/index.html +0 -19
  219. package/src/examples/react-app/src/index.tsx +0 -48
  220. package/src/fixtures/offers/off_0000AUde3KwTztSRK1cznH.json +0 -497
  221. package/src/fixtures/offers/off_0000AVx4lUFFKW8PsPeQeQ.json +0 -307
  222. package/src/fixtures/offers/off_1.json +0 -488
  223. package/src/fixtures/passengers/mock_passengers.ts +0 -26
  224. package/src/fixtures/seat-maps/off_0000AUde3KwTztSRK1cznH.json +0 -6852
  225. package/src/fixtures/seat-maps/off_0000AVx4lUFFKW8PsPeQeQ.json +0 -1
  226. package/src/fixtures/seat-maps/off_1.json +0 -6852
  227. package/src/lib/captureErrorInSentry.ts +0 -42
  228. package/src/lib/compileCreateOrderPayload.ts +0 -63
  229. package/src/lib/createPriceFormatters.ts +0 -73
  230. package/src/lib/fetchFromDuffelAPI.ts +0 -54
  231. package/src/lib/fetchFromFixtures.ts +0 -18
  232. package/src/lib/formatAvailableServices.ts +0 -91
  233. package/src/lib/formatDate.ts +0 -20
  234. package/src/lib/formatSeatMaps.ts +0 -81
  235. package/src/lib/getBaggageServiceDescription.ts +0 -39
  236. package/src/lib/getCabinsForSegmentAndDeck.ts +0 -4
  237. package/src/lib/getCurrencyForSeatMaps.ts +0 -22
  238. package/src/lib/getCurrencyForServices.ts +0 -24
  239. package/src/lib/getFirstSeatElementMatchingCriteria.ts +0 -22
  240. package/src/lib/getPassengerBySegmentList.ts +0 -10
  241. package/src/lib/getPassengerInitials.ts +0 -6
  242. package/src/lib/getPassengerMapById.ts +0 -17
  243. package/src/lib/getPassengerName.ts +0 -41
  244. package/src/lib/getRowNumber.ts +0 -16
  245. package/src/lib/getSegmentList.ts +0 -7
  246. package/src/lib/getServicePriceMapById.ts +0 -20
  247. package/src/lib/getSymbols.ts +0 -22
  248. package/src/lib/getTotalAmountForServices.ts +0 -72
  249. package/src/lib/getTotalQuantity.ts +0 -5
  250. package/src/lib/hasHighLuminance.ts +0 -9
  251. package/src/lib/hasService.ts +0 -24
  252. package/src/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.ts +0 -35
  253. package/src/lib/hasWings.ts +0 -8
  254. package/src/lib/isBaggageService.ts +0 -8
  255. package/src/lib/isCancelForAnyReasonService.ts +0 -9
  256. package/src/lib/isFixtureOfferId.ts +0 -4
  257. package/src/lib/isPayloadComplete.ts +0 -11
  258. package/src/lib/isSeatElement.ts +0 -10
  259. package/src/lib/logging.ts +0 -120
  260. package/src/lib/moneyStringFormatter.ts +0 -34
  261. package/src/lib/offerIsExpired.ts +0 -5
  262. package/src/lib/retrieveOffer.ts +0 -56
  263. package/src/lib/retrieveOfferFromDuffelAPI.ts +0 -13
  264. package/src/lib/retrieveSeatMaps.ts +0 -55
  265. package/src/lib/retrieveSeatMapsFromDuffelAPI.ts +0 -13
  266. package/src/lib/setBodyScrollability.ts +0 -7
  267. package/src/lib/validateProps.ts +0 -37
  268. package/src/lib/withPlural.ts +0 -8
  269. package/src/stories/BaggageSelectionModalHeader.stories.tsx +0 -21
  270. package/src/stories/Button.stories.tsx +0 -91
  271. package/src/stories/DuffelAncillaries.stories.tsx +0 -166
  272. package/src/stories/DuffelPayments.stories.tsx +0 -34
  273. package/src/stories/Icon.stories.tsx +0 -35
  274. package/src/stories/IconButton.stories.tsx +0 -25
  275. package/src/stories/PlacesLookup.stories.tsx +0 -22
  276. package/src/styles/colors.css +0 -22
  277. package/src/styles/components/Amenity.css +0 -23
  278. package/src/styles/components/BaggageDisplay.css +0 -25
  279. package/src/styles/components/Button.css +0 -169
  280. package/src/styles/components/Card.css +0 -52
  281. package/src/styles/components/CfarSelectionModal.css +0 -34
  282. package/src/styles/components/Counter.css +0 -18
  283. package/src/styles/components/DuffelPayments.css +0 -42
  284. package/src/styles/components/IconButton.css +0 -63
  285. package/src/styles/components/Legend.css +0 -62
  286. package/src/styles/components/Loader.css +0 -37
  287. package/src/styles/components/LoadingState.css +0 -87
  288. package/src/styles/components/Modal.css +0 -84
  289. package/src/styles/components/PassengerSelect.css +0 -99
  290. package/src/styles/components/PassengersLayout.css +0 -90
  291. package/src/styles/components/PlacesLookup.css +0 -36
  292. package/src/styles/components/Row.css +0 -70
  293. package/src/styles/components/Seat.css +0 -59
  294. package/src/styles/components/SeatInfo.css +0 -61
  295. package/src/styles/components/SeatMap.css +0 -24
  296. package/src/styles/components/SeatSelect.css +0 -92
  297. package/src/styles/components/Segment.css +0 -17
  298. package/src/styles/components/SelectionSegment.css +0 -10
  299. package/src/styles/components/Summary.css +0 -70
  300. package/src/styles/components/Tabs.css +0 -52
  301. package/src/styles/flex.css +0 -5
  302. package/src/styles/font-families.css +0 -47
  303. package/src/styles/global.css +0 -52
  304. package/src/styles/margin.css +0 -3
  305. package/src/styles/spacing.css +0 -18
  306. package/src/styles/transitions.css +0 -3
  307. package/src/styles/typography.css +0 -13
  308. package/src/tests/components/DuffelAncillaries.test.tsx +0 -342
  309. package/src/tests/lib/createPriceFormatters.test.tsx +0 -152
  310. package/src/tests/lib/formatAvailableServices.test.tsx +0 -79
  311. package/src/tests/lib/formatSeatMaps.test.tsx +0 -49
  312. package/src/tests/lib/getCurrencyForServices.test.tsx +0 -44
  313. package/src/tests/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.test.ts +0 -86
  314. package/src/tests/lib/logging.test.tsx +0 -32
  315. package/src/tests/lib/moneyStringFormatter.test.tsx +0 -12
  316. package/src/tests/lib/validateProps.test.tsx +0 -57
  317. package/src/types/Aircraft.ts +0 -16
  318. package/src/types/Airline.ts +0 -16
  319. package/src/types/Airport.ts +0 -54
  320. package/src/types/City.ts +0 -21
  321. package/src/types/CreateOrderPayload.ts +0 -99
  322. package/src/types/CurrencyConversion.ts +0 -10
  323. package/src/types/DuffelAncillariesProps.ts +0 -108
  324. package/src/types/Offer.ts +0 -851
  325. package/src/types/Order.ts +0 -6
  326. package/src/types/Place.ts +0 -6
  327. package/src/types/SeatMap.ts +0 -231
  328. package/tsconfig.json +0 -52
  329. /package/{src/index.ts → index.d.ts} +0 -0
  330. /package/{src/types/index.ts → types/index.d.ts} +0 -0
@@ -1,18 +0,0 @@
1
- import type { Metadata } from "next";
2
-
3
- export const metadata: Metadata = {
4
- title: "Create Next App",
5
- description: "Generated by create next app",
6
- };
7
-
8
- export default function RootLayout({
9
- children,
10
- }: {
11
- children: React.ReactNode;
12
- }) {
13
- return (
14
- <html lang="en">
15
- <body>{children}</body>
16
- </html>
17
- );
18
- }
@@ -1,9 +0,0 @@
1
- import { DuffelComponents } from "./DuffelComponents";
2
-
3
- export default function Home() {
4
- return (
5
- <main>
6
- <DuffelComponents />
7
- </main>
8
- );
9
- }
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": true,
8
- "noEmit": true,
9
- "esModuleInterop": true,
10
- "module": "esnext",
11
- "moduleResolution": "node",
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "jsx": "preserve",
15
- "incremental": true,
16
- "plugins": [
17
- {
18
- "name": "next"
19
- }
20
- ],
21
- "paths": {
22
- "@/*": ["./src/*"]
23
- }
24
- },
25
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26
- "exclude": ["node_modules"]
27
- }
@@ -1,17 +0,0 @@
1
- # Duffel payments custom element example
2
-
3
- ## Setup
4
-
5
- ```sh
6
- # .env.local
7
-
8
- # The url for the component CDN.
9
- # This is used to load both the styles an
10
- # COMPONENT_CDN=https://assets.duffel.com/components/ancillaries/VERSION # production
11
- COMPONENT_CDN=http://localhost:8000 # development
12
- ```
13
-
14
- ## Run the example
15
-
16
- 1. Serve the Duffel component bundle and watch for changes to rebuild on port `8000` using `yarn dev`.
17
- 2. Open `src/examples/payments-custom-element/index.html` on your browser.
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Payment page example</title>
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <link
7
- rel="icon"
8
- type="image/png"
9
- sizes="96x96"
10
- href="https://duffel.com/images/favicon/favicon-96x96.png"
11
- />
12
-
13
- <!-- 1. This script loads duffel-components -->
14
- <script src="http://localhost:8000/duffel-payments.js"></script>
15
- </head>
16
-
17
- <body style="font-family: sans-serif">
18
- <h1 style="margin-bottom: 2rem">Payment page example</h1>
19
-
20
- <!-- 2. Add the custom element to your markup where you want to render the payments card -->
21
- <duffel-payments></duffel-payments>
22
- </body>
23
- <script>
24
- const duffelpaymentsElement = document.querySelector("duffel-payments");
25
-
26
- // 3. Render the component with the required data, you can safely call this function as many times as you want.
27
- duffelpaymentsElement.render({
28
- paymentIntentClientToken:
29
- "eyJjbGllbnRfc2VjcmV0IjoicGlfM0psczlVQWcySmhFeTh2WTBSTm1MU0JkX3NlY3JldF9QUW9yZXNuU3laeWJadGRiejZwNzBCbUdPIiwicHVibGlzaGFibGVfa2V5IjoicGtfdGVzdF9EQUJLY0E2Vzh6OTc0cTdPSWY0YmJ2MVQwMEpwRmMyOUpWIn0=",
30
- debug: true,
31
- });
32
-
33
- // 4. Listen to 'onSuccessfulPayment' event on the component:
34
- duffelpaymentsElement.addEventListener("onSuccessfulPayment", () =>
35
- console.log("onPayloadReady\n")
36
- );
37
-
38
- // 5. If we run into an issue with the payment, you can listen to 'onFailedPayment' event:
39
- duffelpaymentsElement.addEventListener("onFailedPayment", (event) =>
40
- console.log("onPayloadReady\n", event.detail)
41
- );
42
- </script>
43
- </html>
@@ -1,37 +0,0 @@
1
- # payments-just-typescript example
2
-
3
- ## TL;DR
4
-
5
- Start on the root of the `duffel-components` repository:
6
-
7
- ```sh
8
- # build duffel-components for react env:
9
- yarn react-build
10
-
11
- # change directory to example folder
12
- cd src/examples/payments-just-typescript
13
-
14
- # cleanup last install and build
15
- rm -rf node_modules && rm -rf dist
16
-
17
- # install new version
18
- yarn
19
-
20
- # build and watch example
21
- yarn build
22
-
23
- # open example
24
- open src/index.html -a "Safari"
25
- ```
26
-
27
- ## Build duffel-components
28
-
29
- First, navigate to the root folder of the duffel-components repository and run `yarn react-build` to build the package. It should output a react-dist folder on the root. This folder is the one we reference on `src/examples/payments-just-typescript/package.json` dependencies under `duffel-components`
30
-
31
- ## Install dependencies
32
-
33
- Once the package is built, you can cd into this directory and run `yarn` to install all dependencies. If there are changes to `react-dist` since your last install, you'll need to `rm -rf node_modules`, otherwise the updates build will not be installed.
34
-
35
- ## Run example
36
-
37
- Finally, run `yarn dev` to build `src/examples/payments-just-typescript/src/index.tsx`. This will produce `src/examples/payments-just-typescript/dist` folder that is referenced by `src/examples/payments-just-typescript/src/index.html`. You can then open `src/examples/payments-just-typescript/src/index.html` on your browser to see the example up and running.
@@ -1,16 +0,0 @@
1
- {
2
- "name": "just-typescript",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "build": "esbuild src/index.ts --bundle --outfile=dist/index.js"
7
- },
8
- "dependencies": {
9
- "@types/node": "20.2.5",
10
- "typescript": "5.0.4",
11
- "duffel-components": "../../../../duffel-components/react-dist"
12
- },
13
- "devDependencies": {
14
- "esbuild": "^0.17.19"
15
- }
16
- }
@@ -1,23 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <link
7
- rel="icon"
8
- type="image/png"
9
- sizes="96x96"
10
- href="https://duffel.com/images/favicon/favicon-96x96.png"
11
- />
12
-
13
- <script src="../dist/index.js" defer></script>
14
- <title>Duffel payments component just typescript example</title>
15
- </head>
16
- <body>
17
- <h1 style="margin-bottom: 2rem">
18
- Duffel payments component just typescript example
19
- </h1>
20
-
21
- <duffel-payments></duffel-payments>
22
- </body>
23
- </html>
@@ -1,18 +0,0 @@
1
- import {
2
- onDuffelPaymentsFailedPayment,
3
- onDuffelPaymentsSuccessfulPayment,
4
- renderDuffelPaymentsCustomElement,
5
- } from "duffel-components/custom-elements";
6
-
7
- window.onload = () => {
8
- renderDuffelPaymentsCustomElement({
9
- paymentIntentClientToken:
10
- "eyJjbGllbnRfc2VjcmV0IjoicGlfM0psczlVQWcySmhFeTh2WTBSTm1MU0JkX3NlY3JldF9QUW9yZXNuU3laeWJadGRiejZwNzBCbUdPIiwicHVibGlzaGFibGVfa2V5IjoicGtfdGVzdF9EQUJLY0E2Vzh6OTc0cTdPSWY0YmJ2MVQwMEpwRmMyOUpWIn0=",
11
- });
12
-
13
- // eslint-disable-next-line
14
- onDuffelPaymentsFailedPayment((error) => console.error(error));
15
-
16
- // eslint-disable-next-line
17
- onDuffelPaymentsSuccessfulPayment(() => console.log("Payment successful"));
18
- };
@@ -1,37 +0,0 @@
1
- # duffel-components react example
2
-
3
- ## TL;DR
4
-
5
- Start on the root of the `duffel-components` repository:
6
-
7
- ```sh
8
- # build duffel-components for react env:
9
- yarn react-build
10
-
11
- # change directory to example folder
12
- cd src/examples/react-app
13
-
14
- # cleanup last install and build
15
- rm -rf node_modules && rm -rf dist
16
-
17
- # install new version
18
- yarn
19
-
20
- # build and watch example
21
- yarn build
22
-
23
- # open example
24
- open src/index.html -a "Safari"
25
- ```
26
-
27
- ## Build duffel-components
28
-
29
- First, navigate to the root folder of the duffel-components repository and run `yarn react-build` to build the package. It should output a react-dist folder on the root. This folder is the one we reference on `src/examples/react-app/package.json` dependencies under `duffel-components`
30
-
31
- ## Install dependencies
32
-
33
- Once the package is built, you can cd into this directory and run `yarn` to install all dependencies. If there are changes to `react-dist` since your last install, you'll need to `rm -rf node_modules`, otherwise the updates build will not be installed.
34
-
35
- ## Run example
36
-
37
- Finally, run `yarn dev` to build `src/examples/react-app/src/index.tsx`. This will produce `src/examples/react-app/dist` folder that is referenced by `src/examples/react-app/src/index.html`. You can then open `src/examples/react-app/src/index.html` on your browser to see the example up and running.
@@ -1,20 +0,0 @@
1
- {
2
- "name": "react-app",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "build": "esbuild src/index.tsx --bundle --outfile=dist/index.js"
7
- },
8
- "dependencies": {
9
- "@types/node": "20.2.5",
10
- "@types/react": "18.2.7",
11
- "@types/react-dom": "18.2.4",
12
- "react": "18.2.0",
13
- "react-dom": "18.2.0",
14
- "typescript": "5.0.4",
15
- "duffel-components": "../../../../duffel-components/react-dist"
16
- },
17
- "devDependencies": {
18
- "esbuild": "^0.17.19"
19
- }
20
- }
@@ -1,19 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <link
7
- rel="icon"
8
- type="image/png"
9
- sizes="96x96"
10
- href="https://duffel.com/images/favicon/favicon-96x96.png"
11
- />
12
-
13
- <script src="../dist/index.js" defer></script>
14
- <title>React app example</title>
15
- </head>
16
- <body>
17
- <main id="root"></main>
18
- </body>
19
- </html>
@@ -1,48 +0,0 @@
1
- import { DuffelAncillaries, DuffelPayments } from "duffel-components";
2
- import React from "react";
3
- import { createRoot } from "react-dom/client";
4
-
5
- const App: React.FC = () => (
6
- <div style={{ display: "grid", gridTemplateColumns: "1fr", rowGap: "2rem" }}>
7
- <h1>Duffel ancillaries component react-app example</h1>
8
-
9
- <DuffelAncillaries
10
- offer_id="fixture_off_1"
11
- services={["bags", "seats"]}
12
- passengers={[
13
- {
14
- id: "pas_0000AUde3KY1SptM6ABSfU",
15
- given_name: "Mae",
16
- family_name: "Jemison",
17
- gender: "F",
18
- title: "dr",
19
- born_on: "1956-10-17",
20
- email: "m.jemison@nasa.gov",
21
- phone_number: "+16177562626",
22
- },
23
- {
24
- id: "pas_0000AUde3KY1SptM6ABSfT",
25
- given_name: "Dorothy",
26
- family_name: "Green",
27
- gender: "F",
28
- title: "dr",
29
- born_on: "1942-10-17",
30
- },
31
- ]}
32
- // eslint-disable-next-line
33
- onPayloadReady={console.log}
34
- />
35
-
36
- <DuffelPayments
37
- paymentIntentClientToken="eyJjbGllbnRfc2VjcmV0IjoicGlfM0psczlVQWcySmhFeTh2WTBSTm1MU0JkX3NlY3JldF9QUW9yZXNuU3laeWJadGRiejZwNzBCbUdPIiwicHVibGlzaGFibGVfa2V5IjoicGtfdGVzdF9EQUJLY0E2Vzh6OTc0cTdPSWY0YmJ2MVQwMEpwRmMyOUpWIn0="
38
- onSuccessfulPayment={console.log}
39
- onFailedPayment={console.log}
40
- />
41
- </div>
42
- );
43
-
44
- const rootElement = document.getElementById("root");
45
- if (rootElement) {
46
- const root = createRoot(rootElement);
47
- root.render(<App />);
48
- }