@agg-build/ui 1.0.1 → 1.1.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 (80) hide show
  1. package/dist/{chunk-5ES2VJHO.mjs → chunk-7JEJIGG4.mjs} +162 -253
  2. package/dist/{chunk-BYMLPLEZ.mjs → chunk-F3SU7BRE.mjs} +10 -10
  3. package/dist/{chunk-WLXYCBZV.mjs → chunk-IT2Y62MG.mjs} +31 -35
  4. package/dist/{chunk-43K4PFBC.mjs → chunk-JDYZJKTE.mjs} +2 -2
  5. package/dist/{chunk-HD6HBTK2.mjs → chunk-KDMNFHPL.mjs} +369 -19
  6. package/dist/{chunk-LPNZOX3E.mjs → chunk-OHEZGKFM.mjs} +443 -884
  7. package/dist/{chunk-YZNO6IUD.mjs → chunk-R6DETAZ6.mjs} +1343 -1173
  8. package/dist/events.js +1886 -1545
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +3748 -3707
  11. package/dist/index.mjs +191 -118
  12. package/dist/modals.js +1042 -943
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +2822 -2864
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +1322 -1166
  17. package/dist/primitives.mjs +9 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +3770 -3718
  21. package/dist/trading.mjs +10 -12
  22. package/dist/types/events/item-details/settlement-summary.d.mts +6 -2
  23. package/dist/types/events/item-details/settlement-summary.d.ts +6 -2
  24. package/dist/types/events/list/event-list.types.d.mts +1 -1
  25. package/dist/types/events/list/event-list.types.d.ts +1 -1
  26. package/dist/types/events/list/event-list.utils.d.mts +1 -1
  27. package/dist/types/events/list/event-list.utils.d.ts +1 -1
  28. package/dist/types/pages/event-market/event-market.types.d.mts +1 -3
  29. package/dist/types/pages/event-market/event-market.types.d.ts +1 -3
  30. package/dist/types/pages/user-profile/components/available-balance-card.d.mts +0 -1
  31. package/dist/types/pages/user-profile/components/available-balance-card.d.ts +0 -1
  32. package/dist/types/primitives/icon/icon.types.d.mts +1 -2
  33. package/dist/types/primitives/icon/icon.types.d.ts +1 -2
  34. package/dist/types/primitives/icon/index.d.mts +4 -1
  35. package/dist/types/primitives/icon/index.d.ts +4 -1
  36. package/dist/types/primitives/icon/registry.d.mts +12 -0
  37. package/dist/types/primitives/icon/registry.d.ts +12 -0
  38. package/dist/types/primitives/icon/svg/apps.d.mts +5 -0
  39. package/dist/types/primitives/icon/svg/apps.d.ts +5 -0
  40. package/dist/types/primitives/icon/svg/circle-overlap.d.mts +5 -0
  41. package/dist/types/primitives/icon/svg/circle-overlap.d.ts +5 -0
  42. package/dist/types/primitives/icon/svg/lock.d.mts +5 -0
  43. package/dist/types/primitives/icon/svg/lock.d.ts +5 -0
  44. package/dist/types/primitives/select/index.d.mts +1 -1
  45. package/dist/types/primitives/select/index.d.ts +1 -1
  46. package/dist/types/primitives/select/select.types.d.mts +1 -1
  47. package/dist/types/primitives/select/select.types.d.ts +1 -1
  48. package/dist/types/primitives/select/select.utils.d.mts +0 -1
  49. package/dist/types/primitives/select/select.utils.d.ts +0 -1
  50. package/dist/types/primitives/skeleton/index.d.mts +2 -1
  51. package/dist/types/primitives/skeleton/index.d.ts +2 -1
  52. package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.mts +4 -0
  53. package/dist/types/primitives/skeleton/views/place-order-skeleton-view.d.ts +4 -0
  54. package/dist/types/primitives/typography/index.d.mts +1 -1
  55. package/dist/types/primitives/typography/index.d.ts +1 -1
  56. package/dist/types/primitives/typography/typography.types.d.mts +3 -1
  57. package/dist/types/primitives/typography/typography.types.d.ts +3 -1
  58. package/dist/types/shared/utils.d.mts +3 -1
  59. package/dist/types/shared/utils.d.ts +3 -1
  60. package/dist/types/trading/index.d.mts +0 -1
  61. package/dist/types/trading/index.d.ts +0 -1
  62. package/dist/types/trading/place-order/index.place-order.types.d.mts +0 -1
  63. package/dist/types/trading/place-order/index.place-order.types.d.ts +0 -1
  64. package/dist/types/trading/place-order/index.place-order.utils.d.mts +0 -4
  65. package/dist/types/trading/place-order/index.place-order.utils.d.ts +0 -4
  66. package/dist/types/trading/settlement/index.d.mts +9 -6
  67. package/dist/types/trading/settlement/index.d.ts +9 -6
  68. package/dist/types/trading/settlement/settlement-text-renderer.d.mts +8 -0
  69. package/dist/types/trading/settlement/settlement-text-renderer.d.ts +8 -0
  70. package/dist/types/trading/settlement/settlement-text.utils.d.mts +36 -0
  71. package/dist/types/trading/settlement/settlement-text.utils.d.ts +36 -0
  72. package/dist/types/trading/types.d.mts +0 -19
  73. package/dist/types/trading/types.d.ts +0 -19
  74. package/dist/types/trading/utils.d.mts +0 -1
  75. package/dist/types/trading/utils.d.ts +0 -1
  76. package/package.json +3 -3
  77. package/dist/types/primitives/card/card.constants.d.mts +0 -4
  78. package/dist/types/primitives/card/card.constants.d.ts +0 -4
  79. package/dist/types/trading/settlement/settlement-details.utils.d.mts +0 -7
  80. package/dist/types/trading/settlement/settlement-details.utils.d.ts +0 -7
