@pelatform/starter.shared 0.1.1 → 0.2.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.
@@ -0,0 +1,137 @@
1
+ import { Metadata } from 'next';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as react from 'react';
4
+ import { ComponentType } from 'react';
5
+ 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';
6
+ import 'pelatform-ui/default';
7
+ import '@pelatform/starter.utils';
8
+
9
+ declare function mapLocale(locale?: string): string | undefined;
10
+
11
+ type metadataProps = {
12
+ baseUrl?: string;
13
+ title?: string;
14
+ fullTitle?: string;
15
+ description?: string;
16
+ icons?: Metadata["icons"];
17
+ url?: string;
18
+ image?: string | null;
19
+ video?: string | null;
20
+ openGraph?: {
21
+ type?: "website" | "article" | "book" | "profile" | "music.song" | "music.album" | "music.playlist" | "music.radio_station" | "video.movie" | "video.episode" | "video.tv_show" | "video.other";
22
+ locale?: string;
23
+ name?: string;
24
+ };
25
+ twitter?: {
26
+ site?: string;
27
+ creator?: string;
28
+ };
29
+ canonicalUrl?: string;
30
+ alternateLanguages?: Record<string, string>;
31
+ noIndex?: boolean;
32
+ noArchive?: boolean;
33
+ noSnippet?: boolean;
34
+ manifest?: string | URL | null;
35
+ };
36
+ declare function constructMetadata({ baseUrl, title, fullTitle, description, icons, image, video, url, openGraph, twitter, canonicalUrl, alternateLanguages, noIndex, noArchive, noSnippet, manifest, }: metadataProps): Metadata;
37
+
38
+ declare const socialProviders: readonly [{
39
+ readonly provider: "apple";
40
+ readonly name: "Apple";
41
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
42
+ }, {
43
+ readonly provider: "discord";
44
+ readonly name: "Discord";
45
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
46
+ }, {
47
+ readonly provider: "dropbox";
48
+ readonly name: "Dropbox";
49
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
50
+ }, {
51
+ readonly provider: "facebook";
52
+ readonly name: "Facebook";
53
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
54
+ }, {
55
+ readonly provider: "github";
56
+ readonly name: "GitHub";
57
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
58
+ }, {
59
+ readonly provider: "gitlab";
60
+ readonly name: "GitLab";
61
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
62
+ }, {
63
+ readonly provider: "google";
64
+ readonly name: "Google";
65
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
66
+ }, {
67
+ readonly provider: "huggingface";
68
+ readonly name: "Hugging Face";
69
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
70
+ }, {
71
+ readonly provider: "kick";
72
+ readonly name: "Kick";
73
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
74
+ }, {
75
+ readonly provider: "linear";
76
+ readonly name: "Linear";
77
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
78
+ }, {
79
+ readonly provider: "linkedin";
80
+ readonly name: "LinkedIn";
81
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
82
+ }, {
83
+ readonly provider: "microsoft";
84
+ readonly name: "Microsoft";
85
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
86
+ }, {
87
+ readonly provider: "notion";
88
+ readonly name: "Notion";
89
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
90
+ }, {
91
+ readonly provider: "reddit";
92
+ readonly name: "Reddit";
93
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
94
+ }, {
95
+ readonly provider: "roblox";
96
+ readonly name: "Roblox";
97
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
98
+ }, {
99
+ readonly provider: "slack";
100
+ readonly name: "Slack";
101
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
102
+ }, {
103
+ readonly provider: "spotify";
104
+ readonly name: "Spotify";
105
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
106
+ }, {
107
+ readonly provider: "tiktok";
108
+ readonly name: "TikTok";
109
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
110
+ }, {
111
+ readonly provider: "twitch";
112
+ readonly name: "Twitch";
113
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
114
+ }, {
115
+ readonly provider: "vk";
116
+ readonly name: "VK";
117
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
118
+ }, {
119
+ readonly provider: "twitter";
120
+ readonly name: "X";
121
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
122
+ }, {
123
+ readonly provider: "zoom";
124
+ readonly name: "Zoom";
125
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
126
+ }];
127
+
128
+ type ProviderIcon = ComponentType<{
129
+ className?: string;
130
+ }>;
131
+ type Provider = {
132
+ provider: string;
133
+ name: string;
134
+ icon?: ProviderIcon;
135
+ };
136
+
137
+ export { type Provider, type ProviderIcon, constructMetadata, mapLocale, type metadataProps, socialProviders };
package/dist/extend.js ADDED
@@ -0,0 +1,318 @@
1
+ // src/lib/locale.ts
2
+ function mapLocale(locale) {
3
+ if (!locale) return "en_US";
4
+ const mapping = {
5
+ af: "af_ZA",
6
+ // Afrikaans - South Africa
7
+ am: "am_ET",
8
+ // Amharic - Ethiopia
9
+ ar: "ar_AR",
10
+ // Arabic - Saudi Arabia
11
+ bn: "bn_BD",
12
+ // Bengali - Bangladesh
13
+ bg: "bg_BG",
14
+ // Bulgarian - Bulgaria
15
+ cs: "cs_CZ",
16
+ // Czech - Czech Republic
17
+ da: "da_DK",
18
+ // Danish - Denmark
19
+ de: "de_DE",
20
+ // German - Germany
21
+ el: "el_GR",
22
+ // Greek - Greece
23
+ en: "en_US",
24
+ // English - United States
25
+ en_uk: "en_GB",
26
+ // English - United Kingdom
27
+ es: "es_ES",
28
+ // Spanish - Spain
29
+ es_mx: "es_MX",
30
+ // Spanish - Mexico
31
+ fa: "fa_IR",
32
+ // Persian/Farsi - Iran
33
+ fi: "fi_FI",
34
+ // Finnish - Finland
35
+ fr: "fr_FR",
36
+ // French - France
37
+ fr_ca: "fr_CA",
38
+ // French - Canada
39
+ he: "he_IL",
40
+ // Hebrew - Israel
41
+ hi: "hi_IN",
42
+ // Hindi - India
43
+ hr: "hr_HR",
44
+ // Croatian - Croatia
45
+ hu: "hu_HU",
46
+ // Hungarian - Hungary
47
+ id: "id_ID",
48
+ // Indonesian - Indonesia
49
+ it: "it_IT",
50
+ // Italian - Italy
51
+ ja: "ja_JP",
52
+ // Japanese - Japan
53
+ ko: "ko_KR",
54
+ // Korean - South Korea
55
+ ms: "ms_MY",
56
+ // Malay - Malaysia
57
+ nl: "nl_NL",
58
+ // Dutch - Netherlands
59
+ no: "nb_NO",
60
+ // Norwegian Bokmål - Norway
61
+ pl: "pl_PL",
62
+ // Polish - Poland
63
+ pt: "pt_PT",
64
+ // Portuguese - Portugal
65
+ pt_br: "pt_BR",
66
+ // Portuguese - Brazil
67
+ ro: "ro_RO",
68
+ // Romanian - Romania
69
+ ru: "ru_RU",
70
+ // Russian - Russia
71
+ sk: "sk_SK",
72
+ // Slovak - Slovakia
73
+ sr: "sr_RS",
74
+ // Serbian - Serbia
75
+ sv: "sv_SE",
76
+ // Swedish - Sweden
77
+ sw: "sw_KE",
78
+ // Swahili - Kenya
79
+ th: "th_TH",
80
+ // Thai - Thailand
81
+ tl: "tl_PH",
82
+ // Filipino/Tagalog - Philippines
83
+ tr: "tr_TR",
84
+ // Turkish - Türkiye
85
+ uk: "uk_UA",
86
+ // Ukrainian - Ukraine
87
+ ur: "ur_PK",
88
+ // Urdu - Pakistan
89
+ vi: "vi_VN",
90
+ // Vietnamese - Vietnam
91
+ zh: "zh_CN",
92
+ // Chinese (Simplified) - China
93
+ zh_hk: "zh_HK",
94
+ // Chinese (Traditional) - Hong Kong
95
+ zh_tw: "zh_TW"
96
+ // Chinese (Traditional) - Taiwan
97
+ };
98
+ return mapping[locale] || locale;
99
+ }
100
+
101
+ // src/lib/metadata.ts
102
+ import { getAssetsUrl } from "pelatform-ui";
103
+ function constructMetadata({
104
+ baseUrl,
105
+ title,
106
+ fullTitle,
107
+ description,
108
+ icons = [
109
+ {
110
+ rel: "apple-touch-icon",
111
+ sizes: "32x32",
112
+ url: getAssetsUrl("favicon/apple-touch-icon.png")
113
+ },
114
+ {
115
+ rel: "icon",
116
+ type: "image/png",
117
+ sizes: "32x32",
118
+ url: getAssetsUrl("favicon/favicon-32x32.png")
119
+ },
120
+ {
121
+ rel: "icon",
122
+ type: "image/png",
123
+ sizes: "16x16",
124
+ url: getAssetsUrl("favicon/favicon-16x16.png")
125
+ }
126
+ ],
127
+ image,
128
+ video,
129
+ url,
130
+ openGraph = {
131
+ type: "website",
132
+ locale: "en_US"
133
+ },
134
+ twitter = {},
135
+ canonicalUrl,
136
+ alternateLanguages,
137
+ noIndex = false,
138
+ noArchive = false,
139
+ noSnippet = false,
140
+ manifest
141
+ }) {
142
+ return {
143
+ metadataBase: baseUrl ? new URL(baseUrl) : void 0,
144
+ title: fullTitle || title,
145
+ description,
146
+ icons,
147
+ openGraph: {
148
+ title,
149
+ description,
150
+ type: openGraph.type ?? "website",
151
+ locale: mapLocale(openGraph.locale),
152
+ ...openGraph.name && {
153
+ siteName: openGraph.name
154
+ },
155
+ url,
156
+ ...image && {
157
+ images: image
158
+ },
159
+ ...video && {
160
+ videos: video
161
+ }
162
+ },
163
+ twitter: {
164
+ title,
165
+ description,
166
+ ...image && {
167
+ card: "summary_large_image",
168
+ images: [image]
169
+ },
170
+ ...video && {
171
+ player: video
172
+ },
173
+ ...twitter.site && {
174
+ site: twitter.site
175
+ },
176
+ ...twitter.creator && {
177
+ creator: twitter.creator
178
+ }
179
+ },
180
+ ...(url || canonicalUrl || alternateLanguages) && {
181
+ alternates: {
182
+ ...url || canonicalUrl ? { canonical: url || canonicalUrl } : {},
183
+ ...alternateLanguages ? { languages: alternateLanguages } : {}
184
+ }
185
+ },
186
+ ...(noIndex || noArchive || noSnippet) && {
187
+ robots: {
188
+ ...noIndex ? { index: false, follow: false } : {},
189
+ ...noArchive ? { noarchive: true } : {},
190
+ ...noSnippet ? { nosnippet: true } : {}
191
+ }
192
+ },
193
+ ...manifest && {
194
+ manifest
195
+ },
196
+ creator: "lukmanaviccena"
197
+ };
198
+ }
199
+
200
+ // src/lib/social-providers.ts
201
+ import { Icons } from "pelatform-ui";
202
+ var socialProviders = [
203
+ {
204
+ provider: "apple",
205
+ name: "Apple",
206
+ icon: Icons.Apple
207
+ },
208
+ {
209
+ provider: "discord",
210
+ name: "Discord",
211
+ icon: Icons.Discord
212
+ },
213
+ {
214
+ provider: "dropbox",
215
+ name: "Dropbox",
216
+ icon: Icons.Dropbox
217
+ },
218
+ {
219
+ provider: "facebook",
220
+ name: "Facebook",
221
+ icon: Icons.FacebookColorful
222
+ },
223
+ {
224
+ provider: "github",
225
+ name: "GitHub",
226
+ icon: Icons.Github
227
+ },
228
+ {
229
+ provider: "gitlab",
230
+ name: "GitLab",
231
+ icon: Icons.Gitlab
232
+ },
233
+ {
234
+ provider: "google",
235
+ name: "Google",
236
+ icon: Icons.GoogleColorful
237
+ },
238
+ {
239
+ provider: "huggingface",
240
+ name: "Hugging Face",
241
+ icon: Icons.Huggingface
242
+ },
243
+ {
244
+ provider: "kick",
245
+ name: "Kick",
246
+ icon: Icons.Kick
247
+ },
248
+ {
249
+ provider: "linear",
250
+ name: "Linear",
251
+ icon: Icons.Linear
252
+ },
253
+ {
254
+ provider: "linkedin",
255
+ name: "LinkedIn",
256
+ icon: Icons.LinkedinColorful
257
+ },
258
+ {
259
+ provider: "microsoft",
260
+ name: "Microsoft",
261
+ icon: Icons.Microsoft
262
+ },
263
+ {
264
+ provider: "notion",
265
+ name: "Notion",
266
+ icon: Icons.Notion
267
+ },
268
+ {
269
+ provider: "reddit",
270
+ name: "Reddit",
271
+ icon: Icons.Reddit
272
+ },
273
+ {
274
+ provider: "roblox",
275
+ name: "Roblox",
276
+ icon: Icons.Roblox
277
+ },
278
+ {
279
+ provider: "slack",
280
+ name: "Slack",
281
+ icon: Icons.Slack
282
+ },
283
+ {
284
+ provider: "spotify",
285
+ name: "Spotify",
286
+ icon: Icons.Spotify
287
+ },
288
+ {
289
+ provider: "tiktok",
290
+ name: "TikTok",
291
+ icon: Icons.Tiktok
292
+ },
293
+ {
294
+ provider: "twitch",
295
+ name: "Twitch",
296
+ icon: Icons.Twitch
297
+ },
298
+ {
299
+ provider: "vk",
300
+ name: "VK",
301
+ icon: Icons.Vk
302
+ },
303
+ {
304
+ provider: "twitter",
305
+ name: "X",
306
+ icon: Icons.X
307
+ },
308
+ {
309
+ provider: "zoom",
310
+ name: "Zoom",
311
+ icon: Icons.Zoom
312
+ }
313
+ ];
314
+ export {
315
+ constructMetadata,
316
+ mapLocale,
317
+ socialProviders
318
+ };
package/dist/index.d.ts CHANGED
@@ -6,8 +6,9 @@ import { NavItem, LanguageSwitcherProps } from 'pelatform-ui/components';
6
6
  export { Logo as LogoDefault } from 'pelatform-ui/components';
