@evinvest/uikit 0.4.0 → 0.5.0
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 +15 -1
- package/dist/index.js +19 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -344,6 +344,8 @@ interface HeaderNavItem {
|
|
|
344
344
|
label: string;
|
|
345
345
|
href: string;
|
|
346
346
|
}
|
|
347
|
+
/** Chrome density preset — see the `variant` prop on {@link HeaderProps}. */
|
|
348
|
+
type HeaderVariant = "marketing" | "compact";
|
|
347
349
|
interface HeaderProps {
|
|
348
350
|
nav: readonly HeaderNavItem[];
|
|
349
351
|
/** Right-side call-to-action slot; also re-rendered at the mobile menu's bottom. */
|
|
@@ -354,8 +356,20 @@ interface HeaderProps {
|
|
|
354
356
|
homeHref?: string;
|
|
355
357
|
className?: string;
|
|
356
358
|
linkComponent?: React.ElementType;
|
|
359
|
+
/**
|
|
360
|
+
* Chrome density, per host surface.
|
|
361
|
+
* - `"marketing"` (default): the scroll-aware bar — tall and transparent over a
|
|
362
|
+
* hero, condensing to an opaque blurred bar past 50px.
|
|
363
|
+
* - `"compact"`: a fixed short, opaque bar for app surfaces (e.g. the cabinet)
|
|
364
|
+
* whose content sits directly beneath it — no scroll growth, so a sticky
|
|
365
|
+
* sidebar can butt flush against a known 4rem height.
|
|
366
|
+
*/
|
|
367
|
+
variant?: HeaderVariant;
|
|
368
|
+
/** Drop the primary nav — the desktop row and the mobile menu — keeping only the
|
|
369
|
+
* lockup and CTA. The lockup still links home. */
|
|
370
|
+
hideNav?: boolean;
|
|
357
371
|
}
|
|
358
|
-
declare function Header({ nav, cta, mobileCta, tagline, homeHref, className, linkComponent, }: HeaderProps): React.JSX.Element;
|
|
372
|
+
declare function Header({ nav, cta, mobileCta, tagline, homeHref, className, linkComponent, variant, hideNav, }: HeaderProps): React.JSX.Element;
|
|
359
373
|
|
|
360
374
|
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
361
375
|
|
package/dist/index.js
CHANGED
|
@@ -1183,25 +1183,37 @@ function Header({
|
|
|
1183
1183
|
tagline = "Quy Nhon Fund",
|
|
1184
1184
|
homeHref = "/",
|
|
1185
1185
|
className,
|
|
1186
|
-
linkComponent
|
|
1186
|
+
linkComponent,
|
|
1187
|
+
variant = "marketing",
|
|
1188
|
+
hideNav = false
|
|
1187
1189
|
}) {
|
|
1188
1190
|
const L = linkComponent ?? "a";
|
|
1191
|
+
const compact = variant === "compact";
|
|
1189
1192
|
const [hasScrolled, setHasScrolled] = React23.useState(false);
|
|
1190
1193
|
React23.useEffect(() => {
|
|
1194
|
+
if (compact) return;
|
|
1191
1195
|
const handleScroll = () => setHasScrolled(window.scrollY > 50);
|
|
1192
1196
|
window.addEventListener("scroll", handleScroll);
|
|
1193
1197
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
1194
|
-
}, []);
|
|
1198
|
+
}, [compact]);
|
|
1195
1199
|
return /* @__PURE__ */ jsx14(
|
|
1196
1200
|
"header",
|
|
1197
1201
|
{
|
|
1198
1202
|
"data-slot": "header",
|
|
1203
|
+
"data-variant": variant,
|
|
1199
1204
|
className: cn(
|
|
1200
|
-
"fixed top-0 left-0 w-full z-[60]
|
|
1201
|
-
|
|
1205
|
+
"fixed top-0 left-0 w-full z-[60] border-b",
|
|
1206
|
+
compact ? (
|
|
1207
|
+
// Fixed 4rem bar (py-3 + the 40px lockup): opaque by default so app
|
|
1208
|
+
// content beneath it never bleeds through.
|
|
1209
|
+
"h-16 bg-main-black/90 backdrop-blur-md border-main-mist/10"
|
|
1210
|
+
) : cn(
|
|
1211
|
+
"transition-all duration-500",
|
|
1212
|
+
hasScrolled ? "bg-main-black/90 backdrop-blur-md border-main-mist/10 py-4" : "bg-transparent border-transparent py-6"
|
|
1213
|
+
),
|
|
1202
1214
|
className
|
|
1203
1215
|
),
|
|
1204
|
-
children: /* @__PURE__ */ jsxs4(Container, { className: "flex items-center justify-between gap-4", children: [
|
|
1216
|
+
children: /* @__PURE__ */ jsxs4(Container, { className: "flex h-full items-center justify-between gap-4", children: [
|
|
1205
1217
|
/* @__PURE__ */ jsxs4(
|
|
1206
1218
|
L,
|
|
1207
1219
|
{
|
|
@@ -1217,7 +1229,7 @@ function Header({
|
|
|
1217
1229
|
]
|
|
1218
1230
|
}
|
|
1219
1231
|
),
|
|
1220
|
-
/* @__PURE__ */ jsx14("nav", { className: "hidden lg:flex items-center gap-6 font-mono-tech text-xs tracking-widest uppercase", children: nav.map((item) => /* @__PURE__ */ jsx14(
|
|
1232
|
+
!hideNav && /* @__PURE__ */ jsx14("nav", { className: "hidden lg:flex items-center gap-6 font-mono-tech text-xs tracking-widest uppercase", children: nav.map((item) => /* @__PURE__ */ jsx14(
|
|
1221
1233
|
L,
|
|
1222
1234
|
{
|
|
1223
1235
|
href: item.href,
|
|
@@ -1228,7 +1240,7 @@ function Header({
|
|
|
1228
1240
|
)) }),
|
|
1229
1241
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3", children: [
|
|
1230
1242
|
cta,
|
|
1231
|
-
/* @__PURE__ */ jsx14(MobileMenu, { nav, cta: mobileCta ?? cta, linkComponent: L })
|
|
1243
|
+
!hideNav && /* @__PURE__ */ jsx14(MobileMenu, { nav, cta: mobileCta ?? cta, linkComponent: L })
|
|
1232
1244
|
] })
|
|
1233
1245
|
] })
|
|
1234
1246
|
}
|