@popsure/dirty-swan 0.28.0-beta.4 → 0.28.0
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/Readme.md +2 -0
- package/dist/{App.d.ts → cjs/App.d.ts} +0 -1
- package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- package/dist/{index.js → cjs/index.js} +2811 -1441
- package/dist/cjs/index.js.map +1 -0
- package/dist/{lib → cjs/lib}/components/autocompleteAddress/demo.d.ts +0 -1
- package/dist/cjs/lib/components/autocompleteAddress/index.d.ts +19 -0
- package/dist/{lib/components/input/currency → cjs/lib/components/autocompleteAddress}/index.test.d.ts +0 -0
- package/dist/{lib/components/autocompleteAddress/util → cjs/lib/components/autocompleteAddress}/mapStyle.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/autocompleteAddress/util/index.d.ts +1 -1
- package/dist/{lib → cjs/lib}/components/button/icons/index.d.ts +0 -0
- package/dist/cjs/lib/components/button/index.d.ts +13 -0
- package/dist/{lib → cjs/lib}/components/cards/cardButton/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/cards/cardWithLeftIcon/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/cards/cardWithTopIcon/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/cards/cardWithTopLeftIcon/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/cards/icons/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/cards/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/cards/infoCard/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/chip/index.d.ts +0 -1
- package/dist/cjs/lib/components/comparisonTable/components/AccordionItem/AccordionItem.d.ts +9 -0
- package/dist/cjs/lib/components/comparisonTable/components/AccordionItem/index.d.ts +1 -0
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/Chevron.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/Row/index.d.ts +1 -2
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/TableArrows/Arrow.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/TableArrows/index.d.ts +4 -3
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/TableInfoButton/index.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/TableRating/StarIcon.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/TableRating/ZapIcon.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/TableRating/index.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/TableRowHeader/index.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/comparisonTable/components/TableTrueFalse.d.ts +0 -1
- package/dist/cjs/lib/components/comparisonTable/hooks/useComparisonTable.d.ts +14 -0
- package/dist/{lib → cjs/lib}/components/comparisonTable/index.d.ts +10 -4
- package/dist/{lib → cjs/lib}/components/dateSelector/index.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/downloadButton/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/input/autoSuggestInput/index.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/input/autoSuggestMultiSelect/index.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/input/currency/format/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/input/currency/index.d.ts +0 -1
- package/dist/cjs/lib/components/input/currency/index.test.d.ts +1 -0
- package/dist/{lib → cjs/lib}/components/input/iban/formatIban/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/input/iban/index.d.ts +0 -1
- package/dist/cjs/lib/components/input/index.d.ts +16 -0
- package/dist/{lib → cjs/lib}/components/markdown/index.d.ts +0 -0
- package/dist/{lib/components/modal/regularModal → cjs/lib/components/modal/bottomModal}/index.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/modal/bottomOrRegularModal/index.d.ts +0 -1
- package/dist/{lib → cjs/lib}/components/modal/hooks/useOnClose.d.ts +0 -0
- package/dist/{lib → cjs/lib}/components/modal/index.d.ts +0 -0
- package/dist/{lib/components/modal/bottomModal → cjs/lib/components/modal/regularModal}/index.d.ts +0 -1
- package/dist/cjs/lib/components/multiDropzone/UploadFileCell/index.d.ts +10 -0
- package/dist/cjs/lib/components/multiDropzone/icons/index.d.ts +11 -0
- package/dist/cjs/lib/components/multiDropzone/index.d.ts +15 -0
- package/dist/cjs/lib/components/multiDropzone/index.test.d.ts +1 -0
- package/dist/cjs/lib/components/multiDropzone/types.d.ts +31 -0
- package/dist/cjs/lib/components/multiDropzone/utils/index.d.ts +11 -0
- package/dist/{lib → cjs/lib}/components/segmentedControl/index.d.ts +0 -1
- package/dist/cjs/lib/components/segmentedControl/index.test.d.ts +1 -0
- package/dist/{lib → cjs/lib}/components/signaturePad/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/models/autoSuggestInput/index.d.ts +0 -0
- package/dist/{lib → cjs/lib}/models/download.d.ts +0 -0
- package/dist/{lib → cjs/lib}/scss/private/base/demo.d.ts +0 -1
- package/dist/{lib → cjs/lib}/scss/public/demo.d.ts +0 -1
- package/dist/{lib → cjs/lib}/util/calendarDate/index.d.ts +0 -0
- package/dist/cjs/lib/util/formatBytes/index.d.ts +1 -0
- package/dist/cjs/lib/util/testUtils/customRender.d.ts +7 -0
- package/dist/cjs/lib/util/testUtils/index.d.ts +2 -0
- package/dist/{lib → cjs/lib}/util/zeroFill.d.ts +0 -0
- package/dist/{mapStyle-32849fbf.js → cjs/mapStyle-a64f125f.js} +1 -1
- package/dist/cjs/mapStyle-a64f125f.js.map +1 -0
- package/dist/esm/App.d.ts +3 -0
- package/dist/esm/_commonjsHelpers-0f86abda.js +23 -0
- package/dist/esm/_commonjsHelpers-0f86abda.js.map +1 -0
- package/dist/esm/components/autocompleteAddress/demo.js +65 -0
- package/dist/esm/components/autocompleteAddress/demo.js.map +1 -0
- package/dist/esm/components/autocompleteAddress/index.js +2063 -0
- package/dist/esm/components/autocompleteAddress/index.js.map +1 -0
- package/dist/esm/components/autocompleteAddress/index.test.js +116 -0
- package/dist/esm/components/autocompleteAddress/index.test.js.map +1 -0
- package/dist/esm/components/button/index.js +25 -0
- package/dist/esm/components/button/index.js.map +1 -0
- package/dist/esm/components/cards/cardButton/index.js +6 -0
- package/dist/esm/components/cards/cardButton/index.js.map +1 -0
- package/dist/esm/components/cards/cardWithLeftIcon/index.js +7 -0
- package/dist/esm/components/cards/cardWithLeftIcon/index.js.map +1 -0
- package/dist/esm/components/cards/cardWithTopIcon/index.js +7 -0
- package/dist/esm/components/cards/cardWithTopIcon/index.js.map +1 -0
- package/dist/esm/components/cards/cardWithTopLeftIcon/index.js +7 -0
- package/dist/esm/components/cards/cardWithTopLeftIcon/index.js.map +1 -0
- package/dist/esm/components/cards/index.js +125 -0
- package/dist/esm/components/cards/index.js.map +1 -0
- package/dist/esm/components/cards/infoCard/index.js +7 -0
- package/dist/esm/components/cards/infoCard/index.js.map +1 -0
- package/dist/esm/components/chip/index.js +22 -0
- package/dist/esm/components/chip/index.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js +32 -0
- package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/AccordionItem/index.js +8 -0
- package/dist/esm/components/comparisonTable/components/AccordionItem/index.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/Chevron.js +10 -0
- package/dist/esm/components/comparisonTable/components/Chevron.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/Row/index.js +36 -0
- package/dist/esm/components/comparisonTable/components/Row/index.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/TableArrows/Arrow.js +10 -0
- package/dist/esm/components/comparisonTable/components/TableArrows/Arrow.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/TableArrows/index.js +24 -0
- package/dist/esm/components/comparisonTable/components/TableArrows/index.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +17 -0
- package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/TableRating/StarIcon.js +10 -0
- package/dist/esm/components/comparisonTable/components/TableRating/StarIcon.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/TableRating/ZapIcon.js +10 -0
- package/dist/esm/components/comparisonTable/components/TableRating/ZapIcon.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/TableRating/index.js +27 -0
- package/dist/esm/components/comparisonTable/components/TableRating/index.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/TableRowHeader/index.js +22 -0
- package/dist/esm/components/comparisonTable/components/TableRowHeader/index.js.map +1 -0
- package/dist/esm/components/comparisonTable/components/TableTrueFalse.js +13 -0
- package/dist/esm/components/comparisonTable/components/TableTrueFalse.js.map +1 -0
- package/dist/esm/components/comparisonTable/index.js +1585 -0
- package/dist/esm/components/comparisonTable/index.js.map +1 -0
- package/dist/esm/components/dateSelector/index.js +2161 -0
- package/dist/esm/components/dateSelector/index.js.map +1 -0
- package/dist/esm/components/downloadButton/index.js +36 -0
- package/dist/esm/components/downloadButton/index.js.map +1 -0
- package/dist/esm/components/input/autoSuggestInput/index.js +2161 -0
- package/dist/esm/components/input/autoSuggestInput/index.js.map +1 -0
- package/dist/esm/components/input/autoSuggestMultiSelect/index.js +42 -0
- package/dist/esm/components/input/autoSuggestMultiSelect/index.js.map +1 -0
- package/dist/esm/components/input/currency/index.js +52 -0
- package/dist/esm/components/input/currency/index.js.map +1 -0
- package/dist/esm/components/input/currency/index.test.js +120 -0
- package/dist/esm/components/input/currency/index.test.js.map +1 -0
- package/dist/esm/components/input/iban/index.js +34 -0
- package/dist/esm/components/input/iban/index.js.map +1 -0
- package/dist/esm/components/input/index.js +30 -0
- package/dist/esm/components/input/index.js.map +1 -0
- package/dist/esm/components/markdown/index.js +22164 -0
- package/dist/esm/components/markdown/index.js.map +1 -0
- package/dist/esm/components/modal/bottomModal/index.js +31 -0
- package/dist/esm/components/modal/bottomModal/index.js.map +1 -0
- package/dist/esm/components/modal/bottomOrRegularModal/index.js +35 -0
- package/dist/esm/components/modal/bottomOrRegularModal/index.js.map +1 -0
- package/dist/esm/components/modal/regularModal/index.js +24 -0
- package/dist/esm/components/modal/regularModal/index.js.map +1 -0
- package/dist/esm/components/multiDropzone/UploadFileCell/index.js +6 -0
- package/dist/esm/components/multiDropzone/UploadFileCell/index.js.map +1 -0
- package/dist/esm/components/multiDropzone/index.js +2851 -0
- package/dist/esm/components/multiDropzone/index.js.map +1 -0
- package/dist/esm/components/multiDropzone/index.test.js +7602 -0
- package/dist/esm/components/multiDropzone/index.test.js.map +1 -0
- package/dist/esm/components/segmentedControl/index.js +42 -0
- package/dist/esm/components/segmentedControl/index.js.map +1 -0
- package/dist/esm/components/segmentedControl/index.test.js +63 -0
- package/dist/esm/components/segmentedControl/index.test.js.map +1 -0
- package/dist/esm/components/signaturePad/index.js +560 -0
- package/dist/esm/components/signaturePad/index.js.map +1 -0
- package/dist/esm/customRender-39982d87.js +24102 -0
- package/dist/esm/customRender-39982d87.js.map +1 -0
- package/dist/esm/index-171a0108.js +997 -0
- package/dist/esm/index-171a0108.js.map +1 -0
- package/dist/esm/index-21239ab0.js +237 -0
- package/dist/esm/index-21239ab0.js.map +1 -0
- package/dist/esm/index-47663d39.js +48 -0
- package/dist/esm/index-47663d39.js.map +1 -0
- package/dist/esm/index-51913e93.js +382 -0
- package/dist/esm/index-51913e93.js.map +1 -0
- package/dist/esm/index-be398f1d.js +69 -0
- package/dist/esm/index-be398f1d.js.map +1 -0
- package/dist/esm/index-dd80248b.js +91 -0
- package/dist/esm/index-dd80248b.js.map +1 -0
- package/dist/esm/index-e9e37a34.js +62 -0
- package/dist/esm/index-e9e37a34.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +49 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/components/autocompleteAddress/demo.d.ts +4 -0
- package/dist/esm/lib/components/autocompleteAddress/index.d.ts +19 -0
- package/dist/esm/lib/components/autocompleteAddress/index.test.d.ts +1 -0
- package/dist/esm/lib/components/autocompleteAddress/mapStyle.d.ts +2 -0
- package/dist/esm/lib/components/autocompleteAddress/util/index.d.ts +4 -0
- package/dist/esm/lib/components/button/icons/index.d.ts +9 -0
- package/dist/esm/lib/components/button/index.d.ts +13 -0
- package/dist/esm/lib/components/cards/cardButton/index.d.ts +16 -0
- package/dist/esm/lib/components/cards/cardWithLeftIcon/index.d.ts +14 -0
- package/dist/esm/lib/components/cards/cardWithTopIcon/index.d.ts +15 -0
- package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.d.ts +14 -0
- package/dist/esm/lib/components/cards/icons/index.d.ts +13 -0
- package/dist/esm/lib/components/cards/index.d.ts +16 -0
- package/dist/esm/lib/components/cards/infoCard/index.d.ts +13 -0
- package/dist/esm/lib/components/chip/index.d.ts +6 -0
- package/dist/esm/lib/components/comparisonTable/components/AccordionItem/AccordionItem.d.ts +9 -0
- package/dist/esm/lib/components/comparisonTable/components/AccordionItem/index.d.ts +1 -0
- package/dist/esm/lib/components/comparisonTable/components/Chevron.d.ts +4 -0
- package/dist/esm/lib/components/comparisonTable/components/Row/index.d.ts +11 -0
- package/dist/esm/lib/components/comparisonTable/components/TableArrows/Arrow.d.ts +4 -0
- package/dist/esm/lib/components/comparisonTable/components/TableArrows/index.d.ts +10 -0
- package/dist/esm/lib/components/comparisonTable/components/TableInfoButton/index.d.ts +5 -0
- package/dist/esm/lib/components/comparisonTable/components/TableRating/StarIcon.d.ts +4 -0
- package/dist/esm/lib/components/comparisonTable/components/TableRating/ZapIcon.d.ts +4 -0
- package/dist/esm/lib/components/comparisonTable/components/TableRating/index.d.ts +7 -0
- package/dist/esm/lib/components/comparisonTable/components/TableRowHeader/index.d.ts +7 -0
- package/dist/esm/lib/components/comparisonTable/components/TableTrueFalse.d.ts +5 -0
- package/dist/esm/lib/components/comparisonTable/hooks/useComparisonTable.d.ts +14 -0
- package/dist/esm/lib/components/comparisonTable/index.d.ts +51 -0
- package/dist/esm/lib/components/dateSelector/index.d.ts +23 -0
- package/dist/esm/lib/components/downloadButton/index.d.ts +10 -0
- package/dist/esm/lib/components/input/autoSuggestInput/index.d.ts +13 -0
- package/dist/esm/lib/components/input/autoSuggestMultiSelect/index.d.ts +11 -0
- package/dist/esm/lib/components/input/currency/format/index.d.ts +2 -0
- package/dist/esm/lib/components/input/currency/index.d.ts +7 -0
- package/dist/esm/lib/components/input/currency/index.test.d.ts +1 -0
- package/dist/esm/lib/components/input/iban/formatIban/index.d.ts +1 -0
- package/dist/esm/lib/components/input/iban/index.d.ts +6 -0
- package/dist/esm/lib/components/input/index.d.ts +16 -0
- package/dist/esm/lib/components/markdown/index.d.ts +9 -0
- package/dist/esm/lib/components/modal/bottomModal/index.d.ts +3 -0
- package/dist/esm/lib/components/modal/bottomOrRegularModal/index.d.ts +3 -0
- package/dist/esm/lib/components/modal/hooks/useOnClose.d.ts +7 -0
- package/dist/esm/lib/components/modal/index.d.ts +13 -0
- package/dist/esm/lib/components/modal/regularModal/index.d.ts +3 -0
- package/dist/esm/lib/components/multiDropzone/UploadFileCell/index.d.ts +10 -0
- package/dist/esm/lib/components/multiDropzone/icons/index.d.ts +11 -0
- package/dist/esm/lib/components/multiDropzone/index.d.ts +15 -0
- package/dist/esm/lib/components/multiDropzone/index.test.d.ts +1 -0
- package/dist/esm/lib/components/multiDropzone/types.d.ts +31 -0
- package/dist/esm/lib/components/multiDropzone/utils/index.d.ts +11 -0
- package/dist/esm/lib/components/segmentedControl/index.d.ts +11 -0
- package/dist/esm/lib/components/segmentedControl/index.test.d.ts +1 -0
- package/dist/esm/lib/components/signaturePad/index.d.ts +19 -0
- package/dist/esm/lib/index.d.ts +20 -0
- package/dist/esm/lib/models/autoSuggestInput/index.d.ts +4 -0
- package/dist/esm/lib/models/download.d.ts +1 -0
- package/dist/esm/lib/scss/private/base/demo.d.ts +5 -0
- package/dist/esm/lib/scss/public/demo.d.ts +1 -0
- package/dist/esm/lib/util/calendarDate/index.d.ts +3 -0
- package/dist/esm/lib/util/formatBytes/index.d.ts +1 -0
- package/dist/esm/lib/util/testUtils/customRender.d.ts +7 -0
- package/dist/esm/lib/util/testUtils/index.d.ts +2 -0
- package/dist/esm/lib/util/zeroFill.d.ts +1 -0
- package/dist/esm/mapStyle-1288a869.js +187 -0
- package/dist/esm/mapStyle-1288a869.js.map +1 -0
- package/dist/esm/scss/private/base/demo.js +80 -0
- package/dist/esm/scss/private/base/demo.js.map +1 -0
- package/dist/esm/scss/public/demo.js +284 -0
- package/dist/esm/scss/public/demo.js.map +1 -0
- package/dist/esm/style-inject.es-1f59c1d0.js +29 -0
- package/dist/esm/style-inject.es-1f59c1d0.js.map +1 -0
- package/dist/esm/tslib.es6-5bc94358.js +104 -0
- package/dist/esm/tslib.es6-5bc94358.js.map +1 -0
- package/dist/esm/useOnClose-54f9e6b9.js +40 -0
- package/dist/esm/useOnClose-54f9e6b9.js.map +1 -0
- package/dist/esm/util/testUtils/customRender.js +7 -0
- package/dist/esm/util/testUtils/customRender.js.map +1 -0
- package/dist/esm/v4-d2999257.js +69 -0
- package/dist/esm/v4-d2999257.js.map +1 -0
- package/dist/index.css +75 -3
- package/dist/index.css.map +1 -1
- package/dist/lib/scss/index.scss +2 -0
- package/dist/lib/scss/private/components/_input.scss +1 -3
- package/dist/lib/scss/public/demo.tsx +1 -1
- package/{src/lib/components/autocompleteAddress/modes/dynamic.module.scss → dist/lib/scss/third-party/_google_places.scss} +37 -37
- package/dist/lib/scss/third-party/_index.scss +1 -0
- package/dist/lib/scss/utils/_index.scss +12 -0
- package/package.json +14 -8
- package/src/lib/components/autocompleteAddress/demo.tsx +5 -9
- package/src/lib/components/autocompleteAddress/index.stories.mdx +1 -1
- package/src/lib/components/autocompleteAddress/index.test.tsx +95 -0
- package/src/lib/components/autocompleteAddress/index.tsx +315 -113
- package/src/lib/components/autocompleteAddress/{util/mapStyle.ts → mapStyle.ts} +0 -0
- package/src/lib/components/autocompleteAddress/util/index.ts +1 -1
- package/src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.module.scss +44 -0
- package/src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.tsx +74 -0
- package/src/lib/components/comparisonTable/components/AccordionItem/index.tsx +1 -0
- package/src/lib/components/comparisonTable/components/Row/index.tsx +1 -3
- package/src/lib/components/comparisonTable/components/Row/style.module.scss +11 -2
- package/src/lib/components/comparisonTable/components/TableArrows/index.tsx +2 -4
- package/src/lib/components/comparisonTable/components/TableArrows/style.module.scss +3 -1
- package/src/lib/components/comparisonTable/hooks/useComparisonTable.ts +124 -0
- package/src/lib/components/comparisonTable/index.stories.mdx +226 -8
- package/src/lib/components/comparisonTable/index.tsx +175 -122
- package/src/lib/components/comparisonTable/style.module.scss +16 -6
- package/src/lib/components/input/autoSuggestInput/style.module.scss +4 -1
- package/src/lib/components/input/currency/index.stories.mdx +8 -0
- package/src/lib/components/input/currency/index.test.tsx +22 -22
- package/src/lib/components/input/index.stories.mdx +42 -0
- package/src/lib/components/input/index.tsx +77 -41
- package/src/lib/components/input/style.module.scss +10 -0
- package/src/lib/components/modal/regularModal/index.tsx +14 -12
- package/src/lib/components/modal/regularModal/style.module.scss +16 -15
- package/src/lib/components/multiDropzone/UploadFileCell/index.tsx +44 -64
- package/src/lib/components/multiDropzone/UploadFileCell/style.module.scss +3 -9
- package/src/lib/components/multiDropzone/icons/eye.svg +10 -3
- package/src/lib/components/multiDropzone/icons/file-error.svg +4 -0
- package/src/lib/components/multiDropzone/icons/file-upload.svg +4 -0
- package/src/lib/components/multiDropzone/icons/file.svg +4 -0
- package/src/lib/components/multiDropzone/icons/index.ts +12 -44
- package/src/lib/components/multiDropzone/icons/trash-error.svg +6 -0
- package/src/lib/components/multiDropzone/icons/trash.svg +5 -5
- package/src/lib/components/multiDropzone/icons/upload-small.svg +12 -0
- package/src/lib/components/multiDropzone/index.stories.mdx +75 -0
- package/src/lib/components/multiDropzone/index.test.tsx +230 -0
- package/src/lib/components/multiDropzone/index.tsx +104 -66
- package/src/lib/components/multiDropzone/types.ts +36 -0
- package/src/lib/components/multiDropzone/utils/index.test.ts +112 -0
- package/src/lib/components/multiDropzone/utils/index.ts +69 -0
- package/src/lib/components/segmentedControl/index.test.tsx +45 -0
- package/src/lib/components/segmentedControl/index.tsx +1 -0
- package/src/lib/scss/index.scss +2 -0
- package/src/lib/scss/private/components/_input.scss +1 -3
- package/src/lib/scss/public/demo.tsx +1 -1
- package/src/lib/scss/third-party/_google_places.scss +62 -0
- package/src/lib/scss/third-party/_index.scss +1 -0
- package/src/lib/scss/utils/_index.scss +12 -0
- package/src/lib/util/formatBytes/index.test.ts +19 -0
- package/src/lib/util/formatBytes/index.ts +13 -0
- package/src/lib/util/testUtils/customRender.tsx +15 -0
- package/src/lib/util/testUtils/index.ts +5 -0
- package/src/setupTests.js +50 -2
- package/dist/index.js.map +0 -1
- package/dist/lib/components/autocompleteAddress/components/GoogleMapsWrapper.d.ts +0 -8
- package/dist/lib/components/autocompleteAddress/index.d.ts +0 -23
- package/dist/lib/components/autocompleteAddress/modes/dynamic.d.ts +0 -12
- package/dist/lib/components/autocompleteAddress/modes/manual.d.ts +0 -9
- package/dist/lib/components/autocompleteAddress/util/googleMapsLoader.d.ts +0 -17
- package/dist/lib/components/button/index.d.ts +0 -13
- package/dist/lib/components/comparisonTable/hooks/useActiveTableArrows.d.ts +0 -10
- package/dist/lib/components/input/index.d.ts +0 -10
- package/dist/lib/components/multiDropzone/UploadFileCell/index.d.ts +0 -9
- package/dist/lib/components/multiDropzone/icons/index.d.ts +0 -25
- package/dist/lib/components/multiDropzone/index.d.ts +0 -21
- package/dist/mapStyle-32849fbf.js.map +0 -1
- package/src/lib/components/autocompleteAddress/components/GoogleMapsWrapper.tsx +0 -81
- package/src/lib/components/autocompleteAddress/modes/dynamic.tsx +0 -118
- package/src/lib/components/autocompleteAddress/modes/manual.tsx +0 -81
- package/src/lib/components/autocompleteAddress/util/googleMapsLoader.tsx +0 -73
- package/src/lib/components/comparisonTable/hooks/useActiveTableArrows.ts +0 -63
- package/src/lib/components/multiDropzone/icons/bmp-complete.svg +0 -10
- package/src/lib/components/multiDropzone/icons/bmp.svg +0 -10
- package/src/lib/components/multiDropzone/icons/doc-complete.svg +0 -11
- package/src/lib/components/multiDropzone/icons/doc.svg +0 -11
- package/src/lib/components/multiDropzone/icons/docx-complete.svg +0 -12
- package/src/lib/components/multiDropzone/icons/docx.svg +0 -12
- package/src/lib/components/multiDropzone/icons/generic-complete.svg +0 -4
- package/src/lib/components/multiDropzone/icons/generic-error.svg +0 -7
- package/src/lib/components/multiDropzone/icons/generic.svg +0 -4
- package/src/lib/components/multiDropzone/icons/heic-complete.svg +0 -11
- package/src/lib/components/multiDropzone/icons/heic.svg +0 -11
- package/src/lib/components/multiDropzone/icons/jpeg-complete.svg +0 -11
- package/src/lib/components/multiDropzone/icons/jpeg.svg +0 -11
- package/src/lib/components/multiDropzone/icons/jpg-complete.svg +0 -10
- package/src/lib/components/multiDropzone/icons/jpg.svg +0 -10
- package/src/lib/components/multiDropzone/icons/pdf-complete.svg +0 -8
- package/src/lib/components/multiDropzone/icons/pdf.svg +0 -8
- package/src/lib/components/multiDropzone/icons/png-complete.svg +0 -10
- package/src/lib/components/multiDropzone/icons/png.svg +0 -10
|
@@ -1,24 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import debounce from 'lodash.debounce';
|
|
4
|
+
import isEqual from 'lodash.isequal';
|
|
5
|
+
import Input from '../input';
|
|
6
|
+
import {
|
|
7
|
+
Address,
|
|
8
|
+
countryNameFromAlphaCode,
|
|
9
|
+
Alpha2CountryCode,
|
|
10
|
+
} from '@popsure/public-models';
|
|
11
|
+
|
|
12
|
+
import { geocoderAddressComponentToPartialAddress } from './util';
|
|
13
|
+
|
|
14
|
+
import styles from './style.module.scss';
|
|
15
|
+
|
|
16
|
+
const GERMANY_LAT_LNG = { lat: 51.54317, lng: 10.3181503 };
|
|
17
|
+
|
|
18
|
+
const GERMANY_ALPHA_CODE = 'DE';
|
|
19
|
+
|
|
20
|
+
const MAP_CONFIG_OBJ = {
|
|
21
|
+
zoom: 6,
|
|
22
|
+
center: GERMANY_LAT_LNG,
|
|
23
|
+
fullscreenControl: false,
|
|
24
|
+
mapTypeControl: false,
|
|
25
|
+
panControl: false,
|
|
26
|
+
zoomControl: false,
|
|
27
|
+
streetViewControl: false,
|
|
28
|
+
scrollwheel: false,
|
|
29
|
+
scaleControl: false,
|
|
30
|
+
rotateControl: false,
|
|
31
|
+
draggable: false,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const loadGoogleMapsApiDynamically = (callback: () => void, apiKey: string) => {
|
|
35
|
+
const existingScript = document.getElementById('googleMapsImportScript');
|
|
36
|
+
|
|
37
|
+
if (existingScript) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const googleMapImportScript = document.createElement('script');
|
|
42
|
+
googleMapImportScript.id = 'googleMapsImportScript';
|
|
43
|
+
googleMapImportScript.type = 'text/javascript';
|
|
44
|
+
googleMapImportScript.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places`;
|
|
45
|
+
document.head.appendChild(googleMapImportScript);
|
|
46
|
+
|
|
47
|
+
googleMapImportScript.onload = () => {
|
|
48
|
+
callback();
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const AutoCompleteAddress = ({
|
|
53
|
+
apiKey,
|
|
54
|
+
address: initialAddress,
|
|
55
|
+
onAddressChange,
|
|
56
|
+
placeholders,
|
|
57
|
+
manualAddressEntryTexts,
|
|
58
|
+
}: {
|
|
14
59
|
apiKey: string;
|
|
15
60
|
address?: Partial<Address>;
|
|
16
|
-
staticVersion?: boolean;
|
|
17
61
|
onAddressChange: (address: Partial<Address>) => void;
|
|
18
|
-
manualAddressEntryTexts?: {
|
|
19
|
-
preText?: string;
|
|
20
|
-
cta?: string;
|
|
21
|
-
};
|
|
22
62
|
placeholders?: {
|
|
23
63
|
manualAddressEntry?: string;
|
|
24
64
|
street?: string;
|
|
@@ -27,120 +67,282 @@ export type AutoCompleteAddressProps = {
|
|
|
27
67
|
postcode?: string;
|
|
28
68
|
city?: string;
|
|
29
69
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
staticVersion = !!process.env.STORYBOOK_STATIC,
|
|
37
|
-
onAddressChange,
|
|
38
|
-
manualAddressEntryTexts,
|
|
39
|
-
placeholders
|
|
40
|
-
}: AutoCompleteAddressProps) => {
|
|
70
|
+
manualAddressEntryTexts?: {
|
|
71
|
+
preText?: string;
|
|
72
|
+
cta?: string;
|
|
73
|
+
};
|
|
74
|
+
}) => {
|
|
75
|
+
const [manualAddressEntry, setManualAddressEntry] = useState(false);
|
|
41
76
|
const [isLoading, setIsLoading] = useState(false);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
>(
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
77
|
+
const autocomplete = useRef<google.maps.places.Autocomplete | null>(null);
|
|
78
|
+
const autocompleteElement = useRef<HTMLInputElement | null>(null);
|
|
79
|
+
const map = useRef<google.maps.Map | null>(null);
|
|
80
|
+
const marker = useRef<google.maps.Marker | null>(null);
|
|
81
|
+
const [address, setAddress] = useState(initialAddress);
|
|
82
|
+
const [hasLoadedGoogleAPI, setHasLoadedGoogleAPI] = useState(
|
|
83
|
+
window.google !== undefined
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
loadGoogleMapsApiDynamically(() => {
|
|
87
|
+
setHasLoadedGoogleAPI(true);
|
|
88
|
+
}, apiKey);
|
|
89
|
+
|
|
90
|
+
const [place, setPlace] = useState<google.maps.places.PlaceResult | null>(
|
|
91
|
+
null
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (address) {
|
|
96
|
+
if (autocompleteElement.current && address.street) {
|
|
97
|
+
autocompleteElement.current.value = address.street;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (isEqual(address, initialAddress) === false) {
|
|
101
|
+
onAddressChange({ ...address });
|
|
102
|
+
}
|
|
103
|
+
handleEnterAddressManually();
|
|
104
|
+
}
|
|
105
|
+
}, [initialAddress, address, onAddressChange, hasLoadedGoogleAPI]);
|
|
106
|
+
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (hasLoadedGoogleAPI === false) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const reference = document.getElementById(
|
|
113
|
+
'autocomplete'
|
|
114
|
+
) as HTMLInputElement;
|
|
115
|
+
|
|
116
|
+
autocomplete.current = new google.maps.places.Autocomplete(reference, {
|
|
117
|
+
types: ['address'],
|
|
118
|
+
componentRestrictions: { country: GERMANY_ALPHA_CODE },
|
|
51
119
|
});
|
|
52
120
|
|
|
53
|
-
|
|
121
|
+
autocomplete.current.addListener('place_changed', onPlaceChanged);
|
|
54
122
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
123
|
+
map.current = new google.maps.Map(
|
|
124
|
+
document.getElementById('map')!,
|
|
125
|
+
MAP_CONFIG_OBJ
|
|
126
|
+
);
|
|
58
127
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
128
|
+
import('./mapStyle').then(({ style }) => {
|
|
129
|
+
map.current?.mapTypes.set('styled_map', style);
|
|
130
|
+
map.current?.setMapTypeId('styled_map');
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
marker.current = new google.maps.Marker({
|
|
134
|
+
map: map.current,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
setPlaceFromAddress(address);
|
|
138
|
+
}, [hasLoadedGoogleAPI]); // eslint-disable-line
|
|
139
|
+
|
|
140
|
+
const onPlaceChanged = (
|
|
141
|
+
newPlace:
|
|
142
|
+
| google.maps.places.PlaceResult
|
|
143
|
+
| undefined = autocomplete.current?.getPlace(),
|
|
144
|
+
updateAddress: boolean = true
|
|
145
|
+
) => {
|
|
146
|
+
if (newPlace?.geometry?.location) {
|
|
147
|
+
const geocoderAddress = geocoderAddressComponentToPartialAddress(
|
|
148
|
+
newPlace.address_components!
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
setPlace(newPlace);
|
|
152
|
+
if (updateAddress) {
|
|
153
|
+
setAddress((oldValue) => ({
|
|
154
|
+
...geocoderAddress,
|
|
155
|
+
additionalInformation: oldValue?.additionalInformation,
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
map.current?.panTo(newPlace.geometry.location);
|
|
160
|
+
map.current?.setZoom(15);
|
|
161
|
+
|
|
162
|
+
marker.current?.setPosition(newPlace.geometry.location);
|
|
163
|
+
}
|
|
62
164
|
};
|
|
63
165
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
166
|
+
const setPlaceFromAddress = useCallback(
|
|
167
|
+
(address: Partial<Address> | undefined) => {
|
|
168
|
+
if (!map.current) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (address) {
|
|
173
|
+
const service = new google.maps.places.PlacesService(map.current);
|
|
174
|
+
const query = `${address.street ?? ''} ${address.houseNumber ?? ''}, ${
|
|
175
|
+
address.city ?? ''
|
|
176
|
+
}, ${
|
|
177
|
+
address.country
|
|
178
|
+
? countryNameFromAlphaCode(address.country as Alpha2CountryCode)
|
|
179
|
+
: ''
|
|
180
|
+
}`;
|
|
181
|
+
setIsLoading(true);
|
|
182
|
+
service.findPlaceFromQuery(
|
|
183
|
+
{
|
|
184
|
+
fields: ['place_id'],
|
|
185
|
+
query,
|
|
186
|
+
},
|
|
187
|
+
(results) => {
|
|
188
|
+
const firstResult = results && results[0];
|
|
189
|
+
if (firstResult && firstResult.place_id) {
|
|
190
|
+
service.getDetails(
|
|
191
|
+
{ placeId: firstResult.place_id },
|
|
192
|
+
(newPlace) => {
|
|
193
|
+
onPlaceChanged(newPlace ?? undefined, false);
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
setIsLoading(false);
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
[]
|
|
81
203
|
);
|
|
82
204
|
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
updateMapGeometry(address);
|
|
88
|
-
}
|
|
205
|
+
const debouncedSetPlace = debounce(setPlaceFromAddress, 1000);
|
|
206
|
+
|
|
207
|
+
const handleEnterAddressManually = () => {
|
|
208
|
+
setManualAddressEntry(true);
|
|
89
209
|
};
|
|
90
210
|
|
|
91
211
|
return (
|
|
92
212
|
<>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
213
|
+
<div
|
|
214
|
+
className={classNames(`wmx8 bg-grey-500 ${styles['map-container']}`, {
|
|
215
|
+
[styles['map-container--hidden']]: place === null,
|
|
216
|
+
})}
|
|
217
|
+
>
|
|
218
|
+
<div className={styles.map} id="map" />
|
|
219
|
+
{isLoading && (
|
|
220
|
+
<div className={styles['loading-spinner']}>
|
|
221
|
+
<div className="ds-spinner ds-spinner__m" />
|
|
222
|
+
</div>
|
|
223
|
+
)}
|
|
224
|
+
</div>
|
|
225
|
+
<div className={`wmx8`}>
|
|
226
|
+
{manualAddressEntry === false ? (
|
|
227
|
+
<div style={{ position: 'relative' }}>
|
|
228
|
+
<Input
|
|
229
|
+
className="w100"
|
|
230
|
+
id="autocomplete"
|
|
231
|
+
key="autocomplete-search"
|
|
232
|
+
data-cy="autocomplete"
|
|
233
|
+
type="text"
|
|
234
|
+
placeholder={
|
|
235
|
+
placeholders?.manualAddressEntry || 'Search for address'
|
|
236
|
+
}
|
|
237
|
+
ref={autocompleteElement}
|
|
109
238
|
/>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
239
|
+
{hasLoadedGoogleAPI === false && (
|
|
240
|
+
<div className={styles['loading-spinner']}>
|
|
241
|
+
<div className="ds-spinner ds-spinner__m" />
|
|
242
|
+
</div>
|
|
243
|
+
)}
|
|
244
|
+
</div>
|
|
245
|
+
) : (
|
|
246
|
+
<>
|
|
247
|
+
<div className={`d-flex c-gap16 ${styles['input-line']}`}>
|
|
248
|
+
<Input
|
|
249
|
+
className="w100"
|
|
250
|
+
data-cy="autocomplete"
|
|
251
|
+
key="autocomplete-street"
|
|
252
|
+
type="text"
|
|
253
|
+
placeholder={placeholders?.street || 'Street'}
|
|
254
|
+
value={address?.street || ''}
|
|
255
|
+
onChange={(e) => {
|
|
256
|
+
const newAddress = {
|
|
257
|
+
...address,
|
|
258
|
+
street: e.target.value,
|
|
259
|
+
country: GERMANY_ALPHA_CODE,
|
|
260
|
+
};
|
|
261
|
+
setAddress(newAddress);
|
|
262
|
+
debouncedSetPlace(newAddress);
|
|
263
|
+
}}
|
|
264
|
+
/>
|
|
265
|
+
<Input
|
|
266
|
+
className={`wmx2 ${styles['house-number-input']}`}
|
|
267
|
+
data-cy="autocomplete-house-number"
|
|
268
|
+
key="autocomplete-house-number"
|
|
269
|
+
placeholder={placeholders?.houseNumber || 'House Number'}
|
|
270
|
+
value={address?.houseNumber || ''}
|
|
271
|
+
onChange={(e) => {
|
|
272
|
+
const newAddress = {
|
|
273
|
+
...address,
|
|
274
|
+
houseNumber: e.target.value,
|
|
275
|
+
country: GERMANY_ALPHA_CODE,
|
|
276
|
+
};
|
|
277
|
+
setAddress(newAddress);
|
|
278
|
+
debouncedSetPlace(newAddress);
|
|
279
|
+
}}
|
|
280
|
+
/>
|
|
281
|
+
</div>
|
|
282
|
+
<Input
|
|
283
|
+
className="mt16"
|
|
284
|
+
data-cy="autocomplete-additional-info"
|
|
285
|
+
key="autocomplete-additional-info"
|
|
286
|
+
placeholder={
|
|
287
|
+
placeholders?.additionalInformation ||
|
|
288
|
+
'Additional information (C/O, apartment, …)'
|
|
289
|
+
}
|
|
290
|
+
value={address?.additionalInformation || ''}
|
|
291
|
+
onChange={(e) => {
|
|
292
|
+
const newAddress = {
|
|
293
|
+
...address,
|
|
294
|
+
additionalInformation: e.target.value,
|
|
295
|
+
country: GERMANY_ALPHA_CODE,
|
|
296
|
+
};
|
|
297
|
+
setAddress(newAddress);
|
|
298
|
+
}}
|
|
117
299
|
/>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
300
|
+
<div className={`d-flex mt16 c-gap16 ${styles['input-line']}`}>
|
|
301
|
+
<Input
|
|
302
|
+
className="w100"
|
|
303
|
+
data-cy="autocomplete-postcode"
|
|
304
|
+
key="autocomplete-postcode"
|
|
305
|
+
placeholder={placeholders?.postcode || 'Postcode'}
|
|
306
|
+
value={address?.postcode || ''}
|
|
307
|
+
onChange={(e) => {
|
|
308
|
+
const newAddress = {
|
|
309
|
+
...address,
|
|
310
|
+
postcode: e.target.value,
|
|
311
|
+
country: GERMANY_ALPHA_CODE,
|
|
312
|
+
};
|
|
313
|
+
setAddress(newAddress);
|
|
314
|
+
debouncedSetPlace(newAddress);
|
|
315
|
+
}}
|
|
316
|
+
/>
|
|
317
|
+
<Input
|
|
318
|
+
className="w100"
|
|
319
|
+
data-cy="autocomplete-city"
|
|
320
|
+
key="autocomplete-city"
|
|
321
|
+
placeholder={placeholders?.city || 'City'}
|
|
322
|
+
value={address?.city || ''}
|
|
323
|
+
onChange={(e) => {
|
|
324
|
+
const newAddress = {
|
|
325
|
+
...address,
|
|
326
|
+
city: e.target.value,
|
|
327
|
+
country: GERMANY_ALPHA_CODE,
|
|
328
|
+
};
|
|
329
|
+
setAddress(newAddress);
|
|
330
|
+
debouncedSetPlace(newAddress);
|
|
331
|
+
}}
|
|
332
|
+
/>
|
|
333
|
+
</div>
|
|
334
|
+
</>
|
|
335
|
+
)}
|
|
336
|
+
</div>
|
|
337
|
+
{manualAddressEntry === false && (
|
|
134
338
|
<div className="p-p mt8">
|
|
135
339
|
{manualAddressEntryTexts?.preText || 'Or '}
|
|
136
|
-
<
|
|
137
|
-
className="p-a
|
|
138
|
-
onClick={
|
|
139
|
-
data-value={'true'}
|
|
140
|
-
type="button"
|
|
340
|
+
<span
|
|
341
|
+
className="p-a fw-bold c-pointer"
|
|
342
|
+
onClick={handleEnterAddressManually}
|
|
141
343
|
>
|
|
142
344
|
{manualAddressEntryTexts?.cta || 'Enter address manually'}
|
|
143
|
-
</
|
|
345
|
+
</span>
|
|
144
346
|
</div>
|
|
145
347
|
)}
|
|
146
348
|
</>
|
|
File without changes
|
|
@@ -53,7 +53,7 @@ export const geocoderAddressComponentToPartialAddress = (
|
|
|
53
53
|
return toReturn;
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
export const inlineAddress = (address:
|
|
56
|
+
export const inlineAddress = (address: Address) =>
|
|
57
57
|
`${address.street} ${address.houseNumber}, ${
|
|
58
58
|
address.city
|
|
59
59
|
}, ${countryNameFromAlphaCode(address.country as Alpha2CountryCode)}`;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@import '../../../../scss/public/colors';
|
|
2
|
+
|
|
3
|
+
.container {
|
|
4
|
+
width: var(--growContent, min-content);
|
|
5
|
+
margin: 0 auto;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.container + .container {
|
|
9
|
+
margin-top: 8px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.chevron {
|
|
13
|
+
transition: filter 0.3s ease-in-out, transform 0.2s ease-in-out;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.chevronClosed {
|
|
17
|
+
transform: rotate(180deg);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.iconAndTextContainer {
|
|
21
|
+
column-gap: 12px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.headerButton {
|
|
25
|
+
border: none;
|
|
26
|
+
background: $ds-grey-100;
|
|
27
|
+
column-gap: 16px;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
font-family: inherit;
|
|
30
|
+
outline: none;
|
|
31
|
+
position: relative;
|
|
32
|
+
text-align: inherit;
|
|
33
|
+
transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
|
|
34
|
+
|
|
35
|
+
&:hover {
|
|
36
|
+
background: $ds-primary-100;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.headerButton:hover {
|
|
41
|
+
.chevron {
|
|
42
|
+
filter: brightness(0.425);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import AnimateHeight from 'react-animate-height';
|
|
2
|
+
|
|
3
|
+
import styles from './AccordionItem.module.scss';
|
|
4
|
+
|
|
5
|
+
const ChevronSVG = ({ className }: { className?: string }) => (
|
|
6
|
+
<svg
|
|
7
|
+
width="24"
|
|
8
|
+
height="24"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
className={className}
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
d="M18 15L12 9L6 15"
|
|
16
|
+
stroke="#b4b4ba"
|
|
17
|
+
strokeWidth="2"
|
|
18
|
+
strokeLinecap="round"
|
|
19
|
+
strokeLinejoin="round"
|
|
20
|
+
/>
|
|
21
|
+
</svg>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const AccordionItem = ({
|
|
25
|
+
children,
|
|
26
|
+
className = '',
|
|
27
|
+
headerClassName = '',
|
|
28
|
+
isOpen,
|
|
29
|
+
onOpen,
|
|
30
|
+
onClose,
|
|
31
|
+
label,
|
|
32
|
+
}: {
|
|
33
|
+
children: React.ReactNode | string;
|
|
34
|
+
className?: string;
|
|
35
|
+
headerClassName?: string;
|
|
36
|
+
isOpen: boolean;
|
|
37
|
+
onOpen: () => void;
|
|
38
|
+
onClose: () => void;
|
|
39
|
+
label: React.ReactNode;
|
|
40
|
+
}) => {
|
|
41
|
+
const handleClick = () => {
|
|
42
|
+
if (!isOpen) {
|
|
43
|
+
onOpen();
|
|
44
|
+
} else {
|
|
45
|
+
onClose();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className={`d-flex fd-column ${className} ${styles.container}`}>
|
|
51
|
+
<button
|
|
52
|
+
className={`d-flex ai-center jc-between ${styles.headerButton} ${headerClassName}`}
|
|
53
|
+
onClick={handleClick}
|
|
54
|
+
type="button"
|
|
55
|
+
>
|
|
56
|
+
<div className={`d-flex ai-center ${styles.iconAndTextContainer}`}>
|
|
57
|
+
{typeof label === 'string' ? (
|
|
58
|
+
<h4 className="p-h4">{label}</h4>
|
|
59
|
+
) : (
|
|
60
|
+
<>{label}</>
|
|
61
|
+
)}
|
|
62
|
+
</div>
|
|
63
|
+
<ChevronSVG
|
|
64
|
+
className={`${styles.chevron} ${!isOpen && styles.chevronClosed}`}
|
|
65
|
+
/>
|
|
66
|
+
</button>
|
|
67
|
+
{/* Min height is 0.1 so that the scroll position is correctly synced across accordion items but is not actually shown.
|
|
68
|
+
If set to 0, react-animate-height will set display to "none" which means scrolling is not synced. */}
|
|
69
|
+
<AnimateHeight duration={300} height={isOpen ? 'auto' : 0.1}>
|
|
70
|
+
{children}
|
|
71
|
+
</AnimateHeight>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AccordionItem } from './AccordionItem';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Cell } from '../../index';
|
|
4
|
-
|
|
3
|
+
import type { Cell } from '../../index';
|
|
5
4
|
import styles from './style.module.scss';
|
|
6
5
|
|
|
7
6
|
interface RowProps<T> {
|
|
@@ -25,7 +24,6 @@ const Row = <T extends { id: number }>(props: RowProps<T>) => {
|
|
|
25
24
|
>
|
|
26
25
|
<h4
|
|
27
26
|
className={`
|
|
28
|
-
wmx4
|
|
29
27
|
${styles.cell}
|
|
30
28
|
${styles.sticky}
|
|
31
29
|
${isRowHeader ? `p-h2 p--serif ${styles.title}` : ''}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
@use "../../../../scss/public/colors" as *;
|
|
2
2
|
@use "../../../../scss/public/grid" as *;
|
|
3
3
|
|
|
4
|
-
$cell-min-width: 256px;
|
|
4
|
+
$cell-min-width: var(--cellWidth, 256px);
|
|
5
5
|
|
|
6
6
|
.header {
|
|
7
7
|
position: relative;
|
|
8
8
|
|
|
9
9
|
& > div {
|
|
10
|
-
width:
|
|
10
|
+
width: var(--tableWidth);
|
|
11
|
+
max-width: var(--tableWidth);
|
|
11
12
|
|
|
12
13
|
&:nth-child(n + 3) {
|
|
13
14
|
margin: 0;
|
|
@@ -34,6 +35,7 @@ $cell-min-width: 256px;
|
|
|
34
35
|
color: $ds-grey-700;
|
|
35
36
|
|
|
36
37
|
width: 50vw;
|
|
38
|
+
max-width: calc(var(--tableWidth) / 2);
|
|
37
39
|
|
|
38
40
|
&:first-child {
|
|
39
41
|
background-color: white;
|
|
@@ -60,6 +62,13 @@ $cell-min-width: 256px;
|
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
h4.cell {
|
|
66
|
+
// Set the max width of the first column to the supplied firstColumnWidth (or 288px if not specified) but only
|
|
67
|
+
// if this value does not exceed half of the table's width.
|
|
68
|
+
// This is to ensure that the first column is at most as wide as half the table, which will be the case on mobile where only the first column and one other are shown.
|
|
69
|
+
max-width: min(var(--firstColumnWidth, 288px), calc(var(--tableWidth) / 2));
|
|
70
|
+
}
|
|
71
|
+
|
|
63
72
|
.title {
|
|
64
73
|
position: relative;
|
|
65
74
|
color: $ds-grey-900;
|
|
@@ -2,15 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
|
|
4
4
|
import ArrowIcon from './Arrow';
|
|
5
|
-
import { ActiveTableArrows } from '../../hooks/useActiveTableArrows';
|
|
6
|
-
|
|
7
5
|
import styles from './style.module.scss';
|
|
8
6
|
|
|
9
7
|
export type ArrowValues = 'prev' | 'next';
|
|
10
8
|
|
|
11
9
|
interface TableArrowsProps {
|
|
12
10
|
onClick: (value: ArrowValues) => void;
|
|
13
|
-
active:
|
|
11
|
+
active: { left: boolean; right: boolean };
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
const TableArrows = (props: TableArrowsProps) => {
|
|
@@ -18,7 +16,7 @@ const TableArrows = (props: TableArrowsProps) => {
|
|
|
18
16
|
const handleButtonClick = (value: ArrowValues) => () => onClick(value);
|
|
19
17
|
|
|
20
18
|
return (
|
|
21
|
-
<div className={
|
|
19
|
+
<div className={styles.container}>
|
|
22
20
|
<button
|
|
23
21
|
onClick={handleButtonClick('prev')}
|
|
24
22
|
className={classNames(
|