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,497 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const React = require('react');
5
+ const reactI18next = require('react-i18next');
6
+ const skeleton = require('./skeleton-DjiHerJn.cjs');
7
+ const avatar = require('./avatar-BCM7YQRC.cjs');
8
+ const ImageWithFallback = require('./ImageWithFallback-CfkAkctC.cjs');
9
+ const button = require('./button-0BlA47It.cjs');
10
+
11
+ const activityTypeVariant = {
12
+ create: "success",
13
+ update: "info",
14
+ delete: "destructive",
15
+ comment: "secondary",
16
+ deploy: "default"
17
+ };
18
+ function ActivityCard({
19
+ title,
20
+ items,
21
+ action,
22
+ maxItems = 5,
23
+ className,
24
+ ...props
25
+ }) {
26
+ const { t } = reactI18next.useTranslation();
27
+ const cardTitle = title ?? t("activityCard.title");
28
+ const activityTypeBadge = React.useMemo(
29
+ () => ({
30
+ create: { label: t("activityCard.type.create"), variant: activityTypeVariant.create },
31
+ update: { label: t("activityCard.type.update"), variant: activityTypeVariant.update },
32
+ delete: { label: t("activityCard.type.remove"), variant: activityTypeVariant.delete },
33
+ comment: { label: t("activityCard.type.comment"), variant: activityTypeVariant.comment },
34
+ deploy: { label: t("activityCard.type.deploy"), variant: activityTypeVariant.deploy }
35
+ }),
36
+ [t]
37
+ );
38
+ const visible = items.slice(0, maxItems);
39
+ return /* @__PURE__ */ jsxRuntime.jsxs(skeleton.Card, { className: button.cn("w-full", className), ...props, children: [
40
+ /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardHeader, { children: [
41
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardTitle, { children: cardTitle }),
42
+ action && /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardAction, { children: action })
43
+ ] }),
44
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "px-6 pb-6", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-4", children: visible.map((item) => {
45
+ const badge = item.type ? activityTypeBadge[item.type] : null;
46
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-3", children: [
47
+ /* @__PURE__ */ jsxRuntime.jsxs(avatar.Avatar, { className: "size-8 shrink-0", children: [
48
+ item.user.avatar && /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarImage, { src: item.user.avatar, alt: item.user.name }),
49
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarFallback, { className: "text-xs", children: item.user.initials })
50
+ ] }),
51
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
52
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm leading-snug", children: [
53
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: item.user.name }),
54
+ " ",
55
+ item.action,
56
+ " ",
57
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: item.target })
58
+ ] }),
59
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: item.time })
60
+ ] }),
61
+ badge && /* @__PURE__ */ jsxRuntime.jsx(ImageWithFallback.Badge, { variant: badge.variant, className: "shrink-0 text-xs", children: badge.label })
62
+ ] }, item.id);
63
+ }) }) })
64
+ ] });
65
+ }
66
+
67
+ function ActivityCardSkeleton({ rows = 5, className, ...props }) {
68
+ return /* @__PURE__ */ jsxRuntime.jsxs(skeleton.Card, { className: button.cn("w-full", className), ...props, children: [
69
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-40" }) }),
70
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "px-6 pb-6", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-4", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-3", children: [
71
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "size-8 rounded-full shrink-0" }),
72
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 space-y-1.5", children: [
73
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3.5 w-4/5" }),
74
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-20" })
75
+ ] }),
76
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-16 shrink-0 rounded-full" })
77
+ ] }, i)) }) })
78
+ ] });
79
+ }
80
+
81
+ const statusVariant = {
82
+ online: "success",
83
+ offline: "secondary",
84
+ away: "warning",
85
+ busy: "destructive"
86
+ };
87
+ function ProfileCard({
88
+ name,
89
+ role,
90
+ department,
91
+ avatar: avatar$1,
92
+ initials,
93
+ status,
94
+ stats,
95
+ primaryAction,
96
+ secondaryAction,
97
+ className,
98
+ ...props
99
+ }) {
100
+ const { t } = reactI18next.useTranslation();
101
+ const statusLabelMap = React.useMemo(
102
+ () => ({
103
+ online: t("profileCard.status.online"),
104
+ offline: t("profileCard.status.offline"),
105
+ away: t("profileCard.status.away"),
106
+ busy: t("profileCard.status.busy")
107
+ }),
108
+ [t]
109
+ );
110
+ const s = status ? { label: statusLabelMap[status], variant: statusVariant[status] } : null;
111
+ return /* @__PURE__ */ jsxRuntime.jsx(skeleton.Card, { className: button.cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardContent, { className: "pt-6 flex flex-col items-center text-center gap-3", children: [
112
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
113
+ /* @__PURE__ */ jsxRuntime.jsxs(avatar.Avatar, { className: "size-16", children: [
114
+ avatar$1 && /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarImage, { src: avatar$1, alt: name }),
115
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarFallback, { className: "text-lg font-semibold", children: initials })
116
+ ] }),
117
+ s && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -bottom-0.5 -right-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(ImageWithFallback.Badge, { variant: s.variant, className: "text-[10px] px-1.5 py-0 h-5", children: s.label }) })
118
+ ] }),
119
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
120
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-base leading-tight", children: name }),
121
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: role }),
122
+ department && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: department })
123
+ ] }),
124
+ stats && stats.length > 0 && /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-0.5 px-2", children: [
125
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold", children: stat.value }),
126
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-muted-foreground", children: stat.label })
127
+ ] }, stat.label)) }),
128
+ (primaryAction || secondaryAction) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 w-full", children: [
129
+ secondaryAction && /* @__PURE__ */ jsxRuntime.jsx(
130
+ button.Button,
131
+ {
132
+ variant: "outline",
133
+ className: "flex-1",
134
+ size: "sm",
135
+ onClick: secondaryAction.onClick,
136
+ children: secondaryAction.label
137
+ }
138
+ ),
139
+ primaryAction && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { className: "flex-1", size: "sm", onClick: primaryAction.onClick, children: primaryAction.label })
140
+ ] })
141
+ ] }) });
142
+ }
143
+
144
+ function ProfileCardSkeleton({
145
+ showStats = true,
146
+ showActions = true,
147
+ className,
148
+ ...props
149
+ }) {
150
+ return /* @__PURE__ */ jsxRuntime.jsx(skeleton.Card, { className: button.cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardContent, { className: "pt-6 flex flex-col items-center text-center gap-3", children: [
151
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "size-16 rounded-full" }),
152
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5 w-full flex flex-col items-center", children: [
153
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-32" }),
154
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-24" }),
155
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-20" })
156
+ ] }),
157
+ showStats && /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-1 px-2", children: [
158
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-10" }),
159
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-2.5 w-12" })
160
+ ] }, i)) }),
161
+ showActions && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 w-full", children: [
162
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-8 flex-1 rounded-md" }),
163
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-8 flex-1 rounded-md" })
164
+ ] })
165
+ ] }) });
166
+ }
167
+
168
+ const statusVariantConfig = {
169
+ active: { variant: "info", progressVariant: "info" },
170
+ review: { variant: "warning", progressVariant: "warning" },
171
+ done: { variant: "success", progressVariant: "success" },
172
+ paused: { variant: "secondary", progressVariant: "default" },
173
+ "at-risk": { variant: "destructive", progressVariant: "destructive" }
174
+ };
175
+ function ProjectCard({
176
+ title,
177
+ description,
178
+ status,
179
+ progress,
180
+ dueDate,
181
+ members = [],
182
+ maxMembers = 4,
183
+ action,
184
+ className,
185
+ ...props
186
+ }) {
187
+ const { t } = reactI18next.useTranslation();
188
+ const statusLabelMap = React.useMemo(
189
+ () => ({
190
+ active: t("projectCard.status.active"),
191
+ review: t("projectCard.status.review"),
192
+ done: t("projectCard.status.completed"),
193
+ paused: t("projectCard.status.paused"),
194
+ "at-risk": t("projectCard.status.atRisk")
195
+ }),
196
+ [t]
197
+ );
198
+ const { variant, progressVariant } = statusVariantConfig[status];
199
+ const label = statusLabelMap[status];
200
+ const visible = members.slice(0, maxMembers);
201
+ const overflow = members.length - maxMembers;
202
+ return /* @__PURE__ */ jsxRuntime.jsxs(skeleton.Card, { className: button.cn("w-full", className), ...props, children: [
203
+ /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardHeader, { children: [
204
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
205
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardTitle, { className: "truncate", children: title }),
206
+ description && /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardDescription, { className: "line-clamp-2", children: description })
207
+ ] }),
208
+ /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardAction, { className: "flex items-center gap-2", children: [
209
+ /* @__PURE__ */ jsxRuntime.jsx(ImageWithFallback.Badge, { variant, children: label }),
210
+ action
211
+ ] })
212
+ ] }),
213
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "space-y-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
214
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
215
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("projectCard.progress") }),
216
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
217
+ progress,
218
+ "%"
219
+ ] })
220
+ ] }),
221
+ /* @__PURE__ */ jsxRuntime.jsx(ImageWithFallback.Progress, { value: progress, variant: progressVariant, className: "h-2" })
222
+ ] }) }),
223
+ /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardFooter, { className: "flex items-center justify-between", children: [
224
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex -space-x-2", children: [
225
+ visible.map((m) => /* @__PURE__ */ jsxRuntime.jsxs(avatar.Avatar, { className: "size-7 border-2 border-background", children: [
226
+ m.avatar && /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarImage, { src: m.avatar, alt: m.name }),
227
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarFallback, { className: "text-[10px]", children: m.initials })
228
+ ] }, m.name)),
229
+ overflow > 0 && /* @__PURE__ */ jsxRuntime.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: [
230
+ "+",
231
+ overflow
232
+ ] })
233
+ ] }),
234
+ dueDate && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: dueDate })
235
+ ] })
236
+ ] });
237
+ }
238
+
239
+ function ProjectCardSkeleton({
240
+ memberCount = 3,
241
+ className,
242
+ ...props
243
+ }) {
244
+ return /* @__PURE__ */ jsxRuntime.jsxs(skeleton.Card, { className: button.cn("w-full", className), ...props, children: [
245
+ /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardHeader, { children: [
246
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 min-w-0 flex-1", children: [
247
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-3/4" }),
248
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3.5 w-full mt-0.5" })
249
+ ] }),
250
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-20 rounded-full shrink-0" })
251
+ ] }),
252
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "space-y-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
253
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
254
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-14" }),
255
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-8" })
256
+ ] }),
257
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-2 w-full rounded-full" })
258
+ ] }) }),
259
+ /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardFooter, { className: "flex items-center justify-between", children: [
260
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex -space-x-2", children: Array.from({ length: Math.min(memberCount, 4) }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "size-7 rounded-full border-2 border-background" }, i)) }),
261
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-20" })
262
+ ] })
263
+ ] });
264
+ }
265
+
266
+ function QuickActionCard({
267
+ title,
268
+ description,
269
+ icon,
270
+ badge,
271
+ badgeVariant = "secondary",
272
+ actionLabel,
273
+ actionVariant = "default",
274
+ onAction,
275
+ disabled,
276
+ className,
277
+ ...props
278
+ }) {
279
+ return /* @__PURE__ */ jsxRuntime.jsx(
280
+ skeleton.Card,
281
+ {
282
+ className: button.cn(
283
+ "w-full group transition-shadow hover:shadow-md",
284
+ disabled && "opacity-60 pointer-events-none",
285
+ className
286
+ ),
287
+ ...props,
288
+ children: /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardContent, { className: "pt-6 flex flex-col items-start gap-4", children: [
289
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between w-full", children: [
290
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2.5 rounded-[var(--radius)] bg-primary/10 text-primary", children: icon }),
291
+ badge && /* @__PURE__ */ jsxRuntime.jsx(ImageWithFallback.Badge, { variant: badgeVariant, children: badge })
292
+ ] }),
293
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 flex-1", children: [
294
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-sm leading-tight", children: title }),
295
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: description })
296
+ ] }),
297
+ /* @__PURE__ */ jsxRuntime.jsx(
298
+ button.Button,
299
+ {
300
+ variant: actionVariant,
301
+ size: "sm",
302
+ className: "w-full",
303
+ onClick: onAction,
304
+ disabled,
305
+ children: actionLabel
306
+ }
307
+ )
308
+ ] })
309
+ }
310
+ );
311
+ }
312
+
313
+ function QuickActionCardSkeleton({ className, ...props }) {
314
+ return /* @__PURE__ */ jsxRuntime.jsx(skeleton.Card, { className: button.cn("w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardContent, { className: "pt-6 flex flex-col items-start gap-4", children: [
315
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between w-full", children: [
316
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "size-10 rounded-[var(--radius)]" }),
317
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-14 rounded-full" })
318
+ ] }),
319
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5 flex-1 w-full", children: [
320
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-3/4" }),
321
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-full" }),
322
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-5/6" })
323
+ ] }),
324
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-8 w-full rounded-md" })
325
+ ] }) });
326
+ }
327
+
328
+ const typeVariant = {
329
+ info: "info",
330
+ warning: "warning",
331
+ success: "success",
332
+ error: "destructive",
333
+ default: "secondary"
334
+ };
335
+ function NotificationCard({
336
+ title,
337
+ items,
338
+ unreadCount,
339
+ onMarkAllRead,
340
+ onViewAll,
341
+ maxItems = 4,
342
+ className,
343
+ ...props
344
+ }) {
345
+ const { t } = reactI18next.useTranslation();
346
+ const visible = items.slice(0, maxItems);
347
+ const count = unreadCount ?? items.filter((i) => !i.read).length;
348
+ const cardTitle = title ?? t("notificationCard.title");
349
+ return /* @__PURE__ */ jsxRuntime.jsxs(skeleton.Card, { className: button.cn("w-full", className), ...props, children: [
350
+ /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardHeader, { children: [
351
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
352
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardTitle, { children: cardTitle }),
353
+ count > 0 && /* @__PURE__ */ jsxRuntime.jsx(ImageWithFallback.Badge, { variant: "destructive", className: "h-5 text-[11px] px-1.5", children: count })
354
+ ] }),
355
+ onMarkAllRead && count > 0 && /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardAction, { children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "ghost", size: "sm", className: "text-xs h-7", onClick: onMarkAllRead, children: t("notificationCard.markAllRead") }) })
356
+ ] }),
357
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "px-0 pb-0", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "divide-y divide-border", children: visible.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
358
+ "li",
359
+ {
360
+ className: button.cn(
361
+ "flex items-start gap-3 px-6 py-3 transition-colors",
362
+ !item.read && "bg-muted/40"
363
+ ),
364
+ children: [
365
+ item.user ? /* @__PURE__ */ jsxRuntime.jsxs(avatar.Avatar, { className: "size-8 shrink-0 mt-0.5", children: [
366
+ item.user.avatar && /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarImage, { src: item.user.avatar, alt: item.user.name }),
367
+ /* @__PURE__ */ jsxRuntime.jsx(avatar.AvatarFallback, { className: "text-xs", children: item.user.initials })
368
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-8 shrink-0 mt-0.5 rounded-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
369
+ "div",
370
+ {
371
+ className: button.cn(
372
+ "size-2 rounded-full",
373
+ item.type === "error" ? "bg-destructive" : item.type === "warning" ? "bg-warning" : item.type === "success" ? "bg-success" : item.type === "info" ? "bg-info" : "bg-muted-foreground"
374
+ )
375
+ }
376
+ ) }),
377
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
378
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
379
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium truncate", children: item.title }),
380
+ item.type && item.type !== "default" && /* @__PURE__ */ jsxRuntime.jsx(
381
+ ImageWithFallback.Badge,
382
+ {
383
+ variant: typeVariant[item.type],
384
+ className: "text-[10px] px-1.5 h-4 shrink-0",
385
+ children: item.type
386
+ }
387
+ )
388
+ ] }),
389
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground line-clamp-2 mt-0.5", children: item.message }),
390
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-muted-foreground/70 mt-1", children: item.time })
391
+ ] }),
392
+ !item.read && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-2 rounded-full bg-primary shrink-0 mt-2" })
393
+ ]
394
+ },
395
+ item.id
396
+ )) }) }),
397
+ onViewAll && /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardFooter, { className: "pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "ghost", size: "sm", className: "w-full text-xs", onClick: onViewAll, children: t("notificationCard.viewAll") }) })
398
+ ] });
399
+ }
400
+
401
+ function NotificationCardSkeleton({
402
+ rows = 4,
403
+ showViewAll = false,
404
+ className,
405
+ ...props
406
+ }) {
407
+ return /* @__PURE__ */ jsxRuntime.jsxs(skeleton.Card, { className: button.cn("w-full", className), ...props, children: [
408
+ /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardHeader, { children: [
409
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
410
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-32" }),
411
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-6 rounded-full" })
412
+ ] }),
413
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-7 w-32 rounded-md" })
414
+ ] }),
415
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "px-0 pb-0", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "divide-y divide-border", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-3 px-6 py-3", children: [
416
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "size-8 rounded-full shrink-0 mt-0.5" }),
417
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 space-y-1.5", children: [
418
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
419
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3.5 w-40" }),
420
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-12 rounded-full shrink-0" })
421
+ ] }),
422
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-full" }),
423
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-3/4" }),
424
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-2.5 w-16 mt-0.5" })
425
+ ] }),
426
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "size-2 rounded-full shrink-0 mt-2" })
427
+ ] }, i)) }) }),
428
+ showViewAll && /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardFooter, { className: "pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-8 w-full rounded-md" }) })
429
+ ] });
430
+ }
431
+
432
+ const colorTokens = {
433
+ primary: { bg: "bg-primary/10", icon: "text-primary" },
434
+ "chart-1": { bg: "bg-[var(--chart-1)]/15", icon: "text-[var(--chart-1)]" },
435
+ "chart-2": { bg: "bg-[var(--chart-2)]/15", icon: "text-[var(--chart-2)]" },
436
+ "chart-3": { bg: "bg-[var(--chart-3)]/15", icon: "text-[var(--chart-3)]" },
437
+ "chart-4": { bg: "bg-[var(--chart-4)]/15", icon: "text-[var(--chart-4)]" },
438
+ "chart-5": { bg: "bg-[var(--chart-5)]/15", icon: "text-[var(--chart-5)]" },
439
+ success: { bg: "bg-success/10", icon: "text-success" },
440
+ info: { bg: "bg-info/10", icon: "text-info" },
441
+ warning: { bg: "bg-warning/10", icon: "text-warning" },
442
+ destructive: { bg: "bg-destructive/10", icon: "text-destructive" }
443
+ };
444
+ function FeatureCard({
445
+ title,
446
+ description,
447
+ icon,
448
+ color = "primary",
449
+ badge,
450
+ badgeVariant = "default",
451
+ actionLabel,
452
+ actionVariant = "outline",
453
+ onAction,
454
+ className,
455
+ ...props
456
+ }) {
457
+ const { bg, icon: iconColor } = colorTokens[color];
458
+ return /* @__PURE__ */ jsxRuntime.jsxs(
459
+ skeleton.Card,
460
+ {
461
+ className: button.cn(
462
+ "flex flex-col h-full hover:shadow-md transition-shadow duration-200",
463
+ className
464
+ ),
465
+ ...props,
466
+ children: [
467
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
468
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: button.cn("p-2 rounded-[var(--radius)] shrink-0", bg), children: /* @__PURE__ */ jsxRuntime.jsx(
469
+ "div",
470
+ {
471
+ className: button.cn("size-6 flex items-center justify-center [&>svg]:size-6", iconColor),
472
+ children: icon
473
+ }
474
+ ) }),
475
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 min-w-0", children: [
476
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardTitle, { className: "text-sm", children: title }),
477
+ badge && /* @__PURE__ */ jsxRuntime.jsx(ImageWithFallback.Badge, { variant: badgeVariant, className: "text-xs", children: badge })
478
+ ] })
479
+ ] }) }),
480
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardDescription, { className: "text-sm leading-relaxed", children: description }) }),
481
+ actionLabel && /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: actionVariant, className: "w-full", onClick: onAction, children: actionLabel }) })
482
+ ]
483
+ }
484
+ );
485
+ }
486
+
487
+ exports.ActivityCard = ActivityCard;
488
+ exports.ActivityCardSkeleton = ActivityCardSkeleton;
489
+ exports.FeatureCard = FeatureCard;
490
+ exports.NotificationCard = NotificationCard;
491
+ exports.NotificationCardSkeleton = NotificationCardSkeleton;
492
+ exports.ProfileCard = ProfileCard;
493
+ exports.ProfileCardSkeleton = ProfileCardSkeleton;
494
+ exports.ProjectCard = ProjectCard;
495
+ exports.ProjectCardSkeleton = ProjectCardSkeleton;
496
+ exports.QuickActionCard = QuickActionCard;
497
+ exports.QuickActionCardSkeleton = QuickActionCardSkeleton;
@@ -0,0 +1,122 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const reactSlot = require('@radix-ui/react-slot');
5
+ const classVarianceAuthority = require('class-variance-authority');
6
+ const button = require('./button-0BlA47It.cjs');
7
+ const ProgressPrimitive = require('@radix-ui/react-progress');
8
+ const React = require('react');
9
+
10
+ function _interopNamespaceDefault(e) {
11
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
12
+ if (e) {
13
+ for (const k in e) {
14
+ if (k !== 'default') {
15
+ const d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: () => e[k]
19
+ });
20
+ }
21
+ }
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ const ProgressPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(ProgressPrimitive);
28
+
29
+ const badgeVariants = classVarianceAuthority.cva(
30
+ "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
31
+ {
32
+ variants: {
33
+ variant: {
34
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
35
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
36
+ destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
37
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
38
+ success: "border-transparent bg-success text-success-foreground",
39
+ warning: "border-transparent bg-warning text-warning-foreground",
40
+ info: "border-transparent bg-info text-info-foreground"
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ variant: "default"
45
+ }
46
+ }
47
+ );
48
+ function Badge({
49
+ className,
50
+ variant,
51
+ asChild = false,
52
+ children,
53
+ ...props
54
+ }) {
55
+ const Comp = asChild ? reactSlot.Slot : "span";
56
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { "data-slot": "badge", className: button.cn(badgeVariants({ variant }), className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children }) });
57
+ }
58
+
59
+ const trackVariants = {
60
+ default: "bg-primary/20",
61
+ success: "bg-success/20",
62
+ info: "bg-info/20",
63
+ warning: "bg-warning/20",
64
+ destructive: "bg-destructive/20"
65
+ };
66
+ const indicatorVariants = {
67
+ default: "bg-primary",
68
+ success: "bg-success",
69
+ info: "bg-info",
70
+ warning: "bg-warning",
71
+ destructive: "bg-destructive"
72
+ };
73
+ function Progress({
74
+ className,
75
+ value,
76
+ variant = "default",
77
+ ...props
78
+ }) {
79
+ return /* @__PURE__ */ jsxRuntime.jsx(
80
+ ProgressPrimitive__namespace.Root,
81
+ {
82
+ "data-slot": "progress",
83
+ "aria-label": props["aria-label"] || "Progresso",
84
+ className: button.cn(
85
+ "relative h-2 w-full overflow-hidden rounded-full",
86
+ trackVariants[variant],
87
+ className
88
+ ),
89
+ ...props,
90
+ children: /* @__PURE__ */ jsxRuntime.jsx(
91
+ ProgressPrimitive__namespace.Indicator,
92
+ {
93
+ "data-slot": "progress-indicator",
94
+ className: button.cn("h-full w-full flex-1 transition-all", indicatorVariants[variant]),
95
+ style: { transform: `translateX(-${100 - (value || 0)}%)` }
96
+ }
97
+ )
98
+ }
99
+ );
100
+ }
101
+
102
+ const ERROR_IMG_SRC = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODgiIGhlaWdodD0iODgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBvcGFjaXR5PSIuMyIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIzLjciPjxyZWN0IHg9IjE2IiB5PSIxNiIgd2lkdGg9IjU2IiBoZWlnaHQ9IjU2IiByeD0iNiIvPjxwYXRoIGQ9Im0xNiA1OCAxNi0xOCAzMiAzMiIvPjxjaXJjbGUgY3g9IjUzIiBjeT0iMzUiIHI9IjciLz48L3N2Zz4KCg==";
103
+ function ImageWithFallback(props) {
104
+ const [didError, setDidError] = React.useState(false);
105
+ const handleError = () => {
106
+ setDidError(true);
107
+ };
108
+ const { src, alt, style, className, ...rest } = props;
109
+ return didError ? /* @__PURE__ */ jsxRuntime.jsx(
110
+ "div",
111
+ {
112
+ className: `inline-block bg-gray-100 text-center align-middle ${className ?? ""}`,
113
+ style,
114
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: ERROR_IMG_SRC, alt: "Error loading image", ...rest, "data-original-url": src }) })
115
+ }
116
+ ) : /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt, className, style, ...rest, onError: handleError });
117
+ }
118
+
119
+ exports.Badge = Badge;
120
+ exports.ImageWithFallback = ImageWithFallback;
121
+ exports.Progress = Progress;
122
+ exports.badgeVariants = badgeVariants;