@wayke-se/components-react 2.13.0 → 2.16.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.
Files changed (29) hide show
  1. package/dist-node/index.js +171 -15
  2. package/dist-node/index.js.map +1 -1
  3. package/dist-src/components/Content/wrapper.js +5 -0
  4. package/dist-src/components/InsuranceOptions/Insurance.js +26 -0
  5. package/dist-src/components/InsuranceOptions/InsuranceFree.js +31 -0
  6. package/dist-src/components/InsuranceOptions/InsuranceFreeModal.js +20 -0
  7. package/dist-src/components/InsuranceOptions/{InsuranceOptionModal.js → InsuranceModal.js} +3 -3
  8. package/dist-src/components/InsuranceOptions/index.js +10 -21
  9. package/dist-src/components/Pdf/index.js +11 -0
  10. package/dist-src/components/Pdf/wrapper.js +55 -0
  11. package/dist-src/hooks/useInsurance.js +3 -2
  12. package/dist-src/layouts/searchItem/MetadataItem.js +2 -2
  13. package/dist-src/layouts/searchItem/index.js +14 -2
  14. package/dist-src/queries/INSURANCE_CALCULATION.js +7 -1
  15. package/dist-src/queries/SEARCH_ITEM_BRANCH_QUERY.js +14 -0
  16. package/dist-src/queries/SEARCH_ITEM_QUERY.js +10 -2
  17. package/dist-types/@types/codegen/types.d.ts +66 -42
  18. package/dist-types/components/InsuranceOptions/Insurance.d.ts +9 -0
  19. package/dist-types/components/InsuranceOptions/InsuranceFree.d.ts +7 -0
  20. package/dist-types/components/InsuranceOptions/InsuranceFreeModal.d.ts +8 -0
  21. package/dist-types/components/InsuranceOptions/InsuranceModal.d.ts +10 -0
  22. package/dist-types/components/InsuranceOptions/index.d.ts +3 -2
  23. package/dist-types/components/Pdf/index.d.ts +11 -0
  24. package/dist-types/components/Pdf/wrapper.d.ts +11 -0
  25. package/dist-types/hooks/useInsurance.d.ts +1 -1
  26. package/dist-web/index.js +168 -13
  27. package/dist-web/index.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist-types/components/InsuranceOptions/InsuranceOptionModal.d.ts +0 -9
@@ -39,6 +39,11 @@ export const Wrapper = styled.div `
39
39
  }
40
40
  }
41
41
 
42
+ img {
43
+ display: block;
44
+ width: 100%;
45
+ }
46
+
42
47
  ${({ small }) => small &&
43
48
  css `
44
49
  font-size: 0.875rem;
