@pelatform/starter.shared 0.2.5 → 0.2.6

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
@@ -22,9 +22,10 @@ declare function Header({ children }: {
22
22
  children: ReactNode;
23
23
  }): react_jsx_runtime.JSX.Element;
24
24
  declare function HeaderLeft(): react_jsx_runtime.JSX.Element;
25
- declare function HeaderRight({ sidebar, button }: {
25
+ declare function HeaderRight({ sidebar, button, homeUrl, }: {
26
26
  sidebar?: ReactNode;
27
27
  button?: ReactNode;
28
+ homeUrl?: string;
28
29
  }): react_jsx_runtime.JSX.Element;
29
30
  declare function HeaderSidebarMobile({ children }: {
30
31
  children: ReactNode;
@@ -57,10 +58,11 @@ declare function SiteHeader({ menu, logo, }: {
57
58
  menu: NavItem[];
58
59
  logo?: ReactNode;
59
60
  }): react_jsx_runtime.JSX.Element;
60
- declare function SiteHeaderSecondary({ menu, logo, loginLink, }: {
61
+ declare function SiteHeaderSecondary({ menu, logo, loginHref, loginTarget, }: {
61
62
  menu: NavItem[];
62
63
  logo?: ReactNode;
63
- loginLink?: string;
64
+ loginHref?: string;
65
+ loginTarget?: "_self" | "_blank" | "_parent" | "_top";
64
66
  }): react_jsx_runtime.JSX.Element;
65
67
 
66
68
  type ToolbarItem = "darkmode" | "help" | "language" | "onboarding";
@@ -75,8 +77,9 @@ interface LayoutWrapperProps {
75
77
  sidebarHeader: ReactNode;
76
78
  sidebarMenu: ReactNode;
77
79
  logoHeader?: ReactNode;
80
+ homeUrl?: string;
78
81
  }
79
- declare function LayoutWrapper({ children, sidebarHeader, sidebarMenu, logoHeader, }: LayoutWrapperProps): react_jsx_runtime.JSX.Element;
82
+ declare function LayoutWrapper({ children, sidebarHeader, sidebarMenu, logoHeader, homeUrl, }: LayoutWrapperProps): react_jsx_runtime.JSX.Element;
80
83
 
81
84
  /**
82
85
  * Props for the ConfigProvider component
@@ -267,7 +270,8 @@ declare function SignedInHint({ linkHref }: {
267
270
  linkHref?: string;
268
271
  }): react_jsx_runtime.JSX.Element;
269
272
 
270
- declare function UserMenu({ hiddenSwitcher }: {
273
+ declare function UserMenu({ homeUrl, hiddenSwitcher, }: {
274
+ homeUrl?: string;
271
275
  hiddenSwitcher?: boolean;
272
276
  }): react_jsx_runtime.JSX.Element;
273
277
 
package/dist/index.js CHANGED
@@ -148,7 +148,7 @@ function ToolbarRSC({ show = DEFAULT_SHOW }) {
148
148
  import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
149
149
  function AuthLayout({
150
150
  children,
151
- logo = /* @__PURE__ */ jsx6(LogoWithName, {}),
151
+ logo = /* @__PURE__ */ jsx6(LogoWithHref, {}),
152
152
  disableFooter = false,
153
153
  signInHint = false,
154
154
  signInHref
@@ -215,7 +215,14 @@ import {
215
215
  import { Fragment as Fragment2, useCallback, useEffect, useState } from "react";
216
216
  import Link4 from "next/link";
217
217
  import { useRouter as useRouter2 } from "next/navigation";
218
- import { LogOutIcon, PlusCircleIcon, SettingsIcon, ShieldIcon, UserStarIcon } from "lucide-react";
218
+ import {
219
+ HouseIcon,
220
+ LogOutIcon,
221
+ PlusCircleIcon,
222
+ SettingsIcon,
223
+ ShieldIcon,
224
+ UserStarIcon
225
+ } from "lucide-react";
219
226
  import { useTranslations as useTranslations7 } from "next-intl";
220
227
  import {
221
228
  useConfig as useConfig4,
@@ -510,7 +517,10 @@ function WorkspaceView({ className, classNames, isPending, size, workspace }) {
510
517
 
511
518
  // src/components/user-menu.tsx
512
519
  import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
513
- function UserMenu({ hiddenSwitcher = false }) {
520
+ function UserMenu({
521
+ homeUrl,
522
+ hiddenSwitcher = false
523
+ }) {
514
524
  const { features, path } = useConfig4();
515
525
  const router = useRouter2();
516
526
  const t = useTranslations7();
@@ -555,6 +565,10 @@ function UserMenu({ hiddenSwitcher = false }) {
555
565
  ] })
556
566
  ] }),
557
567
  /* @__PURE__ */ jsx9(DropdownMenuSeparator, {}),
568
+ homeUrl && /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: homeUrl, target: "_blank", children: [
569
+ /* @__PURE__ */ jsx9(HouseIcon, {}),
570
+ /* @__PURE__ */ jsx9("span", { children: t("ui.navigation.home") })
571
+ ] }) }),
558
572
  /* @__PURE__ */ jsx9(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs7(Link4, { href: path.account.SETTINGS, children: [
559
573
  /* @__PURE__ */ jsx9(SettingsIcon, {}),
560
574
  /* @__PURE__ */ jsx9("span", { children: t("ui.navigation.preferences") })
@@ -638,12 +652,16 @@ function HeaderLeft() {
638
652
  )
639
653
  ] }) });
640
654
  }
