@idkwebsites/components 0.1.20 → 0.1.22
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/index.cjs +9 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -11
- package/dist/index.d.ts +6 -11
- package/dist/index.js +9 -24
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1777,13 +1777,13 @@ function DefaultLink({ href, className, onClick, children }) {
|
|
|
1777
1777
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("a", { href, className, onClick, children });
|
|
1778
1778
|
}
|
|
1779
1779
|
function BookingWidgetPanel({
|
|
1780
|
+
mobileHeader,
|
|
1780
1781
|
navLinks = [],
|
|
1781
1782
|
menuIcon,
|
|
1782
1783
|
closeIcon,
|
|
1783
1784
|
categoryIcons,
|
|
1784
1785
|
stepTitles,
|
|
1785
|
-
linkComponent: LinkComp = DefaultLink
|
|
1786
|
-
mobileHeader
|
|
1786
|
+
linkComponent: LinkComp = DefaultLink
|
|
1787
1787
|
} = {}) {
|
|
1788
1788
|
const widgetRef = (0, import_react9.useRef)(null);
|
|
1789
1789
|
const formRef = (0, import_react9.useRef)(null);
|
|
@@ -1829,10 +1829,9 @@ function BookingWidgetPanel({
|
|
|
1829
1829
|
}
|
|
1830
1830
|
}
|
|
1831
1831
|
}, [bw.isAvailabilityLoading, bw.selectedService?.id, bw.availabilityByDate, bw.selectedDate]);
|
|
1832
|
-
const hasCategories = bw.categories.length >= 1;
|
|
1833
1832
|
const hasMultipleCategories = bw.categories.length > 1;
|
|
1834
1833
|
(0, import_react9.useEffect)(() => {
|
|
1835
|
-
if (
|
|
1834
|
+
if (bw.categories.length >= 1 && bw.categoryFilter === "all") {
|
|
1836
1835
|
bw.setCategoryFilter(bw.categories[0]);
|
|
1837
1836
|
}
|
|
1838
1837
|
}, [bw.categories.length]);
|
|
@@ -1848,7 +1847,7 @@ function BookingWidgetPanel({
|
|
|
1848
1847
|
const scrollbars = [];
|
|
1849
1848
|
const opts = {
|
|
1850
1849
|
damping: 0.08,
|
|
1851
|
-
continuousScrolling:
|
|
1850
|
+
continuousScrolling: false,
|
|
1852
1851
|
alwaysShowTracks: false,
|
|
1853
1852
|
plugins: {
|
|
1854
1853
|
overscroll: { effect: "bounce", damping: 0.15, maxOverscroll: 80 }
|
|
@@ -1872,20 +1871,6 @@ function BookingWidgetPanel({
|
|
|
1872
1871
|
};
|
|
1873
1872
|
}, [isReady, mobileStep]);
|
|
1874
1873
|
const initSvcScrollbar = (el) => {
|
|
1875
|
-
if (!el || typeof window !== "undefined" && window.matchMedia("(max-width: 1024px)").matches) {
|
|
1876
|
-
if (svcScrollbarRef.current) {
|
|
1877
|
-
try {
|
|
1878
|
-
svcScrollbarRef.current.destroy();
|
|
1879
|
-
} catch {
|
|
1880
|
-
}
|
|
1881
|
-
svcScrollbarRef.current = null;
|
|
1882
|
-
}
|
|
1883
|
-
return;
|
|
1884
|
-
}
|
|
1885
|
-
if (svcScrollbarRef.current && svcScrollbarRef.current.containerEl === el) {
|
|
1886
|
-
svcScrollbarRef.current.update();
|
|
1887
|
-
return;
|
|
1888
|
-
}
|
|
1889
1874
|
if (svcScrollbarRef.current) {
|
|
1890
1875
|
try {
|
|
1891
1876
|
svcScrollbarRef.current.destroy();
|
|
@@ -1893,9 +1878,10 @@ function BookingWidgetPanel({
|
|
|
1893
1878
|
}
|
|
1894
1879
|
svcScrollbarRef.current = null;
|
|
1895
1880
|
}
|
|
1881
|
+
if (!el || typeof window !== "undefined" && window.matchMedia("(max-width: 1024px)").matches) return;
|
|
1896
1882
|
svcScrollbarRef.current = import_smooth_scrollbar.default.init(el, {
|
|
1897
1883
|
damping: 0.08,
|
|
1898
|
-
continuousScrolling:
|
|
1884
|
+
continuousScrolling: false,
|
|
1899
1885
|
alwaysShowTracks: false,
|
|
1900
1886
|
plugins: {
|
|
1901
1887
|
overscroll: { effect: "bounce", damping: 0.15, maxOverscroll: 80 }
|
|
@@ -2056,12 +2042,11 @@ function BookingWidgetPanel({
|
|
|
2056
2042
|
svc.id
|
|
2057
2043
|
);
|
|
2058
2044
|
};
|
|
2059
|
-
const useLegacyNav = !mobileHeader && navLinks.length > 0;
|
|
2060
2045
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bw", ref: widgetRef, children: [
|
|
2061
|
-
mobileHeader
|
|
2046
|
+
mobileHeader ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "bw-mobile-header", children: mobileHeader }) : null,
|
|
2062
2047
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bw-topbar", children: [
|
|
2063
2048
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "bw-dots", children: Array.from({ length: 4 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `bw-dot ${mobileStep > i ? "is-filled" : ""}` }, i)) }),
|
|
2064
|
-
|
|
2049
|
+
navLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2065
2050
|
"button",
|
|
2066
2051
|
{
|
|
2067
2052
|
className: "bw-topbar-menu",
|
|
@@ -2071,7 +2056,7 @@ function BookingWidgetPanel({
|
|
|
2071
2056
|
}
|
|
2072
2057
|
)
|
|
2073
2058
|
] }),
|
|
2074
|
-
|
|
2059
|
+
navLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_framer_motion.AnimatePresence, { children: navOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2075
2060
|
import_framer_motion.motion.div,
|
|
2076
2061
|
{
|
|
2077
2062
|
className: "bw-nav-overlay",
|