Compare commits

..

No commits in common. "main" and "main_bk_2" have entirely different histories.

676 changed files with 5717 additions and 9032 deletions

View file

@ -1,11 +1,13 @@
{
"folders": [{ "path": "D:/IIS/Orius/app" }],
"folders": [
{ "path": "D:/IIS/Orius/app" }
],
"settings": {
// === GERAL ===
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit",
"source.organizeImports": "explicit"
},
"editor.formatOnPaste": false,
"editor.formatOnType": false,
@ -21,48 +23,53 @@
"**/dist/**": true,
"**/build/**": true,
"**/.next/**": true,
"**/.git/**": true,
"**/.git/**": true
},
"search.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/.next": true,
"**/.git": true,
"**/.git": true
},
// === FRONTEND ===
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features",
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features",
"editor.defaultFormatter": "vscode.typescript-language-features"
},
// === TAILWIND ===
"files.associations": {
"*.css": "tailwindcss",
"*.css": "tailwindcss"
},
"tailwindCSS.includeLanguages": {
"plaintext": "html",
"javascript": "javascript",
"typescriptreact": "typescriptreact",
"typescriptreact": "typescriptreact"
},
// === TERMINAIS ===
"terminal.integrated.profiles.windows": {
"Next.js Dev": {
"path": "cmd.exe",
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run dev"],
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run dev"]
},
"Build & Preview": {
"path": "cmd.exe",
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run build && npm run start"],
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run build && npm run start"]
},
"Git Bash": {
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
},
"path": "C:\\Program Files\\Git\\bin\\bash.exe"
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash",
@ -81,8 +88,8 @@
// === MISC ===
"files.exclude": {
"**/.DS_Store": true,
"**/*.log": true,
},
"**/*.log": true
}
},
"launch": {
"version": "0.2.0",
@ -94,9 +101,9 @@
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev"],
"cwd": "${workspaceFolder}",
"port": 9229,
},
],
"port": 9229
}
]
},
"extensions": {
"recommendations": [
@ -111,7 +118,7 @@
"streetsidesoftware.code-spell-checker",
"eamodio.gitlens",
"mhutchie.git-graph",
"donjayamanne.githistory",
],
},
"donjayamanne.githistory"
]
}
}

View file

@ -1,59 +1,22 @@
# ============================
# STAGE 1 Build
# ============================
FROM node:20-alpine AS builder
# Use uma imagem Node.js completa para o desenvolvimento
FROM node:20-alpine
# Define o diretório de trabalho no container
WORKDIR /app
# Copia pacotes e instala dependências
COPY package*.json ./
RUN npm ci
# Copia os arquivos de configuração do projeto
COPY package.json package-lock.json ./
# Copia o restante do código
# Instala todas as dependências do projeto
# Isso é necessário para o modo de desenvolvimento, pois o build não pré-compila os arquivos.
RUN npm install
# Copia o restante do código da sua aplicação
COPY . .
# ---------- Variáveis de build ----------
# Estas variáveis são usadas pelo Next.js durante o "build"
# para embutir no bundle do frontend.
ARG NEXT_PUBLIC_ORIUS_APP_STATE
ARG NEXT_PUBLIC_ORIUS_APP_API_URL
ARG NEXT_PUBLIC_ORIUS_APP_API_PREFIX
ARG NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE
ENV NEXT_PUBLIC_ORIUS_APP_STATE=$NEXT_PUBLIC_ORIUS_APP_STATE
ENV NEXT_PUBLIC_ORIUS_APP_API_URL=$NEXT_PUBLIC_ORIUS_APP_API_URL
ENV NEXT_PUBLIC_ORIUS_APP_API_PREFIX=$NEXT_PUBLIC_ORIUS_APP_API_PREFIX
ENV NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE=$NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE
# ---------- Build ----------
ENV NODE_ENV=production
RUN npm run build
# ============================
# STAGE 2 Runner (standalone)
# ============================
FROM node:20-alpine AS runner
WORKDIR /app
# ---------- Variáveis em runtime ----------
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# Copia apenas o necessário do build
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
COPY --from=builder /app/package*.json ./
# ---------- Corrige permissões ----------
RUN addgroup -S nodejs && adduser -S nextjs -G nodejs \
&& mkdir -p .next/cache/images \
&& chown -R nextjs:nodejs /app
USER nextjs
# Expõe a porta de desenvolvimento padrão do Next.js
EXPOSE 3000
# ---------- Executa o servidor ----------
CMD ["node", "server.js"]
# Define o comando para iniciar a aplicação em modo de desenvolvimento
# Isso ativará o servidor de desenvolvimento e a recarga automática
CMD ["npm", "run", "dev"]

41
Dockerfile-homologacao Normal file
View file

@ -0,0 +1,41 @@
# Etapa 1: Construir a aplicação
FROM node:20-alpine AS builder
# Define o diretório de trabalho
WORKDIR /app
# Copia os arquivos de configuração do pacote
COPY package.json package-lock.json ./
# Instala as dependências do projeto
RUN npm install
# Copia todo o código da aplicação para o container
COPY . .
# Constrói a aplicação com o output 'standalone'
RUN npm run build
# Etapa 2: Executar a aplicação
# Usa uma imagem Node.js leve
FROM node:20-alpine AS runner
# Define o diretório de trabalho
WORKDIR /app
# Copia o diretório 'standalone' da etapa de build, que já contém o servidor e as dependências
# O diretório 'standalone' é a pasta .next/standalone gerada pela configuração 'output: standalone'
COPY --from=builder /app/.next/standalone ./
# Copia os arquivos públicos
COPY --from=builder /app/public ./public
# Copia os arquivos estáticos gerados pelo build. É aqui que os arquivos CSS e JS ficam.
COPY --from=builder /app/.next/static ./.next/static
# Expõe a porta padrão do Next.js
EXPOSE 3000
# Define o comando para iniciar a aplicação
# O 'start' do package.json não é necessário, o próprio servidor standalone já está no container
CMD ["node", "server.js"]

View file

@ -1,58 +1 @@
# saas_app
Criar envlocal para usar variaveis de ambiente no em desenvolvimento
NEXT_PUBLIC_ORIUS_APP_STATE=GO
NEXT_PUBLIC_ORIUS_APP_API_URL=<http://localhost:8000/>
NEXT_PUBLIC_ORIUS_APP_API_PREFIX=api/v1/
NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE=application/json
## Modo Debug
Abra Run → Add Configuration… → Attach to Node.js
Configure:
{
"name": "Attach Next.js (9230)",
"type": "node",
"request": "attach",
"port": 9230,
"restart": true,
"smartStep": true,
"skipFiles": ["<node_internals>/**"]
}
npm run dev:debug
## onlyoffice
docker run -i -t -d -p 8081:80 --restart=always -e JWT_ENABLED=false onlyoffice/documentserver
## next em rede
```
npx next dev -H 0.0.0.0
```
```
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"dev:lan": "next dev -H 0.0.0.0" <-- Adicione esta linha
},
```
Como acessar no outro dispositivo
Descubra seu IP Local:
No Windows (seu caso), abra um terminal (CMD ou PowerShell) e digite:
Bash
ipconfig
Procure por Endereço IPv4 (geralmente começa com 192.168.x.x ou 10.0.x.x).
Acesse no navegador: No celular ou outro computador, digite: http://SEU_IP_AQUI:3000
Exemplo: <http://192.168.0.15:3000>

View file

@ -1,17 +1,12 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
// Gera build autônomo para rodar com "node server.js"
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
// Isso gera um diretório otimizado que inclui tudo o que a aplicação precisa para rodar
output: 'standalone',
// Configurações gerais
reactStrictMode: true,
poweredByHeader: false,
compress: true,
// Desativa verificações no build de produção
eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true },
eslint: {
// Desativa a verificação de lint durante o build
ignoreDuringBuilds: true,
},
};
module.exports = nextConfig;
export default nextConfig;

316
package-lock.json generated
View file

@ -7,11 +7,9 @@
"": {
"name": "saas",
"version": "25.9.1",
"hasInstallScript": true,
"dependencies": {
"@faker-js/faker": "^10.0.0",
"@hookform/resolvers": "^5.2.1",
"@onlyoffice/document-editor-react": "^2.1.1",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-checkbox": "^1.3.3",
@ -65,7 +63,6 @@
"@types/react-dom": "^19",
"@typescript-eslint/eslint-plugin": "^8.46.1",
"@typescript-eslint/parser": "^8.46.1",
"cross-env": "^10.1.0",
"eslint": "^9.38.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
@ -77,7 +74,6 @@
"eslint-plugin-unused-imports": "^4.2.0",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.14",
"shx": "^0.4.0",
"tailwindcss": "^4",
"tw-animate-css": "^1.3.7",
"typescript": "5.9.3",
@ -404,13 +400,6 @@
"tslib": "^2.4.0"
}
},
"node_modules/@epic-web/invariant": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz",
"integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==",
"dev": true,
"license": "MIT"
},
"node_modules/@eslint-community/eslint-utils": {
"version": "4.9.0",
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz",
@ -1394,19 +1383,6 @@
"node": ">= 8"
}
},
"node_modules/@onlyoffice/document-editor-react": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@onlyoffice/document-editor-react/-/document-editor-react-2.1.1.tgz",
"integrity": "sha512-b0SnFPmT+OEyJons18PPHpwtFABVCI4nr3gPtAAImar1PhN9tNc9703Yo5KPYsHhIgVq+FqHSWgunI9GJnKa5w==",
"license": "Apache-2.0",
"dependencies": {
"lodash": "4.17.21"
},
"peerDependencies": {
"react": "^16.9.0 || ^17 || ^18 || ^19",
"react-dom": "^16.9.0 || ^17 || ^18 || ^19"
}
},
"node_modules/@pkgr/core": {
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz",
@ -4278,24 +4254,6 @@
"react": ">= 16.8.0"
}
},
"node_modules/cross-env": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz",
"integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@epic-web/invariant": "^1.0.0",
"cross-spawn": "^7.0.6"
},
"bin": {
"cross-env": "dist/bin/cross-env.js",
"cross-env-shell": "dist/bin/cross-env-shell.js"
},
"engines": {
"node": ">=20"
}
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@ -4644,16 +4602,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/end-of-stream": {
"version": "1.4.5",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
"integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
"dev": true,
"license": "MIT",
"dependencies": {
"once": "^1.4.0"
}
},
"node_modules/enhanced-resolve": {
"version": "5.18.3",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz",
@ -5511,98 +5459,6 @@
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
"license": "MIT"
},
"node_modules/execa": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"dev": true,
"license": "MIT",
"dependencies": {
"cross-spawn": "^6.0.0",
"get-stream": "^4.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/execa/node_modules/cross-spawn": {
"version": "6.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz",
"integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==",
"dev": true,
"license": "MIT",
"dependencies": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
},
"engines": {
"node": ">=4.8"
}
},
"node_modules/execa/node_modules/path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/execa/node_modules/semver": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver"
}
},
"node_modules/execa/node_modules/shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
"dev": true,
"license": "MIT",
"dependencies": {
"shebang-regex": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/execa/node_modules/shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/execa/node_modules/which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"license": "ISC",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"which": "bin/which"
}
},
"node_modules/faker-js": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/faker-js/-/faker-js-1.0.0.tgz",
@ -5893,19 +5749,6 @@
"node": ">= 0.4"
}
},
"node_modules/get-stream": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
"dev": true,
"license": "MIT",
"dependencies": {
"pump": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/get-symbol-description": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz",
@ -6199,16 +6042,6 @@
"node": ">=12"
}
},
"node_modules/interpret": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
"integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.10"
}
},
"node_modules/is-array-buffer": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz",
@ -6514,16 +6347,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-string": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz",
@ -7105,12 +6928,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"license": "MIT"
},
"node_modules/lodash.includes": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
@ -7444,13 +7261,6 @@
"node": "^10 || ^12 || >=14"
}
},
"node_modules/nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true,
"license": "MIT"
},
"node_modules/node-releases": {
"version": "2.0.25",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.25.tgz",
@ -7458,29 +7268,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==",
"dev": true,
"license": "MIT",
"dependencies": {
"path-key": "^2.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/npm-run-path/node_modules/path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@ -7603,16 +7390,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"license": "ISC",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/optionator": {
"version": "0.9.4",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
@ -7649,16 +7426,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
"integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/p-limit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
@ -7927,17 +7694,6 @@
"react-is": "^16.13.1"
}
},
"node_modules/pump": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
"integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",
"dev": true,
"license": "MIT",
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
@ -8142,18 +7898,6 @@
"react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
"node_modules/rechoir": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
"integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==",
"dev": true,
"dependencies": {
"resolve": "^1.1.6"
},
"engines": {
"node": ">= 0.10"
}
},
"node_modules/redux": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
@ -8504,42 +8248,6 @@
"node": ">=8"
}
},
"node_modules/shelljs": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.9.2.tgz",
"integrity": "sha512-S3I64fEiKgTZzKCC46zT/Ib9meqofLrQVbpSswtjFfAVDW+AZ54WTnAM/3/yENoxz/V1Cy6u3kiiEbQ4DNphvw==",
"dev": true,
"license": "BSD-3-Clause",
"dependencies": {
"execa": "^1.0.0",
"fast-glob": "^3.3.2",
"interpret": "^1.0.0",
"rechoir": "^0.6.2"
},
"bin": {
"shjs": "bin/shjs"
},
"engines": {
"node": ">=18"
}
},
"node_modules/shx": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/shx/-/shx-0.4.0.tgz",
"integrity": "sha512-Z0KixSIlGPpijKgcH6oCMCbltPImvaKy0sGH8AkLRXw1KyzpKtaCTizP2xen+hNDqVF4xxgvA0KXSb9o4Q6hnA==",
"dev": true,
"license": "MIT",
"dependencies": {
"minimist": "^1.2.8",
"shelljs": "^0.9.2"
},
"bin": {
"shx": "lib/cli.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/side-channel": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
@ -8616,13 +8324,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/signal-exit": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
"dev": true,
"license": "ISC"
},
"node_modules/sonner": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",
@ -8789,16 +8490,6 @@
"node": ">=4"
}
},
"node_modules/strip-eof": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
@ -9464,13 +9155,6 @@
"node": ">=0.10.0"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true,
"license": "ISC"
},
"node_modules/yallist": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",

