eai-frontend-components 2.0.4
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/LICENSE +21 -0
- package/README.md +299 -0
- package/dist/components/accordion.d.ts +8 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +13 -0
- package/dist/components/alert-dialog.d.ts +25 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +27 -0
- package/dist/components/alert.d.ts +9 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +22 -0
- package/dist/components/avatar.d.ts +7 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +11 -0
- package/dist/components/badge.d.ts +10 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +26 -0
- package/dist/components/breadcrumb.d.ts +20 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +23 -0
- package/dist/components/button.d.ts +12 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +33 -0
- package/dist/components/calendar.d.ts +9 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +70 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +16 -0
- package/dist/components/carousel.d.ts +19 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +98 -0
- package/dist/components/chart.d.ts +63 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +130 -0
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +8 -0
- package/dist/components/collapsible.d.ts +6 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +5 -0
- package/dist/components/command.d.ts +81 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +28 -0
- package/dist/components/context-menu.d.ts +28 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +33 -0
- package/dist/components/custom/date-picker.d.ts +12 -0
- package/dist/components/custom/date-picker.d.ts.map +1 -0
- package/dist/components/custom/date-picker.js +35 -0
- package/dist/components/custom/form/checkbox.d.ts +13 -0
- package/dist/components/custom/form/checkbox.d.ts.map +1 -0
- package/dist/components/custom/form/checkbox.js +15 -0
- package/dist/components/custom/form/color.d.ts +15 -0
- package/dist/components/custom/form/color.d.ts.map +1 -0
- package/dist/components/custom/form/color.js +40 -0
- package/dist/components/custom/form/combobox.d.ts +37 -0
- package/dist/components/custom/form/combobox.d.ts.map +1 -0
- package/dist/components/custom/form/combobox.js +82 -0
- package/dist/components/custom/form/cpf-cnpj.d.ts +16 -0
- package/dist/components/custom/form/cpf-cnpj.d.ts.map +1 -0
- package/dist/components/custom/form/cpf-cnpj.js +32 -0
- package/dist/components/custom/form/currency.d.ts +14 -0
- package/dist/components/custom/form/currency.d.ts.map +1 -0
- package/dist/components/custom/form/currency.js +15 -0
- package/dist/components/custom/form/date-range.d.ts +16 -0
- package/dist/components/custom/form/date-range.d.ts.map +1 -0
- package/dist/components/custom/form/date-range.js +24 -0
- package/dist/components/custom/form/date.d.ts +16 -0
- package/dist/components/custom/form/date.d.ts.map +1 -0
- package/dist/components/custom/form/date.js +35 -0
- package/dist/components/custom/form/decimal.d.ts +14 -0
- package/dist/components/custom/form/decimal.d.ts.map +1 -0
- package/dist/components/custom/form/decimal.js +15 -0
- package/dist/components/custom/form/file.d.ts +15 -0
- package/dist/components/custom/form/file.d.ts.map +1 -0
- package/dist/components/custom/form/file.js +18 -0
- package/dist/components/custom/form/form-help-text.d.ts +3 -0
- package/dist/components/custom/form/form-help-text.d.ts.map +1 -0
- package/dist/components/custom/form/form-help-text.js +7 -0
- package/dist/components/custom/form/form-label.d.ts +4 -0
- package/dist/components/custom/form/form-label.d.ts.map +1 -0
- package/dist/components/custom/form/form-label.js +9 -0
- package/dist/components/custom/form/form-message.d.ts +3 -0
- package/dist/components/custom/form/form-message.d.ts.map +1 -0
- package/dist/components/custom/form/form-message.js +5 -0
- package/dist/components/custom/form/ghost.d.ts +8 -0
- package/dist/components/custom/form/ghost.d.ts.map +1 -0
- package/dist/components/custom/form/ghost.js +8 -0
- package/dist/components/custom/form/input.d.ts +18 -0
- package/dist/components/custom/form/input.d.ts.map +1 -0
- package/dist/components/custom/form/input.js +14 -0
- package/dist/components/custom/form/mask.d.ts +19 -0
- package/dist/components/custom/form/mask.d.ts.map +1 -0
- package/dist/components/custom/form/mask.js +19 -0
- package/dist/components/custom/form/multi-select-old.d.ts +19 -0
- package/dist/components/custom/form/multi-select-old.d.ts.map +1 -0
- package/dist/components/custom/form/multi-select-old.js +30 -0
- package/dist/components/custom/form/multi-select.d.ts +26 -0
- package/dist/components/custom/form/multi-select.d.ts.map +1 -0
- package/dist/components/custom/form/multi-select.js +66 -0
- package/dist/components/custom/form/password.d.ts +16 -0
- package/dist/components/custom/form/password.d.ts.map +1 -0
- package/dist/components/custom/form/password.js +14 -0
- package/dist/components/custom/form/percent.d.ts +14 -0
- package/dist/components/custom/form/percent.d.ts.map +1 -0
- package/dist/components/custom/form/percent.js +15 -0
- package/dist/components/custom/form/phone.d.ts +16 -0
- package/dist/components/custom/form/phone.d.ts.map +1 -0
- package/dist/components/custom/form/phone.js +23 -0
- package/dist/components/custom/form/radio-group.d.ts +23 -0
- package/dist/components/custom/form/radio-group.d.ts.map +1 -0
- package/dist/components/custom/form/radio-group.js +15 -0
- package/dist/components/custom/form/select.d.ts +20 -0
- package/dist/components/custom/form/select.d.ts.map +1 -0
- package/dist/components/custom/form/select.js +12 -0
- package/dist/components/custom/form/step-new-form.d.ts +10 -0
- package/dist/components/custom/form/step-new-form.d.ts.map +1 -0
- package/dist/components/custom/form/step-new-form.js +13 -0
- package/dist/components/custom/form/switch.d.ts +13 -0
- package/dist/components/custom/form/switch.d.ts.map +1 -0
- package/dist/components/custom/form/switch.js +16 -0
- package/dist/components/custom/form/text.d.ts +18 -0
- package/dist/components/custom/form/text.d.ts.map +1 -0
- package/dist/components/custom/form/text.js +14 -0
- package/dist/components/custom/form/textarea.d.ts +16 -0
- package/dist/components/custom/form/textarea.d.ts.map +1 -0
- package/dist/components/custom/form/textarea.js +19 -0
- package/dist/components/custom/form/utils.d.ts +18 -0
- package/dist/components/custom/form/utils.d.ts.map +1 -0
- package/dist/components/custom/form/utils.js +88 -0
- package/dist/components/custom/header.d.ts +3 -0
- package/dist/components/custom/header.d.ts.map +1 -0
- package/dist/components/custom/header.js +94 -0
- package/dist/components/custom/label.d.ts +13 -0
- package/dist/components/custom/label.d.ts.map +1 -0
- package/dist/components/custom/label.js +20 -0
- package/dist/components/custom/not-found.d.ts +3 -0
- package/dist/components/custom/not-found.d.ts.map +1 -0
- package/dist/components/custom/not-found.js +9 -0
- package/dist/components/custom/sidebar/app-sidebar.d.ts +5 -0
- package/dist/components/custom/sidebar/app-sidebar.d.ts.map +1 -0
- package/dist/components/custom/sidebar/app-sidebar.js +26 -0
- package/dist/components/custom/sidebar/module-switcher.d.ts +3 -0
- package/dist/components/custom/sidebar/module-switcher.d.ts.map +1 -0
- package/dist/components/custom/sidebar/module-switcher.js +55 -0
- package/dist/components/custom/sidebar/nav-footer.d.ts +3 -0
- package/dist/components/custom/sidebar/nav-footer.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-footer.js +17 -0
- package/dist/components/custom/sidebar/nav-main.d.ts +3 -0
- package/dist/components/custom/sidebar/nav-main.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-main.js +32 -0
- package/dist/components/custom/sidebar/nav-submenu-collapsible.d.ts +9 -0
- package/dist/components/custom/sidebar/nav-submenu-collapsible.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-submenu-collapsible.js +21 -0
- package/dist/components/custom/sidebar/nav-submenu-dropdown.d.ts +10 -0
- package/dist/components/custom/sidebar/nav-submenu-dropdown.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-submenu-dropdown.js +13 -0
- package/dist/components/custom/sidebar/nav-user.d.ts +3 -0
- package/dist/components/custom/sidebar/nav-user.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-user.js +51 -0
- package/dist/components/custom/sidebar/sidebar-button.d.ts +9 -0
- package/dist/components/custom/sidebar/sidebar-button.d.ts.map +1 -0
- package/dist/components/custom/sidebar/sidebar-button.js +7 -0
- package/dist/components/custom/sidebar/sidebar-item-two-lines.d.ts +12 -0
- package/dist/components/custom/sidebar/sidebar-item-two-lines.d.ts.map +1 -0
- package/dist/components/custom/sidebar/sidebar-item-two-lines.js +5 -0
- package/dist/components/custom/sidebar/sidebar-item.d.ts +9 -0
- package/dist/components/custom/sidebar/sidebar-item.d.ts.map +1 -0
- package/dist/components/custom/sidebar/sidebar-item.js +7 -0
- package/dist/components/custom/sidebar/types/sidebar.d.ts +29 -0
- package/dist/components/custom/sidebar/types/sidebar.d.ts.map +1 -0
- package/dist/components/custom/sidebar/types/sidebar.js +5 -0
- package/dist/components/custom/table/data-table-export.d.ts +8 -0
- package/dist/components/custom/table/data-table-export.d.ts.map +1 -0
- package/dist/components/custom/table/data-table-export.js +65 -0
- package/dist/components/custom/table/data-table-footer.d.ts +25 -0
- package/dist/components/custom/table/data-table-footer.d.ts.map +1 -0
- package/dist/components/custom/table/data-table-footer.js +39 -0
- package/dist/components/custom/table/data-table-header.d.ts +9 -0
- package/dist/components/custom/table/data-table-header.d.ts.map +1 -0
- package/dist/components/custom/table/data-table-header.js +11 -0
- package/dist/components/custom/table/data-table-rows.d.ts +13 -0
- package/dist/components/custom/table/data-table-rows.d.ts.map +1 -0
- package/dist/components/custom/table/data-table-rows.js +25 -0
- package/dist/components/custom/table/data-table.d.ts +35 -0
- package/dist/components/custom/table/data-table.d.ts.map +1 -0
- package/dist/components/custom/table/data-table.js +99 -0
- package/dist/components/custom/table/types/data-table.d.ts +29 -0
- package/dist/components/custom/table/types/data-table.d.ts.map +1 -0
- package/dist/components/custom/table/types/data-table.js +1 -0
- package/dist/components/custom/theme-provider.d.ts +24 -0
- package/dist/components/custom/theme-provider.d.ts.map +1 -0
- package/dist/components/custom/theme-provider.js +79 -0
- package/dist/components/dateRangePicker.d.ts +3 -0
- package/dist/components/dateRangePicker.d.ts.map +1 -0
- package/dist/components/dateRangePicker.js +15 -0
- package/dist/components/dialog.d.ts +23 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +23 -0
- package/dist/components/drawer.d.ts +23 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +22 -0
- package/dist/components/dropdown-menu.d.ts +28 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +32 -0
- package/dist/components/form.d.ts +24 -0
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +60 -0
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +9 -0
- package/dist/components/input.d.ts +24 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +71 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +9 -0
- package/dist/components/masks.d.ts +17 -0
- package/dist/components/masks.d.ts.map +1 -0
- package/dist/components/masks.js +25 -0
- package/dist/components/pagination.d.ts +30 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +23 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +11 -0
- package/dist/components/progress.d.ts +5 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +7 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +14 -0
- package/dist/components/scroll-area.d.ts +6 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +11 -0
- package/dist/components/select.d.ts +14 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +24 -0
- package/dist/components/separator.d.ts +5 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/sheet.d.ts +26 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +37 -0
- package/dist/components/sidebar.d.ts +67 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +221 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +6 -0
- package/dist/components/slider.d.ts +5 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +7 -0
- package/dist/components/switch.d.ts +5 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +7 -0
- package/dist/components/table.d.ts +11 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +20 -0
- package/dist/components/tabs.d.ts +8 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +12 -0
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +14 -0
- package/dist/components/toast.d.ts +16 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +34 -0
- package/dist/components/toaster.d.ts +2 -0
- package/dist/components/toaster.d.ts.map +1 -0
- package/dist/components/toaster.js +21 -0
- package/dist/components/tooltip.d.ts +8 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +10 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +13 -0
- package/dist/components/ui/alert-dialog.d.ts +25 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +27 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +22 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +11 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +23 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +33 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +70 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +16 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +98 -0
- package/dist/components/ui/chart.d.ts +63 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +130 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +8 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +5 -0
- package/dist/components/ui/command.d.ts +81 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +28 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +33 -0
- package/dist/components/ui/custom/date-picker.d.ts +12 -0
- package/dist/components/ui/custom/date-picker.d.ts.map +1 -0
- package/dist/components/ui/custom/date-picker.js +35 -0
- package/dist/components/ui/custom/form/checkbox.d.ts +13 -0
- package/dist/components/ui/custom/form/checkbox.d.ts.map +1 -0
- package/dist/components/ui/custom/form/checkbox.js +15 -0
- package/dist/components/ui/custom/form/color.d.ts +15 -0
- package/dist/components/ui/custom/form/color.d.ts.map +1 -0
- package/dist/components/ui/custom/form/color.js +40 -0
- package/dist/components/ui/custom/form/combobox.d.ts +37 -0
- package/dist/components/ui/custom/form/combobox.d.ts.map +1 -0
- package/dist/components/ui/custom/form/combobox.js +82 -0
- package/dist/components/ui/custom/form/cpf-cnpj.d.ts +16 -0
- package/dist/components/ui/custom/form/cpf-cnpj.d.ts.map +1 -0
- package/dist/components/ui/custom/form/cpf-cnpj.js +32 -0
- package/dist/components/ui/custom/form/currency.d.ts +14 -0
- package/dist/components/ui/custom/form/currency.d.ts.map +1 -0
- package/dist/components/ui/custom/form/currency.js +15 -0
- package/dist/components/ui/custom/form/date-range.d.ts +16 -0
- package/dist/components/ui/custom/form/date-range.d.ts.map +1 -0
- package/dist/components/ui/custom/form/date-range.js +24 -0
- package/dist/components/ui/custom/form/date.d.ts +16 -0
- package/dist/components/ui/custom/form/date.d.ts.map +1 -0
- package/dist/components/ui/custom/form/date.js +35 -0
- package/dist/components/ui/custom/form/decimal.d.ts +14 -0
- package/dist/components/ui/custom/form/decimal.d.ts.map +1 -0
- package/dist/components/ui/custom/form/decimal.js +15 -0
- package/dist/components/ui/custom/form/file.d.ts +15 -0
- package/dist/components/ui/custom/form/file.d.ts.map +1 -0
- package/dist/components/ui/custom/form/file.js +18 -0
- package/dist/components/ui/custom/form/form-help-text.d.ts +3 -0
- package/dist/components/ui/custom/form/form-help-text.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-help-text.js +7 -0
- package/dist/components/ui/custom/form/form-label.d.ts +7 -0
- package/dist/components/ui/custom/form/form-label.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-label.js +9 -0
- package/dist/components/ui/custom/form/form-message.d.ts +5 -0
- package/dist/components/ui/custom/form/form-message.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-message.js +5 -0
- package/dist/components/ui/custom/form/ghost.d.ts +8 -0
- package/dist/components/ui/custom/form/ghost.d.ts.map +1 -0
- package/dist/components/ui/custom/form/ghost.js +8 -0
- package/dist/components/ui/custom/form/input.d.ts +18 -0
- package/dist/components/ui/custom/form/input.d.ts.map +1 -0
- package/dist/components/ui/custom/form/input.js +14 -0
- package/dist/components/ui/custom/form/mask.d.ts +19 -0
- package/dist/components/ui/custom/form/mask.d.ts.map +1 -0
- package/dist/components/ui/custom/form/mask.js +19 -0
- package/dist/components/ui/custom/form/multi-select-old.d.ts +19 -0
- package/dist/components/ui/custom/form/multi-select-old.d.ts.map +1 -0
- package/dist/components/ui/custom/form/multi-select-old.js +30 -0
- package/dist/components/ui/custom/form/multi-select.d.ts +26 -0
- package/dist/components/ui/custom/form/multi-select.d.ts.map +1 -0
- package/dist/components/ui/custom/form/multi-select.js +66 -0
- package/dist/components/ui/custom/form/password.d.ts +16 -0
- package/dist/components/ui/custom/form/password.d.ts.map +1 -0
- package/dist/components/ui/custom/form/password.js +14 -0
- package/dist/components/ui/custom/form/percent.d.ts +14 -0
- package/dist/components/ui/custom/form/percent.d.ts.map +1 -0
- package/dist/components/ui/custom/form/percent.js +15 -0
- package/dist/components/ui/custom/form/phone.d.ts +16 -0
- package/dist/components/ui/custom/form/phone.d.ts.map +1 -0
- package/dist/components/ui/custom/form/phone.js +23 -0
- package/dist/components/ui/custom/form/radio-group.d.ts +23 -0
- package/dist/components/ui/custom/form/radio-group.d.ts.map +1 -0
- package/dist/components/ui/custom/form/radio-group.js +15 -0
- package/dist/components/ui/custom/form/select.d.ts +20 -0
- package/dist/components/ui/custom/form/select.d.ts.map +1 -0
- package/dist/components/ui/custom/form/select.js +12 -0
- package/dist/components/ui/custom/form/step-new-form.d.ts +10 -0
- package/dist/components/ui/custom/form/step-new-form.d.ts.map +1 -0
- package/dist/components/ui/custom/form/step-new-form.js +13 -0
- package/dist/components/ui/custom/form/switch.d.ts +13 -0
- package/dist/components/ui/custom/form/switch.d.ts.map +1 -0
- package/dist/components/ui/custom/form/switch.js +16 -0
- package/dist/components/ui/custom/form/text.d.ts +18 -0
- package/dist/components/ui/custom/form/text.d.ts.map +1 -0
- package/dist/components/ui/custom/form/text.js +14 -0
- package/dist/components/ui/custom/form/textarea.d.ts +16 -0
- package/dist/components/ui/custom/form/textarea.d.ts.map +1 -0
- package/dist/components/ui/custom/form/textarea.js +19 -0
- package/dist/components/ui/custom/form/utils.d.ts +18 -0
- package/dist/components/ui/custom/form/utils.d.ts.map +1 -0
- package/dist/components/ui/custom/form/utils.js +88 -0
- package/dist/components/ui/custom/header.d.ts +11 -0
- package/dist/components/ui/custom/header.d.ts.map +1 -0
- package/dist/components/ui/custom/header.js +74 -0
- package/dist/components/ui/custom/label.d.ts +13 -0
- package/dist/components/ui/custom/label.d.ts.map +1 -0
- package/dist/components/ui/custom/label.js +20 -0
- package/dist/components/ui/custom/not-found.d.ts +3 -0
- package/dist/components/ui/custom/not-found.d.ts.map +1 -0
- package/dist/components/ui/custom/not-found.js +9 -0
- package/dist/components/ui/custom/sidebar/app-sidebar.d.ts +5 -0
- package/dist/components/ui/custom/sidebar/app-sidebar.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/app-sidebar.js +26 -0
- package/dist/components/ui/custom/sidebar/module-switcher.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/module-switcher.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/module-switcher.js +55 -0
- package/dist/components/ui/custom/sidebar/nav-footer.d.ts +7 -0
- package/dist/components/ui/custom/sidebar/nav-footer.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-footer.js +13 -0
- package/dist/components/ui/custom/sidebar/nav-main.d.ts +7 -0
- package/dist/components/ui/custom/sidebar/nav-main.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-main.js +27 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.js +18 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts +10 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.js +10 -0
- package/dist/components/ui/custom/sidebar/nav-user.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/nav-user.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-user.js +24 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.js +7 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts +12 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.js +5 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.js +7 -0
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.js +20 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.d.ts +29 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.js +5 -0
- package/dist/components/ui/custom/table/data-table-export.d.ts +8 -0
- package/dist/components/ui/custom/table/data-table-export.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-export.js +65 -0
- package/dist/components/ui/custom/table/data-table-footer.d.ts +25 -0
- package/dist/components/ui/custom/table/data-table-footer.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-footer.js +39 -0
- package/dist/components/ui/custom/table/data-table-header.d.ts +9 -0
- package/dist/components/ui/custom/table/data-table-header.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-header.js +11 -0
- package/dist/components/ui/custom/table/data-table-rows.d.ts +13 -0
- package/dist/components/ui/custom/table/data-table-rows.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-rows.js +25 -0
- package/dist/components/ui/custom/table/data-table.d.ts +35 -0
- package/dist/components/ui/custom/table/data-table.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table.js +99 -0
- package/dist/components/ui/custom/table/types/data-table.d.ts +29 -0
- package/dist/components/ui/custom/table/types/data-table.d.ts.map +1 -0
- package/dist/components/ui/custom/table/types/data-table.js +1 -0
- package/dist/components/ui/custom/theme-provider.d.ts +24 -0
- package/dist/components/ui/custom/theme-provider.d.ts.map +1 -0
- package/dist/components/ui/custom/theme-provider.js +79 -0
- package/dist/components/ui/dateRangePicker.d.ts +3 -0
- package/dist/components/ui/dateRangePicker.d.ts.map +1 -0
- package/dist/components/ui/dateRangePicker.js +15 -0
- package/dist/components/ui/dialog.d.ts +23 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +23 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +32 -0
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +60 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +9 -0
- package/dist/components/ui/input.d.ts +24 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +71 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +9 -0
- package/dist/components/ui/masks.d.ts +17 -0
- package/dist/components/ui/masks.d.ts.map +1 -0
- package/dist/components/ui/masks.js +25 -0
- package/dist/components/ui/pagination.d.ts +30 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +23 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +11 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +7 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +14 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +11 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +24 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +7 -0
- package/dist/components/ui/sheet.d.ts +26 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +37 -0
- package/dist/components/ui/sidebar.d.ts +67 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +221 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +6 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +7 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +7 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +20 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +12 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/toast.d.ts +16 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +34 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +21 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +10 -0
- package/dist/components/ui/use-calendar.d.ts +7 -0
- package/dist/components/ui/use-calendar.d.ts.map +1 -0
- package/dist/components/ui/use-calendar.js +23 -0
- package/dist/components/ui/use-toast.d.ts +46 -0
- package/dist/components/ui/use-toast.d.ts.map +1 -0
- package/dist/components/ui/use-toast.js +125 -0
- package/dist/components/use-calendar.d.ts +7 -0
- package/dist/components/use-calendar.d.ts.map +1 -0
- package/dist/components/use-calendar.js +23 -0
- package/dist/components/use-toast.d.ts +46 -0
- package/dist/components/use-toast.d.ts.map +1 -0
- package/dist/components/use-toast.js +125 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +1514 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +3233 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +3558 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/help/date-utils.d.ts +7 -0
- package/dist/lib/help/date-utils.d.ts.map +1 -0
- package/dist/lib/help/date-utils.js +34 -0
- package/dist/lib/help/format.d.ts +22 -0
- package/dist/lib/help/format.d.ts.map +1 -0
- package/dist/lib/help/format.js +140 -0
- package/dist/lib/help/theme.d.ts +291 -0
- package/dist/lib/help/theme.d.ts.map +1 -0
- package/dist/lib/help/theme.js +340 -0
- package/dist/lib/help/uuid.d.ts +2 -0
- package/dist/lib/help/uuid.d.ts.map +1 -0
- package/dist/lib/help/uuid.js +4 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/package.json +146 -0
- package/src/components/ui/accordion.tsx +48 -0
- package/src/components/ui/alert-dialog.tsx +138 -0
- package/src/components/ui/alert.tsx +36 -0
- package/src/components/ui/avatar.tsx +48 -0
- package/src/components/ui/badge.tsx +35 -0
- package/src/components/ui/breadcrumb.tsx +115 -0
- package/src/components/ui/button.tsx +43 -0
- package/src/components/ui/calendar.tsx +142 -0
- package/src/components/ui/card.tsx +35 -0
- package/src/components/ui/carousel.tsx +257 -0
- package/src/components/ui/chart.tsx +364 -0
- package/src/components/ui/checkbox.tsx +26 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/command.tsx +145 -0
- package/src/components/ui/context-menu.tsx +198 -0
- package/src/components/ui/custom/date-picker.tsx +97 -0
- package/src/components/ui/custom/form/checkbox.tsx +53 -0
- package/src/components/ui/custom/form/color.tsx +140 -0
- package/src/components/ui/custom/form/combobox.tsx +259 -0
- package/src/components/ui/custom/form/cpf-cnpj.tsx +85 -0
- package/src/components/ui/custom/form/currency.tsx +51 -0
- package/src/components/ui/custom/form/date-range.tsx +110 -0
- package/src/components/ui/custom/form/date.tsx +109 -0
- package/src/components/ui/custom/form/decimal.tsx +50 -0
- package/src/components/ui/custom/form/file.tsx +65 -0
- package/src/components/ui/custom/form/form-help-text.tsx +20 -0
- package/src/components/ui/custom/form/form-label.tsx +24 -0
- package/src/components/ui/custom/form/form-message.tsx +10 -0
- package/src/components/ui/custom/form/ghost.tsx +28 -0
- package/src/components/ui/custom/form/input.tsx +69 -0
- package/src/components/ui/custom/form/mask.tsx +78 -0
- package/src/components/ui/custom/form/multi-select.tsx +209 -0
- package/src/components/ui/custom/form/password.tsx +70 -0
- package/src/components/ui/custom/form/percent.tsx +52 -0
- package/src/components/ui/custom/form/phone.tsx +79 -0
- package/src/components/ui/custom/form/radio-group.tsx +94 -0
- package/src/components/ui/custom/form/select.tsx +62 -0
- package/src/components/ui/custom/form/step-new-form.tsx +49 -0
- package/src/components/ui/custom/form/switch.tsx +51 -0
- package/src/components/ui/custom/form/text.tsx +71 -0
- package/src/components/ui/custom/form/textarea.tsx +71 -0
- package/src/components/ui/custom/form/utils.ts +100 -0
- package/src/components/ui/custom/header.tsx +128 -0
- package/src/components/ui/custom/label.tsx +79 -0
- package/src/components/ui/custom/not-found.tsx +30 -0
- package/src/components/ui/custom/sidebar/module-switcher.tsx +58 -0
- package/src/components/ui/custom/sidebar/nav-footer.tsx +35 -0
- package/src/components/ui/custom/sidebar/nav-main.tsx +64 -0
- package/src/components/ui/custom/sidebar/nav-submenu-collapsible.tsx +60 -0
- package/src/components/ui/custom/sidebar/nav-submenu-dropdown.tsx +56 -0
- package/src/components/ui/custom/sidebar/nav-user.tsx +77 -0
- package/src/components/ui/custom/sidebar/sidebar-button.tsx +30 -0
- package/src/components/ui/custom/sidebar/sidebar-item-two-lines.tsx +25 -0
- package/src/components/ui/custom/sidebar/sidebar-item.tsx +19 -0
- package/src/components/ui/custom/sidebar/types/sidebar.ts +31 -0
- package/src/components/ui/custom/table/data-table-export.tsx +126 -0
- package/src/components/ui/custom/table/data-table-footer.tsx +148 -0
- package/src/components/ui/custom/table/data-table-header.tsx +58 -0
- package/src/components/ui/custom/table/data-table-rows.tsx +94 -0
- package/src/components/ui/custom/table/data-table.tsx +285 -0
- package/src/components/ui/custom/table/types/data-table.ts +31 -0
- package/src/components/ui/custom/theme-provider.tsx +121 -0
- package/src/components/ui/dateRangePicker.tsx +63 -0
- package/src/components/ui/dialog.tsx +84 -0
- package/src/components/ui/drawer.tsx +116 -0
- package/src/components/ui/dropdown-menu.tsx +173 -0
- package/src/components/ui/form.tsx +114 -0
- package/src/components/ui/hover-card.tsx +27 -0
- package/src/components/ui/input.tsx +265 -0
- package/src/components/ui/label.tsx +15 -0
- package/src/components/ui/masks.ts +35 -0
- package/src/components/ui/pagination.tsx +78 -0
- package/src/components/ui/popover.tsx +32 -0
- package/src/components/ui/progress.tsx +22 -0
- package/src/components/ui/radio-group.tsx +36 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.tsx +130 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.tsx +90 -0
- package/src/components/ui/sidebar.tsx +598 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +18 -0
- package/src/components/ui/switch.tsx +26 -0
- package/src/components/ui/table.tsx +53 -0
- package/src/components/ui/tabs.tsx +47 -0
- package/src/components/ui/textarea.tsx +27 -0
- package/src/components/ui/toast.tsx +88 -0
- package/src/components/ui/toaster.tsx +49 -0
- package/src/components/ui/tooltip.tsx +31 -0
- package/src/components/ui/use-calendar.tsx +61 -0
- package/src/components/ui/use-toast.ts +186 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +299 -0
- package/src/lib/help/date-utils.ts +41 -0
- package/src/lib/help/format.ts +171 -0
- package/src/lib/help/theme.ts +346 -0
- package/src/lib/help/uuid.ts +4 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/globals.css +59 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ReactNode, useEffect, useRef } from 'react';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
import LoadingBar, { LoadingBarRef } from 'react-top-loading-bar';
|
|
4
|
+
import { getTailwindColorShades, TailwindColorName } from '../../../lib/help/theme';
|
|
5
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from '../breadcrumb';
|
|
6
|
+
import { SidebarTrigger } from '../sidebar';
|
|
7
|
+
import { Module, SidebarPage } from './sidebar/types/sidebar';
|
|
8
|
+
import { DEFAULT_THEME_DATA, useTheme } from './theme-provider';
|
|
9
|
+
|
|
10
|
+
const Header = ({
|
|
11
|
+
splittedPath,
|
|
12
|
+
modules,
|
|
13
|
+
pages,
|
|
14
|
+
isLoading,
|
|
15
|
+
combobox,
|
|
16
|
+
}: { splittedPath: string[]; modules: Module[]; pages: SidebarPage[]; isLoading: boolean; combobox: ReactNode }) => {
|
|
17
|
+
const { portalDefinitions } = useTheme();
|
|
18
|
+
const navigate = useNavigate();
|
|
19
|
+
const refProgressLoading = useRef<LoadingBarRef>(null);
|
|
20
|
+
const lastPage = splittedPath[splittedPath.length - 1];
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
isLoading ? refProgressLoading.current?.start() : refProgressLoading.current?.complete();
|
|
24
|
+
}, [isLoading]);
|
|
25
|
+
|
|
26
|
+
const setRouter = (path: string) => {
|
|
27
|
+
navigate(path);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getPath = (index: number) => {
|
|
31
|
+
let path = '';
|
|
32
|
+
|
|
33
|
+
for (let i = 0; i <= index; i++) {
|
|
34
|
+
path += `/${splittedPath[i]}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return path;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const getLinkSidebar = (index: number) => {
|
|
41
|
+
return pages.find((item) => item.path === getPath(index));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const getSubMenuItem = (index: number) => {
|
|
45
|
+
return pages.flatMap((item) => item.subMenuItems || []).find((sub) => sub.path === getPath(index));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getModule = (page: string) => {
|
|
49
|
+
const module = modules.find((mod) => mod.value === page);
|
|
50
|
+
if (!module) {
|
|
51
|
+
return page;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return module?.title;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const getTitle = (index: number) => {
|
|
58
|
+
const linkSidebar = getLinkSidebar(index);
|
|
59
|
+
const subMenuItem = getSubMenuItem(index);
|
|
60
|
+
|
|
61
|
+
if (subMenuItem) {
|
|
62
|
+
return subMenuItem.label;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return linkSidebar?.title;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const renderBreadcrumbPage = (index: number) => {
|
|
69
|
+
return <BreadcrumbPage>{getTitle(index)}</BreadcrumbPage>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const renderBreadcrumbLink = (page: string, index: number) => {
|
|
73
|
+
const linkSidebar = getLinkSidebar(index);
|
|
74
|
+
|
|
75
|
+
return linkSidebar?.subMenuType ? (
|
|
76
|
+
renderBreadcrumbPage(index)
|
|
77
|
+
) : (
|
|
78
|
+
<BreadcrumbLink onClick={() => setRouter(getPath(index))} className='cursor-pointer'>
|
|
79
|
+
{index === 0 ? getModule(page) : getTitle(index)}
|
|
80
|
+
</BreadcrumbLink>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const renderBreadcrumbItens = () => {
|
|
85
|
+
const breadcrumbItems: JSX.Element[] = [];
|
|
86
|
+
|
|
87
|
+
splittedPath.map((page, index) => {
|
|
88
|
+
breadcrumbItems.push(
|
|
89
|
+
<BreadcrumbItem key={`breadcrumb-item-${index}`}>
|
|
90
|
+
{page === lastPage ? renderBreadcrumbPage(index) : renderBreadcrumbLink(page, index)}
|
|
91
|
+
</BreadcrumbItem>,
|
|
92
|
+
);
|
|
93
|
+
if (page !== lastPage) {
|
|
94
|
+
breadcrumbItems.push(<BreadcrumbSeparator key={`breadcrumb-separator-${index}`} className='mt-[1px]' />);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
return breadcrumbItems;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const getColorLoadingBar = () => {
|
|
102
|
+
const colorShades = getTailwindColorShades();
|
|
103
|
+
const tailwindColor = portalDefinitions?.mvnoPrimaryColor || DEFAULT_THEME_DATA.mvnoPrimaryColor;
|
|
104
|
+
const isValidColor = (color: string): color is TailwindColorName => color in colorShades;
|
|
105
|
+
const colorPallete = isValidColor(tailwindColor) ? colorShades[tailwindColor] : colorShades.violet;
|
|
106
|
+
return colorPallete[900];
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<header className='flex flex-col justify-between items-center w-full'>
|
|
111
|
+
<div className='flex justify-between items-center py-3 px-5 w-full'>
|
|
112
|
+
<div className='flex items-center gap-x-2 h-[40px]'>
|
|
113
|
+
<SidebarTrigger className='p-5' />
|
|
114
|
+
<div className='p-2'>
|
|
115
|
+
<Breadcrumb>
|
|
116
|
+
<BreadcrumbList>{renderBreadcrumbItens()}</BreadcrumbList>
|
|
117
|
+
</Breadcrumb>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<div className='flex items-center'>{combobox}</div>
|
|
122
|
+
</div>
|
|
123
|
+
{<LoadingBar ref={refProgressLoading} color={getColorLoadingBar()} height={7} />}
|
|
124
|
+
</header>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default Header;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Copy } from 'lucide-react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../../../lib/utils';
|
|
4
|
+
import { Button } from '../button';
|
|
5
|
+
import { Skeleton } from '../skeleton';
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../tooltip';
|
|
7
|
+
import { toast } from '../use-toast';
|
|
8
|
+
|
|
9
|
+
interface LabelWithTitleProps {
|
|
10
|
+
title: string;
|
|
11
|
+
value: string;
|
|
12
|
+
value2?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
showCopyIcon?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
isLoading?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const LabelWithTitle: React.FC<LabelWithTitleProps> = ({ title, value, value2, required, showCopyIcon = false, className, isLoading }) => {
|
|
20
|
+
const handleCopy = () => {
|
|
21
|
+
if (showCopyIcon && value) {
|
|
22
|
+
navigator.clipboard.writeText(`${value}${value2 ?? ''}`);
|
|
23
|
+
toast({
|
|
24
|
+
title: `"${value}${value2 ?? ''}" foi copiado para a área de transferência.`,
|
|
25
|
+
variant: 'success',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className={cn('flex group', className)}>
|
|
32
|
+
<div
|
|
33
|
+
className={cn(
|
|
34
|
+
'flex flex-col text-sm w-full',
|
|
35
|
+
showCopyIcon ? 'p-1 rounded-md transition-colors group-hover:bg-sidebar-accent' : 'p-1',
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
<div className='relative'>
|
|
39
|
+
<div className='flex items-center text-sm font-medium gap-0.5'>
|
|
40
|
+
<label className='text-default truncate'>{title}</label>
|
|
41
|
+
{required && <div className='text-red-500 truncate'>*</div>}
|
|
42
|
+
</div>
|
|
43
|
+
<div className='grid flex-1 items-center pt-1'>
|
|
44
|
+
{isLoading ? <Skeleton className='h-5 w-full rounded-lg' /> : <div className='text-zinc-500 truncate'>{value}</div>}
|
|
45
|
+
</div>
|
|
46
|
+
{value2 && (
|
|
47
|
+
<div className='grid flex-1 items-center pt-1'>
|
|
48
|
+
{isLoading ? <Skeleton className='h-5 w-full rounded-lg' /> : <div className='text-zinc-500 truncate'>{value2}</div>}
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
<div
|
|
52
|
+
className={cn(
|
|
53
|
+
'pr-1 absolute top-1/2 right-0 -translate-y-1/2 opacity-0 transition-opacity',
|
|
54
|
+
showCopyIcon && 'group-hover:opacity-100',
|
|
55
|
+
)}
|
|
56
|
+
>
|
|
57
|
+
<TooltipProvider>
|
|
58
|
+
<Tooltip>
|
|
59
|
+
<TooltipTrigger asChild>
|
|
60
|
+
<Button
|
|
61
|
+
variant='ghost'
|
|
62
|
+
type='button'
|
|
63
|
+
className={cn('p-1 h-8', !showCopyIcon && 'cursor-default')}
|
|
64
|
+
onClick={handleCopy}
|
|
65
|
+
>
|
|
66
|
+
<Copy size={16} />
|
|
67
|
+
</Button>
|
|
68
|
+
</TooltipTrigger>
|
|
69
|
+
<TooltipContent>Copiar</TooltipContent>
|
|
70
|
+
</Tooltip>
|
|
71
|
+
</TooltipProvider>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default LabelWithTitle;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BarChart2 } from 'lucide-react';
|
|
2
|
+
import { Button } from '../button';
|
|
3
|
+
|
|
4
|
+
const NotFound = () => {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex flex-col items-center justify-center h-screen bg-[url('/imgs/404.png')] bg-cover bg-no-repeat bg-center">
|
|
7
|
+
<div className='flex flex-col items-center justify-center gap-8 w-[424px]'>
|
|
8
|
+
<div className='flex flex-col items-center w-full'>
|
|
9
|
+
<div className='text-5xl font-extrabold'>404</div>
|
|
10
|
+
<div className='text-3xl font-semibold'>Página Indisponível</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div className='flex text-center text-xl font-semibold text-zinc-500'>
|
|
13
|
+
A página que você está tentando acessar se encontra indisponível no momento, tente novamente mais tarde
|
|
14
|
+
</div>
|
|
15
|
+
<div className='flex justify-center w-full'>
|
|
16
|
+
<Button
|
|
17
|
+
onClick={() => {
|
|
18
|
+
window.location.href = '/';
|
|
19
|
+
}}
|
|
20
|
+
className='[&_svg]:size-5'
|
|
21
|
+
>
|
|
22
|
+
<BarChart2 />
|
|
23
|
+
Voltar Para Inicial
|
|
24
|
+
</Button>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
export default NotFound;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Check, ChevronsUpDown } from 'lucide-react';
|
|
2
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../../dropdown-menu';
|
|
3
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from '../../sidebar';
|
|
4
|
+
import SidebarItemTwoLines from './sidebar-item-two-lines';
|
|
5
|
+
import { Module } from './types/sidebar';
|
|
6
|
+
|
|
7
|
+
interface ModuleSwitcherProps {
|
|
8
|
+
modules: Module[];
|
|
9
|
+
activeModule: Module | undefined;
|
|
10
|
+
onModuleChange: (module: Module) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ModuleSwitcher = ({
|
|
14
|
+
modules,
|
|
15
|
+
activeModule,
|
|
16
|
+
onModuleChange,
|
|
17
|
+
}: ModuleSwitcherProps) => {
|
|
18
|
+
const { isMobile } = useSidebar();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<SidebarMenu>
|
|
22
|
+
<SidebarMenuItem>
|
|
23
|
+
<DropdownMenu>
|
|
24
|
+
<DropdownMenuTrigger asChild>
|
|
25
|
+
<SidebarMenuButton size='lg' className='data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground'>
|
|
26
|
+
<SidebarItemTwoLines
|
|
27
|
+
item={{
|
|
28
|
+
iconLeft: (
|
|
29
|
+
<div className='flex p-[7.6px] items-center rounded-md bg-background-primary'>{activeModule?.icon}</div>
|
|
30
|
+
),
|
|
31
|
+
title: activeModule?.title ?? '',
|
|
32
|
+
subTitle: activeModule?.subTitle ?? '',
|
|
33
|
+
iconRight: <ChevronsUpDown size={16} />,
|
|
34
|
+
}}
|
|
35
|
+
/>
|
|
36
|
+
</SidebarMenuButton>
|
|
37
|
+
</DropdownMenuTrigger>
|
|
38
|
+
<DropdownMenuContent className='w-[250px] rounded-lg' align='start' side={isMobile ? 'bottom' : 'right'} sideOffset={4}>
|
|
39
|
+
{modules.map((module) => (
|
|
40
|
+
<DropdownMenuItem key={`module-switcher-${module.value}`} onClick={() => onModuleChange?.(module)} className='gap-2 p-2'>
|
|
41
|
+
<SidebarItemTwoLines
|
|
42
|
+
item={{
|
|
43
|
+
iconLeft: <div className='flex p-[7.6px] items-center rounded-md bg-background-primary'>{module.icon}</div>,
|
|
44
|
+
title: module.title,
|
|
45
|
+
subTitle: module.subTitle,
|
|
46
|
+
iconRight: activeModule?.value === module.value ? <Check size={16} /> : null,
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
</DropdownMenuItem>
|
|
50
|
+
))}
|
|
51
|
+
</DropdownMenuContent>
|
|
52
|
+
</DropdownMenu>
|
|
53
|
+
</SidebarMenuItem>
|
|
54
|
+
</SidebarMenu>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default ModuleSwitcher;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useLocation, useNavigate } from 'react-router-dom';
|
|
2
|
+
import { SidebarGroup, SidebarGroupContent, SidebarMenu } from '../../sidebar';
|
|
3
|
+
import SidebarItem from './sidebar-item';
|
|
4
|
+
import { SidebarPage } from './types/sidebar';
|
|
5
|
+
|
|
6
|
+
interface NavFooterProps {
|
|
7
|
+
pages: SidebarPage[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const NavFooter = ({pages}: NavFooterProps) => {
|
|
11
|
+
const navigate = useNavigate();
|
|
12
|
+
const location = useLocation();
|
|
13
|
+
const selectedRoutePath = location.pathname;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<SidebarGroup className='p-0'>
|
|
17
|
+
<SidebarGroupContent>
|
|
18
|
+
<SidebarMenu>
|
|
19
|
+
{pages.map((item) => {
|
|
20
|
+
return (
|
|
21
|
+
<SidebarItem
|
|
22
|
+
key={`sidebar-menu-main-${item.path}`}
|
|
23
|
+
item={item}
|
|
24
|
+
selectedRoute={selectedRoutePath}
|
|
25
|
+
onClick={() => navigate(item.path)}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
})}
|
|
29
|
+
</SidebarMenu>
|
|
30
|
+
</SidebarGroupContent>
|
|
31
|
+
</SidebarGroup>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default NavFooter;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useIsMobile } from '@/hooks/use-mobile';
|
|
2
|
+
import { useLocation, useNavigate } from 'react-router-dom';
|
|
3
|
+
import { SidebarGroup, SidebarGroupContent, SidebarMenu } from '../../sidebar';
|
|
4
|
+
import NavSubmenuCollapsible from './nav-submenu-collapsible';
|
|
5
|
+
import NavSubmenuDropdown from './nav-submenu-dropdown';
|
|
6
|
+
import SidebarItem from './sidebar-item';
|
|
7
|
+
import { SidebarPage, SidebarSubmenuType } from './types/sidebar';
|
|
8
|
+
|
|
9
|
+
interface NavMainProps {
|
|
10
|
+
pages: SidebarPage[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const NavMain = ({pages}: NavMainProps) => {
|
|
14
|
+
const navigate = useNavigate();
|
|
15
|
+
const location = useLocation();
|
|
16
|
+
const isMobile = useIsMobile();
|
|
17
|
+
const selectedRoutePath = location.pathname;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<SidebarGroup>
|
|
21
|
+
<SidebarGroupContent>
|
|
22
|
+
<SidebarMenu>
|
|
23
|
+
{pages.map((item) => {
|
|
24
|
+
if (item.subMenuType) {
|
|
25
|
+
if (item.subMenuType === SidebarSubmenuType.COLLAPSIBLE || isMobile) {
|
|
26
|
+
return (
|
|
27
|
+
<NavSubmenuCollapsible
|
|
28
|
+
key={`sidebar-submenu-collapsible-${item.path}`}
|
|
29
|
+
item={item}
|
|
30
|
+
selectedRoute={selectedRoutePath}
|
|
31
|
+
onClick={(path) => navigate(path)}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Deprecated: Use COLLAPSIBLE instead
|
|
37
|
+
if (item.subMenuType === SidebarSubmenuType.DROPDOWN) {
|
|
38
|
+
return (
|
|
39
|
+
<NavSubmenuDropdown
|
|
40
|
+
key={`sidebar-submenu-dropdown-${item.path}`}
|
|
41
|
+
item={item}
|
|
42
|
+
selectedRoute={selectedRoutePath}
|
|
43
|
+
onClick={(path) => navigate(path)}
|
|
44
|
+
cols={3}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return (
|
|
50
|
+
<SidebarItem
|
|
51
|
+
key={`sidebar-menu-main-${item.path}`}
|
|
52
|
+
item={item}
|
|
53
|
+
selectedRoute={selectedRoutePath}
|
|
54
|
+
onClick={() => navigate(item.path)}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
})}
|
|
58
|
+
</SidebarMenu>
|
|
59
|
+
</SidebarGroupContent>
|
|
60
|
+
</SidebarGroup>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default NavMain;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ChevronRight } from 'lucide-react';
|
|
2
|
+
import { cn } from '../../../../lib/utils';
|
|
3
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../collapsible';
|
|
4
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, useSidebar } from '../../sidebar';
|
|
5
|
+
import { SidebarPage } from './types/sidebar';
|
|
6
|
+
|
|
7
|
+
interface NavSubmenuCollapsibleProps {
|
|
8
|
+
item: SidebarPage;
|
|
9
|
+
selectedRoute: string | null;
|
|
10
|
+
onClick: (path: string) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const NavSubmenuCollapsible = ({ item, selectedRoute, onClick }: NavSubmenuCollapsibleProps) => {
|
|
14
|
+
const { open, toggleSidebar } = useSidebar();
|
|
15
|
+
|
|
16
|
+
const isOpen = (): boolean => {
|
|
17
|
+
return selectedRoute?.includes(item.path) ?? false;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const handleToggleSidebar = () => {
|
|
21
|
+
if (!open) toggleSidebar();
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<SidebarMenu>
|
|
26
|
+
<Collapsible key={item.title} asChild defaultOpen={isOpen()}>
|
|
27
|
+
<SidebarMenuItem>
|
|
28
|
+
<CollapsibleTrigger asChild className='group/collapsible'>
|
|
29
|
+
<SidebarMenuButton tooltip={item.title} className='px-2 py-5 gap-3' onClick={() => handleToggleSidebar()}>
|
|
30
|
+
{item.icon}
|
|
31
|
+
<span>{item.title}</span>
|
|
32
|
+
<ChevronRight className='ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90' />
|
|
33
|
+
</SidebarMenuButton>
|
|
34
|
+
</CollapsibleTrigger>
|
|
35
|
+
<CollapsibleContent>
|
|
36
|
+
<SidebarMenuSub>
|
|
37
|
+
{item.subMenuItems
|
|
38
|
+
?.map((subItem) => (
|
|
39
|
+
<SidebarMenuSubItem key={subItem.label}>
|
|
40
|
+
<SidebarMenuSubButton asChild onClick={() => onClick(subItem.path)} aria-disabled={subItem.disabled}>
|
|
41
|
+
<div
|
|
42
|
+
className={cn(
|
|
43
|
+
'cursor-pointer px-2 py-1 items-center self-stretch',
|
|
44
|
+
selectedRoute === subItem.path ? 'bg-sidebar-accent' : '',
|
|
45
|
+
)}
|
|
46
|
+
>
|
|
47
|
+
<span>{subItem.label}</span>
|
|
48
|
+
</div>
|
|
49
|
+
</SidebarMenuSubButton>
|
|
50
|
+
</SidebarMenuSubItem>
|
|
51
|
+
))}
|
|
52
|
+
</SidebarMenuSub>
|
|
53
|
+
</CollapsibleContent>
|
|
54
|
+
</SidebarMenuItem>
|
|
55
|
+
</Collapsible>
|
|
56
|
+
</SidebarMenu>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default NavSubmenuCollapsible;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ChevronRight } from 'lucide-react';
|
|
2
|
+
import { cn } from '../../../../lib/utils';
|
|
3
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../../dropdown-menu';
|
|
4
|
+
import { SidebarMenuButton, SidebarMenuItem } from '../../sidebar';
|
|
5
|
+
import { SidebarPage } from './types/sidebar';
|
|
6
|
+
|
|
7
|
+
interface NavSubmenuDropdownProps {
|
|
8
|
+
cols?: number;
|
|
9
|
+
item: SidebarPage;
|
|
10
|
+
selectedRoute: string | null;
|
|
11
|
+
onClick: (path: string) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const NavSubmenuDropdown = ({ cols, item, selectedRoute, onClick }: NavSubmenuDropdownProps) => {
|
|
15
|
+
return (
|
|
16
|
+
<SidebarMenuItem>
|
|
17
|
+
<DropdownMenu>
|
|
18
|
+
<DropdownMenuTrigger asChild>
|
|
19
|
+
<SidebarMenuButton
|
|
20
|
+
asChild
|
|
21
|
+
className={cn(
|
|
22
|
+
'data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground hover:bg-sidebar-accent px-2 py-5 gap-3 cursor-pointer',
|
|
23
|
+
selectedRoute?.includes(item.path) ? 'bg-sidebar-accent' : '',
|
|
24
|
+
)}
|
|
25
|
+
tooltip={item.title}
|
|
26
|
+
>
|
|
27
|
+
<div>
|
|
28
|
+
{item.icon}
|
|
29
|
+
<span>{item.title}</span>
|
|
30
|
+
{<ChevronRight className='ml-auto' />}
|
|
31
|
+
</div>
|
|
32
|
+
</SidebarMenuButton>
|
|
33
|
+
</DropdownMenuTrigger>
|
|
34
|
+
<DropdownMenuContent className={`grid grid-cols-${cols ?? '1'} gap-4 p-4`} align='start' side='right' sideOffset={4}>
|
|
35
|
+
{item.subMenuItems
|
|
36
|
+
?.map((subItem, index) => (
|
|
37
|
+
<DropdownMenuItem
|
|
38
|
+
key={`${index}`}
|
|
39
|
+
className={cn(
|
|
40
|
+
'flex flex-col items-start text-left max-w-[220px] gap-1 cursor-pointer',
|
|
41
|
+
selectedRoute === subItem.path ? 'bg-sidebar-accent' : '',
|
|
42
|
+
)}
|
|
43
|
+
onClick={() => onClick(subItem.path)}
|
|
44
|
+
disabled={subItem.disabled}
|
|
45
|
+
>
|
|
46
|
+
<div className='text-sm font-semibold'>{subItem.label}</div>
|
|
47
|
+
<div className='text-sm text-muted-foreground'>{subItem.description}</div>
|
|
48
|
+
</DropdownMenuItem>
|
|
49
|
+
))}
|
|
50
|
+
</DropdownMenuContent>
|
|
51
|
+
</DropdownMenu>
|
|
52
|
+
</SidebarMenuItem>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default NavSubmenuDropdown;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { LoaderCircle, LogOut } from 'lucide-react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Avatar, AvatarFallback, AvatarImage } from '../../avatar';
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from '../../dropdown-menu';
|
|
5
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from '../../sidebar';
|
|
6
|
+
import SidebarItemTwoLines from './sidebar-item-two-lines';
|
|
7
|
+
|
|
8
|
+
interface NavUserProps {
|
|
9
|
+
userName: string;
|
|
10
|
+
userEmail: string;
|
|
11
|
+
userInitials: string;
|
|
12
|
+
callbackLogout: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const NavUser = ({userName, userEmail, userInitials, callbackLogout}: NavUserProps) => {
|
|
16
|
+
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
|
17
|
+
const { isMobile } = useSidebar();
|
|
18
|
+
|
|
19
|
+
const handleLogout = () => {
|
|
20
|
+
setIsLoggingOut(true);
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
callbackLogout();
|
|
23
|
+
}, 1000);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<SidebarMenu>
|
|
28
|
+
<SidebarMenuItem>
|
|
29
|
+
<DropdownMenu>
|
|
30
|
+
<DropdownMenuTrigger asChild>
|
|
31
|
+
<SidebarMenuButton size='lg' className='data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground'>
|
|
32
|
+
<SidebarItemTwoLines
|
|
33
|
+
item={{
|
|
34
|
+
iconLeft: (
|
|
35
|
+
<Avatar className='h-[31px] w-[31px] rounded-md'>
|
|
36
|
+
<AvatarImage src={userInitials} alt={userName} />
|
|
37
|
+
<AvatarFallback className='rounded-md bg-background-primary text-white'>{userInitials}</AvatarFallback>
|
|
38
|
+
</Avatar>
|
|
39
|
+
),
|
|
40
|
+
title: isLoggingOut ? 'Saindo...' : userName,
|
|
41
|
+
subTitle: isLoggingOut ? '' : userEmail,
|
|
42
|
+
iconRight: isLoggingOut ? (
|
|
43
|
+
<LoaderCircle size={16} className='text-sidebar-foreground animate-spin mr-2' />
|
|
44
|
+
) : (
|
|
45
|
+
<LogOut size={16} className='text-sidebar-foreground' />
|
|
46
|
+
),
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
</SidebarMenuButton>
|
|
50
|
+
</DropdownMenuTrigger>
|
|
51
|
+
<DropdownMenuContent className='w-[250px] rounded-lg' side={isMobile ? 'bottom' : 'right'} align='end' sideOffset={4}>
|
|
52
|
+
<DropdownMenuLabel className='p-0 font-normal'>
|
|
53
|
+
<div className='flex items-center gap-2 px-1 py-1.5 text-left text-sm'>
|
|
54
|
+
<Avatar className='h-8 w-8 rounded-lg'>
|
|
55
|
+
<AvatarImage src={userInitials} alt={userName} />
|
|
56
|
+
<AvatarFallback className='rounded-lg bg-background-primary text-white'>{userInitials}</AvatarFallback>
|
|
57
|
+
</Avatar>
|
|
58
|
+
<div className='grid flex-1 text-left text-sm leading-tight'>
|
|
59
|
+
<span className='truncate font-semibold'>{userName}</span>
|
|
60
|
+
<span className='truncate text-xs'>{userEmail}</span>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</DropdownMenuLabel>
|
|
64
|
+
<DropdownMenuItem className='p-0 font-normal cursor-pointer' onClick={() => handleLogout()}>
|
|
65
|
+
<div className='flex items-center gap-2 px-1 py-1.5 text-left text-sm'>
|
|
66
|
+
<div className='flex w-8 h-8 p-2 items-center rounded-md'>{<LogOut size={16} />}</div>
|
|
67
|
+
Log out
|
|
68
|
+
</div>
|
|
69
|
+
</DropdownMenuItem>
|
|
70
|
+
</DropdownMenuContent>
|
|
71
|
+
</DropdownMenu>
|
|
72
|
+
</SidebarMenuItem>
|
|
73
|
+
</SidebarMenu>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default NavUser;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cn } from '../../../../lib/utils';
|
|
2
|
+
import { SidebarMenuButton } from '../../sidebar';
|
|
3
|
+
import { Module, SidebarPage } from './types/sidebar';
|
|
4
|
+
|
|
5
|
+
interface SidebarItemProps {
|
|
6
|
+
item: SidebarPage;
|
|
7
|
+
selectedRoute: string | null;
|
|
8
|
+
onClick?: (module: Module | null, path: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const SidebarButton = ({ item, selectedRoute, onClick }: SidebarItemProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<SidebarMenuButton
|
|
14
|
+
asChild
|
|
15
|
+
className={cn(
|
|
16
|
+
'data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground hover:bg-sidebar-accent px-2 py-5 gap-3 cursor-pointer',
|
|
17
|
+
selectedRoute?.includes(item.path) ? 'bg-sidebar-accent' : '',
|
|
18
|
+
)}
|
|
19
|
+
tooltip={item.title}
|
|
20
|
+
onClick={() => onClick?.(item.module ?? null, item.path)}
|
|
21
|
+
>
|
|
22
|
+
<div>
|
|
23
|
+
<div className='[&_svg]:size-4 text-sidebar-foreground'>{item.icon}</div>
|
|
24
|
+
<span>{item.title}</span>
|
|
25
|
+
</div>
|
|
26
|
+
</SidebarMenuButton>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default SidebarButton;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface SidebarItemTwoLinesProps {
|
|
4
|
+
item: {
|
|
5
|
+
iconLeft: React.ReactNode;
|
|
6
|
+
title: string;
|
|
7
|
+
subTitle: string;
|
|
8
|
+
iconRight?: React.ReactNode | null;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const SidebarItemTwoLines = ({ item }: SidebarItemTwoLinesProps) => {
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<div className='[&_svg]:size-4 text-white'>{item.iconLeft}</div>
|
|
16
|
+
<div className='grid flex-1 text-left text-sm leading-tight'>
|
|
17
|
+
<span className='truncate font-semibold'>{item.title}</span>
|
|
18
|
+
<span className='truncate text-xs text-foreground'>{item.subTitle}</span>
|
|
19
|
+
</div>
|
|
20
|
+
{item.iconRight}
|
|
21
|
+
</>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default SidebarItemTwoLines;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SidebarMenuItem } from '../../sidebar';
|
|
2
|
+
import SidebarButton from './sidebar-button';
|
|
3
|
+
import { Module, SidebarPage } from './types/sidebar';
|
|
4
|
+
|
|
5
|
+
interface SidebarItemProps {
|
|
6
|
+
item: SidebarPage;
|
|
7
|
+
selectedRoute: string | null;
|
|
8
|
+
onClick?: (module: Module | null, path: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const SidebarItem = ({ item, selectedRoute, onClick }: SidebarItemProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<SidebarMenuItem>
|
|
14
|
+
<SidebarButton item={item} selectedRoute={selectedRoute} onClick={onClick} />
|
|
15
|
+
</SidebarMenuItem>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default SidebarItem;
|