@contractspec/example.marketplace 3.7.6 → 3.8.2

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 (86) hide show
  1. package/README.md +64 -131
  2. package/dist/browser/entities/index.js +470 -470
  3. package/dist/browser/index.js +1257 -1019
  4. package/dist/browser/marketplace.feature.js +175 -0
  5. package/dist/browser/order/index.js +155 -155
  6. package/dist/browser/order/order.event.js +1 -1
  7. package/dist/browser/payout/index.js +71 -71
  8. package/dist/browser/payout/payout.event.js +1 -1
  9. package/dist/browser/product/index.js +104 -104
  10. package/dist/browser/product/product.event.js +1 -1
  11. package/dist/browser/review/index.js +75 -75
  12. package/dist/browser/review/review.event.js +1 -1
  13. package/dist/browser/store/index.js +68 -68
  14. package/dist/browser/store/store.event.js +1 -1
  15. package/dist/browser/ui/MarketplaceDashboard.js +328 -110
  16. package/dist/browser/ui/MarketplaceDashboard.visualizations.js +216 -0
  17. package/dist/browser/ui/hooks/index.js +1 -1
  18. package/dist/browser/ui/hooks/useMarketplaceData.js +1 -1
  19. package/dist/browser/ui/index.js +590 -359
  20. package/dist/browser/ui/renderers/index.js +190 -4
  21. package/dist/browser/ui/renderers/marketplace.markdown.js +190 -4
  22. package/dist/browser/visualizations/catalog.js +126 -0
  23. package/dist/browser/visualizations/index.js +183 -0
  24. package/dist/browser/visualizations/selectors.js +177 -0
  25. package/dist/entities/index.d.ts +110 -110
  26. package/dist/entities/index.js +470 -470
  27. package/dist/index.d.ts +4 -3
  28. package/dist/index.js +1257 -1019
  29. package/dist/marketplace.feature.js +175 -0
  30. package/dist/node/entities/index.js +470 -470
  31. package/dist/node/index.js +1257 -1019
  32. package/dist/node/marketplace.feature.js +175 -0
  33. package/dist/node/order/index.js +155 -155
  34. package/dist/node/order/order.event.js +1 -1
  35. package/dist/node/payout/index.js +71 -71
  36. package/dist/node/payout/payout.event.js +1 -1
  37. package/dist/node/product/index.js +104 -104
  38. package/dist/node/product/product.event.js +1 -1
  39. package/dist/node/review/index.js +75 -75
  40. package/dist/node/review/review.event.js +1 -1
  41. package/dist/node/store/index.js +68 -68
  42. package/dist/node/store/store.event.js +1 -1
  43. package/dist/node/ui/MarketplaceDashboard.js +328 -110
  44. package/dist/node/ui/MarketplaceDashboard.visualizations.js +216 -0
  45. package/dist/node/ui/hooks/index.js +1 -1
  46. package/dist/node/ui/hooks/useMarketplaceData.js +1 -1
  47. package/dist/node/ui/index.js +590 -359
  48. package/dist/node/ui/renderers/index.js +190 -4
  49. package/dist/node/ui/renderers/marketplace.markdown.js +190 -4
  50. package/dist/node/visualizations/catalog.js +126 -0
  51. package/dist/node/visualizations/index.js +183 -0
  52. package/dist/node/visualizations/selectors.js +177 -0
  53. package/dist/order/index.d.ts +2 -2
  54. package/dist/order/index.js +155 -155
  55. package/dist/order/order.event.js +1 -1
  56. package/dist/payout/index.d.ts +2 -2
  57. package/dist/payout/index.js +71 -71
  58. package/dist/payout/payout.event.js +1 -1
  59. package/dist/product/index.d.ts +2 -2
  60. package/dist/product/index.js +104 -104
  61. package/dist/product/product.event.js +1 -1
  62. package/dist/review/index.d.ts +2 -2
  63. package/dist/review/index.js +75 -75
  64. package/dist/review/review.event.js +1 -1
  65. package/dist/store/index.d.ts +2 -2
  66. package/dist/store/index.js +68 -68
  67. package/dist/store/store.event.js +1 -1
  68. package/dist/ui/MarketplaceDashboard.js +328 -110
  69. package/dist/ui/MarketplaceDashboard.visualizations.d.ts +5 -0
  70. package/dist/ui/MarketplaceDashboard.visualizations.js +217 -0
  71. package/dist/ui/hooks/index.d.ts +1 -1
  72. package/dist/ui/hooks/index.js +1 -1
  73. package/dist/ui/hooks/useMarketplaceData.js +1 -1
  74. package/dist/ui/index.d.ts +2 -2
  75. package/dist/ui/index.js +590 -359
  76. package/dist/ui/renderers/index.d.ts +1 -1
  77. package/dist/ui/renderers/index.js +190 -4
  78. package/dist/ui/renderers/marketplace.markdown.js +190 -4
  79. package/dist/visualizations/catalog.d.ts +10 -0
  80. package/dist/visualizations/catalog.js +127 -0
  81. package/dist/visualizations/index.d.ts +2 -0
  82. package/dist/visualizations/index.js +184 -0
  83. package/dist/visualizations/selectors.d.ts +11 -0
  84. package/dist/visualizations/selectors.js +178 -0
  85. package/dist/visualizations/selectors.test.d.ts +1 -0
  86. package/package.json +66 -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();
