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
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { Dialog, TextField } from "hiver-ui-kit-extended";
|
|
3
|
-
import BuildingsIcon from "../../assets/buildings.svg";
|
|
4
|
-
import Icon from "../Icon";
|
|
5
|
-
import searchIcon from "../../assets/search.svg";
|
|
6
|
-
|
|
7
|
-
// Dummy data array
|
|
8
|
-
const dummySearchResults = [
|
|
9
|
-
{
|
|
10
|
-
id: 1,
|
|
11
|
-
name: "John Doe",
|
|
12
|
-
email: "john.doe@example.com",
|
|
13
|
-
company: "Acme Corp",
|
|
14
|
-
lastContact: "2 days ago",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
id: 2,
|
|
18
|
-
name: "Jane Smith",
|
|
19
|
-
email: "jane.smith@example.com",
|
|
20
|
-
company: "Tech Solutions",
|
|
21
|
-
lastContact: "1 week ago",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 3,
|
|
25
|
-
name: "Mike Johnson",
|
|
26
|
-
email: "mike.j@example.com",
|
|
27
|
-
company: "Global Industries",
|
|
28
|
-
lastContact: "3 days ago",
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
interface SearchDialogProps {
|
|
33
|
-
open: boolean;
|
|
34
|
-
onClose: () => void;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const SearchDialog = ({ open, onClose }: SearchDialogProps) => {
|
|
38
|
-
const [searchQuery, setSearchQuery] = useState("");
|
|
39
|
-
const [searchResults, setSearchResults] = useState<typeof dummySearchResults>([]);
|
|
40
|
-
|
|
41
|
-
const handleSearchChange = (value: string) => {
|
|
42
|
-
setSearchQuery(value);
|
|
43
|
-
|
|
44
|
-
if (value.trim() === "") {
|
|
45
|
-
setSearchResults([]);
|
|
46
|
-
} else {
|
|
47
|
-
// Filter dummy data based on search query
|
|
48
|
-
const filtered = dummySearchResults.filter(
|
|
49
|
-
(item) =>
|
|
50
|
-
item.name.toLowerCase().includes(value.toLowerCase()) ||
|
|
51
|
-
item.email.toLowerCase().includes(value.toLowerCase()) ||
|
|
52
|
-
item.company.toLowerCase().includes(value.toLowerCase())
|
|
53
|
-
);
|
|
54
|
-
setSearchResults(filtered);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const StandardDialogContent = () => {
|
|
59
|
-
return (
|
|
60
|
-
<div className="flex items-center justify-center h-full">
|
|
61
|
-
<div className="cm:flex cm:flex-col cm:items-center cm:justify-center cm:gap-6">
|
|
62
|
-
<Icon name="search_typing" size={64} type="active" color="#0F172A" />
|
|
63
|
-
<div className="cm:text-label-small cm:text-slate-text-subtle">Start typing to search</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const SearchResults = () => {
|
|
70
|
-
return (
|
|
71
|
-
<div>
|
|
72
|
-
<div className="cm:text-slate-text-subtle cm:text-xs cm:font-medium cm:leading-[18px] cm:mb-2">
|
|
73
|
-
Accounts ({searchResults.length})
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
{searchResults.map((result) => (
|
|
77
|
-
<div key={result.id} className="cm:flex cm:py-1.5 cm:gap-1 cm:items-center">
|
|
78
|
-
<img src={BuildingsIcon} alt="Buildings" />
|
|
79
|
-
<div className="cm:text-slate-text-title cm:text-sm cm:font-medium cm:leading-5 cm:border-r cm:pr-1 cm:border-slate-border-light">
|
|
80
|
-
{result.company}
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<div className="cm:text-slate-text-subtle cm:text-xs cm:font-normal cm:leading-[18px]">
|
|
85
|
-
{result.email}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
))}
|
|
89
|
-
</div>
|
|
90
|
-
);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const Search = (
|
|
94
|
-
<TextField
|
|
95
|
-
placeholder="Search..."
|
|
96
|
-
className="cm:w-full search-input-custom"
|
|
97
|
-
iconPosition="left"
|
|
98
|
-
value={searchQuery}
|
|
99
|
-
onChange={(e) => {
|
|
100
|
-
handleSearchChange(e.target.value);
|
|
101
|
-
}}
|
|
102
|
-
icon={searchIcon}
|
|
103
|
-
/>
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<>
|
|
108
|
-
<style>{`
|
|
109
|
-
.search-input-custom,
|
|
110
|
-
.search-input-custom input,
|
|
111
|
-
.search-input-custom .p-inputtext,
|
|
112
|
-
.search-input-custom .omni-textfield-input {
|
|
113
|
-
border: none !important;
|
|
114
|
-
box-shadow: none !important;
|
|
115
|
-
outline: none !important;
|
|
116
|
-
}
|
|
117
|
-
.search-input-custom:hover,
|
|
118
|
-
.search-input-custom:focus,
|
|
119
|
-
.search-input-custom:focus-within,
|
|
120
|
-
.search-input-custom input:hover,
|
|
121
|
-
.search-input-custom input:focus,
|
|
122
|
-
.search-input-custom .p-inputtext:enabled:hover,
|
|
123
|
-
.search-input-custom .p-inputtext:enabled:focus,
|
|
124
|
-
.search-input-custom .omni-textfield-input:hover,
|
|
125
|
-
.search-input-custom .omni-textfield-input:focus {
|
|
126
|
-
border: none !important;
|
|
127
|
-
box-shadow: none !important;
|
|
128
|
-
outline: none !important;
|
|
129
|
-
}
|
|
130
|
-
`}</style>
|
|
131
|
-
<Dialog
|
|
132
|
-
open={open}
|
|
133
|
-
variant="standard"
|
|
134
|
-
onClose={onClose}
|
|
135
|
-
onBack={onClose}
|
|
136
|
-
maxWidth="sm"
|
|
137
|
-
title={Search}
|
|
138
|
-
className="cm:bg-slate-surface-white cm:h-[360px] cm:w-[460px]"
|
|
139
|
-
>
|
|
140
|
-
{searchResults.length === 0 ? (
|
|
141
|
-
<StandardDialogContent />
|
|
142
|
-
) : (
|
|
143
|
-
<SearchResults />
|
|
144
|
-
)}
|
|
145
|
-
</Dialog>
|
|
146
|
-
</>
|
|
147
|
-
);
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export default SearchDialog;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Tabs } from 'hiver-ui-kit-extended';
|
|
2
|
-
import { useLocation, useNavigate } from 'react-router-dom';
|
|
3
|
-
import Icon from '../Icon';
|
|
4
|
-
|
|
5
|
-
export default function TabsSection() {
|
|
6
|
-
const location = useLocation();
|
|
7
|
-
const navigate = useNavigate();
|
|
8
|
-
|
|
9
|
-
const paths = ['/accounts', '/contacts'];
|
|
10
|
-
const activeIndex = paths.findIndex((path) =>
|
|
11
|
-
location.pathname.startsWith(path)
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
const isActive = (index: number) => index === activeIndex;
|
|
15
|
-
|
|
16
|
-
const items = [
|
|
17
|
-
{
|
|
18
|
-
label: (
|
|
19
|
-
<div className="cm:flex cm:items-center cm:gap-2">
|
|
20
|
-
<Icon name="accounts" size={16} type="active" color={isActive(0) ? '#0F172A' : '#64758B'} />
|
|
21
|
-
Accounts
|
|
22
|
-
</div>
|
|
23
|
-
) as unknown as string,
|
|
24
|
-
content: '',
|
|
25
|
-
path: '/accounts'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: (
|
|
29
|
-
<div className="cm:flex cm:items-center cm:gap-2">
|
|
30
|
-
<Icon name="contacts" size={16} type="active" color={isActive(1) ? '#0F172A' : '#64758B'} />
|
|
31
|
-
Contacts
|
|
32
|
-
</div>
|
|
33
|
-
) as unknown as string,
|
|
34
|
-
content: '',
|
|
35
|
-
path: '/contacts'
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
const onTabChange = (e: any) => {
|
|
40
|
-
navigate(items[e.index].path);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div className="cm:mb-6">
|
|
45
|
-
<style>{`.p-tabview-panels { display: none; }`}</style>
|
|
46
|
-
<Tabs value={activeIndex} onTabChange={onTabChange} items={items} />
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
}
|