@anker-in/ui 0.1.11 → 0.1.13

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/demo-room.js CHANGED
@@ -335,12 +335,14 @@ var StudioMap = ({
335
335
  const lng = Number(location.lng);
336
336
  const svgIcon = {
337
337
  url: `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(`
338
- <svg xmlns="http://www.w3.org/2000/svg" width="34" height="44" viewBox="0 0 17 22" fill="none">
339
- <path d="M8.5 0C13.1944 0 17 3.80557 17 8.5C17 12.1044 14.94 15.4573 13.0264 17.8174C12.0543 19.0162 11.0847 20.0016 10.3584 20.6875C9.99466 21.031 9.69081 21.3018 9.47559 21.4873C9.36796 21.5801 9.28226 21.6518 9.22266 21.7012C9.19285 21.7259 9.16878 21.7444 9.15234 21.7578C9.14444 21.7642 9.13843 21.7697 9.13379 21.7734C9.13156 21.7752 9.12935 21.7772 9.12793 21.7783L9.12598 21.7803H9.125C9.12232 21.7774 9.08429 21.7304 8.5 21L9.125 21.7812C8.75978 22.0734 8.24022 22.0734 7.875 21.7812L8.5 21C7.91571 21.7304 7.87768 21.7774 7.875 21.7803H7.87402L7.87207 21.7783C7.87065 21.7772 7.86844 21.7752 7.86621 21.7734C7.86157 21.7697 7.85556 21.7642 7.84766 21.7578C7.83122 21.7444 7.80715 21.7259 7.77734 21.7012C7.71774 21.6518 7.63204 21.5801 7.52441 21.4873C7.30919 21.3018 7.00534 21.031 6.6416 20.6875C5.91533 20.0016 4.94566 19.0162 3.97363 17.8174C2.06001 15.4573 0 12.1044 0 8.5C0 3.80557 3.80557 0 8.5 0ZM8.5 2C4.91013 2 2 4.91013 2 8.5C2 11.3955 3.69006 14.2928 5.52637 16.5576C6.4292 17.6711 7.33473 18.5922 8.01465 19.2344C8.19381 19.4036 8.3573 19.5526 8.5 19.6807C8.6427 19.5526 8.80619 19.4036 8.98535 19.2344C9.66527 18.5922 10.5708 17.6711 11.4736 16.5576C13.3099 14.2928 15 11.3955 15 8.5C15 4.91013 12.0899 2 8.5 2ZM8.5 4.59961C10.6539 4.59961 12.4004 6.34609 12.4004 8.5C12.4004 10.6539 10.6539 12.4004 8.5 12.4004C6.34609 12.4004 4.59961 10.6539 4.59961 8.5C4.59961 6.34609 6.34609 4.59961 8.5 4.59961ZM8.5 6.40039C7.34021 6.40039 6.40039 7.34021 6.40039 8.5C6.40039 9.65979 7.34021 10.5996 8.5 10.5996C9.65979 10.5996 10.5996 9.65979 10.5996 8.5C10.5996 7.34021 9.65979 6.40039 8.5 6.40039Z" fill="#3D3D3F"/>
338
+ <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
339
+ <circle cx="24" cy="24" r="22" fill="#00000010"/>
340
+ <circle cx="24" cy="24" r="10" fill="#000000"/>
341
+ <circle cx="24" cy="24" r="5" fill="#3ADB67"/>
340
342
  </svg>
341
343
  `)}`,
342
- scaledSize: { width: 34, height: 44 },
343
- anchor: { x: 17, y: 44 }
344
+ scaledSize: { width: 48, height: 48 },
345
+ anchor: { x: 24, y: 24 }
344
346
  };
345
347
  const marker = new google.maps.Marker({
346
348
  position: { lat, lng },
@@ -528,7 +530,7 @@ var StudioMap = ({
528
530
  "div",
529
531
  {
530
532
  className: cn(
531
- "flex items-center justify-center bg-gray-100 rounded-lg",
533
+ "flex items-center overflow-hidden justify-center bg-gray-100 rounded-[16px]",
532
534
  className
533
535
  ),
534
536
  style: { height: mapHeight },
@@ -540,7 +542,7 @@ var StudioMap = ({
540
542
  return /* @__PURE__ */ jsxRuntime.jsxs(
541
543
  "div",
542
544
  {
543
- className: cn("relative w-full rounded-lg overflow-hidden", className),
545
+ className: cn("relative w-full rounded-[16px] overflow-hidden", className),
544
546
  ...props,
545
547
  children: [
546
548
  /* @__PURE__ */ jsxRuntime.jsx("div", { ref: mapRef, style: { height: mapHeight } }),
@@ -749,6 +751,29 @@ var LocationFilter = ({
749
751
  );
750
752
  const showIndexBar = filteredItems.length >= 10;
751
753
  const handleItemClick = (item) => {
754
+ if (item.code === "__all__") {
755
+ if (currentLevel === "country") {
756
+ onSelect?.({
757
+ level: "country"
758
+ });
759
+ onClose?.();
760
+ } else if (currentLevel === "state") {
761
+ onSelect?.({
762
+ level: "state",
763
+ country: selectedCountry
764
+ });
765
+ onClose?.();
766
+ } else if (currentLevel === "city") {
767
+ const parts = selectedState?.split("/") || [];
768
+ onSelect?.({
769
+ level: "city",
770
+ country: parts[0],
771
+ state: parts[1]
772
+ });
773
+ onClose?.();
774
+ }
775
+ return;
776
+ }
752
777
  if (currentLevel === "country") {
753
778
  setSelectedCountry(item.code);
754
779
  setCurrentLevel("state");
@@ -779,87 +804,94 @@ var LocationFilter = ({
779
804
  return /* @__PURE__ */ jsxRuntime.jsxs(
780
805
  "div",
781
806
  {
782
- style: { height: "794px" },
807
+ style: { height: "724px" },
783
808
  className: cn(
784
- "w-full rounded-[12px] absolute z-10 top-0 left-0 bg-white border border-[#E4E5E6]",
809
+ "w-full rounded-b-[12px] absolute z-10 bottom-[-2px] left-0 bg-white border border-[#E4E5E6]",
785
810
  RoomsList_default.antdMobileScope
786
811
  ),
787
812
  children: [
788
- /* @__PURE__ */ jsxRuntime.jsxs(
813
+ /* @__PURE__ */ jsxRuntime.jsx(
789
814
  "div",
790
815
  {
791
816
  style: { background: "#F8F8F8" },
792
- className: "rounded-[12px] rounded-b-none h-[108px] font-bold text-[14px] flex flex-col",
793
- children: [
794
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end px-[24px] pt-[12px] pb-[8px]", children: /* @__PURE__ */ jsxRuntime.jsx(
817
+ className: "h-[76px] font-bold text-[14px] flex flex-col",
818
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center text-[16px] px-[20px] gap-[16px] py-[24px]", children: [
819
+ /* @__PURE__ */ jsxRuntime.jsx(
795
820
  "button",
796
821
  {
797
- onClick: onClose,
798
- className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-end",
799
- children: /* @__PURE__ */ jsxRuntime.jsx(
800
- "svg",
801
- {
802
- xmlns: "http://www.w3.org/2000/svg",
803
- width: "24",
804
- height: "24",
805
- viewBox: "0 0 24 24",
806
- fill: "none",
807
- children: /* @__PURE__ */ jsxRuntime.jsx(
808
- "path",
809
- {
810
- d: "M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",
811
- fill: "#1D1D1F"
812
- }
813
- )
814
- }
815
- )
822
+ onClick: () => handleTabClick("country"),
823
+ className: cn(
824
+ "pb-[4px] transition-colors",
825
+ currentLevel === "country" ? "text-[#080A0F] border-b-2 border-[#3ADB67]" : "text-[#080A0F]"
826
+ ),
827
+ children: pageData.country
816
828
  }
817
- ) }),
818
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center text-[16px] px-[20px] gap-[16px] py-[16px]", children: [
819
- /* @__PURE__ */ jsxRuntime.jsx(
820
- "button",
821
- {
822
- onClick: () => handleTabClick("country"),
823
- className: cn(
824
- "pb-[4px] transition-colors",
825
- currentLevel === "country" ? "text-[#080A0F] border-b-2 border-[#3ADB67]" : "text-[#080A0F]"
826
- ),
827
- children: pageData.country
828
- }
829
- ),
830
- /* @__PURE__ */ jsxRuntime.jsx(
831
- "button",
832
- {
833
- onClick: () => handleTabClick("state"),
834
- disabled: !selectedCountry,
835
- className: cn(
836
- "pb-[4px] transition-colors",
837
- currentLevel === "state" ? "text-[#080A0F] border-b-2 border-[#3ADB67]" : "text-[#080A0F]",
838
- !selectedCountry && "opacity-50 cursor-not-allowed"
839
- ),
840
- children: pageData.state
841
- }
842
- ),
843
- /* @__PURE__ */ jsxRuntime.jsx(
844
- "button",
845
- {
846
- onClick: () => handleTabClick("city"),
847
- disabled: !selectedState,
848
- className: cn(
849
- "pb-[4px] transition-colors",
850
- currentLevel === "city" ? "text-[#080A0F] border-b-2 border-[#3ADB67]" : "text-[#080A0F]",
851
- !selectedState && "opacity-50 cursor-not-allowed"
852
- ),
853
- children: pageData.city
854
- }
855
- )
856
- ] })
857
- ]
829
+ ),
830
+ /* @__PURE__ */ jsxRuntime.jsx(
831
+ "button",
832
+ {
833
+ onClick: () => handleTabClick("state"),
834
+ disabled: !selectedCountry,
835
+ className: cn(
836
+ "pb-[4px] transition-colors",
837
+ currentLevel === "state" ? "text-[#080A0F] border-b-2 border-[#3ADB67]" : "text-[#080A0F]",
838
+ !selectedCountry && "opacity-50 cursor-not-allowed"
839
+ ),
840
+ children: pageData.state
841
+ }
842
+ ),
843
+ /* @__PURE__ */ jsxRuntime.jsx(
844
+ "button",
845
+ {
846
+ onClick: () => handleTabClick("city"),
847
+ disabled: !selectedState,
848
+ className: cn(
849
+ "pb-[4px] transition-colors",
850
+ currentLevel === "city" ? "text-[#080A0F] border-b-2 border-[#3ADB67]" : "text-[#080A0F]",
851
+ !selectedState && "opacity-50 cursor-not-allowed"
852
+ ),
853
+ children: pageData.city
854
+ }
855
+ )
856
+ ] })
858
857
  }
859
858
  ),
860
- /* @__PURE__ */ jsxRuntime.jsx(AntdMobileIsolated, { style: { height: "calc(100% - 108px)" }, children: showIndexBar ? /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default, { style: { height: "100%" }, children: groupedItems.map((group) => {
861
- const { title, items } = group;
862
- return /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default.Panel, { index: title, title, children: /* @__PURE__ */ jsxRuntime.jsx(List__default.default, { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
859
+ /* @__PURE__ */ jsxRuntime.jsx(AntdMobileIsolated, { style: { height: "calc(100% - 76px)" }, children: showIndexBar ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
860
+ /* @__PURE__ */ jsxRuntime.jsx(List__default.default, { children: /* @__PURE__ */ jsxRuntime.jsx(
861
+ List__default.default.Item,
862
+ {
863
+ onClick: () => handleItemClick({ code: "__all__", name: pageData.allLocations || "All", count: filteredItems.length }),
864
+ className: "text-[16px] !pl-[24px] font-bold",
865
+ style: { cursor: "pointer", borderBottom: "1px solid #E4E5E6" },
866
+ children: pageData.allLocations
867
+ },
868
+ "__all__"
869
+ ) }),
870
+ /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default, { style: { flex: 1 }, children: groupedItems.map((group) => {
871
+ const { title, items } = group;
872
+ return /* @__PURE__ */ jsxRuntime.jsx(IndexBar__default.default.Panel, { index: title, title, children: /* @__PURE__ */ jsxRuntime.jsx(List__default.default, { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
873
+ List__default.default.Item,
874
+ {
875
+ onClick: () => handleItemClick(item),
876
+ className: "text-[16px] !pl-[24px]",
877
+ style: { cursor: "pointer" },
878
+ children: item.name
879
+ },
880
+ item.code
881
+ )) }) }, title);
882
+ }) })
883
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsxs(List__default.default, { children: [
884
+ /* @__PURE__ */ jsxRuntime.jsx(
885
+ List__default.default.Item,
886
+ {
887
+ onClick: () => handleItemClick({ code: "__all__", name: pageData.allLocations || "All", count: filteredItems.length }),
888
+ className: "text-[16px] !pl-[24px] font-bold",
889
+ style: { cursor: "pointer", borderBottom: "1px solid #E4E5E6" },
890
+ children: pageData.allLocations
891
+ },
892
+ "__all__"
893
+ ),
894
+ filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
863
895
  List__default.default.Item,
864
896
  {
865
897
  onClick: () => handleItemClick(item),
@@ -868,17 +900,8 @@ var LocationFilter = ({
868
900
  children: item.name
869
901
  },
870
902
  item.code
871
- )) }) }, title);
872
- }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(List__default.default, { children: filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
873
- List__default.default.Item,
874
- {
875
- onClick: () => handleItemClick(item),
876
- className: "text-[16px] !pl-[24px]",
877
- style: { cursor: "pointer" },
878
- children: item.name
879
- },
880
- item.code
881
- )) }) }) })
903
+ ))
904
+ ] }) }) })
882
905
  ]
883
906
  }
