@agg-market/ui 7.0.0 → 9.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 (75) hide show
  1. package/dist/{chunk-MUB7NYWZ.mjs → chunk-3G7C6WEC.mjs} +3453 -990
  2. package/dist/{chunk-KQKLLL4D.mjs → chunk-3U4VHAP6.mjs} +8 -11
  3. package/dist/{chunk-6I474QXG.mjs → chunk-6CRY27SQ.mjs} +92 -65
  4. package/dist/{chunk-L5U7RGJV.mjs → chunk-HJ4UPYM7.mjs} +22 -23
  5. package/dist/{chunk-AVHMI47G.mjs → chunk-N7U7QCSB.mjs} +5 -6
  6. package/dist/events.js +2904 -2756
  7. package/dist/events.mjs +2 -4
  8. package/dist/index.js +1594 -1438
  9. package/dist/index.mjs +26 -32
  10. package/dist/modals.js +821 -687
  11. package/dist/modals.mjs +2 -3
  12. package/dist/pages.js +2145 -1993
  13. package/dist/pages.mjs +4 -7
  14. package/dist/primitives.js +417 -293
  15. package/dist/primitives.mjs +22 -28
  16. package/dist/styles.css +1 -1
  17. package/dist/tailwind.css +1 -1
  18. package/dist/trading.js +564 -451
  19. package/dist/trading.mjs +2 -4
  20. package/dist/types/events/item/event-list-item.types.d.mts +5 -2
  21. package/dist/types/events/item/event-list-item.types.d.ts +5 -2
  22. package/dist/types/events/item/event-list-item.utils.d.mts +5 -5
  23. package/dist/types/events/item/event-list-item.utils.d.ts +5 -5
  24. package/dist/types/events/item/index.d.mts +1 -1
  25. package/dist/types/events/item/index.d.ts +1 -1
  26. package/dist/types/events/item-details/event-list-item-details.types.d.mts +4 -3
  27. package/dist/types/events/item-details/event-list-item-details.types.d.ts +4 -3
  28. package/dist/types/events/list/event-list.types.d.mts +4 -4
  29. package/dist/types/events/list/event-list.types.d.ts +4 -4
  30. package/dist/types/events/list/event-list.utils.d.mts +5 -5
  31. package/dist/types/events/list/event-list.utils.d.ts +5 -5
  32. package/dist/types/events/market-details/market-details.types.d.mts +5 -3
  33. package/dist/types/events/market-details/market-details.types.d.ts +5 -3
  34. package/dist/types/events/market-details/market-details.utils.d.mts +16 -5
  35. package/dist/types/events/market-details/market-details.utils.d.ts +16 -5
  36. package/dist/types/onramp/index.d.mts +6 -0
  37. package/dist/types/onramp/index.d.ts +6 -0
  38. package/dist/types/onramp/onramp-modal.constants.d.mts +9 -0
  39. package/dist/types/onramp/onramp-modal.constants.d.ts +9 -0
  40. package/dist/types/onramp/onramp-modal.types.d.mts +64 -0
  41. package/dist/types/onramp/onramp-modal.types.d.ts +64 -0
  42. package/dist/types/onramp/steps/quote-card.d.mts +8 -0
  43. package/dist/types/onramp/steps/quote-card.d.ts +8 -0
  44. package/dist/types/onramp/steps/quote-form.d.mts +12 -0
  45. package/dist/types/onramp/steps/quote-form.d.ts +12 -0
  46. package/dist/types/onramp/steps/quote-selection.d.mts +14 -0
  47. package/dist/types/onramp/steps/quote-selection.d.ts +14 -0
  48. package/dist/types/onramp/steps/widget.d.mts +7 -0
  49. package/dist/types/onramp/steps/widget.d.ts +7 -0
  50. package/dist/types/pages/event-market/event-market.types.d.mts +2 -2
  51. package/dist/types/pages/event-market/event-market.types.d.ts +2 -2
  52. package/dist/types/primitives/chart/index.d.mts +10 -1
  53. package/dist/types/primitives/chart/index.d.ts +10 -1
  54. package/dist/types/primitives/icon/index.d.mts +2 -1
  55. package/dist/types/primitives/icon/index.d.ts +2 -1
  56. package/dist/types/primitives/icon/registry.d.mts +4 -0
  57. package/dist/types/primitives/icon/registry.d.ts +4 -0
  58. package/dist/types/primitives/icon/svg/image.d.mts +5 -0
  59. package/dist/types/primitives/icon/svg/image.d.ts +5 -0
  60. package/dist/types/primitives/index.d.mts +1 -0
  61. package/dist/types/primitives/index.d.ts +1 -0
  62. package/dist/types/primitives/remote-image/index.d.mts +6 -0
  63. package/dist/types/primitives/remote-image/index.d.ts +6 -0
  64. package/dist/types/primitives/remote-image/remote-image.constants.d.mts +4 -0
  65. package/dist/types/primitives/remote-image/remote-image.constants.d.ts +4 -0
  66. package/dist/types/primitives/remote-image/remote-image.types.d.mts +16 -0
  67. package/dist/types/primitives/remote-image/remote-image.types.d.ts +16 -0
  68. package/dist/types/trading/types.d.mts +2 -2
  69. package/dist/types/trading/types.d.ts +2 -2
  70. package/package.json +1 -1
  71. package/dist/chunk-EEQPPN7N.mjs +0 -214
  72. package/dist/chunk-EERL6BZF.mjs +0 -997
  73. package/dist/chunk-OAJBTVZT.mjs +0 -119
  74. package/dist/chunk-OVQVAUAI.mjs +0 -420
  75. package/dist/chunk-ZYUJ7YEJ.mjs +0 -645