View file

@ -4,17 +4,14 @@
"version": "25.9.1",
"private": true,
"scripts": {
"dev": "next dev",
"dev:debug": "cross-env NEXT_USE_TURBOPACK=0 NODE_OPTIONS=\"--inspect=9230\" next dev",
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint",
"postinstall": "shx mkdir -p public/libs && shx cp -r node_modules/tinymce public/libs/tinymce"
"lint": "next lint"
},
"dependencies": {
"@faker-js/faker": "^10.0.0",
"@hookform/resolvers": "^5.2.1",
"@onlyoffice/document-editor-react": "^2.1.1",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-avatar": "^1.1.10",
"@radix-ui/react-checkbox": "^1.3.3",
@ -68,7 +65,6 @@
"@types/react-dom": "^19",
"@typescript-eslint/eslint-plugin": "^8.46.1",
"@typescript-eslint/parser": "^8.46.1",
"cross-env": "^10.1.0",
"eslint": "^9.38.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
@ -80,7 +76,6 @@
"eslint-plugin-unused-imports": "^4.2.0",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.14",
"shx": "^0.4.0",
"tailwindcss": "^4",
"tw-animate-css": "^1.3.7",
"typescript": "5.9.3",

Binary file not shown.

View file

@ -1,7 +1,9 @@
'use client';
import GCartorioIndex from '@/packages/administrativo/components/GCartorio/GCartorioIndex';
import GCartorioIndex from "@/packages/administrativo/components/GCartorio/GCartorioIndex";
export default function GCartorioPage() {
return <GCartorioIndex />;
return (
< GCartorioIndex />
);
}

View file

@ -1,3 +1,5 @@
export default function TCensecPage() {
return <div></div>;
}
return (
<div></div>
);
}

View file

@ -1,5 +1,9 @@
import GCalculoIndex from '@/packages/administrativo/components/GCalculo/GCalculoIndex';
import GCalculoIndex from "@/packages/administrativo/components/GCalculo/GCalculoIndex";
export default function GEmolumentoPeriodoPage() {
return <GCalculoIndex />;
}
return (
<GCalculoIndex />
);
}

View file

@ -1,16 +1,18 @@
'use client';
'use client'
import { useParams } from 'next/navigation';
import { useParams } from "next/navigation";
import GEmolumentoItemIndex from '@/packages/administrativo/components/GEmolumentoItem/GEmolumentoItemIndex';
import GEmolumentoItemIndex from "@/packages/administrativo/components/GEmolumentoItem/GEmolumentoItemIndex";
export default function GGramaticaPage() {
const params = useParams();
return (
<GEmolumentoItemIndex
emolumento_id={Number(params.emolumentoId)}
emolumento_periodo_id={Number(params.emolumentoPeriodoId)}
/>
);
}
const params = useParams();
return (
<GEmolumentoItemIndex
emolumento_id={Number(params.emolumentoId)}
emolumento_periodo_id={Number(params.emolumentoPeriodoId)}
/>
);
}

View file

@ -1,5 +1,9 @@
import GEmolumentoIndex from '@/packages/administrativo/components/GEmolumento/GEmolumentoIndex';
import GEmolumentoIndex from "@/packages/administrativo/components/GEmolumento/GEmolumentoIndex";
export default function GEmolumentoPeriodoPage() {
return <GEmolumentoIndex />;
}
return (
<GEmolumentoIndex />
);
}

View file

@ -1,5 +1,9 @@
import GEmolumentoPeriodoIndex from '@/packages/administrativo/components/GEmolumentoPeriodo/GEmolumentoPeriodoIndex';
import GEmolumentoPeriodoIndex from "@/packages/administrativo/components/GEmolumentoPeriodo/GEmolumentoPeriodoIndex";
export default function GEmolumentoPeriodoPage() {
return <GEmolumentoPeriodoIndex />;
}
return (
<GEmolumentoPeriodoIndex />
);
}

View file

@ -1,5 +1,9 @@
import GGramaticaIndex from '@/packages/administrativo/components/GGramatica/GGramaticaIndex';
import GGramaticaIndex from "@/packages/administrativo/components/GGramatica/GGramaticaIndex";
export default function GGramaticaPage() {
return <GGramaticaIndex />;
}
return (
<GGramaticaIndex />
);
}

View file

@ -1,7 +1,9 @@
'use client';
import TImovelDashboard from '@/packages/administrativo/components/TImovel/TImovelDashboard';
import TImovelDashboard from "@/packages/administrativo/components/TImovel/TImovelDashboard";
export default function TImovelDashboardPage() {
return <TImovelDashboard />;
return (
<TImovelDashboard />
);
}

View file

@ -1,7 +1,9 @@
'use client';
import TPessoaDashboard from '@/packages/administrativo/components/TPessoa/TPessoaDashboard';
import TPessoaDashboard from "@/packages/administrativo/components/TPessoa/TPessoaDashboard";
export default function TPessoaDashboardPage() {
return <TPessoaDashboard />;
return (
<TPessoaDashboard />
);
}

View file

@ -1,5 +1,9 @@
import GSeloGrupoIndex from '@/packages/administrativo/components/GSeloGrupo/GSeloGrupoIndex';
import GSeloGrupoIndex from "@/packages/administrativo/components/GSeloGrupo/GSeloGrupoIndex";
export default function GSeloGrupoPage() {
return <GSeloGrupoIndex />;
}
return (
<GSeloGrupoIndex />
);
}

View file

@ -1,5 +1,9 @@
import TServicoTipoIndex from '@/packages/administrativo/components/TServicoTipo/TServicoTipoIndex';
import TServicoTipoIndex from "@/packages/administrativo/components/TServicoTipo/TServicoTipoIndex";
export default function TServicoTipoPage() {
return <TServicoTipoIndex />;
}
return (
<TServicoTipoIndex />
);
}

View file

@ -1,5 +1,11 @@
import GNaturezaTituloIndex from '@/packages/administrativo/components/GNaturezaTitulo/GNaturezaTituloIndex';
import GNaturezaTituloIndex from "@/packages/administrativo/components/GNaturezaTitulo/GNaturezaTituloIndex";
export default function GNaturezaPage() {
return <GNaturezaTituloIndex sistema_id={2} />;
}
return (
<GNaturezaTituloIndex
sistema_id={2}
/>
);
}

View file

