@anker-in/ui 0.3.5 → 0.3.7

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.mjs CHANGED
@@ -1824,7 +1824,7 @@ var Title2 = ({
1824
1824
  title = "",
1825
1825
  ...props
1826
1826
  }) => {
1827
- return /* @__PURE__ */ jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsx("h2", { className: "text-[32px] min-l:text-[48px] font-bold mb-12 text-[#080A0F]", children: title }) });
1827
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsx("h2", { className: "text-[32px] min-l:text-[48px] font-bold mb-6 text-[#080A0F]", children: title }) });
1828
1828
  };
1829
1829
  Title2.displayName = "Title";
1830
1830
  var StudioCard2 = ({
@@ -2424,9 +2424,6 @@ function groupByAlphabet2(items) {
2424
2424
  items: items2.sort((a, b) => a.name.localeCompare(b.name))
2425
2425
  }));
2426
2426
  }
2427
-
2428
- // src/components/DemoRoomO2O/components/RoomsList.module.css
2429
- var RoomsList_default2 = {};
2430
2427
  var LocationFilter2 = ({
2431
2428
  locations,
2432
2429
  onSelect,
@@ -2567,8 +2564,7 @@ var LocationFilter2 = ({
2567
2564
  {
2568
2565
  style: { height: "724px" },
2569
2566
  className: cn(
2570
- "w-full rounded-b-[12px] absolute z-40 bottom-[-2px] left-0 bg-white border border-[#E4E5E6]",
2571
- RoomsList_default2.antdMobileScope
2567
+ "w-full rounded-b-[12px] absolute z-40 bottom-[-2px] left-0 bg-white border border-[#E4E5E6]"
2572
2568
  ),
2573
2569
  children: [
2574
2570
  /* @__PURE__ */ jsx(
@@ -3233,7 +3229,7 @@ var RoomsList2 = ({
3233
3229
  }
3234
3230
  ) })
3235
3231
  ] }),
3236
- !!mergedPageData?.note && /* @__PURE__ */ jsx("div", { children: mergedPageData?.note })
3232
+ !!mergedPageData?.note && /* @__PURE__ */ jsx("div", { className: "mt-[32px] xl:mt-[16px]", children: mergedPageData?.note })
3237
3233
  ] });
3238
3234
  };
3239
3235
  RoomsList2.displayName = "RoomsList";
@@ -11320,7 +11316,7 @@ var QuestionnaireForm2 = ({
11320
11316
  }
11321
11317
  };