@@ -1,4 +1,4 @@
1
- import type { Event } from "@agg-market/hooks";
1
+ import type { VenueEventWithMarkets } from "../../events/item/event-list-item.types";
2
2
  import type { PlaceOrderViewModel, SettlementViewModel } from "../../trading/types";
3
3
  import type { EventListItemDetailsTimeRange } from "../../events/item-details/event-list-item-details.types";
4
4
  export type EventMarketPageClassNames = Partial<{
@@ -30,7 +30,7 @@ export type EventMarketPageLoadingProps = EventMarketPageBaseProps & {
30
30
  eventId?: string;
31
31
  };
32
32
  export type EventMarketPageWithEventProps = EventMarketPageBaseProps & {
33
- event: Event;
33
+ event: VenueEventWithMarkets;
34
34
  eventId?: string;
35
35
  isLoading?: false;
36
36
  };
@@ -1,4 +1,4 @@
1
- import type { Event } from "@agg-market/hooks";
1
+ import type { VenueEventWithMarkets } from "../../events/item/event-list-item.types";
2
2
  import type { PlaceOrderViewModel, SettlementViewModel } from "../../trading/types";
3
3
  import type { EventListItemDetailsTimeRange } from "../../events/item-details/event-list-item-details.types";
4
4
  export type EventMarketPageClassNames = Partial<{
@@ -30,7 +30,7 @@ export type EventMarketPageLoadingProps = EventMarketPageBaseProps & {
30
30
  eventId?: string;
31
31
  };
32
32
  export type EventMarketPageWithEventProps = EventMarketPageBaseProps & {
33
- event: Event;
33
+ event: VenueEventWithMarkets;
34
34
  eventId?: string;
35
35
  isLoading?: false;
36
36
  };
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
+ import { type CandlePoint, type LivelinePoint } from "liveline";
2
3
  export type LineChartPoint = {
3
4
  time: number;
4
5
  value: number;
@@ -29,6 +30,14 @@ export type LineChartProps = {
29
30
  chartType?: LineChartType;
30
31
  showSeriesControls?: boolean;
31
32
  renderSeriesControls?: (props: LineChartSeriesControlsRenderProps) => ReactNode;
33
+ /** Live forming candle (updates in real-time, not yet closed). */
34
+ liveCandle?: CandlePoint;
35
+ /** Live line overlay data (e.g., real-time price series). */
36
+ lineData?: LivelinePoint[];
37
+ /** Live line overlay current value. */
38
+ lineValue?: number;
39
+ /** Enable live visual effects (momentum particles + pulse animation). */
40
+ live?: boolean;
32
41
  };
33
42
  export type LineChartClassNames = {
34
43
  root?: string;
@@ -38,6 +47,6 @@ export type LineChartClassNames = {
38
47
  liveline?: string;
39
48
  };
40
49
  export declare const LineChart: {
41
- ({ series, height, width, classNames, isLoading, chartType, showSeriesControls, renderSeriesControls, }: LineChartProps): JSX.Element;
50
+ ({ series, height, width, classNames, isLoading, chartType, showSeriesControls, renderSeriesControls, liveCandle: liveForming, lineData, lineValue, live, }: LineChartProps): JSX.Element;
42
51
  displayName: string;
43
52
  };
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
+ import { type CandlePoint, type LivelinePoint } from "liveline";
2
3
  export type LineChartPoint = {
3
4
  time: number;
4
5
  value: number;
@@ -29,6 +30,14 @@ export type LineChartProps = {
29
30
  chartType?: LineChartType;
30
31
  showSeriesControls?: boolean;
31
32
  renderSeriesControls?: (props: LineChartSeriesControlsRenderProps) => ReactNode;
33
+ /** Live forming candle (updates in real-time, not yet closed). */
34
+ liveCandle?: CandlePoint;
35
+ /** Live line overlay data (e.g., real-time price series). */
36
+ lineData?: LivelinePoint[];
37
+ /** Live line overlay current value. */
38
+ lineValue?: number;
39
+ /** Enable live visual effects (momentum particles + pulse animation). */
40
+ live?: boolean;
32
41
  };
33
42
  export type LineChartClassNames = {
34
43
  root?: string;
@@ -38,6 +47,6 @@ export type LineChartClassNames = {
38
47
  liveline?: string;
39
48
  };
40
49
  export declare const LineChart: {
41
- ({ series, height, width, classNames, isLoading, chartType, showSeriesControls, renderSeriesControls, }: LineChartProps): JSX.Element;
50
+ ({ series, height, width, classNames, isLoading, chartType, showSeriesControls, renderSeriesControls, liveCandle: liveForming, lineData, lineValue, live, }: LineChartProps): JSX.Element;
42
51
  displayName: string;
43
52
  };
@@ -23,6 +23,7 @@ import { ErrorFilledIcon } from "./svg/error-filled";
23
23
  import { ExternalLinkIcon } from "./svg/external-link";
24
24
  import { EthereumIcon } from "./svg/ethereum";
25
25
  import { GoogleIcon } from "./svg/google";
26
+ import { ImageIcon } from "./svg/image";
26
27
  import { InfoIcon } from "./svg/info";
27
28
  import { iconNames } from "./registry";
28
29
  import { LinkAccountsIcon } from "./svg/link-accounts";
@@ -50,4 +51,4 @@ export declare const Icon: {
50
51
  ({ name, color, size, className, style, ...props }: IconProps): JSX.Element;
51
52
  displayName: string;
52
53
  };
53
- export { AppleIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BestPricesIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, GoogleIcon, iconNames, InfoIcon, LinkAccountsIcon, PencilIcon, PlaySquareIcon, ProfileIcon, RevenueAltIcon, SearchIcon, ShieldTrustIcon, SolanaIcon, StayInControlIcon, TriangleDownIcon, TriangleUpFilledIcon, TriangleUpIcon, UploadIcon, WalletAvatarIcon, WalletIcon, WarningFilledIcon, WarningIcon, };
54
+ export { AppleIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BestPricesIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, GoogleIcon, iconNames, ImageIcon, InfoIcon, LinkAccountsIcon, PencilIcon, PlaySquareIcon, ProfileIcon, RevenueAltIcon, SearchIcon, ShieldTrustIcon, SolanaIcon, StayInControlIcon, TriangleDownIcon, TriangleUpFilledIcon, TriangleUpIcon, UploadIcon, WalletAvatarIcon, WalletIcon, WarningFilledIcon, WarningIcon, };
@@ -23,6 +23,7 @@ import { ErrorFilledIcon } from "./svg/error-filled";
23
23
  import { ExternalLinkIcon } from "./svg/external-link";
24
24
  import { EthereumIcon } from "./svg/ethereum";
25
25
  import { GoogleIcon } from "./svg/google";
26
+ import { ImageIcon } from "./svg/image";
26
27
  import { InfoIcon } from "./svg/info";
27
28
  import { iconNames } from "./registry";
28
29
  import { LinkAccountsIcon } from "./svg/link-accounts";
@@ -50,4 +51,4 @@ export declare const Icon: {
50
51
  ({ name, color, size, className, style, ...props }: IconProps): JSX.Element;
51
52
  displayName: string;
52
53
  };
53
- export { AppleIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BestPricesIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, GoogleIcon, iconNames, InfoIcon, LinkAccountsIcon, PencilIcon, PlaySquareIcon, ProfileIcon, RevenueAltIcon, SearchIcon, ShieldTrustIcon, SolanaIcon, StayInControlIcon, TriangleDownIcon, TriangleUpFilledIcon, TriangleUpIcon, UploadIcon, WalletAvatarIcon, WalletIcon, WarningFilledIcon, WarningIcon, };
54
+ export { AppleIcon, ArrowTrendUpIcon, ArrowsToDotIcon, BankIcon, BestPricesIcon, BoltIcon, CheckCircleIcon, ChartCandlestickIcon, ChartLineIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, CopyIcon, CreateAccountIcon, CreditCardIcon, DisconnectIcon, DotsHorizontalIcon, DocumentIcon, DownloadIcon, ErrorFilledIcon, EthereumIcon, ExternalLinkIcon, GoogleIcon, iconNames, ImageIcon, InfoIcon, LinkAccountsIcon, PencilIcon, PlaySquareIcon, ProfileIcon, RevenueAltIcon, SearchIcon, ShieldTrustIcon, SolanaIcon, StayInControlIcon, TriangleDownIcon, TriangleUpFilledIcon, TriangleUpIcon, UploadIcon, WalletAvatarIcon, WalletIcon, WarningFilledIcon, WarningIcon, };
@@ -112,6 +112,10 @@ export declare const iconRegistry: {
112
112
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
113
113
  displayName: string;
114
114
  };
115
+ readonly image: {
116
+ ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
117
+ displayName: string;
118
+ };
115
119
  readonly info: {
116
120
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
117
121
  displayName: string;
@@ -112,6 +112,10 @@ export declare const iconRegistry: {
112
112
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
113
113
  displayName: string;
114
114
  };
115
+ readonly image: {
116
+ ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
117
+ displayName: string;
118
+ };
115
119
  readonly info: {
116
120
  ({ title, className, ...props }: import("./types").IconSvgProps): JSX.Element;
117
121
  displayName: string;
@@ -0,0 +1,5 @@
1
+ import type { IconSvgProps } from "../types";
2
+ export declare const ImageIcon: {
3
+ ({ title, className, ...props }: IconSvgProps): JSX.Element;
4
+ displayName: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ import type { IconSvgProps } from "../types";
2
+ export declare const ImageIcon: {
3
+ ({ title, className, ...props }: IconSvgProps): JSX.Element;
4
+ displayName: string;
5
+ };
@@ -16,3 +16,4 @@ export * from "./search";
16
16
  export * from "./state-message";
17
17
  export * from "./tabs";
18
18
  export * from "./modal";
19
+ export * from "./remote-image";
@@ -16,3 +16,4 @@ export * from "./search";
16
16
  export * from "./state-message";
17
17
  export * from "./tabs";
18
18
  export * from "./modal";
19
+ export * from "./remote-image";
@@ -0,0 +1,6 @@
1
+ import type { RemoteImageProps, RemoteImageStatus } from "./remote-image.types";
2
+ export type { RemoteImageProps, RemoteImageStatus };
3
+ export declare const RemoteImage: {
4
+ ({ src, alt, title, className, classNames, width, height, onClick, ariaLabel, }: RemoteImageProps): JSX.Element;
5
+ displayName: string;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { RemoteImageProps, RemoteImageStatus } from "./remote-image.types";
2
+ export type { RemoteImageProps, RemoteImageStatus };
3
+ export declare const RemoteImage: {
4
+ ({ src, alt, title, className, classNames, width, height, onClick, ariaLabel, }: RemoteImageProps): JSX.Element;
5
+ displayName: string;
6
+ };
@@ -0,0 +1,4 @@
1
+ export declare const containerClasses = "relative inline-flex shrink-0 overflow-hidden";
2
+ export declare const imageClasses = "h-full w-full object-cover";
3
+ export declare const skeletonClasses = "h-full w-full rounded-agg-lg";
4
+ export declare const placeholderClasses = "flex h-full w-full items-center justify-center bg-agg-secondary-hover rounded-agg-lg";
@@ -0,0 +1,4 @@
1
+ export declare const containerClasses = "relative inline-flex shrink-0 overflow-hidden";
2
+ export declare const imageClasses = "h-full w-full object-cover";
3
+ export declare const skeletonClasses = "h-full w-full rounded-agg-lg";
4
+ export declare const placeholderClasses = "flex h-full w-full items-center justify-center bg-agg-secondary-hover rounded-agg-lg";
@@ -0,0 +1,16 @@
1
+ export type RemoteImageStatus = "loading" | "loaded" | "error";
2
+ export type RemoteImageProps = {
3
+ src: string | undefined | null;
4
+ alt: string;
5
+ title?: string;
6
+ className?: string;
7
+ classNames?: {
8
+ root?: string;
9
+ image?: string;
10
+ placeholder?: string;
11
+ };
12
+ width?: number;
13
+ height?: number;
14
+ onClick?: () => void;
15
+ ariaLabel?: string;
16
+ };
@@ -0,0 +1,16 @@
1
+ export type RemoteImageStatus = "loading" | "loaded" | "error";
2
+ export type RemoteImageProps = {
3
+ src: string | undefined | null;
4
+ alt: string;
5
+ title?: string;
6
+ className?: string;
7
+ classNames?: {
8
+ root?: string;
9
+ image?: string;
10
+ placeholder?: string;
11
+ };
12
+ width?: number;
13
+ height?: number;
14
+ onClick?: () => void;
15
+ ariaLabel?: string;
16
+ };
@@ -40,6 +40,7 @@ export declare const settlementViewModelSchema: z.ZodObject<{
40
40
  }>, "many">;
41
41
  defaultExpandedVenue: z.ZodOptional<z.ZodNullable<z.ZodEnum<["polymarket", "kalshi", "opinion", "probable"]>>>;
42
42
  }, "strip", z.ZodTypeAny, {
43
+ question: string;
43
44
  venues: {
44
45
  venue: "probable" | "kalshi" | "polymarket" | "opinion";
45
46
  description: string;
@@ -47,11 +48,11 @@ export declare const settlementViewModelSchema: z.ZodObject<{
47
48
  showMoreLabel?: string | undefined;
48
49
  }[];
49
50
  sectionLabel: string;
50
- question: string;
51
51
  differencesTitle: string;
52
52
  differences: string[];
53
53
  defaultExpandedVenue?: "probable" | "kalshi" | "polymarket" | "opinion" | null | undefined;
54
54
  }, {
55
+ question: string;
55
56
  venues: {
56
57
  venue: "probable" | "kalshi" | "polymarket" | "opinion";
57
58
  description: string;
@@ -59,7 +60,6 @@ export declare const settlementViewModelSchema: z.ZodObject<{
59
60
  showMoreLabel?: string | undefined;
60
61
  }[];
61
62
  sectionLabel: string;
62
- question: string;
63
63
  differencesTitle: string;
64
64
  differences: string[];
65
65
  defaultExpandedVenue?: "probable" | "kalshi" | "polymarket" | "opinion" | null | undefined;
@@ -40,6 +40,7 @@ export declare const settlementViewModelSchema: z.ZodObject<{
40
40
  }>, "many">;
41
41
  defaultExpandedVenue: z.ZodOptional<z.ZodNullable<z.ZodEnum<["polymarket", "kalshi", "opinion", "probable"]>>>;
42
42
  }, "strip", z.ZodTypeAny, {
43
+ question: string;
43
44
  venues: {
44
45
  venue: "probable" | "kalshi" | "polymarket" | "opinion";
45
46
  description: string;
@@ -47,11 +48,11 @@ export declare const settlementViewModelSchema: z.ZodObject<{
47
48
  showMoreLabel?: string | undefined;
48
49
  }[];
49
50
  sectionLabel: string;
50
- question: string;
51
51
  differencesTitle: string;
52
52
  differences: string[];
53
53
  defaultExpandedVenue?: "probable" | "kalshi" | "polymarket" | "opinion" | null | undefined;
54
54
  }, {
55
+ question: string;
55
56
  venues: {
56
57
  venue: "probable" | "kalshi" | "polymarket" | "opinion";
57
58
  description: string;
@@ -59,7 +60,6 @@ export declare const settlementViewModelSchema: z.ZodObject<{
59
60
  showMoreLabel?: string | undefined;
60
61
  }[];
61
62
  sectionLabel: string;
62
- question: string;
63
63
  differencesTitle: string;
64
64
  differences: string[];
65
65
  defaultExpandedVenue?: "probable" | "kalshi" | "polymarket" | "opinion" | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-market/ui",
3
- "version": "7.0.0",
3
+ "version": "9.0.0",
4
4
  "sideEffects": false,
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -1,214 +0,0 @@
1
- import {
2
- AGG_ROOT_CLASS_NAME,
3
- CloseIcon,
4
- cn,
5
- getMotionClassName
6
- } from "./chunk-MUB7NYWZ.mjs";
7
-
8
- // src/primitives/modal/index.tsx
9
- import * as Dialog from "@radix-ui/react-dialog";
10
- import { useSdkUiConfig, useLabels } from "@agg-market/hooks";
11
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
- var Modal = ({
13
- open,
14
- onOpenChange,
15
- children,
16
- "aria-label": _ariaLabel,
17
- "aria-labelledby": _ariaLabelledBy
18
- }) => {
19
- return /* @__PURE__ */ jsx(Dialog.Root, { open, onOpenChange, children });
20
- };
21
- var ModalContainer = ({
22
- children,
23
- maxWidth = "600px",
24
- classNames,
25
- "aria-label": ariaLabel,
26
- "aria-labelledby": ariaLabelledBy
27
- }) => {
28
- const { rootClassName, enableAnimations } = useSdkUiConfig();
29
- const overlayAnimationClassName = enableAnimations ? "motion-safe:data-[state=open]:animate-agg-modal-overlay-in motion-safe:data-[state=closed]:animate-agg-modal-overlay-out motion-reduce:animate-none" : void 0;
30
- const panelAnimationClassName = enableAnimations ? "motion-safe:data-[state=open]:animate-agg-modal-panel-in motion-safe:data-[state=closed]:animate-agg-modal-panel-out motion-reduce:animate-none" : void 0;
31
- return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
32
- /* @__PURE__ */ jsx(
33
- Dialog.Overlay,
34
- {
35
- className: cn(
36
- "fixed inset-0 z-agg-overlay bg-agg-overlay",
37
- overlayAnimationClassName,
38
- classNames == null ? void 0 : classNames.overlay
39
- )
40
- }
41
- ),
42
- /* @__PURE__ */ jsx(
43
- Dialog.Content,
44
- {
45
- className: cn(
46
- "group/agg-modal",
47
- "fixed inset-0 z-agg-modal",
48
- "flex items-center justify-center p-4",
49
- "sm:p-5",
50
- classNames == null ? void 0 : classNames.content
51
- ),
52
- "aria-label": ariaLabel,
53
- "aria-labelledby": ariaLabelledBy,
54
- onCloseAutoFocus: (event) => {
55
- event.preventDefault();
56
- },
57
- children: /* @__PURE__ */ jsx(
58
- "div",
59
- {
60
- className: cn(
61
- AGG_ROOT_CLASS_NAME,
62
- rootClassName,
63
- "flex w-full max-h-[calc(100%-2rem)] flex-col font-agg-sans",
64
- "rounded-agg-2xl border border-agg-separator",
65
- "bg-agg-secondary text-agg-foreground shadow-agg-modal",
66
- "origin-bottom overflow-hidden will-change-transform",
67
- panelAnimationClassName,
68
- classNames == null ? void 0 : classNames.container
69
- ),
70
- "data-agg-animations": enableAnimations ? "true" : "false",
71
- style: { maxWidth },
72
- children
73
- }
74
- )
75
- }
76
- )
77
- ] });
78
- };
79
- Modal.Container = ModalContainer;
80
- var ModalHeader = ({
81
- title,
82
- subtitle,
83
- leftElement,
84
- rightElement,
85
- hideClose = false,
86
- closeIcon,
87
- classNames,
88
- children,
89
- hideBorder = false
90
- }) => {
91
- const { enableAnimations } = useSdkUiConfig();
92
- const labels = useLabels();
93
- const defaultCloseIcon = /* @__PURE__ */ jsx(CloseIcon, { className: "h-6 w-6" });
94
- const resolvedCloseIcon = closeIcon != null ? closeIcon : defaultCloseIcon;
95
- return /* @__PURE__ */ jsxs(
96
- "div",
97
- {
98
- className: cn(
99
- "group/agg-modal-header",
100
- "flex flex-col",
101
- "sticky top-0 z-20",
102
- "bg-agg-secondary",
103
- hideBorder ? "border-0" : "border-b border-agg-separator",
104
- subtitle ? "min-h-20" : "min-h-16",
105
- classNames == null ? void 0 : classNames.root
106
- ),
107
- children: [
108
- /* @__PURE__ */ jsxs(
109
- "div",
110
- {
111
- className: cn(
112
- "flex items-center justify-between",
113
- "px-4 py-4",
114
- "sm:px-8 sm:py-6",
115
- subtitle && "sm:py-4",
116
- children ? "pb-3 sm:pb-4" : void 0,
117
- classNames == null ? void 0 : classNames.container
118
- ),
119
- children: [
120
- leftElement ? /* @__PURE__ */ jsx(Fragment, { children: leftElement }) : null,
121
- /* @__PURE__ */ jsxs("div", { className: cn("max-w-[calc(100%-1rem)] flex-1", classNames == null ? void 0 : classNames.titleContainer), children: [
122
- /* @__PURE__ */ jsx(
123
- Dialog.Title,
124
- {
125
- className: cn(
126
- !title && "invisible",
127
- "flex items-center text-agg-lg font-agg-bold leading-agg-6",
128
- "sm:text-agg-2xl sm:leading-agg-8",
129
- "text-ellipsis overflow-hidden whitespace-nowrap",
130
- classNames == null ? void 0 : classNames.title
131
- ),
132
- children: title
133
- }
134
- ),
135
- subtitle ? /* @__PURE__ */ jsx(
136
- "span",
137
- {
138
- className: cn(
139
- "text-agg-sm leading-agg-4 text-agg-muted-foreground sm:leading-agg-5",
140
- classNames == null ? void 0 : classNames.subtitle
141
- ),
142
- children: subtitle
143
- }
144
- ) : null
145
- ] }),
146
- /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-6 items-center justify-end", children: [
147
- rightElement ? /* @__PURE__ */ jsx(Fragment, { children: rightElement }) : null,
148
- !hideClose && /* @__PURE__ */ jsx(
149
- Dialog.Close,
150
- {
151
- className: cn(
152
- "outline-0 flex items-center hover:cursor-pointer justify-center text-agg-foreground hover:text-agg-foreground/80",
153
- getMotionClassName(enableAnimations, "transition-colors"),
154
- classNames == null ? void 0 : classNames.close
155
- ),
156
- "aria-label": labels.common.close,
157
- children: resolvedCloseIcon
158
- }
159
- )
160
- ] })
161
- ]
162
- }
163
- ),
164
- children ? /* @__PURE__ */ jsx("div", { children }) : null
165
- ]
166
- }
167
- );
168
- };
169
- Modal.Header = ModalHeader;
170
- var ModalBody = ({ children, classNames }) => {
171
- return /* @__PURE__ */ jsx(
172
- "div",
173
- {
174
- className: cn(
175
- "group/agg-modal-body",
176
- "grow overflow-y-auto",
177
- "px-4 py-6",
178
- "sm:p-8",
179
- "bg-agg-secondary text-agg-foreground",
180
- classNames == null ? void 0 : classNames.root
181
- ),
182
- children
183
- }
184
- );
185
- };
186
- Modal.Body = ModalBody;
187
- var ModalFooter = ({
188
- children,
189
- classNames,
190
- hideBorder = false
191
- }) => {
192
- return /* @__PURE__ */ jsx(
193
- "div",
194
- {
195
- className: cn(
196
- "group/agg-modal-footer",
197
- "sticky bottom-0",
198
- "bg-agg-secondary",
199
- "flex h-[73px] w-full flex-row items-center justify-between gap-3",
200
- "border-agg-separator p-4",
201
- "sm:h-20 sm:justify-end sm:px-8 sm:py-5",
202
- hideBorder ? "border-0" : "border-t",
203
- classNames == null ? void 0 : classNames.root
204
- ),
205
- children
206
- }
207
- );
208
- };
209
- Modal.Footer = ModalFooter;
210
- Modal.displayName = "Modal";
211
-
212
- export {
213
- Modal
214
- };