@ -1,13 +1,14 @@
'use client';
import { useParams } from 'next/navigation';
import { useEffect, useState } from 'react';
import { useParams } from 'next/navigation';
import MainEditor from '@/components/MainEditor';
import { Card, CardContent } from '@/components/ui/card';
import MainEditor from '@/components/MainEditor';
import Loading from '@/shared/components/loading/loading';
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
import Loading from '@/shared/components/loading/loading';
export default function TMinutaDetalhes() {
const params = useParams();

View file

@ -1,13 +1,11 @@
'use client';
import { zodResolver } from '@hookform/resolvers/zod';
import z from 'zod';
import { useEffect } from 'react';
import { useForm, Controller } from 'react-hook-form';
import z from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import MainEditor from '@/components/MainEditor';
import { Button } from '@/components/ui/button';
import { Card, CardContent } from '@/components/ui/card';
import { Checkbox } from '@/components/ui/checkbox';
import {
Form,
@ -19,8 +17,11 @@ import {
} from '@/components/ui/form';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
import MainEditor from '@/components/MainEditor';
import { TMinutaSchema } from '@/packages/administrativo/schemas/TMinuta/TMinutaSchema';
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
import { Card, CardContent } from '@/components/ui/card';
type FormValues = z.infer<typeof TMinutaSchema>;

View file

@ -1,19 +1,22 @@
'use client';
import { useEffect, useState, useCallback } from 'react';
import { Card, CardContent } from '@/components/ui/card';
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
import { useTMinutaRemoveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaRemoveHook';
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
import Loading from '@/shared/components/loading/loading';
import Header from '@/shared/components/structure/Header';
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
import Loading from '@/shared/components/loading/loading';
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
import { useTMinutaRemoveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaRemoveHook';
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
export default function TMinutaPage() {
// Hooks de leitura e escrita

View file

@ -19,6 +19,7 @@ import { Toaster } from '@/components/ui/sonner';
import Response from '../../shared/components/response/response';
import { ResponseProvider } from '../../shared/components/response/ResponseContext';
const geistSans = Geist({
variable: '--font-geist-sans',
subsets: ['latin'],
@ -56,7 +57,9 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem className="hidden md:block">
<BreadcrumbLink href="#">Building Your Application</BreadcrumbLink>
<BreadcrumbLink href="#">
Building Your Application
</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator className="hidden md:block" />
<BreadcrumbItem>

View file

@ -1,8 +1,7 @@
'use client';
import { useEffect, useState } from 'react';
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
import { useEffect, useState } from 'react';
export default function Page() {
const { userAuthenticated } = useGUsuarioGetJWTHook();

View file

@ -1,5 +0,0 @@
import TAtoForm from '@/packages/servicos/components/TAto/TAtoForm';
export default function TAtoFormPage() {
return <TAtoForm />;
}

View file

@ -1,5 +0,0 @@
import TAtoIndex from '@/packages/servicos/components/TAto/TAtoIndex';
export default function TServicoAToPag() {
return <TAtoIndex />;
}

View file

@ -0,0 +1,16 @@
'use client'
import { useParams } from "next/navigation";
import TServicoPedidoDetails from "@/packages/servicos/components/TServicoPedido/TServicoPedidoDetails";
export default function TServicoPedidoDetailsPage() {
const params = useParams();
return (
<TServicoPedidoDetails
servico_pedido_id={Number(params.servicoPedidoId)}
/>
)
}

View file

@ -0,0 +1,7 @@
import TServicoPedidoIndex from "@/packages/servicos/components/TServicoPedido/TServicoPedidoIndex";
export default function TServicoPedidoPage() {
return (
<TServicoPedidoIndex />
)
}

View file

@ -0,0 +1,16 @@
'use client'
import { useParams } from "next/navigation";
import TServicoPedidoForm from "@/packages/servicos/components/TServicoPedido/TServicoPedidoForm";
export default function TServicoPedidoPage() {
const params = useParams();
return (
<TServicoPedidoForm
servico_pedido_id={Number(params.servicoPedidoId)}
/>
)
}

View file

@ -0,0 +1,7 @@
import TServicoPedidoForm from "@/packages/servicos/components/TServicoPedido/TServicoPedidoForm"
export default function TServicoPedidoPage() {
return (
<TServicoPedidoForm />
)
}

View file

@ -1,5 +1,7 @@
import TServicoPedidoDashboard from '@/packages/servicos/components/TServicoPedido/TServicoPedidoDashboard';
import TServicoPedidoDashboard from "@/packages/servicos/components/TServicoPedido/TServicoPedidoDashboard";
export default function TServicoPedidoPage() {
return <TServicoPedidoDashboard />;
}
return (
<TServicoPedidoDashboard />
)
}

View file

@ -1,11 +0,0 @@
'use client';
import { useParams } from 'next/navigation';
import TServicoPedidoDetails from '@/packages/servicos/components/TServicoPedido/TServicoPedidoDetails';
export default function TServicoPedidoDetailsPage() {
const params = useParams();
return <TServicoPedidoDetails servico_pedido_id={Number(params.servicoPedidoId)} />;
}

View file

@ -1,5 +0,0 @@
import TServicoPedidoIndex from '@/packages/servicos/components/TServicoPedido/TServicoPedidoIndex';
export default function TServicoPedidoPage() {
return <TServicoPedidoIndex />;
}

View file

@ -1,11 +0,0 @@
'use client';
import { useParams } from 'next/navigation';
import TServicoPedidoForm from '@/packages/servicos/components/TServicoPedido/TServicoPedidoForm';
export default function TServicoPedidoPage() {
const params = useParams();
return <TServicoPedidoForm servico_pedido_id={Number(params.servicoPedidoId)} />;
}

View file

@ -1,5 +0,0 @@
import TServicoPedidoForm from '@/packages/servicos/components/TServicoPedido/TServicoPedidoForm';
export default function TServicoPedidoPage() {
return <TServicoPedidoForm />;
}

View file

@ -1,7 +1,6 @@
'use client';
import React, { useState } from 'react';
import {
AlertDialog,
AlertDialogCancel,
@ -12,6 +11,7 @@ import {
AlertDialogTitle,
AlertDialogAction,
} from '@/components/ui/alert-dialog';
import { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/ui/input-otp';
interface ConfirmExclusionProps {

View file

@ -6,44 +6,39 @@
:root {
--background: oklch(0.9911 0 0);
--foreground: oklch(0.2988 0.0123 222.4429);
--card: oklch(1 0 0);
--card: oklch(1.0000 0 0);
--card-foreground: oklch(0.2988 0.0123 222.4429);
--popover: oklch(0.9881 0 0);
--popover-foreground: oklch(0.2988 0.0123 222.4429);
--primary: oklch(0.721 0.1873 47.564);
--primary-foreground: oklch(1 0 0);
--primary: oklch(0.7210 0.1873 47.5640);
--primary-foreground: oklch(1.0000 0 0);
--secondary: oklch(0.2988 0.0123 222.4429);
--secondary-foreground: oklch(1 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--secondary-foreground: oklch(1.0000 0 0);
--muted: oklch(0.9700 0 0);
--muted-foreground: oklch(0.5560 0 0);
--accent: oklch(0.9551 0 0);
--accent-foreground: oklch(0.2988 0.0123 222.4429);
--destructive: oklch(0.577 0.245 27.325);
--destructive: oklch(0.5770 0.2450 27.3250);
--destructive-foreground: oklch(1 0 0);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.81 0.1 252);
--chart-2: oklch(0.62 0.19 260);
--chart-3: oklch(0.55 0.22 263);
--chart-4: oklch(0.49 0.22 264);
--chart-5: oklch(0.42 0.18 266);
--sidebar: oklch(1 0 0);
--border: oklch(0.9220 0 0);
--input: oklch(0.9220 0 0);
--ring: oklch(0.7080 0 0);
--chart-1: oklch(0.8100 0.1000 252);
--chart-2: oklch(0.6200 0.1900 260);
--chart-3: oklch(0.5500 0.2200 263);
--chart-4: oklch(0.4900 0.2200 264);
--chart-5: oklch(0.4200 0.1800 266);
--sidebar: oklch(1.0000 0 0);
--sidebar-foreground: oklch(0.2988 0.0123 222.4429);
--sidebar-primary: oklch(0.2364 0.0083 240.2365);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
--font-sans:
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol', 'Noto Color Emoji';
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
--font-mono:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
monospace;
--sidebar-primary-foreground: oklch(0.9850 0 0);
--sidebar-accent: oklch(0.9700 0 0);
--sidebar-accent-foreground: oklch(0.2050 0 0);
--sidebar-border: oklch(0.9220 0 0);
--sidebar-ring: oklch(0.7080 0 0);
--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--radius: 0.625rem;
--shadow-x: 0;
--shadow-y: 1px;
@ -53,11 +48,11 @@
--shadow-color: oklch(0 0 0);
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
--tracking-normal: 0em;
--spacing: 0.25rem;
@ -73,40 +68,35 @@
--card-foreground: oklch(0.9881 0 0);
--popover: oklch(0.2988 0.0123 222.4429);
--popover-foreground: oklch(0.9881 0 0);
--primary: oklch(0.721 0.1873 47.564);
--primary: oklch(0.7210 0.1873 47.5640);
--primary-foreground: oklch(0.2988 0.0123 222.4429);
--secondary: oklch(0.2988 0.0123 222.4429);
--secondary-foreground: oklch(1 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--secondary-foreground: oklch(1.0000 0 0);
--muted: oklch(0.2690 0 0);
--muted-foreground: oklch(0.7080 0 0);
--accent: oklch(0.2988 0.0123 222.4429);
--accent-foreground: oklch(1 0 0);
--destructive: oklch(0.704 0.191 22.216);
--destructive-foreground: oklch(0.985 0 0);
--border: oklch(0.275 0 0);
--input: oklch(0.325 0 0);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.81 0.1 252);
--chart-2: oklch(0.62 0.19 260);
--chart-3: oklch(0.55 0.22 263);
--chart-4: oklch(0.49 0.22 264);
--chart-5: oklch(0.42 0.18 266);
--accent-foreground: oklch(1.0000 0 0);
--destructive: oklch(0.7040 0.1910 22.2160);
--destructive-foreground: oklch(0.9850 0 0);
--border: oklch(0.2750 0 0);
--input: oklch(0.3250 0 0);
--ring: oklch(0.5560 0 0);
--chart-1: oklch(0.8100 0.1000 252);
--chart-2: oklch(0.6200 0.1900 260);
--chart-3: oklch(0.5500 0.2200 263);
--chart-4: oklch(0.4900 0.2200 264);
--chart-5: oklch(0.4200 0.1800 266);
--sidebar: oklch(0.2364 0.0083 240.2365);
--sidebar-foreground: oklch(0.9881 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(0.275 0 0);
--sidebar-ring: oklch(0.439 0 0);
--font-sans:
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol', 'Noto Color Emoji';
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
--font-mono:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
monospace;
--sidebar-primary: oklch(0.4880 0.2430 264.3760);
--sidebar-primary-foreground: oklch(0.9850 0 0);
--sidebar-accent: oklch(0.2690 0 0);
--sidebar-accent-foreground: oklch(0.9850 0 0);
--sidebar-border: oklch(0.2750 0 0);
--sidebar-ring: oklch(0.4390 0 0);
--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--radius: 0.625rem;
--shadow-x: 0;
--shadow-y: 1px;
@ -116,11 +106,11 @@
--shadow-color: oklch(0 0 0);
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
--shadow-offset-x: 0;
--shadow-offset-y: 1px;
@ -162,14 +152,9 @@
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
--font-sans:
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol', 'Noto Color Emoji';
--font-mono:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
monospace;
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
@ -212,4 +197,4 @@
.bg-brand {
background-color: #1a292f;
}
}
}

View file

@ -1,5 +1,5 @@
import { Editor } from '@tinymce/tinymce-react';
import React from 'react';
import { Editor } from '@tinymce/tinymce-react';
// 1. Define as propriedades que nosso componente vai receber
interface MainEditorProps {

View file

@ -7,7 +7,7 @@ import {
HouseIcon,
SquareMousePointer,
SquareTerminal,
UsersIcon,
UsersIcon
} from 'lucide-react';
import Image from 'next/image';
import * as React from 'react';
@ -27,6 +27,8 @@ import {
} from '@/components/ui/sidebar';
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
// This is sample data.
const data = {
teams: [],
@ -54,12 +56,8 @@ const data = {
url: '/servicos/dashboard/',
},
{
title: 'Pedidos',
url: '/servicos/pedidos/',
},
{
title: 'Atos',
url: '/servicos/atos/',
title: 'Balcão',
url: '/servicos/balcao/',
},
],
},
@ -181,33 +179,33 @@ const data = {
url: '/administrativo/atos/partes-tipos',
},
{
title: 'Valores de Serviços',
url: '/administrativo/valores-de-servicos',
title: "Valores de Serviços",
url: "/administrativo/valores-de-servicos",
},
{
title: 'Gramatica',
url: '/administrativo/gramatica',
title: "Gramatica",
url: "/administrativo/gramatica",
},
{
title: 'Cartório',
url: '/administrativo/cartorio',
title: "Cartório",
url: "/administrativo/cartorio",
},
{
title: 'Financeiro/Periodo',
url: '/administrativo/financeiro/periodos',
title: "Financeiro/Periodo",
url: "/administrativo/financeiro/periodos",
},
{
title: 'Financeiro/Emolumentos',
url: '/administrativo/financeiro/emolumentos',
title: "Financeiro/Emolumentos",
url: "/administrativo/financeiro/emolumentos",
},
{
title: 'Selos/Grupos',
url: '/administrativo/selos/grupos',
title: "Selos/Grupos",
url: "/administrativo/selos/grupos",
},
{
title: 'Financeiro/Cálculo Rápido',
url: '/administrativo/financeiro/calculo-rapido',
},
title: "Financeiro/Cálculo Rápido",
url: "/administrativo/financeiro/calculo-rapido",
}
],
},
],

View file

@ -1,20 +1,18 @@
'use client';
import { zodResolver } from '@hookform/resolvers/zod';
import Image from 'next/image';
import { useState } from 'react';
import { useForm } from 'react-hook-form';
import z from 'zod';
import { cn } from '@/lib/utils';
import { Card, CardContent } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { cn } from '@/lib/utils';
import { GUsuarioLoginSchema } from '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
import z from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import GUsuarioLoginService from '@/packages/administrativo/services/GUsuario/GUsuarioLogin';
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
import { Button } from './ui/button';
import { useForm } from 'react-hook-form';
import { useState } from 'react';
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from './ui/form';
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
import { Button } from './ui/button';
import { GUsuarioLoginSchema } from '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
type FormValues = z.infer<typeof GUsuarioLoginSchema>;

View file

@ -1,6 +1,12 @@
'use client';
import { ChevronsUpDown, LogOut, Moon, Sparkles, Sun } from 'lucide-react';
import {
ChevronsUpDown,
LogOut,
Moon,
Sparkles,
Sun,
} from 'lucide-react';
import { useTheme } from 'next-themes';
import { useCallback, useState } from 'react';
@ -69,7 +75,9 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
>
<Avatar className="h-8 w-8 rounded-lg">
<AvatarImage src={user.sigla} alt={user.nome} />
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
<AvatarFallback className="rounded-lg">
{user.sigla}
</AvatarFallback>
</Avatar>
<div className="grid flex-1 text-left text-sm leading-tight">
@ -91,7 +99,9 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
<Avatar className="h-8 w-8 rounded-lg">
<AvatarImage src={user.sigla} alt={user.nome} />
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
<AvatarFallback className="rounded-lg">
{user.sigla}
</AvatarFallback>
</Avatar>
<div className="grid flex-1 text-left text-sm leading-tight">
@ -105,8 +115,15 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
<DropdownMenuGroup>
{/* Alternância de tema */}
<DropdownMenuItem className="cursor-pointer" onClick={handleToggleTheme}>
{isDark ? <Sun className="mr-2 h-4 w-4" /> : <Moon className="mr-2 h-4 w-4" />}
<DropdownMenuItem
className="cursor-pointer"
onClick={handleToggleTheme}
>
{isDark ? (
<Sun className="mr-2 h-4 w-4" />
) : (
<Moon className="mr-2 h-4 w-4" />
)}
{isDark ? 'Modo claro' : 'Modo escuro'}
</DropdownMenuItem>
@ -118,7 +135,10 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
<DropdownMenuSeparator />
<DropdownMenuItem className="cursor-pointer" onClick={handleConfirmOpen}>
<DropdownMenuItem
className="cursor-pointer"
onClick={handleConfirmOpen}
>
<LogOut className="mr-2 h-4 w-4" />
Log out
</DropdownMenuItem>

View file

@ -1,7 +1,7 @@
'use client';
import { ChevronsUpDown, Plus } from 'lucide-react';
import * as React from 'react';
import { ChevronsUpDown, Plus } from 'lucide-react';
import {
DropdownMenu,

View file

@ -1,17 +1,17 @@
'use client';
"use client";
import { ThemeProvider as NextThemesProvider } from 'next-themes';
import * as React from 'react';
import { ThemeProvider as NextThemesProvider } from "next-themes";
import * as React from "react";
export function ThemeProvider({ children }: { children: React.ReactNode }) {
return (
<NextThemesProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
{children}
</NextThemesProvider>
);
return (
<NextThemesProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
{children}
</NextThemesProvider>
);
}

View file

@ -1,10 +1,10 @@
'use client';
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
import * as React from 'react';
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { buttonVariants } from '@/components/ui/button';
function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;

View file

@ -1,7 +1,7 @@
'use client';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
import * as React from 'react';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
import { cn } from '@/lib/utils';

View file

@ -1,39 +1,46 @@
import { Slot } from '@radix-ui/react-slot';
import { cva, type VariantProps } from 'class-variance-authority';
import * as React from 'react';
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
const badgeVariants = cva(
'inline-flex items-center justify-center rounded-full 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',
"inline-flex items-center justify-center rounded-full 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",
{
variants: {
variant: {
default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
default:
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
secondary:
'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
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',
outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
"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",
outline:
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
},
},
defaultVariants: {
variant: 'default',
variant: "default",
},
},
);
}
)
function Badge({
className,
variant,
asChild = false,
...props
}: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
const Comp = asChild ? Slot : 'span';
}: React.ComponentProps<"span"> &
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
const Comp = asChild ? Slot : "span"
return (
<Comp data-slot="badge" className={cn(badgeVariants({ variant }), className)} {...props} />
);
<Comp
data-slot="badge"
className={cn(badgeVariants({ variant }), className)}
{...props}
/>
)
}
export { Badge, badgeVariants };
export { Badge, badgeVariants }

View file

@ -1,6 +1,6 @@
import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
import { ChevronRight, MoreHorizontal } from 'lucide-react';
import * as React from 'react';
import { cn } from '@/lib/utils';

View file

@ -1,8 +1,8 @@
import { Slot } from '@radix-ui/react-slot';
import { cva, type VariantProps } from 'class-variance-authority';
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { Separator } from '@/components/ui/separator';
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
import { Separator } from "@/components/ui/separator"
const buttonGroupVariants = cva(
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
@ -10,22 +10,22 @@ const buttonGroupVariants = cva(
variants: {
orientation: {
horizontal:
'[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none',
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
vertical:
'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none',
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
},
},
defaultVariants: {
orientation: 'horizontal',
orientation: "horizontal",
},
},
);
}
)
function ButtonGroup({
className,
orientation,
...props
}: React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>) {
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
return (
<div
role="group"
@ -34,32 +34,32 @@ function ButtonGroup({
className={cn(buttonGroupVariants({ orientation }), className)}
{...props}
/>
);
)
}
function ButtonGroupText({
className,
asChild = false,
...props
}: React.ComponentProps<'div'> & {
asChild?: boolean;
}: React.ComponentProps<"div"> & {
asChild?: boolean
}) {
const Comp = asChild ? Slot : 'div';
const Comp = asChild ? Slot : "div"
return (
<Comp
className={cn(
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
className,
className
)}
{...props}
/>
);
)
}
function ButtonGroupSeparator({
className,
orientation = 'vertical',
orientation = "vertical",
...props
}: React.ComponentProps<typeof Separator>) {
return (
@ -67,12 +67,17 @@ function ButtonGroupSeparator({
data-slot="button-group-separator"
orientation={orientation}
className={cn(
'bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto',
className,
"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
className
)}
{...props}
/>
);
)
}
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
export {
ButtonGroup,
ButtonGroupSeparator,
ButtonGroupText,
buttonGroupVariants,
}

View file

@ -1,38 +1,40 @@
import { Slot } from '@radix-ui/react-slot';
import { cva, type VariantProps } from 'class-variance-authority';
import * as React from 'react';
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-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",
{
variants: {
variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive:
'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline:
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
link: 'text-primary underline-offset-4 hover:underline',
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost:
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
icon: 'size-9',
'icon-sm': 'size-8',
'icon-lg': 'size-10',
default: "h-9 px-4 py-2 has-[>svg]:px-3",
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
icon: "size-9",
"icon-sm": "size-8",
"icon-lg": "size-10",
},
},
defaultVariants: {
variant: 'default',
size: 'default',
variant: "default",
size: "default",
},
},
);
}
)
function Button({
className,
@ -40,11 +42,11 @@ function Button({
size,
asChild = false,
...props
}: React.ComponentProps<'button'> &
}: React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean;
asChild?: boolean
}) {
const Comp = asChild ? Slot : 'button';
const Comp = asChild ? Slot : "button"
return (
<Comp
@ -52,7 +54,7 @@ function Button({
className={cn(buttonVariants({ variant, size, className }))}
{...props}
/>
);
)
}
export { Button, buttonVariants };
export { Button, buttonVariants }

View file

@ -1,75 +1,92 @@
import * as React from 'react';
import * as React from "react"
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
function Card({ className, ...props }: React.ComponentProps<'div'>) {
function Card({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card"
className={cn(
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
className,
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
className
)}
{...props}
/>
);
)
}
function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-header"
className={cn(
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
className,
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
className
)}
{...props}
/>
);
)
}
function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-title"
className={cn('leading-none font-semibold', className)}
className={cn("leading-none font-semibold", className)}
{...props}
/>
);
)
}
function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-description"
className={cn('text-muted-foreground text-sm', className)}
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
);
)
}
function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-action"
className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
className={cn(
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
className
)}
{...props}
/>
);
)
}
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
return <div data-slot="card-content" className={cn('px-6', className)} {...props} />;
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-content"
className={cn("px-6", className)}
{...props}
/>
)
}
function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-footer"
className={cn('flex items-center px-6 [.border-t]:pt-6', className)}
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
{...props}
/>
);
)
}
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
export {
Card,
CardHeader,
CardFooter,
CardTitle,
CardAction,
CardDescription,
CardContent,
}

