@idkwebsites/components 0.1.19 → 0.1.20

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.d.cts CHANGED
@@ -443,14 +443,14 @@ 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
- /** Navigation links shown in the mobile menu overlay. Omit to hide hamburger. */
446
+ /** Navigation links shown in the mobile menu overlay. Omit to hide hamburger. @deprecated Use `mobileHeader` instead. */
447
447
  navLinks?: {
448
448
  label: string;
449
449
  href: string;
450
450
  }[];
451
- /** Custom icon for the mobile menu open button (default: lucide Menu) */
451
+ /** Custom icon for the mobile menu open button (default: lucide Menu) @deprecated Use `mobileHeader` instead. */
452
452
  menuIcon?: ReactNode;
453
- /** Custom icon for the mobile menu close button (default: lucide X) */
453
+ /** Custom icon for the mobile menu close button (default: lucide X) @deprecated Use `mobileHeader` instead. */
454
454
  closeIcon?: ReactNode;
455
455
  /** Override the category → icon mapping (keyword → React component) */
456
456
  categoryIcons?: Record<string, typeof Scissors>;
@@ -459,6 +459,7 @@ interface BookingWidgetProps {
459
459
  /**
460
460
  * Link component for mobile nav. Defaults to a plain `<a>` tag.
461
461
  * Next.js sites should pass `Link` from `next/link` for client-side navigation.
462
+ * @deprecated Use `mobileHeader` instead.
462
463
  */
463
464
  linkComponent?: ComponentType<{
464
465
  href: string;
@@ -466,8 +467,14 @@ interface BookingWidgetProps {
466
467
  onClick?: () => void;
467
468
  children: ReactNode;
468
469
  }>;
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;
469
476
  }
470
- declare function BookingWidgetPanel({ navLinks, menuIcon, closeIcon, categoryIcons, stepTitles, linkComponent: LinkComp, }?: BookingWidgetProps): react_jsx_runtime.JSX.Element;
477
+ declare function BookingWidgetPanel({ navLinks, menuIcon, closeIcon, categoryIcons, stepTitles, linkComponent: LinkComp, mobileHeader, }?: BookingWidgetProps): react_jsx_runtime.JSX.Element;
471
478
 
472
479
  interface AvailabilityPickerProps {
473
480
  serviceId: string;
package/dist/index.d.ts CHANGED
@@ -443,14 +443,14 @@ 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
- /** Navigation links shown in the mobile menu overlay. Omit to hide hamburger. */
446
+ /** Navigation links shown in the mobile menu overlay. Omit to hide hamburger. @deprecated Use `mobileHeader` instead. */
447
447
  navLinks?: {
448
448
  label: string;
449
449
  href: string;
450
450
  }[];
451
- /** Custom icon for the mobile menu open button (default: lucide Menu) */
451
+ /** Custom icon for the mobile menu open button (default: lucide Menu) @deprecated Use `mobileHeader` instead. */
452
452
  menuIcon?: ReactNode;
453
- /** Custom icon for the mobile menu close button (default: lucide X) */
453
+ /** Custom icon for the mobile menu close button (default: lucide X) @deprecated Use `mobileHeader` instead. */
454
454
  closeIcon?: ReactNode;
455
455
  /** Override the category → icon mapping (keyword → React component) */
456
456
  categoryIcons?: Record<string, typeof Scissors>;
@@ -459,6 +459,7 @@ interface BookingWidgetProps {
459
459
  /**
460
460
  * Link component for mobile nav. Defaults to a plain `<a>` tag.
461
461
  * Next.js sites should pass `Link` from `next/link` for client-side navigation.
462
+ * @deprecated Use `mobileHeader` instead.
462
463
  */
463
464
  linkComponent?: ComponentType<{
464
465
  href: string;
@@ -466,8 +467,14 @@ interface BookingWidgetProps {
466
467
  onClick?: () => void;
467
468
  children: ReactNode;
468
469
  }>;
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;
469
476
  }
470
- declare function BookingWidgetPanel({ navLinks, menuIcon, closeIcon, categoryIcons, stepTitles, linkComponent: LinkComp, }?: BookingWidgetProps): react_jsx_runtime.JSX.Element;
477
+ declare function BookingWidgetPanel({ navLinks, menuIcon, closeIcon, categoryIcons, stepTitles, linkComponent: LinkComp, mobileHeader, }?: BookingWidgetProps): react_jsx_runtime.JSX.Element;
471
478
 
472
479
  interface AvailabilityPickerProps {
473
480
  serviceId: string;
package/dist/index.js CHANGED
@@ -1747,7 +1747,8 @@ function BookingWidgetPanel({
1747
1747
  closeIcon,
1748
1748
  categoryIcons,
1749
1749
  stepTitles,
1750
- linkComponent: LinkComp = DefaultLink
1750
+ linkComponent: LinkComp = DefaultLink,
1751
+ mobileHeader
1751
1752
  } = {}) {
1752
1753
  const widgetRef = useRef3(null);
1753
1754
  const formRef = useRef3(null);
@@ -2020,10 +2021,12 @@ function BookingWidgetPanel({
2020
2021
  svc.id
2021
2022
  );
2022
2023
  };
2024
+ const useLegacyNav = !mobileHeader && navLinks.length > 0;
2023
2025
  return /* @__PURE__ */ jsxs5("div", { className: "bw", ref: widgetRef, children: [
2026
+ mobileHeader && /* @__PURE__ */ jsx9("div", { className: "bw-mobile-header", children: mobileHeader }),
2024
2027
  /* @__PURE__ */ jsxs5("div", { className: "bw-topbar", children: [
2025
2028
  /* @__PURE__ */ jsx9("div", { className: "bw-dots", children: Array.from({ length: 4 }, (_, i) => /* @__PURE__ */ jsx9("div", { className: `bw-dot ${mobileStep > i ? "is-filled" : ""}` }, i)) }),
2026
- navLinks.length > 0 && /* @__PURE__ */ jsx9(
2029
+ useLegacyNav && /* @__PURE__ */ jsx9(
2027
2030
  "button",
2028
2031
  {
2029
2032
  className: "bw-topbar-menu",
@@ -2033,7 +2036,7 @@ function BookingWidgetPanel({
2033
2036
  }
2034
2037
  )
2035
2038
  ] }),
2036
- navLinks.length > 0 && /* @__PURE__ */ jsx9(AnimatePresence, { children: navOpen && /* @__PURE__ */ jsx9(
2039
+ useLegacyNav && /* @__PURE__ */ jsx9(AnimatePresence, { children: navOpen && /* @__PURE__ */ jsx9(
2037
2040
  motion.div,
2038
2041
  {
2039
2042
  className: "bw-nav-overlay",