@6thbridge/hexa 0.0.44 → 0.0.45

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/index.mjs CHANGED
@@ -1,3126 +1,2 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
-
5
- // src/components/label/FormLabel.tsx
6
- import React2 from "react";
7
-
8
- // src/components/label/index.tsx
9
- import * as React from "react";
10
- import * as LabelPrimitive from "@radix-ui/react-label";
11
- import { cva } from "class-variance-authority";
12
-
13
- // src/utils/index.ts
14
- import { clsx } from "clsx";
15
- import { twMerge } from "tailwind-merge";
16
- function cn(...inputs) {
17
- return twMerge(clsx(inputs));
18
- }
19
-
20
- // src/components/label/index.tsx
21
- import { jsx } from "react/jsx-runtime";
22
- var labelVariants = cva(
23
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
24
- );
25
- var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
26
- LabelPrimitive.Root,
27
- {
28
- ref,
29
- className: cn(labelVariants(), className),
30
- ...props
31
- }
32
- ));
33
- Label.displayName = LabelPrimitive.Root.displayName;
34
-
35
- // src/components/label/FormLabel.tsx
36
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
37
- var FormLabel = React2.forwardRef(({ className, children, showAsterisk, error, ...props }, ref) => {
38
- return /* @__PURE__ */ jsx2(
39
- Label,
40
- {
41
- ref,
42
- className: cn(error && "text-red-500", className),
43
- ...props,
44
- children: showAsterisk ? /* @__PURE__ */ jsxs("p", { children: [
45
- children,
46
- /* @__PURE__ */ jsx2("span", { className: "text-red-500", children: "*" })
47
- ] }) : children
48
- }
49
- );
50
- });
51
- FormLabel.displayName = "FormLabel";
52
-
53
- // src/components/loader/index.tsx
54
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
55
- var Loader = ({
56
- size = 16,
57
- colour = "primary"
58
- }) => {
59
- return /* @__PURE__ */ jsxs2(
60
- "svg",
61
- {
62
- className: "animate-spin",
63
- width: size,
64
- height: size,
65
- viewBox: "0 0 20 20",
66
- fill: "none",
67
- children: [
68
- /* @__PURE__ */ jsx3("circle", { cx: "10", cy: "10", r: "9.25", stroke: "transparent", strokeWidth: "1.5" }),
69
- /* @__PURE__ */ jsx3(
70
- "path",
71
- {
72
- d: "M10 0.595792C10 0.266746 10.267 -0.00185055 10.5954 0.0177417C11.9786 0.100242 13.3318 0.469461 14.5682 1.1044C15.9816 1.83021 17.2016 2.88235 18.1273 4.17366C19.0531 5.46496 19.6578 6.95826 19.8913 8.52984C20.1249 10.1014 19.9807 11.706 19.4705 13.2108C18.9604 14.7155 18.0991 16.077 16.9579 17.1825C15.8167 18.288 14.4285 19.1056 12.9084 19.5677C11.3882 20.0298 9.77982 20.123 8.21646 19.8397C6.84883 19.5918 5.55009 19.0619 4.40196 18.2863C4.12931 18.1021 4.08072 17.7265 4.28083 17.4653C4.48094 17.2041 4.85388 17.1564 5.12801 17.3384C6.12474 18.0001 7.24768 18.4531 8.42898 18.6672C9.80606 18.9168 11.2228 18.8347 12.5618 18.4276C13.9008 18.0206 15.1236 17.3004 16.1288 16.3266C17.134 15.3528 17.8927 14.1536 18.342 12.8282C18.7914 11.5027 18.9185 10.0893 18.7127 8.70502C18.507 7.32071 17.9743 6.00535 17.1589 4.86792C16.3435 3.73048 15.2688 2.80371 14.0238 2.16439C12.9559 1.61596 11.789 1.29259 10.5954 1.21173C10.2671 1.18949 10 0.92484 10 0.595792Z",
73
- fill: colour === "primary" ? "#ffffff" : "currentColor",
74
- className: "rounded"
75
- }
76
- )
77
- ]
78
- }
79
- );
80
- };
81
-
82
- // src/components/button/index.tsx
83
- import * as React3 from "react";
84
- import { Slot } from "@radix-ui/react-slot";
85
- import { cva as cva2 } from "class-variance-authority";
86
- import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
87
- var buttonVariants = cva2(
88
- "overflow-hidden isolate inline-flex h-fit items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background dark:ring-offset-transparent transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:!pointer-events-none",
89
- {
90
- variants: {
91
- variant: {
92
- primary: "border-primary-main bg-primary-main hover:bg-primary-main/70 disabled:bg-primary-main/70 text-white font-bold",
93
- danger: "border-red-600 bg-red-600 hover:bg-red-600/70 disabled:bg-red-600/70 text-white font-bold",
94
- neutral: "!border-0 bg-transparent text-primary-main hover:opacity-80 disabled:opacity-60",
95
- outlined: "border border-primary-main text-primary-main hover:opacity-80 disabled:opacity-60",
96
- "danger-outlined": "border border-red-600 text-red-600 hover:opacity-80 disabled:opacity-60",
97
- "light-outlined": "border-white text-white hover:opacity-80 disabled:opacity-60",
98
- "dark-text": "border-transparent bg-transparent hover:bg-opacity-70 disabled:bg-opacity-70 text-black font-medium",
99
- light: "border-white bg-white hover:bg-opacity-70 disabled:bg-opacity-70 text-primary-main font-semibold"
100
- },
101
- size: {
102
- // lg: "h-15 px-8 items-center",
103
- // sm: "h-10 px-3.5 items-center text-sm",
104
- default: "py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",
105
- sm: "py-[0.375rem] px-[1rem] leading-[1rem] font-normal text-sm rounded-lg",
106
- lg: "py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",
107
- md: "py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",
108
- "icon-sm": "h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",
109
- icon: "h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg",
110
- "icon-lg": "h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"
111
- }
112
- },
113
- defaultVariants: {
114
- variant: "primary",
115
- size: "default"
116
- }
117
- }
118
- );
119
- var Button = React3.forwardRef(
120
- ({
121
- className,
122
- variant = "primary",
123
- size,
124
- asChild = false,
125
- isLoading = false,
126
- leftNode,
127
- rightNode,
128
- LoaderSize,
129
- // ref,
130
- ...props
131
- }, ref) => {
132
- const Component = asChild ? Slot : "button";
133
- const { children, disabled, ...rest } = props;
134
- const reference = React3.useRef(null);
135
- return /* @__PURE__ */ jsx4(
136
- Component,
137
- {
138
- className: cn(buttonVariants({ variant, size, className })),
139
- ref: reference || ref,
140
- disabled: disabled || isLoading,
141
- ...rest,
142
- children: /* @__PURE__ */ jsx4("div", { className: "flex font-medium justify-center items-center gap-2", children: isLoading ? /* @__PURE__ */ jsx4(Fragment, { children: /* @__PURE__ */ jsx4("span", { className: "mx-auto", children: /* @__PURE__ */ jsx4(Loader, { size: LoaderSize, colour: "secondary" }) }) }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
143
- leftNode,
144
- children,
145
- rightNode
146
- ] }) })
147
- }
148
- );
149
- }
150
- );
151
- Button.displayName = "Button";
152
-
153
- // src/components/input/index.tsx
154
- import * as React6 from "react";
155
- import { cva as cva3 } from "class-variance-authority";
156
-
157
- // src/components/form/ErrorMessage.tsx
158
- import React4 from "react";
159
- import { jsx as jsx5 } from "react/jsx-runtime";
160
- var ErrorMessage = React4.forwardRef(({ className, children, error, ...props }, ref) => {
161
- const body = error ?? children;
162
- if (!body) {
163
- return null;
164
- }
165
- return /* @__PURE__ */ jsx5(
166
- "p",
167
- {
168
- ref,
169
- className: cn("text-xs font-normal text-[#F04248]", className),
170
- ...props,
171
- children: body
172
- }
173
- );
174
- });
175
- ErrorMessage.displayName = "ErrorMessage";
176
-
177
- // src/components/form/FormDescription.tsx
178
- import React5 from "react";
179
- import { jsx as jsx6 } from "react/jsx-runtime";
180
- var FormDescription = React5.forwardRef(({ className, ...props }, ref) => {
181
- return /* @__PURE__ */ jsx6(
182
- "div",
183
- {
184
- ref,
185
- className: cn("text-sm text-[#8E98A8", className),
186
- ...props
187
- }
188
- );
189
- });
190
- FormDescription.displayName = "FormDescription";
191
-
192
- // src/components/input/index.tsx
193
- import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
194
- var inputVariants = cva3(
195
- "!p-0 flex h-full w-full !border-transparent !bg-transparent text-base focus-visible:bg-transparent focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",
196
- {
197
- variants: {
198
- status: {
199
- default: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
200
- error: "placeholder:text-red-500 text-red-500",
201
- loading: "placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",
202
- prefilled: "",
203
- neutral: ""
204
- }
205
- },
206
- defaultVariants: {
207
- status: "default"
208
- }
209
- }
210
- );
211
- var BaseInnerInput = React6.forwardRef(
212
- ({ className, status, type, ...props }, ref) => {
213
- return /* @__PURE__ */ jsx7(
214
- "input",
215
- {
216
- type,
217
- className: cn(inputVariants({ status }), className),
218
- ref,
219
- ...props
220
- }
221
- );
222
- }
223
- );
224
- BaseInnerInput.displayName = "BaseInnerInput";
225
- var inputContainerVariants = cva3(
226
- "flex relative h-10 w-full rounded-[4px] dark:!bg-transparent border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",
227
- {
228
- variants: {
229
- status: {
230
- default: "border-[#DEDEDE] bg-white text-[#191919] dark:!bg-transparent caret-text-primary focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",
231
- error: "placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-status-error-bg-dark text-red-500 focus-within:bg-red-50 focus-within:border-red-500",
232
- loading: "",
233
- prefilled: "bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",
234
- neutral: "bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"
235
- }
236
- },
237
- defaultVariants: {
238
- status: "default"
239
- }
240
- }
241
- );
242
- var sideVariants = cva3(
243
- "top-0 flex justify-center items-center h-full min-w-[50px] max-w-[100px] dark:!bg-transparent transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",
244
- {
245
- variants: {
246
- side: {
247
- left: "left-0 rounded-l-[8px] border-r",
248
- right: "right-0 rounded-r-[8px] border-l"
249
- },
250
- status: {
251
- default: "border-[#DEDEDE] bg-white text-[#191919] dark:!bg-transparent caret-primary-main focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",
252
- error: "placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-red-50 text-red-500 focus-within:bg-red-50 focus-within:border-red-500",
253
- loading: "",
254
- prefilled: "bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",
255
- neutral: "bg-transparent border-0 caret-[#DEDEDE] !px-0"
256
- }
257
- },
258
- defaultVariants: {
259
- status: "default",
260
- side: "left"
261
- }
262
- }
263
- );
264
- var Input = React6.forwardRef(
265
- ({
266
- className,
267
- status = "default",
268
- disabled,
269
- error,
270
- isLoading,
271
- sideNodeClassName,
272
- showAsterisk,
273
- label,
274
- description,
275
- ...props
276
- }, ref) => {
277
- let containerStatus = status;
278
- if (error) containerStatus = "error";
279
- if (isLoading) containerStatus = "loading";
280
- if (disabled) containerStatus = "prefilled";
281
- return /* @__PURE__ */ jsxs4("div", { className: "relative space-y-1 w-full", children: [
282
- label && /* @__PURE__ */ jsx7(FormLabel, { showAsterisk, error, children: label }),
283
- /* @__PURE__ */ jsxs4(
284
- "div",
285
- {
286
- className: cn(
287
- inputContainerVariants({ status: containerStatus }),
288
- props.leftNode ? "pl-0" : "",
289
- props.rightNode ? "pr-0" : "",
290
- className
291
- ),
292
- children: [
293
- props.leftNode ? /* @__PURE__ */ jsx7(
294
- "div",
295
- {
296
- className: cn(
297
- sideVariants({
298
- status: containerStatus,
299
- side: "left"
300
- }),
301
- sideNodeClassName
302
- ),
303
- children: props.leftNode
304
- }
305
- ) : null,
306
- /* @__PURE__ */ jsx7(
307
- BaseInnerInput,
308
- {
309
- ref,
310
- disabled: isLoading || disabled,
311
- className: cn({
312
- "!pl-3": props.leftNode && status !== "neutral",
313
- "!pr-3": props.rightNode && status !== "neutral"
314
- }),
315
- ...props
316
- }
317
- ),
318
- props.rightNode ? /* @__PURE__ */ jsx7(
319
- "div",
320
- {
321
- className: cn(
322
- sideVariants({
323
- status: containerStatus,
324
- side: "right"
325
- }),
326
- sideNodeClassName
327
- ),
328
- children: props.rightNode
329
- }
330
- ) : null
331
- ]
332
- }
333
- ),
334
- description && /* @__PURE__ */ jsx7(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
335
- /* @__PURE__ */ jsx7(ErrorMessage, { error })
336
- ] });
337
- }
338
- );
339
- Input.displayName = "Input";
340
-
341
- // src/components/password-input/index.tsx
342
- import { useMemo, useState } from "react";
343
-
344
- // src/components/password-input/icons/Eye.tsx
345
- import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
346
- var Eye = () => {
347
- return /* @__PURE__ */ jsxs5(
348
- "svg",
349
- {
350
- width: "18",
351
- height: "14",
352
- viewBox: "0 0 18 14",
353
- fill: "none",
354
- xmlns: "http://www.w3.org/2000/svg",
355
- children: [
356
- /* @__PURE__ */ jsx8(
357
- "path",
358
- {
359
- d: "M1.54639 7.26103C1.48389 7.09264 1.48389 6.90741 1.54639 6.73903C2.15517 5.26292 3.18853 4.00081 4.51547 3.1127C5.84241 2.22459 7.40317 1.75049 8.99989 1.75049C10.5966 1.75049 12.1574 2.22459 13.4843 3.1127C14.8113 4.00081 15.8446 5.26292 16.4534 6.73903C16.5159 6.90741 16.5159 7.09264 16.4534 7.26103C15.8446 8.73713 14.8113 9.99925 13.4843 10.8874C12.1574 11.7755 10.5966 12.2496 8.99989 12.2496C7.40317 12.2496 5.84241 11.7755 4.51547 10.8874C3.18853 9.99925 2.15517 8.73713 1.54639 7.26103Z",
360
- stroke: "#8E98A8",
361
- strokeWidth: "2",
362
- strokeLinecap: "round",
363
- strokeLinejoin: "round"
364
- }
365
- ),
366
- /* @__PURE__ */ jsx8(
367
- "path",
368
- {
369
- d: "M9 9.25C10.2426 9.25 11.25 8.24264 11.25 7C11.25 5.75736 10.2426 4.75 9 4.75C7.75736 4.75 6.75 5.75736 6.75 7C6.75 8.24264 7.75736 9.25 9 9.25Z",
370
- stroke: "#8E98A8",
371
- strokeWidth: "2",
372
- strokeLinecap: "round",
373
- strokeLinejoin: "round"
374
- }
375
- )
376
- ]
377
- }
378
- );
379
- };
380
-
381
- // src/components/password-input/icons/EyeOff.tsx
382
- import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
383
- var EyeOff = () => {
384
- return /* @__PURE__ */ jsxs6(
385
- "svg",
386
- {
387
- width: "18",
388
- height: "18",
389
- viewBox: "0 0 18 18",
390
- fill: "none",
391
- xmlns: "http://www.w3.org/2000/svg",
392
- children: [
393
- /* @__PURE__ */ jsx9(
394
- "path",
395
- {
396
- d: "M4.08759 12.69C3.26171 11.9072 2.61006 10.9591 2.17509 9.90752C2.10081 9.73454 2.0625 9.54826 2.0625 9.36001C2.0625 9.17177 2.10081 8.98549 2.17509 8.81252C2.75274 7.4073 3.72095 6.19704 4.96509 5.32502C6.14597 4.4998 7.55989 4.07405 9.00009 4.11002C10.0363 4.084 11.064 4.30239 12.0001 4.74752M13.9201 6.03752C14.7415 6.81964 15.3904 7.76486 15.8251 8.81252C15.8994 8.98549 15.9377 9.17177 15.9377 9.36001C15.9377 9.54826 15.8994 9.73454 15.8251 9.90752C15.2474 11.3127 14.2792 12.523 13.0351 13.395C11.8542 14.2202 10.4403 14.646 9.00009 14.61C7.9639 14.636 6.93616 14.4176 6.00009 13.9725",
397
- stroke: "#8E98A8",
398
- strokeWidth: "1.5",
399
- strokeLinecap: "round",
400
- strokeLinejoin: "round"
401
- }
402
- ),
403
- /* @__PURE__ */ jsx9(
404
- "path",
405
- {
406
- d: "M6.5325 10.2375C6.42732 9.95694 6.37395 9.65962 6.375 9.36C6.375 8.66381 6.65156 7.99613 7.14384 7.50384C7.63613 7.01156 8.30381 6.735 9 6.735C9.3 6.7335 9.597 6.7875 9.8775 6.8925M11.4675 8.4825C11.5725 8.763 11.6265 9.06 11.625 9.36C11.625 10.0562 11.3484 10.7239 10.8562 11.2162C10.3639 11.7084 9.69619 11.985 9 11.985C8.70038 11.986 8.40306 11.9327 8.1225 11.8275M2.25 15L14.25 3",
407
- stroke: "#8E98A8",
408
- strokeWidth: "1.5",
409
- strokeLinecap: "round",
410
- strokeLinejoin: "round"
411
- }
412
- )
413
- ]
414
- }
415
- );
416
- };
417
-
418
- // src/components/password-input/icons/Check.tsx
419
- import { jsx as jsx10 } from "react/jsx-runtime";
420
- var Check = () => {
421
- return /* @__PURE__ */ jsx10(
422
- "svg",
423
- {
424
- width: "12",
425
- height: "12",
426
- viewBox: "0 0 12 12",
427
- fill: "none",
428
- xmlns: "http://www.w3.org/2000/svg",
429
- children: /* @__PURE__ */ jsx10(
430
- "path",
431
- {
432
- d: "M8.89802 2.93408L9.70202 3.49808L6.21602 8.52608H5.41202L3.46802 5.80208L4.27202 5.05208L5.81402 6.49208L8.89802 2.93408Z",
433
- fill: "currentColor"
434
- }
435
- )
436
- }
437
- );
438
- };
439
-
440
- // src/components/password-input/icons/Fail.tsx
441
- import { jsx as jsx11 } from "react/jsx-runtime";
442
- var Fail = () => {
443
- return /* @__PURE__ */ jsx11(
444
- "svg",
445
- {
446
- width: "12",
447
- height: "12",
448
- viewBox: "0 0 12 12",
449
- fill: "none",
450
- xmlns: "http://www.w3.org/2000/svg",
451
- children: /* @__PURE__ */ jsx11(
452
- "path",
453
- {
454
- d: "M3.37891 8.62142L6.00041 5.99992L8.62191 8.62142M8.62191 3.37842L5.99991 5.99992L3.37891 3.37842",
455
- stroke: "currentColor",
456
- strokeWidth: "1.5",
457
- strokeLinecap: "round",
458
- strokeLinejoin: "round"
459
- }
460
- )
461
- }
462
- );
463
- };
464
-
465
- // src/components/password-input/index.tsx
466
- import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
467
- var validationOptions = [
468
- {
469
- label: "Uppercase",
470
- key: "uppercase",
471
- RegExp: /[A-Z]/,
472
- validated: false
473
- },
474
- {
475
- label: "Lowercase",
476
- key: "lowercase",
477
- RegExp: /[a-z]/,
478
- validated: false
479
- },
480
- {
481
- label: "Number",
482
- key: "number",
483
- RegExp: /\d/,
484
- validated: false
485
- },
486
- {
487
- label: "8 Characters",
488
- key: "eight-chars",
489
- RegExp: /.{8}/,
490
- validated: false
491
- }
492
- ];
493
- var PasswordInput = ({
494
- onValidate,
495
- onChange,
496
- disableValidation,
497
- ...props
498
- }) => {
499
- const [passwordVisible, setPasswordVisible] = useState(false);
500
- const [validatedValues, setValidatedValues] = useState(validationOptions);
501
- const validatePassword = (value) => {
502
- return validationOptions.map((option) => ({
503
- ...option,
504
- validated: option.RegExp.test(value)
505
- }));
506
- };
507
- const checkPasswordStrength = (value) => {
508
- const validatedOptions = validatePassword(value);
509
- const allValidated = validatedOptions.every((option) => option.validated);
510
- setValidatedValues(validatedOptions);
511
- return allValidated;
512
- };
513
- const handlePaswordInputChange = (e) => {
514
- if (onChange) onChange(e);
515
- if (disableValidation) return;
516
- const value = e?.target?.value;
517
- const validated = checkPasswordStrength(value);
518
- if (onValidate) onValidate(validated, value);
519
- };
520
- const ValidateComp = useMemo(() => {
521
- return /* @__PURE__ */ jsx12("div", { className: "flex items-center gap-2", children: validatedValues?.map((value) => /* @__PURE__ */ jsxs7(
522
- "div",
523
- {
524
- className: cn("text-xs flex items-center gap-0.5", {
525
- "text-[#62C554]": value?.validated,
526
- "text-[#8E98A8]": !value?.validated
527
- }),
528
- children: [
529
- /* @__PURE__ */ jsx12("span", { className: "", children: value?.validated ? /* @__PURE__ */ jsx12(Check, {}) : /* @__PURE__ */ jsx12(Fail, {}) }),
530
- /* @__PURE__ */ jsx12("span", { className: "", children: value?.label })
531
- ]
532
- },
533
- value?.key
534
- )) });
535
- }, [validatedValues]);
536
- return /* @__PURE__ */ jsx12(
537
- Input,
538
- {
539
- sideNodeClassName: "!border-l-0",
540
- rightNode: passwordVisible ? /* @__PURE__ */ jsx12(
541
- "button",
542
- {
543
- type: "button",
544
- onClick: () => setPasswordVisible((val) => !val),
545
- children: /* @__PURE__ */ jsx12(Eye, {})
546
- }
547
- ) : /* @__PURE__ */ jsx12(
548
- "button",
549
- {
550
- type: "button",
551
- onClick: () => setPasswordVisible((val) => !val),
552
- children: /* @__PURE__ */ jsx12(EyeOff, {})
553
- }
554
- ),
555
- type: passwordVisible ? "text" : "password",
556
- onChange: handlePaswordInputChange,
557
- description: !disableValidation && ValidateComp,
558
- ...props
559
- }
560
- );
561
- };
562
- PasswordInput.displayName = "PasswordInput";
563
-
564
- // src/components/textarea/index.tsx
565
- import { cva as cva4 } from "class-variance-authority";
566
- import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
567
- var textareaContainerVariants = cva4(
568
- "flex relative min-h-[80px] w-full rounded-[8px] border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",
569
- {
570
- variants: {
571
- status: {
572
- default: "border-[#D7D7D7] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-primary-main focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:border-[#9299A2] dark:disabled:!border-[#9299A2]",
573
- error: "placeholder:text-status-error-fill bg-status-error-bg border-status-error-fill dark:!bg-status-error-bg-dark text-status-error-fill focus-within:bg-status-error-bg focus-within:border-status-error-fill",
574
- loading: "placeholder:text-[#C4C4C4]",
575
- prefilled: "resize-none bg-[#F6F6F6] border-[#D7D7D7] dark:!bg-transparent caret-[#D7D7D7] focus-within:bg-[#F6F6F6] focus-within:border-[#D7D7D7] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",
576
- neutral: ""
577
- }
578
- },
579
- defaultVariants: {
580
- status: "default"
581
- }
582
- }
583
- );
584
- var Textarea = ({
585
- className,
586
- status = "default",
587
- disabled,
588
- error,
589
- isLoading,
590
- showAsterisk,
591
- label,
592
- description,
593
- ...props
594
- }) => {
595
- let containerStatus = status;
596
- if (error) containerStatus = "error";
597
- if (isLoading) containerStatus = "loading";
598
- if (disabled) containerStatus = "prefilled";
599
- return /* @__PURE__ */ jsxs8("div", { className: "relative space-y-1", children: [
600
- /* @__PURE__ */ jsx13(FormLabel, { showAsterisk, error, children: label }),
601
- /* @__PURE__ */ jsx13(
602
- "textarea",
603
- {
604
- className: cn(
605
- "min-h-[80px]",
606
- inputContainerVariants({ status: containerStatus }),
607
- className
608
- ),
609
- disabled: isLoading || disabled,
610
- ...props
611
- }
612
- ),
613
- /* @__PURE__ */ jsx13(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
614
- /* @__PURE__ */ jsx13(ErrorMessage, { error })
615
- ] });
616
- };
617
- Textarea.displayName = "Textarea";
618
-
619
- // src/components/searcheable/index.tsx
620
- import * as React11 from "react";
621
-
622
- // src/components/command/index.tsx
623
- import * as React8 from "react";
624
- import { Command as CommandPrimitive } from "cmdk";
625
- import { Search } from "lucide-react";
626
-
627
- // src/components/dialog/index.tsx
628
- import * as React7 from "react";
629
- import * as DialogPrimitive from "@radix-ui/react-dialog";
630
-
631
- // src/components/dialog/icon/CloseIcon.tsx
632
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
633
- var CloseIcon = () => {
634
- return /* @__PURE__ */ jsxs9(
635
- "svg",
636
- {
637
- xmlns: "http://www.w3.org/2000/svg",
638
- width: "24",
639
- height: "24",
640
- viewBox: "0 0 24 24",
641
- fill: "none",
642
- stroke: "currentColor",
643
- strokeWidth: "2",
644
- strokeLinecap: "round",
645
- strokeLinejoin: "round",
646
- className: "lucide lucide-x",
647
- children: [
648
- /* @__PURE__ */ jsx14("path", { d: "M18 6 6 18" }),
649
- /* @__PURE__ */ jsx14("path", { d: "m6 6 12 12" })
650
- ]
651
- }
652
- );
653
- };
654
-
655
- // src/components/dialog/index.tsx
656
- import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
657
- var DialogRoot = DialogPrimitive.Root;
658
- var DialogTrigger = DialogPrimitive.Trigger;
659
- var DialogPortal = DialogPrimitive.Portal;
660
- var DialogOverlay = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
661
- DialogPrimitive.Overlay,
662
- {
663
- ref,
664
- className: cn(
665
- "fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
666
- className
667
- ),
668
- ...props
669
- }
670
- ));
671
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
672
- var DialogContent = React7.forwardRef(({ className, hideCloseButton, children, ...props }, ref) => /* @__PURE__ */ jsxs10(DialogPortal, { children: [
673
- /* @__PURE__ */ jsx15(DialogOverlay, {}),
674
- /* @__PURE__ */ jsxs10(
675
- DialogPrimitive.Content,
676
- {
677
- ref,
678
- className: cn(
679
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-transparent bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",
680
- className
681
- ),
682
- ...props,
683
- children: [
684
- children,
685
- !hideCloseButton && /* @__PURE__ */ jsxs10(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
686
- /* @__PURE__ */ jsx15(CloseIcon, {}),
687
- /* @__PURE__ */ jsx15("span", { className: "sr-only", children: "Close" })
688
- ] })
689
- ]
690
- }
691
- )
692
- ] }));
693
- DialogContent.displayName = DialogPrimitive.Content.displayName;
694
- var DialogHeader = ({
695
- className,
696
- ...props
697
- }) => /* @__PURE__ */ jsx15(
698
- "div",
699
- {
700
- className: cn("flex flex-col space-y-1.5 text-left", className),
701
- ...props
702
- }
703
- );
704
- DialogHeader.displayName = "DialogHeader";
705
- var DialogFooter = ({
706
- className,
707
- ...props
708
- }) => /* @__PURE__ */ jsx15(
709
- "div",
710
- {
711
- className: cn("flex flex-row justify-end sm:space-x-2", className),
712
- ...props
713
- }
714
- );
715
- DialogFooter.displayName = "DialogFooter";
716
- var DialogTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
717
- DialogPrimitive.Title,
718
- {
719
- ref,
720
- className: cn(
721
- "text-xl font-semibold leading-none tracking-tight",
722
- className
723
- ),
724
- ...props
725
- }
726
- ));
727
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
728
- var DialogDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(
729
- DialogPrimitive.Description,
730
- {
731
- ref,
732
- className: cn("text-sm text-gray-500", className),
733
- ...props
734
- }
735
- ));
736
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
737
- var Dialog2 = ({
738
- trigger = void 0,
739
- children,
740
- open,
741
- onOpenChange,
742
- hideCloseButton,
743
- footer,
744
- title,
745
- description,
746
- contentClassName,
747
- headerClassName,
748
- titleClassName,
749
- descriptionClassName,
750
- footerClassName,
751
- asChild = true,
752
- onOpenAutoFocus,
753
- onCloseAutoFocus,
754
- onEscapeKeyDown,
755
- onInteractOutside,
756
- onPointerDownOutside,
757
- ...props
758
- }) => {
759
- return /* @__PURE__ */ jsxs10(DialogRoot, { ...props, open, onOpenChange, children: [
760
- /* @__PURE__ */ jsx15(DialogTrigger, { asChild, children: trigger }),
761
- /* @__PURE__ */ jsx15(DialogPortal, { children: /* @__PURE__ */ jsxs10(
762
- DialogContent,
763
- {
764
- className: contentClassName,
765
- hideCloseButton,
766
- onOpenAutoFocus,
767
- onCloseAutoFocus,
768
- onEscapeKeyDown,
769
- onPointerDownOutside,
770
- onInteractOutside,
771
- children: [
772
- title || description ? /* @__PURE__ */ jsxs10(DialogHeader, { className: headerClassName, children: [
773
- title && /* @__PURE__ */ jsx15(DialogTitle, { className: titleClassName, children: title }),
774
- description && /* @__PURE__ */ jsx15(DialogDescription, { className: descriptionClassName, children: description })
775
- ] }) : /* @__PURE__ */ jsx15(Fragment2, {}),
776
- children,
777
- footer && /* @__PURE__ */ jsx15(DialogFooter, { className: footerClassName, children: footer })
778
- ]
779
- }
780
- ) })
781
- ] });
782
- };
783
- Dialog2.displayName = DialogPrimitive.Dialog.displayName;
784
-
785
- // src/components/command/index.tsx
786
- import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
787
- var Command = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
788
- CommandPrimitive,
789
- {
790
- ref,
791
- className: cn(
792
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
793
- className
794
- ),
795
- ...props
796
- }
797
- ));
798
- Command.displayName = CommandPrimitive.displayName;
799
- var CommandInput = React8.forwardRef(({ className, CommandInputContainerClassName, loading, ...props }, ref) => /* @__PURE__ */ jsxs11(
800
- "div",
801
- {
802
- className: cn(
803
- "flex items-center border-0 px-3 gap-2",
804
- CommandInputContainerClassName
805
- ),
806
- "cmdk-input-wrapper": "",
807
- children: [
808
- loading ? /* @__PURE__ */ jsx16(Loader, { size: 16, colour: "secondary" }) : /* @__PURE__ */ jsx16(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
809
- /* @__PURE__ */ jsx16(
810
- CommandPrimitive.Input,
811
- {
812
- ref,
813
- className: cn(
814
- "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
815
- className
816
- ),
817
- disabled: loading,
818
- ...props
819
- }
820
- )
821
- ]
822
- }
823
- ));
824
- CommandInput.displayName = CommandPrimitive.Input.displayName;
825
- var CommandList = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
826
- CommandPrimitive.List,
827
- {
828
- ref,
829
- className: cn("overflow-y-auto overflow-x-hidden", className),
830
- ...props
831
- }
832
- ));
833
- CommandList.displayName = CommandPrimitive.List.displayName;
834
- var CommandEmpty = React8.forwardRef((props, ref) => /* @__PURE__ */ jsx16(
835
- CommandPrimitive.Empty,
836
- {
837
- ref,
838
- className: "py-6 text-center text-sm",
839
- ...props
840
- }
841
- ));
842
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
843
- var CommandGroup = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
844
- CommandPrimitive.Group,
845
- {
846
- ref,
847
- className: cn(
848
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
849
- className
850
- ),
851
- ...props
852
- }
853
- ));
854
- CommandGroup.displayName = CommandPrimitive.Group.displayName;
855
- var CommandSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
856
- CommandPrimitive.Separator,
857
- {
858
- ref,
859
- className: cn("-mx-1 h-px bg-border", className),
860
- ...props
861
- }
862
- ));
863
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
864
- var CommandItem = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
865
- CommandPrimitive.Item,
866
- {
867
- ref,
868
- className: cn(
869
- "relative text=[#222222] flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
870
- className
871
- ),
872
- ...props
873
- }
874
- ));
875
- CommandItem.displayName = CommandPrimitive.Item.displayName;
876
- var CommandShortcut = ({
877
- className,
878
- ...props
879
- }) => {
880
- return /* @__PURE__ */ jsx16(
881
- "span",
882
- {
883
- className: cn(
884
- "ml-auto text-xs tracking-widest text-muted-foreground",
885
- className
886
- ),
887
- ...props
888
- }
889
- );
890
- };
891
- CommandShortcut.displayName = "CommandShortcut";
892
-
893
- // src/components/popover/index.tsx
894
- import * as React9 from "react";
895
- import * as PopoverPrimitive from "@radix-ui/react-popover";
896
- import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
897
- var PopoverRoot = PopoverPrimitive.Root;
898
- var PopoverTrigger = PopoverPrimitive.Trigger;
899
- var PopoverContent = React9.forwardRef(
900
- ({ className, align = "center", sideOffset = 4, portal = true, ...props }, ref) => portal ? /* @__PURE__ */ jsx17(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx17(
901
- PopoverPrimitive.Content,
902
- {
903
- ref,
904
- align,
905
- sideOffset,
906
- className: cn(
907
- "pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
908
- className
909
- ),
910
- onOpenAutoFocus: props.onOpenAutoFocus,
911
- onCloseAutoFocus: props.onCloseAutoFocus,
912
- ...props
913
- }
914
- ) }) : /* @__PURE__ */ jsx17(
915
- PopoverPrimitive.Content,
916
- {
917
- ref,
918
- align,
919
- sideOffset,
920
- className: cn(
921
- "pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
922
- className
923
- ),
924
- onOpenAutoFocus: props.onOpenAutoFocus,
925
- onCloseAutoFocus: props.onCloseAutoFocus,
926
- ...props
927
- }
928
- )
929
- );
930
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
931
- var Popover = ({
932
- trigger,
933
- children,
934
- open,
935
- onOpenChange,
936
- contentClassName,
937
- asChild = true,
938
- align,
939
- side,
940
- alignOffset,
941
- triggerClassName,
942
- sideOffset,
943
- onOpenAutoFocus,
944
- onCloseAutoFocus,
945
- portal = true,
946
- ...props
947
- }) => {
948
- return /* @__PURE__ */ jsxs12(PopoverRoot, { ...props, open, onOpenChange, children: [
949
- /* @__PURE__ */ jsx17(PopoverTrigger, { asChild, className: triggerClassName, children: trigger }),
950
- /* @__PURE__ */ jsx17(
951
- PopoverContent,
952
- {
953
- alignOffset,
954
- sideOffset,
955
- side,
956
- align,
957
- className: contentClassName,
958
- onOpenAutoFocus,
959
- onCloseAutoFocus,
960
- portal,
961
- children
962
- }
963
- )
964
- ] });
965
- };
966
- Popover.displayName = PopoverPrimitive.Root.displayName;
967
-
968
- // src/components/scroll-area/index.tsx
969
- import * as React10 from "react";
970
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
971
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
972
- var ScrollArea = React10.forwardRef(({ className, viewPortClassName, children, ...props }, ref) => /* @__PURE__ */ jsxs13(
973
- ScrollAreaPrimitive.Root,
974
- {
975
- ref,
976
- className: cn("relative overflow-hidden", className),
977
- ...props,
978
- children: [
979
- /* @__PURE__ */ jsx18(
980
- ScrollAreaPrimitive.Viewport,
981
- {
982
- className: cn("h-full w-full rounded-[inherit]", viewPortClassName),
983
- children
984
- }
985
- ),
986
- /* @__PURE__ */ jsx18(ScrollBar, {}),
987
- /* @__PURE__ */ jsx18(ScrollAreaPrimitive.Corner, {})
988
- ]
989
- }
990
- ));
991
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
992
- var ScrollBar = React10.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx18(
993
- ScrollAreaPrimitive.ScrollAreaScrollbar,
994
- {
995
- ref,
996
- orientation,
997
- className: cn(
998
- "flex touch-none select-none transition-colors",
999
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
1000
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
1001
- className
1002
- ),
1003
- ...props,
1004
- children: /* @__PURE__ */ jsx18(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-[#959595] transition hover:bg-[#808080]" })
1005
- }
1006
- ));
1007
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
1008
-
1009
- // src/components/searcheable/index.tsx
1010
- import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
1011
- var SearchableTrigger = ({
1012
- className,
1013
- value,
1014
- placeholder = "",
1015
- status,
1016
- disabled
1017
- }) => {
1018
- return /* @__PURE__ */ jsx19(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs14(
1019
- "button",
1020
- {
1021
- disabled,
1022
- className: cn(
1023
- inputContainerVariants({ status }),
1024
- "[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",
1025
- value ? "" : "text-[#79818C]",
1026
- className
1027
- ),
1028
- children: [
1029
- value ?? placeholder ?? "Select options...",
1030
- /* @__PURE__ */ jsx19(
1031
- "svg",
1032
- {
1033
- width: "20",
1034
- height: "20",
1035
- viewBox: "0 0 20 20",
1036
- fill: "none",
1037
- className: " data-[state=open]:goup-rotate-180",
1038
- children: /* @__PURE__ */ jsx19(
1039
- "path",
1040
- {
1041
- d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
1042
- stroke: "currentColor",
1043
- strokeWidth: "1.5",
1044
- strokeMiterlimit: "10",
1045
- strokeLinecap: "round",
1046
- strokeLinejoin: "round"
1047
- }
1048
- )
1049
- }
1050
- )
1051
- ]
1052
- }
1053
- ) });
1054
- };
1055
- var Searchable = ({
1056
- options = [],
1057
- value,
1058
- onChange,
1059
- containerClassName,
1060
- placeholder,
1061
- disabled,
1062
- loading,
1063
- optionComponent,
1064
- children,
1065
- modal = false,
1066
- hideSearch,
1067
- className,
1068
- inputValue,
1069
- onValueChange,
1070
- onInputValueChange
1071
- }) => {
1072
- const [open, setOpen] = React11.useState(false);
1073
- const triggerRef = React11.useRef(null);
1074
- const [width, setWidth] = React11.useState(void 0);
1075
- React11.useLayoutEffect(() => {
1076
- if (triggerRef.current) {
1077
- setWidth(triggerRef.current.clientWidth);
1078
- }
1079
- }, [triggerRef.current]);
1080
- return /* @__PURE__ */ jsxs14(PopoverRoot, { modal, open, onOpenChange: setOpen, children: [
1081
- /* @__PURE__ */ jsx19("div", { className: cn("w-full", className), ref: triggerRef, children }),
1082
- /* @__PURE__ */ jsx19(
1083
- PopoverContent,
1084
- {
1085
- portal: !modal,
1086
- className: "p-0 min-w-[200px]",
1087
- style: { width },
1088
- children: /* @__PURE__ */ jsxs14(
1089
- Command,
1090
- {
1091
- className: cn("relative max-h-[270px]", {
1092
- "mt-2": !hideSearch
1093
- }),
1094
- children: [
1095
- !hideSearch && /* @__PURE__ */ jsx19(
1096
- CommandInput,
1097
- {
1098
- loading,
1099
- placeholder: placeholder ?? "Search options...",
1100
- onValueChange: onInputValueChange,
1101
- value: inputValue,
1102
- CommandInputContainerClassName: "mx-2 border rounded-md border-[#DEDEDE]"
1103
- }
1104
- ),
1105
- /* @__PURE__ */ jsx19(
1106
- ScrollArea,
1107
- {
1108
- viewPortClassName: "max-h-[225px]",
1109
- className: cn(
1110
- "w-full px-0 h-full overflow-y-auto",
1111
- containerClassName
1112
- ),
1113
- children: /* @__PURE__ */ jsxs14(CommandList, { children: [
1114
- !hideSearch && /* @__PURE__ */ jsx19(CommandEmpty, { children: "No result found." }),
1115
- /* @__PURE__ */ jsx19(CommandGroup, { className: "w-full", children: options?.map((option) => /* @__PURE__ */ jsx19(
1116
- CommandItem,
1117
- {
1118
- defaultValue: value?.label,
1119
- value: option.label,
1120
- disabled,
1121
- onSelect: () => {
1122
- onChange(option);
1123
- setOpen(false);
1124
- onValueChange?.(option?.value);
1125
- },
1126
- children: !optionComponent ? option.label : optionComponent(option)
1127
- },
1128
- option.value
1129
- )) })
1130
- ] })
1131
- }
1132
- )
1133
- ]
1134
- }
1135
- )
1136
- }
1137
- )
1138
- ] });
1139
- };
1140
-
1141
- // src/components/country/data.ts
1142
- var countryData = [
1143
- {
1144
- countryCode: "GLOBAL",
1145
- countryName: "Global",
1146
- currency: "Dollars",
1147
- currencyCode: "USD",
1148
- internetCountryCode: "GLOBAL"
1149
- },
1150
- {
1151
- countryName: "Benin",
1152
- countryCode: "+229",
1153
- currency: "West African CFA franc",
1154
- currencyCode: "XOF",
1155
- currencyIcon: "Fr",
1156
- internetCountryCode: "BJ"
1157
- },
1158
- {
1159
- countryName: "Burkina Faso",
1160
- countryCode: "+226",
1161
- currency: "West African CFA franc",
1162
- currencyCode: "XOF",
1163
- currencyIcon: "Fr",
1164
- internetCountryCode: "BF"
1165
- },
1166
- {
1167
- countryName: "Cameroon",
1168
- countryCode: "+237",
1169
- currency: "Central African CFA franc",
1170
- currencyCode: "XAF",
1171
- currencyIcon: "Fr",
1172
- internetCountryCode: "CM"
1173
- },
1174
- {
1175
- countryName: "Chad",
1176
- countryCode: "+235",
1177
- currency: "Central African CFA franc",
1178
- currencyCode: "XAF",
1179
- currencyIcon: "Fr",
1180
- internetCountryCode: "TD"
1181
- },
1182
- {
1183
- countryName: "DR Congo",
1184
- countryCode: "+243",
1185
- currency: "Congolese franc",
1186
- currencyCode: "CDF",
1187
- currencyIcon: "FC",
1188
- internetCountryCode: "CD"
1189
- },
1190
- {
1191
- countryName: "Eswatini",
1192
- countryCode: "+268",
1193
- currency: "Swazi lilangeni",
1194
- currencyCode: "SZL",
1195
- currencyIcon: "L",
1196
- internetCountryCode: "SZ"
1197
- },
1198
- {
1199
- countryName: "Gabon",
1200
- countryCode: "+241",
1201
- currency: "Central African CFA franc",
1202
- currencyCode: "XAF",
1203
- currencyIcon: "Fr",
1204
- internetCountryCode: "GA"
1205
- },
1206
- {
1207
- countryName: "Ghana",
1208
- countryCode: "+233",
1209
- currency: "Ghanaian cedi",
1210
- currencyCode: "GHS",
1211
- currencyIcon: "\u20B5",
1212
- internetCountryCode: "GH"
1213
- },
1214
- {
1215
- countryName: "Guinea",
1216
- countryCode: "+224",
1217
- currency: "Guinean franc",
1218
- currencyCode: "GNF",
1219
- currencyIcon: "Fr",
1220
- internetCountryCode: "GN"
1221
- },
1222
- {
1223
- countryName: "Ivory Coast",
1224
- countryCode: "+225",
1225
- currency: "West African CFA franc",
1226
- currencyCode: "XOF",
1227
- currencyIcon: "Fr",
1228
- internetCountryCode: "CI"
1229
- },
1230
- {
1231
- countryName: "Kenya",
1232
- countryCode: "+254",
1233
- currency: "Kenyan shilling",
1234
- currencyCode: "KES",
1235
- currencyIcon: "Sh",
1236
- internetCountryCode: "KE"
1237
- },
1238
- {
1239
- countryName: "Lesotho",
1240
- countryCode: "+266",
1241
- currency: "Lesotho loti",
1242
- currencyCode: "LSL",
1243
- currencyIcon: "L",
1244
- internetCountryCode: "LS"
1245
- },
1246
- {
1247
- countryName: "Liberia",
1248
- countryCode: "+231",
1249
- currency: "Liberian dollar",
1250
- currencyCode: "LRD",
1251
- currencyIcon: "$",
1252
- internetCountryCode: "LR"
1253
- },
1254
- {
1255
- countryName: "Madagascar",
1256
- countryCode: "+261",
1257
- currency: "Malagasy ariary",
1258
- currencyCode: "MGA",
1259
- currencyIcon: "Ar",
1260
- internetCountryCode: "MG"
1261
- },
1262
- {
1263
- countryName: "Malawi",
1264
- countryCode: "+265",
1265
- currency: "Malawian kwacha",
1266
- currencyCode: "MWK",
1267
- currencyIcon: "MK",
1268
- internetCountryCode: "MW"
1269
- },
1270
- {
1271
- countryName: "Mali",
1272
- countryCode: "+223",
1273
- currency: "West African CFA franc",
1274
- currencyCode: "XOF",
1275
- currencyIcon: "Fr",
1276
- internetCountryCode: "ML"
1277
- },
1278
- {
1279
- countryName: "Mozambique",
1280
- countryCode: "+258",
1281
- currency: "Mozambican metical",
1282
- currencyCode: "MZN",
1283
- currencyIcon: "MT",
1284
- internetCountryCode: "MZ"
1285
- },
1286
- {
1287
- countryName: "Namibia",
1288
- countryCode: "+264",
1289
- currency: "Namibian dollar",
1290
- currencyCode: "NAD",
1291
- currencyIcon: "$",
1292
- internetCountryCode: "NA"
1293
- },
1294
- {
1295
- countryName: "Niger",
1296
- countryCode: "+227",
1297
- currency: "West African CFA franc",
1298
- currencyCode: "XOF",
1299
- currencyIcon: "Fr",
1300
- internetCountryCode: "NE"
1301
- },
1302
- {
1303
- countryName: "Nigeria",
1304
- countryCode: "+234",
1305
- currency: "Nigerian naira",
1306
- currencyCode: "NGN",
1307
- currencyIcon: "\u20A6",
1308
- internetCountryCode: "NG"
1309
- },
1310
- {
1311
- countryName: "Republic of the Congo",
1312
- countryCode: "+242",
1313
- currency: "Central African CFA franc",
1314
- currencyCode: "XAF",
1315
- currencyIcon: "Fr",
1316
- internetCountryCode: "CG"
1317
- },
1318
- {
1319
- countryName: "Rwanda",
1320
- countryCode: "+250",
1321
- currency: "Rwandan franc",
1322
- currencyCode: "RWF",
1323
- currencyIcon: "Fr",
1324
- internetCountryCode: "RW"
1325
- },
1326
- {
1327
- countryName: "Senegal",
1328
- countryCode: "+221",
1329
- currency: "West African CFA franc",
1330
- currencyCode: "XOF",
1331
- currencyIcon: "Fr",
1332
- internetCountryCode: "SN"
1333
- },
1334
- {
1335
- countryName: "Seychelles",
1336
- countryCode: "+248",
1337
- currency: "Seychellois rupee",
1338
- currencyCode: "SCR",
1339
- currencyIcon: "\u20A8",
1340
- internetCountryCode: "SC"
1341
- },
1342
- {
1343
- countryName: "South Africa",
1344
- countryCode: "+27",
1345
- currency: "South African rand",
1346
- currencyCode: "ZAR",
1347
- currencyIcon: "R",
1348
- internetCountryCode: "ZA"
1349
- },
1350
- {
1351
- countryName: "South Sudan",
1352
- countryCode: "+211",
1353
- currency: "South Sudanese pound",
1354
- currencyCode: "SSP",
1355
- currencyIcon: "\xA3",
1356
- internetCountryCode: "SS"
1357
- },
1358
- {
1359
- countryName: "Tanzania",
1360
- countryCode: "+255",
1361
- currency: "Tanzanian shilling",
1362
- currencyCode: "TZS",
1363
- currencyIcon: "Sh",
1364
- internetCountryCode: "TZ"
1365
- },
1366
- {
1367
- countryName: "Togo",
1368
- countryCode: "+228",
1369
- currency: "West African CFA franc",
1370
- currencyCode: "XOF",
1371
- currencyIcon: "Fr",
1372
- internetCountryCode: "TG"
1373
- },
1374
- {
1375
- countryName: "Uganda",
1376
- countryCode: "+256",
1377
- currency: "Ugandan shilling",
1378
- currencyCode: "UGX",
1379
- currencyIcon: "Sh",
1380
- internetCountryCode: "UG"
1381
- },
1382
- {
1383
- countryName: "Zambia",
1384
- countryCode: "+260",
1385
- currency: "Zambian kwacha",
1386
- currencyCode: "ZMW",
1387
- currencyIcon: "ZK",
1388
- internetCountryCode: "ZM"
1389
- }
1390
- ];
1391
- var getCountryDataMap = () => {
1392
- const frequency = {};
1393
- countryData?.forEach((country) => {
1394
- frequency[country?.internetCountryCode] = country?.countryName;
1395
- });
1396
- return frequency;
1397
- };
1398
-
1399
- // src/components/phone-input/index.tsx
1400
- import * as React12 from "react";
1401
- import * as RPNInput from "react-phone-number-input";
1402
- import flags from "react-phone-number-input/flags";
1403
-
1404
- // src/components/phone-input/Flag.tsx
1405
- import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
1406
- var FlatGlobeIcon = (props) => {
1407
- return /* @__PURE__ */ jsxs15(
1408
- "svg",
1409
- {
1410
- xmlns: "http://www.w3.org/2000/svg",
1411
- viewBox: "0 0 32 32",
1412
- fill: "none",
1413
- ...props,
1414
- children: [
1415
- /* @__PURE__ */ jsx20("rect", { width: "32", height: "32", fill: "#60A5FA" }),
1416
- " ",
1417
- /* @__PURE__ */ jsx20(
1418
- "path",
1419
- {
1420
- d: "M3 10L7 8L10 9L13 8L16 10L19 9L22 11L25 10L28 12V15L26 17L28 19L27 22L29 24L27 26L24 25L21 26L18 24L15 25L12 23L9 24L6 22L4 23L2 21V18L4 16L3 13L5 11L3 10Z",
1421
- fill: "#34D399"
1422
- }
1423
- ),
1424
- /* @__PURE__ */ jsx20("rect", { x: "2", y: "28", width: "28", height: "3", fill: "#D1D5DB" }),
1425
- /* @__PURE__ */ jsx20(
1426
- "path",
1427
- {
1428
- d: "M0 16H32M8 0V32M16 0V32M24 0V32",
1429
- stroke: "#2563EB",
1430
- strokeWidth: "0.5",
1431
- vectorEffect: "non-scaling-stroke"
1432
- }
1433
- ),
1434
- /* @__PURE__ */ jsx20(
1435
- "path",
1436
- {
1437
- d: "M0 16H32",
1438
- stroke: "#2563EB",
1439
- strokeWidth: "1",
1440
- vectorEffect: "non-scaling-stroke"
1441
- }
1442
- )
1443
- ]
1444
- }
1445
- );
1446
- };
1447
- var Flag_default = FlatGlobeIcon;
1448
-
1449
- // src/components/phone-input/index.tsx
1450
- import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
1451
- var PhoneInput = React12.forwardRef(
1452
- ({
1453
- className,
1454
- onChange,
1455
- defaultCountry = "NG",
1456
- modal,
1457
- showAsterisk,
1458
- label,
1459
- description,
1460
- error,
1461
- ...props
1462
- }, ref) => {
1463
- const CountrySelectWrapper = (innerProps) => {
1464
- return /* @__PURE__ */ jsx21(CountrySelect, { ...innerProps, status: props.status, modal });
1465
- };
1466
- return /* @__PURE__ */ jsxs16("div", { className: "relative space-y-1", children: [
1467
- /* @__PURE__ */ jsx21(FormLabel, { showAsterisk, error, children: label }),
1468
- /* @__PURE__ */ jsx21(
1469
- RPNInput.default,
1470
- {
1471
- ref,
1472
- className: cn("flex", className),
1473
- flagComponent: FlagComponent,
1474
- countrySelectComponent: CountrySelectWrapper,
1475
- inputComponent: InputComponent,
1476
- defaultCountry,
1477
- onChange: (value) => {
1478
- if (onChange) {
1479
- onChange?.(value);
1480
- }
1481
- },
1482
- ...props
1483
- }
1484
- ),
1485
- /* @__PURE__ */ jsx21(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
1486
- /* @__PURE__ */ jsx21(ErrorMessage, { error })
1487
- ] });
1488
- }
1489
- );
1490
- PhoneInput.displayName = "PhoneInput";
1491
- var InputComponent = React12.forwardRef(
1492
- ({ className, ...props }, ref) => {
1493
- return /* @__PURE__ */ jsx21(
1494
- Input,
1495
- {
1496
- className: cn("!rounded-s-none h-10", className),
1497
- ...props,
1498
- ref
1499
- }
1500
- );
1501
- }
1502
- );
1503
- InputComponent.displayName = "InputComponent";
1504
- var CountrySelect = ({
1505
- disabled,
1506
- value,
1507
- onChange,
1508
- options,
1509
- status,
1510
- modal
1511
- }) => {
1512
- const handleSelect = React12.useCallback(
1513
- (country) => {
1514
- onChange(country);
1515
- },
1516
- [onChange]
1517
- );
1518
- return /* @__PURE__ */ jsxs16(PopoverRoot, { modal, children: [
1519
- /* @__PURE__ */ jsx21(PopoverTrigger, { disabled, children: /* @__PURE__ */ jsxs16(
1520
- "div",
1521
- {
1522
- className: cn(
1523
- inputContainerVariants({ status }),
1524
- "transition justify-center items-center disabled:text-base-500 flex gap-3 h-10 rounded-e-none border-e-0 pl-2 pr-2"
1525
- ),
1526
- children: [
1527
- /* @__PURE__ */ jsx21(FlagComponent, { country: value, countryName: value }),
1528
- /* @__PURE__ */ jsx21(
1529
- "svg",
1530
- {
1531
- className: cn(
1532
- "mr-0.5 h-4 w-4 opacity-50",
1533
- disabled ? "hidden" : "opacity-100"
1534
- ),
1535
- width: "20",
1536
- height: "20",
1537
- viewBox: "0 0 20 20",
1538
- fill: "none",
1539
- children: /* @__PURE__ */ jsx21(
1540
- "path",
1541
- {
1542
- d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
1543
- stroke: "#959595",
1544
- strokeWidth: "1.5",
1545
- strokeMiterlimit: "10",
1546
- strokeLinecap: "round",
1547
- strokeLinejoin: "round"
1548
- }
1549
- )
1550
- }
1551
- )
1552
- ]
1553
- }
1554
- ) }),
1555
- /* @__PURE__ */ jsx21(PopoverContent, { portal: !modal, className: "w-[200px] md:w-[300px] p-0", children: /* @__PURE__ */ jsx21(Command, { children: /* @__PURE__ */ jsx21(CommandList, { children: /* @__PURE__ */ jsxs16(ScrollArea, { className: "h-72", children: [
1556
- /* @__PURE__ */ jsx21(CommandInput, { placeholder: "Search country..." }),
1557
- /* @__PURE__ */ jsx21(CommandEmpty, { children: "No country found." }),
1558
- /* @__PURE__ */ jsx21(CommandGroup, { children: options.filter((x) => x.value).map((option) => /* @__PURE__ */ jsxs16(
1559
- CommandItem,
1560
- {
1561
- className: "gap-2",
1562
- onSelect: () => handleSelect(option.value),
1563
- children: [
1564
- /* @__PURE__ */ jsx21(
1565
- FlagComponent,
1566
- {
1567
- country: option.value,
1568
- countryName: option.label
1569
- }
1570
- ),
1571
- /* @__PURE__ */ jsx21("span", { className: "flex-1 text-sm", children: option.label }),
1572
- option.value && /* @__PURE__ */ jsx21("span", { className: "text-[#191919]/50 text-sm dark:text-white", children: `+${RPNInput.getCountryCallingCode(option.value)}` }),
1573
- /* @__PURE__ */ jsx21(
1574
- "svg",
1575
- {
1576
- width: "16",
1577
- height: "16",
1578
- viewBox: "0 0 16 16",
1579
- fill: "none",
1580
- className: cn(
1581
- "ml-auto",
1582
- option.value === value ? "opacity-100" : "opacity-0"
1583
- ),
1584
- children: /* @__PURE__ */ jsx21(
1585
- "path",
1586
- {
1587
- d: "M4 8.00008L6.66353 10.6636L12 5.33655",
1588
- stroke: "#959595",
1589
- strokeWidth: "1.06667",
1590
- strokeLinecap: "round",
1591
- strokeLinejoin: "round"
1592
- }
1593
- )
1594
- }
1595
- )
1596
- ]
1597
- },
1598
- `${option.value}-${option.label}`
1599
- )) })
1600
- ] }) }) }) })
1601
- ] });
1602
- };
1603
- var FlagComponent = ({
1604
- country,
1605
- countryName,
1606
- className
1607
- }) => {
1608
- const Flag = flags[country];
1609
- if (country === "GLOBAL")
1610
- return /* @__PURE__ */ jsx21(
1611
- "span",
1612
- {
1613
- className: cn(
1614
- "bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",
1615
- className
1616
- ),
1617
- children: /* @__PURE__ */ jsx21(Flag_default, { className: "w-full h-[90%]" })
1618
- }
1619
- );
1620
- return /* @__PURE__ */ jsx21(
1621
- "span",
1622
- {
1623
- className: cn(
1624
- "bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",
1625
- className
1626
- ),
1627
- children: Flag && /* @__PURE__ */ jsx21(Flag, { title: countryName })
1628
- }
1629
- );
1630
- };
1631
- FlagComponent.displayName = "FlagComponent";
1632
-
1633
- // src/components/country/index.tsx
1634
- import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
1635
- var countryMap = getCountryDataMap();
1636
- var CountryTrigger = ({
1637
- className,
1638
- value,
1639
- placeholder = "",
1640
- status,
1641
- disabled
1642
- }) => {
1643
- return /* @__PURE__ */ jsx22(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ jsxs17(
1644
- "button",
1645
- {
1646
- disabled,
1647
- className: cn(
1648
- inputContainerVariants({ status }),
1649
- "[&>span]:justify-start [&>span]:items-center gap-2 flex w-full items-center justify-between goup",
1650
- value ? "" : "text-[#79818C]",
1651
- className
1652
- ),
1653
- children: [
1654
- value ? /* @__PURE__ */ jsxs17("div", { className: "flex gap-2 items-center", children: [
1655
- /* @__PURE__ */ jsx22(
1656
- FlagComponent,
1657
- {
1658
- country: value,
1659
- countryName: value,
1660
- className: "ml-1 !w-6 h-5"
1661
- }
1662
- ),
1663
- /* @__PURE__ */ jsxs17("span", { className: "", children: [
1664
- " ",
1665
- countryMap[value]
1666
- ] })
1667
- ] }) : placeholder ?? "Select options...",
1668
- /* @__PURE__ */ jsx22(
1669
- "svg",
1670
- {
1671
- width: "20",
1672
- height: "20",
1673
- viewBox: "0 0 20 20",
1674
- fill: "none",
1675
- className: " data-[state=open]:goup-rotate-180",
1676
- children: /* @__PURE__ */ jsx22(
1677
- "path",
1678
- {
1679
- d: "M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",
1680
- stroke: "currentColor",
1681
- strokeWidth: "1.5",
1682
- strokeMiterlimit: "10",
1683
- strokeLinecap: "round",
1684
- strokeLinejoin: "round"
1685
- }
1686
- )
1687
- }
1688
- )
1689
- ]
1690
- }
1691
- ) });
1692
- };
1693
- var Country = ({
1694
- hideSearch = true,
1695
- showAsterisk,
1696
- label,
1697
- description,
1698
- error,
1699
- ...props
1700
- }) => {
1701
- const options = countryData?.map((country) => ({
1702
- value: country?.internetCountryCode,
1703
- label: country?.countryName,
1704
- ...country
1705
- }));
1706
- return /* @__PURE__ */ jsxs17("div", { className: "relative space-y-1", children: [
1707
- /* @__PURE__ */ jsx22(FormLabel, { showAsterisk, error, children: label }),
1708
- /* @__PURE__ */ jsx22(
1709
- Searchable,
1710
- {
1711
- options,
1712
- hideSearch,
1713
- optionComponent: (arg) => {
1714
- return /* @__PURE__ */ jsxs17("div", { className: "w-full flex items-center gap-2", children: [
1715
- /* @__PURE__ */ jsx22(
1716
- FlagComponent,
1717
- {
1718
- country: arg?.internetCountryCode,
1719
- countryName: arg?.label,
1720
- className: "ml-2 !w-6 !h-5"
1721
- }
1722
- ),
1723
- /* @__PURE__ */ jsx22("span", { className: "flex-1 text-sm", children: arg?.label })
1724
- ] });
1725
- },
1726
- ...props,
1727
- children: /* @__PURE__ */ jsx22(
1728
- CountryTrigger,
1729
- {
1730
- value: props?.value?.value,
1731
- status: props?.status,
1732
- placeholder: props?.placeholder ?? " Select Country"
1733
- }
1734
- )
1735
- }
1736
- ),
1737
- /* @__PURE__ */ jsx22(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
1738
- /* @__PURE__ */ jsx22(ErrorMessage, { error })
1739
- ] });
1740
- };
1741
-
1742
- // src/components/select/index.tsx
1743
- import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
1744
- var Select = ({
1745
- showAsterisk,
1746
- label,
1747
- description,
1748
- error,
1749
- hideSearch = true,
1750
- status,
1751
- ...props
1752
- }) => {
1753
- return /* @__PURE__ */ jsxs18("div", { className: "relative space-y-1", children: [
1754
- /* @__PURE__ */ jsx23(FormLabel, { showAsterisk, error, children: label }),
1755
- /* @__PURE__ */ jsx23(
1756
- Searchable,
1757
- {
1758
- hideSearch,
1759
- ...props,
1760
- containerClassName: "h-full",
1761
- children: /* @__PURE__ */ jsx23(
1762
- SearchableTrigger,
1763
- {
1764
- disabled: props?.disabled,
1765
- placeholder: "Select or search email",
1766
- status,
1767
- value: props?.value?.label ?? props?.value?.value
1768
- }
1769
- )
1770
- }
1771
- ),
1772
- /* @__PURE__ */ jsx23(FormDescription, { className: "text-gray-400 text-sm !font-normal", children: description }),
1773
- /* @__PURE__ */ jsx23(ErrorMessage, { error })
1774
- ] });
1775
- };
1776
-
1777
- // src/components/otp/index.tsx
1778
- import OtpInput from "react-otp-input";
1779
- import { cva as cva5 } from "class-variance-authority";
1780
- import { useMemo as useMemo2 } from "react";
1781
- import { jsx as jsx24 } from "react/jsx-runtime";
1782
- var otpInputVariants = cva5(
1783
- "transition cursor-default placeholder:text-black dark:placeholder:text-white rounded-lg !h-14 !w-14 border aspect-square text-base font-semibold tracking-normal outline-none placeholder:text-sm placeholder:font-normal text-black focus:bg-white",
1784
- {
1785
- variants: {
1786
- status: {
1787
- default: "border-gray-300 dark:border-[#d4d4d4] focus:border-gray-400 focus-visible:!ring-offset-gray-200 focus:ring-offset-gray-200 !ring-gray-200 !focus-visible:ring-1 bg-white dark:!bg-transparent dark:focus-visible:!ring-0 dark:focus-within:!bg-transparent dark:text-white dark:focus-within:border-[#9299A2] dark:border-[#676767] dark:disabled:!border-[#9299A2]",
1788
- error: "placeholder:text-red-600 bg-red-50 border-red-600 text-red-600 focus-within:bg-red-50 focus-within:border-red-600",
1789
- loading: "placeholder:text-[#C4C4C4]"
1790
- }
1791
- },
1792
- defaultVariants: {
1793
- status: "default"
1794
- }
1795
- }
1796
- );
1797
- var OTPInput = ({
1798
- numInputs = 4,
1799
- inputStyle,
1800
- containerStyle,
1801
- placeholder = "-",
1802
- status,
1803
- ...props
1804
- }) => {
1805
- const placeholderValue = useMemo2(() => {
1806
- if (placeholder) return placeholder;
1807
- const numInputArr = new Array(numInputs).fill("");
1808
- const result = numInputArr.reduce((accumulator, currentValue) => {
1809
- return accumulator += currentValue;
1810
- }, "");
1811
- return result;
1812
- }, [numInputs, placeholder]);
1813
- return /* @__PURE__ */ jsx24(
1814
- OtpInput,
1815
- {
1816
- numInputs,
1817
- placeholder: placeholderValue,
1818
- containerStyle: cn("w-full", containerStyle),
1819
- inputStyle: cn(otpInputVariants({ status }), inputStyle),
1820
- renderInput: (props2) => /* @__PURE__ */ jsx24("input", { ...props2 }),
1821
- ...props
1822
- }
1823
- );
1824
- };
1825
-
1826
- // src/components/copyable-label/index.tsx
1827
- import { useState as useState3 } from "react";
1828
- import { Copy, CheckIcon } from "lucide-react";
1829
- import { motion, AnimatePresence } from "framer-motion";
1830
- import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
1831
- var CopyableLabel = ({
1832
- text,
1833
- textToCopy,
1834
- onCopy,
1835
- iconsPosition = "right",
1836
- clampText = true,
1837
- textClassName
1838
- }) => {
1839
- const [copied, setCopied] = useState3(false);
1840
- const copyToClipboard = () => {
1841
- navigator.clipboard.writeText(textToCopy ?? text).then(() => {
1842
- setCopied(true);
1843
- onCopy?.();
1844
- setTimeout(() => setCopied(false), 2e3);
1845
- });
1846
- };
1847
- const Icon2 = copied ? CheckIcon : Copy;
1848
- return /* @__PURE__ */ jsxs19("div", { className: "flex items-center space-x-2 cursor-pointer text-[#717171] bg-gray-100 w-fit max-w-full rounded-md p-1 px-2", children: [
1849
- iconsPosition === "left" && /* @__PURE__ */ jsx25(AnimatedIcon, { Icon: Icon2, onClick: copyToClipboard, copied }),
1850
- /* @__PURE__ */ jsx25(
1851
- "span",
1852
- {
1853
- className: cn({ "truncate max-w-[100px]": clampText }, textClassName),
1854
- children: text
1855
- }
1856
- ),
1857
- iconsPosition === "right" && /* @__PURE__ */ jsx25(AnimatedIcon, { Icon: Icon2, onClick: copyToClipboard, copied })
1858
- ] });
1859
- };
1860
- var AnimatedIcon = ({ Icon: Icon2, onClick, copied }) => /* @__PURE__ */ jsx25(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx25(
1861
- motion.div,
1862
- {
1863
- initial: { opacity: 0, scale: 0.8 },
1864
- animate: { opacity: 1, scale: 1 },
1865
- exit: { opacity: 0, scale: 0.8 },
1866
- transition: { duration: 0.2 },
1867
- onClick,
1868
- children: /* @__PURE__ */ jsx25(
1869
- Icon2,
1870
- {
1871
- className: `w-5 h-5 ${copied ? "text-green-500" : "text-gray-500 hover:text-gray-700 transition"}`
1872
- }
1873
- )
1874
- },
1875
- copied ? "check" : "copy"
1876
- ) });
1877
-
1878
- // src/components/debounced-input/index.tsx
1879
- import { useEffect, useState as useState4 } from "react";
1880
- import { Search as Search2 } from "lucide-react";
1881
- import { jsx as jsx26 } from "react/jsx-runtime";
1882
- var DebouncedInput = ({
1883
- value: initialValue,
1884
- onChange,
1885
- debounce = 500,
1886
- addon,
1887
- ...props
1888
- }) => {
1889
- const [value, setValue] = useState4(initialValue ?? "");
1890
- const handleInputChange = (event) => setValue(event.target.value);
1891
- useEffect(() => {
1892
- if (!initialValue) return;
1893
- setValue(initialValue);
1894
- }, [initialValue]);
1895
- useEffect(() => {
1896
- const timeout = setTimeout(() => {
1897
- onChange(value);
1898
- }, debounce);
1899
- return () => clearTimeout(timeout);
1900
- }, [value, debounce, onChange]);
1901
- return /* @__PURE__ */ jsx26(
1902
- Input,
1903
- {
1904
- leftNode: addon ?? /* @__PURE__ */ jsx26(Search2, { className: " w-4 h-4 text-gray-400" }),
1905
- sideNodeClassName: "bg-transparent !pr-0 !w-4 border-0 !min-w-[40px]",
1906
- ...props,
1907
- className: cn(
1908
- "!pl-0 py-1 border-[.5px] border-[#E9EBF8] rounded-xl text-sm w-full h-8 focus:outline-none focus:placeholder:hidden focus:!ring-2 !focus:ring-primary-main bg-[#F5F8FF] focus-within:!bg-transparent placeholder:text-xs",
1909
- props?.className
1910
- ),
1911
- onChange: handleInputChange,
1912
- value
1913
- }
1914
- );
1915
- };
1916
-
1917
- // src/components/status/index.tsx
1918
- import { jsx as jsx27 } from "react/jsx-runtime";
1919
- var Status = ({
1920
- status,
1921
- variant,
1922
- className
1923
- }) => {
1924
- return /* @__PURE__ */ jsx27("div", { children: /* @__PURE__ */ jsx27(
1925
- "div",
1926
- {
1927
- className: cn(
1928
- "order-first max-w-max flex-none rounded-full px-2 py-1 text-xs font-medium ring-1 ring-inset ring-current sm:order-none text-[14px] capitalize",
1929
- {
1930
- "bg-green-500/20 text-green-500": variant === "success"
1931
- },
1932
- {
1933
- "bg-gray-500/20 text-white": variant === "abandoned"
1934
- },
1935
- {
1936
- "bg-red-500/20 text-red-500": variant === "failed"
1937
- },
1938
- {
1939
- "bg-yellow-500/20 text-yellow-500": variant === "pending"
1940
- },
1941
- className
1942
- ),
1943
- children: /* @__PURE__ */ jsx27("p", { children: status.replace("-", " ") })
1944
- }
1945
- ) });
1946
- };
1947
-
1948
- // src/components/table/index.tsx
1949
- import { Download, ListFilter, Loader as Loader2, RotateCw } from "lucide-react";
1950
-
1951
- // src/components/table/pagination/index.tsx
1952
- import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
1953
-
1954
- // src/components/table/pagination/utils.tsx
1955
- import { jsx as jsx28 } from "react/jsx-runtime";
1956
- var PageButton = ({
1957
- page,
1958
- currentPage,
1959
- onClick
1960
- }) => {
1961
- if (typeof page === "string") {
1962
- return /* @__PURE__ */ jsx28("span", { className: "px-3 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm font-semibold text-gray-500", children: page });
1963
- }
1964
- return /* @__PURE__ */ jsx28(
1965
- "button",
1966
- {
1967
- onClick,
1968
- className: `p-1 w-8 h-8 text-xs sm:text-sm rounded-full ${page === currentPage ? "bg-primary-main text-white" : "text-[#717171] hover:bg-primary-main/10"}`,
1969
- children: page
1970
- }
1971
- );
1972
- };
1973
- var renderPageNumbers = ({
1974
- totalPages,
1975
- currentPage,
1976
- handlePageClick
1977
- }) => {
1978
- const maxVisiblePages = 3;
1979
- const getWindowBounds = () => {
1980
- const halfWindow = Math.floor(maxVisiblePages / 2);
1981
- let start2 = Math.max(1, currentPage - halfWindow);
1982
- let end2 = Math.min(totalPages, start2 + maxVisiblePages - 1);
1983
- if (end2 > totalPages) {
1984
- start2 = Math.max(1, totalPages - maxVisiblePages + 1);
1985
- end2 = totalPages;
1986
- }
1987
- return { start: start2, end: end2 };
1988
- };
1989
- const { start, end } = getWindowBounds();
1990
- const pages = [];
1991
- if (start > 1) pages.push(1);
1992
- if (start > 2) pages.push("...");
1993
- pages.push(...Array.from({ length: end - start + 1 }, (_, i) => start + i));
1994
- if (end < totalPages - 1) pages.push("...");
1995
- if (end < totalPages) pages.push(totalPages);
1996
- return pages.map((page, idx) => /* @__PURE__ */ jsx28(
1997
- PageButton,
1998
- {
1999
- page,
2000
- currentPage,
2001
- onClick: typeof page === "number" ? () => handlePageClick(page) : void 0
2002
- },
2003
- idx
2004
- ));
2005
- };
2006
-
2007
- // src/components/table/pagination/index.tsx
2008
- import { jsx as jsx29, jsxs as jsxs20 } from "react/jsx-runtime";
2009
- var Pagination = ({
2010
- currentPage = 1,
2011
- totalPages = 1,
2012
- onPageChange,
2013
- itemsPerPage = 0,
2014
- totalItems = 0
2015
- }) => {
2016
- const handlePageClick = (page) => {
2017
- if (page >= 1 && page <= totalPages) {
2018
- onPageChange?.(page);
2019
- }
2020
- };
2021
- const visibleRangeStart = itemsPerPage === 0 ? 1 : itemsPerPage * (currentPage - 1) + 1;
2022
- const visibleRangeEnd = currentPage === totalPages ? totalItems : Math.min(visibleRangeStart + itemsPerPage - 1, totalItems);
2023
- return /* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between border-t border-gray-200 px-4 py-3 sm:px-6 w-full flex-wrap gap-y-10 sm:gap-y-0", children: [
2024
- totalItems && /* @__PURE__ */ jsx29("section", { className: "text-[#717171] text-[12px]", children: /* @__PURE__ */ jsxs20("p", { className: "", children: [
2025
- "Showing ",
2026
- visibleRangeStart,
2027
- " - ",
2028
- visibleRangeEnd,
2029
- " of ",
2030
- totalItems
2031
- ] }) }),
2032
- /* @__PURE__ */ jsx29("div", { className: "flex items-center justify-center sm:justify-end ", children: /* @__PURE__ */ jsxs20("nav", { className: " inline-flex gap-x-1 sm:gap-x-[10px] items-center", children: [
2033
- /* @__PURE__ */ jsx29(
2034
- "button",
2035
- {
2036
- onClick: () => handlePageClick(currentPage - 1),
2037
- disabled: currentPage === 1,
2038
- className: "text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",
2039
- children: /* @__PURE__ */ jsx29(ChevronLeftIcon, { className: "size-5" })
2040
- }
2041
- ),
2042
- renderPageNumbers({ currentPage, totalPages, handlePageClick }),
2043
- /* @__PURE__ */ jsx29(
2044
- "button",
2045
- {
2046
- onClick: () => handlePageClick(currentPage + 1),
2047
- disabled: currentPage === totalPages,
2048
- className: "text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",
2049
- children: /* @__PURE__ */ jsx29(ChevronRightIcon, { className: "size-5" })
2050
- }
2051
- )
2052
- ] }) })
2053
- ] });
2054
- };
2055
-
2056
- // src/components/table/TableBody.tsx
2057
- import {
2058
- flexRender
2059
- } from "@tanstack/react-table";
2060
- import { jsx as jsx30, jsxs as jsxs21 } from "react/jsx-runtime";
2061
- var TableBody = ({
2062
- table,
2063
- isMobile,
2064
- onRowClick,
2065
- id
2066
- }) => {
2067
- return /* @__PURE__ */ jsx30("div", { className: cn("relative w-full rounded-b border-0", {}), children: /* @__PURE__ */ jsxs21("table", { id: id ?? "table", className: "w-full overflow-x-scroll", children: [
2068
- /* @__PURE__ */ jsx30("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx30(
2069
- "tr",
2070
- {
2071
- className: cn(
2072
- " rounded text-[#717171] border-b- bg-[#FCFCFC]",
2073
- {}
2074
- ),
2075
- children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx30(
2076
- "th",
2077
- {
2078
- className: "relative py-3 text-base whitespace-nowrap pl-2.5 text-left font-normal capitalize",
2079
- colSpan: header.colSpan,
2080
- style: {
2081
- width: header.getSize()
2082
- },
2083
- children: header.isPlaceholder ? null : /* @__PURE__ */ jsx30(
2084
- "div",
2085
- {
2086
- className: cn("flex items-center", {
2087
- "cursor-pointer select-none": header.column.getCanSort()
2088
- }),
2089
- onClick: header.column.getToggleSortingHandler(),
2090
- children: header.isPlaceholder ? null : flexRender(
2091
- header.column.columnDef.header,
2092
- header.getContext()
2093
- )
2094
- }
2095
- )
2096
- },
2097
- header.id
2098
- ))
2099
- },
2100
- headerGroup.id
2101
- )) }),
2102
- /* @__PURE__ */ jsx30("tbody", { className: " pl-2.5", children: table?.getFilteredRowModel().rows.map((row) => /* @__PURE__ */ jsx30(
2103
- "tr",
2104
- {
2105
- className: cn(
2106
- "first-letter border-b border-zinc-100",
2107
- {
2108
- "hover:bg-gray-50": !isMobile
2109
- },
2110
- {
2111
- "hover:bg-gray-50 hover:cursor-pointer": onRowClick
2112
- }
2113
- ),
2114
- onClick: () => onRowClick ? onRowClick(row) : {},
2115
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx30(
2116
- "td",
2117
- {
2118
- className: cn("", {
2119
- // block: false,
2120
- }),
2121
- children: /* @__PURE__ */ jsx30(
2122
- "div",
2123
- {
2124
- className: cn("", {
2125
- "w-max p-4 pl-2.5 text-black text-sm": true
2126
- }),
2127
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
2128
- }
2129
- )
2130
- },
2131
- cell.id
2132
- ))
2133
- },
2134
- row.id
2135
- )) })
2136
- ] }) });
2137
- };
2138
-
2139
- // src/components/table/index.tsx
2140
- import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
2141
- var Table = ({
2142
- table,
2143
- isMobile = false,
2144
- onRowClick,
2145
- id,
2146
- onRefetch,
2147
- isRefetching,
2148
- FilterMenu,
2149
- ExtraNode,
2150
- //deprecated: onExport - use download
2151
- onExport,
2152
- search = {
2153
- enabled: false,
2154
- debounceRate: 700
2155
- },
2156
- download = {
2157
- enabled: false,
2158
- buttonId: "download_button",
2159
- buttonText: "Export"
2160
- },
2161
- isLoading,
2162
- pagination
2163
- }) => {
2164
- const handleRefetch = () => {
2165
- try {
2166
- onRefetch?.();
2167
- } catch (e) {
2168
- console.error("Error while refetching data", e);
2169
- }
2170
- };
2171
- const handleSearch = (e) => {
2172
- search?.onSearch?.(e);
2173
- };
2174
- return /* @__PURE__ */ jsxs22("div", { className: cn("relative w-full rounded-b border-0 overflow-x-auto"), children: [
2175
- (onRefetch || search?.enabled || FilterMenu || ExtraNode || onExport) && /* @__PURE__ */ jsxs22("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center bg-white p-2 gap-2", children: [
2176
- /* @__PURE__ */ jsx31("div", { className: "flex flex-1 flex-col sm:flex-row items-center gap-2 justify-start", children: /* @__PURE__ */ jsxs22("div", { className: " w-full flex gap-x-3", children: [
2177
- search?.enabled && /* @__PURE__ */ jsx31("section", { className: "sm:w-56", children: /* @__PURE__ */ jsx31(
2178
- DebouncedInput,
2179
- {
2180
- type: "text",
2181
- placeholder: "Enter search here...",
2182
- className: "h-9",
2183
- onChange: handleSearch,
2184
- debounce: search?.debounceRate
2185
- }
2186
- ) }),
2187
- /* @__PURE__ */ jsxs22("div", { className: " flex gap-2", children: [
2188
- onRefetch && /* @__PURE__ */ jsx31(
2189
- Button,
2190
- {
2191
- onClick: handleRefetch,
2192
- title: "Refetch Data",
2193
- disabled: isRefetching,
2194
- variant: "outlined",
2195
- className: "!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px] ",
2196
- size: "sm",
2197
- children: /* @__PURE__ */ jsx31(
2198
- RotateCw,
2199
- {
2200
- className: cn("w-4 h-4", {
2201
- "animate-spin": isRefetching
2202
- }),
2203
- size: 5
2204
- }
2205
- )
2206
- }
2207
- ),
2208
- FilterMenu && /* @__PURE__ */ jsx31(
2209
- Popover,
2210
- {
2211
- trigger: /* @__PURE__ */ jsx31(
2212
- "button",
2213
- {
2214
- title: "Filter",
2215
- className: cn(
2216
- "!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px]",
2217
- buttonVariants({
2218
- variant: "outlined",
2219
- size: "sm"
2220
- })
2221
- ),
2222
- children: /* @__PURE__ */ jsx31(ListFilter, { className: "w-4 h-4", size: 5 })
2223
- }
2224
- ),
2225
- children: FilterMenu
2226
- }
2227
- )
2228
- ] })
2229
- ] }) }),
2230
- /* @__PURE__ */ jsx31("div", { className: "flex items-start flex-col gap-2 justify-center", children: /* @__PURE__ */ jsx31("section", { className: "flex flex-col-reverse sm:flex-row gap-2", children: /* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
2231
- ExtraNode && ExtraNode,
2232
- onExport && /* @__PURE__ */ jsx31(Button, { variant: "primary", onClick: onExport, size: "sm", children: "Export" }),
2233
- download?.enabled && /* @__PURE__ */ jsx31(
2234
- Button,
2235
- {
2236
- variant: "primary",
2237
- leftNode: /* @__PURE__ */ jsx31(
2238
- Download,
2239
- {
2240
- className: cn("w-4 h-4", {
2241
- "animate-spin": isRefetching
2242
- }),
2243
- size: 5
2244
- }
2245
- ),
2246
- onClick: download?.onDownload,
2247
- id: download.buttonId,
2248
- size: "sm",
2249
- children: download?.buttonText
2250
- }
2251
- )
2252
- ] }) }) })
2253
- ] }),
2254
- /* @__PURE__ */ jsx31("main", { className: "w-full overflow-x-auto mt-5", children: isLoading ? /* @__PURE__ */ jsxs22("div", { className: "py-10 flex flex-col justify-center w-full items-center space-x-2", children: [
2255
- /* @__PURE__ */ jsx31(Loader2, { size: 20, className: "animate-spin" }),
2256
- /* @__PURE__ */ jsx31("p", { className: "mt-3 text-center text-gray-600 text-sm opacity-70 animate-pulse", children: "Loading..." })
2257
- ] }) : table.getRowModel().rows.length < 1 ? /* @__PURE__ */ jsx31("div", { className: "py-10 flex flex-col justify-center w-full items-center", children: /* @__PURE__ */ jsx31("p", { className: "text-center text-gray-600 text-sm opacity-70", children: "No data available" }) }) : /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsx31(
2258
- TableBody,
2259
- {
2260
- table,
2261
- isMobile,
2262
- onRowClick,
2263
- id
2264
- }
2265
- ) }) }),
2266
- !isLoading && pagination?.enabled && table.getRowModel().rows.length > 0 && /* @__PURE__ */ jsx31(
2267
- Pagination,
2268
- {
2269
- ...pagination,
2270
- currentPage: pagination?.currentPage ?? 1,
2271
- totalPages: pagination?.totalPages ?? Math.ceil(
2272
- (pagination?.totalItems ?? 0) / Math.max(pagination?.itemsPerPage ?? 1, 1)
2273
- ) ?? 1,
2274
- onPageChange: (page) => pagination?.onPageChange?.(page)
2275
- }
2276
- )
2277
- ] });
2278
- };
2279
-
2280
- // src/components/dev-banner/index.tsx
2281
- import { useEffect as useEffect2 } from "react";
2282
- import { X } from "lucide-react";
2283
- import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
2284
- var DevBanner = (props) => {
2285
- const {
2286
- environment,
2287
- branch,
2288
- version,
2289
- deployTime,
2290
- showBanner,
2291
- onClose,
2292
- initDefault,
2293
- removeFromStorage,
2294
- syncLocalStorageToState
2295
- } = props;
2296
- const currentEnv = environment || process.env.NEXT_PUBLIC_NODE_ENV;
2297
- if (currentEnv !== "staging" && currentEnv !== "sandbox") {
2298
- return null;
2299
- }
2300
- useEffect2(() => {
2301
- syncLocalStorageToState();
2302
- }, [syncLocalStorageToState]);
2303
- useEffect2(() => {
2304
- let interval;
2305
- if (currentEnv === "staging" || currentEnv === "sandbox") {
2306
- interval = setInterval(
2307
- () => {
2308
- removeFromStorage();
2309
- initDefault();
2310
- },
2311
- 5 * 60 * 1e3
2312
- // 5 minutes in milliseconds
2313
- );
2314
- }
2315
- return () => {
2316
- if (interval) {
2317
- clearInterval(interval);
2318
- }
2319
- };
2320
- }, [
2321
- showBanner,
2322
- environment,
2323
- onClose,
2324
- removeFromStorage,
2325
- initDefault,
2326
- currentEnv
2327
- ]);
2328
- if (!showBanner) return null;
2329
- return /* @__PURE__ */ jsxs23("div", { className: "w-fit p-4 border shadow-md bg-white rounded-md z-[99999] absolute top-2 right-2 min-w-96", children: [
2330
- /* @__PURE__ */ jsx32("button", { onClick: onClose, className: "absolute top-2 right-2", children: /* @__PURE__ */ jsx32(X, {}) }),
2331
- /* @__PURE__ */ jsxs23("div", { className: "space-y-2 text-sm", children: [
2332
- /* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
2333
- /* @__PURE__ */ jsx32("span", { className: "font-medium", children: "Environment:" }),
2334
- /* @__PURE__ */ jsx32("span", { className: "text-blue-600 capitalize", children: currentEnv })
2335
- ] }),
2336
- /* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
2337
- /* @__PURE__ */ jsx32("span", { className: "font-medium", children: "Branch:" }),
2338
- /* @__PURE__ */ jsx32("span", { className: "text-green-600 capitalize", children: branch || process.env.NEXT_PUBLIC_DEPLOY_BRANCH })
2339
- ] }),
2340
- /* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
2341
- /* @__PURE__ */ jsx32("span", { className: "font-medium", children: "Version:" }),
2342
- /* @__PURE__ */ jsx32("span", { className: "text-purple-600", children: version || process.env.NEXT_PUBLIC_DEPLOY_VERSION })
2343
- ] }),
2344
- /* @__PURE__ */ jsxs23("div", { className: "flex gap-2", children: [
2345
- /* @__PURE__ */ jsx32("span", { className: "font-medium", children: "Deploy Time:" }),
2346
- /* @__PURE__ */ jsx32("span", { className: "text-orange-600", children: deployTime || process.env.NEXT_PUBLIC_DEPLOY_TIME })
2347
- ] })
2348
- ] })
2349
- ] });
2350
- };
2351
-
2352
- // src/components/banner/index.tsx
2353
- import { useState as useState5, useEffect as useEffect3 } from "react";
2354
- import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
2355
- var Icon = ({ type }) => {
2356
- if (type === "gray") {
2357
- return /* @__PURE__ */ jsx33(
2358
- "svg",
2359
- {
2360
- width: "20",
2361
- height: "20",
2362
- viewBox: "0 0 20 20",
2363
- fill: "none",
2364
- xmlns: "http://www.w3.org/2000/svg",
2365
- children: /* @__PURE__ */ jsx33(
2366
- "path",
2367
- {
2368
- d: "M10 0C4.49 0 0 4.49 0 10C0 15.51 4.49 20 10 20C15.51 20 20 15.51 20 10C20 4.49 15.51 0 10 0ZM14.78 7.7L9.11 13.37C8.97 13.51 8.78 13.59 8.58 13.59C8.38 13.59 8.19 13.51 8.05 13.37L5.22 10.54C4.93 10.25 4.93 9.77 5.22 9.48C5.51 9.19 5.99 9.19 6.28 9.48L8.58 11.78L13.72 6.64C14.01 6.35 14.49 6.35 14.78 6.64C15.07 6.93 15.07 7.4 14.78 7.7Z",
2369
- fill: "#79818C"
2370
- }
2371
- )
2372
- }
2373
- );
2374
- } else if (type === "info") {
2375
- return /* @__PURE__ */ jsx33(
2376
- "svg",
2377
- {
2378
- stroke: "#70B6F6",
2379
- fill: "#70B6F6",
2380
- "stroke-width": "0",
2381
- viewBox: "0 0 16 16",
2382
- height: "24",
2383
- width: "24",
2384
- xmlns: "http://www.w3.org/2000/svg",
2385
- children: /* @__PURE__ */ jsx33("path", { d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2" })
2386
- }
2387
- );
2388
- } else if (type === "warning") {
2389
- return /* @__PURE__ */ jsx33(
2390
- "svg",
2391
- {
2392
- width: "20",
2393
- height: "20",
2394
- viewBox: "0 0 20 20",
2395
- fill: "none",
2396
- xmlns: "http://www.w3.org/2000/svg",
2397
- children: /* @__PURE__ */ jsx33(
2398
- "path",
2399
- {
2400
- d: "M9.99984 1.66663C5.40817 1.66663 1.6665 5.40829 1.6665 9.99996C1.6665 14.5916 5.40817 18.3333 9.99984 18.3333C14.5915 18.3333 18.3332 14.5916 18.3332 9.99996C18.3332 5.40829 14.5915 1.66663 9.99984 1.66663ZM9.37484 6.66663C9.37484 6.32496 9.65817 6.04163 9.99984 6.04163C10.3415 6.04163 10.6248 6.32496 10.6248 6.66663V10.8333C10.6248 11.175 10.3415 11.4583 9.99984 11.4583C9.65817 11.4583 9.37484 11.175 9.37484 10.8333V6.66663ZM10.7665 13.65C10.7248 13.7583 10.6665 13.8416 10.5915 13.925C10.5082 14 10.4165 14.0583 10.3165 14.1C10.2165 14.1416 10.1082 14.1666 9.99984 14.1666C9.8915 14.1666 9.78317 14.1416 9.68317 14.1C9.58317 14.0583 9.4915 14 9.40817 13.925C9.33317 13.8416 9.27484 13.7583 9.23317 13.65C9.1915 13.55 9.1665 13.4416 9.1665 13.3333C9.1665 13.225 9.1915 13.1166 9.23317 13.0166C9.27484 12.9166 9.33317 12.825 9.40817 12.7416C9.4915 12.6666 9.58317 12.6083 9.68317 12.5666C9.88317 12.4833 10.1165 12.4833 10.3165 12.5666C10.4165 12.6083 10.5082 12.6666 10.5915 12.7416C10.6665 12.825 10.7248 12.9166 10.7665 13.0166C10.8082 13.1166 10.8332 13.225 10.8332 13.3333C10.8332 13.4416 10.8082 13.55 10.7665 13.65Z",
2401
- fill: "#FFC700"
2402
- }
2403
- )
2404
- }
2405
- );
2406
- } else if (type === "success") {
2407
- return /* @__PURE__ */ jsx33(
2408
- "svg",
2409
- {
2410
- width: "24",
2411
- height: "24",
2412
- viewBox: "0 0 24 24",
2413
- fill: "none",
2414
- xmlns: "http://www.w3.org/2000/svg",
2415
- children: /* @__PURE__ */ jsx33(
2416
- "path",
2417
- {
2418
- d: "M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z",
2419
- fill: "#00D488"
2420
- }
2421
- )
2422
- }
2423
- );
2424
- } else {
2425
- return /* @__PURE__ */ jsx33(
2426
- "svg",
2427
- {
2428
- width: "20",
2429
- height: "20",
2430
- viewBox: "0 0 20 20",
2431
- fill: "none",
2432
- xmlns: "http://www.w3.org/2000/svg",
2433
- children: /* @__PURE__ */ jsx33(
2434
- "path",
2435
- {
2436
- d: "M9.99984 1.66663C5.40817 1.66663 1.6665 5.40829 1.6665 9.99996C1.6665 14.5916 5.40817 18.3333 9.99984 18.3333C14.5915 18.3333 18.3332 14.5916 18.3332 9.99996C18.3332 5.40829 14.5915 1.66663 9.99984 1.66663ZM9.37484 6.66663C9.37484 6.32496 9.65817 6.04163 9.99984 6.04163C10.3415 6.04163 10.6248 6.32496 10.6248 6.66663V10.8333C10.6248 11.175 10.3415 11.4583 9.99984 11.4583C9.65817 11.4583 9.37484 11.175 9.37484 10.8333V6.66663ZM10.7665 13.65C10.7248 13.7583 10.6665 13.8416 10.5915 13.925C10.5082 14 10.4165 14.0583 10.3165 14.1C10.2165 14.1416 10.1082 14.1666 9.99984 14.1666C9.8915 14.1666 9.78317 14.1416 9.68317 14.1C9.58317 14.0583 9.4915 14 9.40817 13.925C9.33317 13.8416 9.27484 13.7583 9.23317 13.65C9.1915 13.55 9.1665 13.4416 9.1665 13.3333C9.1665 13.225 9.1915 13.1166 9.23317 13.0166C9.27484 12.9166 9.33317 12.825 9.40817 12.7416C9.4915 12.6666 9.58317 12.6083 9.68317 12.5666C9.88317 12.4833 10.1165 12.4833 10.3165 12.5666C10.4165 12.6083 10.5082 12.6666 10.5915 12.7416C10.6665 12.825 10.7248 12.9166 10.7665 13.0166C10.8082 13.1166 10.8332 13.225 10.8332 13.3333C10.8332 13.4416 10.8082 13.55 10.7665 13.65Z",
2437
- fill: "#F04248"
2438
- }
2439
- )
2440
- }
2441
- );
2442
- }
2443
- };
2444
- var Banner = ({
2445
- type = "info",
2446
- title,
2447
- description,
2448
- open,
2449
- showCloseButton,
2450
- bottomNode,
2451
- sideNode,
2452
- onClose,
2453
- showIcon = true
2454
- }) => {
2455
- const [isOpen, setIsOpen] = useState5(open);
2456
- useEffect3(() => {
2457
- setIsOpen(open);
2458
- }, [open]);
2459
- let bgColor = "";
2460
- let stripeColor = "";
2461
- switch (type) {
2462
- case "gray":
2463
- bgColor = "#eeeef0";
2464
- stripeColor = "#79818c";
2465
- break;
2466
- case "info":
2467
- bgColor = "#ebf5fd";
2468
- stripeColor = "#70B6F6";
2469
- break;
2470
- case "warning":
2471
- bgColor = "#fff8df";
2472
- stripeColor = "#ffc700";
2473
- break;
2474
- case "success":
2475
- bgColor = "#e0f9f0";
2476
- stripeColor = "#49e0aa";
2477
- break;
2478
- case "danger":
2479
- bgColor = "#fde8e9";
2480
- stripeColor = "#f3777c";
2481
- break;
2482
- default:
2483
- bgColor = "#eeeef0";
2484
- stripeColor = "#79818c";
2485
- break;
2486
- }
2487
- function handleClose() {
2488
- setIsOpen(false);
2489
- if (onClose) {
2490
- onClose();
2491
- }
2492
- }
2493
- if (!isOpen) {
2494
- return null;
2495
- }
2496
- return /* @__PURE__ */ jsxs24(
2497
- "div",
2498
- {
2499
- className: "w-full shadow-lg transform flex items-center rounded-md",
2500
- style: {
2501
- background: bgColor || "#ebf5fd"
2502
- },
2503
- children: [
2504
- /* @__PURE__ */ jsx33(
2505
- "div",
2506
- {
2507
- className: "flex-none absolute rounded-l-[2px] rounded-l-4px h-[4px] w-full top-0",
2508
- style: {
2509
- background: stripeColor || "#70B6F6"
2510
- }
2511
- }
2512
- ),
2513
- /* @__PURE__ */ jsxs24("div", { className: "w-full gap-3 h-full flex flex-row justify-between px-4 md:px-4 py-3 md:py-4", children: [
2514
- /* @__PURE__ */ jsxs24("div", { className: "flex flex-row gap-2.5 items-start w-full h-full", children: [
2515
- showIcon && /* @__PURE__ */ jsx33("div", { className: "h-full flex justify-end", children: /* @__PURE__ */ jsx33(Icon, { type }) }),
2516
- /* @__PURE__ */ jsxs24("div", { className: "w-full gap-3 h-full flex flex-col md:flex-row items-start justify-between", children: [
2517
- /* @__PURE__ */ jsxs24("div", { className: "flex-1 gap-3 h-full flex flex-col items-start justify-between", children: [
2518
- (title || description) && /* @__PURE__ */ jsxs24("div", { children: [
2519
- title && /* @__PURE__ */ jsx33("div", { className: "text-sm font-bold text-[#191919]", children: title }),
2520
- description && /* @__PURE__ */ jsx33("div", { className: "text-sm font-normal text-[#5D5D5D] mt-1", children: description })
2521
- ] }),
2522
- bottomNode
2523
- ] }),
2524
- sideNode
2525
- ] })
2526
- ] }),
2527
- showCloseButton && /* @__PURE__ */ jsx33("div", { className: "w-1/10 h-full flex flex-col justify-start items-center", children: /* @__PURE__ */ jsx33("button", { onClick: handleClose, children: /* @__PURE__ */ jsxs24(
2528
- "svg",
2529
- {
2530
- width: "16",
2531
- height: "16",
2532
- viewBox: "0 0 16 16",
2533
- fill: "none",
2534
- xmlns: "http://www.w3.org/2000/svg",
2535
- children: [
2536
- /* @__PURE__ */ jsx33(
2537
- "path",
2538
- {
2539
- d: "M3.3335 3.33337L12.6662 12.6661",
2540
- stroke: "#191919",
2541
- strokeWidth: "1.5",
2542
- strokeLinecap: "round",
2543
- strokeLinejoin: "round"
2544
- }
2545
- ),
2546
- /* @__PURE__ */ jsx33(
2547
- "path",
2548
- {
2549
- d: "M3.33429 12.6661L12.667 3.33337",
2550
- stroke: "#191919",
2551
- strokeWidth: "1.5",
2552
- strokeLinecap: "round",
2553
- strokeLinejoin: "round"
2554
- }
2555
- )
2556
- ]
2557
- }
2558
- ) }) })
2559
- ] })
2560
- ]
2561
- }
2562
- );
2563
- };
2564
-
2565
- // src/components/locale-selctor/icons/Check.tsx
2566
- import { jsx as jsx34 } from "react/jsx-runtime";
2567
- var Check2 = () => {
2568
- return /* @__PURE__ */ jsx34(
2569
- "svg",
2570
- {
2571
- stroke: "currentColor",
2572
- fill: "currentColor",
2573
- strokeWidth: "0",
2574
- viewBox: "0 0 20 20",
2575
- "aria-hidden": "true",
2576
- className: "h-5 w-5",
2577
- height: "1em",
2578
- width: "1em",
2579
- xmlns: "http://www.w3.org/2000/svg",
2580
- children: /* @__PURE__ */ jsx34(
2581
- "path",
2582
- {
2583
- fillRule: "evenodd",
2584
- d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
2585
- clipRule: "evenodd"
2586
- }
2587
- )
2588
- }
2589
- );
2590
- };
2591
-
2592
- // src/components/locale-selctor/icons/EnglishFlag.tsx
2593
- import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
2594
- var EnglishFlag = (props) => {
2595
- return /* @__PURE__ */ jsxs25(
2596
- "svg",
2597
- {
2598
- viewBox: "0 0 60 30",
2599
- className: "w-full max-w-md h-auto",
2600
- "aria-label": "Union Jack - Flag of the United Kingdom",
2601
- ...props,
2602
- children: [
2603
- /* @__PURE__ */ jsx35("rect", { width: "60", height: "30", fill: "#00247D" }),
2604
- /* @__PURE__ */ jsx35("path", { d: "M0,0 L60,30 M60,0 L0,30", stroke: "#FFFFFF", strokeWidth: "6" }),
2605
- /* @__PURE__ */ jsx35("path", { d: "M0,0 L60,30 M60,0 L0,30", stroke: "#CF142B", strokeWidth: "4" }),
2606
- /* @__PURE__ */ jsx35("path", { d: "M30,0 L30,30 M0,15 L60,15", stroke: "#FFFFFF", strokeWidth: "10" }),
2607
- /* @__PURE__ */ jsx35("path", { d: "M30,0 L30,30 M0,15 L60,15", stroke: "#CF142B", strokeWidth: "6" })
2608
- ]
2609
- }
2610
- );
2611
- };
2612
-
2613
- // src/components/locale-selctor/icons/FrenchFlag.tsx
2614
- import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
2615
- var FrenchFlag = (props) => {
2616
- return /* @__PURE__ */ jsxs26(
2617
- "svg",
2618
- {
2619
- viewBox: "0 0 60 40",
2620
- className: "w-full max-w-md h-auto",
2621
- "aria-label": "Tricolore - Flag of France",
2622
- ...props,
2623
- children: [
2624
- /* @__PURE__ */ jsx36("rect", { x: "0", y: "0", width: "20", height: "40", fill: "#002395" }),
2625
- /* @__PURE__ */ jsx36("rect", { x: "20", y: "0", width: "20", height: "40", fill: "#FFFFFF" }),
2626
- /* @__PURE__ */ jsx36("rect", { x: "40", y: "0", width: "20", height: "40", fill: "#ED2939" })
2627
- ]
2628
- }
2629
- );
2630
- };
2631
-
2632
- // src/components/locale-selctor/icons/UpDownIcon.tsx
2633
- import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
2634
- var UpDownIcon = () => {
2635
- return /* @__PURE__ */ jsxs27(
2636
- "svg",
2637
- {
2638
- width: "20",
2639
- height: "18",
2640
- viewBox: "0 0 8 18",
2641
- fill: "none",
2642
- xmlns: "http://www.w3.org/2000/svg",
2643
- children: [
2644
- /* @__PURE__ */ jsx37(
2645
- "path",
2646
- {
2647
- d: "M5.50257 12.9395L3.68439 14.7576L1.86621 12.9395",
2648
- stroke: "currentColor",
2649
- strokeLinecap: "round",
2650
- strokeLinejoin: "round"
2651
- }
2652
- ),
2653
- /* @__PURE__ */ jsx37(
2654
- "path",
2655
- {
2656
- d: "M5.50257 5.06055L3.68439 3.24237L1.86621 5.06055",
2657
- stroke: "currentColor",
2658
- strokeLinecap: "round",
2659
- strokeLinejoin: "round"
2660
- }
2661
- )
2662
- ]
2663
- }
2664
- );
2665
- };
2666
-
2667
- // src/components/locale-selctor/index.tsx
2668
- import { PopoverClose } from "@radix-ui/react-popover";
2669
- import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
2670
- var localeListOptons = [
2671
- {
2672
- key: "en",
2673
- label: "English"
2674
- },
2675
- {
2676
- key: "fr",
2677
- label: "French"
2678
- }
2679
- ];
2680
- var LocaleIcon = ({ locale }) => {
2681
- if (locale === "fr") return /* @__PURE__ */ jsx38(FrenchFlag, { width: 10 });
2682
- return /* @__PURE__ */ jsx38(EnglishFlag, { width: 10 });
2683
- };
2684
- var LocaleTrigger = ({ locale }) => {
2685
- return /* @__PURE__ */ jsx38("div", { className: "px-2 py-1 ", children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2.5", children: [
2686
- /* @__PURE__ */ jsx38(LocaleIcon, { locale }),
2687
- " ",
2688
- /* @__PURE__ */ jsx38("span", { className: "uppercase", children: locale }),
2689
- /* @__PURE__ */ jsx38(UpDownIcon, {})
2690
- ] }) });
2691
- };
2692
- var LocaleSelector = ({
2693
- locale = "en",
2694
- onChange,
2695
- locales = localeListOptons
2696
- }) => {
2697
- return /* @__PURE__ */ jsxs28(PopoverRoot, { children: [
2698
- /* @__PURE__ */ jsx38("div", { className: "flex items-center gap-2 px-2 py-1 rounded-lg shadow border-[0.5px] border-gray-50/50 text-current bg-white/10 ", children: /* @__PURE__ */ jsx38(PopoverTrigger, { className: "!p-0 !bg-transparent ", children: /* @__PURE__ */ jsx38(LocaleTrigger, { locale }) }) }),
2699
- /* @__PURE__ */ jsx38(
2700
- PopoverContent,
2701
- {
2702
- side: "bottom",
2703
- className: "p-0 max-w-max rounded-md overflow-hidden mx-auto mt-2",
2704
- children: /* @__PURE__ */ jsx38("div", { children: locales?.map((_locale) => /* @__PURE__ */ jsxs28(
2705
- PopoverClose,
2706
- {
2707
- type: "button",
2708
- className: cn(
2709
- "flex items-center gap-3 px-3 py-1 text-sm hover:bg-blue-50 w-full transition-all",
2710
- { "bg-blue-100": locale && locale === _locale?.key }
2711
- ),
2712
- onClick: () => onChange?.(_locale?.key),
2713
- children: [
2714
- _locale?.label,
2715
- " ",
2716
- locale && locale === _locale?.key && /* @__PURE__ */ jsx38(Check2, {})
2717
- ]
2718
- },
2719
- _locale?.key
2720
- )) })
2721
- }
2722
- )
2723
- ] });
2724
- };
2725
-
2726
- // src/components/drawer/index.tsx
2727
- import * as React14 from "react";
2728
- import { Drawer as DrawerPrimitive } from "vaul";
2729
- import { cva as cva6 } from "class-variance-authority";
2730
- import { useWindowSize } from "react-use";
2731
-
2732
- // src/components/drawer/icon/CloseIcon.tsx
2733
- import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
2734
- var CloseIcon2 = () => {
2735
- return /* @__PURE__ */ jsxs29(
2736
- "svg",
2737
- {
2738
- xmlns: "http://www.w3.org/2000/svg",
2739
- width: "24",
2740
- height: "24",
2741
- viewBox: "0 0 24 24",
2742
- fill: "none",
2743
- stroke: "currentColor",
2744
- strokeWidth: "2",
2745
- strokeLinecap: "round",
2746
- strokeLinejoin: "round",
2747
- className: "lucide lucide-x",
2748
- children: [
2749
- /* @__PURE__ */ jsx39("path", { d: "M18 6 6 18" }),
2750
- /* @__PURE__ */ jsx39("path", { d: "m6 6 12 12" })
2751
- ]
2752
- }
2753
- );
2754
- };
2755
-
2756
- // src/components/drawer/index.tsx
2757
- import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
2758
- var DrawerRoot = ({
2759
- shouldScaleBackground = true,
2760
- ...props
2761
- }) => /* @__PURE__ */ jsx40(
2762
- DrawerPrimitive.Root,
2763
- {
2764
- direction: "right",
2765
- shouldScaleBackground,
2766
- ...props
2767
- }
2768
- );
2769
- DrawerRoot.displayName = "Drawer";
2770
- var DrawerTrigger = DrawerPrimitive.Trigger;
2771
- var DrawerClose = DrawerPrimitive.Close;
2772
- var DrawerPortal = DrawerPrimitive.Portal;
2773
- var DrawerOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
2774
- DrawerPrimitive.Overlay,
2775
- {
2776
- className: cn(
2777
- "fixed inset-0 z-40 bg-black/75 !m-0 !p-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
2778
- className
2779
- ),
2780
- ...props,
2781
- ref
2782
- }
2783
- ));
2784
- DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
2785
- var DrawerVariants = cva6(
2786
- "fixed focus-visible:outline-0 z-50 gap-4 bg-white shadow-lg dark:bg-[#2B2B2B] dark:text-white transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:border-none",
2787
- {
2788
- variants: {
2789
- side: {
2790
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top rounded-b-lg",
2791
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom rounded-t-lg",
2792
- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-[512px] ",
2793
- right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-[512px]"
2794
- }
2795
- },
2796
- defaultVariants: {
2797
- side: "right"
2798
- }
2799
- }
2800
- );
2801
- var DrawerContent = React14.forwardRef(({ side = "right", hideCloseButton, className, children, ...props }, ref) => /* @__PURE__ */ jsxs30(DrawerPortal, { children: [
2802
- /* @__PURE__ */ jsx40(DrawerOverlay, {}),
2803
- /* @__PURE__ */ jsxs30(
2804
- DrawerPrimitive.Content,
2805
- {
2806
- ref,
2807
- className: cn(DrawerVariants({ side }), className),
2808
- ...props,
2809
- children: [
2810
- /* @__PURE__ */ jsx40("button", { className: "bg-gray-300 block md:hidden mx-auto mt-4 h-1.5 w-[80px] rounded-full opacity-70 transition-opacity hover:opacity-100" }),
2811
- children,
2812
- !hideCloseButton && /* @__PURE__ */ jsxs30(DrawerPrimitive.Close, { className: "absolute right-2 top-3 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
2813
- /* @__PURE__ */ jsx40(CloseIcon2, {}),
2814
- /* @__PURE__ */ jsx40("span", { className: "sr-only", children: "Close" })
2815
- ] })
2816
- ]
2817
- }
2818
- )
2819
- ] }));
2820
- DrawerContent.displayName = DrawerPrimitive.Content.displayName;
2821
- var DrawerHeader = ({
2822
- className,
2823
- ...props
2824
- }) => /* @__PURE__ */ jsx40(
2825
- "div",
2826
- {
2827
- className: cn(
2828
- "text-2xl flex flex-col border-b-0 border-b-gray-200 space-y-1 text-left w-full p-3 py-4",
2829
- className
2830
- ),
2831
- ...props
2832
- }
2833
- );
2834
- DrawerHeader.displayName = "DrawerHeader";
2835
- var DrawerFooter = ({
2836
- className,
2837
- ...props
2838
- }) => /* @__PURE__ */ jsx40(
2839
- "div",
2840
- {
2841
- className: cn(
2842
- "flex flex-col-reverse sm:flex-row m-auto right-0 left-0 p-3 sm:space-x-2 border-t border-t-[#EDEDED] dark:border-t-[#242424] w-full",
2843
- className
2844
- ),
2845
- ...props
2846
- }
2847
- );
2848
- DrawerFooter.displayName = "DrawerFooter";
2849
- var DrawerTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
2850
- DrawerPrimitive.Title,
2851
- {
2852
- ref,
2853
- className: cn(
2854
- "text-xl font-semibold text-[#191919] dark:text-white",
2855
- className
2856
- ),
2857
- ...props
2858
- }
2859
- ));
2860
- DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
2861
- var DrawerDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
2862
- DrawerPrimitive.Description,
2863
- {
2864
- ref,
2865
- className: cn("text-xs text-[#5d5c5c] dark:text-white", className),
2866
- ...props
2867
- }
2868
- ));
2869
- DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
2870
- var Drawer = ({
2871
- trigger = void 0,
2872
- children,
2873
- open = void 0,
2874
- onOpenChange = void 0,
2875
- hideCloseButton,
2876
- footer,
2877
- title,
2878
- description,
2879
- contentClassName,
2880
- headerClassName,
2881
- titleClassName,
2882
- descriptionClassName,
2883
- footerClassName,
2884
- asChild = true,
2885
- onOpenAutoFocus,
2886
- onCloseAutoFocus
2887
- }) => {
2888
- const { width } = useWindowSize();
2889
- const direction = width < 768 ? "bottom" : "right";
2890
- return /* @__PURE__ */ jsxs30(DrawerRoot, { open, onOpenChange, direction, children: [
2891
- /* @__PURE__ */ jsx40(DrawerTrigger, { className: "cursor-pointer", asChild, children: trigger }),
2892
- /* @__PURE__ */ jsxs30(
2893
- DrawerContent,
2894
- {
2895
- className: cn(
2896
- "flex flex-col gap-0 justify-start items-start max-h-[90vh] md:max-h-full w-full",
2897
- contentClassName
2898
- ),
2899
- side: direction,
2900
- hideCloseButton,
2901
- onOpenAutoFocus,
2902
- onCloseAutoFocus,
2903
- children: [
2904
- title || description ? /* @__PURE__ */ jsxs30(DrawerHeader, { className: headerClassName, children: [
2905
- title && /* @__PURE__ */ jsx40(DrawerTitle, { className: titleClassName, children: title }),
2906
- description && /* @__PURE__ */ jsx40(DrawerDescription, { className: descriptionClassName, children: description })
2907
- ] }) : /* @__PURE__ */ jsx40(Fragment4, {}),
2908
- /* @__PURE__ */ jsx40(
2909
- "div",
2910
- {
2911
- className: cn(
2912
- "flex w-full overflow-y-auto flex-col justify-start items-start p-4 flex-1 h-[30px]"
2913
- ),
2914
- children
2915
- }
2916
- ),
2917
- footer && /* @__PURE__ */ jsx40(DrawerFooter, { className: footerClassName, children: footer })
2918
- ]
2919
- }
2920
- )
2921
- ] });
2922
- };
2923
-
2924
- // src/actions/amount.action.ts
2925
- var CurrencySymbolMap = {
2926
- USD: "$",
2927
- CAD: "CA$",
2928
- EUR: "\u20AC",
2929
- AED: "AED",
2930
- AFN: "Af",
2931
- ALL: "ALL",
2932
- AMD: "AMD",
2933
- ARS: "AR$",
2934
- AUD: "AU$",
2935
- AZN: "man.",
2936
- BAM: "KM",
2937
- BDT: "Tk",
2938
- BGN: "BGN",
2939
- BHD: "BD",
2940
- BIF: "FBu",
2941
- BND: "BN$",
2942
- BOB: "Bs",
2943
- BRL: "R$",
2944
- BWP: "BWP",
2945
- BYN: "Br",
2946
- BZD: "BZ$",
2947
- CDF: "CDF",
2948
- CHF: "CHF",
2949
- CLP: "CL$",
2950
- CNY: "CN\xA5",
2951
- COP: "CO$",
2952
- CRC: "\u20A1",
2953
- CVE: "CV$",
2954
- CZK: "K\u010D",
2955
- DJF: "Fdj",
2956
- DKK: "Dkr",
2957
- DOP: "RD$",
2958
- DZD: "DA",
2959
- EEK: "Ekr",
2960
- EGP: "EGP",
2961
- ERN: "Nfk",
2962
- ETB: "Br",
2963
- GBP: "\xA3",
2964
- GEL: "GEL",
2965
- GHS: "GH\u20B5",
2966
- GNF: "FG",
2967
- GTQ: "GTQ",
2968
- HKD: "HK$",
2969
- HNL: "HNL",
2970
- HRK: "kn",
2971
- HUF: "Ft",
2972
- IDR: "Rp",
2973
- ILS: "\u20AA",
2974
- INR: "\u20B9",
2975
- IQD: "IQD",
2976
- IRR: "IRR",
2977
- ISK: "Ikr",
2978
- JMD: "J$",
2979
- JOD: "JD",
2980
- JPY: "\xA5",
2981
- KES: "Ksh",
2982
- KHR: "KHR",
2983
- KMF: "CF",
2984
- KRW: "\u20A9",
2985
- KWD: "KD",
2986
- KZT: "KZT",
2987
- LBP: "L.L.",
2988
- LKR: "SLRs",
2989
- LTL: "Lt",
2990
- LVL: "Ls",
2991
- LYD: "LD",
2992
- MAD: "MAD",
2993
- MDL: "MDL",
2994
- MGA: "MGA",
2995
- MKD: "MKD",
2996
- MMK: "MMK",
2997
- MOP: "MOP$",
2998
- MUR: "MURs",
2999
- MXN: "MX$",
3000
- MYR: "RM",
3001
- MZN: "MTn",
3002
- NAD: "N$",
3003
- NGN: "\u20A6",
3004
- NIO: "C$",
3005
- NOK: "Nkr",
3006
- NPR: "NPRs",
3007
- NZD: "NZ$",
3008
- OMR: "OMR",
3009
- PAB: "B/.",
3010
- PEN: "S/.",
3011
- PHP: "\u20B1",
3012
- PKR: "PKRs",
3013
- PLN: "z\u0142",
3014
- PYG: "\u20B2",
3015
- QAR: "QR",
3016
- RON: "RON",
3017
- RSD: "din.",
3018
- RUB: "RUB",
3019
- RWF: "RWF",
3020
- SAR: "SR",
3021
- SDG: "SDG",
3022
- SEK: "Skr",
3023
- SGD: "S$",
3024
- SOS: "Ssh",
3025
- SYP: "SY\xA3",
3026
- THB: "\u0E3F",
3027
- TND: "DT",
3028
- TOP: "T$",
3029
- TRY: "TL",
3030
- TTD: "TT$",
3031
- TWD: "NT$",
3032
- TZS: "TSh",
3033
- UAH: "\u20B4",
3034
- UGX: "USh",
3035
- UYU: "$U",
3036
- UZS: "UZS",
3037
- VEF: "Bs.F.",
3038
- VND: "\u20AB",
3039
- XAF: "F CFA",
3040
- XOF: "CFA",
3041
- YER: "YR",
3042
- ZAR: "R",
3043
- ZMK: "ZK",
3044
- ZWL: "ZWL$"
3045
- };
3046
- var _AmountAction = class _AmountAction {
3047
- static getCurrencyLocaleMap(currency) {
3048
- const localeMap = {
3049
- XOF: "fr",
3050
- XAF: "fr"
3051
- };
3052
- return localeMap[currency] || "en";
3053
- }
3054
- static koboToNaira(amount) {
3055
- return +amount / 100;
3056
- }
3057
- static nairaToKobo(amount) {
3058
- return +amount * 100;
3059
- }
3060
- static getCurrencySymbol(currency) {
3061
- return CurrencySymbolMap[currency] || currency;
3062
- }
3063
- };
3064
- __publicField(_AmountAction, "formatAmountAndCurrency", (currency, value, options) => {
3065
- const formatted = new Intl.NumberFormat(
3066
- options?.locale || _AmountAction.getCurrencyLocaleMap(currency),
3067
- {
3068
- maximumFractionDigits: 3,
3069
- style: "currency",
3070
- currency,
3071
- currencyDisplay: "symbol"
3072
- }
3073
- ).format(
3074
- options?.convertToMajorCurrency ? _AmountAction.koboToNaira(Number(value)) : Number(value)
3075
- ).replace(/^(\D+)/, "$1 ").replace("\u202F", " ").replace(/\s+/, "");
3076
- const customSymbol = CurrencySymbolMap[currency] || currency;
3077
- return formatted.replace(currency, customSymbol);
3078
- });
3079
- var AmountAction = _AmountAction;
3080
-
3081
- // src/actions/date.action.ts
3082
- import dayjs from "dayjs";
3083
- var DateAction = class {
3084
- static getDateLibrary() {
3085
- return dayjs();
3086
- }
3087
- static formatTimestampToDate(timestamp, dateFormat) {
3088
- return dayjs.unix(timestamp).format(dateFormat || "ddd, MMM, YYYY | HH:mm:ss");
3089
- }
3090
- static formatDateToTimestamp(date) {
3091
- return dayjs(date).unix();
3092
- }
3093
- };
3094
- export {
3095
- AmountAction,
3096
- Banner,
3097
- Button,
3098
- CopyableLabel,
3099
- Country,
3100
- CurrencySymbolMap,
3101
- DateAction,
3102
- DebouncedInput,
3103
- DevBanner,
3104
- Dialog2 as Dialog,
3105
- Drawer,
3106
- DrawerClose,
3107
- DrawerRoot,
3108
- FlagComponent,
3109
- FormLabel,
3110
- Input,
3111
- Loader,
3112
- LocaleSelector,
3113
- OTPInput,
3114
- PasswordInput,
3115
- PhoneInput,
3116
- Popover,
3117
- PopoverContent,
3118
- PopoverRoot,
3119
- PopoverTrigger,
3120
- Select,
3121
- Status,
3122
- Table,
3123
- Textarea,
3124
- buttonVariants,
3125
- cn
3126
- };
1
+ var tr=Object.defineProperty;var rr=(e,t,r)=>t in e?tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Xe=(e,t,r)=>rr(e,typeof t!="symbol"?t+"":t,r);import lr from"react";import*as Ye from"react";import*as Ee from"@radix-ui/react-label";import{cva as nr}from"class-variance-authority";import{clsx as or}from"clsx";import{twMerge as ar}from"tailwind-merge";function o(...e){return ar(or(e))}import{jsx as sr}from"react/jsx-runtime";var ir=nr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ie=Ye.forwardRef(({className:e,...t},r)=>sr(Ee.Root,{ref:r,className:o(ir(),e),...t}));Ie.displayName=Ee.Root.displayName;import{jsx as je,jsxs as dr}from"react/jsx-runtime";var P=lr.forwardRef(({className:e,children:t,showAsterisk:r,error:a,...n},i)=>je(Ie,{ref:i,className:o(a&&"text-red-500",e),...n,children:r?dr("p",{children:[t,je("span",{className:"text-red-500",children:"*"})]}):t}));P.displayName="FormLabel";import{jsx as Je,jsxs as cr}from"react/jsx-runtime";var oe=({size:e=16,colour:t="primary"})=>cr("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 20 20",fill:"none",children:[Je("circle",{cx:"10",cy:"10",r:"9.25",stroke:"transparent",strokeWidth:"1.5"}),Je("path",{d:"M10 0.595792C10 0.266746 10.267 -0.00185055 10.5954 0.0177417C11.9786 0.100242 13.3318 0.469461 14.5682 1.1044C15.9816 1.83021 17.2016 2.88235 18.1273 4.17366C19.0531 5.46496 19.6578 6.95826 19.8913 8.52984C20.1249 10.1014 19.9807 11.706 19.4705 13.2108C18.9604 14.7155 18.0991 16.077 16.9579 17.1825C15.8167 18.288 14.4285 19.1056 12.9084 19.5677C11.3882 20.0298 9.77982 20.123 8.21646 19.8397C6.84883 19.5918 5.55009 19.0619 4.40196 18.2863C4.12931 18.1021 4.08072 17.7265 4.28083 17.4653C4.48094 17.2041 4.85388 17.1564 5.12801 17.3384C6.12474 18.0001 7.24768 18.4531 8.42898 18.6672C9.80606 18.9168 11.2228 18.8347 12.5618 18.4276C13.9008 18.0206 15.1236 17.3004 16.1288 16.3266C17.134 15.3528 17.8927 14.1536 18.342 12.8282C18.7914 11.5027 18.9185 10.0893 18.7127 8.70502C18.507 7.32071 17.9743 6.00535 17.1589 4.86792C16.3435 3.73048 15.2688 2.80371 14.0238 2.16439C12.9559 1.61596 11.789 1.29259 10.5954 1.21173C10.2671 1.18949 10 0.92484 10 0.595792Z",fill:t==="primary"?"#ffffff":"currentColor",className:"rounded"})]});import*as Ne from"react";import{Slot as pr}from"@radix-ui/react-slot";import{cva as mr}from"class-variance-authority";import{Fragment as Qe,jsx as ae,jsxs as ur}from"react/jsx-runtime";var Re=mr("overflow-hidden isolate inline-flex h-fit items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background dark:ring-offset-transparent transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:!pointer-events-none",{variants:{variant:{primary:"border-primary-main bg-primary-main hover:bg-primary-main/70 disabled:bg-primary-main/70 text-white font-bold",danger:"border-red-600 bg-red-600 hover:bg-red-600/70 disabled:bg-red-600/70 text-white font-bold",neutral:"!border-0 bg-transparent text-primary-main hover:opacity-80 disabled:opacity-60",outlined:"border border-primary-main text-primary-main hover:opacity-80 disabled:opacity-60","danger-outlined":"border border-red-600 text-red-600 hover:opacity-80 disabled:opacity-60","light-outlined":"border-white text-white hover:opacity-80 disabled:opacity-60","dark-text":"border-transparent bg-transparent hover:bg-opacity-70 disabled:bg-opacity-70 text-black font-medium",light:"border-white bg-white hover:bg-opacity-70 disabled:bg-opacity-70 text-primary-main font-semibold"},size:{default:"py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg",sm:"py-[0.375rem] px-[1rem] leading-[1rem] font-normal text-sm rounded-lg",lg:"py-[0.75rem] px-[1.5rem] text-[1rem] leading-[1.5rem] font-medium rounded-lg",md:"py-[0.625rem] px-[1.5rem] text-[0.875rem] leading-[1.25rem] font-medium rounded-lg","icon-sm":"h-[1.75rem] w-[1.75rem] flex justify-center items-center font-medium rounded-lg",icon:"h-[2.5rem] w-[2.75rem] flex justify-center items-center font-medium rounded-lg","icon-lg":"h-[3rem] w-[3rem] flex justify-center items-center font-medium rounded-lg"}},defaultVariants:{variant:"primary",size:"default"}}),j=Ne.forwardRef(({className:e,variant:t="primary",size:r,asChild:a=!1,isLoading:n=!1,leftNode:i,rightNode:l,LoaderSize:s,...c},d)=>{let m=a?pr:"button",{children:u,disabled:p,...g}=c,v=Ne.useRef(null);return ae(m,{className:o(Re({variant:t,size:r,className:e})),ref:v||d,disabled:p||n,...g,children:ae("div",{className:"flex font-medium justify-center items-center gap-2",children:n?ae(Qe,{children:ae("span",{className:"mx-auto",children:ae(oe,{size:s,colour:"secondary"})})}):ur(Qe,{children:[i,u,l]})})})});j.displayName="Button";import*as Me from"react";import{cva as Ae}from"class-variance-authority";import fr from"react";import{jsx as gr}from"react/jsx-runtime";var L=fr.forwardRef(({className:e,children:t,error:r,...a},n)=>{let i=r??t;return i?gr("p",{ref:n,className:o("text-xs font-normal text-[#F04248]",e),...a,children:i}):null});L.displayName="ErrorMessage";import yr from"react";import{jsx as Cr}from"react/jsx-runtime";var T=yr.forwardRef(({className:e,...t},r)=>Cr("div",{ref:r,className:o("text-sm text-[#8E98A8",e),...t}));T.displayName="FormDescription";import{jsx as _,jsxs as et}from"react/jsx-runtime";var br=Ae("!p-0 flex h-full w-full !border-transparent !bg-transparent text-base focus-visible:bg-transparent focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",{variants:{status:{default:"placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",error:"placeholder:text-red-500 text-red-500",loading:"placeholder:text-[#C4C4C4] dark:placeholder:text-[#9299A2]",prefilled:"",neutral:""}},defaultVariants:{status:"default"}}),tt=Me.forwardRef(({className:e,status:t,type:r,...a},n)=>_("input",{type:r,className:o(br({status:t}),e),ref:n,...a}));tt.displayName="BaseInnerInput";var O=Ae("flex relative h-10 w-full rounded-[4px] dark:!bg-transparent border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",{variants:{status:{default:"border-[#DEDEDE] bg-white text-[#191919] dark:!bg-transparent caret-text-primary focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-status-error-bg-dark text-red-500 focus-within:bg-red-50 focus-within:border-red-500",loading:"",prefilled:"bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",neutral:"bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]"}},defaultVariants:{status:"default"}}),qe=Ae("top-0 flex justify-center items-center h-full min-w-[50px] max-w-[100px] dark:!bg-transparent transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 dark:disabled:!border-[#9299A2]",{variants:{side:{left:"left-0 rounded-l-[8px] border-r",right:"right-0 rounded-r-[8px] border-l"},status:{default:"border-[#DEDEDE] bg-white text-[#191919] dark:!bg-transparent caret-primary-main focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-red-500 bg-red-50 border-red-500 dark:!bg-red-50 text-red-500 focus-within:bg-red-50 focus-within:border-red-500",loading:"",prefilled:"bg-[#F6F6F6] border-[#DEDEDE] dark:!bg-transparent caret-[#DEDEDE] focus-within:bg-[#F6F6F6] focus-within:border-[#DEDEDE] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",neutral:"bg-transparent border-0 caret-[#DEDEDE] !px-0"}},defaultVariants:{status:"default",side:"left"}}),G=Me.forwardRef(({className:e,status:t="default",disabled:r,error:a,isLoading:n,sideNodeClassName:i,showAsterisk:l,label:s,description:c,...d},m)=>{let u=t;return a&&(u="error"),n&&(u="loading"),r&&(u="prefilled"),et("div",{className:"relative space-y-1 w-full",children:[s&&_(P,{showAsterisk:l,error:a,children:s}),et("div",{className:o(O({status:u}),d.leftNode?"pl-0":"",d.rightNode?"pr-0":"",e),children:[d.leftNode?_("div",{className:o(qe({status:u,side:"left"}),i),children:d.leftNode}):null,_(tt,{ref:m,disabled:n||r,className:o({"!pl-3":d.leftNode&&t!=="neutral","!pr-3":d.rightNode&&t!=="neutral"}),...d}),d.rightNode?_("div",{className:o(qe({status:u,side:"right"}),i),children:d.rightNode}):null]}),c&&_(T,{className:"text-gray-400 text-sm !font-normal",children:c}),_(L,{error:a})]})});G.displayName="Input";import{useMemo as xr,useState as ct}from"react";import{jsx as rt,jsxs as hr}from"react/jsx-runtime";var ot=()=>hr("svg",{width:"18",height:"14",viewBox:"0 0 18 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[rt("path",{d:"M1.54639 7.26103C1.48389 7.09264 1.48389 6.90741 1.54639 6.73903C2.15517 5.26292 3.18853 4.00081 4.51547 3.1127C5.84241 2.22459 7.40317 1.75049 8.99989 1.75049C10.5966 1.75049 12.1574 2.22459 13.4843 3.1127C14.8113 4.00081 15.8446 5.26292 16.4534 6.73903C16.5159 6.90741 16.5159 7.09264 16.4534 7.26103C15.8446 8.73713 14.8113 9.99925 13.4843 10.8874C12.1574 11.7755 10.5966 12.2496 8.99989 12.2496C7.40317 12.2496 5.84241 11.7755 4.51547 10.8874C3.18853 9.99925 2.15517 8.73713 1.54639 7.26103Z",stroke:"#8E98A8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),rt("path",{d:"M9 9.25C10.2426 9.25 11.25 8.24264 11.25 7C11.25 5.75736 10.2426 4.75 9 4.75C7.75736 4.75 6.75 5.75736 6.75 7C6.75 8.24264 7.75736 9.25 9 9.25Z",stroke:"#8E98A8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as at,jsxs as vr}from"react/jsx-runtime";var nt=()=>vr("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[at("path",{d:"M4.08759 12.69C3.26171 11.9072 2.61006 10.9591 2.17509 9.90752C2.10081 9.73454 2.0625 9.54826 2.0625 9.36001C2.0625 9.17177 2.10081 8.98549 2.17509 8.81252C2.75274 7.4073 3.72095 6.19704 4.96509 5.32502C6.14597 4.4998 7.55989 4.07405 9.00009 4.11002C10.0363 4.084 11.064 4.30239 12.0001 4.74752M13.9201 6.03752C14.7415 6.81964 15.3904 7.76486 15.8251 8.81252C15.8994 8.98549 15.9377 9.17177 15.9377 9.36001C15.9377 9.54826 15.8994 9.73454 15.8251 9.90752C15.2474 11.3127 14.2792 12.523 13.0351 13.395C11.8542 14.2202 10.4403 14.646 9.00009 14.61C7.9639 14.636 6.93616 14.4176 6.00009 13.9725",stroke:"#8E98A8",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),at("path",{d:"M6.5325 10.2375C6.42732 9.95694 6.37395 9.65962 6.375 9.36C6.375 8.66381 6.65156 7.99613 7.14384 7.50384C7.63613 7.01156 8.30381 6.735 9 6.735C9.3 6.7335 9.597 6.7875 9.8775 6.8925M11.4675 8.4825C11.5725 8.763 11.6265 9.06 11.625 9.36C11.625 10.0562 11.3484 10.7239 10.8562 11.2162C10.3639 11.7084 9.69619 11.985 9 11.985C8.70038 11.986 8.40306 11.9327 8.1225 11.8275M2.25 15L14.25 3",stroke:"#8E98A8",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as it}from"react/jsx-runtime";var st=()=>it("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:it("path",{d:"M8.89802 2.93408L9.70202 3.49808L6.21602 8.52608H5.41202L3.46802 5.80208L4.27202 5.05208L5.81402 6.49208L8.89802 2.93408Z",fill:"currentColor"})});import{jsx as lt}from"react/jsx-runtime";var dt=()=>lt("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:lt("path",{d:"M3.37891 8.62142L6.00041 5.99992L8.62191 8.62142M8.62191 3.37842L5.99991 5.99992L3.37891 3.37842",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});import{jsx as E,jsxs as wr}from"react/jsx-runtime";var pt=[{label:"Uppercase",key:"uppercase",RegExp:/[A-Z]/,validated:!1},{label:"Lowercase",key:"lowercase",RegExp:/[a-z]/,validated:!1},{label:"Number",key:"number",RegExp:/\d/,validated:!1},{label:"8 Characters",key:"eight-chars",RegExp:/.{8}/,validated:!1}],mt=({onValidate:e,onChange:t,disableValidation:r,...a})=>{let[n,i]=ct(!1),[l,s]=ct(pt),c=p=>pt.map(g=>({...g,validated:g.RegExp.test(p)})),d=p=>{let g=c(p),v=g.every(N=>N.validated);return s(g),v},m=p=>{if(t&&t(p),r)return;let g=p?.target?.value,v=d(g);e&&e(v,g)},u=xr(()=>E("div",{className:"flex items-center gap-2",children:l?.map(p=>wr("div",{className:o("text-xs flex items-center gap-0.5",{"text-[#62C554]":p?.validated,"text-[#8E98A8]":!p?.validated}),children:[E("span",{className:"",children:p?.validated?E(st,{}):E(dt,{})}),E("span",{className:"",children:p?.label})]},p?.key))}),[l]);return E(G,{sideNodeClassName:"!border-l-0",rightNode:n?E("button",{type:"button",onClick:()=>i(p=>!p),children:E(ot,{})}):E("button",{type:"button",onClick:()=>i(p=>!p),children:E(nt,{})}),type:n?"text":"password",onChange:m,description:!r&&u,...a})};mt.displayName="PasswordInput";import{cva as Nr}from"class-variance-authority";import{jsx as Pe,jsxs as Rr}from"react/jsx-runtime";var Ka=Nr("flex relative min-h-[80px] w-full rounded-[8px] border transition px-3 py-2 text-base placeholder:text-[#79818C] focus-within:outline-0 focus-within:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",{variants:{status:{default:"border-[#D7D7D7] dark:border-[#676767] bg-white text-[#191919] dark:!bg-transparent caret-primary-main focus-within:bg-white dark:focus-within:!bg-transparent dark:text-white focus-within:border-primary-main dark:focus-within:border-[#9299A2] dark:border-[#9299A2] dark:disabled:!border-[#9299A2]",error:"placeholder:text-status-error-fill bg-status-error-bg border-status-error-fill dark:!bg-status-error-bg-dark text-status-error-fill focus-within:bg-status-error-bg focus-within:border-status-error-fill",loading:"placeholder:text-[#C4C4C4]",prefilled:"resize-none bg-[#F6F6F6] border-[#D7D7D7] dark:!bg-transparent caret-[#D7D7D7] focus-within:bg-[#F6F6F6] focus-within:border-[#D7D7D7] dark:!border-[#9299A2] dark:focus-within:border-[#9299A2]",neutral:""}},defaultVariants:{status:"default"}}),ut=({className:e,status:t="default",disabled:r,error:a,isLoading:n,showAsterisk:i,label:l,description:s,...c})=>{let d=t;return a&&(d="error"),n&&(d="loading"),r&&(d="prefilled"),Rr("div",{className:"relative space-y-1",children:[Pe(P,{showAsterisk:i,error:a,children:l}),Pe("textarea",{className:o("min-h-[80px]",O({status:d}),e),disabled:n||r,...c}),Pe(T,{className:"text-gray-400 text-sm !font-normal",children:s}),Pe(L,{error:a})]})};ut.displayName="Textarea";import*as $ from"react";import*as z from"react";import{Command as w}from"cmdk";import{Search as Tr}from"lucide-react";import*as ne from"react";import*as y from"@radix-ui/react-dialog";import{jsx as ft,jsxs as Pr}from"react/jsx-runtime";var gt=()=>Pr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-x",children:[ft("path",{d:"M18 6 6 18"}),ft("path",{d:"m6 6 12 12"})]});import{Fragment as Lr,jsx as x,jsxs as J}from"react/jsx-runtime";var Dr=y.Root,kr=y.Trigger,yt=y.Portal,Ct=ne.forwardRef(({className:e,...t},r)=>x(y.Overlay,{ref:r,className:o("fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ct.displayName=y.Overlay.displayName;var Be=ne.forwardRef(({className:e,hideCloseButton:t,children:r,...a},n)=>J(yt,{children:[x(Ct,{}),J(y.Content,{ref:n,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-transparent bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...a,children:[r,!t&&J(y.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[x(gt,{}),x("span",{className:"sr-only",children:"Close"})]})]})]}));Be.displayName=y.Content.displayName;var bt=({className:e,...t})=>x("div",{className:o("flex flex-col space-y-1.5 text-left",e),...t});bt.displayName="DialogHeader";var ht=({className:e,...t})=>x("div",{className:o("flex flex-row justify-end sm:space-x-2",e),...t});ht.displayName="DialogFooter";var vt=ne.forwardRef(({className:e,...t},r)=>x(y.Title,{ref:r,className:o("text-xl font-semibold leading-none tracking-tight",e),...t}));vt.displayName=y.Title.displayName;var xt=ne.forwardRef(({className:e,...t},r)=>x(y.Description,{ref:r,className:o("text-sm text-gray-500",e),...t}));xt.displayName=y.Description.displayName;var Ve=({trigger:e=void 0,children:t,open:r,onOpenChange:a,hideCloseButton:n,footer:i,title:l,description:s,contentClassName:c,headerClassName:d,titleClassName:m,descriptionClassName:u,footerClassName:p,asChild:g=!0,onOpenAutoFocus:v,onCloseAutoFocus:N,onEscapeKeyDown:X,onInteractOutside:V,onPointerDownOutside:Se,...Fe})=>J(Dr,{...Fe,open:r,onOpenChange:a,children:[x(kr,{asChild:g,children:e}),x(yt,{children:J(Be,{className:c,hideCloseButton:n,onOpenAutoFocus:v,onCloseAutoFocus:N,onEscapeKeyDown:X,onPointerDownOutside:Se,onInteractOutside:V,children:[l||s?J(bt,{className:d,children:[l&&x(vt,{className:m,children:l}),s&&x(xt,{className:u,children:s})]}):x(Lr,{}),t,i&&x(ht,{className:p,children:i})]})})]});Ve.displayName=y.Dialog.displayName;import{Fragment as nn,jsx as I,jsxs as Er}from"react/jsx-runtime";var ie=z.forwardRef(({className:e,...t},r)=>I(w,{ref:r,className:o("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));ie.displayName=w.displayName;var se=z.forwardRef(({className:e,CommandInputContainerClassName:t,loading:r,...a},n)=>Er("div",{className:o("flex items-center border-0 px-3 gap-2",t),"cmdk-input-wrapper":"",children:[r?I(oe,{size:16,colour:"secondary"}):I(Tr,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),I(w.Input,{ref:n,className:o("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),disabled:r,...a})]}));se.displayName=w.Input.displayName;var le=z.forwardRef(({className:e,...t},r)=>I(w.List,{ref:r,className:o("overflow-y-auto overflow-x-hidden",e),...t}));le.displayName=w.List.displayName;var de=z.forwardRef((e,t)=>I(w.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));de.displayName=w.Empty.displayName;var ce=z.forwardRef(({className:e,...t},r)=>I(w.Group,{ref:r,className:o("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));ce.displayName=w.Group.displayName;var Sr=z.forwardRef(({className:e,...t},r)=>I(w.Separator,{ref:r,className:o("-mx-1 h-px bg-border",e),...t}));Sr.displayName=w.Separator.displayName;var pe=z.forwardRef(({className:e,...t},r)=>I(w.Item,{ref:r,className:o("relative text=[#222222] flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-primary-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));pe.displayName=w.Item.displayName;var Fr=({className:e,...t})=>I("span",{className:o("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Fr.displayName="CommandShortcut";import*as wt from"react";import*as S from"@radix-ui/react-popover";import{jsx as me,jsxs as Ir}from"react/jsx-runtime";var Z=S.Root,M=S.Trigger,H=wt.forwardRef(({className:e,align:t="center",sideOffset:r=4,portal:a=!0,...n},i)=>a?me(S.Portal,{children:me(S.Content,{ref:i,align:t,sideOffset:r,className:o("pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onOpenAutoFocus:n.onOpenAutoFocus,onCloseAutoFocus:n.onCloseAutoFocus,...n})}):me(S.Content,{ref:i,align:t,sideOffset:r,className:o("pointer-events-auto z-50 w-72 rounded-md border border-transparent bg-white p-4 text-[#191919] shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onOpenAutoFocus:n.onOpenAutoFocus,onCloseAutoFocus:n.onCloseAutoFocus,...n}));H.displayName=S.Content.displayName;var De=({trigger:e,children:t,open:r,onOpenChange:a,contentClassName:n,asChild:i=!0,align:l,side:s,alignOffset:c,triggerClassName:d,sideOffset:m,onOpenAutoFocus:u,onCloseAutoFocus:p,portal:g=!0,...v})=>Ir(Z,{...v,open:r,onOpenChange:a,children:[me(M,{asChild:i,className:d,children:e}),me(H,{alignOffset:c,sideOffset:m,side:s,align:l,className:n,onOpenAutoFocus:u,onCloseAutoFocus:p,portal:g,children:t})]});De.displayName=S.Root.displayName;import*as Oe from"react";import*as D from"@radix-ui/react-scroll-area";import{jsx as ue,jsxs as Mr}from"react/jsx-runtime";var fe=Oe.forwardRef(({className:e,viewPortClassName:t,children:r,...a},n)=>Mr(D.Root,{ref:n,className:o("relative overflow-hidden",e),...a,children:[ue(D.Viewport,{className:o("h-full w-full rounded-[inherit]",t),children:r}),ue(Nt,{}),ue(D.Corner,{})]}));fe.displayName=D.Root.displayName;var Nt=Oe.forwardRef(({className:e,orientation:t="vertical",...r},a)=>ue(D.ScrollAreaScrollbar,{ref:a,orientation:t,className:o("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:ue(D.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-[#959595] transition hover:bg-[#808080]"})}));Nt.displayName=D.ScrollAreaScrollbar.displayName;import{jsx as A,jsxs as ke}from"react/jsx-runtime";var Rt=({className:e,value:t,placeholder:r="",status:a,disabled:n})=>A(M,{asChild:!0,disabled:n,children:ke("button",{disabled:n,className:o(O({status:a}),"[&>span]:justify-start [&>span]:items-center gap-2 flex h-12 w-full items-center justify-between goup",t?"":"text-[#79818C]",e),children:[t??r??"Select options...",A("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:A("path",{d:"M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),Le=({options:e=[],value:t,onChange:r,containerClassName:a,placeholder:n,disabled:i,loading:l,optionComponent:s,children:c,modal:d=!1,hideSearch:m,className:u,inputValue:p,onValueChange:g,onInputValueChange:v})=>{let[N,X]=$.useState(!1),V=$.useRef(null),[Se,Fe]=$.useState(void 0);return $.useLayoutEffect(()=>{V.current&&Fe(V.current.clientWidth)},[V.current]),ke(Z,{modal:d,open:N,onOpenChange:X,children:[A("div",{className:o("w-full",u),ref:V,children:c}),A(H,{portal:!d,className:"p-0 min-w-[200px]",style:{width:Se},children:ke(ie,{className:o("relative max-h-[270px]",{"mt-2":!m}),children:[!m&&A(se,{loading:l,placeholder:n??"Search options...",onValueChange:v,value:p,CommandInputContainerClassName:"mx-2 border rounded-md border-[#DEDEDE]"}),A(fe,{viewPortClassName:"max-h-[225px]",className:o("w-full px-0 h-full overflow-y-auto",a),children:ke(le,{children:[!m&&A(de,{children:"No result found."}),A(ce,{className:"w-full",children:e?.map(Y=>A(pe,{defaultValue:t?.label,value:Y.label,disabled:i,onSelect:()=>{r(Y),X(!1),g?.(Y?.value)},children:s?s(Y):Y.label},Y.value))})]})})]})})]})};var He=[{countryCode:"GLOBAL",countryName:"Global",currency:"Dollars",currencyCode:"USD",internetCountryCode:"GLOBAL"},{countryName:"Benin",countryCode:"+229",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"BJ"},{countryName:"Burkina Faso",countryCode:"+226",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"BF"},{countryName:"Cameroon",countryCode:"+237",currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"CM"},{countryName:"Chad",countryCode:"+235",currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"TD"},{countryName:"DR Congo",countryCode:"+243",currency:"Congolese franc",currencyCode:"CDF",currencyIcon:"FC",internetCountryCode:"CD"},{countryName:"Eswatini",countryCode:"+268",currency:"Swazi lilangeni",currencyCode:"SZL",currencyIcon:"L",internetCountryCode:"SZ"},{countryName:"Gabon",countryCode:"+241",currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"GA"},{countryName:"Ghana",countryCode:"+233",currency:"Ghanaian cedi",currencyCode:"GHS",currencyIcon:"\u20B5",internetCountryCode:"GH"},{countryName:"Guinea",countryCode:"+224",currency:"Guinean franc",currencyCode:"GNF",currencyIcon:"Fr",internetCountryCode:"GN"},{countryName:"Ivory Coast",countryCode:"+225",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"CI"},{countryName:"Kenya",countryCode:"+254",currency:"Kenyan shilling",currencyCode:"KES",currencyIcon:"Sh",internetCountryCode:"KE"},{countryName:"Lesotho",countryCode:"+266",currency:"Lesotho loti",currencyCode:"LSL",currencyIcon:"L",internetCountryCode:"LS"},{countryName:"Liberia",countryCode:"+231",currency:"Liberian dollar",currencyCode:"LRD",currencyIcon:"$",internetCountryCode:"LR"},{countryName:"Madagascar",countryCode:"+261",currency:"Malagasy ariary",currencyCode:"MGA",currencyIcon:"Ar",internetCountryCode:"MG"},{countryName:"Malawi",countryCode:"+265",currency:"Malawian kwacha",currencyCode:"MWK",currencyIcon:"MK",internetCountryCode:"MW"},{countryName:"Mali",countryCode:"+223",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"ML"},{countryName:"Mozambique",countryCode:"+258",currency:"Mozambican metical",currencyCode:"MZN",currencyIcon:"MT",internetCountryCode:"MZ"},{countryName:"Namibia",countryCode:"+264",currency:"Namibian dollar",currencyCode:"NAD",currencyIcon:"$",internetCountryCode:"NA"},{countryName:"Niger",countryCode:"+227",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"NE"},{countryName:"Nigeria",countryCode:"+234",currency:"Nigerian naira",currencyCode:"NGN",currencyIcon:"\u20A6",internetCountryCode:"NG"},{countryName:"Republic of the Congo",countryCode:"+242",currency:"Central African CFA franc",currencyCode:"XAF",currencyIcon:"Fr",internetCountryCode:"CG"},{countryName:"Rwanda",countryCode:"+250",currency:"Rwandan franc",currencyCode:"RWF",currencyIcon:"Fr",internetCountryCode:"RW"},{countryName:"Senegal",countryCode:"+221",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"SN"},{countryName:"Seychelles",countryCode:"+248",currency:"Seychellois rupee",currencyCode:"SCR",currencyIcon:"\u20A8",internetCountryCode:"SC"},{countryName:"South Africa",countryCode:"+27",currency:"South African rand",currencyCode:"ZAR",currencyIcon:"R",internetCountryCode:"ZA"},{countryName:"South Sudan",countryCode:"+211",currency:"South Sudanese pound",currencyCode:"SSP",currencyIcon:"\xA3",internetCountryCode:"SS"},{countryName:"Tanzania",countryCode:"+255",currency:"Tanzanian shilling",currencyCode:"TZS",currencyIcon:"Sh",internetCountryCode:"TZ"},{countryName:"Togo",countryCode:"+228",currency:"West African CFA franc",currencyCode:"XOF",currencyIcon:"Fr",internetCountryCode:"TG"},{countryName:"Uganda",countryCode:"+256",currency:"Ugandan shilling",currencyCode:"UGX",currencyIcon:"Sh",internetCountryCode:"UG"},{countryName:"Zambia",countryCode:"+260",currency:"Zambian kwacha",currencyCode:"ZMW",currencyIcon:"ZK",internetCountryCode:"ZM"}],Pt=()=>{let e={};return He?.forEach(t=>{e[t?.internetCountryCode]=t?.countryName}),e};import*as Ce from"react";import*as Te from"react-phone-number-input";import Vr from"react-phone-number-input/flags";import{jsx as ge,jsxs as Br}from"react/jsx-runtime";var Ar=e=>Br("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"none",...e,children:[ge("rect",{width:"32",height:"32",fill:"#60A5FA"})," ",ge("path",{d:"M3 10L7 8L10 9L13 8L16 10L19 9L22 11L25 10L28 12V15L26 17L28 19L27 22L29 24L27 26L24 25L21 26L18 24L15 25L12 23L9 24L6 22L4 23L2 21V18L4 16L3 13L5 11L3 10Z",fill:"#34D399"}),ge("rect",{x:"2",y:"28",width:"28",height:"3",fill:"#D1D5DB"}),ge("path",{d:"M0 16H32M8 0V32M16 0V32M24 0V32",stroke:"#2563EB",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}),ge("path",{d:"M0 16H32",stroke:"#2563EB",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})]}),Dt=Ar;import{jsx as f,jsxs as ye}from"react/jsx-runtime";var kt=Ce.forwardRef(({className:e,onChange:t,defaultCountry:r="NG",modal:a,showAsterisk:n,label:i,description:l,error:s,...c},d)=>{let m=u=>f(Or,{...u,status:c.status,modal:a});return ye("div",{className:"relative space-y-1",children:[f(P,{showAsterisk:n,error:s,children:i}),f(Te.default,{ref:d,className:o("flex",e),flagComponent:K,countrySelectComponent:m,inputComponent:Lt,defaultCountry:r,onChange:u=>{t&&t?.(u)},...c}),f(T,{className:"text-gray-400 text-sm !font-normal",children:l}),f(L,{error:s})]})});kt.displayName="PhoneInput";var Lt=Ce.forwardRef(({className:e,...t},r)=>f(G,{className:o("!rounded-s-none h-10",e),...t,ref:r}));Lt.displayName="InputComponent";var Or=({disabled:e,value:t,onChange:r,options:a,status:n,modal:i})=>{let l=Ce.useCallback(s=>{r(s)},[r]);return ye(Z,{modal:i,children:[f(M,{disabled:e,children:ye("div",{className:o(O({status:n}),"transition justify-center items-center disabled:text-base-500 flex gap-3 h-10 rounded-e-none border-e-0 pl-2 pr-2"),children:[f(K,{country:t,countryName:t}),f("svg",{className:o("mr-0.5 h-4 w-4 opacity-50",e?"hidden":"opacity-100"),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:f("path",{d:"M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",stroke:"#959595",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),f(H,{portal:!i,className:"w-[200px] md:w-[300px] p-0",children:f(ie,{children:f(le,{children:ye(fe,{className:"h-72",children:[f(se,{placeholder:"Search country..."}),f(de,{children:"No country found."}),f(ce,{children:a.filter(s=>s.value).map(s=>ye(pe,{className:"gap-2",onSelect:()=>l(s.value),children:[f(K,{country:s.value,countryName:s.label}),f("span",{className:"flex-1 text-sm",children:s.label}),s.value&&f("span",{className:"text-[#191919]/50 text-sm dark:text-white",children:`+${Te.getCountryCallingCode(s.value)}`}),f("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:o("ml-auto",s.value===t?"opacity-100":"opacity-0"),children:f("path",{d:"M4 8.00008L6.66353 10.6636L12 5.33655",stroke:"#959595",strokeWidth:"1.06667",strokeLinecap:"round",strokeLinejoin:"round"})})]},`${s.value}-${s.label}`))})]})})})})]})},K=({country:e,countryName:t,className:r})=>{let a=Vr[e];return e==="GLOBAL"?f("span",{className:o("bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",r),children:f(Dt,{className:"w-full h-[90%]"})}):f("span",{className:o("bg-white/20 flex h-4 w-6 overflow-hidden rounded-sm",r),children:a&&f(a,{title:t})})};K.displayName="FlagComponent";import{jsx as F,jsxs as be}from"react/jsx-runtime";var Hr=Pt(),Wr=({className:e,value:t,placeholder:r="",status:a,disabled:n})=>F(M,{asChild:!0,disabled:n,children:be("button",{disabled:n,className:o(O({status:a}),"[&>span]:justify-start [&>span]:items-center gap-2 flex w-full items-center justify-between goup",t?"":"text-[#79818C]",e),children:[t?be("div",{className:"flex gap-2 items-center",children:[F(K,{country:t,countryName:t,className:"ml-1 !w-6 h-5"}),be("span",{className:"",children:[" ",Hr[t]]})]}):r??"Select options...",F("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:" data-[state=open]:goup-rotate-180",children:F("path",{d:"M16.5999 7.45825L11.1666 12.8916C10.5249 13.5333 9.4749 13.5333 8.83324 12.8916L3.3999 7.45825",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),Gr=({hideSearch:e=!0,showAsterisk:t,label:r,description:a,error:n,...i})=>{let l=He?.map(s=>({value:s?.internetCountryCode,label:s?.countryName,...s}));return be("div",{className:"relative space-y-1",children:[F(P,{showAsterisk:t,error:n,children:r}),F(Le,{options:l,hideSearch:e,optionComponent:s=>be("div",{className:"w-full flex items-center gap-2",children:[F(K,{country:s?.internetCountryCode,countryName:s?.label,className:"ml-2 !w-6 !h-5"}),F("span",{className:"flex-1 text-sm",children:s?.label})]}),...i,children:F(Wr,{value:i?.value?.value,status:i?.status,placeholder:i?.placeholder??" Select Country"})}),F(T,{className:"text-gray-400 text-sm !font-normal",children:a}),F(L,{error:n})]})};import{jsx as he,jsxs as Zr}from"react/jsx-runtime";var zr=({showAsterisk:e,label:t,description:r,error:a,hideSearch:n=!0,status:i,...l})=>Zr("div",{className:"relative space-y-1",children:[he(P,{showAsterisk:e,error:a,children:t}),he(Le,{hideSearch:n,...l,containerClassName:"h-full",children:he(Rt,{disabled:l?.disabled,placeholder:"Select or search email",status:i,value:l?.value?.label??l?.value?.value})}),he(T,{className:"text-gray-400 text-sm !font-normal",children:r}),he(L,{error:a})]});import Kr from"react-otp-input";import{cva as _r}from"class-variance-authority";import{useMemo as $r}from"react";import{jsx as Tt}from"react/jsx-runtime";var Ur=_r("transition cursor-default placeholder:text-black dark:placeholder:text-white rounded-lg !h-14 !w-14 border aspect-square text-base font-semibold tracking-normal outline-none placeholder:text-sm placeholder:font-normal text-black focus:bg-white",{variants:{status:{default:"border-gray-300 dark:border-[#d4d4d4] focus:border-gray-400 focus-visible:!ring-offset-gray-200 focus:ring-offset-gray-200 !ring-gray-200 !focus-visible:ring-1 bg-white dark:!bg-transparent dark:focus-visible:!ring-0 dark:focus-within:!bg-transparent dark:text-white dark:focus-within:border-[#9299A2] dark:border-[#676767] dark:disabled:!border-[#9299A2]",error:"placeholder:text-red-600 bg-red-50 border-red-600 text-red-600 focus-within:bg-red-50 focus-within:border-red-600",loading:"placeholder:text-[#C4C4C4]"}},defaultVariants:{status:"default"}}),Xr=({numInputs:e=4,inputStyle:t,containerStyle:r,placeholder:a="-",status:n,...i})=>{let l=$r(()=>a||new Array(e).fill("").reduce((d,m)=>d+=m,""),[e,a]);return Tt(Kr,{numInputs:e,placeholder:l,containerStyle:o("w-full",r),inputStyle:o(Ur({status:n}),t),renderInput:s=>Tt("input",{...s}),...i})};import{useState as Yr}from"react";import{Copy as jr,CheckIcon as Jr}from"lucide-react";import{motion as Qr,AnimatePresence as qr}from"framer-motion";import{jsx as Q,jsxs as to}from"react/jsx-runtime";var eo=({text:e,textToCopy:t,onCopy:r,iconsPosition:a="right",clampText:n=!0,textClassName:i})=>{let[l,s]=Yr(!1),c=()=>{navigator.clipboard.writeText(t??e).then(()=>{s(!0),r?.(),setTimeout(()=>s(!1),2e3)})},d=l?Jr:jr;return to("div",{className:"flex items-center space-x-2 cursor-pointer text-[#717171] bg-gray-100 w-fit max-w-full rounded-md p-1 px-2",children:[a==="left"&&Q(St,{Icon:d,onClick:c,copied:l}),Q("span",{className:o({"truncate max-w-[100px]":n},i),children:e}),a==="right"&&Q(St,{Icon:d,onClick:c,copied:l})]})},St=({Icon:e,onClick:t,copied:r})=>Q(qr,{mode:"wait",children:Q(Qr.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},onClick:t,children:Q(e,{className:`w-5 h-5 ${r?"text-green-500":"text-gray-500 hover:text-gray-700 transition"}`})},r?"check":"copy")});import{useEffect as Ft,useState as ro}from"react";import{Search as oo}from"lucide-react";import{jsx as Et}from"react/jsx-runtime";var We=({value:e,onChange:t,debounce:r=500,addon:a,...n})=>{let[i,l]=ro(e??""),s=c=>l(c.target.value);return Ft(()=>{e&&l(e)},[e]),Ft(()=>{let c=setTimeout(()=>{t(i)},r);return()=>clearTimeout(c)},[i,r,t]),Et(G,{leftNode:a??Et(oo,{className:" w-4 h-4 text-gray-400"}),sideNodeClassName:"bg-transparent !pr-0 !w-4 border-0 !min-w-[40px]",...n,className:o("!pl-0 py-1 border-[.5px] border-[#E9EBF8] rounded-xl text-sm w-full h-8 focus:outline-none focus:placeholder:hidden focus:!ring-2 !focus:ring-primary-main bg-[#F5F8FF] focus-within:!bg-transparent placeholder:text-xs",n?.className),onChange:s,value:i})};import{jsx as Ge}from"react/jsx-runtime";var ao=({status:e,variant:t,className:r})=>Ge("div",{children:Ge("div",{className:o("order-first max-w-max flex-none rounded-full px-2 py-1 text-xs font-medium ring-1 ring-inset ring-current sm:order-none text-[14px] capitalize",{"bg-green-500/20 text-green-500":t==="success"},{"bg-gray-500/20 text-white":t==="abandoned"},{"bg-red-500/20 text-red-500":t==="failed"},{"bg-yellow-500/20 text-yellow-500":t==="pending"},r),children:Ge("p",{children:e.replace("-"," ")})})});import{Download as co,ListFilter as po,Loader as mo,RotateCw as uo}from"lucide-react";import{ChevronLeftIcon as io,ChevronRightIcon as so}from"lucide-react";import{jsx as ze}from"react/jsx-runtime";var no=({page:e,currentPage:t,onClick:r})=>typeof e=="string"?ze("span",{className:"px-3 py-1 sm:px-4 sm:py-2 text-xs sm:text-sm font-semibold text-gray-500",children:e}):ze("button",{onClick:r,className:`p-1 w-8 h-8 text-xs sm:text-sm rounded-full ${e===t?"bg-primary-main text-white":"text-[#717171] hover:bg-primary-main/10"}`,children:e}),It=({totalPages:e,currentPage:t,handlePageClick:r})=>{let n=()=>{let c=Math.floor(1.5),d=Math.max(1,t-c),m=Math.min(e,d+3-1);return m>e&&(d=Math.max(1,e-3+1),m=e),{start:d,end:m}},{start:i,end:l}=n(),s=[];return i>1&&s.push(1),i>2&&s.push("..."),s.push(...Array.from({length:l-i+1},(c,d)=>i+d)),l<e-1&&s.push("..."),l<e&&s.push(e),s.map((c,d)=>ze(no,{page:c,currentPage:t,onClick:typeof c=="number"?()=>r(c):void 0},d))};import{jsx as q,jsxs as Ze}from"react/jsx-runtime";var Mt=({currentPage:e=1,totalPages:t=1,onPageChange:r,itemsPerPage:a=0,totalItems:n=0})=>{let i=c=>{c>=1&&c<=t&&r?.(c)},l=a===0?1:a*(e-1)+1,s=e===t?n:Math.min(l+a-1,n);return Ze("div",{className:"flex items-center justify-between border-t border-gray-200 px-4 py-3 sm:px-6 w-full flex-wrap gap-y-10 sm:gap-y-0",children:[n&&q("section",{className:"text-[#717171] text-[12px]",children:Ze("p",{className:"",children:["Showing ",l," - ",s," of ",n]})}),q("div",{className:"flex items-center justify-center sm:justify-end ",children:Ze("nav",{className:" inline-flex gap-x-1 sm:gap-x-[10px] items-center",children:[q("button",{onClick:()=>i(e-1),disabled:e===1,className:"text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",children:q(io,{className:"size-5"})}),It({currentPage:e,totalPages:t,handlePageClick:i}),q("button",{onClick:()=>i(e+1),disabled:e===t,className:"text-xs text-[#222222] hover:bg-primary-main/10 disabled:text-[#D9D9D9] disabled:cursor-not-allowed sm:flex hidden",children:q(so,{className:"size-5"})})]})})]})};import{flexRender as At}from"@tanstack/react-table";import{jsx as W,jsxs as lo}from"react/jsx-runtime";var Bt=({table:e,isMobile:t,onRowClick:r,id:a})=>W("div",{className:o("relative w-full rounded-b border-0",{}),children:lo("table",{id:a??"table",className:"w-full overflow-x-scroll",children:[W("thead",{children:e.getHeaderGroups().map(n=>W("tr",{className:o(" rounded text-[#717171] border-b- bg-[#FCFCFC]",{}),children:n.headers.map(i=>W("th",{className:"relative py-3 text-base whitespace-nowrap pl-2.5 text-left font-normal capitalize",colSpan:i.colSpan,style:{width:i.getSize()},children:i.isPlaceholder?null:W("div",{className:o("flex items-center",{"cursor-pointer select-none":i.column.getCanSort()}),onClick:i.column.getToggleSortingHandler(),children:i.isPlaceholder?null:At(i.column.columnDef.header,i.getContext())})},i.id))},n.id))}),W("tbody",{className:" pl-2.5",children:e?.getFilteredRowModel().rows.map(n=>W("tr",{className:o("first-letter border-b border-zinc-100",{"hover:bg-gray-50":!t},{"hover:bg-gray-50 hover:cursor-pointer":r}),onClick:()=>r?r(n):{},children:n.getVisibleCells().map(i=>W("td",{className:o("",{}),children:W("div",{className:o("",{"w-max p-4 pl-2.5 text-black text-sm":!0}),children:At(i.column.columnDef.cell,i.getContext())})},i.id))},n.id))})]})});import{jsx as C,jsxs as ee}from"react/jsx-runtime";var fo=({table:e,isMobile:t=!1,onRowClick:r,id:a,onRefetch:n,isRefetching:i,FilterMenu:l,ExtraNode:s,onExport:c,search:d={enabled:!1,debounceRate:700},download:m={enabled:!1,buttonId:"download_button",buttonText:"Export"},isLoading:u,pagination:p})=>{let g=()=>{try{n?.()}catch(N){console.error("Error while refetching data",N)}},v=N=>{d?.onSearch?.(N)};return ee("div",{className:o("relative w-full rounded-b border-0 overflow-x-auto"),children:[(n||d?.enabled||l||s||c)&&ee("div",{className:"w-full flex flex-col sm:flex-row justify-between items-start sm:items-center bg-white p-2 gap-2",children:[C("div",{className:"flex flex-1 flex-col sm:flex-row items-center gap-2 justify-start",children:ee("div",{className:" w-full flex gap-x-3",children:[d?.enabled&&C("section",{className:"sm:w-56",children:C(We,{type:"text",placeholder:"Enter search here...",className:"h-9",onChange:v,debounce:d?.debounceRate})}),ee("div",{className:" flex gap-2",children:[n&&C(j,{onClick:g,title:"Refetch Data",disabled:i,variant:"outlined",className:"!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px] ",size:"sm",children:C(uo,{className:o("w-4 h-4",{"animate-spin":i}),size:5})}),l&&C(De,{trigger:C("button",{title:"Filter",className:o("!border-[#DEDEDE] !text-gray-800 !px-[10px] !py-[8px]",Re({variant:"outlined",size:"sm"})),children:C(po,{className:"w-4 h-4",size:5})}),children:l})]})]})}),C("div",{className:"flex items-start flex-col gap-2 justify-center",children:C("section",{className:"flex flex-col-reverse sm:flex-row gap-2",children:ee("div",{className:"flex gap-2",children:[s&&s,c&&C(j,{variant:"primary",onClick:c,size:"sm",children:"Export"}),m?.enabled&&C(j,{variant:"primary",leftNode:C(co,{className:o("w-4 h-4",{"animate-spin":i}),size:5}),onClick:m?.onDownload,id:m.buttonId,size:"sm",children:m?.buttonText})]})})})]}),C("main",{className:"w-full overflow-x-auto mt-5",children:u?ee("div",{className:"py-10 flex flex-col justify-center w-full items-center space-x-2",children:[C(mo,{size:20,className:"animate-spin"}),C("p",{className:"mt-3 text-center text-gray-600 text-sm opacity-70 animate-pulse",children:"Loading..."})]}):e.getRowModel().rows.length<1?C("div",{className:"py-10 flex flex-col justify-center w-full items-center",children:C("p",{className:"text-center text-gray-600 text-sm opacity-70",children:"No data available"})}):C("div",{className:"flex flex-col gap-2",children:C(Bt,{table:e,isMobile:t,onRowClick:r,id:a})})}),!u&&p?.enabled&&e.getRowModel().rows.length>0&&C(Mt,{...p,currentPage:p?.currentPage??1,totalPages:p?.totalPages??Math.ceil((p?.totalItems??0)/Math.max(p?.itemsPerPage??1,1))??1,onPageChange:N=>p?.onPageChange?.(N)})]})};import{useEffect as Vt}from"react";import{X as go}from"lucide-react";import{jsx as B,jsxs as te}from"react/jsx-runtime";var yo=e=>{let{environment:t,branch:r,version:a,deployTime:n,showBanner:i,onClose:l,initDefault:s,removeFromStorage:c,syncLocalStorageToState:d}=e,m=t||process.env.NEXT_PUBLIC_NODE_ENV;return m!=="staging"&&m!=="sandbox"||(Vt(()=>{d()},[d]),Vt(()=>{let u;return(m==="staging"||m==="sandbox")&&(u=setInterval(()=>{c(),s()},5*60*1e3)),()=>{u&&clearInterval(u)}},[i,t,l,c,s,m]),!i)?null:te("div",{className:"w-fit p-4 border shadow-md bg-white rounded-md z-[99999] absolute top-2 right-2 min-w-96",children:[B("button",{onClick:l,className:"absolute top-2 right-2",children:B(go,{})}),te("div",{className:"space-y-2 text-sm",children:[te("div",{className:"flex gap-2",children:[B("span",{className:"font-medium",children:"Environment:"}),B("span",{className:"text-blue-600 capitalize",children:m})]}),te("div",{className:"flex gap-2",children:[B("span",{className:"font-medium",children:"Branch:"}),B("span",{className:"text-green-600 capitalize",children:r||process.env.NEXT_PUBLIC_DEPLOY_BRANCH})]}),te("div",{className:"flex gap-2",children:[B("span",{className:"font-medium",children:"Version:"}),B("span",{className:"text-purple-600",children:a||process.env.NEXT_PUBLIC_DEPLOY_VERSION})]}),te("div",{className:"flex gap-2",children:[B("span",{className:"font-medium",children:"Deploy Time:"}),B("span",{className:"text-orange-600",children:n||process.env.NEXT_PUBLIC_DEPLOY_TIME})]})]})]})};import{useState as Co,useEffect as bo}from"react";import{jsx as b,jsxs as U}from"react/jsx-runtime";var ho=({type:e})=>e==="gray"?b("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:b("path",{d:"M10 0C4.49 0 0 4.49 0 10C0 15.51 4.49 20 10 20C15.51 20 20 15.51 20 10C20 4.49 15.51 0 10 0ZM14.78 7.7L9.11 13.37C8.97 13.51 8.78 13.59 8.58 13.59C8.38 13.59 8.19 13.51 8.05 13.37L5.22 10.54C4.93 10.25 4.93 9.77 5.22 9.48C5.51 9.19 5.99 9.19 6.28 9.48L8.58 11.78L13.72 6.64C14.01 6.35 14.49 6.35 14.78 6.64C15.07 6.93 15.07 7.4 14.78 7.7Z",fill:"#79818C"})}):e==="info"?b("svg",{stroke:"#70B6F6",fill:"#70B6F6","stroke-width":"0",viewBox:"0 0 16 16",height:"24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:b("path",{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2"})}):e==="warning"?b("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:b("path",{d:"M9.99984 1.66663C5.40817 1.66663 1.6665 5.40829 1.6665 9.99996C1.6665 14.5916 5.40817 18.3333 9.99984 18.3333C14.5915 18.3333 18.3332 14.5916 18.3332 9.99996C18.3332 5.40829 14.5915 1.66663 9.99984 1.66663ZM9.37484 6.66663C9.37484 6.32496 9.65817 6.04163 9.99984 6.04163C10.3415 6.04163 10.6248 6.32496 10.6248 6.66663V10.8333C10.6248 11.175 10.3415 11.4583 9.99984 11.4583C9.65817 11.4583 9.37484 11.175 9.37484 10.8333V6.66663ZM10.7665 13.65C10.7248 13.7583 10.6665 13.8416 10.5915 13.925C10.5082 14 10.4165 14.0583 10.3165 14.1C10.2165 14.1416 10.1082 14.1666 9.99984 14.1666C9.8915 14.1666 9.78317 14.1416 9.68317 14.1C9.58317 14.0583 9.4915 14 9.40817 13.925C9.33317 13.8416 9.27484 13.7583 9.23317 13.65C9.1915 13.55 9.1665 13.4416 9.1665 13.3333C9.1665 13.225 9.1915 13.1166 9.23317 13.0166C9.27484 12.9166 9.33317 12.825 9.40817 12.7416C9.4915 12.6666 9.58317 12.6083 9.68317 12.5666C9.88317 12.4833 10.1165 12.4833 10.3165 12.5666C10.4165 12.6083 10.5082 12.6666 10.5915 12.7416C10.6665 12.825 10.7248 12.9166 10.7665 13.0166C10.8082 13.1166 10.8332 13.225 10.8332 13.3333C10.8332 13.4416 10.8082 13.55 10.7665 13.65Z",fill:"#FFC700"})}):e==="success"?b("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:b("path",{d:"M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z",fill:"#00D488"})}):b("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:b("path",{d:"M9.99984 1.66663C5.40817 1.66663 1.6665 5.40829 1.6665 9.99996C1.6665 14.5916 5.40817 18.3333 9.99984 18.3333C14.5915 18.3333 18.3332 14.5916 18.3332 9.99996C18.3332 5.40829 14.5915 1.66663 9.99984 1.66663ZM9.37484 6.66663C9.37484 6.32496 9.65817 6.04163 9.99984 6.04163C10.3415 6.04163 10.6248 6.32496 10.6248 6.66663V10.8333C10.6248 11.175 10.3415 11.4583 9.99984 11.4583C9.65817 11.4583 9.37484 11.175 9.37484 10.8333V6.66663ZM10.7665 13.65C10.7248 13.7583 10.6665 13.8416 10.5915 13.925C10.5082 14 10.4165 14.0583 10.3165 14.1C10.2165 14.1416 10.1082 14.1666 9.99984 14.1666C9.8915 14.1666 9.78317 14.1416 9.68317 14.1C9.58317 14.0583 9.4915 14 9.40817 13.925C9.33317 13.8416 9.27484 13.7583 9.23317 13.65C9.1915 13.55 9.1665 13.4416 9.1665 13.3333C9.1665 13.225 9.1915 13.1166 9.23317 13.0166C9.27484 12.9166 9.33317 12.825 9.40817 12.7416C9.4915 12.6666 9.58317 12.6083 9.68317 12.5666C9.88317 12.4833 10.1165 12.4833 10.3165 12.5666C10.4165 12.6083 10.5082 12.6666 10.5915 12.7416C10.6665 12.825 10.7248 12.9166 10.7665 13.0166C10.8082 13.1166 10.8332 13.225 10.8332 13.3333C10.8332 13.4416 10.8082 13.55 10.7665 13.65Z",fill:"#F04248"})}),vo=({type:e="info",title:t,description:r,open:a,showCloseButton:n,bottomNode:i,sideNode:l,onClose:s,showIcon:c=!0})=>{let[d,m]=Co(a);bo(()=>{m(a)},[a]);let u="",p="";switch(e){case"gray":u="#eeeef0",p="#79818c";break;case"info":u="#ebf5fd",p="#70B6F6";break;case"warning":u="#fff8df",p="#ffc700";break;case"success":u="#e0f9f0",p="#49e0aa";break;case"danger":u="#fde8e9",p="#f3777c";break;default:u="#eeeef0",p="#79818c";break}function g(){m(!1),s&&s()}return d?U("div",{className:"w-full shadow-lg transform flex items-center rounded-md",style:{background:u||"#ebf5fd"},children:[b("div",{className:"flex-none absolute rounded-l-[2px] rounded-l-4px h-[4px] w-full top-0",style:{background:p||"#70B6F6"}}),U("div",{className:"w-full gap-3 h-full flex flex-row justify-between px-4 md:px-4 py-3 md:py-4",children:[U("div",{className:"flex flex-row gap-2.5 items-start w-full h-full",children:[c&&b("div",{className:"h-full flex justify-end",children:b(ho,{type:e})}),U("div",{className:"w-full gap-3 h-full flex flex-col md:flex-row items-start justify-between",children:[U("div",{className:"flex-1 gap-3 h-full flex flex-col items-start justify-between",children:[(t||r)&&U("div",{children:[t&&b("div",{className:"text-sm font-bold text-[#191919]",children:t}),r&&b("div",{className:"text-sm font-normal text-[#5D5D5D] mt-1",children:r})]}),i]}),l]})]}),n&&b("div",{className:"w-1/10 h-full flex flex-col justify-start items-center",children:b("button",{onClick:g,children:U("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b("path",{d:"M3.3335 3.33337L12.6662 12.6661",stroke:"#191919",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),b("path",{d:"M3.33429 12.6661L12.667 3.33337",stroke:"#191919",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})})]})]}):null};import{jsx as Ot}from"react/jsx-runtime";var Ht=()=>Ot("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 20 20","aria-hidden":"true",className:"h-5 w-5",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:Ot("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})});import{jsx as ve,jsxs as xo}from"react/jsx-runtime";var Wt=e=>xo("svg",{viewBox:"0 0 60 30",className:"w-full max-w-md h-auto","aria-label":"Union Jack - Flag of the United Kingdom",...e,children:[ve("rect",{width:"60",height:"30",fill:"#00247D"}),ve("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#FFFFFF",strokeWidth:"6"}),ve("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#CF142B",strokeWidth:"4"}),ve("path",{d:"M30,0 L30,30 M0,15 L60,15",stroke:"#FFFFFF",strokeWidth:"10"}),ve("path",{d:"M30,0 L30,30 M0,15 L60,15",stroke:"#CF142B",strokeWidth:"6"})]});import{jsx as Ke,jsxs as wo}from"react/jsx-runtime";var Gt=e=>wo("svg",{viewBox:"0 0 60 40",className:"w-full max-w-md h-auto","aria-label":"Tricolore - Flag of France",...e,children:[Ke("rect",{x:"0",y:"0",width:"20",height:"40",fill:"#002395"}),Ke("rect",{x:"20",y:"0",width:"20",height:"40",fill:"#FFFFFF"}),Ke("rect",{x:"40",y:"0",width:"20",height:"40",fill:"#ED2939"})]});import{jsx as zt,jsxs as No}from"react/jsx-runtime";var Zt=()=>No("svg",{width:"20",height:"18",viewBox:"0 0 8 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[zt("path",{d:"M5.50257 12.9395L3.68439 14.7576L1.86621 12.9395",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),zt("path",{d:"M5.50257 5.06055L3.68439 3.24237L1.86621 5.06055",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});import{PopoverClose as Ro}from"@radix-ui/react-popover";import{jsx as k,jsxs as _e}from"react/jsx-runtime";var Po=[{key:"en",label:"English"},{key:"fr",label:"French"}],Do=({locale:e})=>e==="fr"?k(Gt,{width:10}):k(Wt,{width:10}),ko=({locale:e})=>k("div",{className:"px-2 py-1 ",children:_e("div",{className:"flex items-center gap-2.5",children:[k(Do,{locale:e})," ",k("span",{className:"uppercase",children:e}),k(Zt,{})]})}),Lo=({locale:e="en",onChange:t,locales:r=Po})=>_e(Z,{children:[k("div",{className:"flex items-center gap-2 px-2 py-1 rounded-lg shadow border-[0.5px] border-gray-50/50 text-current bg-white/10 ",children:k(M,{className:"!p-0 !bg-transparent ",children:k(ko,{locale:e})})}),k(H,{side:"bottom",className:"p-0 max-w-max rounded-md overflow-hidden mx-auto mt-2",children:k("div",{children:r?.map(a=>_e(Ro,{type:"button",className:o("flex items-center gap-3 px-3 py-1 text-sm hover:bg-blue-50 w-full transition-all",{"bg-blue-100":e&&e===a?.key}),onClick:()=>t?.(a?.key),children:[a?.label," ",e&&e===a?.key&&k(Ht,{})]},a?.key))})})]});import*as xe from"react";import{Drawer as R}from"vaul";import{cva as So}from"class-variance-authority";import{useWindowSize as Fo}from"react-use";import{jsx as Kt,jsxs as To}from"react/jsx-runtime";var _t=()=>To("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-x",children:[Kt("path",{d:"M18 6 6 18"}),Kt("path",{d:"m6 6 12 12"})]});import{Fragment as Vo,jsx as h,jsxs as re}from"react/jsx-runtime";var $e=({shouldScaleBackground:e=!0,...t})=>h(R.Root,{direction:"right",shouldScaleBackground:e,...t});$e.displayName="Drawer";var Eo=R.Trigger,Io=R.Close,Mo=R.Portal,$t=xe.forwardRef(({className:e,...t},r)=>h(R.Overlay,{className:o("fixed inset-0 z-40 bg-black/75 !m-0 !p-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));$t.displayName=R.Overlay.displayName;var Ao=So("fixed focus-visible:outline-0 z-50 gap-4 bg-white shadow-lg dark:bg-[#2B2B2B] dark:text-white transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:border-none",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top rounded-b-lg",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom rounded-t-lg",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-[512px] ",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-[512px]"}},defaultVariants:{side:"right"}}),Ut=xe.forwardRef(({side:e="right",hideCloseButton:t,className:r,children:a,...n},i)=>re(Mo,{children:[h($t,{}),re(R.Content,{ref:i,className:o(Ao({side:e}),r),...n,children:[h("button",{className:"bg-gray-300 block md:hidden mx-auto mt-4 h-1.5 w-[80px] rounded-full opacity-70 transition-opacity hover:opacity-100"}),a,!t&&re(R.Close,{className:"absolute right-2 top-3 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[h(_t,{}),h("span",{className:"sr-only",children:"Close"})]})]})]}));Ut.displayName=R.Content.displayName;var Xt=({className:e,...t})=>h("div",{className:o("text-2xl flex flex-col border-b-0 border-b-gray-200 space-y-1 text-left w-full p-3 py-4",e),...t});Xt.displayName="DrawerHeader";var Yt=({className:e,...t})=>h("div",{className:o("flex flex-col-reverse sm:flex-row m-auto right-0 left-0 p-3 sm:space-x-2 border-t border-t-[#EDEDED] dark:border-t-[#242424] w-full",e),...t});Yt.displayName="DrawerFooter";var jt=xe.forwardRef(({className:e,...t},r)=>h(R.Title,{ref:r,className:o("text-xl font-semibold text-[#191919] dark:text-white",e),...t}));jt.displayName=R.Title.displayName;var Jt=xe.forwardRef(({className:e,...t},r)=>h(R.Description,{ref:r,className:o("text-xs text-[#5d5c5c] dark:text-white",e),...t}));Jt.displayName=R.Description.displayName;var Bo=({trigger:e=void 0,children:t,open:r=void 0,onOpenChange:a=void 0,hideCloseButton:n,footer:i,title:l,description:s,contentClassName:c,headerClassName:d,titleClassName:m,descriptionClassName:u,footerClassName:p,asChild:g=!0,onOpenAutoFocus:v,onCloseAutoFocus:N})=>{let{width:X}=Fo(),V=X<768?"bottom":"right";return re($e,{open:r,onOpenChange:a,direction:V,children:[h(Eo,{className:"cursor-pointer",asChild:g,children:e}),re(Ut,{className:o("flex flex-col gap-0 justify-start items-start max-h-[90vh] md:max-h-full w-full max-w-[500px]",c),side:V,hideCloseButton:n,onOpenAutoFocus:v,onCloseAutoFocus:N,children:[l||s?re(Xt,{className:d,children:[l&&h(jt,{className:m,children:l}),s&&h(Jt,{className:u,children:s})]}):h(Vo,{}),h("div",{className:o("flex w-full overflow-y-auto flex-col justify-start items-start p-4 flex-1 h-[30px]"),children:t}),i&&h(Yt,{className:p,children:i})]})]})};var Qt={USD:"$",CAD:"CA$",EUR:"\u20AC",AED:"AED",AFN:"Af",ALL:"ALL",AMD:"AMD",ARS:"AR$",AUD:"AU$",AZN:"man.",BAM:"KM",BDT:"Tk",BGN:"BGN",BHD:"BD",BIF:"FBu",BND:"BN$",BOB:"Bs",BRL:"R$",BWP:"BWP",BYN:"Br",BZD:"BZ$",CDF:"CDF",CHF:"CHF",CLP:"CL$",CNY:"CN\xA5",COP:"CO$",CRC:"\u20A1",CVE:"CV$",CZK:"K\u010D",DJF:"Fdj",DKK:"Dkr",DOP:"RD$",DZD:"DA",EEK:"Ekr",EGP:"EGP",ERN:"Nfk",ETB:"Br",GBP:"\xA3",GEL:"GEL",GHS:"GH\u20B5",GNF:"FG",GTQ:"GTQ",HKD:"HK$",HNL:"HNL",HRK:"kn",HUF:"Ft",IDR:"Rp",ILS:"\u20AA",INR:"\u20B9",IQD:"IQD",IRR:"IRR",ISK:"Ikr",JMD:"J$",JOD:"JD",JPY:"\xA5",KES:"Ksh",KHR:"KHR",KMF:"CF",KRW:"\u20A9",KWD:"KD",KZT:"KZT",LBP:"L.L.",LKR:"SLRs",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"MDL",MGA:"MGA",MKD:"MKD",MMK:"MMK",MOP:"MOP$",MUR:"MURs",MXN:"MX$",MYR:"RM",MZN:"MTn",NAD:"N$",NGN:"\u20A6",NIO:"C$",NOK:"Nkr",NPR:"NPRs",NZD:"NZ$",OMR:"OMR",PAB:"B/.",PEN:"S/.",PHP:"\u20B1",PKR:"PKRs",PLN:"z\u0142",PYG:"\u20B2",QAR:"QR",RON:"RON",RSD:"din.",RUB:"RUB",RWF:"RWF",SAR:"SR",SDG:"SDG",SEK:"Skr",SGD:"S$",SOS:"Ssh",SYP:"SY\xA3",THB:"\u0E3F",TND:"DT",TOP:"T$",TRY:"TL",TTD:"TT$",TWD:"NT$",TZS:"TSh",UAH:"\u20B4",UGX:"USh",UYU:"$U",UZS:"UZS",VEF:"Bs.F.",VND:"\u20AB",XAF:"F CFA",XOF:"CFA",YER:"YR",ZAR:"R",ZMK:"ZK",ZWL:"ZWL$"},we=class we{static getCurrencyLocaleMap(t){return{XOF:"fr",XAF:"fr"}[t]||"en"}static koboToNaira(t){return+t/100}static nairaToKobo(t){return+t*100}static getCurrencySymbol(t){return Qt[t]||t}};Xe(we,"formatAmountAndCurrency",(t,r,a)=>{let n=new Intl.NumberFormat(a?.locale||we.getCurrencyLocaleMap(t),{maximumFractionDigits:3,style:"currency",currency:t,currencyDisplay:"symbol"}).format(a?.convertToMajorCurrency?we.koboToNaira(Number(r)):Number(r)).replace(/^(\D+)/,"$1 ").replace("\u202F"," ").replace(/\s+/,""),i=Qt[t]||t;return n.replace(t,i)});var qt=we;import Ue from"dayjs";var er=class{static getDateLibrary(){return Ue()}static formatTimestampToDate(t,r){return Ue.unix(t).format(r||"ddd, MMM, YYYY | HH:mm:ss")}static formatDateToTimestamp(t){return Ue(t).unix()}};export{qt as AmountAction,vo as Banner,j as Button,eo as CopyableLabel,Gr as Country,Qt as CurrencySymbolMap,er as DateAction,We as DebouncedInput,yo as DevBanner,Ve as Dialog,Bo as Drawer,Io as DrawerClose,$e as DrawerRoot,K as FlagComponent,P as FormLabel,G as Input,oe as Loader,Lo as LocaleSelector,Xr as OTPInput,mt as PasswordInput,kt as PhoneInput,De as Popover,H as PopoverContent,Z as PopoverRoot,M as PopoverTrigger,zr as Select,ao as Status,fo as Table,ut as Textarea,Re as buttonVariants,o as cn};
2
+ //# sourceMappingURL=index.mjs.map