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.
Files changed (65) hide show
  1. package/README.md +70 -8
  2. package/dist/index.d.mts +380 -2364
  3. package/dist/index.d.ts +380 -2364
  4. package/dist/index.js +287 -326
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +287 -323
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +2 -2
  9. package/src/components/AccountOverviewTab.tsx +5 -5
  10. package/src/components/CartItem.tsx +15 -15
  11. package/src/components/Notification.tsx +3 -3
  12. package/src/components/ProductCard.tsx +10 -10
  13. package/src/components/QuickViewModal.tsx +16 -16
  14. package/src/components/ReviewCard.tsx +2 -2
  15. package/src/lib/Apis/api.ts +0 -1
  16. package/src/lib/Apis/models/group-with-no-users-dto.ts +0 -6
  17. package/src/lib/Apis/models/group-with-users-dto.ts +0 -6
  18. package/src/lib/Apis/models/index.ts +0 -35
  19. package/src/lib/Apis/models/order.ts +0 -6
  20. package/src/lib/Apis/models/populated-order.ts +0 -6
  21. package/src/lib/Apis/models/preference-update-item.ts +1 -0
  22. package/src/lib/Apis/models/update-user-dto.ts +0 -6
  23. package/src/lib/Apis/models/user-group.ts +0 -6
  24. package/src/lib/Apis/models/user-with-no-id.ts +0 -6
  25. package/src/lib/Apis/sharedConfig.ts +1 -1
  26. package/src/screens/CartScreen.tsx +10 -10
  27. package/src/screens/CheckoutScreen.tsx +12 -12
  28. package/src/screens/ProductDetailScreen.tsx +39 -39
  29. package/src/screens/ShopScreen.tsx +20 -20
  30. package/src/lib/Apis/apis/marketing-api.ts +0 -3099
  31. package/src/lib/Apis/models/add-contact-to-list-dto.ts +0 -33
  32. package/src/lib/Apis/models/browser-stats-response-dto.ts +0 -40
  33. package/src/lib/Apis/models/campaign-content-response-dto.ts +0 -40
  34. package/src/lib/Apis/models/campaign-draft-dto.ts +0 -175
  35. package/src/lib/Apis/models/campaign-draft-response-dto.ts +0 -40
  36. package/src/lib/Apis/models/campaign-draft-schedule-dto.ts +0 -49
  37. package/src/lib/Apis/models/campaign-draft-schedule-response-dto.ts +0 -40
  38. package/src/lib/Apis/models/campaign-draft-sending-dto.ts +0 -43
  39. package/src/lib/Apis/models/campaign-draft-sending-response-dto.ts +0 -40
  40. package/src/lib/Apis/models/contact-aggregated-stats-response-dto.ts +0 -40
  41. package/src/lib/Apis/models/contact-full-dto.ts +0 -93
  42. package/src/lib/Apis/models/contact-full-response-dto.ts +0 -40
  43. package/src/lib/Apis/models/contact-list-stats-response-dto.ts +0 -40
  44. package/src/lib/Apis/models/contact-lists-response-dto.ts +0 -40
  45. package/src/lib/Apis/models/country-stats-response-dto.ts +0 -40
  46. package/src/lib/Apis/models/create-contact-dto.ts +0 -39
  47. package/src/lib/Apis/models/create-contact-list-dto.ts +0 -27
  48. package/src/lib/Apis/models/create-email-template-dto.ts +0 -51
  49. package/src/lib/Apis/models/create-marketing-campaign-dto.ts +0 -81
  50. package/src/lib/Apis/models/email-template-response-dto.ts +0 -117
  51. package/src/lib/Apis/models/general-stats-response-dto.ts +0 -40
  52. package/src/lib/Apis/models/link-stats-response-dto.ts +0 -40
  53. package/src/lib/Apis/models/marketing-campaign-content-dto.ts +0 -27
  54. package/src/lib/Apis/models/marketing-list-contact-dto.ts +0 -51
  55. package/src/lib/Apis/models/schedule-campaign-draft-dto.ts +0 -27
  56. package/src/lib/Apis/models/send-test-email-dto.ts +0 -28
  57. package/src/lib/Apis/models/single-browser-stats-dto.ts +0 -45
  58. package/src/lib/Apis/models/single-contact-aggregated-stats-dto.ts +0 -129
  59. package/src/lib/Apis/models/single-contact-list-stats-dto.ts +0 -117
  60. package/src/lib/Apis/models/single-country-stats-dto.ts +0 -39
  61. package/src/lib/Apis/models/single-general-stats.ts +0 -153
  62. package/src/lib/Apis/models/single-link-stats-dto.ts +0 -39
  63. package/src/lib/Apis/models/single-recipient-dto.ts +0 -33
  64. package/src/lib/Apis/models/update-campaign-draft-content-dto.ts +0 -27
  65. 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
- ## Quick Start
22
+ ## Step-by-Step Integration Guide
23
23
 
24
- ### 1) Configure your store
24
+ ### 1) Install Dependencies
25
25
 
26
- Create a config file for your store:
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
- // ecommerce.config.ts
30
- export const ecommerceConfig = {
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
- ### 2) Wrap your app
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 './ecommerce.config';
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 config={ecommerceConfig}>
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>