@rovela-ai/sdk 0.1.19 → 0.1.21

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 (82) hide show
  1. package/dist/admin/components/AdminNav.d.ts +10 -3
  2. package/dist/admin/components/AdminNav.d.ts.map +1 -1
  3. package/dist/admin/components/AdminNav.js +80 -28
  4. package/dist/admin/components/AdminNav.js.map +1 -1
  5. package/dist/admin/components/CategoryForm.d.ts +30 -0
  6. package/dist/admin/components/CategoryForm.d.ts.map +1 -0
  7. package/dist/admin/components/CategoryForm.js +153 -0
  8. package/dist/admin/components/CategoryForm.js.map +1 -0
  9. package/dist/admin/components/CategorySelect.d.ts +32 -0
  10. package/dist/admin/components/CategorySelect.d.ts.map +1 -0
  11. package/dist/admin/components/CategorySelect.js +148 -0
  12. package/dist/admin/components/CategorySelect.js.map +1 -0
  13. package/dist/admin/components/LowStockAlert.d.ts +2 -2
  14. package/dist/admin/components/LowStockAlert.d.ts.map +1 -1
  15. package/dist/admin/components/LowStockAlert.js +16 -9
  16. package/dist/admin/components/LowStockAlert.js.map +1 -1
  17. package/dist/admin/components/OrderStatusChart.d.ts +21 -0
  18. package/dist/admin/components/OrderStatusChart.d.ts.map +1 -0
  19. package/dist/admin/components/OrderStatusChart.js +54 -0
  20. package/dist/admin/components/OrderStatusChart.js.map +1 -0
  21. package/dist/admin/components/ProductForm.d.ts +2 -2
  22. package/dist/admin/components/ProductForm.d.ts.map +1 -1
  23. package/dist/admin/components/ProductForm.js +125 -9
  24. package/dist/admin/components/ProductForm.js.map +1 -1
  25. package/dist/admin/components/RecentOrders.d.ts +1 -1
  26. package/dist/admin/components/RecentOrders.d.ts.map +1 -1
  27. package/dist/admin/components/RecentOrders.js +11 -10
  28. package/dist/admin/components/RecentOrders.js.map +1 -1
  29. package/dist/admin/components/RevenueChart.d.ts +23 -0
  30. package/dist/admin/components/RevenueChart.d.ts.map +1 -0
  31. package/dist/admin/components/RevenueChart.js +70 -0
  32. package/dist/admin/components/RevenueChart.js.map +1 -0
  33. package/dist/admin/components/SEOPreview.d.ts +32 -0
  34. package/dist/admin/components/SEOPreview.d.ts.map +1 -0
  35. package/dist/admin/components/SEOPreview.js +30 -0
  36. package/dist/admin/components/SEOPreview.js.map +1 -0
  37. package/dist/admin/components/StatsCards.d.ts +2 -2
  38. package/dist/admin/components/StatsCards.d.ts.map +1 -1
  39. package/dist/admin/components/StatsCards.js +18 -20
  40. package/dist/admin/components/StatsCards.js.map +1 -1
  41. package/dist/admin/components/TagInput.d.ts +29 -0
  42. package/dist/admin/components/TagInput.d.ts.map +1 -0
  43. package/dist/admin/components/TagInput.js +73 -0
  44. package/dist/admin/components/TagInput.js.map +1 -0
  45. package/dist/admin/components/VariantManager.d.ts +42 -0
  46. package/dist/admin/components/VariantManager.d.ts.map +1 -0
  47. package/dist/admin/components/VariantManager.js +175 -0
  48. package/dist/admin/components/VariantManager.js.map +1 -0
  49. package/dist/admin/components/index.d.ts +9 -0
  50. package/dist/admin/components/index.d.ts.map +1 -1
  51. package/dist/admin/components/index.js +13 -0
  52. package/dist/admin/components/index.js.map +1 -1
  53. package/dist/admin/hooks/index.d.ts +2 -0
  54. package/dist/admin/hooks/index.d.ts.map +1 -1
  55. package/dist/admin/hooks/index.js +1 -0
  56. package/dist/admin/hooks/index.js.map +1 -1
  57. package/dist/admin/hooks/useAdminCategories.d.ts +36 -0
  58. package/dist/admin/hooks/useAdminCategories.d.ts.map +1 -0
  59. package/dist/admin/hooks/useAdminCategories.js +217 -0
  60. package/dist/admin/hooks/useAdminCategories.js.map +1 -0
  61. package/dist/admin/index.d.ts +4 -3
  62. package/dist/admin/index.d.ts.map +1 -1
  63. package/dist/admin/index.js +6 -2
  64. package/dist/admin/index.js.map +1 -1
  65. package/dist/core/StoreSettingsProvider.d.ts +104 -0
  66. package/dist/core/StoreSettingsProvider.d.ts.map +1 -0
  67. package/dist/core/StoreSettingsProvider.js +195 -0
  68. package/dist/core/StoreSettingsProvider.js.map +1 -0
  69. package/dist/core/api/index.d.ts +7 -0
  70. package/dist/core/api/index.d.ts.map +1 -0
  71. package/dist/core/api/index.js +7 -0
  72. package/dist/core/api/index.js.map +1 -0
  73. package/dist/core/api/settings.d.ts +42 -0
  74. package/dist/core/api/settings.d.ts.map +1 -0
  75. package/dist/core/api/settings.js +74 -0
  76. package/dist/core/api/settings.js.map +1 -0
  77. package/dist/core/db/queries.d.ts +6 -6
  78. package/dist/core/index.d.ts +2 -0
  79. package/dist/core/index.d.ts.map +1 -1
  80. package/dist/core/index.js +2 -0
  81. package/dist/core/index.js.map +1 -1
  82. package/package.json +6 -1
@@ -3,20 +3,26 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  /**
4
4
  * @rovela/sdk/admin/components/ProductForm
5
5
  *
6
- * Product create/edit form.
6
+ * Enhanced product create/edit form with 2-column layout.
7
+ * Includes: Basic info, Media, Pricing, Inventory, Variants, SEO, Organization.
7
8
  */
8
- import { useState, useCallback, useEffect } from 'react';
9
+ import { useState, useCallback, useEffect, useMemo } from 'react';
9
10
  import { useAdminProducts } from '../hooks/useAdminProducts';
11
+ import { CategorySelect } from './CategorySelect';
12
+ import { SEOPreview } from './SEOPreview';
13
+ import { TagInput } from './TagInput';
14
+ import { VariantManager } from './VariantManager';
15
+ import { ImagePlus, Trash2, GripVertical, Info, ChevronDown, ChevronUp, Package } from 'lucide-react';
10
16
  // =============================================================================
11
17
  // Component
12
18
  // =============================================================================
