@agg-market/ui 0.0.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/badge.d.mts +5 -3
  2. package/dist/badge.d.ts +5 -3
  3. package/dist/badge.js +52 -12
  4. package/dist/badge.mjs +1 -1
  5. package/dist/button.d.mts +2 -2
  6. package/dist/button.d.ts +2 -2
  7. package/dist/button.js +19 -34
  8. package/dist/button.mjs +2 -2
  9. package/dist/card.d.mts +4 -2
  10. package/dist/card.d.ts +4 -2
  11. package/dist/card.js +8 -4
  12. package/dist/card.mjs +1 -1
  13. package/dist/chart.js +14 -7
  14. package/dist/chart.mjs +2 -2
  15. package/dist/{chunk-ZYREURXK.mjs → chunk-2MJY6RVY.mjs} +35 -35
  16. package/dist/{chunk-P23GR7NX.mjs → chunk-422MCIXV.mjs} +1 -1
  17. package/dist/chunk-4KMFDCAH.mjs +371 -0
  18. package/dist/{chunk-HM3CGN32.mjs → chunk-5GDNWQZS.mjs} +46 -46
  19. package/dist/{chunk-VIP7HSOU.mjs → chunk-5K7VXAYM.mjs} +4 -0
  20. package/dist/{chunk-BJNHDIDW.mjs → chunk-6425RRBI.mjs} +4 -4
  21. package/dist/{chunk-O2XH4A3G.mjs → chunk-7NISYVSJ.mjs} +22 -22
  22. package/dist/{chunk-MXBPDNMC.mjs → chunk-BEDUFOIG.mjs} +95 -22
  23. package/dist/{chunk-VC7LTPQD.mjs → chunk-BN5VVHNV.mjs} +2 -2
  24. package/dist/{chunk-JRS2M5GY.mjs → chunk-CTVMT3VL.mjs} +13 -6
  25. package/dist/{chunk-USLTNDJA.mjs → chunk-D5FTFSKL.mjs} +8 -8
  26. package/dist/{chunk-BLSHXIAH.mjs → chunk-D7JTOGYP.mjs} +6 -11
  27. package/dist/{chunk-W2DMBW4E.mjs → chunk-DL7STJQ5.mjs} +61 -33
  28. package/dist/chunk-ERGNR6UQ.mjs +67 -0
  29. package/dist/chunk-FO263M3V.mjs +10 -0
  30. package/dist/{chunk-3O4U3E5I.mjs → chunk-FO2QCB4Z.mjs} +8 -4
  31. package/dist/{chunk-OGI343OV.mjs → chunk-IGPNIM2B.mjs} +3 -2
  32. package/dist/chunk-K6IJ4WBM.mjs +67 -0
  33. package/dist/{chunk-PGSPYQOW.mjs → chunk-KAGYJ4XT.mjs} +17 -27
  34. package/dist/{chunk-RGZQHSNJ.mjs → chunk-KCPDVBIZ.mjs} +26 -17
  35. package/dist/{chunk-ZHKMDK5M.mjs → chunk-KFOATMAE.mjs} +87 -87
  36. package/dist/{chunk-I4YUYVJJ.mjs → chunk-LK5D3ZTK.mjs} +38 -27
  37. package/dist/{chunk-VUDJ3PYM.mjs → chunk-O46OFVH6.mjs} +40 -16
  38. package/dist/{chunk-RXACBTON.mjs → chunk-OA2IZ3VW.mjs} +16 -22
  39. package/dist/{chunk-F236MLT6.mjs → chunk-PZTHM6WG.mjs} +13 -10
  40. package/dist/{chunk-XELWY7SO.mjs → chunk-QYZKC7KG.mjs} +137 -104
  41. package/dist/{chunk-LWTQD345.mjs → chunk-S3H63TQ5.mjs} +57 -312
  42. package/dist/{chunk-MNSHWA6M.mjs → chunk-TA7LKYKP.mjs} +9 -8
  43. package/dist/{chunk-JH5VMNDL.mjs → chunk-V52WSZHQ.mjs} +8 -7
  44. package/dist/chunk-YJA5VQW6.mjs +167 -0
  45. package/dist/{chunk-EXF4SESB.mjs → chunk-ZFMCCBP6.mjs} +1 -1
  46. package/dist/connect-button.js +51 -73
  47. package/dist/connect-button.mjs +6 -6
  48. package/dist/deposit-modal.js +171 -177
  49. package/dist/deposit-modal.mjs +7 -7
  50. package/dist/event-list-item-details.js +222 -198
  51. package/dist/event-list-item-details.mjs +11 -11
  52. package/dist/event-list-item.js +172 -114
  53. package/dist/event-list-item.mjs +8 -8
  54. package/dist/event-list.js +391 -507
  55. package/dist/event-list.mjs +11 -11
  56. package/dist/event-market-page.d.mts +1 -1
  57. package/dist/event-market-page.d.ts +1 -1
  58. package/dist/event-market-page.js +826 -764
  59. package/dist/event-market-page.mjs +19 -19
  60. package/dist/hello-world.js +28 -16
  61. package/dist/hello-world.mjs +2 -2
  62. package/dist/home-page.js +395 -511
  63. package/dist/home-page.mjs +12 -12
  64. package/dist/icon.d.mts +1 -1
  65. package/dist/icon.d.ts +1 -1
  66. package/dist/icon.js +15 -17
  67. package/dist/icon.mjs +2 -2
  68. package/dist/index.d.mts +6 -6
  69. package/dist/index.d.ts +6 -6
  70. package/dist/index.js +1158 -956
  71. package/dist/index.mjs +34 -32
  72. package/dist/loading-icon.d.mts +1 -1
  73. package/dist/loading-icon.d.ts +1 -1
  74. package/dist/loading-icon.js +5 -9
  75. package/dist/loading-icon.mjs +2 -2
  76. package/dist/market-details.d.mts +2 -2
  77. package/dist/market-details.d.ts +2 -2
  78. package/dist/market-details.js +357 -551
  79. package/dist/market-details.mjs +13 -13
  80. package/dist/modal.js +4 -0
  81. package/dist/modal.mjs +1 -1
  82. package/dist/onboarding-modal.js +63 -67
  83. package/dist/onboarding-modal.mjs +6 -6
  84. package/dist/place-order.d.mts +1 -1
  85. package/dist/place-order.d.ts +1 -1
  86. package/dist/place-order.js +231 -466
  87. package/dist/place-order.mjs +9 -9
  88. package/dist/profile-modal.js +75 -77
  89. package/dist/profile-modal.mjs +6 -6
  90. package/dist/search.d.mts +2 -2
  91. package/dist/search.d.ts +2 -2
  92. package/dist/search.js +28 -34
  93. package/dist/search.mjs +4 -4
  94. package/dist/select.js +104 -99
  95. package/dist/select.mjs +3 -3
  96. package/dist/settlement.d.mts +1 -1
  97. package/dist/settlement.d.ts +1 -1
  98. package/dist/settlement.js +279 -59
  99. package/dist/settlement.mjs +6 -6
  100. package/dist/skeleton.js +15 -10
  101. package/dist/skeleton.mjs +2 -2
  102. package/dist/styles.css +1 -1
  103. package/dist/switch-button.js +13 -6
  104. package/dist/switch-button.mjs +1 -1
  105. package/dist/tabs.d.mts +8 -4
  106. package/dist/tabs.d.ts +8 -4
  107. package/dist/tabs.js +163 -420
  108. package/dist/tabs.mjs +4 -4
  109. package/dist/tailwind.css +1 -1
  110. package/dist/types-BVj9ky9P.d.mts +3 -0
  111. package/dist/types-BVj9ky9P.d.ts +3 -0
  112. package/dist/typography.d.mts +4 -2
  113. package/dist/typography.d.ts +4 -2
  114. package/dist/typography.js +49 -18
  115. package/dist/typography.mjs +5 -3
  116. package/dist/user-profile-page.d.mts +2 -2
  117. package/dist/user-profile-page.d.ts +2 -2
  118. package/dist/user-profile-page.js +200 -474
  119. package/dist/user-profile-page.mjs +7 -7
  120. package/dist/venue-logo.d.mts +2 -2
  121. package/dist/venue-logo.d.ts +2 -2
  122. package/dist/venue-logo.js +6 -11
  123. package/dist/venue-logo.mjs +1 -1
  124. package/dist/{venue-logo.types-BSAuY84j.d.ts → venue-logo.types-D8Cu2rAm.d.ts} +1 -1
  125. package/dist/{venue-logo.types-DACqcTvY.d.mts → venue-logo.types-HRf1yBLD.d.mts} +1 -1
  126. package/dist/withdraw-modal.js +72 -85
  127. package/dist/withdraw-modal.mjs +6 -6
  128. package/package.json +2 -2
  129. package/dist/chunk-AEMAY3MR.mjs +0 -44
  130. package/dist/chunk-DYEWXEEY.mjs +0 -37
  131. package/dist/chunk-QFQHD2V6.mjs +0 -146
  132. package/dist/chunk-ZDF7QP4G.mjs +0 -160
  133. package/dist/chunk-ZVBVGWSP.mjs +0 -15
  134. package/dist/types-Bed6Q0EK.d.mts +0 -3
  135. package/dist/types-Bed6Q0EK.d.ts +0 -3
  136. package/dist/{types-DkGlbmXq.d.mts → types-JBf1DZlH.d.mts} +2 -2
  137. package/dist/{types-DkGlbmXq.d.ts → types-JBf1DZlH.d.ts} +2 -2
