@agg-market/ui 1.0.0 → 3.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 (129) 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-H4UIBDL2.mjs → chunk-LK5D3ZTK.mjs} +15 -15
  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.js +826 -764
  57. package/dist/event-market-page.mjs +19 -19
  58. package/dist/hello-world.js +28 -16
  59. package/dist/hello-world.mjs +2 -2
  60. package/dist/home-page.js +395 -511
  61. package/dist/home-page.mjs +12 -12
  62. package/dist/icon.d.mts +1 -1
  63. package/dist/icon.d.ts +1 -1
  64. package/dist/icon.js +15 -17
  65. package/dist/icon.mjs +2 -2
  66. package/dist/index.d.mts +4 -4
  67. package/dist/index.d.ts +4 -4
  68. package/dist/index.js +1135 -944
  69. package/dist/index.mjs +34 -32
  70. package/dist/loading-icon.d.mts +1 -1
  71. package/dist/loading-icon.d.ts +1 -1
  72. package/dist/loading-icon.js +5 -9
  73. package/dist/loading-icon.mjs +2 -2
  74. package/dist/market-details.d.mts +2 -2
  75. package/dist/market-details.d.ts +2 -2
  76. package/dist/market-details.js +357 -551
  77. package/dist/market-details.mjs +13 -13
  78. package/dist/modal.js +4 -0
  79. package/dist/modal.mjs +1 -1
  80. package/dist/onboarding-modal.js +63 -67
  81. package/dist/onboarding-modal.mjs +6 -6
  82. package/dist/place-order.js +231 -466
  83. package/dist/place-order.mjs +9 -9
  84. package/dist/profile-modal.js +52 -65
  85. package/dist/profile-modal.mjs +6 -6
  86. package/dist/search.d.mts +2 -2
  87. package/dist/search.d.ts +2 -2
  88. package/dist/search.js +28 -34
  89. package/dist/search.mjs +4 -4
  90. package/dist/select.js +104 -99
  91. package/dist/select.mjs +3 -3
  92. package/dist/settlement.js +279 -59
  93. package/dist/settlement.mjs +6 -6
  94. package/dist/skeleton.js +15 -10
  95. package/dist/skeleton.mjs +2 -2
  96. package/dist/styles.css +1 -1
  97. package/dist/switch-button.js +13 -6
  98. package/dist/switch-button.mjs +1 -1
  99. package/dist/tabs.d.mts +8 -4
  100. package/dist/tabs.d.ts +8 -4
  101. package/dist/tabs.js +163 -420
  102. package/dist/tabs.mjs +4 -4
  103. package/dist/tailwind.css +1 -1
  104. package/dist/types-BVj9ky9P.d.mts +3 -0
  105. package/dist/types-BVj9ky9P.d.ts +3 -0
  106. package/dist/typography.d.mts +4 -2
  107. package/dist/typography.d.ts +4 -2
  108. package/dist/typography.js +49 -18
  109. package/dist/typography.mjs +5 -3
  110. package/dist/user-profile-page.d.mts +2 -2
  111. package/dist/user-profile-page.d.ts +2 -2
  112. package/dist/user-profile-page.js +200 -474
  113. package/dist/user-profile-page.mjs +7 -7
  114. package/dist/venue-logo.d.mts +2 -2
  115. package/dist/venue-logo.d.ts +2 -2
  116. package/dist/venue-logo.js +6 -11
  117. package/dist/venue-logo.mjs +1 -1
  118. package/dist/{venue-logo.types-BSAuY84j.d.ts → venue-logo.types-D8Cu2rAm.d.ts} +1 -1
  119. package/dist/{venue-logo.types-DACqcTvY.d.mts → venue-logo.types-HRf1yBLD.d.mts} +1 -1
  120. package/dist/withdraw-modal.js +72 -85
  121. package/dist/withdraw-modal.mjs +6 -6
  122. package/package.json +2 -2
  123. package/dist/chunk-AEMAY3MR.mjs +0 -44
  124. package/dist/chunk-DYEWXEEY.mjs +0 -37
  125. package/dist/chunk-QFQHD2V6.mjs +0 -146
  126. package/dist/chunk-ZDF7QP4G.mjs +0 -160
  127. package/dist/chunk-ZVBVGWSP.mjs +0 -15
  128. package/dist/types-Bed6Q0EK.d.mts +0 -3
  129. package/dist/types-Bed6Q0EK.d.ts +0 -3
@@ -63,15 +63,15 @@ __export(event_market_exports, {
63
63
  });
64
64
  module.exports = __toCommonJS(event_market_exports);
65
65
  var import_react9 = require("react");
66
- var import_hooks20 = require("@agg-market/hooks");
66
+ var import_hooks21 = require("@agg-market/hooks");
67
67
  var import_dayjs5 = __toESM(require("dayjs"));
68
68
 
69
69
  // src/events/item-details/index.tsx
70
70
  var import_react3 = require("react");
71
- var import_hooks12 = require("@agg-market/hooks");
71
+ var import_hooks13 = require("@agg-market/hooks");
72
72
 
73
- // src/constants.ts
74
- var AGG_ROOT_CLASS_NAME = "agg-root";
73
+ // src/primitives/badge/index.tsx
74
+ var import_hooks = require("@agg-market/hooks");
75
75
 
76
76
  // src/shared/utils.ts
77
77
  var cn = (...values) => values.filter(Boolean).join(" ");
@@ -96,13 +96,9 @@ var toDate = (value) => {
96
96
 
97
97
  // src/primitives/badge/badge.constants.ts
98
98
  var badgeSizeClasses = {
99
- xxs: cn("h-4 px-1.5 gap-0.5", "text-agg-xs leading-agg-3"),
100
- xs: cn("h-5 px-2 gap-1", "text-agg-xs leading-agg-4"),
101
- s: cn("h-6 px-2.5 gap-1", "text-agg-sm leading-agg-5"),
102
- m: cn("h-7 px-3 gap-1.5", "text-agg-sm leading-agg-5"),
103
- l: cn("h-8 px-3.5 gap-1.5", "text-agg-base leading-agg-6"),
104
- xl: cn("h-9 px-4 gap-2", "text-agg-lg leading-agg-7"),
105
- xxl: cn("h-10 px-5 gap-2", "text-agg-xl leading-agg-7")
99
+ small: cn("py-1.5 px-4 gap-1.5", "agg-type-label"),
100
+ medium: cn("py-1.5 px-4 gap-2", "agg-type-body"),
101
+ large: cn("py-2.5 px-6 gap-2", "agg-type-body")
106
102
  };
107
103
  var baseBadgeClasses = cn(
108
104
  "inline-flex items-center justify-center rounded-agg-full font-agg-sans",
@@ -111,66 +107,70 @@ var baseBadgeClasses = cn(
111
107
 
112
108
  // src/primitives/badge/index.tsx
113
109
  var import_jsx_runtime = require("react/jsx-runtime");
114
- function Badge({ text, prefix, suffix, size = "m", classNames }) {
110
+ function Badge({
111
+ text,
112
+ prefix,
113
+ suffix,
114
+ size = "medium",
115
+ classNames,
116
+ onClick,
117
+ isActive = false
118
+ }) {
119
+ const { enableAnimations } = (0, import_hooks.useSdkUiConfig)();
115
120
  const resolvedText = `${text}`;
116
121
  const resolvedAriaLabel = resolvedText.length > 0 ? resolvedText : void 0;
117
122
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
118
123
  "span",
119
- {
124
+ __spreadProps(__spreadValues({
120
125
  "aria-label": resolvedAriaLabel,
121
- className: cn(baseBadgeClasses, badgeSizeClasses[size], classNames == null ? void 0 : classNames.root),
126
+ className: cn(
127
+ "group/agg-badge",
128
+ baseBadgeClasses,
129
+ badgeSizeClasses[size],
130
+ onClick ? "cursor-pointer hover:bg-agg-tertiary disabled:cursor-not-allowed" : "",
131
+ getMotionClassName(
132
+ enableAnimations,
133
+ "transition-[border-color,background-color] duration-200 ease-in-out"
134
+ ),
135
+ isActive ? "border-agg-primary bg-agg-secondary! font-agg-bold!" : "border-transparent font-agg-normal",
136
+ classNames == null ? void 0 : classNames.root
137
+ )
138
+ }, onClick && { onClick }), {
122
139
  children: [
123
140
  prefix ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classNames == null ? void 0 : classNames.prefix, children: prefix }) : null,
124
141
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cn("truncate", classNames == null ? void 0 : classNames.text), children: text }),
125
142
  suffix ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: classNames == null ? void 0 : classNames.suffix, children: suffix }) : null
126
143
  ]
127
- }
144
+ })
128
145
  );
129
146
  }
130
147
  Badge.displayName = "Badge";
131
148
 
132
149
  // src/primitives/button/index.tsx
133
- var import_hooks = require("@agg-market/hooks");
150
+ var import_hooks2 = require("@agg-market/hooks");
134
151
 
135
152
  // src/primitives/icon/icon.constants.ts
136
153
  var iconSizeClasses = {
137
- xxs: "h-2 w-2",
138
- xs: "h-3 w-3",
139
- s: "h-4 w-4",
140
- ms: "h-5 w-5",
141
- m: "h-6 w-6",
142
- l: "h-8 w-8",
143
- xl: "h-10 w-10",
144
- xxl: "h-12 w-12"
154
+ small: "h-4 w-4",
155
+ medium: "h-6 w-6",
156
+ large: "h-8 w-8"
145
157
  };
146
158
 
147
159
  // src/primitives/button/button.constants.ts
148
160
  var sizeClasses = {
149
- xxs: cn("h-6 px-2.5 gap-1", "text-agg-xs leading-agg-4"),
150
- xs: cn("h-7 px-3 gap-1", "text-agg-xs leading-agg-4"),
151
- s: cn("h-8 px-4 gap-1.5", "text-agg-sm leading-agg-5"),
152
- m: cn("h-9 px-5 gap-1.5", "text-agg-sm leading-agg-5"),
153
- l: cn("h-10 px-6 gap-2", "text-agg-base leading-agg-6"),
154
- xl: cn("h-11 px-7 gap-2", "text-agg-base leading-agg-6"),
155
- xxl: cn("h-12 px-8 gap-2", "text-agg-base leading-agg-6")
161
+ small: cn("h-8 px-4 gap-1.5", "text-agg-sm leading-agg-5"),
162
+ medium: cn("h-9 px-5 gap-1.5", "text-agg-sm leading-agg-5"),
163
+ large: cn("h-10 px-6 gap-2", "text-agg-base leading-agg-6")
156
164
  };
157
165
  var iconSizeClasses2 = {
158
- xxs: iconSizeClasses.xs,
159
- xs: iconSizeClasses.xs,
160
- s: iconSizeClasses.s,
161
- m: iconSizeClasses.s,
162
- l: iconSizeClasses.s,
163
- xl: iconSizeClasses.s,
164
- xxl: iconSizeClasses.s
166
+ small: iconSizeClasses.small,
167
+ medium: iconSizeClasses.small,
168
+ large: iconSizeClasses.small
165
169
  };
166
170
  var iconSlotClasses = {
167
- xxs: "[&_svg]:h-3 [&_svg]:w-3",
168
- xs: "[&_svg]:h-3 [&_svg]:w-3",
169
- s: "[&_svg]:h-4 [&_svg]:w-4",
170
- m: "[&_svg]:h-4 [&_svg]:w-4",
171
- l: "[&_svg]:h-4 [&_svg]:w-4",
172
- xl: "[&_svg]:h-4 [&_svg]:w-4",
173
- xxl: "[&_svg]:h-4 [&_svg]:w-4"
171
+ small: "[&_svg]:h-4 [&_svg]:w-4",
172
+ medium: "[&_svg]:h-4 [&_svg]:w-4",
173
+ large: "[&_svg]:h-4 [&_svg]:w-4"
174
174
  };
