@cimplify/sdk 0.72.0 → 0.74.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.
- package/dist/react.d.mts +46 -3
- package/dist/react.d.ts +46 -3
- package/dist/react.js +248 -69
- package/dist/react.mjs +248 -70
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/registry/product-customizer.json +1 -1
- package/registry/product-image-gallery.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/variant-selector.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -6250,6 +6250,36 @@ function VariantSelector({
|
|
|
6250
6250
|
className: cn("flex flex-wrap gap-2", classNames?.axisOptions),
|
|
6251
6251
|
children: axis.values.map((value) => {
|
|
6252
6252
|
const isSelected = axisSelections[axis.id] === value.id;
|
|
6253
|
+
if (value.image_url || value.color_hex) {
|
|
6254
|
+
const isImage = Boolean(value.image_url);
|
|
6255
|
+
return /* @__PURE__ */ jsx(
|
|
6256
|
+
Radio.Root,
|
|
6257
|
+
{
|
|
6258
|
+
value: value.id,
|
|
6259
|
+
"data-cimplify-variant-option": true,
|
|
6260
|
+
"data-cimplify-variant-swatch": true,
|
|
6261
|
+
"data-selected": isSelected || void 0,
|
|
6262
|
+
"aria-label": value.name,
|
|
6263
|
+
title: value.name,
|
|
6264
|
+
style: isImage ? void 0 : { backgroundColor: value.color_hex },
|
|
6265
|
+
className: cn(
|
|
6266
|
+
"relative overflow-hidden border border-border transition-shadow",
|
|
6267
|
+
isImage ? "h-12 w-12 rounded-md" : "h-9 w-9 rounded-full",
|
|
6268
|
+
isSelected && "ring-2 ring-foreground ring-offset-2 ring-offset-background border-transparent",
|
|
6269
|
+
isSelected ? classNames?.swatchSelected : classNames?.swatch
|
|
6270
|
+
),
|
|
6271
|
+
children: isImage && /* @__PURE__ */ jsx(
|
|
6272
|
+
"img",
|
|
6273
|
+
{
|
|
6274
|
+
src: value.image_url,
|
|
6275
|
+
alt: "",
|
|
6276
|
+
className: "h-full w-full object-cover"
|
|
6277
|
+
}
|
|
6278
|
+
)
|
|
6279
|
+
},
|
|
6280
|
+
value.id
|
|
6281
|
+
);
|
|
6282
|
+
}
|
|
6253
6283
|
return /* @__PURE__ */ jsx(
|
|
6254
6284
|
Radio.Root,
|
|
6255
6285
|
{
|
|
@@ -7276,6 +7306,144 @@ function formatDuration2(value, unit) {
|
|
|
7276
7306
|
const label = value === 1 ? labels.singular : labels.plural;
|
|
7277
7307
|
return `${value} ${label}`;
|
|
7278
7308
|
}
|
|
7309
|
+
var ANY_VALUE = "__any__";
|
|
7310
|
+
function StaffPicker({
|
|
7311
|
+
staff,
|
|
7312
|
+
selectedStaffId,
|
|
7313
|
+
onStaffSelect,
|
|
7314
|
+
showAnyOption = true,
|
|
7315
|
+
anyLabel = "Any available",
|
|
7316
|
+
className,
|
|
7317
|
+
classNames
|
|
7318
|
+
}) {
|
|
7319
|
+
const groupValue = selectedStaffId === null ? ANY_VALUE : selectedStaffId ?? "";
|
|
7320
|
+
return /* @__PURE__ */ jsxs(
|
|
7321
|
+
RadioGroup,
|
|
7322
|
+
{
|
|
7323
|
+
"data-cimplify-staff-picker": true,
|
|
7324
|
+
className: cn(className, classNames?.root),
|
|
7325
|
+
value: groupValue,
|
|
7326
|
+
onValueChange: (value) => {
|
|
7327
|
+
onStaffSelect?.(value === ANY_VALUE ? null : value);
|
|
7328
|
+
},
|
|
7329
|
+
children: [
|
|
7330
|
+
showAnyOption && /* @__PURE__ */ jsx(
|
|
7331
|
+
Radio.Root,
|
|
7332
|
+
{
|
|
7333
|
+
value: ANY_VALUE,
|
|
7334
|
+
"data-cimplify-staff-option": true,
|
|
7335
|
+
"data-selected": selectedStaffId === null || void 0,
|
|
7336
|
+
"data-any": true,
|
|
7337
|
+
className: classNames?.option,
|
|
7338
|
+
children: /* @__PURE__ */ jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: anyLabel })
|
|
7339
|
+
}
|
|
7340
|
+
),
|
|
7341
|
+
staff.map((member) => /* @__PURE__ */ jsxs(
|
|
7342
|
+
Radio.Root,
|
|
7343
|
+
{
|
|
7344
|
+
value: member.id,
|
|
7345
|
+
"data-cimplify-staff-option": true,
|
|
7346
|
+
"data-selected": selectedStaffId === member.id || void 0,
|
|
7347
|
+
className: classNames?.option,
|
|
7348
|
+
children: [
|
|
7349
|
+
member.avatar_url && /* @__PURE__ */ jsx(
|
|
7350
|
+
"img",
|
|
7351
|
+
{
|
|
7352
|
+
src: member.avatar_url,
|
|
7353
|
+
alt: member.name,
|
|
7354
|
+
"data-cimplify-staff-avatar": true,
|
|
7355
|
+
className: classNames?.avatar
|
|
7356
|
+
}
|
|
7357
|
+
),
|
|
7358
|
+
/* @__PURE__ */ jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: member.name }),
|
|
7359
|
+
member.bio && /* @__PURE__ */ jsx("span", { "data-cimplify-staff-bio": true, className: classNames?.bio, children: member.bio })
|
|
7360
|
+
]
|
|
7361
|
+
},
|
|
7362
|
+
member.id
|
|
7363
|
+
))
|
|
7364
|
+
]
|
|
7365
|
+
}
|
|
7366
|
+
);
|
|
7367
|
+
}
|
|
7368
|
+
function formatDate(value) {
|
|
7369
|
+
const date = new Date(value);
|
|
7370
|
+
if (Number.isNaN(date.getTime())) return value;
|
|
7371
|
+
return date.toLocaleDateString(void 0, {
|
|
7372
|
+
weekday: "short",
|
|
7373
|
+
month: "short",
|
|
7374
|
+
day: "numeric"
|
|
7375
|
+
});
|
|
7376
|
+
}
|
|
7377
|
+
function formatTime(value) {
|
|
7378
|
+
const date = new Date(value);
|
|
7379
|
+
if (Number.isNaN(date.getTime())) return value;
|
|
7380
|
+
return date.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
7381
|
+
}
|
|
7382
|
+
function BookingSummary({
|
|
7383
|
+
slot,
|
|
7384
|
+
total,
|
|
7385
|
+
staffName,
|
|
7386
|
+
durationMinutes,
|
|
7387
|
+
depositType,
|
|
7388
|
+
depositAmount,
|
|
7389
|
+
currency,
|
|
7390
|
+
className,
|
|
7391
|
+
classNames
|
|
7392
|
+
}) {
|
|
7393
|
+
const depositValue = depositAmount != null ? parsePrice(depositAmount) : 0;
|
|
7394
|
+
const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
|
|
7395
|
+
const hasDeposit = depositDue > 0;
|
|
7396
|
+
const balance = Math.max(0, total - depositDue);
|
|
7397
|
+
const rowClass = cn("flex items-center justify-between", classNames?.row);
|
|
7398
|
+
const labelClass = cn("text-muted-foreground", classNames?.label);
|
|
7399
|
+
const valueClass = cn("font-medium", classNames?.value);
|
|
7400
|
+
return /* @__PURE__ */ jsxs(
|
|
7401
|
+
"div",
|
|
7402
|
+
{
|
|
7403
|
+
"data-cimplify-booking-summary": true,
|
|
7404
|
+
className: cn("rounded-lg border border-border p-4 space-y-3", className, classNames?.root),
|
|
7405
|
+
children: [
|
|
7406
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between", classNames?.header), children: [
|
|
7407
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Your booking" }),
|
|
7408
|
+
durationMinutes != null && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
7409
|
+
durationMinutes,
|
|
7410
|
+
" min"
|
|
7411
|
+
] })
|
|
7412
|
+
] }),
|
|
7413
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5 text-sm", children: [
|
|
7414
|
+
staffName && /* @__PURE__ */ jsxs("div", { className: rowClass, children: [
|
|
7415
|
+
/* @__PURE__ */ jsx("span", { className: labelClass, children: "With" }),
|
|
7416
|
+
/* @__PURE__ */ jsx("span", { className: valueClass, children: staffName })
|
|
7417
|
+
] }),
|
|
7418
|
+
/* @__PURE__ */ jsxs("div", { className: rowClass, children: [
|
|
7419
|
+
/* @__PURE__ */ jsx("span", { className: labelClass, children: "Date" }),
|
|
7420
|
+
/* @__PURE__ */ jsx("span", { className: valueClass, children: formatDate(slot.start_time) })
|
|
7421
|
+
] }),
|
|
7422
|
+
/* @__PURE__ */ jsxs("div", { className: rowClass, children: [
|
|
7423
|
+
/* @__PURE__ */ jsx("span", { className: labelClass, children: "Time" }),
|
|
7424
|
+
/* @__PURE__ */ jsx("span", { className: valueClass, children: formatTime(slot.start_time) })
|
|
7425
|
+
] })
|
|
7426
|
+
] }),
|
|
7427
|
+
/* @__PURE__ */ jsxs("div", { className: cn("border-t border-border pt-3 space-y-1.5 text-sm", classNames?.totals), children: [
|
|
7428
|
+
/* @__PURE__ */ jsxs("div", { className: rowClass, children: [
|
|
7429
|
+
/* @__PURE__ */ jsx("span", { className: labelClass, children: "Subtotal" }),
|
|
7430
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: /* @__PURE__ */ jsx(Price, { amount: total, currency }) })
|
|
7431
|
+
] }),
|
|
7432
|
+
hasDeposit && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7433
|
+
/* @__PURE__ */ jsxs("div", { className: cn(rowClass, classNames?.deposit), children: [
|
|
7434
|
+
/* @__PURE__ */ jsx("span", { className: labelClass, children: "Due now (deposit)" }),
|
|
7435
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: /* @__PURE__ */ jsx(Price, { amount: depositDue, currency }) })
|
|
7436
|
+
] }),
|
|
7437
|
+
/* @__PURE__ */ jsxs("div", { className: cn(rowClass, "text-xs text-muted-foreground", classNames?.balance), children: [
|
|
7438
|
+
/* @__PURE__ */ jsx("span", { children: "Balance at appointment" }),
|
|
7439
|
+
/* @__PURE__ */ jsx(Price, { amount: balance, currency })
|
|
7440
|
+
] })
|
|
7441
|
+
] })
|
|
7442
|
+
] })
|
|
7443
|
+
]
|
|
7444
|
+
}
|
|
7445
|
+
);
|
|
7446
|
+
}
|
|
7279
7447
|
var FREQUENCY_LABELS = {
|
|
7280
7448
|
weekly: "Weekly",
|
|
7281
7449
|
biweekly: "Biweekly",
|
|
@@ -8640,7 +8808,7 @@ function groupSlots(slots) {
|
|
|
8640
8808
|
}
|
|
8641
8809
|
return ["morning", "afternoon", "evening"].filter((tod) => groups[tod]?.length).map((tod) => ({ label: TIME_OF_DAY_LABELS[tod], slots: groups[tod] }));
|
|
8642
8810
|
}
|
|
8643
|
-
function
|
|
8811
|
+
function formatTime2(timeStr) {
|
|
8644
8812
|
try {
|
|
8645
8813
|
const date = new Date(timeStr);
|
|
8646
8814
|
if (!isNaN(date.getTime())) {
|
|
@@ -8703,6 +8871,7 @@ function SlotPicker({
|
|
|
8703
8871
|
onSlotSelect,
|
|
8704
8872
|
groupByTimeOfDay = true,
|
|
8705
8873
|
showPrice = true,
|
|
8874
|
+
lowCapacityThreshold = 3,
|
|
8706
8875
|
currency,
|
|
8707
8876
|
schedulingMode = "intraday",
|
|
8708
8877
|
durationUnit,
|
|
@@ -8796,21 +8965,25 @@ function SlotPicker({
|
|
|
8796
8965
|
children: group.slots.map((slot) => {
|
|
8797
8966
|
const value = slotToValue(slot);
|
|
8798
8967
|
const isSelected = selectedSlot?.start_time === slot.start_time && selectedSlot?.end_time === slot.end_time;
|
|
8968
|
+
const capacity = slot.capacity_available ?? slot.remaining_capacity;
|
|
8969
|
+
const soldOut = capacity === 0;
|
|
8970
|
+
const unavailable = slot.is_available === false || soldOut;
|
|
8971
|
+
const lowCapacity = lowCapacityThreshold > 0 && capacity != null && capacity > 0 && capacity <= lowCapacityThreshold;
|
|
8799
8972
|
return /* @__PURE__ */ jsxs(
|
|
8800
8973
|
Radio.Root,
|
|
8801
8974
|
{
|
|
8802
8975
|
value,
|
|
8803
|
-
disabled:
|
|
8976
|
+
disabled: unavailable,
|
|
8804
8977
|
"data-cimplify-slot": true,
|
|
8805
8978
|
"data-selected": isSelected || void 0,
|
|
8806
|
-
"data-unavailable":
|
|
8979
|
+
"data-unavailable": unavailable || void 0,
|
|
8807
8980
|
className: cn(
|
|
8808
8981
|
"inline-flex items-center justify-center gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm font-medium text-foreground transition-colors hover:border-foreground/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[selected]:border-foreground data-[selected]:bg-foreground data-[selected]:text-background data-[unavailable]:cursor-not-allowed data-[unavailable]:opacity-40 data-[unavailable]:line-through",
|
|
8809
8982
|
isMultiDay && "justify-between text-left",
|
|
8810
8983
|
classNames?.slot
|
|
8811
8984
|
),
|
|
8812
8985
|
children: [
|
|
8813
|
-
/* @__PURE__ */ jsx("span", { "data-cimplify-slot-time": true, className: classNames?.slotTime, children: isMultiDay ? formatStaySummary(slot, durationUnit, durationValue) :
|
|
8986
|
+
/* @__PURE__ */ jsx("span", { "data-cimplify-slot-time": true, className: classNames?.slotTime, children: isMultiDay ? formatStaySummary(slot, durationUnit, durationValue) : formatTime2(slot.start_time) }),
|
|
8814
8987
|
showPrice && slot.price && /* @__PURE__ */ jsx(
|
|
8815
8988
|
"span",
|
|
8816
8989
|
{
|
|
@@ -8818,6 +8991,17 @@ function SlotPicker({
|
|
|
8818
8991
|
className: cn("text-xs opacity-70", classNames?.slotPrice),
|
|
8819
8992
|
children: /* @__PURE__ */ jsx(Price, { amount: slot.price, currency })
|
|
8820
8993
|
}
|
|
8994
|
+
),
|
|
8995
|
+
lowCapacity && /* @__PURE__ */ jsxs(
|
|
8996
|
+
"span",
|
|
8997
|
+
{
|
|
8998
|
+
"data-cimplify-slot-scarcity": true,
|
|
8999
|
+
className: cn("text-xs font-medium text-amber-600", classNames?.slotScarcity),
|
|
9000
|
+
children: [
|
|
9001
|
+
capacity,
|
|
9002
|
+
" left"
|
|
9003
|
+
]
|
|
9004
|
+
}
|
|
8821
9005
|
)
|
|
8822
9006
|
]
|
|
8823
9007
|
},
|
|
@@ -8833,7 +9017,7 @@ function SlotPicker({
|
|
|
8833
9017
|
}
|
|
8834
9018
|
);
|
|
8835
9019
|
}
|
|
8836
|
-
function
|
|
9020
|
+
function formatDate2(dateStr) {
|
|
8837
9021
|
const date = /* @__PURE__ */ new Date(dateStr + "T00:00:00");
|
|
8838
9022
|
return date.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" });
|
|
8839
9023
|
}
|
|
@@ -8978,7 +9162,7 @@ function DateSlotPicker({
|
|
|
8978
9162
|
"flex flex-col items-center justify-center rounded-md border border-border bg-background px-1 py-2 text-center text-xs font-medium text-foreground transition-colors hover:border-foreground/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[selected]:border-foreground data-[selected]:bg-foreground data-[selected]:text-background data-[fully-booked]:cursor-not-allowed data-[fully-booked]:opacity-40",
|
|
8979
9163
|
classNames?.dateButton
|
|
8980
9164
|
),
|
|
8981
|
-
children:
|
|
9165
|
+
children: formatDate2(date)
|
|
8982
9166
|
},
|
|
8983
9167
|
date
|
|
8984
9168
|
);
|
|
@@ -9038,6 +9222,7 @@ function ProductCustomizer({
|
|
|
9038
9222
|
const [customerInputValues, setCustomerInputValues] = useState({});
|
|
9039
9223
|
const [specialInstructions, setSpecialInstructions] = useState("");
|
|
9040
9224
|
const [selectedSlot, setSelectedSlot] = useState(null);
|
|
9225
|
+
const [selectedStaffId, setSelectedStaffId] = useState(null);
|
|
9041
9226
|
const cart = useCart();
|
|
9042
9227
|
const currency = getProductCurrency(product);
|
|
9043
9228
|
const productType = product.type || "product";
|
|
@@ -9065,7 +9250,16 @@ function ProductCustomizer({
|
|
|
9065
9250
|
setCustomerInputValues({});
|
|
9066
9251
|
setSpecialInstructions("");
|
|
9067
9252
|
setSelectedSlot(null);
|
|
9253
|
+
setSelectedStaffId(null);
|
|
9068
9254
|
}, [product.id, product.min_order_quantity]);
|
|
9255
|
+
const slotStaff = useMemo(
|
|
9256
|
+
() => (selectedSlot?.available_staff ?? []).map((member) => ({
|
|
9257
|
+
id: member.staff_id,
|
|
9258
|
+
name: member.name
|
|
9259
|
+
})),
|
|
9260
|
+
[selectedSlot]
|
|
9261
|
+
);
|
|
9262
|
+
const selectedStaffName = selectedStaffId ? slotStaff.find((member) => member.id === selectedStaffId)?.name ?? null : null;
|
|
9069
9263
|
const selectedAddOnOptions = useMemo(() => {
|
|
9070
9264
|
if (!product.add_ons) return [];
|
|
9071
9265
|
const options = [];
|
|
@@ -9177,7 +9371,7 @@ function ProductCustomizer({
|
|
|
9177
9371
|
...isService && selectedSlot ? {
|
|
9178
9372
|
scheduledStart: selectedSlot.start_time,
|
|
9179
9373
|
scheduledEnd: selectedSlot.end_time,
|
|
9180
|
-
staffId: selectedSlot.available_staff?.[0]?.staff_id,
|
|
9374
|
+
staffId: selectedStaffId ?? selectedSlot.available_staff?.[0]?.staff_id,
|
|
9181
9375
|
resourceId: selectedSlot.available_resources?.[0]?.resource_id
|
|
9182
9376
|
} : {},
|
|
9183
9377
|
customerInputs: Object.keys(customerInputValues).length > 0 ? Object.entries(customerInputValues).filter(([, v]) => v !== void 0 && v !== "").map(([fieldId, value]) => ({ field_id: fieldId, value })) : void 0,
|
|
@@ -9199,7 +9393,7 @@ function ProductCustomizer({
|
|
|
9199
9393
|
} finally {
|
|
9200
9394
|
setIsSubmitting(false);
|
|
9201
9395
|
}
|
|
9202
|
-
}, [product, quantity, selectedVariantId, selectedVariant, quoteId, normalizedAddOnOptionIds, selectedAddOnOptions, isComposite, compositeSelections, isBundle, bundleSelections, selectedBillingPlan, customerInputValues, specialInstructions, isService, selectedSlot, isSubmitting, onAddToCart, cart]);
|
|
9396
|
+
}, [product, quantity, selectedVariantId, selectedVariant, quoteId, normalizedAddOnOptionIds, selectedAddOnOptions, isComposite, compositeSelections, isBundle, bundleSelections, selectedBillingPlan, customerInputValues, specialInstructions, isService, selectedSlot, selectedStaffId, isSubmitting, onAddToCart, cart]);
|
|
9203
9397
|
return /* @__PURE__ */ jsxs("div", { "data-cimplify-customizer": true, className: cn("space-y-6", className, classNames?.root), children: [
|
|
9204
9398
|
isComposite && product.groups && product.composite_id && /* @__PURE__ */ jsx(
|
|
9205
9399
|
CompositeSelector,
|
|
@@ -9231,11 +9425,30 @@ function ProductCustomizer({
|
|
|
9231
9425
|
{
|
|
9232
9426
|
serviceId: product.id,
|
|
9233
9427
|
selectedSlot,
|
|
9234
|
-
onSlotSelect: (slot) =>
|
|
9428
|
+
onSlotSelect: (slot) => {
|
|
9429
|
+
setSelectedSlot(slot);
|
|
9430
|
+
setSelectedStaffId(null);
|
|
9431
|
+
},
|
|
9235
9432
|
participantCount: quantity,
|
|
9236
9433
|
currency
|
|
9237
9434
|
}
|
|
9238
9435
|
),
|
|
9436
|
+
isService && slotStaff.length > 0 && /* @__PURE__ */ jsxs("div", { "data-cimplify-customizer-staff": true, children: [
|
|
9437
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium uppercase tracking-wider text-muted-foreground mb-3", children: "Choose your specialist" }),
|
|
9438
|
+
/* @__PURE__ */ jsx(
|
|
9439
|
+
StaffPicker,
|
|
9440
|
+
{
|
|
9441
|
+
staff: slotStaff,
|
|
9442
|
+
selectedStaffId,
|
|
9443
|
+
onStaffSelect: setSelectedStaffId,
|
|
9444
|
+
className: "flex flex-wrap gap-2",
|
|
9445
|
+
classNames: {
|
|
9446
|
+
option: "inline-flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm font-medium transition-colors hover:border-foreground/40 cursor-pointer data-[selected]:border-foreground data-[selected]:bg-foreground data-[selected]:text-background",
|
|
9447
|
+
avatar: "w-6 h-6 rounded-full object-cover"
|
|
9448
|
+
}
|
|
9449
|
+
}
|
|
9450
|
+
)
|
|
9451
|
+
] }),
|
|
9239
9452
|
hasVariants && /* @__PURE__ */ jsx(
|
|
9240
9453
|
VariantSelector,
|
|
9241
9454
|
{
|
|
@@ -9320,6 +9533,18 @@ function ProductCustomizer({
|
|
|
9320
9533
|
)
|
|
9321
9534
|
}
|
|
9322
9535
|
) }),
|
|
9536
|
+
isService && selectedSlot && /* @__PURE__ */ jsx(
|
|
9537
|
+
BookingSummary,
|
|
9538
|
+
{
|
|
9539
|
+
slot: selectedSlot,
|
|
9540
|
+
total: displayTotalPrice,
|
|
9541
|
+
staffName: selectedStaffName,
|
|
9542
|
+
durationMinutes: product.duration_minutes,
|
|
9543
|
+
depositType: product.deposit_type,
|
|
9544
|
+
depositAmount: product.deposit_amount,
|
|
9545
|
+
currency
|
|
9546
|
+
}
|
|
9547
|
+
),
|
|
9323
9548
|
/* @__PURE__ */ jsxs(
|
|
9324
9549
|
"div",
|
|
9325
9550
|
{
|
|
@@ -9397,9 +9622,15 @@ function ProductImageGallery({
|
|
|
9397
9622
|
[images]
|
|
9398
9623
|
);
|
|
9399
9624
|
const [selectedImage, setSelectedImage] = useState(0);
|
|
9625
|
+
const [fadeIn, setFadeIn] = useState(true);
|
|
9400
9626
|
useEffect(() => {
|
|
9401
9627
|
setSelectedImage(0);
|
|
9402
9628
|
}, [normalizedImages.length, productName]);
|
|
9629
|
+
useEffect(() => {
|
|
9630
|
+
setFadeIn(false);
|
|
9631
|
+
const id = requestAnimationFrame(() => setFadeIn(true));
|
|
9632
|
+
return () => cancelAnimationFrame(id);
|
|
9633
|
+
}, [selectedImage]);
|
|
9403
9634
|
if (normalizedImages.length === 0) {
|
|
9404
9635
|
return null;
|
|
9405
9636
|
}
|
|
@@ -9415,7 +9646,13 @@ function ProductImageGallery({
|
|
|
9415
9646
|
{
|
|
9416
9647
|
src: activeImage,
|
|
9417
9648
|
alt: productName,
|
|
9418
|
-
style: {
|
|
9649
|
+
style: {
|
|
9650
|
+
width: "100%",
|
|
9651
|
+
height: "100%",
|
|
9652
|
+
objectFit: "cover",
|
|
9653
|
+
opacity: fadeIn ? 1 : 0,
|
|
9654
|
+
transition: "opacity 300ms ease"
|
|
9655
|
+
},
|
|
9419
9656
|
"data-cimplify-image-gallery-active": true
|
|
9420
9657
|
}
|
|
9421
9658
|
)
|
|
@@ -12423,65 +12660,6 @@ function StoreNav({
|
|
|
12423
12660
|
] })
|
|
12424
12661
|
] });
|
|
12425
12662
|
}
|
|
12426
|
-
var ANY_VALUE = "__any__";
|
|
12427
|
-
function StaffPicker({
|
|
12428
|
-
staff,
|
|
12429
|
-
selectedStaffId,
|
|
12430
|
-
onStaffSelect,
|
|
12431
|
-
showAnyOption = true,
|
|
12432
|
-
anyLabel = "Any available",
|
|
12433
|
-
className,
|
|
12434
|
-
classNames
|
|
12435
|
-
}) {
|
|
12436
|
-
const groupValue = selectedStaffId === null ? ANY_VALUE : selectedStaffId ?? "";
|
|
12437
|
-
return /* @__PURE__ */ jsxs(
|
|
12438
|
-
RadioGroup,
|
|
12439
|
-
{
|
|
12440
|
-
"data-cimplify-staff-picker": true,
|
|
12441
|
-
className: cn(className, classNames?.root),
|
|
12442
|
-
value: groupValue,
|
|
12443
|
-
onValueChange: (value) => {
|
|
12444
|
-
onStaffSelect?.(value === ANY_VALUE ? null : value);
|
|
12445
|
-
},
|
|
12446
|
-
children: [
|
|
12447
|
-
showAnyOption && /* @__PURE__ */ jsx(
|
|
12448
|
-
Radio.Root,
|
|
12449
|
-
{
|
|
12450
|
-
value: ANY_VALUE,
|
|
12451
|
-
"data-cimplify-staff-option": true,
|
|
12452
|
-
"data-selected": selectedStaffId === null || void 0,
|
|
12453
|
-
"data-any": true,
|
|
12454
|
-
className: classNames?.option,
|
|
12455
|
-
children: /* @__PURE__ */ jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: anyLabel })
|
|
12456
|
-
}
|
|
12457
|
-
),
|
|
12458
|
-
staff.map((member) => /* @__PURE__ */ jsxs(
|
|
12459
|
-
Radio.Root,
|
|
12460
|
-
{
|
|
12461
|
-
value: member.id,
|
|
12462
|
-
"data-cimplify-staff-option": true,
|
|
12463
|
-
"data-selected": selectedStaffId === member.id || void 0,
|
|
12464
|
-
className: classNames?.option,
|
|
12465
|
-
children: [
|
|
12466
|
-
member.avatar_url && /* @__PURE__ */ jsx(
|
|
12467
|
-
"img",
|
|
12468
|
-
{
|
|
12469
|
-
src: member.avatar_url,
|
|
12470
|
-
alt: member.name,
|
|
12471
|
-
"data-cimplify-staff-avatar": true,
|
|
12472
|
-
className: classNames?.avatar
|
|
12473
|
-
}
|
|
12474
|
-
),
|
|
12475
|
-
/* @__PURE__ */ jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: member.name }),
|
|
12476
|
-
member.bio && /* @__PURE__ */ jsx("span", { "data-cimplify-staff-bio": true, className: classNames?.bio, children: member.bio })
|
|
12477
|
-
]
|
|
12478
|
-
},
|
|
12479
|
-
member.id
|
|
12480
|
-
))
|
|
12481
|
-
]
|
|
12482
|
-
}
|
|
12483
|
-
);
|
|
12484
|
-
}
|
|
12485
12663
|
var STATUS_LABELS3 = {
|
|
12486
12664
|
pending: "Pending",
|
|
12487
12665
|
confirmed: "Confirmed",
|
|
@@ -16574,4 +16752,4 @@ function SparkleIcon({ className }) {
|
|
|
16574
16752
|
);
|
|
16575
16753
|
}
|
|
16576
16754
|
|
|
16577
|
-
export { AccommodationCard, AccountContent, AccountDashboardPage, AccountHero, AccountIdentityStrip, AccountLineItem, AccountLineItems, AccountNav, AccountOrderDetailPage, AccountOrderView, AccountOrdersPage, AccountShell, AccountSidebar, AccountSignedOutPrompt, AccountSubscriptionDetailPage, AccountSubscriptionsPage, Ad, AdProvider, AddOnSelector, AddressElement, AuthElement, AvailabilityBadge, BackLink, BillingPlanSelector, BookingCard, BookingList, BookingPage, BookingsPage, BoxIcon24, BundleProductCard, BundleProductLayout, BundleSelector, Button, CardImage, CardShell, CardVariant, CartDrawer, CartDrawerProvider, CartPage, CartSummary, CartTemplate, CatalogueCollectionLayout, CataloguePage, CatalogueTemplate, CategoryFilter, CategoryGrid, ChatWidget, CheckIcon, CheckoutPage, CimplifyCheckout, CimplifyProvider, CimplifySignInButton, CimplifyUserButton, CollectionPage, CollectionTemplate, CompactCartLayout, CompactCatalogueLayout, CompactSearchLayout, CompactServiceCard, CompositeProductCard, CompositeProductLayout, CompositeSelector, ContextCard, ContinuityCard, CurrencySelector, CustomAttributesTable, CustomerInputFields, DashboardIcon, DashboardIcon20, DatePicker, DateSlotPicker, DealBanner, DealsPage, DefaultCartLayout, DefaultCatalogueLayout, DefaultCollectionLayout, DefaultProductLayout, DefaultSearchLayout, DeliveryEstimate, DeliveryTracker, DeliveryTruckIcon, DigitalProductCard, DigitalProductLayout, DiscountInput, ElementsProvider, EmptyState, ErrorState, FeaturedCollectionLayout, FilterTabs, FoodProductCard, FoodProductLayout, HappeningCard, IdentityIcon, IdentityOfframp, InventoryBadge, ItemsCard, LeaseServiceCard, LineItemDetails, LocationPicker, MediaGallery, MetadataStringList, MobileAccountShell, MobileBackButton, MobileMoreButton, MobileTabBar, NextDeliveryCard, OrderDetailHeader, OrderDetailMetaPipe, OrderDetailPage, OrderHistory, OrderHistoryPage, OrderList, OrderRow, OrderSummary, OrderTimeline, OrderTotals, OrdersIcon, OrdersIcon20, OvenIcon, PackageIcon, PaymentElement, Price, PriceRange, ProductCard, ProductCustomizer, ProductGrid, ProductImageGallery, ProductModel3D, ProductPage, ProductSheet, ProductTemplate, PropertiesTable, QuantitySelector, QuickAddButton, RecentlyViewed, RecommendationCarousel, RelatedProductsSection, RentalServiceCard, ResourcePicker, RetailProductCard, RichText, SaleBadge, ScheduleServiceCard, SearchInput, SearchPage, SearchTemplate, Section, SectionMore, ServiceProductLayout, SessionMessageBanner, SignOutIcon, Skeleton, SlotPicker, SoldOutOverlay, StaffPicker, StandardServiceCard, Status, StoreNav, StoreVideo, SubscriptionCard, SubscriptionList, SubscriptionRow, SubscriptionsIcon, SubscriptionsIcon20, TagPills, TimePicker, Toast, TwoColumnGrid, VariantSelector, VolumePricing, WelcomeCard, WholesaleProductCard, WholesaleProductLayout, WishlistButton, cn, roomToResource, sanitizeRichTextHtml, stripHtmlToText, toAccountLineItem, toAccountLineItems, toAccountOrderView, useActivityState, useAds, useAttributeDefinitions, useAvailableSlots, useBillingPlans, useBookings, useBootstrap, useBundles, useCart, useCartDrawer, useCategories, useChat, useCheckout, useCimplify, useCimplifyClient, useCimplifySession, useCollection, useCollections, useDeals, useDeliveryFee, useElements, useElementsReady, useFxRate, useLocations, useOptionalCimplify, useOrder, useOrders, useProduct, useProductAvailability, useProductDeals, useProductPrice, useProductSchedules, useProducts, useProductsOnSale, usePropertyFacets, useQuote, useRecommendations, useSearch, useServiceAvailability, useServices, useSubscription, useSubscriptions, useTaxonomies, useTaxonomy, useTaxonomyPath, useValidateDiscount, useVariantSelector };
|
|
16755
|
+
export { AccommodationCard, AccountContent, AccountDashboardPage, AccountHero, AccountIdentityStrip, AccountLineItem, AccountLineItems, AccountNav, AccountOrderDetailPage, AccountOrderView, AccountOrdersPage, AccountShell, AccountSidebar, AccountSignedOutPrompt, AccountSubscriptionDetailPage, AccountSubscriptionsPage, Ad, AdProvider, AddOnSelector, AddressElement, AuthElement, AvailabilityBadge, BackLink, BillingPlanSelector, BookingCard, BookingList, BookingPage, BookingSummary, BookingsPage, BoxIcon24, BundleProductCard, BundleProductLayout, BundleSelector, Button, CardImage, CardShell, CardVariant, CartDrawer, CartDrawerProvider, CartPage, CartSummary, CartTemplate, CatalogueCollectionLayout, CataloguePage, CatalogueTemplate, CategoryFilter, CategoryGrid, ChatWidget, CheckIcon, CheckoutPage, CimplifyCheckout, CimplifyProvider, CimplifySignInButton, CimplifyUserButton, CollectionPage, CollectionTemplate, CompactCartLayout, CompactCatalogueLayout, CompactSearchLayout, CompactServiceCard, CompositeProductCard, CompositeProductLayout, CompositeSelector, ContextCard, ContinuityCard, CurrencySelector, CustomAttributesTable, CustomerInputFields, DashboardIcon, DashboardIcon20, DatePicker, DateSlotPicker, DealBanner, DealsPage, DefaultCartLayout, DefaultCatalogueLayout, DefaultCollectionLayout, DefaultProductLayout, DefaultSearchLayout, DeliveryEstimate, DeliveryTracker, DeliveryTruckIcon, DigitalProductCard, DigitalProductLayout, DiscountInput, ElementsProvider, EmptyState, ErrorState, FeaturedCollectionLayout, FilterTabs, FoodProductCard, FoodProductLayout, HappeningCard, IdentityIcon, IdentityOfframp, InventoryBadge, ItemsCard, LeaseServiceCard, LineItemDetails, LocationPicker, MediaGallery, MetadataStringList, MobileAccountShell, MobileBackButton, MobileMoreButton, MobileTabBar, NextDeliveryCard, OrderDetailHeader, OrderDetailMetaPipe, OrderDetailPage, OrderHistory, OrderHistoryPage, OrderList, OrderRow, OrderSummary, OrderTimeline, OrderTotals, OrdersIcon, OrdersIcon20, OvenIcon, PackageIcon, PaymentElement, Price, PriceRange, ProductCard, ProductCustomizer, ProductGrid, ProductImageGallery, ProductModel3D, ProductPage, ProductSheet, ProductTemplate, PropertiesTable, QuantitySelector, QuickAddButton, RecentlyViewed, RecommendationCarousel, RelatedProductsSection, RentalServiceCard, ResourcePicker, RetailProductCard, RichText, SaleBadge, ScheduleServiceCard, SearchInput, SearchPage, SearchTemplate, Section, SectionMore, ServiceProductLayout, SessionMessageBanner, SignOutIcon, Skeleton, SlotPicker, SoldOutOverlay, StaffPicker, StandardServiceCard, Status, StoreNav, StoreVideo, SubscriptionCard, SubscriptionList, SubscriptionRow, SubscriptionsIcon, SubscriptionsIcon20, TagPills, TimePicker, Toast, TwoColumnGrid, VariantSelector, VolumePricing, WelcomeCard, WholesaleProductCard, WholesaleProductLayout, WishlistButton, cn, roomToResource, sanitizeRichTextHtml, stripHtmlToText, toAccountLineItem, toAccountLineItems, toAccountOrderView, useActivityState, useAds, useAttributeDefinitions, useAvailableSlots, useBillingPlans, useBookings, useBootstrap, useBundles, useCart, useCartDrawer, useCategories, useChat, useCheckout, useCimplify, useCimplifyClient, useCimplifySession, useCollection, useCollections, useDeals, useDeliveryFee, useElements, useElementsReady, useFxRate, useLocations, useOptionalCimplify, useOrder, useOrders, useProduct, useProductAvailability, useProductDeals, useProductPrice, useProductSchedules, useProducts, useProductsOnSale, usePropertyFacets, useQuote, useRecommendations, useSearch, useServiceAvailability, useServices, useSubscription, useSubscriptions, useTaxonomies, useTaxonomy, useTaxonomyPath, useValidateDiscount, useVariantSelector };
|