13
19
  /**
14
- * Product form for create and edit.
20
+ * Enhanced product form for create and edit.
15
21
  *
16
22
  * @example
17
23
  * ```tsx
18
24
  * // Create mode
19
- * <ProductForm onSuccess={(id) => router.push(`/admin/products/${id}`)} />
25
+ * <ProductForm onSuccess={() => router.push('/admin/products')} />
20
26
  *
21
27
  * // Edit mode
22
28
  * <ProductForm
@@ -28,6 +34,7 @@ import { useAdminProducts } from '../hooks/useAdminProducts';
28
34
  export function ProductForm({ productId, initialData, onSuccess, onCancel, className = '', }) {
29
35
  const { getProduct, createProduct, updateProduct } = useAdminProducts();
30
36
  const isEditMode = !!productId;
37
+ // Form state
31
38
  const [formData, setFormData] = useState({
32
39
  name: initialData?.name || '',
33
40
  slug: initialData?.slug || '',
@@ -41,11 +48,28 @@ export function ProductForm({ productId, initialData, onSuccess, onCancel, class
41
48
  metaTitle: initialData?.metaTitle,
42
49
  metaDescription: initialData?.metaDescription,
43
50
  metaKeywords: initialData?.metaKeywords || [],
51
+ sku: '',
52
+ inventory: 0,
53
+ trackInventory: true,
44
54
  });
55
+ // Variant state
56
+ const [variantOptions, setVariantOptions] = useState([]);
57
+ const [variants, setVariants] = useState([]);
58
+ const [existingVariants, setExistingVariants] = useState([]);
59
+ // Image URL input
45
60
  const [imageUrl, setImageUrl] = useState('');
61
+ // UI state
46
62
  const [isLoading, setIsLoading] = useState(false);
47
63
  const [isFetching, setIsFetching] = useState(false);
48
64
  const [error, setError] = useState(null);
65
+ const [seoExpanded, setSeoExpanded] = useState(false);
66
+ // Auto-generate slug from name
67
+ const autoSlug = useMemo(() => {
68
+ return formData.name
69
+ .toLowerCase()
70
+ .replace(/[^a-z0-9]+/g, '-')
71
+ .replace(/^-|-$/g, '');
72
+ }, [formData.name]);
49
73
  // Load product data in edit mode
50
74
  useEffect(() => {
51
75
  if (productId && !initialData) {
@@ -67,18 +91,65 @@ export function ProductForm({ productId, initialData, onSuccess, onCancel, class
67
91
  metaDescription: p.metaDescription || undefined,
68
92
  metaKeywords: p.metaKeywords || [],
69
93
  });
94
+ // Load existing variants
95
+ if (p.variants && p.variants.length > 0) {
96
+ setExistingVariants(p.variants.map((v) => ({
97
+ sku: v.sku,
98
+ name: v.name,
99
+ price: v.price ? parseFloat(v.price) : undefined,
100
+ inventory: v.inventory,
101
+ attributes: v.attributes,
102
+ })));
103
+ // Reconstruct variant options from existing variants
104
+ const optionNames = new Set();
105
+ const optionValuesMap = new Map();
106
+ for (const variant of p.variants) {
107
+ for (const [key, value] of Object.entries(variant.attributes)) {
108
+ optionNames.add(key);
109
+ if (!optionValuesMap.has(key)) {
110
+ optionValuesMap.set(key, new Set());
111
+ }
112
+ optionValuesMap.get(key).add(value);
113
+ }
114
+ }
115
+ const reconstructedOptions = Array.from(optionNames).map((name) => ({
116
+ name,
117
+ values: Array.from(optionValuesMap.get(name) || []),
118
+ }));
119
+ setVariantOptions(reconstructedOptions);
120
+ // Set variants
121
+ setVariants(p.variants.map((v) => ({
122
+ id: v.id,
123
+ sku: v.sku,
124
+ name: v.name,
125
+ price: v.price ? parseFloat(v.price) : null,
126
+ inventory: v.inventory,
127
+ attributes: v.attributes,
128
+ })));
129
+ }
130
+ // Auto-expand SEO if has values
131
+ if (p.metaTitle || p.metaDescription || (p.metaKeywords && p.metaKeywords.length > 0)) {
132
+ setSeoExpanded(true);
133
+ }
70
134
  }
71
135
  setIsFetching(false);
72
136
  });
73
137
  }
74
138
  }, [productId, initialData, getProduct]);
139
+ // Handle field changes
75
140
  const handleChange = useCallback((e) => {
76
141
  const { name, value, type } = e.target;
142
+ const checked = e.target.checked;
77
143
  setFormData((prev) => ({
78
144
  ...prev,
79
- [name]: type === 'number' ? (value ? parseFloat(value) : 0) : value,
145
+ [name]: type === 'checkbox'
146
+ ? checked
147
+ : type === 'number'
148
+ ? (value ? parseFloat(value) : 0)
149
+ : value,
80
150
  }));
81
151
  }, []);
152
+ // Handle image add
82
153
  const handleAddImage = useCallback(() => {
83
154
  if (imageUrl.trim()) {
84
155
  setFormData((prev) => ({
@@ -88,20 +159,56 @@ export function ProductForm({ productId, initialData, onSuccess, onCancel, class
88
159
  setImageUrl('');
89
160
  }
90
161
  }, [imageUrl]);
162
+ // Handle image remove
91
163
  const handleRemoveImage = useCallback((index) => {
92
164
  setFormData((prev) => ({
93
165
  ...prev,
94
166
  images: prev.images.filter((_, i) => i !== index),
95
167
  }));
96
168
  }, []);
169
+ // Handle image reorder
170
+ const handleMoveImage = useCallback((fromIndex, toIndex) => {
171
+ setFormData((prev) => {
172
+ const newImages = [...prev.images];
173
+ const [removed] = newImages.splice(fromIndex, 1);
174
+ newImages.splice(toIndex, 0, removed);
175
+ return { ...prev, images: newImages };
176
+ });
177
+ }, []);
178
+ // Handle submit
97
179
  const handleSubmit = useCallback(async (e) => {
98
180
  e.preventDefault();
99
181
  setError(null);
100
182
  setIsLoading(true);
101
183
  try {
184
+ // Build data
185
+ const data = {
186
+ name: formData.name,
187
+ slug: formData.slug || autoSlug,
188
+ description: formData.description,
189
+ price: formData.price,
190
+ comparePrice: formData.comparePrice,
191
+ images: formData.images,
192
+ status: isEditMode ? formData.status : 'draft', // Always create as draft
193
+ categoryId: formData.categoryId,
194
+ hasVariants: formData.hasVariants,
195
+ metaTitle: formData.metaTitle,
196
+ metaDescription: formData.metaDescription,
197
+ metaKeywords: formData.metaKeywords,
198
+ };
199
+ // Add variants if product has variants
200
+ if (formData.hasVariants && variants.length > 0) {
201
+ data.variants = variants.map((v) => ({
202
+ sku: v.sku,
203
+ name: v.name,
204
+ price: v.price ?? undefined,
205
+ inventory: v.inventory,
206
+ attributes: v.attributes,
207
+ }));
208
+ }
102
209
  const result = isEditMode
103
- ? await updateProduct(productId, formData)
104
- : await createProduct(formData);
210
+ ? await updateProduct(productId, data)
211
+ : await createProduct(data);
105
212
  if (!result.success) {
106
213
  setError(result.error || 'Failed to save product');
107
214
  return;
@@ -115,10 +222,19 @@ export function ProductForm({ productId, initialData, onSuccess, onCancel, class
115
222
  finally {
116
223
  setIsLoading(false);
117
224
  }
118
- }, [isEditMode, productId, formData, createProduct, updateProduct, onSuccess]);
225
+ }, [isEditMode, productId, formData, autoSlug, variants, createProduct, updateProduct, onSuccess]);
226
+ // Loading state
119
227
  if (isFetching) {
120
228
  return (_jsx("div", { className: "flex items-center justify-center py-12", children: _jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" }) }));
121
229
  }
122
- return (_jsxs("form", { onSubmit: handleSubmit, className: `space-y-6 ${className}`, children: [error && (_jsx("div", { className: "rounded-md bg-destructive/10 px-4 py-3 text-sm text-destructive", children: error })), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Basic Information" }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("label", { htmlFor: "name", className: "block text-sm font-medium text-foreground", children: "Product Name *" }), _jsx("input", { id: "name", name: "name", type: "text", value: formData.name, onChange: handleChange, required: true, className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "slug", className: "block text-sm font-medium text-foreground", children: "Slug" }), _jsx("input", { id: "slug", name: "slug", type: "text", value: formData.slug, onChange: handleChange, placeholder: "auto-generated-from-name", className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "description", className: "block text-sm font-medium text-foreground", children: "Description" }), _jsx("textarea", { id: "description", name: "description", value: formData.description, onChange: handleChange, rows: 4, className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] })] })] }), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Pricing" }), _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsxs("div", { children: [_jsx("label", { htmlFor: "price", className: "block text-sm font-medium text-foreground", children: "Price *" }), _jsx("input", { id: "price", name: "price", type: "number", step: "0.01", min: "0", value: formData.price, onChange: handleChange, required: true, className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "comparePrice", className: "block text-sm font-medium text-foreground", children: "Compare at Price" }), _jsx("input", { id: "comparePrice", name: "comparePrice", type: "number", step: "0.01", min: "0", value: formData.comparePrice || '', onChange: handleChange, placeholder: "Original price for sales", className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] })] })] }), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Images" }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx("input", { type: "url", value: imageUrl, onChange: (e) => setImageUrl(e.target.value), placeholder: "Enter image URL", className: "flex-1 rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" }), _jsx("button", { type: "button", onClick: handleAddImage, className: "rounded-md bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80", children: "Add" })] }), formData.images.length > 0 && (_jsx("div", { className: "grid grid-cols-4 gap-4", children: formData.images.map((url, index) => (_jsxs("div", { className: "relative", children: [_jsx("img", { src: url, alt: `Product ${index + 1}`, className: "h-24 w-full rounded object-cover" }), _jsx("button", { type: "button", onClick: () => handleRemoveImage(index), className: "absolute -right-2 -top-2 rounded-full bg-destructive p-1 text-destructive-foreground hover:bg-destructive/80", children: _jsx("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }, index))) }))] })] }), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Status" }), _jsxs("select", { name: "status", value: formData.status, onChange: handleChange, className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary", children: [_jsx("option", { value: "draft", children: "Draft" }), _jsx("option", { value: "active", children: "Active" }), _jsx("option", { value: "archived", children: "Archived" })] })] }), _jsxs("div", { className: "flex justify-end gap-4", children: [onCancel && (_jsx("button", { type: "button", onClick: onCancel, className: "rounded-md border border-border px-4 py-2 text-sm font-medium text-foreground hover:bg-accent", children: "Cancel" })), _jsx("button", { type: "submit", disabled: isLoading, className: "rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50", children: isLoading ? 'Saving...' : isEditMode ? 'Update Product' : 'Create Product' })] })] }));
230
+ return (_jsxs("form", { onSubmit: handleSubmit, className: `${className}`, children: [error && (_jsx("div", { className: "mb-6 rounded-md bg-destructive/10 px-4 py-3 text-sm text-destructive", children: error })), _jsxs("div", { className: "grid gap-6 lg:grid-cols-3", children: [_jsxs("div", { className: "space-y-6 lg:col-span-2", children: [_jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Basic Information" }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { children: [_jsxs("label", { htmlFor: "name", className: "block text-sm font-medium text-foreground", children: ["Product Name ", _jsx("span", { className: "text-destructive", children: "*" })] }), _jsx("input", { id: "name", name: "name", type: "text", value: formData.name, onChange: handleChange, required: true, placeholder: "e.g., Premium Cotton T-Shirt", className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "slug", className: "block text-sm font-medium text-foreground", children: "URL Handle" }), _jsxs("div", { className: "mt-1 flex rounded-md border border-input focus-within:border-primary focus-within:ring-1 focus-within:ring-primary", children: [_jsx("span", { className: "inline-flex items-center rounded-l-md border-r border-input bg-muted px-3 text-sm text-muted-foreground", children: "/products/" }), _jsx("input", { id: "slug", name: "slug", type: "text", value: formData.slug, onChange: handleChange, placeholder: autoSlug || 'auto-generated', className: "flex-1 rounded-r-md border-0 bg-background px-3 py-2 text-sm focus:outline-none" })] }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Leave blank to auto-generate from product name" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "description", className: "block text-sm font-medium text-foreground", children: "Description" }), _jsx("textarea", { id: "description", name: "description", value: formData.description, onChange: handleChange, rows: 5, placeholder: "Describe your product in detail...", className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" }), _jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [formData.description.length, " characters"] })] })] })] }), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Media" }), _jsxs("div", { className: "space-y-4", children: [formData.images.length > 0 && (_jsx("div", { className: "grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4", children: formData.images.map((url, index) => (_jsxs("div", { className: "group relative aspect-square overflow-hidden rounded-lg border border-border bg-muted", children: [_jsx("img", { src: url, alt: `Product ${index + 1}`, className: "h-full w-full object-cover" }), index === 0 && (_jsx("span", { className: "absolute left-2 top-2 rounded bg-primary px-2 py-0.5 text-xs font-medium text-primary-foreground", children: "Primary" })), _jsxs("div", { className: "absolute inset-0 flex items-center justify-center gap-2 bg-black/50 opacity-0 transition-opacity group-hover:opacity-100", children: [index > 0 && (_jsx("button", { type: "button", onClick: () => handleMoveImage(index, 0), className: "rounded-full bg-white p-2 text-foreground hover:bg-gray-100", title: "Make primary", children: _jsx(GripVertical, { className: "h-4 w-4" }) })), _jsx("button", { type: "button", onClick: () => handleRemoveImage(index), className: "rounded-full bg-destructive p-2 text-destructive-foreground hover:bg-destructive/90", title: "Remove", children: _jsx(Trash2, { className: "h-4 w-4" }) })] })] }, index))) })), _jsxs("div", { className: "flex gap-2", children: [_jsx("input", { type: "url", value: imageUrl, onChange: (e) => setImageUrl(e.target.value), onKeyDown: (e) => {
231
+ if (e.key === 'Enter') {
232
+ e.preventDefault();
233
+ handleAddImage();
234
+ }
235
+ }, placeholder: "Paste image URL...", className: "flex-1 rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" }), _jsxs("button", { type: "button", onClick: handleAddImage, disabled: !imageUrl.trim(), className: "inline-flex items-center gap-2 rounded-md bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80 disabled:opacity-50", children: [_jsx(ImagePlus, { className: "h-4 w-4" }), "Add"] })] }), formData.images.length === 0 && (_jsxs("div", { className: "rounded-lg border-2 border-dashed border-border p-8 text-center", children: [_jsx(ImagePlus, { className: "mx-auto h-10 w-10 text-muted-foreground" }), _jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: "Add images by pasting URLs above" })] }))] })] }), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Pricing" }), _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsxs("div", { children: [_jsxs("label", { htmlFor: "price", className: "block text-sm font-medium text-foreground", children: ["Price ", _jsx("span", { className: "text-destructive", children: "*" })] }), _jsxs("div", { className: "mt-1 relative", children: [_jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: "$" }), _jsx("input", { id: "price", name: "price", type: "number", step: "0.01", min: "0", value: formData.price, onChange: handleChange, required: true, className: "block w-full rounded-md border border-input bg-background pl-7 pr-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "comparePrice", className: "block text-sm font-medium text-foreground", children: "Compare at Price" }), _jsxs("div", { className: "mt-1 relative", children: [_jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: "$" }), _jsx("input", { id: "comparePrice", name: "comparePrice", type: "number", step: "0.01", min: "0", value: formData.comparePrice || '', onChange: handleChange, placeholder: "Original price", className: "block w-full rounded-md border border-input bg-background pl-7 pr-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Shows as strikethrough price for sales" })] })] }), formData.comparePrice && formData.comparePrice > formData.price && (_jsxs("div", { className: "mt-4 flex items-center gap-2 rounded-md bg-green-50 dark:bg-green-950/20 px-3 py-2 text-sm text-green-700 dark:text-green-400", children: [_jsx(Info, { className: "h-4 w-4" }), Math.round(((formData.comparePrice - formData.price) / formData.comparePrice) * 100), "% discount from compare price"] }))] }), !formData.hasVariants && (_jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Inventory" }), _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsxs("div", { children: [_jsx("label", { htmlFor: "sku", className: "block text-sm font-medium text-foreground", children: "SKU (Stock Keeping Unit)" }), _jsx("input", { id: "sku", name: "sku", type: "text", value: formData.sku || '', onChange: handleChange, placeholder: "e.g., SHIRT-001", className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "inventory", className: "block text-sm font-medium text-foreground", children: "Quantity" }), _jsx("input", { id: "inventory", name: "inventory", type: "number", min: "0", value: formData.inventory || 0, onChange: handleChange, className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" })] })] })] })), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-lg font-medium text-foreground", children: "Variants" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Add options like size or color to create product variants" })] }), _jsxs("label", { className: "relative inline-flex cursor-pointer items-center", children: [_jsx("input", { type: "checkbox", name: "hasVariants", checked: formData.hasVariants, onChange: handleChange, className: "peer sr-only" }), _jsx("div", { className: "peer h-6 w-11 rounded-full bg-muted after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white after:transition-all after:content-[''] peer-checked:bg-primary peer-checked:after:translate-x-full peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-primary/20" })] })] }), formData.hasVariants && (_jsx(VariantManager, { options: variantOptions, variants: variants, onOptionsChange: setVariantOptions, onVariantsChange: setVariants, basePrice: formData.price }))] }), _jsxs("div", { className: "rounded-lg border border-border bg-card", children: [_jsxs("button", { type: "button", onClick: () => setSeoExpanded(!seoExpanded), className: "flex w-full items-center justify-between p-6 text-left", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-lg font-medium text-foreground", children: "Search Engine Listing" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Customize how this product appears in search results" })] }), seoExpanded ? (_jsx(ChevronUp, { className: "h-5 w-5 text-muted-foreground" })) : (_jsx(ChevronDown, { className: "h-5 w-5 text-muted-foreground" }))] }), seoExpanded && (_jsxs("div", { className: "border-t border-border p-6 space-y-4", children: [_jsxs("div", { children: [_jsx("label", { htmlFor: "metaTitle", className: "block text-sm font-medium text-foreground", children: "Meta Title" }), _jsx("input", { id: "metaTitle", name: "metaTitle", type: "text", value: formData.metaTitle || '', onChange: handleChange, maxLength: 70, placeholder: formData.name || 'Product title', className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" }), _jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [(formData.metaTitle || '').length, "/70 characters"] })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "metaDescription", className: "block text-sm font-medium text-foreground", children: "Meta Description" }), _jsx("textarea", { id: "metaDescription", name: "metaDescription", value: formData.metaDescription || '', onChange: handleChange, maxLength: 160, rows: 3, placeholder: "Brief description for search engines...", className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary" }), _jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [(formData.metaDescription || '').length, "/160 characters"] })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: "Meta Keywords" }), _jsx(TagInput, { value: formData.metaKeywords || [], onChange: (tags) => setFormData((prev) => ({ ...prev, metaKeywords: tags })), placeholder: "Add keywords...", maxTags: 10 })] }), _jsx(SEOPreview, { title: formData.metaTitle || formData.name, description: formData.metaDescription || formData.description.slice(0, 160), slug: formData.slug || autoSlug, className: "mt-4" })] }))] })] }), _jsxs("div", { className: "space-y-6", children: [isEditMode && (_jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Status" }), _jsxs("div", { className: "space-y-3", children: [_jsxs("label", { className: "flex items-center gap-3 cursor-pointer", children: [_jsx("input", { type: "radio", name: "status", value: "draft", checked: formData.status === 'draft', onChange: handleChange, className: "h-4 w-4 text-primary focus:ring-primary" }), _jsxs("div", { children: [_jsx("span", { className: "text-sm font-medium text-foreground", children: "Draft" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Not visible to customers" })] })] }), _jsxs("label", { className: "flex items-center gap-3 cursor-pointer", children: [_jsx("input", { type: "radio", name: "status", value: "active", checked: formData.status === 'active', onChange: handleChange, className: "h-4 w-4 text-primary focus:ring-primary" }), _jsxs("div", { children: [_jsx("span", { className: "text-sm font-medium text-foreground", children: "Active" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Visible to customers" })] })] }), _jsxs("label", { className: "flex items-center gap-3 cursor-pointer", children: [_jsx("input", { type: "radio", name: "status", value: "archived", checked: formData.status === 'archived', onChange: handleChange, className: "h-4 w-4 text-primary focus:ring-primary" }), _jsxs("div", { children: [_jsx("span", { className: "text-sm font-medium text-foreground", children: "Archived" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Hidden and not for sale" })] })] })] })] })), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsx("h3", { className: "mb-4 text-lg font-medium text-foreground", children: "Organization" }), _jsx("div", { className: "space-y-4", children: _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: "Category" }), _jsx(CategorySelect, { value: formData.categoryId || null, onChange: (id) => setFormData((prev) => ({ ...prev, categoryId: id || undefined })), placeholder: "Select category", showAddNew: true, onAddNew: () => {
236
+ // Open category management in new tab
237
+ window.open('/admin/categories', '_blank');
238
+ } })] }) })] }), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6", children: [_jsxs("h3", { className: "mb-4 text-lg font-medium text-foreground flex items-center gap-2", children: [_jsx(Package, { className: "h-5 w-5" }), "Summary"] }), _jsxs("dl", { className: "space-y-2 text-sm", children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("dt", { className: "text-muted-foreground", children: "Price" }), _jsxs("dd", { className: "font-medium", children: ["$", formData.price.toFixed(2)] })] }), formData.hasVariants && variants.length > 0 && (_jsxs("div", { className: "flex justify-between", children: [_jsx("dt", { className: "text-muted-foreground", children: "Variants" }), _jsx("dd", { className: "font-medium", children: variants.length })] })), _jsxs("div", { className: "flex justify-between", children: [_jsx("dt", { className: "text-muted-foreground", children: "Images" }), _jsx("dd", { className: "font-medium", children: formData.images.length })] }), formData.hasVariants && variants.length > 0 && (_jsxs("div", { className: "flex justify-between", children: [_jsx("dt", { className: "text-muted-foreground", children: "Total Inventory" }), _jsx("dd", { className: "font-medium", children: variants.reduce((sum, v) => sum + v.inventory, 0) })] }))] })] }), _jsxs("div", { className: "rounded-lg border border-border bg-card p-6 lg:sticky lg:top-6", children: [_jsxs("div", { className: "space-y-3", children: [_jsx("button", { type: "submit", disabled: isLoading, className: "w-full rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50", children: isLoading ? 'Saving...' : isEditMode ? 'Save Changes' : 'Create Product' }), onCancel && (_jsx("button", { type: "button", onClick: onCancel, className: "w-full rounded-md border border-border px-4 py-2.5 text-sm font-medium text-foreground hover:bg-accent", children: "Cancel" }))] }), !isEditMode && (_jsx("p", { className: "mt-3 text-xs text-center text-muted-foreground", children: "Product will be saved as draft" }))] })] })] })] }));
123
239
  }
124
240
  //# sourceMappingURL=ProductForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductForm.js","sourceRoot":"","sources":["../../../src/admin/components/ProductForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAG5D,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,GAAG,EAAE,GACG;IACjB,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,gBAAgB,EAAE,CAAA;IACvE,MAAM,UAAU,GAAG,CAAC,CAAC,SAAS,CAAA;IAE9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAkB;QACxD,IAAI,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE;QAC7B,IAAI,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE;QAC7B,WAAW,EAAE,WAAW,EAAE,WAAW,IAAI,EAAE;QAC3C,KAAK,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;QAC9B,YAAY,EAAE,WAAW,EAAE,YAAY;QACvC,MAAM,EAAE,WAAW,EAAE,MAAM,IAAI,EAAE;QACjC,MAAM,EAAE,WAAW,EAAE,MAAM,IAAI,OAAO;QACtC,UAAU,EAAE,WAAW,EAAE,UAAU;QACnC,WAAW,EAAE,WAAW,EAAE,WAAW,IAAI,KAAK;QAC9C,SAAS,EAAE,WAAW,EAAE,SAAS;QACjC,eAAe,EA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AI,SAAS,EAAC,aAAa,YAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,GAAM,IAChF,CACP,IACE,IACD,EAGN,eAAK,SAAS,EAAC,gEAAgE,aAC7E,eAAK,SAAS,EAAC,WAAW,aACxB,iBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAC,8HAA8H,YAEvI,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,gBAAgB,GAClE,EACR,QAAQ,IAAI,CACX,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAC,wGAAwG,uBAG3G,CACV,IACG,EAEL,CAAC,UAAU,IAAI,CACd,YAAG,SAAS,EAAC,gDAAgD,+CAEzD,CACL,IACG,IACF,IACF,IACD,CACR,CAAA;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { RecentOrdersProps } from '../types';
2
2
  /**
3
- * Recent orders widget for dashboard.
3
+ * Recent orders widget for dashboard with elegant styling.
4
4
  *
5
5
  * @example
6
6
  * ```tsx
@@ -1 +1 @@
1
- {"version":3,"file":"RecentOrders.d.ts","sourceRoot":"","sources":["../../../src/admin/components/RecentOrders.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AA+BjD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAS,EACT,WAA6B,EAC7B,SAAc,GACf,EAAE,iBAAiB,2CAgGnB"}
1
+ {"version":3,"file":"RecentOrders.d.ts","sourceRoot":"","sources":["../../../src/admin/components/RecentOrders.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAgCjD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAS,EACT,WAA6B,EAC7B,SAAc,GACf,EAAE,iBAAiB,2CAgHnB"}
@@ -3,28 +3,29 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  /**
4
4
  * @rovela/sdk/admin/components/RecentOrders
5
5
  *
6
- * Recent orders table for dashboard.
6
+ * Recent orders table for dashboard with theme-aware styling.
7
7
  */
