karsten-design-system 1.2.56 → 1.2.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +207 -207
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
# Karsten Design System
|
|
2
|
-
|
|
3
|
-
Uma biblioteca de componentes React estilizados para projetos da Karsten, construída sobre o PrimeReact.
|
|
4
|
-
|
|
5
|
-
## Instalação
|
|
6
|
-
|
|
7
|
-
Com npm:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install karsten-design-system
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Com yarn:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
yarn add karsten-design-system
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Configuração do PrimeReact
|
|
20
|
-
|
|
21
|
-
No main.tsx adicione:
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
import { StrictMode } from "react";
|
|
25
|
-
import { createRoot } from "react-dom/client";
|
|
26
|
-
import "./index.css";
|
|
27
|
-
import App from "./App.tsx";
|
|
28
|
-
|
|
29
|
-
import { PrimeReactProvider } from 'primereact/api'; // Adicione o PrimeReactProvider
|
|
30
|
-
import Tailwind from 'primereact/passthrough/tailwind'; // Importe o Tailwind
|
|
31
|
-
import './index.css';
|
|
32
|
-
|
|
33
|
-
createRoot(document.getElementById("root")!).render(
|
|
34
|
-
<StrictMode>
|
|
35
|
-
<PrimeReactProvider value={{ pt: Tailwind }}> {/* Envolva o app no Provider do PrimeReact */}
|
|
36
|
-
<App />
|
|
37
|
-
</PrimeReactProvider>
|
|
38
|
-
</StrictMode>
|
|
39
|
-
);
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Pré-requisitos
|
|
43
|
-
|
|
44
|
-
Esta biblioteca requer as seguintes dependências:
|
|
45
|
-
|
|
46
|
-
- React 18 ou superior
|
|
47
|
-
- React DOM 18 ou superior
|
|
48
|
-
- React Router DOM 7 ou superior
|
|
49
|
-
- Tailwind 3.4.0 ou superior
|
|
50
|
-
- @types/date-fns 2 ou superior
|
|
51
|
-
- Chart.js 4 ou superior
|
|
52
|
-
- clsx 2 ou superior
|
|
53
|
-
- date-fns 1 ou superior
|
|
54
|
-
- Primeicons 7 ou superior
|
|
55
|
-
- Primereact 10 ou superior
|
|
56
|
-
- Postcss 8 ou superior
|
|
57
|
-
- Autoprefixer 10 ou superior
|
|
58
|
-
|
|
59
|
-
## Como usar
|
|
60
|
-
|
|
61
|
-
1. Importe o componente desejado da biblioteca:
|
|
62
|
-
|
|
63
|
-
```jsx
|
|
64
|
-
import { Button } from 'karsten-design-system'
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
2. Use o componente em seu projeto:
|
|
68
|
-
|
|
69
|
-
```jsx
|
|
70
|
-
function App() {
|
|
71
|
-
return <Button label="Clique aqui" />
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Componentes Disponíveis
|
|
76
|
-
|
|
77
|
-
- `Accordion` - Componente para exibir conteúdo em seções expansíveis e colapsáveis.
|
|
78
|
-
- `AutoComplete` - Campo de entrada com sugestões automáticas baseadas no texto digitado.
|
|
79
|
-
- `Breadcrumb` - Navegação hierárquica para indicar a localização atual do usuário.
|
|
80
|
-
- `Button` - Botão estilizado com variantes primária e secundária.
|
|
81
|
-
- `Card` - Contêiner estilizado para exibir informações agrupadas.
|
|
82
|
-
- `Chart` - Gráficos para visualização de dados em diferentes formatos.
|
|
83
|
-
- `DateInput` - Campo de entrada para seleção de datas.
|
|
84
|
-
- `Dialog` - Modal para exibição de mensagens ou ações secundárias.
|
|
85
|
-
- `Divider` - Linha divisória para separação visual de conteúdo.
|
|
86
|
-
- `Header` - Cabeçalho estilizado para títulos ou menus.
|
|
87
|
-
- `IconButton` - Botão com ícone, ideal para ações rápidas.
|
|
88
|
-
- `InfoCard` - Cartão informativo para exibir alertas ou dados destacados.
|
|
89
|
-
- `Input` - Campo de entrada para texto.
|
|
90
|
-
- `InternalMenu` - Menu de navegação interna, útil para dashboards.
|
|
91
|
-
- `Link` - Link estilizado para navegação.
|
|
92
|
-
- `MegaMenu` - Menu expandido com múltiplas opções organizadas.
|
|
93
|
-
- `Notification` - Notificação para exibir alertas e mensagens.
|
|
94
|
-
- `Paginator` - Paginação para navegação em listas ou tabelas.
|
|
95
|
-
- `RadioButton` - Botões de seleção única dentro de um grupo.
|
|
96
|
-
- `Select` - Componente para seleção de opções em um menu suspenso.
|
|
97
|
-
- `Sidebar` - Barra lateral para navegação ou exibição de conteúdo adicional.
|
|
98
|
-
- `Skeleton` - Elementos de carregamento em estilo esqueleto.
|
|
99
|
-
- `Spinner` - Indicador de carregamento animado.
|
|
100
|
-
- `Table` - Tabela para exibição de dados estruturados.
|
|
101
|
-
- `Toast` - Mensagens temporárias exibidas no canto da tela.
|
|
102
|
-
|
|
103
|
-
## Desenvolvimento
|
|
104
|
-
|
|
105
|
-
Para contribuir com o projeto:
|
|
106
|
-
|
|
107
|
-
1. Clone o repositório:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
git clone https://github.com/KarstenSA/karsten-design-system.git
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
2. Instale as dependências:
|
|
114
|
-
|
|
115
|
-
Com npm:
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
npm install
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Com yarn:
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
yarn
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
3. Execute o Storybook para desenvolvimento:
|
|
128
|
-
|
|
129
|
-
Com npm:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
npm run storybook
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Com yarn:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
yarn storybook
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
## Scripts Disponíveis
|
|
142
|
-
|
|
143
|
-
Com npm:
|
|
144
|
-
|
|
145
|
-
- `npm run storybook` - Inicia o ambiente de desenvolvimento do Storybook
|
|
146
|
-
- `npm run build-storybook` - Gera o build da biblioteca para hospedagem
|
|
147
|
-
- `npm run build` - Gera o build da biblioteca para publicação no npm
|
|
148
|
-
|
|
149
|
-
Com yarn:
|
|
150
|
-
|
|
151
|
-
- `yarn storybook` - Inicia o ambiente de desenvolvimento do Storybook
|
|
152
|
-
- `yarn build-storybook` - Gera o build do Storybook para hospedagem
|
|
153
|
-
- `yarn build` - Gera o build da biblioteca para publicação no npm
|
|
154
|
-
|
|
155
|
-
## Publicando uma Nova Versão no NPM
|
|
156
|
-
|
|
157
|
-
1. Atualizar a Versão
|
|
158
|
-
|
|
159
|
-
Antes de publicar, aumente a versão no `package.json` e `package-lock.json`.
|
|
160
|
-
|
|
161
|
-
2. Fazer o Build
|
|
162
|
-
|
|
163
|
-
Com npm:
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
npm run build
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Com yarn:
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
yarn build
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
3. Login no NPM
|
|
176
|
-
|
|
177
|
-
Se ainda não estiver autenticado, faça login:
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
npm login
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
4. Publicar
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
npm publish --access public
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
## Resolução de Problemas
|
|
190
|
-
|
|
191
|
-
Se você encontrar o erro "peer dependencies missing", instale as dependências necessárias:
|
|
192
|
-
|
|
193
|
-
Com npm:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
npm install react@^18 react-dom@^18 tailwindcss@^3.4.0 @types/date-fns@^2 chart.js@^4 clsx@^2 date-fns@^1 primeicons@^7 primereact@^10 postcss@^8 autoprefixer@^10
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Com yarn:
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
yarn add react@^18 react-dom@^18 tailwindcss@^3.4.0 @types/date-fns@^2 chart.js@^4 clsx@^2 date-fns@^1 primeicons@^7 primereact@^10 postcss@^8 autoprefixer@^10
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## Licença
|
|
206
|
-
|
|
207
|
-
Este projeto está licenciado sob a licença MIT.
|
|
1
|
+
# Karsten Design System
|
|
2
|
+
|
|
3
|
+
Uma biblioteca de componentes React estilizados para projetos da Karsten, construída sobre o PrimeReact.
|
|
4
|
+
|
|
5
|
+
## Instalação
|
|
6
|
+
|
|
7
|
+
Com npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install karsten-design-system
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Com yarn:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add karsten-design-system
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuração do PrimeReact
|
|
20
|
+
|
|
21
|
+
No main.tsx adicione:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { StrictMode } from "react";
|
|
25
|
+
import { createRoot } from "react-dom/client";
|
|
26
|
+
import "./index.css";
|
|
27
|
+
import App from "./App.tsx";
|
|
28
|
+
|
|
29
|
+
import { PrimeReactProvider } from 'primereact/api'; // Adicione o PrimeReactProvider
|
|
30
|
+
import Tailwind from 'primereact/passthrough/tailwind'; // Importe o Tailwind
|
|
31
|
+
import './index.css';
|
|
32
|
+
|
|
33
|
+
createRoot(document.getElementById("root")!).render(
|
|
34
|
+
<StrictMode>
|
|
35
|
+
<PrimeReactProvider value={{ pt: Tailwind }}> {/* Envolva o app no Provider do PrimeReact */}
|
|
36
|
+
<App />
|
|
37
|
+
</PrimeReactProvider>
|
|
38
|
+
</StrictMode>
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Pré-requisitos
|
|
43
|
+
|
|
44
|
+
Esta biblioteca requer as seguintes dependências:
|
|
45
|
+
|
|
46
|
+
- React 18 ou superior
|
|
47
|
+
- React DOM 18 ou superior
|
|
48
|
+
- React Router DOM 7 ou superior
|
|
49
|
+
- Tailwind 3.4.0 ou superior
|
|
50
|
+
- @types/date-fns 2 ou superior
|
|
51
|
+
- Chart.js 4 ou superior
|
|
52
|
+
- clsx 2 ou superior
|
|
53
|
+
- date-fns 1 ou superior
|
|
54
|
+
- Primeicons 7 ou superior
|
|
55
|
+
- Primereact 10 ou superior
|
|
56
|
+
- Postcss 8 ou superior
|
|
57
|
+
- Autoprefixer 10 ou superior
|
|
58
|
+
|
|
59
|
+
## Como usar
|
|
60
|
+
|
|
61
|
+
1. Importe o componente desejado da biblioteca:
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
import { Button } from 'karsten-design-system'
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
2. Use o componente em seu projeto:
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
function App() {
|
|
71
|
+
return <Button label="Clique aqui" />
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Componentes Disponíveis
|
|
76
|
+
|
|
77
|
+
- `Accordion` - Componente para exibir conteúdo em seções expansíveis e colapsáveis.
|
|
78
|
+
- `AutoComplete` - Campo de entrada com sugestões automáticas baseadas no texto digitado.
|
|
79
|
+
- `Breadcrumb` - Navegação hierárquica para indicar a localização atual do usuário.
|
|
80
|
+
- `Button` - Botão estilizado com variantes primária e secundária.
|
|
81
|
+
- `Card` - Contêiner estilizado para exibir informações agrupadas.
|
|
82
|
+
- `Chart` - Gráficos para visualização de dados em diferentes formatos.
|
|
83
|
+
- `DateInput` - Campo de entrada para seleção de datas.
|
|
84
|
+
- `Dialog` - Modal para exibição de mensagens ou ações secundárias.
|
|
85
|
+
- `Divider` - Linha divisória para separação visual de conteúdo.
|
|
86
|
+
- `Header` - Cabeçalho estilizado para títulos ou menus.
|
|
87
|
+
- `IconButton` - Botão com ícone, ideal para ações rápidas.
|
|
88
|
+
- `InfoCard` - Cartão informativo para exibir alertas ou dados destacados.
|
|
89
|
+
- `Input` - Campo de entrada para texto.
|
|
90
|
+
- `InternalMenu` - Menu de navegação interna, útil para dashboards.
|
|
91
|
+
- `Link` - Link estilizado para navegação.
|
|
92
|
+
- `MegaMenu` - Menu expandido com múltiplas opções organizadas.
|
|
93
|
+
- `Notification` - Notificação para exibir alertas e mensagens.
|
|
94
|
+
- `Paginator` - Paginação para navegação em listas ou tabelas.
|
|
95
|
+
- `RadioButton` - Botões de seleção única dentro de um grupo.
|
|
96
|
+
- `Select` - Componente para seleção de opções em um menu suspenso.
|
|
97
|
+
- `Sidebar` - Barra lateral para navegação ou exibição de conteúdo adicional.
|
|
98
|
+
- `Skeleton` - Elementos de carregamento em estilo esqueleto.
|
|
99
|
+
- `Spinner` - Indicador de carregamento animado.
|
|
100
|
+
- `Table` - Tabela para exibição de dados estruturados.
|
|
101
|
+
- `Toast` - Mensagens temporárias exibidas no canto da tela.
|
|
102
|
+
|
|
103
|
+
## Desenvolvimento
|
|
104
|
+
|
|
105
|
+
Para contribuir com o projeto:
|
|
106
|
+
|
|
107
|
+
1. Clone o repositório:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
git clone https://github.com/KarstenSA/karsten-design-system.git
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
2. Instale as dependências:
|
|
114
|
+
|
|
115
|
+
Com npm:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm install
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Com yarn:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
yarn
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
3. Execute o Storybook para desenvolvimento:
|
|
128
|
+
|
|
129
|
+
Com npm:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm run storybook
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Com yarn:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
yarn storybook
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Scripts Disponíveis
|
|
142
|
+
|
|
143
|
+
Com npm:
|
|
144
|
+
|
|
145
|
+
- `npm run storybook` - Inicia o ambiente de desenvolvimento do Storybook
|
|
146
|
+
- `npm run build-storybook` - Gera o build da biblioteca para hospedagem
|
|
147
|
+
- `npm run build` - Gera o build da biblioteca para publicação no npm
|
|
148
|
+
|
|
149
|
+
Com yarn:
|
|
150
|
+
|
|
151
|
+
- `yarn storybook` - Inicia o ambiente de desenvolvimento do Storybook
|
|
152
|
+
- `yarn build-storybook` - Gera o build do Storybook para hospedagem
|
|
153
|
+
- `yarn build` - Gera o build da biblioteca para publicação no npm
|
|
154
|
+
|
|
155
|
+
## Publicando uma Nova Versão no NPM
|
|
156
|
+
|
|
157
|
+
1. Atualizar a Versão
|
|
158
|
+
|
|
159
|
+
Antes de publicar, aumente a versão no `package.json` e `package-lock.json`.
|
|
160
|
+
|
|
161
|
+
2. Fazer o Build
|
|
162
|
+
|
|
163
|
+
Com npm:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
npm run build
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Com yarn:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
yarn build
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
3. Login no NPM
|
|
176
|
+
|
|
177
|
+
Se ainda não estiver autenticado, faça login:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npm login
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
4. Publicar
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npm publish --access public
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Resolução de Problemas
|
|
190
|
+
|
|
191
|
+
Se você encontrar o erro "peer dependencies missing", instale as dependências necessárias:
|
|
192
|
+
|
|
193
|
+
Com npm:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
npm install react@^18 react-dom@^18 tailwindcss@^3.4.0 @types/date-fns@^2 chart.js@^4 clsx@^2 date-fns@^1 primeicons@^7 primereact@^10 postcss@^8 autoprefixer@^10
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Com yarn:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
yarn add react@^18 react-dom@^18 tailwindcss@^3.4.0 @types/date-fns@^2 chart.js@^4 clsx@^2 date-fns@^1 primeicons@^7 primereact@^10 postcss@^8 autoprefixer@^10
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Licença
|
|
206
|
+
|
|
207
|
+
Este projeto está licenciado sob a licença MIT.
|
package/dist/index.js
CHANGED
|
@@ -205,14 +205,14 @@ function Card({ children, className, ariaLabel = 'Card de informação', }) {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
function CardButton({ label, description, onClick }) {
|
|
208
|
-
return (jsxs("div", { className: "cursor-pointer rounded-2xl p-4 h-[160px] w-full bg-gradient-to-br hover:shadow-md transition-shadow duration-200 border from-[#f3f4f6] to-light-500 border-[#f3f4f6]\n dark:from-dark-400 dark:to-dark-100 dark:border-dark-400 dark:bg-dark-100 dark:shadow-dark-400", onClick: () => {
|
|
208
|
+
return (jsxs("div", { className: "cursor-pointer rounded-2xl p-4 h-[160px] w-full bg-gradient-to-br hover:shadow-md transition-shadow duration-200 border from-[#f3f4f6] to-light-500 border-[#f3f4f6]\r\n dark:from-dark-400 dark:to-dark-100 dark:border-dark-400 dark:bg-dark-100 dark:shadow-dark-400", onClick: () => {
|
|
209
209
|
if (onClick)
|
|
210
210
|
onClick();
|
|
211
211
|
}, children: [jsx("h3", { className: "text-lg font-bold text-primary dark:text-light-500", children: label }), description && (jsx("p", { className: "text-sm mt-2 line-clamp-3 text-primary dark:text-light-500", children: description }))] }));
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
function CardIconsButton({ label, leftIcon, onClick, }) {
|
|
215
|
-
return (jsxs("div", { className: "cursor-pointer rounded-xl p-4 w-full min-h-[60px] bg-gradient-to-br hover:shadow-md transition-shadow duration-200 border flex items-center justify-between gap-4 from-[#f3f4f6] to-light-500 border-[#f3f4f6]\n dark:from-dark-400 dark:to-dark-100 dark:border-dark-400 dark:bg-dark-100 dark:shadow-dark-400", onClick: () => {
|
|
215
|
+
return (jsxs("div", { className: "cursor-pointer rounded-xl p-4 w-full min-h-[60px] bg-gradient-to-br hover:shadow-md transition-shadow duration-200 border flex items-center justify-between gap-4 from-[#f3f4f6] to-light-500 border-[#f3f4f6]\r\n dark:from-dark-400 dark:to-dark-100 dark:border-dark-400 dark:bg-dark-100 dark:shadow-dark-400", onClick: () => {
|
|
216
216
|
if (onClick)
|
|
217
217
|
onClick();
|
|
218
218
|
}, "aria-label": `Botão de navegação para ${label}`, children: [jsxs("div", { className: "flex items-center gap-3 flex-grow overflow-hidden", children: [leftIcon && (jsx("div", { className: "text-xl flex-shrink-0 flex items-center dark:text-light-500 text-primary", children: leftIcon })), jsx("h3", { className: "text-base font-semibold break-words dark:text-light-500 text-primary", children: label })] }), jsx("div", { className: "flex items-center justify-center h-full", children: jsx("i", { className: "pi pi-angle-right text-xl flex-shrink-0 dark:text-light-500 text-primary" }) })] }));
|
|
@@ -503,7 +503,7 @@ function Header({ sidebarItems, sidebarTopItems, username, userConfigItems, setO
|
|
|
503
503
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
504
504
|
};
|
|
505
505
|
}, [openUserConfig]);
|
|
506
|
-
return (jsxs(Fragment, { children: [jsxs("div", { className: "w-100 min-h-16 border-b border-b-light-200 flex flex-row justify-between items-center px-8 shadow-header dark:bg-dark-100 dark:border-b-dark-400", children: [jsxs("div", { className: "flex flex-row items-center gap-4", children: [jsx("button", { className: "bg-transparent border-none", onClick: () => setOpenSidebar(!openSidebar), "aria-label": "Abrir menu lateral", children: jsx("i", { className: `${openSidebar ? 'pi pi-list' : 'pi pi-bars'} text-light-950 cursor-pointer hover:text-light-900 text-xl mt-1 }` }) }), jsx(Link$1, { className: "cursor-pointer", to: redirect, "aria-label": "Ir para p\u00E1gina inicial", children: jsx(LogoSmall, {}) }, "logo-link")] }), jsxs("div", { className: "relative flex flex-row gap-4 items-center", children: [isRenderNotifications && (jsx("button", { className: "bg-transparent border-none mt-1", onClick: () => setOpenNotifications(true), "aria-label": "Abrir notifica\u00E7\u00E3o", children: jsx("i", { className: "pi pi-bell text-light-950 cursor-pointer hover:text-light-900" }) })), jsxs("div", { ref: userConfigRef, className: "relative", children: [jsx("button", { className: "bg-transparent border-none", onClick: () => setOpenUserConfig(!openUserConfig), "aria-label": "Abrir menu de configura\u00E7\u00F5es do usu\u00E1rio", children: jsxs("p", { className: "text-light-950 hover:text-light-900 font-roboto font-bold cursor-pointer transition-colors duration-200", children: [helloTranslation, ", ", username] }) }), openUserConfig && (jsx("div", { className: `absolute w-100
|
|
506
|
+
return (jsxs(Fragment, { children: [jsxs("div", { className: "w-100 min-h-16 border-b border-b-light-200 flex flex-row justify-between items-center px-8 shadow-header dark:bg-dark-100 dark:border-b-dark-400", children: [jsxs("div", { className: "flex flex-row items-center gap-4", children: [jsx("button", { className: "bg-transparent border-none", onClick: () => setOpenSidebar(!openSidebar), "aria-label": "Abrir menu lateral", children: jsx("i", { className: `${openSidebar ? 'pi pi-list' : 'pi pi-bars'} text-light-950 cursor-pointer hover:text-light-900 text-xl mt-1 }` }) }), jsx(Link$1, { className: "cursor-pointer", to: redirect, "aria-label": "Ir para p\u00E1gina inicial", children: jsx(LogoSmall, {}) }, "logo-link")] }), jsxs("div", { className: "relative flex flex-row gap-4 items-center", children: [isRenderNotifications && (jsx("button", { className: "bg-transparent border-none mt-1", onClick: () => setOpenNotifications(true), "aria-label": "Abrir notifica\u00E7\u00E3o", children: jsx("i", { className: "pi pi-bell text-light-950 cursor-pointer hover:text-light-900" }) })), jsxs("div", { ref: userConfigRef, className: "relative", children: [jsx("button", { className: "bg-transparent border-none", onClick: () => setOpenUserConfig(!openUserConfig), "aria-label": "Abrir menu de configura\u00E7\u00F5es do usu\u00E1rio", children: jsxs("p", { className: "text-light-950 hover:text-light-900 font-roboto font-bold cursor-pointer transition-colors duration-200", children: [helloTranslation, ", ", username] }) }), openUserConfig && (jsx("div", { className: `absolute w-100 z-20 p-2 -bottom-1 translate-y-full shadow-container rounded-md bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400`, children: jsx("ul", { children: userConfigItems.map(({ id, title, onClick, path }) => (jsx("li", { className: "p-2 rounded hover:bg-light-300 dark:bg-dark-100 dark:text-light-500 dark:hover:bg-dark-400", children: jsx("a", { onClick: () => {
|
|
507
507
|
if (onClick)
|
|
508
508
|
onClick();
|
|
509
509
|
setOpenUserConfig(false);
|
|
@@ -742,7 +742,7 @@ function LanguageDropdown({ selected = 'pt', onChange, }) {
|
|
|
742
742
|
document.addEventListener('mousedown', handleClickOutside);
|
|
743
743
|
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
744
744
|
}, []);
|
|
745
|
-
return (jsxs("div", { ref: ref, className: "relative inline-block", children: [jsxs("button", { type: "button", className: clsx('p-1 rounded-md cursor-pointer hover:bg-light-300 dark:hover:bg-dark-400'), onClick: () => setOpen(!open), "aria-haspopup": "listbox", "aria-expanded": open, "aria-label": "Selecionar idioma", children: [languageOptions.find((lang) => lang.code === selected)?.icon || null, jsx("span", { className: "sr-only", children: selected })] }), open && (jsx("div", { className: clsx('absolute right-0 mt-2 w-40 rounded-md
|
|
745
|
+
return (jsxs("div", { ref: ref, className: "relative inline-block", children: [jsxs("button", { type: "button", className: clsx('p-1 rounded-md cursor-pointer hover:bg-light-300 dark:hover:bg-dark-400'), onClick: () => setOpen(!open), "aria-haspopup": "listbox", "aria-expanded": open, "aria-label": "Selecionar idioma", children: [languageOptions.find((lang) => lang.code === selected)?.icon || null, jsx("span", { className: "sr-only", children: selected })] }), open && (jsx("div", { className: clsx('absolute right-0 mt-2 w-40 rounded-md p-2 z-40 shadow-container bg-light-500 dark:text-light-500 dark:bg-dark-100 dark:border dark:border-dark-500 dark:shadow-dark-400'), role: "listbox", children: jsx("ul", { children: languageOptions.map((option) => (jsxs("li", { className: clsx('p-2 cursor-pointer rounded hover:bg-light-300 hover:font-bold dark:bg-dark-100 dark:text-light-500 dark:hover:bg-dark-400 mt-1', option.code === selected &&
|
|
746
746
|
'font-bold bg-light-300 dark:bg-dark-400'), role: "option", "aria-selected": option.code === selected, tabIndex: 0, onClick: () => {
|
|
747
747
|
onChange(option);
|
|
748
748
|
setOpen(false);
|
|
@@ -4427,7 +4427,7 @@ function Select(props) {
|
|
|
4427
4427
|
const inputValue = e.target.value;
|
|
4428
4428
|
setSearchText(inputValue);
|
|
4429
4429
|
setHighlightedIndex(0);
|
|
4430
|
-
if (hasOnInputChange) {
|
|
4430
|
+
if (hasOnInputChange && isOpen) {
|
|
4431
4431
|
props.onInputChange?.(inputValue);
|
|
4432
4432
|
}
|
|
4433
4433
|
if (!isOpen) {
|