@kirill.konshin/mui 0.0.2 → 0.0.4

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 (65) hide show
  1. package/README.md +87 -0
  2. package/dist/admin/appProvider.d.ts +18 -0
  3. package/dist/admin/appProvider.d.ts.map +1 -0
  4. package/dist/admin/appProvider.js +32 -0
  5. package/dist/admin/appProvider.js.map +1 -0
  6. package/dist/admin/dashboardLayout.d.ts +8 -0
  7. package/dist/admin/dashboardLayout.d.ts.map +1 -0
  8. package/dist/admin/dashboardLayout.js +17 -0
  9. package/dist/admin/dashboardLayout.js.map +1 -0
  10. package/dist/admin/index.d.ts +4 -0
  11. package/dist/admin/index.d.ts.map +1 -0
  12. package/dist/admin/index.js +4 -0
  13. package/dist/admin/signInPage.d.ts +22 -0
  14. package/dist/admin/signInPage.d.ts.map +1 -0
  15. package/dist/admin/signInPage.js +60 -0
  16. package/dist/admin/signInPage.js.map +1 -0
  17. package/dist/appBarOffset.d.ts.map +1 -1
  18. package/dist/appBarOffset.js +11 -7
  19. package/dist/appBarOffset.js.map +1 -1
  20. package/dist/formControlFieldset.d.ts +1 -1
  21. package/dist/formControlFieldset.d.ts.map +1 -1
  22. package/dist/formControlFieldset.js +17 -26
  23. package/dist/formControlFieldset.js.map +1 -1
  24. package/dist/formControlFieldset.stories.d.ts +2 -2
  25. package/dist/formControlFieldset.stories.d.ts.map +1 -1
  26. package/dist/formLabelLegend.d.ts.map +1 -1
  27. package/dist/formLabelLegend.js +13 -10
  28. package/dist/formLabelLegend.js.map +1 -1
  29. package/dist/formLabelLegend.stories.d.ts +2 -2
  30. package/dist/formLabelLegend.stories.d.ts.map +1 -1
  31. package/dist/genericControl.d.ts.map +1 -1
  32. package/dist/genericControl.js +17 -21
  33. package/dist/genericControl.js.map +1 -1
  34. package/dist/genericControl.stories.d.ts +2 -2
  35. package/dist/genericControl.stories.d.ts.map +1 -1
  36. package/dist/index.d.ts +6 -5
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +6 -9
  39. package/dist/readOnly.d.ts.map +1 -1
  40. package/dist/readOnly.js +15 -7
  41. package/dist/readOnly.js.map +1 -1
  42. package/dist/readOnly.stories.d.ts +2 -2
  43. package/dist/readOnly.stories.d.ts.map +1 -1
  44. package/package.json +38 -5
  45. package/.ctirc +0 -20
  46. package/.storybook/main.ts +0 -2
  47. package/.storybook/preview.ts +0 -2
  48. package/.turbo/turbo-build.log +0 -24
  49. package/AGENTS.md +0 -19
  50. package/CHANGELOG.md +0 -8
  51. package/dist/index.js.map +0 -1
  52. package/src/README.md +0 -3
  53. package/src/appBarOffset.tsx +0 -8
  54. package/src/formControlFieldset.stories.tsx +0 -71
  55. package/src/formControlFieldset.tsx +0 -26
  56. package/src/formLabelLegend.stories.tsx +0 -139
  57. package/src/formLabelLegend.tsx +0 -13
  58. package/src/genericControl.stories.tsx +0 -111
  59. package/src/genericControl.tsx +0 -22
  60. package/src/index.ts +0 -5
  61. package/src/readOnly.stories.tsx +0 -118
  62. package/src/readOnly.tsx +0 -8
  63. package/tsconfig.json +0 -10
  64. package/turbo.json +0 -10
  65. package/vite.config.ts +0 -2
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # @kirill.konshin/mui
2
+
3
+ MUI utilities (main entry) and Toolpad admin components (`/admin` entry).
4
+
5
+ # Admin — `@kirill.konshin/mui/admin`
6
+
7
+ Preconfigured [`@toolpad/core`](https://mui.com/toolpad/core/introduction/) building blocks for password-protected admin apps, wired to [`@kirill.konshin/auth`](https://github.com/kirill-konshin/utils/tree/main/packages/auth):
8
+
9
+ - `AdminAppProvider` — `NextAppProvider` with sign-out built from a `logoutAction` server action
10
+ - `AdminDashboardLayout` — `DashboardLayout` (sidebar collapsed by default) wrapping children in `PageContainer`; also works around Toolpad 0.16 modules missing `'use client'` banners
11
+ - `AdminSignInPage` — `SignInPage` for password-only login: single credentials provider, no email/rememberMe, takes `auth.loginFormAction`, renders setup instructions when `isConfigured` is false; on a dedicated login page pass `state={auth.getReturnTo(await searchParams)}` to return users to the page they came from
12
+
13
+ ```tsx
14
+ // app/admin/layout.tsx — Server Component, passes the actions from @/auth down as props
15
+ import { auth, loginAction, logoutAction } from '@/auth';
16
+ import { AdminShell } from './AdminShell';
17
+ import { AdminSignIn } from './AdminSignIn';
18
+
19
+ export default async function AdminLayout({ children }: LayoutProps<'/admin'>) {
20
+ const isConfigured = auth.isConfigured();
21
+ if (!isConfigured || !(await auth.isAuthenticated())) {
22
+ return <AdminSignIn loginAction={loginAction} isConfigured={isConfigured} />;
23
+ }
24
+ return <AdminShell logoutAction={logoutAction}>{children}</AdminShell>;
25
+ }
26
+ ```
27
+
28
+ ```tsx
29
+ // app/admin/AdminShell.tsx — theme/navigation/branding stay app-specific
30
+ 'use client';
31
+
32
+ import type { PasswordAuth } from '@kirill.konshin/auth';
33
+ import { AdminAppProvider, AdminDashboardLayout } from '@kirill.konshin/mui/admin';
34
+ import DashboardIcon from '@mui/icons-material/Dashboard';
35
+
36
+ const NAVIGATION = [{ segment: 'admin', title: 'Dashboard', icon: <DashboardIcon /> }];
37
+
38
+ export function AdminShell({
39
+ children,
40
+ logoutAction,
41
+ }: {
42
+ children: React.ReactNode;
43
+ logoutAction: PasswordAuth['logout'];
44
+ }) {
45
+ return (
46
+ <AdminAppProvider
47
+ branding={{ title: 'Admin', homeUrl: '/admin' }}
48
+ navigation={NAVIGATION}
49
+ logoutAction={logoutAction}
50
+ >
51
+ <AdminDashboardLayout>{children}</AdminDashboardLayout>
52
+ </AdminAppProvider>
53
+ );
54
+ }
55
+ ```
56
+
57
+ ```tsx
58
+ // app/admin/AdminSignIn.tsx
59
+ 'use client';
60
+
61
+ import type { PasswordAuth } from '@kirill.konshin/auth';
62
+ import { AdminAppProvider, AdminSignInPage } from '@kirill.konshin/mui/admin';
63
+
64
+ export function AdminSignIn({
65
+ loginAction,
66
+ isConfigured,
67
+ }: {
68
+ loginAction: PasswordAuth['loginFormAction'];
69
+ isConfigured: boolean;
70
+ }) {
71
+ return (
72
+ <AdminAppProvider branding={{ title: 'Admin' }}>
73
+ <AdminSignInPage loginAction={loginAction} isConfigured={isConfigured} />
74
+ </AdminAppProvider>
75
+ );
76
+ }
77
+ ```
78
+
79
+ Root layout still needs `AppRouterCacheProvider` from `@mui/material-nextjs/v15-appRouter` (with `options={{ enableCssLayer: true }}`) and your theme.
80
+
81
+ # Utilities (main entry)
82
+
83
+ `AppBarOffset`, `FormControlFieldset`, `FormLabelLegend`, `GenericControl`, `ReadOnly` — see stories.
84
+
85
+ ## Prior Art
86
+
87
+ https://codesandbox.io/p/sandbox/l7vykxl57q MUI v4
@@ -0,0 +1,18 @@
1
+ import { ComponentProps, FC } from 'react';
2
+ import { NextAppProvider } from '@toolpad/core/nextjs';
3
+ export type AdminAppProviderProps = ComponentProps<typeof NextAppProvider> & {
4
+ /** Server action that destroys the session, wired into Toolpad `authentication.signOut` */
5
+ logoutAction?: () => Promise<void>;
6
+ /**
7
+ * Login page (`auth.urls.login`) — Toolpad calls `authentication.signIn` from the account menu
8
+ * when no session is present, and the sign-in UI is `AdminSignInPage` living there. Default `/login`
9
+ */
10
+ loginUrl?: string;
11
+ };
12
+ /**
13
+ * `NextAppProvider` preconfigured for password-protected admin apps: pass `logoutAction` (e.g.
14
+ * `auth.logout` re-exported from a `'use server'` file) to get a sign-out button with a default
15
+ * `Admin` session; `authentication`/`session` props still win when provided.
16
+ */
17
+ export declare const AdminAppProvider: FC<AdminAppProviderProps>;
18
+ //# sourceMappingURL=appProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appProvider.d.ts","sourceRoot":"","sources":["../../src/admin/appProvider.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,cAAc,EAAE,KAAK,EAAE,EAAiB,MAAM,OAAO,CAAC;AAG3E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,GAAG;IACzE,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAyBrD,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { memo, useMemo } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { NextAppProvider } from "@toolpad/core/nextjs";
5
+ import { useRouter } from "next/navigation";
6
+ //#region src/admin/appProvider.tsx
7
+ var DEFAULT_SESSION = { user: { name: "Admin" } };
8
+ /**
9
+ * `NextAppProvider` preconfigured for password-protected admin apps: pass `logoutAction` (e.g.
10
+ * `auth.logout` re-exported from a `'use server'` file) to get a sign-out button with a default
11
+ * `Admin` session; `authentication`/`session` props still win when provided.
12
+ */
13
+ var AdminAppProvider = memo(function AdminAppProvider({ logoutAction, loginUrl = "/login", authentication, session, ...props }) {
14
+ const router = useRouter();
15
+ const defaultAuthentication = useMemo(() => logoutAction && {
16
+ signIn: () => router.push(loginUrl),
17
+ signOut: () => void logoutAction()
18
+ }, [
19
+ logoutAction,
20
+ loginUrl,
21
+ router
22
+ ]);
23
+ return /* @__PURE__ */ jsx(NextAppProvider, {
24
+ authentication: authentication ?? defaultAuthentication,
25
+ session: session ?? (logoutAction ? DEFAULT_SESSION : void 0),
26
+ ...props
27
+ });
28
+ });
29
+ //#endregion
30
+ export { AdminAppProvider };
31
+
32
+ //# sourceMappingURL=appProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appProvider.js","names":[],"sources":["../../src/admin/appProvider.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ComponentProps, type FC, memo, useMemo } from 'react';\n\nimport { type Authentication, type Session } from '@toolpad/core/AppProvider';\nimport { NextAppProvider } from '@toolpad/core/nextjs';\nimport { useRouter } from 'next/navigation';\n\nexport type AdminAppProviderProps = ComponentProps<typeof NextAppProvider> & {\n /** Server action that destroys the session, wired into Toolpad `authentication.signOut` */\n logoutAction?: () => Promise<void>;\n /**\n * Login page (`auth.urls.login`) — Toolpad calls `authentication.signIn` from the account menu\n * when no session is present, and the sign-in UI is `AdminSignInPage` living there. Default `/login`\n */\n loginUrl?: string;\n};\n\nconst DEFAULT_SESSION: Session = { user: { name: 'Admin' } };\n\n/**\n * `NextAppProvider` preconfigured for password-protected admin apps: pass `logoutAction` (e.g.\n * `auth.logout` re-exported from a `'use server'` file) to get a sign-out button with a default\n * `Admin` session; `authentication`/`session` props still win when provided.\n */\nexport const AdminAppProvider: FC<AdminAppProviderProps> = memo(function AdminAppProvider({\n logoutAction,\n loginUrl = '/login',\n authentication,\n session,\n ...props\n}) {\n const router = useRouter();\n\n const defaultAuthentication = useMemo<Authentication | undefined>(\n () =>\n logoutAction && {\n signIn: () => router.push(loginUrl), // the login page renders AdminSignInPage\n signOut: () => void logoutAction(),\n },\n [logoutAction, loginUrl, router],\n );\n\n return (\n <NextAppProvider\n authentication={authentication ?? defaultAuthentication}\n session={session ?? (logoutAction ? DEFAULT_SESSION : undefined)}\n {...props}\n />\n );\n});\n"],"mappings":";;;;;;AAkBA,IAAM,kBAA2B,EAAE,MAAM,EAAE,MAAM,QAAQ,EAAE;;;;;;AAO3D,IAAa,mBAA8C,KAAK,SAAS,iBAAiB,EACtF,cACA,WAAW,UACX,gBACA,SACA,GAAG,SACJ;CACC,MAAM,SAAS,UAAU;CAEzB,MAAM,wBAAwB,cAEtB,gBAAgB;EACZ,cAAc,OAAO,KAAK,QAAQ;EAClC,eAAe,KAAK,aAAa;CACrC,GACJ;EAAC;EAAc;EAAU;CAAM,CACnC;CAEA,OACI,oBAAC,iBAAD;EACI,gBAAgB,kBAAkB;EAClC,SAAS,YAAY,eAAe,kBAAkB,KAAA;EACtD,GAAI;CACP,CAAA;AAET,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ComponentProps, FC } from 'react';
2
+ import { DashboardLayout } from '@toolpad/core/DashboardLayout';
3
+ export type AdminDashboardLayoutProps = ComponentProps<typeof DashboardLayout> & {
4
+ /** Wrap children in Toolpad `PageContainer`, default true */
5
+ pageContainer?: boolean;
6
+ };
7
+ export declare const AdminDashboardLayout: FC<AdminDashboardLayoutProps>;
8
+ //# sourceMappingURL=dashboardLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboardLayout.d.ts","sourceRoot":"","sources":["../../src/admin/dashboardLayout.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,cAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,GAAG;IAC7E,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAKF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAU7D,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { memo } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { DashboardLayout } from "@toolpad/core/DashboardLayout";
5
+ import { PageContainer } from "@toolpad/core/PageContainer";
6
+ //#region src/admin/dashboardLayout.tsx
7
+ var AdminDashboardLayout = memo(function AdminDashboardLayout({ children, pageContainer = true, ...props }) {
8
+ return /* @__PURE__ */ jsx(DashboardLayout, {
9
+ defaultSidebarCollapsed: true,
10
+ ...props,
11
+ children: pageContainer ? /* @__PURE__ */ jsx(PageContainer, { children }) : children
12
+ });
13
+ });
14
+ //#endregion
15
+ export { AdminDashboardLayout };
16
+
17
+ //# sourceMappingURL=dashboardLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboardLayout.js","names":[],"sources":["../../src/admin/dashboardLayout.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ComponentProps, type FC, memo } from 'react';\n\nimport { DashboardLayout } from '@toolpad/core/DashboardLayout';\nimport { PageContainer } from '@toolpad/core/PageContainer';\n\nexport type AdminDashboardLayoutProps = ComponentProps<typeof DashboardLayout> & {\n /** Wrap children in Toolpad `PageContainer`, default true */\n pageContainer?: boolean;\n};\n\n// Client wrapper is mandatory: @toolpad/core ships some DashboardLayout modules without\n// 'use client' banners (AppTitle, DashboardHeader — verified still missing in 0.16), which crash\n// when evaluated in the server graph. Re-check on Toolpad upgrades.\nexport const AdminDashboardLayout: FC<AdminDashboardLayoutProps> = memo(function AdminDashboardLayout({\n children,\n pageContainer = true,\n ...props\n}) {\n return (\n <DashboardLayout defaultSidebarCollapsed {...props}>\n {pageContainer ? <PageContainer>{children}</PageContainer> : children}\n </DashboardLayout>\n );\n});\n"],"mappings":";;;;;;AAeA,IAAa,uBAAsD,KAAK,SAAS,qBAAqB,EAClG,UACA,gBAAgB,MAChB,GAAG,SACJ;CACC,OACI,oBAAC,iBAAD;EAAiB,yBAAA;EAAwB,GAAI;YACxC,gBAAgB,oBAAC,eAAD,EAAgB,SAAwB,CAAA,IAAI;CAChD,CAAA;AAEzB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './appProvider.js';
2
+ export * from './dashboardLayout.js';
3
+ export * from './signInPage.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AdminAppProvider } from "./appProvider.js";
2
+ import { AdminDashboardLayout } from "./dashboardLayout.js";
3
+ import { AdminSignInPage } from "./signInPage.js";
4
+ export { AdminAppProvider, AdminDashboardLayout, AdminSignInPage };
@@ -0,0 +1,22 @@
1
+ import { ComponentProps, FC } from 'react';
2
+ import { PasswordAuth } from '@kirill.konshin/auth';
3
+ import { SignInPage } from '@toolpad/core/SignInPage';
4
+ type SignInPageProps = ComponentProps<typeof SignInPage>;
5
+ export type AdminSignInPageProps = Omit<SignInPageProps, 'signIn'> & {
6
+ /** `auth.loginFormAction` from `@kirill.konshin/auth`, re-exported from a `'use server'` file */
7
+ loginAction: PasswordAuth['loginFormAction'];
8
+ /** Pass `auth.isConfigured()` to render setup instructions instead of the form, default true */
9
+ isConfigured?: boolean;
10
+ /** Subtitle shown when not configured */
11
+ notConfiguredSubtitle?: string;
12
+ /** Sanitized return URL (`auth.getState(await searchParams)`), threaded into the login form */
13
+ state?: string;
14
+ };
15
+ /**
16
+ * Toolpad `SignInPage` preconfigured for the password-only login of `@kirill.konshin/auth`: single
17
+ * credentials provider, no email/rememberMe fields, errors surfaced through the form. On success
18
+ * `loginAction` redirects (handled by Next.js), on failure its message is shown.
19
+ */
20
+ export declare const AdminSignInPage: FC<AdminSignInPageProps>;
21
+ export {};
22
+ //# sourceMappingURL=signInPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signInPage.d.ts","sourceRoot":"","sources":["../../src/admin/signInPage.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,cAAc,EAAE,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AAE/E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,KAAK,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG;IACjE,iGAAiG;IACjG,WAAW,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAC7C,gGAAgG;IAChG,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,+FAA+F;IAC/F,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA2DnD,CAAC"}
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import { memo, useCallback } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { STATE_PARAM } from "@kirill.konshin/auth/client";
5
+ import { formLabelClasses } from "@mui/material/FormLabel";
6
+ import { SignInPage } from "@toolpad/core/SignInPage";
7
+ //#region src/admin/signInPage.tsx
8
+ var DEFAULT_PROVIDERS = [{
9
+ id: "credentials",
10
+ name: "password"
11
+ }];
12
+ var NOT_CONFIGURED_SUBTITLE = "Set ADMIN_PASSWORD and a SESSION_SECRET of at least 32 characters, then restart.";
13
+ /**
14
+ * Toolpad `SignInPage` preconfigured for the password-only login of `@kirill.konshin/auth`: single
15
+ * credentials provider, no email/rememberMe fields, errors surfaced through the form. On success
16
+ * `loginAction` redirects (handled by Next.js), on failure its message is shown.
17
+ */
18
+ var AdminSignInPage = memo(function AdminSignInPage({ loginAction, isConfigured = true, notConfiguredSubtitle = NOT_CONFIGURED_SUBTITLE, providers = DEFAULT_PROVIDERS, state, localeText, slots, slotProps, ...props }) {
19
+ return /* @__PURE__ */ jsx(SignInPage, {
20
+ signIn: useCallback(async (_provider, formData) => {
21
+ if (!(formData instanceof FormData)) return { error: "Password is required" };
22
+ if (state) formData.set(STATE_PARAM, state);
23
+ const error = await loginAction(null, formData);
24
+ return error ? { error } : {};
25
+ }, [loginAction, state]),
26
+ providers: isConfigured ? providers : [],
27
+ localeText: isConfigured ? localeText : {
28
+ signInTitle: "Authentication needs configuration",
29
+ signInSubtitle: notConfiguredSubtitle,
30
+ ...localeText
31
+ },
32
+ slots: {
33
+ emailField: () => null,
34
+ rememberMe: () => null,
35
+ subtitle: () => null,
36
+ ...slots
37
+ },
38
+ slotProps: {
39
+ ...slotProps,
40
+ form: {
41
+ noValidate: true,
42
+ ...slotProps?.form
43
+ },
44
+ passwordField: {
45
+ autoFocus: true,
46
+ sx: { [`& .${formLabelClasses.root}`]: { top: "-2px" } },
47
+ ...slotProps?.passwordField
48
+ },
49
+ submitButton: {
50
+ variant: "contained",
51
+ ...slotProps?.submitButton
52
+ }
53
+ },
54
+ ...props
55
+ });
56
+ });
57
+ //#endregion
58
+ export { AdminSignInPage };
59
+
60
+ //# sourceMappingURL=signInPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signInPage.js","names":[],"sources":["../../src/admin/signInPage.tsx"],"sourcesContent":["'use client';\n\nimport React, { type ComponentProps, type FC, memo, useCallback } from 'react';\n\nimport { type PasswordAuth } from '@kirill.konshin/auth';\nimport { STATE_PARAM } from '@kirill.konshin/auth/client';\nimport { formLabelClasses } from '@mui/material/FormLabel';\nimport { SignInPage } from '@toolpad/core/SignInPage';\n\ntype SignInPageProps = ComponentProps<typeof SignInPage>;\n\nexport type AdminSignInPageProps = Omit<SignInPageProps, 'signIn'> & {\n /** `auth.loginFormAction` from `@kirill.konshin/auth`, re-exported from a `'use server'` file */\n loginAction: PasswordAuth['loginFormAction'];\n /** Pass `auth.isConfigured()` to render setup instructions instead of the form, default true */\n isConfigured?: boolean;\n /** Subtitle shown when not configured */\n notConfiguredSubtitle?: string;\n /** Sanitized return URL (`auth.getState(await searchParams)`), threaded into the login form */\n state?: string;\n};\n\nconst DEFAULT_PROVIDERS: SignInPageProps['providers'] = [{ id: 'credentials', name: 'password' }];\n\nconst NOT_CONFIGURED_SUBTITLE = 'Set ADMIN_PASSWORD and a SESSION_SECRET of at least 32 characters, then restart.';\n\n/**\n * Toolpad `SignInPage` preconfigured for the password-only login of `@kirill.konshin/auth`: single\n * credentials provider, no email/rememberMe fields, errors surfaced through the form. On success\n * `loginAction` redirects (handled by Next.js), on failure its message is shown.\n */\nexport const AdminSignInPage: FC<AdminSignInPageProps> = memo(function AdminSignInPage({\n loginAction,\n isConfigured = true,\n notConfiguredSubtitle = NOT_CONFIGURED_SUBTITLE,\n providers = DEFAULT_PROVIDERS,\n state,\n localeText,\n slots,\n slotProps,\n ...props\n}) {\n const signIn = useCallback<NonNullable<SignInPageProps['signIn']>>(\n async (_provider, formData) => {\n if (!(formData instanceof FormData)) return { error: 'Password is required' };\n // thread the return URL through the form only — never store it in the session,\n // multiple tabs logging in concurrently would clash\n if (state) formData.set(STATE_PARAM, state);\n const error = await loginAction(null, formData);\n return error ? { error } : {};\n },\n [loginAction, state],\n );\n\n return (\n <SignInPage\n signIn={signIn}\n providers={isConfigured ? providers : []}\n localeText={\n isConfigured\n ? localeText\n : {\n signInTitle: 'Authentication needs configuration',\n signInSubtitle: notConfiguredSubtitle,\n ...localeText,\n }\n }\n slots={{\n emailField: () => null,\n rememberMe: () => null,\n subtitle: () => null,\n ...slots,\n }}\n slotProps={{\n ...slotProps,\n // FIXME https://github.com/mui/toolpad/issues/4572 — still relevant in 0.16:\n // browser validation popups fight the server-side errors (noValidate is settable\n // declaratively through the form slot) and the password label renders misaligned;\n // re-check on Toolpad upgrades\n form: { noValidate: true, ...slotProps?.form },\n passwordField: {\n autoFocus: true,\n sx: { [`& .${formLabelClasses.root}`]: { top: '-2px' } },\n ...slotProps?.passwordField,\n },\n submitButton: { variant: 'contained', ...slotProps?.submitButton },\n }}\n {...props}\n />\n );\n});\n"],"mappings":";;;;;;;AAsBA,IAAM,oBAAkD,CAAC;CAAE,IAAI;CAAe,MAAM;AAAW,CAAC;AAEhG,IAAM,0BAA0B;;;;;;AAOhC,IAAa,kBAA4C,KAAK,SAAS,gBAAgB,EACnF,aACA,eAAe,MACf,wBAAwB,yBACxB,YAAY,mBACZ,OACA,YACA,OACA,WACA,GAAG,SACJ;CAaC,OACI,oBAAC,YAAD;EACY,QAdD,YACX,OAAO,WAAW,aAAa;GAC3B,IAAI,EAAE,oBAAoB,WAAW,OAAO,EAAE,OAAO,uBAAuB;GAG5E,IAAI,OAAO,SAAS,IAAI,aAAa,KAAK;GAC1C,MAAM,QAAQ,MAAM,YAAY,MAAM,QAAQ;GAC9C,OAAO,QAAQ,EAAE,MAAM,IAAI,CAAC;EAChC,GACA,CAAC,aAAa,KAAK,CAKP;EACR,WAAW,eAAe,YAAY,CAAC;EACvC,YACI,eACM,aACA;GACI,aAAa;GACb,gBAAgB;GAChB,GAAG;EACP;EAEV,OAAO;GACH,kBAAkB;GAClB,kBAAkB;GAClB,gBAAgB;GAChB,GAAG;EACP;EACA,WAAW;GACP,GAAG;GAKH,MAAM;IAAE,YAAY;IAAM,GAAG,WAAW;GAAK;GAC7C,eAAe;IACX,WAAW;IACX,IAAI,GAAG,MAAM,iBAAiB,SAAS,EAAE,KAAK,OAAO,EAAE;IACvD,GAAG,WAAW;GAClB;GACA,cAAc;IAAE,SAAS;IAAa,GAAG,WAAW;GAAa;EACrE;EACA,GAAI;CACP,CAAA;AAET,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"appBarOffset.d.ts","sourceRoot":"","sources":["../src/appBarOffset.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AACxC,OAAO,EAAkB,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAE7C,CAAC"}
1
+ {"version":3,"file":"appBarOffset.d.ts","sourceRoot":"","sources":["../src/appBarOffset.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,mBAAmB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAE7C,CAAC"}
@@ -1,10 +1,14 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import { memo } from "react";
3
2
  import Box from "@mui/material/Box";
4
- const AppBarOffset = memo(function AppBarOffset2({ sx, ...props }) {
5
- return /* @__PURE__ */ jsx(Box, { ...props, sx: [({ mixins }) => mixins.toolbar, ...Array.isArray(sx) ? sx : [sx]] });
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/appBarOffset.tsx
5
+ var AppBarOffset = memo(function AppBarOffset({ sx, ...props }) {
6
+ return /* @__PURE__ */ jsx(Box, {
7
+ ...props,
8
+ sx: [({ mixins }) => mixins.toolbar, ...Array.isArray(sx) ? sx : [sx]]
9
+ });
6
10
  });
7
- export {
8
- AppBarOffset
9
- };
10
- //# sourceMappingURL=appBarOffset.js.map
11
+ //#endregion
12
+ export { AppBarOffset };
13
+
14
+ //# sourceMappingURL=appBarOffset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"appBarOffset.js","sources":["../src/appBarOffset.tsx"],"sourcesContent":["import React, { FC, memo } from 'react';\nimport { default as Box, BoxProps } from '@mui/material/Box';\n\nexport type AppBarOffsetProps = BoxProps;\n\nexport const AppBarOffset: FC<AppBarOffsetProps> = memo(function AppBarOffset({ sx, ...props }) {\n return <Box {...props} sx={[({ mixins }) => mixins.toolbar, ...(Array.isArray(sx) ? sx : [sx])]} />;\n});\n"],"names":["AppBarOffset"],"mappings":";;;AAKO,MAAM,eAAsC,KAAK,SAASA,cAAa,EAAE,IAAI,GAAG,SAAS;AAC5F,SAAO,oBAAC,OAAK,GAAG,OAAO,IAAI,CAAC,CAAC,EAAE,aAAa,OAAO,SAAS,GAAI,MAAM,QAAQ,EAAE,IAAI,KAAK,CAAC,EAAE,CAAE,GAAG;AACrG,CAAC;"}
1
+ {"version":3,"file":"appBarOffset.js","names":[],"sources":["../src/appBarOffset.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\n\nimport { type BoxProps, default as Box } from '@mui/material/Box';\n\nexport type AppBarOffsetProps = BoxProps;\n\nexport const AppBarOffset: FC<AppBarOffsetProps> = memo(function AppBarOffset({ sx, ...props }) {\n return <Box {...props} sx={[({ mixins }) => mixins.toolbar, ...(Array.isArray(sx) ? sx : [sx])]} />;\n});\n"],"mappings":";;;;AAMA,IAAa,eAAsC,KAAK,SAAS,aAAa,EAAE,IAAI,GAAG,SAAS;CAC5F,OAAO,oBAAC,KAAD;EAAK,GAAI;EAAO,IAAI,EAAE,EAAE,aAAa,OAAO,SAAS,GAAI,MAAM,QAAQ,EAAE,IAAI,KAAK,CAAC,EAAE,CAAE;CAAI,CAAA;AACtG,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { GenericControlProps } from './genericControl';
2
+ import { GenericControlProps } from './genericControl.js';
3
3
  export type FormControlFieldsetProps = GenericControlProps;
4
4
  export declare const FormControlFieldset: FC<FormControlFieldsetProps>;
5
5
  //# sourceMappingURL=formControlFieldset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formControlFieldset.d.ts","sourceRoot":"","sources":["../src/formControlFieldset.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AACxC,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvE,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE3D,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAmB3D,CAAC"}
1
+ {"version":3,"file":"formControlFieldset.d.ts","sourceRoot":"","sources":["../src/formControlFieldset.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAI7C,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5E,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE3D,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CAmB3D,CAAC"}
@@ -1,29 +1,20 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { memo } from "react";
3
1
  import { GenericControl } from "./genericControl.js";
2
+ import { memo } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
4
  import { inputClasses } from "@mui/material/Input";
5
- const FormControlFieldset = memo(function FormControlFieldset2({
6
- children,
7
- sx,
8
- ...props
9
- }) {
10
- return /* @__PURE__ */ jsx(
11
- GenericControl,
12
- {
13
- ...props,
14
- component: "fieldset",
15
- sx: {
16
- ...sx,
17
- [`legend + .${inputClasses.root}`]: {
18
- marginTop: 2
19
- //FIXME 16px, hardcoded from @mui/material/Input/Input.js @ 59
20
- }
21
- },
22
- children
23
- }
24
- );
5
+ //#region src/formControlFieldset.tsx
6
+ var FormControlFieldset = memo(function FormControlFieldset({ children, sx, ...props }) {
7
+ return /* @__PURE__ */ jsx(GenericControl, {
8
+ ...props,
9
+ component: "fieldset",
10
+ sx: {
11
+ ...sx,
12
+ [`legend + .${inputClasses.root}`]: { marginTop: 2 }
13
+ },
14
+ children
15
+ });
25
16
  });
26
- export {
27
- FormControlFieldset
28
- };
29
- //# sourceMappingURL=formControlFieldset.js.map
17
+ //#endregion
18
+ export { FormControlFieldset };
19
+
20
+ //# sourceMappingURL=formControlFieldset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formControlFieldset.js","sources":["../src/formControlFieldset.tsx"],"sourcesContent":["import React, { FC, memo } from 'react';\nimport { GenericControl, GenericControlProps } from './genericControl';\nimport { inputClasses } from '@mui/material/Input';\n\nexport type FormControlFieldsetProps = GenericControlProps;\n\nexport const FormControlFieldset: FC<FormControlFieldsetProps> = memo(function FormControlFieldset({\n children,\n sx,\n ...props\n}) {\n return (\n <GenericControl\n {...props}\n component=\"fieldset\"\n sx={{\n ...sx,\n [`legend + .${inputClasses.root}`]: {\n marginTop: 2, //FIXME 16px, hardcoded from @mui/material/Input/Input.js @ 59\n },\n }}\n >\n {children}\n </GenericControl>\n );\n});\n"],"names":["FormControlFieldset"],"mappings":";;;;AAMO,MAAM,sBAAoD,KAAK,SAASA,qBAAoB;AAAA,EAC/F;AAAA,EACA;AAAA,EACA,GAAG;AACP,GAAG;AACC,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,WAAU;AAAA,MACV,IAAI;AAAA,QACA,GAAG;AAAA,QACH,CAAC,aAAa,aAAa,IAAI,EAAE,GAAG;AAAA,UAChC,WAAW;AAAA;AAAA,QAAA;AAAA,MACf;AAAA,MAGH;AAAA,IAAA;AAAA,EAAA;AAGb,CAAC;"}
1
+ {"version":3,"file":"formControlFieldset.js","names":[],"sources":["../src/formControlFieldset.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\n\nimport { inputClasses } from '@mui/material/Input';\n\nimport { GenericControl, type GenericControlProps } from './genericControl';\n\nexport type FormControlFieldsetProps = GenericControlProps;\n\nexport const FormControlFieldset: FC<FormControlFieldsetProps> = memo(function FormControlFieldset({\n children,\n sx,\n ...props\n}) {\n return (\n <GenericControl\n {...props}\n component=\"fieldset\"\n sx={{\n ...sx,\n [`legend + .${inputClasses.root}`]: {\n marginTop: 2, //FIXME 16px, hardcoded from @mui/material/Input/Input.js @ 59\n },\n }}\n >\n {children}\n </GenericControl>\n );\n});\n"],"mappings":";;;;;AAQA,IAAa,sBAAoD,KAAK,SAAS,oBAAoB,EAC/F,UACA,IACA,GAAG,SACJ;CACC,OACI,oBAAC,gBAAD;EACI,GAAI;EACJ,WAAU;EACV,IAAI;GACA,GAAG;IACF,aAAa,aAAa,SAAS,EAChC,WAAW,EACf;EACJ;EAEC;CACW,CAAA;AAExB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { GenericControl } from './genericControl';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { GenericControl } from './genericControl.js';
3
3
  declare const meta: Meta<typeof GenericControl>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
@@ -1 +1 @@
1
- {"version":3,"file":"formControlFieldset.stories.d.ts","sourceRoot":"","sources":["../src/formControlFieldset.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CA6CC,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAQnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
1
+ {"version":3,"file":"formControlFieldset.stories.d.ts","sourceRoot":"","sources":["../src/formControlFieldset.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CA6CC,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAQnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"formLabelLegend.d.ts","sourceRoot":"","sources":["../src/formLabelLegend.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AACxC,OAAO,EAAyB,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAElF,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEnD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAOnD,CAAC"}
1
+ {"version":3,"file":"formLabelLegend.d.ts","sourceRoot":"","sources":["../src/formLabelLegend.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEvF,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEnD,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAOnD,CAAC"}
@@ -1,13 +1,16 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import { memo } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  import InputLabel from "@mui/material/InputLabel";
4
- const FormLabelLegend = memo(function FormLabelLegend2({ children, ...props }) {
5
- return (
6
- // sx={(theme) => theme.typography.caption}
7
- /* @__PURE__ */ jsx(InputLabel, { ...props, shrink: true, component: "legend", children })
8
- );
4
+ //#region src/formLabelLegend.tsx
5
+ var FormLabelLegend = memo(function FormLabelLegend({ children, ...props }) {
6
+ return /* @__PURE__ */ jsx(InputLabel, {
7
+ ...props,
8
+ shrink: true,
9
+ component: "legend",
10
+ children
11
+ });
9
12
  });
10
- export {
11
- FormLabelLegend
12
- };
13
- //# sourceMappingURL=formLabelLegend.js.map
13
+ //#endregion
14
+ export { FormLabelLegend };
15
+
16
+ //# sourceMappingURL=formLabelLegend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formLabelLegend.js","sources":["../src/formLabelLegend.tsx"],"sourcesContent":["import React, { FC, memo } from 'react';\nimport { default as InputLabel, InputLabelProps } from '@mui/material/InputLabel';\n\nexport type FormLabelLegendProps = InputLabelProps;\n\nexport const FormLabelLegend: FC<FormLabelLegendProps> = memo(function FormLabelLegend({ children, ...props }) {\n return (\n // sx={(theme) => theme.typography.caption}\n <InputLabel {...props} shrink={true} component={'legend' as any}>\n {children}\n </InputLabel>\n );\n});\n"],"names":["FormLabelLegend"],"mappings":";;;AAKO,MAAM,kBAA4C,KAAK,SAASA,iBAAgB,EAAE,UAAU,GAAG,SAAS;AAC3G;AAAA;AAAA,IAEI,oBAAC,cAAY,GAAG,OAAO,QAAQ,MAAM,WAAW,UAC3C,SAAA,CACL;AAAA;AAER,CAAC;"}
1
+ {"version":3,"file":"formLabelLegend.js","names":[],"sources":["../src/formLabelLegend.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\n\nimport { default as InputLabel, type InputLabelProps } from '@mui/material/InputLabel';\n\nexport type FormLabelLegendProps = InputLabelProps;\n\nexport const FormLabelLegend: FC<FormLabelLegendProps> = memo(function FormLabelLegend({ children, ...props }) {\n return (\n // sx={(theme) => theme.typography.caption}\n <InputLabel {...props} shrink={true} component={'legend' as any}>\n {children}\n </InputLabel>\n );\n});\n"],"mappings":";;;;AAMA,IAAa,kBAA4C,KAAK,SAAS,gBAAgB,EAAE,UAAU,GAAG,SAAS;CAC3G,OAEI,oBAAC,YAAD;EAAY,GAAI;EAAO,QAAQ;EAAM,WAAW;EAC3C;CACO,CAAA;AAEpB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { FormLabelLegend } from './formLabelLegend';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { FormLabelLegend } from './formLabelLegend.js';
3
3
  declare const meta: Meta<typeof FormLabelLegend>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
@@ -1 +1 @@
1
- {"version":3,"file":"formLabelLegend.stories.d.ts","sourceRoot":"","sources":["../src/formLabelLegend.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAatC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAa5B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAqBtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAoB/B,CAAC"}
1
+ {"version":3,"file":"formLabelLegend.stories.d.ts","sourceRoot":"","sources":["../src/formLabelLegend.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAatC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAa5B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAWvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAqBtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAoB/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"genericControl.d.ts","sourceRoot":"","sources":["../src/genericControl.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAA0B,MAAM,2BAA2B,CAAC;AAGrF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC;AAEvE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAejD,CAAC"}
1
+ {"version":3,"file":"genericControl.d.ts","sourceRoot":"","sources":["../src/genericControl.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAE7C,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG1F,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC;AAEvE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAejD,CAAC"}
@@ -1,24 +1,20 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import { memo } from "react";
3
- import FormControl from "@mui/material/FormControl";
2
+ import { jsx } from "react/jsx-runtime";
4
3
  import { inputClasses } from "@mui/material/Input";
5
- const GenericControl = memo(function GenericControl2({ children, sx, ...props }) {
6
- return /* @__PURE__ */ jsx(
7
- FormControl,
8
- {
9
- variant: "standard",
10
- sx: {
11
- ...sx,
12
- [`& .${inputClasses.root}`]: {
13
- "&:before, &:after": { display: "none" }
14
- }
15
- },
16
- ...props,
17
- children
18
- }
19
- );
4
+ import FormControl from "@mui/material/FormControl";
5
+ //#region src/genericControl.tsx
6
+ var GenericControl = memo(function GenericControl({ children, sx, ...props }) {
7
+ return /* @__PURE__ */ jsx(FormControl, {
8
+ variant: "standard",
9
+ sx: {
10
+ ...sx,
11
+ [`& .${inputClasses.root}`]: { "&:before, &:after": { display: "none" } }
12
+ },
13
+ ...props,
14
+ children
15
+ });
20
16
  });
21
- export {
22
- GenericControl
23
- };
24
- //# sourceMappingURL=genericControl.js.map
17
+ //#endregion
18
+ export { GenericControl };
19
+
20
+ //# sourceMappingURL=genericControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"genericControl.js","sources":["../src/genericControl.tsx"],"sourcesContent":["import React, { FC, memo } from 'react';\nimport { FormControlProps, default as FormControl } from '@mui/material/FormControl';\nimport { inputClasses } from '@mui/material/Input';\n\nexport type GenericControlProps = FormControlProps & { children: any };\n\nexport const GenericControl: FC<GenericControlProps> = memo(function GenericControl({ children, sx, ...props }) {\n return (\n <FormControl\n variant=\"standard\"\n sx={{\n ...sx,\n [`& .${inputClasses.root}`]: {\n '&:before, &:after': { display: 'none' },\n },\n }}\n {...props}\n >\n {children}\n </FormControl>\n );\n});\n"],"names":["GenericControl"],"mappings":";;;;AAMO,MAAM,iBAA0C,KAAK,SAASA,gBAAe,EAAE,UAAU,IAAI,GAAG,SAAS;AAC5G,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,SAAQ;AAAA,MACR,IAAI;AAAA,QACA,GAAG;AAAA,QACH,CAAC,MAAM,aAAa,IAAI,EAAE,GAAG;AAAA,UACzB,qBAAqB,EAAE,SAAS,OAAA;AAAA,QAAO;AAAA,MAC3C;AAAA,MAEH,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGb,CAAC;"}
1
+ {"version":3,"file":"genericControl.js","names":[],"sources":["../src/genericControl.tsx"],"sourcesContent":["import React, { type FC, memo } from 'react';\n\nimport { default as FormControl, type FormControlProps } from '@mui/material/FormControl';\nimport { inputClasses } from '@mui/material/Input';\n\nexport type GenericControlProps = FormControlProps & { children: any };\n\nexport const GenericControl: FC<GenericControlProps> = memo(function GenericControl({ children, sx, ...props }) {\n return (\n <FormControl\n variant=\"standard\"\n sx={{\n ...sx,\n [`& .${inputClasses.root}`]: {\n '&:before, &:after': { display: 'none' },\n },\n }}\n {...props}\n >\n {children}\n </FormControl>\n );\n});\n"],"mappings":";;;;;AAOA,IAAa,iBAA0C,KAAK,SAAS,eAAe,EAAE,UAAU,IAAI,GAAG,SAAS;CAC5G,OACI,oBAAC,aAAD;EACI,SAAQ;EACR,IAAI;GACA,GAAG;IACF,MAAM,aAAa,SAAS,EACzB,qBAAqB,EAAE,SAAS,OAAO,EAC3C;EACJ;EACA,GAAI;EAEH;CACQ,CAAA;AAErB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { GenericControl } from './genericControl';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { GenericControl } from './genericControl.js';
3
3
  declare const meta: Meta<typeof GenericControl>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
@@ -1 +1 @@
1
- {"version":3,"file":"genericControl.stories.d.ts","sourceRoot":"","sources":["../src/genericControl.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAarC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAS/B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAiBvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAkBrC,CAAC"}
1
+ {"version":3,"file":"genericControl.stories.d.ts","sourceRoot":"","sources":["../src/genericControl.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAarC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAS/B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAiBvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAkBrC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export * from './appBarOffset';
2
- export * from './formControlFieldset';
3
- export * from './formLabelLegend';
4
- export * from './genericControl';
5
- export * from './readOnly';
1
+ export * from './appBarOffset.js';
2
+ export * from './formControlFieldset.js';
3
+ export * from './formLabelLegend.js';
4
+ export * from './genericControl.js';
5
+ export * from './readOnly.js';
6
+ export * from './admin/index.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,13 +1,10 @@
1
1
  import { AppBarOffset } from "./appBarOffset.js";
2
+ import { GenericControl } from "./genericControl.js";
2
3
  import { FormControlFieldset } from "./formControlFieldset.js";
3
4
  import { FormLabelLegend } from "./formLabelLegend.js";
4
- import { GenericControl } from "./genericControl.js";
5
5
  import { ReadOnly } from "./readOnly.js";
6
- export {
7
- AppBarOffset,
8
- FormControlFieldset,
9
- FormLabelLegend,
10
- GenericControl,
11
- ReadOnly
12
- };
13
- //# sourceMappingURL=index.js.map
6
+ import { AdminAppProvider } from "./admin/appProvider.js";
7
+ import { AdminDashboardLayout } from "./admin/dashboardLayout.js";
8
+ import { AdminSignInPage } from "./admin/signInPage.js";
9
+ import "./admin/index.js";
10
+ export { AdminAppProvider, AdminDashboardLayout, AdminSignInPage, AppBarOffset, FormControlFieldset, FormLabelLegend, GenericControl, ReadOnly };
@@ -1 +1 @@
1
- {"version":3,"file":"readOnly.d.ts","sourceRoot":"","sources":["../src/readOnly.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AACxC,OAAO,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC;AAE3D,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAErC,CAAC"}
1
+ {"version":3,"file":"readOnly.d.ts","sourceRoot":"","sources":["../src/readOnly.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,CAAC;AAE3D,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAErC,CAAC"}