hey-pharmacist-ecommerce 1.1.42 → 1.1.43
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 +70 -8
- package/dist/index.d.mts +380 -2364
- package/dist/index.d.ts +380 -2364
- package/dist/index.js +287 -326
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +287 -323
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/AccountOverviewTab.tsx +5 -5
- package/src/components/CartItem.tsx +15 -15
- package/src/components/Notification.tsx +3 -3
- package/src/components/ProductCard.tsx +10 -10
- package/src/components/QuickViewModal.tsx +16 -16
- package/src/components/ReviewCard.tsx +2 -2
- package/src/lib/Apis/api.ts +0 -1
- package/src/lib/Apis/models/group-with-no-users-dto.ts +0 -6
- package/src/lib/Apis/models/group-with-users-dto.ts +0 -6
- package/src/lib/Apis/models/index.ts +0 -35
- package/src/lib/Apis/models/order.ts +0 -6
- package/src/lib/Apis/models/populated-order.ts +0 -6
- package/src/lib/Apis/models/preference-update-item.ts +1 -0
- package/src/lib/Apis/models/update-user-dto.ts +0 -6
- package/src/lib/Apis/models/user-group.ts +0 -6
- package/src/lib/Apis/models/user-with-no-id.ts +0 -6
- package/src/lib/Apis/sharedConfig.ts +1 -1
- package/src/screens/CartScreen.tsx +10 -10
- package/src/screens/CheckoutScreen.tsx +12 -12
- package/src/screens/ProductDetailScreen.tsx +39 -39
- package/src/screens/ShopScreen.tsx +20 -20
- package/src/lib/Apis/apis/marketing-api.ts +0 -3099
- package/src/lib/Apis/models/add-contact-to-list-dto.ts +0 -33
- package/src/lib/Apis/models/browser-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/campaign-content-response-dto.ts +0 -40
- package/src/lib/Apis/models/campaign-draft-dto.ts +0 -175
- package/src/lib/Apis/models/campaign-draft-response-dto.ts +0 -40
- package/src/lib/Apis/models/campaign-draft-schedule-dto.ts +0 -49
- package/src/lib/Apis/models/campaign-draft-schedule-response-dto.ts +0 -40
- package/src/lib/Apis/models/campaign-draft-sending-dto.ts +0 -43
- package/src/lib/Apis/models/campaign-draft-sending-response-dto.ts +0 -40
- package/src/lib/Apis/models/contact-aggregated-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/contact-full-dto.ts +0 -93
- package/src/lib/Apis/models/contact-full-response-dto.ts +0 -40
- package/src/lib/Apis/models/contact-list-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/contact-lists-response-dto.ts +0 -40
- package/src/lib/Apis/models/country-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/create-contact-dto.ts +0 -39
- package/src/lib/Apis/models/create-contact-list-dto.ts +0 -27
- package/src/lib/Apis/models/create-email-template-dto.ts +0 -51
- package/src/lib/Apis/models/create-marketing-campaign-dto.ts +0 -81
- package/src/lib/Apis/models/email-template-response-dto.ts +0 -117
- package/src/lib/Apis/models/general-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/link-stats-response-dto.ts +0 -40
- package/src/lib/Apis/models/marketing-campaign-content-dto.ts +0 -27
- package/src/lib/Apis/models/marketing-list-contact-dto.ts +0 -51
- package/src/lib/Apis/models/schedule-campaign-draft-dto.ts +0 -27
- package/src/lib/Apis/models/send-test-email-dto.ts +0 -28
- package/src/lib/Apis/models/single-browser-stats-dto.ts +0 -45
- package/src/lib/Apis/models/single-contact-aggregated-stats-dto.ts +0 -129
- package/src/lib/Apis/models/single-contact-list-stats-dto.ts +0 -117
- package/src/lib/Apis/models/single-country-stats-dto.ts +0 -39
- package/src/lib/Apis/models/single-general-stats.ts +0 -153
- package/src/lib/Apis/models/single-link-stats-dto.ts +0 -39
- package/src/lib/Apis/models/single-recipient-dto.ts +0 -33
- package/src/lib/Apis/models/update-campaign-draft-content-dto.ts +0 -27
- package/src/lib/Apis/models/update-marketing-camp-draft-dto.ts +0 -81
package/README.md
CHANGED
|
@@ -19,33 +19,91 @@ Production‑ready, multi‑tenant e‑commerce UI + API adapter for Next.js. It
|
|
|
19
19
|
npm install hey-pharmacist-ecommerce react-hook-form @hookform/resolvers
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Step-by-Step Integration Guide
|
|
23
23
|
|
|
24
|
-
### 1)
|
|
24
|
+
### 1) Install Dependencies
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Install the library and its peer dependencies:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install hey-pharmacist-ecommerce react-hook-form @hookform/resolvers
|
|
30
|
+
# or
|
|
31
|
+
yarn add hey-pharmacist-ecommerce react-hook-form @hookform/resolvers
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2) Configure CSS and Tailwind
|
|
35
|
+
|
|
36
|
+
To ensure styles apply correctly, you must update your global CSS and Tailwind config.
|
|
37
|
+
|
|
38
|
+
**A. Update `index.css` / `globals.css`**
|
|
39
|
+
Import the library's global styles and map your local variables to the library's namespaced variables.
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
@import "tailwindcss";
|
|
43
|
+
/* Import library styles to get base theme definitions */
|
|
44
|
+
@import "hey-pharmacist-ecommerce/styles/globals.css";
|
|
45
|
+
|
|
46
|
+
/* ... existing source directives ... */
|
|
47
|
+
|
|
48
|
+
/* Map local variables to library variables if needed */
|
|
49
|
+
:root {
|
|
50
|
+
/* ... existing vars ... */
|
|
51
|
+
--primary: var(--hp-primary, #030213);
|
|
52
|
+
--secondary: var(--hp-secondary, #2b4b7c);
|
|
53
|
+
--accent: var(--hp-accent, #e67e50);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**B. Update Tailwind Config**
|
|
58
|
+
Ensure Tailwind scans the library's components for class names.
|
|
59
|
+
|
|
60
|
+
If using Tailwind v4 (CSS-only config):
|
|
61
|
+
```css
|
|
62
|
+
@source "./node_modules/hey-pharmacist-ecommerce/**/*.{js,ts,jsx,tsx,mdx}";
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If using `tailwind.config.js`:
|
|
66
|
+
```javascript
|
|
67
|
+
module.exports = {
|
|
68
|
+
content: [
|
|
69
|
+
// ... existing paths
|
|
70
|
+
"./node_modules/hey-pharmacist-ecommerce/**/*.{js,ts,jsx,tsx,mdx}",
|
|
71
|
+
],
|
|
72
|
+
// ...
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 3) Create Store Configuration
|
|
77
|
+
|
|
78
|
+
Create a config file for your store (e.g., `lib/ecommerce-config.ts`):
|
|
27
79
|
|
|
28
80
|
```typescript
|
|
29
|
-
|
|
30
|
-
|
|
81
|
+
import { EcommerceConfig } from 'hey-pharmacist-ecommerce';
|
|
82
|
+
|
|
83
|
+
export const ecommerceConfig: EcommerceConfig = {
|
|
31
84
|
storeId: "your-store-id",
|
|
32
85
|
storeName: "Your Store Name",
|
|
33
86
|
logo: "/path/to/logo.png",
|
|
34
87
|
colors: {
|
|
35
88
|
primary: "#3B82F6",
|
|
89
|
+
primaryDark: "#1E40AF",
|
|
36
90
|
secondary: "#1E40AF",
|
|
37
91
|
accent: "#F59E0B",
|
|
92
|
+
accentDark: "#D97706",
|
|
93
|
+
textMuted: "#6B7280"
|
|
38
94
|
},
|
|
39
95
|
apiBaseUrl: "https://your-api.com",
|
|
40
96
|
};
|
|
41
97
|
```
|
|
42
98
|
|
|
43
|
-
###
|
|
99
|
+
### 4) Wrap your App with Provider
|
|
100
|
+
|
|
101
|
+
Wrap your application root with `EcommerceProvider`. This handles state, auth, and theme injection.
|
|
44
102
|
|
|
45
103
|
```tsx
|
|
46
104
|
// app/layout.tsx
|
|
47
105
|
import { EcommerceProvider } from 'hey-pharmacist-ecommerce';
|
|
48
|
-
import { ecommerceConfig } from '
|
|
106
|
+
import { ecommerceConfig } from '@/lib/ecommerce-config';
|
|
49
107
|
|
|
50
108
|
export default function RootLayout({
|
|
51
109
|
children,
|
|
@@ -55,7 +113,11 @@ export default function RootLayout({
|
|
|
55
113
|
return (
|
|
56
114
|
<html lang="en">
|
|
57
115
|
<body>
|
|
58
|
-
<EcommerceProvider
|
|
116
|
+
<EcommerceProvider
|
|
117
|
+
config={ecommerceConfig}
|
|
118
|
+
basePath="/shop" {/* Optional: if shop is under a subpath */}
|
|
119
|
+
withToaster={true} {/* Optional: enables global toast notifications */}
|
|
120
|
+
>
|
|
59
121
|
{children}
|
|
60
122
|
</EcommerceProvider>
|
|
61
123
|
</body>
|