@abpjs/theme-shared 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +568 -0
  3. package/dist/components/confirmation/Confirmation.d.ts +27 -0
  4. package/dist/components/confirmation/index.d.ts +1 -0
  5. package/dist/components/index.d.ts +4 -0
  6. package/dist/components/modal/Modal.d.ts +114 -0
  7. package/dist/components/modal/index.d.ts +1 -0
  8. package/dist/components/toast/Toast.d.ts +43 -0
  9. package/dist/components/toast/index.d.ts +1 -0
  10. package/dist/components/ui/Alert.d.ts +50 -0
  11. package/dist/components/ui/Button.d.ts +70 -0
  12. package/dist/components/ui/Checkbox.d.ts +64 -0
  13. package/dist/components/ui/FormField.d.ts +50 -0
  14. package/dist/components/ui/color-mode.d.ts +19 -0
  15. package/dist/components/ui/index.d.ts +16 -0
  16. package/dist/components/ui/provider.d.ts +2 -0
  17. package/dist/components/ui/toaster.d.ts +3 -0
  18. package/dist/components/ui/tooltip.d.ts +11 -0
  19. package/dist/contexts/confirmation.context.d.ts +100 -0
  20. package/dist/contexts/index.d.ts +2 -0
  21. package/dist/contexts/toaster.context.d.ts +91 -0
  22. package/dist/handlers/error.handler.d.ts +110 -0
  23. package/dist/handlers/index.d.ts +1 -0
  24. package/dist/hooks/index.d.ts +3 -0
  25. package/dist/index.d.ts +17 -0
  26. package/dist/index.js +1305 -0
  27. package/dist/index.mjs +1281 -0
  28. package/dist/models/confirmation.d.ts +21 -0
  29. package/dist/models/index.d.ts +2 -0
  30. package/dist/models/toaster.d.ts +48 -0
  31. package/dist/providers/ThemeSharedProvider.d.ts +135 -0
  32. package/dist/providers/index.d.ts +1 -0
  33. package/dist/theme/index.d.ts +42 -0
  34. package/dist/utils/index.d.ts +1 -0
  35. package/dist/utils/styles.d.ts +14 -0
  36. package/package.json +57 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,1281 @@
