@pelatform/starter.shared 0.2.2 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { ReactNode, CSSProperties, ComponentProps, PropsWithChildren } from 'react';
3
+ import { ReactNode, CSSProperties, ComponentProps, PropsWithChildren, ComponentType } from 'react';
4
4
  import { MenuItem } from 'pelatform-ui';
5
5
  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, 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';
9
+ import { AnyAuthClient, User, Workspace, ApiKey } from '@pelatform/starter.utils';
10
+ import { Toaster, Avatar, buttonVariants, Dialog, Card, Button, Input } from 'pelatform-ui/default';
12
11
  import { LucideIcon } from 'lucide-react';
13
12
 
14
13
  declare function AuthLayout({ children, logo, disableFooter, signInHint, signInHref, }: {
@@ -139,6 +138,79 @@ interface SharedProvidersProps {
139
138
  }
140
139
  declare function SharedProviders({ children, locale, messages, timeZone, sonnerPosition, }: SharedProvidersProps): react_jsx_runtime.JSX.Element;
141
140
 
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
+
142
214
  declare function CardComponent({ children, className, classNames, title, description, instructions, actionLabel, action, disabled, isDestructive, isPending, isSubmitting, ...props }: CardComponentProps): react_jsx_runtime.JSX.Element;
143
215
  declare function CardHeaderComponent({ className, classNames, title, description, isPending, }: CardComponentProps): react_jsx_runtime.JSX.Element;
144
216
  declare function CardFooterComponent({ className, classNames, instructions, actionLabel, action, disabled, isDestructive, isPending, isSubmitting, }: CardComponentProps): react_jsx_runtime.JSX.Element;
@@ -199,10 +271,127 @@ declare function UserMenu({ hiddenSwitcher }: {
199
271
  hiddenSwitcher?: boolean;
200
272
  }): react_jsx_runtime.JSX.Element;
201
273
 
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
+
202
292
  declare function UserView({ className, classNames, isPending, size, user }: ViewProps): react_jsx_runtime.JSX.Element;
203
293
  declare function ApiKeyView({ className, classNames, apiKey }: ViewProps & {
204
294
  apiKey: ApiKey;
205
295
  }): react_jsx_runtime.JSX.Element;
206
296
  declare function WorkspaceView({ className, classNames, isPending, size, workspace }: ViewProps): react_jsx_runtime.JSX.Element;
207
297
 
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 };
298
+ declare const socialProviders: readonly [{
299
+ readonly provider: "apple";
300
+ readonly name: "Apple";
301
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
302
+ }, {
303
+ readonly provider: "discord";
304
+ readonly name: "Discord";
305
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
306
+ }, {
307
+ readonly provider: "dropbox";
308
+ readonly name: "Dropbox";
309
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
310
+ }, {
311
+ readonly provider: "facebook";
312
+ readonly name: "Facebook";
313
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
314
+ }, {
315
+ readonly provider: "github";
316
+ readonly name: "GitHub";
317
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
318
+ }, {
319
+ readonly provider: "gitlab";
320
+ readonly name: "GitLab";
321
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
322
+ }, {
323
+ readonly provider: "google";
324
+ readonly name: "Google";
325
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
326
+ }, {
327
+ readonly provider: "huggingface";
328
+ readonly name: "Hugging Face";
329
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
330
+ }, {
331
+ readonly provider: "kick";
332
+ readonly name: "Kick";
333
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
334
+ }, {
335
+ readonly provider: "linear";
336
+ readonly name: "Linear";
337
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
338
+ }, {
339
+ readonly provider: "linkedin";
340
+ readonly name: "LinkedIn";
341
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
342
+ }, {
343
+ readonly provider: "microsoft";
344
+ readonly name: "Microsoft";
345
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
346
+ }, {
347
+ readonly provider: "notion";
348
+ readonly name: "Notion";
349
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
350
+ }, {
351
+ readonly provider: "reddit";
352
+ readonly name: "Reddit";
353
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
354
+ }, {
355
+ readonly provider: "roblox";
356
+ readonly name: "Roblox";
357
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
358
+ }, {
359
+ readonly provider: "slack";
360
+ readonly name: "Slack";
361
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
362
+ }, {
363
+ readonly provider: "spotify";
364
+ readonly name: "Spotify";
365
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
366
+ }, {
367
+ readonly provider: "tiktok";
368
+ readonly name: "TikTok";
369
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
370
+ }, {
371
+ readonly provider: "twitch";
372
+ readonly name: "Twitch";
373
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
374
+ }, {
375
+ readonly provider: "vk";
376
+ readonly name: "VK";
377
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
378
+ }, {
379
+ readonly provider: "twitter";
380
+ readonly name: "X";
381
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
382
+ }, {
383
+ readonly provider: "zoom";
384
+ readonly name: "Zoom";
385
+ readonly icon: (props: react.HTMLAttributes<SVGElement>) => react_jsx_runtime.JSX.Element;
386
+ }];
387
+
388
+ type ProviderIcon = ComponentType<{
389
+ className?: string;
390
+ }>;
391
+ type Provider = {
392
+ provider: string;
393
+ name: string;
394
+ icon?: ProviderIcon;
395
+ };
396
+
397
+ 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, type Provider, type ProviderIcon, SharedProviders, type SharedProvidersProps, Sidebar, SidebarContent, SidebarContentMenu, SidebarHeaderBack, SignedInHint, SiteFooter, SiteHeader, SiteHeaderSecondary, SkeletonInputComponent, SkeletonViewComponent, Toolbar, UserAvatar, UserMenu, UserView, type ViewClassNames, type ViewProps, WorkspaceLogo, WorkspaceView, socialProviders };
package/dist/index.js CHANGED
@@ -199,7 +199,7 @@ function AuthLayout({
199
199
  // src/components/layouts/header.tsx
200
200
  import { useEffect as useEffect2, useState as useState2 } from "react";
201
201
  import { usePathname as usePathname2 } from "next/navigation";
202
- import { Menu, PanelRight } from "lucide-react";
202
+ import { MenuIcon, PanelRightIcon } from "lucide-react";
203
203
  import { useLayout } from "@pelatform/starter.hook";
204
204
  import {
205
205
  Button as Button2,
@@ -216,7 +216,7 @@ import {
216
216
  import { Fragment as Fragment2, useCallback, useEffect, useState } from "react";
217
217
  import Link4 from "next/link";
218
218
  import { useRouter as useRouter2 } from "next/navigation";
219
- import { LogOut, PlusCircleIcon, Settings, Shield, UserStar } from "lucide-react";
219
+ import { LogOutIcon, PlusCircleIcon, SettingsIcon, ShieldIcon, UserStarIcon } from "lucide-react";
220
220
  import { useTranslations as useTranslations7 } from "next-intl";
221
221
  import {
222
222
  useConfig as useConfig4,
@@ -224,7 +224,7 @@ import {
224
224
  useSession as useSession3,
225
225
  useSetActiveSession
226
226
  } from "@pelatform/starter.hook";
227
- import { getUserName as getUserName3 } from "@pelatform/starter.utils";
227
+ import { getUserName as getUserName3 } from "pelatform-ui";
228
228
  import { ModeSwitcher as ModeSwitcher2, UserAvatar as UserAvatar2 } from "pelatform-ui/components";
229
229
  import {
230
230
  Badge,
@@ -239,15 +239,13 @@ import {
239
239
  // src/components/view.tsx
240
240
  import { KeyRoundIcon } from "lucide-react";
241
241
  import { useLocale as useLocale2, useTranslations as useTranslations6 } from "next-intl";
242
- import { getUserName as getUserName2 } from "@pelatform/starter.utils";
243
- import { cn as cn4 } from "pelatform-ui";
242
+ import { cn as cn4, formatDate, getUserName as getUserName2 } from "pelatform-ui";
244
243
  import { Skeleton as Skeleton2 } from "pelatform-ui/default";
245
244
 
246
245
  // src/components/avatar.tsx
247
246
  import { BuildingIcon, UserRoundIcon } from "lucide-react";
248
247
  import { useTranslations as useTranslations5 } from "next-intl";
249
- import { getSizeAvatar, getUserName } from "@pelatform/starter.utils";
250
- import { cn as cn3 } from "pelatform-ui";
248
+ import { cn as cn3, getSizeAvatar, getUserName } from "pelatform-ui";
251
249
  import { getInitials } from "pelatform-ui/components";
252
250
  import { Avatar, AvatarFallback, AvatarImage, Skeleton } from "pelatform-ui/default";
253
251
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -421,16 +419,18 @@ function UserView({ className, classNames, isPending, size, user }) {
421
419
  ] });
422
420
  }
423
421
  function ApiKeyView({ className, classNames, apiKey }) {
424
- const t = useTranslations6();
425
422
  const locale = useLocale2();
423
+ const t = useTranslations6();
426
424
  const formatExpiration = () => {
427
425
  if (!apiKey.expiresAt) return t("common.time.neverExpires");
428
- const expiresDate = new Date(apiKey.expiresAt);
429
- return `${t("common.time.expires")} ${expiresDate.toLocaleDateString(locale ?? "en", {
430
- month: "short",
431
- day: "numeric",
432
- year: "numeric"
433
- })}`;
426
+ const expiresDate = formatDate(
427
+ new Date(apiKey.expiresAt),
428
+ {
429
+ month: "short"
430
+ },
431
+ locale ?? "en"
432
+ );
433
+ return `${t("common.time.expires")} ${expiresDate}`;
434
434
  };
435
435
  return /* @__PURE__ */ jsxs6("div", { className: cn4("flex items-center gap-3 truncate", className, classNames?.base), children: [
436
436
  /* @__PURE__ */ jsx8(KeyRoundIcon, { className: cn4("size-4 shrink-0", classNames?.icon) }),
@@ -557,15 +557,15 @@ function UserMenu({ hiddenSwitcher = false }) {
557
557
  ] }),
558
558
  /* @__PURE__ */ jsx9(DropdownMenuSeparator, {}),
559
559
  /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.account.SETTINGS, children: [
560
- /* @__PURE__ */ jsx9(Settings, {}),
560
+ /* @__PURE__ */ jsx9(SettingsIcon, {}),
561
561
  /* @__PURE__ */ jsx9("span", { children: t("ui.navigation.preferences") })
562
562
  ] }) }),
563
563
  /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.account.SECURITY, children: [
564
- /* @__PURE__ */ jsx9(Shield, {}),
564
+ /* @__PURE__ */ jsx9(ShieldIcon, {}),
565
565
  /* @__PURE__ */ jsx9("span", { children: t("ui.navigation.security") })
566
566
  ] }) }),
