@agg-market/ui 7.0.0 → 8.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 (37) hide show
  1. package/dist/{chunk-KQKLLL4D.mjs → chunk-JE4MV5RL.mjs} +8 -11
  2. package/dist/{chunk-L5U7RGJV.mjs → chunk-KRCRD4AJ.mjs} +11 -14
  3. package/dist/{chunk-AVHMI47G.mjs → chunk-SBLIHCN2.mjs} +5 -6
  4. package/dist/{chunk-6I474QXG.mjs → chunk-TLFRGJ5B.mjs} +18 -21
  5. package/dist/{chunk-MUB7NYWZ.mjs → chunk-WKY3IN52.mjs} +3446 -990
  6. package/dist/events.js +2825 -2714
  7. package/dist/events.mjs +2 -4
  8. package/dist/index.js +1506 -1389
  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 +2362 -2249
  13. package/dist/pages.mjs +4 -7
  14. package/dist/primitives.js +407 -290
  15. package/dist/primitives.mjs +22 -28
  16. package/dist/trading.js +564 -451
  17. package/dist/trading.mjs +2 -4
  18. package/dist/types/primitives/icon/index.d.mts +2 -1
  19. package/dist/types/primitives/icon/index.d.ts +2 -1
  20. package/dist/types/primitives/icon/registry.d.mts +4 -0
  21. package/dist/types/primitives/icon/registry.d.ts +4 -0
  22. package/dist/types/primitives/icon/svg/image.d.mts +5 -0
  23. package/dist/types/primitives/icon/svg/image.d.ts +5 -0
  24. package/dist/types/primitives/index.d.mts +1 -0
  25. package/dist/types/primitives/index.d.ts +1 -0
  26. package/dist/types/primitives/remote-image/index.d.mts +6 -0
  27. package/dist/types/primitives/remote-image/index.d.ts +6 -0
  28. package/dist/types/primitives/remote-image/remote-image.constants.d.mts +4 -0
  29. package/dist/types/primitives/remote-image/remote-image.constants.d.ts +4 -0
  30. package/dist/types/primitives/remote-image/remote-image.types.d.mts +16 -0
  31. package/dist/types/primitives/remote-image/remote-image.types.d.ts +16 -0
  32. package/package.json +1 -1
  33. package/dist/chunk-EEQPPN7N.mjs +0 -214
  34. package/dist/chunk-EERL6BZF.mjs +0 -997
  35. package/dist/chunk-OAJBTVZT.mjs +0 -119
  36. package/dist/chunk-OVQVAUAI.mjs +0 -420
  37. package/dist/chunk-ZYUJ7YEJ.mjs +0 -645
package/dist/trading.mjs CHANGED
@@ -29,10 +29,8 @@ import {
29
29
  getTradingSlippageLabel,
30
30
  getTradingValueLabel,
31
31
  getTradingVenueLabel
32
- } from "./chunk-KQKLLL4D.mjs";
33
- import "./chunk-OAJBTVZT.mjs";
34
- import "./chunk-EERL6BZF.mjs";
35
- import "./chunk-MUB7NYWZ.mjs";
32
+ } from "./chunk-JE4MV5RL.mjs";
33
+ import "./chunk-WKY3IN52.mjs";
36
34
  export {
37
35
  PlaceOrder,
38
36
  Settlement,
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-market/ui",
3
- "version": "7.0.0",
3
+ "version": "8.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
- };