@anker-in/ui 0.1.9 → 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.
@@ -1,62 +1,6 @@
1
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
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
  ] }) })
@@ -367,7 +370,7 @@ var StudioMap = ({
367
370
  <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
368
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"/>
369
372
  </svg>
370
- <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>
371
374
  </div>` : ""}
372
375
  <div style="margin-bottom: 8px; color: #666;">
373
376
  <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
@@ -1055,13 +1058,13 @@ var RoomsList = ({
1055
1058
  state,
1056
1059
  zipCode: "",
1057
1060
  country,
1058
- lat: Number(room.latitude) || 34.0522,
1059
- lng: Number(room.longitude) || -118.2437,
1061
+ lat: Number(room.latitude) || 0,
1062
+ lng: Number(room.longitude) || 0,
1060
1063
  availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : mergedPageData.noAvailableTime,
1061
1064
  euifyMakeModel: room?.description
1062
1065
  };
1063
1066
  });
1064
- }, [demoRooms]);
1067
+ }, [demoRooms, mergedPageData.defaultCountry, mergedPageData.noAvailableTime]);
1065
1068
  const filteredStudioLocations = React2.useMemo(() => {
1066
1069
  if (!selectedLocation) return studioLocations;
1067
1070
  return studioLocations.filter((location) => {
@@ -1183,7 +1186,10 @@ var RoomsList = ({
1183
1186
  onSchedule,
1184
1187
  onMouseEnter: () => setHoveredRoomId(item.id),
1185
1188
  onMouseLeave: () => setHoveredRoomId(null),
1186
- pageData: mergedPageData.studioCard
1189
+ pageData: {
1190
+ ...mergedPageData.studioCard,
1191
+ noAvailableTime: mergedPageData?.noAvailableTime
1192
+ }
1187
1193
  },
1188
1194
  item.id
1189
1195
  );
@@ -1216,7 +1222,10 @@ var RoomsList = ({
1216
1222
  hoveredLocationId: hoveredRoomId,
1217
1223
  onSchedule,
1218
1224
  mapHeight: "794px",
1219
- pageData: mergedPageData.map
1225
+ pageData: {
1226
+ ...mergedPageData.map,
1227
+ noAvailableTime: pageData?.noAvailableTime
1228
+ }
1220
1229
  }
1221
1230
  ) })
1222
1231
  ] })
@@ -1419,211 +1428,9 @@ var DemoRoom = ({
1419
1428
  ) });
1420
1429
  };
1421
1430
  DemoRoom.displayName = "DemoRoom";
1422
- var EventCard = ({
1423
- title,
1424
- description,
1425
- backgroundImage,
1426
- aspectRatio,
1427
- variant = "medium",
1428
- buttons = [],
1429
- subtitle,
1430
- className,
1431
- ...props
1432
- }) => {
1433
- const isLarge = variant === "large";
1434
- const isMedium = variant === "medium";
1435
- const isProduct = variant === "product";
1436
- return /* @__PURE__ */ jsxRuntime.jsx(
1437
- "div",
1438
- {
1439
- className: cn("rounded-3xl overflow-hidden relative", className),
1440
- style: {
1441
- backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
1442
- backgroundSize: "cover",
1443
- backgroundPosition: "center",
1444
- aspectRatio
1445
- },
1446
- ...props,
1447
- children: /* @__PURE__ */ jsxRuntime.jsxs(
1448
- "div",
1449
- {
1450
- className: cn(
1451
- "relative h-full flex flex-col",
1452
- isLarge && "justify-center pl-8",
1453
- !isLarge && "justify-end pl-8 pb-8"
1454
- ),
1455
- children: [
1456
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1457
- /* @__PURE__ */ jsxRuntime.jsx(
1458
- "h3",
1459
- {
1460
- className: cn(
1461
- "font-semibold mb-3",
1462
- isLarge && "text-3xl text-gray-900",
1463
- isMedium && "text-2xl text-white",
1464
- isProduct && "text-2xl text-gray-900"
1465
- ),
1466
- children: title
1467
- }
1468
- ),
1469
- subtitle && isProduct && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 mb-4", children: subtitle }),
1470
- description && /* @__PURE__ */ jsxRuntime.jsx(
1471
- "p",
1472
- {
1473
- className: cn(
1474
- "text-sm leading-relaxed",
1475
- isMedium && "text-white/90",
1476
- (isLarge || isProduct) && "text-gray-600"
1477
- ),
1478
- children: description
1479
- }
1480
- )
1481
- ] }),
1482
- buttons.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-3 mt-6", children: buttons.map((button, index) => /* @__PURE__ */ jsxRuntime.jsx(
1483
- "button",
1484
- {
1485
- onClick: button.onClick,
1486
- className: cn(
1487
- "px-6 py-3 rounded-full font-medium text-sm transition-all duration-200",
1488
- button.variant === "primary" && "bg-gray-900 text-white hover:bg-gray-800",
1489
- button.variant === "secondary" && "bg-white text-gray-900 border border-gray-300 hover:bg-gray-50"
1490
- ),
1491
- children: button.label
1492
- },
1493
- index
1494
- )) })
1495
- ]
1496
- }
1497
- )
1498
- }
1499
- );
1500
- };
1501
- EventCard.displayName = "EventCard";
1502
- var defaultEvents = [
1503
- {
1504
- variant: "large",
1505
- title: "IFA 2025 Event Name Event Name",
1506
- description: "Corem ipsum dolor sit amet, consectetur adipiscing elit.",
1507
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1508
- buttons: [
1509
- {
1510
- label: "Schedule Now",
1511
- variant: "primary"
1512
- }
1513
- ],
1514
- aspectRatio: "1664 / 640"
1515
- },
1516
- {
1517
- variant: "medium",
1518
- title: "Local Event Name Local Event Name Local Event Name",
1519
- description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
1520
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1521
- buttons: [
1522
- {
1523
- label: "Schedule Now",
1524
- variant: "primary"
1525
- }
1526
- ],
1527
- aspectRatio: "824 / 640"
1528
- },
1529
- {
1530
- variant: "product",
1531
- title: "Anker Prime",
1532
- subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
1533
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1534
- buttons: [
1535
- {
1536
- label: "Learn More",
1537
- variant: "secondary"
1538
- },
1539
- {
1540
- label: "Shop Now",
1541
- variant: "primary"
1542
- }
1543
- ],
1544
- aspectRatio: "824 / 640"
1545
- },
1546
- {
1547
- variant: "medium",
1548
- title: "Local Event Name Local Event Name Local Event Name",
1549
- description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
1550
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1551
- buttons: [
1552
- {
1553
- label: "Schedule Now",
1554
- variant: "primary"
1555
- }
1556
- ],
1557
- aspectRatio: "824 / 640"
1558
- },
1559
- {
1560
- variant: "product",
1561
- title: "Anker Prime",
1562
- subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
1563
- backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1564
- buttons: [
1565
- {
1566
- label: "Learn More",
1567
- variant: "secondary"
1568
- },
1569
- {
1570
- label: "Shop Now",
1571
- variant: "primary"
1572
- }
1573
- ],
1574
- aspectRatio: "824 / 640"
1575
- }
1576
- ];
1577
- var UpcomingEvents = ({
1578
- title = "Upcoming Events",
1579
- events = defaultEvents,
1580
- showViewMore = true,
1581
- onViewMore,
1582
- className,
1583
- ...props
1584
- }) => {
1585
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full", className), ...props, children: [
1586
- /* @__PURE__ */ jsxRuntime.jsx(Title, { title }),
1587
- /* @__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)) }),
1588
- showViewMore && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
1589
- "button",
1590
- {
1591
- onClick: onViewMore,
1592
- className: "inline-flex items-center gap-2 text-gray-700 hover:text-gray-900 transition-colors duration-200",
1593
- children: [
1594
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold", children: "View More" }),
1595
- /* @__PURE__ */ jsxRuntime.jsx(
1596
- "svg",
1597
- {
1598
- width: "16",
1599
- height: "16",
1600
- viewBox: "0 0 16 16",
1601
- fill: "none",
1602
- xmlns: "http://www.w3.org/2000/svg",
1603
- className: "transition-transform duration-200 group-hover:translate-y-0.5",
1604
- children: /* @__PURE__ */ jsxRuntime.jsx(
1605
- "path",
1606
- {
1607
- d: "M8 3L8 13M8 13L12 9M8 13L4 9",
1608
- stroke: "currentColor",
1609
- strokeWidth: "2",
1610
- strokeLinecap: "round",
1611
- strokeLinejoin: "round"
1612
- }
1613
- )
1614
- }
1615
- )
1616
- ]
1617
- }
1618
- ) })
1619
- ] });
1620
- };
1621
- UpcomingEvents.displayName = "UpcomingEvents";
1622
1431
 
1623
1432
  exports.DemoRoom = DemoRoom;
1624
- exports.EventCard = EventCard;
1625
1433
  exports.StudioCard = StudioCard;
1626
1434
  exports.StudioMap = StudioMap;
1627
- exports.UpcomingEvents = UpcomingEvents;
1628
1435
  //# sourceMappingURL=demo-room.js.map
1629
1436
  //# sourceMappingURL=demo-room.js.map