175
175
  var variantClasses = {
176
176
  primary: cn(
@@ -186,10 +186,11 @@ var variantClasses = {
186
186
  "focus-visible:ring-agg-separator"
187
187
  ),
188
188
  tertiary: cn(
189
- "bg-transparent text-agg-foreground",
190
- "hover:bg-agg-secondary-hover",
189
+ "bg-transparent text-agg-primary",
190
+ "hover:text-agg-primary-hover",
191
191
  "disabled:bg-transparent disabled:text-agg-muted-foreground",
192
- "focus-visible:ring-agg-separator"
192
+ "focus-visible:ring-agg-separator",
193
+ "px-0! py-0! h-fit!"
193
194
  )
194
195
  };
195
196
  var baseButtonClasses = cn(
@@ -205,7 +206,7 @@ var Button = (_a) => {
205
206
  var _b = _a, {
206
207
  children,
207
208
  variant = "primary",
208
- size = "m",
209
+ size = "medium",
209
210
  isLoading = false,
210
211
  disabled,
211
212
  prefix,
@@ -225,15 +226,16 @@ var Button = (_a) => {
225
226
  "className",
226
227
  "aria-label"
227
228
  ]);
228
- const { enableAnimations } = (0, import_hooks.useSdkUiConfig)();
229
+ const { enableAnimations } = (0, import_hooks2.useSdkUiConfig)();
229
230
  const isDisabled = disabled || isLoading;
230
231
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
231
232
  "button",
232
233
  __spreadProps(__spreadValues({
233
234
  type,
234
235
  className: cn(
236
+ "group/agg-button",
235
237
  baseButtonClasses,
236
- getMotionClassName(enableAnimations, "transition-colors"),
238
+ getMotionClassName(enableAnimations, "transition-colors duration-200 ease-in-out"),
237
239
  sizeClasses[size],
238
240
  iconSlotClasses[size],
239
241
  variantClasses[variant],
@@ -265,13 +267,13 @@ Button.displayName = "Button";
265
267
 
266
268
  // src/primitives/chart/index.tsx
267
269
  var import_dayjs = __toESM(require("dayjs"));
268
- var import_hooks3 = require("@agg-market/hooks");
270
+ var import_hooks4 = require("@agg-market/hooks");
269
271
  var import_react2 = require("react");
270
272
  var import_liveline = require("liveline");
271
273
 
272
274
  // src/primitives/switch-button/index.tsx
273
275
  var import_react = require("react");
274
- var import_hooks2 = require("@agg-market/hooks");
276
+ var import_hooks3 = require("@agg-market/hooks");
275
277
  var import_jsx_runtime3 = require("react/jsx-runtime");
276
278
  var resolveActiveIndex = (options, value) => {
277
279
  const activeIndex = options.findIndex((option) => option.value === value);
@@ -299,7 +301,7 @@ var SwitchButton = ({
299
301
  ariaLabel,
300
302
  className
301
303
  }) => {
302
- const { enableAnimations } = (0, import_hooks2.useSdkUiConfig)();
304
+ const { enableAnimations } = (0, import_hooks3.useSdkUiConfig)();
303
305
  const activeIndex = (0, import_react.useMemo)(() => {
304
306
  return resolveActiveIndex(options, value);
305
307
  }, [options, value]);
@@ -345,7 +347,10 @@ var SwitchButton = ({
345
347
  "div",
346
348
  {
347
349
  className: cn(
350
+ "group/agg-switch",
348
351
  "inline-flex min-w-0 rounded-agg-full bg-agg-secondary-hover font-agg-sans",
352
+ getMotionClassName(enableAnimations, "transition-background duration-200 ease-in-out"),
353
+ "cursor-pointer hover:bg-agg-tertiary",
349
354
  className
350
355
  ),
351
356
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
@@ -365,7 +370,7 @@ var SwitchButton = ({
365
370
  "pointer-events-none absolute inset-y-0 left-0 rounded-agg-full border-2 border-agg-primary bg-agg-secondary",
366
371
  getMotionClassName(
367
372
  enableAnimations,
368
- "transition-transform duration-[450ms] ease-[cubic-bezier(0.77,0,0.175,1)]"
373
+ "transition-transform duration-500 ease-[cubic-bezier(0.77,0,0.175,1)]"
369
374
  )
370
375
  ),
371
376
  style: {
@@ -389,15 +394,19 @@ var SwitchButton = ({
389
394
  disabled: option.disabled,
390
395
  className: cn(
391
396
  "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",
392
- getMotionClassName(enableAnimations, "transition-colors duration-300"),
397
+ getMotionClassName(
398
+ enableAnimations,
399
+ "transition-[colors] duration-200 ease-in-out"
400
+ ),
393
401
  "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",
394
- "disabled:cursor-not-allowed disabled:text-agg-muted-foreground",
402
+ "cursor-pointer disabled:cursor-not-allowed disabled:text-agg-muted-foreground",
395
403
  isActive ? "font-agg-bold" : "font-agg-normal"
396
404
  ),
397
- onClick: () => {
398
- if (option.disabled || isActive) {
405
+ onClick: (e) => {
406
+ e.preventDefault();
407
+ e.stopPropagation();
408
+ if (option.disabled || isActive)
399
409
  return;
400
- }
401
410
  onValueChange(option.value);
402
411
  },
403
412
  onKeyDown: (event) => {
@@ -520,8 +529,8 @@ var LineChart = ({
520
529
  renderSeriesControls
521
530
  }) => {
522
531
  var _a, _b;
523
- const labels = (0, import_hooks3.useLabels)();
524
- const { theme } = (0, import_hooks3.useSdkUiConfig)();
532
+ const labels = (0, import_hooks4.useLabels)();
533
+ const { theme } = (0, import_hooks4.useSdkUiConfig)();
525
534
  const normalizedSeries = (0, import_react2.useMemo)(() => {
526
535
  return normalizeSeries(series);
527
536
  }, [series]);
@@ -575,7 +584,7 @@ var LineChart = ({
575
584
  seriesSwitchAriaLabel: labels.common.lineChartSeriesSwitchAria,
576
585
  formatSeriesOptionAriaLabel: labels.common.lineChartSeriesOptionAria
577
586
  }) : null : null;
578
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: cn("w-full", classNames == null ? void 0 : classNames.root), style: { width }, children: [
587
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: cn("group/agg-chart", "w-full", classNames == null ? void 0 : classNames.root), style: { width }, children: [
579
588
  !isLoading && seriesControls ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cn("mb-3", classNames == null ? void 0 : classNames.controls), children: seriesControls }) : null,
580
589
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
581
590
  "div",
@@ -618,34 +627,38 @@ var LineChart = ({
618
627
  LineChart.displayName = "LineChart";
619
628
 
620
629
  // src/primitives/card/index.tsx
621
- var import_hooks4 = require("@agg-market/hooks");
630
+ var import_hooks5 = require("@agg-market/hooks");
622
631
  var import_jsx_runtime5 = require("react/jsx-runtime");
623
632
  var Card = (_a) => {
624
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
625
- const { enableAnimations } = (0, import_hooks4.useSdkUiConfig)();
633
+ var _b = _a, { className, onClick } = _b, props = __objRest(_b, ["className", "onClick"]);
634
+ const { enableAnimations } = (0, import_hooks5.useSdkUiConfig)();
626
635
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
627
636
  "div",
628
- __spreadValues({
637
+ __spreadValues(__spreadValues({
629
638
  className: cn(
639
+ "group/agg-card",
630
640
  "flex w-full flex-col font-agg-sans",
631
641
  "rounded-agg-xl border border-agg-separator",
632
642
  "bg-agg-secondary text-agg-foreground shadow-agg-card",
633
- getMotionClassName(enableAnimations, "transition-shadow hover:shadow-agg-card-hover"),
643
+ getMotionClassName(
644
+ enableAnimations,
645
+ "transition-shadow hover:shadow-agg-card-hover duration-300 ease-in-out"
646
+ ),
634
647
  className
635
648
  )
636
- }, props)
649
+ }, onClick ? { onClick } : {}), props)
637
650
  );
638
651
  };
639
652
  Card.displayName = "Card";
640
653
 
641
654
  // src/primitives/skeleton/views/event-list-skeleton-view.tsx
642
- var import_hooks7 = require("@agg-market/hooks");
655
+ var import_hooks8 = require("@agg-market/hooks");
643
656
 
644
657
  // src/primitives/skeleton/skeleton-block.tsx
645
- var import_hooks5 = require("@agg-market/hooks");
658
+ var import_hooks6 = require("@agg-market/hooks");
646
659
  var import_jsx_runtime6 = require("react/jsx-runtime");
647
660
  var SkeletonBlock = ({ className }) => {
648
- const { enableAnimations } = (0, import_hooks5.useSdkUiConfig)();
661
+ const { enableAnimations } = (0, import_hooks6.useSdkUiConfig)();
649
662
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
650
663
  "div",
651
664
  {
@@ -661,7 +674,7 @@ var SkeletonBlock = ({ className }) => {
661
674
  SkeletonBlock.displayName = "SkeletonBlock";
662
675
 
663
676
  // src/primitives/skeleton/views/event-list-item-skeleton-view.tsx
664
- var import_hooks6 = require("@agg-market/hooks");
677
+ var import_hooks7 = require("@agg-market/hooks");
665
678
 
666
679
  // src/events/item/event-list-item.constants.ts
667
680
  var baseCardClassName = "gap-3 overflow-hidden p-5 w-full";
@@ -673,11 +686,11 @@ var EventListItemSkeletonView = ({
673
686
  ariaLabel,
674
687
  isStandalone = false
675
688
  }) => {
676
- const labels = (0, import_hooks6.useLabels)();
689
+ const labels = (0, import_hooks7.useLabels)();
677
690
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
678
691
  Card,
679
692
  {
680
- className: cn(baseCardClassName, className),
693
+ className: cn("group/agg-skeleton", baseCardClassName, className),
681
694
  role: isStandalone ? "status" : void 0,
682
695
  "aria-label": isStandalone ? ariaLabel != null ? ariaLabel : labels.eventItem.loading : void 0,
683
696
  "aria-busy": isStandalone || void 0,
@@ -722,11 +735,11 @@ EventListItemSkeletonView.displayName = "EventListItemSkeletonView";
722
735
  // src/primitives/skeleton/views/event-list-skeleton-view.tsx
723
736
  var import_jsx_runtime8 = require("react/jsx-runtime");
724
737
  var EventListSkeletonView = ({ className, ariaLabel }) => {
725
- const labels = (0, import_hooks7.useLabels)();
738
+ const labels = (0, import_hooks8.useLabels)();
726
739
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
727
740
  "section",
728
741
  {
729
- className: cn("flex w-full flex-col gap-5", className),
742
+ className: cn("group/agg-skeleton", "flex w-full flex-col gap-5", className),
730
743
  role: "status",
731
744
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventList.loading("events"),
732
745
  "aria-busy": true,
@@ -754,7 +767,7 @@ var EventListSkeletonView = ({ className, ariaLabel }) => {
754
767
  EventListSkeletonView.displayName = "EventListSkeletonView";
755
768
 
756
769
  // src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
757
- var import_hooks8 = require("@agg-market/hooks");
770
+ var import_hooks9 = require("@agg-market/hooks");
758
771
 
759
772
  // src/events/item-details/event-list-item-details.constants.ts
760
773
  var detailsBaseCardClassName = "w-full overflow-hidden gap-6 p-5 md:gap-8 md:p-10";
@@ -780,11 +793,11 @@ var EventListItemDetailsSkeletonView = ({
780
793
  className,
781
794
  ariaLabel
782
795
  }) => {
783
- const labels = (0, import_hooks8.useLabels)();
796
+ const labels = (0, import_hooks9.useLabels)();
784
797
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
785
798
  Card,
786
799
  {
787
- className: cn(detailsBaseCardClassName, className),
800
+ className: cn("group/agg-skeleton", detailsBaseCardClassName, className),
788
801
  role: "status",
789
802
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading,
790
803
  "aria-busy": true,
@@ -821,7 +834,7 @@ var EventListItemDetailsSkeletonView = ({
821
834
  EventListItemDetailsSkeletonView.displayName = "EventListItemDetailsSkeletonView";
822
835
 
823
836
  // src/primitives/skeleton/views/market-details-skeleton-view.tsx
824
- var import_hooks9 = require("@agg-market/hooks");
837
+ var import_hooks10 = require("@agg-market/hooks");
825
838
 
826
839
  // src/events/market-details/market-details.constants.ts
827
840
  var marketDetailsBaseCardClassName = "w-full overflow-hidden rounded-agg-lg border border-agg-separator bg-agg-secondary text-agg-foreground shadow-none hover:shadow-none";
@@ -841,11 +854,11 @@ var MarketDetailsSkeletonView = ({
841
854
  ariaLabel,
842
855
  isDetailed
843
856
  }) => {
844
- const labels = (0, import_hooks9.useLabels)();
857
+ const labels = (0, import_hooks10.useLabels)();
845
858
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
846
859
  Card,
847
860
  {
848
- className: cn(marketDetailsBaseCardClassName, className),
861
+ className: cn("group/agg-skeleton", marketDetailsBaseCardClassName, className),
849
862
  role: "status",
850
863
  "aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.loading,
851
864
  "aria-busy": true,
@@ -915,7 +928,7 @@ MarketDetailsSkeletonView.displayName = "MarketDetailsSkeletonView";
915
928
  var import_jsx_runtime11 = require("react/jsx-runtime");
916
929
  var placeOrderCardClassName = "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
917
930
  var ContentBody = () => {
918
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [
931
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("flex flex-col gap-6 p-5"), children: [
919
932
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-2", children: [
920
933
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-start justify-between gap-5", children: [
921
934
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
@@ -982,7 +995,7 @@ var PlaceOrderSkeletonView = ({
982
995
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
983
996
  "div",
984
997
  {
985
- className: cn("w-full", className),
998
+ className: cn("group/agg-skeleton", "w-full", className),
986
999
  role: "status",
987
1000
  "aria-label": ariaLabel != null ? ariaLabel : "Loading place order",
988
1001
  "aria-busy": true,
@@ -1005,17 +1018,18 @@ var PlaceOrderSkeletonView = ({
1005
1018
  PlaceOrderSkeletonView.displayName = "PlaceOrderSkeletonView";
1006
1019
 
1007
1020
  // src/primitives/skeleton/views/settlement-skeleton-view.tsx
1008
- var import_hooks10 = require("@agg-market/hooks");
1021
+ var import_hooks11 = require("@agg-market/hooks");
1009
1022
  var import_jsx_runtime12 = require("react/jsx-runtime");
1010
1023
  var SettlementSkeletonView = ({
1011
1024
  className,
1012
1025
  ariaLabel
1013
1026
  }) => {
1014
- const labels = (0, import_hooks10.useLabels)();
1027
+ const labels = (0, import_hooks11.useLabels)();
1015
1028
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1016
1029
  Card,
1017
1030
  {
1018
1031
  className: cn(
1032
+ "group/agg-skeleton",
1019
1033
  "flex flex-col w-full gap-5 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none",
1020
1034
  className
1021
1035
  ),
@@ -1099,21 +1113,22 @@ var Skeleton = ({ view, className, ariaLabel }) => {
1099
1113
  Skeleton.displayName = "Skeleton";
1100
1114
 
1101
1115
  // src/primitives/typography/typography.constants.ts
1102
- var variantClasses2 = {
1103
- title: cn("font-agg-sans text-agg-lg leading-agg-7", "font-agg-bold", "text-agg-foreground"),
1104
- body: cn("font-agg-sans text-agg-base leading-agg-6", "font-agg-normal", "text-agg-foreground"),
1105
- meta: cn(
1106
- "font-agg-sans text-agg-sm leading-agg-5",
1107
- "font-agg-normal",
1108
- "text-agg-muted-foreground"
1109
- ),
1110
- label: cn(
1111
- "font-agg-sans text-agg-sm leading-agg-5",
1112
- "font-agg-bold uppercase",
1113
- "text-agg-foreground"
1114
- ),
1115
- value: cn("font-agg-sans text-agg-xl leading-agg-7", "font-agg-normal", "text-agg-foreground"),
1116
- caption: cn("font-agg-sans text-agg-xs leading-agg-4", "font-agg-normal", "text-agg-foreground")
1116
+ var typographyVariantClasses = {
1117
+ display: cn("agg-type-display"),
1118
+ heading: cn("agg-type-heading"),
1119
+ title: cn("agg-type-title"),
1120
+ "title-strong": cn("agg-type-title-strong"),
1121
+ "body-large": cn("agg-type-body-large"),
1122
+ "body-large-strong": cn("agg-type-body-large-strong"),
1123
+ body: cn("agg-type-body"),
1124
+ "body-strong": cn("agg-type-body-strong"),
1125
+ label: cn("agg-type-label"),
1126
+ "label-strong": cn("agg-type-label-strong"),
1127
+ "label-caps": cn("agg-type-label-caps"),
1128
+ caption: cn("agg-type-caption"),
1129
+ "caption-strong": cn("agg-type-caption-strong"),
1130
+ "caption-caps": cn("agg-type-caption-caps"),
1131
+ overline: cn("agg-type-overline")
1117
1132
  };
1118
1133
 
1119
1134
  // src/primitives/typography/index.tsx
@@ -1124,12 +1139,23 @@ var Typography = ({
1124
1139
  className,
1125
1140
  children
1126
1141
  }) => {
1127
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Component, { className: cn(variantClasses2[variant], "truncate", className), children });
1142
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1143
+ Component,
1144
+ {
1145
+ className: cn(
1146
+ "group/agg-typography",
1147
+ "text-agg-foreground",
1148
+ typographyVariantClasses[variant],
1149
+ className
1150
+ ),
1151
+ children
1152
+ }
1153
+ );
1128
1154
  };
1129
1155
  Typography.displayName = "Typography";
1130
1156
 
1131
1157
  // src/primitives/venue-logo/index.tsx
1132
- var import_hooks11 = require("@agg-market/hooks");
1158
+ var import_hooks12 = require("@agg-market/hooks");
1133
1159
 
1134
1160
  // src/primitives/icon/types.ts
1135
1161
  var getIconA11yProps = (title) => ({
@@ -1138,7 +1164,7 @@ var getIconA11yProps = (title) => ({
1138
1164
  });
1139
1165
 
1140
1166
  // src/primitives/venue-logo/logo-props.ts
1141
- var DEFAULT_MONOCHROME_COLOR = "#000000";
1167
+ var DEFAULT_MONOCHROME_COLOR = "currentColor";
1142
1168
  var resolveLogoPrimaryColor = ({
1143
1169
  brandColor,
1144
1170
  isColor = true,
@@ -1336,14 +1362,9 @@ var venueLogoRegistry = {
1336
1362
  };
1337
1363
  var venueLogoNames = Object.keys(venueLogoRegistry);
1338
1364
  var sizeClasses2 = {
1339
- xxs: "h-2 w-2",
1340
- xs: "h-3 w-3",
1341
- s: "h-4 w-4",
1342
- ms: "h-5 w-5",
1343
- m: "h-6 w-6",
1344
- l: "h-8 w-8",
1345
- xl: "h-10 w-10",
1346
- xxl: "h-12 w-12"
1365
+ small: "h-4 w-4",
1366
+ medium: "h-6 w-6",
1367
+ large: "h-8 w-8"
1347
1368
  };
1348
1369
 
1349
1370
  // src/primitives/venue-logo/index.tsx
@@ -1353,19 +1374,19 @@ var VenueLogo = ({
1353
1374
  isColor = true,
1354
1375
  isMonochromatic = false,
1355
1376
  color,
1356
- size = "m",
1377
+ size = "medium",
1357
1378
  className,
1358
1379
  ariaLabel,
1359
1380
  title
1360
1381
  }) => {
1361
- const labels = (0, import_hooks11.useLabels)();
1382
+ const labels = (0, import_hooks12.useLabels)();
1362
1383
  const Component = venueLogoRegistry[venue];
1363
1384
  const sizeClass = sizeClasses2[size];
1364
1385
  const resolvedIsColor = isMonochromatic ? false : isColor;
1365
1386
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1366
1387
  Component,
1367
1388
  {
1368
- className: cn("shrink-0", sizeClass, className),
1389
+ className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
1369
1390
  isColor: resolvedIsColor,
1370
1391
  color,
1371
1392
  "aria-label": ariaLabel != null ? ariaLabel : labels.venues[venue],
@@ -1610,7 +1631,7 @@ var EventListItemDetailsLoadingState = ({
1610
1631
  classNames,
1611
1632
  ariaLabel
1612
1633
  }) => {
1613
- const labels = (0, import_hooks12.useLabels)();
1634
+ const labels = (0, import_hooks13.useLabels)();
1614
1635
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1615
1636
  Skeleton,
1616
1637
  {
@@ -1624,7 +1645,7 @@ var EventListItemDetailsUnavailableState = ({
1624
1645
  classNames,
1625
1646
  ariaLabel
1626
1647
  }) => {
1627
- const labels = (0, import_hooks12.useLabels)();
1648
+ const labels = (0, import_hooks13.useLabels)();
1628
1649
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1629
1650
  Card,
1630
1651
  {
@@ -1632,7 +1653,7 @@ var EventListItemDetailsUnavailableState = ({
1632
1653
  role: "status",
1633
1654
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.unavailableAria,
1634
1655
  children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex flex-col gap-1", classNames == null ? void 0 : classNames.header), children: [
1635
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "title", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItemDetails.unavailableTitle }),
1656
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "body-large-strong", className: cn("truncate", classNames == null ? void 0 : classNames.title), children: labels.eventItemDetails.unavailableTitle }),
1636
1657
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "body", className: "text-agg-muted-foreground", children: labels.eventItemDetails.unavailableDescription })
1637
1658
  ] })
1638
1659
  }
@@ -1670,7 +1691,7 @@ var EventListItemDetailsGraphSection = ({
1670
1691
  formatPercent,
1671
1692
  selectedTimeRange
1672
1693
  }) => {
1673
- const labels = (0, import_hooks12.useLabels)();
1694
+ const labels = (0, import_hooks13.useLabels)();
1674
1695
  const [selectedVenue, setSelectedVenue] = (0, import_react3.useState)(null);
1675
1696
  const [activeProbabilityMode, setActiveProbabilityMode] = (0, import_react3.useState)("yes");
1676
1697
  const probabilityModeConfigs = (0, import_react3.useMemo)(() => {
@@ -1757,7 +1778,7 @@ var EventListItemDetailsGraphSection = ({
1757
1778
  const timeWindow = (0, import_react3.useMemo)(() => {
1758
1779
  return getTimeWindowByRange(selectedTimeRange);
1759
1780
  }, [selectedTimeRange]);
1760
- const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0, import_hooks12.usePriceHistory)(__spreadProps(__spreadValues({
1781
+ const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0, import_hooks13.usePriceHistory)(__spreadProps(__spreadValues({
1761
1782
  groups: priceHistoryGroups
1762
1783
  }, timeWindow), {
1763
1784
  enabled: priceHistoryGroups.length > 0
@@ -1895,25 +1916,27 @@ var EventListItemDetailsGraphSection = ({
1895
1916
  className: cn(
1896
1917
  "rounded-agg-full 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"
1897
1918
  ),
1898
- onClick: () => handleVenueToggle(venueData.venue),
1899
1919
  children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1900
1920
  Badge,
1901
1921
  {
1902
1922
  text,
1903
- size: "l",
1923
+ size: "large",
1904
1924
  prefix: showVenueLogo ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1905
1925
  VenueLogo,
1906
1926
  {
1907
1927
  venue: venueData.venue,
1908
- size: "s",
1928
+ size: "small",
1909
1929
  title: (_a = venueInfo == null ? void 0 : venueInfo[venueData.venue]) == null ? void 0 : _a.label
1910
1930
  }
1911
1931
  ) : void 0,
1912
1932
  classNames: {
1913
- root: cn(
1914
- "h-9 shrink-0 border-2 px-4 text-agg-base leading-agg-6",
1915
- isActiveVenue ? "border-agg-primary bg-agg-secondary font-agg-bold" : "border-transparent bg-agg-secondary-hover font-agg-normal"
1916
- )
1933
+ root: cn("h-9 shrink-0 border-2 px-4 text-agg-base leading-agg-6")
1934
+ },
1935
+ isActive: isActiveVenue,
1936
+ onClick: (e) => {
1937
+ e.preventDefault();
1938
+ e.stopPropagation();
1939
+ handleVenueToggle(venueData.venue);
1917
1940
  }
1918
1941
  }
1919
1942
  )
@@ -1955,8 +1978,8 @@ var EventListItemDetailsContent = ({
1955
1978
  ariaLabel,
1956
1979
  defaultTimeRange
1957
1980
  }) => {
1958
- const config = (0, import_hooks12.useSdkUiConfig)();
1959
- const labels = (0, import_hooks12.useLabels)();
1981
+ const config = (0, import_hooks13.useSdkUiConfig)();
1982
+ const labels = (0, import_hooks13.useLabels)();
1960
1983
  const venueMarkets = (0, import_react3.useMemo)(() => {
1961
1984
  var _a, _b, _c;
1962
1985
  return (_c = (_b = (_a = event.markets) == null ? void 0 : _a[0]) == null ? void 0 : _b.venueMarkets) != null ? _c : [];
@@ -2051,69 +2074,73 @@ var EventListItemDetailsContent = ({
2051
2074
  className: cn(detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
2052
2075
  "aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
2053
2076
  children: [
2054
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex items-start gap-3 md:gap-4 ", classNames == null ? void 0 : classNames.header), children: [
2055
- resolvedImage ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2056
- "img",
2057
- {
2058
- src: resolvedImage,
2059
- alt: "",
2060
- className: "size-10 rounded-agg-lg object-cover md:size-[60px]"
2061
- }
2062
- ) : null,
2063
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
2064
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2065
- Typography,
2066
- {
2067
- variant: "value",
2068
- className: cn(
2069
- "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:text-agg-2xl md:leading-agg-8 md:block md:truncate md:whitespace-nowrap",
2070
- classNames == null ? void 0 : classNames.title
2071
- ),
2072
- children: resolvedTitle
2073
- }
2077
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2078
+ "div",
2079
+ {
2080
+ className: cn(
2081
+ "flex flex-row gap-3 md:gap-4",
2082
+ "items-center justify-start",
2083
+ classNames == null ? void 0 : classNames.header
2074
2084
  ),
2075
- outcomeSelectorLabels.length > 2 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2076
- "div",
2077
- {
2078
- className: cn(
2079
- "flex items-center gap-2 overflow-x-auto pb-1 md:flex-wrap md:overflow-visible md:pb-0",
2080
- classNames == null ? void 0 : classNames.headerPills
2085
+ children: [
2086
+ resolvedImage ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2087
+ "img",
2088
+ {
2089
+ src: resolvedImage,
2090
+ alt: "",
2091
+ className: "size-10 rounded-agg-lg object-cover md:size-[60px]"
2092
+ }
2093
+ ) : null,
2094
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
2095
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2096
+ Typography,
2097
+ {
2098
+ variant: "body-strong",
2099
+ className: cn(
2100
+ "min-w-0 text-agg-base font-agg-bold! leading-agg-6 md:text-agg-2xl md:leading-agg-8",
2101
+ "truncate text-wrap wrap-break-word line-clamp-2",
2102
+ classNames == null ? void 0 : classNames.title
2103
+ ),
2104
+ children: resolvedTitle
2105
+ }
2081
2106
  ),
2082
- children: outcomeSelectorLabels.map((outcomeSelectorLabel) => {
2083
- const isActive = outcomeSelectorLabel === selectedOutcomeLabel;
2084
- const displayLabel = isDateLikeLabel(outcomeSelectorLabel) ? formatDateLabel(outcomeSelectorLabel) : outcomeSelectorLabel;
2085
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2086
- Button,
2087
- {
2088
- size: "s",
2089
- variant: "secondary",
2090
- "aria-pressed": isActive,
2091
- className: cn(
2092
- "h-auto shrink-0 rounded-agg-full px-4 py-1.5 text-agg-sm leading-agg-5",
2093
- "border-2",
2094
- isActive ? "border-agg-primary bg-agg-secondary text-agg-foreground font-agg-bold" : "border-transparent bg-agg-secondary-hover text-agg-foreground font-agg-normal"
2095
- ),
2096
- onClick: () => setSelectedOutcomeLabel(outcomeSelectorLabel),
2097
- children: displayLabel
2098
- },
2099
- outcomeSelectorLabel
2100
- );
2101
- })
2102
- }
2103
- ) : null
2104
- ] })
2105
- ] }),
2107
+ outcomeSelectorLabels.length > 2 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2108
+ "div",
2109
+ {
2110
+ className: cn(
2111
+ "flex items-center gap-2 overflow-x-auto pb-1 md:flex-wrap md:overflow-visible md:pb-0",
2112
+ classNames == null ? void 0 : classNames.headerPills
2113
+ ),
2114
+ children: outcomeSelectorLabels.map((outcomeSelectorLabel) => {
2115
+ const isActive = outcomeSelectorLabel === selectedOutcomeLabel;
2116
+ const displayLabel = isDateLikeLabel(outcomeSelectorLabel) ? formatDateLabel(outcomeSelectorLabel) : outcomeSelectorLabel;
2117
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2118
+ Button,
2119
+ {
2120
+ size: "small",
2121
+ variant: "secondary",
2122
+ "aria-pressed": isActive,
2123
+ className: cn(
2124
+ "h-auto shrink-0 rounded-agg-full px-4 py-1.5 text-agg-sm leading-agg-5",
2125
+ "border-2",
2126
+ isActive ? "border-agg-primary bg-agg-secondary text-agg-foreground font-agg-bold" : "border-transparent bg-agg-secondary-hover text-agg-foreground font-agg-normal"
2127
+ ),
2128
+ onClick: () => setSelectedOutcomeLabel(outcomeSelectorLabel),
2129
+ children: displayLabel
2130
+ },
2131
+ outcomeSelectorLabel
2132
+ );
2133
+ })
2134
+ }
2135
+ ) : null
2136
+ ] })
2137
+ ]
2138
+ }
2139
+ ),
2106
2140
  detailsStats && detailsStats.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-wrap items-start gap-4 md:gap-6", classNames == null ? void 0 : classNames.headerStats), children: detailsStats.map((statItem) => {
2107
- const deltaClassName = statItem.deltaTone === "positive" ? "text-agg-success" : statItem.deltaTone === "negative" ? "text-agg-error" : "text-agg-muted-foreground";
2141
+ const deltaClassName = statItem.deltaTone === "positive" ? "text-agg-success!" : statItem.deltaTone === "negative" ? "text-agg-error!" : "text-agg-muted-foreground";
2108
2142
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-1", children: [
2109
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2110
- Typography,
2111
- {
2112
- variant: "label",
2113
- className: "text-agg-xs leading-agg-4 tracking-agg-normal text-agg-muted-foreground",
2114
- children: statItem.label
2115
- }
2116
- ),
2143
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "caption-caps", className: "text-agg-muted-foreground", children: statItem.label }),
2117
2144
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-baseline gap-1", children: [
2118
2145
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2119
2146
  Typography,
@@ -2123,14 +2150,7 @@ var EventListItemDetailsContent = ({
2123
2150
  children: statItem.value
2124
2151
  }
2125
2152
  ),
2126
- statItem.delta ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2127
- Typography,
2128
- {
2129
- variant: "meta",
2130
- className: cn("text-agg-sm leading-agg-5", deltaClassName),
2131
- children: statItem.delta
2132
- }
2133
- ) : null
2153
+ statItem.delta ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "label", className: cn(deltaClassName), children: statItem.delta }) : null
2134
2154
  ] })
2135
2155
  ] }, `${statItem.label}-${statItem.value}`);
2136
2156
  }) }) : null,
@@ -2150,18 +2170,19 @@ var EventListItemDetailsContent = ({
2150
2170
  }
2151
2171
  ),
2152
2172
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-4", classNames == null ? void 0 : classNames.footer), children: [
2153
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "meta", className: "text-agg-muted-foreground text-agg-sm leading-agg-5", children: volumeLabel || "-" }),
2173
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: volumeLabel || "-" }),
2154
2174
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex items-center gap-2 md:gap-3", classNames == null ? void 0 : classNames.timeRange), children: eventListItemDetailsTimeRanges.map((timeRange) => {
2155
2175
  const isActive = timeRange === selectedTimeRange;
2156
2176
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2157
2177
  Button,
2158
2178
  {
2159
- size: "xs",
2179
+ size: "small",
2160
2180
  variant: "tertiary",
2161
2181
  className: cn(
2162
2182
  "h-auto min-w-0 rounded-none px-0 py-0 text-agg-xs leading-agg-4 md:text-agg-sm md:leading-agg-5",
2163
2183
  "border-0 bg-transparent shadow-none",
2164
- isActive ? "font-agg-bold text-agg-foreground" : "font-agg-normal text-agg-muted-foreground"
2184
+ "hover:text-agg-foreground!",
2185
+ isActive ? "font-agg-bold! text-agg-foreground!" : "font-agg-normal! text-agg-muted-foreground!"
2165
2186
  ),
2166
2187
  "aria-pressed": isActive,
2167
2188
  onClick: () => setSelectedTimeRange(timeRange),
@@ -2185,7 +2206,7 @@ var EventListItemDetailsByEventId = (_a) => {
2185
2206
  event: fetchedEvent,
2186
2207
  isError,
2187
2208
  isLoading
2188
- } = (0, import_hooks12.useEvent)(eventId, {
2209
+ } = (0, import_hooks13.useEvent)(eventId, {
2189
2210
  enabled: !!eventId
2190
2211
  });
2191
2212
  const resolvedEvent = (0, import_react3.useMemo)(() => {
@@ -2262,12 +2283,15 @@ EventListItemDetails.displayName = "EventListItemDetails";
2262
2283
 
2263
2284
  // src/events/market-details/index.tsx
2264
2285
  var import_react6 = require("react");
2265
- var import_hooks16 = require("@agg-market/hooks");
2286
+ var import_hooks17 = require("@agg-market/hooks");
2266
2287
 
2267
2288
  // src/primitives/tabs/index.tsx
2268
2289
  var import_react5 = require("react");
2290
+ var import_hooks15 = require("@agg-market/hooks");
2291
+
2292
+ // src/primitives/select/index.tsx
2293
+ var import_react4 = require("react");
2269
2294
  var import_hooks14 = require("@agg-market/hooks");
2270
- var DropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
2271
2295
 
2272
2296
  // src/primitives/icon/svg/arrow-trend-up.tsx
2273
2297
  var import_jsx_runtime21 = require("react/jsx-runtime");
@@ -2324,14 +2348,10 @@ var ArrowsToDotIcon = (_a) => {
2324
2348
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2325
2349
  "path",
2326
2350
  {
2327
- 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",
2328
- stroke: "currentColor",
2329
- strokeWidth: "1.25",
2330
- strokeLinecap: "round",
2331
- strokeLinejoin: "round"
2351
+ 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",
2352
+ fill: "currentColor"
2332
2353
  }
2333
- ),
2334
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "8", cy: "8", r: "1.5", fill: "currentColor" })
2354
+ )
2335
2355
  ]
2336
2356
  })
2337
2357
  );
@@ -3566,7 +3586,7 @@ var Icon = (_a) => {
3566
3586
  var _b = _a, {
3567
3587
  name,
3568
3588
  color,
3569
- size = "m",
3589
+ size = "medium",
3570
3590
  className = "text-agg-primary",
3571
3591
  style
3572
3592
  } = _b, props = __objRest(_b, [
@@ -3579,13 +3599,18 @@ var Icon = (_a) => {
3579
3599
  const Component = iconRegistry[name];
3580
3600
  const resolvedStyle = resolveIconStyle(color, style);
3581
3601
  const resolvedClassName = cn(iconSizeClasses[size], className);
3582
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Component, __spreadValues({ color, className: resolvedClassName, style: resolvedStyle }, props));
3602
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
3603
+ Component,
3604
+ __spreadValues({
3605
+ color,
3606
+ className: cn("group/agg-icon", resolvedClassName),
3607
+ style: resolvedStyle
3608
+ }, props)
3609
+ );
3583
3610
  };
3584
3611
  Icon.displayName = "Icon";
3585
3612
 
3586
3613
  // src/primitives/select/index.tsx
3587
- var import_react4 = require("react");
3588
- var import_hooks13 = require("@agg-market/hooks");
3589
3614
  var import_jsx_runtime63 = require("react/jsx-runtime");
3590
3615
  var Select = ({
3591
3616
  items,
@@ -3596,8 +3621,8 @@ var Select = ({
3596
3621
  disabled = false
3597
3622
  }) => {
3598
3623
  var _a;
3599
- const labels = (0, import_hooks13.useLabels)();
3600
- const { enableAnimations } = (0, import_hooks13.useSdkUiConfig)();
3624
+ const labels = (0, import_hooks14.useLabels)();
3625
+ const { enableAnimations } = (0, import_hooks14.useSdkUiConfig)();
3601
3626
  const hasEnabledItems = items.some((item) => !item.disabled);
3602
3627
  const hasAnyIcon = items.some((item) => item.iconUrl);
3603
3628
  const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
@@ -3607,7 +3632,7 @@ var Select = ({
3607
3632
  if (!isOpen)
3608
3633
  return;
3609
3634
  const handlePointerDown = (e) => {
3610
- if (containerRef.current && !containerRef.current.contains(e.target)) {
3635
+ if (containerRef.current && !containerRef.current.contains(e == null ? void 0 : e.target)) {
3611
3636
  close();
3612
3637
  }
3613
3638
  };
@@ -3618,7 +3643,7 @@ var Select = ({
3618
3643
  if (!isOpen)
3619
3644
  return;
3620
3645
  const handleKey = (e) => {
3621
- if (e.key === "Escape")
3646
+ if ((e == null ? void 0 : e.key) === "Escape")
3622
3647
  close();
3623
3648
  };
3624
3649
  document.addEventListener("keydown", handleKey);
@@ -3627,7 +3652,7 @@ var Select = ({
3627
3652
  const isDisabled = disabled || !hasEnabledItems;
3628
3653
  const selectedItem = items.find((item) => item.value === value);
3629
3654
  if (!hasAnyIcon) {
3630
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("label", { className: cn("relative inline-flex w-full", className), children: [
3655
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("label", { className: cn("group/agg-select", "relative inline-flex w-full", className), children: [
3631
3656
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3632
3657
  "select",
3633
3658
  {
@@ -3636,7 +3661,7 @@ var Select = ({
3636
3661
  "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",
3637
3662
  getMotionClassName(
3638
3663
  enableAnimations,
3639
- "transition-[border-color,box-shadow] duration-200 ease-out"
3664
+ "transition-[border-color,box-shadow] duration-200 ease-in-out"
3640
3665
  ),
3641
3666
  "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
3642
3667
  "disabled:cursor-not-allowed disabled:opacity-60"
@@ -3647,88 +3672,95 @@ var Select = ({
3647
3672
  children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("option", { value: item.value, disabled: item.disabled, children: item.label }, item.value))
3648
3673
  }
3649
3674
  ),
3650
- /* @__PURE__ */ (0, import_jsx_runtime63.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_runtime63.jsx)(Icon, { name: "chevron-down", size: "s", color: "currentColor" }) })
3675
+ /* @__PURE__ */ (0, import_jsx_runtime63.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_runtime63.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) })
3651
3676
  ] });
3652
3677
  }
3653
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { ref: containerRef, className: cn("relative inline-flex w-full", className), children: [
3654
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
3655
- "button",
3656
- {
3657
- type: "button",
3658
- "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
3659
- "aria-expanded": isOpen,
3660
- "aria-haspopup": "listbox",
3661
- disabled: isDisabled,
3662
- className: cn(
3663
- "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",
3664
- "flex items-center gap-2 text-left",
3665
- getMotionClassName(
3666
- enableAnimations,
3667
- "transition-[border-color,box-shadow] duration-200 ease-out"
3668
- ),
3669
- "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
3670
- "disabled:cursor-not-allowed disabled:opacity-60"
3671
- ),
3672
- onClick: () => setIsOpen((prev) => !prev),
3673
- children: [
3674
- (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3675
- "img",
3676
- {
3677
- src: selectedItem.iconUrl,
3678
- alt: "",
3679
- className: "h-4 w-4 shrink-0 rounded-sm object-contain"
3680
- }
3681
- ) : null,
3682
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
3683
- ]
3684
- }
3685
- ),
3686
- /* @__PURE__ */ (0, import_jsx_runtime63.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_runtime63.jsx)(Icon, { name: "chevron-down", size: "s", color: "currentColor" }) }),
3687
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3688
- "div",
3689
- {
3690
- role: "listbox",
3691
- "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
3692
- 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",
3693
- children: items.map((item) => {
3694
- const isSelected = item.value === value;
3695
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
3696
- "button",
3697
- {
3698
- type: "button",
3699
- role: "option",
3700
- "aria-selected": isSelected,
3701
- disabled: item.disabled,
3702
- className: cn(
3703
- "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
3704
- "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
3705
- isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
3706
- item.disabled && "cursor-not-allowed opacity-60"
3678
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
3679
+ "div",
3680
+ {
3681
+ ref: containerRef,
3682
+ className: cn("group/agg-select", "relative inline-flex w-full", className),
3683
+ children: [
3684
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
3685
+ "button",
3686
+ {
3687
+ type: "button",
3688
+ "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
3689
+ "aria-expanded": isOpen,
3690
+ "aria-haspopup": "listbox",
3691
+ disabled: isDisabled,
3692
+ className: cn(
3693
+ "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",
3694
+ "flex items-center gap-2 text-left",
3695
+ getMotionClassName(
3696
+ enableAnimations,
3697
+ "transition-[border-color,box-shadow] duration-200 ease-in-out"
3707
3698
  ),
3708
- onClick: () => {
3709
- if (!item.disabled) {
3710
- onChange(item.value);
3711
- close();
3699
+ "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
3700
+ "disabled:cursor-not-allowed disabled:opacity-60"
3701
+ ),
3702
+ onClick: () => setIsOpen((prev) => !prev),
3703
+ children: [
3704
+ (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3705
+ "img",
3706
+ {
3707
+ src: selectedItem.iconUrl,
3708
+ alt: "",
3709
+ className: "h-4 w-4 shrink-0 rounded-sm object-contain"
3712
3710
  }
3713
- },
3714
- children: [
3715
- item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3716
- "img",
3717
- {
3718
- src: item.iconUrl,
3719
- alt: "",
3720
- className: "h-4 w-4 shrink-0 rounded-sm object-contain"
3721
- }
3722
- ) : null,
3723
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "truncate", children: item.label })
3724
- ]
3725
- },
3726
- item.value
3727
- );
3728
- })
3729
- }
3730
- ) : null
3731
- ] });
3711
+ ) : null,
3712
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
3713
+ ]
3714
+ }
3715
+ ),
3716
+ /* @__PURE__ */ (0, import_jsx_runtime63.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_runtime63.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) }),
3717
+ isOpen ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3718
+ "div",
3719
+ {
3720
+ role: "listbox",
3721
+ "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
3722
+ 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",
3723
+ children: items.map((item) => {
3724
+ const isSelected = item.value === value;
3725
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
3726
+ "button",
3727
+ {
3728
+ type: "button",
3729
+ role: "option",
3730
+ "aria-selected": isSelected,
3731
+ disabled: item.disabled,
3732
+ className: cn(
3733
+ "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
3734
+ "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
3735
+ isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
3736
+ item.disabled && "cursor-not-allowed opacity-60"
3737
+ ),
3738
+ onClick: () => {
3739
+ if (!item.disabled) {
3740
+ onChange(item.value);
3741
+ close();
3742
+ }
3743
+ },
3744
+ children: [
3745
+ item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
3746
+ "img",
3747
+ {
3748
+ src: item.iconUrl,
3749
+ alt: "",
3750
+ className: "h-4 w-4 shrink-0 rounded-sm object-contain"
3751
+ }
3752
+ ) : null,
3753
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "truncate", children: item.label })
3754
+ ]
3755
+ },
3756
+ item.value
3757
+ );
3758
+ })
3759
+ }
3760
+ ) : null
3761
+ ]
3762
+ }
3763
+ );
3732
3764
  };
3733
3765
  Select.displayName = "Select";
3734
3766
 
@@ -3755,86 +3787,10 @@ var findEdgeEnabledIndex = (items, direction) => {
3755
3787
  }
3756
3788
  return -1;
3757
3789
  };
3758
- var FALLBACK_TAB_WIDTH = 112;
3759
- var FALLBACK_MORE_WIDTH = 56;
3760
- var sumWidths = (indices, widths) => {
3761
- return [...indices].reduce((accumulator, index) => {
3762
- var _a;
3763
- return accumulator + ((_a = widths[index]) != null ? _a : 0);
3764
- }, 0);
3765
- };
3766
- var resolveTabsOverflowLayout = ({
3767
- items,
3768
- value,
3769
- containerWidth,
3770
- moreButtonWidth,
3771
- itemWidthByValue
3772
- }) => {
3773
- var _a;
3774
- if (items.length === 0) {
3775
- return {
3776
- visibleItems: [],
3777
- hiddenItems: []
3778
- };
3779
- }
3780
- if (!Number.isFinite(containerWidth) || containerWidth <= 0) {
3781
- return {
3782
- visibleItems: items,
3783
- hiddenItems: []
3784
- };
3785
- }
3786
- const resolvedItemWidths = items.map((item) => {
3787
- var _a2;
3788
- const measuredWidth = (_a2 = itemWidthByValue.get(item.value)) != null ? _a2 : FALLBACK_TAB_WIDTH;
3789
- return Math.max(1, measuredWidth);
3790
- });
3791
- const totalItemsWidth = resolvedItemWidths.reduce((sum, width) => {
3792
- return sum + width;
3793
- }, 0);
3794
- if (totalItemsWidth <= containerWidth) {
3795
- return {
3796
- visibleItems: items,
3797
- hiddenItems: []
3798
- };
3799
- }
3800
- const reservedMoreWidth = Math.max(1, moreButtonWidth || FALLBACK_MORE_WIDTH);
3801
- const visibleIndices = /* @__PURE__ */ new Set();
3802
- let usedWidth = 0;
3803
- for (let index = 0; index < items.length; index += 1) {
3804
- const itemWidth = (_a = resolvedItemWidths[index]) != null ? _a : FALLBACK_TAB_WIDTH;
3805
- const hasRemainingItems = index < items.length - 1;
3806
- const requiredExtraWidth = hasRemainingItems ? reservedMoreWidth : 0;
3807
- if (usedWidth + itemWidth + requiredExtraWidth > containerWidth)
3808
- break;
3809
- visibleIndices.add(index);
3810
- usedWidth += itemWidth;
3811
- }
3812
- if (visibleIndices.size === 0) {
3813
- visibleIndices.add(0);
3814
- }
3815
- const activeIndex = items.findIndex((item) => item.value === value);
3816
- const isActiveHidden = activeIndex >= 0 && !visibleIndices.has(activeIndex);
3817
- if (isActiveHidden && activeIndex >= 0) {
3818
- visibleIndices.add(activeIndex);
3819
- while (visibleIndices.size > 1) {
3820
- const visibleWidth = sumWidths(visibleIndices, resolvedItemWidths);
3821
- if (visibleWidth + reservedMoreWidth <= containerWidth)
3822
- break;
3823
- const removableIndex = [...visibleIndices].sort((left, right) => right - left).find((index) => index !== activeIndex);
3824
- if (removableIndex == null)
3825
- break;
3826
- visibleIndices.delete(removableIndex);
3827
- }
3828
- }
3829
- return {
3830
- visibleItems: items.filter((_, index) => visibleIndices.has(index)),
3831
- hiddenItems: items.filter((_, index) => !visibleIndices.has(index))
3832
- };
3833
- };
3834
3790
 
3835
3791
  // src/primitives/tabs/index.tsx
3836
3792
  var import_jsx_runtime64 = require("react/jsx-runtime");
3837
- var mobileTabsMediaQuery = "(max-width: 767px)";
3793
+ var mobileTabsMediaQuery = "(max-width: 512px)";
3838
3794
  var getTabButtonClassName = ({
3839
3795
  enableAnimations,
3840
3796
  isBarVariant,
@@ -3846,7 +3802,11 @@ var getTabButtonClassName = ({
3846
3802
  return cn(
3847
3803
  "cursor-pointer disabled:cursor-not-allowed",
3848
3804
  "relative inline-flex h-full shrink-0 items-center justify-center gap-2 font-agg-sans",
3849
- getMotionClassName(enableAnimations, "transition-colors motion-reduce:transition-none"),
3805
+ isBarVariant ? "hover:text-agg-foreground hover:bg-agg-secondary-hover" : "hover:text-agg-foreground hover:font-bold",
3806
+ getMotionClassName(
3807
+ enableAnimations,
3808
+ "transition-[colors] duration-300 ease-in-out motion-reduce:transition-none"
3809
+ ),
3850
3810
  isBarVariant ? cn(
3851
3811
  "min-w-20 overflow-hidden border-r border-agg-separator last:border-r-0",
3852
3812
  isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
@@ -3858,48 +3818,19 @@ var getTabButtonClassName = ({
3858
3818
  isDisabled && "cursor-not-allowed opacity-60"
3859
3819
  );
3860
3820
  };
3861
- var getMeasureTabClassName = ({
3862
- isBarVariant,
3863
- size
3821
+ var Tabs = ({
3822
+ items,
3823
+ value,
3824
+ onChange,
3825
+ variant = "bar",
3826
+ size = "m",
3827
+ overflowBehavior,
3828
+ ariaLabel,
3829
+ className,
3830
+ classNames
3864
3831
  }) => {
3865
- const isSmall = size === "s";
3866
- return cn(
3867
- "relative inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-agg-sans",
3868
- isBarVariant ? cn(
3869
- "h-8 min-w-20 border-r border-agg-separator font-agg-bold",
3870
- isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
3871
- ) : cn(
3872
- "h-12 font-agg-bold",
3873
- isSmall ? "px-4 text-agg-sm leading-agg-5" : "px-5 text-agg-base leading-agg-6"
3874
- )
3875
- );
3876
- };
3877
- var getMoreButtonClassName = ({
3878
- enableAnimations,
3879
- isBarVariant,
3880
- size
3881
- }) => {
3882
- const isSmall = size === "s";
3883
- return cn(
3884
- "cursor-pointer disabled:cursor-not-allowed",
3885
- "relative inline-flex shrink-0 items-center justify-center overflow-hidden font-agg-sans text-agg-foreground hover:bg-agg-secondary-hover",
3886
- getMotionClassName(enableAnimations, "transition-colors motion-reduce:transition-none"),
3887
- 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")
3888
- );
3889
- };
3890
- var Tabs = ({
3891
- items,
3892
- value,
3893
- onChange,
3894
- variant = "bar",
3895
- size = "m",
3896
- overflowBehavior,
3897
- overflowMenuAriaLabel,
3898
- ariaLabel,
3899
- className
3900
- }) => {
3901
- const labels = (0, import_hooks14.useLabels)();
3902
- const { enableAnimations, rootClassName } = (0, import_hooks14.useSdkUiConfig)();
3832
+ const labels = (0, import_hooks15.useLabels)();
3833
+ const { enableAnimations } = (0, import_hooks15.useSdkUiConfig)();
3903
3834
  const buttonRefs = (0, import_react5.useRef)([]);
3904
3835
  const dragStateRef = (0, import_react5.useRef)({
3905
3836
  isPointerDown: false,
@@ -3911,8 +3842,6 @@ var Tabs = ({
3911
3842
  });
3912
3843
  const suppressClickRef = (0, import_react5.useRef)(false);
3913
3844
  const resolvedAriaLabel = ariaLabel != null ? ariaLabel : labels.common.tabsAria;
3914
- const resolvedOverflowMenuAriaLabel = overflowMenuAriaLabel != null ? overflowMenuAriaLabel : labels.common.hiddenTabsAria;
3915
- const [isMoreMenuOpen, setIsMoreMenuOpen] = (0, import_react5.useState)(false);
3916
3845
  const [isMobileViewport, setIsMobileViewport] = (0, import_react5.useState)(false);
3917
3846
  const [isDraggingTabs, setIsDraggingTabs] = (0, import_react5.useState)(false);
3918
3847
  const [activeUnderlineStyle, setActiveUnderlineStyle] = (0, import_react5.useState)({
@@ -3920,39 +3849,21 @@ var Tabs = ({
3920
3849
  width: 0,
3921
3850
  opacity: 0
3922
3851
  });
3923
- const [overflowLayout, setOverflowLayout] = (0, import_react5.useState)({
3924
- visibleItems: items,
3925
- hiddenItems: []
3926
- });
3927
3852
  const [scrollAffordanceState, setScrollAffordanceState] = (0, import_react5.useState)({
3928
3853
  showStart: false,
3929
3854
  showEnd: false
3930
3855
  });
3931
- const containerRef = (0, import_react5.useRef)(null);
3932
3856
  const tabListRef = (0, import_react5.useRef)(null);
3933
- const moreButtonMeasureRef = (0, import_react5.useRef)(null);
3934
- const tabMeasureRefs = (0, import_react5.useRef)(/* @__PURE__ */ new Map());
3935
3857
  const isBarVariant = variant === "bar";
3936
3858
  const resolvedOverflowBehavior = (0, import_react5.useMemo)(() => {
3937
3859
  if (overflowBehavior)
3938
3860
  return overflowBehavior;
3939
3861
  if (!isBarVariant)
3940
3862
  return "scroll";
3941
- return isMobileViewport ? "select" : "menu";
3863
+ return isMobileViewport ? "select" : "scroll";
3942
3864
  }, [isBarVariant, isMobileViewport, overflowBehavior]);
3943
- const shouldUseOverflowMenu = resolvedOverflowBehavior === "menu";
3944
3865
  const shouldUseOverflowScroll = resolvedOverflowBehavior === "scroll";
3945
3866
  const shouldUseOverflowSelect = resolvedOverflowBehavior === "select";
3946
- const handleMeasureTabRef = (0, import_react5.useCallback)(
3947
- (tabValue, tabElement) => {
3948
- if (!tabElement) {
3949
- tabMeasureRefs.current.delete(tabValue);
3950
- return;
3951
- }
3952
- tabMeasureRefs.current.set(tabValue, tabElement);
3953
- },
3954
- []
3955
- );
3956
3867
  (0, import_react5.useEffect)(() => {
3957
3868
  if (typeof window === "undefined")
3958
3869
  return;
@@ -3972,55 +3883,6 @@ var Tabs = ({
3972
3883
  mediaQueryList.removeListener(handleMediaQueryChange);
3973
3884
  };
3974
3885
  }, []);
3975
- const handleRecalculateOverflow = (0, import_react5.useCallback)(() => {
3976
- var _a, _b, _c, _d;
3977
- if (!shouldUseOverflowMenu) {
3978
- setOverflowLayout({
3979
- visibleItems: items,
3980
- hiddenItems: []
3981
- });
3982
- return;
3983
- }
3984
- const containerWidth = (_b = (_a = containerRef.current) == null ? void 0 : _a.clientWidth) != null ? _b : 0;
3985
- const moreButtonWidth = (_d = (_c = moreButtonMeasureRef.current) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
3986
- const itemWidthByValue = new Map(
3987
- items.map((item) => {
3988
- var _a2, _b2;
3989
- return [item.value, (_b2 = (_a2 = tabMeasureRefs.current.get(item.value)) == null ? void 0 : _a2.offsetWidth) != null ? _b2 : 0];
3990
- })
3991
- );
3992
- setOverflowLayout(
3993
- resolveTabsOverflowLayout({
3994
- items,
3995
- value,
3996
- containerWidth,
3997
- moreButtonWidth,
3998
- itemWidthByValue
3999
- })
4000
- );
4001
- }, [items, shouldUseOverflowMenu, value]);
4002
- (0, import_react5.useEffect)(() => {
4003
- handleRecalculateOverflow();
4004
- }, [handleRecalculateOverflow]);
4005
- (0, import_react5.useEffect)(() => {
4006
- if (!shouldUseOverflowMenu)
4007
- return;
4008
- const container = containerRef.current;
4009
- if (!container || typeof ResizeObserver === "undefined")
4010
- return;
4011
- const resizeObserver = new ResizeObserver(() => {
4012
- handleRecalculateOverflow();
4013
- });
4014
- resizeObserver.observe(container);
4015
- return () => {
4016
- resizeObserver.disconnect();
4017
- };
4018
- }, [handleRecalculateOverflow, shouldUseOverflowMenu]);
4019
- (0, import_react5.useEffect)(() => {
4020
- if (overflowLayout.hiddenItems.length > 0)
4021
- return;
4022
- setIsMoreMenuOpen(false);
4023
- }, [overflowLayout.hiddenItems.length]);
4024
3886
  const updateScrollAffordances = (0, import_react5.useCallback)(() => {
4025
3887
  if (!shouldUseOverflowScroll) {
4026
3888
  setScrollAffordanceState({
@@ -4038,8 +3900,7 @@ var Tabs = ({
4038
3900
  showEnd: maxScrollLeft - tabListElement.scrollLeft > 4
4039
3901
  });
4040
3902
  }, [shouldUseOverflowScroll]);
4041
- const renderedItems = shouldUseOverflowMenu ? overflowLayout.visibleItems : items;
4042
- const shouldShowMoreButton = shouldUseOverflowMenu && overflowLayout.hiddenItems.length > 0;
3903
+ const renderedItems = items;
4043
3904
  const selectItems = (0, import_react5.useMemo)(() => {
4044
3905
  return items.map((item) => ({
4045
3906
  value: item.value,
@@ -4064,24 +3925,24 @@ var Tabs = ({
4064
3925
  (_a = buttonRefs.current[index]) == null ? void 0 : _a.focus();
4065
3926
  };
4066
3927
  const handleKeyDown = (event, index) => {
4067
- switch (event.key) {
3928
+ switch (event == null ? void 0 : event.key) {
4068
3929
  case "ArrowRight": {
4069
- event.preventDefault();
3930
+ event == null ? void 0 : event.preventDefault();
4070
3931
  handleMoveFocus(findNextEnabledIndex(renderedItems, index, 1));
4071
3932
  return;
4072
3933
  }
4073
3934
  case "ArrowLeft": {
4074
- event.preventDefault();
3935
+ event == null ? void 0 : event.preventDefault();
4075
3936
  handleMoveFocus(findNextEnabledIndex(renderedItems, index, -1));
4076
3937
  return;
4077
3938
  }
4078
3939
  case "Home": {
4079
- event.preventDefault();
3940
+ event == null ? void 0 : event.preventDefault();
4080
3941
  handleMoveFocus(findEdgeEnabledIndex(renderedItems, 1));
4081
3942
  return;
4082
3943
  }
4083
3944
  case "End": {
4084
- event.preventDefault();
3945
+ event == null ? void 0 : event.preventDefault();
4085
3946
  handleMoveFocus(findEdgeEnabledIndex(renderedItems, -1));
4086
3947
  return;
4087
3948
  }
@@ -4089,22 +3950,16 @@ var Tabs = ({
4089
3950
  return;
4090
3951
  }
4091
3952
  };
4092
- const activeHiddenItem = (0, import_react5.useMemo)(() => {
4093
- if (!shouldUseOverflowMenu)
4094
- return void 0;
4095
- return overflowLayout.hiddenItems.find((item) => item.value === value);
4096
- }, [overflowLayout.hiddenItems, shouldUseOverflowMenu, value]);
4097
3953
  const tabListClassName = cn(
4098
3954
  "inline-flex items-stretch bg-agg-secondary",
4099
- shouldUseOverflowMenu ? "min-w-0 flex-1 overflow-hidden" : shouldUseOverflowScroll ? cn(
3955
+ shouldUseOverflowScroll ? cn(
4100
3956
  "overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
4101
3957
  getMotionClassName(enableAnimations, "scroll-smooth")
4102
3958
  ) : "overflow-x-auto",
4103
3959
  isBarVariant ? "h-8 rounded-agg-sm border border-agg-separator" : "h-12 border-b border-agg-separator -mb-[1px]",
4104
3960
  shouldUseOverflowScroll && "select-none",
4105
3961
  shouldUseOverflowScroll && !isBarVariant && "snap-x snap-mandatory",
4106
- shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab"),
4107
- shouldShowMoreButton && isBarVariant && "rounded-r-none border-r-0"
3962
+ shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab")
4108
3963
  );
4109
3964
  const handleTabListWheel = (event) => {
4110
3965
  if (!shouldUseOverflowScroll)
@@ -4193,14 +4048,10 @@ var Tabs = ({
4193
4048
  const handleTabListClickCapture = (event) => {
4194
4049
  if (!suppressClickRef.current)
4195
4050
  return;
4196
- event.preventDefault();
4197
- event.stopPropagation();
4051
+ event == null ? void 0 : event.preventDefault();
4052
+ event == null ? void 0 : event.stopPropagation();
4198
4053
  suppressClickRef.current = false;
4199
4054
  };
4200
- const handleSelectHiddenItem = (nextValue) => {
4201
- handleSelect(nextValue);
4202
- setIsMoreMenuOpen(false);
4203
- };
4204
4055
  const updateActiveUnderline = (0, import_react5.useCallback)(() => {
4205
4056
  if (isBarVariant) {
4206
4057
  setActiveUnderlineStyle({
@@ -4268,18 +4119,34 @@ var Tabs = ({
4268
4119
  (0, import_react5.useEffect)(() => {
4269
4120
  if (!shouldUseOverflowScroll)
4270
4121
  return;
4122
+ const tabListElement = tabListRef.current;
4123
+ if (!tabListElement)
4124
+ return;
4271
4125
  const activeIndex = renderedItems.findIndex((item) => item.value === value);
4272
4126
  const activeButton = activeIndex >= 0 ? buttonRefs.current[activeIndex] : null;
4273
4127
  if (!activeButton)
4274
4128
  return;
4275
- activeButton.scrollIntoView({
4276
- behavior: getScrollBehavior(enableAnimations),
4277
- block: "nearest",
4278
- inline: "nearest"
4129
+ if (tabListElement.scrollWidth - tabListElement.clientWidth <= 1)
4130
+ return;
4131
+ const currentScrollLeft = tabListElement.scrollLeft;
4132
+ const currentScrollRight = currentScrollLeft + tabListElement.clientWidth;
4133
+ const activeButtonLeft = activeButton.offsetLeft;
4134
+ const activeButtonRight = activeButtonLeft + activeButton.offsetWidth;
4135
+ let nextScrollLeft = currentScrollLeft;
4136
+ if (activeButtonLeft < currentScrollLeft) {
4137
+ nextScrollLeft = activeButtonLeft;
4138
+ } else if (activeButtonRight > currentScrollRight) {
4139
+ nextScrollLeft = activeButtonRight - tabListElement.clientWidth;
4140
+ }
4141
+ if (Math.abs(nextScrollLeft - currentScrollLeft) < 1)
4142
+ return;
4143
+ tabListElement.scrollTo({
4144
+ left: Math.max(0, nextScrollLeft),
4145
+ behavior: getScrollBehavior(enableAnimations)
4279
4146
  });
4280
4147
  }, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
4281
4148
  if (shouldUseOverflowSelect) {
4282
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4149
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: cn("w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4283
4150
  Select,
4284
4151
  {
4285
4152
  ariaLabel,
@@ -4294,10 +4161,12 @@ var Tabs = ({
4294
4161
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4295
4162
  "div",
4296
4163
  {
4297
- ref: containerRef,
4298
4164
  className: cn(
4299
- "relative inline-flex max-w-full items-stretch font-agg-sans bg-agg-secondary",
4300
- className
4165
+ "group/agg-tabs",
4166
+ "relative max-w-full items-stretch font-agg-sans bg-agg-secondary",
4167
+ "inline-flex",
4168
+ className,
4169
+ classNames == null ? void 0 : classNames.root
4301
4170
  ),
4302
4171
  children: [
4303
4172
  /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
@@ -4306,7 +4175,7 @@ var Tabs = ({
4306
4175
  ref: tabListRef,
4307
4176
  role: "tablist",
4308
4177
  "aria-label": resolvedAriaLabel,
4309
- className: cn("relative", tabListClassName),
4178
+ className: cn("relative", tabListClassName, classNames == null ? void 0 : classNames.tabList),
4310
4179
  onClickCapture: handleTabListClickCapture,
4311
4180
  onPointerCancel: handleEndTabListDrag,
4312
4181
  onPointerDown: handleTabListPointerDown,
@@ -4328,7 +4197,11 @@ var Tabs = ({
4328
4197
  "aria-selected": isActive,
4329
4198
  "aria-label": item.label,
4330
4199
  disabled: item.disabled,
4331
- onClick: () => handleSelect(item.value),
4200
+ onClick: (e) => {
4201
+ e.preventDefault();
4202
+ e.stopPropagation();
4203
+ handleSelect(item.value);
4204
+ },
4332
4205
  onKeyDown: (event) => handleKeyDown(event, index),
4333
4206
  className: cn(
4334
4207
  getTabButtonClassName({
@@ -4370,7 +4243,7 @@ var Tabs = ({
4370
4243
  "pointer-events-none absolute bottom-0 left-0 rounded-t-agg-sm bg-agg-primary",
4371
4244
  getMotionClassName(
4372
4245
  enableAnimations,
4373
- "transition-[transform,width,opacity] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]"
4246
+ "transition-[transform,width,opacity] duration-300 ease-in-out"
4374
4247
  ),
4375
4248
  "h-[3px]"
4376
4249
  ),
@@ -4386,7 +4259,7 @@ var Tabs = ({
4386
4259
  {
4387
4260
  "aria-hidden": true,
4388
4261
  className: cn(
4389
- "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",
4262
+ "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",
4390
4263
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
4391
4264
  scrollAffordanceState.showStart ? "opacity-100" : "opacity-0"
4392
4265
  )
@@ -4397,104 +4270,13 @@ var Tabs = ({
4397
4270
  {
4398
4271
  "aria-hidden": true,
4399
4272
  className: cn(
4400
- "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",
4273
+ "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",
4401
4274
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
4402
4275
  scrollAffordanceState.showEnd ? "opacity-100" : "opacity-0"
4403
4276
  )
4404
4277
  }
4405
4278
  )
4406
- ] }) : null,
4407
- shouldShowMoreButton ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DropdownMenu.Root, { open: isMoreMenuOpen, onOpenChange: setIsMoreMenuOpen, children: [
4408
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4409
- "button",
4410
- {
4411
- type: "button",
4412
- "aria-label": resolvedOverflowMenuAriaLabel,
4413
- className: cn(
4414
- getMoreButtonClassName({
4415
- enableAnimations,
4416
- isBarVariant,
4417
- size
4418
- }),
4419
- activeHiddenItem ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground"
4420
- ),
4421
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Icon, { name: "dots-horizontal", size: isBarVariant ? "s" : "m", color: "currentColor" })
4422
- }
4423
- ) }),
4424
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4425
- DropdownMenu.Content,
4426
- {
4427
- align: "end",
4428
- "aria-label": resolvedOverflowMenuAriaLabel,
4429
- className: cn(
4430
- AGG_ROOT_CLASS_NAME,
4431
- rootClassName,
4432
- "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"
4433
- ),
4434
- "data-agg-animations": enableAnimations ? "true" : "false",
4435
- sideOffset: 8,
4436
- children: overflowLayout.hiddenItems.map((item) => {
4437
- const isSelected = item.value === value;
4438
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4439
- DropdownMenu.Item,
4440
- {
4441
- disabled: item.disabled,
4442
- onSelect: () => handleSelectHiddenItem(item.value),
4443
- className: cn(
4444
- "cursor-pointer disabled:cursor-not-allowed",
4445
- "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
4446
- getMotionClassName(enableAnimations, "transition-colors"),
4447
- "focus:bg-agg-secondary-hover data-[highlighted]:bg-agg-secondary-hover",
4448
- isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
4449
- item.disabled && "cursor-not-allowed opacity-60"
4450
- ),
4451
- children: [
4452
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
4453
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "truncate whitespace-nowrap [&::first-letter]:uppercase", children: item.label })
4454
- ]
4455
- },
4456
- item.value
4457
- );
4458
- })
4459
- }
4460
- ) })
4461
- ] }) : null,
4462
- shouldUseOverflowMenu ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4463
- "div",
4464
- {
4465
- "aria-hidden": true,
4466
- className: "pointer-events-none invisible fixed top-0 left-0 -z-10 h-0 overflow-hidden whitespace-nowrap",
4467
- children: [
4468
- items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4469
- "span",
4470
- {
4471
- ref: (tabElement) => handleMeasureTabRef(item.value, tabElement),
4472
- className: getMeasureTabClassName({
4473
- isBarVariant,
4474
- size
4475
- }),
4476
- children: [
4477
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
4478
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: item.label })
4479
- ]
4480
- },
4481
- `measure-${item.value}`
4482
- )),
4483
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4484
- "span",
4485
- {
4486
- ref: moreButtonMeasureRef,
4487
- className: getMoreButtonClassName({
4488
- enableAnimations,
4489
- isBarVariant,
4490
- size
4491
- }),
4492
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Icon, { name: "dots-horizontal", size: isBarVariant ? "s" : "m", color: "currentColor" })
4493
- }
4494
- )
4495
- ]
4496
- }
4497
- ) : null
4279
+ ] }) : null
4498
4280
  ]
4499
4281
  }
4500
4282
  );
@@ -4502,21 +4284,22 @@ var Tabs = ({
4502
4284
  Tabs.displayName = "Tabs";
4503
4285
 
4504
4286
  // src/primitives/loading-icon/index.tsx
4505
- var import_hooks15 = require("@agg-market/hooks");
4287
+ var import_hooks16 = require("@agg-market/hooks");
4506
4288
  var import_jsx_runtime65 = require("react/jsx-runtime");
4507
4289
  var LoadingIcon = ({
4508
- size = "m",
4290
+ size = "medium",
4509
4291
  className,
4510
4292
  ariaLabel
4511
4293
  }) => {
4512
- const labels = (0, import_hooks15.useLabels)();
4513
- const { enableAnimations } = (0, import_hooks15.useSdkUiConfig)();
4294
+ const labels = (0, import_hooks16.useLabels)();
4295
+ const { enableAnimations } = (0, import_hooks16.useSdkUiConfig)();
4514
4296
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
4515
4297
  "span",
4516
4298
  {
4517
4299
  role: "status",
4518
4300
  "aria-label": ariaLabel != null ? ariaLabel : labels.common.loading,
4519
4301
  className: cn(
4302
+ "group/agg-loading-icon",
4520
4303
  "inline-grid place-items-center text-agg-primary will-change-transform",
4521
4304
  className
4522
4305
  ),
@@ -4812,7 +4595,7 @@ var MarketDetailsLoadingState = ({
4812
4595
  ariaLabel,
4813
4596
  classNames
4814
4597
  }) => {
4815
- const labels = (0, import_hooks16.useLabels)();
4598
+ const labels = (0, import_hooks17.useLabels)();
4816
4599
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4817
4600
  Skeleton,
4818
4601
  {
@@ -4826,7 +4609,7 @@ var MarketDetailsUnavailableState = ({
4826
4609
  ariaLabel,
4827
4610
  classNames
4828
4611
  }) => {
4829
- const labels = (0, import_hooks16.useLabels)();
4612
+ const labels = (0, import_hooks17.useLabels)();
4830
4613
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4831
4614
  Card,
4832
4615
  {
@@ -4834,8 +4617,8 @@ var MarketDetailsUnavailableState = ({
4834
4617
  role: "status",
4835
4618
  "aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.unavailableAria,
4836
4619
  children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-1 p-5", children: [
4837
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "title", children: labels.marketDetails.unavailableTitle }),
4838
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "meta", children: labels.marketDetails.unavailableDescription })
4620
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "body-large-strong", children: labels.marketDetails.unavailableTitle }),
4621
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.unavailableDescription })
4839
4622
  ] })
4840
4623
  }
4841
4624
  );
@@ -4846,16 +4629,16 @@ var OrderBookRows = ({
4846
4629
  formatNumber,
4847
4630
  formatCurrency
4848
4631
  }) => {
4849
- const labels = (0, import_hooks16.useLabels)();
4632
+ const labels = (0, import_hooks17.useLabels)();
4850
4633
  const isAsks = title === labels.marketDetails.asks;
4851
4634
  const priceClassName = isAsks ? "text-agg-orderbook-ask" : "text-agg-orderbook-bid";
4852
4635
  const barClassName = isAsks ? "bg-agg-orderbook-ask/10" : "bg-agg-orderbook-bid/10";
4853
4636
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-2", children: [
4854
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "label", className: "text-agg-xs leading-agg-4", children: title }),
4637
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "caption-caps", children: title }),
4855
4638
  rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-2", children: [
4856
4639
  /* @__PURE__ */ (0, import_jsx_runtime66.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: [
4857
4640
  /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center gap-1 md:gap-3", children: [
4858
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(VenueLogo, { venue: row.venue, size: "xs" }),
4641
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(VenueLogo, { venue: row.venue, size: "small" }),
4859
4642
  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4860
4643
  "span",
4861
4644
  {
@@ -4889,11 +4672,15 @@ var getOutcomeButtonClassName = ({
4889
4672
  isPositive,
4890
4673
  isActive
4891
4674
  }) => {
4675
+ 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";
4676
+ const activeStateClassName = isPositive ? "border-transparent bg-[#18c15c] text-agg-on-primary" : "border-transparent bg-[#e5455f] text-agg-on-primary";
4892
4677
  return cn(
4893
4678
  "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]",
4894
- getMotionClassName(enableAnimations, "transition-all duration-300"),
4895
- 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",
4896
- isActive && (isPositive ? "border-agg-orderbook-bid" : "border-agg-orderbook-ask")
4679
+ getMotionClassName(enableAnimations, "transition-all duration-300 ease-in-out"),
4680
+ isActive ? activeStateClassName : defaultStateClassName,
4681
+ "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",
4682
+ "cursor-pointer disabled:cursor-not-allowed disabled:text-agg-muted-foreground",
4683
+ isActive ? "font-agg-bold" : "font-agg-normal"
4897
4684
  );
4898
4685
  };
4899
4686
  var MarketDetailsContent = ({
@@ -4911,8 +4698,8 @@ var MarketDetailsContent = ({
4911
4698
  classNames,
4912
4699
  otherContent
4913
4700
  }) => {
4914
- const config = (0, import_hooks16.useSdkUiConfig)();
4915
- const labels = (0, import_hooks16.useLabels)();
4701
+ const config = (0, import_hooks17.useSdkUiConfig)();
4702
+ const labels = (0, import_hooks17.useLabels)();
4916
4703
  const detailsContentId = (0, import_react6.useId)();
4917
4704
  const model = (0, import_react6.useMemo)(() => {
4918
4705
  return buildMarketDetailsModel({
@@ -4998,7 +4785,7 @@ var MarketDetailsContent = ({
4998
4785
  const priceHistoryGroups = (0, import_react6.useMemo)(() => {
4999
4786
  return buildPriceHistoryGroups(graphOutcomes);
5000
4787
  }, [graphOutcomes]);
5001
- const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0, import_hooks16.usePriceHistory)(__spreadProps(__spreadValues({
4788
+ const { data: priceHistoryData, isLoading: isPriceHistoryLoading } = (0, import_hooks17.usePriceHistory)(__spreadProps(__spreadValues({
5002
4789
  groups: priceHistoryGroups
5003
4790
  }, timeWindow), {
5004
4791
  enabled: isOpened && selectedTab === "graph" && priceHistoryGroups.length > 0
@@ -5010,7 +4797,7 @@ var MarketDetailsContent = ({
5010
4797
  liveUpdate: true
5011
4798
  }));
5012
4799
  }, [selectedOutcomesByVenue]);
5013
- const { data: orderBookData, isLoading: isOrderBookLoading } = (0, import_hooks16.useOrderBook)({
4800
+ const { data: orderBookData, isLoading: isOrderBookLoading } = (0, import_hooks17.useOrderBook)({
5014
4801
  orderbooks: orderBookInputs,
5015
4802
  enabled: isOpened && selectedTab === "order-book" && orderBookInputs.length > 0
5016
4803
  });
@@ -5100,7 +4887,7 @@ var MarketDetailsContent = ({
5100
4887
  }, [labels, model]);
5101
4888
  const handleOutcomeKeyDown = (eventToHandle) => {
5102
4889
  var _a;
5103
- if (eventToHandle.key !== "ArrowLeft" && eventToHandle.key !== "ArrowRight") {
4890
+ if ((eventToHandle == null ? void 0 : eventToHandle.key) !== "ArrowLeft" && (eventToHandle == null ? void 0 : eventToHandle.key) !== "ArrowRight") {
5104
4891
  return;
5105
4892
  }
5106
4893
  if (headerOutcomeItems.length <= 1)
@@ -5112,9 +4899,17 @@ var MarketDetailsContent = ({
5112
4899
  const nextIndex = activeIndex < 0 ? 0 : (activeIndex + direction + headerOutcomeItems.length) % headerOutcomeItems.length;
5113
4900
  setSelectedOutcomeLabel((_a = headerOutcomeItems[nextIndex]) == null ? void 0 : _a.label);
5114
4901
  };
5115
- const handleToggleExpanded = () => {
5116
- setIsOpened((prev) => !prev);
5117
- onOpenChange == null ? void 0 : onOpenChange(!isOpened);
4902
+ const handleToggleExpanded = (event2) => {
4903
+ if (event2 && "key" in event2 && (event2 == null ? void 0 : event2.key) !== "Enter" && (event2 == null ? void 0 : event2.key) !== " ") {
4904
+ return;
4905
+ }
4906
+ event2 == null ? void 0 : event2.preventDefault();
4907
+ event2 == null ? void 0 : event2.stopPropagation();
4908
+ setIsOpened((prev) => {
4909
+ const next = !prev;
4910
+ onOpenChange == null ? void 0 : onOpenChange(next);
4911
+ return next;
4912
+ });
5118
4913
  };
5119
4914
  const handleGraphVenueToggle = (venue) => {
5120
4915
  setSelectedGraphVenue((currentVenue) => {
@@ -5138,88 +4933,101 @@ var MarketDetailsContent = ({
5138
4933
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
5139
4934
  Card,
5140
4935
  {
5141
- className: cn(marketDetailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
5142
- "aria-label": ariaLabel != null ? ariaLabel : model.title,
4936
+ className: cn(
4937
+ "w-full cursor-pointer rounded-agg-2xl text-left outline-none",
4938
+ marketDetailsBaseCardClassName,
4939
+ classNames == null ? void 0 : classNames.root
4940
+ ),
4941
+ "aria-expanded": isOpened,
4942
+ "aria-controls": detailsContentId,
4943
+ role: "button",
4944
+ tabIndex: 0,
4945
+ "aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
4946
+ onClick: handleToggleExpanded,
4947
+ onKeyDown: handleToggleExpanded,
5143
4948
  children: [
5144
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: cn("flex flex-col gap-3 px-5 py-4", isOpened && "pb-3", classNames == null ? void 0 : classNames.header), children: [
5145
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
5146
- "button",
5147
- {
5148
- type: "button",
5149
- className: "flex w-full cursor-pointer items-center justify-between gap-4 rounded-agg-2xl text-left outline-none",
5150
- "aria-expanded": isOpened,
5151
- "aria-controls": detailsContentId,
5152
- "aria-label": isOpened ? labels.marketDetails.toggleCloseDetailsAria(model.title) : labels.marketDetails.toggleOpenDetailsAria(model.title),
5153
- onClick: handleToggleExpanded,
5154
- children: [
5155
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
5156
- model.image ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5157
- "img",
5158
- {
5159
- src: model.image,
5160
- alt: "",
5161
- className: "size-12 rounded-agg-lg object-cover md:size-[60px]"
5162
- }
5163
- ) : null,
5164
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
5165
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { as: "h3", variant: "title", className: "truncate text-agg-lg leading-agg-7", children: model.title }),
5166
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "meta", className: "truncate text-agg-sm leading-agg-5", children: model.subtitle }) })
5167
- ] })
5168
- ] }),
5169
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5170
- Typography,
4949
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
4950
+ "div",
4951
+ {
4952
+ className: cn(
4953
+ "flex flex-row items-center justify-between gap-3 px-5 py-4",
4954
+ isOpened && "pb-3",
4955
+ classNames == null ? void 0 : classNames.header
4956
+ ),
4957
+ children: [
4958
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
4959
+ model.image ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4960
+ "img",
5171
4961
  {
5172
- as: "div",
5173
- variant: "value",
5174
- className: "shrink-0 text-agg-2xl font-agg-bold leading-agg-8",
5175
- children: formatProbabilityPercent(headlineProbability)
4962
+ src: model.image,
4963
+ alt: "",
4964
+ className: "size-12 rounded-agg-lg object-cover md:size-[60px]"
5176
4965
  }
5177
- )
5178
- ]
5179
- }
5180
- ),
5181
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5182
- "div",
5183
- {
5184
- className: "flex gap-2",
5185
- role: "tablist",
5186
- "aria-label": labels.marketDetails.marketOutcomesAria,
5187
- tabIndex: 0,
5188
- onKeyDown: handleOutcomeKeyDown,
5189
- children: headerOutcomeItems.map((item) => {
5190
- const isPositive = item.tone === "positive";
5191
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5192
- "button",
5193
- {
5194
- type: "button",
5195
- role: "tab",
5196
- "aria-selected": item.label === selectedOutcomeLabel,
5197
- tabIndex: item.label === selectedOutcomeLabel ? 0 : -1,
5198
- className: getOutcomeButtonClassName({
5199
- enableAnimations: config.enableAnimations,
5200
- isPositive,
5201
- isActive: item.label === selectedOutcomeLabel
5202
- }),
5203
- onClick: () => {
5204
- setSelectedOutcomeLabel(item.label);
5205
- },
5206
- children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
5207
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5208
- VenueLogo,
5209
- {
5210
- venue: isPositive ? "polymarket" : "probable",
5211
- size: "xs"
5212
- }
5213
- ),
5214
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { className: "text-agg-base leading-agg-6", children: `${item.label} ${formatProbabilityCents(item.probability)}` })
5215
- ] })
5216
- },
5217
- item.label
5218
- );
5219
- })
5220
- }
5221
- )
5222
- ] }),
4966
+ ) : null,
4967
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
4968
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { as: "h3", variant: "body-large-strong", className: "truncate", children: model.title }),
4969
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "label", className: "truncate text-agg-muted-foreground", children: model.subtitle }) })
4970
+ ] })
4971
+ ] }),
4972
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { as: "div", variant: "heading", className: "shrink-0", children: formatProbabilityPercent(headlineProbability) }),
4973
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4974
+ "div",
4975
+ {
4976
+ className: "flex gap-2",
4977
+ role: "tablist",
4978
+ "aria-label": labels.marketDetails.marketOutcomesAria,
4979
+ tabIndex: 0,
4980
+ onKeyDown: (e) => handleOutcomeKeyDown(e),
4981
+ children: headerOutcomeItems.map((item) => {
4982
+ const isPositive = item.tone === "positive";
4983
+ const isActiveOutcome = item.label === selectedOutcomeLabel;
4984
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
4985
+ "button",
4986
+ {
4987
+ type: "button",
4988
+ role: "tab",
4989
+ "aria-selected": isActiveOutcome,
4990
+ tabIndex: isActiveOutcome ? 0 : -1,
4991
+ className: getOutcomeButtonClassName({
4992
+ enableAnimations: config.enableAnimations,
4993
+ isPositive,
4994
+ isActive: isActiveOutcome
4995
+ }),
4996
+ onClick: (e) => {
4997
+ e.preventDefault();
4998
+ e.stopPropagation();
4999
+ setSelectedOutcomeLabel(item.label);
5000
+ },
5001
+ children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
5002
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5003
+ VenueLogo,
5004
+ {
5005
+ venue: isPositive ? "polymarket" : "probable",
5006
+ size: "small",
5007
+ color: isActiveOutcome ? "var(--agg-color-on-primary)" : void 0
5008
+ }
5009
+ ),
5010
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5011
+ Typography,
5012
+ {
5013
+ variant: isActiveOutcome ? "body-strong" : "body",
5014
+ className: cn(
5015
+ "text-agg-base leading-agg-6",
5016
+ isActiveOutcome ? "text-agg-on-primary" : "text-agg-foreground"
5017
+ ),
5018
+ children: `${item.label} ${formatProbabilityCents(item.probability)}`
5019
+ }
5020
+ )
5021
+ ] })
5022
+ },
5023
+ item.label
5024
+ );
5025
+ })
5026
+ }
5027
+ )
5028
+ ]
5029
+ }
5030
+ ),
5223
5031
  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5224
5032
  "div",
5225
5033
  {
@@ -5271,7 +5079,7 @@ var MarketDetailsContent = ({
5271
5079
  "aria-busy": true,
5272
5080
  children: [
5273
5081
  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LoadingIcon, {}),
5274
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "meta", children: labels.marketDetails.loadingOrderbookLabel })
5082
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.marketDetails.loadingOrderbookLabel })
5275
5083
  ]
5276
5084
  }
5277
5085
  ) : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
@@ -5319,9 +5127,13 @@ var MarketDetailsContent = ({
5319
5127
  "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",
5320
5128
  isActiveVenue ? "border-agg-primary bg-agg-secondary" : "border-transparent bg-agg-secondary-hover"
5321
5129
  ),
5322
- onClick: () => handleGraphVenueToggle(item.venue),
5130
+ onClick: (e) => {
5131
+ e.preventDefault();
5132
+ e.stopPropagation();
5133
+ handleGraphVenueToggle(item.venue);
5134
+ },
5323
5135
  children: [
5324
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(VenueLogo, { venue: item.venue, size: "xs" }),
5136
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(VenueLogo, { venue: item.venue, size: "small" }),
5325
5137
  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-agg-base leading-agg-6 text-agg-foreground", children: probability })
5326
5138
  ]
5327
5139
  },
@@ -5366,7 +5178,11 @@ var MarketDetailsContent = ({
5366
5178
  isActive ? "font-agg-bold text-agg-foreground" : "font-agg-normal text-agg-muted-foreground"
5367
5179
  ),
5368
5180
  "aria-pressed": isActive,
5369
- onClick: () => setSelectedTimeRange(timeRange),
5181
+ onClick: (e) => {
5182
+ e.preventDefault();
5183
+ e.stopPropagation();
5184
+ setSelectedTimeRange(timeRange);
5185
+ },
5370
5186
  children: timeRange === "ALL" ? labels.eventItemDetails.allTimeRange : timeRange
5371
5187
  },
5372
5188
  timeRange
@@ -5381,7 +5197,7 @@ var MarketDetailsContent = ({
5381
5197
  {
5382
5198
  className: "flex items-center justify-between rounded-agg-xl bg-agg-secondary-hover px-4 py-3",
5383
5199
  children: [
5384
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "meta", children: row.label }),
5200
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: row.label }),
5385
5201
  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography, { variant: "body", className: "text-right", children: row.value })
5386
5202
  ]
5387
5203
  },
@@ -5417,7 +5233,7 @@ var MarketDetails = (props) => {
5417
5233
  (_a2 = props.onOpenChange) == null ? void 0 : _a2.call(props, nextIsOpened);
5418
5234
  };
5419
5235
  const hasEventProp = "event" in props && !!props.event;
5420
- const { event: fetchedEvent, isLoading: isFetchingEvent } = (0, import_hooks16.useEvent)(
5236
+ const { event: fetchedEvent, isLoading: isFetchingEvent } = (0, import_hooks17.useEvent)(
5421
5237
  hasEventProp ? void 0 : props.eventId,
5422
5238
  {
5423
5239
  enabled: !props.isLoading && !hasEventProp && !!props.eventId
@@ -5469,12 +5285,12 @@ MarketDetails.displayName = "MarketDetails";
5469
5285
 
5470
5286
  // src/trading/place-order/index.tsx
5471
5287
  var import_react7 = require("react");
5472
- var import_hooks18 = require("@agg-market/hooks");
5288
+ var import_hooks19 = require("@agg-market/hooks");
5473
5289
 
5474
5290
  // src/trading/utils.ts
5475
- var import_hooks17 = require("@agg-market/hooks");
5291
+ var import_hooks18 = require("@agg-market/hooks");
5476
5292
  var import_dayjs4 = __toESM(require("dayjs"));
5477
- var defaultLabels = (0, import_hooks17.resolveAggUiLabels)("en-US");
5293
+ var defaultLabels = (0, import_hooks18.resolveAggUiLabels)("en-US");
5478
5294
  var defaultSettlementSectionLabel = defaultLabels.trading.settlementSection;
5479
5295
  var defaultSettlementDifferencesTitle = defaultLabels.trading.settlementDifferencesTitle;
5480
5296
  var defaultTradingDisclaimer = defaultLabels.trading.disclaimer;
@@ -5539,6 +5355,26 @@ var getResultValueClassName = (tone) => {
5539
5355
  return "text-agg-foreground";
5540
5356
  return "text-agg-success";
5541
5357
  };
5358
+ var negativeOutcomePattern = /\b(no|down|against|under|lose|false)\b/i;
5359
+ var resolveIsPositiveOutcome = (outcome, index) => {
5360
+ const outcomeText = `${outcome.id} ${outcome.label}`;
5361
+ if (negativeOutcomePattern.test(outcomeText))
5362
+ return false;
5363
+ if (index === 1)
5364
+ return false;
5365
+ return true;
5366
+ };
5367
+ var getOutcomeButtonClassName2 = ({
5368
+ enableAnimations,
5369
+ isActive,
5370
+ isPositive
5371
+ }) => {
5372
+ return cn(
5373
+ "flex-1 cursor-pointer rounded-agg-full border px-6 py-2.5 text-agg-base leading-agg-6",
5374
+ getMotionClassName(enableAnimations, "transition-all duration-300 ease-in-out"),
5375
+ isActive ? isPositive ? "border-transparent bg-[#18c15c] font-agg-bold text-agg-on-primary" : "border-transparent bg-[#e5455f] font-agg-bold text-agg-on-primary" : "border-transparent bg-agg-secondary-hover font-agg-normal text-agg-foreground hover:bg-agg-tertiary"
5376
+ );
5377
+ };
5542
5378
  var getStatusContent = ({
5543
5379
  placement,
5544
5380
  status,
@@ -5595,8 +5431,8 @@ var PlaceOrder = ({
5595
5431
  onStatusAction,
5596
5432
  onTabChange
5597
5433
  }) => {
5598
- const { enableAnimations } = (0, import_hooks18.useSdkUiConfig)();
5599
- const labels = (0, import_hooks18.useLabels)();
5434
+ const { enableAnimations } = (0, import_hooks19.useSdkUiConfig)();
5435
+ const labels = (0, import_hooks19.useLabels)();
5600
5436
  const resolvedDisclaimer = disclaimer === defaultTradingDisclaimer ? labels.trading.disclaimer : disclaimer;
5601
5437
  if (isLoading) {
5602
5438
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
@@ -5641,7 +5477,7 @@ var PlaceOrder = ({
5641
5477
  const actionButton = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5642
5478
  Button,
5643
5479
  {
5644
- size: "xxl",
5480
+ size: "large",
5645
5481
  className: "w-full",
5646
5482
  disabled: isPrimaryActionDisabled,
5647
5483
  isLoading: isPrimaryActionLoading,
@@ -5675,7 +5511,7 @@ var PlaceOrder = ({
5675
5511
  Icon,
5676
5512
  {
5677
5513
  name: "close",
5678
- size: "m",
5514
+ size: "medium",
5679
5515
  className: "h-6 w-6 text-agg-foreground",
5680
5516
  color: "currentColor"
5681
5517
  }
@@ -5695,21 +5531,25 @@ var PlaceOrder = ({
5695
5531
  variant: "underline",
5696
5532
  size: "s",
5697
5533
  overflowBehavior: "scroll",
5698
- className: "w-full"
5534
+ classNames: {
5535
+ root: "w-full",
5536
+ tabList: "w-full"
5537
+ }
5699
5538
  }
5700
5539
  ),
5701
5540
  /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex flex-col gap-4", children: [
5702
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex w-full gap-2", children: outcomes.map((outcome) => {
5541
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex w-full gap-2", children: outcomes.map((outcome, index) => {
5703
5542
  const isActive = outcome.id === resolvedOutcomeId;
5543
+ const isPositive = resolveIsPositiveOutcome(outcome, index);
5704
5544
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5705
5545
  "button",
5706
5546
  {
5707
5547
  type: "button",
5708
- className: cn(
5709
- "flex-1 rounded-agg-full px-6 py-2.5 text-agg-base leading-agg-6",
5710
- getMotionClassName(enableAnimations, "transition-colors"),
5711
- isActive ? "bg-agg-success font-agg-bold text-agg-on-primary" : "bg-agg-secondary-hover font-agg-normal text-agg-foreground"
5712
- ),
5548
+ className: getOutcomeButtonClassName2({
5549
+ enableAnimations,
5550
+ isActive,
5551
+ isPositive
5552
+ }),
5713
5553
  "aria-pressed": isActive,
5714
5554
  "aria-label": `${outcome.label} ${outcome.priceLabel}`,
5715
5555
  onClick: () => handleOutcomeChange(outcome.id),
@@ -5752,7 +5592,7 @@ var PlaceOrder = ({
5752
5592
  VenueLogo,
5753
5593
  {
5754
5594
  venue: row.venue,
5755
- size: "s",
5595
+ size: "small",
5756
5596
  ariaLabel: getTradingVenueLabel(row.venue)
5757
5597
  }
5758
5598
  ),
@@ -5814,7 +5654,7 @@ PlaceOrder.displayName = "PlaceOrder";
5814
5654
 
5815
5655
  // src/trading/settlement/index.tsx
5816
5656
  var import_react8 = require("react");
5817
- var import_hooks19 = require("@agg-market/hooks");
5657
+ var import_hooks20 = require("@agg-market/hooks");
5818
5658
  var import_jsx_runtime68 = require("react/jsx-runtime");
5819
5659
  var getSettlementHeaderClassName = () => {
5820
5660
  return "flex items-center justify-between gap-4";
@@ -5833,12 +5673,18 @@ var Settlement = ({
5833
5673
  className
5834
5674
  }) => {
5835
5675
  var _a, _b;
5836
- const labels = (0, import_hooks19.useLabels)();
5676
+ const labels = (0, import_hooks20.useLabels)();
5677
+ const { enableAnimations } = (0, import_hooks20.useSdkUiConfig)();
5837
5678
  const resolvedSectionLabel = sectionLabel === defaultSettlementSectionLabel ? labels.trading.settlementSection : sectionLabel;
5838
5679
  const resolvedDifferencesTitle = differencesTitle === defaultSettlementDifferencesTitle ? labels.trading.settlementDifferencesTitle : differencesTitle;
5839
5680
  const [internalExpandedVenue, setInternalExpandedVenue] = (0, import_react8.useState)(
5840
5681
  (_b = defaultExpandedVenue != null ? defaultExpandedVenue : (_a = venues[0]) == null ? void 0 : _a.venue) != null ? _b : null
5841
5682
  );
5683
+ const [expandedDescriptionByVenue, setExpandedDescriptionByVenue] = (0, import_react8.useState)({});
5684
+ const [overflowingDescriptionByVenue, setOverflowingDescriptionByVenue] = (0, import_react8.useState)({});
5685
+ const [collapsedDescriptionByVenue, setCollapsedDescriptionByVenue] = (0, import_react8.useState)({});
5686
+ const descriptionWrapperRefs = (0, import_react8.useRef)(/* @__PURE__ */ new Map());
5687
+ const descriptionMeasureRefs = (0, import_react8.useRef)(/* @__PURE__ */ new Map());
5842
5688
  (0, import_react8.useEffect)(() => {
5843
5689
  if (expandedVenue === void 0)
5844
5690
  return;
@@ -5852,6 +5698,154 @@ var Settlement = ({
5852
5698
  }
5853
5699
  onExpandedVenueChange == null ? void 0 : onExpandedVenueChange(nextVenue);
5854
5700
  };
5701
+ const handleDescriptionWrapperRef = (0, import_react8.useCallback)(
5702
+ (venue, element) => {
5703
+ if (!element) {
5704
+ descriptionWrapperRefs.current.delete(venue);
5705
+ return;
5706
+ }
5707
+ descriptionWrapperRefs.current.set(venue, element);
5708
+ },
5709
+ []
5710
+ );
5711
+ const handleDescriptionMeasureRef = (0, import_react8.useCallback)(
5712
+ (venue, element) => {
5713
+ if (!element) {
5714
+ descriptionMeasureRefs.current.delete(venue);
5715
+ return;
5716
+ }
5717
+ descriptionMeasureRefs.current.set(venue, element);
5718
+ },
5719
+ []
5720
+ );
5721
+ const updateDescriptionLayout = (0, import_react8.useCallback)(
5722
+ (venue, description, showMoreLabel) => {
5723
+ const descriptionWrapperElement = descriptionWrapperRefs.current.get(venue);
5724
+ const descriptionMeasureElement = descriptionMeasureRefs.current.get(venue);
5725
+ if (!descriptionWrapperElement || !descriptionMeasureElement)
5726
+ return;
5727
+ const wrapperWidth = descriptionWrapperElement.clientWidth;
5728
+ if (wrapperWidth <= 0)
5729
+ return;
5730
+ const computedStyles = window.getComputedStyle(descriptionWrapperElement);
5731
+ const parsedLineHeight = Number.parseFloat(computedStyles.lineHeight);
5732
+ const lineHeight = Number.isFinite(parsedLineHeight) ? parsedLineHeight : 20;
5733
+ const maxHeight = lineHeight * 2 + 1;
5734
+ descriptionMeasureElement.style.width = `${wrapperWidth}px`;
5735
+ const getHeight = (value) => {
5736
+ descriptionMeasureElement.textContent = value;
5737
+ return descriptionMeasureElement.scrollHeight;
5738
+ };
5739
+ const fullHeight = getHeight(description);
5740
+ if (fullHeight <= maxHeight) {
5741
+ setOverflowingDescriptionByVenue((currentState) => {
5742
+ if (currentState[venue] === false)
5743
+ return currentState;
5744
+ return __spreadProps(__spreadValues({}, currentState), {
5745
+ [venue]: false
5746
+ });
5747
+ });
5748
+ setCollapsedDescriptionByVenue((currentState) => {
5749
+ if (currentState[venue] === description)
5750
+ return currentState;
5751
+ return __spreadProps(__spreadValues({}, currentState), {
5752
+ [venue]: description
5753
+ });
5754
+ });
5755
+ return;
5756
+ }
5757
+ const suffix = `... ${showMoreLabel}`;
5758
+ let left = 0;
5759
+ let right = description.length;
5760
+ let bestLength = 0;
5761
+ while (left <= right) {
5762
+ const middle = Math.floor((left + right) / 2);
5763
+ const candidate = description.slice(0, middle).trimEnd();
5764
+ const candidateHeight = getHeight(`${candidate}${suffix}`);
5765
+ if (candidateHeight <= maxHeight) {
5766
+ bestLength = middle;
5767
+ left = middle + 1;
5768
+ continue;
5769
+ }
5770
+ right = middle - 1;
5771
+ }
5772
+ const collapsedDescription = description.slice(0, bestLength).trimEnd();
5773
+ setOverflowingDescriptionByVenue((currentState) => {
5774
+ if (currentState[venue] === true)
5775
+ return currentState;
5776
+ return __spreadProps(__spreadValues({}, currentState), {
5777
+ [venue]: true
5778
+ });
5779
+ });
5780
+ setCollapsedDescriptionByVenue((currentState) => {
5781
+ if (currentState[venue] === collapsedDescription)
5782
+ return currentState;
5783
+ return __spreadProps(__spreadValues({}, currentState), {
5784
+ [venue]: collapsedDescription
5785
+ });
5786
+ });
5787
+ },
5788
+ []
5789
+ );
5790
+ (0, import_react8.useEffect)(() => {
5791
+ if (typeof window === "undefined")
5792
+ return;
5793
+ if (!resolvedExpandedVenue)
5794
+ return;
5795
+ if (expandedDescriptionByVenue[resolvedExpandedVenue])
5796
+ return;
5797
+ const expandedVenueItem = venues.find((venueItem) => venueItem.venue === resolvedExpandedVenue);
5798
+ if (!expandedVenueItem)
5799
+ return;
5800
+ const frameId = window.requestAnimationFrame(() => {
5801
+ var _a2;
5802
+ updateDescriptionLayout(
5803
+ resolvedExpandedVenue,
5804
+ expandedVenueItem.description,
5805
+ (_a2 = expandedVenueItem.showMoreLabel) != null ? _a2 : "Show more"
5806
+ );
5807
+ });
5808
+ return () => {
5809
+ window.cancelAnimationFrame(frameId);
5810
+ };
5811
+ }, [expandedDescriptionByVenue, resolvedExpandedVenue, updateDescriptionLayout, venues]);
5812
+ (0, import_react8.useEffect)(() => {
5813
+ if (!resolvedExpandedVenue)
5814
+ return;
5815
+ if (expandedDescriptionByVenue[resolvedExpandedVenue])
5816
+ return;
5817
+ if (typeof ResizeObserver === "undefined")
5818
+ return;
5819
+ const expandedVenueItem = venues.find((venueItem) => venueItem.venue === resolvedExpandedVenue);
5820
+ if (!expandedVenueItem)
5821
+ return;
5822
+ const descriptionWrapperElement = descriptionWrapperRefs.current.get(resolvedExpandedVenue);
5823
+ if (!descriptionWrapperElement)
5824
+ return;
5825
+ const resizeObserver = new ResizeObserver(() => {
5826
+ var _a2;
5827
+ updateDescriptionLayout(
5828
+ resolvedExpandedVenue,
5829
+ expandedVenueItem.description,
5830
+ (_a2 = expandedVenueItem.showMoreLabel) != null ? _a2 : "Show more"
5831
+ );
5832
+ });
5833
+ resizeObserver.observe(descriptionWrapperElement);
5834
+ return () => {
5835
+ resizeObserver.disconnect();
5836
+ };
5837
+ }, [expandedDescriptionByVenue, resolvedExpandedVenue, updateDescriptionLayout, venues]);
5838
+ const handleDescriptionShowMoreClick = (event, venue) => {
5839
+ event == null ? void 0 : event.stopPropagation();
5840
+ setExpandedDescriptionByVenue((currentState) => {
5841
+ if (currentState[venue])
5842
+ return currentState;
5843
+ return __spreadProps(__spreadValues({}, currentState), {
5844
+ [venue]: true
5845
+ });
5846
+ });
5847
+ onShowMore == null ? void 0 : onShowMore(venue);
5848
+ };
5855
5849
  if (isLoading) {
5856
5850
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5857
5851
  Skeleton,
@@ -5880,25 +5874,53 @@ var Settlement = ({
5880
5874
  ] }),
5881
5875
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
5882
5876
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex flex-col gap-3", children: venues.map((venue) => {
5877
+ var _a2, _b2;
5883
5878
  const venueLabel = getTradingVenueLabel(venue.venue, venue.label);
5884
5879
  const isExpanded = resolvedExpandedVenue === venue.venue;
5885
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: cn("flex flex-col", isExpanded ? "gap-2" : "gap-0"), children: [
5880
+ const isDescriptionExpanded = !!expandedDescriptionByVenue[venue.venue];
5881
+ const isDescriptionOverflowing = !!overflowingDescriptionByVenue[venue.venue];
5882
+ const shouldShowDescriptionCta = isExpanded && isDescriptionOverflowing && !isDescriptionExpanded;
5883
+ const resolvedShowMoreLabel = (_a2 = venue.showMoreLabel) != null ? _a2 : "Show more";
5884
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col", children: [
5886
5885
  /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
5887
5886
  "button",
5888
5887
  {
5889
5888
  type: "button",
5890
- className: "flex items-center gap-2 text-left",
5889
+ className: cn(
5890
+ "flex items-center gap-2 text-left",
5891
+ "cursor-pointer disabled:cursor-not-allowed hover:opacity-50",
5892
+ getMotionClassName(
5893
+ enableAnimations,
5894
+ "transition-[opacity,color] duration-200 ease-in-out"
5895
+ )
5896
+ ),
5891
5897
  "aria-expanded": isExpanded,
5892
5898
  "aria-label": labels.trading.settlementDetailsAria(venueLabel),
5893
5899
  onClick: () => handleVenueClick(venue.venue),
5894
5900
  children: [
5895
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(VenueLogo, { venue: venue.venue, size: "s", ariaLabel: venueLabel }),
5896
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: venueLabel }),
5901
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5902
+ VenueLogo,
5903
+ {
5904
+ venue: venue.venue,
5905
+ size: "small",
5906
+ ariaLabel: venueLabel
5907
+ }
5908
+ ),
5909
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5910
+ "span",
5911
+ {
5912
+ className: cn(
5913
+ "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground",
5914
+ isExpanded ? "text-agg-primary" : "text-agg-foreground"
5915
+ ),
5916
+ children: venueLabel
5917
+ }
5918
+ ),
5897
5919
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5898
5920
  Icon,
5899
5921
  {
5900
5922
  name: isExpanded ? "chevron-up" : "chevron-down",
5901
- size: "s",
5923
+ size: "small",
5902
5924
  className: "text-agg-foreground",
5903
5925
  color: "currentColor"
5904
5926
  }
@@ -5906,25 +5928,65 @@ var Settlement = ({
5906
5928
  ]
5907
5929
  }
5908
5930
  ),
5909
- isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: [
5910
- venue.description,
5911
- venue.showMoreLabel ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
5912
- " ",
5913
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5914
- "button",
5931
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5932
+ "div",
5933
+ {
5934
+ "aria-hidden": !isExpanded,
5935
+ className: cn(
5936
+ "grid overflow-hidden",
5937
+ isExpanded ? "mt-2 grid-rows-[1fr] opacity-100" : "mt-0 grid-rows-[0fr] opacity-0",
5938
+ !isExpanded && "pointer-events-none",
5939
+ getMotionClassName(
5940
+ enableAnimations,
5941
+ "transition-[grid-template-rows,opacity,margin-top] duration-300 ease-in-out"
5942
+ )
5943
+ ),
5944
+ children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
5945
+ "div",
5915
5946
  {
5916
- type: "button",
5917
- className: "font-agg-normal text-agg-foreground underline-offset-2 hover:underline",
5918
- "aria-label": labels.trading.settlementShowMoreAria(
5919
- venue.showMoreLabel,
5920
- venueLabel
5921
- ),
5922
- onClick: () => onShowMore == null ? void 0 : onShowMore(venue.venue),
5923
- children: venue.showMoreLabel
5947
+ ref: (element) => handleDescriptionWrapperRef(venue.venue, element),
5948
+ className: "relative min-h-0",
5949
+ children: [
5950
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("p", { className: "min-h-0 text-agg-sm leading-agg-5 text-agg-foreground", children: [
5951
+ isDescriptionExpanded || !isDescriptionOverflowing ? venue.description : (_b2 = collapsedDescriptionByVenue[venue.venue]) != null ? _b2 : venue.description,
5952
+ shouldShowDescriptionCta ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
5953
+ "... ",
5954
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5955
+ "button",
5956
+ {
5957
+ type: "button",
5958
+ tabIndex: isExpanded ? 0 : -1,
5959
+ className: cn(
5960
+ "cursor-pointer disabled:cursor-not-allowed",
5961
+ "text-agg-sm leading-agg-5 text-agg-foreground underline-offset-2 hover:underline hover:font-agg-bold",
5962
+ getMotionClassName(
5963
+ enableAnimations,
5964
+ "transition-[text-decoration] duration-200 ease-in-out"
5965
+ )
5966
+ ),
5967
+ "aria-label": labels.trading.settlementShowMoreAria(
5968
+ resolvedShowMoreLabel,
5969
+ venueLabel
5970
+ ),
5971
+ onClick: (event) => handleDescriptionShowMoreClick(event, venue.venue),
5972
+ children: resolvedShowMoreLabel
5973
+ }
5974
+ )
5975
+ ] }) : null
5976
+ ] }),
5977
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5978
+ "p",
5979
+ {
5980
+ ref: (element) => handleDescriptionMeasureRef(venue.venue, element),
5981
+ "aria-hidden": true,
5982
+ className: "pointer-events-none invisible fixed top-0 left-0 -z-10 whitespace-normal text-agg-sm leading-agg-5"
5983
+ }
5984
+ )
5985
+ ]
5924
5986
  }
5925
5987
  )
5926
- ] }) : null
5927
- ] }) : null
5988
+ }
5989
+ )
5928
5990
  ] }, venue.venue);
5929
5991
  }) })
5930
5992
  ]
@@ -5993,7 +6055,7 @@ var resolveInitialExpandedMarketId = (detailedMarkets, defaultExpandedMarketId)
5993
6055
  var EventMarketPageUnavailableState = ({
5994
6056
  ariaLabel
5995
6057
  }) => {
5996
- const labels = (0, import_hooks20.useLabels)();
6058
+ const labels = (0, import_hooks21.useLabels)();
5997
6059
  return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5998
6060
  Card,
5999
6061
  {
@@ -6001,8 +6063,8 @@ var EventMarketPageUnavailableState = ({
6001
6063
  role: "status",
6002
6064
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventMarketPage.unavailableAria,
6003
6065
  children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex flex-col gap-1", children: [
6004
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Typography, { variant: "title", children: labels.eventMarketPage.unavailableTitle }),
6005
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Typography, { variant: "meta", children: labels.eventMarketPage.unavailableDescription })
6066
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Typography, { variant: "body-large-strong", children: labels.eventMarketPage.unavailableTitle }),
6067
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Typography, { variant: "label", className: "text-agg-muted-foreground", children: labels.eventMarketPage.unavailableDescription })
6006
6068
  ] })
6007
6069
  }
6008
6070
  );
@@ -6012,7 +6074,7 @@ var EventMarketPageLoadingState = ({
6012
6074
  settlement,
6013
6075
  classNames
6014
6076
  }) => {
6015
- const labels = (0, import_hooks20.useLabels)();
6077
+ const labels = (0, import_hooks21.useLabels)();
6016
6078
  const fallbackSettlement = settlement != null ? settlement : {
6017
6079
  sectionLabel: labels.trading.settlementSection,
6018
6080
  question: labels.eventMarketPage.loadingSettlementQuestion,
@@ -6078,7 +6140,7 @@ var EventMarketPageContent = ({
6078
6140
  classNames,
6079
6141
  ariaLabel
6080
6142
  }) => {
6081
- const labels = (0, import_hooks20.useLabels)();
6143
+ const labels = (0, import_hooks21.useLabels)();
6082
6144
  const resolvedHeroMarketId = (0, import_react9.useMemo)(() => {
6083
6145
  return resolveHeroMarketId(event, heroMarketId);
6084
6146
  }, [event, heroMarketId]);
@@ -6163,7 +6225,7 @@ var EventMarketPageContent = ({
6163
6225
  };
6164
6226
  var EventMarketPage = (props) => {
6165
6227
  const hasEventProp = "event" in props && !!props.event;
6166
- const { event: fetchedEvent, isLoading: isFetchingEvent } = (0, import_hooks20.useEvent)(
6228
+ const { event: fetchedEvent, isLoading: isFetchingEvent } = (0, import_hooks21.useEvent)(
6167
6229
  hasEventProp ? void 0 : props.eventId,
6168
6230
  {
6169
6231
  enabled: !props.isLoading && !hasEventProp && !!props.eventId