@agg-market/ui 3.0.1 → 5.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 (60) hide show
  1. package/dist/chart.js +18 -5
  2. package/dist/chart.mjs +2 -2
  3. package/dist/{chunk-422MCIXV.mjs → chunk-34IRJYSU.mjs} +15 -11
  4. package/dist/{chunk-KUWTY4EM.mjs → chunk-3W7NBJLU.mjs} +1 -1
  5. package/dist/chunk-4343LYSH.mjs +45 -0
  6. package/dist/{chunk-RKCVOKE3.mjs → chunk-CTYJVVHJ.mjs} +26 -3
  7. package/dist/{chunk-MVJNQN7P.mjs → chunk-DHBHKIJR.mjs} +153 -94
  8. package/dist/{chunk-KRQFVMJE.mjs → chunk-GFBF2J3Y.mjs} +18 -25
  9. package/dist/{chunk-ZJJA4I3I.mjs → chunk-KIYMVWL4.mjs} +1 -1
  10. package/dist/{chunk-CTVMT3VL.mjs → chunk-LCZKSITC.mjs} +2 -2
  11. package/dist/chunk-M4RJHRFT.mjs +445 -0
  12. package/dist/{chunk-KSCSYCEF.mjs → chunk-MJHKBCXQ.mjs} +1 -1
  13. package/dist/{chunk-GHB3GOCW.mjs → chunk-MKVGQ7AS.mjs} +17 -21
  14. package/dist/{chunk-BN5VVHNV.mjs → chunk-OJVTGNIF.mjs} +17 -4
  15. package/dist/{chunk-FF3QYU26.mjs → chunk-Q6DGDBPV.mjs} +87 -26
  16. package/dist/{chunk-DCORNTCY.mjs → chunk-QDMHLRDY.mjs} +31 -62
  17. package/dist/{chunk-RGHA4PZH.mjs → chunk-T7TATHPD.mjs} +34 -10
  18. package/dist/chunk-XUCS575S.mjs +65 -0
  19. package/dist/event-list-item-details.js +1836 -407
  20. package/dist/event-list-item-details.mjs +10 -6
  21. package/dist/event-list-item.js +448 -279
  22. package/dist/event-list-item.mjs +6 -3
  23. package/dist/event-list.js +787 -627
  24. package/dist/event-list.mjs +7 -4
  25. package/dist/event-market-page.d.mts +1 -1
  26. package/dist/event-market-page.d.ts +1 -1
  27. package/dist/event-market-page.js +2684 -2572
  28. package/dist/event-market-page.mjs +12 -11
  29. package/dist/home-page.js +804 -644
  30. package/dist/home-page.mjs +8 -5
  31. package/dist/index.d.mts +3 -2
  32. package/dist/index.d.ts +3 -2
  33. package/dist/index.js +1344 -1177
  34. package/dist/index.mjs +23 -18
  35. package/dist/market-details.js +919 -757
  36. package/dist/market-details.mjs +9 -7
  37. package/dist/place-order.d.mts +1 -1
  38. package/dist/place-order.d.ts +1 -1
  39. package/dist/place-order.js +151 -189
  40. package/dist/place-order.mjs +2 -2
  41. package/dist/search.js +3 -0
  42. package/dist/search.mjs +2 -1
  43. package/dist/settlement.d.mts +1 -1
  44. package/dist/settlement.d.ts +1 -1
  45. package/dist/settlement.js +151 -189
  46. package/dist/settlement.mjs +2 -2
  47. package/dist/skeleton.js +151 -189
  48. package/dist/skeleton.mjs +1 -1
  49. package/dist/state-message.d.mts +16 -0
  50. package/dist/state-message.d.ts +16 -0
  51. package/dist/state-message.js +1629 -0
  52. package/dist/state-message.mjs +14 -0
  53. package/dist/styles.css +1 -1
  54. package/dist/switch-button.js +2 -2
  55. package/dist/switch-button.mjs +1 -1
  56. package/dist/tailwind.css +1 -1
  57. package/package.json +14 -2
  58. package/dist/chunk-V52WSZHQ.mjs +0 -482
  59. package/dist/{types-DkGlbmXq.d.mts → types-BImwqY4o.d.mts} +4 -4
  60. package/dist/{types-DkGlbmXq.d.ts → types-BImwqY4o.d.ts} +4 -4
