ikoncomponents 1.4.8 → 1.4.9
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/commands/init.js +57 -0
- package/dist/index.js +3 -116
- package/dist/utlis/copyDir.js +7 -0
- package/package.json +12 -90
- package/templates/default/hooks/use-mobile.ts +19 -0
- package/templates/default/ikonShade/accordion.tsx +66 -0
- package/templates/default/ikonShade/alert-dialog.tsx +179 -0
- package/templates/default/ikonShade/alert.tsx +66 -0
- package/templates/default/ikonShade/aspect-ratio.tsx +11 -0
- package/templates/default/ikonShade/avatar.tsx +53 -0
- package/templates/default/ikonShade/badge.tsx +49 -0
- package/templates/default/ikonShade/breadcrumb.tsx +109 -0
- package/templates/default/ikonShade/button.tsx +64 -0
- package/templates/default/ikonShade/calendar.tsx +227 -0
- package/templates/default/ikonShade/card.tsx +92 -0
- package/templates/default/ikonShade/checkbox.tsx +33 -0
- package/templates/default/ikonShade/collapsible.tsx +33 -0
- package/templates/default/ikonShade/command.tsx +184 -0
- package/templates/default/ikonShade/date-input.tsx +259 -0
- package/templates/default/ikonShade/date-range-picker.tsx +103 -0
- package/templates/default/ikonShade/dialog.tsx +143 -0
- package/templates/default/ikonShade/drawer.tsx +134 -0
- package/templates/default/ikonShade/dropdown-menu.tsx +259 -0
- package/templates/default/ikonShade/form.tsx +166 -0
- package/templates/default/ikonShade/hover-card.tsx +44 -0
- package/templates/default/ikonShade/input-otp.tsx +71 -0
- package/templates/default/ikonShade/input.tsx +22 -0
- package/templates/default/ikonShade/label.tsx +24 -0
- package/templates/default/ikonShade/navigation-menu.tsx +195 -0
- package/templates/default/ikonShade/popover.tsx +48 -0
- package/templates/default/ikonShade/progress.tsx +40 -0
- package/templates/default/ikonShade/radio-group.tsx +45 -0
- package/templates/default/ikonShade/scroll-area.tsx +58 -0
- package/templates/default/ikonShade/select.tsx +184 -0
- package/templates/default/ikonShade/separator.tsx +28 -0
- package/templates/default/ikonShade/sheet.tsx +139 -0
- package/templates/default/ikonShade/sidebar.tsx +726 -0
- package/templates/default/ikonShade/skeleton.tsx +15 -0
- package/templates/default/ikonShade/slider.tsx +64 -0
- package/templates/default/ikonShade/sonner.tsx +25 -0
- package/templates/default/ikonShade/switch.tsx +31 -0
- package/templates/default/ikonShade/table.tsx +116 -0
- package/templates/default/ikonShade/tabs.tsx +67 -0
- package/templates/default/ikonShade/textarea.tsx +18 -0
- package/templates/default/ikonShade/toggle-group.tsx +83 -0
- package/templates/default/ikonShade/toggle.tsx +47 -0
- package/templates/default/ikonShade/tooltip.tsx +65 -0
- package/templates/default/ikonShade/workflow.tsx +119 -0
- package/templates/default/ikoncomponents/action-menu/index.tsx +108 -0
- package/templates/default/ikoncomponents/action-menu/type.ts +18 -0
- package/templates/default/ikoncomponents/activity-sheet/index.tsx +63 -0
- package/templates/default/ikoncomponents/alert-dialog/dialog-context.tsx +65 -0
- package/templates/default/ikoncomponents/alert-dialog/index.tsx +80 -0
- package/templates/default/ikoncomponents/app-breadcrumb/BreadcrumbProvider.tsx +68 -0
- package/templates/default/ikoncomponents/app-breadcrumb/index.tsx +222 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-event/index.tsx +38 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-toolbar/index.tsx +81 -0
- package/templates/default/ikoncomponents/big-calendar/index.css +879 -0
- package/templates/default/ikoncomponents/big-calendar/index.tsx +59 -0
- package/templates/default/ikoncomponents/big-calendar/type.ts +37 -0
- package/templates/default/ikoncomponents/buttons/index.tsx +127 -0
- package/templates/default/ikoncomponents/combobox-input/index.tsx +75 -0
- package/templates/default/ikoncomponents/combobox-input/type.ts +14 -0
- package/templates/default/ikoncomponents/custom-combo-dropdown/index.tsx +242 -0
- package/templates/default/ikoncomponents/data-table/datatable-column-filter/index.tsx +80 -0
- package/templates/default/ikoncomponents/data-table/datatable-faceted-filter/index.tsx +149 -0
- package/templates/default/ikoncomponents/data-table/datatable-filter-menu/index.tsx +98 -0
- package/templates/default/ikoncomponents/data-table/datatable-pagination/index.tsx +119 -0
- package/templates/default/ikoncomponents/data-table/datatable-toolbar/index.tsx +45 -0
- package/templates/default/ikoncomponents/data-table/function.ts +7 -0
- package/templates/default/ikoncomponents/data-table/index.tsx +549 -0
- package/templates/default/ikoncomponents/data-table/type.ts +75 -0
- package/templates/default/ikoncomponents/e-chart/index.tsx +183 -0
- package/templates/default/ikoncomponents/file-input/index.tsx +27 -0
- package/templates/default/ikoncomponents/fileUpload/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input/index.tsx +111 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input-value/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/date-input/index.tsx +80 -0
- package/templates/default/ikoncomponents/form-fields/file-input/index.tsx +9 -0
- package/templates/default/ikoncomponents/form-fields/input/index.tsx +27 -0
- package/{dist/ikoncomponents/form-fields/multi-combobox-input/index.js → templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx} +574 -381
- package/templates/default/ikoncomponents/form-fields/otp-input/index.tsx +39 -0
- package/templates/default/ikoncomponents/form-fields/password-input/index.tsx +52 -0
- package/templates/default/ikoncomponents/form-fields/phone-input/index.tsx +7 -0
- package/templates/default/ikoncomponents/form-fields/textarea/index.tsx +28 -0
- package/templates/default/ikoncomponents/form-fields/types/index.ts +46 -0
- package/templates/default/ikoncomponents/glowing-effect/index.tsx +171 -0
- package/templates/default/ikoncomponents/icon/index.tsx +22 -0
- package/templates/default/ikoncomponents/image-cropper-upload/components/cropperImg.css +19 -0
- package/{dist/ikoncomponents/image-cropper-upload/components/newCropper.js → templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx} +117 -85
- package/templates/default/ikoncomponents/image-cropper-upload/components/newImageUploadForm.tsx +352 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form/index.tsx +250 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx +32 -0
- package/{dist/ikoncomponents/image-cropper-upload/image-cropper/index.js → templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx} +119 -87
- package/templates/default/ikoncomponents/image-cropper-upload/index.tsx +95 -0
- package/templates/default/ikoncomponents/image-cropper-upload/utils/index.ts +117 -0
- package/templates/default/ikoncomponents/loading-spinner/index.tsx +43 -0
- package/templates/default/ikoncomponents/main-layout/RefreshContext.tsx +30 -0
- package/templates/default/ikoncomponents/main-layout/SidebarNavContext.tsx +103 -0
- package/templates/default/ikoncomponents/main-layout/app-sidebar.tsx +36 -0
- package/templates/default/ikoncomponents/main-layout/footer.tsx +21 -0
- package/templates/default/ikoncomponents/main-layout/header.tsx +53 -0
- package/templates/default/ikoncomponents/main-layout/index.tsx +43 -0
- package/templates/default/ikoncomponents/main-layout/main-sidebar.tsx +389 -0
- package/templates/default/ikoncomponents/main-layout/nav-main.tsx +103 -0
- package/templates/default/ikoncomponents/multi-combobox/index.tsx +345 -0
- package/templates/default/ikoncomponents/no-data/index.tsx +11 -0
- package/templates/default/ikoncomponents/page-wrapper/index.tsx +30 -0
- package/templates/default/ikoncomponents/password-strength-meter/index.tsx +49 -0
- package/templates/default/ikoncomponents/phone-input/index.tsx +72 -0
- package/templates/default/ikoncomponents/provider-wrapper/index.tsx +32 -0
- package/templates/default/ikoncomponents/search-input/index.tsx +18 -0
- package/templates/default/ikoncomponents/sheet/index.tsx +34 -0
- package/templates/default/ikoncomponents/simple-widget/index.tsx +54 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-table.tsx +34 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-widget.tsx +13 -0
- package/templates/default/ikoncomponents/tabs/index.tsx +139 -0
- package/{dist/ikoncomponents/tabs/type.d.ts → templates/default/ikoncomponents/tabs/type.ts} +20 -20
- package/{dist/ikoncomponents/theme-toggle-btn/index.js → templates/default/ikoncomponents/theme-toggle-btn/index.tsx} +189 -118
- package/templates/default/ikoncomponents/title-progress/index.tsx +41 -0
- package/templates/default/ikoncomponents/tooltip/index.tsx +17 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.tsx +33 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/index.tsx +279 -0
- package/templates/default/ikoncomponents/upload-tab/index.tsx +237 -0
- package/templates/default/ikoncomponents/widgets/index.tsx +81 -0
- package/templates/default/ikoncomponents/widgets/type.ts +11 -0
- package/templates/default/ikoncomponents/work-in-progress/index.tsx +16 -0
- package/{dist/index.d.ts → templates/default/index.ts} +234 -139
- package/templates/default/styles.css +1159 -0
- package/templates/default/utils/actions/account/index.ts +33 -0
- package/templates/default/utils/actions/account/type.ts +4 -0
- package/{dist/utils/actions/auth/index.js → templates/default/utils/actions/auth/index.ts} +69 -58
- package/templates/default/utils/actions/common/revalidate.ts +18 -0
- package/templates/default/utils/actions/common/type.ts +4 -0
- package/{dist/utils/actions/common/utils.js → templates/default/utils/actions/common/utils.ts} +28 -25
- package/templates/default/utils/actions/software/index.ts +106 -0
- package/templates/default/utils/api/accountService/index.ts +103 -0
- package/templates/default/utils/api/accountService/type.ts +4 -0
- package/templates/default/utils/api/file-upload/index.ts +103 -0
- package/templates/default/utils/api/file-upload/type.ts +8 -0
- package/{dist/utils/api/ikonBaseApi.js → templates/default/utils/api/ikonBaseApi.ts} +132 -104
- package/templates/default/utils/api/loginService/index.ts +108 -0
- package/{dist/utils/api/loginService/type.d.ts → templates/default/utils/api/loginService/type.ts} +35 -32
- package/templates/default/utils/api/softwareService/index.ts +356 -0
- package/templates/default/utils/api/softwareService/type.ts +62 -0
- package/{dist/utils/border-radius-provider.js → templates/default/utils/border-radius-provider.tsx} +59 -35
- package/templates/default/utils/cn.ts +6 -0
- package/{dist/utils/font-provider.js → templates/default/utils/font-provider.tsx} +61 -37
- package/templates/default/utils/session/cookieSession.ts +49 -0
- package/templates/default/utils/theme-provider/index.tsx +11 -0
- package/templates/default/utils/token-management/index.ts +115 -0
- package/templates/default/utils/token-management/types.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-mobile.js +0 -15
- package/dist/ikoncomponents/action-menu/index.d.ts +0 -6
- package/dist/ikoncomponents/action-menu/index.d.ts.map +0 -1
- package/dist/ikoncomponents/action-menu/index.js +0 -42
- package/dist/ikoncomponents/action-menu/type.d.ts +0 -15
- package/dist/ikoncomponents/action-menu/type.d.ts.map +0 -1
- package/dist/ikoncomponents/action-menu/type.js +0 -1
- package/dist/ikoncomponents/activity-sheet/index.d.ts +0 -12
- package/dist/ikoncomponents/activity-sheet/index.d.ts.map +0 -1
- package/dist/ikoncomponents/activity-sheet/index.js +0 -23
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +0 -22
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts.map +0 -1
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +0 -30
- package/dist/ikoncomponents/alert-dialog/index.d.ts +0 -15
- package/dist/ikoncomponents/alert-dialog/index.d.ts.map +0 -1
- package/dist/ikoncomponents/alert-dialog/index.js +0 -20
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +0 -19
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts.map +0 -1
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +0 -43
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +0 -6
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts.map +0 -1
- package/dist/ikoncomponents/app-breadcrumb/index.js +0 -57
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +0 -6
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +0 -16
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +0 -3
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +0 -39
- package/dist/ikoncomponents/big-calendar/index.d.ts +0 -4
- package/dist/ikoncomponents/big-calendar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/index.js +0 -35
- package/dist/ikoncomponents/big-calendar/type.d.ts +0 -32
- package/dist/ikoncomponents/big-calendar/type.d.ts.map +0 -1
- package/dist/ikoncomponents/big-calendar/type.js +0 -1
- package/dist/ikoncomponents/buttons/index.d.ts +0 -19
- package/dist/ikoncomponents/buttons/index.d.ts.map +0 -1
- package/dist/ikoncomponents/buttons/index.js +0 -38
- package/dist/ikoncomponents/combobox-input/index.d.ts +0 -3
- package/dist/ikoncomponents/combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/combobox-input/index.js +0 -18
- package/dist/ikoncomponents/combobox-input/type.d.ts +0 -14
- package/dist/ikoncomponents/combobox-input/type.d.ts.map +0 -1
- package/dist/ikoncomponents/combobox-input/type.js +0 -1
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +0 -22
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts.map +0 -1
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +0 -85
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +0 -22
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +0 -35
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +0 -38
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +0 -13
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +0 -18
- package/dist/ikoncomponents/data-table/function.d.ts +0 -2
- package/dist/ikoncomponents/data-table/function.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/function.js +0 -6
- package/dist/ikoncomponents/data-table/index.d.ts +0 -3
- package/dist/ikoncomponents/data-table/index.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/index.js +0 -223
- package/dist/ikoncomponents/data-table/type.d.ts +0 -61
- package/dist/ikoncomponents/data-table/type.d.ts.map +0 -1
- package/dist/ikoncomponents/data-table/type.js +0 -1
- package/dist/ikoncomponents/e-chart/index.d.ts +0 -16
- package/dist/ikoncomponents/e-chart/index.d.ts.map +0 -1
- package/dist/ikoncomponents/e-chart/index.js +0 -115
- package/dist/ikoncomponents/file-input/index.d.ts +0 -2
- package/dist/ikoncomponents/file-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/file-input/index.js +0 -21
- package/dist/ikoncomponents/fileUpload/index.d.ts +0 -16
- package/dist/ikoncomponents/fileUpload/index.d.ts.map +0 -1
- package/dist/ikoncomponents/fileUpload/index.js +0 -69
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +0 -21
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +0 -19
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +0 -26
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/date-input/index.js +0 -15
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/file-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +0 -7
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/otp-input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/password-input/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/password-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/password-input/index.js +0 -23
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/phone-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +0 -3
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/textarea/index.js +0 -18
- package/dist/ikoncomponents/form-fields/types/index.d.ts +0 -37
- package/dist/ikoncomponents/form-fields/types/index.d.ts.map +0 -1
- package/dist/ikoncomponents/form-fields/types/index.js +0 -1
- package/dist/ikoncomponents/glowing-effect/index.d.ts +0 -15
- package/dist/ikoncomponents/glowing-effect/index.d.ts.map +0 -1
- package/dist/ikoncomponents/glowing-effect/index.js +0 -84
- package/dist/ikoncomponents/icon/index.d.ts +0 -9
- package/dist/ikoncomponents/icon/index.d.ts.map +0 -1
- package/dist/ikoncomponents/icon/index.js +0 -23
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +0 -16
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +0 -8
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +0 -145
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +0 -7
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +0 -92
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +0 -7
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +0 -14
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +0 -15
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +0 -28
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/index.js +0 -49
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +0 -17
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts.map +0 -1
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +0 -73
- package/dist/ikoncomponents/loading-spinner/index.d.ts +0 -10
- package/dist/ikoncomponents/loading-spinner/index.d.ts.map +0 -1
- package/dist/ikoncomponents/loading-spinner/index.js +0 -19
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +0 -11
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/RefreshContext.js +0 -17
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +0 -34
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +0 -52
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +0 -4
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/app-sidebar.js +0 -24
- package/dist/ikoncomponents/main-layout/footer.d.ts +0 -2
- package/dist/ikoncomponents/main-layout/footer.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/footer.js +0 -5
- package/dist/ikoncomponents/main-layout/header.d.ts +0 -4
- package/dist/ikoncomponents/main-layout/header.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/header.js +0 -15
- package/dist/ikoncomponents/main-layout/index.d.ts +0 -7
- package/dist/ikoncomponents/main-layout/index.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/index.js +0 -12
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +0 -61
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/main-sidebar.js +0 -119
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +0 -12
- package/dist/ikoncomponents/main-layout/nav-main.d.ts.map +0 -1
- package/dist/ikoncomponents/main-layout/nav-main.js +0 -33
- package/dist/ikoncomponents/multi-combobox/index.d.ts +0 -14
- package/dist/ikoncomponents/multi-combobox/index.d.ts.map +0 -1
- package/dist/ikoncomponents/multi-combobox/index.js +0 -202
- package/dist/ikoncomponents/no-data/index.d.ts +0 -4
- package/dist/ikoncomponents/no-data/index.d.ts.map +0 -1
- package/dist/ikoncomponents/no-data/index.js +0 -5
- package/dist/ikoncomponents/page-wrapper/index.d.ts +0 -10
- package/dist/ikoncomponents/page-wrapper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/page-wrapper/index.js +0 -7
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +0 -4
- package/dist/ikoncomponents/password-strength-meter/index.d.ts.map +0 -1
- package/dist/ikoncomponents/password-strength-meter/index.js +0 -40
- package/dist/ikoncomponents/phone-input/index.d.ts +0 -2
- package/dist/ikoncomponents/phone-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/phone-input/index.js +0 -41
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +0 -7
- package/dist/ikoncomponents/provider-wrapper/index.d.ts.map +0 -1
- package/dist/ikoncomponents/provider-wrapper/index.js +0 -10
- package/dist/ikoncomponents/search-input/index.d.ts +0 -2
- package/dist/ikoncomponents/search-input/index.d.ts.map +0 -1
- package/dist/ikoncomponents/search-input/index.js +0 -19
- package/dist/ikoncomponents/sheet/index.d.ts +0 -11
- package/dist/ikoncomponents/sheet/index.d.ts.map +0 -1
- package/dist/ikoncomponents/sheet/index.js +0 -6
- package/dist/ikoncomponents/simple-widget/index.d.ts +0 -15
- package/dist/ikoncomponents/simple-widget/index.d.ts.map +0 -1
- package/dist/ikoncomponents/simple-widget/index.js +0 -14
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +0 -6
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts.map +0 -1
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +0 -6
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +0 -4
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts.map +0 -1
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +0 -5
- package/dist/ikoncomponents/tabs/index.d.ts +0 -3
- package/dist/ikoncomponents/tabs/index.d.ts.map +0 -1
- package/dist/ikoncomponents/tabs/index.js +0 -50
- package/dist/ikoncomponents/tabs/type.d.ts.map +0 -1
- package/dist/ikoncomponents/tabs/type.js +0 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +0 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts.map +0 -1
- package/dist/ikoncomponents/title-progress/index.d.ts +0 -13
- package/dist/ikoncomponents/title-progress/index.d.ts.map +0 -1
- package/dist/ikoncomponents/title-progress/index.js +0 -10
- package/dist/ikoncomponents/tooltip/index.d.ts +0 -6
- package/dist/ikoncomponents/tooltip/index.d.ts.map +0 -1
- package/dist/ikoncomponents/tooltip/index.js +0 -5
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.d.ts +0 -10
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.d.ts.map +0 -1
- package/dist/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.js +0 -24
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +0 -32
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts.map +0 -1
- package/dist/ikoncomponents/twolevel-dropdown/index.js +0 -143
- package/dist/ikoncomponents/upload-tab/index.d.ts +0 -2
- package/dist/ikoncomponents/upload-tab/index.d.ts.map +0 -1
- package/dist/ikoncomponents/upload-tab/index.js +0 -92
- package/dist/ikoncomponents/widgets/index.d.ts +0 -3
- package/dist/ikoncomponents/widgets/index.d.ts.map +0 -1
- package/dist/ikoncomponents/widgets/index.js +0 -14
- package/dist/ikoncomponents/widgets/type.d.ts +0 -11
- package/dist/ikoncomponents/widgets/type.d.ts.map +0 -1
- package/dist/ikoncomponents/widgets/type.js +0 -2
- package/dist/ikoncomponents/work-in-progress/index.d.ts +0 -2
- package/dist/ikoncomponents/work-in-progress/index.d.ts.map +0 -1
- package/dist/ikoncomponents/work-in-progress/index.js +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/shadcn/accordion.d.ts +0 -8
- package/dist/shadcn/accordion.d.ts.map +0 -1
- package/dist/shadcn/accordion.js +0 -33
- package/dist/shadcn/alert-dialog.d.ts +0 -21
- package/dist/shadcn/alert-dialog.d.ts.map +0 -1
- package/dist/shadcn/alert-dialog.js +0 -83
- package/dist/shadcn/alert.d.ts +0 -10
- package/dist/shadcn/alert.d.ts.map +0 -1
- package/dist/shadcn/alert.js +0 -38
- package/dist/shadcn/aspect-ratio.d.ts +0 -4
- package/dist/shadcn/aspect-ratio.d.ts.map +0 -1
- package/dist/shadcn/aspect-ratio.js +0 -19
- package/dist/shadcn/avatar.d.ts +0 -7
- package/dist/shadcn/avatar.d.ts.map +0 -1
- package/dist/shadcn/avatar.js +0 -28
- package/dist/shadcn/badge.d.ts +0 -10
- package/dist/shadcn/badge.d.ts.map +0 -1
- package/dist/shadcn/badge.js +0 -35
- package/dist/shadcn/breadcrumb.d.ts +0 -12
- package/dist/shadcn/breadcrumb.d.ts.map +0 -1
- package/dist/shadcn/breadcrumb.js +0 -45
- package/dist/shadcn/button.d.ts +0 -11
- package/dist/shadcn/button.d.ts.map +0 -1
- package/dist/shadcn/button.js +0 -47
- package/dist/shadcn/calendar.d.ts +0 -9
- package/dist/shadcn/calendar.d.ts.map +0 -1
- package/dist/shadcn/calendar.js +0 -61
- package/dist/shadcn/card.d.ts +0 -10
- package/dist/shadcn/card.d.ts.map +0 -1
- package/dist/shadcn/card.js +0 -42
- package/dist/shadcn/checkbox.d.ts +0 -5
- package/dist/shadcn/checkbox.d.ts.map +0 -1
- package/dist/shadcn/checkbox.js +0 -21
- package/dist/shadcn/collapsible.d.ts +0 -6
- package/dist/shadcn/collapsible.d.ts.map +0 -1
- package/dist/shadcn/collapsible.js +0 -27
- package/dist/shadcn/command.d.ts +0 -19
- package/dist/shadcn/command.d.ts.map +0 -1
- package/dist/shadcn/command.js +0 -54
- package/dist/shadcn/date-input.d.ts +0 -8
- package/dist/shadcn/date-input.d.ts.map +0 -1
- package/dist/shadcn/date-input.js +0 -179
- package/dist/shadcn/date-range-picker.d.ts +0 -25
- package/dist/shadcn/date-range-picker.d.ts.map +0 -1
- package/dist/shadcn/date-range-picker.js +0 -45
- package/dist/shadcn/dialog.d.ts +0 -16
- package/dist/shadcn/dialog.d.ts.map +0 -1
- package/dist/shadcn/dialog.js +0 -57
- package/dist/shadcn/drawer.d.ts +0 -14
- package/dist/shadcn/drawer.d.ts.map +0 -1
- package/dist/shadcn/drawer.js +0 -56
- package/dist/shadcn/dropdown-menu.d.ts +0 -26
- package/dist/shadcn/dropdown-menu.d.ts.map +0 -1
- package/dist/shadcn/dropdown-menu.js +0 -77
- package/dist/shadcn/form.d.ts +0 -25
- package/dist/shadcn/form.d.ts.map +0 -1
- package/dist/shadcn/form.js +0 -70
- package/dist/shadcn/hover-card.d.ts +0 -7
- package/dist/shadcn/hover-card.d.ts.map +0 -1
- package/dist/shadcn/hover-card.js +0 -28
- package/dist/shadcn/input-otp.d.ts +0 -35
- package/dist/shadcn/input-otp.d.ts.map +0 -1
- package/dist/shadcn/input-otp.js +0 -40
- package/dist/shadcn/input.d.ts +0 -4
- package/dist/shadcn/input.d.ts.map +0 -1
- package/dist/shadcn/input.js +0 -18
- package/dist/shadcn/label.d.ts +0 -5
- package/dist/shadcn/label.d.ts.map +0 -1
- package/dist/shadcn/label.js +0 -20
- package/dist/shadcn/navigation-menu.d.ts +0 -17
- package/dist/shadcn/navigation-menu.d.ts.map +0 -1
- package/dist/shadcn/navigation-menu.js +0 -74
- package/dist/shadcn/popover.d.ts +0 -8
- package/dist/shadcn/popover.d.ts.map +0 -1
- package/dist/shadcn/popover.js +0 -32
- package/dist/shadcn/progress.d.ts +0 -9
- package/dist/shadcn/progress.d.ts.map +0 -1
- package/dist/shadcn/progress.js +0 -23
- package/dist/shadcn/radio-group.d.ts +0 -6
- package/dist/shadcn/radio-group.d.ts.map +0 -1
- package/dist/shadcn/radio-group.js +0 -25
- package/dist/shadcn/scroll-area.d.ts +0 -6
- package/dist/shadcn/scroll-area.d.ts.map +0 -1
- package/dist/shadcn/scroll-area.js +0 -26
- package/dist/shadcn/select.d.ts +0 -16
- package/dist/shadcn/select.d.ts.map +0 -1
- package/dist/shadcn/select.js +0 -59
- package/dist/shadcn/separator.d.ts +0 -5
- package/dist/shadcn/separator.d.ts.map +0 -1
- package/dist/shadcn/separator.js +0 -20
- package/dist/shadcn/sheet.d.ts +0 -14
- package/dist/shadcn/sheet.d.ts.map +0 -1
- package/dist/shadcn/sheet.js +0 -61
- package/dist/shadcn/sidebar.d.ts +0 -70
- package/dist/shadcn/sidebar.d.ts.map +0 -1
- package/dist/shadcn/sidebar.js +0 -242
- package/dist/shadcn/skeleton.d.ts +0 -4
- package/dist/shadcn/skeleton.d.ts.map +0 -1
- package/dist/shadcn/skeleton.js +0 -18
- package/dist/shadcn/slider.d.ts +0 -5
- package/dist/shadcn/slider.d.ts.map +0 -1
- package/dist/shadcn/slider.js +0 -26
- package/dist/shadcn/sonner.d.ts +0 -4
- package/dist/shadcn/sonner.d.ts.map +0 -1
- package/dist/shadcn/sonner.js +0 -25
- package/dist/shadcn/switch.d.ts +0 -5
- package/dist/shadcn/switch.d.ts.map +0 -1
- package/dist/shadcn/switch.js +0 -20
- package/dist/shadcn/table.d.ts +0 -11
- package/dist/shadcn/table.d.ts.map +0 -1
- package/dist/shadcn/table.js +0 -47
- package/dist/shadcn/tabs.d.ts +0 -8
- package/dist/shadcn/tabs.d.ts.map +0 -1
- package/dist/shadcn/tabs.js +0 -32
- package/dist/shadcn/textarea.d.ts +0 -4
- package/dist/shadcn/textarea.d.ts.map +0 -1
- package/dist/shadcn/textarea.js +0 -18
- package/dist/shadcn/toggle-group.d.ts +0 -10
- package/dist/shadcn/toggle-group.d.ts.map +0 -1
- package/dist/shadcn/toggle-group.js +0 -35
- package/dist/shadcn/toggle.d.ts +0 -10
- package/dist/shadcn/toggle.d.ts.map +0 -1
- package/dist/shadcn/toggle.js +0 -38
- package/dist/shadcn/tooltip.d.ts +0 -8
- package/dist/shadcn/tooltip.d.ts.map +0 -1
- package/dist/shadcn/tooltip.js +0 -32
- package/dist/shadcn/workflow.d.ts +0 -21
- package/dist/shadcn/workflow.d.ts.map +0 -1
- package/dist/shadcn/workflow.js +0 -20
- package/dist/styles.css +0 -1302
- package/dist/utils/actions/account/index.d.ts +0 -6
- package/dist/utils/actions/account/index.d.ts.map +0 -1
- package/dist/utils/actions/account/index.js +0 -28
- package/dist/utils/actions/account/type.d.ts +0 -5
- package/dist/utils/actions/account/type.d.ts.map +0 -1
- package/dist/utils/actions/account/type.js +0 -1
- package/dist/utils/actions/auth/index.d.ts +0 -8
- package/dist/utils/actions/auth/index.d.ts.map +0 -1
- package/dist/utils/actions/common/revalidate.d.ts +0 -3
- package/dist/utils/actions/common/revalidate.d.ts.map +0 -1
- package/dist/utils/actions/common/revalidate.js +0 -14
- package/dist/utils/actions/common/type.d.ts +0 -5
- package/dist/utils/actions/common/type.d.ts.map +0 -1
- package/dist/utils/actions/common/type.js +0 -1
- package/dist/utils/actions/common/utils.d.ts +0 -6
- package/dist/utils/actions/common/utils.d.ts.map +0 -1
- package/dist/utils/actions/software/index.d.ts +0 -12
- package/dist/utils/actions/software/index.d.ts.map +0 -1
- package/dist/utils/actions/software/index.js +0 -75
- package/dist/utils/api/accountService/index.d.ts +0 -24
- package/dist/utils/api/accountService/index.d.ts.map +0 -1
- package/dist/utils/api/accountService/index.js +0 -64
- package/dist/utils/api/accountService/type.d.ts +0 -5
- package/dist/utils/api/accountService/type.d.ts.map +0 -1
- package/dist/utils/api/accountService/type.js +0 -1
- package/dist/utils/api/file-upload/index.d.ts +0 -6
- package/dist/utils/api/file-upload/index.d.ts.map +0 -1
- package/dist/utils/api/file-upload/index.js +0 -80
- package/dist/utils/api/file-upload/type.d.ts +0 -7
- package/dist/utils/api/file-upload/type.d.ts.map +0 -1
- package/dist/utils/api/file-upload/type.js +0 -1
- package/dist/utils/api/ikonBaseApi.d.ts +0 -13
- package/dist/utils/api/ikonBaseApi.d.ts.map +0 -1
- package/dist/utils/api/loginService/index.d.ts +0 -13
- package/dist/utils/api/loginService/index.d.ts.map +0 -1
- package/dist/utils/api/loginService/index.js +0 -72
- package/dist/utils/api/loginService/type.d.ts.map +0 -1
- package/dist/utils/api/loginService/type.js +0 -1
- package/dist/utils/api/softwareService/index.d.ts +0 -65
- package/dist/utils/api/softwareService/index.d.ts.map +0 -1
- package/dist/utils/api/softwareService/index.js +0 -212
- package/dist/utils/api/softwareService/type.d.ts +0 -55
- package/dist/utils/api/softwareService/type.d.ts.map +0 -1
- package/dist/utils/api/softwareService/type.js +0 -1
- package/dist/utils/border-radius-provider.d.ts +0 -12
- package/dist/utils/border-radius-provider.d.ts.map +0 -1
- package/dist/utils/cn.d.ts +0 -3
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.js +0 -5
- package/dist/utils/font-provider.d.ts +0 -12
- package/dist/utils/font-provider.d.ts.map +0 -1
- package/dist/utils/session/cookieSession.d.ts +0 -9
- package/dist/utils/session/cookieSession.d.ts.map +0 -1
- package/dist/utils/session/cookieSession.js +0 -33
- package/dist/utils/theme-provider/index.d.ts +0 -4
- package/dist/utils/theme-provider/index.d.ts.map +0 -1
- package/dist/utils/theme-provider/index.js +0 -18
- package/dist/utils/token-management/index.d.ts +0 -11
- package/dist/utils/token-management/index.d.ts.map +0 -1
- package/dist/utils/token-management/index.js +0 -69
- package/dist/utils/token-management/types.d.ts +0 -7
- package/dist/utils/token-management/types.d.ts.map +0 -1
- package/dist/utils/token-management/types.js +0 -1
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Input } from '../../../shadcn/input';
|
|
3
|
-
import { Label } from '../../../shadcn/label';
|
|
4
|
-
import { ToggleGroup, ToggleGroupItem } from '../../../shadcn/toggle-group';
|
|
5
|
-
import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, FileImage, ImageIcon, RotateCcw, RotateCw, Square, ZoomIn, ZoomOut } from 'lucide-react';
|
|
6
|
-
import { memo, useEffect, useState } from 'react';
|
|
7
|
-
import { ImageCropper } from '../image-cropper';
|
|
8
|
-
import Image from 'next/image';
|
|
9
|
-
import { AspectRatio } from '../../../shadcn/aspect-ratio';
|
|
10
|
-
import { TextButton } from '../../buttons';
|
|
11
|
-
import { toast } from 'sonner';
|
|
12
|
-
import { FileInput } from '../../file-input';
|
|
13
|
-
import { useImageCropper } from '..';
|
|
14
|
-
const stateWiseAspectRatio = {
|
|
15
|
-
landscape: 4 / 3,
|
|
16
|
-
potrait: 3 / 4,
|
|
17
|
-
icon: 1 / 1
|
|
18
|
-
};
|
|
19
|
-
function CropperFormComponent({ onNewFileUpload }) {
|
|
20
|
-
const { originalImage, setOriginalImage, aspectRatioWiseImages, setAspectRatioWiseImages } = useImageCropper();
|
|
21
|
-
const [croppedImage, setCroppedImage] = useState(null);
|
|
22
|
-
const [activeState, setActiveState] = useState();
|
|
23
|
-
const [rotationAngle, setRotationAngle] = useState(0);
|
|
24
|
-
const [scale, setScale] = useState(1);
|
|
25
|
-
const [moveDirection, setMoveDirection] = useState({
|
|
26
|
-
x: 0,
|
|
27
|
-
y: 0,
|
|
28
|
-
});
|
|
29
|
-
const [imageSrc, setImageSrc] = useState(null);
|
|
30
|
-
const handleDrop = (event) => {
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
handleFileChange(event.dataTransfer.files[0]);
|
|
33
|
-
};
|
|
34
|
-
const handleFileChange = (file) => {
|
|
35
|
-
var _a;
|
|
36
|
-
if (typeof file === "string") {
|
|
37
|
-
setImageSrc(file);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
if ((_a = file === null || file === void 0 ? void 0 : file.type) === null || _a === void 0 ? void 0 : _a.startsWith("image/")) {
|
|
41
|
-
onNewFileUpload === null || onNewFileUpload === void 0 ? void 0 : onNewFileUpload();
|
|
42
|
-
const reader = new FileReader();
|
|
43
|
-
reader.onloadend = () => {
|
|
44
|
-
setImageSrc(reader.result);
|
|
45
|
-
setActiveState(undefined);
|
|
46
|
-
};
|
|
47
|
-
reader.readAsDataURL(file);
|
|
48
|
-
setOriginalImage(Object.assign(Object.assign({}, originalImage), { image: file, name: file.name }));
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
toast.error("Please select a valid image file.");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (originalImage.image) {
|
|
57
|
-
handleFileChange(originalImage.image);
|
|
58
|
-
}
|
|
59
|
-
}, [originalImage.image]);
|
|
60
|
-
const getImagePreview = (state) => {
|
|
61
|
-
const imgSource = croppedImage && activeState === state ? croppedImage : aspectRatioWiseImages[state];
|
|
62
|
-
return (_jsxs(_Fragment, { children: [_jsx("h3", { className: 'mb-3', children: state }), _jsx(AspectRatio, { ratio: stateWiseAspectRatio[state], className: 'bg-muted', children: imgSource &&
|
|
63
|
-
_jsx(Image, { src: imgSource || "", alt: `Preview ${state}`, fill: true }) })] }));
|
|
64
|
-
};
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
if (croppedImage) {
|
|
67
|
-
if (activeState) {
|
|
68
|
-
setAspectRatioWiseImages(Object.assign(Object.assign({}, aspectRatioWiseImages), { [activeState]: croppedImage }));
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
setAspectRatioWiseImages({
|
|
72
|
-
landscape: croppedImage,
|
|
73
|
-
potrait: croppedImage,
|
|
74
|
-
icon: croppedImage
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}, [croppedImage]);
|
|
79
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: 'flex flex-col gap-3 h-full overflow-auto', children: [_jsxs("div", { className: 'flex flex-col lg:flex-row gap-3 justify-between', children: [_jsxs("div", { className: 'w-full flex flex-col gap-4', children: [_jsx(Label, { htmlFor: "imageName", children: "Image Name" }), _jsx(FileInput, { id: "inputImage", accept: "image/*", fileNamePlaceholder: "Enter image name", fileName: (originalImage === null || originalImage === void 0 ? void 0 : originalImage.name) || "", onChange: (e) => {
|
|
80
|
-
var _a;
|
|
81
|
-
const file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
82
|
-
if (file) {
|
|
83
|
-
handleFileChange(file);
|
|
84
|
-
}
|
|
85
|
-
}, onFileNameChange: (e) => {
|
|
86
|
-
setOriginalImage(Object.assign(Object.assign({}, originalImage), { name: e.target.value }));
|
|
87
|
-
} })] }), _jsxs("div", { className: 'w-full flex flex-col gap-4', children: [_jsx(Label, { htmlFor: "imageDescription", children: "Image Description" }), _jsx(Input, { id: "imageDescription", placeholder: "Enter image Description", value: (originalImage === null || originalImage === void 0 ? void 0 : originalImage.description) || "", onChange: (e) => setOriginalImage(Object.assign(Object.assign({}, originalImage), { description: e.target.value })) })] })] }), _jsxs("div", { className: 'flex flex-col lg:flex-row gap-3', children: [_jsxs("div", { className: 'flex-grow flex flex-col gap-3', children: [_jsxs("div", { children: [_jsx("h3", { className: 'mb-3', children: "Original Image" }), _jsx(AspectRatio, { ratio: 4 / 3, className: 'flex justify-center items-center bg-muted text-muted-foreground', onDrop: handleDrop, onDragOver: (e) => e.preventDefault(), children: imageSrc ?
|
|
88
|
-
_jsx(ImageCropper, { src: imageSrc, onCroppedImage: setCroppedImage, aspectRatio: stateWiseAspectRatio[activeState || "icon"], rotationAngle: rotationAngle, zoomLevel: scale, moveDirection: moveDirection })
|
|
89
|
-
:
|
|
90
|
-
_jsxs("div", { className: "text-center", children: [_jsx(Label, { htmlFor: "inputImage", children: "Drag and drop an image here" }), _jsx("div", { className: "mt-3", children: _jsx(TextButton, { variant: "outline", onClick: () => { var _a; return (_a = document.getElementById("inputImage")) === null || _a === void 0 ? void 0 : _a.click(); }, children: "Browse Image" }) })] }) })] }), _jsxs("div", { className: "flex flex-col lg:flex-row gap-3 justify-between", children: [_jsx("div", { children: _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: activeState, onValueChange: (value) => setActiveState(value), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "landscape", children: _jsx(ImageIcon, {}) }), _jsx(ToggleGroupItem, { className: "rounded-none border-x-0", value: "potrait", children: _jsx(FileImage, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none', value: "icon", children: _jsx(Square, {}) })] }) }), _jsxs("div", { className: 'flex flex-col lg:flex-row gap-3 justify-between', children: [_jsxs(ToggleGroup, { type: "single", variant: 'outline', value: "", onValueChange: (value) => setRotationAngle(parseInt(value)), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "90", children: _jsx(RotateCw, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none border-s-0', value: "-90", children: _jsx(RotateCcw, {}) })] }), _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: '', children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "up", onClick: () => setMoveDirection({ x: 0, y: -5 }), children: _jsx(ArrowUp, {}) }), _jsx(ToggleGroupItem, { className: "rounded-none border-x-0", value: "down", onClick: () => setMoveDirection({ x: 0, y: 5 }), children: _jsx(ArrowDown, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-none border-e-0', value: "left", onClick: () => setMoveDirection({ x: -5, y: 0 }), children: _jsx(ArrowLeft, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none', value: "right", onClick: () => setMoveDirection({ x: 5, y: 0 }), children: _jsx(ArrowRight, {}) })] }), _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: "", onValueChange: (value) => setScale(pre => pre + parseFloat(value)), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "0.1", children: _jsx(ZoomIn, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none border-s-0', value: "-0.1", children: _jsx(ZoomOut, {}) })] })] })] })] }), _jsxs("div", { className: "flex flex-row lg:flex-col gap-3 w-full lg:w-48", children: [_jsx("div", { className: 'w-5/5', children: getImagePreview("landscape") }), _jsx("div", { className: 'w-4/5', children: getImagePreview("potrait") }), _jsx("div", { className: 'w-3/5', children: getImagePreview("icon") })] })] })] }) }));
|
|
91
|
-
}
|
|
92
|
-
export const CropperForm = memo(CropperFormComponent);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AspectRatioWiseImagesProps, OriginalImageProps } from '..';
|
|
2
|
-
export declare function CropperFormWithModal({ open, onOpenChange, onCropperChange }: Readonly<{
|
|
3
|
-
open: boolean;
|
|
4
|
-
onOpenChange: (open: boolean) => void;
|
|
5
|
-
onCropperChange: (originalImage: OriginalImageProps, aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
6
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAmB,MAAM,IAAI,CAAA;AAEpF,wBAAgB,oBAAoB,CAC/B,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,EACpC,QAAQ,CAAC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAAC,eAAe,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,0BAA0B,KAAK,IAAI,CAAA;CAAE,CAAC,2CAsB1L"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '../../../shadcn/dialog';
|
|
3
|
-
import { CropperForm } from '../cropper-form';
|
|
4
|
-
import { TextButton } from '../../buttons';
|
|
5
|
-
import { useImageCropper } from '..';
|
|
6
|
-
export function CropperFormWithModal({ open, onOpenChange, onCropperChange }) {
|
|
7
|
-
const { originalImage, aspectRatioWiseImages } = useImageCropper();
|
|
8
|
-
return (_jsx(Dialog, { modal: true, open: open, onOpenChange: (isOpen) => {
|
|
9
|
-
onOpenChange(isOpen);
|
|
10
|
-
}, children: _jsxs(DialogContent, { className: "max-w-full lg:max-w-5xl max-h-full overflow-auto", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: "Image to upload" }) }), _jsx(CropperForm, {}), _jsx(DialogFooter, { children: _jsx(TextButton, { onClick: () => {
|
|
11
|
-
onCropperChange(originalImage, aspectRatioWiseImages);
|
|
12
|
-
onOpenChange(false);
|
|
13
|
-
}, children: "Save Changes" }) })] }) }));
|
|
14
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "cropperjs/dist/cropper.css";
|
|
3
|
-
export interface CropperImgProps {
|
|
4
|
-
src: 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
|
-
}
|
|
14
|
-
export declare const ImageCropper: React.NamedExoticComponent<CropperImgProps>;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ikoncomponents/image-cropper-upload/image-cropper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAE9E,OAAO,4BAA4B,CAAC;AAEpC,MAAM,WAAW,eAAe;IAC5B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AA2GD,eAAO,MAAM,YAAY,6CAA8B,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CropperUploadImagesInfoProps } from './utils';
|
|
3
|
-
export interface ImageCropperContextProps {
|
|
4
|
-
originalImage: OriginalImageProps;
|
|
5
|
-
setOriginalImage: (originalImage: OriginalImageProps) => void;
|
|
6
|
-
aspectRatioWiseImages: AspectRatioWiseImagesProps;
|
|
7
|
-
setAspectRatioWiseImages: (aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
8
|
-
}
|
|
9
|
-
export interface AspectRatioWiseImagesProps {
|
|
10
|
-
landscape: string | null;
|
|
11
|
-
potrait: string | null;
|
|
12
|
-
icon: string | null;
|
|
13
|
-
}
|
|
14
|
-
export interface OriginalImageProps {
|
|
15
|
-
image: string | File | null;
|
|
16
|
-
name?: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ImageCropperProps {
|
|
20
|
-
children: ReactNode;
|
|
21
|
-
uploadedImages: CropperUploadImagesInfoProps | null;
|
|
22
|
-
onCropperChange: (originalImage: OriginalImageProps, aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
23
|
-
modalOpen?: boolean;
|
|
24
|
-
onModalOpenChange?: (open: boolean) => void;
|
|
25
|
-
}
|
|
26
|
-
export declare function ImageCropperProvider({ children, uploadedImages, onCropperChange, modalOpen, onModalOpenChange }: ImageCropperProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare const useImageCropper: () => ImageCropperContextProps;
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ikoncomponents/image-cropper-upload/index.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAiB,SAAS,EAAmC,MAAM,OAAO,CAAA;AAExF,OAAO,EAAE,4BAA4B,EAAiC,MAAM,SAAS,CAAC;AAGtF,MAAM,WAAW,wBAAwB;IACrC,aAAa,EAAE,kBAAkB,CAAC;IAClC,gBAAgB,EAAE,CAAC,aAAa,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC9D,qBAAqB,EAAE,0BAA0B,CAAC;IAClD,wBAAwB,EAAE,CAAC,qBAAqB,EAAE,0BAA0B,KAAK,IAAI,CAAC;CACzF;AAGD,MAAM,WAAW,0BAA0B;IACvC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,EAAE,4BAA4B,GAAG,IAAI,CAAC;IACpD,eAAe,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAChH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAID,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,2CAiDlI;AAED,eAAO,MAAM,eAAe,QAAO,wBAMlC,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useEffect, useState } from 'react';
|
|
4
|
-
import { CropperFormWithModal } from './cropper-form-with-modal';
|
|
5
|
-
import { uploadedImagesToCropperImgObj } from './utils';
|
|
6
|
-
const ImageCropperContext = createContext(undefined);
|
|
7
|
-
export function ImageCropperProvider({ children, uploadedImages, onCropperChange, modalOpen, onModalOpenChange }) {
|
|
8
|
-
const [aspectRatioWiseImages, setAspectRatioWiseImages] = useState({
|
|
9
|
-
landscape: null,
|
|
10
|
-
potrait: null,
|
|
11
|
-
icon: null
|
|
12
|
-
});
|
|
13
|
-
const [originalImage, setOriginalImage] = useState({
|
|
14
|
-
image: null,
|
|
15
|
-
name: "",
|
|
16
|
-
description: "",
|
|
17
|
-
});
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
async function updateCropperImages() {
|
|
20
|
-
if (!uploadedImages)
|
|
21
|
-
return; // Prevent unnecessary processing
|
|
22
|
-
try {
|
|
23
|
-
const res = await uploadedImagesToCropperImgObj(uploadedImages);
|
|
24
|
-
if (res) {
|
|
25
|
-
// Check if state is different before updating
|
|
26
|
-
setOriginalImage((prev) => JSON.stringify(prev) === JSON.stringify(res.originalImage) ? prev : res.originalImage);
|
|
27
|
-
setAspectRatioWiseImages((prev) => JSON.stringify(prev) === JSON.stringify(res.aspectRatioWiseImages) ? prev : res.aspectRatioWiseImages);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
console.error("Error processing uploaded images:", error);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
updateCropperImages();
|
|
35
|
-
}, [uploadedImages]); // Runs only when `uploadedImages` changes
|
|
36
|
-
return (_jsxs(ImageCropperContext.Provider, { value: {
|
|
37
|
-
originalImage,
|
|
38
|
-
setOriginalImage,
|
|
39
|
-
aspectRatioWiseImages,
|
|
40
|
-
setAspectRatioWiseImages
|
|
41
|
-
}, children: [children, modalOpen && onModalOpenChange && _jsx(CropperFormWithModal, { open: modalOpen, onOpenChange: onModalOpenChange, onCropperChange: onCropperChange })] }));
|
|
42
|
-
}
|
|
43
|
-
export const useImageCropper = () => {
|
|
44
|
-
const context = useContext(ImageCropperContext);
|
|
45
|
-
if (!context) {
|
|
46
|
-
throw new Error("useImageCropper must be used within a ImageCropperProvider");
|
|
47
|
-
}
|
|
48
|
-
return context;
|
|
49
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AspectRatioWiseImagesProps, OriginalImageProps } from "..";
|
|
2
|
-
import { FileinfoProps } from "../../../utils/api/file-upload/type";
|
|
3
|
-
export interface CropperUploadImagesInfoProps {
|
|
4
|
-
originalImageInfo?: FileinfoProps | null;
|
|
5
|
-
imageName?: string;
|
|
6
|
-
imageDescription?: string;
|
|
7
|
-
landscapeImageInfo?: FileinfoProps | null;
|
|
8
|
-
portaitImageInfo?: FileinfoProps | null;
|
|
9
|
-
iconImageInfo?: FileinfoProps | null;
|
|
10
|
-
}
|
|
11
|
-
export interface UploadedImagesToCropperImgObjProps {
|
|
12
|
-
originalImage: OriginalImageProps;
|
|
13
|
-
aspectRatioWiseImages: AspectRatioWiseImagesProps;
|
|
14
|
-
}
|
|
15
|
-
export declare function imageCropperFilesUpload(originalImage: OriginalImageProps, aspectRatioWiseImages?: AspectRatioWiseImagesProps, resourceId?: string): Promise<CropperUploadImagesInfoProps | null>;
|
|
16
|
-
export declare function uploadedImagesToCropperImgObj(uploadedImages: CropperUploadImagesInfoProps | null): Promise<UploadedImagesToCropperImgObjProps | null>;
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ikoncomponents/image-cropper-upload/utils/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAGpE,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC1C,gBAAgB,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CACtC;AACD,MAAM,WAAW,kCAAkC;IACjD,aAAa,EAAE,kBAAkB,CAAC;IAClC,qBAAqB,EAAE,0BAA0B,CAAC;CACnD;AACD,wBAAsB,uBAAuB,CAC3C,aAAa,EAAE,kBAAkB,EACjC,qBAAqB,CAAC,EAAE,0BAA0B,EAClD,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,4BAA4B,GAAG,IAAI,CAAC,CAwD9C;AAED,wBAAsB,6BAA6B,CACjD,cAAc,EAAE,4BAA4B,GAAG,IAAI,GAClD,OAAO,CAAC,kCAAkC,GAAG,IAAI,CAAC,CAgCpD"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { base64FileUpload, singleFileUpload, } from "../../../utils/api/file-upload";
|
|
2
|
-
import { getResourceUrl } from "../../../utils/actions/common/utils";
|
|
3
|
-
export async function imageCropperFilesUpload(originalImage, aspectRatioWiseImages, resourceId) {
|
|
4
|
-
if (!originalImage.image) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
const originalImageInfo = await singleFileUpload(originalImage.image, resourceId);
|
|
8
|
-
const cropperUploadImagesInfo = {
|
|
9
|
-
originalImageInfo: originalImageInfo,
|
|
10
|
-
imageName: originalImage.name,
|
|
11
|
-
imageDescription: originalImage.description,
|
|
12
|
-
landscapeImageInfo: null,
|
|
13
|
-
portaitImageInfo: null,
|
|
14
|
-
iconImageInfo: null,
|
|
15
|
-
};
|
|
16
|
-
if (aspectRatioWiseImages) {
|
|
17
|
-
if (aspectRatioWiseImages.landscape) {
|
|
18
|
-
try {
|
|
19
|
-
cropperUploadImagesInfo["landscapeImageInfo"] = await base64FileUpload(aspectRatioWiseImages.landscape, originalImage.name + "_L.webp", "image/webp");
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
console.error(error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (aspectRatioWiseImages.potrait) {
|
|
26
|
-
try {
|
|
27
|
-
cropperUploadImagesInfo["portaitImageInfo"] = await base64FileUpload(aspectRatioWiseImages.potrait, originalImage.name + "_P.webp", "image/webp");
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
console.error(error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (aspectRatioWiseImages.icon) {
|
|
34
|
-
try {
|
|
35
|
-
cropperUploadImagesInfo["iconImageInfo"] = await base64FileUpload(aspectRatioWiseImages.icon, originalImage.name + "_I.webp", "image/webp");
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
console.error(error);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return cropperUploadImagesInfo;
|
|
43
|
-
}
|
|
44
|
-
export async function uploadedImagesToCropperImgObj(uploadedImages) {
|
|
45
|
-
if (!uploadedImages) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
const originalImageUrl = uploadedImages.originalImageInfo
|
|
49
|
-
? await getResourceUrl(uploadedImages.originalImageInfo)
|
|
50
|
-
: null;
|
|
51
|
-
const landscapeImageUrl = uploadedImages.landscapeImageInfo
|
|
52
|
-
? await getResourceUrl(uploadedImages.landscapeImageInfo)
|
|
53
|
-
: null;
|
|
54
|
-
const portaitImageUrl = uploadedImages.portaitImageInfo
|
|
55
|
-
? await getResourceUrl(uploadedImages.portaitImageInfo)
|
|
56
|
-
: null;
|
|
57
|
-
const iconImageUrl = uploadedImages.iconImageInfo
|
|
58
|
-
? await getResourceUrl(uploadedImages.iconImageInfo)
|
|
59
|
-
: null;
|
|
60
|
-
const obj = {
|
|
61
|
-
originalImage: {
|
|
62
|
-
image: originalImageUrl,
|
|
63
|
-
name: uploadedImages.imageName,
|
|
64
|
-
description: uploadedImages.imageDescription,
|
|
65
|
-
},
|
|
66
|
-
aspectRatioWiseImages: {
|
|
67
|
-
landscape: landscapeImageUrl,
|
|
68
|
-
potrait: portaitImageUrl,
|
|
69
|
-
icon: iconImageUrl,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
return obj;
|
|
73
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface ISVGProps extends React.SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number;
|
|
4
|
-
className?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface LoadingSpinnerProps extends ISVGProps {
|
|
7
|
-
visible?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const LoadingSpinner: ({ size, className, visible, ...props }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ikoncomponents/loading-spinner/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,GAAI,wCAK5B,mBAAmB,mDAwBrB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
-
import { cn } from "../../utils/cn";
|
|
14
|
-
export const LoadingSpinner = (_a) => {
|
|
15
|
-
var { size = 48, className, visible = true } = _a, props = __rest(_a, ["size", "className", "visible"]);
|
|
16
|
-
if (!visible)
|
|
17
|
-
return null;
|
|
18
|
-
return (_jsx("div", { className: "h-full w-full", children: _jsx("div", { className: "absolute inset-0 flex justify-center items-center z-50", children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: size, height: size }, props, { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: cn("animate-spin", className), children: _jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })) }) }));
|
|
19
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface RefreshContextType {
|
|
3
|
-
refresh: () => void;
|
|
4
|
-
refreshCounter: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function RefreshProvider({ children }: {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function useRefresh(): RefreshContextType;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=RefreshContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshContext.d.ts","sourceRoot":"","sources":["../../../src/ikoncomponents/main-layout/RefreshContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAEhF,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAID,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAY1E;AAED,wBAAgB,UAAU,uBAMzB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useState, useCallback } from 'react';
|
|
3
|
-
const RefreshContext = createContext(undefined);
|
|
4
|
-
export function RefreshProvider({ children }) {
|
|
5
|
-
const [refreshCounter, setRefreshCounter] = useState(0);
|
|
6
|
-
const refresh = useCallback(() => {
|
|
7
|
-
setRefreshCounter((prev) => prev + 1);
|
|
8
|
-
}, []);
|
|
9
|
-
return (_jsx(RefreshContext.Provider, { value: { refresh, refreshCounter }, children: children }));
|
|
10
|
-
}
|
|
11
|
-
export function useRefresh() {
|
|
12
|
-
const context = useContext(RefreshContext);
|
|
13
|
-
if (context === undefined) {
|
|
14
|
-
throw new Error('useRefresh must be used within a RefreshProvider');
|
|
15
|
-
}
|
|
16
|
-
return context;
|
|
17
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { LucideIcon } from 'lucide-react';
|
|
3
|
-
export interface SidebarNavSubItem {
|
|
4
|
-
title: string;
|
|
5
|
-
url: string;
|
|
6
|
-
isActive?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface SidebarNavItem {
|
|
9
|
-
title: string;
|
|
10
|
-
url: string;
|
|
11
|
-
icon?: LucideIcon;
|
|
12
|
-
isActive?: boolean;
|
|
13
|
-
default?: boolean;
|
|
14
|
-
items?: SidebarNavSubItem[];
|
|
15
|
-
header?: ReactNode;
|
|
16
|
-
footer?: ReactNode;
|
|
17
|
-
}
|
|
18
|
-
export interface SidebarNavContextType {
|
|
19
|
-
navItems: SidebarNavItem[];
|
|
20
|
-
header: ReactNode | null;
|
|
21
|
-
footer: ReactNode | null;
|
|
22
|
-
setNavItems: (items: SidebarNavItem[]) => void;
|
|
23
|
-
addNavItem: (item: SidebarNavItem) => void;
|
|
24
|
-
removeNavItem: (title: string) => void;
|
|
25
|
-
updateNavItem: (title: string, updates: Partial<SidebarNavItem>) => void;
|
|
26
|
-
clearNavItems: () => void;
|
|
27
|
-
setSidebarHeader: (header: ReactNode) => void;
|
|
28
|
-
setSidebarFooter: (footer: ReactNode) => void;
|
|
29
|
-
}
|
|
30
|
-
export declare function SidebarNavProvider({ children }: {
|
|
31
|
-
children: ReactNode;
|
|
32
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export declare function useSidebarNav(): SidebarNavContextType;
|
|
34
|
-
//# sourceMappingURL=SidebarNavContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarNavContext.d.ts","sourceRoot":"","sources":["../../../src/ikoncomponents/main-layout/SidebarNavContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,SAAS,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACzE,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IAC9C,gBAAgB,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;CACjD;AAID,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CA0DvE;AAED,wBAAgB,aAAa,0BAM5B"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useState } from 'react';
|
|
4
|
-
const SidebarNavContext = createContext(undefined);
|
|
5
|
-
export function SidebarNavProvider({ children }) {
|
|
6
|
-
const [navItems, setNavItems] = useState([]);
|
|
7
|
-
const [header, setHeader] = useState(null);
|
|
8
|
-
const [footer, setFooter] = useState(null);
|
|
9
|
-
const addNavItem = (item) => {
|
|
10
|
-
setNavItems((prevItems) => {
|
|
11
|
-
const exists = prevItems.some((navItem) => navItem.title === item.title);
|
|
12
|
-
if (exists) {
|
|
13
|
-
return prevItems.map((navItem) => navItem.title === item.title ? Object.assign(Object.assign({}, navItem), item) : navItem);
|
|
14
|
-
}
|
|
15
|
-
return [...prevItems, item];
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
const removeNavItem = (title) => {
|
|
19
|
-
setNavItems((prevItems) => prevItems.filter((item) => item.title !== title));
|
|
20
|
-
};
|
|
21
|
-
const updateNavItem = (title, updates) => {
|
|
22
|
-
setNavItems((prevItems) => prevItems.map((item) => item.title === title ? Object.assign(Object.assign({}, item), updates) : item));
|
|
23
|
-
};
|
|
24
|
-
const setSidebarHeader = (header) => {
|
|
25
|
-
setHeader(header);
|
|
26
|
-
};
|
|
27
|
-
const setSidebarFooter = (footer) => {
|
|
28
|
-
setFooter(footer);
|
|
29
|
-
};
|
|
30
|
-
const clearNavItems = () => {
|
|
31
|
-
setNavItems([]);
|
|
32
|
-
};
|
|
33
|
-
return (_jsx(SidebarNavContext.Provider, { value: {
|
|
34
|
-
navItems,
|
|
35
|
-
header,
|
|
36
|
-
footer,
|
|
37
|
-
setNavItems,
|
|
38
|
-
addNavItem,
|
|
39
|
-
removeNavItem,
|
|
40
|
-
updateNavItem,
|
|
41
|
-
clearNavItems,
|
|
42
|
-
setSidebarHeader,
|
|
43
|
-
setSidebarFooter,
|
|
44
|
-
}, children: children }));
|
|
45
|
-
}
|
|
46
|
-
export function useSidebarNav() {
|
|
47
|
-
const context = useContext(SidebarNavContext);
|
|
48
|
-
if (!context) {
|
|
49
|
-
throw new Error('useSidebarNav must be used within a SidebarNavProvider');
|
|
50
|
-
}
|
|
51
|
-
return context;
|
|
52
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../../src/ikoncomponents/main-layout/app-sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,OAAO,EAKR,MAAM,sBAAsB,CAAC;AAI9B,wBAAgB,UAAU,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,kDAsB5E"}
|
|
@@ -1,24 +0,0 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarRail, } from "../../shadcn/sidebar";
|
|
15
|
-
import { NavMain } from "./nav-main";
|
|
16
|
-
import { useSidebarNav } from "./SidebarNavContext";
|
|
17
|
-
export function AppSidebar(_a) {
|
|
18
|
-
var props = __rest(_a, []);
|
|
19
|
-
const { navItems, header, footer } = useSidebarNav();
|
|
20
|
-
if (!navItems || navItems.length === 0) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return (_jsxs(Sidebar, Object.assign({ className: "ml-12", collapsible: "offcanvas" }, props, { children: [header && _jsx(SidebarHeader, { children: header }), _jsx(SidebarContent, { children: _jsx(NavMain, {}) }), footer && _jsx(SidebarFooter, { children: footer }), _jsx(SidebarRail, {})] })));
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../src/ikoncomponents/main-layout/footer.tsx"],"names":[],"mappings":"AAGA,wBAAgB,MAAM,4CAgBrB"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Copyright } from "lucide-react";
|
|
3
|
-
export function Footer() {
|
|
4
|
-
return (_jsx("footer", { className: "ml-12 flex border-t px-4 py-2 justify-center lg:justify-start", children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(Copyright, { className: "size-4" }), _jsx("span", { children: "Powered By" }), _jsx("a", { href: "https://keross.com", target: "_blank", children: "Keross" }), _jsx("span", { className: "", children: "|" }), _jsx("span", { id: "txtCopyrightYear", className: "", children: new Date().getFullYear() })] }) }));
|
|
5
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/ikoncomponents/main-layout/header.tsx"],"names":[],"mappings":"AAYA,wBAAgB,MAAM,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,2CAwC9D"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AppBreadcrumb } from "../app-breadcrumb";
|
|
3
|
-
import { ThemeToggleBtn } from "../theme-toggle-btn";
|
|
4
|
-
import { Separator } from "../../shadcn/separator";
|
|
5
|
-
import { SidebarTrigger } from "../../shadcn/sidebar";
|
|
6
|
-
import { Bell, Play } from "lucide-react";
|
|
7
|
-
import { IconButtonWithTooltip, IconTextButton } from "../buttons";
|
|
8
|
-
import { useSidebarNav } from "./SidebarNavContext";
|
|
9
|
-
import Link from "next/link";
|
|
10
|
-
export function Header({ platformUrl }) {
|
|
11
|
-
const { navItems } = useSidebarNav();
|
|
12
|
-
return (_jsx("header", { className: "ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: _jsxs("div", { className: "flex items-center justify-between gap-2 px-4 w-full", children: [_jsxs("div", { className: "flex items-center gap-2", children: [(!navItems || navItems.length === 0) ? _jsx("div", {}) : _jsx(SidebarTrigger, { className: "-ml-1" }), (!navItems || navItems.length === 0) ?
|
|
13
|
-
_jsx("div", {}) :
|
|
14
|
-
_jsx(Separator, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }), _jsx(AppBreadcrumb, {})] }), _jsxs("div", { className: "ml-auto flex gap-4", children: [_jsx(IconButtonWithTooltip, { className: "px-2!", tooltipContent: "Notifications", children: _jsx(Bell, {}) }), _jsx(ThemeToggleBtn, {}), _jsx(Link, { href: `${platformUrl}/app-store`, children: _jsxs(IconTextButton, { variant: "default", children: [_jsx(Play, {}), "App Store"] }) })] })] }) }));
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ikoncomponents/main-layout/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUxC,wBAAgB,UAAU,CAAC,EACvB,QAAQ,EACR,OAAO,EACP,WAAW,EACd,EAAE;IACC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACvB,2CAwBA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { MainSidebar } from './main-sidebar';
|
|
3
|
-
import { SidebarInset, SidebarProvider } from '../../shadcn/sidebar';
|
|
4
|
-
import { DialogProvider } from '../alert-dialog/dialog-context';
|
|
5
|
-
import { AppSidebar } from './app-sidebar';
|
|
6
|
-
import { Header } from './header';
|
|
7
|
-
import { Footer } from './footer';
|
|
8
|
-
import { SidebarNavProvider } from './SidebarNavContext';
|
|
9
|
-
import { RefreshProvider } from './RefreshContext';
|
|
10
|
-
export function MainLayout({ children, baseUrl, platformUrl }) {
|
|
11
|
-
return (_jsx(_Fragment, { children: _jsxs(RefreshProvider, { children: [_jsx(MainSidebar, { baseUrl: baseUrl, platformUrl: platformUrl }), _jsx(SidebarProvider, { children: _jsx(DialogProvider, { children: _jsxs(SidebarNavProvider, { children: [_jsx(AppSidebar, {}), _jsxs(SidebarInset, { className: "flex flex-col h-screen", children: [_jsx(Header, { platformUrl: platformUrl }), _jsx("div", { className: "flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden", children: children }), _jsx(Footer, {})] })] }) }) })] }) }));
|
|
12
|
-
}
|