@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
@@ -68,9 +68,6 @@ var import_hooks14 = require("@agg-market/hooks");
68
68
  // src/primitives/card/index.tsx
69
69
  var import_hooks = require("@agg-market/hooks");
70
70
 
71
- // src/constants.ts
72
- var AGG_ROOT_CLASS_NAME = "agg-root";
73
-
74
71
  // src/shared/utils.ts
75
72
  var cn = (...values) => values.filter(Boolean).join(" ");
76
73
  var getMotionClassName = (enabled, ...values) => {
@@ -95,19 +92,23 @@ var toDate = (value) => {
95
92
  // src/primitives/card/index.tsx
96
93
  var import_jsx_runtime = require("react/jsx-runtime");
97
94
  var Card = (_a) => {
98
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
95
+ var _b = _a, { className, onClick } = _b, props = __objRest(_b, ["className", "onClick"]);
99
96
  const { enableAnimations } = (0, import_hooks.useSdkUiConfig)();
100
97
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
98
  "div",
102
- __spreadValues({
99
+ __spreadValues(__spreadValues({
103
100
  className: cn(
101
+ "group/agg-card",
104
102
  "flex w-full flex-col font-agg-sans",
105
103
  "rounded-agg-xl border border-agg-separator",
106
104
  "bg-agg-secondary text-agg-foreground shadow-agg-card",
107
- getMotionClassName(enableAnimations, "transition-shadow hover:shadow-agg-card-hover"),
105
+ getMotionClassName(
106
+ enableAnimations,
107
+ "transition-shadow hover:shadow-agg-card-hover duration-300 ease-in-out"
108
+ ),
108
109
  className
109
110
  )
110
- }, props)
111
+ }, onClick ? { onClick } : {}), props)
111
112
  );
112
113
  };
113
114
  Card.displayName = "Card";
@@ -194,7 +195,10 @@ var SwitchButton = ({
194
195
  "div",
195
196
  {
196
197
  className: cn(
198
+ "group/agg-switch",
197
199
  "inline-flex min-w-0 rounded-agg-full bg-agg-secondary-hover font-agg-sans",
200
+ getMotionClassName(enableAnimations, "transition-background duration-200 ease-in-out"),
201
+ "cursor-pointer hover:bg-agg-tertiary",
198
202
  className
199
203
  ),
200
204
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
@@ -214,7 +218,7 @@ var SwitchButton = ({
214
218
  "pointer-events-none absolute inset-y-0 left-0 rounded-agg-full border-2 border-agg-primary bg-agg-secondary",
215
219
  getMotionClassName(
216
220
  enableAnimations,
217
- "transition-transform duration-[450ms] ease-[cubic-bezier(0.77,0,0.175,1)]"
221
+ "transition-transform duration-500 ease-[cubic-bezier(0.77,0,0.175,1)]"
218
222
  )
219
223
  ),
220
224
  style: {
@@ -238,15 +242,19 @@ var SwitchButton = ({
238
242
  disabled: option.disabled,
239
243
  className: cn(
240
244
  "relative z-10 min-w-0 rounded-agg-full px-5 py-1.5 font-agg-sans text-agg-base leading-agg-6 text-agg-foreground",
241
- getMotionClassName(enableAnimations, "transition-colors duration-300"),
245
+ getMotionClassName(
246
+ enableAnimations,
247
+ "transition-[colors] duration-200 ease-in-out"
248
+ ),
242
249
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary-hover",
243
- "disabled:cursor-not-allowed disabled:text-agg-muted-foreground",
250
+ "cursor-pointer disabled:cursor-not-allowed disabled:text-agg-muted-foreground",
244
251
  isActive ? "font-agg-bold" : "font-agg-normal"
245
252
  ),
246
- onClick: () => {
247
- if (option.disabled || isActive) {
253
+ onClick: (e) => {
254
+ e.preventDefault();
255
+ e.stopPropagation();
256
+ if (option.disabled || isActive)
248
257
  return;
249
- }
250
258
  onValueChange(option.value);
251
259
  },
252
260
  onKeyDown: (event) => {
@@ -424,7 +432,7 @@ var LineChart = ({
424
432
  seriesSwitchAriaLabel: labels.common.lineChartSeriesSwitchAria,
425
433
  formatSeriesOptionAriaLabel: labels.common.lineChartSeriesOptionAria
426
434
  }) : null : null;
427
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cn("w-full", classNames == null ? void 0 : classNames.root), style: { width }, children: [
435
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cn("group/agg-chart", "w-full", classNames == null ? void 0 : classNames.root), style: { width }, children: [
428
436
  !isLoading && seriesControls ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn("mb-3", classNames == null ? void 0 : classNames.controls), children: seriesControls }) : null,
429
437
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
430
438
  "div",
@@ -505,7 +513,7 @@ var EventListItemSkeletonView = ({
505
513
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
506
514
  Card,
507
515
  {
508
- className: cn(baseCardClassName, className),
516
+ className: cn("group/agg-skeleton", baseCardClassName, className),
509
517
  role: isStandalone ? "status" : void 0,
510
518
  "aria-label": isStandalone ? ariaLabel != null ? ariaLabel : labels.eventItem.loading : void 0,
511
519
  "aria-busy": isStandalone || void 0,
@@ -554,7 +562,7 @@ var EventListSkeletonView = ({ className, ariaLabel }) => {
554
562
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
555
563
  "section",
556
564
  {
557
- className: cn("flex w-full flex-col gap-5", className),
565
+ className: cn("group/agg-skeleton", "flex w-full flex-col gap-5", className),
558
566
  role: "status",
559
567
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventList.loading("events"),
560
568
  "aria-busy": true,
@@ -612,7 +620,7 @@ var EventListItemDetailsSkeletonView = ({
612
620
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
613
621
  Card,
614
622
  {
615
- className: cn(detailsBaseCardClassName, className),
623
+ className: cn("group/agg-skeleton", detailsBaseCardClassName, className),
616
624
  role: "status",
617
625
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading,
618
626
  "aria-busy": true,
@@ -673,7 +681,7 @@ var MarketDetailsSkeletonView = ({
673
681
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
674
682
  Card,
675
683
  {
676
- className: cn(marketDetailsBaseCardClassName, className),
684
+ className: cn("group/agg-skeleton", marketDetailsBaseCardClassName, className),
677
685
  role: "status",
678
686
  "aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.loading,
679
687
  "aria-busy": true,
@@ -743,7 +751,7 @@ MarketDetailsSkeletonView.displayName = "MarketDetailsSkeletonView";
743
751
  var import_jsx_runtime9 = require("react/jsx-runtime");
744
752
  var placeOrderCardClassName = "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
745
753
  var ContentBody = () => {
746
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [
754
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: cn("flex flex-col gap-6 p-5"), children: [
747
755
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2", children: [
748
756
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-start justify-between gap-5", children: [
749
757
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
@@ -810,7 +818,7 @@ var PlaceOrderSkeletonView = ({
810
818
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
811
819
  "div",
812
820
  {
813
- className: cn("w-full", className),
821
+ className: cn("group/agg-skeleton", "w-full", className),
814
822
  role: "status",
815
823
  "aria-label": ariaLabel != null ? ariaLabel : "Loading place order",
816
824
  "aria-busy": true,
@@ -844,6 +852,7 @@ var SettlementSkeletonView = ({
844
852
  Card,
845
853
  {
846
854
  className: cn(
855
+ "group/agg-skeleton",
847
856
  "flex flex-col w-full gap-5 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none",
848
857
  className
849
858
  ),
@@ -929,7 +938,10 @@ Skeleton.displayName = "Skeleton";
929
938
  // src/primitives/tabs/index.tsx
930
939
  var import_react4 = require("react");
931
940
  var import_hooks11 = require("@agg-market/hooks");
932
- var DropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
941
+
942
+ // src/primitives/select/index.tsx
943
+ var import_react3 = require("react");
944
+ var import_hooks10 = require("@agg-market/hooks");
933
945
 
934
946
  // src/primitives/icon/types.ts
935
947
  var getIconA11yProps = (title) => ({
@@ -992,14 +1004,10 @@ var ArrowsToDotIcon = (_a) => {
992
1004
  /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
993
1005
  "path",
994
1006
  {
995
- 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",
996
- stroke: "currentColor",
997
- strokeWidth: "1.25",
998
- strokeLinecap: "round",
999
- strokeLinejoin: "round"
1007
+ 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",
1008
+ fill: "currentColor"
1000
1009
  }
1001
- ),
1002
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("circle", { cx: "8", cy: "8", r: "1.5", fill: "currentColor" })
1010
+ )
1003
1011
  ]
1004
1012
  })
1005
1013
  );
@@ -1533,14 +1541,9 @@ InfoIcon.displayName = "InfoIcon";
1533
1541
 
1534
1542
  // src/primitives/icon/icon.constants.ts
1535
1543
  var iconSizeClasses = {
1536
- xxs: "h-2 w-2",
1537
- xs: "h-3 w-3",
1538
- s: "h-4 w-4",
1539
- ms: "h-5 w-5",
1540
- m: "h-6 w-6",
1541
- l: "h-8 w-8",
1542
- xl: "h-10 w-10",
1543
- xxl: "h-12 w-12"
1544
+ small: "h-4 w-4",
1545
+ medium: "h-6 w-6",
1546
+ large: "h-8 w-8"
1544
1547
  };
1545
1548
 
1546
1549
  // src/primitives/icon/svg/check-badge.tsx
@@ -2246,7 +2249,7 @@ var Icon = (_a) => {
2246
2249
  var _b = _a, {
2247
2250
  name,
2248
2251
  color,
2249
- size = "m",
2252
+ size = "medium",
2250
2253
  className = "text-agg-primary",
2251
2254
  style
2252
2255
  } = _b, props = __objRest(_b, [
@@ -2259,13 +2262,18 @@ var Icon = (_a) => {
2259
2262
  const Component = iconRegistry[name];
2260
2263
  const resolvedStyle = resolveIconStyle(color, style);
2261
2264
  const resolvedClassName = cn(iconSizeClasses[size], className);
2262
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Component, __spreadValues({ color, className: resolvedClassName, style: resolvedStyle }, props));
2265
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2266
+ Component,
2267
+ __spreadValues({
2268
+ color,
2269
+ className: cn("group/agg-icon", resolvedClassName),
2270
+ style: resolvedStyle
2271
+ }, props)
2272
+ );
2263
2273
  };
2264
2274
  Icon.displayName = "Icon";
2265
2275
 
2266
2276
  // src/primitives/select/index.tsx
2267
- var import_react3 = require("react");
2268
- var import_hooks10 = require("@agg-market/hooks");
2269
2277
  var import_jsx_runtime54 = require("react/jsx-runtime");
2270
2278
  var Select = ({
2271
2279
  items,
@@ -2287,7 +2295,7 @@ var Select = ({
2287
2295
  if (!isOpen)
2288
2296
  return;
2289
2297
  const handlePointerDown = (e) => {
2290
- if (containerRef.current && !containerRef.current.contains(e.target)) {
2298
+ if (containerRef.current && !containerRef.current.contains(e == null ? void 0 : e.target)) {
2291
2299
  close();
2292
2300
  }
2293
2301
  };
@@ -2298,7 +2306,7 @@ var Select = ({
2298
2306
  if (!isOpen)
2299
2307
  return;
2300
2308
  const handleKey = (e) => {
2301
- if (e.key === "Escape")
2309
+ if ((e == null ? void 0 : e.key) === "Escape")
2302
2310
  close();
2303
2311
  };
2304
2312
  document.addEventListener("keydown", handleKey);
@@ -2307,7 +2315,7 @@ var Select = ({
2307
2315
  const isDisabled = disabled || !hasEnabledItems;
2308
2316
  const selectedItem = items.find((item) => item.value === value);
2309
2317
  if (!hasAnyIcon) {
2310
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("label", { className: cn("relative inline-flex w-full", className), children: [
2318
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("label", { className: cn("group/agg-select", "relative inline-flex w-full", className), children: [
2311
2319
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2312
2320
  "select",
2313
2321
  {
@@ -2316,7 +2324,7 @@ var Select = ({
2316
2324
  "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",
2317
2325
  getMotionClassName(
2318
2326
  enableAnimations,
2319
- "transition-[border-color,box-shadow] duration-200 ease-out"
2327
+ "transition-[border-color,box-shadow] duration-200 ease-in-out"
2320
2328
  ),
2321
2329
  "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
2322
2330
  "disabled:cursor-not-allowed disabled:opacity-60"
@@ -2327,88 +2335,95 @@ var Select = ({
2327
2335
  children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("option", { value: item.value, disabled: item.disabled, children: item.label }, item.value))
2328
2336
  }
2329
2337
  ),
2330
- /* @__PURE__ */ (0, import_jsx_runtime54.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_runtime54.jsx)(Icon, { name: "chevron-down", size: "s", color: "currentColor" }) })
2338
+ /* @__PURE__ */ (0, import_jsx_runtime54.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_runtime54.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) })
2331
2339
  ] });
2332
2340
  }
2333
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { ref: containerRef, className: cn("relative inline-flex w-full", className), children: [
2334
- /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2335
- "button",
2336
- {
2337
- type: "button",
2338
- "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2339
- "aria-expanded": isOpen,
2340
- "aria-haspopup": "listbox",
2341
- disabled: isDisabled,
2342
- className: cn(
2343
- "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",
2344
- "flex items-center gap-2 text-left",
2345
- getMotionClassName(
2346
- enableAnimations,
2347
- "transition-[border-color,box-shadow] duration-200 ease-out"
2348
- ),
2349
- "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
2350
- "disabled:cursor-not-allowed disabled:opacity-60"
2351
- ),
2352
- onClick: () => setIsOpen((prev) => !prev),
2353
- children: [
2354
- (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2355
- "img",
2356
- {
2357
- src: selectedItem.iconUrl,
2358
- alt: "",
2359
- className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2360
- }
2361
- ) : null,
2362
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
2363
- ]
2364
- }
2365
- ),
2366
- /* @__PURE__ */ (0, import_jsx_runtime54.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_runtime54.jsx)(Icon, { name: "chevron-down", size: "s", color: "currentColor" }) }),
2367
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2368
- "div",
2369
- {
2370
- role: "listbox",
2371
- "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2372
- 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",
2373
- children: items.map((item) => {
2374
- const isSelected = item.value === value;
2375
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2376
- "button",
2377
- {
2378
- type: "button",
2379
- role: "option",
2380
- "aria-selected": isSelected,
2381
- disabled: item.disabled,
2382
- className: cn(
2383
- "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
2384
- "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
2385
- isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
2386
- item.disabled && "cursor-not-allowed opacity-60"
2341
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2342
+ "div",
2343
+ {
2344
+ ref: containerRef,
2345
+ className: cn("group/agg-select", "relative inline-flex w-full", className),
2346
+ children: [
2347
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2348
+ "button",
2349
+ {
2350
+ type: "button",
2351
+ "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2352
+ "aria-expanded": isOpen,
2353
+ "aria-haspopup": "listbox",
2354
+ disabled: isDisabled,
2355
+ className: cn(
2356
+ "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",
2357
+ "flex items-center gap-2 text-left",
2358
+ getMotionClassName(
2359
+ enableAnimations,
2360
+ "transition-[border-color,box-shadow] duration-200 ease-in-out"
2387
2361
  ),
2388
- onClick: () => {
2389
- if (!item.disabled) {
2390
- onChange(item.value);
2391
- close();
2362
+ "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
2363
+ "disabled:cursor-not-allowed disabled:opacity-60"
2364
+ ),
2365
+ onClick: () => setIsOpen((prev) => !prev),
2366
+ children: [
2367
+ (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2368
+ "img",
2369
+ {
2370
+ src: selectedItem.iconUrl,
2371
+ alt: "",
2372
+ className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2392
2373
  }
2393
- },
2394
- children: [
2395
- item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2396
- "img",
2397
- {
2398
- src: item.iconUrl,
2399
- alt: "",
2400
- className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2401
- }
2402
- ) : null,
2403
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "truncate", children: item.label })
2404
- ]
2405
- },
2406
- item.value
2407
- );
2408
- })
2409
- }
2410
- ) : null
2411
- ] });
2374
+ ) : null,
2375
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
2376
+ ]
2377
+ }
2378
+ ),
2379
+ /* @__PURE__ */ (0, import_jsx_runtime54.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_runtime54.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) }),
2380
+ isOpen ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2381
+ "div",
2382
+ {
2383
+ role: "listbox",
2384
+ "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2385
+ 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",
2386
+ children: items.map((item) => {
2387
+ const isSelected = item.value === value;
2388
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2389
+ "button",
2390
+ {
2391
+ type: "button",
2392
+ role: "option",
2393
+ "aria-selected": isSelected,
2394
+ disabled: item.disabled,
2395
+ className: cn(
2396
+ "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
2397
+ "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
2398
+ isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
2399
+ item.disabled && "cursor-not-allowed opacity-60"
2400
+ ),
2401
+ onClick: () => {
2402
+ if (!item.disabled) {
2403
+ onChange(item.value);
2404
+ close();
2405
+ }
2406
+ },
2407
+ children: [
2408
+ item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2409
+ "img",
2410
+ {
2411
+ src: item.iconUrl,
2412
+ alt: "",
2413
+ className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2414
+ }
2415
+ ) : null,
2416
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "truncate", children: item.label })
2417
+ ]
2418
+ },
2419
+ item.value
2420
+ );
2421
+ })
2422
+ }
2423
+ ) : null
2424
+ ]
2425
+ }
2426
+ );
2412
2427
  };
2413
2428
  Select.displayName = "Select";
2414
2429
 
@@ -2435,86 +2450,10 @@ var findEdgeEnabledIndex = (items, direction) => {
2435
2450
  }
2436
2451
  return -1;
2437
2452
  };
2438
- var FALLBACK_TAB_WIDTH = 112;
2439
- var FALLBACK_MORE_WIDTH = 56;
2440
- var sumWidths = (indices, widths) => {
2441
- return [...indices].reduce((accumulator, index) => {
2442
- var _a;
2443
- return accumulator + ((_a = widths[index]) != null ? _a : 0);
2444
- }, 0);
2445
- };
2446
- var resolveTabsOverflowLayout = ({
2447
- items,
2448
- value,
2449
- containerWidth,
2450
- moreButtonWidth,
2451
- itemWidthByValue
2452
- }) => {
2453
- var _a;
2454
- if (items.length === 0) {
2455
- return {
2456
- visibleItems: [],
2457
- hiddenItems: []
2458
- };
2459
- }
2460
- if (!Number.isFinite(containerWidth) || containerWidth <= 0) {
2461
- return {
2462
- visibleItems: items,
2463
- hiddenItems: []
2464
- };
2465
- }
2466
- const resolvedItemWidths = items.map((item) => {
2467
- var _a2;
2468
- const measuredWidth = (_a2 = itemWidthByValue.get(item.value)) != null ? _a2 : FALLBACK_TAB_WIDTH;
2469
- return Math.max(1, measuredWidth);
2470
- });
2471
- const totalItemsWidth = resolvedItemWidths.reduce((sum, width) => {
2472
- return sum + width;
2473
- }, 0);
2474
- if (totalItemsWidth <= containerWidth) {
2475
- return {
2476
- visibleItems: items,
2477
- hiddenItems: []
2478
- };
2479
- }
2480
- const reservedMoreWidth = Math.max(1, moreButtonWidth || FALLBACK_MORE_WIDTH);
2481
- const visibleIndices = /* @__PURE__ */ new Set();
2482
- let usedWidth = 0;
2483
- for (let index = 0; index < items.length; index += 1) {
2484
- const itemWidth = (_a = resolvedItemWidths[index]) != null ? _a : FALLBACK_TAB_WIDTH;
2485
- const hasRemainingItems = index < items.length - 1;
2486
- const requiredExtraWidth = hasRemainingItems ? reservedMoreWidth : 0;
2487
- if (usedWidth + itemWidth + requiredExtraWidth > containerWidth)
2488
- break;
2489
- visibleIndices.add(index);
2490
- usedWidth += itemWidth;
2491
- }
2492
- if (visibleIndices.size === 0) {
2493
- visibleIndices.add(0);
2494
- }
2495
- const activeIndex = items.findIndex((item) => item.value === value);
2496
- const isActiveHidden = activeIndex >= 0 && !visibleIndices.has(activeIndex);
2497
- if (isActiveHidden && activeIndex >= 0) {
2498
- visibleIndices.add(activeIndex);
2499
- while (visibleIndices.size > 1) {
2500
- const visibleWidth = sumWidths(visibleIndices, resolvedItemWidths);
2501
- if (visibleWidth + reservedMoreWidth <= containerWidth)
2502
- break;
2503
- const removableIndex = [...visibleIndices].sort((left, right) => right - left).find((index) => index !== activeIndex);
2504
- if (removableIndex == null)
2505
- break;
2506
- visibleIndices.delete(removableIndex);
2507
- }
2508
- }
2509
- return {
2510
- visibleItems: items.filter((_, index) => visibleIndices.has(index)),
2511
- hiddenItems: items.filter((_, index) => !visibleIndices.has(index))
2512
- };
2513
- };
2514
2453
 
2515
2454
  // src/primitives/tabs/index.tsx
2516
2455
  var import_jsx_runtime55 = require("react/jsx-runtime");
2517
- var mobileTabsMediaQuery = "(max-width: 767px)";
2456
+ var mobileTabsMediaQuery = "(max-width: 512px)";
2518
2457
  var getTabButtonClassName = ({
2519
2458
  enableAnimations,
2520
2459
  isBarVariant,
@@ -2526,7 +2465,11 @@ var getTabButtonClassName = ({
2526
2465
  return cn(
2527
2466
  "cursor-pointer disabled:cursor-not-allowed",
2528
2467
  "relative inline-flex h-full shrink-0 items-center justify-center gap-2 font-agg-sans",
2529
- getMotionClassName(enableAnimations, "transition-colors motion-reduce:transition-none"),
2468
+ isBarVariant ? "hover:text-agg-foreground hover:bg-agg-secondary-hover" : "hover:text-agg-foreground hover:font-bold",
2469
+ getMotionClassName(
2470
+ enableAnimations,
2471
+ "transition-[colors] duration-300 ease-in-out motion-reduce:transition-none"
2472
+ ),
2530
2473
  isBarVariant ? cn(
2531
2474
  "min-w-20 overflow-hidden border-r border-agg-separator last:border-r-0",
2532
2475
  isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
@@ -2538,35 +2481,6 @@ var getTabButtonClassName = ({
2538
2481
  isDisabled && "cursor-not-allowed opacity-60"
2539
2482
  );
2540
2483
  };
2541
- var getMeasureTabClassName = ({
2542
- isBarVariant,
2543
- size
2544
- }) => {
2545
- const isSmall = size === "s";
2546
- return cn(
2547
- "relative inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-agg-sans",
2548
- isBarVariant ? cn(
2549
- "h-8 min-w-20 border-r border-agg-separator font-agg-bold",
2550
- isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
2551
- ) : cn(
2552
- "h-12 font-agg-bold",
2553
- isSmall ? "px-4 text-agg-sm leading-agg-5" : "px-5 text-agg-base leading-agg-6"
2554
- )
2555
- );
2556
- };
2557
- var getMoreButtonClassName = ({
2558
- enableAnimations,
2559
- isBarVariant,
2560
- size
2561
- }) => {
2562
- const isSmall = size === "s";
2563
- return cn(
2564
- "cursor-pointer disabled:cursor-not-allowed",
2565
- "relative inline-flex shrink-0 items-center justify-center overflow-hidden font-agg-sans text-agg-foreground hover:bg-agg-secondary-hover",
2566
- getMotionClassName(enableAnimations, "transition-colors motion-reduce:transition-none"),
2567
- 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")
2568
- );
2569
- };
2570
2484
  var Tabs = ({
2571
2485
  items,
2572
2486
  value,
@@ -2574,12 +2488,12 @@ var Tabs = ({
2574
2488
  variant = "bar",
2575
2489
  size = "m",
2576
2490
  overflowBehavior,
2577
- overflowMenuAriaLabel,
2578
2491
  ariaLabel,
2579
- className
2492
+ className,
2493
+ classNames
2580
2494
  }) => {
2581
2495
  const labels = (0, import_hooks11.useLabels)();
2582
- const { enableAnimations, rootClassName } = (0, import_hooks11.useSdkUiConfig)();
2496
+ const { enableAnimations } = (0, import_hooks11.useSdkUiConfig)();
2583
2497
  const buttonRefs = (0, import_react4.useRef)([]);
2584
2498
  const dragStateRef = (0, import_react4.useRef)({
2585
2499
  isPointerDown: false,
@@ -2591,8 +2505,6 @@ var Tabs = ({
2591
2505
  });
2592
2506
  const suppressClickRef = (0, import_react4.useRef)(false);
2593
2507
  const resolvedAriaLabel = ariaLabel != null ? ariaLabel : labels.common.tabsAria;
2594
- const resolvedOverflowMenuAriaLabel = overflowMenuAriaLabel != null ? overflowMenuAriaLabel : labels.common.hiddenTabsAria;
2595
- const [isMoreMenuOpen, setIsMoreMenuOpen] = (0, import_react4.useState)(false);
2596
2508
  const [isMobileViewport, setIsMobileViewport] = (0, import_react4.useState)(false);
2597
2509
  const [isDraggingTabs, setIsDraggingTabs] = (0, import_react4.useState)(false);
2598
2510
  const [activeUnderlineStyle, setActiveUnderlineStyle] = (0, import_react4.useState)({
@@ -2600,39 +2512,21 @@ var Tabs = ({
2600
2512
  width: 0,
2601
2513
  opacity: 0
2602
2514
  });
2603
- const [overflowLayout, setOverflowLayout] = (0, import_react4.useState)({
2604
- visibleItems: items,
2605
- hiddenItems: []
2606
- });
2607
2515
  const [scrollAffordanceState, setScrollAffordanceState] = (0, import_react4.useState)({
2608
2516
  showStart: false,
2609
2517
  showEnd: false
2610
2518
  });
2611
- const containerRef = (0, import_react4.useRef)(null);
2612
2519
  const tabListRef = (0, import_react4.useRef)(null);
2613
- const moreButtonMeasureRef = (0, import_react4.useRef)(null);
2614
- const tabMeasureRefs = (0, import_react4.useRef)(/* @__PURE__ */ new Map());
2615
2520
  const isBarVariant = variant === "bar";
2616
2521
  const resolvedOverflowBehavior = (0, import_react4.useMemo)(() => {
2617
2522
  if (overflowBehavior)
2618
2523
  return overflowBehavior;
2619
2524
  if (!isBarVariant)
2620
2525
  return "scroll";
2621
- return isMobileViewport ? "select" : "menu";
2526
+ return isMobileViewport ? "select" : "scroll";
2622
2527
  }, [isBarVariant, isMobileViewport, overflowBehavior]);
2623
- const shouldUseOverflowMenu = resolvedOverflowBehavior === "menu";
2624
2528
  const shouldUseOverflowScroll = resolvedOverflowBehavior === "scroll";
2625
2529
  const shouldUseOverflowSelect = resolvedOverflowBehavior === "select";
2626
- const handleMeasureTabRef = (0, import_react4.useCallback)(
2627
- (tabValue, tabElement) => {
2628
- if (!tabElement) {
2629
- tabMeasureRefs.current.delete(tabValue);
2630
- return;
2631
- }
2632
- tabMeasureRefs.current.set(tabValue, tabElement);
2633
- },
2634
- []
2635
- );
2636
2530
  (0, import_react4.useEffect)(() => {
2637
2531
  if (typeof window === "undefined")
2638
2532
  return;
@@ -2652,55 +2546,6 @@ var Tabs = ({
2652
2546
  mediaQueryList.removeListener(handleMediaQueryChange);
2653
2547
  };
2654
2548
  }, []);
2655
- const handleRecalculateOverflow = (0, import_react4.useCallback)(() => {
2656
- var _a, _b, _c, _d;
2657
- if (!shouldUseOverflowMenu) {
2658
- setOverflowLayout({
2659
- visibleItems: items,
2660
- hiddenItems: []
2661
- });
2662
- return;
2663
- }
2664
- const containerWidth = (_b = (_a = containerRef.current) == null ? void 0 : _a.clientWidth) != null ? _b : 0;
2665
- const moreButtonWidth = (_d = (_c = moreButtonMeasureRef.current) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
2666
- const itemWidthByValue = new Map(
2667
- items.map((item) => {
2668
- var _a2, _b2;
2669
- return [item.value, (_b2 = (_a2 = tabMeasureRefs.current.get(item.value)) == null ? void 0 : _a2.offsetWidth) != null ? _b2 : 0];
2670
- })
2671
- );
2672
- setOverflowLayout(
2673
- resolveTabsOverflowLayout({
2674
- items,
2675
- value,
2676
- containerWidth,
2677
- moreButtonWidth,
2678
- itemWidthByValue
2679
- })
2680
- );
2681
- }, [items, shouldUseOverflowMenu, value]);
2682
- (0, import_react4.useEffect)(() => {
2683
- handleRecalculateOverflow();
2684
- }, [handleRecalculateOverflow]);
2685
- (0, import_react4.useEffect)(() => {
2686
- if (!shouldUseOverflowMenu)
2687
- return;
2688
- const container = containerRef.current;
2689
- if (!container || typeof ResizeObserver === "undefined")
2690
- return;
2691
- const resizeObserver = new ResizeObserver(() => {
2692
- handleRecalculateOverflow();
2693
- });
2694
- resizeObserver.observe(container);
2695
- return () => {
2696
- resizeObserver.disconnect();
2697
- };
2698
- }, [handleRecalculateOverflow, shouldUseOverflowMenu]);
2699
- (0, import_react4.useEffect)(() => {
2700
- if (overflowLayout.hiddenItems.length > 0)
2701
- return;
2702
- setIsMoreMenuOpen(false);
2703
- }, [overflowLayout.hiddenItems.length]);
2704
2549
  const updateScrollAffordances = (0, import_react4.useCallback)(() => {
2705
2550
  if (!shouldUseOverflowScroll) {
2706
2551
  setScrollAffordanceState({
@@ -2718,8 +2563,7 @@ var Tabs = ({
2718
2563
  showEnd: maxScrollLeft - tabListElement.scrollLeft > 4
2719
2564
  });
2720
2565
  }, [shouldUseOverflowScroll]);
2721
- const renderedItems = shouldUseOverflowMenu ? overflowLayout.visibleItems : items;
2722
- const shouldShowMoreButton = shouldUseOverflowMenu && overflowLayout.hiddenItems.length > 0;
2566
+ const renderedItems = items;
2723
2567
  const selectItems = (0, import_react4.useMemo)(() => {
2724
2568
  return items.map((item) => ({
2725
2569
  value: item.value,
@@ -2744,24 +2588,24 @@ var Tabs = ({
2744
2588
  (_a = buttonRefs.current[index]) == null ? void 0 : _a.focus();
2745
2589
  };
2746
2590
  const handleKeyDown = (event, index) => {
2747
- switch (event.key) {
2591
+ switch (event == null ? void 0 : event.key) {
2748
2592
  case "ArrowRight": {
2749
- event.preventDefault();
2593
+ event == null ? void 0 : event.preventDefault();
2750
2594
  handleMoveFocus(findNextEnabledIndex(renderedItems, index, 1));
2751
2595
  return;
2752
2596
  }
2753
2597
  case "ArrowLeft": {
2754
- event.preventDefault();
2598
+ event == null ? void 0 : event.preventDefault();
2755
2599
  handleMoveFocus(findNextEnabledIndex(renderedItems, index, -1));
2756
2600
  return;
2757
2601
  }
2758
2602
  case "Home": {
2759
- event.preventDefault();
2603
+ event == null ? void 0 : event.preventDefault();
2760
2604
  handleMoveFocus(findEdgeEnabledIndex(renderedItems, 1));
2761
2605
  return;
2762
2606
  }
2763
2607
  case "End": {
2764
- event.preventDefault();
2608
+ event == null ? void 0 : event.preventDefault();
2765
2609
  handleMoveFocus(findEdgeEnabledIndex(renderedItems, -1));
2766
2610
  return;
2767
2611
  }
@@ -2769,22 +2613,16 @@ var Tabs = ({
2769
2613
  return;
2770
2614
  }
2771
2615
  };
2772
- const activeHiddenItem = (0, import_react4.useMemo)(() => {
2773
- if (!shouldUseOverflowMenu)
2774
- return void 0;
2775
- return overflowLayout.hiddenItems.find((item) => item.value === value);
2776
- }, [overflowLayout.hiddenItems, shouldUseOverflowMenu, value]);
2777
2616
  const tabListClassName = cn(
2778
2617
  "inline-flex items-stretch bg-agg-secondary",
2779
- shouldUseOverflowMenu ? "min-w-0 flex-1 overflow-hidden" : shouldUseOverflowScroll ? cn(
2618
+ shouldUseOverflowScroll ? cn(
2780
2619
  "overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
2781
2620
  getMotionClassName(enableAnimations, "scroll-smooth")
2782
2621
  ) : "overflow-x-auto",
2783
2622
  isBarVariant ? "h-8 rounded-agg-sm border border-agg-separator" : "h-12 border-b border-agg-separator -mb-[1px]",
2784
2623
  shouldUseOverflowScroll && "select-none",
2785
2624
  shouldUseOverflowScroll && !isBarVariant && "snap-x snap-mandatory",
2786
- shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab"),
2787
- shouldShowMoreButton && isBarVariant && "rounded-r-none border-r-0"
2625
+ shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab")
2788
2626
  );
2789
2627
  const handleTabListWheel = (event) => {
2790
2628
  if (!shouldUseOverflowScroll)
@@ -2873,14 +2711,10 @@ var Tabs = ({
2873
2711
  const handleTabListClickCapture = (event) => {
2874
2712
  if (!suppressClickRef.current)
2875
2713
  return;
2876
- event.preventDefault();
2877
- event.stopPropagation();
2714
+ event == null ? void 0 : event.preventDefault();
2715
+ event == null ? void 0 : event.stopPropagation();
2878
2716
  suppressClickRef.current = false;
2879
2717
  };
2880
- const handleSelectHiddenItem = (nextValue) => {
2881
- handleSelect(nextValue);
2882
- setIsMoreMenuOpen(false);
2883
- };
2884
2718
  const updateActiveUnderline = (0, import_react4.useCallback)(() => {
2885
2719
  if (isBarVariant) {
2886
2720
  setActiveUnderlineStyle({
@@ -2948,18 +2782,34 @@ var Tabs = ({
2948
2782
  (0, import_react4.useEffect)(() => {
2949
2783
  if (!shouldUseOverflowScroll)
2950
2784
  return;
2785
+ const tabListElement = tabListRef.current;
2786
+ if (!tabListElement)
2787
+ return;
2951
2788
  const activeIndex = renderedItems.findIndex((item) => item.value === value);
2952
2789
  const activeButton = activeIndex >= 0 ? buttonRefs.current[activeIndex] : null;
2953
2790
  if (!activeButton)
2954
2791
  return;
2955
- activeButton.scrollIntoView({
2956
- behavior: getScrollBehavior(enableAnimations),
2957
- block: "nearest",
2958
- inline: "nearest"
2792
+ if (tabListElement.scrollWidth - tabListElement.clientWidth <= 1)
2793
+ return;
2794
+ const currentScrollLeft = tabListElement.scrollLeft;
2795
+ const currentScrollRight = currentScrollLeft + tabListElement.clientWidth;
2796
+ const activeButtonLeft = activeButton.offsetLeft;
2797
+ const activeButtonRight = activeButtonLeft + activeButton.offsetWidth;
2798
+ let nextScrollLeft = currentScrollLeft;
2799
+ if (activeButtonLeft < currentScrollLeft) {
2800
+ nextScrollLeft = activeButtonLeft;
2801
+ } else if (activeButtonRight > currentScrollRight) {
2802
+ nextScrollLeft = activeButtonRight - tabListElement.clientWidth;
2803
+ }
2804
+ if (Math.abs(nextScrollLeft - currentScrollLeft) < 1)
2805
+ return;
2806
+ tabListElement.scrollTo({
2807
+ left: Math.max(0, nextScrollLeft),
2808
+ behavior: getScrollBehavior(enableAnimations)
2959
2809
  });
2960
2810
  }, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
2961
2811
  if (shouldUseOverflowSelect) {
2962
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
2812
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: cn("w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
2963
2813
  Select,
2964
2814
  {
2965
2815
  ariaLabel,
@@ -2974,10 +2824,12 @@ var Tabs = ({
2974
2824
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
2975
2825
  "div",
2976
2826
  {
2977
- ref: containerRef,
2978
2827
  className: cn(
2979
- "relative inline-flex max-w-full items-stretch font-agg-sans bg-agg-secondary",
2980
- className
2828
+ "group/agg-tabs",
2829
+ "relative max-w-full items-stretch font-agg-sans bg-agg-secondary",
2830
+ "inline-flex",
2831
+ className,
2832
+ classNames == null ? void 0 : classNames.root
2981
2833
  ),
2982
2834
  children: [
2983
2835
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
@@ -2986,7 +2838,7 @@ var Tabs = ({
2986
2838
  ref: tabListRef,
2987
2839
  role: "tablist",
2988
2840
  "aria-label": resolvedAriaLabel,
2989
- className: cn("relative", tabListClassName),
2841
+ className: cn("relative", tabListClassName, classNames == null ? void 0 : classNames.tabList),
2990
2842
  onClickCapture: handleTabListClickCapture,
2991
2843
  onPointerCancel: handleEndTabListDrag,
2992
2844
  onPointerDown: handleTabListPointerDown,
@@ -3008,7 +2860,11 @@ var Tabs = ({
3008
2860
  "aria-selected": isActive,
3009
2861
  "aria-label": item.label,
3010
2862
  disabled: item.disabled,
3011
- onClick: () => handleSelect(item.value),
2863
+ onClick: (e) => {
2864
+ e.preventDefault();
2865
+ e.stopPropagation();
2866
+ handleSelect(item.value);
2867
+ },
3012
2868
  onKeyDown: (event) => handleKeyDown(event, index),
3013
2869
  className: cn(
3014
2870
  getTabButtonClassName({
@@ -3050,7 +2906,7 @@ var Tabs = ({
3050
2906
  "pointer-events-none absolute bottom-0 left-0 rounded-t-agg-sm bg-agg-primary",
3051
2907
  getMotionClassName(
3052
2908
  enableAnimations,
3053
- "transition-[transform,width,opacity] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]"
2909
+ "transition-[transform,width,opacity] duration-300 ease-in-out"
3054
2910
  ),
3055
2911
  "h-[3px]"
3056
2912
  ),
@@ -3066,7 +2922,7 @@ var Tabs = ({
3066
2922
  {
3067
2923
  "aria-hidden": true,
3068
2924
  className: cn(
3069
- "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",
2925
+ "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",
3070
2926
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
3071
2927
  scrollAffordanceState.showStart ? "opacity-100" : "opacity-0"
3072
2928
  )
@@ -3077,104 +2933,13 @@ var Tabs = ({
3077
2933
  {
3078
2934
  "aria-hidden": true,
3079
2935
  className: cn(
3080
- "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",
2936
+ "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",
3081
2937
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
3082
2938
  scrollAffordanceState.showEnd ? "opacity-100" : "opacity-0"
3083
2939
  )
3084
2940
  }
3085
2941
  )
3086
- ] }) : null,
3087
- shouldShowMoreButton ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenu.Root, { open: isMoreMenuOpen, onOpenChange: setIsMoreMenuOpen, children: [
3088
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
3089
- "button",
3090
- {
3091
- type: "button",
3092
- "aria-label": resolvedOverflowMenuAriaLabel,
3093
- className: cn(
3094
- getMoreButtonClassName({
3095
- enableAnimations,
3096
- isBarVariant,
3097
- size
3098
- }),
3099
- activeHiddenItem ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground"
3100
- ),
3101
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { name: "dots-horizontal", size: isBarVariant ? "s" : "m", color: "currentColor" })
3102
- }
3103
- ) }),
3104
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
3105
- DropdownMenu.Content,
3106
- {
3107
- align: "end",
3108
- "aria-label": resolvedOverflowMenuAriaLabel,
3109
- className: cn(
3110
- AGG_ROOT_CLASS_NAME,
3111
- rootClassName,
3112
- "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"
3113
- ),
3114
- "data-agg-animations": enableAnimations ? "true" : "false",
3115
- sideOffset: 8,
3116
- children: overflowLayout.hiddenItems.map((item) => {
3117
- const isSelected = item.value === value;
3118
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
3119
- DropdownMenu.Item,
3120
- {
3121
- disabled: item.disabled,
3122
- onSelect: () => handleSelectHiddenItem(item.value),
3123
- className: cn(
3124
- "cursor-pointer disabled:cursor-not-allowed",
3125
- "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
3126
- getMotionClassName(enableAnimations, "transition-colors"),
3127
- "focus:bg-agg-secondary-hover data-[highlighted]:bg-agg-secondary-hover",
3128
- isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
3129
- item.disabled && "cursor-not-allowed opacity-60"
3130
- ),
3131
- children: [
3132
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
3133
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "truncate whitespace-nowrap [&::first-letter]:uppercase", children: item.label })
3134
- ]
3135
- },
3136
- item.value
3137
- );
3138
- })
3139
- }
3140
- ) })
3141
- ] }) : null,
3142
- shouldUseOverflowMenu ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
3143
- "div",
3144
- {
3145
- "aria-hidden": true,
3146
- className: "pointer-events-none invisible fixed top-0 left-0 -z-10 h-0 overflow-hidden whitespace-nowrap",
3147
- children: [
3148
- items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
3149
- "span",
3150
- {
3151
- ref: (tabElement) => handleMeasureTabRef(item.value, tabElement),
3152
- className: getMeasureTabClassName({
3153
- isBarVariant,
3154
- size
3155
- }),
3156
- children: [
3157
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
3158
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: item.label })
3159
- ]
3160
- },
3161
- `measure-${item.value}`
3162
- )),
3163
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
3164
- "span",
3165
- {
3166
- ref: moreButtonMeasureRef,
3167
- className: getMoreButtonClassName({
3168
- enableAnimations,
3169
- isBarVariant,
3170
- size
3171
- }),
3172
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Icon, { name: "dots-horizontal", size: isBarVariant ? "s" : "m", color: "currentColor" })
3173
- }
3174
- )
3175
- ]
3176
- }
3177
- ) : null
2942
+ ] }) : null
3178
2943
  ]
3179
2944
  }
3180
2945
  );
@@ -3182,21 +2947,22 @@ var Tabs = ({
3182
2947
  Tabs.displayName = "Tabs";
3183
2948
 
3184
2949
  // src/primitives/typography/typography.constants.ts
3185
- var variantClasses = {
3186
- title: cn("font-agg-sans text-agg-lg leading-agg-7", "font-agg-bold", "text-agg-foreground"),
3187
- body: cn("font-agg-sans text-agg-base leading-agg-6", "font-agg-normal", "text-agg-foreground"),
3188
- meta: cn(
3189
- "font-agg-sans text-agg-sm leading-agg-5",
3190
- "font-agg-normal",
3191
- "text-agg-muted-foreground"
3192
- ),
3193
- label: cn(
3194
- "font-agg-sans text-agg-sm leading-agg-5",
3195
- "font-agg-bold uppercase",
3196
- "text-agg-foreground"
3197
- ),
3198
- value: cn("font-agg-sans text-agg-xl leading-agg-7", "font-agg-normal", "text-agg-foreground"),
3199
- caption: cn("font-agg-sans text-agg-xs leading-agg-4", "font-agg-normal", "text-agg-foreground")
2950
+ var typographyVariantClasses = {
2951
+ display: cn("agg-type-display"),
2952
+ heading: cn("agg-type-heading"),
2953
+ title: cn("agg-type-title"),
2954
+ "title-strong": cn("agg-type-title-strong"),
2955
+ "body-large": cn("agg-type-body-large"),
2956
+ "body-large-strong": cn("agg-type-body-large-strong"),
2957
+ body: cn("agg-type-body"),
2958
+ "body-strong": cn("agg-type-body-strong"),
2959
+ label: cn("agg-type-label"),
2960
+ "label-strong": cn("agg-type-label-strong"),
2961
+ "label-caps": cn("agg-type-label-caps"),
2962
+ caption: cn("agg-type-caption"),
2963
+ "caption-strong": cn("agg-type-caption-strong"),
2964
+ "caption-caps": cn("agg-type-caption-caps"),
2965
+ overline: cn("agg-type-overline")
3200
2966
  };
3201
2967
 
3202
2968
  // src/primitives/typography/index.tsx
@@ -3207,7 +2973,18 @@ var Typography = ({
3207
2973
  className,
3208
2974
  children
3209
2975
  }) => {
3210
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Component, { className: cn(variantClasses[variant], "truncate", className), children });
2976
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
2977
+ Component,
2978
+ {
2979
+ className: cn(
2980
+ "group/agg-typography",
2981
+ "text-agg-foreground",
2982
+ typographyVariantClasses[variant],
2983
+ className
2984
+ ),
2985
+ children
2986
+ }
2987
+ );
3211
2988
  };
3212
2989
  Typography.displayName = "Typography";
3213
2990
 
@@ -3215,7 +2992,7 @@ Typography.displayName = "Typography";
3215
2992
  var import_hooks12 = require("@agg-market/hooks");
3216
2993
 
3217
2994
  // src/primitives/venue-logo/logo-props.ts
3218
- var DEFAULT_MONOCHROME_COLOR = "#000000";
2995
+ var DEFAULT_MONOCHROME_COLOR = "currentColor";
3219
2996
  var resolveLogoPrimaryColor = ({
3220
2997
  brandColor,
3221
2998
  isColor = true,
@@ -3413,14 +3190,9 @@ var venueLogoRegistry = {
3413
3190
  };
3414
3191
  var venueLogoNames = Object.keys(venueLogoRegistry);
3415
3192
  var sizeClasses = {
3416
- xxs: "h-2 w-2",
3417
- xs: "h-3 w-3",
3418
- s: "h-4 w-4",
3419
- ms: "h-5 w-5",
3420
- m: "h-6 w-6",
3421
- l: "h-8 w-8",
3422
- xl: "h-10 w-10",
3423
- xxl: "h-12 w-12"
3193
+ small: "h-4 w-4",
3194
+ medium: "h-6 w-6",
3195
+ large: "h-8 w-8"
3424
3196
  };
3425
3197
 
3426
3198
  // src/primitives/venue-logo/index.tsx
@@ -3430,7 +3202,7 @@ var VenueLogo = ({
3430
3202
  isColor = true,
3431
3203
  isMonochromatic = false,
3432
3204
  color,
3433
- size = "m",
3205
+ size = "medium",
3434
3206
  className,
3435
3207
  ariaLabel,
3436
3208
  title
@@ -3442,7 +3214,7 @@ var VenueLogo = ({
3442
3214
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
3443
3215
  Component,
3444
3216
  {
3445
- className: cn("shrink-0", sizeClass, className),
3217
+ className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
3446
3218
  isColor: resolvedIsColor,
3447
3219
  color,
3448
3220
  "aria-label": ariaLabel != null ? ariaLabel : labels.venues[venue],
@@ -3456,7 +3228,7 @@ VenueLogo.displayName = "VenueLogo";
3456
3228
  var import_hooks13 = require("@agg-market/hooks");
3457
3229
  var import_jsx_runtime62 = require("react/jsx-runtime");
3458
3230
  var LoadingIcon = ({
3459
- size = "m",
3231
+ size = "medium",
3460
3232
  className,
3461
3233
  ariaLabel
3462
3234
  }) => {
@@ -3468,6 +3240,7 @@ var LoadingIcon = ({
3468
3240
  role: "status",
3469
3241
  "aria-label": ariaLabel != null ? ariaLabel : labels.common.loading,
3470
3242
  className: cn(
3243
+ "group/agg-loading-icon",
3471
3244
  "inline-grid place-items-center text-agg-primary will-change-transform",
3472
3245
  className
3473
3246
  ),
@@ -3971,8 +3744,8 @@ var MarketDetailsUnavailableState = ({
3971
3744
  role: "status",
3972
3745
  "aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
3973
3746
  children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
3974
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "title", children: labels.marketDetails.unavailableTitle }),
3975
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "meta", children: labels.marketDetails.unavailableDescription })
3747
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
3748
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
3976
3749
  ] })
3977
3750
  }
3978
3751
  );
@@ -3988,11 +3761,11 @@ var OrderBookRows = ({
3988
3761
  const priceClassName = isAsks ? "text-agg-orderbook-ask" : "text-agg-orderbook-bid";
3989
3762
  const barClassName = isAsks ? "bg-agg-orderbook-ask/10" : "bg-agg-orderbook-bid/10";
3990
3763
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col gap-2", children: [
3991
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "label", className: "text-agg-xs leading-agg-4", children: title }),
3764
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "caption-caps", children: title }),
3992
3765
  rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col gap-2", children: [
3993
3766
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "grid grid-cols-[52px_1fr_1fr_52px] items-center gap-2 md:grid-cols-[88px_1fr_1fr_minmax(120px,220px)] md:gap-6", children: [
3994
3767
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center gap-1 md:gap-3", children: [
3995
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(VenueLogo, { venue: row.venue, size: "xs" }),
3768
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(VenueLogo, { venue: row.venue, size: "small" }),
3996
3769
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3997
3770
  "span",
3998
3771
  {
@@ -4026,11 +3799,15 @@ var getOutcomeButtonClassName = ({
4026
3799
  isPositive,
4027
3800
  isActive
4028
3801
  }) => {
3802
+ const defaultStateClassName = isPositive ? "border-[#18c15c]/50 bg-[#18c15c]/5 text-agg-foreground hover:bg-[#18c15c]/10" : "border-[#e5455f]/50 bg-[#e5455f]/5 text-agg-foreground hover:bg-[#e5455f]/10";
3803
+ const activeStateClassName = isPositive ? "border-transparent bg-[#18c15c] text-agg-on-primary" : "border-transparent bg-[#e5455f] text-agg-on-primary";
4029
3804
  return cn(
4030
3805
  "h-auto min-h-10 flex-1 rounded-agg-full border px-4 py-1.5 text-agg-base leading-agg-6 shadow-none md:flex-none md:min-w-[168px]",
4031
- getMotionClassName(enableAnimations, "transition-all duration-300"),
4032
- isPositive ? "border-agg-orderbook-bid/50 bg-agg-orderbook-bid/5 text-agg-foreground" : "border-agg-orderbook-ask/50 bg-agg-orderbook-ask/5 text-agg-foreground",
4033
- isActive && (isPositive ? "border-agg-orderbook-bid" : "border-agg-orderbook-ask")
3806
+ getMotionClassName(enableAnimations, "transition-all duration-300 ease-in-out"),
3807
+ isActive ? activeStateClassName : defaultStateClassName,
3808
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary-hover",
3809
+ "cursor-pointer disabled:cursor-not-allowed disabled:text-agg-muted-foreground",
3810
+ isActive ? "font-agg-bold" : "font-agg-normal"
4034
3811
  );
4035
3812
  };
4036
3813
  var MarketDetailsContent = ({
@@ -4237,7 +4014,7 @@ var MarketDetailsContent = ({
4237
4014
  }, [labels, model]);
4238
4015
  const handleOutcomeKeyDown = (eventToHandle) => {
4239
4016
  var _a;
4240
- if (eventToHandle.key !== "ArrowLeft" && eventToHandle.key !== "ArrowRight") {
4017
+ if ((eventToHandle == null ? void 0 : eventToHandle.key) !== "ArrowLeft" && (eventToHandle == null ? void 0 : eventToHandle.key) !== "ArrowRight") {
4241
4018
  return;
4242
4019
  }
4243
4020
  if (headerOutcomeItems.length <= 1)
@@ -4249,9 +4026,17 @@ var MarketDetailsContent = ({
4249
4026
  const nextIndex = activeIndex < 0 ? 0 : (activeIndex + direction + headerOutcomeItems.length) % headerOutcomeItems.length;
4250
4027
  setSelectedOutcomeLabel((_a = headerOutcomeItems[nextIndex]) == null ? void 0 : _a.label);
4251
4028
  };
4252
- const handleToggleExpanded = () => {
4253
- setIsOpened((prev) => !prev);
4254
- onOpenChange == null ? void 0 : onOpenChange(!isOpened);
4029
+ const handleToggleExpanded = (event2) => {
4030
+ if (event2 && "key" in event2 && (event2 == null ? void 0 : event2.key) !== "Enter" && (event2 == null ? void 0 : event2.key) !== " ") {
4031
+ return;
4032
+ }
4033
+ event2 == null ? void 0 : event2.preventDefault();
4034
+ event2 == null ? void 0 : event2.stopPropagation();
4035
+ setIsOpened((prev) => {
4036
+ const next = !prev;
4037
+ onOpenChange == null ? void 0 : onOpenChange(next);
4038
+ return next;
4039
+ });
4255
4040
  };
4256
4041
  const handleGraphVenueToggle = (venue) => {
4257
4042
  setSelectedGraphVenue((currentVenue) => {
@@ -4275,88 +4060,101 @@ var MarketDetailsContent = ({
4275
4060
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
4276
4061
  Card,
4277
4062
  {
4278
- className: cn(marketDetailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
4279
- "aria-label": ariaLabel != null ? ariaLabel : model.title,
4063
+ className: cn(
4064
+ "w-full cursor-pointer rounded-agg-2xl text-left outline-none",
4065
+ marketDetailsBaseCardClassName,
4066
+ classNames == null ? void 0 : classNames.root
4067
+ ),
4068
+ "aria-expanded": isOpened,
4069
+ "aria-controls": detailsContentId,
4070
+ role: "button",
4071
+ tabIndex: 0,
4072
+ "aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
4073
+ onClick: handleToggleExpanded,
4074
+ onKeyDown: handleToggleExpanded,
4280
4075
  children: [
4281
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cn("flex flex-col gap-3 px-5 py-4", isOpened && "pb-3", classNames == null ? void 0 : classNames.header), children: [
4282
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
4283
- "button",
4284
- {
4285
- type: "button",
4286
- className: "flex w-full cursor-pointer items-center justify-between gap-4 rounded-agg-2xl text-left outline-none",
4287
- "aria-expanded": isOpened,
4288
- "aria-controls": detailsContentId,
4289
- "aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
4290
- onClick: handleToggleExpanded,
4291
- children: [
4292
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
4293
- model.image ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4294
- "img",
4295
- {
4296
- src: model.image,
4297
- alt: "",
4298
- className: "size-12 rounded-agg-lg object-cover md:size-[60px]"
4299
- }
4300
- ) : null,
4301
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
4302
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { as: "h3", variant: "title", className: "truncate text-agg-lg leading-agg-7", children: model.title }),
4303
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "meta", className: "truncate text-agg-sm leading-agg-5", children: model.subtitle }) })
4304
- ] })
4305
- ] }),
4306
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4307
- Typography,
4076
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
4077
+ "div",
4078
+ {
4079
+ className: cn(
4080
+ "flex flex-row items-center justify-between gap-3 px-5 py-4",
4081
+ isOpened && "pb-3",
4082
+ classNames == null ? void 0 : classNames.header
4083
+ ),
4084
+ children: [
4085
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
4086
+ model.image ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4087
+ "img",
4308
4088
  {
4309
- as: "div",
4310
- variant: "value",
4311
- className: "shrink-0 text-agg-2xl font-agg-bold leading-agg-8",
4312
- children: formatProbabilityPercent(headlineProbability)
4089
+ src: model.image,
4090
+ alt: "",
4091
+ className: "size-12 rounded-agg-lg object-cover md:size-[60px]"
4313
4092
  }
4314
- )
4315
- ]
4316
- }
4317
- ),
4318
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4319
- "div",
4320
- {
4321
- className: "flex gap-2",
4322
- role: "tablist",
4323
- "aria-label": labels.marketDetails.marketOutcomesAria,
4324
- tabIndex: 0,
4325
- onKeyDown: handleOutcomeKeyDown,
4326
- children: headerOutcomeItems.map((item) => {
4327
- const isPositive = item.tone === "positive";
4328
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4329
- "button",
4330
- {
4331
- type: "button",
4332
- role: "tab",
4333
- "aria-selected": item.label === selectedOutcomeLabel,
4334
- tabIndex: item.label === selectedOutcomeLabel ? 0 : -1,
4335
- className: getOutcomeButtonClassName({
4336
- enableAnimations: config.enableAnimations,
4337
- isPositive,
4338
- isActive: item.label === selectedOutcomeLabel
4339
- }),
4340
- onClick: () => {
4341
- setSelectedOutcomeLabel(item.label);
4342
- },
4343
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
4344
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4345
- VenueLogo,
4346
- {
4347
- venue: isPositive ? "polymarket" : "probable",
4348
- size: "xs"
4349
- }
4350
- ),
4351
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { className: "text-agg-base leading-agg-6", children: `${item.label} ${formatProbabilityCents(item.probability)}` })
4352
- ] })
4353
- },
4354
- item.label
4355
- );
4356
- })
4357
- }
4358
- )
4359
- ] }),
4093
+ ) : null,
4094
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
4095
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { as: "h3", variant: "body-large-strong", className: "truncate", children: model.title }),
4096
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "label", className: "truncate text-agg-muted-foreground", children: model.subtitle }) })
4097
+ ] })
4098
+ ] }),
4099
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { as: "div", variant: "heading", className: "shrink-0", children: formatProbabilityPercent(headlineProbability) }),
4100
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4101
+ "div",
4102
+ {
4103
+ className: "flex gap-2",
4104
+ role: "tablist",
4105
+ "aria-label": labels.marketDetails.marketOutcomesAria,
4106
+ tabIndex: 0,
4107
+ onKeyDown: (e) => handleOutcomeKeyDown(e),
4108
+ children: headerOutcomeItems.map((item) => {
4109
+ const isPositive = item.tone === "positive";
4110
+ const isActiveOutcome = item.label === selectedOutcomeLabel;
4111
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4112
+ "button",
4113
+ {
4114
+ type: "button",
4115
+ role: "tab",
4116
+ "aria-selected": isActiveOutcome,
4117
+ tabIndex: isActiveOutcome ? 0 : -1,
4118
+ className: getOutcomeButtonClassName({
4119
+ enableAnimations: config.enableAnimations,
4120
+ isPositive,
4121
+ isActive: isActiveOutcome
4122
+ }),
4123
+ onClick: (e) => {
4124
+ e.preventDefault();
4125
+ e.stopPropagation();
4126
+ setSelectedOutcomeLabel(item.label);
4127
+ },
4128
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
4129
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4130
+ VenueLogo,
4131
+ {
4132
+ venue: isPositive ? "polymarket" : "probable",
4133
+ size: "small",
4134
+ color: isActiveOutcome ? "var(--agg-color-on-primary)" : void 0
4135
+ }
4136
+ ),
4137
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4138
+ Typography,
4139
+ {
4140
+ variant: isActiveOutcome ? "body-strong" : "body",
4141
+ className: cn(
4142
+ "text-agg-base leading-agg-6",
4143
+ isActiveOutcome ? "text-agg-on-primary" : "text-agg-foreground"
4144
+ ),
4145
+ children: `${item.label} ${formatProbabilityCents(item.probability)}`
4146
+ }
4147
+ )
4148
+ ] })
4149
+ },
4150
+ item.label
4151
+ );
4152
+ })
4153
+ }
4154
+ )
4155
+ ]
4156
+ }
4157
+ ),
4360
4158
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4361
4159
  "div",
4362
4160
  {
@@ -4408,7 +4206,7 @@ var MarketDetailsContent = ({
4408
4206
  "aria-busy": true,
4409
4207
  children: [
4410
4208
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LoadingIcon, {}),
4411
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "meta", children: labels.marketDetails.loadingOrderbookLabel })
4209
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.loadingOrderbookLabel })
4412
4210
  ]
4413
4211
  }
4414
4212
  ) : /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
@@ -4456,9 +4254,13 @@ var MarketDetailsContent = ({
4456
4254
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary-hover",
4457
4255
  isActiveVenue ? "border-agg-primary bg-agg-secondary" : "border-transparent bg-agg-secondary-hover"
4458
4256
  ),
4459
- onClick: () => handleGraphVenueToggle(item.venue),
4257
+ onClick: (e) => {
4258
+ e.preventDefault();
4259
+ e.stopPropagation();
4260
+ handleGraphVenueToggle(item.venue);
4261
+ },
4460
4262
  children: [
4461
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(VenueLogo, { venue: item.venue, size: "xs" }),
4263
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
4462
4264
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
4463
4265
  ]
4464
4266
  },
@@ -4503,7 +4305,11 @@ var MarketDetailsContent = ({
4503
4305
  isActive ? "font-agg-bold text-agg-foreground" : "font-agg-normal text-agg-muted-foreground"
4504
4306
  ),
4505
4307
  "aria-pressed": isActive,
4506
- onClick: () => setSelectedTimeRange(timeRange),
4308
+ onClick: (e) => {
4309
+ e.preventDefault();
4310
+ e.stopPropagation();
4311
+ setSelectedTimeRange(timeRange);
4312
+ },
4507
4313
  children: timeRange === "ALL" ? labels.eventItemDetails.allTimeRange : timeRange
4508
4314
  },
4509
4315
  timeRange
@@ -4518,7 +4324,7 @@ var MarketDetailsContent = ({
4518
4324
  {
4519
4325
  className: "flex items-center justify-between rounded-agg-xl bg-agg-secondary-hover px-4 py-3",
4520
4326
  children: [
4521
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "meta", children: row.label }),
4327
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
4522
4328
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
4523
4329
  ]
4524
4330
  },