@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,437 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { PanelLeftIcon } from "lucide-react";
|
|
5
|
+
import { Slot } from "radix-ui";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Button } from "./button";
|
|
8
|
+
import { Input } from "./input";
|
|
9
|
+
import { Separator } from "./separator";
|
|
10
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet";
|
|
11
|
+
import { Skeleton } from "./skeleton";
|
|
12
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip";
|
|
13
|
+
import { useIsMobile } from "../../hooks/use-mobile";
|
|
14
|
+
import { cn } from "../../lib/utils";
|
|
15
|
+
const SIDEBAR_COOKIE_NAME = 'sidebar_state';
|
|
16
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
17
|
+
const SIDEBAR_WIDTH = '16rem';
|
|
18
|
+
const SIDEBAR_WIDTH_MOBILE = '18rem';
|
|
19
|
+
const SIDEBAR_WIDTH_ICON = '3rem';
|
|
20
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
21
|
+
const SidebarContext = /*#__PURE__*/ React.createContext(null);
|
|
22
|
+
function useSidebar() {
|
|
23
|
+
const context = React.useContext(SidebarContext);
|
|
24
|
+
if (!context) {
|
|
25
|
+
throw new Error('useSidebar must be used within a SidebarProvider.');
|
|
26
|
+
}
|
|
27
|
+
return context;
|
|
28
|
+
}
|
|
29
|
+
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
30
|
+
const isMobile = useIsMobile();
|
|
31
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
32
|
+
// This is the internal state of the sidebar.
|
|
33
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
34
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
35
|
+
const open = openProp ?? _open;
|
|
36
|
+
const setOpen = React.useCallback((value)=>{
|
|
37
|
+
const openState = typeof value === 'function' ? value(open) : value;
|
|
38
|
+
if (setOpenProp) {
|
|
39
|
+
setOpenProp(openState);
|
|
40
|
+
} else {
|
|
41
|
+
_setOpen(openState);
|
|
42
|
+
}
|
|
43
|
+
// This sets the cookie to keep the sidebar state.
|
|
44
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
45
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
46
|
+
}, [
|
|
47
|
+
setOpenProp,
|
|
48
|
+
open
|
|
49
|
+
]);
|
|
50
|
+
// Helper to toggle the sidebar.
|
|
51
|
+
const toggleSidebar = React.useCallback(()=>{
|
|
52
|
+
return isMobile ? setOpenMobile((open)=>!open) : setOpen((open)=>!open);
|
|
53
|
+
}, [
|
|
54
|
+
isMobile,
|
|
55
|
+
setOpen,
|
|
56
|
+
setOpenMobile
|
|
57
|
+
]);
|
|
58
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
59
|
+
React.useEffect(()=>{
|
|
60
|
+
const handleKeyDown = (event)=>{
|
|
61
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
toggleSidebar();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
67
|
+
return ()=>window.removeEventListener('keydown', handleKeyDown);
|
|
68
|
+
}, [
|
|
69
|
+
toggleSidebar
|
|
70
|
+
]);
|
|
71
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
72
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
73
|
+
const state = open ? 'expanded' : 'collapsed';
|
|
74
|
+
const contextValue = React.useMemo(()=>({
|
|
75
|
+
state,
|
|
76
|
+
open,
|
|
77
|
+
setOpen,
|
|
78
|
+
isMobile,
|
|
79
|
+
openMobile,
|
|
80
|
+
setOpenMobile,
|
|
81
|
+
toggleSidebar
|
|
82
|
+
}), [
|
|
83
|
+
state,
|
|
84
|
+
open,
|
|
85
|
+
setOpen,
|
|
86
|
+
isMobile,
|
|
87
|
+
openMobile,
|
|
88
|
+
setOpenMobile,
|
|
89
|
+
toggleSidebar
|
|
90
|
+
]);
|
|
91
|
+
return /*#__PURE__*/ _jsx(SidebarContext.Provider, {
|
|
92
|
+
value: contextValue,
|
|
93
|
+
children: /*#__PURE__*/ _jsx(TooltipProvider, {
|
|
94
|
+
delayDuration: 0,
|
|
95
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
96
|
+
className: cn('group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full', className),
|
|
97
|
+
"data-slot": "sidebar-wrapper",
|
|
98
|
+
style: {
|
|
99
|
+
'--sidebar-width': SIDEBAR_WIDTH,
|
|
100
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
101
|
+
...style
|
|
102
|
+
},
|
|
103
|
+
...props,
|
|
104
|
+
children: children
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function Sidebar({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }) {
|
|
110
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
111
|
+
if (collapsible === 'none') {
|
|
112
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
113
|
+
className: cn('bg-sidebar text-sidebar-foreground w-(--sidebar-width) flex h-full flex-col', className),
|
|
114
|
+
"data-slot": "sidebar",
|
|
115
|
+
...props,
|
|
116
|
+
children: children
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (isMobile) {
|
|
120
|
+
return /*#__PURE__*/ _jsx(Sheet, {
|
|
121
|
+
onOpenChange: setOpenMobile,
|
|
122
|
+
open: openMobile,
|
|
123
|
+
...props,
|
|
124
|
+
children: /*#__PURE__*/ _jsxs(SheetContent, {
|
|
125
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
126
|
+
"data-mobile": "true",
|
|
127
|
+
"data-sidebar": "sidebar",
|
|
128
|
+
"data-slot": "sidebar",
|
|
129
|
+
side: side,
|
|
130
|
+
style: {
|
|
131
|
+
'--sidebar-width': SIDEBAR_WIDTH_MOBILE
|
|
132
|
+
},
|
|
133
|
+
children: [
|
|
134
|
+
/*#__PURE__*/ _jsxs(SheetHeader, {
|
|
135
|
+
className: "sr-only",
|
|
136
|
+
children: [
|
|
137
|
+
/*#__PURE__*/ _jsx(SheetTitle, {
|
|
138
|
+
children: "Sidebar"
|
|
139
|
+
}),
|
|
140
|
+
/*#__PURE__*/ _jsx(SheetDescription, {
|
|
141
|
+
children: "Displays the mobile sidebar."
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
}),
|
|
145
|
+
/*#__PURE__*/ _jsx("div", {
|
|
146
|
+
className: "flex h-full w-full flex-col",
|
|
147
|
+
children: children
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
154
|
+
className: "text-sidebar-foreground group peer hidden md:block",
|
|
155
|
+
"data-collapsible": state === 'collapsed' ? collapsible : '',
|
|
156
|
+
"data-side": side,
|
|
157
|
+
"data-slot": "sidebar",
|
|
158
|
+
"data-state": state,
|
|
159
|
+
"data-variant": variant,
|
|
160
|
+
children: [
|
|
161
|
+
/*#__PURE__*/ _jsx("div", {
|
|
162
|
+
className: cn('w-(--sidebar-width) relative bg-transparent transition-[width] duration-200 ease-linear', 'group-data-[collapsible=offcanvas]:w-0', 'group-data-[side=right]:rotate-180', variant === 'floating' || variant === 'inset' ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]' : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)'),
|
|
163
|
+
"data-slot": "sidebar-gap"
|
|
164
|
+
}),
|
|
165
|
+
/*#__PURE__*/ _jsx("div", {
|
|
166
|
+
className: cn('w-(--sidebar-width) fixed inset-y-0 z-10 hidden h-svh transition-[left,right,width] duration-200 ease-linear md:flex', side === 'left' ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]' : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]', // Adjust the padding for floating and inset variants.
|
|
167
|
+
variant === 'floating' || variant === 'inset' ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]' : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l', className),
|
|
168
|
+
"data-slot": "sidebar-container",
|
|
169
|
+
...props,
|
|
170
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
171
|
+
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
172
|
+
"data-sidebar": "sidebar",
|
|
173
|
+
"data-slot": "sidebar-inner",
|
|
174
|
+
children: children
|
|
175
|
+
})
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
181
|
+
const { toggleSidebar } = useSidebar();
|
|
182
|
+
return /*#__PURE__*/ _jsxs(Button, {
|
|
183
|
+
className: cn('size-7', className),
|
|
184
|
+
"data-sidebar": "trigger",
|
|
185
|
+
"data-slot": "sidebar-trigger",
|
|
186
|
+
onClick: (event)=>{
|
|
187
|
+
onClick?.(event);
|
|
188
|
+
toggleSidebar();
|
|
189
|
+
},
|
|
190
|
+
size: "icon",
|
|
191
|
+
variant: "ghost",
|
|
192
|
+
...props,
|
|
193
|
+
children: [
|
|
194
|
+
/*#__PURE__*/ _jsx(PanelLeftIcon, {}),
|
|
195
|
+
/*#__PURE__*/ _jsx("span", {
|
|
196
|
+
className: "sr-only",
|
|
197
|
+
children: "Toggle Sidebar"
|
|
198
|
+
})
|
|
199
|
+
]
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function SidebarRail({ className, ...props }) {
|
|
203
|
+
const { toggleSidebar } = useSidebar();
|
|
204
|
+
return /*#__PURE__*/ _jsx("button", {
|
|
205
|
+
"aria-label": "Toggle Sidebar",
|
|
206
|
+
className: cn('hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex', 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize', '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize', 'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full', '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2', '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2', className),
|
|
207
|
+
"data-sidebar": "rail",
|
|
208
|
+
"data-slot": "sidebar-rail",
|
|
209
|
+
onClick: toggleSidebar,
|
|
210
|
+
tabIndex: -1,
|
|
211
|
+
title: "Toggle Sidebar",
|
|
212
|
+
...props
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function SidebarInset({ className, ...props }) {
|
|
216
|
+
return /*#__PURE__*/ _jsx("main", {
|
|
217
|
+
className: cn('bg-background relative flex w-full flex-1 flex-col', 'md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm', className),
|
|
218
|
+
"data-slot": "sidebar-inset",
|
|
219
|
+
...props
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function SidebarInput({ className, ...props }) {
|
|
223
|
+
return /*#__PURE__*/ _jsx(Input, {
|
|
224
|
+
className: cn('bg-background h-8 w-full shadow-none', className),
|
|
225
|
+
"data-sidebar": "input",
|
|
226
|
+
"data-slot": "sidebar-input",
|
|
227
|
+
...props
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function SidebarHeader({ className, ...props }) {
|
|
231
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
232
|
+
className: cn('flex flex-col gap-2 p-2', className),
|
|
233
|
+
"data-sidebar": "header",
|
|
234
|
+
"data-slot": "sidebar-header",
|
|
235
|
+
...props
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
function SidebarFooter({ className, ...props }) {
|
|
239
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
240
|
+
className: cn('flex flex-col gap-2 p-2', className),
|
|
241
|
+
"data-sidebar": "footer",
|
|
242
|
+
"data-slot": "sidebar-footer",
|
|
243
|
+
...props
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
function SidebarSeparator({ className, ...props }) {
|
|
247
|
+
return /*#__PURE__*/ _jsx(Separator, {
|
|
248
|
+
className: cn('bg-sidebar-border mx-2 w-auto', className),
|
|
249
|
+
"data-sidebar": "separator",
|
|
250
|
+
"data-slot": "sidebar-separator",
|
|
251
|
+
...props
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function SidebarContent({ className, ...props }) {
|
|
255
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
256
|
+
className: cn('flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden', className),
|
|
257
|
+
"data-sidebar": "content",
|
|
258
|
+
"data-slot": "sidebar-content",
|
|
259
|
+
...props
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
function SidebarGroup({ className, ...props }) {
|
|
263
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
264
|
+
className: cn('relative flex w-full min-w-0 flex-col p-2', className),
|
|
265
|
+
"data-sidebar": "group",
|
|
266
|
+
"data-slot": "sidebar-group",
|
|
267
|
+
...props
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
271
|
+
const Comp = asChild ? Slot.Root : 'div';
|
|
272
|
+
return /*#__PURE__*/ _jsx(Comp, {
|
|
273
|
+
className: cn('text-sidebar-foreground/70 ring-sidebar-ring outline-hidden flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0', className),
|
|
274
|
+
"data-sidebar": "group-label",
|
|
275
|
+
"data-slot": "sidebar-group-label",
|
|
276
|
+
...props
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
280
|
+
const Comp = asChild ? Slot.Root : 'button';
|
|
281
|
+
return /*#__PURE__*/ _jsx(Comp, {
|
|
282
|
+
className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground outline-hidden absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', // Increases the hit area of the button on mobile.
|
|
283
|
+
'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', className),
|
|
284
|
+
"data-sidebar": "group-action",
|
|
285
|
+
"data-slot": "sidebar-group-action",
|
|
286
|
+
...props
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
function SidebarGroupContent({ className, ...props }) {
|
|
290
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
291
|
+
className: cn('w-full text-sm', className),
|
|
292
|
+
"data-sidebar": "group-content",
|
|
293
|
+
"data-slot": "sidebar-group-content",
|
|
294
|
+
...props
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
function SidebarMenu({ className, ...props }) {
|
|
298
|
+
return /*#__PURE__*/ _jsx("ul", {
|
|
299
|
+
className: cn('flex w-full min-w-0 flex-col gap-1', className),
|
|
300
|
+
"data-sidebar": "menu",
|
|
301
|
+
"data-slot": "sidebar-menu",
|
|
302
|
+
...props
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
306
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
307
|
+
className: cn('group/menu-item relative', className),
|
|
308
|
+
"data-sidebar": "menu-item",
|
|
309
|
+
"data-slot": "sidebar-menu-item",
|
|
310
|
+
...props
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
const sidebarMenuButtonVariants = cva('peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', {
|
|
314
|
+
variants: {
|
|
315
|
+
variant: {
|
|
316
|
+
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
317
|
+
outline: 'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]'
|
|
318
|
+
},
|
|
319
|
+
size: {
|
|
320
|
+
default: 'h-8 text-sm',
|
|
321
|
+
sm: 'h-7 text-xs',
|
|
322
|
+
lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!'
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
defaultVariants: {
|
|
326
|
+
variant: 'default',
|
|
327
|
+
size: 'default'
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
function SidebarMenuButton({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }) {
|
|
331
|
+
const Comp = asChild ? Slot.Root : 'button';
|
|
332
|
+
const { isMobile, state } = useSidebar();
|
|
333
|
+
const button = /*#__PURE__*/ _jsx(Comp, {
|
|
334
|
+
className: cn(sidebarMenuButtonVariants({
|
|
335
|
+
variant,
|
|
336
|
+
size
|
|
337
|
+
}), className),
|
|
338
|
+
"data-active": isActive,
|
|
339
|
+
"data-sidebar": "menu-button",
|
|
340
|
+
"data-size": size,
|
|
341
|
+
"data-slot": "sidebar-menu-button",
|
|
342
|
+
...props
|
|
343
|
+
});
|
|
344
|
+
if (!tooltip) {
|
|
345
|
+
return button;
|
|
346
|
+
}
|
|
347
|
+
if (typeof tooltip === 'string') {
|
|
348
|
+
tooltip = {
|
|
349
|
+
children: tooltip
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
353
|
+
children: [
|
|
354
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
355
|
+
asChild: true,
|
|
356
|
+
children: button
|
|
357
|
+
}),
|
|
358
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
359
|
+
align: "center",
|
|
360
|
+
hidden: state !== 'collapsed' || isMobile,
|
|
361
|
+
side: "right",
|
|
362
|
+
...tooltip
|
|
363
|
+
})
|
|
364
|
+
]
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
|
|
368
|
+
const Comp = asChild ? Slot.Root : 'button';
|
|
369
|
+
return /*#__PURE__*/ _jsx(Comp, {
|
|
370
|
+
className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground outline-hidden absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', // Increases the hit area of the button on mobile.
|
|
371
|
+
'after:absolute after:-inset-2 md:after:hidden', 'peer-data-[size=sm]/menu-button:top-1', 'peer-data-[size=default]/menu-button:top-1.5', 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', showOnHover && 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0', className),
|
|
372
|
+
"data-sidebar": "menu-action",
|
|
373
|
+
"data-slot": "sidebar-menu-action",
|
|
374
|
+
...props
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function SidebarMenuBadge({ className, ...props }) {
|
|
378
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
379
|
+
className: cn('text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums', 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground', 'peer-data-[size=sm]/menu-button:top-1', 'peer-data-[size=default]/menu-button:top-1.5', 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', className),
|
|
380
|
+
"data-sidebar": "menu-badge",
|
|
381
|
+
"data-slot": "sidebar-menu-badge",
|
|
382
|
+
...props
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
386
|
+
// Random width between 50 to 90%.
|
|
387
|
+
const width = React.useMemo(()=>{
|
|
388
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
389
|
+
}, []);
|
|
390
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
391
|
+
className: cn('flex h-8 items-center gap-2 rounded-md px-2', className),
|
|
392
|
+
"data-sidebar": "menu-skeleton",
|
|
393
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
394
|
+
...props,
|
|
395
|
+
children: [
|
|
396
|
+
showIcon && /*#__PURE__*/ _jsx(Skeleton, {
|
|
397
|
+
className: "size-4 rounded-md",
|
|
398
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
399
|
+
}),
|
|
400
|
+
/*#__PURE__*/ _jsx(Skeleton, {
|
|
401
|
+
className: "max-w-(--skeleton-width) h-4 flex-1",
|
|
402
|
+
"data-sidebar": "menu-skeleton-text",
|
|
403
|
+
style: {
|
|
404
|
+
'--skeleton-width': width
|
|
405
|
+
}
|
|
406
|
+
})
|
|
407
|
+
]
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
411
|
+
return /*#__PURE__*/ _jsx("ul", {
|
|
412
|
+
className: cn('border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5', 'group-data-[collapsible=icon]:hidden', className),
|
|
413
|
+
"data-sidebar": "menu-sub",
|
|
414
|
+
"data-slot": "sidebar-menu-sub",
|
|
415
|
+
...props
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function SidebarMenuSubItem({ className, ...props }) {
|
|
419
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
420
|
+
className: cn('group/menu-sub-item relative', className),
|
|
421
|
+
"data-sidebar": "menu-sub-item",
|
|
422
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
423
|
+
...props
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false, className, ...props }) {
|
|
427
|
+
const Comp = asChild ? Slot.Root : 'a';
|
|
428
|
+
return /*#__PURE__*/ _jsx(Comp, {
|
|
429
|
+
className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground outline-hidden flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground', size === 'sm' && 'text-xs', size === 'md' && 'text-sm', 'group-data-[collapsible=icon]:hidden', className),
|
|
430
|
+
"data-active": isActive,
|
|
431
|
+
"data-sidebar": "menu-sub-button",
|
|
432
|
+
"data-size": size,
|
|
433
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
434
|
+
...props
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/skeleton.tsx"],"names":[],"mappings":"AAEA,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQrE;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
function Skeleton({ className, ...props }) {
|
|
4
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
5
|
+
className: cn('bg-accent animate-pulse rounded-md', className),
|
|
6
|
+
"data-slot": "skeleton",
|
|
7
|
+
...props
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export { Skeleton };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Slider as SliderPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Slider };
|
|
5
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/slider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,YAAY,EACZ,KAAK,EACL,GAAO,EACP,GAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CA8CnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slider as SliderPrimitive } from "radix-ui";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
7
|
+
const _values = React.useMemo(()=>Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [
|
|
8
|
+
min,
|
|
9
|
+
max
|
|
10
|
+
], [
|
|
11
|
+
value,
|
|
12
|
+
defaultValue,
|
|
13
|
+
min,
|
|
14
|
+
max
|
|
15
|
+
]);
|
|
16
|
+
return /*#__PURE__*/ _jsxs(SliderPrimitive.Root, {
|
|
17
|
+
className: cn('relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50', className),
|
|
18
|
+
"data-slot": "slider",
|
|
19
|
+
defaultValue: defaultValue,
|
|
20
|
+
max: max,
|
|
21
|
+
min: min,
|
|
22
|
+
value: value,
|
|
23
|
+
...props,
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ _jsx(SliderPrimitive.Track, {
|
|
26
|
+
className: cn('bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5'),
|
|
27
|
+
"data-slot": "slider-track",
|
|
28
|
+
children: /*#__PURE__*/ _jsx(SliderPrimitive.Range, {
|
|
29
|
+
className: cn('bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full'),
|
|
30
|
+
"data-slot": "slider-range"
|
|
31
|
+
})
|
|
32
|
+
}),
|
|
33
|
+
Array.from({
|
|
34
|
+
length: _values.length
|
|
35
|
+
}, (_, index)=>/*#__PURE__*/ _jsx(SliderPrimitive.Thumb, {
|
|
36
|
+
className: "border-primary bg-background ring-ring/50 focus-visible:outline-hidden block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50",
|
|
37
|
+
"data-slot": "slider-thumb"
|
|
38
|
+
}, index))
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export { Slider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sonner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAO3C,QAAA,MAAM,OAAO,GAAI,cAAc,YAAY,4CAwB1C,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useTheme } from "next-themes";
|
|
4
|
+
import { Toaster as Sonner } from "sonner";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
const Toaster = ({ ...props })=>{
|
|
7
|
+
const { theme = 'system' } = useTheme();
|
|
8
|
+
return /*#__PURE__*/ _jsx(Sonner, {
|
|
9
|
+
className: "toaster group z-50",
|
|
10
|
+
style: {
|
|
11
|
+
'--normal-bg': 'var(--popover)',
|
|
12
|
+
'--normal-text': 'var(--popover-foreground)',
|
|
13
|
+
'--normal-border': 'var(--border)'
|
|
14
|
+
},
|
|
15
|
+
theme: theme,
|
|
16
|
+
toastOptions: {
|
|
17
|
+
classNames: {
|
|
18
|
+
toast: cn('group-[.toaster]:pointer-events-auto'),
|
|
19
|
+
...props.toastOptions?.classNames
|
|
20
|
+
},
|
|
21
|
+
...props.toastOptions
|
|
22
|
+
},
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
export { Toaster };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Switch as SwitchPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Switch };
|
|
5
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAkBnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
function Switch({ className, ...props }) {
|
|
7
|
+
return /*#__PURE__*/ _jsx(SwitchPrimitive.Root, {
|
|
8
|
+
className: cn('data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 shadow-xs peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent outline-none transition-all focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className),
|
|
9
|
+
"data-slot": "switch",
|
|
10
|
+
...props,
|
|
11
|
+
children: /*#__PURE__*/ _jsx(SwitchPrimitive.Thumb, {
|
|
12
|
+
className: cn('bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0'),
|
|
13
|
+
"data-slot": "switch-thumb"
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export { Switch };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<'table'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, };
|
|
11
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAapE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAQ1E;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAQxE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAW1E;AAED,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWpE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWrE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWrE;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,2CAQjC;AAED,OAAO,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,GACT,CAAC"}
|