@agg-build/ui 4.18.0 → 4.18.2

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.
package/dist/pages.mjs CHANGED
@@ -9,25 +9,25 @@ import {
9
9
  buildAggTxExplorerHref,
10
10
  formatShareAmount,
11
11
  useHomePageModals
12
- } from "./chunk-FTWJRLJQ.mjs";
13
- import "./chunk-WSZYDOZN.mjs";
12
+ } from "./chunk-RFMA5ABT.mjs";
13
+ import "./chunk-DXASFSVL.mjs";
14
14
  import {
15
15
  EventMarketPage,
16
16
  EventOpenOrders,
17
17
  EventOpenOrdersCard,
18
18
  formatRecurringCountdown,
19
19
  useEventOpenOrders
20
- } from "./chunk-HFL3CEWG.mjs";
21
- import "./chunk-2UPO6G3S.mjs";
20
+ } from "./chunk-NSQQ62QK.mjs";
21
+ import "./chunk-DWPBGMVJ.mjs";
22
22
  import {
23
23
  DEPOSIT_MODAL_OPEN_EVENT,
24
24
  WITHDRAW_MODAL_OPEN_EVENT,
25
25
  requestAggDepositModalOpen,
26
26
  requestAggWithdrawModalOpen
27
- } from "./chunk-2OBJ7DYT.mjs";
28
- import "./chunk-JJ3VVCEP.mjs";
29
- import "./chunk-NRPS2D3Q.mjs";
30
- import "./chunk-WIGSRHUG.mjs";
27
+ } from "./chunk-5YHKIJ23.mjs";
28
+ import "./chunk-WOCZ4TVT.mjs";
29
+ import "./chunk-ROA5K67W.mjs";
30
+ import "./chunk-XZVGHKMW.mjs";
31
31
  export {
32
32
  DEPOSIT_MODAL_OPEN_EVENT,
33
33
  EventMarketPage,
@@ -6056,7 +6056,8 @@ var RemoteImage = ({
6056
6056
  width,
6057
6057
  height,
6058
6058
  onClick,
6059
- ariaLabel
6059
+ ariaLabel,
6060
+ fallback
6060
6061
  }) => {
6061
6062
  const {
6062
6063
  general: { theme }
@@ -6113,7 +6114,7 @@ var RemoteImage = ({
6113
6114
  className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
6114
6115
  "aria-hidden": true,
6115
6116
  "aria-errormessage": "Image failed to load",
6116
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
6117
+ children: fallback != null ? fallback : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
6117
6118
  Icon,
6118
6119
  {
6119
6120
  name: "image",
@@ -100,7 +100,7 @@ import {
100
100
  useOptionalToast,
101
101
  useToast,
102
102
  venueLogoNames
103
- } from "./chunk-WIGSRHUG.mjs";
103
+ } from "./chunk-XZVGHKMW.mjs";
104
104
  export {
105
105
  ActivityChartIcon,
106
106
  AggErrorBoundary,
package/dist/trading.js CHANGED
@@ -4136,7 +4136,8 @@ var RemoteImage = ({
4136
4136
  width,
4137
4137
  height,
4138
4138
  onClick,
4139
- ariaLabel
4139
+ ariaLabel,
4140
+ fallback
4140
4141
  }) => {
4141
4142
  const {
4142
4143
  general: { theme }
@@ -4193,7 +4194,7 @@ var RemoteImage = ({
4193
4194
  className: cn(placeholderClasses, classNames == null ? void 0 : classNames.placeholder),
4194
4195
  "aria-hidden": true,
4195
4196
  "aria-errormessage": "Image failed to load",
4196
- children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
4197
+ children: fallback != null ? fallback : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
4197
4198
  Icon,
4198
4199
  {
4199
4200
  name: "image",
@@ -10294,7 +10295,7 @@ var resolvePlaceOrderQuoteStatus = ({
10294
10295
  selectedMarket,
10295
10296
  tradeSide = "buy"
10296
10297
  }) => {
10297
- var _a, _b, _c, _d, _e;
10298
+ var _a, _b, _c, _d, _e, _f;
10298
10299
  if (!selectedMarket) {
10299
10300
  return {
10300
10301
  tone: "warning",
@@ -10314,7 +10315,15 @@ var resolvePlaceOrderQuoteStatus = ({
10314
10315
  };
10315
10316
  }
10316
10317
  if (quoteData.status === "no_orderbooks") {
10317
- const serverError = (_a = quoteData.error) == null ? void 0 : _a.trim();
10318
+ const warnings = (_a = quoteData.warnings) != null ? _a : [];
10319
+ if (warnings.length > 0 && warnings.every((warning) => warning.reason === "hosted_cash_unavailable")) {
10320
+ return {
10321
+ tone: "warning",
10322
+ message: labels.betdexBalanceUnavailable,
10323
+ placement: "above-action"
10324
+ };
10325
+ }
10326
+ const serverError = (_b = quoteData.error) == null ? void 0 : _b.trim();
10318
10327
  return {
10319
10328
  tone: "error",
10320
10329
  message: serverError || labels.noOrderbooks,
@@ -10331,24 +10340,24 @@ var resolvePlaceOrderQuoteStatus = ({
10331
10340
  if (quoteData.status === "insufficient_input_amount") {
10332
10341
  return {
10333
10342
  tone: "error",
10334
- message: (_b = quoteData.message) != null ? _b : labels.insufficientInputAmount,
10343
+ message: (_c = quoteData.message) != null ? _c : labels.insufficientInputAmount,
10335
10344
  placement: "above-action"
10336
10345
  };
10337
10346
  }
10338
10347
  if (quoteData.status === "invalid_input") {
10339
10348
  return {
10340
10349
  tone: "error",
10341
- message: (_c = quoteData.message) != null ? _c : labels.quoteUnavailable,
10350
+ message: (_d = quoteData.message) != null ? _d : labels.quoteUnavailable,
10342
10351
  placement: "above-action"
10343
10352
  };
10344
10353
  }
10345
10354
  if (quoteData.status === "insufficient_position") {
10346
- const total = (_d = quoteData.positionAvailability) == null ? void 0 : _d.totalSellableShares;
10355
+ const total = (_e = quoteData.positionAvailability) == null ? void 0 : _e.totalSellableShares;
10347
10356
  const message = total != null ? labels.insufficientPosition(total) : labels.insufficientPositionGeneric;
10348
10357
  return { tone: "error", message, placement: "above-action" };
10349
10358
  }
10350
10359
  if (quoteData.status === "insufficient_depth") {
10351
- const serverError = (_e = quoteData.error) == null ? void 0 : _e.trim();
10360
+ const serverError = (_f = quoteData.error) == null ? void 0 : _f.trim();
10352
10361
  return {
10353
10362
  tone: "error",
10354
10363
  message: tradeSide === "sell" ? serverError || labels.insufficientSellDepth : serverError || labels.insufficientLiquidity,
@@ -12936,6 +12945,7 @@ var renderCardHeader = ({
12936
12945
  headerSubtitle,
12937
12946
  headerImage,
12938
12947
  headerTitle,
12948
+ headerVenue,
12939
12949
  onClose
12940
12950
  }) => {
12941
12951
  if (!headerTitle) return null;
@@ -12946,6 +12956,7 @@ var renderCardHeader = ({
12946
12956
  {
12947
12957
  src: headerImage,
12948
12958
  alt: "",
12959
+ fallback: headerVenue ? /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(VenueLogo, { venue: headerVenue, size: "large" }) : void 0,
12949
12960
  className: "agg-order-market-image h-12 w-12 shrink-0 overflow-hidden rounded-agg-lg object-cover"
12950
12961
  }
12951
12962
  ),
@@ -13272,7 +13283,7 @@ var PlaceOrder = ({
13272
13283
  showResolvingState = false,
13273
13284
  midpointsResult
13274
13285
  }) => {
13275
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha;
13286
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia;
13276
13287
  const {
13277
13288
  enableDebug: isExecutionDebugEnabled,
13278
13289
  features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
@@ -15558,6 +15569,7 @@ var PlaceOrder = ({
15558
15569
  headerSubtitle,
15559
15570
  headerImage,
15560
15571
  headerTitle,
15572
+ headerVenue: (_ia = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) != null ? _ia : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.venue,
15561
15573
  onClose
15562
15574
  }),
15563
15575
  /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: cn("agg-order-panel-content flex flex-col gap-6", classNames == null ? void 0 : classNames.content), children: [
package/dist/trading.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  useClaimWinnings,
15
15
  useResolvedMarketClaim,
16
16
  venueRequiresSharedKyc
17
- } from "./chunk-2OBJ7DYT.mjs";
17
+ } from "./chunk-5YHKIJ23.mjs";
18
18
  import {
19
19
  SETTLEMENT_SECTION_ID,
20
20
  Settlement,
@@ -32,9 +32,9 @@ import {
32
32
  prepareSettlementDifferences,
33
33
  resolveDifferenceIconClassName,
34
34
  useEventTradingContext
35
- } from "./chunk-JJ3VVCEP.mjs";
36
- import "./chunk-NRPS2D3Q.mjs";
37
- import "./chunk-WIGSRHUG.mjs";
35
+ } from "./chunk-WOCZ4TVT.mjs";
36
+ import "./chunk-ROA5K67W.mjs";
37
+ import "./chunk-XZVGHKMW.mjs";
38
38
  export {
39
39
  FundKalshiModal,
40
40
  PlaceOrder,
@@ -2,6 +2,6 @@ import type { RemoteImageProps, RemoteImageStatus } from "./remote-image.types";
2
2
  export type { RemoteImageProps, RemoteImageStatus };
3
3
  /** Renders a remote image with loading skeleton and error placeholder fallbacks. */
4
4
  export declare const RemoteImage: {
5
- ({ src, retinaSrc, alt, title, className, classNames, width, height, onClick, ariaLabel, }: RemoteImageProps): JSX.Element;
5
+ ({ src, retinaSrc, alt, title, className, classNames, width, height, onClick, ariaLabel, fallback, }: RemoteImageProps): JSX.Element;
6
6
  displayName: string;
7
7
  };
@@ -2,6 +2,6 @@ import type { RemoteImageProps, RemoteImageStatus } from "./remote-image.types";
2
2
  export type { RemoteImageProps, RemoteImageStatus };
3
3
  /** Renders a remote image with loading skeleton and error placeholder fallbacks. */
4
4
  export declare const RemoteImage: {
5
- ({ src, retinaSrc, alt, title, className, classNames, width, height, onClick, ariaLabel, }: RemoteImageProps): JSX.Element;
5
+ ({ src, retinaSrc, alt, title, className, classNames, width, height, onClick, ariaLabel, fallback, }: RemoteImageProps): JSX.Element;
6
6
  displayName: string;
7
7
  };
@@ -31,4 +31,10 @@ export type RemoteImageProps = {
31
31
  onClick?: () => void;
32
32
  /** Accessible label applied when the image acts like a control. */
33
33
  ariaLabel?: string;
34
+ /**
35
+ * Rendered instead of the generic image icon when there is no usable image
36
+ * (missing source or load failure), e.g. the owning venue's mark. The
37
+ * caller must pass real existing artwork, never an invented subject image.
38
+ */
39
+ fallback?: React.ReactNode;
34
40
  };
@@ -31,4 +31,10 @@ export type RemoteImageProps = {
31
31
  onClick?: () => void;
32
32
  /** Accessible label applied when the image acts like a control. */
33
33
  ariaLabel?: string;
34
+ /**
35
+ * Rendered instead of the generic image icon when there is no usable image
36
+ * (missing source or load failure), e.g. the owning venue's mark. The
37
+ * caller must pass real existing artwork, never an invented subject image.
38
+ */
39
+ fallback?: React.ReactNode;
34
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/ui",
3
- "version": "4.18.0",
3
+ "version": "4.18.2",
4
4
  "description": "Pre-built React component library for the AGG prediction market aggregator. Tailwind-based, themeable, with primitives, event surfaces, trading flows, full pages, and modals.",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -100,7 +100,7 @@
100
100
  "liveline": "^0.0.7",
101
101
  "react": "^18.0.0 || ^19.0.0",
102
102
  "react-dom": "^18.0.0 || ^19.0.0",
103
- "@agg-build/hooks": "^4.18.0",
103
+ "@agg-build/hooks": "^4.18.2",
104
104
  "@agg-build/sdk": "^4.18.0"
105
105
  },
106
106
  "dependencies": {