@@ -52,8 +52,221 @@ function useMarketplaceData(projectId = "local-project") {
52
52
  };
53
53
  }
54
54
 
55
+ // src/visualizations/catalog.ts
56
+ import {
57
+ defineVisualization,
58
+ VisualizationRegistry
59
+ } from "@contractspec/lib.contracts-spec/visualizations";
60
+ var ORDER_LIST_REF = {
61
+ key: "marketplace.order.list",
62
+ version: "1.0.0"
63
+ };
64
+ var PRODUCT_LIST_REF = {
65
+ key: "marketplace.product.list",
66
+ version: "1.0.0"
67
+ };
68
+ var META = {
69
+ version: "1.0.0",
70
+ domain: "marketplace",
71
+ stability: "experimental",
72
+ owners: ["@example.marketplace"],
73
+ tags: ["marketplace", "visualization", "commerce"]
74
+ };
75
+ var MarketplaceOrderStatusVisualization = defineVisualization({
76
+ meta: {
77
+ ...META,
78
+ key: "marketplace.visualization.order-status",
79
+ title: "Order Status Breakdown",
80
+ description: "Distribution of current order states.",
81
+ goal: "Expose delivery and backlog mix at a glance.",
82
+ context: "Marketplace operations overview."
83
+ },
84
+ source: { primary: ORDER_LIST_REF, resultPath: "data" },
85
+ visualization: {
86
+ kind: "pie",
87
+ nameDimension: "status",
88
+ valueMeasure: "orders",
89
+ dimensions: [
90
+ { key: "status", label: "Status", dataPath: "status", type: "category" }
91
+ ],
92
+ measures: [
93
+ { key: "orders", label: "Orders", dataPath: "orders", format: "number" }
94
+ ],
95
+ table: { caption: "Order counts by status." }
96
+ }
97
+ });
98
+ var MarketplaceCategoryValueVisualization = defineVisualization({
99
+ meta: {
100
+ ...META,
101
+ key: "marketplace.visualization.category-value",
102
+ title: "Category Value Comparison",
103
+ description: "Catalog value by product category derived from current pricing and stock.",
104
+ goal: "Compare where the marketplace catalog is concentrated.",
105
+ context: "Merchandising overview."
106
+ },
107
+ source: { primary: PRODUCT_LIST_REF, resultPath: "data" },
108
+ visualization: {
109
+ kind: "cartesian",
110
+ variant: "bar",
111
+ xDimension: "category",
112
+ yMeasures: ["catalogValue"],
113
+ dimensions: [
114
+ {
115
+ key: "category",
116
+ label: "Category",
117
+ dataPath: "category",
118
+ type: "category"
119
+ }
120
+ ],
121
+ measures: [
122
+ {
123
+ key: "catalogValue",
124
+ label: "Catalog Value",
125
+ dataPath: "catalogValue",
126
+ format: "currency",
127
+ color: "#1d4ed8"
128
+ }
129
+ ],
130
+ table: { caption: "Catalog value by product category." }
131
+ }
132
+ });
133
+ var MarketplaceOrderActivityVisualization = defineVisualization({
134
+ meta: {
135
+ ...META,
136
+ key: "marketplace.visualization.order-activity",
137
+ title: "Recent Order Activity",
138
+ description: "Daily order volume from recent order creation timestamps.",
139
+ goal: "Show recent order activity trends.",
140
+ context: "Commerce operations trend monitoring."
141
+ },
142
+ source: { primary: ORDER_LIST_REF, resultPath: "data" },
143
+ visualization: {
144
+ kind: "cartesian",
145
+ variant: "line",
146
+ xDimension: "day",
147
+ yMeasures: ["orders"],
148
+ dimensions: [{ key: "day", label: "Day", dataPath: "day", type: "time" }],
149
+ measures: [
150
+ {
151
+ key: "orders",
152
+ label: "Orders",
153
+ dataPath: "orders",
154
+ format: "number",
155
+ color: "#0f766e"
156
+ }
157
+ ],
158
+ table: { caption: "Daily order counts." }
159
+ }
160
+ });
161
+ var MarketplaceVisualizationSpecs = [
162
+ MarketplaceOrderStatusVisualization,
163
+ MarketplaceCategoryValueVisualization,
164
+ MarketplaceOrderActivityVisualization
165
+ ];
166
+ var MarketplaceVisualizationRegistry = new VisualizationRegistry([
167
+ ...MarketplaceVisualizationSpecs
168
+ ]);
169
+ var MarketplaceVisualizationRefs = MarketplaceVisualizationSpecs.map((spec) => ({
170
+ key: spec.meta.key,
171
+ version: spec.meta.version
172
+ }));
173
+
174
+ // src/visualizations/selectors.ts
175
+ function toDayKey(value) {
176
+ const date = value instanceof Date ? value : new Date(value);
177
+ return date.toISOString().slice(0, 10);
178
+ }
179
+ function createMarketplaceVisualizationItems(products, orders) {
180
+ const orderStatus = new Map;
181
+ const orderActivity = new Map;
182
+ const categoryValue = new Map;
183
+ for (const order of orders) {
184
+ orderStatus.set(order.status, (orderStatus.get(order.status) ?? 0) + 1);
185
+ const day = toDayKey(order.createdAt);
186
+ orderActivity.set(day, (orderActivity.get(day) ?? 0) + 1);
187
+ }
188
+ for (const product of products) {
189
+ const category = product.category ?? "Uncategorized";
190
+ categoryValue.set(category, (categoryValue.get(category) ?? 0) + product.price * product.stock);
191
+ }
192
+ return [
193
+ {
194
+ key: "marketplace-order-status",
195
+ spec: MarketplaceOrderStatusVisualization,
196
+ data: {
197
+ data: Array.from(orderStatus.entries()).map(([status, count]) => ({
198
+ status,
199
+ orders: count
200
+ }))
201
+ },
202
+ title: "Order Status Breakdown",
203
+ description: "Status mix across the current order set.",
204
+ height: 260
205
+ },
206
+ {
207
+ key: "marketplace-category-value",
208
+ spec: MarketplaceCategoryValueVisualization,
209
+ data: {
210
+ data: Array.from(categoryValue.entries()).sort(([, left], [, right]) => right - left).map(([category, value]) => ({
211
+ category,
212
+ catalogValue: value
213
+ }))
214
+ },
215
+ title: "Category Value Comparison",
216
+ description: "Derived from current product pricing and stock."
217
+ },
218
+ {
219
+ key: "marketplace-order-activity",
220
+ spec: MarketplaceOrderActivityVisualization,
221
+ data: {
222
+ data: Array.from(orderActivity.entries()).sort(([left], [right]) => left.localeCompare(right)).map(([day, count]) => ({ day, orders: count }))
223
+ },
224
+ title: "Recent Order Activity",
225
+ description: "Daily order count from current order history."
226
+ }
227
+ ];
228
+ }
229
+ // src/ui/MarketplaceDashboard.visualizations.tsx
230
+ import {
231
+ VisualizationCard,
232
+ VisualizationGrid
233
+ } from "@contractspec/lib.design-system";
234
+ import { jsxDEV } from "react/jsx-dev-runtime";
235
+ "use client";
236
+ function MarketplaceVisualizationOverview({
237
+ products,
238
+ orders
239
+ }) {
240
+ const items = createMarketplaceVisualizationItems(products, orders);
241
+ return /* @__PURE__ */ jsxDEV("section", {
242
+ className: "space-y-3",
243
+ children: [
244
+ /* @__PURE__ */ jsxDEV("div", {
245
+ children: [
246
+ /* @__PURE__ */ jsxDEV("h3", {
247
+ className: "font-semibold text-lg",
248
+ children: "Commerce Visualizations"
249
+ }, undefined, false, undefined, this),
250
+ /* @__PURE__ */ jsxDEV("p", {
251
+ className: "text-muted-foreground text-sm",
252
+ children: "Order and catalog trends exposed through shared visualization contracts."
253
+ }, undefined, false, undefined, this)
254
+ ]
255
+ }, undefined, true, undefined, this),
256
+ /* @__PURE__ */ jsxDEV(VisualizationGrid, {
257
+ children: items.map((item) => /* @__PURE__ */ jsxDEV(VisualizationCard, {
258
+ data: item.data,
259
+ description: item.description,
260
+ height: item.height,
261
+ spec: item.spec,
262
+ title: item.title
263
+ }, item.key, false, undefined, this))
264
+ }, undefined, false, undefined, this)
265
+ ]
266
+ }, undefined, true, undefined, this);
267
+ }
268
+
55
269
  // src/ui/MarketplaceDashboard.tsx
