@contractspec/example.marketplace 3.7.5 → 3.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -131
- package/dist/browser/entities/index.js +470 -470
- package/dist/browser/index.js +945 -944
- package/dist/browser/order/index.js +155 -155
- package/dist/browser/order/order.event.js +1 -1
- package/dist/browser/payout/index.js +71 -71
- package/dist/browser/payout/payout.event.js +1 -1
- package/dist/browser/product/index.js +104 -104
- package/dist/browser/product/product.event.js +1 -1
- package/dist/browser/review/index.js +75 -75
- package/dist/browser/review/review.event.js +1 -1
- package/dist/browser/store/index.js +68 -68
- package/dist/browser/store/store.event.js +1 -1
- package/dist/browser/ui/MarketplaceDashboard.js +35 -35
- package/dist/browser/ui/hooks/index.js +1 -1
- package/dist/browser/ui/hooks/useMarketplaceData.js +1 -1
- package/dist/browser/ui/index.js +285 -284
- package/dist/entities/index.d.ts +110 -110
- package/dist/entities/index.js +470 -470
- package/dist/index.d.ts +3 -3
- package/dist/index.js +945 -944
- package/dist/node/entities/index.js +470 -470
- package/dist/node/index.js +945 -944
- package/dist/node/order/index.js +155 -155
- package/dist/node/order/order.event.js +1 -1
- package/dist/node/payout/index.js +71 -71
- package/dist/node/payout/payout.event.js +1 -1
- package/dist/node/product/index.js +104 -104
- package/dist/node/product/product.event.js +1 -1
- package/dist/node/review/index.js +75 -75
- package/dist/node/review/review.event.js +1 -1
- package/dist/node/store/index.js +68 -68
- package/dist/node/store/store.event.js +1 -1
- package/dist/node/ui/MarketplaceDashboard.js +35 -35
- package/dist/node/ui/hooks/index.js +1 -1
- package/dist/node/ui/hooks/useMarketplaceData.js +1 -1
- package/dist/node/ui/index.js +285 -284
- package/dist/order/index.d.ts +2 -2
- package/dist/order/index.js +155 -155
- package/dist/order/order.event.js +1 -1
- package/dist/payout/index.d.ts +2 -2
- package/dist/payout/index.js +71 -71
- package/dist/payout/payout.event.js +1 -1
- package/dist/product/index.d.ts +2 -2
- package/dist/product/index.js +104 -104
- package/dist/product/product.event.js +1 -1
- package/dist/review/index.d.ts +2 -2
- package/dist/review/index.js +75 -75
- package/dist/review/review.event.js +1 -1
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +68 -68
- package/dist/store/store.event.js +1 -1
- package/dist/ui/MarketplaceDashboard.js +35 -35
- package/dist/ui/hooks/index.d.ts +1 -1
- package/dist/ui/hooks/index.js +1 -1
- package/dist/ui/hooks/useMarketplaceData.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +285 -284
- package/dist/ui/renderers/index.d.ts +1 -1
- package/package.json +10 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/hooks/useMarketplaceData.ts
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
2
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
"use client";
|
|
5
5
|
function useMarketplaceData(projectId = "local-project") {
|
|
6
6
|
const { handlers } = useTemplateRuntime();
|
|
@@ -53,7 +53,6 @@ function useMarketplaceData(projectId = "local-project") {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// src/ui/MarketplaceDashboard.tsx
|
|
56
|
-
import { useState as useState2 } from "react";
|
|
57
56
|
import {
|
|
58
57
|
Button,
|
|
59
58
|
ErrorState,
|
|
@@ -61,6 +60,7 @@ import {
|
|
|
61
60
|
StatCard,
|
|
62
61
|
StatCardGroup
|
|
63
62
|
} from "@contractspec/lib.design-system";
|
|
63
|
+
import { useState as useState2 } from "react";
|
|
64
64
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
65
65
|
"use client";
|
|
66
66
|
var STATUS_COLORS = {
|
|
@@ -112,7 +112,7 @@ function MarketplaceDashboard() {
|
|
|
112
112
|
className: "flex items-center justify-between",
|
|
113
113
|
children: [
|
|
114
114
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
115
|
-
className: "text-2xl
|
|
115
|
+
className: "font-bold text-2xl",
|
|
116
116
|
children: "Marketplace"
|
|
117
117
|
}, undefined, false, undefined, this),
|
|
118
118
|
/* @__PURE__ */ jsxDEV(Button, {
|
|
@@ -152,14 +152,14 @@ function MarketplaceDashboard() {
|
|
|
152
152
|
]
|
|
153
153
|
}, undefined, true, undefined, this),
|
|
154
154
|
/* @__PURE__ */ jsxDEV("nav", {
|
|
155
|
-
className: "
|
|
155
|
+
className: "flex gap-1 rounded-lg bg-muted p-1",
|
|
156
156
|
role: "tablist",
|
|
157
157
|
children: tabs.map((tab) => /* @__PURE__ */ jsxDEV(Button, {
|
|
158
158
|
type: "button",
|
|
159
159
|
role: "tab",
|
|
160
160
|
"aria-selected": activeTab === tab.id,
|
|
161
161
|
onClick: () => setActiveTab(tab.id),
|
|
162
|
-
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm
|
|
162
|
+
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 font-medium text-sm transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
163
163
|
children: [
|
|
164
164
|
/* @__PURE__ */ jsxDEV("span", {
|
|
165
165
|
children: tab.icon
|
|
@@ -173,35 +173,35 @@ function MarketplaceDashboard() {
|
|
|
173
173
|
role: "tabpanel",
|
|
174
174
|
children: [
|
|
175
175
|
activeTab === "stores" && /* @__PURE__ */ jsxDEV("div", {
|
|
176
|
-
className: "
|
|
176
|
+
className: "rounded-lg border border-border",
|
|
177
177
|
children: /* @__PURE__ */ jsxDEV("table", {
|
|
178
178
|
className: "w-full",
|
|
179
179
|
children: [
|
|
180
180
|
/* @__PURE__ */ jsxDEV("thead", {
|
|
181
|
-
className: "border-border bg-muted/30
|
|
181
|
+
className: "border-border border-b bg-muted/30",
|
|
182
182
|
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
183
183
|
children: [
|
|
184
184
|
/* @__PURE__ */ jsxDEV("th", {
|
|
185
|
-
className: "px-4 py-3 text-left text-sm
|
|
185
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
186
186
|
children: "Store"
|
|
187
187
|
}, undefined, false, undefined, this),
|
|
188
188
|
/* @__PURE__ */ jsxDEV("th", {
|
|
189
|
-
className: "px-4 py-3 text-left text-sm
|
|
189
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
190
190
|
children: "Status"
|
|
191
191
|
}, undefined, false, undefined, this),
|
|
192
192
|
/* @__PURE__ */ jsxDEV("th", {
|
|
193
|
-
className: "px-4 py-3 text-left text-sm
|
|
193
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
194
194
|
children: "Rating"
|
|
195
195
|
}, undefined, false, undefined, this),
|
|
196
196
|
/* @__PURE__ */ jsxDEV("th", {
|
|
197
|
-
className: "px-4 py-3 text-left text-sm
|
|
197
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
198
198
|
children: "Reviews"
|
|
199
199
|
}, undefined, false, undefined, this)
|
|
200
200
|
]
|
|
201
201
|
}, undefined, true, undefined, this)
|
|
202
202
|
}, undefined, false, undefined, this),
|
|
203
203
|
/* @__PURE__ */ jsxDEV("tbody", {
|
|
204
|
-
className: "divide-
|
|
204
|
+
className: "divide-y divide-border",
|
|
205
205
|
children: [
|
|
206
206
|
stores.map((store) => /* @__PURE__ */ jsxDEV("tr", {
|
|
207
207
|
className: "hover:bg-muted/50",
|
|
@@ -222,7 +222,7 @@ function MarketplaceDashboard() {
|
|
|
222
222
|
/* @__PURE__ */ jsxDEV("td", {
|
|
223
223
|
className: "px-4 py-3",
|
|
224
224
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
225
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
225
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[store.status] ?? ""}`,
|
|
226
226
|
children: store.status
|
|
227
227
|
}, undefined, false, undefined, this)
|
|
228
228
|
}, undefined, false, undefined, this),
|
|
@@ -237,7 +237,7 @@ function MarketplaceDashboard() {
|
|
|
237
237
|
}, undefined, true, undefined, this)
|
|
238
238
|
}, undefined, false, undefined, this),
|
|
239
239
|
/* @__PURE__ */ jsxDEV("td", {
|
|
240
|
-
className: "
|
|
240
|
+
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
241
241
|
children: [
|
|
242
242
|
store.reviewCount,
|
|
243
243
|
" reviews"
|
|
@@ -248,7 +248,7 @@ function MarketplaceDashboard() {
|
|
|
248
248
|
stores.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
|
|
249
249
|
children: /* @__PURE__ */ jsxDEV("td", {
|
|
250
250
|
colSpan: 4,
|
|
251
|
-
className: "
|
|
251
|
+
className: "px-4 py-8 text-center text-muted-foreground",
|
|
252
252
|
children: "No stores found"
|
|
253
253
|
}, undefined, false, undefined, this)
|
|
254
254
|
}, undefined, false, undefined, this)
|
|
@@ -258,35 +258,35 @@ function MarketplaceDashboard() {
|
|
|
258
258
|
}, undefined, true, undefined, this)
|
|
259
259
|
}, undefined, false, undefined, this),
|
|
260
260
|
activeTab === "products" && /* @__PURE__ */ jsxDEV("div", {
|
|
261
|
-
className: "
|
|
261
|
+
className: "rounded-lg border border-border",
|
|
262
262
|
children: /* @__PURE__ */ jsxDEV("table", {
|
|
263
263
|
className: "w-full",
|
|
264
264
|
children: [
|
|
265
265
|
/* @__PURE__ */ jsxDEV("thead", {
|
|
266
|
-
className: "border-border bg-muted/30
|
|
266
|
+
className: "border-border border-b bg-muted/30",
|
|
267
267
|
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
268
268
|
children: [
|
|
269
269
|
/* @__PURE__ */ jsxDEV("th", {
|
|
270
|
-
className: "px-4 py-3 text-left text-sm
|
|
270
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
271
271
|
children: "Product"
|
|
272
272
|
}, undefined, false, undefined, this),
|
|
273
273
|
/* @__PURE__ */ jsxDEV("th", {
|
|
274
|
-
className: "px-4 py-3 text-left text-sm
|
|
274
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
275
275
|
children: "Price"
|
|
276
276
|
}, undefined, false, undefined, this),
|
|
277
277
|
/* @__PURE__ */ jsxDEV("th", {
|
|
278
|
-
className: "px-4 py-3 text-left text-sm
|
|
278
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
279
279
|
children: "Stock"
|
|
280
280
|
}, undefined, false, undefined, this),
|
|
281
281
|
/* @__PURE__ */ jsxDEV("th", {
|
|
282
|
-
className: "px-4 py-3 text-left text-sm
|
|
282
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
283
283
|
children: "Status"
|
|
284
284
|
}, undefined, false, undefined, this)
|
|
285
285
|
]
|
|
286
286
|
}, undefined, true, undefined, this)
|
|
287
287
|
}, undefined, false, undefined, this),
|
|
288
288
|
/* @__PURE__ */ jsxDEV("tbody", {
|
|
289
|
-
className: "divide-
|
|
289
|
+
className: "divide-y divide-border",
|
|
290
290
|
children: [
|
|
291
291
|
products.map((product) => /* @__PURE__ */ jsxDEV("tr", {
|
|
292
292
|
className: "hover:bg-muted/50",
|
|
@@ -315,7 +315,7 @@ function MarketplaceDashboard() {
|
|
|
315
315
|
/* @__PURE__ */ jsxDEV("td", {
|
|
316
316
|
className: "px-4 py-3",
|
|
317
317
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
318
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
318
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[product.status] ?? ""}`,
|
|
319
319
|
children: product.status
|
|
320
320
|
}, undefined, false, undefined, this)
|
|
321
321
|
}, undefined, false, undefined, this)
|
|
@@ -324,7 +324,7 @@ function MarketplaceDashboard() {
|
|
|
324
324
|
products.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
|
|
325
325
|
children: /* @__PURE__ */ jsxDEV("td", {
|
|
326
326
|
colSpan: 4,
|
|
327
|
-
className: "
|
|
327
|
+
className: "px-4 py-8 text-center text-muted-foreground",
|
|
328
328
|
children: "No products found"
|
|
329
329
|
}, undefined, false, undefined, this)
|
|
330
330
|
}, undefined, false, undefined, this)
|
|
@@ -334,39 +334,39 @@ function MarketplaceDashboard() {
|
|
|
334
334
|
}, undefined, true, undefined, this)
|
|
335
335
|
}, undefined, false, undefined, this),
|
|
336
336
|
activeTab === "orders" && /* @__PURE__ */ jsxDEV("div", {
|
|
337
|
-
className: "
|
|
337
|
+
className: "rounded-lg border border-border",
|
|
338
338
|
children: /* @__PURE__ */ jsxDEV("table", {
|
|
339
339
|
className: "w-full",
|
|
340
340
|
children: [
|
|
341
341
|
/* @__PURE__ */ jsxDEV("thead", {
|
|
342
|
-
className: "border-border bg-muted/30
|
|
342
|
+
className: "border-border border-b bg-muted/30",
|
|
343
343
|
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
344
344
|
children: [
|
|
345
345
|
/* @__PURE__ */ jsxDEV("th", {
|
|
346
|
-
className: "px-4 py-3 text-left text-sm
|
|
346
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
347
347
|
children: "Order ID"
|
|
348
348
|
}, undefined, false, undefined, this),
|
|
349
349
|
/* @__PURE__ */ jsxDEV("th", {
|
|
350
|
-
className: "px-4 py-3 text-left text-sm
|
|
350
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
351
351
|
children: "Customer"
|
|
352
352
|
}, undefined, false, undefined, this),
|
|
353
353
|
/* @__PURE__ */ jsxDEV("th", {
|
|
354
|
-
className: "px-4 py-3 text-left text-sm
|
|
354
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
355
355
|
children: "Total"
|
|
356
356
|
}, undefined, false, undefined, this),
|
|
357
357
|
/* @__PURE__ */ jsxDEV("th", {
|
|
358
|
-
className: "px-4 py-3 text-left text-sm
|
|
358
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
359
359
|
children: "Status"
|
|
360
360
|
}, undefined, false, undefined, this),
|
|
361
361
|
/* @__PURE__ */ jsxDEV("th", {
|
|
362
|
-
className: "px-4 py-3 text-left text-sm
|
|
362
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
363
363
|
children: "Date"
|
|
364
364
|
}, undefined, false, undefined, this)
|
|
365
365
|
]
|
|
366
366
|
}, undefined, true, undefined, this)
|
|
367
367
|
}, undefined, false, undefined, this),
|
|
368
368
|
/* @__PURE__ */ jsxDEV("tbody", {
|
|
369
|
-
className: "divide-
|
|
369
|
+
className: "divide-y divide-border",
|
|
370
370
|
children: [
|
|
371
371
|
orders.map((order) => /* @__PURE__ */ jsxDEV("tr", {
|
|
372
372
|
className: "hover:bg-muted/50",
|
|
@@ -386,12 +386,12 @@ function MarketplaceDashboard() {
|
|
|
386
386
|
/* @__PURE__ */ jsxDEV("td", {
|
|
387
387
|
className: "px-4 py-3",
|
|
388
388
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
389
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
389
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[order.status] ?? ""}`,
|
|
390
390
|
children: order.status
|
|
391
391
|
}, undefined, false, undefined, this)
|
|
392
392
|
}, undefined, false, undefined, this),
|
|
393
393
|
/* @__PURE__ */ jsxDEV("td", {
|
|
394
|
-
className: "
|
|
394
|
+
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
395
395
|
children: order.createdAt.toLocaleDateString()
|
|
396
396
|
}, undefined, false, undefined, this)
|
|
397
397
|
]
|
|
@@ -399,7 +399,7 @@ function MarketplaceDashboard() {
|
|
|
399
399
|
orders.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
|
|
400
400
|
children: /* @__PURE__ */ jsxDEV("td", {
|
|
401
401
|
colSpan: 5,
|
|
402
|
-
className: "
|
|
402
|
+
className: "px-4 py-8 text-center text-muted-foreground",
|
|
403
403
|
children: "No orders found"
|
|
404
404
|
}, undefined, false, undefined, this)
|
|
405
405
|
}, undefined, false, undefined, this)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/hooks/useMarketplaceData.ts
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
2
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
"use client";
|
|
5
5
|
function useMarketplaceData(projectId = "local-project") {
|
|
6
6
|
const { handlers } = useTemplateRuntime();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/hooks/useMarketplaceData.ts
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
2
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
"use client";
|
|
5
5
|
function useMarketplaceData(projectId = "local-project") {
|
|
6
6
|
const { handlers } = useTemplateRuntime();
|