@@ -0,0 +1,26 @@
1
+ import React, { useState, useCallback } from 'react';
2
+ import { Repeat, RepeatTiny } from '../Repeat/index';
3
+ import { VisualHeading } from '../Heading/index';
4
+ import OptionBox from '../OptionBox/index';
5
+ import { OptionBoxHeading, OptionBoxContent } from '../OptionBox/wrapper';
6
+ import { ButtonInline } from '../Button/index';
7
+ import InsuranceModal from './InsuranceModal';
8
+ const Insurance = ({ id, branch, insuranceOptions }) => {
9
+ const [modal, setModal] = useState(false);
10
+ const toggleModal = useCallback(() => setModal(!modal), [modal]);
11
+ if (!insuranceOptions.length) {
12
+ return null;
13
+ }
14
+ return (React.createElement(React.Fragment, null,
15
+ modal && (React.createElement(InsuranceModal, { id: id, branch: branch, onClose: toggleModal, insuranceOptions: insuranceOptions[0] })),
16
+ React.createElement(Repeat, null,
17
+ React.createElement(RepeatTiny, null,
18
+ React.createElement(VisualHeading, null, "V\u00E4lj till f\u00F6rs\u00E4kring")),
19
+ React.createElement(RepeatTiny, null,
20
+ React.createElement(React.Fragment, null, insuranceOptions.map((insuranceOption, index) => (React.createElement(OptionBox, { key: `${insuranceOption.url}-${index}`, logo: insuranceOption.logotype || undefined, logoAlt: insuranceOption.name || 'Logotyp' },
21
+ React.createElement(OptionBoxHeading, null, "F\u00E5 prisf\u00F6rslag"),
22
+ React.createElement(OptionBoxContent, null,
23
+ React.createElement("p", null,
24
+ React.createElement(ButtonInline, { onClick: toggleModal }, "Mer information")))))))))));
25
+ };
26
+ export default Insurance;
@@ -0,0 +1,31 @@
1
+ import React, { useState, useCallback } from 'react';
2
+ import { Repeat, RepeatTiny } from '../Repeat/index';
3
+ import { VisualHeading } from '../Heading/index';
4
+ import OptionBox from '../OptionBox/index';
5
+ import { OptionBoxContent } from '../OptionBox/wrapper';
6
+ import Content from '../Content/index';
7
+ import { marked } from 'marked';
8
+ import { ButtonInline } from '../Button/index';
9
+ import InsuranceFreeModal from './InsuranceFreeModal';
10
+ const Insurance = ({ insuranceOptions }) => {
11
+ var _a, _b;
12
+ const [modal, setModal] = useState(false);
13
+ const toggleModal = useCallback(() => setModal(!modal), [modal]);
14
+ if (!insuranceOptions.length) {
15
+ return null;
16
+ }
17
+ return (React.createElement(React.Fragment, null,
18
+ modal && React.createElement(InsuranceFreeModal, { onClose: toggleModal, insuranceOptions: insuranceOptions[0] }),
19
+ React.createElement(Repeat, null,
20
+ React.createElement(RepeatTiny, null,
21
+ React.createElement(VisualHeading, null, (_b = (_a = insuranceOptions[0]) === null || _a === void 0 ? void 0 : _a.insuranceHeader) !== null && _b !== void 0 ? _b : 'Försäkring')),
22
+ React.createElement(RepeatTiny, null,
23
+ React.createElement(React.Fragment, null, insuranceOptions.map((insuranceOption, index) => (React.createElement(OptionBox, { key: `${insuranceOption.url}-${index}`, logo: insuranceOption.logotype || undefined, logoAlt: insuranceOption.name || 'Logotyp' },
24
+ insuranceOption.description && (React.createElement(Content, { dangerouslySetInnerHTML: {
25
+ __html: marked(insuranceOption.description),
26
+ } })),
27
+ React.createElement(OptionBoxContent, null,
28
+ React.createElement("p", null,
29
+ React.createElement(ButtonInline, { onClick: toggleModal }, "Mer information")))))))))));
30
+ };
31
+ export default Insurance;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import Modal from '../Modal/index';
3
+ import Content from '../Content/index';
4
+ import { Repeat } from '../Repeat/index';
5
+ import { ButtonInline } from '../Button/index';
6
+ import LogoBox from '../LogoBox/index';
7
+ import { marked } from 'marked';
8
+ const InsuranceFreeModal = ({ onClose, insuranceOptions }) => {
9
+ var _a;
10
+ return (React.createElement(Modal, { title: (_a = insuranceOptions === null || insuranceOptions === void 0 ? void 0 : insuranceOptions.insuranceHeader) !== null && _a !== void 0 ? _a : 'Försäkring', onClose: onClose },
11
+ (insuranceOptions === null || insuranceOptions === void 0 ? void 0 : insuranceOptions.longDescription) && (React.createElement(Repeat, null,
12
+ React.createElement(Content, { dangerouslySetInnerHTML: {
13
+ __html: marked(insuranceOptions.longDescription),
14
+ } }))),
15
+ (insuranceOptions === null || insuranceOptions === void 0 ? void 0 : insuranceOptions.url) && (React.createElement(Repeat, null,
16
+ React.createElement(ButtonInline, { as: "a", href: insuranceOptions.url, target: "_blank", rel: "noopener noreferrer" }, "L\u00E4s mer om f\u00F6rs\u00E4kringen (\u00D6ppnas i ett nytt f\u00F6nster)"))),
17
+ (insuranceOptions === null || insuranceOptions === void 0 ? void 0 : insuranceOptions.logotype) && (React.createElement(Repeat, null,
18
+ React.createElement(LogoBox, { logo: insuranceOptions.logotype, alt: insuranceOptions.name || 'Logotyp', wide: true })))));
19
+ };
20
+ export default InsuranceFreeModal;
@@ -22,13 +22,13 @@ import Loader from '../Loader/index';
22
22
  import { numberSeparator } from '../../utils/formats';
23
23
  import { DrivingDistance } from '../../@types/codegen/types';
24
24
  import PubSub from '../../utils/pubsub/pubsub';