8
8
  import { useAdminStats } from '../hooks/useAdminStats';
9
9
  // =============================================================================
10
10
  // Status Badge
11
11
  // =============================================================================
12
12
  function StatusBadge({ status }) {
13
+ // Theme-aware status styles using CSS variables
13
14
  const statusStyles = {
14
- pending: 'bg-yellow-100 text-yellow-800',
15
- paid: 'bg-green-100 text-green-800',
16
- shipped: 'bg-blue-100 text-blue-800',
17
- delivered: 'bg-green-100 text-green-800',
18
- cancelled: 'bg-red-100 text-red-800',
19
- refunded: 'bg-gray-100 text-gray-800',
15
+ pending: 'bg-amber-500/10 text-amber-600 dark:text-amber-400',
16
+ paid: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400',
17
+ shipped: 'bg-blue-500/10 text-blue-600 dark:text-blue-400',
18
+ delivered: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400',
19
+ cancelled: 'bg-red-500/10 text-red-600 dark:text-red-400',
20
+ refunded: 'bg-muted text-muted-foreground',
20
21
  };
21
- return (_jsx("span", { className: `inline-flex rounded-full px-2 py-1 text-xs font-medium ${statusStyles[status] || 'bg-gray-100 text-gray-800'}`, children: status.charAt(0).toUpperCase() + status.slice(1) }));
22
+ return (_jsx("span", { className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${statusStyles[status] || 'bg-muted text-muted-foreground'}`, children: status.charAt(0).toUpperCase() + status.slice(1) }));
22
23
  }
23
24
  // =============================================================================
24
25
  // Component
25
26
  // =============================================================================
26
27
  /**
27
- * Recent orders widget for dashboard.
28
+ * Recent orders widget for dashboard with elegant styling.
28
29
  *
29
30
  * @example
30
31
  * ```tsx
@@ -50,6 +51,6 @@ export function RecentOrders({ limit = 5, viewAllHref = '/admin/orders', classNa
50
51
  currency: 'USD',
51
52
  }).format(parseFloat(value));
52
53
  };
53
- return (_jsxs("div", { className: `rounded-lg border border-border bg-card ${className}`, children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-6 py-4", children: [_jsx("h3", { className: "text-lg font-medium text-foreground", children: "Recent Orders" }), _jsx("a", { href: viewAllHref, className: "text-sm text-primary hover:underline", children: "View all" })] }), _jsx("div", { className: "overflow-x-auto", children: isLoading ? (_jsx("div", { className: "p-6", children: _jsx("div", { className: "space-y-4", children: [...Array(limit)].map((_, i) => (_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-4 w-32 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-4 w-16 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" })] }, i))) }) })) : recentOrders.length === 0 ? (_jsx("div", { className: "py-12 text-center", children: _jsx("p", { className: "text-muted-foreground", children: "No orders yet" }) })) : (_jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-border bg-muted/50 text-left text-xs font-medium uppercase text-muted-foreground", children: [_jsx("th", { className: "px-6 py-3", children: "Order" }), _jsx("th", { className: "px-6 py-3", children: "Customer" }), _jsx("th", { className: "px-6 py-3", children: "Status" }), _jsx("th", { className: "px-6 py-3", children: "Total" }), _jsx("th", { className: "px-6 py-3", children: "Date" })] }) }), _jsx("tbody", { className: "divide-y divide-border", children: recentOrders.map((order) => (_jsxs("tr", { className: "hover:bg-muted/50", children: [_jsx("td", { className: "whitespace-nowrap px-6 py-4", children: _jsxs("a", { href: `/admin/orders/${order.id}`, className: "font-medium text-primary hover:underline", children: ["#", order.id.slice(-8).toUpperCase()] }) }), _jsx("td", { className: "whitespace-nowrap px-6 py-4 text-sm text-foreground", children: order.email }), _jsx("td", { className: "whitespace-nowrap px-6 py-4", children: _jsx(StatusBadge, { status: order.status }) }), _jsx("td", { className: "whitespace-nowrap px-6 py-4 text-sm font-medium text-foreground", children: formatCurrency(order.total) }), _jsx("td", { className: "whitespace-nowrap px-6 py-4 text-sm text-muted-foreground", children: formatDate(order.createdAt) })] }, order.id))) })] })) })] }));
54
+ return (_jsxs("div", { className: `rounded-xl border border-border bg-card ${className}`, children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-6 py-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-lg font-semibold text-foreground", children: "Recent Orders" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Latest customer orders" })] }), _jsxs("a", { href: viewAllHref, className: "inline-flex items-center gap-1 text-sm font-medium text-primary transition-colors hover:text-primary/80", children: ["View all", _jsx("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })] })] }), _jsx("div", { className: "overflow-x-auto", children: isLoading ? (_jsx("div", { className: "p-6", children: _jsx("div", { className: "space-y-4", children: [...Array(limit)].map((_, i) => (_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-4 w-32 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-4 w-16 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" })] }, i))) }) })) : recentOrders.length === 0 ? (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [_jsx("svg", { className: "h-12 w-12 text-muted-foreground/30", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1, children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007zM8.625 10.5a.375.375 0 11-.75 0 .375.375 0 01.75 0zm7.5 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z" }) }), _jsx("p", { className: "mt-4 text-sm text-muted-foreground", children: "No orders yet" }), _jsx("p", { className: "text-xs text-muted-foreground/70", children: "Orders will appear here as they come in" })] })) : (_jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-border text-left text-xs font-medium uppercase tracking-wider text-muted-foreground", children: [_jsx("th", { className: "px-6 py-3", children: "Order" }), _jsx("th", { className: "px-6 py-3", children: "Customer" }), _jsx("th", { className: "px-6 py-3", children: "Status" }), _jsx("th", { className: "px-6 py-3 text-right", children: "Total" }), _jsx("th", { className: "px-6 py-3 text-right", children: "Date" })] }) }), _jsx("tbody", { className: "divide-y divide-border", children: recentOrders.map((order) => (_jsxs("tr", { className: "group transition-colors hover:bg-muted/50", children: [_jsx("td", { className: "whitespace-nowrap px-6 py-4", children: _jsxs("a", { href: `/admin/orders/${order.id}`, className: "font-medium text-primary transition-colors hover:text-primary/80", children: ["#", order.id.slice(-8).toUpperCase()] }) }), _jsx("td", { className: "whitespace-nowrap px-6 py-4 text-sm text-foreground", children: order.email }), _jsx("td", { className: "whitespace-nowrap px-6 py-4", children: _jsx(StatusBadge, { status: order.status }) }), _jsx("td", { className: "whitespace-nowrap px-6 py-4 text-right text-sm font-medium text-foreground", children: formatCurrency(order.total) }), _jsx("td", { className: "whitespace-nowrap px-6 py-4 text-right text-sm text-muted-foreground", children: formatDate(order.createdAt) })] }, order.id))) })] })) })] }));
54
55
  }
