@alepha/ui 0.18.1 → 0.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/{AdminApiKeys-C-6_Q-lH.js → AdminApiKeys-Dy_k-4Vd.js} +17 -38
- package/dist/admin/AdminApiKeys-Dy_k-4Vd.js.map +1 -0
- package/dist/admin/{AdminAudits-Bgbf04hO.js → AdminAudits-CKiFMSSU.js} +23 -19
- package/dist/admin/AdminAudits-CKiFMSSU.js.map +1 -0
- package/dist/admin/AdminDashboard-PhC_dZqo.js +67 -0
- package/dist/admin/AdminDashboard-PhC_dZqo.js.map +1 -0
- package/dist/admin/{AdminFiles-B9a7G3cY.js → AdminFiles-DFTjijGp.js} +3 -7
- package/dist/admin/AdminFiles-DFTjijGp.js.map +1 -0
- package/dist/admin/{AdminJobDashboard-DaTwf5OY.js → AdminJobDashboard-BL8gGPDp.js} +2 -2
- package/dist/admin/{AdminJobDashboard-DaTwf5OY.js.map → AdminJobDashboard-BL8gGPDp.js.map} +1 -1
- package/dist/admin/{AdminJobExecutions-B9cek5dl.js → AdminJobExecutions-D9E-CS-U.js} +24 -36
- package/dist/admin/AdminJobExecutions-D9E-CS-U.js.map +1 -0
- package/dist/admin/{AdminJobRegistry-DFgV3oqx.js → AdminJobRegistry-Ci9ue1zC.js} +10 -18
- package/dist/admin/AdminJobRegistry-Ci9ue1zC.js.map +1 -0
- package/dist/admin/AdminLayout-I6TlUMPc.js +61 -0
- package/dist/admin/AdminLayout-I6TlUMPc.js.map +1 -0
- package/dist/admin/AdminNotifications-ZPHCYrv7.js +542 -0
- package/dist/admin/AdminNotifications-ZPHCYrv7.js.map +1 -0
- package/dist/admin/{AdminParameters-DHw9ATgl.js → AdminParameters-CqgvhRsb.js} +120 -105
- package/dist/admin/AdminParameters-CqgvhRsb.js.map +1 -0
- package/dist/admin/{AdminSessions-BhGJPI3z.js → AdminSessions-Bz5NRuoW.js} +48 -53
- package/dist/admin/AdminSessions-Bz5NRuoW.js.map +1 -0
- package/dist/admin/{AdminUserLayout-BdC4Te8m.js → AdminUserLayout-lXT6I0Qq.js} +14 -8
- package/dist/admin/AdminUserLayout-lXT6I0Qq.js.map +1 -0
- package/dist/admin/{AdminUserProfile-DAt23fqY.js → AdminUserProfile-vFBLoJ3h.js} +3 -3
- package/dist/admin/{AdminUserProfile-DAt23fqY.js.map → AdminUserProfile-vFBLoJ3h.js.map} +1 -1
- package/dist/admin/{AdminUserSessions-1uzcx02z.js → AdminUserSessions-CT_YDim0.js} +33 -35
- package/dist/admin/AdminUserSessions-CT_YDim0.js.map +1 -0
- package/dist/admin/AdminUsers-D1UfGya9.js +206 -0
- package/dist/admin/AdminUsers-D1UfGya9.js.map +1 -0
- package/dist/admin/{AuthLayout-DFJvCvzw.js → AuthLayout-_frhdgOO.js} +2 -2
- package/dist/admin/{AuthLayout-DFJvCvzw.js.map → AuthLayout-_frhdgOO.js.map} +1 -1
- package/dist/admin/{IconGoogle-CSQLPYwX.js → IconGoogle-Ch1m3Uzl.js} +1 -1
- package/dist/admin/{IconGoogle-CSQLPYwX.js.map → IconGoogle-Ch1m3Uzl.js.map} +1 -1
- package/dist/admin/Login-xtNmQtGh.js +275 -0
- package/dist/admin/Login-xtNmQtGh.js.map +1 -0
- package/dist/{auth/Profile-BMX_Ar_s.js → admin/Profile-_AtPUwAP.js} +31 -27
- package/dist/admin/Profile-_AtPUwAP.js.map +1 -0
- package/dist/admin/{Register-Cs10l8vX.js → Register-JcCjHUUn.js} +199 -143
- package/dist/admin/Register-JcCjHUUn.js.map +1 -0
- package/dist/admin/{ResetPassword-BwDdfkGH.js → ResetPassword-CwGBPLJO.js} +7 -7
- package/dist/admin/ResetPassword-CwGBPLJO.js.map +1 -0
- package/dist/admin/{VerifyEmail-DfXHAiQl.js → VerifyEmail-hNxWejWf.js} +23 -8
- package/dist/admin/VerifyEmail-hNxWejWf.js.map +1 -0
- package/dist/admin/{core-2xoLiT0o.js → core-CYaRQ8O-.js} +2082 -688
- package/dist/admin/core-CYaRQ8O-.js.map +1 -0
- package/dist/admin/index.d.ts +112 -48
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +467 -69
- package/dist/admin/index.js.map +1 -1
- package/dist/auth/{AuthLayout-CAE1pX9s.js → AuthLayout-AvLlcLjS.js} +2 -2
- package/dist/auth/{AuthLayout-CAE1pX9s.js.map → AuthLayout-AvLlcLjS.js.map} +1 -1
- package/dist/auth/Login-BA1E8IZl.js +275 -0
- package/dist/auth/Login-BA1E8IZl.js.map +1 -0
- package/dist/{admin/Profile-B-c9pCPf.js → auth/Profile-YcWdeuFz.js} +31 -27
- package/dist/auth/Profile-YcWdeuFz.js.map +1 -0
- package/dist/auth/{Register-6hi_cpfF.js → Register-CPhEO5MG.js} +198 -142
- package/dist/auth/Register-CPhEO5MG.js.map +1 -0
- package/dist/{demo/ResetPassword-DWN0lzr5.js → auth/ResetPassword-DCtGcneA.js} +7 -7
- package/dist/auth/ResetPassword-DCtGcneA.js.map +1 -0
- package/dist/{demo/VerifyEmail-DZWL72K4.js → auth/VerifyEmail-DkH7NBfn.js} +23 -8
- package/dist/auth/VerifyEmail-DkH7NBfn.js.map +1 -0
- package/dist/auth/{core-niW0sFLv.js → core-D5jIAVF2.js} +1385 -329
- package/dist/auth/core-D5jIAVF2.js.map +1 -0
- package/dist/auth/index.d.ts +105 -49
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +29 -26
- package/dist/auth/index.js.map +1 -1
- package/dist/core/index.d.ts +210 -74
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2247 -834
- package/dist/core/index.js.map +1 -1
- package/dist/demo/{AuthLayout-jLa0aKsI.js → AuthLayout-Brri4A-L.js} +2 -2
- package/dist/demo/{AuthLayout-jLa0aKsI.js.map → AuthLayout-Brri4A-L.js.map} +1 -1
- package/dist/demo/DemoButton-wiCxZZ_L.js +182 -0
- package/dist/demo/DemoButton-wiCxZZ_L.js.map +1 -0
- package/dist/demo/DemoControlSelect-D7ILObVg.js +305 -0
- package/dist/demo/DemoControlSelect-D7ILObVg.js.map +1 -0
- package/dist/demo/DemoDataTable-DZ5Y8pFX.js +362 -0
- package/dist/demo/DemoDataTable-DZ5Y8pFX.js.map +1 -0
- package/dist/demo/{DemoDialog-4ItHLf9t.js → DemoDialog-CUWdLHim.js} +2 -2
- package/dist/demo/{DemoDialog-4ItHLf9t.js.map → DemoDialog-CUWdLHim.js.map} +1 -1
- package/dist/demo/{DemoFlex-EtVq8QfX.js → DemoFlex-a8OhMMvq.js} +3 -3
- package/dist/demo/{DemoFlex-EtVq8QfX.js.map → DemoFlex-a8OhMMvq.js.map} +1 -1
- package/dist/demo/{DemoHeading-BS-vGfkI.js → DemoHeading-C13OVDfS.js} +3 -3
- package/dist/demo/{DemoHeading-BS-vGfkI.js.map → DemoHeading-C13OVDfS.js.map} +1 -1
- package/dist/demo/{DemoHome-Clbn8AmS.js → DemoHome-D_De3UiT.js} +2 -2
- package/dist/demo/{DemoHome-Clbn8AmS.js.map → DemoHome-D_De3UiT.js.map} +1 -1
- package/dist/demo/{DemoJsonViewer-DkIX_ky2.js → DemoJsonViewer-B50s9aGM.js} +3 -3
- package/dist/demo/{DemoJsonViewer-DkIX_ky2.js.map → DemoJsonViewer-B50s9aGM.js.map} +1 -1
- package/dist/demo/{DemoLayout-C56xb5EE.js → DemoLayout-CHU8WTwO.js} +14 -5
- package/dist/demo/DemoLayout-CHU8WTwO.js.map +1 -0
- package/dist/demo/{DemoLogin-BZwpicOS.js → DemoLogin-BBlrWpml.js} +49 -32
- package/dist/demo/DemoLogin-BBlrWpml.js.map +1 -0
- package/dist/demo/{DemoRegister-C7_qc4MJ.js → DemoRegister-BuNE3_-f.js} +49 -50
- package/dist/demo/DemoRegister-BuNE3_-f.js.map +1 -0
- package/dist/demo/{DemoResetPassword-BI1Ct4Dw.js → DemoResetPassword-D_IjjjOJ.js} +12 -16
- package/dist/demo/DemoResetPassword-D_IjjjOJ.js.map +1 -0
- package/dist/demo/{DemoSidebar-CcBo4ltC.js → DemoSidebar-Giy2HRBD.js} +3 -3
- package/dist/demo/{DemoSidebar-CcBo4ltC.js.map → DemoSidebar-Giy2HRBD.js.map} +1 -1
- package/dist/demo/{DemoText-CzXuUn3g.js → DemoText-ubcw-vog.js} +3 -3
- package/dist/demo/{DemoText-CzXuUn3g.js.map → DemoText-ubcw-vog.js.map} +1 -1
- package/dist/demo/{DemoToast-BgHDhWrX.js → DemoToast-9die_dYT.js} +2 -2
- package/dist/demo/{DemoToast-BgHDhWrX.js.map → DemoToast-9die_dYT.js.map} +1 -1
- package/dist/demo/{DemoTypeForm-DDzWoMSV.js → DemoTypeForm-D_d6OVKL.js} +8 -4
- package/dist/demo/DemoTypeForm-D_d6OVKL.js.map +1 -0
- package/dist/demo/DemoVerifyEmail-B43KlF4F.js +34 -0
- package/dist/demo/DemoVerifyEmail-B43KlF4F.js.map +1 -0
- package/dist/demo/Login-C12N4oGs.js +275 -0
- package/dist/demo/Login-C12N4oGs.js.map +1 -0
- package/dist/demo/{Profile-CWqti7FB.js → Profile-DS5q4vOh.js} +31 -27
- package/dist/demo/Profile-DS5q4vOh.js.map +1 -0
- package/dist/demo/{Register-a70LPgs2.js → Register-B4hLBeEv.js} +198 -142
- package/dist/demo/Register-B4hLBeEv.js.map +1 -0
- package/dist/{auth/ResetPassword-CqfTk1FI.js → demo/ResetPassword-D8g9ha1N.js} +7 -7
- package/dist/demo/ResetPassword-D8g9ha1N.js.map +1 -0
- package/dist/demo/{Showcase-Dq3MISpd.js → Showcase-D6Fxt4X4.js} +64 -65
- package/dist/demo/Showcase-D6Fxt4X4.js.map +1 -0
- package/dist/{auth/VerifyEmail-nWiSTMjF.js → demo/VerifyEmail-BjDo0cZA.js} +23 -8
- package/dist/demo/VerifyEmail-BjDo0cZA.js.map +1 -0
- package/dist/demo/{auth-d6n3xbug.js → auth-ByVTreDl.js} +8 -8
- package/dist/demo/{auth-d6n3xbug.js.map → auth-ByVTreDl.js.map} +1 -1
- package/dist/demo/{core-RCUw1Q-a.js → core-DFgB3yU4.js} +2182 -756
- package/dist/demo/core-DFgB3yU4.js.map +1 -0
- package/dist/demo/index.d.ts +1 -0
- package/dist/demo/index.d.ts.map +1 -1
- package/dist/demo/index.js +24 -18
- package/dist/demo/index.js.map +1 -1
- package/package.json +7 -7
- package/src/admin/{AdminRouter.ts → AdminRouter.tsx} +150 -18
- package/src/admin/components/AdminDashboard.tsx +52 -0
- package/src/admin/components/AdminLayout.tsx +32 -40
- package/src/admin/components/audits/AdminAudits.tsx +22 -16
- package/src/admin/components/files/AdminFiles.tsx +1 -6
- package/src/admin/components/jobs/AdminJobExecutions.tsx +33 -39
- package/src/admin/components/jobs/AdminJobRegistry.tsx +9 -18
- package/src/admin/components/keys/AdminApiKeys.tsx +23 -41
- package/src/admin/components/notifications/AdminNotifications.tsx +519 -0
- package/src/admin/components/parameters/ParameterDetails.tsx +12 -270
- package/src/admin/components/parameters/ParameterDetailsConfigForm.tsx +238 -0
- package/src/admin/components/parameters/ParameterDetailsLoading.tsx +24 -0
- package/src/admin/components/parameters/ParameterHistory.tsx +10 -11
- package/src/admin/components/parameters/ParameterTree.tsx +28 -184
- package/src/admin/components/parameters/ParameterTreeNode.tsx +151 -0
- package/src/admin/components/sessions/AdminSessions.tsx +71 -71
- package/src/admin/components/shared/AdminResourceHeader.tsx +2 -25
- package/src/admin/components/shared/AdminResourceHeaderMenuItem.tsx +37 -0
- package/src/admin/components/shared/AdminResourceTabs.tsx +2 -26
- package/src/admin/components/shared/AdminResourceTabsItem.tsx +36 -0
- package/src/admin/components/users/AdminUserSessions.tsx +33 -31
- package/src/admin/components/users/AdminUsers.tsx +184 -72
- package/src/admin/index.ts +2 -2
- package/src/admin/primitives/$uiAdmin.ts +1 -1
- package/src/auth/components/Login.tsx +188 -121
- package/src/auth/components/Profile.tsx +1 -22
- package/src/auth/components/ProfileField.tsx +39 -0
- package/src/auth/components/Register.tsx +215 -158
- package/src/auth/components/ResetPassword.tsx +7 -11
- package/src/auth/components/VerifyEmail.tsx +35 -10
- package/src/auth/components/buttons/UserButton.tsx +20 -24
- package/src/auth/index.ts +1 -0
- package/src/core/atoms/alephaSidebarAtom.ts +1 -1
- package/src/core/atoms/alephaThemeListAtom.ts +14 -1
- package/src/core/atoms/alephaThemeOverridesAtom.ts +17 -0
- package/src/core/atoms/themes/editorial.ts +184 -0
- package/src/core/atoms/themes/monochrome.ts +197 -0
- package/src/core/atoms/themes/rosePine.ts +208 -0
- package/src/core/atoms/themes/softBrutalism.ts +221 -0
- package/src/core/atoms/themes/terminal.ts +186 -0
- package/src/core/components/Flex.tsx +101 -1
- package/src/core/components/Text.tsx +1 -1
- package/src/core/components/buttons/ActionButton.tsx +109 -87
- package/src/core/components/buttons/DarkModeButton.tsx +3 -3
- package/src/core/components/buttons/LanguageButton.tsx +1 -1
- package/src/core/components/buttons/OmnibarButton.tsx +1 -2
- package/src/core/components/buttons/ThemeButton.tsx +40 -11
- package/src/core/components/buttons/ThemeExpertModal.tsx +184 -0
- package/src/core/components/buttons/ToggleSidebarButton.tsx +1 -2
- package/src/core/components/data/DetailDrawer.tsx +102 -96
- package/src/core/components/data/DetailList.tsx +2 -1
- package/src/core/components/layout/AppBar.tsx +10 -0
- package/src/core/components/layout/Breadcrumb.tsx +3 -6
- package/src/core/components/layout/DashboardShell.tsx +28 -11
- package/src/core/components/layout/Sidebar.tsx +18 -235
- package/src/core/components/layout/SidebarCollapsedItem.tsx +91 -0
- package/src/core/components/layout/SidebarItem.tsx +146 -0
- package/src/core/components/layout/index.ts +3 -1
- package/src/core/constants/ui.ts +5 -5
- package/src/core/form/components/Control.tsx +31 -29
- package/src/core/form/components/ControlArray.tsx +13 -39
- package/src/core/form/components/ControlDate.tsx +10 -21
- package/src/core/form/components/ControlNumber.tsx +4 -33
- package/src/core/form/components/ControlQueryBuilder.tsx +12 -175
- package/src/core/form/components/ControlQueryBuilderHelp.tsx +165 -0
- package/src/core/form/components/ControlSelect.browser.spec.tsx +343 -0
- package/src/core/form/components/ControlSelect.tsx +294 -92
- package/src/core/form/components/TypeForm.browser.spec.tsx +3 -3
- package/src/core/form/components/TypeForm.tsx +5 -2
- package/src/core/form/index.ts +8 -1
- package/src/core/form/utils/parseInput.ts +7 -3
- package/src/core/hooks/useTheme.ts +26 -3
- package/src/core/index.ts +9 -2
- package/src/core/interfaces/AlephaTheme.ts +2 -0
- package/src/core/json/components/JsonViewer.tsx +103 -319
- package/src/core/json/components/JsonViewerCopyButton.tsx +46 -0
- package/src/core/json/components/JsonViewerRowNode.tsx +120 -0
- package/src/core/json/components/JsonViewerShared.ts +76 -0
- package/src/core/providers/ThemeProvider.ts +108 -8
- package/src/core/services/DialogService.tsx +24 -3
- package/src/core/styles.css +33 -20
- package/src/core/table/components/ColumnPicker.tsx +3 -3
- package/src/core/table/components/DataTable.tsx +233 -143
- package/src/core/table/components/DataTableFilters.tsx +6 -16
- package/src/core/table/components/DataTablePagination.tsx +58 -29
- package/src/core/table/components/DataTableToolbar.tsx +16 -7
- package/src/core/table/components/FilterPicker.tsx +3 -3
- package/src/core/table/index.ts +1 -0
- package/src/core/table/interfaces/types.ts +42 -9
- package/src/core/utils/icons.tsx +2 -2
- package/src/demo/DemoRouter.ts +8 -1
- package/src/demo/components/DemoLayout.tsx +12 -2
- package/src/demo/components/auth/DemoLogin.tsx +35 -28
- package/src/demo/components/auth/DemoRegister.tsx +35 -49
- package/src/demo/components/auth/DemoResetPassword.tsx +5 -9
- package/src/demo/components/auth/DemoVerifyEmail.tsx +7 -6
- package/src/demo/components/core/DemoButton.tsx +123 -103
- package/src/demo/components/core/DemoControlSelect.tsx +325 -0
- package/src/demo/components/core/DemoDataTable.tsx +255 -241
- package/src/demo/components/core/DemoTypeForm.tsx +7 -2
- package/src/demo/components/shared/MacWindow.tsx +5 -11
- package/src/demo/components/shared/Showcase.tsx +28 -42
- package/dist/admin/AdminApiKeys-C-6_Q-lH.js.map +0 -1
- package/dist/admin/AdminAudits-Bgbf04hO.js.map +0 -1
- package/dist/admin/AdminFiles-B9a7G3cY.js.map +0 -1
- package/dist/admin/AdminJobExecutions-B9cek5dl.js.map +0 -1
- package/dist/admin/AdminJobRegistry-DFgV3oqx.js.map +0 -1
- package/dist/admin/AdminLayout-DHsvWxVB.js +0 -70
- package/dist/admin/AdminLayout-DHsvWxVB.js.map +0 -1
- package/dist/admin/AdminParameters-DHw9ATgl.js.map +0 -1
- package/dist/admin/AdminSessions-BhGJPI3z.js.map +0 -1
- package/dist/admin/AdminUserLayout-BdC4Te8m.js.map +0 -1
- package/dist/admin/AdminUserSessions-1uzcx02z.js.map +0 -1
- package/dist/admin/AdminUsers-C85c3eiQ.js +0 -121
- package/dist/admin/AdminUsers-C85c3eiQ.js.map +0 -1
- package/dist/admin/Login-BGheURrg.js +0 -219
- package/dist/admin/Login-BGheURrg.js.map +0 -1
- package/dist/admin/Profile-B-c9pCPf.js.map +0 -1
- package/dist/admin/Register-Cs10l8vX.js.map +0 -1
- package/dist/admin/ResetPassword-BwDdfkGH.js.map +0 -1
- package/dist/admin/VerifyEmail-DfXHAiQl.js.map +0 -1
- package/dist/admin/auth-Dr0Cf8I7.js +0 -319
- package/dist/admin/auth-Dr0Cf8I7.js.map +0 -1
- package/dist/admin/core-2xoLiT0o.js.map +0 -1
- package/dist/auth/Login-Denw_UGy.js +0 -219
- package/dist/auth/Login-Denw_UGy.js.map +0 -1
- package/dist/auth/Profile-BMX_Ar_s.js.map +0 -1
- package/dist/auth/Register-6hi_cpfF.js.map +0 -1
- package/dist/auth/ResetPassword-CqfTk1FI.js.map +0 -1
- package/dist/auth/VerifyEmail-nWiSTMjF.js.map +0 -1
- package/dist/auth/core-niW0sFLv.js.map +0 -1
- package/dist/demo/DemoButton-BmaWZVwf.js +0 -178
- package/dist/demo/DemoButton-BmaWZVwf.js.map +0 -1
- package/dist/demo/DemoDataTable-Z9xyV221.js +0 -362
- package/dist/demo/DemoDataTable-Z9xyV221.js.map +0 -1
- package/dist/demo/DemoLayout-C56xb5EE.js.map +0 -1
- package/dist/demo/DemoLogin-BZwpicOS.js.map +0 -1
- package/dist/demo/DemoRegister-C7_qc4MJ.js.map +0 -1
- package/dist/demo/DemoResetPassword-BI1Ct4Dw.js.map +0 -1
- package/dist/demo/DemoTypeForm-DDzWoMSV.js.map +0 -1
- package/dist/demo/DemoVerifyEmail-C_Irdnov.js +0 -30
- package/dist/demo/DemoVerifyEmail-C_Irdnov.js.map +0 -1
- package/dist/demo/Login-hSOU3jZc.js +0 -219
- package/dist/demo/Login-hSOU3jZc.js.map +0 -1
- package/dist/demo/Profile-CWqti7FB.js.map +0 -1
- package/dist/demo/Register-a70LPgs2.js.map +0 -1
- package/dist/demo/ResetPassword-DWN0lzr5.js.map +0 -1
- package/dist/demo/Showcase-Dq3MISpd.js.map +0 -1
- package/dist/demo/VerifyEmail-DZWL72K4.js.map +0 -1
- package/dist/demo/core-RCUw1Q-a.js.map +0 -1
- package/src/demo/styles.css +0 -0
|
@@ -36,109 +36,115 @@ export interface DetailDrawerProps {
|
|
|
36
36
|
defaultTab?: string;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const DetailDrawer = ({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
p="md"
|
|
63
|
-
justify="space-between"
|
|
64
|
-
align="flex-start"
|
|
65
|
-
style={{ borderBottom: "1px solid var(--mantine-color-default-border)" }}
|
|
39
|
+
const DetailDrawer = (props: DetailDrawerProps) => {
|
|
40
|
+
const {
|
|
41
|
+
opened,
|
|
42
|
+
onClose,
|
|
43
|
+
title,
|
|
44
|
+
subtitle,
|
|
45
|
+
status,
|
|
46
|
+
actions,
|
|
47
|
+
tabs,
|
|
48
|
+
children,
|
|
49
|
+
loading,
|
|
50
|
+
size = "xl",
|
|
51
|
+
defaultTab,
|
|
52
|
+
} = props;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Drawer
|
|
56
|
+
opened={opened}
|
|
57
|
+
onClose={onClose}
|
|
58
|
+
position="right"
|
|
59
|
+
size={size}
|
|
60
|
+
withCloseButton={false}
|
|
61
|
+
padding={0}
|
|
66
62
|
>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
63
|
+
{/* Header */}
|
|
64
|
+
<Flex
|
|
65
|
+
p="md"
|
|
66
|
+
justify="space-between"
|
|
67
|
+
align="flex-start"
|
|
68
|
+
style={{
|
|
69
|
+
borderBottom: "1px solid var(--mantine-color-default-border)",
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<Flex direction="column" gap={2} style={{ minWidth: 0, flex: 1 }}>
|
|
73
|
+
<Flex gap="xs" align="center">
|
|
74
|
+
{status && (
|
|
75
|
+
<Flex
|
|
76
|
+
w={8}
|
|
77
|
+
h={8}
|
|
78
|
+
style={{
|
|
79
|
+
borderRadius: "50%",
|
|
80
|
+
backgroundColor: status.active
|
|
81
|
+
? "var(--mantine-color-green-6)"
|
|
82
|
+
: "var(--mantine-color-red-6)",
|
|
83
|
+
flexShrink: 0,
|
|
84
|
+
}}
|
|
85
|
+
/>
|
|
86
|
+
)}
|
|
87
|
+
<Text size="lg" fw={600} truncate>
|
|
88
|
+
{title}
|
|
89
|
+
</Text>
|
|
90
|
+
</Flex>
|
|
91
|
+
{subtitle && (
|
|
92
|
+
<Text size="sm" c="dimmed" truncate>
|
|
93
|
+
{subtitle}
|
|
94
|
+
</Text>
|
|
81
95
|
)}
|
|
82
|
-
<Text size="lg" fw={600} truncate>
|
|
83
|
-
{title}
|
|
84
|
-
</Text>
|
|
85
96
|
</Flex>
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
>
|
|
103
|
-
Actions
|
|
97
|
+
<Flex gap="xs" align="center" style={{ flexShrink: 0 }}>
|
|
98
|
+
{actions && actions.length > 0 && (
|
|
99
|
+
<ActionButton
|
|
100
|
+
variant="default"
|
|
101
|
+
size="xs"
|
|
102
|
+
menu={{
|
|
103
|
+
items: actions,
|
|
104
|
+
position: "bottom-end",
|
|
105
|
+
width: 200,
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
Actions
|
|
109
|
+
</ActionButton>
|
|
110
|
+
)}
|
|
111
|
+
<ActionButton variant="subtle" size="xs" c="dimmed" onClick={onClose}>
|
|
112
|
+
Close
|
|
104
113
|
</ActionButton>
|
|
105
|
-
|
|
106
|
-
<ActionButton variant="subtle" size="xs" c="dimmed" onClick={onClose}>
|
|
107
|
-
Close
|
|
108
|
-
</ActionButton>
|
|
114
|
+
</Flex>
|
|
109
115
|
</Flex>
|
|
110
|
-
</Flex>
|
|
111
116
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
{/* Content */}
|
|
118
|
+
{loading ? (
|
|
119
|
+
<Flex flex={1} justify="center" align="center" py="xl">
|
|
120
|
+
<Loader />
|
|
121
|
+
</Flex>
|
|
122
|
+
) : tabs && tabs.length > 0 ? (
|
|
123
|
+
<Tabs defaultValue={defaultTab || tabs[0].value}>
|
|
124
|
+
<Tabs.List px="md">
|
|
125
|
+
{tabs.map((tab) => (
|
|
126
|
+
<Tabs.Tab
|
|
127
|
+
key={tab.value}
|
|
128
|
+
value={tab.value}
|
|
129
|
+
leftSection={tab.icon ? <tab.icon size={14} /> : undefined}
|
|
130
|
+
>
|
|
131
|
+
{tab.label}
|
|
132
|
+
</Tabs.Tab>
|
|
133
|
+
))}
|
|
134
|
+
</Tabs.List>
|
|
120
135
|
{tabs.map((tab) => (
|
|
121
|
-
<Tabs.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
leftSection={tab.icon ? <tab.icon size={14} /> : undefined}
|
|
125
|
-
>
|
|
126
|
-
{tab.label}
|
|
127
|
-
</Tabs.Tab>
|
|
136
|
+
<Tabs.Panel key={tab.value} value={tab.value} p="md">
|
|
137
|
+
{tab.content}
|
|
138
|
+
</Tabs.Panel>
|
|
128
139
|
))}
|
|
129
|
-
</Tabs
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
{children}
|
|
139
|
-
</Flex>
|
|
140
|
-
)}
|
|
141
|
-
</Drawer>
|
|
142
|
-
);
|
|
140
|
+
</Tabs>
|
|
141
|
+
) : (
|
|
142
|
+
<Flex direction="column" p="md">
|
|
143
|
+
{children}
|
|
144
|
+
</Flex>
|
|
145
|
+
)}
|
|
146
|
+
</Drawer>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
143
149
|
|
|
144
150
|
export default DetailDrawer;
|
|
@@ -14,7 +14,8 @@ export interface DetailListProps {
|
|
|
14
14
|
columns?: number;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const DetailList = (
|
|
17
|
+
const DetailList = (props: DetailListProps) => {
|
|
18
|
+
const { items, columns = 1 } = props;
|
|
18
19
|
const visibleItems = items.filter((item) => !item.hidden);
|
|
19
20
|
|
|
20
21
|
return (
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
OmnibarButton,
|
|
9
9
|
type OmnibarButtonProps,
|
|
10
10
|
Text,
|
|
11
|
+
ThemeButton,
|
|
11
12
|
} from "@alepha/ui";
|
|
12
13
|
import {
|
|
13
14
|
Anchor,
|
|
@@ -25,6 +26,7 @@ export type AppBarItem =
|
|
|
25
26
|
| AppBarElement
|
|
26
27
|
| AppBarBurger
|
|
27
28
|
| AppBarDark
|
|
29
|
+
| AppBarTheme
|
|
28
30
|
| AppBarSearch
|
|
29
31
|
| AppBarLang
|
|
30
32
|
| AppBarSpacer
|
|
@@ -54,6 +56,11 @@ export interface AppBarDark extends AppBarAbstractItem {
|
|
|
54
56
|
props?: Partial<ActionProps>;
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
export interface AppBarTheme extends AppBarAbstractItem {
|
|
60
|
+
type: "theme";
|
|
61
|
+
props?: Partial<ActionProps>;
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
export interface AppBarSearch extends AppBarAbstractItem {
|
|
58
65
|
type: "search";
|
|
59
66
|
props?: OmnibarButtonProps;
|
|
@@ -175,6 +182,9 @@ const AppBar = (props: AppBarProps) => {
|
|
|
175
182
|
if (item.type === "dark") {
|
|
176
183
|
return <DarkModeButton key={index} {...item.props} />;
|
|
177
184
|
}
|
|
185
|
+
if (item.type === "theme") {
|
|
186
|
+
return <ThemeButton key={index} {...item.props} />;
|
|
187
|
+
}
|
|
178
188
|
if (item.type === "search") {
|
|
179
189
|
return <OmnibarButton key={index} {...item.props} />;
|
|
180
190
|
}
|
|
@@ -34,12 +34,9 @@ export interface BreadcrumbProps extends FlexProps {
|
|
|
34
34
|
* Pages should define a `label` in their `$page()` options for best results.
|
|
35
35
|
* Falls back to the page name converted to Title Case.
|
|
36
36
|
*/
|
|
37
|
-
const Breadcrumb = ({
|
|
38
|
-
home = "Home",
|
|
39
|
-
|
|
40
|
-
size = "sm",
|
|
41
|
-
...groupProps
|
|
42
|
-
}: BreadcrumbProps) => {
|
|
37
|
+
const Breadcrumb = (props: BreadcrumbProps) => {
|
|
38
|
+
const { home = "Home", separator, size = "sm", ...groupProps } = props;
|
|
39
|
+
|
|
43
40
|
const state = useRouterState();
|
|
44
41
|
const router = useRouter();
|
|
45
42
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { alephaSidebarAtom, Flex } from "@alepha/ui";
|
|
1
|
+
import { alephaSidebarAtom, Container, Flex } from "@alepha/ui";
|
|
2
2
|
import {
|
|
3
3
|
AppShell,
|
|
4
4
|
type AppShellFooterProps,
|
|
@@ -37,7 +37,7 @@ export interface DashboardShellProps {
|
|
|
37
37
|
/**
|
|
38
38
|
* Content rendered above the Sidebar inside the navbar (e.g. logo).
|
|
39
39
|
*/
|
|
40
|
-
navbarHeader?: ReactNode;
|
|
40
|
+
navbarHeader?: (props: { collapsed: boolean }) => ReactNode;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Content rendered below the Sidebar inside the navbar (e.g. toggle button).
|
|
@@ -64,10 +64,14 @@ export interface DashboardShellProps {
|
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
|
-
* Wrap
|
|
68
|
-
* Pass `true` for default Container, or ContainerProps to customize.
|
|
67
|
+
* Wrap the Dashboard main content in a Mantine Container.
|
|
69
68
|
*/
|
|
70
69
|
container?: boolean | ContainerProps;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* If true, the DashboardShell will fill the height of its container.
|
|
73
|
+
*/
|
|
74
|
+
fill?: boolean;
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
const DashboardShell = (props: DashboardShellProps) => {
|
|
@@ -131,11 +135,13 @@ const DashboardShell = (props: DashboardShellProps) => {
|
|
|
131
135
|
const headerHeight = hasAppBar ? hHeight : 0;
|
|
132
136
|
const footerHeight = footerElement ? fHeight : 0;
|
|
133
137
|
const navbarWidth = collapsed ? collapsedWidth : expandedWidth;
|
|
138
|
+
const mainContent = props.children ?? <NestedView />;
|
|
134
139
|
|
|
135
140
|
return (
|
|
136
141
|
<AppShell
|
|
137
142
|
layout={"alt"}
|
|
138
143
|
w={"100%"}
|
|
144
|
+
h={"100vh"}
|
|
139
145
|
flex={1}
|
|
140
146
|
header={hasAppBar ? { height: hHeight } : undefined}
|
|
141
147
|
navbar={
|
|
@@ -159,10 +165,7 @@ const DashboardShell = (props: DashboardShellProps) => {
|
|
|
159
165
|
)}
|
|
160
166
|
|
|
161
167
|
{hasSidebar && (
|
|
162
|
-
<AppShell.Navbar
|
|
163
|
-
className="alepha-sidebar-navbar"
|
|
164
|
-
{...props.appShellNavbarProps}
|
|
165
|
-
>
|
|
168
|
+
<AppShell.Navbar {...props.appShellNavbarProps}>
|
|
166
169
|
{props.navbarHeader ? (
|
|
167
170
|
<Flex
|
|
168
171
|
style={{
|
|
@@ -170,7 +173,7 @@ const DashboardShell = (props: DashboardShellProps) => {
|
|
|
170
173
|
}}
|
|
171
174
|
h={headerHeight}
|
|
172
175
|
>
|
|
173
|
-
{props.navbarHeader}
|
|
176
|
+
{props.navbarHeader({ collapsed })}
|
|
174
177
|
</Flex>
|
|
175
178
|
) : null}
|
|
176
179
|
<Sidebar {...(props.sidebarProps ?? {})} collapsed={collapsed} />
|
|
@@ -187,8 +190,22 @@ const DashboardShell = (props: DashboardShellProps) => {
|
|
|
187
190
|
</AppShell.Navbar>
|
|
188
191
|
)}
|
|
189
192
|
|
|
190
|
-
<AppShell.Main
|
|
191
|
-
{
|
|
193
|
+
<AppShell.Main
|
|
194
|
+
display={"flex"}
|
|
195
|
+
bg={"var(--alepha-ground)"}
|
|
196
|
+
pos={"relative"}
|
|
197
|
+
h={props.fill ? "100%" : "inherit"}
|
|
198
|
+
{...props.appShellMainProps}
|
|
199
|
+
>
|
|
200
|
+
{props.container ? (
|
|
201
|
+
<Container
|
|
202
|
+
{...(typeof props.container === "boolean" ? {} : props.container)}
|
|
203
|
+
>
|
|
204
|
+
{mainContent}
|
|
205
|
+
</Container>
|
|
206
|
+
) : (
|
|
207
|
+
mainContent
|
|
208
|
+
)}
|
|
192
209
|
</AppShell.Main>
|
|
193
210
|
|
|
194
211
|
{footerElement && (
|
|
@@ -1,31 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActionButton,
|
|
3
|
-
type ActionMenuConfig,
|
|
4
|
-
type ActionMenuItem,
|
|
5
|
-
type ActionProps,
|
|
6
|
-
Flex,
|
|
7
|
-
OmnibarButton,
|
|
8
|
-
renderIcon,
|
|
9
|
-
SidebarCollapseButton,
|
|
10
|
-
Text,
|
|
11
|
-
ui,
|
|
12
|
-
} from "@alepha/ui";
|
|
13
1
|
import type { FlexProps, MantineBreakpoint } from "@mantine/core";
|
|
14
|
-
import {
|
|
15
|
-
IconChevronDown,
|
|
16
|
-
IconChevronRight,
|
|
17
|
-
IconSquareRounded,
|
|
18
|
-
} from "@tabler/icons-react";
|
|
19
|
-
import { useEvents } from "alepha/react";
|
|
20
2
|
import { useRouter } from "alepha/react/router";
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
import { type ComponentType, Fragment, type ReactNode, useMemo } from "react";
|
|
4
|
+
import { ui } from "../../constants/ui.ts";
|
|
5
|
+
import { renderIcon } from "../../helpers/renderIcon.tsx";
|
|
6
|
+
import type { ActionProps } from "../buttons/ActionButton.tsx";
|
|
7
|
+
import OmnibarButton from "../buttons/OmnibarButton.tsx";
|
|
8
|
+
import SidebarCollapseButton from "../buttons/ToggleSidebarButton.tsx";
|
|
9
|
+
import Flex from "../Flex.tsx";
|
|
10
|
+
import Text from "../Text.tsx";
|
|
11
|
+
import { SidebarCollapsedItem } from "./SidebarCollapsedItem.tsx";
|
|
12
|
+
import { SidebarItem } from "./SidebarItem.tsx";
|
|
13
|
+
|
|
14
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
29
15
|
|
|
30
16
|
export interface SidebarProps {
|
|
31
17
|
items?: SidebarNode[];
|
|
@@ -49,9 +35,10 @@ export interface SidebarProps {
|
|
|
49
35
|
};
|
|
50
36
|
}
|
|
51
37
|
|
|
38
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
39
|
+
|
|
52
40
|
export const Sidebar = (props: SidebarProps) => {
|
|
53
41
|
const router = useRouter();
|
|
54
|
-
const { onItemClick } = props;
|
|
55
42
|
|
|
56
43
|
const divider = (
|
|
57
44
|
key: string | number,
|
|
@@ -89,7 +76,7 @@ export const Sidebar = (props: SidebarProps) => {
|
|
|
89
76
|
|
|
90
77
|
if (item.type === "search") {
|
|
91
78
|
return (
|
|
92
|
-
<Flex key={key} mb="xs">
|
|
79
|
+
<Flex key={key} mb="xs" w={"100%"} justify="center" pos={"relative"}>
|
|
93
80
|
<OmnibarButton collapsed={collapsed} />
|
|
94
81
|
</Flex>
|
|
95
82
|
);
|
|
@@ -112,7 +99,6 @@ export const Sidebar = (props: SidebarProps) => {
|
|
|
112
99
|
if (collapsed) {
|
|
113
100
|
return (
|
|
114
101
|
<Fragment key={key}>
|
|
115
|
-
{divider(`${key}-d`, undefined, collapsed)}
|
|
116
102
|
{item.children?.map((child, index) =>
|
|
117
103
|
renderNode(child, `s${key}-${index}`, collapsed),
|
|
118
104
|
)}
|
|
@@ -161,7 +147,7 @@ export const Sidebar = (props: SidebarProps) => {
|
|
|
161
147
|
key={key}
|
|
162
148
|
item={item}
|
|
163
149
|
level={0}
|
|
164
|
-
onItemClick={onItemClick}
|
|
150
|
+
onItemClick={props.onItemClick}
|
|
165
151
|
theme={props.theme ?? {}}
|
|
166
152
|
/>
|
|
167
153
|
);
|
|
@@ -172,7 +158,7 @@ export const Sidebar = (props: SidebarProps) => {
|
|
|
172
158
|
key={key}
|
|
173
159
|
item={item}
|
|
174
160
|
level={0}
|
|
175
|
-
onItemClick={onItemClick}
|
|
161
|
+
onItemClick={props.onItemClick}
|
|
176
162
|
theme={props.theme ?? {}}
|
|
177
163
|
/>
|
|
178
164
|
);
|
|
@@ -202,7 +188,7 @@ export const Sidebar = (props: SidebarProps) => {
|
|
|
202
188
|
};
|
|
203
189
|
|
|
204
190
|
const padding = "md";
|
|
205
|
-
const gap = props.items ? (props.gap ??
|
|
191
|
+
const gap = props.items ? (props.gap ?? 8) : "xs";
|
|
206
192
|
const menu = useMemo(
|
|
207
193
|
() => getSidebarNodes(),
|
|
208
194
|
[props.items, props.autoPopulateMenu],
|
|
@@ -249,209 +235,6 @@ export const Sidebar = (props: SidebarProps) => {
|
|
|
249
235
|
|
|
250
236
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
251
237
|
|
|
252
|
-
export interface SidebarItemProps {
|
|
253
|
-
item: SidebarMenuItem;
|
|
254
|
-
level: number;
|
|
255
|
-
onItemClick?: (item: SidebarMenuItem) => void;
|
|
256
|
-
theme: SidebarTheme;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export const SidebarItem = (props: SidebarItemProps) => {
|
|
260
|
-
const { item, level } = props;
|
|
261
|
-
const maxLevel = 2; // 0, 1, 2 = 3 levels total
|
|
262
|
-
|
|
263
|
-
const router = useRouter();
|
|
264
|
-
const isActive = useCallback((item: SidebarMenuItem): boolean => {
|
|
265
|
-
if (!item.children) return false;
|
|
266
|
-
for (const child of item.children) {
|
|
267
|
-
if (child.href) {
|
|
268
|
-
if (router.isActive(child.href)) {
|
|
269
|
-
return true;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
if (isActive(child)) {
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
return false;
|
|
277
|
-
}, []);
|
|
278
|
-
|
|
279
|
-
const [isOpen, setIsOpen] = useState<boolean>(isActive(item));
|
|
280
|
-
|
|
281
|
-
useEvents(
|
|
282
|
-
{
|
|
283
|
-
"react:transition:end": () => {
|
|
284
|
-
// recalculate open state on transition end to ensure correct state after navigation
|
|
285
|
-
if (isActive(item)) {
|
|
286
|
-
setIsOpen(true);
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
},
|
|
290
|
-
[],
|
|
291
|
-
);
|
|
292
|
-
|
|
293
|
-
if (level > maxLevel) return null;
|
|
294
|
-
|
|
295
|
-
const handleItemClick = (e: MouseEvent) => {
|
|
296
|
-
if (!props.item.target) {
|
|
297
|
-
e.preventDefault();
|
|
298
|
-
}
|
|
299
|
-
if (item.children && item.children.length > 0) {
|
|
300
|
-
setIsOpen(!isOpen);
|
|
301
|
-
} else {
|
|
302
|
-
props.onItemClick?.(item);
|
|
303
|
-
item.onClick?.();
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
return (
|
|
308
|
-
<Flex direction={"column"} ps={level === 0 ? 0 : 32} pos={"relative"}>
|
|
309
|
-
<ActionButton
|
|
310
|
-
w={"100%"}
|
|
311
|
-
justify="space-between"
|
|
312
|
-
href={props.item.href}
|
|
313
|
-
target={props.item.target}
|
|
314
|
-
size={
|
|
315
|
-
props.item.theme?.size ??
|
|
316
|
-
props.theme.button?.size ??
|
|
317
|
-
(level === 0 ? "sm" : "xs")
|
|
318
|
-
}
|
|
319
|
-
// tooltip={
|
|
320
|
-
// item.description
|
|
321
|
-
// ? { label: item.description, position: "right" }
|
|
322
|
-
// : undefined
|
|
323
|
-
// }
|
|
324
|
-
bd={0}
|
|
325
|
-
fw={"normal"}
|
|
326
|
-
variant={"default"}
|
|
327
|
-
propsActive={{
|
|
328
|
-
variant: "outline",
|
|
329
|
-
fw: "bold",
|
|
330
|
-
}}
|
|
331
|
-
radius={props.item.theme?.radius ?? props.theme.button?.radius ?? "md"}
|
|
332
|
-
onClick={handleItemClick}
|
|
333
|
-
leftSection={
|
|
334
|
-
<Flex w={"100%"} align="center" gap={"sm"}>
|
|
335
|
-
{renderIcon(item.icon, ui.sizes.icon.sm)}
|
|
336
|
-
<Flex direction={"column"}>
|
|
337
|
-
<Flex>{item.label}</Flex>
|
|
338
|
-
</Flex>
|
|
339
|
-
</Flex>
|
|
340
|
-
}
|
|
341
|
-
rightSection={
|
|
342
|
-
item.children ? (
|
|
343
|
-
<Flex>
|
|
344
|
-
{isOpen ? (
|
|
345
|
-
<IconChevronDown size={14} />
|
|
346
|
-
) : (
|
|
347
|
-
<IconChevronRight size={14} />
|
|
348
|
-
)}
|
|
349
|
-
</Flex>
|
|
350
|
-
) : (
|
|
351
|
-
props.item.rightSection
|
|
352
|
-
)
|
|
353
|
-
}
|
|
354
|
-
{...props.item.actionProps}
|
|
355
|
-
/>
|
|
356
|
-
|
|
357
|
-
{item.children && isOpen && (
|
|
358
|
-
<Flex direction={"column"} data-parent-level={level}>
|
|
359
|
-
<Flex
|
|
360
|
-
style={{
|
|
361
|
-
position: "absolute",
|
|
362
|
-
width: 1,
|
|
363
|
-
background:
|
|
364
|
-
"linear-gradient(to bottom, transparent, var(--mantine-color-default-border), transparent)",
|
|
365
|
-
top: 48,
|
|
366
|
-
left: 20 + 32 * level,
|
|
367
|
-
bottom: 16,
|
|
368
|
-
}}
|
|
369
|
-
/>
|
|
370
|
-
{item.children
|
|
371
|
-
.filter((child) => !child.can || child.can())
|
|
372
|
-
.map((child, index) => (
|
|
373
|
-
<SidebarItem
|
|
374
|
-
key={index}
|
|
375
|
-
item={child}
|
|
376
|
-
level={level + 1}
|
|
377
|
-
onItemClick={props.onItemClick}
|
|
378
|
-
theme={props.theme}
|
|
379
|
-
/>
|
|
380
|
-
))}
|
|
381
|
-
</Flex>
|
|
382
|
-
)}
|
|
383
|
-
</Flex>
|
|
384
|
-
);
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
388
|
-
|
|
389
|
-
const SidebarCollapsedItem = (props: SidebarItemProps) => {
|
|
390
|
-
const { item, level } = props;
|
|
391
|
-
const router = useRouter();
|
|
392
|
-
|
|
393
|
-
const handleItemClick = () => {
|
|
394
|
-
props.onItemClick?.(item);
|
|
395
|
-
item.onClick?.();
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
const hasChildren = item.children && item.children.length > 0;
|
|
399
|
-
|
|
400
|
-
const menu: ActionMenuConfig | undefined = hasChildren
|
|
401
|
-
? {
|
|
402
|
-
on: "hover",
|
|
403
|
-
position: "right",
|
|
404
|
-
items: item
|
|
405
|
-
.children!.filter((child) => !child.can || child.can())
|
|
406
|
-
.map(
|
|
407
|
-
(child): ActionMenuItem => ({
|
|
408
|
-
label: child.label as string,
|
|
409
|
-
icon: renderIcon(child.icon, ui.sizes.icon.sm),
|
|
410
|
-
href: child.href,
|
|
411
|
-
active: child.href
|
|
412
|
-
? router.isActive(child.href, {
|
|
413
|
-
startWith: child.activeStartsWith,
|
|
414
|
-
})
|
|
415
|
-
: undefined,
|
|
416
|
-
}),
|
|
417
|
-
),
|
|
418
|
-
}
|
|
419
|
-
: undefined;
|
|
420
|
-
|
|
421
|
-
return (
|
|
422
|
-
<ActionButton
|
|
423
|
-
size={
|
|
424
|
-
props.item.theme?.size ??
|
|
425
|
-
props.theme.button?.size ??
|
|
426
|
-
(level === 0 ? "sm" : "xs")
|
|
427
|
-
}
|
|
428
|
-
variant={"subtle"}
|
|
429
|
-
variantActive={"default"}
|
|
430
|
-
tooltip={
|
|
431
|
-
hasChildren
|
|
432
|
-
? undefined
|
|
433
|
-
: {
|
|
434
|
-
label: item.label,
|
|
435
|
-
position: "right",
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
radius={props.item.theme?.radius ?? props.theme.button?.radius ?? "md"}
|
|
439
|
-
onClick={hasChildren ? undefined : handleItemClick}
|
|
440
|
-
icon={
|
|
441
|
-
renderIcon(item.icon, ui.sizes.icon.sm) ?? (
|
|
442
|
-
<IconSquareRounded size={ui.sizes.icon.sm} />
|
|
443
|
-
)
|
|
444
|
-
}
|
|
445
|
-
href={hasChildren ? undefined : (props.item.href as any)}
|
|
446
|
-
target={hasChildren ? undefined : props.item.target}
|
|
447
|
-
menu={menu}
|
|
448
|
-
{...props.item.actionProps}
|
|
449
|
-
/>
|
|
450
|
-
);
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
454
|
-
|
|
455
238
|
export type SidebarNode =
|
|
456
239
|
| SidebarMenuItem
|
|
457
240
|
| SidebarSpacer
|