25
- const InsuranceOptionModal = ({ id, onClose, insuranceOptions }) => {
25
+ const InsuranceModal = ({ id, branch, onClose, insuranceOptions }) => {
26
26
  const [form, setForm] = useState({
27
27
  ssn: '',
28
28
  drivingDistance: DrivingDistance.Between0And1000,
29
29
  });
30
30
  const [payload, setPayload] = useState();
31
- const { loading, data, error } = useInsuranceCalculation(id, ssnIsValid(payload === null || payload === void 0 ? void 0 : payload.ssn) ? payload === null || payload === void 0 ? void 0 : payload.ssn : undefined, payload === null || payload === void 0 ? void 0 : payload.drivingDistance);
31
+ const { loading, data, error } = useInsuranceCalculation(id, (branch === null || branch === void 0 ? void 0 : branch.id) ? branch === null || branch === void 0 ? void 0 : branch.id : undefined, ssnIsValid(payload === null || payload === void 0 ? void 0 : payload.ssn) ? payload === null || payload === void 0 ? void 0 : payload.ssn : undefined, payload === null || payload === void 0 ? void 0 : payload.drivingDistance);
32
32
  const onChangeSsn = useCallback((e) => setForm({ ...form, ssn: e.currentTarget.value }), [form]);
33
33
  const onChangeDrivingDistance = useCallback((e) => setForm({ ...form, drivingDistance: e.currentTarget.value }), [form]);
34
34
  const onShowInsurances = useCallback(() => {
@@ -102,4 +102,4 @@ const InsuranceOptionModal = ({ id, onClose, insuranceOptions }) => {
102
102
  " ",
103
103
  addon.unit)))))))))))))))));
104
104
  };
