@tetsuo-ai/marketplace-react 0.1.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 (112) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/LICENSE +21 -0
  3. package/README.md +172 -0
  4. package/dist/chunk-5OTKSRHM.js +128 -0
  5. package/dist/chunk-5OTKSRHM.js.map +1 -0
  6. package/dist/chunk-ABS77JB2.js +94 -0
  7. package/dist/chunk-ABS77JB2.js.map +1 -0
  8. package/dist/chunk-GN5DYVN5.js +35 -0
  9. package/dist/chunk-GN5DYVN5.js.map +1 -0
  10. package/dist/chunk-KJMR6OGC.js +1198 -0
  11. package/dist/chunk-KJMR6OGC.js.map +1 -0
  12. package/dist/chunk-YORZNYZZ.js +107 -0
  13. package/dist/chunk-YORZNYZZ.js.map +1 -0
  14. package/dist/components/agenc-components.css +570 -0
  15. package/dist/components/index.cjs +1335 -0
  16. package/dist/components/index.cjs.map +1 -0
  17. package/dist/components/index.d.cts +5 -0
  18. package/dist/components/index.d.ts +5 -0
  19. package/dist/components/index.js +5 -0
  20. package/dist/components/index.js.map +1 -0
  21. package/dist/hooks/index.cjs +493 -0
  22. package/dist/hooks/index.cjs.map +1 -0
  23. package/dist/hooks/index.d.cts +294 -0
  24. package/dist/hooks/index.d.ts +294 -0
  25. package/dist/hooks/index.js +339 -0
  26. package/dist/hooks/index.js.map +1 -0
  27. package/dist/index-BLrlBVj-.d.cts +1129 -0
  28. package/dist/index-CKTYsNPH.d.ts +1129 -0
  29. package/dist/index.cjs +1690 -0
  30. package/dist/index.cjs.map +1 -0
  31. package/dist/index.d.cts +235 -0
  32. package/dist/index.d.ts +235 -0
  33. package/dist/index.js +127 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/signers/index.cjs +166 -0
  36. package/dist/signers/index.cjs.map +1 -0
  37. package/dist/signers/index.d.cts +136 -0
  38. package/dist/signers/index.d.ts +136 -0
  39. package/dist/signers/index.js +4 -0
  40. package/dist/signers/index.js.map +1 -0
  41. package/dist/testing/index.cjs +62 -0
  42. package/dist/testing/index.cjs.map +1 -0
  43. package/dist/testing/index.d.cts +71 -0
  44. package/dist/testing/index.d.ts +71 -0
  45. package/dist/testing/index.js +60 -0
  46. package/dist/testing/index.js.map +1 -0
  47. package/dist/theme/agenc-tailwind-preset.cjs +184 -0
  48. package/dist/theme/agenc-tokens.css +132 -0
  49. package/dist/types-jvISR6bc.d.cts +135 -0
  50. package/dist/types-jvISR6bc.d.ts +135 -0
  51. package/dist/useAgentTrackRecord-BLf1nrbu.d.cts +249 -0
  52. package/dist/useAgentTrackRecord-BLf1nrbu.d.ts +249 -0
  53. package/package.json +139 -0
  54. package/src/components/DisputeBanner.stories.tsx +39 -0
  55. package/src/components/DisputeBanner.tsx +110 -0
  56. package/src/components/HireButton.stories.tsx +72 -0
  57. package/src/components/HireButton.tsx +151 -0
  58. package/src/components/HireCheckoutModal.stories.tsx +107 -0
  59. package/src/components/HireCheckoutModal.tsx +284 -0
  60. package/src/components/ListingCard.stories.tsx +55 -0
  61. package/src/components/ListingCard.tsx +148 -0
  62. package/src/components/ListingGrid.stories.tsx +44 -0
  63. package/src/components/ListingGrid.tsx +137 -0
  64. package/src/components/Modal.tsx +121 -0
  65. package/src/components/PoweredByAgenC.tsx +85 -0
  66. package/src/components/ProviderCard.stories.tsx +61 -0
  67. package/src/components/ProviderCard.tsx +154 -0
  68. package/src/components/ReferrerDisclosure.tsx +67 -0
  69. package/src/components/ReviewPanel.stories.tsx +65 -0
  70. package/src/components/ReviewPanel.tsx +141 -0
  71. package/src/components/TaskTimeline.stories.tsx +43 -0
  72. package/src/components/TaskTimeline.tsx +156 -0
  73. package/src/components/__fixtures__/index.tsx +173 -0
  74. package/src/components/agenc-components.css +570 -0
  75. package/src/components/badges.tsx +115 -0
  76. package/src/components/format.ts +150 -0
  77. package/src/components/index.ts +102 -0
  78. package/src/components/primitives.tsx +236 -0
  79. package/src/components/strings.ts +131 -0
  80. package/src/components/useFocusTrap.ts +122 -0
  81. package/src/hooks/index.ts +90 -0
  82. package/src/hooks/internal.ts +70 -0
  83. package/src/hooks/useAgentTrackRecord.ts +166 -0
  84. package/src/hooks/useDispute.ts +130 -0
  85. package/src/hooks/useHire.ts +198 -0
  86. package/src/hooks/useListing.ts +138 -0
  87. package/src/hooks/useListings.ts +133 -0
  88. package/src/hooks/useReferrerEarnings.ts +134 -0
  89. package/src/hooks/useSubmissionReview.ts +179 -0
  90. package/src/hooks/useTaskStatus.ts +192 -0
  91. package/src/hooks/useWalletSigner.ts +99 -0
  92. package/src/index.ts +170 -0
  93. package/src/provider/AgencProvider.tsx +169 -0
  94. package/src/provider/context.ts +35 -0
  95. package/src/provider/index.ts +17 -0
  96. package/src/provider/network.ts +68 -0
  97. package/src/provider/referrer.ts +97 -0
  98. package/src/signers/README.md +130 -0
  99. package/src/signers/embedded-wallet-mock.ts +158 -0
  100. package/src/signers/embedded-wallet.ts +64 -0
  101. package/src/signers/index.ts +48 -0
  102. package/src/signers/strings.ts +39 -0
  103. package/src/signers/types.ts +158 -0
  104. package/src/signers/wallet-account.ts +128 -0
  105. package/src/signers/wallet-adapter.ts +149 -0
  106. package/src/strings/index.ts +119 -0
  107. package/src/testing/index.ts +24 -0
  108. package/src/theme/agenc-tailwind-preset.cjs +184 -0
  109. package/src/theme/agenc-tokens.css +132 -0
  110. package/src/theme/index.ts +94 -0
  111. package/src/transport/index.ts +164 -0
  112. package/src/types.ts +224 -0
