@bigz-app/booking-widget 0.2.0 → 0.2.1

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/dist/index.esm.js CHANGED
@@ -9258,6 +9258,7 @@ function PaymentFormInner({ config, eventDetails, formData, totalAmount, discoun
9258
9258
  // Main PaymentForm component that handles payment intent creation and Elements wrapper
9259
9259
  function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode, onSuccess, onError, systemConfig, stripePromise, stripeAppearance, }) {
9260
9260
  const [clientSecret, setClientSecret] = useState(null);
9261
+ const [paymentIntentId, setPaymentIntentId] = useState(null);
9261
9262
  const [isCreatingPaymentIntent, setIsCreatingPaymentIntent] = useState(false);
9262
9263
  const [paymentError, setPaymentError] = useState(null);
9263
9264
  // Create payment intent when component mounts or when relevant data changes
@@ -9297,6 +9298,7 @@ function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode
9297
9298
  customerEmail: formData.customerEmail?.trim(),
9298
9299
  customerPhone: formData.customerPhone?.trim(),
9299
9300
  comment: formData.comment?.trim(),
9301
+ ...(paymentIntentId && { paymentIntentId }), // Include existing payment intent ID if available
9300
9302
  };
9301
9303
  // Validate required fields
9302
9304
  if (!requestData.eventInstanceId) {
@@ -9322,6 +9324,7 @@ function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode
9322
9324
  const data = await response.json();
9323
9325
  if (response.ok) {
9324
9326
  setClientSecret(data.clientSecret);
9327
+ setPaymentIntentId(data.paymentIntentId); // Save payment intent ID for future updates
9325
9328
  }
9326
9329
  else {
9327
9330
  console.error("[PAYMENT_FORM] Payment intent creation failed:", {
@@ -9597,6 +9600,7 @@ const bookingFormSchema = objectType({
9597
9600
  customerPhone: stringType().optional(),
9598
9601
  participants: arrayType(participantSchema).min(1, "Mindestens ein Teilnehmer erforderlich"),
9599
9602
  discountCode: stringType().optional(),
9603
+ comment: stringType().optional(),
9600
9604
  acceptTerms: booleanType()
9601
9605
  .refine((val) => val === true, "Bitte akzeptiere die Allgemeinen Geschäftsbedingungen"),
9602
9606
  });
@@ -9612,6 +9616,7 @@ function BookingForm({ config, eventDetails, stripePromise, onSuccess, onError,
9612
9616
  defaultValues: {
9613
9617
  participants: [{ name: "", age: undefined }],
9614
9618
  discountCode: "",
9619
+ comment: "",
9615
9620
  acceptTerms: false,
9616
9621
  },
9617
9622
  });
@@ -9998,6 +10003,36 @@ function BookingForm({ config, eventDetails, stripePromise, onSuccess, onError,
9998
10003
  backdropFilter: "blur(4px)",
9999
10004
  borderRadius: "var(--bw-border-radius)",
10000
10005
  padding: "var(--bw-spacing)",
10006
+ }, children: [jsx("label", { htmlFor: "booking-comment", style: {
10007
+ fontSize: "var(--bw-font-size)",
10008
+ fontWeight: "500",
10009
+ color: "var(--bw-text-color)",
10010
+ fontFamily: "var(--bw-font-family)",
10011
+ display: "block",
10012
+ marginBottom: "8px",
10013
+ }, children: "Kommentar (optional)" }), jsx("textarea", { id: "booking-comment", ...form.register("comment"), placeholder: "Zus\u00E4tzliche Anmerkungen zu Ihrer Buchung...", rows: 3, style: {
10014
+ width: "100%",
10015
+ padding: "12px",
10016
+ border: `1px solid var(--bw-border-color)`,
10017
+ borderRadius: "var(--bw-border-radius)",
10018
+ fontSize: "var(--bw-font-size)",
10019
+ fontFamily: "var(--bw-font-family)",
10020
+ backgroundColor: "var(--bw-input-bg)",
10021
+ color: "var(--bw-text-color)",
10022
+ resize: "vertical",
10023
+ minHeight: "80px",
10024
+ outline: "none",
10025
+ transition: "border-color 0.2s ease",
10026
+ }, onFocus: (e) => {
10027
+ e.target.style.borderColor = "var(--bw-highlight-color)";
10028
+ }, onBlur: (e) => {
10029
+ e.target.style.borderColor = "var(--bw-border-color)";
10030
+ } })] }), jsxs("div", { style: {
10031
+ backgroundColor: "var(--bw-surface-color)",
10032
+ border: `1px solid var(--bw-border-color)`,
10033
+ backdropFilter: "blur(4px)",
10034
+ borderRadius: "var(--bw-border-radius)",
10035
+ padding: "var(--bw-spacing)",
10001
10036
  }, children: [jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [jsx("input", { id: "acceptTerms", ...form.register("acceptTerms"), type: "checkbox", style: {
10002
10037
  marginTop: "4px",
10003
10038
  width: "20px",