@cimplify/sdk 0.11.0 → 0.12.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 +8 -2
- package/dist/react.d.ts +8 -2
- package/dist/react.js +417 -291
- package/dist/react.mjs +417 -291
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/registry/bookings-page.json +1 -1
- package/registry/category-filter.json +1 -1
- package/registry/date-slot-picker.json +1 -1
- package/registry/discount-input.json +1 -1
- package/registry/order-history-page.json +1 -1
- package/registry/product-image-gallery.json +1 -1
- package/registry/search-input.json +1 -1
- package/registry/search-page.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/staff-picker.json +1 -1
package/dist/react.js
CHANGED
|
@@ -9,6 +9,9 @@ var tailwindMerge = require('tailwind-merge');
|
|
|
9
9
|
var radioGroup = require('@base-ui/react/radio-group');
|
|
10
10
|
var radio = require('@base-ui/react/radio');
|
|
11
11
|
var checkbox = require('@base-ui/react/checkbox');
|
|
12
|
+
var field = require('@base-ui/react/field');
|
|
13
|
+
var input = require('@base-ui/react/input');
|
|
14
|
+
var tabs = require('@base-ui/react/tabs');
|
|
12
15
|
|
|
13
16
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
17
|
|
|
@@ -9172,33 +9175,45 @@ function ProductImageGallery({
|
|
|
9172
9175
|
)
|
|
9173
9176
|
}
|
|
9174
9177
|
),
|
|
9175
|
-
normalizedImages.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9176
|
-
|
|
9178
|
+
normalizedImages.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9179
|
+
radioGroup.RadioGroup,
|
|
9177
9180
|
{
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
"data-cimplify-image-gallery-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9181
|
+
"aria-label": `${productName} image thumbnails`,
|
|
9182
|
+
value: String(selectedImage),
|
|
9183
|
+
onValueChange: (value) => setSelectedImage(Number(value)),
|
|
9184
|
+
"data-cimplify-image-gallery-thumbnails": true,
|
|
9185
|
+
style: { display: "flex", gap: "0.5rem", marginTop: "0.75rem" },
|
|
9186
|
+
children: normalizedImages.map((image, index) => {
|
|
9187
|
+
const isSelected = selectedImage === index;
|
|
9188
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9189
|
+
radio.Radio.Root,
|
|
9190
|
+
{
|
|
9191
|
+
value: String(index),
|
|
9192
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
9193
|
+
"data-cimplify-image-gallery-thumb": true,
|
|
9194
|
+
"data-selected": isSelected || void 0,
|
|
9195
|
+
style: {
|
|
9196
|
+
width: "4rem",
|
|
9197
|
+
height: "4rem",
|
|
9198
|
+
overflow: "hidden",
|
|
9199
|
+
padding: 0,
|
|
9200
|
+
border: "none",
|
|
9201
|
+
cursor: "pointer"
|
|
9202
|
+
},
|
|
9203
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9204
|
+
"img",
|
|
9205
|
+
{
|
|
9206
|
+
src: image,
|
|
9207
|
+
alt: "",
|
|
9208
|
+
style: { width: "100%", height: "100%", objectFit: "cover" }
|
|
9209
|
+
}
|
|
9210
|
+
)
|
|
9211
|
+
},
|
|
9212
|
+
`${image}-${index}`
|
|
9213
|
+
);
|
|
9214
|
+
})
|
|
9215
|
+
}
|
|
9216
|
+
)
|
|
9202
9217
|
] });
|
|
9203
9218
|
}
|
|
9204
9219
|
function CartLineItemRow({
|
|
@@ -9809,6 +9824,26 @@ function ProductGrid({
|
|
|
9809
9824
|
)
|
|
9810
9825
|
] });
|
|
9811
9826
|
}
|
|
9827
|
+
var SearchIcon = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9828
|
+
"svg",
|
|
9829
|
+
{
|
|
9830
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9831
|
+
width: "16",
|
|
9832
|
+
height: "16",
|
|
9833
|
+
viewBox: "0 0 24 24",
|
|
9834
|
+
fill: "none",
|
|
9835
|
+
stroke: "currentColor",
|
|
9836
|
+
strokeWidth: "2",
|
|
9837
|
+
strokeLinecap: "round",
|
|
9838
|
+
strokeLinejoin: "round",
|
|
9839
|
+
"aria-hidden": "true",
|
|
9840
|
+
"data-cimplify-search-icon": true,
|
|
9841
|
+
children: [
|
|
9842
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
9843
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
9844
|
+
]
|
|
9845
|
+
}
|
|
9846
|
+
);
|
|
9812
9847
|
function SearchInput({
|
|
9813
9848
|
placeholder = "Search products...",
|
|
9814
9849
|
searchOptions,
|
|
@@ -9819,42 +9854,58 @@ function SearchInput({
|
|
|
9819
9854
|
classNames
|
|
9820
9855
|
}) {
|
|
9821
9856
|
const { results, isLoading, query, setQuery, clear } = useSearch(searchOptions);
|
|
9822
|
-
const
|
|
9823
|
-
(
|
|
9824
|
-
setQuery(
|
|
9857
|
+
const handleValueChange = React3.useCallback(
|
|
9858
|
+
(value) => {
|
|
9859
|
+
setQuery(value);
|
|
9825
9860
|
},
|
|
9826
9861
|
[setQuery]
|
|
9827
9862
|
);
|
|
9828
9863
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9829
|
-
|
|
9864
|
+
field.Field.Root,
|
|
9830
9865
|
{
|
|
9831
9866
|
"data-cimplify-search": true,
|
|
9832
9867
|
className: cn(className, classNames?.root),
|
|
9833
9868
|
style: { position: "relative" },
|
|
9834
9869
|
children: [
|
|
9835
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9870
|
+
/* @__PURE__ */ jsxRuntime.jsx(field.Field.Label, { className: "sr-only", children: "Search products" }),
|
|
9871
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
|
|
9872
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9873
|
+
"span",
|
|
9874
|
+
{
|
|
9875
|
+
"data-cimplify-search-icon-wrapper": true,
|
|
9876
|
+
style: {
|
|
9877
|
+
position: "absolute",
|
|
9878
|
+
left: "0.5rem",
|
|
9879
|
+
pointerEvents: "none",
|
|
9880
|
+
display: "flex",
|
|
9881
|
+
alignItems: "center"
|
|
9882
|
+
},
|
|
9883
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, {})
|
|
9884
|
+
}
|
|
9885
|
+
),
|
|
9886
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9887
|
+
input.Input,
|
|
9888
|
+
{
|
|
9889
|
+
type: "search",
|
|
9890
|
+
value: query,
|
|
9891
|
+
onValueChange: handleValueChange,
|
|
9892
|
+
placeholder,
|
|
9893
|
+
"data-cimplify-search-input": true,
|
|
9894
|
+
className: classNames?.input
|
|
9895
|
+
}
|
|
9896
|
+
),
|
|
9897
|
+
query.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9898
|
+
"button",
|
|
9899
|
+
{
|
|
9900
|
+
type: "button",
|
|
9901
|
+
onClick: clear,
|
|
9902
|
+
"data-cimplify-search-clear": true,
|
|
9903
|
+
className: classNames?.clearButton,
|
|
9904
|
+
"aria-label": "Clear search",
|
|
9905
|
+
children: "\xD7"
|
|
9906
|
+
}
|
|
9907
|
+
)
|
|
9908
|
+
] }),
|
|
9858
9909
|
showResults && query.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-search-results": true, className: classNames?.results, children: [
|
|
9859
9910
|
isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-search-loading": true, className: classNames?.loading, "aria-busy": "true", children: "Searching..." }),
|
|
9860
9911
|
!isLoading && results.length === 0 && query.length >= 2 && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-search-empty": true, className: classNames?.empty, children: "No results found" }),
|
|
@@ -9874,6 +9925,7 @@ function SearchInput({
|
|
|
9874
9925
|
}
|
|
9875
9926
|
);
|
|
9876
9927
|
}
|
|
9928
|
+
var ALL_VALUE = "__all__";
|
|
9877
9929
|
function CategoryFilter({
|
|
9878
9930
|
selectedId = null,
|
|
9879
9931
|
onSelect,
|
|
@@ -9883,9 +9935,9 @@ function CategoryFilter({
|
|
|
9883
9935
|
classNames
|
|
9884
9936
|
}) {
|
|
9885
9937
|
const { categories, isLoading } = useCategories();
|
|
9886
|
-
const
|
|
9887
|
-
(
|
|
9888
|
-
onSelect(
|
|
9938
|
+
const handleValueChange = React3.useCallback(
|
|
9939
|
+
(value) => {
|
|
9940
|
+
onSelect(value === ALL_VALUE ? null : String(value));
|
|
9889
9941
|
},
|
|
9890
9942
|
[onSelect]
|
|
9891
9943
|
);
|
|
@@ -9899,45 +9951,45 @@ function CategoryFilter({
|
|
|
9899
9951
|
}
|
|
9900
9952
|
);
|
|
9901
9953
|
}
|
|
9902
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
9903
|
-
|
|
9954
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9955
|
+
tabs.Tabs.Root,
|
|
9904
9956
|
{
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
"
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9957
|
+
value: selectedId ?? ALL_VALUE,
|
|
9958
|
+
onValueChange: handleValueChange,
|
|
9959
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9960
|
+
tabs.Tabs.List,
|
|
9961
|
+
{
|
|
9962
|
+
"data-cimplify-category-filter": true,
|
|
9963
|
+
"aria-label": "Filter by category",
|
|
9964
|
+
className: cn(className, classNames?.root),
|
|
9965
|
+
children: [
|
|
9966
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9967
|
+
tabs.Tabs.Tab,
|
|
9968
|
+
{
|
|
9969
|
+
value: ALL_VALUE,
|
|
9970
|
+
"data-cimplify-category-filter-item": true,
|
|
9971
|
+
"data-selected": selectedId === null || void 0,
|
|
9972
|
+
className: cn(classNames?.item, classNames?.allButton),
|
|
9973
|
+
children: allLabel
|
|
9974
|
+
}
|
|
9975
|
+
),
|
|
9976
|
+
categories.map((category) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9977
|
+
tabs.Tabs.Tab,
|
|
9978
|
+
{
|
|
9979
|
+
value: category.id,
|
|
9980
|
+
"data-cimplify-category-filter-item": true,
|
|
9981
|
+
"data-selected": selectedId === category.id || void 0,
|
|
9982
|
+
className: classNames?.item,
|
|
9983
|
+
children: [
|
|
9984
|
+
category.name,
|
|
9985
|
+
showCounts && category.product_count != null && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-category-count": true, className: classNames?.count, children: category.product_count })
|
|
9986
|
+
]
|
|
9987
|
+
},
|
|
9988
|
+
category.id
|
|
9989
|
+
))
|
|
9990
|
+
]
|
|
9991
|
+
}
|
|
9992
|
+
)
|
|
9941
9993
|
}
|
|
9942
9994
|
);
|
|
9943
9995
|
}
|
|
@@ -9980,50 +10032,74 @@ function DiscountInput({
|
|
|
9980
10032
|
[handleApply]
|
|
9981
10033
|
);
|
|
9982
10034
|
const isApplied = appliedValidation?.is_eligible === true;
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10035
|
+
const hasError = !!error || !!appliedValidation && !appliedValidation.is_eligible;
|
|
10036
|
+
const errorMessage = error ? error.message : appliedValidation && !appliedValidation.is_eligible ? appliedValidation.ineligibility_reason ?? "This code is not valid." : void 0;
|
|
10037
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10038
|
+
field.Field.Root,
|
|
10039
|
+
{
|
|
10040
|
+
"data-cimplify-discount": true,
|
|
10041
|
+
invalid: hasError,
|
|
10042
|
+
disabled: isApplied,
|
|
10043
|
+
className: cn(className, classNames?.root),
|
|
10044
|
+
children: [
|
|
10045
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-discount-form": true, children: [
|
|
10046
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10047
|
+
input.Input,
|
|
10048
|
+
{
|
|
10049
|
+
type: "text",
|
|
10050
|
+
value: code,
|
|
10051
|
+
onValueChange: (value) => setCode(value),
|
|
10052
|
+
onKeyDown: handleKeyDown,
|
|
10053
|
+
placeholder,
|
|
10054
|
+
"data-cimplify-discount-input": true,
|
|
10055
|
+
className: classNames?.input,
|
|
10056
|
+
"aria-label": "Discount code"
|
|
10057
|
+
}
|
|
10058
|
+
),
|
|
10059
|
+
isApplied ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10060
|
+
"button",
|
|
10061
|
+
{
|
|
10062
|
+
type: "button",
|
|
10063
|
+
onClick: handleClear,
|
|
10064
|
+
"data-cimplify-discount-clear": true,
|
|
10065
|
+
className: classNames?.button,
|
|
10066
|
+
children: "Remove"
|
|
10067
|
+
}
|
|
10068
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
10069
|
+
"button",
|
|
10070
|
+
{
|
|
10071
|
+
type: "button",
|
|
10072
|
+
onClick: handleApply,
|
|
10073
|
+
disabled: isValidating || code.trim().length === 0,
|
|
10074
|
+
"data-cimplify-discount-apply": true,
|
|
10075
|
+
className: classNames?.button,
|
|
10076
|
+
children: isValidating ? "Checking..." : "Apply"
|
|
10077
|
+
}
|
|
10078
|
+
)
|
|
10079
|
+
] }),
|
|
10080
|
+
hasError && errorMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10081
|
+
field.Field.Error,
|
|
10082
|
+
{
|
|
10083
|
+
match: true,
|
|
10084
|
+
"data-cimplify-discount-error": true,
|
|
10085
|
+
className: classNames?.error,
|
|
10086
|
+
children: errorMessage
|
|
10087
|
+
}
|
|
10088
|
+
),
|
|
10089
|
+
isApplied && appliedValidation.discount_amount && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10090
|
+
field.Field.Description,
|
|
10091
|
+
{
|
|
10092
|
+
"data-cimplify-discount-success": true,
|
|
10093
|
+
className: classNames?.success,
|
|
10094
|
+
children: [
|
|
10095
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount applied" }),
|
|
10096
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: appliedValidation.discount_amount, prefix: "-" })
|
|
10097
|
+
]
|
|
10098
|
+
}
|
|
10099
|
+
)
|
|
10100
|
+
]
|
|
10101
|
+
}
|
|
10102
|
+
);
|
|
10027
10103
|
}
|
|
10028
10104
|
function CategoryGrid({
|
|
10029
10105
|
categories: categoriesProp,
|
|
@@ -10470,6 +10546,9 @@ function formatTime(timeStr) {
|
|
|
10470
10546
|
}
|
|
10471
10547
|
return timeStr;
|
|
10472
10548
|
}
|
|
10549
|
+
function slotToValue(slot) {
|
|
10550
|
+
return `${slot.start_time}|${slot.end_time}`;
|
|
10551
|
+
}
|
|
10473
10552
|
function SlotPicker({
|
|
10474
10553
|
slots: slotsProp,
|
|
10475
10554
|
serviceId,
|
|
@@ -10514,29 +10593,49 @@ function SlotPicker({
|
|
|
10514
10593
|
);
|
|
10515
10594
|
}
|
|
10516
10595
|
const groups = groupByTimeOfDay ? groupSlots(slots) : [{ label: "", slots }];
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
},
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10596
|
+
const slotsByValue = /* @__PURE__ */ new Map();
|
|
10597
|
+
for (const slot of slots) {
|
|
10598
|
+
slotsByValue.set(slotToValue(slot), slot);
|
|
10599
|
+
}
|
|
10600
|
+
const selectedValue = selectedSlot ? slotToValue(selectedSlot) : "";
|
|
10601
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10602
|
+
radioGroup.RadioGroup,
|
|
10603
|
+
{
|
|
10604
|
+
"data-cimplify-slot-picker": true,
|
|
10605
|
+
className: cn(className, classNames?.root),
|
|
10606
|
+
value: selectedValue,
|
|
10607
|
+
onValueChange: (value) => {
|
|
10608
|
+
const slot = slotsByValue.get(value);
|
|
10609
|
+
if (slot?.is_available) {
|
|
10610
|
+
onSlotSelect?.(slot);
|
|
10611
|
+
}
|
|
10612
|
+
},
|
|
10613
|
+
children: groups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-slot-group": true, className: classNames?.group, children: [
|
|
10614
|
+
group.label && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-slot-group-label": true, className: classNames?.groupLabel, children: group.label }),
|
|
10615
|
+
group.slots.map((slot) => {
|
|
10616
|
+
const value = slotToValue(slot);
|
|
10617
|
+
const isSelected = selectedSlot?.start_time === slot.start_time && selectedSlot?.end_time === slot.end_time;
|
|
10618
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10619
|
+
radio.Radio.Root,
|
|
10620
|
+
{
|
|
10621
|
+
value,
|
|
10622
|
+
disabled: !slot.is_available,
|
|
10623
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
10624
|
+
"data-cimplify-slot": true,
|
|
10625
|
+
"data-selected": isSelected || void 0,
|
|
10626
|
+
"data-unavailable": !slot.is_available || void 0,
|
|
10627
|
+
className: classNames?.slot,
|
|
10628
|
+
children: [
|
|
10629
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-slot-time": true, className: classNames?.slotTime, children: formatTime(slot.start_time) }),
|
|
10630
|
+
showPrice && slot.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-slot-price": true, className: classNames?.slotPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: slot.price }) })
|
|
10631
|
+
]
|
|
10632
|
+
},
|
|
10633
|
+
value
|
|
10634
|
+
);
|
|
10635
|
+
})
|
|
10636
|
+
] }, group.label || "all"))
|
|
10637
|
+
}
|
|
10638
|
+
);
|
|
10540
10639
|
}
|
|
10541
10640
|
function formatDate(dateStr) {
|
|
10542
10641
|
const date = /* @__PURE__ */ new Date(dateStr + "T00:00:00");
|
|
@@ -10599,8 +10698,10 @@ function DateSlotPicker({
|
|
|
10599
10698
|
const handleNext = React3.useCallback(() => {
|
|
10600
10699
|
setOffset((prev) => prev + daysToShow);
|
|
10601
10700
|
}, [daysToShow]);
|
|
10602
|
-
const
|
|
10603
|
-
|
|
10701
|
+
const handleDateChange = React3.useCallback((value) => {
|
|
10702
|
+
if (typeof value === "string") {
|
|
10703
|
+
setSelectedDate(value);
|
|
10704
|
+
}
|
|
10604
10705
|
}, []);
|
|
10605
10706
|
const handleSlotSelect = React3.useCallback(
|
|
10606
10707
|
(slot) => {
|
|
@@ -10608,72 +10709,79 @@ function DateSlotPicker({
|
|
|
10608
10709
|
},
|
|
10609
10710
|
[onSlotSelect, selectedDate]
|
|
10610
10711
|
);
|
|
10611
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
10668
|
-
date:
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10712
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10713
|
+
tabs.Tabs.Root,
|
|
10714
|
+
{
|
|
10715
|
+
value: selectedDate,
|
|
10716
|
+
onValueChange: handleDateChange,
|
|
10717
|
+
"data-cimplify-date-slot-picker": true,
|
|
10718
|
+
className: cn(className, classNames?.root),
|
|
10719
|
+
children: [
|
|
10720
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-date-nav": true, className: classNames?.nav, children: [
|
|
10721
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10722
|
+
"button",
|
|
10723
|
+
{
|
|
10724
|
+
type: "button",
|
|
10725
|
+
onClick: handlePrev,
|
|
10726
|
+
disabled: offset === 0,
|
|
10727
|
+
"data-cimplify-date-nav-prev": true,
|
|
10728
|
+
className: classNames?.navButton,
|
|
10729
|
+
children: "\u2190"
|
|
10730
|
+
}
|
|
10731
|
+
),
|
|
10732
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10733
|
+
"button",
|
|
10734
|
+
{
|
|
10735
|
+
type: "button",
|
|
10736
|
+
onClick: handleNext,
|
|
10737
|
+
"data-cimplify-date-nav-next": true,
|
|
10738
|
+
className: classNames?.navButton,
|
|
10739
|
+
children: "\u2192"
|
|
10740
|
+
}
|
|
10741
|
+
)
|
|
10742
|
+
] }),
|
|
10743
|
+
/* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs.List, { "data-cimplify-date-strip": true, className: classNames?.dateStrip, children: dateRange.dates.map((date) => {
|
|
10744
|
+
const dayInfo = availabilityMap.get(date);
|
|
10745
|
+
const hasAvailability = dayInfo?.has_availability !== false;
|
|
10746
|
+
const isSelected = selectedDate === date;
|
|
10747
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10748
|
+
tabs.Tabs.Tab,
|
|
10749
|
+
{
|
|
10750
|
+
value: date,
|
|
10751
|
+
"data-cimplify-date-button": true,
|
|
10752
|
+
"data-selected": isSelected || void 0,
|
|
10753
|
+
"data-available": hasAvailability || void 0,
|
|
10754
|
+
"data-fully-booked": !hasAvailability || void 0,
|
|
10755
|
+
className: classNames?.dateButton,
|
|
10756
|
+
children: formatDate(date)
|
|
10757
|
+
},
|
|
10758
|
+
date
|
|
10759
|
+
);
|
|
10760
|
+
}) }),
|
|
10761
|
+
availabilityLoading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10762
|
+
"div",
|
|
10763
|
+
{
|
|
10764
|
+
"data-cimplify-date-slot-loading": true,
|
|
10765
|
+
"aria-busy": "true",
|
|
10766
|
+
className: classNames?.loading
|
|
10767
|
+
}
|
|
10768
|
+
),
|
|
10769
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-date-slots": true, className: classNames?.slots, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10770
|
+
SlotPicker,
|
|
10771
|
+
{
|
|
10772
|
+
serviceId,
|
|
10773
|
+
date: selectedDate,
|
|
10774
|
+
participantCount,
|
|
10775
|
+
selectedSlot,
|
|
10776
|
+
onSlotSelect: handleSlotSelect,
|
|
10777
|
+
showPrice
|
|
10778
|
+
}
|
|
10779
|
+
) })
|
|
10780
|
+
]
|
|
10781
|
+
}
|
|
10782
|
+
);
|
|
10676
10783
|
}
|
|
10784
|
+
var ANY_VALUE = "__any__";
|
|
10677
10785
|
function StaffPicker({
|
|
10678
10786
|
staff,
|
|
10679
10787
|
selectedStaffId,
|
|
@@ -10683,44 +10791,56 @@ function StaffPicker({
|
|
|
10683
10791
|
className,
|
|
10684
10792
|
classNames
|
|
10685
10793
|
}) {
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
className: classNames?.option,
|
|
10696
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: anyLabel })
|
|
10697
|
-
}
|
|
10698
|
-
),
|
|
10699
|
-
staff.map((member) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10700
|
-
"button",
|
|
10701
|
-
{
|
|
10702
|
-
type: "button",
|
|
10703
|
-
onClick: () => onStaffSelect?.(member.id),
|
|
10704
|
-
"data-cimplify-staff-option": true,
|
|
10705
|
-
"data-selected": selectedStaffId === member.id || void 0,
|
|
10706
|
-
className: classNames?.option,
|
|
10707
|
-
children: [
|
|
10708
|
-
member.avatar_url && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10709
|
-
"img",
|
|
10710
|
-
{
|
|
10711
|
-
src: member.avatar_url,
|
|
10712
|
-
alt: member.name,
|
|
10713
|
-
"data-cimplify-staff-avatar": true,
|
|
10714
|
-
className: classNames?.avatar
|
|
10715
|
-
}
|
|
10716
|
-
),
|
|
10717
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: member.name }),
|
|
10718
|
-
member.bio && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-bio": true, className: classNames?.bio, children: member.bio })
|
|
10719
|
-
]
|
|
10794
|
+
const groupValue = selectedStaffId === null ? ANY_VALUE : selectedStaffId ?? "";
|
|
10795
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10796
|
+
radioGroup.RadioGroup,
|
|
10797
|
+
{
|
|
10798
|
+
"data-cimplify-staff-picker": true,
|
|
10799
|
+
className: cn(className, classNames?.root),
|
|
10800
|
+
value: groupValue,
|
|
10801
|
+
onValueChange: (value) => {
|
|
10802
|
+
onStaffSelect?.(value === ANY_VALUE ? null : value);
|
|
10720
10803
|
},
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10804
|
+
children: [
|
|
10805
|
+
showAnyOption && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10806
|
+
radio.Radio.Root,
|
|
10807
|
+
{
|
|
10808
|
+
value: ANY_VALUE,
|
|
10809
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
10810
|
+
"data-cimplify-staff-option": true,
|
|
10811
|
+
"data-selected": selectedStaffId === null || void 0,
|
|
10812
|
+
"data-any": true,
|
|
10813
|
+
className: classNames?.option,
|
|
10814
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: anyLabel })
|
|
10815
|
+
}
|
|
10816
|
+
),
|
|
10817
|
+
staff.map((member) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10818
|
+
radio.Radio.Root,
|
|
10819
|
+
{
|
|
10820
|
+
value: member.id,
|
|
10821
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
10822
|
+
"data-cimplify-staff-option": true,
|
|
10823
|
+
"data-selected": selectedStaffId === member.id || void 0,
|
|
10824
|
+
className: classNames?.option,
|
|
10825
|
+
children: [
|
|
10826
|
+
member.avatar_url && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10827
|
+
"img",
|
|
10828
|
+
{
|
|
10829
|
+
src: member.avatar_url,
|
|
10830
|
+
alt: member.name,
|
|
10831
|
+
"data-cimplify-staff-avatar": true,
|
|
10832
|
+
className: classNames?.avatar
|
|
10833
|
+
}
|
|
10834
|
+
),
|
|
10835
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: member.name }),
|
|
10836
|
+
member.bio && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-bio": true, className: classNames?.bio, children: member.bio })
|
|
10837
|
+
]
|
|
10838
|
+
},
|
|
10839
|
+
member.id
|
|
10840
|
+
))
|
|
10841
|
+
]
|
|
10842
|
+
}
|
|
10843
|
+
);
|
|
10724
10844
|
}
|
|
10725
10845
|
var STATUS_LABELS3 = {
|
|
10726
10846
|
pending: "Pending",
|
|
@@ -11392,10 +11512,10 @@ function OrderDetailPage({
|
|
|
11392
11512
|
] });
|
|
11393
11513
|
}
|
|
11394
11514
|
var STATUS_FILTERS = [
|
|
11395
|
-
{ label: "All", value: void 0 },
|
|
11396
|
-
{ label: "Active", value: "confirmed" },
|
|
11397
|
-
{ label: "Completed", value: "completed" },
|
|
11398
|
-
{ label: "Cancelled", value: "cancelled" }
|
|
11515
|
+
{ label: "All", value: void 0, tabValue: "all" },
|
|
11516
|
+
{ label: "Active", value: "confirmed", tabValue: "confirmed" },
|
|
11517
|
+
{ label: "Completed", value: "completed", tabValue: "completed" },
|
|
11518
|
+
{ label: "Cancelled", value: "cancelled", tabValue: "cancelled" }
|
|
11399
11519
|
];
|
|
11400
11520
|
function OrderHistoryPage({
|
|
11401
11521
|
title = "Order History",
|
|
@@ -11409,6 +11529,10 @@ function OrderHistoryPage({
|
|
|
11409
11529
|
}) {
|
|
11410
11530
|
const [statusFilter, setStatusFilter] = React3.useState(void 0);
|
|
11411
11531
|
const [selectedOrder, setSelectedOrder] = React3.useState(null);
|
|
11532
|
+
const handleTabChange = React3.useCallback((value) => {
|
|
11533
|
+
const filter = STATUS_FILTERS.find((f) => f.tabValue === value);
|
|
11534
|
+
setStatusFilter(filter?.value);
|
|
11535
|
+
}, []);
|
|
11412
11536
|
const handleOrderClick = React3.useCallback(
|
|
11413
11537
|
(order) => {
|
|
11414
11538
|
if (onOrderNavigate) {
|
|
@@ -11422,6 +11546,7 @@ function OrderHistoryPage({
|
|
|
11422
11546
|
const handleBack = React3.useCallback(() => {
|
|
11423
11547
|
setSelectedOrder(null);
|
|
11424
11548
|
}, []);
|
|
11549
|
+
const activeTabValue = STATUS_FILTERS.find((f) => f.value === statusFilter)?.tabValue ?? "all";
|
|
11425
11550
|
if (selectedOrder && !onOrderNavigate) {
|
|
11426
11551
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-order-history-page": true, className: cn(className, classNames?.root), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-history-detail": true, className: classNames?.detail, children: [
|
|
11427
11552
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11439,20 +11564,17 @@ function OrderHistoryPage({
|
|
|
11439
11564
|
}
|
|
11440
11565
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-history-page": true, className: cn(className, classNames?.root), children: [
|
|
11441
11566
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-order-history-header": true, className: classNames?.header, children: /* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-order-history-title": true, className: classNames?.title, children: title }) }),
|
|
11442
|
-
showFilters && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11443
|
-
|
|
11567
|
+
showFilters && /* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs.Root, { value: activeTabValue, onValueChange: handleTabChange, children: /* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs.List, { "data-cimplify-order-history-filters": true, className: classNames?.filters, children: STATUS_FILTERS.map((filter) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11568
|
+
tabs.Tabs.Tab,
|
|
11444
11569
|
{
|
|
11445
|
-
|
|
11446
|
-
role: "tab",
|
|
11447
|
-
"aria-selected": statusFilter === filter.value,
|
|
11448
|
-
onClick: () => setStatusFilter(filter.value),
|
|
11570
|
+
value: filter.tabValue,
|
|
11449
11571
|
"data-cimplify-order-filter": true,
|
|
11450
11572
|
"data-selected": statusFilter === filter.value || void 0,
|
|
11451
11573
|
className: classNames?.filterButton,
|
|
11452
11574
|
children: filter.label
|
|
11453
11575
|
},
|
|
11454
|
-
filter.
|
|
11455
|
-
)) }),
|
|
11576
|
+
filter.tabValue
|
|
11577
|
+
)) }) }),
|
|
11456
11578
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-order-history-list": true, className: classNames?.list, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11457
11579
|
OrderHistory,
|
|
11458
11580
|
{
|
|
@@ -11480,7 +11602,7 @@ function SearchPage({
|
|
|
11480
11602
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-search-page-header": true, className: classNames?.header, children: /* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-search-page-title": true, className: classNames?.title, children: title }) }),
|
|
11481
11603
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-search-page-input": true, className: classNames?.inputContainer, children: [
|
|
11482
11604
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11483
|
-
|
|
11605
|
+
input.Input,
|
|
11484
11606
|
{
|
|
11485
11607
|
type: "search",
|
|
11486
11608
|
value: query,
|
|
@@ -11822,20 +11944,24 @@ function BookingsPage({
|
|
|
11822
11944
|
}
|
|
11823
11945
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bookings-page": true, className: cn(className, classNames?.root), children: [
|
|
11824
11946
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-bookings-header": true, className: classNames?.header, children: /* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-bookings-title": true, className: classNames?.title, children: title }) }),
|
|
11825
|
-
showFilters && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11826
|
-
|
|
11947
|
+
showFilters && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11948
|
+
tabs.Tabs.Root,
|
|
11827
11949
|
{
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
"
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11950
|
+
value: filter,
|
|
11951
|
+
onValueChange: (value) => setFilter(value),
|
|
11952
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs.List, { "data-cimplify-bookings-filters": true, className: classNames?.filters, children: BOOKING_FILTERS.map((f) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11953
|
+
tabs.Tabs.Tab,
|
|
11954
|
+
{
|
|
11955
|
+
value: f.value,
|
|
11956
|
+
"data-cimplify-booking-filter": true,
|
|
11957
|
+
"data-selected": filter === f.value || void 0,
|
|
11958
|
+
className: classNames?.filterButton,
|
|
11959
|
+
children: f.label
|
|
11960
|
+
},
|
|
11961
|
+
f.value
|
|
11962
|
+
)) })
|
|
11963
|
+
}
|
|
11964
|
+
),
|
|
11839
11965
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-bookings-list": true, className: classNames?.list, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11840
11966
|
BookingList,
|
|
11841
11967
|
{
|