55
56
  //# sourceMappingURL=RecentOrders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RecentOrders.js","sourceRoot":"","sources":["../../../src/admin/components/RecentOrders.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;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AO,SAAS,EAAC,wBAAwB,YACtC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC3B,cAAmB,SAAS,EAAC,mBAAmB,aAC9C,aAAI,SAAS,EAAC,6BAA6B,YACzC,aACE,IAAI,EAAE,iBAAiB,KAAK,CAAC,EAAE,EAAE,EACjC,SAAS,EAAC,0CAA0C,kBAElD,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,IAChC,GACD,EACL,aAAI,SAAS,EAAC,qDAAqD,YAChE,KAAK,CAAC,KAAK,GACT,EACL,aAAI,SAAS,EAAC,6BAA6B,YACzC,KAAC,WAAW,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAI,GAClC,EACL,aAAI,SAAS,EAAC,iEAAiE,YAC5E,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,GACzB,EACL,aAAI,SAAS,EAAC,2DAA2D,YACtE,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,GACzB,KApBE,KAAK,CAAC,EAAE,CAqBZ,CACN,CAAC,GACI,IACF,CACT,GACG,IACF,CACP,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"RecentOrders.js","sourceRoot":"","sources":["../../../src/admin/components/RecentOrders.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAGtD,gFAAgF;AAChF,eAAe;AACf,gFAAgF;AAEhF,SAAS,WAAW,CAAC,EAAE,MAAM,EAAsB;IACjD,gDAAgD;IAChD,MAAM,YAAY,GAA2B;QAC3C,OAAO,EAAE,oDAAoD;QAC7D,IAAI,EAAE,0DAA0D;QAChE,OAAO,EAAE,iDAAiD;QAC1D,SAAS,EAAE,0DAA0D;QACrE,SAAS,EAAE,8CAA8C;QACzD,QAAQ,EAAE,gCAAgC;KAC3C,CAAA;IAED,OAAO,CACL,eACE,SAAS,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AAI,SAAS,EAAC,WAAW,yBAAc,EACvC,aAAI,SAAS,EAAC,WAAW,uBAAY,EACrC,aAAI,SAAS,EAAC,sBAAsB,sBAAW,EAC/C,aAAI,SAAS,EAAC,sBAAsB,qBAAU,IAC3C,GACC,EACR,gBAAO,SAAS,EAAC,wBAAwB,YACtC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC3B,cAAmB,SAAS,EAAC,2CAA2C,aACtE,aAAI,SAAS,EAAC,6BAA6B,YACzC,aACE,IAAI,EAAE,iBAAiB,KAAK,CAAC,EAAE,EAAE,EACjC,SAAS,EAAC,kEAAkE,kBAE1E,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,IAChC,GACD,EACL,aAAI,SAAS,EAAC,qDAAqD,YAChE,KAAK,CAAC,KAAK,GACT,EACL,aAAI,SAAS,EAAC,6BAA6B,YACzC,KAAC,WAAW,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAI,GAClC,EACL,aAAI,SAAS,EAAC,4EAA4E,YACvF,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,GACzB,EACL,aAAI,SAAS,EAAC,sEAAsE,YACjF,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,GACzB,KApBE,KAAK,CAAC,EAAE,CAqBZ,CACN,CAAC,GACI,IACF,CACT,GACG,IACF,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface RevenueChartProps {
