@idkwebsites/components 0.1.21 → 0.1.23
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 +10 -26
- 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 +10 -26
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -443,14 +443,16 @@ interface BookingWidgetProps$1 {
|
|
|
443
443
|
declare function BookingWidget({ className, title, subtitle, serviceSearchPlaceholder, categoryLabel, serviceListMaxHeight, serviceLayout, serviceColumns, showServicePagination, staffLayout, staffColumns, showStaffPagination, timeLayout, showFullyBookedLabel, calendarVariant, enableServiceSearch, enableCategoryFilter, enableDatePaging, disabledWeekdays, ...hookProps }: BookingWidgetProps$1): react_jsx_runtime.JSX.Element;
|
|
444
444
|
|
|
445
445
|
interface BookingWidgetProps {
|
|
446
|
-
/**
|
|
446
|
+
/** Optional mobile-only header content rendered above the widget topbar. */
|
|
447
|
+
mobileHeader?: ReactNode;
|
|
448
|
+
/** Navigation links shown in the mobile menu overlay. Omit to hide hamburger. */
|
|
447
449
|
navLinks?: {
|
|
448
450
|
label: string;
|
|
449
451
|
href: string;
|
|
450
452
|
}[];
|
|
451
|
-
/** Custom icon for the mobile menu open button (default: lucide Menu)
|
|
453
|
+
/** Custom icon for the mobile menu open button (default: lucide Menu) */
|
|
452
454
|
menuIcon?: ReactNode;
|
|
453
|
-
/** Custom icon for the mobile menu close button (default: lucide X)
|
|
455
|
+
/** Custom icon for the mobile menu close button (default: lucide X) */
|
|
454
456
|
closeIcon?: ReactNode;
|
|
455
457
|
/** Override the category → icon mapping (keyword → React component) */
|
|
456
458
|
categoryIcons?: Record<string, typeof Scissors>;
|
|
@@ -459,7 +461,6 @@ interface BookingWidgetProps {
|
|
|
459
461
|
/**
|
|
460
462
|
* Link component for mobile nav. Defaults to a plain `<a>` tag.
|
|
461
463
|
* Next.js sites should pass `Link` from `next/link` for client-side navigation.
|
|
462
|
-
* @deprecated Use `mobileHeader` instead.
|
|
463
464
|
*/
|
|
464
465
|
linkComponent?: ComponentType<{
|
|
465
466
|
href: string;
|
|
@@ -467,14 +468,8 @@ interface BookingWidgetProps {
|
|
|
467
468
|
onClick?: () => void;
|
|
468
469
|
children: ReactNode;
|
|
469
470
|
}>;
|
|
470
|
-
/**
|
|
471
|
-
* Site's mobile header/navbar component. Rendered inside the widget on mobile,
|
|
472
|
-
* replacing the built-in hamburger menu. Pass your SiteHeader component here
|
|
473
|
-
* so the booking widget uses the same navigation design as the rest of the site.
|
|
474
|
-
*/
|
|
475
|
-
mobileHeader?: ReactNode;
|
|
476
471
|
}
|
|
477
|
-
declare function BookingWidgetPanel({ navLinks, menuIcon, closeIcon, categoryIcons, stepTitles, linkComponent: LinkComp,
|
|
472
|
+
declare function BookingWidgetPanel({ mobileHeader, navLinks, menuIcon, closeIcon, categoryIcons, stepTitles, linkComponent: LinkComp, }?: BookingWidgetProps): react_jsx_runtime.JSX.Element;
|
|
478
473
|
|
|
479
474
|
interface AvailabilityPickerProps {
|
|
480
475
|
serviceId: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -443,14 +443,16 @@ interface BookingWidgetProps$1 {
|
|
|
443
443
|
declare function BookingWidget({ className, title, subtitle, serviceSearchPlaceholder, categoryLabel, serviceListMaxHeight, serviceLayout, serviceColumns, showServicePagination, staffLayout, staffColumns, showStaffPagination, timeLayout, showFullyBookedLabel, calendarVariant, enableServiceSearch, enableCategoryFilter, enableDatePaging, disabledWeekdays, ...hookProps }: BookingWidgetProps$1): react_jsx_runtime.JSX.Element;
|
|
444
444
|
|
|
445
445
|
interface BookingWidgetProps {
|
|
446
|
-
/**
|
|
446
|
+
/** Optional mobile-only header content rendered above the widget topbar. */
|
|
447
|
+
mobileHeader?: ReactNode;
|
|
448
|
+
/** Navigation links shown in the mobile menu overlay. Omit to hide hamburger. */
|
|
447
449
|
navLinks?: {
|
|
448
450
|
label: string;
|
|
449
451
|
href: string;
|
|
450
452
|
}[];
|
|
451
|
-
/** Custom icon for the mobile menu open button (default: lucide Menu)
|
|
453
|
+
/** Custom icon for the mobile menu open button (default: lucide Menu) */
|
|
452
454
|
menuIcon?: ReactNode;
|
|
453
|
-
/** Custom icon for the mobile menu close button (default: lucide X)
|
|
455
|
+
/** Custom icon for the mobile menu close button (default: lucide X) */
|
|
454
456
|
closeIcon?: ReactNode;
|
|
455
457
|
/** Override the category → icon mapping (keyword → React component) */
|
|
456
458
|
categoryIcons?: Record<string, typeof Scissors>;
|
|
@@ -459,7 +461,6 @@ interface BookingWidgetProps {
|
|
|
459
461
|
/**
|
|
460
462
|
* Link component for mobile nav. Defaults to a plain `<a>` tag.
|
|
461
463
|
* Next.js sites should pass `Link` from `next/link` for client-side navigation.
|
|
462
|
-
* @deprecated Use `mobileHeader` instead.
|
|
463
464
|
*/
|
|
464
465
|
linkComponent?: ComponentType<{
|
|
465
466
|
href: string;
|
|
@@ -467,14 +468,8 @@ interface BookingWidgetProps {
|
|
|
467
468
|
onClick?: () => void;
|
|
468
469
|
children: ReactNode;
|
|
469
470
|
}>;
|
|
470
|
-
/**
|
|
471
|
-
* Site's mobile header/navbar component. Rendered inside the widget on mobile,
|
|
472
|
-
* replacing the built-in hamburger menu. Pass your SiteHeader component here
|
|
473
|
-
* so the booking widget uses the same navigation design as the rest of the site.
|
|
474
|
-
*/
|
|
475
|
-
mobileHeader?: ReactNode;
|
|
476
471
|
}
|
|
477
|
-
declare function BookingWidgetPanel({ navLinks, menuIcon, closeIcon, categoryIcons, stepTitles, linkComponent: LinkComp,
|
|
472
|
+
declare function BookingWidgetPanel({ mobileHeader, navLinks, menuIcon, closeIcon, categoryIcons, stepTitles, linkComponent: LinkComp, }?: BookingWidgetProps): react_jsx_runtime.JSX.Element;
|
|
478
473
|
|
|
479
474
|
interface AvailabilityPickerProps {
|
|
480
475
|
serviceId: string;
|
package/dist/index.js
CHANGED
|
@@ -1742,13 +1742,13 @@ function DefaultLink({ href, className, onClick, children }) {
|
|
|
1742
1742
|
return /* @__PURE__ */ jsx9("a", { href, className, onClick, children });
|
|
1743
1743
|
}
|
|
1744
1744
|
function BookingWidgetPanel({
|
|
1745
|
+
mobileHeader,
|
|
1745
1746
|
navLinks = [],
|
|
1746
1747
|
menuIcon,
|
|
1747
1748
|
closeIcon,
|
|
1748
1749
|
categoryIcons,
|
|
1749
1750
|
stepTitles,
|
|
1750
|
-
linkComponent: LinkComp = DefaultLink
|
|
1751
|
-
mobileHeader
|
|
1751
|
+
linkComponent: LinkComp = DefaultLink
|
|
1752
1752
|
} = {}) {
|
|
1753
1753
|
const widgetRef = useRef3(null);
|
|
1754
1754
|
const formRef = useRef3(null);
|
|
@@ -1794,10 +1794,9 @@ function BookingWidgetPanel({
|
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
}, [bw.isAvailabilityLoading, bw.selectedService?.id, bw.availabilityByDate, bw.selectedDate]);
|
|
1797
|
-
const hasCategories = bw.categories.length >= 1;
|
|
1798
1797
|
const hasMultipleCategories = bw.categories.length > 1;
|
|
1799
1798
|
useEffect2(() => {
|
|
1800
|
-
if (
|
|
1799
|
+
if (bw.categories.length >= 1 && bw.categoryFilter === "all") {
|
|
1801
1800
|
bw.setCategoryFilter(bw.categories[0]);
|
|
1802
1801
|
}
|
|
1803
1802
|
}, [bw.categories.length]);
|
|
@@ -1813,7 +1812,7 @@ function BookingWidgetPanel({
|
|
|
1813
1812
|
const scrollbars = [];
|
|
1814
1813
|
const opts = {
|
|
1815
1814
|
damping: 0.08,
|
|
1816
|
-
continuousScrolling:
|
|
1815
|
+
continuousScrolling: false,
|
|
1817
1816
|
alwaysShowTracks: false,
|
|
1818
1817
|
plugins: {
|
|
1819
1818
|
overscroll: { effect: "bounce", damping: 0.15, maxOverscroll: 80 }
|
|
@@ -1837,20 +1836,6 @@ function BookingWidgetPanel({
|
|
|
1837
1836
|
};
|
|
1838
1837
|
}, [isReady, mobileStep]);
|
|
1839
1838
|
const initSvcScrollbar = (el) => {
|
|
1840
|
-
if (!el || typeof window !== "undefined" && window.matchMedia("(max-width: 1024px)").matches) {
|
|
1841
|
-
if (svcScrollbarRef.current) {
|
|
1842
|
-
try {
|
|
1843
|
-
svcScrollbarRef.current.destroy();
|
|
1844
|
-
} catch {
|
|
1845
|
-
}
|
|
1846
|
-
svcScrollbarRef.current = null;
|
|
1847
|
-
}
|
|
1848
|
-
return;
|
|
1849
|
-
}
|
|
1850
|
-
if (svcScrollbarRef.current && svcScrollbarRef.current.containerEl === el) {
|
|
1851
|
-
svcScrollbarRef.current.update();
|
|
1852
|
-
return;
|
|
1853
|
-
}
|
|
1854
1839
|
if (svcScrollbarRef.current) {
|
|
1855
1840
|
try {
|
|
1856
1841
|
svcScrollbarRef.current.destroy();
|
|
@@ -1858,9 +1843,10 @@ function BookingWidgetPanel({
|
|
|
1858
1843
|
}
|
|
1859
1844
|
svcScrollbarRef.current = null;
|
|
1860
1845
|
}
|
|
1846
|
+
if (!el || typeof window !== "undefined" && window.matchMedia("(max-width: 1024px)").matches) return;
|
|
1861
1847
|
svcScrollbarRef.current = Scrollbar.init(el, {
|
|
1862
1848
|
damping: 0.08,
|
|
1863
|
-
continuousScrolling:
|
|
1849
|
+
continuousScrolling: false,
|
|
1864
1850
|
alwaysShowTracks: false,
|
|
1865
1851
|
plugins: {
|
|
1866
1852
|
overscroll: { effect: "bounce", damping: 0.15, maxOverscroll: 80 }
|
|
@@ -2021,12 +2007,11 @@ function BookingWidgetPanel({
|
|
|
2021
2007
|
svc.id
|
|
2022
2008
|
);
|
|
2023
2009
|
};
|
|
2024
|
-
const useLegacyNav = !mobileHeader && navLinks.length > 0;
|
|
2025
2010
|
return /* @__PURE__ */ jsxs5("div", { className: "bw", ref: widgetRef, children: [
|
|
2026
|
-
mobileHeader
|
|
2011
|
+
mobileHeader ? /* @__PURE__ */ jsx9("div", { className: "bw-mobile-header", children: mobileHeader }) : null,
|
|
2027
2012
|
/* @__PURE__ */ jsxs5("div", { className: "bw-topbar", children: [
|
|
2028
2013
|
/* @__PURE__ */ jsx9("div", { className: "bw-dots", children: Array.from({ length: 4 }, (_, i) => /* @__PURE__ */ jsx9("div", { className: `bw-dot ${mobileStep > i ? "is-filled" : ""}` }, i)) }),
|
|
2029
|
-
|
|
2014
|
+
navLinks.length > 0 && /* @__PURE__ */ jsx9(
|
|
2030
2015
|
"button",
|
|
2031
2016
|
{
|
|
2032
2017
|
className: "bw-topbar-menu",
|
|
@@ -2036,7 +2021,7 @@ function BookingWidgetPanel({
|
|
|
2036
2021
|
}
|
|
2037
2022
|
)
|
|
2038
2023
|
] }),
|
|
2039
|
-
|
|
2024
|
+
navLinks.length > 0 && /* @__PURE__ */ jsx9(AnimatePresence, { children: navOpen && /* @__PURE__ */ jsx9(
|
|
2040
2025
|
motion.div,
|
|
2041
2026
|
{
|
|
2042
2027
|
className: "bw-nav-overlay",
|
|
@@ -2215,8 +2200,7 @@ function BookingWidgetPanel({
|
|
|
2215
2200
|
const wrap = el.querySelector(".bw-svc-scroll-wrap");
|
|
2216
2201
|
if (wrap) requestAnimationFrame(() => initSvcScrollbar(wrap));
|
|
2217
2202
|
} else {
|
|
2218
|
-
|
|
2219
|
-
if (svcScrollbarRef.current && wrap && svcScrollbarRef.current.containerEl === wrap) {
|
|
2203
|
+
if (svcScrollbarRef.current) {
|
|
2220
2204
|
svcScrollbarRef.current.scrollTo(0, 0, 0);
|
|
2221
2205
|
try {
|
|
2222
2206
|
svcScrollbarRef.current.destroy();
|