@agg-market/ui 0.0.6 → 2.0.0

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.
Files changed (137) hide show
  1. package/dist/badge.d.mts +5 -3
  2. package/dist/badge.d.ts +5 -3
  3. package/dist/badge.js +52 -12
  4. package/dist/badge.mjs +1 -1
  5. package/dist/button.d.mts +2 -2
  6. package/dist/button.d.ts +2 -2
  7. package/dist/button.js +19 -34
  8. package/dist/button.mjs +2 -2
  9. package/dist/card.d.mts +4 -2
  10. package/dist/card.d.ts +4 -2
  11. package/dist/card.js +8 -4
  12. package/dist/card.mjs +1 -1
  13. package/dist/chart.js +14 -7
  14. package/dist/chart.mjs +2 -2
  15. package/dist/{chunk-ZYREURXK.mjs → chunk-2MJY6RVY.mjs} +35 -35
  16. package/dist/{chunk-P23GR7NX.mjs → chunk-422MCIXV.mjs} +1 -1
  17. package/dist/chunk-4KMFDCAH.mjs +371 -0
  18. package/dist/{chunk-HM3CGN32.mjs → chunk-5GDNWQZS.mjs} +46 -46
  19. package/dist/{chunk-VIP7HSOU.mjs → chunk-5K7VXAYM.mjs} +4 -0
  20. package/dist/{chunk-BJNHDIDW.mjs → chunk-6425RRBI.mjs} +4 -4
  21. package/dist/{chunk-O2XH4A3G.mjs → chunk-7NISYVSJ.mjs} +22 -22
  22. package/dist/{chunk-MXBPDNMC.mjs → chunk-BEDUFOIG.mjs} +95 -22
  23. package/dist/{chunk-VC7LTPQD.mjs → chunk-BN5VVHNV.mjs} +2 -2
  24. package/dist/{chunk-JRS2M5GY.mjs → chunk-CTVMT3VL.mjs} +13 -6
  25. package/dist/{chunk-USLTNDJA.mjs → chunk-D5FTFSKL.mjs} +8 -8
  26. package/dist/{chunk-BLSHXIAH.mjs → chunk-D7JTOGYP.mjs} +6 -11
  27. package/dist/{chunk-W2DMBW4E.mjs → chunk-DL7STJQ5.mjs} +61 -33
  28. package/dist/chunk-ERGNR6UQ.mjs +67 -0
  29. package/dist/chunk-FO263M3V.mjs +10 -0
  30. package/dist/{chunk-3O4U3E5I.mjs → chunk-FO2QCB4Z.mjs} +8 -4
  31. package/dist/{chunk-OGI343OV.mjs → chunk-IGPNIM2B.mjs} +3 -2
  32. package/dist/chunk-K6IJ4WBM.mjs +67 -0
  33. package/dist/{chunk-PGSPYQOW.mjs → chunk-KAGYJ4XT.mjs} +17 -27
  34. package/dist/{chunk-RGZQHSNJ.mjs → chunk-KCPDVBIZ.mjs} +26 -17
  35. package/dist/{chunk-ZHKMDK5M.mjs → chunk-KFOATMAE.mjs} +87 -87
  36. package/dist/{chunk-I4YUYVJJ.mjs → chunk-LK5D3ZTK.mjs} +38 -27
  37. package/dist/{chunk-VUDJ3PYM.mjs → chunk-O46OFVH6.mjs} +40 -16
  38. package/dist/{chunk-RXACBTON.mjs → chunk-OA2IZ3VW.mjs} +16 -22
  39. package/dist/{chunk-F236MLT6.mjs → chunk-PZTHM6WG.mjs} +13 -10
  40. package/dist/{chunk-XELWY7SO.mjs → chunk-QYZKC7KG.mjs} +137 -104
  41. package/dist/{chunk-LWTQD345.mjs → chunk-S3H63TQ5.mjs} +57 -312
  42. package/dist/{chunk-MNSHWA6M.mjs → chunk-TA7LKYKP.mjs} +9 -8
  43. package/dist/{chunk-JH5VMNDL.mjs → chunk-V52WSZHQ.mjs} +8 -7
  44. package/dist/chunk-YJA5VQW6.mjs +167 -0
  45. package/dist/{chunk-EXF4SESB.mjs → chunk-ZFMCCBP6.mjs} +1 -1
  46. package/dist/connect-button.js +51 -73
  47. package/dist/connect-button.mjs +6 -6
  48. package/dist/deposit-modal.js +171 -177
  49. package/dist/deposit-modal.mjs +7 -7
  50. package/dist/event-list-item-details.js +222 -198
  51. package/dist/event-list-item-details.mjs +11 -11
  52. package/dist/event-list-item.js +172 -114
  53. package/dist/event-list-item.mjs +8 -8
  54. package/dist/event-list.js +391 -507
  55. package/dist/event-list.mjs +11 -11
  56. package/dist/event-market-page.d.mts +1 -1
  57. package/dist/event-market-page.d.ts +1 -1
  58. package/dist/event-market-page.js +826 -764
  59. package/dist/event-market-page.mjs +19 -19
  60. package/dist/hello-world.js +28 -16
  61. package/dist/hello-world.mjs +2 -2
  62. package/dist/home-page.js +395 -511
  63. package/dist/home-page.mjs +12 -12
  64. package/dist/icon.d.mts +1 -1
  65. package/dist/icon.d.ts +1 -1
  66. package/dist/icon.js +15 -17
  67. package/dist/icon.mjs +2 -2
  68. package/dist/index.d.mts +6 -6
  69. package/dist/index.d.ts +6 -6
  70. package/dist/index.js +1158 -956
  71. package/dist/index.mjs +34 -32
  72. package/dist/loading-icon.d.mts +1 -1
  73. package/dist/loading-icon.d.ts +1 -1
  74. package/dist/loading-icon.js +5 -9
  75. package/dist/loading-icon.mjs +2 -2
  76. package/dist/market-details.d.mts +2 -2
  77. package/dist/market-details.d.ts +2 -2
  78. package/dist/market-details.js +357 -551
  79. package/dist/market-details.mjs +13 -13
  80. package/dist/modal.js +4 -0
  81. package/dist/modal.mjs +1 -1
  82. package/dist/onboarding-modal.js +63 -67
  83. package/dist/onboarding-modal.mjs +6 -6
  84. package/dist/place-order.d.mts +1 -1
  85. package/dist/place-order.d.ts +1 -1
  86. package/dist/place-order.js +231 -466
  87. package/dist/place-order.mjs +9 -9
  88. package/dist/profile-modal.js +75 -77
  89. package/dist/profile-modal.mjs +6 -6
  90. package/dist/search.d.mts +2 -2
  91. package/dist/search.d.ts +2 -2
  92. package/dist/search.js +28 -34
  93. package/dist/search.mjs +4 -4
  94. package/dist/select.js +104 -99
  95. package/dist/select.mjs +3 -3
  96. package/dist/settlement.d.mts +1 -1
  97. package/dist/settlement.d.ts +1 -1
  98. package/dist/settlement.js +279 -59
  99. package/dist/settlement.mjs +6 -6
  100. package/dist/skeleton.js +15 -10
  101. package/dist/skeleton.mjs +2 -2
  102. package/dist/styles.css +1 -1
  103. package/dist/switch-button.js +13 -6
  104. package/dist/switch-button.mjs +1 -1
  105. package/dist/tabs.d.mts +8 -4
  106. package/dist/tabs.d.ts +8 -4
  107. package/dist/tabs.js +163 -420
  108. package/dist/tabs.mjs +4 -4
  109. package/dist/tailwind.css +1 -1
  110. package/dist/types-BVj9ky9P.d.mts +3 -0
  111. package/dist/types-BVj9ky9P.d.ts +3 -0
  112. package/dist/typography.d.mts +4 -2
  113. package/dist/typography.d.ts +4 -2
  114. package/dist/typography.js +49 -18
  115. package/dist/typography.mjs +5 -3
  116. package/dist/user-profile-page.d.mts +2 -2
  117. package/dist/user-profile-page.d.ts +2 -2
  118. package/dist/user-profile-page.js +200 -474
  119. package/dist/user-profile-page.mjs +7 -7
  120. package/dist/venue-logo.d.mts +2 -2
  121. package/dist/venue-logo.d.ts +2 -2
  122. package/dist/venue-logo.js +6 -11
  123. package/dist/venue-logo.mjs +1 -1
  124. package/dist/{venue-logo.types-BSAuY84j.d.ts → venue-logo.types-D8Cu2rAm.d.ts} +1 -1
  125. package/dist/{venue-logo.types-DACqcTvY.d.mts → venue-logo.types-HRf1yBLD.d.mts} +1 -1
  126. package/dist/withdraw-modal.js +72 -85
  127. package/dist/withdraw-modal.mjs +6 -6
  128. package/package.json +2 -2
  129. package/dist/chunk-AEMAY3MR.mjs +0 -44
  130. package/dist/chunk-DYEWXEEY.mjs +0 -37
  131. package/dist/chunk-QFQHD2V6.mjs +0 -146
  132. package/dist/chunk-ZDF7QP4G.mjs +0 -160
  133. package/dist/chunk-ZVBVGWSP.mjs +0 -15
  134. package/dist/types-Bed6Q0EK.d.mts +0 -3
  135. package/dist/types-Bed6Q0EK.d.ts +0 -3
  136. package/dist/{types-DkGlbmXq.d.mts → types-JBf1DZlH.d.mts} +2 -2
  137. package/dist/{types-DkGlbmXq.d.ts → types-JBf1DZlH.d.ts} +2 -2
package/dist/home-page.js CHANGED
@@ -63,14 +63,11 @@ __export(home_exports, {
63
63
  });
64
64
  module.exports = __toCommonJS(home_exports);
65
65
  var import_react5 = require("react");
66
- var import_hooks13 = require("@agg-market/hooks");
66
+ var import_hooks14 = require("@agg-market/hooks");
67
67
 
68
68
  // src/events/list/index.tsx
69
69
  var import_react4 = require("react");
70
- var import_hooks12 = require("@agg-market/hooks");
71
-
72
- // src/constants.ts
73
- var AGG_ROOT_CLASS_NAME = "agg-root";
70
+ var import_hooks13 = require("@agg-market/hooks");
74
71
 
75
72
  // src/shared/utils.ts
