@coinlist-co/react 0.1.2 → 0.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/dist/RequirementItem-BpkJQep8.d.ts +37 -0
- package/dist/RequirementItem-BvwsFu9e.d.cts +37 -0
- package/dist/{chunk-WFA6X7E2.js → chunk-IADBIDY6.js} +3 -3
- package/dist/chunk-IDCROXPS.js +412 -0
- package/dist/chunk-IDCROXPS.js.map +1 -0
- package/dist/{chunk-6CG7JT7Q.js → chunk-P4DTIPEX.js} +144 -5
- package/dist/chunk-P4DTIPEX.js.map +1 -0
- package/dist/{chunk-DLEKT4T4.js → chunk-V5M7SA3C.js} +47 -4
- package/dist/chunk-V5M7SA3C.js.map +1 -0
- package/dist/client/components/index.cjs +467 -5
- package/dist/client/components/index.cjs.map +1 -1
- package/dist/client/components/index.d.cts +61 -11
- package/dist/client/components/index.d.ts +61 -11
- package/dist/client/components/index.js +268 -240
- package/dist/client/components/index.js.map +1 -1
- package/dist/client/core/index.cjs +146 -4
- package/dist/client/core/index.cjs.map +1 -1
- package/dist/client/core/index.d.cts +2 -2
- package/dist/client/core/index.d.ts +2 -2
- package/dist/client/core/index.js +13 -1
- package/dist/client/hooks/index.cjs +49 -6
- package/dist/client/hooks/index.cjs.map +1 -1
- package/dist/client/hooks/index.d.cts +6 -5
- package/dist/client/hooks/index.d.ts +6 -5
- package/dist/client/hooks/index.js +5 -3
- package/dist/client/index.cjs +244 -10
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +6 -4
- package/dist/client/index.d.ts +6 -4
- package/dist/client/index.js +30 -2
- package/dist/client/styles.css +1 -1
- package/dist/coinlist-client-B_dJkbwB.d.ts +283 -0
- package/dist/coinlist-client-DBKa6j3f.d.cts +283 -0
- package/dist/requirement-CxbdY8l4.d.cts +202 -0
- package/dist/requirement-fJsQ3f9_.d.ts +202 -0
- package/dist/{useCoinListOffers-DIdOb5hB.d.ts → useCoinListOffers-C5lBlzcC.d.ts} +1 -1
- package/dist/{useCoinListOffers-DvJxu6qj.d.cts → useCoinListOffers-CguwXaCX.d.cts} +1 -1
- package/dist/useCoinListRequirements-BECx1cIw.d.ts +31 -0
- package/dist/useCoinListRequirements-CX2gV9gJ.d.cts +31 -0
- package/dist/{useCompleteCoinListOAuth-6Z4DGuiH.d.cts → useCompleteCoinListOAuth-BRhAqD4_.d.cts} +1 -1
- package/dist/{useCompleteCoinListOAuth-C3G1Vsf8.d.ts → useCompleteCoinListOAuth-DEZpHjd6.d.ts} +1 -1
- package/package.json +4 -4
- package/dist/chunk-6CG7JT7Q.js.map +0 -1
- package/dist/chunk-DLEKT4T4.js.map +0 -1
- package/dist/coinlist-client-BiA8a2yU.d.ts +0 -272
- package/dist/coinlist-client-DXKFDGhP.d.cts +0 -272
- package/dist/offer-D6p_Ijme.d.cts +0 -30
- package/dist/offer-DnFEFJw9.d.ts +0 -30
- /package/dist/{chunk-WFA6X7E2.js.map → chunk-IADBIDY6.js.map} +0 -0
|
@@ -1,125 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AlertBanner,
|
|
3
|
+
ChecklistStatus,
|
|
4
|
+
ClButton,
|
|
5
|
+
RequirementItem,
|
|
6
|
+
RequirementItemUi,
|
|
7
|
+
RequirementStatus,
|
|
8
|
+
RequirementVariant,
|
|
9
|
+
cn,
|
|
10
|
+
typeClasses
|
|
11
|
+
} from "../../chunk-IDCROXPS.js";
|
|
1
12
|
import {
|
|
2
13
|
useCoinListOffers
|
|
3
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-IADBIDY6.js";
|
|
4
15
|
import {
|
|
5
|
-
useCoinList
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
useCoinList,
|
|
17
|
+
useCoinListRequirements
|
|
18
|
+
} from "../../chunk-V5M7SA3C.js";
|
|
19
|
+
import "../../chunk-P4DTIPEX.js";
|
|
8
20
|
import "../../chunk-GRVV7NLV.js";
|
|
9
21
|
|
|
10
22
|
// src/client/components/index.ts
|
|
11
23
|
import "../styles.css";
|
|
12
24
|
|
|
13
|
-
// src/client/components/design-system/ClButton.tsx
|
|
14
|
-
import { cva } from "class-variance-authority";
|
|
15
|
-
import { forwardRef } from "react";
|
|
16
|
-
|
|
17
|
-
// src/client/components/design-system/utils.ts
|
|
18
|
-
import { clsx } from "clsx";
|
|
19
|
-
function cn(...inputs) {
|
|
20
|
-
return clsx(inputs);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// src/client/components/design-system/ClButton.tsx
|
|
24
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
-
var buttonVariants = cva(
|
|
26
|
-
"inline-flex items-center justify-center gap-3 whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-40 cursor-pointer",
|
|
27
|
-
{
|
|
28
|
-
variants: {
|
|
29
|
-
variant: {
|
|
30
|
-
// Primary — tokens auto-switch: dark bg (#171717) → light bg (#f4f4f5) in dark mode
|
|
31
|
-
primary: "bg-brand-primary text-text-inverse font-semibold hover:bg-brand-primary-hover active:bg-brand-primary-active focus-visible:ring-gray-500",
|
|
32
|
-
// Secondary — bg-section, border-border, text-text-primary all auto-switch
|
|
33
|
-
// hover maps to border token value; active has no token so uses dark: override
|
|
34
|
-
secondary: "bg-section border border-border text-text-primary font-medium hover:bg-border active:bg-[#d9d9d9] dark:active:bg-divider focus-visible:ring-gray-400",
|
|
35
|
-
// Destructive — error tokens auto-switch to translucent dark equivalents
|
|
36
|
-
// hover/active have no tokens so use dark: overrides
|
|
37
|
-
destructive: "bg-error-subtle border border-error-border text-error font-semibold hover:bg-[#fcdcd8] active:bg-[#f9c9c4] dark:hover:bg-[rgba(248,113,113,0.20)] dark:active:bg-[rgba(248,113,113,0.30)] focus-visible:ring-red-400",
|
|
38
|
-
// Ghost — transparent base; hover/active use section/border tokens (auto-switch)
|
|
39
|
-
ghost: "bg-transparent text-text-primary font-medium hover:bg-section active:bg-border focus-visible:ring-gray-400",
|
|
40
|
-
// Link — text-text-primary auto-switches light/dark
|
|
41
|
-
link: "h-auto p-0 text-text-primary font-medium underline-offset-4 hover:underline focus-visible:ring-gray-500",
|
|
42
|
-
// Destructive link — text-error auto-switches (#b42318 → #f87171 in dark)
|
|
43
|
-
destructiveLink: "h-auto p-0 text-error font-medium hover:text-[#8b1a13] active:text-[#6d1510] dark:hover:text-[#fca5a5] dark:active:text-[#f87171] focus-visible:ring-red-500"
|
|
44
|
-
},
|
|
45
|
-
size: {
|
|
46
|
-
sm: "h-9 px-4 text-sm tracking-[0.28px]",
|
|
47
|
-
default: "h-11 px-5 text-sm tracking-[0.28px]",
|
|
48
|
-
lg: "h-14 px-6 text-base",
|
|
49
|
-
icon: "h-12 w-12"
|
|
50
|
-
},
|
|
51
|
-
radius: {
|
|
52
|
-
pill: "rounded-full",
|
|
53
|
-
// compound variants below handle size-specific radii
|
|
54
|
-
rounded: ""
|
|
55
|
-
},
|
|
56
|
-
fullWidth: {
|
|
57
|
-
true: "w-full",
|
|
58
|
-
false: ""
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
compoundVariants: [
|
|
62
|
-
{ size: "sm", radius: "rounded", className: "rounded-lg" },
|
|
63
|
-
{ size: "default", radius: "rounded", className: "rounded-2xl" },
|
|
64
|
-
{ size: "lg", radius: "rounded", className: "rounded-2xl" },
|
|
65
|
-
{ size: "icon", radius: "rounded", className: "rounded-md" }
|
|
66
|
-
],
|
|
67
|
-
defaultVariants: {
|
|
68
|
-
variant: "primary",
|
|
69
|
-
size: "default",
|
|
70
|
-
radius: "pill",
|
|
71
|
-
fullWidth: false
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
var ClButton = forwardRef(
|
|
76
|
-
({
|
|
77
|
-
className,
|
|
78
|
-
variant,
|
|
79
|
-
size,
|
|
80
|
-
radius,
|
|
81
|
-
fullWidth,
|
|
82
|
-
children,
|
|
83
|
-
isLoading = false,
|
|
84
|
-
loadingText,
|
|
85
|
-
startIcon,
|
|
86
|
-
endIcon,
|
|
87
|
-
disabled,
|
|
88
|
-
...props
|
|
89
|
-
}, ref) => {
|
|
90
|
-
const isDisabled = disabled || isLoading;
|
|
91
|
-
return /* @__PURE__ */ jsxs(
|
|
92
|
-
"button",
|
|
93
|
-
{
|
|
94
|
-
className: cn(
|
|
95
|
-
buttonVariants({ variant, size, radius, fullWidth }),
|
|
96
|
-
className
|
|
97
|
-
),
|
|
98
|
-
ref,
|
|
99
|
-
disabled: isDisabled,
|
|
100
|
-
...props,
|
|
101
|
-
children: [
|
|
102
|
-
isLoading && /* @__PURE__ */ jsx(
|
|
103
|
-
"span",
|
|
104
|
-
{
|
|
105
|
-
className: "h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent opacity-60",
|
|
106
|
-
"aria-hidden": "true"
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
startIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: startIcon }),
|
|
110
|
-
/* @__PURE__ */ jsx("span", { className: cn(isLoading && "opacity-60"), children: isLoading && loadingText ? loadingText : children }),
|
|
111
|
-
endIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: endIcon })
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
ClButton.displayName = "ClButton";
|
|
118
|
-
|
|
119
25
|
// src/client/components/design-system/logos/CoinListLogomark.tsx
|
|
120
|
-
import { jsx
|
|
26
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
121
27
|
function CoinListLogomark(props) {
|
|
122
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ jsxs(
|
|
123
29
|
"svg",
|
|
124
30
|
{
|
|
125
31
|
width: "115",
|
|
@@ -130,28 +36,28 @@ function CoinListLogomark(props) {
|
|
|
130
36
|
"aria-hidden": "true",
|
|
131
37
|
...props,
|
|
132
38
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
134
40
|
"path",
|
|
135
41
|
{
|
|
136
42
|
d: "M69.7519 123.966C75.8021 124.172 81.7491 123.519 87.4899 121.799C98.3871 118.531 107.531 112.58 114.922 103.947C114.922 103.947 114.922 103.947 114.888 103.912C112.859 102.193 110.831 100.507 108.837 98.8218L106.809 97.1363C106.431 96.8268 106.087 96.5172 105.709 96.2076C104.919 95.5197 104.128 94.8662 103.303 94.2126C96.2902 98.8562 88.5899 101.539 80.0991 101.883C75.8364 102.055 71.6082 101.642 67.4831 100.507C60.5047 98.6154 54.2483 95.1757 49.2294 89.7755C40.0854 79.938 36.854 68.1743 39.226 55.0348C40.7041 46.9172 44.4168 40.0723 50.0888 34.5C48.8856 34.7408 47.6825 35.016 46.5137 35.3943C37.5072 38.2148 30.5976 43.6839 25.6131 51.6639C21.6598 58.0273 19.5629 64.9411 19.3223 72.4739C19.1848 76.7047 19.4598 80.7979 20.4223 84.7879C23.4818 97.2395 30.2882 107.043 40.6698 114.335H40.7729V114.403C41.1167 114.644 41.4604 114.919 41.8042 115.16C50.2607 120.801 59.5766 123.691 69.7519 124.035V123.966Z",
|
|
137
43
|
fill: "currentColor"
|
|
138
44
|
}
|
|
139
45
|
),
|
|
140
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
141
47
|
"path",
|
|
142
48
|
{
|
|
143
49
|
d: "M73.1896 89.052C69.1676 90.8406 65.0081 91.8725 60.6768 92.2165C65.9707 95.209 71.7802 96.688 78.1054 96.8256C80.168 96.86 82.2305 96.6536 84.3962 96.3097C89.7245 95.4841 94.6746 93.5579 99.281 90.7374C94.9153 87.057 90.5839 83.4109 86.2181 79.7305C82.5055 83.6861 78.1741 86.8506 73.1896 89.052Z",
|
|
144
50
|
fill: "currentColor"
|
|
145
51
|
}
|
|
146
52
|
),
|
|
147
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
148
54
|
"path",
|
|
149
55
|
{
|
|
150
56
|
d: "M67.9643 0.241609C67.4143 0.276006 66.8643 0.344799 66.3486 0.413592C71.6425 1.4111 76.7646 3.13093 81.6116 5.71068C91.0306 10.7326 98.3527 17.9215 103.268 27.4494L105.915 25.1448C108.631 22.7714 111.347 20.3981 114.063 18.0247C107.634 11.1797 100.072 6.15784 91.2025 3.06214C85.2898 0.998336 79.2396 -0.0335643 73.0176 0.000832322C71.3675 0.000832322 69.6831 0.138419 67.9643 0.241609Z",
|
|
151
57
|
fill: "currentColor"
|
|
152
58
|
}
|
|
153
59
|
),
|
|
154
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
155
61
|
"path",
|
|
156
62
|
{
|
|
157
63
|
d: "M26.4037 107.871C18.4628 97.9988 14.1314 86.7167 14.2002 73.818C14.2002 67.317 15.5409 61.0568 18.1191 55.1062C21.9348 46.2662 27.9506 39.1805 36.4071 34.2962C44.348 29.687 52.9763 27.8984 62.1547 29.2743C71.5738 30.7189 79.3771 35.2249 85.6336 42.2762C85.6336 42.2762 85.8398 42.5514 85.9429 42.6546C86.8711 41.8291 87.8336 41.0035 88.7618 40.178L89.8962 39.1805C90.8587 38.355 91.8212 37.4951 92.7838 36.6696C94.9838 34.7434 97.1495 32.8515 99.3152 30.9253C95.087 22.223 88.7274 15.55 80.3053 10.8377C70.3706 5.26541 59.6797 3.54557 48.37 5.02463C42.7323 5.78136 37.3352 7.50119 32.1788 10.0465C14.6815 18.7145 2.06546 36.532 1.03418 58.4771C0.862296 62.0887 1.10293 65.7348 1.65294 69.3464C3.02798 78.3239 6.32808 86.4759 11.622 93.8368C15.7471 99.5123 20.6629 104.19 26.3693 107.871H26.4037Z",
|
|
@@ -164,7 +70,7 @@ function CoinListLogomark(props) {
|
|
|
164
70
|
}
|
|
165
71
|
|
|
166
72
|
// src/client/components/CoinListSignInButton.tsx
|
|
167
|
-
import { jsx as
|
|
73
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
168
74
|
function CoinListSignInButton({
|
|
169
75
|
onClick,
|
|
170
76
|
disabled = false,
|
|
@@ -172,7 +78,7 @@ function CoinListSignInButton({
|
|
|
172
78
|
isLoading = false,
|
|
173
79
|
className
|
|
174
80
|
}) {
|
|
175
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ jsx2(
|
|
176
82
|
ClButton,
|
|
177
83
|
{
|
|
178
84
|
variant: "primary",
|
|
@@ -182,88 +88,22 @@ function CoinListSignInButton({
|
|
|
182
88
|
disabled,
|
|
183
89
|
isLoading,
|
|
184
90
|
loadingText: "Signing in...",
|
|
185
|
-
startIcon: /* @__PURE__ */
|
|
91
|
+
startIcon: /* @__PURE__ */ jsx2(CoinListLogomark, { className: "h-[18px] w-[16px] shrink-0" }),
|
|
186
92
|
className,
|
|
187
93
|
children: "Continue with CoinList"
|
|
188
94
|
}
|
|
189
95
|
);
|
|
190
96
|
}
|
|
191
97
|
|
|
192
|
-
// src/client/components/design-system/AlertBanner.tsx
|
|
193
|
-
import { CircleCheck, Info } from "lucide-react";
|
|
194
|
-
|
|
195
|
-
// src/client/components/design-system/tokens/typography.ts
|
|
196
|
-
var typeClasses = {
|
|
197
|
-
hero: "text-[64px] leading-[110%] font-semibold",
|
|
198
|
-
display: "text-[48px] leading-[110%] font-semibold",
|
|
199
|
-
h1: "text-[36px] leading-[120%] font-semibold",
|
|
200
|
-
h2: "text-[28px] leading-[125%] font-semibold",
|
|
201
|
-
h3: "text-[22px] leading-[130%] font-semibold",
|
|
202
|
-
h4: "text-[18px] leading-[135%] font-medium",
|
|
203
|
-
body: "text-[16px] leading-[150%] font-normal",
|
|
204
|
-
subhead: "text-[14px] leading-[150%] font-normal",
|
|
205
|
-
caption: "text-[12px] leading-[140%] font-normal",
|
|
206
|
-
label: "text-[14px] leading-[140%] font-medium",
|
|
207
|
-
data: "text-[14px] leading-[140%] font-normal"
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
// src/client/components/design-system/AlertBanner.tsx
|
|
211
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
212
|
-
var variantConfig = {
|
|
213
|
-
info: {
|
|
214
|
-
container: "bg-surface border-border",
|
|
215
|
-
text: "text-text-secondary",
|
|
216
|
-
Icon: Info
|
|
217
|
-
},
|
|
218
|
-
success: {
|
|
219
|
-
container: "bg-success-subtle border-success-border",
|
|
220
|
-
text: "text-success",
|
|
221
|
-
Icon: CircleCheck
|
|
222
|
-
},
|
|
223
|
-
warning: {
|
|
224
|
-
container: "bg-warning-subtle border-warning-border",
|
|
225
|
-
text: "text-warning",
|
|
226
|
-
Icon: Info
|
|
227
|
-
},
|
|
228
|
-
error: {
|
|
229
|
-
container: "bg-error-subtle border-error-border",
|
|
230
|
-
text: "text-error",
|
|
231
|
-
Icon: Info
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
function AlertBanner({
|
|
235
|
-
variant,
|
|
236
|
-
content,
|
|
237
|
-
icon = false,
|
|
238
|
-
className
|
|
239
|
-
}) {
|
|
240
|
-
const { container, text, Icon } = variantConfig[variant];
|
|
241
|
-
return /* @__PURE__ */ jsxs3(
|
|
242
|
-
"div",
|
|
243
|
-
{
|
|
244
|
-
className: cn(
|
|
245
|
-
"flex items-center rounded-btn border p-3",
|
|
246
|
-
icon && "gap-2",
|
|
247
|
-
container,
|
|
248
|
-
className
|
|
249
|
-
),
|
|
250
|
-
children: [
|
|
251
|
-
icon && /* @__PURE__ */ jsx4(Icon, { className: cn("h-4 w-4 shrink-0", text), "aria-hidden": "true" }),
|
|
252
|
-
/* @__PURE__ */ jsx4("p", { className: cn(typeClasses.subhead, text), children: content })
|
|
253
|
-
]
|
|
254
|
-
}
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
98
|
// src/client/components/design-system/CloseButton.tsx
|
|
259
99
|
import { X } from "lucide-react";
|
|
260
|
-
import { jsx as
|
|
100
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
261
101
|
function CloseButton({
|
|
262
102
|
onClick,
|
|
263
103
|
"aria-label": ariaLabel = "Close",
|
|
264
104
|
className
|
|
265
105
|
}) {
|
|
266
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ jsx3(
|
|
267
107
|
"button",
|
|
268
108
|
{
|
|
269
109
|
type: "button",
|
|
@@ -273,15 +113,15 @@ function CloseButton({
|
|
|
273
113
|
"cursor-pointer rounded-full p-1.5 text-text-secondary transition-colors hover:bg-surface hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2",
|
|
274
114
|
className
|
|
275
115
|
),
|
|
276
|
-
children: /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ jsx3(X, { className: "h-5 w-5" })
|
|
277
117
|
}
|
|
278
118
|
);
|
|
279
119
|
}
|
|
280
120
|
|
|
281
121
|
// src/client/components/design-system/logos/CoinListWordmark.tsx
|
|
282
|
-
import { jsx as
|
|
122
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
283
123
|
function CoinListWordmark(props) {
|
|
284
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ jsxs2(
|
|
285
125
|
"svg",
|
|
286
126
|
{
|
|
287
127
|
width: "638",
|
|
@@ -292,35 +132,35 @@ function CoinListWordmark(props) {
|
|
|
292
132
|
"aria-hidden": "true",
|
|
293
133
|
...props,
|
|
294
134
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ jsx4(
|
|
296
136
|
"path",
|
|
297
137
|
{
|
|
298
138
|
d: "M68.7724 123.966C74.8226 124.172 80.7696 123.519 86.5104 121.799C97.4076 118.531 106.551 112.58 113.942 103.947C113.942 103.947 113.942 103.947 113.908 103.912C111.879 102.193 109.851 100.507 107.857 98.8218L105.829 97.1363C105.451 96.8268 105.107 96.5172 104.729 96.2076C103.939 95.5197 103.148 94.8662 102.323 94.2126C95.3107 98.8562 87.6104 101.539 79.1196 101.883C74.8569 102.055 70.6287 101.642 66.5036 100.507C59.5252 98.6154 53.2688 95.1757 48.2499 89.7755C39.1059 79.938 35.8745 68.1743 38.2465 55.0348C39.7246 46.9172 43.4373 40.0723 49.1093 34.5C47.9061 34.7408 46.703 35.016 45.5342 35.3943C36.5277 38.2148 29.6181 43.6839 24.6336 51.6639C20.6803 58.0273 18.5834 64.9411 18.3428 72.4739C18.2053 76.7047 18.4803 80.7979 19.4428 84.7879C22.5023 97.2395 29.3087 107.043 39.6903 114.335H39.7934V114.403C40.1372 114.644 40.4809 114.919 40.8247 115.16C49.2812 120.801 58.5971 123.691 68.7724 124.035V123.966Z",
|
|
299
139
|
fill: "currentColor"
|
|
300
140
|
}
|
|
301
141
|
),
|
|
302
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ jsx4(
|
|
303
143
|
"path",
|
|
304
144
|
{
|
|
305
145
|
d: "M72.2101 89.052C68.1881 90.8406 64.0286 91.8725 59.6973 92.2165C64.9912 95.209 70.8007 96.688 77.1259 96.8256C79.1885 96.86 81.251 96.6536 83.4167 96.3097C88.745 95.4841 93.6951 93.5579 98.3015 90.7374C93.9358 87.057 89.6044 83.4109 85.2386 79.7305C81.526 83.6861 77.1946 86.8506 72.2101 89.052Z",
|
|
306
146
|
fill: "currentColor"
|
|
307
147
|
}
|
|
308
148
|
),
|
|
309
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ jsx4(
|
|
310
150
|
"path",
|
|
311
151
|
{
|
|
312
152
|
d: "M66.9848 0.241609C66.4348 0.276006 65.8848 0.344799 65.3691 0.413592C70.663 1.4111 75.7851 3.13093 80.6321 5.71068C90.0511 10.7326 97.3732 17.9215 102.289 27.4494L104.936 25.1448C107.652 22.7714 110.368 20.3981 113.084 18.0247C106.655 11.1797 99.092 6.15784 90.223 3.06214C84.3103 0.998336 78.2601 -0.0335643 72.0381 0.000832319C70.388 0.000832319 68.7036 0.138419 66.9848 0.241609Z",
|
|
313
153
|
fill: "currentColor"
|
|
314
154
|
}
|
|
315
155
|
),
|
|
316
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ jsx4(
|
|
317
157
|
"path",
|
|
318
158
|
{
|
|
319
159
|
d: "M25.4242 107.871C17.4833 97.9988 13.1519 86.7167 13.2207 73.818C13.2207 67.317 14.5614 61.0568 17.1396 55.1062C20.9553 46.2662 26.9711 39.1805 35.4276 34.2962C43.3685 29.687 51.9968 27.8984 61.1752 29.2743C70.5943 30.7189 78.3976 35.2249 84.6541 42.2762C84.6541 42.2762 84.8603 42.5514 84.9634 42.6546C85.8916 41.8291 86.8541 41.0035 87.7823 40.178L88.9167 39.1805C89.8792 38.355 90.8417 37.4951 91.8043 36.6696C94.0043 34.7434 96.17 32.8515 98.3357 30.9253C94.1075 22.223 87.7479 15.55 79.3258 10.8377C69.3911 5.26541 58.7002 3.54557 47.3904 5.02463C41.7528 5.78136 36.3557 7.50119 31.1993 10.0465C13.702 18.7145 1.08597 36.532 0.0546833 58.4771C-0.117196 62.0887 0.123436 65.7348 0.673452 69.3464C2.04849 78.3239 5.34859 86.4759 10.6425 93.8368C14.7676 99.5123 19.6834 104.19 25.3898 107.871H25.4242Z",
|
|
320
160
|
fill: "currentColor"
|
|
321
161
|
}
|
|
322
162
|
),
|
|
323
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ jsx4(
|
|
324
164
|
"path",
|
|
325
165
|
{
|
|
326
166
|
fillRule: "evenodd",
|
|
@@ -335,9 +175,9 @@ function CoinListWordmark(props) {
|
|
|
335
175
|
}
|
|
336
176
|
|
|
337
177
|
// src/client/components/PoweredByCoinList.tsx
|
|
338
|
-
import { jsx as
|
|
178
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
339
179
|
function PoweredByCoinList({ className }) {
|
|
340
|
-
return /* @__PURE__ */
|
|
180
|
+
return /* @__PURE__ */ jsxs3(
|
|
341
181
|
"div",
|
|
342
182
|
{
|
|
343
183
|
className: cn(
|
|
@@ -345,21 +185,21 @@ function PoweredByCoinList({ className }) {
|
|
|
345
185
|
className
|
|
346
186
|
),
|
|
347
187
|
children: [
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ jsx5("span", { className: cn(typeClasses.caption, "tracking-[0.12px]"), children: "Powered by" }),
|
|
189
|
+
/* @__PURE__ */ jsx5(CoinListWordmark, { className: "h-3 w-auto" })
|
|
350
190
|
]
|
|
351
191
|
}
|
|
352
192
|
);
|
|
353
193
|
}
|
|
354
194
|
|
|
355
195
|
// src/client/components/CoinListSignInCard.tsx
|
|
356
|
-
import { jsx as
|
|
196
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
357
197
|
function CoinListSignInCard() {
|
|
358
198
|
const { coinlist } = useCoinList();
|
|
359
199
|
const onSignIn = async () => {
|
|
360
200
|
await coinlist.startOAuth();
|
|
361
201
|
};
|
|
362
|
-
return /* @__PURE__ */
|
|
202
|
+
return /* @__PURE__ */ jsx6(BaseCoinListSignInCard, { onSignIn });
|
|
363
203
|
}
|
|
364
204
|
function BaseCoinListSignInCard({
|
|
365
205
|
state = "idle",
|
|
@@ -367,7 +207,7 @@ function BaseCoinListSignInCard({
|
|
|
367
207
|
onClose,
|
|
368
208
|
className
|
|
369
209
|
}) {
|
|
370
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ jsxs4(
|
|
371
211
|
"div",
|
|
372
212
|
{
|
|
373
213
|
className: cn(
|
|
@@ -375,13 +215,13 @@ function BaseCoinListSignInCard({
|
|
|
375
215
|
className
|
|
376
216
|
),
|
|
377
217
|
children: [
|
|
378
|
-
onClose && /* @__PURE__ */
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
218
|
+
onClose && /* @__PURE__ */ jsx6(CloseButton, { onClick: onClose, className: "absolute right-4 top-4" }),
|
|
219
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2", children: [
|
|
220
|
+
/* @__PURE__ */ jsx6("h3", { className: cn(typeClasses.h3, "text-text-primary"), children: "Sign in to participate" }),
|
|
221
|
+
/* @__PURE__ */ jsx6("p", { className: cn(typeClasses.body, "text-text-secondary"), children: "A CoinList account is required to participate in this sale." })
|
|
382
222
|
] }),
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
state === "error" && /* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ jsx6(CoinListSignInButton, { onClick: onSignIn, fullWidth: true, className: "mt-4" }),
|
|
224
|
+
state === "error" && /* @__PURE__ */ jsx6(
|
|
385
225
|
AlertBanner,
|
|
386
226
|
{
|
|
387
227
|
variant: "error",
|
|
@@ -390,18 +230,27 @@ function BaseCoinListSignInCard({
|
|
|
390
230
|
className: "mt-4"
|
|
391
231
|
}
|
|
392
232
|
),
|
|
393
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ jsx6(PoweredByCoinList, { className: "mt-4" })
|
|
394
234
|
]
|
|
395
235
|
}
|
|
396
236
|
);
|
|
397
237
|
}
|
|
398
238
|
|
|
399
239
|
// src/client/components/offers/OfferCard.tsx
|
|
400
|
-
import { Fragment, jsx as
|
|
240
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
401
241
|
var monthYearFormatter = new Intl.DateTimeFormat("en-US", {
|
|
402
242
|
month: "short",
|
|
403
243
|
year: "numeric"
|
|
404
244
|
});
|
|
245
|
+
var OfferCardUi = {
|
|
246
|
+
fromDomain: (offer) => ({
|
|
247
|
+
tagline: offer.tagline,
|
|
248
|
+
bannerUrl: offer.bannerUrl,
|
|
249
|
+
logoUrl: offer.logoUrl,
|
|
250
|
+
formattedStartsAt: monthYearFormatter.format(offer.startsAt),
|
|
251
|
+
formattedEndsAt: monthYearFormatter.format(offer.endsAt)
|
|
252
|
+
})
|
|
253
|
+
};
|
|
405
254
|
function OfferCard({
|
|
406
255
|
offer,
|
|
407
256
|
onClick,
|
|
@@ -409,35 +258,35 @@ function OfferCard({
|
|
|
409
258
|
containerClassName
|
|
410
259
|
}) {
|
|
411
260
|
const cardLabel = "Open offer details";
|
|
412
|
-
const cardContent = /* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
offer.bannerUrl ? /* @__PURE__ */
|
|
261
|
+
const cardContent = /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
262
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative mb-6 h-52 w-full overflow-hidden rounded-2xl border border-border/60 bg-section", children: [
|
|
263
|
+
offer.bannerUrl ? /* @__PURE__ */ jsx7(
|
|
415
264
|
"img",
|
|
416
265
|
{
|
|
417
266
|
src: offer.bannerUrl,
|
|
418
267
|
alt: "Offer banner",
|
|
419
268
|
className: "h-full w-full object-cover"
|
|
420
269
|
}
|
|
421
|
-
) : /* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
270
|
+
) : /* @__PURE__ */ jsx7("div", { className: "h-full w-full bg-gradient-to-br from-surface via-section to-background" }),
|
|
271
|
+
/* @__PURE__ */ jsx7("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-overlay/35" }),
|
|
272
|
+
/* @__PURE__ */ jsx7("div", { className: "absolute inset-0 flex items-center justify-center p-6", children: offer.logoUrl ? /* @__PURE__ */ jsx7(
|
|
424
273
|
"img",
|
|
425
274
|
{
|
|
426
275
|
src: offer.logoUrl,
|
|
427
276
|
alt: "Offer logo",
|
|
428
277
|
className: "h-28 w-28 rounded-full border border-border bg-surface object-cover shadow-[0_10px_24px_rgba(0,0,0,0.25)]"
|
|
429
278
|
}
|
|
430
|
-
) : /* @__PURE__ */
|
|
279
|
+
) : /* @__PURE__ */ jsx7("div", { className: "h-28 w-28 rounded-full border border-border bg-surface shadow-[0_10px_24px_rgba(0,0,0,0.18)]" }) })
|
|
431
280
|
] }),
|
|
432
|
-
offer.tagline && /* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
281
|
+
offer.tagline && /* @__PURE__ */ jsx7("p", { className: cn(typeClasses.h3, "min-h-[2.4rem] text-text-primary"), children: offer.tagline }),
|
|
282
|
+
/* @__PURE__ */ jsxs5("div", { className: "mt-4 grid grid-cols-2 gap-5 border-t border-divider pt-4", children: [
|
|
283
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1", children: [
|
|
284
|
+
/* @__PURE__ */ jsx7("span", { className: cn(typeClasses.subhead, "text-text-secondary"), children: "Starts" }),
|
|
285
|
+
/* @__PURE__ */ jsx7("span", { className: cn(typeClasses.label, "text-text-primary"), children: offer.formattedStartsAt })
|
|
437
286
|
] }),
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1", children: [
|
|
288
|
+
/* @__PURE__ */ jsx7("span", { className: cn(typeClasses.subhead, "text-text-secondary"), children: "Ends" }),
|
|
289
|
+
/* @__PURE__ */ jsx7("span", { className: cn(typeClasses.label, "text-text-primary"), children: offer.formattedEndsAt })
|
|
441
290
|
] })
|
|
442
291
|
] })
|
|
443
292
|
] });
|
|
@@ -448,7 +297,7 @@ function OfferCard({
|
|
|
448
297
|
);
|
|
449
298
|
let cardNode;
|
|
450
299
|
if (onClick) {
|
|
451
|
-
cardNode = /* @__PURE__ */
|
|
300
|
+
cardNode = /* @__PURE__ */ jsx7(
|
|
452
301
|
"button",
|
|
453
302
|
{
|
|
454
303
|
type: "button",
|
|
@@ -459,20 +308,20 @@ function OfferCard({
|
|
|
459
308
|
}
|
|
460
309
|
);
|
|
461
310
|
} else {
|
|
462
|
-
cardNode = /* @__PURE__ */
|
|
311
|
+
cardNode = /* @__PURE__ */ jsx7("div", { className: baseClasses, children: cardContent });
|
|
463
312
|
}
|
|
464
313
|
if (!containerClassName) {
|
|
465
314
|
return cardNode;
|
|
466
315
|
}
|
|
467
|
-
return /* @__PURE__ */
|
|
316
|
+
return /* @__PURE__ */ jsx7("div", { className: containerClassName, children: cardNode });
|
|
468
317
|
}
|
|
469
318
|
|
|
470
319
|
// src/client/components/offers/OffersGrid.tsx
|
|
471
|
-
import { jsx as
|
|
320
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
472
321
|
var DEFAULT_MAX_COLUMNS = 3;
|
|
473
322
|
function OffersGrid(props) {
|
|
474
323
|
const { offersState } = useCoinListOffers();
|
|
475
|
-
return /* @__PURE__ */
|
|
324
|
+
return /* @__PURE__ */ jsx8(BaseOffersGrid, { ...props, offersState });
|
|
476
325
|
}
|
|
477
326
|
function BaseOffersGrid({
|
|
478
327
|
offersState,
|
|
@@ -489,12 +338,12 @@ function BaseOffersGrid({
|
|
|
489
338
|
if (loading) {
|
|
490
339
|
return loading;
|
|
491
340
|
}
|
|
492
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ jsx8(
|
|
493
342
|
"output",
|
|
494
343
|
{
|
|
495
344
|
"aria-live": "polite",
|
|
496
345
|
className: "flex min-h-40 items-center justify-center rounded-2xl border border-border bg-background p-6",
|
|
497
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ jsx8("p", { className: cn(typeClasses.body, "text-text-secondary"), children: "Loading offers..." })
|
|
498
347
|
}
|
|
499
348
|
);
|
|
500
349
|
}
|
|
@@ -503,7 +352,7 @@ function BaseOffersGrid({
|
|
|
503
352
|
return error;
|
|
504
353
|
}
|
|
505
354
|
const errorMessage = offersState.reason === "not-authenticated" ? "Sign in to view available offers." : "Unable to load offers right now. Please try again.";
|
|
506
|
-
return /* @__PURE__ */
|
|
355
|
+
return /* @__PURE__ */ jsx8(
|
|
507
356
|
AlertBanner,
|
|
508
357
|
{
|
|
509
358
|
variant: "error",
|
|
@@ -517,20 +366,20 @@ function BaseOffersGrid({
|
|
|
517
366
|
if (emptyState) {
|
|
518
367
|
return emptyState;
|
|
519
368
|
}
|
|
520
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ jsxs6(
|
|
521
370
|
"output",
|
|
522
371
|
{
|
|
523
372
|
"aria-live": "polite",
|
|
524
373
|
className: "flex min-h-40 flex-col items-center justify-center rounded-2xl border border-border bg-background p-6 text-center",
|
|
525
374
|
children: [
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ jsx8("p", { className: cn(typeClasses.body, "font-medium text-text-primary"), children: "No offers available" }),
|
|
376
|
+
/* @__PURE__ */ jsx8("p", { className: cn(typeClasses.subhead, "text-text-secondary"), children: "Check back soon for upcoming opportunities." })
|
|
528
377
|
]
|
|
529
378
|
}
|
|
530
379
|
);
|
|
531
380
|
}
|
|
532
381
|
const maxGridWidth = `calc(${cols} * 28rem + ${Math.max(cols - 1, 0)} * 1.5rem)`;
|
|
533
|
-
return /* @__PURE__ */
|
|
382
|
+
return /* @__PURE__ */ jsx8("div", { className: cn("flex w-full justify-center", containerClassName), children: /* @__PURE__ */ jsx8(
|
|
534
383
|
"div",
|
|
535
384
|
{
|
|
536
385
|
className: cn("grid w-full gap-6", className),
|
|
@@ -538,10 +387,10 @@ function BaseOffersGrid({
|
|
|
538
387
|
gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 20rem), 1fr))",
|
|
539
388
|
maxWidth: maxGridWidth
|
|
540
389
|
},
|
|
541
|
-
children: offersState.offers.map((offer) => /* @__PURE__ */
|
|
390
|
+
children: offersState.offers.map((offer) => /* @__PURE__ */ jsx8(
|
|
542
391
|
OfferCard,
|
|
543
392
|
{
|
|
544
|
-
offer,
|
|
393
|
+
offer: OfferCardUi.fromDomain(offer),
|
|
545
394
|
onClick: onOfferClick ? () => onOfferClick(offer) : void 0
|
|
546
395
|
},
|
|
547
396
|
offer.id
|
|
@@ -549,10 +398,189 @@ function BaseOffersGrid({
|
|
|
549
398
|
}
|
|
550
399
|
) });
|
|
551
400
|
}
|
|
401
|
+
|
|
402
|
+
// src/client/components/requirements/RequirementsChecklist.tsx
|
|
403
|
+
import {
|
|
404
|
+
Children,
|
|
405
|
+
cloneElement,
|
|
406
|
+
isValidElement,
|
|
407
|
+
useState
|
|
408
|
+
} from "react";
|
|
409
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
410
|
+
var DEFAULT_LABELS = {
|
|
411
|
+
kyc_approved: "KYC Verification",
|
|
412
|
+
identity_verified: "Identity Verification",
|
|
413
|
+
proof_of_address: "Proof of Address",
|
|
414
|
+
source_of_funds: "Source of Funds",
|
|
415
|
+
external_wallet: "External Wallet",
|
|
416
|
+
whitelisted_wallet: "Whitelisted Wallet",
|
|
417
|
+
jurisdiction: "Jurisdiction Check",
|
|
418
|
+
accreditation: "Accreditation"
|
|
419
|
+
};
|
|
420
|
+
var DEFAULT_DESCRIPTIONS = {
|
|
421
|
+
kyc_approved: "Complete Know Your Customer verification.",
|
|
422
|
+
identity_verified: "Verify your identity.",
|
|
423
|
+
proof_of_address: "Provide proof of your residential address.",
|
|
424
|
+
source_of_funds: "Provide documentation for your source of funds.",
|
|
425
|
+
external_wallet: "Connect an external wallet.",
|
|
426
|
+
whitelisted_wallet: "Connect a whitelisted wallet.",
|
|
427
|
+
jurisdiction: "Confirm your jurisdiction eligibility.",
|
|
428
|
+
accreditation: "Verify your accreditation status."
|
|
429
|
+
};
|
|
430
|
+
function RequirementsChecklist(props) {
|
|
431
|
+
if ("status" in props) {
|
|
432
|
+
return /* @__PURE__ */ jsx9(StaticRequirementsChecklist, { ...props });
|
|
433
|
+
}
|
|
434
|
+
return /* @__PURE__ */ jsx9(DynamicRequirementsChecklist, { ...props });
|
|
435
|
+
}
|
|
436
|
+
function DynamicRequirementsChecklist(props) {
|
|
437
|
+
const { requirementsState } = useCoinListRequirements(props.offerId);
|
|
438
|
+
return /* @__PURE__ */ jsx9(
|
|
439
|
+
BaseRequirementsChecklist,
|
|
440
|
+
{
|
|
441
|
+
...props,
|
|
442
|
+
requirementsState
|
|
443
|
+
}
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
function StaticRequirementsChecklist({
|
|
447
|
+
title,
|
|
448
|
+
description,
|
|
449
|
+
status,
|
|
450
|
+
onContinue,
|
|
451
|
+
children,
|
|
452
|
+
className
|
|
453
|
+
}) {
|
|
454
|
+
const [expandedIndex, setExpandedIndex] = useState(null);
|
|
455
|
+
const accordionChildren = Children.map(children, (child, index) => {
|
|
456
|
+
if (!isValidElement(child)) return child;
|
|
457
|
+
return cloneElement(
|
|
458
|
+
child,
|
|
459
|
+
{
|
|
460
|
+
expanded: expandedIndex === index,
|
|
461
|
+
onToggle: () => setExpandedIndex((prev) => prev === index ? null : index)
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
});
|
|
465
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn("flex w-full flex-col gap-4", className), children: [
|
|
466
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-2", children: [
|
|
467
|
+
/* @__PURE__ */ jsx9("h3", { className: cn(typeClasses.h3, "text-text-primary"), children: title }),
|
|
468
|
+
/* @__PURE__ */ jsx9("p", { className: cn(typeClasses.body, "text-text-secondary"), children: description })
|
|
469
|
+
] }),
|
|
470
|
+
/* @__PURE__ */ jsx9("div", { className: "flex flex-col divide-y divide-divider", children: accordionChildren }),
|
|
471
|
+
status === "ineligible" && /* @__PURE__ */ jsx9(
|
|
472
|
+
AlertBanner,
|
|
473
|
+
{
|
|
474
|
+
variant: "error",
|
|
475
|
+
icon: true,
|
|
476
|
+
content: "You are not eligible to participate."
|
|
477
|
+
}
|
|
478
|
+
),
|
|
479
|
+
/* @__PURE__ */ jsx9(ClButton, { fullWidth: true, disabled: status !== "eligible", onClick: onContinue, children: "Continue" })
|
|
480
|
+
] });
|
|
481
|
+
}
|
|
482
|
+
function BaseRequirementsChecklist({
|
|
483
|
+
requirementsState,
|
|
484
|
+
optionId,
|
|
485
|
+
title,
|
|
486
|
+
description,
|
|
487
|
+
onContinue,
|
|
488
|
+
onRequirementAction,
|
|
489
|
+
onContactSupport,
|
|
490
|
+
getLabel,
|
|
491
|
+
getDescription,
|
|
492
|
+
loading,
|
|
493
|
+
error,
|
|
494
|
+
className
|
|
495
|
+
}) {
|
|
496
|
+
const [expandedIndex, setExpandedIndex] = useState(null);
|
|
497
|
+
if (requirementsState.type === "LOADING") {
|
|
498
|
+
if (loading) return loading;
|
|
499
|
+
return /* @__PURE__ */ jsx9(
|
|
500
|
+
"output",
|
|
501
|
+
{
|
|
502
|
+
"aria-live": "polite",
|
|
503
|
+
className: "flex min-h-40 items-center justify-center rounded-2xl border border-border bg-background p-6",
|
|
504
|
+
children: /* @__PURE__ */ jsx9("p", { className: cn(typeClasses.body, "text-text-secondary"), children: "Loading requirements..." })
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
if (requirementsState.type === "ERROR") {
|
|
509
|
+
if (error) return error;
|
|
510
|
+
const errorMessage = requirementsState.reason === "not-authenticated" ? "Sign in to view requirements." : "Unable to load requirements right now. Please try again.";
|
|
511
|
+
return /* @__PURE__ */ jsx9(
|
|
512
|
+
AlertBanner,
|
|
513
|
+
{
|
|
514
|
+
variant: "error",
|
|
515
|
+
icon: true,
|
|
516
|
+
content: errorMessage,
|
|
517
|
+
className: "w-full max-w-[28rem]"
|
|
518
|
+
}
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
const { requirementsByOptionId, statuses } = requirementsState;
|
|
522
|
+
const requirements = requirementsByOptionId[optionId] ?? [];
|
|
523
|
+
const requirementIds = new Set(requirements.map((r) => r.id));
|
|
524
|
+
const optionStatuses = statuses.filter((s) => requirementIds.has(s.id));
|
|
525
|
+
const statusByRequirementId = new Map(optionStatuses.map((s) => [s.id, s]));
|
|
526
|
+
const checklistStatus = ChecklistStatus.derive(optionStatuses);
|
|
527
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn("flex w-full flex-col gap-4", className), children: [
|
|
528
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-2", children: [
|
|
529
|
+
/* @__PURE__ */ jsx9("h3", { className: cn(typeClasses.h3, "text-text-primary"), children: title }),
|
|
530
|
+
/* @__PURE__ */ jsx9("p", { className: cn(typeClasses.body, "text-text-secondary"), children: description })
|
|
531
|
+
] }),
|
|
532
|
+
/* @__PURE__ */ jsx9("div", { className: "flex flex-col divide-y divide-divider", children: requirements.map((req, index) => {
|
|
533
|
+
const statusInfo = statusByRequirementId.get(req.id);
|
|
534
|
+
const label = getLabel ? getLabel(req) : DEFAULT_LABELS[req.type];
|
|
535
|
+
const description2 = (getDescription ? getDescription(req) : null) ?? DEFAULT_DESCRIPTIONS[req.type];
|
|
536
|
+
return /* @__PURE__ */ jsx9(
|
|
537
|
+
RequirementItem,
|
|
538
|
+
{
|
|
539
|
+
ui: RequirementItemUi.fromDomain(
|
|
540
|
+
req,
|
|
541
|
+
statusInfo,
|
|
542
|
+
label,
|
|
543
|
+
description2
|
|
544
|
+
),
|
|
545
|
+
expanded: expandedIndex === index,
|
|
546
|
+
onToggle: () => setExpandedIndex((prev) => prev === index ? null : index),
|
|
547
|
+
onAction: onRequirementAction ? () => onRequirementAction(req) : void 0,
|
|
548
|
+
onContactSupport: onContactSupport ? () => onContactSupport(req) : void 0
|
|
549
|
+
},
|
|
550
|
+
req.id
|
|
551
|
+
);
|
|
552
|
+
}) }),
|
|
553
|
+
checklistStatus === "ineligible" && /* @__PURE__ */ jsx9(
|
|
554
|
+
AlertBanner,
|
|
555
|
+
{
|
|
556
|
+
variant: "error",
|
|
557
|
+
icon: true,
|
|
558
|
+
content: "You are not eligible to participate."
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
/* @__PURE__ */ jsx9(
|
|
562
|
+
ClButton,
|
|
563
|
+
{
|
|
564
|
+
fullWidth: true,
|
|
565
|
+
disabled: checklistStatus !== "eligible",
|
|
566
|
+
onClick: onContinue,
|
|
567
|
+
children: "Continue"
|
|
568
|
+
}
|
|
569
|
+
)
|
|
570
|
+
] });
|
|
571
|
+
}
|
|
552
572
|
export {
|
|
553
573
|
BaseCoinListSignInCard,
|
|
574
|
+
BaseRequirementsChecklist,
|
|
575
|
+
ChecklistStatus,
|
|
554
576
|
CoinListSignInCard,
|
|
555
577
|
OfferCard,
|
|
556
|
-
|
|
578
|
+
OfferCardUi,
|
|
579
|
+
OffersGrid,
|
|
580
|
+
RequirementItem,
|
|
581
|
+
RequirementItemUi,
|
|
582
|
+
RequirementStatus,
|
|
583
|
+
RequirementVariant,
|
|
584
|
+
RequirementsChecklist
|
|
557
585
|
};
|
|
558
586
|
//# sourceMappingURL=index.js.map
|