@agg-build/ui 1.2.11 → 1.2.12

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 (66) hide show
  1. package/dist/{chunk-J7K2U44E.mjs → chunk-3JXBOU24.mjs} +110 -60
  2. package/dist/{chunk-3ZSNHGAB.mjs → chunk-4WBQTUPW.mjs} +314 -58
  3. package/dist/{chunk-54PCEK6G.mjs → chunk-IBOE7DRY.mjs} +1 -1
  4. package/dist/{chunk-YP75TIY6.mjs → chunk-J6WELNCX.mjs} +3 -3
  5. package/dist/{chunk-ENAGASVU.mjs → chunk-U55T5BPE.mjs} +406 -337
  6. package/dist/{chunk-SJLHOAKK.mjs → chunk-X3KCFWXN.mjs} +936 -650
  7. package/dist/{chunk-NWJHFGBZ.mjs → chunk-YSW4ULL5.mjs} +1 -1
  8. package/dist/events.js +1593 -886
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +4211 -3198
  11. package/dist/index.mjs +480 -105
  12. package/dist/modals.js +1164 -923
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +1975 -1492
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +928 -649
  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 +641 -444
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/agg-provider.d.mts +27 -0
  23. package/dist/types/agg-provider.d.ts +27 -0
  24. package/dist/types/events/list/event-list-tabs.d.mts +6 -1
  25. package/dist/types/events/list/event-list-tabs.d.ts +6 -1
  26. package/dist/types/index.d.mts +2 -0
  27. package/dist/types/index.d.ts +2 -0
  28. package/dist/types/notifications/agg-notification-events-provider.d.mts +35 -0
  29. package/dist/types/notifications/agg-notification-events-provider.d.ts +35 -0
  30. package/dist/types/notifications/agg-toast-provider.d.mts +27 -0
  31. package/dist/types/notifications/agg-toast-provider.d.ts +27 -0
  32. package/dist/types/notifications/deposit-notification-events.d.mts +10 -0
  33. package/dist/types/notifications/deposit-notification-events.d.ts +10 -0
  34. package/dist/types/notifications/index.d.mts +2 -0
  35. package/dist/types/notifications/index.d.ts +2 -0
  36. package/dist/types/primitives/button/button.types.d.mts +4 -0
  37. package/dist/types/primitives/button/button.types.d.ts +4 -0
  38. package/dist/types/primitives/button/index.d.mts +1 -1
  39. package/dist/types/primitives/button/index.d.ts +1 -1
  40. package/dist/types/primitives/icon/registry.d.mts +16 -0
  41. package/dist/types/primitives/icon/registry.d.ts +16 -0
  42. package/dist/types/primitives/icon/svg/sort-end-date.d.mts +5 -0
  43. package/dist/types/primitives/icon/svg/sort-end-date.d.ts +5 -0
  44. package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.mts +5 -0
  45. package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.ts +5 -0
  46. package/dist/types/primitives/icon/svg/sort-volume-24hr.d.mts +5 -0
  47. package/dist/types/primitives/icon/svg/sort-volume-24hr.d.ts +5 -0
  48. package/dist/types/primitives/icon/svg/sort-volume.d.mts +5 -0
  49. package/dist/types/primitives/icon/svg/sort-volume.d.ts +5 -0
  50. package/dist/types/primitives/select/index.d.mts +1 -1
  51. package/dist/types/primitives/select/index.d.ts +1 -1
  52. package/dist/types/primitives/select/select.types.d.mts +9 -0
  53. package/dist/types/primitives/select/select.types.d.ts +9 -0
  54. package/dist/types/primitives/toast/toast.types.d.mts +3 -0
  55. package/dist/types/primitives/toast/toast.types.d.ts +3 -0
  56. package/dist/types/profile/index.d.mts +1 -1
  57. package/dist/types/profile/index.d.ts +1 -1
  58. package/dist/types/profile/profile-modal.constants.d.mts +2 -2
  59. package/dist/types/profile/profile-modal.constants.d.ts +2 -2
  60. package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +2 -17
  61. package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +2 -17
  62. package/dist/types/profile/tabs/trading-access-tab.d.mts +15 -0
  63. package/dist/types/profile/tabs/trading-access-tab.d.ts +15 -0
  64. package/dist/types/trading/place-order/index.place-order.utils.d.mts +1 -1
  65. package/dist/types/trading/place-order/index.place-order.utils.d.ts +1 -1
  66. package/package.json +2 -2
