@ugurdemirel/landcraft 0.1.2 → 0.1.3
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +861 -857
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/MegaMenu.tsx +10 -1
package/package.json
CHANGED
|
@@ -49,6 +49,8 @@ export interface MegaMenuProps extends Omit<HTMLAttributes<HTMLElement>, "title"
|
|
|
49
49
|
/** Rendered at the right side of the bar (desktop) and inside the mobile panel. */
|
|
50
50
|
actions?: ReactNode;
|
|
51
51
|
cta?: ReactNode;
|
|
52
|
+
/** Optional language switcher rendered on the right (desktop) and beside the menu button (mobile). */
|
|
53
|
+
languageSwitcher?: ReactNode;
|
|
52
54
|
sticky?: boolean;
|
|
53
55
|
/** Component used to render brand, trigger and panel links. Defaults to `<a>`. Pass your router's `<Link>` (Next.js, Remix, React Router…) for framework-aware navigation. */
|
|
54
56
|
LinkComponent?: ElementType;
|
|
@@ -72,6 +74,7 @@ export const MegaMenu = ({
|
|
|
72
74
|
items,
|
|
73
75
|
actions,
|
|
74
76
|
cta,
|
|
77
|
+
languageSwitcher,
|
|
75
78
|
sticky = true,
|
|
76
79
|
LinkComponent,
|
|
77
80
|
onKeyDown,
|
|
@@ -323,10 +326,15 @@ export const MegaMenu = ({
|
|
|
323
326
|
</ul>
|
|
324
327
|
|
|
325
328
|
<div className="hidden items-center gap-3 lg:flex">
|
|
329
|
+
{languageSwitcher}
|
|
326
330
|
{actions}
|
|
327
331
|
{cta}
|
|
328
332
|
</div>
|
|
329
333
|
|
|
334
|
+
{languageSwitcher ? (
|
|
335
|
+
<div className="flex items-center lg:hidden">{languageSwitcher}</div>
|
|
336
|
+
) : null}
|
|
337
|
+
|
|
330
338
|
<button
|
|
331
339
|
type="button"
|
|
332
340
|
aria-label={mobileOpen ? "Close menu" : "Open menu"}
|
|
@@ -354,7 +362,8 @@ export const MegaMenu = ({
|
|
|
354
362
|
aria-label={`${item.label} menu`}
|
|
355
363
|
onMouseEnter={() => setOpenIndex(i)}
|
|
356
364
|
className={cn(
|
|
357
|
-
"absolute
|
|
365
|
+
"absolute top-full z-50 pt-2 transition-all duration-150",
|
|
366
|
+
variant === "floating" ? "inset-x-0 mx-auto w-full max-w-5xl" : "inset-x-0",
|
|
358
367
|
open
|
|
359
368
|
? "visible translate-y-0 opacity-100"
|
|
360
369
|
: "pointer-events-none invisible -translate-y-1 opacity-0",
|