@mrfylke/contact-form 0.1.25 → 0.1.26
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 +41 -13
- package/lib/ContactFormRoot.d.ts.map +1 -1
- package/lib/ContactFormRoot.js +4 -3
- package/lib/components/icon/generated-icons.d.ts +15 -15
- package/lib/components/icon/generated-icons.js +54 -54
- package/lib/contact.module.css +0 -9
- package/lib/group-travel/index.d.ts.map +1 -1
- package/lib/group-travel/index.js +1 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/journey-info/index.d.ts.map +1 -1
- package/lib/journey-info/index.js +10 -8
- package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
- package/lib/journey-info/journeyInfoStateMachine.d.ts.map +1 -1
- package/lib/journey-info/journeyInfoStateMachine.js +1 -1
- package/lib/layouts/contact-pages.js +1 -1
- package/lib/lost-property/LostPropertyMachine.d.ts +2 -2
- package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
- package/lib/lost-property/LostPropertyMachine.js +1 -1
- package/lib/lost-property-external/index.d.ts.map +1 -1
- package/lib/lost-property-external/index.js +1 -2
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/serviceOfferingForm.js +3 -1
- package/lib/means-of-transport/index.d.ts.map +1 -1
- package/lib/means-of-transport/index.js +8 -2
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +4 -2
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
- package/lib/means-of-transport/means-of-transport-form-machine.js +9 -3
- package/lib/modules/config/context.d.ts +8 -1
- package/lib/modules/config/context.d.ts.map +1 -1
- package/lib/modules/config/context.js +7 -1
- package/lib/modules/config/default-submit.d.ts +3 -0
- package/lib/modules/config/default-submit.d.ts.map +1 -0
- package/lib/modules/config/default-submit.js +13 -0
- package/lib/modules/config/index.d.ts +1 -0
- package/lib/modules/config/index.d.ts.map +1 -1
- package/lib/modules/config/index.js +1 -0
- package/lib/modules/config/types.d.ts +52 -25
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/modules/org-data/index.d.ts +1 -2
- package/lib/modules/org-data/index.d.ts.map +1 -1
- package/lib/modules/org-data/index.js +1 -2
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +18 -2
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +19 -3
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
- package/lib/refund/forms/residualValueOnTravelCard/index.js +1 -2
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +9 -0
- package/lib/refund/refundFormMachine.d.ts +10 -2
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +23 -2
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.d.ts.map +1 -1
- package/lib/server/index.js +3 -1
- package/lib/server/submit-route-handler.d.ts +20 -0
- package/lib/server/submit-route-handler.d.ts.map +1 -0
- package/lib/server/submit-route-handler.js +62 -0
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.js +2 -2
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
- package/lib/ticket-control/forms/postponePayment.js +2 -2
- package/lib/ticket-control/index.d.ts.map +1 -1
- package/lib/ticket-control/index.js +2 -0
- package/lib/ticket-control/ticket-control-form-machine.d.ts +4 -2
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
- package/lib/ticket-control/ticket-control-form-machine.js +13 -4
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +1 -1
- package/lib/ticketing/ticketingStateMachine.d.ts +2 -2
- package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
- package/lib/translations/commons.d.ts +1 -0
- package/lib/translations/commons.d.ts.map +1 -1
- package/lib/translations/commons.js +4 -4
- package/lib/translations/index.d.ts +2 -6
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/index.js +1 -9
- package/lib/translations/language-context.d.ts +0 -8
- package/lib/translations/language-context.d.ts.map +1 -1
- package/lib/translations/language-context.js +1 -31
- package/lib/translations/merge-overrides.d.ts +1 -7
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +1 -13
- package/lib/translations/pages/contact.d.ts +9 -4
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +10 -5
- package/lib/translations/server/endpoints.d.ts +0 -62
- package/lib/translations/server/endpoints.d.ts.map +1 -1
- package/lib/translations/server/endpoints.js +0 -62
- package/lib/translations/types.d.ts +0 -6
- package/lib/translations/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/translations/common/index.d.ts +0 -3
- package/lib/translations/common/index.d.ts.map +0 -1
- package/lib/translations/common/index.js +0 -7
- package/lib/translations/common/layout.d.ts +0 -8
- package/lib/translations/common/layout.d.ts.map +0 -1
- package/lib/translations/common/layout.js +0 -11
- package/lib/translations/common/titles.d.ts +0 -4
- package/lib/translations/common/titles.d.ts.map +0 -1
- package/lib/translations/common/titles.js +0 -7
- package/lib/translations/json-to-override.d.ts +0 -19
- package/lib/translations/json-to-override.d.ts.map +0 -1
- package/lib/translations/json-to-override.js +0 -65
- package/lib/translations/load-org-translations.d.ts +0 -19
- package/lib/translations/load-org-translations.d.ts.map +0 -1
- package/lib/translations/load-org-translations.js +0 -23
package/README.md
CHANGED
|
@@ -64,37 +64,65 @@ export default function ContactPage() {
|
|
|
64
64
|
|
|
65
65
|
## API configuration
|
|
66
66
|
|
|
67
|
-
The package is decoupled from your backend.
|
|
67
|
+
The package is decoupled from your backend. By default, it POSTs to
|
|
68
|
+
`endpoints.submit` (`/api/contact/submit`) with `{ ...state, $slug: slug }`
|
|
69
|
+
in the body — no `onSubmit` needed:
|
|
68
70
|
|
|
69
71
|
```ts
|
|
70
|
-
|
|
72
|
+
api: {
|
|
73
|
+
endpoints: {
|
|
74
|
+
submit: '/api/contact/submit', // Optional, this is the default
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Pair that with `createSubmitRouteHandler` for the route itself — it reads
|
|
80
|
+
`$slug` from the body and forwards the rest to your connector at that path:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// app/api/contact/submit/route.ts
|
|
84
|
+
import { createSubmitRouteHandler } from '@mrfylke/contact-form/server';
|
|
85
|
+
|
|
86
|
+
export const POST = createSubmitRouteHandler({
|
|
87
|
+
request: (path, init) => fetch(`${process.env.CONNECTOR_URL}${path}`, init),
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Overriding the submit callback
|
|
92
|
+
|
|
93
|
+
For full control over routing, provide your own `onSubmit` callback instead —
|
|
94
|
+
it receives the form slug and form state:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import type { FormSlug } from '@mrfylke/contact-form';
|
|
71
98
|
|
|
72
99
|
const onSubmit = async (
|
|
73
|
-
|
|
100
|
+
slug: FormSlug,
|
|
74
101
|
state: Record<string, unknown>,
|
|
75
102
|
): Promise<Response> => {
|
|
76
103
|
return fetch('/api/contact/submit', {
|
|
77
104
|
method: 'POST',
|
|
78
105
|
headers: { 'Content-Type': 'application/json' },
|
|
79
|
-
body: JSON.stringify({ ...state, formType:
|
|
106
|
+
body: JSON.stringify({ ...state, formType: slug }),
|
|
80
107
|
});
|
|
81
108
|
};
|
|
82
109
|
```
|
|
83
110
|
|
|
84
|
-
|
|
111
|
+
See `FormSlug` for the full set of possible values.
|
|
85
112
|
|
|
86
113
|
### Routing submissions to different endpoints
|
|
87
114
|
|
|
88
115
|
```ts
|
|
89
|
-
const onSubmit = async (
|
|
90
|
-
const endpointMap: Record<
|
|
91
|
-
|
|
92
|
-
refund:
|
|
93
|
-
|
|
94
|
-
ticketing:
|
|
95
|
-
|
|
116
|
+
const onSubmit = async (slug: FormSlug, state) => {
|
|
117
|
+
const endpointMap: Record<FormSlug, string> = {
|
|
118
|
+
'ticket-control': '/api/contact/ticket-control',
|
|
119
|
+
refund: '/api/contact/refund',
|
|
120
|
+
'means-of-transport': '/api/contact/means-of-transport',
|
|
121
|
+
ticketing: '/api/contact/ticketing',
|
|
122
|
+
'journey-info': '/api/contact/journey-info',
|
|
123
|
+
'lost-property': '/api/contact/lost-property',
|
|
96
124
|
};
|
|
97
|
-
return fetch(endpointMap[
|
|
125
|
+
return fetch(endpointMap[slug], {
|
|
98
126
|
method: 'POST',
|
|
99
127
|
headers: { 'Content-Type': 'application/json' },
|
|
100
128
|
body: JSON.stringify(state),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactFormRoot.d.ts","sourceRoot":"","sources":["../src/ContactFormRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,+BAA+B,EACpC,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAQxB,MAAM,MAAM,oBAAoB,GAAG;IACjC,mEAAmE;IACnE,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,+BAA+B,CAAC;IACvD,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,EACR,KAAK,EACL,oBAAoB,EACpB,QAAQ,GACT,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ContactFormRoot.d.ts","sourceRoot":"","sources":["../src/ContactFormRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,+BAA+B,EACpC,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAQxB,MAAM,MAAM,oBAAoB,GAAG;IACjC,mEAAmE;IACnE,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,+BAA+B,CAAC;IACvD,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,EACR,KAAK,EACL,oBAAoB,EACpB,QAAQ,GACT,EAAE,oBAAoB,qBAsBtB"}
|
package/lib/ContactFormRoot.js
CHANGED
|
@@ -16,10 +16,11 @@ function ThemeSync({ children }) {
|
|
|
16
16
|
* consumers can pass their routes/layout as children.
|
|
17
17
|
*/
|
|
18
18
|
function ContactFormRoot({ config, language, theme, translationsOverride, children, }) {
|
|
19
|
-
// Merge config translations (
|
|
19
|
+
// Merge config translations (optional) with optional root-level override (override takes precedence)
|
|
20
|
+
const configTranslations = config.translations ?? {};
|
|
20
21
|
const mergedTranslations = translationsOverride
|
|
21
|
-
? deepMerge(
|
|
22
|
-
:
|
|
22
|
+
? deepMerge(configTranslations, translationsOverride)
|
|
23
|
+
: configTranslations;
|
|
23
24
|
const mergedConfig = (0, config_1.mergeConfigThemeOverrides)(config);
|
|
24
25
|
return ((0, jsx_runtime_1.jsx)(config_1.ContactFormConfigContext.Provider, { value: mergedConfig, children: (0, jsx_runtime_1.jsx)(theme_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(ThemeSync, { children: (0, jsx_runtime_1.jsx)(translations_1.AppLanguageProvider, { overrides: mergedTranslations, language: language, children: children }) }) }) }));
|
|
25
26
|
}
|
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
export declare const icons: {
|
|
2
2
|
mono: {
|
|
3
|
-
"bonus/Star": {
|
|
4
|
-
relative: string;
|
|
5
|
-
absolute: string;
|
|
6
|
-
assetType: string;
|
|
7
|
-
id: string;
|
|
8
|
-
};
|
|
9
|
-
"bonus/StarFill": {
|
|
10
|
-
relative: string;
|
|
11
|
-
absolute: string;
|
|
12
|
-
assetType: string;
|
|
13
|
-
id: string;
|
|
14
|
-
};
|
|
15
3
|
"actions/Add": {
|
|
16
4
|
relative: string;
|
|
17
5
|
absolute: string;
|
|
@@ -168,6 +156,18 @@ export declare const icons: {
|
|
|
168
156
|
assetType: string;
|
|
169
157
|
id: string;
|
|
170
158
|
};
|
|
159
|
+
"bonus/Star": {
|
|
160
|
+
relative: string;
|
|
161
|
+
absolute: string;
|
|
162
|
+
assetType: string;
|
|
163
|
+
id: string;
|
|
164
|
+
};
|
|
165
|
+
"bonus/StarFill": {
|
|
166
|
+
relative: string;
|
|
167
|
+
absolute: string;
|
|
168
|
+
assetType: string;
|
|
169
|
+
id: string;
|
|
170
|
+
};
|
|
171
171
|
"devices/Laptop": {
|
|
172
172
|
relative: string;
|
|
173
173
|
absolute: string;
|
|
@@ -1140,19 +1140,19 @@ export declare const icons: {
|
|
|
1140
1140
|
assetType: string;
|
|
1141
1141
|
id: string;
|
|
1142
1142
|
};
|
|
1143
|
-
"
|
|
1143
|
+
"logo/logo": {
|
|
1144
1144
|
relative: string;
|
|
1145
1145
|
absolute: string;
|
|
1146
1146
|
assetType: string;
|
|
1147
1147
|
id: string;
|
|
1148
1148
|
};
|
|
1149
|
-
"ticketing/
|
|
1149
|
+
"ticketing/Travelcard": {
|
|
1150
1150
|
relative: string;
|
|
1151
1151
|
absolute: string;
|
|
1152
1152
|
assetType: string;
|
|
1153
1153
|
id: string;
|
|
1154
1154
|
};
|
|
1155
|
-
"
|
|
1155
|
+
"ticketing/TravelcardOutlined": {
|
|
1156
1156
|
relative: string;
|
|
1157
1157
|
absolute: string;
|
|
1158
1158
|
assetType: string;
|
|
@@ -6,18 +6,6 @@ exports.icons = void 0;
|
|
|
6
6
|
// NB! NB! NB!
|
|
7
7
|
exports.icons = {
|
|
8
8
|
"mono": {
|
|
9
|
-
"bonus/Star": {
|
|
10
|
-
"relative": "mono/bonus/Star.svg",
|
|
11
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/bonus/Star.svg",
|
|
12
|
-
"assetType": "mono",
|
|
13
|
-
"id": "bonus/Star"
|
|
14
|
-
},
|
|
15
|
-
"bonus/StarFill": {
|
|
16
|
-
"relative": "mono/bonus/StarFill.svg",
|
|
17
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/bonus/StarFill.svg",
|
|
18
|
-
"assetType": "mono",
|
|
19
|
-
"id": "bonus/StarFill"
|
|
20
|
-
},
|
|
21
9
|
"actions/Add": {
|
|
22
10
|
"relative": "mono/actions/Add.svg",
|
|
23
11
|
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/actions/Add.svg",
|
|
@@ -174,6 +162,18 @@ exports.icons = {
|
|
|
174
162
|
"assetType": "mono",
|
|
175
163
|
"id": "actions/Swap"
|
|
176
164
|
},
|
|
165
|
+
"bonus/Star": {
|
|
166
|
+
"relative": "mono/bonus/Star.svg",
|
|
167
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/bonus/Star.svg",
|
|
168
|
+
"assetType": "mono",
|
|
169
|
+
"id": "bonus/Star"
|
|
170
|
+
},
|
|
171
|
+
"bonus/StarFill": {
|
|
172
|
+
"relative": "mono/bonus/StarFill.svg",
|
|
173
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/bonus/StarFill.svg",
|
|
174
|
+
"assetType": "mono",
|
|
175
|
+
"id": "bonus/StarFill"
|
|
176
|
+
},
|
|
177
177
|
"devices/Laptop": {
|
|
178
178
|
"relative": "mono/devices/Laptop.svg",
|
|
179
179
|
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/devices/Laptop.svg",
|
|
@@ -1146,6 +1146,12 @@ exports.icons = {
|
|
|
1146
1146
|
"assetType": "mono",
|
|
1147
1147
|
"id": "transportation-entur/Walk"
|
|
1148
1148
|
},
|
|
1149
|
+
"logo/logo": {
|
|
1150
|
+
"relative": "mono/logo/logo.svg",
|
|
1151
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/logo/logo.svg",
|
|
1152
|
+
"assetType": "mono",
|
|
1153
|
+
"id": "logo/logo"
|
|
1154
|
+
},
|
|
1149
1155
|
"ticketing/Travelcard": {
|
|
1150
1156
|
"relative": "mono/ticketing/Travelcard.svg",
|
|
1151
1157
|
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/ticketing/Travelcard.svg",
|
|
@@ -1157,12 +1163,6 @@ exports.icons = {
|
|
|
1157
1163
|
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/ticketing/TravelcardOutlined.svg",
|
|
1158
1164
|
"assetType": "mono",
|
|
1159
1165
|
"id": "ticketing/TravelcardOutlined"
|
|
1160
|
-
},
|
|
1161
|
-
"logo/logo": {
|
|
1162
|
-
"relative": "mono/logo/logo.svg",
|
|
1163
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/mono/logo/logo.svg",
|
|
1164
|
-
"assetType": "mono",
|
|
1165
|
-
"id": "logo/logo"
|
|
1166
1166
|
}
|
|
1167
1167
|
},
|
|
1168
1168
|
"images": {
|
|
@@ -1183,80 +1183,80 @@ exports.icons = {
|
|
|
1183
1183
|
"id": "BestillMaxi"
|
|
1184
1184
|
},
|
|
1185
1185
|
"mobility/BabyOnScooter": {
|
|
1186
|
-
"relative": "colors/images/mobility/
|
|
1187
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1186
|
+
"relative": "colors/images/mobility/light/BabyOnScooter.svg",
|
|
1187
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/BabyOnScooter.svg",
|
|
1188
1188
|
"assetType": "colors",
|
|
1189
1189
|
"colorType": "images",
|
|
1190
1190
|
"darkable": true,
|
|
1191
1191
|
"id": "mobility/BabyOnScooter"
|
|
1192
1192
|
},
|
|
1193
1193
|
"mobility/BundlingCarSharingActive": {
|
|
1194
|
-
"relative": "colors/images/mobility/
|
|
1195
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1194
|
+
"relative": "colors/images/mobility/light/BundlingCarSharingActive.svg",
|
|
1195
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/BundlingCarSharingActive.svg",
|
|
1196
1196
|
"assetType": "colors",
|
|
1197
1197
|
"colorType": "images",
|
|
1198
1198
|
"darkable": true,
|
|
1199
1199
|
"id": "mobility/BundlingCarSharingActive"
|
|
1200
1200
|
},
|
|
1201
1201
|
"mobility/BundlingCityBike": {
|
|
1202
|
-
"relative": "colors/images/mobility/
|
|
1203
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1202
|
+
"relative": "colors/images/mobility/light/BundlingCityBike.svg",
|
|
1203
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/BundlingCityBike.svg",
|
|
1204
1204
|
"assetType": "colors",
|
|
1205
1205
|
"colorType": "images",
|
|
1206
1206
|
"darkable": true,
|
|
1207
1207
|
"id": "mobility/BundlingCityBike"
|
|
1208
1208
|
},
|
|
1209
1209
|
"mobility/BundlingCityBikeActive": {
|
|
1210
|
-
"relative": "colors/images/mobility/
|
|
1211
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1210
|
+
"relative": "colors/images/mobility/light/BundlingCityBikeActive.svg",
|
|
1211
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/BundlingCityBikeActive.svg",
|
|
1212
1212
|
"assetType": "colors",
|
|
1213
1213
|
"colorType": "images",
|
|
1214
1214
|
"darkable": true,
|
|
1215
1215
|
"id": "mobility/BundlingCityBikeActive"
|
|
1216
1216
|
},
|
|
1217
1217
|
"mobility/CityBikeRide": {
|
|
1218
|
-
"relative": "colors/images/mobility/
|
|
1219
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1218
|
+
"relative": "colors/images/mobility/light/CityBikeRide.svg",
|
|
1219
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/CityBikeRide.svg",
|
|
1220
1220
|
"assetType": "colors",
|
|
1221
1221
|
"colorType": "images",
|
|
1222
1222
|
"darkable": true,
|
|
1223
1223
|
"id": "mobility/CityBikeRide"
|
|
1224
1224
|
},
|
|
1225
1225
|
"mobility/ElectricCityBike": {
|
|
1226
|
-
"relative": "colors/images/mobility/
|
|
1227
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1226
|
+
"relative": "colors/images/mobility/light/ElectricCityBike.svg",
|
|
1227
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/ElectricCityBike.svg",
|
|
1228
1228
|
"assetType": "colors",
|
|
1229
1229
|
"colorType": "images",
|
|
1230
1230
|
"darkable": true,
|
|
1231
1231
|
"id": "mobility/ElectricCityBike"
|
|
1232
1232
|
},
|
|
1233
1233
|
"mobility/ElectricCityBikeRide": {
|
|
1234
|
-
"relative": "colors/images/mobility/
|
|
1235
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1234
|
+
"relative": "colors/images/mobility/light/ElectricCityBikeRide.svg",
|
|
1235
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/ElectricCityBikeRide.svg",
|
|
1236
1236
|
"assetType": "colors",
|
|
1237
1237
|
"colorType": "images",
|
|
1238
1238
|
"darkable": true,
|
|
1239
1239
|
"id": "mobility/ElectricCityBikeRide"
|
|
1240
1240
|
},
|
|
1241
1241
|
"mobility/ParkAndRide": {
|
|
1242
|
-
"relative": "colors/images/mobility/
|
|
1243
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1242
|
+
"relative": "colors/images/mobility/light/ParkAndRide.svg",
|
|
1243
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/ParkAndRide.svg",
|
|
1244
1244
|
"assetType": "colors",
|
|
1245
1245
|
"colorType": "images",
|
|
1246
1246
|
"darkable": true,
|
|
1247
1247
|
"id": "mobility/ParkAndRide"
|
|
1248
1248
|
},
|
|
1249
1249
|
"mobility/Scooter": {
|
|
1250
|
-
"relative": "colors/images/mobility/
|
|
1251
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1250
|
+
"relative": "colors/images/mobility/light/Scooter.svg",
|
|
1251
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/Scooter.svg",
|
|
1252
1252
|
"assetType": "colors",
|
|
1253
1253
|
"colorType": "images",
|
|
1254
1254
|
"darkable": true,
|
|
1255
1255
|
"id": "mobility/Scooter"
|
|
1256
1256
|
},
|
|
1257
1257
|
"mobility/StartCityBike": {
|
|
1258
|
-
"relative": "colors/images/mobility/
|
|
1259
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/
|
|
1258
|
+
"relative": "colors/images/mobility/light/StartCityBike.svg",
|
|
1259
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/mobility/light/StartCityBike.svg",
|
|
1260
1260
|
"assetType": "colors",
|
|
1261
1261
|
"colorType": "images",
|
|
1262
1262
|
"darkable": true,
|
|
@@ -1851,64 +1851,64 @@ exports.icons = {
|
|
|
1851
1851
|
"id": "badge/ios"
|
|
1852
1852
|
},
|
|
1853
1853
|
"ticket-type/Boat": {
|
|
1854
|
-
"relative": "colors/illustrations/ticket-type/
|
|
1855
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/
|
|
1854
|
+
"relative": "colors/illustrations/ticket-type/light/Boat.svg",
|
|
1855
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/light/Boat.svg",
|
|
1856
1856
|
"assetType": "colors",
|
|
1857
1857
|
"colorType": "illustrations",
|
|
1858
1858
|
"darkable": true,
|
|
1859
1859
|
"id": "ticket-type/Boat"
|
|
1860
1860
|
},
|
|
1861
1861
|
"ticket-type/Carnet": {
|
|
1862
|
-
"relative": "colors/illustrations/ticket-type/
|
|
1863
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/
|
|
1862
|
+
"relative": "colors/illustrations/ticket-type/light/Carnet.svg",
|
|
1863
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/light/Carnet.svg",
|
|
1864
1864
|
"assetType": "colors",
|
|
1865
1865
|
"colorType": "illustrations",
|
|
1866
1866
|
"darkable": true,
|
|
1867
1867
|
"id": "ticket-type/Carnet"
|
|
1868
1868
|
},
|
|
1869
1869
|
"ticket-type/H24": {
|
|
1870
|
-
"relative": "colors/illustrations/ticket-type/
|
|
1871
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/
|
|
1870
|
+
"relative": "colors/illustrations/ticket-type/light/H24.svg",
|
|
1871
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/light/H24.svg",
|
|
1872
1872
|
"assetType": "colors",
|
|
1873
1873
|
"colorType": "illustrations",
|
|
1874
1874
|
"darkable": true,
|
|
1875
1875
|
"id": "ticket-type/H24"
|
|
1876
1876
|
},
|
|
1877
1877
|
"ticket-type/Night": {
|
|
1878
|
-
"relative": "colors/illustrations/ticket-type/
|
|
1879
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/
|
|
1878
|
+
"relative": "colors/illustrations/ticket-type/light/Night.svg",
|
|
1879
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/light/Night.svg",
|
|
1880
1880
|
"assetType": "colors",
|
|
1881
1881
|
"colorType": "illustrations",
|
|
1882
1882
|
"darkable": true,
|
|
1883
1883
|
"id": "ticket-type/Night"
|
|
1884
1884
|
},
|
|
1885
1885
|
"ticket-type/Period": {
|
|
1886
|
-
"relative": "colors/illustrations/ticket-type/
|
|
1887
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/
|
|
1886
|
+
"relative": "colors/illustrations/ticket-type/light/Period.svg",
|
|
1887
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/light/Period.svg",
|
|
1888
1888
|
"assetType": "colors",
|
|
1889
1889
|
"colorType": "illustrations",
|
|
1890
1890
|
"darkable": true,
|
|
1891
1891
|
"id": "ticket-type/Period"
|
|
1892
1892
|
},
|
|
1893
1893
|
"ticket-type/Single": {
|
|
1894
|
-
"relative": "colors/illustrations/ticket-type/
|
|
1895
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/
|
|
1894
|
+
"relative": "colors/illustrations/ticket-type/light/Single.svg",
|
|
1895
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/light/Single.svg",
|
|
1896
1896
|
"assetType": "colors",
|
|
1897
1897
|
"colorType": "illustrations",
|
|
1898
1898
|
"darkable": true,
|
|
1899
1899
|
"id": "ticket-type/Single"
|
|
1900
1900
|
},
|
|
1901
1901
|
"ticket-type/Summer": {
|
|
1902
|
-
"relative": "colors/illustrations/ticket-type/
|
|
1903
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/
|
|
1902
|
+
"relative": "colors/illustrations/ticket-type/light/Summer.svg",
|
|
1903
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/light/Summer.svg",
|
|
1904
1904
|
"assetType": "colors",
|
|
1905
1905
|
"colorType": "illustrations",
|
|
1906
1906
|
"darkable": true,
|
|
1907
1907
|
"id": "ticket-type/Summer"
|
|
1908
1908
|
},
|
|
1909
1909
|
"ticket-type/Youth": {
|
|
1910
|
-
"relative": "colors/illustrations/ticket-type/
|
|
1911
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/
|
|
1910
|
+
"relative": "colors/illustrations/ticket-type/light/Youth.svg",
|
|
1911
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/illustrations/ticket-type/light/Youth.svg",
|
|
1912
1912
|
"assetType": "colors",
|
|
1913
1913
|
"colorType": "illustrations",
|
|
1914
1914
|
"darkable": true,
|
package/lib/contact.module.css
CHANGED
|
@@ -19,15 +19,6 @@
|
|
|
19
19
|
padding: token('spacing.xSmall') 0;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.link {
|
|
23
|
-
font-weight: bold;
|
|
24
|
-
text-decoration: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.link:hover {
|
|
28
|
-
text-decoration: underline;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
22
|
.feedback {
|
|
32
23
|
composes: typo-body__s;
|
|
33
24
|
padding: token('spacing.small');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/group-travel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/group-travel/index.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,kBAAkB,gCAkBzC"}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = GroupTravelContent;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const contact_module_css_1 = __importDefault(require("../contact.module.css"));
|
|
9
8
|
const components_1 = require("../components");
|
|
10
9
|
const link_1 = __importDefault(require("next/link"));
|
|
11
10
|
const translations_1 = require("../translations");
|
|
@@ -13,5 +12,5 @@ const typography_1 = require("../components/typography");
|
|
|
13
12
|
function GroupTravelContent() {
|
|
14
13
|
const PageText = (0, translations_1.usePageText)();
|
|
15
14
|
const { t } = (0, translations_1.useTranslation)();
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(components_1.SectionCard, { title: t(PageText.Contact.groupTravel.title), children: (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(PageText.Contact.groupTravel.description.info), ' ', (0, jsx_runtime_1.jsx)(link_1.default, {
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(components_1.SectionCard, { title: t(PageText.Contact.groupTravel.title), children: (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(PageText.Contact.groupTravel.description.info), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: t(PageText.Contact.groupTravel.description.url), target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.groupTravel.description.externalLink) })] }) }));
|
|
17
16
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { useContactFormConfig, useThemeConfig, useApiConfig, buildEnabledPageIds, } from './modules/config';
|
|
1
|
+
export { useContactFormConfig, useThemeConfig, useApiConfig, buildEnabledPageIds, createDefaultOnSubmit, } from './modules/config';
|
|
2
2
|
export type { TicketControlSubmitPayload, RefundSubmitPayload, MeansOfTransportSubmitPayload, TicketingSubmitPayload, JourneyInfoSubmitPayload, LostPropertySubmitPayload, } from './types/submit-payloads';
|
|
3
3
|
export type { TransportModeType, ReasonForTransportFailure, TicketType, PurchasePlatformType, } from './types';
|
|
4
4
|
export { TicketTypeId } from './types';
|
|
5
|
-
export type { ContactFormConfig, Theme, ThemeColors, ContrastColor, TransportColors, InteractiveColor, StatusColors, ApiConfig,
|
|
5
|
+
export type { ContactFormConfig, Theme, ThemeColors, ContrastColor, TransportColors, InteractiveColor, StatusColors, ApiConfig, LayoutConfig, LayoutLinkLabel, PagesConfig, FormSchemaOverrides, FormSlug, ContactPage, PageId, ExtraPageId, ExtraContactPage, EnabledPageIdsList, } from './modules/config';
|
|
6
6
|
export { ThemeProvider, useTheme, useHtmlDarkMode } from './modules/theme';
|
|
7
7
|
export type { MonoIcons } from './components/icon';
|
|
8
8
|
export { ButtonLink, Button } from './components/button';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/lib/index.js
CHANGED
|
@@ -17,14 +17,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
21
|
-
exports.ContactFormRoot = exports.JourneyInfoContent = void 0;
|
|
20
|
+
exports.TicketControlPageContent = exports.MeansOfTransportContent = exports.AppTicketRefundContent = exports.RefundFormEvents = exports.RefundTicketForm = exports.FormType = exports.RefundContent = exports.SuccessContent = exports.ErrorContent = exports.ExternalLinkPage = exports.ContactFormContainer = exports.useActiveContactPageTitle = exports.getPageTitleForPathname = exports.getContactPages = exports.ContactPageLayout = exports.commonInputValidator = exports.findOrderFormFields = exports.getLineName = exports.findFirstErrorMessage = exports.scrollToFirstErrorMessage = exports.useTransportModeOptions = exports.useLines = exports.Checkbox = exports.DepartureTimeField = exports.TimeSelector = exports.DateSelector = exports.getStopOptions = exports.getLineOptions = exports.SearchableSelect = exports.Textarea = exports.Select = exports.Radio = exports.Input = exports.Fieldset = exports.FileInput = exports.FieldWrapperWithError = exports.SectionCard = exports.ErrorMessage = exports.Typo = exports.Button = exports.ButtonLink = exports.useHtmlDarkMode = exports.useTheme = exports.ThemeProvider = exports.TicketTypeId = exports.createDefaultOnSubmit = exports.buildEnabledPageIds = exports.useApiConfig = exports.useThemeConfig = exports.useContactFormConfig = void 0;
|
|
21
|
+
exports.ContactFormRoot = exports.JourneyInfoContent = exports.TicketingContent = void 0;
|
|
22
22
|
// Configuration system (NEW - required for setup)
|
|
23
23
|
var config_1 = require("./modules/config");
|
|
24
24
|
Object.defineProperty(exports, "useContactFormConfig", { enumerable: true, get: function () { return config_1.useContactFormConfig; } });
|
|
25
25
|
Object.defineProperty(exports, "useThemeConfig", { enumerable: true, get: function () { return config_1.useThemeConfig; } });
|
|
26
26
|
Object.defineProperty(exports, "useApiConfig", { enumerable: true, get: function () { return config_1.useApiConfig; } });
|
|
27
27
|
Object.defineProperty(exports, "buildEnabledPageIds", { enumerable: true, get: function () { return config_1.buildEnabledPageIds; } });
|
|
28
|
+
Object.defineProperty(exports, "createDefaultOnSubmit", { enumerable: true, get: function () { return config_1.createDefaultOnSubmit; } });
|
|
28
29
|
var types_1 = require("./types");
|
|
29
30
|
Object.defineProperty(exports, "TicketTypeId", { enumerable: true, get: function () { return types_1.TicketTypeId; } });
|
|
30
31
|
// Theme system (NEW)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/journey-info/index.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/journey-info/index.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,kBAAkB,gCAiLzC"}
|
|
@@ -20,7 +20,7 @@ function JourneyInfoContent() {
|
|
|
20
20
|
const PageText = (0, translations_1.usePageText)();
|
|
21
21
|
const { t } = (0, translations_1.useTranslation)();
|
|
22
22
|
const apiConfig = (0, config_1.useApiConfig)();
|
|
23
|
-
const { layout
|
|
23
|
+
const { layout } = (0, config_1.useContactFormConfig)();
|
|
24
24
|
const successPath = layout?.successPath ??
|
|
25
25
|
(layout?.basePath ? `${layout.basePath}/success` : '/contact/success');
|
|
26
26
|
const errorPath = layout?.errorPath ??
|
|
@@ -34,14 +34,16 @@ function JourneyInfoContent() {
|
|
|
34
34
|
e.preventDefault();
|
|
35
35
|
send({ type: 'SUBMIT', orderedFormFieldNames: (0, utils_1.findOrderFormFields)(e) });
|
|
36
36
|
};
|
|
37
|
-
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.journeyInfo.input.question.title), isRequired: true, children: [(0, jsx_runtime_1.jsxs)("div", { className: contact_module_css_1.default.extraInfo, children: [(0, jsx_runtime_1.jsx)("p", { children: t(PageText.Contact.journeyInfo.info.useTravelSearch) }), (0, jsx_runtime_1.jsx)("div", { className: contact_module_css_1.default.extraInfo__buttonContainer, children: (0, jsx_runtime_1.jsx)(button_1.ButtonLink, { href:
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.journeyInfo.input.question.title), isRequired: true, children: [(0, jsx_runtime_1.jsxs)("div", { className: contact_module_css_1.default.extraInfo, children: [(0, jsx_runtime_1.jsx)("p", { children: t(PageText.Contact.journeyInfo.info.useTravelSearch) }), (0, jsx_runtime_1.jsx)("div", { className: contact_module_css_1.default.extraInfo__buttonContainer, children: (0, jsx_runtime_1.jsx)(button_1.ButtonLink, { href: t(PageText.Contact.journeyInfo.info.travelSearchLink.href), mode: "interactive_0", title: t(PageText.Contact.journeyInfo.info.travelSearchLink.text), icon: {
|
|
38
38
|
right: ((0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { icon: "navigation/ArrowRight", overrideMode: "dark" })),
|
|
39
|
-
}, aProps: { target: '_blank', rel: 'noreferrer' } }) }),
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
}, aProps: { target: '_blank', rel: 'noreferrer' } }) }), (() => {
|
|
40
|
+
const contactHref = t(PageText.Contact.journeyInfo.info.contactLink.href);
|
|
41
|
+
if (!contactHref)
|
|
42
|
+
return null;
|
|
43
|
+
const prefix = t(PageText.Contact.journeyInfo.info.contactLink.prefix);
|
|
44
|
+
const linkText = t(PageText.Contact.journeyInfo.info.contactLink.text);
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)("p", { children: [prefix && `${prefix} `, (0, jsx_runtime_1.jsx)("a", { href: contactHref, target: "_blank", rel: "noreferrer", children: linkText }), "."] }));
|
|
46
|
+
})()] }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.journeyInfo.input.question.info), value: state.context.question || '', onChange: (e) => send({
|
|
45
47
|
type: 'ON_INPUT_CHANGE',
|
|
46
48
|
inputName: 'question',
|
|
47
49
|
value: e.target.value,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputErrorMessages } from '../validation';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FormSlug } from '../modules/config/types';
|
|
3
3
|
type SubmitInput = {
|
|
4
4
|
attachments?: File[];
|
|
5
5
|
firstName?: string;
|
|
@@ -21,7 +21,7 @@ export type MachinePaths = {
|
|
|
21
21
|
successPath: string;
|
|
22
22
|
errorPath: string;
|
|
23
23
|
};
|
|
24
|
-
export declare function createJourneyInfoStateMachine(onSubmit: (
|
|
24
|
+
export declare function createJourneyInfoStateMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<JourneyInfoContextType, {
|
|
25
25
|
type: "VALIDATE";
|
|
26
26
|
} | {
|
|
27
27
|
type: "ON_INPUT_CHANGE";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journeyInfoStateMachine.d.ts","sourceRoot":"","sources":["../../src/journey-info/journeyInfoStateMachine.ts"],"names":[],"mappings":"AAMA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"journeyInfoStateMachine.d.ts","sourceRoot":"","sources":["../../src/journey-info/journeyInfoStateMachine.ts"],"names":[],"mappings":"AAMA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,kBAAkB,CAAC;IAClC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAaF,MAAM,MAAM,YAAY,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,CACR,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0JrB;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAC"}
|
|
@@ -79,7 +79,7 @@ function createJourneyInfoStateMachine(onSubmit, paths) {
|
|
|
79
79
|
...input,
|
|
80
80
|
attachments: base64EncodedAttachments,
|
|
81
81
|
};
|
|
82
|
-
const response = await onSubmit('
|
|
82
|
+
const response = await onSubmit('journey-info', state);
|
|
83
83
|
if (!response.ok)
|
|
84
84
|
throw new Error('Failed to call API');
|
|
85
85
|
return response.ok;
|
|
@@ -100,7 +100,7 @@ function findMatchedPage(pathname, basePath, visiblePages) {
|
|
|
100
100
|
function getPageTitleForPathname(pathname, config) {
|
|
101
101
|
const basePath = config.layout?.basePath ?? '/contact';
|
|
102
102
|
const { PageText: mergedPageText } = (0, translations_1.mergeTranslationOverrides)({
|
|
103
|
-
pages: config.translations
|
|
103
|
+
pages: config.translations?.pages,
|
|
104
104
|
});
|
|
105
105
|
const visiblePages = getVisiblePages(config.pages, mergedPageText);
|
|
106
106
|
return findMatchedPage(pathname, basePath, visiblePages)?.title;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputErrorMessages } from '../validation';
|
|
2
2
|
import type { TransportModeType } from '../types';
|
|
3
3
|
import type { Line } from '../server/journey-planner/validators';
|
|
4
|
-
import type {
|
|
4
|
+
import type { FormSlug } from '../modules/config/types';
|
|
5
5
|
export type LostPropertyContext = {
|
|
6
6
|
transportMode?: TransportModeType;
|
|
7
7
|
line?: Line;
|
|
@@ -51,7 +51,7 @@ type SubmitInput = {
|
|
|
51
51
|
email?: string;
|
|
52
52
|
phoneNumber?: string;
|
|
53
53
|
};
|
|
54
|
-
export declare function createLostPropertyMachine(onSubmit: (
|
|
54
|
+
export declare function createLostPropertyMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<LostPropertyContext, {
|
|
55
55
|
type: "ON_INPUT_CHANGE";
|
|
56
56
|
inputName: string;
|
|
57
57
|
value: unknown;
|