@crystaldesign/widget-contact-form 25.3.0-beta.4 → 25.3.0-beta.42

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.
@@ -0,0 +1,374 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import { useState } from 'react';
3
+ import { useCss, useConfiguration } from '@crystaldesign/widget-library';
4
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
+ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
6
+ import _regeneratorRuntime from '@babel/runtime/regenerator';
7
+ import { useDivaCore, useTranslation, Trans } from '@crystaldesign/diva-core';
8
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
9
+
10
+ (function() {
11
+ const env = {"STAGE":"production"};
12
+ try {
13
+ if (process) {
14
+ process.env = Object.assign({}, process.env);
15
+ Object.assign(process.env, env);
16
+ return;
17
+ }
18
+ } catch (e) {} // avoid ReferenceError: process is not defined
19
+ globalThis.process = { env:env };
20
+ })();
21
+
22
+ function styleInject(css, ref) {
23
+ if ( ref === void 0 ) ref = {};
24
+ var insertAt = ref.insertAt;
25
+
26
+ if (!css || typeof document === 'undefined') { return; }
27
+
28
+ var head = document.head || document.getElementsByTagName('head')[0];
29
+ var style = document.createElement('style');
30
+ style.type = 'text/css';
31
+
32
+ if (insertAt === 'top') {
33
+ if (head.firstChild) {
34
+ head.insertBefore(style, head.firstChild);
35
+ } else {
36
+ head.appendChild(style);
37
+ }
38
+ } else {
39
+ head.appendChild(style);
40
+ }
41
+
42
+ if (style.styleSheet) {
43
+ style.styleSheet.cssText = css;
44
+ } else {
45
+ style.appendChild(document.createTextNode(css));
46
+ }
47
+ }
48
+
49
+ var form = "form-B77D-";
50
+ var input = "input-oPXuT";
51
+ var textarea = "textarea-cMW-q";
52
+ var inputGroup = "inputGroup-gO790";
53
+ var button = "button-fOW5S";
54
+ var agbContainer = "agbContainer--O-xN";
55
+ var checkAgbText = "checkAgbText-Jl3wz";
56
+ var errorBox = "errorBox-hMx0W";
57
+ var errorMailValidation = "errorMailValidation-HNoLo";
58
+ var css_248z = ".form-B77D- {\n display: flex;\n flex-direction: column;\n padding: 10px;\n gap: 1.3rem;\n font-family: 'Roboto';\n}\n\n.input-oPXuT,\n.textarea-cMW-q {\n padding: 0.5rem;\n border: 1px solid #ccc;\n}\n\n.inputGroup-gO790 {\n display: flex;\n flex-direction: column;\n}\n.textarea-cMW-q {\n min-height: 150px;\n font-family: 'Roboto';\n resize: none;\n}\n\n.button-fOW5S {\n padding: 0.75rem;\n background-color: #6c757d;\n background-color: var(--primaryColor, #6c757d);\n color: white;\n border: none;\n cursor: pointer;\n}\n\n.button-fOW5S:disabled {\n background-color: #ccc;\n cursor: not-allowed;\n color: #666;\n}\n\n.button-fOW5S:enabled:hover {\n background-color: #5a6268;\n background-color: var(--primaryColor, #5a6268);\n}\n\n.agbContainer--O-xN {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 10px;\n}\n.agbContainer--O-xN input {\n transform: scale(1.5);\n}\n\n.checkAgbText-Jl3wz {\n display: flex;\n flex-direction: column;\n font-size: 12px;\n}\n\n.errorBox-hMx0W {\n background-color: #fdecea; /* Helles Rot */\n border-left: 4px solid #e53e3e; /* Dunkelrote linke Linie */\n color: #b71c1c; /* Kräftiges Rot für den Text */\n padding: 10px;\n border-radius: 6px;\n font-weight: bold;\n}\n.errorMailValidation-HNoLo {\n color: #d9534f; /* Dezentes Rot */\n font-size: 13px; /* Kleine Schrift */\n margin-top: 4px;\n font-weight: 500; /* Etwas kräftiger für bessere Lesbarkeit */\n}\n@media (max-width: 768px) {\n .agbContainer--O-xN {\n flex-direction: row; /* Stack the elements vertically */\n gap: 5px; /* Reduce the gap between checkbox and text */\n }\n\n .checkAgbText-Jl3wz {\n font-size: 10px; /* Reduce the font size on smaller screens */\n }\n .agbContainer--O-xN input {\n transform: scale(1.2);\n }\n}\n";
59
+ styleInject(css_248z);
60
+
61
+ /**
62
+ * Sends an email via API call.
63
+ *
64
+ * @param {string} messageService - The URL of the message service.
65
+ * @param {string} jwt - The JWT token.
66
+ * @param {string} mailTo - The email address to send the email to.
67
+ * @param {any} data - The data to send in the email.
68
+ * @param {string[]} [attachments] - The attachments to send with the email.
69
+ * @returns {Promise<void>} - A promise that resolves when the email is sent.
70
+ */
71
+ function sendMail(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8) {
72
+ return _sendMail.apply(this, arguments);
73
+ }
74
+ function _sendMail() {
75
+ _sendMail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(messageService, jwt, organizationId, mailTo, variant, data, attachments, language) {
76
+ var body, response;
77
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
78
+ while (1) switch (_context.prev = _context.next) {
79
+ case 0:
80
+ _context.prev = 0;
81
+ body = {
82
+ variant: variant !== null && variant !== void 0 ? variant : 'DEFAULT',
83
+ to: mailTo,
84
+ language: language,
85
+ organizationIds: [organizationId],
86
+ data: data,
87
+ attachments: attachments !== null && attachments !== void 0 && attachments.length ? attachments : undefined
88
+ };
89
+ _context.next = 4;
90
+ return fetch(messageService + '/mail/contact', {
91
+ method: 'POST',
92
+ headers: {
93
+ 'Content-Type': 'application/json',
94
+ Authorization: 'Bearer ' + jwt
95
+ },
96
+ body: JSON.stringify(body)
97
+ });
98
+ case 4:
99
+ response = _context.sent;
100
+ if (response.ok) {
101
+ _context.next = 7;
102
+ break;
103
+ }
104
+ throw new Error('Failed to send email');
105
+ case 7:
106
+ _context.next = 12;
107
+ break;
108
+ case 9:
109
+ _context.prev = 9;
110
+ _context.t0 = _context["catch"](0);
111
+ throw new Error('Failed to send email');
112
+ case 12:
113
+ case "end":
114
+ return _context.stop();
115
+ }
116
+ }, _callee, null, [[0, 9]]);
117
+ }));
118
+ return _sendMail.apply(this, arguments);
119
+ }
120
+
121
+ function useContactForm(settings) {
122
+ var _useDivaCore = useDivaCore(),
123
+ _useDivaCore$state = _useDivaCore.state,
124
+ apiConfig = _useDivaCore$state.apiConfig,
125
+ jwt = _useDivaCore$state.jwt,
126
+ organization = _useDivaCore$state.organization,
127
+ navigationConfiguration = _useDivaCore$state.navigationConfiguration,
128
+ _useDivaCore$actions = _useDivaCore.actions,
129
+ openModal = _useDivaCore$actions.openModal,
130
+ toggleLoading = _useDivaCore$actions.toggleLoading;
131
+ var _useTranslation = useTranslation(),
132
+ t = _useTranslation.t,
133
+ i18n = _useTranslation.i18n;
134
+ useCss(settings);
135
+ function sendEMail(_x, _x2, _x3, _x4, _x5, _x6) {
136
+ return _sendEMail.apply(this, arguments);
137
+ }
138
+ function _sendEMail() {
139
+ _sendEMail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(name, email, message, variant, attachments, divaNr) {
140
+ var _ref, data;
141
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
142
+ while (1) switch (_context.prev = _context.next) {
143
+ case 0:
144
+ _context.prev = 0;
145
+ data = {
146
+ name: name,
147
+ email: variant !== 'CLIENT' ? email : undefined,
148
+ message: message,
149
+ divaNr: divaNr
150
+ };
151
+ toggleLoading('sendMail');
152
+ _context.next = 5;
153
+ return sendMail(apiConfig.messageService, jwt, organization._id, variant === 'CLIENT' ? email : settings.mailTo, variant, data, attachments, (_ref = i18n.language.toUpperCase()) !== null && _ref !== void 0 ? _ref : 'DE');
154
+ case 5:
155
+ toggleLoading('sendMail');
156
+ openModal({
157
+ content: t('modal.success.sendingcontactform'),
158
+ accept: true
159
+ });
160
+ _context.next = 13;
161
+ break;
162
+ case 9:
163
+ _context.prev = 9;
164
+ _context.t0 = _context["catch"](0);
165
+ toggleLoading('sendMail');
166
+ openModal({
167
+ title: t('Error'),
168
+ content: t('modal.error.sendingcontactform') + _context.t0,
169
+ accept: true
170
+ });
171
+ case 13:
172
+ case "end":
173
+ return _context.stop();
174
+ }
175
+ }, _callee, null, [[0, 9]]);
176
+ }));
177
+ return _sendEMail.apply(this, arguments);
178
+ }
179
+ var validateEmail = function validateEmail(email) {
180
+ var regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
181
+ return regex.test(email);
182
+ };
183
+ return {
184
+ sendEMail: sendEMail,
185
+ navigationConfiguration: navigationConfiguration,
186
+ validateEmail: validateEmail
187
+ };
188
+ }
189
+
190
+ var MainComponent = function MainComponent(_ref) {
191
+ var _navigationConfigurat, _navigationConfigurat2;
192
+ var onSubmit = _ref.onSubmit,
193
+ title = _ref.title,
194
+ submitButtonText = _ref.submitButtonText,
195
+ action = _ref.action,
196
+ basket = _ref.basket,
197
+ settings = _ref.settings;
198
+ var _useTranslation = useTranslation(),
199
+ t = _useTranslation.t;
200
+ var _useContactForm = useContactForm(settings),
201
+ sendEMail = _useContactForm.sendEMail,
202
+ navigationConfiguration = _useContactForm.navigationConfiguration,
203
+ validateEmail = _useContactForm.validateEmail;
204
+ var _useState = useState(''),
205
+ _useState2 = _slicedToArray(_useState, 2),
206
+ error = _useState2[0],
207
+ setError = _useState2[1];
208
+ var _useState3 = useState(''),
209
+ _useState4 = _slicedToArray(_useState3, 2),
210
+ name = _useState4[0],
211
+ setName = _useState4[1];
212
+ var _useState5 = useState(''),
213
+ _useState6 = _slicedToArray(_useState5, 2),
214
+ email = _useState6[0],
215
+ setEmail = _useState6[1];
216
+ var _useState7 = useState(''),
217
+ _useState8 = _slicedToArray(_useState7, 2),
218
+ message = _useState8[0],
219
+ setMessage = _useState8[1];
220
+ var _useState9 = useState(false),
221
+ _useState10 = _slicedToArray(_useState9, 2),
222
+ acceptAgbs = _useState10[0],
223
+ setAcceptAgbs = _useState10[1];
224
+ var _useState11 = useState(''),
225
+ _useState12 = _slicedToArray(_useState11, 2),
226
+ emailError = _useState12[0],
227
+ setEmailError = _useState12[1];
228
+ var inputOk = name && validateEmail(email) && message && acceptAgbs;
229
+ var handleEmailChange = function handleEmailChange(e) {
230
+ var value = e.target.value;
231
+ setEmail(value);
232
+ if (!validateEmail(value)) {
233
+ setEmailError(t('input.mail.validation.error'));
234
+ } else {
235
+ setEmailError('');
236
+ }
237
+ };
238
+ var handleSubmit = function handleSubmit() {
239
+ if (action === 'SEND_MAIL') {
240
+ if (inputOk) {
241
+ var attachments = basket !== null && basket !== void 0 && basket.PDFDocumentURL ? [basket === null || basket === void 0 ? void 0 : basket.PDFDocumentURL] : undefined;
242
+ sendEMail(name, email, message, 'DEFAULT', attachments, basket === null || basket === void 0 ? void 0 : basket.DivaNr);
243
+ sendEMail(name, email, message, 'CLIENT', attachments, undefined);
244
+ } else {
245
+ setError(t('contactform.error.fields'));
246
+ }
247
+ } else if (onSubmit) {
248
+ onSubmit({
249
+ name: name,
250
+ email: email,
251
+ message: message
252
+ });
253
+ } else alert('Action is not implemented yet');
254
+ };
255
+ return /*#__PURE__*/jsxs(Fragment, {
256
+ children: [title && /*#__PURE__*/jsx("h2", {
257
+ children: t(title, title)
258
+ }), /*#__PURE__*/jsxs("div", {
259
+ className: form,
260
+ children: [/*#__PURE__*/jsx("input", {
261
+ type: "text",
262
+ id: "name",
263
+ value: name,
264
+ onChange: function onChange(e) {
265
+ return setName(e.target.value);
266
+ },
267
+ required: true,
268
+ className: input,
269
+ placeholder: t('contactform.placeholder.name')
270
+ }), /*#__PURE__*/jsxs("div", {
271
+ className: inputGroup,
272
+ children: [/*#__PURE__*/jsx("input", {
273
+ type: "email",
274
+ id: "email",
275
+ value: email,
276
+ onChange: handleEmailChange,
277
+ required: true,
278
+ className: input,
279
+ placeholder: t('contactform.placeholder.email')
280
+ }), emailError && /*#__PURE__*/jsx("div", {
281
+ className: errorMailValidation,
282
+ children: emailError
283
+ })]
284
+ }), /*#__PURE__*/jsx("textarea", {
285
+ id: "message",
286
+ value: message,
287
+ onChange: function onChange(e) {
288
+ return setMessage(e.target.value);
289
+ },
290
+ required: true,
291
+ className: textarea,
292
+ placeholder: t('contactform.placeholder.message')
293
+ }), /*#__PURE__*/jsxs("div", {
294
+ id: "agbContainer",
295
+ className: agbContainer,
296
+ children: [/*#__PURE__*/jsx("input", {
297
+ type: "checkbox",
298
+ id: "acceptAgbs",
299
+ onChange: function onChange(e) {
300
+ return setAcceptAgbs(e.target.checked);
301
+ },
302
+ required: true
303
+ }), /*#__PURE__*/jsx("label", {
304
+ htmlFor: "acceptAgbs",
305
+ children: /*#__PURE__*/jsx("div", {
306
+ className: checkAgbText,
307
+ children: /*#__PURE__*/jsx("span", {
308
+ children: /*#__PURE__*/jsx(AcceptTerms, {
309
+ privacyUrl: (_navigationConfigurat = navigationConfiguration === null || navigationConfiguration === void 0 ? void 0 : navigationConfiguration.privacyUrl) !== null && _navigationConfigurat !== void 0 ? _navigationConfigurat : 'https://www.diva-portal.de/datenschutz',
310
+ agbUrl: (_navigationConfigurat2 = navigationConfiguration === null || navigationConfiguration === void 0 ? void 0 : navigationConfiguration.tosUrl) !== null && _navigationConfigurat2 !== void 0 ? _navigationConfigurat2 : 'https://www.diva-portal.de/agb'
311
+ })
312
+ })
313
+ })
314
+ })]
315
+ }), error && /*#__PURE__*/jsx("div", {
316
+ className: errorBox,
317
+ children: error
318
+ }), /*#__PURE__*/jsx("button", {
319
+ type: "submit",
320
+ id: "submitButton",
321
+ className: button,
322
+ onClick: handleSubmit,
323
+ disabled: !inputOk,
324
+ children: submitButtonText ? t(submitButtonText, submitButtonText) : t('contactform.submitbuttontext')
325
+ })]
326
+ })]
327
+ });
328
+ };
329
+ var AcceptTerms = function AcceptTerms(_ref2) {
330
+ var privacyUrl = _ref2.privacyUrl,
331
+ agbUrl = _ref2.agbUrl;
332
+ var _useTranslation2 = useTranslation(),
333
+ t = _useTranslation2.t;
334
+ var pUrl = /*#__PURE__*/jsx("a", {
335
+ href: privacyUrl,
336
+ target: "_blank",
337
+ children: t('auth.privacypolicy')
338
+ });
339
+ var aUrl = /*#__PURE__*/jsx("a", {
340
+ href: agbUrl,
341
+ target: "_blank",
342
+ children: t('auth.GeneralTerms')
343
+ });
344
+ return /*#__PURE__*/jsx(Trans, {
345
+ i18nKey: "contactform.acceptprivacyandagb",
346
+ components: {
347
+ privacyUrl: pUrl,
348
+ agbUrl: aUrl
349
+ }
350
+ });
351
+ };
352
+
353
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
354
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
355
+ var Main = function Main(_ref) {
356
+ var settings = _ref.settings;
357
+ _ref.parameters;
358
+ _ref.internal;
359
+ return /*#__PURE__*/jsx(ContactFormComponent, {
360
+ settings: settings
361
+ });
362
+ };
363
+ var ContactFormComponent = function ContactFormComponent(props) {
364
+ var settings = useConfiguration(ContactForm.name, props.settings);
365
+ return /*#__PURE__*/jsx(MainComponent, _objectSpread(_objectSpread({}, props), {}, {
366
+ settings: settings
367
+ }));
368
+ };
369
+ var ContactForm = {
370
+ name: 'CONTACTFORM',
371
+ renderFunction: Main
372
+ };
373
+
374
+ export { ContactFormComponent, ContactForm as default };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { ContactFormProps } from '../types';
3
+ export declare const MainComponent: React.FC<ContactFormProps>;
4
+ export default MainComponent;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+FpD,CAAC;AAgBF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,11 @@
1
+
2
+
3
+ export * from './types';
4
+ import React from 'react';
5
+ import { ComponentDefinition } from '@crystaldesign/diva-core';
6
+ import { Configuration, ContactFormProps } from './types';
7
+ export declare const ContactFormComponent: React.FC<ContactFormProps>;
8
+ declare const ContactForm: ComponentDefinition<Configuration>;
9
+ export default ContactForm;
10
+ //# sourceMappingURL=index.d.ts.map
11
+
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAkB,MAAM,0BAA0B,CAAC;AAG/E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM1D,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAG3D,CAAC;AAEF,QAAA,MAAM,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAGnD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Sends an email via API call.
3
+ *
4
+ * @param {string} messageService - The URL of the message service.
5
+ * @param {string} jwt - The JWT token.
6
+ * @param {string} mailTo - The email address to send the email to.
7
+ * @param {any} data - The data to send in the email.
8
+ * @param {string[]} [attachments] - The attachments to send with the email.
9
+ * @returns {Promise<void>} - A promise that resolves when the email is sent.
10
+ */
11
+ export declare function sendMail(messageService: string, jwt: string, organizationId: string, mailTo: string, variant: string, data: any, attachments?: string[], language?: 'DE' | 'IT' | 'FR' | 'EN'): Promise<void>;
12
+ //# sourceMappingURL=ApiHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/ApiHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,GAAG,EACT,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,iBA2BrC"}
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { WithDivaMock } from '@crystaldesign/diva-core';
3
+ import { ContactFormProps } from '@crystaldesign/widget-contact-form/types';
4
+ declare const meta: Meta<WithDivaMock<ContactFormProps>>;
5
+ export default meta;
6
+ type Story = StoryObj<WithDivaMock<ContactFormProps>>;
7
+ export declare const Default: Story;
8
+ //# sourceMappingURL=contactform.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contactform.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/stories/default/contactform.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAqB,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAG5E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAI9C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAEtD,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { BasketData } from '@crystaldesign/diva-core';
2
+ import { BaseConfiguration } from '@crystaldesign/widget-library';
3
+ export interface ContactFormProps {
4
+ settings: Configuration;
5
+ title?: string;
6
+ submitButtonText?: string;
7
+ onSubmit?: (data: {
8
+ name: string;
9
+ email: string;
10
+ message: string;
11
+ }) => void;
12
+ action?: 'SEND_MAIL';
13
+ basket?: BasketData;
14
+ }
15
+ export interface Configuration extends BaseConfiguration {
16
+ mailTo: string;
17
+ }
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,7 @@
1
+ import { Configuration } from './types';
2
+ export default function useContactForm(settings: Configuration): {
3
+ sendEMail: (name: string, email: string, message: string, variant: string, attachments?: string[], divaNr?: string) => Promise<void>;
4
+ navigationConfiguration: import("packages/core/src/types").NavigationConfiguration;
5
+ validateEmail: (email: string) => boolean;
6
+ };
7
+ //# sourceMappingURL=useContactForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContactForm.d.ts","sourceRoot":"","sources":["../../../../src/useContactForm.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,QAAQ,EAAE,aAAa;sBAS7B,MAAM,SAAS,MAAM,WAAW,MAAM,WAAW,MAAM,gBAAgB,MAAM,EAAE,WAAW,MAAM;;2BA2BjG,MAAM;EAMrC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/widget-contact-form",
3
- "version": "25.3.0-beta.4",
3
+ "version": "25.3.0-beta.42",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "storybook": "storybook dev -p 6006",
@@ -25,7 +25,10 @@
25
25
  "react": "^18.3.1",
26
26
  "react-dom": "^18.3.1"
27
27
  },
28
+ "dependencies": {
29
+ "@crystaldesign/widget-library": "25.3.0-beta.42"
30
+ },
28
31
  "module": "build/esm/index.js",
29
32
  "types": "./build/types/widget-contact-form/src/index.d.ts",
30
- "gitHead": "0e0612b0cbd4b582f58a977b9bca3e7c9685cf21"
33
+ "gitHead": "ac1ee04802272364e173c8ab0eea41892d5ebef9"
31
34
  }