@fluid-app/portal-sdk 0.1.138 → 0.1.140

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.cjs CHANGED
@@ -56,7 +56,7 @@ require("./portal-tenant-product-media-adapter-DmH2iJvp.cjs");
56
56
  require("./dist-BF_4vk1z.cjs");
57
57
  const require_ProductsScreen = require("./ProductsScreen-CdkcbVlB.cjs");
58
58
  const require_MySiteScreen = require("./MySiteScreen-DVjRy-nI.cjs");
59
- const require_ShopScreen = require("./ShopScreen-ZRlRj9cR.cjs");
59
+ const require_ShopScreen = require("./ShopScreen-3Z-9TKeI.cjs");
60
60
  require("./UpgradeScreen-CfTaMZiR.cjs");
61
61
  require("./AppDownloadScreen-CO-wctCB.cjs");
62
62
  let react = require("react");
@@ -1742,46 +1742,26 @@ function filterRepOnlySections(sections) {
1742
1742
  //#region src/shell/QuickLinksDropdown.tsx
1743
1743
  function QuickLinksDropdown({ onNavigate }) {
1744
1744
  const [open, setOpen] = (0, react.useState)(false);
1745
- const panelRef = (0, react.useRef)(null);
1746
- const buttonRef = (0, react.useRef)(null);
1747
- const close = (0, react.useCallback)(() => setOpen(false), []);
1748
- (0, react.useEffect)(() => {
1749
- if (!open) return;
1750
- const handleMouseDown = (e) => {
1751
- if (panelRef.current && !panelRef.current.contains(e.target) && buttonRef.current && !buttonRef.current.contains(e.target)) close();
1752
- };
1753
- const handleKeyDown = (e) => {
1754
- if (e.key === "Escape") close();
1755
- };
1756
- document.addEventListener("mousedown", handleMouseDown);
1757
- document.addEventListener("keydown", handleKeyDown);
1758
- return () => {
1759
- document.removeEventListener("mousedown", handleMouseDown);
1760
- document.removeEventListener("keydown", handleKeyDown);
1761
- };
1762
- }, [open, close]);
1763
1745
  const { isCustomer } = require_ShareablesScreen.useUserType();
1764
1746
  const sections = (0, react.useMemo)(() => {
1765
1747
  const all = getSystemNavigationBySection();
1766
1748
  return isCustomer ? filterRepOnlySections(all) : all;
1767
1749
  }, [isCustomer]);
1768
- const handleItemClick = (slug) => {
1769
- onNavigate(slug);
1770
- close();
1771
- };
1772
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1773
- className: "relative",
1774
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1775
- ref: buttonRef,
1776
- type: "button",
1777
- onClick: () => setOpen((prev) => !prev),
1778
- className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex shrink-0 items-center justify-center rounded-md p-2",
1779
- "aria-label": "Quick links",
1780
- "aria-expanded": open,
1781
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LayoutGrid, { className: "h-4 w-4" })
1782
- }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1783
- ref: panelRef,
1784
- className: "border-border bg-background absolute top-full right-0 z-50 mt-1 w-[700px] max-w-[90vw] overflow-hidden rounded-lg border shadow-lg",
1750
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Popover, {
1751
+ open,
1752
+ onOpenChange: setOpen,
1753
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.PopoverTrigger, {
1754
+ asChild: true,
1755
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
1756
+ variant: "ghost",
1757
+ size: "sm",
1758
+ className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0",
1759
+ "aria-label": "Quick links",
1760
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LayoutGrid, { className: "h-4 w-4" })
1761
+ })
1762
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.PopoverContent, {
1763
+ align: "end",
1764
+ className: "w-175 max-w-[90vw] overflow-hidden rounded-lg p-0 shadow-lg",
1785
1765
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1786
1766
  className: "flex flex-col",
1787
1767
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -1799,13 +1779,16 @@ function QuickLinksDropdown({ onNavigate }) {
1799
1779
  children: sectionName
1800
1780
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1801
1781
  className: "grid grid-cols-4 gap-2",
1802
- children: items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1803
- type: "button",
1804
- onClick: () => handleItemClick(item.slug),
1805
- className: "text-sidebar-foreground hover:bg-sidebar-primary hover:text-sidebar-primary-foreground flex items-center gap-2 rounded-lg px-3 py-2 text-sm transition-colors",
1782
+ children: items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
1783
+ variant: "ghost",
1784
+ className: "text-sidebar-foreground hover:bg-sidebar-primary hover:text-sidebar-primary-foreground h-auto justify-start gap-2 rounded-lg px-3 py-2 text-sm",
1785
+ onClick: () => {
1786
+ if (item.slug) onNavigate(item.slug);
1787
+ setOpen(false);
1788
+ },
1806
1789
  children: [item.icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RepIcon, {
1807
1790
  name: item.icon,
1808
- className: "text-muted-foreground h-4 w-4 shrink-0"
1791
+ className: "h-4 w-4 shrink-0"
1809
1792
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1810
1793
  className: "truncate",
1811
1794
  children: item.label
@@ -1833,12 +1816,12 @@ function SdkMobileQuickLinksGrid({ onNavigate }) {
1833
1816
  children: sectionName
1834
1817
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1835
1818
  className: "grid grid-cols-3 gap-2",
1836
- children: items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1837
- type: "button",
1819
+ children: items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Button, {
1820
+ variant: "ghost",
1821
+ className: "text-sidebar-foreground hover:bg-sidebar-primary hover:text-sidebar-primary-foreground h-auto flex-col gap-1 rounded-lg p-2",
1838
1822
  onClick: () => {
1839
1823
  if (item.slug) onNavigate(item.slug);
1840
1824
  },
1841
- className: "text-sidebar-foreground hover:bg-sidebar-primary hover:text-sidebar-primary-foreground flex h-auto flex-col items-center gap-1 rounded-lg p-2",
1842
1825
  children: [item.icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RepIcon, {
1843
1826
  name: item.icon,
1844
1827
  className: "size-5"
@@ -3006,7 +2989,7 @@ const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => requir
3006
2989
  const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-BK8qvbi5.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
3007
2990
  const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-BsABB4tn.cjs")).then((m) => ({ default: m.MessagingScreen })));
3008
2991
  const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-Ch84WukS.cjs")).then((m) => ({ default: m.ContactsScreen })));
3009
- const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-24JSOKXO.cjs")).then((m) => ({ default: m.ShopScreen })));
2992
+ const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-Bit0Fdgr.cjs")).then((m) => ({ default: m.ShopScreen })));
3010
2993
  const CustomersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./CustomersScreen-9f10-_AZ.cjs")).then((n) => n.CustomersScreen_exports).then((m) => ({ default: m.CustomersScreen })));
3011
2994
  const ProductsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProductsScreen-DTpNKgt-.cjs")).then((m) => ({ default: m.ProductsScreen })));
3012
2995
  const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-DAyoNLBd.cjs")).then((m) => ({ default: m.ShareablesScreen })));
@@ -4486,7 +4469,7 @@ const screenPropertySchemas = {
4486
4469
  ProductsScreen: () => Promise.resolve().then(() => require("./ProductsScreen-DTpNKgt-.cjs")).then((m) => m.productsScreenPropertySchema),
4487
4470
  MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-BTF8MZCU.cjs")).then((m) => m.mySiteScreenPropertySchema),
4488
4471
  ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-DAyoNLBd.cjs")).then((m) => m.shareablesScreenPropertySchema),
4489
- ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-24JSOKXO.cjs")).then((m) => m.shopScreenPropertySchema),
4472
+ ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-Bit0Fdgr.cjs")).then((m) => m.shopScreenPropertySchema),
4490
4473
  UpgradeScreen: () => Promise.resolve().then(() => require("./UpgradeScreen-DqarV2BI.cjs")).then((m) => m.upgradeScreenPropertySchema),
4491
4474
  AppDownloadScreen: () => Promise.resolve().then(() => require("./AppDownloadScreen-nz3fgOVF.cjs")).then((m) => m.appDownloadScreenPropertySchema)
4492
4475
  };