7
7
  import { Config } from '@pelatform/starter.config';
8
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';
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';
11
12
  import { LucideIcon } from 'lucide-react';
12
13
 
13
14
  declare function AuthLayout({ children, logo, disableFooter, signInHint, signInHref, }: {
@@ -138,79 +139,6 @@ interface SharedProvidersProps {
138
139
  }
139
140
  declare function SharedProviders({ children, locale, messages, timeZone, sonnerPosition, }: SharedProvidersProps): react_jsx_runtime.JSX.Element;
140
141
 
141
- type AvatarClassNames = {
142
- base?: string;
143
- fallback?: string;
144
- fallbackIcon?: string;
145
- image?: string;
146
- skeleton?: string;
147
- };
148
- interface AvatarProps extends ComponentProps<typeof Avatar> {
149
- className?: string;
150
- classNames?: AvatarClassNames;
151
- image?: string;
152
- isPending?: boolean;
153
- size?: NonNullable<Parameters<typeof buttonVariants>[0]>["size"] | null | undefined;
154
- user?: Partial<User> | null;
155
- workspace?: Partial<Workspace> | null;
156
- }
157
-
158
- type DialogClassNames = {
159
- content?: string;
160
- header?: string;
161
- footer?: string;
162
- };
163
- interface DialogComponentProps extends ComponentProps<typeof Dialog> {
164
- className?: string;
165
- children?: ReactNode;
166
- classNames?: CardClassNames;
167
- title?: string;
168
- description?: string;
169
- disableFooter?: boolean;
170
- cancelButton?: boolean;
171
- cancelButtonDisabled?: boolean;
172
- button?: ReactNode;
173
- }
174
-
175
- type CardClassNames = {
176
- base?: string;
177
- cell?: string;
178
- content?: string;
179
- header?: string;
180
- footer?: string;
181
- grid?: string;
182
- skeleton?: string;
183
- title?: string;
184
- description?: string;
185
- instructions?: string;
186
- error?: string;
187
- label?: string;
188
- input?: string;
189
- checkbox?: string;
190
- icon?: string;
191
- button?: string;
192
- primaryButton?: string;
193
- secondaryButton?: string;
194
- outlineButton?: string;
195
- destructiveButton?: string;
196
- avatar?: AvatarClassNames;
197
- dialog?: DialogClassNames;
198
- };
199
- interface CardComponentProps extends Omit<ComponentProps<typeof Card>, "title" | "variant"> {
200
- className?: string;
201
- children?: ReactNode;
202
- classNames?: CardClassNames;
203
- title?: ReactNode;
204
- description?: ReactNode;
205
- instructions?: ReactNode;
206
- actionLabel?: ReactNode;
207
- action?: () => Promise<unknown> | unknown;
208
- disabled?: boolean;
209
- isDestructive?: boolean;
210
- isPending?: boolean;
211
- isSubmitting?: boolean;
212
- }
213
-
214
142
  declare function CardComponent({ children, className, classNames, title, description, instructions, actionLabel, action, disabled, isDestructive, isPending, isSubmitting, ...props }: CardComponentProps): react_jsx_runtime.JSX.Element;
215
143
  declare function CardHeaderComponent({ className, classNames, title, description, isPending, }: CardComponentProps): react_jsx_runtime.JSX.Element;
216
144
  declare function CardFooterComponent({ className, classNames, instructions, actionLabel, action, disabled, isDestructive, isPending, isSubmitting, }: CardComponentProps): react_jsx_runtime.JSX.Element;
@@ -271,28 +199,10 @@ declare function UserMenu({ hiddenSwitcher }: {
271
199
  hiddenSwitcher?: boolean;
272
200
  }): react_jsx_runtime.JSX.Element;
273
201
 
274
- type ViewClassNames = {
275
- base?: string;
276
- content?: string;
277
- title?: string;
278
- subtitle?: string;
279
- skeleton?: string;
280
- icon?: string;
281
- avatar?: AvatarClassNames;
282
- };
283
- interface ViewProps {
284
- className?: string;
285
- classNames?: ViewClassNames;
286
- isPending?: boolean;
287
- size?: NonNullable<Parameters<typeof buttonVariants>[0]>["size"] | null | undefined;
288
- user?: Partial<User> | null;
289
- workspace?: Partial<Workspace> | null;
290
- }
291
-
292
202
  declare function UserView({ className, classNames, isPending, size, user }: ViewProps): react_jsx_runtime.JSX.Element;
293
203
  declare function ApiKeyView({ className, classNames, apiKey }: ViewProps & {
294
204
  apiKey: ApiKey;
295
205
  }): react_jsx_runtime.JSX.Element;
296
206
  declare function WorkspaceView({ className, classNames, isPending, size, workspace }: ViewProps): react_jsx_runtime.JSX.Element;
297
207
 
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 };
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 };
package/dist/index.js CHANGED
@@ -594,19 +594,24 @@ function UserMenu({ hiddenSwitcher = false }) {
594
594
  /* @__PURE__ */ jsx9(DropdownMenuItem, { disabled: true, children: /* @__PURE__ */ jsx9(UserView, { isPending: true }) }),
595
595
  /* @__PURE__ */ jsx9(DropdownMenuSeparator, {})
596
596
  ] }),