11322
11318
  return /* @__PURE__ */ jsxs("div", { className: "pb-[80px] light", children: [
11323
- visibleQuestions && visibleQuestions.length > 0 && /* @__PURE__ */ jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8 dark:bg-white dark:border-[#E4E5E6] l:p-4", children: /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: visibleQuestions.map((question) => {
11319
+ visibleQuestions && visibleQuestions.length > 0 && /* @__PURE__ */ jsx("div", { className: "bg-white rounded-[12px] p-8 dark:bg-white l:p-4", children: /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: visibleQuestions.map((question) => {
11324
11320
  const questionId = getQuestionId(question);
11325
11321
  const hasError = !!errors[questionId];
11326
11322
  return /* @__PURE__ */ jsxs(
@@ -11435,8 +11431,12 @@ var DateTimePicker2 = ({
11435
11431
  podDesignId
11436
11432
  }) => {
11437
11433
  const { token: themeToken } = theme.useToken();
11438
- const [selectedDate, setSelectedDate] = useState(() => booking ? dayjs4(booking.booking_date) : null);
11439
- const [calendarValue, setCalendarValue] = useState(() => booking ? dayjs4(booking.booking_date) : dayjs4());
11434
+ const [selectedDate, setSelectedDate] = useState(
11435
+ () => booking ? dayjs4(booking.booking_date) : null
11436
+ );
11437
+ const [calendarValue, setCalendarValue] = useState(
11438
+ () => booking ? dayjs4(booking.booking_date) : dayjs4()
11439
+ );
11440
11440
  const [selectedTimeslotId, setSelectedTimeslotId] = useState(
11441
11441
  null
11442
11442
  );
@@ -11457,15 +11457,9 @@ var DateTimePicker2 = ({
11457
11457
  error: editError
11458
11458
  } = useEditBooking(apiClient);
11459
11459
  const isManagedByParent = demoRoomLoading !== void 0;
11460
- const {
11461
- data: fetchedDemoRoom,
11462
- loading: fetchedDemoRoomLoading
11463
- } = useDemoRoom(
11464
- apiClient,
11465
- demoRoomCode || "",
11466
- locale,
11467
- { enabled: !isManagedByParent && !demoRoomProp && !!demoRoomCode }
11468
- );
11460
+ const { data: fetchedDemoRoom, loading: fetchedDemoRoomLoading } = useDemoRoom(apiClient, demoRoomCode || "", locale, {
11461
+ enabled: !isManagedByParent && !demoRoomProp && !!demoRoomCode
11462
+ });
11469
11463
  const demoRoom = demoRoomProp ?? fetchedDemoRoom;
11470
11464
  const effectiveDemoRoomLoading = !demoRoom && !!(isManagedByParent ? demoRoomLoading : fetchedDemoRoomLoading);
11471
11465
  const isPodPurpose = selectedPurposeType === "pod";
@@ -11535,9 +11529,16 @@ var DateTimePicker2 = ({
11535
11529
  setCalendarValue(nearestDate);
11536
11530
  setSelectedTimeslotId(nearestSlot.id);
11537
11531
  setIsInitialized(true);
11538
- }, [booking, isInitialized, demoRoom?.timeslots, demoRoom?.timezone, timezone5]);
11532
+ }, [
11533
+ booking,
11534
+ isInitialized,
11535
+ demoRoom?.timeslots,
11536
+ demoRoom?.timezone,
11537
+ timezone5
11538
+ ]);
11539
11539
  useEffect(() => {
11540
- if (!timeslotsData?.timeslots || isInitialized || autoSelectLockRef.current) return;
11540
+ if (!timeslotsData?.timeslots || isInitialized || autoSelectLockRef.current)
11541
+ return;
11541
11542
  const tz = demoRoom?.timezone || timezone5;
11542
11543
  const now2 = tz ? dayjs4().tz(tz) : dayjs4();
11543
11544
  const availableTimeslots = timeslotsData.timeslots.filter((slot) => {
@@ -11637,7 +11638,13 @@ var DateTimePicker2 = ({
11637
11638
  setSelectedTimeslotId(match.id);
11638
11639
  setHasResolvedBookingSlot(true);
11639
11640
  }
11640
- }, [booking, dayTimeslots, hasResolvedBookingSlot, demoRoom?.timezone, timezone5]);
11641
+ }, [
11642
+ booking,
11643
+ dayTimeslots,
11644
+ hasResolvedBookingSlot,
11645
+ demoRoom?.timezone,
11646
+ timezone5
11647
+ ]);
11641
11648
  const initialResponses = useMemo(() => {
11642
11649
  if (!booking) return void 0;
11643
11650
  return {
@@ -11658,7 +11665,6 @@ var DateTimePicker2 = ({
11658
11665
  borderRadius: 16
11659
11666
  };
11660
11667
  return /* @__PURE__ */ jsxs("div", { children: [
11661
- /* @__PURE__ */ jsx("div", { className: "text-[48px] l:text-[32px] py-[64px] l:py-[24px] l:pt-[64px] font-bold text-center", children: pageData?.scheduleYourVisit }),
11662
11668
  /* @__PURE__ */ jsxs("div", { className: "flex gap-4 l:flex-col", children: [
11663
11669
  /* @__PURE__ */ jsx(
11664
11670
  ConfigProvider,
@@ -11687,6 +11693,13 @@ var DateTimePicker2 = ({
11687
11693
  overflow: hidden;
11688
11694
  padding: 0 24px 16px 24px !important;
11689
11695
  }
11696
+ @media (max-width: 1023px) {
11697
+ .calendar-custom-cell {
11698
+ border-radius: 16px !important;
11699
+ overflow: hidden;
11700
+ padding: 0 16px 16px 16px !important;
11701
+ }
11702
+ }
11690
11703
  .calendar-custom-cell,
11691
11704
  .calendar-custom-cell *,
11692
11705
  .calendar-custom-cell .ant-picker-panel,
@@ -11955,9 +11968,9 @@ var DateTimePicker2 = ({
11955
11968
  )
11956
11969
  }
11957
11970
  ),
11958
- /* @__PURE__ */ jsxs("div", { className: "bg-white p-[24px] rounded-[16px] flex-1", children: [
11971
+ /* @__PURE__ */ jsxs("div", { className: "bg-white p-[24px] l:p-[16px] rounded-[16px] flex-1", children: [
11959
11972
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
11960
- /* @__PURE__ */ jsx("div", { className: "text-[24px] l:text-[16px]", children: pageData?.timeSlot }),
11973
+ /* @__PURE__ */ jsx("div", { className: "text-[24px] l:text-[14px]", children: pageData?.timeSlot }),
11961
11974
  /* @__PURE__ */ jsxs("div", { className: "flex text-[18px] l:text-[14px] l:gap-1 gap-2", children: [
11962
11975
  /* @__PURE__ */ jsx(
11963
11976
  "button",
@@ -12028,7 +12041,7 @@ var DateTimePicker2 = ({
12028
12041
  ] }),
12029
12042
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 mt-[40px] gap-4 l:mt-[16px] l:flex l:flex-col l:gap-2", children: timeslotsLoading ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: pageData?.loadingTimeSlots }) : timeslotsError ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-red-600 py-8", children: pageData?.failedToLoadTimeSlots }) : dayTimeslots.length === 0 ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: pageData?.noAvailableTimeSlots }) : dayTimeslots.map((slot) => {
12030
12043
  const isAvailable = slot.status === "available";
12031
- const isFull = slot.status === "full";
12044
+ slot.status === "full";
12032
12045
  const isSelected = selectedTimeslotId === slot.id;
12033
12046
  return /* @__PURE__ */ jsx(
12034
12047
  "button",
@@ -12040,24 +12053,11 @@ var DateTimePicker2 = ({
12040
12053
  }
12041
12054
  },
12042
12055
  className: `
12043
- rounded-[20px] w-full text-[18px] l:gap-2 l:text-[16px] flex items-center justify-center gap-4 h-[76px]
12056
+ rounded-[8px] w-full text-[18px] l:gap-2 l:text-[16px] flex items-center justify-center gap-4 h-[76px]
12044
12057
  border text-center transition-colors
12045
12058
  ${isSelected ? "border-[#3ADB67] bg-[#3ADB67] cursor-pointer" : isAvailable ? "border-[#E4E5E6] hover:border-[#3ADB67] hover:bg-[#3ADB67] cursor-pointer" : "border-[#E4E5E6] bg-[#F5F5F5] text-[#767880] cursor-not-allowed"}
12046
12059
  `,
12047
- children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
12048
- /* @__PURE__ */ jsx("div", { children: formatTimeslot(slot) }),
12049
- isFull && /* @__PURE__ */ jsx("div", { className: "text-[16px] l:text-[14px] text-[#767880] mt-[2px]", children: pageData?.full }),
12050
- isAvailable && !isSelected && /* @__PURE__ */ jsxs("div", { className: "text-[16px] l:text-[14px] text-[#767880] mt-1", children: [
12051
- slot.capacity - slot.booked_count,
12052
- " ",
12053
- pageData?.spotsLeft
12054
- ] }),
12055
- isAvailable && isSelected && /* @__PURE__ */ jsxs("div", { className: "text-[16px] l:text-[14px] mt-1", children: [
12056
- slot.capacity - slot.booked_count,
12057
- " ",
12058
- pageData?.spotsLeft
12059
- ] })
12060
- ] })
12060
+ children: /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ jsx("div", { children: formatTimeslot(slot) }) })
12061
12061
  },
12062
12062
  slot.id
12063
12063
  );
@@ -12068,8 +12068,16 @@ var DateTimePicker2 = ({
12068
12068
  ) })
12069
12069
  ] })
12070
12070
  ] }),
12071
- /* @__PURE__ */ jsxs("div", { className: "mt-12", children: [
12072
- !!questionnaire?.questions?.length && /* @__PURE__ */ jsx("div", { className: "text-[48px] font-bold text-center mb-8 l:mb-[24px] l:text-[32px] l:text-left", children: pageData?.fillOutForm }),
12071
+ /* @__PURE__ */ jsxs("div", { children: [
12072
+ !!questionnaire?.questions?.length && /* @__PURE__ */ jsx(
12073
+ "div",
12074
+ {
12075
+ className: cn(
12076
+ "text-[48px] l:text-[32px] pb-[24px] pt-[64px] l:pt-[32px] font-bold"
12077
+ ),
12078
+ children: pageData?.fillOutForm
12079
+ }
12080
+ ),
12073
12081
  questionnaireLoading ? /* @__PURE__ */ jsx("div", { className: "text-center text-[#767880] py-8", children: pageData?.loadingQuestionnaire }) : /* @__PURE__ */ jsx(
12074
12082
  QuestionnaireForm2,
12075
12083
  {
@@ -12410,6 +12418,7 @@ function sanitizeRedirectSource(source) {
12410
12418
  function buildMirWelcomeUrl({
12411
12419
  baseUrl,
12412
12420
  language,
12421
+ countrycode = "US",
12413
12422
  managerId,
12414
12423
  credential,
12415
12424
  currentUrl,
@@ -12420,7 +12429,7 @@ function buildMirWelcomeUrl({
12420
12429
  if (language) {
12421
12430
  url.searchParams.set("language", language);
12422
12431
  }
12423
- url.searchParams.set("countrycode", "US");
12432
+ url.searchParams.set("countrycode", countrycode);
12424
12433
  url.searchParams.set(managerIdParam, managerId);
12425
12434
  url.searchParams.set(credentialParam, credential);
12426
12435
  const redirectSource = sanitizeRedirectSource(
@@ -12486,12 +12495,12 @@ var normalizePurposeData = (purposeData) => {
12486
12495
  return normalizePurposeSource(purposeData);
12487
12496
  };
12488
12497
  var filterPurposeOptionsByBusinessTypes = (purposeOptions, businessTypes) => {
12489
- if (!businessTypes?.length) return purposeOptions;
12498
+ if (!businessTypes?.length) return [];
12490
12499
  const allowedTypes = new Set(businessTypes);
12491
12500
  const filtered = purposeOptions.filter(
12492
12501
  (item) => !!item.type && allowedTypes.has(item.type)
12493
12502
  );
12494
- return filtered.length ? filtered : purposeOptions;
12503
+ return filtered.length ? filtered : [];
12495
12504
  };
12496
12505
  var getPurposeLabel = (pageData) => {
12497
12506
  const purposeData = pageData?.purposeData;
@@ -12561,7 +12570,7 @@ var BookingFormO2O = ({
12561
12570
  return purposeOptions[0]?.type || "";
12562
12571
  });
12563
12572
  const resolvedFromExplicitSource = !!initialBusinessType && purposeOptions.some((item) => item.type === initialBusinessType) || !!booking?.business_type && purposeOptions.some((item) => item.type === booking.business_type);
12564
- if (resolvedFromExplicitSource) {
12573
+ if (resolvedFromExplicitSource || purposeOptions.length > 0) {
12565
12574
  setIsPurposeConfirmed(true);
12566
12575
  }
12567
12576
  }, [purposeOptions, initialBusinessType, booking?.business_type]);
@@ -12604,7 +12613,8 @@ var BookingFormO2O = ({
12604
12613
  }
12605
12614
  return buildMirWelcomeUrl({
12606
12615
  baseUrl: editBaseUrl,
12607
- language: apiConfig.locale,
12616
+ language: apiConfig?.podLanguage,
12617
+ countrycode: apiConfig?.podCountry,
12608
12618
  managerId: effectiveStoreManagerId,
12609
12619
  credential: effectiveMirSessionId,
12610
12620
  managerIdParam: "store_manager_id",
@@ -12616,17 +12626,20 @@ var BookingFormO2O = ({
12616
12626
  if (!baseUrl) return void 0;
12617
12627
  return buildMirWelcomeUrl({
12618
12628
  baseUrl,
12619
- language: apiConfig.locale,
12629
+ language: apiConfig?.podLanguage,
12630
+ countrycode: apiConfig?.podCountry,
12620
12631
  managerId,
12621
12632
  credential: mirCredential
12622
12633
  });
12623
12634
  }, [
12624
- selectedPodContent,
12625
- apiConfig.locale,
12626
- managerId,
12627
12635
  isPodButtonDisabled,
12628
- mirCredential,
12629
12636
  isPodDesignEditMode,
12637
+ managerId,
12638
+ selectedPodContent?.buttonLink,
12639
+ selectedPodContent?.buttonEditLink,
12640
+ apiConfig?.podLanguage,
12641
+ apiConfig?.podCountry,
12642
+ mirCredential,
12630
12643
  effectiveStoreManagerId,
12631
12644
  effectiveMirSessionId
12632
12645
  ]);
@@ -12638,7 +12651,7 @@ var BookingFormO2O = ({
12638
12651
  [pageData?.dateTimePicker, pageData?.questionnaireForm]
12639
12652
  );
12640
12653
  return /* @__PURE__ */ jsxs("div", { children: [
12641
- /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsx(
12654
+ !token && /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsx(
12642
12655
  DemoRoomDetail2,
12643
12656
  {
12644
12657
  className: cn("min-l:mt-8", layoutClassName),
@@ -12651,7 +12664,17 @@ var BookingFormO2O = ({
12651
12664
  }
12652
12665
  ) }),
12653
12666
  /* @__PURE__ */ jsxs("div", { className: "bg-[#f5f5f5]", children: [
12654
- !!purposeOptions.length && /* @__PURE__ */ jsx("div", { className: cn("py-[40px] l:py-[24px]", className), children: /* @__PURE__ */ jsxs(
12667
+ /* @__PURE__ */ jsx(
12668
+ "div",
12669
+ {
12670
+ className: cn(
12671
+ "text-[48px] l:text-[32px] pb-[24px] pt-[128px] l:pt-[64px] font-bold",
12672
+ className
12673
+ ),
12674
+ children: dateTimePickerPageData?.scheduleYourVisit
12675
+ }
12676
+ ),
12677
+ !!purposeOptions.length && /* @__PURE__ */ jsx("div", { className: cn("pb-[40px] l:pb-[24px]", className), children: /* @__PURE__ */ jsxs(
12655
12678
  "div",
12656
12679
  {
12657
12680
  className: cn(
@@ -12705,7 +12728,7 @@ var BookingFormO2O = ({
12705
12728
  {
12706
12729
  src: selectedPodImage,
12707
12730
  alt: selectedPodContent.imageAlt || selectedPodContent.title || "",
12708
- className: "mt-[12px] h-[220px] rounded-[8px] object-cover l:h-auto"
12731
+ className: "mt-[12px] h-[220px] rounded-[8px] object-cover max-h-[360px]"
12709
12732
  }
12710
12733
  ),
12711
12734
  !!selectedPodButtonText && (booking?.print_status === "unprinted" && booking?.design_project_id || !token) && /* @__PURE__ */ jsxs(
@@ -13123,7 +13146,7 @@ var BookingSuccessO2O = ({
13123
13146
  " ",
13124
13147
  podDesignName
13125
13148
  ] }),
13126
- bookingData?.status && pageData.podData?.status?.[bookingData.status] && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-[#4A4C56]", children: pageData.podData.status[bookingData.status] })
13149
+ bookingData?.print_status && pageData.podData?.status?.[bookingData.print_status] && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-[#4A4C56]", children: pageData.podData.status[bookingData.print_status] })
13127
13150
  ] }),
13128
13151
  podDesignImage && /* @__PURE__ */ jsx(
13129
13152
  Image,
@@ -13175,7 +13198,7 @@ var BookingSuccessO2O = ({
13175
13198
  ]
13176
13199
  }
13177
13200
  ),
13178
- isPending && /* @__PURE__ */ jsxs("div", { className: "mt-[64px] pb-4 print:hidden", children: [
13201
+ isPending && !isCancelled && !isStore && /* @__PURE__ */ jsxs("div", { className: "mt-[64px] pb-4 print:hidden", children: [
13179
13202
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs("div", { className: "flex md:w-full gap-4 md:flex-col md:items-center md:justify-center", children: [
13180
13203
  onEditBooking && token && /* @__PURE__ */ jsx(
13181
13204
  "button",