kaze 1.4.0 → 2.0.0

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.
Files changed (261) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -1
  3. data/README.md +1 -1
  4. data/lib/kaze/commands/app/hotwire_stack.rb +2 -0
  5. data/lib/kaze/commands/app/inertia_react_stack.rb +5 -1
  6. data/lib/kaze/commands/app/inertia_vue_stack.rb +5 -1
  7. data/lib/kaze/commands/app.rb +9 -2
  8. data/lib/kaze/version.rb +1 -1
  9. data/stubs/default/config/routes.rb +11 -4
  10. data/stubs/default/test/integration/appearance_test.rb +11 -0
  11. data/stubs/default/test/integration/password_update_test.rb +9 -1
  12. data/stubs/hotwire/app/assets/tailwind/application.css +119 -1
  13. data/stubs/hotwire/app/components/breadcrumbs_component.rb +32 -0
  14. data/stubs/hotwire/app/components/danger_button_component.rb +1 -1
  15. data/stubs/hotwire/app/components/dropdown_component.html.erb +2 -2
  16. data/stubs/hotwire/app/components/dropdown_component.rb +5 -1
  17. data/stubs/hotwire/app/components/dropdown_link_component.rb +1 -1
  18. data/stubs/hotwire/app/components/heading_component.rb +19 -0
  19. data/stubs/hotwire/app/components/icon_component.rb +30 -0
  20. data/stubs/hotwire/app/components/input_error_component.rb +1 -1
  21. data/stubs/hotwire/app/components/input_label_component.rb +3 -3
  22. data/stubs/hotwire/app/components/modal_component.html.erb +2 -2
  23. data/stubs/hotwire/app/components/primary_button_component.rb +1 -1
  24. data/stubs/hotwire/app/components/secondary_button_component.rb +1 -1
  25. data/stubs/hotwire/app/components/sidebar_menu_button_component.rb +25 -0
  26. data/stubs/hotwire/app/components/text_input_component.rb +1 -1
  27. data/stubs/hotwire/app/components/user_avatar_component.rb +27 -0
  28. data/stubs/hotwire/app/controllers/application_controller.rb +1 -0
  29. data/stubs/hotwire/app/controllers/concerns/sidebar_state.rb +14 -0
  30. data/stubs/hotwire/app/controllers/settings/appearance_controller.rb +7 -0
  31. data/stubs/hotwire/app/controllers/settings/password_controller.rb +19 -0
  32. data/stubs/hotwire/app/controllers/{profile_controller.rb → settings/profile_controller.rb} +3 -4
  33. data/stubs/hotwire/app/views/auth/login.html.erb +1 -1
  34. data/stubs/hotwire/app/views/dashboard/index.html.erb +6 -11
  35. data/stubs/hotwire/app/views/layouts/_settings.html.erb +26 -0
  36. data/stubs/hotwire/app/views/layouts/_sidebar.html.erb +56 -0
  37. data/stubs/hotwire/app/views/layouts/_sidebar_header.html.erb +11 -0
  38. data/stubs/hotwire/app/views/layouts/_sidebar_user.html.erb +34 -0
  39. data/stubs/hotwire/app/views/layouts/application.html.erb +24 -15
  40. data/stubs/hotwire/app/views/settings/appearance/_update_appearance_form.html.erb +28 -0
  41. data/stubs/hotwire/app/views/settings/appearance/edit.html.erb +10 -0
  42. data/stubs/hotwire/app/views/{profile/partials → settings/password}/_update_password_form.html.erb +2 -10
  43. data/stubs/hotwire/app/views/settings/password/edit.html.erb +10 -0
  44. data/stubs/hotwire/app/views/{profile/partials → settings/profile}/_confirm_user_deletion_modal.html.erb +2 -2
  45. data/stubs/hotwire/app/views/settings/profile/_delete_user_form.html.erb +6 -0
  46. data/stubs/hotwire/app/views/{profile/partials → settings/profile}/_update_profile_information_form.html.erb +4 -12
  47. data/stubs/hotwire/app/views/{profile → settings/profile}/destroy.turbo_stream.erb +1 -1
  48. data/stubs/hotwire/app/views/settings/profile/edit.html.erb +14 -0
  49. data/stubs/inertia-common/app/controllers/concerns/handle_inertia_requests.rb +4 -1
  50. data/stubs/inertia-common/app/controllers/settings/appearance_controller.rb +7 -0
  51. data/stubs/inertia-common/app/controllers/settings/password_controller.rb +17 -0
  52. data/stubs/inertia-common/app/controllers/{profile_controller.rb → settings/profile_controller.rb} +2 -2
  53. data/stubs/inertia-common/test/integration/appearance_test.rb +11 -0
  54. data/stubs/inertia-common/test/integration/password_update_test.rb +10 -2
  55. data/stubs/inertia-react-ts/app/assets/tailwind/application.css +120 -1
  56. data/stubs/inertia-react-ts/app/javascript/Components/AppLogo.tsx +17 -0
  57. data/stubs/inertia-react-ts/app/javascript/Components/AppShell.tsx +9 -0
  58. data/stubs/inertia-react-ts/app/javascript/Components/AppSidebar.tsx +65 -0
  59. data/stubs/inertia-react-ts/app/javascript/Components/AppSidebarHeader.tsx +14 -0
  60. data/stubs/inertia-react-ts/app/javascript/Components/Breadcrumbs.tsx +43 -0
  61. data/stubs/inertia-react-ts/app/javascript/Components/Heading.tsx +19 -0
  62. data/stubs/inertia-react-ts/app/javascript/Components/InputError.tsx +1 -1
  63. data/stubs/inertia-react-ts/app/javascript/Components/NavFooter.tsx +32 -0
  64. data/stubs/inertia-react-ts/app/javascript/Components/NavMain.tsx +32 -0
  65. data/stubs/inertia-react-ts/app/javascript/Components/NavUser.tsx +39 -0
  66. data/stubs/inertia-react-ts/app/javascript/Components/UserInfo.tsx +23 -0
  67. data/stubs/inertia-react-ts/app/javascript/Components/UserMenuContent.tsx +57 -0
  68. data/stubs/inertia-react-ts/app/javascript/Components/ui/avatar.tsx +51 -0
  69. data/stubs/inertia-react-ts/app/javascript/Components/ui/breadcrumb.tsx +109 -0
  70. data/stubs/inertia-react-ts/app/javascript/Components/ui/button.tsx +49 -0
  71. data/stubs/inertia-react-ts/app/javascript/Components/ui/checkbox.tsx +27 -0
  72. data/stubs/inertia-react-ts/app/javascript/Components/ui/dialog.tsx +109 -0
  73. data/stubs/inertia-react-ts/app/javascript/Components/ui/dropdown-menu.tsx +217 -0
  74. data/stubs/inertia-react-ts/app/javascript/Components/ui/input.tsx +21 -0
  75. data/stubs/inertia-react-ts/app/javascript/Components/ui/label.tsx +19 -0
  76. data/stubs/inertia-react-ts/app/javascript/Components/ui/separator.tsx +26 -0
  77. data/stubs/inertia-react-ts/app/javascript/Components/ui/sheet.tsx +137 -0
  78. data/stubs/inertia-react-ts/app/javascript/Components/ui/sidebar.tsx +719 -0
  79. data/stubs/inertia-react-ts/app/javascript/Components/ui/skeleton.tsx +13 -0
  80. data/stubs/inertia-react-ts/app/javascript/Components/ui/tooltip.tsx +55 -0
  81. data/stubs/inertia-react-ts/app/javascript/Layouts/AuthenticatedLayout.tsx +19 -127
  82. data/stubs/inertia-react-ts/app/javascript/Layouts/GuestLayout.tsx +1 -1
  83. data/stubs/inertia-react-ts/app/javascript/Layouts/SettingsLayout.tsx +57 -0
  84. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx +6 -6
  85. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Login.tsx +17 -12
  86. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Register.tsx +14 -14
  87. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ResetPassword.tsx +10 -10
  88. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/VerifyEmail.tsx +2 -2
  89. data/stubs/inertia-react-ts/app/javascript/Pages/Dashboard.tsx +13 -8
  90. data/stubs/inertia-react-ts/app/javascript/Pages/Settings/Appearance.tsx +33 -0
  91. data/stubs/inertia-react-ts/app/javascript/Pages/Settings/Partials/DeleteUserForm.tsx +107 -0
  92. data/stubs/inertia-react-ts/app/javascript/Pages/Settings/Partials/UpdateAppearanceForm.tsx +41 -0
  93. data/stubs/inertia-react-ts/app/javascript/Pages/{Profile → Settings}/Partials/UpdatePasswordForm.tsx +12 -20
  94. data/stubs/inertia-react-ts/app/javascript/Pages/{Profile → Settings}/Partials/UpdateProfileInformationForm.tsx +13 -21
  95. data/stubs/inertia-react-ts/app/javascript/Pages/Settings/Password.tsx +33 -0
  96. data/stubs/inertia-react-ts/app/javascript/Pages/Settings/Profile.tsx +35 -0
  97. data/stubs/inertia-react-ts/app/javascript/entrypoints/application.tsx +6 -1
  98. data/stubs/inertia-react-ts/app/javascript/hooks/use-initials.tsx +23 -0
  99. data/stubs/inertia-react-ts/app/javascript/hooks/use-mobile-navigation.tsx +11 -0
  100. data/stubs/inertia-react-ts/app/javascript/hooks/use-mobile.tsx +36 -0
  101. data/stubs/inertia-react-ts/app/javascript/lib/appearance.ts +1 -2
  102. data/stubs/inertia-react-ts/app/javascript/lib/utils.ts +6 -0
  103. data/stubs/inertia-react-ts/app/javascript/types/global.d.ts +2 -2
  104. data/stubs/inertia-react-ts/app/javascript/types/index.d.ts +14 -0
  105. data/stubs/inertia-react-ts/components.json +21 -0
  106. data/stubs/inertia-react-ts/package.json +13 -0
  107. data/stubs/inertia-vue-ts/app/assets/tailwind/application.css +120 -1
  108. data/stubs/inertia-vue-ts/app/javascript/Components/AppLogo.vue +17 -0
  109. data/stubs/inertia-vue-ts/app/javascript/Components/AppShell.vue +12 -0
  110. data/stubs/inertia-vue-ts/app/javascript/Components/AppSidebar.vue +65 -0
  111. data/stubs/inertia-vue-ts/app/javascript/Components/AppSidebarHeader.vue +20 -0
  112. data/stubs/inertia-vue-ts/app/javascript/Components/Breadcrumbs.vue +32 -0
  113. data/stubs/inertia-vue-ts/app/javascript/Components/Heading.vue +15 -0
  114. data/stubs/inertia-vue-ts/app/javascript/Components/InputError.vue +1 -1
  115. data/stubs/inertia-vue-ts/app/javascript/Components/NavFooter.vue +33 -0
  116. data/stubs/inertia-vue-ts/app/javascript/Components/NavMain.vue +32 -0
  117. data/stubs/inertia-vue-ts/app/javascript/Components/NavUser.vue +40 -0
  118. data/stubs/inertia-vue-ts/app/javascript/Components/UserInfo.vue +25 -0
  119. data/stubs/inertia-vue-ts/app/javascript/Components/UserMenuContent.vue +47 -0
  120. data/stubs/inertia-vue-ts/app/javascript/Components/ui/avatar/Avatar.vue +18 -0
  121. data/stubs/inertia-vue-ts/app/javascript/Components/ui/avatar/AvatarFallback.vue +21 -0
  122. data/stubs/inertia-vue-ts/app/javascript/Components/ui/avatar/AvatarImage.vue +16 -0
  123. data/stubs/inertia-vue-ts/app/javascript/Components/ui/avatar/index.ts +3 -0
  124. data/stubs/inertia-vue-ts/app/javascript/Components/ui/breadcrumb/Breadcrumb.vue +17 -0
  125. data/stubs/inertia-vue-ts/app/javascript/Components/ui/breadcrumb/BreadcrumbEllipsis.vue +23 -0
  126. data/stubs/inertia-vue-ts/app/javascript/Components/ui/breadcrumb/BreadcrumbItem.vue +17 -0
  127. data/stubs/inertia-vue-ts/app/javascript/Components/ui/breadcrumb/BreadcrumbLink.vue +21 -0
  128. data/stubs/inertia-vue-ts/app/javascript/Components/ui/breadcrumb/BreadcrumbList.vue +17 -0
  129. data/stubs/inertia-vue-ts/app/javascript/Components/ui/breadcrumb/BreadcrumbPage.vue +20 -0
  130. data/stubs/inertia-vue-ts/app/javascript/Components/ui/breadcrumb/BreadcrumbSeparator.vue +22 -0
  131. data/stubs/inertia-vue-ts/app/javascript/Components/ui/breadcrumb/index.ts +7 -0
  132. data/stubs/inertia-vue-ts/app/javascript/Components/ui/button/Button.vue +31 -0
  133. data/stubs/inertia-vue-ts/app/javascript/Components/ui/button/index.ts +34 -0
  134. data/stubs/inertia-vue-ts/app/javascript/Components/ui/checkbox/Checkbox.vue +35 -0
  135. data/stubs/inertia-vue-ts/app/javascript/Components/ui/checkbox/index.ts +1 -0
  136. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/Dialog.vue +15 -0
  137. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/DialogClose.vue +12 -0
  138. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/DialogContent.vue +52 -0
  139. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/DialogDescription.vue +23 -0
  140. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/DialogFooter.vue +25 -0
  141. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/DialogHeader.vue +14 -0
  142. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/DialogOverlay.vue +26 -0
  143. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/DialogTitle.vue +23 -0
  144. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/DialogTrigger.vue +12 -0
  145. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dialog/index.ts +9 -0
  146. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dropdown-menu/DropdownMenu.vue +15 -0
  147. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dropdown-menu/DropdownMenuContent.vue +37 -0
  148. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
  149. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dropdown-menu/DropdownMenuItem.vue +41 -0
  150. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
  151. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
  152. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dropdown-menu/DropdownMenuTrigger.vue +14 -0
  153. data/stubs/inertia-vue-ts/app/javascript/Components/ui/dropdown-menu/index.ts +7 -0
  154. data/stubs/inertia-vue-ts/app/javascript/Components/ui/input/Input.vue +50 -0
  155. data/stubs/inertia-vue-ts/app/javascript/Components/ui/input/index.ts +1 -0
  156. data/stubs/inertia-vue-ts/app/javascript/Components/ui/label/Label.vue +26 -0
  157. data/stubs/inertia-vue-ts/app/javascript/Components/ui/label/index.ts +1 -0
  158. data/stubs/inertia-vue-ts/app/javascript/Components/ui/separator/Separator.vue +29 -0
  159. data/stubs/inertia-vue-ts/app/javascript/Components/ui/separator/index.ts +1 -0
  160. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/Sheet.vue +19 -0
  161. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/SheetClose.vue +15 -0
  162. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/SheetContent.vue +62 -0
  163. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/SheetDescription.vue +21 -0
  164. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/SheetFooter.vue +16 -0
  165. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/SheetHeader.vue +15 -0
  166. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/SheetOverlay.vue +21 -0
  167. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/SheetTitle.vue +21 -0
  168. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/SheetTrigger.vue +15 -0
  169. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sheet/index.ts +8 -0
  170. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/Sidebar.vue +96 -0
  171. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarContent.vue +18 -0
  172. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarFooter.vue +18 -0
  173. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarGroup.vue +18 -0
  174. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarGroupAction.vue +27 -0
  175. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarGroupContent.vue +18 -0
  176. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarGroupLabel.vue +25 -0
  177. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarHeader.vue +18 -0
  178. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarInput.vue +22 -0
  179. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarInset.vue +21 -0
  180. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenu.vue +18 -0
  181. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuAction.vue +35 -0
  182. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuBadge.vue +26 -0
  183. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuButton.vue +48 -0
  184. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
  185. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuItem.vue +18 -0
  186. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
  187. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuSub.vue +22 -0
  188. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
  189. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
  190. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarProvider.vue +82 -0
  191. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarRail.vue +33 -0
  192. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarSeparator.vue +19 -0
  193. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/SidebarTrigger.vue +28 -0
  194. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/index.ts +60 -0
  195. data/stubs/inertia-vue-ts/app/javascript/Components/ui/sidebar/utils.ts +19 -0
  196. data/stubs/inertia-vue-ts/app/javascript/Components/ui/skeleton/Skeleton.vue +17 -0
  197. data/stubs/inertia-vue-ts/app/javascript/Components/ui/skeleton/index.ts +1 -0
  198. data/stubs/inertia-vue-ts/app/javascript/Components/ui/tooltip/Tooltip.vue +19 -0
  199. data/stubs/inertia-vue-ts/app/javascript/Components/ui/tooltip/TooltipContent.vue +34 -0
  200. data/stubs/inertia-vue-ts/app/javascript/Components/ui/tooltip/TooltipProvider.vue +14 -0
  201. data/stubs/inertia-vue-ts/app/javascript/Components/ui/tooltip/TooltipTrigger.vue +15 -0
  202. data/stubs/inertia-vue-ts/app/javascript/Components/ui/tooltip/index.ts +4 -0
  203. data/stubs/inertia-vue-ts/app/javascript/Layouts/AuthenticatedLayout.vue +17 -147
  204. data/stubs/inertia-vue-ts/app/javascript/Layouts/SettingsLayout.vue +57 -0
  205. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ForgotPassword.vue +7 -7
  206. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Login.vue +10 -12
  207. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Register.vue +12 -14
  208. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ResetPassword.vue +8 -10
  209. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/VerifyEmail.vue +3 -3
  210. data/stubs/inertia-vue-ts/app/javascript/Pages/Dashboard.vue +15 -10
  211. data/stubs/inertia-vue-ts/app/javascript/Pages/Settings/Appearance.vue +33 -0
  212. data/stubs/inertia-vue-ts/app/javascript/Pages/Settings/Partials/DeleteUserForm.vue +96 -0
  213. data/stubs/inertia-vue-ts/app/javascript/Pages/Settings/Partials/UpdateAppearanceForm.vue +42 -0
  214. data/stubs/inertia-vue-ts/app/javascript/Pages/{Profile → Settings}/Partials/UpdatePasswordForm.vue +12 -20
  215. data/stubs/inertia-vue-ts/app/javascript/Pages/{Profile → Settings}/Partials/UpdateProfileInformationForm.vue +12 -20
  216. data/stubs/inertia-vue-ts/app/javascript/Pages/Settings/Password.vue +33 -0
  217. data/stubs/inertia-vue-ts/app/javascript/Pages/Settings/Profile.vue +40 -0
  218. data/stubs/inertia-vue-ts/app/javascript/composables/useInitials.ts +29 -0
  219. data/stubs/inertia-vue-ts/app/javascript/lib/appearance.ts +1 -2
  220. data/stubs/inertia-vue-ts/app/javascript/lib/utils.ts +6 -0
  221. data/stubs/inertia-vue-ts/app/javascript/types/index.d.ts +14 -0
  222. data/stubs/inertia-vue-ts/app/javascript/types/vue-shims.d.ts +10 -0
  223. data/stubs/inertia-vue-ts/components.json +20 -0
  224. data/stubs/inertia-vue-ts/package.json +8 -1
  225. data/stubs/inertia-vue-ts/vite.config.ts +25 -1
  226. metadata +171 -46
  227. data/stubs/hotwire/app/components/nav_link_component.rb +0 -15
  228. data/stubs/hotwire/app/components/responsive_nav_link_component.rb +0 -15
  229. data/stubs/hotwire/app/controllers/password_controller.rb +0 -13
  230. data/stubs/hotwire/app/views/layouts/_navigation.html.erb +0 -82
  231. data/stubs/hotwire/app/views/profile/edit.html.erb +0 -29
  232. data/stubs/hotwire/app/views/profile/partials/_delete_user_form.html.erb +0 -14
  233. data/stubs/hotwire/app/views/profile/partials/_update_appearance_form.html.erb +0 -39
  234. data/stubs/inertia-common/app/controllers/password_controller.rb +0 -13
  235. data/stubs/inertia-react-ts/app/javascript/Components/Checkbox.tsx +0 -11
  236. data/stubs/inertia-react-ts/app/javascript/Components/DangerButton.tsx +0 -20
  237. data/stubs/inertia-react-ts/app/javascript/Components/Dropdown.tsx +0 -100
  238. data/stubs/inertia-react-ts/app/javascript/Components/InputLabel.tsx +0 -14
  239. data/stubs/inertia-react-ts/app/javascript/Components/Modal.tsx +0 -66
  240. data/stubs/inertia-react-ts/app/javascript/Components/NavLink.tsx +0 -21
  241. data/stubs/inertia-react-ts/app/javascript/Components/PrimaryButton.tsx +0 -20
  242. data/stubs/inertia-react-ts/app/javascript/Components/ResponsiveNavLink.tsx +0 -21
  243. data/stubs/inertia-react-ts/app/javascript/Components/SecondaryButton.tsx +0 -22
  244. data/stubs/inertia-react-ts/app/javascript/Components/TextInput.tsx +0 -32
  245. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Edit.tsx +0 -37
  246. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/DeleteUserForm.tsx +0 -102
  247. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/UpdateAppearanceForm.tsx +0 -47
  248. data/stubs/inertia-vue-ts/app/javascript/Components/Checkbox.vue +0 -29
  249. data/stubs/inertia-vue-ts/app/javascript/Components/DangerButton.vue +0 -7
  250. data/stubs/inertia-vue-ts/app/javascript/Components/Dropdown.vue +0 -75
  251. data/stubs/inertia-vue-ts/app/javascript/Components/DropdownLink.vue +0 -16
  252. data/stubs/inertia-vue-ts/app/javascript/Components/InputLabel.vue +0 -12
  253. data/stubs/inertia-vue-ts/app/javascript/Components/Modal.vue +0 -109
  254. data/stubs/inertia-vue-ts/app/javascript/Components/NavLink.vue +0 -21
  255. data/stubs/inertia-vue-ts/app/javascript/Components/PrimaryButton.vue +0 -7
  256. data/stubs/inertia-vue-ts/app/javascript/Components/ResponsiveNavLink.vue +0 -21
  257. data/stubs/inertia-vue-ts/app/javascript/Components/SecondaryButton.vue +0 -19
  258. data/stubs/inertia-vue-ts/app/javascript/Components/TextInput.vue +0 -23
  259. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Edit.vue +0 -43
  260. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/DeleteUserForm.vue +0 -99
  261. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/UpdateAppearanceForm.vue +0 -47
