@lincros-ui/components 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +35 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4551,7 +4551,9 @@ var SSOLoadingOverlay = memo(({
|
|
|
4551
4551
|
tenantId,
|
|
4552
4552
|
error,
|
|
4553
4553
|
show = true,
|
|
4554
|
-
className = ""
|
|
4554
|
+
className = "",
|
|
4555
|
+
ssoProviderName = "SSO",
|
|
4556
|
+
appName = "o sistema"
|
|
4555
4557
|
}) => {
|
|
4556
4558
|
const getStepIcon = useMemo(() => {
|
|
4557
4559
|
switch (step) {
|
|
@@ -4577,7 +4579,7 @@ var SSOLoadingOverlay = memo(({
|
|
|
4577
4579
|
case "redirecting":
|
|
4578
4580
|
return "Redirecionando para SSO";
|
|
4579
4581
|
case "authenticating":
|
|
4580
|
-
return
|
|
4582
|
+
return `Autenticando com ${ssoProviderName}`;
|
|
4581
4583
|
case "processing":
|
|
4582
4584
|
return "Processando credenciais";
|
|
4583
4585
|
case "completing":
|
|
@@ -4587,24 +4589,24 @@ var SSOLoadingOverlay = memo(({
|
|
|
4587
4589
|
default:
|
|
4588
4590
|
return "Carregando...";
|
|
4589
4591
|
}
|
|
4590
|
-
}, [step]);
|
|
4592
|
+
}, [step, ssoProviderName]);
|
|
4591
4593
|
const getStepDescription = useMemo(() => {
|
|
4592
4594
|
if (message) return message;
|
|
4593
4595
|
switch (step) {
|
|
4594
4596
|
case "redirecting":
|
|
4595
|
-
return
|
|
4597
|
+
return `Preparando conex\xE3o segura com ${ssoProviderName}...`;
|
|
4596
4598
|
case "authenticating":
|
|
4597
|
-
return
|
|
4599
|
+
return `Verificando suas credenciais no sistema ${ssoProviderName}...`;
|
|
4598
4600
|
case "processing":
|
|
4599
4601
|
return "Criando sua sess\xE3o e configurando acesso...";
|
|
4600
4602
|
case "completing":
|
|
4601
|
-
return
|
|
4603
|
+
return `Redirecionando para ${appName}...`;
|
|
4602
4604
|
case "error":
|
|
4603
4605
|
return error || "Ocorreu um erro durante a autentica\xE7\xE3o SSO";
|
|
4604
4606
|
default:
|
|
4605
4607
|
return "Aguarde...";
|
|
4606
4608
|
}
|
|
4607
|
-
}, [message, step, error]);
|
|
4609
|
+
}, [message, step, error, ssoProviderName, appName]);
|
|
4608
4610
|
const getBgColor = useMemo(() => {
|
|
4609
4611
|
switch (step) {
|
|
4610
4612
|
case "error":
|
|
@@ -4901,7 +4903,10 @@ function ControlSidebar({
|
|
|
4901
4903
|
routePaths,
|
|
4902
4904
|
user,
|
|
4903
4905
|
onLogout,
|
|
4904
|
-
getCurrentTenantId
|
|
4906
|
+
getCurrentTenantId,
|
|
4907
|
+
logoUrl = "/lovable-uploads/632ebc32-3ae3-4944-8e70-0e9c2539494a.png",
|
|
4908
|
+
appName = "App",
|
|
4909
|
+
appSubtitle = "Sistema"
|
|
4905
4910
|
}) {
|
|
4906
4911
|
const {
|
|
4907
4912
|
toggleSubmenu,
|
|
@@ -5066,21 +5071,21 @@ function ControlSidebar({
|
|
|
5066
5071
|
/* @__PURE__ */ jsx(
|
|
5067
5072
|
"img",
|
|
5068
5073
|
{
|
|
5069
|
-
src:
|
|
5070
|
-
alt:
|
|
5074
|
+
src: logoUrl,
|
|
5075
|
+
alt: `${appName} Logo`,
|
|
5071
5076
|
className: "w-20 h-20 object-contain"
|
|
5072
5077
|
}
|
|
5073
5078
|
),
|
|
5074
5079
|
/* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
5075
|
-
/* @__PURE__ */ jsx("h2", { className: "font-bold text-lg text-gray-800", children:
|
|
5076
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children:
|
|
5080
|
+
/* @__PURE__ */ jsx("h2", { className: "font-bold text-lg text-gray-800", children: appName }),
|
|
5081
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500", children: appSubtitle })
|
|
5077
5082
|
] })
|
|
5078
5083
|
] }),
|
|
5079
5084
|
isCollapsed && /* @__PURE__ */ jsx("div", { className: "flex justify-center px-2 py-2", children: /* @__PURE__ */ jsx(
|
|
5080
5085
|
"img",
|
|
5081
5086
|
{
|
|
5082
|
-
src:
|
|
5083
|
-
alt:
|
|
5087
|
+
src: logoUrl,
|
|
5088
|
+
alt: `${appName} Logo`,
|
|
5084
5089
|
className: "w-8 h-8 object-contain"
|
|
5085
5090
|
}
|
|
5086
5091
|
) })
|
|
@@ -6839,7 +6844,10 @@ var SSOError = memo(({
|
|
|
6839
6844
|
className = "",
|
|
6840
6845
|
onRetry,
|
|
6841
6846
|
onBackToLogin,
|
|
6842
|
-
onContactSupport
|
|
6847
|
+
onContactSupport,
|
|
6848
|
+
ssoProviderName = "SSO",
|
|
6849
|
+
appName = "o sistema",
|
|
6850
|
+
supportEmail = "suporte@example.com"
|
|
6843
6851
|
}) => {
|
|
6844
6852
|
const getErrorIcon = () => {
|
|
6845
6853
|
switch (errorType) {
|
|
@@ -6876,7 +6884,7 @@ var SSOError = memo(({
|
|
|
6876
6884
|
const getErrorDescription = () => {
|
|
6877
6885
|
switch (errorType) {
|
|
6878
6886
|
case "authentication_failed":
|
|
6879
|
-
return
|
|
6887
|
+
return `N\xE3o foi poss\xEDvel autenticar suas credenciais no sistema ${ssoProviderName}. Verifique suas permiss\xF5es e tente novamente.`;
|
|
6880
6888
|
case "invalid_state":
|
|
6881
6889
|
return "A sess\xE3o SSO \xE9 inv\xE1lida ou foi comprometida. Por seguran\xE7a, o login foi cancelado.";
|
|
6882
6890
|
case "token_expired":
|
|
@@ -6893,14 +6901,14 @@ var SSOError = memo(({
|
|
|
6893
6901
|
switch (errorType) {
|
|
6894
6902
|
case "authentication_failed":
|
|
6895
6903
|
return [
|
|
6896
|
-
|
|
6904
|
+
`Verifique se voc\xEA tem acesso ao sistema ${ssoProviderName}`,
|
|
6897
6905
|
"Confirme se suas credenciais est\xE3o corretas",
|
|
6898
6906
|
"Entre em contato com o administrador se o problema persistir"
|
|
6899
6907
|
];
|
|
6900
6908
|
case "invalid_state":
|
|
6901
6909
|
return [
|
|
6902
6910
|
"Limpe os cookies do navegador",
|
|
6903
|
-
|
|
6911
|
+
`Feche todas as abas de ${appName} e ${ssoProviderName}`,
|
|
6904
6912
|
"Inicie um novo processo de login SSO"
|
|
6905
6913
|
];
|
|
6906
6914
|
case "token_expired":
|
|
@@ -6912,7 +6920,7 @@ var SSOError = memo(({
|
|
|
6912
6920
|
case "server_error":
|
|
6913
6921
|
return [
|
|
6914
6922
|
"Aguarde alguns minutos e tente novamente",
|
|
6915
|
-
|
|
6923
|
+
`Verifique se o servi\xE7o ${ssoProviderName} est\xE1 funcionando`,
|
|
6916
6924
|
"Use o login tradicional como alternativa"
|
|
6917
6925
|
];
|
|
6918
6926
|
case "tenant_mismatch":
|
|
@@ -6954,7 +6962,7 @@ var SSOError = memo(({
|
|
|
6954
6962
|
}, [onBackToLogin]);
|
|
6955
6963
|
const handleContactSupport = useCallback(() => {
|
|
6956
6964
|
onContactSupport?.();
|
|
6957
|
-
window.open(
|
|
6965
|
+
window.open(`mailto:${supportEmail}?subject=Erro SSO&body=` + encodeURIComponent(
|
|
6958
6966
|
`Erro SSO
|
|
6959
6967
|
|
|
6960
6968
|
Tipo: ${errorType}
|
|
@@ -6963,7 +6971,7 @@ Tenant: ${tenantId}
|
|
|
6963
6971
|
C\xF3digo: ${errorCode}
|
|
6964
6972
|
Detalhes: ${details}`
|
|
6965
6973
|
), "_blank");
|
|
6966
|
-
}, [onContactSupport, errorType, message, tenantId, errorCode, details]);
|
|
6974
|
+
}, [onContactSupport, errorType, message, tenantId, errorCode, details, supportEmail]);
|
|
6967
6975
|
return /* @__PURE__ */ jsx("div", { className: `min-h-screen flex items-center justify-center p-4 bg-muted/30 ${className}`, children: /* @__PURE__ */ jsxs(Card, { className: "w-full max-w-2xl shadow-lg", children: [
|
|
6968
6976
|
/* @__PURE__ */ jsxs(CardHeader, { className: "text-center pb-4", children: [
|
|
6969
6977
|
/* @__PURE__ */ jsx("div", { className: "flex justify-center mb-4", children: getErrorIcon() }),
|
|
@@ -7068,7 +7076,8 @@ var SSOLoginButton = memo(({
|
|
|
7068
7076
|
onLoginError,
|
|
7069
7077
|
hideAlternativeLogin = false,
|
|
7070
7078
|
ssoLoginUrl,
|
|
7071
|
-
apiBaseUrl = "http://localhost:8000"
|
|
7079
|
+
apiBaseUrl = "http://localhost:8000",
|
|
7080
|
+
ssoProviderName = "SSO"
|
|
7072
7081
|
}) => {
|
|
7073
7082
|
const [isInitiating, setIsInitiating] = useState(false);
|
|
7074
7083
|
const handleSSOLogin = useCallback(async () => {
|
|
@@ -7150,7 +7159,7 @@ var SSOLoginButton = memo(({
|
|
|
7150
7159
|
children: [
|
|
7151
7160
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-3", children: [
|
|
7152
7161
|
isLoading ? /* @__PURE__ */ jsx("div", { className: "icon-size animate-spin rounded-full border-2 border-background border-t-foreground" }) : /* @__PURE__ */ jsx(Shield, { className: "icon-size" }),
|
|
7153
|
-
/* @__PURE__ */ jsx("span", { className: "font-medium", children: isLoading ? "Iniciando SSO..." :
|
|
7162
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: isLoading ? "Iniciando SSO..." : `Entrar com ${ssoProviderName}` })
|
|
7154
7163
|
] }),
|
|
7155
7164
|
isLoading && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-background/50 backdrop-blur-sm" })
|
|
7156
7165
|
]
|
|
@@ -10390,7 +10399,8 @@ var SendMessageModal = ({
|
|
|
10390
10399
|
onClose,
|
|
10391
10400
|
config: initialConfig,
|
|
10392
10401
|
configs = [],
|
|
10393
|
-
defaultPhone = ""
|
|
10402
|
+
defaultPhone = "",
|
|
10403
|
+
appName = "Sistema"
|
|
10394
10404
|
}) => {
|
|
10395
10405
|
const { sendMessage, isSending, validatePhoneNumber } = useWhatsApp();
|
|
10396
10406
|
const [selectedConfig, setSelectedConfig] = useState(initialConfig || null);
|
|
@@ -10778,7 +10788,7 @@ var SendMessageModal = ({
|
|
|
10778
10788
|
variant: "acorde",
|
|
10779
10789
|
value: locationName,
|
|
10780
10790
|
onChange: (e) => setLocationName(e.target.value),
|
|
10781
|
-
placeholder:
|
|
10791
|
+
placeholder: appName,
|
|
10782
10792
|
className: "mt-1"
|
|
10783
10793
|
}
|
|
10784
10794
|
)
|