@duffel/components 2.7.19 → 3.0.0-canary

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 (325) hide show
  1. package/.circleci/config.yml +67 -0
  2. package/.eslintrc.js +34 -0
  3. package/.github/renovate.json +16 -0
  4. package/.github/workflows/autoapprove.yml +18 -0
  5. package/.github/workflows/release.yml +86 -0
  6. package/.husky/post-commit +4 -0
  7. package/.husky/pre-commit +4 -0
  8. package/.nvmrc +1 -0
  9. package/.prettierignore +2 -0
  10. package/.storybook/Storyshots.test.js +3 -0
  11. package/.storybook/__snapshots__/Storyshots.test.js.snap +48133 -0
  12. package/.storybook/main.ts +33 -0
  13. package/.storybook/preview.tsx +28 -0
  14. package/.tool-versions +1 -0
  15. package/README.md +129 -16
  16. package/__mocks__/styleMock.js +6 -0
  17. package/babel.config.js +20 -0
  18. package/commitlint.config.js +4 -0
  19. package/config/esbuild.base.config.js +14 -0
  20. package/config/esbuild.cdn.config.js +50 -0
  21. package/config/esbuild.dev.config.js +45 -0
  22. package/config/esbuild.react.config.js +42 -0
  23. package/jest.config.ts +14 -0
  24. package/package.json +123 -192
  25. package/react-dist/components/AnimatedLoaderEllipsis.d.ts +2 -0
  26. package/react-dist/components/Button.d.ts +23 -0
  27. package/react-dist/components/Card.d.ts +14 -0
  28. package/react-dist/components/Counter.d.ts +10 -0
  29. package/react-dist/components/DuffelAncillaries.d.ts +3 -0
  30. package/react-dist/components/DuffelAncillariesCustomElement.d.ts +13 -0
  31. package/react-dist/components/ErrorBoundary.d.ts +13 -0
  32. package/react-dist/components/FetchOfferErrorState.d.ts +5 -0
  33. package/react-dist/components/Icon.d.ts +44 -0
  34. package/react-dist/components/IconButton.d.ts +16 -0
  35. package/react-dist/components/Modal.d.ts +11 -0
  36. package/react-dist/components/NonIdealState.d.ts +4 -0
  37. package/react-dist/components/Stamp.d.ts +7 -0
  38. package/react-dist/components/Tabs.d.ts +16 -0
  39. package/react-dist/components/bags/BaggageSelectionCard.d.ts +11 -0
  40. package/react-dist/components/bags/BaggageSelectionController.d.ts +13 -0
  41. package/react-dist/components/bags/BaggageSelectionModal.d.ts +11 -0
  42. package/react-dist/components/bags/BaggageSelectionModalBody.d.ts +11 -0
  43. package/react-dist/components/bags/BaggageSelectionModalBodyPassenger.d.ts +13 -0
  44. package/react-dist/components/bags/BaggageSelectionModalFooter.d.ts +14 -0
  45. package/react-dist/components/bags/BaggageSelectionModalHeader.d.ts +9 -0
  46. package/react-dist/components/bags/IncludedBaggageBanner.d.ts +7 -0
  47. package/react-dist/components/cancel_for_any_reason/CfarSelectionCard.d.ts +10 -0
  48. package/react-dist/components/cancel_for_any_reason/CfarSelectionModal.d.ts +11 -0
  49. package/react-dist/components/cancel_for_any_reason/CfarSelectionModalBody.d.ts +7 -0
  50. package/react-dist/components/cancel_for_any_reason/CfarSelectionModalBodyListItem.d.ts +4 -0
  51. package/react-dist/components/cancel_for_any_reason/CfarSelectionModalFooter.d.ts +11 -0
  52. package/react-dist/components/cancel_for_any_reason/CfarSelectionModalHeader.d.ts +2 -0
  53. package/react-dist/components/seats/Amenity.d.ts +6 -0
  54. package/react-dist/components/seats/DeckSelect.d.ts +15 -0
  55. package/react-dist/components/seats/Element.d.ts +15 -0
  56. package/react-dist/components/seats/EmptyElement.d.ts +2 -0
  57. package/react-dist/components/seats/ExitElement.d.ts +6 -0
  58. package/react-dist/components/seats/Legend.d.ts +12 -0
  59. package/react-dist/components/seats/Row.d.ts +13 -0
  60. package/react-dist/components/seats/RowSection.d.ts +17 -0
  61. package/react-dist/components/seats/SeatElement.d.ts +13 -0
  62. package/react-dist/components/seats/SeatInfo.d.ts +7 -0
  63. package/react-dist/components/seats/SeatMap.d.ts +12 -0
  64. package/react-dist/components/seats/SeatMapUnavailable.d.ts +2 -0
  65. package/react-dist/components/seats/SeatSelectionCard.d.ts +13 -0
  66. package/react-dist/components/seats/SeatSelectionModal.d.ts +13 -0
  67. package/react-dist/components/seats/SeatSelectionModalBody.d.ts +4 -0
  68. package/react-dist/components/seats/SeatSelectionModalFooter.d.ts +16 -0
  69. package/react-dist/components/seats/SeatSelectionModalHeader.d.ts +10 -0
  70. package/react-dist/components/seats/SeatUnavailable.d.ts +5 -0
  71. package/react-dist/index.d.ts +8 -0
  72. package/react-dist/index.js +36 -0
  73. package/react-dist/index.js.map +7 -0
  74. package/react-dist/lib/captureErrorInSentry.d.ts +1 -0
  75. package/react-dist/lib/compileCreateOrderPayload.d.ts +14 -0
  76. package/react-dist/lib/createPriceFormatters.d.ts +12 -0
  77. package/react-dist/lib/fetchFromDuffelAPI.d.ts +1 -0
  78. package/react-dist/lib/fetchFromFixtures.d.ts +4 -0
  79. package/react-dist/lib/formatAvailableServices.d.ts +12 -0
  80. package/react-dist/lib/formatDate.d.ts +2 -0
  81. package/react-dist/lib/formatSeatMaps.d.ts +4 -0
  82. package/react-dist/lib/getBaggageServiceDescription.d.ts +2 -0
  83. package/react-dist/lib/getCabinsForSegmentAndDeck.d.ts +2 -0
  84. package/react-dist/lib/getCurrencyForSeatMaps.d.ts +10 -0
  85. package/react-dist/lib/getCurrencyForServices.d.ts +11 -0
  86. package/react-dist/lib/getFirstSeatElementMatchingCriteria.d.ts +3 -0
  87. package/react-dist/lib/getPassengerBySegmentList.d.ts +6 -0
  88. package/react-dist/lib/getPassengerInitials.d.ts +1 -0
  89. package/react-dist/lib/getPassengerMapById.d.ts +3 -0
  90. package/react-dist/lib/getPassengerName.d.ts +3 -0
  91. package/react-dist/lib/getRowNumber.d.ts +2 -0
  92. package/react-dist/lib/getSegmentList.d.ts +2 -0
  93. package/react-dist/lib/getServicePriceMapById.d.ts +3 -0
  94. package/react-dist/lib/getSymbols.d.ts +2 -0
  95. package/react-dist/lib/getTotalAmountForServices.d.ts +6 -0
  96. package/react-dist/lib/getTotalQuantity.d.ts +2 -0
  97. package/react-dist/lib/hasService.d.ts +2 -0
  98. package/react-dist/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.d.ts +3 -0
  99. package/react-dist/lib/hasWings.d.ts +2 -0
  100. package/react-dist/lib/isBaggageService.d.ts +2 -0
  101. package/react-dist/lib/isCancelForAnyReasonService.d.ts +2 -0
  102. package/react-dist/lib/isFixtureOfferId.d.ts +2 -0
  103. package/react-dist/lib/isPayloadComplete.d.ts +2 -0
  104. package/react-dist/lib/isSeatElement.d.ts +2 -0
  105. package/react-dist/lib/logging.d.ts +53 -0
  106. package/react-dist/lib/moneyStringFormatter.d.ts +8 -0
  107. package/react-dist/lib/offerIsExpired.d.ts +2 -0
  108. package/react-dist/lib/retrieveOffer.d.ts +2 -0
  109. package/react-dist/lib/retrieveOfferFromDuffelAPI.d.ts +1 -0
  110. package/react-dist/lib/retrieveSeatMaps.d.ts +2 -0
  111. package/react-dist/lib/retrieveSeatMapsFromDuffelAPI.d.ts +1 -0
  112. package/react-dist/lib/setBodyScrollability.d.ts +1 -0
  113. package/react-dist/lib/validateProps.d.ts +7 -0
  114. package/react-dist/lib/withPlural.d.ts +1 -0
  115. package/react-dist/types/Aircraft.d.ts +14 -0
  116. package/react-dist/types/Airline.d.ts +14 -0
  117. package/react-dist/types/Airport.d.ts +44 -0
  118. package/react-dist/types/City.d.ts +18 -0
  119. package/react-dist/types/CreateOrderPayload.d.ts +72 -0
  120. package/react-dist/types/CurrencyConversion.d.ts +10 -0
  121. package/react-dist/types/DuffelAncillariesProps.d.ts +70 -0
  122. package/react-dist/types/Offer.d.ts +711 -0
  123. package/react-dist/types/Order.d.ts +8 -0
  124. package/react-dist/types/Place.d.ts +8 -0
  125. package/react-dist/types/SeatMap.d.ts +190 -0
  126. package/react-dist/types/index.d.ts +11 -0
  127. package/scripts/generate-fixture.ts +195 -0
  128. package/scripts/upload-to-cdn.sh +39 -0
  129. package/scripts.tsconfig.json +11 -0
  130. package/src/components/AnimatedLoaderEllipsis.tsx +5 -0
  131. package/src/components/Button.tsx +62 -0
  132. package/src/components/Card.tsx +126 -0
  133. package/src/components/Counter.tsx +40 -0
  134. package/src/components/DuffelAncillaries.tsx +346 -0
  135. package/src/components/DuffelAncillariesCustomElement.tsx +124 -0
  136. package/src/components/ErrorBoundary.tsx +54 -0
  137. package/src/components/FetchOfferErrorState.tsx +35 -0
  138. package/src/components/Icon.tsx +151 -0
  139. package/src/components/IconButton.tsx +42 -0
  140. package/src/components/Modal.tsx +36 -0
  141. package/src/components/NonIdealState.tsx +28 -0
  142. package/src/components/Stamp.tsx +29 -0
  143. package/src/components/Tabs.tsx +36 -0
  144. package/src/components/bags/BaggageSelectionCard.tsx +96 -0
  145. package/src/components/bags/BaggageSelectionController.tsx +88 -0
  146. package/src/components/bags/BaggageSelectionModal.tsx +81 -0
  147. package/src/components/bags/BaggageSelectionModalBody.tsx +60 -0
  148. package/src/components/bags/BaggageSelectionModalBodyPassenger.tsx +122 -0
  149. package/src/components/bags/BaggageSelectionModalFooter.tsx +81 -0
  150. package/src/components/bags/BaggageSelectionModalHeader.tsx +76 -0
  151. package/src/components/bags/IncludedBaggageBanner.tsx +51 -0
  152. package/src/components/cancel_for_any_reason/CfarSelectionCard.tsx +90 -0
  153. package/src/components/cancel_for_any_reason/CfarSelectionModal.tsx +63 -0
  154. package/src/components/cancel_for_any_reason/CfarSelectionModalBody.tsx +56 -0
  155. package/src/components/cancel_for_any_reason/CfarSelectionModalBodyListItem.tsx +11 -0
  156. package/src/components/cancel_for_any_reason/CfarSelectionModalFooter.tsx +74 -0
  157. package/src/components/cancel_for_any_reason/CfarSelectionModalHeader.tsx +9 -0
  158. package/src/components/seats/Amenity.tsx +21 -0
  159. package/src/components/seats/DeckSelect.tsx +27 -0
  160. package/src/components/seats/Element.tsx +52 -0
  161. package/src/components/seats/EmptyElement.tsx +5 -0
  162. package/src/components/seats/ExitElement.tsx +17 -0
  163. package/src/components/seats/Legend.tsx +60 -0
  164. package/src/components/seats/Row.tsx +47 -0
  165. package/src/components/seats/RowSection.tsx +75 -0
  166. package/src/components/seats/SeatElement.tsx +120 -0
  167. package/src/components/seats/SeatInfo.tsx +32 -0
  168. package/src/components/seats/SeatMap.tsx +81 -0
  169. package/src/components/seats/SeatMapUnavailable.tsx +21 -0
  170. package/src/components/seats/SeatSelectionCard.tsx +103 -0
  171. package/src/components/seats/SeatSelectionModal.tsx +142 -0
  172. package/src/components/seats/SeatSelectionModalBody.tsx +13 -0
  173. package/src/components/seats/SeatSelectionModalFooter.tsx +82 -0
  174. package/src/components/seats/SeatSelectionModalHeader.tsx +87 -0
  175. package/src/components/seats/SeatUnavailable.tsx +14 -0
  176. package/src/examples/client-side/index.html +57 -0
  177. package/src/examples/full-stack/index.html +48 -0
  178. package/src/examples/full-stack/server.mjs +157 -0
  179. package/src/examples/just-typescript/README.md +37 -0
  180. package/src/examples/just-typescript/package.json +16 -0
  181. package/src/examples/just-typescript/src/index.html +23 -0
  182. package/src/examples/just-typescript/src/index.ts +35 -0
  183. package/src/examples/just-typescript/yarn.lock +154 -0
  184. package/src/examples/react-app/README.md +37 -0
  185. package/src/examples/react-app/package.json +20 -0
  186. package/src/examples/react-app/src/index.html +19 -0
  187. package/src/examples/react-app/src/index.tsx +43 -0
  188. package/src/examples/react-app/yarn.lock +219 -0
  189. package/src/fixtures/offers/off_0000AUde3KwTztSRK1cznH.json +497 -0
  190. package/src/fixtures/offers/off_0000AVx4lUFFKW8PsPeQeQ.json +307 -0
  191. package/src/fixtures/offers/off_1.json +497 -0
  192. package/src/fixtures/passengers/mock_passengers.ts +26 -0
  193. package/src/fixtures/seat-maps/off_0000AUde3KwTztSRK1cznH.json +6852 -0
  194. package/src/fixtures/seat-maps/off_0000AVx4lUFFKW8PsPeQeQ.json +1 -0
  195. package/src/fixtures/seat-maps/off_1.json +6852 -0
  196. package/src/index.ts +8 -0
  197. package/src/lib/captureErrorInSentry.ts +60 -0
  198. package/src/lib/compileCreateOrderPayload.ts +63 -0
  199. package/src/lib/createPriceFormatters.ts +73 -0
  200. package/src/lib/fetchFromDuffelAPI.ts +24 -0
  201. package/src/lib/fetchFromFixtures.ts +18 -0
  202. package/src/lib/formatAvailableServices.ts +91 -0
  203. package/src/lib/formatDate.ts +21 -0
  204. package/src/lib/formatSeatMaps.ts +81 -0
  205. package/src/lib/getBaggageServiceDescription.ts +44 -0
  206. package/src/lib/getCabinsForSegmentAndDeck.ts +4 -0
  207. package/src/lib/getCurrencyForSeatMaps.ts +22 -0
  208. package/src/lib/getCurrencyForServices.ts +24 -0
  209. package/src/lib/getFirstSeatElementMatchingCriteria.ts +22 -0
  210. package/src/lib/getPassengerBySegmentList.ts +10 -0
  211. package/src/lib/getPassengerInitials.ts +6 -0
  212. package/src/lib/getPassengerMapById.ts +17 -0
  213. package/src/lib/getPassengerName.ts +37 -0
  214. package/src/lib/getRowNumber.ts +16 -0
  215. package/src/lib/getSegmentList.ts +7 -0
  216. package/src/lib/getServicePriceMapById.ts +20 -0
  217. package/src/lib/getSymbols.ts +22 -0
  218. package/src/lib/getTotalAmountForServices.ts +72 -0
  219. package/src/lib/getTotalQuantity.ts +5 -0
  220. package/src/lib/hasService.ts +24 -0
  221. package/src/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.ts +35 -0
  222. package/src/lib/hasWings.ts +8 -0
  223. package/src/lib/isBaggageService.ts +8 -0
  224. package/src/lib/isCancelForAnyReasonService.ts +9 -0
  225. package/src/lib/isFixtureOfferId.ts +4 -0
  226. package/src/lib/isPayloadComplete.ts +11 -0
  227. package/src/lib/isSeatElement.ts +10 -0
  228. package/src/lib/logging.ts +100 -0
  229. package/src/lib/moneyStringFormatter.ts +34 -0
  230. package/src/lib/offerIsExpired.ts +5 -0
  231. package/src/lib/retrieveOffer.ts +49 -0
  232. package/src/lib/retrieveOfferFromDuffelAPI.ts +13 -0
  233. package/src/lib/retrieveSeatMaps.ts +50 -0
  234. package/src/lib/retrieveSeatMapsFromDuffelAPI.ts +13 -0
  235. package/src/lib/setBodyScrollability.ts +7 -0
  236. package/src/lib/validateProps.ts +37 -0
  237. package/src/lib/withPlural.ts +8 -0
  238. package/src/stories/BaggageSelectionModalHeader.stories.tsx +21 -0
  239. package/src/stories/Button.stories.tsx +60 -0
  240. package/src/stories/DuffelAncillaries.stories.tsx +126 -0
  241. package/src/stories/Icon.stories.tsx +34 -0
  242. package/src/stories/IconButton.stories.tsx +25 -0
  243. package/src/styles/colors.css +22 -0
  244. package/src/styles/components/Amenity.css +23 -0
  245. package/src/styles/components/BaggageDisplay.css +25 -0
  246. package/src/styles/components/Button.css +161 -0
  247. package/src/styles/components/Card.css +52 -0
  248. package/src/styles/components/CfarSelectionModal.css +34 -0
  249. package/src/styles/components/Counter.css +18 -0
  250. package/src/styles/components/IconButton.css +63 -0
  251. package/src/styles/components/Legend.css +58 -0
  252. package/src/styles/components/Loader.css +37 -0
  253. package/src/styles/components/LoadingState.css +81 -0
  254. package/src/styles/components/Modal.css +83 -0
  255. package/src/styles/components/PassengerSelect.css +93 -0
  256. package/src/styles/components/PassengersLayout.css +90 -0
  257. package/src/styles/components/Row.css +70 -0
  258. package/src/styles/components/Seat.css +57 -0
  259. package/src/styles/components/SeatInfo.css +61 -0
  260. package/src/styles/components/SeatMap.css +24 -0
  261. package/src/styles/components/SeatSelect.css +92 -0
  262. package/src/styles/components/Segment.css +17 -0
  263. package/src/styles/components/SelectionSegment.css +10 -0
  264. package/src/styles/components/Summary.css +70 -0
  265. package/src/styles/components/Tabs.css +49 -0
  266. package/src/styles/flex.css +5 -0
  267. package/src/styles/font-families.css +47 -0
  268. package/src/styles/global.css +50 -0
  269. package/src/styles/margin.css +3 -0
  270. package/src/styles/spacing.css +18 -0
  271. package/src/styles/transitions.css +3 -0
  272. package/src/styles/typography.css +13 -0
  273. package/src/tests/components/DuffelAncillaries.test.tsx +342 -0
  274. package/src/tests/lib/createPriceFormatters.test.tsx +152 -0
  275. package/src/tests/lib/formatAvailableServices.test.tsx +79 -0
  276. package/src/tests/lib/formatSeatMaps.test.tsx +49 -0
  277. package/src/tests/lib/getCurrencyForServices.test.tsx +44 -0
  278. package/src/tests/lib/hasServiceOfSameMetadataTypeAlreadyBeenSelected.test.ts +86 -0
  279. package/src/tests/lib/logging.test.tsx +32 -0
  280. package/src/tests/lib/moneyStringFormatter.test.tsx +12 -0
  281. package/src/tests/lib/validateProps.test.tsx +57 -0
  282. package/src/types/Aircraft.ts +16 -0
  283. package/src/types/Airline.ts +16 -0
  284. package/src/types/Airport.ts +54 -0
  285. package/src/types/City.ts +21 -0
  286. package/src/types/CreateOrderPayload.ts +99 -0
  287. package/src/types/CurrencyConversion.ts +10 -0
  288. package/src/types/DuffelAncillariesProps.ts +108 -0
  289. package/src/types/Offer.ts +851 -0
  290. package/src/types/Order.ts +6 -0
  291. package/src/types/Place.ts +6 -0
  292. package/src/types/SeatMap.ts +231 -0
  293. package/src/types/index.ts +11 -0
  294. package/tsconfig.json +52 -0
  295. package/LICENSE +0 -21
  296. package/dist/AdditionalBaggage.esm.js +0 -1
  297. package/dist/AdditionalBaggage.js +0 -1
  298. package/dist/AdditionalBaggage.min.css +0 -408
  299. package/dist/AdditionalBaggage.umd.min.js +0 -2
  300. package/dist/AdditionalBaggage.umd.min.js.LICENSE.txt +0 -60
  301. package/dist/AdditionalBaggageSelection.esm.js +0 -1
  302. package/dist/AdditionalBaggageSelection.js +0 -1
  303. package/dist/AdditionalBaggageSelection.min.css +0 -744
  304. package/dist/AdditionalBaggageSelection.umd.min.js +0 -2
  305. package/dist/AdditionalBaggageSelection.umd.min.js.LICENSE.txt +0 -93
  306. package/dist/CardPayment.esm.js +0 -2
  307. package/dist/CardPayment.esm.js.LICENSE.txt +0 -6
  308. package/dist/CardPayment.js +0 -2
  309. package/dist/CardPayment.js.LICENSE.txt +0 -6
  310. package/dist/CardPayment.min.css +0 -233
  311. package/dist/CardPayment.umd.min.js +0 -2
  312. package/dist/CardPayment.umd.min.js.LICENSE.txt +0 -61
  313. package/dist/SeatSelection.esm.js +0 -1
  314. package/dist/SeatSelection.js +0 -1
  315. package/dist/SeatSelection.min.css +0 -1127
  316. package/dist/SeatSelection.umd.min.js +0 -2
  317. package/dist/SeatSelection.umd.min.js.LICENSE.txt +0 -60
  318. package/dist/duffel-components.d.ts +0 -1614
  319. package/dist/duffel-components.esm.js +0 -2
  320. package/dist/duffel-components.esm.js.LICENSE.txt +0 -6
  321. package/dist/duffel-components.js +0 -2
  322. package/dist/duffel-components.js.LICENSE.txt +0 -6
  323. package/dist/duffel-components.min.css +0 -1280
  324. package/dist/duffel-components.umd.min.js +0 -2
  325. package/dist/duffel-components.umd.min.js.LICENSE.txt +0 -102