@@ -1,12 +1,15 @@
1
- import type { SettlementViewModel, TradingVenue } from "../types";
2
- export type SettlementProps = SettlementViewModel & {
1
+ export declare const SETTLEMENT_SECTION_ID = "agg-settlement-section";
2
+ export type SettlementProps = {
3
3
  className?: string;
4
- expandedVenue?: TradingVenue | null;
4
+ id?: string;
5
+ sectionLabel?: string;
6
+ question?: string;
7
+ eventDescription?: string | null;
8
+ marketDescription?: string | null;
9
+ primaryRules?: string | null;
5
10
  isLoading?: boolean;
6
- onExpandedVenueChange?: (venue: TradingVenue | null) => void;
7
- onShowMore?: (venue: TradingVenue) => void;
8
11
  };
9
12
  export declare const Settlement: {
10
- ({ sectionLabel, question, differencesTitle, differences, venues, expandedVenue, isLoading, onExpandedVenueChange, onShowMore, className, }: SettlementProps): JSX.Element;
13
+ ({ className, id, sectionLabel, question, eventDescription, marketDescription, primaryRules, isLoading, }: SettlementProps): JSX.Element;
11
14
  displayName: string;
12
15
  };
@@ -0,0 +1,8 @@
1
+ export type SettlementTextRendererProps = {
2
+ content: string;
3
+ className?: string;
4
+ };
5
+ export declare const SettlementTextRenderer: {
6
+ ({ content, className, }: SettlementTextRendererProps): JSX.Element | null;
7
+ displayName: string;
8
+ };
@@ -0,0 +1,8 @@
1
+ export type SettlementTextRendererProps = {
2
+ content: string;
3
+ className?: string;
4
+ };
5
+ export declare const SettlementTextRenderer: {
6
+ ({ content, className, }: SettlementTextRendererProps): JSX.Element | null;
7
+ displayName: string;
8
+ };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Helpers used only by the Settlement / SettlementSummary surface to parse and
3
+ * normalize settlement-related text (event description, market description,
4
+ * primary rules). Not intended for use elsewhere.
5
+ */
6
+ export type SettlementBlock = {
7
+ kind: "paragraph";
8
+ lines: string[];
9
+ } | {
10
+ kind: "list";
11
+ items: string[];
12
+ };
13
+ export declare const parseSettlementBlocks: (input: string) => SettlementBlock[];
14
+ /**
15
+ * Returns the first non-empty paragraph from the input — used by
16
+ * SettlementSummary to show only a teaser of the event description.
17
+ */
18
+ export declare const getFirstSettlementParagraph: (input: string | null | undefined) => string;
19
+ /** Lower-cased, whitespace-collapsed form used for dedup comparisons. */
20
+ export declare const normalizeSettlementForCompare: (input: string) => string;
21
+ export type SettlementSourceInput = {
22
+ eventDescription?: string | null;
23
+ marketDescription?: string | null;
24
+ primaryRules?: string | null;
25
+ };
26
+ export type SettlementSourceKey = "eventDescription" | "marketDescription" | "primaryRules";
27
+ export type SettlementSourceBlock = {
28
+ key: SettlementSourceKey;
29
+ content: string;
30
+ };
31
+ /**
32
+ * Produces the ordered list of non-empty settlement blocks for the Settlement
33
+ * section, dropping any source whose normalized text is identical to a block
34
+ * already included.
35
+ */
36
+ export declare const dedupeSettlementSources: (sources: SettlementSourceInput) => SettlementSourceBlock[];
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Helpers used only by the Settlement / SettlementSummary surface to parse and
3
+ * normalize settlement-related text (event description, market description,
4
+ * primary rules). Not intended for use elsewhere.
5
+ */
6
+ export type SettlementBlock = {
7
+ kind: "paragraph";
8
+ lines: string[];
9
+ } | {
10
+ kind: "list";
11
+ items: string[];
12
+ };
13
+ export declare const parseSettlementBlocks: (input: string) => SettlementBlock[];
14
+ /**
15
+ * Returns the first non-empty paragraph from the input — used by
16
+ * SettlementSummary to show only a teaser of the event description.
17
+ */
18
+ export declare const getFirstSettlementParagraph: (input: string | null | undefined) => string;
19
+ /** Lower-cased, whitespace-collapsed form used for dedup comparisons. */
20
+ export declare const normalizeSettlementForCompare: (input: string) => string;
21
+ export type SettlementSourceInput = {
22
+ eventDescription?: string | null;
23
+ marketDescription?: string | null;
24
+ primaryRules?: string | null;
25
+ };
26
+ export type SettlementSourceKey = "eventDescription" | "marketDescription" | "primaryRules";
27
+ export type SettlementSourceBlock = {
28
+ key: SettlementSourceKey;
29
+ content: string;
30
+ };
31
+ /**
32
+ * Produces the ordered list of non-empty settlement blocks for the Settlement
33
+ * section, dropping any source whose normalized text is identical to a block
34
+ * already included.
35
+ */
36
+ export declare const dedupeSettlementSources: (sources: SettlementSourceInput) => SettlementSourceBlock[];
@@ -4,25 +4,6 @@ export type TradingVenue = Venue;
4
4
  export declare const parseVenue: (v: unknown) => import("@agg-build/sdk").SafeParseResult<Venue>;
5
5
  /** safeParse-compatible finite non-negative number check. */
6
6
  export declare const parseAmount: (v: unknown) => import("@agg-build/sdk").SafeParseResult<number>;
7
- export interface SettlementVenueItem {
8
- marketId: string;
9
- venue: TradingVenue;
10
- label?: string;
11
- description: string;
12
- showMoreLabel?: string;
13
- }
14
- export interface SettlementViewModel {
15
- sectionLabel?: string;
16
- question?: string;
17
- differencesTitle?: string;
18
- differences?: string[];
19
- venues: SettlementVenueItem[];
20
- }
21
- export interface SettlementSection {
22
- key: string;
23
- label: string;
24
- venues: SettlementVenueItem[];
25
- }
26
7
  export type PlaceOrderTab = "buy" | "sell";
27
8
  export type PlaceOrderStatusTone = "warning" | "error";
28
9
  export type PlaceOrderStatusPlacement = "above-action" | "below-action";
@@ -4,25 +4,6 @@ export type TradingVenue = Venue;
4
4
  export declare const parseVenue: (v: unknown) => import("@agg-build/sdk").SafeParseResult<Venue>;
5
5
  /** safeParse-compatible finite non-negative number check. */
6
6
  export declare const parseAmount: (v: unknown) => import("@agg-build/sdk").SafeParseResult<number>;
7
- export interface SettlementVenueItem {
8
- marketId: string;
9
- venue: TradingVenue;
10
- label?: string;
11
- description: string;
12
- showMoreLabel?: string;
13
- }
14
- export interface SettlementViewModel {
15
- sectionLabel?: string;
16
- question?: string;
17
- differencesTitle?: string;
18
- differences?: string[];
19
- venues: SettlementVenueItem[];
20
- }
21
- export interface SettlementSection {
22
- key: string;
23
- label: string;
24
- venues: SettlementVenueItem[];
25
- }
26
7
  export type PlaceOrderTab = "buy" | "sell";
27
8
  export type PlaceOrderStatusTone = "warning" | "error";
28
9
  export type PlaceOrderStatusPlacement = "above-action" | "below-action";
@@ -1,6 +1,5 @@
1
1
  import type { TradingVenue } from "./types";
2
2
  export declare const defaultSettlementSectionLabel: string;
3
- export declare const defaultSettlementDifferencesTitle: string;
4
3
  export declare const defaultTradingDisclaimer: string;
5
4
  export declare const getTradingDateLabel: (value: string | Date) => string;
6
5
  export declare const getTradingVenueLabel: (venue: TradingVenue | undefined, label?: string) => string;
@@ -1,6 +1,5 @@
1
1
  import type { TradingVenue } from "./types";
2
2
  export declare const defaultSettlementSectionLabel: string;
3
- export declare const defaultSettlementDifferencesTitle: string;
4
3
  export declare const defaultTradingDisclaimer: string;
5
4
  export declare const getTradingDateLabel: (value: string | Date) => string;
6
5
  export declare const getTradingVenueLabel: (venue: TradingVenue | undefined, label?: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/ui",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
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,8 +100,8 @@
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": "^1.0.1",
104
- "@agg-build/sdk": "^1.0.1"
103
+ "@agg-build/sdk": "^1.0.1",
104
+ "@agg-build/hooks": "^1.0.2"
105
105
  },
106
106
  "dependencies": {
107
107
  "@number-flow/react": "^0.6.0",
@@ -1,4 +0,0 @@
1
- export declare const CARD_BASE_CLASS_NAME = "group/agg-card relative flex w-full flex-col font-agg-sans rounded-[calc(var(--agg-radius-xl)-1px)] bg-agg-secondary text-agg-foreground shadow-agg-card";
2
- export declare const CARD_HOVER_TRANSITION_CLASS_NAME = "transition-shadow hover:shadow-agg-card-hover duration-300 ease-in-out";
3
- export declare const CARD_GRADIENT_WRAPPER_CLASS_NAME = "group/agg-card-gradient rounded-agg-xl p-[1px] relative bg-agg-separator";
4
- export declare const CARD_GRADIENT_OVERLAY_CLASS_NAME = "absolute inset-0 rounded-agg-xl bg-gradient-to-b from-agg-separator to-agg-primary opacity-0 group-hover/agg-card-gradient:opacity-100 transition-opacity duration-200 ease-in-out pointer-events-none";
@@ -1,4 +0,0 @@
1
- export declare const CARD_BASE_CLASS_NAME = "group/agg-card relative flex w-full flex-col font-agg-sans rounded-[calc(var(--agg-radius-xl)-1px)] bg-agg-secondary text-agg-foreground shadow-agg-card";
2
- export declare const CARD_HOVER_TRANSITION_CLASS_NAME = "transition-shadow hover:shadow-agg-card-hover duration-300 ease-in-out";
3
- export declare const CARD_GRADIENT_WRAPPER_CLASS_NAME = "group/agg-card-gradient rounded-agg-xl p-[1px] relative bg-agg-separator";
4
- export declare const CARD_GRADIENT_OVERLAY_CLASS_NAME = "absolute inset-0 rounded-agg-xl bg-gradient-to-b from-agg-separator to-agg-primary opacity-0 group-hover/agg-card-gradient:opacity-100 transition-opacity duration-200 ease-in-out pointer-events-none";
@@ -1,7 +0,0 @@
1
- import type { AggUiLabels, VenueMarket } from "@agg-build/hooks";
2
- import type { SettlementSection } from "../types";
3
- /**
4
- * Maps venue markets to settlement sections, filtering out sections
5
- * where no venue has meaningful content for that field.
6
- */
7
- export declare function mapVenueMarketsToSettlementSections(venueMarkets: VenueMarket[], labels: AggUiLabels, selectedMarketId?: string): SettlementSection[];
@@ -1,7 +0,0 @@
1
- import type { AggUiLabels, VenueMarket } from "@agg-build/hooks";
2
- import type { SettlementSection } from "../types";
3
- /**
4
- * Maps venue markets to settlement sections, filtering out sections
5
- * where no venue has meaningful content for that field.
6
- */
7
- export declare function mapVenueMarketsToSettlementSections(venueMarkets: VenueMarket[], labels: AggUiLabels, selectedMarketId?: string): SettlementSection[];