View file

@ -1,132 +0,0 @@
const ChartTooltip = RechartsPrimitive.Tooltip;
function ChartTooltipContent(props: any) {
const {
active,
payload,
className,
indicator = 'dot',
hideLabel = false,
hideIndicator = false,
label,
labelFormatter,
labelClassName,
formatter,
color,
nameKey,
labelKey,
} = props;
const { config } = useChart();
const tooltipLabel = React.useMemo(() => {
if (hideLabel || !payload?.length) {
return null;
}
const [item] = payload;
const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
const itemConfig = getPayloadConfigFromPayload(config, item, key);
const value =
!labelKey && typeof label === 'string'
? config[label as keyof typeof config]?.label || label
: itemConfig?.label;
if (labelFormatter) {
return (
<div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
);
}
if (!value) {
return null;
}
return <div className={cn('font-medium', labelClassName)}>{value}</div>;
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
if (!active || !payload?.length) {
return null;
}
const nestLabel = payload.length === 1 && indicator !== 'dot';
return (
<div
className={cn(
'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',
className,
)}
>
{!nestLabel ? tooltipLabel : null}
<div className="grid gap-1.5">
{payload
.filter((item: any) => item.type !== 'none')
.map((item: any, index: number) => {
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
const itemConfig = getPayloadConfigFromPayload(config, item, key);
const indicatorColor = color || item.payload?.fill || item.color;
return (
<div
key={item.dataKey}
className={cn(
'[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',
indicator === 'dot' && 'items-center',
)}
>
{formatter && item?.value !== undefined && item.name ? (
formatter(item.value, item.name, item, index, item.payload)
) : (
<>
{itemConfig?.icon ? (
<itemConfig.icon />
) : (
!hideIndicator && (
<div
className={cn(
'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',
{
'h-2.5 w-2.5': indicator === 'dot',
'w-1': indicator === 'line',
'w-0 border-[1.5px] border-dashed bg-transparent':
indicator === 'dashed',
'my-0.5': nestLabel && indicator === 'dashed',
},
)}
style={
{
'--color-bg': indicatorColor,
'--color-border': indicatorColor,
} as React.CSSProperties
}
/>
)
)}
<div
className={cn(
'flex flex-1 justify-between leading-none',
nestLabel ? 'items-end' : 'items-center',
)}
>
<div className="grid gap-1.5">
{nestLabel ? tooltipLabel : null}
<span className="text-muted-foreground">
{itemConfig?.label || item.name}
</span>
</div>
{item.value && (
<span className="text-foreground font-mono font-medium tabular-nums">
{item.value.toLocaleString()}
</span>
)}
</div>
</>
)}
</div>
);
})}
</div>
</div>
);
}

View file

@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
import { CheckIcon } from 'lucide-react';
import * as React from 'react';
import { cn } from '@/lib/utils';

View file

@ -1,9 +1,10 @@
'use client';
import * as React from 'react';
import { Command as CommandPrimitive } from 'cmdk';
import { SearchIcon } from 'lucide-react';
import * as React from 'react';
import { cn } from '@/lib/utils';
import {
Dialog,
DialogContent,
@ -11,7 +12,6 @@ import {
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
import { cn } from '@/lib/utils';
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
return (

View file

@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { XIcon } from 'lucide-react';
import * as React from 'react';
import { cn } from '@/lib/utils';

View file

@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
import * as React from 'react';
import { cn } from '@/lib/utils';

View file

@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import * as LabelPrimitive from '@radix-ui/react-label';
import { Slot } from '@radix-ui/react-slot';
import * as React from 'react';
import {
Controller,
FormProvider,
@ -13,8 +13,8 @@ import {
type FieldValues,
} from 'react-hook-form';
import { Label } from '@/components/ui/label';
import { cn } from '@/lib/utils';
import { Label } from '@/components/ui/label';
const Form = FormProvider;

View file

@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import { OTPInput, OTPInputContext } from 'input-otp';
import { MinusIcon } from 'lucide-react';
import * as React from 'react';
import { cn } from '@/lib/utils';

View file

@ -1,21 +1,21 @@
import * as React from 'react';
import * as React from "react"
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
<input
type={type}
data-slot="input"
className={cn(
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
'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',
className,
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
"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",
className
)}
{...props}
/>
);
)
}
export { Input };
export { Input }

View file

@ -1,61 +1,65 @@
import { Slot } from '@radix-ui/react-slot';
import { cva, type VariantProps } from 'class-variance-authority';
import * as React from 'react';
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import { Separator } from '@/components/ui/separator';
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
import { Separator } from "@/components/ui/separator"
function ItemGroup({ className, ...props }: React.ComponentProps<'div'>) {
function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
role="list"
data-slot="item-group"
className={cn('group/item-group flex flex-col', className)}
className={cn("group/item-group flex flex-col", className)}
{...props}
/>
);
)
}
function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>) {
function ItemSeparator({
className,
...props
}: React.ComponentProps<typeof Separator>) {
return (
<Separator
data-slot="item-separator"
orientation="horizontal"
className={cn('my-0', className)}
className={cn("my-0", className)}
{...props}
/>
);
)
}
const itemVariants = cva(
'group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
"group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
{
variants: {
variant: {
default: 'bg-transparent',
outline: 'border-border',
muted: 'bg-muted/50',
default: "bg-transparent",
outline: "border-border",
muted: "bg-muted/50",
},
size: {
default: 'p-4 gap-4 ',
sm: 'py-3 px-4 gap-2.5',
default: "p-4 gap-4 ",
sm: "py-3 px-4 gap-2.5",
},
},
defaultVariants: {
variant: 'default',
size: 'default',
variant: "default",
size: "default",
},
},
);
}
)
function Item({
className,
variant = 'default',
size = 'default',
variant = "default",
size = "default",
asChild = false,
...props
}: React.ComponentProps<'div'> & VariantProps<typeof itemVariants> & { asChild?: boolean }) {
const Comp = asChild ? Slot : 'div';
}: React.ComponentProps<"div"> &
VariantProps<typeof itemVariants> & { asChild?: boolean }) {
const Comp = asChild ? Slot : "div"
return (
<Comp
data-slot="item"
@ -64,30 +68,31 @@ function Item({
className={cn(itemVariants({ variant, size, className }))}
{...props}
/>
);
)
}
const itemMediaVariants = cva(
'flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5',
"flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5",
{
variants: {
variant: {
default: 'bg-transparent',
default: "bg-transparent",
icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
image: 'size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover',
image:
"size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover",
},
},
defaultVariants: {
variant: 'default',
variant: "default",
},
},
);
}
)
function ItemMedia({
className,
variant = 'default',
variant = "default",
...props
}: React.ComponentProps<'div'> & VariantProps<typeof itemMediaVariants>) {
}: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
return (
<div
data-slot="item-media"
@ -95,67 +100,83 @@ function ItemMedia({
className={cn(itemMediaVariants({ variant, className }))}
{...props}
/>
);
)
}
function ItemContent({ className, ...props }: React.ComponentProps<'div'>) {
function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="item-content"
className={cn('flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none', className)}
className={cn(
"flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
className
)}
{...props}
/>
);
)
}
function ItemTitle({ className, ...props }: React.ComponentProps<'div'>) {
function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="item-title"
className={cn('flex w-fit items-center gap-2 text-sm leading-snug font-medium', className)}
className={cn(
"flex w-fit items-center gap-2 text-sm leading-snug font-medium",
className
)}
{...props}
/>
);
)
}
function ItemDescription({ className, ...props }: React.ComponentProps<'p'>) {
function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
return (
<p
data-slot="item-description"
className={cn(
'text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance',
'[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
className,
"text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance",
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
className
)}
{...props}
/>
);
)
}
function ItemActions({ className, ...props }: React.ComponentProps<'div'>) {
function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
return (
<div data-slot="item-actions" className={cn('flex items-center gap-2', className)} {...props} />
);
<div
data-slot="item-actions"
className={cn("flex items-center gap-2", className)}
{...props}
/>
)
}
function ItemHeader({ className, ...props }: React.ComponentProps<'div'>) {
function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="item-header"
className={cn('flex basis-full items-center justify-between gap-2', className)}
className={cn(
"flex basis-full items-center justify-between gap-2",
className
)}
{...props}
/>
);
)
}
function ItemFooter({ className, ...props }: React.ComponentProps<'div'>) {
function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="item-footer"
className={cn('flex basis-full items-center justify-between gap-2', className)}
className={cn(
"flex basis-full items-center justify-between gap-2",
className
)}
{...props}
/>
);
)
}
export {
@ -169,4 +190,4 @@ export {
ItemDescription,
ItemHeader,
ItemFooter,
};
}

