@flowtomic/ui 0.1.10 → 0.1.11
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/blocks/developer-panel/page.js +1 -1
- package/dist/components/atoms/actions/badge/badge.d.ts +2 -2
- package/dist/components/atoms/actions/button/button.d.ts +2 -2
- package/dist/components/atoms/animation/encrypted-text/encrypted-text.js +1 -1
- package/dist/components/atoms/data-display/qr-code/qr-code.d.ts +1 -1
- package/dist/components/atoms/feedback/alert/alert.d.ts +1 -1
- package/dist/components/atoms/feedback/alert-dialog/alert-dialog.d.ts +2 -2
- package/dist/components/atoms/feedback/tooltip/tooltip.js +3 -3
- package/dist/components/atoms/forms/input/input.d.ts +1 -1
- package/dist/components/atoms/forms/toggle/toggle.d.ts +2 -2
- package/dist/components/atoms/layout/sidebar/sidebar.d.ts +2 -2
- package/dist/components/atoms/navigation/command/command.d.ts +7 -7
- package/dist/components/molecules/forms/autocomplete/autocomplete-context.d.ts +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete-context.d.ts.map +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/molecules/forms/autocomplete/autocomplete.js +2 -2
- package/dist/components/molecules/forms/item/item.d.ts +2 -2
- package/dist/components/molecules/forms/text-editor/text-editor.js +1 -1
- package/dist/components/molecules/navigation/menu-dock/menu-dock.d.ts.map +1 -1
- package/dist/components/molecules/navigation/menu-dock/menu-dock.js +24 -27
- package/dist/components/organisms/document-editor/document-editor.js +1 -1
- package/dist/components/organisms/model-selector/model-selector.d.ts +1 -1
- package/dist/components/organisms/widget-config-modal/widget-config-modal.js +3 -3
- package/dist/components/organisms/widget-palette/widget-palette.d.ts.map +1 -1
- package/dist/components/organisms/widget-palette/widget-palette.js +1 -1
- package/dist/index.js +464 -464
- package/package.json +2 -2
|
@@ -31,5 +31,5 @@ export default function DeveloperPanel({ user, health, systemInfo, environmentIn
|
|
|
31
31
|
if (loading) {
|
|
32
32
|
return (_jsx("div", { className: "container mx-auto p-6", children: _jsx("div", { className: "flex items-center justify-center h-64", children: _jsx("p", { className: "text-muted-foreground", children: "Carregando informa\u00E7\u00F5es do sistema..." }) }) }));
|
|
33
33
|
}
|
|
34
|
-
return (_jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-3xl font-bold", children: "Painel de Desenvolvedor" }), _jsx("p", { className: "text-muted-foreground mt-2", children: "Informa\u00E7\u00F5es t\u00E9cnicas e ferramentas de desenvolvimento" })] }), _jsx(Badge, { variant: "outline", className: "text-lg px-4 py-2", children: user?.isAdmin ? "ADMIN" : "USER" })] }), error && (_jsxs(Card, { className: "border-destructive", children: [_jsx(CardHeader, { children: _jsx(CardTitle, { className: "text-destructive", children: "Erro" }) }), _jsx(CardContent, { children: _jsx("p", { children: error }) })] })), _jsxs(Tabs, { defaultValue: "info", className: "w-full", children: [_jsxs(TabsList, { className: "grid w-full grid-cols-2 mb-6", children: [_jsxs(TabsTrigger, { value: "info", className: "flex items-center gap-2", children: [_jsx(Info, { className: "h-4 w-4" }), "Informa\u00E7\u00F5es do Sistema"] }), _jsxs(TabsTrigger, { value: "editor", className: "flex items-center gap-2", children: [_jsx(Code, { className: "h-4 w-4" }), "Editor de Scripts"] })] }), _jsx(TabsContent, { value: "info", className: "space-y-6", children: _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Usu\u00E1rio Atual" }), _jsx(CardDescription, { children: "Informa\u00E7\u00F5es da sess\u00E3o atual" })] }), _jsxs(CardContent, { className: "space-y-2", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Nome" }), _jsx("p", { className: "font-medium", children: user?.username || "N/A" })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Email" }), _jsx("p", { className: "font-medium", children: user?.email || "N/A" })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Role" }), _jsx(Badge, { variant: user?.isAdmin ? "default" : "secondary", children: user?.role || "N/A" })] }), user?.token && (_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Token" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("code", { className: "text-xs bg-muted px-2 py-1 rounded flex-1 truncate", children: [user.token.substring(0, 20), "..."] }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => copyToClipboard(user.token, "token"), children: copiedText === "token" ? "Copiado!" : "Copiar" })] })] }))] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Status do Sistema" }), _jsx(CardDescription, { children: "Health check da API" })] }), _jsx(CardContent, { className: "space-y-2", children: health ? (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Status" }), _jsx(Badge, { variant: health.status === "UP" ? "default" : "destructive", children: health.status })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Servi\u00E7o" }), _jsx("p", { className: "font-medium", children: health.service })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Timestamp" }), _jsx("p", { className: "font-medium text-xs", children: new Date(health.timestamp).toLocaleString("pt-BR") })] })] })) : (_jsx("p", { className: "text-muted-foreground", children: "N\u00E3o dispon\u00EDvel" })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Informa\u00E7\u00F5es da Aplica\u00E7\u00E3o" }), _jsx(CardDescription, { children: "Vers\u00E3o e detalhes do sistema" })] }), _jsx(CardContent, { className: "space-y-2", children: systemInfo ? (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Nome" }), _jsx("p", { className: "font-medium", children: systemInfo.name })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Vers\u00E3o" }), _jsx(Badge, { variant: "outline", children: systemInfo.version })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Descri\u00E7\u00E3o" }), _jsx("p", { className: "font-medium text-sm", children: systemInfo.description })] })] })) : (_jsx("p", { className: "text-muted-foreground", children: "N\u00E3o dispon\u00EDvel" })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Ambiente Frontend" }), _jsx(CardDescription, { children: "Configura\u00E7\u00F5es do cliente" })] }), _jsx(CardContent, { className: "space-y-2", children: environmentInfo ? (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "API Base URL" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { className: "text-xs bg-muted px-2 py-1 rounded flex-1 truncate", children: environmentInfo.apiBaseUrl }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => copyToClipboard(environmentInfo.apiBaseUrl, "apiUrl"), children: copiedText === "apiUrl" ? "Copiado!" : "Copiar" })] })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Modo" }), _jsx(Badge, { variant: "outline", children: environmentInfo.nodeEnv })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Timezone" }), _jsx("p", { className: "font-medium text-xs", children: environmentInfo.timezone })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Resolu\u00E7\u00E3o" }), _jsx("p", { className: "font-medium text-xs", children: environmentInfo.screenResolution })] })] })) : (_jsx("p", { className: "text-muted-foreground", children: "N\u00E3o dispon\u00EDvel" })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Ferramentas" }), _jsx(CardDescription, { children: "Acesso r\u00E1pido a ferramentas de desenvolvimento" })] }), _jsxs(CardContent, { className: "space-y-2", children: [_jsx(Button, { variant: "outline", className: "w-full justify-start", onClick: onOpenSwagger || defaultOpenSwagger, children: "\uD83D\uDCDA Abrir Swagger UI" }), _jsx(Button, { variant: "outline", className: "w-full justify-start", onClick: onOpenApiDocs || defaultOpenApiDocs, children: "\uD83D\uDCD6 Abrir API Docs (JSON)" }), _jsx(Button, { variant: "outline", className: "w-full justify-start", onClick: onOpenHealthCheck || defaultOpenHealthCheck, children: "\u2764\uFE0F Health Check" })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Navegador" }), _jsx(CardDescription, { children: "Informa\u00E7\u00F5es do cliente web" })] }), _jsx(CardContent, { className: "space-y-2", children: environmentInfo ? (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "User Agent" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("code", { className: "text-xs bg-muted px-2 py-1 rounded flex-1 truncate", children: [environmentInfo.userAgent.substring(0, 50), "..."] }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => copyToClipboard(environmentInfo.userAgent, "userAgent"), children: copiedText === "userAgent" ? "Copiado!" : "Copiar" })] })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Timestamp" }), _jsx("p", { className: "font-medium text-xs", children: new Date(environmentInfo.timestamp).toLocaleString("pt-BR") })] })] })) : (_jsx("p", { className: "text-muted-foreground", children: "N\u00E3o dispon\u00EDvel" })) })] })] }) }), _jsx(TabsContent, { value: "editor", className: "space-y-6", children: _jsx(ScriptEditor, { ...scriptEditorProps }) })] })] }));
|
|
34
|
+
return (_jsxs("div", { className: "container mx-auto p-6 space-y-6", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-3xl font-bold", children: "Painel de Desenvolvedor" }), _jsx("p", { className: "text-muted-foreground mt-2", children: "Informa\u00E7\u00F5es t\u00E9cnicas e ferramentas de desenvolvimento" })] }), _jsx(Badge, { variant: "outline", className: "text-lg px-4 py-2", children: user?.isAdmin ? "ADMIN" : "USER" })] }), error && (_jsxs(Card, { className: "border-destructive", children: [_jsx(CardHeader, { children: _jsx(CardTitle, { className: "text-destructive", children: "Erro" }) }), _jsx(CardContent, { children: _jsx("p", { children: error }) })] })), _jsxs(Tabs, { defaultValue: "info", className: "w-full", children: [_jsxs(TabsList, { className: "grid w-full grid-cols-2 mb-6", children: [_jsxs(TabsTrigger, { value: "info", className: "flex items-center gap-2", children: [_jsx(Info, { className: "h-4 w-4" }), "Informa\u00E7\u00F5es do Sistema"] }), _jsxs(TabsTrigger, { value: "editor", className: "flex items-center gap-2", children: [_jsx(Code, { className: "h-4 w-4" }), "Editor de Scripts"] })] }), _jsx(TabsContent, { value: "info", className: "space-y-6", children: _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Usu\u00E1rio Atual" }), _jsx(CardDescription, { children: "Informa\u00E7\u00F5es da sess\u00E3o atual" })] }), _jsxs(CardContent, { className: "space-y-2", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Nome" }), _jsx("p", { className: "font-medium", children: user?.username || "N/A" })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Email" }), _jsx("p", { className: "font-medium", children: user?.email || "N/A" })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Role" }), _jsx(Badge, { variant: user?.isAdmin ? "default" : "secondary", children: user?.role || "N/A" })] }), user?.token && (_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Token" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("code", { className: "text-xs bg-muted px-2 py-1 rounded flex-1 truncate", children: [user.token.substring(0, 20), "..."] }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => user.token && copyToClipboard(user.token, "token"), children: copiedText === "token" ? "Copiado!" : "Copiar" })] })] }))] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Status do Sistema" }), _jsx(CardDescription, { children: "Health check da API" })] }), _jsx(CardContent, { className: "space-y-2", children: health ? (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Status" }), _jsx(Badge, { variant: health.status === "UP" ? "default" : "destructive", children: health.status })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Servi\u00E7o" }), _jsx("p", { className: "font-medium", children: health.service })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Timestamp" }), _jsx("p", { className: "font-medium text-xs", children: new Date(health.timestamp).toLocaleString("pt-BR") })] })] })) : (_jsx("p", { className: "text-muted-foreground", children: "N\u00E3o dispon\u00EDvel" })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Informa\u00E7\u00F5es da Aplica\u00E7\u00E3o" }), _jsx(CardDescription, { children: "Vers\u00E3o e detalhes do sistema" })] }), _jsx(CardContent, { className: "space-y-2", children: systemInfo ? (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Nome" }), _jsx("p", { className: "font-medium", children: systemInfo.name })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Vers\u00E3o" }), _jsx(Badge, { variant: "outline", children: systemInfo.version })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Descri\u00E7\u00E3o" }), _jsx("p", { className: "font-medium text-sm", children: systemInfo.description })] })] })) : (_jsx("p", { className: "text-muted-foreground", children: "N\u00E3o dispon\u00EDvel" })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Ambiente Frontend" }), _jsx(CardDescription, { children: "Configura\u00E7\u00F5es do cliente" })] }), _jsx(CardContent, { className: "space-y-2", children: environmentInfo ? (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "API Base URL" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { className: "text-xs bg-muted px-2 py-1 rounded flex-1 truncate", children: environmentInfo.apiBaseUrl }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => copyToClipboard(environmentInfo.apiBaseUrl, "apiUrl"), children: copiedText === "apiUrl" ? "Copiado!" : "Copiar" })] })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Modo" }), _jsx(Badge, { variant: "outline", children: environmentInfo.nodeEnv })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Timezone" }), _jsx("p", { className: "font-medium text-xs", children: environmentInfo.timezone })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Resolu\u00E7\u00E3o" }), _jsx("p", { className: "font-medium text-xs", children: environmentInfo.screenResolution })] })] })) : (_jsx("p", { className: "text-muted-foreground", children: "N\u00E3o dispon\u00EDvel" })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Ferramentas" }), _jsx(CardDescription, { children: "Acesso r\u00E1pido a ferramentas de desenvolvimento" })] }), _jsxs(CardContent, { className: "space-y-2", children: [_jsx(Button, { variant: "outline", className: "w-full justify-start", onClick: onOpenSwagger || defaultOpenSwagger, children: "\uD83D\uDCDA Abrir Swagger UI" }), _jsx(Button, { variant: "outline", className: "w-full justify-start", onClick: onOpenApiDocs || defaultOpenApiDocs, children: "\uD83D\uDCD6 Abrir API Docs (JSON)" }), _jsx(Button, { variant: "outline", className: "w-full justify-start", onClick: onOpenHealthCheck || defaultOpenHealthCheck, children: "\u2764\uFE0F Health Check" })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: "Navegador" }), _jsx(CardDescription, { children: "Informa\u00E7\u00F5es do cliente web" })] }), _jsx(CardContent, { className: "space-y-2", children: environmentInfo ? (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "User Agent" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("code", { className: "text-xs bg-muted px-2 py-1 rounded flex-1 truncate", children: [environmentInfo.userAgent.substring(0, 50), "..."] }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => copyToClipboard(environmentInfo.userAgent, "userAgent"), children: copiedText === "userAgent" ? "Copiado!" : "Copiar" })] })] }), _jsxs("div", { children: [_jsx("p", { className: "text-sm text-muted-foreground", children: "Timestamp" }), _jsx("p", { className: "font-medium text-xs", children: new Date(environmentInfo.timestamp).toLocaleString("pt-BR") })] })] })) : (_jsx("p", { className: "text-muted-foreground", children: "N\u00E3o dispon\u00EDvel" })) })] })] }) }), _jsx(TabsContent, { value: "editor", className: "space-y-6", children: _jsx(ScriptEditor, { ...scriptEditorProps }) })] })] }));
|
|
35
35
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import React from "react";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
5
|
-
size?: "
|
|
4
|
+
variant?: "outline" | "default" | "success" | "destructive" | "secondary" | "info" | "warning" | null | undefined;
|
|
5
|
+
size?: "sm" | "lg" | "md" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
8
8
|
children: React.ReactNode;
|
|
@@ -2,8 +2,8 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { type Transition } from "motion/react";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "link" | "
|
|
6
|
-
size?: "
|
|
5
|
+
variant?: "link" | "outline" | "default" | "success" | "destructive" | "secondary" | "ghost" | "info" | "natural" | null | undefined;
|
|
6
|
+
size?: "sm" | "default" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "transition">, VariantProps<typeof buttonVariants> {
|
|
9
9
|
asChild?: boolean;
|
|
@@ -92,7 +92,7 @@ export const EncryptedText = ({ text, className, revealDelayMs = 50, charset = D
|
|
|
92
92
|
}, [isInView, text, revealDelayMs, charset, flipDelayMs]);
|
|
93
93
|
if (!text)
|
|
94
94
|
return null;
|
|
95
|
-
return (_jsx(motion.span, { ref: ref, className: cn(className), "aria-label": text,
|
|
95
|
+
return (_jsx(motion.span, { ref: ref, className: cn(className), "aria-label": text, children: text.split("").map((char, index) => {
|
|
96
96
|
const isRevealed = index < revealCount;
|
|
97
97
|
const displayChar = isRevealed
|
|
98
98
|
? char
|
|
@@ -2,7 +2,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { type Options as QRCodeStylingOptions } from "qr-code-styling";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
declare const qrCodeRootVariants: (props?: ({
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "lg" | "md" | null | undefined;
|
|
6
6
|
animated?: boolean | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export interface QRCodeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof qrCodeRootVariants> {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { type VariantProps } from "class-variance-authority";
|
|
15
15
|
import * as React from "react";
|
|
16
16
|
declare const alertVariants: (props?: ({
|
|
17
|
-
variant?: "default" | "
|
|
17
|
+
variant?: "default" | "success" | "destructive" | "info" | "warning" | null | undefined;
|
|
18
18
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
19
|
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
20
20
|
}
|
|
@@ -19,7 +19,7 @@ export type AlertDialogTriggerProps = React.ComponentPropsWithoutRef<typeof Aler
|
|
|
19
19
|
* Variantes de animação para AlertDialogContent
|
|
20
20
|
*/
|
|
21
21
|
declare const alertDialogContentVariants: (props?: ({
|
|
22
|
-
animation?: "center" | "
|
|
22
|
+
animation?: "center" | "top" | "right" | "bottom" | "left" | "depth" | "3d" | null | undefined;
|
|
23
23
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
24
|
export type AlertDialogContentProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & VariantProps<typeof alertDialogContentVariants> & {
|
|
25
25
|
/**
|
|
@@ -61,7 +61,7 @@ declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDial
|
|
|
61
61
|
* Suporta animações 3D quando animation="3d"
|
|
62
62
|
*/
|
|
63
63
|
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & VariantProps<(props?: ({
|
|
64
|
-
animation?: "center" | "
|
|
64
|
+
animation?: "center" | "top" | "right" | "bottom" | "left" | "depth" | "3d" | null | undefined;
|
|
65
65
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
66
66
|
/**
|
|
67
67
|
* Habilita backdrop blur (apenas para animation="3d")
|
|
@@ -52,7 +52,7 @@ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
|
52
52
|
* Este componente não renderiza nada - o tooltip é renderizado via portal
|
|
53
53
|
* O estado é gerenciado pelo TooltipWithMouseFollowWrapper
|
|
54
54
|
*/
|
|
55
|
-
const TooltipContentWithMouseFollow = React.forwardRef(({ className, minWidth, children, ...
|
|
55
|
+
const TooltipContentWithMouseFollow = React.forwardRef(({ className: _className, minWidth: _minWidth, children: _children, ..._props }, _ref) => {
|
|
56
56
|
// Este componente não renderiza - o tooltip é gerenciado pelo wrapper
|
|
57
57
|
return null;
|
|
58
58
|
});
|
|
@@ -92,7 +92,7 @@ export function TooltipWithMouseFollow({ content, children, containerClassName,
|
|
|
92
92
|
});
|
|
93
93
|
return () => cancelAnimationFrame(rafId1);
|
|
94
94
|
}
|
|
95
|
-
}, [isVisible
|
|
95
|
+
}, [isVisible]);
|
|
96
96
|
const calculatePosition = React.useCallback((mouseX, mouseY) => {
|
|
97
97
|
if (!contentRef.current || !containerRef.current) {
|
|
98
98
|
return { x: mouseX + 12, y: mouseY + 12 };
|
|
@@ -196,7 +196,7 @@ export function TooltipWithMouseFollow({ content, children, containerClassName,
|
|
|
196
196
|
setPosition(newPosition);
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
|
-
}, [isVisible,
|
|
199
|
+
}, [isVisible, mouse.x, mouse.y, calculatePosition]);
|
|
200
200
|
return (_jsxs("div", { ref: containerRef, className: cn("relative inline-block", containerClassName), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseMove: handleMouseMove, onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, onClick: handleClick, children: [children, _jsx(AnimatePresence, { children: isVisible && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height, opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: {
|
|
201
201
|
type: "spring",
|
|
202
202
|
stiffness: 200,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import React from "react";
|
|
3
3
|
declare const inputVariants: (props?: ({
|
|
4
|
-
size?: "
|
|
4
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
5
5
|
variant?: "default" | "error" | "success" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof inputVariants> {
|
|
@@ -2,8 +2,8 @@ import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
import type * as React from "react";
|
|
4
4
|
declare const toggleVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
6
|
-
size?: "
|
|
5
|
+
variant?: "outline" | "default" | null | undefined;
|
|
6
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export interface ToggleProps extends React.ComponentProps<typeof TogglePrimitive.Root>, VariantProps<typeof toggleVariants> {
|
|
9
9
|
}
|
|
@@ -106,8 +106,8 @@ declare namespace SidebarMenuItem {
|
|
|
106
106
|
var displayName: string;
|
|
107
107
|
}
|
|
108
108
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
109
|
-
variant?: "
|
|
110
|
-
size?: "
|
|
109
|
+
variant?: "outline" | "default" | null | undefined;
|
|
110
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
111
111
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
112
112
|
export interface SidebarMenuButtonProps extends React.ComponentProps<"button">, VariantProps<typeof sidebarMenuButtonVariants> {
|
|
113
113
|
asChild?: boolean;
|
|
@@ -23,7 +23,7 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
|
23
23
|
ref?: React.Ref<HTMLDivElement>;
|
|
24
24
|
} & {
|
|
25
25
|
asChild?: boolean;
|
|
26
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
26
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
27
27
|
label?: string;
|
|
28
28
|
shouldFilter?: boolean;
|
|
29
29
|
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
@@ -48,7 +48,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
|
|
|
48
48
|
ref?: React.Ref<HTMLInputElement>;
|
|
49
49
|
} & {
|
|
50
50
|
asChild?: boolean;
|
|
51
|
-
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "
|
|
51
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
52
52
|
value?: string;
|
|
53
53
|
onValueChange?: (search: string) => void;
|
|
54
54
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -61,7 +61,7 @@ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
|
61
61
|
ref?: React.Ref<HTMLDivElement>;
|
|
62
62
|
} & {
|
|
63
63
|
asChild?: boolean;
|
|
64
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
64
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
65
65
|
label?: string;
|
|
66
66
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
67
67
|
/**
|
|
@@ -73,7 +73,7 @@ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
|
73
73
|
ref?: React.Ref<HTMLDivElement>;
|
|
74
74
|
} & {
|
|
75
75
|
asChild?: boolean;
|
|
76
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
76
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
77
77
|
/**
|
|
78
78
|
* CommandGroup - Grupo do command
|
|
79
79
|
*/
|
|
@@ -83,7 +83,7 @@ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
|
83
83
|
ref?: React.Ref<HTMLDivElement>;
|
|
84
84
|
} & {
|
|
85
85
|
asChild?: boolean;
|
|
86
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
86
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
|
|
87
87
|
heading?: React.ReactNode;
|
|
88
88
|
value?: string;
|
|
89
89
|
forceMount?: boolean;
|
|
@@ -95,7 +95,7 @@ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<R
|
|
|
95
95
|
ref?: React.Ref<HTMLDivElement>;
|
|
96
96
|
} & {
|
|
97
97
|
asChild?: boolean;
|
|
98
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
98
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
99
99
|
alwaysRender?: boolean;
|
|
100
100
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
101
101
|
/**
|
|
@@ -107,7 +107,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
|
107
107
|
ref?: React.Ref<HTMLDivElement>;
|
|
108
108
|
} & {
|
|
109
109
|
asChild?: boolean;
|
|
110
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement
|
|
110
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
|
|
111
111
|
disabled?: boolean;
|
|
112
112
|
onSelect?: (value: string) => void;
|
|
113
113
|
value?: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Fornece estado e helpers do hook useAutocomplete para subcomponentes
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import type { UseAutocompleteReturn } from "flowtomic/logic";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
export interface AutocompleteContextValue extends UseAutocompleteReturn {
|
|
9
9
|
size?: "sm" | "default" | "lg";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-context.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"autocomplete-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete-context.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACrE,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB,qDAE/B,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,wBAAwB,CAMjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,iBAAiB,CAAC;AAI3E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/forms/autocomplete/autocomplete.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,iBAAiB,CAAC;AAI3E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,MAAM,WAAW,iBACf,SAAQ,IAAI,CACV,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,CAC/C;IAED,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAEpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA4OD,eAAO,MAAM,YAAY;;;;;;CAMvB,CAAC"}
|
|
@@ -18,7 +18,7 @@ import { Spinner } from "../../../atoms/animation/spinner/spinner";
|
|
|
18
18
|
import { Popover, PopoverContent, PopoverTrigger } from "../../../atoms/feedback/popover/popover";
|
|
19
19
|
import { inputVariants } from "../../../atoms/forms/input/input";
|
|
20
20
|
// Context/Composição
|
|
21
|
-
import { AutocompleteContext
|
|
21
|
+
import { AutocompleteContext } from "./autocomplete-context";
|
|
22
22
|
import { AutocompleteItem } from "./autocomplete-item";
|
|
23
23
|
import { AutocompleteSection } from "./autocomplete-section";
|
|
24
24
|
const AutocompleteRoot = React.forwardRef(({ options = [], value: controlledValue, defaultValue, onValueChange, placeholder = "Selecione uma opção...", disabled = false, size = "default", className, inputClassName, emptyMessage = "Nenhum resultado encontrado.", filterFunction, allowCustomValue = false, isLoading = false, maxListboxHeight = "300px", children, id, ...props }, ref) => {
|
|
@@ -36,7 +36,7 @@ const AutocompleteRoot = React.forwardRef(({ options = [], value: controlledValu
|
|
|
36
36
|
emptyMessage,
|
|
37
37
|
children: useComposition ? children : undefined,
|
|
38
38
|
});
|
|
39
|
-
const { inputValue, selectedValue, isOpen, filteredItems, getInputProps, getPopoverProps, getListProps, getItemProps, open, close, clear, } = hookReturn;
|
|
39
|
+
const { inputValue: _inputValue, selectedValue, isOpen, filteredItems, getInputProps, getPopoverProps, getListProps, getItemProps, open: _open, close: _close, clear, } = hookReturn;
|
|
40
40
|
// Input props
|
|
41
41
|
const inputProps = getInputProps({
|
|
42
42
|
...props,
|
|
@@ -13,8 +13,8 @@ declare namespace ItemSeparator {
|
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
15
15
|
declare const itemVariants: (props?: ({
|
|
16
|
-
variant?: "
|
|
17
|
-
size?: "
|
|
16
|
+
variant?: "outline" | "default" | "muted" | null | undefined;
|
|
17
|
+
size?: "sm" | "default" | null | undefined;
|
|
18
18
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
19
|
export interface ItemProps extends React.ComponentProps<"div">, VariantProps<typeof itemVariants> {
|
|
20
20
|
asChild?: boolean;
|
|
@@ -73,7 +73,7 @@ function useMarkdownState(controlled, initial) {
|
|
|
73
73
|
const isControlled = controlled !== undefined;
|
|
74
74
|
const [value, setValue] = React.useState(initial);
|
|
75
75
|
React.useEffect(() => {
|
|
76
|
-
if (isControlled)
|
|
76
|
+
if (isControlled && controlled !== undefined)
|
|
77
77
|
setValue(controlled);
|
|
78
78
|
}, [controlled, isControlled]);
|
|
79
79
|
return { value, setValue, isControlled };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-dock.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/navigation/menu-dock/menu-dock.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAUD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"menu-dock.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/navigation/menu-dock/menu-dock.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAUD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAsM5C,CAAC"}
|
|
@@ -27,37 +27,14 @@ export const MenuDock = ({ items, className, variant = "default", orientation =
|
|
|
27
27
|
}
|
|
28
28
|
return items;
|
|
29
29
|
}, [items]);
|
|
30
|
-
//
|
|
31
|
-
if (animationType === "floating") {
|
|
32
|
-
return (_jsx(FloatingDock, { items: finalItems.map((item) => ({
|
|
33
|
-
title: item.label,
|
|
34
|
-
icon: _jsx(item.icon, { className: "h-full w-full" }),
|
|
35
|
-
href: item.href || item.path || "#",
|
|
36
|
-
onClick: item.onClick,
|
|
37
|
-
})), desktopClassName: desktopClassName, mobileClassName: mobileClassName, className: className }));
|
|
38
|
-
}
|
|
39
|
-
// Animação default (comportamento original)
|
|
30
|
+
// Todos os hooks devem ser chamados antes de qualquer return condicional
|
|
40
31
|
const [internalActiveIndex, setInternalActiveIndex] = useState(defaultActiveIndex);
|
|
41
|
-
// Usar índice controlado se fornecido, caso contrário usar estado interno
|
|
42
32
|
const isControlled = controlledActiveIndex !== undefined;
|
|
43
33
|
const activeIndex = isControlled ? controlledActiveIndex : internalActiveIndex;
|
|
44
|
-
const setActiveIndex = (index) => {
|
|
45
|
-
if (!isControlled) {
|
|
46
|
-
setInternalActiveIndex(index);
|
|
47
|
-
}
|
|
48
|
-
onActiveIndexChange?.(index);
|
|
49
|
-
};
|
|
50
34
|
const containerRef = useRef(null);
|
|
51
35
|
const shouldReduceMotion = useReducedMotion();
|
|
52
|
-
// Para o underline, precisamos rastrear o texto, não o botão
|
|
53
36
|
const textRefs = useRef([]);
|
|
54
37
|
const buttonRefs = useRef([]);
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (activeIndex >= finalItems.length && !isControlled) {
|
|
57
|
-
setInternalActiveIndex(0);
|
|
58
|
-
}
|
|
59
|
-
}, [finalItems, activeIndex, isControlled]);
|
|
60
|
-
// Usar o hook apenas quando showLabels e horizontal
|
|
61
38
|
const shouldUseIndicator = showLabels && orientation === "horizontal";
|
|
62
39
|
const { indicatorStyle, registerElement, unregisterElement } = useAnimatedIndicator({
|
|
63
40
|
containerRef: containerRef,
|
|
@@ -66,11 +43,22 @@ export const MenuDock = ({ items, className, variant = "default", orientation =
|
|
|
66
43
|
getElementValue: (element) => {
|
|
67
44
|
return element.getAttribute("data-index") || "";
|
|
68
45
|
},
|
|
69
|
-
updateOnResize: shouldUseIndicator,
|
|
46
|
+
updateOnResize: shouldUseIndicator && animationType === "default",
|
|
70
47
|
});
|
|
48
|
+
const setActiveIndex = (index) => {
|
|
49
|
+
if (!isControlled) {
|
|
50
|
+
setInternalActiveIndex(index);
|
|
51
|
+
}
|
|
52
|
+
onActiveIndexChange?.(index);
|
|
53
|
+
};
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (animationType === "default" && activeIndex >= finalItems.length && !isControlled) {
|
|
56
|
+
setInternalActiveIndex(0);
|
|
57
|
+
}
|
|
58
|
+
}, [finalItems, activeIndex, isControlled, animationType]);
|
|
71
59
|
// Registrar elementos quando shouldUseIndicator mudar ou items mudarem
|
|
72
60
|
useEffect(() => {
|
|
73
|
-
if (shouldUseIndicator) {
|
|
61
|
+
if (animationType === "default" && shouldUseIndicator) {
|
|
74
62
|
textRefs.current.forEach((el, index) => {
|
|
75
63
|
if (el) {
|
|
76
64
|
registerElement(el, index.toString());
|
|
@@ -82,7 +70,16 @@ export const MenuDock = ({ items, className, variant = "default", orientation =
|
|
|
82
70
|
});
|
|
83
71
|
};
|
|
84
72
|
}
|
|
85
|
-
}, [shouldUseIndicator,
|
|
73
|
+
}, [shouldUseIndicator, registerElement, unregisterElement, animationType]);
|
|
74
|
+
// Se animationType for "floating", renderizar FloatingDock
|
|
75
|
+
if (animationType === "floating") {
|
|
76
|
+
return (_jsx(FloatingDock, { items: finalItems.map((item) => ({
|
|
77
|
+
title: item.label,
|
|
78
|
+
icon: _jsx(item.icon, { className: "h-full w-full" }),
|
|
79
|
+
href: item.href || item.path || "#",
|
|
80
|
+
onClick: item.onClick,
|
|
81
|
+
})), desktopClassName: desktopClassName, mobileClassName: mobileClassName, className: className }));
|
|
82
|
+
}
|
|
86
83
|
const sizeClasses = {
|
|
87
84
|
default: "p-3",
|
|
88
85
|
compact: "p-2",
|
|
@@ -126,7 +126,7 @@ export const DocumentEditor = React.forwardRef(({ title: controlledTitle, onTitl
|
|
|
126
126
|
if (activePage !== safeActivePage) {
|
|
127
127
|
handleActivePageChange(safeActivePage);
|
|
128
128
|
}
|
|
129
|
-
}, [activePage, safeActivePage]);
|
|
129
|
+
}, [activePage, safeActivePage, handleActivePageChange]);
|
|
130
130
|
if (!currentPage) {
|
|
131
131
|
return null; // Fallback de segurança
|
|
132
132
|
}
|
|
@@ -30,7 +30,7 @@ export declare const ModelSelectorInput: React.ForwardRefExoticComponent<Omit<Om
|
|
|
30
30
|
ref?: React.Ref<HTMLInputElement>;
|
|
31
31
|
} & {
|
|
32
32
|
asChild?: boolean;
|
|
33
|
-
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "
|
|
33
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
34
34
|
value?: string;
|
|
35
35
|
onValueChange?: (search: string) => void;
|
|
36
36
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -15,15 +15,15 @@ import { cn } from "@/lib/utils";
|
|
|
15
15
|
* formulários de configuração totalmente customizados.
|
|
16
16
|
*/
|
|
17
17
|
export function WidgetConfigModal({ open, widget, onSave, onClose, renderConfigForm, title, description, className, }) {
|
|
18
|
-
|
|
19
|
-
return null;
|
|
20
|
-
const [config, setConfig] = React.useState(widget.config || {});
|
|
18
|
+
const [config, setConfig] = React.useState(widget?.config || {});
|
|
21
19
|
// Atualiza config quando widget muda
|
|
22
20
|
React.useEffect(() => {
|
|
23
21
|
if (widget) {
|
|
24
22
|
setConfig(widget.config || {});
|
|
25
23
|
}
|
|
26
24
|
}, [widget]);
|
|
25
|
+
if (!widget)
|
|
26
|
+
return null;
|
|
27
27
|
const handleSave = () => {
|
|
28
28
|
onSave(widget.id, config);
|
|
29
29
|
onClose();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-palette.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/widget-palette/widget-palette.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAElD;;OAEG;IACH,WAAW,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsDD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,OAAO,EACP,KAA6B,EAC7B,WAA2D,EAC3D,SAAS,GACV,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"widget-palette.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/widget-palette/widget-palette.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAElD;;OAEG;IACH,WAAW,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsDD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,OAAO,EACP,KAA6B,EAC7B,WAA2D,EAC3D,SAAS,GACV,EAAE,kBAAkB,kDAkDpB"}
|
|
@@ -38,5 +38,5 @@ function DraggableWidgetItem({ widget }) {
|
|
|
38
38
|
export function WidgetPalette({ isOpen, widgets, onClose, title = "Widgets Disponíveis", description = "Arraste widgets para adicionar ao dashboard", className, }) {
|
|
39
39
|
if (!isOpen)
|
|
40
40
|
return null;
|
|
41
|
-
return (_jsxs("div", { className: cn("fixed right-0 top-0 h-full w-80 bg-background border-l border-border", "shadow-lg z-40 transition-transform duration-300", "flex flex-col", className), children: [_jsxs("div", { className: "p-4 border-b border-border", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }), onClose && (_jsx("button", { onClick: onClose, className: "p-1 rounded-md hover:bg-accent transition-colors", "aria-label": "Fechar paleta", children: _jsx(X, { className: "w-5 h-5" }) }))] }), _jsx("p", { className: "text-sm text-muted-foreground mt-1", children: description })] }), _jsx("div", { className: "flex-1 overflow-y-auto p-4 space-y-3", children: widgets.length === 0 ? (_jsx("div", { className: "text-center py-8 text-sm text-muted-foreground", children: "Nenhum widget dispon\u00EDvel" })) : (widgets.map((widget) => _jsx(DraggableWidgetItem, { widget: widget }, widget.id))) }), _jsx("div", { className: "p-4 border-t border-border bg-muted/50", children: _jsxs("p", { className: "text-xs text-muted-foreground text-center", children: [widgets.length, " ", widgets.length === 1 ? "widget" : "widgets", " dispon\u00EDvel", widgets.length !== 1 ? "eis" : ""] }) })] }));
|
|
41
|
+
return (_jsxs("div", { className: cn("fixed right-0 top-0 h-full w-80 bg-background border-l border-border", "shadow-lg z-40 transition-transform duration-300", "flex flex-col", className), children: [_jsxs("div", { className: "p-4 border-b border-border", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }), onClose && (_jsx("button", { type: "button", onClick: onClose, className: "p-1 rounded-md hover:bg-accent transition-colors", "aria-label": "Fechar paleta", children: _jsx(X, { className: "w-5 h-5" }) }))] }), _jsx("p", { className: "text-sm text-muted-foreground mt-1", children: description })] }), _jsx("div", { className: "flex-1 overflow-y-auto p-4 space-y-3", children: widgets.length === 0 ? (_jsx("div", { className: "text-center py-8 text-sm text-muted-foreground", children: "Nenhum widget dispon\u00EDvel" })) : (widgets.map((widget) => _jsx(DraggableWidgetItem, { widget: widget }, widget.id))) }), _jsx("div", { className: "p-4 border-t border-border bg-muted/50", children: _jsxs("p", { className: "text-xs text-muted-foreground text-center", children: [widgets.length, " ", widgets.length === 1 ? "widget" : "widgets", " dispon\u00EDvel", widgets.length !== 1 ? "eis" : ""] }) })] }));
|
|
42
42
|
}
|