@instockng/storefront-ui 1.0.0
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 +394 -0
- package/dist/components/CartItem.d.ts +15 -0
- package/dist/components/CartItem.d.ts.map +1 -0
- package/dist/components/Checkout.d.ts +39 -0
- package/dist/components/Checkout.d.ts.map +1 -0
- package/dist/components/DiscountCodeInput.d.ts +20 -0
- package/dist/components/DiscountCodeInput.d.ts.map +1 -0
- package/dist/components/OrderConfirmation.d.ts +30 -0
- package/dist/components/OrderConfirmation.d.ts.map +1 -0
- package/dist/components/ProductCard.d.ts +42 -0
- package/dist/components/ProductCard.d.ts.map +1 -0
- package/dist/components/ProductGrid.d.ts +33 -0
- package/dist/components/ProductGrid.d.ts.map +1 -0
- package/dist/components/ShoppingCart.d.ts +28 -0
- package/dist/components/ShoppingCart.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/form-input.d.ts +20 -0
- package/dist/components/ui/form-input.d.ts.map +1 -0
- package/dist/components/ui/form-select.d.ts +18 -0
- package/dist/components/ui/form-select.d.ts.map +1 -0
- package/dist/components/ui/modal.d.ts +31 -0
- package/dist/components/ui/modal.d.ts.map +1 -0
- package/dist/contexts/CartContext.d.ts +60 -0
- package/dist/contexts/CartContext.d.ts.map +1 -0
- package/dist/hooks/usePaystackPayment.d.ts +46 -0
- package/dist/hooks/usePaystackPayment.d.ts.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +99 -0
- package/dist/index10.mjs +644 -0
- package/dist/index100.mjs +7 -0
- package/dist/index101.mjs +35 -0
- package/dist/index102.mjs +33 -0
- package/dist/index103.mjs +30 -0
- package/dist/index104.mjs +63 -0
- package/dist/index105.mjs +5 -0
- package/dist/index106.mjs +4 -0
- package/dist/index107.mjs +4 -0
- package/dist/index108.mjs +19 -0
- package/dist/index109.mjs +15 -0
- package/dist/index11.mjs +62 -0
- package/dist/index110.mjs +8 -0
- package/dist/index111.mjs +32 -0
- package/dist/index12.mjs +64 -0
- package/dist/index13.mjs +26 -0
- package/dist/index14.mjs +117 -0
- package/dist/index15.mjs +44 -0
- package/dist/index16.mjs +44 -0
- package/dist/index17.mjs +44 -0
- package/dist/index18.mjs +43 -0
- package/dist/index19.mjs +11 -0
- package/dist/index2.mjs +24 -0
- package/dist/index20.mjs +29 -0
- package/dist/index21.mjs +34 -0
- package/dist/index22.mjs +22 -0
- package/dist/index23.mjs +90 -0
- package/dist/index24.mjs +22 -0
- package/dist/index25.mjs +13 -0
- package/dist/index26.mjs +99 -0
- package/dist/index27.mjs +20 -0
- package/dist/index28.mjs +67 -0
- package/dist/index29.mjs +98 -0
- package/dist/index3.mjs +121 -0
- package/dist/index30.mjs +21 -0
- package/dist/index31.mjs +21 -0
- package/dist/index32.mjs +13 -0
- package/dist/index33.mjs +6 -0
- package/dist/index34.mjs +1435 -0
- package/dist/index35.mjs +4 -0
- package/dist/index36.mjs +59 -0
- package/dist/index37.mjs +53 -0
- package/dist/index38.mjs +35 -0
- package/dist/index39.mjs +17 -0
- package/dist/index4.mjs +201 -0
- package/dist/index40.mjs +2265 -0
- package/dist/index41.mjs +25 -0
- package/dist/index42.mjs +38 -0
- package/dist/index43.mjs +46 -0
- package/dist/index44.mjs +101 -0
- package/dist/index45.mjs +114 -0
- package/dist/index46.mjs +78 -0
- package/dist/index47.mjs +89 -0
- package/dist/index48.mjs +106 -0
- package/dist/index49.mjs +87 -0
- package/dist/index5.mjs +112 -0
- package/dist/index50.mjs +76 -0
- package/dist/index51.mjs +20 -0
- package/dist/index52.mjs +19 -0
- package/dist/index53.mjs +64 -0
- package/dist/index54.mjs +131 -0
- package/dist/index55.mjs +135 -0
- package/dist/index56.mjs +77 -0
- package/dist/index57.mjs +17 -0
- package/dist/index58.mjs +65 -0
- package/dist/index59.mjs +6 -0
- package/dist/index6.mjs +82 -0
- package/dist/index60.mjs +4 -0
- package/dist/index61.mjs +7 -0
- package/dist/index62.mjs +36 -0
- package/dist/index63.mjs +45 -0
- package/dist/index64.mjs +237 -0
- package/dist/index65.mjs +8 -0
- package/dist/index66.mjs +136 -0
- package/dist/index67.mjs +70 -0
- package/dist/index68.mjs +89 -0
- package/dist/index69.mjs +31 -0
- package/dist/index7.mjs +100 -0
- package/dist/index70.mjs +11 -0
- package/dist/index71.mjs +77 -0
- package/dist/index72.mjs +6 -0
- package/dist/index73.mjs +4 -0
- package/dist/index74.mjs +85 -0
- package/dist/index75.mjs +56 -0
- package/dist/index76.mjs +8 -0
- package/dist/index77.mjs +7 -0
- package/dist/index78.mjs +181 -0
- package/dist/index79.mjs +55 -0
- package/dist/index8.mjs +165 -0
- package/dist/index80.mjs +71 -0
- package/dist/index81.mjs +23 -0
- package/dist/index82.mjs +58 -0
- package/dist/index83.mjs +31 -0
- package/dist/index84.mjs +9 -0
- package/dist/index85.mjs +54 -0
- package/dist/index86.mjs +8 -0
- package/dist/index87.mjs +14 -0
- package/dist/index88.mjs +9 -0
- package/dist/index89.mjs +30 -0
- package/dist/index9.mjs +100 -0
- package/dist/index90.mjs +4 -0
- package/dist/index91.mjs +72 -0
- package/dist/index92.mjs +169 -0
- package/dist/index93.mjs +15 -0
- package/dist/index94.mjs +9 -0
- package/dist/index95.mjs +33 -0
- package/dist/index96.mjs +13 -0
- package/dist/index97.mjs +6 -0
- package/dist/index98.mjs +6 -0
- package/dist/index99.mjs +14 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/mockServiceWorker.js +349 -0
- package/dist/providers/StorefrontProvider.d.ts +47 -0
- package/dist/providers/StorefrontProvider.d.ts.map +1 -0
- package/dist/test-utils/MockCartProvider.d.ts +21 -0
- package/dist/test-utils/MockCartProvider.d.ts.map +1 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
# @instockng/storefront-ui
|
|
2
|
+
|
|
3
|
+
Pre-built React UI components for building e-commerce storefronts with the OMS (Order Management System) API. Built with React, TypeScript, Tailwind CSS, and shadcn/ui.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @instockng/storefront-ui @tanstack/react-query lucide-react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
- ✅ **Drop-in Components** - Fully functional UI out of the box
|
|
14
|
+
- ✅ **Fully Typed** - TypeScript support with auto-generated API types
|
|
15
|
+
- ✅ **Customizable** - Override styles with className props
|
|
16
|
+
- ✅ **Theme Support** - Pass custom colors, fonts, and styling
|
|
17
|
+
- ✅ **Responsive** - Mobile-first design
|
|
18
|
+
- ✅ **Accessible** - Built with accessibility in mind
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @instockng/storefront-ui
|
|
24
|
+
# or
|
|
25
|
+
pnpm add @instockng/storefront-ui
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Peer Dependencies
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install react react-dom @tanstack/react-query lucide-react
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
### Setup
|
|
37
|
+
|
|
38
|
+
Wrap your app with providers:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { ApiClientProvider } from '@instockng/storefront-ui';
|
|
42
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
43
|
+
|
|
44
|
+
const queryClient = new QueryClient();
|
|
45
|
+
|
|
46
|
+
function App() {
|
|
47
|
+
return (
|
|
48
|
+
<QueryClientProvider client={queryClient}>
|
|
49
|
+
<ApiClientProvider baseURL="https://api.yoursite.com">
|
|
50
|
+
<YourApp />
|
|
51
|
+
</ApiClientProvider>
|
|
52
|
+
</QueryClientProvider>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Quick Start Examples
|
|
58
|
+
|
|
59
|
+
#### ProductGrid - Product Catalog
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { ProductGrid } from '@instockng/storefront-ui';
|
|
63
|
+
|
|
64
|
+
function ProductCatalog() {
|
|
65
|
+
return (
|
|
66
|
+
<ProductGrid
|
|
67
|
+
brandId="your-brand-uuid"
|
|
68
|
+
onAddToCart={(variantId, quantity) => {
|
|
69
|
+
console.log('Adding to cart:', variantId, quantity);
|
|
70
|
+
}}
|
|
71
|
+
columns={3}
|
|
72
|
+
showStock={true}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### ShoppingCart - Cart Sidebar with Integrated Checkout
|
|
79
|
+
|
|
80
|
+
The `ShoppingCart` component now includes an integrated `Checkout` modal - no need to handle `onCheckout` unless you want custom behavior!
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { ShoppingCart, CartProvider } from '@instockng/storefront-ui';
|
|
84
|
+
|
|
85
|
+
function MyApp() {
|
|
86
|
+
const [isCartOpen, setIsCartOpen] = useState(false);
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<CartProvider cartId="cart-uuid">
|
|
90
|
+
{/* Your app content */}
|
|
91
|
+
<button onClick={() => setIsCartOpen(true)}>Open Cart</button>
|
|
92
|
+
|
|
93
|
+
{/* Cart with integrated checkout - no onCheckout needed! */}
|
|
94
|
+
<ShoppingCart
|
|
95
|
+
isOpen={isCartOpen}
|
|
96
|
+
onClose={() => setIsCartOpen(false)}
|
|
97
|
+
onOrderSuccess={(orderId) => {
|
|
98
|
+
console.log('Order placed:', orderId);
|
|
99
|
+
// Optionally navigate or show success message
|
|
100
|
+
}}
|
|
101
|
+
showDiscountCode={true}
|
|
102
|
+
/>
|
|
103
|
+
</CartProvider>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Custom Checkout Handler (Optional)**
|
|
109
|
+
|
|
110
|
+
If you need custom behavior, you can still pass `onCheckout`:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<ShoppingCart
|
|
114
|
+
isOpen={isCartOpen}
|
|
115
|
+
onClose={() => setIsCartOpen(false)}
|
|
116
|
+
onCheckout={() => navigate('/custom-checkout')} // Custom behavior
|
|
117
|
+
showDiscountCode={true}
|
|
118
|
+
/>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### CheckoutSummary - Checkout Page
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
import { CheckoutSummary } from '@instockng/storefront-ui';
|
|
125
|
+
|
|
126
|
+
function CheckoutPage() {
|
|
127
|
+
const navigate = useNavigate();
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<CheckoutSummary
|
|
131
|
+
cartId="cart-uuid"
|
|
132
|
+
brandId="brand-uuid"
|
|
133
|
+
onSuccess={(orderId, token) => {
|
|
134
|
+
navigate(`/order-confirmation/${orderId}/${token}`);
|
|
135
|
+
}}
|
|
136
|
+
cartSummary={{
|
|
137
|
+
subtotal: 100.00,
|
|
138
|
+
discountAmount: 10.00,
|
|
139
|
+
discountCode: 'SAVE10',
|
|
140
|
+
deliveryFee: 5.00,
|
|
141
|
+
total: 95.00
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### OrderConfirmation - Confirmation Page
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { OrderConfirmation } from '@instockng/storefront-ui';
|
|
152
|
+
|
|
153
|
+
function OrderPage() {
|
|
154
|
+
const { orderId, token } = useParams();
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<OrderConfirmation
|
|
158
|
+
orderId={orderId}
|
|
159
|
+
token={token}
|
|
160
|
+
onConfirm={(orderNumber) => {
|
|
161
|
+
console.log('Order confirmed:', orderNumber);
|
|
162
|
+
}}
|
|
163
|
+
/>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### Customization
|
|
169
|
+
|
|
170
|
+
```tsx
|
|
171
|
+
<OrderConfirmation
|
|
172
|
+
orderId={orderId}
|
|
173
|
+
token={token}
|
|
174
|
+
// Custom styling
|
|
175
|
+
className="bg-white"
|
|
176
|
+
headerClassName="text-brand-blue"
|
|
177
|
+
buttonClassName="bg-brand-primary hover:bg-brand-primary-dark"
|
|
178
|
+
cardClassName="shadow-lg border-brand-gray"
|
|
179
|
+
|
|
180
|
+
// Custom locale & currency
|
|
181
|
+
currency="USD"
|
|
182
|
+
locale="en-US"
|
|
183
|
+
|
|
184
|
+
// Custom WhatsApp support
|
|
185
|
+
whatsappHelpLink="https://wa.me/1234567890"
|
|
186
|
+
whatsappHelpNumber="+1 (234) 567-890"
|
|
187
|
+
|
|
188
|
+
// Callbacks
|
|
189
|
+
onConfirm={(orderNumber) => {
|
|
190
|
+
// Track analytics
|
|
191
|
+
analytics.track('Order Confirmed', { orderNumber });
|
|
192
|
+
// Redirect
|
|
193
|
+
router.push('/thank-you');
|
|
194
|
+
}}
|
|
195
|
+
onError={(error) => {
|
|
196
|
+
// Show toast notification
|
|
197
|
+
toast.error('Failed to confirm order');
|
|
198
|
+
}}
|
|
199
|
+
/>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Available Components
|
|
203
|
+
|
|
204
|
+
### Product Components
|
|
205
|
+
|
|
206
|
+
- **ProductGrid** - Grid of products with add to cart, filtering, and customization
|
|
207
|
+
- **ProductCard** - Individual product with variants, images, stock status, and quantity selector
|
|
208
|
+
|
|
209
|
+
### Cart Components
|
|
210
|
+
|
|
211
|
+
- **ShoppingCart** - Full cart display with items, discount codes, and checkout button
|
|
212
|
+
- **CartItem** - Individual cart item with quantity controls and remove button
|
|
213
|
+
- **DiscountCodeInput** - Standalone discount code input with validation
|
|
214
|
+
|
|
215
|
+
### Checkout Components
|
|
216
|
+
|
|
217
|
+
- **CheckoutSummary** - Complete checkout form with customer info, delivery, and payment
|
|
218
|
+
- **DeliveryZoneSelector** - Delivery zone dropdown grouped by state
|
|
219
|
+
|
|
220
|
+
### Order Components
|
|
221
|
+
|
|
222
|
+
- **OrderConfirmation** - Order confirmation page for confirming prospect orders
|
|
223
|
+
|
|
224
|
+
## Theming
|
|
225
|
+
|
|
226
|
+
All components accept `className` props for custom styling:
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
<OrderConfirmation
|
|
230
|
+
className="font-custom" // Root container
|
|
231
|
+
headerClassName="text-brand-color" // Header section
|
|
232
|
+
buttonClassName="bg-brand-primary" // Buttons
|
|
233
|
+
cardClassName="border-brand-gray" // Card components
|
|
234
|
+
/>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Using with Tailwind
|
|
238
|
+
|
|
239
|
+
The components are built with Tailwind CSS. Make sure your `tailwind.config.js` includes the package:
|
|
240
|
+
|
|
241
|
+
```js
|
|
242
|
+
module.exports = {
|
|
243
|
+
content: [
|
|
244
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
245
|
+
'./node_modules/@instockng/storefront-ui/**/*.{js,ts,jsx,tsx}',
|
|
246
|
+
],
|
|
247
|
+
// ... your config
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## API Hooks
|
|
252
|
+
|
|
253
|
+
All `@oms/api-client` hooks are re-exported for convenience:
|
|
254
|
+
|
|
255
|
+
```tsx
|
|
256
|
+
import {
|
|
257
|
+
useGetOrder,
|
|
258
|
+
useConfirmOrder,
|
|
259
|
+
useGetProducts,
|
|
260
|
+
useGetCart,
|
|
261
|
+
useCheckout,
|
|
262
|
+
// ... all other hooks
|
|
263
|
+
} from '@instockng/storefront-ui';
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## UI Primitives
|
|
267
|
+
|
|
268
|
+
Access underlying UI components for custom layouts:
|
|
269
|
+
|
|
270
|
+
```tsx
|
|
271
|
+
import {
|
|
272
|
+
Button,
|
|
273
|
+
Card,
|
|
274
|
+
CardContent,
|
|
275
|
+
CardHeader,
|
|
276
|
+
CardTitle,
|
|
277
|
+
Badge,
|
|
278
|
+
} from '@instockng/storefront-ui';
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Utilities
|
|
282
|
+
|
|
283
|
+
Helper functions for formatting:
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
import {
|
|
287
|
+
formatCurrency,
|
|
288
|
+
formatDate,
|
|
289
|
+
formatDateTime,
|
|
290
|
+
getStatusColor,
|
|
291
|
+
cn, // Tailwind class merger
|
|
292
|
+
} from '@instockng/storefront-ui';
|
|
293
|
+
|
|
294
|
+
// Usage
|
|
295
|
+
formatCurrency(1999.99, 'USD', 'en-US'); // "$1,999.99"
|
|
296
|
+
formatDate('2024-01-15'); // "January 15, 2024"
|
|
297
|
+
formatDateTime('2024-01-15T10:30:00'); // "January 15, 2024 at 10:30 AM"
|
|
298
|
+
getStatusColor('shipped'); // "bg-blue-100 text-blue-800"
|
|
299
|
+
cn('base-class', { 'conditional': true }); // Merges Tailwind classes
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## TypeScript
|
|
303
|
+
|
|
304
|
+
All components are fully typed with TypeScript:
|
|
305
|
+
|
|
306
|
+
```tsx
|
|
307
|
+
import type { OrderConfirmationProps } from '@instockng/storefront-ui';
|
|
308
|
+
|
|
309
|
+
const config: OrderConfirmationProps = {
|
|
310
|
+
orderId: '123',
|
|
311
|
+
token: 'abc',
|
|
312
|
+
// TypeScript will autocomplete and validate all props
|
|
313
|
+
};
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Examples
|
|
317
|
+
|
|
318
|
+
### Simple Usage
|
|
319
|
+
|
|
320
|
+
```tsx
|
|
321
|
+
import { OrderConfirmation } from '@instockng/storefront-ui';
|
|
322
|
+
|
|
323
|
+
export default function OrderPage({ orderId, token }) {
|
|
324
|
+
return <OrderConfirmation orderId={orderId} token={token} />;
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### With Custom Brand Colors
|
|
329
|
+
|
|
330
|
+
```tsx
|
|
331
|
+
import { OrderConfirmation } from '@instockng/storefront-ui';
|
|
332
|
+
|
|
333
|
+
export default function BrandedOrderPage({ orderId, token }) {
|
|
334
|
+
return (
|
|
335
|
+
<OrderConfirmation
|
|
336
|
+
orderId={orderId}
|
|
337
|
+
token={token}
|
|
338
|
+
className="bg-gray-50 font-inter"
|
|
339
|
+
headerClassName="text-purple-600"
|
|
340
|
+
buttonClassName="bg-purple-600 hover:bg-purple-700"
|
|
341
|
+
cardClassName="border-purple-200"
|
|
342
|
+
currency="USD"
|
|
343
|
+
locale="en-US"
|
|
344
|
+
/>
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### With Analytics Tracking
|
|
350
|
+
|
|
351
|
+
```tsx
|
|
352
|
+
import { OrderConfirmation } from '@instockng/storefront-ui';
|
|
353
|
+
import { analytics } from './analytics';
|
|
354
|
+
|
|
355
|
+
export default function TrackedOrderPage({ orderId, token }) {
|
|
356
|
+
return (
|
|
357
|
+
<OrderConfirmation
|
|
358
|
+
orderId={orderId}
|
|
359
|
+
token={token}
|
|
360
|
+
onConfirm={(orderNumber) => {
|
|
361
|
+
analytics.track('Order Confirmed', {
|
|
362
|
+
orderNumber,
|
|
363
|
+
orderId,
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
// Redirect to thank you page
|
|
367
|
+
window.location.href = '/thank-you';
|
|
368
|
+
}}
|
|
369
|
+
onError={(error) => {
|
|
370
|
+
analytics.track('Order Confirmation Failed', {
|
|
371
|
+
error: error.message,
|
|
372
|
+
orderId,
|
|
373
|
+
});
|
|
374
|
+
}}
|
|
375
|
+
/>
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Development
|
|
381
|
+
|
|
382
|
+
This package is part of the OMS monorepo. When the backend API changes:
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
# Regenerate types
|
|
386
|
+
cd packages/types
|
|
387
|
+
pnpm run generate
|
|
388
|
+
|
|
389
|
+
# The storefront-ui will automatically pick up new types
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## License
|
|
393
|
+
|
|
394
|
+
ISC
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CartItem Component
|
|
3
|
+
*
|
|
4
|
+
* Displays a single item in the shopping cart with quantity controls and remove button.
|
|
5
|
+
*/
|
|
6
|
+
import type { CartItem as CartItemType } from '@oms/api-client';
|
|
7
|
+
export interface CartItemProps {
|
|
8
|
+
item: CartItemType;
|
|
9
|
+
/** Custom class name */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Disable controls */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function CartItem({ item, className, disabled, }: CartItemProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=CartItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CartItem.d.ts","sourceRoot":"","sources":["../../src/components/CartItem.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIhE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,SAAS,EACT,QAAgB,GACjB,EAAE,aAAa,2CAoHf"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type PaymentMethod = 'cod' | 'online';
|
|
2
|
+
export interface CheckoutFormData {
|
|
3
|
+
firstName: string;
|
|
4
|
+
lastName: string;
|
|
5
|
+
email: string;
|
|
6
|
+
phone: string;
|
|
7
|
+
address: string;
|
|
8
|
+
city: string;
|
|
9
|
+
state?: string;
|
|
10
|
+
deliveryZoneId: string;
|
|
11
|
+
paymentMethod: PaymentMethod;
|
|
12
|
+
notes?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CheckoutProps {
|
|
15
|
+
/** Controls modal visibility */
|
|
16
|
+
isOpen: boolean;
|
|
17
|
+
/** Callback when modal should close */
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
/** Initial form data */
|
|
20
|
+
initialData?: Partial<CheckoutFormData>;
|
|
21
|
+
/** Callback on successful checkout */
|
|
22
|
+
onSuccess?: (orderId: string) => void;
|
|
23
|
+
/** Callback on error */
|
|
24
|
+
onError?: (error: Error) => void;
|
|
25
|
+
/** Submit button text */
|
|
26
|
+
submitButtonText?: string;
|
|
27
|
+
/** States available for selection */
|
|
28
|
+
states?: Array<{
|
|
29
|
+
value: string;
|
|
30
|
+
label: string;
|
|
31
|
+
}>;
|
|
32
|
+
/** Refund policy content */
|
|
33
|
+
refundPolicy?: {
|
|
34
|
+
title?: string;
|
|
35
|
+
policies?: string[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export declare function Checkout({ isOpen, onClose, initialData, onSuccess, onError, submitButtonText, refundPolicy, }: CheckoutProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=Checkout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkout.d.ts","sourceRoot":"","sources":["../../src/components/Checkout.tsx"],"names":[],"mappings":"AA4FA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,uCAAuC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wBAAwB;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACxC,sCAAsC;IACtC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,wBAAwB;IACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,4BAA4B;IAC5B,YAAY,CAAC,EAAE;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAID,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,OAAO,EACP,WAAW,EACX,SAAS,EACT,OAAO,EACP,gBAAgC,EAChC,YAAY,GACb,EAAE,aAAa,2CAiyBf"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiscountCodeInput Component
|
|
3
|
+
*
|
|
4
|
+
* Input field for applying/removing discount codes with validation feedback.
|
|
5
|
+
* Uses CartProvider for cart operations.
|
|
6
|
+
*/
|
|
7
|
+
export interface DiscountCodeInputProps {
|
|
8
|
+
/** Callback on successful apply/remove */
|
|
9
|
+
onSuccess?: () => void;
|
|
10
|
+
/** Custom class name */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Placeholder text */
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
/** Custom class name for the input */
|
|
15
|
+
inputClassName?: string;
|
|
16
|
+
/** Custom class name for the apply button */
|
|
17
|
+
buttonClassName?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function DiscountCodeInput({ onSuccess, className, placeholder, inputClassName, buttonClassName, }: DiscountCodeInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=DiscountCodeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscountCodeInput.d.ts","sourceRoot":"","sources":["../../src/components/DiscountCodeInput.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,WAAW,sBAAsB;IACrC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,SAAS,EACT,WAAmC,EACnC,cAAc,EACd,eAAe,GAChB,EAAE,sBAAsB,2CA+HxB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OrderConfirmation Component
|
|
3
|
+
*
|
|
4
|
+
* A pre-built order confirmation page for e-commerce sites.
|
|
5
|
+
* Displays order details and allows customers to confirm prospect orders.
|
|
6
|
+
*/
|
|
7
|
+
export interface OrderConfirmationProps {
|
|
8
|
+
/** Order UUID */
|
|
9
|
+
orderId: string;
|
|
10
|
+
/** User action token for authentication */
|
|
11
|
+
token: string;
|
|
12
|
+
/** Custom class name for root container */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Custom class name for header section */
|
|
15
|
+
headerClassName?: string;
|
|
16
|
+
/** Custom class name for buttons */
|
|
17
|
+
buttonClassName?: string;
|
|
18
|
+
/** Custom class name for cards */
|
|
19
|
+
cardClassName?: string;
|
|
20
|
+
/** WhatsApp help link (defaults to shared constant) */
|
|
21
|
+
whatsappHelpLink?: string;
|
|
22
|
+
/** WhatsApp help number formatted (defaults to shared constant) */
|
|
23
|
+
whatsappHelpNumber?: string;
|
|
24
|
+
/** Currency code for formatting */
|
|
25
|
+
currency?: string;
|
|
26
|
+
/** Locale for date/currency formatting */
|
|
27
|
+
locale?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function OrderConfirmation({ orderId, token, className, headerClassName, buttonClassName, cardClassName, whatsappHelpLink, whatsappHelpNumber, currency, locale, }: OrderConfirmationProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=OrderConfirmation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrderConfirmation.d.ts","sourceRoot":"","sources":["../../src/components/OrderConfirmation.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,MAAM,WAAW,sBAAsB;IACrC,iBAAiB;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IAEd,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,KAAK,EACL,SAAS,EACT,eAAe,EACf,eAAe,EACf,aAAa,EACb,gBAAqC,EACrC,kBAAmD,EACnD,QAAgB,EAChB,MAAgB,GACjB,EAAE,sBAAsB,2CAuPxB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProductCard Component
|
|
3
|
+
*
|
|
4
|
+
* Displays a product with image, name, price, and add to cart button.
|
|
5
|
+
* Handles variant selection if product has multiple variants.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProductCardProduct {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
imageUrl?: string;
|
|
12
|
+
brand?: {
|
|
13
|
+
name: string;
|
|
14
|
+
logoUrl?: string;
|
|
15
|
+
};
|
|
16
|
+
variants: Array<{
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
price: number;
|
|
20
|
+
sku: string;
|
|
21
|
+
stock?: number;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export interface ProductCardProps {
|
|
25
|
+
product: ProductCardProduct;
|
|
26
|
+
/** Callback when add to cart is clicked */
|
|
27
|
+
onAddToCart?: (variantId: string, quantity: number) => void;
|
|
28
|
+
/** Show stock information */
|
|
29
|
+
showStock?: boolean;
|
|
30
|
+
/** Custom class names */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** Image class name */
|
|
33
|
+
imageClassName?: string;
|
|
34
|
+
/** Disable add to cart button */
|
|
35
|
+
disableAddToCart?: boolean;
|
|
36
|
+
/** Loading state for add to cart */
|
|
37
|
+
isAddingToCart?: boolean;
|
|
38
|
+
/** Click handler for card */
|
|
39
|
+
onClick?: () => void;
|
|
40
|
+
}
|
|
41
|
+
export declare function ProductCard({ product, onAddToCart, showStock, className, imageClassName, disableAddToCart, isAddingToCart, onClick, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=ProductCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../src/components/ProductCard.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,QAAQ,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oCAAoC;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,WAAW,EACX,SAAgB,EAChB,SAAS,EACT,cAAc,EACd,gBAAwB,EACxB,cAAsB,EACtB,OAAO,GACR,EAAE,gBAAgB,2CAsIlB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProductGrid Component
|
|
3
|
+
*
|
|
4
|
+
* Displays a grid of products using ProductCard.
|
|
5
|
+
* Handles loading, empty states, and integrates with useGetProducts hook.
|
|
6
|
+
*/
|
|
7
|
+
import { type ProductCardProduct } from './ProductCard';
|
|
8
|
+
export interface ProductGridProps {
|
|
9
|
+
/** Brand UUID to fetch products for */
|
|
10
|
+
brandId: string;
|
|
11
|
+
/** Callback when add to cart is clicked */
|
|
12
|
+
onAddToCart?: (variantId: string, quantity: number) => void;
|
|
13
|
+
/** Callback when product card is clicked */
|
|
14
|
+
onProductClick?: (product: ProductCardProduct) => void;
|
|
15
|
+
/** Number of columns in grid */
|
|
16
|
+
columns?: 2 | 3 | 4;
|
|
17
|
+
/** Show stock information */
|
|
18
|
+
showStock?: boolean;
|
|
19
|
+
/** Custom class name for grid container */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Custom class name for product cards */
|
|
22
|
+
cardClassName?: string;
|
|
23
|
+
/** Show loading state */
|
|
24
|
+
showLoading?: boolean;
|
|
25
|
+
/** Custom empty state message */
|
|
26
|
+
emptyMessage?: string;
|
|
27
|
+
/** Custom error message */
|
|
28
|
+
errorMessage?: string;
|
|
29
|
+
/** Loading variant ID (to show loading state on specific card) */
|
|
30
|
+
loadingVariantId?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function ProductGrid({ brandId, onAddToCart, onProductClick, columns, showStock, className, cardClassName, showLoading, emptyMessage, errorMessage, loadingVariantId, }: ProductGridProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=ProductGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductGrid.d.ts","sourceRoot":"","sources":["../../src/components/ProductGrid.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAIrE,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,4CAA4C;IAC5C,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACvD,gCAAgC;IAChC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yBAAyB;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,WAAW,EACX,cAAc,EACd,OAAW,EACX,SAAgB,EAChB,SAAS,EACT,aAAa,EACb,WAAkB,EAClB,YAAqD,EACrD,YAAiE,EACjE,gBAAgB,GACjB,EAAE,gBAAgB,2CA2FlB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ShoppingCartProps {
|
|
2
|
+
/** Whether the cart is open */
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
/** Callback when cart should close */
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
/** Callback when checkout is clicked */
|
|
7
|
+
onCheckout?: () => void;
|
|
8
|
+
/** Callback when continue shopping is clicked */
|
|
9
|
+
onContinueShopping?: () => void;
|
|
10
|
+
/** Custom class name */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Show discount code input */
|
|
13
|
+
showDiscountCode?: boolean;
|
|
14
|
+
/** Checkout button text */
|
|
15
|
+
checkoutButtonText?: string;
|
|
16
|
+
/** Continue shopping button text */
|
|
17
|
+
continueShoppingText?: string;
|
|
18
|
+
/** Custom class for checkout button */
|
|
19
|
+
checkoutButtonClassName?: string;
|
|
20
|
+
/** Custom class for continue shopping button */
|
|
21
|
+
continueShoppingButtonClassName?: string;
|
|
22
|
+
/** Disable checkout */
|
|
23
|
+
disableCheckout?: boolean;
|
|
24
|
+
/** Empty cart message */
|
|
25
|
+
emptyMessage?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function ShoppingCart({ isOpen, onClose, onCheckout, onContinueShopping, className, showDiscountCode, checkoutButtonText, continueShoppingText, checkoutButtonClassName, continueShoppingButtonClassName, disableCheckout, emptyMessage, }: ShoppingCartProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=ShoppingCart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShoppingCart.d.ts","sourceRoot":"","sources":["../../src/components/ShoppingCart.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oCAAoC;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uCAAuC;IACvC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,gDAAgD;IAChD,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,uBAAuB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,gBAAuB,EACvB,kBAA+B,EAC/B,oBAA0C,EAC1C,uBAAuB,EACvB,+BAA+B,EAC/B,eAAuB,EACvB,YAAmC,GACpC,EAAE,iBAAiB,2CA2MnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
10
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,aAAa;;mFAkBlB,CAAA;AAED,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAI1D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, loading, children, disabled, type, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Button, buttonVariants };
|
|
12
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,cAAc;;;mFA8BnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,OAAe,EACf,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,2CAeF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|