597
- deviceSessions?.filter((sessionData) => sessionData.user.id !== user?.id).map(({ session, user: multiUser }) => /* @__PURE__ */ jsxs7(Fragment2, { children: [
598
- /* @__PURE__ */ jsxs7(DropdownMenuItem, { onClick: () => switchAccount(session.token), children: [
599
- /* @__PURE__ */ jsx9(UserAvatar2, { src: multiUser?.image || void 0, alt: getUserName3(multiUser) }),
600
- /* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 flex-1 flex-col items-start", children: [
601
- /* @__PURE__ */ jsx9("span", { className: "truncate font-semibold text-foreground text-xs", children: getUserName3(multiUser) }),
602
- /* @__PURE__ */ jsx9("span", { className: "block w-full truncate text-muted-foreground text-xs", children: multiUser?.email })
603
- ] })
604
- ] }),
605
- /* @__PURE__ */ jsx9(DropdownMenuSeparator, {})
606
- ] }, session.id)),
597
+ deviceSessions?.filter((sessionData) => sessionData.user.id !== user?.id).map(({ session, user: multiUser }) => {
598
+ const userData = multiUser;
599
+ return /* @__PURE__ */ jsxs7(Fragment2, { children: [
600
+ /* @__PURE__ */ jsxs7(DropdownMenuItem, { onClick: () => switchAccount(session.token), children: [
601
+ /* @__PURE__ */ jsx9(UserAvatar2, { src: userData?.image || void 0, alt: getUserName3(userData) }),
602
+ /* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 flex-1 flex-col items-start", children: [
603
+ /* @__PURE__ */ jsx9("span", { className: "truncate font-semibold text-foreground text-xs", children: getUserName3(userData) }),
604
+ /* @__PURE__ */ jsx9("span", { className: "block w-full truncate text-muted-foreground text-xs", children: userData?.email })
605
+ ] })
606
+ ] }),
607
+ /* @__PURE__ */ jsx9(DropdownMenuSeparator, {})
608
+ ] }, session.id);
609
+ }),
607
610
  /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.auth.SIGN_IN, children: [
608
611
  /* @__PURE__ */ jsx9(PlusCircleIcon, {}),
609
- t("common.actions.addAccount")
612
+ t("common.actions.add"),
613
+ " ",
614
+ t("ui.navigation.account")
610
615
  ] }) })