package/dist/chart.js CHANGED
@@ -122,10 +122,10 @@ var SwitchButton = ({
122
122
  return null;
123
123
  }
124
124
  const handleKeyDown = (event, optionIndex) => {
125
- if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") {
125
+ if ((event == null ? void 0 : event.key) !== "ArrowLeft" && (event == null ? void 0 : event.key) !== "ArrowRight") {
126
126
  return;
127
127
  }
128
- event.preventDefault();
128
+ event == null ? void 0 : event.preventDefault();
129
129
  const nextOptionIndex = resolveNextEnabledIndex(
130
130
  options,
131
131
  optionIndex,
@@ -242,8 +242,18 @@ var normalizeSeries = (series) => {
242
242
  var defaultValueFormatter = (value) => {
243
243
  return `${Math.round(value)}%`;
244
244
  };
245
- var defaultTimeFormatter = (timestamp) => {
246
- return import_dayjs.default.unix(timestamp).format("MMM D");
245
+ var resolveTimeFormatter = (windowSeconds) => {
246
+ return (timestamp) => {
247
+ if (!Number.isFinite(timestamp))
248
+ return "";
249
+ if (windowSeconds <= 48 * 60 * 60) {
250
+ return import_dayjs.default.unix(timestamp).format("HH:mm");
251
+ }
252
+ if (windowSeconds <= 14 * 24 * 60 * 60) {
253
+ return import_dayjs.default.unix(timestamp).format("MMM D HH:mm");
254
+ }
255
+ return import_dayjs.default.unix(timestamp).format("MMM D");
256
+ };
247
257
  };
248
258
  var toLivelinePoints = (points) => {
249
259
  return points.map((point) => ({
@@ -366,6 +376,9 @@ var LineChart = ({
366
376
  const windowSeconds = (0, import_react2.useMemo)(() => {
367
377
  return resolveWindowSeconds(normalizedSeries);
368
378
  }, [normalizedSeries]);
379
+ const timeFormatter = (0, import_react2.useMemo)(() => {
380
+ return resolveTimeFormatter(windowSeconds);
381
+ }, [windowSeconds]);
369
382
  const seriesControls = showSeriesControls && normalizedSeries.length > 0 ? (_a = renderSeriesControls == null ? void 0 : renderSeriesControls({
370
383
  series: normalizedSeries,
371
384
  activeSeriesId,
@@ -404,7 +417,7 @@ var LineChart = ({
404
417
  pulse: false,
405
418
  window: windowSeconds,
406
419
  formatValue: defaultValueFormatter,
407
- formatTime: defaultTimeFormatter,
420
+ formatTime: timeFormatter,
408
421
  padding: {
409
422
  top: 12,
410
423
  right: 80,
package/dist/chart.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LineChart
3
- } from "./chunk-BN5VVHNV.mjs";
4
- import "./chunk-CTVMT3VL.mjs";
3
+ } from "./chunk-OJVTGNIF.mjs";
4
+ import "./chunk-LCZKSITC.mjs";
5
5
  import "./chunk-GJ4U5NCE.mjs";
6
6
  export {
7
7
  LineChart
@@ -2,11 +2,11 @@ import {
2
2
  resolveOutcomeTitle,
3
3
  selectPrimaryVenueMarket,
4
4
  sortOutcomes
5
- } from "./chunk-GHB3GOCW.mjs";
5
+ } from "./chunk-MKVGQ7AS.mjs";
6
6
  import {
7
7
  fallbackLineColors,
8
8
  lineColorByVenue
9
- } from "./chunk-V52WSZHQ.mjs";
9
+ } from "./chunk-M4RJHRFT.mjs";
10
10
 
11
11
  // src/events/item-details/event-list-item-details.utils.ts
12
12
  import dayjs from "dayjs";
@@ -107,18 +107,22 @@ var resolveOutcomesByVenue = (venueMarkets, selectedOutcomeLabel) => {
107
107
  };
108
108
  }).filter((item) => item != null);
109
109
  };
110
- var buildPriceHistoryGroups = (selectedOutcomes) => {
111
- const venueMarketOutcomeIdsByVenue = /* @__PURE__ */ new Map();
112
- selectedOutcomes.forEach(({ venue, outcome }) => {
113
- var _a;
114
- if (!venueMarketOutcomeIdsByVenue.has(venue)) {
115
- venueMarketOutcomeIdsByVenue.set(venue, []);
110
+ var buildPriceHistoryGroups = (selectedOutcomes, fallbackMarketId) => {
111
+ const marketIdByVenue = /* @__PURE__ */ new Map();
112
+ selectedOutcomes.forEach(({ venue, market }) => {
113
+ var _a, _b;
114
+ const marketWithCanonicalId = market;
115
+ const canonicalMarketId = (_a = marketWithCanonicalId.marketId) != null ? _a : fallbackMarketId;
116
+ if (!canonicalMarketId)
117
+ return;
118
+ if (!marketIdByVenue.has(venue)) {
119
+ marketIdByVenue.set(venue, /* @__PURE__ */ new Set());
116
120
  }
117
- (_a = venueMarketOutcomeIdsByVenue.get(venue)) == null ? void 0 : _a.push(outcome.id);
121
+ (_b = marketIdByVenue.get(venue)) == null ? void 0 : _b.add(canonicalMarketId);
118
122
  });
119
- return [...venueMarketOutcomeIdsByVenue.entries()].map(([venue, venueMarketOutcomeIds]) => ({
123
+ return [...marketIdByVenue.entries()].map(([venue, marketIds]) => ({
120
124
  venue,
121
- venueMarketOutcomeIds
125
+ venueMarketOutcomeIds: [...marketIds]
122
126
  })).filter((group) => group.venueMarketOutcomeIds.length > 0);
123
127
  };
124
128
  var resolveSeriesColor = (venue, index) => {
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  Skeleton,
8
8
  skeletonViews
9
- } from "./chunk-V52WSZHQ.mjs";
9
+ } from "./chunk-M4RJHRFT.mjs";
10
10
  import {
11
11
  VenueLogo
12
12
  } from "./chunk-PORVP72S.mjs";
@@ -0,0 +1,45 @@
1
+ import {
2
+ getIconA11yProps
3
+ } from "./chunk-BNDFQPHF.mjs";
4
+ import {
5
+ __objRest,
6
+ __spreadProps,
7
+ __spreadValues
8
+ } from "./chunk-GJ4U5NCE.mjs";
9
+
10
+ // src/primitives/search/search-empty-icon.tsx
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ var SearchEmptyIcon = (_a) => {
13
+ var _b = _a, { title, className } = _b, props = __objRest(_b, ["title", "className"]);
14
+ return /* @__PURE__ */ jsxs(
15
+ "svg",
16
+ __spreadProps(__spreadValues(__spreadValues({
17
+ viewBox: "0 0 40 40",
18
+ fill: "none",
19
+ xmlns: "http://www.w3.org/2000/svg",
20
+ className
21
+ }, getIconA11yProps(title)), props), {
22
+ children: [
23
+ title ? /* @__PURE__ */ jsx("title", { children: title }) : null,
24
+ /* @__PURE__ */ jsx("circle", { cx: "19.9987", cy: "20.0013", r: "9.2", stroke: "currentColor", strokeWidth: "1.6" }),
25
+ /* @__PURE__ */ jsx(
26
+ "ellipse",
27
+ {
28
+ cx: "19.9987",
29
+ cy: "20.0012",
30
+ rx: "17.2",
31
+ ry: "6.6",
32
+ transform: "rotate(-35 19.9987 20.0012)",
33
+ stroke: "currentColor",
34
+ strokeWidth: "1.6"
35
+ }
36
+ )
37
+ ]
38
+ })
39
+ );
40
+ };
41
+ SearchEmptyIcon.displayName = "SearchEmptyIcon";
42
+
43
+ export {
44
+ SearchEmptyIcon
45
+ };
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  formatCountLabel,
3
3
  getVenueSummary,
4
+ isErrorWithStatus,
4
5
  normalizeProbability,
5
6
  resolveEventListItemEvent,
6
7
  resolveOutcomeTitle,
@@ -9,14 +10,17 @@ import {
9
10
  resolveVenueLabel,
10
11
  resolveVisibleOutcomes,
11
12
  selectPrimaryVenueMarket
12
- } from "./chunk-GHB3GOCW.mjs";
13
+ } from "./chunk-MKVGQ7AS.mjs";
14
+ import {
15
+ StateMessage
16
+ } from "./chunk-XUCS575S.mjs";
13
17
  import {
14
18
  Badge
15
19
  } from "./chunk-K6IJ4WBM.mjs";
16
20
  import {
17
21
  Skeleton,
18
22
  baseCardClassName
19
- } from "./chunk-V52WSZHQ.mjs";
23
+ } from "./chunk-M4RJHRFT.mjs";
20
24
  import {
21
25
  VenueLogo
22
26
  } from "./chunk-PORVP72S.mjs";
@@ -76,6 +80,21 @@ var EventListItemUnavailableState = ({
76
80
  }
77
81
  );
78
82
  };
83
+ var EventListItemNotFoundState = ({
84
+ classNames,
85
+ ariaLabel
86
+ }) => {
87
+ const labels = useLabels();
88
+ return /* @__PURE__ */ jsx(Card, { className: cn("w-full gap-0 overflow-hidden p-0", classNames == null ? void 0 : classNames.root), children: /* @__PURE__ */ jsx(
89
+ StateMessage,
90
+ {
91
+ ariaLabel: ariaLabel != null ? ariaLabel : labels.eventItemDetails.notFoundAria,
92
+ title: labels.eventItemDetails.notFoundTitle,
93
+ description: labels.eventItemDetails.notFoundDescription,
94
+ className: "min-h-[280px] md:min-h-[320px]"
95
+ }
96
+ ) });
97
+ };
79
98
  var EventListItemContent = ({
80
99
  event,
81
100
  title,
@@ -272,6 +291,7 @@ var EventListItemByEventId = (_a) => {
272
291
  ]);
273
292
  const {
274
293
  event: fetchedEvent,
294
+ error,
275
295
  isError,
276
296
  isLoading
277
297
  } = useEvent(eventId, {
@@ -286,7 +306,10 @@ var EventListItemByEventId = (_a) => {
286
306
  if (isLoading) {
287
307
  return /* @__PURE__ */ jsx(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
288
308
  }
289
- if (!resolvedEvent && !isError) {
309
+ if (isErrorWithStatus(error, 404)) {
310
+ return /* @__PURE__ */ jsx(EventListItemNotFoundState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
311
+ }
312
+ if (!fetchedEvent && !isError) {
290
313
  return /* @__PURE__ */ jsx(EventListItemLoadingState, { classNames: rest.classNames, ariaLabel: rest.ariaLabel });
291
314
  }
292
315
  if (!resolvedEvent) {