@pelatform/starter.shared 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,107 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { ComponentType } from 'react';
4
+ export { A as AvatarClassNames, a as AvatarProps, C as CardClassNames, b as CardComponentProps, D as DialogClassNames, c as DialogComponentProps, V as ViewClassNames, d as ViewProps } from './view-B1v2TRLo.js';
5
+ import 'pelatform-ui/default';
6
+ import '@pelatform/starter.utils';
7
+
8
+ declare const socialProviders: readonly [{
9
+ readonly provider: "apple";
10
+ readonly name: "Apple";
11
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
12
+ }, {
13
+ readonly provider: "discord";
14
+ readonly name: "Discord";
15
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
16
+ }, {
17
+ readonly provider: "dropbox";
18
+ readonly name: "Dropbox";
19
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
20
+ }, {
21
+ readonly provider: "facebook";
22
+ readonly name: "Facebook";
23
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
24
+ }, {
25
+ readonly provider: "github";
26
+ readonly name: "GitHub";
27
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
28
+ }, {
29
+ readonly provider: "gitlab";
30
+ readonly name: "GitLab";
31
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
32
+ }, {
33
+ readonly provider: "google";
34
+ readonly name: "Google";
35
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
36
+ }, {
37
+ readonly provider: "huggingface";
38
+ readonly name: "Hugging Face";
39
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
40
+ }, {
41
+ readonly provider: "kick";
42
+ readonly name: "Kick";
43
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
44
+ }, {
45
+ readonly provider: "linear";
46
+ readonly name: "Linear";
47
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
48
+ }, {
49
+ readonly provider: "linkedin";
50
+ readonly name: "LinkedIn";
51
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
52
+ }, {
53
+ readonly provider: "microsoft";
54
+ readonly name: "Microsoft";
55
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
56
+ }, {
57
+ readonly provider: "notion";
58
+ readonly name: "Notion";
59
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
60
+ }, {
61
+ readonly provider: "reddit";
62
+ readonly name: "Reddit";
63
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
64
+ }, {
65
+ readonly provider: "roblox";
66
+ readonly name: "Roblox";
67
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
68
+ }, {
69
+ readonly provider: "slack";
70
+ readonly name: "Slack";
71
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
72
+ }, {
73
+ readonly provider: "spotify";
74
+ readonly name: "Spotify";
75
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
76
+ }, {
77
+ readonly provider: "tiktok";
78
+ readonly name: "TikTok";
79
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
80
+ }, {
81
+ readonly provider: "twitch";
82
+ readonly name: "Twitch";
83
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
84
+ }, {
85
+ readonly provider: "vk";
86
+ readonly name: "VK";
87
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
88
+ }, {
89
+ readonly provider: "twitter";
90
+ readonly name: "X";
91
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
92
+ }, {
93
+ readonly provider: "zoom";
94
+ readonly name: "Zoom";
95
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
96
+ }];
97
+
98
+ type ProviderIcon = ComponentType<{
99
+ className?: string;
100
+ }>;
101
+ type Provider = {
102
+ provider: string;
103
+ name: string;
104
+ icon?: ProviderIcon;
105
+ };
106
+
107
+ export { type Provider, type ProviderIcon, socialProviders };
package/dist/extend.js ADDED
@@ -0,0 +1,117 @@
1
+ // src/lib/social-providers.ts
2
+ import { Icons } from "pelatform-ui";
3
+ var socialProviders = [
4
+ {
5
+ provider: "apple",
6
+ name: "Apple",
7
+ icon: Icons.Apple
8
+ },
9
+ {
10
+ provider: "discord",
11
+ name: "Discord",
12
+ icon: Icons.Discord
13
+ },
14
+ {
15
+ provider: "dropbox",
16
+ name: "Dropbox",
17
+ icon: Icons.Dropbox
18
+ },
19
+ {
20
+ provider: "facebook",
21
+ name: "Facebook",
22
+ icon: Icons.FacebookColorful
23
+ },
24
+ {
25
+ provider: "github",
26
+ name: "GitHub",
27
+ icon: Icons.Github
28
+ },
29
+ {
30
+ provider: "gitlab",
31
+ name: "GitLab",
32
+ icon: Icons.Gitlab
33
+ },
34
+ {
35
+ provider: "google",
36
+ name: "Google",
37
+ icon: Icons.GoogleColorful
38
+ },
39
+ {
40
+ provider: "huggingface",
41
+ name: "Hugging Face",
42
+ icon: Icons.Huggingface
43
+ },
44
+ {
45
+ provider: "kick",
46
+ name: "Kick",
47
+ icon: Icons.Kick
48
+ },
49
+ {
50
+ provider: "linear",
51
+ name: "Linear",
52
+ icon: Icons.Linear
53
+ },
54
+ {
55
+ provider: "linkedin",
56
+ name: "LinkedIn",
57
+ icon: Icons.LinkedinColorful
58
+ },
59
+ {
60
+ provider: "microsoft",
61
+ name: "Microsoft",
62
+ icon: Icons.Microsoft
63
+ },
64
+ {
65
+ provider: "notion",
66
+ name: "Notion",
67
+ icon: Icons.Notion
68
+ },
69
+ {
70
+ provider: "reddit",
71
+ name: "Reddit",
72
+ icon: Icons.Reddit
73
+ },
74
+ {
75
+ provider: "roblox",
76
+ name: "Roblox",
77
+ icon: Icons.Roblox
78
+ },
79
+ {
80
+ provider: "slack",
81
+ name: "Slack",
82
+ icon: Icons.Slack
83
+ },
84
+ {
85
+ provider: "spotify",
86
+ name: "Spotify",
87
+ icon: Icons.Spotify
88
+ },
89
+ {
90
+ provider: "tiktok",
91
+ name: "TikTok",
92
+ icon: Icons.Tiktok
93
+ },
94
+ {
95
+ provider: "twitch",
96
+ name: "Twitch",
97
+ icon: Icons.Twitch
98
+ },
99
+ {
100
+ provider: "vk",
101
+ name: "VK",
102
+ icon: Icons.Vk
103
+ },
104
+ {
105
+ provider: "twitter",
106
+ name: "X",
107
+ icon: Icons.X
108
+ },
109
+ {
110
+ provider: "zoom",
111
+ name: "Zoom",
112
+ icon: Icons.Zoom
113
+ }
114
+ ];
115
+ export {
116
+ socialProviders
117
+ };
package/dist/index.d.ts CHANGED
@@ -1,83 +1,143 @@
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, ApiKey } from '@pelatform/starter.utils';
10
+ import { Toaster, Button, Input } from 'pelatform-ui/default';
11
+ import { b as CardComponentProps, c as DialogComponentProps, C as CardClassNames, a as AvatarProps, d as ViewProps } from './view-B1v2TRLo.js';
12
+ import { LucideIcon } from 'lucide-react';
8
13
 
