customer-module-frontend 1.0.1-beta.1 → 1.0.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/dist/customer-module.css +1 -0
- package/dist/customer-module.js +29033 -0
- package/dist/customer-module.js.map +1 -0
- package/package.json +21 -2
- package/.cursor/rules/context.md +0 -306
- package/.cursor/rules/guardrails.md +0 -35
- package/.env +0 -1
- package/.github/workflows/publish-to-npm-beta.yml +0 -51
- package/.github/workflows/publish-to-npm.yml +0 -58
- package/eslint.config.js +0 -23
- package/index.html +0 -13
- package/postcss-unwrap-layers.js +0 -31
- package/postcss.config.js +0 -11
- package/src/App.css +0 -40
- package/src/App.tsx +0 -58
- package/src/assets/accounts.svg +0 -3
- package/src/assets/at_the_rate.svg +0 -10
- package/src/assets/buildings.svg +0 -3
- package/src/assets/chat.svg +0 -3
- package/src/assets/close.svg +0 -3
- package/src/assets/contacts.svg +0 -3
- package/src/assets/conversation.svg +0 -10
- package/src/assets/customers.svg +0 -10
- package/src/assets/details.svg +0 -3
- package/src/assets/domain.svg +0 -10
- package/src/assets/edit.svg +0 -15
- package/src/assets/email.svg +0 -3
- package/src/assets/google.svg +0 -8
- package/src/assets/inbox.svg +0 -0
- package/src/assets/message.svg +0 -3
- package/src/assets/no-data.svg +0 -9
- package/src/assets/open_in_a_new_tab.svg +0 -10
- package/src/assets/phone.svg +0 -3
- package/src/assets/react.svg +0 -1
- package/src/assets/search.svg +0 -3
- package/src/assets/search_typing.svg +0 -4
- package/src/assets/sm_contacts.svg +0 -3
- package/src/assets/sm_inbox.svg +0 -3
- package/src/assets/sm_slider.svg +0 -3
- package/src/assets/status-resolved.svg +0 -3
- package/src/assets/status-snoozed.svg +0 -4
- package/src/assets/status_open.svg +0 -1
- package/src/components/AccountContacts/index.tsx +0 -107
- package/src/components/AccountDetails/index.tsx +0 -102
- package/src/components/AccountsConversation/index.tsx +0 -75
- package/src/components/Avatar/constants.tsx +0 -45
- package/src/components/Avatar/index.tsx +0 -42
- package/src/components/BreadcrumbsSection/index.tsx +0 -16
- package/src/components/Card/index.tsx +0 -31
- package/src/components/Card/types.ts +0 -10
- package/src/components/ContactConversation/Converation.tsx +0 -14
- package/src/components/ContactConversation/index.tsx +0 -81
- package/src/components/ContactDetails/index.tsx +0 -111
- package/src/components/Contacts/EditContact.tsx +0 -213
- package/src/components/Contacts/constants/index.tsx +0 -24
- package/src/components/Contacts/index.tsx +0 -171
- package/src/components/ConversationBox/constants.tsx +0 -99
- package/src/components/ConversationBox/index.tsx +0 -147
- package/src/components/ConversationBox/types.ts +0 -20
- package/src/components/CustomersLayout/index.tsx +0 -20
- package/src/components/DetailsCard/index.tsx +0 -31
- package/src/components/DetailsCard/types.ts +0 -10
- package/src/components/EmptyData/NoDataFound.tsx +0 -31
- package/src/components/Header/index.tsx +0 -55
- package/src/components/Icon/index.tsx +0 -93
- package/src/components/Icon/types.ts +0 -13
- package/src/components/Listing/AccountTable.tsx +0 -47
- package/src/components/Listing/ContactTable.tsx +0 -76
- package/src/components/RightPanel/AccountPanel.tsx +0 -123
- package/src/components/RightPanel/ContactPanel.tsx +0 -142
- package/src/components/RightPanel/index.tsx +0 -167
- package/src/components/Search/SearchDialog.tsx +0 -150
- package/src/components/TabsSection/index.tsx +0 -49
- package/src/constants/index.tsx +0 -645
- package/src/hooks/useBreadcrumb.tsx +0 -93
- package/src/index.css +0 -315
- package/src/main.tsx +0 -14
- package/src/pages/AccountDetail.tsx +0 -68
- package/src/pages/Accounts.tsx +0 -12
- package/src/pages/ContactDetail.tsx +0 -55
- package/src/pages/Contacts.tsx +0 -12
- package/src/stores/count.tsx +0 -17
- package/src/types/index.ts +0 -0
- package/tailwind.config.js +0 -179
- package/tsconfig.app.json +0 -36
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -31
- /package/{public → dist}/vite.svg +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "customer-module-frontend",
|
|
3
|
-
"version": "1.0.1
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -8,13 +8,32 @@
|
|
|
8
8
|
"lint": "eslint .",
|
|
9
9
|
"preview": "vite preview"
|
|
10
10
|
},
|
|
11
|
+
"main": "./dist/customer-module.js",
|
|
12
|
+
"module": "./dist/customer-module.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/customer-module.js"
|
|
18
|
+
},
|
|
19
|
+
"./RightPanel": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/customer-module.js"
|
|
22
|
+
},
|
|
23
|
+
"./styles": "./dist/customer-module.css"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
11
28
|
"dependencies": {
|
|
12
|
-
"
|
|
29
|
+
"axios": "^1.13.2",
|
|
30
|
+
"hiver-ui-kit-extended": "1.0.0",
|
|
13
31
|
"primeicons": "7.0.0",
|
|
14
32
|
"primereact": "10.9.7",
|
|
15
33
|
"react": "18.2.0",
|
|
16
34
|
"react-dom": "18.2.0",
|
|
17
35
|
"react-router-dom": "^7.10.1",
|
|
36
|
+
"universal-cookie": "^7.0.1",
|
|
18
37
|
"zustand": "^5.0.9"
|
|
19
38
|
},
|
|
20
39
|
"devDependencies": {
|
package/.cursor/rules/context.md
DELETED
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
# Cursor Rules for Customer Module Frontend
|
|
2
|
-
|
|
3
|
-
## Tech Stack & Architecture
|
|
4
|
-
|
|
5
|
-
- **Framework**: React 19.2+ with TypeScript
|
|
6
|
-
- **Build Tool**: Vite 7+
|
|
7
|
-
- **State Management**:
|
|
8
|
-
- Client state: Zustand
|
|
9
|
-
- Component state: React built-in hooks (useState, useReducer) for local component state
|
|
10
|
-
- **API Client**: Bifrost JS (@hiver/bifrost-js)
|
|
11
|
-
- **Routing**: React Router DOM (supports MemoryRouter for testing/embedded scenarios)
|
|
12
|
-
- **Styling**:
|
|
13
|
-
- Tailwind CSS v4 with `@tailwindcss/postcss` plugin
|
|
14
|
-
- PostCSS with autoprefixer
|
|
15
|
-
- Custom prefix support (e.g., `cm:` prefix for customer module)
|
|
16
|
-
- Use `tailwind-merge` for merging Tailwind classes
|
|
17
|
-
- **Code Quality**: ESLint with TypeScript support
|
|
18
|
-
|
|
19
|
-
## Code Style & Conventions
|
|
20
|
-
|
|
21
|
-
### TypeScript
|
|
22
|
-
- Use strict TypeScript typing - avoid `any` types
|
|
23
|
-
- Define types in `src/types/` directory
|
|
24
|
-
- Use type imports: `import type { ... }` for type-only imports
|
|
25
|
-
- Prefer interfaces for component props and object shapes
|
|
26
|
-
- Use type aliases for unions, primitives, and utility types
|
|
27
|
-
- Export types alongside their implementations
|
|
28
|
-
|
|
29
|
-
### React Components
|
|
30
|
-
- Use functional components with TypeScript
|
|
31
|
-
- Use PascalCase for component names and file names
|
|
32
|
-
- Define component props as interfaces extending React HTML attributes when needed
|
|
33
|
-
- Use default exports for components
|
|
34
|
-
- Prefer named exports for utilities, hooks, and types
|
|
35
|
-
- Use React.FC or explicit return types for components
|
|
36
|
-
- Always destructure props in function signature
|
|
37
|
-
|
|
38
|
-
### File Organization
|
|
39
|
-
```
|
|
40
|
-
src/
|
|
41
|
-
├── components/ # React components organized by feature (to be created)
|
|
42
|
-
│ ├── core/ # Reusable UI components (if needed)
|
|
43
|
-
│ └── [Feature]/ # Feature-specific components
|
|
44
|
-
├── hooks/ # Custom React hooks (prefixed with "use") (to be created)
|
|
45
|
-
├── services/ # API service functions (to be created)
|
|
46
|
-
├── stores/ # Zustand stores
|
|
47
|
-
├── types/ # TypeScript type definitions (to be created)
|
|
48
|
-
├── utils/ # Utility functions (to be created)
|
|
49
|
-
├── constants/ # Application constants (to be created)
|
|
50
|
-
├── assets/ # Static assets (images, icons, etc.)
|
|
51
|
-
├── App.tsx # Main application component
|
|
52
|
-
├── main.tsx # Application entry point
|
|
53
|
-
└── index.css # Global styles
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Naming Conventions
|
|
57
|
-
- **Components**: PascalCase (e.g., `PaymentFailedBanner.tsx`, `SCButton.tsx`)
|
|
58
|
-
- **Hooks**: camelCase starting with "use" (e.g., `usePlans.ts`, `useSubscription.ts`)
|
|
59
|
-
- **Services**: camelCase (e.g., `subscriptionApi.ts`, `fetchData.ts`)
|
|
60
|
-
- **Types/Interfaces**: PascalCase (e.g., `SubscriptionData`, `PlansApiResponse`)
|
|
61
|
-
- **Utils**: camelCase (e.g., `error.ts`, `planMapper.ts`)
|
|
62
|
-
- **Stores**: camelCase ending with "Store" (e.g., `subscriptionStore.ts`)
|
|
63
|
-
- **Constants**: UPPER_SNAKE_CASE for exported constants, camelCase for files
|
|
64
|
-
|
|
65
|
-
## Component Patterns
|
|
66
|
-
|
|
67
|
-
### UI Components
|
|
68
|
-
- Create reusable UI components in `src/components/core/` directory
|
|
69
|
-
- Use standard HTML elements with Tailwind CSS for styling
|
|
70
|
-
- Build custom components as needed for the application
|
|
71
|
-
- Components should be composable and reusable
|
|
72
|
-
|
|
73
|
-
### Tailwind CSS Usage
|
|
74
|
-
- Use Tailwind CSS v4 with `@tailwindcss/postcss` plugin
|
|
75
|
-
- Tailwind classes can use custom prefixes (e.g., `cm:` for customer module)
|
|
76
|
-
- Use Tailwind utility classes instead of inline styles
|
|
77
|
-
- Use `twMerge` from `tailwind-merge` when merging classes manually
|
|
78
|
-
- For component-specific styles, use CSS modules or regular CSS files
|
|
79
|
-
- Configure Tailwind in `tailwind.config.js`
|
|
80
|
-
|
|
81
|
-
### Styling Guidelines
|
|
82
|
-
- Prefer Tailwind utilities over custom CSS
|
|
83
|
-
- Use CSS modules or regular CSS files for complex component-specific styles
|
|
84
|
-
- Never use inline styles (`style={{ ... }}`)
|
|
85
|
-
- Use CSS variables when needed
|
|
86
|
-
- Maintain consistent spacing using Tailwind spacing scale
|
|
87
|
-
- PostCSS configuration is in `postcss.config.js` with `@tailwindcss/postcss` and `autoprefixer`
|
|
88
|
-
|
|
89
|
-
## State Management Patterns
|
|
90
|
-
|
|
91
|
-
### Client State (Zustand)
|
|
92
|
-
- Use Zustand stores for global client state
|
|
93
|
-
- Store files in `src/stores/` directory
|
|
94
|
-
- Use devtools middleware for development
|
|
95
|
-
- Follow the pattern:
|
|
96
|
-
```typescript
|
|
97
|
-
interface State {
|
|
98
|
-
data: DataType | null;
|
|
99
|
-
isLoading: boolean;
|
|
100
|
-
error: string | null;
|
|
101
|
-
setData: (data: DataType | null) => void;
|
|
102
|
-
fetchData: () => Promise<void>;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export const useStore = create<State>((set) => ({
|
|
106
|
-
data: null,
|
|
107
|
-
isLoading: false,
|
|
108
|
-
error: null,
|
|
109
|
-
setData: (data) => set({ data }),
|
|
110
|
-
fetchData: async () => {
|
|
111
|
-
set({ isLoading: true, error: null });
|
|
112
|
-
// Fetch logic here
|
|
113
|
-
},
|
|
114
|
-
}));
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Component State
|
|
118
|
-
- Use React built-in hooks for local component state:
|
|
119
|
-
- `useState` for simple component state
|
|
120
|
-
- `useReducer` for complex component state
|
|
121
|
-
- `useContext` for shared state within a component tree (prefer Zustand for global state)
|
|
122
|
-
|
|
123
|
-
## API & Service Layer
|
|
124
|
-
|
|
125
|
-
### Service Functions
|
|
126
|
-
- All API calls go through Bifrost JS (@hiver/bifrost-js)
|
|
127
|
-
- Create service files in `src/services/` directory
|
|
128
|
-
- Use Bifrost JS client for HTTP requests
|
|
129
|
-
- Service functions should be pure and not contain business logic
|
|
130
|
-
- Wrap API calls with error handling utilities
|
|
131
|
-
|
|
132
|
-
### Bifrost JS Usage
|
|
133
|
-
- Initialize Bifrost client in `src/services/bifrost.ts` or similar
|
|
134
|
-
- Use Bifrost for all API communication
|
|
135
|
-
- Follow Bifrost JS patterns and conventions
|
|
136
|
-
- Handle authentication and request/response interceptors through Bifrost
|
|
137
|
-
|
|
138
|
-
### Error Handling
|
|
139
|
-
- Always check for errors before using data
|
|
140
|
-
- Handle errors at the hook/component level, not in service functions
|
|
141
|
-
- Use try-catch blocks for error handling
|
|
142
|
-
- Display user-friendly error messages
|
|
143
|
-
- Leverage Bifrost JS error handling capabilities
|
|
144
|
-
|
|
145
|
-
### API Response Types
|
|
146
|
-
- Define all API response types in `src/types/api.ts`
|
|
147
|
-
- Follow consistent patterns for API responses
|
|
148
|
-
- Align types with Bifrost JS response structures
|
|
149
|
-
|
|
150
|
-
## Routing Patterns
|
|
151
|
-
|
|
152
|
-
### React Router
|
|
153
|
-
- Use React Router DOM for routing
|
|
154
|
-
- Support both BrowserRouter (production) and MemoryRouter (testing/embedded scenarios)
|
|
155
|
-
- **BrowserRouter**: Use for standalone applications with browser history
|
|
156
|
-
- **MemoryRouter**: Use for embedded scenarios, testing, or when you need to control history programmatically
|
|
157
|
-
- Define routes in `src/App.tsx` or a dedicated routes file
|
|
158
|
-
- Use `useNavigate`, `useParams`, `useLocation` hooks for navigation
|
|
159
|
-
|
|
160
|
-
## Hooks Patterns
|
|
161
|
-
|
|
162
|
-
### Custom Hooks
|
|
163
|
-
- Create hooks in `src/hooks/` directory
|
|
164
|
-
- Name hooks starting with "use" (e.g., `useCustomer`, `useData`)
|
|
165
|
-
- Hooks should encapsulate reusable logic
|
|
166
|
-
- Export hooks from `src/hooks/index.ts`
|
|
167
|
-
- Hooks can encapsulate:
|
|
168
|
-
- API calls using Bifrost JS
|
|
169
|
-
- Zustand store interactions
|
|
170
|
-
- React Router navigation
|
|
171
|
-
- Side effects and state logic
|
|
172
|
-
|
|
173
|
-
### Hook Structure
|
|
174
|
-
```typescript
|
|
175
|
-
export const useResource = () => {
|
|
176
|
-
const { data, isLoading, error, fetchData } = useStore();
|
|
177
|
-
|
|
178
|
-
useEffect(() => {
|
|
179
|
-
fetchData();
|
|
180
|
-
}, []);
|
|
181
|
-
|
|
182
|
-
return { data, isLoading, error };
|
|
183
|
-
};
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
## Type Safety
|
|
187
|
-
|
|
188
|
-
### Type Definitions
|
|
189
|
-
- Define types in `src/types/` directory
|
|
190
|
-
- Use descriptive type names ending with appropriate suffixes:
|
|
191
|
-
- `*ApiResponse` for API response types
|
|
192
|
-
- `*Request` for API request types
|
|
193
|
-
- `*Data` for data structures
|
|
194
|
-
- `*Props` for component props
|
|
195
|
-
- Export types alongside implementations
|
|
196
|
-
- Use discriminated unions for variant types
|
|
197
|
-
|
|
198
|
-
### Type Guards
|
|
199
|
-
- Create type guards for runtime type checking when needed
|
|
200
|
-
- Use TypeScript's type narrowing features
|
|
201
|
-
|
|
202
|
-
## Code Quality & Best Practices
|
|
203
|
-
|
|
204
|
-
### General Rules
|
|
205
|
-
- **NEVER** use `console.log` in production code (remove before committing)
|
|
206
|
-
- **NEVER** commit commented-out code unless it's clearly marked as temporary
|
|
207
|
-
- **NEVER** use `any` type - use `unknown` if type is truly unknown
|
|
208
|
-
- **NEVER** mutate state directly - always use immutable updates
|
|
209
|
-
- **NEVER** bypass error handling - always handle errors appropriately
|
|
210
|
-
- **ALWAYS** use TypeScript strict mode features
|
|
211
|
-
- **ALWAYS** handle loading and error states in components
|
|
212
|
-
- **ALWAYS** use proper TypeScript types
|
|
213
|
-
- **ALWAYS** use Zustand for global client state
|
|
214
|
-
- **ALWAYS** use Bifrost JS for API calls
|
|
215
|
-
|
|
216
|
-
### Performance
|
|
217
|
-
- Use `useMemo` for expensive computations
|
|
218
|
-
- Use `useCallback` for functions passed as props to memoized components
|
|
219
|
-
- Avoid unnecessary re-renders by properly managing dependencies
|
|
220
|
-
- Use Zustand selectors to prevent unnecessary re-renders
|
|
221
|
-
- Leverage Bifrost JS caching if available
|
|
222
|
-
|
|
223
|
-
### Accessibility
|
|
224
|
-
- Use semantic HTML elements
|
|
225
|
-
- Include proper ARIA labels when needed
|
|
226
|
-
- Ensure keyboard navigation works
|
|
227
|
-
- Maintain proper focus management in modals
|
|
228
|
-
|
|
229
|
-
### Testing Considerations
|
|
230
|
-
- Code should be testable - avoid side effects in pure functions
|
|
231
|
-
- Consider using MSW (Mock Service Worker) for API mocking in tests if needed
|
|
232
|
-
- Mock data should be in `src/mock/` or `src/mocks/` (to be created)
|
|
233
|
-
|
|
234
|
-
## Import Organization
|
|
235
|
-
|
|
236
|
-
### Import Order
|
|
237
|
-
1. React and React-related imports
|
|
238
|
-
2. Third-party library imports
|
|
239
|
-
3. Internal imports (components, hooks, services, utils, types, constants)
|
|
240
|
-
4. Type-only imports (use `import type`)
|
|
241
|
-
|
|
242
|
-
### Import Paths
|
|
243
|
-
- Use relative imports for files in the same directory or nearby
|
|
244
|
-
- Use absolute imports with path aliases if configured in `tsconfig.json` or `vite.config.ts`
|
|
245
|
-
- Prefer named imports over default imports for utilities
|
|
246
|
-
- Use default imports for components
|
|
247
|
-
|
|
248
|
-
## Best Practices
|
|
249
|
-
|
|
250
|
-
### ✅ DO
|
|
251
|
-
- Use Tailwind CSS utility classes for styling
|
|
252
|
-
- Use Zustand for global client state
|
|
253
|
-
- Use Bifrost JS for all API calls
|
|
254
|
-
- Use React Router for routing (BrowserRouter or MemoryRouter as needed)
|
|
255
|
-
- Handle loading and error states appropriately
|
|
256
|
-
- Use TypeScript strictly
|
|
257
|
-
- Follow the existing file structure
|
|
258
|
-
- Export types alongside implementations
|
|
259
|
-
- Use descriptive names for functions and variables
|
|
260
|
-
- Keep components small and focused
|
|
261
|
-
- Extract reusable logic into hooks or utils
|
|
262
|
-
- Use Zustand selectors to optimize re-renders
|
|
263
|
-
|
|
264
|
-
## Configuration Files
|
|
265
|
-
|
|
266
|
-
### Important Configs
|
|
267
|
-
- `tailwind.config.js` - Tailwind CSS v4 configuration
|
|
268
|
-
- `postcss.config.js` - PostCSS configuration with `@tailwindcss/postcss` and `autoprefixer`
|
|
269
|
-
- `vite.config.ts` - Vite build configuration
|
|
270
|
-
- `tsconfig.json` - TypeScript configuration (project references)
|
|
271
|
-
- `tsconfig.app.json` - TypeScript configuration for app code
|
|
272
|
-
- `tsconfig.node.json` - TypeScript configuration for Node.js files (vite.config.ts)
|
|
273
|
-
- `package.json` - Project dependencies and scripts
|
|
274
|
-
- `src/services/bifrost.ts` - Bifrost JS client configuration
|
|
275
|
-
|
|
276
|
-
## Environment & Build
|
|
277
|
-
|
|
278
|
-
- Use environment variables through Vite's `import.meta.env`
|
|
279
|
-
- Build outputs go to `dist/` directory
|
|
280
|
-
- Use Vite for development (`yarn dev`) and production builds (`yarn build`)
|
|
281
|
-
- PostCSS processes CSS with Tailwind and Autoprefixer
|
|
282
|
-
- Configure Bifrost JS with appropriate base URLs from environment variables
|
|
283
|
-
|
|
284
|
-
## Documentation
|
|
285
|
-
|
|
286
|
-
- Add JSDoc comments for complex functions and utilities
|
|
287
|
-
- Document component props with TypeScript interfaces
|
|
288
|
-
- Include usage examples in complex component files
|
|
289
|
-
- Keep README files updated
|
|
290
|
-
|
|
291
|
-
## Git & Version Control
|
|
292
|
-
|
|
293
|
-
- Follow conventional commit messages
|
|
294
|
-
- Use meaningful branch names
|
|
295
|
-
- Don't commit large files or build artifacts
|
|
296
|
-
- Don't commit `node_modules/` or `dist/` directories
|
|
297
|
-
- Consider using lint-staged for pre-commit checks if needed
|
|
298
|
-
|
|
299
|
-
## Package Management
|
|
300
|
-
|
|
301
|
-
- Uses `yarn` as the package manager
|
|
302
|
-
- Key dependencies:
|
|
303
|
-
- `zustand` - State management
|
|
304
|
-
- `@hiver/bifrost-js` - API client
|
|
305
|
-
- `react-router-dom` - Routing
|
|
306
|
-
- `tailwindcss` v4 - Styling
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Guardrails - Strict Rules & Constraints
|
|
2
|
-
|
|
3
|
-
These are **MANDATORY** rules that must be followed. Violations of these rules should be caught during code review.
|
|
4
|
-
|
|
5
|
-
## ❌ DO NOT
|
|
6
|
-
|
|
7
|
-
### Styling
|
|
8
|
-
- **Don't use inline styles** - use Tailwind or CSS
|
|
9
|
-
- **Don't forget the Tailwind prefix** - use custom prefixes (e.g., `cm:`) when configured
|
|
10
|
-
|
|
11
|
-
### API & Service Layer
|
|
12
|
-
- **Don't bypass the service layer** - always use service functions with Bifrost JS
|
|
13
|
-
- **Don't use `fetch` directly** - always use Bifrost JS for API calls
|
|
14
|
-
- **Don't hardcode API URLs** - use config from environment variables or config files
|
|
15
|
-
|
|
16
|
-
### State Management
|
|
17
|
-
- **Don't mutate Zustand state directly** - use setter functions
|
|
18
|
-
- **Don't create global state with Context API** - use Zustand instead
|
|
19
|
-
|
|
20
|
-
### TypeScript & Code Quality
|
|
21
|
-
- **Don't create components without proper TypeScript types**
|
|
22
|
-
- **Don't ignore TypeScript errors** - fix them properly
|
|
23
|
-
- **Don't use `any` type** - use `unknown` if type is truly unknown
|
|
24
|
-
- **Don't use `console.log` in production code** - remove before committing
|
|
25
|
-
|
|
26
|
-
### Code Organization
|
|
27
|
-
- **Don't create duplicate types** - reuse existing types
|
|
28
|
-
- **Don't commit debug code or commented-out code** - unless clearly marked as temporary
|
|
29
|
-
|
|
30
|
-
### Routing
|
|
31
|
-
- **Don't mix routing solutions** - use React Router consistently
|
|
32
|
-
|
|
33
|
-
### General
|
|
34
|
-
- **Don't mutate state directly** - always use immutable updates
|
|
35
|
-
- **Don't bypass error handling** - always handle errors appropriately
|
package/.env
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
UI_FRAMEWORK=primereact
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
name: "Beta Release Process"
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
# Allows manual triggering on ANY branch — including your feature branch
|
|
5
|
-
workflow_dispatch:
|
|
6
|
-
inputs:
|
|
7
|
-
version:
|
|
8
|
-
description: "Beta version number (e.g. 1.0.0-beta.1)"
|
|
9
|
-
required: true
|
|
10
|
-
type: string
|
|
11
|
-
|
|
12
|
-
env:
|
|
13
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
publish_beta:
|
|
17
|
-
name: Publish Beta to NPM Registry
|
|
18
|
-
runs-on: ubuntu-latest
|
|
19
|
-
steps:
|
|
20
|
-
- name: Checkout code
|
|
21
|
-
uses: actions/checkout@v2
|
|
22
|
-
|
|
23
|
-
- name: Use Node.js 20
|
|
24
|
-
uses: actions/setup-node@v3
|
|
25
|
-
with:
|
|
26
|
-
node-version: 20
|
|
27
|
-
registry-url: https://registry.npmjs.org/
|
|
28
|
-
always-auth: true
|
|
29
|
-
|
|
30
|
-
- name: Configure Git
|
|
31
|
-
run: |
|
|
32
|
-
git config --global user.name "engg-hiver"
|
|
33
|
-
git config --global user.email "engineering-dev@grexit.com"
|
|
34
|
-
|
|
35
|
-
- name: Configure NPM
|
|
36
|
-
run: |
|
|
37
|
-
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
38
|
-
npm config set git-tag-version=false
|
|
39
|
-
|
|
40
|
-
- name: Install dependencies
|
|
41
|
-
run: yarn install
|
|
42
|
-
|
|
43
|
-
- name: Build package
|
|
44
|
-
run: npm run build
|
|
45
|
-
|
|
46
|
-
- name: Update version
|
|
47
|
-
run: npm version ${{ inputs.version }} --no-git-tag-version
|
|
48
|
-
|
|
49
|
-
- name: Publish beta to NPM
|
|
50
|
-
run: npm publish --tag beta
|
|
51
|
-
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
name: "Release process initiated"
|
|
2
|
-
on:
|
|
3
|
-
release:
|
|
4
|
-
types: [published]
|
|
5
|
-
env:
|
|
6
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
changelog_prerelease:
|
|
10
|
-
name: Publish to NPM registry
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@v2
|
|
15
|
-
with:
|
|
16
|
-
ref: main
|
|
17
|
-
token: ${{ secrets.CI_SYSTEM_GITHUB_WORKFLOW }}
|
|
18
|
-
|
|
19
|
-
- name: Use Node.js 20
|
|
20
|
-
uses: actions/setup-node@v3
|
|
21
|
-
with:
|
|
22
|
-
node-version: 20
|
|
23
|
-
registry-url: https://registry.npmjs.org/
|
|
24
|
-
always-auth: true
|
|
25
|
-
|
|
26
|
-
- run: git config --global user.name "engg-hiver"
|
|
27
|
-
- run: git config --global user.email "engineering-dev@grexit.com"
|
|
28
|
-
- run: npm config set '//registry.npmjs.org/:_authToken'="${NPM_TOKEN}"
|
|
29
|
-
- run: npm config set git-tag-version=false
|
|
30
|
-
- run: yarn install
|
|
31
|
-
- run: npm run build
|
|
32
|
-
- run: npm version ${{ github.event.release.tag_name }}
|
|
33
|
-
|
|
34
|
-
- name: Publish to NPM
|
|
35
|
-
run: npm publish
|
|
36
|
-
|
|
37
|
-
- run: git pull
|
|
38
|
-
- run: git push
|
|
39
|
-
env:
|
|
40
|
-
github-token: ${{ secrets.CI_SYSTEM_GITHUB_WORKFLOW }}
|
|
41
|
-
|
|
42
|
-
- name: Update Changelog
|
|
43
|
-
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
|
|
44
|
-
with:
|
|
45
|
-
token: ${{ secrets.CI_SYSTEM_GITHUB_WORKFLOW }}
|
|
46
|
-
issues: true
|
|
47
|
-
issuesWoLabels: true
|
|
48
|
-
pullRequests: true
|
|
49
|
-
prWoLabels: true
|
|
50
|
-
unreleased: true
|
|
51
|
-
addSections: '{"documentation":{"prefix":"**Documentation:**","labels":["documentation"]}}'
|
|
52
|
-
|
|
53
|
-
- uses: stefanzweifel/git-auto-commit-action@v4
|
|
54
|
-
with:
|
|
55
|
-
commit_message: Update Changelog for PR
|
|
56
|
-
file_pattern: CHANGELOG.md package.json
|
|
57
|
-
env:
|
|
58
|
-
github-token: ${{ secrets.CI_SYSTEM_GITHUB_WORKFLOW }}
|
package/eslint.config.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js'
|
|
2
|
-
import globals from 'globals'
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
-
import tseslint from 'typescript-eslint'
|
|
6
|
-
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
7
|
-
|
|
8
|
-
export default defineConfig([
|
|
9
|
-
globalIgnores(['dist']),
|
|
10
|
-
{
|
|
11
|
-
files: ['**/*.{ts,tsx}'],
|
|
12
|
-
extends: [
|
|
13
|
-
js.configs.recommended,
|
|
14
|
-
tseslint.configs.recommended,
|
|
15
|
-
reactHooks.configs.flat.recommended,
|
|
16
|
-
reactRefresh.configs.vite,
|
|
17
|
-
],
|
|
18
|
-
languageOptions: {
|
|
19
|
-
ecmaVersion: 2020,
|
|
20
|
-
globals: globals.browser,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
])
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>customer-module-frontend</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/postcss-unwrap-layers.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PostCSS plugin to unwrap @layer directives and extract their contents
|
|
3
|
-
* This is needed because host applications may not support CSS cascade layers
|
|
4
|
-
*/
|
|
5
|
-
export default function unwrapLayersPlugin() {
|
|
6
|
-
return {
|
|
7
|
-
postcssPlugin: 'unwrap-layers',
|
|
8
|
-
AtRule: {
|
|
9
|
-
layer(atRule) {
|
|
10
|
-
// If the layer has no nodes (empty layer), remove it entirely
|
|
11
|
-
if (!atRule.nodes || atRule.nodes.length === 0) {
|
|
12
|
-
atRule.remove();
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Extract all child nodes from the @layer
|
|
17
|
-
const nodes = atRule.nodes;
|
|
18
|
-
|
|
19
|
-
// Insert all child nodes before the @layer rule
|
|
20
|
-
nodes.forEach(node => {
|
|
21
|
-
atRule.parent.insertBefore(atRule, node);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// Remove the now-empty @layer wrapper
|
|
25
|
-
atRule.remove();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
unwrapLayersPlugin.postcss = true;
|
package/postcss.config.js
DELETED
package/src/App.css
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#root {
|
|
2
|
-
margin: 0 auto;
|
|
3
|
-
text-align: center;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.logo {
|
|
7
|
-
height: 6em;
|
|
8
|
-
padding: 1.5em;
|
|
9
|
-
will-change: filter;
|
|
10
|
-
transition: filter 300ms;
|
|
11
|
-
}
|
|
12
|
-
.logo:hover {
|
|
13
|
-
filter: drop-shadow(0 0 2em #646cffaa);
|
|
14
|
-
}
|
|
15
|
-
.logo.react:hover {
|
|
16
|
-
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@keyframes logo-spin {
|
|
20
|
-
from {
|
|
21
|
-
transform: rotate(0deg);
|
|
22
|
-
}
|
|
23
|
-
to {
|
|
24
|
-
transform: rotate(360deg);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
29
|
-
a:nth-of-type(2) .logo {
|
|
30
|
-
animation: logo-spin infinite 20s linear;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.card {
|
|
35
|
-
padding: 2em;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.read-the-docs {
|
|
39
|
-
color: #888;
|
|
40
|
-
}
|
package/src/App.tsx
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Routes, Route, Navigate } from 'react-router-dom';
|
|
2
|
-
import CustomersLayout from './components/CustomersLayout';
|
|
3
|
-
import Accounts from './pages/Accounts';
|
|
4
|
-
import Contacts from './pages/Contacts';
|
|
5
|
-
import AccountDetail from './pages/AccountDetail';
|
|
6
|
-
import ContactDetail from './pages/ContactDetail';
|
|
7
|
-
import Conversation from './components/ContactConversation/Converation';
|
|
8
|
-
import './App.css';
|
|
9
|
-
|
|
10
|
-
// import { useCountStore } from './stores/count'
|
|
11
|
-
// import ConversationBox from './components/ConversationBox'
|
|
12
|
-
// import AccountTable from './components/Listing/AccountTable'
|
|
13
|
-
// import ContactTable from './components/Listing/ContactTable'
|
|
14
|
-
// import PrimaryContactsDilaog from './components/Contacts'
|
|
15
|
-
|
|
16
|
-
function App() {
|
|
17
|
-
return (
|
|
18
|
-
<>
|
|
19
|
-
<Routes>
|
|
20
|
-
<Route path="/conversation" element={<Conversation />} />
|
|
21
|
-
<Route element={<CustomersLayout />}>
|
|
22
|
-
<Route path="/" element={<Navigate to="/accounts" />} />
|
|
23
|
-
<Route path="/accounts" element={<Accounts />} />
|
|
24
|
-
<Route path="/contacts" element={<Contacts />} />
|
|
25
|
-
{/* <PrimaryContactsDilaog /> */}
|
|
26
|
-
{/* <AccountTable /> */}
|
|
27
|
-
{/* <ContactTable /> */}
|
|
28
|
-
{/* <ConversationBox
|
|
29
|
-
type="email"
|
|
30
|
-
heading="Issue with the app"
|
|
31
|
-
status="pending"
|
|
32
|
-
senderName="Ryan Reynolds"
|
|
33
|
-
timestamp="Feb 4, 02:45 PM"
|
|
34
|
-
messagePreview="I am having trouble with the app. It keeps crashing and I am losing data. Can you please help?"
|
|
35
|
-
mailboxName="Finance"
|
|
36
|
-
assignedAgent={{name: 'Andy Rue', avatarColor: '#5398CF', avatarInitial: 'A'}}
|
|
37
|
-
/>
|
|
38
|
-
<ConversationBox
|
|
39
|
-
type="chat"
|
|
40
|
-
status="open"
|
|
41
|
-
senderName="Blake Lively"
|
|
42
|
-
timestamp="Feb 4, 02:45 PM"
|
|
43
|
-
messagePreview="I am unable to access key features. The loading times are excessive, hindering my workflow. Can you please investigate?"
|
|
44
|
-
mailboxName="Sales"
|
|
45
|
-
assignedAgent={{name: 'Alice Adams', avatarColor: '#D04B4F', avatarInitial: 'A'}}
|
|
46
|
-
/> */}
|
|
47
|
-
|
|
48
|
-
{/* Details Pages */}
|
|
49
|
-
<Route path="/accounts/:accountId" element={<AccountDetail />} />
|
|
50
|
-
<Route path="/accounts/:accountId/contacts/:contactId" element={<ContactDetail />} />
|
|
51
|
-
<Route path="/contacts/:contactId" element={<ContactDetail />} />
|
|
52
|
-
</Route>
|
|
53
|
-
</Routes>
|
|
54
|
-
</>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default App;
|
package/src/assets/accounts.svg
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M5.33325 14V4.66667C5.33325 4.04669 5.33325 3.73669 5.4014 3.48236C5.58633 2.79218 6.12543 2.25308 6.81559 2.06815C7.06992 2 7.37992 2 7.99992 2C8.61992 2 8.92992 2 9.18425 2.06815C9.87439 2.25308 10.4135 2.79218 10.5985 3.48236C10.6666 3.73669 10.6666 4.04669 10.6666 4.66667V14M3.46659 14H12.5333C13.28 14 13.6534 14 13.9386 13.8547C14.1895 13.7269 14.3935 13.5229 14.5213 13.272C14.6666 12.9868 14.6666 12.6134 14.6666 11.8667V6.8C14.6666 6.05326 14.6666 5.67989 14.5213 5.39468C14.3935 5.14379 14.1895 4.93982 13.9386 4.81199C13.6534 4.66667 13.28 4.66667 12.5333 4.66667H3.46659C2.71985 4.66667 2.34648 4.66667 2.06127 4.81199C1.81038 4.93982 1.60641 5.14379 1.47858 5.39468C1.33325 5.67989 1.33325 6.05326 1.33325 6.8V11.8667C1.33325 12.6134 1.33325 12.9868 1.47858 13.272C1.60641 13.5229 1.81038 13.7269 2.06127 13.8547C2.34648 14 2.71985 14 3.46659 14Z" stroke="#334155" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|