View file

@ -1,7 +1,7 @@
'use client';
import * as LabelPrimitive from '@radix-ui/react-label';
import * as React from 'react';
import * as LabelPrimitive from '@radix-ui/react-label';
import { cn } from '@/lib/utils';

View file

@ -1,7 +1,7 @@
'use client';
import * as PopoverPrimitive from '@radix-ui/react-popover';
import * as React from 'react';
import * as PopoverPrimitive from '@radix-ui/react-popover';
import { cn } from '@/lib/utils';

View file

@ -1,9 +1,9 @@
'use client';
"use client"
import * as ProgressPrimitive from '@radix-ui/react-progress';
import * as React from 'react';
import * as React from "react"
import * as ProgressPrimitive from "@radix-ui/react-progress"
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
function Progress({
className,
@ -13,7 +13,10 @@ function Progress({
return (
<ProgressPrimitive.Root
data-slot="progress"
className={cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className)}
className={cn(
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
className
)}
{...props}
>
<ProgressPrimitive.Indicator
@ -22,7 +25,7 @@ function Progress({
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
/>
</ProgressPrimitive.Root>
);
)
}
export { Progress };
export { Progress }

View file

@ -1,9 +1,9 @@
'use client';
"use client"
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
import * as React from 'react';
import * as React from "react"
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
function ScrollArea({
className,
@ -13,7 +13,7 @@ function ScrollArea({
return (
<ScrollAreaPrimitive.Root
data-slot="scroll-area"
className={cn('relative', className)}
className={cn("relative", className)}
{...props}
>
<ScrollAreaPrimitive.Viewport
@ -25,12 +25,12 @@ function ScrollArea({
<ScrollBar />
<ScrollAreaPrimitive.Corner />
</ScrollAreaPrimitive.Root>
);
)
}
function ScrollBar({
className,
orientation = 'vertical',
orientation = "vertical",
...props
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
return (
@ -38,10 +38,12 @@ function ScrollBar({
data-slot="scroll-area-scrollbar"
orientation={orientation}
className={cn(
'flex touch-none p-px transition-colors select-none',
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent',
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent',
className,
"flex touch-none p-px transition-colors select-none",
orientation === "vertical" &&
"h-full w-2.5 border-l border-l-transparent",
orientation === "horizontal" &&
"h-2.5 flex-col border-t border-t-transparent",
className
)}
{...props}
>
@ -50,7 +52,7 @@ function ScrollBar({
className="bg-border relative flex-1 rounded-full"
/>
</ScrollAreaPrimitive.ScrollAreaScrollbar>
);
)
}
export { ScrollArea, ScrollBar };
export { ScrollArea, ScrollBar }

View file

@ -1,30 +1,36 @@
'use client';
"use client"
import * as SelectPrimitive from '@radix-ui/react-select';
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
import * as React from 'react';
import * as React from "react"
import * as SelectPrimitive from "@radix-ui/react-select"
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
return <SelectPrimitive.Root data-slot="select" {...props} />;
function Select({
...props
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
return <SelectPrimitive.Root data-slot="select" {...props} />
}
function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
function SelectGroup({
...props
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
return <SelectPrimitive.Group data-slot="select-group" {...props} />
}
function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
function SelectValue({
...props
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
return <SelectPrimitive.Value data-slot="select-value" {...props} />
}
function SelectTrigger({
className,
size = 'default',
size = "default",
children,
...props
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
size?: 'sm' | 'default';
size?: "sm" | "default"
}) {
return (
<SelectPrimitive.Trigger
@ -32,7 +38,7 @@ function SelectTrigger({
data-size={size}
className={cn(
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
className
)}
{...props}
>
@ -41,14 +47,14 @@ function SelectTrigger({
<ChevronDownIcon className="size-4 opacity-50" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
);
)
}
function SelectContent({
className,
children,
position = 'popper',
align = 'center',
position = "popper",
align = "center",
...props
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
return (
@ -56,10 +62,10 @@ function SelectContent({
<SelectPrimitive.Content
data-slot="select-content"
className={cn(
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md',
position === 'popper' &&
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
className,
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className
)}
position={position}
align={align}
@ -68,9 +74,9 @@ function SelectContent({
<SelectScrollUpButton />
<SelectPrimitive.Viewport
className={cn(
'p-1',
position === 'popper' &&
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1',
"p-1",
position === "popper" &&
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
)}
>
{children}
@ -78,17 +84,20 @@ function SelectContent({
<SelectScrollDownButton />
</SelectPrimitive.Content>
</SelectPrimitive.Portal>
);
)
}
function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
function SelectLabel({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
return (
<SelectPrimitive.Label
data-slot="select-label"
className={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
{...props}
/>
);
)
}
function SelectItem({
@ -101,7 +110,7 @@ function SelectItem({
data-slot="select-item"
className={cn(
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
className,
className
)}
{...props}
>
@ -112,7 +121,7 @@ function SelectItem({
</span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
</SelectPrimitive.Item>
);
)
}
function SelectSeparator({
@ -122,10 +131,10 @@ function SelectSeparator({
return (
<SelectPrimitive.Separator
data-slot="select-separator"
className={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
{...props}
/>
);
)
}
function SelectScrollUpButton({
@ -135,12 +144,15 @@ function SelectScrollUpButton({
return (
<SelectPrimitive.ScrollUpButton
data-slot="select-scroll-up-button"
className={cn('flex cursor-default items-center justify-center py-1', className)}
className={cn(
"flex cursor-default items-center justify-center py-1",
className
)}
{...props}
>
<ChevronUpIcon className="size-4" />
</SelectPrimitive.ScrollUpButton>
);
)
}
function SelectScrollDownButton({
@ -150,12 +162,15 @@ function SelectScrollDownButton({
return (
<SelectPrimitive.ScrollDownButton
data-slot="select-scroll-down-button"
className={cn('flex cursor-default items-center justify-center py-1', className)}
className={cn(
"flex cursor-default items-center justify-center py-1",
className
)}
{...props}
>
<ChevronDownIcon className="size-4" />
</SelectPrimitive.ScrollDownButton>
);
)
}
export {
@ -169,4 +184,4 @@ export {
SelectSeparator,
SelectTrigger,
SelectValue,
};
}

View file

@ -1,13 +1,13 @@
'use client';
"use client"
import * as SeparatorPrimitive from '@radix-ui/react-separator';
import * as React from 'react';
import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"
import { cn } from '@/lib/utils';
import { cn } from "@/lib/utils"
function Separator({
className,
orientation = 'horizontal',
orientation = "horizontal",
decorative = true,
...props
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
@ -17,12 +17,12 @@ function Separator({
decorative={decorative}
orientation={orientation}
className={cn(
'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
className,
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
className
)}
{...props}
/>
);
)
}
export { Separator };
export { Separator }

View file

@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import * as SheetPrimitive from '@radix-ui/react-dialog';
import { XIcon } from 'lucide-react';
import * as React from 'react';
import { cn } from '@/lib/utils';

View file

@ -548,7 +548,7 @@ function SidebarMenuAction({
'peer-data-[size=lg]/menu-button:top-2.5',
'group-data-[collapsible=icon]:hidden',
showOnHover &&
'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',
'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',
className,
)}
{...props}
@ -690,5 +690,6 @@ export {
SidebarRail,
SidebarSeparator,
SidebarTrigger,
useSidebar,
useSidebar
};

View file

@ -1,7 +1,7 @@
'use client';
import * as SwitchPrimitive from '@radix-ui/react-switch';
import * as React from 'react';
import * as SwitchPrimitive from '@radix-ui/react-switch';
import { cn } from '@/lib/utils';

View file

@ -1,7 +1,7 @@
'use client';
import * as TabsPrimitive from '@radix-ui/react-tabs';
import * as React from 'react';
import * as TabsPrimitive from '@radix-ui/react-tabs';
import { cn } from '@/lib/utils';

View file

@ -1,7 +1,7 @@
'use client';
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
import * as React from 'react';
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
import { cn } from '@/lib/utils';

View file

@ -4,19 +4,13 @@ import { NextResponse, type MiddlewareConfig, type NextRequest } from 'next/serv
const publicRoutes = [
{ path: '/login', whenAuthenticated: 'redirect' },
{ path: '/register', whenAuthenticated: 'redirect' },
{ path: '/', whenAuthenticated: 'next' },
] as const;
const ROOT_PATH = '/login'; // url raiz
export function middleware(request: NextRequest) {
const path = request.nextUrl.pathname;
// --- AJUSTE NECESSÁRIO PARA ONLYOFFICE ---
// Se a rota termina em .docx, libera o acesso imediatamente (sem checar token)
if (path.endsWith('.docx')) {
return NextResponse.next();
}
// -----------------------------------------
const publicRoute = publicRoutes.find((route) => route.path === path);
const authToken = request.cookies.get('access_token');
@ -32,8 +26,6 @@ export function middleware(request: NextRequest) {
// 3. Autenticado em rota pública com flag "redirect" → vai para raiz
if (authToken && publicRoute && publicRoute.whenAuthenticated === 'redirect') {
// OBS: Se ROOT_PATH for '/login', isso pode gerar um loop infinito para usuários logados.
// O ideal seria redirecionar para '/' (dashboard), mas mantive seu código original.
return NextResponse.redirect(new URL(ROOT_PATH, request.url));
}
@ -61,7 +53,7 @@ export function middleware(request: NextRequest) {
export const config: MiddlewareConfig = {
matcher: [
// ignora APIs, arquivos estáticos, metadados E ARQUIVOS .DOCX
'/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|images|.*\\.docx$).*)',
// ignora APIs, arquivos estáticos e metadados
'/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|images).*)',
],
};
};

View file

@ -1,8 +1,5 @@
'use client';
import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
import React from 'react';
import { Button } from '@/components/ui/button';
import {
Command,
@ -18,6 +15,8 @@ import { cn } from '@/lib/utils';
import { CCaixaServicoReadInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoReadInterface';
import { useCCaixaServicoReadHook } from '@/packages/administrativo/interfaces/CCaixaServico/useCCaixaServicoReadHook';
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
import React from 'react';
export default function CCaixaServicoSelect({ sistema_id, field }: any) {
const cCaixaServicoReadParams: CCaixaServicoReadInterface = { sistema_id };
@ -59,7 +58,7 @@ export default function CCaixaServicoSelect({ sistema_id, field }: any) {
</Button>
</FormControl>
</PopoverTrigger>
<PopoverContent className="w-[var(--radix-popover-trigger-width)] p-0">
<PopoverContent className="w-full p-0">
<Command>
<CommandInput placeholder="Buscar etiquetas/carimbos..." />
<CommandList>

View file

@ -14,11 +14,13 @@ import GCalculoInterface from '@/packages/administrativo/interfaces/GCalculo/GCa
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
import { SortableHeader } from '@/shared/components/dataTable/SortableHeader';
export default function GCalculoColumns(
onEdit: (item: GCalculoInterface, isEditingFormStatus: boolean) => void,
onDelete: (item: GCalculoInterface, isEditingFormStatus: boolean) => void,
): ColumnDef<GCalculoInterface>[] {
return [
// Descrição
{
accessorKey: 'apresentante',

View file

@ -38,6 +38,7 @@ export default function GCalculoForm({
onSave,
buttonIsLoading,
}: GCalculoFormInterface) {
const form = useGCalculoFormHook({});
// Atualiza o formulário quando recebe dados para edição
@ -77,7 +78,10 @@ export default function GCalculoForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Apresentante</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>
@ -93,7 +97,10 @@ export default function GCalculoForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Observação</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>
@ -108,7 +115,10 @@ export default function GCalculoForm({
render={({ field }) => (
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Emolumento</FormLabel>
<GEmolumentoSelect field={field} sistema_id={2} />
<GEmolumentoSelect
field={field}
sistema_id={2}
/>
<FormMessage />
</FormItem>
)}
@ -123,7 +133,10 @@ export default function GCalculoForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Valor Documento</FormLabel>
<FormControl>
<Input {...field} type="number" />
<Input
{...field}
type="number"
/>
</FormControl>
<FormMessage />
</FormItem>
@ -139,7 +152,10 @@ export default function GCalculoForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Quantidade</FormLabel>
<FormControl>
<Input {...field} type="number" />
<Input
{...field}
type="number"
/>
</FormControl>
<FormMessage />
</FormItem>

View file

@ -2,6 +2,7 @@
import { useCallback, useState } from 'react';
import { useGCalculoDeleteHook } from '@/packages/administrativo/hooks/GCalculo/useGCalculoDeleteHook';
import { useGCalculoIndexHook } from '@/packages/administrativo/hooks/GCalculo/useGCalculoIndexHook';
import { useGCalculoSaveHook } from '@/packages/administrativo/hooks/GCalculo/useGCalculoSaveHook';
@ -14,6 +15,7 @@ import GCalculoForm from './GCalculoForm';
import GCalculoTable from './GCalculoTable';
export default function GCalculoIndex() {
// Controle de estado do botão
const [buttonIsLoading, setButtonIsLoading] = useState(false);
@ -94,7 +96,9 @@ export default function GCalculoIndex() {
await deleteGCalculo(itemToDelete);
// Atualiza a lista de cálculos em memória, removendo o item pelo índice
setGCalculo((prev) => prev.filter((_, index) => index !== itemToDelete.index));
setGCalculo((prev) =>
prev.filter((_, index) => index !== itemToDelete.index)
);
// Limpa o item selecionado para exclusão
setItemToDelete(null);
@ -115,7 +119,10 @@ export default function GCalculoIndex() {
}}
/>
{/* Tabela de andamentos */}
<GCalculoTable data={gCalculo} onEdit={handleOpenForm} onDelete={handleConfirmDelete} />
<GCalculoTable
data={gCalculo}
onEdit={handleOpenForm}
onDelete={handleConfirmDelete} />
{/* Modal de confirmação */}
{isConfirmOpen && (
<ConfirmDialog

View file

@ -6,9 +6,11 @@ import { DataTable } from '@/shared/components/dataTable/DataTable';
import GCalculoColumns from './GCalculoColumns';
export default function GCalculoTable({ data, onEdit, onDelete }: GCalculoTableInterface) {
const columns = GCalculoColumns(onEdit, onDelete);
return (
<div>
<DataTable
data={data}
@ -17,5 +19,6 @@ export default function GCalculoTable({ data, onEdit, onDelete }: GCalculoTableI
filterPlaceholder="Buscar por apresentante da natureza..."
/>
</div>
);
}

View file

@ -13,7 +13,7 @@ import {
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
import { SortableHeader } from '@/shared/components/dataTable/SortableHeader';
import GCartorioInterface from '@/packages/administrativo/interfaces/GCartorio/GCartorioInterface';
import GCartorioInterface from '../../interfaces/GCartorio/GCartorioInterface';
export default function GCartorioColumns(
onEdit: (item: GCartorioInterface, isEditingFormStatus: boolean) => void,

View file

@ -1,6 +1,6 @@
'use client';
import { useEffect } from 'react';
import React, { useEffect } from 'react';
import { Button } from '@/components/ui/button';
import {
@ -24,8 +24,8 @@ import { Input } from '@/components/ui/input';
import { ResetFormIfData } from '@/shared/actions/form/ResetFormIfData';
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
import { useGCartorioFormHook } from '@/packages/administrativo/hooks/GCartorio/useGCartorioFormHook';
import { GCartorioFormInterface } from '@/packages/administrativo/interfaces/GCartorio/GCartorioFormInterface';
import { useGCartorioFormHook } from '../../hooks/GCartorio/useGCartorioFormHook';
import { GCartorioFormInterface } from '../../interfaces/GCartorio/GCartorioFormInterface';
/**
* Formulário de cadastro/edição de Natureza
@ -409,6 +409,7 @@ export default function GCartorioForm({
</form>
</Form>
</DialogContent>
</Dialog>
);
}

View file

@ -2,6 +2,7 @@
import { useEffect, useState, useCallback } from 'react';
import { useGCartorioDeleteHook } from '@/packages/administrativo/hooks/GCartorio/useGCartorioDeleteHook';
import { useGCartorioIndexHook } from '@/packages/administrativo/hooks/GCartorio/useGCartorioIndexHook';
import { useGCartorioSaveHook } from '@/packages/administrativo/hooks/GCartorio/useGCartorioSaveHook';
@ -15,6 +16,7 @@ import GCartorioForm from './GCartorioForm';
import GCartorioTable from './GCartorioTable';
export default function GCartorioIndex() {
// Controle de estado do botão
const [buttonIsLoading, setButtonIsLoading] = useState(false);

View file

@ -2,8 +2,8 @@
import { DataTable } from '@/shared/components/dataTable/DataTable';
import GCartorioTableInterface from '@/packages/administrativo/interfaces/GCartorio/GCartorioTableInterface';
import GCartorioColumns from './GCartorioColumns';
import GCartorioTableInterface from '../../interfaces/GCartorio/GCartorioTableInterface';
/**
* Componente principal da tabela de Naturezas

View file

@ -33,7 +33,7 @@ import {
} from '@/components/ui/select';
import { useGUfReadHook } from '@/packages/administrativo/hooks/GUF/useGUfReadHook';
import { GCidadeSchema } from '@/packages/administrativo/schemas/GCidade/GCidadeSchema';
import { GCidadeSchema } from '../../schemas/GCidade/GCidadeSchema';
// Hook responsável em trazer todos os estados brasileiros

View file

@ -20,7 +20,7 @@ import {
TableRow,
} from '@/components/ui/table';
import GCidadeInterface from '@/packages/administrativo/interfaces/GCidade/GCidadeInterface';
import GCidadeInterface from '../../interfaces/GCidade/GCidadeInterface';
// Tipagem das props do componente da tabela
interface GCidadeTableProps {

View file

@ -14,14 +14,16 @@ import {
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
import { SortableHeader } from '@/shared/components/dataTable/SortableHeader';
import GEmolumentoInterface from '@/packages/administrativo/interfaces/GEmolumento/GEmolumentoInterface';
import GEmolumentoInterface from '../../interfaces/GEmolumento/GEmolumentoInterface';
export default function GEmolumentoColumns(
onEdit: (item: GEmolumentoInterface, isEditingFormStatus: boolean) => void,
onDelete: (item: GEmolumentoInterface, isEditingFormStatus: boolean) => void,
emolumentoPeriodoId: number,
): ColumnDef<GEmolumentoInterface>[] {
return [
// ID
{
accessorKey: 'emolumento_id',
@ -58,9 +60,7 @@ export default function GEmolumentoColumns(
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link
href={`/administrativo/financeiro/emolumentos/${Number(row.getValue('emolumento_id'))}/${emolumentoPeriodoId}/itens`}
>
<Link href={`/administrativo/financeiro/emolumentos/${Number(row.getValue('emolumento_id'))}/${emolumentoPeriodoId}/itens`}>
<ListIcon className="mr-2 h-4 w-4" />
Itens
</Link>

View file

@ -30,8 +30,8 @@ import SistemasSelect from '@/shared/components/sistemas/SistemasSelect';
import SituacoesSelect from '@/shared/components/situacoes/SituacoesSelect';
import TipoEmolumentoSelect from '@/shared/components/tipoEmolumento/TipoAtoAnteriorSelect';
import { useGEmolumentoFormHook } from '@/packages/administrativo/hooks/GEmolumento/useGEmolumentoFormHook';
import { GEmolumentoFormInterface } from '@/packages/administrativo/interfaces/GEmolumento/GEmolumentoFormInterface';
import { useGEmolumentoFormHook } from '../../hooks/GEmolumento/useGEmolumentoFormHook';
import { GEmolumentoFormInterface } from '../../interfaces/GEmolumento/GEmolumentoFormInterface';
import GSeloGrupoSelect from '../GSeloGrupo/GSeloGrupoSelect';
/**
@ -140,7 +140,7 @@ export default function GEmolumentoForm({
control={form.control}
name="selo_grupo_id"
render={({ field }) => (
<FormItem className="w-full">
<FormItem className='w-full'>
<FormLabel>Selo Grupo</FormLabel>
<GSeloGrupoSelect field={field} />
<FormMessage />
@ -155,7 +155,7 @@ export default function GEmolumentoForm({
control={form.control}
name="reg_averb"
render={({ field }) => (
<FormItem className="w-full">
<FormItem className='w-full'>
<FormLabel>Registro/Averbação</FormLabel>
<Input {...field} type="text" maxLength={1} />
<FormMessage />
@ -218,8 +218,7 @@ export default function GEmolumentoForm({
<FormItem>
<FormLabel>Código Nota</FormLabel>
<FormControl>
<Input
{...field}
<Input {...field}
type="number"
step="0.01"
onChange={(e) => field.onChange(parseNumberInput(e))}
@ -272,8 +271,7 @@ export default function GEmolumentoForm({
<FormItem>
<FormLabel>Valor Máximo Certidão</FormLabel>
<FormControl>
<Input
{...field}
<Input {...field}
type="number"
step="0.001"
onChange={(e) => field.onChange(parseNumberInput(e))}

View file

@ -15,6 +15,7 @@ import GEmolumentoForm from './GEmolumentoForm';
import GEmolumentoTable from './GEmolumentoTable';
export default function GEmolumentoIndex() {
// Controle de estado do botão
const [buttonIsLoading, setButtonIsLoading] = useState(false);

View file

@ -5,12 +5,12 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from '@/components/ui/command';
import { FormControl } from '@/components/ui/form';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
@ -21,130 +21,131 @@ import GetCapitalize from '@/shared/actions/text/GetCapitalize';
// Tipagem das props do componente
interface GEmolumentoSelectProps {
sistema_id: number;
field: any;
onSelectChange?: (emolumento: { emolumento_id: number; descricao: string }) => void;
className?: string;
sistema_id: number;
field: any;
onSelectChange?: (emolumento: { emolumento_id: number; descricao: string }) => void;
className?: string;
}
// Componente principal do select de emolumentos
export default function GEmolumentoServicoSelect({
sistema_id,
field,
onSelectChange,
className,
}: GEmolumentoSelectProps) {
const [open, setOpen] = useState(false);
const [isLoading, setIsLoading] = useState(false);
// Define parâmetros de leitura para o hook que busca os emolumentos
const gEmolumentoReadParams: GEmolumentoReadInterface = {
sistema_id,
urlParams: { situacao: 'A' },
};
const { gEmolumento = [], fetchGEmolumento } = useGEmolumentoReadHook();
field,
onSelectChange,
className,
}: GEmolumentoSelectProps) {
const [open, setOpen] = useState(false);
const [isLoading, setIsLoading] = useState(false);
/**
* Efeito para buscar os dados apenas uma vez.
*/
const loadData = useCallback(async () => {
if (gEmolumento.length) return;
setIsLoading(true);
await fetchGEmolumento(gEmolumentoReadParams);
setIsLoading(false);
}, [gEmolumento.length, fetchGEmolumento, gEmolumentoReadParams]);
// Define parâmetros de leitura para o hook que busca os emolumentos
const gEmolumentoReadParams: GEmolumentoReadInterface = { sistema_id, urlParams: { situacao: 'A' } };
const { gEmolumento = [], fetchGEmolumento } = useGEmolumentoReadHook();
useEffect(() => {
loadData();
}, [loadData]);
/**
* Efeito para buscar os dados apenas uma vez.
*/
const loadData = useCallback(async () => {
if (gEmolumento.length) return;
setIsLoading(true);
await fetchGEmolumento(gEmolumentoReadParams);
setIsLoading(false);
}, [gEmolumento.length, fetchGEmolumento, gEmolumentoReadParams]);
/**
* Memoriza o item selecionado para evitar reprocessamentos.
*/
const selected = useMemo(
() => gEmolumento.find((item) => String(item.emolumento_id) === String(field?.value?.id ?? '')),
[gEmolumento, field?.value],
);
useEffect(() => {
loadData();
}, [loadData]);
/**
* Manipulador de seleção com verificação segura.
*/
const handleSelect = useCallback(
(item: any) => {
if (!field?.onChange) return;
/**
* Memoriza o item selecionado para evitar reprocessamentos.
*/
const selected = useMemo(
() =>
gEmolumento.find(
(item) => String(item.emolumento_id) === String(field?.value?.id ?? ''),
),
[gEmolumento, field?.value],
);
const selectedValue = {
emolumento_id: Number(item.emolumento_id),
descricao: item.descricao,
sistema_id: item.sistema_id,
};
/**
* Manipulador de seleção com verificação segura.
*/
const handleSelect = useCallback(
(item: any) => {
if (!field?.onChange) return;
field.onChange(selectedValue);
const selectedValue = {
emolumento_id: Number(item.emolumento_id),
descricao: item.descricao,
sistema_id: item.sistema_id,
};
if (onSelectChange) onSelectChange(selectedValue);
field.onChange(selectedValue);
setOpen(false);
},
[field, onSelectChange],
);
if (onSelectChange) onSelectChange(selectedValue);
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<FormControl className="w-full">
<Button
variant="outline"
role="combobox"
aria-expanded={open}
disabled={isLoading}
className={cn(
'min-h-[2.5rem] w-full justify-between text-left break-words whitespace-normal',
className,
)}
>
{isLoading
? 'Carregando...'
: field.value?.descricao
? GetCapitalize(field.value.descricao)
: 'Selecione emolumento'}
<ChevronsUpDownIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</FormControl>
</PopoverTrigger>
setOpen(false);
},
[field, onSelectChange],
);
<PopoverContent
align="start"
side="bottom"
className="w-[var(--radix-popover-trigger-width)] max-w-full p-0"
>
<Command>
<CommandInput placeholder="Buscar emolumentos..." disabled={isLoading} />
<CommandList>
<CommandEmpty>
{isLoading ? 'Carregando...' : 'Nenhum resultado encontrado.'}
</CommandEmpty>
<CommandGroup>
{gEmolumento.map((item) => (
<CommandItem
key={item.emolumento_id}
value={item.descricao?.toLowerCase() ?? ''}
onSelect={() => handleSelect(item)}
>
<CheckIcon
className={cn(
'mr-2 h-4 w-4',
String(field?.value?.emolumento_id ?? '') === String(item.emolumento_id)
? 'opacity-100'
: 'opacity-0',
)}
/>
{GetCapitalize(item.descricao ?? '')}
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
);
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<FormControl className="w-full">
<Button
variant="outline"
role="combobox"
aria-expanded={open}
disabled={isLoading}
className={cn(
'justify-between min-h-[2.5rem] w-full text-left break-words whitespace-normal',
className,
)}
>
{isLoading
? 'Carregando...'
: field.value?.descricao
? GetCapitalize(field.value.descricao)
: 'Selecione emolumento'}
<ChevronsUpDownIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</FormControl>
</PopoverTrigger>
<PopoverContent
align="start"
side="bottom"
className="w-[var(--radix-popover-trigger-width)] max-w-full p-0"
>
<Command>
<CommandInput placeholder="Buscar emolumentos..." disabled={isLoading} />
<CommandList>
<CommandEmpty>
{isLoading ? 'Carregando...' : 'Nenhum resultado encontrado.'}
</CommandEmpty>
<CommandGroup>
{gEmolumento.map((item) => (
<CommandItem
key={item.emolumento_id}
value={item.descricao?.toLowerCase() ?? ''}
onSelect={() => handleSelect(item)}
>
<CheckIcon
className={cn(
'mr-2 h-4 w-4',
String(field?.value?.emolumento_id ?? '') ===
String(item.emolumento_id)
? 'opacity-100'
: 'opacity-0',
)}
/>
{GetCapitalize(item.descricao ?? '')}
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
);
}

View file

@ -2,24 +2,20 @@
import { DataTable } from '@/shared/components/dataTable/DataTable';
import GEmolumentoTableInterface from '@/packages/administrativo/interfaces/GEmolumento/GEmolumentoTableInterface';
import GEmolumentoTableInterface from '../../interfaces/GEmolumento/GEmolumentoTableInterface';
import GEmolumentoPeriodoSelect from '../GEmolumentoPeriodo/GEmolumentoPeriodoSelect';
import GEmolumentoColumns from './GEmolumentoColumns';
/**
* Componente principal da tabela de Naturezas
*/
export default function GEmolumentoTable({
data,
onEdit,
onDelete,
onSelectedEmolumentoPeriodo,
emolumentoPeriodoId,
}: GEmolumentoTableInterface) {
export default function GEmolumentoTable({ data, onEdit, onDelete, onSelectedEmolumentoPeriodo, emolumentoPeriodoId }: GEmolumentoTableInterface) {
const columns = GEmolumentoColumns(onEdit, onDelete, emolumentoPeriodoId);
return (
<div>
<GEmolumentoPeriodoSelect onSelectedEmolumentoPeriodo={onSelectedEmolumentoPeriodo} />
<GEmolumentoPeriodoSelect
onSelectedEmolumentoPeriodo={onSelectedEmolumentoPeriodo}
/>
<DataTable
data={data}
columns={columns}
@ -28,4 +24,4 @@ export default function GEmolumentoTable({
/>
</div>
);
}
}

View file

@ -13,7 +13,7 @@ import {
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
import { SortableHeader } from '@/shared/components/dataTable/SortableHeader';
import GEmolumentoItemInterface from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemInterface';
import GEmolumentoItemInterface from '../../interfaces/GEmolumentoItem/GEmolumentoItemInterface';
export default function GEmolumentoItemColumns(
onEdit: (item: GEmolumentoItemInterface, isEditingFormStatus: boolean) => void,

View file

@ -27,8 +27,8 @@ import { parseNumberInput } from '@/shared/actions/form/parseNumberInput';
import { ResetFormIfData } from '@/shared/actions/form/ResetFormIfData';
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
import { useGEmolumentoItemFormHook } from '@/packages/administrativo/hooks/GEmolumentoItem/useGEmolumentoItemFormHook';
import { GEmolumentoItemFormInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemFormInterface';
import { useGEmolumentoItemFormHook } from '../../hooks/GEmolumentoItem/useGEmolumentoItemFormHook';
import { GEmolumentoItemFormInterface } from '../../interfaces/GEmolumentoItem/GEmolumentoItemFormInterface';
export default function GEmolumentoItemForm({
isOpen,
@ -37,6 +37,7 @@ export default function GEmolumentoItemForm({
onSave,
buttonIsLoading,
}: GEmolumentoItemFormInterface) {
// Inicializa o formulário
const form = useGEmolumentoItemFormHook({});
@ -85,8 +86,7 @@ export default function GEmolumentoItemForm({
<FormItem>
<FormLabel>Valor Início</FormLabel>
<FormControl>
<Input
{...field}
<Input {...field}
type="number"
onChange={(e) => field.onChange(parseNumberInput(e))}
/>
@ -104,8 +104,7 @@ export default function GEmolumentoItemForm({
<FormItem>
<FormLabel>Valor Fim</FormLabel>
<FormControl>
<Input
{...field}
<Input {...field}
type="number"
onChange={(e) => field.onChange(parseNumberInput(e))}
/>
@ -123,8 +122,7 @@ export default function GEmolumentoItemForm({
<FormItem>
<FormLabel>Valor Taxa Judiciária</FormLabel>
<FormControl>
<Input
{...field}
<Input {...field}
type="number"
onChange={(e) => field.onChange(parseNumberInput(e))}
/>

View file

@ -12,17 +12,16 @@ import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDi
import Loading from '@/shared/components/loading/loading';
import Header from '@/shared/components/structure/Header';
import GEmolumentoItemForm from './GEmolumentoItemForm';
import GEmolumentoItemTable from './GEmolumentoItemTable';
export default function GEmolumentoItemIndex({
emolumento_id,
emolumento_periodo_id,
}: GEmolumentoItemIndexInterface) {
export default function GEmolumentoItemIndex({ emolumento_id, emolumento_periodo_id }: GEmolumentoItemIndexInterface) {
const gEmolumentoItemParams = {
emolumento_id: emolumento_id,
emolumento_periodo_id: emolumento_periodo_id,
};
emolumento_periodo_id: emolumento_periodo_id
}
// Controle de estado do botão
const [buttonIsLoading, setButtonIsLoading] = useState(false);
@ -49,8 +48,7 @@ export default function GEmolumentoItemIndex({
*/
const handleOpenForm = useCallback((data: GEmolumentoItemInterface | null) => {
// Se não houver dados (criação), cria um objeto inicial com imovel_id
const initialData: GEmolumentoItemInterface =
data ?? ({ emolumento_id, emolumento_periodo_id } as GEmolumentoItemInterface);
const initialData: GEmolumentoItemInterface = data ?? ({ emolumento_id, emolumento_periodo_id } as GEmolumentoItemInterface);
setSelectedData(initialData);
setIsFormOpen(true);
}, []);

View file

@ -8,11 +8,7 @@ import GEmolumentoItemColumns from './GEmolumentoItemColumns';
/**
* Componente principal da tabela de Naturezas
*/
export default function GEmolumentoItemTable({
data,
onEdit,
onDelete,
}: GEmolumentoItemTableInterface) {
export default function GEmolumentoItemTable({ data, onEdit, onDelete }: GEmolumentoItemTableInterface) {
const columns = GEmolumentoItemColumns(onEdit, onDelete);
return (
<div>

View file

@ -14,7 +14,7 @@ import { FormatDateTime } from '@/shared/actions/dateTime/FormatDateTime';
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
import { SortableHeader } from '@/shared/components/dataTable/SortableHeader';
import GEmolumentoPeriodoInterface from '@/packages/administrativo/interfaces/GEmolumentoPeriodo/GEmolumentoPeriodoInterface';
import GEmolumentoPeriodoInterface from '../../interfaces/GEmolumentoPeriodo/GEmolumentoPeriodoInterface';
export default function GEmolumentoPeriodoColumns(
onEdit: (item: GEmolumentoPeriodoInterface, isEditingFormStatus: boolean) => void,

View file

@ -1,6 +1,6 @@
'use client';
import { useEffect } from 'react';
import React, { useEffect } from 'react';
import { Button } from '@/components/ui/button';
import {
@ -24,8 +24,8 @@ import { Input } from '@/components/ui/input';
import { ResetFormIfData } from '@/shared/actions/form/ResetFormIfData';
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
import { useGEmolumentoPeriodoFormHook } from '@/packages/administrativo/hooks/GEmolumentoPeriodo/useGEmolumentoPeriodoFormHook';
import { GEmolumentoPeriodoFormInterface } from '@/packages/administrativo/interfaces/GEmolumentoPeriodo/GEmolumentoPeriodoFormInterface';
import { useGEmolumentoPeriodoFormHook } from '../../hooks/GEmolumentoPeriodo/useGEmolumentoPeriodoFormHook';
import { GEmolumentoPeriodoFormInterface } from '../../interfaces/GEmolumentoPeriodo/GEmolumentoPeriodoFormInterface';
/**
* Formulário de cadastro/edição de Natureza
@ -77,7 +77,10 @@ export default function GEmolumentoPeriodoForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Palavra</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>

View file

@ -2,6 +2,7 @@
import { useEffect, useState, useCallback } from 'react';
import { useGEmolumentoPeriodoDeleteHook } from '@/packages/administrativo/hooks/GEmolumentoPeriodo/useGEmolumentoPeriodoDeleteHook';
import { useGEmolumentoPeriodoIndexHook } from '@/packages/administrativo/hooks/GEmolumentoPeriodo/useGEmolumentoPeriodoIndexHook';
import { useGEmolumentoPeriodoSaveHook } from '@/packages/administrativo/hooks/GEmolumentoPeriodo/useGEmolumentoPeriodoSaveHook';
@ -15,6 +16,7 @@ import GEmolumentoPeriodoForm from './GEmolumentoPeriodoForm';
import GEmolumentoPeriodoTable from './GEmolumentoPeriodoTable';
export default function GEmolumentoPeriodoIndex() {
// Controle de estado do botão
const [buttonIsLoading, setButtonIsLoading] = useState(false);
@ -130,11 +132,7 @@ export default function GEmolumentoPeriodoIndex() {
}}
/>
{/* Tabela de andamentos */}
<GEmolumentoPeriodoTable
data={gEmolumentoPeriodo}
onEdit={handleOpenForm}
onDelete={handleConfirmDelete}
/>
<GEmolumentoPeriodoTable data={gEmolumentoPeriodo} onEdit={handleOpenForm} onDelete={handleConfirmDelete} />
{/* Modal de confirmação */}
{isConfirmOpen && (
<ConfirmDialog

View file

@ -5,108 +5,106 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
import { Button } from '@/components/ui/button';
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from '@/components/ui/command';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
import { cn } from '@/lib/utils';
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
import { useGEmolumentoPeriodoIndexHook } from '@/packages/administrativo/hooks/GEmolumentoPeriodo/useGEmolumentoPeriodoIndexHook';
import GEmolumentoPeriodoSelectInterface from '@/packages/administrativo/interfaces/GEmolumentoPeriodo/GEmolumentoPeriodoSelectInterface';
import { useGEmolumentoPeriodoIndexHook } from '../../hooks/GEmolumentoPeriodo/useGEmolumentoPeriodoIndexHook';
import GEmolumentoPeriodoSelectInterface from '../../interfaces/GEmolumentoPeriodo/GEmolumentoPeriodoSelectInterface';
export default function GEmolumentoPeriodoSelect({
onSelectedEmolumentoPeriodo,
}: GEmolumentoPeriodoSelectInterface) {
const [open, setOpen] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [selectedId, setSelectedId] = useState<number | null>(null);
export default function GEmolumentoPeriodoSelect({ onSelectedEmolumentoPeriodo }: GEmolumentoPeriodoSelectInterface) {
const { gEmolumentoPeriodo, indexGEmolumentoPeriodo } = useGEmolumentoPeriodoIndexHook();
const [open, setOpen] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [selectedId, setSelectedId] = useState<number | null>(null);
// ---------------------------------------------------------------------------
// Carrega os períodos apenas uma vez
// ---------------------------------------------------------------------------
const loadData = useCallback(async () => {
if (gEmolumentoPeriodo.length) return;
setIsLoading(true);
await indexGEmolumentoPeriodo();
setIsLoading(false);
}, [gEmolumentoPeriodo.length, indexGEmolumentoPeriodo]);
const { gEmolumentoPeriodo, indexGEmolumentoPeriodo } = useGEmolumentoPeriodoIndexHook();
useEffect(() => {
loadData();
}, [loadData]);
// ---------------------------------------------------------------------------
// Carrega os períodos apenas uma vez
// ---------------------------------------------------------------------------
const loadData = useCallback(async () => {
if (gEmolumentoPeriodo.length) return;
setIsLoading(true);
await indexGEmolumentoPeriodo();
setIsLoading(false);
}, [gEmolumentoPeriodo.length, indexGEmolumentoPeriodo]);
// ---------------------------------------------------------------------------
// Item selecionado
// ---------------------------------------------------------------------------
const selected = useMemo(
() =>
gEmolumentoPeriodo.find((b) => String(b.emolumento_periodo_id) === String(selectedId ?? '')),
[gEmolumentoPeriodo, selectedId],
);
useEffect(() => {
loadData();
}, [loadData]);
// ---------------------------------------------------------------------------
// Ao selecionar um item → dispara novo hook
// ---------------------------------------------------------------------------
const handleSelect = async (id: number) => {
setSelectedId(id);
setOpen(false);
onSelectedEmolumentoPeriodo(id);
};
// ---------------------------------------------------------------------------
// Item selecionado
// ---------------------------------------------------------------------------
const selected = useMemo(
() => gEmolumentoPeriodo.find((b) => String(b.emolumento_periodo_id) === String(selectedId ?? '')),
[gEmolumentoPeriodo, selectedId]
);
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<Button
variant="outline"
role="combobox"
aria-expanded={open}
disabled={isLoading}
className="w-full justify-between"
>
{isLoading
? 'Carregando...'
: selected
? GetCapitalize(selected.descricao)
: 'Selecione...'}
<ChevronsUpDownIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent className="mb-5 w-full p-0">
<Command>
<CommandInput placeholder="Buscar período..." disabled={isLoading} />
<CommandList>
<CommandEmpty>
{isLoading ? 'Carregando...' : 'Nenhum resultado encontrado.'}
</CommandEmpty>
<CommandGroup>
{gEmolumentoPeriodo.map((item) => (
<CommandItem
key={item.emolumento_periodo_id}
value={item.descricao?.toLowerCase() ?? ''}
onSelect={() => handleSelect(Number(item.emolumento_periodo_id))}
// ---------------------------------------------------------------------------
// Ao selecionar um item → dispara novo hook
// ---------------------------------------------------------------------------
const handleSelect = async (id: number) => {
setSelectedId(id);
setOpen(false);
onSelectedEmolumentoPeriodo(id);
};
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<Button
variant="outline"
role="combobox"
aria-expanded={open}
disabled={isLoading}
className="w-full justify-between"
>
<CheckIcon
className={cn(
'mr-2 h-4 w-4',
String(selectedId ?? '') === String(item.emolumento_periodo_id)
? 'opacity-100'
: 'opacity-0',
)}
/>
{GetCapitalize(item.descricao ?? '')}
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
);
{isLoading
? 'Carregando...'
: selected
? GetCapitalize(selected.descricao)
: 'Selecione...'}
<ChevronsUpDownIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button>
</PopoverTrigger>
<PopoverContent className="w-full p-0 mb-5">
<Command>
<CommandInput placeholder="Buscar período..." disabled={isLoading} />
<CommandList>
<CommandEmpty>
{isLoading ? 'Carregando...' : 'Nenhum resultado encontrado.'}
</CommandEmpty>
<CommandGroup>
{gEmolumentoPeriodo.map((item) => (
<CommandItem
key={item.emolumento_periodo_id}
value={item.descricao?.toLowerCase() ?? ''}
onSelect={() => handleSelect(Number(item.emolumento_periodo_id))}
>
<CheckIcon
className={cn(
'mr-2 h-4 w-4',
String(selectedId ?? '') === String(item.emolumento_periodo_id)
? 'opacity-100'
: 'opacity-0'
)}
/>
{GetCapitalize(item.descricao ?? '')}
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
);
}

View file

@ -2,17 +2,13 @@
import { DataTable } from '@/shared/components/dataTable/DataTable';
import GEmolumentoPeriodoTableInterface from '@/packages/administrativo/interfaces/GEmolumentoPeriodo/GEmolumentoPeriodoTableInterface';
import GEmolumentoPeriodoColumns from './GEmolumentoPeriodoColumns';
import GEmolumentoPeriodoTableInterface from '../../interfaces/GEmolumentoPeriodo/GEmolumentoPeriodoTableInterface';
/**
* Componente principal da tabela de Naturezas
*/
export default function GEmolumentoPeriodoTable({
data,
onEdit,
onDelete,
}: GEmolumentoPeriodoTableInterface) {
export default function GEmolumentoPeriodoTable({ data, onEdit, onDelete }: GEmolumentoPeriodoTableInterface) {
const columns = GEmolumentoPeriodoColumns(onEdit, onDelete);
return (
<div>

View file

@ -13,7 +13,7 @@ import {
import GetCapitalize from '@/shared/actions/text/GetCapitalize';
import { SortableHeader } from '@/shared/components/dataTable/SortableHeader';
import GGramaticaInterface from '@/packages/administrativo/interfaces/GGramatica/GGramaticaInterface';
import GGramaticaInterface from '../../interfaces/GGramatica/GGramaticaInterface';
export default function GGramaticaColumns(
onEdit: (item: GGramaticaInterface, isEditingFormStatus: boolean) => void,

View file

@ -21,11 +21,11 @@ import {
FormMessage,
} from '@/components/ui/form';
import { Input } from '@/components/ui/input';
import { useGGramaticaFormHook } from '@/packages/administrativo/hooks/GGramatica/useGGramaticaFormHook';
import { GGramaticaFormInterface } from '@/packages/administrativo/interfaces/GGramatica/GGramaticaFormInterface';
import { ResetFormIfData } from '@/shared/actions/form/ResetFormIfData';
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
import { useGGramaticaFormHook } from '../../hooks/GGramatica/useGGramaticaFormHook';
import { GGramaticaFormInterface } from '../../interfaces/GGramatica/GGramaticaFormInterface';
/**
* Formulário de cadastro/edição de Natureza
@ -38,6 +38,7 @@ export default function GGramaticaForm({
onSave,
buttonIsLoading,
}: GGramaticaFormInterface) {
const form = useGGramaticaFormHook({});
// Atualiza o formulário quando recebe dados para edição
@ -77,7 +78,10 @@ export default function GGramaticaForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Palavra</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>
@ -93,7 +97,10 @@ export default function GGramaticaForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Prefixo</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>
@ -109,7 +116,10 @@ export default function GGramaticaForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Sufixo Masculino Singular</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>
@ -125,7 +135,10 @@ export default function GGramaticaForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Sufixo Masculino Plural</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>
@ -141,7 +154,10 @@ export default function GGramaticaForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Sufixo Feminino Singular</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>
@ -157,7 +173,10 @@ export default function GGramaticaForm({
<FormItem className="col-span-1 sm:col-span-2">
<FormLabel>Sufixo Feminino Plural</FormLabel>
<FormControl>
<Input {...field} type="text" />
<Input
{...field}
type="text"
/>
</FormControl>
<FormMessage />
</FormItem>

View file

@ -2,6 +2,7 @@
import { useCallback, useEffect, useState } from 'react';
import { useGGramaticaDeleteHook } from '@/packages/administrativo/hooks/GGramatica/useGGramaticaDeleteHook';
import { useGGramaticaIndexHook } from '@/packages/administrativo/hooks/GGramatica/useGGramaticaIndexHook';
import { useGGramaticaSaveHook } from '@/packages/administrativo/hooks/GGramatica/useGGramaticaSaveHook';
@ -15,6 +16,7 @@ import GGramaticaForm from './GGramaticaForm';
import GGramaticaTable from './GGramaticaTable';
export default function GGramaticaIndex() {
// Controle de estado do botão
const [buttonIsLoading, setButtonIsLoading] = useState(false);

Some files were not shown because too many files have changed in this diff Show more