ikoncomponents 1.5.8 → 1.5.10
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/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/ikoncomponents/action-menu/index.d.ts +5 -0
- package/dist/ikoncomponents/action-menu/index.js +42 -0
- package/dist/ikoncomponents/action-menu/type.d.ts +14 -0
- package/dist/ikoncomponents/action-menu/type.js +1 -0
- package/dist/ikoncomponents/activity-sheet/index.d.ts +11 -0
- package/dist/ikoncomponents/activity-sheet/index.js +23 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +21 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +30 -0
- package/dist/ikoncomponents/alert-dialog/index.d.ts +14 -0
- package/dist/ikoncomponents/alert-dialog/index.js +20 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +18 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +43 -0
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +5 -0
- package/dist/ikoncomponents/app-breadcrumb/index.js +57 -0
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +5 -0
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +16 -0
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +2 -0
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +39 -0
- package/dist/ikoncomponents/big-calendar/index.d.ts +3 -0
- package/dist/ikoncomponents/big-calendar/index.js +35 -0
- package/dist/ikoncomponents/big-calendar/type.d.ts +31 -0
- package/dist/ikoncomponents/big-calendar/type.js +1 -0
- package/dist/ikoncomponents/buttons/index.d.ts +18 -0
- package/dist/ikoncomponents/buttons/index.js +38 -0
- package/dist/ikoncomponents/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/combobox-input/index.js +18 -0
- package/dist/ikoncomponents/combobox-input/type.d.ts +13 -0
- package/dist/ikoncomponents/combobox-input/type.js +1 -0
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +21 -0
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +85 -0
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +22 -0
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +35 -0
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +38 -0
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +13 -0
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +18 -0
- package/dist/ikoncomponents/data-table/function.d.ts +1 -0
- package/dist/ikoncomponents/data-table/function.js +6 -0
- package/dist/ikoncomponents/data-table/index.d.ts +2 -0
- package/dist/ikoncomponents/data-table/index.js +223 -0
- package/dist/ikoncomponents/data-table/type.d.ts +60 -0
- package/dist/ikoncomponents/data-table/type.js +1 -0
- package/dist/ikoncomponents/e-chart/index.d.ts +15 -0
- package/dist/ikoncomponents/e-chart/index.js +115 -0
- package/dist/ikoncomponents/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/file-input/index.js +21 -0
- package/dist/ikoncomponents/fileUpload/index.d.ts +15 -0
- package/dist/ikoncomponents/fileUpload/index.js +69 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +21 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +18 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +26 -0
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/date-input/index.js +15 -0
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/file-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +6 -0
- package/{templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx → dist/ikoncomponents/form-fields/multi-combobox-input/index.js} +381 -574
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/otp-input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/textarea/index.js +18 -0
- package/dist/ikoncomponents/form-fields/types/index.d.ts +36 -0
- package/dist/ikoncomponents/form-fields/types/index.js +1 -0
- package/dist/ikoncomponents/glowing-effect/index.d.ts +14 -0
- package/dist/ikoncomponents/glowing-effect/index.js +84 -0
- package/dist/ikoncomponents/icon/index.d.ts +8 -0
- package/dist/ikoncomponents/icon/index.js +23 -0
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +15 -0
- package/{templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx → dist/ikoncomponents/image-cropper-upload/components/newCropper.js} +85 -117
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +7 -0
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +145 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +6 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +92 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +6 -0
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +14 -0
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +14 -0
- package/{templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx → dist/ikoncomponents/image-cropper-upload/image-cropper/index.js} +87 -119
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +27 -0
- package/dist/ikoncomponents/image-cropper-upload/index.js +49 -0
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +16 -0
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +73 -0
- package/dist/ikoncomponents/loading-spinner/index.d.ts +9 -0
- package/dist/ikoncomponents/loading-spinner/index.js +19 -0
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +10 -0
- package/dist/ikoncomponents/main-layout/RefreshContext.js +18 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +33 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +52 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.js +24 -0
- package/dist/ikoncomponents/main-layout/footer.d.ts +1 -0
- package/dist/ikoncomponents/main-layout/footer.js +5 -0
- package/dist/ikoncomponents/main-layout/header.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/header.js +15 -0
- package/dist/ikoncomponents/main-layout/index.d.ts +6 -0
- package/dist/ikoncomponents/main-layout/index.js +11 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +60 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.js +119 -0
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +11 -0
- package/dist/ikoncomponents/main-layout/nav-main.js +33 -0
- package/dist/ikoncomponents/multi-combobox/index.d.ts +13 -0
- package/dist/ikoncomponents/multi-combobox/index.js +202 -0
- package/dist/ikoncomponents/no-data/index.d.ts +3 -0
- package/dist/ikoncomponents/no-data/index.js +5 -0
- package/dist/ikoncomponents/page-wrapper/index.d.ts +9 -0
- package/dist/ikoncomponents/page-wrapper/index.js +7 -0
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +3 -0
- package/dist/ikoncomponents/password-strength-meter/index.js +40 -0
- package/dist/ikoncomponents/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/phone-input/index.js +41 -0
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +6 -0
- package/dist/ikoncomponents/provider-wrapper/index.js +11 -0
- package/dist/ikoncomponents/search-input/index.d.ts +1 -0
- package/dist/ikoncomponents/search-input/index.js +19 -0
- package/dist/ikoncomponents/sheet/index.d.ts +10 -0
- package/dist/ikoncomponents/sheet/index.js +6 -0
- package/dist/ikoncomponents/simple-widget/index.d.ts +14 -0
- package/dist/ikoncomponents/simple-widget/index.js +14 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +5 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +6 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +3 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +5 -0
- package/dist/ikoncomponents/tabs/index.d.ts +2 -0
- package/dist/ikoncomponents/tabs/index.js +50 -0
- package/{templates/default/ikoncomponents/tabs/type.ts → dist/ikoncomponents/tabs/type.d.ts} +19 -20
- package/dist/ikoncomponents/tabs/type.js +2 -0
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +1 -0
- package/{templates/default/ikoncomponents/theme-toggle-btn/index.tsx → dist/ikoncomponents/theme-toggle-btn/index.js} +118 -189
- package/dist/ikoncomponents/title-progress/index.d.ts +12 -0
- package/dist/ikoncomponents/title-progress/index.js +10 -0
- package/dist/ikoncomponents/tooltip/index.d.ts +5 -0
- package/dist/ikoncomponents/tooltip/index.js +5 -0
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +31 -0
- package/dist/ikoncomponents/twolevel-dropdown/index.js +143 -0
- package/dist/ikoncomponents/upload-tab/index.d.ts +1 -0
- package/dist/ikoncomponents/upload-tab/index.js +92 -0
- package/dist/ikoncomponents/widgets/index.d.ts +2 -0
- package/dist/ikoncomponents/widgets/index.js +14 -0
- package/dist/ikoncomponents/widgets/type.d.ts +10 -0
- package/dist/ikoncomponents/widgets/type.js +2 -0
- package/dist/ikoncomponents/work-in-progress/index.d.ts +1 -0
- package/dist/ikoncomponents/work-in-progress/index.js +4 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +116 -14
- package/dist/shadcn/accordion.d.ts +7 -0
- package/dist/shadcn/accordion.js +33 -0
- package/dist/shadcn/alert-dialog.d.ts +20 -0
- package/dist/shadcn/alert-dialog.js +83 -0
- package/dist/shadcn/alert.d.ts +9 -0
- package/dist/shadcn/alert.js +38 -0
- package/dist/shadcn/aspect-ratio.d.ts +3 -0
- package/dist/shadcn/aspect-ratio.js +19 -0
- package/dist/shadcn/avatar.d.ts +6 -0
- package/dist/shadcn/avatar.js +28 -0
- package/dist/shadcn/badge.d.ts +9 -0
- package/dist/shadcn/badge.js +35 -0
- package/dist/shadcn/breadcrumb.d.ts +11 -0
- package/dist/shadcn/breadcrumb.js +45 -0
- package/dist/shadcn/button.d.ts +10 -0
- package/dist/shadcn/button.js +47 -0
- package/dist/shadcn/calendar.d.ts +8 -0
- package/dist/shadcn/calendar.js +61 -0
- package/dist/shadcn/card.d.ts +9 -0
- package/dist/shadcn/card.js +42 -0
- package/dist/shadcn/checkbox.d.ts +4 -0
- package/dist/shadcn/checkbox.js +21 -0
- package/dist/shadcn/collapsible.d.ts +5 -0
- package/dist/shadcn/collapsible.js +27 -0
- package/dist/shadcn/command.d.ts +18 -0
- package/dist/shadcn/command.js +54 -0
- package/dist/shadcn/date-input.d.ts +7 -0
- package/dist/shadcn/date-input.js +179 -0
- package/dist/shadcn/date-range-picker.d.ts +24 -0
- package/dist/shadcn/date-range-picker.js +45 -0
- package/dist/shadcn/dialog.d.ts +15 -0
- package/dist/shadcn/dialog.js +57 -0
- package/dist/shadcn/drawer.d.ts +13 -0
- package/dist/shadcn/drawer.js +56 -0
- package/dist/shadcn/dropdown-menu.d.ts +25 -0
- package/dist/shadcn/dropdown-menu.js +77 -0
- package/dist/shadcn/form.d.ts +24 -0
- package/dist/shadcn/form.js +70 -0
- package/dist/shadcn/hover-card.d.ts +6 -0
- package/dist/shadcn/hover-card.js +28 -0
- package/dist/shadcn/input-otp.d.ts +34 -0
- package/dist/shadcn/input-otp.js +40 -0
- package/dist/shadcn/input.d.ts +3 -0
- package/dist/shadcn/input.js +18 -0
- package/dist/shadcn/label.d.ts +4 -0
- package/dist/shadcn/label.js +20 -0
- package/dist/shadcn/navigation-menu.d.ts +16 -0
- package/dist/shadcn/navigation-menu.js +74 -0
- package/dist/shadcn/popover.d.ts +7 -0
- package/dist/shadcn/popover.js +32 -0
- package/dist/shadcn/progress.d.ts +8 -0
- package/dist/shadcn/progress.js +23 -0
- package/dist/shadcn/radio-group.d.ts +5 -0
- package/dist/shadcn/radio-group.js +25 -0
- package/dist/shadcn/scroll-area.d.ts +5 -0
- package/dist/shadcn/scroll-area.js +26 -0
- package/dist/shadcn/select.d.ts +15 -0
- package/dist/shadcn/select.js +59 -0
- package/dist/shadcn/separator.d.ts +4 -0
- package/dist/shadcn/separator.js +20 -0
- package/dist/shadcn/sheet.d.ts +13 -0
- package/dist/shadcn/sheet.js +61 -0
- package/dist/shadcn/sidebar.d.ts +69 -0
- package/dist/shadcn/sidebar.js +242 -0
- package/dist/shadcn/skeleton.d.ts +3 -0
- package/dist/shadcn/skeleton.js +18 -0
- package/dist/shadcn/slider.d.ts +4 -0
- package/dist/shadcn/slider.js +26 -0
- package/dist/shadcn/sonner.d.ts +3 -0
- package/dist/shadcn/sonner.js +25 -0
- package/dist/shadcn/switch.d.ts +4 -0
- package/dist/shadcn/switch.js +20 -0
- package/dist/shadcn/table.d.ts +10 -0
- package/dist/shadcn/table.js +47 -0
- package/dist/shadcn/tabs.d.ts +7 -0
- package/dist/shadcn/tabs.js +32 -0
- package/dist/shadcn/textarea.d.ts +3 -0
- package/dist/shadcn/textarea.js +18 -0
- package/dist/shadcn/toggle-group.d.ts +9 -0
- package/dist/shadcn/toggle-group.js +35 -0
- package/dist/shadcn/toggle.d.ts +9 -0
- package/dist/shadcn/toggle.js +38 -0
- package/dist/shadcn/tooltip.d.ts +7 -0
- package/dist/shadcn/tooltip.js +32 -0
- package/dist/shadcn/workflow.d.ts +20 -0
- package/dist/shadcn/workflow.js +20 -0
- package/dist/styles.css +6163 -0
- package/dist/utils/actions/account/index.d.ts +5 -0
- package/dist/utils/actions/account/index.js +28 -0
- package/dist/utils/actions/account/type.d.ts +4 -0
- package/dist/utils/actions/account/type.js +1 -0
- package/dist/utils/actions/auth/index.d.ts +7 -0
- package/{templates/default/utils/actions/auth/index.ts → dist/utils/actions/auth/index.js} +58 -69
- package/dist/utils/actions/common/utils.d.ts +5 -0
- package/{templates/default/utils/actions/common/utils.ts → dist/utils/actions/common/utils.js} +25 -28
- package/dist/utils/actions/software/index.d.ts +11 -0
- package/dist/utils/actions/software/index.js +75 -0
- package/dist/utils/api/accountService/index.d.ts +23 -0
- package/dist/utils/api/accountService/index.js +64 -0
- package/dist/utils/api/accountService/type.d.ts +4 -0
- package/dist/utils/api/accountService/type.js +1 -0
- package/dist/utils/api/file-upload/index.d.ts +5 -0
- package/dist/utils/api/file-upload/index.js +80 -0
- package/dist/utils/api/file-upload/type.d.ts +6 -0
- package/dist/utils/api/file-upload/type.js +1 -0
- package/dist/utils/api/ikonBaseApi.d.ts +12 -0
- package/{templates/default/utils/api/ikonBaseApi.ts → dist/utils/api/ikonBaseApi.js} +104 -132
- package/dist/utils/api/loginService/index.d.ts +12 -0
- package/dist/utils/api/loginService/index.js +72 -0
- package/{templates/default/utils/api/loginService/type.ts → dist/utils/api/loginService/type.d.ts} +31 -35
- package/dist/utils/api/loginService/type.js +1 -0
- package/dist/utils/api/softwareService/index.d.ts +64 -0
- package/dist/utils/api/softwareService/index.js +212 -0
- package/dist/utils/api/softwareService/type.d.ts +54 -0
- package/dist/utils/api/softwareService/type.js +1 -0
- package/dist/utils/border-radius-provider.d.ts +11 -0
- package/{templates/default/utils/border-radius-provider.tsx → dist/utils/border-radius-provider.js} +35 -59
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +5 -0
- package/dist/utils/font-provider.d.ts +11 -0
- package/{templates/default/utils/font-provider.tsx → dist/utils/font-provider.js} +37 -61
- package/dist/utils/session/cookieSession.d.ts +8 -0
- package/dist/utils/session/cookieSession.js +33 -0
- package/dist/utils/theme-provider/index.d.ts +3 -0
- package/dist/utils/theme-provider/index.js +18 -0
- package/dist/utils/token-management/index.d.ts +10 -0
- package/dist/utils/token-management/index.js +69 -0
- package/dist/utils/token-management/types.d.ts +6 -0
- package/dist/utils/token-management/types.js +1 -0
- package/package.json +91 -17
- package/bin.js +0 -2
- package/dist/commands/init.js +0 -63
- package/dist/utlis/copyDir.js +0 -7
- package/templates/default/hooks/use-mobile.ts +0 -19
- package/templates/default/ikonS/accordion.tsx +0 -66
- package/templates/default/ikonS/alert-dialog.tsx +0 -179
- package/templates/default/ikonS/alert.tsx +0 -66
- package/templates/default/ikonS/aspect-ratio.tsx +0 -11
- package/templates/default/ikonS/avatar.tsx +0 -53
- package/templates/default/ikonS/badge.tsx +0 -49
- package/templates/default/ikonS/breadcrumb.tsx +0 -109
- package/templates/default/ikonS/button.tsx +0 -64
- package/templates/default/ikonS/calendar.tsx +0 -227
- package/templates/default/ikonS/card.tsx +0 -92
- package/templates/default/ikonS/checkbox.tsx +0 -33
- package/templates/default/ikonS/collapsible.tsx +0 -33
- package/templates/default/ikonS/command.tsx +0 -184
- package/templates/default/ikonS/date-input.tsx +0 -259
- package/templates/default/ikonS/date-range-picker.tsx +0 -103
- package/templates/default/ikonS/dialog.tsx +0 -143
- package/templates/default/ikonS/drawer.tsx +0 -134
- package/templates/default/ikonS/dropdown-menu.tsx +0 -259
- package/templates/default/ikonS/form.tsx +0 -166
- package/templates/default/ikonS/hover-card.tsx +0 -44
- package/templates/default/ikonS/input-otp.tsx +0 -71
- package/templates/default/ikonS/input.tsx +0 -22
- package/templates/default/ikonS/label.tsx +0 -24
- package/templates/default/ikonS/navigation-menu.tsx +0 -195
- package/templates/default/ikonS/popover.tsx +0 -48
- package/templates/default/ikonS/progress.tsx +0 -40
- package/templates/default/ikonS/radio-group.tsx +0 -45
- package/templates/default/ikonS/scroll-area.tsx +0 -58
- package/templates/default/ikonS/select.tsx +0 -184
- package/templates/default/ikonS/separator.tsx +0 -28
- package/templates/default/ikonS/sheet.tsx +0 -139
- package/templates/default/ikonS/sidebar.tsx +0 -726
- package/templates/default/ikonS/skeleton.tsx +0 -15
- package/templates/default/ikonS/slider.tsx +0 -64
- package/templates/default/ikonS/sonner.tsx +0 -25
- package/templates/default/ikonS/switch.tsx +0 -31
- package/templates/default/ikonS/table.tsx +0 -116
- package/templates/default/ikonS/tabs.tsx +0 -67
- package/templates/default/ikonS/textarea.tsx +0 -18
- package/templates/default/ikonS/toggle-group.tsx +0 -83
- package/templates/default/ikonS/toggle.tsx +0 -47
- package/templates/default/ikonS/tooltip.tsx +0 -65
- package/templates/default/ikonS/workflow.tsx +0 -119
- package/templates/default/ikoncomponents/action-menu/index.tsx +0 -108
- package/templates/default/ikoncomponents/action-menu/type.ts +0 -18
- package/templates/default/ikoncomponents/activity-sheet/index.tsx +0 -63
- package/templates/default/ikoncomponents/alert-dialog/dialog-context.tsx +0 -65
- package/templates/default/ikoncomponents/alert-dialog/index.tsx +0 -80
- package/templates/default/ikoncomponents/app-breadcrumb/BreadcrumbProvider.tsx +0 -68
- package/templates/default/ikoncomponents/app-breadcrumb/index.tsx +0 -222
- package/templates/default/ikoncomponents/big-calendar/big-calender-event/index.tsx +0 -38
- package/templates/default/ikoncomponents/big-calendar/big-calender-toolbar/index.tsx +0 -81
- package/templates/default/ikoncomponents/big-calendar/index.css +0 -879
- package/templates/default/ikoncomponents/big-calendar/index.tsx +0 -59
- package/templates/default/ikoncomponents/big-calendar/type.ts +0 -37
- package/templates/default/ikoncomponents/buttons/index.tsx +0 -127
- package/templates/default/ikoncomponents/combobox-input/index.tsx +0 -75
- package/templates/default/ikoncomponents/combobox-input/type.ts +0 -14
- package/templates/default/ikoncomponents/custom-combo-dropdown/index.tsx +0 -242
- package/templates/default/ikoncomponents/data-table/datatable-column-filter/index.tsx +0 -80
- package/templates/default/ikoncomponents/data-table/datatable-faceted-filter/index.tsx +0 -149
- package/templates/default/ikoncomponents/data-table/datatable-filter-menu/index.tsx +0 -98
- package/templates/default/ikoncomponents/data-table/datatable-pagination/index.tsx +0 -119
- package/templates/default/ikoncomponents/data-table/datatable-toolbar/index.tsx +0 -45
- package/templates/default/ikoncomponents/data-table/function.ts +0 -7
- package/templates/default/ikoncomponents/data-table/index.tsx +0 -549
- package/templates/default/ikoncomponents/data-table/type.ts +0 -75
- package/templates/default/ikoncomponents/e-chart/index.tsx +0 -183
- package/templates/default/ikoncomponents/file-input/index.tsx +0 -27
- package/templates/default/ikoncomponents/fileUpload/index.tsx +0 -121
- package/templates/default/ikoncomponents/form-fields/combobox-input/index.tsx +0 -111
- package/templates/default/ikoncomponents/form-fields/combobox-input-value/index.tsx +0 -121
- package/templates/default/ikoncomponents/form-fields/date-input/index.tsx +0 -80
- package/templates/default/ikoncomponents/form-fields/file-input/index.tsx +0 -9
- package/templates/default/ikoncomponents/form-fields/input/index.tsx +0 -27
- package/templates/default/ikoncomponents/form-fields/otp-input/index.tsx +0 -39
- package/templates/default/ikoncomponents/form-fields/password-input/index.tsx +0 -52
- package/templates/default/ikoncomponents/form-fields/phone-input/index.tsx +0 -7
- package/templates/default/ikoncomponents/form-fields/textarea/index.tsx +0 -28
- package/templates/default/ikoncomponents/form-fields/types/index.ts +0 -46
- package/templates/default/ikoncomponents/glowing-effect/index.tsx +0 -171
- package/templates/default/ikoncomponents/icon/index.tsx +0 -22
- package/templates/default/ikoncomponents/image-cropper-upload/components/cropperImg.css +0 -19
- package/templates/default/ikoncomponents/image-cropper-upload/components/newImageUploadForm.tsx +0 -352
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form/index.tsx +0 -250
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx +0 -32
- package/templates/default/ikoncomponents/image-cropper-upload/index.tsx +0 -95
- package/templates/default/ikoncomponents/image-cropper-upload/utils/index.ts +0 -117
- package/templates/default/ikoncomponents/loading-spinner/index.tsx +0 -43
- package/templates/default/ikoncomponents/main-layout/RefreshContext.tsx +0 -30
- package/templates/default/ikoncomponents/main-layout/SidebarNavContext.tsx +0 -103
- package/templates/default/ikoncomponents/main-layout/app-sidebar.tsx +0 -36
- package/templates/default/ikoncomponents/main-layout/footer.tsx +0 -21
- package/templates/default/ikoncomponents/main-layout/header.tsx +0 -53
- package/templates/default/ikoncomponents/main-layout/index.tsx +0 -38
- package/templates/default/ikoncomponents/main-layout/main-sidebar.tsx +0 -389
- package/templates/default/ikoncomponents/main-layout/nav-main.tsx +0 -103
- package/templates/default/ikoncomponents/multi-combobox/index.tsx +0 -345
- package/templates/default/ikoncomponents/no-data/index.tsx +0 -11
- package/templates/default/ikoncomponents/page-wrapper/index.tsx +0 -30
- package/templates/default/ikoncomponents/password-strength-meter/index.tsx +0 -49
- package/templates/default/ikoncomponents/phone-input/index.tsx +0 -72
- package/templates/default/ikoncomponents/provider-wrapper/index.tsx +0 -32
- package/templates/default/ikoncomponents/search-input/index.tsx +0 -18
- package/templates/default/ikoncomponents/sheet/index.tsx +0 -34
- package/templates/default/ikoncomponents/simple-widget/index.tsx +0 -54
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-table.tsx +0 -34
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-widget.tsx +0 -13
- package/templates/default/ikoncomponents/tabs/index.tsx +0 -139
- package/templates/default/ikoncomponents/title-progress/index.tsx +0 -41
- package/templates/default/ikoncomponents/tooltip/index.tsx +0 -17
- package/templates/default/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.tsx +0 -33
- package/templates/default/ikoncomponents/twolevel-dropdown/index.tsx +0 -279
- package/templates/default/ikoncomponents/upload-tab/index.tsx +0 -237
- package/templates/default/ikoncomponents/widgets/index.tsx +0 -81
- package/templates/default/ikoncomponents/widgets/type.ts +0 -11
- package/templates/default/ikoncomponents/work-in-progress/index.tsx +0 -16
- package/templates/default/styles.css +0 -1159
- package/templates/default/utils/actions/account/index.ts +0 -33
- package/templates/default/utils/actions/account/type.ts +0 -4
- package/templates/default/utils/actions/common/revalidate.ts +0 -18
- package/templates/default/utils/actions/common/type.ts +0 -4
- package/templates/default/utils/actions/software/index.ts +0 -106
- package/templates/default/utils/api/accountService/index.ts +0 -103
- package/templates/default/utils/api/accountService/type.ts +0 -4
- package/templates/default/utils/api/file-upload/index.ts +0 -103
- package/templates/default/utils/api/file-upload/type.ts +0 -8
- package/templates/default/utils/api/loginService/index.ts +0 -106
- package/templates/default/utils/api/softwareService/index.ts +0 -356
- package/templates/default/utils/api/softwareService/type.ts +0 -62
- package/templates/default/utils/cn.ts +0 -6
- package/templates/default/utils/session/cookieSession.ts +0 -49
- package/templates/default/utils/theme-provider/index.tsx +0 -11
- package/templates/default/utils/token-management/index.ts +0 -115
- package/templates/default/utils/token-management/types.ts +0 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../../../shadcn/form';
|
|
14
|
+
import { InputOTP, InputOTPGroup, InputOTPSlot, } from "../../../shadcn/input-otp";
|
|
15
|
+
export function FormOtpInput(_a) {
|
|
16
|
+
var { formControl, label, formDescription, extraFormComponent, name } = _a, inputProps = __rest(_a, ["formControl", "label", "formDescription", "extraFormComponent", "name"]);
|
|
17
|
+
return (_jsx(_Fragment, { children: _jsx(FormField, { control: formControl, name: name, render: ({ field }) => (_jsxs(FormItem, { children: [label && _jsx(FormLabel, { children: label }), _jsx(FormControl, { children: _jsx(InputOTP, Object.assign({ maxLength: 4 }, field, { children: _jsxs(InputOTPGroup, { children: [_jsx(InputOTPSlot, { index: 0 }), _jsx(InputOTPSlot, { index: 1 }), _jsx(InputOTPSlot, { index: 2 }), _jsx(InputOTPSlot, { index: 3 })] }) })) }), extraFormComponent && extraFormComponent(field.value), formDescription && _jsx(FormDescription, { children: formDescription }), _jsx(FormMessage, {})] })) }) }));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FormPhoneInput(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../../../shadcn/form';
|
|
14
|
+
import { Textarea } from '../../../shadcn/textarea';
|
|
15
|
+
export function FormTextarea(_a) {
|
|
16
|
+
var { formControl, name, label, formItemClass, formDescription } = _a, textAreaProps = __rest(_a, ["formControl", "name", "label", "formItemClass", "formDescription"]);
|
|
17
|
+
return (_jsx(_Fragment, { children: _jsx(FormField, { control: formControl, name: name, render: ({ field }) => (_jsxs(FormItem, { className: formItemClass, children: [label && _jsx(FormLabel, { children: label }), _jsx(FormControl, { children: _jsx(Textarea, Object.assign({}, field, textAreaProps)) }), formDescription && _jsx(FormDescription, { children: formDescription }), _jsx(FormMessage, {})] })) }) }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from "react";
|
|
2
|
+
import { Matcher } from "react-day-picker";
|
|
3
|
+
export interface FormFieldProps {
|
|
4
|
+
formControl: any;
|
|
5
|
+
label?: string;
|
|
6
|
+
formItemClass?: string;
|
|
7
|
+
formDescription?: string;
|
|
8
|
+
extraFormComponent?: (value: string) => ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface FormInputProps extends FormFieldProps, InputHTMLAttributes<HTMLInputElement> {
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FormTextareaProps extends FormFieldProps, TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
export interface FormDateInputProps extends FormFieldProps {
|
|
17
|
+
name: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
dateFormat?: string;
|
|
20
|
+
calendarDateDisabled?: Matcher;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface FormComboboxInputProps extends FormFieldProps {
|
|
24
|
+
name: string;
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
items: FormComboboxItemProps[];
|
|
27
|
+
onSelect?: (value: string | string[]) => void;
|
|
28
|
+
defaultValue?: [];
|
|
29
|
+
disabled?: ((...args: any) => boolean) | boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface FormComboboxItemProps {
|
|
32
|
+
value: string;
|
|
33
|
+
label?: string | undefined;
|
|
34
|
+
extra?: any;
|
|
35
|
+
disabled?: ((...args: any) => boolean) | boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface GlowingEffectProps {
|
|
2
|
+
blur?: number;
|
|
3
|
+
inactiveZone?: number;
|
|
4
|
+
proximity?: number;
|
|
5
|
+
spread?: number;
|
|
6
|
+
variant?: "default" | "white";
|
|
7
|
+
glow?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
movementDuration?: number;
|
|
11
|
+
borderWidth?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const GlowingEffect: ({ blur, inactiveZone, proximity, spread, variant, glow, className, movementDuration, borderWidth, disabled, }: GlowingEffectProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
4
|
+
import { animate } from "motion/react";
|
|
5
|
+
import { cn } from "../../utils/cn";
|
|
6
|
+
export const GlowingEffect = (({ blur = 0, inactiveZone = 0.7, proximity = 0, spread = 20, variant = "default", glow = false, className, movementDuration = 2, borderWidth = 1, disabled = true, }) => {
|
|
7
|
+
const containerRef = useRef(null);
|
|
8
|
+
const lastPosition = useRef({ x: 0, y: 0 });
|
|
9
|
+
const animationFrameRef = useRef(0);
|
|
10
|
+
const handleMove = useCallback((e) => {
|
|
11
|
+
if (!containerRef.current)
|
|
12
|
+
return;
|
|
13
|
+
if (animationFrameRef.current) {
|
|
14
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
15
|
+
}
|
|
16
|
+
animationFrameRef.current = requestAnimationFrame(() => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const element = containerRef.current;
|
|
19
|
+
if (!element)
|
|
20
|
+
return;
|
|
21
|
+
const { left, top, width, height } = element.getBoundingClientRect();
|
|
22
|
+
const mouseX = (_a = e === null || e === void 0 ? void 0 : e.x) !== null && _a !== void 0 ? _a : lastPosition.current.x;
|
|
23
|
+
const mouseY = (_b = e === null || e === void 0 ? void 0 : e.y) !== null && _b !== void 0 ? _b : lastPosition.current.y;
|
|
24
|
+
if (e) {
|
|
25
|
+
lastPosition.current = { x: mouseX, y: mouseY };
|
|
26
|
+
}
|
|
27
|
+
const center = [left + width * 0.5, top + height * 0.5];
|
|
28
|
+
const distanceFromCenter = Math.hypot(mouseX - center[0], mouseY - center[1]);
|
|
29
|
+
const inactiveRadius = 0.5 * Math.min(width, height) * inactiveZone;
|
|
30
|
+
if (distanceFromCenter < inactiveRadius) {
|
|
31
|
+
element.style.setProperty("--active", "0");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const isActive = mouseX > left - proximity &&
|
|
35
|
+
mouseX < left + width + proximity &&
|
|
36
|
+
mouseY > top - proximity &&
|
|
37
|
+
mouseY < top + height + proximity;
|
|
38
|
+
element.style.setProperty("--active", isActive ? "1" : "0");
|
|
39
|
+
if (!isActive)
|
|
40
|
+
return;
|
|
41
|
+
const currentAngle = parseFloat(element.style.getPropertyValue("--start")) || 0;
|
|
42
|
+
const targetAngle = (180 * Math.atan2(mouseY - center[1], mouseX - center[0])) /
|
|
43
|
+
Math.PI +
|
|
44
|
+
90;
|
|
45
|
+
const angleDiff = ((targetAngle - currentAngle + 180) % 360) - 180;
|
|
46
|
+
const newAngle = currentAngle + angleDiff;
|
|
47
|
+
animate(currentAngle, newAngle, {
|
|
48
|
+
duration: movementDuration,
|
|
49
|
+
ease: [0.16, 1, 0.3, 1],
|
|
50
|
+
onUpdate: (value) => {
|
|
51
|
+
element.style.setProperty("--start", String(value));
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}, [inactiveZone, proximity, movementDuration]);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (disabled)
|
|
58
|
+
return;
|
|
59
|
+
const handleScroll = () => handleMove();
|
|
60
|
+
const handlePointerMove = (e) => handleMove(e);
|
|
61
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
62
|
+
document.body.addEventListener("pointermove", handlePointerMove, {
|
|
63
|
+
passive: true,
|
|
64
|
+
});
|
|
65
|
+
return () => {
|
|
66
|
+
if (animationFrameRef.current) {
|
|
67
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
68
|
+
}
|
|
69
|
+
window.removeEventListener("scroll", handleScroll);
|
|
70
|
+
document.body.removeEventListener("pointermove", handlePointerMove);
|
|
71
|
+
};
|
|
72
|
+
}, [handleMove, disabled]);
|
|
73
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity", glow && "opacity-100", variant === "white" && "border-white", disabled && "!block") }), _jsx("div", { ref: containerRef, style: {
|
|
74
|
+
"--blur": `${blur}px`,
|
|
75
|
+
"--spread": spread,
|
|
76
|
+
"--start": "0",
|
|
77
|
+
"--active": "0",
|
|
78
|
+
"--glowingeffect-border-width": `${borderWidth}px`,
|
|
79
|
+
"--repeating-conic-gradient-times": "5",
|
|
80
|
+
"--gradient": variant === "white"
|
|
81
|
+
? `repeating-conic-gradient(from 236.84deg at 50% 50%,var(--black),var(--black) calc(25% / var(--repeating-conic-gradient-times)))`
|
|
82
|
+
: `linear-gradient(54.29deg, #00A5E9 22.93%, #A020F0 32.97%, #55C8FF 52.28%, #A020F0 73.13%, #071182 88.57%)`,
|
|
83
|
+
}, className: cn("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity", glow && "opacity-100", blur > 0 && "blur-[var(--blur)] ", className, disabled && "!hidden"), children: _jsx("div", { className: cn("glow", "rounded-[inherit]", 'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]', "after:[border:var(--glowingeffect-border-width)_solid_transparent]", "after:[background:var(--gradient)] after:[background-attachment:fixed]", "after:opacity-[var(--active)] after:transition-opacity after:duration-300", "after:[mask-clip:padding-box,border-box]", "after:[mask-composite:intersect]", "after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]") }) })] }));
|
|
84
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as LucideIcons from 'lucide-react';
|
|
15
|
+
export function Icon(_a) {
|
|
16
|
+
var { name } = _a, props = __rest(_a, ["name"]);
|
|
17
|
+
const IconComponent = LucideIcons[name];
|
|
18
|
+
if (!IconComponent) {
|
|
19
|
+
console.warn(`Icon "${name}" not found in lucide-react`);
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return _jsx(IconComponent, Object.assign({}, props));
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "cropperjs/dist/cropper.css";
|
|
3
|
+
export interface CropperImgProps {
|
|
4
|
+
imageSrc: string | undefined;
|
|
5
|
+
onCroppedImage: (imageUrl: string) => void;
|
|
6
|
+
aspectRatio: number;
|
|
7
|
+
rotationAngle: number;
|
|
8
|
+
zoomLevel: number;
|
|
9
|
+
moveDirection: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
currentState: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const NewCropperImg: React.FC<CropperImgProps>;
|
|
@@ -1,117 +1,85 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const left = canvasLeft + (canvasWidth - cropBoxWidth) / 2;
|
|
87
|
-
const top = canvasTop + (canvasHeight - cropBoxHeight) / 2;
|
|
88
|
-
|
|
89
|
-
// Set the crop box data
|
|
90
|
-
cropper.setCropBoxData({
|
|
91
|
-
left: left,
|
|
92
|
-
top: top,
|
|
93
|
-
width: cropBoxWidth,
|
|
94
|
-
height: cropBoxHeight,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
}, [aspectRatio]); // Trigger this effect whenever aspectRatio changes
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<Cropper
|
|
104
|
-
src={imageSrc}
|
|
105
|
-
style={{ height: "100%", width: "100%", objectFit: "contain" }}
|
|
106
|
-
guides={true} // Show guides for cropping
|
|
107
|
-
crop={onCrop} // Callback to capture the cropped area
|
|
108
|
-
ref={cropperRef}
|
|
109
|
-
dragMode='move'
|
|
110
|
-
movable={true}
|
|
111
|
-
zoomable={true} // Allow zooming of the image
|
|
112
|
-
scalable={true} // Prevent scaling of the crop box
|
|
113
|
-
cropBoxMovable={true} // Allow the crop box to be moved inside the image
|
|
114
|
-
cropBoxResizable={false} // Disable resizing the crop box
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
117
|
-
};
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import Cropper from "react-cropper";
|
|
4
|
+
import "cropperjs/dist/cropper.css";
|
|
5
|
+
export const NewCropperImg = ({ imageSrc, onCroppedImage, aspectRatio, rotationAngle, zoomLevel, moveDirection, currentState }) => {
|
|
6
|
+
const cropperRef = useRef(null);
|
|
7
|
+
const onCrop = () => {
|
|
8
|
+
var _a;
|
|
9
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
10
|
+
if (cropper) {
|
|
11
|
+
cropper.setDragMode('move');
|
|
12
|
+
const croppedCanvas = cropper.getCroppedCanvas();
|
|
13
|
+
const croppedImageUrl = croppedCanvas.toDataURL(); // Data URL for preview
|
|
14
|
+
onCroppedImage(croppedImageUrl);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
console.log("Cropper instance is not available.");
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
var _a;
|
|
22
|
+
// Rotate the image whenever the rotation angle changes
|
|
23
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
24
|
+
if (cropper) {
|
|
25
|
+
cropper.rotate(rotationAngle); // Apply the rotation to the image
|
|
26
|
+
}
|
|
27
|
+
}, [rotationAngle]); // Effect will run whenever rotationAngle changes
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
var _a;
|
|
30
|
+
// Zoom the image whenever the zoom level changes
|
|
31
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
32
|
+
if (cropper) {
|
|
33
|
+
const cropBoxData = cropper.getCropBoxData();
|
|
34
|
+
if (cropBoxData.width) {
|
|
35
|
+
console.log('Inside cropper scale');
|
|
36
|
+
cropper.scale(zoomLevel); // Apply the zoom level
|
|
37
|
+
}
|
|
38
|
+
// Apply zoom directly without using getZoom method
|
|
39
|
+
}
|
|
40
|
+
}, [zoomLevel]); // Effect will run whenever zoomLevel changes
|
|
41
|
+
// Move the image based on the moveDirection prop
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
var _a;
|
|
44
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
45
|
+
if (cropper) {
|
|
46
|
+
// Make sure moveDirection is available before calling move
|
|
47
|
+
const cropBoxData = cropper.getCropBoxData();
|
|
48
|
+
if (cropBoxData.width) {
|
|
49
|
+
const { x, y } = moveDirection;
|
|
50
|
+
if (typeof x === "number" && typeof y === "number") {
|
|
51
|
+
cropper.move(x, y); // Move the image
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}, [moveDirection]); // This effect runs whenever moveDirection changes
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
var _a;
|
|
58
|
+
const cropper = (_a = cropperRef.current) === null || _a === void 0 ? void 0 : _a.cropper;
|
|
59
|
+
if (cropper) {
|
|
60
|
+
cropper.setAspectRatio(aspectRatio); // Dynamically set the aspect ratio
|
|
61
|
+
if (aspectRatio === 1) {
|
|
62
|
+
// Get the displayed (canvas) dimensions of the image
|
|
63
|
+
const canvasData = cropper.getCanvasData();
|
|
64
|
+
const canvasWidth = canvasData.width; // Displayed width of the image
|
|
65
|
+
const canvasHeight = canvasData.height; // Displayed height of the image
|
|
66
|
+
const canvasLeft = canvasData.left; // Left offset of the image within the container
|
|
67
|
+
const canvasTop = canvasData.top; // Top offset of the image within the container
|
|
68
|
+
// Define the desired crop box dimensions
|
|
69
|
+
const cropBoxWidth = 200; // Desired crop box width
|
|
70
|
+
const cropBoxHeight = 100; // Desired crop box height
|
|
71
|
+
// Calculate the center position for the crop box
|
|
72
|
+
const left = canvasLeft + (canvasWidth - cropBoxWidth) / 2;
|
|
73
|
+
const top = canvasTop + (canvasHeight - cropBoxHeight) / 2;
|
|
74
|
+
// Set the crop box data
|
|
75
|
+
cropper.setCropBoxData({
|
|
76
|
+
left: left,
|
|
77
|
+
top: top,
|
|
78
|
+
width: cropBoxWidth,
|
|
79
|
+
height: cropBoxHeight,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, [aspectRatio]); // Trigger this effect whenever aspectRatio changes
|
|
84
|
+
return (_jsx(Cropper, { src: imageSrc, style: { height: "100%", width: "100%", objectFit: "contain" }, guides: true, crop: onCrop, ref: cropperRef, dragMode: 'move', movable: true, zoomable: true, scalable: true, cropBoxMovable: true, cropBoxResizable: false }));
|
|
85
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ImageFormProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
onImageSubmit: (data: string | null) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const NewImageForm: React.NamedExoticComponent<ImageFormProps>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, memo } from "react";
|
|
3
|
+
import { ZoomIn, ZoomOut, RotateCw, RotateCcw, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, ImageIcon, FileImage, Square, Upload, } from "lucide-react";
|
|
4
|
+
import { Label } from "../../../shadcn/label";
|
|
5
|
+
import { Input } from "../../../shadcn/input";
|
|
6
|
+
import { Button } from "../../../shadcn/button";
|
|
7
|
+
import { NewCropperImg } from "./newCropper";
|
|
8
|
+
import Image from "next/image";
|
|
9
|
+
const NewImageFormComponent = ({ open, setOpen, onImageSubmit, }) => {
|
|
10
|
+
const [imageSrc, setImageSrc] = useState(null);
|
|
11
|
+
const [croppedImage, setCroppedImage] = useState(null);
|
|
12
|
+
const [prevImages, setPrevImages] = useState({
|
|
13
|
+
first: null,
|
|
14
|
+
second: null,
|
|
15
|
+
third: null,
|
|
16
|
+
});
|
|
17
|
+
const [aspectRatio, setAspectRatio] = useState(4 / 3);
|
|
18
|
+
const [activeState, setActiveState] = useState("first");
|
|
19
|
+
const [rotationAngle, setRotationAngle] = useState(0);
|
|
20
|
+
const [scale, setScale] = useState(1);
|
|
21
|
+
const [moveDirection, setMoveDirection] = useState({
|
|
22
|
+
x: 0,
|
|
23
|
+
y: 0,
|
|
24
|
+
});
|
|
25
|
+
const [fileName, setFileName] = useState("");
|
|
26
|
+
const handleImageSubmit = () => {
|
|
27
|
+
console.log("Image Submit Button is pressed");
|
|
28
|
+
console.log(prevImages);
|
|
29
|
+
onImageSubmit(prevImages.third);
|
|
30
|
+
setOpen(false);
|
|
31
|
+
};
|
|
32
|
+
const rotateImage = (angle) => {
|
|
33
|
+
setRotationAngle((prevAngle) => prevAngle + angle);
|
|
34
|
+
};
|
|
35
|
+
const handleMoveUp = () => {
|
|
36
|
+
setMoveDirection({ x: 0, y: -5 });
|
|
37
|
+
};
|
|
38
|
+
const handleMoveDown = () => {
|
|
39
|
+
setMoveDirection({ x: 0, y: 5 });
|
|
40
|
+
};
|
|
41
|
+
const handleMoveLeft = () => {
|
|
42
|
+
setMoveDirection({ x: -5, y: 0 });
|
|
43
|
+
};
|
|
44
|
+
const handleMoveRight = () => {
|
|
45
|
+
setMoveDirection({ x: 5, y: 0 });
|
|
46
|
+
};
|
|
47
|
+
// Handle zoom in
|
|
48
|
+
const zoomIn = () => {
|
|
49
|
+
setScale((prevScale) => {
|
|
50
|
+
const newScale = prevScale + 0.2;
|
|
51
|
+
if (newScale <= 2) {
|
|
52
|
+
// Ensure scale does not exceed the max value
|
|
53
|
+
return newScale;
|
|
54
|
+
}
|
|
55
|
+
return prevScale;
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
// Handle zoom out
|
|
59
|
+
const zoomOut = () => {
|
|
60
|
+
setScale((prevScale) => {
|
|
61
|
+
const newScale = prevScale - 0.2;
|
|
62
|
+
if (newScale >= 0.2) {
|
|
63
|
+
// Ensure scale does not go below the min value
|
|
64
|
+
return newScale;
|
|
65
|
+
}
|
|
66
|
+
return prevScale;
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
const handleAspectRatioChange = (ratio, stateName) => {
|
|
70
|
+
setAspectRatio(ratio);
|
|
71
|
+
setActiveState(stateName);
|
|
72
|
+
};
|
|
73
|
+
const handleFileChange = (file) => {
|
|
74
|
+
if (file.type.startsWith("image/")) {
|
|
75
|
+
const reader = new FileReader();
|
|
76
|
+
reader.onloadend = () => {
|
|
77
|
+
setImageSrc(reader.result);
|
|
78
|
+
setFileName((prev) => prev || file.name);
|
|
79
|
+
};
|
|
80
|
+
reader.readAsDataURL(file);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
alert("Please drop a valid image file.");
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const handleDrop = (event) => {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
handleFileChange(event.dataTransfer.files[0]);
|
|
89
|
+
};
|
|
90
|
+
const getImagePreview = (state) => {
|
|
91
|
+
const imgSource = croppedImage && activeState === state ? croppedImage : prevImages[state];
|
|
92
|
+
// const imgSource = prevImages[state];
|
|
93
|
+
return imgSource ? (_jsx("div", { className: `
|
|
94
|
+
${state === "first"
|
|
95
|
+
? "relative w-3/5 h-[200px] bg-slate-400"
|
|
96
|
+
: state === "second"
|
|
97
|
+
? "relative w-1/2 h-[220px] bg-slate-400"
|
|
98
|
+
: "relative w-1/3 h-[120px] bg-slate-400"}`, children: _jsx(Image, { src: imgSource || "", alt: `Preview ${state}`, layout: "fill", objectFit: "70vh" }) })) : (_jsx("div", { className: `
|
|
99
|
+
${state === "first"
|
|
100
|
+
? "relative w-3/5 h-[200px] bg-slate-400"
|
|
101
|
+
: state === "second"
|
|
102
|
+
? "relative w-1/2 h-[220px] bg-slate-400"
|
|
103
|
+
: "relative w-1/3 h-[120px] bg-slate-400"}` }));
|
|
104
|
+
};
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (croppedImage) {
|
|
107
|
+
if (prevImages.first === null ||
|
|
108
|
+
prevImages.second === null ||
|
|
109
|
+
prevImages.third === null) {
|
|
110
|
+
setPrevImages({
|
|
111
|
+
first: croppedImage,
|
|
112
|
+
second: croppedImage,
|
|
113
|
+
third: croppedImage,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
setPrevImages((prev) => (Object.assign(Object.assign({}, prev), { [activeState]: croppedImage })));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, [croppedImage]);
|
|
121
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-row gap-2", children: [_jsxs("div", { className: "flex-1", children: [_jsx(Label, { htmlFor: "imageName", children: "Image Name" }), _jsx(Input, { id: "imageName", placeholder: "Enter image name", value: fileName, onChange: (e) => setFileName(e.target.value) })] }), _jsxs("div", { className: "self-end", children: [_jsx(Button, { variant: "outline", onClick: () => { var _a; return (_a = document.getElementById("inputImage1")) === null || _a === void 0 ? void 0 : _a.click(); }, children: _jsx(Upload, {}) }), _jsx(Input, { id: "inputImage1", type: "file", accept: "image/png, image/jpeg", className: "hidden", onChange: (e) => {
|
|
122
|
+
var _a;
|
|
123
|
+
const file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
124
|
+
if (file && file.type.startsWith("image/")) {
|
|
125
|
+
const reader = new FileReader();
|
|
126
|
+
reader.onloadend = () => {
|
|
127
|
+
setImageSrc(reader.result);
|
|
128
|
+
setFileName((prevFileName) => prevFileName || file.name);
|
|
129
|
+
};
|
|
130
|
+
reader.readAsDataURL(file);
|
|
131
|
+
setPrevImages({
|
|
132
|
+
first: null,
|
|
133
|
+
second: null,
|
|
134
|
+
third: null,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
} })] }), _jsxs("div", { className: "flex-1", children: [_jsx(Label, { htmlFor: "imageDesc", children: "Image Description" }), _jsx(Input, { id: "imageDesc", placeholder: "Describe your image" })] })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx("div", { className: "w-3/5 flex justify-center items-center border-2 border-dashed border-gray-400 bg-gray-100", style: { height: "70vh" }, onDrop: handleDrop, onDragOver: (e) => e.preventDefault(), children: imageSrc ? (_jsx(NewCropperImg, { imageSrc: imageSrc, onCroppedImage: setCroppedImage, aspectRatio: aspectRatio, rotationAngle: rotationAngle, zoomLevel: scale, moveDirection: moveDirection, currentState: activeState })) : (_jsxs("div", { className: "text-center", children: [_jsx(Label, { htmlFor: "inputImage", children: "Drag and drop an image here" }), _jsxs("div", { className: "mt-4", children: [_jsx(Button, { variant: "outline", onClick: () => { var _a; return (_a = document.getElementById("inputImage")) === null || _a === void 0 ? void 0 : _a.click(); }, children: "Upload Image" }), _jsx(Input, { id: "inputImage", type: "file", accept: "image/png, image/jpeg", className: "hidden", onChange: (e) => {
|
|
138
|
+
var _a;
|
|
139
|
+
const file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
140
|
+
if (file) {
|
|
141
|
+
handleFileChange(file);
|
|
142
|
+
}
|
|
143
|
+
} })] })] })) }), _jsxs("div", { className: "w-2/5 flex flex-col gap-2", children: [_jsx("h3", { children: "Landscape" }), getImagePreview("first"), _jsx("h3", { children: "Potrait" }), getImagePreview("second"), _jsx("h3", { children: "Icon" }), getImagePreview("third")] })] }), _jsxs("div", { className: "flex flex-row gap-1", children: [_jsxs("div", { className: "w-3/5 flex flex-row justify-between", children: [_jsxs("div", { children: [_jsx(Button, { variant: "outline", onClick: () => handleAspectRatioChange(4 / 3, "first"), children: _jsx(ImageIcon, {}) }), _jsx(Button, { variant: "outline", onClick: () => handleAspectRatioChange(3 / 4, "second"), children: _jsx(FileImage, {}) }), _jsx(Button, { variant: "outline", onClick: () => handleAspectRatioChange(1 / 1, "third"), children: _jsx(Square, {}) })] }), _jsxs("div", { children: [_jsx(Button, { onClick: () => rotateImage(90), variant: "outline", children: _jsx(RotateCw, {}) }), _jsx(Button, { onClick: () => rotateImage(-90), variant: "outline", children: _jsx(RotateCcw, {}) })] }), _jsxs("div", { children: [_jsx(Button, { onClick: () => zoomIn(), variant: "outline", children: _jsx(ZoomIn, {}) }), _jsx(Button, { onClick: () => zoomOut(), variant: "outline", children: _jsx(ZoomOut, {}) })] }), _jsxs("div", { children: [_jsx(Button, { onClick: handleMoveUp, variant: "outline", children: _jsx(ArrowUp, {}) }), _jsx(Button, { onClick: handleMoveDown, variant: "outline", children: _jsx(ArrowDown, {}) }), _jsx(Button, { onClick: handleMoveLeft, variant: "outline", children: _jsx(ArrowLeft, {}) }), _jsx(Button, { onClick: handleMoveRight, variant: "outline", children: _jsx(ArrowRight, {}) })] })] }), _jsx("div", { className: "w-2/5 flex flex-row-reverse", children: _jsx(Button, { onClick: handleImageSubmit, children: "Save" }) })] })] }));
|
|
144
|
+
};
|
|
145
|
+
export const NewImageForm = memo(NewImageFormComponent);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
onNewFileUpload?: (...args: any) => void;
|
|
3
|
+
}
|
|
4
|
+
declare function CropperFormComponent({ onNewFileUpload }: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const CropperForm: import("react").MemoExoticComponent<typeof CropperFormComponent>;
|
|
6
|
+
export {};
|