@agg-build/ui 2.4.2 → 2.4.5

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 (38) hide show
  1. package/dist/{chunk-EOCHFD2U.mjs → chunk-CXSIXL7M.mjs} +38 -36
  2. package/dist/{chunk-3FLLEJFM.mjs → chunk-GWRFSQQK.mjs} +75 -9
  3. package/dist/{chunk-MDO3NMXP.mjs → chunk-I4X5UNCT.mjs} +343 -193
  4. package/dist/{chunk-G5BXCT5Y.mjs → chunk-JVRTJQPZ.mjs} +1 -1
  5. package/dist/{chunk-GUYFQP7L.mjs → chunk-P5CVJQPW.mjs} +288 -291
  6. package/dist/{chunk-2ET5CXOU.mjs → chunk-PTNFXXOV.mjs} +53 -21
  7. package/dist/{chunk-G5Y45GIA.mjs → chunk-UH3DUTMG.mjs} +352 -43
  8. package/dist/events.js +679 -194
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +1097 -547
  11. package/dist/index.mjs +13 -7
  12. package/dist/modals.js +333 -297
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +809 -262
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +53 -21
  17. package/dist/primitives.mjs +1 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +3265 -2765
  21. package/dist/trading.mjs +10 -4
  22. package/dist/types/events/item-details/event-list-item-details.constants.d.mts +1 -1
  23. package/dist/types/events/item-details/event-list-item-details.constants.d.ts +1 -1
  24. package/dist/types/events/item-details/settlement-summary.d.mts +3 -1
  25. package/dist/types/events/item-details/settlement-summary.d.ts +3 -1
  26. package/dist/types/onboarding/index.d.mts +1 -1
  27. package/dist/types/onboarding/index.d.ts +1 -1
  28. package/dist/types/onboarding/steps/connect-accounts.d.mts +1 -1
  29. package/dist/types/onboarding/steps/connect-accounts.d.ts +1 -1
  30. package/dist/types/primitives/icon/icon.constants.d.mts +1 -0
  31. package/dist/types/primitives/icon/icon.constants.d.ts +1 -0
  32. package/dist/types/shared/use-horizontal-scroll-state.d.mts +3 -0
  33. package/dist/types/shared/use-horizontal-scroll-state.d.ts +3 -0
  34. package/dist/types/trading/place-order/index.place-order.utils.d.mts +1 -0
  35. package/dist/types/trading/place-order/index.place-order.utils.d.ts +1 -0
  36. package/dist/types/trading/settlement/index.d.mts +19 -1
  37. package/dist/types/trading/settlement/index.d.ts +19 -1
  38. package/package.json +2 -2
package/dist/pages.mjs CHANGED
@@ -8,17 +8,17 @@ import {
8
8
  UserProfilePage,
9
9
  buildAggTxExplorerHref,
10
10
  useHomePageModals
11
- } from "./chunk-EOCHFD2U.mjs";
12
- import "./chunk-MDO3NMXP.mjs";
11
+ } from "./chunk-CXSIXL7M.mjs";
12
+ import "./chunk-I4X5UNCT.mjs";
13
13
  import {
14
14
  DEPOSIT_MODAL_OPEN_EVENT,
15
15
  WITHDRAW_MODAL_OPEN_EVENT,
16
16
  requestAggDepositModalOpen,
17
17
  requestAggWithdrawModalOpen
18
- } from "./chunk-3FLLEJFM.mjs";
19
- import "./chunk-G5Y45GIA.mjs";
20
- import "./chunk-G5BXCT5Y.mjs";
21
- import "./chunk-2ET5CXOU.mjs";
18
+ } from "./chunk-GWRFSQQK.mjs";
19
+ import "./chunk-UH3DUTMG.mjs";
20
+ import "./chunk-JVRTJQPZ.mjs";
21
+ import "./chunk-PTNFXXOV.mjs";
22
22
  export {
23
23
  DEPOSIT_MODAL_OPEN_EVENT,
24
24
  EventMarketPage,
@@ -1605,6 +1605,12 @@ var iconSizeClasses = {
1605
1605
  medium: "h-6 w-6",
1606
1606
  large: "h-8 w-8"
1607
1607
  };
1608
+ var iconSizePixels = {
1609
+ xs: 12,
1610
+ small: 16,
1611
+ medium: 24,
1612
+ large: 32
1613
+ };
1608
1614
 
1609
1615
  // src/primitives/search/search-empty-icon.tsx
1610
1616
  var import_jsx_runtime40 = require("react/jsx-runtime");
@@ -3206,6 +3212,8 @@ var Icon = (_a) => {
3206
3212
  __spreadValues({
3207
3213
  color,
3208
3214
  className: cn("group/agg-icon", resolvedClassName),
3215
+ width: iconSizePixels[size],
3216
+ height: iconSizePixels[size],
3209
3217
  style: resolvedStyle
3210
3218
  }, props)
3211
3219
  );
@@ -5424,7 +5432,7 @@ EventListSkeletonView.displayName = "EventListSkeletonView";
5424
5432
  var import_hooks13 = require("@agg-build/hooks");
5425
5433
 
5426
5434
  // src/events/item-details/event-list-item-details.constants.ts
5427
- var detailsBaseCardClassName = "w-full gap-6 p-5 md:gap-8";
5435
+ var detailsBaseCardClassName = "w-full gap-6 p-4 md:p-5 md:gap-8";
5428
5436
 
5429
5437
  // src/primitives/skeleton/views/event-list-item-details-skeleton-view.tsx
5430
5438
  var import_jsx_runtime101 = require("react/jsx-runtime");
@@ -5727,17 +5735,10 @@ var SettlementSkeletonView = ({
5727
5735
  children: [
5728
5736
  /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex w-full items-center justify-between gap-4", children: [
5729
5737
  /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "h-4 w-[81px] rounded-agg-sm" }),
5730
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "h-5 w-full max-w-[240px] rounded-agg-sm" })
5731
- ] }),
5732
- /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
5733
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "h-5 w-[200px] rounded-agg-sm" }),
5734
- /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex flex-col gap-2", children: [
5735
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[320px] rounded-agg-sm" }),
5736
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "h-4 w-full max-w-[280px] rounded-agg-sm" })
5737
- ] })
5738
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "h-5 w-[240px] max-w-[60%] rounded-agg-sm" })
5738
5739
  ] }),