611
616
  ] })
612
617
  ] })
@@ -0,0 +1,96 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { Avatar, buttonVariants, Dialog, Card } from 'pelatform-ui/default';
3
+ import { User, Workspace } from '@pelatform/starter.utils';
4
+
5
+ type AvatarClassNames = {
6
+ base?: string;
7
+ fallback?: string;
8
+ fallbackIcon?: string;
9
+ image?: string;
10
+ skeleton?: string;
11
+ };
12
+ interface AvatarProps extends ComponentProps<typeof Avatar> {
13
+ className?: string;
14
+ classNames?: AvatarClassNames;
15
+ image?: string;
16
+ isPending?: boolean;
17
+ size?: NonNullable<Parameters<typeof buttonVariants>[0]>["size"] | null | undefined;
18
+ user?: Partial<User> | null;
19
+ workspace?: Partial<Workspace> | null;
20
+ }
21
+
22
+ type DialogClassNames = {
23
+ content?: string;
24
+ header?: string;
25
+ footer?: string;
26
+ };
27
+ interface DialogComponentProps extends ComponentProps<typeof Dialog> {
28
+ className?: string;
29
+ children?: ReactNode;
30
+ classNames?: CardClassNames;
31
+ title?: string;
32
+ description?: string;
33
+ disableFooter?: boolean;
34
+ cancelButton?: boolean;
35
+ cancelButtonDisabled?: boolean;
36
+ button?: ReactNode;
37
+ }
38
+
39
+ type CardClassNames = {
40
+ base?: string;
41
+ cell?: string;
42
+ content?: string;
43
+ header?: string;
44
+ footer?: string;
45
+ grid?: string;
46
+ skeleton?: string;
47
+ title?: string;
48
+ description?: string;
49
+ instructions?: string;
50
+ error?: string;
51
+ label?: string;
52
+ input?: string;
53
+ checkbox?: string;
54
+ icon?: string;
55
+ button?: string;
56
+ primaryButton?: string;
57
+ secondaryButton?: string;
58
+ outlineButton?: string;
59
+ destructiveButton?: string;
60
+ avatar?: AvatarClassNames;
61
+ dialog?: DialogClassNames;
62
+ };
63
+ interface CardComponentProps extends Omit<ComponentProps<typeof Card>, "title" | "variant"> {
64
+ className?: string;
65
+ children?: ReactNode;
66
+ classNames?: CardClassNames;
67
+ title?: ReactNode;
68
+ description?: ReactNode;
69
+ instructions?: ReactNode;
70
+ actionLabel?: ReactNode;
71
+ action?: () => Promise<unknown> | unknown;
72
+ disabled?: boolean;
73
+ isDestructive?: boolean;
74
+ isPending?: boolean;
75
+ isSubmitting?: boolean;
76
+ }
77
+
78
+ type ViewClassNames = {
79
+ base?: string;
80
+ content?: string;
81
+ title?: string;
82
+ subtitle?: string;
83
+ skeleton?: string;
84
+ icon?: string;
85
+ avatar?: AvatarClassNames;
86
+ };
87
+ interface ViewProps {
88
+ className?: string;
89
+ classNames?: ViewClassNames;
90
+ isPending?: boolean;
91
+ size?: NonNullable<Parameters<typeof buttonVariants>[0]>["size"] | null | undefined;
92
+ user?: Partial<User> | null;
93
+ workspace?: Partial<Workspace> | null;
94
+ }
95
+
96
+ export type { AvatarClassNames as A, CardClassNames as C, DialogClassNames as D, ViewClassNames as V, AvatarProps as a, CardComponentProps as b, DialogComponentProps as c, ViewProps as d };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pelatform/starter.shared",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "A part of SaaS starter kit for Pelatform applications.",
5
5
  "author": "Pelatform",
