xertica-ui 2.6.0 → 2.7.0

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 (100) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/components/assistant/xertica-assistant/use-assistant.ts +5 -6
  4. package/{templates/src/features/auth/ui → components/blocks/auth}/AuthPageShell.tsx +8 -3
  5. package/components/blocks/auth/PasswordStrengthMeter.tsx +41 -0
  6. package/components/blocks/auth/SocialLoginButtons.tsx +95 -0
  7. package/components/blocks/auth/index.ts +11 -0
  8. package/components/blocks/auth/usePasswordStrength.ts +13 -0
  9. package/components/blocks/index.ts +1 -0
  10. package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +45 -139
  11. package/components/pages/login-page/LoginPage.tsx +52 -145
  12. package/components/pages/reset-password-page/ResetPasswordPage.tsx +79 -169
  13. package/components/pages/verify-email-page/VerifyEmailPage.tsx +48 -150
  14. package/dist/AssistantChart-CImCNLfD.cjs +3551 -0
  15. package/dist/AssistantChart-DfdIfmQr.js +3383 -0
  16. package/dist/FeatureCard-BhpfmPPx.js +485 -0
  17. package/dist/FeatureCard-D-5yS_OD.cjs +497 -0
  18. package/dist/ImageWithFallback-CfkAkctC.cjs +122 -0
  19. package/dist/ImageWithFallback-bw-CxxDc.js +98 -0
  20. package/dist/LanguageContext-CX_zdxre.js +1912 -0
  21. package/dist/LanguageContext-CjhSSqJT.cjs +1917 -0
  22. package/dist/LanguageSelector-BR3Ss0k_.js +46 -0
  23. package/dist/LanguageSelector-CHOLPmHr.cjs +48 -0
  24. package/dist/PasswordStrengthMeter-C8irs0G1.js +173 -0
  25. package/dist/PasswordStrengthMeter-MLzhax-d.cjs +179 -0
  26. package/dist/ThemeContext-CEY9pCn-.cjs +86 -0
  27. package/dist/ThemeContext-Dk3tH7Ym.js +83 -0
  28. package/dist/ThemeToggle-BpM_iHh8.js +215 -0
  29. package/dist/ThemeToggle-CZRlv0d4.cjs +219 -0
  30. package/dist/VerifyEmailPage-BKiaw2YK.js +2954 -0
  31. package/dist/VerifyEmailPage-Beaicc6V.cjs +2963 -0
  32. package/dist/VerifyEmailPage-BehPBp0F.cjs +2963 -0
  33. package/dist/VerifyEmailPage-Djb6hthM.js +2954 -0
  34. package/dist/XerticaProvider-BijpC_py.cjs +46 -0
  35. package/dist/XerticaProvider-C2wDRQhT.js +44 -0
  36. package/dist/alert-dialog-BzIcTKn_.cjs +872 -0
  37. package/dist/alert-dialog-kty5pxQp.js +819 -0
  38. package/dist/assistant.cjs.js +1 -1
  39. package/dist/assistant.es.js +1 -1
  40. package/dist/blocks.cjs.js +7 -3
  41. package/dist/blocks.es.js +2 -2
  42. package/dist/brand.cjs.js +7 -6
  43. package/dist/brand.es.js +3 -2
  44. package/dist/components/blocks/auth/AuthPageShell.d.ts +12 -0
  45. package/dist/components/blocks/auth/PasswordStrengthMeter.d.ts +7 -0
  46. package/dist/components/blocks/auth/SocialLoginButtons.d.ts +8 -0
  47. package/dist/components/blocks/auth/index.d.ts +8 -0
  48. package/dist/components/blocks/auth/usePasswordStrength.d.ts +3 -0
  49. package/dist/components/blocks/index.d.ts +1 -0
  50. package/dist/components/pages/reset-password-page/ResetPasswordPage.d.ts +1 -1
  51. package/dist/hooks.cjs.js +5 -4
  52. package/dist/hooks.es.js +2 -1
  53. package/dist/index.cjs.js +29 -24
  54. package/dist/index.es.js +12 -11
  55. package/dist/layout.cjs.js +1 -1
  56. package/dist/layout.es.js +1 -1
  57. package/dist/pages.cjs.js +1 -1
  58. package/dist/pages.es.js +1 -1
  59. package/dist/sidebar-B7YzwAp3.js +1151 -0
  60. package/dist/sidebar-Cb0U7NsV.cjs +1154 -0
  61. package/dist/ui.cjs.js +7 -7
  62. package/dist/ui.es.js +3 -3
  63. package/dist/xertica-assistant-8fh8KA2K.js +2173 -0
  64. package/dist/xertica-assistant-BjfG3zyL.cjs +2180 -0
  65. package/docs/i18n.md +2 -0
  66. package/package.json +1 -1
  67. package/templates/package.json +2 -2
  68. package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +1 -2
  69. package/templates/src/features/auth/ui/LoginContent.tsx +1 -2
  70. package/templates/src/features/auth/ui/ResetPasswordContent.tsx +3 -57
  71. package/templates/src/features/auth/ui/VerifyEmailContent.tsx +1 -2
  72. package/templates/src/features/home/index.ts +0 -10
  73. package/templates/src/features/home/ui/HomeContent.tsx +21 -75
  74. package/templates/src/features/template/index.ts +0 -4
  75. package/templates/src/features/template/ui/TemplateContent.tsx +26 -1279
  76. package/templates/src/locales/en/pages/templates.json +5 -313
  77. package/templates/src/locales/es/pages/templates.json +5 -313
  78. package/templates/src/locales/pt-BR/pages/templates.json +5 -313
  79. package/templates/src/features/auth/ui/SocialLoginButtons.tsx +0 -78
  80. package/templates/src/features/home/data/mock.ts +0 -41
  81. package/templates/src/features/home/hooks/useFeatureCards.ts +0 -20
  82. package/templates/src/features/home/store/dashboardStore.ts +0 -25
  83. package/templates/src/features/template/ui/CrudTemplate.tsx +0 -112
  84. package/templates/src/features/template/ui/DashboardTemplate.tsx +0 -110
  85. package/templates/src/features/template/ui/FormTemplate.tsx +0 -117
  86. package/templates/src/features/template/ui/LoginTemplate.tsx +0 -59
  87. package/templates/src/locales/en/pages/crudTemplate.json +0 -25
  88. package/templates/src/locales/en/pages/dashboardTemplate.json +0 -20
  89. package/templates/src/locales/en/pages/formTemplate.json +0 -16
  90. package/templates/src/locales/en/pages/loginTemplate.json +0 -9
  91. package/templates/src/locales/es/pages/crudTemplate.json +0 -25
  92. package/templates/src/locales/es/pages/dashboardTemplate.json +0 -20
  93. package/templates/src/locales/es/pages/formTemplate.json +0 -16
  94. package/templates/src/locales/es/pages/loginTemplate.json +0 -9
  95. package/templates/src/locales/pt-BR/pages/crudTemplate.json +0 -25
  96. package/templates/src/locales/pt-BR/pages/dashboardTemplate.json +0 -20
  97. package/templates/src/locales/pt-BR/pages/formTemplate.json +0 -16
  98. package/templates/src/locales/pt-BR/pages/loginTemplate.json +0 -9
  99. package/templates/vite.config.d.ts +0 -2
  100. package/templates/vite.config.js +0 -20
