@goopti/ui 1.0.2 → 1.1.1
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 +183 -183
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +25 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/avatar.d.ts +8 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +10 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +10 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +22 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +11 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +30 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +8 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +50 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +21 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +17 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +10 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +12 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/checkbox.d.ts +8 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +8 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +9 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +11 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/date-picker.d.ts +9 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +29 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +20 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +29 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +15 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +26 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/hover-card.d.ts +8 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +10 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/icon.d.ts +8 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +11 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/input-otp.d.ts +9 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +22 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +6 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +7 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +7 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/popover.d.ts +9 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +21 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +7 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +7 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +12 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +7 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/scroll-area.d.ts +7 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +7 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +13 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +26 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +7 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +10 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +20 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.d.ts +6 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +7 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +11 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +31 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +7 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/textarea.d.ts +6 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +7 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toast.d.ts +19 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +25 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/tooltip.d.ts +9 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +16 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +4 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +9 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/theme.css +140 -0
- package/package.json +1 -1
- package/dist/assets/index-gWZidFXq.js +0 -203
- package/dist/assets/index-p3H2VfDS.css +0 -1
- package/dist/assets/logo-opti-D621QI7V.png +0 -0
- package/dist/index.html +0 -15
package/README.md
CHANGED
|
@@ -1,183 +1,183 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Um kit de componentes React
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @goopti/ui
|
|
9
|
-
# ou
|
|
10
|
-
yarn add @goopti/ui
|
|
11
|
-
# ou
|
|
12
|
-
pnpm add @goopti/ui
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Uso
|
|
16
|
-
|
|
17
|
-
### 1. Adicione Tailwind CSS ao seu projeto
|
|
18
|
-
|
|
19
|
-
Este kit usa Tailwind CSS. Se ainda
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm install -D tailwindcss postcss autoprefixer
|
|
23
|
-
npx tailwindcss init -p
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Configure o `tailwind.config.js`:
|
|
27
|
-
|
|
28
|
-
```js
|
|
29
|
-
export default {
|
|
30
|
-
content: [
|
|
31
|
-
"./index.html",
|
|
32
|
-
"./src/**/*.{js,jsx,ts,tsx}",
|
|
33
|
-
"./node_modules/@goopti/ui/**/*.{js,jsx,ts,tsx}",
|
|
34
|
-
],
|
|
35
|
-
theme: {
|
|
36
|
-
extend: {},
|
|
37
|
-
},
|
|
38
|
-
plugins: [],
|
|
39
|
-
};
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 2. Importe o CSS do tema
|
|
43
|
-
|
|
44
|
-
```jsx
|
|
45
|
-
import "@goopti/ui/css";
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### 3. Use um componente
|
|
49
|
-
|
|
50
|
-
```jsx
|
|
51
|
-
import { Button } from "@goopti/ui/components/button";
|
|
52
|
-
|
|
53
|
-
export default function App() {
|
|
54
|
-
return (
|
|
55
|
-
<Button variant="primary">
|
|
56
|
-
Agendar
|
|
57
|
-
</Button>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Componentes
|
|
63
|
-
|
|
64
|
-
###
|
|
65
|
-
- **Button**
|
|
66
|
-
- **Badge**
|
|
67
|
-
- **Card**
|
|
68
|
-
|
|
69
|
-
###
|
|
70
|
-
- **Input**
|
|
71
|
-
- **Textarea**
|
|
72
|
-
- **Select**
|
|
73
|
-
- **Checkbox**
|
|
74
|
-
- **Radio**
|
|
75
|
-
- **Switch**
|
|
76
|
-
- **Slider**
|
|
77
|
-
- **InputOTP**
|
|
78
|
-
|
|
79
|
-
### Overlays
|
|
80
|
-
- **Dialog**
|
|
81
|
-
- **Sheet**
|
|
82
|
-
- **Popover**
|
|
83
|
-
- **HoverCard**
|
|
84
|
-
- **Dropdown**
|
|
85
|
-
- **Tooltip**
|
|
86
|
-
- **Command**
|
|
87
|
-
|
|
88
|
-
###
|
|
89
|
-
- **Tabs**
|
|
90
|
-
- **Breadcrumb**
|
|
91
|
-
- **Pagination**
|
|
92
|
-
- **Sidebar**
|
|
93
|
-
|
|
94
|
-
### Feedback
|
|
95
|
-
- **Toast**
|
|
96
|
-
- **AlertDialog**
|
|
97
|
-
- **Progress**
|
|
98
|
-
- **Skeleton**
|
|
99
|
-
|
|
100
|
-
### Data & Pickers
|
|
101
|
-
- **DatePicker**
|
|
102
|
-
- **TimePicker**
|
|
103
|
-
- **DataTable**
|
|
104
|
-
- **Carousel**
|
|
105
|
-
|
|
106
|
-
###
|
|
107
|
-
- **Collapsible**
|
|
108
|
-
- **ScrollArea**
|
|
109
|
-
|
|
110
|
-
##
|
|
111
|
-
|
|
112
|
-
### Cores e Tokens
|
|
113
|
-
|
|
114
|
-
O tema
|
|
115
|
-
|
|
116
|
-
1. Copie e edite `node_modules/@goopti/ui/dist/theme.css`
|
|
117
|
-
2. Ou sobrescreva as
|
|
118
|
-
|
|
119
|
-
```css
|
|
120
|
-
:root {
|
|
121
|
-
--primary: 0 0% 100%; /* cor
|
|
122
|
-
--primary-foreground: 215 100% 50%;
|
|
123
|
-
--secondary: 215 100% 50%;
|
|
124
|
-
--muted: 0 0% 95%;
|
|
125
|
-
/* ... mais tokens */
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
###
|
|
130
|
-
|
|
131
|
-
Defina no seu `tailwind.config.js`:
|
|
132
|
-
|
|
133
|
-
```js
|
|
134
|
-
theme: {
|
|
135
|
-
extend: {
|
|
136
|
-
spacing: {
|
|
137
|
-
'4xs': '2px',
|
|
138
|
-
'3xs': '4px',
|
|
139
|
-
// ... conforme seu design system
|
|
140
|
-
},
|
|
141
|
-
borderRadius: {
|
|
142
|
-
none: '0px',
|
|
143
|
-
xs: '4px',
|
|
144
|
-
sm: '6px',
|
|
145
|
-
md: '8px',
|
|
146
|
-
lg: '12px',
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
## Acessibilidade
|
|
153
|
-
|
|
154
|
-
Todos os componentes
|
|
155
|
-
- Teclado: Tab, Arrow, Enter, Escape
|
|
156
|
-
- ARIA labels e roles
|
|
157
|
-
- Contraste de cores WCAG AA
|
|
158
|
-
- Focus management
|
|
159
|
-
- Screen reader support
|
|
160
|
-
|
|
161
|
-
## TypeScript
|
|
162
|
-
|
|
163
|
-
Este pacote inclui tipos completos. Use com
|
|
164
|
-
|
|
165
|
-
```tsx
|
|
166
|
-
import { Button, ButtonProps } from "@goopti/ui/components/button";
|
|
167
|
-
|
|
168
|
-
interface MyButtonProps extends ButtonProps {
|
|
169
|
-
customProp?: string;
|
|
170
|
-
}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
##
|
|
174
|
-
|
|
175
|
-
MIT
|
|
176
|
-
|
|
177
|
-
## Suporte
|
|
178
|
-
|
|
179
|
-
Para problemas ou
|
|
180
|
-
|
|
181
|
-
## Changelog
|
|
182
|
-
|
|
183
|
-
Veja [CHANGELOG.md](./CHANGELOG.md) para
|
|
1
|
+
# @goopti/ui
|
|
2
|
+
|
|
3
|
+
Um kit de componentes React acessíveis e customizáveis, baseado em [shadcn/ui](https://ui.shadcn.com), com tema e tokens da OPTI Soluções.
|
|
4
|
+
|
|
5
|
+
## Instalação
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @goopti/ui
|
|
9
|
+
# ou
|
|
10
|
+
yarn add @goopti/ui
|
|
11
|
+
# ou
|
|
12
|
+
pnpm add @goopti/ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Uso Rápido
|
|
16
|
+
|
|
17
|
+
### 1. Adicione Tailwind CSS ao seu projeto
|
|
18
|
+
|
|
19
|
+
Este kit usa Tailwind CSS. Se ainda não tiver configurado:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -D tailwindcss postcss autoprefixer
|
|
23
|
+
npx tailwindcss init -p
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Configure o `tailwind.config.js`:
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
export default {
|
|
30
|
+
content: [
|
|
31
|
+
"./index.html",
|
|
32
|
+
"./src/**/*.{js,jsx,ts,tsx}",
|
|
33
|
+
"./node_modules/@goopti/ui/**/*.{js,jsx,ts,tsx}",
|
|
34
|
+
],
|
|
35
|
+
theme: {
|
|
36
|
+
extend: {},
|
|
37
|
+
},
|
|
38
|
+
plugins: [],
|
|
39
|
+
};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 2. Importe o CSS do tema
|
|
43
|
+
|
|
44
|
+
```jsx
|
|
45
|
+
import "@goopti/ui/css";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 3. Use um componente
|
|
49
|
+
|
|
50
|
+
```jsx
|
|
51
|
+
import { Button } from "@goopti/ui/components/button";
|
|
52
|
+
|
|
53
|
+
export default function App() {
|
|
54
|
+
return (
|
|
55
|
+
<Button variant="primary">
|
|
56
|
+
Agendar diagnóstico
|
|
57
|
+
</Button>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Componentes Disponíveis
|
|
63
|
+
|
|
64
|
+
### Básicos
|
|
65
|
+
- **Button** – Botão em 6 variantes (primary, brand, secondary, outline, ghost, link)
|
|
66
|
+
- **Badge** – Rótulo de status/categoria
|
|
67
|
+
- **Card** – Container de conteúdo com espaçamento
|
|
68
|
+
|
|
69
|
+
### Formulário
|
|
70
|
+
- **Input** – Campo de texto
|
|
71
|
+
- **Textarea** – Campo multilinha
|
|
72
|
+
- **Select** – Dropdown customizado
|
|
73
|
+
- **Checkbox** – Caixa de seleção
|
|
74
|
+
- **Radio** – Grupo de rádio
|
|
75
|
+
- **Switch** – Interruptor on/off
|
|
76
|
+
- **Slider** – Controle deslizante
|
|
77
|
+
- **InputOTP** – Entrada de código 2FA
|
|
78
|
+
|
|
79
|
+
### Overlays
|
|
80
|
+
- **Dialog** – Modal customizado
|
|
81
|
+
- **Sheet** – Painel lateral (drawer)
|
|
82
|
+
- **Popover** – Tooltip com conteúdo
|
|
83
|
+
- **HoverCard** – Card ao passar o mouse
|
|
84
|
+
- **Dropdown** – Menu suspenso
|
|
85
|
+
- **Tooltip** – Dica ao passar o mouse
|
|
86
|
+
- **Command** – Paleta de comandos (⌘K)
|
|
87
|
+
|
|
88
|
+
### Navegação
|
|
89
|
+
- **Tabs** – Abas de conteúdo
|
|
90
|
+
- **Breadcrumb** – Caminho de navegação
|
|
91
|
+
- **Pagination** – Paginador
|
|
92
|
+
- **Sidebar** – Barra lateral com seções
|
|
93
|
+
|
|
94
|
+
### Feedback
|
|
95
|
+
- **Toast** – Notificação temporária
|
|
96
|
+
- **AlertDialog** – Diálogo de confirmação
|
|
97
|
+
- **Progress** – Barra de progresso
|
|
98
|
+
- **Skeleton** – Placeholder de carregamento
|
|
99
|
+
|
|
100
|
+
### Data & Pickers
|
|
101
|
+
- **DatePicker** – Seletor de data
|
|
102
|
+
- **TimePicker** – Seletor de hora
|
|
103
|
+
- **DataTable** – Tabela com sort/filter
|
|
104
|
+
- **Carousel** – Carrossel de itens
|
|
105
|
+
|
|
106
|
+
### Utilitários
|
|
107
|
+
- **Collapsible** – Conteúdo colapsável
|
|
108
|
+
- **ScrollArea** – Área com scroll customizado
|
|
109
|
+
|
|
110
|
+
## Customização
|
|
111
|
+
|
|
112
|
+
### Cores e Tokens
|
|
113
|
+
|
|
114
|
+
O tema padrão está em `src/theme.css`. Para customizar cores, fonts e espaçamento:
|
|
115
|
+
|
|
116
|
+
1. Copie e edite `node_modules/@goopti/ui/dist/theme.css`
|
|
117
|
+
2. Ou sobrescreva as variáveis CSS no seu `globals.css`:
|
|
118
|
+
|
|
119
|
+
```css
|
|
120
|
+
:root {
|
|
121
|
+
--primary: 0 0% 100%; /* cor primária */
|
|
122
|
+
--primary-foreground: 215 100% 50%;
|
|
123
|
+
--secondary: 215 100% 50%;
|
|
124
|
+
--muted: 0 0% 95%;
|
|
125
|
+
/* ... mais tokens */
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Espaçamento, Raio e Sombras
|
|
130
|
+
|
|
131
|
+
Defina no seu `tailwind.config.js`:
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
theme: {
|
|
135
|
+
extend: {
|
|
136
|
+
spacing: {
|
|
137
|
+
'4xs': '2px',
|
|
138
|
+
'3xs': '4px',
|
|
139
|
+
// ... conforme seu design system
|
|
140
|
+
},
|
|
141
|
+
borderRadius: {
|
|
142
|
+
none: '0px',
|
|
143
|
+
xs: '4px',
|
|
144
|
+
sm: '6px',
|
|
145
|
+
md: '8px',
|
|
146
|
+
lg: '12px',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Acessibilidade
|
|
153
|
+
|
|
154
|
+
Todos os componentes são construídos com acessibilidade em mente:
|
|
155
|
+
- Teclado: Tab, Arrow, Enter, Escape
|
|
156
|
+
- ARIA labels e roles
|
|
157
|
+
- Contraste de cores WCAG AA
|
|
158
|
+
- Focus management
|
|
159
|
+
- Screen reader support
|
|
160
|
+
|
|
161
|
+
## TypeScript
|
|
162
|
+
|
|
163
|
+
Este pacote inclui tipos completos. Use com confiança:
|
|
164
|
+
|
|
165
|
+
```tsx
|
|
166
|
+
import { Button, ButtonProps } from "@goopti/ui/components/button";
|
|
167
|
+
|
|
168
|
+
interface MyButtonProps extends ButtonProps {
|
|
169
|
+
customProp?: string;
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Licença
|
|
174
|
+
|
|
175
|
+
MIT – Use livremente em projetos comerciais e open-source.
|
|
176
|
+
|
|
177
|
+
## Suporte
|
|
178
|
+
|
|
179
|
+
Para problemas ou sugestões, abra uma issue no [repositório GitHub](https://github.com/OPTI-Solucoes/opti-ui).
|
|
180
|
+
|
|
181
|
+
## Changelog
|
|
182
|
+
|
|
183
|
+
Veja [CHANGELOG.md](./CHANGELOG.md) para histórico de versões.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AlertDialogProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
onConfirm?: () => void;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
confirmLabel?: string;
|
|
9
|
+
cancelLabel?: string;
|
|
10
|
+
destructive?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const AlertDialog: React.ForwardRefExoticComponent<AlertDialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { AlertDialog };
|
|
14
|
+
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,WAAW,yFAiEhB,CAAC;AAGF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
const AlertDialog = React.forwardRef(({ open = false, onClose, onConfirm, title, description, confirmLabel = "Continuar", cancelLabel = "Cancelar", destructive, ...props }, ref) => {
|
|
5
|
+
React.useEffect(() => {
|
|
6
|
+
const onKey = (e) => {
|
|
7
|
+
if (e.key === "Escape")
|
|
8
|
+
onClose?.();
|
|
9
|
+
};
|
|
10
|
+
if (open)
|
|
11
|
+
document.addEventListener("keydown", onKey);
|
|
12
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
13
|
+
}, [open, onClose]);
|
|
14
|
+
if (!open)
|
|
15
|
+
return null;
|
|
16
|
+
return (_jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [_jsx("div", { className: "animate-overlay absolute inset-0 bg-black/50 backdrop-blur-[2px]" }), _jsxs("div", { ref: ref, className: "animate-content relative z-10 w-full max-w-md rounded-xl border bg-card p-6 shadow-lg", ...props, children: [_jsx("h2", { className: "font-display text-lg font-semibold text-foreground", children: title }), _jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: description }), _jsxs("div", { className: "mt-6 flex justify-end gap-2", children: [_jsx("button", { onClick: onClose, className: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-semibold transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[.98] border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2", children: cancelLabel }), _jsx("button", { onClick: () => {
|
|
17
|
+
onConfirm?.();
|
|
18
|
+
onClose?.();
|
|
19
|
+
}, className: cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-semibold transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[.98] h-10 px-4 py-2", destructive
|
|
20
|
+
? "bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm"
|
|
21
|
+
: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm"), children: confirmLabel })] })] })] }));
|
|
22
|
+
});
|
|
23
|
+
AlertDialog.displayName = "AlertDialog";
|
|
24
|
+
export { AlertDialog };
|
|
25
|
+
//# sourceMappingURL=alert-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","sourceRoot":"","sources":["../../src/components/alert-dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAclC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,IAAI,GAAG,KAAK,EACZ,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAAY,GAAG,WAAW,EAC1B,WAAW,GAAG,UAAU,EACxB,WAAW,EACX,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,KAAK,GAAG,CAAC,CAAgB,EAAE,EAAE;YACjC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;gBAAE,OAAO,EAAE,EAAE,CAAC;QACtC,CAAC,CAAC;QACF,IAAI,IAAI;YAAE,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpB,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,OAAO,CACL,eAAK,SAAS,EAAC,yDAAyD,aACtE,cACE,SAAS,EAAC,kEAAkE,GACvE,EACP,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,uFAAuF,KAC7F,KAAK,aAET,aAAI,SAAS,EAAC,oDAAoD,YAC/D,KAAK,GACH,EACL,YAAG,SAAS,EAAC,oCAAoC,YAAE,WAAW,GAAK,EACnE,eAAK,SAAS,EAAC,6BAA6B,aAC1C,iBACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,8YAA8Y,YAEvZ,WAAW,GACL,EACT,iBACE,OAAO,EAAE,GAAG,EAAE;oCACZ,SAAS,EAAE,EAAE,CAAC;oCACd,OAAO,EAAE,EAAE,CAAC;gCACd,CAAC,EACD,SAAS,EAAE,EAAE,CACX,+TAA+T,EAC/T,WAAW;oCACT,CAAC,CAAC,8EAA8E;oCAChF,CAAC,CAAC,kEAAkE,CACvE,YAEA,YAAY,GACN,IACL,IACF,IACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
src?: string;
|
|
4
|
+
fallback?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
export { Avatar };
|
|
8
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/components/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,qFA2BX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
const Avatar = React.forwardRef(({ className, src, fallback, ...props }, ref) => {
|
|
5
|
+
const [err, setErr] = React.useState(false);
|
|
6
|
+
return (_jsx("span", { ref: ref, className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full bg-muted", className), ...props, children: src && !err ? (_jsx("img", { src: src, onError: () => setErr(true), className: "aspect-square h-full w-full object-cover", alt: "avatar" })) : (_jsx("span", { className: "flex h-full w-full items-center justify-center text-sm font-semibold text-muted-foreground", children: fallback })) }));
|
|
7
|
+
});
|
|
8
|
+
Avatar.displayName = "Avatar";
|
|
9
|
+
export { Avatar };
|
|
10
|
+
//# sourceMappingURL=avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../src/components/avatar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAOlC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAC7B,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC9C,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,CACL,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,wEAAwE,EACxE,SAAS,CACV,KACG,KAAK,YAER,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CACb,cACE,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAC3B,SAAS,EAAC,0CAA0C,EACpD,GAAG,EAAC,QAAQ,GACZ,CACH,CAAC,CAAC,CAAC,CACF,eAAM,SAAS,EAAC,4FAA4F,YACzG,QAAQ,GACJ,CACR,GACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "info" | "brand" | "success" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
10
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa;;8EAgBlB,CAAC;AAEF,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAC3C,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,QAAA,MAAM,KAAK,oFAQV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
const badgeVariants = cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "border-transparent bg-primary text-primary-foreground",
|
|
9
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
10
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground",
|
|
11
|
+
success: "border-transparent bg-success text-success-foreground",
|
|
12
|
+
info: "border-transparent bg-info text-info-foreground",
|
|
13
|
+
brand: "border-transparent bg-brand text-brand-foreground",
|
|
14
|
+
outline: "border-border text-foreground",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: { variant: "default" },
|
|
18
|
+
});
|
|
19
|
+
const Badge = React.forwardRef(({ className, variant, ...props }, ref) => (_jsx("span", { ref: ref, className: cn(badgeVariants({ variant, className })), ...props })));
|
|
20
|
+
Badge.displayName = "Badge";
|
|
21
|
+
export { Badge, badgeVariants };
|
|
22
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,aAAa,GAAG,GAAG,CACvB,kFAAkF,EAClF;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,uDAAuD;YAChE,SAAS,EAAE,2DAA2D;YACtE,WAAW,EAAE,+DAA+D;YAC5E,OAAO,EAAE,uDAAuD;YAChE,IAAI,EAAE,iDAAiD;YACvD,KAAK,EAAE,mDAAmD;YAC1D,OAAO,EAAE,+BAA+B;SACzC;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;CACxC,CACF,CAAC;AAMF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACzC,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,KAChD,KAAK,GACT,CACH,CACF,CAAC;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "primary" | "destructive" | "outline" | "secondary" | "ghost" | "info" | "brand" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
}
|
|
9
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export { Button, buttonVariants };
|
|
11
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EAwBnB,CAAC;AAEF,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;CAAG;AAE1C,QAAA,MAAM,MAAM,uFAQX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-semibold transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[.98] [&_svg]:pointer-events-none", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm",
|
|
9
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm",
|
|
10
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm",
|
|
11
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
13
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
15
|
+
info: "bg-info text-info-foreground hover:bg-info/90 shadow-sm",
|
|
16
|
+
brand: "bg-brand text-brand-foreground hover:bg-brand/90 shadow-sm",
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "h-10 px-4 py-2",
|
|
20
|
+
sm: "h-9 rounded-md px-3 text-[13px]",
|
|
21
|
+
lg: "h-11 rounded-md px-8 text-base",
|
|
22
|
+
icon: "h-10 w-10",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: { variant: "default", size: "default" },
|
|
26
|
+
});
|
|
27
|
+
const Button = React.forwardRef(({ className, variant, size, ...props }, ref) => (_jsx("button", { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props })));
|
|
28
|
+
Button.displayName = "Button";
|
|
29
|
+
export { Button, buttonVariants };
|
|
30
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAGlC,MAAM,cAAc,GAAG,GAAG,CACxB,4UAA4U,EAC5U;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAM,kEAAkE;YAC/E,OAAO,EAAM,kEAAkE;YAC/E,WAAW,EAAE,8EAA8E;YAC3F,OAAO,EAAM,gFAAgF;YAC7F,SAAS,EAAI,8DAA8D;YAC3E,KAAK,EAAQ,8CAA8C;YAC3D,IAAI,EAAS,iDAAiD;YAC9D,IAAI,EAAS,yDAAyD;YACtE,KAAK,EAAQ,4DAA4D;SAC1E;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,gBAAgB;YACzB,EAAE,EAAE,iCAAiC;YACrC,EAAE,EAAE,gCAAgC;YACpC,IAAI,EAAE,WAAW;SAClB;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;CACzD,CACF,CAAC;AAMF,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAC7B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC/C,iBACE,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,EAC3D,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CACF,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CalendarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
+
value?: Date;
|
|
4
|
+
onChange?: (date: Date) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Calendar };
|
|
8
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/components/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8B/B,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACjC;AAED,QAAA,MAAM,QAAQ,sFA4Eb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
import { Icon } from "./icon";
|
|
5
|
+
const MONTHS_PT = [
|
|
6
|
+
"Janeiro",
|
|
7
|
+
"Fevereiro",
|
|
8
|
+
"Março",
|
|
9
|
+
"Abril",
|
|
10
|
+
"Maio",
|
|
11
|
+
"Junho",
|
|
12
|
+
"Julho",
|
|
13
|
+
"Agosto",
|
|
14
|
+
"Setembro",
|
|
15
|
+
"Outubro",
|
|
16
|
+
"Novembro",
|
|
17
|
+
"Dezembro",
|
|
18
|
+
];
|
|
19
|
+
const DOW_PT = ["D", "S", "T", "Q", "Q", "S", "S"];
|
|
20
|
+
function sameDay(a, b) {
|
|
21
|
+
return !!(a &&
|
|
22
|
+
b &&
|
|
23
|
+
a.getFullYear() === b.getFullYear() &&
|
|
24
|
+
a.getMonth() === b.getMonth() &&
|
|
25
|
+
a.getDate() === b.getDate());
|
|
26
|
+
}
|
|
27
|
+
const Calendar = React.forwardRef(({ value, onChange, className, ...props }, ref) => {
|
|
28
|
+
const today = new Date();
|
|
29
|
+
const [view, setView] = React.useState(() => value
|
|
30
|
+
? new Date(value.getFullYear(), value.getMonth(), 1)
|
|
31
|
+
: new Date(today.getFullYear(), today.getMonth(), 1));
|
|
32
|
+
const year = view.getFullYear();
|
|
33
|
+
const month = view.getMonth();
|
|
34
|
+
const firstDow = new Date(year, month, 1).getDay();
|
|
35
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
36
|
+
const cells = [];
|
|
37
|
+
for (let i = 0; i < firstDow; i++)
|
|
38
|
+
cells.push(null);
|
|
39
|
+
for (let d = 1; d <= daysInMonth; d++)
|
|
40
|
+
cells.push(new Date(year, month, d));
|
|
41
|
+
const shift = (n) => setView(new Date(year, month + n, 1));
|
|
42
|
+
return (_jsxs("div", { ref: ref, className: cn("w-fit rounded-lg border bg-card p-3", className), ...props, children: [_jsxs("div", { className: "mb-2 flex items-center justify-between px-1", children: [_jsx("button", { onClick: () => shift(-1), className: "inline-flex h-7 w-7 items-center justify-center rounded-md border border-input hover:bg-accent transition-colors", children: _jsx(Icon, { name: "chevron-left", size: 15 }) }), _jsxs("span", { className: "text-sm font-semibold text-foreground", children: [MONTHS_PT[month], " ", year] }), _jsx("button", { onClick: () => shift(1), className: "inline-flex h-7 w-7 items-center justify-center rounded-md border border-input hover:bg-accent transition-colors", children: _jsx(Icon, { name: "chevron-right", size: 15 }) })] }), _jsxs("div", { className: "grid grid-cols-7 gap-1", children: [DOW_PT.map((d, i) => (_jsx("div", { className: "flex h-8 w-9 items-center justify-center text-xs font-medium text-muted-foreground", children: d }, i))), cells.map((d, i) => d === null ? (_jsx("div", { className: "h-9 w-9" }, i)) : (_jsx("button", { onClick: () => onChange?.(d), className: cn("inline-flex h-9 w-9 items-center justify-center rounded-md text-sm transition-colors", sameDay(d, value)
|
|
43
|
+
? "bg-primary text-primary-foreground font-semibold"
|
|
44
|
+
: sameDay(d, today)
|
|
45
|
+
? "bg-accent text-accent-foreground font-medium"
|
|
46
|
+
: "text-foreground hover:bg-accent"), children: d.getDate() }, i)))] })] }));
|
|
47
|
+
});
|
|
48
|
+
Calendar.displayName = "Calendar";
|
|
49
|
+
export { Calendar };
|
|
50
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/components/calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,SAAS,GAAG;IAChB,SAAS;IACT,WAAW;IACX,OAAO;IACP,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,UAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;CACX,CAAC;AACF,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAEnD,SAAS,OAAO,CAAC,CAAQ,EAAE,CAAQ;IACjC,OAAO,CAAC,CAAC,CACP,CAAC;QACD,CAAC;QACD,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE;QACnC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE;QAC7B,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAC5B,CAAC;AACJ,CAAC;AAOD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAChD,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAC1C,KAAK;QACH,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CACvD,CAAC;IAEF,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAE3D,MAAM,KAAK,GAAoB,EAAE,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAE5E,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEnE,OAAO,CACL,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,KAC3D,KAAK,aAET,eAAK,SAAS,EAAC,6CAA6C,aAC1D,iBACE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACxB,SAAS,EAAC,kHAAkH,YAE5H,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAE,EAAE,GAAI,GAC/B,EACT,gBAAM,SAAS,EAAC,uCAAuC,aACpD,SAAS,CAAC,KAAK,CAAC,OAAG,IAAI,IACnB,EACP,iBACE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EACvB,SAAS,EAAC,kHAAkH,YAE5H,KAAC,IAAI,IAAC,IAAI,EAAC,eAAe,EAAC,IAAI,EAAE,EAAE,GAAI,GAChC,IACL,EACN,eAAK,SAAS,EAAC,wBAAwB,aACpC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACpB,cAEE,SAAS,EAAC,oFAAoF,YAE7F,CAAC,IAHG,CAAC,CAIF,CACP,CAAC,EACD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAClB,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CACX,cAAa,SAAS,EAAC,SAAS,IAAtB,CAAC,CAA4B,CACxC,CAAC,CAAC,CAAC,CACF,iBAEE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAC5B,SAAS,EAAE,EAAE,CACX,sFAAsF,EACtF,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC;4BACf,CAAC,CAAC,kDAAkD;4BACpD,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC;gCACnB,CAAC,CAAC,8CAA8C;gCAChD,CAAC,CAAC,iCAAiC,CACtC,YAEA,CAAC,CAAC,OAAO,EAAE,IAXP,CAAC,CAYC,CACV,CACF,IACG,IACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
}
|
|
4
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
}
|
|
7
|
+
declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export interface CardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
9
|
+
}
|
|
10
|
+
declare const CardTitle: React.ForwardRefExoticComponent<CardTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
11
|
+
export interface CardDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
12
|
+
}
|
|
13
|
+
declare const CardDescription: React.ForwardRefExoticComponent<CardDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
14
|
+
export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
}
|
|
16
|
+
declare const CardContent: React.ForwardRefExoticComponent<CardContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
}
|
|
19
|
+
declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
|
|
21
|
+
//# sourceMappingURL=card.d.ts.map
|