nexus-shared 1.0.7 → 1.0.8

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/USER-GUIDE.md CHANGED
@@ -96,13 +96,22 @@ await HideLoader();
96
96
 
97
97
  ### Global layout (Next.js)
98
98
 
99
+ `next/font` must run in your app (not inside the pre-built package). Define the font in `app/layout.tsx` and pass `className` to `GlobalLayout`:
100
+
99
101
  ```tsx
100
- import { GlobalLayout, GetGlobalLayout } from "nexus.core";
102
+ import { Inter } from "next/font/google";
103
+ import { DEFAULT_FONT_WEIGHTS, GlobalLayout, GetGlobalLayout } from "nexus.core";
104
+
105
+ const inter = Inter({ weight: DEFAULT_FONT_WEIGHTS, subsets: ["latin"] });
101
106
 
102
107
  const globalLayout = GetGlobalLayout(/* … */);
103
108
 
104
109
  export default function RootLayout({ children }: { children: React.ReactNode }) {
105
- return <GlobalLayout globalLayout={globalLayout}>{children}</GlobalLayout>;
110
+ return (
111
+ <GlobalLayout globalLayout={globalLayout} bodyClassName={inter.className}>
112
+ {children}
113
+ </GlobalLayout>
114
+ );
106
115
  }
107
116
  ```
108
117
 
package/dist/index.cjs CHANGED
@@ -2609,7 +2609,6 @@ var LayoutHelpers = ({ globalLayout }) => {
2609
2609
  }, []);
2610
2610
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nexus-popup-container" });
2611
2611
  };
2612
- var INTER_FONT = google.Inter({ weight: ["300", "400", "500", "600", "700", "800"], subsets: ["latin"] });
2613
2612
  var GlobalLayout = async ({ children, globalLayout }) => {
2614
2613
  return /* @__PURE__ */ jsxRuntime.jsxs("html", { lang: "en", children: [
2615
2614
  /* @__PURE__ */ jsxRuntime.jsxs("head", { children: [
@@ -2620,7 +2619,7 @@ var GlobalLayout = async ({ children, globalLayout }) => {
2620
2619
  /* @__PURE__ */ jsxRuntime.jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }),
2621
2620
  /* @__PURE__ */ jsxRuntime.jsx("style", { id: "nexus-styles" })
2622
2621
  ] }),
2623
- /* @__PURE__ */ jsxRuntime.jsxs("body", { className: INTER_FONT.className, children: [
2622
+ /* @__PURE__ */ jsxRuntime.jsxs("body", { className: google.Inter({ weight: ["300", "400", "500", "600", "700", "800"], subsets: ["latin"] }).className, children: [
2624
2623
  /* @__PURE__ */ jsxRuntime.jsx(LayoutHelpers, { globalLayout }),
2625
2624
  /* @__PURE__ */ jsxRuntime.jsx(
2626
2625
  "div",
@@ -2960,7 +2959,6 @@ exports.GlobalDialogbox = GlobalDialogbox;
2960
2959
  exports.GlobalLayout = GlobalLayout;
2961
2960
  exports.HasFlag = HasFlag;
2962
2961
  exports.HideLoader = HideLoader;
2963
- exports.INTER_FONT = INTER_FONT;
2964
2962
  exports.Icon = Icon;
2965
2963
  exports.Iconbox = Iconbox;
2966
2964
  exports.InitializeDialogbox = InitializeDialogbox;