567
567
  "admin" === userRole && /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.admin.OVERVIEW, children: [
568
- /* @__PURE__ */ jsx9(UserStar, {}),
568
+ /* @__PURE__ */ jsx9(UserStarIcon, {}),
569
569
  /* @__PURE__ */ jsx9("span", { children: "Admin Dashboard" })
570
570
  ] }) }),
571
571
  !hiddenSwitcher && /* @__PURE__ */ jsxs7(Fragment3, { children: [
@@ -585,7 +585,7 @@ function UserMenu({ hiddenSwitcher = false }) {
585
585
  ] }),
586
586
  /* @__PURE__ */ jsx9(DropdownMenuSeparator, {}),
587
587
  /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.auth.SIGN_OUT, children: [
588
- /* @__PURE__ */ jsx9(LogOut, {}),
588
+ /* @__PURE__ */ jsx9(LogOutIcon, {}),
589
589
  /* @__PURE__ */ jsx9("span", { children: t("ui.navigation.signOut") })
590
590
  ] }) }),
591
591
  user && features.multiSession && /* @__PURE__ */ jsxs7(Fragment3, { children: [
@@ -634,7 +634,7 @@ function HeaderLeft() {
634
634
  variant: "ghost",
635
635
  onClick: sidebarToggle,
636
636
  className: "hidden text-muted-foreground hover:text-foreground lg:inline-flex",
637
- children: /* @__PURE__ */ jsx10(PanelRight, { className: "-rotate-180 in-data-[sidebar-open=false]:rotate-0 opacity-100" })
637
+ children: /* @__PURE__ */ jsx10(PanelRightIcon, { className: "-rotate-180 in-data-[sidebar-open=false]:rotate-0 opacity-100" })
638
638
  }
639
639
  )
640
640
  ] }) });
