karsten-design-system 1.2.27 → 1.2.31
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 -208
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,208 +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
|
-
- `
|
|
87
|
-
- `
|
|
88
|
-
- `
|
|
89
|
-
- `
|
|
90
|
-
- `
|
|
91
|
-
- `
|
|
92
|
-
- `
|
|
93
|
-
- `
|
|
94
|
-
- `
|
|
95
|
-
- `
|
|
96
|
-
- `
|
|
97
|
-
- `
|
|
98
|
-
- `
|
|
99
|
-
- `
|
|
100
|
-
- `
|
|
101
|
-
- `
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
- `npm run storybook` -
|
|
147
|
-
- `npm run build
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
- `yarn storybook` -
|
|
153
|
-
- `yarn build
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
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
|
@@ -157,6 +157,10 @@ function CalendarInput({ error, placeholder = 'Selecione uma data', label, disab
|
|
|
157
157
|
const calendarRef = useRef(null);
|
|
158
158
|
const hasError = (error && !disabled) || (!!error && !disabled);
|
|
159
159
|
const [isDarkMode, setIsDarkMode] = useState(false);
|
|
160
|
+
const [isClient, setIsClient] = useState(false);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
setIsClient(true);
|
|
163
|
+
}, []);
|
|
160
164
|
const dateTemplate = (data) => {
|
|
161
165
|
const date = new Date(`${data.year}/${data.month + 1}/${data.day}`);
|
|
162
166
|
const dayComponent = (className) => {
|
|
@@ -188,6 +192,8 @@ function CalendarInput({ error, placeholder = 'Selecione uma data', label, disab
|
|
|
188
192
|
}
|
|
189
193
|
};
|
|
190
194
|
useEffect(() => {
|
|
195
|
+
if (!isClient || typeof document === 'undefined')
|
|
196
|
+
return;
|
|
191
197
|
const htmlClassList = document.documentElement.classList;
|
|
192
198
|
setIsDarkMode(htmlClassList.contains('dark'));
|
|
193
199
|
const observer = new MutationObserver(() => {
|
|
@@ -198,7 +204,7 @@ function CalendarInput({ error, placeholder = 'Selecione uma data', label, disab
|
|
|
198
204
|
attributeFilter: ['class'],
|
|
199
205
|
});
|
|
200
206
|
return () => observer.disconnect();
|
|
201
|
-
}, []);
|
|
207
|
+
}, [isClient]);
|
|
202
208
|
return (jsx("div", { className: "relative flex flex-col w-full min-w-full", children: jsxs("div", { onClick: handleInputClick, children: [jsx(FloatingLabel, { value: props?.value ? props.value.toString() : '', label: label, disabled: disabled, error: error }), jsxs("div", { className: "relative w-full min-w-full", children: [jsx(Calendar, { ...props, disabled: disabled, placeholder: placeholder, ref: calendarRef, panelStyle: { width: '420px', height: '410px' }, className: clsx('w-full min-w-full focus:shadow-none border-none z-0 font-roboto border rounded-md', hasError
|
|
203
209
|
? 'border-redError placeholder:!text-redError p-invalid'
|
|
204
210
|
: 'border-light-700 focus:border-primary', disabled && 'border-light-100 text-disabled', error && 'border-redError text-redError p-invalid', !error && 'border-light-700 p-custom'), dateFormat: "dd/mm/yy", inputStyle: {
|
|
@@ -217,14 +223,14 @@ function Card({ children, className, ariaLabel = 'Card de informação', }) {
|
|
|
217
223
|
}
|
|
218
224
|
|
|
219
225
|
function CardButton({ label, description, onClick }) {
|
|
220
|
-
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]\
|
|
226
|
+
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: () => {
|
|
221
227
|
if (onClick)
|
|
222
228
|
onClick();
|
|
223
229
|
}, 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 }))] }));
|
|
224
230
|
}
|
|
225
231
|
|
|
226
232
|
function CardIconsButton({ label, leftIcon, onClick, }) {
|
|
227
|
-
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]\
|
|
233
|
+
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: () => {
|
|
228
234
|
if (onClick)
|
|
229
235
|
onClick();
|
|
230
236
|
}, "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" }) })] }));
|
|
@@ -232,6 +238,10 @@ function CardIconsButton({ label, leftIcon, onClick, }) {
|
|
|
232
238
|
|
|
233
239
|
function Charts({ type, labels, datasets, title, stacked = false, horizontal = false, legendPosition = 'top', }) {
|
|
234
240
|
const [isDarkMode, setIsDarkMode] = useState(false);
|
|
241
|
+
const [isClient, setIsClient] = useState(false);
|
|
242
|
+
useEffect(() => {
|
|
243
|
+
setIsClient(true);
|
|
244
|
+
}, []);
|
|
235
245
|
const chartData = {
|
|
236
246
|
labels,
|
|
237
247
|
datasets: datasets.map((ds) => ({
|
|
@@ -281,6 +291,8 @@ function Charts({ type, labels, datasets, title, stacked = false, horizontal = f
|
|
|
281
291
|
},
|
|
282
292
|
};
|
|
283
293
|
useEffect(() => {
|
|
294
|
+
if (!isClient || typeof document === 'undefined')
|
|
295
|
+
return;
|
|
284
296
|
const htmlClassList = document.documentElement.classList;
|
|
285
297
|
setIsDarkMode(htmlClassList.contains('dark'));
|
|
286
298
|
const observer = new MutationObserver(() => {
|
|
@@ -291,7 +303,7 @@ function Charts({ type, labels, datasets, title, stacked = false, horizontal = f
|
|
|
291
303
|
attributeFilter: ['class'],
|
|
292
304
|
});
|
|
293
305
|
return () => observer.disconnect();
|
|
294
|
-
}, []);
|
|
306
|
+
}, [isClient]);
|
|
295
307
|
return (jsx(Chart, { type: chartType, data: chartData, options: chartOptions, className: "w-full h-full", "aria-label": "chart" }));
|
|
296
308
|
}
|
|
297
309
|
|