@anker-in/ui 0.1.8 → 0.1.10

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.
@@ -16,6 +16,7 @@ interface DemoRoomPageData {
16
16
  * 加载失败文案
17
17
  */
18
18
  errorTitle?: string;
19
+ machine?: string;
19
20
  /**
20
21
  * 位置筛选相关文案
21
22
  */
@@ -16,6 +16,7 @@ interface DemoRoomPageData {
16
16
  * 加载失败文案
17
17
  */
18
18
  errorTitle?: string;
19
+ machine?: string;
19
20
  /**
20
21
  * 位置筛选相关文案
21
22
  */
@@ -1,62 +1,6 @@
1
- export { D as DemoRoom, b as DemoRoomPageData, a as DemoRoomProps } from './DemoRoom-Dx3PluHP.mjs';
1
+ export { D as DemoRoom, b as DemoRoomPageData, a as DemoRoomProps } from './DemoRoom-YZ2To7p9.mjs';
2
2
  import React from 'react';
3
3
 
4
- interface EventCardButton {
5
- label: string;
6
- variant?: 'primary' | 'secondary';
7
- onClick?: () => void;
8
- }
9
- interface EventCardProps extends React.HTMLAttributes<HTMLDivElement> {
10
- /**
11
- * Event title
12
- */
13
- title: string;
14
- /**
15
- * Event description
16
- */
17
- description?: string;
18
- /**
19
- * Background image URL
20
- */
21
- backgroundImage?: string;
22
- aspectRatio?: string;
23
- /**
24
- * Card variant - determines styling
25
- */
26
- variant?: 'large' | 'medium' | 'product';
27
- /**
28
- * Buttons/actions for the card
29
- */
30
- buttons?: EventCardButton[];
31
- /**
32
- * Additional subtitle (for product variant)
33
- */
34
- subtitle?: string;
35
- }
36
- declare const EventCard: React.FC<EventCardProps>;
37
-
38
- interface UpcomingEventsProps extends React.HTMLAttributes<HTMLDivElement> {
39
- /**
40
- * Section title
41
- * @default "Upcoming Events"
42
- */
43
- title?: string;
44
- /**
45
- * Array of event cards to display
46
- */
47
- events?: EventCardProps[];
48
- /**
49
- * Show "View More" button
50
- * @default true
51
- */
52
- showViewMore?: boolean;
53
- /**
54
- * Callback when "View More" is clicked
55
- */
56
- onViewMore?: () => void;
57
- }
58
- declare const UpcomingEvents: React.FC<UpcomingEventsProps>;
59
-
60
4
  interface StudioLocation {
61
5
  id: string;
62
6
  name: string;
@@ -111,6 +55,7 @@ interface StudioMapProps extends React.HTMLAttributes<HTMLDivElement> {
111
55
  loadingMap?: string;
112
56
  scheduleNow?: string;
113
57
  available?: string;
58
+ noAvailableTime?: string;
114
59
  };
115
60
  }
116
61
  declare const StudioMap: React.FC<StudioMapProps>;
@@ -155,8 +100,9 @@ interface StudioCardProps extends React.HTMLAttributes<HTMLDivElement> {
155
100
  scheduleNow?: string;
156
101
  available?: string;
157
102
  away?: string;
103
+ noAvailableTime?: string;
158
104
  };
159
105
  }
160
106
  declare const StudioCard: React.FC<StudioCardProps>;
161
107
 
162
- export { EventCard, type EventCardButton, type EventCardProps, StudioCard, type StudioCardProps, type StudioLocation, StudioMap, type StudioMapProps, UpcomingEvents, type UpcomingEventsProps };
108
+ export { StudioCard, type StudioCardProps, type StudioLocation, StudioMap, type StudioMapProps };
@@ -1,62 +1,6 @@
1
- export { D as DemoRoom, b as DemoRoomPageData, a as DemoRoomProps } from './DemoRoom-Dx3PluHP.js';
1
+ export { D as DemoRoom, b as DemoRoomPageData, a as DemoRoomProps } from './DemoRoom-YZ2To7p9.js';
2
2
  import React from 'react';
3
3
 
4
- interface EventCardButton {
5
- label: string;
6
- variant?: 'primary' | 'secondary';
7
- onClick?: () => void;
8
- }
9
- interface EventCardProps extends React.HTMLAttributes<HTMLDivElement> {
10
- /**
11
- * Event title
12
- */
13
- title: string;
14
- /**
15
- * Event description
16
- */
17
- description?: string;
18
- /**
19
- * Background image URL
20
- */
21
- backgroundImage?: string;
22
- aspectRatio?: string;
23
- /**
24
- * Card variant - determines styling
25
- */
26
- variant?: 'large' | 'medium' | 'product';
27
- /**
28
- * Buttons/actions for the card
29
- */
30
- buttons?: EventCardButton[];
31
- /**
32
- * Additional subtitle (for product variant)
33
- */
34
- subtitle?: string;
35
- }
36
- declare const EventCard: React.FC<EventCardProps>;
37
-
38
- interface UpcomingEventsProps extends React.HTMLAttributes<HTMLDivElement> {
39
- /**
40
- * Section title
41
- * @default "Upcoming Events"
42
- */
43
- title?: string;
44
- /**
45
- * Array of event cards to display
46
- */
47
- events?: EventCardProps[];
48
- /**
49
- * Show "View More" button
50
- * @default true
51
- */
52
- showViewMore?: boolean;
53
- /**
54
- * Callback when "View More" is clicked
55
- */
56
- onViewMore?: () => void;
57
- }
58
- declare const UpcomingEvents: React.FC<UpcomingEventsProps>;
59
-
60
4
  interface StudioLocation {
61
5
  id: string;
62
6
  name: string;
@@ -111,6 +55,7 @@ interface StudioMapProps extends React.HTMLAttributes<HTMLDivElement> {
111
55
  loadingMap?: string;
112
56
  scheduleNow?: string;
113
57
  available?: string;
58
+ noAvailableTime?: string;
114
59
  };
115
60
  }
116
61
  declare const StudioMap: React.FC<StudioMapProps>;
@@ -155,8 +100,9 @@ interface StudioCardProps extends React.HTMLAttributes<HTMLDivElement> {
155
100
  scheduleNow?: string;
156
101
  available?: string;
157
102
  away?: string;
103
+ noAvailableTime?: string;
158
104
  };
159
105
  }
