@agg-build/ui 1.2.11 → 1.3.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.
- package/README.md +34 -1
- package/dist/{chunk-NWJHFGBZ.mjs → chunk-55ODXLOS.mjs} +1 -1
- package/dist/{chunk-3ZSNHGAB.mjs → chunk-5ALBEKAT.mjs} +842 -300
- package/dist/{chunk-YP75TIY6.mjs → chunk-6PQ6O6M5.mjs} +583 -186
- package/dist/{chunk-ENAGASVU.mjs → chunk-ONVP7YWS.mjs} +439 -339
- package/dist/{chunk-SJLHOAKK.mjs → chunk-QUZWA34R.mjs} +1256 -844
- package/dist/{chunk-54PCEK6G.mjs → chunk-UFC7L74C.mjs} +26 -27
- package/dist/{chunk-J7K2U44E.mjs → chunk-YWJIYEJV.mjs} +236 -121
- package/dist/events.js +2460 -1355
- package/dist/events.mjs +5 -3
- package/dist/index.js +5741 -3841
- package/dist/index.mjs +485 -106
- package/dist/modals.js +1399 -1093
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +4039 -2687
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +1267 -895
- package/dist/primitives.mjs +3 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1032 -695
- package/dist/trading.mjs +4 -4
- package/dist/types/agg-provider.d.mts +27 -0
- package/dist/types/agg-provider.d.ts +27 -0
- package/dist/types/events/item/event-list-item-v2.utils.d.mts +28 -0
- package/dist/types/events/item/event-list-item-v2.utils.d.ts +28 -0
- package/dist/types/events/item/event-list-item.constants.d.mts +1 -1
- package/dist/types/events/item/event-list-item.constants.d.ts +1 -1
- package/dist/types/events/item/index.d.mts +4 -0
- package/dist/types/events/item/index.d.ts +4 -0
- package/dist/types/events/list/event-list-tabs.d.mts +6 -1
- package/dist/types/events/list/event-list-tabs.d.ts +6 -1
- package/dist/types/events/list/event-list.types.d.mts +2 -0
- package/dist/types/events/list/event-list.types.d.ts +2 -0
- package/dist/types/events/list/event-list.utils.d.mts +19 -0
- package/dist/types/events/list/event-list.utils.d.ts +19 -0
- package/dist/types/events/list/index.d.mts +1 -1
- package/dist/types/events/list/index.d.ts +1 -1
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/notifications/agg-notification-events-provider.d.mts +35 -0
- package/dist/types/notifications/agg-notification-events-provider.d.ts +35 -0
- package/dist/types/notifications/agg-toast-provider.d.mts +27 -0
- package/dist/types/notifications/agg-toast-provider.d.ts +27 -0
- package/dist/types/notifications/deposit-notification-events.d.mts +10 -0
- package/dist/types/notifications/deposit-notification-events.d.ts +10 -0
- package/dist/types/notifications/index.d.mts +2 -0
- package/dist/types/notifications/index.d.ts +2 -0
- package/dist/types/pages/home/home.types.d.mts +1 -0
- package/dist/types/pages/home/home.types.d.ts +1 -0
- package/dist/types/pages/user-profile/user-profile.types.d.mts +30 -4
- package/dist/types/pages/user-profile/user-profile.types.d.ts +30 -4
- package/dist/types/primitives/button/button.types.d.mts +4 -0
- package/dist/types/primitives/button/button.types.d.ts +4 -0
- package/dist/types/primitives/button/index.d.mts +1 -1
- package/dist/types/primitives/button/index.d.ts +1 -1
- package/dist/types/primitives/icon/index.d.mts +2 -1
- package/dist/types/primitives/icon/index.d.ts +2 -1
- package/dist/types/primitives/icon/registry.d.mts +20 -0
- package/dist/types/primitives/icon/registry.d.ts +20 -0
- package/dist/types/primitives/icon/svg/gift-bonus.d.mts +5 -0
- package/dist/types/primitives/icon/svg/gift-bonus.d.ts +5 -0
- package/dist/types/primitives/icon/svg/sort-end-date.d.mts +5 -0
- package/dist/types/primitives/icon/svg/sort-end-date.d.ts +5 -0
- package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.mts +5 -0
- package/dist/types/primitives/icon/svg/sort-top-arbitrage.d.ts +5 -0
- package/dist/types/primitives/icon/svg/sort-volume-24hr.d.mts +5 -0
- package/dist/types/primitives/icon/svg/sort-volume-24hr.d.ts +5 -0
- package/dist/types/primitives/icon/svg/sort-volume.d.mts +5 -0
- package/dist/types/primitives/icon/svg/sort-volume.d.ts +5 -0
- package/dist/types/primitives/search/search.types.d.mts +2 -1
- package/dist/types/primitives/search/search.types.d.ts +2 -1
- package/dist/types/primitives/select/index.d.mts +1 -1
- package/dist/types/primitives/select/index.d.ts +1 -1
- package/dist/types/primitives/select/select.types.d.mts +9 -0
- package/dist/types/primitives/select/select.types.d.ts +9 -0
- package/dist/types/primitives/skeleton/index.d.mts +1 -1
- package/dist/types/primitives/skeleton/index.d.ts +1 -1
- package/dist/types/primitives/skeleton/skeleton.types.d.mts +4 -0
- package/dist/types/primitives/skeleton/skeleton.types.d.ts +4 -0
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.mts +1 -1
- package/dist/types/primitives/skeleton/views/event-list-skeleton-view.d.ts +1 -1
- package/dist/types/primitives/toast/toast.types.d.mts +3 -0
- package/dist/types/primitives/toast/toast.types.d.ts +3 -0
- package/dist/types/profile/index.d.mts +1 -1
- package/dist/types/profile/index.d.ts +1 -1
- package/dist/types/profile/profile-modal.constants.d.mts +2 -2
- package/dist/types/profile/profile-modal.constants.d.ts +2 -2
- package/dist/types/profile/tabs/accounts-wallets-tab.d.mts +2 -17
- package/dist/types/profile/tabs/accounts-wallets-tab.d.ts +2 -17
- package/dist/types/profile/tabs/trading-access-tab.d.mts +15 -0
- package/dist/types/profile/tabs/trading-access-tab.d.ts +15 -0
- package/dist/types/trading/place-order/index.d.mts +1 -1
- package/dist/types/trading/place-order/index.d.ts +1 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +4 -1
- package/dist/types/trading/place-order/index.place-order.types.d.ts +4 -1
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +3 -1
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +3 -1
- package/package.json +3 -3
package/dist/trading.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
SettlementDetails,
|
|
7
7
|
parseAmount,
|
|
8
8
|
parseVenue
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YWJIYEJV.mjs";
|
|
10
10
|
import {
|
|
11
11
|
SETTLEMENT_SECTION_ID,
|
|
12
12
|
Settlement,
|
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
getTradingValueLabel,
|
|
22
22
|
getTradingVenueLabel,
|
|
23
23
|
useEventTradingContext
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-UFC7L74C.mjs";
|
|
25
|
+
import "./chunk-55ODXLOS.mjs";
|
|
26
|
+
import "./chunk-QUZWA34R.mjs";
|
|
27
27
|
export {
|
|
28
28
|
PlaceOrder,
|
|
29
29
|
PlaceOrderFailureView,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AggProviderProps as AggSdkProviderProps } from "@agg-build/hooks";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { type AggToastProviderProps } from "./notifications/agg-toast-provider";
|
|
4
|
+
export interface AggProviderProps extends Omit<AggSdkProviderProps, "children"> {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Optional overrides forwarded to the internally-mounted `AggToastProvider`.
|
|
8
|
+
* Use this for toast viewport positioning, swipe behavior, etc. The
|
|
9
|
+
* notification bridge itself is gated by
|
|
10
|
+
* `config.features.enableNotifications` (default `true`), not by this prop.
|
|
11
|
+
*/
|
|
12
|
+
toast?: Omit<AggToastProviderProps, "children">;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Batteries-included AGG provider for partner React apps. Wraps the bare
|
|
16
|
+
* `AggProvider` from `@agg-build/hooks` with `AggToastProvider`, so partners
|
|
17
|
+
* get the toast surface **and** the global order/deposit/withdrawal
|
|
18
|
+
* notification bridge by mounting a single component.
|
|
19
|
+
*
|
|
20
|
+
* Partners who want a leaner setup (no toast surface) can import the original
|
|
21
|
+
* `AggProvider` from `@agg-build/hooks` directly.
|
|
22
|
+
*
|
|
23
|
+
* The notification bridge respects `config.features.enableNotifications`
|
|
24
|
+
* (default `true`) — set it to `false` to keep the toast surface mounted
|
|
25
|
+
* for ad-hoc partner-fired toasts while suppressing all SDK-driven ones.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AggProvider({ children, toast, ...providerProps }: AggProviderProps): JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AggProviderProps as AggSdkProviderProps } from "@agg-build/hooks";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { type AggToastProviderProps } from "./notifications/agg-toast-provider";
|
|
4
|
+
export interface AggProviderProps extends Omit<AggSdkProviderProps, "children"> {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Optional overrides forwarded to the internally-mounted `AggToastProvider`.
|
|
8
|
+
* Use this for toast viewport positioning, swipe behavior, etc. The
|
|
9
|
+
* notification bridge itself is gated by
|
|
10
|
+
* `config.features.enableNotifications` (default `true`), not by this prop.
|
|
11
|
+
*/
|
|
12
|
+
toast?: Omit<AggToastProviderProps, "children">;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Batteries-included AGG provider for partner React apps. Wraps the bare
|
|
16
|
+
* `AggProvider` from `@agg-build/hooks` with `AggToastProvider`, so partners
|
|
17
|
+
* get the toast surface **and** the global order/deposit/withdrawal
|
|
18
|
+
* notification bridge by mounting a single component.
|
|
19
|
+
*
|
|
20
|
+
* Partners who want a leaner setup (no toast surface) can import the original
|
|
21
|
+
* `AggProvider` from `@agg-build/hooks` directly.
|
|
22
|
+
*
|
|
23
|
+
* The notification bridge respects `config.features.enableNotifications`
|
|
24
|
+
* (default `true`) — set it to `false` to keep the toast surface mounted
|
|
25
|
+
* for ad-hoc partner-fired toasts while suppressing all SDK-driven ones.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AggProvider({ children, toast, ...providerProps }: AggProviderProps): JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { VenueMarket, VenueMarketOutcome } from "@agg-build/hooks";
|
|
2
|
+
export type EventListItemV2Price = {
|
|
3
|
+
venue: VenueMarket["venue"];
|
|
4
|
+
market: VenueMarket;
|
|
5
|
+
outcome: VenueMarketOutcome;
|
|
6
|
+
price: number;
|
|
7
|
+
isBest: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type EventListItemV2Row = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
market: VenueMarket;
|
|
13
|
+
outcome: VenueMarketOutcome;
|
|
14
|
+
prices: EventListItemV2Price[];
|
|
15
|
+
};
|
|
16
|
+
export type EventListItemV2Comparison = {
|
|
17
|
+
rows: EventListItemV2Row[];
|
|
18
|
+
hasVenueCompetition: boolean;
|
|
19
|
+
matchedVenues: VenueMarket["venue"][];
|
|
20
|
+
};
|
|
21
|
+
type NormalizeEventListItemV2ComparisonOptions = {
|
|
22
|
+
venueMarkets: VenueMarket[];
|
|
23
|
+
marketCount: number;
|
|
24
|
+
priceByOutcomeId?: ReadonlyMap<string, number>;
|
|
25
|
+
};
|
|
26
|
+
export declare const computePriceGapsFromComparisonRows: (rows: readonly EventListItemV2Row[]) => Map<string, number>;
|
|
27
|
+
export declare const normalizeEventListItemV2Comparison: ({ venueMarkets, marketCount, priceByOutcomeId, }: NormalizeEventListItemV2ComparisonOptions) => EventListItemV2Comparison;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { VenueMarket, VenueMarketOutcome } from "@agg-build/hooks";
|
|
2
|
+
export type EventListItemV2Price = {
|
|
3
|
+
venue: VenueMarket["venue"];
|
|
4
|
+
market: VenueMarket;
|
|
5
|
+
outcome: VenueMarketOutcome;
|
|
6
|
+
price: number;
|
|
7
|
+
isBest: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type EventListItemV2Row = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
market: VenueMarket;
|
|
13
|
+
outcome: VenueMarketOutcome;
|
|
14
|
+
prices: EventListItemV2Price[];
|
|
15
|
+
};
|
|
16
|
+
export type EventListItemV2Comparison = {
|
|
17
|
+
rows: EventListItemV2Row[];
|
|
18
|
+
hasVenueCompetition: boolean;
|
|
19
|
+
matchedVenues: VenueMarket["venue"][];
|
|
20
|
+
};
|
|
21
|
+
type NormalizeEventListItemV2ComparisonOptions = {
|
|
22
|
+
venueMarkets: VenueMarket[];
|
|
23
|
+
marketCount: number;
|
|
24
|
+
priceByOutcomeId?: ReadonlyMap<string, number>;
|
|
25
|
+
};
|
|
26
|
+
export declare const computePriceGapsFromComparisonRows: (rows: readonly EventListItemV2Row[]) => Map<string, number>;
|
|
27
|
+
export declare const normalizeEventListItemV2Comparison: ({ venueMarkets, marketCount, priceByOutcomeId, }: NormalizeEventListItemV2ComparisonOptions) => EventListItemV2Comparison;
|
|
28
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const baseCardClassName = "gap-3 overflow-hidden p-
|
|
1
|
+
export declare const baseCardClassName = "gap-3 overflow-hidden p-4 w-full";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const baseCardClassName = "gap-3 overflow-hidden p-
|
|
1
|
+
export declare const baseCardClassName = "gap-3 overflow-hidden p-4 w-full";
|
|
@@ -41,4 +41,9 @@ export type EventListTabsHeaderOverflowResult<THeader extends HTMLElement, TTitl
|
|
|
41
41
|
* element and `titleRef` to the title element. Pass `recomputeOn` (e.g.
|
|
42
42
|
* the resolved tab list) to re-measure when tab content changes.
|
|
43
43
|
*/
|
|
44
|
-
export declare const useEventListTabsHeaderOverflow: <THeader extends HTMLElement = HTMLElement, TTitle extends HTMLElement = HTMLElement>(recomputeOn?: unknown
|
|
44
|
+
export declare const useEventListTabsHeaderOverflow: <THeader extends HTMLElement = HTMLElement, TTitle extends HTMLElement = HTMLElement>(recomputeOn?: unknown, options?: {
|
|
45
|
+
/** Force select fallback when available tabs inline width drops below this threshold. */
|
|
46
|
+
minTabsInlineWidthForSelect?: number;
|
|
47
|
+
/** Whether natural tab overflow should switch to select. Default true for legacy behavior. */
|
|
48
|
+
preferSelectOnOverflow?: boolean;
|
|
49
|
+
}) => EventListTabsHeaderOverflowResult<THeader, TTitle>;
|
|
@@ -41,4 +41,9 @@ export type EventListTabsHeaderOverflowResult<THeader extends HTMLElement, TTitl
|
|
|
41
41
|
* element and `titleRef` to the title element. Pass `recomputeOn` (e.g.
|
|
42
42
|
* the resolved tab list) to re-measure when tab content changes.
|
|
43
43
|
*/
|
|
44
|
-
export declare const useEventListTabsHeaderOverflow: <THeader extends HTMLElement = HTMLElement, TTitle extends HTMLElement = HTMLElement>(recomputeOn?: unknown
|
|
44
|
+
export declare const useEventListTabsHeaderOverflow: <THeader extends HTMLElement = HTMLElement, TTitle extends HTMLElement = HTMLElement>(recomputeOn?: unknown, options?: {
|
|
45
|
+
/** Force select fallback when available tabs inline width drops below this threshold. */
|
|
46
|
+
minTabsInlineWidthForSelect?: number;
|
|
47
|
+
/** Whether natural tab overflow should switch to select. Default true for legacy behavior. */
|
|
48
|
+
preferSelectOnOverflow?: boolean;
|
|
49
|
+
}) => EventListTabsHeaderOverflowResult<THeader, TTitle>;
|
|
@@ -31,6 +31,8 @@ export type EventListProps = {
|
|
|
31
31
|
search?: UseVenueEventsOptions["search"];
|
|
32
32
|
/** Category filters applied to the events query. */
|
|
33
33
|
categoryIds?: UseVenueEventsOptions["categoryIds"];
|
|
34
|
+
/** Called when the sidebar selects a top-level category root. */
|
|
35
|
+
onCategoryRootChange?: (categoryId: string | undefined) => void;
|
|
34
36
|
/** Called when an event card body is clicked. */
|
|
35
37
|
onEventClick?: (event?: VenueEventWithMarkets) => void;
|
|
36
38
|
/** Called when an outcome price badge is clicked. Use to navigate to the event with a preselected market and outcome. */
|
|
@@ -31,6 +31,8 @@ export type EventListProps = {
|
|
|
31
31
|
search?: UseVenueEventsOptions["search"];
|
|
32
32
|
/** Category filters applied to the events query. */
|
|
33
33
|
categoryIds?: UseVenueEventsOptions["categoryIds"];
|
|
34
|
+
/** Called when the sidebar selects a top-level category root. */
|
|
35
|
+
onCategoryRootChange?: (categoryId: string | undefined) => void;
|
|
34
36
|
/** Called when an event card body is clicked. */
|
|
35
37
|
onEventClick?: (event?: VenueEventWithMarkets) => void;
|
|
36
38
|
/** Called when an outcome price badge is clicked. Use to navigate to the event with a preselected market and outcome. */
|
|
@@ -16,4 +16,23 @@ export declare const filterEventsByTabValue: (events: VenueEventWithMarkets[], _
|
|
|
16
16
|
export declare const filterOpenMarkets: (markets: VenueMarket[]) => VenueMarket[];
|
|
17
17
|
/** Sort markets by YES odds descending, preserving input order for ties and missing values. */
|
|
18
18
|
export declare const sortMarketsByYesOddsDesc: (markets: VenueMarket[]) => VenueMarket[];
|
|
19
|
+
/** Sort markets by displayed volume descending, preserving input order for ties. */
|
|
20
|
+
export declare const sortMarketsByVolumeDesc: (markets: VenueMarket[]) => VenueMarket[];
|
|
21
|
+
/** A single drilled-into level beneath the active top-level tab. */
|
|
22
|
+
export type SubcategoryPathEntry = {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
eventCount: number;
|
|
26
|
+
};
|
|
27
|
+
export type CategoryNavigationItem = {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const sortCategoriesForNavigation: <TCategory extends CategoryNavigationItem>(categories: readonly TCategory[]) => TCategory[];
|
|
32
|
+
/**
|
|
33
|
+
* Resolve the categoryIds to send to the API based on the current drill path.
|
|
34
|
+
* - At the deepest selected level, filter by that category id only.
|
|
35
|
+
* - With an empty path, use the provided fallback category ids.
|
|
36
|
+
*/
|
|
37
|
+
export declare const resolveCategoryIdsFromPath: (path: readonly SubcategoryPathEntry[], fallbackCategoryIds: string[] | undefined) => string[] | undefined;
|
|
19
38
|
export declare const resolveTabVenus: (tab: EventListTab | undefined, visibleVenues?: readonly string[]) => UseVenueEventsOptions["venues"] | undefined;
|
|
@@ -16,4 +16,23 @@ export declare const filterEventsByTabValue: (events: VenueEventWithMarkets[], _
|
|
|
16
16
|
export declare const filterOpenMarkets: (markets: VenueMarket[]) => VenueMarket[];
|
|
17
17
|
/** Sort markets by YES odds descending, preserving input order for ties and missing values. */
|
|
18
18
|
export declare const sortMarketsByYesOddsDesc: (markets: VenueMarket[]) => VenueMarket[];
|
|
19
|
+
/** Sort markets by displayed volume descending, preserving input order for ties. */
|
|
20
|
+
export declare const sortMarketsByVolumeDesc: (markets: VenueMarket[]) => VenueMarket[];
|
|
21
|
+
/** A single drilled-into level beneath the active top-level tab. */
|
|
22
|
+
export type SubcategoryPathEntry = {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
eventCount: number;
|
|
26
|
+
};
|
|
27
|
+
export type CategoryNavigationItem = {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const sortCategoriesForNavigation: <TCategory extends CategoryNavigationItem>(categories: readonly TCategory[]) => TCategory[];
|
|
32
|
+
/**
|
|
33
|
+
* Resolve the categoryIds to send to the API based on the current drill path.
|
|
34
|
+
* - At the deepest selected level, filter by that category id only.
|
|
35
|
+
* - With an empty path, use the provided fallback category ids.
|
|
36
|
+
*/
|
|
37
|
+
export declare const resolveCategoryIdsFromPath: (path: readonly SubcategoryPathEntry[], fallbackCategoryIds: string[] | undefined) => string[] | undefined;
|
|
19
38
|
export declare const resolveTabVenus: (tab: EventListTab | undefined, visibleVenues?: readonly string[]) => UseVenueEventsOptions["venues"] | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EventListProps } from "./event-list.types";
|
|
2
2
|
export type { EventListProps, EventListStateRef } from "./event-list.types";
|
|
3
3
|
export declare const EventList: {
|
|
4
|
-
({ title, limit, maxVisibleItems, search, categoryIds, onEventClick, onMarketClick, getMarketHref, getEventHref, initialVenueTab, initialLoadedPageCount, stateRef, }: EventListProps): JSX.Element;
|
|
4
|
+
({ title, limit, maxVisibleItems, search, categoryIds, onCategoryRootChange, onEventClick, onMarketClick, getMarketHref, getEventHref, initialVenueTab, initialLoadedPageCount, stateRef, }: EventListProps): JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EventListProps } from "./event-list.types";
|
|
2
2
|
export type { EventListProps, EventListStateRef } from "./event-list.types";
|
|
3
3
|
export declare const EventList: {
|
|
4
|
-
({ title, limit, maxVisibleItems, search, categoryIds, onEventClick, onMarketClick, getMarketHref, getEventHref, initialVenueTab, initialLoadedPageCount, stateRef, }: EventListProps): JSX.Element;
|
|
4
|
+
({ title, limit, maxVisibleItems, search, categoryIds, onCategoryRootChange, onEventClick, onMarketClick, getMarketHref, getEventHref, initialVenueTab, initialLoadedPageCount, stateRef, }: EventListProps): JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
package/dist/types/index.d.mts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ToastContextValue } from "../primitives/toast";
|
|
3
|
+
interface AggNotificationEventsProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Toggle off without unmounting (e.g. partner is rendering a marketing page
|
|
7
|
+
* where toasts would be noise). Defaults to `true`. The
|
|
8
|
+
* `features.enableNotifications` flag on `<AggProvider config>` also gates
|
|
9
|
+
* the bridge — if either is `false`, no toasts fire.
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* How many recent deposit rows the bridge keeps in its observation window.
|
|
14
|
+
* The bridge mounts its own lightweight `useUserActivity({ type: "deposit" })`
|
|
15
|
+
* query so it can catch lifecycle transitions even when no other page is
|
|
16
|
+
* rendering the activity feed. Defaults to 25.
|
|
17
|
+
*/
|
|
18
|
+
depositActivityLimit?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Global notification bridge. Subscribes to order WS events, withdrawal
|
|
22
|
+
* lifecycle WS events, and the deposit activity feed; turns terminal
|
|
23
|
+
* transitions into toasts via the existing `ToastProvider`. Auto-mounted by
|
|
24
|
+
* `<ToastProvider>` — partners don't need to wire it manually.
|
|
25
|
+
*
|
|
26
|
+
* Bails to a transparent passthrough when no `<AggProvider>` is above it, so
|
|
27
|
+
* a partner using `<ToastProvider>` standalone (e.g. a marketing page) keeps
|
|
28
|
+
* working without hooking into the SDK.
|
|
29
|
+
*
|
|
30
|
+
* Toasts dedupe per `${kind}:${id}:${status}` so reconnect storms and polling
|
|
31
|
+
* overlap don't double-fire, and the dedupe table is cleared on user-id change
|
|
32
|
+
* so signing out / in cannot leak toasts from a prior session.
|
|
33
|
+
*/
|
|
34
|
+
export declare function AggNotificationEventsProvider({ children, enabled, depositActivityLimit, }: AggNotificationEventsProviderProps): JSX.Element;
|
|
35
|
+
export type { ToastContextValue };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ToastContextValue } from "../primitives/toast";
|
|
3
|
+
interface AggNotificationEventsProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Toggle off without unmounting (e.g. partner is rendering a marketing page
|
|
7
|
+
* where toasts would be noise). Defaults to `true`. The
|
|
8
|
+
* `features.enableNotifications` flag on `<AggProvider config>` also gates
|
|
9
|
+
* the bridge — if either is `false`, no toasts fire.
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* How many recent deposit rows the bridge keeps in its observation window.
|
|
14
|
+
* The bridge mounts its own lightweight `useUserActivity({ type: "deposit" })`
|
|
15
|
+
* query so it can catch lifecycle transitions even when no other page is
|
|
16
|
+
* rendering the activity feed. Defaults to 25.
|
|
17
|
+
*/
|
|
18
|
+
depositActivityLimit?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Global notification bridge. Subscribes to order WS events, withdrawal
|
|
22
|
+
* lifecycle WS events, and the deposit activity feed; turns terminal
|
|
23
|
+
* transitions into toasts via the existing `ToastProvider`. Auto-mounted by
|
|
24
|
+
* `<ToastProvider>` — partners don't need to wire it manually.
|
|
25
|
+
*
|
|
26
|
+
* Bails to a transparent passthrough when no `<AggProvider>` is above it, so
|
|
27
|
+
* a partner using `<ToastProvider>` standalone (e.g. a marketing page) keeps
|
|
28
|
+
* working without hooking into the SDK.
|
|
29
|
+
*
|
|
30
|
+
* Toasts dedupe per `${kind}:${id}:${status}` so reconnect storms and polling
|
|
31
|
+
* overlap don't double-fire, and the dedupe table is cleared on user-id change
|
|
32
|
+
* so signing out / in cannot leak toasts from a prior session.
|
|
33
|
+
*/
|
|
34
|
+
export declare function AggNotificationEventsProvider({ children, enabled, depositActivityLimit, }: AggNotificationEventsProviderProps): JSX.Element;
|
|
35
|
+
export type { ToastContextValue };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ToastProviderProps } from "../primitives/toast";
|
|
3
|
+
export interface AggToastProviderProps extends Omit<ToastProviderProps, "children"> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Disable the global notification bridge mounted under the toast viewport.
|
|
7
|
+
* When `true`, `AggToastProvider` behaves like the bare `ToastProvider` —
|
|
8
|
+
* no order/deposit/withdrawal toasts are emitted automatically. Defaults
|
|
9
|
+
* to `false`.
|
|
10
|
+
*/
|
|
11
|
+
disableAggNotifications?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Forwarded to `AggNotificationEventsProvider`. See its prop docs.
|
|
14
|
+
* Defaults to 25.
|
|
15
|
+
*/
|
|
16
|
+
notificationDepositActivityLimit?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Drop-in replacement for `ToastProvider` that also mounts the global Agg
|
|
20
|
+
* notification bridge. Partners using `@agg-build/ui` should prefer this
|
|
21
|
+
* over the raw `ToastProvider` so order/deposit/withdrawal lifecycle events
|
|
22
|
+
* become toasts automatically with no extra wiring.
|
|
23
|
+
*
|
|
24
|
+
* The bridge gracefully no-ops when no `<AggProvider>` is mounted above it,
|
|
25
|
+
* so this provider remains safe to use even on routes that don't run the SDK.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AggToastProvider({ children, disableAggNotifications, notificationDepositActivityLimit, ...toastProps }: AggToastProviderProps): JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ToastProviderProps } from "../primitives/toast";
|
|
3
|
+
export interface AggToastProviderProps extends Omit<ToastProviderProps, "children"> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Disable the global notification bridge mounted under the toast viewport.
|
|
7
|
+
* When `true`, `AggToastProvider` behaves like the bare `ToastProvider` —
|
|
8
|
+
* no order/deposit/withdrawal toasts are emitted automatically. Defaults
|
|
9
|
+
* to `false`.
|
|
10
|
+
*/
|
|
11
|
+
disableAggNotifications?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Forwarded to `AggNotificationEventsProvider`. See its prop docs.
|
|
14
|
+
* Defaults to 25.
|
|
15
|
+
*/
|
|
16
|
+
notificationDepositActivityLimit?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Drop-in replacement for `ToastProvider` that also mounts the global Agg
|
|
20
|
+
* notification bridge. Partners using `@agg-build/ui` should prefer this
|
|
21
|
+
* over the raw `ToastProvider` so order/deposit/withdrawal lifecycle events
|
|
22
|
+
* become toasts automatically with no extra wiring.
|
|
23
|
+
*
|
|
24
|
+
* The bridge gracefully no-ops when no `<AggProvider>` is mounted above it,
|
|
25
|
+
* so this provider remains safe to use even on routes that don't run the SDK.
|
|
26
|
+
*/
|
|
27
|
+
export declare function AggToastProvider({ children, disableAggNotifications, notificationDepositActivityLimit, ...toastProps }: AggToastProviderProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AggDepositNotificationStatus = "completed" | "failed";
|
|
2
|
+
export interface AggDepositNotificationDetail {
|
|
3
|
+
id?: string;
|
|
4
|
+
status: AggDepositNotificationStatus;
|
|
5
|
+
amount?: string;
|
|
6
|
+
tokenSymbol?: string;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const dispatchAggDepositNotification: (detail: AggDepositNotificationDetail) => void;
|
|
10
|
+
export declare const subscribeAggDepositNotification: (handler: (detail: AggDepositNotificationDetail) => void) => (() => void);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AggDepositNotificationStatus = "completed" | "failed";
|
|
2
|
+
export interface AggDepositNotificationDetail {
|
|
3
|
+
id?: string;
|
|
4
|
+
status: AggDepositNotificationStatus;
|
|
5
|
+
amount?: string;
|
|
6
|
+
tokenSymbol?: string;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const dispatchAggDepositNotification: (detail: AggDepositNotificationDetail) => void;
|
|
10
|
+
export declare const subscribeAggDepositNotification: (handler: (detail: AggDepositNotificationDetail) => void) => (() => void);
|
|
@@ -120,7 +120,7 @@ export interface UserProfilePosition {
|
|
|
120
120
|
/** Winning outcome ids used to redeem closed winning positions. */
|
|
121
121
|
winningOutcomeIds?: string[];
|
|
122
122
|
}
|
|
123
|
-
export type UserProfileActivityKind = "trade" | "withdrawal" | "deposit" | "bridge" | "user_op";
|
|
123
|
+
export type UserProfileActivityKind = "trade" | "redeem" | "withdrawal" | "deposit" | "bridge" | "user_op" | "unknown";
|
|
124
124
|
export interface UserProfileTradeActivity {
|
|
125
125
|
kind: "trade";
|
|
126
126
|
id: string;
|
|
@@ -153,6 +153,32 @@ export interface UserProfileTradeActivity {
|
|
|
153
153
|
/** Time label, e.g. "3d ago" */
|
|
154
154
|
timeLabel: string;
|
|
155
155
|
}
|
|
156
|
+
export interface UserProfileRedeemActivity {
|
|
157
|
+
kind: "redeem";
|
|
158
|
+
id: string;
|
|
159
|
+
/** Whether the activity failed and should render in a degraded state. */
|
|
160
|
+
isFailed?: boolean;
|
|
161
|
+
/** Whether the row should use error-colored text because the activity has an error. */
|
|
162
|
+
hasError?: boolean;
|
|
163
|
+
/** Error message for the activity. */
|
|
164
|
+
errorMessage?: string;
|
|
165
|
+
/** Normalized lifecycle status driving row title and amount rendering. */
|
|
166
|
+
status?: UserProfileActivityStatus;
|
|
167
|
+
/** Activity type label, e.g. "Redeem". */
|
|
168
|
+
type: string;
|
|
169
|
+
/** Status-aware title, e.g. "Successful claim". */
|
|
170
|
+
title: string;
|
|
171
|
+
/** Market thumbnail image URL. */
|
|
172
|
+
thumbnailSrc: string;
|
|
173
|
+
/** Market question shown below the redeem title. */
|
|
174
|
+
marketTitle: string;
|
|
175
|
+
/** Outcome label, e.g. "Down". */
|
|
176
|
+
outcomeLabel: string;
|
|
177
|
+
/** Right-side payout label, e.g. "+20.00 USDC". */
|
|
178
|
+
amountLabel: string;
|
|
179
|
+
/** Time label, e.g. "3d ago". */
|
|
180
|
+
timeLabel: string;
|
|
181
|
+
}
|
|
156
182
|
/**
|
|
157
183
|
* Normalized UI state for activity rows. Backend statuses collapse into
|
|
158
184
|
* one of four buckets so row tone, status icons, titles, and amounts stay
|
|
@@ -161,9 +187,9 @@ export interface UserProfileTradeActivity {
|
|
|
161
187
|
*/
|
|
162
188
|
export type UserProfileActivityStatus = "completed" | "pending" | "failed" | "canceled";
|
|
163
189
|
export type UserProfileTransferStatus = UserProfileActivityStatus;
|
|
164
|
-
/** Non-
|
|
190
|
+
/** Non-market-image activity row: withdrawal / deposit / bridge / user_op / unknown. */
|
|
165
191
|
export interface UserProfileTransferActivity {
|
|
166
|
-
kind: "withdrawal" | "deposit" | "bridge" | "user_op";
|
|
192
|
+
kind: "withdrawal" | "deposit" | "bridge" | "user_op" | "unknown";
|
|
167
193
|
id: string;
|
|
168
194
|
/** Whether the activity failed and should render in a degraded state. */
|
|
169
195
|
isFailed?: boolean;
|
|
@@ -188,7 +214,7 @@ export interface UserProfileTransferActivity {
|
|
|
188
214
|
/** Chain ID for chain-aware deposit icons. */
|
|
189
215
|
chainId?: string | number;
|
|
190
216
|
}
|
|
191
|
-
export type UserProfileActivity = UserProfileTradeActivity | UserProfileTransferActivity;
|
|
217
|
+
export type UserProfileActivity = UserProfileTradeActivity | UserProfileRedeemActivity | UserProfileTransferActivity;
|
|
192
218
|
export interface UserProfileOpenOrder {
|
|
193
219
|
id: string;
|
|
194
220
|
/** Market thumbnail image URL */
|
|
@@ -120,7 +120,7 @@ export interface UserProfilePosition {
|
|
|
120
120
|
/** Winning outcome ids used to redeem closed winning positions. */
|
|
121
121
|
winningOutcomeIds?: string[];
|
|
122
122
|
}
|
|
123
|
-
export type UserProfileActivityKind = "trade" | "withdrawal" | "deposit" | "bridge" | "user_op";
|
|
123
|
+
export type UserProfileActivityKind = "trade" | "redeem" | "withdrawal" | "deposit" | "bridge" | "user_op" | "unknown";
|
|
124
124
|
export interface UserProfileTradeActivity {
|
|
125
125
|
kind: "trade";
|
|
126
126
|
id: string;
|
|
@@ -153,6 +153,32 @@ export interface UserProfileTradeActivity {
|
|
|
153
153
|
/** Time label, e.g. "3d ago" */
|
|
154
154
|
timeLabel: string;
|
|
155
155
|
}
|
|
156
|
+
export interface UserProfileRedeemActivity {
|
|
157
|
+
kind: "redeem";
|
|
158
|
+
id: string;
|
|
159
|
+
/** Whether the activity failed and should render in a degraded state. */
|
|
160
|
+
isFailed?: boolean;
|
|
161
|
+
/** Whether the row should use error-colored text because the activity has an error. */
|
|
162
|
+
hasError?: boolean;
|
|
163
|
+
/** Error message for the activity. */
|
|
164
|
+
errorMessage?: string;
|
|
165
|
+
/** Normalized lifecycle status driving row title and amount rendering. */
|
|
166
|
+
status?: UserProfileActivityStatus;
|
|
167
|
+
/** Activity type label, e.g. "Redeem". */
|
|
168
|
+
type: string;
|
|
169
|
+
/** Status-aware title, e.g. "Successful claim". */
|
|
170
|
+
title: string;
|
|
171
|
+
/** Market thumbnail image URL. */
|
|
172
|
+
thumbnailSrc: string;
|
|
173
|
+
/** Market question shown below the redeem title. */
|
|
174
|
+
marketTitle: string;
|
|
175
|
+
/** Outcome label, e.g. "Down". */
|
|
176
|
+
outcomeLabel: string;
|
|
177
|
+
/** Right-side payout label, e.g. "+20.00 USDC". */
|
|
178
|
+
amountLabel: string;
|
|
179
|
+
/** Time label, e.g. "3d ago". */
|
|
180
|
+
timeLabel: string;
|
|
181
|
+
}
|
|
156
182
|
/**
|
|
157
183
|
* Normalized UI state for activity rows. Backend statuses collapse into
|
|
158
184
|
* one of four buckets so row tone, status icons, titles, and amounts stay
|
|
@@ -161,9 +187,9 @@ export interface UserProfileTradeActivity {
|
|
|
161
187
|
*/
|
|
162
188
|
export type UserProfileActivityStatus = "completed" | "pending" | "failed" | "canceled";
|
|
163
189
|
export type UserProfileTransferStatus = UserProfileActivityStatus;
|
|
164
|
-
/** Non-
|
|
190
|
+
/** Non-market-image activity row: withdrawal / deposit / bridge / user_op / unknown. */
|
|
165
191
|
export interface UserProfileTransferActivity {
|
|
166
|
-
kind: "withdrawal" | "deposit" | "bridge" | "user_op";
|
|
192
|
+
kind: "withdrawal" | "deposit" | "bridge" | "user_op" | "unknown";
|
|
167
193
|
id: string;
|
|
168
194
|
/** Whether the activity failed and should render in a degraded state. */
|
|
169
195
|
isFailed?: boolean;
|
|
@@ -188,7 +214,7 @@ export interface UserProfileTransferActivity {
|
|
|
188
214
|
/** Chain ID for chain-aware deposit icons. */
|
|
189
215
|
chainId?: string | number;
|
|
190
216
|
}
|
|
191
|
-
export type UserProfileActivity = UserProfileTradeActivity | UserProfileTransferActivity;
|
|
217
|
+
export type UserProfileActivity = UserProfileTradeActivity | UserProfileRedeemActivity | UserProfileTransferActivity;
|
|
192
218
|
export interface UserProfileOpenOrder {
|
|
193
219
|
id: string;
|
|
194
220
|
/** Market thumbnail image URL */
|
|
@@ -15,4 +15,8 @@ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "childre
|
|
|
15
15
|
prefix?: JSX.Element | FC | ReactNode;
|
|
16
16
|
/** Optional content rendered after the button label. */
|
|
17
17
|
suffix?: JSX.Element | FC | ReactNode;
|
|
18
|
+
classNames?: {
|
|
19
|
+
root?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
};
|
|
18
22
|
};
|
|
@@ -15,4 +15,8 @@ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "childre
|
|
|
15
15
|
prefix?: JSX.Element | FC | ReactNode;
|
|
16
16
|
/** Optional content rendered after the button label. */
|
|
17
17
|
suffix?: JSX.Element | FC | ReactNode;
|
|
18
|
+
classNames?: {
|
|
19
|
+
root?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
};
|
|
18
22
|
};
|
|
@@ -2,6 +2,6 @@ import type { ButtonProps } from "./button.types";
|
|
|
2
2
|
export type { ButtonProps, ButtonSize, ButtonVariant } from "./button.types";
|
|
3
3
|
/** Renders a themed action button with loading state, sizing variants, and optional icon slots. */
|
|
4
4
|
export declare const Button: {
|
|
5
|
-
({ children, variant, size, isLoading, disabled, prefix, suffix, type, className, "aria-label": ariaLabel, ...other }: ButtonProps): JSX.Element;
|
|
5
|
+
({ children, variant, size, isLoading, disabled, prefix, suffix, type, className, classNames, "aria-label": ariaLabel, ...other }: ButtonProps): JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|
|
@@ -2,6 +2,6 @@ import type { ButtonProps } from "./button.types";
|
|
|
2
2
|
export type { ButtonProps, ButtonSize, ButtonVariant } from "./button.types";
|
|
3
3
|
/** Renders a themed action button with loading state, sizing variants, and optional icon slots. */
|
|
4
4
|
export declare const Button: {
|
|
5
|
-
({ children, variant, size, isLoading, disabled, prefix, suffix, type, className, "aria-label": ariaLabel, ...other }: ButtonProps): JSX.Element;
|
|
5
|
+
({ children, variant, size, isLoading, disabled, prefix, suffix, type, className, classNames, "aria-label": ariaLabel, ...other }: ButtonProps): JSX.Element;
|
|
6
6
|
displayName: string;
|
|
7
7
|
};
|