105
- export default InsuranceOptionModal;
105
+ export default InsuranceModal;
@@ -1,26 +1,15 @@
1
- import React, { useState, useCallback } from 'react';
2
- import { Repeat, RepeatTiny } from '../Repeat/index';
3
- import { VisualHeading } from '../Heading/index';
4
- import OptionBox from '../OptionBox/index';
5
- import { OptionBoxHeading, OptionBoxContent } from '../OptionBox/wrapper';
6
- import { ButtonInline } from '../Button/index';
7
- import InsuranceOptionModal from './InsuranceOptionModal';
8
- const InsuranceOptions = ({ id, insuranceOptions }) => {
9
- const [modal, setModal] = useState(false);
10
- const toggleModal = useCallback(() => setModal(!modal), [modal]);
1
+ import React from 'react';
2
+ import Insurance from './Insurance';
3
+ import InsuranceFree from './InsuranceFree';
4
+ const InsuranceOptions = ({ id, branch, insuranceOptions }) => {
11
5
  if (!insuranceOptions.length) {
12
6
  return null;
13
7
  }
14
- return (React.createElement(React.Fragment, null,
15
- modal && (React.createElement(InsuranceOptionModal, { id: id, onClose: toggleModal, insuranceOptions: insuranceOptions[0] })),
16
- React.createElement(Repeat, null,
17
- React.createElement(RepeatTiny, null,
18
- React.createElement(VisualHeading, null, "V\u00E4lj till f\u00F6rs\u00E4kring")),
19
- React.createElement(RepeatTiny, null,
20
- React.createElement(React.Fragment, null, insuranceOptions.map((insuranceOption, index) => (React.createElement(OptionBox, { key: `${insuranceOption.url}-${index}`, logo: insuranceOption.logotype || undefined, logoAlt: insuranceOption.name || 'Logotyp' },
21
- React.createElement(OptionBoxHeading, null, "F\u00E5 prisf\u00F6rslag"),
22
- React.createElement(OptionBoxContent, null,
23
- React.createElement("p", null,
24
- React.createElement(ButtonInline, { onClick: toggleModal }, "Mer information")))))))))));
8
+ if (insuranceOptions.length > 0) {
9
+ if (insuranceOptions[0].requiresDistance && insuranceOptions[0].requiresPersonalNumber)
10
+ return React.createElement(Insurance, { id: id, branch: branch, insuranceOptions: insuranceOptions });
11
+ return React.createElement(InsuranceFree, { insuranceOptions: insuranceOptions });
12
+ }
13
+ return null;
25
14
  };
26
15
  export default InsuranceOptions;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { PdfListItem, PdfSubtitle, PdfTitle, PdfContainer, PdfListInner, PdfLink, PdfColumn, } from './wrapper';
3
+ export const PdfDownloadItem = ({ document }) => (React.createElement(PdfListItem, null,
4
+ React.createElement(PdfListInner, null,
5
+ React.createElement(PdfColumn, null,
6
+ React.createElement(PdfTitle, null, document.name),
7
+ React.createElement(PdfSubtitle, null, document.contentType)),
8
+ React.createElement(PdfColumn, null,
9
+ React.createElement(PdfLink, { href: document.url, rel: "noopener noreferrer nofollow", target: "_blank" }, "\u00D6ppna")))));
10
+ export const PdfDownloadContainer = ({ documents }) => (React.createElement(PdfContainer, null, documents.map((document, i) => (React.createElement(PdfDownloadItem, { key: `${document.url}-${i}`, document: document })))));
11
+ export default PdfDownloadContainer;
@@ -0,0 +1,55 @@
1
+ import styled from 'styled-components';
2
+ import { size } from '../../layout/helpers';
3
+ export const PdfListItem = styled.li.attrs(() => ({
4
+ className: 'wayke__theme wayke__color--primary-text',
5
+ })) `
6
+ flex: 0 0 50%;
7
+ padding: ${size(1)};
8
+
9
+ ${({ theme }) => theme.breakpoint.LtSm} {
10
+ flex: 0 0 100%;
11
+ }
12
+ `;
13
+ export const PdfContainer = styled.ul `
14
+ list-style: none;
15
+ padding: 0;
16
+ display: flex;
17
+ flex-wrap: wrap;
18
+ margin: ${size(-1)};
19
+ `;
20
+ export const PdfLink = styled.a.attrs(() => ({
21
+ className: 'wayke__theme wayke__color--primary-text wayke__font--bold',
22
+ })) `
23
+ text-decoration: none;
24
+ font-size: 0.875rem;
25
+ &:after {
26
+ content: '';
27
+ position: absolute;
28
+ top: 0;
29
+ left: 0;
30
+ width: 100%;
31
+ height: 100%;
32
+ }
33
+ `;
34
+ export const PdfTitle = styled.div `
35
+ color: ${(props) => props.theme.color.textDark};
36
+ `;
37
+ export const PdfSubtitle = styled.div `
38
+ color: ${(props) => props.theme.color.textDarkLighten};
39
+ `;
40
+ export const PdfColumn = styled.div `
41
+ flex 0 0 auto;
42
+ &:first-child {
43
+ flex: 1 1 auto;
44
+ }
45
+ `;
46
+ export const PdfListInner = styled.div `
47
+ position: relative;
48
+ border: 1px solid ${(props) => props.theme.color.border};
49
+ padding: ${size(1.5)};
50
+ display: flex;
51
+ align-items: center;
52
+ :hover {
53
+ background-color: ${(props) => props.theme.color.hoverOverlay};
54
+ }
55
+ `;
@@ -1,11 +1,12 @@
1
1
  import { useQuery } from '@apollo/client';
2
2
  import INSURANCE_CALCULATION from '../queries/INSURANCE_CALCULATION';
3
- const useInsuranceCalculation = (id, personalNumber, drivingDistance) => useQuery(INSURANCE_CALCULATION, {
3
+ const useInsuranceCalculation = (id, branchId, personalNumber, drivingDistance) => useQuery(INSURANCE_CALCULATION, {
4
4
  variables: {
5
5
  id,
6
+ branch: branchId,
6
7
  personalNumber: personalNumber,
7
8
  drivingDistance: drivingDistance,
8
9
  },
9
- skip: personalNumber === undefined || drivingDistance === undefined,
10
+ skip: personalNumber === undefined || drivingDistance === undefined || branchId === undefined,
10
11
  });
11
12
  export default useInsuranceCalculation;
@@ -2,7 +2,7 @@ import React, { useState, useCallback } from 'react';
2
2
  import { TableListItem, TableListKey, TableListValue, TableListBooleanPos, TableListBooleanNeg, } from '../../components/TableList/index';
3
3
  import { IconCheck, IconCancel } from '../../components/Icon/index';
4
4
  import { SrOnly } from '../../components/SrOnly/index';
5
- import { ButtonInlinePrimary } from '../../components/Button/index';
5
+ import { ButtonInline } from '../../components/Button/index';
6
6
  import Modal from '../../components/Modal/index';
7
7
  import Content from '../../components/Content/index';
8
8
  const formatValue = (value, unit) => {
@@ -26,7 +26,7 @@ const MetadataItem = ({ name, hint, value, unit }) => {
26
26
  const onToggleFoldout = useCallback(() => setFoldout(!foldout), [foldout]);
27
27
  const presentedValue = formatValue(value, unit);
28
28
  return (React.createElement(TableListItem, null,
29
- React.createElement(TableListKey, null, hint ? (React.createElement(ButtonInlinePrimary, { onClick: onToggleFoldout, title: `Mer information om ${name}` }, name)) : (name)),
29
+ React.createElement(TableListKey, null, hint ? (React.createElement(ButtonInline, { onClick: onToggleFoldout, title: `Mer information om ${name}` }, name)) : (name)),
30
30
  React.createElement(TableListValue, null, value !== undefined ? presentedValue : 'Uppgift saknas'),
31
31
  hint && foldout && (React.createElement(Modal, { title: name, onClose: onToggleFoldout },
32
32
  React.createElement(Content, { dangerouslySetInnerHTML: { __html: hint } })))));
@@ -31,6 +31,7 @@ import Page404 from './Page404';
31
31
  import PageLoading from './PageLoading';
32
32
  import PubSub from '../../utils/pubsub/pubsub';
33
33
  import Property from './Property';
34
+ import PdfDownloadContainer from '../../components/Pdf/index';
34
35
  const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, onClickSearchItem, }) => {
35
36
  var _a, _b, _c;
36
37
  const [ecomModal, setEcomModal] = useState(false);
@@ -61,7 +62,10 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
61
62
  const { vehicle } = result;
62
63
  const contact = centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.contact;
63
64
  const branch = centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.branch;
64
- const { title, shortDescription, media, description, price, financialOptions, insuranceOptions, manufacturer, ecommerce, packageOptions, publishedAt, } = vehicle;
65
+ const { title, shortDescription, media, description, price, financialOptions, manufacturer, ecommerce, packageOptions, publishedAt, documents, } = vehicle;
66
+ const insuranceOptions = (centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.insuranceOptions)
67
+ ? centralStorageVehicle.insuranceOptions
68
+ : vehicle.insuranceOptions;
65
69
  const { fuelType, mileage, gearbox, modelYear, propertySet } = vehicle.data;
66
70
  const uspList = [
67
71
  {
@@ -104,7 +108,7 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
104
108
  React.createElement(PriceTable, { price: price })),
105
109
  (financialOptions.length > 0 || insuranceOptions.length > 0) && (React.createElement(ProductPageAsideSection, { mobileOrder: 4 },
106
110
  financialOptions.length > 0 && (React.createElement(FinancialOptions, { id: id, financialOptions: financialOptions })),
107
- insuranceOptions.length > 0 && (React.createElement(InsuranceOptions, { id: id, insuranceOptions: insuranceOptions })))),
111
+ insuranceOptions.length > 0 && (React.createElement(InsuranceOptions, { id: id, branch: centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.branch, insuranceOptions: insuranceOptions })))),
108
112
  React.createElement(ProductPageAsideSection, { mobileOrder: 5 },
109
113
  React.createElement(CheckList, { manufacturer: manufacturer, packageOptions: packageOptions, ecommerce: ecommerce, branch: branch, contact: centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.contact, loadingCentralStorageVehicle: loadingCentralStorageVehicle, toggleEcomModal: toggleEcomModal }))),
110
114
  React.createElement(ProductPageMain, null,
@@ -131,6 +135,14 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
131
135
  React.createElement(Repeat, null,
132
136
  React.createElement(ExtendContent, { actionTitle: "Visa mer", onClick: onShowMoreOptionsClick },
133
137
  React.createElement(UspList, { items: options }))))),
138
+ (documents.length || 0) > 0 && (React.createElement(ProductPageMainSection, null,
139
+ React.createElement(Repeat, null,
140
+ React.createElement(H2, { noMargin: true }, "Dokument")),
141
+ React.createElement(Repeat, null,
142
+ React.createElement(Content, null,
143
+ React.createElement("p", null, "Tillh\u00F6rande dokument f\u00F6r bilen."))),
144
+ React.createElement(Repeat, null,
145
+ React.createElement(PdfDownloadContainer, { documents: documents })))),
134
146
  React.createElement(ProductPageMainSection, null,
135
147
  React.createElement(Branch, { branch: branch, loading: loadingCentralStorageVehicle }),
136
148
  ecommerce && ecommerce.enabled && (React.createElement(Repeat, null,
@@ -2,10 +2,16 @@ import { gql } from '@apollo/client';
2
2
  const INSURANCE_CALCULATION = gql `
3
3
  query InsuranceCalculation(
4
4
  $id: ID!
5
+ $branch: ID
5
6
  $personalNumber: PersonalNumber!
6
7
  $drivingDistance: DrivingDistance!
7
8
  ) {
8
- insurances(id: $id, personalNumber: $personalNumber, drivingDistance: $drivingDistance) {
9
+ insurances(
10
+ id: $id
11
+ branch: $branch
12
+ personalNumber: $personalNumber
13
+ drivingDistance: $drivingDistance
14
+ ) {
9
15
  name
10
16
  price
11
17
  unit
@@ -96,6 +96,20 @@ const SEARCH_ITEM_BRANCH_QUERY = gql `
96
96
  title
97
97
  }
98
98
  }
99
+ insuranceOptions {
100
+ insuranceHeader
101
+ institute
102
+ identifier
103
+ logotype
104
+ name
105
+ description
106
+ longDescription
107
+ url
108
+ insuranceText
109
+ requiresPersonalNumber
110
+ requiresDistance
111
+ terms
112
+ }
99
113
  }
100
114
  }
