@wix/headless-bookings 0.0.112 → 0.0.114

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.
@@ -1,4 +1,4 @@
1
- import type { FormValues } from '@wix/form-public';
1
+ import type { FormValues } from '@wix/forms/components';
2
2
  import type { Location } from '@wix/auto_sdk_bookings_services';
3
3
  import type { ServiceSelection, ServiceSelectionTimeSlot, ExtendedResource } from '../../services/booking/booking.js';
4
4
  export declare function createMockResource(overrides?: Partial<ExtendedResource>): ExtendedResource;
@@ -3,7 +3,7 @@
3
3
  * Wrapper for the Wix Bookings createBooking SDK function
4
4
  */
5
5
  import { type Booking, type CreateBookingResponse, type ParticipantNotification } from '@wix/auto_sdk_bookings_bookings';
6
- import type { FormValues } from '@wix/form-public';
6
+ import type { FormValues } from '@wix/forms/components';
7
7
  /**
8
8
  * Options for creating a booking
9
9
  */
@@ -3,7 +3,7 @@
3
3
  * Provides components for displaying and managing booking form fields
4
4
  */
5
5
  import React from 'react';
6
- import { Form } from '@wix/headless-forms/react';
6
+ import { Form } from '@wix/forms/components';
7
7
  import type { BookingFormRenderProps } from '../core/booking-form/BookingForm.js';
8
8
  type FieldMap = Parameters<typeof Form.Fields>[0]['fieldMap'];
