@vitnode/core 1.2.0-canary.51 → 1.2.0-canary.53
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/config/next.config.ts +3 -3
- package/dist/scripts/get-config.d.ts +2 -2
- package/dist/scripts/get-config.d.ts.map +1 -1
- package/dist/scripts/plugin.d.ts.map +1 -1
- package/dist/scripts/prepare-database.d.ts.map +1 -1
- package/dist/scripts/prepare-plugins-files.d.ts.map +1 -1
- package/dist/scripts/scripts.js +4 -4
- package/dist/scripts/shared/file-utils.d.ts.map +1 -1
- package/dist/src/api/adapters/email/nodemailer.d.ts +1 -1
- package/dist/src/api/adapters/email/nodemailer.js +3 -3
- package/dist/src/api/adapters/email/resend.d.ts +1 -1
- package/dist/src/api/adapters/email/resend.js +2 -2
- package/dist/src/api/adapters/sso/discord.d.ts +1 -1
- package/dist/src/api/adapters/sso/discord.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/discord.js +21 -21
- package/dist/src/api/adapters/sso/facebook.d.ts +1 -1
- package/dist/src/api/adapters/sso/facebook.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/facebook.js +23 -23
- package/dist/src/api/adapters/sso/google.d.ts +1 -1
- package/dist/src/api/adapters/sso/google.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/google.js +21 -21
- package/dist/src/api/config.d.ts +3 -3
- package/dist/src/api/config.d.ts.map +1 -1
- package/dist/src/api/config.js +11 -11
- package/dist/src/api/lib/check-plugin-id.js +8 -8
- package/dist/src/api/lib/logger-middleware.d.ts +1 -1
- package/dist/src/api/lib/logger-middleware.js +9 -9
- package/dist/src/api/lib/module.d.ts +2 -2
- package/dist/src/api/lib/plugin.d.ts +2 -2
- package/dist/src/api/lib/plugin.d.ts.map +1 -1
- package/dist/src/api/lib/route.d.ts +2 -2
- package/dist/src/api/lib/route.d.ts.map +1 -1
- package/dist/src/api/lib/route.js +1 -1
- package/dist/src/api/lib/with-pagination.d.ts +7 -7
- package/dist/src/api/lib/with-pagination.d.ts.map +1 -1
- package/dist/src/api/lib/with-pagination.js +37 -24
- package/dist/src/api/middlewares/captcha.middleware.d.ts +1 -1
- package/dist/src/api/middlewares/captcha.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/captcha.middleware.js +14 -13
- package/dist/src/api/middlewares/global.middleware.d.ts +12 -20
- package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/global.middleware.js +29 -28
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts +3 -3
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/rate-limiter.middleware.js +4 -4
- package/dist/src/api/models/device.d.ts +1 -1
- package/dist/src/api/models/device.d.ts.map +1 -1
- package/dist/src/api/models/device.js +13 -13
- package/dist/src/api/models/email.d.ts +27 -11
- package/dist/src/api/models/email.d.ts.map +1 -1
- package/dist/src/api/models/email.js +35 -22
- package/dist/src/api/models/password.d.ts +4 -0
- package/dist/src/api/models/password.d.ts.map +1 -1
- package/dist/src/api/models/password.js +15 -7
- package/dist/src/api/models/session-admin.d.ts +2 -1
- package/dist/src/api/models/session-admin.d.ts.map +1 -1
- package/dist/src/api/models/session-admin.js +19 -19
- package/dist/src/api/models/session.d.ts +2 -1
- package/dist/src/api/models/session.d.ts.map +1 -1
- package/dist/src/api/models/session.js +17 -17
- package/dist/src/api/models/sso.d.ts +1 -1
- package/dist/src/api/models/sso.d.ts.map +1 -1
- package/dist/src/api/models/sso.js +24 -24
- package/dist/src/api/models/user/get-user-by-id.d.ts +2 -1
- package/dist/src/api/models/user/get-user-by-id.d.ts.map +1 -1
- package/dist/src/api/models/user/get-user-by-id.js +3 -2
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.js +1 -1
- package/dist/src/api/models/user/sign-up.d.ts +1 -1
- package/dist/src/api/models/user/sign-up.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-up.js +13 -14
- package/dist/src/api/models/user.d.ts +1 -0
- package/dist/src/api/models/user.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.d.ts +3 -3
- package/dist/src/api/modules/admin/admin.module.js +1 -1
- package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +1 -1
- package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -1
- package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +2 -2
- package/dist/src/api/modules/admin/debug/routes/logs.route.js +16 -16
- package/dist/src/api/modules/admin/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/admin/routes/session.route.js +7 -7
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts +2 -2
- package/dist/src/api/modules/admin/users/routes/list.route.js +12 -12
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +2 -2
- package/dist/src/api/modules/admin/users/routes/users.route.js +15 -15
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts +1 -1
- package/dist/src/api/modules/admin/users/users.admin.module.js +1 -1
- package/dist/src/api/modules/middleware/middleware.module.d.ts +1 -1
- package/dist/src/api/modules/middleware/middleware.module.js +1 -1
- package/dist/src/api/modules/middleware/route.d.ts +2 -2
- package/dist/src/api/modules/middleware/route.js +12 -12
- package/dist/src/api/modules/users/routes/change-password.route.d.ts +52 -0
- package/dist/src/api/modules/users/routes/change-password.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/change-password.route.js +58 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts +42 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.js +91 -0
- package/dist/src/api/modules/users/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/session.route.js +6 -6
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/sign-in.route.js +10 -10
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/sign-out.route.js +7 -7
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +9 -3
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/sign-up.route.js +18 -12
- package/dist/src/api/modules/users/routes/test.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/test.route.js +9 -15
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +6 -3
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/sso/routes/callback.route.js +10 -7
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +2 -2
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +6 -6
- package/dist/src/api/modules/users/sso/sso.module.d.ts +6 -3
- package/dist/src/api/modules/users/sso/sso.module.d.ts.map +1 -1
- package/dist/src/api/modules/users/sso/sso.module.js +1 -1
- package/dist/src/api/modules/users/users.module.d.ts +103 -11
- package/dist/src/api/modules/users/users.module.d.ts.map +1 -1
- package/dist/src/api/modules/users/users.module.js +6 -2
- package/dist/src/app/login/page.d.ts +1 -1
- package/dist/src/app/login/page.js +2 -2
- package/dist/src/app/login/reset-password/page.d.ts +9 -0
- package/dist/src/app/login/reset-password/page.d.ts.map +1 -0
- package/dist/src/app/login/reset-password/page.js +18 -0
- package/dist/src/app/register/page.d.ts +1 -1
- package/dist/src/app/register/page.js +2 -2
- package/dist/src/app_admin/core/debug/page.d.ts +1 -1
- package/dist/src/app_admin/core/debug/page.js +8 -8
- package/dist/src/app_admin/core/users/page.d.ts +2 -2
- package/dist/src/app_admin/core/users/page.d.ts.map +1 -1
- package/dist/src/app_admin/core/users/page.js +7 -7
- package/dist/src/components/avatar.d.ts +1 -1
- package/dist/src/components/avatar.js +1 -1
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts +2 -2
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +5 -5
- package/dist/src/components/confirm-action/content.d.ts.map +1 -1
- package/dist/src/components/confirm-action/content.js +3 -4
- package/dist/src/components/date-format.js +8 -8
- package/dist/src/components/form/auto-form.d.ts +17 -16
- package/dist/src/components/form/auto-form.d.ts.map +1 -1
- package/dist/src/components/form/auto-form.js +15 -13
- package/dist/src/components/form/common/desc.js +1 -1
- package/dist/src/components/form/common/label.d.ts +4 -2
- package/dist/src/components/form/common/label.d.ts.map +1 -1
- package/dist/src/components/form/common/label.js +14 -4
- package/dist/src/components/form/fields/checkbox.d.ts +3 -3
- package/dist/src/components/form/fields/checkbox.d.ts.map +1 -1
- package/dist/src/components/form/fields/checkbox.js +2 -1
- package/dist/src/components/form/fields/combobox-async.d.ts +4 -4
- package/dist/src/components/form/fields/combobox-async.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox-async.js +31 -24
- package/dist/src/components/form/fields/combobox.d.ts +4 -4
- package/dist/src/components/form/fields/combobox.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox.js +8 -8
- package/dist/src/components/form/fields/input.d.ts +3 -3
- package/dist/src/components/form/fields/input.d.ts.map +1 -1
- package/dist/src/components/form/fields/input.js +4 -3
- package/dist/src/components/form/fields/radio-group.d.ts +4 -4
- package/dist/src/components/form/fields/radio-group.d.ts.map +1 -1
- package/dist/src/components/form/fields/radio-group.js +2 -2
- package/dist/src/components/form/fields/select.d.ts +4 -4
- package/dist/src/components/form/fields/select.d.ts.map +1 -1
- package/dist/src/components/form/fields/select.js +4 -4
- package/dist/src/components/form/fields/switch.d.ts +3 -3
- package/dist/src/components/form/fields/switch.d.ts.map +1 -1
- package/dist/src/components/form/fields/switch.js +2 -1
- package/dist/src/components/form/fields/textarea.d.ts +4 -4
- package/dist/src/components/form/fields/textarea.d.ts.map +1 -1
- package/dist/src/components/form/fields/textarea.js +3 -3
- package/dist/src/components/i18n-provider.d.ts +2 -2
- package/dist/src/components/i18n-provider.js +3 -3
- package/dist/src/components/logo-vitnode.d.ts.map +1 -1
- package/dist/src/components/logo-vitnode.js +8 -2
- package/dist/src/components/switchers/langs/language-swietcher.d.ts +1 -1
- package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +1 -1
- package/dist/src/components/switchers/langs/language-swietcher.js +3 -3
- package/dist/src/components/switchers/themes/theme-switcher.js +4 -4
- package/dist/src/components/table/content.d.ts +1 -1
- package/dist/src/components/table/content.d.ts.map +1 -1
- package/dist/src/components/table/content.js +5 -5
- package/dist/src/components/table/data-table.d.ts +7 -7
- package/dist/src/components/table/data-table.d.ts.map +1 -1
- package/dist/src/components/table/data-table.js +22 -15
- package/dist/src/components/table/order-table-head.d.ts +4 -4
- package/dist/src/components/table/order-table-head.d.ts.map +1 -1
- package/dist/src/components/table/order-table-head.js +20 -9
- package/dist/src/components/table/pagination.js +19 -19
- package/dist/src/components/ui/accordion.d.ts +2 -2
- package/dist/src/components/ui/accordion.d.ts.map +1 -1
- package/dist/src/components/ui/accordion.js +4 -5
- package/dist/src/components/ui/alert-dialog.d.ts +7 -7
- package/dist/src/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/components/ui/alert-dialog.js +13 -14
- package/dist/src/components/ui/alert.d.ts +6 -6
- package/dist/src/components/ui/alert.d.ts.map +1 -1
- package/dist/src/components/ui/alert.js +6 -7
- package/dist/src/components/ui/badge.d.ts +4 -4
- package/dist/src/components/ui/badge.d.ts.map +1 -1
- package/dist/src/components/ui/badge.js +7 -8
- package/dist/src/components/ui/button-client.d.ts +1 -1
- package/dist/src/components/ui/button-client.js +9 -9
- package/dist/src/components/ui/button.d.ts +9 -9
- package/dist/src/components/ui/button.d.ts.map +1 -1
- package/dist/src/components/ui/button.js +14 -15
- package/dist/src/components/ui/card.d.ts +8 -8
- package/dist/src/components/ui/card.d.ts.map +1 -1
- package/dist/src/components/ui/card.js +7 -8
- package/dist/src/components/ui/checkbox.d.ts +2 -2
- package/dist/src/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/components/ui/checkbox.js +2 -3
- package/dist/src/components/ui/collapsible.d.ts +1 -1
- package/dist/src/components/ui/collapsible.js +1 -1
- package/dist/src/components/ui/command.d.ts +4 -4
- package/dist/src/components/ui/command.d.ts.map +1 -1
- package/dist/src/components/ui/command.js +9 -10
- package/dist/src/components/ui/context-menu.d.ts +4 -4
- package/dist/src/components/ui/context-menu.d.ts.map +1 -1
- package/dist/src/components/ui/context-menu.js +7 -8
- package/dist/src/components/ui/dialog.d.ts +6 -6
- package/dist/src/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/components/ui/dialog.js +16 -16
- package/dist/src/components/ui/drawer.d.ts +4 -4
- package/dist/src/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/components/ui/drawer.js +7 -8
- package/dist/src/components/ui/dropdown-menu.d.ts +4 -4
- package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/components/ui/dropdown-menu.js +8 -9
- package/dist/src/components/ui/form.d.ts +10 -10
- package/dist/src/components/ui/form.d.ts.map +1 -1
- package/dist/src/components/ui/form.js +15 -15
- package/dist/src/components/ui/header-content.js +1 -1
- package/dist/src/components/ui/hover-card.d.ts +2 -2
- package/dist/src/components/ui/hover-card.d.ts.map +1 -1
- package/dist/src/components/ui/hover-card.js +3 -4
- package/dist/src/components/ui/input-otp.d.ts +5 -5
- package/dist/src/components/ui/input-otp.d.ts.map +1 -1
- package/dist/src/components/ui/input-otp.js +6 -7
- package/dist/src/components/ui/input.d.ts +2 -2
- package/dist/src/components/ui/input.d.ts.map +1 -1
- package/dist/src/components/ui/input.js +1 -2
- package/dist/src/components/ui/label.d.ts +2 -2
- package/dist/src/components/ui/label.d.ts.map +1 -1
- package/dist/src/components/ui/label.js +2 -3
- package/dist/src/components/ui/loader.js +3 -3
- package/dist/src/components/ui/menubar.d.ts +4 -4
- package/dist/src/components/ui/menubar.d.ts.map +1 -1
- package/dist/src/components/ui/menubar.js +11 -12
- package/dist/src/components/ui/navigation-menu.d.ts +2 -2
- package/dist/src/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/src/components/ui/navigation-menu.js +10 -11
- package/dist/src/components/ui/popover.d.ts +3 -3
- package/dist/src/components/ui/popover.d.ts.map +1 -1
- package/dist/src/components/ui/popover.js +4 -4
- package/dist/src/components/ui/progress.d.ts +2 -2
- package/dist/src/components/ui/progress.d.ts.map +1 -1
- package/dist/src/components/ui/progress.js +2 -3
- package/dist/src/components/ui/radio-group.d.ts +2 -2
- package/dist/src/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/components/ui/radio-group.js +3 -4
- package/dist/src/components/ui/select.d.ts +3 -3
- package/dist/src/components/ui/select.d.ts.map +1 -1
- package/dist/src/components/ui/select.js +9 -10
- package/dist/src/components/ui/separator.d.ts +2 -2
- package/dist/src/components/ui/separator.d.ts.map +1 -1
- package/dist/src/components/ui/separator.js +3 -4
- package/dist/src/components/ui/sheet.d.ts +5 -5
- package/dist/src/components/ui/sheet.d.ts.map +1 -1
- package/dist/src/components/ui/sheet.js +8 -9
- package/dist/src/components/ui/sidebar.d.ts +31 -31
- package/dist/src/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/components/ui/sidebar.js +67 -69
- package/dist/src/components/ui/skeleton.d.ts +1 -1
- package/dist/src/components/ui/skeleton.js +1 -1
- package/dist/src/components/ui/slider.d.ts +2 -2
- package/dist/src/components/ui/slider.d.ts.map +1 -1
- package/dist/src/components/ui/slider.js +16 -8
- package/dist/src/components/ui/sonner.d.ts +1 -1
- package/dist/src/components/ui/sonner.d.ts.map +1 -1
- package/dist/src/components/ui/sonner.js +6 -6
- package/dist/src/components/ui/switch.d.ts +2 -2
- package/dist/src/components/ui/switch.d.ts.map +1 -1
- package/dist/src/components/ui/switch.js +3 -4
- package/dist/src/components/ui/table.d.ts +9 -9
- package/dist/src/components/ui/table.d.ts.map +1 -1
- package/dist/src/components/ui/table.js +8 -9
- package/dist/src/components/ui/tabs.d.ts +2 -2
- package/dist/src/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/components/ui/tabs.js +4 -5
- package/dist/src/components/ui/textarea.d.ts +2 -2
- package/dist/src/components/ui/textarea.d.ts.map +1 -1
- package/dist/src/components/ui/textarea.js +1 -2
- package/dist/src/components/ui/toggle-group.d.ts +4 -4
- package/dist/src/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/src/components/ui/toggle-group.js +6 -6
- package/dist/src/components/ui/toggle.d.ts +3 -3
- package/dist/src/components/ui/toggle.d.ts.map +1 -1
- package/dist/src/components/ui/toggle.js +8 -9
- package/dist/src/components/ui/tooltip.d.ts +3 -3
- package/dist/src/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/components/ui/tooltip.js +8 -10
- package/dist/src/config.js +2 -2
- package/dist/src/database/admins.js +10 -10
- package/dist/src/database/languages.js +7 -7
- package/dist/src/database/logs.js +9 -9
- package/dist/src/database/moderators.js +5 -5
- package/dist/src/database/roles.js +1 -1
- package/dist/src/database/sessions.js +6 -6
- package/dist/src/database/users.d.ts +21 -2
- package/dist/src/database/users.d.ts.map +1 -1
- package/dist/src/database/users.js +18 -15
- package/dist/src/drizzle.config.d.ts +2 -2
- package/dist/src/drizzle.config.d.ts.map +1 -1
- package/dist/src/drizzle.config.js +19 -12
- package/dist/src/emails/default-template.d.ts +34 -22
- package/dist/src/emails/default-template.d.ts.map +1 -1
- package/dist/src/emails/default-template.js +61 -66
- package/dist/src/emails/reset-password.d.ts +56 -0
- package/dist/src/emails/reset-password.d.ts.map +1 -0
- package/dist/src/emails/reset-password.js +132 -0
- package/dist/src/emails/ui/button.d.ts +9 -0
- package/dist/src/emails/ui/button.d.ts.map +1 -0
- package/dist/src/emails/ui/button.js +36 -0
- package/dist/src/emails/ui/card.d.ts +8 -0
- package/dist/src/emails/ui/card.d.ts.map +1 -0
- package/dist/src/emails/ui/card.js +39 -0
- package/dist/src/hooks/use-before-unload.js +3 -3
- package/dist/src/hooks/use-captcha.d.ts +2 -2
- package/dist/src/hooks/use-captcha.d.ts.map +1 -1
- package/dist/src/hooks/use-captcha.js +64 -40
- package/dist/src/hooks/use-mobile.d.ts.map +1 -1
- package/dist/src/hooks/use-mobile.js +3 -4
- package/dist/src/lib/api/get-middleware-api.js +4 -4
- package/dist/src/lib/api/get-session-admin-api.js +5 -5
- package/dist/src/lib/api/get-session-api.js +4 -4
- package/dist/src/lib/colors.js +28 -19
- package/dist/src/lib/colors.test.js +60 -60
- package/dist/src/lib/config.js +3 -3
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts.map +1 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.js +1 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +27 -27
- package/dist/src/lib/fetcher/core.d.ts +5 -5
- package/dist/src/lib/fetcher/core.d.ts.map +1 -1
- package/dist/src/lib/fetcher/core.js +16 -10
- package/dist/src/lib/fetcher/helpers-server.d.ts +1 -1
- package/dist/src/lib/fetcher/helpers-server.js +1 -1
- package/dist/src/lib/fetcher/helpers.test.js +17 -17
- package/dist/src/lib/fetcher/types.d.ts +26 -26
- package/dist/src/lib/fetcher/types.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.d.ts +4 -4
- package/dist/src/lib/fetcher-client.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.js +3 -3
- package/dist/src/lib/fetcher.d.ts +5 -5
- package/dist/src/lib/fetcher.d.ts.map +1 -1
- package/dist/src/lib/fetcher.js +4 -4
- package/dist/src/lib/helpers/auto-form.d.ts +3 -3
- package/dist/src/lib/helpers/auto-form.d.ts.map +1 -1
- package/dist/src/lib/helpers/auto-form.js +16 -15
- package/dist/src/lib/helpers/auto-form.test.js +129 -129
- package/dist/src/lib/navigation.d.ts +2 -2
- package/dist/src/lib/navigation.d.ts.map +1 -1
- package/dist/src/lib/plugin.d.ts +3 -3
- package/dist/src/lib/special-characters.js +1 -1
- package/dist/src/lib/special-characters.test.js +36 -36
- package/dist/src/lib/utils.d.ts +1 -1
- package/dist/src/tests/setup.d.ts +1 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts +1 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/admin-layout.js +4 -8
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +11 -12
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +11 -11
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.js +1 -2
- package/dist/src/views/admin/layouts/sidebar/sign-out.js +1 -1
- package/dist/src/views/admin/layouts/user-bar/client.js +5 -5
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts +1 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.js +1 -1
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +3 -2
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +3 -3
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +10 -10
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +2 -2
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +15 -15
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +7 -7
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +7 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +3 -3
- package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +25 -25
- package/dist/src/views/admin/views/core/test.js +43 -43
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/users/users-admin-view.js +13 -14
- package/dist/src/views/auth/password-reset/change-password-form/form.d.ts +5 -0
- package/dist/src/views/auth/password-reset/change-password-form/form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/form.js +48 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts +6 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +22 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts +11 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.js +36 -0
- package/dist/src/views/auth/password-reset/form/form.d.ts +6 -0
- package/dist/src/views/auth/password-reset/form/form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/form.js +104 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.d.ts +7 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.js +21 -0
- package/dist/src/views/auth/password-reset/form/use-form.d.ts +12 -0
- package/dist/src/views/auth/password-reset/form/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/use-form.js +33 -0
- package/dist/src/views/auth/password-reset/password-reset-view.d.ts +7 -0
- package/dist/src/views/auth/password-reset/password-reset-view.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/password-reset-view.js +37 -0
- package/dist/src/views/auth/sign-in/form/form.d.ts +2 -1
- package/dist/src/views/auth/sign-in/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/form.js +15 -10
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts +2 -2
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/mutation-api.js +10 -10
- package/dist/src/views/auth/sign-in/form/use-form.d.ts +2 -2
- package/dist/src/views/auth/sign-in/form/use-form.js +11 -11
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/sign-in-view.js +13 -7
- package/dist/src/views/auth/{components → sign-up/components}/password-input.d.ts +3 -3
- package/dist/src/views/auth/sign-up/components/password-input.d.ts.map +1 -0
- package/dist/src/views/auth/{components → sign-up/components}/password-input.js +13 -14
- package/dist/src/views/auth/sign-up/email-confirmation-view.js +4 -4
- package/dist/src/views/auth/sign-up/form/form.d.ts +2 -2
- package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/form.js +20 -33
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +3 -3
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/mutation-api.js +6 -6
- package/dist/src/views/auth/sign-up/form/use-form.d.ts +3 -8
- package/dist/src/views/auth/sign-up/form/use-form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/use-form.js +27 -24
- package/dist/src/views/auth/sign-up/sign-up-view.js +6 -6
- package/dist/src/views/auth/sign-up/wrapper.d.ts +1 -1
- package/dist/src/views/auth/sign-up/wrapper.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/wrapper.js +5 -8
- package/dist/src/views/auth/sso/buttons/client.js +4 -4
- package/dist/src/views/auth/sso/buttons/mutation-api.js +5 -5
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +2 -2
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +21 -7
- package/dist/src/views/auth/sso/callback/client/client.d.ts +3 -1
- package/dist/src/views/auth/sso/callback/client/client.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/client/client.js +36 -7
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +11 -6
- package/dist/src/views/error/back-button.js +1 -1
- package/dist/src/views/error/error-view.d.ts +5 -3
- package/dist/src/views/error/error-view.d.ts.map +1 -1
- package/dist/src/views/error/error-view.js +25 -23
- package/dist/src/views/error/global-error-view.d.ts +3 -3
- package/dist/src/views/error/global-error-view.d.ts.map +1 -1
- package/dist/src/views/error/global-error-view.js +36 -44
- package/dist/src/views/layouts/provider.d.ts +4 -4
- package/dist/src/views/layouts/provider.d.ts.map +1 -1
- package/dist/src/views/layouts/provider.js +3 -3
- package/dist/src/views/layouts/root-layout.d.ts +3 -3
- package/dist/src/views/layouts/root-layout.d.ts.map +1 -1
- package/dist/src/views/layouts/root-layout.js +1 -2
- package/dist/src/views/layouts/theme/header/header.d.ts +2 -2
- package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/header.js +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.js +4 -4
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +8 -8
- package/dist/src/views/layouts/theme/header/user/user.js +4 -4
- package/dist/src/views/layouts/theme/layout.d.ts +2 -2
- package/dist/src/views/layouts/theme/layout.js +1 -1
- package/dist/src/vitnode.config.d.ts +16 -13
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/src/vitnode.config.js +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -46
- package/src/app/login/page.tsx +5 -5
- package/src/app/login/reset-password/page.tsx +27 -0
- package/src/app/login/sso/[providerId]/page.tsx +1 -1
- package/src/app/register/page.tsx +5 -5
- package/src/app_admin/core/debug/page.tsx +14 -14
- package/src/app_admin/core/page.tsx +1 -1
- package/src/app_admin/core/test/page.tsx +1 -1
- package/src/app_admin/core/users/page.tsx +12 -13
- package/src/locales/en.json +42 -2
- package/dist/src/views/auth/components/password-input.d.ts.map +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { XIcon } from "lucide-react";
|
|
4
4
|
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
5
|
-
import * as React from "react";
|
|
6
5
|
import { cn } from "../../lib/utils.js";
|
|
7
6
|
function Sheet({ ...props }) {
|
|
8
7
|
return /*#__PURE__*/ _jsx(SheetPrimitive.Root, {
|
|
@@ -30,17 +29,17 @@ function SheetPortal({ ...props }) {
|
|
|
30
29
|
}
|
|
31
30
|
function SheetOverlay({ className, ...props }) {
|
|
32
31
|
return /*#__PURE__*/ _jsx(SheetPrimitive.Overlay, {
|
|
33
|
-
className: cn(
|
|
32
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
|
|
34
33
|
"data-slot": "sheet-overlay",
|
|
35
34
|
...props
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
|
-
function SheetContent({ className, children, side =
|
|
37
|
+
function SheetContent({ className, children, side = "right", ...props }) {
|
|
39
38
|
return /*#__PURE__*/ _jsxs(SheetPortal, {
|
|
40
39
|
children: [
|
|
41
40
|
/*#__PURE__*/ _jsx(SheetOverlay, {}),
|
|
42
41
|
/*#__PURE__*/ _jsxs(SheetPrimitive.Content, {
|
|
43
|
-
className: cn(
|
|
42
|
+
className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", className),
|
|
44
43
|
"data-slot": "sheet-content",
|
|
45
44
|
...props,
|
|
46
45
|
children: [
|
|
@@ -64,28 +63,28 @@ function SheetContent({ className, children, side = 'right', ...props }) {
|
|
|
64
63
|
}
|
|
65
64
|
function SheetHeader({ className, ...props }) {
|
|
66
65
|
return /*#__PURE__*/ _jsx("div", {
|
|
67
|
-
className: cn(
|
|
66
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
68
67
|
"data-slot": "sheet-header",
|
|
69
68
|
...props
|
|
70
69
|
});
|
|
71
70
|
}
|
|
72
71
|
function SheetFooter({ className, ...props }) {
|
|
73
72
|
return /*#__PURE__*/ _jsx("div", {
|
|
74
|
-
className: cn(
|
|
73
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
75
74
|
"data-slot": "sheet-footer",
|
|
76
75
|
...props
|
|
77
76
|
});
|
|
78
77
|
}
|
|
79
78
|
function SheetTitle({ className, ...props }) {
|
|
80
79
|
return /*#__PURE__*/ _jsx(SheetPrimitive.Title, {
|
|
81
|
-
className: cn(
|
|
80
|
+
className: cn("text-foreground font-semibold", className),
|
|
82
81
|
"data-slot": "sheet-title",
|
|
83
82
|
...props
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
85
|
function SheetDescription({ className, ...props }) {
|
|
87
86
|
return /*#__PURE__*/ _jsx(SheetPrimitive.Description, {
|
|
88
|
-
className: cn(
|
|
87
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
89
88
|
"data-slot": "sheet-description",
|
|
90
89
|
...props
|
|
91
90
|
});
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { type VariantProps } from
|
|
2
|
-
import
|
|
3
|
-
import { Button } from
|
|
4
|
-
import { Input } from
|
|
5
|
-
import { Separator } from
|
|
6
|
-
import { TooltipContent } from
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Button } from "../../components/ui/button";
|
|
4
|
+
import { Input } from "../../components/ui/input";
|
|
5
|
+
import { Separator } from "../../components/ui/separator";
|
|
6
|
+
import { TooltipContent } from "../../components/ui/tooltip";
|
|
7
7
|
interface SidebarContextProps {
|
|
8
8
|
isMobile: boolean;
|
|
9
9
|
open: boolean;
|
|
10
10
|
openMobile: boolean;
|
|
11
11
|
setOpen: (open: boolean) => void;
|
|
12
12
|
setOpenMobile: (open: boolean) => void;
|
|
13
|
-
state:
|
|
13
|
+
state: "collapsed" | "expanded";
|
|
14
14
|
toggleSidebar: () => void;
|
|
15
15
|
}
|
|
16
16
|
declare function useSidebar(): SidebarContextProps;
|
|
17
|
-
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<
|
|
17
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<"div"> & {
|
|
18
18
|
defaultOpen?: boolean;
|
|
19
19
|
onOpenChange?: (open: boolean) => void;
|
|
20
20
|
open?: boolean;
|
|
21
21
|
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<
|
|
23
|
-
collapsible?:
|
|
24
|
-
side?:
|
|
25
|
-
variant?:
|
|
22
|
+
declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<"div"> & {
|
|
23
|
+
collapsible?: "icon" | "none" | "offcanvas";
|
|
24
|
+
side?: "left" | "right";
|
|
25
|
+
variant?: "floating" | "inset" | "sidebar";
|
|
26
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
declare function SidebarRail({ className, ...props }: React.ComponentProps<
|
|
29
|
-
declare function SidebarInset({ className, ...props }: React.ComponentProps<
|
|
28
|
+
declare function SidebarRail({ className, ...props }: React.ComponentProps<"button">): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
declare function SidebarHeader({ className, ...props }: React.ComponentProps<
|
|
32
|
-
declare function SidebarFooter({ className, ...props }: React.ComponentProps<
|
|
31
|
+
declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
declare function SidebarContent({ className, ...props }: React.ComponentProps<
|
|
35
|
-
declare function SidebarGroup({ className, ...props }: React.ComponentProps<
|
|
36
|
-
declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<
|
|
34
|
+
declare function SidebarContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare function SidebarGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
37
37
|
asChild?: boolean;
|
|
38
38
|
}): import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<
|
|
39
|
+
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<"button"> & {
|
|
40
40
|
asChild?: boolean;
|
|
41
41
|
}): import("react/jsx-runtime").JSX.Element;
|
|
42
|
-
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<
|
|
43
|
-
declare function SidebarMenu({ className, ...props }: React.ComponentProps<
|
|
44
|
-
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<
|
|
42
|
+
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
46
46
|
variant?: "default" | "outline" | null | undefined;
|
|
47
47
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
48
48
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
49
|
-
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<
|
|
49
|
+
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<"button"> & VariantProps<typeof sidebarMenuButtonVariants> & {
|
|
50
50
|
asChild?: boolean;
|
|
51
51
|
isActive?: boolean;
|
|
52
52
|
tooltip?: React.ComponentProps<typeof TooltipContent> | string;
|
|
53
53
|
}): import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<
|
|
54
|
+
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<"button"> & {
|
|
55
55
|
asChild?: boolean;
|
|
56
56
|
showOnHover?: boolean;
|
|
57
57
|
}): import("react/jsx-runtime").JSX.Element;
|
|
58
|
-
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<
|
|
59
|
-
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<
|
|
58
|
+
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<"div"> & {
|
|
60
60
|
showIcon?: boolean;
|
|
61
61
|
}): import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<
|
|
63
|
-
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<
|
|
64
|
-
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<
|
|
62
|
+
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<"a"> & {
|
|
65
65
|
asChild?: boolean;
|
|
66
66
|
isActive?: boolean;
|
|
67
|
-
size?:
|
|
67
|
+
size?: "md" | "sm";
|
|
68
68
|
}): import("react/jsx-runtime").JSX.Element;
|
|
69
69
|
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, };
|
|
70
70
|
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sidebar.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { PanelLeftIcon } from "lucide-react";
|
|
5
5
|
import { useTranslations } from "next-intl";
|
|
6
6
|
import { Slot } from "radix-ui";
|
|
7
|
-
import
|
|
7
|
+
import React from "react";
|
|
8
8
|
import { Button } from "./button.js";
|
|
9
9
|
import { Input } from "./input.js";
|
|
10
10
|
import { Separator } from "./separator.js";
|
|
@@ -13,17 +13,17 @@ import { Skeleton } from "./skeleton.js";
|
|
|
13
13
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
14
14
|
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
15
15
|
import { cn } from "../../lib/utils.js";
|
|
16
|
-
const SIDEBAR_COOKIE_NAME =
|
|
16
|
+
const SIDEBAR_COOKIE_NAME = "vitnode_admin_sidebar_state";
|
|
17
17
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
18
|
-
const SIDEBAR_WIDTH =
|
|
19
|
-
const SIDEBAR_WIDTH_MOBILE =
|
|
20
|
-
const SIDEBAR_WIDTH_ICON =
|
|
21
|
-
const SIDEBAR_KEYBOARD_SHORTCUT =
|
|
18
|
+
const SIDEBAR_WIDTH = "16rem";
|
|
19
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
20
|
+
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
21
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
22
22
|
const SidebarContext = /*#__PURE__*/ React.createContext(null);
|
|
23
23
|
function useSidebar() {
|
|
24
24
|
const context = React.use(SidebarContext);
|
|
25
25
|
if (!context) {
|
|
26
|
-
throw new Error(
|
|
26
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
27
27
|
}
|
|
28
28
|
return context;
|
|
29
29
|
}
|
|
@@ -35,14 +35,14 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
35
35
|
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
36
36
|
const open = openProp ?? _open;
|
|
37
37
|
const setOpen = React.useCallback((value)=>{
|
|
38
|
-
const openState = typeof value ===
|
|
38
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
39
39
|
if (setOpenProp) {
|
|
40
40
|
setOpenProp(openState);
|
|
41
41
|
} else {
|
|
42
42
|
_setOpen(openState);
|
|
43
43
|
}
|
|
44
44
|
// This sets the cookie to keep the sidebar state.
|
|
45
|
-
//
|
|
45
|
+
// biome-ignore lint/suspicious/noDocumentCookie: <needed for client side>
|
|
46
46
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
47
47
|
}, [
|
|
48
48
|
setOpenProp,
|
|
@@ -53,8 +53,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
53
53
|
return isMobile ? setOpenMobile((open)=>!open) : setOpen((open)=>!open);
|
|
54
54
|
}, [
|
|
55
55
|
isMobile,
|
|
56
|
-
setOpen
|
|
57
|
-
setOpenMobile
|
|
56
|
+
setOpen
|
|
58
57
|
]);
|
|
59
58
|
// Adds a keyboard shortcut to toggle the sidebar.
|
|
60
59
|
React.useEffect(()=>{
|
|
@@ -64,14 +63,14 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
64
63
|
toggleSidebar();
|
|
65
64
|
}
|
|
66
65
|
};
|
|
67
|
-
window.addEventListener(
|
|
68
|
-
return ()=>window.removeEventListener(
|
|
66
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
67
|
+
return ()=>window.removeEventListener("keydown", handleKeyDown);
|
|
69
68
|
}, [
|
|
70
69
|
toggleSidebar
|
|
71
70
|
]);
|
|
72
71
|
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
73
72
|
// This makes it easier to style the sidebar with Tailwind classes.
|
|
74
|
-
const state = open ?
|
|
73
|
+
const state = open ? "expanded" : "collapsed";
|
|
75
74
|
const contextValue = React.useMemo(()=>({
|
|
76
75
|
state,
|
|
77
76
|
open,
|
|
@@ -86,7 +85,6 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
86
85
|
setOpen,
|
|
87
86
|
isMobile,
|
|
88
87
|
openMobile,
|
|
89
|
-
setOpenMobile,
|
|
90
88
|
toggleSidebar
|
|
91
89
|
]);
|
|
92
90
|
return /*#__PURE__*/ _jsx(SidebarContext, {
|
|
@@ -94,11 +92,11 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
94
92
|
children: /*#__PURE__*/ _jsx(TooltipProvider, {
|
|
95
93
|
delayDuration: 0,
|
|
96
94
|
children: /*#__PURE__*/ _jsx("div", {
|
|
97
|
-
className: cn(
|
|
95
|
+
className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", className),
|
|
98
96
|
"data-slot": "sidebar-wrapper",
|
|
99
97
|
style: {
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
99
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
102
100
|
...style
|
|
103
101
|
},
|
|
104
102
|
...props,
|
|
@@ -107,11 +105,11 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
107
105
|
})
|
|
108
106
|
});
|
|
109
107
|
}
|
|
110
|
-
function Sidebar({ side =
|
|
108
|
+
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }) {
|
|
111
109
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
112
|
-
if (collapsible ===
|
|
110
|
+
if (collapsible === "none") {
|
|
113
111
|
return /*#__PURE__*/ _jsx("div", {
|
|
114
|
-
className: cn(
|
|
112
|
+
className: cn("bg-sidebar text-sidebar-foreground w-(--sidebar-width) flex h-full flex-col", className),
|
|
115
113
|
"data-slot": "sidebar",
|
|
116
114
|
...props,
|
|
117
115
|
children: children
|
|
@@ -129,7 +127,7 @@ function Sidebar({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas'
|
|
|
129
127
|
"data-slot": "sidebar",
|
|
130
128
|
side: side,
|
|
131
129
|
style: {
|
|
132
|
-
|
|
130
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
133
131
|
},
|
|
134
132
|
children: [
|
|
135
133
|
/*#__PURE__*/ _jsxs(SheetHeader, {
|
|
@@ -153,19 +151,19 @@ function Sidebar({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas'
|
|
|
153
151
|
}
|
|
154
152
|
return /*#__PURE__*/ _jsxs("div", {
|
|
155
153
|
className: "text-sidebar-foreground group peer hidden md:block",
|
|
156
|
-
"data-collapsible": state ===
|
|
154
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
157
155
|
"data-side": side,
|
|
158
156
|
"data-slot": "sidebar",
|
|
159
157
|
"data-state": state,
|
|
160
158
|
"data-variant": variant,
|
|
161
159
|
children: [
|
|
162
160
|
/*#__PURE__*/ _jsx("div", {
|
|
163
|
-
className: cn(
|
|
161
|
+
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)"),
|
|
164
162
|
"data-slot": "sidebar-gap"
|
|
165
163
|
}),
|
|
166
164
|
/*#__PURE__*/ _jsx("div", {
|
|
167
|
-
className: cn(
|
|
168
|
-
variant ===
|
|
165
|
+
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.
|
|
166
|
+
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),
|
|
169
167
|
"data-slot": "sidebar-container",
|
|
170
168
|
...props,
|
|
171
169
|
children: /*#__PURE__*/ _jsx("div", {
|
|
@@ -180,10 +178,10 @@ function Sidebar({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas'
|
|
|
180
178
|
}
|
|
181
179
|
function SidebarTrigger({ className, onClick, ...props }) {
|
|
182
180
|
const { toggleSidebar } = useSidebar();
|
|
183
|
-
const t = useTranslations(
|
|
181
|
+
const t = useTranslations("core.global");
|
|
184
182
|
return /*#__PURE__*/ _jsx(Button, {
|
|
185
|
-
"aria-label": t(
|
|
186
|
-
className: cn(
|
|
183
|
+
"aria-label": t("toggle_sidebar"),
|
|
184
|
+
className: cn("size-7", className),
|
|
187
185
|
"data-sidebar": "trigger",
|
|
188
186
|
"data-slot": "sidebar-trigger",
|
|
189
187
|
onClick: (event)=>{
|
|
@@ -200,7 +198,7 @@ function SidebarRail({ className, ...props }) {
|
|
|
200
198
|
const { toggleSidebar } = useSidebar();
|
|
201
199
|
return /*#__PURE__*/ _jsx("button", {
|
|
202
200
|
"aria-label": "Toggle Sidebar",
|
|
203
|
-
className: cn(
|
|
201
|
+
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),
|
|
204
202
|
"data-sidebar": "rail",
|
|
205
203
|
"data-slot": "sidebar-rail",
|
|
206
204
|
onClick: toggleSidebar,
|
|
@@ -212,14 +210,14 @@ function SidebarRail({ className, ...props }) {
|
|
|
212
210
|
}
|
|
213
211
|
function SidebarInset({ className, ...props }) {
|
|
214
212
|
return /*#__PURE__*/ _jsx("main", {
|
|
215
|
-
className: cn(
|
|
213
|
+
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),
|
|
216
214
|
"data-slot": "sidebar-inset",
|
|
217
215
|
...props
|
|
218
216
|
});
|
|
219
217
|
}
|
|
220
218
|
function SidebarInput({ className, ...props }) {
|
|
221
219
|
return /*#__PURE__*/ _jsx(Input, {
|
|
222
|
-
className: cn(
|
|
220
|
+
className: cn("bg-background h-8 w-full shadow-none", className),
|
|
223
221
|
"data-sidebar": "input",
|
|
224
222
|
"data-slot": "sidebar-input",
|
|
225
223
|
...props
|
|
@@ -227,7 +225,7 @@ function SidebarInput({ className, ...props }) {
|
|
|
227
225
|
}
|
|
228
226
|
function SidebarHeader({ className, ...props }) {
|
|
229
227
|
return /*#__PURE__*/ _jsx("div", {
|
|
230
|
-
className: cn(
|
|
228
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
231
229
|
"data-sidebar": "header",
|
|
232
230
|
"data-slot": "sidebar-header",
|
|
233
231
|
...props
|
|
@@ -235,7 +233,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
235
233
|
}
|
|
236
234
|
function SidebarFooter({ className, ...props }) {
|
|
237
235
|
return /*#__PURE__*/ _jsx("div", {
|
|
238
|
-
className: cn(
|
|
236
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
239
237
|
"data-sidebar": "footer",
|
|
240
238
|
"data-slot": "sidebar-footer",
|
|
241
239
|
...props
|
|
@@ -243,7 +241,7 @@ function SidebarFooter({ className, ...props }) {
|
|
|
243
241
|
}
|
|
244
242
|
function SidebarSeparator({ className, ...props }) {
|
|
245
243
|
return /*#__PURE__*/ _jsx(Separator, {
|
|
246
|
-
className: cn(
|
|
244
|
+
className: cn("bg-sidebar-border mx-2 w-auto", className),
|
|
247
245
|
"data-sidebar": "separator",
|
|
248
246
|
"data-slot": "sidebar-separator",
|
|
249
247
|
...props
|
|
@@ -251,7 +249,7 @@ function SidebarSeparator({ className, ...props }) {
|
|
|
251
249
|
}
|
|
252
250
|
function SidebarContent({ className, ...props }) {
|
|
253
251
|
return /*#__PURE__*/ _jsx("div", {
|
|
254
|
-
className: cn(
|
|
252
|
+
className: cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
|
|
255
253
|
"data-sidebar": "content",
|
|
256
254
|
"data-slot": "sidebar-content",
|
|
257
255
|
...props
|
|
@@ -259,26 +257,26 @@ function SidebarContent({ className, ...props }) {
|
|
|
259
257
|
}
|
|
260
258
|
function SidebarGroup({ className, ...props }) {
|
|
261
259
|
return /*#__PURE__*/ _jsx("div", {
|
|
262
|
-
className: cn(
|
|
260
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
263
261
|
"data-sidebar": "group",
|
|
264
262
|
"data-slot": "sidebar-group",
|
|
265
263
|
...props
|
|
266
264
|
});
|
|
267
265
|
}
|
|
268
266
|
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
269
|
-
const Comp = asChild ? Slot.Root :
|
|
267
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
270
268
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
271
|
-
className: cn(
|
|
269
|
+
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),
|
|
272
270
|
"data-sidebar": "group-label",
|
|
273
271
|
"data-slot": "sidebar-group-label",
|
|
274
272
|
...props
|
|
275
273
|
});
|
|
276
274
|
}
|
|
277
275
|
function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
278
|
-
const Comp = asChild ? Slot.Root :
|
|
276
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
279
277
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
280
|
-
className: cn(
|
|
281
|
-
|
|
278
|
+
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.
|
|
279
|
+
"after:absolute after:-inset-2 md:after:hidden", "group-data-[collapsible=icon]:hidden", className),
|
|
282
280
|
"data-sidebar": "group-action",
|
|
283
281
|
"data-slot": "sidebar-group-action",
|
|
284
282
|
...props
|
|
@@ -286,7 +284,7 @@ function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
|
286
284
|
}
|
|
287
285
|
function SidebarGroupContent({ className, ...props }) {
|
|
288
286
|
return /*#__PURE__*/ _jsx("div", {
|
|
289
|
-
className: cn(
|
|
287
|
+
className: cn("w-full text-sm", className),
|
|
290
288
|
"data-sidebar": "group-content",
|
|
291
289
|
"data-slot": "sidebar-group-content",
|
|
292
290
|
...props
|
|
@@ -294,7 +292,7 @@ function SidebarGroupContent({ className, ...props }) {
|
|
|
294
292
|
}
|
|
295
293
|
function SidebarMenu({ className, ...props }) {
|
|
296
294
|
return /*#__PURE__*/ _jsx("ul", {
|
|
297
|
-
className: cn(
|
|
295
|
+
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
298
296
|
"data-sidebar": "menu",
|
|
299
297
|
"data-slot": "sidebar-menu",
|
|
300
298
|
...props
|
|
@@ -302,31 +300,31 @@ function SidebarMenu({ className, ...props }) {
|
|
|
302
300
|
}
|
|
303
301
|
function SidebarMenuItem({ className, ...props }) {
|
|
304
302
|
return /*#__PURE__*/ _jsx("li", {
|
|
305
|
-
className: cn(
|
|
303
|
+
className: cn("group/menu-item relative", className),
|
|
306
304
|
"data-sidebar": "menu-item",
|
|
307
305
|
"data-slot": "sidebar-menu-item",
|
|
308
306
|
...props
|
|
309
307
|
});
|
|
310
308
|
}
|
|
311
|
-
const sidebarMenuButtonVariants = cva(
|
|
309
|
+
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", {
|
|
312
310
|
variants: {
|
|
313
311
|
variant: {
|
|
314
|
-
default:
|
|
315
|
-
outline:
|
|
312
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
313
|
+
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))]"
|
|
316
314
|
},
|
|
317
315
|
size: {
|
|
318
|
-
default:
|
|
319
|
-
sm:
|
|
320
|
-
lg:
|
|
316
|
+
default: "h-8 text-sm",
|
|
317
|
+
sm: "h-7 text-xs",
|
|
318
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
321
319
|
}
|
|
322
320
|
},
|
|
323
321
|
defaultVariants: {
|
|
324
|
-
variant:
|
|
325
|
-
size:
|
|
322
|
+
variant: "default",
|
|
323
|
+
size: "default"
|
|
326
324
|
}
|
|
327
325
|
});
|
|
328
|
-
function SidebarMenuButton({ asChild = false, isActive = false, variant =
|
|
329
|
-
const Comp = asChild ? Slot.Root :
|
|
326
|
+
function SidebarMenuButton({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
|
|
327
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
330
328
|
const { isMobile, state } = useSidebar();
|
|
331
329
|
const button = /*#__PURE__*/ _jsx(Comp, {
|
|
332
330
|
className: cn(sidebarMenuButtonVariants({
|
|
@@ -342,7 +340,7 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = 'defau
|
|
|
342
340
|
if (!tooltip) {
|
|
343
341
|
return button;
|
|
344
342
|
}
|
|
345
|
-
if (typeof tooltip ===
|
|
343
|
+
if (typeof tooltip === "string") {
|
|
346
344
|
tooltip = {
|
|
347
345
|
children: tooltip
|
|
348
346
|
};
|
|
@@ -355,7 +353,7 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = 'defau
|
|
|
355
353
|
}),
|
|
356
354
|
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
357
355
|
align: "center",
|
|
358
|
-
hidden: state !==
|
|
356
|
+
hidden: state !== "collapsed" || isMobile,
|
|
359
357
|
side: "right",
|
|
360
358
|
...tooltip
|
|
361
359
|
})
|
|
@@ -363,10 +361,10 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = 'defau
|
|
|
363
361
|
});
|
|
364
362
|
}
|
|
365
363
|
function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
|
|
366
|
-
const Comp = asChild ? Slot.Root :
|
|
364
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
367
365
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
368
|
-
className: cn(
|
|
369
|
-
|
|
366
|
+
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.
|
|
367
|
+
"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),
|
|
370
368
|
"data-sidebar": "menu-action",
|
|
371
369
|
"data-slot": "sidebar-menu-action",
|
|
372
370
|
...props
|
|
@@ -374,7 +372,7 @@ function SidebarMenuAction({ className, asChild = false, showOnHover = false, ..
|
|
|
374
372
|
}
|
|
375
373
|
function SidebarMenuBadge({ className, ...props }) {
|
|
376
374
|
return /*#__PURE__*/ _jsx("div", {
|
|
377
|
-
className: cn(
|
|
375
|
+
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),
|
|
378
376
|
"data-sidebar": "menu-badge",
|
|
379
377
|
"data-slot": "sidebar-menu-badge",
|
|
380
378
|
...props
|
|
@@ -386,7 +384,7 @@ function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
|
386
384
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
387
385
|
}, []);
|
|
388
386
|
return /*#__PURE__*/ _jsxs("div", {
|
|
389
|
-
className: cn(
|
|
387
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
390
388
|
"data-sidebar": "menu-skeleton",
|
|
391
389
|
"data-slot": "sidebar-menu-skeleton",
|
|
392
390
|
...props,
|
|
@@ -399,7 +397,7 @@ function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
|
399
397
|
className: "max-w-(--skeleton-width) h-4 flex-1",
|
|
400
398
|
"data-sidebar": "menu-skeleton-text",
|
|
401
399
|
style: {
|
|
402
|
-
|
|
400
|
+
"--skeleton-width": width
|
|
403
401
|
}
|
|
404
402
|
})
|
|
405
403
|
]
|
|
@@ -407,7 +405,7 @@ function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
|
407
405
|
}
|
|
408
406
|
function SidebarMenuSub({ className, ...props }) {
|
|
409
407
|
return /*#__PURE__*/ _jsx("ul", {
|
|
410
|
-
className: cn(
|
|
408
|
+
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),
|
|
411
409
|
"data-sidebar": "menu-sub",
|
|
412
410
|
"data-slot": "sidebar-menu-sub",
|
|
413
411
|
...props
|
|
@@ -415,16 +413,16 @@ function SidebarMenuSub({ className, ...props }) {
|
|
|
415
413
|
}
|
|
416
414
|
function SidebarMenuSubItem({ className, ...props }) {
|
|
417
415
|
return /*#__PURE__*/ _jsx("li", {
|
|
418
|
-
className: cn(
|
|
416
|
+
className: cn("group/menu-sub-item relative", className),
|
|
419
417
|
"data-sidebar": "menu-sub-item",
|
|
420
418
|
"data-slot": "sidebar-menu-sub-item",
|
|
421
419
|
...props
|
|
422
420
|
});
|
|
423
421
|
}
|
|
424
|
-
function SidebarMenuSubButton({ asChild = false, size =
|
|
425
|
-
const Comp = asChild ? Slot.Root :
|
|
422
|
+
function SidebarMenuSubButton({ asChild = false, size = "md", isActive = false, className, ...props }) {
|
|
423
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
426
424
|
return /*#__PURE__*/ _jsx(Comp, {
|
|
427
|
-
className: cn(
|
|
425
|
+
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),
|
|
428
426
|
"data-active": isActive,
|
|
429
427
|
"data-sidebar": "menu-sub-button",
|
|
430
428
|
"data-size": size,
|