@contractspec/example.marketplace 3.7.6 → 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 +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/hooks/useMarketplaceData.ts
|
|
3
|
-
import { useCallback, useEffect, useState } from "react";
|
|
4
3
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
+
import { useCallback, useEffect, useState } from "react";
|
|
5
5
|
"use client";
|
|
6
6
|
function useMarketplaceData(projectId = "local-project") {
|
|
7
7
|
const { handlers } = useTemplateRuntime();
|
|
@@ -54,7 +54,6 @@ function useMarketplaceData(projectId = "local-project") {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/ui/MarketplaceDashboard.tsx
|
|
57
|
-
import { useState as useState2 } from "react";
|
|
58
57
|
import {
|
|
59
58
|
Button,
|
|
60
59
|
ErrorState,
|
|
@@ -62,6 +61,7 @@ import {
|
|
|
62
61
|
StatCard,
|
|
63
62
|
StatCardGroup
|
|
64
63
|
} from "@contractspec/lib.design-system";
|
|
64
|
+
import { useState as useState2 } from "react";
|
|
65
65
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
66
66
|
"use client";
|
|
67
67
|
var STATUS_COLORS = {
|
|
@@ -113,7 +113,7 @@ function MarketplaceDashboard() {
|
|
|
113
113
|
className: "flex items-center justify-between",
|
|
114
114
|
children: [
|
|
115
115
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
116
|
-
className: "text-2xl
|
|
116
|
+
className: "font-bold text-2xl",
|
|
117
117
|
children: "Marketplace"
|
|
118
118
|
}, undefined, false, undefined, this),
|
|
119
119
|
/* @__PURE__ */ jsxDEV(Button, {
|
|
@@ -153,14 +153,14 @@ function MarketplaceDashboard() {
|
|
|
153
153
|
]
|
|
154
154
|
}, undefined, true, undefined, this),
|
|
155
155
|
/* @__PURE__ */ jsxDEV("nav", {
|
|
156
|
-
className: "
|
|
156
|
+
className: "flex gap-1 rounded-lg bg-muted p-1",
|
|
157
157
|
role: "tablist",
|
|
158
158
|
children: tabs.map((tab) => /* @__PURE__ */ jsxDEV(Button, {
|
|
159
159
|
type: "button",
|
|
160
160
|
role: "tab",
|
|
161
161
|
"aria-selected": activeTab === tab.id,
|
|
162
162
|
onClick: () => setActiveTab(tab.id),
|
|
163
|
-
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm
|
|
163
|
+
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"}`,
|
|
164
164
|
children: [
|
|
165
165
|
/* @__PURE__ */ jsxDEV("span", {
|
|
166
166
|
children: tab.icon
|
|
@@ -174,35 +174,35 @@ function MarketplaceDashboard() {
|
|
|
174
174
|
role: "tabpanel",
|
|
175
175
|
children: [
|
|
176
176
|
activeTab === "stores" && /* @__PURE__ */ jsxDEV("div", {
|
|
177
|
-
className: "
|
|
177
|
+
className: "rounded-lg border border-border",
|
|
178
178
|
children: /* @__PURE__ */ jsxDEV("table", {
|
|
179
179
|
className: "w-full",
|
|
180
180
|
children: [
|
|
181
181
|
/* @__PURE__ */ jsxDEV("thead", {
|
|
182
|
-
className: "border-border bg-muted/30
|
|
182
|
+
className: "border-border border-b bg-muted/30",
|
|
183
183
|
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
184
184
|
children: [
|
|
185
185
|
/* @__PURE__ */ jsxDEV("th", {
|
|
186
|
-
className: "px-4 py-3 text-left text-sm
|
|
186
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
187
187
|
children: "Store"
|
|
188
188
|
}, undefined, false, undefined, this),
|
|
189
189
|
/* @__PURE__ */ jsxDEV("th", {
|
|
190
|
-
className: "px-4 py-3 text-left text-sm
|
|
190
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
191
191
|
children: "Status"
|
|
192
192
|
}, undefined, false, undefined, this),
|
|
193
193
|
/* @__PURE__ */ jsxDEV("th", {
|
|
194
|
-
className: "px-4 py-3 text-left text-sm
|
|
194
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
195
195
|
children: "Rating"
|
|
196
196
|
}, undefined, false, undefined, this),
|
|
197
197
|
/* @__PURE__ */ jsxDEV("th", {
|
|
198
|
-
className: "px-4 py-3 text-left text-sm
|
|
198
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
199
199
|
children: "Reviews"
|
|
200
200
|
}, undefined, false, undefined, this)
|
|
201
201
|
]
|
|
202
202
|
}, undefined, true, undefined, this)
|
|
203
203
|
}, undefined, false, undefined, this),
|
|
204
204
|
/* @__PURE__ */ jsxDEV("tbody", {
|
|
205
|
-
className: "divide-
|
|
205
|
+
className: "divide-y divide-border",
|
|
206
206
|
children: [
|
|
207
207
|
stores.map((store) => /* @__PURE__ */ jsxDEV("tr", {
|
|
208
208
|
className: "hover:bg-muted/50",
|
|
@@ -223,7 +223,7 @@ function MarketplaceDashboard() {
|
|
|
223
223
|
/* @__PURE__ */ jsxDEV("td", {
|
|
224
224
|
className: "px-4 py-3",
|
|
225
225
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
226
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
226
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[store.status] ?? ""}`,
|
|
227
227
|
children: store.status
|
|
228
228
|
}, undefined, false, undefined, this)
|
|
229
229
|
}, undefined, false, undefined, this),
|
|
@@ -238,7 +238,7 @@ function MarketplaceDashboard() {
|
|
|
238
238
|
}, undefined, true, undefined, this)
|
|
239
239
|
}, undefined, false, undefined, this),
|
|
240
240
|
/* @__PURE__ */ jsxDEV("td", {
|
|
241
|
-
className: "
|
|
241
|
+
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
242
242
|
children: [
|
|
243
243
|
store.reviewCount,
|
|
244
244
|
" reviews"
|
|
@@ -249,7 +249,7 @@ function MarketplaceDashboard() {
|
|
|
249
249
|
stores.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
|
|
250
250
|
children: /* @__PURE__ */ jsxDEV("td", {
|
|
251
251
|
colSpan: 4,
|
|
252
|
-
className: "
|
|
252
|
+
className: "px-4 py-8 text-center text-muted-foreground",
|
|
253
253
|
children: "No stores found"
|
|
254
254
|
}, undefined, false, undefined, this)
|
|
255
255
|
}, undefined, false, undefined, this)
|
|
@@ -259,35 +259,35 @@ function MarketplaceDashboard() {
|
|
|
259
259
|
}, undefined, true, undefined, this)
|
|
260
260
|
}, undefined, false, undefined, this),
|
|
261
261
|
activeTab === "products" && /* @__PURE__ */ jsxDEV("div", {
|
|
262
|
-
className: "
|
|
262
|
+
className: "rounded-lg border border-border",
|
|
263
263
|
children: /* @__PURE__ */ jsxDEV("table", {
|
|
264
264
|
className: "w-full",
|
|
265
265
|
children: [
|
|
266
266
|
/* @__PURE__ */ jsxDEV("thead", {
|
|
267
|
-
className: "border-border bg-muted/30
|
|
267
|
+
className: "border-border border-b bg-muted/30",
|
|
268
268
|
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
269
269
|
children: [
|
|
270
270
|
/* @__PURE__ */ jsxDEV("th", {
|
|
271
|
-
className: "px-4 py-3 text-left text-sm
|
|
271
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
272
272
|
children: "Product"
|
|
273
273
|
}, undefined, false, undefined, this),
|
|
274
274
|
/* @__PURE__ */ jsxDEV("th", {
|
|
275
|
-
className: "px-4 py-3 text-left text-sm
|
|
275
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
276
276
|
children: "Price"
|
|
277
277
|
}, undefined, false, undefined, this),
|
|
278
278
|
/* @__PURE__ */ jsxDEV("th", {
|
|
279
|
-
className: "px-4 py-3 text-left text-sm
|
|
279
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
280
280
|
children: "Stock"
|
|
281
281
|
}, undefined, false, undefined, this),
|
|
282
282
|
/* @__PURE__ */ jsxDEV("th", {
|
|
283
|
-
className: "px-4 py-3 text-left text-sm
|
|
283
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
284
284
|
children: "Status"
|
|
285
285
|
}, undefined, false, undefined, this)
|
|
286
286
|
]
|
|
287
287
|
}, undefined, true, undefined, this)
|
|
288
288
|
}, undefined, false, undefined, this),
|
|
289
289
|
/* @__PURE__ */ jsxDEV("tbody", {
|
|
290
|
-
className: "divide-
|
|
290
|
+
className: "divide-y divide-border",
|
|
291
291
|
children: [
|
|
292
292
|
products.map((product) => /* @__PURE__ */ jsxDEV("tr", {
|
|
293
293
|
className: "hover:bg-muted/50",
|
|
@@ -316,7 +316,7 @@ function MarketplaceDashboard() {
|
|
|
316
316
|
/* @__PURE__ */ jsxDEV("td", {
|
|
317
317
|
className: "px-4 py-3",
|
|
318
318
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
319
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
319
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[product.status] ?? ""}`,
|
|
320
320
|
children: product.status
|
|
321
321
|
}, undefined, false, undefined, this)
|
|
322
322
|
}, undefined, false, undefined, this)
|
|
@@ -325,7 +325,7 @@ function MarketplaceDashboard() {
|
|
|
325
325
|
products.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
|
|
326
326
|
children: /* @__PURE__ */ jsxDEV("td", {
|
|
327
327
|
colSpan: 4,
|
|
328
|
-
className: "
|
|
328
|
+
className: "px-4 py-8 text-center text-muted-foreground",
|
|
329
329
|
children: "No products found"
|
|
330
330
|
}, undefined, false, undefined, this)
|
|
331
331
|
}, undefined, false, undefined, this)
|
|
@@ -335,39 +335,39 @@ function MarketplaceDashboard() {
|
|
|
335
335
|
}, undefined, true, undefined, this)
|
|
336
336
|
}, undefined, false, undefined, this),
|
|
337
337
|
activeTab === "orders" && /* @__PURE__ */ jsxDEV("div", {
|
|
338
|
-
className: "
|
|
338
|
+
className: "rounded-lg border border-border",
|
|
339
339
|
children: /* @__PURE__ */ jsxDEV("table", {
|
|
340
340
|
className: "w-full",
|
|
341
341
|
children: [
|
|
342
342
|
/* @__PURE__ */ jsxDEV("thead", {
|
|
343
|
-
className: "border-border bg-muted/30
|
|
343
|
+
className: "border-border border-b bg-muted/30",
|
|
344
344
|
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
345
345
|
children: [
|
|
346
346
|
/* @__PURE__ */ jsxDEV("th", {
|
|
347
|
-
className: "px-4 py-3 text-left text-sm
|
|
347
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
348
348
|
children: "Order ID"
|
|
349
349
|
}, undefined, false, undefined, this),
|
|
350
350
|
/* @__PURE__ */ jsxDEV("th", {
|
|
351
|
-
className: "px-4 py-3 text-left text-sm
|
|
351
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
352
352
|
children: "Customer"
|
|
353
353
|
}, undefined, false, undefined, this),
|
|
354
354
|
/* @__PURE__ */ jsxDEV("th", {
|
|
355
|
-
className: "px-4 py-3 text-left text-sm
|
|
355
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
356
356
|
children: "Total"
|
|
357
357
|
}, undefined, false, undefined, this),
|
|
358
358
|
/* @__PURE__ */ jsxDEV("th", {
|
|
359
|
-
className: "px-4 py-3 text-left text-sm
|
|
359
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
360
360
|
children: "Status"
|
|
361
361
|
}, undefined, false, undefined, this),
|
|
362
362
|
/* @__PURE__ */ jsxDEV("th", {
|
|
363
|
-
className: "px-4 py-3 text-left text-sm
|
|
363
|
+
className: "px-4 py-3 text-left font-medium text-sm",
|
|
364
364
|
children: "Date"
|
|
365
365
|
}, undefined, false, undefined, this)
|
|
366
366
|
]
|
|
367
367
|
}, undefined, true, undefined, this)
|
|
368
368
|
}, undefined, false, undefined, this),
|
|
369
369
|
/* @__PURE__ */ jsxDEV("tbody", {
|
|
370
|
-
className: "divide-
|
|
370
|
+
className: "divide-y divide-border",
|
|
371
371
|
children: [
|
|
372
372
|
orders.map((order) => /* @__PURE__ */ jsxDEV("tr", {
|
|
373
373
|
className: "hover:bg-muted/50",
|
|
@@ -387,12 +387,12 @@ function MarketplaceDashboard() {
|
|
|
387
387
|
/* @__PURE__ */ jsxDEV("td", {
|
|
388
388
|
className: "px-4 py-3",
|
|
389
389
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
390
|
-
className: `inline-flex rounded-full px-2 py-0.5 text-xs
|
|
390
|
+
className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[order.status] ?? ""}`,
|
|
391
391
|
children: order.status
|
|
392
392
|
}, undefined, false, undefined, this)
|
|
393
393
|
}, undefined, false, undefined, this),
|
|
394
394
|
/* @__PURE__ */ jsxDEV("td", {
|
|
395
|
-
className: "
|
|
395
|
+
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
396
396
|
children: order.createdAt.toLocaleDateString()
|
|
397
397
|
}, undefined, false, undefined, this)
|
|
398
398
|
]
|
|
@@ -400,7 +400,7 @@ function MarketplaceDashboard() {
|
|
|
400
400
|
orders.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
|
|
401
401
|
children: /* @__PURE__ */ jsxDEV("td", {
|
|
402
402
|
colSpan: 5,
|
|
403
|
-
className: "
|
|
403
|
+
className: "px-4 py-8 text-center text-muted-foreground",
|
|
404
404
|
children: "No orders found"
|
|
405
405
|
}, undefined, false, undefined, this)
|
|
406
406
|
}, undefined, false, undefined, this)
|
package/dist/ui/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { type MarketplaceStats, useMarketplaceData, } from './useMarketplaceData';
|
package/dist/ui/hooks/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/hooks/useMarketplaceData.ts
|
|
3
|
-
import { useCallback, useEffect, useState } from "react";
|
|
4
3
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
+
import { useCallback, useEffect, useState } from "react";
|
|
5
5
|
"use client";
|
|
6
6
|
function useMarketplaceData(projectId = "local-project") {
|
|
7
7
|
const { handlers } = useTemplateRuntime();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/hooks/useMarketplaceData.ts
|
|
3
|
-
import { useCallback, useEffect, useState } from "react";
|
|
4
3
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
+
import { useCallback, useEffect, useState } from "react";
|
|
5
5
|
"use client";
|
|
6
6
|
function useMarketplaceData(projectId = "local-project") {
|
|
7
7
|
const { handlers } = useTemplateRuntime();
|
package/dist/ui/index.d.ts
CHANGED