76
73
  var cn = (...values) => values.filter(Boolean).join(" ");
@@ -154,14 +151,10 @@ var ArrowsToDotIcon = (_a) => {
154
151
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
155
152
  "path",
156
153
  {
157
- d: "M8 2V5M8 11V14M2 8H5M11 8H14M3.76 3.76L5.9 5.9M10.1 10.1L12.24 12.24M12.24 3.76L10.1 5.9M5.9 10.1L3.76 12.24",
158
- stroke: "currentColor",
159
- strokeWidth: "1.25",
160
- strokeLinecap: "round",
161
- strokeLinejoin: "round"
154
+ d: "M8 6.66667C8.73667 6.66667 9.33333 7.26333 9.33333 8C9.33333 8.73667 8.73667 9.33333 8 9.33333C7.26333 9.33333 6.66667 8.73667 6.66667 8C6.66667 7.26333 7.26333 6.66667 8 6.66667ZM5.27867 7.05733L3.39267 5.17133C3.132 4.91067 2.71067 4.91067 2.45 5.17133C2.18933 5.432 2.18933 5.854 2.45 6.114L3.67467 7.33333H0.666667C0.298 7.33333 0 7.632 0 8C0 8.368 0.298 8.66667 0.666667 8.66667H3.662L2.44867 9.88667C2.18867 10.148 2.19 10.5693 2.45133 10.8293C2.71267 11.0893 3.13467 11.088 3.394 10.8267L5.27933 8.93133C5.79467 8.41467 5.79467 7.574 5.27933 7.05667L5.27867 7.05733ZM7.068 5.278C7.56133 5.79267 8.45 5.79267 8.94267 5.278L10.828 3.392C11.0887 3.13133 11.0887 2.70933 10.828 2.44933C10.5673 2.18867 10.146 2.18867 9.88533 2.44933L8.66667 3.674V0.666667C8.66667 0.298667 8.36867 0 8 0C7.63133 0 7.33333 0.298667 7.33333 0.666667V3.662L6.11333 2.44867C5.852 2.18867 5.43067 2.19 5.17067 2.45133C4.91067 2.71267 4.912 3.13467 5.17333 3.394L7.068 5.278ZM8.94267 10.7213C8.42667 10.2053 7.58533 10.2053 7.06867 10.72L5.17267 12.606C4.91133 12.866 4.91 13.2873 5.17 13.5487C5.42933 13.8093 5.85067 13.8113 6.11267 13.5513L7.33267 12.3307V15.3333C7.33267 15.702 7.63067 16 7.99933 16C8.368 16 8.666 15.702 8.666 15.3333V12.3307L9.88467 13.55C10.1453 13.8107 10.5667 13.8107 10.8273 13.55C11.088 13.2893 11.088 12.868 10.8273 12.6073L8.94267 10.7213ZM15.3333 7.33333H12.3307L13.55 6.114C13.8107 5.854 13.8107 5.432 13.55 5.17133C13.2893 4.91067 12.868 4.91067 12.6073 5.17133L10.7213 7.05733C10.2053 7.574 10.2047 8.41467 10.72 8.93133L12.606 10.8273C12.866 11.088 13.2873 11.09 13.5487 10.83C13.81 10.57 13.8113 10.1487 13.5513 9.88733L12.3307 8.66733H15.3333C15.702 8.66733 16 8.36867 16 8.00067C16 7.63267 15.702 7.334 15.3333 7.334V7.33333Z",
155
+ fill: "currentColor"
162
156
  }
163
- ),
164
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "8", cy: "8", r: "1.5", fill: "currentColor" })
157
+ )
165
158
  ]
166
159
  })
167
160
  );
@@ -695,14 +688,9 @@ InfoIcon.displayName = "InfoIcon";
695
688
 
696
689
  // src/primitives/icon/icon.constants.ts
697
690
  var iconSizeClasses = {
698
- xxs: "h-2 w-2",
699
- xs: "h-3 w-3",
700
- s: "h-4 w-4",
701
- ms: "h-5 w-5",
702
- m: "h-6 w-6",
703
- l: "h-8 w-8",
704
- xl: "h-10 w-10",
705
- xxl: "h-12 w-12"
691
+ small: "h-4 w-4",
692
+ medium: "h-6 w-6",
693
+ large: "h-8 w-8"
706
694
  };
707
695
 
708
696
  // src/primitives/icon/svg/check-badge.tsx
@@ -1408,7 +1396,7 @@ var Icon = (_a) => {
1408
1396
  var _b = _a, {
1409
1397
  name,
1410
1398
  color,
1411
- size = "m",
1399
+ size = "medium",
1412
1400
  className = "text-agg-primary",
1413
1401
  style
1414
1402
  } = _b, props = __objRest(_b, [
@@ -1421,7 +1409,14 @@ var Icon = (_a) => {
1421
1409
  const Component = iconRegistry[name];
1422
1410
  const resolvedStyle = resolveIconStyle(color, style);
1423
1411
  const resolvedClassName = cn(iconSizeClasses[size], className);
1424
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Component, __spreadValues({ color, className: resolvedClassName, style: resolvedStyle }, props));
1412
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
1413
+ Component,
1414
+ __spreadValues({
1415
+ color,
1416
+ className: cn("group/agg-icon", resolvedClassName),
1417
+ style: resolvedStyle
1418
+ }, props)
1419
+ );
1425
1420
  };
1426
1421
  Icon.displayName = "Icon";
1427
1422
 
@@ -1454,19 +1449,23 @@ var import_hooks3 = require("@agg-market/hooks");
1454
1449
  var import_hooks2 = require("@agg-market/hooks");
1455
1450
  var import_jsx_runtime44 = require("react/jsx-runtime");
1456
1451
  var Card = (_a) => {
1457
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1452
+ var _b = _a, { className, onClick } = _b, props = __objRest(_b, ["className", "onClick"]);
1458
1453
  const { enableAnimations } = (0, import_hooks2.useSdkUiConfig)();
1459
1454
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
1460
1455
  "div",
1461
- __spreadValues({
1456
+ __spreadValues(__spreadValues({
1462
1457
  className: cn(
1458
+ "group/agg-card",
1463
1459
  "flex w-full flex-col font-agg-sans",
1464
1460
  "rounded-agg-xl border border-agg-separator",
1465
1461
  "bg-agg-secondary text-agg-foreground shadow-agg-card",
1466
- getMotionClassName(enableAnimations, "transition-shadow hover:shadow-agg-card-hover"),
1462
+ getMotionClassName(
1463
+ enableAnimations,
1464
+ "transition-shadow hover:shadow-agg-card-hover duration-300 ease-in-out"
1465
+ ),
1467
1466
  className
1468
1467
  )
1469
- }, props)
1468
+ }, onClick ? { onClick } : {}), props)
1470
1469
  );
1471
1470
  };
1472
1471
  Card.displayName = "Card";