1
+ // src/models/toaster.ts
2
+ var Toaster;
3
+ ((Toaster2) => {
4
+ let Status;
5
+ ((Status2) => {
6
+ Status2["confirm"] = "confirm";
7
+ Status2["reject"] = "reject";
8
+ Status2["dismiss"] = "dismiss";
9
+ })(Status = Toaster2.Status || (Toaster2.Status = {}));
10
+ })(Toaster || (Toaster = {}));
11
+
12
+ // src/contexts/toaster.context.tsx
13
+ import {
14
+ createContext,
15
+ useContext,
16
+ useCallback,
17
+ useState,
18
+ useRef,
19
+ useMemo
20
+ } from "react";
21
+ import { jsx } from "react/jsx-runtime";
22
+ var ToasterContext = createContext(null);
23
+ var toastCounter = 0;
24
+ function generateId() {
25
+ toastCounter += 1;
26
+ return `toast-${Date.now()}-${toastCounter}-${Math.random().toString(36).substring(2, 9)}`;
27
+ }
28
+ var DEFAULT_LIFE = 5e3;
29
+ function ToasterProvider({ children }) {
30
+ const [toasts, setToasts] = useState([]);
31
+ const resolversRef = useRef(/* @__PURE__ */ new Map());
32
+ const remove = useCallback((id) => {
33
+ setToasts((prev) => prev.filter((t) => t.id !== id));
34
+ const resolver = resolversRef.current.get(id);
35
+ if (resolver) {
36
+ resolver(Toaster.Status.dismiss);
37
+ resolversRef.current.delete(id);
38
+ }
39
+ }, []);
40
+ const show = useCallback(
41
+ (message, title, severity, options) => {
42
+ const id = options?.id?.toString() || generateId();
43
+ const life = options?.sticky ? void 0 : options?.life ?? DEFAULT_LIFE;
44
+ const toast = {
45
+ id,
46
+ message,
47
+ title,
48
+ severity,
49
+ ...options
50
+ };
51
+ setToasts((prev) => [...prev, toast]);
52
+ if (life) {
53
+ setTimeout(() => {
54
+ remove(id);
55
+ }, life);
56
+ }
57
+ return new Promise((resolve) => {
58
+ resolversRef.current.set(id, resolve);
59
+ });
60
+ },
61
+ [remove]
62
+ );
63
+ const info = useCallback(
64
+ (message, title, options) => show(message, title, "info", options),
65
+ [show]
66
+ );
67
+ const success = useCallback(
68
+ (message, title, options) => show(message, title, "success", options),
69
+ [show]
70
+ );
71
+ const warn = useCallback(
72
+ (message, title, options) => show(message, title, "warn", options),
73
+ [show]
74
+ );
75
+ const error = useCallback(
76
+ (message, title, options) => show(message, title, "error", options),
77
+ [show]
78
+ );
79
+ const addAll = useCallback(
80
+ (messages) => {
81
+ messages.forEach((msg) => {
82
+ show(msg.message, msg.title, msg.severity, msg);
83
+ });
84
+ },
85
+ [show]
86
+ );
87
+ const clear = useCallback((status) => {
88
+ setToasts((prev) => {
89
+ prev.forEach((toast) => {
90
+ const resolver = resolversRef.current.get(toast.id);
91
+ if (resolver) {
92
+ resolver(status ?? Toaster.Status.dismiss);
93
+ resolversRef.current.delete(toast.id);
94
+ }
95
+ });
96
+ return [];
97
+ });
98
+ }, []);
99
+ const service = useMemo(
100
+ () => ({
101
+ info,
102
+ success,
103
+ warn,
104
+ error,
105
+ addAll,
106
+ clear,
107
+ remove
108
+ }),
109
+ [info, success, warn, error, addAll, clear, remove]
110
+ );
111
+ const value = useMemo(
112
+ () => ({ service, toasts }),
113
+ [service, toasts]
114
+ );
115
+ return /* @__PURE__ */ jsx(ToasterContext.Provider, { value, children });
116
+ }
117
+ function useToaster() {
118
+ const context = useContext(ToasterContext);
119
+ if (!context) {
120
+ throw new Error("useToaster must be used within a ToasterProvider");
121
+ }
122
+ return context.service;
123
+ }
124
+ function useToasts() {
125
+ const context = useContext(ToasterContext);
126
+ if (!context) {
127
+ throw new Error("useToasts must be used within a ToasterProvider");
128
+ }
129
+ return context.toasts;
130
+ }
131
+ function useToasterContext() {
132
+ const context = useContext(ToasterContext);
133
+ if (!context) {
134
+ throw new Error("useToasterContext must be used within a ToasterProvider");
135
+ }
136
+ return context;
137
+ }
138
+
139
+ // src/contexts/confirmation.context.tsx
140
+ import {
141
+ createContext as createContext2,
142
+ useContext as useContext2,
143
+ useCallback as useCallback2,
144
+ useState as useState2,
145
+ useRef as useRef2,
146
+ useMemo as useMemo2
147
+ } from "react";
148
+ import { jsx as jsx2 } from "react/jsx-runtime";
149
+ var ConfirmationContext = createContext2(null);
150
+ function generateId2() {
151
+ return `confirmation-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
152
+ }
153
+ function ConfirmationProvider({ children }) {
154
+ const [confirmation, setConfirmation] = useState2(null);
155
+ const resolverRef = useRef2(null);
156
+ const respond = useCallback2((status) => {
157
+ if (resolverRef.current) {
158
+ resolverRef.current(status);
159
+ resolverRef.current = null;
160
+ }
161
+ setConfirmation(null);
162
+ }, []);
163
+ const show = useCallback2(
164
+ (message, title, severity, options = {}) => {
165
+ if (resolverRef.current) {
166
+ resolverRef.current(Toaster.Status.dismiss);
167
+ }
168
+ const id = options.id?.toString() || generateId2();
169
+ const confirmationMessage = {
170
+ id,
171
+ message,
172
+ title,
173
+ severity,
174
+ options
175
+ };
176
+ setConfirmation(confirmationMessage);
177
+ return new Promise((resolve) => {
178
+ resolverRef.current = resolve;
179
+ });
180
+ },
181
+ []
182
+ );
183
+ const info = useCallback2(
184
+ (message, title, options) => show(message, title, "info", options),
185
+ [show]
186
+ );
187
+ const success = useCallback2(
188
+ (message, title, options) => show(message, title, "success", options),
189
+ [show]
190
+ );
191
+ const warn = useCallback2(
192
+ (message, title, options) => show(message, title, "warn", options),
193
+ [show]
194
+ );
195
+ const error = useCallback2(
196
+ (message, title, options) => show(message, title, "error", options),
197
+ [show]
198
+ );
199
+ const clear = useCallback2(
200
+ (status) => {
201
+ respond(status ?? Toaster.Status.dismiss);
202
+ },
203
+ [respond]
204
+ );
205
+ const service = useMemo2(
206
+ () => ({
207
+ info,
208
+ success,
209
+ warn,
210
+ error,
211
+ clear
212
+ }),
213
+ [info, success, warn, error, clear]
214
+ );
215
+ const value = useMemo2(
216
+ () => ({ service, confirmation, respond }),
217
+ [service, confirmation, respond]
218
+ );
219
+ return /* @__PURE__ */ jsx2(ConfirmationContext.Provider, { value, children });
220
+ }
221
+ function useConfirmation() {
222
+ const context = useContext2(ConfirmationContext);
223
+ if (!context) {
224
+ throw new Error("useConfirmation must be used within a ConfirmationProvider");
225
+ }
226
+ return context.service;
227
+ }
228
+ function useConfirmationState() {
229
+ const context = useContext2(ConfirmationContext);
230
+ if (!context) {
231
+ throw new Error("useConfirmationState must be used within a ConfirmationProvider");
232
+ }
233
+ return { confirmation: context.confirmation, respond: context.respond };
234
+ }
235
+ function useConfirmationContext() {
236
+ const context = useContext2(ConfirmationContext);
237
+ if (!context) {
238
+ throw new Error("useConfirmationContext must be used within a ConfirmationProvider");
239
+ }
240
+ return context;
241
+ }
242
+
243
+ // src/handlers/error.handler.ts
244
+ import { useCallback as useCallback3 } from "react";
245
+ var DEFAULT_ERROR_MESSAGES = {
246
+ 400: "AbpUi::DefaultErrorMessage400",
247
+ 401: "AbpUi::DefaultErrorMessage401",
248
+ 403: "AbpUi::DefaultErrorMessage403",
249
+ 404: "AbpUi::DefaultErrorMessage404",
250
+ 500: "AbpUi::DefaultErrorMessage500",
251
+ 503: "AbpUi::DefaultErrorMessage503"
252
+ };
253
+ function useErrorHandler(options = {}) {
254
+ const { navigate, loginPath = "/account/login" } = options;
255
+ const confirmation = useConfirmation();
256
+ const navigateToLogin = useCallback3(() => {
257
+ if (navigate) {
258
+ navigate(loginPath);
259
+ }
260
+ }, [navigate, loginPath]);
261
+ const showError = useCallback3(
262
+ async (message, title) => {
263
+ return confirmation.error(message, title || "AbpUi::Error");
264
+ },
265
+ [confirmation]
266
+ );
267
+ const handleError = useCallback3(
268
+ async (error) => {
269
+ if (error.status === 401) {
270
+ navigateToLogin();
271
+ return;
272
+ }
273
+ let message = error.error?.error?.message;
274
+ let title = "AbpUi::Error";
275
+ if (!message) {
276
+ message = DEFAULT_ERROR_MESSAGES[error.status] || "AbpUi::DefaultErrorMessage";
277
+ }
278
+ const validationErrors = error.error?.error?.validationErrors;
279
+ if (validationErrors && validationErrors.length > 0) {
280
+ message = validationErrors.map((e) => e.message).join("\n");
281
+ title = "AbpUi::ValidationError";
282
+ }
283
+ await showError(message, title);
284
+ },
285
+ [navigateToLogin, showError]
286
+ );
287
+ return {
288
+ handleError,
289
+ showError,
290
+ navigateToLogin
291
+ };
292
+ }
293
+ function createErrorInterceptor(errorHandler) {
294
+ return async (error) => {
295
+ if (isHttpErrorResponse(error)) {
296
+ await errorHandler.handleError(error);
297
+ }
298
+ return Promise.reject(error);
299
+ };
300
+ }
301
+ function isHttpErrorResponse(error) {
302
+ return typeof error === "object" && error !== null && "status" in error && typeof error.status === "number";
303
+ }
304
+
305
+ // src/components/toast/Toast.tsx
306
+ import { useEffect, useRef as useRef3, useMemo as useMemo3 } from "react";
307
+ import {
308
+ Toaster as ChakraToaster,
309
+ Portal,
310
+ Stack,
311
+ Toast,
312
+ createToaster,
313
+ Box,
314
+ Flex,
315
+ CloseButton
316
+ } from "@chakra-ui/react";
317
+ import { useLocalization } from "@abpjs/core";
318
+ import {
319
+ CheckCircle,
320
+ Info,
321
+ AlertTriangle,
322
+ XCircle
323
+ } from "lucide-react";
324
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
325
+ function SeverityIcon({ severity }) {
326
+ const iconProps = { size: 20 };
327
+ switch (severity) {
328
+ case "success":
329
+ return /* @__PURE__ */ jsx3(CheckCircle, { ...iconProps, color: "var(--chakra-colors-green-500)" });
330
+ case "info":
331
+ return /* @__PURE__ */ jsx3(Info, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
332
+ case "warn":
333
+ return /* @__PURE__ */ jsx3(AlertTriangle, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
334
+ case "error":
335
+ return /* @__PURE__ */ jsx3(XCircle, { ...iconProps, color: "var(--chakra-colors-red-500)" });
336
+ }
337
+ }
338
+ function getSeverityColorPalette(severity) {
339
+ switch (severity) {
340
+ case "success":
341
+ return "green";
342
+ case "info":
343
+ return "blue";
344
+ case "warn":
345
+ return "yellow";
346
+ case "error":
347
+ return "red";
348
+ }
349
+ }
350
+ function getSeverityBg(severity) {
351
+ switch (severity) {
352
+ case "success":
353
+ return "green.50";
354
+ case "info":
355
+ return "blue.50";
356
+ case "warn":
357
+ return "yellow.50";
358
+ case "error":
359
+ return "red.50";
360
+ }
361
+ }
362
+ function getSeverityBorderColor(severity) {
363
+ switch (severity) {
364
+ case "success":
365
+ return "green.200";
366
+ case "info":
367
+ return "blue.200";
368
+ case "warn":
369
+ return "yellow.200";
370
+ case "error":
371
+ return "red.200";
372
+ }
373
+ }
374
+ function mapSeverityToType(severity) {
375
+ switch (severity) {
376
+ case "success":
377
+ return "success";
378
+ case "info":
379
+ return "info";
380
+ case "warn":
381
+ return "warning";
382
+ case "error":
383
+ return "error";
384
+ }
385
+ }
386
+ function getPlacement(position) {
387
+ switch (position) {
388
+ case "top":
389
+ return "top";
390
+ case "top-left":
391
+ return "top-start";
392
+ // Logical: start = left in LTR, right in RTL
393
+ case "top-right":
394
+ return "top-end";
395
+ // Logical: end = right in LTR, left in RTL
396
+ case "bottom":
397
+ return "bottom";
398
+ case "bottom-left":
399
+ return "bottom-start";
400
+ case "bottom-right":
401
+ default:
402
+ return "bottom-end";
403
+ }
404
+ }
405
+ var toasterCache = /* @__PURE__ */ new Map();
406
+ function getToaster(placement) {
407
+ if (!toasterCache.has(placement)) {
408
+ toasterCache.set(placement, createToaster({
409
+ placement,
410
+ pauseOnPageIdle: true
411
+ }));
412
+ }
413
+ return toasterCache.get(placement);
414
+ }
415
+ function ToastContainer({ position = "bottom-right" }) {
416
+ const { toasts, service } = useToasterContext();
417
+ const { t } = useLocalization();
418
+ const displayedToastsRef = useRef3(/* @__PURE__ */ new Set());
419
+ const placement = useMemo3(() => getPlacement(position), [position]);
420
+ const toaster = useMemo3(() => getToaster(placement), [placement]);
421
+ useEffect(() => {
422
+ const newToasts = toasts.filter((toast) => !displayedToastsRef.current.has(toast.id));
423
+ newToasts.forEach((toast) => {
424
+ displayedToastsRef.current.add(toast.id);
425
+ const localizedMessage = t(
426
+ toast.message,
427
+ ...toast.messageLocalizationParams || []
428
+ );
429
+ const localizedTitle = toast.title ? t(toast.title, ...toast.titleLocalizationParams || []) : void 0;
430
+ requestAnimationFrame(() => {
431
+ toaster.create({
432
+ id: toast.id,
433
+ title: localizedTitle,
434
+ description: localizedMessage,
435
+ type: mapSeverityToType(toast.severity),
436
+ duration: toast.sticky ? void 0 : toast.life || 5e3,
437
+ meta: {
438
+ closable: toast.closable !== false,
439
+ severity: toast.severity
440
+ },
441
+ onStatusChange: (details) => {
442
+ if (details.status === "unmounted") {
443
+ displayedToastsRef.current.delete(toast.id);
444
+ service.remove(toast.id);
445
+ }
446
+ }
447
+ });
448
+ });
449
+ });
450
+ }, [toasts, t, service, toaster]);
451
+ return /* @__PURE__ */ jsx3(Portal, { children: /* @__PURE__ */ jsx3(ChakraToaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => {
452
+ const severity = toast.meta?.severity || "info";
453
+ const closable = toast.meta?.closable !== false;
454
+ return /* @__PURE__ */ jsx3(
455
+ Toast.Root,
456
+ {
457
+ bg: getSeverityBg(severity),
458
+ borderWidth: "1px",
459
+ borderColor: getSeverityBorderColor(severity),
460
+ borderRadius: "lg",
461
+ boxShadow: "lg",
462
+ width: { md: "sm" },
463
+ children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", gap: 3, p: 4, children: [
464
+ /* @__PURE__ */ jsx3(Box, { flexShrink: 0, pt: "2px", children: /* @__PURE__ */ jsx3(SeverityIcon, { severity }) }),
465
+ /* @__PURE__ */ jsxs(Stack, { gap: 1, flex: 1, children: [
466
+ toast.title && /* @__PURE__ */ jsx3(Toast.Title, { fontWeight: "bold", fontSize: "sm", color: "fg", children: toast.title }),
467
+ toast.description && /* @__PURE__ */ jsx3(Toast.Description, { fontSize: "sm", color: "gray.700", children: toast.description })
468
+ ] }),
469
+ closable && /* @__PURE__ */ jsx3(Toast.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx3(CloseButton, { size: "sm" }) })
470
+ ] })
471
+ }
472
+ );
473
+ } }) });
474
+ }
475
+
476
+ // src/components/confirmation/Confirmation.tsx
477
+ import { useRef as useRef4 } from "react";
478
+ import {
479
+ Dialog,
480
+ Portal as Portal2,
481
+ Button,
482
+ Flex as Flex2,
483
+ Text
484
+ } from "@chakra-ui/react";
485
+ import { useLocalization as useLocalization2 } from "@abpjs/core";
486
+ import {
487
+ CheckCircle as CheckCircle2,
488
+ Info as Info2,
489
+ AlertTriangle as AlertTriangle2,
490
+ XCircle as XCircle2
491
+ } from "lucide-react";
492
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
493
+ function SeverityIcon2({ severity }) {
494
+ const iconProps = { size: 24 };
495
+ switch (severity) {
496
+ case "success":
497
+ return /* @__PURE__ */ jsx4(CheckCircle2, { ...iconProps, color: "var(--chakra-colors-green-500)" });
498
+ case "info":
499
+ return /* @__PURE__ */ jsx4(Info2, { ...iconProps, color: "var(--chakra-colors-blue-500)" });
500
+ case "warn":
501
+ return /* @__PURE__ */ jsx4(AlertTriangle2, { ...iconProps, color: "var(--chakra-colors-yellow-500)" });
502
+ case "error":
503
+ return /* @__PURE__ */ jsx4(XCircle2, { ...iconProps, color: "var(--chakra-colors-red-500)" });
504
+ }
505
+ }
506
+ function getSeverityColorPalette2(severity) {
507
+ switch (severity) {
508
+ case "success":
509
+ return "green";
510
+ case "info":
511
+ return "blue";
512
+ case "warn":
513
+ return "yellow";
514
+ case "error":
515
+ return "red";
516
+ }
517
+ }
518
+ function ConfirmationDialog({ className }) {
519
+ const { confirmation, respond } = useConfirmationState();
520
+ const { t } = useLocalization2();
521
+ const cancelRef = useRef4(null);
522
+ if (!confirmation) {
523
+ return null;
524
+ }
525
+ const { message, title, severity, options } = confirmation;
526
+ const localizedMessage = t(
527
+ message,
528
+ ...options.messageLocalizationParams || []
529
+ );
530
+ const localizedTitle = title ? t(title, ...options.titleLocalizationParams || []) : void 0;
531
+ const yesCopy = options.yesCopy ? t(options.yesCopy) : t("AbpUi::Yes");
532
+ const cancelCopy = options.cancelCopy ? t(options.cancelCopy) : t("AbpUi::Cancel");
533
+ const handleConfirm = () => {
534
+ respond(Toaster.Status.confirm);
535
+ };
536
+ const handleCancel = () => {
537
+ respond(Toaster.Status.reject);
538
+ };
539
+ const handleDismiss = () => {
540
+ respond(Toaster.Status.dismiss);
541
+ };
542
+ const handleOpenChange = (details) => {
543
+ if (!details.open) {
544
+ handleDismiss();
545
+ }
546
+ };
547
+ return /* @__PURE__ */ jsx4(
548
+ Dialog.Root,
549
+ {
550
+ open: true,
551
+ onOpenChange: handleOpenChange,
552
+ role: "alertdialog",
553
+ placement: "center",
554
+ initialFocusEl: () => cancelRef.current,
555
+ children: /* @__PURE__ */ jsxs2(Portal2, { children: [
556
+ /* @__PURE__ */ jsx4(Dialog.Backdrop, {}),
557
+ /* @__PURE__ */ jsx4(Dialog.Positioner, { children: /* @__PURE__ */ jsxs2(Dialog.Content, { className, maxWidth: "md", children: [
558
+ /* @__PURE__ */ jsx4(Dialog.Header, { children: /* @__PURE__ */ jsxs2(Flex2, { align: "center", gap: 3, children: [
559
+ /* @__PURE__ */ jsx4(SeverityIcon2, { severity }),
560
+ localizedTitle && /* @__PURE__ */ jsx4(Dialog.Title, { children: /* @__PURE__ */ jsx4(Text, { fontWeight: "bold", fontSize: "lg", children: localizedTitle }) })
561
+ ] }) }),
562
+ /* @__PURE__ */ jsx4(Dialog.Body, { children: /* @__PURE__ */ jsx4(Text, { color: "gray.600", children: localizedMessage }) }),
563
+ /* @__PURE__ */ jsx4(Dialog.Footer, { children: /* @__PURE__ */ jsxs2(Flex2, { gap: 3, children: [
564
+ !options.hideCancelBtn && /* @__PURE__ */ jsx4(
565
+ Button,
566
+ {
567
+ ref: cancelRef,
568
+ variant: "ghost",
569
+ onClick: handleCancel,
570
+ children: cancelCopy
571
+ }
572
+ ),
573
+ !options.hideYesBtn && /* @__PURE__ */ jsx4(
574
+ Button,
575
+ {
576
+ colorPalette: getSeverityColorPalette2(severity),
577
+ onClick: handleConfirm,
578
+ children: yesCopy
579
+ }
580
+ )
581
+ ] }) })
582
+ ] }) })
583
+ ] })
584
+ }
585
+ );
586
+ }
587
+
588
+ // src/components/modal/Modal.tsx
589
+ import {
590
+ Dialog as Dialog2,
591
+ Portal as Portal3,
592
+ Box as Box2,
593
+ Flex as Flex3,
594
+ Text as Text2,
595
+ Separator,
596
+ CloseButton as CloseButton2
597
+ } from "@chakra-ui/react";
598
+ import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
599
+ function getSizeWidth(size) {
600
+ switch (size) {
601
+ case "sm":
602
+ return "sm";
603
+ case "md":
604
+ return "md";
605
+ case "lg":
606
+ return "lg";
607
+ case "xl":
608
+ return "xl";
609
+ case "full":
610
+ return "full";
611
+ default:
612
+ return "md";
613
+ }
614
+ }
615
+ function Modal({
616
+ visible,
617
+ onVisibleChange,
618
+ size = "md",
619
+ centered = true,
620
+ modalClass,
621
+ header,
622
+ children,
623
+ footer,
624
+ showCloseButton = true,
625
+ closeOnOverlayClick = true,
626
+ closeOnEscape = true,
627
+ scrollBehavior = "inside",
628
+ motionPreset = "scale",
629
+ trapFocus = true,
630
+ preventScroll = true
631
+ }) {
632
+ const handleOpenChange = (details) => {
633
+ onVisibleChange?.(details.open);
634
+ };
635
+ return /* @__PURE__ */ jsx5(
636
+ Dialog2.Root,
637
+ {
638
+ open: visible,
639
+ onOpenChange: handleOpenChange,
640
+ placement: centered ? "center" : "top",
641
+ closeOnInteractOutside: closeOnOverlayClick,
642
+ closeOnEscape,
643
+ scrollBehavior,
644
+ motionPreset,
645
+ trapFocus,
646
+ preventScroll,
647
+ children: /* @__PURE__ */ jsxs3(Portal3, { children: [
648
+ /* @__PURE__ */ jsx5(Dialog2.Backdrop, {}),
649
+ /* @__PURE__ */ jsx5(Dialog2.Positioner, { children: /* @__PURE__ */ jsxs3(
650
+ Dialog2.Content,
651
+ {
652
+ className: modalClass,
653
+ width: getSizeWidth(size),
654
+ maxWidth: size === "full" ? "100vw" : void 0,
655
+ maxHeight: size === "full" ? "100vh" : void 0,
656
+ children: [
657
+ (header || showCloseButton) && /* @__PURE__ */ jsxs3(Fragment, { children: [
658
+ /* @__PURE__ */ jsx5(Dialog2.Header, { children: /* @__PURE__ */ jsxs3(Flex3, { justify: "space-between", align: "center", width: "100%", children: [
659
+ header && /* @__PURE__ */ jsx5(Dialog2.Title, { children: /* @__PURE__ */ jsx5(Text2, { fontWeight: "bold", fontSize: "lg", children: header }) }),
660
+ showCloseButton && /* @__PURE__ */ jsx5(Dialog2.CloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx5(CloseButton2, { size: "sm" }) })
661
+ ] }) }),
662
+ /* @__PURE__ */ jsx5(Separator, {})
663
+ ] }),
664
+ children && /* @__PURE__ */ jsx5(Dialog2.Body, { py: 4, children }),
665
+ footer && /* @__PURE__ */ jsxs3(Fragment, { children: [
666
+ /* @__PURE__ */ jsx5(Separator, {}),
667
+ /* @__PURE__ */ jsx5(Dialog2.Footer, { children: /* @__PURE__ */ jsx5(Flex3, { gap: 3, justify: "flex-end", w: "100%", children: footer }) })
668
+ ] })
669
+ ]
670
+ }
671
+ ) })
672
+ ] })
673
+ }
674
+ );
675
+ }
676
+ function AbpModalHeader({ children, className }) {
677
+ return /* @__PURE__ */ jsx5(Text2, { fontWeight: "bold", fontSize: "lg", className, children });
678
+ }
679
+ function AbpModalBody({ children, className }) {
680
+ return /* @__PURE__ */ jsx5(Box2, { color: "gray.600", className, children });
681
+ }
682
+ function AbpModalFooter({ children, className }) {
683
+ return /* @__PURE__ */ jsx5(Flex3, { gap: 3, justify: "flex-end", className, children });
684
+ }
685
+
686
+ // src/components/ui/Alert.tsx
687
+ import { Alert as ChakraAlert } from "@chakra-ui/react";
688
+ import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
689
+ function Alert({
690
+ status = "info",
691
+ children,
692
+ title,
693
+ description,
694
+ showIcon = true,
695
+ className,
696
+ mb,
697
+ borderRadius = "md"
698
+ }) {
699
+ return /* @__PURE__ */ jsxs4(
700
+ ChakraAlert.Root,
701
+ {
702
+ status,
703
+ className,
704
+ mb,
705
+ borderRadius,
706
+ children: [
707
+ showIcon && /* @__PURE__ */ jsx6(ChakraAlert.Indicator, {}),
708
+ title ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
709
+ /* @__PURE__ */ jsx6(ChakraAlert.Title, { children: title }),
710
+ (description || children) && /* @__PURE__ */ jsx6(ChakraAlert.Description, { children: description || children })
711
+ ] }) : /* @__PURE__ */ jsx6(ChakraAlert.Title, { children })
712
+ ]
713
+ }
714
+ );
715
+ }
716
+
717
+ // src/components/ui/Button.tsx
718
+ import { forwardRef } from "react";
719
+ import { Button as ChakraButton } from "@chakra-ui/react";
720
+ import { jsx as jsx7 } from "react/jsx-runtime";
721
+ var Button2 = forwardRef(
722
+ function Button3({
723
+ children,
724
+ type = "button",
725
+ variant = "solid",
726
+ colorPalette = "gray",
727
+ size = "md",
728
+ disabled = false,
729
+ loading = false,
730
+ loadingText,
731
+ onClick,
732
+ className,
733
+ width,
734
+ mr,
735
+ ml
736
+ }, ref) {
737
+ return /* @__PURE__ */ jsx7(
738
+ ChakraButton,
739
+ {
740
+ ref,
741
+ type,
742
+ variant,
743
+ colorPalette,
744
+ size,
745
+ disabled,
746
+ loading,
747
+ loadingText,
748
+ onClick,
749
+ className,
750
+ width,
751
+ mr,
752
+ ml,
753
+ children
754
+ }
755
+ );
756
+ }
757
+ );
758
+
759
+ // src/components/ui/Checkbox.tsx
760
+ import { forwardRef as forwardRef2 } from "react";
761
+ import { Checkbox as ChakraCheckbox } from "@chakra-ui/react";
762
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
763
+ var Checkbox = forwardRef2(
764
+ function Checkbox2({
765
+ children,
766
+ checked,
767
+ defaultChecked,
768
+ disabled = false,
769
+ invalid = false,
770
+ required = false,
771
+ readOnly = false,
772
+ colorPalette = "blue",
773
+ size = "md",
774
+ id,
775
+ name,
776
+ value,
777
+ onChange,
778
+ className
779
+ }, ref) {
780
+ return /* @__PURE__ */ jsxs5(
781
+ ChakraCheckbox.Root,
782
+ {
783
+ checked,
784
+ defaultChecked,
785
+ disabled,
786
+ invalid,
787
+ required,
788
+ readOnly,
789
+ colorPalette,
790
+ size,
791
+ className,
792
+ children: [
793
+ /* @__PURE__ */ jsx8(
794
+ ChakraCheckbox.HiddenInput,
795
+ {
796
+ ref,
797
+ id,
798
+ name,
799
+ value,
800
+ onChange
801
+ }
802
+ ),
803
+ /* @__PURE__ */ jsx8(ChakraCheckbox.Control, {}),
804
+ children && /* @__PURE__ */ jsx8(ChakraCheckbox.Label, { children })
805
+ ]
806
+ }
807
+ );
808
+ }
809
+ );
810
+
811
+ // src/components/ui/FormField.tsx
812
+ import { Field } from "@chakra-ui/react";
813
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
814
+ function FormField({
815
+ label,
816
+ invalid = false,
817
+ required = false,
818
+ disabled = false,
819
+ errorText,
820
+ helperText,
821
+ children,
822
+ htmlFor,
823
+ className
824
+ }) {
825
+ return /* @__PURE__ */ jsxs6(Field.Root, { invalid, disabled, className, children: [
826
+ label && /* @__PURE__ */ jsxs6(Field.Label, { htmlFor, children: [
827
+ label,
828
+ required && /* @__PURE__ */ jsx9(Field.RequiredIndicator, {})
829
+ ] }),
830
+ children,
831
+ helperText && !invalid && /* @__PURE__ */ jsx9(Field.HelperText, { children: helperText }),
832
+ invalid && errorText && /* @__PURE__ */ jsx9(Field.ErrorText, { children: errorText })
833
+ ] });
834
+ }
835
+
836
+ // src/providers/ThemeSharedProvider.tsx
837
+ import { ChakraProvider, LocaleProvider } from "@chakra-ui/react";
838
+
839
+ // src/theme/index.ts
840
+ import { createSystem, defaultConfig, defineConfig } from "@chakra-ui/react";
841
+ var colors = {
842
+ brand: {
843
+ 50: { value: "#e3f2fd" },
844
+ 100: { value: "#bbdefb" },
845
+ 200: { value: "#90caf9" },
846
+ 300: { value: "#64b5f6" },
847
+ 400: { value: "#42a5f5" },
848
+ 500: { value: "#2196f3" },
849
+ 600: { value: "#1e88e5" },
850
+ 700: { value: "#1976d2" },
851
+ 800: { value: "#1565c0" },
852
+ 900: { value: "#0d47a1" },
853
+ 950: { value: "#082f5e" }
854
+ },
855
+ success: {
856
+ 50: { value: "#e8f5e9" },
857
+ 100: { value: "#c8e6c9" },
858
+ 200: { value: "#a5d6a7" },
859
+ 300: { value: "#81c784" },
860
+ 400: { value: "#66bb6a" },
861
+ 500: { value: "#4caf50" },
862
+ 600: { value: "#43a047" },
863
+ 700: { value: "#388e3c" },
864
+ 800: { value: "#2e7d32" },
865
+ 900: { value: "#1b5e20" },
866
+ 950: { value: "#0d3010" }
867
+ },
868
+ warning: {
869
+ 50: { value: "#fff8e1" },
870
+ 100: { value: "#ffecb3" },
871
+ 200: { value: "#ffe082" },
872
+ 300: { value: "#ffd54f" },
873
+ 400: { value: "#ffca28" },
874
+ 500: { value: "#ffc107" },
875
+ 600: { value: "#ffb300" },
876
+ 700: { value: "#ffa000" },
877
+ 800: { value: "#ff8f00" },
878
+ 900: { value: "#ff6f00" },
879
+ 950: { value: "#cc5900" }
880
+ },
881
+ error: {
882
+ 50: { value: "#ffebee" },
883
+ 100: { value: "#ffcdd2" },
884
+ 200: { value: "#ef9a9a" },
885
+ 300: { value: "#e57373" },
886
+ 400: { value: "#ef5350" },
887
+ 500: { value: "#f44336" },
888
+ 600: { value: "#e53935" },
889
+ 700: { value: "#d32f2f" },
890
+ 800: { value: "#c62828" },
891
+ 900: { value: "#b71c1c" },
892
+ 950: { value: "#7f1212" }
893
+ }
894
+ };
895
+ var semanticTokens = {
896
+ // colors: {
897
+ // // Background colors
898
+ // bg: {
899
+ // DEFAULT: {
900
+ // value: { _light: '{colors.white}', _dark: '#121212' },
901
+ // },
902
+ // subtle: {
903
+ // value: { _light: '{colors.gray.50}', _dark: '#1a1a1a' },
904
+ // },
905
+ // muted: {
906
+ // value: { _light: '{colors.gray.100}', _dark: '#2d2d2d' },
907
+ // },
908
+ // emphasized: {
909
+ // value: { _light: '{colors.gray.200}', _dark: '#3d3d3d' },
910
+ // },
911
+ // inverted: {
912
+ // value: { _light: '{colors.gray.900}', _dark: '{colors.white}' },
913
+ // },
914
+ // },
915
+ // // Foreground (text) colors
916
+ // fg: {
917
+ // DEFAULT: {
918
+ // value: { _light: '{colors.gray.900}', _dark: '#e5e5e5' },
919
+ // },
920
+ // muted: {
921
+ // value: { _light: '{colors.gray.600}', _dark: '#a1a1a1' },
922
+ // },
923
+ // subtle: {
924
+ // value: { _light: '{colors.gray.500}', _dark: '#737373' },
925
+ // },
926
+ // inverted: {
927
+ // value: { _light: '{colors.white}', _dark: '{colors.gray.900}' },
928
+ // },
929
+ // },
930
+ // // Border colors
931
+ // border: {
932
+ // DEFAULT: {
933
+ // value: { _light: '{colors.gray.200}', _dark: '#3d3d3d' },
934
+ // },
935
+ // muted: {
936
+ // value: { _light: '{colors.gray.100}', _dark: '#2d2d2d' },
937
+ // },
938
+ // subtle: {
939
+ // value: { _light: '{colors.gray.50}', _dark: '#1a1a1a' },
940
+ // },
941
+ // emphasized: {
942
+ // value: { _light: '{colors.gray.300}', _dark: '#525252' },
943
+ // },
944
+ // },
945
+ // // Brand colors with light/dark support
946
+ // brand: {
947
+ // solid: {
948
+ // value: { _light: '{colors.brand.500}', _dark: '{colors.brand.400}' },
949
+ // },
950
+ // contrast: {
951
+ // value: { _light: '{colors.white}', _dark: '{colors.white}' },
952
+ // },
953
+ // fg: {
954
+ // value: { _light: '{colors.brand.700}', _dark: '{colors.brand.300}' },
955
+ // },
956
+ // muted: {
957
+ // value: { _light: '{colors.brand.100}', _dark: '{colors.brand.900}' },
958
+ // },
959
+ // subtle: {
960
+ // value: { _light: '{colors.brand.50}', _dark: '{colors.brand.950}' },
961
+ // },
962
+ // emphasized: {
963
+ // value: { _light: '{colors.brand.300}', _dark: '{colors.brand.600}' },
964
+ // },
965
+ // focusRing: {
966
+ // value: { _light: '{colors.brand.500}', _dark: '{colors.brand.400}' },
967
+ // },
968
+ // },
969
+ // // Success colors with light/dark support
970
+ // success: {
971
+ // solid: {
972
+ // value: { _light: '{colors.success.500}', _dark: '{colors.success.400}' },
973
+ // },
974
+ // contrast: {
975
+ // value: { _light: '{colors.white}', _dark: '{colors.white}' },
976
+ // },
977
+ // fg: {
978
+ // value: { _light: '{colors.success.700}', _dark: '{colors.success.300}' },
979
+ // },
980
+ // muted: {
981
+ // value: { _light: '{colors.success.100}', _dark: '{colors.success.900}' },
982
+ // },
983
+ // subtle: {
984
+ // value: { _light: '{colors.success.50}', _dark: '{colors.success.950}' },
985
+ // },
986
+ // emphasized: {
987
+ // value: { _light: '{colors.success.300}', _dark: '{colors.success.600}' },
988
+ // },
989
+ // focusRing: {
990
+ // value: { _light: '{colors.success.500}', _dark: '{colors.success.400}' },
991
+ // },
992
+ // },
993
+ // // Warning colors with light/dark support
994
+ // warning: {
995
+ // solid: {
996
+ // value: { _light: '{colors.warning.500}', _dark: '{colors.warning.400}' },
997
+ // },
998
+ // contrast: {
999
+ // value: { _light: '{colors.black}', _dark: '{colors.black}' },
1000
+ // },
1001
+ // fg: {
1002
+ // value: { _light: '{colors.warning.700}', _dark: '{colors.warning.300}' },
1003
+ // },
1004
+ // muted: {
1005
+ // value: { _light: '{colors.warning.100}', _dark: '{colors.warning.900}' },
1006
+ // },
1007
+ // subtle: {
1008
+ // value: { _light: '{colors.warning.50}', _dark: '{colors.warning.950}' },
1009
+ // },
1010
+ // emphasized: {
1011
+ // value: { _light: '{colors.warning.300}', _dark: '{colors.warning.600}' },
1012
+ // },
1013
+ // focusRing: {
1014
+ // value: { _light: '{colors.warning.500}', _dark: '{colors.warning.400}' },
1015
+ // },
1016
+ // },
1017
+ // // Error colors with light/dark support
1018
+ // error: {
1019
+ // solid: {
1020
+ // value: { _light: '{colors.error.500}', _dark: '{colors.error.400}' },
1021
+ // },
1022
+ // contrast: {
1023
+ // value: { _light: '{colors.white}', _dark: '{colors.white}' },
1024
+ // },
1025
+ // fg: {
1026
+ // value: { _light: '{colors.error.700}', _dark: '{colors.error.300}' },
1027
+ // },
1028
+ // muted: {
1029
+ // value: { _light: '{colors.error.100}', _dark: '{colors.error.900}' },
1030
+ // },
1031
+ // subtle: {
1032
+ // value: { _light: '{colors.error.50}', _dark: '{colors.error.950}' },
1033
+ // },
1034
+ // emphasized: {
1035
+ // value: { _light: '{colors.error.300}', _dark: '{colors.error.600}' },
1036
+ // },
1037
+ // focusRing: {
1038
+ // value: { _light: '{colors.error.500}', _dark: '{colors.error.400}' },
1039
+ // },
1040
+ // },
1041
+ // },
1042
+ };
1043
+ var defaultAbpConfig = defineConfig({
1044
+ theme: {
1045
+ tokens: {
1046
+ colors,
1047
+ fonts: {
1048
+ heading: { value: "system-ui, sans-serif" },
1049
+ body: { value: "system-ui, sans-serif" }
1050
+ }
1051
+ },
1052
+ semanticTokens
1053
+ },
1054
+ // Global styles
1055
+ globalCss: {
1056
+ "html, body": {
1057
+ colorPalette: "brand",
1058
+ bg: "bg",
1059
+ color: "fg"
1060
+ }
1061
+ }
1062
+ });
1063
+ function createAbpSystem(overrides) {
1064
+ if (overrides) {
1065
+ return createSystem(defaultConfig, defaultAbpConfig, overrides);
1066
+ }
1067
+ return createSystem(defaultConfig, defaultAbpConfig);
1068
+ }
1069
+ var abpSystem = createAbpSystem();
1070
+
1071
+ // src/components/ui/color-mode.tsx
1072
+ import { ClientOnly, IconButton, Skeleton, Span } from "@chakra-ui/react";
1073
+ import { ThemeProvider, useTheme } from "next-themes";
1074
+ import * as React7 from "react";
1075
+ import { Moon, Sun } from "lucide-react";
1076
+ import { jsx as jsx10 } from "react/jsx-runtime";
1077
+ function ColorModeProvider(props) {
1078
+ return /* @__PURE__ */ jsx10(ThemeProvider, { attribute: "class", disableTransitionOnChange: true, ...props });
1079
+ }
1080
+ function useColorMode() {
1081
+ const { resolvedTheme, setTheme, forcedTheme } = useTheme();
1082
+ const colorMode = forcedTheme || resolvedTheme;
1083
+ const toggleColorMode = () => {
1084
+ setTheme(resolvedTheme === "dark" ? "light" : "dark");
1085
+ };
1086
+ return {
1087
+ colorMode,
1088
+ setColorMode: setTheme,
1089
+ toggleColorMode
1090
+ };
1091
+ }
1092
+ function ColorModeIcon() {
1093
+ const { colorMode } = useColorMode();
1094
+ return colorMode === "dark" ? /* @__PURE__ */ jsx10(Moon, {}) : /* @__PURE__ */ jsx10(Sun, {});
1095
+ }
1096
+ var ColorModeButton = React7.forwardRef(function ColorModeButton2(props, ref) {
1097
+ const { toggleColorMode } = useColorMode();
1098
+ return /* @__PURE__ */ jsx10(ClientOnly, { fallback: /* @__PURE__ */ jsx10(Skeleton, { boxSize: "9" }), children: /* @__PURE__ */ jsx10(
1099
+ IconButton,
1100
+ {
1101
+ onClick: toggleColorMode,
1102
+ variant: "ghost",
1103
+ "aria-label": "Toggle color mode",
1104
+ size: "sm",
1105
+ ref,
1106
+ ...props,
1107
+ css: {
1108
+ _icon: {
1109
+ width: "5",
1110
+ height: "5"
1111
+ }
1112
+ },
1113
+ children: /* @__PURE__ */ jsx10(ColorModeIcon, {})
1114
+ }
1115
+ ) });
1116
+ });
1117
+ var LightMode = React7.forwardRef(
1118
+ function LightMode2(props, ref) {
1119
+ return /* @__PURE__ */ jsx10(
1120
+ Span,
1121
+ {
1122
+ color: "fg",
1123
+ display: "contents",
1124
+ className: "chakra-theme light",
1125
+ colorPalette: "gray",
1126
+ colorScheme: "light",
1127
+ ref,
1128
+ ...props
1129
+ }
1130
+ );
1131
+ }
1132
+ );
1133
+ var DarkMode = React7.forwardRef(
1134
+ function DarkMode2(props, ref) {
1135
+ return /* @__PURE__ */ jsx10(
1136
+ Span,
1137
+ {
1138
+ color: "fg",
1139
+ display: "contents",
1140
+ className: "chakra-theme dark",
1141
+ colorPalette: "gray",
1142
+ colorScheme: "dark",
1143
+ ref,
1144
+ ...props
1145
+ }
1146
+ );
1147
+ }
1148
+ );
1149
+
1150
+ // src/providers/ThemeSharedProvider.tsx
1151
+ import { useDirection } from "@abpjs/core";
1152
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
1153
+ function ThemeSharedProvider({
1154
+ children,
1155
+ renderToasts = true,
1156
+ renderConfirmation = true,
1157
+ themeOverrides,
1158
+ toastPosition = "bottom-right",
1159
+ enableColorMode = false,
1160
+ defaultColorMode = "light",
1161
+ locale = "en-US"
1162
+ }) {
1163
+ const system = themeOverrides ? createAbpSystem(themeOverrides) : abpSystem;
1164
+ const { endSide } = useDirection();
1165
+ toastPosition = `bottom-${endSide}`;
1166
+ const content = /* @__PURE__ */ jsx11(ToasterProvider, { children: /* @__PURE__ */ jsxs7(ConfirmationProvider, { children: [
1167
+ children,
1168
+ renderToasts && /* @__PURE__ */ jsx11(ToastContainer, { position: toastPosition }),
1169
+ renderConfirmation && /* @__PURE__ */ jsx11(ConfirmationDialog, {})
1170
+ ] }) });
1171
+ const colorModeProps = enableColorMode ? { defaultTheme: defaultColorMode } : { forcedTheme: "light" };
1172
+ return /* @__PURE__ */ jsx11(ChakraProvider, { value: system, children: /* @__PURE__ */ jsx11(LocaleProvider, { locale, children: /* @__PURE__ */ jsx11(ColorModeProvider, { ...colorModeProps, children: content }) }) });
1173
+ }
1174
+
1175
+ // src/utils/styles.ts
1176
+ var THEME_SHARED_STYLES = `
1177
+ /* Form validation styling */
1178
+ .is-invalid {
1179
+ border-color: var(--chakra-colors-red-500) !important;
1180
+ }
1181
+
1182
+ .invalid-feedback {
1183
+ display: block;
1184
+ width: 100%;
1185
+ margin-top: var(--chakra-space-1);
1186
+ font-size: var(--chakra-fontSizes-sm);
1187
+ color: var(--chakra-colors-red-500);
1188
+ }
1189
+
1190
+ /* Pointer cursor utility */
1191
+ .pointer {
1192
+ cursor: pointer;
1193
+ }
1194
+
1195
+ /* Fade animations */
1196
+ @keyframes fadeInTop {
1197
+ from {
1198
+ opacity: 0;
1199
+ transform: translateY(-20px);
1200
+ }
1201
+ to {
1202
+ opacity: 1;
1203
+ transform: translateY(0);
1204
+ }
1205
+ }
1206
+
1207
+ @keyframes fadeOutTop {
1208
+ from {
1209
+ opacity: 1;
1210
+ transform: translateY(0);
1211
+ }
1212
+ to {
1213
+ opacity: 0;
1214
+ transform: translateY(-20px);
1215
+ }
1216
+ }
1217
+
1218
+ .fade-in-top {
1219
+ animation: fadeInTop 0.3s ease-out forwards;
1220
+ }
1221
+
1222
+ .fade-out-top {
1223
+ animation: fadeOutTop 0.3s ease-out forwards;
1224
+ }
1225
+ `;
1226
+ function injectThemeSharedStyles() {
1227
+ if (typeof document === "undefined") {
1228
+ return void 0;
1229
+ }
1230
+ const styleId = "abp-theme-shared-styles";
1231
+ if (document.getElementById(styleId)) {
1232
+ return void 0;
1233
+ }
1234
+ const styleElement = document.createElement("style");
1235
+ styleElement.id = styleId;
1236
+ styleElement.textContent = THEME_SHARED_STYLES;
1237
+ document.head.appendChild(styleElement);
1238
+ return () => {
1239
+ const element = document.getElementById(styleId);
1240
+ if (element) {
1241
+ element.remove();
1242
+ }
1243
+ };
1244
+ }
1245
+ export {
1246
+ AbpModalBody,
1247
+ AbpModalFooter,
1248
+ AbpModalHeader,
1249
+ Alert,
1250
+ Button2 as Button,
1251
+ Dialog2 as ChakraDialog,
1252
+ Checkbox,
1253
+ ConfirmationDialog,
1254
+ ConfirmationProvider,
1255
+ FormField,
1256
+ Modal,
1257
+ AbpModalBody as ModalBody,
1258
+ AbpModalFooter as ModalFooter,
1259
+ AbpModalHeader as ModalHeader,
1260
+ THEME_SHARED_STYLES,
1261
+ ThemeSharedProvider,
1262
+ ToastContainer,
1263
+ Toaster,
1264
+ ToasterProvider,
1265
+ abpSystem,
1266
+ createAbpSystem,
1267
+ createErrorInterceptor,
1268
+ defaultAbpConfig,
1269
+ defineConfig,
1270
+ getSeverityBg,
1271
+ getSeverityBorderColor,
1272
+ getSeverityColorPalette as getSeverityColorScheme,
1273
+ injectThemeSharedStyles,
1274
+ useConfirmation,
1275
+ useConfirmationContext,
1276
+ useConfirmationState,
1277
+ useErrorHandler,
1278
+ useToaster,
1279
+ useToasterContext,
1280
+ useToasts
1281
+ };