@alepha/ui 0.15.1 → 0.15.2
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/AdminAudits-BlGGKLof.js +3 -0
- package/dist/admin/{AdminAudits-DClGEVBj.js → AdminAudits-C0DPYw0W.js} +4 -4
- package/dist/admin/AdminAudits-C0DPYw0W.js.map +1 -0
- package/dist/admin/AdminFiles-Bg9feLFH.js +3 -0
- package/dist/admin/{AdminFiles-C76r1_Xz.js → AdminFiles-Cu8GHgQ3.js} +3 -3
- package/dist/admin/AdminFiles-Cu8GHgQ3.js.map +1 -0
- package/dist/admin/{AdminNotifications-Bsalygm5.js → AdminNotifications-CgYkBuG_.js} +3 -3
- package/dist/admin/AdminNotifications-CgYkBuG_.js.map +1 -0
- package/dist/admin/AdminNotifications-DmfGPqHe.js +3 -0
- package/dist/admin/{AdminParameters-CpmAWwqN.js → AdminParameters-Cl-R0nXt.js} +1 -1
- package/dist/admin/{AdminParameters-Bmxtnpv-.js → AdminParameters-hjNG_KXb.js} +4 -4
- package/dist/admin/AdminParameters-hjNG_KXb.js.map +1 -0
- package/dist/admin/{AdminSessions-DmK3R6pP.js → AdminSessions-Bey9cuy1.js} +4 -4
- package/dist/admin/AdminSessions-Bey9cuy1.js.map +1 -0
- package/dist/admin/AdminSessions-Cn4_jB04.js +3 -0
- package/dist/admin/{AdminUserAudits-BPMP1Qd2.js → AdminUserAudits-C7AN9jx7.js} +4 -4
- package/dist/admin/AdminUserAudits-C7AN9jx7.js.map +1 -0
- package/dist/admin/{AdminUserAudits-Brcenss9.js → AdminUserAudits-Cp_ERd2g.js} +1 -1
- package/dist/admin/{AdminUserCreate-Cx8bkYC2.js → AdminUserCreate-Chr-7hLk.js} +1 -1
- package/dist/admin/{AdminUserCreate-CZjB6NKc.js → AdminUserCreate-DiXi1EWB.js} +4 -4
- package/dist/admin/AdminUserCreate-DiXi1EWB.js.map +1 -0
- package/dist/admin/{AdminUserDetails-8TYsqQBy.js → AdminUserDetails-Dcn3OwMC.js} +1 -1
- package/dist/admin/{AdminUserDetails-DuqCOBJK.js → AdminUserDetails-yM4x8JE6.js} +5 -5
- package/dist/admin/AdminUserDetails-yM4x8JE6.js.map +1 -0
- package/dist/admin/{AdminUserLayout-Bz2u_zQ4.js → AdminUserLayout-CfeQHH6e.js} +1 -1
- package/dist/admin/{AdminUserLayout-Dgk8s7Cd.js → AdminUserLayout-D9bqGt6T.js} +3 -3
- package/dist/admin/AdminUserLayout-D9bqGt6T.js.map +1 -0
- package/dist/admin/{AdminUserSessions-DCpe8_T6.js → AdminUserSessions-kmkXG-xf.js} +4 -4
- package/dist/admin/AdminUserSessions-kmkXG-xf.js.map +1 -0
- package/dist/admin/AdminUserSessions-rvA0ztxn.js +3 -0
- package/dist/admin/{AdminUserSettings-qxDfowqh.js → AdminUserSettings-BnzRAcqV.js} +4 -4
- package/dist/admin/AdminUserSettings-BnzRAcqV.js.map +1 -0
- package/dist/admin/AdminUserSettings-CXs-jtRv.js +3 -0
- package/dist/admin/{AdminUsers-ZlPsDz0T.js → AdminUsers-CYkcUWCg.js} +4 -4
- package/dist/admin/AdminUsers-CYkcUWCg.js.map +1 -0
- package/dist/admin/AdminUsers-DdFXzrEn.js +3 -0
- package/dist/admin/index.d.ts +33 -18
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +44 -29
- package/dist/admin/index.js.map +1 -1
- package/dist/auth/{AuthLayout-CWzQ8rCe.js → AuthLayout-Dj5K4SIN.js} +2 -2
- package/dist/auth/AuthLayout-Dj5K4SIN.js.map +1 -0
- package/dist/auth/{Login-CyvKwy5e.js → Login-BAFVcX_J.js} +5 -5
- package/dist/auth/Login-BAFVcX_J.js.map +1 -0
- package/dist/auth/Login-C5PUsp8I.js +4 -0
- package/dist/auth/{Register-C7Zp09Ks.js → Register-CZRXEcWy.js} +6 -6
- package/dist/auth/Register-CZRXEcWy.js.map +1 -0
- package/dist/auth/Register-DMTs5ep_.js +4 -0
- package/dist/auth/ResetPassword-D-mhMtmx.js +3 -0
- package/dist/auth/{ResetPassword-DYJSUC6B.js → ResetPassword-DTYNsBIj.js} +5 -5
- package/dist/auth/ResetPassword-DTYNsBIj.js.map +1 -0
- package/dist/auth/VerifyEmail-BsrCmncc.js +3 -0
- package/dist/auth/{VerifyEmail-CNXFIwWW.js → VerifyEmail-DolENWGn.js} +4 -4
- package/dist/auth/VerifyEmail-DolENWGn.js.map +1 -0
- package/dist/auth/index.d.ts +30 -19
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +24 -13
- package/dist/auth/index.js.map +1 -1
- package/dist/core/index.d.ts +115 -52
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +302 -87
- package/dist/core/index.js.map +1 -1
- package/dist/demo/{DemoDataTable-DYbDYbs5.js → DemoDataTable-CguplbR7.js} +2 -2
- package/dist/demo/{DemoDataTable-DYbDYbs5.js.map → DemoDataTable-CguplbR7.js.map} +1 -1
- package/dist/demo/DemoJsonViewer-DIssGVlJ.js +4 -0
- package/dist/demo/{DemoJsonViewer-D_Hff1Q2.js → DemoJsonViewer-Dgdk3Txb.js} +3 -3
- package/dist/demo/{DemoJsonViewer-D_Hff1Q2.js.map → DemoJsonViewer-Dgdk3Txb.js.map} +1 -1
- package/dist/demo/{DemoLayout-DjIDm93B.js → DemoLayout-B20TEuhV.js} +2 -2
- package/dist/demo/DemoLayout-B20TEuhV.js.map +1 -0
- package/dist/demo/DemoLayout-DSRyf4qJ.js +3 -0
- package/dist/demo/{DemoLogin-BA_HiIRZ.js → DemoLogin-mtkN6340.js} +6 -6
- package/dist/demo/DemoLogin-mtkN6340.js.map +1 -0
- package/dist/demo/{DemoRegister-B6syaxP9.js → DemoRegister-C0MW7anp.js} +7 -7
- package/dist/demo/DemoRegister-C0MW7anp.js.map +1 -0
- package/dist/demo/{DemoResetPassword-BOcLG4GF.js → DemoResetPassword-CPTy88iK.js} +6 -6
- package/dist/demo/DemoResetPassword-CPTy88iK.js.map +1 -0
- package/dist/demo/{DemoSidebar-DpZXf7GO.js → DemoSidebar-MVmQKfMt.js} +2 -2
- package/dist/demo/{DemoSidebar-DpZXf7GO.js.map → DemoSidebar-MVmQKfMt.js.map} +1 -1
- package/dist/demo/{DemoTypeForm-BlLAcQqZ.js → DemoTypeForm-w-qtfRlC.js} +3 -3
- package/dist/demo/DemoTypeForm-w-qtfRlC.js.map +1 -0
- package/dist/demo/{DemoVerifyEmail-C-J7bXUQ.js → DemoVerifyEmail-C8FFJT5A.js} +5 -5
- package/dist/demo/DemoVerifyEmail-C8FFJT5A.js.map +1 -0
- package/dist/demo/{Showcase-HchhcsHV.js → Showcase-CQrMWars.js} +2 -2
- package/dist/demo/Showcase-CQrMWars.js.map +1 -0
- package/dist/demo/index.d.ts +25 -15
- package/dist/demo/index.d.ts.map +1 -1
- package/dist/demo/index.js +24 -14
- package/dist/demo/index.js.map +1 -1
- package/package.json +5 -6
- package/src/admin/AdminRouter.ts +2 -2
- package/src/admin/MainRouter.ts +1 -1
- package/src/admin/components/audits/AdminAudits.tsx +3 -3
- package/src/admin/components/files/AdminFiles.tsx +2 -2
- package/src/admin/components/jobs/AdminJobs.tsx +2 -2
- package/src/admin/components/notifications/AdminNotifications.tsx +2 -2
- package/src/admin/components/parameters/AdminParameters.tsx +1 -1
- package/src/admin/components/parameters/ParameterDetails.tsx +2 -2
- package/src/admin/components/parameters/ParameterHistory.tsx +1 -1
- package/src/admin/components/parameters/types.ts +9 -3
- package/src/admin/components/sessions/AdminSessions.tsx +3 -3
- package/src/admin/components/shared/AdminResourceHeader.tsx +1 -1
- package/src/admin/components/shared/AdminResourceTabs.tsx +1 -1
- package/src/admin/components/users/AdminUserAudits.tsx +3 -3
- package/src/admin/components/users/AdminUserCreate.tsx +3 -3
- package/src/admin/components/users/AdminUserDetails.tsx +4 -4
- package/src/admin/components/users/AdminUserLayout.tsx +2 -2
- package/src/admin/components/users/AdminUserSessions.tsx +3 -3
- package/src/admin/components/users/AdminUserSettings.tsx +3 -3
- package/src/admin/components/users/AdminUsers.tsx +3 -3
- package/src/admin/index.ts +16 -1
- package/src/auth/AuthI18n.ts +1 -1
- package/src/auth/AuthRouter.ts +2 -2
- package/src/auth/components/AuthLayout.tsx +1 -1
- package/src/auth/components/Login.tsx +4 -4
- package/src/auth/components/Register.tsx +5 -5
- package/src/auth/components/ResetPassword.tsx +4 -4
- package/src/auth/components/VerifyEmail.tsx +3 -3
- package/src/auth/components/buttons/UserButton.tsx +2 -2
- package/src/auth/index.ts +14 -3
- package/src/core/RootRouter.ts +1 -1
- package/src/core/atoms/alephaSidebarAtom.ts +57 -0
- package/src/core/components/buttons/ActionButton.tsx +9 -9
- package/src/core/components/buttons/BurgerButton.tsx +5 -4
- package/src/core/components/buttons/LanguageButton.tsx +1 -1
- package/src/core/components/buttons/OmnibarButton.tsx +20 -1
- package/src/core/components/buttons/ThemeButton.tsx +1 -1
- package/src/core/components/buttons/ToggleSidebarButton.tsx +33 -23
- package/src/core/components/form/Control.tsx +1 -1
- package/src/core/components/form/ControlArray.tsx +2 -2
- package/src/core/components/form/ControlDate.tsx +1 -1
- package/src/core/components/form/ControlNumber.tsx +2 -2
- package/src/core/components/form/ControlObject.tsx +1 -1
- package/src/core/components/form/ControlQueryBuilder.tsx +1 -1
- package/src/core/components/form/ControlSelect.tsx +1 -1
- package/src/core/components/form/TypeForm.tsx +2 -2
- package/src/core/components/layout/AdminShell.tsx +205 -27
- package/src/core/components/layout/AlephaMantineProvider.tsx +3 -3
- package/src/core/components/layout/Omnibar.tsx +2 -2
- package/src/core/components/layout/Sidebar.tsx +42 -77
- package/src/core/components/table/DataTable.tsx +2 -2
- package/src/core/components/table/DataTableFilters.tsx +1 -1
- package/src/core/components/table/types.ts +1 -1
- package/src/core/hooks/useDialog.ts +1 -1
- package/src/core/hooks/useTheme.ts +1 -1
- package/src/core/hooks/useToast.ts +1 -1
- package/src/core/index.ts +57 -6
- package/src/core/providers/ThemeProvider.ts +1 -1
- package/src/core/styles.css +58 -0
- package/src/core/utils/parseInput.ts +1 -1
- package/src/demo/DemoRouter.ts +1 -1
- package/src/demo/components/DemoLayout.tsx +1 -1
- package/src/demo/components/core/DemoTypeForm.tsx +1 -1
- package/src/demo/components/json/DemoJsonViewer.tsx +1 -1
- package/src/demo/components/shared/Showcase.tsx +1 -1
- package/src/demo/index.ts +11 -1
- package/src/json/index.ts +13 -0
- package/dist/admin/AdminAudits-ColpiP4T.js +0 -3
- package/dist/admin/AdminAudits-DClGEVBj.js.map +0 -1
- package/dist/admin/AdminFiles-C5pqXN5B.js +0 -3
- package/dist/admin/AdminFiles-C76r1_Xz.js.map +0 -1
- package/dist/admin/AdminNotifications-BXixCBu9.js +0 -3
- package/dist/admin/AdminNotifications-Bsalygm5.js.map +0 -1
- package/dist/admin/AdminParameters-Bmxtnpv-.js.map +0 -1
- package/dist/admin/AdminSessions-CrkRvey3.js +0 -3
- package/dist/admin/AdminSessions-DmK3R6pP.js.map +0 -1
- package/dist/admin/AdminUserAudits-BPMP1Qd2.js.map +0 -1
- package/dist/admin/AdminUserCreate-CZjB6NKc.js.map +0 -1
- package/dist/admin/AdminUserDetails-DuqCOBJK.js.map +0 -1
- package/dist/admin/AdminUserLayout-Dgk8s7Cd.js.map +0 -1
- package/dist/admin/AdminUserSessions-DCpe8_T6.js.map +0 -1
- package/dist/admin/AdminUserSessions-beiJqY2D.js +0 -3
- package/dist/admin/AdminUserSettings-CxlInVnu.js +0 -3
- package/dist/admin/AdminUserSettings-qxDfowqh.js.map +0 -1
- package/dist/admin/AdminUsers-Bd0wMP8v.js +0 -3
- package/dist/admin/AdminUsers-ZlPsDz0T.js.map +0 -1
- package/dist/auth/AuthLayout-CWzQ8rCe.js.map +0 -1
- package/dist/auth/Login-CxOPyNFP.js +0 -4
- package/dist/auth/Login-CyvKwy5e.js.map +0 -1
- package/dist/auth/Register-C7Zp09Ks.js.map +0 -1
- package/dist/auth/Register-Cacr7YbA.js +0 -4
- package/dist/auth/ResetPassword-CMkx8Ibf.js +0 -3
- package/dist/auth/ResetPassword-DYJSUC6B.js.map +0 -1
- package/dist/auth/VerifyEmail-CNXFIwWW.js.map +0 -1
- package/dist/auth/VerifyEmail-DKyDlz96.js +0 -3
- package/dist/demo/DemoJsonViewer-DbWVDdz_.js +0 -4
- package/dist/demo/DemoLayout-DjIDm93B.js.map +0 -1
- package/dist/demo/DemoLayout-nNMajP_9.js +0 -3
- package/dist/demo/DemoLogin-BA_HiIRZ.js.map +0 -1
- package/dist/demo/DemoRegister-B6syaxP9.js.map +0 -1
- package/dist/demo/DemoResetPassword-BOcLG4GF.js.map +0 -1
- package/dist/demo/DemoTypeForm-BlLAcQqZ.js.map +0 -1
- package/dist/demo/DemoVerifyEmail-C-J7bXUQ.js.map +0 -1
- package/dist/demo/Showcase-HchhcsHV.js.map +0 -1
package/src/auth/AuthRouter.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ReactAuth } from "@alepha/react/auth";
|
|
2
|
-
import { $page } from "@alepha/react/router";
|
|
3
1
|
import {
|
|
4
2
|
IconLogin2,
|
|
5
3
|
IconLogout2,
|
|
@@ -9,6 +7,8 @@ import {
|
|
|
9
7
|
} from "@tabler/icons-react";
|
|
10
8
|
import { $inject, AlephaError, t } from "alepha";
|
|
11
9
|
import type { RealmController } from "alepha/api/users";
|
|
10
|
+
import { ReactAuth } from "alepha/react/auth";
|
|
11
|
+
import { $page } from "alepha/react/router";
|
|
12
12
|
import { $client } from "alepha/server/links";
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useAuth } from "@alepha/react/auth";
|
|
2
|
-
import { FormValidationError, useForm } from "@alepha/react/form";
|
|
3
|
-
import { useI18n } from "@alepha/react/i18n";
|
|
4
|
-
import { useRouter } from "@alepha/react/router";
|
|
5
1
|
import { ActionButton, Control, capitalize } from "@alepha/ui";
|
|
6
2
|
import { Card, Flex, Group, Image, Stack, Text, Title } from "@mantine/core";
|
|
7
3
|
import { IconLock, IconUser } from "@tabler/icons-react";
|
|
8
4
|
import { AlephaError, t } from "alepha";
|
|
9
5
|
import type { RealmConfig } from "alepha/api/users";
|
|
6
|
+
import { useAuth } from "alepha/react/auth";
|
|
7
|
+
import { FormValidationError, useForm } from "alepha/react/form";
|
|
8
|
+
import { useI18n } from "alepha/react/i18n";
|
|
9
|
+
import { useRouter } from "alepha/react/router";
|
|
10
10
|
import { HttpError } from "alepha/server";
|
|
11
11
|
import { useMemo } from "react";
|
|
12
12
|
import type { AuthI18n } from "../AuthI18n.ts";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { useClient } from "@alepha/react";
|
|
2
|
-
import { useAuth } from "@alepha/react/auth";
|
|
3
|
-
import { useForm } from "@alepha/react/form";
|
|
4
|
-
import { useI18n } from "@alepha/react/i18n";
|
|
5
|
-
import { useRouter } from "@alepha/react/router";
|
|
6
1
|
import { ActionButton, Control, capitalize } from "@alepha/ui";
|
|
7
2
|
import {
|
|
8
3
|
Alert,
|
|
@@ -28,6 +23,11 @@ import type {
|
|
|
28
23
|
RegistrationIntentResponse,
|
|
29
24
|
UserController,
|
|
30
25
|
} from "alepha/api/users";
|
|
26
|
+
import { useClient } from "alepha/react";
|
|
27
|
+
import { useAuth } from "alepha/react/auth";
|
|
28
|
+
import { useForm } from "alepha/react/form";
|
|
29
|
+
import { useI18n } from "alepha/react/i18n";
|
|
30
|
+
import { useRouter } from "alepha/react/router";
|
|
31
31
|
import { useMemo, useState } from "react";
|
|
32
32
|
import type { AuthI18n } from "../AuthI18n.ts";
|
|
33
33
|
import type { AuthRouter } from "../AuthRouter.ts";
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { useClient } from "@alepha/react";
|
|
2
|
-
import { useForm } from "@alepha/react/form";
|
|
3
|
-
import { useI18n } from "@alepha/react/i18n";
|
|
4
|
-
import { useRouter } from "@alepha/react/router";
|
|
5
1
|
import { ActionButton, Control } from "@alepha/ui";
|
|
6
2
|
import {
|
|
7
3
|
Alert,
|
|
@@ -27,6 +23,10 @@ import type {
|
|
|
27
23
|
UserController,
|
|
28
24
|
} from "alepha/api/users";
|
|
29
25
|
import { resetPasswordRequestSchema } from "alepha/api/users";
|
|
26
|
+
import { useClient } from "alepha/react";
|
|
27
|
+
import { useForm } from "alepha/react/form";
|
|
28
|
+
import { useI18n } from "alepha/react/i18n";
|
|
29
|
+
import { useRouter } from "alepha/react/router";
|
|
30
30
|
import { useState } from "react";
|
|
31
31
|
import type { AuthI18n } from "../AuthI18n.ts";
|
|
32
32
|
import type { AuthRouter } from "../AuthRouter.ts";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useClient } from "@alepha/react";
|
|
2
|
-
import { useI18n } from "@alepha/react/i18n";
|
|
3
|
-
import { useRouter, useRouterState } from "@alepha/react/router";
|
|
4
1
|
import { ActionButton } from "@alepha/ui";
|
|
5
2
|
import { Alert, Card, Flex, Loader, Stack, Text } from "@mantine/core";
|
|
6
3
|
import { IconAlertCircle, IconCheck, IconMailCheck } from "@tabler/icons-react";
|
|
7
4
|
import type { UserController } from "alepha/api/users";
|
|
5
|
+
import { useClient } from "alepha/react";
|
|
6
|
+
import { useI18n } from "alepha/react/i18n";
|
|
7
|
+
import { useRouter, useRouterState } from "alepha/react/router";
|
|
8
8
|
import { useEffect, useState } from "react";
|
|
9
9
|
import type { AuthI18n } from "../AuthI18n.ts";
|
|
10
10
|
import type { AuthRouter } from "../AuthRouter.ts";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { useAuth } from "@alepha/react/auth";
|
|
2
|
-
import { useRouter } from "@alepha/react/router";
|
|
3
1
|
import {
|
|
4
2
|
ActionButton,
|
|
5
3
|
type ActionMenuConfig,
|
|
@@ -9,6 +7,8 @@ import {
|
|
|
9
7
|
} from "@alepha/ui";
|
|
10
8
|
import { Avatar } from "@mantine/core";
|
|
11
9
|
import { IconLogin2, IconLogout, IconUser } from "@tabler/icons-react";
|
|
10
|
+
import { useAuth } from "alepha/react/auth";
|
|
11
|
+
import { useRouter } from "alepha/react/router";
|
|
12
12
|
import type { ReactNode } from "react";
|
|
13
13
|
import type { AuthRouter } from "../../AuthRouter.ts";
|
|
14
14
|
|
package/src/auth/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AlephaReactAuth } from "@alepha/react/auth";
|
|
2
|
-
import { AlephaReactI18n } from "@alepha/react/i18n";
|
|
3
1
|
import { AlephaUI } from "@alepha/ui";
|
|
4
2
|
import { $module } from "alepha";
|
|
3
|
+
import { AlephaReactAuth } from "alepha/react/auth";
|
|
4
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
5
5
|
import { AuthI18n } from "./AuthI18n.ts";
|
|
6
6
|
import { AuthRouter } from "./AuthRouter.ts";
|
|
7
7
|
|
|
@@ -18,7 +18,18 @@ export { default as VerifyEmail } from "./components/VerifyEmail.tsx";
|
|
|
18
18
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* | type | quality | stability |
|
|
22
|
+
* |------|---------|-----------|
|
|
23
|
+
* | frontend | rare | experimental |
|
|
24
|
+
*
|
|
25
|
+
* Authentication UI components.
|
|
26
|
+
*
|
|
27
|
+
* **Features:**
|
|
28
|
+
* - Login page component
|
|
29
|
+
* - Register page component
|
|
30
|
+
* - Reset password page component
|
|
31
|
+
* - Email verification page component
|
|
32
|
+
* - UserButton for user menu
|
|
22
33
|
*
|
|
23
34
|
* @module alepha.ui.auth
|
|
24
35
|
*/
|
package/src/core/RootRouter.ts
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { $atom, type Static, t } from "alepha";
|
|
2
|
+
|
|
3
|
+
export const alephaSidebarAtom = $atom({
|
|
4
|
+
name: "alepha.ui.sidebar",
|
|
5
|
+
schema: t.object({
|
|
6
|
+
/**
|
|
7
|
+
* Whether the sidebar is opened or closed (mobile).
|
|
8
|
+
*/
|
|
9
|
+
opened: t.boolean(),
|
|
10
|
+
/**
|
|
11
|
+
* Whether the sidebar is collapsed (narrow) or expanded (wide).
|
|
12
|
+
*/
|
|
13
|
+
collapsed: t.boolean(),
|
|
14
|
+
/**
|
|
15
|
+
* Current width of the sidebar when expanded (can be changed by resizing).
|
|
16
|
+
* @default 300
|
|
17
|
+
*/
|
|
18
|
+
width: t.number(),
|
|
19
|
+
/**
|
|
20
|
+
* Default width used when expanding from collapsed state or on hover.
|
|
21
|
+
* @default 300
|
|
22
|
+
*/
|
|
23
|
+
defaultWidth: t.number(),
|
|
24
|
+
/**
|
|
25
|
+
* Width of the sidebar when collapsed.
|
|
26
|
+
* @default 78
|
|
27
|
+
*/
|
|
28
|
+
collapsedWidth: t.number(),
|
|
29
|
+
/**
|
|
30
|
+
* Maximum width when resizing.
|
|
31
|
+
* @default 500
|
|
32
|
+
*/
|
|
33
|
+
maxWidth: t.number(),
|
|
34
|
+
/**
|
|
35
|
+
* Minimum width before auto-collapse triggers.
|
|
36
|
+
* @default 150
|
|
37
|
+
*/
|
|
38
|
+
collapseThreshold: t.number(),
|
|
39
|
+
/**
|
|
40
|
+
* Delay in ms before sidebar expands on hover when collapsed.
|
|
41
|
+
* @default 300
|
|
42
|
+
*/
|
|
43
|
+
hoverDelay: t.number(),
|
|
44
|
+
}),
|
|
45
|
+
default: {
|
|
46
|
+
opened: false,
|
|
47
|
+
collapsed: false,
|
|
48
|
+
width: 300,
|
|
49
|
+
defaultWidth: 300,
|
|
50
|
+
collapsedWidth: 78,
|
|
51
|
+
maxWidth: 500,
|
|
52
|
+
collapseThreshold: 240,
|
|
53
|
+
hoverDelay: 300,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export type AlephaSidebarState = Static<typeof alephaSidebarAtom.schema>;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import { type UseActionReturn, useAction } from "@alepha/react";
|
|
2
|
-
import { type FormModel, useFormState } from "@alepha/react/form";
|
|
3
|
-
import {
|
|
4
|
-
type RouterGoOptions,
|
|
5
|
-
type UseActiveOptions,
|
|
6
|
-
useActive,
|
|
7
|
-
useRouter,
|
|
8
|
-
} from "@alepha/react/router";
|
|
9
1
|
import {
|
|
10
2
|
Anchor,
|
|
11
3
|
type AnchorProps,
|
|
@@ -23,6 +15,14 @@ import {
|
|
|
23
15
|
useMantineTheme,
|
|
24
16
|
} from "@mantine/core";
|
|
25
17
|
import { IconCheck, IconChevronRight } from "@tabler/icons-react";
|
|
18
|
+
import { type UseActionReturn, useAction } from "alepha/react";
|
|
19
|
+
import { type FormModel, useFormState } from "alepha/react/form";
|
|
20
|
+
import {
|
|
21
|
+
type RouterGoOptions,
|
|
22
|
+
type UseActiveOptions,
|
|
23
|
+
useActive,
|
|
24
|
+
useRouter,
|
|
25
|
+
} from "alepha/react/router";
|
|
26
26
|
import {
|
|
27
27
|
type ButtonHTMLAttributes,
|
|
28
28
|
Children,
|
|
@@ -287,7 +287,7 @@ const ActionButton = (_props: ActionProps) => {
|
|
|
287
287
|
|
|
288
288
|
if (!props.children) {
|
|
289
289
|
restProps.children = Children.only(icon);
|
|
290
|
-
restProps.px ??= "xs";
|
|
290
|
+
restProps.px ??= "xs"; // TODO: change based on props.size ?
|
|
291
291
|
} else {
|
|
292
292
|
restProps.leftSection = icon;
|
|
293
293
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { useStore } from "@alepha/react";
|
|
2
1
|
import { Burger, type BurgerProps } from "@mantine/core";
|
|
2
|
+
import { useStore } from "alepha/react";
|
|
3
|
+
import { alephaSidebarAtom } from "../../atoms/alephaSidebarAtom.ts";
|
|
3
4
|
|
|
4
5
|
export interface BurgerButtonProps extends BurgerProps {}
|
|
5
6
|
|
|
6
7
|
const BurgerButton = (props: BurgerButtonProps) => {
|
|
7
|
-
const [
|
|
8
|
+
const [sidebar, setSidebar] = useStore(alephaSidebarAtom);
|
|
8
9
|
|
|
9
10
|
return (
|
|
10
11
|
<Burger
|
|
11
|
-
opened={opened}
|
|
12
|
-
onClick={() =>
|
|
12
|
+
opened={sidebar.opened}
|
|
13
|
+
onClick={() => setSidebar({ ...sidebar, opened: !sidebar.opened })}
|
|
13
14
|
hiddenFrom="sm"
|
|
14
15
|
size="sm"
|
|
15
16
|
{...props}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Flex, Kbd, Text } from "@mantine/core";
|
|
2
|
+
import { useOs } from "@mantine/hooks";
|
|
2
3
|
import { spotlight } from "@mantine/spotlight";
|
|
3
4
|
import { IconSearch } from "@tabler/icons-react";
|
|
5
|
+
import { ClientOnly } from "alepha/react";
|
|
4
6
|
import ActionButton, { type ActionProps } from "./ActionButton.tsx";
|
|
5
7
|
|
|
6
8
|
export interface OmnibarButtonProps {
|
|
@@ -9,6 +11,23 @@ export interface OmnibarButtonProps {
|
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
const OmnibarButton = (props: OmnibarButtonProps) => {
|
|
14
|
+
const os = useOs();
|
|
15
|
+
const isMac = os === "macos" || os === "ios";
|
|
16
|
+
const shortcut = isMac ? "⌘" : "Ctrl";
|
|
17
|
+
|
|
18
|
+
if (props.collapsed) {
|
|
19
|
+
return (
|
|
20
|
+
<ActionButton
|
|
21
|
+
variant={"subtle"}
|
|
22
|
+
onClick={spotlight.open}
|
|
23
|
+
radius={"md"}
|
|
24
|
+
icon={<IconSearch size={16} />}
|
|
25
|
+
tooltip={{ label: "Search", position: "right" }}
|
|
26
|
+
{...props.actionProps}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
12
31
|
return (
|
|
13
32
|
<ActionButton
|
|
14
33
|
variant={"default"}
|
|
@@ -16,7 +35,7 @@ const OmnibarButton = (props: OmnibarButtonProps) => {
|
|
|
16
35
|
justify={"space-between"}
|
|
17
36
|
rightSection={
|
|
18
37
|
<Kbd visibleFrom={"sm"} size={"sm"}>
|
|
19
|
-
|
|
38
|
+
<ClientOnly>{shortcut}</ClientOnly>+K
|
|
20
39
|
</Kbd>
|
|
21
40
|
}
|
|
22
41
|
radius={"md"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useStore } from "@alepha/react";
|
|
2
1
|
import { IconPalette } from "@tabler/icons-react";
|
|
2
|
+
import { useStore } from "alepha/react";
|
|
3
3
|
import { alephaThemeListAtom } from "../../atoms/alephaThemeListAtom.ts";
|
|
4
4
|
import { useTheme } from "../../hooks/useTheme.ts";
|
|
5
5
|
import ActionButton, { type ActionProps } from "./ActionButton.tsx";
|
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import { useStore } from "@alepha/react";
|
|
2
|
-
import { Flex } from "@mantine/core";
|
|
3
1
|
import {
|
|
4
2
|
IconLayoutSidebarLeftCollapse,
|
|
5
3
|
IconLayoutSidebarRightCollapse,
|
|
6
4
|
} from "@tabler/icons-react";
|
|
7
|
-
import
|
|
5
|
+
import { useStore } from "alepha/react";
|
|
6
|
+
import { alephaSidebarAtom } from "../../atoms/alephaSidebarAtom.ts";
|
|
7
|
+
import ActionButton, { type ActionProps } from "./ActionButton.tsx";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type Props = ActionProps;
|
|
10
|
+
|
|
11
|
+
const ToggleSidebarButton = (props: Props) => {
|
|
12
|
+
const [sidebar, setSidebar] = useStore(alephaSidebarAtom);
|
|
11
13
|
|
|
12
14
|
return (
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
<ActionButton
|
|
16
|
+
icon={
|
|
17
|
+
sidebar.collapsed ? (
|
|
18
|
+
<IconLayoutSidebarRightCollapse />
|
|
19
|
+
) : (
|
|
20
|
+
<IconLayoutSidebarLeftCollapse />
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
visibleFrom={"sm"}
|
|
24
|
+
variant={"subtle"}
|
|
25
|
+
size={"md"}
|
|
26
|
+
onClick={() => {
|
|
27
|
+
const expanding = sidebar.collapsed;
|
|
28
|
+
setSidebar({
|
|
29
|
+
...sidebar,
|
|
30
|
+
collapsed: !sidebar.collapsed,
|
|
31
|
+
// Reset width to defaultWidth when expanding
|
|
32
|
+
width: expanding ? sidebar.defaultWidth : sidebar.width,
|
|
33
|
+
});
|
|
34
|
+
}}
|
|
35
|
+
tooltip={{
|
|
36
|
+
position: "right",
|
|
37
|
+
label: sidebar.collapsed ? "Show sidebar" : "Hide sidebar",
|
|
38
|
+
}}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
31
41
|
);
|
|
32
42
|
};
|
|
33
43
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useFormState } from "@alepha/react/form";
|
|
2
1
|
import {
|
|
3
2
|
ColorInput,
|
|
4
3
|
type ColorInputProps,
|
|
@@ -20,6 +19,7 @@ import type {
|
|
|
20
19
|
DateTimePickerProps,
|
|
21
20
|
TimeInputProps,
|
|
22
21
|
} from "@mantine/dates";
|
|
22
|
+
import { useFormState } from "alepha/react/form";
|
|
23
23
|
import type { ComponentType } from "react";
|
|
24
24
|
import {
|
|
25
25
|
type GenericControlProps,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { useEvents } from "@alepha/react";
|
|
2
|
-
import type { BaseInputField } from "@alepha/react/form";
|
|
3
1
|
import {
|
|
4
2
|
ActionIcon,
|
|
5
3
|
Fieldset,
|
|
@@ -11,6 +9,8 @@ import {
|
|
|
11
9
|
} from "@mantine/core";
|
|
12
10
|
import { IconGripVertical, IconPlus, IconTrash } from "@tabler/icons-react";
|
|
13
11
|
import type { TObject, TSchema } from "alepha";
|
|
12
|
+
import { useEvents } from "alepha/react";
|
|
13
|
+
import type { BaseInputField } from "alepha/react/form";
|
|
14
14
|
import { useRef, useState } from "react";
|
|
15
15
|
import { ui } from "../../constants/ui.ts";
|
|
16
16
|
import {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useFormState } from "@alepha/react/form";
|
|
2
1
|
import {
|
|
3
2
|
DateInput,
|
|
4
3
|
type DateInputProps,
|
|
@@ -7,6 +6,7 @@ import {
|
|
|
7
6
|
TimeInput,
|
|
8
7
|
type TimeInputProps,
|
|
9
8
|
} from "@mantine/dates";
|
|
9
|
+
import { useFormState } from "alepha/react/form";
|
|
10
10
|
import {
|
|
11
11
|
type GenericControlProps,
|
|
12
12
|
parseInput,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { useEvents } from "@alepha/react";
|
|
2
|
-
import { useFormState } from "@alepha/react/form";
|
|
3
1
|
import {
|
|
4
2
|
Input,
|
|
5
3
|
NumberInput,
|
|
@@ -7,6 +5,8 @@ import {
|
|
|
7
5
|
Slider,
|
|
8
6
|
type SliderProps,
|
|
9
7
|
} from "@mantine/core";
|
|
8
|
+
import { useEvents } from "alepha/react";
|
|
9
|
+
import { useFormState } from "alepha/react/form";
|
|
10
10
|
import { useRef, useState } from "react";
|
|
11
11
|
import {
|
|
12
12
|
type GenericControlProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BaseInputField, ObjectInputField } from "@alepha/react/form";
|
|
2
1
|
import { Fieldset, Grid, Stack, Text } from "@mantine/core";
|
|
3
2
|
import type { TObject } from "alepha";
|
|
3
|
+
import type { BaseInputField, ObjectInputField } from "alepha/react/form";
|
|
4
4
|
import {
|
|
5
5
|
type GenericControlProps,
|
|
6
6
|
parseInput,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useEvents } from "@alepha/react";
|
|
2
1
|
import {
|
|
3
2
|
ActionIcon,
|
|
4
3
|
Badge,
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
import { IconFilter, IconInfoTriangle, IconX } from "@tabler/icons-react";
|
|
15
14
|
import type { TObject } from "alepha";
|
|
16
15
|
import { parseQueryString } from "alepha/orm";
|
|
16
|
+
import { useEvents } from "alepha/react";
|
|
17
17
|
import { useRef, useState } from "react";
|
|
18
18
|
import { ui } from "../../constants/ui.ts";
|
|
19
19
|
import {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useFormState } from "@alepha/react/form";
|
|
2
1
|
import {
|
|
3
2
|
Autocomplete,
|
|
4
3
|
type AutocompleteProps,
|
|
@@ -13,6 +12,7 @@ import {
|
|
|
13
12
|
TagsInput,
|
|
14
13
|
type TagsInputProps,
|
|
15
14
|
} from "@mantine/core";
|
|
15
|
+
import { useFormState } from "alepha/react/form";
|
|
16
16
|
import { useEffect, useState } from "react";
|
|
17
17
|
import {
|
|
18
18
|
type GenericControlProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { FormModel } from "@alepha/react/form";
|
|
2
1
|
import { Card, Flex, type FlexProps, Grid } from "@mantine/core";
|
|
3
2
|
import type { TObject } from "alepha";
|
|
3
|
+
import type { FormModel } from "alepha/react/form";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
5
|
import ActionButton, {
|
|
6
6
|
type ActionSubmitButtonProps,
|
|
@@ -55,7 +55,7 @@ export interface TypeFormProps<T extends TObject> {
|
|
|
55
55
|
* @example
|
|
56
56
|
* ```tsx
|
|
57
57
|
* import { t } from "alepha";
|
|
58
|
-
* import { useForm } from "
|
|
58
|
+
* import { useForm } from "alepha/react/form";
|
|
59
59
|
* import { TypeForm } from "@alepha/ui";
|
|
60
60
|
*
|
|
61
61
|
* const form = useForm({
|