@profplum700/etsy-admin-ui 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,392 @@
1
+ # @profplum700/etsy-admin-ui
2
+
3
+ Pre-built admin dashboard components for the Etsy v3 API. Build beautiful admin interfaces in minutes.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @profplum700/etsy-admin-ui @profplum700/etsy-react @profplum700/etsy-v3-api-client
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - Pre-built dashboard components
14
+ - Responsive design
15
+ - TypeScript support
16
+ - Customizable styling
17
+ - Dark mode ready
18
+ - Zero dependencies (besides peer deps)
19
+
20
+ ## Quick Start
21
+
22
+ ```tsx
23
+ import React from 'react';
24
+ import { EtsyProvider } from '@profplum700/etsy-react';
25
+ import { EtsyClient } from '@profplum700/etsy-v3-api-client';
26
+ import {
27
+ Layout,
28
+ ShopDashboard,
29
+ ListingManager,
30
+ OrderFulfillment,
31
+ InventoryTracker,
32
+ } from '@profplum700/etsy-admin-ui';
33
+
34
+ // Import default styles (optional)
35
+ import '@profplum700/etsy-admin-ui/dist/styles/default.css';
36
+
37
+ const client = new EtsyClient({
38
+ apiKey: process.env.ETSY_API_KEY,
39
+ });
40
+
41
+ function App() {
42
+ return (
43
+ <EtsyProvider client={client}>
44
+ <Layout
45
+ header={<h1>My Shop Admin</h1>}
46
+ sidebar={
47
+ <nav>
48
+ <a href="#dashboard">Dashboard</a>
49
+ <a href="#listings">Listings</a>
50
+ <a href="#orders">Orders</a>
51
+ <a href="#inventory">Inventory</a>
52
+ </nav>
53
+ }
54
+ >
55
+ <ShopDashboard shopId="123" />
56
+ <ListingManager shopId="123" />
57
+ <OrderFulfillment shopId="123" />
58
+ <InventoryTracker shopId="123" />
59
+ </Layout>
60
+ </EtsyProvider>
61
+ );
62
+ }
63
+ ```
64
+
65
+ ## Components
66
+
67
+ ### `<Layout>`
68
+
69
+ Main layout container with header, sidebar, and footer support.
70
+
71
+ ```tsx
72
+ <Layout
73
+ header={<Header title="Shop Admin" />}
74
+ sidebar={<Sidebar>{/* sidebar content */}</Sidebar>}
75
+ footer={<footer>© 2025 My Shop</footer>}
76
+ >
77
+ {/* main content */}
78
+ </Layout>
79
+ ```
80
+
81
+ **Props:**
82
+ - `children` - Main content
83
+ - `header` - Header content
84
+ - `sidebar` - Sidebar content
85
+ - `footer` - Footer content
86
+ - `className` - Additional CSS classes
87
+
88
+ ### `<ShopDashboard>`
89
+
90
+ Display shop overview with key statistics.
91
+
92
+ ```tsx
93
+ <ShopDashboard
94
+ shopId="123"
95
+ onError={(error) => console.error(error)}
96
+ />
97
+ ```
98
+
99
+ **Props:**
100
+ - `shopId` (required) - The shop ID
101
+ - `className` - Additional CSS classes
102
+ - `onError` - Error callback
103
+
104
+ **Features:**
105
+ - Shop title and name
106
+ - Active listings count
107
+ - Currency information
108
+ - Shop status (open/vacation)
109
+ - Shop announcement
110
+ - Links to shop URL
111
+
112
+ ### `<ListingManager>`
113
+
114
+ Manage shop listings with filtering and actions.
115
+
116
+ ```tsx
117
+ <ListingManager
118
+ shopId="123"
119
+ onListingUpdate={(listing) => console.log('Updated:', listing)}
120
+ onListingDelete={(id) => console.log('Deleted:', id)}
121
+ />
122
+ ```
123
+
124
+ **Props:**
125
+ - `shopId` (required) - The shop ID
126
+ - `className` - Additional CSS classes
127
+ - `onListingUpdate` - Callback when a listing is updated
128
+ - `onListingDelete` - Callback when a listing is deleted
129
+
130
+ **Features:**
131
+ - Filter by state (active, inactive, draft, expired)
132
+ - Grid view with images
133
+ - Quick activate/deactivate
134
+ - Delete listings
135
+ - Load more pagination
136
+ - Price and quantity display
137
+
138
+ ### `<OrderFulfillment>`
139
+
140
+ Track and manage orders with fulfillment actions.
141
+
142
+ ```tsx
143
+ <OrderFulfillment
144
+ shopId="123"
145
+ onOrderUpdate={(receipt) => console.log('Updated:', receipt)}
146
+ />
147
+ ```
148
+
149
+ **Props:**
150
+ - `shopId` (required) - The shop ID
151
+ - `className` - Additional CSS classes
152
+ - `onOrderUpdate` - Callback when an order is updated
153
+
154
+ **Features:**
155
+ - Filter by status (all, unpaid, unshipped)
156
+ - Order details display
157
+ - Buyer information
158
+ - Payment and shipping status
159
+ - Mark as paid/shipped actions
160
+ - Buyer messages
161
+ - Load more pagination
162
+
163
+ ### `<InventoryTracker>`
164
+
165
+ Monitor inventory levels with low stock alerts.
166
+
167
+ ```tsx
168
+ <InventoryTracker
169
+ shopId="123"
170
+ lowStockThreshold={5}
171
+ />
172
+ ```
173
+
174
+ **Props:**
175
+ - `shopId` (required) - The shop ID
176
+ - `className` - Additional CSS classes
177
+ - `lowStockThreshold` - Threshold for low stock warning (default: 5)
178
+
179
+ **Features:**
180
+ - Total inventory count
181
+ - In stock, low stock, and out of stock counts
182
+ - Low stock warnings
183
+ - Out of stock alerts
184
+ - Quick overview of inventory status
185
+
186
+ ### Layout Components
187
+
188
+ #### `<Header>`
189
+
190
+ Pre-styled header component.
191
+
192
+ ```tsx
193
+ <Header title="Shop Admin">
194
+ <button>Settings</button>
195
+ </Header>
196
+ ```
197
+
198
+ #### `<Sidebar>`
199
+
200
+ Sidebar container with navigation items.
201
+
202
+ ```tsx
203
+ <Sidebar>
204
+ <SidebarItem label="Dashboard" active />
205
+ <SidebarItem label="Listings" onClick={() => navigate('/listings')} />
206
+ <SidebarItem label="Orders" href="/orders" />
207
+ </Sidebar>
208
+ ```
209
+
210
+ #### `<SidebarItem>`
211
+
212
+ Individual sidebar navigation item.
213
+
214
+ ```tsx
215
+ <SidebarItem
216
+ label="Dashboard"
217
+ icon={<DashboardIcon />}
218
+ active={true}
219
+ onClick={() => {}}
220
+ href="/dashboard"
221
+ />
222
+ ```
223
+
224
+ ## Styling
225
+
226
+ ### Using Default Styles
227
+
228
+ Import the default stylesheet:
229
+
230
+ ```tsx
231
+ import '@profplum700/etsy-admin-ui/dist/styles/default.css';
232
+ ```
233
+
234
+ ### Custom Styling
235
+
236
+ All components use CSS classes with the `etsy-` prefix. You can override them:
237
+
238
+ ```css
239
+ .etsy-shop-dashboard {
240
+ background: #f5f5f5;
241
+ border-radius: 8px;
242
+ }
243
+
244
+ .etsy-btn {
245
+ background: #your-brand-color;
246
+ }
247
+
248
+ .etsy-stat-card {
249
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
250
+ }
251
+ ```
252
+
253
+ ### CSS Variables
254
+
255
+ Customize the color scheme using CSS variables:
256
+
257
+ ```css
258
+ :root {
259
+ --etsy-primary: #f56400;
260
+ --etsy-secondary: #222222;
261
+ --etsy-success: #00a651;
262
+ --etsy-warning: #f9a825;
263
+ --etsy-danger: #d32f2f;
264
+ --etsy-info: #2196f3;
265
+ }
266
+ ```
267
+
268
+ ### Dark Mode
269
+
270
+ Add dark mode support:
271
+
272
+ ```css
273
+ [data-theme="dark"] {
274
+ --etsy-bg: #1a1a1a;
275
+ --etsy-bg-secondary: #2a2a2a;
276
+ --etsy-text: #ffffff;
277
+ --etsy-text-secondary: #b0b0b0;
278
+ --etsy-border: #404040;
279
+ }
280
+ ```
281
+
282
+ ## Complete Example
283
+
284
+ ```tsx
285
+ import React, { useState } from 'react';
286
+ import { EtsyProvider } from '@profplum700/etsy-react';
287
+ import { EtsyClient } from '@profplum700/etsy-v3-api-client';
288
+ import {
289
+ Layout,
290
+ Header,
291
+ Sidebar,
292
+ SidebarItem,
293
+ ShopDashboard,
294
+ ListingManager,
295
+ OrderFulfillment,
296
+ InventoryTracker,
297
+ } from '@profplum700/etsy-admin-ui';
298
+ import '@profplum700/etsy-admin-ui/dist/styles/default.css';
299
+
300
+ const client = new EtsyClient({
301
+ apiKey: process.env.ETSY_API_KEY,
302
+ });
303
+
304
+ function AdminApp() {
305
+ const [activeView, setActiveView] = useState('dashboard');
306
+ const shopId = 'YOUR_SHOP_ID';
307
+
308
+ return (
309
+ <EtsyProvider client={client}>
310
+ <Layout
311
+ header={
312
+ <Header title="Shop Admin Dashboard">
313
+ <button onClick={() => console.log('Settings')}>Settings</button>
314
+ </Header>
315
+ }
316
+ sidebar={
317
+ <Sidebar>
318
+ <SidebarItem
319
+ label="Dashboard"
320
+ active={activeView === 'dashboard'}
321
+ onClick={() => setActiveView('dashboard')}
322
+ />
323
+ <SidebarItem
324
+ label="Listings"
325
+ active={activeView === 'listings'}
326
+ onClick={() => setActiveView('listings')}
327
+ />
328
+ <SidebarItem
329
+ label="Orders"
330
+ active={activeView === 'orders'}
331
+ onClick={() => setActiveView('orders')}
332
+ />
333
+ <SidebarItem
334
+ label="Inventory"
335
+ active={activeView === 'inventory'}
336
+ onClick={() => setActiveView('inventory')}
337
+ />
338
+ </Sidebar>
339
+ }
340
+ >
341
+ {activeView === 'dashboard' && <ShopDashboard shopId={shopId} />}
342
+ {activeView === 'listings' && <ListingManager shopId={shopId} />}
343
+ {activeView === 'orders' && <OrderFulfillment shopId={shopId} />}
344
+ {activeView === 'inventory' && <InventoryTracker shopId={shopId} />}
345
+ </Layout>
346
+ </EtsyProvider>
347
+ );
348
+ }
349
+
350
+ export default AdminApp;
351
+ ```
352
+
353
+ ## TypeScript Support
354
+
355
+ All components are fully typed with TypeScript.
356
+
357
+ ```typescript
358
+ import type {
359
+ ShopDashboardProps,
360
+ ListingManagerProps,
361
+ OrderFulfillmentProps,
362
+ InventoryTrackerProps,
363
+ LayoutProps,
364
+ HeaderProps,
365
+ SidebarProps,
366
+ SidebarItemProps,
367
+ } from '@profplum700/etsy-admin-ui';
368
+ ```
369
+
370
+ ## Responsive Design
371
+
372
+ All components are mobile-responsive and adapt to different screen sizes automatically.
373
+
374
+ ## Browser Support
375
+
376
+ - Modern browsers (Chrome, Firefox, Safari, Edge)
377
+ - Mobile browsers (iOS Safari, Chrome Mobile)
378
+
379
+ ## License
380
+
381
+ MIT
382
+
383
+ ## Related Packages
384
+
385
+ - [@profplum700/etsy-v3-api-client](../etsy-v3-api-client) - Core API client
386
+ - [@profplum700/etsy-react](../etsy-react) - React hooks
387
+ - [@profplum700/etsy-nextjs](../etsy-nextjs) - Next.js integration
388
+ - [@profplum700/etsy-cli](../etsy-cli) - CLI tool
389
+
390
+ ## Contributing
391
+
392
+ Contributions are welcome! Please see the main repository for guidelines.