@@ -0,0 +1,570 @@
1
+ /* ============================================================================
2
+ * @tetsuo-ai/marketplace-react — prebuilt component recipes.
3
+ *
4
+ * Every rule styles itself ONLY through the `--agenc-*` custom properties
5
+ * declared by the foundation token sheet (`theme.css`). To restyle, override
6
+ * those variables on an ancestor — never edit these recipes per-brand. There is
7
+ * NO CSS-in-JS runtime: this is the entire styling surface for the components,
8
+ * and it is OPTIONAL (pass `unstyled` to drop every class below).
9
+ *
10
+ * Import order for the styled look:
11
+ * import "@tetsuo-ai/marketplace-react/theme.css"; // tokens
12
+ * import "@tetsuo-ai/marketplace-react/components.css"; // these recipes
13
+ * ============================================================================ */
14
+
15
+ /* --- Accessibility utility --------------------------------------------------*/
16
+ .agenc-visually-hidden {
17
+ position: absolute;
18
+ width: 1px;
19
+ height: 1px;
20
+ padding: 0;
21
+ margin: -1px;
22
+ overflow: hidden;
23
+ clip: rect(0, 0, 0, 0);
24
+ white-space: nowrap;
25
+ border: 0;
26
+ }
27
+
28
+ /* --- Spinner ----------------------------------------------------------------*/
29
+ .agenc-spinner {
30
+ display: inline-block;
31
+ width: 1em;
32
+ height: 1em;
33
+ border: 2px solid var(--agenc-border-strong, #4a2e7a);
34
+ border-top-color: var(--agenc-violet, #7b3fff);
35
+ border-radius: var(--agenc-radius-pill, 9999px);
36
+ animation: agenc-spin 0.7s linear infinite;
37
+ vertical-align: -0.15em;
38
+ }
39
+ @keyframes agenc-spin {
40
+ to {
41
+ transform: rotate(360deg);
42
+ }
43
+ }
44
+ @media (prefers-reduced-motion: reduce) {
45
+ .agenc-spinner {
46
+ animation-duration: 2s;
47
+ }
48
+ }
49
+
50
+ /* --- Button -----------------------------------------------------------------*/
51
+ .agenc-button {
52
+ display: inline-flex;
53
+ align-items: center;
54
+ gap: var(--agenc-space-2, 8px);
55
+ padding: var(--agenc-space-2, 8px) var(--agenc-space-4, 16px);
56
+ font: inherit;
57
+ font-weight: 600;
58
+ line-height: 1.2;
59
+ border: 1px solid transparent;
60
+ border-radius: var(--agenc-radius, 8px);
61
+ cursor: pointer;
62
+ transition: background-color 0.12s ease, border-color 0.12s ease,
63
+ opacity 0.12s ease;
64
+ }
65
+ .agenc-button:disabled {
66
+ opacity: 0.55;
67
+ cursor: not-allowed;
68
+ }
69
+ .agenc-button:focus-visible {
70
+ outline: 2px solid var(--agenc-cyan, #48c8ef);
71
+ outline-offset: 2px;
72
+ }
73
+ .agenc-button--primary {
74
+ background: var(--agenc-violet, #7b3fff);
75
+ color: var(--agenc-text, #f5f0ff);
76
+ }
77
+ .agenc-button--primary:hover:not(:disabled) {
78
+ background: var(--agenc-magenta, #ff2e93);
79
+ }
80
+ .agenc-button--secondary {
81
+ background: var(--agenc-surface-2, #221638);
82
+ color: var(--agenc-text, #f5f0ff);
83
+ border-color: var(--agenc-border-strong, #4a2e7a);
84
+ }
85
+ .agenc-button--secondary:hover:not(:disabled) {
86
+ background: var(--agenc-surface-3, #2e1a4a);
87
+ }
88
+ .agenc-button--ghost {
89
+ background: transparent;
90
+ color: var(--agenc-text-muted, #b8a8d9);
91
+ }
92
+ .agenc-button--ghost:hover:not(:disabled) {
93
+ color: var(--agenc-text, #f5f0ff);
94
+ }
95
+ .agenc-button--danger {
96
+ background: transparent;
97
+ color: var(--agenc-danger, #ff3d3d);
98
+ border-color: var(--agenc-danger, #ff3d3d);
99
+ }
100
+ .agenc-button--danger:hover:not(:disabled) {
101
+ background: var(--agenc-danger, #ff3d3d);
102
+ color: var(--agenc-void, #0a0612);
103
+ }
104
+
105
+ /* --- Badge ------------------------------------------------------------------*/
106
+ .agenc-badge {
107
+ display: inline-flex;
108
+ align-items: center;
109
+ padding: 2px var(--agenc-space-2, 8px);
110
+ font-size: 0.78em;
111
+ font-weight: 600;
112
+ line-height: 1.4;
113
+ border-radius: var(--agenc-radius-pill, 9999px);
114
+ border: 1px solid var(--agenc-border, #2e1a4a);
115
+ color: var(--agenc-text-muted, #b8a8d9);
116
+ background: var(--agenc-surface-2, #221638);
117
+ }
118
+ .agenc-badge--success {
119
+ color: var(--agenc-success, #3fffa0);
120
+ border-color: var(--agenc-success, #3fffa0);
121
+ }
122
+ .agenc-badge--warning {
123
+ color: var(--agenc-warning, #ffc53f);
124
+ border-color: var(--agenc-warning, #ffc53f);
125
+ }
126
+ .agenc-badge--danger {
127
+ color: var(--agenc-danger, #ff3d3d);
128
+ border-color: var(--agenc-danger, #ff3d3d);
129
+ }
130
+ .agenc-badge--info {
131
+ color: var(--agenc-cyan, #48c8ef);
132
+ border-color: var(--agenc-cyan, #48c8ef);
133
+ }
134
+
135
+ /* --- State block (loading / empty / error) ----------------------------------*/
136
+ .agenc-state {
137
+ display: flex;
138
+ align-items: center;
139
+ gap: var(--agenc-space-2, 8px);
140
+ padding: var(--agenc-space-4, 16px);
141
+ color: var(--agenc-text-muted, #b8a8d9);
142
+ font: inherit;
143
+ }
144
+ .agenc-state--error {
145
+ color: var(--agenc-danger, #ff3d3d);
146
+ }
147
+
148
+ /* --- ListingCard ------------------------------------------------------------*/
149
+ .agenc-listing-card {
150
+ display: flex;
151
+ flex-direction: column;
152
+ gap: var(--agenc-space-3, 12px);
153
+ padding: var(--agenc-space-4, 16px);
154
+ background: var(--agenc-surface, #16102a);
155
+ border: 1px solid var(--agenc-border, #2e1a4a);
156
+ border-radius: var(--agenc-radius-lg, 12px);
157
+ color: var(--agenc-text, #f5f0ff);
158
+ }
159
+ .agenc-listing-card__header {
160
+ display: flex;
161
+ align-items: flex-start;
162
+ justify-content: space-between;
163
+ gap: var(--agenc-space-2, 8px);
164
+ }
165
+ .agenc-listing-card__title {
166
+ margin: 0;
167
+ font-size: 1.05rem;
168
+ font-weight: 700;
169
+ color: var(--agenc-text, #f5f0ff);
170
+ }
171
+ .agenc-listing-card__title-button {
172
+ margin: 0;
173
+ padding: 0;
174
+ background: none;
175
+ border: none;
176
+ text-align: left;
177
+ cursor: pointer;
178
+ color: inherit;
179
+ }
180
+ .agenc-listing-card__title-button:focus-visible {
181
+ outline: 2px solid var(--agenc-cyan, #48c8ef);
182
+ outline-offset: 2px;
183
+ border-radius: var(--agenc-radius-sm, 4px);
184
+ }
185
+ .agenc-listing-card__meta {
186
+ display: flex;
187
+ flex-direction: column;
188
+ gap: var(--agenc-space-2, 8px);
189
+ margin: 0;
190
+ font-size: 0.85rem;
191
+ color: var(--agenc-text-muted, #b8a8d9);
192
+ }
193
+ .agenc-listing-card__meta-row {
194
+ display: flex;
195
+ align-items: center;
196
+ justify-content: space-between;
197
+ gap: var(--agenc-space-2, 8px);
198
+ }
199
+ .agenc-listing-card__meta dt,
200
+ .agenc-listing-card__meta dd {
201
+ margin: 0;
202
+ }
203
+ .agenc-listing-card__footer {
204
+ display: flex;
205
+ align-items: center;
206
+ justify-content: space-between;
207
+ gap: var(--agenc-space-3, 12px);
208
+ margin-top: auto;
209
+ }
210
+ .agenc-listing-card__price {
211
+ margin: 0;
212
+ }
213
+ .agenc-listing-card__price-label {
214
+ color: var(--agenc-text-dim, #6e5c8f);
215
+ font-size: 0.8rem;
216
+ }
217
+ .agenc-listing-card__price-value {
218
+ font-weight: 700;
219
+ color: var(--agenc-cyan, #48c8ef);
220
+ }
221
+
222
+ /* --- ListingGrid ------------------------------------------------------------*/
223
+ .agenc-listing-grid__list {
224
+ list-style: none;
225
+ margin: 0;
226
+ padding: 0;
227
+ display: grid;
228
+ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
229
+ gap: var(--agenc-space-4, 16px);
230
+ }
231
+ .agenc-listing-grid__item {
232
+ display: flex;
233
+ }
234
+ .agenc-listing-grid__item > * {
235
+ flex: 1;
236
+ }
237
+ .agenc-listing-grid__more {
238
+ display: flex;
239
+ justify-content: center;
240
+ margin-top: var(--agenc-space-4, 16px);
241
+ }
242
+
243
+ /* --- Modal ------------------------------------------------------------------*/
244
+ .agenc-modal {
245
+ position: fixed;
246
+ inset: 0;
247
+ display: flex;
248
+ align-items: center;
249
+ justify-content: center;
250
+ padding: var(--agenc-space-4, 16px);
251
+ background: rgba(10, 6, 18, 0.72);
252
+ z-index: 1000;
253
+ }
254
+ .agenc-modal__dialog {
255
+ width: 100%;
256
+ max-width: 420px;
257
+ max-height: 90vh;
258
+ overflow: auto;
259
+ background: var(--agenc-surface-2, #221638);
260
+ border: 1px solid var(--agenc-border-strong, #4a2e7a);
261
+ border-radius: var(--agenc-radius-lg, 12px);
262
+ color: var(--agenc-text, #f5f0ff);
263
+ box-shadow: var(--agenc-glow-violet, 0 0 24px #7b3fff66);
264
+ }
265
+ .agenc-modal__dialog:focus-visible {
266
+ outline: 2px solid var(--agenc-cyan, #48c8ef);
267
+ outline-offset: 2px;
268
+ }
269
+ .agenc-modal__header {
270
+ display: flex;
271
+ align-items: center;
272
+ justify-content: space-between;
273
+ gap: var(--agenc-space-2, 8px);
274
+ padding: var(--agenc-space-4, 16px);
275
+ border-bottom: 1px solid var(--agenc-border, #2e1a4a);
276
+ }
277
+ .agenc-modal__title {
278
+ margin: 0;
279
+ font-size: 1.1rem;
280
+ font-weight: 700;
281
+ }
282
+ .agenc-modal__close {
283
+ display: inline-flex;
284
+ align-items: center;
285
+ justify-content: center;
286
+ width: 2rem;
287
+ height: 2rem;
288
+ font-size: 1.4rem;
289
+ line-height: 1;
290
+ background: none;
291
+ border: none;
292
+ border-radius: var(--agenc-radius, 8px);
293
+ color: var(--agenc-text-muted, #b8a8d9);
294
+ cursor: pointer;
295
+ }
296
+ .agenc-modal__close:hover {
297
+ color: var(--agenc-text, #f5f0ff);
298
+ background: var(--agenc-surface-3, #2e1a4a);
299
+ }
300
+ .agenc-modal__close:focus-visible {
301
+ outline: 2px solid var(--agenc-cyan, #48c8ef);
302
+ outline-offset: 2px;
303
+ }
304
+ .agenc-modal__body {
305
+ padding: var(--agenc-space-4, 16px);
306
+ }
307
+ .agenc-modal__footer {
308
+ display: flex;
309
+ justify-content: flex-end;
310
+ gap: var(--agenc-space-2, 8px);
311
+ padding: var(--agenc-space-4, 16px);
312
+ border-top: 1px solid var(--agenc-border, #2e1a4a);
313
+ }
314
+
315
+ /* --- Checkout ---------------------------------------------------------------*/
316
+ .agenc-checkout {
317
+ display: flex;
318
+ flex-direction: column;
319
+ gap: var(--agenc-space-3, 12px);
320
+ }
321
+ .agenc-checkout__row {
322
+ display: flex;
323
+ align-items: baseline;
324
+ justify-content: space-between;
325
+ gap: var(--agenc-space-3, 12px);
326
+ }
327
+ .agenc-checkout__price-label {
328
+ color: var(--agenc-text-muted, #b8a8d9);
329
+ }
330
+ .agenc-checkout__price {
331
+ font-size: 1.35rem;
332
+ font-weight: 800;
333
+ color: var(--agenc-cyan, #48c8ef);
334
+ }
335
+ .agenc-checkout__escrow-note {
336
+ margin: 0;
337
+ font-size: 0.85rem;
338
+ color: var(--agenc-text-muted, #b8a8d9);
339
+ }
340
+ .agenc-checkout__status {
341
+ font-size: 0.9rem;
342
+ color: var(--agenc-success, #3fffa0);
343
+ }
344
+ .agenc-checkout__error {
345
+ display: flex;
346
+ flex-direction: column;
347
+ gap: 2px;
348
+ padding: var(--agenc-space-2, 8px) var(--agenc-space-3, 12px);
349
+ border: 1px solid var(--agenc-danger, #ff3d3d);
350
+ border-radius: var(--agenc-radius, 8px);
351
+ color: var(--agenc-danger, #ff3d3d);
352
+ font-size: 0.85rem;
353
+ }
354
+ .agenc-checkout__hint {
355
+ margin: 0;
356
+ font-size: 0.85rem;
357
+ color: var(--agenc-warning, #ffc53f);
358
+ }
359
+
360
+ /* --- Referrer disclosure ----------------------------------------------------*/
361
+ .agenc-referrer-disclosure {
362
+ margin: 0;
363
+ font-size: 0.8rem;
364
+ color: var(--agenc-text-dim, #6e5c8f);
365
+ }
366
+ .agenc-referrer-disclosure__fee {
367
+ color: var(--agenc-text-muted, #b8a8d9);
368
+ }
369
+
370
+ /* --- TaskTimeline -----------------------------------------------------------*/
371
+ .agenc-timeline__list {
372
+ list-style: none;
373
+ margin: 0;
374
+ padding: 0;
375
+ display: flex;
376
+ flex-direction: column;
377
+ gap: var(--agenc-space-3, 12px);
378
+ }
379
+ .agenc-timeline__step {
380
+ display: flex;
381
+ align-items: center;
382
+ gap: var(--agenc-space-3, 12px);
383
+ color: var(--agenc-text-dim, #6e5c8f);
384
+ }
385
+ .agenc-timeline__marker {
386
+ width: 0.75rem;
387
+ height: 0.75rem;
388
+ border-radius: var(--agenc-radius-pill, 9999px);
389
+ border: 2px solid currentColor;
390
+ flex: 0 0 auto;
391
+ }
392
+ .agenc-timeline__step--done {
393
+ color: var(--agenc-success, #3fffa0);
394
+ }
395
+ .agenc-timeline__step--done .agenc-timeline__marker {
396
+ background: var(--agenc-success, #3fffa0);
397
+ }
398
+ .agenc-timeline__step--current {
399
+ color: var(--agenc-cyan, #48c8ef);
400
+ font-weight: 700;
401
+ }
402
+ .agenc-timeline__step--current .agenc-timeline__marker {
403
+ background: var(--agenc-cyan, #48c8ef);
404
+ box-shadow: var(--agenc-glow-cyan, 0 0 24px #48c8ef66);
405
+ }
406
+ .agenc-timeline__terminal {
407
+ margin: var(--agenc-space-3, 12px) 0 0;
408
+ padding: var(--agenc-space-2, 8px) var(--agenc-space-3, 12px);
409
+ border-radius: var(--agenc-radius, 8px);
410
+ font-weight: 600;
411
+ }
412
+ .agenc-timeline__terminal--cancelled {
413
+ color: var(--agenc-text-muted, #b8a8d9);
414
+ background: var(--agenc-surface-2, #221638);
415
+ }
416
+ .agenc-timeline__terminal--disputed {
417
+ color: var(--agenc-warning, #ffc53f);
418
+ border: 1px solid var(--agenc-warning, #ffc53f);
419
+ }
420
+ .agenc-timeline__terminal--rejected {
421
+ color: var(--agenc-danger, #ff3d3d);
422
+ border: 1px solid var(--agenc-danger, #ff3d3d);
423
+ }
424
+
425
+ /* --- ReviewPanel ------------------------------------------------------------*/
426
+ .agenc-review {
427
+ display: flex;
428
+ flex-direction: column;
429
+ gap: var(--agenc-space-3, 12px);
430
+ padding: var(--agenc-space-4, 16px);
431
+ background: var(--agenc-surface, #16102a);
432
+ border: 1px solid var(--agenc-border, #2e1a4a);
433
+ border-radius: var(--agenc-radius-lg, 12px);
434
+ color: var(--agenc-text, #f5f0ff);
435
+ }
436
+ .agenc-review__title {
437
+ margin: 0;
438
+ font-size: 1rem;
439
+ font-weight: 700;
440
+ }
441
+ .agenc-review__actions {
442
+ display: flex;
443
+ flex-wrap: wrap;
444
+ gap: var(--agenc-space-2, 8px);
445
+ }
446
+ .agenc-review__status {
447
+ font-size: 0.9rem;
448
+ color: var(--agenc-success, #3fffa0);
449
+ }
450
+ .agenc-review__error {
451
+ display: flex;
452
+ flex-direction: column;
453
+ gap: 2px;
454
+ color: var(--agenc-danger, #ff3d3d);
455
+ font-size: 0.85rem;
456
+ }
457
+
458
+ /* --- DisputeBanner ----------------------------------------------------------*/
459
+ .agenc-dispute {
460
+ display: flex;
461
+ flex-direction: column;
462
+ gap: var(--agenc-space-2, 8px);
463
+ padding: var(--agenc-space-4, 16px);
464
+ border-radius: var(--agenc-radius-lg, 12px);
465
+ color: var(--agenc-text, #f5f0ff);
466
+ }
467
+ .agenc-dispute--open {
468
+ border: 1px solid var(--agenc-warning, #ffc53f);
469
+ background: var(--agenc-surface-2, #221638);
470
+ }
471
+ .agenc-dispute--none {
472
+ border: 1px solid var(--agenc-border, #2e1a4a);
473
+ background: var(--agenc-surface, #16102a);
474
+ }
475
+ .agenc-dispute__title {
476
+ color: var(--agenc-warning, #ffc53f);
477
+ }
478
+ .agenc-dispute__body,
479
+ .agenc-dispute__none {
480
+ margin: 0;
481
+ font-size: 0.9rem;
482
+ color: var(--agenc-text-muted, #b8a8d9);
483
+ }
484
+ .agenc-dispute__status {
485
+ font-size: 0.85rem;
486
+ color: var(--agenc-success, #3fffa0);
487
+ }
488
+ .agenc-dispute__error {
489
+ display: flex;
490
+ flex-direction: column;
491
+ gap: 2px;
492
+ color: var(--agenc-danger, #ff3d3d);
493
+ font-size: 0.85rem;
494
+ }
495
+
496
+ /* --- ProviderCard -----------------------------------------------------------*/
497
+ .agenc-provider {
498
+ display: flex;
499
+ flex-direction: column;
500
+ gap: var(--agenc-space-3, 12px);
501
+ padding: var(--agenc-space-4, 16px);
502
+ background: var(--agenc-surface, #16102a);
503
+ border: 1px solid var(--agenc-border, #2e1a4a);
504
+ border-radius: var(--agenc-radius-lg, 12px);
505
+ color: var(--agenc-text, #f5f0ff);
506
+ }
507
+ .agenc-provider__header {
508
+ display: flex;
509
+ align-items: center;
510
+ justify-content: space-between;
511
+ gap: var(--agenc-space-2, 8px);
512
+ }
513
+ .agenc-provider__id {
514
+ display: flex;
515
+ flex-direction: column;
516
+ }
517
+ .agenc-provider__label {
518
+ font-size: 0.75rem;
519
+ text-transform: uppercase;
520
+ letter-spacing: 0.04em;
521
+ color: var(--agenc-text-dim, #6e5c8f);
522
+ }
523
+ .agenc-provider__pda {
524
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
525
+ font-size: 0.85rem;
526
+ color: var(--agenc-text-muted, #b8a8d9);
527
+ }
528
+ .agenc-provider__stats {
529
+ display: grid;
530
+ grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
531
+ gap: var(--agenc-space-3, 12px);
532
+ margin: 0;
533
+ }
534
+ .agenc-provider__stat dt {
535
+ margin: 0;
536
+ font-size: 0.75rem;
537
+ color: var(--agenc-text-dim, #6e5c8f);
538
+ }
539
+ .agenc-provider__stat dd {
540
+ margin: 0;
541
+ font-size: 1.1rem;
542
+ font-weight: 700;
543
+ color: var(--agenc-text, #f5f0ff);
544
+ }
545
+ .agenc-provider__provisional {
546
+ font-size: 0.7rem;
547
+ font-weight: 400;
548
+ color: var(--agenc-text-dim, #6e5c8f);
549
+ }
550
+
551
+ /* --- PoweredByAgenC ---------------------------------------------------------*/
552
+ .agenc-powered-by {
553
+ display: inline-flex;
554
+ align-items: center;
555
+ gap: var(--agenc-space-1, 4px);
556
+ font-size: 0.75rem;
557
+ color: var(--agenc-text-dim, #6e5c8f);
558
+ text-decoration: none;
559
+ }
560
+ .agenc-powered-by:hover {
561
+ color: var(--agenc-violet, #7b3fff);
562
+ }
563
+ .agenc-powered-by:focus-visible {
564
+ outline: 2px solid var(--agenc-cyan, #48c8ef);
565
+ outline-offset: 2px;
566
+ border-radius: var(--agenc-radius-sm, 4px);
567
+ }
568
+ .agenc-powered-by__label {
569
+ font-weight: 600;
570
+ }
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Shared status badges: moderation attestation + provider-verified.
3
+ *
4
+ * ## Moderation (P6.8 boundary — read before extending)
5
+ *
6
+ * Per PLAN_2 A3, `ListingCard`/`Checkout` surface moderation aggressively, but
7
+ * the UNATTESTED-listing render toggle is gated on the PLAN.md P6.8 [HUMAN]
8
+ * neutrality decision and is NOT built here. This badge therefore only ever
9
+ * SHOWS the attestation STATE (attested / pending / issues); it never gates
10
+ * whether a listing renders. The v1 read model does not project a standalone
11
+ * attestation verdict, so "attested" is inferred from the indexer listing
12
+ * projection's `metadataValid` (the strongest signal available today); a
13
+ * dedicated verdict slots in later without changing this surface.
14
+ *
15
+ * @module components/badges
16
+ */
17
+ import type { ReactNode } from "react";
18
+ import type { IndexerListing } from "../types.js";
19
+ import { tc } from "./format.js";
20
+ import { Badge, type ThemableProps } from "./primitives.js";
21
+
22
+ /** The moderation state a badge can show (never a render gate). */
23
+ export type ModerationState = "attested" | "pending" | "issues";
24
+
25
+ /**
26
+ * Derive a moderation display state from the indexer listing projection.
27
+ *
28
+ * - `null` projection (gPA fallback, no indexer) → `"pending"` (unknown, shown
29
+ * honestly as pending — never asserted as attested);
30
+ * - `metadataValid === true` → `"attested"`;
31
+ * - `metadataValid === false` (issues present) → `"issues"`.
32
+ */
33
+ export function moderationStateOf(
34
+ moderation: IndexerListing | null | undefined,
35
+ ): ModerationState {
36
+ if (!moderation) return "pending";
37
+ return moderation.metadataValid ? "attested" : "issues";
38
+ }
39
+
40
+ /** Props for {@link ModerationBadge}. */
41
+ export interface ModerationBadgeProps extends ThemableProps {
42
+ /** The indexer listing projection (carries `metadataValid`/`metadataIssues`). */
43
+ moderation: IndexerListing | null | undefined;
44
+ /** Pre-resolved state (overrides `moderation`-derived state). */
45
+ state?: ModerationState;
46
+ }
47
+
48
+ const MODERATION_TONE = {
49
+ attested: "success",
50
+ pending: "neutral",
51
+ issues: "warning",
52
+ } as const;
53
+
54
+ const MODERATION_STRING = {
55
+ attested: "components.hire.moderationAttested",
56
+ pending: "components.hire.moderationPending",
57
+ // Distinct from `pending` ("Moderation pending") so a buyer can textually
58
+ // tell "we found problems" apart from "we haven't checked", not just by tone.
59
+ issues: "components.hire.moderationIssues",
60
+ } as const;
61
+
62
+ /**
63
+ * Show the listing's moderation attestation STATE (never a render gate).
64
+ */
65
+ export function ModerationBadge({
66
+ moderation,
67
+ state,
68
+ unstyled,
69
+ className,
70
+ }: ModerationBadgeProps): ReactNode {
71
+ const resolved = state ?? moderationStateOf(moderation);
72
+ const label = tc(MODERATION_STRING[resolved]);
73
+ const issues =
74
+ resolved === "issues" && moderation?.metadataIssues?.length
75
+ ? moderation.metadataIssues.join("; ")
76
+ : undefined;
77
+ return (
78
+ <Badge
79
+ tone={MODERATION_TONE[resolved]}
80
+ unstyled={unstyled}
81
+ className={className}
82
+ label={issues ?? label}
83
+ >
84
+ {label}
85
+ </Badge>
86
+ );
87
+ }
88
+
89
+ /** Props for {@link VerifiedBadge}. */
90
+ export interface VerifiedBadgeProps extends ThemableProps {
91
+ /** Whether the entity is verified. */
92
+ verified: boolean;
93
+ }
94
+
95
+ /**
96
+ * A provider-verified pill (used by ProviderCard). Shows verified/unverified
97
+ * state with the appropriate tone.
98
+ */
99
+ export function VerifiedBadge({
100
+ verified,
101
+ unstyled,
102
+ className,
103
+ }: VerifiedBadgeProps): ReactNode {
104
+ return (
105
+ <Badge
106
+ tone={verified ? "success" : "neutral"}
107
+ unstyled={unstyled}
108
+ className={className}
109
+ >
110
+ {verified
111
+ ? tc("components.common.verified")
112
+ : tc("components.common.unverified")}
113
+ </Badge>
114
+ );
115
+ }