package/package.json CHANGED
@@ -1,221 +1,152 @@
1
1
  {
2
2
  "name": "@duffel/components",
3
- "version": "2.7.19",
4
- "description": "Set of pre-built UI components for integrating with Duffel API",
5
- "main": "dist/duffel-components.js",
6
- "module": "dist/duffel-components.esm.js",
7
- "jsnext:main": "dist/duffel-components.esm.js",
8
- "unpkg": "dist/duffel-components.umd.js",
9
- "unpkg:min": "dist/duffel-components.umd.min.js",
10
- "types": "dist/duffel-components.d.ts",
3
+ "version": "3.0.0-canary",
4
+ "private": false,
5
+ "license": "MIT",
6
+ "main": "react-dist/index.js",
11
7
  "scripts": {
12
- "prebuild": "node -p \"'export const DUFFEL_COMPONENTS_VERSION = ' + JSON.stringify(require('./package.json').version) + ''\" > ./src/version.ts && yarn prettier",
13
- "build": "webpack --mode production --config webpack.config.babel.js && yarn create-dts",
14
- "lint": "eslint . --ext .ts,.tsx",
15
- "test": "jest",
16
- "pre-commit-check": "yarn lint-staged && yarn test --passWithNoTests && yarn build && yarn e2e",
8
+ "precdn-build": "rm -rf ./cdn-dist",
9
+ "cdn-build": "node config/esbuild.cdn.config.js",
10
+ "build-storybook": "storybook build",
11
+ "check-types": "tsc --project tsconfig.json --noEmit --emitDeclarationOnly false",
12
+ "dev": "node config/esbuild.dev.config.js",
13
+ "generate-fixture": "esbuild ./scripts/generate-fixture.ts --outfile=dist/scripts/generate-fixture.cjs --format=cjs --platform=node --bundle --tsconfig=scripts.tsconfig.json",
14
+ "postgenerate-fixture": "node dist/scripts/generate-fixture.cjs",
15
+ "generate-type-declarations": "tsc --project tsconfig.json",
16
+ "commit": "cz",
17
+ "lint": "eslint . --ext .ts,.tsx,.mjs,.js --max-warnings=0",
18
+ "pre-commit-check": "concurrently --raw \"yarn check-types\" \"yarn lint-staged\"",
19
+ "post-commit-check": "yarn commitlint --from main",
17
20
  "prepare": "husky install",
18
- "get-version": "echo $npm_package_version",
19
- "release": "npx semantic-release --debug",
20
- "commit": "git-cz",
21
- "commitlint": "commitlint",
22
- "storybook": "start-storybook -p 6006",
23
- "build-storybook": "build-storybook",
24
- "chromatic": "npx chromatic",
25
- "create-dts": "dts-bundle-generator -o dist/duffel-components.d.ts src/index.ts --no-check",
26
- "server": "http-server -p 1234",
27
- "e2e": "npx playwright test",
28
- "e2e:debug": "PWDEBUG=1 npx playwright test",
29
21
  "prettier": "prettier --write --loglevel=warn .",
30
22
  "prettier-check": "prettier --check .",
31
- "local-package:update": "yarn build && yalc push --replace --changed",
32
- "local-package:clean": "yalc installations clean @duffel/components"
23
+ "prereact-build": "rm -rf ./react-dist",
24
+ "react-build": "node config/esbuild.react.config.js",
25
+ "postreact-build": "yarn generate-type-declarations",
26
+ "run-client-side-server": "http-server src/examples/client-side --port=6262",
27
+ "run-example:client-side": "concurrently \"yarn dev\" \"yarn run-client-side-server\"",
28
+ "run-example:full-stack": "concurrently \"yarn dev\" \"yarn run-full-stack-server\"",
29
+ "run-full-stack-server": "node src/examples/full-stack/server.mjs",
30
+ "storybook": "storybook dev -p 6006",
31
+ "test": "LANG='en_US' TZ=UTC yarn jest",
32
+ "preupload-to-cdn": "yarn cdn-build",
33
+ "upload-to-cdn": "bash ./scripts/upload-to-cdn.sh",
34
+ "prerelease": "yarn react-build",
35
+ "release": "yarn semantic-release",
36
+ "get-version": "cat package.json | jq '.version'"
33
37
  },
34
- "config": {
35
- "commitizen": {
36
- "path": "@commitlint/cz-commitlint"
38
+ "husky": {
39
+ "hooks": {
40
+ "pre-commit": "yarn pre-commit-check",
41
+ "post-commit": "yarn post-commit"
37
42
  }
38
43
  },
39
44
  "lint-staged": {
40
- "*.{ts,tsx}": [
41
- "eslint",
42
- "prettier --write"
43
- ],
44
- "*.{js,jsx,md,yml,yaml}": [
45
+ "*.{ts,tsx,mjs,js}": [
46
+ "eslint --fix",
45
47
  "prettier --write"
46
48
  ]
47
49
  },
48
- "files": [
49
- "dist/**"
50
- ],
51
- "peerDependencies": {
52
- "react": "^16.8.0 || ^17 || ^18",
53
- "react-dom": "^16.8.0 || ^17 || ^18"
54
- },
55
50
  "dependencies": {
56
- "@popperjs/core": "2.11.8",
57
- "@stripe/react-stripe-js": "1.8.0",
58
- "@stripe/stripe-js": "^1.35.0",
59
- "base64-js": "1.5.1",
60
- "classnames": "2.3.2",
61
- "decimal.js": "^10.4.3",
62
- "ieee754": "1.2.1",
63
- "prop-types": "15.8.1",
64
- "react-popper": "2.2.5",
65
- "smoothscroll-polyfill": "0.4.4"
51
+ "@sentry/browser": "^7.43.0",
52
+ "classnames": "^2.3.2",
53
+ "react": "18.2.0",
54
+ "react-dom": "18.2.0"
66
55
  },
67
56
  "devDependencies": {
68
- "@babel/core": "7.21.4",
69
- "@babel/plugin-proposal-class-properties": "7.18.6",
70
- "@babel/plugin-proposal-unicode-property-regex": "7.18.6",
71
- "@babel/preset-env": "7.21.4",
72
- "@babel/preset-react": "7.18.6",
73
- "@babel/register": "7.21.0",
74
- "@commitlint/cli": "17.4.4",
75
- "@commitlint/config-angular": "17.4.4",
76
- "@commitlint/cz-commitlint": "17.4.4",
77
- "@playwright/test": "1.31.2",
78
- "@semantic-release/changelog": "6.0.3",
79
- "@semantic-release/commit-analyzer": "9.0.2",
80
- "@semantic-release/git": "10.0.1",
81
- "@storybook/addon-actions": "6.5.16",
82
- "@storybook/addon-controls": "6.5.16",
83
- "@storybook/addon-essentials": "6.5.16",
84
- "@storybook/addon-links": "6.5.16",
85
- "@storybook/addon-postcss": "2.0.0",
86
- "@storybook/builder-webpack5": "6.5.16",
87
- "@storybook/manager-webpack5": "6.5.16",
88
- "@storybook/react": "6.5.16",
89
- "@testing-library/jest-dom": "5.16.5",
90
- "@testing-library/react": "13.4.0",
91
- "@types/jest": "27.5.2",
92
- "@types/lodash": "4.14.195",
93
- "@types/node": "17.0.42",
94
- "@types/react": "18.0.34",
95
- "@types/react-dom": "18.0.11",
96
- "@types/smoothscroll-polyfill": "0.3.1",
97
- "@typescript-eslint/eslint-plugin": "5.36.1",
98
- "@typescript-eslint/parser": "5.36.1",
99
- "babel-loader": "8.3.0",
100
- "babel-plugin-module-resolver": "4.1.0",
101
- "chromatic": "6.7.4",
102
- "clean-webpack-plugin": "4.0.0",
103
- "commitizen": "4.2.6",
104
- "css-loader": "6.7.3",
105
- "dotenv": "16.0.3",
106
- "dts-bundle-generator": "6.12.0",
107
- "eslint": "8.22.0",
108
- "eslint-config-prettier": "8.5.0",
109
- "eslint-plugin-react-hooks": "4.6.0",
110
- "eslint-plugin-spellcheck": "0.0.20",
111
- "eslint-plugin-storybook": "0.6.11",
112
- "fork-ts-checker-webpack-plugin": "7.2.14",
113
- "http-server": "14.1.1",
114
- "husky": "8.0.3",
115
- "inquirer": "9.1.4",
116
- "jest": "26.6.3",
117
- "lint-staged": "13.0.3",
118
- "lodash": "4.17.21",
119
- "mini-css-extract-plugin": "2.6.1",
120
- "node-polyfill-webpack-plugin": "2.0.1",
121
- "postcss": "8.4.21",
122
- "postcss-combine-duplicated-selectors": "10.0.3",
123
- "postcss-discard-duplicates": "5.1.0",
124
- "postcss-import": "14.1.0",
125
- "postcss-loader": "7.0.2",
126
- "postcss-nested": "5.0.6",
127
- "prettier": "2.7.1",
128
- "react": "18.2.0",
129
- "react-dom": "18.2.0",
130
- "semantic-release": "19.0.5",
131
- "ts-jest": "26.5.6",
132
- "ts-loader": "9.3.1",
133
- "ts-node": "10.9.1",
134
- "tslib": "2.4.0",
135
- "types-webpack-bundler": "1.0.2",
136
- "typescript": "4.7.4",
137
- "webpack": "5.76.0",
138
- "webpack-cli": "4.10.0",
139
- "webpack-node-externals": "3.0.0"
57
+ "@babel/core": "^7.21.4",
58
+ "@babel/preset-env": "^7.21.4",
59
+ "@babel/preset-react": "^7.18.6",
60
+ "@babel/preset-typescript": "^7.21.4",
61
+ "@commitlint/cli": "^17.6.5",
62
+ "@commitlint/config-conventional": "^17.6.5",
63
+ "@duffel/api": "^1.26.0",
64
+ "@sentry/esbuild-plugin": "^0.7.0",
65
+ "@storybook/addon-essentials": "^7.0.2",
66
+ "@storybook/addon-interactions": "^7.0.2",
67
+ "@storybook/addon-links": "^7.0.2",
68
+ "@storybook/addon-storyshots": "^7.0.4",
69
+ "@storybook/blocks": "^7.0.2",
70
+ "@storybook/react": "^7.0.2",
71
+ "@storybook/react-webpack5": "^7.0.2",
72
+ "@storybook/testing-library": "^0.1.0",
73
+ "@testing-library/react": "^14.0.0",
74
+ "@types/jest": "^29.5.0",
75
+ "@types/node": "^18.15.11",
76
+ "@types/prompts": "^2.4.4",
77
+ "@types/react": "^18.0.32",
78
+ "@types/react-dom": "^18.0.11",
79
+ "@typescript-eslint/eslint-plugin": "^5.43.0",
80
+ "@typescript-eslint/parser": "^5.57.0",
81
+ "babel-jest": "^29.5.0",
82
+ "commitizen": "^4.3.0",
83
+ "concurrently": "^8.0.0",
84
+ "cz-conventional-changelog": "^3.3.0",
85
+ "dotenv": "^16.0.3",
86
+ "esbuild": "0.17.19",
87
+ "esbuild-copy-static-files": "^0.1.0",
88
+ "eslint": "^8.0.1",
89
+ "eslint-config-prettier": "^8.8.0",
90
+ "eslint-plugin-import": "^2.25.2",
91
+ "eslint-plugin-jsx-a11y": "^6.7.1",
92
+ "eslint-plugin-react": "^7.32.2",
93
+ "eslint-plugin-react-hooks": "^4.6.0",
94
+ "eslint-plugin-storybook": "^0.6.11",
95
+ "http-server": "^14.1.1",
96
+ "husky": "^8.0.3",
97
+ "jest": "^29.5.0",
98
+ "jest-environment-jsdom": "^29.5.0",
99
+ "lint-staged": "^13.2.0",
100
+ "prettier": "^2.8.7",
101
+ "prettier-plugin-organize-imports": "^3.2.2",
102
+ "prompts": "^2.4.2",
103
+ "prop-types": "^15.8.1",
104
+ "semantic-release": "^21.0.3",
105
+ "storybook": "^7.0.2",
106
+ "ts-node": "^10.9.1",
107
+ "tsconfig-paths-webpack-plugin": "^4.0.1",
108
+ "typescript": "5.0.4"
140
109
  },
141
110
  "engines": {
142
- "node": ">=14.*"
111
+ "node": "~18.*"
112
+ },
113
+ "config": {
114
+ "commitizen": {
115
+ "path": "./node_modules/cz-conventional-changelog"
116
+ }
143
117
  },
118
+ "plugins": [
119
+ [
120
+ "@semantic-release/commit-analyzer"
121
+ ],
122
+ [
123
+ "@semantic-release/release-notes-generator"
124
+ ],
125
+ "@semantic-release/npm",
126
+ "@semantic-release/github"
127
+ ],
144
128
  "release": {
145
129
  "branches": [
146
- {
147
- "name": "main"
148
- }
149
- ],
150
- "plugins": [
151
- [
152
- "@semantic-release/commit-analyzer",
153
- {
154
- "preset": "angular",
155
- "releaseRules": [
156
- {
157
- "type": "docs",
158
- "scope": "readme",
159
- "release": "patch"
160
- },
161
- {
162
- "type": "refactor",
163
- "release": "patch"
164
- },
165
- {
166
- "breaking": true,
167
- "release": "major"
168
- },
169
- {
170
- "type": "build",
171
- "scope": "deps",
172
- "release": "patch"
173
- }
174
- ]
175
- }
176
- ],
177
- [
178
- "@semantic-release/release-notes-generator"
179
- ],
180
- [
181
- "@semantic-release/git",
182
- {
183
- "assets": [
184
- "CHANGELOG.md"
185
- ]
186
- }
187
- ],
188
- "@semantic-release/npm",
189
- "@semantic-release/github"
130
+ "main"
190
131
  ]
191
132
  },
192
- "resolutions": {
193
- "@types/webpack": "^5.28.0",
194
- "immer": "^9.0.6",
195
- "ansi-regex": "^5.0.1",
196
- "glob-parent": "^6.0.0",
197
- "browserslist": "^4.16.5",
198
- "trim": "^1.0.0",
199
- "@types/react-dom": "18.0.11",
200
- "@types/react": "18.0.34",
201
- "loader-utils": "^2.0.4"
133
+ "description": "## What is this?",
134
+ "repository": {
135
+ "type": "git",
136
+ "url": "git+https://github.com/duffelhq/duffel-checkout.git"
202
137
  },
203
138
  "keywords": [
139
+ "Duffel",
140
+ "ancillaries",
141
+ "seats",
204
142
  "seat",
205
- "maps",
206
- "seat",
207
- "selection",
208
- "seat",
209
- "selections",
210
- "duffel",
211
- "duffelhq",
212
- "seat",
213
- "seatmap",
214
- "payment",
215
- "payments",
143
+ "map",
216
144
  "baggage",
217
- "baggages"
145
+ "travel"
218
146
  ],
219
- "author": "Duffel Technology Limited <help@duffel.com> (http://duffel.com)",
220
- "license": "MIT"
147
+ "author": "duffel.com",
148
+ "bugs": {
149
+ "url": "https://github.com/duffelhq/duffel-checkout/issues"
150
+ },
151
+ "homepage": "https://github.com/duffelhq/duffel-checkout#readme"
221
152
  }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ export declare const AnimatedLoaderEllipsis: React.FC;
@@ -0,0 +1,23 @@
1
+ import { IconName } from "@components/Icon";
2
+ import * as React from "react";
3
+ declare const BUTTON_VARIANTS: {
4
+ primary: string;
5
+ outlined: string;
6
+ destructive: string;
7
+ };
8
+ type ButtonVariants = keyof typeof BUTTON_VARIANTS;
9
+ declare const BUTTON_SIZES: {
10
+ 32: string;
11
+ 40: string;
12
+ 48: string;
13
+ };
14
+ type ButtonSizes = keyof typeof BUTTON_SIZES;
15
+ type NativeButtonProps = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
16
+ export interface ButtonProps extends Pick<NativeButtonProps, "id" | "onClick" | "disabled" | "children" | "className"> {
17
+ "data-testid"?: string;
18
+ iconBefore?: IconName;
19
+ variant?: ButtonVariants;
20
+ size?: ButtonSizes;
21
+ }
22
+ export declare const Button: React.FC<ButtonProps>;
23
+ export {};
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { IconName } from "./Icon";
3
+ export interface CardProps {
4
+ buttonTitle: string;
5
+ title: string;
6
+ icon: IconName;
7
+ onClick?: (() => void) | null;
8
+ children: React.ReactNode;
9
+ copy: string;
10
+ isLoading?: boolean;
11
+ disabled?: boolean;
12
+ isSelected?: boolean;
13
+ }
14
+ export declare const Card: React.FC<CardProps>;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ interface CounterProps {
3
+ id: string;
4
+ min: number;
5
+ max: number;
6
+ value: number;
7
+ onChange: (value: number) => void;
8
+ }
9
+ export declare const Counter: React.FC<CounterProps>;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ import { DuffelAncillariesProps } from "../types/DuffelAncillariesProps";
3
+ export declare const DuffelAncillaries: React.FC<DuffelAncillariesProps>;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { DuffelAncillariesPropsWithClientKeyAndOfferId, DuffelAncillariesPropsWithOfferIdForFixture, DuffelAncillariesPropsWithOffersAndSeatMaps, DuffelAncillariesPropWithOfferAndClientKey, OnPayloadReady } from "../types/DuffelAncillariesProps";
3
+ declare global {
4
+ namespace JSX {
5
+ interface IntrinsicElements {
6
+ "duffel-ancillaries": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
7
+ }
8
+ }
9
+ }
10
+ type DuffelAncillariesCustomElementRenderArguments = Omit<DuffelAncillariesPropsWithOfferIdForFixture, "onPayloadReady"> | Omit<DuffelAncillariesPropsWithClientKeyAndOfferId, "onPayloadReady"> | Omit<DuffelAncillariesPropWithOfferAndClientKey, "onPayloadReady"> | Omit<DuffelAncillariesPropsWithOffersAndSeatMaps, "onPayloadReady">;
11
+ export declare function renderDuffelAncillariesCustomElement(props: DuffelAncillariesCustomElementRenderArguments): void;
12
+ export declare function onDuffelAncillariesPayloadReady(onPayloadReady: OnPayloadReady): void;
13
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export declare class ErrorBoundary extends React.Component<{
3
+ children: React.ReactNode | React.ReactNode[];
4
+ }> {
5
+ state: {
6
+ hasError: boolean;
7
+ };
8
+ static getDerivedStateFromError(): {
9
+ hasError: boolean;
10
+ };
11
+ componentDidCatch(error: Error, context: Record<any, any>): void;
12
+ render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
13
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ export declare const FetchOfferErrorState: React.FC<{
3
+ height: string;
4
+ message: string;
5
+ }>;
@@ -0,0 +1,44 @@
1
+ import * as React from "react";
2
+ export declare const ICON_MAP: {
3
+ add: import("react/jsx-runtime").JSX.Element;
4
+ arrow_forward: import("react/jsx-runtime").JSX.Element;
5
+ arrow_left: import("react/jsx-runtime").JSX.Element;
6
+ arrow_right: import("react/jsx-runtime").JSX.Element;
7
+ autorenew: import("react/jsx-runtime").JSX.Element;
8
+ bassinet: import("react/jsx-runtime").JSX.Element;
9
+ cabin_bag: import("react/jsx-runtime").JSX.Element;
10
+ check: import("react/jsx-runtime").JSX.Element;
11
+ checked_bag: import("react/jsx-runtime").JSX.Element;
12
+ chevron: import("react/jsx-runtime").JSX.Element;
13
+ close: import("react/jsx-runtime").JSX.Element;
14
+ closet: import("react/jsx-runtime").JSX.Element;
15
+ exit_row: import("react/jsx-runtime").JSX.Element;
16
+ exit_row_right: import("react/jsx-runtime").JSX.Element;
17
+ expand_content: import("react/jsx-runtime").JSX.Element;
18
+ flight_class: import("react/jsx-runtime").JSX.Element;
19
+ galley: import("react/jsx-runtime").JSX.Element;
20
+ lavatory: import("react/jsx-runtime").JSX.Element;
21
+ lie_flat_seat: import("react/jsx-runtime").JSX.Element;
22
+ minus: import("react/jsx-runtime").JSX.Element;
23
+ no_airplane: import("react/jsx-runtime").JSX.Element;
24
+ no_bag: import("react/jsx-runtime").JSX.Element;
25
+ no_seat: import("react/jsx-runtime").JSX.Element;
26
+ north_east: import("react/jsx-runtime").JSX.Element;
27
+ seat: import("react/jsx-runtime").JSX.Element;
28
+ seat_paid_indicator: import("react/jsx-runtime").JSX.Element;
29
+ shield_with_moon: import("react/jsx-runtime").JSX.Element;
30
+ stairs: import("react/jsx-runtime").JSX.Element;
31
+ wifi: import("react/jsx-runtime").JSX.Element;
32
+ };
33
+ export type IconName = keyof typeof ICON_MAP;
34
+ interface IconProps {
35
+ name: IconName;
36
+ className?: string;
37
+ size?: number;
38
+ onClick?: (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
39
+ ml?: string;
40
+ viewBox?: string;
41
+ style?: React.CSSProperties;
42
+ }
43
+ export declare const Icon: React.FunctionComponent<IconProps>;
44
+ export {};
@@ -0,0 +1,16 @@
1
+ import { IconName } from "@components/Icon";
2
+ import * as React from "react";
3
+ declare const ICON_BUTTON_VARIANTS: {
4
+ primary: string;
5
+ outlined: string;
6
+ };
7
+ type IconButtonVariants = keyof typeof ICON_BUTTON_VARIANTS;
8
+ type NativeButtonProps = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
9
+ export interface IconButtonProps extends Pick<NativeButtonProps, "id" | "onClick" | "disabled" | "className"> {
10
+ "data-testid"?: string;
11
+ icon: IconName;
12
+ title: string;
13
+ variant?: IconButtonVariants;
14
+ }
15
+ export declare const IconButton: React.FC<IconButtonProps>;
16
+ export {};
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ interface ModalProps {
3
+ onClose: () => void;
4
+ isOpen: boolean;
5
+ children: React.ReactNode;
6
+ }
7
+ export declare const Modal: React.FC<ModalProps>;
8
+ export declare const ModalBody: React.FC<{
9
+ children: React.ReactNode;
10
+ }>;
11
+ export {};
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ export declare const NonIdealState: React.FC<React.PropsWithChildren<{
3
+ style?: React.CSSProperties;
4
+ }>>;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export interface StampProps {
3
+ backgroundColor: React.CSSProperties["backgroundColor"];
4
+ color: React.CSSProperties["color"];
5
+ children: React.ReactNode;
6
+ }
7
+ export declare const Stamp: React.FC<StampProps>;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ export interface TabsProps {
3
+ /**
4
+ * The currently selected tab option
5
+ */
6
+ value: string;
7
+ /**
8
+ * Callback for when a new tab option is selected
9
+ */
10
+ onChange: (value: string) => void;
11
+ /**
12
+ * The options you want to render on the tabs
13
+ */
14
+ options: string[];
15
+ }
16
+ export declare const Tabs: React.FC<TabsProps>;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { CreateOrderPayload, CreateOrderPayloadServices } from "../../types/CreateOrderPayload";
3
+ import { Offer } from "../../types/Offer";
4
+ export interface BaggageSelectionCardProps {
5
+ isLoading: boolean;
6
+ offer?: Offer;
7
+ passengers: CreateOrderPayload["passengers"];
8
+ selectedServices: CreateOrderPayloadServices;
9
+ setSelectedServices: (selectedServices: CreateOrderPayloadServices) => void;
10
+ }
11
+ export declare const BaggageSelectionCard: React.FC<BaggageSelectionCardProps>;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { CreateOrderPayloadServices } from "../../types/CreateOrderPayload";
3
+ import { OfferAvailableServiceBaggage } from "../../types/Offer";
4
+ interface BaggageSelectionControllerProps {
5
+ segmentId: string;
6
+ passengerId: string;
7
+ availableService: OfferAvailableServiceBaggage;
8
+ selectedServices: CreateOrderPayloadServices;
9
+ quantity: number;
10
+ onQuantityChanged: (quantity: number) => void;
11
+ }
12
+ export declare const BaggageSelectionController: React.FC<BaggageSelectionControllerProps>;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { CreateOrderPayload, CreateOrderPayloadServices } from "../../types/CreateOrderPayload";
3
+ import { Offer } from "../../types/Offer";
4
+ export interface BaggageSelectionModalProps {
5
+ isOpen: boolean;
6
+ offer?: Offer;
7
+ passengers: CreateOrderPayload["passengers"];
8
+ selectedServices: CreateOrderPayloadServices;
9
+ onClose: (selectedServices: CreateOrderPayloadServices) => void;
10
+ }
11
+ export declare const BaggageSelectionModal: React.FC<BaggageSelectionModalProps>;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { CreateOrderPayloadPassenger, CreateOrderPayloadServices } from "../../types/CreateOrderPayload";
3
+ import { Offer, OfferSliceSegment } from "../../types/Offer";
4
+ export interface BaggageSelectionModalBodyProps {
5
+ offer: Offer;
6
+ segment: OfferSliceSegment;
7
+ passengersById: Record<CreateOrderPayloadPassenger["id"], CreateOrderPayloadPassenger>;
8
+ selectedServices: CreateOrderPayloadServices;
9
+ setSelectedServices: (selectedServices: CreateOrderPayloadServices) => void;
10
+ }
11
+ export declare const BaggageSelectionModalBody: React.FC<BaggageSelectionModalBodyProps>;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { CreateOrderPayloadServices } from "../../types/CreateOrderPayload";
3
+ import { OfferAvailableServiceBaggage, OfferSliceSegmentPassengerBaggage } from "../../types/Offer";
4
+ export interface BaggageSelectionModalBodyPassengerProps {
5
+ segmentId: string;
6
+ passengerId: string;
7
+ passengerName: string;
8
+ includedBaggage: OfferSliceSegmentPassengerBaggage[];
9
+ passengerServicesForSegment: OfferAvailableServiceBaggage[];
10
+ selectedServices: CreateOrderPayloadServices;
11
+ setSelectedServices: (selectedServices: CreateOrderPayloadServices) => void;
12
+ }
13
+ export declare const BaggageSelectionModalBodyPassenger: React.FC<BaggageSelectionModalBodyPassengerProps>;
@@ -0,0 +1,14 @@
1
+ import { ServicePriceMapById } from "@lib/getServicePriceMapById";
2
+ import React from "react";
3
+ import { CreateOrderPayloadServices } from "../../types/CreateOrderPayload";
4
+ export interface BaggageSelectionModalFooterProps {
5
+ currency: string;
6
+ selectedServices: CreateOrderPayloadServices;
7
+ servicePrices: ServicePriceMapById;
8
+ isFirstSegment: boolean;
9
+ isLastSegment: boolean;
10
+ onNextSegmentButtonClicked: () => void;
11
+ onPreviousSegmentButtonClicked: () => void;
12
+ onClose: () => void;
13
+ }
14
+ export declare const BaggageSelectionModalFooter: React.FC<BaggageSelectionModalFooterProps>;