@vitnode/core 1.2.0-canary.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/LICENSE.md +21 -0
- package/dist/emails/my-email.d.ts +2 -0
- package/dist/emails/my-email.d.ts.map +1 -0
- package/dist/scripts/get-config.d.ts +3 -0
- package/dist/scripts/get-config.d.ts.map +1 -0
- package/dist/scripts/plugin.d.ts +4 -0
- package/dist/scripts/plugin.d.ts.map +1 -0
- package/dist/scripts/prepare-database.d.ts +7 -0
- package/dist/scripts/prepare-database.d.ts.map +1 -0
- package/dist/scripts/prepare-plugins-files.d.ts +2 -0
- package/dist/scripts/prepare-plugins-files.d.ts.map +1 -0
- package/dist/scripts/run-interactive-shell-command.d.ts +2 -0
- package/dist/scripts/run-interactive-shell-command.d.ts.map +1 -0
- package/dist/scripts/scripts.d.ts +3 -0
- package/dist/scripts/scripts.d.ts.map +1 -0
- package/dist/scripts/scripts.js +21 -0
- package/dist/scripts/shared/file-utils.d.ts +14 -0
- package/dist/scripts/shared/file-utils.d.ts.map +1 -0
- package/dist/src/api/config.d.ts +24 -0
- package/dist/src/api/config.d.ts.map +1 -0
- package/dist/src/api/config.js +50 -0
- package/dist/src/api/lib/check-plugin-id.d.ts +15 -0
- package/dist/src/api/lib/check-plugin-id.d.ts.map +1 -0
- package/dist/src/api/lib/check-plugin-id.js +15 -0
- package/dist/src/api/lib/get-user-ip.d.ts +3 -0
- package/dist/src/api/lib/get-user-ip.d.ts.map +1 -0
- package/dist/src/api/lib/get-user-ip.js +8 -0
- package/dist/src/api/lib/module.d.ts +23 -0
- package/dist/src/api/lib/module.d.ts.map +1 -0
- package/dist/src/api/lib/module.js +21 -0
- package/dist/src/api/lib/plugin.d.ts +11 -0
- package/dist/src/api/lib/plugin.d.ts.map +1 -0
- package/dist/src/api/lib/plugin.js +14 -0
- package/dist/src/api/lib/route.d.ts +26 -0
- package/dist/src/api/lib/route.d.ts.map +1 -0
- package/dist/src/api/lib/route.js +23 -0
- package/dist/src/api/lib/with-pagination.d.ts +72 -0
- package/dist/src/api/lib/with-pagination.d.ts.map +1 -0
- package/dist/src/api/lib/with-pagination.js +70 -0
- package/dist/src/api/middlewares/global/global.d.ts +66 -0
- package/dist/src/api/middlewares/global/global.d.ts.map +1 -0
- package/dist/src/api/middlewares/global/global.js +47 -0
- package/dist/src/api/models/device.d.ts +10 -0
- package/dist/src/api/models/device.d.ts.map +1 -0
- package/dist/src/api/models/device.js +54 -0
- package/dist/src/api/models/email.d.ts +22 -0
- package/dist/src/api/models/email.d.ts.map +1 -0
- package/dist/src/api/models/email.js +30 -0
- package/dist/src/api/models/password.d.ts +5 -0
- package/dist/src/api/models/password.d.ts.map +1 -0
- package/dist/src/api/models/password.js +21 -0
- package/dist/src/api/models/session-admin.d.ts +24 -0
- package/dist/src/api/models/session-admin.d.ts.map +1 -0
- package/dist/src/api/models/session-admin.js +73 -0
- package/dist/src/api/models/session.d.ts +23 -0
- package/dist/src/api/models/session.d.ts.map +1 -0
- package/dist/src/api/models/session.js +60 -0
- package/dist/src/api/models/sso.d.ts +38 -0
- package/dist/src/api/models/sso.d.ts.map +1 -0
- package/dist/src/api/models/sso.js +120 -0
- package/dist/src/api/models/user/get-user-by-id.d.ts +17 -0
- package/dist/src/api/models/user/get-user-by-id.d.ts.map +1 -0
- package/dist/src/api/models/user/get-user-by-id.js +18 -0
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts +10 -0
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts.map +1 -0
- package/dist/src/api/models/user/sign-in-with-passwords.js +22 -0
- package/dist/src/api/models/user/sign-up.d.ts +21 -0
- package/dist/src/api/models/user/sign-up.d.ts.map +1 -0
- package/dist/src/api/models/user/sign-up.js +75 -0
- package/dist/src/api/models/user.d.ts +45 -0
- package/dist/src/api/models/user.d.ts.map +1 -0
- package/dist/src/api/models/user.js +8 -0
- package/dist/src/api/modules/admin/admin.module.d.ts +294 -0
- package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/admin.module.js +14 -0
- package/dist/src/api/modules/admin/routes/session.route.d.ts +108 -0
- package/dist/src/api/modules/admin/routes/session.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/routes/session.route.js +51 -0
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts +190 -0
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/users/routes/list.route.js +79 -0
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +193 -0
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/users/routes/users.route.js +84 -0
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts +189 -0
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/users/users.admin.module.js +10 -0
- package/dist/src/api/modules/middleware/middleware.module.d.ts +52 -0
- package/dist/src/api/modules/middleware/middleware.module.d.ts.map +1 -0
- package/dist/src/api/modules/middleware/middleware.module.js +10 -0
- package/dist/src/api/modules/middleware/route.d.ts +53 -0
- package/dist/src/api/modules/middleware/route.d.ts.map +1 -0
- package/dist/src/api/modules/middleware/route.js +39 -0
- package/dist/src/api/modules/users/avatar-color.d.ts +2 -0
- package/dist/src/api/modules/users/avatar-color.d.ts.map +1 -0
- package/dist/src/api/modules/users/avatar-color.js +43 -0
- package/dist/src/api/modules/users/routes/session.route.d.ts +103 -0
- package/dist/src/api/modules/users/routes/session.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/session.route.js +46 -0
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts +88 -0
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/sign-in.route.js +71 -0
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts +47 -0
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/sign-out.route.js +43 -0
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +89 -0
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/sign-up.route.js +60 -0
- package/dist/src/api/modules/users/routes/test.route.d.ts +31 -0
- package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/test.route.js +32 -0
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +78 -0
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/sso/routes/callback.route.js +49 -0
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +51 -0
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +36 -0
- package/dist/src/api/modules/users/sso/sso.module.d.ts +125 -0
- package/dist/src/api/modules/users/sso/sso.module.d.ts.map +1 -0
- package/dist/src/api/modules/users/sso/sso.module.js +12 -0
- package/dist/src/api/modules/users/users.module.d.ts +439 -0
- package/dist/src/api/modules/users/users.module.d.ts.map +1 -0
- package/dist/src/api/modules/users/users.module.js +22 -0
- package/dist/src/api/plugin.d.ts +2 -0
- package/dist/src/api/plugin.d.ts.map +1 -0
- package/dist/src/api/plugin.js +13 -0
- package/dist/src/api/plugins/email/nodemailer.d.ts +10 -0
- package/dist/src/api/plugins/email/nodemailer.d.ts.map +1 -0
- package/dist/src/api/plugins/email/nodemailer.js +30 -0
- package/dist/src/api/plugins/email/resend.d.ts +6 -0
- package/dist/src/api/plugins/email/resend.d.ts.map +1 -0
- package/dist/src/api/plugins/email/resend.js +21 -0
- package/dist/src/api/plugins/sso/discord.d.ts +6 -0
- package/dist/src/api/plugins/sso/discord.d.ts.map +1 -0
- package/dist/src/api/plugins/sso/discord.js +77 -0
- package/dist/src/api/plugins/sso/facebook.d.ts +6 -0
- package/dist/src/api/plugins/sso/facebook.d.ts.map +1 -0
- package/dist/src/api/plugins/sso/facebook.js +76 -0
- package/dist/src/api/plugins/sso/google.d.ts +6 -0
- package/dist/src/api/plugins/sso/google.d.ts.map +1 -0
- package/dist/src/api/plugins/sso/google.js +87 -0
- package/dist/src/app/login/page.d.ts +6 -0
- package/dist/src/app/login/page.d.ts.map +1 -0
- package/dist/src/app/login/page.js +15 -0
- package/dist/src/app/login/sso/[providerId]/page.d.ts +7 -0
- package/dist/src/app/login/sso/[providerId]/page.d.ts.map +1 -0
- package/dist/src/app/login/sso/[providerId]/page.js +10 -0
- package/dist/src/app/register/page.d.ts +6 -0
- package/dist/src/app/register/page.d.ts.map +1 -0
- package/dist/src/app/register/page.js +15 -0
- package/dist/src/app_admin/core/page.d.ts +2 -0
- package/dist/src/app_admin/core/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/page.js +5 -0
- package/dist/src/app_admin/core/test/page.d.ts +2 -0
- package/dist/src/app_admin/core/test/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/test/page.js +5 -0
- package/dist/src/app_admin/core/users/page.d.ts +6 -0
- package/dist/src/app_admin/core/users/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/users/page.js +35 -0
- package/dist/src/components/avatar.d.ts +10 -0
- package/dist/src/components/avatar.d.ts.map +1 -0
- package/dist/src/components/avatar.js +14 -0
- package/dist/src/components/date-format.d.ts +5 -0
- package/dist/src/components/date-format.d.ts.map +1 -0
- package/dist/src/components/date-format.js +38 -0
- package/dist/src/components/form/auto-form.d.ts +12 -0
- package/dist/src/components/form/auto-form.d.ts.map +1 -0
- package/dist/src/components/form/auto-form.js +57 -0
- package/dist/src/components/form/common/desc.d.ts +2 -0
- package/dist/src/components/form/common/desc.d.ts.map +1 -0
- package/dist/src/components/form/common/desc.js +9 -0
- package/dist/src/components/form/common/label.d.ts +3 -0
- package/dist/src/components/form/common/label.d.ts.map +1 -0
- package/dist/src/components/form/common/label.js +8 -0
- package/dist/src/components/form/fields/checkbox.d.ts +8 -0
- package/dist/src/components/form/fields/checkbox.d.ts.map +1 -0
- package/dist/src/components/form/fields/checkbox.js +35 -0
- package/dist/src/components/form/fields/combobox.d.ts +14 -0
- package/dist/src/components/form/fields/combobox.d.ts.map +1 -0
- package/dist/src/components/form/fields/combobox.js +88 -0
- package/dist/src/components/form/fields/input.d.ts +9 -0
- package/dist/src/components/form/fields/input.d.ts.map +1 -0
- package/dist/src/components/form/fields/input.js +34 -0
- package/dist/src/components/form/fields/item.d.ts +14 -0
- package/dist/src/components/form/fields/item.d.ts.map +1 -0
- package/dist/src/components/form/fields/item.js +22 -0
- package/dist/src/components/form/fields/radio-group.d.ts +13 -0
- package/dist/src/components/form/fields/radio-group.d.ts.map +1 -0
- package/dist/src/components/form/fields/radio-group.js +51 -0
- package/dist/src/components/form/fields/select.d.ts +14 -0
- package/dist/src/components/form/fields/select.d.ts.map +1 -0
- package/dist/src/components/form/fields/select.js +59 -0
- package/dist/src/components/form/fields/switch.d.ts +8 -0
- package/dist/src/components/form/fields/switch.d.ts.map +1 -0
- package/dist/src/components/form/fields/switch.js +35 -0
- package/dist/src/components/form/fields/textarea.d.ts +9 -0
- package/dist/src/components/form/fields/textarea.d.ts.map +1 -0
- package/dist/src/components/form/fields/textarea.js +34 -0
- package/dist/src/components/i18n-provider.d.ts +7 -0
- package/dist/src/components/i18n-provider.d.ts.map +1 -0
- package/dist/src/components/i18n-provider.js +43 -0
- package/dist/src/components/logo-vitnode.d.ts +4 -0
- package/dist/src/components/logo-vitnode.d.ts.map +1 -0
- package/dist/src/components/logo-vitnode.js +113 -0
- package/dist/src/components/switchers/theme-switcher.d.ts +2 -0
- package/dist/src/components/switchers/theme-switcher.d.ts.map +1 -0
- package/dist/src/components/switchers/theme-switcher.js +25 -0
- package/dist/src/components/table/content.d.ts +3 -0
- package/dist/src/components/table/content.d.ts.map +1 -0
- package/dist/src/components/table/content.js +84 -0
- package/dist/src/components/table/data-table.d.ts +37 -0
- package/dist/src/components/table/data-table.d.ts.map +1 -0
- package/dist/src/components/table/data-table.js +69 -0
- package/dist/src/components/table/order-table-head.d.ts +7 -0
- package/dist/src/components/table/order-table-head.d.ts.map +1 -0
- package/dist/src/components/table/order-table-head.js +39 -0
- package/dist/src/components/table/pagination.d.ts +11 -0
- package/dist/src/components/table/pagination.d.ts.map +1 -0
- package/dist/src/components/table/pagination.js +122 -0
- package/dist/src/components/ui/accordion.d.ts +8 -0
- package/dist/src/components/ui/accordion.d.ts.map +1 -0
- package/dist/src/components/ui/accordion.js +47 -0
- package/dist/src/components/ui/alert-dialog.d.ts +15 -0
- package/dist/src/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/src/components/ui/alert-dialog.js +86 -0
- package/dist/src/components/ui/alert.d.ts +10 -0
- package/dist/src/components/ui/alert.d.ts.map +1 -0
- package/dist/src/components/ui/alert.js +40 -0
- package/dist/src/components/ui/badge.d.ts +10 -0
- package/dist/src/components/ui/badge.d.ts.map +1 -0
- package/dist/src/components/ui/badge.js +29 -0
- package/dist/src/components/ui/button.d.ts +13 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/button.js +66 -0
- package/dist/src/components/ui/card.d.ts +10 -0
- package/dist/src/components/ui/card.d.ts.map +1 -0
- package/dist/src/components/ui/card.js +53 -0
- package/dist/src/components/ui/checkbox.d.ts +5 -0
- package/dist/src/components/ui/checkbox.d.ts.map +1 -0
- package/dist/src/components/ui/checkbox.js +21 -0
- package/dist/src/components/ui/collapsible.d.ts +6 -0
- package/dist/src/components/ui/collapsible.d.ts.map +1 -0
- package/dist/src/components/ui/collapsible.js +22 -0
- package/dist/src/components/ui/command.d.ts +19 -0
- package/dist/src/components/ui/command.d.ts.map +1 -0
- package/dist/src/components/ui/command.js +99 -0
- package/dist/src/components/ui/context-menu.d.ts +26 -0
- package/dist/src/components/ui/context-menu.d.ts.map +1 -0
- package/dist/src/components/ui/context-menu.js +141 -0
- package/dist/src/components/ui/dialog.d.ts +23 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.js +181 -0
- package/dist/src/components/ui/drawer.d.ts +14 -0
- package/dist/src/components/ui/drawer.d.ts.map +1 -0
- package/dist/src/components/ui/drawer.js +84 -0
- package/dist/src/components/ui/dropdown-menu.d.ts +26 -0
- package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/src/components/ui/dropdown-menu.js +142 -0
- package/dist/src/components/ui/form.d.ts +33 -0
- package/dist/src/components/ui/form.d.ts.map +1 -0
- package/dist/src/components/ui/form.js +142 -0
- package/dist/src/components/ui/header-content.d.ts +17 -0
- package/dist/src/components/ui/header-content.d.ts.map +1 -0
- package/dist/src/components/ui/header-content.js +30 -0
- package/dist/src/components/ui/hover-card.d.ts +7 -0
- package/dist/src/components/ui/hover-card.d.ts.map +1 -0
- package/dist/src/components/ui/hover-card.js +30 -0
- package/dist/src/components/ui/input-otp.d.ts +12 -0
- package/dist/src/components/ui/input-otp.d.ts.map +1 -0
- package/dist/src/components/ui/input-otp.js +49 -0
- package/dist/src/components/ui/input.d.ts +4 -0
- package/dist/src/components/ui/input.d.ts.map +1 -0
- package/dist/src/components/ui/input.js +12 -0
- package/dist/src/components/ui/label.d.ts +5 -0
- package/dist/src/components/ui/label.d.ts.map +1 -0
- package/dist/src/components/ui/label.js +13 -0
- package/dist/src/components/ui/loader.d.ts +5 -0
- package/dist/src/components/ui/loader.d.ts.map +1 -0
- package/dist/src/components/ui/loader.js +16 -0
- package/dist/src/components/ui/menubar.d.ts +27 -0
- package/dist/src/components/ui/menubar.d.ts.map +1 -0
- package/dist/src/components/ui/menubar.js +152 -0
- package/dist/src/components/ui/navigation-menu.d.ts +15 -0
- package/dist/src/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/src/components/ui/navigation-menu.js +83 -0
- package/dist/src/components/ui/popover.d.ts +8 -0
- package/dist/src/components/ui/popover.d.ts.map +1 -0
- package/dist/src/components/ui/popover.js +35 -0
- package/dist/src/components/ui/progress.d.ts +5 -0
- package/dist/src/components/ui/progress.d.ts.map +1 -0
- package/dist/src/components/ui/progress.js +20 -0
- package/dist/src/components/ui/radio-group.d.ts +6 -0
- package/dist/src/components/ui/radio-group.d.ts.map +1 -0
- package/dist/src/components/ui/radio-group.js +28 -0
- package/dist/src/components/ui/select.d.ts +16 -0
- package/dist/src/components/ui/select.d.ts.map +1 -0
- package/dist/src/components/ui/select.js +114 -0
- package/dist/src/components/ui/separator.d.ts +5 -0
- package/dist/src/components/ui/separator.d.ts.map +1 -0
- package/dist/src/components/ui/separator.js +15 -0
- package/dist/src/components/ui/sheet.d.ts +14 -0
- package/dist/src/components/ui/sheet.d.ts.map +1 -0
- package/dist/src/components/ui/sheet.js +93 -0
- package/dist/src/components/ui/sidebar.d.ts +70 -0
- package/dist/src/components/ui/sidebar.d.ts.map +1 -0
- package/dist/src/components/ui/sidebar.js +437 -0
- package/dist/src/components/ui/skeleton.d.ts +3 -0
- package/dist/src/components/ui/skeleton.d.ts.map +1 -0
- package/dist/src/components/ui/skeleton.js +10 -0
- package/dist/src/components/ui/slider.d.ts +5 -0
- package/dist/src/components/ui/slider.d.ts.map +1 -0
- package/dist/src/components/ui/slider.js +42 -0
- package/dist/src/components/ui/sonner.d.ts +4 -0
- package/dist/src/components/ui/sonner.d.ts.map +1 -0
- package/dist/src/components/ui/sonner.js +26 -0
- package/dist/src/components/ui/switch.d.ts +5 -0
- package/dist/src/components/ui/switch.d.ts.map +1 -0
- package/dist/src/components/ui/switch.js +17 -0
- package/dist/src/components/ui/table.d.ts +11 -0
- package/dist/src/components/ui/table.d.ts.map +1 -0
- package/dist/src/components/ui/table.js +64 -0
- package/dist/src/components/ui/tabs.d.ts +8 -0
- package/dist/src/components/ui/tabs.d.ts.map +1 -0
- package/dist/src/components/ui/tabs.js +34 -0
- package/dist/src/components/ui/textarea.d.ts +4 -0
- package/dist/src/components/ui/textarea.d.ts.map +1 -0
- package/dist/src/components/ui/textarea.js +11 -0
- package/dist/src/components/ui/toggle-group.d.ts +8 -0
- package/dist/src/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/src/components/ui/toggle-group.js +41 -0
- package/dist/src/components/ui/toggle.d.ts +10 -0
- package/dist/src/components/ui/toggle.d.ts.map +1 -0
- package/dist/src/components/ui/toggle.js +35 -0
- package/dist/src/components/ui/tooltip.d.ts +8 -0
- package/dist/src/components/ui/tooltip.d.ts.map +1 -0
- package/dist/src/components/ui/tooltip.js +43 -0
- package/dist/src/components/ui/unsaved-changes-dialog.d.ts +1 -0
- package/dist/src/components/ui/unsaved-changes-dialog.d.ts.map +1 -0
- package/dist/src/config.d.ts +5 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +4 -0
- package/dist/src/database/admins.d.ts +246 -0
- package/dist/src/database/admins.d.ts.map +1 -0
- package/dist/src/database/admins.js +74 -0
- package/dist/src/database/languages.d.ts +321 -0
- package/dist/src/database/languages.d.ts.map +1 -0
- package/dist/src/database/languages.js +52 -0
- package/dist/src/database/moderators.d.ts +114 -0
- package/dist/src/database/moderators.d.ts.map +1 -0
- package/dist/src/database/moderators.js +37 -0
- package/dist/src/database/roles.d.ts +146 -0
- package/dist/src/database/roles.d.ts.map +1 -0
- package/dist/src/database/roles.js +13 -0
- package/dist/src/database/sessions.d.ts +196 -0
- package/dist/src/database/sessions.d.ts.map +1 -0
- package/dist/src/database/sessions.js +57 -0
- package/dist/src/database/users.d.ts +562 -0
- package/dist/src/database/users.d.ts.map +1 -0
- package/dist/src/database/users.js +142 -0
- package/dist/src/drizzle.config.d.ts +6 -0
- package/dist/src/drizzle.config.d.ts.map +1 -0
- package/dist/src/drizzle.config.js +37 -0
- package/dist/src/hooks/use-before-unload-with-dialog.d.ts +1 -0
- package/dist/src/hooks/use-before-unload-with-dialog.d.ts.map +1 -0
- package/dist/src/hooks/use-before-unload.d.ts +2 -0
- package/dist/src/hooks/use-before-unload.d.ts.map +1 -0
- package/dist/src/hooks/use-before-unload.js +30 -0
- package/dist/src/hooks/use-mobile.d.ts +2 -0
- package/dist/src/hooks/use-mobile.d.ts.map +1 -0
- package/dist/src/hooks/use-mobile.js +15 -0
- package/dist/src/hooks/use-unsaved-changes.d.ts +1 -0
- package/dist/src/hooks/use-unsaved-changes.d.ts.map +1 -0
- package/dist/src/lib/api/get-middleware-api.d.ts +8 -0
- package/dist/src/lib/api/get-middleware-api.d.ts.map +1 -0
- package/dist/src/lib/api/get-middleware-api.js +13 -0
- package/dist/src/lib/api/get-session-admin-api.d.ts +16 -0
- package/dist/src/lib/api/get-session-admin-api.d.ts.map +1 -0
- package/dist/src/lib/api/get-session-admin-api.js +19 -0
- package/dist/src/lib/api/get-session-api.d.ts +17 -0
- package/dist/src/lib/api/get-session-api.d.ts.map +1 -0
- package/dist/src/lib/api/get-session-api.js +14 -0
- package/dist/src/lib/colors.d.ts +23 -0
- package/dist/src/lib/colors.d.ts.map +1 -0
- package/dist/src/lib/colors.js +131 -0
- package/dist/src/lib/colors.test.d.ts +2 -0
- package/dist/src/lib/colors.test.d.ts.map +1 -0
- package/dist/src/lib/colors.test.js +173 -0
- package/dist/src/lib/config.d.ts +6 -0
- package/dist/src/lib/config.d.ts.map +1 -0
- package/dist/src/lib/config.js +15 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts +10 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts.map +1 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.js +12 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.d.ts +2 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.d.ts.map +1 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +78 -0
- package/dist/src/lib/fetcher/fetcher.d.ts +9 -0
- package/dist/src/lib/fetcher/fetcher.d.ts.map +1 -0
- package/dist/src/lib/fetcher/helpers.d.ts +3 -0
- package/dist/src/lib/fetcher/helpers.d.ts.map +1 -0
- package/dist/src/lib/fetcher/helpers.js +33 -0
- package/dist/src/lib/fetcher/helpers.test.d.ts +2 -0
- package/dist/src/lib/fetcher/helpers.test.d.ts.map +1 -0
- package/dist/src/lib/fetcher/helpers.test.js +37 -0
- package/dist/src/lib/fetcher/index.d.ts +34 -0
- package/dist/src/lib/fetcher/index.d.ts.map +1 -0
- package/dist/src/lib/fetcher/types.d.ts +120 -0
- package/dist/src/lib/fetcher/types.d.ts.map +1 -0
- package/dist/src/lib/fetcher/types.js +1 -0
- package/dist/src/lib/fetcher.d.ts +9 -0
- package/dist/src/lib/fetcher.d.ts.map +1 -0
- package/dist/src/lib/fetcher.js +47 -0
- package/dist/src/lib/helpers/auto-form.d.ts +10 -0
- package/dist/src/lib/helpers/auto-form.d.ts.map +1 -0
- package/dist/src/lib/helpers/auto-form.js +82 -0
- package/dist/src/lib/helpers/auto-form.test.d.ts +2 -0
- package/dist/src/lib/helpers/auto-form.test.d.ts.map +1 -0
- package/dist/src/lib/helpers/auto-form.test.js +126 -0
- package/dist/src/lib/navigation.d.ts +339 -0
- package/dist/src/lib/navigation.d.ts.map +1 -0
- package/dist/src/lib/navigation.js +11 -0
- package/dist/src/lib/plugin.d.ts +15 -0
- package/dist/src/lib/plugin.d.ts.map +1 -0
- package/dist/src/lib/plugin.js +3 -0
- package/dist/src/lib/special-characters.d.ts +3 -0
- package/dist/src/lib/special-characters.d.ts.map +1 -0
- package/dist/src/lib/special-characters.js +4 -0
- package/dist/src/lib/special-characters.test.d.ts +2 -0
- package/dist/src/lib/special-characters.test.d.ts.map +1 -0
- package/dist/src/lib/special-characters.test.js +56 -0
- package/dist/src/lib/utils.d.ts +3 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +5 -0
- package/dist/src/tests/setup.d.ts +2 -0
- package/dist/src/tests/setup.d.ts.map +1 -0
- package/dist/src/tests/setup.js +6 -0
- package/dist/src/views/admin/layouts/admin-layout.d.ts +8 -0
- package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/admin-layout.js +70 -0
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts +11 -0
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +70 -0
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +10 -0
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +49 -0
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts +3 -0
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/sidebar/sidebar.js +30 -0
- package/dist/src/views/admin/layouts/sidebar/sign-out.d.ts +4 -0
- package/dist/src/views/admin/layouts/sidebar/sign-out.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/sidebar/sign-out.js +14 -0
- package/dist/src/views/admin/layouts/user-bar/client.d.ts +7 -0
- package/dist/src/views/admin/layouts/user-bar/client.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/user-bar/client.js +61 -0
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts +3 -0
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/user-bar/user-bar.js +31 -0
- package/dist/src/views/admin/sign-in/sign-in-admin-view.d.ts +2 -0
- package/dist/src/views/admin/sign-in/sign-in-admin-view.d.ts.map +1 -0
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +26 -0
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.d.ts +2 -0
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +44 -0
- package/dist/src/views/admin/views/core/test.d.ts +2 -0
- package/dist/src/views/admin/views/core/test.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/test.js +146 -0
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts +4 -0
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/users/users-admin-view.js +90 -0
- package/dist/src/views/auth/components/password-input.d.ts +4 -0
- package/dist/src/views/auth/components/password-input.d.ts.map +1 -0
- package/dist/src/views/auth/components/password-input.js +89 -0
- package/dist/src/views/auth/sign-in/form/form.d.ts +4 -0
- package/dist/src/views/auth/sign-in/form/form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/form/form.js +59 -0
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.d.ts +10 -0
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.js +33 -0
- package/dist/src/views/auth/sign-in/form/hooks/use-form.d.ts +27 -0
- package/dist/src/views/auth/sign-in/form/hooks/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/form/hooks/use-form.js +38 -0
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts +2 -0
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/sign-in-view.js +55 -0
- package/dist/src/views/auth/sign-up/form/form.d.ts +4 -0
- package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/form/form.js +88 -0
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.d.ts +6 -0
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.js +18 -0
- package/dist/src/views/auth/sign-up/form/hooks/use-form.d.ts +61 -0
- package/dist/src/views/auth/sign-up/form/hooks/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/form/hooks/use-form.js +57 -0
- package/dist/src/views/auth/sign-up/sign-up-view.d.ts +2 -0
- package/dist/src/views/auth/sign-up/sign-up-view.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/sign-up-view.js +61 -0
- package/dist/src/views/auth/sso/buttons/client.d.ts +5 -0
- package/dist/src/views/auth/sso/buttons/client.d.ts.map +1 -0
- package/dist/src/views/auth/sso/buttons/client.js +22 -0
- package/dist/src/views/auth/sso/buttons/mutation-api.d.ts +4 -0
- package/dist/src/views/auth/sso/buttons/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sso/buttons/mutation-api.js +24 -0
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts +3 -0
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts.map +1 -0
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +51 -0
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts +5 -0
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts.map +1 -0
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +18 -0
- package/dist/src/views/auth/sso/callback/client/client.d.ts +6 -0
- package/dist/src/views/auth/sso/callback/client/client.d.ts.map +1 -0
- package/dist/src/views/auth/sso/callback/client/client.js +39 -0
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts +8 -0
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +27 -0
- package/dist/src/views/error/back-button.d.ts +5 -0
- package/dist/src/views/error/back-button.d.ts.map +1 -0
- package/dist/src/views/error/back-button.js +14 -0
- package/dist/src/views/error/error-view.d.ts +5 -0
- package/dist/src/views/error/error-view.d.ts.map +1 -0
- package/dist/src/views/error/error-view.js +56 -0
- package/dist/src/views/error/global-error-view.d.ts +6 -0
- package/dist/src/views/error/global-error-view.d.ts.map +1 -0
- package/dist/src/views/error/global-error-view.js +57 -0
- package/dist/src/views/layouts/provider.d.ts +11 -0
- package/dist/src/views/layouts/provider.d.ts.map +1 -0
- package/dist/src/views/layouts/provider.js +43 -0
- package/dist/src/views/layouts/root-layout.d.ts +16 -0
- package/dist/src/views/layouts/root-layout.d.ts.map +1 -0
- package/dist/src/views/layouts/root-layout.js +38 -0
- package/dist/src/views/layouts/theme/header/header.d.ts +4 -0
- package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/header.js +32 -0
- package/dist/src/views/layouts/theme/header/user/auth/auth.d.ts +2 -0
- package/dist/src/views/layouts/theme/header/user/auth/auth.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/user/auth/auth.js +33 -0
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts +5 -0
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/user/auth/client.js +47 -0
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.d.ts +4 -0
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +27 -0
- package/dist/src/views/layouts/theme/header/user/user.d.ts +2 -0
- package/dist/src/views/layouts/theme/header/user/user.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/user/user.js +34 -0
- package/dist/src/views/layouts/theme/layout.d.ts +5 -0
- package/dist/src/views/layouts/theme/layout.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/layout.js +15 -0
- package/dist/src/vitnode.config.d.ts +50 -0
- package/dist/src/vitnode.config.d.ts.map +1 -0
- package/dist/src/vitnode.config.js +39 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/package.json +94 -0
- package/src/app/login/page.tsx +21 -0
- package/src/app/login/sso/[providerId]/page.tsx +19 -0
- package/src/app/register/page.tsx +21 -0
- package/src/app_admin/core/page.tsx +5 -0
- package/src/app_admin/core/test/page.tsx +5 -0
- package/src/app_admin/core/users/page.tsx +35 -0
- package/src/database/admins.ts +87 -0
- package/src/database/languages.ts +54 -0
- package/src/database/moderators.ts +42 -0
- package/src/database/roles.ts +15 -0
- package/src/database/sessions.ts +59 -0
- package/src/database/users.ts +142 -0
- package/src/locales/en.json +156 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, ChevronsUpDown } from "lucide-react";
|
|
3
|
+
import { useTranslations } from "next-intl";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Button } from "../../ui/button";
|
|
6
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../../ui/command";
|
|
7
|
+
import { FormControl, FormItem, FormMessage } from "../../ui/form";
|
|
8
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../ui/popover";
|
|
9
|
+
import { getBaseSchema } from "../../../lib/helpers/auto-form";
|
|
10
|
+
import { cn } from "../../../lib/utils";
|
|
11
|
+
import { AutoFormDesc } from "../common/desc";
|
|
12
|
+
import { AutoFormLabel } from "../common/label";
|
|
13
|
+
export function AutoFormCombobox({ label, field, description, shape, // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
placeholder: _, className, labels = [], ...props }) {
|
|
15
|
+
const t = useTranslations('core.global');
|
|
16
|
+
const baseValues = getBaseSchema(shape, true)._def.values;
|
|
17
|
+
const values = baseValues.map((value)=>{
|
|
18
|
+
const label = labels.find((l)=>l.value === value)?.label;
|
|
19
|
+
return {
|
|
20
|
+
value,
|
|
21
|
+
label: label ?? value
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/ _jsxs(FormItem, {
|
|
25
|
+
className: "flex flex-col",
|
|
26
|
+
children: [
|
|
27
|
+
label && /*#__PURE__*/ _jsx(AutoFormLabel, {
|
|
28
|
+
children: label
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ _jsxs(Popover, {
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ _jsx(PopoverTrigger, {
|
|
33
|
+
asChild: true,
|
|
34
|
+
children: /*#__PURE__*/ _jsx(FormControl, {
|
|
35
|
+
children: /*#__PURE__*/ _jsxs(Button, {
|
|
36
|
+
className: cn('w-[200px] justify-between', !field.value && 'text-muted-foreground', className),
|
|
37
|
+
role: "combobox",
|
|
38
|
+
variant: "outline",
|
|
39
|
+
...props,
|
|
40
|
+
children: [
|
|
41
|
+
field.value ? values.find(({ value })=>value === field.value)?.label : t('select_option'),
|
|
42
|
+
/*#__PURE__*/ _jsx(ChevronsUpDown, {
|
|
43
|
+
className: "ml-2 h-4 w-4 shrink-0 opacity-50"
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
/*#__PURE__*/ _jsx(PopoverContent, {
|
|
50
|
+
className: "w-[200px] p-0",
|
|
51
|
+
children: /*#__PURE__*/ _jsxs(Command, {
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ _jsx(CommandInput, {
|
|
54
|
+
placeholder: "Search language..."
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsxs(CommandList, {
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ _jsx(CommandEmpty, {
|
|
59
|
+
children: "No language found."
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ _jsx(CommandGroup, {
|
|
62
|
+
children: values.map(({ label, value })=>/*#__PURE__*/ _jsxs(CommandItem, {
|
|
63
|
+
onSelect: ()=>{
|
|
64
|
+
field.onChange(value);
|
|
65
|
+
},
|
|
66
|
+
value: label,
|
|
67
|
+
children: [
|
|
68
|
+
label,
|
|
69
|
+
/*#__PURE__*/ _jsx(Check, {
|
|
70
|
+
className: cn('ml-auto', value === field.value ? 'opacity-100' : 'opacity-0')
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}, value))
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
description && /*#__PURE__*/ _jsx(AutoFormDesc, {
|
|
83
|
+
children: description
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Input } from '../../../components/ui/input';
|
|
4
|
+
import type { ItemAutoFormComponentProps } from './item';
|
|
5
|
+
export declare function AutoFormInput<T extends z.ZodTypeAny>({ label, field, shape: _, description, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof Input>, 'value'> & {
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACpD,KAAK,EACL,KAAK,EAEL,KAAK,EAAE,CAAC,EACR,WAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IAClD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,2CAwBF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FormControl, FormItem, FormMessage } from "../../ui/form";
|
|
4
|
+
import { Input } from "../../ui/input";
|
|
5
|
+
import { AutoFormDesc } from "../common/desc";
|
|
6
|
+
import { AutoFormLabel } from "../common/label";
|
|
7
|
+
export function AutoFormInput({ label, field, // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
+
shape: _, description, ...props }) {
|
|
9
|
+
return /*#__PURE__*/ _jsxs(FormItem, {
|
|
10
|
+
children: [
|
|
11
|
+
label && /*#__PURE__*/ _jsx(AutoFormLabel, {
|
|
12
|
+
children: label
|
|
13
|
+
}),
|
|
14
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
15
|
+
children: /*#__PURE__*/ _jsx(Input, {
|
|
16
|
+
onBlur: (e)=>{
|
|
17
|
+
field.onBlur();
|
|
18
|
+
props.onBlur?.(e);
|
|
19
|
+
},
|
|
20
|
+
onChange: (e)=>{
|
|
21
|
+
field.onChange(e);
|
|
22
|
+
props.onChange?.(e);
|
|
23
|
+
},
|
|
24
|
+
value: field.value ?? '',
|
|
25
|
+
...props
|
|
26
|
+
})
|
|
27
|
+
}),
|
|
28
|
+
description && /*#__PURE__*/ _jsx(AutoFormDesc, {
|
|
29
|
+
children: description
|
|
30
|
+
}),
|
|
31
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ControllerRenderProps, FieldPath, FieldValues } from 'react-hook-form';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
export interface ItemAutoFormComponentProps<T extends z.ZodTypeAny, TName extends FieldPath<z.infer<T>> = FieldPath<z.infer<T>>> {
|
|
4
|
+
field: ControllerRenderProps<FieldValues, TName>;
|
|
5
|
+
shape: z.ZodAny;
|
|
6
|
+
}
|
|
7
|
+
export interface ItemAutoFormProps<T extends z.ZodTypeAny, TName extends FieldPath<z.infer<T>> = FieldPath<z.infer<T>>> {
|
|
8
|
+
component: (props: ItemAutoFormComponentProps<T, TName>) => React.ReactNode;
|
|
9
|
+
id: TName;
|
|
10
|
+
}
|
|
11
|
+
export declare function ItemAutoForm<T extends z.ZodEffects<z.ZodObject<z.ZodRawShape>> | z.ZodObject<z.ZodRawShape>, TName extends FieldPath<z.infer<T>> = FieldPath<z.infer<T>>>({ id, component, formSchema, }: ItemAutoFormProps<T, TName> & {
|
|
12
|
+
formSchema: T;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
//# sourceMappingURL=item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,MAAM,WAAW,0BAA0B,CACzC,CAAC,SAAS,CAAC,CAAC,UAAU,EACtB,KAAK,SAAS,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3D,KAAK,EAAE,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB,CAChC,CAAC,SAAS,CAAC,CAAC,UAAU,EACtB,KAAK,SAAS,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3D,SAAS,EAAE,CAAC,KAAK,EAAE,0BAA0B,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5E,EAAE,EAAE,KAAK,CAAC;CACX;AAED,wBAAgB,YAAY,CAC1B,CAAC,SACG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,GACxC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,EAC9B,KAAK,SAAS,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC3D,EACA,EAAE,EACF,SAAS,EACT,UAAU,GACX,EAAE,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,kDAmBjD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { FormField } from "../../ui/form";
|
|
3
|
+
import { getShapeFromSchema } from "../../../lib/helpers/auto-form";
|
|
4
|
+
export function ItemAutoForm({ id, component, formSchema }) {
|
|
5
|
+
let shape = null;
|
|
6
|
+
const ids = id.split('.');
|
|
7
|
+
for (const id of ids){
|
|
8
|
+
shape = getShapeFromSchema(shape ? shape : formSchema, id);
|
|
9
|
+
}
|
|
10
|
+
if (!shape) return null;
|
|
11
|
+
return /*#__PURE__*/ _jsx(FormField, {
|
|
12
|
+
name: id,
|
|
13
|
+
render: ({ field })=>{
|
|
14
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
15
|
+
children: component({
|
|
16
|
+
field,
|
|
17
|
+
shape
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { RadioGroup } from '../../../components/ui/radio-group';
|
|
4
|
+
import type { ItemAutoFormComponentProps } from './item';
|
|
5
|
+
export declare function AutoFormRadioGroup<T extends z.ZodTypeAny>({ label, field, description, shape, labels, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof RadioGroup>, 'value'> & {
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
labels?: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,UAAU,EAAkB,MAAM,6BAA6B,CAAC;AAGzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACzD,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,MAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,EAAE,OAAO,CAAC,GAAG;IACvD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C,2CA0CF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FormControl, FormItem, FormLabel, FormMessage } from "../../ui/form";
|
|
4
|
+
import { RadioGroup, RadioGroupItem } from "../../ui/radio-group";
|
|
5
|
+
import { getBaseSchema } from "../../../lib/helpers/auto-form";
|
|
6
|
+
import { AutoFormDesc } from "../common/desc";
|
|
7
|
+
import { AutoFormLabel } from "../common/label";
|
|
8
|
+
export function AutoFormRadioGroup({ label, field, description, shape, labels = [], ...props }) {
|
|
9
|
+
const baseValues = getBaseSchema(shape, true)._def.values;
|
|
10
|
+
const values = baseValues.map((value)=>{
|
|
11
|
+
const label = labels.find((l)=>l.value === value)?.label;
|
|
12
|
+
return {
|
|
13
|
+
value,
|
|
14
|
+
label: label ?? value
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
return /*#__PURE__*/ _jsxs(FormItem, {
|
|
18
|
+
className: "space-y-3",
|
|
19
|
+
children: [
|
|
20
|
+
label && /*#__PURE__*/ _jsx(AutoFormLabel, {
|
|
21
|
+
children: label
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
24
|
+
children: /*#__PURE__*/ _jsx(RadioGroup, {
|
|
25
|
+
defaultValue: field.value,
|
|
26
|
+
disabled: props.disabled,
|
|
27
|
+
onValueChange: field.onChange,
|
|
28
|
+
...props,
|
|
29
|
+
children: values.map(({ value, label })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
30
|
+
className: "flex items-center space-x-3 space-y-0",
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
33
|
+
children: /*#__PURE__*/ _jsx(RadioGroupItem, {
|
|
34
|
+
value: value
|
|
35
|
+
})
|
|
36
|
+
}),
|
|
37
|
+
/*#__PURE__*/ _jsx(FormLabel, {
|
|
38
|
+
className: "font-normal",
|
|
39
|
+
children: label
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}, value))
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
description && /*#__PURE__*/ _jsx(AutoFormDesc, {
|
|
46
|
+
children: description
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Select } from '../../../components/ui/select';
|
|
4
|
+
import type { ItemAutoFormComponentProps } from './item';
|
|
5
|
+
export declare function AutoFormSelect<T extends z.ZodTypeAny>({ label, field, description, shape, placeholder, labels, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof Select>, 'value'> & {
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
labels?: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,MAAM,EAKP,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACrD,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,WAAW,EACX,MAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG;IACnD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,2CAuDF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslations } from "next-intl";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { FormControl, FormItem, FormMessage } from "../../ui/form";
|
|
5
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/select";
|
|
6
|
+
import { getBaseSchema } from "../../../lib/helpers/auto-form";
|
|
7
|
+
import { AutoFormDesc } from "../common/desc";
|
|
8
|
+
import { AutoFormLabel } from "../common/label";
|
|
9
|
+
export function AutoFormSelect({ label, field, description, shape, placeholder, labels = [], ...props }) {
|
|
10
|
+
const t = useTranslations('core.global');
|
|
11
|
+
const baseValues = getBaseSchema(shape, true)._def.values;
|
|
12
|
+
const values = baseValues.map((value)=>{
|
|
13
|
+
const label = labels.find((l)=>l.value === value)?.label;
|
|
14
|
+
return {
|
|
15
|
+
value,
|
|
16
|
+
label: label ?? value
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
const currentPlaceholder = (values ?? labels).find((l)=>l.value === field.value)?.label ?? t('select_option');
|
|
20
|
+
return /*#__PURE__*/ _jsxs(FormItem, {
|
|
21
|
+
className: "space-y-3",
|
|
22
|
+
children: [
|
|
23
|
+
label && /*#__PURE__*/ _jsx(AutoFormLabel, {
|
|
24
|
+
children: label
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
27
|
+
children: /*#__PURE__*/ _jsxs(Select, {
|
|
28
|
+
defaultValue: field.value,
|
|
29
|
+
disabled: props.disabled,
|
|
30
|
+
onValueChange: (e)=>{
|
|
31
|
+
field.onChange(e);
|
|
32
|
+
props?.onValueChange?.(e);
|
|
33
|
+
},
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ _jsx(SelectTrigger, {
|
|
37
|
+
...props,
|
|
38
|
+
children: /*#__PURE__*/ _jsx(SelectValue, {
|
|
39
|
+
onBlur: field.onBlur,
|
|
40
|
+
placeholder: placeholder ?? currentPlaceholder,
|
|
41
|
+
children: currentPlaceholder
|
|
42
|
+
})
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ _jsx(SelectContent, {
|
|
45
|
+
children: values.map(({ value, label })=>/*#__PURE__*/ _jsx(SelectItem, {
|
|
46
|
+
value: value,
|
|
47
|
+
children: label
|
|
48
|
+
}, value))
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
description && /*#__PURE__*/ _jsx(AutoFormDesc, {
|
|
54
|
+
children: description
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { Switch } from '../../../components/ui/switch';
|
|
3
|
+
import type { ItemAutoFormComponentProps } from './item';
|
|
4
|
+
export declare function AutoFormSwitch<T extends z.ZodTypeAny>({ label, field, shape: _, description, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof Switch>, 'checked'> & {
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACrD,KAAK,EACL,KAAK,EAEL,KAAK,EAAE,CAAC,EACR,WAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG;IACrD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,2CAwBF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl, FormItem } from "../../ui/form";
|
|
3
|
+
import { Switch } from "../../ui/switch";
|
|
4
|
+
import { AutoFormDesc } from "../common/desc";
|
|
5
|
+
import { AutoFormLabel } from "../common/label";
|
|
6
|
+
export function AutoFormSwitch({ label, field, // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
+
shape: _, description, ...props }) {
|
|
8
|
+
return /*#__PURE__*/ _jsxs(FormItem, {
|
|
9
|
+
className: "flex flex-row items-center justify-between rounded-lg border p-4",
|
|
10
|
+
children: [
|
|
11
|
+
!!(label ?? description) && /*#__PURE__*/ _jsxs("div", {
|
|
12
|
+
className: "space-y-0.5",
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ _jsx(AutoFormLabel, {
|
|
15
|
+
className: "text-base",
|
|
16
|
+
children: "Marketing emails"
|
|
17
|
+
}),
|
|
18
|
+
/*#__PURE__*/ _jsx(AutoFormDesc, {
|
|
19
|
+
children: "Receive emails about new products, features, and more."
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
24
|
+
children: /*#__PURE__*/ _jsx(Switch, {
|
|
25
|
+
checked: field.value || false,
|
|
26
|
+
onCheckedChange: (e)=>{
|
|
27
|
+
field.onChange(e);
|
|
28
|
+
props?.onCheckedChange?.(e);
|
|
29
|
+
},
|
|
30
|
+
...props
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Textarea } from '../../../components/ui/textarea';
|
|
4
|
+
import type { ItemAutoFormComponentProps } from './item';
|
|
5
|
+
export declare function AutoFormTextarea<T extends z.ZodTypeAny>({ label, field, shape: _, description, ...props }: ItemAutoFormComponentProps<T> & Omit<React.ComponentProps<typeof Textarea>, 'value'> & {
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/fields/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAKzD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EACvD,KAAK,EACL,KAAK,EAEL,KAAK,EAAE,CAAC,EACR,WAAW,EACX,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,EAAE,OAAO,CAAC,GAAG;IACrD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,2CAwBF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FormControl, FormItem, FormMessage } from "../../ui/form";
|
|
4
|
+
import { Textarea } from "../../ui/textarea";
|
|
5
|
+
import { AutoFormDesc } from "../common/desc";
|
|
6
|
+
import { AutoFormLabel } from "../common/label";
|
|
7
|
+
export function AutoFormTextarea({ label, field, // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
+
shape: _, description, ...props }) {
|
|
9
|
+
return /*#__PURE__*/ _jsxs(FormItem, {
|
|
10
|
+
children: [
|
|
11
|
+
label && /*#__PURE__*/ _jsx(AutoFormLabel, {
|
|
12
|
+
children: label
|
|
13
|
+
}),
|
|
14
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
15
|
+
children: /*#__PURE__*/ _jsx(Textarea, {
|
|
16
|
+
onBlur: (e)=>{
|
|
17
|
+
field.onBlur();
|
|
18
|
+
props.onBlur?.(e);
|
|
19
|
+
},
|
|
20
|
+
onChange: (e)=>{
|
|
21
|
+
field.onChange(e);
|
|
22
|
+
props.onChange?.(e);
|
|
23
|
+
},
|
|
24
|
+
value: field.value ?? '',
|
|
25
|
+
...props
|
|
26
|
+
})
|
|
27
|
+
}),
|
|
28
|
+
description && /*#__PURE__*/ _jsx(AutoFormDesc, {
|
|
29
|
+
children: description
|
|
30
|
+
}),
|
|
31
|
+
/*#__PURE__*/ _jsx(FormMessage, {})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Messages, NamespaceKeys, NestedKeyOf } from 'next-intl';
|
|
2
|
+
import 'server-only';
|
|
3
|
+
export declare function I18nProvider<NestedKey extends NamespaceKeys<Messages, NestedKeyOf<Messages>> = never>({ children, namespaces, }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
namespaces: NestedKey | NestedKey[];
|
|
6
|
+
}): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
//# sourceMappingURL=i18n-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-provider.d.ts","sourceRoot":"","sources":["../../../src/components/i18n-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAItE,OAAO,aAAa,CAAC;AA2BrB,wBAAsB,YAAY,CAChC,SAAS,SAAS,aAAa,CAAC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,KAAK,EACxE,EACA,QAAQ,EACR,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACrC,oDAaA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { NextIntlClientProvider } from "next-intl";
|
|
3
|
+
import { getLocale, getMessages } from "next-intl/server";
|
|
4
|
+
import "server-only";
|
|
5
|
+
const pick = (obj, paths)=>{
|
|
6
|
+
const result = {};
|
|
7
|
+
for (const path of paths){
|
|
8
|
+
const keys = path.split('.');
|
|
9
|
+
let src = obj;
|
|
10
|
+
let dest = result;
|
|
11
|
+
for(let i = 0; i < keys.length; i++){
|
|
12
|
+
const key = keys[i];
|
|
13
|
+
if (src && Object.prototype.hasOwnProperty.call(src, key)) {
|
|
14
|
+
if (i === keys.length - 1) {
|
|
15
|
+
dest[key] = src[key];
|
|
16
|
+
} else {
|
|
17
|
+
dest[key] ??= {};
|
|
18
|
+
dest = dest[key];
|
|
19
|
+
src = src[key];
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
export async function I18nProvider({ children, namespaces }) {
|
|
29
|
+
const locale = await getLocale();
|
|
30
|
+
const messagesInit = await getMessages({
|
|
31
|
+
locale
|
|
32
|
+
});
|
|
33
|
+
const messages = pick(messagesInit, [
|
|
34
|
+
'core.global',
|
|
35
|
+
...Array.isArray(namespaces) ? namespaces : [
|
|
36
|
+
namespaces
|
|
37
|
+
]
|
|
38
|
+
]);
|
|
39
|
+
return /*#__PURE__*/ _jsx(NextIntlClientProvider, {
|
|
40
|
+
messages: messages,
|
|
41
|
+
children: children
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo-vitnode.d.ts","sourceRoot":"","sources":["../../../src/components/logo-vitnode.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAI,gCAIzB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,4CA4FA,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
export const LogoVitNode = ({ className, small, ...props })=>{
|
|
4
|
+
if (small) return /*#__PURE__*/ _jsxs("svg", {
|
|
5
|
+
"aria-label": "Logo VitNode",
|
|
6
|
+
className: cn('text-foreground', className),
|
|
7
|
+
fill: "none",
|
|
8
|
+
viewBox: "0 0 375 376",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
...props,
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ _jsx("path", {
|
|
13
|
+
d: "M169.385 16.196C180.827 9.60134 194.923 9.60134 206.365 16.196L329.51 87.1749C340.952 93.7695 348 105.957 348 119.146V261.104C348 274.293 340.952 286.481 329.51 293.075L206.365 364.054C194.923 370.649 180.827 370.649 169.385 364.054L46.2396 293.075C34.7982 286.481 27.75 274.293 27.75 261.104V119.146C27.75 105.957 34.7982 93.7695 46.2396 87.1749L169.385 16.196Z",
|
|
14
|
+
fill: "#FDFEFF"
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ _jsx("path", {
|
|
17
|
+
clipRule: "evenodd",
|
|
18
|
+
d: "M168.101 5.19482C180.105 -1.73161 194.895 -1.73161 206.899 5.19482L336.101 79.745C348.105 86.6714 355.5 99.472 355.5 113.325V262.425C355.5 276.278 348.105 289.079 336.101 296.005L206.899 370.555C194.895 377.482 180.105 377.482 168.101 370.555L38.899 296.005C26.8948 289.079 19.5 276.278 19.5 262.425V113.325C19.5 99.472 26.8948 86.6714 38.899 79.745L168.101 5.19482ZM109.649 106.082L187.5 61.1613L265.351 106.082L187.5 241.071L109.649 106.082ZM77.6969 148.394V251.232L166.585 302.521L77.6969 148.394ZM208.415 302.521L297.303 251.232V148.394L208.415 302.521Z",
|
|
19
|
+
fill: "url(#paint0_linear_123_23)",
|
|
20
|
+
fillRule: "evenodd"
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ _jsx("defs", {
|
|
23
|
+
children: /*#__PURE__*/ _jsxs("linearGradient", {
|
|
24
|
+
gradientUnits: "userSpaceOnUse",
|
|
25
|
+
id: "paint0_linear_123_23",
|
|
26
|
+
x1: "187.5",
|
|
27
|
+
x2: "187.5",
|
|
28
|
+
y1: "0",
|
|
29
|
+
y2: "375.75",
|
|
30
|
+
children: [
|
|
31
|
+
/*#__PURE__*/ _jsx("stop", {
|
|
32
|
+
stopColor: "#3261BF"
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ _jsx("stop", {
|
|
35
|
+
offset: "1",
|
|
36
|
+
stopColor: "#363795"
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
return /*#__PURE__*/ _jsxs("svg", {
|
|
44
|
+
"aria-label": "Logo VitNode",
|
|
45
|
+
className: cn('text-foreground', className),
|
|
46
|
+
fill: "none",
|
|
47
|
+
viewBox: "0 0 762 191",
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
...props,
|
|
50
|
+
children: [
|
|
51
|
+
/*#__PURE__*/ _jsxs("g", {
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ _jsx("path", {
|
|
54
|
+
d: "M550.7 157H543.7L505 98.2V157H498V87.1H505L543.7 145.8V87.1H550.7V157ZM597.955 157.7C591.488 157.7 585.621 156.2 580.355 153.2C575.088 150.133 570.921 145.9 567.855 140.5C564.855 135.033 563.355 128.867 563.355 122C563.355 115.133 564.855 109 567.855 103.6C570.921 98.1333 575.088 93.9 580.355 90.9C585.621 87.8333 591.488 86.3 597.955 86.3C604.488 86.3 610.388 87.8333 615.655 90.9C620.921 93.9 625.055 98.1333 628.055 103.6C631.055 109 632.555 115.133 632.555 122C632.555 128.867 631.055 135.033 628.055 140.5C625.055 145.9 620.921 150.133 615.655 153.2C610.388 156.2 604.488 157.7 597.955 157.7ZM597.955 151.6C603.155 151.6 607.821 150.4 611.955 148C616.088 145.6 619.355 142.167 621.755 137.7C624.155 133.167 625.355 127.933 625.355 122C625.355 116.067 624.155 110.867 621.755 106.4C619.355 101.933 616.088 98.5 611.955 96.1C607.821 93.7 603.155 92.5 597.955 92.5C592.755 92.5 588.088 93.7 583.955 96.1C579.821 98.5 576.555 101.933 574.155 106.4C571.755 110.867 570.555 116.067 570.555 122C570.555 127.933 571.755 133.167 574.155 137.7C576.555 142.167 579.821 145.6 583.955 148C588.088 150.4 592.755 151.6 597.955 151.6ZM666.063 87.1C673.797 87.1 680.43 88.5 685.963 91.3C691.497 94.1 695.73 98.1333 698.663 103.4C701.597 108.667 703.063 114.933 703.063 122.2C703.063 129.4 701.597 135.633 698.663 140.9C695.73 146.1 691.497 150.1 685.963 152.9C680.43 155.633 673.797 157 666.063 157H645.363V87.1H666.063ZM666.063 151.2C675.797 151.2 683.197 148.667 688.263 143.6C693.397 138.467 695.963 131.333 695.963 122.2C695.963 113 693.397 105.833 688.263 100.7C683.197 95.5 675.797 92.9 666.063 92.9H652.363V151.2H666.063ZM722.969 92.8V118.9H749.469V124.7H722.969V151.2H752.469V157H715.969V87H752.469V92.8H722.969Z",
|
|
55
|
+
fill: "currentColor"
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ _jsx("path", {
|
|
58
|
+
d: "M349.338 32.044L305.016 157H266.924L222.602 32.044H254.998L285.97 126.384L317.12 32.044H349.338ZM392.497 32.044V157H362.059V32.044H392.497ZM504.446 32.044V56.43H471.338V157H440.9V56.43H407.792V32.044H504.446Z",
|
|
59
|
+
fill: "url(#paint0_linear_205_42)"
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ _jsx("path", {
|
|
64
|
+
d: "M85.7722 8.20596C91.5658 4.86468 98.7039 4.86468 104.497 8.20596L166.855 44.1686C172.649 47.5099 176.218 53.6848 176.218 60.3674V132.293C176.218 138.975 172.649 145.15 166.855 148.491L104.497 184.454C98.7039 187.795 91.5658 187.795 85.7722 184.454L23.4144 148.491C17.6208 145.15 14.0518 138.975 14.0518 132.293V60.3674C14.0518 53.6848 17.6208 47.5099 23.4144 44.1686L85.7722 8.20596Z",
|
|
65
|
+
fill: "#FDFEFF"
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ _jsx("path", {
|
|
68
|
+
clipRule: "evenodd",
|
|
69
|
+
d: "M85.1219 2.63204C91.2005 -0.877348 98.6896 -0.877348 104.768 2.63204L170.193 40.4041C176.271 43.9135 180.016 50.3991 180.016 57.4179V132.962C180.016 139.981 176.271 146.466 170.193 149.976L104.768 187.748C98.6896 191.257 91.2005 191.257 85.1219 187.748L19.6974 149.976C13.6188 146.466 9.87427 139.981 9.87427 132.962V57.4179C9.87427 50.3991 13.6188 43.9135 19.6974 40.4041L85.1219 2.63204ZM55.5232 53.7481L94.945 30.9884L134.367 53.7481L94.945 122.143L55.5232 53.7481ZM39.3436 75.1861V127.291L84.3544 153.277L39.3436 75.1861ZM105.536 153.277L150.546 127.291V75.1861L105.536 153.277Z",
|
|
70
|
+
fill: "url(#paint1_linear_205_42)",
|
|
71
|
+
fillRule: "evenodd"
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ _jsxs("defs", {
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ _jsxs("linearGradient", {
|
|
76
|
+
gradientUnits: "userSpaceOnUse",
|
|
77
|
+
id: "paint0_linear_205_42",
|
|
78
|
+
x1: "381.603",
|
|
79
|
+
x2: "381.603",
|
|
80
|
+
y1: "6",
|
|
81
|
+
y2: "196",
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ _jsx("stop", {
|
|
84
|
+
stopColor: "#3261BF"
|
|
85
|
+
}),
|
|
86
|
+
/*#__PURE__*/ _jsx("stop", {
|
|
87
|
+
offset: "1",
|
|
88
|
+
stopColor: "#363795"
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ _jsxs("linearGradient", {
|
|
93
|
+
gradientUnits: "userSpaceOnUse",
|
|
94
|
+
id: "paint1_linear_205_42",
|
|
95
|
+
x1: "94.945",
|
|
96
|
+
x2: "94.945",
|
|
97
|
+
y1: "0",
|
|
98
|
+
y2: "190.38",
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ _jsx("stop", {
|
|
101
|
+
stopColor: "#3261BF"
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ _jsx("stop", {
|
|
104
|
+
offset: "1",
|
|
105
|
+
stopColor: "#363795"
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-switcher.d.ts","sourceRoot":"","sources":["../../../../src/components/switchers/theme-switcher.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,+CAiBzB,CAAC"}
|