@coinlist-co/react 0.2.0 → 0.4.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 (67) hide show
  1. package/dist/RequirementItem-B-MvcxSr.d.cts +37 -0
  2. package/dist/RequirementItem-DcYot2uC.d.ts +37 -0
  3. package/dist/chunk-EHZ6PIGN.js +414 -0
  4. package/dist/chunk-EHZ6PIGN.js.map +1 -0
  5. package/dist/chunk-NC45IO63.js +777 -0
  6. package/dist/chunk-NC45IO63.js.map +1 -0
  7. package/dist/chunk-RIFATQB5.js +257 -0
  8. package/dist/chunk-RIFATQB5.js.map +1 -0
  9. package/dist/chunk-UGJUTRXC.js +304 -0
  10. package/dist/chunk-UGJUTRXC.js.map +1 -0
  11. package/dist/client/components/index.cjs +473 -10
  12. package/dist/client/components/index.cjs.map +1 -1
  13. package/dist/client/components/index.d.cts +80 -12
  14. package/dist/client/components/index.d.ts +80 -12
  15. package/dist/client/components/index.js +243 -243
  16. package/dist/client/components/index.js.map +1 -1
  17. package/dist/client/core/index.cjs +349 -202
  18. package/dist/client/core/index.cjs.map +1 -1
  19. package/dist/client/core/index.d.cts +4 -4
  20. package/dist/client/core/index.d.ts +4 -4
  21. package/dist/client/core/index.js +16 -14
  22. package/dist/client/hooks/index.cjs +133 -16
  23. package/dist/client/hooks/index.cjs.map +1 -1
  24. package/dist/client/hooks/index.d.cts +102 -8
  25. package/dist/client/hooks/index.d.ts +102 -8
  26. package/dist/client/hooks/index.js +11 -9
  27. package/dist/client/index.cjs +591 -210
  28. package/dist/client/index.cjs.map +1 -1
  29. package/dist/client/index.d.cts +7 -6
  30. package/dist/client/index.d.ts +7 -6
  31. package/dist/client/index.js +41 -17
  32. package/dist/client/styles.css +1 -1
  33. package/dist/coinlist-client-BSxpqylo.d.ts +158 -0
  34. package/dist/coinlist-client-Cah5c_aF.d.cts +158 -0
  35. package/dist/participation-DMMEDxON.d.cts +185 -0
  36. package/dist/participation-E-bT-GXJ.d.ts +185 -0
  37. package/dist/requirement-XWT0T_zO.d.cts +205 -0
  38. package/dist/requirement-XWT0T_zO.d.ts +205 -0
  39. package/dist/server/index.cjs +519 -14
  40. package/dist/server/index.cjs.map +1 -1
  41. package/dist/server/index.d.cts +73 -4
  42. package/dist/server/index.d.ts +73 -4
  43. package/dist/server/index.js +116 -20
  44. package/dist/server/index.js.map +1 -1
  45. package/dist/useCoinListRequirements-B5-ZPOMz.d.ts +80 -0
  46. package/dist/useCoinListRequirements-Cuc32Tqw.d.cts +80 -0
  47. package/package.json +4 -4
  48. package/dist/chunk-32GOUV3L.js +0 -118
  49. package/dist/chunk-32GOUV3L.js.map +0 -1
  50. package/dist/chunk-G3B4RLXP.js +0 -76
  51. package/dist/chunk-G3B4RLXP.js.map +0 -1
  52. package/dist/chunk-GRVV7NLV.js +0 -282
  53. package/dist/chunk-GRVV7NLV.js.map +0 -1
  54. package/dist/chunk-Z5RFQOMS.js +0 -560
  55. package/dist/chunk-Z5RFQOMS.js.map +0 -1
  56. package/dist/coinlist-client-20v7fJSW.d.ts +0 -394
  57. package/dist/coinlist-client-Ds86ycAg.d.cts +0 -394
  58. package/dist/newtype-yKTvFdg_.d.cts +0 -6
  59. package/dist/newtype-yKTvFdg_.d.ts +0 -6
  60. package/dist/oauth-session-DgItaMKN.d.cts +0 -56
  61. package/dist/oauth-session-DnKDI5ou.d.ts +0 -56
  62. package/dist/offer-D6p_Ijme.d.cts +0 -30
  63. package/dist/offer-DnFEFJw9.d.ts +0 -30
  64. package/dist/useCoinListOffers-DIdOb5hB.d.ts +0 -27
  65. package/dist/useCoinListOffers-DvJxu6qj.d.cts +0 -27
  66. package/dist/useCompleteCoinListOAuth-C359mp_k.d.cts +0 -55
  67. package/dist/useCompleteCoinListOAuth-wZX3o8r2.d.ts +0 -55
