@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
@@ -0,0 +1,8 @@
1
+ export type Order = {
2
+ id: string;
3
+ [any: string]: any;
4
+ slices: {
5
+ segments: any[];
6
+ }[];
7
+ };
8
+ export type OrderAvailableService = any;
@@ -0,0 +1,8 @@
1
+ import { Airport } from "./Airport";
2
+ import { City } from "./City";
3
+ export type Place = (Airport & {
4
+ type?: "airport";
5
+ airports?: Airport[] | null;
6
+ }) | (City & {
7
+ type?: "city";
8
+ });
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Seat maps are used to build a rich experience for your customers so they can select a seat as part of an order.
3
+ * A seat map includes the data for rendering seats in the relevant cabins, along with their total cost and other information such as disclosures.
4
+ * @link https://duffel.com/docs/api/seat-maps/schema
5
+ */
6
+ export interface SeatMap {
7
+ /**
8
+ * Duffel's unique identifier for the seat map
9
+ */
10
+ id: string;
11
+ /**
12
+ * Duffel's unique identifier for the slice. It identifies the slice of an offer (i.e. the same slice across offers will have different ids.)
13
+ */
14
+ slice_id: string;
15
+ /**
16
+ * Duffel's unique identifier for the segment. It identifies the segment of an offer (i.e. the same segment across offers will have different ids).
17
+ */
18
+ segment_id: string;
19
+ /**
20
+ * The list of cabins in this seat map.
21
+ * Cabins are ordered by deck from lowest to highest, and then within each deck from the front to back of the aircraft.
22
+ */
23
+ cabins: SeatMapCabin[];
24
+ }
25
+ export interface SeatMapCabin {
26
+ /**
27
+ * Level 0 is the main deck and level 1 is the upper deck above that, which is found on some large aircraft.
28
+ */
29
+ deck: number;
30
+ /**
31
+ * The cabin class that the passenger will travel in on this segment
32
+ */
33
+ cabin_class: string;
34
+ /**
35
+ * Where the wings of the aircraft are in relation to rows in the cabin.
36
+ * The numbers correspond to the indices of the first and the last row which are overwing. You can use this to draw a visual representation of the wings to help users get a better idea of what they will see outside their window.
37
+ * The indices are 0 th-based and are for all rows, not just those that have seats.
38
+ * This is null when no rows of the cabin are overwing.
39
+ */
40
+ wings: {
41
+ /**
42
+ * The index of the first row which is overwing, starting from the front of the aircraft.
43
+ */
44
+ first_row_index: number;
45
+ /**
46
+ * The index of the last row which is overwing, starting from the front of the aircraft.
47
+ */
48
+ last_row_index: number;
49
+ } | null;
50
+ /**
51
+ * The number of aisles in this cabin.
52
+ * If this is set to 1, each row of the cabin is split into two sections. If this is set to 2, each row of the cabin is split into three section.
53
+ */
54
+ aisles: number;
55
+ /**
56
+ * A list of rows in this cabin.
57
+ * Row sections are broken up by aisles. Rows are ordered from front to back of the aircraft.
58
+ */
59
+ rows: SeatMapCabinRow[];
60
+ }
61
+ export interface SeatMapCabinRow {
62
+ /**
63
+ * A list of sections.
64
+ * Each row is divided into sections by one or more aisles.
65
+ */
66
+ sections: SeatMapCabinRowSection[];
67
+ }
68
+ export interface SeatMapCabinRowSection {
69
+ /**
70
+ * The elements that make up this section.
71
+ */
72
+ elements: SeatMapCabinRowSectionElement[];
73
+ }
74
+ /**
75
+ * A seat for a passenger. If the available_services list is empty (which will be represented as an empty list : []), the seat is unavailable.
76
+ * For display, all seats should be displayed with the same static width.
77
+ */
78
+ export interface SeatMapCabinRowSectionElementSeat {
79
+ /**
80
+ * The type of this element.
81
+ */
82
+ type: "seat";
83
+ /**
84
+ * The designator used to uniquely identify the seat, usually made up of a row number and a column letter
85
+ */
86
+ designator: string;
87
+ /**
88
+ * A name which describes the type of seat, which you can display in your user interface to help customers to understand its features
89
+ */
90
+ name?: string;
91
+ /**
92
+ * Each disclosure is text, in English, provided by the airline that describes the terms and conditions of this seat. We recommend showing this in your user interface to make sure that customers understand any restrictions and limitations.
93
+ */
94
+ disclosures: string[];
95
+ /**
96
+ * Seats are considered a special kind of service. There will be at most one service per seat per passenger. A seat can only be booked for one passenger. If a seat has no available services (which will be represented as an empty list : []) then it's unavailable.
97
+ */
98
+ available_services: SeatMapCabinRowSectionAvailableService[];
99
+ }
100
+ export interface SeatMapCabinRowSectionAvailableService {
101
+ /**
102
+ * Duffel's unique identifier for the service
103
+ */
104
+ id: string;
105
+ /**
106
+ * The passenger that this seat is for
107
+ */
108
+ passenger_id: string;
109
+ /**
110
+ * The total price of the seat, including taxes
111
+ */
112
+ total_amount: string;
113
+ /**
114
+ * The currency of the total_amount, as an ISO 4217 currency code
115
+ */
116
+ total_currency: string;
117
+ }
118
+ /**
119
+ * A bassinet is a child's cradle. This element will be aligned with the corresponding seat in the following row.
120
+ * For display, this element should have the same width as a seat for proper alignment.
121
+ */
122
+ export interface SeatMapCabinRowSectionElementBassinet {
123
+ /**
124
+ * The type of this element.
125
+ */
126
+ type: "bassinet";
127
+ }
128
+ /**
129
+ * An empty space used for padding in some non-standard seat arrangements.
130
+ * For display, this element should have the same dimensions as a seat for proper alignment.
131
+ */
132
+ export interface SeatMapCabinRowSectionElementEmpty {
133
+ /**
134
+ * The type of this element.
135
+ */
136
+ type: "empty";
137
+ }
138
+ /**
139
+ * An exit row represents the extra wide legroom used to reach aircraft exits. There is one exit_row element per row section.
140
+ * Exit row elements only occur in their own row, so they can be displayed as one element across the whole row. Displaying an exit row element filling all available space in its section or using the same width as the seat is also reasonable.
141
+ */
142
+ export interface SeatMapCabinRowSectionElementExitRow {
143
+ /**
144
+ * The type of this element.
145
+ */
146
+ type: "exit_row";
147
+ }
148
+ /**
149
+ * A lavatory for use by passengers.
150
+ * For display, this element should ideally fill or shrink to available space in a row section. Displaying it with the same width as seat is also reasonable.
151
+ */
152
+ export interface SeatMapCabinRowSectionElementLavatory {
153
+ /**
154
+ * The type of this element.
155
+ */
156
+ type: "lavatory";
157
+ }
158
+ /**
159
+ * A galley is the compartment where food is cooked or prepared. These are conventionally marked with a teacup symbol.
160
+ * For display, this element should ideally fill or shrink to available space in a row section. Displaying it with the same width as seat is also reasonable.
161
+ */
162
+ export interface SeatMapCabinRowSectionElementGalley {
163
+ /**
164
+ * The type of this element.
165
+ */
166
+ type: "galley";
167
+ }
168
+ /**
169
+ * A closet used for storage. These are conventionally marked with a clothes hanger symbol.
170
+ * For display, this element should ideally fill or shrink to available space in a row section. Displaying it with the same width as seat is also reasonable.
171
+ */
172
+ export interface SeatMapCabinRowSectionElementCloset {
173
+ /**
174
+ * The type of this element.
175
+ */
176
+ type: "closet";
177
+ }
178
+ /**
179
+ * A set of stairs to another deck.
180
+ * For display, this element should ideally fill or shrink to available space in a row section. Displaying it with the same width as seat is also reasonable.
181
+ */
182
+ export interface SeatMapCabinRowSectionElementStairs {
183
+ /**
184
+ * The type of this element.
185
+ */
186
+ type: "stairs";
187
+ }
188
+ export type SeatMapCabinRowSectionElement = SeatMapCabinRowSectionElementSeat | SeatMapCabinRowSectionElementBassinet | SeatMapCabinRowSectionElementEmpty | SeatMapCabinRowSectionElementExitRow | SeatMapCabinRowSectionElementLavatory | SeatMapCabinRowSectionElementGalley | SeatMapCabinRowSectionElementCloset | SeatMapCabinRowSectionElementStairs;
189
+ export type SeatMapCabinRowSectionElementType = SeatMapCabinRowSectionElement["type"];
190
+ export type SeatMapCabinRowSectionElementAmenity = Exclude<SeatMapCabinRowSectionElementType, "empty" | "seat">;
@@ -1,67 +0,0 @@
1
- ---
2
- version: 2.1
3
-
4
- # Note: You can validate your config file using the Circle CLI:
5
- # https://support.circleci.com/hc/en-us/articles/360006735753-Validating-your-CircleCI-Configuration
6
-
7
- aliases:
8
- - &working_directory ~/duffel_app
9
- - &cache_directory ~/.cache/yarn
10
-
11
- executors:
12
- node-executor:
13
- working_directory: *working_directory
14
- docker:
15
- - image: cimg/node:lts
16
-
17
- commands:
18
- save_deps_cache:
19
- description: Save Yarn Package Cache
20
- steps:
21
- - save_cache:
22
- name: Save Yarn Package Cache
23
- key: v${CACHE_VERSION}-yarn-packages-{{ checksum "yarn.lock" }}
24
- paths:
25
- - *cache_directory
26
-
27
- restore_deps_cache:
28
- description: Restore Yarn Package Cache
29
- steps:
30
- - restore_cache:
31
- key: v${CACHE_VERSION}-yarn-packages-{{ checksum "yarn.lock" }}
32
- paths:
33
- - *cache_directory
34
-
35
- setup:
36
- description: Set up common system expectations
37
- steps:
38
- - checkout
39
- - restore_deps_cache
40
- - run: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
41
- - save_deps_cache
42
-
43
- jobs:
44
- lint:
45
- executor: node-executor
46
- steps:
47
- - setup
48
- - run: yarn check-types
49
- - run: yarn lint
50
- - run: yarn prettier-check
51
- build-storybook:
52
- executor: node-executor
53
- steps:
54
- - setup
55
- - run: yarn build-storybook
56
- test:
57
- executor: node-executor
58
- steps:
59
- - setup
60
- - run: yarn test
61
-
62
- workflows:
63
- build_and_test:
64
- jobs:
65
- - lint
66
- - test
67
- - build-storybook
package/.eslintrc.js DELETED
@@ -1,47 +0,0 @@
1
- module.exports = {
2
- settings: {
3
- react: {
4
- version: "detect",
5
- },
6
- },
7
- env: {
8
- browser: true,
9
- node: true,
10
- jest: true,
11
- },
12
- ignorePatterns: [
13
- "**/dist/**",
14
- "**/cdn-dist/**",
15
- "**/react-dist/**",
16
- "__generated__**",
17
- ],
18
- parser: "@typescript-eslint/parser",
19
- extends: [
20
- "eslint:recommended",
21
- "plugin:@typescript-eslint/eslint-recommended",
22
- "plugin:@typescript-eslint/recommended",
23
- "plugin:jsx-a11y/recommended",
24
- "plugin:react/recommended",
25
- "plugin:react-hooks/recommended",
26
- "prettier",
27
- "plugin:storybook/recommended",
28
- ],
29
- overrides: [],
30
- plugins: ["@typescript-eslint", "jsx-a11y", "import"],
31
- rules: {
32
- "@typescript-eslint/no-explicit-any": 0,
33
- "@typescript-eslint/no-non-null-assertion": 0,
34
- "react/display-name": 0,
35
- "react/react-in-jsx-scope": 0,
36
- "react/prop-types": 0,
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
- ],
46
- },
47
- };
@@ -1,4 +0,0 @@
1
- # See https://help.github.com/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
2
- # for more information about the format and syntax of this file
3
-
4
- * @duffelhq/ux-products
@@ -1,29 +0,0 @@
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.
@@ -1,12 +0,0 @@
1
- {
2
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
- "extends": ["config:base", "schedule:monthly", ":combinePatchMinorReleases"],
4
- "labels": ["dependencies"],
5
- "enabledManagers": ["github-actions", "npm"],
6
- "packageRules": [
7
- {
8
- "matchPackagePrefixes": ["@types", "eslint", "jest", "prettier"],
9
- "automerge": true
10
- }
11
- ]
12
- }
@@ -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
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- lts/hydrogen
package/.prettierignore DELETED
@@ -1,2 +0,0 @@
1
- dist
2
- __generated__*
@@ -1,3 +0,0 @@
1
- import initStoryshots from "@storybook/addon-storyshots";
2
-
3
- initStoryshots();