@@ -68,9 +68,6 @@ var import_hooks13 = require("@agg-market/hooks");
68
68
  // src/primitives/button/index.tsx
69
69
  var import_hooks = require("@agg-market/hooks");
70
70
 
71
- // src/constants.ts
72
- var AGG_ROOT_CLASS_NAME = "agg-root";
73
-
74
71
  // src/shared/utils.ts
75
72
  var cn = (...values) => values.filter(Boolean).join(" ");
76
73
  var getMotionClassName = (enabled, ...values) => {
@@ -84,43 +81,26 @@ var getScrollBehavior = (enabled) => {
84
81
 
85
82
  // src/primitives/icon/icon.constants.ts
86
83
  var iconSizeClasses = {
87
- xxs: "h-2 w-2",
88
- xs: "h-3 w-3",
89
- s: "h-4 w-4",
90
- ms: "h-5 w-5",
91
- m: "h-6 w-6",
92
- l: "h-8 w-8",
93
- xl: "h-10 w-10",
94
- xxl: "h-12 w-12"
84
+ small: "h-4 w-4",
85
+ medium: "h-6 w-6",
86
+ large: "h-8 w-8"
95
87
  };
96
88
 
97
89
  // src/primitives/button/button.constants.ts
98
90
  var sizeClasses = {
99
- xxs: cn("h-6 px-2.5 gap-1", "text-agg-xs leading-agg-4"),
100
- xs: cn("h-7 px-3 gap-1", "text-agg-xs leading-agg-4"),
101
- s: cn("h-8 px-4 gap-1.5", "text-agg-sm leading-agg-5"),
102
- m: cn("h-9 px-5 gap-1.5", "text-agg-sm leading-agg-5"),
103
- l: cn("h-10 px-6 gap-2", "text-agg-base leading-agg-6"),
104
- xl: cn("h-11 px-7 gap-2", "text-agg-base leading-agg-6"),
105
- xxl: cn("h-12 px-8 gap-2", "text-agg-base leading-agg-6")
91
+ small: cn("h-8 px-4 gap-1.5", "text-agg-sm leading-agg-5"),
92
+ medium: cn("h-9 px-5 gap-1.5", "text-agg-sm leading-agg-5"),
93
+ large: cn("h-10 px-6 gap-2", "text-agg-base leading-agg-6")
106
94
  };
107
95
  var iconSizeClasses2 = {
108
- xxs: iconSizeClasses.xs,
109
- xs: iconSizeClasses.xs,
110
- s: iconSizeClasses.s,
111
- m: iconSizeClasses.s,
112
- l: iconSizeClasses.s,
113
- xl: iconSizeClasses.s,
114
- xxl: iconSizeClasses.s
96
+ small: iconSizeClasses.small,
97
+ medium: iconSizeClasses.small,
98
+ large: iconSizeClasses.small
115
99
  };
116
100
  var iconSlotClasses = {
117
- xxs: "[&_svg]:h-3 [&_svg]:w-3",
118
- xs: "[&_svg]:h-3 [&_svg]:w-3",
119
- s: "[&_svg]:h-4 [&_svg]:w-4",
120
- m: "[&_svg]:h-4 [&_svg]:w-4",
121
- l: "[&_svg]:h-4 [&_svg]:w-4",
122
- xl: "[&_svg]:h-4 [&_svg]:w-4",
123
- xxl: "[&_svg]:h-4 [&_svg]:w-4"
101
+ small: "[&_svg]:h-4 [&_svg]:w-4",
102
+ medium: "[&_svg]:h-4 [&_svg]:w-4",
103
+ large: "[&_svg]:h-4 [&_svg]:w-4"
124
104
  };
125
105
  var variantClasses = {
126
106
  primary: cn(
@@ -136,10 +116,11 @@ var variantClasses = {
136
116
  "focus-visible:ring-agg-separator"
137
117
  ),
138
118
  tertiary: cn(
139
- "bg-transparent text-agg-foreground",
140
- "hover:bg-agg-secondary-hover",
119
+ "bg-transparent text-agg-primary",
120
+ "hover:text-agg-primary-hover",
141
121
  "disabled:bg-transparent disabled:text-agg-muted-foreground",
142
- "focus-visible:ring-agg-separator"
122
+ "focus-visible:ring-agg-separator",
123
+ "px-0! py-0! h-fit!"
143
124
  )
144
125
  };
145
126
  var baseButtonClasses = cn(
@@ -155,7 +136,7 @@ var Button = (_a) => {
155
136
  var _b = _a, {
156
137
  children,
157
138
  variant = "primary",
158
- size = "m",
139
+ size = "medium",
159
140
  isLoading = false,
160
141
  disabled,
161
142
  prefix,
@@ -182,8 +163,9 @@ var Button = (_a) => {
182
163
  __spreadProps(__spreadValues({
183
164
  type,
184
165
  className: cn(
166
+ "group/agg-button",
185
167
  baseButtonClasses,
186
- getMotionClassName(enableAnimations, "transition-colors"),
168
+ getMotionClassName(enableAnimations, "transition-colors duration-200 ease-in-out"),
187
169
  sizeClasses[size],
188
170
  iconSlotClasses[size],
189
171
  variantClasses[variant],
@@ -217,19 +199,23 @@ Button.displayName = "Button";
217
199
  var import_hooks2 = require("@agg-market/hooks");
218
200
  var import_jsx_runtime2 = require("react/jsx-runtime");
219
201
  var Card = (_a) => {
220
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
202
+ var _b = _a, { className, onClick } = _b, props = __objRest(_b, ["className", "onClick"]);
221
203
  const { enableAnimations } = (0, import_hooks2.useSdkUiConfig)();
222
204
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
223
205
  "div",
224
- __spreadValues({
206
+ __spreadValues(__spreadValues({
225
207
  className: cn(
208
+ "group/agg-card",
226
209
  "flex w-full flex-col font-agg-sans",
227
210
  "rounded-agg-xl border border-agg-separator",
228
211
  "bg-agg-secondary text-agg-foreground shadow-agg-card",
229
- getMotionClassName(enableAnimations, "transition-shadow hover:shadow-agg-card-hover"),
212
+ getMotionClassName(
213
+ enableAnimations,
214
+ "transition-shadow hover:shadow-agg-card-hover duration-300 ease-in-out"
215
+ ),
230
216
  className
231
217
  )
232
- }, props)
218
+ }, onClick ? { onClick } : {}), props)
233
219
  );
234
220
  };
235
221
  Card.displayName = "Card";
@@ -295,14 +281,10 @@ var ArrowsToDotIcon = (_a) => {
295
281
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
296
282
  "path",
297
283
  {
298
- 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",
299
- stroke: "currentColor",
300
- strokeWidth: "1.25",
301
- strokeLinecap: "round",
302
- strokeLinejoin: "round"
284
+ 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",
285
+ fill: "currentColor"
303
286
  }
304
- ),
305
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "8", cy: "8", r: "1.5", fill: "currentColor" })
287
+ )
306
288
  ]
307
289
  })
308
290
  );
@@ -1537,7 +1519,7 @@ var Icon = (_a) => {
1537
1519
  var _b = _a, {
1538
1520
  name,
1539
1521
  color,
1540
- size = "m",
1522
+ size = "medium",
1541
1523
  className = "text-agg-primary",
1542
1524
  style
1543
1525
  } = _b, props = __objRest(_b, [
@@ -1550,7 +1532,14 @@ var Icon = (_a) => {
1550
1532
  const Component = iconRegistry[name];
1551
1533
  const resolvedStyle = resolveIconStyle(color, style);
1552
1534
  const resolvedClassName = cn(iconSizeClasses[size], className);
1553
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Component, __spreadValues({ color, className: resolvedClassName, style: resolvedStyle }, props));
1535
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
1536
+ Component,
1537
+ __spreadValues({
1538
+ color,
1539
+ className: cn("group/agg-icon", resolvedClassName),
1540
+ style: resolvedStyle
1541
+ }, props)
1542
+ );
1554
1543
  };
1555
1544
  Icon.displayName = "Icon";
1556
1545
 
@@ -1593,7 +1582,7 @@ var EventListItemSkeletonView = ({
1593
1582
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
1594
1583
  Card,
1595
1584
  {
1596
- className: cn(baseCardClassName, className),
1585
+ className: cn("group/agg-skeleton", baseCardClassName, className),
1597
1586
  role: isStandalone ? "status" : void 0,
1598
1587
  "aria-label": isStandalone ? ariaLabel != null ? ariaLabel : labels.eventItem.loading : void 0,
1599
1588
  "aria-busy": isStandalone || void 0,
@@ -1642,7 +1631,7 @@ var EventListSkeletonView = ({ className, ariaLabel }) => {
1642
1631
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
1643
1632
  "section",
1644
1633
  {
1645
- className: cn("flex w-full flex-col gap-5", className),
1634
+ className: cn("group/agg-skeleton", "flex w-full flex-col gap-5", className),
1646
1635
  role: "status",
1647
1636
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventList.loading("events"),
1648
1637
  "aria-busy": true,
@@ -1685,7 +1674,7 @@ var EventListItemDetailsSkeletonView = ({
1685
1674
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
1686
1675
  Card,
1687
1676
  {
1688
- className: cn(detailsBaseCardClassName, className),
1677
+ className: cn("group/agg-skeleton", detailsBaseCardClassName, className),
1689
1678
  role: "status",
1690
1679
  "aria-label": ariaLabel != null ? ariaLabel : labels.eventItemDetails.loading,
1691
1680
  "aria-busy": true,
@@ -1738,7 +1727,7 @@ var MarketDetailsSkeletonView = ({
1738
1727
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
1739
1728
  Card,
1740
1729
  {
1741
- className: cn(marketDetailsBaseCardClassName, className),
1730
+ className: cn("group/agg-skeleton", marketDetailsBaseCardClassName, className),
1742
1731
  role: "status",
1743
1732
  "aria-label": ariaLabel != null ? ariaLabel : labels.marketDetails.loading,
1744
1733
  "aria-busy": true,
@@ -1808,7 +1797,7 @@ MarketDetailsSkeletonView.displayName = "MarketDetailsSkeletonView";
1808
1797
  var import_jsx_runtime50 = require("react/jsx-runtime");
1809
1798
  var placeOrderCardClassName = "overflow-hidden rounded-agg-xl border border-agg-border bg-agg-secondary shadow-none hover:shadow-none";
1810
1799
  var ContentBody = () => {
1811
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-6 p-5", children: [
1800
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("flex flex-col gap-6 p-5"), children: [
1812
1801
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex flex-col gap-2", children: [
1813
1802
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-start justify-between gap-5", children: [
1814
1803
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
@@ -1875,7 +1864,7 @@ var PlaceOrderSkeletonView = ({
1875
1864
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
1876
1865
  "div",
1877
1866
  {
1878
- className: cn("w-full", className),
1867
+ className: cn("group/agg-skeleton", "w-full", className),
1879
1868
  role: "status",
1880
1869
  "aria-label": ariaLabel != null ? ariaLabel : "Loading place order",
1881
1870
  "aria-busy": true,
@@ -1909,6 +1898,7 @@ var SettlementSkeletonView = ({
1909
1898
  Card,
1910
1899
  {
1911
1900
  className: cn(
1901
+ "group/agg-skeleton",
1912
1902
  "flex flex-col w-full gap-5 rounded-agg-xl border border-agg-separator bg-agg-secondary p-5 shadow-none hover:shadow-none",
1913
1903
  className
1914
1904
  ),
@@ -1994,7 +1984,6 @@ Skeleton.displayName = "Skeleton";
1994
1984
  // src/primitives/tabs/index.tsx
1995
1985
  var import_react2 = require("react");
1996
1986
  var import_hooks10 = require("@agg-market/hooks");
1997
- var DropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
1998
1987
 
1999
1988
  // src/primitives/select/index.tsx
2000
1989
  var import_react = require("react");
@@ -2020,7 +2009,7 @@ var Select = ({
2020
2009
  if (!isOpen)
2021
2010
  return;
2022
2011
  const handlePointerDown = (e) => {
2023
- if (containerRef.current && !containerRef.current.contains(e.target)) {
2012
+ if (containerRef.current && !containerRef.current.contains(e == null ? void 0 : e.target)) {
2024
2013
  close();
2025
2014
  }
2026
2015
  };
@@ -2031,7 +2020,7 @@ var Select = ({
2031
2020
  if (!isOpen)
2032
2021
  return;
2033
2022
  const handleKey = (e) => {
2034
- if (e.key === "Escape")
2023
+ if ((e == null ? void 0 : e.key) === "Escape")
2035
2024
  close();
2036
2025
  };
2037
2026
  document.addEventListener("keydown", handleKey);
@@ -2040,7 +2029,7 @@ var Select = ({
2040
2029
  const isDisabled = disabled || !hasEnabledItems;
2041
2030
  const selectedItem = items.find((item) => item.value === value);
2042
2031
  if (!hasAnyIcon) {
2043
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: cn("relative inline-flex w-full", className), children: [
2032
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("label", { className: cn("group/agg-select", "relative inline-flex w-full", className), children: [
2044
2033
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2045
2034
  "select",
2046
2035
  {
@@ -2049,7 +2038,7 @@ var Select = ({
2049
2038
  "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",
2050
2039
  getMotionClassName(
2051
2040
  enableAnimations,
2052
- "transition-[border-color,box-shadow] duration-200 ease-out"
2041
+ "transition-[border-color,box-shadow] duration-200 ease-in-out"
2053
2042
  ),
2054
2043
  "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
2055
2044
  "disabled:cursor-not-allowed disabled:opacity-60"
@@ -2060,88 +2049,95 @@ var Select = ({
2060
2049
  children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("option", { value: item.value, disabled: item.disabled, children: item.label }, item.value))
2061
2050
  }
2062
2051
  ),
2063
- /* @__PURE__ */ (0, import_jsx_runtime53.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_runtime53.jsx)(Icon, { name: "chevron-down", size: "s", color: "currentColor" }) })
2052
+ /* @__PURE__ */ (0, import_jsx_runtime53.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_runtime53.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) })
2064
2053
  ] });
2065
2054
  }
2066
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { ref: containerRef, className: cn("relative inline-flex w-full", className), children: [
2067
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2068
- "button",
2069
- {
2070
- type: "button",
2071
- "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2072
- "aria-expanded": isOpen,
2073
- "aria-haspopup": "listbox",
2074
- disabled: isDisabled,
2075
- className: cn(
2076
- "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",
2077
- "flex items-center gap-2 text-left",
2078
- getMotionClassName(
2079
- enableAnimations,
2080
- "transition-[border-color,box-shadow] duration-200 ease-out"
2081
- ),
2082
- "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
2083
- "disabled:cursor-not-allowed disabled:opacity-60"
2084
- ),
2085
- onClick: () => setIsOpen((prev) => !prev),
2086
- children: [
2087
- (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2088
- "img",
2089
- {
2090
- src: selectedItem.iconUrl,
2091
- alt: "",
2092
- className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2093
- }
2094
- ) : null,
2095
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
2096
- ]
2097
- }
2098
- ),
2099
- /* @__PURE__ */ (0, import_jsx_runtime53.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_runtime53.jsx)(Icon, { name: "chevron-down", size: "s", color: "currentColor" }) }),
2100
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2101
- "div",
2102
- {
2103
- role: "listbox",
2104
- "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2105
- 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",
2106
- children: items.map((item) => {
2107
- const isSelected = item.value === value;
2108
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2109
- "button",
2110
- {
2111
- type: "button",
2112
- role: "option",
2113
- "aria-selected": isSelected,
2114
- disabled: item.disabled,
2115
- className: cn(
2116
- "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
2117
- "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
2118
- isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
2119
- item.disabled && "cursor-not-allowed opacity-60"
2055
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2056
+ "div",
2057
+ {
2058
+ ref: containerRef,
2059
+ className: cn("group/agg-select", "relative inline-flex w-full", className),
2060
+ children: [
2061
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2062
+ "button",
2063
+ {
2064
+ type: "button",
2065
+ "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2066
+ "aria-expanded": isOpen,
2067
+ "aria-haspopup": "listbox",
2068
+ disabled: isDisabled,
2069
+ className: cn(
2070
+ "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",
2071
+ "flex items-center gap-2 text-left",
2072
+ getMotionClassName(
2073
+ enableAnimations,
2074
+ "transition-[border-color,box-shadow] duration-200 ease-in-out"
2120
2075
  ),
2121
- onClick: () => {
2122
- if (!item.disabled) {
2123
- onChange(item.value);
2124
- close();
2076
+ "focus:border-agg-primary focus:ring-2 focus:ring-agg-primary/15",
2077
+ "disabled:cursor-not-allowed disabled:opacity-60"
2078
+ ),
2079
+ onClick: () => setIsOpen((prev) => !prev),
2080
+ children: [
2081
+ (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2082
+ "img",
2083
+ {
2084
+ src: selectedItem.iconUrl,
2085
+ alt: "",
2086
+ className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2125
2087
  }
2126
- },
2127
- children: [
2128
- item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2129
- "img",
2130
- {
2131
- src: item.iconUrl,
2132
- alt: "",
2133
- className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2134
- }
2135
- ) : null,
2136
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "truncate", children: item.label })
2137
- ]
2138
- },
2139
- item.value
2140
- );
2141
- })
2142
- }
2143
- ) : null
2144
- ] });
2088
+ ) : null,
2089
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "flex-1 truncate", children: (_a = selectedItem == null ? void 0 : selectedItem.label) != null ? _a : "" })
2090
+ ]
2091
+ }
2092
+ ),
2093
+ /* @__PURE__ */ (0, import_jsx_runtime53.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_runtime53.jsx)(Icon, { name: "chevron-down", size: "small", color: "currentColor" }) }),
2094
+ isOpen ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2095
+ "div",
2096
+ {
2097
+ role: "listbox",
2098
+ "aria-label": ariaLabel != null ? ariaLabel : labels.common.selectAria,
2099
+ 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",
2100
+ children: items.map((item) => {
2101
+ const isSelected = item.value === value;
2102
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
2103
+ "button",
2104
+ {
2105
+ type: "button",
2106
+ role: "option",
2107
+ "aria-selected": isSelected,
2108
+ disabled: item.disabled,
2109
+ className: cn(
2110
+ "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
2111
+ "hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
2112
+ isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
2113
+ item.disabled && "cursor-not-allowed opacity-60"
2114
+ ),
2115
+ onClick: () => {
2116
+ if (!item.disabled) {
2117
+ onChange(item.value);
2118
+ close();
2119
+ }
2120
+ },
2121
+ children: [
2122
+ item.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2123
+ "img",
2124
+ {
2125
+ src: item.iconUrl,
2126
+ alt: "",
2127
+ className: "h-4 w-4 shrink-0 rounded-sm object-contain"
2128
+ }
2129
+ ) : null,
2130
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "truncate", children: item.label })
2131
+ ]
2132
+ },
2133
+ item.value
2134
+ );
2135
+ })
2136
+ }
2137
+ ) : null
2138
+ ]
2139
+ }
2140
+ );
2145
2141
  };
2146
2142
  Select.displayName = "Select";
2147
2143
 
@@ -2168,86 +2164,10 @@ var findEdgeEnabledIndex = (items, direction) => {
2168
2164
  }
2169
2165
  return -1;
2170
2166
  };
2171
- var FALLBACK_TAB_WIDTH = 112;
2172
- var FALLBACK_MORE_WIDTH = 56;
2173
- var sumWidths = (indices, widths) => {
2174
- return [...indices].reduce((accumulator, index) => {
2175
- var _a;
2176
- return accumulator + ((_a = widths[index]) != null ? _a : 0);
2177
- }, 0);
2178
- };
2179
- var resolveTabsOverflowLayout = ({
2180
- items,
2181
- value,
2182
- containerWidth,
2183
- moreButtonWidth,
2184
- itemWidthByValue
2185
- }) => {
2186
- var _a;
2187
- if (items.length === 0) {
2188
- return {
2189
- visibleItems: [],
2190
- hiddenItems: []
2191
- };
2192
- }
2193
- if (!Number.isFinite(containerWidth) || containerWidth <= 0) {
2194
- return {
2195
- visibleItems: items,
2196
- hiddenItems: []
2197
- };
2198
- }
2199
- const resolvedItemWidths = items.map((item) => {
2200
- var _a2;
2201
- const measuredWidth = (_a2 = itemWidthByValue.get(item.value)) != null ? _a2 : FALLBACK_TAB_WIDTH;
2202
- return Math.max(1, measuredWidth);
2203
- });
2204
- const totalItemsWidth = resolvedItemWidths.reduce((sum, width) => {
2205
- return sum + width;
2206
- }, 0);
2207
- if (totalItemsWidth <= containerWidth) {
2208
- return {
2209
- visibleItems: items,
2210
- hiddenItems: []
2211
- };
2212
- }
2213
- const reservedMoreWidth = Math.max(1, moreButtonWidth || FALLBACK_MORE_WIDTH);
2214
- const visibleIndices = /* @__PURE__ */ new Set();
2215
- let usedWidth = 0;
2216
- for (let index = 0; index < items.length; index += 1) {
2217
- const itemWidth = (_a = resolvedItemWidths[index]) != null ? _a : FALLBACK_TAB_WIDTH;
2218
- const hasRemainingItems = index < items.length - 1;
2219
- const requiredExtraWidth = hasRemainingItems ? reservedMoreWidth : 0;
2220
- if (usedWidth + itemWidth + requiredExtraWidth > containerWidth)
2221
- break;
2222
- visibleIndices.add(index);
2223
- usedWidth += itemWidth;
2224
- }
2225
- if (visibleIndices.size === 0) {
2226
- visibleIndices.add(0);
2227
- }
2228
- const activeIndex = items.findIndex((item) => item.value === value);
2229
- const isActiveHidden = activeIndex >= 0 && !visibleIndices.has(activeIndex);
2230
- if (isActiveHidden && activeIndex >= 0) {
2231
- visibleIndices.add(activeIndex);
2232
- while (visibleIndices.size > 1) {
2233
- const visibleWidth = sumWidths(visibleIndices, resolvedItemWidths);
2234
- if (visibleWidth + reservedMoreWidth <= containerWidth)
2235
- break;
2236
- const removableIndex = [...visibleIndices].sort((left, right) => right - left).find((index) => index !== activeIndex);
2237
- if (removableIndex == null)
2238
- break;
2239
- visibleIndices.delete(removableIndex);
2240
- }
2241
- }
2242
- return {
2243
- visibleItems: items.filter((_, index) => visibleIndices.has(index)),
2244
- hiddenItems: items.filter((_, index) => !visibleIndices.has(index))
2245
- };
2246
- };
2247
2167
 
2248
2168
  // src/primitives/tabs/index.tsx
2249
2169
  var import_jsx_runtime54 = require("react/jsx-runtime");
2250
- var mobileTabsMediaQuery = "(max-width: 767px)";
2170
+ var mobileTabsMediaQuery = "(max-width: 512px)";
2251
2171
  var getTabButtonClassName = ({
2252
2172
  enableAnimations,
2253
2173
  isBarVariant,
@@ -2259,7 +2179,11 @@ var getTabButtonClassName = ({
2259
2179
  return cn(
2260
2180
  "cursor-pointer disabled:cursor-not-allowed",
2261
2181
  "relative inline-flex h-full shrink-0 items-center justify-center gap-2 font-agg-sans",
2262
- getMotionClassName(enableAnimations, "transition-colors motion-reduce:transition-none"),
2182
+ isBarVariant ? "hover:text-agg-foreground hover:bg-agg-secondary-hover" : "hover:text-agg-foreground hover:font-bold",
2183
+ getMotionClassName(
2184
+ enableAnimations,
2185
+ "transition-[colors] duration-300 ease-in-out motion-reduce:transition-none"
2186
+ ),
2263
2187
  isBarVariant ? cn(
2264
2188
  "min-w-20 overflow-hidden border-r border-agg-separator last:border-r-0",
2265
2189
  isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
@@ -2271,35 +2195,6 @@ var getTabButtonClassName = ({
2271
2195
  isDisabled && "cursor-not-allowed opacity-60"
2272
2196
  );
2273
2197
  };
2274
- var getMeasureTabClassName = ({
2275
- isBarVariant,
2276
- size
2277
- }) => {
2278
- const isSmall = size === "s";
2279
- return cn(
2280
- "relative inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap font-agg-sans",
2281
- isBarVariant ? cn(
2282
- "h-8 min-w-20 border-r border-agg-separator font-agg-bold",
2283
- isSmall ? "px-3 text-agg-sm leading-agg-5" : "px-4 text-agg-base leading-agg-6"
2284
- ) : cn(
2285
- "h-12 font-agg-bold",
2286
- isSmall ? "px-4 text-agg-sm leading-agg-5" : "px-5 text-agg-base leading-agg-6"
2287
- )
2288
- );
2289
- };
2290
- var getMoreButtonClassName = ({
2291
- enableAnimations,
2292
- isBarVariant,
2293
- size
2294
- }) => {
2295
- const isSmall = size === "s";
2296
- return cn(
2297
- "cursor-pointer disabled:cursor-not-allowed",
2298
- "relative inline-flex shrink-0 items-center justify-center overflow-hidden font-agg-sans text-agg-foreground hover:bg-agg-secondary-hover",
2299
- getMotionClassName(enableAnimations, "transition-colors motion-reduce:transition-none"),
2300
- 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")
2301
- );
2302
- };
2303
2198
  var Tabs = ({
2304
2199
  items,
2305
2200
  value,
@@ -2307,12 +2202,12 @@ var Tabs = ({
2307
2202
  variant = "bar",
2308
2203
  size = "m",
2309
2204
  overflowBehavior,
2310
- overflowMenuAriaLabel,
2311
2205
  ariaLabel,
2312
- className
2206
+ className,
2207
+ classNames
2313
2208
  }) => {
2314
2209
  const labels = (0, import_hooks10.useLabels)();
2315
- const { enableAnimations, rootClassName } = (0, import_hooks10.useSdkUiConfig)();
2210
+ const { enableAnimations } = (0, import_hooks10.useSdkUiConfig)();
2316
2211
  const buttonRefs = (0, import_react2.useRef)([]);
2317
2212
  const dragStateRef = (0, import_react2.useRef)({
2318
2213
  isPointerDown: false,
@@ -2324,8 +2219,6 @@ var Tabs = ({
2324
2219
  });
2325
2220
  const suppressClickRef = (0, import_react2.useRef)(false);
2326
2221
  const resolvedAriaLabel = ariaLabel != null ? ariaLabel : labels.common.tabsAria;
2327
- const resolvedOverflowMenuAriaLabel = overflowMenuAriaLabel != null ? overflowMenuAriaLabel : labels.common.hiddenTabsAria;
2328
- const [isMoreMenuOpen, setIsMoreMenuOpen] = (0, import_react2.useState)(false);
2329
2222
  const [isMobileViewport, setIsMobileViewport] = (0, import_react2.useState)(false);
2330
2223
  const [isDraggingTabs, setIsDraggingTabs] = (0, import_react2.useState)(false);
2331
2224
  const [activeUnderlineStyle, setActiveUnderlineStyle] = (0, import_react2.useState)({
@@ -2333,39 +2226,21 @@ var Tabs = ({
2333
2226
  width: 0,
2334
2227
  opacity: 0
2335
2228
  });
2336
- const [overflowLayout, setOverflowLayout] = (0, import_react2.useState)({
2337
- visibleItems: items,
2338
- hiddenItems: []
2339
- });
2340
2229
  const [scrollAffordanceState, setScrollAffordanceState] = (0, import_react2.useState)({
2341
2230
  showStart: false,
2342
2231
  showEnd: false
2343
2232
  });
2344
- const containerRef = (0, import_react2.useRef)(null);
2345
2233
  const tabListRef = (0, import_react2.useRef)(null);
2346
- const moreButtonMeasureRef = (0, import_react2.useRef)(null);
2347
- const tabMeasureRefs = (0, import_react2.useRef)(/* @__PURE__ */ new Map());
2348
2234
  const isBarVariant = variant === "bar";
2349
2235
  const resolvedOverflowBehavior = (0, import_react2.useMemo)(() => {
2350
2236
  if (overflowBehavior)
2351
2237
  return overflowBehavior;
2352
2238
  if (!isBarVariant)
2353
2239
  return "scroll";
2354
- return isMobileViewport ? "select" : "menu";
2240
+ return isMobileViewport ? "select" : "scroll";
2355
2241
  }, [isBarVariant, isMobileViewport, overflowBehavior]);
2356
- const shouldUseOverflowMenu = resolvedOverflowBehavior === "menu";
2357
2242
  const shouldUseOverflowScroll = resolvedOverflowBehavior === "scroll";
2358
2243
  const shouldUseOverflowSelect = resolvedOverflowBehavior === "select";
2359
- const handleMeasureTabRef = (0, import_react2.useCallback)(
2360
- (tabValue, tabElement) => {
2361
- if (!tabElement) {
2362
- tabMeasureRefs.current.delete(tabValue);
2363
- return;
2364
- }
2365
- tabMeasureRefs.current.set(tabValue, tabElement);
2366
- },
2367
- []
2368
- );
2369
2244
  (0, import_react2.useEffect)(() => {
2370
2245
  if (typeof window === "undefined")
2371
2246
  return;
@@ -2385,55 +2260,6 @@ var Tabs = ({
2385
2260
  mediaQueryList.removeListener(handleMediaQueryChange);
2386
2261
  };
2387
2262
  }, []);
2388
- const handleRecalculateOverflow = (0, import_react2.useCallback)(() => {
2389
- var _a, _b, _c, _d;
2390
- if (!shouldUseOverflowMenu) {
2391
- setOverflowLayout({
2392
- visibleItems: items,
2393
- hiddenItems: []
2394
- });
2395
- return;
2396
- }
2397
- const containerWidth = (_b = (_a = containerRef.current) == null ? void 0 : _a.clientWidth) != null ? _b : 0;
2398
- const moreButtonWidth = (_d = (_c = moreButtonMeasureRef.current) == null ? void 0 : _c.offsetWidth) != null ? _d : 0;
2399
- const itemWidthByValue = new Map(
2400
- items.map((item) => {
2401
- var _a2, _b2;
2402
- return [item.value, (_b2 = (_a2 = tabMeasureRefs.current.get(item.value)) == null ? void 0 : _a2.offsetWidth) != null ? _b2 : 0];
2403
- })
2404
- );
2405
- setOverflowLayout(
2406
- resolveTabsOverflowLayout({
2407
- items,
2408
- value,
2409
- containerWidth,
2410
- moreButtonWidth,
2411
- itemWidthByValue
2412
- })
2413
- );
2414
- }, [items, shouldUseOverflowMenu, value]);
2415
- (0, import_react2.useEffect)(() => {
2416
- handleRecalculateOverflow();
2417
- }, [handleRecalculateOverflow]);
2418
- (0, import_react2.useEffect)(() => {
2419
- if (!shouldUseOverflowMenu)
2420
- return;
2421
- const container = containerRef.current;
2422
- if (!container || typeof ResizeObserver === "undefined")
2423
- return;
2424
- const resizeObserver = new ResizeObserver(() => {
2425
- handleRecalculateOverflow();
2426
- });
2427
- resizeObserver.observe(container);
2428
- return () => {
2429
- resizeObserver.disconnect();
2430
- };
2431
- }, [handleRecalculateOverflow, shouldUseOverflowMenu]);
2432
- (0, import_react2.useEffect)(() => {
2433
- if (overflowLayout.hiddenItems.length > 0)
2434
- return;
2435
- setIsMoreMenuOpen(false);
2436
- }, [overflowLayout.hiddenItems.length]);
2437
2263
  const updateScrollAffordances = (0, import_react2.useCallback)(() => {
2438
2264
  if (!shouldUseOverflowScroll) {
2439
2265
  setScrollAffordanceState({
@@ -2451,8 +2277,7 @@ var Tabs = ({
2451
2277
  showEnd: maxScrollLeft - tabListElement.scrollLeft > 4
2452
2278
  });
2453
2279
  }, [shouldUseOverflowScroll]);
2454
- const renderedItems = shouldUseOverflowMenu ? overflowLayout.visibleItems : items;
2455
- const shouldShowMoreButton = shouldUseOverflowMenu && overflowLayout.hiddenItems.length > 0;
2280
+ const renderedItems = items;
2456
2281
  const selectItems = (0, import_react2.useMemo)(() => {
2457
2282
  return items.map((item) => ({
2458
2283
  value: item.value,
@@ -2477,24 +2302,24 @@ var Tabs = ({
2477
2302
  (_a = buttonRefs.current[index]) == null ? void 0 : _a.focus();
2478
2303
  };
2479
2304
  const handleKeyDown = (event, index) => {
2480
- switch (event.key) {
2305
+ switch (event == null ? void 0 : event.key) {
2481
2306
  case "ArrowRight": {
2482
- event.preventDefault();
2307
+ event == null ? void 0 : event.preventDefault();
2483
2308
  handleMoveFocus(findNextEnabledIndex(renderedItems, index, 1));
2484
2309
  return;
2485
2310
  }
2486
2311
  case "ArrowLeft": {
2487
- event.preventDefault();
2312
+ event == null ? void 0 : event.preventDefault();
2488
2313
  handleMoveFocus(findNextEnabledIndex(renderedItems, index, -1));
2489
2314
  return;
2490
2315
  }
2491
2316
  case "Home": {
2492
- event.preventDefault();
2317
+ event == null ? void 0 : event.preventDefault();
2493
2318
  handleMoveFocus(findEdgeEnabledIndex(renderedItems, 1));
2494
2319
  return;
2495
2320
  }
2496
2321
  case "End": {
2497
- event.preventDefault();
2322
+ event == null ? void 0 : event.preventDefault();
2498
2323
  handleMoveFocus(findEdgeEnabledIndex(renderedItems, -1));
2499
2324
  return;
2500
2325
  }
@@ -2502,22 +2327,16 @@ var Tabs = ({
2502
2327
  return;
2503
2328
  }
2504
2329
  };
2505
- const activeHiddenItem = (0, import_react2.useMemo)(() => {
2506
- if (!shouldUseOverflowMenu)
2507
- return void 0;
2508
- return overflowLayout.hiddenItems.find((item) => item.value === value);
2509
- }, [overflowLayout.hiddenItems, shouldUseOverflowMenu, value]);
2510
2330
  const tabListClassName = cn(
2511
2331
  "inline-flex items-stretch bg-agg-secondary",
2512
- shouldUseOverflowMenu ? "min-w-0 flex-1 overflow-hidden" : shouldUseOverflowScroll ? cn(
2332
+ shouldUseOverflowScroll ? cn(
2513
2333
  "overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
2514
2334
  getMotionClassName(enableAnimations, "scroll-smooth")
2515
2335
  ) : "overflow-x-auto",
2516
2336
  isBarVariant ? "h-8 rounded-agg-sm border border-agg-separator" : "h-12 border-b border-agg-separator -mb-[1px]",
2517
2337
  shouldUseOverflowScroll && "select-none",
2518
2338
  shouldUseOverflowScroll && !isBarVariant && "snap-x snap-mandatory",
2519
- shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab"),
2520
- shouldShowMoreButton && isBarVariant && "rounded-r-none border-r-0"
2339
+ shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab")
2521
2340
  );
2522
2341
  const handleTabListWheel = (event) => {
2523
2342
  if (!shouldUseOverflowScroll)
@@ -2606,14 +2425,10 @@ var Tabs = ({
2606
2425
  const handleTabListClickCapture = (event) => {
2607
2426
  if (!suppressClickRef.current)
2608
2427
  return;
2609
- event.preventDefault();
2610
- event.stopPropagation();
2428
+ event == null ? void 0 : event.preventDefault();
2429
+ event == null ? void 0 : event.stopPropagation();
2611
2430
  suppressClickRef.current = false;
2612
2431
  };
2613
- const handleSelectHiddenItem = (nextValue) => {
2614
- handleSelect(nextValue);
2615
- setIsMoreMenuOpen(false);
2616
- };
2617
2432
  const updateActiveUnderline = (0, import_react2.useCallback)(() => {
2618
2433
  if (isBarVariant) {
2619
2434
  setActiveUnderlineStyle({
@@ -2681,18 +2496,34 @@ var Tabs = ({
2681
2496
  (0, import_react2.useEffect)(() => {
2682
2497
  if (!shouldUseOverflowScroll)
2683
2498
  return;
2499
+ const tabListElement = tabListRef.current;
2500
+ if (!tabListElement)
2501
+ return;
2684
2502
  const activeIndex = renderedItems.findIndex((item) => item.value === value);
2685
2503
  const activeButton = activeIndex >= 0 ? buttonRefs.current[activeIndex] : null;
2686
2504
  if (!activeButton)
2687
2505
  return;
2688
- activeButton.scrollIntoView({
2689
- behavior: getScrollBehavior(enableAnimations),
2690
- block: "nearest",
2691
- inline: "nearest"
2506
+ if (tabListElement.scrollWidth - tabListElement.clientWidth <= 1)
2507
+ return;
2508
+ const currentScrollLeft = tabListElement.scrollLeft;
2509
+ const currentScrollRight = currentScrollLeft + tabListElement.clientWidth;
2510
+ const activeButtonLeft = activeButton.offsetLeft;
2511
+ const activeButtonRight = activeButtonLeft + activeButton.offsetWidth;
2512
+ let nextScrollLeft = currentScrollLeft;
2513
+ if (activeButtonLeft < currentScrollLeft) {
2514
+ nextScrollLeft = activeButtonLeft;
2515
+ } else if (activeButtonRight > currentScrollRight) {
2516
+ nextScrollLeft = activeButtonRight - tabListElement.clientWidth;
2517
+ }
2518
+ if (Math.abs(nextScrollLeft - currentScrollLeft) < 1)
2519
+ return;
2520
+ tabListElement.scrollTo({
2521
+ left: Math.max(0, nextScrollLeft),
2522
+ behavior: getScrollBehavior(enableAnimations)
2692
2523
  });
2693
2524
  }, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
2694
2525
  if (shouldUseOverflowSelect) {
2695
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2526
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: cn("w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2696
2527
  Select,
2697
2528
  {
2698
2529
  ariaLabel,
@@ -2707,10 +2538,12 @@ var Tabs = ({
2707
2538
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2708
2539
  "div",
2709
2540
  {
2710
- ref: containerRef,
2711
2541
  className: cn(
2712
- "relative inline-flex max-w-full items-stretch font-agg-sans bg-agg-secondary",
2713
- className
2542
+ "group/agg-tabs",
2543
+ "relative max-w-full items-stretch font-agg-sans bg-agg-secondary",
2544
+ "inline-flex",
2545
+ className,
2546
+ classNames == null ? void 0 : classNames.root
2714
2547
  ),
2715
2548
  children: [
2716
2549
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
@@ -2719,7 +2552,7 @@ var Tabs = ({
2719
2552
  ref: tabListRef,
2720
2553
  role: "tablist",
2721
2554
  "aria-label": resolvedAriaLabel,
2722
- className: cn("relative", tabListClassName),
2555
+ className: cn("relative", tabListClassName, classNames == null ? void 0 : classNames.tabList),
2723
2556
  onClickCapture: handleTabListClickCapture,
2724
2557
  onPointerCancel: handleEndTabListDrag,
2725
2558
  onPointerDown: handleTabListPointerDown,
@@ -2741,7 +2574,11 @@ var Tabs = ({
2741
2574
  "aria-selected": isActive,
2742
2575
  "aria-label": item.label,
2743
2576
  disabled: item.disabled,
2744
- onClick: () => handleSelect(item.value),
2577
+ onClick: (e) => {
2578
+ e.preventDefault();
2579
+ e.stopPropagation();
2580
+ handleSelect(item.value);
2581
+ },
2745
2582
  onKeyDown: (event) => handleKeyDown(event, index),
2746
2583
  className: cn(
2747
2584
  getTabButtonClassName({
@@ -2783,7 +2620,7 @@ var Tabs = ({
2783
2620
  "pointer-events-none absolute bottom-0 left-0 rounded-t-agg-sm bg-agg-primary",
2784
2621
  getMotionClassName(
2785
2622
  enableAnimations,
2786
- "transition-[transform,width,opacity] duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]"
2623
+ "transition-[transform,width,opacity] duration-300 ease-in-out"
2787
2624
  ),
2788
2625
  "h-[3px]"
2789
2626
  ),
@@ -2799,7 +2636,7 @@ var Tabs = ({
2799
2636
  {
2800
2637
  "aria-hidden": true,
2801
2638
  className: cn(
2802
- "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",
2639
+ "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",
2803
2640
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
2804
2641
  scrollAffordanceState.showStart ? "opacity-100" : "opacity-0"
2805
2642
  )
@@ -2810,104 +2647,13 @@ var Tabs = ({
2810
2647
  {
2811
2648
  "aria-hidden": true,
2812
2649
  className: cn(
2813
- "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",
2650
+ "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",
2814
2651
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
2815
2652
  scrollAffordanceState.showEnd ? "opacity-100" : "opacity-0"
2816
2653
  )
2817
2654
  }
2818
2655
  )
2819
- ] }) : null,
2820
- shouldShowMoreButton ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(DropdownMenu.Root, { open: isMoreMenuOpen, onOpenChange: setIsMoreMenuOpen, children: [
2821
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2822
- "button",
2823
- {
2824
- type: "button",
2825
- "aria-label": resolvedOverflowMenuAriaLabel,
2826
- className: cn(
2827
- getMoreButtonClassName({
2828
- enableAnimations,
2829
- isBarVariant,
2830
- size
2831
- }),
2832
- activeHiddenItem ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground"
2833
- ),
2834
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { name: "dots-horizontal", size: isBarVariant ? "s" : "m", color: "currentColor" })
2835
- }
2836
- ) }),
2837
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DropdownMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2838
- DropdownMenu.Content,
2839
- {
2840
- align: "end",
2841
- "aria-label": resolvedOverflowMenuAriaLabel,
2842
- className: cn(
2843
- AGG_ROOT_CLASS_NAME,
2844
- rootClassName,
2845
- "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"
2846
- ),
2847
- "data-agg-animations": enableAnimations ? "true" : "false",
2848
- sideOffset: 8,
2849
- children: overflowLayout.hiddenItems.map((item) => {
2850
- const isSelected = item.value === value;
2851
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2852
- DropdownMenu.Item,
2853
- {
2854
- disabled: item.disabled,
2855
- onSelect: () => handleSelectHiddenItem(item.value),
2856
- className: cn(
2857
- "cursor-pointer disabled:cursor-not-allowed",
2858
- "flex w-full items-center gap-2 px-4 py-2 text-left text-agg-sm leading-agg-5 outline-none",
2859
- getMotionClassName(enableAnimations, "transition-colors"),
2860
- "focus:bg-agg-secondary-hover data-[highlighted]:bg-agg-secondary-hover",
2861
- isSelected ? "font-agg-bold text-agg-primary" : "font-agg-normal text-agg-foreground",
2862
- item.disabled && "cursor-not-allowed opacity-60"
2863
- ),
2864
- children: [
2865
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
2866
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "truncate whitespace-nowrap [&::first-letter]:uppercase", children: item.label })
2867
- ]
2868
- },
2869
- item.value
2870
- );
2871
- })
2872
- }
2873
- ) })
2874
- ] }) : null,
2875
- shouldUseOverflowMenu ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2876
- "div",
2877
- {
2878
- "aria-hidden": true,
2879
- className: "pointer-events-none invisible fixed top-0 left-0 -z-10 h-0 overflow-hidden whitespace-nowrap",
2880
- children: [
2881
- items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
2882
- "span",
2883
- {
2884
- ref: (tabElement) => handleMeasureTabRef(item.value, tabElement),
2885
- className: getMeasureTabClassName({
2886
- isBarVariant,
2887
- size
2888
- }),
2889
- children: [
2890
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center", children: item.icon }) : null,
2891
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: item.label })
2892
- ]
2893
- },
2894
- `measure-${item.value}`
2895
- )),
2896
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
2897
- "span",
2898
- {
2899
- ref: moreButtonMeasureRef,
2900
- className: getMoreButtonClassName({
2901
- enableAnimations,
2902
- isBarVariant,
2903
- size
2904
- }),
2905
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { name: "dots-horizontal", size: isBarVariant ? "s" : "m", color: "currentColor" })
2906
- }
2907
- )
2908
- ]
2909
- }
2910
- ) : null
2656
+ ] }) : null
2911
2657
  ]
2912
2658
  }
2913
2659
  );
@@ -2918,7 +2664,7 @@ Tabs.displayName = "Tabs";
2918
2664
  var import_hooks11 = require("@agg-market/hooks");
2919
2665
 
2920
2666
  // src/primitives/venue-logo/logo-props.ts
2921
- var DEFAULT_MONOCHROME_COLOR = "#000000";
2667
+ var DEFAULT_MONOCHROME_COLOR = "currentColor";
2922
2668
  var resolveLogoPrimaryColor = ({
2923
2669
  brandColor,
2924
2670
  isColor = true,
@@ -3116,14 +2862,9 @@ var venueLogoRegistry = {
3116
2862
  };
3117
2863
  var venueLogoNames = Object.keys(venueLogoRegistry);
3118
2864
  var sizeClasses2 = {
3119
- xxs: "h-2 w-2",
3120
- xs: "h-3 w-3",
3121
- s: "h-4 w-4",
3122
- ms: "h-5 w-5",
3123
- m: "h-6 w-6",
3124
- l: "h-8 w-8",
3125
- xl: "h-10 w-10",
3126
- xxl: "h-12 w-12"
2865
+ small: "h-4 w-4",
2866
+ medium: "h-6 w-6",
2867
+ large: "h-8 w-8"
3127
2868
  };
3128
2869
 
3129
2870
  // src/primitives/venue-logo/index.tsx
@@ -3133,7 +2874,7 @@ var VenueLogo = ({
3133
2874
  isColor = true,
3134
2875
  isMonochromatic = false,
3135
2876
  color,
3136
- size = "m",
2877
+ size = "medium",
3137
2878
  className,
3138
2879
  ariaLabel,
3139
2880
  title
@@ -3145,7 +2886,7 @@ var VenueLogo = ({
3145
2886
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
3146
2887
  Component,
3147
2888
  {
3148
- className: cn("shrink-0", sizeClass, className),
2889
+ className: cn("group/agg-venue-logo", "shrink-0", sizeClass, className),
3149
2890
  isColor: resolvedIsColor,
3150
2891
  color,
3151
2892
  "aria-label": ariaLabel != null ? ariaLabel : labels.venues[venue],
@@ -3223,6 +2964,26 @@ var getResultValueClassName = (tone) => {
3223
2964
  return "text-agg-foreground";
3224
2965
  return "text-agg-success";
3225
2966
  };
2967
+ var negativeOutcomePattern = /\b(no|down|against|under|lose|false)\b/i;
2968
+ var resolveIsPositiveOutcome = (outcome, index) => {
2969
+ const outcomeText = `${outcome.id} ${outcome.label}`;
2970
+ if (negativeOutcomePattern.test(outcomeText))
2971
+ return false;
2972
+ if (index === 1)
2973
+ return false;
2974
+ return true;
2975
+ };
2976
+ var getOutcomeButtonClassName = ({
2977
+ enableAnimations,
2978
+ isActive,
2979
+ isPositive
2980
+ }) => {
2981
+ return cn(
2982
+ "flex-1 cursor-pointer rounded-agg-full border px-6 py-2.5 text-agg-base leading-agg-6",
2983
+ getMotionClassName(enableAnimations, "transition-all duration-300 ease-in-out"),
2984
+ 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"
2985
+ );
2986
+ };
3226
2987
  var getStatusContent = ({
3227
2988
  placement,
3228
2989
  status,
@@ -3325,7 +3086,7 @@ var PlaceOrder = ({
3325
3086
  const actionButton = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
3326
3087
  Button,
3327
3088
  {
3328
- size: "xxl",
3089
+ size: "large",
3329
3090
  className: "w-full",
3330
3091
  disabled: isPrimaryActionDisabled,
3331
3092
  isLoading: isPrimaryActionLoading,
@@ -3359,7 +3120,7 @@ var PlaceOrder = ({
3359
3120
  Icon,
3360
3121
  {
3361
3122
  name: "close",
3362
- size: "m",
3123
+ size: "medium",
3363
3124
  className: "h-6 w-6 text-agg-foreground",
3364
3125
  color: "currentColor"
3365
3126
  }
@@ -3379,21 +3140,25 @@ var PlaceOrder = ({
3379
3140
  variant: "underline",
3380
3141
  size: "s",
3381
3142
  overflowBehavior: "scroll",
3382
- className: "w-full"
3143
+ classNames: {
3144
+ root: "w-full",
3145
+ tabList: "w-full"
3146
+ }
3383
3147
  }
3384
3148
  ),
3385
3149
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col gap-4", children: [
3386
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex w-full gap-2", children: outcomes.map((outcome) => {
3150
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex w-full gap-2", children: outcomes.map((outcome, index) => {
3387
3151
  const isActive = outcome.id === resolvedOutcomeId;
3152
+ const isPositive = resolveIsPositiveOutcome(outcome, index);
3388
3153
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
3389
3154
  "button",
3390
3155
  {
3391
3156
  type: "button",
3392
- className: cn(
3393
- "flex-1 rounded-agg-full px-6 py-2.5 text-agg-base leading-agg-6",
3394
- getMotionClassName(enableAnimations, "transition-colors"),
3395
- isActive ? "bg-agg-success font-agg-bold text-agg-on-primary" : "bg-agg-secondary-hover font-agg-normal text-agg-foreground"
3396
- ),
3157
+ className: getOutcomeButtonClassName({
3158
+ enableAnimations,
3159
+ isActive,
3160
+ isPositive
3161
+ }),
3397
3162
  "aria-pressed": isActive,
3398
3163
  "aria-label": `${outcome.label} ${outcome.priceLabel}`,
3399
3164
  onClick: () => handleOutcomeChange(outcome.id),
@@ -3436,7 +3201,7 @@ var PlaceOrder = ({
3436
3201
  VenueLogo,
3437
3202
  {
3438
3203
  venue: row.venue,
3439
- size: "s",
3204
+ size: "small",
3440
3205
  ariaLabel: getTradingVenueLabel(row.venue)
3441
3206
  }
3442
3207
  ),