9
9
  export declare const TestIds: {
@@ -44,7 +44,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
44
44
  */
45
45
  const react_1 = __importDefault(require("react"));
46
46
  const react_2 = require("@wix/headless-utils/react");
47
- const react_3 = require("@wix/headless-forms/react");
47
+ const components_1 = require("@wix/forms/components");
48
48
  const CoreBookingForm = __importStar(require("../core/booking-form/BookingForm.js"));
49
49
  const booking_form_js_1 = require("../../services/booking-form/booking-form.js");
50
50
  /**
@@ -162,7 +162,7 @@ exports.Root = react_1.default.forwardRef((props, ref) => {
162
162
  fields: renderProps.fields,
163
163
  rowGapClassname,
164
164
  columnGapClassname,
165
- }, children: (0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": exports.TestIds.bookingFormRoot, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: children ?? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_3.Form.Loading, { className: "flex justify-center p-4 text-foreground" }), (0, jsx_runtime_1.jsx)(react_3.Form.LoadingError, { className: "bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-lg mb-4" }), (0, jsx_runtime_1.jsx)(react_3.Form.Fields, { fieldMap: renderProps.fields, rowGapClassname: rowGapClassname, columnGapClassname: columnGapClassname }), (0, jsx_runtime_1.jsx)(react_3.Form.Error, { className: "mt-4 bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-lg" }), (0, jsx_runtime_1.jsx)(react_3.Form.Submitted, { className: "mt-4 bg-green-500/10 border border-green-500/20 text-green-500 px-4 py-3 rounded-lg" })] })) }) }) }));
165
+ }, children: (0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": exports.TestIds.bookingFormRoot, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: children ?? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Form.Loading, { className: "flex justify-center p-4 text-foreground" }), (0, jsx_runtime_1.jsx)(components_1.Form.LoadingError, { className: "bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-lg mb-4" }), (0, jsx_runtime_1.jsx)(components_1.Form.Fields, { fieldMap: renderProps.fields, rowGapClassname: rowGapClassname, columnGapClassname: columnGapClassname }), (0, jsx_runtime_1.jsx)(components_1.Form.Error, { className: "mt-4 bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-lg" }), (0, jsx_runtime_1.jsx)(components_1.Form.Submitted, { className: "mt-4 bg-green-500/10 border border-green-500/20 text-green-500 px-4 py-3 rounded-lg" })] })) }) }) }));
166
166
  } }) }));
167
167
  });
168
168
  exports.Root.displayName = 'BookingForm.Root';
@@ -195,7 +195,7 @@ function useBookingFormContext() {
195
195
  exports.Fields = react_1.default.forwardRef((props, ref) => {
196
196
  const context = useBookingFormContext();
197
197
  const { rowGapClassname = context.rowGapClassname, columnGapClassname = context.columnGapClassname, className, ...otherProps } = props;
198
- return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: className, "data-testid": exports.TestIds.bookingFormFields, ...otherProps, children: (0, jsx_runtime_1.jsx)(react_3.Form.Fields, { fieldMap: context.fields, rowGapClassname: rowGapClassname, columnGapClassname: columnGapClassname }) }));
198
+ return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: className, "data-testid": exports.TestIds.bookingFormFields, ...otherProps, children: (0, jsx_runtime_1.jsx)(components_1.Form.Fields, { fieldMap: context.fields, rowGapClassname: rowGapClassname, columnGapClassname: columnGapClassname }) }));
199
199
  });
200
200
  exports.Fields.displayName = 'BookingForm.Fields';
201
201
  // ============================================================================
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { type BookingServiceConfig, type ServiceSelection, type BookingServiceActions } from '../../../services/booking/booking.js';
7
- import type { FormValues } from '@wix/form-public';
7
+ import type { FormValues } from '@wix/forms/components';
8
8
  import type { TimeSlot, Resource } from '@wix/auto_sdk_bookings_availability-time-slots';
9
9
  import { type Service, type Location as ServiceLocationType } from '@wix/auto_sdk_bookings_services';
10
10
  import type { PricingServiceSelection } from '../../../services/payment/payment.js';
@@ -9,10 +9,10 @@
9
9
  * 2. SSR/SSG: Provide a pre-loaded form object for server-side rendering
10
10
  */
11
11
  import * as React from 'react';
12
- import { type FormValues } from '@wix/form-public';
12
+ import { type FormValues } from '@wix/forms/components';
13
13
  import { forms, submissions } from '@wix/forms';
14
14
  import { BookingFormConfigurationError } from '../../../services/booking-form/booking-form.js';
15
- import { Form } from '@wix/headless-forms/react';
15
+ import { Form } from '@wix/forms/components';
16
16
  type FieldMap = Parameters<typeof Form.Fields>[0]['fieldMap'];
17
17
  export type Submit = () => Promise<submissions.GetSubmissionResponse['submission'] | undefined>;
18
18
  export type ValidateStep = (stepId: string) => Promise<boolean>;
@@ -95,7 +95,7 @@ export type BookingFormProps = BookingFormWithFormIdProps | BookingFormWithFormP
95
95
  * ```tsx
96
96
  * // Pattern 1: Client-side loading
97
97
  * import * as CoreBookingForm from '@wix/headless-bookings/react/core/booking-form';
98
- * import { Form } from '@wix/headless-forms/react';
98
+ * import { Form } from '@wix/forms/components';
99
99
  *
100
100
  * <CoreBookingForm.Root formId="form-123">
101
101
  * {({ formId, setFormSubmission, fields }) => (
@@ -54,8 +54,8 @@ const services_manager_1 = require("@wix/services-manager");
54
54
  const booking_form_js_1 = require("../../../services/booking-form/booking-form.js");
55
55
  Object.defineProperty(exports, "BookingFormConfigurationError", { enumerable: true, get: function () { return booking_form_js_1.BookingFormConfigurationError; } });
56
56
  const booking_js_1 = require("../../../services/booking/booking.js");
57
- const react_2 = require("@wix/headless-forms/react");
58
- const services_1 = require("@wix/headless-forms/services");
57
+ const components_1 = require("@wix/forms/components");
58
+ const services_1 = require("@wix/forms/services");
59
59
  const signals_1 = require("@wix/services-definitions/core-services/signals");
60
60
  // ============================================================================
61
61
  // Component
@@ -80,7 +80,7 @@ const signals_1 = require("@wix/services-definitions/core-services/signals");
80
80
  * ```tsx
81
81
  * // Pattern 1: Client-side loading
82
82
  * import * as CoreBookingForm from '@wix/headless-bookings/react/core/booking-form';
83
- * import { Form } from '@wix/headless-forms/react';
83
+ * import { Form } from '@wix/forms/components';
84
84
  *
85
85
  * <CoreBookingForm.Root formId="form-123">
86
86
  * {({ formId, setFormSubmission, fields }) => (
@@ -147,7 +147,7 @@ function FormWrapper({ children, formRef, }) {
147
147
  if (!formServiceConfig) {
148
148
  return null;
149
149
  }
150
- return ((0, jsx_runtime_1.jsx)(react_2.Form.Root, { formServiceConfig: formServiceConfig, formRef: formRef, children: children }));
150
+ return ((0, jsx_runtime_1.jsx)(components_1.Form.Root, { formServiceConfig: formServiceConfig, formRef: formRef, children: children }));
151
151
  }
152
152
  /**
153
153
  * Internal component that consumes BookingFormService and provides render props.
@@ -2,7 +2,7 @@
2
2
  * Validation logic for the Book action
3
3
  */
4
4
  import type { ServiceSelection } from '../booking.js';
5
- import type { FormValues } from '@wix/form-public';
5
+ import type { FormValues } from '@wix/forms/components';
6
6
  /**
7
7
  * Parameters for canBook validation
8
8
  */
@@ -2,7 +2,7 @@
2
2
  * Types for the Book action
3
3
  */
4
4
  import type { ServiceSelection } from '../booking.js';
5
- import type { FormValues } from '@wix/form-public';
5
+ import type { FormValues } from '@wix/forms/components';
6
6
  import type { Location as TimeSlotLocationType } from '@wix/auto_sdk_bookings_availability-time-slots';
7
7
  /**
8
8
  * Enum for book result types
@@ -6,7 +6,7 @@
6
6
  import { type Signal } from '@wix/services-definitions/core-services/signals';
7
7
  import type { Service, Location as ServiceLocationType } from '@wix/auto_sdk_bookings_services';
8
8
  import type { Resource, EventInfo, Location as TimeSlotLocationType } from '@wix/auto_sdk_bookings_availability-time-slots';
9
- import type { FormValues } from '@wix/form-public';
9
+ import type { FormValues } from '@wix/forms/components';
10
10
  import type { BookResult } from './book-action/types.js';
11
11
  /**
12
12
  * Extended Resource type with a type field for categorization
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import { type ReadOnlySignal } from '@wix/services-definitions/core-services/signals';
11
11
  import { forms } from '@wix/forms';
12
- import { FormServiceConfig } from '@wix/headless-forms/services';
12
+ import { FormServiceConfig } from '@wix/forms/services';
13
13
  /**
14
14
  * The required namespace for booking forms.
15
15
  * All booking forms must belong to this namespace.
@@ -1,4 +1,4 @@
1
- import type { FormValues } from '@wix/form-public';
1
+ import type { FormValues } from '@wix/forms/components';
2
2
  import type { Location } from '@wix/auto_sdk_bookings_services';
3
3
  import type { ServiceSelection, ServiceSelectionTimeSlot, ExtendedResource } from '../../services/booking/booking.js';
4
4
  export declare function createMockResource(overrides?: Partial<ExtendedResource>): ExtendedResource;
@@ -3,7 +3,7 @@
3
3
  * Wrapper for the Wix Bookings createBooking SDK function
4
4
  */
5
5
  import { type Booking, type CreateBookingResponse, type ParticipantNotification } from '@wix/auto_sdk_bookings_bookings';
6
- import type { FormValues } from '@wix/form-public';
6
+ import type { FormValues } from '@wix/forms/components';
7
7
  /**
8
8
  * Options for creating a booking
9
9
  */
@@ -3,7 +3,7 @@
3
3
  * Provides components for displaying and managing booking form fields
4
4
  */
5
5
  import React from 'react';
6
- import { Form } from '@wix/headless-forms/react';
6
+ import { Form } from '@wix/forms/components';
7
7
  import type { BookingFormRenderProps } from '../core/booking-form/BookingForm.js';
8
8
  type FieldMap = Parameters<typeof Form.Fields>[0]['fieldMap'];
9
9
  export declare const TestIds: {
@@ -5,7 +5,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
5
5
  */
6
6
  import React from 'react';
7
7
  import { AsChildSlot } from '@wix/headless-utils/react';
8
- import { Form } from '@wix/headless-forms/react';
8
+ import { Form } from '@wix/forms/components';
9
9
  import * as CoreBookingForm from '../core/booking-form/BookingForm.js';
10
10
  import { BookingFormConfigurationError } from '../../services/booking-form/booking-form.js';
11
11
  /**
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { type BookingServiceConfig, type ServiceSelection, type BookingServiceActions } from '../../../services/booking/booking.js';
7
- import type { FormValues } from '@wix/form-public';
7
+ import type { FormValues } from '@wix/forms/components';
8
8
  import type { TimeSlot, Resource } from '@wix/auto_sdk_bookings_availability-time-slots';
9
9
  import { type Service, type Location as ServiceLocationType } from '@wix/auto_sdk_bookings_services';
10
10
  import type { PricingServiceSelection } from '../../../services/payment/payment.js';
@@ -9,10 +9,10 @@
9
9
  * 2. SSR/SSG: Provide a pre-loaded form object for server-side rendering
10
10
  */
11
11
  import * as React from 'react';
12
- import { type FormValues } from '@wix/form-public';
12
+ import { type FormValues } from '@wix/forms/components';
13
13
  import { forms, submissions } from '@wix/forms';
14
14
  import { BookingFormConfigurationError } from '../../../services/booking-form/booking-form.js';
15
- import { Form } from '@wix/headless-forms/react';
15
+ import { Form } from '@wix/forms/components';
16
16
  type FieldMap = Parameters<typeof Form.Fields>[0]['fieldMap'];
17
17
  export type Submit = () => Promise<submissions.GetSubmissionResponse['submission'] | undefined>;
18
18
  export type ValidateStep = (stepId: string) => Promise<boolean>;
@@ -95,7 +95,7 @@ export type BookingFormProps = BookingFormWithFormIdProps | BookingFormWithFormP
95
95
  * ```tsx
96
96
  * // Pattern 1: Client-side loading
97
97
  * import * as CoreBookingForm from '@wix/headless-bookings/react/core/booking-form';
98
- * import { Form } from '@wix/headless-forms/react';
98
+ * import { Form } from '@wix/forms/components';
99
99
  *
100
100
  * <CoreBookingForm.Root formId="form-123">
101
101
  * {({ formId, setFormSubmission, fields }) => (
@@ -15,8 +15,8 @@ import { WixServices, useService } from '@wix/services-manager-react';
15
15
  import { createServicesMap } from '@wix/services-manager';
16
16
  import { BookingFormServiceDefinition, BookingFormService, BookingFormConfigurationError, } from '../../../services/booking-form/booking-form.js';
17
17
  import { BookingServiceDefinition } from '../../../services/booking/booking.js';
18
- import { Form } from '@wix/headless-forms/react';
19
- import { FormServiceDefinition } from '@wix/headless-forms/services';
18
+ import { Form } from '@wix/forms/components';
19
+ import { FormServiceDefinition } from '@wix/forms/services';
20
20
  import { SignalsServiceDefinition } from '@wix/services-definitions/core-services/signals';
21
21
  // ============================================================================
22
22
  // Component
@@ -41,7 +41,7 @@ import { SignalsServiceDefinition } from '@wix/services-definitions/core-service
41
41
  * ```tsx
42
42
  * // Pattern 1: Client-side loading
43
43
  * import * as CoreBookingForm from '@wix/headless-bookings/react/core/booking-form';
44
- * import { Form } from '@wix/headless-forms/react';
44
+ * import { Form } from '@wix/forms/components';
45
45
  *
46
46
  * <CoreBookingForm.Root formId="form-123">
47
47
  * {({ formId, setFormSubmission, fields }) => (
@@ -2,7 +2,7 @@
2
2
  * Validation logic for the Book action
3
3
  */
4
4
  import type { ServiceSelection } from '../booking.js';
5
- import type { FormValues } from '@wix/form-public';
5
+ import type { FormValues } from '@wix/forms/components';
6
6
  /**
7
7
  * Parameters for canBook validation
8
8
  */
@@ -2,7 +2,7 @@
2
2
  * Types for the Book action
3
3
  */
4
4
  import type { ServiceSelection } from '../booking.js';
5
- import type { FormValues } from '@wix/form-public';
5
+ import type { FormValues } from '@wix/forms/components';
6
6
  import type { Location as TimeSlotLocationType } from '@wix/auto_sdk_bookings_availability-time-slots';
7
7
  /**
8
8
  * Enum for book result types
@@ -6,7 +6,7 @@
6
6
  import { type Signal } from '@wix/services-definitions/core-services/signals';
7
7
  import type { Service, Location as ServiceLocationType } from '@wix/auto_sdk_bookings_services';
8
8
  import type { Resource, EventInfo, Location as TimeSlotLocationType } from '@wix/auto_sdk_bookings_availability-time-slots';
9
- import type { FormValues } from '@wix/form-public';
9
+ import type { FormValues } from '@wix/forms/components';
10
10
  import type { BookResult } from './book-action/types.js';
11
11
  /**
12
12
  * Extended Resource type with a type field for categorization
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import { type ReadOnlySignal } from '@wix/services-definitions/core-services/signals';
11
11
  import { forms } from '@wix/forms';
12
- import { FormServiceConfig } from '@wix/headless-forms/services';
12
+ import { FormServiceConfig } from '@wix/forms/services';
13
13
  /**
14
14
  * The required namespace for booking forms.
15
15
  * All booking forms must belong to this namespace.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-bookings",
3
- "version": "0.0.112",
3
+ "version": "0.0.114",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "test": "vitest",
12
12
  "lint:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md}\"",
13
13
  "lint:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,md}\"",
14
- "test:cjs-esm": "npx @wix/cjs-esm-build-verifier"
14
+ "test:cjs-esm": "cjs-esm-build-verifier"
15
15
  },
16
16
  "files": [
17
17
  "dist",
@@ -37,10 +37,9 @@
37
37
  "@wix/auto_sdk_bookings_bookings": "^1.0.103",
38
38
  "@wix/auto_sdk_bookings_event-time-slots": "^1.0.64",
39
39
  "@wix/auto_sdk_ecom_checkout": "^1.0.104",
40
- "@wix/form-public": "^0.125.0",
41
- "@wix/headless-forms": "0.0.38",
42
- "@wix/headless-media": "0.0.23",
43
- "@wix/headless-utils": "0.0.10",
40
+ "@wix/forms": "^1.0.384",
41
+ "@wix/headless-media": "0.0.24",
42
+ "@wix/headless-utils": "0.0.11",
44
43
  "@wix/services-definitions": "^1.0.1",
45
44
  "@wix/services-manager-react": "^1.0.3",
46
45
  "date-fns": "^4.1.0"
@@ -74,5 +73,5 @@
74
73
  "groupId": "com.wixpress.headless-components"
75
74
  }
76
75
  },
77
- "falconPackageHash": "1f6d821595229ac28d8371d48847d4b452a7d3450f8fd901493e82de"
76
+ "falconPackageHash": "acf097b39b9a06b7b7ff8eded039c9e4227c143a5a8f78707e700199"
78
77
  }