@@ -1485,7 +1484,7 @@ var EventListItemSkeletonView = ({
1485
1484
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
1486
1485
  Card,
1487
1486
  {
1488
- className: cn(baseCardClassName, className),
1487
+ className: cn("group/agg-skeleton", baseCardClassName, className),
1489
1488
  role: isStandalone ? "status" : void 0,
1490
1489
  "aria-label": isStandalone ? ariaLabel != null ? ariaLabel : labels.eventItem.loading : void 0,
1491
1490
  "aria-busy": isStandalone || void 0,
@@ -1534,7 +1533,7 @@ var EventListSkeletonView = ({ className, ariaLabel }) => {
1534
1533
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
1535
1534
  "section",
1536
1535
  {
1537
- className: cn("flex w-full flex-col gap-5", className),
1536
+ className: cn("group/agg-skeleton", "flex w-full flex-col gap-5", className),
1538
1537
  role: "status",
1539
1538
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventList.loading("events"),
1540
1539
  "aria-busy": true,
@@ -1577,7 +1576,7 @@ var EventListItemDetailsSkeletonView = ({
1577
1576
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
1578
1577
  Card,
1579
1578
  {
1580
- className: cn(detailsBaseCardClassName, className),
1579
+ className: cn("group/agg-skeleton", detailsBaseCardClassName, className),
1581
1580
  role: "status",
1582
1581
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading,
1583
1582
  "aria-busy": true,
@@ -1630,7 +1629,7 @@ var MarketDetailsSkeletonView = ({
1630
1629
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
1631
1630
  Card,
1632
1631
  {
1633
- className: cn(marketDetailsBaseCardClassName, className),
1632
+ className: cn("group/agg-skeleton", marketDetailsBaseCardClassName, className),
1634
1633
  role: "status",
1635
1634
  "aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.loading,
1636
1635
  "aria-busy": true,
@@ -1700,7 +1699,7 @@ MarketDetailsSkeletonView.displayName = "MarketDetailsSkeletonView";
1700
1699
  var import_jsx_runtime49 = require("react/jsx-runtime");
1701
1700
  var placeOrderCardClassName = "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
1702
1701
  var ContentBody = () => {
1703
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [
1702
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex flex-col gap-6 p-5"), children: [
1704
1703
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col gap-2", children: [
1705
1704
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex items-start justify-between gap-5", children: [
1706
1705
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
@@ -1767,7 +1766,7 @@ var PlaceOrderSkeletonView = ({
1767
1766
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
1768
1767
  "div",
1769
1768
  {
1770
- className: cn("w-full", className),
1769
+ className: cn("group/agg-skeleton", "w-full", className),
1771
1770
  role: "status",
1772
1771
  "aria-label": ariaLabel != null ? ariaLabel : "Loading place order",
1773
1772
  "aria-busy": true,
@@ -1801,6 +1800,7 @@ var SettlementSkeletonView = ({
1801
1800
  Card,
1802
1801
  {
1803
1802
  className: cn(
1803
+ "group/agg-skeleton",
1804
1804
  "flex flex-col w-full gap-5 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none",
1805
1805
  className
1806
1806
  ),
@@ -1886,7 +1886,6 @@ Skeleton.displayName = "Skeleton";
1886
1886
  // src/primitives/tabs/index.tsx
1887
1887
  var import_react2 = require("react");
1888
1888
  var import_hooks9 = require("@agg-market/hooks");
1889
- var DropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
1890
1889
 
1891
1890
  // src/primitives/select/index.tsx
1892
1891
  var import_react = require("react");
@@ -1912,7 +1911,7 @@ var Select = ({
1912
1911
  if (!isOpen)
1913
1912
  return;
1914
1913
  const handlePointerDown = (e) => {
1915
- if (containerRef.current && !containerRef.current.contains(e.target)) {
1914
+ if (containerRef.current && !containerRef.current.contains(e == null ? void 0 : e.target)) {
1916
1915
  close();
1917
1916
  }
1918
1917
  };
@@ -1923,7 +1922,7 @@ var Select = ({
1923
1922
  if (!isOpen)
1924
1923
  return;
1925
1924
  const handleKey = (e) => {
1926
- if (e.key === "Escape")
1925
+ if ((e == null ? void 0 : e.key) === "Escape")
1927
1926
  close();
1928
1927
  };
1929
1928
  document.addEventListener("keydown", handleKey);
@@ -1932,7 +1931,7 @@ var Select = ({
1932
1931
  const isDisabled = disabled || !hasEnabledItems;
1933
1932
  const selectedItem = items.find((item) => item.value === value);
1934
1933
  if (!hasAnyIcon) {
1935
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("label", { className: cn("relative inline-flex w-full", className), children: [
1934
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("label", { className: cn("group/agg-select", "relative inline-flex w-full", className), children: [
1936
1935
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
1937
1936
  "select",
1938
1937
  {
@@ -1941,7 +1940,7 @@ var Select = ({
1941
1940
  "w-full appearance-none rounded-agg-md border border-agg-separator bg-agg-secondary px-4 py-2 pr-10 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground outline-none",
1942
1941
  getMotionClassName(
1943
1942
  enableAnimations,
1944
- "transition-[border-color,box-shadow] duration-200 ease-out"
1943
+ "transition-[border-color,box-shadow] duration-200 ease-in-out"
1945
1944
  ),
1946
1945
  "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
1947
1946
  "disabled:cursor-not-allowed disabled:opacity-60"
@@ -1952,88 +1951,95 @@ var Select = ({
1952
1951
  children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("option", { value: item.value, disabled: item.disabled, children: item.label }, item.value))
1953
1952
  }
1954
1953
  ),
1955
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { name: "chevron-down", size: "s", color: "currentColor" }) })
1954
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) })
1956
1955
  ] });
1957
1956
  }
1958
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { ref: containerRef, className: cn("relative inline-flex w-full", className), children: [
1959
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
1960
- "button",
1961
- {
1962
- type: "button",
1963
- "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
1964
- "aria-expanded": isOpen,
1965
- "aria-haspopup": "listbox",
1966
- disabled: isDisabled,
1967
- className: cn(
1968
- "w-full rounded-agg-md border border-agg-separator bg-agg-secondary px-4 py-2 pr-10 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground outline-none",
1969
- "flex items-center gap-2 text-left",
1970
- getMotionClassName(
1971
- enableAnimations,
1972
- "transition-[border-color,box-shadow] duration-200 ease-out"
1973
- ),
1974
- "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
1975
- "disabled:cursor-not-allowed disabled:opacity-60"
1976
- ),
1977
- onClick: () => setIsOpen((prev) => !prev),
1978
- children: [
1979
- (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
1980
- "img",
1981
- {
1982
- src: selectedItem.iconUrl,
1983
- alt: "",
1984
- className: "h-4 w-4 shrink-0 rounded-sm object-contain"
1985
- }
1986
- ) : null,
1987
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
1988
- ]
1989
- }
1990
- ),
1991
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { name: "chevron-down", size: "s", color: "currentColor" }) }),
1992
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
1993
- "div",
1994
- {
1995
- role: "listbox",
1996
- "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
1997
- className: "absolute top-full left-0 z-50 mt-1 w-full overflow-hidden rounded-agg-md border border-agg-separator bg-agg-secondary shadow-lg",
1998
- children: items.map((item) => {
1999
- const isSelected = item.value === value;
2000
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
2001
- "button",
2002
- {
2003
- type: "button",
2004
- role: "option",
2005
- "aria-selected": isSelected,
2006
- disabled: item.disabled,
2007
- className: cn(
2008
- "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
2009
- "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
2010
- isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
2011
- item.disabled && "cursor-not-allowed opacity-60"
1957
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
1958
+ "div",
1959
+ {
1960
+ ref: containerRef,
1961
+ className: cn("group/agg-select", "relative inline-flex w-full", className),
1962
+ children: [
1963
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
1964
+ "button",
1965
+ {
1966
+ type: "button",
1967
+ "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
1968
+ "aria-expanded": isOpen,
1969
+ "aria-haspopup": "listbox",
1970
+ disabled: isDisabled,
1971
+ className: cn(
1972
+ "w-full rounded-agg-md border border-agg-separator bg-agg-secondary px-4 py-2 pr-10 font-agg-sans text-agg-sm leading-agg-5 text-agg-foreground outline-none",
1973
+ "flex items-center gap-2 text-left",
1974
+ getMotionClassName(
1975
+ enableAnimations,
1976
+ "transition-[border-color,box-shadow] duration-200 ease-in-out"
2012
1977
  ),
2013
- onClick: () => {
2014
- if (!item.disabled) {
2015
- onChange(item.value);
2016
- close();
1978
+ "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
1979
+ "disabled:cursor-not-allowed disabled:opacity-60"
1980
+ ),
1981
+ onClick: () => setIsOpen((prev) => !prev),
1982
+ children: [
1983
+ (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
1984
+ "img",
1985
+ {
1986
+ src: selectedItem.iconUrl,
1987
+ alt: "",
1988
+ className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2017
1989
  }
2018
- },
2019
- children: [
2020
- item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2021
- "img",
2022
- {
2023
- src: item.iconUrl,
2024
- alt: "",
2025
- className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2026
- }
2027
- ) : null,
2028
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "truncate", children: item.label })
2029
- ]
2030
- },
2031
- item.value
2032
- );
2033
- })
2034
- }
2035
- ) : null
2036
- ] });
1990
+ ) : null,
1991
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
1992
+ ]
1993
+ }
1994
+ ),
1995
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pointer-events-none absolute inset-y-0 right-3 inline-flex items-center justify-center text-agg-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) }),
1996
+ isOpen ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
1997
+ "div",
1998
+ {
1999
+ role: "listbox",
2000
+ "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2001
+ className: "absolute top-full left-0 z-50 mt-1 w-full overflow-hidden rounded-agg-md border border-agg-separator bg-agg-secondary shadow-lg",
2002
+ children: items.map((item) => {
2003
+ const isSelected = item.value === value;
2004
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
2005
+ "button",
2006
+ {
2007
+ type: "button",
2008
+ role: "option",
2009
+ "aria-selected": isSelected,
2010
+ disabled: item.disabled,
2011
+ className: cn(
2012
+ "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
2013
+ "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
2014
+ isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
2015
+ item.disabled && "cursor-not-allowed opacity-60"
2016
+ ),
2017
+ onClick: () => {
2018
+ if (!item.disabled) {
2019
+ onChange(item.value);
2020
+ close();
2021
+ }
2022
+ },
2023
+ children: [
2024
+ item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
2025
+ "img",
2026
+ {
2027
+ src: item.iconUrl,
2028
+ alt: "",
2029
+ className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2030
+ }
2031
+ ) : null,
2032
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "truncate", children: item.label })
2033
+ ]
2034
+ },
2035
+ item.value
2036
+ );
2037
+ })
2038
+ }
2039
+ ) : null
2040
+ ]
2041
+ }
2042
+ );
2037
2043
  };
2038
2044
  Select.displayName = "Select";
2039
2045
 
@@ -2060,86 +2066,10 @@ var findEdgeEnabledIndex = (items, direction) => {
2060
2066
  }
2061
2067
  return -1;
2062
2068
  };
2063
- var FALLBACK_TAB_WIDTH = 112;
2064
- var FALLBACK_MORE_WIDTH = 56;
2065
- var sumWidths = (indices, widths) => {
2066
- return [...indices].reduce((accumulator, index) => {
2067
- var _a;
2068
- return accumulator + ((_a = widths[index]) != null ? _a : 0);
2069
- }, 0);
2070
- };
2071
- var resolveTabsOverflowLayout = ({
2072
- items,
2073
- value,
2074
- containerWidth,
2075
- moreButtonWidth,
2076
- itemWidthByValue
2077
- }) => {
2078
- var _a;
2079
- if (items.length === 0) {
2080
- return {
2081
- visibleItems: [],
2082
- hiddenItems: []
2083
- };
2084
- }
2085
- if (!Number.isFinite(containerWidth) || containerWidth <= 0) {
2086
- return {
2087
- visibleItems: items,
2088
- hiddenItems: []
2089
- };
2090
- }
2091
- const resolvedItemWidths = items.map((item) => {
2092
- var _a2;
2093
- const measuredWidth = (_a2 = itemWidthByValue.get(item.value)) != null ? _a2 : FALLBACK_TAB_WIDTH;
2094
- return Math.max(1, measuredWidth);
2095
- });
2096
- const totalItemsWidth = resolvedItemWidths.reduce((sum, width) => {
2097
- return sum + width;
2098
- }, 0);
2099
- if (totalItemsWidth <= containerWidth) {
2100
- return {
2101
- visibleItems: items,
2102
- hiddenItems: []
2103
- };
2104
- }
2105
- const reservedMoreWidth = Math.max(1, moreButtonWidth || FALLBACK_MORE_WIDTH);
2106
- const visibleIndices = /* @__PURE__ */ new Set();
2107
- let usedWidth = 0;
2108
- for (let index = 0; index < items.length; index += 1) {
2109
- const itemWidth = (_a = resolvedItemWidths[index]) != null ? _a : FALLBACK_TAB_WIDTH;
2110
- const hasRemainingItems = index < items.length - 1;
2111
- const requiredExtraWidth = hasRemainingItems ? reservedMoreWidth : 0;
2112
- if (usedWidth + itemWidth + requiredExtraWidth > containerWidth)
2113
- break;
2114
- visibleIndices.add(index);
2115
- usedWidth += itemWidth;
2116
- }
2117
- if (visibleIndices.size === 0) {
2118
- visibleIndices.add(0);
2119
- }
2120
- const activeIndex = items.findIndex((item) => item.value === value);
2121
- const isActiveHidden = activeIndex >= 0 && !visibleIndices.has(activeIndex);
2122
- if (isActiveHidden && activeIndex >= 0) {
2123
- visibleIndices.add(activeIndex);
2124
- while (visibleIndices.size > 1) {
2125
- const visibleWidth = sumWidths(visibleIndices, resolvedItemWidths);
2126
- if (visibleWidth + reservedMoreWidth <= containerWidth)
2127
- break;
2128
- const removableIndex = [...visibleIndices].sort((left, right) => right - left).find((index) => index !== activeIndex);
2129
- if (removableIndex == null)
2130
- break;
2131
- visibleIndices.delete(removableIndex);
2132
- }
2133
- }
2134
- return {
2135
- visibleItems: items.filter((_, index) => visibleIndices.has(index)),
2136
- hiddenItems: items.filter((_, index) => !visibleIndices.has(index))
2137
- };
2138
- };
2139
2069
 
2140
2070
  // src/primitives/tabs/index.tsx
2141
2071
  var import_jsx_runtime53 = require("react/jsx-runtime");
2142
- var mobileTabsMediaQuery = "(max-width: 767px)";
2072
+ var mobileTabsMediaQuery = "(max-width: 512px)";
2143
2073
  var getTabButtonClassName = ({
2144
2074
  enableAnimations,
2145
2075
  isBarVariant,
@@ -2151,7 +2081,11 @@ var getTabButtonClassName = ({
2151
2081
  return cn(
2152
2082
  "cursor-pointer disabled:cursor-not-allowed",
2153
2083
  "relative inline-flex h-full shrink-0 items-center justify-center gap-2 font-agg-sans",
2154
- getMotionClassName(enableAnimations, "transition-colors motion-reduce:transition-none"),
2084
+ isBarVariant ? "hover:text-agg-foreground hover:bg-agg-secondary-hover" : "hover:text-agg-foreground hover:font-bold",
2085
+ getMotionClassName(
2086
+ enableAnimations,
2087
+ "transition-[colors] duration-300 ease-in-out motion-reduce:transition-none"
2088
+ ),
2155
2089
  isBarVariant ? cn(
2156
2090
  "min-w-20 overflow-hidden border-r border-agg-separator last:border-r-0",
2157
2091
  isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
@@ -2163,35 +2097,6 @@ var getTabButtonClassName = ({
2163
2097
  isDisabled && "cursor-not-allowed opacity-60"
2164
2098
  );
2165
2099
  };
2166
- var getMeasureTabClassName = ({
2167
- isBarVariant,
2168
- size
2169
- }) => {
2170
- const isSmall = size === "s";
2171
- return cn(
2172
- "relative inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-agg-sans",
2173
- isBarVariant ? cn(
2174
- "h-8 min-w-20 border-r border-agg-separator font-agg-bold",
2175
- isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
2176
- ) : cn(
2177
- "h-12 font-agg-bold",
2178
- isSmall ? "px-4 text-agg-sm leading-agg-5" : "px-5 text-agg-base leading-agg-6"
2179
- )
2180
- );
2181
- };
2182
- var getMoreButtonClassName = ({
2183
- enableAnimations,
2184
- isBarVariant,
2185
- size
2186
- }) => {
2187
- const isSmall = size === "s";
2188
- return cn(
2189
- "cursor-pointer disabled:cursor-not-allowed",
2190
- "relative inline-flex shrink-0 items-center justify-center overflow-hidden font-agg-sans text-agg-foreground hover:bg-agg-secondary-hover",
2191
- getMotionClassName(enableAnimations, "transition-colors motion-reduce:transition-none"),
2192
- isBarVariant ? "h-8 rounded-r-agg-sm border border-agg-separator bg-agg-secondary px-2" : cn("h-12 bg-agg-secondary", isSmall ? "px-3 text-agg-sm" : "px-4 text-agg-base")
2193
- );
2194
- };
2195
2100
  var Tabs = ({
2196
2101
  items,
2197
2102
  value,
@@ -2199,12 +2104,12 @@ var Tabs = ({
2199
2104
  variant = "bar",
2200
2105
  size = "m",
2201
2106
  overflowBehavior,
2202
- overflowMenuAriaLabel,
2203
2107
  ariaLabel,
2204
- className
2108
+ className,
2109
+ classNames
2205
2110
  }) => {
2206
2111
  const labels = (0, import_hooks9.useLabels)();
2207
- const { enableAnimations, rootClassName } = (0, import_hooks9.useSdkUiConfig)();
2112
+ const { enableAnimations } = (0, import_hooks9.useSdkUiConfig)();
2208
2113
  const buttonRefs = (0, import_react2.useRef)([]);
2209
2114
  const dragStateRef = (0, import_react2.useRef)({
2210
2115
  isPointerDown: false,
@@ -2216,8 +2121,6 @@ var Tabs = ({
2216
2121
  });
2217
2122
  const suppressClickRef = (0, import_react2.useRef)(false);
2218
2123
  const resolvedAriaLabel = ariaLabel != null ? ariaLabel : labels.common.tabsAria;
2219
- const resolvedOverflowMenuAriaLabel = overflowMenuAriaLabel != null ? overflowMenuAriaLabel : labels.common.hiddenTabsAria;
2220
- const [isMoreMenuOpen, setIsMoreMenuOpen] = (0, import_react2.useState)(false);
2221
2124
  const [isMobileViewport, setIsMobileViewport] = (0, import_react2.useState)(false);
2222
2125
  const [isDraggingTabs, setIsDraggingTabs] = (0, import_react2.useState)(false);
2223
2126
  const [activeUnderlineStyle, setActiveUnderlineStyle] = (0, import_react2.useState)({
@@ -2225,39 +2128,21 @@ var Tabs = ({
2225
2128
  width: 0,
2226
2129
  opacity: 0
2227
2130
  });
2228
- const [overflowLayout, setOverflowLayout] = (0, import_react2.useState)({
2229
- visibleItems: items,
2230
- hiddenItems: []
2231
- });
2232
2131
  const [scrollAffordanceState, setScrollAffordanceState] = (0, import_react2.useState)({
2233
2132
  showStart: false,
2234
2133
  showEnd: false
2235
2134
  });
2236
- const containerRef = (0, import_react2.useRef)(null);
2237
2135
  const tabListRef = (0, import_react2.useRef)(null);
2238
- const moreButtonMeasureRef = (0, import_react2.useRef)(null);
2239
- const tabMeasureRefs = (0, import_react2.useRef)(/* @__PURE__ */ new Map());
2240
2136
  const isBarVariant = variant === "bar";
2241
2137
  const resolvedOverflowBehavior = (0, import_react2.useMemo)(() => {
2242
2138
  if (overflowBehavior)
2243
2139
  return overflowBehavior;
2244
2140
  if (!isBarVariant)
2245
2141
  return "scroll";
2246
- return isMobileViewport ? "select" : "menu";
2142
+ return isMobileViewport ? "select" : "scroll";
2247
2143
  }, [isBarVariant, isMobileViewport, overflowBehavior]);
2248
- const shouldUseOverflowMenu = resolvedOverflowBehavior === "menu";
2249
2144
  const shouldUseOverflowScroll = resolvedOverflowBehavior === "scroll";
2250
2145
  const shouldUseOverflowSelect = resolvedOverflowBehavior === "select";
2251
- const handleMeasureTabRef = (0, import_react2.useCallback)(
2252
- (tabValue, tabElement) => {
2253
- if (!tabElement) {
2254
- tabMeasureRefs.current.delete(tabValue);
2255
- return;
2256
- }
2257
- tabMeasureRefs.current.set(tabValue, tabElement);
2258
- },
2259
- []
2260
- );
2261
2146
  (0, import_react2.useEffect)(() => {
2262
2147
  if (typeof window === "undefined")
2263
2148
  return;
@@ -2277,55 +2162,6 @@ var Tabs = ({
2277
2162
  mediaQueryList.removeListener(handleMediaQueryChange);
2278
2163
  };
2279
2164
  }, []);
2280
- const handleRecalculateOverflow = (0, import_react2.useCallback)(() => {
2281
- var _a, _b, _c, _d;
2282
- if (!shouldUseOverflowMenu) {
2283
- setOverflowLayout({
2284
- visibleItems: items,
2285
- hiddenItems: []
2286
- });
2287
- return;
2288
- }
2289
- const containerWidth = (_b = (_a = containerRef.current) == null ? void 0 : _a.clientWidth) != null ? _b : 0;
2290
- const moreButtonWidth = (_d = (_c = moreButtonMeasureRef.current) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
2291
- const itemWidthByValue = new Map(
2292
- items.map((item) => {
2293
- var _a2, _b2;
2294
- return [item.value, (_b2 = (_a2 = tabMeasureRefs.current.get(item.value)) == null ? void 0 : _a2.offsetWidth) != null ? _b2 : 0];
2295
- })
2296
- );
2297
- setOverflowLayout(
2298
- resolveTabsOverflowLayout({
2299
- items,
2300
- value,
2301
- containerWidth,
2302
- moreButtonWidth,
2303
- itemWidthByValue
2304
- })
2305
- );
2306
- }, [items, shouldUseOverflowMenu, value]);
2307
- (0, import_react2.useEffect)(() => {
2308
- handleRecalculateOverflow();
2309
- }, [handleRecalculateOverflow]);
2310
- (0, import_react2.useEffect)(() => {
2311
- if (!shouldUseOverflowMenu)
2312
- return;
2313
- const container = containerRef.current;
2314
- if (!container || typeof ResizeObserver === "undefined")
2315
- return;
2316
- const resizeObserver = new ResizeObserver(() => {
2317
- handleRecalculateOverflow();
2318
- });
2319
- resizeObserver.observe(container);
2320
- return () => {
2321
- resizeObserver.disconnect();
2322
- };
2323
- }, [handleRecalculateOverflow, shouldUseOverflowMenu]);
2324
- (0, import_react2.useEffect)(() => {
2325
- if (overflowLayout.hiddenItems.length > 0)
2326
- return;
2327
- setIsMoreMenuOpen(false);
2328
- }, [overflowLayout.hiddenItems.length]);
2329
2165
  const updateScrollAffordances = (0, import_react2.useCallback)(() => {
2330
2166
  if (!shouldUseOverflowScroll) {
2331
2167
  setScrollAffordanceState({
@@ -2343,8 +2179,7 @@ var Tabs = ({
2343
2179
  showEnd: maxScrollLeft - tabListElement.scrollLeft > 4
2344
2180
  });
2345
2181
  }, [shouldUseOverflowScroll]);
2346
- const renderedItems = shouldUseOverflowMenu ? overflowLayout.visibleItems : items;
2347
- const shouldShowMoreButton = shouldUseOverflowMenu && overflowLayout.hiddenItems.length > 0;
2182
+ const renderedItems = items;
2348
2183
  const selectItems = (0, import_react2.useMemo)(() => {
2349
2184
  return items.map((item) => ({
2350
2185
  value: item.value,
@@ -2369,24 +2204,24 @@ var Tabs = ({
2369
2204
  (_a = buttonRefs.current[index]) == null ? void 0 : _a.focus();
2370
2205
  };
2371
2206
  const handleKeyDown = (event, index) => {
2372
- switch (event.key) {
2207
+ switch (event == null ? void 0 : event.key) {
2373
2208
  case "ArrowRight": {
2374
- event.preventDefault();
2209
+ event == null ? void 0 : event.preventDefault();
2375
2210
  handleMoveFocus(findNextEnabledIndex(renderedItems, index, 1));
2376
2211
  return;
2377
2212
  }
2378
2213
  case "ArrowLeft": {
2379
- event.preventDefault();
2214
+ event == null ? void 0 : event.preventDefault();
2380
2215
  handleMoveFocus(findNextEnabledIndex(renderedItems, index, -1));
2381
2216
  return;
2382
2217
  }
2383
2218
  case "Home": {
2384
- event.preventDefault();
2219
+ event == null ? void 0 : event.preventDefault();
2385
2220
  handleMoveFocus(findEdgeEnabledIndex(renderedItems, 1));
2386
2221
  return;
2387
2222
  }
2388
2223
  case "End": {
2389
- event.preventDefault();
2224
+ event == null ? void 0 : event.preventDefault();
2390
2225
  handleMoveFocus(findEdgeEnabledIndex(renderedItems, -1));
2391
2226
  return;
2392
2227
  }
@@ -2394,22 +2229,16 @@ var Tabs = ({
2394
2229
  return;
2395
2230
  }
2396
2231
  };
2397
- const activeHiddenItem = (0, import_react2.useMemo)(() => {
2398
- if (!shouldUseOverflowMenu)
2399
- return void 0;
2400
- return overflowLayout.hiddenItems.find((item) => item.value === value);
2401
- }, [overflowLayout.hiddenItems, shouldUseOverflowMenu, value]);
2402
2232
  const tabListClassName = cn(
2403
2233
  "inline-flex items-stretch bg-agg-secondary",
2404
- shouldUseOverflowMenu ? "min-w-0 flex-1 overflow-hidden" : shouldUseOverflowScroll ? cn(
2234
+ shouldUseOverflowScroll ? cn(
2405
2235
  "overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
2406
2236
  getMotionClassName(enableAnimations, "scroll-smooth")
2407
2237
  ) : "overflow-x-auto",
2408
2238
  isBarVariant ? "h-8 rounded-agg-sm border border-agg-separator" : "h-12 border-b border-agg-separator -mb-[1px]",
2409
2239
  shouldUseOverflowScroll && "select-none",
2410
2240
  shouldUseOverflowScroll && !isBarVariant && "snap-x snap-mandatory",
2411
- shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab"),
2412
- shouldShowMoreButton && isBarVariant && "rounded-r-none border-r-0"
2241
+ shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab")
2413
2242
  );
2414
2243
  const handleTabListWheel = (event) => {
2415
2244
  if (!shouldUseOverflowScroll)
@@ -2498,14 +2327,10 @@ var Tabs = ({
2498
2327
  const handleTabListClickCapture = (event) => {
2499
2328
  if (!suppressClickRef.current)
2500
2329
  return;
2501
- event.preventDefault();
2502
- event.stopPropagation();
2330
+ event == null ? void 0 : event.preventDefault();
2331
+ event == null ? void 0 : event.stopPropagation();
2503
2332
  suppressClickRef.current = false;
2504
2333
  };
2505
- const handleSelectHiddenItem = (nextValue) => {
2506
- handleSelect(nextValue);
2507
- setIsMoreMenuOpen(false);
2508
- };
2509
2334
  const updateActiveUnderline = (0, import_react2.useCallback)(() => {
2510
2335
  if (isBarVariant) {
2511
2336
  setActiveUnderlineStyle({
@@ -2573,18 +2398,34 @@ var Tabs = ({
2573
2398
  (0, import_react2.useEffect)(() => {
2574
2399
  if (!shouldUseOverflowScroll)
2575
2400
  return;
2401
+ const tabListElement = tabListRef.current;
2402
+ if (!tabListElement)
2403
+ return;
2576
2404
  const activeIndex = renderedItems.findIndex((item) => item.value === value);
2577
2405
  const activeButton = activeIndex >= 0 ? buttonRefs.current[activeIndex] : null;
2578
2406
  if (!activeButton)
2579
2407
  return;
2580
- activeButton.scrollIntoView({
2581
- behavior: getScrollBehavior(enableAnimations),
2582
- block: "nearest",
2583
- inline: "nearest"
2408
+ if (tabListElement.scrollWidth - tabListElement.clientWidth <= 1)
2409
+ return;
2410
+ const currentScrollLeft = tabListElement.scrollLeft;
2411
+ const currentScrollRight = currentScrollLeft + tabListElement.clientWidth;
2412
+ const activeButtonLeft = activeButton.offsetLeft;
2413
+ const activeButtonRight = activeButtonLeft + activeButton.offsetWidth;
2414
+ let nextScrollLeft = currentScrollLeft;
2415
+ if (activeButtonLeft < currentScrollLeft) {
2416
+ nextScrollLeft = activeButtonLeft;
2417
+ } else if (activeButtonRight > currentScrollRight) {
2418
+ nextScrollLeft = activeButtonRight - tabListElement.clientWidth;
2419
+ }
2420
+ if (Math.abs(nextScrollLeft - currentScrollLeft) < 1)
2421
+ return;
2422
+ tabListElement.scrollTo({
2423
+ left: Math.max(0, nextScrollLeft),
2424
+ behavior: getScrollBehavior(enableAnimations)
2584
2425
  });
2585
2426
  }, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
2586
2427
  if (shouldUseOverflowSelect) {
2587
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2428
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: cn("w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2588
2429
  Select,
2589
2430
  {
2590
2431
  ariaLabel,
@@ -2599,10 +2440,12 @@ var Tabs = ({
2599
2440
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2600
2441
  "div",
2601
2442
  {
2602
- ref: containerRef,
2603
2443
  className: cn(
2604
- "relative inline-flex max-w-full items-stretch font-agg-sans bg-agg-secondary",
2605
- className
2444
+ "group/agg-tabs",
2445
+ "relative max-w-full items-stretch font-agg-sans bg-agg-secondary",
2446
+ "inline-flex",
2447
+ className,
2448
+ classNames == null ? void 0 : classNames.root
2606
2449
  ),
2607
2450
  children: [
2608
2451
  /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
@@ -2611,7 +2454,7 @@ var Tabs = ({
2611
2454
  ref: tabListRef,
2612
2455
  role: "tablist",
2613
2456
  "aria-label": resolvedAriaLabel,
2614
- className: cn("relative", tabListClassName),
2457
+ className: cn("relative", tabListClassName, classNames == null ? void 0 : classNames.tabList),
2615
2458
  onClickCapture: handleTabListClickCapture,
2616
2459
  onPointerCancel: handleEndTabListDrag,
2617
2460
  onPointerDown: handleTabListPointerDown,
@@ -2633,7 +2476,11 @@ var Tabs = ({
2633
2476
  "aria-selected": isActive,
2634
2477
  "aria-label": item.label,
2635
2478
  disabled: item.disabled,
2636
- onClick: () => handleSelect(item.value),
2479
+ onClick: (e) => {
2480
+ e.preventDefault();
2481
+ e.stopPropagation();
2482
+ handleSelect(item.value);
2483
+ },
2637
2484
  onKeyDown: (event) => handleKeyDown(event, index),
2638
2485
  className: cn(
2639
2486
  getTabButtonClassName({
@@ -2675,7 +2522,7 @@ var Tabs = ({
2675
2522
  "pointer-events-none absolute bottom-0 left-0 rounded-t-agg-sm bg-agg-primary",
2676
2523
  getMotionClassName(
2677
2524
  enableAnimations,
2678
- "transition-[transform,width,opacity] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]"
2525
+ "transition-[transform,width,opacity] duration-300 ease-in-out"
2679
2526
  ),
2680
2527
  "h-[3px]"
2681
2528
  ),
@@ -2691,7 +2538,7 @@ var Tabs = ({
2691
2538
  {
2692
2539
  "aria-hidden": true,
2693
2540
  className: cn(
2694
- "pointer-events-none absolute top-0 bottom-0 left-0 z-10 w-12 md:w-18 bg-gradient-to-r from-agg-secondary via-agg-secondary to-transparent",
2541
+ "pointer-events-none absolute top-0 bottom-0 left-8 z-10 w-12 md:w-18 bg-linear-to-r from-agg-secondary via-agg-secondary to-transparent",
2695
2542
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
2696
2543
  scrollAffordanceState.showStart ? "opacity-100" : "opacity-0"
2697
2544
  )
@@ -2702,104 +2549,13 @@ var Tabs = ({
2702
2549
  {
2703
2550
  "aria-hidden": true,
2704
2551
  className: cn(
2705
- "pointer-events-none absolute top-0 right-0 bottom-0 z-10 w-12 md:w-18 bg-gradient-to-l from-agg-secondary via-agg-secondary to-transparent",
2552
+ "pointer-events-none absolute top-0 right-8 bottom-0 z-10 w-12 md:w-18 bg-linear-to-l from-agg-secondary via-agg-secondary to-transparent",
2706
2553
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
2707
2554
  scrollAffordanceState.showEnd ? "opacity-100" : "opacity-0"
2708
2555
  )
2709
2556
  }
2710
2557
  )
2711
- ] }) : null,
2712
- shouldShowMoreButton ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(DropdownMenu.Root, { open: isMoreMenuOpen, onOpenChange: setIsMoreMenuOpen, children: [
2713
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2714
- "button",
2715
- {
2716
- type: "button",
2717
- "aria-label": resolvedOverflowMenuAriaLabel,
2718
- className: cn(
2719
- getMoreButtonClassName({
2720
- enableAnimations,
2721
- isBarVariant,
2722
- size
2723
- }),
2724
- activeHiddenItem ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground"
2725
- ),
2726
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { name: "dots-horizontal", size: isBarVariant ? "s" : "m", color: "currentColor" })
2727
- }
2728
- ) }),
2729
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2730
- DropdownMenu.Content,
2731
- {
2732
- align: "end",
2733
- "aria-label": resolvedOverflowMenuAriaLabel,
2734
- className: cn(
2735
- AGG_ROOT_CLASS_NAME,
2736
- rootClassName,
2737
- "z-agg-dropdown mt-2 min-w-48 overflow-hidden rounded-agg-md border border-agg-separator bg-agg-secondary shadow-agg-popover outline-none"
2738
- ),
2739
- "data-agg-animations": enableAnimations ? "true" : "false",
2740
- sideOffset: 8,
2741
- children: overflowLayout.hiddenItems.map((item) => {
2742
- const isSelected = item.value === value;
2743
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2744
- DropdownMenu.Item,
2745
- {
2746
- disabled: item.disabled,
2747
- onSelect: () => handleSelectHiddenItem(item.value),
2748
- className: cn(
2749
- "cursor-pointer disabled:cursor-not-allowed",
2750
- "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
2751
- getMotionClassName(enableAnimations, "transition-colors"),
2752
- "focus:bg-agg-secondary-hover data-[highlighted]:bg-agg-secondary-hover",
2753
- isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
2754
- item.disabled && "cursor-not-allowed opacity-60"
2755
- ),
2756
- children: [
2757
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
2758
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "truncate whitespace-nowrap [&::first-letter]:uppercase", children: item.label })
2759
- ]
2760
- },
2761
- item.value
2762
- );
2763
- })
2764
- }
2765
- ) })
2766
- ] }) : null,
2767
- shouldUseOverflowMenu ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2768
- "div",
2769
- {
2770
- "aria-hidden": true,
2771
- className: "pointer-events-none invisible fixed top-0 left-0 -z-10 h-0 overflow-hidden whitespace-nowrap",
2772
- children: [
2773
- items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2774
- "span",
2775
- {
2776
- ref: (tabElement) => handleMeasureTabRef(item.value, tabElement),
2777
- className: getMeasureTabClassName({
2778
- isBarVariant,
2779
- size
2780
- }),
2781
- children: [
2782
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
2783
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: item.label })
2784
- ]
2785
- },
2786
- `measure-${item.value}`
2787
- )),
2788
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2789
- "span",
2790
- {
2791
- ref: moreButtonMeasureRef,
2792
- className: getMoreButtonClassName({
2793
- enableAnimations,
2794
- isBarVariant,
2795
- size
2796
- }),
2797
- children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { name: "dots-horizontal", size: isBarVariant ? "s" : "m", color: "currentColor" })
2798
- }
2799
- )
2800
- ]
2801
- }
2802
- ) : null
2558
+ ] }) : null
2803
2559
  ]
2804
2560
  }
2805
2561
  );
@@ -2807,21 +2563,22 @@ var Tabs = ({
2807
2563
  Tabs.displayName = "Tabs";
2808
2564
 
2809
2565
  // src/primitives/typography/typography.constants.ts
2810
- var variantClasses = {
2811
- title: cn("font-agg-sans text-agg-lg leading-agg-7", "font-agg-bold", "text-agg-foreground"),
2812
- body: cn("font-agg-sans text-agg-base leading-agg-6", "font-agg-normal", "text-agg-foreground"),
2813
- meta: cn(
2814
- "font-agg-sans text-agg-sm leading-agg-5",
2815
- "font-agg-normal",
2816
- "text-agg-muted-foreground"
2817
- ),
2818
- label: cn(
2819
- "font-agg-sans text-agg-sm leading-agg-5",
2820
- "font-agg-bold uppercase",
2821
- "text-agg-foreground"
2822
- ),
2823
- value: cn("font-agg-sans text-agg-xl leading-agg-7", "font-agg-normal", "text-agg-foreground"),
2824
- caption: cn("font-agg-sans text-agg-xs leading-agg-4", "font-agg-normal", "text-agg-foreground")
2566
+ var typographyVariantClasses = {
2567
+ display: cn("agg-type-display"),
2568
+ heading: cn("agg-type-heading"),
2569
+ title: cn("agg-type-title"),
2570
+ "title-strong": cn("agg-type-title-strong"),
2571
+ "body-large": cn("agg-type-body-large"),
2572
+ "body-large-strong": cn("agg-type-body-large-strong"),
2573
+ body: cn("agg-type-body"),
2574
+ "body-strong": cn("agg-type-body-strong"),
2575
+ label: cn("agg-type-label"),
2576
+ "label-strong": cn("agg-type-label-strong"),
2577
+ "label-caps": cn("agg-type-label-caps"),
2578
+ caption: cn("agg-type-caption"),
2579
+ "caption-strong": cn("agg-type-caption-strong"),
2580
+ "caption-caps": cn("agg-type-caption-caps"),
2581
+ overline: cn("agg-type-overline")
2825
2582
  };
2826
2583
 
2827
2584
  // src/primitives/typography/index.tsx
@@ -2832,7 +2589,18 @@ var Typography = ({
2832
2589
  className,
2833
2590
  children
2834
2591
  }) => {
2835
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Component, { className: cn(variantClasses[variant], "truncate", className), children });
2592
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2593
+ Component,
2594
+ {
2595
+ className: cn(
2596
+ "group/agg-typography",
2597
+ "text-agg-foreground",
2598
+ typographyVariantClasses[variant],
2599
+ className
2600
+ ),
2601
+ children
2602
+ }
2603
+ );
2836
2604
  };
2837
2605
  Typography.displayName = "Typography";
2838
2606
 
@@ -2840,7 +2608,7 @@ Typography.displayName = "Typography";
2840
2608
  var import_hooks10 = require("@agg-market/hooks");
2841
2609
 
2842
2610
  // src/primitives/venue-logo/logo-props.ts
2843
- var DEFAULT_MONOCHROME_COLOR = "#000000";
2611
+ var DEFAULT_MONOCHROME_COLOR = "currentColor";
2844
2612
  var resolveLogoPrimaryColor = ({
2845
2613
  brandColor,
2846
2614
  isColor = true,
@@ -3038,14 +2806,9 @@ var venueLogoRegistry = {
3038
2806
  };
3039
2807
  var venueLogoNames = Object.keys(venueLogoRegistry);
3040
2808
  var sizeClasses = {
3041
- xxs: "h-2 w-2",
3042
- xs: "h-3 w-3",
3043
- s: "h-4 w-4",
3044
- ms: "h-5 w-5",
3045
- m: "h-6 w-6",
3046
- l: "h-8 w-8",
3047
- xl: "h-10 w-10",
3048
- xxl: "h-12 w-12"
2809
+ small: "h-4 w-4",
2810
+ medium: "h-6 w-6",
2811
+ large: "h-8 w-8"
3049
2812
  };
3050
2813
 
3051
2814
  // src/primitives/venue-logo/index.tsx
@@ -3055,7 +2818,7 @@ var VenueLogo = ({
3055
2818
  isColor = true,
3056
2819
  isMonochromatic = false,
3057
2820
  color,
3058
- size = "m",
2821
+ size = "medium",
3059
2822
  className,
3060
2823
  ariaLabel,
3061
2824
  title
@@ -3067,7 +2830,7 @@ var VenueLogo = ({
3067
2830
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
3068
2831
  Component,
3069
2832
  {
3070
- className: cn("shrink-0", sizeClass, className),
2833
+ className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
3071
2834
  isColor: resolvedIsColor,
3072
2835
  color,
3073
2836
  "aria-label": ariaLabel != null ? ariaLabel : labels.venues[venue],
@@ -3080,17 +2843,16 @@ VenueLogo.displayName = "VenueLogo";
3080
2843
  // src/events/item/index.tsx
3081
2844
  var import_dayjs = __toESM(require("dayjs"));
3082
2845
  var import_react3 = require("react");
2846
+ var import_hooks12 = require("@agg-market/hooks");
2847
+
2848
+ // src/primitives/badge/index.tsx
3083
2849
  var import_hooks11 = require("@agg-market/hooks");
3084
2850
 
3085
2851
  // src/primitives/badge/badge.constants.ts
3086
2852
  var badgeSizeClasses = {
3087
- xxs: cn("h-4 px-1.5 gap-0.5", "text-agg-xs leading-agg-3"),
3088
- xs: cn("h-5 px-2 gap-1", "text-agg-xs leading-agg-4"),
3089
- s: cn("h-6 px-2.5 gap-1", "text-agg-sm leading-agg-5"),
3090
- m: cn("h-7 px-3 gap-1.5", "text-agg-sm leading-agg-5"),
3091
- l: cn("h-8 px-3.5 gap-1.5", "text-agg-base leading-agg-6"),
3092
- xl: cn("h-9 px-4 gap-2", "text-agg-lg leading-agg-7"),
3093
- xxl: cn("h-10 px-5 gap-2", "text-agg-xl leading-agg-7")
2853
+ small: cn("py-1.5 px-4 gap-1.5", "agg-type-label"),
2854
+ medium: cn("py-1.5 px-4 gap-2", "agg-type-body"),
2855
+ large: cn("py-2.5 px-6 gap-2", "agg-type-body")
3094
2856
  };
3095
2857
  var baseBadgeClasses = cn(
3096
2858
  "inline-flex items-center justify-center rounded-agg-full font-agg-sans",
@@ -3099,20 +2861,41 @@ var baseBadgeClasses = cn(
3099
2861
 
3100
2862
  // src/primitives/badge/index.tsx
3101
2863
  var import_jsx_runtime60 = require("react/jsx-runtime");
3102
- function Badge({ text, prefix, suffix, size = "m", classNames }) {
2864
+ function Badge({
2865
+ text,
2866
+ prefix,
2867
+ suffix,
2868
+ size = "medium",
2869
+ classNames,
2870
+ onClick,
2871
+ isActive = false
2872
+ }) {
2873
+ const { enableAnimations } = (0, import_hooks11.useSdkUiConfig)();
3103
2874
  const resolvedText = `${text}`;
3104
2875
  const resolvedAriaLabel = resolvedText.length > 0 ? resolvedText : void 0;
3105
2876
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
3106
2877
  "span",
3107
- {
2878
+ __spreadProps(__spreadValues({
3108
2879
  "aria-label": resolvedAriaLabel,
3109
- className: cn(baseBadgeClasses, badgeSizeClasses[size], classNames == null ? void 0 : classNames.root),
2880
+ className: cn(
2881
+ "group/agg-badge",
2882
+ baseBadgeClasses,
2883
+ badgeSizeClasses[size],
2884
+ onClick ? "cursor-pointer hover:bg-agg-tertiary disabled:cursor-not-allowed" : "",
2885
+ getMotionClassName(
2886
+ enableAnimations,
2887
+ "transition-[border-color,background-color] duration-200 ease-in-out"
2888
+ ),
2889
+ isActive ? "border-agg-primary bg-agg-secondary! font-agg-bold!" : "border-transparent font-agg-normal",
2890
+ classNames == null ? void 0 : classNames.root
2891
+ )
2892
+ }, onClick && { onClick }), {
3110
2893
  children: [
3111
2894
  prefix ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: classNames == null ? void 0 : classNames.prefix, children: prefix }) : null,
3112
2895
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: cn("truncate", classNames == null ? void 0 : classNames.text), children: text }),
3113
2896
  suffix ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: classNames == null ? void 0 : classNames.suffix, children: suffix }) : null
3114
2897
  ]
3115
- }
2898
+ })
3116
2899
  );
3117
2900
  }
3118
2901
  Badge.displayName = "Badge";
@@ -3276,7 +3059,7 @@ var EventListItemLoadingState = ({
3276
3059
  classNames,
3277
3060
  ariaLabel
3278
3061
  }) => {
3279
- const labels = (0, import_hooks11.useLabels)();
3062
+ const labels = (0, import_hooks12.useLabels)();
3280
3063
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3281
3064
  Skeleton,
3282
3065
  {
@@ -3290,7 +3073,7 @@ var EventListItemUnavailableState = ({
3290
3073
  classNames,
3291
3074
  ariaLabel
3292
3075
  }) => {
3293
- const labels = (0, import_hooks11.useLabels)();
3076
+ const labels = (0, import_hooks12.useLabels)();
3294
3077
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3295
3078
  Card,
3296
3079
  {
@@ -3298,7 +3081,7 @@ var EventListItemUnavailableState = ({
3298
3081
  role: "status",
3299
3082
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventItem.unavailableAria,
3300
3083
  children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
3301
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Typography, { variant: "title", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItem.unavailableTitle }),
3084
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItem.unavailableTitle }),
3302
3085
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItem.unavailableDescription })
3303
3086
  ] })
3304
3087
  }
@@ -3317,8 +3100,8 @@ var EventListItemContent = ({
3317
3100
  ariaLabel
3318
3101
  }) => {
3319
3102
  var _a;
3320
- const config = (0, import_hooks11.useSdkUiConfig)();
3321
- const labels = (0, import_hooks11.useLabels)();
3103
+ const config = (0, import_hooks12.useSdkUiConfig)();
3104
+ const labels = (0, import_hooks12.useLabels)();
3322
3105
  const allVenueMarkets = (0, import_react3.useMemo)(() => {
3323
3106
  return event.markets.flatMap((market) => market.venueMarkets);
3324
3107
  }, [event.markets]);
@@ -3342,8 +3125,8 @@ var EventListItemContent = ({
3342
3125
  const handleKeyDown = (eventToHandle) => {
3343
3126
  if (!onClick)
3344
3127
  return;
3345
- if (eventToHandle.key === "Enter" || eventToHandle.key === " ") {
3346
- eventToHandle.preventDefault();
3128
+ if ((eventToHandle == null ? void 0 : eventToHandle.key) === "Enter" || (eventToHandle == null ? void 0 : eventToHandle.key) === " ") {
3129
+ eventToHandle == null ? void 0 : eventToHandle.preventDefault();
3347
3130
  onClick();
3348
3131
  }
3349
3132
  };
@@ -3352,9 +3135,17 @@ var EventListItemContent = ({
3352
3135
  return null;
3353
3136
  if (Math.abs(value) < config.arbitrageThreshold)
3354
3137
  return null;
3355
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: cn("flex items-baseline gap-1", "text-agg-success"), children: [
3356
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Typography, { variant: "label", className: "text-agg-success", children: config.formatPercent(value) }),
3357
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, { name: "triangle-up", size: "xxs", title: labels.eventItem.arbitrage })
3138
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: cn("flex items-center gap-1", "text-agg-success"), children: [
3139
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Typography, { variant: "label-strong", className: "text-agg-success", children: config.formatPercent(value) }),
3140
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3141
+ Icon,
3142
+ {
3143
+ name: "triangle-up",
3144
+ size: "small",
3145
+ title: labels.eventItem.arbitrage,
3146
+ className: "size-2!"
3147
+ }
3148
+ )
3358
3149
  ] });
3359
3150
  };
3360
3151
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
@@ -3379,9 +3170,10 @@ var EventListItemContent = ({
3379
3170
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3380
3171
  Typography,
3381
3172
  {
3382
- variant: "title",
3173
+ variant: "body-strong",
3383
3174
  className: cn(
3384
- "min-w-0 text-agg-base font-agg-bold leading-agg-6 whitespace-normal [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] md:block md:truncate md:whitespace-nowrap",
3175
+ "min-w-0 text-agg-base font-agg-bold leading-agg-6 ",
3176
+ "truncate text-wrap wrap-break-word line-clamp-2",
3385
3177
  classNames == null ? void 0 : classNames.title
3386
3178
  ),
3387
3179
  children: resolvedTitle
@@ -3398,7 +3190,7 @@ var EventListItemContent = ({
3398
3190
  "div",
3399
3191
  {
3400
3192
  className: cn(
3401
- "grid w-full grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-3",
3193
+ "flex flex-row gap-3 w-full items-center justify-between",
3402
3194
  classNames == null ? void 0 : classNames.outcomeRow
3403
3195
  ),
3404
3196
  children: [
@@ -3410,21 +3202,23 @@ var EventListItemContent = ({
3410
3202
  children: formattedTitle
3411
3203
  }
3412
3204
  ),
3413
- renderArbitrage(arbitragePercent),
3414
- showBadge ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3415
- Badge,
3416
- {
3417
- text: config.formatPercent(probability),
3418
- prefix: showVenueLogo ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VenueLogo, { venue: visibleOutcome.venue, size: "s" }) : void 0,
3419
- size: "l",
3420
- classNames: {
3421
- root: cn(
3422
- "h-9 min-w-[101px] justify-center px-4 text-agg-base leading-agg-6",
3423
- classNames == null ? void 0 : classNames.badge
3424
- )
3205
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-row gap-3 items-center justify-end", children: [
3206
+ renderArbitrage(arbitragePercent),
3207
+ showBadge ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3208
+ Badge,
3209
+ {
3210
+ text: config.formatPercent(probability),
3211
+ prefix: showVenueLogo ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VenueLogo, { venue: visibleOutcome.venue, size: "small" }) : void 0,
3212
+ size: "large",
3213
+ classNames: {
3214
+ root: cn(
3215
+ "h-9 min-w-[101px] justify-center px-4 text-agg-base leading-agg-6",
3216
+ classNames == null ? void 0 : classNames.badge
3217
+ )
3218
+ }
3425
3219
  }
3426
- }
3427
- ) : null
3220
+ ) : null
3221
+ ] })
3428
3222
  ]
3429
3223
  },
3430
3224
  `${visibleOutcome.market.id}-${visibleOutcome.outcome.id}`
@@ -3439,7 +3233,7 @@ var EventListItemContent = ({
3439
3233
  classNames == null ? void 0 : classNames.footer
3440
3234
  ),
3441
3235
  children: [
3442
- /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: cn("flex items-center gap-2", "text-agg-sm leading-agg-5"), children: [
3236
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: cn("flex items-center gap-1", "text-agg-sm leading-agg-5"), children: [
3443
3237
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "truncate text-agg-muted-foreground", children: formatCountLabel(
3444
3238
  marketCount,
3445
3239
  labels.eventItem.marketSingular,
@@ -3447,16 +3241,33 @@ var EventListItemContent = ({
3447
3241
  ) }),
3448
3242
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-agg-muted-foreground", children: "\xD7" }),
3449
3243
  singleVenue ? /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { className: "flex items-center gap-1 truncate text-agg-muted-foreground", children: [
3450
- showVenueLogo ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VenueLogo, { venue: singleVenue, size: "xs" }) : null,
3244
+ showVenueLogo ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3245
+ VenueLogo,
3246
+ {
3247
+ venue: singleVenue,
3248
+ size: "small",
3249
+ isMonochromatic: true,
3250
+ className: "text-agg-muted-foreground!"
3251
+ }
3252
+ ) : null,
3451
3253
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { children: venueLabel })
3452
3254
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "truncate text-agg-muted-foreground", children: formatCountLabel(
3453
3255
  venueCount,
3454
3256
  labels.eventItem.venueSingular,
3455
3257
  labels.eventItem.venuePlural
3456
3258
  ) }),
3457
- showVenueLogo && !singleVenue && visibleVenueLogos.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "flex items-center gap-1 overflow-hidden", children: visibleVenueLogos.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VenueLogo, { venue, size: "xs" }, venue)) }) : null
3259
+ showVenueLogo && !singleVenue && visibleVenueLogos.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "flex items-center gap-1 overflow-hidden", children: visibleVenueLogos.map((venue) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3260
+ VenueLogo,
3261
+ {
3262
+ venue,
3263
+ size: "small",
3264
+ isMonochromatic: true,
3265
+ className: "text-agg-muted-foreground!"
3266
+ },
3267
+ venue
3268
+ )) }) : null
3458
3269
  ] }),
3459
- volumeLabel ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Typography, { variant: "meta", className: "text-agg-sm", children: volumeLabel }) : null
3270
+ volumeLabel ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Typography, { variant: "label", className: "text-agg-sm text-agg-muted-foreground", children: volumeLabel }) : null
3460
3271
  ]
3461
3272
  }
3462
3273
  )
@@ -3474,7 +3285,7 @@ var EventListItemByEventId = (_a) => {
3474
3285
  event: fetchedEvent,
3475
3286
  isError,
3476
3287
  isLoading
3477
- } = (0, import_hooks11.useEvent)(eventId, {
3288
+ } = (0, import_hooks12.useEvent)(eventId, {
3478
3289
  enabled: !!eventId
3479
3290
  });
3480
3291
  const resolvedEvent = (0, import_react3.useMemo)(() => {
@@ -3570,7 +3381,7 @@ var resolveTabVenus = (tab) => {
3570
3381
  var import_jsx_runtime62 = require("react/jsx-runtime");
3571
3382
  var renderTabIcon = (tab, isActive) => {
3572
3383
  if (tab.venueLogo) {
3573
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(VenueLogo, { venue: tab.venueLogo, size: "xs" });
3384
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(VenueLogo, { venue: tab.venueLogo, size: "small" });
3574
3385
  }
3575
3386
  if (!tab.iconName)
3576
3387
  return null;
@@ -3578,11 +3389,37 @@ var renderTabIcon = (tab, isActive) => {
3578
3389
  Icon,
3579
3390
  {
3580
3391
  name: tab.iconName,
3581
- size: "s",
3392
+ size: "small",
3582
3393
  color: isActive ? "var(--agg-color-primary)" : "var(--agg-color-foreground)"
3583
3394
  }
3584
3395
  );
3585
3396
  };
3397
+ var TAB_MIN_WIDTH = 80;
3398
+ var TAB_HORIZONTAL_PADDING = 32;
3399
+ var TAB_ICON_AND_GAP_WIDTH = 24;
3400
+ var TAB_OUTER_BORDER_WIDTH = 2;
3401
+ var TAB_INNER_BORDER_WIDTH = 1;
3402
+ var measureTabLabelWidth = (label) => {
3403
+ if (typeof document === "undefined")
3404
+ return label.length * 9;
3405
+ const canvas = document.createElement("canvas");
3406
+ const context = canvas.getContext("2d");
3407
+ if (!context)
3408
+ return label.length * 9;
3409
+ context.font = "700 16px Inter";
3410
+ return context.measureText(label).width;
3411
+ };
3412
+ var estimateTabsWidth = (items) => {
3413
+ if (items.length === 0)
3414
+ return 0;
3415
+ const tabsWidth = items.reduce((sum, item) => {
3416
+ const textWidth = Math.ceil(measureTabLabelWidth(item.label));
3417
+ const iconWidth = item.icon ? TAB_ICON_AND_GAP_WIDTH : 0;
3418
+ const buttonWidth = Math.max(TAB_MIN_WIDTH, textWidth + iconWidth + TAB_HORIZONTAL_PADDING);
3419
+ return sum + buttonWidth;
3420
+ }, 0);
3421
+ return tabsWidth + TAB_OUTER_BORDER_WIDTH + (items.length - 1) * TAB_INNER_BORDER_WIDTH;
3422
+ };
3586
3423
  var EventList = ({
3587
3424
  title,
3588
3425
  maxItemsPerRow = 3,
@@ -3593,13 +3430,14 @@ var EventList = ({
3593
3430
  categoryIds
3594
3431
  }) => {
3595
3432
  var _a, _b;
3596
- const labels = (0, import_hooks12.useLabels)();
3433
+ const labels = (0, import_hooks13.useLabels)();
3597
3434
  const defaultEventListTabs = (0, import_react4.useMemo)(() => {
3598
3435
  return getDefaultEventListTabs(labels);
3599
3436
  }, [labels]);
3600
3437
  const [activeTabValue, setActiveTabValue] = (0, import_react4.useState)(
3601
3438
  (_b = (_a = defaultEventListTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
3602
3439
  );
3440
+ const [shouldUseSelectOverflow, setShouldUseSelectOverflow] = (0, import_react4.useState)(false);
3603
3441
  const activeTab = (0, import_react4.useMemo)(() => {
3604
3442
  return defaultEventListTabs.find((tab) => tab.value === activeTabValue);
3605
3443
  }, [activeTabValue]);
@@ -3613,7 +3451,7 @@ var EventList = ({
3613
3451
  }, [maxVisibleItems]);
3614
3452
  const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
3615
3453
  const shouldPaginate = resolvedMaxVisibleItems == null;
3616
- const { events, isLoading, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = (0, import_hooks12.useEvents)({
3454
+ const { events, isLoading, isError, fetchNextPage, hasNextPage, isFetchingNextPage } = (0, import_hooks13.useEvents)({
3617
3455
  venues,
3618
3456
  search,
3619
3457
  categoryIds,
@@ -3639,6 +3477,46 @@ var EventList = ({
3639
3477
  };
3640
3478
  });
3641
3479
  }, [activeTabValue]);
3480
+ const headerRef = (0, import_react4.useRef)(null);
3481
+ const titleRef = (0, import_react4.useRef)(null);
3482
+ const updateTabsOverflowBehavior = (0, import_react4.useCallback)(() => {
3483
+ if (typeof window === "undefined")
3484
+ return;
3485
+ const headerElement = headerRef.current;
3486
+ const titleElement = titleRef.current;
3487
+ if (!headerElement || !titleElement)
3488
+ return;
3489
+ const isDesktop = window.matchMedia("(min-width: 768px)").matches;
3490
+ if (!isDesktop) {
3491
+ setShouldUseSelectOverflow(false);
3492
+ return;
3493
+ }
3494
+ const headerStyles = window.getComputedStyle(headerElement);
3495
+ const rawGap = headerStyles.columnGap || headerStyles.gap || "0";
3496
+ const horizontalGap = Number.parseFloat(rawGap) || 0;
3497
+ const availableTabsWidth = headerElement.clientWidth - titleElement.getBoundingClientRect().width - horizontalGap;
3498
+ const estimatedTabsWidth = estimateTabsWidth(tabsItems);
3499
+ setShouldUseSelectOverflow(availableTabsWidth > 0 && estimatedTabsWidth > availableTabsWidth);
3500
+ }, [tabsItems]);
3501
+ (0, import_react4.useEffect)(() => {
3502
+ updateTabsOverflowBehavior();
3503
+ }, [updateTabsOverflowBehavior]);
3504
+ (0, import_react4.useEffect)(() => {
3505
+ if (typeof ResizeObserver === "undefined")
3506
+ return;
3507
+ const headerElement = headerRef.current;
3508
+ const titleElement = titleRef.current;
3509
+ if (!headerElement || !titleElement)
3510
+ return;
3511
+ const resizeObserver = new ResizeObserver(() => {
3512
+ updateTabsOverflowBehavior();
3513
+ });
3514
+ resizeObserver.observe(headerElement);
3515
+ resizeObserver.observe(titleElement);
3516
+ return () => {
3517
+ resizeObserver.disconnect();
3518
+ };
3519
+ }, [updateTabsOverflowBehavior]);
3642
3520
  const resolvedMaxItemsPerRow = Number.isFinite(maxItemsPerRow) ? Math.max(1, Math.floor(maxItemsPerRow)) : 1;
3643
3521
  const loadingPlaceholderCount = isFetchingNextPage ? Math.min(resolvedMaxItemsPerRow, resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : Infinity) : 0;
3644
3522
  const shouldRenderLoadingState = isLoading && tileEvents.length === 0;
@@ -3680,19 +3558,25 @@ var EventList = ({
3680
3558
  return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Skeleton, { view: "event-list", ariaLabel: labels.eventList.loading(title) });
3681
3559
  }
3682
3560
  return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("section", { className: "flex w-full flex-col gap-5", children: [
3683
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("header", { className: "flex flex-col md:flex-row w-full flex-nowrap items-start md:items-center justify-between gap-2 md:gap-4", children: [
3684
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { as: "h2", variant: "value", className: "truncate [&::first-letter]:uppercase", children: title }),
3685
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
3686
- Tabs,
3687
- {
3688
- ariaLabel: labels.eventList.tabsAria(title),
3689
- className: "max-w-full",
3690
- items: tabsItems,
3691
- value: activeTabValue,
3692
- onChange: setActiveTabValue
3693
- }
3694
- )
3695
- ] }),
3561
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
3562
+ "header",
3563
+ {
3564
+ ref: headerRef,
3565
+ className: "flex flex-col sm:flex-row w-full flex-nowrap items-start sm:items-center justify-between gap-2 sm:gap-4",
3566
+ children: [
3567
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { ref: titleRef, className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Typography, { as: "h2", variant: "title", className: "truncate [&::first-letter]:uppercase", children: title }) }),
3568
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
3569
+ Tabs,
3570
+ {
3571
+ ariaLabel: labels.eventList.tabsAria(title),
3572
+ items: tabsItems,
3573
+ value: activeTabValue,
3574
+ onChange: setActiveTabValue
3575
+ }
3576
+ )
3577
+ ]
3578
+ }
3579
+ ),
3696
3580
  /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: gridClassName, style: gridStyle, children: [
3697
3581
  tileEvents.map((event) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
3698
3582
  EventListItem,
@@ -3873,11 +3757,11 @@ var HomePage = ({
3873
3757
  categoriesLimit = DEFAULT_CATEGORIES_LIMIT,
3874
3758
  allCategoryTabLabel = DEFAULT_ALL_CATEGORY_TAB_LABEL
3875
3759
  }) => {
3876
- const labels = (0, import_hooks13.useLabels)();
3760
+ const labels = (0, import_hooks14.useLabels)();
3877
3761
  const hasCustomTabs = !!tabs && tabs.length > 0;
3878
3762
  const shouldUseCategoriesTabs = !hasCustomTabs && useCategoriesTabs;
3879
3763
  const resolvedAllCategoryTabLabel = allCategoryTabLabel === DEFAULT_ALL_CATEGORY_TAB_LABEL ? labels.home.trending : allCategoryTabLabel;
3880
- const { categories } = (0, import_hooks13.useCategories)({
3764
+ const { categories } = (0, import_hooks14.useCategories)({
3881
3765
  limit: categoriesLimit,
3882
3766
  enabled: shouldUseCategoriesTabs
3883
3767
  });
@@ -3913,7 +3797,7 @@ var HomePage = ({
3913
3797
  Icon,
3914
3798
  {
3915
3799
  name: tab.iconName,
3916
- size: "m",
3800
+ size: "medium",
3917
3801
  color: isActive ? "var(--agg-color-primary)" : "var(--agg-color-foreground)"
3918
3802
  }
3919
3803
  ) : void 0,