641
- function HeaderRight({ sidebar, button }) {
655
+ function HeaderRight({
656
+ sidebar,
657
+ button,
658
+ homeUrl
659
+ }) {
642
660
  const { isMobile } = useLayout();
643
661
  return /* @__PURE__ */ jsxs8("nav", { className: "flex items-center gap-1.5 lg:gap-2.5", children: [
644
662
  button,
645
663
  isMobile && sidebar,
646
- /* @__PURE__ */ jsx10(UserMenu, {})
664
+ /* @__PURE__ */ jsx10(UserMenu, { homeUrl })
647
665
  ] });
648
666
  }
649
667
  function HeaderSidebarMobile({ children }) {
@@ -898,10 +916,10 @@ import {
898
916
  SiteHeader as UISiteHeader
899
917
  } from "pelatform-ui/components";
900
918
  import { Button as Button4, Separator } from "pelatform-ui/default";
901
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
919
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
902
920
  function SiteHeader({
903
921
  menu,
904
- logo = /* @__PURE__ */ jsx13(LogoWithHref, { href: "/home" })
922
+ logo = /* @__PURE__ */ jsx13(LogoWithHref, { href: "/" })
905
923
  }) {
906
924
  const { path } = useConfig6();
907
925
  const pathname = usePathname4();
@@ -950,8 +968,9 @@ function SiteHeader({
950
968
  }
951
969
  function SiteHeaderSecondary({
952
970
  menu,
953
- logo = /* @__PURE__ */ jsx13(LogoWithHref, { href: "/home" }),
954
- loginLink
971
+ logo = /* @__PURE__ */ jsx13(LogoWithHref, { href: "/" }),
972
+ loginHref,
973
+ loginTarget = "_self"
955
974
  }) {
956
975
  const pathname = usePathname4();
957
976
  const t = useTranslations10();
@@ -964,7 +983,6 @@ function SiteHeaderSecondary({
964
983
  /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-end gap-3", children: /* @__PURE__ */ jsxs11("nav", { className: "flex items-center gap-0 md:gap-1", children: [
965
984
  /* @__PURE__ */ jsx13(ModeSwitcher3, {}),
966
985
  /* @__PURE__ */ jsx13(LanguageSwitcher, {}),
967
- /* @__PURE__ */ jsx13(Separator, { orientation: "vertical", className: "mx-3 h-5 max-lg:hidden" }),
968
986
  /* @__PURE__ */ jsx13(MobileNav, { children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col space-y-3", children: [
969
987
  menu?.map(
970
988
  (item, navIndex) => item.href || item.children ? /* @__PURE__ */ jsx13(
@@ -979,9 +997,12 @@ function SiteHeaderSecondary({
979
997
  `nav-${navIndex}-${item.href}`
980
998
  ) : null
981
999
  ),
982
- loginLink && /* @__PURE__ */ jsx13("div", { className: "border-t pt-3", children: /* @__PURE__ */ jsx13(Button4, { variant: "secondary", size: "sm", className: "w-full", children: /* @__PURE__ */ jsx13(Link7, { href: loginLink, children: t("ui.navigation.signIn") }) }) })
1000
+ loginHref && /* @__PURE__ */ jsx13("div", { className: "border-t pt-3", children: /* @__PURE__ */ jsx13(Button4, { variant: "secondary", size: "sm", className: "w-full", children: /* @__PURE__ */ jsx13(Link7, { href: loginHref, target: loginTarget, children: t("ui.navigation.signIn") }) }) })
983
1001
  ] }) }),
984
- loginLink && /* @__PURE__ */ jsx13(Button4, { variant: "secondary", size: "sm", className: "hidden md:flex", children: /* @__PURE__ */ jsx13(Link7, { href: loginLink, children: t("ui.navigation.signIn") }) })
1002
+ loginHref && /* @__PURE__ */ jsxs11(Fragment5, { children: [
1003
+ /* @__PURE__ */ jsx13(Separator, { orientation: "vertical", className: "mx-3 h-5 max-md:hidden" }),
1004
+ /* @__PURE__ */ jsx13(Button4, { variant: "secondary", size: "sm", className: "hidden md:flex", children: /* @__PURE__ */ jsx13(Link7, { href: loginHref, target: loginTarget, children: t("ui.navigation.signIn") }) })
1005
+ ] })
985
1006
  ] }) })
986
1007
  ] });