@@ -654,7 +654,7 @@ function HeaderSidebarMobile({ children }) {
654
654
  setIsSheetOpen(false);
655
655
  }, [pathname]);
656
656
  return /* @__PURE__ */ jsxs8(Sheet, { open: isSheetOpen, onOpenChange: setIsSheetOpen, children: [
657
- /* @__PURE__ */ jsx10(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx10(Button2, { variant: "ghost", mode: "icon", size: "icon", children: /* @__PURE__ */ jsx10(Menu, { className: "size-4" }) }) }),
657
+ /* @__PURE__ */ jsx10(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsx10(Button2, { variant: "ghost", mode: "icon", size: "icon", children: /* @__PURE__ */ jsx10(MenuIcon, { className: "size-4" }) }) }),
658
658
  /* @__PURE__ */ jsxs8(SheetContent, { className: "w-(--sidebar-width) gap-0 p-0", side: "left", close: false, children: [
659
659
  /* @__PURE__ */ jsxs8(SheetHeader, { className: "hidden space-y-0 p-0", children: [
660
660
  /* @__PURE__ */ jsx10(SheetTitle, { className: "sr-only", children: "Navigation menu" }),
@@ -1594,6 +1594,121 @@ function PasswordInput({
1594
1594
  ] })
1595
1595
  ] });
1596
1596
  }
1597
+
1598
+ // src/lib/social-providers.ts
1599
+ import { Icons } from "pelatform-ui";
1600
+ var socialProviders = [
1601
+ {
1602
+ provider: "apple",
1603
+ name: "Apple",
1604
+ icon: Icons.Apple
1605
+ },
1606
+ {
1607
+ provider: "discord",
1608
+ name: "Discord",
1609
+ icon: Icons.Discord
1610
+ },
1611
+ {
1612
+ provider: "dropbox",
1613
+ name: "Dropbox",
1614
+ icon: Icons.Dropbox
1615
+ },
1616
+ {
1617
+ provider: "facebook",
1618
+ name: "Facebook",
1619
+ icon: Icons.FacebookColorful
1620
+ },
1621
+ {
1622
+ provider: "github",
1623
+ name: "GitHub",
1624
+ icon: Icons.Github
1625
+ },
1626
+ {
1627
+ provider: "gitlab",
1628
+ name: "GitLab",
1629
+ icon: Icons.Gitlab
1630
+ },
1631
+ {
1632
+ provider: "google",
1633
+ name: "Google",
1634
+ icon: Icons.GoogleColorful
1635
+ },
1636
+ {
1637
+ provider: "huggingface",
1638
+ name: "Hugging Face",
1639
+ icon: Icons.Huggingface
1640
+ },
1641
+ {
1642
+ provider: "kick",
1643
+ name: "Kick",
1644
+ icon: Icons.Kick
1645
+ },
1646
+ {
1647
+ provider: "linear",
1648
+ name: "Linear",
1649
+ icon: Icons.Linear
1650
+ },
1651
+ {
1652
+ provider: "linkedin",
1653
+ name: "LinkedIn",
1654
+ icon: Icons.LinkedinColorful
1655
+ },
1656
+ {
1657
+ provider: "microsoft",
1658
+ name: "Microsoft",
1659
+ icon: Icons.Microsoft
1660
+ },
1661
+ {
1662
+ provider: "notion",
1663
+ name: "Notion",
1664
+ icon: Icons.Notion
1665
+ },
1666
+ {
1667
+ provider: "reddit",
1668
+ name: "Reddit",
1669
+ icon: Icons.Reddit
1670
+ },
1671
+ {
1672
+ provider: "roblox",
1673
+ name: "Roblox",
1674
+ icon: Icons.Roblox
1675
+ },
1676
+ {
1677
+ provider: "slack",
1678
+ name: "Slack",
1679
+ icon: Icons.Slack
1680
+ },
1681
+ {
1682
+ provider: "spotify",
1683
+ name: "Spotify",
1684
+ icon: Icons.Spotify
1685
+ },
1686
+ {
1687
+ provider: "tiktok",
1688
+ name: "TikTok",
1689
+ icon: Icons.Tiktok
1690
+ },
1691
+ {
1692
+ provider: "twitch",
1693
+ name: "Twitch",
1694
+ icon: Icons.Twitch
1695
+ },
1696
+ {
1697
+ provider: "vk",
1698
+ name: "VK",
1699
+ icon: Icons.Vk
1700
+ },
1701
+ {
1702
+ provider: "twitter",
1703
+ name: "X",
1704
+ icon: Icons.X
1705
+ },
1706
+ {
1707
+ provider: "zoom",
1708
+ name: "Zoom",
1709
+ icon: Icons.Zoom
1710
+ }
1711
+ ];
1597
1712
  export {
1598
1713
  ApiKeyView,
1599
1714
  AuthLayout,
@@ -1635,5 +1750,6 @@ export {
1635
1750
  UserMenu,
1636
1751
  UserView,
1637
1752
  WorkspaceLogo,
1638
- WorkspaceView
1753
+ WorkspaceView,
1754
+ socialProviders
1639
1755
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pelatform/starter.shared",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "A part of SaaS starter kit for Pelatform applications.",
5
5
  "author": "Pelatform",
6
6
  "license": "MIT",
@@ -13,10 +13,6 @@
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"
20
16
  }
21
17
  },
22
18
  "scripts": {
@@ -41,14 +37,14 @@
41
37
  "devDependencies": {
42
38
  "@pelatform/starter.config": "0.2.1",
43
39
  "@pelatform/starter.hook": "0.2.1",
44
- "@pelatform/starter.utils": "0.2.1",
40
+ "@pelatform/starter.utils": "0.2.3",
45
41
  "@pelatform/tsconfig": "^0.1.3",
46
42
  "@types/react": "^19.2.7",
47
- "lucide-react": "^0.559.0",
48
- "next": "^16.0.8",
49
- "next-intl": "^4.5.8",
50
- "pelatform-ui": "^1.1.3",
51
- "react": "^19.2.1",
43
+ "lucide-react": "^0.561.0",
44
+ "next": "^16.0.10",
45
+ "next-intl": "^4.6.0",
46
+ "pelatform-ui": "^1.1.6",
47
+ "react": "^19.2.3",
52
48
  "react-hook-form": "^7.68.0",
53
49
  "tsup": "^8.5.1"
54
50
  },
package/dist/extend.d.ts DELETED
@@ -1,137 +0,0 @@
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 DELETED
@@ -1,318 +0,0 @@
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
- };
@@ -1,96 +0,0 @@
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 };