@pelatform/starter.shared 0.1.0 → 0.1.1

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 (3) hide show
  1. package/dist/index.d.ts +138 -6
  2. package/dist/index.js +1305 -666
  3. package/package.json +6 -4
package/dist/index.d.ts CHANGED
@@ -1,10 +1,142 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ComponentProps, ReactNode, PropsWithChildren } from 'react';
3
- import { Avatar, buttonVariants, Dialog, Card, Button, Input } from 'pelatform-ui/default';
4
- import { User, Workspace, ApiKey } from '@pelatform/starter.utils';
5
- import { LucideIcon } from 'lucide-react';
6
- import { LanguageSwitcherProps } from 'pelatform-ui/components';
2
+ import * as react from 'react';
3
+ import { ReactNode, CSSProperties, ComponentProps, PropsWithChildren } from 'react';
4
+ import { MenuItem } from 'pelatform-ui';
5
+ import { NavItem, LanguageSwitcherProps } from 'pelatform-ui/components';
7
6
  export { Logo as LogoDefault } from 'pelatform-ui/components';
7
+ import { Config } from '@pelatform/starter.config';
8
+ import { AuthQueryOptions } from '@pelatform/starter.hook';
9
+ import { AnyAuthClient, User, Workspace, ApiKey } from '@pelatform/starter.utils';
10
+ import { Toaster, Avatar, buttonVariants, Dialog, Card, Button, Input } from 'pelatform-ui/default';
11
+ import { LucideIcon } from 'lucide-react';
12
+
13
+ declare function AuthLayout({ children, logo, disableFooter, signInHint, signInHref, }: {
14
+ children: ReactNode;
15
+ logo?: ReactNode;
16
+ disableFooter?: boolean;
17
+ signInHint?: boolean;
18
+ signInHref?: string;
19
+ }): react_jsx_runtime.JSX.Element;
20
+
21
+ declare function Header({ children }: {
22
+ children: ReactNode;
23
+ }): react_jsx_runtime.JSX.Element;
24
+ declare function HeaderLeft(): react_jsx_runtime.JSX.Element;
25
+ declare function HeaderRight({ sidebar, button }: {
26
+ sidebar?: ReactNode;
27
+ button?: ReactNode;
28
+ }): react_jsx_runtime.JSX.Element;
29
+ declare function HeaderSidebarMobile({ children }: {
30
+ children: ReactNode;
31
+ }): react_jsx_runtime.JSX.Element;
32
+
33
+ declare function LayoutLoader({ children }: {
34
+ children: ReactNode;
35
+ }): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
36
+
37
+ declare function Sidebar({ children }: {
38
+ children: ReactNode;
39
+ }): react_jsx_runtime.JSX.Element | null;
40
+ declare function SidebarHeaderBack({ linkHref, admin, }: {
41
+ linkHref?: string;
42
+ admin?: boolean;
43
+ }): react_jsx_runtime.JSX.Element;
44
+ declare function SidebarContent({ children }: {
45
+ children: ReactNode;
46
+ }): react_jsx_runtime.JSX.Element;
47
+ declare function SidebarContentMenu({ menu, type, }: {
48
+ menu: MenuItem[];
49
+ type?: "default" | "toggle";
50
+ }): react_jsx_runtime.JSX.Element;
51
+
52
+ declare function SiteFooter({ disableProjectBy }: {
53
+ disableProjectBy?: boolean;
54
+ }): react_jsx_runtime.JSX.Element;
55
+
56
+ declare function SiteHeader({ menu, logo, }: {
57
+ menu: NavItem[];
58
+ logo?: ReactNode;
59
+ }): react_jsx_runtime.JSX.Element;
60
+ declare function SiteHeaderSecondary({ menu, logo, loginLink, }: {
61
+ menu: NavItem[];
62
+ logo?: ReactNode;
63
+ loginLink?: string;
64
+ }): react_jsx_runtime.JSX.Element;
65
+
66
+ type ToolbarItem = "darkmode" | "help" | "language" | "onboarding";
67
+ type ToolbarProps = {
68
+ className?: string;
69
+ show?: ReadonlyArray<ToolbarItem>;
70
+ };
71
+ declare function Toolbar(props: ToolbarProps): react_jsx_runtime.JSX.Element;
72
+
73
+ interface LayoutWrapperProps {
74
+ children: ReactNode;
75
+ sidebarHeader: ReactNode;
76
+ sidebarMenu: ReactNode;
77
+ logoHeader?: ReactNode;
78
+ }
79
+ declare function LayoutWrapper({ children, sidebarHeader, sidebarMenu, logoHeader, }: LayoutWrapperProps): react_jsx_runtime.JSX.Element;
80
+
81
+ /**
82
+ * Props for the ConfigProvider component
83
+ */
84
+ type ConfigProviderProps = {
85
+ /** The configuration object to provide to all child components (can be partial, can have extra properties) */
86
+ config: Partial<Config> | Record<string, any>;
87
+ /** AuthClient instance to provide to all child components */
88
+ authClient: AnyAuthClient;
89
+ /** Child components that can access the configuration */
90
+ children: ReactNode;
91
+ } & Partial<AuthQueryOptions>;
92
+ /**
93
+ * Provider component that makes configuration available to all client components
94
+ * This should be wrapped around your application in the root layout
95
+ *
96
+ * @param props - Component props
97
+ * @param props.config - The configuration object to provide (can be partial, will merge with defaults)
98
+ * @param props.authClient - The Better Auth client instance
99
+ * @param props.children - Child components
100
+ *
101
+ * @example
102
+ * ```tsx
103
+ * // app/layout.tsx
104
+ * import { ConfigProvider } from '@pelatform/starter'
105
+ * import { authClient } from '@repo/auth/client'
106
+ * import { config } from '@repo/config'
107
+ *
108
+ * export default function RootLayout({ children }) {
109
+ * return (
110
+ * <html>
111
+ * <body>
112
+ * <ConfigProvider config={config} authClient={authClient}>
113
+ * {children}
114
+ * </ConfigProvider>
115
+ * </body>
116
+ * </html>
117
+ * )
118
+ * }
119
+ * ```
120
+ */
121
+ declare function ConfigProvider({ config, authClient, children, ...props }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
122
+
123
+ interface LayoutProviderProps {
124
+ children: ReactNode;
125
+ style?: CSSProperties;
126
+ bodyClassName?: string;
127
+ className?: string;
128
+ logoHeader?: ReactNode;
129
+ }
130
+ declare function LayoutProvider({ children, style: customStyle, bodyClassName, className, logoHeader, }: LayoutProviderProps): react_jsx_runtime.JSX.Element;
131
+
132
+ interface SharedProvidersProps {
133
+ children: ReactNode;
134
+ locale: string;
135
+ messages: Record<string, string>;
136
+ timeZone?: string;
137
+ sonnerPosition?: ComponentProps<typeof Toaster>["position"];
138
+ }
139
+ declare function SharedProviders({ children, locale, messages, timeZone, sonnerPosition, }: SharedProvidersProps): react_jsx_runtime.JSX.Element;
8
140
 
9
141
  type AvatarClassNames = {
10
142
  base?: string;
@@ -163,4 +295,4 @@ declare function ApiKeyView({ className, classNames, apiKey }: ViewProps & {
163
295
  }): react_jsx_runtime.JSX.Element;
164
296
  declare function WorkspaceView({ className, classNames, isPending, size, workspace }: ViewProps): react_jsx_runtime.JSX.Element;
165
297
 
166
- export { ApiKeyView, type AvatarClassNames, type AvatarProps, CardActionComponent, type CardClassNames, CardComponent, type CardComponentProps, CardFooterComponent, CardHeaderComponent, type DialogClassNames, DialogComponent, type DialogComponentProps, DialogFooterComponent, DisplayIdCard, EmptyState, type EmptyStateProps, LanguageSwitcher, LogoWithHref, LogoWithName, OTPInputGroup, PasswordInput, SignedInHint, SkeletonInputComponent, SkeletonViewComponent, UserAvatar, UserMenu, UserView, type ViewClassNames, type ViewProps, WorkspaceLogo, WorkspaceView };
298
+ export { ApiKeyView, AuthLayout, type AvatarClassNames, type AvatarProps, CardActionComponent, type CardClassNames, CardComponent, type CardComponentProps, CardFooterComponent, CardHeaderComponent, ConfigProvider, type ConfigProviderProps, type DialogClassNames, DialogComponent, type DialogComponentProps, DialogFooterComponent, DisplayIdCard, EmptyState, type EmptyStateProps, Header, HeaderLeft, HeaderRight, HeaderSidebarMobile, LanguageSwitcher, LayoutLoader, LayoutProvider, type LayoutProviderProps, LayoutWrapper, LogoWithHref, LogoWithName, OTPInputGroup, PasswordInput, SharedProviders, type SharedProvidersProps, Sidebar, SidebarContent, SidebarContentMenu, SidebarHeaderBack, SignedInHint, SiteFooter, SiteHeader, SiteHeaderSecondary, SkeletonInputComponent, SkeletonViewComponent, Toolbar, UserAvatar, UserMenu, UserView, type ViewClassNames, type ViewProps, WorkspaceLogo, WorkspaceView };