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,79 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { ControllerRenderProps, FieldValues, FormState } from 'react-hook-form';
|
|
3
|
+
import * as FormComponents from '../../form';
|
|
4
|
+
import { MaskInputFone } from '../../input';
|
|
5
|
+
import { formHelpText } from './form-help-text';
|
|
6
|
+
import { formLabelAndSubLabel } from './form-label';
|
|
7
|
+
import { formMessage } from './form-message';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
control: any;
|
|
11
|
+
name: string;
|
|
12
|
+
label: string;
|
|
13
|
+
subLabel?: string;
|
|
14
|
+
helpText?: JSX.Element;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
20
|
+
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const masks = ['(99) 9999-99999', '(99) 9 9999-9999'];
|
|
24
|
+
|
|
25
|
+
export const FormInputPhone: React.FC<Props> = ({
|
|
26
|
+
control,
|
|
27
|
+
name,
|
|
28
|
+
label,
|
|
29
|
+
subLabel,
|
|
30
|
+
helpText,
|
|
31
|
+
placeholder,
|
|
32
|
+
className,
|
|
33
|
+
disabled,
|
|
34
|
+
required,
|
|
35
|
+
onChange,
|
|
36
|
+
onKeyUp,
|
|
37
|
+
}) => {
|
|
38
|
+
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
39
|
+
const [mask, setMask] = useState(masks[0]);
|
|
40
|
+
|
|
41
|
+
const getMask = (val: string) => (val.replace(/\D/g, '').length > 10 ? masks[1] : masks[0]);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<FormField
|
|
45
|
+
control={control}
|
|
46
|
+
name={name}
|
|
47
|
+
render={({ field, formState }: { field: ControllerRenderProps<FieldValues, string>; formState: FormState<FieldValues> }) => {
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
setMask(getMask(field.value || ''));
|
|
50
|
+
}, [field.value]);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<FormItem className={className}>
|
|
54
|
+
<div className='flex items-center space-x-1.5'>
|
|
55
|
+
{label && formLabelAndSubLabel(FormLabel, label, subLabel, required)}
|
|
56
|
+
{helpText && formHelpText(helpText)}
|
|
57
|
+
</div>
|
|
58
|
+
<FormControl>
|
|
59
|
+
<MaskInputFone
|
|
60
|
+
{...field}
|
|
61
|
+
className={className}
|
|
62
|
+
placeholder={placeholder ?? '(00) 0 0000-0000'}
|
|
63
|
+
disabled={disabled || formState.isSubmitting}
|
|
64
|
+
mask={mask}
|
|
65
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
66
|
+
onChange?.(e);
|
|
67
|
+
field.onChange(e);
|
|
68
|
+
setMask(getMask(e.target.value));
|
|
69
|
+
}}
|
|
70
|
+
onKeyUp={(e: React.KeyboardEvent<HTMLInputElement>) => onKeyUp?.(e)}
|
|
71
|
+
/>
|
|
72
|
+
</FormControl>
|
|
73
|
+
{formMessage(FormMessage)}
|
|
74
|
+
</FormItem>
|
|
75
|
+
);
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ControllerRenderProps, FieldValues, FormState } from 'react-hook-form';
|
|
2
|
+
import { cn } from '../../../../lib/utils';
|
|
3
|
+
import * as FormComponents from '../../form';
|
|
4
|
+
import { Label } from '../../label';
|
|
5
|
+
import { RadioGroup, RadioGroupItem } from '../../radio-group';
|
|
6
|
+
import { formHelpText } from './form-help-text';
|
|
7
|
+
import { formLabelAndSubLabel } from './form-label';
|
|
8
|
+
import { formMessage } from './form-message';
|
|
9
|
+
|
|
10
|
+
export interface RadioOption {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface Props {
|
|
17
|
+
control: any;
|
|
18
|
+
name: string;
|
|
19
|
+
value?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
subLabel?: string;
|
|
22
|
+
helpText?: JSX.Element;
|
|
23
|
+
className?: string;
|
|
24
|
+
classNameOptions?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
options?: RadioOption[];
|
|
28
|
+
onChange?: (value: string) => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const FormRadioGroup: React.FC<Props> = ({
|
|
32
|
+
control,
|
|
33
|
+
name,
|
|
34
|
+
value,
|
|
35
|
+
label,
|
|
36
|
+
subLabel,
|
|
37
|
+
helpText,
|
|
38
|
+
className,
|
|
39
|
+
classNameOptions,
|
|
40
|
+
disabled,
|
|
41
|
+
required,
|
|
42
|
+
options,
|
|
43
|
+
onChange,
|
|
44
|
+
}) => {
|
|
45
|
+
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
46
|
+
return (
|
|
47
|
+
<FormField
|
|
48
|
+
control={control}
|
|
49
|
+
name={name}
|
|
50
|
+
key={value}
|
|
51
|
+
render={({ field, formState }: { field: ControllerRenderProps<FieldValues, string>; formState: FormState<FieldValues> }) => (
|
|
52
|
+
<FormItem>
|
|
53
|
+
<div className={cn('flex items-center space-x-1.5 mb-2', className)}>
|
|
54
|
+
{label && formLabelAndSubLabel(FormLabel, label, subLabel, required)}
|
|
55
|
+
{helpText && formHelpText(helpText)}
|
|
56
|
+
</div>
|
|
57
|
+
<FormControl>
|
|
58
|
+
<RadioGroup
|
|
59
|
+
onValueChange={(value: string) => {
|
|
60
|
+
field?.onChange?.(value);
|
|
61
|
+
onChange?.(value);
|
|
62
|
+
}}
|
|
63
|
+
defaultValue={field.value}
|
|
64
|
+
disabled={disabled || formState.isSubmitting}
|
|
65
|
+
className={`${className}`}
|
|
66
|
+
>
|
|
67
|
+
<div className={cn('flex flex-grow gap-6', classNameOptions)}>
|
|
68
|
+
{options?.map((option, index) => (
|
|
69
|
+
<div className='flex flex-col' key={`radio-${name}-${index}`}>
|
|
70
|
+
<div className='flex items-center space-x-2' key={`radio-${name}-${index}`}>
|
|
71
|
+
<RadioGroupItem
|
|
72
|
+
value={option.value}
|
|
73
|
+
id={`r${option.value}`}
|
|
74
|
+
checked={field.value === option.value}
|
|
75
|
+
disabled={option.disabled}
|
|
76
|
+
/>
|
|
77
|
+
<Label htmlFor={`r${option.value}`} className={option.disabled ? 'opacity-50' : ''}>
|
|
78
|
+
{option.label}
|
|
79
|
+
</Label>
|
|
80
|
+
</div>
|
|
81
|
+
{option.description && (
|
|
82
|
+
<div className={cn('pl-6 text-zinc-500', { 'opacity-50': option.disabled })}>{option.description}</div>
|
|
83
|
+
)}
|
|
84
|
+
</div>
|
|
85
|
+
))}
|
|
86
|
+
</div>
|
|
87
|
+
</RadioGroup>
|
|
88
|
+
</FormControl>
|
|
89
|
+
{formMessage(FormMessage)}
|
|
90
|
+
</FormItem>
|
|
91
|
+
)}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Select } from '@radix-ui/react-select';
|
|
2
|
+
import { cn } from '../../../../lib/utils';
|
|
3
|
+
import * as FormComponents from '../../form';
|
|
4
|
+
import { SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '../../select';
|
|
5
|
+
import { formHelpText } from './form-help-text';
|
|
6
|
+
import { formLabelAndSubLabel } from './form-label';
|
|
7
|
+
import { formMessage } from './form-message';
|
|
8
|
+
|
|
9
|
+
export interface SelectOption {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
default?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface Props {
|
|
16
|
+
control: any;
|
|
17
|
+
name: string;
|
|
18
|
+
label: string;
|
|
19
|
+
subLabel?: string;
|
|
20
|
+
helpText?: JSX.Element;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
options: SelectOption[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const FormSelect: React.FC<Props> = ({ control, name, label, subLabel, helpText, placeholder, className, disabled, required, options }) => {
|
|
29
|
+
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<FormField
|
|
33
|
+
control={control}
|
|
34
|
+
name={name}
|
|
35
|
+
render={({ field, formState }) => (
|
|
36
|
+
<FormItem className={className}>
|
|
37
|
+
<div className='flex items-center space-x-1.5'>
|
|
38
|
+
{label && formLabelAndSubLabel(FormLabel, label, subLabel, required)}
|
|
39
|
+
{helpText && formHelpText(helpText)}
|
|
40
|
+
</div>
|
|
41
|
+
<FormControl>
|
|
42
|
+
<Select onValueChange={field.onChange} defaultValue={field.value} disabled={disabled}>
|
|
43
|
+
<SelectTrigger className={cn('', formState.errors[name] ? 'border-red-600' : '', className)}>
|
|
44
|
+
<SelectValue className='text-slate-400' placeholder={placeholder} />
|
|
45
|
+
</SelectTrigger>
|
|
46
|
+
<SelectContent className='bg-white cursor-pointer'>
|
|
47
|
+
<SelectGroup>
|
|
48
|
+
{options.map((option) => (
|
|
49
|
+
<SelectItem key={option.value} value={option.value}>
|
|
50
|
+
{option.label}
|
|
51
|
+
</SelectItem>
|
|
52
|
+
))}
|
|
53
|
+
</SelectGroup>
|
|
54
|
+
</SelectContent>
|
|
55
|
+
</Select>
|
|
56
|
+
</FormControl>
|
|
57
|
+
{formMessage(FormMessage)}
|
|
58
|
+
</FormItem>
|
|
59
|
+
)}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Check } from 'lucide-react';
|
|
2
|
+
import { Separator } from '../../separator';
|
|
3
|
+
|
|
4
|
+
interface PropsStepNewForm {
|
|
5
|
+
steps: { id: string; label: string }[];
|
|
6
|
+
currentIndex: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const StepNewForm = ({ steps, currentIndex }: PropsStepNewForm) => {
|
|
10
|
+
const getStepIcon = (index: number) => {
|
|
11
|
+
if (index < currentIndex) {
|
|
12
|
+
return (
|
|
13
|
+
<div className='flex w-6 h-6 rounded-md items-center justify-center bg-background-secondary border'>
|
|
14
|
+
<Check size={16} className='stroke-2 stroke-primary' />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
className={`flex w-6 h-6 rounded-md items-center justify-center border ${
|
|
22
|
+
index === currentIndex ? 'bg-background-primary text-white' : 'bg-white text-black'
|
|
23
|
+
}`}
|
|
24
|
+
>
|
|
25
|
+
{index + 1}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className='flex flex-row gap-x-3 my-2.5'>
|
|
32
|
+
{steps.map((step, index, array) => (
|
|
33
|
+
<div className='flex items-center text-sm font-medium gap-x-3' key={step.id}>
|
|
34
|
+
<div className='flex items-center text-sm font-medium gap-x-3'>
|
|
35
|
+
{getStepIcon(index)}
|
|
36
|
+
{step.label}
|
|
37
|
+
</div>
|
|
38
|
+
{index + 1 < array.length && (
|
|
39
|
+
<div className='w-10'>
|
|
40
|
+
<Separator />
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
</div>
|
|
44
|
+
))}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default StepNewForm;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ControllerRenderProps, FieldValues } from 'react-hook-form';
|
|
2
|
+
import { cn } from '../../../../lib/utils';
|
|
3
|
+
import * as FormComponents from '../../form';
|
|
4
|
+
import { Switch } from '../../switch';
|
|
5
|
+
import { formHelpText } from './form-help-text';
|
|
6
|
+
import { formLabelAndSubLabel } from './form-label';
|
|
7
|
+
import { formMessage } from './form-message';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
control: any;
|
|
11
|
+
name: string;
|
|
12
|
+
label: string;
|
|
13
|
+
subLabel?: string;
|
|
14
|
+
helpText?: JSX.Element;
|
|
15
|
+
className?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const FormInputSwitch: React.FC<Props> = ({ control, name, label, subLabel, helpText, className, disabled, onCheckedChange }) => {
|
|
21
|
+
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<FormField
|
|
25
|
+
control={control}
|
|
26
|
+
name={name}
|
|
27
|
+
render={({ field }: { field: ControllerRenderProps<FieldValues, string> }) => (
|
|
28
|
+
<FormItem className={cn('flex items-top gap-x-2', className)}>
|
|
29
|
+
<FormControl>
|
|
30
|
+
<Switch
|
|
31
|
+
{...field}
|
|
32
|
+
checked={field.value}
|
|
33
|
+
onCheckedChange={(checked: boolean) => {
|
|
34
|
+
field.onChange(checked);
|
|
35
|
+
if (onCheckedChange) {
|
|
36
|
+
onCheckedChange(checked);
|
|
37
|
+
}
|
|
38
|
+
}}
|
|
39
|
+
disabled={disabled}
|
|
40
|
+
/>
|
|
41
|
+
</FormControl>
|
|
42
|
+
<div className='flex h-full items-center space-x-1.5'>
|
|
43
|
+
{label && formLabelAndSubLabel(FormLabel, label, subLabel, false, 'pb-0')}
|
|
44
|
+
{helpText && formHelpText(helpText)}
|
|
45
|
+
</div>
|
|
46
|
+
{formMessage(FormMessage)}
|
|
47
|
+
</FormItem>
|
|
48
|
+
)}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ControllerRenderProps, FieldValues, FormState } from 'react-hook-form';
|
|
2
|
+
import * as FormComponents from '../../form';
|
|
3
|
+
import { InputText } from '../../input';
|
|
4
|
+
import { formHelpText } from './form-help-text';
|
|
5
|
+
import { formLabelAndSubLabel } from './form-label';
|
|
6
|
+
import { formMessage } from './form-message';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
control: any;
|
|
10
|
+
name: string;
|
|
11
|
+
label: string;
|
|
12
|
+
subLabel?: string;
|
|
13
|
+
helpText?: JSX.Element;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
maxLength?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
20
|
+
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
21
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const FormInputText: React.FC<Props> = ({
|
|
25
|
+
control,
|
|
26
|
+
name,
|
|
27
|
+
label,
|
|
28
|
+
subLabel,
|
|
29
|
+
helpText,
|
|
30
|
+
placeholder,
|
|
31
|
+
maxLength,
|
|
32
|
+
className,
|
|
33
|
+
disabled,
|
|
34
|
+
required,
|
|
35
|
+
inputRef,
|
|
36
|
+
onKeyUp,
|
|
37
|
+
onChange,
|
|
38
|
+
}) => {
|
|
39
|
+
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<FormField
|
|
43
|
+
control={control}
|
|
44
|
+
name={name}
|
|
45
|
+
render={({ field, formState }: { field: ControllerRenderProps<FieldValues, string>; formState: FormState<FieldValues> }) => (
|
|
46
|
+
<FormItem className={className}>
|
|
47
|
+
<div className='flex items-center space-x-1.5'>
|
|
48
|
+
{label && formLabelAndSubLabel(FormLabel, label, subLabel, required)}
|
|
49
|
+
{helpText && formHelpText(helpText)}
|
|
50
|
+
</div>
|
|
51
|
+
<FormControl>
|
|
52
|
+
<InputText
|
|
53
|
+
{...field}
|
|
54
|
+
maxLength={maxLength}
|
|
55
|
+
placeholder={placeholder}
|
|
56
|
+
disabled={disabled || formState.isSubmitting}
|
|
57
|
+
value={field.value || ''}
|
|
58
|
+
onKeyUp={(e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
59
|
+
if (onKeyUp) {
|
|
60
|
+
onKeyUp(e);
|
|
61
|
+
}
|
|
62
|
+
}}
|
|
63
|
+
ref={inputRef}
|
|
64
|
+
/>
|
|
65
|
+
</FormControl>
|
|
66
|
+
{formMessage(FormMessage)}
|
|
67
|
+
</FormItem>
|
|
68
|
+
)}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ControllerRenderProps, FieldValues, FormState } from 'react-hook-form';
|
|
2
|
+
import * as FormComponents from '../../form';
|
|
3
|
+
import { Textarea } from '../../textarea';
|
|
4
|
+
import { formHelpText } from './form-help-text';
|
|
5
|
+
import { formLabelAndSubLabel } from './form-label';
|
|
6
|
+
import { formMessage } from './form-message';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
control: any;
|
|
10
|
+
name: string;
|
|
11
|
+
label: string;
|
|
12
|
+
subLabel?: string;
|
|
13
|
+
helpText?: JSX.Element;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
19
|
+
onKeyUp?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const FormTextarea: React.FC<Props> = ({
|
|
23
|
+
control,
|
|
24
|
+
name,
|
|
25
|
+
label,
|
|
26
|
+
subLabel,
|
|
27
|
+
helpText,
|
|
28
|
+
placeholder,
|
|
29
|
+
className,
|
|
30
|
+
disabled,
|
|
31
|
+
required,
|
|
32
|
+
onChange,
|
|
33
|
+
onKeyUp,
|
|
34
|
+
}) => {
|
|
35
|
+
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<FormField
|
|
39
|
+
control={control}
|
|
40
|
+
name={name}
|
|
41
|
+
render={({ field, formState }: { field: ControllerRenderProps<FieldValues, string>; formState: FormState<FieldValues> }) => (
|
|
42
|
+
<FormItem className={className}>
|
|
43
|
+
<div className='flex items-center space-x-1.5'>
|
|
44
|
+
{label && formLabelAndSubLabel(FormLabel, label, subLabel, required)}
|
|
45
|
+
{helpText && formHelpText(helpText)}
|
|
46
|
+
</div>
|
|
47
|
+
<FormControl>
|
|
48
|
+
<Textarea
|
|
49
|
+
{...field}
|
|
50
|
+
className='resize-none outline-none focus:outline-none'
|
|
51
|
+
placeholder={placeholder}
|
|
52
|
+
disabled={disabled || formState.isSubmitting}
|
|
53
|
+
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
54
|
+
field.onChange(e);
|
|
55
|
+
if (onChange) {
|
|
56
|
+
onChange(e);
|
|
57
|
+
}
|
|
58
|
+
}}
|
|
59
|
+
onKeyUp={(e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
|
60
|
+
if (onKeyUp) {
|
|
61
|
+
onKeyUp(e);
|
|
62
|
+
}
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
65
|
+
</FormControl>
|
|
66
|
+
{formMessage(FormMessage)}
|
|
67
|
+
</FormItem>
|
|
68
|
+
)}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export type RGB = { r: number; g: number; b: number };
|
|
2
|
+
type HSL = { h: number; s: number; l: number };
|
|
3
|
+
|
|
4
|
+
export const rgbToHex = ({ r, g, b }: RGB): string => {
|
|
5
|
+
const toHex = (n: number) => Math.max(0, Math.min(255, n)).toString(16).padStart(2, '0').toUpperCase();
|
|
6
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const hexToRgb = (hex: string): RGB | null => {
|
|
10
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
11
|
+
return result
|
|
12
|
+
? {
|
|
13
|
+
r: Number.parseInt(result[1], 16),
|
|
14
|
+
g: Number.parseInt(result[2], 16),
|
|
15
|
+
b: Number.parseInt(result[3], 16),
|
|
16
|
+
}
|
|
17
|
+
: null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const rgbToHsl = ({ r, g, b }: RGB): HSL => {
|
|
21
|
+
r /= 255;
|
|
22
|
+
g /= 255;
|
|
23
|
+
b /= 255;
|
|
24
|
+
|
|
25
|
+
const max = Math.max(r, g, b);
|
|
26
|
+
const min = Math.min(r, g, b);
|
|
27
|
+
let h = 0;
|
|
28
|
+
let s = 0;
|
|
29
|
+
const l = (max + min) / 2;
|
|
30
|
+
|
|
31
|
+
if (max !== min) {
|
|
32
|
+
const d = max - min;
|
|
33
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
34
|
+
|
|
35
|
+
switch (max) {
|
|
36
|
+
case r:
|
|
37
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
38
|
+
break;
|
|
39
|
+
case g:
|
|
40
|
+
h = (b - r) / d + 2;
|
|
41
|
+
break;
|
|
42
|
+
case b:
|
|
43
|
+
h = (r - g) / d + 4;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
h /= 6;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
h: Math.round(h * 360),
|
|
52
|
+
s: Math.round(s * 100),
|
|
53
|
+
l: Math.round(l * 100),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const hue2rgb = (p: number, q: number, t: number) => {
|
|
58
|
+
let tempT = t;
|
|
59
|
+
if (tempT < 0) tempT += 1;
|
|
60
|
+
if (tempT > 1) tempT -= 1;
|
|
61
|
+
if (tempT < 1 / 6) return p + (q - p) * 6 * tempT;
|
|
62
|
+
if (tempT < 1 / 2) return q;
|
|
63
|
+
if (tempT < 2 / 3) return p + (q - p) * (2 / 3 - tempT) * 6;
|
|
64
|
+
return p;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const hslToRgb = ({ h, s, l }: HSL): RGB => {
|
|
68
|
+
h /= 360;
|
|
69
|
+
s /= 100;
|
|
70
|
+
l /= 100;
|
|
71
|
+
|
|
72
|
+
let r: number;
|
|
73
|
+
let g: number;
|
|
74
|
+
let b: number;
|
|
75
|
+
|
|
76
|
+
if (s === 0) {
|
|
77
|
+
r = g = b = l;
|
|
78
|
+
} else {
|
|
79
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
80
|
+
const p = 2 * l - q;
|
|
81
|
+
|
|
82
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
83
|
+
g = hue2rgb(p, q, h);
|
|
84
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
r: Math.round(r * 255),
|
|
89
|
+
g: Math.round(g * 255),
|
|
90
|
+
b: Math.round(b * 255),
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const formatRgba = (rgb: RGB, a = 1): string => {
|
|
95
|
+
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${a})`;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const formatHsla = (hsl: HSL, a = 1): string => {
|
|
99
|
+
return `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${a})`;
|
|
100
|
+
};
|