@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.js
CHANGED
|
@@ -6255,6 +6255,36 @@ function VariantSelector({
|
|
|
6255
6255
|
className: cn("flex flex-wrap gap-2", classNames?.axisOptions),
|
|
6256
6256
|
children: axis.values.map((value) => {
|
|
6257
6257
|
const isSelected = axisSelections[axis.id] === value.id;
|
|
6258
|
+
if (value.image_url || value.color_hex) {
|
|
6259
|
+
const isImage = Boolean(value.image_url);
|
|
6260
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6261
|
+
radio.Radio.Root,
|
|
6262
|
+
{
|
|
6263
|
+
value: value.id,
|
|
6264
|
+
"data-cimplify-variant-option": true,
|
|
6265
|
+
"data-cimplify-variant-swatch": true,
|
|
6266
|
+
"data-selected": isSelected || void 0,
|
|
6267
|
+
"aria-label": value.name,
|
|
6268
|
+
title: value.name,
|
|
6269
|
+
style: isImage ? void 0 : { backgroundColor: value.color_hex },
|
|
6270
|
+
className: cn(
|
|
6271
|
+
"relative overflow-hidden border border-border transition-shadow",
|
|
6272
|
+
isImage ? "h-12 w-12 rounded-md" : "h-9 w-9 rounded-full",
|
|
6273
|
+
isSelected && "ring-2 ring-foreground ring-offset-2 ring-offset-background border-transparent",
|
|
6274
|
+
isSelected ? classNames?.swatchSelected : classNames?.swatch
|
|
6275
|
+
),
|
|
6276
|
+
children: isImage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6277
|
+
"img",
|
|
6278
|
+
{
|
|
6279
|
+
src: value.image_url,
|
|
6280
|
+
alt: "",
|
|
6281
|
+
className: "h-full w-full object-cover"
|
|
6282
|
+
}
|
|
6283
|
+
)
|
|
6284
|
+
},
|
|
6285
|
+
value.id
|
|
6286
|
+
);
|
|
6287
|
+
}
|
|
6258
6288
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6259
6289
|
radio.Radio.Root,
|
|
6260
6290
|
{
|
|
@@ -7281,6 +7311,144 @@ function formatDuration2(value, unit) {
|
|
|
7281
7311
|
const label = value === 1 ? labels.singular : labels.plural;
|
|
7282
7312
|
return `${value} ${label}`;
|
|
7283
7313
|
}
|
|
7314
|
+
var ANY_VALUE = "__any__";
|
|
7315
|
+
function StaffPicker({
|
|
7316
|
+
staff,
|
|
7317
|
+
selectedStaffId,
|
|
7318
|
+
onStaffSelect,
|
|
7319
|
+
showAnyOption = true,
|
|
7320
|
+
anyLabel = "Any available",
|
|
7321
|
+
className,
|
|
7322
|
+
classNames
|
|
7323
|
+
}) {
|
|
7324
|
+
const groupValue = selectedStaffId === null ? ANY_VALUE : selectedStaffId ?? "";
|
|
7325
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7326
|
+
radioGroup.RadioGroup,
|
|
7327
|
+
{
|
|
7328
|
+
"data-cimplify-staff-picker": true,
|
|
7329
|
+
className: cn(className, classNames?.root),
|
|
7330
|
+
value: groupValue,
|
|
7331
|
+
onValueChange: (value) => {
|
|
7332
|
+
onStaffSelect?.(value === ANY_VALUE ? null : value);
|
|
7333
|
+
},
|
|
7334
|
+
children: [
|
|
7335
|
+
showAnyOption && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7336
|
+
radio.Radio.Root,
|
|
7337
|
+
{
|
|
7338
|
+
value: ANY_VALUE,
|
|
7339
|
+
"data-cimplify-staff-option": true,
|
|
7340
|
+
"data-selected": selectedStaffId === null || void 0,
|
|
7341
|
+
"data-any": true,
|
|
7342
|
+
className: classNames?.option,
|
|
7343
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: anyLabel })
|
|
7344
|
+
}
|
|
7345
|
+
),
|
|
7346
|
+
staff.map((member) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7347
|
+
radio.Radio.Root,
|
|
7348
|
+
{
|
|
7349
|
+
value: member.id,
|
|
7350
|
+
"data-cimplify-staff-option": true,
|
|
7351
|
+
"data-selected": selectedStaffId === member.id || void 0,
|
|
7352
|
+
className: classNames?.option,
|
|
7353
|
+
children: [
|
|
7354
|
+
member.avatar_url && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7355
|
+
"img",
|
|
7356
|
+
{
|
|
7357
|
+
src: member.avatar_url,
|
|
7358
|
+
alt: member.name,
|
|
7359
|
+
"data-cimplify-staff-avatar": true,
|
|
7360
|
+
className: classNames?.avatar
|
|
7361
|
+
}
|
|
7362
|
+
),
|
|
7363
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: member.name }),
|
|
7364
|
+
member.bio && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-bio": true, className: classNames?.bio, children: member.bio })
|
|
7365
|
+
]
|
|
7366
|
+
},
|
|
7367
|
+
member.id
|
|
7368
|
+
))
|
|
7369
|
+
]
|
|
7370
|
+
}
|
|
7371
|
+
);
|
|
7372
|
+
}
|
|
7373
|
+
function formatDate(value) {
|
|
7374
|
+
const date = new Date(value);
|
|
7375
|
+
if (Number.isNaN(date.getTime())) return value;
|
|
7376
|
+
return date.toLocaleDateString(void 0, {
|
|
7377
|
+
weekday: "short",
|
|
7378
|
+
month: "short",
|
|
7379
|
+
day: "numeric"
|
|
7380
|
+
});
|
|
7381
|
+
}
|
|
7382
|
+
function formatTime(value) {
|
|
7383
|
+
const date = new Date(value);
|
|
7384
|
+
if (Number.isNaN(date.getTime())) return value;
|
|
7385
|
+
return date.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
7386
|
+
}
|
|
7387
|
+
function BookingSummary({
|
|
7388
|
+
slot,
|
|
7389
|
+
total,
|
|
7390
|
+
staffName,
|
|
7391
|
+
durationMinutes,
|
|
7392
|
+
depositType,
|
|
7393
|
+
depositAmount,
|
|
7394
|
+
currency,
|
|
7395
|
+
className,
|
|
7396
|
+
classNames
|
|
7397
|
+
}) {
|
|
7398
|
+
const depositValue = depositAmount != null ? chunk7Y2O3E4D_js.parsePrice(depositAmount) : 0;
|
|
7399
|
+
const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
|
|
7400
|
+
const hasDeposit = depositDue > 0;
|
|
7401
|
+
const balance = Math.max(0, total - depositDue);
|
|
7402
|
+
const rowClass = cn("flex items-center justify-between", classNames?.row);
|
|
7403
|
+
const labelClass = cn("text-muted-foreground", classNames?.label);
|
|
7404
|
+
const valueClass = cn("font-medium", classNames?.value);
|
|
7405
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7406
|
+
"div",
|
|
7407
|
+
{
|
|
7408
|
+
"data-cimplify-booking-summary": true,
|
|
7409
|
+
className: cn("rounded-lg border border-border p-4 space-y-3", className, classNames?.root),
|
|
7410
|
+
children: [
|
|
7411
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center justify-between", classNames?.header), children: [
|
|
7412
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold", children: "Your booking" }),
|
|
7413
|
+
durationMinutes != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
7414
|
+
durationMinutes,
|
|
7415
|
+
" min"
|
|
7416
|
+
] })
|
|
7417
|
+
] }),
|
|
7418
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5 text-sm", children: [
|
|
7419
|
+
staffName && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: rowClass, children: [
|
|
7420
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: labelClass, children: "With" }),
|
|
7421
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: valueClass, children: staffName })
|
|
7422
|
+
] }),
|
|
7423
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: rowClass, children: [
|
|
7424
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: labelClass, children: "Date" }),
|
|
7425
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: valueClass, children: formatDate(slot.start_time) })
|
|
7426
|
+
] }),
|
|
7427
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: rowClass, children: [
|
|
7428
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: labelClass, children: "Time" }),
|
|
7429
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: valueClass, children: formatTime(slot.start_time) })
|
|
7430
|
+
] })
|
|
7431
|
+
] }),
|
|
7432
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("border-t border-border pt-3 space-y-1.5 text-sm", classNames?.totals), children: [
|
|
7433
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: rowClass, children: [
|
|
7434
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: labelClass, children: "Subtotal" }),
|
|
7435
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: total, currency }) })
|
|
7436
|
+
] }),
|
|
7437
|
+
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7438
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(rowClass, classNames?.deposit), children: [
|
|
7439
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: labelClass, children: "Due now (deposit)" }),
|
|
7440
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositDue, currency }) })
|
|
7441
|
+
] }),
|
|
7442
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(rowClass, "text-xs text-muted-foreground", classNames?.balance), children: [
|
|
7443
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Balance at appointment" }),
|
|
7444
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: balance, currency })
|
|
7445
|
+
] })
|
|
7446
|
+
] })
|
|
7447
|
+
] })
|
|
7448
|
+
]
|
|
7449
|
+
}
|
|
7450
|
+
);
|
|
7451
|
+
}
|
|
7284
7452
|
var FREQUENCY_LABELS = {
|
|
7285
7453
|
weekly: "Weekly",
|
|
7286
7454
|
biweekly: "Biweekly",
|
|
@@ -8645,7 +8813,7 @@ function groupSlots(slots) {
|
|
|
8645
8813
|
}
|
|
8646
8814
|
return ["morning", "afternoon", "evening"].filter((tod) => groups[tod]?.length).map((tod) => ({ label: TIME_OF_DAY_LABELS[tod], slots: groups[tod] }));
|
|
8647
8815
|
}
|
|
8648
|
-
function
|
|
8816
|
+
function formatTime2(timeStr) {
|
|
8649
8817
|
try {
|
|
8650
8818
|
const date = new Date(timeStr);
|
|
8651
8819
|
if (!isNaN(date.getTime())) {
|
|
@@ -8708,6 +8876,7 @@ function SlotPicker({
|
|
|
8708
8876
|
onSlotSelect,
|
|
8709
8877
|
groupByTimeOfDay = true,
|
|
8710
8878
|
showPrice = true,
|
|
8879
|
+
lowCapacityThreshold = 3,
|
|
8711
8880
|
currency,
|
|
8712
8881
|
schedulingMode = "intraday",
|
|
8713
8882
|
durationUnit,
|
|
@@ -8801,21 +8970,25 @@ function SlotPicker({
|
|
|
8801
8970
|
children: group.slots.map((slot) => {
|
|
8802
8971
|
const value = slotToValue(slot);
|
|
8803
8972
|
const isSelected = selectedSlot?.start_time === slot.start_time && selectedSlot?.end_time === slot.end_time;
|
|
8973
|
+
const capacity = slot.capacity_available ?? slot.remaining_capacity;
|
|
8974
|
+
const soldOut = capacity === 0;
|
|
8975
|
+
const unavailable = slot.is_available === false || soldOut;
|
|
8976
|
+
const lowCapacity = lowCapacityThreshold > 0 && capacity != null && capacity > 0 && capacity <= lowCapacityThreshold;
|
|
8804
8977
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8805
8978
|
radio.Radio.Root,
|
|
8806
8979
|
{
|
|
8807
8980
|
value,
|
|
8808
|
-
disabled:
|
|
8981
|
+
disabled: unavailable,
|
|
8809
8982
|
"data-cimplify-slot": true,
|
|
8810
8983
|
"data-selected": isSelected || void 0,
|
|
8811
|
-
"data-unavailable":
|
|
8984
|
+
"data-unavailable": unavailable || void 0,
|
|
8812
8985
|
className: cn(
|
|
8813
8986
|
"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",
|
|
8814
8987
|
isMultiDay && "justify-between text-left",
|
|
8815
8988
|
classNames?.slot
|
|
8816
8989
|
),
|
|
8817
8990
|
children: [
|
|
8818
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-slot-time": true, className: classNames?.slotTime, children: isMultiDay ? formatStaySummary(slot, durationUnit, durationValue) :
|
|
8991
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-slot-time": true, className: classNames?.slotTime, children: isMultiDay ? formatStaySummary(slot, durationUnit, durationValue) : formatTime2(slot.start_time) }),
|
|
8819
8992
|
showPrice && slot.price && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8820
8993
|
"span",
|
|
8821
8994
|
{
|
|
@@ -8823,6 +8996,17 @@ function SlotPicker({
|
|
|
8823
8996
|
className: cn("text-xs opacity-70", classNames?.slotPrice),
|
|
8824
8997
|
children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: slot.price, currency })
|
|
8825
8998
|
}
|
|
8999
|
+
),
|
|
9000
|
+
lowCapacity && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9001
|
+
"span",
|
|
9002
|
+
{
|
|
9003
|
+
"data-cimplify-slot-scarcity": true,
|
|
9004
|
+
className: cn("text-xs font-medium text-amber-600", classNames?.slotScarcity),
|
|
9005
|
+
children: [
|
|
9006
|
+
capacity,
|
|
9007
|
+
" left"
|
|
9008
|
+
]
|
|
9009
|
+
}
|
|
8826
9010
|
)
|
|
8827
9011
|
]
|
|
8828
9012
|
},
|
|
@@ -8838,7 +9022,7 @@ function SlotPicker({
|
|
|
8838
9022
|
}
|
|
8839
9023
|
);
|
|
8840
9024
|
}
|
|
8841
|
-
function
|
|
9025
|
+
function formatDate2(dateStr) {
|
|
8842
9026
|
const date = /* @__PURE__ */ new Date(dateStr + "T00:00:00");
|
|
8843
9027
|
return date.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" });
|
|
8844
9028
|
}
|
|
@@ -8983,7 +9167,7 @@ function DateSlotPicker({
|
|
|
8983
9167
|
"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",
|
|
8984
9168
|
classNames?.dateButton
|
|
8985
9169
|
),
|
|
8986
|
-
children:
|
|
9170
|
+
children: formatDate2(date)
|
|
8987
9171
|
},
|
|
8988
9172
|
date
|
|
8989
9173
|
);
|
|
@@ -9043,6 +9227,7 @@ function ProductCustomizer({
|
|
|
9043
9227
|
const [customerInputValues, setCustomerInputValues] = React14.useState({});
|
|
9044
9228
|
const [specialInstructions, setSpecialInstructions] = React14.useState("");
|
|
9045
9229
|
const [selectedSlot, setSelectedSlot] = React14.useState(null);
|
|
9230
|
+
const [selectedStaffId, setSelectedStaffId] = React14.useState(null);
|
|
9046
9231
|
const cart = useCart();
|
|
9047
9232
|
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
9048
9233
|
const productType = product.type || "product";
|
|
@@ -9070,7 +9255,16 @@ function ProductCustomizer({
|
|
|
9070
9255
|
setCustomerInputValues({});
|
|
9071
9256
|
setSpecialInstructions("");
|
|
9072
9257
|
setSelectedSlot(null);
|
|
9258
|
+
setSelectedStaffId(null);
|
|
9073
9259
|
}, [product.id, product.min_order_quantity]);
|
|
9260
|
+
const slotStaff = React14.useMemo(
|
|
9261
|
+
() => (selectedSlot?.available_staff ?? []).map((member) => ({
|
|
9262
|
+
id: member.staff_id,
|
|
9263
|
+
name: member.name
|
|
9264
|
+
})),
|
|
9265
|
+
[selectedSlot]
|
|
9266
|
+
);
|
|
9267
|
+
const selectedStaffName = selectedStaffId ? slotStaff.find((member) => member.id === selectedStaffId)?.name ?? null : null;
|
|
9074
9268
|
const selectedAddOnOptions = React14.useMemo(() => {
|
|
9075
9269
|
if (!product.add_ons) return [];
|
|
9076
9270
|
const options = [];
|
|
@@ -9182,7 +9376,7 @@ function ProductCustomizer({
|
|
|
9182
9376
|
...isService && selectedSlot ? {
|
|
9183
9377
|
scheduledStart: selectedSlot.start_time,
|
|
9184
9378
|
scheduledEnd: selectedSlot.end_time,
|
|
9185
|
-
staffId: selectedSlot.available_staff?.[0]?.staff_id,
|
|
9379
|
+
staffId: selectedStaffId ?? selectedSlot.available_staff?.[0]?.staff_id,
|
|
9186
9380
|
resourceId: selectedSlot.available_resources?.[0]?.resource_id
|
|
9187
9381
|
} : {},
|
|
9188
9382
|
customerInputs: Object.keys(customerInputValues).length > 0 ? Object.entries(customerInputValues).filter(([, v]) => v !== void 0 && v !== "").map(([fieldId, value]) => ({ field_id: fieldId, value })) : void 0,
|
|
@@ -9204,7 +9398,7 @@ function ProductCustomizer({
|
|
|
9204
9398
|
} finally {
|
|
9205
9399
|
setIsSubmitting(false);
|
|
9206
9400
|
}
|
|
9207
|
-
}, [product, quantity, selectedVariantId, selectedVariant, quoteId, normalizedAddOnOptionIds, selectedAddOnOptions, isComposite, compositeSelections, isBundle, bundleSelections, selectedBillingPlan, customerInputValues, specialInstructions, isService, selectedSlot, isSubmitting, onAddToCart, cart]);
|
|
9401
|
+
}, [product, quantity, selectedVariantId, selectedVariant, quoteId, normalizedAddOnOptionIds, selectedAddOnOptions, isComposite, compositeSelections, isBundle, bundleSelections, selectedBillingPlan, customerInputValues, specialInstructions, isService, selectedSlot, selectedStaffId, isSubmitting, onAddToCart, cart]);
|
|
9208
9402
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customizer": true, className: cn("space-y-6", className, classNames?.root), children: [
|
|
9209
9403
|
isComposite && product.groups && product.composite_id && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9210
9404
|
CompositeSelector,
|
|
@@ -9236,11 +9430,30 @@ function ProductCustomizer({
|
|
|
9236
9430
|
{
|
|
9237
9431
|
serviceId: product.id,
|
|
9238
9432
|
selectedSlot,
|
|
9239
|
-
onSlotSelect: (slot) =>
|
|
9433
|
+
onSlotSelect: (slot) => {
|
|
9434
|
+
setSelectedSlot(slot);
|
|
9435
|
+
setSelectedStaffId(null);
|
|
9436
|
+
},
|
|
9240
9437
|
participantCount: quantity,
|
|
9241
9438
|
currency
|
|
9242
9439
|
}
|
|
9243
9440
|
),
|
|
9441
|
+
isService && slotStaff.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customizer-staff": true, children: [
|
|
9442
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-xs font-medium uppercase tracking-wider text-muted-foreground mb-3", children: "Choose your specialist" }),
|
|
9443
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9444
|
+
StaffPicker,
|
|
9445
|
+
{
|
|
9446
|
+
staff: slotStaff,
|
|
9447
|
+
selectedStaffId,
|
|
9448
|
+
onStaffSelect: setSelectedStaffId,
|
|
9449
|
+
className: "flex flex-wrap gap-2",
|
|
9450
|
+
classNames: {
|
|
9451
|
+
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",
|
|
9452
|
+
avatar: "w-6 h-6 rounded-full object-cover"
|
|
9453
|
+
}
|
|
9454
|
+
}
|
|
9455
|
+
)
|
|
9456
|
+
] }),
|
|
9244
9457
|
hasVariants && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9245
9458
|
VariantSelector,
|
|
9246
9459
|
{
|
|
@@ -9325,6 +9538,18 @@ function ProductCustomizer({
|
|
|
9325
9538
|
)
|
|
9326
9539
|
}
|
|
9327
9540
|
) }),
|
|
9541
|
+
isService && selectedSlot && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9542
|
+
BookingSummary,
|
|
9543
|
+
{
|
|
9544
|
+
slot: selectedSlot,
|
|
9545
|
+
total: displayTotalPrice,
|
|
9546
|
+
staffName: selectedStaffName,
|
|
9547
|
+
durationMinutes: product.duration_minutes,
|
|
9548
|
+
depositType: product.deposit_type,
|
|
9549
|
+
depositAmount: product.deposit_amount,
|
|
9550
|
+
currency
|
|
9551
|
+
}
|
|
9552
|
+
),
|
|
9328
9553
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9329
9554
|
"div",
|
|
9330
9555
|
{
|
|
@@ -9402,9 +9627,15 @@ function ProductImageGallery({
|
|
|
9402
9627
|
[images]
|
|
9403
9628
|
);
|
|
9404
9629
|
const [selectedImage, setSelectedImage] = React14.useState(0);
|
|
9630
|
+
const [fadeIn, setFadeIn] = React14.useState(true);
|
|
9405
9631
|
React14.useEffect(() => {
|
|
9406
9632
|
setSelectedImage(0);
|
|
9407
9633
|
}, [normalizedImages.length, productName]);
|
|
9634
|
+
React14.useEffect(() => {
|
|
9635
|
+
setFadeIn(false);
|
|
9636
|
+
const id = requestAnimationFrame(() => setFadeIn(true));
|
|
9637
|
+
return () => cancelAnimationFrame(id);
|
|
9638
|
+
}, [selectedImage]);
|
|
9408
9639
|
if (normalizedImages.length === 0) {
|
|
9409
9640
|
return null;
|
|
9410
9641
|
}
|
|
@@ -9420,7 +9651,13 @@ function ProductImageGallery({
|
|
|
9420
9651
|
{
|
|
9421
9652
|
src: activeImage,
|
|
9422
9653
|
alt: productName,
|
|
9423
|
-
style: {
|
|
9654
|
+
style: {
|
|
9655
|
+
width: "100%",
|
|
9656
|
+
height: "100%",
|
|
9657
|
+
objectFit: "cover",
|
|
9658
|
+
opacity: fadeIn ? 1 : 0,
|
|
9659
|
+
transition: "opacity 300ms ease"
|
|
9660
|
+
},
|
|
9424
9661
|
"data-cimplify-image-gallery-active": true
|
|
9425
9662
|
}
|
|
9426
9663
|
)
|
|
@@ -12428,65 +12665,6 @@ function StoreNav({
|
|
|
12428
12665
|
] })
|
|
12429
12666
|
] });
|
|
12430
12667
|
}
|
|
12431
|
-
var ANY_VALUE = "__any__";
|
|
12432
|
-
function StaffPicker({
|
|
12433
|
-
staff,
|
|
12434
|
-
selectedStaffId,
|
|
12435
|
-
onStaffSelect,
|
|
12436
|
-
showAnyOption = true,
|
|
12437
|
-
anyLabel = "Any available",
|
|
12438
|
-
className,
|
|
12439
|
-
classNames
|
|
12440
|
-
}) {
|
|
12441
|
-
const groupValue = selectedStaffId === null ? ANY_VALUE : selectedStaffId ?? "";
|
|
12442
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12443
|
-
radioGroup.RadioGroup,
|
|
12444
|
-
{
|
|
12445
|
-
"data-cimplify-staff-picker": true,
|
|
12446
|
-
className: cn(className, classNames?.root),
|
|
12447
|
-
value: groupValue,
|
|
12448
|
-
onValueChange: (value) => {
|
|
12449
|
-
onStaffSelect?.(value === ANY_VALUE ? null : value);
|
|
12450
|
-
},
|
|
12451
|
-
children: [
|
|
12452
|
-
showAnyOption && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12453
|
-
radio.Radio.Root,
|
|
12454
|
-
{
|
|
12455
|
-
value: ANY_VALUE,
|
|
12456
|
-
"data-cimplify-staff-option": true,
|
|
12457
|
-
"data-selected": selectedStaffId === null || void 0,
|
|
12458
|
-
"data-any": true,
|
|
12459
|
-
className: classNames?.option,
|
|
12460
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: anyLabel })
|
|
12461
|
-
}
|
|
12462
|
-
),
|
|
12463
|
-
staff.map((member) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12464
|
-
radio.Radio.Root,
|
|
12465
|
-
{
|
|
12466
|
-
value: member.id,
|
|
12467
|
-
"data-cimplify-staff-option": true,
|
|
12468
|
-
"data-selected": selectedStaffId === member.id || void 0,
|
|
12469
|
-
className: classNames?.option,
|
|
12470
|
-
children: [
|
|
12471
|
-
member.avatar_url && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12472
|
-
"img",
|
|
12473
|
-
{
|
|
12474
|
-
src: member.avatar_url,
|
|
12475
|
-
alt: member.name,
|
|
12476
|
-
"data-cimplify-staff-avatar": true,
|
|
12477
|
-
className: classNames?.avatar
|
|
12478
|
-
}
|
|
12479
|
-
),
|
|
12480
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: member.name }),
|
|
12481
|
-
member.bio && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-bio": true, className: classNames?.bio, children: member.bio })
|
|
12482
|
-
]
|
|
12483
|
-
},
|
|
12484
|
-
member.id
|
|
12485
|
-
))
|
|
12486
|
-
]
|
|
12487
|
-
}
|
|
12488
|
-
);
|
|
12489
|
-
}
|
|
12490
12668
|
var STATUS_LABELS3 = {
|
|
12491
12669
|
pending: "Pending",
|
|
12492
12670
|
confirmed: "Confirmed",
|
|
@@ -16610,6 +16788,7 @@ exports.BillingPlanSelector = BillingPlanSelector;
|
|
|
16610
16788
|
exports.BookingCard = BookingCard;
|
|
16611
16789
|
exports.BookingList = BookingList;
|
|
16612
16790
|
exports.BookingPage = BookingPage;
|
|
16791
|
+
exports.BookingSummary = BookingSummary;
|
|
16613
16792
|
exports.BookingsPage = BookingsPage;
|
|
16614
16793
|
exports.BoxIcon24 = BoxIcon24;
|
|
16615
16794
|
exports.BundleProductCard = BundleProductCard;
|