9
- type AvatarClassNames = {
10
- base?: string;
11
- fallback?: string;
12
- fallbackIcon?: string;
13
- image?: string;
14
- skeleton?: string;
15
- };
16
- interface AvatarProps extends ComponentProps<typeof Avatar> {
17
- className?: string;
18
- classNames?: AvatarClassNames;
19
- image?: string;
20
- isPending?: boolean;
21
- size?: NonNullable<Parameters<typeof buttonVariants>[0]>["size"] | null | undefined;
22
- user?: Partial<User> | null;
23
- workspace?: Partial<Workspace> | null;
24
- }
25
-
26
- type DialogClassNames = {
27
- content?: string;
28
- header?: string;
29
- footer?: string;
30
- };
31
- interface DialogComponentProps extends ComponentProps<typeof Dialog> {
32
- className?: string;
33
- children?: ReactNode;
34
- classNames?: CardClassNames;
35
- title?: string;
36
- description?: string;
14
+ declare function AuthLayout({ children, logo, disableFooter, signInHint, signInHref, }: {
15
+ children: ReactNode;
16
+ logo?: ReactNode;
37
17
  disableFooter?: boolean;
38
- cancelButton?: boolean;
39
- cancelButtonDisabled?: boolean;
18
+ signInHint?: boolean;
19
+ signInHref?: string;
20
+ }): react_jsx_runtime.JSX.Element;
21
+
22
+ declare function Header({ children }: {
23
+ children: ReactNode;
24
+ }): react_jsx_runtime.JSX.Element;
25
+ declare function HeaderLeft(): react_jsx_runtime.JSX.Element;
26
+ declare function HeaderRight({ sidebar, button }: {
27
+ sidebar?: ReactNode;
40
28
  button?: ReactNode;
41
- }
29
+ }): react_jsx_runtime.JSX.Element;
30
+ declare function HeaderSidebarMobile({ children }: {
31
+ children: ReactNode;
32
+ }): react_jsx_runtime.JSX.Element;
33
+
34
+ declare function LayoutLoader({ children }: {
35
+ children: ReactNode;
36
+ }): 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;
37
+
38
+ declare function Sidebar({ children }: {
39
+ children: ReactNode;
40
+ }): react_jsx_runtime.JSX.Element | null;
41
+ declare function SidebarHeaderBack({ linkHref, admin, }: {
42
+ linkHref?: string;
43
+ admin?: boolean;
44
+ }): react_jsx_runtime.JSX.Element;
45
+ declare function SidebarContent({ children }: {
46
+ children: ReactNode;
47
+ }): react_jsx_runtime.JSX.Element;
48
+ declare function SidebarContentMenu({ menu, type, }: {
49
+ menu: MenuItem[];
50
+ type?: "default" | "toggle";
51
+ }): react_jsx_runtime.JSX.Element;
52
+
53
+ declare function SiteFooter({ disableProjectBy }: {
54
+ disableProjectBy?: boolean;
55
+ }): react_jsx_runtime.JSX.Element;
42
56
 
