mblabs-roccato-frontend-commons 0.0.26 → 0.0.28
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 +111 -111
- package/dist/index.d.ts +5 -1
- package/dist/mblabs-roccato-frontend-commons.css +1 -1
- package/dist/mblabs-roccato-frontend-commons.js +20764 -17835
- package/package.json +143 -143
- package/src/components/atoms/AudioPlayer/audio-player.stories.tsx +36 -36
- package/src/components/atoms/AudioPlayer/audio-player.test.tsx +19 -19
- package/src/components/atoms/AudioPlayer/audio-player.tsx +13 -13
- package/src/components/atoms/AudioPlayer/index.ts +1 -1
- package/src/components/atoms/Badge/badge.stories.tsx +80 -80
- package/src/components/atoms/Badge/badge.test.tsx +59 -59
- package/src/components/atoms/Badge/badge.tsx +47 -47
- package/src/components/atoms/Badge/index.ts +1 -1
- package/src/components/atoms/Box/box.stories.tsx +37 -37
- package/src/components/atoms/Box/box.test.tsx +47 -47
- package/src/components/atoms/Box/box.tsx +7 -7
- package/src/components/atoms/Box/index.ts +1 -1
- package/src/components/atoms/Button/button.stories.tsx +114 -114
- package/src/components/atoms/Button/button.test.tsx +66 -66
- package/src/components/atoms/Button/button.tsx +69 -69
- package/src/components/atoms/Button/index.ts +1 -1
- package/src/components/atoms/Calendar/__snapshots__/calendar.test.tsx.snap +5 -5
- package/src/components/atoms/Calendar/calendar.stories.tsx +51 -51
- package/src/components/atoms/Calendar/calendar.test.tsx +64 -64
- package/src/components/atoms/Calendar/calendar.tsx +47 -47
- package/src/components/atoms/Calendar/index.ts +1 -1
- package/src/components/atoms/Checkbox/checkbox.stories.tsx +133 -133
- package/src/components/atoms/Checkbox/checkbox.test.tsx +70 -70
- package/src/components/atoms/Checkbox/checkbox.tsx +31 -31
- package/src/components/atoms/Checkbox/index.ts +1 -1
- package/src/components/atoms/Flex/flex.stories.tsx +33 -33
- package/src/components/atoms/Flex/flex.test.tsx +47 -47
- package/src/components/atoms/Flex/flex.tsx +7 -7
- package/src/components/atoms/Flex/index.ts +1 -1
- package/src/components/atoms/Grid/grid.stories.tsx +33 -33
- package/src/components/atoms/Grid/grid.test.tsx +47 -47
- package/src/components/atoms/Grid/grid.tsx +7 -7
- package/src/components/atoms/Grid/index.ts +1 -1
- package/src/components/atoms/Input/index.ts +1 -1
- package/src/components/atoms/Input/input.stories.tsx +67 -67
- package/src/components/atoms/Input/input.test.tsx +86 -86
- package/src/components/atoms/Input/input.tsx +44 -44
- package/src/components/atoms/Label/index.ts +1 -1
- package/src/components/atoms/Label/label.stories.tsx +90 -90
- package/src/components/atoms/Label/label.test.tsx +59 -59
- package/src/components/atoms/Label/label.tsx +23 -23
- package/src/components/atoms/Progress/index.ts +1 -1
- package/src/components/atoms/Progress/progress.stories.tsx +30 -30
- package/src/components/atoms/Progress/progress.test.tsx +62 -62
- package/src/components/atoms/Progress/progress.tsx +32 -32
- package/src/components/atoms/RenderCondition/index.ts +1 -1
- package/src/components/atoms/RenderCondition/render-condition.stories.tsx +28 -28
- package/src/components/atoms/RenderCondition/render-condition.test.tsx +27 -27
- package/src/components/atoms/RenderCondition/render-condition.tsx +9 -9
- package/src/components/atoms/Separator/index.ts +1 -1
- package/src/components/atoms/Separator/separator.stories.tsx +117 -117
- package/src/components/atoms/Separator/separator.test.tsx +50 -50
- package/src/components/atoms/Separator/separator.tsx +28 -28
- package/src/components/atoms/Skeleton/index.ts +1 -1
- package/src/components/atoms/Skeleton/skeleton.stories.tsx +84 -84
- package/src/components/atoms/Skeleton/skeleton.test.tsx +39 -39
- package/src/components/atoms/Skeleton/skeleton.tsx +14 -14
- package/src/components/atoms/Slider/index.ts +1 -1
- package/src/components/atoms/Slider/slider.stories.tsx +28 -28
- package/src/components/atoms/Slider/slider.test.tsx +91 -91
- package/src/components/atoms/Slider/slider.tsx +66 -66
- package/src/components/atoms/Sonner/index.ts +1 -1
- package/src/components/atoms/Sonner/sonner.stories.tsx +105 -105
- package/src/components/atoms/Sonner/sonner.test.tsx +24 -24
- package/src/components/atoms/Sonner/sonner.tsx +21 -21
- package/src/components/atoms/Switch/index.ts +1 -1
- package/src/components/atoms/Switch/switch.stories.tsx +120 -120
- package/src/components/atoms/Switch/switch.test.tsx +70 -70
- package/src/components/atoms/Switch/switch.tsx +31 -31
- package/src/components/atoms/Textarea/index.ts +1 -1
- package/src/components/atoms/Textarea/textarea.stories.tsx +169 -169
- package/src/components/atoms/Textarea/textarea.test.tsx +56 -56
- package/src/components/atoms/Textarea/textarea.tsx +18 -18
- package/src/components/atoms/Toggle/index.ts +1 -1
- package/src/components/atoms/Toggle/toggle.stories.tsx +170 -170
- package/src/components/atoms/Toggle/toggle.test.tsx +62 -62
- package/src/components/atoms/Toggle/toggle.tsx +47 -47
- package/src/components/atoms/Typography/index.ts +1 -1
- package/src/components/atoms/Typography/typography.stories.tsx +95 -95
- package/src/components/atoms/Typography/typography.test.tsx +66 -66
- package/src/components/atoms/Typography/typography.tsx +63 -63
- package/src/components/atoms/VideoPlayer/index.ts +1 -1
- package/src/components/atoms/VideoPlayer/video-player.stories.tsx +37 -37
- package/src/components/atoms/VideoPlayer/video-player.test.tsx +19 -19
- package/src/components/atoms/VideoPlayer/video-player.tsx +26 -26
- package/src/components/atoms/index.ts +21 -21
- package/src/components/index.ts +3 -3
- package/src/components/molecules/Accordion/accordion.stories.tsx +81 -81
- package/src/components/molecules/Accordion/accordion.test.tsx +91 -91
- package/src/components/molecules/Accordion/accordion.tsx +65 -65
- package/src/components/molecules/Accordion/index.ts +1 -1
- package/src/components/molecules/Alert/alert.stories.tsx +75 -75
- package/src/components/molecules/Alert/alert.test.tsx +58 -58
- package/src/components/molecules/Alert/alert.tsx +67 -67
- package/src/components/molecules/Alert/index.ts +1 -1
- package/src/components/molecules/AlertDialog/alert-dialog.stories.tsx +55 -55
- package/src/components/molecules/AlertDialog/alert-dialog.test.tsx +34 -34
- package/src/components/molecules/AlertDialog/alert-dialog.tsx +159 -159
- package/src/components/molecules/AlertDialog/index.ts +1 -1
- package/src/components/molecules/Avatar/avatar.stories.tsx +98 -98
- package/src/components/molecules/Avatar/avatar.test.tsx +55 -55
- package/src/components/molecules/Avatar/avatar.tsx +55 -55
- package/src/components/molecules/Avatar/index.ts +1 -1
- package/src/components/molecules/Breadcrumb/breadcrumb.stories.tsx +125 -125
- package/src/components/molecules/Breadcrumb/breadcrumb.test.tsx +118 -118
- package/src/components/molecules/Breadcrumb/breadcrumb.tsx +120 -120
- package/src/components/molecules/Breadcrumb/index.ts +1 -1
- package/src/components/molecules/Card/card.stories.tsx +109 -109
- package/src/components/molecules/Card/card.test.tsx +103 -103
- package/src/components/molecules/Card/card.tsx +78 -78
- package/src/components/molecules/Card/index.ts +1 -1
- package/src/components/molecules/Collapsible/collapsible.stories.tsx +27 -27
- package/src/components/molecules/Collapsible/collapsible.test.tsx +35 -35
- package/src/components/molecules/Collapsible/collapsible.tsx +31 -31
- package/src/components/molecules/Collapsible/index.ts +1 -1
- package/src/components/molecules/Command/command.stories.tsx +70 -70
- package/src/components/molecules/Command/command.test.tsx +49 -49
- package/src/components/molecules/Command/command.tsx +177 -177
- package/src/components/molecules/Command/index.ts +1 -1
- package/src/components/molecules/ContextMenu/context-menu.stories.tsx +68 -68
- package/src/components/molecules/ContextMenu/context-menu.test.tsx +24 -24
- package/src/components/molecules/ContextMenu/context-menu.tsx +259 -259
- package/src/components/molecules/ContextMenu/index.ts +1 -1
- package/src/components/molecules/DatePicker/date-picker.stories.tsx +35 -35
- package/src/components/molecules/DatePicker/date-picker.test.tsx +27 -27
- package/src/components/molecules/DatePicker/date-picker.tsx +65 -65
- package/src/components/molecules/Dialog/dialog.stories.tsx +43 -43
- package/src/components/molecules/Dialog/dialog.test.tsx +51 -51
- package/src/components/molecules/Dialog/dialog.tsx +145 -145
- package/src/components/molecules/Drawer/drawer.stories.tsx +132 -132
- package/src/components/molecules/Drawer/drawer.test.tsx +100 -100
- package/src/components/molecules/Drawer/drawer.tsx +149 -149
- package/src/components/molecules/Drawer/index.ts +1 -1
- package/src/components/molecules/Dropdown/dropdown.stories.tsx +60 -52
- package/src/components/molecules/Dropdown/dropdown.test.tsx +128 -128
- package/src/components/molecules/Dropdown/dropdown.tsx +114 -74
- package/src/components/molecules/DropdownMenu/dropdown-menu.stories.tsx +127 -127
- package/src/components/molecules/DropdownMenu/dropdown-menu.test.tsx +163 -163
- package/src/components/molecules/DropdownMenu/dropdown-menu.tsx +235 -235
- package/src/components/molecules/DropdownMenu/index.ts +1 -1
- package/src/components/molecules/HoverCard/hover-card.stories.tsx +48 -48
- package/src/components/molecules/HoverCard/hover-card.test.tsx +42 -42
- package/src/components/molecules/HoverCard/hover-card.tsx +44 -44
- package/src/components/molecules/HoverCard/index.ts +1 -1
- package/src/components/molecules/InputOTP/index.ts +1 -1
- package/src/components/molecules/InputOTP/input-otp.stories.tsx +52 -52
- package/src/components/molecules/InputOTP/input-otp.test.tsx +28 -28
- package/src/components/molecules/InputOTP/input-otp.tsx +76 -76
- package/src/components/molecules/Menubar/index.ts +1 -1
- package/src/components/molecules/Menubar/menubar.stories.tsx +113 -113
- package/src/components/molecules/Menubar/menubar.test.tsx +42 -42
- package/src/components/molecules/Menubar/menubar.tsx +314 -314
- package/src/components/molecules/NavigationMenu/index.ts +1 -1
- package/src/components/molecules/NavigationMenu/navigation-menu.stories.tsx +143 -143
- package/src/components/molecules/NavigationMenu/navigation-menu.test.tsx +69 -69
- package/src/components/molecules/NavigationMenu/navigation-menu.tsx +174 -174
- package/src/components/molecules/PDFViewer/index.ts +1 -1
- package/src/components/molecules/PDFViewer/pdf-viewer.stories.tsx +33 -33
- package/src/components/molecules/PDFViewer/pdf-viewer.test.tsx +26 -26
- package/src/components/molecules/PDFViewer/pdf-viewer.tsx +213 -213
- package/src/components/molecules/Pagination/index.ts +1 -1
- package/src/components/molecules/Pagination/pagination.stories.tsx +50 -50
- package/src/components/molecules/Pagination/pagination.test.tsx +27 -27
- package/src/components/molecules/Pagination/pagination.tsx +129 -129
- package/src/components/molecules/Popover/index.ts +1 -1
- package/src/components/molecules/Popover/popover-menu.stories.tsx +27 -27
- package/src/components/molecules/Popover/popover.test.tsx +50 -50
- package/src/components/molecules/Popover/popover.tsx +32 -32
- package/src/components/molecules/RadioGroup/index.ts +1 -1
- package/src/components/molecules/RadioGroup/radio-group.stories.tsx +42 -42
- package/src/components/molecules/RadioGroup/radio-group.test.tsx +22 -22
- package/src/components/molecules/RadioGroup/radio-group.tsx +44 -44
- package/src/components/molecules/Resizable/index.ts +1 -1
- package/src/components/molecules/Resizable/resizable.stories.tsx +52 -52
- package/src/components/molecules/Resizable/resizable.test.tsx +22 -22
- package/src/components/molecules/Resizable/resizable.tsx +55 -55
- package/src/components/molecules/ScrollArea/index.ts +1 -1
- package/src/components/molecules/ScrollArea/scroll-area.stories.tsx +93 -93
- package/src/components/molecules/ScrollArea/scroll-area.test.tsx +28 -28
- package/src/components/molecules/ScrollArea/scroll-area.tsx +57 -57
- package/src/components/molecules/Select/index.ts +1 -1
- package/src/components/molecules/Select/select.stories.tsx +63 -63
- package/src/components/molecules/Select/select.test.tsx +80 -80
- package/src/components/molecules/Select/select.tsx +172 -172
- package/src/components/molecules/Sheet/index.ts +1 -1
- package/src/components/molecules/Sheet/sheet.stories.tsx +141 -141
- package/src/components/molecules/Sheet/sheet.test.tsx +70 -70
- package/src/components/molecules/Sheet/sheet.tsx +133 -133
- package/src/components/molecules/Tabs/index.ts +1 -1
- package/src/components/molecules/Tabs/tabs.stories.tsx +133 -133
- package/src/components/molecules/Tabs/tabs.test.tsx +94 -94
- package/src/components/molecules/Tabs/tabs.tsx +62 -62
- package/src/components/molecules/ToggleGroup/index.ts +1 -1
- package/src/components/molecules/ToggleGroup/toggle-group.stories.tsx +117 -117
- package/src/components/molecules/ToggleGroup/toggle-group.test.tsx +100 -100
- package/src/components/molecules/ToggleGroup/toggle-group.tsx +70 -70
- package/src/components/molecules/Tooltip/index.ts +1 -1
- package/src/components/molecules/Tooltip/tooltip.stories.tsx +133 -133
- package/src/components/molecules/Tooltip/tooltip.test.tsx +58 -58
- package/src/components/molecules/Tooltip/tooltip.tsx +58 -58
- package/src/components/molecules/index.ts +29 -29
- package/src/components/organisms/Carousel/carousel.stories.tsx +46 -46
- package/src/components/organisms/Carousel/carousel.test.tsx +24 -24
- package/src/components/organisms/Carousel/carousel.tsx +244 -244
- package/src/components/organisms/Carousel/index.ts +1 -1
- package/src/components/organisms/Chart/chart.stories.tsx +102 -102
- package/src/components/organisms/Chart/chart.test.tsx +105 -105
- package/src/components/organisms/Chart/chart.tsx +294 -294
- package/src/components/organisms/Chart/index.ts +1 -1
- package/src/components/organisms/FileUpload/FilePreview/file-preview.tsx +55 -55
- package/src/components/organisms/FileUpload/FilePreview/index.ts +1 -1
- package/src/components/organisms/FileUpload/file-upload.stories.tsx +20 -20
- package/src/components/organisms/FileUpload/file-upload.test.tsx +59 -59
- package/src/components/organisms/FileUpload/file-upload.tsx +175 -175
- package/src/components/organisms/FileUpload/file.d.ts +20 -20
- package/src/components/organisms/FileUpload/index.ts +1 -2
- package/src/components/organisms/Form/__snapshots__/form.test.tsx.snap +5 -5
- package/src/components/organisms/Form/form.stories.tsx +155 -155
- package/src/components/organisms/Form/form.test.tsx +49 -49
- package/src/components/organisms/Form/form.tsx +127 -127
- package/src/components/organisms/Form/index.ts +1 -1
- package/src/components/organisms/Sidebar/__snapshots__/sidebar.test.tsx.snap +5 -5
- package/src/components/organisms/Sidebar/index.ts +1 -1
- package/src/components/organisms/Sidebar/sidebar.stories.tsx +86 -86
- package/src/components/organisms/Sidebar/sidebar.test.tsx +101 -101
- package/src/components/organisms/Sidebar/sidebar.tsx +666 -666
- package/src/components/organisms/Table/__snapshots__/table.test.tsx.snap +10 -10
- package/src/components/organisms/Table/index.ts +1 -1
- package/src/components/organisms/Table/table.stories.tsx +83 -83
- package/src/components/organisms/Table/table.test.tsx +44 -44
- package/src/components/organisms/Table/table.tsx +101 -101
- package/src/components/organisms/index.ts +5 -4
- package/src/constants/brazilian-states.ts +29 -29
- package/src/constants/index.ts +1 -1
- package/src/hooks/index.ts +5 -5
- package/src/hooks/useForm.ts +7 -7
- package/src/hooks/useFormField.ts +41 -41
- package/src/hooks/useMobile.ts +21 -21
- package/src/hooks/useOnToggle.ts +28 -28
- package/src/hooks/useSidebar.ts +23 -23
- package/src/index.css +85 -85
- package/src/main.ts +6 -6
- package/src/utils/api/api.test.ts +63 -63
- package/src/utils/api/api.ts +33 -33
- package/src/utils/api/index.ts +1 -1
- package/src/utils/array/array.test.ts +159 -159
- package/src/utils/array/array.ts +43 -43
- package/src/utils/array/index.ts +1 -1
- package/src/utils/cn/cn.test.ts +42 -42
- package/src/utils/cn/cn.ts +6 -6
- package/src/utils/cn/index.ts +1 -1
- package/src/utils/currency/currency.test.ts +122 -122
- package/src/utils/currency/currency.ts +59 -59
- package/src/utils/currency/index.ts +1 -1
- package/src/utils/date/date.test.ts +166 -166
- package/src/utils/date/date.ts +83 -83
- package/src/utils/date/index.ts +1 -1
- package/src/utils/file/file.ts +44 -44
- package/src/utils/file/index.ts +1 -1
- package/src/utils/get-initials/get-initials.test.ts +40 -40
- package/src/utils/get-initials/get-initials.ts +13 -13
- package/src/utils/get-initials/index.ts +1 -1
- package/src/utils/index.ts +9 -9
- package/src/utils/string/index.ts +1 -1
- package/src/utils/string/string.test.ts +170 -170
- package/src/utils/string/string.ts +150 -150
- package/src/utils/video/index.ts +1 -1
- package/src/utils/video/video.ts +8 -8
- package/src/vite-env.d.ts +3 -3
- package/src/components/atoms/AudioPlayer/__snapshots__/audio-player.test.tsx.snap +0 -22
- package/src/components/atoms/Progress/__snapshots__/progress.test.tsx.snap +0 -25
- package/src/components/atoms/Slider/__snapshots__/slider.test.tsx.snap +0 -295
- package/src/components/atoms/VideoPlayer/__snapshots__/video-player.test.tsx.snap +0 -17
- package/src/components/molecules/Accordion/__snapshots__/accordion.test.tsx.snap +0 -123
- package/src/components/molecules/Alert/__snapshots__/alert.test.tsx.snap +0 -27
- package/src/components/molecules/AlertDialog/__snapshots__/alert-dialog.test.tsx.snap +0 -18
- package/src/components/molecules/Collapsible/__snapshots__/collapsible.test.tsx.snap +0 -27
- package/src/components/molecules/Command/__snapshots__/command.test.tsx.snap +0 -31
- package/src/components/molecules/ContextMenu/__snapshots__/context-menu.test.tsx.snap +0 -14
- package/src/components/molecules/DatePicker/__snapshots__/date-picker.test.tsx.snap +0 -49
- package/src/components/molecules/Dialog/__snapshots__/dialog.test.tsx.snap +0 -18
- package/src/components/molecules/HoverCard/__snapshots__/hover-card.test.tsx.snap +0 -14
- package/src/components/molecules/InputOTP/__snapshots__/input-otp.test.tsx.snap +0 -89
- package/src/components/molecules/Menubar/__snapshots__/menubar.test.tsx.snap +0 -80
- package/src/components/molecules/PDFViewer/__snapshots__/pdf-viewer.test.tsx.snap +0 -257
- package/src/components/molecules/Pagination/__snapshots__/pagination.test.tsx.snap +0 -160
- package/src/components/molecules/RadioGroup/__snapshots__/radio-group.test.tsx.snap +0 -110
- package/src/components/molecules/Resizable/__snapshots__/resizable.test.tsx.snap +0 -121
- package/src/components/molecules/ScrollArea/__snapshots__/scroll-area.test.tsx.snap +0 -636
- package/src/components/organisms/Carousel/__snapshots__/carousel.test.tsx.snap +0 -225
package/README.md
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
# 🧩 mblabs-roccato-frontend-commons
|
|
2
|
-
|
|
3
|
-
Uma coleção de componentes e utilitários de front-end reutilizáveis, desenvolvidos com tecnologias modernas como React 19, TailwindCSS, Radix UI e muito mais. Criado para ser compartilhado entre projetos dentro do ecossistema MB Labs Roccato.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 📦 Instalação
|
|
8
|
-
|
|
9
|
-
Utilize o [pnpm](https://pnpm.io/) como gerenciador de pacotes (Node.js 22+):
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
pnpm add mblabs-roccato-frontend-commons
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Certifique-se de instalar também as dependências peer:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pnpm add react@^19.0.0 react-dom@^19.0.0 react-hook-form@^7.55.0
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 🚀 Como usar
|
|
24
|
-
|
|
25
|
-
Importe os componentes ou utilitários diretamente do pacote:
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
import { MeuComponente } from 'mblabs-roccato-frontend-commons';
|
|
29
|
-
import 'mblabs-roccato-frontend-commons/css'; // estilos padrões
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## ✨ Destaques
|
|
35
|
-
|
|
36
|
-
- ✅ Suporte ao React 19
|
|
37
|
-
- 🎨 TailwindCSS 4 com variantes dinâmicas
|
|
38
|
-
- ⚙️ Componentes acessíveis via Radix UI
|
|
39
|
-
- 🧰 Drag & drop com DnD Kit
|
|
40
|
-
- 📊 Visualizações com Recharts
|
|
41
|
-
- 🧪 Totalmente tipado com TypeScript
|
|
42
|
-
- 📚 Documentação interativa com Storybook
|
|
43
|
-
- ⚡ Build otimizado com Vite
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## 📂 Estrutura do Projeto
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
📁 src/
|
|
51
|
-
┣ 📦 components/
|
|
52
|
-
┣ ┣ 📦 atoms/
|
|
53
|
-
┣ ┣ 📦 molecules/
|
|
54
|
-
┣ ┣ 📦 organisms/
|
|
55
|
-
┣ ┣ 📄 index.ts
|
|
56
|
-
┣ 📦 hooks/
|
|
57
|
-
┣ 📦 utils/
|
|
58
|
-
┗ 📄 index.ts
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## 🧪 Scripts
|
|
64
|
-
|
|
65
|
-
| Comando | Descrição |
|
|
66
|
-
| ---------------------- | ------------------------------------------------- |
|
|
67
|
-
| `pnpm build` | Compila a lib com TypeScript e Vite |
|
|
68
|
-
| `pnpm lint` | Lint no projeto com ESLint |
|
|
69
|
-
| `pnpm storybook` | Inicia o Storybook em ambiente de desenvolvimento |
|
|
70
|
-
| `pnpm build-storybook` | Gera versão estática do Storybook |
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 📚 Storybook
|
|
75
|
-
|
|
76
|
-
Explore e teste os componentes interativamente:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
pnpm storybook
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Ou gere a versão estática:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
pnpm build-storybook
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## 🧩 Tecnologias Utilizadas
|
|
91
|
-
|
|
92
|
-
- React 19
|
|
93
|
-
- TailwindCSS
|
|
94
|
-
- Radix UI
|
|
95
|
-
- DnD Kit
|
|
96
|
-
- Tanstack react-table
|
|
97
|
-
- Tabler icons-react
|
|
98
|
-
- Date fns
|
|
99
|
-
- Recharts
|
|
100
|
-
- React Hook Form
|
|
101
|
-
- Zod
|
|
102
|
-
- Storybook
|
|
103
|
-
- Vite
|
|
104
|
-
- TypeScript
|
|
105
|
-
- ESLint
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## 📝 Licença
|
|
110
|
-
|
|
111
|
-
MIT © Roccato — Feito com ❤️ pelo time MB Labs.
|
|
1
|
+
# 🧩 mblabs-roccato-frontend-commons
|
|
2
|
+
|
|
3
|
+
Uma coleção de componentes e utilitários de front-end reutilizáveis, desenvolvidos com tecnologias modernas como React 19, TailwindCSS, Radix UI e muito mais. Criado para ser compartilhado entre projetos dentro do ecossistema MB Labs Roccato.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📦 Instalação
|
|
8
|
+
|
|
9
|
+
Utilize o [pnpm](https://pnpm.io/) como gerenciador de pacotes (Node.js 22+):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add mblabs-roccato-frontend-commons
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Certifique-se de instalar também as dependências peer:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add react@^19.0.0 react-dom@^19.0.0 react-hook-form@^7.55.0
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🚀 Como usar
|
|
24
|
+
|
|
25
|
+
Importe os componentes ou utilitários diretamente do pacote:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { MeuComponente } from 'mblabs-roccato-frontend-commons';
|
|
29
|
+
import 'mblabs-roccato-frontend-commons/css'; // estilos padrões
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## ✨ Destaques
|
|
35
|
+
|
|
36
|
+
- ✅ Suporte ao React 19
|
|
37
|
+
- 🎨 TailwindCSS 4 com variantes dinâmicas
|
|
38
|
+
- ⚙️ Componentes acessíveis via Radix UI
|
|
39
|
+
- 🧰 Drag & drop com DnD Kit
|
|
40
|
+
- 📊 Visualizações com Recharts
|
|
41
|
+
- 🧪 Totalmente tipado com TypeScript
|
|
42
|
+
- 📚 Documentação interativa com Storybook
|
|
43
|
+
- ⚡ Build otimizado com Vite
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📂 Estrutura do Projeto
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
📁 src/
|
|
51
|
+
┣ 📦 components/
|
|
52
|
+
┣ ┣ 📦 atoms/
|
|
53
|
+
┣ ┣ 📦 molecules/
|
|
54
|
+
┣ ┣ 📦 organisms/
|
|
55
|
+
┣ ┣ 📄 index.ts
|
|
56
|
+
┣ 📦 hooks/
|
|
57
|
+
┣ 📦 utils/
|
|
58
|
+
┗ 📄 index.ts
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 🧪 Scripts
|
|
64
|
+
|
|
65
|
+
| Comando | Descrição |
|
|
66
|
+
| ---------------------- | ------------------------------------------------- |
|
|
67
|
+
| `pnpm build` | Compila a lib com TypeScript e Vite |
|
|
68
|
+
| `pnpm lint` | Lint no projeto com ESLint |
|
|
69
|
+
| `pnpm storybook` | Inicia o Storybook em ambiente de desenvolvimento |
|
|
70
|
+
| `pnpm build-storybook` | Gera versão estática do Storybook |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 📚 Storybook
|
|
75
|
+
|
|
76
|
+
Explore e teste os componentes interativamente:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pnpm storybook
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Ou gere a versão estática:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm build-storybook
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 🧩 Tecnologias Utilizadas
|
|
91
|
+
|
|
92
|
+
- React 19
|
|
93
|
+
- TailwindCSS
|
|
94
|
+
- Radix UI
|
|
95
|
+
- DnD Kit
|
|
96
|
+
- Tanstack react-table
|
|
97
|
+
- Tabler icons-react
|
|
98
|
+
- Date fns
|
|
99
|
+
- Recharts
|
|
100
|
+
- React Hook Form
|
|
101
|
+
- Zod
|
|
102
|
+
- Storybook
|
|
103
|
+
- Vite
|
|
104
|
+
- TypeScript
|
|
105
|
+
- ESLint
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 📝 Licença
|
|
110
|
+
|
|
111
|
+
MIT © Roccato — Feito com ❤️ pelo time MB Labs.
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
|
18
18
|
import { FieldError } from 'react-hook-form';
|
|
19
19
|
import { FieldPath } from 'react-hook-form';
|
|
20
20
|
import { FieldValues } from 'react-hook-form';
|
|
21
|
+
import { FileUploadProps } from './file';
|
|
21
22
|
import { GroupBase } from 'react-select';
|
|
22
23
|
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
23
24
|
import { JSX } from 'react/jsx-runtime';
|
|
@@ -342,7 +343,7 @@ export declare function DrawerTrigger({ ...props }: React_2.ComponentProps<typeo
|
|
|
342
343
|
|
|
343
344
|
export declare const Dropdown: <Option extends {
|
|
344
345
|
label: string;
|
|
345
|
-
}, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ classNames, components: customComponents, creatable, ...props }: DropdownProps<Option, IsMulti, Group>) => JSX.Element;
|
|
346
|
+
}, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ classNames, components: customComponents, creatable, isDisabled, ...props }: DropdownProps<Option, IsMulti, Group>) => JSX.Element;
|
|
346
347
|
|
|
347
348
|
export declare function DropdownMenu({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Root>): JSX.Element;
|
|
348
349
|
|
|
@@ -383,8 +384,11 @@ export declare function DropdownMenuTrigger({ ...props }: React_2.ComponentProps
|
|
|
383
384
|
|
|
384
385
|
declare type DropdownProps<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> = Props<Option, IsMulti, Group> & {
|
|
385
386
|
creatable?: boolean;
|
|
387
|
+
isDisabled?: boolean;
|
|
386
388
|
};
|
|
387
389
|
|
|
390
|
+
export declare const FileUpload: ({ onUpload, maxSize, accept, maxFiles, className, dragAndDropLabel, dragActiveLabel, maxSizeLabel, maxFilesLabel, uploadCompleteLabel, }: FileUploadProps) => JSX.Element;
|
|
391
|
+
|
|
388
392
|
export declare function Flex({ className, ...props }: React.ComponentProps<'div'>): JSX.Element;
|
|
389
393
|
|
|
390
394
|
export declare function Form<T extends FieldValues>({ methods, onValid, onInvalid, className, children, ...props }: FormProps<T>): JSX.Element;
|