@agg-market/ui 6.0.0 → 7.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.
- package/README.md +17 -2
- package/dist/{chunk-LMOJKJOY.mjs → chunk-6I474QXG.mjs} +319 -199
- package/dist/{chunk-5ZKPBMRK.mjs → chunk-AVHMI47G.mjs} +18 -20
- package/dist/{chunk-ADGL6RFX.mjs → chunk-EEQPPN7N.mjs} +1 -1
- package/dist/{chunk-UBBOLLOS.mjs → chunk-EERL6BZF.mjs} +2 -4
- package/dist/{chunk-G6YKGVQR.mjs → chunk-KQKLLL4D.mjs} +15 -54
- package/dist/{chunk-2ICOSP7N.mjs → chunk-L5U7RGJV.mjs} +5 -5
- package/dist/{chunk-HI4EEDN5.mjs → chunk-MUB7NYWZ.mjs} +799 -228
- package/dist/chunk-OAJBTVZT.mjs +119 -0
- package/dist/{chunk-JE3Z52FD.mjs → chunk-OVQVAUAI.mjs} +110 -35
- package/dist/{chunk-CN7GI2RJ.mjs → chunk-ZYUJ7YEJ.mjs} +68 -8
- package/dist/events.js +1364 -771
- package/dist/events.mjs +4 -5
- package/dist/index.js +2353 -1541
- package/dist/index.mjs +597 -19
- package/dist/modals.js +1058 -651
- package/dist/modals.mjs +3 -4
- package/dist/pages.js +1717 -1055
- package/dist/pages.mjs +7 -7
- package/dist/primitives.js +936 -336
- package/dist/primitives.mjs +25 -11
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +994 -512
- package/dist/trading.mjs +4 -4
- package/dist/types/auth/connect-button-view/connect-button-view.constants.d.mts +31 -0
- package/dist/types/auth/connect-button-view/connect-button-view.constants.d.ts +31 -0
- package/dist/types/auth/connect-button-view/connect-button-view.types.d.mts +83 -0
- package/dist/types/auth/connect-button-view/connect-button-view.types.d.ts +83 -0
- package/dist/types/auth/connect-button-view/index.d.mts +7 -0
- package/dist/types/auth/connect-button-view/index.d.ts +7 -0
- package/dist/types/auth/index.d.mts +1 -1
- package/dist/types/auth/index.d.ts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/primitives/chart/chart-type-switch.d.mts +10 -0
- package/dist/types/primitives/chart/chart-type-switch.d.ts +10 -0
- package/dist/types/primitives/chart/index.d.mts +7 -1
- package/dist/types/primitives/chart/index.d.ts +7 -1
- package/dist/types/primitives/icon/index.d.mts +8 -1
- package/dist/types/primitives/icon/index.d.ts +8 -1
- package/dist/types/primitives/icon/registry.d.mts +28 -0
- package/dist/types/primitives/icon/registry.d.ts +28 -0
- package/dist/types/primitives/icon/svg/apple.d.mts +5 -0
- package/dist/types/primitives/icon/svg/apple.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chart-candlestick.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chart-candlestick.d.ts +5 -0
- package/dist/types/primitives/icon/svg/chart-line.d.mts +5 -0
- package/dist/types/primitives/icon/svg/chart-line.d.ts +5 -0
- package/dist/types/primitives/icon/svg/error-filled.d.mts +5 -0
- package/dist/types/primitives/icon/svg/error-filled.d.ts +5 -0
- package/dist/types/primitives/icon/svg/ethereum.d.mts +5 -0
- package/dist/types/primitives/icon/svg/ethereum.d.ts +5 -0
- package/dist/types/primitives/icon/svg/google.d.mts +5 -0
- package/dist/types/primitives/icon/svg/google.d.ts +5 -0
- package/dist/types/primitives/icon/svg/solana.d.mts +5 -0
- package/dist/types/primitives/icon/svg/solana.d.ts +5 -0
- package/dist/types/primitives/index.d.mts +1 -0
- package/dist/types/primitives/index.d.ts +1 -0
- package/dist/types/primitives/inline-alert/index.d.mts +16 -0
- package/dist/types/primitives/inline-alert/index.d.ts +16 -0
- package/dist/types/primitives/venue-logo/svg/logo-limitless.d.mts +5 -0
- package/dist/types/primitives/venue-logo/svg/logo-limitless.d.ts +5 -0
- package/dist/types/primitives/venue-logo/venue-logo.types.d.mts +1 -1
- package/dist/types/primitives/venue-logo/venue-logo.types.d.ts +1 -1
- package/dist/types/trading/types.d.mts +26 -26
- package/dist/types/trading/types.d.ts +26 -26
- package/package.json +3 -15
- package/dist/auth.d.mts +0 -1
- package/dist/auth.d.ts +0 -1
- package/dist/auth.js +0 -2290
- package/dist/auth.mjs +0 -8
- package/dist/chunk-INRG3D4M.mjs +0 -450
- package/dist/chunk-MHCHR65A.mjs +0 -165
- package/dist/chunk-PASXFYKQ.mjs +0 -81
- package/dist/types/auth/connect-button/connect-button.constants.d.mts +0 -10
- package/dist/types/auth/connect-button/connect-button.constants.d.ts +0 -10
- package/dist/types/auth/connect-button/connect-button.types.d.mts +0 -33
- package/dist/types/auth/connect-button/connect-button.types.d.ts +0 -33
- package/dist/types/auth/connect-button/index.d.mts +0 -7
- package/dist/types/auth/connect-button/index.d.ts +0 -7
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon,
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-MUB7NYWZ.mjs";
|
|
5
|
+
|
|
6
|
+
// src/primitives/inline-alert/index.tsx
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var toneIconName = {
|
|
9
|
+
error: "error-filled",
|
|
10
|
+
warning: "warning-filled"
|
|
11
|
+
};
|
|
12
|
+
var toneIconClassName = {
|
|
13
|
+
error: "text-agg-error",
|
|
14
|
+
warning: "text-agg-warning"
|
|
15
|
+
};
|
|
16
|
+
var surfaceClassNames = {
|
|
17
|
+
error: "rounded-agg-lg bg-agg-status-error-surface px-3 py-2.5",
|
|
18
|
+
warning: "rounded-agg-lg border border-agg-separator bg-agg-secondary-hover px-3 py-2.5"
|
|
19
|
+
};
|
|
20
|
+
var liveRegionConfig = {
|
|
21
|
+
error: {
|
|
22
|
+
role: "alert",
|
|
23
|
+
ariaLive: "assertive"
|
|
24
|
+
},
|
|
25
|
+
warning: {
|
|
26
|
+
role: "status",
|
|
27
|
+
ariaLive: "polite"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var resolveVariant = ({
|
|
31
|
+
tone,
|
|
32
|
+
variant
|
|
33
|
+
}) => {
|
|
34
|
+
if (variant)
|
|
35
|
+
return variant;
|
|
36
|
+
return tone === "error" ? "surface" : "plain";
|
|
37
|
+
};
|
|
38
|
+
var InlineAlert = ({
|
|
39
|
+
tone = "error",
|
|
40
|
+
variant,
|
|
41
|
+
title,
|
|
42
|
+
message,
|
|
43
|
+
actionLabel,
|
|
44
|
+
onAction,
|
|
45
|
+
className,
|
|
46
|
+
"aria-label": ariaLabel
|
|
47
|
+
}) => {
|
|
48
|
+
const resolvedVariant = resolveVariant({
|
|
49
|
+
tone,
|
|
50
|
+
variant
|
|
51
|
+
});
|
|
52
|
+
const hasAction = !!actionLabel && !!onAction;
|
|
53
|
+
const { ariaLive, role } = liveRegionConfig[tone];
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: cn(
|
|
58
|
+
"flex w-full gap-3",
|
|
59
|
+
resolvedVariant === "plain" ? "items-center justify-center" : "items-start",
|
|
60
|
+
resolvedVariant === "surface" ? surfaceClassNames[tone] : null,
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
role,
|
|
64
|
+
"aria-live": ariaLive,
|
|
65
|
+
"aria-label": ariaLabel,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
Icon,
|
|
69
|
+
{
|
|
70
|
+
name: toneIconName[tone],
|
|
71
|
+
className: cn("h-4 w-4 shrink-0", toneIconClassName[tone]),
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: cn(
|
|
79
|
+
"min-w-0",
|
|
80
|
+
resolvedVariant === "plain" && !hasAction ? "flex-none text-center" : "flex-1"
|
|
81
|
+
),
|
|
82
|
+
children: /* @__PURE__ */ jsxs(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: cn(
|
|
86
|
+
"flex flex-col",
|
|
87
|
+
title ? "gap-1" : null,
|
|
88
|
+
resolvedVariant === "plain" && !hasAction ? "items-center" : null
|
|
89
|
+
),
|
|
90
|
+
children: [
|
|
91
|
+
title ? /* @__PURE__ */ jsx("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: title }) : null,
|
|
92
|
+
/* @__PURE__ */ jsx("p", { className: "text-agg-sm leading-agg-5 text-agg-foreground", children: message })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
hasAction ? /* @__PURE__ */ jsx(
|
|
99
|
+
"button",
|
|
100
|
+
{
|
|
101
|
+
type: "button",
|
|
102
|
+
className: cn(
|
|
103
|
+
"shrink-0 text-agg-sm font-agg-bold leading-agg-5 text-agg-primary",
|
|
104
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary-hover focus-visible:ring-offset-2 focus-visible:ring-offset-agg-secondary"
|
|
105
|
+
),
|
|
106
|
+
"aria-label": actionLabel,
|
|
107
|
+
onClick: onAction,
|
|
108
|
+
children: actionLabel
|
|
109
|
+
}
|
|
110
|
+
) : null
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
InlineAlert.displayName = "InlineAlert";
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
InlineAlert
|
|
119
|
+
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SearchEmptyIcon,
|
|
3
3
|
Typography
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZYUJ7YEJ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Icon,
|
|
7
7
|
VenueLogo,
|
|
8
8
|
__spreadProps,
|
|
9
9
|
__spreadValues,
|
|
10
10
|
cn,
|
|
11
|
-
getMotionClassName
|
|
12
|
-
|
|
11
|
+
getMotionClassName,
|
|
12
|
+
iconSizeClasses
|
|
13
|
+
} from "./chunk-MUB7NYWZ.mjs";
|
|
13
14
|
|
|
14
15
|
// src/primitives/hello-world.tsx
|
|
15
16
|
import { useHello } from "@agg-market/hooks";
|
|
@@ -29,10 +30,83 @@ function HelloWorld() {
|
|
|
29
30
|
}
|
|
30
31
|
HelloWorld.displayName = "HelloWorld";
|
|
31
32
|
|
|
33
|
+
// src/primitives/loading-icon/index.tsx
|
|
34
|
+
import { useLabels, useSdkUiConfig } from "@agg-market/hooks";
|
|
35
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
36
|
+
var LoadingIcon = ({
|
|
37
|
+
size = "medium",
|
|
38
|
+
className,
|
|
39
|
+
ariaLabel
|
|
40
|
+
}) => {
|
|
41
|
+
const labels = useLabels();
|
|
42
|
+
const { enableAnimations } = useSdkUiConfig();
|
|
43
|
+
return /* @__PURE__ */ jsx2(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
role: "status",
|
|
47
|
+
"aria-label": ariaLabel != null ? ariaLabel : labels.common.loading,
|
|
48
|
+
className: cn(
|
|
49
|
+
"group/agg-loading-icon",
|
|
50
|
+
"inline-grid place-items-center text-agg-primary will-change-transform",
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
children: /* @__PURE__ */ jsx2("span", { className: "inline-grid place-items-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("svg", { viewBox: "0 0 44 44", className: cn("block", iconSizeClasses[size]), children: /* @__PURE__ */ jsxs2("g", { children: [
|
|
54
|
+
enableAnimations ? /* @__PURE__ */ jsx2(
|
|
55
|
+
"animateTransform",
|
|
56
|
+
{
|
|
57
|
+
attributeName: "transform",
|
|
58
|
+
attributeType: "XML",
|
|
59
|
+
type: "rotate",
|
|
60
|
+
from: "0 22 22",
|
|
61
|
+
to: "360 22 22",
|
|
62
|
+
dur: "1.4s",
|
|
63
|
+
repeatCount: "indefinite"
|
|
64
|
+
}
|
|
65
|
+
) : null,
|
|
66
|
+
/* @__PURE__ */ jsx2(
|
|
67
|
+
"circle",
|
|
68
|
+
{
|
|
69
|
+
cx: "22",
|
|
70
|
+
cy: "22",
|
|
71
|
+
r: "16",
|
|
72
|
+
fill: "none",
|
|
73
|
+
stroke: "currentColor",
|
|
74
|
+
strokeWidth: "6",
|
|
75
|
+
strokeLinecap: "round",
|
|
76
|
+
strokeDasharray: "60 100",
|
|
77
|
+
strokeDashoffset: "0",
|
|
78
|
+
children: enableAnimations ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
79
|
+
/* @__PURE__ */ jsx2(
|
|
80
|
+
"animate",
|
|
81
|
+
{
|
|
82
|
+
attributeName: "stroke-dasharray",
|
|
83
|
+
values: "1 100;60 100;1 100",
|
|
84
|
+
dur: "1.2s",
|
|
85
|
+
repeatCount: "indefinite"
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
/* @__PURE__ */ jsx2(
|
|
89
|
+
"animate",
|
|
90
|
+
{
|
|
91
|
+
attributeName: "stroke-dashoffset",
|
|
92
|
+
values: "0;-25;-100",
|
|
93
|
+
dur: "1.2s",
|
|
94
|
+
repeatCount: "indefinite"
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] }) : null
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] }) }) })
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
LoadingIcon.displayName = "LoadingIcon";
|
|
105
|
+
|
|
32
106
|
// src/primitives/number-value.tsx
|
|
33
107
|
import { useMemo } from "react";
|
|
34
|
-
import { useSdkUiConfig } from "@agg-market/hooks";
|
|
35
|
-
import { jsx as
|
|
108
|
+
import { useSdkUiConfig as useSdkUiConfig2 } from "@agg-market/hooks";
|
|
109
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
36
110
|
var NumberValue = ({
|
|
37
111
|
value,
|
|
38
112
|
format = "number",
|
|
@@ -40,7 +114,7 @@ var NumberValue = ({
|
|
|
40
114
|
className,
|
|
41
115
|
ariaLabel
|
|
42
116
|
}) => {
|
|
43
|
-
const config =
|
|
117
|
+
const config = useSdkUiConfig2();
|
|
44
118
|
const formatted = useMemo(() => {
|
|
45
119
|
if (value == null)
|
|
46
120
|
return fallback;
|
|
@@ -60,13 +134,13 @@ var NumberValue = ({
|
|
|
60
134
|
}
|
|
61
135
|
return config.formatNumber(value);
|
|
62
136
|
}, [config, fallback, format, value]);
|
|
63
|
-
return /* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ jsx3("span", { className: cn("font-agg-sans", className), "aria-label": ariaLabel, children: formatted });
|
|
64
138
|
};
|
|
65
139
|
NumberValue.displayName = "NumberValue";
|
|
66
140
|
|
|
67
141
|
// src/primitives/search/index.tsx
|
|
68
142
|
import { useMemo as useMemo2 } from "react";
|
|
69
|
-
import { useLabels, useSdkUiConfig as
|
|
143
|
+
import { useLabels as useLabels2, useSdkUiConfig as useSdkUiConfig3 } from "@agg-market/hooks";
|
|
70
144
|
|
|
71
145
|
// src/primitives/search/search.types.ts
|
|
72
146
|
import { z } from "zod";
|
|
@@ -92,7 +166,7 @@ var searchResultItemSchema = z.object({
|
|
|
92
166
|
var searchResultItemsSchema = z.array(searchResultItemSchema);
|
|
93
167
|
|
|
94
168
|
// src/primitives/search/index.tsx
|
|
95
|
-
import { jsx as
|
|
169
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
96
170
|
var SearchResultRow = ({
|
|
97
171
|
item,
|
|
98
172
|
resultAria,
|
|
@@ -103,7 +177,7 @@ var SearchResultRow = ({
|
|
|
103
177
|
const handleResultClick = () => {
|
|
104
178
|
onSelect == null ? void 0 : onSelect(item);
|
|
105
179
|
};
|
|
106
|
-
return /* @__PURE__ */
|
|
180
|
+
return /* @__PURE__ */ jsxs3(
|
|
107
181
|
"button",
|
|
108
182
|
{
|
|
109
183
|
type: "button",
|
|
@@ -119,8 +193,8 @@ var SearchResultRow = ({
|
|
|
119
193
|
onClick: handleResultClick,
|
|
120
194
|
"aria-label": resultAria(item.title),
|
|
121
195
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
197
|
+
/* @__PURE__ */ jsx4(
|
|
124
198
|
"img",
|
|
125
199
|
{
|
|
126
200
|
src: item.thumbnailSrc,
|
|
@@ -131,7 +205,7 @@ var SearchResultRow = ({
|
|
|
131
205
|
)
|
|
132
206
|
}
|
|
133
207
|
),
|
|
134
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ jsx4(
|
|
135
209
|
"p",
|
|
136
210
|
{
|
|
137
211
|
className: cn(
|
|
@@ -142,10 +216,10 @@ var SearchResultRow = ({
|
|
|
142
216
|
}
|
|
143
217
|
)
|
|
144
218
|
] }),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ jsxs3("div", { className: cn("flex w-[200px] shrink-0 items-center gap-2", classNames == null ? void 0 : classNames.resultMeta), children: [
|
|
220
|
+
/* @__PURE__ */ jsx4(VenueLogo, { venue: item.venue, size: "small" }),
|
|
221
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex min-w-0 flex-1 items-baseline gap-2", children: [
|
|
222
|
+
/* @__PURE__ */ jsx4(
|
|
149
223
|
"p",
|
|
150
224
|
{
|
|
151
225
|
className: cn(
|
|
@@ -155,7 +229,7 @@ var SearchResultRow = ({
|
|
|
155
229
|
children: item.valueLabel
|
|
156
230
|
}
|
|
157
231
|
),
|
|
158
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ jsx4(
|
|
159
233
|
"p",
|
|
160
234
|
{
|
|
161
235
|
className: cn(
|
|
@@ -167,7 +241,7 @@ var SearchResultRow = ({
|
|
|
167
241
|
)
|
|
168
242
|
] })
|
|
169
243
|
] }),
|
|
170
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ jsx4(
|
|
171
245
|
Icon,
|
|
172
246
|
{
|
|
173
247
|
name: "chevron-right",
|
|
@@ -195,8 +269,8 @@ var Search = ({
|
|
|
195
269
|
classNames,
|
|
196
270
|
inputProps
|
|
197
271
|
}) => {
|
|
198
|
-
const labels =
|
|
199
|
-
const { enableAnimations } =
|
|
272
|
+
const labels = useLabels2();
|
|
273
|
+
const { enableAnimations } = useSdkUiConfig3();
|
|
200
274
|
const validatedResults = useMemo2(() => {
|
|
201
275
|
return getValidatedResults(results);
|
|
202
276
|
}, [results]);
|
|
@@ -208,8 +282,8 @@ var Search = ({
|
|
|
208
282
|
const handleInputChange = (event) => {
|
|
209
283
|
onValueChange(event.target.value);
|
|
210
284
|
};
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
285
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("group/agg-search", "flex w-full flex-col gap-1", classNames == null ? void 0 : classNames.root), children: [
|
|
286
|
+
/* @__PURE__ */ jsx4("label", { className: "w-full", children: /* @__PURE__ */ jsxs3(
|
|
213
287
|
"div",
|
|
214
288
|
{
|
|
215
289
|
className: cn(
|
|
@@ -223,7 +297,7 @@ var Search = ({
|
|
|
223
297
|
classNames == null ? void 0 : classNames.inputContainer
|
|
224
298
|
),
|
|
225
299
|
children: [
|
|
226
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ jsx4(
|
|
227
301
|
Icon,
|
|
228
302
|
{
|
|
229
303
|
name: "search",
|
|
@@ -231,7 +305,7 @@ var Search = ({
|
|
|
231
305
|
className: cn("text-agg-muted-foreground", classNames == null ? void 0 : classNames.searchIcon)
|
|
232
306
|
}
|
|
233
307
|
),
|
|
234
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ jsx4(
|
|
235
309
|
"input",
|
|
236
310
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
237
311
|
type: "text",
|
|
@@ -252,25 +326,25 @@ var Search = ({
|
|
|
252
326
|
]
|
|
253
327
|
}
|
|
254
328
|
) }),
|
|
255
|
-
shouldRenderResults ? /* @__PURE__ */
|
|
329
|
+
shouldRenderResults ? /* @__PURE__ */ jsx4(
|
|
256
330
|
"div",
|
|
257
331
|
{
|
|
258
332
|
className: cn(
|
|
259
333
|
"w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary py-2 shadow-[0px_8px_16px_0px_rgba(0,0,0,0.1)]",
|
|
260
334
|
classNames == null ? void 0 : classNames.dropdown
|
|
261
335
|
),
|
|
262
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ jsx4(
|
|
263
337
|
"ul",
|
|
264
338
|
{
|
|
265
339
|
className: cn("m-0 flex list-none flex-col p-0", classNames == null ? void 0 : classNames.resultsList),
|
|
266
340
|
role: "listbox",
|
|
267
341
|
"aria-label": labels.search.resultsAria,
|
|
268
|
-
children: validatedResults.map((item, index) => /* @__PURE__ */
|
|
342
|
+
children: validatedResults.map((item, index) => /* @__PURE__ */ jsx4(
|
|
269
343
|
"li",
|
|
270
344
|
{
|
|
271
345
|
role: "presentation",
|
|
272
346
|
className: cn(index > 0 && "border-t border-agg-separator", classNames == null ? void 0 : classNames.resultItem),
|
|
273
|
-
children: /* @__PURE__ */
|
|
347
|
+
children: /* @__PURE__ */ jsx4(
|
|
274
348
|
SearchResultRow,
|
|
275
349
|
{
|
|
276
350
|
item,
|
|
@@ -286,29 +360,29 @@ var Search = ({
|
|
|
286
360
|
)
|
|
287
361
|
}
|
|
288
362
|
) : null,
|
|
289
|
-
shouldRenderNoResults ? /* @__PURE__ */
|
|
363
|
+
shouldRenderNoResults ? /* @__PURE__ */ jsx4(
|
|
290
364
|
"div",
|
|
291
365
|
{
|
|
292
366
|
className: cn(
|
|
293
367
|
"w-full overflow-hidden rounded-agg-xl border border-agg-separator bg-agg-secondary py-10 shadow-[0px_8px_16px_0px_rgba(0,0,0,0.1)]",
|
|
294
368
|
classNames == null ? void 0 : classNames.emptyState
|
|
295
369
|
),
|
|
296
|
-
children: /* @__PURE__ */
|
|
370
|
+
children: /* @__PURE__ */ jsxs3(
|
|
297
371
|
"div",
|
|
298
372
|
{
|
|
299
373
|
className: cn("flex flex-col items-center gap-5", classNames == null ? void 0 : classNames.emptyStateContent),
|
|
300
374
|
role: "status",
|
|
301
375
|
"aria-live": "polite",
|
|
302
376
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ jsx4(
|
|
304
378
|
SearchEmptyIcon,
|
|
305
379
|
{
|
|
306
380
|
className: cn("h-10 w-10 text-agg-muted-foreground", classNames == null ? void 0 : classNames.emptyStateIcon),
|
|
307
381
|
"aria-hidden": true
|
|
308
382
|
}
|
|
309
383
|
),
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center gap-1 text-center", children: [
|
|
385
|
+
/* @__PURE__ */ jsx4(
|
|
312
386
|
"p",
|
|
313
387
|
{
|
|
314
388
|
className: cn(
|
|
@@ -318,7 +392,7 @@ var Search = ({
|
|
|
318
392
|
children: labels.search.noResultsTitle
|
|
319
393
|
}
|
|
320
394
|
),
|
|
321
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ jsx4(
|
|
322
396
|
"p",
|
|
323
397
|
{
|
|
324
398
|
className: cn(
|
|
@@ -340,6 +414,7 @@ Search.displayName = "Search";
|
|
|
340
414
|
|
|
341
415
|
export {
|
|
342
416
|
HelloWorld,
|
|
417
|
+
LoadingIcon,
|
|
343
418
|
NumberValue,
|
|
344
419
|
Search
|
|
345
420
|
};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
cn,
|
|
8
8
|
getIconA11yProps,
|
|
9
9
|
getMotionClassName
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MUB7NYWZ.mjs";
|
|
11
11
|
|
|
12
12
|
// src/primitives/switch-button/index.tsx
|
|
13
13
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -69,7 +69,7 @@ var SwitchButton = ({
|
|
|
69
69
|
if ((event == null ? void 0 : event.key) !== "ArrowLeft" && (event == null ? void 0 : event.key) !== "ArrowRight") {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
event
|
|
72
|
+
event.preventDefault();
|
|
73
73
|
const nextOptionIndex = resolveNextEnabledIndex(
|
|
74
74
|
options,
|
|
75
75
|
optionIndex,
|
|
@@ -235,12 +235,18 @@ var normalizeSeries = (series) => {
|
|
|
235
235
|
if (!Number.isFinite(point.time) || !Number.isFinite(point.value)) {
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
const normalizedTime = Math.floor(point.time);
|
|
239
|
+
const normalizedPoint = {
|
|
240
|
+
time: normalizedTime,
|
|
241
|
+
value: point.value,
|
|
242
|
+
open: Number.isFinite(point.open) ? point.open : void 0,
|
|
243
|
+
high: Number.isFinite(point.high) ? point.high : void 0,
|
|
244
|
+
low: Number.isFinite(point.low) ? point.low : void 0,
|
|
245
|
+
close: Number.isFinite(point.close) ? point.close : void 0
|
|
246
|
+
};
|
|
247
|
+
pointsByTime.set(normalizedTime, normalizedPoint);
|
|
239
248
|
});
|
|
240
|
-
const sortedPoints = [...pointsByTime.entries()].sort((left, right) => left[0] - right[0]).map(([
|
|
241
|
-
time,
|
|
242
|
-
value
|
|
243
|
-
}));
|
|
249
|
+
const sortedPoints = [...pointsByTime.entries()].sort((left, right) => left[0] - right[0]).map(([, point]) => point);
|
|
244
250
|
return __spreadProps(__spreadValues({}, seriesItem), {
|
|
245
251
|
points: sortedPoints
|
|
246
252
|
});
|
|
@@ -268,6 +274,44 @@ var toLivelinePoints = (points) => {
|
|
|
268
274
|
value: point.value
|
|
269
275
|
}));
|
|
270
276
|
};
|
|
277
|
+
var toLivelineCandles = (points) => {
|
|
278
|
+
return points.map((point) => {
|
|
279
|
+
var _a, _b, _c, _d;
|
|
280
|
+
const open = (_a = point.open) != null ? _a : point.value;
|
|
281
|
+
const close = (_b = point.close) != null ? _b : point.value;
|
|
282
|
+
const high = (_c = point.high) != null ? _c : Math.max(open, close, point.value);
|
|
283
|
+
const low = (_d = point.low) != null ? _d : Math.min(open, close, point.value);
|
|
284
|
+
if (!Number.isFinite(point.time) || !Number.isFinite(open) || !Number.isFinite(high) || !Number.isFinite(low) || !Number.isFinite(close)) {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
return {
|
|
288
|
+
time: point.time,
|
|
289
|
+
open,
|
|
290
|
+
high: Math.max(open, close, high),
|
|
291
|
+
low: Math.min(open, close, low),
|
|
292
|
+
close
|
|
293
|
+
};
|
|
294
|
+
}).filter((point) => point != null);
|
|
295
|
+
};
|
|
296
|
+
var resolveCandleWidthSeconds = (points) => {
|
|
297
|
+
if (points.length <= 1) {
|
|
298
|
+
return void 0;
|
|
299
|
+
}
|
|
300
|
+
let minimumIntervalSeconds = null;
|
|
301
|
+
for (let index = 1; index < points.length; index += 1) {
|
|
302
|
+
const currentPoint = points[index];
|
|
303
|
+
const previousPoint = points[index - 1];
|
|
304
|
+
const intervalSeconds = currentPoint.time - previousPoint.time;
|
|
305
|
+
if (!Number.isFinite(intervalSeconds) || intervalSeconds <= 0) {
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
minimumIntervalSeconds = minimumIntervalSeconds == null ? intervalSeconds : Math.min(minimumIntervalSeconds, intervalSeconds);
|
|
309
|
+
}
|
|
310
|
+
if (minimumIntervalSeconds == null) {
|
|
311
|
+
return void 0;
|
|
312
|
+
}
|
|
313
|
+
return Math.max(60, Math.floor(minimumIntervalSeconds));
|
|
314
|
+
};
|
|
271
315
|
var resolveWindowSeconds = (normalizedSeries) => {
|
|
272
316
|
const timestamps = normalizedSeries.flatMap(
|
|
273
317
|
(seriesItem) => seriesItem.points.map((point) => point.time)
|
|
@@ -336,6 +380,7 @@ var LineChart = ({
|
|
|
336
380
|
width,
|
|
337
381
|
classNames,
|
|
338
382
|
isLoading = false,
|
|
383
|
+
chartType = "line",
|
|
339
384
|
showSeriesControls = true,
|
|
340
385
|
renderSeriesControls
|
|
341
386
|
}) => {
|
|
@@ -366,12 +411,24 @@ var LineChart = ({
|
|
|
366
411
|
}
|
|
367
412
|
return toLivelinePoints(primarySeries.points);
|
|
368
413
|
}, [primarySeries]);
|
|
414
|
+
const primaryCandles = useMemo2(() => {
|
|
415
|
+
if (!primarySeries) {
|
|
416
|
+
return [];
|
|
417
|
+
}
|
|
418
|
+
return toLivelineCandles(primarySeries.points);
|
|
419
|
+
}, [primarySeries]);
|
|
369
420
|
const primaryValue = useMemo2(() => {
|
|
370
421
|
if (!primarySeries) {
|
|
371
422
|
return 0;
|
|
372
423
|
}
|
|
373
424
|
return resolveLatestValue(primarySeries.points);
|
|
374
425
|
}, [primarySeries]);
|
|
426
|
+
const candleWidth = useMemo2(() => {
|
|
427
|
+
if (!primarySeries) {
|
|
428
|
+
return void 0;
|
|
429
|
+
}
|
|
430
|
+
return resolveCandleWidthSeconds(primarySeries.points);
|
|
431
|
+
}, [primarySeries]);
|
|
375
432
|
const livelineSeries = useMemo2(() => {
|
|
376
433
|
return normalizedSeries.map((seriesItem) => ({
|
|
377
434
|
id: seriesItem.id,
|
|
@@ -409,7 +466,7 @@ var LineChart = ({
|
|
|
409
466
|
),
|
|
410
467
|
style: { height },
|
|
411
468
|
role: "img",
|
|
412
|
-
"aria-label": labels.common.lineChartAria,
|
|
469
|
+
"aria-label": chartType === "candlestick" ? labels.common.candlestickChartAria : labels.common.lineChartAria,
|
|
413
470
|
children: /* @__PURE__ */ jsx3(
|
|
414
471
|
Liveline,
|
|
415
472
|
{
|
|
@@ -423,6 +480,9 @@ var LineChart = ({
|
|
|
423
480
|
momentum: false,
|
|
424
481
|
pulse: false,
|
|
425
482
|
window: windowSeconds,
|
|
483
|
+
mode: chartType === "candlestick" ? "candle" : "line",
|
|
484
|
+
candles: chartType === "candlestick" ? primaryCandles : void 0,
|
|
485
|
+
candleWidth: chartType === "candlestick" ? candleWidth : void 0,
|
|
426
486
|
formatValue: defaultValueFormatter,
|
|
427
487
|
formatTime: timeFormatter,
|
|
428
488
|
padding: {
|