@@ -23,7 +23,7 @@ import {
23
23
  selectOutcomePrice,
24
24
  sortOutcomeSelectorOutcomes,
25
25
  useEventTradingContext
26
- } from "./chunk-54PCEK6G.mjs";
26
+ } from "./chunk-IBOE7DRY.mjs";
27
27
  import {
28
28
  AutocompleteSelect,
29
29
  Badge,
@@ -33,8 +33,10 @@ import {
33
33
  LineChart,
34
34
  MOBILE_TABS_MEDIA_QUERY,
35
35
  MarketDetailsOderbookSkeleton,
36
+ Modal,
36
37
  RemoteImage,
37
38
  SearchEmptyIcon,
39
+ Select,
38
40
  Skeleton,
39
41
  StateMessage,
40
42
  SwitchButton,
@@ -70,7 +72,7 @@ import {
70
72
  sortMarketsByYesOddsDesc,
71
73
  sortOutcomes,
72
74
  splitEventsByLifecycle
73
- } from "./chunk-SJLHOAKK.mjs";
75
+ } from "./chunk-X3KCFWXN.mjs";
74
76
 
75
77
  // src/events/item/index.tsx
76
78
  import {
@@ -4530,8 +4532,16 @@ var MarketDetailsList = ({
4530
4532
  MarketDetailsList.displayName = "MarketDetailsList";
4531
4533
 
4532
4534
  // src/events/list/index.tsx
4533
- import { MarketStatus as MarketStatus2, useAppConfig as useAppConfig2, useLabels as useLabels8, useVenueEvents } from "@agg-build/hooks";
4535
+ import {
4536
+ MarketStatus as MarketStatus2,
4537
+ useAppConfig as useAppConfig2,
4538
+ useCategories,
4539
+ useLabels as useLabels8,
4540
+ useSdkUiConfig as useSdkUiConfig4,
4541
+ useVenueEvents
4542
+ } from "@agg-build/hooks";
4534
4543
  import { VENUES } from "@agg-build/sdk";
4544
+ import * as Dialog from "@radix-ui/react-dialog";
4535
4545
  import { useEffect as useEffect6, useMemo as useMemo8, useRef as useRef7, useState as useState6 } from "react";
4536
4546
 
4537
4547
  // src/events/list/event-list-tabs.tsx
@@ -4670,12 +4680,13 @@ var EventListTabs = ({
4670
4680
  );
4671
4681
  };
4672
4682
  EventListTabs.displayName = "EventListTabs";
4673
- var useEventListTabsHeaderOverflow = (recomputeOn) => {
4683
+ var useEventListTabsHeaderOverflow = (recomputeOn, options) => {
4674
4684
  const headerRef = useRef6(null);
4675
4685
  const titleRef = useRef6(null);
4676
4686
  const requiredTabsWidthRef = useRef6(0);
4677
4687
  const [shouldUseSelectOverflow, setShouldUseSelectOverflow] = useState5(false);
4678
4688
  const updateTabsOverflowBehavior = useCallback3(() => {
4689
+ var _a;
4679
4690
  if (typeof window === "undefined") return;
4680
4691
  const headerElement = headerRef.current;
4681
4692
  const titleElement = titleRef.current;
@@ -4688,6 +4699,16 @@ var useEventListTabsHeaderOverflow = (recomputeOn) => {
4688
4699
  setShouldUseSelectOverflow(true);
4689
4700
  return;
4690
4701
  }
4702
+ const minTabsInlineWidthForSelect = options == null ? void 0 : options.minTabsInlineWidthForSelect;
4703
+ if (typeof minTabsInlineWidthForSelect === "number" && availableTabsWidth < minTabsInlineWidthForSelect) {
4704
+ setShouldUseSelectOverflow(true);
4705
+ return;
4706
+ }
4707
+ const preferSelectOnOverflow = (_a = options == null ? void 0 : options.preferSelectOnOverflow) != null ? _a : true;
4708
+ if (!preferSelectOnOverflow) {
4709
+ setShouldUseSelectOverflow(false);
4710
+ return;
4711
+ }
4691
4712
  const tabListElement = headerElement.querySelector(".agg-tab-list");
4692
4713
  if (tabListElement) {
4693
4714
  const currentRequiredWidth = tabListElement.scrollWidth;
@@ -4700,7 +4721,7 @@ var useEventListTabsHeaderOverflow = (recomputeOn) => {
4700
4721
  }
4701
4722
  if (requiredTabsWidthRef.current <= 0) return;
4702
4723
  setShouldUseSelectOverflow(requiredTabsWidthRef.current > availableTabsWidth);
4703
- }, []);
4724
+ }, [options == null ? void 0 : options.minTabsInlineWidthForSelect, options == null ? void 0 : options.preferSelectOnOverflow]);
4704
4725
  useEffect5(() => {
4705
4726
  updateTabsOverflowBehavior();
4706
4727
  }, [recomputeOn, updateTabsOverflowBehavior]);
@@ -4732,7 +4753,25 @@ var useEventListTabsHeaderOverflow = (recomputeOn) => {
4732
4753
  };
4733
4754
 
4734
4755
  // src/events/list/index.tsx
4735
- import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
4756
+ import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
4757
+ var SORT_ICON_BY_VALUE = {
4758
+ volume24hr: "sort-volume-24hr",
4759
+ topArbitrage: "sort-top-arbitrage",
4760
+ volume: "sort-volume",
4761
+ endDate: "sort-end-date"
4762
+ };
4763
+ var resolveSortQueryParams = (value) => {
4764
+ if (value === "volume") {
4765
+ return { sortBy: "volume", sortDir: "desc" };
4766
+ }
4767
+ if (value === "endDate") {
4768
+ return { sortBy: "endDate", sortDir: "asc" };
4769
+ }
4770
+ if (value === "topArbitrage") {
4771
+ return {};
4772
+ }
4773
+ return { sortBy: "volume24hr", sortDir: "desc" };
4774
+ };
4736
4775
  var EventList = ({
4737
4776
  title,
4738
4777
  limit = DEFAULT_EVENTS_LIMIT,
@@ -4747,9 +4786,13 @@ var EventList = ({
4747
4786
  initialLoadedPageCount,
4748
4787
  stateRef
4749
4788
  }) => {
4750
- var _a, _b;
4789
+ var _a, _b, _c;
4751
4790
  const labels = useLabels8();
4752
4791
  const { disabledVenues } = useAppConfig2();
4792
+ const {
4793
+ features: { enableVenueEventDiscoveryFilters }
4794
+ } = useSdkUiConfig4();
4795
+ const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
4753
4796
  const resolvedTabs = useEventListTabs();
4754
4797
  const visibleVenues = useMemo8(
4755
4798
  () => disabledVenues.length === 0 ? void 0 : VENUES.filter(
@@ -4760,7 +4803,90 @@ var EventList = ({
4760
4803
  const [activeTabValue, setActiveTabValue] = useState6(
4761
4804
  (_b = initialVenueTab != null ? initialVenueTab : (_a = resolvedTabs[0]) == null ? void 0 : _a.value) != null ? _b : "matched"
4762
4805
  );
4763
- const { headerRef, titleRef, shouldUseSelectOverflow } = useEventListTabsHeaderOverflow(resolvedTabs);
4806
+ const [selectedSort, setSelectedSort] = useState6("volume24hr");
4807
+ const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = useState6(false);
4808
+ const [selectedParentCategoryId, setSelectedParentCategoryId] = useState6(null);
4809
+ const [selectedSubcategoryId, setSelectedSubcategoryId] = useState6(null);
4810
+ const { headerRef, titleRef, shouldUseSelectOverflow } = useEventListTabsHeaderOverflow(resolvedTabs, { minTabsInlineWidthForSelect: 400, preferSelectOnOverflow: false });
4811
+ const sortItems = useMemo8(() => {
4812
+ return [
4813
+ {
4814
+ value: "volume24hr",
4815
+ label: labels.eventList.sortBy24hVolume,
4816
+ icon: /* @__PURE__ */ jsx11(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
4817
+ },
4818
+ {
4819
+ value: "topArbitrage",
4820
+ label: labels.eventList.sortByTopArbitrage,
4821
+ icon: /* @__PURE__ */ jsx11(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" }),
4822
+ disabled: true,
4823
+ hidden: true
4824
+ },
4825
+ {
4826
+ value: "volume",
4827
+ label: labels.eventList.sortByTotalVolume,
4828
+ icon: /* @__PURE__ */ jsx11(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
4829
+ },
4830
+ {
4831
+ value: "endDate",
4832
+ label: labels.eventList.sortByEndingSoon,
4833
+ icon: /* @__PURE__ */ jsx11(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
4834
+ }
4835
+ ];
4836
+ }, [
4837
+ labels.eventList.sortBy24hVolume,
4838
+ labels.eventList.sortByEndingSoon,
4839
+ labels.eventList.sortByTopArbitrage,
4840
+ labels.eventList.sortByTotalVolume
4841
+ ]);
4842
+ const baseCategoryId = (_c = categoryIds == null ? void 0 : categoryIds[0]) != null ? _c : null;
4843
+ useEffect6(() => {
4844
+ if (!isDiscoveryFiltersEnabled) return;
4845
+ setSelectedParentCategoryId(baseCategoryId);
4846
+ setSelectedSubcategoryId(null);
4847
+ }, [baseCategoryId, isDiscoveryFiltersEnabled]);
4848
+ const { categories: topLevelCategories } = useCategories({
4849
+ queryKeyScope: "event-list-top-categories",
4850
+ enabled: isDiscoveryFiltersEnabled,
4851
+ limit: 100
4852
+ });
4853
+ const { categories: subcategories } = useCategories({
4854
+ queryKeyScope: "event-list-subcategories",
4855
+ enabled: isDiscoveryFiltersEnabled && Boolean(baseCategoryId),
4856
+ parentId: baseCategoryId,
4857
+ limit: 100
4858
+ });
4859
+ const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && Boolean(baseCategoryId) && subcategories.length > 0;
4860
+ console.log({
4861
+ enableVenueEventDiscoveryFilters,
4862
+ shouldRenderSubcategoryFilters,
4863
+ isDiscoveryFiltersEnabled,
4864
+ baseCategoryId,
4865
+ subcategories
4866
+ });
4867
+ const totalTopLevelEventCount = useMemo8(() => {
4868
+ return topLevelCategories.reduce((accumulator, category) => {
4869
+ var _a2;
4870
+ return accumulator + ((_a2 = category.eventCount) != null ? _a2 : 0);
4871
+ }, 0);
4872
+ }, [topLevelCategories]);
4873
+ const selectedParentEventCount = useMemo8(() => {
4874
+ var _a2;
4875
+ if (!baseCategoryId) return totalTopLevelEventCount;
4876
+ const selectedParentCategory = topLevelCategories.find(
4877
+ (category) => category.id === baseCategoryId
4878
+ );
4879
+ return (_a2 = selectedParentCategory == null ? void 0 : selectedParentCategory.eventCount) != null ? _a2 : totalTopLevelEventCount;
4880
+ }, [baseCategoryId, topLevelCategories, totalTopLevelEventCount]);
4881
+ const resolvedCategoryIds = useMemo8(() => {
4882
+ if (!isDiscoveryFiltersEnabled) return categoryIds;
4883
+ if (selectedSubcategoryId) return [selectedSubcategoryId];
4884
+ if (selectedParentCategoryId) return [selectedParentCategoryId];
4885
+ return categoryIds;
4886
+ }, [categoryIds, isDiscoveryFiltersEnabled, selectedParentCategoryId, selectedSubcategoryId]);
4887
+ const sortQueryParams = useMemo8(() => {
4888
+ return resolveSortQueryParams(selectedSort);
4889
+ }, [selectedSort]);
4764
4890
  const activeTab = useMemo8(() => {
4765
4891
  return resolvedTabs.find((tab) => tab.value === activeTabValue);
4766
4892
  }, [activeTabValue, resolvedTabs]);
@@ -4796,12 +4922,12 @@ var EventList = ({
4796
4922
  queryKeyScope: "event-list",
4797
4923
  venues,
4798
4924
  search,
4799
- categoryIds,
4925
+ categoryIds: resolvedCategoryIds,
4800
4926
  matchStatus,
4801
4927
  limit: requestLimit,
4802
4928
  status: [MarketStatus2.open],
4803
- sortBy: "volume24hr",
4804
- sortDir: "desc",
4929
+ sortBy: sortQueryParams.sortBy,
4930
+ sortDir: sortQueryParams.sortDir,
4805
4931
  endDateFrom,
4806
4932
  initialPages: initialLoadedPageCount
4807
4933
  });
@@ -4853,6 +4979,54 @@ var EventList = ({
4853
4979
  const gridClassName = cn(
4854
4980
  "grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] md:grid-cols-[repeat(auto-fill,minmax(360px,1fr))] gap-4"
4855
4981
  );
4982
+ const isAllSubcategoriesSelected = shouldRenderSubcategoryFilters && !selectedSubcategoryId;
4983
+ const handleSelectAllCategories = () => {
4984
+ setSelectedParentCategoryId(baseCategoryId);
4985
+ setSelectedSubcategoryId(null);
4986
+ setIsSubcategoriesModalOpen(false);
4987
+ };
4988
+ const handleSelectSubcategory = (subcategoryId) => {
4989
+ setSelectedSubcategoryId(subcategoryId);
4990
+ setIsSubcategoriesModalOpen(false);
4991
+ };
4992
+ const subcategoriesListContent = /* @__PURE__ */ jsxs8(Fragment2, { children: [
4993
+ /* @__PURE__ */ jsxs8(
4994
+ "button",
4995
+ {
4996
+ type: "button",
4997
+ className: cn(
4998
+ "flex w-full items-center justify-between rounded-[6px] px-3 py-3 text-left text-agg-sm leading-agg-5",
4999
+ isAllSubcategoriesSelected ? "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground"
5000
+ ),
5001
+ onClick: handleSelectAllCategories,
5002
+ children: [
5003
+ /* @__PURE__ */ jsx11("span", { children: labels.eventList.subcategoriesAll }),
5004
+ /* @__PURE__ */ jsx11("span", { className: "text-agg-muted-foreground", children: selectedParentEventCount })
5005
+ ]
5006
+ }
5007
+ ),
5008
+ subcategories.map((subcategory) => {
5009
+ var _a2;
5010
+ const isSubcategorySelected = selectedSubcategoryId === subcategory.id;
5011
+ return /* @__PURE__ */ jsxs8(
5012
+ "button",
5013
+ {
5014
+ type: "button",
5015
+ className: cn(
5016
+ "flex w-full items-center justify-between rounded-[6px] px-3 py-3 text-left text-agg-sm leading-agg-5",
5017
+ "cursor-pointer",
5018
+ isSubcategorySelected ? "bg-agg-secondary-hover font-agg-bold text-agg-foreground" : "font-agg-normal text-agg-foreground"
5019
+ ),
5020
+ onClick: () => handleSelectSubcategory(subcategory.id),
5021
+ children: [
5022
+ /* @__PURE__ */ jsx11("span", { className: "truncate first-letter:uppercase", children: subcategory.name }),
5023
+ /* @__PURE__ */ jsx11("span", { className: "text-agg-muted-foreground", children: (_a2 = subcategory.eventCount) != null ? _a2 : 0 })
5024
+ ]
5025
+ },
5026
+ subcategory.id
5027
+ );
5028
+ })
5029
+ ] });
4856
5030
  if (shouldRenderLoadingState) {
4857
5031
  return /* @__PURE__ */ jsx11(Skeleton, { view: "event-list", ariaLabel: labels.eventList.loading(title) });
4858
5032
  }
@@ -4868,62 +5042,144 @@ var EventList = ({
4868
5042
  ),
4869
5043
  children: [
4870
5044
  /* @__PURE__ */ jsx11("div", { ref: titleRef, className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ jsx11(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title }) }),
4871
- /* @__PURE__ */ jsx11(
4872
- EventListTabs,
4873
- {
4874
- ariaLabel: labels.eventList.tabsAria(title),
4875
- className: "agg-event-list-tabs min-w-0 max-w-full",
4876
- activeTab: activeTabValue,
4877
- onTabChange: setActiveTabValue,
4878
- overflowBehavior: shouldUseSelectOverflow ? "select" : void 0
4879
- }
4880
- )
5045
+ /* @__PURE__ */ jsxs8("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
5046
+ /* @__PURE__ */ jsx11(
5047
+ EventListTabs,
5048
+ {
5049
+ ariaLabel: labels.eventList.tabsAria(title),
5050
+ className: cn(
5051
+ "agg-event-list-tabs w-fit max-w-full flex-1",
5052
+ shouldUseSelectOverflow ? "min-w-[220px]" : "min-w-[400px]"
5053
+ ),
5054
+ activeTab: activeTabValue,
5055
+ onTabChange: setActiveTabValue,
5056
+ overflowBehavior: shouldUseSelectOverflow ? "select" : "scroll"
5057
+ }
5058
+ ),
5059
+ /* @__PURE__ */ jsx11(
5060
+ Select,
5061
+ {
5062
+ ariaLabel: labels.eventList.sortByLabel,
5063
+ className: "min-w-[160px] w-auto! shrink-0 min-h-10.5",
5064
+ value: selectedSort,
5065
+ onChange: setSelectedSort,
5066
+ items: sortItems,
5067
+ contentClassName: "py-2"
5068
+ }
5069
+ )
5070
+ ] })
4881
5071
  ]
4882
5072
  }
4883
5073
  ),
4884
- /* @__PURE__ */ jsxs8("div", { className: cn("agg-event-list-grid", isPlaceholderData && "opacity-60", gridClassName), children: [
4885
- tileEvents.map((event) => /* @__PURE__ */ jsx11(
4886
- EventListItem,
4887
- {
4888
- event,
4889
- classNames: {
4890
- root: "agg-event-list-item w-full min-w-0 max-w-none"
4891
- },
4892
- onEventClick,
4893
- onMarketClick,
4894
- getMarketHref,
4895
- href: getEventHref == null ? void 0 : getEventHref(event),
4896
- marketStatus: MarketStatus2.open
4897
- },
4898
- event.id
4899
- )),
4900
- shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ jsx11(
4901
- EventListItem,
5074
+ /* @__PURE__ */ jsxs8("div", { className: "flex w-full gap-2 md:hidden", children: [
5075
+ /* @__PURE__ */ jsx11(
5076
+ EventListTabs,
4902
5077
  {
4903
- isLoading: true,
4904
- classNames: {
4905
- root: "agg-event-list-item w-full min-w-0 max-w-none"
4906
- }
4907
- },
4908
- `loading-${index}`
4909
- )) : null,
4910
- shouldRenderEmptyState ? /* @__PURE__ */ jsx11("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx11(
4911
- StateMessage,
5078
+ ariaLabel: labels.eventList.tabsAria(title),
5079
+ className: "agg-event-list-tabs min-w-0 flex-1",
5080
+ activeTab: activeTabValue,
5081
+ onTabChange: setActiveTabValue,
5082
+ overflowBehavior: "select"
5083
+ }
5084
+ ),
5085
+ /* @__PURE__ */ jsx11(
5086
+ Select,
4912
5087
  {
4913
- title: labels.eventList.emptyTitle,
4914
- description: labels.eventList.emptyDescription,
4915
- icon: /* @__PURE__ */ jsx11(Icon, { name: "search-empty" })
5088
+ ariaLabel: labels.eventList.sortByLabel,
5089
+ className: "min-w-0 flex-1 md:min-w-[144px]",
5090
+ value: selectedSort,
5091
+ onChange: setSelectedSort,
5092
+ items: sortItems,
5093
+ contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
4916
5094
  }
4917
- ) }) : null,
4918
- isError ? /* @__PURE__ */ jsx11("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx11(
4919
- StateMessage,
5095
+ ),
5096
+ shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx11(
5097
+ "button",
4920
5098
  {
4921
- title: labels.eventList.errorTitle,
4922
- description: labels.eventList.errorDescription,
4923
- icon: /* @__PURE__ */ jsx11(Icon, { name: "warning" })
5099
+ type: "button",
5100
+ className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-[8px] border-2 border-agg-primary bg-agg-secondary text-agg-foreground cursor-pointer",
5101
+ "aria-label": labels.eventList.subcategoriesOpenAria,
5102
+ onClick: () => setIsSubcategoriesModalOpen(true),
5103
+ children: /* @__PURE__ */ jsx11(Icon, { name: "apps", size: "small", color: "currentColor" })
4924
5104
  }
4925
- ) }) : null
5105
+ ) : null
4926
5106
  ] }),
5107
+ /* @__PURE__ */ jsxs8(
5108
+ "div",
5109
+ {
5110
+ className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
5111
+ children: [
5112
+ shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx11("aside", { className: "hidden w-[200px] shrink-0 md:block", children: /* @__PURE__ */ jsx11("div", { className: "flex w-full flex-col gap-1 rounded-[8px] border border-agg-separator bg-agg-secondary p-2", children: subcategoriesListContent }) }) : null,
5113
+ /* @__PURE__ */ jsxs8(
5114
+ "div",
5115
+ {
5116
+ className: cn(
5117
+ "agg-event-list-grid",
5118
+ "w-full",
5119
+ isPlaceholderData && "opacity-60",
5120
+ gridClassName
5121
+ ),
5122
+ children: [
5123
+ tileEvents.map((event) => /* @__PURE__ */ jsx11(
5124
+ EventListItem,
5125
+ {
5126
+ event,
5127
+ classNames: {
5128
+ root: "agg-event-list-item w-full min-w-0 max-w-none"
5129
+ },
5130
+ onEventClick,
5131
+ onMarketClick,
5132
+ getMarketHref,
5133
+ href: getEventHref == null ? void 0 : getEventHref(event),
5134
+ marketStatus: MarketStatus2.open
5135
+ },
5136
+ event.id
5137
+ )),
5138
+ shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ jsx11(
5139
+ EventListItem,
5140
+ {
5141
+ isLoading: true,
5142
+ classNames: {
5143
+ root: "agg-event-list-item w-full min-w-0 max-w-none"
5144
+ }
5145
+ },
5146
+ `loading-${index}`
5147
+ )) : null,
5148
+ shouldRenderEmptyState ? /* @__PURE__ */ jsx11("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx11(
5149
+ StateMessage,
5150
+ {
5151
+ title: labels.eventList.emptyTitle,
5152
+ description: labels.eventList.emptyDescription,
5153
+ icon: /* @__PURE__ */ jsx11(Icon, { name: "search-empty" })
5154
+ }
5155
+ ) }) : null,
5156
+ isError ? /* @__PURE__ */ jsx11("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx11(
5157
+ StateMessage,
5158
+ {
5159
+ title: labels.eventList.errorTitle,
5160
+ description: labels.eventList.errorDescription,
5161
+ icon: /* @__PURE__ */ jsx11(Icon, { name: "warning" })
5162
+ }
5163
+ ) }) : null
5164
+ ]
5165
+ }
5166
+ )
5167
+ ]
5168
+ }
5169
+ ),
5170
+ shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx11(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ jsxs8(
5171
+ Modal.Container,
5172
+ {
5173
+ classNames: {
5174
+ content: "items-end p-0",
5175
+ container: "w-full max-w-none border-0 bg-transparent shadow-none"
5176
+ },
5177
+ children: [
5178
+ /* @__PURE__ */ jsx11(Dialog.Title, { className: "sr-only", children: labels.eventList.subcategoriesLabel }),
5179
+ /* @__PURE__ */ jsx11("div", { className: "w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary p-4", children: /* @__PURE__ */ jsx11("div", { className: "flex flex-col gap-1", children: subcategoriesListContent }) })
5180
+ ]
5181
+ }
5182
+ ) }) : null,
4927
5183
  shouldPaginate && hasNextPage ? /* @__PURE__ */ jsx11("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
4928
5184
  ] });
4929
5185
  };
@@ -17,7 +17,7 @@ import {
17
17
  selectPrimaryVenueMarket,
18
18
  skeletonViews,
19
19
  sortOutcomes
20
- } from "./chunk-SJLHOAKK.mjs";
20
+ } from "./chunk-X3KCFWXN.mjs";
21
21
 
22
22
  // src/trading/trading-context/index.tsx
23
23
  import { useEventTradingContext } from "@agg-build/hooks";
@@ -10,13 +10,13 @@ import {
10
10
  isErrorWithStatus,
11
11
  useEventListTabs,
12
12
  useEventListTabsHeaderOverflow
13
- } from "./chunk-3ZSNHGAB.mjs";
13
+ } from "./chunk-4WBQTUPW.mjs";
14
14
  import {
15
15
  DEPOSIT_MODAL_OPEN_EVENT,
16
16
  PlaceOrder,
17
17
  SettlementDetails,
18
18
  WITHDRAW_MODAL_OPEN_EVENT
19
- } from "./chunk-J7K2U44E.mjs";
19
+ } from "./chunk-3JXBOU24.mjs";
20
20
  import {
21
21
  AggErrorBoundary,
22
22
  Button,
@@ -45,7 +45,7 @@ import {
45
45
  filterOpenEvents,
46
46
  resolveTabVenus,
47
47
  shortenAddress
48
- } from "./chunk-SJLHOAKK.mjs";
48
+ } from "./chunk-X3KCFWXN.mjs";
49
49
 
50
50
  // src/pages/home/index.tsx
51
51
  import {