160
106
  declare const StudioCard: React.FC<StudioCardProps>;
161
107
 
162
- export { EventCard, type EventCardButton, type EventCardProps, StudioCard, type StudioCardProps, type StudioLocation, StudioMap, type StudioMapProps, UpcomingEvents, type UpcomingEventsProps };
108
+ export { StudioCard, type StudioCardProps, type StudioLocation, StudioMap, type StudioMapProps };
package/dist/demo-room.js CHANGED
@@ -56,7 +56,10 @@ var StudioCard = ({
56
56
  "div",
57
57
  {
58
58
  ...props,
59
- className: cn("p-6 cursor-pointer transition-colors duration-200", className),
59
+ className: cn(
60
+ "p-6 cursor-pointer transition-colors duration-200",
61
+ className
62
+ ),
60
63
  style: {
61
64
  backgroundColor: isHovered ? "#f3f4f6" : "transparent",
62
65
  ...style
@@ -78,7 +81,7 @@ var StudioCard = ({
78
81
  pageData.away
79
82
  ] })
80
83
  ] }),
81
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
84
+ availableTime && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
82
85
  /* @__PURE__ */ jsxRuntime.jsxs(
83
86
  "svg",
84
87
  {
@@ -132,7 +135,7 @@ var StudioCard = ({
132
135
  }
133
136
  ),
134
137
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600", children: [
135
- pageData.available,
138
+ availableTime === pageData.noAvailableTime ? "" : pageData.available,
136
139
  " ",
137
140
  availableTime
138
141
  ] }) })