@@ -1,125 +1,29 @@
1
1
  import {
2
- useCoinListOffers
3
- } from "../../chunk-G3B4RLXP.js";
2
+ AlertBanner,
3
+ ChecklistStatus,
4
+ ClButton,
5
+ RequirementItem,
6
+ RequirementItemUi,
7
+ RequirementStatus,
8
+ RequirementVariant,
9
+ cn,
10
+ typeClasses
11
+ } from "../../chunk-EHZ6PIGN.js";
4
12
  import {
5
- useCoinList
6
- } from "../../chunk-32GOUV3L.js";
7
- import "../../chunk-Z5RFQOMS.js";
8
- import "../../chunk-GRVV7NLV.js";
13
+ useCoinList,
14
+ useCoinListOffers,
15
+ useCoinListRequirements
16
+ } from "../../chunk-UGJUTRXC.js";
17
+ import "../../chunk-RIFATQB5.js";
18
+ import "../../chunk-NC45IO63.js";
9
19
 
10
20
  // src/client/components/index.ts
11
21
  import "../styles.css";
12
22
 
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
23
  // src/client/components/design-system/logos/CoinListLogomark.tsx
120
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
24
+ import { jsx, jsxs } from "react/jsx-runtime";
121
25
  function CoinListLogomark(props) {
122
- return /* @__PURE__ */ jsxs2(
26
+ return /* @__PURE__ */ jsxs(
123
27
  "svg",
124
28
  {
125
29
  width: "115",
@@ -130,28 +34,28 @@ function CoinListLogomark(props) {
130
34
  "aria-hidden": "true",
131
35
  ...props,
132
36
  children: [
133
- /* @__PURE__ */ jsx2(
37
+ /* @__PURE__ */ jsx(
134
38
  "path",
135
39
  {
136
40
  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
41
  fill: "currentColor"
138
42
  }
139
43
  ),
140
- /* @__PURE__ */ jsx2(
44
+ /* @__PURE__ */ jsx(
141
45
  "path",
142
46
  {
143
47
  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
48
  fill: "currentColor"
145
49
  }
146
50
  ),
147
- /* @__PURE__ */ jsx2(
51
+ /* @__PURE__ */ jsx(
148
52
  "path",
149
53
  {
150
54
  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
55
  fill: "currentColor"
152
56
  }
153
57
  ),
154
- /* @__PURE__ */ jsx2(
58
+ /* @__PURE__ */ jsx(
155
59
  "path",
156
60
  {
157
61
  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 +68,7 @@ function CoinListLogomark(props) {
164
68
  }
165
69
 
166
70
  // src/client/components/CoinListSignInButton.tsx
167
- import { jsx as jsx3 } from "react/jsx-runtime";
71
+ import { jsx as jsx2 } from "react/jsx-runtime";
168
72
  function CoinListSignInButton({
169
73
  onClick,
170
74
  disabled = false,
@@ -172,7 +76,7 @@ function CoinListSignInButton({
172
76
  isLoading = false,
173
77
  className
174
78
  }) {
175
- return /* @__PURE__ */ jsx3(
79
+ return /* @__PURE__ */ jsx2(
176
80
  ClButton,
177
81
  {
178
82
  variant: "primary",
@@ -182,88 +86,22 @@ function CoinListSignInButton({
182
86
  disabled,
183
87
  isLoading,
184
88
  loadingText: "Signing in...",
185
- startIcon: /* @__PURE__ */ jsx3(CoinListLogomark, { className: "h-[18px] w-[16px] shrink-0" }),
89
+ startIcon: /* @__PURE__ */ jsx2(CoinListLogomark, { className: "h-[18px] w-[16px] shrink-0" }),
186
90
  className,
187
91
  children: "Continue with CoinList"
188
92
  }
189
93
  );
190
94
  }
191
95
 
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
96
  // src/client/components/design-system/CloseButton.tsx
259
97
  import { X } from "lucide-react";
260
- import { jsx as jsx5 } from "react/jsx-runtime";
98
+ import { jsx as jsx3 } from "react/jsx-runtime";
261
99
  function CloseButton({
262
100
  onClick,
263
101
  "aria-label": ariaLabel = "Close",
264
102
  className
265
103
  }) {
266
- return /* @__PURE__ */ jsx5(
104
+ return /* @__PURE__ */ jsx3(
267
105
  "button",
268
106
  {
269
107
  type: "button",
@@ -273,15 +111,15 @@ function CloseButton({
273
111
  "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
112
  className
275
113
  ),
276
- children: /* @__PURE__ */ jsx5(X, { className: "h-5 w-5" })
114
+ children: /* @__PURE__ */ jsx3(X, { className: "h-5 w-5" })
277
115
  }
278
116
  );
279
117
  }
280
118
 
281
119
  // src/client/components/design-system/logos/CoinListWordmark.tsx
282
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
120
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
283
121
  function CoinListWordmark(props) {
284
- return /* @__PURE__ */ jsxs4(
122
+ return /* @__PURE__ */ jsxs2(
285
123
  "svg",
286
124
  {
287
125
  width: "638",
@@ -292,35 +130,35 @@ function CoinListWordmark(props) {
292
130
  "aria-hidden": "true",
293
131
  ...props,
294
132
  children: [
295
- /* @__PURE__ */ jsx6(
133
+ /* @__PURE__ */ jsx4(
296
134
  "path",
297
135
  {
298
136
  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
137
  fill: "currentColor"
300
138
  }
301
139
  ),
302
- /* @__PURE__ */ jsx6(
140
+ /* @__PURE__ */ jsx4(
303
141
  "path",
304
142
  {
305
143
  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
144
  fill: "currentColor"
307
145
  }
308
146
  ),
309
- /* @__PURE__ */ jsx6(
147
+ /* @__PURE__ */ jsx4(
310
148
  "path",
311
149
  {
312
150
  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
151
  fill: "currentColor"
314
152
  }
315
153
  ),
316
- /* @__PURE__ */ jsx6(
154
+ /* @__PURE__ */ jsx4(
317
155
  "path",
318
156
  {
319
157
  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
158
  fill: "currentColor"
321
159
  }
322
160
  ),
323
- /* @__PURE__ */ jsx6(
161
+ /* @__PURE__ */ jsx4(
324
162
  "path",
325
163
  {
326
164
  fillRule: "evenodd",
@@ -335,9 +173,9 @@ function CoinListWordmark(props) {
335
173
  }
336
174
 
337
175
  // src/client/components/PoweredByCoinList.tsx
338
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
176
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
339
177
  function PoweredByCoinList({ className }) {
340
- return /* @__PURE__ */ jsxs5(
178
+ return /* @__PURE__ */ jsxs3(
341
179
  "div",
342
180
  {
343
181
  className: cn(
@@ -345,21 +183,21 @@ function PoweredByCoinList({ className }) {
345
183
  className
346
184
  ),
347
185
  children: [
348
- /* @__PURE__ */ jsx7("span", { className: cn(typeClasses.caption, "tracking-[0.12px]"), children: "Powered by" }),
349
- /* @__PURE__ */ jsx7(CoinListWordmark, { className: "h-3 w-auto" })
186
+ /* @__PURE__ */ jsx5("span", { className: cn(typeClasses.caption, "tracking-[0.12px]"), children: "Powered by" }),
187
+ /* @__PURE__ */ jsx5(CoinListWordmark, { className: "h-3 w-auto" })
350
188
  ]
351
189
  }
352
190
  );
353
191
  }
354
192
 
355
193
  // src/client/components/CoinListSignInCard.tsx
356
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
194
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
357
195
  function CoinListSignInCard() {
358
196
  const { coinlist } = useCoinList();
359
197
  const onSignIn = async () => {
360
198
  await coinlist.startOAuth();
361
199
  };
362
- return /* @__PURE__ */ jsx8(BaseCoinListSignInCard, { onSignIn });
200
+ return /* @__PURE__ */ jsx6(BaseCoinListSignInCard, { onSignIn });
363
201
  }
364
202
  function BaseCoinListSignInCard({
365
203
  state = "idle",
@@ -367,7 +205,7 @@ function BaseCoinListSignInCard({
367
205
  onClose,
368
206
  className
369
207
  }) {
370
- return /* @__PURE__ */ jsxs6(
208
+ return /* @__PURE__ */ jsxs4(
371
209
  "div",
372
210
  {
373
211
  className: cn(
@@ -375,13 +213,13 @@ function BaseCoinListSignInCard({
375
213
  className
376
214
  ),
377
215
  children: [
378
- onClose && /* @__PURE__ */ jsx8(CloseButton, { onClick: onClose, className: "absolute right-4 top-4" }),
379
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-2", children: [
380
- /* @__PURE__ */ jsx8("h3", { className: cn(typeClasses.h3, "text-text-primary"), children: "Sign in to participate" }),
381
- /* @__PURE__ */ jsx8("p", { className: cn(typeClasses.body, "text-text-secondary"), children: "A CoinList account is required to participate in this sale." })
216
+ onClose && /* @__PURE__ */ jsx6(CloseButton, { onClick: onClose, className: "absolute right-4 top-4" }),
217
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2", children: [
218
+ /* @__PURE__ */ jsx6("h3", { className: cn(typeClasses.h3, "text-text-primary"), children: "Sign in to participate" }),
219
+ /* @__PURE__ */ jsx6("p", { className: cn(typeClasses.body, "text-text-secondary"), children: "A CoinList account is required to participate in this sale." })
382
220
  ] }),
383
- /* @__PURE__ */ jsx8(CoinListSignInButton, { onClick: onSignIn, fullWidth: true, className: "mt-4" }),
384
- state === "error" && /* @__PURE__ */ jsx8(
221
+ /* @__PURE__ */ jsx6(CoinListSignInButton, { onClick: onSignIn, fullWidth: true, className: "mt-4" }),
222
+ state === "error" && /* @__PURE__ */ jsx6(
385
223
  AlertBanner,
386
224
  {
387
225
  variant: "error",
@@ -390,18 +228,27 @@ function BaseCoinListSignInCard({
390
228
  className: "mt-4"
391
229
  }
392
230
  ),
393
- /* @__PURE__ */ jsx8(PoweredByCoinList, { className: "mt-4" })
231
+ /* @__PURE__ */ jsx6(PoweredByCoinList, { className: "mt-4" })
394
232
  ]
395
233
  }
396
234
  );
397
235
  }
398
236
 
399
237
  // src/client/components/offers/OfferCard.tsx
400
- import { Fragment, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
238
+ import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
401
239
  var monthYearFormatter = new Intl.DateTimeFormat("en-US", {
402
240
  month: "short",
403
241
  year: "numeric"
404
242
  });
243
+ var OfferCardUi = {
244
+ fromDomain: (offer) => ({
245
+ tagline: offer.tagline,
246
+ bannerUrl: offer.bannerUrl,
247
+ logoUrl: offer.logoUrl,
248
+ formattedStartsAt: monthYearFormatter.format(offer.startsAt),
249
+ formattedEndsAt: monthYearFormatter.format(offer.endsAt)
250
+ })
251
+ };
405
252
  function OfferCard({
406
253
  offer,
407
254
  onClick,
@@ -409,35 +256,35 @@ function OfferCard({
409
256
  containerClassName
410
257
  }) {
411
258
  const cardLabel = "Open offer details";
412
- const cardContent = /* @__PURE__ */ jsxs7(Fragment, { children: [
413
- /* @__PURE__ */ jsxs7("div", { className: "relative mb-6 h-52 w-full overflow-hidden rounded-2xl border border-border/60 bg-section", children: [
414
- offer.bannerUrl ? /* @__PURE__ */ jsx9(
259
+ const cardContent = /* @__PURE__ */ jsxs5(Fragment, { children: [
260
+ /* @__PURE__ */ jsxs5("div", { className: "relative mb-6 h-52 w-full overflow-hidden rounded-2xl border border-border/60 bg-section", children: [
261
+ offer.bannerUrl ? /* @__PURE__ */ jsx7(
415
262
  "img",
416
263
  {
417
264
  src: offer.bannerUrl,
418
265
  alt: "Offer banner",
419
266
  className: "h-full w-full object-cover"
420
267
  }
421
- ) : /* @__PURE__ */ jsx9("div", { className: "h-full w-full bg-gradient-to-br from-surface via-section to-background" }),
422
- /* @__PURE__ */ jsx9("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-overlay/35" }),
423
- /* @__PURE__ */ jsx9("div", { className: "absolute inset-0 flex items-center justify-center p-6", children: offer.logoUrl ? /* @__PURE__ */ jsx9(
268
+ ) : /* @__PURE__ */ jsx7("div", { className: "h-full w-full bg-gradient-to-br from-surface via-section to-background" }),
269
+ /* @__PURE__ */ jsx7("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-overlay/35" }),
270
+ /* @__PURE__ */ jsx7("div", { className: "absolute inset-0 flex items-center justify-center p-6", children: offer.logoUrl ? /* @__PURE__ */ jsx7(
424
271
  "img",
425
272
  {
426
273
  src: offer.logoUrl,
427
274
  alt: "Offer logo",
428
275
  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
276
  }
430
- ) : /* @__PURE__ */ jsx9("div", { className: "h-28 w-28 rounded-full border border-border bg-surface shadow-[0_10px_24px_rgba(0,0,0,0.18)]" }) })
277
+ ) : /* @__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
278
  ] }),
432
- offer.tagline && /* @__PURE__ */ jsx9("p", { className: cn(typeClasses.h3, "min-h-[2.4rem] text-text-primary"), children: offer.tagline }),
433
- /* @__PURE__ */ jsxs7("div", { className: "mt-4 grid grid-cols-2 gap-5 border-t border-divider pt-4", children: [
434
- /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1", children: [
435
- /* @__PURE__ */ jsx9("span", { className: cn(typeClasses.subhead, "text-text-secondary"), children: "Starts" }),
436
- /* @__PURE__ */ jsx9("span", { className: cn(typeClasses.label, "text-text-primary"), children: monthYearFormatter.format(offer.startsAt) })
279
+ offer.tagline && /* @__PURE__ */ jsx7("p", { className: cn(typeClasses.h3, "min-h-[2.4rem] text-text-primary"), children: offer.tagline }),
280
+ /* @__PURE__ */ jsxs5("div", { className: "mt-4 grid grid-cols-2 gap-5 border-t border-divider pt-4", children: [
281
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1", children: [
282
+ /* @__PURE__ */ jsx7("span", { className: cn(typeClasses.subhead, "text-text-secondary"), children: "Starts" }),
283
+ /* @__PURE__ */ jsx7("span", { className: cn(typeClasses.label, "text-text-primary"), children: offer.formattedStartsAt })
437
284
  ] }),
438
- /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1", children: [
439
- /* @__PURE__ */ jsx9("span", { className: cn(typeClasses.subhead, "text-text-secondary"), children: "Ends" }),
440
- /* @__PURE__ */ jsx9("span", { className: cn(typeClasses.label, "text-text-primary"), children: monthYearFormatter.format(offer.endsAt) })
285
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1", children: [
286
+ /* @__PURE__ */ jsx7("span", { className: cn(typeClasses.subhead, "text-text-secondary"), children: "Ends" }),
287
+ /* @__PURE__ */ jsx7("span", { className: cn(typeClasses.label, "text-text-primary"), children: offer.formattedEndsAt })
441
288
  ] })
442
289
  ] })
443
290
  ] });
@@ -448,7 +295,7 @@ function OfferCard({
448
295
  );
449
296
  let cardNode;
450
297
  if (onClick) {
451
- cardNode = /* @__PURE__ */ jsx9(
298
+ cardNode = /* @__PURE__ */ jsx7(
452
299
  "button",
453
300
  {
454
301
  type: "button",
@@ -459,20 +306,22 @@ function OfferCard({
459
306
  }
460
307
  );
461
308
  } else {
462
- cardNode = /* @__PURE__ */ jsx9("div", { className: baseClasses, children: cardContent });
309
+ cardNode = /* @__PURE__ */ jsx7("div", { className: baseClasses, children: cardContent });
463
310
  }
464
311
  if (!containerClassName) {
465
312
  return cardNode;
466
313
  }
467
- return /* @__PURE__ */ jsx9("div", { className: containerClassName, children: cardNode });
314
+ return /* @__PURE__ */ jsx7("div", { className: containerClassName, children: cardNode });
468
315
  }
469
316
 
470
317
  // src/client/components/offers/OffersGrid.tsx
471
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
318
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
472
319
  var DEFAULT_MAX_COLUMNS = 3;
473
320
  function OffersGrid(props) {
474
- const { offersState } = useCoinListOffers();
475
- return /* @__PURE__ */ jsx10(BaseOffersGrid, { ...props, offersState });
321
+ const { offersState } = useCoinListOffers({
322
+ serverOffers: props.serverOffers
323
+ });
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__ */ jsx10(
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__ */ jsx10("p", { className: cn(typeClasses.body, "text-text-secondary"), children: "Loading offers..." })
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__ */ jsx10(
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__ */ jsxs8(
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__ */ jsx10("p", { className: cn(typeClasses.body, "font-medium text-text-primary"), children: "No offers available" }),
527
- /* @__PURE__ */ jsx10("p", { className: cn(typeClasses.subhead, "text-text-secondary"), children: "Check back soon for upcoming opportunities." })
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__ */ jsx10("div", { className: cn("flex w-full justify-center", containerClassName), children: /* @__PURE__ */ jsx10(
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__ */ jsx10(
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,161 @@ function BaseOffersGrid({
549
398
  }
550
399
  ) });
551
400
  }
401
+
402
+ // src/client/components/requirements/RequirementsChecklist.tsx
403
+ import { useState } from "react";
404
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
405
+ var DEFAULT_LABELS = {
406
+ kyc_approved: "KYC Verification",
407
+ identity_verified: "Identity Verification",
408
+ proof_of_address: "Proof of Address",
409
+ source_of_funds: "Source of Funds",
410
+ external_wallet: "External Wallet",
411
+ whitelisted_wallet: "Whitelisted Wallet",
412
+ jurisdiction: "Jurisdiction Check",
413
+ accreditation: "Accreditation"
414
+ };
415
+ var DEFAULT_DESCRIPTIONS = {
416
+ kyc_approved: "Complete Know Your Customer verification.",
417
+ identity_verified: "Verify your identity.",
418
+ proof_of_address: "Provide proof of your residential address.",
419
+ source_of_funds: "Provide documentation for your source of funds.",
420
+ external_wallet: "Connect an external wallet.",
421
+ whitelisted_wallet: "Connect a whitelisted wallet.",
422
+ jurisdiction: "Confirm your jurisdiction eligibility.",
423
+ accreditation: "Verify your accreditation status."
424
+ };
425
+ function RequirementsChecklist(props) {
426
+ const { coinlist } = useCoinList();
427
+ const { requirementsState } = useCoinListRequirements(props.offerId, {
428
+ serverData: props.serverData
429
+ });
430
+ const onRequirementAction = props.onRequirementActionOverride !== void 0 ? props.onRequirementActionOverride : (requirement) => coinlist.handleRequirement(requirement);
431
+ const onContactSupport = props.onContactSupportOverride !== void 0 ? props.onContactSupportOverride : () => coinlist.contactSupport();
432
+ return /* @__PURE__ */ jsx9(
433
+ BaseRequirementsChecklist,
434
+ {
435
+ ...props,
436
+ onRequirementActionOverride: onRequirementAction,
437
+ onContactSupportOverride: onContactSupport,
438
+ requirementsState
439
+ }
440
+ );
441
+ }
442
+ function BaseRequirementsChecklist({
443
+ requirementsState,
444
+ optionId,
445
+ title,
446
+ description,
447
+ onContinue,
448
+ onRequirementActionOverride: onRequirementAction,
449
+ onContactSupportOverride: onContactSupport,
450
+ getLabel,
451
+ getDescription,
452
+ loading,
453
+ error,
454
+ className
455
+ }) {
456
+ const [expandedIndex, setExpandedIndex] = useState(null);
457
+ if (requirementsState.type === "LOADING") {
458
+ if (loading) return loading;
459
+ return /* @__PURE__ */ jsx9(
460
+ "output",
461
+ {
462
+ "aria-live": "polite",
463
+ className: "flex min-h-40 items-center justify-center rounded-2xl border border-border bg-background p-6",
464
+ children: /* @__PURE__ */ jsx9("p", { className: cn(typeClasses.body, "text-text-secondary"), children: "Loading requirements..." })
465
+ }
466
+ );
467
+ }
468
+ if (requirementsState.type === "ERROR") {
469
+ if (error) return error;
470
+ const errorMessage = requirementsState.reason === "not-authenticated" ? "Sign in to view requirements." : "Unable to load requirements right now. Please try again.";
471
+ return /* @__PURE__ */ jsx9(
472
+ AlertBanner,
473
+ {
474
+ variant: "error",
475
+ icon: true,
476
+ content: errorMessage,
477
+ className: "w-full max-w-[28rem]"
478
+ }
479
+ );
480
+ }
481
+ const { requirementsByOptionId, statuses } = requirementsState;
482
+ const requirements = requirementsByOptionId[optionId] ?? [];
483
+ const requirementIds = new Set(requirements.map((r) => r.id));
484
+ const optionStatuses = statuses.filter((s) => requirementIds.has(s.id));
485
+ const statusByRequirementId = new Map(optionStatuses.map((s) => [s.id, s]));
486
+ const checklistStatus = ChecklistStatus.derive(optionStatuses);
487
+ return /* @__PURE__ */ jsxs7("div", { className: cn("flex w-full flex-col gap-4", className), children: [
488
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-2", children: [
489
+ /* @__PURE__ */ jsx9("h3", { className: cn(typeClasses.h3, "text-text-primary"), children: title }),
490
+ /* @__PURE__ */ jsx9("p", { className: cn(typeClasses.body, "text-text-secondary"), children: description })
491
+ ] }),
492
+ /* @__PURE__ */ jsx9("div", { className: "flex flex-col divide-y divide-divider", children: requirements.map((req, index) => {
493
+ const statusInfo = statusByRequirementId.get(req.id);
494
+ const label = getLabel ? getLabel(req) : DEFAULT_LABELS[req.type];
495
+ const description2 = (getDescription ? getDescription(req) : null) ?? DEFAULT_DESCRIPTIONS[req.type];
496
+ let onActionBound;
497
+ if (onRequirementAction === null) {
498
+ onActionBound = null;
499
+ } else if (onRequirementAction) {
500
+ onActionBound = () => onRequirementAction(req);
501
+ }
502
+ let onContactSupportBound;
503
+ if (onContactSupport === null) {
504
+ onContactSupportBound = null;
505
+ } else if (onContactSupport) {
506
+ onContactSupportBound = () => onContactSupport(req);
507
+ }
508
+ return /* @__PURE__ */ jsx9(
509
+ RequirementItem,
510
+ {
511
+ ui: RequirementItemUi.fromDomain(
512
+ req,
513
+ statusInfo,
514
+ label,
515
+ description2
516
+ ),
517
+ expanded: expandedIndex === index,
518
+ onToggle: () => setExpandedIndex((prev) => prev === index ? null : index),
519
+ onAction: onActionBound,
520
+ onContactSupport: onContactSupportBound
521
+ },
522
+ req.id
523
+ );
524
+ }) }),
525
+ checklistStatus === "ineligible" && /* @__PURE__ */ jsx9(
526
+ AlertBanner,
527
+ {
528
+ variant: "error",
529
+ icon: true,
530
+ content: "You are not eligible to participate."
531
+ }
532
+ ),
533
+ onContinue && /* @__PURE__ */ jsx9(
534
+ ClButton,
535
+ {
536
+ fullWidth: true,
537
+ disabled: checklistStatus !== "eligible",
538
+ onClick: onContinue,
539
+ children: "Continue"
540
+ }
541
+ )
542
+ ] });
543
+ }
552
544
  export {
553
545
  BaseCoinListSignInCard,
546
+ BaseRequirementsChecklist,
547
+ ChecklistStatus,
554
548
  CoinListSignInCard,
555
549
  OfferCard,
556
- OffersGrid
550
+ OfferCardUi,
551
+ OffersGrid,
552
+ RequirementItem,
553
+ RequirementItemUi,
554
+ RequirementStatus,
555
+ RequirementVariant,
556
+ RequirementsChecklist
557
557
  };
558
558
  //# sourceMappingURL=index.js.map