2
+ /** Revenue data by day */
3
+ data: {
4
+ date: string;
5
+ revenue: number;
6
+ }[];
7
+ /** Loading state */
8
+ isLoading?: boolean;
9
+ /** Currency code for formatting */
10
+ currency?: string;
11
+ /** Custom className */
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Revenue chart showing last 30 days of revenue data.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <RevenueChart data={revenueByDay} isLoading={isLoading} />
20
+ * ```
21
+ */
22
+ export declare function RevenueChart({ data, isLoading, currency, className, }: RevenueChartProps): import("react/jsx-runtime").JSX.Element;
23
+ //# sourceMappingURL=RevenueChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RevenueChart.d.ts","sourceRoot":"","sources":["../../../src/admin/components/RevenueChart.tsx"],"names":[],"mappings":"AAsBA,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACzC,oBAAoB;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AA+CD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,SAAiB,EACjB,QAAgB,EAChB,SAAc,GACf,EAAE,iBAAiB,2CAiHnB"}
@@ -0,0 +1,70 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * @rovela/sdk/admin/components/RevenueChart
5
+ *
6
+ * 30-day revenue line chart for dashboard.
7
+ */
8
+ import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, } from 'recharts';
9
+ function CustomTooltip({ active, payload, label, currency }) {
10
+ if (!active || !payload || !payload.length)
11
+ return null;
12
+ const formatCurrency = (value) => {
13
+ return new Intl.NumberFormat('en-US', {
14
+ style: 'currency',
15
+ currency,
16
+ minimumFractionDigits: 0,
17
+ maximumFractionDigits: 0,
18
+ }).format(value);
19
+ };
20
+ const formatDate = (dateStr) => {
21
+ const date = new Date(dateStr);
22
+ return date.toLocaleDateString('en-US', {
23
+ month: 'short',
24
+ day: 'numeric',
25
+ });
26
+ };
27
+ return (_jsxs("div", { className: "rounded-lg border border-border bg-card px-3 py-2 shadow-lg", children: [_jsx("p", { className: "text-xs text-muted-foreground", children: label ? formatDate(label) : '' }), _jsx("p", { className: "text-sm font-semibold text-foreground", children: formatCurrency(payload[0].value) })] }));
28
+ }
29
+ // =============================================================================
30
+ // Component
31
+ // =============================================================================
32
+ /**
33
+ * Revenue chart showing last 30 days of revenue data.
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * <RevenueChart data={revenueByDay} isLoading={isLoading} />
38
+ * ```
39
+ */
40
+ export function RevenueChart({ data, isLoading = false, currency = 'USD', className = '', }) {
41
+ const formatCurrency = (value) => {
42
+ return new Intl.NumberFormat('en-US', {
43
+ style: 'currency',
44
+ currency,
45
+ notation: 'compact',
46
+ minimumFractionDigits: 0,
47
+ maximumFractionDigits: 1,
48
+ }).format(value);
49
+ };
50
+ const formatXAxis = (dateStr) => {
51
+ const date = new Date(dateStr);
52
+ return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
53
+ };
54
+ // Calculate total revenue
55
+ const totalRevenue = data.reduce((sum, item) => sum + item.revenue, 0);
56
+ // Show only every 5th label on x-axis to avoid crowding
57
+ const tickFormatter = (value, index) => {
58
+ if (index % 5 === 0 || index === data.length - 1) {
59
+ return formatXAxis(value);
60
+ }
61
+ return '';
62
+ };
63
+ return (_jsxs("div", { className: `rounded-xl border border-border bg-card ${className}`, children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-6 py-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-lg font-semibold text-foreground", children: "Revenue" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Last 30 days" })] }), !isLoading && (_jsxs("div", { className: "text-right", children: [_jsx("p", { className: "text-2xl font-bold text-foreground", children: new Intl.NumberFormat('en-US', {
64
+ style: 'currency',
65
+ currency,
66
+ minimumFractionDigits: 0,
67
+ maximumFractionDigits: 0,
68
+ }).format(totalRevenue) }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Total" })] }))] }), _jsx("div", { className: "p-6", children: isLoading ? (_jsx("div", { className: "flex h-64 items-center justify-center", children: _jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" }) })) : data.length === 0 ? (_jsxs("div", { className: "flex h-64 flex-col items-center justify-center text-center", children: [_jsx("svg", { className: "h-12 w-12 text-muted-foreground/30", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1, children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z" }) }), _jsx("p", { className: "mt-4 text-sm text-muted-foreground", children: "No revenue data yet" }), _jsx("p", { className: "text-xs text-muted-foreground/70", children: "Revenue will appear here after your first sale" })] })) : (_jsx(ResponsiveContainer, { width: "100%", height: 256, children: _jsxs(AreaChart, { data: data, margin: { top: 10, right: 10, left: 0, bottom: 0 }, children: [_jsx("defs", { children: _jsxs("linearGradient", { id: "revenueGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "0%", stopColor: "hsl(var(--primary))", stopOpacity: 0.3 }), _jsx("stop", { offset: "100%", stopColor: "hsl(var(--primary))", stopOpacity: 0 })] }) }), _jsx(CartesianGrid, { strokeDasharray: "3 3", vertical: false, stroke: "hsl(var(--border))" }), _jsx(XAxis, { dataKey: "date", tickFormatter: tickFormatter, axisLine: false, tickLine: false, tick: { fill: 'hsl(var(--muted-foreground))', fontSize: 12 }, dy: 10 }), _jsx(YAxis, { tickFormatter: formatCurrency, axisLine: false, tickLine: false, tick: { fill: 'hsl(var(--muted-foreground))', fontSize: 12 }, width: 60 }), _jsx(Tooltip, { content: _jsx(CustomTooltip, { currency: currency }) }), _jsx(Area, { type: "monotone", dataKey: "revenue", stroke: "hsl(var(--primary))", strokeWidth: 2, fill: "url(#revenueGradient)" })] }) })) })] }));
69
+ }
70
+ //# sourceMappingURL=RevenueChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RevenueChart.js","sourceRoot":"","sources":["../../../src/admin/components/RevenueChart.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;GAIG;AAEH,OAAO,EACL,IAAI,EACJ,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,OAAO,EACP,KAAK,EACL,KAAK,GACN,MAAM,UAAU,CAAA;AA4BjB,SAAS,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAgB;IACvE,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAEvD,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE;QACvC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;YACpC,KAAK,EAAE,UAAU;YACjB,QAAQ;YACR,qBAAqB,EAAE,CAAC;YACxB,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAClB,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA;QAC9B,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;YACtC,KAAK,EAAE,OAAO;YACd,GAAG,EAAE,SAAS;SACf,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO,CACL,eAAK,SAAS,EAAC,6DAA6D,aAC1E,YAAG,SAAS,EAAC,+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AAW,EAAE,CAAC,EACd,IAAI,EAAC,uBAAuB,GAC5B,IACQ,GACQ,CACvB,GACG,IACF,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @rovela/sdk/admin/components/SEOPreview
3
+ *
4
+ * Google search result preview for SEO fields.
5
+ */
6
+ export interface SEOPreviewProps {
7
+ /** Page title */
8
+ title: string;
9
+ /** Meta description */
10
+ description: string;
11
+ /** URL slug */
12
+ slug: string;
13
+ /** Base URL for preview */
14
+ baseUrl?: string;
15
+ /** Additional CSS classes */
16
+ className?: string;
17
+ }
18
+ /**
19
+ * Preview of how the page will appear in Google search results.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <SEOPreview
24
+ * title={metaTitle || productName}
25
+ * description={metaDescription || productDescription}
26
+ * slug={productSlug}
27
+ * baseUrl="https://mystore.com/products"
28
+ * />
29
+ * ```
30
+ */
31
+ export declare function SEOPreview({ title, description, slug, baseUrl, className, }: SEOPreviewProps): import("react/jsx-runtime").JSX.Element;
32
+ //# sourceMappingURL=SEOPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SEOPreview.d.ts","sourceRoot":"","sources":["../../../src/admin/components/SEOPreview.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAMH,MAAM,WAAW,eAAe;IAC9B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAA0C,EAC1C,SAAc,GACf,EAAE,eAAe,2CA6DjB"}
@@ -0,0 +1,30 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // =============================================================================
4
+ // Component
5
+ // =============================================================================
6
+ /**
7
+ * Preview of how the page will appear in Google search results.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <SEOPreview
12
+ * title={metaTitle || productName}
13
+ * description={metaDescription || productDescription}
14
+ * slug={productSlug}
15
+ * baseUrl="https://mystore.com/products"
16
+ * />
17
+ * ```
18
+ */
19
+ export function SEOPreview({ title, description, slug, baseUrl = 'https://yourstore.com/products', className = '', }) {
20
+ // Truncate title to ~60 characters (Google displays ~50-60)
21
+ const displayTitle = title.length > 60 ? `${title.slice(0, 57)}...` : title;
22
+ // Truncate description to ~155 characters (Google displays ~150-160)
23
+ const displayDescription = description.length > 155
24
+ ? `${description.slice(0, 152)}...`
25
+ : description;
26
+ // Build URL
27
+ const displayUrl = `${baseUrl}/${slug || 'product-name'}`;
28
+ return (_jsxs("div", { className: `rounded-lg border border-border bg-card p-4 ${className}`, children: [_jsx("p", { className: "mb-3 text-xs font-medium uppercase tracking-wider text-muted-foreground", children: "Search Engine Preview" }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2 text-sm", children: [_jsx("div", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-muted", children: _jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "S" }) }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-xs text-muted-foreground", children: "Your Store" }), _jsx("span", { className: "text-xs text-muted-foreground truncate max-w-[300px]", children: displayUrl })] })] }), _jsx("h3", { className: "text-lg font-normal text-[#1a0dab] hover:underline cursor-pointer leading-snug", children: displayTitle || 'Product Title' }), _jsx("p", { className: "text-sm text-[#545454] leading-relaxed", children: displayDescription || 'Add a meta description to help search engines understand what this product is about and to entice users to click.' })] }), _jsxs("div", { className: "mt-4 flex gap-6 border-t border-border pt-3", children: [_jsxs("div", { className: "text-xs", children: [_jsx("span", { className: "text-muted-foreground", children: "Title: " }), _jsxs("span", { className: title.length > 60 ? 'text-destructive' : 'text-foreground', children: [title.length, "/60"] })] }), _jsxs("div", { className: "text-xs", children: [_jsx("span", { className: "text-muted-foreground", children: "Description: " }), _jsxs("span", { className: description.length > 160 ? 'text-destructive' : 'text-foreground', children: [description.length, "/160"] })] })] })] }));
29
+ }
30
+ //# sourceMappingURL=SEOPreview.js.map