@@ -341,18 +344,22 @@ var StudioMap = ({
341
344
  validLocations.forEach((location) => {
342
345
  const lat = Number(location.lat);
343
346
  const lng = Number(location.lng);
347
+ const svgIcon = {
348
+ url: `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(`
349
+ <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
350
+ <circle cx="24" cy="24" r="22" fill="#00000010"/>
351
+ <circle cx="24" cy="24" r="10" fill="#000000"/>
352
+ <circle cx="24" cy="24" r="5" fill="#3ADB67"/>
353
+ </svg>
354
+ `)}`,
355
+ scaledSize: { width: 48, height: 48 },
356
+ anchor: { x: 24, y: 24 }
357
+ };
344
358
  const marker = new google.maps.Marker({
345
359
  position: { lat, lng },
346
360
  map: googleMapRef.current,
347
361
  title: location.name,
348
- icon: {
349
- path: google.maps.SymbolPath.CIRCLE,
350
- scale: 10,
351
- fillColor: "#000000",
352
- fillOpacity: 1,
353
- strokeColor: "#ffffff",
354
- strokeWeight: 2
355
- }
362
+ icon: svgIcon
356
363
  });
357
364
  marker.addListener("click", () => {
358
365
  setSelectedLocation(location);
@@ -363,7 +370,7 @@ var StudioMap = ({
363
370
  <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
364
371
  <path d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"/>
365
372
  </svg>
366
- <span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
373
+ <span style="vertical-align: middle;"> ${location.availableTime === pageData?.noAvailableTime ? "" : pageData.available} ${location.availableTime}</span>
367
374
  </div>` : ""}
368
375
  <div style="margin-bottom: 8px; color: #666;">
369
376
  <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
@@ -868,6 +875,7 @@ var defaultPageData = {
868
875
  title: "Find a Studio Near You",
869
876
  loadingText: "Loading demo rooms...",
870
877
  errorTitle: "Failed to load demo rooms",
878
+ machine: "eufymake E1",
871
879
  locationFilter: {
872
880
  allLocations: "All Locations",
873
881
  clear: "Clear",
@@ -1050,13 +1058,13 @@ var RoomsList = ({
1050
1058
  state,
1051
1059
  zipCode: "",
1052
1060
  country,
1053
- lat: Number(room.latitude) || 34.0522,
1054
- lng: Number(room.longitude) || -118.2437,
1061
+ lat: Number(room.latitude) || 0,
1062
+ lng: Number(room.longitude) || 0,
1055
1063
  availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : mergedPageData.noAvailableTime,
1056
1064
  euifyMakeModel: room?.description
1057
1065
  };
1058
1066
  });
1059
- }, [demoRooms]);
1067
+ }, [demoRooms, mergedPageData.defaultCountry, mergedPageData.noAvailableTime]);
1060
1068
  const filteredStudioLocations = React2.useMemo(() => {
1061
1069
  if (!selectedLocation) return studioLocations;
1062
1070
  return studioLocations.filter((location) => {
@@ -1138,7 +1146,7 @@ var RoomsList = ({
1138
1146
  }
1139
1147
  ),
1140
1148
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex text-[#767880] cursor-not-allowed", children: [
1141
- "eufymake E1",
1149
+ mergedPageData.machine,
1142
1150
  /* @__PURE__ */ jsxRuntime.jsx(
1143
1151
  "svg",
1144
1152
  {
@@ -1178,7 +1186,10 @@ var RoomsList = ({
1178
1186
  onSchedule,
1179
1187
  onMouseEnter: () => setHoveredRoomId(item.id),
1180
1188
  onMouseLeave: () => setHoveredRoomId(null),
1181
- pageData: mergedPageData.studioCard
1189
+ pageData: {
1190
+ ...mergedPageData.studioCard,
1191
+ noAvailableTime: mergedPageData?.noAvailableTime
1192
+ }
1182
1193
  },
1183
1194
  item.id
1184
1195
  );
@@ -1211,7 +1222,10 @@ var RoomsList = ({
1211
1222
  hoveredLocationId: hoveredRoomId,
1212
1223
  onSchedule,
1213
1224
  mapHeight: "794px",
1214
- pageData: mergedPageData.map
1225
+ pageData: {
1226
+ ...mergedPageData.map,
1227
+ noAvailableTime: pageData?.noAvailableTime
1228
+ }
1215
1229
  }
1216
1230
  ) })
1217
1231
  ] })
@@ -1414,211 +1428,9 @@ var DemoRoom = ({
1414
1428
  ) });
1415
1429
  };
1416
1430
  DemoRoom.displayName = "DemoRoom";
1417
- var EventCard = ({
1418
- title,
1419
- description,
1420
- backgroundImage,
1421
- aspectRatio,
1422
- variant = "medium",
1423
- buttons = [],
1424
- subtitle,
1425
- className,
1426
- ...props
1427
- }) => {
1428
- const isLarge = variant === "large";
1429
- const isMedium = variant === "medium";
1430
- const isProduct = variant === "product";
1431
- return /* @__PURE__ */ jsxRuntime.jsx(
1432
- "div",
1433
- {
1434
- className: cn("rounded-3xl overflow-hidden relative", className),
1435
- style: {
1436
- backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
1437
- backgroundSize: "cover",
1438
- backgroundPosition: "center",
1439
- aspectRatio
1440
- },
1441
- ...props,
1442
- children: /* @__PURE__ */ jsxRuntime.jsxs(
1443
- "div",
1444
- {
1445
- className: cn(
1446
- "relative h-full flex flex-col",
1447
- isLarge && "justify-center pl-8",
1448
- !isLarge && "justify-end pl-8 pb-8"
1449
- ),
1450
- children: [
1451
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1452
- /* @__PURE__ */ jsxRuntime.jsx(
1453
- "h3",
1454
- {
1455
- className: cn(
1456
- "font-semibold mb-3",
1457
- isLarge && "text-3xl text-gray-900",
1458
- isMedium && "text-2xl text-white",
1459
- isProduct && "text-2xl text-gray-900"
1460
- ),
1461
- children: title
1462
- }
1463
- ),
1464
- subtitle && isProduct && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 mb-4", children: subtitle }),
1465
- description && /* @__PURE__ */ jsxRuntime.jsx(
1466
- "p",
1467
- {
1468
- className: cn(
1469
- "text-sm leading-relaxed",
1470
- isMedium && "text-white/90",
1471
- (isLarge || isProduct) && "text-gray-600"
1472
- ),
1473
- children: description
1474
- }
1475
- )
1476
- ] }),
1477
- buttons.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-3 mt-6", children: buttons.map((button, index) => /* @__PURE__ */ jsxRuntime.jsx(
1478
- "button",
1479
- {
1480
- onClick: button.onClick,
1481
- className: cn(
1482
- "px-6 py-3 rounded-full font-medium text-sm transition-all duration-200",
1483
- button.variant === "primary" && "bg-gray-900 text-white hover:bg-gray-800",
1484
- button.variant === "secondary" && "bg-white text-gray-900 border border-gray-300 hover:bg-gray-50"
1485
- ),
1486
- children: button.label
1487
- },
1488
- index
1489
- )) })
1490
- ]
1491
- }
1492
- )
1493
- }
1494
- );
1495
- };
1496
- EventCard.displayName = "EventCard";
1497
- var defaultEvents = [
1498
- {
1499
- variant: "large",
1500
- title: "IFA 2025 Event Name Event Name",
1501
- description: "Corem ipsum dolor sit amet, consectetur adipiscing elit.",
1502
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1503
- buttons: [
1504
- {
1505
- label: "Schedule Now",
1506
- variant: "primary"
1507
- }
1508
- ],
1509
- aspectRatio: "1664 / 640"
1510
- },
1511
- {
1512
- variant: "medium",
1513
- title: "Local Event Name Local Event Name Local Event Name",
1514
- description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
1515
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1516
- buttons: [
1517
- {
1518
- label: "Schedule Now",
1519
- variant: "primary"
1520
- }
1521
- ],
1522
- aspectRatio: "824 / 640"
1523
- },
1524
- {
1525
- variant: "product",
1526
- title: "Anker Prime",
1527
- subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
1528
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1529
- buttons: [
1530
- {
1531
- label: "Learn More",
1532
- variant: "secondary"
1533
- },
1534
- {
1535
- label: "Shop Now",
1536
- variant: "primary"
1537
- }
1538
- ],
1539
- aspectRatio: "824 / 640"
1540
- },
1541
- {
1542
- variant: "medium",
1543
- title: "Local Event Name Local Event Name Local Event Name",
1544
- description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
1545
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1546
- buttons: [
1547
- {
1548
- label: "Schedule Now",
1549
- variant: "primary"
1550
- }
1551
- ],
1552
- aspectRatio: "824 / 640"
1553
- },
1554
- {
1555
- variant: "product",
1556
- title: "Anker Prime",
1557
- subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
1558
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1559
- buttons: [
1560
- {
1561
- label: "Learn More",
1562
- variant: "secondary"
1563
- },
1564
- {
1565
- label: "Shop Now",
1566
- variant: "primary"
1567
- }
1568
- ],
1569
- aspectRatio: "824 / 640"
1570
- }
1571
- ];
1572
- var UpcomingEvents = ({
1573
- title = "Upcoming Events",
1574
- events = defaultEvents,
1575
- showViewMore = true,
1576
- onViewMore,
1577
- className,
1578
- ...props
1579
- }) => {
1580
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), ...props, children: [
1581
- /* @__PURE__ */ jsxRuntime.jsx(Title, { title }),
1582
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-6 mb-[64px]", children: events.map((event, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(index === 0 ? "col-span-2" : ""), children: /* @__PURE__ */ jsxRuntime.jsx(EventCard, { ...event }) }, index)) }),
1583
- showViewMore && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
1584
- "button",
1585
- {
1586
- onClick: onViewMore,
1587
- className: "inline-flex items-center gap-2 text-gray-700 hover:text-gray-900 transition-colors duration-200",
1588
- children: [
1589
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold", children: "View More" }),
1590
- /* @__PURE__ */ jsxRuntime.jsx(
1591
- "svg",
1592
- {
1593
- width: "16",
1594
- height: "16",
1595
- viewBox: "0 0 16 16",
1596
- fill: "none",
1597
- xmlns: "http://www.w3.org/2000/svg",
1598
- className: "transition-transform duration-200 group-hover:translate-y-0.5",
1599
- children: /* @__PURE__ */ jsxRuntime.jsx(
1600
- "path",
1601
- {
1602
- d: "M8 3L8 13M8 13L12 9M8 13L4 9",
1603
- stroke: "currentColor",
1604
- strokeWidth: "2",
1605
- strokeLinecap: "round",
1606
- strokeLinejoin: "round"
1607
- }
1608
- )
1609
- }
1610
- )
1611
- ]
1612
- }
1613
- ) })
1614
- ] });
1615
- };
1616
- UpcomingEvents.displayName = "UpcomingEvents";
1617
1431
 
1618
1432
  exports.DemoRoom = DemoRoom;
1619
- exports.EventCard = EventCard;
1620
1433
  exports.StudioCard = StudioCard;
1621
1434
  exports.StudioMap = StudioMap;
1622
- exports.UpcomingEvents = UpcomingEvents;
1623
1435
  //# sourceMappingURL=demo-room.js.map
1624
1436
  //# sourceMappingURL=demo-room.js.map