43
- type CardClassNames = {
44
- base?: string;
45
- cell?: string;
46
- content?: string;
47
- header?: string;
48
- footer?: string;
49
- grid?: string;
50
- skeleton?: string;
51
- title?: string;
52
- description?: string;
53
- instructions?: string;
54
- error?: string;
55
- label?: string;
56
- input?: string;
57
- checkbox?: string;
58
- icon?: string;
59
- button?: string;
60
- primaryButton?: string;
61
- secondaryButton?: string;
62
- outlineButton?: string;
63
- destructiveButton?: string;
64
- avatar?: AvatarClassNames;
65
- dialog?: DialogClassNames;
57
+ declare function SiteHeader({ menu, logo, }: {
58
+ menu: NavItem[];
59
+ logo?: ReactNode;
60
+ }): react_jsx_runtime.JSX.Element;
61
+ declare function SiteHeaderSecondary({ menu, logo, loginLink, }: {
62
+ menu: NavItem[];
63
+ logo?: ReactNode;
64
+ loginLink?: string;
65
+ }): react_jsx_runtime.JSX.Element;
66
+
67
+ type ToolbarItem = "darkmode" | "help" | "language" | "onboarding";
68
+ type ToolbarProps = {
69
+ className?: string;
70
+ show?: ReadonlyArray<ToolbarItem>;
66
71
  };
67
- interface CardComponentProps extends Omit<ComponentProps<typeof Card>, "title" | "variant"> {
72
+ declare function Toolbar(props: ToolbarProps): react_jsx_runtime.JSX.Element;
73
+
74
+ interface LayoutWrapperProps {
75
+ children: ReactNode;
76
+ sidebarHeader: ReactNode;
77
+ sidebarMenu: ReactNode;
78
+ logoHeader?: ReactNode;
79
+ }
80
+ declare function LayoutWrapper({ children, sidebarHeader, sidebarMenu, logoHeader, }: LayoutWrapperProps): react_jsx_runtime.JSX.Element;
81
+
82
+ /**
83
+ * Props for the ConfigProvider component
84
+ */
85
+ type ConfigProviderProps = {
86
+ /** The configuration object to provide to all child components (can be partial, can have extra properties) */
87
+ config: Partial<Config> | Record<string, any>;
88
+ /** AuthClient instance to provide to all child components */
89
+ authClient: AnyAuthClient;
90
+ /** Child components that can access the configuration */
91
+ children: ReactNode;
92
+ } & Partial<AuthQueryOptions>;
93
+ /**
94
+ * Provider component that makes configuration available to all client components
95
+ * This should be wrapped around your application in the root layout
96
+ *
97
+ * @param props - Component props
98
+ * @param props.config - The configuration object to provide (can be partial, will merge with defaults)
99
+ * @param props.authClient - The Better Auth client instance
100
+ * @param props.children - Child components
101
+ *
102
+ * @example
103
+ * ```tsx
104
+ * // app/layout.tsx
105
+ * import { ConfigProvider } from '@pelatform/starter'
106
+ * import { authClient } from '@repo/auth/client'
107
+ * import { config } from '@repo/config'
108
+ *
109
+ * export default function RootLayout({ children }) {
110
+ * return (
111
+ * <html>
112
+ * <body>
113
+ * <ConfigProvider config={config} authClient={authClient}>
114
+ * {children}
115
+ * </ConfigProvider>
116
+ * </body>
117
+ * </html>
118
+ * )
119
+ * }
120
+ * ```
121
+ */
122
+ declare function ConfigProvider({ config, authClient, children, ...props }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
123
+
124
+ interface LayoutProviderProps {
125
+ children: ReactNode;
126
+ style?: CSSProperties;
127
+ bodyClassName?: string;
68
128
  className?: string;
69
- children?: ReactNode;
70
- classNames?: CardClassNames;
71
- title?: ReactNode;
72
- description?: ReactNode;
73
- instructions?: ReactNode;
74
- actionLabel?: ReactNode;
75
- action?: () => Promise<unknown> | unknown;
76
- disabled?: boolean;
77
- isDestructive?: boolean;
78
- isPending?: boolean;
79
- isSubmitting?: boolean;
129
+ logoHeader?: ReactNode;
130
+ }
131
+ declare function LayoutProvider({ children, style: customStyle, bodyClassName, className, logoHeader, }: LayoutProviderProps): react_jsx_runtime.JSX.Element;
132
+
133
+ interface SharedProvidersProps {
134
+ children: ReactNode;
135
+ locale: string;
136
+ messages: Record<string, string>;
137
+ timeZone?: string;
138
+ sonnerPosition?: ComponentProps<typeof Toaster>["position"];
80
139
  }
140
+ declare function SharedProviders({ children, locale, messages, timeZone, sonnerPosition, }: SharedProvidersProps): react_jsx_runtime.JSX.Element;
81
141
 
82
142
  declare function CardComponent({ children, className, classNames, title, description, instructions, actionLabel, action, disabled, isDestructive, isPending, isSubmitting, ...props }: CardComponentProps): react_jsx_runtime.JSX.Element;
83
143
  declare function CardHeaderComponent({ className, classNames, title, description, isPending, }: CardComponentProps): react_jsx_runtime.JSX.Element;
@@ -139,28 +199,10 @@ declare function UserMenu({ hiddenSwitcher }: {
139
199
  hiddenSwitcher?: boolean;
140
200
  }): react_jsx_runtime.JSX.Element;
141
201
 
142
- type ViewClassNames = {
143
- base?: string;
144
- content?: string;
145
- title?: string;
146
- subtitle?: string;
147
- skeleton?: string;
148
- icon?: string;
149
- avatar?: AvatarClassNames;
150
- };
151
- interface ViewProps {
152
- className?: string;
153
- classNames?: ViewClassNames;
154
- isPending?: boolean;
155
- size?: NonNullable<Parameters<typeof buttonVariants>[0]>["size"] | null | undefined;
156
- user?: Partial<User> | null;
157
- workspace?: Partial<Workspace> | null;
158
- }
159
-
160
202
  declare function UserView({ className, classNames, isPending, size, user }: ViewProps): react_jsx_runtime.JSX.Element;
161
203
  declare function ApiKeyView({ className, classNames, apiKey }: ViewProps & {
162
204
  apiKey: ApiKey;
163
205
  }): react_jsx_runtime.JSX.Element;
164
206
  declare function WorkspaceView({ className, classNames, isPending, size, workspace }: ViewProps): react_jsx_runtime.JSX.Element;
165
207
 
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 };
208
+ export { ApiKeyView, AuthLayout, CardActionComponent, CardComponent, CardFooterComponent, CardHeaderComponent, ConfigProvider, type ConfigProviderProps, DialogComponent, 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, WorkspaceLogo, WorkspaceView };