@fluid-app/portal-sdk 0.1.443 → 0.1.445

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.mjs CHANGED
@@ -88,6 +88,7 @@ import { twMerge } from "tailwind-merge";
88
88
  import { Slot } from "@radix-ui/react-slot";
89
89
  import { cva } from "class-variance-authority";
90
90
  import { createRoot } from "react-dom/client";
91
+ import { MobileBottomSheet } from "@fluid-app/ui-components/components/MobileBottomSheet";
91
92
  //#region src/types/page-template.ts
92
93
  /**
93
94
  * Built-in page category IDs
@@ -951,12 +952,12 @@ function AppShellLayout({ sidebarContent, headerContent, children, sidebarHeader
951
952
  /* @__PURE__ */ jsxs(SidebarInset, {
952
953
  className: "flex flex-1 flex-col overflow-hidden",
953
954
  children: [headerContent, /* @__PURE__ */ jsx("div", {
954
- className: `bg-muted min-h-0 flex-1 md:pt-4 md:pr-4 md:pb-4 md:pl-2 ${useBottomNav ? "max-md:pb-[calc(4rem+env(safe-area-inset-bottom))]" : ""}`,
955
+ className: `bg-muted min-h-0 flex-1 md:pt-4 md:pr-4 md:pb-4 md:pl-2 ${useBottomNav ? "max-md:pb-[calc(3.5rem+env(safe-area-inset-bottom))]" : ""}`,
955
956
  children: /* @__PURE__ */ jsx("div", {
956
957
  ref: screenContentRef,
957
958
  "data-fluid-portal-screen-area": "",
958
959
  tabIndex: -1,
959
- className: "ring-foreground/5 scrollbar-none bg-background text-foreground h-full overflow-auto rounded-xl shadow-sm ring-1",
960
+ className: "ring-foreground/5 scrollbar-none bg-background text-foreground h-full overflow-auto rounded-xl shadow-sm ring-1 max-md:rounded-none max-md:shadow-none max-md:ring-0",
960
961
  children
961
962
  })
962
963
  })]
@@ -1250,7 +1251,7 @@ function SdkBottomNav({ navItems, currentSlug, onNavigate, appDefinitionId = 0,
1250
1251
  setMoreOpen(false);
1251
1252
  };
1252
1253
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("nav", {
1253
- className: "border-border bg-sidebar fixed right-0 bottom-0 left-0 z-40 flex h-16 items-end justify-around border-t pb-[env(safe-area-inset-bottom)]",
1254
+ className: "border-border bg-sidebar fixed right-0 bottom-0 left-0 z-40 flex h-[calc(3.5rem+env(safe-area-inset-bottom))] items-end justify-around border-t pb-[env(safe-area-inset-bottom)]",
1254
1255
  children: [visibleItems.map((item) => {
1255
1256
  return /* @__PURE__ */ jsxs("button", {
1256
1257
  type: "button",
@@ -1270,41 +1271,22 @@ function SdkBottomNav({ navItems, currentSlug, onNavigate, appDefinitionId = 0,
1270
1271
  className: `flex flex-1 flex-col items-center justify-center gap-0.5 py-2 text-[10px] font-medium transition-colors ${overflowItems.some((item) => isInSection(item, currentSlug)) ? "text-primary" : "text-muted-foreground"}`,
1271
1272
  children: [/* @__PURE__ */ jsx(Ellipsis, { className: "size-5" }), /* @__PURE__ */ jsx("span", { children: t("nav_more") })]
1272
1273
  })]
1273
- }), moreOpen && /* @__PURE__ */ jsxs("div", {
1274
- className: "fixed inset-0 z-50 flex flex-col",
1275
- children: [/* @__PURE__ */ jsx("div", {
1276
- className: "flex-1 bg-black/50",
1277
- onClick: () => setMoreOpen(false),
1278
- "aria-hidden": "true"
1279
- }), /* @__PURE__ */ jsxs("div", {
1280
- className: "bg-sidebar rounded-t-2xl pb-[env(safe-area-inset-bottom)]",
1281
- children: [/* @__PURE__ */ jsxs("div", {
1282
- className: "flex items-center justify-between px-4 pt-4 pb-2",
1283
- children: [/* @__PURE__ */ jsx("span", {
1284
- className: "text-foreground text-sm font-semibold",
1285
- children: t("nav_more")
1286
- }), /* @__PURE__ */ jsx("button", {
1287
- type: "button",
1288
- onClick: () => setMoreOpen(false),
1289
- className: "text-muted-foreground hover:bg-sidebar-accent flex items-center justify-center rounded-full p-1",
1290
- "aria-label": t("nav_close"),
1291
- children: /* @__PURE__ */ jsx(X, { className: "size-5" })
1292
- })]
1293
- }), /* @__PURE__ */ jsx("div", {
1294
- className: "px-2 pb-4",
1295
- children: overflowItems.map((item) => {
1296
- return /* @__PURE__ */ jsxs("button", {
1297
- type: "button",
1298
- onClick: () => handleItemClick(item),
1299
- className: `flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors ${isInSection(item, currentSlug) ? "bg-sidebar-primary text-sidebar-primary-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent"}`,
1300
- children: [/* @__PURE__ */ jsx(RepIcon, {
1301
- name: item.icon || "file",
1302
- className: "size-5"
1303
- }), /* @__PURE__ */ jsx("span", { children: translateNavLabel(shellApi, item.slug, item.label) })]
1304
- }, item.id ?? item.slug ?? item.label);
1305
- })
1306
- })]
1307
- })]
1274
+ }), /* @__PURE__ */ jsx(MobileBottomSheet, {
1275
+ open: moreOpen,
1276
+ onOpenChange: setMoreOpen,
1277
+ title: t("nav_more"),
1278
+ surface: "sidebar",
1279
+ children: overflowItems.map((item) => {
1280
+ return /* @__PURE__ */ jsxs("button", {
1281
+ type: "button",
1282
+ onClick: () => handleItemClick(item),
1283
+ className: `flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors ${isInSection(item, currentSlug) ? "bg-sidebar-primary text-sidebar-primary-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent"}`,
1284
+ children: [/* @__PURE__ */ jsx(RepIcon, {
1285
+ name: item.icon || "file",
1286
+ className: "size-5"
1287
+ }), /* @__PURE__ */ jsx("span", { children: translateNavLabel(shellApi, item.slug, item.label) })]
1288
+ }, item.id ?? item.slug ?? item.label);
1289
+ })
1308
1290
  })] });
1309
1291
  }
1310
1292
  //#endregion
@@ -1580,7 +1562,7 @@ function SdkHeader({ mobileTabs, currentSlug, title, onBack, onNavigate, onLogou
1580
1562
  icon: ChevronLeft,
1581
1563
  "aria-label": t("nav_back"),
1582
1564
  onClick: onBack,
1583
- className: "-ml-1 flex-none"
1565
+ className: "border-border/60 bg-background/70 -ml-1 flex-none rounded-full border shadow-sm backdrop-blur-md transition-transform active:scale-95 [&_svg]:size-5"
1584
1566
  }) : null,
1585
1567
  resolvedTitle ? /* @__PURE__ */ jsx("h1", {
1586
1568
  className: "text-sidebar-foreground min-w-0 flex-1 truncate text-[17px] leading-tight font-semibold tracking-[-0.01em]",