@@ -0,0 +1,719 @@
1
+ import { Slot } from "@radix-ui/react-slot"
2
+ import type { VariantProps} from "class-variance-authority";
3
+ import { cva } from "class-variance-authority"
4
+ import { PanelLeftCloseIcon, PanelLeftOpenIcon } from "lucide-react"
5
+ import * as React from "react"
6
+
7
+ import { Button } from "@/Components/ui/button"
8
+ import { Input } from "@/Components/ui/input"
9
+ import { Separator } from "@/Components/ui/separator"
10
+ import {
11
+ Sheet,
12
+ SheetContent,
13
+ SheetDescription,
14
+ SheetHeader,
15
+ SheetTitle,
16
+ } from "@/Components/ui/sheet"
17
+ import { Skeleton } from "@/Components/ui/skeleton"
18
+ import {
19
+ Tooltip,
20
+ TooltipContent,
21
+ TooltipTrigger,
22
+ } from "@/Components/ui/tooltip"
23
+ import { useIsMobile } from "@/hooks/use-mobile"
24
+ import { cn } from "@/lib/utils"
25
+
26
+ const SIDEBAR_COOKIE_NAME = "sidebar_state"
27
+ const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
28
+ const SIDEBAR_WIDTH = "16rem"
29
+ const SIDEBAR_WIDTH_MOBILE = "18rem"
30
+ const SIDEBAR_WIDTH_ICON = "3rem"
31
+ const SIDEBAR_KEYBOARD_SHORTCUT = "b"
32
+
33
+ type SidebarContext = {
34
+ state: "expanded" | "collapsed"
35
+ open: boolean
36
+ setOpen: (open: boolean) => void
37
+ openMobile: boolean
38
+ setOpenMobile: (open: boolean) => void
39
+ isMobile: boolean
40
+ toggleSidebar: () => void
41
+ }
42
+
43
+ const SidebarContext = React.createContext<SidebarContext | null>(null)
44
+
45
+ function useSidebar() {
46
+ const context = React.useContext(SidebarContext)
47
+ if (!context) {
48
+ throw new Error("useSidebar must be used within a SidebarProvider.")
49
+ }
50
+
51
+ return context
52
+ }
53
+
54
+ function SidebarProvider({
55
+ defaultOpen = true,
56
+ open: openProp,
57
+ onOpenChange: setOpenProp,
58
+ className,
59
+ style,
60
+ children,
61
+ ...props
62
+ }: React.ComponentProps<"div"> & {
63
+ defaultOpen?: boolean
64
+ open?: boolean
65
+ onOpenChange?: (open: boolean) => void
66
+ }) {
67
+ const isMobile = useIsMobile()
68
+ const [openMobile, setOpenMobile] = React.useState(false)
69
+
70
+ // This is the internal state of the sidebar.
71
+ // We use openProp and setOpenProp for control from outside the component.
72
+ const [_open, _setOpen] = React.useState(defaultOpen)
73
+ const open = openProp ?? _open
74
+ const setOpen = React.useCallback(
75
+ (value: boolean | ((value: boolean) => boolean)) => {
76
+ const openState = typeof value === "function" ? value(open) : value
77
+ if (setOpenProp) {
78
+ setOpenProp(openState)
79
+ } else {
80
+ _setOpen(openState)
81
+ }
82
+
83
+ // This sets the cookie to keep the sidebar state.
84
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
85
+ },
86
+ [setOpenProp, open]
87
+ )
88
+
89
+ // Helper to toggle the sidebar.
90
+ const toggleSidebar = React.useCallback(() => {
91
+ return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open)
92
+ }, [isMobile, setOpen, setOpenMobile])
93
+
94
+ // Adds a keyboard shortcut to toggle the sidebar.
95
+ React.useEffect(() => {
96
+ const handleKeyDown = (event: KeyboardEvent) => {
97
+ if (
98
+ event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
99
+ (event.metaKey || event.ctrlKey)
100
+ ) {
101
+ event.preventDefault()
102
+ toggleSidebar()
103
+ }
104
+ }
105
+
106
+ window.addEventListener("keydown", handleKeyDown)
107
+ return () => window.removeEventListener("keydown", handleKeyDown)
108
+ }, [toggleSidebar])
109
+
110
+ // We add a state so that we can do data-state="expanded" or "collapsed".
111
+ // This makes it easier to style the sidebar with Tailwind classes.
112
+ const state = open ? "expanded" : "collapsed"
113
+
114
+ const contextValue = React.useMemo<SidebarContext>(
115
+ () => ({
116
+ state,
117
+ open,
118
+ setOpen,
119
+ isMobile,
120
+ openMobile,
121
+ setOpenMobile,
122
+ toggleSidebar,
123
+ }),
124
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
125
+ )
126
+
127
+ return (
128
+ <SidebarContext.Provider value={contextValue}>
129
+ <div
130
+ data-slot="sidebar-wrapper"
131
+ style={
132
+ {
133
+ "--sidebar-width": SIDEBAR_WIDTH,
134
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
135
+ ...style,
136
+ } as React.CSSProperties
137
+ }
138
+ className={cn(
139
+ "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
140
+ className
141
+ )}
142
+ {...props}
143
+ >
144
+ {children}
145
+ </div>
146
+ </SidebarContext.Provider>
147
+ )
148
+ }
149
+
150
+ function Sidebar({
151
+ side = "left",
152
+ variant = "sidebar",
153
+ collapsible = "offcanvas",
154
+ className,
155
+ children,
156
+ ...props
157
+ }: React.ComponentProps<"div"> & {
158
+ side?: "left" | "right"
159
+ variant?: "sidebar" | "floating" | "inset"
160
+ collapsible?: "offcanvas" | "icon" | "none"
161
+ }) {
162
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
163
+
164
+ if (collapsible === "none") {
165
+ return (
166
+ <div
167
+ data-slot="sidebar"
168
+ className={cn(
169
+ "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
170
+ className
171
+ )}
172
+ {...props}
173
+ >
174
+ {children}
175
+ </div>
176
+ )
177
+ }
178
+
179
+ if (isMobile) {
180
+ return (
181
+ <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
182
+ <SheetHeader className="sr-only">
183
+ <SheetTitle>Sidebar</SheetTitle>
184
+ <SheetDescription>Displays the mobile sidebar.</SheetDescription>
185
+ </SheetHeader>
186
+ <SheetContent
187
+ data-sidebar="sidebar"
188
+ data-slot="sidebar"
189
+ data-mobile="true"
190
+ className="bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden"
191
+ style={
192
+ {
193
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE,
194
+ } as React.CSSProperties
195
+ }
196
+ side={side}
197
+ >
198
+ <div className="flex h-full w-full flex-col">{children}</div>
199
+ </SheetContent>
200
+ </Sheet>
201
+ )
202
+ }
203
+
204
+ return (
205
+ <div
206
+ className="group peer text-sidebar-foreground hidden md:block"
207
+ data-state={state}
208
+ data-collapsible={state === "collapsed" ? collapsible : ""}
209
+ data-variant={variant}
210
+ data-side={side}
211
+ data-slot="sidebar"
212
+ >
213
+ {/* This is what handles the sidebar gap on desktop */}
214
+ <div
215
+ className={cn(
216
+ "relative h-svh w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
217
+ "group-data-[collapsible=offcanvas]:w-0",
218
+ "group-data-[side=right]:rotate-180",
219
+ variant === "floating" || variant === "inset"
220
+ ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
221
+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
222
+ )}
223
+ />
224
+ <div
225
+ className={cn(
226
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
227
+ side === "left"
228
+ ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
229
+ : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
230
+ // Adjust the padding for floating and inset variants.
231
+ variant === "floating" || variant === "inset"
232
+ ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
233
+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
234
+ className
235
+ )}
236
+ {...props}
237
+ >
238
+ <div
239
+ data-sidebar="sidebar"
240
+ 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"
241
+ >
242
+ {children}
243
+ </div>
244
+ </div>
245
+ </div>
246
+ )
247
+ }
248
+
249
+ function SidebarTrigger({
250
+ className,
251
+ onClick,
252
+ ...props
253
+ }: React.ComponentProps<typeof Button>) {
254
+ const { toggleSidebar, isMobile, state } = useSidebar()
255
+
256
+ return (
257
+ <Button
258
+ data-sidebar="trigger"
259
+ data-slot="sidebar-trigger"
260
+ variant="ghost"
261
+ size="icon"
262
+ className={cn("h-7 w-7", className)}
263
+ onClick={(event) => {
264
+ onClick?.(event)
265
+ toggleSidebar()
266
+ }}
267
+ {...props}
268
+ >
269
+ {isMobile || state === "collapsed" ? <PanelLeftOpenIcon /> : <PanelLeftCloseIcon />}
270
+ <span className="sr-only">Toggle sidebar</span>
271
+ </Button>
272
+ )
273
+ }
274
+
275
+ function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
276
+ const { toggleSidebar } = useSidebar()
277
+
278
+ return (
279
+ <button
280
+ data-sidebar="rail"
281
+ data-slot="sidebar-rail"
282
+ aria-label="Toggle sidebar"
283
+ tabIndex={-1}
284
+ onClick={toggleSidebar}
285
+ title="Toggle sidebar"
286
+ className={cn(
287
+ "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
288
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
289
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
290
+ "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
291
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
292
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
293
+ className
294
+ )}
295
+ {...props}
296
+ />
297
+ )
298
+ }
299
+
300
+ function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
301
+ return (
302
+ <main
303
+ data-slot="sidebar-inset"
304
+ className={cn(
305
+ "bg-background relative flex max-w-full min-h-svh flex-1 flex-col",
306
+ "peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-0",
307
+ className
308
+ )}
309
+ {...props}
310
+ />
311
+ )
312
+ }
313
+
314
+ function SidebarInput({
315
+ className,
316
+ ...props
317
+ }: React.ComponentProps<typeof Input>) {
318
+ return (
319
+ <Input
320
+ data-slot="sidebar-input"
321
+ data-sidebar="input"
322
+ className={cn("bg-background h-8 w-full shadow-none", className)}
323
+ {...props}
324
+ />
325
+ )
326
+ }
327
+
328
+ function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
329
+ return (
330
+ <div
331
+ data-slot="sidebar-header"
332
+ data-sidebar="header"
333
+ className={cn("flex flex-col gap-2 p-2", className)}
334
+ {...props}
335
+ />
336
+ )
337
+ }
338
+
339
+ function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
340
+ return (
341
+ <div
342
+ data-slot="sidebar-footer"
343
+ data-sidebar="footer"
344
+ className={cn("flex flex-col gap-2 p-2", className)}
345
+ {...props}
346
+ />
347
+ )
348
+ }
349
+
350
+ function SidebarSeparator({
351
+ className,
352
+ ...props
353
+ }: React.ComponentProps<typeof Separator>) {
354
+ return (
355
+ <Separator
356
+ data-slot="sidebar-separator"
357
+ data-sidebar="separator"
358
+ className={cn("bg-sidebar-border mx-2 w-auto", className)}
359
+ {...props}
360
+ />
361
+ )
362
+ }
363
+
364
+ function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
365
+ return (
366
+ <div
367
+ data-slot="sidebar-content"
368
+ data-sidebar="content"
369
+ className={cn(
370
+ "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
371
+ className
372
+ )}
373
+ {...props}
374
+ />
375
+ )
376
+ }
377
+
378
+ function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
379
+ return (
380
+ <div
381
+ data-slot="sidebar-group"
382
+ data-sidebar="group"
383
+ className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
384
+ {...props}
385
+ />
386
+ )
387
+ }
388
+
389
+ function SidebarGroupLabel({
390
+ className,
391
+ asChild = false,
392
+ ...props
393
+ }: React.ComponentProps<"div"> & { asChild?: boolean }) {
394
+ const Comp = asChild ? Slot : "div"
395
+
396
+ return (
397
+ <Comp
398
+ data-slot="sidebar-group-label"
399
+ data-sidebar="group-label"
400
+ className={cn(
401
+ "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
402
+ "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 group-data-[collapsible=icon]:select-none group-data-[collapsible=icon]:pointer-events-none",
403
+ className
404
+ )}
405
+ {...props}
406
+ />
407
+ )
408
+ }
409
+
410
+ function SidebarGroupAction({
411
+ className,
412
+ asChild = false,
413
+ ...props
414
+ }: React.ComponentProps<"button"> & { asChild?: boolean }) {
415
+ const Comp = asChild ? Slot : "button"
416
+
417
+ return (
418
+ <Comp
419
+ data-slot="sidebar-group-action"
420
+ data-sidebar="group-action"
421
+ className={cn(
422
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
423
+ // Increases the hit area of the button on mobile.
424
+ "after:absolute after:-inset-2 md:after:hidden",
425
+ "group-data-[collapsible=icon]:hidden",
426
+ className
427
+ )}
428
+ {...props}
429
+ />
430
+ )
431
+ }
432
+
433
+ function SidebarGroupContent({
434
+ className,
435
+ ...props
436
+ }: React.ComponentProps<"div">) {
437
+ return (
438
+ <div
439
+ data-slot="sidebar-group-content"
440
+ data-sidebar="group-content"
441
+ className={cn("w-full text-sm", className)}
442
+ {...props}
443
+ />
444
+ )
445
+ }
446
+
447
+ function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
448
+ return (
449
+ <ul
450
+ data-slot="sidebar-menu"
451
+ data-sidebar="menu"
452
+ className={cn("flex w-full min-w-0 flex-col gap-1", className)}
453
+ {...props}
454
+ />
455
+ )
456
+ }
457
+
458
+ function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
459
+ return (
460
+ <li
461
+ data-slot="sidebar-menu-item"
462
+ data-sidebar="menu-item"
463
+ className={cn("group/menu-item relative", className)}
464
+ {...props}
465
+ />
466
+ )
467
+ }
468
+
469
+ const sidebarMenuButtonVariants = cva(
470
+ "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",
471
+ {
472
+ variants: {
473
+ variant: {
474
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
475
+ outline:
476
+ "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))]",
477
+ },
478
+ size: {
479
+ default: "h-8 text-sm",
480
+ sm: "h-7 text-xs",
481
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
482
+ },
483
+ },
484
+ defaultVariants: {
485
+ variant: "default",
486
+ size: "default",
487
+ },
488
+ }
489
+ )
490
+
491
+ function SidebarMenuButton({
492
+ asChild = false,
493
+ isActive = false,
494
+ variant = "default",
495
+ size = "default",
496
+ tooltip,
497
+ className,
498
+ ...props
499
+ }: React.ComponentProps<"button"> & {
500
+ asChild?: boolean
501
+ isActive?: boolean
502
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>
503
+ } & VariantProps<typeof sidebarMenuButtonVariants>) {
504
+ const Comp = asChild ? Slot : "button"
505
+ const { isMobile, state } = useSidebar()
506
+
507
+ const button = (
508
+ <Comp
509
+ data-slot="sidebar-menu-button"
510
+ data-sidebar="menu-button"
511
+ data-size={size}
512
+ data-active={isActive}
513
+ className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
514
+ {...props}
515
+ />
516
+ )
517
+
518
+ if (!tooltip) {
519
+ return button
520
+ }
521
+
522
+ if (typeof tooltip === "string") {
523
+ tooltip = {
524
+ children: tooltip,
525
+ }
526
+ }
527
+
528
+ return (
529
+ <Tooltip>
530
+ <TooltipTrigger asChild>{button}</TooltipTrigger>
531
+ <TooltipContent
532
+ side="right"
533
+ align="center"
534
+ hidden={state !== "collapsed" || isMobile}
535
+ {...tooltip}
536
+ />
537
+ </Tooltip>
538
+ )
539
+ }
540
+
541
+ function SidebarMenuAction({
542
+ className,
543
+ asChild = false,
544
+ showOnHover = false,
545
+ ...props
546
+ }: React.ComponentProps<"button"> & {
547
+ asChild?: boolean
548
+ showOnHover?: boolean
549
+ }) {
550
+ const Comp = asChild ? Slot : "button"
551
+
552
+ return (
553
+ <Comp
554
+ data-slot="sidebar-menu-action"
555
+ data-sidebar="menu-action"
556
+ className={cn(
557
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
558
+ // Increases the hit area of the button on mobile.
559
+ "after:absolute after:-inset-2 md:after:hidden",
560
+ "peer-data-[size=sm]/menu-button:top-1",
561
+ "peer-data-[size=default]/menu-button:top-1.5",
562
+ "peer-data-[size=lg]/menu-button:top-2.5",
563
+ "group-data-[collapsible=icon]:hidden",
564
+ showOnHover &&
565
+ "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",
566
+ className
567
+ )}
568
+ {...props}
569
+ />
570
+ )
571
+ }
572
+
573
+ function SidebarMenuBadge({
574
+ className,
575
+ ...props
576
+ }: React.ComponentProps<"div">) {
577
+ return (
578
+ <div
579
+ data-slot="sidebar-menu-badge"
580
+ data-sidebar="menu-badge"
581
+ className={cn(
582
+ "text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
583
+ "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
584
+ "peer-data-[size=sm]/menu-button:top-1",
585
+ "peer-data-[size=default]/menu-button:top-1.5",
586
+ "peer-data-[size=lg]/menu-button:top-2.5",
587
+ "group-data-[collapsible=icon]:hidden",
588
+ className
589
+ )}
590
+ {...props}
591
+ />
592
+ )
593
+ }
594
+
595
+ function SidebarMenuSkeleton({
596
+ className,
597
+ showIcon = false,
598
+ ...props
599
+ }: React.ComponentProps<"div"> & {
600
+ showIcon?: boolean
601
+ }) {
602
+
603
+ // wrapping in useState to ensure the width is stable across renders
604
+ // also ensures we have a stable reference to the style object
605
+ const [skeletonStyle] = React.useState(() => (
606
+ {
607
+ "--skeleton-width": `${Math.floor(Math.random() * 40) + 50}%` // Random width between 50 and 90%.
608
+ } as React.CSSProperties
609
+ ))
610
+
611
+ return (
612
+ <div
613
+ data-slot="sidebar-menu-skeleton"
614
+ data-sidebar="menu-skeleton"
615
+ className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
616
+ {...props}
617
+ >
618
+ {showIcon && (
619
+ <Skeleton
620
+ className="size-4 rounded-md"
621
+ data-sidebar="menu-skeleton-icon"
622
+ />
623
+ )}
624
+ <Skeleton
625
+ className="h-4 max-w-(--skeleton-width) flex-1"
626
+ data-sidebar="menu-skeleton-text"
627
+ style={skeletonStyle}
628
+ />
629
+ </div>
630
+ )
631
+ }
632
+
633
+ function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
634
+ return (
635
+ <ul
636
+ data-slot="sidebar-menu-sub"
637
+ data-sidebar="menu-sub"
638
+ className={cn(
639
+ "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",
640
+ "group-data-[collapsible=icon]:hidden",
641
+ className
642
+ )}
643
+ {...props}
644
+ />
645
+ )
646
+ }
647
+
648
+ function SidebarMenuSubItem({
649
+ className,
650
+ ...props
651
+ }: React.ComponentProps<"li">) {
652
+ return (
653
+ <li
654
+ data-slot="sidebar-menu-sub-item"
655
+ data-sidebar="menu-sub-item"
656
+ className={cn("group/menu-sub-item relative", className)}
657
+ {...props}
658
+ />
659
+ )
660
+ }
661
+
662
+ function SidebarMenuSubButton({
663
+ asChild = false,
664
+ size = "md",
665
+ isActive = false,
666
+ className,
667
+ ...props
668
+ }: React.ComponentProps<"a"> & {
669
+ asChild?: boolean
670
+ size?: "sm" | "md"
671
+ isActive?: boolean
672
+ }) {
673
+ const Comp = asChild ? Slot : "a"
674
+
675
+ return (
676
+ <Comp
677
+ data-slot="sidebar-menu-sub-button"
678
+ data-sidebar="menu-sub-button"
679
+ data-size={size}
680
+ data-active={isActive}
681
+ className={cn(
682
+ "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 flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden 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",
683
+ "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
684
+ size === "sm" && "text-xs",
685
+ size === "md" && "text-sm",
686
+ "group-data-[collapsible=icon]:hidden",
687
+ className
688
+ )}
689
+ {...props}
690
+ />
691
+ )
692
+ }
693
+
694
+ export {
695
+ Sidebar,
696
+ SidebarContent,
697
+ SidebarFooter,
698
+ SidebarGroup,
699
+ SidebarGroupAction,
700
+ SidebarGroupContent,
701
+ SidebarGroupLabel,
702
+ SidebarHeader,
703
+ SidebarInput,
704
+ SidebarInset,
705
+ SidebarMenu,
706
+ SidebarMenuAction,
707
+ SidebarMenuBadge,
708
+ SidebarMenuButton,
709
+ SidebarMenuItem,
710
+ SidebarMenuSkeleton,
711
+ SidebarMenuSub,
712
+ SidebarMenuSubButton,
713
+ SidebarMenuSubItem,
714
+ SidebarProvider,
715
+ SidebarRail,
716
+ SidebarSeparator,
717
+ SidebarTrigger,
718
+ useSidebar,
719
+ }