@cimplify/sdk 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react.d.mts +8 -2
- package/dist/react.d.ts +8 -2
- package/dist/react.js +413 -296
- package/dist/react.mjs +413 -296
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/registry/add-on-selector.json +1 -1
- package/registry/bookings-page.json +1 -1
- package/registry/bundle-selector.json +1 -1
- package/registry/category-filter.json +1 -1
- package/registry/composite-selector.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/registry/variant-selector.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
|
|
|
@@ -8008,7 +8011,6 @@ function VariantSelector({
|
|
|
8008
8011
|
radio.Radio.Root,
|
|
8009
8012
|
{
|
|
8010
8013
|
value: value.id,
|
|
8011
|
-
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
8012
8014
|
"data-cimplify-variant-option": true,
|
|
8013
8015
|
"data-selected": isSelected || void 0,
|
|
8014
8016
|
className: cn(
|
|
@@ -8056,7 +8058,6 @@ function VariantSelector({
|
|
|
8056
8058
|
radio.Radio.Root,
|
|
8057
8059
|
{
|
|
8058
8060
|
value: variant.id,
|
|
8059
|
-
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
8060
8061
|
"data-cimplify-variant-option": true,
|
|
8061
8062
|
"data-selected": isSelected || void 0,
|
|
8062
8063
|
className: cn(
|
|
@@ -8214,7 +8215,6 @@ function AddOnSelector({
|
|
|
8214
8215
|
checked: isSelected,
|
|
8215
8216
|
onCheckedChange: (checked) => handleCheckedChange(addOn, option.id, checked),
|
|
8216
8217
|
value: option.id,
|
|
8217
|
-
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
8218
8218
|
"data-cimplify-addon-option": true,
|
|
8219
8219
|
"data-selected": isSelected || void 0,
|
|
8220
8220
|
className: cn(
|
|
@@ -8455,7 +8455,6 @@ function BundleComponentCard({
|
|
|
8455
8455
|
radio.Radio.Root,
|
|
8456
8456
|
{
|
|
8457
8457
|
value: variant.id,
|
|
8458
|
-
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
8459
8458
|
"data-cimplify-bundle-variant-option": true,
|
|
8460
8459
|
"data-selected": isSelected || void 0,
|
|
8461
8460
|
className: cn(
|
|
@@ -8701,7 +8700,6 @@ function CompositeSelector({
|
|
|
8701
8700
|
checked: isSelected,
|
|
8702
8701
|
onCheckedChange: () => toggleComponent(group, component),
|
|
8703
8702
|
value: component.id,
|
|
8704
|
-
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
|
|
8705
8703
|
"data-cimplify-composite-component": true,
|
|
8706
8704
|
"data-selected": isSelected || void 0,
|
|
8707
8705
|
className: cn(
|
|
@@ -9172,33 +9170,44 @@ function ProductImageGallery({
|
|
|
9172
9170
|
)
|
|
9173
9171
|
}
|
|
9174
9172
|
),
|
|
9175
|
-
normalizedImages.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9176
|
-
|
|
9173
|
+
normalizedImages.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9174
|
+
radioGroup.RadioGroup,
|
|
9177
9175
|
{
|
|
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
|
-
|
|
9176
|
+
"aria-label": `${productName} image thumbnails`,
|
|
9177
|
+
value: String(selectedImage),
|
|
9178
|
+
onValueChange: (value) => setSelectedImage(Number(value)),
|
|
9179
|
+
"data-cimplify-image-gallery-thumbnails": true,
|
|
9180
|
+
style: { display: "flex", gap: "0.5rem", marginTop: "0.75rem" },
|
|
9181
|
+
children: normalizedImages.map((image, index) => {
|
|
9182
|
+
const isSelected = selectedImage === index;
|
|
9183
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9184
|
+
radio.Radio.Root,
|
|
9185
|
+
{
|
|
9186
|
+
value: String(index),
|
|
9187
|
+
"data-cimplify-image-gallery-thumb": true,
|
|
9188
|
+
"data-selected": isSelected || void 0,
|
|
9189
|
+
style: {
|
|
9190
|
+
width: "4rem",
|
|
9191
|
+
height: "4rem",
|
|
9192
|
+
overflow: "hidden",
|
|
9193
|
+
padding: 0,
|
|
9194
|
+
border: "none",
|
|
9195
|
+
cursor: "pointer"
|
|
9196
|
+
},
|
|
9197
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9198
|
+
"img",
|
|
9199
|
+
{
|
|
9200
|
+
src: image,
|
|
9201
|
+
alt: "",
|
|
9202
|
+
style: { width: "100%", height: "100%", objectFit: "cover" }
|
|
9203
|
+
}
|
|
9204
|
+
)
|
|
9205
|
+
},
|
|
9206
|
+
`${image}-${index}`
|
|
9207
|
+
);
|
|
9208
|
+
})
|
|
9209
|
+
}
|
|
9210
|
+
)
|
|
9202
9211
|
] });
|
|
9203
9212
|
}
|
|
9204
9213
|
function CartLineItemRow({
|
|
@@ -9809,6 +9818,26 @@ function ProductGrid({
|
|
|
9809
9818
|
)
|
|
9810
9819
|
] });
|
|
9811
9820
|
}
|
|
9821
|
+
var SearchIcon = () => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9822
|
+
"svg",
|
|
9823
|
+
{
|
|
9824
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9825
|
+
width: "16",
|
|
9826
|
+
height: "16",
|
|
9827
|
+
viewBox: "0 0 24 24",
|
|
9828
|
+
fill: "none",
|
|
9829
|
+
stroke: "currentColor",
|
|
9830
|
+
strokeWidth: "2",
|
|
9831
|
+
strokeLinecap: "round",
|
|
9832
|
+
strokeLinejoin: "round",
|
|
9833
|
+
"aria-hidden": "true",
|
|
9834
|
+
"data-cimplify-search-icon": true,
|
|
9835
|
+
children: [
|
|
9836
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
9837
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
9838
|
+
]
|
|
9839
|
+
}
|
|
9840
|
+
);
|
|
9812
9841
|
function SearchInput({
|
|
9813
9842
|
placeholder = "Search products...",
|
|
9814
9843
|
searchOptions,
|
|
@@ -9819,42 +9848,58 @@ function SearchInput({
|
|
|
9819
9848
|
classNames
|
|
9820
9849
|
}) {
|
|
9821
9850
|
const { results, isLoading, query, setQuery, clear } = useSearch(searchOptions);
|
|
9822
|
-
const
|
|
9823
|
-
(
|
|
9824
|
-
setQuery(
|
|
9851
|
+
const handleValueChange = React3.useCallback(
|
|
9852
|
+
(value) => {
|
|
9853
|
+
setQuery(value);
|
|
9825
9854
|
},
|
|
9826
9855
|
[setQuery]
|
|
9827
9856
|
);
|
|
9828
9857
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9829
|
-
|
|
9858
|
+
field.Field.Root,
|
|
9830
9859
|
{
|
|
9831
9860
|
"data-cimplify-search": true,
|
|
9832
9861
|
className: cn(className, classNames?.root),
|
|
9833
9862
|
style: { position: "relative" },
|
|
9834
9863
|
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
|
-
|
|
9864
|
+
/* @__PURE__ */ jsxRuntime.jsx(field.Field.Label, { className: "sr-only", children: "Search products" }),
|
|
9865
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", display: "flex", alignItems: "center" }, children: [
|
|
9866
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9867
|
+
"span",
|
|
9868
|
+
{
|
|
9869
|
+
"data-cimplify-search-icon-wrapper": true,
|
|
9870
|
+
style: {
|
|
9871
|
+
position: "absolute",
|
|
9872
|
+
left: "0.5rem",
|
|
9873
|
+
pointerEvents: "none",
|
|
9874
|
+
display: "flex",
|
|
9875
|
+
alignItems: "center"
|
|
9876
|
+
},
|
|
9877
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, {})
|
|
9878
|
+
}
|
|
9879
|
+
),
|
|
9880
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9881
|
+
input.Input,
|
|
9882
|
+
{
|
|
9883
|
+
type: "search",
|
|
9884
|
+
value: query,
|
|
9885
|
+
onValueChange: handleValueChange,
|
|
9886
|
+
placeholder,
|
|
9887
|
+
"data-cimplify-search-input": true,
|
|
9888
|
+
className: classNames?.input
|
|
9889
|
+
}
|
|
9890
|
+
),
|
|
9891
|
+
query.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9892
|
+
"button",
|
|
9893
|
+
{
|
|
9894
|
+
type: "button",
|
|
9895
|
+
onClick: clear,
|
|
9896
|
+
"data-cimplify-search-clear": true,
|
|
9897
|
+
className: classNames?.clearButton,
|
|
9898
|
+
"aria-label": "Clear search",
|
|
9899
|
+
children: "\xD7"
|
|
9900
|
+
}
|
|
9901
|
+
)
|
|
9902
|
+
] }),
|
|
9858
9903
|
showResults && query.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-search-results": true, className: classNames?.results, children: [
|
|
9859
9904
|
isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-search-loading": true, className: classNames?.loading, "aria-busy": "true", children: "Searching..." }),
|
|
9860
9905
|
!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 +9919,7 @@ function SearchInput({
|
|
|
9874
9919
|
}
|
|
9875
9920
|
);
|
|
9876
9921
|
}
|
|
9922
|
+
var ALL_VALUE = "__all__";
|
|
9877
9923
|
function CategoryFilter({
|
|
9878
9924
|
selectedId = null,
|
|
9879
9925
|
onSelect,
|
|
@@ -9883,9 +9929,9 @@ function CategoryFilter({
|
|
|
9883
9929
|
classNames
|
|
9884
9930
|
}) {
|
|
9885
9931
|
const { categories, isLoading } = useCategories();
|
|
9886
|
-
const
|
|
9887
|
-
(
|
|
9888
|
-
onSelect(
|
|
9932
|
+
const handleValueChange = React3.useCallback(
|
|
9933
|
+
(value) => {
|
|
9934
|
+
onSelect(value === ALL_VALUE ? null : String(value));
|
|
9889
9935
|
},
|
|
9890
9936
|
[onSelect]
|
|
9891
9937
|
);
|
|
@@ -9899,45 +9945,45 @@ function CategoryFilter({
|
|
|
9899
9945
|
}
|
|
9900
9946
|
);
|
|
9901
9947
|
}
|
|
9902
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
9903
|
-
|
|
9948
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9949
|
+
tabs.Tabs.Root,
|
|
9904
9950
|
{
|
|
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
|
-
|
|
9951
|
+
value: selectedId ?? ALL_VALUE,
|
|
9952
|
+
onValueChange: handleValueChange,
|
|
9953
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9954
|
+
tabs.Tabs.List,
|
|
9955
|
+
{
|
|
9956
|
+
"data-cimplify-category-filter": true,
|
|
9957
|
+
"aria-label": "Filter by category",
|
|
9958
|
+
className: cn(className, classNames?.root),
|
|
9959
|
+
children: [
|
|
9960
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9961
|
+
tabs.Tabs.Tab,
|
|
9962
|
+
{
|
|
9963
|
+
value: ALL_VALUE,
|
|
9964
|
+
"data-cimplify-category-filter-item": true,
|
|
9965
|
+
"data-selected": selectedId === null || void 0,
|
|
9966
|
+
className: cn(classNames?.item, classNames?.allButton),
|
|
9967
|
+
children: allLabel
|
|
9968
|
+
}
|
|
9969
|
+
),
|
|
9970
|
+
categories.map((category) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9971
|
+
tabs.Tabs.Tab,
|
|
9972
|
+
{
|
|
9973
|
+
value: category.id,
|
|
9974
|
+
"data-cimplify-category-filter-item": true,
|
|
9975
|
+
"data-selected": selectedId === category.id || void 0,
|
|
9976
|
+
className: classNames?.item,
|
|
9977
|
+
children: [
|
|
9978
|
+
category.name,
|
|
9979
|
+
showCounts && category.product_count != null && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-category-count": true, className: classNames?.count, children: category.product_count })
|
|
9980
|
+
]
|
|
9981
|
+
},
|
|
9982
|
+
category.id
|
|
9983
|
+
))
|
|
9984
|
+
]
|
|
9985
|
+
}
|
|
9986
|
+
)
|
|
9941
9987
|
}
|
|
9942
9988
|
);
|
|
9943
9989
|
}
|
|
@@ -9980,50 +10026,74 @@ function DiscountInput({
|
|
|
9980
10026
|
[handleApply]
|
|
9981
10027
|
);
|
|
9982
10028
|
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
|
-
|
|
10029
|
+
const hasError = !!error || !!appliedValidation && !appliedValidation.is_eligible;
|
|
10030
|
+
const errorMessage = error ? error.message : appliedValidation && !appliedValidation.is_eligible ? appliedValidation.ineligibility_reason ?? "This code is not valid." : void 0;
|
|
10031
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10032
|
+
field.Field.Root,
|
|
10033
|
+
{
|
|
10034
|
+
"data-cimplify-discount": true,
|
|
10035
|
+
invalid: hasError,
|
|
10036
|
+
disabled: isApplied,
|
|
10037
|
+
className: cn(className, classNames?.root),
|
|
10038
|
+
children: [
|
|
10039
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-discount-form": true, children: [
|
|
10040
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10041
|
+
input.Input,
|
|
10042
|
+
{
|
|
10043
|
+
type: "text",
|
|
10044
|
+
value: code,
|
|
10045
|
+
onValueChange: (value) => setCode(value),
|
|
10046
|
+
onKeyDown: handleKeyDown,
|
|
10047
|
+
placeholder,
|
|
10048
|
+
"data-cimplify-discount-input": true,
|
|
10049
|
+
className: classNames?.input,
|
|
10050
|
+
"aria-label": "Discount code"
|
|
10051
|
+
}
|
|
10052
|
+
),
|
|
10053
|
+
isApplied ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10054
|
+
"button",
|
|
10055
|
+
{
|
|
10056
|
+
type: "button",
|
|
10057
|
+
onClick: handleClear,
|
|
10058
|
+
"data-cimplify-discount-clear": true,
|
|
10059
|
+
className: classNames?.button,
|
|
10060
|
+
children: "Remove"
|
|
10061
|
+
}
|
|
10062
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
10063
|
+
"button",
|
|
10064
|
+
{
|
|
10065
|
+
type: "button",
|
|
10066
|
+
onClick: handleApply,
|
|
10067
|
+
disabled: isValidating || code.trim().length === 0,
|
|
10068
|
+
"data-cimplify-discount-apply": true,
|
|
10069
|
+
className: classNames?.button,
|
|
10070
|
+
children: isValidating ? "Checking..." : "Apply"
|
|
10071
|
+
}
|
|
10072
|
+
)
|
|
10073
|
+
] }),
|
|
10074
|
+
hasError && errorMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10075
|
+
field.Field.Error,
|
|
10076
|
+
{
|
|
10077
|
+
match: true,
|
|
10078
|
+
"data-cimplify-discount-error": true,
|
|
10079
|
+
className: classNames?.error,
|
|
10080
|
+
children: errorMessage
|
|
10081
|
+
}
|
|
10082
|
+
),
|
|
10083
|
+
isApplied && appliedValidation.discount_amount && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10084
|
+
field.Field.Description,
|
|
10085
|
+
{
|
|
10086
|
+
"data-cimplify-discount-success": true,
|
|
10087
|
+
className: classNames?.success,
|
|
10088
|
+
children: [
|
|
10089
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount applied" }),
|
|
10090
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: appliedValidation.discount_amount, prefix: "-" })
|
|
10091
|
+
]
|
|
10092
|
+
}
|
|
10093
|
+
)
|
|
10094
|
+
]
|
|
10095
|
+
}
|
|
10096
|
+
);
|
|
10027
10097
|
}
|
|
10028
10098
|
function CategoryGrid({
|
|
10029
10099
|
categories: categoriesProp,
|
|
@@ -10470,6 +10540,9 @@ function formatTime(timeStr) {
|
|
|
10470
10540
|
}
|
|
10471
10541
|
return timeStr;
|
|
10472
10542
|
}
|
|
10543
|
+
function slotToValue(slot) {
|
|
10544
|
+
return `${slot.start_time}|${slot.end_time}`;
|
|
10545
|
+
}
|
|
10473
10546
|
function SlotPicker({
|
|
10474
10547
|
slots: slotsProp,
|
|
10475
10548
|
serviceId,
|
|
@@ -10514,29 +10587,48 @@ function SlotPicker({
|
|
|
10514
10587
|
);
|
|
10515
10588
|
}
|
|
10516
10589
|
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
|
-
|
|
10590
|
+
const slotsByValue = /* @__PURE__ */ new Map();
|
|
10591
|
+
for (const slot of slots) {
|
|
10592
|
+
slotsByValue.set(slotToValue(slot), slot);
|
|
10593
|
+
}
|
|
10594
|
+
const selectedValue = selectedSlot ? slotToValue(selectedSlot) : "";
|
|
10595
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10596
|
+
radioGroup.RadioGroup,
|
|
10597
|
+
{
|
|
10598
|
+
"data-cimplify-slot-picker": true,
|
|
10599
|
+
className: cn(className, classNames?.root),
|
|
10600
|
+
value: selectedValue,
|
|
10601
|
+
onValueChange: (value) => {
|
|
10602
|
+
const slot = slotsByValue.get(value);
|
|
10603
|
+
if (slot?.is_available) {
|
|
10604
|
+
onSlotSelect?.(slot);
|
|
10605
|
+
}
|
|
10606
|
+
},
|
|
10607
|
+
children: groups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-slot-group": true, className: classNames?.group, children: [
|
|
10608
|
+
group.label && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-slot-group-label": true, className: classNames?.groupLabel, children: group.label }),
|
|
10609
|
+
group.slots.map((slot) => {
|
|
10610
|
+
const value = slotToValue(slot);
|
|
10611
|
+
const isSelected = selectedSlot?.start_time === slot.start_time && selectedSlot?.end_time === slot.end_time;
|
|
10612
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10613
|
+
radio.Radio.Root,
|
|
10614
|
+
{
|
|
10615
|
+
value,
|
|
10616
|
+
disabled: !slot.is_available,
|
|
10617
|
+
"data-cimplify-slot": true,
|
|
10618
|
+
"data-selected": isSelected || void 0,
|
|
10619
|
+
"data-unavailable": !slot.is_available || void 0,
|
|
10620
|
+
className: classNames?.slot,
|
|
10621
|
+
children: [
|
|
10622
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-slot-time": true, className: classNames?.slotTime, children: formatTime(slot.start_time) }),
|
|
10623
|
+
showPrice && slot.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-slot-price": true, className: classNames?.slotPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: slot.price }) })
|
|
10624
|
+
]
|
|
10625
|
+
},
|
|
10626
|
+
value
|
|
10627
|
+
);
|
|
10628
|
+
})
|
|
10629
|
+
] }, group.label || "all"))
|
|
10630
|
+
}
|
|
10631
|
+
);
|
|
10540
10632
|
}
|
|
10541
10633
|
function formatDate(dateStr) {
|
|
10542
10634
|
const date = /* @__PURE__ */ new Date(dateStr + "T00:00:00");
|
|
@@ -10599,8 +10691,10 @@ function DateSlotPicker({
|
|
|
10599
10691
|
const handleNext = React3.useCallback(() => {
|
|
10600
10692
|
setOffset((prev) => prev + daysToShow);
|
|
10601
10693
|
}, [daysToShow]);
|
|
10602
|
-
const
|
|
10603
|
-
|
|
10694
|
+
const handleDateChange = React3.useCallback((value) => {
|
|
10695
|
+
if (typeof value === "string") {
|
|
10696
|
+
setSelectedDate(value);
|
|
10697
|
+
}
|
|
10604
10698
|
}, []);
|
|
10605
10699
|
const handleSlotSelect = React3.useCallback(
|
|
10606
10700
|
(slot) => {
|
|
@@ -10608,72 +10702,79 @@ function DateSlotPicker({
|
|
|
10608
10702
|
},
|
|
10609
10703
|
[onSlotSelect, selectedDate]
|
|
10610
10704
|
);
|
|
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
|
-
|
|
10705
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10706
|
+
tabs.Tabs.Root,
|
|
10707
|
+
{
|
|
10708
|
+
value: selectedDate,
|
|
10709
|
+
onValueChange: handleDateChange,
|
|
10710
|
+
"data-cimplify-date-slot-picker": true,
|
|
10711
|
+
className: cn(className, classNames?.root),
|
|
10712
|
+
children: [
|
|
10713
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-date-nav": true, className: classNames?.nav, children: [
|
|
10714
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10715
|
+
"button",
|
|
10716
|
+
{
|
|
10717
|
+
type: "button",
|
|
10718
|
+
onClick: handlePrev,
|
|
10719
|
+
disabled: offset === 0,
|
|
10720
|
+
"data-cimplify-date-nav-prev": true,
|
|
10721
|
+
className: classNames?.navButton,
|
|
10722
|
+
children: "\u2190"
|
|
10723
|
+
}
|
|
10724
|
+
),
|
|
10725
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10726
|
+
"button",
|
|
10727
|
+
{
|
|
10728
|
+
type: "button",
|
|
10729
|
+
onClick: handleNext,
|
|
10730
|
+
"data-cimplify-date-nav-next": true,
|
|
10731
|
+
className: classNames?.navButton,
|
|
10732
|
+
children: "\u2192"
|
|
10733
|
+
}
|
|
10734
|
+
)
|
|
10735
|
+
] }),
|
|
10736
|
+
/* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs.List, { "data-cimplify-date-strip": true, className: classNames?.dateStrip, children: dateRange.dates.map((date) => {
|
|
10737
|
+
const dayInfo = availabilityMap.get(date);
|
|
10738
|
+
const hasAvailability = dayInfo?.has_availability !== false;
|
|
10739
|
+
const isSelected = selectedDate === date;
|
|
10740
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10741
|
+
tabs.Tabs.Tab,
|
|
10742
|
+
{
|
|
10743
|
+
value: date,
|
|
10744
|
+
"data-cimplify-date-button": true,
|
|
10745
|
+
"data-selected": isSelected || void 0,
|
|
10746
|
+
"data-available": hasAvailability || void 0,
|
|
10747
|
+
"data-fully-booked": !hasAvailability || void 0,
|
|
10748
|
+
className: classNames?.dateButton,
|
|
10749
|
+
children: formatDate(date)
|
|
10750
|
+
},
|
|
10751
|
+
date
|
|
10752
|
+
);
|
|
10753
|
+
}) }),
|
|
10754
|
+
availabilityLoading && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10755
|
+
"div",
|
|
10756
|
+
{
|
|
10757
|
+
"data-cimplify-date-slot-loading": true,
|
|
10758
|
+
"aria-busy": "true",
|
|
10759
|
+
className: classNames?.loading
|
|
10760
|
+
}
|
|
10761
|
+
),
|
|
10762
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-date-slots": true, className: classNames?.slots, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10763
|
+
SlotPicker,
|
|
10764
|
+
{
|
|
10765
|
+
serviceId,
|
|
10766
|
+
date: selectedDate,
|
|
10767
|
+
participantCount,
|
|
10768
|
+
selectedSlot,
|
|
10769
|
+
onSlotSelect: handleSlotSelect,
|
|
10770
|
+
showPrice
|
|
10771
|
+
}
|
|
10772
|
+
) })
|
|
10773
|
+
]
|
|
10774
|
+
}
|
|
10775
|
+
);
|
|
10676
10776
|
}
|
|
10777
|
+
var ANY_VALUE = "__any__";
|
|
10677
10778
|
function StaffPicker({
|
|
10678
10779
|
staff,
|
|
10679
10780
|
selectedStaffId,
|
|
@@ -10683,44 +10784,54 @@ function StaffPicker({
|
|
|
10683
10784
|
className,
|
|
10684
10785
|
classNames
|
|
10685
10786
|
}) {
|
|
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
|
-
]
|
|
10787
|
+
const groupValue = selectedStaffId === null ? ANY_VALUE : selectedStaffId ?? "";
|
|
10788
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10789
|
+
radioGroup.RadioGroup,
|
|
10790
|
+
{
|
|
10791
|
+
"data-cimplify-staff-picker": true,
|
|
10792
|
+
className: cn(className, classNames?.root),
|
|
10793
|
+
value: groupValue,
|
|
10794
|
+
onValueChange: (value) => {
|
|
10795
|
+
onStaffSelect?.(value === ANY_VALUE ? null : value);
|
|
10720
10796
|
},
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10797
|
+
children: [
|
|
10798
|
+
showAnyOption && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10799
|
+
radio.Radio.Root,
|
|
10800
|
+
{
|
|
10801
|
+
value: ANY_VALUE,
|
|
10802
|
+
"data-cimplify-staff-option": true,
|
|
10803
|
+
"data-selected": selectedStaffId === null || void 0,
|
|
10804
|
+
"data-any": true,
|
|
10805
|
+
className: classNames?.option,
|
|
10806
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: anyLabel })
|
|
10807
|
+
}
|
|
10808
|
+
),
|
|
10809
|
+
staff.map((member) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10810
|
+
radio.Radio.Root,
|
|
10811
|
+
{
|
|
10812
|
+
value: member.id,
|
|
10813
|
+
"data-cimplify-staff-option": true,
|
|
10814
|
+
"data-selected": selectedStaffId === member.id || void 0,
|
|
10815
|
+
className: classNames?.option,
|
|
10816
|
+
children: [
|
|
10817
|
+
member.avatar_url && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10818
|
+
"img",
|
|
10819
|
+
{
|
|
10820
|
+
src: member.avatar_url,
|
|
10821
|
+
alt: member.name,
|
|
10822
|
+
"data-cimplify-staff-avatar": true,
|
|
10823
|
+
className: classNames?.avatar
|
|
10824
|
+
}
|
|
10825
|
+
),
|
|
10826
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-name": true, className: classNames?.name, children: member.name }),
|
|
10827
|
+
member.bio && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-staff-bio": true, className: classNames?.bio, children: member.bio })
|
|
10828
|
+
]
|
|
10829
|
+
},
|
|
10830
|
+
member.id
|
|
10831
|
+
))
|
|
10832
|
+
]
|
|
10833
|
+
}
|
|
10834
|
+
);
|
|
10724
10835
|
}
|
|
10725
10836
|
var STATUS_LABELS3 = {
|
|
10726
10837
|
pending: "Pending",
|
|
@@ -11392,10 +11503,10 @@ function OrderDetailPage({
|
|
|
11392
11503
|
] });
|
|
11393
11504
|
}
|
|
11394
11505
|
var STATUS_FILTERS = [
|
|
11395
|
-
{ label: "All", value: void 0 },
|
|
11396
|
-
{ label: "Active", value: "confirmed" },
|
|
11397
|
-
{ label: "Completed", value: "completed" },
|
|
11398
|
-
{ label: "Cancelled", value: "cancelled" }
|
|
11506
|
+
{ label: "All", value: void 0, tabValue: "all" },
|
|
11507
|
+
{ label: "Active", value: "confirmed", tabValue: "confirmed" },
|
|
11508
|
+
{ label: "Completed", value: "completed", tabValue: "completed" },
|
|
11509
|
+
{ label: "Cancelled", value: "cancelled", tabValue: "cancelled" }
|
|
11399
11510
|
];
|
|
11400
11511
|
function OrderHistoryPage({
|
|
11401
11512
|
title = "Order History",
|
|
@@ -11409,6 +11520,10 @@ function OrderHistoryPage({
|
|
|
11409
11520
|
}) {
|
|
11410
11521
|
const [statusFilter, setStatusFilter] = React3.useState(void 0);
|
|
11411
11522
|
const [selectedOrder, setSelectedOrder] = React3.useState(null);
|
|
11523
|
+
const handleTabChange = React3.useCallback((value) => {
|
|
11524
|
+
const filter = STATUS_FILTERS.find((f) => f.tabValue === value);
|
|
11525
|
+
setStatusFilter(filter?.value);
|
|
11526
|
+
}, []);
|
|
11412
11527
|
const handleOrderClick = React3.useCallback(
|
|
11413
11528
|
(order) => {
|
|
11414
11529
|
if (onOrderNavigate) {
|
|
@@ -11422,6 +11537,7 @@ function OrderHistoryPage({
|
|
|
11422
11537
|
const handleBack = React3.useCallback(() => {
|
|
11423
11538
|
setSelectedOrder(null);
|
|
11424
11539
|
}, []);
|
|
11540
|
+
const activeTabValue = STATUS_FILTERS.find((f) => f.value === statusFilter)?.tabValue ?? "all";
|
|
11425
11541
|
if (selectedOrder && !onOrderNavigate) {
|
|
11426
11542
|
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
11543
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11439,20 +11555,17 @@ function OrderHistoryPage({
|
|
|
11439
11555
|
}
|
|
11440
11556
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-history-page": true, className: cn(className, classNames?.root), children: [
|
|
11441
11557
|
/* @__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
|
-
|
|
11558
|
+
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(
|
|
11559
|
+
tabs.Tabs.Tab,
|
|
11444
11560
|
{
|
|
11445
|
-
|
|
11446
|
-
role: "tab",
|
|
11447
|
-
"aria-selected": statusFilter === filter.value,
|
|
11448
|
-
onClick: () => setStatusFilter(filter.value),
|
|
11561
|
+
value: filter.tabValue,
|
|
11449
11562
|
"data-cimplify-order-filter": true,
|
|
11450
11563
|
"data-selected": statusFilter === filter.value || void 0,
|
|
11451
11564
|
className: classNames?.filterButton,
|
|
11452
11565
|
children: filter.label
|
|
11453
11566
|
},
|
|
11454
|
-
filter.
|
|
11455
|
-
)) }),
|
|
11567
|
+
filter.tabValue
|
|
11568
|
+
)) }) }),
|
|
11456
11569
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-order-history-list": true, className: classNames?.list, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11457
11570
|
OrderHistory,
|
|
11458
11571
|
{
|
|
@@ -11480,7 +11593,7 @@ function SearchPage({
|
|
|
11480
11593
|
/* @__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
11594
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-search-page-input": true, className: classNames?.inputContainer, children: [
|
|
11482
11595
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11483
|
-
|
|
11596
|
+
input.Input,
|
|
11484
11597
|
{
|
|
11485
11598
|
type: "search",
|
|
11486
11599
|
value: query,
|
|
@@ -11822,20 +11935,24 @@ function BookingsPage({
|
|
|
11822
11935
|
}
|
|
11823
11936
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bookings-page": true, className: cn(className, classNames?.root), children: [
|
|
11824
11937
|
/* @__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
|
-
|
|
11938
|
+
showFilters && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11939
|
+
tabs.Tabs.Root,
|
|
11827
11940
|
{
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
"
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11941
|
+
value: filter,
|
|
11942
|
+
onValueChange: (value) => setFilter(value),
|
|
11943
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(tabs.Tabs.List, { "data-cimplify-bookings-filters": true, className: classNames?.filters, children: BOOKING_FILTERS.map((f) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11944
|
+
tabs.Tabs.Tab,
|
|
11945
|
+
{
|
|
11946
|
+
value: f.value,
|
|
11947
|
+
"data-cimplify-booking-filter": true,
|
|
11948
|
+
"data-selected": filter === f.value || void 0,
|
|
11949
|
+
className: classNames?.filterButton,
|
|
11950
|
+
children: f.label
|
|
11951
|
+
},
|
|
11952
|
+
f.value
|
|
11953
|
+
)) })
|
|
11954
|
+
}
|
|
11955
|
+
),
|
|
11839
11956
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-bookings-list": true, className: classNames?.list, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11840
11957
|
BookingList,
|
|
11841
11958
|
{
|