884
907
  );
@@ -1104,10 +1127,6 @@ var RoomsList = ({
1104
1127
  setSelectedLocation(selection);
1105
1128
  setShowLocationFilter(false);
1106
1129
  };
1107
- const handleClearFilter = () => {
1108
- setSelectedLocation(void 0);
1109
- };
1110
- console.log(filteredStudioLocations);
1111
1130
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, ...props, children: [
1112
1131
  /* @__PURE__ */ jsxRuntime.jsx(Title, { title: mergedPageData.title }),
1113
1132
  loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: mergedPageData.loadingText }) }) }),
@@ -1122,12 +1141,15 @@ var RoomsList = ({
1122
1141
  className: "flex-none relative w-[420px] l:!w-full",
1123
1142
  style: { height: "794px" },
1124
1143
  children: [
1125
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[12px] mb-4 bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-[40px] font-bold text-[16px] gap-10 flex items-center", children: [
1144
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
1145
+ "mb-4 bg-white border border-[#E4E5E6] px-[20px] py-[16px]",
1146
+ showLocationFilter ? "rounded-t-[12px] rounded-b-none" : "rounded-[12px]"
1147
+ ), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-[40px] font-bold text-[16px] l:text-[14px] gap-10 l:gap-4 flex items-center", children: [
1126
1148
  /* @__PURE__ */ jsxRuntime.jsxs(
1127
1149
  "button",
1128
1150
  {
1129
1151
  className: "flex cursor-pointer items-center hover:text-[#3ADB67] transition-colors",
1130
- onClick: () => setShowLocationFilter(true),
1152
+ onClick: () => setShowLocationFilter(!showLocationFilter),
1131
1153
  children: [
1132
1154
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1", children: getSelectedLocationName() }),
1133
1155
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1138,6 +1160,10 @@ var RoomsList = ({
1138
1160
  height: "24",
1139
1161
  viewBox: "0 0 24 24",
1140
1162
  fill: "none",
1163
+ className: cn(
1164
+ "transition-transform duration-300",
1165
+ showLocationFilter && "rotate-180"
1166
+ ),
1141
1167
  children: /* @__PURE__ */ jsxRuntime.jsx(
1142
1168
  "path",
1143
1169
  {
@@ -1150,14 +1176,7 @@ var RoomsList = ({
1150
1176
  ]
1151
1177
  }
1152
1178
  ),
1153
- selectedLocation && /* @__PURE__ */ jsxRuntime.jsx(
1154
- "button",
1155
- {
1156
- onClick: handleClearFilter,
1157
- className: "ml-auto text-[14px] text-[#2E8B57] hover:underline",
1158
- children: mergedPageData.locationFilter.clear
1159
- }
1160
- ),
1179
+ selectedLocation && false,
1161
1180
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex text-[#767880] cursor-not-allowed", children: [
1162
1181
  mergedPageData.machine,
1163
1182
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1198,7 +1217,6 @@ var RoomsList = ({
1198
1217
  euifyMakeModel: item?.euifyMakeModel || "",
1199
1218
  onSchedule,
1200
1219
  onMouseEnter: () => setHoveredRoomId(item.id),
1201
- onMouseLeave: () => setHoveredRoomId(null),
1202
1220
  pageData: {
1203
1221
  ...mergedPageData.studioCard,
1204
1222
  noAvailableTime: mergedPageData?.noAvailableTime