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