101
115
  ${HoursOpen}
@@ -18,6 +18,7 @@ const SEARCH_ITEM_QUERY = gql `
18
18
  query SearchItem($id: ID!) {
19
19
  vehicle(id: $id) {
20
20
  id
21
+ documents
21
22
  contact {
22
23
  name
23
24
  email
@@ -157,10 +158,17 @@ const SEARCH_ITEM_QUERY = gql `
157
158
  withHomeDelivery
158
159
  }
159
160
  insuranceOptions {
160
- description
161
+ insuranceHeader
162
+ institute
163
+ identifier
161
164
  logotype
162
- url
163
165
  name
166
+ description
167
+ longDescription
168
+ url
169
+ insuranceText
170
+ requiresPersonalNumber
171
+ requiresDistance
164
172
  terms
165
173
  }
166
174
  financialOptions {
@@ -1,4 +1,5 @@
1
1
  export declare type Maybe<T> = T | null;
2
+ export declare type InputMaybe<T> = Maybe<T>;
2
3
  export declare type Exact<T extends {
3
4
  [key: string]: unknown;
4
5
  }> = {
@@ -19,6 +20,11 @@ export declare type Scalars = {
19
20
  Float: number;
20
21
  DateTime: Date;
21
22
  Email: string;
23
+ FileDocument: {
24
+ contentType: string;
25
+ name: string;
26
+ url: string;
27
+ };
22
28
  PersonalNumber: string;
23
29
  PhoneNumber: string;
24
30
  Time: string;
@@ -30,38 +36,38 @@ export declare type Scalars = {
30
36
  };
31
37
  export declare type Branch = {
32
38
  __typename?: 'Branch';
33
- id: Scalars['ID'];
39
+ connections: Array<BranchConnection>;
40
+ contact?: Maybe<ContactOptions>;
34
41
  description?: Maybe<Scalars['String']>;
35
42
  flags?: Maybe<BranchFlags>;
36
- name?: Maybe<Scalars['String']>;
37
- contact?: Maybe<ContactOptions>;
38
43
  homepage?: Maybe<Scalars['URL']>;
44
+ id: Scalars['ID'];
45
+ location?: Maybe<Location>;
39
46
  logotype?: Maybe<Scalars['URL']>;
47
+ name?: Maybe<Scalars['String']>;
40
48
  openingHours?: Maybe<OpeningHours>;
41
49
  organization?: Maybe<Organization>;
42
- location?: Maybe<Location>;
43
50
  promos: Array<Promo>;
44
51
  services: Array<Service>;
45
- connections: Array<BranchConnection>;
46
52
  };
47
53
  export declare type BranchConnection = {
48
54
  __typename?: 'BranchConnection';
49
55
  id: Scalars['ID'];
50
- name?: Maybe<Scalars['String']>;
51
56
  location?: Maybe<Location>;
57
+ name?: Maybe<Scalars['String']>;
52
58
  };
53
59
  export declare type BranchFlags = {
54
60
  __typename?: 'BranchFlags';
55
- mrf?: Maybe<Scalars['Boolean']>;
56
61
  centralStorage?: Maybe<Scalars['Boolean']>;
57
62
  ecommerce?: Maybe<Scalars['Boolean']>;
63
+ mrf?: Maybe<Scalars['Boolean']>;
58
64
  };
59
65
  export declare type ContactOptions = {
60
66
  __typename?: 'ContactOptions';
61
- name?: Maybe<Scalars['String']>;
67
+ avatar?: Maybe<Scalars['URL']>;
62
68
  email?: Maybe<Scalars['Email']>;
69
+ name?: Maybe<Scalars['String']>;
63
70
  phonenumber?: Maybe<Scalars['PhoneNumber']>;
64
- avatar?: Maybe<Scalars['URL']>;
65
71
  };
66
72
  export declare enum DrivingDistance {
67
73
  Between0And1000 = "BETWEEN0AND1000",
@@ -74,8 +80,8 @@ export declare type Ecommerce = {
74
80
  __typename?: 'Ecommerce';
75
81
  enabled?: Maybe<Scalars['Boolean']>;
76
82
  reserved?: Maybe<Scalars['Boolean']>;
77
- withTradeIn?: Maybe<Scalars['Boolean']>;
78
83
  withHomeDelivery?: Maybe<Scalars['Boolean']>;
84
+ withTradeIn?: Maybe<Scalars['Boolean']>;
79
85
  };
80
86
  export declare type FinancialOption = {
81
87
  __typename?: 'FinancialOption';
@@ -122,30 +128,30 @@ export declare type HoursOpen = {
122
128
  };
123
129
  export declare type Insurance = {
124
130
  __typename?: 'Insurance';
125
- name: Scalars['String'];
126
- price: Scalars['Float'];
127
- unit: Scalars['String'];
128
- description: Scalars['String'];
129
- logotype?: Maybe<Scalars['URL']>;
130
131
  addons: Array<InsuranceAddon>;
132
+ description: Scalars['String'];
131
133
  items: Array<InsuranceItem>;
132
134
  legality?: Maybe<InsuranceLegality>;
135
+ logotype?: Maybe<Scalars['URL']>;
136
+ name: Scalars['String'];
137
+ price: Scalars['Float'];
133
138
  terms?: Maybe<Scalars['URL']>;
139
+ unit: Scalars['String'];
134
140
  url?: Maybe<Scalars['URL']>;
135
141
  };
136
142
  export declare type InsuranceAddon = {
137
143
  __typename?: 'InsuranceAddon';
138
- id: Scalars['ID'];
139
- title?: Maybe<Scalars['String']>;
140
144
  description?: Maybe<Scalars['String']>;
145
+ exclusions: Array<Scalars['String']>;
146
+ id: Scalars['ID'];
141
147
  price: Scalars['Float'];
148
+ title?: Maybe<Scalars['String']>;
142
149
  unit: Scalars['String'];
143
- exclusions: Array<Scalars['String']>;
144
150
  };
145
151
  export declare type InsuranceItem = {
146
152
  __typename?: 'InsuranceItem';
147
- name?: Maybe<Scalars['String']>;
148
153
  description?: Maybe<Scalars['String']>;
154
+ name?: Maybe<Scalars['String']>;
149
155
  };
150
156
  export declare type InsuranceLegality = {
151
157
  __typename?: 'InsuranceLegality';
@@ -155,8 +161,16 @@ export declare type InsuranceLegality = {
155
161
  export declare type InsuranceOption = {
156
162
  __typename?: 'InsuranceOption';
157
163
  description?: Maybe<Scalars['String']>;
164
+ identifier?: Maybe<Scalars['String']>;
165
+ institute?: Maybe<Scalars['String']>;
166
+ insuranceHeader?: Maybe<Scalars['String']>;
167
+ insuranceText?: Maybe<Scalars['String']>;
158
168
  logotype?: Maybe<Scalars['URL']>;
169
+ longDescription?: Maybe<Scalars['String']>;
159
170
  name?: Maybe<Scalars['String']>;
171
+ requiresDistance?: Maybe<Scalars['Boolean']>;
172
+ requiresPersonalNumber?: Maybe<Scalars['Boolean']>;
173
+ /** @deprecated No longer supported */
160
174
  terms?: Maybe<Scalars['URL']>;
161
175
  url?: Maybe<Scalars['URL']>;
162
176
  };
@@ -169,9 +183,9 @@ export declare type Location = {
169
183
  __typename?: 'Location';
170
184
  city?: Maybe<Scalars['String']>;
171
185
  county?: Maybe<Scalars['String']>;
172
- streetAddress?: Maybe<Scalars['String']>;
173
- postalCode?: Maybe<Scalars['String']>;
174
186
  position?: Maybe<Position>;
187
+ postalCode?: Maybe<Scalars['String']>;
188
+ streetAddress?: Maybe<Scalars['String']>;
175
189
  };
176
190
  export declare type Manufacturer = {
177
191
  __typename?: 'Manufacturer';
@@ -182,8 +196,8 @@ export declare type Manufacturer = {
182
196
  };
183
197
  export declare type Media = {
184
198
  __typename?: 'Media';
185
- type: Scalars['String'];
186
199
  files: Array<MediaFile>;
200
+ type: Scalars['String'];
187
201
  };
188
202
  export declare type MediaFile = {
189
203
  __typename?: 'MediaFile';
@@ -197,17 +211,24 @@ export declare type MediaFileFormat = {
197
211
  };
198
212
  export declare type OpeningHours = {
199
213
  __typename?: 'OpeningHours';
200
- monday?: Maybe<HoursOpen>;
201
- tuesday?: Maybe<HoursOpen>;
202
- wednesday?: Maybe<HoursOpen>;
203
- thursday?: Maybe<HoursOpen>;
204
214
  friday?: Maybe<HoursOpen>;
215
+ monday?: Maybe<HoursOpen>;
205
216
  saturday?: Maybe<HoursOpen>;
206
217
  sunday?: Maybe<HoursOpen>;
218
+ thursday?: Maybe<HoursOpen>;
219
+ tuesday?: Maybe<HoursOpen>;
220
+ wednesday?: Maybe<HoursOpen>;
207
221
  };
208
222
  export declare type Organization = {
209
223
  __typename?: 'Organization';
210
224
  branches: Array<Maybe<Branch>>;
225
+ contact?: Maybe<ContactOptions>;
226
+ description?: Maybe<Scalars['String']>;
227
+ flags?: Maybe<BranchFlags>;
228
+ homepage?: Maybe<Scalars['URL']>;
229
+ id: Scalars['ID'];
230
+ logotype?: Maybe<Scalars['URL']>;
231
+ name?: Maybe<Scalars['String']>;
211
232
  parent?: Maybe<Branch>;
212
233
  };
213
234
  export declare type PackageOption = {
@@ -231,35 +252,37 @@ export declare type Promo = {
231
252
  };
232
253
  export declare type Query = {
233
254
  __typename?: 'Query';
234
- vehicle?: Maybe<Vehicle>;
235
255
  branch?: Maybe<Branch>;
236
- loan?: Maybe<FinancialOption>;
237
256
  insurances: Array<Insurance>;
257
+ loan?: Maybe<FinancialOption>;
258
+ vehicle?: Maybe<Vehicle>;
238
259
  };
239
- export declare type QueryVehicleArgs = {
260
+ export declare type QueryBranchArgs = {
240
261
  id: Scalars['ID'];
241
- branch?: Maybe<Scalars['ID']>;
242
262
  };
243
- export declare type QueryBranchArgs = {
263
+ export declare type QueryInsurancesArgs = {
264
+ branch?: InputMaybe<Scalars['ID']>;
265
+ drivingDistance: DrivingDistance;
244
266
  id: Scalars['ID'];
267
+ personalNumber: Scalars['PersonalNumber'];
245
268
  };
246
269
  export declare type QueryLoanArgs = {
247
- id: Scalars['ID'];
248
- duration: Scalars['Int'];
270
+ branch?: InputMaybe<Scalars['ID']>;
249
271
  downPayment: Scalars['Int'];
272
+ duration: Scalars['Int'];
273
+ id: Scalars['ID'];
250
274
  residual: Scalars['Float'];
251
275
  };
252
- export declare type QueryInsurancesArgs = {
276
+ export declare type QueryVehicleArgs = {
277
+ branch?: InputMaybe<Scalars['ID']>;
253
278
  id: Scalars['ID'];
254
- personalNumber: Scalars['PersonalNumber'];
255
- drivingDistance: DrivingDistance;
256
279
  };
257
280
  export declare type SafetyOption = {
258
281
  __typename?: 'SafetyOption';
259
282
  content?: Maybe<Scalars['String']>;
283
+ image?: Maybe<Scalars['URL']>;
260
284
  name?: Maybe<Scalars['String']>;
261
285
  title?: Maybe<Scalars['String']>;
262
- image?: Maybe<Scalars['URL']>;
263
286
  };
264
287
  export declare type Service = {
265
288
  __typename?: 'Service';
@@ -268,22 +291,23 @@ export declare type Service = {
268
291
  };
269
292
  export declare type Vehicle = {
270
293
  __typename?: 'Vehicle';
271
- id: Scalars['ID'];
272
294
  branch?: Maybe<Branch>;
273
295
  contact?: Maybe<ContactOptions>;
274
296
  data: VehicleData;
275
297
  description?: Maybe<Scalars['String']>;
276
298
  discount?: Maybe<Scalars['Float']>;
299
+ documents: Array<Scalars['FileDocument']>;
277
300
  ecommerce?: Maybe<Ecommerce>;
278
301
  financialOptions: Array<FinancialOption>;
279
302
  flags?: Maybe<VehicleFlags>;
303
+ id: Scalars['ID'];
280
304
  insuranceOptions: Array<InsuranceOption>;
281
- publishedAt?: Maybe<Scalars['DateTime']>;
305
+ location?: Maybe<Location>;
282
306
  manufacturer?: Maybe<Manufacturer>;
283
307
  media: Array<Media>;
284
- location?: Maybe<Location>;
285
308
  packageOptions: Array<PackageOption>;
286
309
  price: Scalars['Float'];
310
+ publishedAt?: Maybe<Scalars['DateTime']>;
287
311
  safety: Array<SafetyOption>;
288
312
  shortDescription?: Maybe<Scalars['String']>;
289
313
  title: Scalars['String'];
@@ -309,8 +333,8 @@ export declare type VehicleData = {
309
333
  vin?: Maybe<Scalars['String']>;
310
334
  };
311
335
  export declare type VehicleDataPropertySetArgs = {
312
- properties?: Maybe<Array<Scalars['String']>>;
313
- category?: Maybe<Scalars['String']>;
336
+ category?: InputMaybe<Scalars['String']>;
337
+ properties?: InputMaybe<Array<Scalars['String']>>;
314
338
  };
315
339
  export declare type VehicleFlags = {
316
340
  __typename?: 'VehicleFlags';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { InsuranceOption, Branch } from '../../@types/codegen/types';
3
+ interface InsuranceOptions {
4
+ id: string;
5
+ branch?: Branch | null;
6
+ insuranceOptions: InsuranceOption[];
7
+ }
8
+ declare const Insurance: ({ id, branch, insuranceOptions }: InsuranceOptions) => JSX.Element | null;
9
+ export default Insurance;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { InsuranceOption } from '../../@types/codegen/types';
3
+ interface InsuranceOptions {
4
+ insuranceOptions: InsuranceOption[];
5
+ }
6
+ declare const Insurance: ({ insuranceOptions }: InsuranceOptions) => JSX.Element | null;
7
+ export default Insurance;