6
6
  "license": "MIT",
@@ -13,6 +13,10 @@
13
13
  ".": {
14
14
  "types": "./dist/index.d.ts",
15
15
  "default": "./dist/index.js"
16
+ },
17
+ "./extend": {
18
+ "types": "./dist/extend.d.ts",
19
+ "default": "./dist/extend.js"
16
20
  }
17
21
  },
18
22
  "scripts": {
@@ -35,14 +39,13 @@
35
39
  "@tanstack/react-query-devtools": "^5.91.1"
36
40
  },
37
41
  "devDependencies": {
38
- "@pelatform/starter.config": "0.1.1",
39
- "@pelatform/starter.hook": "0.1.1",
40
- "@pelatform/starter.i18n": "0.1.3",
41
- "@pelatform/starter.utils": "0.1.1",
42
+ "@pelatform/starter.config": "0.2.1",
43
+ "@pelatform/starter.hook": "0.2.1",
44
+ "@pelatform/starter.utils": "0.2.1",
42
45
  "@pelatform/tsconfig": "^0.1.3",
43
46
  "@types/react": "^19.2.7",
44
- "lucide-react": "^0.556.0",
45
- "next": "^16.0.7",
47
+ "lucide-react": "^0.557.0",
48
+ "next": "^16.0.8",
46
49
  "next-intl": "^4.5.8",
47
50
  "pelatform-ui": "^1.1.3",
48
51
  "react": "^19.2.1",
@@ -50,10 +53,9 @@
50
53
  "tsup": "^8.5.1"
51
54
  },
52
55
  "peerDependencies": {
53
- "@pelatform/starter.config": ">=0.1.0",
54
- "@pelatform/starter.hook": ">=0.1.0",
55
- "@pelatform/starter.i18n": ">=0.1.0",
56
- "@pelatform/starter.utils": ">=0.1.0",
56
+ "@pelatform/starter.config": ">=0.2.0",
57
+ "@pelatform/starter.hook": ">=0.2.0",
58
+ "@pelatform/starter.utils": ">=0.2.0",
57
59
  "lucide-react": ">=0.55.0",
58
60
  "next": ">=16.0.0",
59
61
  "next-intl": ">=4.5.0",