987
1008
  }
@@ -1052,21 +1073,28 @@ function LayoutProvider({
1052
1073
  }
1053
1074
 
1054
1075
  // src/components/layouts/wrapper.tsx
1055
- import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
1076
+ import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
1056
1077
  function LayoutWrapper({
1057
1078
  children,
1058
1079
  sidebarHeader,
1059
1080
  sidebarMenu,
1060
- logoHeader
1081
+ logoHeader,
1082
+ homeUrl
1061
1083
  }) {
1062
- const sidebarContent = /* @__PURE__ */ jsxs12(Fragment5, { children: [
1084
+ const sidebarContent = /* @__PURE__ */ jsxs12(Fragment6, { children: [
1063
1085
  sidebarHeader,
1064
1086
  /* @__PURE__ */ jsx15(SidebarContent, { children: sidebarMenu })
1065
1087
  ] });
1066
1088
  return /* @__PURE__ */ jsxs12(LayoutProvider, { logoHeader, children: [
1067
1089
  /* @__PURE__ */ jsxs12(Header, { children: [
1068
1090
  /* @__PURE__ */ jsx15(HeaderLeft, {}),
1069
- /* @__PURE__ */ jsx15(HeaderRight, { sidebar: /* @__PURE__ */ jsx15(HeaderSidebarMobile, { children: sidebarContent }) })
1091
+ /* @__PURE__ */ jsx15(
1092
+ HeaderRight,
1093
+ {
1094
+ sidebar: /* @__PURE__ */ jsx15(HeaderSidebarMobile, { children: sidebarContent }),
1095
+ homeUrl
1096
+ }
1097
+ )
1070
1098
  ] }),
1071
1099
  /* @__PURE__ */ jsxs12("div", { className: "flex grow pt-(--header-height-mobile) lg:pt-(--header-height)", children: [
1072
1100
  /* @__PURE__ */ jsx15(Sidebar, { children: sidebarContent }),
@@ -1133,7 +1161,7 @@ function SharedProviders({
1133
1161
  import { useFormState } from "react-hook-form";
1134
1162
  import { cn as cn7 } from "pelatform-ui";
1135
1163
  import { Button as Button5, Card, CardContent, CardFooter, Skeleton as Skeleton4, Spinner } from "pelatform-ui/default";
1136
- import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
1164
+ import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
1137
1165
  function CardComponent({
1138
1166
  children,
1139
1167
  className,
@@ -1196,10 +1224,10 @@ function CardHeaderComponent({
1196
1224
  description,
1197
1225
  isPending
1198
1226
  }) {
1199
- return /* @__PURE__ */ jsx18("div", { className: cn7("flex flex-col space-y-2", className, classNames?.header), children: isPending ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
1227
+ return /* @__PURE__ */ jsx18("div", { className: cn7("flex flex-col space-y-2", className, classNames?.header), children: isPending ? /* @__PURE__ */ jsxs14(Fragment7, { children: [
1200
1228
  /* @__PURE__ */ jsx18(Skeleton4, { className: cn7("h-7 w-1/3", classNames?.skeleton) }),
1201
1229
  description && /* @__PURE__ */ jsx18(Skeleton4, { className: cn7("h-5 w-2/3", classNames?.skeleton) })
1202
- ] }) : /* @__PURE__ */ jsxs14(Fragment6, { children: [
1230
+ ] }) : /* @__PURE__ */ jsxs14(Fragment7, { children: [
1203
1231
  /* @__PURE__ */ jsx18("h2", { className: cn7("font-medium text-xl", classNames?.title), children: title }),
1204
1232
  description && /* @__PURE__ */ jsx18("p", { className: cn7("text-muted-foreground text-sm", classNames?.description), children: description })
1205
1233
  ] }) });
@@ -1224,7 +1252,7 @@ function CardFooterComponent({
1224
1252
  className,
1225
1253
  classNames?.footer
1226
1254
  ),
1227
- children: isPending ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
1255
+ children: isPending ? /* @__PURE__ */ jsxs14(Fragment7, { children: [
1228
1256
  instructions && /* @__PURE__ */ jsx18(
1229
1257
  Skeleton4,
1230
1258
  {
@@ -1240,7 +1268,7 @@ function CardFooterComponent({
1240
1268
  className: cn7("h-8 w-20 bg-muted-foreground/10 md:ms-auto", classNames?.skeleton)
1241
1269
  }
1242
1270
  )
1243
- ] }) : /* @__PURE__ */ jsxs14(Fragment6, { children: [
1271
+ ] }) : /* @__PURE__ */ jsxs14(Fragment7, { children: [
1244
1272
  instructions && /* @__PURE__ */ jsx18(
1245
1273
  "div",
1246
1274
  {
@@ -1495,7 +1523,7 @@ function EmptyState({
1495
1523
 
1496
1524
  // src/components/otp-input-group.tsx
1497
1525
  import { InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "pelatform-ui/default";
1498
- import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
1526
+ import { Fragment as Fragment8, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
1499
1527
  function OTPInputGroup({ otpSeparators = 0 }) {
1500
1528
  if (otpSeparators === 0) {
1501
1529
  return /* @__PURE__ */ jsxs19(InputOTPGroup, { children: [
@@ -1508,7 +1536,7 @@ function OTPInputGroup({ otpSeparators = 0 }) {
1508
1536
  ] });
1509
1537
  }
1510
1538
  if (otpSeparators === 1) {
1511
- return /* @__PURE__ */ jsxs19(Fragment7, { children: [
1539
+ return /* @__PURE__ */ jsxs19(Fragment8, { children: [
1512
1540
  /* @__PURE__ */ jsxs19(InputOTPGroup, { children: [
1513
1541
  /* @__PURE__ */ jsx23(InputOTPSlot, { index: 0 }),
1514
1542
  /* @__PURE__ */ jsx23(InputOTPSlot, { index: 1 }),
@@ -1522,7 +1550,7 @@ function OTPInputGroup({ otpSeparators = 0 }) {
1522
1550
  ] })
1523
1551
  ] });
1524
1552
  }
1525
- return /* @__PURE__ */ jsxs19(Fragment7, { children: [
1553
+ return /* @__PURE__ */ jsxs19(Fragment8, { children: [
1526
1554
  /* @__PURE__ */ jsxs19(InputOTPGroup, { children: [
1527
1555
  /* @__PURE__ */ jsx23(InputOTPSlot, { index: 0 }),
1528
1556
  /* @__PURE__ */ jsx23(InputOTPSlot, { index: 1 })
@@ -1545,7 +1573,7 @@ import { useState as useState5 } from "react";
1545
1573
  import { EyeIcon, EyeOffIcon } from "lucide-react";
1546
1574
  import { cn as cn12 } from "pelatform-ui";
1547
1575
  import { Button as Button8, Input as Input2 } from "pelatform-ui/default";
1548
- import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
1576
+ import { Fragment as Fragment9, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
1549
1577
  function PasswordInput({
1550
1578
  className,
1551
1579
  variant,
@@ -1569,7 +1597,7 @@ function PasswordInput({
1569
1597
  }
1570
1598
  }
1571
1599
  ),
1572
- enableToggle && /* @__PURE__ */ jsxs20(Fragment8, { children: [
1600
+ enableToggle && /* @__PURE__ */ jsxs20(Fragment9, { children: [
1573
1601
  /* @__PURE__ */ jsx24(
1574
1602
  Button8,
1575
1603
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pelatform/starter.shared",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "A part of SaaS starter kit for Pelatform applications.",
5
5
  "author": "Pelatform",
6
6
  "license": "MIT",