@eka-care/abdm-dashboard-stg 0.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/README.md +73 -0
- package/eslint.config.js +23 -0
- package/index.html +27 -0
- package/package.json +46 -0
- package/postcss.config.js +6 -0
- package/public/headerImg.png +0 -0
- package/public/iphoneStep2.png +0 -0
- package/public/iphoneStep3.png +0 -0
- package/public/vite.svg +1 -0
- package/src/abdm-dashboard.tsx +18 -0
- package/src/app/store.ts +15 -0
- package/src/appointment-token-pdf/pdf-page1.tsx +324 -0
- package/src/appointment-token-pdf/pdf-page2.tsx +346 -0
- package/src/assets/react.svg +1 -0
- package/src/components/abha-metric.tsx +322 -0
- package/src/components/abha-workflows.tsx +225 -0
- package/src/components/automate-strip.tsx +29 -0
- package/src/components/cards/metric-card.tsx +75 -0
- package/src/components/cards/request-card.tsx +23 -0
- package/src/components/cards/request-cards.tsx +24 -0
- package/src/components/cards/workflow-card.tsx +55 -0
- package/src/components/custom/calendar.tsx +59 -0
- package/src/components/custom/switch.tsx +32 -0
- package/src/components/loader/abdm-dash-loader.tsx +21 -0
- package/src/components/loader/card-loader.tsx +20 -0
- package/src/components/modal/automateTaks-modal.tsx +110 -0
- package/src/components/modal/modal.tsx +67 -0
- package/src/components/modal/select-lang-modal.tsx +38 -0
- package/src/components/notification-header.tsx +11 -0
- package/src/features/api/baseApi.ts +23 -0
- package/src/features/cardApis/cardApi.ts +15 -0
- package/src/features/landingApi/landingApi.ts +20 -0
- package/src/features/slice/landingApiSlice.ts +49 -0
- package/src/features/tasksApis/taskGetApi.ts +12 -0
- package/src/features/tasksApis/taskUpdateApi.ts +15 -0
- package/src/home.tsx +132 -0
- package/src/index.css +297 -0
- package/src/main.tsx +107 -0
- package/src/tailwind-theme-config/pds2/border.ts +69 -0
- package/src/tailwind-theme-config/pds2/colors.ts +88 -0
- package/src/tailwind-theme-config/pds2/spacing.ts +1007 -0
- package/src/types/pagify-sdk.d.ts +17 -0
- package/src/utils/constants.ts +19 -0
- package/src/utils/helpers.ts +32 -0
- package/tailwind.config.ts +131 -0
- package/tsconfig.app.json +28 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +62 -0
package/src/home.tsx
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import AbhaMetric from "./components/abha-metric";
|
|
3
|
+
import AbhaWorkFlows from "./components/abha-workflows";
|
|
4
|
+
import AutomateStrip from "./components/automate-strip";
|
|
5
|
+
import Modal from "./components/modal/modal";
|
|
6
|
+
import NotificationHeader from "./components/notification-header";
|
|
7
|
+
import { useLandingApiQuery } from "./features/landingApi/landingApi";
|
|
8
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
9
|
+
import {
|
|
10
|
+
getShowAutomateStrip,
|
|
11
|
+
setClinicId,
|
|
12
|
+
setDashboardData,
|
|
13
|
+
setHfrId,
|
|
14
|
+
setQrUrl,
|
|
15
|
+
setShowAutomateStrip,
|
|
16
|
+
} from "./features/slice/landingApiSlice";
|
|
17
|
+
import Loader from "./components/loader/abdm-dash-loader";
|
|
18
|
+
import { useTaskGetApiQuery } from "./features/tasksApis/taskGetApi";
|
|
19
|
+
// import RequestCards from "./components/request-cards";
|
|
20
|
+
|
|
21
|
+
const Home = ({
|
|
22
|
+
clinicId,
|
|
23
|
+
clientId,
|
|
24
|
+
}: {
|
|
25
|
+
clinicId: string;
|
|
26
|
+
clientId: string;
|
|
27
|
+
}) => {
|
|
28
|
+
console.log("recieved clinicId, clientId", clinicId, clientId);
|
|
29
|
+
|
|
30
|
+
const dispatch = useDispatch();
|
|
31
|
+
const showAutomateStrip = useSelector(getShowAutomateStrip);
|
|
32
|
+
const { data: taskApiData, isSuccess: taskApiSuccess } = useTaskGetApiQuery(
|
|
33
|
+
clinicId ?? ""
|
|
34
|
+
);
|
|
35
|
+
const [showModal, setShowModal] = useState<boolean>(false);
|
|
36
|
+
const [showAbhaSDK, setShowAbhaSDK] = useState<boolean>(false);
|
|
37
|
+
const [showAutomateModal, setShowAutomateModal] = useState<boolean>(false);
|
|
38
|
+
const [showWorkFlowIframe, setShowWorkflowIframe] = useState<boolean>(false);
|
|
39
|
+
const { data, isSuccess, isLoading, refetch } = useLandingApiQuery(clinicId, {
|
|
40
|
+
refetchOnMountOrArgChange: true,
|
|
41
|
+
refetchOnFocus: false,
|
|
42
|
+
refetchOnReconnect: false,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
dispatch(setClinicId(clinicId));
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (isSuccess && data) {
|
|
51
|
+
dispatch(setDashboardData(data.data));
|
|
52
|
+
dispatch(setQrUrl(data.data?.scan_url));
|
|
53
|
+
dispatch(setHfrId(data.data?.hip_id));
|
|
54
|
+
}
|
|
55
|
+
}, [isSuccess, data, dispatch]);
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (taskApiSuccess && taskApiData?.messaging) {
|
|
59
|
+
if (
|
|
60
|
+
taskApiData.messaging.kyc &&
|
|
61
|
+
taskApiData.messaging.abha &&
|
|
62
|
+
taskApiData.messaging.consent
|
|
63
|
+
) {
|
|
64
|
+
dispatch(setShowAutomateStrip(false));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, [taskApiSuccess, taskApiData]);
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
function handleMessage(event: MessageEvent) {
|
|
71
|
+
const msg = event.data;
|
|
72
|
+
|
|
73
|
+
if (!msg || typeof msg !== "object") return;
|
|
74
|
+
|
|
75
|
+
if (msg.type === "ON_HFR_CREATED_SUCCESSFULLY") {
|
|
76
|
+
console.log("Received ON_HFR_CREATED_SUCCESSFULLY → Refetching API...");
|
|
77
|
+
refetch();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
window.addEventListener("message", handleMessage);
|
|
82
|
+
|
|
83
|
+
return () => {
|
|
84
|
+
window.removeEventListener("message", handleMessage);
|
|
85
|
+
};
|
|
86
|
+
}, [refetch]);
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<div className="abhaDash-w-full abhaDash-h-full abhaDash-relative abhaDash-overflow-auto">
|
|
91
|
+
{isLoading ? (
|
|
92
|
+
<Loader />
|
|
93
|
+
) : isSuccess ? (
|
|
94
|
+
<>
|
|
95
|
+
<NotificationHeader />
|
|
96
|
+
<AbhaMetric />
|
|
97
|
+
{showAutomateStrip && (
|
|
98
|
+
<AutomateStrip setShowAutomateModal={setShowAutomateModal} />
|
|
99
|
+
)}
|
|
100
|
+
{/* <RequestCards/> */}
|
|
101
|
+
<AbhaWorkFlows
|
|
102
|
+
setShowAbhaSDK={setShowAbhaSDK}
|
|
103
|
+
setShowWorkflowIframe={setShowWorkflowIframe}
|
|
104
|
+
// setShowModal={setShowModal}
|
|
105
|
+
/>
|
|
106
|
+
{(showModal ||
|
|
107
|
+
showAutomateModal ||
|
|
108
|
+
showAbhaSDK ||
|
|
109
|
+
showWorkFlowIframe) && (
|
|
110
|
+
<Modal
|
|
111
|
+
showAbhaSDK={showAbhaSDK}
|
|
112
|
+
setShowAbhaSDK={setShowAbhaSDK}
|
|
113
|
+
showModal={showModal}
|
|
114
|
+
showAutomateModal={showAutomateModal}
|
|
115
|
+
setShowModal={setShowModal}
|
|
116
|
+
setShowAutomateModal={setShowAutomateModal}
|
|
117
|
+
setShowWorkflowIframe={setShowWorkflowIframe}
|
|
118
|
+
showWorkflowIframe={showWorkFlowIframe}
|
|
119
|
+
/>
|
|
120
|
+
)}
|
|
121
|
+
</>
|
|
122
|
+
) : (
|
|
123
|
+
<iframe
|
|
124
|
+
className="abhaDash-w-full abhaDash-h-full"
|
|
125
|
+
src="https://product.eka.care/dhis"
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export default Home;
|
package/src/index.css
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
#root {
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100vw;
|
|
8
|
+
}
|
|
9
|
+
#abdm-root {
|
|
10
|
+
height: 100vh;
|
|
11
|
+
width: 100vw;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
@apply abhaDash-font-lato;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@layer base {
|
|
19
|
+
.AbhaTitleHeadline {
|
|
20
|
+
@apply abhaDash-font-700 abhaDash-text-34 abhaDash-leading-44;
|
|
21
|
+
}
|
|
22
|
+
.AbhaTitle2Headline {
|
|
23
|
+
@apply abhaDash-font-700 abhaDash-text-14 abhaDash-leading-20;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.AbhaTitle4Headline {
|
|
27
|
+
@apply abhaDash-font-700 abhaDash-text-16 abhaDash-leading-20;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.AbhaTitle3Headline {
|
|
31
|
+
@apply abhaDash-font-700 abhaDash-text-13 abhaDash-leading-16;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.AbhaTitlesSubheadline {
|
|
35
|
+
@apply abhaDash-font-700 abhaDash-text-24 abhaDash-leading-32;
|
|
36
|
+
}
|
|
37
|
+
.AbhaTitle2Subheadline {
|
|
38
|
+
@apply abhaDash-font-700 abhaDash-text-20 abhaDash-leading-32;
|
|
39
|
+
}
|
|
40
|
+
.AbhaBodyBody {
|
|
41
|
+
@apply abhaDash-font-400 abhaDash-text-16 abhaDash-leading-22;
|
|
42
|
+
}
|
|
43
|
+
.AbhaDisplayRegular {
|
|
44
|
+
@apply abhaDash-font-400 abhaDash-text-34 abhaDash-leading-44;
|
|
45
|
+
}
|
|
46
|
+
.AbhaDisplayMedium {
|
|
47
|
+
@apply abhaDash-font-500 abhaDash-text-32 abhaDash-leading-40;
|
|
48
|
+
}
|
|
49
|
+
.AbhaDisplaySemibold {
|
|
50
|
+
@apply abhaDash-font-600 abhaDash-text-32 abhaDash-leading-40;
|
|
51
|
+
}
|
|
52
|
+
.AbhaHeading2Medium {
|
|
53
|
+
@apply abhaDash-font-500 abhaDash-text-24 abhaDash-leading-32;
|
|
54
|
+
}
|
|
55
|
+
.AbhaHeading2Semibold {
|
|
56
|
+
@apply abhaDash-font-600 abhaDash-text-24 abhaDash-leading-32;
|
|
57
|
+
}
|
|
58
|
+
.AbhaHeading3Semibold {
|
|
59
|
+
@apply abhaDash-font-600 abhaDash-text-20 abhaDash-leading-28;
|
|
60
|
+
}
|
|
61
|
+
.AbhaHeading4Semibold {
|
|
62
|
+
@apply abhaDash-font-600 abhaDash-text-18 abhaDash-leading-24;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.AbhaBody1Semibold {
|
|
66
|
+
@apply abhaDash-font-600 abhaDash-text-16 abhaDash-leading-24;
|
|
67
|
+
}
|
|
68
|
+
.AbhaBody2Semibold {
|
|
69
|
+
@apply abhaDash-font-600 abhaDash-text-14 abhaDash-leading-20;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.AbhaBody1Regular {
|
|
73
|
+
@apply abhaDash-font-400 abhaDash-text-16 abhaDash-leading-24;
|
|
74
|
+
}
|
|
75
|
+
.AbhaBody2Regular {
|
|
76
|
+
@apply abhaDash-font-400 abhaDash-text-14 abhaDash-leading-20;
|
|
77
|
+
}
|
|
78
|
+
.AbhaBody2Medium {
|
|
79
|
+
@apply abhaDash-font-500 abhaDash-text-14 abhaDash-leading-20;
|
|
80
|
+
}
|
|
81
|
+
.AbhaBody3Regular {
|
|
82
|
+
@apply abhaDash-font-400 abhaDash-text-12 abhaDash-leading-16;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.AbhaBody4Regular {
|
|
86
|
+
@apply abhaDash-font-400 abhaDash-text-10 abhaDash-leading-16;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.AbhaBody4Medium {
|
|
90
|
+
@apply abhaDash-font-500 abhaDash-text-10 abhaDash-leading-16;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.AbhaBody3Medium {
|
|
94
|
+
@apply abhaDash-font-500 abhaDash-text-12 abhaDash-leading-16;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.AbhaBody3Semibold {
|
|
98
|
+
@apply abhaDash-font-600 abhaDash-text-12 abhaDash-leading-16;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.AbhaBody3CapsRegular {
|
|
102
|
+
@apply abhaDash-font-400 abhaDash-text-12 abhaDash-leading-16 abhaDash-uppercase abhaDash-tracking-[0.Abha96px];
|
|
103
|
+
}
|
|
104
|
+
.AbhaBody3CapsSemibold {
|
|
105
|
+
@apply abhaDash-font-600 abhaDash-text-12 abhaDash-leading-16 abhaDash-uppercase abhaDash-tracking-[0.Abha96px];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.AbhaBodyFootnote {
|
|
109
|
+
@apply abhaDash-font-400 abhaDash-text-13 abhaDash-leading-18;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.AbhaBodyInputLabel {
|
|
113
|
+
@apply abhaDash-font-400 abhaDash-text-12 abhaDash-leading-12;
|
|
114
|
+
}
|
|
115
|
+
.AbhaLabel1Semibold {
|
|
116
|
+
@apply abhaDash-font-600 abhaDash-text-10 abhaDash-leading-14;
|
|
117
|
+
}
|
|
118
|
+
.AbhaLabel2Medium {
|
|
119
|
+
@apply abhaDash-font-500 abhaDash-text-10 abhaDash-leading-12;
|
|
120
|
+
}
|
|
121
|
+
.AbhaLabel2Regular {
|
|
122
|
+
@apply abhaDash-font-400 abhaDash-text-10 abhaDash-leading-12;
|
|
123
|
+
}
|
|
124
|
+
.AbhaSubheadlineRegular {
|
|
125
|
+
@apply abhaDash-font-400 abhaDash-text-14 abhaDash-leading-20;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* loader styling */
|
|
130
|
+
.abhaDash_loading svg polyline {
|
|
131
|
+
fill: none;
|
|
132
|
+
stroke-width: 3;
|
|
133
|
+
stroke-linecap: round;
|
|
134
|
+
stroke-linejoin: round;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.abhaDash_loading svg polyline#back {
|
|
138
|
+
fill: none;
|
|
139
|
+
stroke: #62c359;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.abhaDash_loading svg polyline#front {
|
|
143
|
+
fill: none;
|
|
144
|
+
stroke: #018d41;
|
|
145
|
+
stroke-dasharray: 48, 144;
|
|
146
|
+
stroke-dashoffset: 192;
|
|
147
|
+
animation: dash_682 1.4s linear infinite;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@keyframes dash_682 {
|
|
151
|
+
72.5% {
|
|
152
|
+
opacity: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
to {
|
|
156
|
+
stroke-dashoffset: 0;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
.react-date-picker__wrapper {
|
|
160
|
+
border: none !important;
|
|
161
|
+
}
|
|
162
|
+
.react-calendar {
|
|
163
|
+
width: 290px !important;
|
|
164
|
+
border-radius: 16px;
|
|
165
|
+
overflow: auto;
|
|
166
|
+
border: 0px !important;
|
|
167
|
+
padding: 0px 5px 5px 5px;
|
|
168
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
|
|
169
|
+
@apply abhaDash-font-500;
|
|
170
|
+
}
|
|
171
|
+
.react-calendar__tile {
|
|
172
|
+
/* padding: 12px !important ; */
|
|
173
|
+
border-radius: 24px;
|
|
174
|
+
}
|
|
175
|
+
.react-calendar > button:hover {
|
|
176
|
+
background: #000 !important;
|
|
177
|
+
}
|
|
178
|
+
.react-calendar__tile:disabled {
|
|
179
|
+
background-color: transparent !important;
|
|
180
|
+
}
|
|
181
|
+
.react-calendar__tile--now {
|
|
182
|
+
background: transparent !important;
|
|
183
|
+
}
|
|
184
|
+
.react-calendar__tile--now:hover {
|
|
185
|
+
background: #e6e6e6 !important;
|
|
186
|
+
}
|
|
187
|
+
.react-calendar__tile--now > abbr {
|
|
188
|
+
border-bottom: 1px solid #000 !important;
|
|
189
|
+
}
|
|
190
|
+
.react-calendar__tile--active {
|
|
191
|
+
background-color: #62c359 !important;
|
|
192
|
+
}
|
|
193
|
+
.react-calendar__tile--active > abbr {
|
|
194
|
+
border-color: white !important;
|
|
195
|
+
}
|
|
196
|
+
.react-calendar__month-view__days__day--weekend:disabled {
|
|
197
|
+
color: #cdcdcd !important;
|
|
198
|
+
}
|
|
199
|
+
abbr:where([title]) {
|
|
200
|
+
text-decoration: none !important;
|
|
201
|
+
}
|
|
202
|
+
.react-calendar__tile--hasActive {
|
|
203
|
+
background-color: #62c359 !important;
|
|
204
|
+
color: white !important;
|
|
205
|
+
border-color: white !important;
|
|
206
|
+
}
|
|
207
|
+
.react-calendar__tile--hasActive > abbr {
|
|
208
|
+
border-bottom: 1px solid white !important;
|
|
209
|
+
}
|
|
210
|
+
.react-date-picker__inputGroup__input:invalid {
|
|
211
|
+
background-color: transparent !important;
|
|
212
|
+
}
|
|
213
|
+
.react-date-picker--disabled {
|
|
214
|
+
background-color: transparent !important;
|
|
215
|
+
}
|
|
216
|
+
.custom-date-wrapper {
|
|
217
|
+
position: relative;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.custom-date-placeholder {
|
|
221
|
+
position: absolute;
|
|
222
|
+
top: 50%;
|
|
223
|
+
left: 14px;
|
|
224
|
+
transform: translateY(-50%);
|
|
225
|
+
color: #9ca3af;
|
|
226
|
+
pointer-events: none;
|
|
227
|
+
z-index: 10;
|
|
228
|
+
font-size: 14px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* Hide input group (numbers) when value is null */
|
|
232
|
+
.date-empty .react-date-picker__inputGroup {
|
|
233
|
+
opacity: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* Hide day/month/year fields */
|
|
237
|
+
.date-empty .react-date-picker__inputGroup__input {
|
|
238
|
+
opacity: 0;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* Hide / dividers */
|
|
242
|
+
.date-empty .react-date-picker__inputGroup__divider {
|
|
243
|
+
opacity: 0;
|
|
244
|
+
}
|
|
245
|
+
.react-date-picker__button {
|
|
246
|
+
padding-right: 0px !important;
|
|
247
|
+
padding-left: 0px !important;
|
|
248
|
+
}
|
|
249
|
+
.react-date-picker__inputGroup {
|
|
250
|
+
padding-right: 0px !important;
|
|
251
|
+
padding-left: 0px !important;
|
|
252
|
+
}
|
|
253
|
+
.react-calendar__navigation {
|
|
254
|
+
width: 100%;
|
|
255
|
+
margin-bottom: 5px !important;
|
|
256
|
+
padding: 0px 10px;
|
|
257
|
+
/* height: 0 !important;
|
|
258
|
+
padding: 20px 0px; */
|
|
259
|
+
}
|
|
260
|
+
.react-calendar__navigation > button:disabled {
|
|
261
|
+
visibility: hidden !important;
|
|
262
|
+
}
|
|
263
|
+
.react-calendar__navigation > button:active {
|
|
264
|
+
background-color: transparent !important;
|
|
265
|
+
}
|
|
266
|
+
.react-calendar__navigation__label__labelText:hover {
|
|
267
|
+
background-color: #e6e6e6 !important;
|
|
268
|
+
padding: 5px 10px;
|
|
269
|
+
border-radius: 24px;
|
|
270
|
+
}
|
|
271
|
+
.react-calendar__navigation__label:enabled:hover {
|
|
272
|
+
background-color: transparent !important;
|
|
273
|
+
}
|
|
274
|
+
.react-calendar__navigation__label:enabled:focus {
|
|
275
|
+
background-color: transparent !important;
|
|
276
|
+
}
|
|
277
|
+
.react-calendar__navigation button {
|
|
278
|
+
min-width: 30px !important;
|
|
279
|
+
}
|
|
280
|
+
.react-calendar__navigation__arrow:enabled:hover {
|
|
281
|
+
border-radius: 50% !important;
|
|
282
|
+
height: 30px !important;
|
|
283
|
+
padding: 5px !important;
|
|
284
|
+
background-color: #e6e6e6 !important;
|
|
285
|
+
margin-top: 8px !important;
|
|
286
|
+
}
|
|
287
|
+
.react-calendar__navigation__arrow:enabled:focus {
|
|
288
|
+
border-radius: 50% !important;
|
|
289
|
+
height: 30px !important;
|
|
290
|
+
padding: 5px !important;
|
|
291
|
+
background-color: #e6e6e6 !important;
|
|
292
|
+
margin-top: 8px !important;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.react-calendar__year-view .react-calendar__tile, .react-calendar__decade-view .react-calendar__tile, .react-calendar__century-view .react-calendar__tile{
|
|
296
|
+
padding: 9px !important;
|
|
297
|
+
}
|
package/src/main.tsx
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { createRoot, type Root } from "react-dom/client";
|
|
2
|
+
import "./index.css";
|
|
3
|
+
import AbdmDashboard from "./abdm-dashboard.tsx";
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
interface Window {
|
|
7
|
+
Bridge: new () => any;
|
|
8
|
+
initAbhaApp?: (params: {
|
|
9
|
+
clientId: string;
|
|
10
|
+
containerId: string;
|
|
11
|
+
method: string;
|
|
12
|
+
data?: Record<string, any>;
|
|
13
|
+
onSuccess: (params: any) => void;
|
|
14
|
+
onError: (params: any) => void;
|
|
15
|
+
onAbhaClose: () => void;
|
|
16
|
+
}) => void;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Stores mounted roots
|
|
21
|
+
const roots: Map<string, Root> = new Map();
|
|
22
|
+
|
|
23
|
+
interface MountOptions {
|
|
24
|
+
clinicId?: string;
|
|
25
|
+
clientId?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface MountResult {
|
|
29
|
+
id: string;
|
|
30
|
+
unmount: () => boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function ensureContainer(id: string): HTMLElement {
|
|
34
|
+
let el = document.getElementById(id);
|
|
35
|
+
if (!el) {
|
|
36
|
+
el = document.createElement("div");
|
|
37
|
+
el.id = id;
|
|
38
|
+
document.body.appendChild(el);
|
|
39
|
+
}
|
|
40
|
+
return el;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function mountABDMDashboard(
|
|
44
|
+
elementId = "abdm-dashboard-root",
|
|
45
|
+
options: MountOptions = {}
|
|
46
|
+
): MountResult {
|
|
47
|
+
const id = elementId;
|
|
48
|
+
const {
|
|
49
|
+
clinicId = "default-clinic",
|
|
50
|
+
clientId = "default-client",
|
|
51
|
+
} = options;
|
|
52
|
+
|
|
53
|
+
const container = ensureContainer(id);
|
|
54
|
+
|
|
55
|
+
if (roots.has(id)) {
|
|
56
|
+
return {
|
|
57
|
+
id,
|
|
58
|
+
unmount: () => unmountABDMDashboard(id),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const root = createRoot(container);
|
|
63
|
+
roots.set(id, root);
|
|
64
|
+
|
|
65
|
+
root.render(<AbdmDashboard clinicId={clinicId} clientId={clientId} />);
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
id,
|
|
69
|
+
unmount: () => unmountABDMDashboard(id),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function unmountABDMDashboard(
|
|
74
|
+
elementId = "abdm-dashboard-root"
|
|
75
|
+
): boolean {
|
|
76
|
+
const id = elementId;
|
|
77
|
+
const root = roots.get(id);
|
|
78
|
+
|
|
79
|
+
if (!root) return false;
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
root.unmount();
|
|
83
|
+
roots.delete(id);
|
|
84
|
+
return true;
|
|
85
|
+
} catch (e) {
|
|
86
|
+
console.error("abdmDashboard: unmount failed", e);
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
export const __attachToWindow = (() => {
|
|
93
|
+
try {
|
|
94
|
+
const w = window as any;
|
|
95
|
+
w.abdmDashboardMount = mountABDMDashboard;
|
|
96
|
+
w.abdmDashboardUnmount = unmountABDMDashboard;
|
|
97
|
+
} catch (e) {
|
|
98
|
+
console.error(e);
|
|
99
|
+
}
|
|
100
|
+
})();
|
|
101
|
+
|
|
102
|
+
export default function abdmDashboard(
|
|
103
|
+
name: string,
|
|
104
|
+
options?: MountOptions
|
|
105
|
+
): MountResult {
|
|
106
|
+
return mountABDMDashboard(name, options);
|
|
107
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const borders = {
|
|
2
|
+
none: "0px",
|
|
3
|
+
DEFAULT: "0.0625rem",
|
|
4
|
+
0.5: "0.03125rem",
|
|
5
|
+
1: "0.0625rem",
|
|
6
|
+
2: "0.125rem",
|
|
7
|
+
3: "0.1875rem",
|
|
8
|
+
4: "0.25rem",
|
|
9
|
+
5: "0.3125rem",
|
|
10
|
+
6: "0.375rem",
|
|
11
|
+
7: "0.4375rem",
|
|
12
|
+
8: "0.5rem",
|
|
13
|
+
9: "0.5625rem",
|
|
14
|
+
10: "0.625rem",
|
|
15
|
+
11: "0.6875rem",
|
|
16
|
+
12: "0.75rem",
|
|
17
|
+
13: "0.8125rem",
|
|
18
|
+
14: "0.875rem",
|
|
19
|
+
15: "0.9375rem",
|
|
20
|
+
16: "1.0rem",
|
|
21
|
+
17: "1.0625rem",
|
|
22
|
+
18: "1.125rem",
|
|
23
|
+
19: "1.1875rem",
|
|
24
|
+
20: "1.25rem",
|
|
25
|
+
21: "1.3125rem",
|
|
26
|
+
22: "1.375rem",
|
|
27
|
+
23: "1.4375rem",
|
|
28
|
+
24: "1.5rem",
|
|
29
|
+
25: "1.5625rem",
|
|
30
|
+
26: "1.625rem",
|
|
31
|
+
27: "1.6875rem",
|
|
32
|
+
28: "1.75rem",
|
|
33
|
+
29: "1.8125rem",
|
|
34
|
+
30: "1.875rem",
|
|
35
|
+
31: "1.9375rem",
|
|
36
|
+
32: "2.0rem",
|
|
37
|
+
33: "2.0625rem",
|
|
38
|
+
34: "2.125rem",
|
|
39
|
+
35: "2.1875rem",
|
|
40
|
+
36: "2.25rem",
|
|
41
|
+
37: "2.3125rem",
|
|
42
|
+
38: "2.375rem",
|
|
43
|
+
39: "2.4375rem",
|
|
44
|
+
40: "2.5rem",
|
|
45
|
+
41: "2.5625rem",
|
|
46
|
+
42: "2.625rem",
|
|
47
|
+
43: "2.6875rem",
|
|
48
|
+
44: "2.75rem",
|
|
49
|
+
45: "2.8125rem",
|
|
50
|
+
46: "2.875rem",
|
|
51
|
+
47: "2.9375rem",
|
|
52
|
+
48: "3.0rem",
|
|
53
|
+
49: "3.0625rem",
|
|
54
|
+
50: "3.125rem",
|
|
55
|
+
51: "3.1875rem",
|
|
56
|
+
52: "3.25rem",
|
|
57
|
+
53: "3.3125rem",
|
|
58
|
+
54: "3.375rem",
|
|
59
|
+
55: "3.4375rem",
|
|
60
|
+
56: "3.5rem",
|
|
61
|
+
57: "3.5625rem",
|
|
62
|
+
58: "3.625rem",
|
|
63
|
+
59: "3.6875rem",
|
|
64
|
+
60: "3.75rem",
|
|
65
|
+
circle: "50%",
|
|
66
|
+
full: "9999px",
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default borders;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const pdsColors = {
|
|
2
|
+
text: {
|
|
3
|
+
'disabled':"#9ca3af",
|
|
4
|
+
"01": "#111B31",
|
|
5
|
+
"02": "#39465B",
|
|
6
|
+
"03": "#4B596D",
|
|
7
|
+
"04": "#9EA8B8",
|
|
8
|
+
brand: "#6B5CE0",
|
|
9
|
+
black: "#000000",
|
|
10
|
+
doc: "#215FFF",
|
|
11
|
+
invert: "#FFFFFF",
|
|
12
|
+
primary: "#215FFF",
|
|
13
|
+
"red-primary": "#D74B41",
|
|
14
|
+
"primary-dark": "#143999",
|
|
15
|
+
secondary: "#4C5980",
|
|
16
|
+
success: "#1B7E43",
|
|
17
|
+
white: "#FFFFFF",
|
|
18
|
+
info: "#3B5BFA",
|
|
19
|
+
error: "#BD0F0F",
|
|
20
|
+
"black-20": "#00000033",
|
|
21
|
+
"neutral-600-medium": "#767676",
|
|
22
|
+
"neutral-800-dark": "#484848",
|
|
23
|
+
"neutral-1000-black": "#1A1A1A",
|
|
24
|
+
"primary-500": "#215FFF",
|
|
25
|
+
"color-foreground-on-primary": "#FFFFFF",
|
|
26
|
+
},
|
|
27
|
+
border: {
|
|
28
|
+
"green-light": "#75CAA6",
|
|
29
|
+
neutral: "#0000000D",
|
|
30
|
+
"brand-01": "#6B5CE0",
|
|
31
|
+
"brand-02": "#E4E1FA",
|
|
32
|
+
"03": "#D9DDE3",
|
|
33
|
+
error: "#BD0F0F",
|
|
34
|
+
doc: "#215FFF",
|
|
35
|
+
"blue-100": "#CDD5FE",
|
|
36
|
+
info: "#3B5BFA",
|
|
37
|
+
"neutral-300-strokedark": "#BABABA",
|
|
38
|
+
"neutral-200-strokelight": "#D1D1D1",
|
|
39
|
+
},
|
|
40
|
+
bg: {
|
|
41
|
+
"primary-container":"#EADDFF",
|
|
42
|
+
"modal-black":"#000000d1",
|
|
43
|
+
"primary-light": "#E9EFFF",
|
|
44
|
+
"green-light": "#E8F6F0",
|
|
45
|
+
"yellow-light": "#FDF7E7",
|
|
46
|
+
"green-dark": "#D1EDE1",
|
|
47
|
+
secondary: "#ABB7C2",
|
|
48
|
+
"02": "#E4E7EC",
|
|
49
|
+
"04": "#BEC5D0",
|
|
50
|
+
white: "#FFFFFF",
|
|
51
|
+
'doc': "#215FFF",
|
|
52
|
+
"brand-01": "#6B5CE0",
|
|
53
|
+
"brand-02": "#E4E1FA",
|
|
54
|
+
"brand-03": "#F4F2FF",
|
|
55
|
+
"01": "#F2F4F7",
|
|
56
|
+
"green-100": "#D5F6E2",
|
|
57
|
+
invert: "#111B31",
|
|
58
|
+
"seperator-dark": "#D6D9E0",
|
|
59
|
+
"fab-bg-brand-04": "#B3ABED",
|
|
60
|
+
"warning-03": "#FFFBE5",
|
|
61
|
+
"purple-800": "#1A1254",
|
|
62
|
+
"error-01": "#F15353",
|
|
63
|
+
"yellow-50": "#FDF7E7",
|
|
64
|
+
"primary-bg-light": "#E9EFFF",
|
|
65
|
+
"neutral-100-bg-dark": "#E8E8E8",
|
|
66
|
+
"button-danger-background-color": "#D92D20",
|
|
67
|
+
"color-foreground-heading": "#1A1A1A",
|
|
68
|
+
"color-foreground-warning": "#F79009",
|
|
69
|
+
"color-foreground-success": "#039855",
|
|
70
|
+
"success-02": "#27B961",
|
|
71
|
+
"success-03": "#EAFBF1",
|
|
72
|
+
red: "#DD3F3F",
|
|
73
|
+
"error-03": "#FDE7E7",
|
|
74
|
+
},
|
|
75
|
+
icon: {
|
|
76
|
+
"success-02": "#27B961",
|
|
77
|
+
"03": "#4B596D",
|
|
78
|
+
invert: "#FFFFFF",
|
|
79
|
+
"orange-600": "#B73B15",
|
|
80
|
+
"orange-500": "#E9673F",
|
|
81
|
+
"orange-400": "#FB9637",
|
|
82
|
+
"orange-300": "#FCB069",
|
|
83
|
+
brand: "#6B5CE0",
|
|
84
|
+
"01": "#F2F4F7",
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export default pdsColors;
|