@geomak/ui 6.1.0 → 6.2.1

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
@@ -13,6 +13,7 @@ var Accordion = require('@radix-ui/react-accordion');
13
13
  var ContextMenuPrimitive = require('@radix-ui/react-context-menu');
14
14
  var Popover = require('@radix-ui/react-popover');
15
15
  var SwitchPrimitive = require('@radix-ui/react-switch');
16
+ var NavigationMenu = require('@radix-ui/react-navigation-menu');
16
17
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
17
18
  var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
18
19
  var ToggleGroup = require('@radix-ui/react-toggle-group');
@@ -47,6 +48,7 @@ var Accordion__namespace = /*#__PURE__*/_interopNamespace(Accordion);
47
48
  var ContextMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(ContextMenuPrimitive);
48
49
  var Popover__namespace = /*#__PURE__*/_interopNamespace(Popover);
49
50
  var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
51
+ var NavigationMenu__namespace = /*#__PURE__*/_interopNamespace(NavigationMenu);
50
52
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
51
53
  var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
52
54
  var ToggleGroup__namespace = /*#__PURE__*/_interopNamespace(ToggleGroup);
@@ -3421,6 +3423,106 @@ function Sidebar({
3421
3423
  }
3422
3424
  ) });
3423
3425
  }
3426
+ var MegaMenuContext = React8.createContext({ align: "start" });
3427
+ function MegaMenu({ children, align = "start", delayDuration = 200, className = "", style, "aria-label": ariaLabel }) {
3428
+ return /* @__PURE__ */ jsxRuntime.jsx(MegaMenuContext.Provider, { value: { align }, children: /* @__PURE__ */ jsxRuntime.jsx(
3429
+ NavigationMenu__namespace.Root,
3430
+ {
3431
+ delayDuration,
3432
+ "aria-label": ariaLabel,
3433
+ className: ["relative z-10 flex w-full", className].filter(Boolean).join(" "),
3434
+ style,
3435
+ children: /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu__namespace.List, { className: "flex items-center gap-1", children })
3436
+ }
3437
+ ) });
3438
+ }
3439
+ var TOP_ITEM = "group/top inline-flex items-center gap-1.5 h-10 px-3 rounded-md text-sm font-medium select-none text-foreground-secondary hover:text-foreground hover:bg-surface-raised data-[state=open]:text-accent data-[active]:text-accent transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent";
3440
+ function MegaMenuItem({ label, icon, href, children, className = "" }) {
3441
+ const { align } = React8.useContext(MegaMenuContext);
3442
+ const pos = align === "center" ? "left-1/2 -translate-x-1/2" : align === "end" ? "right-0" : "left-0";
3443
+ if (!children) {
3444
+ return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu__namespace.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu__namespace.Link, { href, className: [TOP_ITEM, className].filter(Boolean).join(" "), children: [
3445
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center", children: icon }),
3446
+ label
3447
+ ] }) });
3448
+ }
3449
+ return /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu__namespace.Item, { children: [
3450
+ /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu__namespace.Trigger, { className: [TOP_ITEM, className].filter(Boolean).join(" "), children: [
3451
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center", children: icon }),
3452
+ label,
3453
+ /* @__PURE__ */ jsxRuntime.jsx(
3454
+ "svg",
3455
+ {
3456
+ viewBox: "0 0 24 24",
3457
+ fill: "none",
3458
+ stroke: "currentColor",
3459
+ strokeWidth: 2,
3460
+ "aria-hidden": "true",
3461
+ className: "h-3.5 w-3.5 text-foreground-muted transition-transform duration-200 group-data-[state=open]/top:rotate-180 group-data-[state=open]/top:text-accent",
3462
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
3463
+ }
3464
+ )
3465
+ ] }),
3466
+ /* @__PURE__ */ jsxRuntime.jsx(
3467
+ NavigationMenu__namespace.Content,
3468
+ {
3469
+ className: `absolute top-full mt-2 ${pos} z-20 overflow-hidden rounded-lg border border-border bg-surface shadow-lg
3470
+ data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95
3471
+ data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,
3472
+ children
3473
+ }
3474
+ )
3475
+ ] });
3476
+ }
3477
+ function MegaMenuPanel({ children, columns, className = "", style }) {
3478
+ const maxWidth = columns ? `${columns * 248}px` : "min(92vw, 880px)";
3479
+ return /* @__PURE__ */ jsxRuntime.jsx(
3480
+ "div",
3481
+ {
3482
+ className: ["flex flex-wrap gap-6 p-6", className].filter(Boolean).join(" "),
3483
+ style: { maxWidth, ...style },
3484
+ children
3485
+ }
3486
+ );
3487
+ }
3488
+ function MegaMenuSection({ title, children, className = "" }) {
3489
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ["min-w-[200px] flex flex-col", className].filter(Boolean).join(" "), children: [
3490
+ title && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-3 pb-1.5 text-[11px] font-semibold uppercase tracking-widest text-foreground-muted select-none", children: title }),
3491
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-0.5", children })
3492
+ ] });
3493
+ }
3494
+ function MegaMenuLink({ href, icon, description, active, onClick, children, className = "" }) {
3495
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3496
+ NavigationMenu__namespace.Link,
3497
+ {
3498
+ active,
3499
+ href,
3500
+ onClick,
3501
+ className: [
3502
+ "group/link flex items-start gap-3 rounded-md p-3 transition-colors select-none",
3503
+ "hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
3504
+ "data-[active]:bg-surface-raised",
3505
+ className
3506
+ ].filter(Boolean).join(" "),
3507
+ children: [
3508
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-md bg-surface-raised text-accent group-hover/link:bg-surface group-data-[active]/link:bg-surface transition-colors", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-[18px] w-[18px] inline-flex items-center justify-center", children: icon }) }),
3509
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col min-w-0", children: [
3510
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground group-data-[active]/link:text-accent", children }),
3511
+ description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-foreground-muted leading-snug mt-0.5", children: description })
3512
+ ] })
3513
+ ]
3514
+ }
3515
+ );
3516
+ }
3517
+ function MegaMenuFeatured({ children, className = "" }) {
3518
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ["min-w-[220px] rounded-lg bg-surface-raised border border-border p-4 flex flex-col", className].filter(Boolean).join(" "), children });
3519
+ }
3520
+ MegaMenu.Item = MegaMenuItem;
3521
+ MegaMenu.Panel = MegaMenuPanel;
3522
+ MegaMenu.Section = MegaMenuSection;
3523
+ MegaMenu.Link = MegaMenuLink;
3524
+ MegaMenu.Featured = MegaMenuFeatured;
3525
+ var MegaMenu_default = MegaMenu;
3424
3526
  function AppShell({
3425
3527
  topBar,
3426
3528
  sidebarSections = [],
@@ -6897,6 +6999,7 @@ exports.Icon = icons_default;
6897
6999
  exports.IconButton = IconButton;
6898
7000
  exports.List = List2;
6899
7001
  exports.LoadingSpinner = LoadingSpinner;
7002
+ exports.MegaMenu = MegaMenu_default;
6900
7003
  exports.Modal = Modal;
6901
7004
  exports.NotificationProvider = NotificationProvider;
6902
7005
  exports.NumberInput = NumberInput;