5739
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "h-px w-full bg-agg-separator" }),
5740
- /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex w-full flex-col gap-3", children: [
5740
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "h-5 w-[200px] rounded-agg-sm" }),
5741
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex w-full flex-col gap-4", children: [
5741
5742
  /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "flex items-center gap-2", children: [
5742
5743
  /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "size-4 rounded-agg-sm" }),
5743
5744
  /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(SkeletonBlock, { className: "h-5 w-[100px] rounded-agg-sm" })
@@ -8639,14 +8640,23 @@ var import_react14 = require("react");
8639
8640
  var import_react13 = require("react");
8640
8641
  var useHorizontalScrollState = () => {
8641
8642
  const containerRef = (0, import_react13.useRef)(null);
8643
+ const [hasOverflow, setHasOverflow] = (0, import_react13.useState)(false);
8644
+ const [isAtStart, setIsAtStart] = (0, import_react13.useState)(true);
8645
+ const [isAtEnd, setIsAtEnd] = (0, import_react13.useState)(true);
8642
8646
  const [canScrollLeft, setCanScrollLeft] = (0, import_react13.useState)(false);
8643
8647
  const [canScrollRight, setCanScrollRight] = (0, import_react13.useState)(false);
8644
8648
  const update = (0, import_react13.useCallback)(() => {
8645
8649
  const el = containerRef.current;
8646
8650
  if (!el) return;
8647
- const maxScroll = el.scrollWidth - el.clientWidth;
8648
- setCanScrollLeft(el.scrollLeft > 4);
8649
- setCanScrollRight(maxScroll - el.scrollLeft > 4);
8651
+ const epsilon = 2;
8652
+ const nextHasOverflow = el.scrollWidth > el.clientWidth + epsilon;
8653
+ const nextIsAtStart = el.scrollLeft <= epsilon;
8654
+ const nextIsAtEnd = el.scrollLeft + el.clientWidth >= el.scrollWidth - epsilon;
8655
+ setHasOverflow(nextHasOverflow);
8656
+ setIsAtStart(nextIsAtStart);
8657
+ setIsAtEnd(nextIsAtEnd);
8658
+ setCanScrollLeft(nextHasOverflow && !nextIsAtStart);
8659
+ setCanScrollRight(nextHasOverflow && !nextIsAtEnd);
8650
8660
  }, []);
8651
8661
  (0, import_react13.useEffect)(() => {
8652
8662
  const el = containerRef.current;
@@ -8662,7 +8672,15 @@ var useHorizontalScrollState = () => {
8662
8672
  ro.observe(el);
8663
8673
  return () => ro.disconnect();
8664
8674
  }, [update]);
8665
- return { containerRef, canScrollLeft, canScrollRight, update };
8675
+ return {
8676
+ containerRef,
8677
+ hasOverflow,
8678
+ isAtStart,
8679
+ isAtEnd,
8680
+ canScrollLeft,
8681
+ canScrollRight,
8682
+ update
8683
+ };
8666
8684
  };
8667
8685
 
8668
8686
  // src/primitives/tabs/tabs.constants.ts
@@ -8757,6 +8775,9 @@ var Tabs = ({
8757
8775
  });
8758
8776
  const {
8759
8777
  containerRef: tabListRef,
8778
+ hasOverflow,
8779
+ isAtStart,
8780
+ isAtEnd,
8760
8781
  canScrollLeft,
8761
8782
  canScrollRight,
8762
8783
  update: updateScrollState
@@ -8845,7 +8866,7 @@ var Tabs = ({
8845
8866
  "overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
8846
8867
  getMotionClassName(enableAnimations, "scroll-smooth")
8847
8868
  ) : "overflow-x-auto",
8848
- isBarVariant ? "items-start rounded-agg-lg border border-agg-separator p-1.5" : "h-15 border-b border-agg-separator -mb-[1px]",
8869
+ isBarVariant ? "items-start rounded-agg-lg border border-agg-separator p-1.5" : "h-14 md:h-15 border-b border-agg-separator -mb-[1px]",
8849
8870
  shouldUseOverflowScroll && "select-none",
8850
8871
  shouldUseOverflowScroll && !isBarVariant && "snap-x snap-mandatory",
8851
8872
  shouldUseOverflowScroll && (isDraggingTabs ? "cursor-grabbing" : "cursor-grab")
@@ -9003,7 +9024,10 @@ var Tabs = ({
9003
9024
  left: Math.max(0, nextScrollLeft),
9004
9025
  behavior: getScrollBehavior(enableAnimations)
9005
9026
  });
9006
- }, [enableAnimations, renderedItems, shouldUseOverflowScroll, value]);
9027
+ requestAnimationFrame(() => {
9028
+ updateScrollState();
9029
+ });
9030
+ }, [enableAnimations, renderedItems, shouldUseOverflowScroll, updateScrollState, value]);
9007
9031
  if (shouldUseOverflowSelect) {
9008
9032
  return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: cn("group/agg-tabs w-full", className, classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
9009
9033
  Select,
@@ -9042,6 +9066,13 @@ var Tabs = ({
9042
9066
  onPointerUp: handleEndTabListDrag,
9043
9067
  onWheel: handleTabListWheel,
9044
9068
  children: [
9069
+ shouldUseOverflowScroll && !isBarVariant && hasOverflow ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
9070
+ "span",
9071
+ {
9072
+ "aria-hidden": true,
9073
+ className: "agg-tab-scroll-start-spacer h-full w-4 shrink-0 snap-start"
9074
+ }
9075
+ ) : null,
9045
9076
  renderedItems.map((item, index) => {
9046
9077
  var _a;
9047
9078
  const isActive = item.value === value;
@@ -9076,6 +9107,7 @@ var Tabs = ({
9076
9107
  isDisabled: !!item.disabled,
9077
9108
  size
9078
9109
  }),
9110
+ !isBarVariant && (size === "s" ? "px-3 md:px-4" : "h-14 px-3 md:h-15 md:px-4"),
9079
9111
  shouldUseOverflowScroll && !isBarVariant && "snap-start",
9080
9112
  classNames == null ? void 0 : classNames.tabTrigger
9081
9113
  ),
@@ -9125,9 +9157,9 @@ var Tabs = ({
9125
9157
  "aria-hidden": true,
9126
9158
  className: cn(
9127
9159
  "agg-tab-scroll-start",
9128
- "pointer-events-none absolute top-0 bottom-0 left-0 z-10 w-12 md:w-18 bg-linear-to-r from-agg-secondary via-agg-secondary to-transparent",
9160
+ "pointer-events-none absolute inset-y-0 left-0 z-10 w-6 md:w-[60px] bg-linear-to-r from-agg-secondary to-transparent",
9129
9161
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
9130
- canScrollLeft ? "opacity-100" : "opacity-0"
9162
+ hasOverflow && canScrollLeft && !isAtStart ? "opacity-100" : "opacity-0"
9131
9163
  )
9132
9164
  }
9133
9165
  ),
@@ -9137,9 +9169,9 @@ var Tabs = ({
9137
9169
  "aria-hidden": true,
9138
9170
  className: cn(
9139
9171
  "agg-tab-scroll-end",
9140
- "pointer-events-none absolute top-0 right-0 bottom-0 z-10 w-12 md:w-18 bg-linear-to-l from-agg-secondary via-agg-secondary to-transparent",
9172
+ "pointer-events-none absolute inset-y-0 right-0 z-10 w-6 md:w-[60px] bg-linear-to-l from-agg-secondary to-transparent",
9141
9173
  getMotionClassName(enableAnimations, "transition-opacity duration-200"),
9142
- canScrollRight ? "opacity-100" : "opacity-0"
9174
+ hasOverflow && canScrollRight && !isAtEnd ? "opacity-100" : "opacity-0"
9143
9175
  )
9144
9176
  }
9145
9177
  )
@@ -99,7 +99,7 @@ import {
99
99
  useOptionalToast,
100
100
  useToast,
101
101
  venueLogoNames
102
- } from "./chunk-2ET5CXOU.mjs";
102
+ } from "./chunk-PTNFXXOV.mjs";
103
103
  export {
104
104
  ActivityChartIcon,
105
105
  AggErrorBoundary,