@anker-in/ui 0.3.8 → 0.3.9

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
@@ -12547,20 +12547,63 @@ function buildMirWelcomeUrl({
12547
12547
  url.searchParams.set("redirect_url", encodeURIComponent(redirectSource));
12548
12548
  return url.toString();
12549
12549
  }
12550
- var ChevronIcon2 = () => /* @__PURE__ */ jsx(
12550
+ var PurposeCheckedIcon = () => /* @__PURE__ */ jsxs(
12551
12551
  "svg",
12552
12552
  {
12553
12553
  xmlns: "http://www.w3.org/2000/svg",
12554
- width: "24",
12555
- height: "24",
12556
- viewBox: "0 0 24 24",
12554
+ width: "20",
12555
+ height: "20",
12556
+ viewBox: "0 0 20 20",
12557
12557
  fill: "none",
12558
12558
  "aria-hidden": "true",
12559
+ className: "shrink-0",
12560
+ children: [
12561
+ /* @__PURE__ */ jsx("rect", { x: "0.8", y: "0.8", width: "18.4", height: "18.4", rx: "9.2", fill: "#000F16" }),
12562
+ /* @__PURE__ */ jsx(
12563
+ "rect",
12564
+ {
12565
+ x: "0.8",
12566
+ y: "0.8",
12567
+ width: "18.4",
12568
+ height: "18.4",
12569
+ rx: "9.2",
12570
+ stroke: "#000F16",
12571
+ strokeWidth: "1.6"
12572
+ }
12573
+ ),
12574
+ /* @__PURE__ */ jsx(
12575
+ "path",
12576
+ {
12577
+ d: "M6 9.58333L8.94737 12.5L14 7.5",
12578
+ strokeWidth: "1.6",
12579
+ strokeLinecap: "round",
12580
+ strokeLinejoin: "round",
12581
+ stroke: "white"
12582
+ }
12583
+ )
12584
+ ]
12585
+ }
12586
+ );
12587
+ var PurposeRadioIcon = () => /* @__PURE__ */ jsx(
12588
+ "svg",
12589
+ {
12590
+ xmlns: "http://www.w3.org/2000/svg",
12591
+ width: "20",
12592
+ height: "20",
12593
+ viewBox: "0 0 20 20",
12594
+ fill: "none",
12595
+ "aria-hidden": "true",
12596
+ className: "shrink-0",
12559
12597
  children: /* @__PURE__ */ jsx(
12560
- "path",
12598
+ "rect",
12561
12599
  {
12562
- d: "M16.7661 9.23364C17.078 9.5455 17.0779 10.0516 16.7661 10.3635L12.5991 14.5305C12.2874 14.842 11.782 14.8418 11.4702 14.5305L7.30322 10.3635C6.99135 10.0516 6.99135 9.54552 7.30322 9.23364C7.615 8.9221 8.1203 8.92219 8.43213 9.23364L12.0347 12.8362L15.6362 9.23364C15.9481 8.92183 16.4543 8.92181 16.7661 9.23364Z",
12563
- fill: "currentColor"
12600
+ x: "0.8",
12601
+ y: "0.8",
12602
+ width: "18.4",
12603
+ height: "18.4",
12604
+ rx: "9.2",
12605
+ stroke: "currentColor",
12606
+ strokeWidth: "1.6"
12564
12607
  }
12565
12608
  )
12566
12609
  }
@@ -12794,44 +12837,91 @@ var BookingFormO2O = ({
12794
12837
  isPodSelected && "grid-cols-2"
12795
12838
  ),
12796
12839
  children: [
12797
- /* @__PURE__ */ jsxs("section", { className: "rounded-[16px] bg-white px-[28px] py-[24px] l:px-[16px] l:py-[20px]", children: [
12798
- /* @__PURE__ */ jsx(
12799
- "label",
12800
- {
12801
- htmlFor: "booking-purpose-select",
12802
- className: "block text-[16px] font-bold text-[#080A0F] l:text-[14px]",
12803
- children: getPurposeLabel(pageData)
12804
- }
12805
- ),
12806
- /* @__PURE__ */ jsxs("div", { className: "relative mt-[14px]", children: [
12807
- /* @__PURE__ */ jsx(
12808
- "select",
12809
- {
12810
- id: "booking-purpose-select",
12811
- value: selectedPurpose?.type || "",
12812
- onChange: (event2) => {
12813
- setSelectedPurposeType(event2.target.value);
12814
- setIsPurposeConfirmed(true);
12815
- },
12816
- disabled: !!token,
12817
- className: cn(
12818
- "h-[48px] w-full appearance-none rounded-[8px] border border-[#D9DCE1] bg-white px-[16px] pr-[48px] text-[16px] font-medium text-[#2A2C32] outline-none transition-colors focus:border-[#080A0F] focus:ring-2 focus:ring-[#3ADB67]/30 l:text-[14px]",
12819
- token && "pointer-events-none cursor-not-allowed opacity-50"
12820
- ),
12821
- children: purposeOptions.map((item, index) => /* @__PURE__ */ jsx(
12822
- "option",
12823
- {
12824
- value: item.type || "",
12825
- children: item.label || item.type
12826
- },
12827
- `${item.type || item.label || "purpose"}-${index}`
12828
- ))
12829
- }
12840
+ /* @__PURE__ */ jsxs(
12841
+ "section",
12842
+ {
12843
+ className: cn(
12844
+ "flex flex-col rounded-[16px] bg-white px-[32px] py-[24px] l:px-[16px] l:py-[20px]",
12845
+ // 双栏时左卡高度由右侧 POD 卡撑开(与下拉版一致),选项列表内部滚动,
12846
+ // 避免选项+说明过多把左卡撑得比右卡高;h-0 让本卡不参与 grid 行高计算
12847
+ isPodSelected && "min-l:h-0 min-l:min-h-full min-l:overflow-hidden"
12830
12848
  ),
12831
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-[14px] top-1/2 flex -translate-y-1/2 text-[#080A0F]", children: /* @__PURE__ */ jsx(ChevronIcon2, {}) })
12832
- ] }),
12833
- !!selectedPurpose?.purposeNote && /* @__PURE__ */ jsx("p", { className: "mt-[16px] max-w-[720px] text-[14px] font-medium leading-[1.35] text-[#080A0F] l:text-[13px]", children: selectedPurpose.purposeNote })
12834
- ] }),
12849
+ children: [
12850
+ /* @__PURE__ */ jsx(
12851
+ "p",
12852
+ {
12853
+ id: "booking-purpose-label",
12854
+ className: "block text-[16px] font-bold text-[#080A0F] l:text-[14px]",
12855
+ children: getPurposeLabel(pageData)
12856
+ }
12857
+ ),
12858
+ /* @__PURE__ */ jsx(
12859
+ "div",
12860
+ {
12861
+ role: "radiogroup",
12862
+ "aria-labelledby": "booking-purpose-label",
12863
+ className: cn(
12864
+ "mt-[14px] flex min-h-0 flex-col gap-[16px] overflow-y-auto pr-[4px]",
12865
+ // 仅桌面双栏时列表受右卡高度约束内部滚动;独占一行(未选 POD / 移动端)不限高
12866
+ isPodSelected && "min-l:flex-1"
12867
+ ),
12868
+ children: purposeOptions.map((item, index) => {
12869
+ const isSelected = !!item.type && selectedPurpose?.type === item.type;
12870
+ const selectItem = () => {
12871
+ if (token) return;
12872
+ setSelectedPurposeType(item.type || "");
12873
+ setIsPurposeConfirmed(true);
12874
+ };
12875
+ return /* @__PURE__ */ jsxs(
12876
+ "div",
12877
+ {
12878
+ role: "radio",
12879
+ "aria-checked": isSelected,
12880
+ tabIndex: token ? -1 : 0,
12881
+ onClick: selectItem,
12882
+ onKeyDown: (event2) => {
12883
+ if (event2.key === "Enter" || event2.key === " ") {
12884
+ event2.preventDefault();
12885
+ selectItem();
12886
+ }
12887
+ },
12888
+ className: cn(
12889
+ "shrink-0 cursor-pointer overflow-hidden rounded-[8px] bg-[#F5F6F7] outline-none",
12890
+ token && "pointer-events-none cursor-not-allowed"
12891
+ ),
12892
+ children: [
12893
+ /* @__PURE__ */ jsxs(
12894
+ "div",
12895
+ {
12896
+ className: cn(
12897
+ "group flex h-[60px] w-full items-center gap-[12px] px-[16px] text-left text-[16px] font-bold text-[#000F16] transition-[box-shadow,color] l:text-[14px]",
12898
+ isSelected ? "bg-[#93E0EC]" : "rounded-[8px] bg-white text-[#5A5E66] shadow-[inset_0_0_0_1px_#D9DCE1] hover:text-[#000F16] hover:shadow-[inset_0_0_0_1.6px_#00CBEB]"
12899
+ ),
12900
+ children: [
12901
+ /* @__PURE__ */ jsx(
12902
+ "span",
12903
+ {
12904
+ className: cn(
12905
+ !isSelected && "text-[#D9DCE1] group-hover:text-[#00CBEB]"
12906
+ ),
12907
+ children: isSelected ? /* @__PURE__ */ jsx(PurposeCheckedIcon, {}) : /* @__PURE__ */ jsx(PurposeRadioIcon, {})
12908
+ }
12909
+ ),
12910
+ item.label || item.type
12911
+ ]
12912
+ }
12913
+ ),
12914
+ !!item.purposeNote && /* @__PURE__ */ jsx("p", { className: " px-[16px] py-[8px] text-[14px] font-medium leading-[1.35] text-[#080A0F] l:text-[13px]", children: item.purposeNote })
12915
+ ]
12916
+ },
12917
+ `${item.type || item.label || "purpose"}-${index}`
12918
+ );
12919
+ })
12920
+ }
12921
+ )
12922
+ ]
12923
+ }
12924
+ ),
12835
12925
  isPodSelected && !!selectedPodContent && /* @__PURE__ */ jsxs("section", { className: "rounded-[16px] bg-white px-[28px] py-[20px] l:px-[16px] l:py-[20px]", children: [
12836
12926
  !!selectedPodContent.title && /* @__PURE__ */ jsx("h2", { className: "text-[16px] font-bold text-[#080A0F] l:text-[14px]", children: selectedPodContent.title }),
12837
12927
  !!selectedPodDescription && /* @__PURE__ */ jsx("p", { className: "mt-[6px] text-[13px] font-medium leading-[1.35] text-[#080A0F] l:text-[12px]", children: selectedPodDescription }),