56
- import { useState as useState2 } from "react";
57
270
  import {
58
271
  Button,
59
272
  ErrorState,
@@ -61,7 +274,8 @@ import {
61
274
  StatCard,
62
275
  StatCardGroup
63
276
  } from "@contractspec/lib.design-system";
64
- import { jsxDEV } from "react/jsx-dev-runtime";
277
+ import { useState as useState2 } from "react";
278
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
65
279
  "use client";
66
280
  var STATUS_COLORS = {
67
281
  ACTIVE: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
@@ -93,32 +307,32 @@ function MarketplaceDashboard() {
93
307
  { id: "orders", label: "Orders", icon: "\uD83D\uDED2" }
94
308
  ];
95
309
  if (loading) {
96
- return /* @__PURE__ */ jsxDEV(LoaderBlock, {
310
+ return /* @__PURE__ */ jsxDEV2(LoaderBlock, {
97
311
  label: "Loading Marketplace..."
98
312
  }, undefined, false, undefined, this);
99
313
  }
100
314
  if (error) {
101
- return /* @__PURE__ */ jsxDEV(ErrorState, {
315
+ return /* @__PURE__ */ jsxDEV2(ErrorState, {
102
316
  title: "Failed to load Marketplace",
103
317
  description: error.message,
104
318
  onRetry: refetch,
105
319
  retryLabel: "Retry"
106
320
  }, undefined, false, undefined, this);
107
321
  }
108
- return /* @__PURE__ */ jsxDEV("div", {
322
+ return /* @__PURE__ */ jsxDEV2("div", {
109
323
  className: "space-y-6",
110
324
  children: [
111
- /* @__PURE__ */ jsxDEV("div", {
325
+ /* @__PURE__ */ jsxDEV2("div", {
112
326
  className: "flex items-center justify-between",
113
327
  children: [
114
- /* @__PURE__ */ jsxDEV("h2", {
115
- className: "text-2xl font-bold",
328
+ /* @__PURE__ */ jsxDEV2("h2", {
329
+ className: "font-bold text-2xl",
116
330
  children: "Marketplace"
117
331
  }, undefined, false, undefined, this),
118
- /* @__PURE__ */ jsxDEV(Button, {
332
+ /* @__PURE__ */ jsxDEV2(Button, {
119
333
  onClick: () => alert("Create store modal"),
120
334
  children: [
121
- /* @__PURE__ */ jsxDEV("span", {
335
+ /* @__PURE__ */ jsxDEV2("span", {
122
336
  className: "mr-2",
123
337
  children: "+"
124
338
  }, undefined, false, undefined, this),
@@ -127,108 +341,112 @@ function MarketplaceDashboard() {
127
341
  }, undefined, true, undefined, this)
128
342
  ]
129
343
  }, undefined, true, undefined, this),
130
- /* @__PURE__ */ jsxDEV(StatCardGroup, {
344
+ /* @__PURE__ */ jsxDEV2(StatCardGroup, {
131
345
  children: [
132
- /* @__PURE__ */ jsxDEV(StatCard, {
346
+ /* @__PURE__ */ jsxDEV2(StatCard, {
133
347
  label: "Stores",
134
348
  value: stats.totalStores,
135
349
  hint: `${stats.activeStores} active`
136
350
  }, undefined, false, undefined, this),
137
- /* @__PURE__ */ jsxDEV(StatCard, {
351
+ /* @__PURE__ */ jsxDEV2(StatCard, {
138
352
  label: "Products",
139
353
  value: stats.totalProducts,
140
354
  hint: "listed"
141
355
  }, undefined, false, undefined, this),
142
- /* @__PURE__ */ jsxDEV(StatCard, {
356
+ /* @__PURE__ */ jsxDEV2(StatCard, {
143
357
  label: "Orders",
144
358
  value: stats.totalOrders,
145
359
  hint: `${stats.pendingOrders} pending`
146
360
  }, undefined, false, undefined, this),
147
- /* @__PURE__ */ jsxDEV(StatCard, {
361
+ /* @__PURE__ */ jsxDEV2(StatCard, {
148
362
  label: "Revenue",
149
363
  value: formatCurrency(stats.totalRevenue),
150
364
  hint: "total"
151
365
  }, undefined, false, undefined, this)
152
366
  ]
153
367
  }, undefined, true, undefined, this),
154
- /* @__PURE__ */ jsxDEV("nav", {
155
- className: "bg-muted flex gap-1 rounded-lg p-1",
368
+ /* @__PURE__ */ jsxDEV2(MarketplaceVisualizationOverview, {
369
+ orders,
370
+ products
371
+ }, undefined, false, undefined, this),
372
+ /* @__PURE__ */ jsxDEV2("nav", {
373
+ className: "flex gap-1 rounded-lg bg-muted p-1",
156
374
  role: "tablist",
157
- children: tabs.map((tab) => /* @__PURE__ */ jsxDEV(Button, {
375
+ children: tabs.map((tab) => /* @__PURE__ */ jsxDEV2(Button, {
158
376
  type: "button",
159
377
  role: "tab",
160
378
  "aria-selected": activeTab === tab.id,
161
379
  onClick: () => setActiveTab(tab.id),
162
- className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
380
+ 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
381
  children: [
164
- /* @__PURE__ */ jsxDEV("span", {
382
+ /* @__PURE__ */ jsxDEV2("span", {
165
383
  children: tab.icon
166
384
  }, undefined, false, undefined, this),
167
385
  tab.label
168
386
  ]
169
387
  }, tab.id, true, undefined, this))
170
388
  }, undefined, false, undefined, this),
171
- /* @__PURE__ */ jsxDEV("div", {
389
+ /* @__PURE__ */ jsxDEV2("div", {
172
390
  className: "min-h-[400px]",
173
391
  role: "tabpanel",
174
392
  children: [
175
- activeTab === "stores" && /* @__PURE__ */ jsxDEV("div", {
176
- className: "border-border rounded-lg border",
177
- children: /* @__PURE__ */ jsxDEV("table", {
393
+ activeTab === "stores" && /* @__PURE__ */ jsxDEV2("div", {
394
+ className: "rounded-lg border border-border",
395
+ children: /* @__PURE__ */ jsxDEV2("table", {
178
396
  className: "w-full",
179
397
  children: [
180
- /* @__PURE__ */ jsxDEV("thead", {
181
- className: "border-border bg-muted/30 border-b",
182
- children: /* @__PURE__ */ jsxDEV("tr", {
398
+ /* @__PURE__ */ jsxDEV2("thead", {
399
+ className: "border-border border-b bg-muted/30",
400
+ children: /* @__PURE__ */ jsxDEV2("tr", {
183
401
  children: [
184
- /* @__PURE__ */ jsxDEV("th", {
185
- className: "px-4 py-3 text-left text-sm font-medium",
402
+ /* @__PURE__ */ jsxDEV2("th", {
403
+ className: "px-4 py-3 text-left font-medium text-sm",
186
404
  children: "Store"
187
405
  }, undefined, false, undefined, this),
188
- /* @__PURE__ */ jsxDEV("th", {
189
- className: "px-4 py-3 text-left text-sm font-medium",
406
+ /* @__PURE__ */ jsxDEV2("th", {
407
+ className: "px-4 py-3 text-left font-medium text-sm",
190
408
  children: "Status"
191
409
  }, undefined, false, undefined, this),
192
- /* @__PURE__ */ jsxDEV("th", {
193
- className: "px-4 py-3 text-left text-sm font-medium",
410
+ /* @__PURE__ */ jsxDEV2("th", {
411
+ className: "px-4 py-3 text-left font-medium text-sm",
194
412
  children: "Rating"
195
413
  }, undefined, false, undefined, this),
196
- /* @__PURE__ */ jsxDEV("th", {
197
- className: "px-4 py-3 text-left text-sm font-medium",
414
+ /* @__PURE__ */ jsxDEV2("th", {
415
+ className: "px-4 py-3 text-left font-medium text-sm",
198
416
  children: "Reviews"
199
417
  }, undefined, false, undefined, this)
200
418
  ]
201
419
  }, undefined, true, undefined, this)
202
420
  }, undefined, false, undefined, this),
203
- /* @__PURE__ */ jsxDEV("tbody", {
204
- className: "divide-border divide-y",
421
+ /* @__PURE__ */ jsxDEV2("tbody", {
422
+ className: "divide-y divide-border",
205
423
  children: [
206
- stores.map((store) => /* @__PURE__ */ jsxDEV("tr", {
424
+ stores.map((store) => /* @__PURE__ */ jsxDEV2("tr", {
207
425
  className: "hover:bg-muted/50",
208
426
  children: [
209
- /* @__PURE__ */ jsxDEV("td", {
427
+ /* @__PURE__ */ jsxDEV2("td", {
210
428
  className: "px-4 py-3",
211
429
  children: [
212
- /* @__PURE__ */ jsxDEV("div", {
430
+ /* @__PURE__ */ jsxDEV2("div", {
213
431
  className: "font-medium",
214
432
  children: store.name
215
433
  }, undefined, false, undefined, this),
216
- /* @__PURE__ */ jsxDEV("div", {
434
+ /* @__PURE__ */ jsxDEV2("div", {
217
435
  className: "text-muted-foreground text-sm",
218
436
  children: store.description
219
437
  }, undefined, false, undefined, this)
220
438
  ]
221
439
  }, undefined, true, undefined, this),
222
- /* @__PURE__ */ jsxDEV("td", {
440
+ /* @__PURE__ */ jsxDEV2("td", {
223
441
  className: "px-4 py-3",
224
- children: /* @__PURE__ */ jsxDEV("span", {
225
- className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[store.status] ?? ""}`,
442
+ children: /* @__PURE__ */ jsxDEV2("span", {
443
+ className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[store.status] ?? ""}`,
226
444
  children: store.status
227
445
  }, undefined, false, undefined, this)
228
446
  }, undefined, false, undefined, this),
229
- /* @__PURE__ */ jsxDEV("td", {
447
+ /* @__PURE__ */ jsxDEV2("td", {
230
448
  className: "px-4 py-3",
231
- children: /* @__PURE__ */ jsxDEV("span", {
449
+ children: /* @__PURE__ */ jsxDEV2("span", {
232
450
  className: "flex items-center gap-1",
233
451
  children: [
234
452
  "⭐ ",
@@ -236,8 +454,8 @@ function MarketplaceDashboard() {
236
454
  ]
237
455
  }, undefined, true, undefined, this)
238
456
  }, undefined, false, undefined, this),
239
- /* @__PURE__ */ jsxDEV("td", {
240
- className: "text-muted-foreground px-4 py-3 text-sm",
457
+ /* @__PURE__ */ jsxDEV2("td", {
458
+ className: "px-4 py-3 text-muted-foreground text-sm",
241
459
  children: [
242
460
  store.reviewCount,
243
461
  " reviews"
@@ -245,10 +463,10 @@ function MarketplaceDashboard() {
245
463
  }, undefined, true, undefined, this)
246
464
  ]
247
465
  }, store.id, true, undefined, this)),
248
- stores.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
249
- children: /* @__PURE__ */ jsxDEV("td", {
466
+ stores.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
467
+ children: /* @__PURE__ */ jsxDEV2("td", {
250
468
  colSpan: 4,
251
- className: "text-muted-foreground px-4 py-8 text-center",
469
+ className: "px-4 py-8 text-center text-muted-foreground",
252
470
  children: "No stores found"
253
471
  }, undefined, false, undefined, this)
254
472
  }, undefined, false, undefined, this)
@@ -257,74 +475,74 @@ function MarketplaceDashboard() {
257
475
  ]
258
476
  }, undefined, true, undefined, this)
259
477
  }, undefined, false, undefined, this),
260
- activeTab === "products" && /* @__PURE__ */ jsxDEV("div", {
261
- className: "border-border rounded-lg border",
262
- children: /* @__PURE__ */ jsxDEV("table", {
478
+ activeTab === "products" && /* @__PURE__ */ jsxDEV2("div", {
479
+ className: "rounded-lg border border-border",
480
+ children: /* @__PURE__ */ jsxDEV2("table", {
263
481
  className: "w-full",
264
482
  children: [
265
- /* @__PURE__ */ jsxDEV("thead", {
266
- className: "border-border bg-muted/30 border-b",
267
- children: /* @__PURE__ */ jsxDEV("tr", {
483
+ /* @__PURE__ */ jsxDEV2("thead", {
484
+ className: "border-border border-b bg-muted/30",
485
+ children: /* @__PURE__ */ jsxDEV2("tr", {
268
486
  children: [
269
- /* @__PURE__ */ jsxDEV("th", {
270
- className: "px-4 py-3 text-left text-sm font-medium",
487
+ /* @__PURE__ */ jsxDEV2("th", {
488
+ className: "px-4 py-3 text-left font-medium text-sm",
271
489
  children: "Product"
272
490
  }, undefined, false, undefined, this),
273
- /* @__PURE__ */ jsxDEV("th", {
274
- className: "px-4 py-3 text-left text-sm font-medium",
491
+ /* @__PURE__ */ jsxDEV2("th", {
492
+ className: "px-4 py-3 text-left font-medium text-sm",
275
493
  children: "Price"
276
494
  }, undefined, false, undefined, this),
277
- /* @__PURE__ */ jsxDEV("th", {
278
- className: "px-4 py-3 text-left text-sm font-medium",
495
+ /* @__PURE__ */ jsxDEV2("th", {
496
+ className: "px-4 py-3 text-left font-medium text-sm",
279
497
  children: "Stock"
280
498
  }, undefined, false, undefined, this),
281
- /* @__PURE__ */ jsxDEV("th", {
282
- className: "px-4 py-3 text-left text-sm font-medium",
499
+ /* @__PURE__ */ jsxDEV2("th", {
500
+ className: "px-4 py-3 text-left font-medium text-sm",
283
501
  children: "Status"
284
502
  }, undefined, false, undefined, this)
285
503
  ]
286
504
  }, undefined, true, undefined, this)
287
505
  }, undefined, false, undefined, this),
288
- /* @__PURE__ */ jsxDEV("tbody", {
289
- className: "divide-border divide-y",
506
+ /* @__PURE__ */ jsxDEV2("tbody", {
507
+ className: "divide-y divide-border",
290
508
  children: [
291
- products.map((product) => /* @__PURE__ */ jsxDEV("tr", {
509
+ products.map((product) => /* @__PURE__ */ jsxDEV2("tr", {
292
510
  className: "hover:bg-muted/50",
293
511
  children: [
294
- /* @__PURE__ */ jsxDEV("td", {
512
+ /* @__PURE__ */ jsxDEV2("td", {
295
513
  className: "px-4 py-3",
296
514
  children: [
297
- /* @__PURE__ */ jsxDEV("div", {
515
+ /* @__PURE__ */ jsxDEV2("div", {
298
516
  className: "font-medium",
299
517
  children: product.name
300
518
  }, undefined, false, undefined, this),
301
- /* @__PURE__ */ jsxDEV("div", {
519
+ /* @__PURE__ */ jsxDEV2("div", {
302
520
  className: "text-muted-foreground text-sm",
303
521
  children: product.category
304
522
  }, undefined, false, undefined, this)
305
523
  ]
306
524
  }, undefined, true, undefined, this),
307
- /* @__PURE__ */ jsxDEV("td", {
525
+ /* @__PURE__ */ jsxDEV2("td", {
308
526
  className: "px-4 py-3 font-mono",
309
527
  children: formatCurrency(product.price, product.currency)
310
528
  }, undefined, false, undefined, this),
311
- /* @__PURE__ */ jsxDEV("td", {
529
+ /* @__PURE__ */ jsxDEV2("td", {
312
530
  className: "px-4 py-3",
313
531
  children: product.stock
314
532
  }, undefined, false, undefined, this),
315
- /* @__PURE__ */ jsxDEV("td", {
533
+ /* @__PURE__ */ jsxDEV2("td", {
316
534
  className: "px-4 py-3",
317
- children: /* @__PURE__ */ jsxDEV("span", {
318
- className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[product.status] ?? ""}`,
535
+ children: /* @__PURE__ */ jsxDEV2("span", {
536
+ className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[product.status] ?? ""}`,
319
537
  children: product.status
320
538
  }, undefined, false, undefined, this)
321
539
  }, undefined, false, undefined, this)
322
540
  ]
323
541
  }, product.id, true, undefined, this)),
324
- products.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
325
- children: /* @__PURE__ */ jsxDEV("td", {
542
+ products.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
543
+ children: /* @__PURE__ */ jsxDEV2("td", {
326
544
  colSpan: 4,
327
- className: "text-muted-foreground px-4 py-8 text-center",
545
+ className: "px-4 py-8 text-center text-muted-foreground",
328
546
  children: "No products found"
329
547
  }, undefined, false, undefined, this)
330
548
  }, undefined, false, undefined, this)
@@ -333,73 +551,73 @@ function MarketplaceDashboard() {
333
551
  ]
334
552
  }, undefined, true, undefined, this)
335
553
  }, undefined, false, undefined, this),
336
- activeTab === "orders" && /* @__PURE__ */ jsxDEV("div", {
337
- className: "border-border rounded-lg border",
338
- children: /* @__PURE__ */ jsxDEV("table", {
554
+ activeTab === "orders" && /* @__PURE__ */ jsxDEV2("div", {
555
+ className: "rounded-lg border border-border",
556
+ children: /* @__PURE__ */ jsxDEV2("table", {
339
557
  className: "w-full",
340
558
  children: [
341
- /* @__PURE__ */ jsxDEV("thead", {
342
- className: "border-border bg-muted/30 border-b",
343
- children: /* @__PURE__ */ jsxDEV("tr", {
559
+ /* @__PURE__ */ jsxDEV2("thead", {
560
+ className: "border-border border-b bg-muted/30",
561
+ children: /* @__PURE__ */ jsxDEV2("tr", {
344
562
  children: [
345
- /* @__PURE__ */ jsxDEV("th", {
346
- className: "px-4 py-3 text-left text-sm font-medium",
563
+ /* @__PURE__ */ jsxDEV2("th", {
564
+ className: "px-4 py-3 text-left font-medium text-sm",
347
565
  children: "Order ID"
348
566
  }, undefined, false, undefined, this),
349
- /* @__PURE__ */ jsxDEV("th", {
350
- className: "px-4 py-3 text-left text-sm font-medium",
567
+ /* @__PURE__ */ jsxDEV2("th", {
568
+ className: "px-4 py-3 text-left font-medium text-sm",
351
569
  children: "Customer"
352
570
  }, undefined, false, undefined, this),
353
- /* @__PURE__ */ jsxDEV("th", {
354
- className: "px-4 py-3 text-left text-sm font-medium",
571
+ /* @__PURE__ */ jsxDEV2("th", {
572
+ className: "px-4 py-3 text-left font-medium text-sm",
355
573
  children: "Total"
356
574
  }, undefined, false, undefined, this),
357
- /* @__PURE__ */ jsxDEV("th", {
358
- className: "px-4 py-3 text-left text-sm font-medium",
575
+ /* @__PURE__ */ jsxDEV2("th", {
576
+ className: "px-4 py-3 text-left font-medium text-sm",
359
577
  children: "Status"
360
578
  }, undefined, false, undefined, this),
361
- /* @__PURE__ */ jsxDEV("th", {
362
- className: "px-4 py-3 text-left text-sm font-medium",
579
+ /* @__PURE__ */ jsxDEV2("th", {
580
+ className: "px-4 py-3 text-left font-medium text-sm",
363
581
  children: "Date"
364
582
  }, undefined, false, undefined, this)
365
583
  ]
366
584
  }, undefined, true, undefined, this)
367
585
  }, undefined, false, undefined, this),
368
- /* @__PURE__ */ jsxDEV("tbody", {
369
- className: "divide-border divide-y",
586
+ /* @__PURE__ */ jsxDEV2("tbody", {
587
+ className: "divide-y divide-border",
370
588
  children: [
371
- orders.map((order) => /* @__PURE__ */ jsxDEV("tr", {
589
+ orders.map((order) => /* @__PURE__ */ jsxDEV2("tr", {
372
590
  className: "hover:bg-muted/50",
373
591
  children: [
374
- /* @__PURE__ */ jsxDEV("td", {
592
+ /* @__PURE__ */ jsxDEV2("td", {
375
593
  className: "px-4 py-3 font-mono text-sm",
376
594
  children: order.id
377
595
  }, undefined, false, undefined, this),
378
- /* @__PURE__ */ jsxDEV("td", {
596
+ /* @__PURE__ */ jsxDEV2("td", {
379
597
  className: "px-4 py-3 text-sm",
380
598
  children: order.customerId
381
599
  }, undefined, false, undefined, this),
382
- /* @__PURE__ */ jsxDEV("td", {
600
+ /* @__PURE__ */ jsxDEV2("td", {
383
601
  className: "px-4 py-3 font-mono",
384
602
  children: formatCurrency(order.total, order.currency)
385
603
  }, undefined, false, undefined, this),
386
- /* @__PURE__ */ jsxDEV("td", {
604
+ /* @__PURE__ */ jsxDEV2("td", {
387
605
  className: "px-4 py-3",
388
- children: /* @__PURE__ */ jsxDEV("span", {
389
- className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${STATUS_COLORS[order.status] ?? ""}`,
606
+ children: /* @__PURE__ */ jsxDEV2("span", {
607
+ className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[order.status] ?? ""}`,
390
608
  children: order.status
391
609
  }, undefined, false, undefined, this)
392
610
  }, undefined, false, undefined, this),
393
- /* @__PURE__ */ jsxDEV("td", {
394
- className: "text-muted-foreground px-4 py-3 text-sm",
611
+ /* @__PURE__ */ jsxDEV2("td", {
612
+ className: "px-4 py-3 text-muted-foreground text-sm",
395
613
  children: order.createdAt.toLocaleDateString()
396
614
  }, undefined, false, undefined, this)
397
615
  ]
398
616
  }, order.id, true, undefined, this)),
399
- orders.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
400
- children: /* @__PURE__ */ jsxDEV("td", {
617
+ orders.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
618
+ children: /* @__PURE__ */ jsxDEV2("td", {
401
619
  colSpan: 5,
402
- className: "text-muted-foreground px-4 py-8 text-center",
620
+ className: "px-4 py-8 text-center text-muted-foreground",
403
621
  children: "No orders found"
404
622
  }, undefined, false, undefined, this)
405
623
  }, undefined, false, undefined, this)