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,98 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Slot, Slottable } from '@radix-ui/react-slot';
3
+ import { cva } from 'class-variance-authority';
4
+ import { c as cn } from './button-DZHzN1Gd.js';
5
+ import * as ProgressPrimitive from '@radix-ui/react-progress';
6
+ import { useState } from 'react';
7
+
8
+ const badgeVariants = cva(
9
+ "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",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
14
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
15
+ 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",
16
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
17
+ success: "border-transparent bg-success text-success-foreground",
18
+ warning: "border-transparent bg-warning text-warning-foreground",
19
+ info: "border-transparent bg-info text-info-foreground"
20
+ }
21
+ },
22
+ defaultVariants: {
23
+ variant: "default"
24
+ }
25
+ }
26
+ );
27
+ function Badge({
28
+ className,
29
+ variant,
30
+ asChild = false,
31
+ children,
32
+ ...props
33
+ }) {
34
+ const Comp = asChild ? Slot : "span";
35
+ return /* @__PURE__ */ jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props, children: /* @__PURE__ */ jsx(Slottable, { children }) });
36
+ }
37
+
38
+ const trackVariants = {
39
+ default: "bg-primary/20",
40
+ success: "bg-success/20",
41
+ info: "bg-info/20",
42
+ warning: "bg-warning/20",
43
+ destructive: "bg-destructive/20"
44
+ };
45
+ const indicatorVariants = {
46
+ default: "bg-primary",
47
+ success: "bg-success",
48
+ info: "bg-info",
49
+ warning: "bg-warning",
50
+ destructive: "bg-destructive"
51
+ };
52
+ function Progress({
53
+ className,
54
+ value,
55
+ variant = "default",
56
+ ...props
57
+ }) {
58
+ return /* @__PURE__ */ jsx(
59
+ ProgressPrimitive.Root,
60
+ {
61
+ "data-slot": "progress",
62
+ "aria-label": props["aria-label"] || "Progresso",
63
+ className: cn(
64
+ "relative h-2 w-full overflow-hidden rounded-full",
65
+ trackVariants[variant],
66
+ className
67
+ ),
68
+ ...props,
69
+ children: /* @__PURE__ */ jsx(
70
+ ProgressPrimitive.Indicator,
71
+ {
72
+ "data-slot": "progress-indicator",
73
+ className: cn("h-full w-full flex-1 transition-all", indicatorVariants[variant]),
74
+ style: { transform: `translateX(-${100 - (value || 0)}%)` }
75
+ }
76
+ )
77
+ }
78
+ );
79
+ }
80
+
81
+ const ERROR_IMG_SRC = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODgiIGhlaWdodD0iODgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBvcGFjaXR5PSIuMyIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIzLjciPjxyZWN0IHg9IjE2IiB5PSIxNiIgd2lkdGg9IjU2IiBoZWlnaHQ9IjU2IiByeD0iNiIvPjxwYXRoIGQ9Im0xNiA1OCAxNi0xOCAzMiAzMiIvPjxjaXJjbGUgY3g9IjUzIiBjeT0iMzUiIHI9IjciLz48L3N2Zz4KCg==";
82
+ function ImageWithFallback(props) {
83
+ const [didError, setDidError] = useState(false);
84
+ const handleError = () => {
85
+ setDidError(true);
86
+ };
87
+ const { src, alt, style, className, ...rest } = props;
88
+ return didError ? /* @__PURE__ */ jsx(
89
+ "div",
90
+ {
91
+ className: `inline-block bg-gray-100 text-center align-middle ${className ?? ""}`,
92
+ style,
93
+ children: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ jsx("img", { src: ERROR_IMG_SRC, alt: "Error loading image", ...rest, "data-original-url": src }) })
94
+ }
95
+ ) : /* @__PURE__ */ jsx("img", { src, alt, className, style, ...rest, onError: handleError });
96
+ }
97
+
98
+ export { Badge as B, ImageWithFallback as I, Progress as P, badgeVariants as b };