@@ -0,0 +1,485 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { C as Card, e as CardHeader, f as CardTitle, a as CardAction, b as CardContent, S as Skeleton, c as CardDescription, d as CardFooter } from './skeleton-DtR5tkYe.js';
5
+ import { A as Avatar, b as AvatarImage, a as AvatarFallback } from './avatar-3kO2Anrp.js';
6
+ import { B as Badge, P as Progress } from './ImageWithFallback-bw-CxxDc.js';
7
+ import { c as cn, B as Button } from './button-DZHzN1Gd.js';
8
+
9
+ const activityTypeVariant = {
10
+ create: "success",
11
+ update: "info",
12
+ delete: "destructive",
13
+ comment: "secondary",
14
+ deploy: "default"
15
+ };
16
+ function ActivityCard({
17
+ title,
18
+ items,
19
+ action,
20
+ maxItems = 5,
21
+ className,
22
+ ...props
23
+ }) {
24
+ const { t } = useTranslation();
25
+ const cardTitle = title ?? t("activityCard.title");
26
+ const activityTypeBadge = useMemo(
27
+ () => ({
28
+ create: { label: t("activityCard.type.create"), variant: activityTypeVariant.create },
29
+ update: { label: t("activityCard.type.update"), variant: activityTypeVariant.update },
30
+ delete: { label: t("activityCard.type.remove"), variant: activityTypeVariant.delete },
31
+ comment: { label: t("activityCard.type.comment"), variant: activityTypeVariant.comment },
32
+ deploy: { label: t("activityCard.type.deploy"), variant: activityTypeVariant.deploy }
33
+ }),
34
+ [t]
35
+ );
36
+ const visible = items.slice(0, maxItems);
37
+ return /* @__PURE__ */ jsxs(Card, { className: cn("w-full", className), ...props, children: [
38
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
39
+ /* @__PURE__ */ jsx(CardTitle, { children: cardTitle }),
40
+ action && /* @__PURE__ */ jsx(CardAction, { children: action })
41
+ ] }),
42
+ /* @__PURE__ */ jsx(CardContent, { className: "px-6 pb-6", children: /* @__PURE__ */ jsx("ul", { className: "space-y-4", children: visible.map((item) => {
43
+ const badge = item.type ? activityTypeBadge[item.type] : null;
44
+ return /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-3", children: [
45
+ /* @__PURE__ */ jsxs(Avatar, { className: "size-8 shrink-0", children: [
46
+ item.user.avatar && /* @__PURE__ */ jsx(AvatarImage, { src: item.user.avatar, alt: item.user.name }),
47
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: item.user.initials })
48
+ ] }),
49
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
50
+ /* @__PURE__ */ jsxs("p", { className: "text-sm leading-snug", children: [
51
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: item.user.name }),
52
+ " ",
53
+ item.action,
54
+ " ",
55
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: item.target })
56
+ ] }),
57
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: item.time })
58
+ ] }),
59
+ badge && /* @__PURE__ */ jsx(Badge, { variant: badge.variant, className: "shrink-0 text-xs", children: badge.label })
60
+ ] }, item.id);
61
+ }) }) })
62
+ ] });
63
+ }
64
+
65
+ function ActivityCardSkeleton({ rows = 5, className, ...props }) {
66
+ return /* @__PURE__ */ jsxs(Card, { className: cn("w-full", className), ...props, children: [
67
+ /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-40" }) }),
68
+ /* @__PURE__ */ jsx(CardContent, { className: "px-6 pb-6", children: /* @__PURE__ */ jsx("ul", { className: "space-y-4", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-3", children: [
69
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-8 rounded-full shrink-0" }),
70
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 space-y-1.5", children: [
71
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-4/5" }),
72
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-20" })
73
+ ] }),
74
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16 shrink-0 rounded-full" })
75
+ ] }, i)) }) })
76
+ ] });
77
+ }
78
+
79
+ const statusVariant = {
80
+ online: "success",
81
+ offline: "secondary",
82
+ away: "warning",
83
+ busy: "destructive"
84
+ };
85
+ function ProfileCard({
86
+ name,
87
+ role,
88
+ department,
89
+ avatar,
90
+ initials,
91
+ status,
92
+ stats,
93
+ primaryAction,
94
+ secondaryAction,
95
+ className,
96
+ ...props
97
+ }) {
98
+ const { t } = useTranslation();
99
+ const statusLabelMap = useMemo(
100
+ () => ({
101
+ online: t("profileCard.status.online"),
102
+ offline: t("profileCard.status.offline"),
103
+ away: t("profileCard.status.away"),
104
+ busy: t("profileCard.status.busy")
105
+ }),
106
+ [t]
107
+ );
108
+ const s = status ? { label: statusLabelMap[status], variant: statusVariant[status] } : null;
109
+ return /* @__PURE__ */ jsx(Card, { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs(CardContent, { className: "pt-6 flex flex-col items-center text-center gap-3", children: [
110
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
111
+ /* @__PURE__ */ jsxs(Avatar, { className: "size-16", children: [
112
+ avatar && /* @__PURE__ */ jsx(AvatarImage, { src: avatar, alt: name }),
113
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-lg font-semibold", children: initials })
114
+ ] }),
115
+ s && /* @__PURE__ */ jsx("span", { className: "absolute -bottom-0.5 -right-0.5", children: /* @__PURE__ */ jsx(Badge, { variant: s.variant, className: "text-[10px] px-1.5 py-0 h-5", children: s.label }) })
116
+ ] }),
117
+ /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
118
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-base leading-tight", children: name }),
119
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: role }),
120
+ department && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: department })
121
+ ] }),
122
+ stats && stats.length > 0 && /* @__PURE__ */ jsx("div", { className: "w-full grid grid-cols-3 divide-x divide-border border-y border-border py-3 mt-1", children: stats.map((stat) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5 px-2", children: [
123
+ /* @__PURE__ */ jsx("span", { className: "text-base font-bold", children: stat.value }),
124
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: stat.label })
125
+ ] }, stat.label)) }),
126
+ (primaryAction || secondaryAction) && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 w-full", children: [
127
+ secondaryAction && /* @__PURE__ */ jsx(
128
+ Button,
129
+ {
130
+ variant: "outline",
131
+ className: "flex-1",
132
+ size: "sm",
133
+ onClick: secondaryAction.onClick,
134
+ children: secondaryAction.label
135
+ }
136
+ ),
137
+ primaryAction && /* @__PURE__ */ jsx(Button, { className: "flex-1", size: "sm", onClick: primaryAction.onClick, children: primaryAction.label })
138
+ ] })
139
+ ] }) });
140
+ }
141
+
142
+ function ProfileCardSkeleton({
143
+ showStats = true,
144
+ showActions = true,
145
+ className,
146
+ ...props
147
+ }) {
148
+ return /* @__PURE__ */ jsx(Card, { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs(CardContent, { className: "pt-6 flex flex-col items-center text-center gap-3", children: [
149
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-16 rounded-full" }),
150
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5 w-full flex flex-col items-center", children: [
151
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" }),
152
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-24" }),
153
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-20" })
154
+ ] }),
155
+ showStats && /* @__PURE__ */ jsx("div", { className: "w-full grid grid-cols-3 divide-x divide-border border-y border-border py-3 mt-1", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1 px-2", children: [
156
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-10" }),
157
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-2.5 w-12" })
158
+ ] }, i)) }),
159
+ showActions && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 w-full", children: [
160
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 flex-1 rounded-md" }),
161
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 flex-1 rounded-md" })
162
+ ] })
163
+ ] }) });
164
+ }
165
+
166
+ const statusVariantConfig = {
167
+ active: { variant: "info", progressVariant: "info" },
168
+ review: { variant: "warning", progressVariant: "warning" },
169
+ done: { variant: "success", progressVariant: "success" },
170
+ paused: { variant: "secondary", progressVariant: "default" },
171
+ "at-risk": { variant: "destructive", progressVariant: "destructive" }
172
+ };
173
+ function ProjectCard({
174
+ title,
175
+ description,
176
+ status,
177
+ progress,
178
+ dueDate,
179
+ members = [],
180
+ maxMembers = 4,
181
+ action,
182
+ className,
183
+ ...props
184
+ }) {
185
+ const { t } = useTranslation();
186
+ const statusLabelMap = useMemo(
187
+ () => ({
188
+ active: t("projectCard.status.active"),
189
+ review: t("projectCard.status.review"),
190
+ done: t("projectCard.status.completed"),
191
+ paused: t("projectCard.status.paused"),
192
+ "at-risk": t("projectCard.status.atRisk")
193
+ }),
194
+ [t]
195
+ );
196
+ const { variant, progressVariant } = statusVariantConfig[status];
197
+ const label = statusLabelMap[status];
198
+ const visible = members.slice(0, maxMembers);
199
+ const overflow = members.length - maxMembers;
200
+ return /* @__PURE__ */ jsxs(Card, { className: cn("w-full", className), ...props, children: [
201
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
202
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
203
+ /* @__PURE__ */ jsx(CardTitle, { className: "truncate", children: title }),
204
+ description && /* @__PURE__ */ jsx(CardDescription, { className: "line-clamp-2", children: description })
205
+ ] }),
206
+ /* @__PURE__ */ jsxs(CardAction, { className: "flex items-center gap-2", children: [
207
+ /* @__PURE__ */ jsx(Badge, { variant, children: label }),
208
+ action
209
+ ] })
210
+ ] }),
211
+ /* @__PURE__ */ jsx(CardContent, { className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
212
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
213
+ /* @__PURE__ */ jsx("span", { children: t("projectCard.progress") }),
214
+ /* @__PURE__ */ jsxs("span", { children: [
215
+ progress,
216
+ "%"
217
+ ] })
218
+ ] }),
219
+ /* @__PURE__ */ jsx(Progress, { value: progress, variant: progressVariant, className: "h-2" })
220
+ ] }) }),
221
+ /* @__PURE__ */ jsxs(CardFooter, { className: "flex items-center justify-between", children: [
222
+ /* @__PURE__ */ jsxs("div", { className: "flex -space-x-2", children: [
223
+ visible.map((m) => /* @__PURE__ */ jsxs(Avatar, { className: "size-7 border-2 border-background", children: [
224
+ m.avatar && /* @__PURE__ */ jsx(AvatarImage, { src: m.avatar, alt: m.name }),
225
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[10px]", children: m.initials })
226
+ ] }, m.name)),
227
+ overflow > 0 && /* @__PURE__ */ jsxs("div", { className: "size-7 rounded-full border-2 border-background bg-muted flex items-center justify-center text-[10px] font-medium text-muted-foreground", children: [
228
+ "+",
229
+ overflow
230
+ ] })
231
+ ] }),
232
+ dueDate && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: dueDate })
233
+ ] })
234
+ ] });
235
+ }
236
+
237
+ function ProjectCardSkeleton({
238
+ memberCount = 3,
239
+ className,
240
+ ...props
241
+ }) {
242
+ return /* @__PURE__ */ jsxs(Card, { className: cn("w-full", className), ...props, children: [
243
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
244
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0 flex-1", children: [
245
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-3/4" }),
246
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-full mt-0.5" })
247
+ ] }),
248
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-20 rounded-full shrink-0" })
249
+ ] }),
250
+ /* @__PURE__ */ jsx(CardContent, { className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
251
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
252
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-14" }),
253
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-8" })
254
+ ] }),
255
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-2 w-full rounded-full" })
256
+ ] }) }),
257
+ /* @__PURE__ */ jsxs(CardFooter, { className: "flex items-center justify-between", children: [
258
+ /* @__PURE__ */ jsx("div", { className: "flex -space-x-2", children: Array.from({ length: Math.min(memberCount, 4) }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: "size-7 rounded-full border-2 border-background" }, i)) }),
259
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-20" })
260
+ ] })
261
+ ] });
262
+ }
263
+
264
+ function QuickActionCard({
265
+ title,
266
+ description,
267
+ icon,
268
+ badge,
269
+ badgeVariant = "secondary",
270
+ actionLabel,
271
+ actionVariant = "default",
272
+ onAction,
273
+ disabled,
274
+ className,
275
+ ...props
276
+ }) {
277
+ return /* @__PURE__ */ jsx(
278
+ Card,
279
+ {
280
+ className: cn(
281
+ "w-full group transition-shadow hover:shadow-md",
282
+ disabled && "opacity-60 pointer-events-none",
283
+ className
284
+ ),
285
+ ...props,
286
+ children: /* @__PURE__ */ jsxs(CardContent, { className: "pt-6 flex flex-col items-start gap-4", children: [
287
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between w-full", children: [
288
+ /* @__PURE__ */ jsx("div", { className: "p-2.5 rounded-[var(--radius)] bg-primary/10 text-primary", children: icon }),
289
+ badge && /* @__PURE__ */ jsx(Badge, { variant: badgeVariant, children: badge })
290
+ ] }),
291
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1 flex-1", children: [
292
+ /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm leading-tight", children: title }),
293
+ description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: description })
294
+ ] }),
295
+ /* @__PURE__ */ jsx(
296
+ Button,
297
+ {
298
+ variant: actionVariant,
299
+ size: "sm",
300
+ className: "w-full",
301
+ onClick: onAction,
302
+ disabled,
303
+ children: actionLabel
304
+ }
305
+ )
306
+ ] })
307
+ }
308
+ );
309
+ }
310
+
311
+ function QuickActionCardSkeleton({ className, ...props }) {
312
+ return /* @__PURE__ */ jsx(Card, { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs(CardContent, { className: "pt-6 flex flex-col items-start gap-4", children: [
313
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between w-full", children: [
314
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-10 rounded-[var(--radius)]" }),
315
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-14 rounded-full" })
316
+ ] }),
317
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5 flex-1 w-full", children: [
318
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4" }),
319
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-full" }),
320
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-5/6" })
321
+ ] }),
322
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-full rounded-md" })
323
+ ] }) });
324
+ }
325
+
326
+ const typeVariant = {
327
+ info: "info",
328
+ warning: "warning",
329
+ success: "success",
330
+ error: "destructive",
331
+ default: "secondary"
332
+ };
333
+ function NotificationCard({
334
+ title,
335
+ items,
336
+ unreadCount,
337
+ onMarkAllRead,
338
+ onViewAll,
339
+ maxItems = 4,
340
+ className,
341
+ ...props
342
+ }) {
343
+ const { t } = useTranslation();
344
+ const visible = items.slice(0, maxItems);
345
+ const count = unreadCount ?? items.filter((i) => !i.read).length;
346
+ const cardTitle = title ?? t("notificationCard.title");
347
+ return /* @__PURE__ */ jsxs(Card, { className: cn("w-full", className), ...props, children: [
348
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
349
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
350
+ /* @__PURE__ */ jsx(CardTitle, { children: cardTitle }),
351
+ count > 0 && /* @__PURE__ */ jsx(Badge, { variant: "destructive", className: "h-5 text-[11px] px-1.5", children: count })
352
+ ] }),
353
+ onMarkAllRead && count > 0 && /* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "text-xs h-7", onClick: onMarkAllRead, children: t("notificationCard.markAllRead") }) })
354
+ ] }),
355
+ /* @__PURE__ */ jsx(CardContent, { className: "px-0 pb-0", children: /* @__PURE__ */ jsx("ul", { className: "divide-y divide-border", children: visible.map((item) => /* @__PURE__ */ jsxs(
356
+ "li",
357
+ {
358
+ className: cn(
359
+ "flex items-start gap-3 px-6 py-3 transition-colors",
360
+ !item.read && "bg-muted/40"
361
+ ),
362
+ children: [
363
+ item.user ? /* @__PURE__ */ jsxs(Avatar, { className: "size-8 shrink-0 mt-0.5", children: [
364
+ item.user.avatar && /* @__PURE__ */ jsx(AvatarImage, { src: item.user.avatar, alt: item.user.name }),
365
+ /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: item.user.initials })
366
+ ] }) : /* @__PURE__ */ jsx("div", { className: "size-8 shrink-0 mt-0.5 rounded-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsx(
367
+ "div",
368
+ {
369
+ className: cn(
370
+ "size-2 rounded-full",
371
+ item.type === "error" ? "bg-destructive" : item.type === "warning" ? "bg-warning" : item.type === "success" ? "bg-success" : item.type === "info" ? "bg-info" : "bg-muted-foreground"
372
+ )
373
+ }
374
+ ) }),
375
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
376
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
377
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: item.title }),
378
+ item.type && item.type !== "default" && /* @__PURE__ */ jsx(
379
+ Badge,
380
+ {
381
+ variant: typeVariant[item.type],
382
+ className: "text-[10px] px-1.5 h-4 shrink-0",
383
+ children: item.type
384
+ }
385
+ )
386
+ ] }),
387
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground line-clamp-2 mt-0.5", children: item.message }),
388
+ /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground/70 mt-1", children: item.time })
389
+ ] }),
390
+ !item.read && /* @__PURE__ */ jsx("div", { className: "size-2 rounded-full bg-primary shrink-0 mt-2" })
391
+ ]
392
+ },
393
+ item.id
394
+ )) }) }),
395
+ onViewAll && /* @__PURE__ */ jsx(CardFooter, { className: "pt-2", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "w-full text-xs", onClick: onViewAll, children: t("notificationCard.viewAll") }) })
396
+ ] });
397
+ }
398
+
399
+ function NotificationCardSkeleton({
400
+ rows = 4,
401
+ showViewAll = false,
402
+ className,
403
+ ...props
404
+ }) {
405
+ return /* @__PURE__ */ jsxs(Card, { className: cn("w-full", className), ...props, children: [
406
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
407
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
408
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-32" }),
409
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-6 rounded-full" })
410
+ ] }),
411
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-32 rounded-md" })
412
+ ] }),
413
+ /* @__PURE__ */ jsx(CardContent, { className: "px-0 pb-0", children: /* @__PURE__ */ jsx("ul", { className: "divide-y divide-border", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-3 px-6 py-3", children: [
414
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-8 rounded-full shrink-0 mt-0.5" }),
415
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 space-y-1.5", children: [
416
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
417
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-40" }),
418
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12 rounded-full shrink-0" })
419
+ ] }),
420
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-full" }),
421
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-3/4" }),
422
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-2.5 w-16 mt-0.5" })
423
+ ] }),
424
+ /* @__PURE__ */ jsx(Skeleton, { className: "size-2 rounded-full shrink-0 mt-2" })
425
+ ] }, i)) }) }),
426
+ showViewAll && /* @__PURE__ */ jsx(CardFooter, { className: "pt-2", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-full rounded-md" }) })
427
+ ] });
428
+ }
429
+
430
+ const colorTokens = {
431
+ primary: { bg: "bg-primary/10", icon: "text-primary" },
432
+ "chart-1": { bg: "bg-[var(--chart-1)]/15", icon: "text-[var(--chart-1)]" },
433
+ "chart-2": { bg: "bg-[var(--chart-2)]/15", icon: "text-[var(--chart-2)]" },
434
+ "chart-3": { bg: "bg-[var(--chart-3)]/15", icon: "text-[var(--chart-3)]" },
435
+ "chart-4": { bg: "bg-[var(--chart-4)]/15", icon: "text-[var(--chart-4)]" },
436
+ "chart-5": { bg: "bg-[var(--chart-5)]/15", icon: "text-[var(--chart-5)]" },
437
+ success: { bg: "bg-success/10", icon: "text-success" },
438
+ info: { bg: "bg-info/10", icon: "text-info" },
439
+ warning: { bg: "bg-warning/10", icon: "text-warning" },
440
+ destructive: { bg: "bg-destructive/10", icon: "text-destructive" }
441
+ };
442
+ function FeatureCard({
443
+ title,
444
+ description,
445
+ icon,
446
+ color = "primary",
447
+ badge,
448
+ badgeVariant = "default",
449
+ actionLabel,
450
+ actionVariant = "outline",
451
+ onAction,
452
+ className,
453
+ ...props
454
+ }) {
455
+ const { bg, icon: iconColor } = colorTokens[color];
456
+ return /* @__PURE__ */ jsxs(
457
+ Card,
458
+ {
459
+ className: cn(
460
+ "flex flex-col h-full hover:shadow-md transition-shadow duration-200",
461
+ className
462
+ ),
463
+ ...props,
464
+ children: [
465
+ /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
466
+ /* @__PURE__ */ jsx("div", { className: cn("p-2 rounded-[var(--radius)] shrink-0", bg), children: /* @__PURE__ */ jsx(
467
+ "div",
468
+ {
469
+ className: cn("size-6 flex items-center justify-center [&>svg]:size-6", iconColor),
470
+ children: icon
471
+ }
472
+ ) }),
473
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 min-w-0", children: [
474
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-sm", children: title }),
475
+ badge && /* @__PURE__ */ jsx(Badge, { variant: badgeVariant, className: "text-xs", children: badge })
476
+ ] })
477
+ ] }) }),
478
+ /* @__PURE__ */ jsx(CardContent, { className: "flex-1", children: /* @__PURE__ */ jsx(CardDescription, { className: "text-sm leading-relaxed", children: description }) }),
479
+ actionLabel && /* @__PURE__ */ jsx(CardFooter, { children: /* @__PURE__ */ jsx(Button, { variant: actionVariant, className: "w-full", onClick: onAction, children: actionLabel }) })
480
+ ]
481
+ }
482
+ );
483
+ }
484
+
485
+ export { ActivityCard as A, FeatureCard as F, NotificationCard as N, ProfileCard as P, QuickActionCard as Q, ActivityCardSkeleton as a, NotificationCardSkeleton as b, ProfileCardSkeleton as c, ProjectCard as d, ProjectCardSkeleton as e, QuickActionCardSkeleton as f };